diff --git a/apps/decoder.c b/apps/decoder.c index ca91fd1bf5332c0eb9102f0c214178d881481843..d28ce9f88fce4c9aab0e3e7243a5dfec0716b3db 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -117,17 +117,11 @@ typedef struct bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; -#ifdef NON_DIEGETIC_PAN int16_t Opt_non_diegetic_pan; float non_diegetic_pan_gain; -#else - float no_diegetic_pan; -#endif bool renderConfigEnabled; char *renderConfigFilename; -#ifdef COMPLEXITY_LEVEL_INDICATION IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; -#endif #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; @@ -227,17 +221,9 @@ int main( *------------------------------------------------------------------------------------------*/ #ifdef FIX_439_OTR_PARAMS -#ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Open( &hIvasDec, arg.decMode, arg.orientation_tracking, arg.no_diegetic_pan ) ) != IVAS_ERR_OK ) -#endif #endif { fprintf( stderr, "Open failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -404,17 +390,9 @@ int main( *------------------------------------------------------------------------------------------*/ #ifdef FIX_439_OTR_PARAMS -#ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled ) ) != IVAS_ERR_OK ) -#endif #endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -835,9 +813,7 @@ static bool parseCmdlIVAS_dec( arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->voipMode = false; -#ifdef COMPLEXITY_LEVEL_INDICATION arg->complexityLevel = IVAS_DEC_COMPLEXITY_LEVEL_THREE; -#endif arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; @@ -868,12 +844,8 @@ static bool parseCmdlIVAS_dec( arg->renderConfigFilename = NULL; arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; -#ifdef NON_DIEGETIC_PAN arg->Opt_non_diegetic_pan = 0; arg->non_diegetic_pan_gain = 0.f; -#else - arg->no_diegetic_pan = 0.f; -#endif #ifdef VARIABLE_SPEED_DECODING arg->variableSpeedMode = 0; arg->tsmScale = 100; @@ -1172,56 +1144,27 @@ static bool parseCmdlIVAS_dec( else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 ) { i++; -#ifdef NON_DIEGETIC_PAN arg->Opt_non_diegetic_pan = 1; -#else - if ( argc - i <= 4 || ( argv[i][0] == '-' ) ) - { - fprintf( stderr, "Error: Argument for panning option not specified!\n\n" ); - usage_dec(); - return false; - } -#endif strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; -#ifdef NON_DIEGETIC_PAN to_upper( argv_to_upper ); -#endif if ( ( strcmp( argv_to_upper, "CENTER" ) == 0 ) || ( strchr( argv_to_upper, 'C' ) != NULL ) ) { -#ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = 0.f; -#else - arg->no_diegetic_pan = 0.f; -#endif } else if ( ( strcmp( argv_to_upper, "LEFT" ) == 0 ) || ( strchr( argv_to_upper, 'L' ) != NULL ) ) { -#ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = 1.f; -#else - arg->no_diegetic_pan = 1.f; -#endif } else if ( ( strcmp( argv_to_upper, "RIGHT" ) == 0 ) || ( strchr( argv_to_upper, 'R' ) != NULL ) ) { -#ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = -1.f; -#else - arg->no_diegetic_pan = -1.f; -#endif } else { -#ifdef NON_DIEGETIC_PAN arg->non_diegetic_pan_gain = (float) atof( argv_to_upper ) / 90.f; if ( arg->non_diegetic_pan_gain > 1.0f || arg->non_diegetic_pan_gain < -1.0f ) -#else - arg->no_diegetic_pan = (float) atof( argv_to_upper ); - - if ( arg->no_diegetic_pan > 1.0f || arg->no_diegetic_pan < -1.0f ) -#endif { fprintf( stderr, "Error: Incorrect value for panning gain value specified: %s\n\n", argv[i] ); usage_dec(); @@ -1230,7 +1173,6 @@ static bool parseCmdlIVAS_dec( } i++; } -#ifdef COMPLEXITY_LEVEL_INDICATION else if ( strcmp( argv_to_upper, "-LEVEL" ) == 0 ) { int16_t level; @@ -1248,7 +1190,6 @@ static bool parseCmdlIVAS_dec( fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" ); } } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1277,25 +1218,21 @@ static bool parseCmdlIVAS_dec( arg->customLsSetupFilename = argv[i]; } i++; -#ifdef NON_DIEGETIC_PAN if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputFormat != IVAS_DEC_OUTPUT_STEREO ) ) { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); return false; } -#endif } else { arg->outputFormat = IVAS_DEC_OUTPUT_MONO; arg->decMode = IVAS_DEC_MODE_EVS; -#ifdef NON_DIEGETIC_PAN if ( ( arg->Opt_non_diegetic_pan ) ) { arg->outputFormat = IVAS_DEC_OUTPUT_STEREO; } -#endif } /*-----------------------------------------------------------------* @@ -1426,11 +1363,9 @@ static void usage_dec( void ) fprintf( stdout, " containing FEC pattern (short values of 0 (good) or 1 (bad))\n" ); fprintf( stdout, " default is OFF, if this option is not used\n" ); fprintf( stdout, "-force R : Force specific binaural rendering mode, R = (TDREND, CLDFBREND),\n" ); -#ifdef COMPLEXITY_LEVEL_INDICATION fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); #endif -#endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info : specify subfolder name for debug output\n" ); diff --git a/apps/encoder.c b/apps/encoder.c index a23970a27071d0604fba171cc5c6345c93793c03..df7c0915d4f6b5f1306d69b25b011cdc75ece738 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -111,9 +111,7 @@ typedef struct IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig; const char *ca_config_file; bool mimeOutput; -#ifdef COMPLEXITY_LEVEL_INDICATION IVAS_ENC_COMPLEXITY_LEVEL complexityLevel; -#endif #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; @@ -881,9 +879,7 @@ static void initArgStruct( EncArguments *arg ) arg->ca_config_file = NULL; arg->mimeOutput = false; arg->ism_extended_metadata = false; -#ifdef COMPLEXITY_LEVEL_INDICATION arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; -#endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; @@ -1136,31 +1132,18 @@ static bool parseCmdlIVAS_enc( { strncpy( stmp, argv[i], sizeof( stmp ) ); stmp[sizeof( stmp ) - 1] = '\0'; -#ifdef FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING to_upper( stmp ); if ( strcmp( stmp, "LO" ) == 0 ) -#else - to_upper( argv[i] ); - if ( strcmp( argv[i], "LO" ) == 0 ) -#endif { arg->caConfig.fec_indicator = IVAS_ENC_FEC_LO; } -#ifdef FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING else if ( strcmp( stmp, "HI" ) == 0 ) -#else - else if ( strcmp( argv[i], "HI" ) == 0 ) -#endif { arg->caConfig.fec_indicator = IVAS_ENC_FEC_HI; } else { -#ifdef FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING arg->ca_config_file = argv[i]; -#else - arg->ca_config_file = stmp; -#endif } i++; @@ -1197,7 +1180,6 @@ static bool parseCmdlIVAS_enc( } -#ifdef COMPLEXITY_LEVEL_INDICATION /*-----------------------------------------------------------------* * Complexity Level *-----------------------------------------------------------------*/ @@ -1220,7 +1202,6 @@ static bool parseCmdlIVAS_enc( fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" ); } } -#endif /*-----------------------------------------------------------------* * IVAS Formats diff --git a/apps/renderer.c b/apps/renderer.c index 4fcd3f92e1e90662bdea298892111fc7ba5e0c21..3ed5d4996e9fb6fcfc6ec21a70808f390d0d9278 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -140,12 +140,8 @@ typedef struct #else int8_t orientationTracking; #endif -#ifdef NON_DIEGETIC_PAN int16_t nonDiegeticPan; float nonDiegeticPanGain; -#else - float noDiegeticPan; -#endif bool delayCompensationEnabled; bool quietModeEnabled; bool sceneDescriptionInput; @@ -560,7 +556,6 @@ int main( CmdlnArgs args = parseCmdlnArgs( argc, argv ); -#ifdef NON_DIEGETIC_PAN if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_MONO ) || ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == IVAS_REND_AUDIO_CONFIG_OBJECT && args.inConfig.numAudioObjects == 1 ) ) ) { @@ -573,7 +568,6 @@ int main( fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" ); exit( -1 ); } -#endif positionProvider = IsmPositionProvider_open(); @@ -689,11 +683,7 @@ int main( IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; -#ifdef NON_DIEGETIC_PAN if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1366,7 +1356,6 @@ static bool parseOutConfig( return true; } -#ifdef NON_DIEGETIC_PAN static bool parseDiegeticPan( char *value, float *nonDiegeticPan ) @@ -1396,38 +1385,6 @@ static bool parseDiegeticPan( } } return true; - -#else -static bool parseDiegeticPan( - char *value, - float *noDiegeticPan ) -{ - to_upper( value ); - - if ( ( strcmp( value, "CENTER" ) == 0 ) || ( strchr( value, 'C' ) != NULL ) ) - { - *noDiegeticPan = 0.f; - } - else if ( ( strcmp( value, "LEFT" ) == 0 ) || ( strchr( value, 'L' ) != NULL ) ) - { - *noDiegeticPan = -1.f; - } - else if ( ( strcmp( value, "RIGHT" ) == 0 ) || ( strchr( value, 'R' ) != NULL ) ) - { - *noDiegeticPan = 1.f; - } - else - { - *noDiegeticPan = (float) atof( value ); - - if ( *noDiegeticPan > 1.0f || *noDiegeticPan < -1.0f ) - { - fprintf( stderr, "Error: Incorrect value for panning option argument specified!\n\n" ); - return false; - } - } - return false; -#endif } static bool parseOrientationTracking( @@ -1708,12 +1665,8 @@ static CmdlnArgs defaultArgs( #else args.orientationTracking = IVAS_ORIENT_TRK_NONE; #endif -#ifdef NON_DIEGETIC_PAN args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; -#else - args.noDiegeticPan = 0.0f; -#endif args.delayCompensationEnabled = true; args.quietModeEnabled = false; @@ -1805,18 +1758,12 @@ static void parseOption( break; case CmdLnOptionId_nonDiegeticPan: assert( numOptionValues == 1 ); -#ifdef NON_DIEGETIC_PAN if ( !parseDiegeticPan( optionValues[0], &args->nonDiegeticPanGain ) ) -#else - if ( !parseDiegeticPan( optionValues[0], &args->noDiegeticPan ) ) -#endif { fprintf( stderr, "Unknown option for diegetic panning: %s\n", optionValues[0] ); exit( -1 ); } -#ifdef NON_DIEGETIC_PAN args->nonDiegeticPan = 1; -#endif break; case CmdLnOptionId_orientationTracking: assert( numOptionValues == 1 ); @@ -1931,9 +1878,7 @@ void getMetadataFromFileReader( objectMetadataBuffer->positions[objIdx].radius = ismMetadata.radius; objectMetadataBuffer->positions[objIdx].yaw = ismMetadata.yaw; objectMetadataBuffer->positions[objIdx].pitch = ismMetadata.pitch; -#ifdef ISM_NON_DIEGETIC_PAN objectMetadataBuffer->positions[objIdx].non_diegetic_flag = ismMetadata.non_diegetic_flag; -#endif return; } @@ -1991,9 +1936,7 @@ static void IsmPositionProvider_getNextFrame( objectMetadataBuffer->positions[objIdx].radius = 1.0f; objectMetadataBuffer->positions[objIdx].yaw = 0.0f; objectMetadataBuffer->positions[objIdx].pitch = 0.0f; -#ifdef ISM_NON_DIEGETIC_PAN objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0; -#endif } /* Wrap azimuth to lie within (-180, 180] range */ @@ -2255,22 +2198,14 @@ static void parseObjectPosition( { char *endptr; int16_t read_values; -#ifdef ISM_NON_DIEGETIC_PAN float meta_prm[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f }; -#else - float meta_prm[7] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; -#endif readNextMetadataChunk( line, "," ); *positionDuration = (uint16_t) strtol( line, &endptr, 10 ); readNextMetadataChunk( line, "\n" ); -#ifdef ISM_NON_DIEGETIC_PAN read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6], &meta_prm[7] ); -#else - read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6] ); -#endif if ( read_values < 2 ) { @@ -2283,9 +2218,7 @@ static void parseObjectPosition( position->radius = meta_prm[2]; position->yaw = meta_prm[5]; position->pitch = meta_prm[6]; -#ifdef ISM_NON_DIEGETIC_PAN position->non_diegetic_flag = (int16_t) meta_prm[7]; -#endif return; } diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 86e1615d5a5a549ba4f4d7e59112b51cf7c195bc..d2aae93ed416c50f8086b2b43b62f32b1c7e9de6 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -2928,11 +2928,7 @@ ivas_error preview_indices( k = IVAS_FORMAT_SIGNALING_NBITS; if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef COMBINED_FORMAT_SIGNALING k = IVAS_FORMAT_SIGNALING_NBITS_EXTENDED; -#else - k = IVAS_FORMAT_SIGNALING_NBITS_SBA; -#endif } if ( total_brate < MIN_BRATE_MDCT_STEREO ) @@ -2972,15 +2968,9 @@ ivas_error preview_indices( else if ( st_ivas->ivas_format == SBA_FORMAT ) { /* Read SBA planar flag and SBA order */ -#ifdef COMBINED_FORMAT_SIGNALING st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_EXTENDED] == 1 ); st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_EXTENDED + 2] == 1 ); st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_EXTENDED + 1] == 1 ); -#else - st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 ); - st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 ); - st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 1] == 1 ); -#endif st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( total_brate, st_ivas->sba_order ); diff --git a/lib_com/cnst.h b/lib_com/cnst.h index a32d202419ea1b4bcf2d5957bba44fab39b6c330..d518dff0df3cce6bdc2ac6b56907403c49643e27 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -1433,11 +1433,7 @@ typedef enum _DCTTYPE #define CNA_MAX_BRATE ACELP_13k20 -#ifdef FIX_I414_OOA_CNA #define CNA_INIT_NBANDS 6 -#else -#define MAX_CNA_NBANDS 12 -#endif #define GAIN_Q_OFFSET_EVS 60.f #define GAIN_Q_OFFSET_IVAS 45.f @@ -1535,9 +1531,7 @@ typedef enum _DCTTYPE #define TOD_NSPEC 80 /* number of spectral bins of the tonal detector */ #define TOD_THR_MASS 0.86f /* initial value for the adaptive threshold of the tonal detector */ #define P2A_FACT 0.9f /* long-term averaging factor for peak-to-average ratio */ -#ifdef FIX_SP2A #define THR_P2A_HIGH 95.0f /* higher threshold to detect strongly peaky signals at low bitrates*/ -#endif #define THR_P2A 80.0f /* lower threshold to detect strongly peaky signals at higher bitrates */ /*----------------------------------------------------------------------------------* diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 3b9a3319085acdb16b34bd4354aa3ca7171d51d0..33ddc9e881d865970af564c2b21c974af44c6844 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -80,9 +80,7 @@ typedef struct _IVAS_ISM_METADATA float gainFactor; float yaw; float pitch; -#ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag; -#endif } IVAS_ISM_METADATA; typedef struct @@ -131,9 +129,7 @@ typedef struct float radius; float yaw; float pitch; -#ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag; -#endif } IVAS_REND_AudioObjectPosition; typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 5757b0c53d7e6d924080b4d6002efb44d3948846..6f42b17a403be04fad6d118480fd442b7330e6b8 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -78,11 +78,7 @@ typedef enum *----------------------------------------------------------------------------------*/ #define IVAS_FORMAT_SIGNALING_NBITS 2 /* number of bits for signaling the IVAS format */ -#ifdef COMBINED_FORMAT_SIGNALING #define IVAS_FORMAT_SIGNALING_NBITS_EXTENDED ( IVAS_FORMAT_SIGNALING_NBITS + 1 ) -#else -#define IVAS_FORMAT_SIGNALING_NBITS_SBA ( IVAS_FORMAT_SIGNALING_NBITS + 1 ) -#endif /*----------------------------------------------------------------------------------* @@ -156,12 +152,8 @@ typedef enum RENDERER_MCMASA_MONO_STEREO, RENDERER_PARAM_ISM, RENDERER_BINAURAL_MIXER_CONV, -#if defined NON_DIEGETIC_PAN || defined ISM_NON_DIEGETIC_PAN RENDERER_BINAURAL_MIXER_CONV_ROOM, RENDERER_NON_DIEGETIC_DOWNMIX -#else - RENDERER_BINAURAL_MIXER_CONV_ROOM -#endif } RENDERER_TYPE; @@ -175,16 +167,12 @@ typedef enum #define HEAD_ROTATION_HOA_ORDER 3 /* HOA 3rd order */ #define MAX_CICP_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts)*/ #define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order) */ -#ifdef NON_DIEGETIC_PAN #define MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN 2 /* Maximum number of output channels with non diegetic panning */ -#endif #define BINAURAL_CHANNELS 2 /* number of channels for binaural output configuration */ #define CPE_CHANNELS 2 /* number of CPE (stereo) channels */ #define FOA_CHANNELS 4 /* number of FOA channels */ -#ifdef HODIRAC #define HOA2_CHANNELS 9 -#endif #define MAX_NUM_OBJECTS 4 /* max. number of audio objects */ @@ -366,9 +354,7 @@ typedef enum #define ISM_RADIUS_MIN 0.0f #define ISM_RADIUS_DELTA 0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ #define ISM_EXTENDED_METADATA_BRATE IVAS_64k -#ifdef ISM_NON_DIEGETIC_PAN #define ISM_METADATA_IS_NDP_BITS 1 -#endif #define ISM_EXTENDED_METADATA_BITS 1 #define ISM_METADATA_RS_MAX_FRAMES 5 /* Number of frames with opposite extended metadata flags before switching */ @@ -410,9 +396,7 @@ enum { IND_ISM_NUM_OBJECTS, IND_ISM_EXTENDED_FLAG = IND_ISM_NUM_OBJECTS + MAX_NUM_OBJECTS, -#ifdef ISM_NON_DIEGETIC_PAN IND_ISM_EXTENDED_NDP_FLAG, -#endif IND_ISM_METADATA_FLAG, IND_ISM_VAD_FLAG = IND_ISM_METADATA_FLAG + MAX_NUM_OBJECTS, IND_ISM_NOISY_SPEECH_FLAG = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS, @@ -421,9 +405,7 @@ enum /* ------------- loop for objects -------------- */ TAG_ISM_LOOP_START = IND_ISM_DTX_COH_SCA + MAX_NUM_OBJECTS, -#ifdef ISM_NON_DIEGETIC_PAN IND_ISM_NDP_FLAG = TAG_ISM_LOOP_START, -#endif IND_ISM_AZIMUTH_DIFF_FLAG = TAG_ISM_LOOP_START, IND_ISM_AZIMUTH = TAG_ISM_LOOP_START, IND_ISM_ELEVATION_DIFF_FLAG = TAG_ISM_LOOP_START, @@ -876,18 +858,14 @@ enum fea_names #define SNS_LOW_BR_MODE -1 #define SNS_NPTS 16 /* Number of downsampled SNS parameters */ -#ifdef SNS_MSVQ #define SNS_STEREO_MODE_LR 0 #define SNS_STEREO_MODE_MS 1 #define SNS_STEREO_MODE_OFFSET_INDICES 4 #define SNS_MSVQ_NSTAGES_TCX20 4 #define SNS_MSVQ_NSTAGES_TCX10 3 #define SNS_MSVQ_NSTAGES_SIDE 2 -#endif -#ifdef FIX_445_SNS_BUGFIXES #define SNS_CDBKS_BITS_4_FRAC 12 #define SNS_MEANS_BITS_4_FRAC 14 -#endif #define MDCT_ST_PLC_FADEOUT_MIN_NOISE_NRG 0.001f #define MDCT_ST_PLC_FADEOUT_MAX_CONC_FRAME 2 * FRAMES_PER_SEC @@ -922,9 +900,7 @@ typedef enum { // VE: this should be renamed to e.g. N_SPATIAL_SUBFRAMES #define MAX_PARAM_SPATIAL_SUBFRAMES 4 /* Maximum number of subframes for parameteric spatial coding */ #define L_SPATIAL_SUBFR_48k (L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES) -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #define CLDFB_SLOTS_PER_SUBFRAME ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ) /* Number of CLDFB slots per subframe */ -#endif /*----------------------------------------------------------------------------------* @@ -955,11 +931,7 @@ typedef enum * DirAC Constants *----------------------------------------------------------------------------------*/ -#ifdef HODIRAC #define DIRAC_MAX_ANA_CHANS 11 /* Maximum number of channels for DirAC analysis */ -#else -#define DIRAC_MAX_ANA_CHANS FOA_CHANNELS /* Maximum number of channels for DirAC analysis */ -#endif #define DIRAC_NUM_DIMS 3 /* number of directions to estimate (X,Y,Z) */ #define DIRAC_MAX_NBANDS 12 /* Maximum number of frequency bands for the DirAC Side Parameter decoding */ @@ -973,10 +945,8 @@ typedef enum #define DIRAC_NO_FB_BANDS_MAX MDFT_FB_BANDS_240 #define DELAY_DIRAC_ENC_CMP_NS_PARAM_ISM ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) /* == 12 ms */ -#ifdef HODIRAC #define DIRAC_HO_NUMSECTORS 2 #define NUM_ANA_SECTORS 2 -#endif /* DirAC renderer setup */ @@ -1036,16 +1006,10 @@ typedef enum #define SPAR_CONFIG_BW FB -#ifndef HODIRAC -#define IVAS_SPAR_MAX_CH (FOA_CHANNELS + 2 * ( IVAS_MAX_SBA_ORDER - 1 )) /* FOA + planar HOA */ -#else #define IVAS_SPAR_MAX_CH ((( IVAS_MAX_SBA_ORDER ) * ( IVAS_MAX_SBA_ORDER )) + 2) /* HOA2 + pHOA3*/ #define IVAS_HBR_MAX_DECOR_CHS (2) -#endif -#ifdef HODIRAC #define IVAS_SPAR_MAX_FB_IN_CHAN 11 -#endif #define IVAS_SPAR_P_LOWERTRI ((IVAS_SPAR_MAX_CH - 1) * (IVAS_SPAR_MAX_CH - 2)) >> 1 #define IVAS_SPAR_MAX_C_COEFF (IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS) * ( IVAS_SPAR_MAX_DMX_CHS - 1) @@ -1254,9 +1218,7 @@ enum #define MASA_ANGLE_TOLERANCE 0.5f #define MASA_LIMIT_NO_BANDS_SUR_COH 8 #define MINIMUM_BIT_BUDGET_NORMAL_META 100 -#ifdef HODIRAC #define DIFF_DFRATIO_2BIT_LIMIT_IDX_HODIRAC 4 -#endif #define DIFF_DFRATIO_2BIT_LIMIT_IDX 3 #define DIFF_DFRATIO_1BIT_LIMIT_IDX 6 @@ -1306,12 +1268,8 @@ typedef enum MC_MODE_NONE, MC_MODE_MCT, MC_MODE_PARAMMC, -#ifndef MC_PARAMUPMIX_MODE - MC_MODE_MCMASA -#else MC_MODE_MCMASA, MC_MODE_PARAMUPMIX -#endif } MC_MODE; typedef enum @@ -1371,7 +1329,6 @@ typedef enum MCT_CHAN_MODE_IGNORE } MCT_CHAN_MODE; -#ifdef MC_PARAMUPMIX_MODE /*----------------------------------------------------------------------------------* * MC Param-Upmix Mode Constants *----------------------------------------------------------------------------------*/ @@ -1421,7 +1378,6 @@ typedef struct } HUFF_NODE_TABLE; -#endif /*----------------------------------------------------------------------------------* * Parametric MC Constants *----------------------------------------------------------------------------------*/ @@ -1473,9 +1429,7 @@ typedef enum #define PARAM_MC_BAND_TO_MDCT_BAND_RATIO 16 /* Ratio of resolution of CLDFB Bands to MDCT Bands */ #define PARAM_MC_SLOT_ENC_NS 2500000L #define PARAM_MC_MDFT_NO_SLOTS 8 -#ifdef PARAMMC_SHORT_ENC_MDFT #define PARAM_MC_CLDFB_TO_MDFT_FAC 2 -#endif /*----------------------------------------------------------------------------------* * LFE Coding Constants @@ -1596,11 +1550,7 @@ typedef enum #define SFX_SPAT_BIN_NUM_SUBSAMPLES 64 #define ITD_MEM_LEN (MAX_ITD + SFX_SPAT_BIN_SINC_M) #define L_SUBFRAME5MS_48k (L_FRAME48k/4) -#ifdef FIX_421_TD_INT_TUNE #define MAX_ANGULAR_STEP (0.01f) -#else -#define MAX_ANGULAR_STEP (1.0f) -#endif #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 @@ -1621,12 +1571,8 @@ typedef enum typedef enum { TDREND_PLAYSTATUS_INITIAL, -#ifdef ISM_NON_DIEGETIC_PAN TDREND_PLAYSTATUS_PLAYING, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC -#else - TDREND_PLAYSTATUS_PLAYING -#endif } TDREND_PlayStatus_t; typedef enum @@ -1696,9 +1642,7 @@ typedef enum #define IVAS_320_PT_LEN 320 #define IVAS_240_PT_LEN 240 #define IVAS_160_PT_LEN 160 -#ifdef PARAMMC_SHORT_ENC_MDFT #define IVAS_120_PT_LEN 120 -#endif #define IVAS_80_PT_LEN 80 #define IVAS_40_PT_LEN 40 diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c index 7a2439660671bbdf529b1a62cc38dd159809f7ab..1860e6ac70cad5a82a3a76290368f46b027d6c41 100644 --- a/lib_com/ivas_cov_smooth.c +++ b/lib_com/ivas_cov_smooth.c @@ -50,12 +50,7 @@ static void ivas_set_up_cov_smoothing( ivas_cov_smooth_state_t *hCovState, ivas_filterbank_t *pFb, const float max_update_rate, - const int16_t min_pool_size -#ifndef FIX_331_ALL_BRS - , - const int16_t nchan_inp /* i : number of input channels */ -#endif - , + const int16_t min_pool_size, const int32_t ivas_total_brate ) { int16_t j, k; @@ -94,30 +89,6 @@ static void ivas_set_up_cov_smoothing( } } else -#ifndef FIX_331_ALL_BRS - if ( nchan_inp <= FOA_CHANNELS ) - { - for ( j = 0; j < pFb->filterbank_num_bands; j++ ) - { - float update_factor; - update_factor = 0.0f; - - for ( k = 0; k < pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; k++ ) - { - update_factor += pFb->fb_bin_to_band.pFb_bin_to_band[j][k]; - } - - hCovState->pSmoothing_factor[j] = update_factor / min_pool_size; - - if ( hCovState->pSmoothing_factor[j] > max_update_rate ) - { - hCovState->pSmoothing_factor[j] = max_update_rate; - } - } - } - else - { -#endif for ( j = 0; j < pFb->filterbank_num_bands; j++ ) { float update_factor; @@ -137,9 +108,6 @@ static void ivas_set_up_cov_smoothing( hCovState->pSmoothing_factor[j] = max_update_rate; } } -#ifndef FIX_331_ALL_BRS - } -#endif hCovState->prior_bank_idx = -1; return; @@ -187,11 +155,7 @@ ivas_error ivas_spar_covar_smooth_enc_open( } -#ifndef FIX_331_ALL_BRS - ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size, nchan_inp, ivas_total_brate ); -#else ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size, ivas_total_brate ); -#endif *hCovState_out = hCovState; diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index d0b4c5a4db1b3a37719ab466836e24645f3c1e2e..a5964edd6642dd7af34e6c2ee63154f2a43bcf48 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -49,7 +49,6 @@ static uint16_t deindex_sph_idx_general( const int16_t idx_sph, const int16_t no_bits, float *theta_dec, float *phi_dec, uint16_t *p_id_phi, const MC_LS_SETUP mc_format ); -#ifdef HODIRAC /*------------------------------------------------------------------------- * ivas_get_hodirac_flag() * @@ -71,7 +70,6 @@ int16_t ivas_get_hodirac_flag( return 0; } } -#endif /*------------------------------------------------------------------------- @@ -159,12 +157,10 @@ ivas_error ivas_dirac_config( spar_dirac_split_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); -#ifdef HODIRAC if ( ivas_get_hodirac_flag( ivas_total_brate, sba_order ) ) { spar_dirac_split_band = 0; } -#endif } else { @@ -173,9 +169,7 @@ ivas_error ivas_dirac_config( } hConfig->enc_param_start_band = 0; hConfig->dec_param_estim = FALSE; -#ifdef FIX_391_SBA hConfig->dec_param_estim_old = hConfig->dec_param_estim; -#endif if ( ivas_format == SBA_FORMAT ) /* skip for MASA decoder */ { if ( ( error = ivas_dirac_sba_config( hQMetaData, nchan_transport, nSCE, nCPE, element_mode, ivas_total_brate, sba_order, sba_mode, hConfig->nbands - spar_dirac_split_band ) ) != IVAS_ERR_OK ) @@ -201,7 +195,6 @@ ivas_error ivas_dirac_config( hConfig->enc_param_start_band = spar_dirac_split_band; } -#ifdef HODIRAC if ( ivas_get_hodirac_flag( ivas_total_brate, sba_order ) ) { hConfig->dec_param_estim = FALSE; @@ -210,7 +203,6 @@ ivas_error ivas_dirac_config( set_c( (int8_t *) hQMetaData->twoDirBands, (int8_t) 1, hQMetaData->q_direction[0].cfg.nbands ); hQMetaData->numTwoDirBands = (uint8_t) hQMetaData->q_direction[0].cfg.nbands; } -#endif } else { @@ -359,16 +351,12 @@ ivas_error ivas_dirac_sba_config( int16_t i; int16_t nbands_wb; int16_t nbands_coded; -#ifdef HODIRAC int16_t hodirac_flag; -#endif ivas_error error; error = IVAS_ERR_OK; hQMetaData->is_masa_ivas_format = 0; -#ifdef HODIRAC hodirac_flag = ivas_get_hodirac_flag( sba_total_brate, sba_order ); -#endif if ( sba_mode == SBA_MODE_SPAR ) { @@ -405,9 +393,7 @@ ivas_error ivas_dirac_sba_config( else { hQMetaData->useLowerBandRes = 0; -#ifdef HODIRAC if ( hodirac_flag == 0 ) -#endif { nbands_coded = nbands - 1; /* always combine the last two bands */ } @@ -415,18 +401,16 @@ ivas_error ivas_dirac_sba_config( { int16_t no_dirs = 1; -#ifdef HODIRAC if ( hodirac_flag ) { no_dirs = 2; } -#endif if ( ( error = ivas_qmetadata_allocate_memory( hQMetaData, nbands_coded, no_dirs, 0 ) ) != IVAS_ERR_OK ) { return error; } -#if defined( HODIRAC ) && !defined( FIX_DTX_428 ) +#if !defined( FIX_DTX_428 ) { int16_t dir, j; for ( dir = 0; dir < hQMetaData->no_directions; dir++ ) @@ -536,12 +520,10 @@ ivas_error ivas_dirac_sba_config( { { int16_t no_dirs = 1; -#ifdef HODIRAC if ( hodirac_flag ) { no_dirs = 2; } -#endif if ( ( error = ivas_qmetadata_allocate_memory( hQMetaData, 6, no_dirs, 0 ) ) != IVAS_ERR_OK ) { return error; @@ -575,13 +557,11 @@ ivas_error ivas_dirac_sba_config( { hQMetaData->q_direction[i].cfg.search_effort = 1; -#ifdef HODIRAC if ( hodirac_flag ) { hQMetaData->q_direction[i].cfg.start_band = 0; } else -#endif { hQMetaData->q_direction[i].cfg.start_band = nbands_wb; } @@ -888,7 +868,6 @@ void deindex_spherical_component( } -#ifdef HODIRAC /*---------------------------------------------------------------- * calculate_hodirac_sector_parameters() * @@ -1104,7 +1083,6 @@ void calculate_hodirac_sector_parameters( return; } -#endif /*-----------------------------------------------------------------------* diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c index 2598a43d3001e02c7cdcca3c011fa74bf2f47bb2..3d0b6255c9395ad982f29f39228f60e098c2f90d 100644 --- a/lib_com/ivas_fb_mixer.c +++ b/lib_com/ivas_fb_mixer.c @@ -106,10 +106,8 @@ ivas_error ivas_fb_set_cfg( const int16_t num_out_chans, /* i : number of FB output channels */ const int16_t active_w_mixing, /* i : active_w_mixing flag */ const int32_t sampling_rate /* i : sampling rate */ -#ifdef HODIRAC , const int16_t nchan_fb_in /* i : number of dirAC analysis channels*/ -#endif ) { IVAS_FB_CFG *pFb_cfg; @@ -121,9 +119,7 @@ ivas_error ivas_fb_set_cfg( pFb_cfg->num_in_chans = num_in_chans; pFb_cfg->num_out_chans = num_out_chans; -#ifdef HODIRAC pFb_cfg->nchan_fb_in = nchan_fb_in; -#endif pFb_cfg->pcm_offset = 0; /* note: in SPAR decoder, this parameter is overwritten later */ pFb_cfg->active_w_mixing = active_w_mixing; @@ -163,11 +159,7 @@ ivas_error ivas_fb_set_cfg( { pFb_cfg->fb_latency = NS2SA( sampling_rate, DELAY_FB_1_NS ); pFb_cfg->fade_len = NS2SA( sampling_rate, DELAY_FB_1_NS ); -#ifdef PARAMMC_SHORT_ENC_MDFT pFb_cfg->prior_input_length = NS2SA( sampling_rate, DELAY_DIRAC_ENC_CMP_NS ) + NS2SA( sampling_rate, PARAM_MC_SLOT_ENC_NS ); -#else - pFb_cfg->prior_input_length = NS2SA( sampling_rate, DELAY_DIRAC_ENC_CMP_NS ) + 3 * NS2SA( sampling_rate, PARAM_MC_SLOT_ENC_NS ); -#endif } *pFb_cfg_out = pFb_cfg; @@ -226,19 +218,11 @@ ivas_error ivas_FB_mixer_open( } else if ( fb_cfg->active_w_mixing ) { -#ifdef HODIRAC num_chs_alloc = max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ); -#else - num_chs_alloc = fb_cfg->num_in_chans; -#endif } else { -#ifdef SBA_TD_RESIDUAL num_chs_alloc = 1; /* only W channel processed for predicting YZX */ -#else - num_chs_alloc = fb_cfg->num_out_chans; -#endif } for ( i = 0; i < num_chs_alloc; i++ ) @@ -270,11 +254,7 @@ ivas_error ivas_FB_mixer_open( } else { -#ifdef HODIRAC num_chs_alloc = max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ); -#else - num_chs_alloc = fb_cfg->num_in_chans; -#endif } for ( i = 0; i < num_chs_alloc; i++ ) @@ -289,11 +269,7 @@ ivas_error ivas_FB_mixer_open( if ( ( fb_cfg->active_w_mixing != -1 ) && ( fb_cfg->num_out_chans > 0 ) ) { float *pTemp_mem; -#ifdef HODIRAC if ( ( pTemp_mem = (float *) malloc( sizeof( float ) * fb_cfg->num_out_chans * max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ) * IVAS_MAX_NUM_BANDS ) ) == NULL ) -#else - if ( ( pTemp_mem = (float *) malloc( sizeof( float ) * fb_cfg->num_out_chans * fb_cfg->num_in_chans * IVAS_MAX_NUM_BANDS ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer" ); } @@ -404,19 +380,11 @@ void ivas_FB_mixer_close( } else if ( fb_cfg->active_w_mixing ) { -#ifdef HODIRAC num_chs_alloc = max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ); -#else - num_chs_alloc = fb_cfg->num_in_chans; -#endif } else { -#ifdef SBA_TD_RESIDUAL num_chs_alloc = 1; /* only W channel processed for predicting YZX */ -#else - num_chs_alloc = fb_cfg->num_out_chans; -#endif } if ( hFbMixer != NULL ) @@ -441,11 +409,7 @@ void ivas_FB_mixer_close( } else { -#ifdef HODIRAC num_chs_alloc = max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ); -#else - num_chs_alloc = fb_cfg->num_in_chans; -#endif } @@ -526,11 +490,8 @@ void ivas_fb_mixer_pcm_ingest( float pcm_in[][L_FRAME48k], /* i : input audio channels */ float **ppOut_pcm, /* o : output audio channels */ const int16_t frame_len /* i : frame length */ -#ifdef HODIRAC , - const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] -#endif -) + const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] ) { int16_t i; int16_t num_chs_ingest; @@ -542,25 +503,13 @@ void ivas_fb_mixer_pcm_ingest( } else { -#ifdef SBA_TD_RESIDUAL num_chs_ingest = 1; /* forward Filterbank MDFT only on W */ -#else - num_chs_ingest = fb_cfg->num_out_chans; -#endif } for ( i = 0; i < fb_cfg->num_in_chans; i++ ) { mvr2r( &hFbMixer->ppFilterbank_prior_input[i][fb_cfg->prior_input_length - frame_len], ppOut_pcm[i], frame_len ); -#ifdef HODIRAC -#ifdef HODIRAC mvr2r( pcm_in[HOA_md_ind[i]], &ppOut_pcm[i][frame_len], frame_len ); -#else - mvr2r( pcm_in[HOA_keep_ind_spar[i]], &ppOut_pcm[i][frame_len], frame_len ); -#endif -#else - mvr2r( pcm_in[i], &ppOut_pcm[i][frame_len], frame_len ); -#endif } for ( i = 0; i < num_chs_ingest; i++ ) @@ -582,20 +531,14 @@ void ivas_fb_mixer_update_prior_input( IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle */ float *pcm_in[], /* i : input audio channels */ const int16_t length /* i : length of time slot */ -#ifdef HODIRAC , const int16_t nchan_fb_in /* i : number of analysis channels */ -#endif ) { int16_t i; for ( i = 0; i < -#ifdef HODIRAC nchan_fb_in; -#else - hFbMixer->fb_cfg->num_in_chans; -#endif i++ ) { mvr2r( &hFbMixer->ppFilterbank_prior_input[i][length], hFbMixer->ppFilterbank_prior_input[i], hFbMixer->fb_cfg->prior_input_length - length ); @@ -619,10 +562,8 @@ void ivas_fb_mixer_get_windowed_fr( float *frame_f_imag[], /* o : imag freq domain values */ const int16_t length, /* i : number of new samples in time slot */ const int16_t mdft_len /* i : MDFT frame length */ -#ifdef HODIRAC , const int16_t nchan_fb_in /* i : number of analysis channels */ -#endif ) { int16_t ch_idx, j, offset, rev_offset; @@ -638,12 +579,7 @@ void ivas_fb_mixer_get_windowed_fr( set_zero( fr_in_block, offset ); for ( ch_idx = 0; ch_idx < -#ifdef HODIRAC - nchan_fb_in -#else - hFbMixer->fb_cfg->num_in_chans -#endif - ; + nchan_fb_in; ch_idx++ ) { mvr2r( &hFbMixer->ppFilterbank_prior_input[ch_idx][offset + hFbMixer->fb_cfg->windowed_fr_offset], &fr_in_block[offset], n_old_samples - offset ); @@ -842,9 +778,6 @@ void ivas_fb_mixer_get_in_out_mapping( for ( i = 1; i < fb_cfg->num_out_chans; i++ ) { in_out_mixer_map[i][0] = 1; -#ifndef SBA_TD_RESIDUAL - in_out_mixer_map[i][order[i]] = 1; -#endif } } } diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index d14b252fd87b163b23d6e27062b53bed5cf948fc..a28fb77d20ed6fa9c379ac903dca440a83a46a23 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -88,18 +88,16 @@ 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 */ -#ifdef ISM_NON_DIEGETIC_PAN + 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 */ -#endif - const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD 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 localVAD[MAX_NUM_OBJECTS], /* i : local VAD 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 */ ) { int16_t ch; @@ -139,12 +137,10 @@ ivas_error ivas_ism_config( { nb_bits_metadata[0] += ISM_EXTENDED_METADATA_BITS; -#ifdef ISM_NON_DIEGETIC_PAN if ( ism_extended_metadata_flag ) { nb_bits_metadata[0] += ISM_METADATA_IS_NDP_BITS; } -#endif } nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism; @@ -347,10 +343,8 @@ void ivas_ism_reset_metadata( hIsmMeta->yaw = 0.0f; hIsmMeta->pitch = 0.0f; hIsmMeta->radius = 1.0f; -#ifdef ISM_NON_DIEGETIC_PAN hIsmMeta->ism_metadata_flag = 0; hIsmMeta->non_diegetic_flag = 0; -#endif return; } @@ -366,9 +360,6 @@ void ivas_ism_reset_metadata_API( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) { -#ifndef ISM_NON_DIEGETIC_PAN - hIsmMeta->ism_metadata_flag = 0; -#endif ivas_ism_reset_metadata( hIsmMeta ); return; diff --git a/lib_com/ivas_mc_com.c b/lib_com/ivas_mc_com.c index 9bda9d49a4d27edd80a390f1a702c332acf801a0..0001f39704e1eaebe67b02524461d5a2284b832f 100644 --- a/lib_com/ivas_mc_com.c +++ b/lib_com/ivas_mc_com.c @@ -103,12 +103,6 @@ MC_MODE ivas_mc_mode_select( { mc_mode = MC_MODE_MCMASA; } -#ifndef MC_PARAMUPMIX_MODE - else if ( total_brate < IVAS_192k ) - { - mc_mode = MC_MODE_PARAMMC; - } -#else else if ( total_brate < IVAS_160k ) { mc_mode = MC_MODE_PARAMMC; @@ -117,7 +111,6 @@ MC_MODE ivas_mc_mode_select( { mc_mode = MC_MODE_PARAMUPMIX; } -#endif break; default: assert( 0 && "LS Setup not supported or defined for MC mode!\n" ); diff --git a/lib_com/ivas_mdft_imdft.c b/lib_com/ivas_mdft_imdft.c index a9f5bac5320fd73094f64617b505aa32253e7373..ad9d19a9107824ed92f8da3e6d5f965b34464bda 100644 --- a/lib_com/ivas_mdft_imdft.c +++ b/lib_com/ivas_mdft_imdft.c @@ -82,11 +82,9 @@ static void ivas_get_mdft_twid_factors( case IVAS_160_PT_LEN: *ppTwid = &ivas_mdft_coeff_cos_twid_160[0]; break; -#ifdef PARAMMC_SHORT_ENC_MDFT case IVAS_120_PT_LEN: *ppTwid = &ivas_mdft_coeff_cos_twid_120[0]; break; -#endif case IVAS_80_PT_LEN: *ppTwid = &ivas_mdft_coeff_cos_twid_80[0]; break; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 27790e039d8c01ff3af41748f5c63e96da594cde..4e8f41dfc54e173e7af9a99d386945253f87190a 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -869,9 +869,7 @@ ivas_error ivas_ism_config( 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 */ -#ifdef ISM_NON_DIEGETIC_PAN const int16_t ism_extended_metadata_flag, /* i : extended metadata flag */ -#endif const int16_t localVAD[MAX_NUM_OBJECTS], /* i : local VAD flag */ const int16_t ism_imp[], /* i : ISM importance flags */ int32_t element_brate[], /* o : element bitrate per object */ @@ -912,12 +910,8 @@ ivas_error ivas_set_ism_metadata( const float elevation, /* i : elevation value */ const float radius_meta, /* i : radius */ const float yaw, /* i : yaw */ -#ifdef ISM_NON_DIEGETIC_PAN const float pitch, /* i : pitch */ const int16_t non_diegetic_flag /* i : non-diegetic object flag */ -#else - const float pitch /* i : pitch */ -#endif ); ivas_error ivas_ism_metadata_enc_create( @@ -2551,7 +2545,6 @@ void sns_shape_spectrum( const int16_t L_frame /* i : frame length */ ); -#ifdef SNS_MSVQ int16_t quantize_sns( float sns_in[CPE_CHANNELS][NB_DIV][M], float snsQ_out[CPE_CHANNELS][NB_DIV][M], @@ -2566,7 +2559,6 @@ void dequantize_sns( float snsQ_out[CPE_CHANNELS][NB_DIV][M], Decoder_State **sts ); -#endif void sns_avq_cod( const float *sns, /* i : Input sns vectors */ @@ -2575,18 +2567,14 @@ void sns_avq_cod( float *snsmid_q, /* o : Quantized mid-LFS vectors */ int16_t *index, /* o : Quantization indices */ const int16_t core, /* i : core */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif const int16_t low_brate_mode /* i : flag low bit operating mode */ ); void sns_avq_cod_stereo( const float *snsl, /* i : Input sns vector (left channel) */ const float *snsr, /* i : Input sns vector (right channel) */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif float *snsl_q, /* o : Quantized sns vector (left channel) */ float *snsr_q, /* o : Quantized sns vector (right channel) */ int16_t *indexl, /* o : Quantization indices (left channel) */ @@ -2595,23 +2583,15 @@ void sns_avq_cod_stereo( void sns_avq_dec( int16_t *index, /* i : Quantization indices */ -#ifdef SNS_MSVQ float SNS_Q[NB_DIV][M], /* o : Quantized SNS vectors */ -#else - float *SNS_Q, /* o : Quantized SNS vectors */ -#endif -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif const int16_t numlpc /* i : Number of sets of lpc */ ); void sns_avq_dec_stereo( int16_t *indexl, /* i : Quantization indices (left channel) */ int16_t *indexr, /* i : Quantization indices (right channe) */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif float *SNS_Ql, /* o : Quantized SNS vectors (left channel) */ float *SNS_Qr /* o : Quantized SNS vectors (right channe) */ ); @@ -3110,10 +3090,8 @@ void mdct_read_IGF_bits( ivas_error ivas_qmetadata_enc_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *hQMetaData /* i/o: q_metadata handle */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); #ifdef HR_METADATA @@ -3178,10 +3156,8 @@ int16_t ivas_qmetadata_dec_decode( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ uint16_t *bitstream, /* i : bitstream */ int16_t *index /* i/o: bitstream position */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); #ifdef HR_METADATA @@ -3213,9 +3189,7 @@ void ivas_qmetadata_to_dirac( MASA_DECODER_HANDLE hMasa, /* i : MASA decoder structure */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const SBA_MODE sba_mode, /* i : SBA mode */ -#ifdef HODIRAC const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#endif int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); @@ -3418,11 +3392,9 @@ void ivas_dirac_param_est_enc( float **pp_fr_imag, const int16_t input_frame, const SBA_MODE sba_mode -#ifdef HODIRAC , const int16_t hodirac_flag, const int16_t nchan_fb_in -#endif ); @@ -3498,13 +3470,10 @@ int16_t ivas_sba_get_nchan( /*! r: number of ambisonics metadata channels */ int16_t ivas_sba_get_nchan_metadata( const int16_t sba_order /* i : Ambisonic (SBA) order */ -#ifdef HODIRAC , const int32_t ivas_total_brate -#endif ); -#ifdef HODIRAC void ivas_sba_get_spar_hoa_ch_ind( const int16_t num_md_chs, /* i : number of MD channels */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ @@ -3518,13 +3487,6 @@ void ivas_sba_get_spar_hoa_md_flag( int16_t *spar_hoa_md_flag, int16_t *spar_hoa_dirac2spar_md_flag ); -#else -/*! r: flag indicating to code SPAR HOA MD for all bands */ -int16_t ivas_sba_get_spar_hoa_md_flag( - const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -); -#endif void ivas_sba_zero_vert_comp( float sba_data[][L_FRAME48k], /* i/o: SBA data frame */ @@ -3556,13 +3518,11 @@ void ivas_sba_dirac_stereo_config( STEREO_DFT_CONFIG_DATA_HANDLE hConfig /* o : DFT stereo configuration */ ); -#ifdef HODIRAC /*! r: HO-DirAC flag */ int16_t ivas_get_hodirac_flag( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t sba_order /* i : Ambisonic (SBA) order */ ); -#endif int16_t ivas_get_sba_dirac_stereo_flag( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ @@ -3651,12 +3611,10 @@ ivas_error ivas_dirac_dec_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#ifdef DIRAC_ALLOC_HARM ivas_error ivas_dirac_allocate_parameters( DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ const int16_t params_flag /* i : set of parameters flag */ ); -#endif ivas_error ivas_dirac_dec_config( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -3667,12 +3625,10 @@ void ivas_dirac_dec_close( DIRAC_DEC_HANDLE *hDirAC /* i/o: decoder DirAC handle */ ); -#ifdef DIRAC_ALLOC_HARM void ivas_dirac_deallocate_parameters( DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ const int16_t params_flag /* i : set of parameters flag */ ); -#endif void ivas_dirac_dec_read_BS( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ @@ -3681,9 +3637,7 @@ void ivas_dirac_dec_read_BS( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q metadata */ int16_t *nb_bits, /* o : number of bits read */ const SBA_MODE sba_mode, /* i : SBA mode */ -#ifdef HODIRAC const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#endif int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); @@ -3737,7 +3691,6 @@ void ivas_dirac_dec_render_sf( #endif ); -#ifdef FIX_417_TD_DECORR_BRATE_SW ivas_error ivas_td_decorr_reconfig_dec( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate, /* i : total IVAS bitrate */ @@ -3752,12 +3705,6 @@ float configure_reqularization_factor( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate /* i : total IVAS bitrate */ ); -#else -ivas_error ivas_dirac_dec_init_binaural_data( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -); -#endif void computeDiffuseness_mdft( float **buffer_intensity[DIRAC_NUM_DIMS], @@ -3838,19 +3785,15 @@ ivas_error ivas_dirac_dec_output_synthesis_open( const RENDERER_TYPE renderer_type, /* i : renderer type */ const int16_t nchan_transport, /* i : number of transport channels */ const int32_t output_Fs /* i : output sampling rate */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); void ivas_dirac_dec_output_synthesis_init( DIRAC_DEC_HANDLE hDirAC, /* i/o: DirAC handle */ const int16_t nchan_out_woLFE /* i : number of output audio channels without LFE */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); void ivas_dirac_dec_output_synthesis_close( @@ -3873,14 +3816,12 @@ void ivas_dirac_dec_output_synthesis_process_slot( const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport /* i : number of transport channels */ -#if !defined( HODIRAC ) || defined( JBM_TSM_ON_TCS ) +#if defined( JBM_TSM_ON_TCS ) , const int16_t index_slot #endif -#ifdef HODIRAC , const int16_t hodirac_flag -#endif ); void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( @@ -3892,13 +3833,11 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( const int16_t nbslots, /* i : number of slots to process */ #endif const float *onset_filter -#ifdef HODIRAC , #ifdef JBM_TSM_ON_TCS const int16_t md_idx, #endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( @@ -3955,10 +3894,8 @@ void ivas_dirac_dec_compute_directional_responses( const float *surCohRatio, const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat /* i : rotation matrix */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); void ivas_dirac_dec_get_frequency_axis( @@ -3966,7 +3903,6 @@ void ivas_dirac_dec_get_frequency_axis( const int32_t output_Fs, /* i : sampling frequency */ const int16_t num_freq_bands ); /* i : number of frequency bands */ -#ifdef HODIRAC void calculate_hodirac_sector_parameters( float RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : signal vector (L+1)^2 x N_bins, real part */ float ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i : signal vector, imaginary part */ @@ -3980,9 +3916,7 @@ void calculate_hodirac_sector_parameters( float *diff, /* o : array of sector diffuseness values, flat */ float *ene /* o : array of sector energy values, flat */ ); -#endif -#ifdef MC_PARAMUPMIX_MODE void ivas_mc_paramupmix_enc( Encoder_Struct *st_ivas, /* i/o: IVAS Encoder handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: IVAS Metadata bitstream handle */ @@ -4023,7 +3957,6 @@ void ivas_mc_paramupmix_dec_read_BS( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, /* i/o: decoder MC Param-Upmix handle */ int16_t *nb_bits /* o : number of bits written */ ); -#endif void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ @@ -4707,11 +4640,9 @@ void ivas_get_spar_md_from_dirac( const int16_t active_w_vlbr ); -#ifdef HODIRAC int16_t ivas_get_spar_dec_md_num_subframes( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int32_t ivas_total_brate ); -#endif ivas_error ivas_spar_md_dec_open( ivas_spar_md_dec_state_t **hMdDec_out, /* i/o: SPAR MD decoder handle */ @@ -4765,19 +4696,15 @@ void ivas_spar_update_md_hist( void ivas_spar_smooth_md_dtx( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_bands_out /* i : number of output bands */ - #ifdef HODIRAC , const int16_t num_md_sub_frames /* i : number of metadata subframes */ -#endif ); void ivas_spar_setup_md_smoothing( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_bands_out /* i : number of output bands */ -#ifdef HODIRAC , const int16_t num_md_sub_frames /* i : number of metadata subframes */ -#endif ); void ivas_spar_dec_gen_umx_mat( @@ -4785,10 +4712,8 @@ void ivas_spar_dec_gen_umx_mat( const int16_t nchan_transport, /* i : number of transport channels */ const int16_t num_bands_out, /* i : number of output bands */ const int16_t bfi /* i : bad frame indicator */ -#ifdef HODIRAC , const int16_t num_md_sub_frames -#endif ); /* Covariance module */ @@ -4818,10 +4743,8 @@ void ivas_enc_cov_handler_process( const int16_t nchan_inp, const int16_t dtx_vad, const int16_t transient_det[2] -#ifdef HODIRAC , const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] -#endif ); ivas_error ivas_spar_covar_smooth_enc_open( @@ -4896,14 +4819,12 @@ void ivas_td_decorr_process( const int16_t output_frame /* i : output frame length */ ); -#ifdef MC_PARAMUPMIX_MODE void ivas_td_decorr_APD_iir_filter( ivas_td_decorr_APD_filt_state_t *filter_state, float *pIn_out, const int16_t num_APD_sections, const int16_t length ); -#endif #define IVAS_CMULT_FLOAT( in1_re, in1_im, in2_re, in2_im, out1_re, out1_im ) \ out1_re = ( in1_re * in2_re ) - ( in1_im * in2_im ); MAC(1); MULT(1); \ @@ -5195,10 +5116,8 @@ void masa_compensate_two_dir_energy_ratio_index( const int16_t ratio_index_2, /* i : Input ratio for direction 2 */ int16_t *ratio_index_mod1, /* o : Output modified ratio for direction 1 */ int16_t *ratio_index_mod2 /* o : Output modified ratio for direction 2 */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ); void ivas_set_qmetadata_maxbit_req( @@ -5206,12 +5125,10 @@ void ivas_set_qmetadata_maxbit_req( const IVAS_FORMAT ivas_format /* i : IVAS format */ ); -#ifdef HODIRAC /*! r: Bits to be used for quantizing distribution ratio of direct-to-total ratios */ int16_t ivas_get_df_ratio_bits_hodirac( const int16_t index_diff /* i : Index of quantized diffuse-to-total ratio */ ); -#endif /*! r: Bits to be used for quantizing distribution ratio of direct-to-total ratios */ int16_t ivas_get_df_ratio_bits( @@ -5246,36 +5163,14 @@ void ivas_masa_prerender( ); #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -void ivas_spar_param_to_masa_param_mapping_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - int16_t azimuth[CLDFB_NO_CHANNELS_MAX], - int16_t elevation[CLDFB_NO_CHANNELS_MAX], - float energy_ratio1[CLDFB_NO_CHANNELS_MAX], - float spreadCoherence[CLDFB_NO_CHANNELS_MAX], - float surroundingCoherence[CLDFB_NO_CHANNELS_MAX], - float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ - float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /* i : Input audio in CLDFB domain, imag */ -); -#endif #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS void ivas_spar_param_to_masa_param_mapping( Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ const int16_t subframe /* i : Subframe to map */ ); -#else -void ivas_spar_param_to_masa_param_mapping( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ - const int16_t firstSubframe, /* i : First subframe to map */ - const int16_t nSubframes /* i : Number of subframes to map */ -); -#endif /*---------------------------------------------------------------------------------* @@ -5453,9 +5348,7 @@ void ivas_ls_setup_conversion_close( void ivas_ls_setup_conversion( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ -#ifdef MC_PARAMUPMIX_MODE const int16_t input_chans, /* i : number of input channels to the renderer */ -#endif const int16_t output_frame, /* i : frame length */ #ifdef JBM_TSM_ON_TCS float *input[], /* i : LS input/output synthesis signal */ @@ -5599,10 +5492,8 @@ void computeReferencePower_enc( const int16_t enc_param_start_band, /* i : first band to process */ const int16_t num_freq_bands, /* i : Number of frequency bands */ const SBA_MODE sba_mode /* i : SBA mode */ -#ifdef HODIRAC , const int16_t nchan_ana /* i : number of analysis channels */ -#endif ); ivas_error ivas_mono_dmx_renderer_open( @@ -5738,10 +5629,8 @@ ivas_error ivas_fb_set_cfg( const int16_t num_out_chans, /* i : number of FB output channels */ const int16_t active_w_mixing, /* i : active_w_mixing flag */ const int32_t sampling_Fs /* i : sampling rate */ -#ifdef HODIRAC , const int16_t nachan_dirac_ana /* i : number of DirAR analysis channels */ -#endif ); ivas_error ivas_FB_mixer_open( @@ -5762,10 +5651,8 @@ void ivas_fb_mixer_pcm_ingest( float pcm_in[][L_FRAME48k], /* i : input audio channels */ float **ppOut_pcm, /* o : output audio channels */ const int16_t frame_length /* i : frame length */ -#ifdef HODIRAC , const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] -#endif ); void ivas_dirac_enc_spar_delay_synchro( @@ -5778,10 +5665,8 @@ void ivas_fb_mixer_update_prior_input( IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle */ float *pcm_in[], /* i : input audio channels */ const int16_t length /* i : length of time slot */ -#ifdef HODIRAC , const int16_t nchan_fb_in /* i : number of analysis channels */ -#endif ); void ivas_fb_mixer_get_windowed_fr( @@ -5791,10 +5676,8 @@ void ivas_fb_mixer_get_windowed_fr( float *frame_f_imag[], /* o : imag freq domain values */ const int16_t length, /* i : number of new samples in time slot */ const int16_t mdft_len /* i : MDFT frame length */ -#ifdef HODIRAC , const int16_t nchan_fb_in /* i : number of analysis channels */ -#endif ); void ivas_fb_mixer_process( diff --git a/lib_com/ivas_qmetadata_com.c b/lib_com/ivas_qmetadata_com.c index 380723604403c671773c0f6881c9f09782b95a4e..26dbb10df141b59d6a2eb4bcb186a72d1488bcb1 100644 --- a/lib_com/ivas_qmetadata_com.c +++ b/lib_com/ivas_qmetadata_com.c @@ -508,10 +508,8 @@ void masa_compensate_two_dir_energy_ratio_index( const int16_t ratio_index_2, /* i : Input ratio for direction 2 */ int16_t *ratio_index_mod1, /* o : Output modified ratio for direction 1 */ int16_t *ratio_index_mod2 /* o : Output modified ratio for direction 2 */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { float ratio1, ratio2; @@ -520,9 +518,7 @@ void masa_compensate_two_dir_energy_ratio_index( ratio1 = 1.0f - diffuseness_reconstructions[ratio_index_1]; ratio2 = 1.0f - diffuseness_reconstructions[ratio_index_2]; -#ifdef HODIRAC if ( !hodirac_flag ) -#endif { ratioSum = ratio1 + ratio2; if ( ratio1 >= ratio2 ) @@ -621,7 +617,6 @@ void ivas_qmetadata_direction_vector_to_azimuth_elevation( } -#ifdef HODIRAC /*------------------------------------------------------------------------- * ivas_get_df_ratio_bits_hodirac() * @@ -650,7 +645,6 @@ int16_t ivas_get_df_ratio_bits_hodirac( return dfRatio_bits; } -#endif /*--------------------------------------------------------------- * ivas_get_df_ratio_bits() diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index dea512d50d42a9e445f2b89d9f49445fdb14be01..b083210e0796f78a2bac3fe4722ec20250858637 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -877,9 +877,7 @@ const int16_t DirAC_block_grouping_5ms_MDFT[MAX_PARAM_SPATIAL_SUBFRAMES + 1] = 0, 1, 2, 3, 4 }; -#ifdef HODIRAC const float c_weights[DIRAC_NO_FB_BANDS_MAX] = { 9.962447e-02f, 9.627997e-01f, 9.926667e-01f, 9.981028e-01f, 9.996648e-01f, 1.000000e+00f, 9.997692e-01f, 9.992002e-01f, 9.983890e-01f, 9.973818e-01f, 9.962037e-01f, 9.948692e-01f, 9.933876e-01f, 9.917654e-01f, 9.900073e-01f, 9.881169e-01f, 9.860975e-01f, 9.839516e-01f, 9.816818e-01f, 9.792906e-01f, 9.767801e-01f, 9.741527e-01f, 9.714106e-01f, 9.685560e-01f, 9.655913e-01f, 9.625187e-01f, 9.593406e-01f, 9.560594e-01f, 9.526774e-01f, 9.491970e-01f, 9.456208e-01f, 9.419512e-01f, 9.381908e-01f, 9.343420e-01f, 9.304075e-01f, 9.263898e-01f, 9.222915e-01f, 9.181152e-01f, 9.138636e-01f, 9.095392e-01f, 9.051447e-01f, 9.006827e-01f, 8.961559e-01f, 8.915668e-01f, 8.869181e-01f, 8.822123e-01f, 8.774521e-01f, 8.726400e-01f, 8.677785e-01f, 8.628702e-01f, 8.579176e-01f, 8.529231e-01f, 8.478893e-01f, 8.428184e-01f, 8.377130e-01f, 8.325753e-01f, 8.274077e-01f, 8.222124e-01f, 8.169917e-01f, 8.117478e-01f, 8.064829e-01f, 8.011990e-01f, 7.958982e-01f, 7.905827e-01f, 7.852543e-01f, 7.799150e-01f, 7.745667e-01f, 7.692112e-01f, 7.638505e-01f, 7.584861e-01f, 7.531199e-01f, 7.477535e-01f, 7.423885e-01f, 7.370265e-01f, 7.316691e-01f, 7.263176e-01f, 7.209736e-01f, 7.156384e-01f, 7.103134e-01f, 7.049999e-01f, 6.996990e-01f, 6.944121e-01f, 6.891403e-01f, 6.838847e-01f, 6.786464e-01f, 6.734265e-01f, 6.682258e-01f, 6.630455e-01f, 6.578863e-01f, 6.527492e-01f, 6.476350e-01f, 6.425445e-01f, 6.374784e-01f, 6.324376e-01f, 6.274226e-01f, 6.224341e-01f, 6.174729e-01f, 6.125393e-01f, 6.076341e-01f, 6.027577e-01f, 5.979106e-01f, 5.930932e-01f, 5.883061e-01f, 5.835497e-01f, 5.788242e-01f, 5.741301e-01f, 5.694676e-01f, 5.648372e-01f, 5.602390e-01f, 5.556734e-01f, 5.511404e-01f, 5.466405e-01f, 5.421737e-01f, 5.377402e-01f, 5.333402e-01f, 5.289738e-01f, 5.246411e-01f, 5.203422e-01f, 5.160771e-01f, 5.118460e-01f, 5.076489e-01f, 5.034858e-01f, 4.993567e-01f, 4.952616e-01f, 4.912005e-01f, 4.871734e-01f, 4.831802e-01f, 4.792209e-01f, 4.752955e-01f, 4.714037e-01f, 4.675457e-01f, 4.637212e-01f, 4.599302e-01f, 4.561725e-01f, 4.524481e-01f, 4.487567e-01f, 4.450983e-01f, 4.414728e-01f, 4.378799e-01f, 4.343195e-01f, 4.307915e-01f, 4.272956e-01f, 4.238318e-01f, 4.203997e-01f, 4.169993e-01f, 4.136303e-01f, 4.102926e-01f, 4.069859e-01f, 4.037101e-01f, 4.004649e-01f, 3.972501e-01f, 3.940655e-01f, 3.909109e-01f, 3.877861e-01f, 3.846909e-01f, 3.816250e-01f, 3.785882e-01f, 3.755803e-01f, 3.726010e-01f, 3.696501e-01f, 3.667275e-01f, 3.638328e-01f, 3.609658e-01f, 3.581263e-01f, 3.553141e-01f, 3.525289e-01f, 3.497705e-01f, 3.470387e-01f, 3.443331e-01f, 3.416537e-01f, 3.390001e-01f, 3.363720e-01f, 3.337694e-01f, 3.311919e-01f, 3.286393e-01f, 3.261114e-01f, 3.236079e-01f, 3.211286e-01f, 3.186733e-01f, 3.162418e-01f, 3.138337e-01f, 3.114490e-01f, 3.090872e-01f, 3.067484e-01f, 3.044321e-01f, 3.021382e-01f, 2.998664e-01f, 2.976166e-01f, 2.953885e-01f, 2.931819e-01f, 2.909966e-01f, 2.888323e-01f, 2.866889e-01f, 2.845661e-01f, 2.824637e-01f, 2.803816e-01f, 2.783194e-01f, 2.762770e-01f, 2.742543e-01f, 2.722509e-01f, 2.702667e-01f, 2.683014e-01f, 2.663550e-01f, 2.644271e-01f, 2.625177e-01f, 2.606264e-01f, 2.587531e-01f, 2.568977e-01f, 2.550599e-01f, 2.532395e-01f, 2.514364e-01f, 2.496503e-01f, 2.478811e-01f, 2.461287e-01f, 2.443928e-01f, 2.426732e-01f, 2.409698e-01f, 2.392824e-01f, 2.376109e-01f, 2.359550e-01f, 2.343146e-01f, 2.326895e-01f, 2.310797e-01f, 2.294848e-01f, 2.279047e-01f, 2.263394e-01f, 2.247886e-01f, 2.232521e-01f, 2.217299e-01f, 2.202217e-01f, 2.187274e-01f, 2.172469e-01f, 2.157800e-01f, 2.143266e-01f, 2.128865e-01f, 2.114596e-01f, 2.100457e-01f, 2.086447e-01f, 2.072564e-01f, 2.058808e-01f }; -#endif /*----------------------------------------------------------------------* * SPAR ROM tables @@ -951,19 +949,11 @@ const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] = { 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } }, // not yet optimized { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, -#ifdef HODIRAC { 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } }, // not yet optimized { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, { 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } }, // not yet optimized { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, -#else - { 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 97700, 93300, 128000 } }, // not yet optimized - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 127200, 122550, 128000 },{ 76300, 73550, 128000 } }, // not yet optimized - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, -#endif }; const ivas_freq_models_t ivas_arith_pred_r_consts[TOTAL_PRED_QUANT_STRATS_ARITH] = @@ -1480,31 +1470,13 @@ const int16_t dtx_pr_real_q_levels[3][3] = { { 9,9,9 },{ 9,7,9 },{ 9,5,7 } }; const int16_t pr_pr_idx_pairs[3][3][2] = { { { 0, 0 },{ 0, 0 },{ 0, 0 } },{ { 0, 0 },{ 0, 0 },{ 0, 0 } },{ { 0, 0 },{ 1, 3 },{ 0, 0 } } }; const int16_t pr_pd_idx_pairs[3][3][2] = { { { 1, 1 },{ 2, 2 },{ 3, 3 } },{ { 1, 1 },{ 3, 2 },{ 2, 0 } },{ { 2, 1 },{ 0, 0 },{ 0, 0 } } }; -#ifdef HODIRAC const int16_t remix_order_set[1][DIRAC_MAX_ANA_CHANS] = { /* WYZX --> WYXZ... */ { 0, 1, 3, 2, 4, 5, 6, 7, 8, 9, 10 } }; -#else -const int16_t remix_order_set[1][IVAS_SPAR_MAX_CH] = { /* WYZX --> WYXZ... */ - { 0, 1, 3, 2, 4, 5, 6, 7} -}; -#endif -#ifdef HODIRAC const int16_t keep_planar[IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS] = { 1, 1, 1, 1, 1, 1 }; -#else -const int16_t keep_planar[IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS] = { 1, 1, 1, 1 }; -#endif -#ifdef HODIRAC const int16_t HOA_keep_ind[IVAS_SPAR_MAX_FB_IN_CHAN] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15}; -#ifdef HODIRAC const int16_t HOA_keep_ind_spar[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 8, 9, 10, 10, 10, 10}; const int16_t HOA_keep_ind_spar512[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; -#else -const int16_t HOA_keep_ind_spar[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 8, 9, 10}; -#endif -#else -const int16_t HOA_keep_ind[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 8, 9, 15}; -#endif /*----------------------------------------------------------------------* @@ -4055,7 +4027,6 @@ const float ivas_cos_twiddle_160[IVAS_160_PT_LEN >> 1] = 0.0760120586092433f, 0.0564205163668375f, 0.0368072229413588f, 0.0171797396307788f }; -#ifdef PARAMMC_SHORT_ENC_MDFT const float ivas_mdft_coeff_cos_twid_120[IVAS_120_PT_LEN + 1] = { 1.0000000000f, 0.9999143276f, 0.9996573250f, 0.9992290362f, 0.9986295348f, 0.9978589232f, 0.9969173337f, @@ -4077,7 +4048,6 @@ const float ivas_mdft_coeff_cos_twid_120[IVAS_120_PT_LEN + 1] = 0.1045284633f, 0.0915016187f, 0.0784590957f, 0.0654031292f, 0.0523359562f, 0.0392598158f, 0.0261769483f, 0.0130895956f, 0.0000000000f }; -#endif const float ivas_sin_twiddle_80[IVAS_80_PT_LEN >> 1] = { @@ -5629,11 +5599,9 @@ const int16_t ivas_num_active_bands[FB - WB + 1] = IVAS_16K_12BANDS_ACTIVE_BANDS, IVAS_FB_BANDS_12, IVAS_FB_BANDS_12 }; -#ifdef SNS_MSVQ const int16_t ivas_sns_cdbks_tcx20_levels[SNS_MSVQ_NSTAGES_TCX20] = { 128, 64, 32, 32 }; const int16_t ivas_sns_cdbks_tcx20_bits[SNS_MSVQ_NSTAGES_TCX20] = { 7, 6, 5, 5 }; -#ifdef FIX_445_SNS_BUGFIXES /* pre-rounded codebook vectors for singed Q4.12 represantation */ const float ivas_sns_cdbk_tcx20_stage1[ 128 * 16 ] = { -1.8305664f, -2.0878906f, -0.9638672f, 2.8059082f, 2.668213f, 1.1638184f, 1.390625f, 1.217041f, 1.3850098f, 0.44555664f, -0.47045898f, -0.5307617f, -0.810791f, -1.1647949f, -1.4560547f, -1.7612305f, @@ -6206,611 +6174,7 @@ const float ivas_sns_cdbks_side_tcx10_stage2[ 8 * 16 ] = { }; const float *const ivas_sns_cdbks_side_tcx10[SNS_MSVQ_NSTAGES_SIDE] = { ivas_sns_cdbks_side_tcx10_stage1, ivas_sns_cdbks_side_tcx10_stage2 }; -#else -/* codebooks trained for no adaptive tilt */ -const float ivas_sns_cdbk_tcx20_stage1[ 128 * 16 ] = { - -3.24881770f, -1.99497051f, -0.04725080f, 1.02318508f, 1.51589220f, 1.44649178f, 1.27858728f, 1.15137095f, 0.98029724f, 0.69167126f, 0.33414576f, 0.11759238f, -0.27510520f, -0.63610342f, -1.05394049f, -1.28304590f, - -3.24340413f, -4.15075396f, -2.86242117f, -1.11561919f, 1.12899983f, 1.98341478f, 0.56638511f, -0.05841474f, -0.14875192f, 0.31098029f, 1.87121037f, 0.91347082f, 1.02548459f, 1.98227488f, 1.30278860f, 0.49435585f, - 1.23065598f, 0.87793778f, 0.28294330f, 0.02972172f, 0.42574775f, 0.83386805f, 0.95758438f, 1.21299710f, 1.15042593f, 1.00234403f, 0.60083169f, -0.06520030f, -1.53941239f, -2.26801783f, -2.42116011f, -2.31126766f, - 0.06088614f, 0.02623315f, -0.61781539f, -1.23181247f, -1.40815590f, -1.42831471f, -1.44033232f, -1.33353337f, -0.99555917f, -0.36554180f, 0.55314618f, 1.56114474f, 2.01339157f, 1.99106535f, 1.51097476f, 1.10422329f, - -0.46337128f, -1.76230281f, -2.14514561f, -1.74284853f, -0.74943182f, 0.04642704f, 0.99955801f, 1.04344919f, 1.33994604f, 1.17515394f, 1.38810800f, 1.59087304f, 0.68196542f, -0.13955087f, -0.49622391f, -0.76660607f, - -2.07291483f, -1.16133507f, -1.23972694f, -1.55319745f, -1.53709378f, -0.89687815f, -0.30493476f, 0.53566030f, 0.90463531f, 1.12789938f, 1.18233130f, 1.05231063f, 0.85029894f, 0.96079862f, 1.14041844f, 1.01172838f, - 2.12762247f, 0.85938708f, 0.01404337f, -0.21119526f, -0.23292897f, -0.20800178f, 0.17965021f, 0.51517794f, 0.58450068f, 0.57289696f, 0.08413189f, -0.34604446f, -0.63957268f, -0.82541169f, -1.16686648f, -1.30738935f, - 1.40474083f, 0.32307263f, 0.16419111f, 0.38346550f, 0.50108274f, 0.37590359f, 0.08846238f, -0.23008300f, -0.45942672f, -0.45977478f, -0.43670746f, -0.36727746f, -0.35363526f, -0.33341415f, -0.31539698f, -0.28520292f, - -1.63093109f, 0.32670603f, 1.08393314f, 0.58998372f, 0.53843053f, 0.88612683f, 0.92734321f, 0.85881168f, 0.60801083f, 0.37502839f, -0.29325438f, -0.61636624f, -0.51913318f, -0.70035895f, -0.99754553f, -1.43678500f, - -1.93833343f, -0.69005518f, -0.75170110f, -1.07591216f, -1.13136476f, -0.91057037f, -0.96360579f, -0.81544927f, -0.72636191f, -0.36468519f, 0.13935276f, 1.01589488f, 1.62003238f, 2.00743696f, 2.33078654f, 2.25453582f, - 0.79346182f, 0.75880356f, 0.99941121f, 1.41339988f, 1.42679902f, 1.10135650f, 0.67724856f, 0.16701926f, -0.44226147f, -0.83565024f, -0.96240506f, -0.97710726f, -1.05267194f, -1.07354671f, -1.04194230f, -0.95191489f, - 1.32136151f, -0.10247792f, -0.44723017f, -0.36075427f, -0.71183851f, -0.78401615f, 0.03854040f, 0.61579422f, 0.72990899f, 0.74660263f, 0.27260947f, -0.45511245f, -0.57501743f, -0.20707029f, -0.10728071f, 0.02598055f, - -2.38997175f, -0.94335853f, 0.22486968f, 0.68758389f, 0.77400708f, 0.48551812f, 0.16770824f, 0.18451833f, 0.33722182f, 0.44300618f, 0.45730356f, 0.25903292f, 0.07348018f, -0.18351294f, -0.34985810f, -0.22754861f, - -0.04011386f, -2.74627791f, -2.64617639f, -2.12344376f, -1.04417531f, -1.19773434f, -1.09890378f, -1.14847926f, -1.25163399f, -1.37182360f, -0.92453053f, 0.26852562f, 2.49004087f, 5.03865317f, 3.18845554f, 4.60761675f, - 1.14142799f, 2.34150710f, 1.12597821f, 0.18025034f, -0.06854703f, 0.11882225f, -0.04029384f, -0.10117108f, -1.28130702f, -1.15721800f, 0.11730029f, 0.68335719f, -0.86449861f, -0.91274565f, -0.63726145f, -0.64560064f, - 0.13591417f, 1.45701293f, 0.18328994f, -1.33736241f, -1.63073739f, -1.11748160f, 0.33426081f, 1.38341076f, 1.23963779f, 1.15857921f, -0.19884512f, -0.46649971f, -0.23043753f, -0.16721531f, -0.08938742f, -0.65413930f, - -3.20422583f, -2.18732518f, -1.06476764f, -0.35148934f, 0.10909386f, 0.39065642f, 0.55826648f, 0.44049157f, 0.21409388f, 0.73508456f, 0.80931151f, 0.46688874f, 0.41272044f, 0.76516296f, 1.00398863f, 0.90204888f, - -2.87971458f, -4.23728027f, -0.84454748f, -0.07411834f, 0.21882417f, -1.73386520f, 0.44502397f, -0.29845675f, 0.51877264f, 1.16767994f, -0.80604089f, 1.51749444f, 2.06387385f, 2.42941495f, 1.48054035f, 1.03239888f, - 0.41502416f, 1.92937242f, 2.34493885f, 2.24663449f, 1.97723622f, 1.21219002f, 0.63995779f, 0.11201995f, -0.55860561f, -1.24739776f, -1.54711086f, -1.65155024f, -1.60927011f, -1.56104438f, -1.42473910f, -1.27765585f, - 0.97567115f, -1.33363678f, -2.33351304f, -2.63770798f, -2.22869213f, -1.57504148f, -1.07402035f, -0.47932319f, 0.18065985f, 0.66105619f, 1.18623833f, 1.66207325f, 1.92650802f, 1.89672632f, 1.54070829f, 1.63229361f, - -1.83309029f, -1.12088085f, -0.69053368f, -0.04697322f, 0.16614312f, 0.20653379f, 0.18628141f, 0.29156151f, 0.23415032f, 0.18998435f, 0.46020416f, 0.73218863f, 0.60617333f, 0.33402310f, 0.20549266f, 0.07874144f, - 1.16879643f, -0.94945093f, -1.28153207f, -1.43119528f, -1.63599975f, -1.48906283f, -0.72189452f, 0.19212127f, 0.62604095f, 0.71399312f, 0.84540884f, 0.67919451f, 0.73724815f, 0.94849167f, 0.74181449f, 0.85602585f, - 3.95026110f, 1.56392643f, -0.09370037f, -1.55546296f, -0.28400433f, 2.65160213f, 1.72026891f, -1.03325487f, -2.07533128f, -1.61929448f, -0.37408941f, -0.62936182f, -0.97909452f, -0.16160269f, -0.16361090f, -0.91725088f, - 0.53671249f, -1.03786958f, -1.08801981f, -0.37356699f, -0.22489401f, 0.02309705f, 0.14784551f, 0.19793732f, 0.12472343f, 0.09506024f, 0.05869315f, 0.14383214f, 0.10038818f, 0.25076267f, 0.40789510f, 0.63740306f, - -1.95841389f, 0.03478956f, 1.04981544f, 1.45141888f, 1.01368780f, 1.76553008f, 0.97518033f, 0.87744500f, 1.11998177f, 1.49531245f, 0.43867723f, -1.39588091f, -2.49552623f, -2.06407734f, -1.18465117f, -1.12328885f, - -1.17302983f, 0.17875585f, 0.89193716f, 1.29461477f, 1.14616923f, 0.04577007f, -0.87252250f, -0.55960184f, -0.58720665f, -0.52949712f, -0.37526793f, 0.00605696f, -0.15490600f, 0.06404177f, 0.40280720f, 0.22187871f, - 0.64131376f, 1.75231910f, 2.22508888f, 1.98484418f, 0.78172753f, -0.67005650f, -0.79535378f, 0.16537851f, 0.46442966f, -0.37889506f, -1.24009244f, -0.92537177f, -0.87140953f, -1.04472250f, -1.06971265f, -1.01948730f, - 0.34969434f, 1.41127416f, 0.95134631f, -0.49521902f, -1.13459218f, -1.02414143f, -0.54470763f, 0.04902381f, -0.01765934f, -0.09518271f, -0.07199094f, -0.00398826f, 0.14565429f, 0.17470642f, 0.18302401f, 0.12275814f, - -0.44981302f, -0.20165042f, -0.00073479f, 0.26315901f, 0.44473473f, 0.36317865f, 0.17484972f, 0.03171990f, 0.07343634f, 0.04543774f, -0.09709362f, -0.05624873f, -0.00866747f, -0.02410679f, -0.21651202f, -0.34168925f, - -1.24451525f, -1.23251652f, -1.59614073f, -2.03789978f, -1.96213854f, -1.71444999f, -1.60613134f, -1.51978903f, -1.00014591f, 0.04117804f, 1.34166006f, 2.42925461f, 2.88303472f, 2.83027230f, 2.48737677f, 1.90095093f, - 1.96467234f, 1.49818482f, 0.23737321f, -0.11314831f, -0.14050512f, -0.25201114f, -0.17389748f, -0.07042668f, -0.18426976f, -0.34937744f, -0.42674607f, -0.50442879f, -0.58679768f, -0.52836378f, -0.35445903f, -0.01579900f, - -0.99933612f, 1.11819495f, 1.29449512f, -0.02576221f, -0.61170357f, 0.30864176f, 0.87998806f, 0.96699269f, 0.98082342f, 1.27485776f, 0.52941745f, -1.29529727f, -1.88922976f, -1.36858904f, -0.37094568f, -0.79254774f, - -2.00039877f, -0.30176543f, 0.62981832f, 1.66518235f, 1.71899440f, 1.30408052f, 0.82774193f, 1.00586191f, 0.86017140f, 0.54233910f, -0.13420070f, -0.66585251f, -0.96492148f, -1.18998336f, -1.56871158f, -1.72835605f, - -2.69937742f, -3.72437438f, -3.23623013f, -0.25624354f, 1.96357307f, 2.46814215f, 3.53069303f, -1.06174110f, -1.09336853f, -0.07686535f, 1.29279961f, 1.80354460f, 1.27988399f, -0.42606045f, -0.44754574f, 0.68316996f, - -0.09822772f, 1.26120245f, 1.70052823f, 1.56502837f, 1.15694639f, 0.88838189f, 0.57465867f, 0.31853596f, 0.03466567f, -0.25958767f, -0.49911919f, -0.76007985f, -1.16055649f, -1.53569625f, -1.61195549f, -1.57472513f, - -1.14376495f, -1.43799067f, -1.45325578f, -1.52444742f, -1.38528757f, -1.09797958f, -0.89118095f, -0.62608417f, -0.00250085f, 0.94458366f, 1.51363028f, 1.81223868f, 1.83008829f, 1.56737959f, 1.18148735f, 0.71308420f, - -0.16148812f, -2.04769833f, -2.09471486f, -1.43005703f, -0.50205979f, -0.54822778f, 1.68195446f, 4.00061129f, 1.03275735f, 0.41847912f, 0.66770340f, -0.11822564f, -0.63042447f, -0.32785779f, -0.23825248f, 0.29750055f, - -3.59916102f, -3.16769339f, -2.44843270f, -2.08077491f, -1.31387103f, -0.17348440f, 0.36398119f, 1.21172207f, 1.38864588f, 1.46347831f, 1.46684451f, 1.84157730f, 1.58044756f, 1.35394187f, 1.27155115f, 0.84122764f, - 1.12168796f, 1.77011301f, 0.80501182f, -0.65059510f, -0.86885740f, -0.21223750f, 0.66413611f, 0.77827963f, 0.37800197f, -0.26796888f, -0.97801860f, -0.64966444f, -0.50047252f, -0.44549810f, -0.47750530f, -0.46641261f, - 1.69417025f, 0.14170351f, -0.30309571f, -0.50074499f, -0.60597114f, -0.65756500f, -0.62775844f, -0.41013834f, -0.07761611f, 0.16510349f, 0.25158511f, 0.34758291f, 0.28289899f, 0.29273919f, 0.09829950f, -0.09119332f, - -0.86153928f, 1.09981825f, 0.79441249f, 0.41436072f, 0.25807562f, -0.33355863f, -0.51983659f, -0.25841284f, 0.00191053f, 0.13240503f, 0.19942573f, 0.24363814f, 0.08478089f, -0.15773770f, -0.37897853f, -0.71876393f, - -3.54840520f, -3.31670990f, -2.41138986f, -1.93012869f, -1.20864357f, -0.47291818f, -0.18678664f, 0.02177990f, 0.31458995f, 0.70059621f, 1.23845973f, 1.82707181f, 2.12918865f, 2.27071260f, 2.36659938f, 2.20598371f, - -1.13771731f, 0.39368618f, 0.69608234f, 1.45165188f, 1.41884327f, 1.47720631f, 0.71071536f, 0.51669579f, 0.07379070f, -0.91725636f, -1.46431524f, -2.01818354f, -0.45034354f, -0.20458063f, -0.61685389f, 0.07057863f, - 1.94180196f, -0.43938181f, -1.45235723f, -1.62714803f, -0.56602083f, 0.17861664f, -0.11574800f, -0.55042921f, -0.26385634f, 0.14973980f, 0.40358646f, 0.57744006f, 0.91363053f, 0.71399177f, -0.04044356f, 0.17657766f, - -2.29623160f, 0.37017475f, -0.14625619f, 1.40510672f, -0.18688173f, 0.98162341f, -0.08351923f, 0.30727120f, 0.21088276f, 0.00882905f, 0.20930156f, 0.07859582f, 0.11868622f, 0.19357924f, -0.59940040f, -0.57176126f, - 0.32770546f, -2.17703619f, -2.14694909f, -1.21327174f, -0.09787592f, -0.38390569f, -0.54684876f, -0.76275935f, -1.00614562f, -1.06555455f, -0.70232123f, -0.12667989f, 0.23719344f, 0.82854727f, 3.01646153f, 5.81943998f, - 1.74451794f, 2.61728252f, 2.50084081f, 2.14806463f, 1.03256213f, -0.14230845f, -0.89600957f, -1.26996454f, -1.47590648f, -1.42717085f, -1.20779572f, -0.98498624f, -0.82778555f, -0.73610012f, -0.59428320f, -0.48095729f, - -1.63200590f, 0.23028801f, -0.00907184f, -0.79978843f, -1.00748376f, -0.12526203f, 0.79168097f, 0.90826744f, 0.57548955f, 0.65151547f, 0.37307684f, -0.12047965f, -0.13538324f, 0.00756611f, 0.31705141f, -0.02546129f, - -2.96255244f, -1.89398578f, -1.11705055f, -0.49587679f, -0.64879460f, 0.52145289f, -0.11691144f, 1.02365070f, 0.12124424f, 1.06613244f, 2.03450026f, 1.32855094f, 0.54450823f, -0.09583278f, -0.09304639f, 0.78401059f, - -2.74846388f, -3.29381816f, -1.69589747f, 0.09992536f, 1.19730664f, -0.16362356f, -0.15703004f, 0.55042720f, 0.31568131f, 0.18156842f, 0.68590339f, 1.08986889f, 1.58662197f, 1.58930878f, 0.65286724f, 0.10935410f, - 2.40977200f, 1.75366309f, 0.74979137f, 0.75357579f, 0.58888421f, 0.34045829f, 0.41658500f, 0.41731179f, 0.35825939f, 0.03048901f, -0.69808452f, -1.34206657f, -1.51950247f, -1.45414323f, -1.40318331f, -1.40180996f, - -0.45462369f, -0.79464966f, -0.73449499f, -0.64030961f, -0.59804980f, -0.52688087f, -0.50966580f, -0.32241860f, -0.22751147f, -0.05981052f, 0.18569777f, 0.50293633f, 0.68570837f, 0.93799600f, 1.18364242f, 1.37243415f, - 0.71230959f, -0.15258830f, -0.30639043f, -0.10789426f, 0.13596677f, 0.06139692f, -0.05906250f, -0.09243858f, 0.16058801f, 0.19962984f, -0.02914953f, -0.05986174f, -0.00798730f, -0.03679071f, -0.19035654f, -0.22737122f, - 0.20985119f, 0.67531452f, -0.76482923f, -1.95548615f, -2.01335569f, -1.31859418f, -0.44117933f, 0.43598020f, 0.63898416f, 0.59260283f, 0.59660664f, 0.64364003f, 0.57962656f, 0.72198795f, 0.77431143f, 0.62453906f, - 3.37266827f, 1.16546541f, 0.15487771f, 0.57979973f, 1.63054771f, 1.04524609f, -0.13961184f, -0.53246008f, -0.51061506f, -0.83238697f, -1.04232388f, -0.96061103f, -0.90339873f, -0.99671658f, -1.06027762f, -0.97020325f, - -2.45339028f, 0.22870307f, 0.50079654f, 0.82545821f, -0.45080889f, -0.16537387f, -0.25306064f, -0.33349906f, 0.26143456f, 0.09313222f, 0.86160665f, 0.75164534f, -1.22179547f, -0.18801375f, 1.02457992f, 0.51858541f, - -1.46171297f, 0.63898461f, 2.15634917f, 1.94818588f, 2.12627540f, 1.70759626f, 1.43815259f, 0.82410049f, 0.20479176f, -0.43378728f, -0.89783731f, -1.30555797f, -1.66597981f, -1.80440934f, -1.79291067f, -1.68224086f, - -0.10170911f, 1.63842605f, 2.05629785f, 1.72760611f, 0.13751598f, -1.26847816f, -1.58069540f, -1.04510855f, -0.88231099f, -0.68616151f, -0.59891556f, -0.49054331f, -0.18451655f, 0.19151542f, 0.64619056f, 0.44088718f, - -0.86655238f, 0.59030963f, 1.14256838f, 1.66795450f, 1.50058628f, 1.34944192f, 0.08257813f, 0.24901720f, -0.18852178f, -0.03650931f, -0.27994508f, -1.06110568f, -2.06900429f, -1.73358377f, -0.24057835f, -0.10665549f, - 1.50872779f, 1.31070374f, 0.39357214f, -0.46407462f, -0.92397447f, -1.13436545f, -1.23237146f, -1.13209159f, -1.03095318f, -0.62563255f, -0.17705075f, 0.30244717f, 0.51989500f, 0.80258928f, 0.87034201f, 1.01223693f, - -0.30437289f, -0.88801487f, -0.86107707f, -0.28285107f, 0.28699382f, 0.45911485f, 0.48852566f, 0.45550239f, 0.58082722f, 0.55866427f, 0.31299044f, 0.14102370f, 0.07480087f, -0.08720185f, -0.35323153f, -0.58169395f, - -2.81842263f, -2.50111842f, -2.46829445f, -2.46942172f, -2.16241013f, -1.43881623f, -1.42903221f, -0.83291045f, 0.08734224f, 1.62875243f, 2.38321450f, 2.57841755f, 2.43444406f, 2.45552669f, 2.52427006f, 2.02845861f, - 3.37066045f, 1.49218725f, 0.55470586f, 0.13748306f, -0.13402053f, -0.39589325f, -0.44410867f, -0.48568748f, -0.51085663f, -0.42397560f, -0.53871831f, -0.60800303f, -0.57632384f, -0.50071998f, -0.46558245f, -0.47114696f, - -0.62183100f, 1.32484675f, 1.39280525f, 0.63916764f, 0.07573329f, 0.57096453f, 0.11014546f, -0.13955579f, -0.60839590f, -0.77966466f, -1.07179154f, -1.77671234f, -0.71411508f, 0.13441149f, 0.72184010f, 0.74215154f, - -2.90081845f, -3.29359883f, -1.89249569f, 2.35796037f, 2.47210792f, 0.89083303f, 1.25230145f, 1.03281210f, 1.34506489f, 0.48347288f, -0.08158884f, 0.21388757f, 0.05047384f, -0.37546417f, -0.70672331f, -0.84822525f, - -0.68878586f, -3.17765901f, -2.72677654f, -0.83696096f, 1.93901658f, 2.45806994f, 0.77003930f, 0.58220309f, 0.28500621f, -0.15305225f, 0.53711675f, 0.20321993f, 0.20435459f, 0.27124049f, 0.02126411f, 0.31170327f, - 1.03813940f, 1.60082720f, 1.24608760f, 0.78739775f, 0.96747591f, 1.10068123f, 1.15134869f, 0.74915981f, 0.42167811f, 0.15553718f, -0.33259317f, -0.97385519f, -1.61082594f, -2.05590168f, -2.15737100f, -2.08778582f, - -0.64496025f, 0.35212582f, -0.04908282f, -1.05504457f, -1.19731005f, -0.73315350f, -0.66929749f, -0.60130627f, -0.33236585f, 0.23014025f, 0.69893111f, 1.09565077f, 1.08466375f, 0.94366305f, 0.65639554f, 0.22095053f, - 0.48358349f, -0.37847120f, -1.02753771f, -0.73518795f, -0.11326269f, 0.53003780f, 0.88038488f, 0.88882395f, 0.97329253f, 0.69212641f, 0.87373175f, 0.80871682f, -0.03656343f, -0.94980974f, -1.26081773f, -1.62904720f, - -2.23244251f, -1.79490434f, -1.96001543f, -2.27380061f, -2.07255037f, -1.46415033f, -1.04393033f, 0.20282312f, 1.57244767f, 1.97591827f, 1.77648956f, 1.75160994f, 1.62357252f, 1.47414518f, 1.35930993f, 1.10547779f, - 0.79628045f, 0.95200921f, 0.49234542f, 0.09199320f, -0.05724590f, -0.07118046f, -0.04634766f, -0.00096416f, -0.17970825f, -0.09563800f, -0.01779017f, 0.13120319f, -0.03610489f, -0.35895498f, -0.62415601f, -0.97574095f, - 1.23786391f, -0.05332070f, 0.12142715f, 0.41317442f, 0.15674045f, -0.23609842f, -0.45604039f, -0.60612644f, -0.72063869f, -0.65773356f, -0.45446098f, -0.19856125f, -0.01567566f, 0.31093945f, 0.48567017f, 0.67284050f, - -0.38959317f, 0.48417975f, 0.67846195f, 0.96883427f, 0.97152360f, 0.77479838f, 0.58711345f, 0.71066957f, 0.54730033f, 0.30078955f, -0.00792413f, -0.23889729f, -0.71320215f, -1.17067509f, -1.60334166f, -1.90003738f, - -0.58748774f, -1.47663922f, -1.69196885f, -1.58982061f, -1.20534794f, -0.84425696f, -0.58959522f, -0.30927859f, 0.05320947f, 0.43265601f, 0.78002809f, 1.13478063f, 1.29240277f, 1.39914925f, 1.52607187f, 1.67609674f, - 0.21900175f, 0.90198746f, 1.47152638f, 1.60585024f, 1.28627552f, 0.62955762f, -0.10179136f, -0.53979665f, -0.95849172f, -1.05549774f, -0.93249423f, -0.63224235f, -0.54606380f, -0.47048197f, -0.44721628f, -0.43012290f, - 1.16598857f, -0.44883323f, -0.35990019f, 0.55867022f, 0.76350144f, 0.40336553f, -0.17899520f, -0.32789312f, 0.39266043f, 1.31706823f, 0.14239671f, -1.37351682f, -1.43994906f, -0.44961849f, 0.22694761f, -0.39189263f, - -2.38540927f, -1.62852954f, -0.88269400f, -0.07377225f, 0.58356450f, 0.88990527f, 0.91596948f, 0.64591793f, 0.36616944f, 0.38677852f, 0.46220080f, 0.31194777f, 0.22940934f, 0.16539664f, 0.07914516f, -0.06599966f, - 0.72463355f, -0.52958069f, -1.48068920f, -1.78301927f, -1.84235585f, -1.64970240f, -1.53867955f, -1.38956832f, -1.22397576f, -0.84685537f, -0.05213558f, 1.07240247f, 1.81984926f, 2.69693629f, 2.99963897f, 3.02310102f, - 1.19409909f, 2.68519772f, 1.98964488f, 0.67968388f, -0.01774621f, -0.15701839f, -0.09104235f, 0.24620030f, -0.83163859f, -1.22467182f, -1.23467957f, -1.15083406f, -0.63344301f, -0.72619249f, -0.46989224f, -0.25766714f, - -0.36982280f, 1.17012486f, 0.65527007f, -0.63203416f, -0.41714099f, 0.81639854f, 0.54164978f, 0.77650051f, 0.59880614f, 0.82660687f, -1.04749065f, -0.62911908f, -0.34368981f, -0.45351210f, -0.51314098f, -0.97940604f, - -2.68285677f, -0.85691687f, -0.20235026f, -0.01759520f, -0.00179021f, 0.11451343f, 0.27056934f, 0.20577824f, -0.23029364f, 0.11388472f, -0.05166620f, 0.07283122f, 0.56553984f, 0.81068091f, 1.04931803f, 0.84035365f, - -1.52932955f, -1.34785922f, -0.57071683f, -0.20686289f, 0.08155976f, -0.47381873f, -0.77622457f, -0.57310159f, -0.22137986f, 0.13834100f, 0.49481460f, 0.80177416f, 0.88568748f, 1.02957744f, 1.20356068f, 1.06397834f, - 0.85311314f, 1.33739225f, 1.91363915f, 1.93231248f, 2.08304754f, 1.71778606f, 0.86773094f, 0.43475180f, 0.03661492f, -0.61728713f, -1.15699401f, -1.66982248f, -1.98244609f, -2.00151078f, -1.93416224f, -1.81416574f, - 1.60126279f, -0.81833805f, -1.38880039f, -1.40634796f, -1.32149763f, -1.28036492f, -1.07256373f, -0.72500244f, -0.46550137f, -0.10403512f, 0.28677127f, 0.67644278f, 1.00944110f, 1.34460513f, 1.63359356f, 2.03033498f, - -1.12256198f, -1.95155583f, -1.32316561f, -0.63266570f, -0.15627220f, 0.07123786f, 0.13550620f, 0.25890778f, 0.47783453f, 0.57057758f, 0.68332609f, 0.73453078f, 0.66233264f, 0.62861164f, 0.56744294f, 0.39591321f, - 0.06875844f, -0.77557401f, -1.05293353f, -1.03197877f, -0.85111938f, -0.61756528f, -0.16943921f, 0.22208891f, 0.49771452f, 0.66450860f, 0.73241467f, 0.72611275f, 0.63156506f, 0.52604468f, 0.30774149f, 0.12166125f, - 3.80400584f, 1.75988157f, 0.24665703f, -1.24851564f, -1.25633571f, 0.32422259f, 2.13094918f, 0.70439664f, -1.53713254f, -1.71622823f, -1.08819715f, -0.50716458f, -0.74087437f, -0.99402032f, -0.10491345f, 0.22326928f, - -0.65058475f, -0.32678303f, -0.20547132f, -0.11041511f, -0.11848885f, -0.20790889f, -0.31102714f, -0.27474061f, -0.20625644f, -0.08260245f, 0.09887987f, 0.33251986f, 0.41319745f, 0.49892877f, 0.56061378f, 0.59013885f, - -2.39642240f, -0.73872271f, 0.49057636f, 1.16325658f, 0.79747808f, 1.34021740f, 0.82073194f, 1.17831994f, 1.25881141f, 0.84489551f, -0.77511278f, -1.30893620f, -1.25529283f, -0.65601516f, -0.34679935f, -0.41698601f, - -0.54371008f, 0.45990001f, 0.73230478f, 1.41706822f, 1.07142705f, 0.82233755f, -0.15928811f, -0.34139895f, -0.08643862f, -0.24274513f, -0.48172279f, -0.46452865f, -0.44837803f, -0.43356299f, -0.59008965f, -0.71117480f, - -0.36854343f, 1.40608712f, 2.13291678f, 1.80061219f, 1.15989238f, -0.32896337f, -0.86683083f, -0.45937605f, -0.17796119f, -0.40226921f, -0.30363529f, -1.08494615f, -0.97269428f, -0.91102639f, -0.31526836f, -0.30799363f, - 0.16771127f, 1.28284008f, 0.25724837f, -1.11750032f, -1.04368583f, 0.13121741f, 0.10609539f, 0.02437401f, -0.56098948f, -0.38744327f, 0.07855531f, 0.20548373f, 0.06560664f, 0.24342662f, 0.39885137f, 0.14820870f, - 0.20792769f, -0.15663987f, -0.04445993f, 0.27319064f, 0.51281629f, 0.57962552f, 0.54535177f, 0.41567183f, 0.41718141f, 0.20916435f, -0.10574785f, -0.26957618f, -0.44861183f, -0.55143961f, -0.71969549f, -0.86475851f, - -2.53854175f, -2.10301056f, -1.97482174f, -2.12277877f, -1.80824545f, -1.32660134f, -1.25816793f, -0.90711327f, -0.59056817f, -0.05426883f, 0.60446374f, 1.61001048f, 2.40601840f, 3.00689095f, 3.60110855f, 3.45562566f, - 1.07778822f, 2.19172459f, 1.44013405f, 0.27222350f, 0.03173527f, -0.04691321f, 0.06376916f, 0.63907484f, -0.17949007f, 0.10010871f, -0.52495472f, -0.90729516f, -0.89428983f, -1.02410889f, -1.09546364f, -1.14404292f, - 0.76276530f, 1.59524592f, 1.47474021f, 0.18145014f, 0.13550913f, 0.88510912f, 1.03412929f, 1.01111065f, 0.77539585f, 0.20329499f, -1.35508663f, -1.83340559f, -1.40465488f, -1.14514789f, -1.16420913f, -1.15624650f, - -2.56605999f, -0.69575164f, 0.80693890f, 1.72778867f, 2.34339014f, 2.09042055f, 1.74382199f, 1.18476481f, 0.71416221f, 0.16808900f, -0.19808303f, -0.77842890f, -1.40866559f, -1.73499872f, -1.76586854f, -1.63151971f, - -0.32618212f, -2.76955063f, -2.78043449f, 0.51956703f, 4.34383806f, 1.88716237f, 4.47289205f, -0.68129863f, -1.52511041f, -1.32636741f, 0.65997777f, -0.52682311f, -0.69581956f, -0.43799624f, -0.50098243f, -0.31287245f, - 1.11744895f, 0.76474262f, 0.68913317f, 0.77356058f, 0.73021025f, 0.55480731f, 0.41334472f, 0.23384124f, 0.00040865f, -0.18384701f, -0.30336471f, -0.46628578f, -0.73968976f, -1.02792872f, -1.19473003f, -1.36165137f, - -1.09856438f, -2.65937422f, -2.23447552f, -2.36127808f, -1.92601400f, -1.29606162f, -0.86847602f, -0.41112389f, 0.27059515f, 0.62653494f, 1.25539083f, 2.16718498f, 2.40401093f, 1.97246907f, 1.87623832f, 2.28294385f, - -2.23812017f, -3.37112518f, -3.06489410f, -2.44639779f, -1.77205118f, -0.96847500f, 3.20788062f, 2.74986128f, 2.48376367f, 3.58855607f, 1.46558359f, 0.58208141f, 0.58647621f, -0.03336968f, -0.01161197f, -0.75815742f, - -3.34068874f, -3.31330139f, -3.27624195f, -3.18776773f, -2.60176738f, -1.35466356f, -0.47112724f, 0.80847853f, 1.80958348f, 2.21285031f, 2.26554713f, 2.76880679f, 2.60017886f, 2.04062204f, 1.67575322f, 1.36373732f, - 0.04677635f, 1.13691098f, 1.30914680f, 0.25672818f, 0.15799852f, 0.60568291f, 0.31771628f, 0.07597951f, -0.26589647f, -0.54972118f, -0.86844552f, -0.61094603f, -0.47072310f, -0.40511943f, -0.38309528f, -0.35299238f, - 0.22528620f, 0.31743905f, 0.31483553f, 0.17720192f, 0.16231355f, -0.06831057f, -0.29693139f, -0.45560458f, -0.21127731f, -0.08624191f, -0.20781580f, -0.12232125f, 0.08133224f, 0.09984234f, 0.03187445f, 0.03837752f, - 0.45404525f, 1.31244734f, 1.09193858f, 0.46595512f, 0.31516414f, -0.08250116f, -0.64154502f, -0.86897307f, -0.92275973f, -0.84086567f, -0.63886704f, -0.14652849f, 0.08165072f, 0.18249933f, 0.18288233f, 0.05545734f, - -2.78701578f, -2.31409561f, -1.68556203f, -1.40144529f, -0.74842449f, -0.07375189f, -0.20211385f, 0.09260002f, 0.29898930f, 0.66465229f, 0.75558861f, 0.96729187f, 1.14177838f, 1.55174084f, 1.99705535f, 1.74271247f, - -0.10464683f, -0.94242352f, -0.57955843f, 1.29762166f, 1.68516688f, 1.09852539f, 0.72099378f, 0.51323036f, -0.24285175f, -0.55888513f, -0.50577021f, -0.46366004f, -0.55836815f, -0.58550721f, -0.50078205f, -0.27308479f, - 3.45286440f, 0.59611628f, -0.69351346f, -1.14674518f, -1.07854543f, -0.89938730f, -0.76263547f, -0.52068670f, -0.36216337f, -0.17157688f, -0.01447939f, 0.15778389f, 0.27944020f, 0.35739675f, 0.34083744f, 0.46529411f, - -1.28927442f, 0.10726691f, 0.86158650f, 0.06273348f, -0.04085696f, 1.13928101f, 0.37886132f, 0.13576595f, -0.53530704f, -0.37566277f, -0.10613359f, -0.03059598f, -0.04857175f, -0.00612681f, 0.00516239f, -0.25812835f, - 2.89076531f, -0.04664344f, -1.93237643f, -2.19996964f, -1.86412035f, -1.18315371f, -1.10120931f, -1.31680378f, -1.30399765f, -1.28669610f, -0.94489947f, -0.60614659f, 1.58599312f, 0.95842154f, 2.94815038f, 5.40268579f, - 3.83455417f, 3.13869337f, 1.72510455f, 1.17236146f, 0.33356711f, 0.11348813f, -0.29704182f, -1.13829975f, -1.48383443f, -1.43388842f, -1.35163818f, -1.16938088f, -1.02627819f, -0.92590386f, -0.82058768f, -0.67091549f, - -0.93172509f, 0.85237993f, 1.34276319f, 0.25174685f, -0.79705618f, -0.63895111f, 0.21118680f, 0.97143052f, 0.70458966f, -0.18635616f, -0.52911893f, -1.85150883f, -0.43982599f, 0.04075634f, 0.50586277f, 0.49382650f, - -3.79516923f, -3.31533743f, -1.55672619f, 0.02918112f, 0.69887327f, 0.58481500f, 1.07030510f, 1.26562384f, 1.20349632f, 1.07269840f, 0.89773042f, 0.88137053f, 0.60964812f, 0.28884498f, 0.12262285f, -0.05797732f, - -0.08660073f, -3.36745835f, -3.82012977f, -2.75147711f, -0.36352096f, 0.85747874f, 1.11140604f, 0.65593665f, 0.35792228f, 0.54619342f, 0.99489751f, 1.28924616f, 0.96663509f, 1.40602119f, 1.12645860f, 1.07699149f, - 1.92634136f, 2.07569243f, 1.90024169f, 1.55333140f, 1.00662166f, 0.59662392f, 0.41735113f, 0.03712017f, -0.30033462f, -0.70147399f, -1.26150322f, -1.36946469f, -1.49306813f, -1.53593901f, -1.47859712f, -1.37294294f, - 0.41088895f, -0.68758389f, -0.85837881f, -0.86844724f, -0.85475992f, -0.88373397f, -0.82636157f, -0.54233624f, -0.33497780f, -0.06884329f, 0.24209832f, 0.60199869f, 0.83678079f, 1.05727685f, 1.27867768f, 1.49770152f, - -0.45442780f, -0.39381771f, -0.35575987f, -0.28279611f, -0.03460671f, 0.02188475f, -0.06207990f, -0.02068513f, 0.24104453f, 0.35743869f, 0.26392307f, 0.33209979f, 0.34550175f, 0.24362296f, 0.00439669f, -0.20573886f, - -1.38047831f, 0.78167658f, 0.42055729f, -0.93786054f, -1.72548724f, -1.52410071f, -0.47028251f, 0.81491117f, 0.82382622f, 0.46806997f, 0.95867097f, 0.52433344f, -0.02522016f, 0.39885676f, 0.61128096f, 0.26124617f, - 1.92925285f, 1.70790963f, 1.15526536f, 0.66461298f, 0.67490541f, 0.23892474f, -0.12861693f, -0.33635752f, -0.52286346f, -0.56868795f, -0.86695874f, -0.88842939f, -0.86631615f, -0.80495760f, -0.73812023f, -0.64956301f, - -0.46329214f, 0.55823622f, 0.34966614f, -0.14855330f, -0.35757896f, -0.52459469f, -0.85251369f, -0.95064429f, -0.99468342f, -0.76192580f, -0.41419015f, 0.12436151f, 0.64925405f, 1.13684199f, 1.33630964f, 1.31330685f, - 0.86356450f, 0.34381018f, -0.02085849f, 1.83539444f, 2.32518759f, 1.67398143f, 1.25867313f, 1.20615444f, 0.52697956f, -0.09144588f, -0.76159106f, -1.51187022f, -1.92351238f, -1.95050372f, -1.91438733f, -1.85957587f, - 1.24350337f, 2.40332737f, 1.88241131f, 1.35749721f, -0.42200494f, -1.44428015f, -1.39178301f, -0.93577948f, -0.61036359f, -0.51298915f, -0.79745508f, 0.00259692f, 0.20231677f, -0.31281818f, -0.31072767f, -0.35345154f, - -1.27391584f, 0.23665237f, 1.44085187f, 2.06602253f, 1.71605896f, 0.13376293f, -0.37509412f, 0.40922525f, 0.84118074f, 0.94717998f, -0.77859633f, -1.07717911f, -1.15385313f, -1.14774662f, -0.82654451f, -1.15800495f, - 1.30848084f, 0.08937934f, -0.37852967f, -0.65194579f, -0.75067573f, -0.79649158f, -0.77379985f, -0.60797455f, -0.51295495f, -0.32714998f, -0.08812522f, 0.24492207f, 0.48331843f, 0.72894883f, 0.89967800f, 1.13292004f, - -1.59837663f, -0.80221740f, -0.23176726f, 0.53351299f, 0.66646844f, 0.70631763f, 0.72180374f, 0.68847102f, 0.63073539f, 0.46683184f, 0.29870291f, 0.24285644f, -0.04345483f, -0.36903735f, -0.77735195f, -1.13349493f, - -3.27008180f, -3.34427840f, -3.19628867f, -2.98677397f, -2.40944350f, -1.63513906f, -1.40569428f, -0.88190894f, -0.25273952f, 0.84351501f, 1.96278949f, 2.92570176f, 3.17223429f, 3.47899460f, 3.70716828f, 3.29194486f, - 2.58466208f, 2.01534437f, 1.28252767f, 0.44865967f, -0.33100837f, -0.81011259f, -1.06701187f, -1.12743988f, -1.21505758f, -0.99337144f, -0.66853937f, -0.46093443f, -0.22132067f, 0.00996599f, 0.24481197f, 0.30882455f, - -0.62864502f, 1.04984327f, 1.56877053f, 0.77975000f, 0.01037804f, 0.92352492f, 1.12297462f, 0.76284403f, -0.16106015f, -0.21398417f, -0.62673537f, -1.68917053f, -1.60748063f, -0.79116243f, -0.06290217f, -0.43694470f -}; -const float ivas_sns_cdbk_tcx20_stage2[ 64 * 16 ] = { - -0.14487037f, 0.32346300f, 0.29798679f, -0.52393127f, -0.25671033f, 0.85717754f, -0.09030235f, -0.41110330f, -0.32938564f, -0.36580017f, -0.13142117f, -0.06404494f, 0.10671000f, 0.18731030f, 0.26606878f, 0.27885301f, - 0.52707061f, 0.35016312f, 0.54090507f, 0.82023896f, 0.46675870f, -0.60012182f, -0.76783382f, -0.39198749f, -0.17916696f, -0.17307722f, -0.10507731f, -0.09327542f, -0.12176361f, -0.12715624f, -0.11980175f, -0.02587481f, - -0.71420988f, -0.65927011f, -0.35007906f, -0.01478187f, 0.15375095f, 0.11149616f, 0.08819131f, 0.11537168f, 0.18041243f, 0.28846009f, 0.61920238f, 0.78709602f, 0.49945852f, -0.03863360f, -0.42339912f, -0.64306599f, - -0.81717379f, 0.06122156f, 0.05823003f, 0.10166328f, 0.27940347f, 0.24198679f, 0.13036228f, 0.07594383f, 0.21865219f, 0.19571948f, 0.11860502f, 0.04836758f, -0.03211315f, -0.14926357f, -0.23274285f, -0.29886216f, - -0.68529960f, -0.60305257f, -0.55080408f, -0.31252031f, 0.02732556f, 0.58303818f, 0.67638004f, 0.45008305f, 0.44400610f, 0.24064307f, 0.01598330f, -0.02342002f, -0.05864021f, -0.08903495f, -0.06326312f, -0.05142446f, - 0.89939472f, 0.31232066f, -0.27153630f, -0.52911639f, -0.58173141f, -0.63610440f, -0.61689761f, -0.43424024f, -0.23705022f, -0.00031150f, 0.15363335f, 0.19705513f, 0.25413198f, 0.35648787f, 0.53897823f, 0.59498626f, - 0.29798691f, 0.08114488f, 0.25286730f, -0.14155021f, -0.55163298f, -0.91534601f, -0.57551866f, 0.56064647f, 0.80731933f, -0.19474923f, -0.20126966f, 0.06517040f, 0.06866947f, 0.09059095f, 0.13444783f, 0.22122305f, - -0.19554741f, -1.08027678f, -0.01182563f, 0.56474090f, 0.41996725f, 0.08237738f, 0.08022205f, 0.10168343f, 0.06794579f, -0.08037661f, -0.20594204f, -0.13493371f, -0.05614077f, 0.03317273f, 0.14216415f, 0.27276933f, - -0.23050462f, -0.75246507f, -0.69868854f, -0.48346371f, -0.40917848f, -0.36594095f, -0.07600729f, 0.12198463f, 0.35806061f, 0.42664099f, 0.36253664f, 0.28721164f, 0.28501428f, 0.31580309f, 0.39290382f, 0.46609294f, - -0.67820482f, -0.00872112f, 0.40025028f, 0.70327670f, 0.42493234f, -0.57698003f, -0.97061329f, -0.62910745f, -0.24969320f, -0.09521511f, 0.04433478f, 0.16549806f, 0.17050527f, 0.26401941f, 0.52200672f, 0.51371134f, - 1.15515222f, -0.29885937f, -0.45759359f, -0.16519237f, -0.04117621f, -0.07252194f, -0.02430911f, -0.04766781f, -0.02328497f, -0.05048145f, -0.05153410f, -0.06528098f, -0.04522347f, -0.01163017f, 0.03517569f, 0.16442759f, - 1.26308471f, 0.47631737f, 0.20702857f, 0.04885555f, 0.01820924f, -0.04929548f, -0.00848071f, -0.02414509f, -0.04549576f, -0.16589601f, -0.22069993f, -0.30533811f, -0.30611208f, -0.31300078f, -0.32636395f, -0.24866742f, - -0.64451248f, -0.26649107f, 0.11640199f, 0.09050698f, -0.25875099f, -0.58989672f, -0.18201608f, 0.56293201f, 0.69520096f, 0.55973258f, 0.03137457f, -0.53909145f, -0.42689946f, 0.14106379f, 0.40632407f, 0.30412130f, - 0.15140746f, 0.14125954f, -0.08456824f, -0.13219101f, 0.06042009f, 0.33575532f, 0.35779441f, 0.19239547f, -0.11511443f, -0.41291307f, -0.06796502f, 0.62883409f, 0.54647417f, -0.03056743f, -0.64102233f, -0.92999908f, - -0.20214866f, 0.33358969f, 0.69126333f, 0.34454972f, 0.05105591f, 0.16949466f, 0.15791728f, -0.06633089f, -0.02155995f, 0.20242418f, 0.31712646f, 0.04823767f, -0.30694375f, -0.55917643f, -0.61612875f, -0.54337052f, - 0.11822897f, -0.04039421f, 0.70914148f, 0.55687588f, 0.06691609f, -0.01671241f, 0.38831368f, 0.48498674f, 0.23982281f, -0.11333950f, -0.44950589f, -0.59143612f, -0.55439378f, -0.42178388f, -0.28206333f, -0.09465644f, - -0.14336086f, 0.05638831f, -0.01441642f, -0.42382782f, -0.38698654f, 0.24817171f, 0.77752198f, 0.25906019f, -0.48986881f, -0.97798705f, -0.62796677f, 0.10790457f, 0.39301453f, 0.49075265f, 0.45648021f, 0.27511976f, - 0.57860103f, -0.01948333f, -0.01550826f, 0.52219942f, 0.68939814f, 0.35139876f, -0.01666617f, -0.21673535f, -0.47658403f, -0.68042929f, -0.65034996f, -0.34910948f, -0.19976833f, -0.03318456f, 0.13815711f, 0.37806438f, - 0.37246276f, -0.08878862f, -0.58662283f, -0.58539914f, -0.25552364f, 0.03268078f, 0.23525090f, 0.52779846f, 0.89804404f, 0.85582758f, 0.41881201f, -0.00512611f, -0.24135956f, -0.44973199f, -0.57601809f, -0.55230687f, - -0.32189259f, -0.20721675f, -0.09742343f, -0.05501794f, -0.02597120f, -0.10341441f, -0.07152803f, 0.00321003f, 0.14348106f, 0.13459909f, 0.13417173f, 0.08360042f, 0.09862647f, 0.09372765f, 0.07551569f, 0.11553216f, - 0.23782332f, 0.49257946f, 0.16314649f, -0.21082378f, -0.15908458f, 0.19948076f, 0.80829724f, 0.74048420f, 0.31470714f, -0.11736674f, -0.41702302f, -0.38958905f, -0.30642209f, -0.41287171f, -0.48993898f, -0.45339847f, - -0.64636094f, -0.04385833f, 0.14399510f, -0.43842603f, -0.73607781f, -0.26594508f, 0.62882301f, 0.35001150f, 0.28828962f, 0.02070640f, 0.04274640f, 0.10066767f, 0.01277906f, 0.02855391f, 0.23224313f, 0.28185233f, - 0.47046627f, 0.94887935f, 0.24713839f, -0.23737461f, -0.23876072f, -0.07439994f, -0.09495447f, -0.13384673f, -0.10919962f, 0.11561096f, 0.34750397f, 0.22863541f, -0.07880257f, -0.39830725f, -0.49574485f, -0.49684374f, - -0.40909559f, -0.18655327f, 0.13106838f, 0.38799987f, 0.49861722f, 0.83281701f, 0.69114756f, 0.20069371f, -0.12792677f, -0.35587040f, -0.42614275f, -0.34440943f, -0.28876141f, -0.27425834f, -0.22103645f, -0.10828931f, - -1.18999475f, -0.19958884f, -0.14983643f, 0.01470880f, -0.02795637f, -0.14641321f, -0.31784893f, -0.46245588f, -0.18208072f, 0.19701783f, 0.59261157f, 0.51921614f, 0.35016513f, 0.38054069f, 0.38692917f, 0.23498570f, - 0.09958109f, -0.26177154f, -0.09010091f, 0.31898761f, 0.75461690f, 0.12276914f, -0.81281416f, -0.78184322f, -0.24358470f, 0.82758568f, 0.36579631f, -0.14176577f, -0.08975069f, -0.12652615f, 0.12350150f, -0.06468093f, - 0.08899403f, -0.19355344f, -0.19424186f, -0.07670148f, -0.01129831f, -0.12185644f, -0.22497393f, -0.43014230f, -0.38336267f, -0.26093033f, -0.06975312f, 0.14762185f, 0.34014822f, 0.41134546f, 0.45027987f, 0.52842445f, - 0.21499436f, 0.50168679f, 0.45504898f, 0.25411634f, -0.47901658f, -0.45717782f, -0.14093183f, 0.17265389f, 0.11115764f, -0.41915721f, -0.31922857f, 0.22345448f, 0.48226916f, 0.07143490f, -0.26830399f, -0.40300051f, - 0.12687524f, 0.05171471f, -0.07690770f, 0.26252085f, 0.27712144f, 0.23952572f, 0.03309903f, 0.01500629f, 0.06484326f, 0.06571283f, -0.16817282f, -0.63246792f, -0.98935090f, -0.44804742f, 0.39837118f, 0.78015619f, - -0.27518648f, -0.48420415f, -0.24141667f, 0.57134912f, 0.65714603f, 0.42293616f, -0.10408493f, -0.38791089f, -0.61076554f, -0.57292363f, -0.09457207f, 0.54285737f, 0.61562883f, 0.23132651f, -0.13569709f, -0.13448269f, - -0.44830103f, 0.90540056f, 0.00072142f, -0.39226111f, -0.46186317f, -0.43645456f, -0.37826714f, -0.24360826f, -0.04123674f, 0.14260549f, 0.22801709f, 0.22668095f, 0.21516528f, 0.17002730f, 0.24853909f, 0.26483493f, - 0.82582984f, -0.18396730f, -0.69977925f, -0.51672827f, 0.33935958f, 1.15275754f, 0.74107352f, 0.01951258f, -0.25558033f, -0.43304939f, -0.34099848f, -0.20947442f, -0.14398117f, -0.10182217f, -0.18238069f, -0.01077166f, - -0.05956926f, -0.06776164f, 0.03443600f, -0.24779379f, -0.39446507f, 0.19355305f, 0.85153169f, -0.02976018f, -0.70253585f, 0.23290277f, 0.42513902f, -0.02301892f, -0.00892405f, -0.00056059f, -0.02586520f, -0.17730813f, - -0.10475355f, -0.12240226f, 0.23596905f, 0.84034179f, 1.10352903f, -0.04380181f, -0.55005573f, -0.07517667f, 0.38548284f, 0.23177362f, -0.44010180f, -0.37858708f, -0.16160512f, -0.18482124f, -0.37409253f, -0.36169852f, - -0.66969186f, 0.05371874f, -0.03936352f, -0.29928720f, -0.41624260f, -0.41299981f, -0.08577629f, 0.31675281f, 0.52331795f, 0.62411866f, 0.60734652f, 0.31853824f, 0.22382100f, -0.00426635f, -0.24809569f, -0.49189053f, - 0.42558925f, -0.08740923f, -0.12413315f, 0.07160194f, 0.21621681f, 0.18737853f, 0.20692231f, 0.06594840f, 0.06316038f, -0.01455973f, -0.09736051f, -0.19278266f, -0.20576965f, -0.20479396f, -0.19511934f, -0.11488934f, - 0.36293062f, -0.57831316f, -0.52476107f, -0.18291608f, 0.05956296f, 0.17827873f, 0.56052629f, 0.90619512f, 0.33375509f, -0.31016948f, -0.35518802f, -0.18057272f, -0.07051228f, -0.11858827f, -0.10671145f, 0.02648366f, - -0.47233802f, -0.10696118f, -0.17385597f, -0.31283671f, -0.54242892f, -0.48720345f, -0.41705631f, -0.17742297f, 0.04283104f, -0.05195671f, -0.10468624f, -0.03852503f, 0.06812391f, 0.59475499f, 1.17499043f, 1.00457125f, - 0.33658160f, 0.35011487f, 0.45187233f, -0.02492518f, -0.55350758f, -0.59303580f, -0.31109052f, 0.13779098f, 0.55888251f, 0.84708841f, 0.47270673f, -0.43127783f, -0.54032183f, -0.34904867f, -0.17752966f, -0.17430036f, - 0.44845114f, -0.49717161f, -0.47780018f, 0.51116217f, 0.25239415f, -0.46774617f, -0.37660723f, -0.11699702f, 0.09542037f, -0.01250943f, 0.20050057f, 0.40176439f, 0.32380431f, 0.15297561f, -0.14232876f, -0.29531216f, - 0.58997624f, 0.33423174f, -0.49272429f, -0.77991590f, -0.63691990f, -0.16375248f, 0.20892044f, 0.18843065f, 0.17599488f, 0.14061586f, 0.15322675f, 0.18367503f, 0.13457790f, 0.01264192f, -0.03498125f, -0.01399761f, - 0.11883889f, -0.17653462f, -0.07102121f, -0.16170325f, -0.31396815f, -0.45007863f, -0.66549732f, -0.56194237f, -0.04368741f, 0.74826150f, 1.05944395f, 0.45896665f, 0.13555009f, 0.05510292f, 0.02009383f, -0.15182464f, - 0.07240272f, -0.58533213f, -0.60637060f, -0.30890106f, -0.02128210f, 0.09681284f, 0.16938452f, 0.09862013f, 0.19046479f, 0.19100352f, 0.26416808f, 0.26993362f, 0.23648423f, 0.09763257f, -0.04637479f, -0.11864633f, - 1.00841842f, 0.48487093f, -0.06341281f, -0.08270476f, 0.05744570f, 0.01750478f, -0.34725114f, -0.56805040f, -0.46574885f, -0.30005483f, -0.09520550f, 0.06924440f, 0.18895007f, 0.12019539f, -0.01497133f, -0.00923003f, - -0.11951983f, -0.09981565f, -0.02725746f, -0.30082482f, 0.20230754f, 0.13666509f, -0.43246623f, 0.35244293f, 0.18119722f, 1.02992782f, -0.88125774f, 0.02331986f, 0.31122766f, -0.27229286f, 0.03194423f, -0.13559793f, - 0.30038871f, 0.08947897f, -0.39317595f, -0.46247446f, -0.42411556f, -0.42404287f, -0.31600225f, -0.23970776f, -0.22563637f, -0.14999339f, 0.24040805f, 0.88216954f, 0.90562440f, 0.49896646f, -0.00532430f, -0.27656328f, - -1.03852817f, -0.43685628f, 0.97570249f, 0.40073542f, -0.16567993f, -0.21536660f, 0.12504130f, 0.05185039f, 0.10097880f, 0.11493671f, 0.11604106f, 0.09278894f, 0.06924125f, -0.04393053f, -0.08352009f, -0.06343456f, - 0.63612744f, 0.65518210f, 0.45922163f, 0.32046049f, 0.42927283f, 0.43905062f, 0.21015594f, -0.14220340f, -0.37678678f, -0.46507109f, -0.45569496f, -0.37686899f, -0.32849396f, -0.33044372f, -0.35635326f, -0.31755504f, - 0.41636915f, 0.62005731f, 0.06636205f, -0.59228655f, 0.33311937f, 0.75787668f, 0.00941011f, -0.45161756f, -0.65103077f, -1.10958672f, -1.02188609f, -0.67703448f, 0.33622739f, 1.61684726f, 0.14432118f, 0.20285196f, - -0.54161629f, 0.29651460f, 0.48390239f, 0.54479388f, 0.45539891f, 0.27213590f, -0.06343843f, -0.24873747f, -0.31972562f, -0.38332671f, -0.30589718f, -0.21560606f, -0.11351916f, -0.04853252f, 0.04142231f, 0.14623145f, - -0.21538006f, -0.50670918f, -0.02385513f, 0.35315677f, 0.10824776f, 0.03860134f, 0.48712274f, 0.49283326f, 0.39503514f, 0.30292369f, 0.35920722f, 0.11075640f, -0.28306221f, -0.52442456f, -0.56662428f, -0.52782887f, - 0.24246654f, 0.15496835f, 0.07742345f, -0.00816546f, -0.02214009f, -0.12207666f, -0.09321134f, -0.14020839f, -0.02096415f, 0.02403039f, -0.00227972f, -0.07257466f, -0.06385085f, -0.03120190f, -0.01017645f, 0.08796095f, - 0.55718201f, 0.39817200f, 0.01585643f, -0.42726280f, -0.49946467f, -0.23926890f, 0.12647764f, 0.16539668f, -0.09322228f, -0.28903514f, -0.36248464f, -0.37621498f, -0.21830881f, 0.12546719f, 0.47757747f, 0.63913280f, - 0.07202509f, -0.30917825f, 0.26796130f, 0.18122649f, -0.74238320f, -0.65070972f, 0.20487278f, -0.03910861f, -0.13788223f, -0.13927704f, 0.30951126f, 0.22564689f, 0.18217460f, 0.23128586f, 0.20552209f, 0.13831273f, - 0.81154454f, 0.16848402f, -0.17973760f, -0.10712113f, -0.08562767f, -0.33154566f, -0.24733460f, -0.19259111f, 0.09705231f, 0.36926093f, 0.39058223f, 0.34681425f, 0.16685070f, -0.13716590f, -0.45775544f, -0.61170978f, - -1.33280729f, -0.16122649f, -0.09275794f, 0.58345947f, 0.61239977f, 0.50766167f, 0.06032890f, 0.13414746f, 0.18885722f, 0.13865434f, 0.23772269f, -0.25267260f, -0.54709895f, -0.31230173f, 0.07737009f, 0.15826345f, - -1.08561454f, -0.71787872f, -0.33522393f, 0.09636394f, 0.26521236f, 0.37639836f, 0.31311513f, 0.09537412f, -0.07885832f, -0.23990515f, -0.16502660f, 0.10895014f, 0.26463981f, 0.29732376f, 0.35578048f, 0.44934924f, - -0.29274363f, 0.08361693f, 0.01766194f, -0.22807328f, -0.16950675f, 0.28608384f, 0.00299181f, 0.07025513f, -0.20633117f, 0.48438844f, 0.91263549f, 0.04231580f, -0.66916627f, -0.44689801f, 0.06041835f, 0.05235140f, - 0.18067823f, -0.43833102f, -0.91255750f, -0.38799121f, 0.28155095f, 0.40506215f, 0.07352559f, -0.10582149f, -0.13688260f, -0.20626464f, -0.13280234f, -0.02533342f, 0.03247104f, 0.20876704f, 0.46466759f, 0.69926172f, - 0.51511088f, 0.81421556f, 0.82445640f, 0.01131859f, -0.32041051f, -0.39839079f, -0.43152495f, -0.42594915f, -0.41684800f, -0.38010709f, -0.25091606f, -0.15334343f, -0.03594408f, 0.06862608f, 0.21814936f, 0.36155722f, - -0.74835512f, -0.03907167f, -0.02730968f, 0.01017743f, 0.06598847f, 0.36210429f, 0.29611340f, 0.34006521f, 0.09628113f, -0.15142368f, -0.62878543f, -0.79996695f, -0.45331571f, 0.20593004f, 0.80186308f, 0.66970511f, - -0.25432502f, 0.38418428f, 0.43145928f, 0.30498956f, 0.19189249f, -0.25021553f, -0.53882666f, -0.61584834f, -0.43654724f, -0.03402395f, 0.45760398f, 0.60327277f, 0.53610474f, 0.16098234f, -0.30297334f, -0.63772932f, - -0.42321919f, 0.85086362f, 0.60159420f, 0.08633772f, -0.28445894f, -0.22512885f, 0.23909004f, 0.20046697f, 0.01484137f, -0.11652413f, -0.12017169f, -0.26922922f, -0.26311675f, -0.18921524f, -0.06712212f, -0.03500777f, - 0.58209071f, -0.26533411f, -0.20240535f, 0.27577532f, 0.65478295f, 0.66491349f, 0.41026256f, 0.22123940f, 0.15813271f, 0.07048989f, -0.03133192f, -0.19389440f, -0.34519672f, -0.53017394f, -0.73238212f, -0.73696843f -}; -const float ivas_sns_cdbk_tcx20_stage3[ 32 * 16 ] = { - -0.08443224f, -0.18703635f, -0.02297765f, 0.35108322f, -0.47365404f, 0.60080101f, -0.14560352f, 0.01413276f, 0.01222370f, 0.01369841f, 0.05509108f, 0.03233707f, 0.01187713f, -0.08225931f, -0.08910713f, -0.00617424f, - -0.45134081f, -0.18205893f, -0.21886586f, -0.27082278f, -0.18872267f, -0.08438255f, 0.11808124f, 0.11472340f, 0.08049694f, 0.05868671f, 0.08856118f, 0.10686811f, 0.14792971f, 0.16522330f, 0.21823435f, 0.29738868f, - -0.11328915f, 0.10130429f, -0.14943437f, 0.15645630f, 0.63935450f, 0.37821704f, -0.21310801f, -0.24867988f, -0.01659672f, 0.03328198f, -0.08180066f, -0.05657044f, 0.10906149f, 0.03196869f, -0.22137928f, -0.34878580f, - 0.05458665f, -0.05919364f, -0.13460386f, 0.10683925f, 0.02486665f, -0.03996090f, -0.07800776f, -0.00646458f, -0.21155480f, -0.27387617f, 0.02240932f, 0.70908553f, -0.66258796f, -0.11916859f, 0.46104817f, 0.20658280f, - -0.18236160f, -0.42556974f, -0.01518583f, 0.40249814f, 0.16028064f, -0.31751965f, -0.32775039f, -0.07115151f, 0.14131570f, 0.25092515f, 0.30150209f, 0.11921413f, 0.03049898f, 0.00963513f, -0.00838672f, -0.06794450f, - 0.43233298f, 0.11411029f, -0.14415844f, -0.34176452f, -0.41588457f, -0.29962161f, 0.10637969f, 0.23407196f, 0.10305969f, -0.00062410f, 0.02900924f, 0.03866877f, 0.08640844f, 0.05154612f, 0.00161694f, 0.00484903f, - -0.21512794f, 0.25425865f, 0.27105566f, -0.05213586f, -0.05906940f, -0.26548344f, -0.44413633f, 0.03920286f, 0.46845996f, 0.41236263f, -0.31903770f, -0.32961136f, 0.22647316f, 0.19335126f, -0.03700087f, -0.14356117f, - 0.21924285f, -0.02083234f, -0.21264229f, -0.32008443f, 0.85787441f, -0.31109029f, -0.11710511f, 0.15258065f, -0.05422604f, 0.04703640f, 0.03138786f, 0.00284139f, -0.14128648f, -0.12246651f, -0.12553053f, 0.11430042f, - -0.06983219f, 0.15566395f, 0.00257636f, -0.43107600f, -0.19146497f, 0.19866667f, 0.23130140f, -0.15042179f, -0.31509935f, -0.19492938f, 0.13173040f, 0.34976123f, 0.35522809f, 0.15128504f, -0.03897684f, -0.18441264f, - 0.03835343f, -0.41781092f, -0.09130119f, 0.23649600f, 0.31864720f, 0.31965077f, 0.31997092f, 0.09379415f, -0.07805132f, -0.17350540f, -0.16066354f, -0.15534991f, -0.10595695f, -0.07769963f, -0.06267573f, -0.00389790f, - -0.06072967f, -0.08529762f, -0.25895528f, -0.11410745f, -0.03994694f, 0.00520744f, 0.13029546f, 0.20924505f, 0.20033325f, 0.00128218f, -0.48912530f, -0.29001748f, 0.59798769f, 0.57708579f, -0.00334114f, -0.37991599f, - 0.67709987f, 0.24479940f, 0.09839041f, 0.09240624f, 0.04874621f, -0.07903978f, -0.10677716f, -0.20070119f, -0.12618873f, -0.06680438f, -0.05551493f, -0.11559282f, -0.11011740f, -0.12021879f, -0.12904082f, -0.05144612f, - -0.24390844f, -0.02971498f, 0.26491058f, 0.32477805f, 0.15268137f, -0.03230336f, -0.09305650f, -0.07114758f, -0.26964124f, -0.44939594f, -0.31245133f, 0.05828219f, 0.30712838f, 0.31280972f, 0.10713241f, -0.02610336f, - 0.19735739f, -0.09060264f, 0.00825537f, -0.36599055f, 0.05585799f, 0.37908316f, -0.38413173f, 0.35027949f, 0.34555851f, -0.34241207f, -0.18091006f, 0.16295794f, 0.08399265f, -0.12258257f, -0.08886776f, -0.00784505f, - 0.18552089f, -0.05448505f, -0.06090343f, 0.28995307f, -0.00222442f, -0.38233148f, -0.18031475f, 0.21268787f, 0.02073848f, -0.18932508f, -0.18523794f, -0.18812600f, -0.12671694f, 0.01228197f, 0.22055935f, 0.42792350f, - 0.12799222f, 0.22968936f, 0.03802711f, -0.14099927f, -0.08635323f, 0.16987494f, 0.35348472f, 0.04505467f, -0.26388915f, -0.34916901f, -0.22942166f, -0.17684250f, -0.08724829f, -0.00054213f, 0.12610262f, 0.24423959f, - -0.08038187f, -0.16879152f, -0.00176772f, 0.35376535f, -0.37011098f, -0.36320739f, 0.66636341f, -0.06773157f, -0.07814045f, -0.04765960f, -0.03365673f, 0.02181851f, 0.03254002f, 0.03483427f, 0.02717800f, 0.07494827f, - -0.34868864f, 0.17040333f, 0.25260784f, 0.10076787f, 0.06839398f, -0.02800665f, -0.06848675f, -0.16826923f, -0.07268923f, 0.01087754f, 0.05460110f, 0.00431011f, 0.03885215f, 0.00975901f, -0.01527130f, -0.00916121f, - 0.18571700f, 0.08336153f, 0.02979922f, -0.39409904f, -0.12098272f, 0.43026379f, -0.26722488f, -0.41282119f, 0.02970150f, 0.49897713f, 0.10843837f, -0.24094187f, -0.08115504f, 0.00006204f, 0.10433840f, 0.04656578f, - 0.00538329f, -0.07750994f, -0.10910098f, 0.04048538f, 0.03334399f, 0.28342260f, 0.14581840f, -0.24746813f, -0.34416074f, 0.06151045f, 0.68745611f, 0.19063398f, -0.23771814f, -0.28316033f, -0.12688702f, -0.02204889f, - -0.60521242f, -0.06124017f, 0.11564466f, 0.07475615f, 0.11824730f, 0.14189819f, 0.27204580f, 0.27978428f, 0.25196977f, 0.13866750f, 0.00205101f, -0.10150602f, -0.11644945f, -0.18929950f, -0.17648802f, -0.14486907f, - 0.06856566f, -0.13844197f, -0.26691240f, -0.18845012f, -0.05126065f, 0.00304429f, 0.11414309f, 0.06950182f, 0.19286717f, 0.29037166f, 0.27053650f, 0.17652627f, 0.09171994f, -0.09001258f, -0.24528745f, -0.29691120f, - -0.13004111f, 0.35130055f, 0.29363124f, -0.18853208f, -0.39468716f, -0.19791109f, -0.04383464f, 0.00894901f, 0.12616722f, 0.23070746f, 0.26441755f, 0.01948829f, -0.23089364f, -0.30363455f, -0.02382649f, 0.21869951f, - 0.11164215f, 0.03116967f, -0.06353187f, 0.16924336f, -0.01461062f, -0.19152070f, 0.03686445f, 0.20477538f, -0.03967336f, -0.32744743f, -0.17088429f, 0.63829176f, 0.35280729f, -0.43549735f, -0.27277762f, -0.02885087f, - -0.30725406f, 0.74701729f, -0.39274145f, 0.04302180f, 0.07483049f, -0.03413902f, 0.09344659f, 0.09169015f, 0.04345559f, -0.04477331f, -0.00176985f, -0.03585142f, -0.03405962f, -0.07575575f, -0.09739054f, -0.06972689f, - 0.28265268f, -0.39222951f, -0.42695953f, -0.10897533f, 0.07424889f, 0.08797478f, 0.00908971f, -0.13637855f, -0.12075776f, -0.04977985f, 0.06395383f, 0.09442120f, 0.15174794f, 0.13939497f, 0.13041070f, 0.20118587f, - -0.06637296f, 0.10778732f, -0.07433513f, -0.03524749f, -0.17212396f, -0.11995773f, 0.04291853f, -0.06480863f, -0.07793575f, 0.16559639f, 0.16476497f, -0.45667097f, -0.18714125f, 0.71725922f, 0.42534599f, -0.36907862f, - 0.15419735f, 0.13519411f, 0.37767798f, 0.23431801f, -0.02281061f, -0.05079690f, 0.14170781f, 0.09854410f, 0.01337290f, -0.01979078f, -0.01296254f, -0.03126860f, -0.07566643f, -0.16863998f, -0.32784959f, -0.44522679f, - -0.24074183f, 0.08320241f, 0.21818929f, 0.23760260f, 0.19352113f, 0.17458723f, -0.14563963f, -0.24861723f, -0.22656746f, -0.05362363f, 0.00368164f, -0.25389215f, -0.34172497f, -0.16702059f, 0.23332537f, 0.53371777f, - 0.03933551f, -0.61436501f, 0.74997308f, -0.14605678f, -0.06355008f, -0.07845237f, 0.03677743f, -0.01381658f, 0.03542562f, 0.01940321f, 0.04277388f, 0.01439240f, 0.05417023f, -0.03165523f, -0.04388511f, -0.00047013f, - 0.19660049f, -0.03582845f, -0.21224511f, -0.09633821f, 0.02140122f, 0.06690902f, 0.14753796f, 0.23491232f, 0.40075372f, 0.33318442f, -0.21453422f, -0.44835823f, -0.31995723f, -0.14770359f, -0.02720588f, 0.10087175f, - 0.22313452f, 0.23174662f, 0.13588360f, -0.01979092f, -0.17483898f, -0.36387601f, -0.35104947f, -0.34545228f, -0.17072761f, 0.01654692f, 0.12560464f, 0.14070090f, 0.18025650f, 0.13082045f, 0.10588357f, 0.13515746f -}; -const float ivas_sns_cdbk_tcx20_stage4[ 32 * 16 ] = { - -0.01178932f, -0.08216325f, 0.00009975f, 0.07861932f, 0.10639093f, 0.10607783f, -0.11972309f, 0.01910820f, -0.05635505f, 0.02765448f, -0.08840101f, -0.09623400f, 0.34917350f, -0.19835894f, -0.46938213f, 0.43528268f, - -0.08636054f, 0.13923351f, -0.15932705f, -0.10849641f, -0.02303533f, -0.23968519f, -0.02192257f, 0.50128910f, 0.27139459f, -0.07262939f, -0.06622134f, -0.01073419f, -0.04308095f, -0.05629457f, -0.03175020f, 0.00762044f, - 0.24815560f, 0.14657944f, 0.07172491f, 0.02302382f, 0.01991109f, -0.10204469f, -0.24960876f, -0.07085594f, 0.12223419f, 0.06999865f, 0.10986748f, 0.13492392f, 0.05865008f, -0.10366906f, -0.23987720f, -0.23901358f, - -0.15438243f, -0.04559005f, 0.16760111f, 0.26289859f, 0.24002732f, 0.06333052f, -0.04293731f, 0.16191749f, 0.12993586f, -0.15916904f, -0.24049436f, -0.13688115f, -0.13764233f, -0.11140102f, -0.01899323f, 0.02178000f, - -0.09362153f, -0.06475772f, -0.01949932f, -0.04249530f, -0.05109865f, 0.07410551f, -0.01006480f, 0.04753318f, -0.02781557f, 0.07745214f, 0.06146913f, -0.16546467f, -0.41512457f, 0.10097607f, 0.66727071f, -0.13886467f, - -0.07368760f, 0.36035427f, 0.21605884f, -0.01438276f, -0.11360433f, -0.05644934f, 0.03063785f, -0.05006328f, -0.07521149f, -0.13595728f, -0.01277458f, 0.04492285f, 0.01200858f, -0.04176021f, -0.04570247f, -0.04438907f, - 0.09516185f, -0.01929782f, 0.00494854f, -0.09763747f, -0.07344490f, 0.12994610f, 0.48094184f, -0.48192847f, -0.05573409f, 0.26426544f, -0.27655157f, -0.08642901f, 0.08435032f, 0.13304512f, -0.05782422f, -0.04381160f, - -0.09313450f, 0.05540574f, 0.01201341f, -0.06726039f, -0.10451812f, 0.02669040f, -0.05484815f, 0.07449424f, -0.34344135f, 0.56109258f, -0.27428709f, -0.09301413f, 0.41965904f, -0.13902794f, 0.18473846f, -0.16456202f, - 0.08693855f, 0.01453042f, -0.11107078f, 0.06241724f, 0.10204906f, -0.07064796f, -0.13846291f, 0.08293345f, -0.10757619f, -0.22863306f, 0.03213009f, 0.19644778f, 0.16452805f, 0.34110370f, 0.09006750f, -0.51675482f, - -0.18423905f, 0.01384230f, 0.26714303f, -0.40934167f, 0.39275996f, -0.01237613f, -0.25919307f, -0.08619564f, -0.04046283f, -0.01126873f, -0.01664395f, 0.01744563f, 0.10282249f, 0.09607820f, 0.04998616f, 0.07964328f, - -0.02274322f, 0.17908332f, -0.02788687f, 0.00807798f, -0.14435131f, -0.02676761f, 0.10369709f, -0.23851723f, 0.57714821f, -0.24897036f, -0.18048434f, 0.02001729f, -0.12740088f, -0.09982727f, 0.00840552f, 0.22051971f, - 0.13771932f, -0.17471600f, 0.18563016f, 0.18284665f, 0.11307352f, 0.20075992f, -0.03584593f, -0.25044388f, -0.20529947f, -0.11730357f, 0.05388263f, 0.08544750f, 0.04416102f, -0.02585125f, -0.09278592f, -0.10127474f, - 0.08834726f, 0.11313223f, -0.16483942f, -0.28318232f, -0.23943962f, -0.10440104f, -0.03978272f, -0.07375089f, -0.00562577f, 0.02329676f, 0.14600550f, 0.17681015f, 0.14410817f, 0.09264978f, 0.05695417f, 0.06971767f, - 0.14265864f, -0.42999794f, -0.17884255f, -0.08097949f, -0.04680661f, -0.04620171f, 0.02411542f, 0.04266824f, 0.15894248f, 0.24773695f, 0.15192868f, -0.01414995f, -0.13102813f, -0.07567236f, 0.04332535f, 0.19230306f, - -0.21142675f, -0.18455704f, -0.13706857f, -0.09760966f, -0.00844340f, 0.14865602f, 0.20607338f, 0.12012844f, -0.00914924f, -0.14368559f, -0.00265126f, 0.10043210f, 0.09154737f, 0.03443178f, 0.02422327f, 0.06909914f, - 0.18450361f, 0.00435351f, 0.27864126f, 0.17704943f, -0.20479796f, -0.29862599f, -0.17089168f, -0.09881143f, 0.04783000f, 0.14260548f, -0.02349078f, -0.20487241f, -0.13745683f, 0.05546335f, 0.10019847f, 0.14830206f, - 0.10317471f, -0.16998911f, 0.09734737f, 0.06796242f, -0.01161580f, -0.18371589f, -0.08936939f, 0.07107444f, -0.09565406f, -0.23557438f, 0.42834066f, 0.31175412f, -0.11511657f, -0.28572113f, -0.06889545f, 0.17599802f, - 0.11312034f, 0.08666296f, 0.02086535f, 0.12656018f, -0.12520471f, 0.04702581f, 0.39113807f, 0.09775371f, -0.00094471f, 0.08191930f, 0.07626151f, -0.13554986f, -0.29383511f, -0.25857022f, -0.15738811f, -0.06981449f, - 0.07590872f, 0.10290609f, -0.14618577f, 0.13491216f, 0.33869686f, -0.04072549f, -0.30046897f, -0.07243681f, 0.07180300f, 0.23060158f, 0.21642544f, -0.13575731f, -0.31781641f, -0.19431392f, -0.02233810f, 0.05878895f, - -0.11105764f, -0.05437616f, -0.00379085f, 0.08951467f, 0.39169243f, -0.38233560f, 0.34492699f, -0.09947370f, -0.08648526f, -0.03340088f, -0.02593483f, 0.11572014f, 0.01899877f, -0.03965890f, -0.06421047f, -0.06012863f, - -0.01630162f, 0.17784241f, -0.29989778f, 0.10469439f, 0.14861228f, -0.00722859f, -0.10711587f, -0.18435390f, -0.22539717f, -0.21441284f, 0.00336383f, 0.04362196f, 0.03914130f, 0.10650815f, 0.16959322f, 0.26133027f, - -0.45700261f, 0.07282251f, 0.00944859f, 0.03968330f, -0.02457975f, 0.11148291f, -0.02109853f, -0.18417192f, 0.02503845f, 0.10733751f, 0.21565042f, 0.09727523f, 0.00466877f, -0.01572810f, -0.00245341f, 0.02162664f, - 0.01471341f, -0.09796256f, 0.37685840f, -0.27373841f, -0.22809280f, 0.20207443f, 0.12508033f, 0.16172866f, 0.15442152f, -0.03971152f, -0.03731565f, 0.04320052f, -0.02493079f, -0.08894232f, -0.13155708f, -0.15582618f, - -0.04063466f, 0.14873431f, 0.10076527f, -0.09442471f, 0.02133939f, -0.04747602f, 0.02176493f, 0.52606315f, -0.60183613f, -0.05056878f, 0.18858100f, -0.00936749f, -0.17007143f, -0.00822640f, 0.01473704f, 0.00062041f, - -0.01851982f, 0.07661957f, -0.30452796f, 0.64817852f, -0.21819667f, -0.15094971f, -0.02014064f, 0.04976562f, 0.03988913f, 0.00229505f, -0.01596447f, -0.00497683f, 0.01888521f, 0.00912230f, -0.04741494f, -0.06406442f, - -0.18646693f, -0.25658854f, 0.20567339f, 0.06671960f, -0.24836724f, -0.23737029f, 0.03275858f, 0.09293590f, 0.06861982f, 0.01487215f, 0.10808605f, 0.17546010f, 0.16832370f, 0.12557457f, -0.00949461f, -0.12073619f, - -0.08559046f, -0.16350668f, -0.28729498f, 0.01179878f, 0.06195939f, 0.06121501f, -0.29667937f, -0.19145944f, 0.41150010f, 0.18707789f, -0.21406932f, 0.19248440f, 0.16889573f, 0.10825101f, 0.07412737f, -0.03870938f, - 0.00652202f, -0.15316918f, 0.25343593f, -0.09299964f, -0.22861167f, 0.06865193f, 0.02064443f, -0.10488496f, -0.18017250f, -0.21898191f, -0.08742146f, 0.02608617f, 0.05046582f, 0.08687786f, 0.21515984f, 0.33839723f, - 0.12533507f, 0.27191291f, 0.06056226f, -0.10872799f, 0.01799135f, 0.17589055f, -0.05514906f, -0.01148984f, 0.01373578f, -0.08944541f, -0.35717808f, -0.38014180f, 0.05531840f, 0.30742910f, 0.08016039f, -0.10620357f, - -0.01190022f, -0.24441497f, -0.07461266f, 0.02317252f, 0.05704737f, 0.16442883f, 0.06955004f, 0.05748732f, 0.05251523f, 0.22879327f, 0.21860705f, -0.37376474f, 0.03987437f, 0.33071525f, -0.23228300f, -0.30521565f, - -0.00581916f, 0.24592784f, -0.27266538f, -0.28914327f, 0.09129356f, 0.42079957f, 0.05815983f, 0.01136363f, 0.03980200f, -0.04215296f, 0.01465284f, 0.03859289f, -0.13354970f, -0.16935580f, -0.05814064f, 0.05023468f, - 0.44241891f, -0.06885632f, -0.14130761f, -0.04771012f, -0.00863562f, 0.00586591f, 0.12381405f, 0.08059256f, -0.06764947f, -0.22513354f, -0.10536820f, 0.02669478f, 0.01147300f, -0.01584685f, -0.02845628f, 0.01810479f -}; - -const float *const ivas_sns_cdbks_tcx20[SNS_MSVQ_NSTAGES_TCX20] = { ivas_sns_cdbk_tcx20_stage1, ivas_sns_cdbk_tcx20_stage2, ivas_sns_cdbk_tcx20_stage3, ivas_sns_cdbk_tcx20_stage4 }; -const float ivas_sns_means_tcx20[M] = { - 0.9155f , 1.2408f , 1.0050f , 0.5846f, - 0.2472f , 0.1902f , 0.0984f , 0.1039f, - -0.0139f , -0.0856f , -0.4157f , -0.6148f, - -0.7026f , -0.7216f , -0.8052f , -1.0262f -}; - -const int16_t ivas_sns_cdbks_tcx10_levels[SNS_MSVQ_NSTAGES_TCX10] = { 128, 32, 8 }; -const int16_t ivas_sns_cdbks_tcx10_bits[SNS_MSVQ_NSTAGES_TCX10] = { 7, 5, 3 }; - -const float ivas_sns_cdbk_tcx10_stage1[ 128 * 16 ] = { - 0.06343891f, -0.00651786f, -0.56994713f, -0.98772396f, -1.35099293f, -1.24848646f, -1.20301995f, -0.81089507f, -0.06563095f, 1.11147581f, 1.73933309f, 1.65859611f, 1.26237806f, 0.68028141f, 0.12449909f, -0.39678907f, - -1.34007175f, -1.50272189f, -2.07958791f, -2.38322761f, -2.22156614f, -1.96435669f, -1.68760863f, -1.23664935f, -0.28772180f, 0.87765579f, 1.83822720f, 1.95281398f, 2.33671266f, 2.76119687f, 2.75790597f, 2.17899850f, - -0.51450332f, 0.69692757f, 1.90898730f, 1.89179379f, 1.41350404f, 0.03604267f, 0.02251128f, -1.04270018f, -0.97981089f, -0.36225564f, 0.14171617f, -0.32050715f, -0.56272675f, -0.38710633f, -0.74842203f, -1.19345103f, - 0.61027733f, -0.25705654f, -0.30960961f, 0.11651829f, 0.08424358f, -0.04474594f, -0.21961636f, -0.26522327f, -0.31681379f, -0.23903185f, -0.07879718f, 0.00383111f, 0.09522293f, 0.15157026f, 0.24747985f, 0.42175137f, - 0.06215930f, 0.74417332f, -0.05737044f, -0.84302341f, -0.79474372f, -0.48758880f, 0.00597663f, 0.39113473f, 0.94133689f, 1.03804127f, 0.53832521f, -0.22235026f, -0.44306288f, -0.22065599f, -0.22880587f, -0.42354568f, - -1.79298887f, -1.27561542f, -0.40453013f, 0.23597108f, 1.02842032f, 1.26211371f, 0.67302878f, 0.34945977f, 0.47749022f, 0.37809966f, 0.32913783f, 0.24544337f, -0.10938763f, -0.26555659f, -0.53889493f, -0.59219154f, - 1.13009762f, 0.63132036f, 0.20308733f, 0.12539517f, -0.05215684f, -0.59255734f, -0.72324525f, -0.47416068f, -0.34730473f, -0.17547668f, -0.01869868f, -0.01336213f, -0.03177292f, -0.01470495f, 0.12726970f, 0.22627027f, - 0.77990892f, 0.11720033f, -0.36217078f, -0.11533103f, -0.09211988f, -0.10379850f, 0.04466728f, 0.23851356f, 0.32838480f, 0.57072608f, 0.78005115f, 0.64032724f, 0.04609407f, -0.53665387f, -1.07338898f, -1.26240993f, - 0.71007500f, 1.67092184f, 0.87004285f, -0.47652190f, -0.41457815f, 1.09228787f, 1.43629613f, 1.29941339f, 0.74914490f, -0.87973861f, -1.00898687f, -0.76690679f, -0.87310138f, -0.89762148f, -1.11083002f, -1.39989674f, - 0.93106313f, -0.58060200f, -1.42018765f, -1.93078113f, -1.40332079f, -1.01406592f, -0.68270775f, -0.12421160f, -0.12818640f, 0.46306788f, 0.74384671f, 1.78170251f, 1.49298768f, 0.36128067f, 0.32905160f, 1.18106291f, - -0.34612942f, -0.05241863f, 0.63278953f, 1.64696186f, 1.83789559f, 1.82381570f, 1.71656555f, 1.45437140f, 1.06980287f, 0.39137818f, -0.16457688f, -0.79497784f, -1.78896933f, -2.38820658f, -2.55386733f, -2.48443600f, - -1.86975241f, -1.08195483f, -0.57202727f, -0.39808906f, -0.40936508f, 0.09703771f, 0.81017115f, 0.38629167f, 0.19481800f, 0.19706778f, -0.03872708f, -0.18683058f, 0.37148725f, 0.91055817f, 0.85929760f, 0.73001606f, - 0.13134993f, -0.43834896f, -0.42233235f, -0.34270675f, -0.42348478f, -0.62064185f, -0.67185252f, -0.57602218f, -0.46183286f, -0.05757593f, 0.38429775f, 0.63679540f, 0.59933007f, 0.44800121f, 0.69922041f, 1.11580320f, - -3.26282616f, -2.43458949f, -1.60312382f, -1.18490625f, -0.63841390f, -0.06739227f, 0.57790279f, 1.01010243f, 0.95682720f, 0.75035821f, 0.76084039f, 0.55166704f, 0.83933875f, 1.36392702f, 1.32925064f, 1.05103737f, - 2.94202112f, 3.01169534f, 2.23272878f, 2.33910012f, 1.97620433f, 1.92572769f, -0.00413067f, -1.30712114f, -1.48714461f, -1.62849896f, -1.56921600f, -1.60110814f, -1.73339679f, -1.81275951f, -1.69381023f, -1.59029306f, - -2.29630904f, -1.61967905f, -0.50968315f, 0.70826746f, 1.31943393f, 1.58078613f, 1.31857322f, 0.52237224f, 0.09330352f, 0.13994471f, 0.02623813f, -0.21467602f, -0.33140340f, -0.32793129f, -0.24016399f, -0.16907333f, - 1.17007844f, 1.46542856f, 1.12327460f, 0.78468376f, 0.28858044f, -0.24345469f, -0.36619581f, -0.30604001f, -0.24486928f, -0.39076408f, -0.42628982f, -0.47126418f, -0.48974406f, -0.58899141f, -0.61209496f, -0.69233731f, - 1.07869290f, -1.09624499f, -1.92296142f, -2.03260639f, -0.72727691f, 0.59938120f, 1.09296276f, -0.23244761f, -0.74213456f, -0.00394467f, 0.65433789f, 0.15922442f, 0.10516506f, 0.08483738f, 1.10833114f, 1.87468404f, - -0.45930662f, 0.49568081f, 0.92195224f, 1.70200988f, 1.24720421f, 1.19845895f, 0.75959352f, 0.23323360f, -0.27099240f, -1.38259199f, -2.25979609f, -0.92875900f, -0.06647214f, -0.58552485f, -0.33254823f, -0.27214292f, - -0.34979667f, 0.75395625f, 0.28769469f, -0.85592098f, -0.65167816f, 0.61099639f, 0.60402617f, 0.14561560f, -0.35073645f, -0.56010271f, -0.46661447f, -0.33527423f, -0.00166125f, 0.46634881f, 0.62977271f, 0.07337395f, - -0.41325825f, -0.71696540f, -0.72218212f, -0.64886200f, -0.33204525f, -0.13777071f, -0.05902665f, 0.08826462f, 0.09668422f, 0.34870144f, 0.76742933f, 1.02820877f, 0.66254418f, 0.26837143f, -0.04920095f, -0.18089312f, - -3.00863529f, -3.40420466f, -1.94263495f, -0.42577604f, 1.34874808f, 1.22039392f, -0.16945247f, -0.55999693f, 0.06330206f, 1.23795253f, 0.30477631f, 0.53425336f, 1.62154688f, 1.44462099f, 0.96061888f, 0.77448714f, - 1.81574209f, 1.72942805f, 0.78817895f, 0.12550764f, -0.50423190f, -0.81032090f, -0.83940826f, -0.95575724f, -0.70482913f, -0.32127670f, -0.08073867f, -0.13170408f, -0.16649118f, -0.08610719f, -0.03381103f, 0.17581953f, - -0.84693001f, -0.20800644f, 0.25371425f, 0.56604831f, 0.68467374f, 0.74501557f, 0.69436428f, 0.53975035f, 0.44393852f, 0.30580817f, 0.06566139f, -0.27742827f, -0.57148395f, -0.67328070f, -0.81658998f, -0.90525565f, - -0.44018762f, 0.22712975f, 1.11402502f, 1.98499541f, 1.52065113f, 0.79057891f, 0.55313940f, 0.32776632f, 0.39113088f, 0.10707747f, -0.20138118f, -0.67412788f, -1.34113027f, -1.39661518f, -1.43118002f, -1.53187281f, - -0.71632657f, -0.79492959f, -1.11328698f, -1.41494496f, -1.48929785f, -1.40383584f, -1.26657215f, -1.11367689f, -0.76426307f, 0.01056535f, 0.85354567f, 1.27473730f, 1.64108006f, 2.08311127f, 2.27822947f, 1.93586484f, - 2.05008554f, 2.18328135f, 1.98567996f, 2.35703511f, 2.27653310f, 2.41056123f, 1.36801069f, 0.12761937f, -0.59913124f, -1.45799255f, -1.89092221f, -1.99613693f, -2.20251841f, -2.33272106f, -2.21702011f, -2.06236397f, - -0.88997509f, -0.45675689f, 0.38059457f, 0.51582524f, 0.11775375f, -0.01509768f, -0.18542670f, -0.33776632f, -0.39018689f, -0.33129536f, -0.13149667f, 0.00113524f, 0.03060501f, 0.32190251f, 0.62848970f, 0.74169479f, - 1.19033790f, 0.59193623f, -0.18758267f, -0.71960274f, -0.81756997f, -0.65024529f, -0.64463404f, -0.82612299f, -0.84513928f, -0.45206413f, -0.04059069f, 0.00434486f, 0.50165507f, 1.00958611f, 0.97568033f, 0.91001135f, - -2.25864394f, -2.18529992f, -1.67272884f, -1.18053068f, -0.96703519f, -0.83661833f, -0.59641534f, -0.08623307f, 0.57868270f, 1.39398557f, 2.00205076f, 1.91429603f, 1.37348845f, 1.02732012f, 0.88340938f, 0.61027091f, - 1.13384373f, 2.01444926f, 1.64076134f, 0.39967630f, 0.11211256f, 0.60599786f, 0.41069653f, -0.08528479f, -0.18299306f, -0.80418851f, -1.03743576f, -1.04941914f, -0.88831874f, -0.76292972f, -0.67716107f, -0.82980704f, - -1.17168042f, -0.44794963f, 0.01219570f, -0.09679638f, 0.01681223f, 0.42983884f, 0.69873962f, 1.14025903f, 1.28455301f, 0.60046712f, -0.18327995f, -0.56883208f, -0.60793720f, -0.38487681f, -0.31833900f, -0.40317432f, - 0.85846316f, 0.89573242f, -0.03759975f, -0.56845446f, -0.63431292f, -0.69230128f, -0.59890012f, -0.27699442f, -0.10781577f, 0.38926803f, 0.44176667f, 0.74409936f, 0.51508281f, -0.44324047f, -0.56579214f, 0.08099815f, - -3.15663729f, -3.79941004f, -3.31993311f, -2.54887019f, -1.08297819f, 1.57490155f, 2.29511481f, 2.21386433f, 2.04448334f, 1.39028095f, 1.22351492f, 1.20294900f, 1.33557966f, 1.22044095f, 0.22504752f, -0.81835038f, - 2.10765319f, 2.66375515f, 1.73697111f, 0.50664812f, -0.22472176f, -0.63409486f, -0.65405139f, -0.71248479f, -0.73053296f, -0.87990271f, -0.82710167f, -0.73244187f, -0.64629112f, -0.47294253f, -0.23431056f, -0.26615160f, - -0.03257826f, 0.53214066f, -0.00109639f, -0.42211164f, -0.51464982f, -0.59747387f, -0.63145473f, -0.49761105f, -0.36163571f, 0.00923799f, 0.32394200f, 0.34648466f, 0.32420111f, 0.44177392f, 0.52684150f, 0.55398991f, - 0.38342101f, 0.05503415f, -0.69210895f, -1.40291256f, -1.20627913f, -0.22810180f, 0.91689677f, 1.67212414f, 1.26349034f, 0.48698570f, 0.10567292f, 0.13423949f, -0.02515828f, -0.41152165f, -0.51320898f, -0.53857267f, - -2.82653388f, -3.73292024f, -3.01554952f, 0.33800837f, 1.63071077f, 3.70049918f, 1.52548217f, -0.51327972f, -0.09119392f, 0.92240352f, 2.33190356f, 1.84268123f, -0.37179294f, -0.94969237f, -1.13179438f, 0.34106773f, - 1.56686851f, 0.88339322f, 0.31264631f, -0.04528796f, -0.42838354f, -0.20342114f, 0.40102389f, 0.54537791f, 0.35383369f, -0.18334298f, -0.75234358f, -0.76217615f, -0.36188398f, -0.46147282f, -0.54662536f, -0.31820590f, - 1.24862641f, 0.57117898f, 0.32856394f, 0.39564440f, 0.31824468f, 0.20893064f, 0.02628416f, -0.15359328f, -0.37616872f, -0.26748355f, -0.12954661f, -0.12215355f, -0.31835718f, -0.55834118f, -0.61233860f, -0.55948996f, - -0.59446013f, 0.48100057f, 1.20941553f, 0.41887505f, 0.63264306f, 1.37297652f, 1.40760513f, 0.91551762f, 0.67322895f, -0.90761879f, -1.23123057f, -0.97622159f, -0.96118737f, -0.53857839f, -0.69473239f, -1.20723297f, - -0.59728936f, -1.63533369f, -2.00769344f, -1.93041740f, -1.52949359f, -0.77428525f, -0.21146300f, 0.18478098f, 0.44962772f, 0.95017605f, 1.24326918f, 1.36658626f, 1.25105966f, 1.00442735f, 1.03660313f, 1.19944572f, - 0.32910504f, 1.16199966f, 2.05499236f, 2.56854877f, 2.45081012f, 1.66017811f, 1.01838813f, 0.51773322f, -0.06505376f, -1.14261830f, -1.77930778f, -1.94467446f, -1.83142606f, -1.76577923f, -1.67433287f, -1.55856482f, - -2.64386625f, -1.44973884f, -0.70503582f, -0.39387129f, -0.07345342f, 0.04530383f, 0.12054861f, 0.18110856f, 0.21747675f, 0.44785123f, 0.60100453f, 0.60149054f, 0.48165166f, 0.67654040f, 0.91879547f, 0.97419414f, - 0.52841759f, -0.23803980f, -0.77847320f, -1.06415798f, -1.29095335f, -0.94613842f, 0.01856631f, 0.57516289f, 0.58685158f, 0.24351075f, -0.23807950f, -0.16772309f, 0.27674343f, 0.40698887f, 0.73162063f, 1.35570347f, - -2.57939825f, -1.65066455f, -0.80960514f, -0.40285025f, -0.02550543f, 0.48071345f, 0.90391140f, 1.61193038f, 1.46090124f, 0.72305123f, 0.34664153f, 0.08297581f, -0.07460306f, 0.06306698f, -0.00946438f, -0.12110157f, - 1.93616583f, 2.87229439f, 2.28910932f, 1.18636717f, 0.28185288f, 0.08337698f, 0.52019726f, -0.70876138f, -1.13139506f, -1.42927692f, -1.07719650f, -0.84569529f, -1.10761102f, -1.14612879f, -0.78606400f, -0.93723475f, - -0.83260061f, -1.02726632f, -0.72610655f, 0.18186308f, 0.34897446f, 0.12845730f, 0.04139028f, 0.52688618f, 0.69166145f, 0.76853602f, 0.83316573f, 0.74702270f, 0.29499833f, -0.33104569f, -0.74851736f, -0.89741947f, - 2.77837874f, 1.31099865f, 0.62870774f, 0.35471489f, 0.05642577f, -0.02869061f, 0.19231930f, 0.50340721f, 0.36258783f, -0.06924684f, -0.52796695f, -0.75396481f, -0.89969036f, -1.23296254f, -1.40215690f, -1.27286039f, - -2.03034497f, -1.73876167f, -1.42952672f, -1.24259095f, -0.92252541f, -0.61137126f, -0.50926746f, -0.37515247f, -0.01804868f, 0.44616051f, 0.86247078f, 1.09558380f, 1.34244283f, 1.77606518f, 1.80302809f, 1.55183866f, - -0.13073542f, 0.74480506f, 1.75612393f, 1.94677409f, 1.45854395f, 0.14973385f, 0.41257896f, 0.78276795f, 0.53033406f, -0.97322979f, -1.31039960f, -1.18457724f, -1.39195239f, -0.74765434f, -0.89874803f, -1.14436551f, - -0.34864040f, 0.37594126f, 1.12760599f, 0.69668388f, 0.42042319f, 0.18779444f, -0.10969643f, -0.21695083f, -0.15889803f, -0.31866683f, -0.31049579f, -0.24646351f, -0.37724204f, -0.33366480f, -0.20076896f, -0.18696143f, - -0.21183487f, 0.60232151f, 0.88716970f, 0.69703105f, 0.10878166f, -0.60737034f, -0.81172315f, -0.92047926f, -0.64811892f, -0.24324457f, 0.15840527f, 0.21438269f, 0.31129327f, 0.53391758f, 0.13740501f, -0.20793704f, - -4.29885487f, -4.07150539f, -2.63799263f, -0.36599561f, 1.44131158f, 1.45858072f, -0.19422385f, -1.06386090f, -0.33862479f, 1.91691551f, 0.64172657f, 0.73115700f, 2.00475202f, 1.65789788f, 1.59229150f, 1.52642575f, - 2.70538594f, 1.21062684f, 0.58857880f, 0.37060452f, 0.32021415f, 0.15108056f, -0.18531087f, -0.47434646f, -0.64590620f, -0.70151444f, -0.68058335f, -0.63299041f, -0.53628956f, -0.62363375f, -0.52279857f, -0.34311771f, - -1.21504940f, -0.39554896f, 0.66755826f, 1.39859234f, 1.07486796f, 1.12290637f, 1.04295204f, 1.14165077f, 1.23441664f, 0.53720217f, -1.08842200f, -1.71470800f, -1.43192570f, -1.01274229f, -0.48508172f, -0.87666906f, - 0.79744189f, 0.76166108f, 0.24454768f, -0.10831092f, 0.07052421f, 0.61249105f, 1.01239329f, 0.92265182f, 0.79053239f, 0.48135056f, 0.14383439f, -0.46575922f, -0.96925167f, -1.31622221f, -1.46252773f, -1.51535724f, - 0.81612871f, -1.33697557f, -1.87521893f, -0.34596308f, 1.89973642f, 0.17905631f, -0.58156390f, -1.21825474f, -1.35128034f, -0.86896364f, -0.55987250f, -0.57592082f, -0.20226923f, 0.35191711f, 1.77194975f, 3.89749413f, - 1.63600586f, 1.88172004f, 2.47282363f, 2.31646225f, 1.68082996f, 0.43732883f, 0.54619537f, 0.53604274f, -0.42499034f, -1.38097531f, -1.67316581f, -1.66333999f, -1.66730967f, -1.61301407f, -1.62366867f, -1.46094527f, - -1.13086259f, -0.59286092f, -0.77851750f, -1.03233519f, -1.00728739f, -0.89574050f, -0.77142682f, -0.49554543f, -0.07881573f, 0.54315382f, 0.97530238f, 1.12272839f, 0.97460042f, 0.97504778f, 1.10466703f, 1.08789246f, - 2.01814493f, 0.44413768f, -0.35041288f, -0.98686383f, -1.26200527f, -1.52732432f, -1.48571248f, -1.19925108f, -0.92116223f, -0.35166881f, 0.13444272f, 0.18334560f, 0.92894956f, 1.08294765f, 1.35106569f, 1.94136698f, - -1.70233870f, -1.07878027f, -0.41699769f, -0.44160483f, -0.44460656f, -0.07853597f, -0.00754784f, 0.33653711f, 1.01426686f, 1.48915964f, 0.89682530f, 0.27439080f, 0.11875833f, 0.11843921f, 0.03694301f, -0.11490828f, - 2.92061289f, 2.48313078f, 1.67219449f, 1.01289511f, 0.89753859f, 0.94593326f, 0.70215728f, 0.23868842f, -0.29061326f, -1.00973596f, -1.40595256f, -1.63034802f, -1.68974684f, -1.71427450f, -1.62221007f, -1.51026992f, - -0.53491548f, -0.78055602f, -0.76775254f, 0.10333314f, 0.89464100f, 1.39260245f, 1.42278905f, 1.08133696f, 0.66191720f, 0.26667076f, 0.06990779f, -0.05792125f, -0.54825802f, -0.97098851f, -1.11014442f, -1.12266153f, - 0.08434699f, -0.45396949f, -0.94011771f, -1.20989965f, -1.27570370f, -1.00735662f, -0.43812010f, 0.32116477f, 0.90682311f, 1.07490930f, 1.04265682f, 0.83531254f, 0.64508330f, 0.31821119f, 0.09966431f, -0.00300507f, - -3.45239663f, -3.47846075f, -3.31323927f, -2.90259299f, -2.36355887f, -1.50192157f, -0.92288952f, -0.22530010f, 0.43258717f, 1.44935400f, 2.42148671f, 2.40769873f, 2.68306011f, 3.17878912f, 2.96783805f, 2.61954501f, - 0.48284645f, 1.41799541f, 1.97243102f, 1.59009976f, 1.22294070f, 0.43320660f, -0.04294311f, -0.31344005f, -0.66525145f, -1.13038241f, -1.07639821f, -0.88736938f, -0.84264379f, -0.79497080f, -0.64026957f, -0.72585115f, - -0.53516472f, -0.76920408f, -0.88526173f, -0.38845075f, -0.11227754f, 0.13805981f, 0.30967527f, 0.39937585f, 0.29135651f, 0.31552367f, 0.32154879f, 0.11114380f, 0.10183365f, 0.23587895f, 0.26513073f, 0.20083182f, - -0.82074713f, 0.00036242f, 0.05382877f, -0.93967714f, -1.34393534f, -0.63769734f, 0.72309703f, 0.71909478f, 0.67996995f, 0.71025231f, 0.03684615f, -0.42385779f, 0.20909277f, 0.74865506f, 0.36478854f, -0.08007303f, - -3.48156475f, -2.62401860f, -1.04625145f, 0.48561624f, 1.08462887f, 1.17430353f, 0.89095108f, 0.61098007f, 0.50455996f, 0.68603781f, 0.79217569f, 0.58623668f, 0.26474313f, 0.08681209f, -0.00104191f, -0.01416800f, - 0.84688039f, 0.96543736f, 0.75181222f, 0.42822852f, 0.24904957f, 0.14177234f, -0.40028407f, -0.85658294f, -0.99971434f, -0.98122097f, -0.75656716f, -0.49934498f, -0.24276416f, 0.09868884f, 0.51868958f, 0.73591908f, - -0.06813618f, -0.46119843f, -0.30096714f, 0.02701580f, 0.39106072f, 0.62007470f, 0.37968778f, 0.26617731f, 0.19689970f, 0.13864013f, 0.13523990f, 0.07059597f, -0.06298216f, -0.21734863f, -0.46878891f, -0.64597009f, - 0.51769554f, 1.42736951f, 1.88530137f, 0.81872770f, 0.32102451f, 1.12825115f, 1.21494458f, 1.01472394f, 0.70810844f, -0.50467729f, -1.98880367f, -2.08711611f, -1.72264586f, -0.93580475f, -0.50571272f, -1.29138527f, - 0.60536537f, -0.70354528f, -1.21617652f, -1.24262631f, -1.19828977f, -1.12565262f, -1.02203112f, -0.75894521f, -0.36826442f, 0.22795933f, 0.70544758f, 0.89015550f, 1.16228260f, 1.29703247f, 1.33542695f, 1.41186140f, - 1.04571798f, 1.61006483f, 1.19302962f, 0.57809989f, 0.71546259f, 1.30149630f, 1.62036473f, 1.44726990f, 1.32882491f, 0.70680094f, -0.39181833f, -1.57019972f, -2.33882246f, -2.53038720f, -2.43836110f, -2.27754281f, - -1.70543716f, -1.02771491f, -0.55943640f, -0.54366014f, 0.38503076f, 1.17876631f, 0.37193454f, -0.12189347f, 0.01303672f, -0.31900986f, -0.63608524f, -0.16956145f, 0.42659413f, 0.80300802f, 1.20767125f, 0.69675704f, - 1.23368326f, -0.17372473f, -0.75359852f, -0.99565343f, -0.84904797f, -0.66289765f, -0.45993622f, -0.17721316f, 0.04972474f, 0.35539595f, 0.55580381f, 0.47907626f, 0.35782172f, 0.37623101f, 0.34327632f, 0.32105845f, - -2.18352213f, -1.61901373f, -1.19957932f, -1.19527760f, -1.04950866f, -0.80750101f, -0.01092868f, 0.85242547f, 1.12490981f, 0.83609667f, 0.69994996f, 0.68985497f, 0.89390672f, 1.14712210f, 1.06776086f, 0.75330468f, - 2.33432113f, 2.91068592f, 2.96537876f, 2.14989074f, 1.35332201f, -0.15166191f, -0.61009155f, -1.11607408f, -1.38841709f, -1.32795548f, -1.18652766f, -1.19841345f, -1.27066378f, -1.28720326f, -1.20653804f, -0.97005218f, - -1.23488338f, -0.82668707f, -0.18190692f, 0.80577567f, 1.40765006f, 1.57572199f, 0.77649472f, 0.06817818f, -0.35316133f, -0.31163295f, -0.22814807f, -0.08516639f, -0.14974413f, -0.40747307f, -0.44196718f, -0.41305033f, - 1.49614141f, 2.17073361f, 1.21828130f, 0.24082715f, -0.04653730f, -0.02674890f, 0.07730547f, -0.75552212f, -0.53247648f, 0.68923075f, 0.51413502f, -1.15304142f, -1.36047405f, -1.08476009f, -0.71333064f, -0.73376398f, - -0.89704242f, -1.73833976f, -1.54624918f, -0.75197415f, -0.28436966f, -0.17513881f, -0.18327761f, -0.08090335f, 0.17526730f, 0.62711579f, 0.87938919f, 0.73687059f, 0.73766468f, 0.77613800f, 0.76077200f, 0.96407748f, - -0.74442989f, 0.06393849f, 0.79593747f, 2.27945407f, 2.65112193f, 2.16937280f, 1.04534068f, 0.40390110f, -0.66651353f, -1.35166042f, -1.46612345f, -0.64581600f, -0.65681647f, -1.60629861f, -1.31557834f, -0.95583049f, - 1.36402643f, 1.80223774f, 0.69837068f, -0.49496040f, -0.78242114f, -0.27168915f, 0.02445085f, -0.20866271f, -0.30035706f, -0.41170635f, -0.35841577f, -0.34242299f, -0.28692410f, -0.02094657f, -0.05934480f, -0.35123483f, - -1.08520561f, -0.84120058f, -0.40604501f, -0.30838475f, -0.39817946f, -0.45244145f, -0.46460261f, -0.31407296f, -0.03689281f, 0.38084328f, 0.75874597f, 0.64589942f, 0.68713572f, 0.85059140f, 0.70295555f, 0.28085506f, - -3.41901495f, -4.05624120f, -2.77833774f, -0.25403214f, 1.87889428f, 1.49402114f, -0.04104013f, -0.12322346f, 0.66403332f, 2.05218773f, 0.76725378f, 0.75987949f, 1.64445951f, 1.18046450f, 0.23904189f, -0.00834539f, - 2.34563559f, 1.85433514f, 0.92188091f, 0.00938003f, -0.66632165f, -1.24128642f, -1.45925477f, -1.45794931f, -1.45009658f, -1.08637380f, -0.53948104f, -0.13215543f, 0.79501605f, 0.54741060f, 0.55538134f, 1.00387907f, - 0.18830608f, 0.82743615f, 0.71353361f, 0.08375013f, 0.72945362f, 1.56781385f, 0.82203061f, -0.15761113f, -1.14514559f, -0.94404839f, -0.45524505f, -0.03539938f, -0.38522988f, -0.55123197f, -0.43254198f, -0.82587158f, - 0.28717168f, 1.26620628f, 1.79284485f, 0.74811924f, 0.75340319f, 0.55244948f, 0.46108770f, 0.62189892f, 0.63524206f, -0.36020964f, -0.49840190f, -0.49783437f, -1.24630499f, -1.48121128f, -1.52882801f, -1.50563245f, - 0.77651863f, -0.09801613f, -0.65368548f, -1.42314584f, -1.95826046f, -2.20248886f, -1.97940063f, -1.63600078f, -1.05805019f, -0.03308653f, 1.18890487f, 1.59425997f, 1.56951997f, 1.72023665f, 1.99206238f, 2.20063258f, - 1.86036810f, 1.95524352f, 1.65802754f, 0.51762484f, 0.32278641f, 1.41534130f, 1.58480385f, 1.00644422f, -0.43304110f, -1.52615221f, -1.54409319f, -1.50951389f, -1.44095494f, -1.33336688f, -1.41459830f, -1.11891940f, - -0.48994782f, -0.25738925f, -0.03744629f, -0.08936731f, -0.21819055f, -0.21749988f, -0.57009207f, -0.68163031f, -0.77904329f, -0.92638722f, -0.49253451f, -0.11015934f, 0.49328977f, 1.25069491f, 1.61419932f, 1.51150480f, - 2.17925129f, 0.65744215f, -0.14102877f, -0.68226531f, -0.86240255f, -0.96233313f, -0.77240075f, -0.60150667f, -0.43620670f, -0.12974041f, 0.06940761f, 0.29313968f, 0.32005914f, 0.04484663f, 0.20342365f, 0.82031433f, - -2.73276927f, -1.95293295f, -1.25302447f, -1.26607638f, -1.03464322f, -0.41097672f, 0.11299908f, 0.61306244f, 1.35234054f, 1.98785456f, 1.65758988f, 0.94482039f, 0.67093436f, 0.60201696f, 0.38959545f, 0.31920903f, - 1.99599002f, 1.78113188f, 1.60094449f, 1.49585133f, 1.05949606f, 0.38027999f, -0.00956917f, -0.37696778f, -0.58734884f, -0.88374264f, -1.14734587f, -1.24114441f, -1.17843206f, -1.09199503f, -0.92371805f, -0.87342960f, - -1.37903570f, -0.79248227f, 0.13536234f, 0.47656459f, 0.43589978f, 0.88461367f, 1.02738581f, 0.55354663f, 0.25049941f, -0.28501314f, -0.80941419f, -0.81019030f, -0.45648923f, 0.11389766f, 0.39621982f, 0.25863532f, - 2.10361489f, 0.37593562f, -0.16944555f, -0.32212923f, -0.22241176f, -0.24351656f, -0.27375398f, 0.02762124f, 0.11073362f, 0.23273069f, 0.27063497f, 0.08607178f, -0.19792432f, -0.48410706f, -0.59195084f, -0.70210352f, - -3.28081022f, -2.84286219f, -2.41405615f, -2.18965898f, -1.85813828f, -1.04835079f, -0.44771380f, 0.59206456f, 1.50301948f, 2.07448941f, 2.16550955f, 1.89856464f, 1.75678779f, 1.60095964f, 1.36941840f, 1.12077632f, - 1.20650745f, 1.87107653f, 1.86883453f, 1.42456949f, 0.48789223f, -0.72412798f, -1.11112426f, -1.49029508f, -1.30798779f, -1.39394685f, -1.21186297f, -0.51923241f, 0.01995250f, 0.34176002f, 0.40195072f, 0.13603383f, - 1.27785134f, 0.88553037f, 0.16900733f, -0.27809430f, -1.01525323f, -1.49395836f, -1.43232130f, -1.19784251f, -0.74210861f, -0.08619940f, 0.47709237f, 0.55331864f, 0.84110624f, 0.88279667f, 0.58250791f, 0.57656718f, - 0.33221429f, 1.11386403f, 0.75316099f, -0.54031614f, -1.07863165f, -0.21932249f, 1.22065947f, 1.15034668f, 1.03141160f, -0.31201434f, -1.38480174f, -0.81360834f, -0.27523041f, 0.24071536f, -0.19254386f, -1.02590322f, - -1.49213877f, -2.62687029f, -1.76800978f, 0.37484393f, 2.24342021f, 1.70797214f, 0.00785579f, -0.16576749f, 0.40170467f, 1.53774796f, 0.29192482f, 0.32972463f, 0.96040034f, 0.07052406f, -0.75744205f, -1.11588939f, - 1.68310221f, 0.62723214f, -0.21848789f, -0.50907306f, -0.77679516f, -0.86027718f, -0.37120564f, 0.20445818f, 0.27312526f, -0.13982446f, -0.56141448f, -0.66669228f, 0.06397763f, 0.19621457f, 0.32877219f, 0.72688794f, - 0.71839263f, 0.21641507f, 0.34358239f, 1.05799089f, 1.05814284f, 0.52787967f, 0.14046002f, 0.11966559f, 0.07361240f, -0.17447064f, -0.37909417f, -0.61722985f, -0.71730019f, -0.79744166f, -0.77133987f, -0.79926472f, - -0.02890014f, 0.92802997f, 1.03744813f, 0.32870919f, 0.07886022f, 0.63362031f, 0.46497182f, 0.14157700f, -0.03057580f, -0.54785692f, -1.11970728f, -1.36023434f, -0.91731394f, 0.07493639f, 0.47210281f, -0.15566707f, - -0.69638941f, -0.91666102f, -1.56178072f, -1.95501706f, -1.82786692f, -1.74880889f, -1.34684465f, 0.11048340f, 1.37545972f, 1.36714659f, 1.44286472f, 1.29857548f, 1.10826459f, 1.56371080f, 1.18624590f, 0.60061806f, - -0.68066861f, 0.38195183f, 1.51822296f, 2.21510524f, 2.33189221f, 1.97513513f, 1.15635207f, 1.51498823f, 1.49065161f, -0.27868821f, -1.78208773f, -2.20070549f, -2.26038069f, -2.05737950f, -1.59696081f, -1.72742716f, - -2.17324712f, -1.42748120f, -0.47105336f, 0.06399853f, -0.10139724f, -0.33208523f, -0.36226578f, -0.45684329f, -0.45421750f, -0.02950979f, 0.57908509f, 0.82823657f, 0.84044612f, 0.96336259f, 1.18058199f, 1.35238916f, - 0.30637595f, -0.07750454f, -0.01603143f, -0.03845729f, -0.46768884f, -0.33028351f, 0.33893858f, 0.66006523f, 0.64603598f, 0.25681503f, -0.24604284f, -0.37133227f, -0.20588021f, -0.28072164f, -0.22555667f, 0.05126849f, - -1.81904207f, -1.97008939f, -1.38138723f, -0.56721565f, 0.08439254f, 0.50012417f, 0.41461731f, 0.70946239f, 0.65844196f, 0.50418711f, 0.67016347f, 0.85608609f, 0.63818532f, 0.38340644f, 0.22816114f, 0.09050718f, - 3.82551321f, 3.02994002f, 1.79732057f, 1.05862951f, 0.33021546f, 0.01969982f, -0.57482284f, -1.10367492f, -1.21202781f, -1.06293594f, -0.97966329f, -1.01767532f, -1.10340104f, -1.13918652f, -1.02503523f, -0.84289579f, - -2.06530906f, -1.02138773f, 0.19121847f, 0.64135688f, 0.47353945f, 0.29125589f, 0.17346435f, 0.09846354f, 0.14173379f, 0.44108119f, 0.42909595f, 0.13671490f, -0.09429711f, 0.06651142f, 0.02429001f, 0.07226851f, - 1.63249192f, 0.94436017f, 0.65530634f, 0.76476367f, 1.10302458f, 1.20701875f, 0.88073298f, 0.43640158f, -0.07220279f, -0.39214092f, -0.60759685f, -0.87296187f, -1.13810886f, -1.40490240f, -1.54422408f, -1.59196182f, - -2.96354446f, -2.66922503f, -2.35080143f, -1.84250497f, -1.24255764f, -0.53451683f, -0.22318900f, 0.15923121f, 0.44185767f, 0.90571587f, 1.20883041f, 1.21786822f, 1.54160670f, 2.22751201f, 2.21090650f, 1.91281110f, - -0.09062710f, 0.80687377f, 1.69510603f, 2.38364009f, 2.08626387f, 1.00304738f, 0.66997543f, 0.04541459f, -0.35848319f, -0.80600051f, -1.65487629f, -2.04562701f, -2.03869244f, -1.11898388f, 0.04427361f, -0.62130392f, - -0.99015493f, -0.47096904f, 0.39660329f, 1.29486538f, 1.58962509f, 0.33608325f, -0.41798602f, -0.54749259f, -0.00991716f, -0.02240745f, -0.93933104f, -0.69735917f, -0.17095973f, 0.19272004f, 0.29655039f, 0.16013060f, - -0.50032252f, -0.00936927f, 0.13895740f, 0.11955067f, -0.00882381f, -0.31634261f, -0.30280409f, -0.10222302f, -0.04951847f, 0.13870349f, 0.43344396f, 0.56559398f, 0.24092822f, -0.05903140f, -0.12616386f, -0.16257807f, - -4.66891396f, -4.62476618f, -2.72504562f, -0.11626174f, 1.38983931f, 1.37676145f, 0.15183709f, -0.07491020f, 0.54070200f, 1.84266982f, 0.65624201f, 0.70100510f, 1.81013255f, 1.75739872f, 0.97189375f, 1.01141647f, - 3.82513926f, 1.74864093f, 0.71663856f, -0.06702053f, -0.46144066f, -0.68679697f, -0.83513366f, -0.69088271f, -0.63484378f, -0.48492965f, -0.30596681f, -0.27767202f, -0.29901877f, -0.55135905f, -0.55561568f, -0.43973879f, - -1.83506374f, -1.72166910f, -0.66010462f, 1.71984506f, 2.40983158f, 1.81667012f, 1.44944523f, 1.31000271f, 0.86661928f, 0.58345030f, -0.05866711f, -0.37487717f, -0.74598532f, -1.38021702f, -1.58454113f, -1.79473786f, - 0.16939787f, 1.05222199f, 0.60925979f, -0.08245082f, -0.05127361f, -0.01958411f, -0.04649851f, 0.11008216f, 0.21213694f, -0.02520358f, -0.00574917f, -0.04591061f, -0.24174211f, -0.38605009f, -0.52417208f, -0.72446423f, - -0.07063893f, -1.74970518f, -1.79098807f, -1.50819293f, -1.06029380f, -1.44474701f, -1.24662095f, -1.20341521f, -1.18506899f, -0.88327503f, -0.47818767f, 0.53478172f, 1.99588317f, 2.01785324f, 2.86156101f, 5.21105441f, - 1.18577996f, 1.82923029f, 2.00218590f, 1.75897045f, 1.55666666f, 1.15213194f, 1.02264996f, 0.58845201f, 0.39345304f, -0.25590088f, -1.11168611f, -1.75581078f, -2.05745836f, -2.20440070f, -2.14031291f, -1.96395016f, - -0.49703383f, -0.62650520f, -0.98853522f, -1.16849765f, -1.02786508f, -0.51447634f, -0.02538523f, 0.08704333f, 0.03359763f, 0.17774887f, 0.30484412f, 0.32520735f, 0.62948522f, 1.14552041f, 1.22336987f, 0.92148234f, - -0.07188198f, 0.18500810f, -0.22096354f, -0.56851679f, -0.98832362f, -1.20304996f, -1.11943691f, -1.09383807f, -0.85446062f, -0.29360582f, 0.44439822f, 0.64306330f, 1.09971537f, 1.50142342f, 1.36382024f, 1.17664847f, - -1.21730935f, -1.48884440f, -1.78500620f, -1.57607634f, -0.82775565f, -0.09612994f, 0.49933981f, 1.06136160f, 1.31463011f, 1.46090638f, 1.14896512f, 0.64320117f, 0.39111587f, 0.36061229f, 0.18325675f, -0.07226660f, - 2.30575156f, 2.37005513f, 1.37776397f, 0.78509487f, 0.18022242f, -0.13093354f, 0.22126477f, -0.11444642f, -0.35716968f, -0.59492665f, -0.35765935f, -0.44655201f, -1.03213345f, -1.27074059f, -1.44000075f, -1.49558947f, - -1.00874079f, -1.64011865f, -1.86084729f, -1.06805908f, 0.07222945f, 1.36179475f, 1.87160360f, 1.76248472f, 1.52374330f, 1.04119855f, 0.73448166f, 0.13768018f, -0.49711929f, -0.73696841f, -0.89885406f, -0.79450886f -}; -const float ivas_sns_cdbk_tcx10_stage2[ 32 * 16 ] = { - 0.30627323f, 0.48836579f, -0.02716944f, -0.47680077f, -0.52992614f, -0.25467720f, -0.13298242f, -0.14929291f, -0.14808149f, 0.08665801f, 0.28830653f, 0.27526330f, 0.09942358f, -0.01755061f, 0.03315580f, 0.15903469f, - 0.40931263f, -0.04412117f, -0.08826419f, 0.38716891f, 0.51515595f, 0.42227845f, 0.34963425f, 0.26800736f, 0.03770000f, -0.19967080f, -0.31044249f, -0.32623294f, -0.38445978f, -0.38085950f, -0.38590829f, -0.26929836f, - -0.16037262f, -0.37557223f, -0.41481262f, -0.12384627f, 0.25702942f, 0.29593484f, 0.04534352f, -0.04349856f, -0.11439445f, -0.20184919f, 0.03250628f, 0.58473249f, 1.07468564f, 0.31789485f, -0.43837532f, -0.73540590f, - -0.72021067f, 0.08601834f, 0.36444345f, 0.07734969f, -0.03855524f, -0.02016363f, 0.22787880f, 0.23660595f, -0.06162934f, -0.60111840f, -0.53416841f, -0.01411490f, 0.31545914f, 0.35328934f, 0.27371155f, 0.05520477f, - 0.17033204f, -0.13395098f, -0.17486207f, -0.16431307f, -0.15028250f, -0.16217158f, 0.20788205f, 0.78892741f, 0.82887028f, 0.27828798f, -0.09961411f, -0.26525390f, -0.29531330f, -0.31862369f, -0.30357092f, -0.20634333f, - 0.66971623f, 0.62862982f, 0.51073654f, 0.36780819f, 0.09494981f, -0.26895298f, -0.43607248f, -0.52929484f, -0.50226353f, -0.28888748f, -0.08077826f, 0.07870787f, -0.04066089f, -0.15014043f, -0.07631337f, 0.02281584f, - -0.14637266f, -0.46934298f, -0.43556714f, -0.11250329f, 0.02177593f, -0.06273200f, -0.10608254f, -0.23883852f, -0.34273025f, -0.21064510f, 0.01000878f, 0.26290329f, 0.36940740f, 0.45606583f, 0.50057089f, 0.50408231f, - -0.63822919f, -0.37848043f, -0.12025765f, 0.46869706f, 0.60287599f, 0.40487467f, 0.32284423f, 0.21760285f, 0.02923608f, 0.00961581f, 0.09146575f, 0.01422525f, -0.19921025f, -0.27268562f, -0.30705403f, -0.24552069f, - 1.00438179f, 0.03452909f, -0.36528888f, -0.16282387f, -0.17507552f, -0.16366972f, 0.01988929f, 0.04208138f, -0.09195065f, -0.12550201f, -0.13827904f, -0.15519976f, -0.13718296f, -0.04187317f, 0.11795197f, 0.33801187f, - -0.29872646f, -0.05673935f, 0.22627715f, 0.35384240f, 0.40583411f, 0.05342130f, -0.33165017f, -0.58372192f, -0.59880799f, -0.13860904f, 0.35292935f, 0.42680564f, 0.12541820f, -0.05244271f, 0.02304693f, 0.09312233f, - -0.62056798f, -0.65569894f, -0.39193684f, -0.23470135f, -0.10487732f, -0.02415277f, 0.10485475f, 0.27475842f, 0.33639795f, 0.28659695f, 0.29816270f, 0.35486347f, 0.22178257f, 0.06294332f, 0.00371302f, 0.08786182f, - -0.24167361f, 0.39335919f, 0.45401345f, -0.01359878f, -0.02799250f, 0.03219280f, -0.03498926f, 0.13917253f, 0.56998817f, 0.30076805f, -0.02861530f, -0.08301223f, -0.23268793f, -0.25582563f, -0.40349390f, -0.56760551f, - -0.25453749f, 0.20141031f, 0.13622118f, 0.02192458f, 0.01884274f, 0.35426017f, 0.30533029f, -0.04383371f, -0.03213904f, 0.48723585f, 0.26916690f, -0.57914714f, -0.86274497f, -0.46431975f, 0.21456299f, 0.22776732f, - 0.10091242f, -0.00486621f, 0.15438553f, 0.58933636f, 0.58327809f, 0.15020643f, -0.13942120f, -0.30560120f, -0.39802935f, -0.42014770f, -0.43506227f, -0.49122908f, -0.24162334f, 0.07789107f, 0.33589368f, 0.44407700f, - -0.86901291f, -0.12649490f, 0.37769660f, 0.32335451f, -0.09778731f, -0.30169760f, -0.11330902f, 0.06975956f, 0.10852794f, 0.10187023f, 0.01908335f, -0.02063501f, -0.02583787f, 0.01976747f, 0.15814638f, 0.37656868f, - 0.04263499f, 0.02090495f, 0.31860242f, 0.23302977f, -0.33090591f, -0.80333458f, -0.73651770f, -0.34102413f, 0.01204330f, 0.27818705f, 0.45925162f, 0.49138398f, 0.30213637f, 0.14165342f, -0.01743260f, -0.07061291f, - -0.33546750f, 0.07559517f, -0.29917689f, -0.73625773f, -0.65250278f, -0.17791468f, 0.36283358f, 0.41870726f, 0.25167625f, 0.10475438f, 0.03036614f, -0.11264997f, 0.02694511f, 0.35023967f, 0.42385566f, 0.26899640f, - 0.35439950f, 0.67540976f, 0.38662754f, 0.00957348f, -0.04081569f, 0.08980026f, 0.24456400f, 0.16454453f, -0.17326799f, -0.44054817f, -0.46528410f, -0.40046956f, -0.28220380f, -0.18741583f, -0.03688613f, 0.10197206f, - 0.42543134f, 0.16124378f, -0.11664388f, -0.16052109f, -0.14380996f, -0.20548992f, -0.07681681f, -0.05550879f, -0.19682147f, -0.44926335f, -0.31008693f, 0.10843293f, 0.56978845f, 0.55547148f, 0.11319503f, -0.21860065f, - -0.29805544f, -0.51653600f, -0.50993841f, -0.23042275f, 0.24667415f, 0.49673729f, 0.44572321f, 0.45012593f, 0.15926189f, -0.25316153f, -0.34302757f, -0.25146569f, -0.04585493f, 0.07882198f, 0.19017230f, 0.38094576f, - 0.32844224f, 0.41193928f, 0.40958218f, 0.23076367f, -0.27298459f, -0.73724149f, -0.33139249f, 0.20850941f, 0.29246785f, 0.02387269f, -0.22298162f, -0.22401730f, -0.10602946f, -0.10948655f, -0.04914188f, 0.14769834f, - -0.17579666f, 0.35780877f, 0.71235588f, 0.55448086f, 0.37958752f, 0.25325181f, 0.00067976f, -0.17449727f, -0.19933258f, -0.18272217f, -0.13825657f, -0.13482936f, -0.26973501f, -0.36527057f, -0.38046021f, -0.23726392f, - 0.18763378f, -0.33806505f, -0.40345471f, -0.16420458f, -0.35258917f, -0.57440801f, -0.40444473f, 0.03937379f, 0.28301143f, 0.24202773f, 0.11450746f, -0.01201630f, 0.15584175f, 0.29186178f, 0.39454798f, 0.54037647f, - 0.22483690f, -0.44980090f, -0.04869487f, 0.59069175f, 0.53952189f, -0.08294351f, -0.50222392f, -0.24118691f, 0.23316504f, 0.15935219f, -0.04441873f, 0.04368785f, -0.01936622f, -0.19829407f, -0.17269697f, -0.03162974f, - 0.86145933f, 0.21872440f, 0.03989593f, 0.02383014f, -0.09253274f, -0.16857595f, -0.11671737f, 0.08021353f, 0.06125647f, 0.12344152f, 0.23383136f, 0.23023986f, 0.00554465f, -0.33666994f, -0.57850362f, -0.58543742f, - 0.51765053f, 0.14453794f, -0.21849231f, -0.46766148f, 0.28518641f, 0.98554209f, 0.04290847f, -0.60417524f, -0.40619174f, 0.07096948f, -0.07934046f, -0.11108689f, 0.01736604f, 0.02182622f, -0.13816306f, -0.06087569f, - 0.48940455f, -0.48846716f, -0.76449136f, -0.43167975f, -0.08214146f, 0.11409731f, 0.23323066f, 0.14717357f, 0.03539665f, 0.18939153f, 0.30742449f, 0.25985980f, 0.09542412f, -0.02333196f, -0.07732568f, -0.00396539f, - -0.11187535f, 0.22479868f, 0.00043228f, -0.32181417f, -0.15096473f, 0.43016822f, 0.70121781f, 0.35219596f, -0.12050155f, -0.23287073f, 0.15265180f, 0.19690580f, -0.06424055f, -0.21596133f, -0.38579166f, -0.45435087f, - -0.22289529f, -0.33733328f, 0.06840735f, 0.09280703f, 0.04636627f, 0.21910935f, -0.03558133f, 0.03650325f, 0.61258277f, 0.50575298f, -0.41287364f, -0.69151766f, -0.55346043f, 0.16231747f, 0.54407303f, -0.03425754f, - -0.01396139f, 0.41256481f, 0.28386076f, -0.13079544f, -0.35049882f, -0.37139357f, -0.26190236f, -0.28543916f, -0.36404168f, -0.41216213f, -0.30446824f, -0.16554805f, 0.07635435f, 0.40718475f, 0.72148357f, 0.75876291f, - -0.78143464f, 0.05520810f, 0.09851993f, -0.35088396f, -0.29183273f, 0.13535467f, 0.10630173f, -0.35151176f, -0.27502696f, 0.15923208f, 0.34325564f, 0.26263384f, 0.39924614f, 0.42088604f, 0.20935571f, -0.13930422f, - -0.20363163f, -0.21557857f, -0.16300691f, -0.04183005f, -0.11100316f, -0.05771045f, 0.03898740f, 0.01316220f, 0.17362802f, 0.74914331f, 0.94477958f, 0.44778038f, -0.09421183f, -0.32736334f, -0.50631884f, -0.64682642f -}; -const float ivas_sns_cdbk_tcx10_stage3[ 8 * 16 ] = { - 0.15213764f, -0.12778955f, 0.09362990f, -0.08343056f, -0.25379718f, 0.12518895f, 0.29943288f, -0.09857322f, -0.34816031f, -0.24349585f, -0.11266650f, -0.05996015f, 0.03254247f, 0.15532134f, 0.23410563f, 0.23551447f, - -0.16242282f, -0.11097776f, -0.31747514f, -0.25628076f, 0.13836003f, 0.29861681f, 0.10506779f, 0.11734717f, 0.26608658f, 0.05454060f, -0.14603348f, -0.19239843f, 0.04173306f, 0.20966631f, 0.07432020f, -0.12015035f, - -0.05086737f, 0.14763099f, -0.10027459f, -0.32093478f, -0.17515530f, -0.18641303f, -0.27141947f, -0.07787662f, 0.00378069f, -0.04285463f, 0.10140687f, 0.34974771f, 0.30832793f, 0.10107726f, 0.07691200f, 0.13691240f, - -0.19149570f, -0.03034820f, 0.22501633f, 0.07949802f, -0.27147765f, -0.19613243f, 0.27922429f, 0.35035416f, 0.10414276f, 0.00614821f, 0.06550601f, 0.11675054f, 0.03695278f, -0.13039057f, -0.22716902f, -0.21657951f, - 0.26536712f, -0.20814302f, -0.25065997f, 0.11971631f, 0.27275427f, 0.17786545f, -0.00254739f, -0.12770659f, -0.22797897f, 0.00768447f, 0.21340357f, 0.19482691f, 0.04586545f, -0.11847485f, -0.17809566f, -0.18387694f, - 0.25667429f, 0.24654641f, 0.10151031f, -0.02938848f, -0.14360442f, -0.13987667f, -0.20754252f, -0.19670735f, 0.17496815f, 0.41594389f, 0.13093074f, -0.20541061f, -0.16236246f, 0.04068170f, -0.03728146f, -0.24508149f, - -0.08722397f, 0.02295918f, 0.00051204f, 0.07408103f, 0.14389321f, 0.06786859f, 0.00359252f, 0.11717038f, 0.08740562f, 0.00119184f, -0.07592203f, -0.11362449f, -0.31422561f, -0.38910675f, -0.02291088f, 0.48433932f, - -0.18216919f, 0.06012195f, 0.24774113f, 0.41673922f, 0.28902704f, -0.14711768f, -0.20580810f, -0.08400793f, -0.06024452f, -0.19915854f, -0.17662518f, -0.08993148f, 0.01116638f, 0.13122555f, 0.08011919f, -0.09107791f -}; - -const float *const ivas_sns_cdbks_tcx10[SNS_MSVQ_NSTAGES_TCX10] = { ivas_sns_cdbk_tcx10_stage1, ivas_sns_cdbk_tcx10_stage2, ivas_sns_cdbk_tcx10_stage3}; - -const float ivas_sns_means_tcx10[M] = { - 0.9510f , 1.1892f , 0.8969f , 0.3467f, - 0.1347f , 0.1074f , 0.0504f , -0.0790f, - -0.1305f , -0.3713f , -0.5611f , -0.5757f, - -0.4801f , -0.4108f , -0.4564f , -0.6112f -}; - -const int16_t ivas_sns_cdbks_side_tcx20_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 32 }; -const int16_t ivas_sns_cdbks_side_tcx20_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 5 }; -const int16_t ivas_sns_cdbks_side_tcx10_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 8 }; -const int16_t ivas_sns_cdbks_side_tcx10_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 3 }; - -const float ivas_sns_means_side_tcx20[M] = { - -0.0181f , 0.0044f , 0.0133f , 0.0096f, - 0.0073f , 0.0038f , 0.0058f , 0.0015f, - -0.0046f , -0.0096f , -0.0099f , -0.0173f, - -0.0075f , 0.0049f , 0.0023f , 0.0141f -}; - -const float ivas_sns_cdbks_side_tcx20_stage1[ 32 * 16 ] = { - -0.09561560f, -0.07036320f, 0.02878750f, 0.03511974f, 0.17132389f, -0.03138941f, -0.33178799f, -0.21216198f, -0.04445341f, 0.02221417f, 0.02283919f, 0.03233147f, 0.08941267f, 0.12190493f, 0.12476806f, 0.13706984f, - 0.00109929f, 0.08875231f, 0.22238215f, 0.21457590f, 0.10015343f, 0.04638508f, 0.03393346f, -0.00874452f, -0.04376851f, -0.07742100f, -0.07534945f, -0.10337673f, -0.10407952f, -0.11112585f, -0.09133646f, -0.09207950f, - -0.24818594f, 0.26921203f, 0.44107852f, 0.17248048f, 0.64417785f, 0.17680036f, 0.13990282f, -0.00956079f, 0.26766161f, -0.03617849f, -0.51006953f, -0.14559280f, 0.04585566f, -0.32296828f, -0.43440915f, -0.45020472f, - -0.02603883f, -0.10893371f, -0.10500311f, -0.11573136f, -0.10145701f, 0.08950274f, 0.26393655f, 0.16421642f, 0.06653788f, 0.02055681f, 0.03165200f, -0.00660730f, -0.02920382f, -0.04413712f, -0.04586630f, -0.05342379f, - 0.42792206f, 0.05873236f, -0.03519993f, -0.02404930f, -0.02129021f, -0.02228539f, -0.05794333f, -0.05329147f, -0.02713142f, -0.02536622f, -0.01781476f, -0.04129741f, -0.03786846f, -0.04699464f, -0.04049980f, -0.03562223f, - 0.02055988f, 0.02639971f, 0.00689886f, 0.00418128f, -0.01634280f, 0.00921734f, 0.00364626f, -0.03176210f, -0.04382792f, -0.01247039f, 0.02183370f, -0.00002241f, -0.00402301f, -0.00566646f, 0.00978385f, 0.01159419f, - 0.19157117f, 0.21950742f, 0.18377101f, -0.02875442f, -0.28243126f, -0.54171973f, -0.31264637f, -0.03676636f, 0.00528891f, -0.04001921f, 0.08505054f, 0.06946939f, 0.13428842f, 0.15810925f, 0.11903950f, 0.07624180f, - -0.30190937f, -0.29575446f, -0.26060885f, -0.18754051f, -0.14798754f, -0.10966049f, -0.13245975f, -0.11017279f, -0.08153340f, -0.06447313f, 0.04034392f, 0.17641778f, 0.25731939f, 0.31027339f, 0.40673221f, 0.50101364f, - -0.47842978f, -0.03818905f, 0.07056377f, 0.03300345f, 0.02730699f, 0.05007915f, 0.02893237f, 0.02226785f, 0.04222222f, 0.04128904f, 0.03830734f, 0.01743857f, 0.03607951f, 0.02582752f, 0.04198512f, 0.04131589f, - -0.02242885f, 0.01802990f, -0.00361209f, 0.02714255f, 0.04843318f, 0.04306928f, 0.02675985f, 0.07964815f, 0.10019006f, 0.05262710f, 0.00113825f, -0.04747375f, -0.04988074f, -0.05204562f, -0.09989329f, -0.12170389f, - 0.28967652f, 0.36512749f, 0.38343313f, 0.37459919f, 0.29419461f, 0.21272806f, 0.14963422f, 0.11987446f, -0.00354946f, -0.11817788f, -0.21991893f, -0.37389500f, -0.43897693f, -0.47312318f, -0.36222971f, -0.19939667f, - -0.29847367f, -0.28024953f, -0.23616334f, -0.19456539f, -0.16497910f, -0.12215408f, -0.05213406f, 0.03088777f, 0.11427925f, 0.17777695f, 0.21315635f, 0.18382103f, 0.20758797f, 0.19478448f, 0.14014366f, 0.08628162f, - -0.01005369f, -0.03186180f, -0.07995901f, -0.10893772f, -0.11257191f, -0.10933952f, -0.06260446f, 0.01592879f, 0.06618622f, 0.08792663f, 0.09779631f, 0.06871009f, 0.06158038f, 0.04699408f, 0.04045205f, 0.02975352f, - -0.12591171f, -0.31330699f, -0.09207505f, 0.04353844f, 0.05691547f, 0.02830292f, 0.05190188f, 0.05663181f, 0.05579546f, 0.05136184f, 0.06373287f, 0.03243363f, 0.03631576f, 0.02886726f, 0.02108611f, 0.00441022f, - 0.51424359f, 0.44825357f, 0.27826391f, 0.14692419f, 0.04486213f, 0.01374316f, -0.05577450f, -0.06790050f, -0.10394906f, -0.14111342f, -0.16141165f, -0.18795338f, -0.17689540f, -0.18030471f, -0.19451666f, -0.17647134f, - 0.01250082f, -0.03513855f, -0.10558904f, -0.13589106f, -0.16642959f, -0.12403555f, -0.11639493f, -0.13504470f, -0.12448111f, -0.08902796f, 0.02742439f, 0.14597597f, 0.22586358f, 0.24372767f, 0.18517594f, 0.19136417f, - 0.00690369f, -0.06536790f, -0.04560492f, 0.17183296f, 0.06108150f, -0.14297504f, -0.10743566f, 0.00028842f, -0.00000737f, 0.01948888f, 0.04144583f, 0.01034213f, 0.01186359f, 0.01904016f, 0.01513936f, 0.00396440f, - -0.02696488f, -0.05930555f, -0.05635944f, 0.04417762f, 0.20483421f, 0.24818872f, 0.08337011f, -0.03555721f, -0.04496794f, -0.05268211f, -0.05177582f, -0.06105043f, -0.04493356f, -0.04903822f, -0.04844764f, -0.04948792f, - 0.09934599f, 0.20097988f, 0.02959104f, 0.10059414f, 0.36489123f, 0.42345991f, 0.31306867f, 0.19189664f, 0.02025838f, -0.16920767f, -0.19221388f, -0.36590851f, -0.24124038f, -0.21069901f, -0.24782116f, -0.31699542f, - -0.38302159f, -0.20867958f, -0.06199247f, 0.00929974f, -0.08763027f, 0.01230753f, 0.12845035f, 0.27194101f, 0.35480151f, 0.36726532f, 0.20142240f, -0.03957218f, -0.10891503f, -0.16235951f, -0.15207841f, -0.14123875f, - 0.29448433f, 0.27467021f, 0.21093907f, 0.02636253f, -0.10971996f, -0.06520899f, -0.09114815f, -0.19988466f, -0.25173695f, -0.21777001f, -0.19036007f, -0.10825290f, 0.00468462f, 0.07695453f, 0.14592570f, 0.20006079f, - -0.09613522f, -0.07305197f, 0.23140183f, -0.01276782f, -0.05046178f, -0.03690868f, 0.01854782f, -0.00516658f, -0.01794740f, 0.01127293f, 0.02845775f, 0.00246563f, -0.00285605f, -0.00274282f, 0.00447526f, 0.00141708f, - 0.09853152f, 0.23398475f, 0.15560679f, 0.01939291f, -0.05095939f, -0.10951335f, -0.08366621f, -0.03852663f, -0.00171258f, -0.01619636f, -0.02703945f, -0.04625883f, -0.03573599f, -0.03656223f, -0.03486191f, -0.02648302f, - -0.05407938f, -0.18042914f, -0.31075117f, -0.36223570f, -0.35545274f, -0.26114190f, -0.21540173f, -0.18652814f, -0.10764184f, -0.04326102f, 0.10627938f, 0.32432791f, 0.40043785f, 0.56193174f, 0.40395999f, 0.27998606f, - -0.22375901f, -0.11453094f, -0.06437672f, 0.02966050f, -0.06882505f, -0.02229970f, 0.00519106f, 0.04139490f, -0.21099529f, -0.00965469f, 0.01906172f, 0.06535794f, 0.27085374f, 0.36298568f, 0.13009871f, -0.21016295f, - 0.18023915f, 0.15936182f, 0.13064987f, 0.09848966f, 0.08230524f, 0.11068418f, 0.11168088f, 0.11505046f, 0.13567778f, 0.12259236f, 0.03115883f, -0.14115321f, -0.20420262f, -0.27855554f, -0.34034745f, -0.31363132f, - -0.12817652f, 0.06412346f, 0.23407500f, 0.37946648f, 0.31127015f, 0.27044470f, 0.18591463f, 0.13643852f, 0.07403884f, -0.00928348f, -0.10609226f, -0.26765738f, -0.35056732f, -0.38530570f, -0.26185421f, -0.14683496f, - -0.63004591f, -0.58451443f, -0.16857245f, -0.08058005f, -0.09034904f, 0.00601978f, 0.10036174f, 0.10417477f, 0.14447621f, 0.13945086f, 0.18409447f, 0.20139949f, 0.10118410f, 0.12033491f, 0.20454736f, 0.24801829f, - 0.09650912f, 0.15979369f, -0.02778062f, -0.21860304f, -0.09723043f, 0.03923136f, 0.06141602f, 0.00600025f, -0.03251321f, -0.01956117f, -0.01004770f, -0.01435564f, 0.01114831f, 0.01113413f, 0.01304939f, 0.02180959f, - -0.00555466f, -0.14717213f, -0.37968771f, -0.12250216f, 0.03497204f, 0.13708345f, 0.03564652f, 0.00785509f, 0.04438533f, 0.06495152f, 0.07142555f, 0.05800545f, 0.06370878f, 0.05930816f, 0.05015268f, 0.02742217f, - 0.24931986f, 0.21084678f, 0.15421842f, 0.14679305f, 0.11899038f, 0.10112391f, 0.08120544f, 0.01848917f, -0.03021656f, -0.11872087f, -0.17582510f, -0.27756371f, -0.26300284f, -0.17730239f, -0.07164775f, 0.03329224f, - -0.17764482f, -0.15058551f, -0.12627503f, -0.06547272f, -0.05935809f, -0.01277874f, 0.01723090f, -0.00829920f, -0.02788840f, 0.01142219f, 0.05531784f, 0.04254613f, 0.04730144f, 0.07050022f, 0.15526930f, 0.22871460f -}; - -const float ivas_sns_cdbks_side_tcx20_stage2[ 32 * 16 ] = { - -0.01387178f, 0.00066194f, 0.01705500f, 0.00585076f, 0.05625865f, -0.08189174f, -0.29272907f, 0.00394582f, 0.14068978f, 0.03888049f, 0.01046905f, 0.03828706f, 0.04214951f, 0.02083198f, 0.00583650f, 0.00757601f, - -0.07101791f, -0.10250166f, 0.03818920f, 0.09162373f, 0.11895681f, 0.13465195f, 0.05088923f, -0.11144198f, -0.13846971f, -0.20720284f, -0.25737659f, -0.15071919f, 0.03249921f, 0.08124332f, 0.17587328f, 0.31480317f, - 0.07163217f, 0.02904662f, 0.01959293f, 0.00805967f, 0.02343380f, 0.02069451f, 0.03232257f, 0.02206815f, 0.03462995f, 0.01790113f, -0.03778174f, -0.14048245f, -0.21681559f, -0.11035045f, 0.05755451f, 0.16849432f, - -0.10816723f, -0.02739052f, -0.08241511f, -0.08220118f, -0.07911491f, 0.04976754f, 0.10255540f, 0.23875558f, 0.25687913f, 0.03165525f, -0.15819986f, -0.14652796f, -0.00803674f, -0.00055281f, -0.01439374f, 0.02738701f, - -0.02270156f, 0.02799492f, 0.14119353f, -0.06753253f, -0.07348415f, 0.16270911f, -0.00726861f, -0.06576199f, -0.02852827f, -0.01072544f, -0.02385080f, 0.01259492f, -0.00575096f, -0.00670975f, -0.01412345f, -0.01805497f, - -0.09730804f, -0.09207854f, -0.06155676f, -0.01193574f, 0.00669004f, 0.04165295f, 0.00840306f, -0.01763756f, -0.08511468f, -0.12564582f, -0.06302424f, 0.13694410f, 0.25188182f, 0.15335399f, 0.00198570f, -0.04661036f, - -0.20229607f, 0.27055253f, 0.05937269f, 0.00423687f, 0.02212468f, -0.00979552f, -0.02654450f, -0.02737173f, -0.03263414f, -0.01695365f, -0.02587673f, -0.00157241f, -0.00766337f, -0.00946241f, 0.00474761f, -0.00086382f, - 0.06446543f, -0.26714355f, 0.12269745f, 0.02565502f, -0.00628892f, 0.00430942f, 0.00862473f, -0.00170779f, 0.00617105f, -0.00718104f, -0.01871731f, 0.01193483f, 0.00860795f, 0.00997801f, 0.02026700f, 0.01832765f, - -0.00061741f, -0.03771131f, -0.03643531f, -0.01560727f, 0.00567664f, -0.00566226f, -0.00287572f, 0.03281006f, 0.04750282f, 0.01895354f, -0.01051254f, 0.01765380f, 0.01259038f, 0.00436097f, -0.01332776f, -0.01679868f, - 0.06930783f, 0.05302917f, 0.06102093f, 0.13367091f, 0.13415662f, 0.00542245f, -0.09926086f, -0.18333294f, -0.21849319f, -0.08349384f, 0.02026711f, 0.05881583f, 0.01345789f, 0.01158885f, 0.01962784f, 0.00421544f, - 0.00361302f, -0.05045316f, -0.00509374f, 0.19082766f, -0.18804365f, -0.05470887f, 0.00052718f, -0.02162397f, -0.00194290f, 0.00166374f, 0.00419055f, 0.02490528f, 0.02211515f, 0.02768455f, 0.02704636f, 0.01929285f, - 0.02476472f, -0.00405085f, -0.02659682f, -0.08596413f, -0.06315428f, -0.06855039f, -0.07500519f, -0.05011866f, -0.06108486f, -0.00618761f, 0.05634272f, 0.08835189f, 0.05894742f, 0.06729406f, 0.07762828f, 0.06738369f, - 0.13702164f, 0.08497052f, 0.07105828f, 0.04681336f, 0.02464482f, 0.00482884f, -0.01068152f, -0.00650854f, 0.01424842f, -0.00735400f, -0.04158832f, -0.02704081f, -0.04141575f, -0.06089035f, -0.09289456f, -0.09521199f, - -0.16780678f, 0.06667456f, 0.18201515f, 0.07399154f, -0.01999438f, 0.05535422f, 0.03900328f, -0.12016656f, -0.10793461f, 0.12328733f, 0.37944090f, 0.03265145f, -0.16138072f, -0.15224770f, -0.10548425f, -0.11740339f, - -0.01321210f, -0.01125461f, -0.03726540f, 0.00275729f, -0.04632781f, -0.24449670f, 0.09996640f, 0.11060024f, 0.00843480f, 0.01020953f, 0.01323100f, 0.03866782f, 0.01652133f, 0.01477176f, 0.01931947f, 0.01807687f, - 0.04427139f, 0.07762448f, -0.03500615f, -0.18353333f, 0.15726631f, 0.06121580f, -0.02944487f, -0.01882019f, -0.02386520f, 0.00077271f, -0.01038885f, 0.00869168f, -0.00564164f, -0.00937383f, -0.01500538f, -0.01876296f, - 0.13690793f, 0.01111401f, -0.03351651f, -0.01725554f, -0.07761571f, -0.12250939f, -0.07631311f, -0.01738486f, 0.14254332f, 0.21322328f, 0.14586930f, 0.03233900f, -0.08363281f, -0.12036013f, -0.07612890f, -0.05727984f, - 0.02949784f, -0.12225020f, -0.24763790f, 0.09504104f, 0.18885156f, 0.02619185f, 0.01292378f, 0.03000215f, 0.00909582f, -0.00936785f, -0.02571287f, 0.00889712f, -0.00234566f, -0.00169068f, 0.00871879f, -0.00021486f, - -0.03852054f, -0.03889437f, -0.08884280f, -0.06896184f, 0.02214326f, 0.10225505f, 0.12832898f, 0.08401269f, 0.06576567f, 0.08182152f, 0.07603111f, 0.04006712f, -0.04791395f, -0.09454805f, -0.10354215f, -0.11920167f, - 0.00938218f, 0.04681937f, 0.08173506f, 0.03766262f, 0.00645705f, -0.03830769f, -0.01180921f, 0.28211251f, 0.02788724f, -0.25197511f, -0.12812732f, 0.01575526f, 0.01158131f, -0.01435589f, -0.04416799f, -0.03064940f, - 0.06374854f, 0.12417689f, 0.09544838f, -0.13379816f, -0.26304159f, -0.06323982f, 0.03308697f, 0.06602140f, 0.04869582f, 0.02626429f, 0.00579212f, 0.01966626f, -0.00288156f, -0.00594553f, -0.00083407f, -0.01315989f, - -0.01689007f, -0.05224654f, -0.05732359f, 0.00797541f, -0.01178359f, -0.06878838f, -0.08592686f, -0.01631491f, -0.01215461f, 0.04690048f, 0.18175850f, 0.26923595f, 0.13470179f, -0.02451530f, -0.12744548f, -0.16718270f, - -0.02187075f, -0.05395855f, -0.02263713f, -0.00045869f, 0.07200871f, 0.08343703f, 0.05673476f, -0.01486174f, 0.02824052f, 0.09407959f, 0.06117651f, -0.48782246f, -0.01849447f, 0.15501071f, 0.05869060f, 0.01072538f, - 0.38479396f, -0.04937867f, -0.07935772f, -0.02506650f, -0.02316760f, -0.02067798f, 0.02695150f, -0.00054291f, -0.05256493f, -0.03399701f, -0.04629317f, -0.01085654f, -0.01817534f, -0.02213798f, -0.01605045f, -0.01347864f, - -0.23847427f, -0.06501920f, -0.01803515f, -0.00348509f, 0.04039109f, 0.01940591f, 0.01835329f, 0.03075053f, 0.03001602f, 0.02853897f, 0.01016726f, 0.03707260f, 0.02160199f, 0.03493100f, 0.03506401f, 0.01872098f, - 0.03862266f, 0.02890076f, 0.02592629f, 0.04317070f, 0.03495444f, -0.02192080f, -0.03469867f, -0.01962511f, -0.02362473f, -0.09521267f, -0.13881717f, -0.03271523f, 0.01372571f, 0.05875682f, 0.06459397f, 0.05796305f, - -0.01487374f, 0.01485744f, 0.01264233f, 0.04546350f, 0.00733058f, 0.08289797f, 0.17793293f, 0.03071348f, -0.11739129f, -0.07170388f, -0.04800450f, -0.00719781f, -0.01613242f, -0.02445791f, -0.03329781f, -0.03877884f, - 0.06919396f, -0.04913878f, -0.23414589f, -0.32278902f, -0.15262688f, -0.02830432f, 0.05881428f, 0.05602689f, 0.08630162f, 0.08206753f, 0.05235369f, 0.05459854f, 0.02224523f, 0.07894449f, 0.13055514f, 0.09590365f, - -0.13456165f, -0.02675728f, 0.10718846f, 0.16038985f, 0.13314470f, 0.04370885f, 0.00879630f, 0.02004215f, 0.04004457f, 0.01767300f, -0.03006764f, -0.02489721f, -0.06793547f, -0.08666415f, -0.07647774f, -0.08362676f, - -0.01963376f, -0.05985601f, -0.06123515f, 0.00802984f, 0.03197310f, 0.08198580f, -0.04518129f, -0.25550460f, -0.02763673f, 0.10534295f, 0.06276998f, 0.04687612f, 0.02909544f, 0.03184387f, 0.04253063f, 0.02859974f, - -0.05005194f, 0.08455623f, 0.27160784f, 0.05333258f, -0.06395559f, -0.12989814f, -0.07303311f, -0.05166257f, -0.03661287f, -0.00149673f, -0.00090933f, 0.02163393f, 0.00899793f, -0.00065646f, -0.01328460f, -0.01856715f, - 0.08465235f, 0.18910437f, -0.17964239f, -0.01596332f, -0.01786381f, -0.02173723f, 0.00655794f, -0.00747303f, -0.01909382f, -0.01073786f, -0.01461080f, 0.01419150f, 0.00349640f, -0.00567498f, -0.00358136f, -0.00162392f -}; - -const float *const ivas_sns_cdbks_side_tcx20[SNS_MSVQ_NSTAGES_SIDE] = { ivas_sns_cdbks_side_tcx20_stage1, ivas_sns_cdbks_side_tcx20_stage2 }; - -const float ivas_sns_means_side_tcx10[M] = { - -0.0085f , 0.0070f , 0.0074f , 0.0045f, - -0.0038f , 0.0071f , 0.0040f , -0.0068f, - -0.0104f , -0.0095f , -0.0259f , -0.0163f, - 0.0127f , 0.0087f , 0.0036f , 0.0262f -}; - -const float ivas_sns_cdbks_side_tcx10_stage1[ 32 * 16 ] = { - -0.23085418f, -0.21005449f, -0.18570241f, -0.13606880f, -0.11948469f, -0.10308038f, -0.11104958f, -0.15882089f, -0.13896854f, -0.06621316f, 0.05217852f, 0.11795393f, 0.15762859f, 0.26837024f, 0.37542593f, 0.48873907f, - 0.13745600f, 0.20131847f, 0.22182278f, 0.29526068f, 0.24656821f, 0.13757111f, 0.07460669f, 0.03134436f, -0.06561883f, -0.17480962f, -0.24070771f, -0.31627147f, -0.28865063f, -0.14849001f, -0.03399112f, -0.07740884f, - -0.13299250f, -0.14002491f, -0.11936499f, -0.04179630f, -0.03438902f, 0.04431344f, 0.06951552f, 0.01403797f, 0.05531963f, -0.01394528f, -0.09745552f, 0.00448586f, 0.26823524f, 0.23321159f, 0.06675539f, -0.17590634f, - 0.06191756f, 0.11582434f, 0.13192343f, 0.09527126f, 0.08193836f, 0.01139745f, 0.03044540f, 0.11065563f, 0.07578016f, -0.02083963f, -0.07297648f, -0.08340844f, -0.07282079f, -0.12840160f, -0.18605485f, -0.15065167f, - -0.03483375f, -0.04038755f, -0.07410056f, -0.06961358f, -0.04495163f, -0.12359739f, -0.20954724f, -0.19583867f, -0.14529606f, 0.00841374f, 0.12968518f, 0.22831580f, 0.23147392f, 0.13653895f, 0.09511995f, 0.10861877f, - 0.06658553f, 0.21860187f, 0.09436141f, -0.09071645f, -0.07082980f, 0.04518200f, 0.04859027f, -0.03547180f, -0.06006165f, -0.02756024f, 0.00158143f, -0.01511772f, -0.04477551f, -0.04937419f, -0.04159366f, -0.03940128f, - 0.02864506f, -0.04039106f, -0.15284948f, -0.42538299f, -0.19236357f, 0.03104685f, 0.02253710f, 0.02311004f, 0.04867318f, 0.06745871f, 0.09338212f, 0.09710035f, 0.07856015f, 0.09301454f, 0.11632315f, 0.11113598f, - 0.14528623f, 0.29868967f, 0.46429789f, 0.54323288f, 0.40204138f, 0.26355278f, 0.17207026f, 0.09889195f, -0.00279626f, -0.16206412f, -0.29083020f, -0.40501466f, -0.54537297f, -0.46768767f, -0.27766915f, -0.23662804f, - -0.38143153f, -0.38286102f, -0.37711911f, -0.29609917f, -0.25719669f, -0.20628984f, -0.15545466f, -0.08387721f, -0.03028209f, 0.14307072f, 0.32718172f, 0.40216059f, 0.39369890f, 0.30234268f, 0.29650354f, 0.30565312f, - 0.35958422f, 0.51604595f, 0.41116626f, 0.13914238f, -0.03378266f, -0.13855653f, -0.18788816f, -0.17389274f, -0.14739128f, -0.16521614f, -0.14451729f, -0.13567903f, -0.09514774f, -0.07488226f, -0.06811874f, -0.06086662f, - -0.66004345f, -0.31718869f, -0.22177390f, -0.12449418f, -0.09939825f, 0.07331022f, 0.21408044f, 0.21558931f, 0.11208625f, 0.04257974f, -0.01807639f, 0.09442548f, 0.06053141f, 0.06888331f, 0.20357028f, 0.35591847f, - -0.16304924f, -0.12420037f, -0.04222860f, 0.05588216f, 0.18467874f, 0.32957705f, 0.39156897f, 0.27848510f, 0.13897139f, -0.02741662f, -0.14580317f, -0.19651482f, -0.22072919f, -0.18213237f, -0.12846721f, -0.14862176f, - -0.17887269f, -0.40659902f, -0.02516902f, 0.09601495f, 0.06138763f, 0.02130781f, 0.05102018f, 0.04939750f, 0.05199909f, 0.05639114f, 0.06766195f, 0.07106289f, 0.04938017f, 0.02276475f, 0.00986626f, 0.00238653f, - 0.35668951f, 0.22742896f, -0.06232152f, -0.18667516f, -0.28394315f, -0.31893226f, -0.28501785f, -0.19154472f, -0.14625471f, -0.07293625f, 0.05620192f, 0.15269426f, 0.20840665f, 0.19892856f, 0.16095072f, 0.18632539f, - -0.04935166f, -0.11272268f, 0.08233717f, 0.29988006f, 0.19331526f, 0.14054174f, 0.08680898f, -0.01410902f, -0.04313985f, -0.03494681f, -0.04540697f, -0.07243925f, -0.09250963f, -0.09472804f, -0.10148439f, -0.14204503f, - 0.18485137f, 0.25341568f, 0.21009944f, 0.20568550f, 0.20518381f, 0.27019582f, 0.21216885f, 0.00546777f, -0.00044021f, -0.10735443f, -0.20735090f, -0.14224940f, -0.09351389f, -0.09761419f, -0.36078632f, -0.53775866f, - -0.37281135f, -0.49261999f, -0.36727842f, -0.16577288f, -0.02238290f, 0.00199674f, -0.01679564f, 0.04714198f, 0.10589472f, 0.16394573f, 0.18921056f, 0.20782063f, 0.19861654f, 0.19447370f, 0.17625681f, 0.15230414f, - 0.06686853f, 0.05611921f, 0.03365910f, 0.02756852f, 0.08295478f, 0.06008045f, -0.03273553f, -0.04364718f, -0.01449926f, -0.16865975f, -0.29690154f, -0.15022460f, -0.01812698f, 0.04654261f, 0.11587511f, 0.23512676f, - 0.05629958f, -0.04922929f, -0.24893641f, -0.04282766f, 0.05664299f, 0.06157661f, 0.05406340f, 0.01868661f, -0.00352496f, -0.00155314f, 0.04576544f, 0.04384907f, 0.01829060f, 0.01451148f, 0.01064548f, -0.03425997f, - 0.00489548f, -0.00560306f, 0.00615573f, -0.00441324f, 0.02514502f, 0.02634783f, 0.01098806f, 0.01133668f, 0.06739798f, 0.14368795f, 0.11283267f, 0.01118776f, -0.08555990f, -0.10393666f, -0.11315265f, -0.10730981f, - -0.15112519f, -0.11783557f, -0.13754019f, -0.07632290f, -0.06121828f, -0.06360113f, -0.05018035f, -0.00549590f, 0.05908192f, 0.04630727f, 0.02538631f, -0.00811102f, -0.02567731f, 0.08327373f, 0.21071206f, 0.27234661f, - 0.56834545f, 0.15133540f, -0.01992277f, -0.04770211f, -0.05432411f, -0.02191499f, -0.02550971f, -0.03144176f, -0.02317891f, -0.02811835f, -0.04327235f, -0.06018613f, -0.07647819f, -0.07349573f, -0.08821391f, -0.12592196f, - -0.03137272f, -0.03974785f, -0.03770784f, -0.05600026f, -0.03191645f, -0.04815164f, -0.04304812f, 0.02455638f, 0.06207261f, 0.02331568f, -0.01876696f, -0.04473163f, -0.02498340f, 0.06425271f, 0.11960865f, 0.08262092f, - 0.45973777f, 0.45999547f, 0.38173824f, 0.22785755f, 0.16821465f, 0.17382620f, 0.20517627f, 0.04061839f, -0.12685907f, -0.26643193f, -0.37356030f, -0.36765140f, -0.32336919f, -0.29335060f, -0.29318189f, -0.07275984f, - -0.07969188f, -0.23669686f, -0.42690692f, -0.49932686f, -0.40006183f, -0.28450852f, -0.22942850f, -0.12475617f, -0.03421007f, 0.12993786f, 0.27530393f, 0.32731838f, 0.50859567f, 0.47553443f, 0.32383390f, 0.27506335f, - 0.34046042f, 0.28909102f, 0.17226731f, 0.06244214f, 0.10377957f, 0.13146006f, 0.03081777f, -0.02599206f, -0.11020633f, -0.20031818f, -0.27040991f, -0.19266314f, -0.09502591f, -0.17705982f, -0.16383079f, 0.10518781f, - -0.43345226f, 0.01054419f, 0.06653837f, 0.02899912f, 0.04789640f, 0.03995846f, 0.02631173f, 0.04744618f, 0.05142942f, 0.03249742f, 0.03044055f, 0.03518159f, 0.01592359f, 0.00998224f, -0.00417209f, -0.00552518f, - -0.35779590f, -0.24084024f, -0.08920896f, -0.01964746f, -0.04518980f, 0.07193759f, 0.22722040f, 0.28999718f, 0.39417664f, 0.30171530f, 0.12526317f, 0.00759665f, -0.11081727f, -0.17325866f, -0.19301481f, -0.18813416f, - -0.16184582f, -0.19051919f, -0.19758934f, -0.16274525f, -0.19869541f, -0.22576659f, -0.13506612f, 0.01672518f, 0.13044875f, 0.26035967f, 0.27598891f, 0.22195891f, 0.13262193f, 0.13096192f, 0.10021772f, 0.00294471f, - 0.07825952f, 0.06525092f, 0.17527642f, 0.02096373f, -0.24373383f, -0.29324959f, -0.11558339f, -0.03040273f, 0.01406029f, 0.04150557f, 0.06984124f, 0.07372710f, 0.06551062f, 0.06332513f, 0.02509070f, -0.00984142f, - 0.08701726f, 0.12843394f, 0.16700094f, 0.15034452f, 0.12947411f, -0.01656238f, -0.15483649f, -0.18970569f, -0.18557831f, -0.09352705f, -0.01998975f, -0.00988876f, 0.00753489f, 0.01530672f, 0.00965047f, -0.02467425f, - 0.26197082f, 0.21849905f, 0.21673972f, 0.16654799f, 0.18547759f, 0.16177425f, 0.16111117f, 0.20927596f, 0.18073438f, 0.03535012f, -0.14032550f, -0.22486416f, -0.33259461f, -0.40957544f, -0.38613800f, -0.30398287f -}; - -const float ivas_sns_cdbks_side_tcx10_stage2[ 8 * 16 ] = { - -0.13993218f, -0.02453874f, 0.12672628f, 0.02785695f, 0.06681568f, 0.12811808f, 0.07492973f, -0.01977524f, -0.05822869f, -0.07547464f, -0.06553072f, -0.05473233f, -0.04357434f, -0.00634272f, 0.03406826f, 0.02961442f, - -0.06711216f, -0.11444162f, -0.09789788f, -0.09123304f, -0.12190348f, -0.00995424f, 0.10989921f, 0.11555575f, 0.06002452f, 0.03801973f, 0.02047622f, 0.01721280f, 0.02414692f, 0.02829613f, 0.03827912f, 0.05063187f, - 0.05523005f, 0.03052467f, 0.03910551f, 0.05802321f, 0.02158461f, 0.03249705f, 0.04015871f, -0.00878163f, -0.05597684f, -0.02391125f, 0.03722223f, 0.06349026f, 0.02718346f, -0.07380323f, -0.12743287f, -0.11511406f, - 0.11202279f, 0.20074913f, 0.04546646f, -0.10844616f, -0.14193153f, -0.08529745f, -0.03252409f, 0.03394947f, 0.04414551f, 0.00658101f, -0.01249852f, -0.01845361f, -0.01335408f, -0.01042434f, -0.00769413f, -0.01229041f, - -0.04167890f, -0.07371348f, -0.14826543f, 0.02126701f, 0.16009313f, 0.11910639f, 0.05602141f, 0.08082496f, 0.12544839f, 0.05415940f, -0.03080142f, -0.04070302f, -0.06024186f, -0.07129750f, -0.07769974f, -0.07251926f, - -0.07457123f, -0.04115197f, -0.04049765f, -0.06857318f, -0.04225051f, -0.03861733f, -0.05120942f, -0.08876715f, -0.05537668f, 0.03678654f, 0.09038235f, 0.06681871f, 0.08915640f, 0.13108744f, 0.08129597f, 0.00548771f, - -0.05294641f, 0.03370244f, 0.16024587f, 0.17199155f, 0.02454307f, -0.13278320f, -0.13945295f, -0.04199699f, 0.00678627f, 0.02029543f, 0.00856028f, 0.00137417f, -0.01135502f, -0.03017687f, -0.02257884f, 0.00379131f, - 0.20898804f, -0.01113044f, -0.08488316f, -0.01088633f, 0.03304903f, -0.01306932f, -0.05782260f, -0.07100917f, -0.06682249f, -0.05645623f, -0.04781041f, -0.03500698f, -0.01196148f, 0.03266111f, 0.08176223f, 0.11039842f -}; - -const float *const ivas_sns_cdbks_side_tcx10[SNS_MSVQ_NSTAGES_SIDE] = { ivas_sns_cdbks_side_tcx10_stage1, ivas_sns_cdbks_side_tcx10_stage2 }; -#endif -#endif // SNS_MSVQ - -#ifdef FIX_445_SNS_BUGFIXES const int16_t sns_1st_cdbk[2][2][8 * 32] = { { /* split 1 */ { /* TCX 20 */ @@ -6977,9 +6341,7 @@ const int16_t sns_1st_means_32k[2][16] = { 16510, 20660, 16025, 7224, 3921, 3868, 2623, 742, -1316, -6269, -8284, -7288, -6380, -8410, -13351, -20277, } }; -#endif -#ifdef MC_PARAMUPMIX_MODE ACPL_QUANT_TABLE alpha_quant_table[] = { { /* Alfa Fine */ @@ -7075,6 +6437,5 @@ ACPL_QUANT_TABLE beta_quant_table[2][9] = } /* End Beta Coarse #5 */ } }; -#endif /* clang-format on */ diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index fd8bd41a3034cbf94686cf6f51c0896dbef503a2..f43bacbf3bcb91500bfb8bd65b080fe760ab05d1 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -161,22 +161,12 @@ extern const int16_t DirAC_band_grouping_5[5 + 1]; extern const int16_t DirAC_block_grouping[MAX_PARAM_SPATIAL_SUBFRAMES + 1]; extern const int16_t DirAC_block_grouping_5ms_MDFT[MAX_PARAM_SPATIAL_SUBFRAMES + 1]; -#ifdef HODIRAC extern const float c_weights[DIRAC_NO_FB_BANDS_MAX]; -#endif -#ifdef HODIRAC -extern const float w_nm[NUM_ANA_SECTORS][9]; -extern const float x_nm[NUM_ANA_SECTORS][9]; -extern const float y_nm[NUM_ANA_SECTORS][9]; -extern const float z_nm[NUM_ANA_SECTORS][9]; -#else -#define NUM_ANA_SECTORS 1 extern const float w_nm[NUM_ANA_SECTORS][9]; extern const float x_nm[NUM_ANA_SECTORS][9]; extern const float y_nm[NUM_ANA_SECTORS][9]; extern const float z_nm[NUM_ANA_SECTORS][9]; -#endif /*------------------------------------------------------------------------------------------* * SPAR ROM tables @@ -189,19 +179,11 @@ extern const ivas_huff_models_t ivas_huff_pred_r_consts[TOTAL_PRED_QUANT_STRATS_ extern const ivas_huff_models_t ivas_huff_drct_r_consts[TOTAL_DRCT_QUANT_STRATS]; extern const ivas_huff_models_t ivas_huff_decd_r_consts[TOTAL_DECD_QUANT_STRATS]; extern const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN]; -#ifdef HODIRAC extern const int16_t remix_order_set[1][DIRAC_MAX_ANA_CHANS]; -#else -extern const int16_t remix_order_set[1][IVAS_SPAR_MAX_CH]; -#endif extern const int16_t keep_planar[IVAS_SPAR_MAX_CH - FOA_CHANNELS]; -#ifdef HODIRAC extern const int16_t HOA_keep_ind[IVAS_SPAR_MAX_FB_IN_CHAN]; extern const int16_t HOA_keep_ind_spar[IVAS_SPAR_MAX_CH]; extern const int16_t HOA_keep_ind_spar512[IVAS_SPAR_MAX_CH]; -#else -extern const int16_t HOA_keep_ind[IVAS_SPAR_MAX_CH]; -#endif extern const float dtx_pd_real_min_max[2]; extern const int16_t dtx_pd_real_q_levels[3][3]; @@ -392,9 +374,7 @@ extern const float ivas_cos_twiddle_80[IVAS_80_PT_LEN >> 1]; extern const float ivas_mdft_coeff_cos_twid_240[IVAS_240_PT_LEN + 1]; extern const float ivas_mdft_coeff_cos_twid_160[IVAS_160_PT_LEN + 1]; -#ifdef PARAMMC_SHORT_ENC_MDFT extern const float ivas_mdft_coeff_cos_twid_120[IVAS_120_PT_LEN + 1]; -#endif extern const float ivas_mdft_coeff_cos_twid_80[IVAS_80_PT_LEN + 1]; extern const float ivas_mdft_coeff_cos_twid_40[IVAS_40_PT_LEN + 1]; extern const float ivas_mdft_coeff_cos_twid_960[IVAS_960_PT_LEN + 1]; @@ -431,28 +411,9 @@ extern const float ivas_fb_resp_cheby_ramp_16del[IVAS_FB_1MS_16K_SAMP + 1]; extern const int16_t ivas_num_active_bands[FB - WB + 1]; -#ifdef SNS_MSVQ /*------------------------------------------------------------------------------------------* * SNS MSVQ codebooks and means *------------------------------------------------------------------------------------------*/ -#ifdef FIX_445_SNS_BUGFIXES -extern const int16_t ivas_sns_cdbks_tcx20_levels[]; -extern const int16_t ivas_sns_cdbks_tcx20_bits[]; - -extern const int16_t ivas_sns_cdbks_tcx10_levels[]; -extern const int16_t ivas_sns_cdbks_tcx10_bits[]; - -extern const float *const ivas_sns_cdbks_tcx20[]; -extern const float *const ivas_sns_cdbks_tcx10[]; - -extern const int16_t ivas_sns_cdbks_side_tcx20_levels[]; -extern const int16_t ivas_sns_cdbks_side_tcx20_bits[]; -extern const int16_t ivas_sns_cdbks_side_tcx10_levels[]; -extern const int16_t ivas_sns_cdbks_side_tcx10_bits[]; - -extern const float *const ivas_sns_cdbks_side_tcx20[]; -extern const float *const ivas_sns_cdbks_side_tcx10[]; -#else extern const int16_t ivas_sns_cdbks_tcx20_levels[]; extern const int16_t ivas_sns_cdbks_tcx20_bits[]; @@ -462,32 +423,21 @@ extern const int16_t ivas_sns_cdbks_tcx10_bits[]; extern const float *const ivas_sns_cdbks_tcx20[]; extern const float *const ivas_sns_cdbks_tcx10[]; -extern const float ivas_sns_means_tcx20[]; -extern const float ivas_sns_means_tcx10[]; - extern const int16_t ivas_sns_cdbks_side_tcx20_levels[]; extern const int16_t ivas_sns_cdbks_side_tcx20_bits[]; extern const int16_t ivas_sns_cdbks_side_tcx10_levels[]; extern const int16_t ivas_sns_cdbks_side_tcx10_bits[]; extern const float *const ivas_sns_cdbks_side_tcx20[]; -extern const float ivas_sns_means_side_tcx20[]; extern const float *const ivas_sns_cdbks_side_tcx10[]; -extern const float ivas_sns_means_side_tcx10[]; -#endif -#endif -#ifdef MC_PARAMUPMIX_MODE extern ACPL_QUANT_TABLE alpha_quant_table[]; extern ACPL_QUANT_TABLE beta_quant_table[2][9]; -#endif -#ifdef FIX_445_SNS_BUGFIXES /* means and codebooks for the split VQ in the 2-stage SNS VQ */ extern const int16_t sns_1st_cdbk[2][2][8 * 32]; extern const int16_t sns_1st_means_16k[2][16]; extern const int16_t sns_1st_means_25k6[2][16]; extern const int16_t sns_1st_means_32k[2][16]; -#endif /* IVAS_ROM_COM_H */ #endif diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index d0b153260b5412cc5688f0e18c93fc3f4ed4bfb1..e7a448315f43ef827f94e165106f77c728c140e6 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -222,11 +222,8 @@ int16_t ivas_sba_get_nchan( /*! r: number of ambisonics metadata channels */ int16_t ivas_sba_get_nchan_metadata( const int16_t sba_order /* i : Ambisonic (SBA) order */ -#ifdef HODIRAC , - const int32_t ivas_total_brate -#endif -) + const int32_t ivas_total_brate ) { int16_t nb_channels; @@ -236,7 +233,6 @@ int16_t ivas_sba_get_nchan_metadata( } else { -#ifdef HODIRAC if ( ivas_total_brate >= IVAS_512k ) { nb_channels = ( SBA_HOA2_ORDER + 1 ) * ( SBA_HOA2_ORDER + 1 ); @@ -244,7 +240,6 @@ int16_t ivas_sba_get_nchan_metadata( nb_channels = min( nb_channels, ( sba_order + 1 ) * ( sba_order + 1 ) ); } else -#endif { /* FOA + planar HOA */ nb_channels = FOA_CHANNELS + 2 * ( sba_order - 1 ); @@ -261,7 +256,6 @@ int16_t ivas_sba_get_nchan_metadata( *-------------------------------------------------------------------*/ /*! r: flag indicating to code SPAR HOA MD for all bands */ -#ifdef HODIRAC void ivas_sba_get_spar_hoa_ch_ind( const int16_t num_md_chs, /* i : number of MD channels */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ @@ -312,26 +306,6 @@ void ivas_sba_get_spar_hoa_md_flag( return; } -#else -int16_t ivas_sba_get_spar_hoa_md_flag( - const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ -) -{ - int16_t spar_hoa_md_flag = 0; - - if ( sba_order > 1 && ivas_total_brate >= IVAS_256k ) - { - spar_hoa_md_flag = 1; - } - else - { - spar_hoa_md_flag = 0; - } - - return spar_hoa_md_flag; -} -#endif /*-------------------------------------------------------------------* diff --git a/lib_com/ivas_sns_com.c b/lib_com/ivas_sns_com.c index b109ef87d6978833b560e3ab34f0005ba12fde7d..da7b37e8c55f2ecfecc5f0439968cf315b39772e 100644 --- a/lib_com/ivas_sns_com.c +++ b/lib_com/ivas_sns_com.c @@ -36,9 +36,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#ifdef FIX_445_SNS_BUGFIXES #include "ivas_rom_com.h" -#endif #include #include #ifdef DEBUGGING @@ -121,7 +119,6 @@ void sns_compute_scf( xs[FDNS_NPTS - 1] = 0.75f * x[FDNS_NPTS - 1] + 0.25f * x[FDNS_NPTS - 2]; /* Pre-emphasis */ -#ifdef FIX_445_SNS_BUGFIXES switch ( L_frame ) { case L_FRAME16k: @@ -137,33 +134,6 @@ void sns_compute_scf( tilt = 0.f; assert( !"illegal frame length in sns_compute_scf" ); } -#else - if ( L_frame == L_FRAME16k ) - { - tilt = 18.f; - } - else if ( L_frame == L_SPEC16k_EXT ) - { - tilt = 20.f; - } - else if ( L_frame == L_FRAME25_6k ) - { - tilt = 22.f; - } - else if ( L_frame == L_FRAME32k ) - { - tilt = 26.f; - } - else if ( L_frame == L_SPEC32k_EXT ) - { - tilt = 30.f; - } - else - { - tilt = 0.f; - assert( 0 && "illegal frame length in sns_compute_scf" ); - } -#endif for ( i = 0; i < FDNS_NPTS; i++ ) { diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index 73d8030651fd1d8b92bc1ac5e5733ab032981fe6..fb0f2637653dc12f2f173922b39d4265fa441de1 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -1686,18 +1686,12 @@ void ivas_get_spar_md_from_dirac( remix_order = remix_order_set[hSpar_md_cfg->remix_unmix_order]; - num_ch = ivas_sba_get_nchan_metadata( order -#ifdef HODIRAC - , + num_ch = ivas_sba_get_nchan_metadata( order, IVAS_256k /*dummy value as order is always 1 in this function*/ -#endif ); - hoa2_ch = ivas_sba_get_nchan_metadata( SBA_HOA2_ORDER -#ifdef HODIRAC - , + hoa2_ch = ivas_sba_get_nchan_metadata( SBA_HOA2_ORDER, IVAS_256k /*dummy value as order is always 1 in this function*/ -#endif ); foa_ch = FOA_CHANNELS; @@ -2173,13 +2167,8 @@ void ivas_spar_set_bitrate_config( max_bits += (int16_t) ( ivas_spar_br_table_consts[table_idx].core_brs[i][1] / FRAMES_PER_SEC ); } -#ifdef COMBINED_FORMAT_SIGNALING pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_EXTENDED - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - total_bits; pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_EXTENDED - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - max_bits; -#else - pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - total_bits; - pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - max_bits; -#endif md_coding_bits_header = SPAR_NUM_CODING_STRAT_BITS + pSpar_md_cfg->quant_strat_bits; diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index e2f2e0f1f28605512ca05562788e267b0ca68b08..e38ad28e691ecbc9343e42971c08e3e10a6af483 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -58,11 +58,9 @@ typedef struct { int16_t ism_metadata_flag; /* flag whether metadata are coded in particular frame of particular object */ int16_t last_ism_metadata_flag; /* last frame ism_metadata_flag */ -#ifdef ISM_NON_DIEGETIC_PAN - int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */ -#endif - float azimuth; /* azimuth value read from the input metadata file */ - float elevation; /* azimuth value read from the input metadata file */ + int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */ + float azimuth; /* azimuth value read from the input metadata file */ + float elevation; /* azimuth value read from the input metadata file */ float radius; float yaw; /* azimuth orientation value read from the input metadata file */ float pitch; /* elevation orientation value read from the input metadata file */ @@ -76,13 +74,9 @@ typedef struct float last_true_azimuth; /* MD smoothing in DTX- last true Q azimuth value */ float last_true_elevation; /* MD smoothing in DTX- last true Q elevation value */ -#ifdef FIX_387_ISM_MD_FEC int16_t ism_md_fec_cnt_enc; /* counter of continuous frames where MD are not transmitted */ int16_t ism_md_inc_diff_cnt; /* counter of continuous frames where MD are transmitted in inactive segments when MD significantly changes */ -#endif -#ifdef FIX_435_ISM_MERGE_BUG - float last_true_radius; /* last true Q radius value */ -#endif + float last_true_radius; /* last true Q radius value */ } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; @@ -170,9 +164,7 @@ typedef struct ivas_param_ism_data_structure int16_t flag_noisy_speech; int16_t noisy_speech_buffer[PARAM_ISM_HYS_BUF_SIZE]; -#ifdef FIX_440_PARAM_ISM_DIR_NOISE int16_t flag_equal_energy; -#endif } PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE; @@ -185,9 +177,7 @@ typedef struct ivas_dirac_config_data_struct { int16_t enc_param_start_band; int16_t dec_param_estim; -#ifdef FIX_391_SBA int16_t dec_param_estim_old; -#endif int16_t nbands; } DIRAC_CONFIG_DATA, *DIRAC_CONFIG_DATA_HANDLE; @@ -727,9 +717,7 @@ typedef struct ivas_fb_mixer_cfg_t int16_t fb_latency; int16_t num_in_chans; int16_t num_out_chans; -#ifdef HODIRAC int16_t nchan_fb_in; -#endif int16_t pcm_offset; int16_t fade_len; /* this sets the stride length; no delay is introduced */ int16_t prior_input_length; diff --git a/lib_com/ivas_td_decorr.c b/lib_com/ivas_td_decorr.c index 9a08c06f6a3fd08d11edc45bdc83253e07324bef..9285e23a227a86f3e3b649f263901a8cfe3378f4 100644 --- a/lib_com/ivas_td_decorr.c +++ b/lib_com/ivas_td_decorr.c @@ -87,10 +87,8 @@ static const float ivas_three_pow_frac[IVAS_MAX_DECORR_APD_SECTIONS] = { }; -#ifdef FIX_417_TD_DECORR_BRATE_SW #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) -#endif /*------------------------------------------------------------------------------------------* * Local functions declaration @@ -101,7 +99,6 @@ static int16_t ivas_get_APD_filt_orders( const int16_t num_out_chans, const int3 static void ivas_td_decorr_init( ivas_td_decorr_state_t *hTdDecorr, const int16_t num_out_chans, const int16_t ducking_flag ); -#ifdef FIX_417_TD_DECORR_BRATE_SW /*------------------------------------------------------------------------- * ivas_td_decorr_reconfig_dec() * @@ -191,7 +188,6 @@ ivas_error ivas_td_decorr_reconfig_dec( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- @@ -405,11 +401,7 @@ static void ivas_td_decorr_init( * * APD IIR filter *-----------------------------------------------------------------------------------------*/ -#ifdef MC_PARAMUPMIX_MODE void ivas_td_decorr_APD_iir_filter( -#else -static void ivas_td_decorr_APD_iir_filter( -#endif ivas_td_decorr_APD_filt_state_t *filter_state, float *pIn_out, const int16_t num_APD_sections, diff --git a/lib_com/options.h b/lib_com/options.h index cbbccd5ec33efd4a7df54f53589a6fa44c233142..00d703e68c52a6306a56b0749022afe9229d56f9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -142,93 +142,24 @@ #define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define NON_DIEGETIC_PAN /* Orange: Contribution 34: non diegetic panning in decoder */ -#define ISM_NON_DIEGETIC_PAN /* Orange: Contribution 34: non diegetic panning for ism objects */ -#define FIX_331_ALL_BRS /*Enable the fix_331 across all the bitrates and sba modes*/ -#define FIX_ISM_DTX_CNG_BWIDTH_ALT /* VA: issue 396 - alternative fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation */ -#define FIX_398_MASA_DIRECTION_ALIGNMENT /* Nokia: Issue 398: in 2dir MASA, dynamically adjust directions to be consistent */ -#define REND_DEBUGGING_REVISION /* VA: encapsulate rendering debugging options with DEBUGGING */ -#define FIX_419_ISM_MD_FIX /* VA: Issue 419: fix the upper value limitation for parameter angle1_diff_cnt */ -#define FIX_I414_OOA_CNA /* VA: Issue 414: Fixing out-of-array write operation in stereo CNA */ - - -#define SNS_MSVQ /* FhG: contribution 33 - MSVQ for SNS parameters at stereo mid bitrates */ /*#define FIX_XXX_JBM_FIFO_BUFFER */ /* FhG: prevent wraparound of a length identifier in cause of large frames and many channels*/ - -#define FIX_379_GAININTP /* Eri: Adds a gain interpolation for directional/distance gain to handle abrupt changes in metadata (Non BE) */ -#define FIX_387_ISM_MD_FEC /* VA: Issue 387: fix MD discontinuity in ISM FEC */ - -#define FIX_418_SID_BITRATE /* Eri: Issue 418: Using the correct bitrate for unified stereo SID */ -#define PARAMMC_SHORT_ENC_MDFT /* FhG: Issue 410: complexity optimization for parametric Multichannel modes */ -#define FIX_421_TD_INT_TUNE /* Eri: Issue 421: Increase use of interpolation in TD renderer filter transition */ -#define FIX_419_ISM_BRATE_SW_DTX /* VA: issue 419: fix ISM Bitrate Switching with dtx */ -#define FIX_422 /* FhG: Issue 422: re-introduce fix for noisy speech buffer in ParamISM */ - -#define ERI_MSVQ_CLEANUP /* Eri: Contribution #31 BE modularization of msvq encoder side DCT21&DCT24 within msvq_enc() */ -#define FIX_416_ISM_BR_SWITCHING /* FhG: add missing CLDFB reconfig to ISM BR switching */ -#define FIX_SP2A /* VA: Issue 412: Adjust threshold for the S_p2a feature in the tonal detector */ - -#define FIX_413_SBA_DTX /* Dlb: Fix for issue 413, SBA DTX CNG in 2TC mode*/ -#define FIX_417_TD_DECORR_BRATE_SW /* VA: Issue 417: fix incorrect use of TD decorrelator in bitrate switching */ -#define FIX_368_SBA_MODE /* Dlb: Fix for issue 368 */ -#define FIX_427_MAXIMUM_S_INDEX /* VA: issue 427: fix return index of function maximum_s() */ -#define FIX_431_PARAMMC_PLC_INTERPOLATOR /* FhG: Issue 431: fix missing interpolator reset for ParamMC PCL */ -#define FIX_391_SBA /* Dlb: Fix for issue 391 for SBA */ -#define LBR_ADAP_SMOOTHING_OPT /* FhG: Issue 436: complexity optimization of adaptive smoothing in low-bitrate SBA */ - -#define FIX_425_MASA_BRSW_RENDERER /* Nokia: Issue 425: renderer not reconfigure in MASA bitrate switching */ - -#define EUALER2QUAT_FIX /* Dlb :fix for issue 430 issue in euler2quat, sign of quat y is inverted */ #define HR_METADATA /* Nok: Contribution #45: encode directional MASA metadata with more bits at 384k and 512k */ -#define SBA_TD_RESIDUAL /* Dlb : Issue 426: SBA encoder complexity optimization */ - -#define FIX_357_DTX_32K /* Eri: issue 357 - Forced LP-CNG at 32k */ -#define FIX_435_ISM_MERGE_BUG /* Eri: Merge bug fix for ISM NULL metadata and tcx_only cases */ -#define FIX_355_REFACTOR_PARAMBIN_TO_5MS /* Nokia: Fixes issue 355 by refactoring parametric binauralizer code to 5 ms mode */ -#define FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING /* Eri: Fix incorrect use of stack variable used for channel aware config file */ -#define COMBINED_FORMAT_SIGNALING /* VA: Introduce a signaling bit for combined format coding */ -#define FIX_446_STEREO_DMX_CRASH /* FhG: fix discrepancy with EVS code that could cause crashes in rare cases */ - -#define FIX_386_CORECODER_RECONFIG_2 /* VA: Issue 386: Resolve remaining ToDo comments in CoreCoder reconfig. */ #define FIX_439_OTR_PARAMS /* Philips: Issue 439: orientation tracking parameter aspects. */ -#define FIX_440_PARAM_ISM_DIR_NOISE /* FhG: Issue 440: Fix directional background noise becoming diffuse in ParamISM */ - -#define LBR_SBA_DIRAC_FIX /* DLB: Bug fix for DirAC at low bitrates */ - -#define FIX_445_SNS_BUGFIXES /* FhG: bug fix for spectral tilt in SNS computation + necessary update of codebooks and converison to fixedpoint-compatible tables */ -#define FIX_447_PARAMBIN_MASA_REGU_FAC /* Nokia: Issue 447: Fix issue by adjusting regularization factor minimum value. */ -#define FIX_441_SBA_PARAMBIN_GAINS /* Nokia: Fix issue 441 by changing gains in SBA path of parametric binauralizer */ - -#define MC_PARAMUPMIX_MODE /* Dlb: Contribution 39: Multichannel Parametric Upmix */ -#define FIX_469_BRSWITCH_PUPMIX /* Dlb: Fix issue 469 for Param Upmix bitrate switching */ - -#define HODIRAC /* FhG: Contribution 32: Sector-based HO-DirAC method for SBA at high bitrates */ -#define DIRAC_ALLOC_HARM /* VA: harmonize DirAC parameters allocation/deallocation */ - - -#define COMPLEXITY_LEVEL_INDICATION #define FIX_463_TD_RENDERER_DIRECTIVITY_RESET /* Eri: Remove unintentional reset of directivity pattern */ - #define FIX_642 /* FhG: Fix for issue 642, buggy DoA-array access in DirAC head rotation*/ - #define FIX_443_FD_CNG_INIT /* FhG: correct bitrate value for FD-CNG init */ #define VARIABLE_SPEED_DECODING /* FhG: variable speed decoding employing the JBM functioniality */ #define JBM_TSM_ON_TCS /* FhG: run the TSM part of JBM on the TCs instead of the final output pcm waveforms */ - #define FIX_DTX_428 /* FhG: fix for issue 428, crash with DTX and bitrate switching */ - #define FIX_STEREO_474 /* FhG fix for issue 574, crash with SBA to stereo output at 512 kbps */ #define FIX_MDCT_ST_PLC_FADEOUT_DELAY - #define FIX_DIRAC_LS_SYNTHESIS_CONFIG_479 /* FhG: fix for issue 479, broken LS output with DirAC at high BRs */ - #define HYBRID_ITD_MAX /* FhG: Improvement for DFT-stereo for cases with large ITDs */ - #define FIX_487_LOWRATE_SBA_TUNING_FIX /* Dlb: TUning fix for low bitrate cases to match theoretical longest SPAR MD bitstream */ - #define FIX_490_MASA_2TC_LBR_DTX /* Nokia: Fixes issue 490 by correcting condition. */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 6d3d0fd744585ba84ed17fb2e299074d8d89d411..e6f371c468148a17d0d23a7be80ee575ed20a52a 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4555,10 +4555,8 @@ ivas_error acelp_core_dec( const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ const int16_t nchan_out, /* i : number of output channels */ STEREO_CNG_DEC_HANDLE hStereoCng /* i : stereo CNG handle */ -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT , const int16_t read_sid_info /* i : read SID info flag */ -#endif ); void bass_psfilter_init( @@ -8171,7 +8169,6 @@ void extend_dctN_input( const int16_t n_cols, /* i: number of columns == truncation length */ DCTTYPE dcttype ); /* i: matrix type */ -#ifdef ERI_MSVQ_CLEANUP int16_t msvq_stage1_dct_search( /* o : (p_max , best candidate sofar ) */ const float *u, /* i : target */ const int16_t N, /* i : target length and IDCT synthesis length */ @@ -8205,7 +8202,6 @@ int16_t msvq_stage1_dct_recalc_candidates_fdcng_wb( const int16_t maxC_st1, /* i : number of candidates in stage1 */ float *dist_ptr /* i/o: updated MSE vector for stage1 */ ); -#endif void PulseResynchronization( const float *src_exc, /* i : Input excitation buffer */ diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index 25a5d6ee9e2bc576521784a27abdc242d86344dd..e4b8ec9db90d6e036d74a6910cc82c7aa7347412 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -22285,77 +22285,6 @@ const Word16 InvDiffTable[32] = /* Q20 */ 0x290F, 0x27A4, 0x264C, 0x2506, 0x23CF, 0x22A7, 0x218E, 0x2081 }; -#ifndef FIX_445_SNS_BUGFIXES -const float sns_vq_cdk1[8*32] = { - -2.0529254143208289e+00f, -2.0105187772519200e+00f, -1.9181418840663027e+00f, -2.0529955931580051e+00f, -1.7965682581646625e+00f, -1.2350476819733338e+00f, -7.4106681145668685e-01f, -1.3500749433562539e-01f, - +6.8395648103934958e-01f, -5.6618076612019363e-01f, -1.1629656439143417e+00f, -1.6994296999691509e+00f, -1.7665333688662666e+00f, -1.4601240490692278e+00f, -1.0934184548732562e+00f, -5.8974136946769384e-01f, - -2.7268374190678193e+00f, -2.1818157040224055e+00f, -6.0427109270377999e-01f, +3.1651466770121833e-01f, +9.3430762386407940e-01f, +1.0478771837003078e+00f, +9.9559582196380947e-01f, +1.1082403839542609e+00f, - +2.4379206786519574e+00f, +1.9640422580297323e+00f, +9.2771600149270417e-01f, +9.4135273318020941e-03f, -6.4013168732630366e-01f, -1.0138049129223088e+00f, -1.0924849368417169e+00f, -9.1129148479978594e-01f, - +8.1762121316616565e-01f, -1.9433974959365836e-02f, -4.0054937117179751e-01f, -3.9231079150228149e-01f, -2.9970406532808125e-01f, -6.2996056616087495e-02f, +3.7544100964377108e-01f, +6.3685372354777436e-01f, - +1.4734834246724329e+00f, +2.3539621556904251e+00f, +9.7194661426112050e-01f, -5.4110096556162990e-01f, -9.8129311847374545e-01f, -6.1342289097457547e-01f, +3.7249272152905366e-01f, +8.1252213656497096e-01f, - -1.2496145961286331e+00f, -3.2376394756447752e-01f, +5.1439178441534027e-02f, +1.0005059991983459e-01f, +2.3749822119608346e-01f, +4.0542724931792579e-01f, +5.1033138353497232e-01f, +5.5694404671095077e-01f, - +7.7965743766052975e-01f, +2.1917885215778097e+00f, +1.7164750043876311e+00f, +5.7945306635665195e-01f, -1.0190291924038120e-01f, -4.0418854005812310e-01f, -4.7849155803986132e-01f, -3.4725769238259874e-01f, - +6.8865034807898129e-01f, +5.7566331510263680e-01f, -7.7725260497355977e-03f, -5.3794851427474544e-01f, -7.6313855691212973e-01f, -7.8413803908382473e-01f, -7.0161107722315574e-01f, -4.8903452069978415e-01f, - +1.6928828230225725e+00f, +9.3495589460148931e-01f, +3.5426821621575499e-01f, +3.9507891687964890e-02f, -7.9631988607824541e-02f, -1.6624589421972935e-01f, -1.6180598135213178e-01f, -1.2860376999895359e-01f, - -1.6962541680165768e+00f, +4.3456061122651995e-01f, +1.0710566866483171e+00f, +1.3249974344239270e+00f, +1.0825630027900910e+00f, +9.0621333090389167e-01f, +6.5428541538000140e-01f, +6.7283424156333382e-01f, - +4.5763916137396308e+00f, +4.0870427709381518e+00f, +2.6750799962096261e+00f, +1.4487891616901025e+00f, +2.4432209950451603e-01f, -5.4383244175422862e-01f, -9.4142251186129933e-01f, -1.0862058366913647e+00f, - +1.1883989487611160e+00f, +1.1685324900978113e+00f, +9.3045980943772877e-01f, +8.3738457417173884e-01f, +6.3496480700237246e-01f, +4.6405143429051326e-01f, +3.1705534227338888e-01f, +2.0799507760170197e-01f, - +2.8980578835865609e+00f, +3.0880495072396617e+00f, +1.8680019598806248e+00f, +7.0446466488259230e-01f, +1.0107302845552169e-01f, -2.8986489567349910e-01f, -4.1462748482286188e-01f, -3.6206036514823836e-01f, - -1.7524799389036466e-01f, +1.1936698995397648e+00f, +1.6088971749375909e+00f, +1.7111901074418125e+00f, +1.4837525009734551e+00f, +5.2536808756057463e-01f, -3.1226889149907566e-01f, -3.5746958704581933e-01f, - +9.0352696786286879e-01f, +2.4731406386331605e+00f, +2.9079925242729416e+00f, +2.7918041274045429e+00f, +2.2373843929092465e+00f, +8.5208847870338755e-01f, -7.6200320575426320e-02f, -2.5316053664429367e-01f, - -1.1865763437968528e+00f, -7.4234595628060440e-01f, -6.0141100860138463e-01f, -8.5065089175547848e-01f, -8.8329724313055402e-01f, -6.5351381126344021e-01f, -5.0230651881879618e-01f, -2.3359707426927168e-01f, - +2.7673589888377261e+00f, +6.6328569264593351e-01f, -4.1472488624881343e-01f, -9.3187436659797018e-01f, -1.0754140202622839e+00f, -1.0146723389090857e+00f, -8.7888946611264573e-01f, -6.0836606213569688e-01f, - -1.8124429341308173e+00f, -9.7828066142280434e-01f, +6.5968430845517978e-01f, +2.1854499449267628e+00f, +2.2517483941731826e+00f, +2.3821501109065295e+00f, +1.9235238012956650e+00f, +1.5065083288921912e+00f, - +4.9050283992558246e+00f, +2.4264119698434983e+00f, +8.3367299614637902e-01f, -4.3119484392510427e-02f, -5.8100382033177300e-01f, -7.7353747986816990e-01f, -8.7895223350767071e-01f, -8.6819816920933113e-01f, - +6.5228388674538984e-01f, +1.1174683594915380e-01f, +1.2383281142011383e-01f, +6.0151217547540869e-01f, +9.5444246174773772e-01f, +1.2805750123888453e+00f, +9.2140926443564275e-01f, +5.7786881373204924e-01f, - +1.9490989723028713e+00f, +2.8004262751807882e+00f, +1.9081816065970161e+00f, +3.7248785750983177e-01f, +1.3095620385608037e-01f, +7.9016424306166244e-01f, +1.1640502521465221e+00f, +1.0066783002173452e+00f, - -1.0171864644867654e-01f, +1.7954757784640871e+00f, +1.8915637038163424e+00f, +1.0909542570620605e+00f, +6.1888445783828194e-01f, +7.6574083569028828e-01f, +8.9561325653114987e-01f, +8.0797624213033170e-01f, - +1.9350543800926379e+00f, +3.2339385307849722e+00f, +3.0806729276317419e+00f, +2.1684844197871249e+00f, +7.8035951982399498e-01f, -6.7854327548476567e-01f, -9.6732224945258960e-01f, -5.8068474286758409e-01f, - -1.5383985945543574e-01f, +7.1583722374971992e-01f, +5.8674384505519706e-01f, +3.7092544478085621e-01f, +1.0970155384441491e-01f, -2.3854313229153577e-02f, -5.3508967318497622e-02f, +3.3979575877473786e-02f, - +2.7095625819635165e+00f, +1.7832208238203791e+00f, +9.6783753432609421e-01f, +5.8919108500645523e-01f, +4.1191953120474317e-01f, +1.9592175852184501e-01f, -1.0134844291353281e-02f, -1.6725603195278577e-01f, - -2.6560188981865329e-01f, +1.4059113655935889e+00f, +1.9844196049902063e+00f, +2.4291429998935334e+00f, +2.2837873843112892e+00f, +1.8570922995202830e+00f, +1.2056879204230433e+00f, +8.4717915626409468e-01f, - +3.1939221203717074e+00f, +3.7963726820313615e+00f, +3.2748823221663406e+00f, +2.4724357608035472e+00f, +1.6860933687497499e+00f, +6.4628696101838046e-01f, -7.8170867286998971e-02f, -6.1406792037327973e-01f, - +1.6686627356973500e+00f, +2.4375118241337517e+00f, +2.2118134266295129e+00f, +1.4754862720822910e+00f, +1.0100987843177478e+00f, +4.8216927165041135e-01f, +5.0597779432044222e-02f, -7.2090396257990311e-02f, - +3.4953550651375287e+00f, +3.2379627985821369e+00f, +2.1155532232841976e+00f, +1.3293556793682053e+00f, +1.0159800928862721e+00f, +6.8710150035919371e-01f, +5.0950588745743997e-01f, +2.0092204555514792e-01f, - +1.6537233329850265e+00f, +1.8429927128987775e+00f, +1.5795688890212489e+00f, +1.5313117335176101e+00f, +1.4688051742099697e+00f, +1.3047757088193301e+00f, +9.3703047481911916e-01f, +6.6034404507297240e-01f, - +1.9642176175501569e+00f, +2.9388625018759811e+00f, +2.9051270203314714e+00f, +2.2145871562616142e+00f, +1.8151504726187455e+00f, +1.4766756664819134e+00f, +1.0710276243190799e+00f, +6.1861320930710639e-01f -}; - -const float sns_vq_cdk2[8*32] = { - -5.9829995937529679e-01f, -1.6330921039310822e+00f, -2.2069628561771211e+00f, -2.3101968732645872e+00f, -2.2987624447001700e+00f, -2.2585659584659474e+00f, -2.2426863949716420e+00f, -2.2717425510152180e+00f, - -1.4313340820994043e+00f, -1.7500847356351696e+00f, -1.7795938232358199e+00f, -1.7213803415353539e+00f, -1.6610776464291162e+00f, -1.6069804294990451e+00f, -1.5625217472935489e+00f, -1.5641247494491251e+00f, - -4.2712987825717169e-01f, -8.1657540705874065e-01f, -1.1438786300941690e+00f, -1.5047514473946468e+00f, -1.8039927073343207e+00f, -1.9709309014182719e+00f, -2.0721822202754367e+00f, -2.2015067008471854e+00f, - -8.8390021618372749e-01f, -9.1027146153915306e-01f, -8.4148501893353445e-01f, -7.0803242455046478e-01f, -4.0873435152568971e-01f, -5.8364530253510127e-02f, +1.5450950372912373e-01f, +2.3879767518520115e-01f, - +2.2959495262308716e-01f, -4.5380527270641730e-01f, -1.2610303555144773e+00f, -1.9593984147017431e+00f, -2.5055916891711632e+00f, -2.7888667896972388e+00f, -2.9113125863020777e+00f, -2.9748256948291001e+00f, - -1.1488842521346578e+00f, -1.3517692148186562e+00f, -1.3594824205078988e+00f, -1.2204819600745185e+00f, -9.1363085887906581e-01f, -6.8205390481915806e-01f, -5.8474638022763137e-01f, -6.3572794299637214e-01f, - -7.7093095554781843e-01f, -9.4474580908674310e-01f, -9.4836193194533303e-01f, -9.4516185118638463e-01f, -1.0483710354237581e+00f, -1.1355351751536940e+00f, -1.2428754319298756e+00f, -1.3831917119547590e+00f, - -9.3476137541952931e-01f, -7.0790164340965811e-01f, -3.3885900459516044e-01f, +8.2267549037198462e-02f, +4.8079994558165973e-01f, +8.0682939355530092e-01f, +1.0305358697421620e+00f, +1.0235050392855534e+00f, - +1.0095585388252226e+00f, -1.5967777106488176e-01f, -2.2123760679560007e+00f, -2.4162196770688293e+00f, -2.1066059048135193e+00f, -1.8818990363917070e+00f, -1.9958495939733885e+00f, -2.3481921543456847e+00f, - +9.2392277358713179e-02f, -1.8364442239470730e-01f, -5.9563356599054251e-01f, -1.0147004796192145e+00f, -1.3476180323301636e+00f, -1.5136187252106814e+00f, -1.5799100551406959e+00f, -1.7192022915180234e+00f, - -1.4222957040291027e-02f, -1.7371797028437352e-01f, -3.0805783645739226e-01f, -4.0484411256102021e-01f, -6.6432144720337050e-01f, -1.0344124279519349e+00f, -1.6814321622332238e+00f, -2.5032237993558693e+00f, - +6.8743182828212471e-02f, +3.3095426522069737e-01f, +5.0002819580392865e-01f, +5.6165737804402860e-01f, +5.0172311732338448e-01f, +3.6961533646464034e-01f, +8.5026798082935839e-02f, -3.9473330479310409e-01f, - +1.0356440140522545e+00f, +7.8065342952998484e-01f, +6.7193695552111687e-02f, -9.5261546302001587e-01f, -2.0142463788396388e+00f, -2.7767542927506610e+00f, -3.1928041080758338e+00f, -3.4042594311363201e+00f, - -6.6289350610256359e-01f, -6.3896764348680091e-01f, -5.1207254963552118e-01f, -3.6335660396488040e-01f, -2.8247932520862895e-01f, -3.1477486911353381e-01f, -4.4809778805307687e-01f, -6.9186118822875298e-01f, - +7.9969719144308171e-02f, +2.1588869900646174e-01f, +3.0323707912603959e-01f, +2.6884673422742911e-01f, +5.9642290590166340e-02f, -2.8613663980468629e-01f, -7.9406912376026706e-01f, -1.4470063450324298e+00f, - -2.0240948732059452e-01f, +2.3334712655850515e-01f, +5.7657451283939798e-01f, +7.9742677228839842e-01f, +9.3220814515190065e-01f, +1.0323450144255806e+00f, +1.0118085786908606e+00f, +7.9014188629614879e-01f, - -7.1530830084194669e-02f, -1.2396351139455990e+00f, -2.0842499795217195e+00f, -1.3035503744881123e+00f, -8.3471992091295932e-01f, -1.1295869482135590e+00f, -1.7132725973269993e+00f, -2.1802158117711343e+00f, - -1.7835942638423960e-01f, -7.1247931965515532e-01f, -1.5124017210947220e+00f, -1.9967695368388680e+00f, -1.8783401399959028e+00f, -1.4021324347049549e+00f, -1.0637376079630234e+00f, -1.1080152582418752e+00f, - +1.0480932547841233e+00f, +2.7493060468886921e-01f, -1.1919132498368252e+00f, -1.2523434724836580e+00f, -7.8936067946054767e-01f, -8.2091162445205956e-01f, -1.3128033132740213e+00f, -1.9655091841161074e+00f, - -3.3232308742031469e-01f, -2.2713591199678415e-01f, -1.4351679017954885e-01f, -1.9801985565791998e-02f, +1.0057467598256911e-01f, +2.2696827939185557e-01f, +3.0695375436198624e-01f, +2.2875897090753330e-01f, - +3.4676185796153502e-01f, -1.0768837168056489e-01f, -6.9753922421077807e-01f, -1.0937050061788010e+00f, -1.5428629138891437e+00f, -2.0449896355500123e+00f, -2.4848880613940572e+00f, -2.8583647439574880e+00f, - -1.2173513563721174e-02f, -3.2908222329502096e-01f, -7.4562386900667521e-01f, -1.0159346083066496e+00f, -9.9134754982937601e-01f, -8.0708475073517449e-01f, -5.9033001697337439e-01f, -5.3497643414524321e-01f, - -1.0362333131951586e-01f, -2.6988877087476748e-01f, -3.8890071054155473e-01f, -4.9037107401879965e-01f, -5.6504591412573135e-01f, -7.3336953439609320e-01f, -9.9258959592254403e-01f, -1.3661070412637724e+00f, - -7.9157092539986307e-01f, -3.3641122720876027e-01f, +2.9168895215304702e-01f, +1.0181013149521261e+00f, +1.5982627043961528e+00f, +1.9868228787387316e+00f, +2.1282934389276504e+00f, +1.9646952813708398e+00f, - +8.5453347281306224e-01f, +8.1178943134578940e-01f, -4.8818346255935796e-01f, -2.1067304958054955e+00f, -2.5063149014598722e+00f, -2.0640557329267200e+00f, -1.6543474135830516e+00f, -1.7651753795641250e+00f, - +6.2358146522917657e-01f, +5.4834889364422190e-01f, +1.7179524311839983e-01f, -3.5307730840525375e-01f, -7.7064726884538126e-01f, -1.0122724639555478e+00f, -1.1610381095678584e+00f, -1.4059777048358271e+00f, - +7.4374029892860283e-01f, +9.2218263151186131e-01f, +7.8921361199673412e-01f, +5.4697537641890215e-01f, +3.4695498575470718e-02f, -6.0728616781597766e-01f, -1.5817464846714542e+00f, -2.9492076413515940e+00f, - +1.0792513778563164e+00f, +1.4361817236342909e+00f, +1.4897259644477068e+00f, +1.4980968655148907e+00f, +1.3061906859741226e+00f, +9.2722643966101292e-01f, +4.6901200392574449e-01f, -8.4108696494310742e-02f, - +8.5358364275519205e-01f, +6.0645747733831856e-01f, +2.0465300574744516e-01f, -3.7181339249044437e-01f, -1.0727735914037746e+00f, -1.6784774674483536e+00f, -2.1020318554063260e+00f, -2.5024013237162377e+00f, - +1.2794365477031622e-01f, +1.2747703630869173e-01f, -4.1758739312140455e-02f, -2.4311752788462185e-01f, -3.1778646043737568e-01f, -2.8915217065224763e-01f, -2.9094454849599488e-01f, -4.4820832489443191e-01f, - +1.2951853228518271e+00f, +9.5620359941142952e-01f, +5.3144852217798388e-01f, +2.1179514725221937e-01f, -6.5987484250824083e-02f, -3.2087563737255587e-01f, -5.4468525409236357e-01f, -8.8065574221328113e-01f, - -1.0568174530545921e-02f, +8.7151888563731761e-01f, +1.5660992592896033e+00f, +1.9198797896705255e+00f, +2.0755726094083351e+00f, +2.1798356493630360e+00f, +2.0711596722334082e+00f, +1.7022476043512389e+00f -}; -#endif const float tcx_mdct_window_48[420] = { diff --git a/lib_com/rom_com.h b/lib_com/rom_com.h index 0d0f319e1df667cd86b34a47282db7ee282357ce..e6284ab417d0b2ef4a0704e8ef60dbdc45e968c2 100644 --- a/lib_com/rom_com.h +++ b/lib_com/rom_com.h @@ -1341,11 +1341,6 @@ extern const Word16 invTable[INV_TABLE_SIZE + 1]; extern const Word16 sqrtTable[SQRT_TABLE_SIZE + 1]; extern const Word16 invSqrtTable[SQRT_TABLE_SIZE + 1]; -#ifndef FIX_445_SNS_BUGFIXES -extern const float sns_vq_cdk1[8 * 32]; -extern const float sns_vq_cdk2[8 * 32]; - -#endif extern const float tcx_mdct_window_48[420]; extern const float tcx_mdct_window_half_48[180]; extern const float tcx_mdct_window_trans_48[60]; diff --git a/lib_com/tools.c b/lib_com/tools.c index b730564580e892b85eee18f9a391e4540e3ac555..ab688adbb9f77cfc81f361399a4bedd55486d7a7 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -561,9 +561,7 @@ int16_t maximum_s( { if ( vec[i] > tmp ) { -#ifdef FIX_427_MAXIMUM_S_INDEX ind = i; -#endif tmp = vec[i]; } } diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index f7b7465028a3f9a29da82a35dd02fa27be3c8500..0c073cb9fd6bb09fb77333686caef14e5bc9b08d 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -75,10 +75,8 @@ ivas_error acelp_core_dec( const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ const int16_t nchan_out, /* i : number of output channels */ STEREO_CNG_DEC_HANDLE hStereoCng /* i : stereo CNG handle */ -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT , const int16_t read_sid_info /* i : read SID info flag */ -#endif ) { float old_exc[L_EXC_DEC], *exc; /* excitation signal buffer */ @@ -514,11 +512,7 @@ ivas_error acelp_core_dec( } else { -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( st->core_brate == SID_2k40 && st->element_mode != IVAS_CPE_MDCT ) -#else - if ( st->core_brate == SID_2k40 && st->element_mode != IVAS_CPE_MDCT && st->read_sid_info ) -#endif { FdCng_decodeSID( st ); *sid_bw = 0; @@ -535,12 +529,7 @@ ivas_error acelp_core_dec( ApplyFdCng( syn, NULL, realBuffer, imagBuffer, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); } -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( !read_sid_info ) -#else - if ( !st->read_sid_info ) - // if (!st->read_sid_info && st->cng_ism_flag) /* read_sid_info can only be 0 in ParamISM mode */ -#endif { float noise_lvl_highest; diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index 8ea2d71159fd155c3219b3e6ed165ed887d736cb..fcc1a5ec521f74564435923ae098780dd65e02b4 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -261,11 +261,7 @@ ivas_error evs_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 7f8eba27c0e5a7f9dd7ff5f953e1818e7e3b5de0..23fd63059c6057f72ac4fb2b9c73110f3cd7091e 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -158,13 +158,8 @@ void initFdCngDec( hFdCngDec->cna_ILD_LT = 0.0f; hFdCngDec->first_cna_noise_updated = 0; hFdCngDec->first_cna_noise_update_cnt = 0; -#ifdef FIX_I414_OOA_CNA hFdCngDec->cna_nbands = CNA_INIT_NBANDS; mvs2s( cna_init_bands, hFdCngDec->cna_band_limits, CNA_INIT_NBANDS + 1 ); -#else - hFdCngDec->cna_nbands = 6; - mvs2s( cna_init_bands, hFdCngDec->cna_band_limits, MAX_CNA_NBANDS + 1 ); -#endif hFdCngDec->cna_act_fact = 1.0f; hFdCngDec->cna_rescale_fact = 0.0f; hFdCngDec->cna_seed = 5687; diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 173623db6589f4e672d76673014d0ce540229fe6..c9997f5782eade42665d738f97eaf86edda80139 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -702,11 +702,7 @@ ivas_error init_decoder( * FD-CNG decoder *-----------------------------------------------------------------*/ -#ifdef MC_PARAMUPMIX_MODE if ( ( st->element_mode == IVAS_CPE_MDCT || idchan == 0 ) && mc_mode != MC_MODE_MCT && mc_mode != MC_MODE_PARAMUPMIX ) -#else - if ( ( st->element_mode == IVAS_CPE_MDCT || idchan == 0 ) && mc_mode != MC_MODE_MCT ) -#endif { /* Create FD_CNG instance */ if ( ( error = createFdCngDec( &st->hFdCngDec ) ) != IVAS_ERR_OK ) @@ -736,9 +732,6 @@ ivas_error init_decoder( st->cna_dirac_flag = 0; st->cng_sba_flag = 0; st->cng_ism_flag = 0; -#ifndef FIX_ISM_DTX_CNG_BWIDTH_ALT - st->read_sid_info = 1; /* by default read the sid info from bitstream */ -#endif st->is_ism_format = 0; diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index bfe0a4bb533681ebb76b93d73f03380014b20f97..d64e5d1cb57449d6cecb544fa8624d282ad5451e 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -433,7 +433,6 @@ static ivas_error ivas_binaural_hrtf_open( * *-------------------------------------------------------------------------*/ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS static void ivas_binaural_obtain_DMX( const int16_t numTimeSlots, BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ @@ -441,15 +440,6 @@ static void ivas_binaural_obtain_DMX( float ImagBuffer[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Contains the LS signals */ float realDMX[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float imagDMX[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] ) -#else -static void ivas_binaural_obtain_DMX( - const int16_t numTimeSlots, - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ - float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : Contains the LS signals */ - float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : Contains the LS signals */ - float realDMX[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float imagDMX[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) -#endif { int16_t chIdx, bandIdx, k; @@ -1183,17 +1173,10 @@ void ivas_binRenderer( /* Obtain the binaural dmx and compute the reverb */ if ( hBinRenderer->hReverb != NULL ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS float reverbRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float inRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float inIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#else - float reverbRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float reverbIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float inRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float inIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#endif ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm ); for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) @@ -1205,15 +1188,11 @@ void ivas_binRenderer( } } -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS ivas_binaural_reverb_processSubframe( hBinRenderer->hReverb, BINAURAL_CHANNELS, numTimeSlots, inRe, inIm, reverbRe, reverbIm ); #else ivas_binaural_reverb_processSubframe( hBinRenderer->hReverb, BINAURAL_CHANNELS, inRe, inIm, reverbRe, reverbIm ); #endif -#else - ivas_binaural_reverb_processFrame( hBinRenderer->hReverb, BINAURAL_CHANNELS, inRe, inIm, reverbRe, reverbIm, 0u ); -#endif /* Add the conv module and reverb module output */ for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 516e027f90db764e863ccec371bbb212e532b0c2..9d6211bf8f56e6508b593c3a41feb509c85a6465 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -90,9 +90,7 @@ ivas_error ivas_core_dec( int16_t use_cldfb_for_dft; float *p_output_mem; int16_t flag_sec_CNA; -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT int16_t read_sid_info; -#endif int16_t last_element_mode; int16_t nchan_out; float *save_hb_synth; @@ -108,9 +106,7 @@ ivas_error ivas_core_dec( use_cldfb_for_dft = 0; tdm_LRTD_flag = -1; -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT read_sid_info = 1; /* read SID by default */ -#endif if ( hSCE != NULL ) { @@ -122,7 +118,6 @@ ivas_error ivas_core_dec( hStereoTD = NULL; p_output_mem = NULL; nchan_out = 1; -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( st_ivas != NULL && st_ivas->ivas_format == ISM_FORMAT ) { if ( st_ivas->hISMDTX.sce_id_dtx != hSCE->sce_id ) @@ -130,7 +125,6 @@ ivas_error ivas_core_dec( read_sid_info = 0; } } -#endif } else { @@ -347,11 +341,7 @@ ivas_error ivas_core_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 0af1699564180f2878a152d52d20f2829c56c816..7069e7d08f802323211d6f43aae28406273d84b3 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -64,9 +64,7 @@ ivas_error ivas_dec( int16_t nb_bits_metadata[MAX_SCE]; int32_t output_Fs, ivas_total_brate; AUDIO_CONFIG output_config; -#ifdef NON_DIEGETIC_PAN float pan_left, pan_right; -#endif ivas_error error; #ifdef JBM_TSM_ON_TCS float *p_output[MAX_OUTPUT_CHANNELS]; @@ -152,17 +150,9 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_MC ) { #ifdef JBM_TSM_ON_TCS -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); #else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif -#else -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, output ); -#else - ivas_ls_setup_conversion( st_ivas, output_frame, output ); -#endif #endif } } @@ -216,7 +206,6 @@ ivas_error ivas_dec( { ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); } -#ifdef NON_DIEGETIC_PAN else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; @@ -224,7 +213,6 @@ ivas_error ivas_dec( v_multc( output[0], pan_right, output[1], output_frame ); v_multc( output[0], pan_left, output[0], output_frame ); } -#endif else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { ivas_param_ism_dec( st_ivas, output ); @@ -247,7 +235,6 @@ ivas_error ivas_dec( { ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); } -#ifdef NON_DIEGETIC_PAN else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; @@ -255,7 +242,6 @@ ivas_error ivas_dec( v_multc( output[0], pan_right, output[1], output_frame ); v_multc( output[0], pan_left, output[0], output_frame ); } -#endif else if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ @@ -265,14 +251,10 @@ ivas_error ivas_dec( ivas_ism_render( st_ivas, output, output_frame ); #endif } -#ifdef REND_DEBUGGING_REVISION #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) #else else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) -#endif -#else - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) #endif { /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ @@ -343,9 +325,7 @@ ivas_error ivas_dec( if ( st_ivas->ivas_format == SBA_FORMAT ) { ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, -#ifdef HODIRAC ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ), -#endif 0 ); } else @@ -363,9 +343,7 @@ ivas_error ivas_dec( st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, -#ifdef HODIRAC ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ), -#endif st_ivas->hSpar->dirac_to_spar_md_bands ); } @@ -433,12 +411,8 @@ ivas_error ivas_dec( ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, output ); } - ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi -#ifdef HODIRAC - , - ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate ) -#endif - ); + ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, + ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); } ivas_sba_dirac_stereo_dec( st_ivas, output, output_frame, st_ivas->ivas_format == MC_FORMAT ); @@ -477,7 +451,6 @@ ivas_error ivas_dec( } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { -#ifdef FIX_441_SBA_PARAMBIN_GAINS float gain; if ( nchan_remapped == 1 ) @@ -488,9 +461,6 @@ ivas_error ivas_dec( { gain = 1.3657f; } -#else - float gain = 0.8414f; /* Todo: Temporary gain for roughly matching the loudness. To be tuned later together with other outputs. */ -#endif for ( n = 0; n < nchan_remapped; n++ ) { @@ -596,17 +566,9 @@ ivas_error ivas_dec( else if ( st_ivas->renderer_type == RENDERER_MC ) { #ifdef JBM_TSM_ON_TCS -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); #else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif -#else -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, output ); -#else - ivas_ls_setup_conversion( st_ivas, output_frame, output ); -#endif #endif } else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) @@ -634,7 +596,6 @@ ivas_error ivas_dec( #endif } } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); @@ -729,7 +690,6 @@ ivas_error ivas_dec( #endif } } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { /* read Parametric MC parameters from the bitstream */ @@ -760,18 +720,9 @@ ivas_error ivas_dec( if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) { #ifdef JBM_TSM_ON_TCS -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); #else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif -#else -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, output ); -#else - - ivas_ls_setup_conversion( st_ivas, output_frame, output ); -#endif #endif } else diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 2801c9c14670057508a905b4e56782277c9c887a..d69d323c9bf9838afb36601f452b1c2efb965d04 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -51,12 +51,7 @@ * Local function prototypes *-----------------------------------------------------------------------*/ -static ivas_error ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, const RENDERER_TYPE renderer_type, DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem -#ifdef HODIRAC - , - const int16_t hodirac_flag -#endif -); +static ivas_error ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, const RENDERER_TYPE renderer_type, DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem, const int16_t hodirac_flag ); static void ivas_dirac_free_mem( DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem ); @@ -70,12 +65,7 @@ static void protoSignalComputation1( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRA static void protoSignalComputation2( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float *proto_frame_f, float *proto_direct_buffer_f, float *reference_power, float *proto_power_smooth, const int16_t isloudspeaker, const int16_t slot_index, const int16_t num_freq_bands, MASA_STEREO_TYPE_DETECT *stereo_type_detect ); -static void protoSignalComputation4( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float *proto_frame_f, float *proto_direct_buffer_f, float *reference_power, float *proto_power_smooth, const int16_t slot_index, const int16_t num_outputs_diff, const int16_t num_freq_bands, const float *mtx_hoa_decoder, const int16_t nchan_transport -#ifdef HODIRAC - , - const int16_t *sba_map_tc_ind -#endif -); +static void protoSignalComputation4( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float *proto_frame_f, float *proto_direct_buffer_f, float *reference_power, float *proto_power_smooth, const int16_t slot_index, const int16_t num_outputs_diff, const int16_t num_freq_bands, const float *mtx_hoa_decoder, const int16_t nchan_transport, const int16_t *sba_map_tc_ind ); static void ivas_dirac_dec_compute_diffuse_proto( DIRAC_DEC_HANDLE hDirAC, const int16_t slot_idx ); @@ -113,7 +103,6 @@ ivas_error ivas_dirac_dec_open( } -#ifdef DIRAC_ALLOC_HARM /*------------------------------------------------------------------------- * ivas_dirac_allocate_parameters() * @@ -250,7 +239,6 @@ ivas_error ivas_dirac_allocate_parameters( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- @@ -280,9 +268,7 @@ ivas_error ivas_dirac_dec_config( int32_t output_Fs, ivas_total_brate; ivas_error error; int16_t nchan_transport_orig; -#ifdef HODIRAC int16_t hodirac_flag; -#endif DIRAC_CONFIG_FLAG flag_config; flag_config = ( flag_config_inp == DIRAC_RECONFIGURE_MODE ) ? DIRAC_RECONFIGURE : flag_config_inp; @@ -291,9 +277,7 @@ ivas_error ivas_dirac_dec_config( hDirAC = NULL; output_Fs = st_ivas->hDecoderConfig->output_Fs; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifdef HODIRAC hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); -#endif if ( flag_config == DIRAC_RECONFIGURE ) @@ -332,12 +316,8 @@ ivas_error ivas_dirac_dec_config( nchan_transport_orig = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && !( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { - st_ivas->nchan_transport = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + st_ivas->nchan_transport = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); } nchan_transport = st_ivas->nchan_transport; @@ -429,98 +409,23 @@ ivas_error ivas_dirac_dec_config( #endif } -#ifdef HODIRAC if ( st_ivas->ivas_format == SBA_FORMAT && flag_config == DIRAC_RECONFIGURE && ( ( ivas_total_brate > IVAS_256k && st_ivas->hDecoderConfig->last_ivas_total_brate <= IVAS_256k ) || ( ivas_total_brate <= IVAS_256k && st_ivas->hDecoderConfig->last_ivas_total_brate > IVAS_256k ) ) ) { if ( st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k && hDirAC->azimuth2 == NULL ) { -#ifdef DIRAC_ALLOC_HARM if ( ( error = ivas_dirac_allocate_parameters( hDirAC, 2 ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( hDirAC->azimuth2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->elevation2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->energy_ratio2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->spreadCoherence2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( ( hDirAC->azimuth2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->azimuth2[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->elevation2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->elevation2[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->energy_ratio2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->energy_ratio2[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->spreadCoherence2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->spreadCoherence2[i], 0.0f, hDirAC->num_freq_bands ); - } -#endif } else if ( st_ivas->hDecoderConfig->ivas_total_brate <= IVAS_256k && hDirAC->azimuth2 != NULL ) { -#ifdef DIRAC_ALLOC_HARM ivas_dirac_deallocate_parameters( hDirAC, 2 ); -#else - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - free( hDirAC->azimuth2[i] ); - free( hDirAC->elevation2[i] ); - free( hDirAC->energy_ratio2[i] ); - free( hDirAC->spreadCoherence2[i] ); - } - - free( hDirAC->azimuth2 ); - free( hDirAC->elevation2 ); - free( hDirAC->energy_ratio2 ); - free( hDirAC->spreadCoherence2 ); - - hDirAC->azimuth2 = NULL; - hDirAC->elevation2 = NULL; - hDirAC->energy_ratio2 = NULL; - hDirAC->spreadCoherence2 = NULL; -#endif } } -#endif /* band config needed only for SPAR with FOA output */ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA && st_ivas->sba_mode == SBA_MODE_SPAR -#ifdef HODIRAC - && !hodirac_flag -#endif - ) + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA && st_ivas->sba_mode == SBA_MODE_SPAR && !hodirac_flag ) { return IVAS_ERR_OK; } @@ -681,7 +586,6 @@ ivas_error ivas_dirac_dec_config( } set_s( hDirAC->proto_index_diff, 0, hDirAC->num_outputs_diff ); -#ifdef HODIRAC hDirAC->sba_map_tc = sba_map_tc; if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) { @@ -690,7 +594,6 @@ ivas_error ivas_dirac_dec_config( hDirAC->sba_map_tc = sba_map_tc_512; } } -#endif if ( nchan_transport == 1 ) { @@ -797,17 +700,10 @@ ivas_error ivas_dirac_dec_config( for ( k = 0; k < min( hDirAC->num_outputs_dir, hDirAC->num_protos_dir ); k++ ) { -#ifdef HODIRAC if ( hDirAC->sba_map_tc[k] < hDirAC->num_outputs_dir ) { hDirAC->proto_index_dir[hDirAC->sba_map_tc[k]] = k; } -#else - if ( sba_map_tc[k] < hDirAC->num_outputs_dir ) - { - hDirAC->proto_index_dir[sba_map_tc[k]] = k; - } -#endif } } } @@ -983,12 +879,8 @@ ivas_error ivas_dirac_dec_config( /* output synthesis */ if ( flag_config == DIRAC_OPEN ) { - if ( ( ivas_dirac_dec_output_synthesis_open( hDirAC, st_ivas->renderer_type, nchan_transport, output_Fs -#ifdef HODIRAC - , - hodirac_flag -#endif - ) ) != IVAS_ERR_OK ) + if ( ( ivas_dirac_dec_output_synthesis_open( hDirAC, st_ivas->renderer_type, nchan_transport, output_Fs, + hodirac_flag ) ) != IVAS_ERR_OK ) { return error; } @@ -998,12 +890,8 @@ ivas_error ivas_dirac_dec_config( { ivas_dirac_dec_output_synthesis_close( hDirAC ); - if ( ( ivas_dirac_dec_output_synthesis_open( hDirAC, st_ivas->renderer_type, nchan_transport, output_Fs -#ifdef HODIRAC - , - hodirac_flag -#endif - ) ) != IVAS_ERR_OK ) + if ( ( ivas_dirac_dec_output_synthesis_open( hDirAC, st_ivas->renderer_type, nchan_transport, output_Fs, + hodirac_flag ) ) != IVAS_ERR_OK ) { return error; } @@ -1097,24 +985,16 @@ ivas_error ivas_dirac_dec_config( } /* output synthesis */ - ivas_dirac_dec_output_synthesis_init( hDirAC, nchan_out_woLFE -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + ivas_dirac_dec_output_synthesis_init( hDirAC, nchan_out_woLFE, + hodirac_flag ); /* Allocate stack memory */ if ( flag_config != DIRAC_OPEN ) { ivas_dirac_free_mem( &( hDirAC->stack_mem ) ); } - if ( ( error = ivas_dirac_alloc_mem( hDirAC, st_ivas->renderer_type, &( hDirAC->stack_mem ) -#ifdef HODIRAC - , - hodirac_flag -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_alloc_mem( hDirAC, st_ivas->renderer_type, &( hDirAC->stack_mem ), + hodirac_flag ) ) != IVAS_ERR_OK ) { return error; } @@ -1127,9 +1007,7 @@ ivas_error ivas_dirac_dec_config( hDirAC->dirac_bs_md_write_idx = 0; hDirAC->dirac_read_idx = 0; hDirAC->spar_to_dirac_write_idx = 0; -#ifdef FIX_391_SBA hDirAC->hConfig->dec_param_estim_old = hDirAC->hConfig->dec_param_estim; -#endif if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; @@ -1192,141 +1070,17 @@ ivas_error ivas_dirac_dec_config( #endif } -#ifdef DIRAC_ALLOC_HARM if ( ( error = ivas_dirac_allocate_parameters( hDirAC, 1 ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( hDirAC->azimuth = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - if ( ( hDirAC->elevation = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) + if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k ) ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->diffuseness_vector = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->energy_ratio1 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->spreadCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->surroundingCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( ( hDirAC->azimuth[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->azimuth[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->elevation[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->elevation[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->diffuseness_vector[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->diffuseness_vector[i], 1.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->energy_ratio1[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->energy_ratio1[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->spreadCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->spreadCoherence[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->surroundingCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->surroundingCoherence[i], 0.0f, hDirAC->num_freq_bands ); - } -#endif - - if ( st_ivas->ivas_format == MASA_FORMAT -#ifdef HODIRAC - || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k ) -#endif - ) - { -#ifdef DIRAC_ALLOC_HARM if ( ( error = ivas_dirac_allocate_parameters( hDirAC, 2 ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( hDirAC->azimuth2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->elevation2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->energy_ratio2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->spreadCoherence2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( ( hDirAC->azimuth2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->azimuth2[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->elevation2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->elevation2[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->energy_ratio2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->energy_ratio2[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->spreadCoherence2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->spreadCoherence2[i], 0.0f, hDirAC->num_freq_bands ); - } -#endif } else { @@ -1341,7 +1095,6 @@ ivas_error ivas_dirac_dec_config( hDirAC->dithering_seed = DIRAC_DITH_SEED; st_ivas->hDirAC = hDirAC; } -#ifdef FIX_391_SBA else if ( hDirAC->hConfig->dec_param_estim_old != hDirAC->hConfig->dec_param_estim ) { int16_t num_slots_in_subfr; @@ -1350,73 +1103,7 @@ ivas_error ivas_dirac_dec_config( { if ( ( hDirAC->hConfig->dec_param_estim_old != hDirAC->hConfig->dec_param_estim ) ) { -#ifdef DIRAC_ALLOC_HARM ivas_dirac_deallocate_parameters( hDirAC, 1 ); -#else - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->azimuth[i] != NULL ) - { - free( hDirAC->azimuth[i] ); - hDirAC->azimuth[i] = NULL; - } - if ( hDirAC->elevation[i] != NULL ) - { - free( hDirAC->elevation[i] ); - hDirAC->elevation[i] = NULL; - } - if ( hDirAC->diffuseness_vector[i] != NULL ) - { - free( hDirAC->diffuseness_vector[i] ); - hDirAC->diffuseness_vector[i] = NULL; - } - if ( hDirAC->energy_ratio1[i] != NULL ) - { - free( hDirAC->energy_ratio1[i] ); - hDirAC->energy_ratio1[i] = NULL; - } - if ( hDirAC->spreadCoherence[i] != NULL ) - { - free( hDirAC->spreadCoherence[i] ); - hDirAC->spreadCoherence[i] = NULL; - } - if ( hDirAC->surroundingCoherence[i] != NULL ) - { - free( hDirAC->surroundingCoherence[i] ); - hDirAC->surroundingCoherence[i] = NULL; - } - } - if ( hDirAC->azimuth != NULL ) - { - free( hDirAC->azimuth ); - hDirAC->azimuth = NULL; - } - if ( hDirAC->elevation != NULL ) - { - free( hDirAC->elevation ); - hDirAC->elevation = NULL; - } - if ( hDirAC->diffuseness_vector != NULL ) - { - free( hDirAC->diffuseness_vector ); - hDirAC->diffuseness_vector = NULL; - } - if ( hDirAC->energy_ratio1 != NULL ) - { - free( hDirAC->energy_ratio1 ); - hDirAC->energy_ratio1 = NULL; - } - if ( hDirAC->spreadCoherence != NULL ) - { - free( hDirAC->spreadCoherence ); - hDirAC->spreadCoherence = NULL; - } - if ( hDirAC->surroundingCoherence != NULL ) - { - free( hDirAC->surroundingCoherence ); - hDirAC->surroundingCoherence = NULL; - } -#endif } hDirAC->dirac_md_buffer_length = ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_DIRAC_PARAM_DEC_SFR ) * num_slots_in_subfr; hDirAC->dirac_bs_md_write_idx = DELAY_DIRAC_PARAM_DEC_SFR * num_slots_in_subfr; @@ -1424,83 +1111,12 @@ ivas_error ivas_dirac_dec_config( hDirAC->dirac_read_idx = 0; hDirAC->dirac_estimator_idx = 0; -#ifdef DIRAC_ALLOC_HARM if ( ( error = ivas_dirac_allocate_parameters( hDirAC, 1 ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( hDirAC->azimuth = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->elevation = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->diffuseness_vector = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->energy_ratio1 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->spreadCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - - if ( ( hDirAC->surroundingCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( ( hDirAC->azimuth[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->azimuth[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->elevation[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_s( hDirAC->elevation[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->diffuseness_vector[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->diffuseness_vector[i], 1.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->energy_ratio1[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->energy_ratio1[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->spreadCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->spreadCoherence[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->surroundingCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } - set_f( hDirAC->surroundingCoherence[i], 0.0f, hDirAC->num_freq_bands ); - } -#endif } } -#endif #ifdef JBM_TSM_ON_TCS /* allocate transport channels*/ if ( flag_config == DIRAC_OPEN ) @@ -1631,143 +1247,8 @@ void ivas_dirac_dec_close( hDirAC->buffer_energy = NULL; } -#ifdef DIRAC_ALLOC_HARM ivas_dirac_deallocate_parameters( hDirAC, 1 ); ivas_dirac_deallocate_parameters( hDirAC, 2 ); -#else - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->azimuth[i] != NULL ) - { - free( hDirAC->azimuth[i] ); - hDirAC->azimuth[i] = NULL; - } - - if ( hDirAC->elevation[i] != NULL ) - { - free( hDirAC->elevation[i] ); - hDirAC->elevation[i] = NULL; - } - if ( hDirAC->diffuseness_vector[i] != NULL ) - { - free( hDirAC->diffuseness_vector[i] ); - hDirAC->diffuseness_vector[i] = NULL; - } - } - if ( hDirAC->azimuth != NULL ) - { - free( hDirAC->azimuth ); - hDirAC->azimuth = NULL; - } - if ( hDirAC->elevation != NULL ) - { - free( hDirAC->elevation ); - hDirAC->elevation = NULL; - } - if ( hDirAC->diffuseness_vector != NULL ) - { - free( hDirAC->diffuseness_vector ); - hDirAC->diffuseness_vector = NULL; - } - - if ( hDirAC->azimuth2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->azimuth2[i] != NULL ) - { - free( hDirAC->azimuth2[i] ); - hDirAC->azimuth2[i] = NULL; - } - } - free( hDirAC->azimuth2 ); - hDirAC->azimuth2 = NULL; - } - - if ( hDirAC->elevation2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->elevation2[i] != NULL ) - { - free( hDirAC->elevation2[i] ); - hDirAC->elevation2[i] = NULL; - } - } - free( hDirAC->elevation2 ); - hDirAC->elevation2 = NULL; - } - - if ( hDirAC->energy_ratio1 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->energy_ratio1[i] != NULL ) - { - free( hDirAC->energy_ratio1[i] ); - hDirAC->energy_ratio1[i] = NULL; - } - } - free( hDirAC->energy_ratio1 ); - hDirAC->energy_ratio1 = NULL; - } - - if ( hDirAC->energy_ratio2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->energy_ratio2[i] != NULL ) - { - free( hDirAC->energy_ratio2[i] ); - hDirAC->energy_ratio2[i] = NULL; - } - } - free( hDirAC->energy_ratio2 ); - hDirAC->energy_ratio2 = NULL; - } - - if ( hDirAC->spreadCoherence != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->spreadCoherence[i] != NULL ) - { - free( hDirAC->spreadCoherence[i] ); - hDirAC->spreadCoherence[i] = NULL; - } - } - free( hDirAC->spreadCoherence ); - hDirAC->spreadCoherence = NULL; - } - - if ( hDirAC->spreadCoherence2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->spreadCoherence2[i] != NULL ) - { - free( hDirAC->spreadCoherence2[i] ); - hDirAC->spreadCoherence2[i] = NULL; - } - } - free( hDirAC->spreadCoherence2 ); - hDirAC->spreadCoherence2 = NULL; - } - - if ( hDirAC->surroundingCoherence != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->surroundingCoherence[i] != NULL ) - { - free( hDirAC->surroundingCoherence[i] ); - hDirAC->surroundingCoherence[i] = NULL; - } - } - free( hDirAC->surroundingCoherence ); - hDirAC->surroundingCoherence = NULL; - } -#endif if ( hDirAC->masa_stereo_type_detect != NULL ) { @@ -1784,7 +1265,6 @@ void ivas_dirac_dec_close( } -#ifdef DIRAC_ALLOC_HARM /*------------------------------------------------------------------------- * ivas_dirac_deallocate_parameters() * @@ -1948,7 +1428,6 @@ void ivas_dirac_deallocate_parameters( return; } -#endif /*------------------------------------------------------------------------- @@ -1960,18 +1439,12 @@ void ivas_dirac_deallocate_parameters( static ivas_error ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, const RENDERER_TYPE renderer_type, - DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem -#ifdef HODIRAC - , - const int16_t hodirac_flag -#endif -) + DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem, + const int16_t hodirac_flag ) { int16_t num_freq_bands, num_freq_bands_diff, size; -#ifdef HODIRAC int16_t size_ho; int16_t size_pf; -#endif int16_t num_outputs_dir, num_outputs_diff; int16_t num_protos_dir; @@ -1984,7 +1457,6 @@ static ivas_error ivas_dirac_alloc_mem( num_outputs_diff = hDirAC->num_outputs_diff; size = num_freq_bands * num_outputs_dir; -#ifdef HODIRAC if ( hodirac_flag ) { size_ho = size * DIRAC_HO_NUMSECTORS; @@ -1995,7 +1467,6 @@ static ivas_error ivas_dirac_alloc_mem( size_ho = size; size_pf = num_freq_bands; } -#endif /* PSD related buffers */ hDirAC_mem->cy_auto_dir_smooth = NULL; @@ -2042,11 +1513,7 @@ static ivas_error ivas_dirac_alloc_mem( hDirAC->h_output_synthesis_psd_state.direct_responses_square = hDirAC_mem->direct_responses_square; /* Target and smoothed nrg factors/gains */ -#ifdef HODIRAC if ( ( hDirAC_mem->cy_cross_dir_smooth = (float *) malloc( sizeof( float ) * size_ho ) ) == NULL ) -#else - if ( ( hDirAC_mem->cy_cross_dir_smooth = (float *) malloc( sizeof( float ) * size ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } @@ -2072,11 +1539,7 @@ static ivas_error ivas_dirac_alloc_mem( hDirAC->h_output_synthesis_psd_state.cy_auto_diff_smooth = hDirAC_mem->cy_auto_diff_smooth; /*Responses (gains/factors)*/ -#ifdef HODIRAC if ( ( hDirAC_mem->direct_responses = (float *) malloc( sizeof( float ) * size_ho ) ) == NULL ) -#else - if ( ( hDirAC_mem->direct_responses = (float *) malloc( sizeof( float ) * size ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } @@ -2122,19 +1585,11 @@ static ivas_error ivas_dirac_alloc_mem( if ( renderer_type != RENDERER_BINAURAL_PARAMETRIC && renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#ifdef HODIRAC if ( ( hDirAC_mem->direct_power_factor = (float *) malloc( sizeof( float ) * size_pf ) ) == NULL ) -#else - if ( ( hDirAC_mem->direct_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } -#ifdef HODIRAC if ( ( hDirAC_mem->diffuse_power_factor = (float *) malloc( sizeof( float ) * size_pf ) ) == NULL ) -#else - if ( ( hDirAC_mem->diffuse_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } @@ -2262,10 +1717,8 @@ void ivas_dirac_dec_read_BS( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata */ int16_t *nb_bits, /* o : number of bits read */ const SBA_MODE sba_mode, /* i : SBA mode */ -#ifdef HODIRAC - const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#endif - int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ + 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; @@ -2359,12 +1812,8 @@ void ivas_dirac_dec_read_BS( hQMetaData->q_direction[0].cfg.nblocks = MAX_PARAM_SPATIAL_SUBFRAMES; } - *nb_bits += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ) -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + *nb_bits += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), + hodirac_flag ); } #ifdef DEBUGGING @@ -2431,12 +1880,8 @@ void ivas_dirac_dec_read_BS( if ( hDirAC != NULL ) { - ivas_qmetadata_to_dirac( hQMetaData, hDirAC, NULL, ivas_total_brate, sba_mode -#ifdef HODIRAC - , - hodirac_flag -#endif - , + ivas_qmetadata_to_dirac( hQMetaData, hDirAC, NULL, ivas_total_brate, sba_mode, + hodirac_flag, dirac_to_spar_md_bands ); } @@ -2456,10 +1901,8 @@ void ivas_qmetadata_to_dirac( MASA_DECODER_HANDLE hMasa, /* i : MASA decoder structure */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const SBA_MODE sba_mode, /* i : SBA mode */ -#ifdef HODIRAC - const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#endif - int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ + 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 block, band; @@ -2475,10 +1918,8 @@ void ivas_qmetadata_to_dirac( int16_t nbands = 0; int16_t nblocks = 0; int16_t qBand_idx; -#ifdef HODIRAC int16_t idx_sec = 0; int16_t no_secs = 1; -#endif q_direction = &( hQMetaData->q_direction[0] ); hDirAC->numSimultaneousDirections = hQMetaData->no_directions; @@ -2568,9 +2009,7 @@ void ivas_qmetadata_to_dirac( int16_t num_slots_in_subfr; int16_t tmp_write_idx_param_band; int16_t tmp_write_idx_band; -#ifdef HODIRAC float diffuseness_sec = 0.f; -#endif num_slots_in_subfr = hDirAC->hConfig->dec_param_estim ? CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES : 1; @@ -2590,9 +2029,6 @@ void ivas_qmetadata_to_dirac( } else { -#ifndef HODIRAC - assert( ( hQMetaData->no_directions == 1 ) && "Only 1 direction supported in SBA mode!" ); -#endif start_band = hDirAC->hConfig->enc_param_start_band; if ( sba_mode == SBA_MODE_SPAR ) @@ -2671,14 +2107,12 @@ void ivas_qmetadata_to_dirac( } /* Bands with spatial data transmitted */ -#ifdef HODIRAC if ( hodirac_flag ) { no_secs = DIRAC_HO_NUMSECTORS; } for ( idx_sec = 0; idx_sec < no_secs; idx_sec++ ) -#endif { for ( band = start_band; band < nbands; band++ ) { @@ -2714,19 +2148,11 @@ void ivas_qmetadata_to_dirac( block_qmetadata = min( block, nblocks - 1 ); block_qmetadata = max( block_qmetadata, 0 ); -#ifdef HODIRAC if ( q_direction[idx_sec].band_data[qBand_idx].azimuth[block_qmetadata] < 0.f ) { q_direction[idx_sec].band_data[qBand_idx].azimuth[block_qmetadata] += 360.f; } -#else - if ( q_direction->band_data[qBand_idx].azimuth[block_qmetadata] < 0.f ) - { - q_direction->band_data[qBand_idx].azimuth[block_qmetadata] += 360.f; - } -#endif -#ifdef HODIRAC if ( hMasa == NULL && hodirac_flag ) { azimuth = q_direction[idx_sec].band_data[qBand_idx].azimuth[block_qmetadata]; @@ -2736,7 +2162,6 @@ void ivas_qmetadata_to_dirac( assert( diffuseness_sec < 1.0001f && diffuseness_sec > -0.0001f ); } else -#endif { azimuth = q_direction->band_data[qBand_idx].azimuth[block_qmetadata]; elevation = q_direction->band_data[qBand_idx].elevation[block_qmetadata]; @@ -2746,14 +2171,12 @@ void ivas_qmetadata_to_dirac( { tmp_write_idx_band = tmp_write_idx_param_band; -#ifdef HODIRAC if ( hodirac_flag ) { azi = (int16_t) ( azimuth + 0.5f ); ele = (int16_t) ( elevation + 0.5f ); } else -#endif { azi = (int16_t) ( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); ele = (int16_t) ( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); @@ -2788,7 +2211,6 @@ void ivas_qmetadata_to_dirac( hDirAC->diffuseness_vector[tmp_write_idx_band][b] = diffuseness; -#ifdef HODIRAC if ( hodirac_flag ) { if ( idx_sec == 0 ) @@ -2806,7 +2228,6 @@ void ivas_qmetadata_to_dirac( } } else -#endif { hDirAC->elevation[tmp_write_idx_band][b] = ele; hDirAC->azimuth[tmp_write_idx_band][b] = azi; @@ -3119,9 +2540,7 @@ void ivas_dirac_dec_render_sf( int16_t sf1, sf2; #endif int16_t slot_idx, index_slot; -#ifdef HODIRAC int16_t hodirac_flag; -#endif float *p_Rmat; #ifdef JBM_TSM_ON_TCS int16_t slot_idx_start, slot_idx_start_cldfb_synth, md_idx; @@ -3162,9 +2581,7 @@ void ivas_dirac_dec_render_sf( onset_filter = DirAC_mem.onset_filter; onset_filter_subframe = DirAC_mem.onset_filter + hDirAC->num_freq_bands; -#ifdef HODIRAC hodirac_flag = ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ); -#endif if ( st_ivas->hQMetaData != NULL && st_ivas->sba_mode != SBA_MODE_SPAR ) { @@ -3406,12 +2823,8 @@ void ivas_dirac_dec_render_sf( #endif surCohRatio, st_ivas->hHeadTrackData->shd_rot_max_order, - p_Rmat -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + p_Rmat, + hodirac_flag ); } else { @@ -3425,12 +2838,8 @@ void ivas_dirac_dec_render_sf( #endif surCohRatio, 0, - NULL -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + NULL, + hodirac_flag ); } } @@ -3469,34 +2878,17 @@ void ivas_dirac_dec_render_sf( for ( ch = 0; ch < nchan_transport; ch++ ) { #ifdef JBM_TSM_ON_TCS -#ifdef HODIRAC cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[hDirAC->sba_map_tc[ch]][hDirAC->num_freq_bands * index_slot] ), Cldfb_RealBuffer[ch][0], Cldfb_ImagBuffer[ch][0], hDirAC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); #else - cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[sba_map_tc[ch]][hDirAC->num_freq_bands * index_slot] ), - Cldfb_RealBuffer[ch][0], - Cldfb_ImagBuffer[ch][0], - hDirAC->num_freq_bands, - st_ivas->cldfbAnaDec[ch] ); -#endif -#else -#ifdef HODIRAC cldfbAnalysis_ts( &( output_f[hDirAC->sba_map_tc[ch]][hDirAC->num_freq_bands * index_slot] ), Cldfb_RealBuffer[ch][0], Cldfb_ImagBuffer[ch][0], hDirAC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); -#else - cldfbAnalysis_ts( &( output_f[sba_map_tc[ch]][hDirAC->num_freq_bands * index_slot] ), - Cldfb_RealBuffer[ch][0], - Cldfb_ImagBuffer[ch][0], - hDirAC->num_freq_bands, - st_ivas->cldfbAnaDec[ch] ); - -#endif #endif } } @@ -3573,9 +2965,7 @@ void ivas_dirac_dec_render_sf( { switch ( nchan_transport ) { -#ifdef HODIRAC case 11: -#endif case 8: case 6: case 4: @@ -3587,12 +2977,8 @@ void ivas_dirac_dec_render_sf( slot_idx, hDirAC->num_outputs_diff, hDirAC->num_freq_bands, hDirAC->hoa_decoder, - nchan_transport -#ifdef HODIRAC - , - hDirAC->sba_map_tc -#endif - ); + nchan_transport, + hDirAC->sba_map_tc ); break; case 2: protoSignalComputation2( Cldfb_RealBuffer, Cldfb_ImagBuffer, @@ -3797,17 +3183,9 @@ void ivas_dirac_dec_render_sf( p_Rmat, st_ivas->hVBAPdata, hDirAC->hOutSetup, - nchan_transport -#ifndef HODIRAC - , - index_slot -#endif -#ifdef HODIRAC - , + nchan_transport, st_ivas->sba_analysis_order > 1 && - st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k -#endif - ); + st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k ); } else { @@ -3817,16 +3195,9 @@ void ivas_dirac_dec_render_sf( 0, st_ivas->hVBAPdata, hDirAC->hOutSetup, - nchan_transport -#ifndef HODIRAC - , - index_slot -#endif -#ifdef HODIRAC - , + nchan_transport, st_ivas->sba_analysis_order > 1 && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_256k -#endif ); } @@ -3845,9 +3216,7 @@ void ivas_dirac_dec_render_sf( hDirAC->hOutSetup, nchan_transport, md_idx, -#ifdef HODIRAC hodirac_flag -#endif ); } @@ -3865,10 +3234,7 @@ void ivas_dirac_dec_render_sf( hDirAC->hOutSetup, nchan_transport, md_idx, -#ifdef HODIRAC - hodirac_flag -#endif - ); + hodirac_flag ); } #endif @@ -3939,15 +3305,11 @@ void ivas_dirac_dec_render_sf( #ifdef JBM_TSM_ON_TCS hDirAC->subframe_nbslots[subframe_idx], #endif - p_onset_filter -#ifdef HODIRAC - , + p_onset_filter, #ifdef JBM_TSM_ON_TCS md_idx, #endif - hodirac_flag -#endif - ); + hodirac_flag ); } else { @@ -4899,12 +4261,8 @@ static void protoSignalComputation4( const int16_t num_outputs_diff, const int16_t num_freq_bands, const float *mtx_hoa_decoder, - const int16_t nchan_transport -#ifdef HODIRAC - , - const int16_t *sba_map_tc_ind -#endif -) + const int16_t nchan_transport, + const int16_t *sba_map_tc_ind ) { int16_t k, l; int16_t n; @@ -4930,13 +4288,8 @@ static void protoSignalComputation4( proto_frame_f[2 * l * num_freq_bands + 2 * k + 1] = 0.f; for ( n = 0; n < nchan_transport; n++ ) { -#ifdef HODIRAC proto_frame_f[2 * l * num_freq_bands + 2 * k] += RealBuffer[n][0][k] * mtx_hoa_decoder[l * 16 + sba_map_tc_ind[n]]; proto_frame_f[2 * l * num_freq_bands + 2 * k + 1] += ImagBuffer[n][0][k] * mtx_hoa_decoder[l * 16 + sba_map_tc_ind[n]]; -#else - proto_frame_f[2 * l * num_freq_bands + 2 * k] += RealBuffer[n][0][k] * mtx_hoa_decoder[l * 16 + sba_map_tc[n]]; - proto_frame_f[2 * l * num_freq_bands + 2 * k + 1] += ImagBuffer[n][0][k] * mtx_hoa_decoder[l * 16 + sba_map_tc[n]]; -#endif } } } diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c old mode 100755 new mode 100644 index f88b5f5f3ab0b8bc463a9e479d5d583fc0e82567..1ad87d6618dc729bc86c982f5034136c3d142aa9 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -91,16 +91,12 @@ ivas_error ivas_dirac_dec_output_synthesis_open( RENDERER_TYPE renderer_type, /* i : renderer type */ const int16_t nchan_transport, /* i : number of transport channels */ const int32_t output_Fs /* i : output sampling rate */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { int16_t idx, ch_idx; -#ifdef HODIRAC int16_t size; -#endif float tmp; uint16_t num_diffuse_responses; float temp_alpha_synthesis[CLDFB_NO_CHANNELS_MAX]; @@ -178,7 +174,6 @@ ivas_error ivas_dirac_dec_output_synthesis_open( } /* target PSD buffers */ -#ifdef HODIRAC if ( hodirac_flag ) { size = hDirAC->num_freq_bands * hDirAC->num_outputs_dir * DIRAC_HO_NUMSECTORS; @@ -191,12 +186,6 @@ ivas_error ivas_dirac_dec_output_synthesis_open( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n" ) ); } -#else - if ( ( dirac_output_synthesis_state->cy_cross_dir_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n" ) ); - } -#endif if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { @@ -230,17 +219,10 @@ ivas_error ivas_dirac_dec_output_synthesis_open( } /* direct and diffuse gain buffers */ -#ifdef HODIRAC if ( ( dirac_output_synthesis_state->gains_dir_prev = (float *) malloc( size * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n" ) ); } -#else - if ( ( dirac_output_synthesis_state->gains_dir_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n" ) ); - } -#endif if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { @@ -387,15 +369,11 @@ ivas_error ivas_dirac_dec_output_synthesis_open( void ivas_dirac_dec_output_synthesis_init( DIRAC_DEC_HANDLE hDirAC, /* i/o: DirAC handle */ const int16_t nchan_out_woLFE /* i : number of output audio channels without LFE */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { -#ifdef HODIRAC int16_t size; -#endif DIRAC_OUTPUT_SYNTHESIS_PARAMS *h_dirac_output_synthesis_params; DIRAC_OUTPUT_SYNTHESIS_STATE *h_dirac_output_synthesis_state; @@ -413,7 +391,6 @@ void ivas_dirac_dec_output_synthesis_init( set_zero( h_dirac_output_synthesis_state->cy_auto_dir_smooth_prev, hDirAC->num_freq_bands * hDirAC->num_outputs_dir ); } -#ifdef HODIRAC if ( hodirac_flag ) { size = hDirAC->num_freq_bands * hDirAC->num_outputs_dir * DIRAC_HO_NUMSECTORS; @@ -423,9 +400,6 @@ void ivas_dirac_dec_output_synthesis_init( size = hDirAC->num_freq_bands * hDirAC->num_outputs_dir; } set_zero( h_dirac_output_synthesis_state->cy_cross_dir_smooth_prev, size ); -#else - set_zero( h_dirac_output_synthesis_state->cy_cross_dir_smooth_prev, hDirAC->num_freq_bands * hDirAC->num_outputs_dir ); -#endif if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { @@ -444,11 +418,7 @@ void ivas_dirac_dec_output_synthesis_init( { set_zero( h_dirac_output_synthesis_state->proto_power_smooth_prev, hDirAC->num_freq_bands * hDirAC->num_protos_dir ); } -#ifdef HODIRAC set_zero( h_dirac_output_synthesis_state->gains_dir_prev, size ); -#else - set_zero( h_dirac_output_synthesis_state->gains_dir_prev, hDirAC->num_freq_bands * hDirAC->num_outputs_dir ); -#endif if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { @@ -591,14 +561,12 @@ void ivas_dirac_dec_output_synthesis_process_slot( const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport /* i : number of transport channels*/ -#if !defined( HODIRAC ) || defined( JBM_TSM_ON_TCS ) +#if defined( JBM_TSM_ON_TCS ) , const int16_t md_idx #endif -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { int16_t num_freq_bands, num_channels_dir; @@ -635,7 +603,6 @@ void ivas_dirac_dec_output_synthesis_process_slot( num_channels_dir = hOutSetup.nchan_out_woLFE; } -#ifdef HODIRAC if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD && hodirac_flag ) { ivas_dirac_dec_compute_directional_responses( hDirAC, @@ -712,124 +679,119 @@ void ivas_dirac_dec_output_synthesis_process_slot( } } else // ( hDirAC->hConfig->dec_param_estim == TRUE ) -#endif if ( hDirAC->hConfig->dec_param_estim == TRUE ) - { + { - /* compute direct responses */ + /* compute direct responses */ #ifdef JBM_TSM_ON_TCS - ivas_dirac_dec_compute_directional_responses( hDirAC, - hVBAPdata, - NULL, - azimuth, - elevation, - md_idx, - NULL, - sh_rot_max_order, - p_Rmat -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + ivas_dirac_dec_compute_directional_responses( hDirAC, + hVBAPdata, + NULL, + azimuth, + elevation, + md_idx, + NULL, + sh_rot_max_order, + p_Rmat, + hodirac_flag ); #endif - if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) - { - ivas_dirac_dec_compute_gain_factors( num_freq_bands, - diffuseness, - h_dirac_output_synthesis_params->max_band_decorr, - h_dirac_output_synthesis_state->direct_power_factor, - h_dirac_output_synthesis_state->diffuse_power_factor ); + if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) + { + ivas_dirac_dec_compute_gain_factors( num_freq_bands, + diffuseness, + h_dirac_output_synthesis_params->max_band_decorr, + h_dirac_output_synthesis_state->direct_power_factor, + h_dirac_output_synthesis_state->diffuse_power_factor ); - v_multc( h_dirac_output_synthesis_state->direct_power_factor, - 0.25f, - h_dirac_output_synthesis_state->direct_power_factor, - num_freq_bands ); - v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, - 0.25f, - h_dirac_output_synthesis_state->diffuse_power_factor, - num_freq_bands ); + v_multc( h_dirac_output_synthesis_state->direct_power_factor, + 0.25f, + h_dirac_output_synthesis_state->direct_power_factor, + num_freq_bands ); + v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, + 0.25f, + h_dirac_output_synthesis_state->diffuse_power_factor, + num_freq_bands ); - /*Direct gain*/ - for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ ) - { - int16_t k; - if ( ch_idx != 0 ) + /*Direct gain*/ + for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ ) { - float a, b, c; - - /*Directonal sound gain nrg compensation*/ - for ( k = 0; k < num_freq_bands_diff; k++ ) + int16_t k; + if ( ch_idx != 0 ) { - a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; - b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); - c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ); /*Diffuseness modellling nrg compensation*/ - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + float a, b, c; + + /*Directonal sound gain nrg compensation*/ + for ( k = 0; k < num_freq_bands_diff; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; + b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); + c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ); /*Diffuseness modellling nrg compensation*/ + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + } + for ( ; k < num_freq_bands; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; + b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); + c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ); /*Diffuseness modellling nrg compensation*/ + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + } } - for ( ; k < num_freq_bands; k++ ) + else { - a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; - b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); - c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ); /*Diffuseness modellling nrg compensation*/ - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + /*Diffuseness modellling nrg compensation*/ + for ( k = 0; k < num_freq_bands_diff; k++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) ); + } + for ( ; k < num_freq_bands; k++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ) ); + } } } - else + + /*Directional gain (panning)*/ + for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) { - /*Diffuseness modellling nrg compensation*/ - for ( k = 0; k < num_freq_bands_diff; k++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) ); - } - for ( ; k < num_freq_bands; k++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ) ); - } + v_mult( h_dirac_output_synthesis_state->direct_power_factor, + &h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands], + aux_buf, + num_freq_bands ); + + v_add( aux_buf, + &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], + &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], + num_freq_bands ); } - } - /*Directional gain (panning)*/ - for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) - { - v_mult( h_dirac_output_synthesis_state->direct_power_factor, - &h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands], - aux_buf, - num_freq_bands ); - - v_add( aux_buf, - &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], - &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], - num_freq_bands ); - } + /*Diffuse gain*/ + for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) + { + v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, + hDirAC->diffuse_response_function[ch_idx], + aux_buf, + num_freq_bands_diff ); + + v_add( aux_buf, + &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], + &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], + num_freq_bands_diff ); + } - /*Diffuse gain*/ - for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) + return; + } + else { - v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, - hDirAC->diffuse_response_function[ch_idx], - aux_buf, - num_freq_bands_diff ); - - v_add( aux_buf, - &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], - &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], - num_freq_bands_diff ); + /* compute reference and diffuse power factor for this frame */ + ivas_dirac_dec_compute_power_factors( num_freq_bands, + diffuseness, + h_dirac_output_synthesis_params->max_band_decorr, + h_dirac_output_synthesis_state->direct_power_factor, + h_dirac_output_synthesis_state->diffuse_power_factor ); } - - return; - } - else - { - /* compute reference and diffuse power factor for this frame */ - ivas_dirac_dec_compute_power_factors( num_freq_bands, - diffuseness, - h_dirac_output_synthesis_params->max_band_decorr, - h_dirac_output_synthesis_state->direct_power_factor, - h_dirac_output_synthesis_state->diffuse_power_factor ); } - } diff_start_band = 0; if ( h_dirac_output_synthesis_params->use_onset_filters ) @@ -872,14 +834,11 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( #ifdef JBM_TSM_ON_TCS const int16_t nbslots, /* i : number of slots to process */ #endif - const float *onset_filter -#ifdef HODIRAC - , + const float *onset_filter, #ifdef JBM_TSM_ON_TCS const int16_t md_idx, #endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { int16_t buf_idx, ch_idx, i, l; @@ -899,11 +858,9 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( DIRAC_OUTPUT_SYNTHESIS_STATE h_dirac_output_synthesis_state; int16_t nchan_transport_foa; int16_t ch_idx_diff; -#ifdef HODIRAC float aux_buf[CLDFB_NO_CHANNELS_MAX]; float ratio[DIRAC_HO_NUMSECTORS * CLDFB_NO_CHANNELS_MAX]; const float *diffuseness; -#endif /* collect some often used parameters */ h_dirac_output_synthesis_params = hDirAC->h_output_synthesis_psd_params; @@ -917,19 +874,16 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( num_channels_diff = hDirAC->num_outputs_diff; nchan_transport_foa = min( 4, nchan_transport ); -#ifdef HODIRAC #ifdef JBM_TSM_ON_TCS diffuseness = hDirAC->diffuseness_vector[md_idx]; #else diffuseness = hDirAC->diffuseness_vector[hDirAC->dirac_read_idx]; -#endif #endif /*-----------------------------------------------------------------* * comput target Gains *-----------------------------------------------------------------*/ -#ifdef HODIRAC if ( hodirac_flag ) { assert( hDirAC->hConfig->dec_param_estim == FALSE ); @@ -983,9 +937,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( num_freq_bands_diff ); } } - else -#endif - if ( hDirAC->hConfig->dec_param_estim == FALSE ) + else if ( hDirAC->hConfig->dec_param_estim == FALSE ) { /*Direct gain*/ for ( ch_idx = 0; ch_idx < nchan_transport_foa; ch_idx++ ) @@ -1032,7 +984,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( p_gains_dir = h_dirac_output_synthesis_state.cy_cross_dir_smooth_prev; /* Direct gains */ -#ifdef HODIRAC if ( hodirac_flag ) { for ( ch_idx = 0; ch_idx < nchan_transport_foa; ch_idx++ ) @@ -1049,7 +1000,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( } } else -#endif { for ( ch_idx = 0; ch_idx < nchan_transport_foa; ch_idx++ ) { @@ -1079,7 +1029,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( } } -#ifdef HODIRAC if ( hodirac_flag ) { p_cy_cross_dir_smooth = h_dirac_output_synthesis_state.cy_cross_dir_smooth + num_freq_bands * num_channels_dir; @@ -1109,7 +1058,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( } } } -#endif /*Diffuse gains*/ p_cy_auto_diff_smooth = h_dirac_output_synthesis_state.cy_auto_diff_smooth + nchan_transport_foa * num_freq_bands_diff; @@ -1157,7 +1105,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( /*Directional stream*/ for ( ch_idx = nchan_transport_foa; ch_idx < num_channels_dir; ch_idx++ ) { -#ifdef HODIRAC if ( hodirac_flag ) { if ( proto_direct_index[ch_idx] == 0 ) @@ -1204,7 +1151,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( } } else -#endif { p_proto = h_dirac_output_synthesis_state.proto_direct_buffer_f + buf_idx * 2 * num_freq_bands * num_protos_dir + @@ -1244,13 +1190,8 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( for ( l = 0; l < num_freq_bands_diff; l++ ) { g = g1 * ( *( p_gains_diff++ ) ) + g2 * ( *( p_gains_diff_prev++ ) ); -#ifdef HODIRAC output_real[l * num_channels_dir + hDirAC->sba_map_tc[ch_idx]] += g * ( *( p_proto++ ) ); /* maps ch_idx 5 to 8 */ output_imag[l * num_channels_dir + hDirAC->sba_map_tc[ch_idx]] += g * ( *( p_proto++ ) ); -#else - output_real[l * num_channels_dir + sba_map_tc[ch_idx]] += g * ( *( p_proto++ ) ); /* maps ch_idx 5 to 8 */ - output_imag[l * num_channels_dir + sba_map_tc[ch_idx]] += g * ( *( p_proto++ ) ); -#endif } } else @@ -1314,13 +1255,11 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( *-----------------------------------------------------------------*/ /* store estimates for next synthesis block */ -#ifdef HODIRAC if ( hodirac_flag ) { mvr2r( h_dirac_output_synthesis_state.cy_cross_dir_smooth_prev, h_dirac_output_synthesis_state.gains_dir_prev, num_freq_bands * num_channels_dir * DIRAC_HO_NUMSECTORS ); } else -#endif { mvr2r( h_dirac_output_synthesis_state.cy_cross_dir_smooth_prev, h_dirac_output_synthesis_state.gains_dir_prev, num_freq_bands * num_channels_dir ); } @@ -1328,13 +1267,11 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd( mvr2r( h_dirac_output_synthesis_state.cy_auto_diff_smooth_prev, h_dirac_output_synthesis_state.gains_diff_prev, num_freq_bands_diff * num_channels_diff ); /* reset values */ -#ifdef HODIRAC if ( hodirac_flag ) { set_zero( h_dirac_output_synthesis_state.cy_cross_dir_smooth, num_freq_bands * num_channels_dir * DIRAC_HO_NUMSECTORS ); } else -#endif { set_zero( h_dirac_output_synthesis_state.cy_cross_dir_smooth, num_freq_bands * num_channels_dir ); } @@ -1889,10 +1826,8 @@ void ivas_dirac_dec_compute_directional_responses( const float *surCohRatio, const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat /* i : rotation matrix */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { int16_t k, l; @@ -1971,7 +1906,6 @@ void ivas_dirac_dec_compute_directional_responses( /* HOA3 PANNING */ if ( hDirAC->panningConf == DIRAC_PANNING_HOA3 ) { -#ifdef HODIRAC set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); @@ -2003,22 +1937,6 @@ void ivas_dirac_dec_compute_directional_responses( mvr2r_inc( direct_response_dir2, 1, &hDirAC->h_output_synthesis_psd_state.direct_responses[k + hDirAC->num_freq_bands * num_channels_dir], hDirAC->num_freq_bands, num_channels_dir ); } } -#else - set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); - if ( p_Rmat != 0 ) - { - ivas_dirac_dec_get_response_split_order( azimuth[k], elevation[k], direct_response_hoa, shd_rot_max_order, p_Rmat ); - } - else - { - ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirAC->hOutSetup.ambisonics_order ); - } - - if ( hMasa == NULL && hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) - { - mvr2r_inc( direct_response_hoa, 1, &hDirAC->h_output_synthesis_psd_state.direct_responses[k], hDirAC->num_freq_bands, num_channels_dir ); - } -#endif else if ( ( ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) && ( hMasa != NULL ) ) || hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD || hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d5982c63a059fb5afc03b349b0bae3b30add3f11..98ddbe5ec8e1b18ef076c4a66ff63e48a3c7579c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -385,7 +385,6 @@ static ivas_error ivas_read_format( st_ivas->ivas_format = MC_FORMAT; break; case 2: -#ifdef COMBINED_FORMAT_SIGNALING st_ivas->ivas_format = ISM_FORMAT; if ( ivas_total_brate >= IVAS_24k4 ) @@ -399,9 +398,6 @@ static ivas_error ivas_read_format( ( *num_bits_read )++; } -#else - st_ivas->ivas_format = ISM_FORMAT; -#endif break; case 3: @@ -900,9 +896,7 @@ ivas_error ivas_init_decoder( st_ivas->hSCE[sce_id]->hCoreCoder[0]->is_ism_format = 1; } -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT st_ivas->hISMDTX.sce_id_dtx = 0; -#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { @@ -950,12 +944,7 @@ ivas_error ivas_init_decoder( ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, -#ifdef HODIRAC - ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) -#else - IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND -#endif - ) ) != IVAS_ERR_OK ) + ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) ) != IVAS_ERR_OK ) { return error; } @@ -978,7 +967,6 @@ ivas_error ivas_init_decoder( int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1]; st_ivas->hSpar->enc_param_start_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); -#ifdef HODIRAC if ( ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ) { st_ivas->hSpar->enc_param_start_band = 0; @@ -986,7 +974,6 @@ ivas_error ivas_init_decoder( set_c( (int8_t *) st_ivas->hQMetaData->twoDirBands, (int8_t) 1, st_ivas->hQMetaData->q_direction[0].cfg.nbands ); st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } -#endif ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); @@ -1096,7 +1083,6 @@ ivas_error ivas_init_decoder( return error; } } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { /* init EFAP for custom LS setup */ @@ -1137,7 +1123,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { /* init EFAP for custom LS setup */ @@ -1404,9 +1389,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC && ( st_ivas->renderer_type == RENDERER_TD_PANNING || -#if defined NON_DIEGETIC_PAN || defined ISM_NON_DIEGETIC_PAN st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX || -#endif st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || @@ -1421,11 +1404,7 @@ ivas_error ivas_init_decoder( /*-----------------------------------------------------------------* * LFE handles for rendering after rendering to adjust LFE delay to binaural filter delay *-----------------------------------------------------------------*/ -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCT ) -#endif { binauralization_delay_ns = st_ivas->binaural_latency_ns; if ( st_ivas->hBinRenderer != NULL ) @@ -1714,9 +1693,7 @@ void ivas_initialize_handles_dec( st_ivas->hMasa = NULL; st_ivas->hQMetaData = NULL; st_ivas->hMCT = NULL; -#ifdef MC_PARAMUPMIX_MODE st_ivas->hMCParamUpmix = NULL; -#endif st_ivas->hParamMC = NULL; st_ivas->hLFE = NULL; @@ -1861,10 +1838,8 @@ void ivas_destroy_dec( /* LFE handle */ ivas_lfe_dec_close( &( st_ivas->hLFE ) ); -#ifdef MC_PARAMUPMIX_MODE /* Param-Upmix MC handle */ ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) ); -#endif /* Parametric MC handle */ ivas_param_mc_dec_close( &st_ivas->hParamMC ); @@ -1987,9 +1962,7 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses += 2; } break; -#ifdef NON_DIEGETIC_PAN case RENDERER_NON_DIEGETIC_DOWNMIX: -#endif case RENDERER_MONO_DOWNMIX: if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -2117,13 +2090,11 @@ void ivas_init_dec_get_num_cldfb_instances( default: assert( 0 && "Renderer not handled for CLDFB reservation." ); } -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) { *numCldfbAnalyses = max( MC_PARAMUPMIX_MIN_CLDFB, *numCldfbAnalyses ); *numCldfbSyntheses = max( MC_PARAMUPMIX_MIN_CLDFB, *numCldfbSyntheses ); } -#endif return; } @@ -2159,12 +2130,10 @@ static ivas_error doSanityChecks_IVAS( assert( st_ivas->ivas_format != MONO_FORMAT && "\n Wrong IVAS format: MONO" ); /* Verify output configuration compatible with non-diegetic panning */ -#ifdef NON_DIEGETIC_PAN if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan && ( st_ivas->ivas_format != MONO_FORMAT ) && ( st_ivas->transport_config != AUDIO_CONFIG_ISM1 ) ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Non-diegetic panning not supported in this IVAS format" ); } -#endif /* Verify stereo output configuration */ if ( st_ivas->ivas_format == STEREO_FORMAT ) @@ -2215,11 +2184,7 @@ static ivas_error doSanityChecks_IVAS( } #ifdef DEBUGGING -#ifdef MC_PARAMUPMIX_MODE 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 || ( 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 && st_ivas->mc_mode != MC_MODE_PARAMUPMIX ) ) ) ) -#else - 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 || ( 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 ) ) ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" ); } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 5706261093a102b3ffe66ee887b8fc8fd0bea19f..571da52921b7bd2a581a06f08815ff7471c779f0 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -63,9 +63,7 @@ static ivas_error ivas_ism_bitrate_switching( ivas_error error; int32_t element_brate_tmp[MAX_NUM_OBJECTS]; int16_t nSCE_old, nCPE_old; -#ifdef FIX_416_ISM_BR_SWITCHING int16_t numCldfbAnalyses_old, numCldfbSyntheses_old, ism_mode; -#endif #ifdef JBM_TSM_ON_TCS TC_BUFFER_MODE tc_buffer_mode_new; @@ -82,19 +80,13 @@ static ivas_error ivas_ism_bitrate_switching( nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; -#ifdef FIX_416_ISM_BR_SWITCHING /* we have to temporarily set the ism mode back to the old one, otherwise this can give wrong results*/ ism_mode = st_ivas->ism_mode; 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; -#endif -#ifdef ISM_NON_DIEGETIC_PAN 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 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -301,7 +293,6 @@ static ivas_error ivas_ism_bitrate_switching( } } -#ifdef FIX_416_ISM_BR_SWITCHING /*-----------------------------------------------------------------* * CLDFB instances *-----------------------------------------------------------------*/ @@ -310,7 +301,6 @@ static ivas_error ivas_ism_bitrate_switching( { return error; } -#endif #ifdef JBM_TSM_ON_TCS /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index b2bc737fa20367b0ce9f3271f4c82a7567d8c2d7..7c22ff2e9e16aa871944278f3d3eba7dba5df3d6 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -39,42 +39,6 @@ #endif #include "wmc_auto.h" -#ifndef FIX_ISM_DTX_CNG_BWIDTH_ALT -/*-------------------------------------------------------------------* - * ivas_ism_preprocessing() - * - * - *-------------------------------------------------------------------*/ - -static void ivas_ism_preprocessing( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t sce_id /* i : SCE # identifier */ -) -{ - Decoder_State *st; - - st = st_ivas->hSCE[sce_id]->hCoreCoder[0]; - - { - /* reset the bitstream to at least read the cng type and bandwidth for non transmitted SCE */ - st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; - st->next_bit_pos = 0; /* note: needed in paramISM -> discISM switching */ - - if ( sce_id == st_ivas->hISMDTX.sce_id_dtx ) - { - st->read_sid_info = 1; /* read the sid info from bitstream */ - } - else - { - st->read_sid_info = 0; /* do not read the sid info from bitstream but use the estimated noise */ - } - - st->cng_ism_flag = 1; - } - - return; -} -#endif /*-------------------------------------------------------------------* * ivas_ism_dtx_dec() @@ -93,9 +57,7 @@ ivas_error ivas_ism_dtx_dec( int16_t idx, flag_noisy_speech, sce_id_dtx; ISM_MODE last_ism_mode, ism_mode_bstr; ivas_error error; -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT Decoder_State *st; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -188,15 +150,11 @@ ivas_error ivas_ism_dtx_dec( { for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT st = st_ivas->hSCE[ch]->hCoreCoder[0]; st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; st->next_bit_pos = 0; /* note: needed in paramISM -> discISM switching */ st->cng_ism_flag = 1; st->L_frame = min( st->L_frame, L_FRAME16k ); /* note: needed for switching from active frame with L_frame=640 to CNG in object with no SID */ -#else - ivas_ism_preprocessing( st_ivas, ch ); // VE: after the acceptance of switches, replace the function call by its content -#endif } } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index b7bf89e026c874793b942f96e2e0b8f798cc0591..e269d1e6041209e0336d7e8df22a5d7f8d46ce47 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -48,11 +48,7 @@ * Local functions *-----------------------------------------------------------------------*/ -#ifdef ISM_NON_DIEGETIC_PAN static void decode_angle_indices( DEC_CORE_HANDLE st0, ISM_METADATA_ANGLE_HANDLE angle, const int16_t non_diegetic_flag, int16_t *flag_abs_azimuth ); -#else -static void decode_angle_indices( DEC_CORE_HANDLE st0, ISM_METADATA_ANGLE_HANDLE angle, int16_t *flag_abs_azimuth ); -#endif static int16_t decode_radius( DEC_CORE_HANDLE st0, int16_t *last_radius_idx, int16_t *flag_abs_radius ); @@ -161,9 +157,7 @@ ivas_error ivas_ism_metadata_dec( int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; DEC_CORE_HANDLE st0; int16_t ism_extmeta_bitstream; -#ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag_global; -#endif float yaw, pitch, radius; int16_t flag_abs_radius; int16_t flag_abs_orientation; @@ -193,9 +187,7 @@ ivas_error ivas_ism_metadata_dec( next_bit_pos_orig = st0->next_bit_pos; st0->next_bit_pos = 0; ism_extmeta_bitstream = 0; -#ifdef ISM_NON_DIEGETIC_PAN non_diegetic_flag_global = 0; -#endif /* reverse the bitstream for easier reading of indices */ for ( i = 0; i < min( MAX_BITS_METADATA, last_bit_pos ); i++ ) @@ -236,13 +228,11 @@ ivas_error ivas_ism_metadata_dec( { ism_extmeta_bitstream = get_next_indice( st0, ISM_EXTENDED_METADATA_BITS ); -#ifdef ISM_NON_DIEGETIC_PAN /* read global non-diegetic object flag */ if ( ism_extmeta_bitstream ) { non_diegetic_flag_global = get_next_indice( st0, ISM_METADATA_IS_NDP_BITS ); } -#endif } /* Apply hysteresis in case rate switching causes fluctuation in presence of extended metadata */ if ( *ism_extmeta_active == -1 || *ism_extmeta_active == ism_extmeta_bitstream ) /* If first frame or bitstream matches internal state */ @@ -323,7 +313,6 @@ ivas_error ivas_ism_metadata_dec( if ( hIsmMeta[ch]->ism_metadata_flag ) { -#ifdef ISM_NON_DIEGETIC_PAN if ( non_diegetic_flag_global ) { /* read non-diegetic flag for each object */ @@ -352,9 +341,6 @@ ivas_error ivas_ism_metadata_dec( else { decode_angle_indices( st0, &( hIsmMetaData->position_angle ), hIsmMeta[ch]->non_diegetic_flag, &flag_abs_position ); -#else - decode_angle_indices( st0, &( hIsmMetaData->position_angle ), &flag_abs_position ); -#endif idx_angle1 = hIsmMetaData->position_angle.last_angle1_idx; idx_angle2 = hIsmMetaData->position_angle.last_angle2_idx; @@ -372,11 +358,7 @@ ivas_error ivas_ism_metadata_dec( /* radius/raw/pitch dequantization */ if ( ism_extmeta_bitstream ) { -#ifdef ISM_NON_DIEGETIC_PAN decode_angle_indices( st0, &( hIsmMetaData->orientation_angle ), hIsmMeta[ch]->non_diegetic_flag, &flag_abs_orientation ); -#else - decode_angle_indices( st0, &( hIsmMetaData->orientation_angle ), &flag_abs_orientation ); -#endif idx_angle1 = hIsmMetaData->orientation_angle.last_angle1_idx; idx_angle2 = hIsmMetaData->orientation_angle.last_angle2_idx; yaw = ism_dequant_meta( idx_angle1, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); @@ -405,9 +387,7 @@ ivas_error ivas_ism_metadata_dec( hIsmMetaData->last_true_azimuth = hIsmMetaData->azimuth; hIsmMetaData->last_true_elevation = hIsmMetaData->elevation; } -#ifdef ISM_NON_DIEGETIC_PAN } -#endif /* save number of metadata bits read */ if ( ism_mode == ISM_MODE_DISC ) { @@ -499,11 +479,7 @@ ivas_error ivas_ism_metadata_dec( if ( !bfi ) { -#ifdef ISM_NON_DIEGETIC_PAN if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, ism_extmeta_bitstream, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_config( ism_total_brate, *nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -512,14 +488,9 @@ ivas_error ivas_ism_metadata_dec( { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; -#ifdef FIX_419_ISM_BRATE_SW_DTX hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; -#endif if ( ism_mode == ISM_MODE_DISC ) { -#ifndef FIX_419_ISM_BRATE_SW_DTX - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; -#endif if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; @@ -613,11 +584,7 @@ ivas_error ivas_ism_metadata_dec_create( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } -#ifdef ISM_NON_DIEGETIC_PAN if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -637,10 +604,8 @@ ivas_error ivas_ism_metadata_dec_create( static void decode_angle_indices( DEC_CORE_HANDLE st0, /* i/o: bitstream handle */ ISM_METADATA_ANGLE_HANDLE angle, /* i/o: angle handle */ -#ifdef ISM_NON_DIEGETIC_PAN const int16_t non_diegetic_flag, /* i : Non diegetic flag */ -#endif - int16_t *flag_abs_angle1 /* o : Azimuth/yaw encoding mode */ + int16_t *flag_abs_angle1 /* o : Azimuth/yaw encoding mode */ ) { int16_t idx_angle1, nbits_diff_angle1, diff, sgn; @@ -718,10 +683,8 @@ static void decode_angle_indices( * Elevation/pitch decoding and dequantization *----------------------------------------------------------------*/ -#ifdef ISM_NON_DIEGETIC_PAN if ( non_diegetic_flag == 0 ) { -#endif /* Decode elevation/pitch index */ if ( *flag_abs_angle1 == 0 && get_next_indice( st0, 1 ) == 1 ) /* elevation_abs_flag */ { @@ -769,14 +732,11 @@ static void decode_angle_indices( { idx_angle2 = angle->last_angle2_idx; } - -#ifdef ISM_NON_DIEGETIC_PAN } else { idx_angle2 = angle->last_angle2_idx; /* second MD parameter is not transmitted for non-diegetic object */ } -#endif /*----------------------------------------------------------------* * Final updates @@ -784,9 +744,6 @@ static void decode_angle_indices( angle->last_angle2_idx = idx_angle2; angle->last_angle1_idx = idx_angle1; -#ifndef ISM_NON_DIEGETIC_PAN - angle->last_angle2_idx = idx_angle2; -#endif return; } @@ -976,12 +933,6 @@ void ivas_ism_metadata_sid_dec( hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = (float) ( idx ) / (float) ( ( 1 << nBits_coh ) - 1 ); } } -#ifndef FIX_ISM_DTX_CNG_BWIDTH_ALT - else - { - *sce_id_dtx = 0; - } -#endif if ( ism_mode == ISM_MODE_PARAM ) { diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 7e0f65a66332762e561897da24c43a907acd446a..5236de4109e9a7344cbb722341c74d50b4e183da 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -689,7 +689,6 @@ ivas_error ivas_param_ism_dec_open( #ifndef JBM_TSM_ON_TCS hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; #endif -#ifdef DIRAC_ALLOC_HARM if ( ( error = ivas_dirac_allocate_parameters( hDirAC, 1 ) ) != IVAS_ERR_OK ) { return error; @@ -699,109 +698,6 @@ ivas_error ivas_param_ism_dec_open( { return error; } -#else - if ( ( hDirAC->azimuth = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->elevation = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->azimuth2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->elevation2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->energy_ratio1 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->spreadCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->energy_ratio2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->spreadCoherence2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - if ( ( hDirAC->surroundingCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( ( hDirAC->azimuth[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_s( hDirAC->azimuth[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->elevation[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_s( hDirAC->elevation[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->azimuth2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_s( hDirAC->azimuth2[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->elevation2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_s( hDirAC->elevation2[i], 0, hDirAC->num_freq_bands ); - - if ( ( hDirAC->energy_ratio1[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_f( hDirAC->energy_ratio1[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->spreadCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_f( hDirAC->spreadCoherence[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->energy_ratio2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_f( hDirAC->energy_ratio2[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->spreadCoherence2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_f( hDirAC->spreadCoherence2[i], 0.0f, hDirAC->num_freq_bands ); - - if ( ( hDirAC->surroundingCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); - } - set_f( hDirAC->surroundingCoherence[i], 0.0f, hDirAC->num_freq_bands ); - } -#endif } st_ivas->hISMDTX.dtx_flag = 0; @@ -872,9 +768,6 @@ void ivas_param_ism_dec_close( AUDIO_CONFIG output_config /* i : output audio configuration */ ) { -#ifndef DIRAC_ALLOC_HARM - int16_t i; -#endif DIRAC_DEC_HANDLE hDirAC; if ( hDirAC_out == NULL || *hDirAC_out == NULL ) @@ -893,134 +786,8 @@ void ivas_param_ism_dec_close( if ( ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) { -#ifdef DIRAC_ALLOC_HARM ivas_dirac_deallocate_parameters( hDirAC, 1 ); ivas_dirac_deallocate_parameters( hDirAC, 2 ); -#else - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->azimuth[i] != NULL ) - { - free( hDirAC->azimuth[i] ); - hDirAC->azimuth[i] = NULL; - } - - if ( hDirAC->elevation[i] != NULL ) - { - free( hDirAC->elevation[i] ); - hDirAC->elevation[i] = NULL; - } - } - - if ( hDirAC->azimuth != NULL ) - { - free( hDirAC->azimuth ); - hDirAC->azimuth = NULL; - } - if ( hDirAC->elevation != NULL ) - { - free( hDirAC->elevation ); - hDirAC->elevation = NULL; - } - - if ( hDirAC->azimuth2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->azimuth2[i] != NULL ) - { - free( hDirAC->azimuth2[i] ); - hDirAC->azimuth2[i] = NULL; - } - } - free( hDirAC->azimuth2 ); - hDirAC->azimuth2 = NULL; - } - - if ( hDirAC->elevation2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->elevation2[i] != NULL ) - { - free( hDirAC->elevation2[i] ); - hDirAC->elevation2[i] = NULL; - } - } - free( hDirAC->elevation2 ); - hDirAC->elevation2 = NULL; - } - - if ( hDirAC->energy_ratio1 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->energy_ratio1[i] != NULL ) - { - free( hDirAC->energy_ratio1[i] ); - hDirAC->energy_ratio1[i] = NULL; - } - } - free( hDirAC->energy_ratio1 ); - hDirAC->energy_ratio1 = NULL; - } - - if ( hDirAC->energy_ratio2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->energy_ratio2[i] != NULL ) - { - free( hDirAC->energy_ratio2[i] ); - hDirAC->energy_ratio2[i] = NULL; - } - } - free( hDirAC->energy_ratio2 ); - hDirAC->energy_ratio2 = NULL; - } - - if ( hDirAC->spreadCoherence != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->spreadCoherence[i] != NULL ) - { - free( hDirAC->spreadCoherence[i] ); - hDirAC->spreadCoherence[i] = NULL; - } - } - free( hDirAC->spreadCoherence ); - hDirAC->spreadCoherence = NULL; - } - - if ( hDirAC->spreadCoherence2 != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->spreadCoherence2[i] != NULL ) - { - free( hDirAC->spreadCoherence2[i] ); - hDirAC->spreadCoherence2[i] = NULL; - } - } - free( hDirAC->spreadCoherence2 ); - hDirAC->spreadCoherence2 = NULL; - } - - if ( hDirAC->surroundingCoherence != NULL ) - { - for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) - { - if ( hDirAC->surroundingCoherence[i] != NULL ) - { - free( hDirAC->surroundingCoherence[i] ); - hDirAC->surroundingCoherence[i] = NULL; - } - } - free( hDirAC->surroundingCoherence ); - hDirAC->surroundingCoherence = NULL; - } -#endif } if ( !( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 95c153fc807fd19d529eecd4aa4de64a2d4c8ed6..3b38e2d890f0c28df26f3841e5e89d502e51cc5b 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -176,11 +176,7 @@ void ivas_ism_render( else { /* Head rotation: rotate the object positions depending the head's orientation */ -#ifdef ISM_NON_DIEGETIC_PAN if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 && !st_ivas->hIsmMetaData[i]->non_diegetic_flag ) -#else - if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 ) -#endif { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, Rmat, st_ivas->hIntSetup.is_planar_setup ); } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index f33a5e01e6cf6a459ddd4b88f9df85127c80a776..74acc77d688a43d02d56e7837ca9366f7fa5f11f 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -131,11 +131,7 @@ ivas_error ivas_jbm_dec_tc( } if ( st_ivas->renderer_type == RENDERER_MC && st_ivas->hDecoderConfig->nchan_out == 1 ) { -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); -#else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif } } else if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -191,9 +187,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == SBA_FORMAT ) { ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, -#ifdef HODIRAC st_ivas->sba_analysis_order > 1 && ivas_total_brate > IVAS_256k, -#endif 0 ); } else @@ -216,9 +210,7 @@ ivas_error ivas_jbm_dec_tc( st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode, -#ifdef HODIRAC st_ivas->sba_analysis_order > 1 && ivas_total_brate > IVAS_256k, -#endif st_ivas->hSpar->dirac_to_spar_md_bands ); } @@ -275,12 +267,8 @@ ivas_error ivas_jbm_dec_tc( ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, output ); } - ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi -#ifdef HODIRAC - , - ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate ) -#endif - ); + ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi, + ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); } ivas_sba_dirac_stereo_dec( st_ivas, output, output_frame, st_ivas->ivas_format == MC_FORMAT ); @@ -367,11 +355,7 @@ ivas_error ivas_jbm_dec_tc( { if ( st_ivas->renderer_type == RENDERER_MC ) { -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); -#else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif } else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { @@ -408,11 +392,7 @@ ivas_error ivas_jbm_dec_tc( /* Rendering */ if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) { -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); -#else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif } } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) @@ -686,11 +666,7 @@ ivas_error ivas_jbm_dec_render( if ( st_ivas->renderer_type == RENDERER_MC ) { *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); -#else - ivas_ls_setup_conversion( st_ivas, output_frame, p_output, p_output ); -#endif } } else if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -822,11 +798,7 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->renderer_type == RENDERER_MC ) { *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); -#ifdef MC_PARAMUPMIX_MODE ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); -#else - ivas_ls_setup_conversion( st_ivas, *nSamplesRendered, p_tc, p_output ); -#endif } else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 44cc172041215a34f169c06211b510ca1b85c396..d17a5fdac7593d15ceeff79e55837268ec1e6b1c 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -211,12 +211,8 @@ ivas_error ivas_masa_decode( else { #endif - *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos -#ifdef HODIRAC - , - 0 -#endif - ); + *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos, + 0 ); #ifdef HR_METADATA } #endif @@ -303,12 +299,8 @@ ivas_error ivas_masa_decode( if ( st_ivas->hDirAC != NULL ) { ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, ivas_total_brate, - SBA_MODE_NONE -#ifdef HODIRAC - , - 0 -#endif - , + SBA_MODE_NONE, + 0, 0 ); } st->next_bit_pos = next_bit_pos_orig; @@ -1147,9 +1139,7 @@ ivas_error ivas_masa_dec_reconfigure( uint16_t *bit_stream; Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; -#ifdef FIX_417_TD_DECORR_BRATE_SW int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; -#endif ivas_error error; error = IVAS_ERR_OK; @@ -1157,11 +1147,8 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifdef FIX_417_TD_DECORR_BRATE_SW ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); -#endif -#ifdef FIX_425_MASA_BRSW_RENDERER /* renderer might have changed, reselect */ ivas_renderer_select( st_ivas ); @@ -1179,7 +1166,6 @@ ivas_error ivas_masa_dec_reconfigure( ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); } /* possible reconfigure is done later */ -#endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles @@ -1237,14 +1223,11 @@ ivas_error ivas_masa_dec_reconfigure( } } } -#ifdef FIX_425_MASA_BRSW_RENDERER if ( st_ivas->hDiracDecBin != NULL ) { /* regularization factor is bitrate-dependent */ st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); } -#endif -#ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -1269,7 +1252,6 @@ ivas_error ivas_masa_dec_reconfigure( /*-----------------------------------------------------------------* * Set-up MASA coding elements and bitrates *-----------------------------------------------------------------*/ -#endif ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); @@ -1301,251 +1283,8 @@ ivas_error ivas_masa_dec_reconfigure( #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -/*-------------------------------------------------------------------* - * ivas_spar_param_to_masa_param_mapping() - * - * Determine MASA metadata from the SPAR metadata - *-------------------------------------------------------------------*/ -void ivas_spar_param_to_masa_param_mapping_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - int16_t azimuth[CLDFB_NO_CHANNELS_MAX], - int16_t elevation[CLDFB_NO_CHANNELS_MAX], - float energy_ratio1[CLDFB_NO_CHANNELS_MAX], - float spreadCoherence[CLDFB_NO_CHANNELS_MAX], - float surroundingCoherence[CLDFB_NO_CHANNELS_MAX], - float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ - float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /* i : Input audio in CLDFB domain, imag */ -) -{ - int16_t i, j, sf, band, bin, slot, ch, nBins, nchan_transport; - int16_t mixer_mat_index; - DIRAC_DEC_HANDLE hDirAC; - SPAR_DEC_HANDLE hSpar; - DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; - float mixer_mat_sf_bands_real[SPAR_DIRAC_SPLIT_START_BAND][FOA_CHANNELS][FOA_CHANNELS]; - float mixer_mat_sf_bins_real[CLDFB_NO_CHANNELS_MAX][FOA_CHANNELS][FOA_CHANNELS]; - int16_t *band_grouping; - int16_t band_start, band_end; - float transportSignalEnergies[2][CLDFB_NO_CHANNELS_MAX]; - float transportSignalCrossCorrelation[CLDFB_NO_CHANNELS_MAX]; - float instEne; - float inCovarianceMtx[FOA_CHANNELS][FOA_CHANNELS]; - float foaCovarianceMtx[FOA_CHANNELS][FOA_CHANNELS]; - float Iy, Iz, Ix, E, azi, ele, I, ratio; - float diffuseGainX, diffuseGainY, diffuseGainZ, diffuseGainSum; - int16_t slot_idx_start; - int16_t slot_idx; - float slot_fac; - int16_t subframe_idx; - - - /* Set values */ - hDirAC = st_ivas->hDirAC; - hSpar = st_ivas->hSpar; - hDirAC->numSimultaneousDirections = 1; - hDiffuseDist = st_ivas->hDirAC->hDiffuseDist; - nchan_transport = st_ivas->nchan_transport; - band_grouping = hDirAC->band_grouping; - subframe_idx = hSpar->subframes_rendered; - slot_idx_start = hSpar->slots_rendered; - - /* Init arrays */ - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - set_zero( inCovarianceMtx[i], FOA_CHANNELS ); - } - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bands_real[band][i][j] = 0.0f; - } - } - } - - - slot_fac = 1.0f / (float) hSpar->subframe_nbslots[subframe_idx]; - - /* Delay the SPAR mixing matrices to have them synced with the audio */ - for ( slot_idx = 0; slot_idx < hSpar->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - sf = hSpar->render_to_md_map[slot_idx + slot_idx_start] / JBM_CLDFB_SLOTS_IN_SUBFRAME; - if ( sf < SPAR_META_DELAY_SUBFRAMES ) - { - mixer_mat_index = sf + MAX_PARAM_SPATIAL_SUBFRAMES - SPAR_META_DELAY_SUBFRAMES + 1; - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bands_real[band][i][j] += slot_fac * st_ivas->hSpar->hMdDec->mixer_mat_prev[mixer_mat_index][i][j][band]; - } - } - } - } - else - { - mixer_mat_index = sf - SPAR_META_DELAY_SUBFRAMES; - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bands_real[band][i][j] += slot_fac * st_ivas->hSpar->hMdDec->mixer_mat[i][j][band + mixer_mat_index * IVAS_MAX_NUM_BANDS]; - } - } - } - } - } - - /* Map the mixing matrices from the frequency bands to frequency bins */ - bin = 0; - - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - band_start = band_grouping[band]; - band_end = band_grouping[band + 1]; - for ( bin = band_start; bin < band_end; bin++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bins_real[bin][i][j] = mixer_mat_sf_bands_real[band][i][j]; - } - } - } - } - - nBins = bin; - - - /* Determine MASA metadata */ - - /* Determine transport signal energies and cross correlations when more than 1 TC */ - if ( nchan_transport == 2 ) - { - set_zero( transportSignalEnergies[0], nBins ); - set_zero( transportSignalEnergies[1], nBins ); - set_zero( transportSignalCrossCorrelation, nBins ); - for ( slot = 0; slot < hDirAC->subframe_nbslots[subframe_idx]; slot++ ) - - { - for ( bin = 0; bin < nBins; bin++ ) - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - instEne = ( inRe[ch][slot][bin] * inRe[ch][slot][bin] ); - instEne += ( inIm[ch][slot][bin] * inIm[ch][slot][bin] ); - transportSignalEnergies[ch][bin] += instEne; - } - transportSignalCrossCorrelation[bin] += inRe[0][slot][bin] * inRe[1][slot][bin]; - transportSignalCrossCorrelation[bin] += inIm[0][slot][bin] * inIm[1][slot][bin]; - } - } - } - - if ( hDiffuseDist != NULL ) - { - set_zero( hDiffuseDist->diffuseRatioX, CLDFB_NO_CHANNELS_MAX ); - set_zero( hDiffuseDist->diffuseRatioY, CLDFB_NO_CHANNELS_MAX ); - set_zero( hDiffuseDist->diffuseRatioZ, CLDFB_NO_CHANNELS_MAX ); - } - - for ( bin = 0; bin < nBins; bin++ ) - { - /* Set the energy of the first transport signal */ - if ( nchan_transport == 1 ) - { - inCovarianceMtx[0][0] = 1.0f; /* In case of 1TC, fixed value can be used */ - } - else - { - inCovarianceMtx[0][0] = transportSignalEnergies[0][bin]; /* In case of 2TC, use actual energies */ - } - /* Decorrelated channels assumed to have the same energy as the source channel */ - inCovarianceMtx[1][1] = inCovarianceMtx[0][0]; - inCovarianceMtx[2][2] = inCovarianceMtx[0][0]; - inCovarianceMtx[3][3] = inCovarianceMtx[0][0]; - - /* In case residuals were transmitted, use their actual energies and cross correlations */ - if ( nchan_transport == 2 ) - { - inCovarianceMtx[1][1] = transportSignalEnergies[1][bin]; - inCovarianceMtx[0][1] = transportSignalCrossCorrelation[bin]; - inCovarianceMtx[1][0] = inCovarianceMtx[0][1]; - } - - compute_foa_cov_matrix( foaCovarianceMtx, inCovarianceMtx, mixer_mat_sf_bins_real[bin] ); - - /* Estimate MASA metadata */ - Iy = foaCovarianceMtx[0][1]; /* Intensity in Y direction */ - Iz = foaCovarianceMtx[0][2]; /* Intensity in Z direction */ - Ix = foaCovarianceMtx[0][3]; /* Intensity in X direction */ - I = sqrtf( Ix * Ix + Iy * Iy + Iz * Iz ); /* Intensity vector length */ - E = ( foaCovarianceMtx[0][0] + foaCovarianceMtx[1][1] + foaCovarianceMtx[2][2] + foaCovarianceMtx[3][3] ) / 2.0f; /* Overall energy */ - azi = atan2f( Iy, Ix ); /* Azimuth */ - ele = atan2f( Iz, sqrtf( Ix * Ix + Iy * Iy ) ); /* Elevation */ - ratio = I / fmaxf( 1e-12f, E ); /* Energy ratio */ - ratio = fmaxf( 0.0f, fminf( 1.0f, ratio ) ); - - azimuth[bin] = (int16_t) roundf( azi / PI_OVER_180 ); - elevation[bin] = (int16_t) roundf( ele / PI_OVER_180 ); - energy_ratio1[bin] = ratio; - - spreadCoherence[bin] = 0.0f; - surroundingCoherence[bin] = 0.0f; - - /* Determine directional distribution of the indirect audio based on the SPAR mixing matrices (and the transport audio signals when 2 TC) */ - if ( hDiffuseDist != NULL ) - { - if ( nchan_transport == 1 ) - { - diffuseGainY = fabsf( mixer_mat_sf_bins_real[bin][1][1] ); - diffuseGainX = fabsf( mixer_mat_sf_bins_real[bin][3][2] ); - diffuseGainZ = fabsf( mixer_mat_sf_bins_real[bin][2][3] ); - } - else if ( nchan_transport == 2 ) - { - diffuseGainY = fabsf( mixer_mat_sf_bins_real[bin][1][1] * transportSignalEnergies[1][bin] ); - diffuseGainX = fabsf( mixer_mat_sf_bins_real[bin][3][2] * transportSignalEnergies[0][bin] ) + fabsf( mixer_mat_sf_bins_real[bin][3][1] * transportSignalEnergies[1][bin] ); - diffuseGainZ = fabsf( mixer_mat_sf_bins_real[bin][2][3] * transportSignalEnergies[0][bin] ) + fabsf( mixer_mat_sf_bins_real[bin][2][1] * transportSignalEnergies[1][bin] ); - } - else - { - diffuseGainY = 1.0f; - diffuseGainX = 1.0f; - diffuseGainZ = 1.0f; - } - - diffuseGainSum = diffuseGainY + diffuseGainX + diffuseGainZ; - - if ( diffuseGainSum == 0.0f ) - { - hDiffuseDist->diffuseRatioX[bin] = 1.0f / 3.0f; - hDiffuseDist->diffuseRatioY[bin] = 1.0f / 3.0f; - hDiffuseDist->diffuseRatioZ[bin] = 1.0f / 3.0f; - } - else - { - hDiffuseDist->diffuseRatioX[bin] = diffuseGainX / ( diffuseGainSum + EPSILON ); - hDiffuseDist->diffuseRatioY[bin] = diffuseGainY / ( diffuseGainSum + EPSILON ); - hDiffuseDist->diffuseRatioZ[bin] = diffuseGainZ / ( diffuseGainSum + EPSILON ); - } - } - } - - return; -} -#endif #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS void ivas_spar_param_to_masa_param_mapping( Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ @@ -1813,243 +1552,6 @@ void ivas_spar_param_to_masa_param_mapping( return; } -#else -void ivas_spar_param_to_masa_param_mapping( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ - const int16_t firstSubframe, /* i : First subframe to map */ - const int16_t nSubframes /* i : Number of subframes to map */ -) -{ - int16_t i, j, sf, band, bin, slot, ch, nBins, nchan_transport; - int16_t mixer_mat_index; - int16_t dirac_write_idx; - DIRAC_DEC_HANDLE hDirAC; - DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; - float mixer_mat_sf_bands_real[MAX_PARAM_SPATIAL_SUBFRAMES][SPAR_DIRAC_SPLIT_START_BAND][FOA_CHANNELS][FOA_CHANNELS]; - float mixer_mat_sf_bins_real[MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX][FOA_CHANNELS][FOA_CHANNELS]; - int16_t *band_grouping; - int16_t band_start, band_end; - float transportSignalEnergies[2][CLDFB_NO_CHANNELS_MAX]; - float transportSignalCrossCorrelation[CLDFB_NO_CHANNELS_MAX]; - float instEne; - float inCovarianceMtx[FOA_CHANNELS][FOA_CHANNELS]; - float foaCovarianceMtx[FOA_CHANNELS][FOA_CHANNELS]; - float Iy, Iz, Ix, E, azi, ele, I, ratio; - float diffuseGainX, diffuseGainY, diffuseGainZ, diffuseGainSum; -#ifdef JBM_TSM_ON_TCS - int16_t slot_idx_start; -#endif - - /* Set values */ - hDirAC = st_ivas->hDirAC; - hDirAC->numSimultaneousDirections = 1; - hDiffuseDist = st_ivas->hDirAC->hDiffuseDist; - nchan_transport = st_ivas->nchan_transport; - band_grouping = hDirAC->band_grouping; - dirac_write_idx = hDirAC->dirac_read_idx; /* Mixing matrices, from which MASA meta is determined, already have the delay compensation */ - - /* Init arrays */ - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - set_zero( inCovarianceMtx[i], FOA_CHANNELS ); - } - - /* Delay the SPAR mixing matrices to have them synced with the audio */ - for ( sf = firstSubframe; sf < ( firstSubframe + nSubframes ); sf++ ) - { - if ( sf < SPAR_META_DELAY_SUBFRAMES ) - { - mixer_mat_index = sf + MAX_PARAM_SPATIAL_SUBFRAMES - SPAR_META_DELAY_SUBFRAMES + 1; - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bands_real[sf][band][i][j] = st_ivas->hSpar->hMdDec->mixer_mat_prev[mixer_mat_index][i][j][band]; - } - } - } - } - else - { - mixer_mat_index = sf - SPAR_META_DELAY_SUBFRAMES; - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bands_real[sf][band][i][j] = st_ivas->hSpar->hMdDec->mixer_mat[i][j][band + mixer_mat_index * IVAS_MAX_NUM_BANDS]; - } - } - } - } - } - - /* Map the mixing matrices from the frequency bands to frequency bins */ - bin = 0; - for ( sf = firstSubframe; sf < ( firstSubframe + nSubframes ); sf++ ) - { - for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) - { - band_start = band_grouping[band]; - band_end = band_grouping[band + 1]; - for ( bin = band_start; bin < band_end; bin++ ) - { - for ( i = 0; i < FOA_CHANNELS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - mixer_mat_sf_bins_real[sf][bin][i][j] = mixer_mat_sf_bands_real[sf][band][i][j]; - } - } - } - } - } - nBins = bin; - -#ifdef JBM_TSM_ON_TCS - slot_idx_start = st_ivas->hSpar->slots_rendered; -#endif - - /* Determine MASA metadata */ - for ( sf = firstSubframe; sf < ( firstSubframe + nSubframes ); sf++ ) - { - /* Determine transport signal energies and cross correlations when more than 1 TC */ - if ( nchan_transport == 2 ) - { - set_zero( transportSignalEnergies[0], nBins ); - set_zero( transportSignalEnergies[1], nBins ); - set_zero( transportSignalCrossCorrelation, nBins ); -#ifdef JBM_TSM_ON_TCS - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots[sf]; slot++ ) -#else - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots; slot++ ) -#endif - { -#ifdef JBM_TSM_ON_TCS - int16_t slotThis = slot + slot_idx_start; -#else - int16_t slotThis = slot + ( hDirAC->subframe_nbslots * sf ); -#endif - - for ( bin = 0; bin < nBins; bin++ ) - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - instEne = ( inRe[ch][slotThis][bin] * inRe[ch][slotThis][bin] ); - instEne += ( inIm[ch][slotThis][bin] * inIm[ch][slotThis][bin] ); - transportSignalEnergies[ch][bin] += instEne; - } - transportSignalCrossCorrelation[bin] += inRe[0][slotThis][bin] * inRe[1][slotThis][bin]; - transportSignalCrossCorrelation[bin] += inIm[0][slotThis][bin] * inIm[1][slotThis][bin]; - } - } - } - - if ( hDiffuseDist != NULL ) - { - set_zero( hDiffuseDist->diffuseRatioX[sf], CLDFB_NO_CHANNELS_MAX ); - set_zero( hDiffuseDist->diffuseRatioY[sf], CLDFB_NO_CHANNELS_MAX ); - set_zero( hDiffuseDist->diffuseRatioZ[sf], CLDFB_NO_CHANNELS_MAX ); - } - - for ( bin = 0; bin < nBins; bin++ ) - { - /* Set the energy of the first transport signal */ - if ( nchan_transport == 1 ) - { - inCovarianceMtx[0][0] = 1.0f; /* In case of 1TC, fixed value can be used */ - } - else - { - inCovarianceMtx[0][0] = transportSignalEnergies[0][bin]; /* In case of 2TC, use actual energies */ - } - /* Decorrelated channels assumed to have the same energy as the source channel */ - inCovarianceMtx[1][1] = inCovarianceMtx[0][0]; - inCovarianceMtx[2][2] = inCovarianceMtx[0][0]; - inCovarianceMtx[3][3] = inCovarianceMtx[0][0]; - - /* In case residuals were transmitted, use their actual energies and cross correlations */ - if ( nchan_transport == 2 ) - { - inCovarianceMtx[1][1] = transportSignalEnergies[1][bin]; - inCovarianceMtx[0][1] = transportSignalCrossCorrelation[bin]; - inCovarianceMtx[1][0] = inCovarianceMtx[0][1]; - } - - compute_foa_cov_matrix( foaCovarianceMtx, inCovarianceMtx, mixer_mat_sf_bins_real[sf][bin] ); - - /* Estimate MASA metadata */ - Iy = foaCovarianceMtx[0][1]; /* Intensity in Y direction */ - Iz = foaCovarianceMtx[0][2]; /* Intensity in Z direction */ - Ix = foaCovarianceMtx[0][3]; /* Intensity in X direction */ - I = sqrtf( Ix * Ix + Iy * Iy + Iz * Iz ); /* Intensity vector length */ - E = ( foaCovarianceMtx[0][0] + foaCovarianceMtx[1][1] + foaCovarianceMtx[2][2] + foaCovarianceMtx[3][3] ) / 2.0f; /* Overall energy */ - azi = atan2f( Iy, Ix ); /* Azimuth */ - ele = atan2f( Iz, sqrtf( Ix * Ix + Iy * Iy ) ); /* Elevation */ - ratio = I / fmaxf( 1e-12f, E ); /* Energy ratio */ - ratio = fmaxf( 0.0f, fminf( 1.0f, ratio ) ); - - hDirAC->azimuth[dirac_write_idx][bin] = (int16_t) roundf( azi / PI_OVER_180 ); - hDirAC->elevation[dirac_write_idx][bin] = (int16_t) roundf( ele / PI_OVER_180 ); - hDirAC->energy_ratio1[dirac_write_idx][bin] = ratio; - hDirAC->diffuseness_vector[dirac_write_idx][bin] = 1.0f - ratio; - - hDirAC->spreadCoherence[dirac_write_idx][bin] = 0.0f; - hDirAC->surroundingCoherence[dirac_write_idx][bin] = 0.0f; - - /* Determine directional distribution of the indirect audio based on the SPAR mixing matrices (and the transport audio signals when 2 TC) */ - if ( hDiffuseDist != NULL ) - { - if ( nchan_transport == 1 ) - { - diffuseGainY = fabsf( mixer_mat_sf_bins_real[sf][bin][1][1] ); - diffuseGainX = fabsf( mixer_mat_sf_bins_real[sf][bin][3][2] ); - diffuseGainZ = fabsf( mixer_mat_sf_bins_real[sf][bin][2][3] ); - } - else if ( nchan_transport == 2 ) - { - diffuseGainY = fabsf( mixer_mat_sf_bins_real[sf][bin][1][1] * transportSignalEnergies[1][bin] ); - diffuseGainX = fabsf( mixer_mat_sf_bins_real[sf][bin][3][2] * transportSignalEnergies[0][bin] ) + fabsf( mixer_mat_sf_bins_real[sf][bin][3][1] * transportSignalEnergies[1][bin] ); - diffuseGainZ = fabsf( mixer_mat_sf_bins_real[sf][bin][2][3] * transportSignalEnergies[0][bin] ) + fabsf( mixer_mat_sf_bins_real[sf][bin][2][1] * transportSignalEnergies[1][bin] ); - } - else - { - diffuseGainY = 1.0f; - diffuseGainX = 1.0f; - diffuseGainZ = 1.0f; - } - - diffuseGainSum = diffuseGainY + diffuseGainX + diffuseGainZ; - - if ( diffuseGainSum == 0.0f ) - { - hDiffuseDist->diffuseRatioX[sf][bin] = 1.0f / 3.0f; - hDiffuseDist->diffuseRatioY[sf][bin] = 1.0f / 3.0f; - hDiffuseDist->diffuseRatioZ[sf][bin] = 1.0f / 3.0f; - } - else - { - hDiffuseDist->diffuseRatioX[sf][bin] = diffuseGainX / ( diffuseGainSum + EPSILON ); - hDiffuseDist->diffuseRatioY[sf][bin] = diffuseGainY / ( diffuseGainSum + EPSILON ); - hDiffuseDist->diffuseRatioZ[sf][bin] = diffuseGainZ / ( diffuseGainSum + EPSILON ); - } - } - } - - dirac_write_idx = ( dirac_write_idx + 1 ) % hDirAC->dirac_md_buffer_length; -#ifdef JBM_TSM_ON_TCS - slot_idx_start += st_ivas->hSpar->subframe_nbslots[sf]; -#endif - } - - return; -} -#endif /* Estimate FOA properties: foaCov = mixMtx * inCov * mixMtx' */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index d19e2d33ccb1ab0ff5254d1a3b7dcbd48b23adc1..c6e0776660877f0faf0577fb3e5583cf268e5d48 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1397,9 +1397,7 @@ void ivas_param_mc_dec_read_BS( hMetadataPMC->bAttackPresent = 0; hMetadataPMC->attackIndex = 0; #ifndef JBM_TSM_ON_TCS -#ifdef FIX_431_PARAMMC_PLC_INTERPOLATOR ivas_param_mc_dec_compute_interpolator( hMetadataPMC->bAttackPresent, hMetadataPMC->attackIndex, PARAM_MC_MAX_NSLOTS, hParamMC->h_output_synthesis_params.interpolator ); -#endif #endif } diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 5b04578c847968d22a119522445036163d286d96..346868ab6a4686978faf188fd65dbad3f220c634 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -49,7 +49,6 @@ #include "wmc_auto.h" #include "rom_dec.h" -#ifdef MC_PARAMUPMIX_MODE /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ @@ -692,5 +691,3 @@ static void get_ec_data( dequant_beta( nParBand, parBandStart, quant_type, alphaQEnv, parQ, ab ); } } - -#endif diff --git a/lib_dec/ivas_mcmasa_dec.c b/lib_dec/ivas_mcmasa_dec.c index 59d215e22ca4abfb1e784903fc1bc055efe51da6..99b3ff68744b0daf4e3460cd3c9ab3b764ad6bc3 100755 --- a/lib_dec/ivas_mcmasa_dec.c +++ b/lib_dec/ivas_mcmasa_dec.c @@ -131,7 +131,6 @@ ivas_error ivas_mcmasa_dec_reconfig( } else { -#ifdef FIX_417_TD_DECORR_BRATE_SW /* if necessary, close/open td-decorrs */ 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 ) { @@ -140,18 +139,6 @@ ivas_error ivas_mcmasa_dec_reconfig( /* regularization factor is bitrate-dependent */ st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); -#else - /* the decision for useTdDecorr is done in ivas_dirac_dec_init_binaural_data(). here, comparing against the same condition. */ - if ( st_ivas->hDiracDecBin->useTdDecorr != ( ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) ) - { - /* st_ivas->hDiracDecBin->useTdDecorr will change => close and re-open. */ - ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 19a0909461a40f3649436dec3bba5a52bb178bf4..6eada0e18b3912579410cf73cf7600bc67c8bf07 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -277,11 +277,7 @@ ivas_error ivas_mct_dec( #endif } /* move channels after LFE to correct output for multi-channel MCT */ -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#else - if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) -#endif { float tmp[L_FRAME48k]; @@ -352,12 +348,10 @@ ivas_error create_mct_dec( { hMCT->nchan_out_woLFE = st_ivas->nchan_transport - st_ivas->hTransSetup.num_lfe; } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { hMCT->nchan_out_woLFE = st_ivas->nchan_transport - st_ivas->hTransSetup.num_lfe; } -#endif else { assert( !"IVAS format currently not supported for MCT" ); @@ -463,12 +457,10 @@ ivas_error mct_dec_reconfigure( { hMCT->nchan_out_woLFE = st_ivas->nchan_transport - st_ivas->hTransSetup.num_lfe; } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { hMCT->nchan_out_woLFE = st_ivas->nchan_transport - st_ivas->hTransSetup.num_lfe; } -#endif else { assert( !"IVAS format currently not supported for MCT" ); @@ -816,17 +808,11 @@ static ivas_error ivas_mc_dec_reconfig( ivas_ls_setup_conversion_close( &st_ivas->hLsSetUpConversion ); } -#ifdef MC_PARAMUPMIX_MODE -#ifdef FIX_469_BRSWITCH_PUPMIX if ( last_mc_mode == MC_MODE_PARAMUPMIX ) { ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) ); ivas_ls_setup_conversion_close( &( st_ivas->hLsSetUpConversion ) ); } -#else - ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) ); -#endif -#endif /* De-allocate McMasa-related handles */ ivas_masa_dec_close( &( st_ivas->hMasa ) ); ivas_qmetadata_close( &st_ivas->hQMetaData ); @@ -849,7 +835,6 @@ static ivas_error ivas_mc_dec_reconfig( } } } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { st_ivas->nSCE = 0; @@ -890,7 +875,6 @@ static ivas_error ivas_mc_dec_reconfig( assert( 0 ); } } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { if ( last_mc_mode != MC_MODE_PARAMMC ) @@ -962,9 +946,7 @@ static ivas_error ivas_mc_dec_reconfig( ivas_ls_setup_conversion_close( &st_ivas->hLsSetUpConversion ); } -#ifdef MC_PARAMUPMIX_MODE ivas_mc_paramupmix_dec_close( &( st_ivas->hMCParamUpmix ) ); -#endif if ( st_ivas->hParamMC != NULL ) { @@ -1059,13 +1041,11 @@ static ivas_error ivas_mc_dec_reconfig( new_brate_SCE = 0; new_brate_CPE = ( ivas_total_brate / ( st_ivas->nchan_transport - 1 ) ) * CPE_CHANNELS; } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { new_brate_SCE = 0; new_brate_CPE = ( ivas_total_brate / ( st_ivas->nchan_transport - 1 ) ) * CPE_CHANNELS; } -#endif else { new_brate_SCE = 0; /* ivas_total_brate / st_ivas->nchan_transport;*/ @@ -1103,24 +1083,10 @@ static ivas_error ivas_mc_dec_reconfig( } -#ifndef FIX_417_TD_DECORR_BRATE_SW - /*-----------------------------------------------------------------* - * CLDFB instances - *-----------------------------------------------------------------*/ - - if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /*-----------------------------------------------------------------* * Allocate the LFE handle that is coded seperately after the allocation of the core coders *-----------------------------------------------------------------*/ -#ifdef MC_PARAMUPMIX_MODE if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCT && st_ivas->hLFE == NULL ) -#endif { int32_t binauralization_delay_ns = st_ivas->binaural_latency_ns; if ( st_ivas->hBinRenderer != NULL ) @@ -1304,7 +1270,6 @@ static ivas_error ivas_mc_dec_reconfig( #endif } -#ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -1325,7 +1290,6 @@ static ivas_error ivas_mc_dec_reconfig( { return error; } -#endif #ifdef JBM_TSM_ON_TCS /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 81a8dda3549bc069ea6bdde12056d5338b63b9c0..becf11e070428610fdc436ab17ac3a884021c195 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -35,9 +35,7 @@ #include "options.h" #include "prot.h" #include "rom_com.h" -#ifdef SNS_MSVQ #include "ivas_rom_com.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -371,7 +369,6 @@ void ivas_mdct_dec_side_bits_frame_channel( * SNS parameters *--------------------------------------------------------------------------------*/ -#ifdef SNS_MSVQ sns_low_br_mode = 0; skipped_first_channel = 0; if ( !MCT_flag && sts[0]->sr_core == 25600 && ( ( hCPE->element_brate == IVAS_48k || hCPE->element_brate == IVAS_64k ) ) ) @@ -470,44 +467,6 @@ void ivas_mdct_dec_side_bits_frame_channel( st->side_bits_frame_channel += st0->next_bit_pos - start_bit_pos_sns; } } -#else - skipped_first_channel = 0; - sns_low_br_mode = 0; - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - st = sts[ch]; - - if ( st->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) - { - skipped_first_channel = 1; - continue; - } - - start_bit_pos_sns = st0->next_bit_pos; - - if ( ch == 0 || skipped_first_channel ) - { - /* read SNS stereo mode */ - param_lpc[0][0] = get_next_indice( st0, 1 ) << 1; - - /* read low br mode flag (if it is possible to be non-zero) */ - if ( sts[0]->element_brate == IVAS_48k && !( ( sts[0]->core == TCX_20 && sts[1]->core == TCX_20 ) ) ) - { - sns_low_br_mode = get_next_indice( st0, 1 ); - } - } - - tmp = ch; - if ( ch == 1 && param_lpc[0][0] == 2 ) - { - tmp = 3; - } - - getLPCparam( st, ¶m_lpc[ch][0], st0, tmp, sns_low_br_mode && !( sts[0]->core == TCX_20 && sts[1]->core == TCX_20 ) ); - - st->side_bits_frame_channel += st0->next_bit_pos - start_bit_pos_sns; - } -#endif // SNS_MSVQ } return; @@ -543,11 +502,7 @@ void ivas_mdct_core_invQ( int16_t *prm[CPE_CHANNELS]; /* LPC */ Word16 Aind[CPE_CHANNELS][M + 1]; -#ifdef SNS_MSVQ float sns[CPE_CHANNELS][NB_DIV][M]; -#else - float lsf[CPE_CHANNELS][( NB_DIV + 1 ) * M]; -#endif /* TCX */ float xn_buf[L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX]; int16_t tcx_offset[CPE_CHANNELS]; @@ -714,7 +669,6 @@ void ivas_mdct_core_invQ( * LPC PARAMETERS *--------------------------------------------------------------------------------*/ -#ifdef SNS_MSVQ if ( bfi == 0 ) { if ( !MCT_flag && sts[0]->sr_core == 25600 && ( ( hCPE->element_brate == IVAS_48k || hCPE->element_brate == IVAS_64k ) ) ) @@ -725,11 +679,7 @@ void ivas_mdct_core_invQ( { if ( sts[0]->core == TCX_20_CORE && sts[1]->core == TCX_20_CORE && sts[0]->mct_chan_mode != MCT_CHAN_MODE_IGNORE && sts[1]->mct_chan_mode != MCT_CHAN_MODE_IGNORE ) { -#ifdef FIX_445_SNS_BUGFIXES sns_avq_dec_stereo( param_lpc[0], param_lpc[1], sts[0]->L_frame, &sns[0][0][0], &sns[1][0][0] ); -#else - sns_avq_dec_stereo( param_lpc[0], param_lpc[1], &sns[0][0][0], &sns[1][0][0] ); -#endif } else { @@ -738,44 +688,12 @@ void ivas_mdct_core_invQ( st = sts[ch]; if ( st->mct_chan_mode != MCT_CHAN_MODE_IGNORE ) { -#ifdef FIX_445_SNS_BUGFIXES sns_avq_dec( param_lpc[ch], sns[ch], st->L_frame, st->numlpc ); -#else - sns_avq_dec( param_lpc[ch], sns[ch], st->numlpc ); -#endif } } } } } -#else - if ( bfi == 0 ) - { - if ( sts[0]->core == TCX_20_CORE && sts[1]->core == TCX_20_CORE && sts[0]->mct_chan_mode != MCT_CHAN_MODE_IGNORE && sts[1]->mct_chan_mode != MCT_CHAN_MODE_IGNORE ) - { -#ifdef FIX_445_SNS_BUGFIXES - sns_avq_dec_stereo( param_lpc[0], param_lpc[1], sts[0]->L_frame, &lsf[0][M], &lsf[1][M] ); -#else - sns_avq_dec_stereo( param_lpc[0], param_lpc[1], &lsf[0][M], &lsf[1][M] ); -#endif - } - else - { - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - st = sts[ch]; - if ( st->mct_chan_mode != MCT_CHAN_MODE_IGNORE ) - { -#ifdef FIX_445_SNS_BUGFIXES - sns_avq_dec( param_lpc[ch], &lsf[ch][M], st->L_frame, st->numlpc ); -#else - sns_avq_dec( param_lpc[ch], &lsf[ch][M], st->numlpc ); -#endif - } - } - } - } -#endif /*--------------------------------------------------------------* @@ -820,11 +738,7 @@ void ivas_mdct_core_invQ( /* Stability Factor */ if ( !bfi ) { -#ifdef SNS_MSVQ mvr2r( sns[ch][k], &Aq[ch][k * M], M ); -#else - mvr2r( &lsf[ch][( k + 1 ) * M], &Aq[ch][k * M], M ); -#endif } else { diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index 3f95113f604f8249e1034492dfe1c92fb926645c..131f07090cd0386c986910002fa8b1d51dbe8800 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -312,7 +312,6 @@ ivas_error ivas_ls_setup_conversion_open( int16_t output_frame; int32_t output_Fs; int16_t nchan_out; -#ifdef MC_PARAMUPMIX_MODE int16_t paramUpmixMonoStereo; if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) @@ -323,7 +322,6 @@ ivas_error ivas_ls_setup_conversion_open( { paramUpmixMonoStereo = FALSE; } -#endif output_Fs = st_ivas->hDecoderConfig->output_Fs; nchan_out = st_ivas->hDecoderConfig->nchan_out; output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); @@ -362,7 +360,6 @@ ivas_error ivas_ls_setup_conversion_open( } else { -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { if ( paramUpmixMonoStereo == TRUE ) @@ -378,9 +375,6 @@ ivas_error ivas_ls_setup_conversion_open( { inChannels = st_ivas->nchan_transport; } -#else - inChannels = st_ivas->nchan_transport; -#endif /*Initialization of MDCT bands with TCX20 resolution */ ivas_lssetupconversion_mdct_init_bands( output_frame, TCX_20_CORE, &hLsSetUpConversion->sfbOffset[0], &hLsSetUpConversion->sfbCnt ); @@ -427,7 +421,6 @@ ivas_error ivas_ls_setup_conversion_open( { if ( st_ivas->transport_config != AUDIO_CONFIG_INVALID ) { -#ifdef MC_PARAMUPMIX_MODE if ( paramUpmixMonoStereo == TRUE ) { get_ls_conversion_matrix( hLsSetUpConversion, AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); @@ -436,9 +429,6 @@ ivas_error ivas_ls_setup_conversion_open( { get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); -#endif } else { @@ -505,10 +495,8 @@ void ivas_ls_setup_conversion_close( *-------------------------------------------------------------------------*/ void ivas_ls_setup_conversion( - Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ -#ifdef MC_PARAMUPMIX_MODE - const int16_t input_chans, /* i : number of input channels to the renderer */ -#endif + Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ + const int16_t input_chans, /* i : number of input channels to the renderer */ const int16_t output_frame, /* i : frame length */ #ifdef JBM_TSM_ON_TCS float *input[], /* i : LS input/output synthesis signal */ @@ -530,11 +518,7 @@ void ivas_ls_setup_conversion( for ( chOutIdx = 0; chOutIdx < st_ivas->hDecoderConfig->nchan_out; chOutIdx++ ) { set_zero( output_tmp[chOutIdx], output_frame ); -#ifdef MC_PARAMUPMIX_MODE for ( chInIdx = 0; chInIdx < input_chans; chInIdx++ ) -#else - for ( chInIdx = 0; chInIdx < st_ivas->nchan_transport; chInIdx++ ) -#endif { dmxCoeff = hLsSetUpConversion->dmxMtx[chInIdx][chOutIdx]; diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 4092142a9a1b9b5606c9723e325bd70edcbefdf2..e1c2621ea81fbecaa9a1c157a6c37c0467ddb156 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -152,12 +152,8 @@ void ivas_renderer_select( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); if ( nchan_internal == 2 ) { st_ivas->hHeadTrackData->shd_rot_max_order = 1; @@ -195,29 +191,17 @@ void ivas_renderer_select( *internal_config = transport_config; if ( output_config == AUDIO_CONFIG_BINAURAL ) { -#ifdef MC_PARAMUPMIX_MODE #ifdef DEBUGGING if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && st_ivas->hDecoderConfig->Opt_Headrotation ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) #else if ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && st_ivas->hDecoderConfig->Opt_Headrotation && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#endif -#else -#ifdef DEBUGGING - if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && st_ivas->hDecoderConfig->Opt_Headrotation ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) -#else - if ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && st_ivas->hDecoderConfig->Opt_Headrotation && ( st_ivas->mc_mode == MC_MODE_MCT ) ) -#endif #endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; } else { -#ifdef MC_PARAMUPMIX_MODE if ( ( st_ivas->mc_mode == MC_MODE_MCT ) || ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCT ) -#endif { *renderer_type = RENDERER_BINAURAL_MIXER_CONV; } @@ -245,11 +229,7 @@ void ivas_renderer_select( } else /* AUDIO_CONFIG_BINAURAL_ROOM */ { -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCT ) -#endif { *renderer_type = RENDERER_BINAURAL_MIXER_CONV_ROOM; } @@ -276,7 +256,6 @@ void ivas_renderer_select( * Non-binaural rendering configurations *-----------------------------------------------------------------*/ -#ifdef NON_DIEGETIC_PAN else if ( st_ivas->ivas_format == MONO_FORMAT ) { if ( output_config == AUDIO_CONFIG_STEREO ) @@ -284,7 +263,6 @@ void ivas_renderer_select( *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } } -#endif else if ( st_ivas->ivas_format == STEREO_FORMAT ) { if ( output_config != AUDIO_CONFIG_STEREO && output_config != AUDIO_CONFIG_MONO ) @@ -294,14 +272,12 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == ISM_FORMAT ) { -#ifdef NON_DIEGETIC_PAN if ( ( output_config == AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } else { -#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { *renderer_type = RENDERER_PARAM_ISM; @@ -335,9 +311,7 @@ void ivas_renderer_select( *renderer_type = RENDERER_DISABLE; } } -#ifdef NON_DIEGETIC_PAN } -#endif } else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) { @@ -396,7 +370,6 @@ void ivas_renderer_select( *renderer_type = RENDERER_SBA_LINEAR_ENC; } } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { *internal_config = transport_config; @@ -412,7 +385,6 @@ void ivas_renderer_select( } } } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 5480f73a33538aefb9ee7974e07342b04bccc430..a6fe0c0b7456ceeaa512812df5be17e22ac23670 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -139,10 +139,8 @@ int16_t ivas_qmetadata_dec_decode( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: hQMetaData handle */ uint16_t *bitstream, /* i : bitstream */ int16_t *index /* i/o: bitstream position */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ -#endif ) { int16_t d, b, m; @@ -230,7 +228,6 @@ int16_t ivas_qmetadata_dec_decode( bits_diff_sum = 0; bits_diff_sum += ivas_qmetadata_entropy_decode_diffuseness( bitstream, index, &( hQMetaData->q_direction[0] ), &diffuseness_index_max_ec_frame_pre[0] ); -#ifdef HODIRAC if ( hodirac_flag ) { if ( hQMetaData->no_directions == 2 ) @@ -250,7 +247,6 @@ int16_t ivas_qmetadata_dec_decode( } } else -#endif { if ( hQMetaData->no_directions == 2 ) { @@ -282,7 +278,6 @@ int16_t ivas_qmetadata_dec_decode( diffRatio = diffuseness_reconstructions[hQMetaData->q_direction[0].band_data[b].energy_ratio_index[0]]; dfRatio_qsteps = 1 << dfRatio_bits[dir2band]; -#ifdef HODIRAC /* already encoded as total and ratios in HO-DirAC */ if ( hodirac_flag ) { @@ -291,7 +286,6 @@ int16_t ivas_qmetadata_dec_decode( dir2ratio = dfRatio; } else -#endif { dfRatio = usdequant( hQMetaData->q_direction[1].band_data[dir2band].energy_ratio_index[0], 0.5f, 0.5f / ( dfRatio_qsteps - 1 ) ); @@ -302,14 +296,12 @@ int16_t ivas_qmetadata_dec_decode( /* Requantize the 1 - dirRatio separately for each direction to obtain inverted dirRatio index. These are used in further decoding. */ hQMetaData->q_direction[0].band_data[b].energy_ratio_index[0] = masa_sq( 1.0f - dir1ratio, diffuseness_thresholds, DIRAC_DIFFUSE_LEVELS ); -#ifdef HODIRAC if ( hodirac_flag ) { float tmp; hQMetaData->q_direction[1].band_data[dir2band].energy_ratio_index[0] = usquant( dir2ratio, &tmp, 0.0f, 1.f / ( DIRAC_DIFFUSE_LEVELS - 1 ), DIRAC_DIFFUSE_LEVELS ); } else -#endif { hQMetaData->q_direction[1].band_data[dir2band].energy_ratio_index[0] = masa_sq( 1.0f - dir2ratio, diffuseness_thresholds, DIRAC_DIFFUSE_LEVELS ); } @@ -368,12 +360,8 @@ int16_t ivas_qmetadata_dec_decode( index_dirRatio1Inv = hQMetaData->q_direction[0].band_data[b].energy_ratio_index[0]; index_dirRatio2Inv = hQMetaData->q_direction[1].band_data[dir2band].energy_ratio_index[0]; - masa_compensate_two_dir_energy_ratio_index( index_dirRatio1Inv, index_dirRatio2Inv, &index_dirRatio1Inv_mod, &index_dirRatio2Inv_mod -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + masa_compensate_two_dir_energy_ratio_index( index_dirRatio1Inv, index_dirRatio2Inv, &index_dirRatio1Inv_mod, &index_dirRatio2Inv_mod, + hodirac_flag ); for ( m = 0; m < hQMetaData->q_direction[0].cfg.nblocks; m++ ) { @@ -764,9 +752,7 @@ int16_t ivas_qmetadata_dec_decode( } /* Scale energy ratios that sum to over one */ -#ifdef HODIRAC if ( !hodirac_flag ) -#endif { for ( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ ) { diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index 16298dfe980c2f68e746765e91fce88411d0fd31..6a33a36aaa072eb8fb15cf98c29159072bd55bcd 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -226,11 +226,7 @@ const float dft_win_8k[70] = * stereo CNA tables *------------------------------------------------------------------------*/ -#ifdef FIX_I414_OOA_CNA const int16_t cna_init_bands[CNA_INIT_NBANDS + 1] = -#else -const int16_t cna_init_bands[MAX_CNA_NBANDS + 1] = -#endif { 1, 4, 14, 33, 67, 171, 320 }; @@ -524,7 +520,6 @@ const float ap_split_frequencies[DIRAC_DECORR_NUM_SPLIT_BANDS + 1] = 0.0f, 0.125f, 0.375f, 1.0f }; -#ifdef HODIRAC const int16_t sba_map_tc[11] = { 0, 1, 2, 3, 4, 8, 9, 15, 5, 6, 7 @@ -533,12 +528,6 @@ const int16_t sba_map_tc_512[11] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15 }; -#else -const int16_t sba_map_tc[8] = -{ - 0, 1, 2, 3, 4, 8, 9, 15 -}; -#endif /*----------------------------------------------------------------------------------* @@ -554,7 +543,6 @@ const float dmxmtx_table[BINAURAL_CHANNELS][11] = /* clang-format on */ -#ifdef MC_PARAMUPMIX_MODE const int16_t huff_nodes_first_band_alpha[32][2] = { /* Alpha Fine Huffman table df0 */ { -17, 1 }, @@ -841,5 +829,3 @@ HUFF_NODE_TABLE huff_nodes_dt = { { huff_nodes_alpha_1D_DT, huff_nodes_alpha_1D_DT_coarse }, { huff_nodes_beta_1D_DT, huff_nodes_beta_1D_DT_coarse } }; - -#endif diff --git a/lib_dec/ivas_rom_dec.h b/lib_dec/ivas_rom_dec.h index 05211fa94e119e07a1d06a9917350065ed926065..7a19f170c0b00f12d5050d4224dcd05cc7960b98 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -68,11 +68,7 @@ extern const float dft_win232ms_48k[450]; extern const float dft_win_8k[70]; -#ifdef FIX_I414_OOA_CNA extern const int16_t cna_init_bands[CNA_INIT_NBANDS + 1]; -#else -extern const int16_t cna_init_bands[MAX_CNA_NBANDS + 1]; -#endif extern const float min_smooth_gains1[SBA_DIRAC_STEREO_NUM_BANDS]; extern const float max_smooth_gains1[SBA_DIRAC_STEREO_NUM_BANDS]; @@ -115,12 +111,8 @@ extern const float ap_lattice_coeffs_3[DIRAC_DECORR_FILTER_LEN_3 * DIRAC_MAX_NUM extern const float *const ap_lattice_coeffs[DIRAC_DECORR_NUM_SPLIT_BANDS]; extern const float ap_split_frequencies[DIRAC_DECORR_NUM_SPLIT_BANDS + 1]; -#ifdef HODIRAC extern const int16_t sba_map_tc[11]; extern const int16_t sba_map_tc_512[11]; -#else -extern const int16_t sba_map_tc[8]; -#endif /*----------------------------------------------------------------------------------* * FASTCONV and PARAMETRIC binaural renderer ROM tables @@ -129,7 +121,6 @@ extern const int16_t sba_map_tc[8]; extern const float dmxmtx_table[BINAURAL_CHANNELS][11]; -#ifdef MC_PARAMUPMIX_MODE extern const int16_t huff_nodes_first_band_alpha[32][2]; extern const int16_t huff_nodes_first_band_alpha_coarse[16][2]; @@ -151,6 +142,5 @@ extern const int16_t huff_nodes_beta_1D_DT_coarse[8][2]; extern const HUFF_NODE_TABLE huff_nodes_df0; extern const HUFF_NODE_TABLE huff_nodes_df; extern const HUFF_NODE_TABLE huff_nodes_dt; -#endif #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c old mode 100755 new mode 100644 index 0dcaec91da54020113ede586536eb13f1da1d064..ac8bb23541e85f11e8a6d506396d3f512ab4ef98 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -109,9 +109,7 @@ ivas_error ivas_sba_dec_reconfigure( int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; int16_t sba_dirac_stereo_flag_old; int32_t ivas_total_brate; -#ifdef HODIRAC int32_t last_ivas_total_brate; -#endif RENDERER_TYPE old_renderer_type; @@ -121,9 +119,7 @@ ivas_error ivas_sba_dec_reconfigure( hDecoderConfig = st_ivas->hDecoderConfig; ivas_total_brate = hDecoderConfig->ivas_total_brate; -#ifdef HODIRAC last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; -#endif /*-----------------------------------------------------------------* * Set SBA high-level parameters @@ -174,11 +170,7 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } - if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) -#ifdef HODIRAC - || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) -#endif - ) + if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) { ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); @@ -273,11 +265,7 @@ ivas_error ivas_sba_dec_reconfigure( ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); } - if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) -#ifdef HODIRAC - || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) -#endif - ) + if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) ) { DIRAC_CONFIG_FLAG flag_config; @@ -310,11 +298,7 @@ ivas_error ivas_sba_dec_reconfigure( ivas_total_brate, st_ivas->sba_analysis_order, st_ivas->sba_mode, -#ifdef HODIRAC ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) -#else - IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND -#endif ) ) != IVAS_ERR_OK ) { @@ -352,7 +336,6 @@ ivas_error ivas_sba_dec_reconfigure( return error; } -#ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -364,7 +347,6 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } -#endif /*-----------------------------------------------------------------* * CLDFB instances @@ -400,12 +382,8 @@ ivas_error ivas_sba_dec_reconfigure( } else if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { - tc_nchan_to_allocate = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + tc_nchan_to_allocate = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); } else { @@ -497,12 +475,8 @@ void ivas_sba_dec_render( float *output_f_local[MAX_OUTPUT_CHANNELS]; hSpar = st_ivas->hSpar; - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; #ifdef DEBUGGING assert( hSpar ); diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 6d71f1f8b8e9d1ae738d5659cd9f9313edcc9130..71a5718436251a496db1f5644969f05c6c1a7c6c 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -438,12 +438,8 @@ void ivas_sba_upmixer_renderer( push_wmops( "ivas_sba_upmixer_renderer" ); - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); #ifndef JBM_TSM_ON_TCS if ( st_ivas->nchan_transport >= 3 ) @@ -690,12 +686,8 @@ void ivas_sba_mix_matrix_determiner( /* Mixing matrix determiner */ num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; - ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, bfi -#ifdef HODIRAC - , - MAX_PARAM_SPATIAL_SUBFRAMES -#endif - ); + ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, bfi, + MAX_PARAM_SPATIAL_SUBFRAMES ); return; } diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 9a940b9b6da17e326145e2d9ba39c49e63931ff1..97a9b8189561c02b52568353f64d4d0cde103382 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -92,18 +92,12 @@ ivas_error ivas_sce_dec( st->total_brate = ivas_total_brate - nb_bits_metadata * FRAMES_PER_SEC; assert( st->total_brate == SID_2k40 && "SCE SID must be 2.4kbps!" ); -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->hISMDTX.sce_id_dtx != sce_id ) { st->total_brate = FRAME_NO_DATA; } -#endif } -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT else if ( !st_ivas->bfi && ivas_total_brate == FRAME_NO_DATA ) -#else - else if ( !st_ivas->bfi && ivas_total_brate <= SID_2k40 ) -#endif { st->total_brate = FRAME_NO_DATA; } @@ -181,18 +175,12 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate - nb_bits_metadata * FRAMES_PER_SEC; -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->hISMDTX.sce_id_dtx != sce_id ) { st->total_brate = FRAME_NO_DATA; } -#endif } -#ifdef FIX_ISM_DTX_CNG_BWIDTH_ALT else if ( !st_ivas->bfi && ivas_total_brate == FRAME_NO_DATA ) -#else - else if ( !st_ivas->bfi && ivas_total_brate <= SID_2k40 ) -#endif { st->total_brate = ivas_total_brate; } diff --git a/lib_dec/ivas_sns_dec.c b/lib_dec/ivas_sns_dec.c index 4812091ecc5aff53331660c12bb35f2d2f38b112..e11551d2a603439892d7d0589a20ffebe908d8d7 100644 --- a/lib_dec/ivas_sns_dec.c +++ b/lib_dec/ivas_sns_dec.c @@ -35,13 +35,9 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#ifdef SNS_MSVQ #include "ivas_rom_com.h" #include "ivas_cnst.h" -#endif -#ifdef FIX_445_SNS_BUGFIXES #include -#endif #include "wmc_auto.h" /*------------------------------------------------------------------- @@ -52,15 +48,12 @@ static void sns_1st_dec( const int16_t index, /* i : codebook index */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t core, const int16_t L_frame, -#endif float *snsq /* i/o: i:prediction o:quantized sns */ ) { int16_t i; -#ifdef FIX_445_SNS_BUGFIXES const int16_t *p_dico, *means; const float cdbk_fix2float = 1.f / powf( 2, SNS_CDBKS_BITS_4_FRAC ); const float means_fix2float = 1.f / powf( 2, SNS_MEANS_BITS_4_FRAC ); @@ -81,38 +74,19 @@ static void sns_1st_dec( assert( !"illegal frame length in sns_1st_cod" ); } -#else - const float *p_dico; -#endif -#ifdef FIX_445_SNS_BUGFIXES p_dico = &sns_1st_cdbk[0][core - 1][0] + ( index % 32 ) * ( M / 2 ); -#else - p_dico = &sns_vq_cdk1[( index % 32 ) * ( M / 2 )]; -#endif for ( i = 0; i < M / 2; i++ ) { -#ifdef FIX_445_SNS_BUGFIXES snsq[i] = ( *p_dico++ ) * cdbk_fix2float + means[i] * means_fix2float; -#else - snsq[i] = *p_dico++; -#endif } -#ifdef FIX_445_SNS_BUGFIXES p_dico = &sns_1st_cdbk[1][core - 1][0] + ( index >> 5 ) * ( M / 2 ); -#else - p_dico = &sns_vq_cdk2[( index >> 5 ) * ( M / 2 )]; -#endif for ( i = M / 2; i < M; i++ ) { -#ifdef FIX_445_SNS_BUGFIXES snsq[i] = ( *p_dico++ ) * cdbk_fix2float + means[i] * means_fix2float; -#else - snsq[i] = *p_dico++; -#endif } return; @@ -153,54 +127,23 @@ static void sns_2st_dec( *-------------------------------------------------------------------*/ void sns_avq_dec( - int16_t *index, /* i : Quantization indices */ -#ifdef SNS_MSVQ + int16_t *index, /* i : Quantization indices */ float SNS_Q[NB_DIV][M], /* o : Quantized SNS vectors */ -#else - float *SNS_Q, /* o : Quantized SNS vectors */ -#endif -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif const int16_t numlpc /* i : Number of sets of lpc */ ) { int16_t i, nbi, last; int16_t q_type; -#ifdef SNS_MSVQ /* go from one-based indexing to zero-based indexing */ last = numlpc - 1; -#else - /* Last LPC index */ - if ( numlpc == 1 ) - { - last = 0; - } - else - { - last = M; - } -#endif index++; /* Decode last LPC */ -#ifdef SNS_MSVQ -#ifdef FIX_445_SNS_BUGFIXES sns_1st_dec( *index++, numlpc, L_frame, SNS_Q[last] ); -#else - sns_1st_dec( *index++, SNS_Q[last] ); -#endif sns_2st_dec( SNS_Q[last], index ); -#else -#ifdef FIX_445_SNS_BUGFIXES - sns_1st_dec( *index++, numplc, L_Frame & SNS_Q[last] ); -#else - sns_1st_dec( *index++, &SNS_Q[last] ); -#endif - sns_2st_dec( &SNS_Q[last], index ); -#endif nbi = 2 + index[0] + index[1]; index += nbi; @@ -211,37 +154,16 @@ void sns_avq_dec( if ( q_type == 0 ) { -#ifdef SNS_MSVQ -#ifdef FIX_445_SNS_BUGFIXES sns_1st_dec( *index++, numlpc, L_frame, SNS_Q[0] ); -#else - sns_1st_dec( *index++, SNS_Q[0] ); -#endif sns_2st_dec( SNS_Q[0], index ); -#else -#ifdef FIX_445_SNS_BUGFIXES - sns_1st_dec( *index++, numlpc, L_frame, &SNS_Q[0] ); -#else - sns_1st_dec( *index++, &SNS_Q[0] ); -#endif - sns_2st_dec( &SNS_Q[0], index ); -#endif } else if ( q_type == 1 ) { for ( i = 0; i < M; i++ ) { -#ifdef SNS_MSVQ SNS_Q[0][i] = SNS_Q[0][M + i]; -#else - SNS_Q[i] = SNS_Q[M + i]; -#endif } -#ifdef SNS_MSVQ sns_2st_dec( SNS_Q[0], index ); -#else - sns_2st_dec( &SNS_Q[0], index ); -#endif } } @@ -258,9 +180,7 @@ void sns_avq_dec( void sns_avq_dec_stereo( int16_t *indexl, /* i : Quantization indices (left channel) */ int16_t *indexr, /* i : Quantization indices (right channe) */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif float *SNS_Ql, /* o : Quantized SNS vectors (left channel) */ float *SNS_Qr /* o : Quantized SNS vectors (right channe) */ ) @@ -275,11 +195,7 @@ void sns_avq_dec_stereo( { /* MS coding */ -#ifdef FIX_445_SNS_BUGFIXES sns_1st_dec( *indexl++, TCX_20_CORE, L_frame, mid_q ); -#else - sns_1st_dec( *indexl++, mid_q ); -#endif sns_2st_dec( mid_q, indexl ); for ( i = 0; i < M; i++ ) @@ -302,34 +218,22 @@ void sns_avq_dec_stereo( { /* LR decoding */ -#ifdef FIX_445_SNS_BUGFIXES sns_1st_dec( *indexl++, TCX_20_CORE, L_frame, SNS_Ql ); -#else - sns_1st_dec( *indexl++, SNS_Ql ); -#endif sns_2st_dec( SNS_Ql, indexl ); -#ifdef FIX_445_SNS_BUGFIXES sns_1st_dec( *indexr++, TCX_20_CORE, L_frame, SNS_Qr ); -#else - sns_1st_dec( *indexr++, SNS_Qr ); -#endif sns_2st_dec( SNS_Qr, indexr ); } return; } -#ifdef SNS_MSVQ void dequantize_sns( int16_t indices[CPE_CHANNELS][NPRM_LPC_NEW], float snsQ_out[CPE_CHANNELS][NB_DIV][M], Decoder_State **sts ) { int16_t nSubframes, k, ch; -#ifndef FIX_445_SNS_BUGFIXES - const float *means; -#endif int16_t sns_stereo_mode[NB_DIV]; int16_t zero_side_flag[NB_DIV]; Decoder_State *st; @@ -364,14 +268,7 @@ void dequantize_sns( } nStages = SNS_MSVQ_NSTAGES_SIDE; -#ifndef FIX_445_SNS_BUGFIXES - means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_side_tcx20 : ivas_sns_means_side_tcx10; -#endif msvq_dec( side_cdbks, NULL, NULL, nStages, M, M, &indices[ch][idxIndices + SNS_STEREO_MODE_OFFSET_INDICES], 0, NULL, snsQ, NULL ); - -#ifndef FIX_445_SNS_BUGFIXES - v_add( snsQ, means, snsQ, M ); -#endif } else { @@ -392,19 +289,4 @@ void dequantize_sns( } } } -#ifndef FIX_445_SNS_BUGFIXES - - /* add means back */ - for ( ch = 0; ch < CPE_CHANNELS; ++ch ) - { - st = sts[ch]; - nSubframes = ( st->core == TCX_20_CORE ) ? 1 : NB_DIV; - means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_tcx20 : ivas_sns_means_tcx10; - for ( k = 0; k < nSubframes; ++k ) - { - v_add( snsQ_out[ch][k], means, snsQ_out[ch][k], M ); - } - } -#endif } -#endif // SNS_MSVQ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c old mode 100755 new mode 100644 index d1104594a11a879df6fe1850505ffda2213c304f..0c1948a56cda70b7043e12ba6e72f8f1297f3afc --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -72,18 +72,12 @@ ivas_error ivas_spar_dec_open( IVAS_FB_CFG *fb_cfg; int16_t i, j, b, active_w_mixing; int32_t output_Fs; -#ifdef HODIRAC int16_t num_decor_chs; -#endif error = IVAS_ERR_OK; sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); -#ifndef HODIRAC - num_channels_internal = ivas_sba_get_nchan_metadata( sba_order_internal ); -#else num_channels_internal = ivas_sba_get_nchan_metadata( sba_order_internal, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif hSpar = st_ivas->hSpar; @@ -97,7 +91,6 @@ ivas_error ivas_spar_dec_open( } output_Fs = st_ivas->hDecoderConfig->output_Fs; -#ifdef HODIRAC if ( num_channels_internal > ( SBA_HOA2_ORDER + 1 ) * ( SBA_HOA2_ORDER + 1 ) ) { num_decor_chs = IVAS_HBR_MAX_DECOR_CHS; @@ -106,21 +99,12 @@ ivas_error ivas_spar_dec_open( { num_decor_chs = num_channels_internal - 1; } -#endif -#ifdef HODIRAC /* TD decorr. */ if ( ( error = ivas_td_decorr_dec_open( &hSpar->hTdDecorr, output_Fs, num_decor_chs + 1, 1 ) ) != IVAS_ERR_OK ) { return error; } -#else - /* TD decorr. */ - if ( ( error = ivas_td_decorr_dec_open( &hSpar->hTdDecorr, output_Fs, num_channels_internal, 1 ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /* MD handle */ if ( ( error = ivas_spar_md_dec_open( &hSpar->hMdDec, st_ivas->hDecoderConfig, num_channels_internal, sba_order_internal, st_ivas->sid_format ) ) != IVAS_ERR_OK ) @@ -132,12 +116,8 @@ ivas_error ivas_spar_dec_open( /* set FB config. */ active_w_mixing = -1; - if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, num_channels_internal, num_channels_internal, active_w_mixing, output_Fs -#ifdef HODIRAC - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, num_channels_internal, num_channels_internal, active_w_mixing, output_Fs, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -711,9 +691,7 @@ static void ivas_spar_dec_MD( { int16_t num_channels, table_idx, num_bands_out, bfi, sba_order; int32_t ivas_total_brate; -#ifdef HODIRAC int16_t num_md_sub_frames; -#endif DECODER_CONFIG_HANDLE hDecoderConfig = st_ivas->hDecoderConfig; SPAR_DEC_HANDLE hSpar = st_ivas->hSpar; @@ -726,16 +704,10 @@ static void ivas_spar_dec_MD( sba_order = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); bfi = st_ivas->bfi; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - num_channels = ivas_sba_get_nchan_metadata( sba_order -#ifdef HODIRAC - , - ivas_total_brate -#endif - ); + num_channels = ivas_sba_get_nchan_metadata( sba_order, + ivas_total_brate ); -#ifdef HODIRAC num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; @@ -797,11 +769,8 @@ static void ivas_spar_dec_MD( { ivas_spar_setup_md_smoothing( hSpar->hMdDec, num_bands_out -#ifdef HODIRAC , - num_md_sub_frames -#endif - ); + num_md_sub_frames ); } else { @@ -812,12 +781,8 @@ static void ivas_spar_dec_MD( { if ( !bfi ) { - ivas_spar_smooth_md_dtx( hSpar->hMdDec, num_bands_out -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ); + ivas_spar_smooth_md_dtx( hSpar->hMdDec, num_bands_out, + num_md_sub_frames ); } set_s( hSpar->hMdDec->valid_bands, 0, IVAS_MAX_NUM_BANDS ); @@ -956,12 +921,8 @@ static void ivas_spar_get_skip_mat( const int16_t num_ch_out, const int16_t num_ch_in, const int16_t num_spar_bands, - int16_t skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] -#ifdef HODIRAC - , - const int16_t num_md_sub_frames -#endif -) + int16_t skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], + const int16_t num_md_sub_frames ) { int16_t spar_band, out_ch, in_ch; int16_t i_ts, skip_flag; @@ -972,7 +933,6 @@ static void ivas_spar_get_skip_mat( { skip_mat[out_ch][in_ch] = 1; skip_flag = 1; -#ifdef HODIRAC for ( i_ts = 0; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) { for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) @@ -1010,26 +970,6 @@ static void ivas_spar_get_skip_mat( } } } -#else - - for ( i_ts = 0; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) - { - for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) - { - if ( hSpar->hMdDec->mixer_mat_prev[1 + i_ts][out_ch][in_ch][spar_band] != 0.0f || hSpar->hMdDec->mixer_mat[out_ch][in_ch][spar_band + i_ts * MAX_PARAM_SPATIAL_SUBFRAMES] != 0.0f ) - { - skip_flag = 0; - break; - } - } - - if ( skip_flag == 0 ) - { - skip_mat[out_ch][in_ch] = 0; - break; - } - } -#endif } } @@ -1149,12 +1089,8 @@ void ivas_spar_dec_agc_pca( if ( hSpar->hMdDec->td_decorr_flag ) { - num_in_ingest = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + num_in_ingest = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); } else { @@ -1224,12 +1160,8 @@ void ivas_spar_dec_set_render_params( *---------------------------------------------------------------------*/ nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport; num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; - ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, st_ivas->bfi -#ifdef HODIRAC - , - ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate ) -#endif - ); + ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, st_ivas->bfi, + ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); ivas_spar_dec_set_render_map( st_ivas, n_cldfb_slots ); @@ -1256,12 +1188,8 @@ void ivas_spar_dec_digest_tc( /* TD decorrelator */ default_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); nSamplesLeftForTD = nSamplesForRendering; - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order -#ifdef HODIRAC - , - st_ivas->hDecoderConfig->ivas_total_brate -#endif - ); + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, + st_ivas->hDecoderConfig->ivas_total_brate ); for ( ch = 0; ch < nchan_internal; ch++ ) { pPcm_tmp[ch] = Pcm_tmp[ch]; @@ -1272,7 +1200,6 @@ void ivas_spar_dec_digest_tc( { int16_t nSamplesToDecorr = min( nSamplesLeftForTD, default_frame ); ivas_td_decorr_process( hSpar->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr ); -#ifdef HODIRAC if ( hSpar->hTdDecorr->num_apd_outputs >= ( nchan_internal - nchan_transport ) ) { for ( ch = 0; ch < nchan_internal - nchan_transport; ch++ ) @@ -1291,12 +1218,6 @@ void ivas_spar_dec_digest_tc( mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - ch], p_tc[nchan_internal - 1 - ch], nSamplesToDecorr ); } } -#else - for ( ch = 0; ch < nchan_internal - nchan_transport; ch++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - ch], p_tc[nchan_internal - 1 - ch], nSamplesToDecorr ); - } -#endif for ( ch = 0; ch < nchan_internal; ch++ ) { p_tc[ch] += nSamplesToDecorr; @@ -1349,7 +1270,6 @@ void ivas_spar_dec_upmixer( if ( hSpar->hMdDec->td_decorr_flag ) { ivas_td_decorr_process( hSpar->hTdDecorr, st_ivas->hTcBuffer->tc, pPcm_tmp, output_frame ); -#ifdef HODIRAC if ( hSpar->hTdDecorr->num_apd_outputs >= ( nchan_internal - nchan_transport ) ) { for ( i = 0; i < nchan_internal - nchan_transport; i++ ) @@ -1368,12 +1288,6 @@ void ivas_spar_dec_upmixer( mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal - 1 - i], output_frame ); } } -#else - for ( i = 0; i < nchan_internal - nchan_transport; i++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal - 1 - i], output_frame ); - } -#endif } @@ -1454,12 +1368,10 @@ void ivas_spar_dec_upmixer( int16_t b_skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; DECODER_CONFIG_HANDLE hDecoderConfig; SPAR_DEC_HANDLE hSpar; -#ifdef HODIRAC int16_t num_md_sub_frames; #ifndef JBM_TSM_ON_TCS int16_t md_sf_idx; #endif -#endif #ifdef JBM_TSM_ON_TCS push_wmops( "ivas_spar_dec_upmixer_sf" ); @@ -1478,9 +1390,7 @@ void ivas_spar_dec_upmixer( numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; numch_out = hSpar->hFbMixer->fb_cfg->num_out_chans; -#ifdef HODIRAC num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, hDecoderConfig->ivas_total_brate ); -#endif #ifdef JBM_TSM_ON_TCS slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -1587,7 +1497,6 @@ void ivas_spar_dec_upmixer( { ivas_td_decorr_process( hSpar->hTdDecorr, output, pPcm_tmp, output_frame ); -#ifdef HODIRAC if ( hSpar->hTdDecorr->num_apd_outputs >= ( nchan_internal - nchan_transport ) ) { for ( i = 0; i < nchan_internal - nchan_transport; i++ ) @@ -1606,12 +1515,6 @@ void ivas_spar_dec_upmixer( mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], output[nchan_internal - 1 - i], output_frame ); } } -#else - for ( i = 0; i < nchan_internal - nchan_transport; i++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], output[nchan_internal - 1 - i], output_frame ); - } -#endif } #endif hSpar->hFbMixer->fb_cfg->num_in_chans = num_in_ingest; @@ -1651,12 +1554,8 @@ void ivas_spar_dec_upmixer( * Gen umx mat *---------------------------------------------------------------------*/ - ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, st_ivas->bfi -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ); + ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, st_ivas->bfi, + num_md_sub_frames ); #endif /*---------------------------------------------------------------------* @@ -1667,12 +1566,8 @@ void ivas_spar_dec_upmixer( /* apply parameters */ /* determine if we can skip certain data */ - ivas_spar_get_skip_mat( hSpar, numch_out, numch_in, num_spar_bands, b_skip_mat -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ); /* this can be precomputed based on bitrate and format*/ + ivas_spar_get_skip_mat( hSpar, numch_out, numch_in, num_spar_bands, b_skip_mat, + num_md_sub_frames ); /* this can be precomputed based on bitrate and format*/ numch_out_dirac = hDecoderConfig->nchan_out; @@ -1713,14 +1608,7 @@ void ivas_spar_dec_upmixer( if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) ) { -#ifdef LBR_ADAP_SMOOTHING_OPT ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); -#else - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - ivas_spar_calc_smooth_facs( cldfb_in_ts_re[in_ch], cldfb_in_ts_im[in_ch], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac[in_ch], hSpar->hMdDec->smooth_buf[in_ch] ); - } -#endif } #ifdef JBM_TSM_ON_TCS @@ -1744,11 +1632,7 @@ void ivas_spar_dec_upmixer( { for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { -#ifdef LBR_ADAP_SMOOTHING_OPT mixer_mat[out_ch][in_ch][spar_band] = ( 1 - hSpar->hMdDec->smooth_fac[spar_band] ) * mixer_mat[out_ch][in_ch][spar_band] + hSpar->hMdDec->smooth_fac[spar_band] * hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band]; -#else - mixer_mat[out_ch][in_ch][spar_band] = ( 1 - hSpar->hMdDec->smooth_fac[in_ch][spar_band] ) * mixer_mat[out_ch][in_ch][spar_band] + hSpar->hMdDec->smooth_fac[in_ch][spar_band] * hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band]; -#endif hSpar->hMdDec->mixer_mat_prev2[out_ch][in_ch][spar_band] = mixer_mat[out_ch][in_ch][spar_band]; } } @@ -1769,7 +1653,6 @@ void ivas_spar_dec_upmixer( for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { -#ifdef HODIRAC if ( b_skip_mat[out_ch][in_ch] == 0 ) { if ( cldfb_band < CLDFB_PAR_WEIGHT_START_BAND ) /* tuning parameter, depends on how much SPAR Filters overlap for the CLDFB bands */ @@ -1791,31 +1674,6 @@ void ivas_spar_dec_upmixer( out_im[out_ch] += cldfb_in_ts_im[in_ch][ts][cldfb_band] * cldfb_par; } } -#else - - if ( b_skip_mat[out_ch][in_ch] ) - { - continue; - } - else if ( cldfb_band < CLDFB_PAR_WEIGHT_START_BAND ) /* tuning parameter, depends on how much SPAR Filters overlap for the CLDFB bands */ - { - spar_band = bin2band->p_cldfb_map_to_spar_band[cldfb_band]; - cldfb_par = mixer_mat[out_ch][in_ch][spar_band]; - } - else - { - cldfb_par = 0.0f; - for ( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ ) - { - /* accumulate contributions from all SPAR bands */ - cldfb_par += mixer_mat[out_ch][in_ch][spar_band] * bin2band->pp_cldfb_weights_per_spar_band[cldfb_band][spar_band]; - } - } - - out_re[out_ch] += cldfb_in_ts_re[in_ch][ts][cldfb_band] * cldfb_par; - out_im[out_ch] += cldfb_in_ts_im[in_ch][ts][cldfb_band] * cldfb_par; - } -#endif } /*update CLDFB data with the parameter-modified data*/ @@ -1831,9 +1689,7 @@ void ivas_spar_dec_upmixer( /* we have crossed an unadapted parameter sf border, update previous mixing matrices */ int16_t md_sf = md_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME; split_band = SPAR_DIRAC_SPLIT_START_BAND; -#ifdef HODIRAC md_sf = ( num_md_sub_frames == MAX_PARAM_SPATIAL_SUBFRAMES ) ? md_sf : 0; -#endif if ( split_band < IVAS_MAX_NUM_BANDS ) { mvr2r( hSpar->hMdDec->mixer_mat_prev[1][0][0], hSpar->hMdDec->mixer_mat_prev[0][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_SPAR_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); @@ -1951,9 +1807,7 @@ void ivas_spar_dec_upmixer( #ifndef JBM_TSM_ON_TCS -#ifdef HODIRAC md_sf_idx = ( num_md_sub_frames == MAX_PARAM_SPATIAL_SUBFRAMES ) ? i_sf : 0; -#endif split_band = SPAR_DIRAC_SPLIT_START_BAND; if ( split_band < IVAS_MAX_NUM_BANDS ) { @@ -1970,11 +1824,7 @@ void ivas_spar_dec_upmixer( { for ( b = 0; b < num_spar_bands; b++ ) { -#ifdef HODIRAC hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf_idx * IVAS_MAX_NUM_BANDS]; -#else - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + i_sf * IVAS_MAX_NUM_BANDS]; -#endif } } } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c old mode 100755 new mode 100644 index bfca6c62802068d4d726e21653b4841f0f2ef8b0..5945023010770b783c78e70e8ffefe96fb6670e8 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -63,13 +63,7 @@ static const int16_t ivas_spar_dec_plc_spatial_target[IVAS_SPAR_MAX_CH] = { 1, 0 * Static functions declaration *------------------------------------------------------------------------------------------*/ -static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, const int16_t n_ts, const int16_t bw, const int16_t dtx_vad, const int16_t nB, -#ifdef HODIRAC - const int16_t numch_out, -#else - const int16_t sba_order, -#endif - const int16_t active_w_vlbr ); +static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, const int16_t n_ts, const int16_t bw, const int16_t dtx_vad, const int16_t nB, const int16_t numch_out, const int16_t active_w_vlbr ); static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate ); @@ -81,24 +75,9 @@ static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const static void ivas_mat_col_rearrange( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t order[IVAS_SPAR_MAX_CH], const int16_t i_ts, float ***mixer_mat, const int16_t bands, const int16_t num_ch ); -static void ivas_spar_dec_compute_ramp_down_post_matrix( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands, const int16_t bfi -#ifdef HODIRAC - , - const int16_t num_md_sub_frames -#endif -); +static void ivas_spar_dec_compute_ramp_down_post_matrix( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands, const int16_t bfi, const int16_t num_md_sub_frames ); -static void ivas_spar_md_fill_invalid_bands( ivas_spar_dec_matrices_t *pSpar_coeffs, ivas_spar_dec_matrices_t *pSpar_coeffs_prev, const int16_t *valid_bands, int16_t *base_band_age, const int16_t num_bands, -#ifdef HODIRAC - const int16_t numch_out -#else - const int16_t sba_order -#endif -#ifdef HODIRAC - , - const int16_t num_md_sub_frames -#endif -); +static void ivas_spar_md_fill_invalid_bands( ivas_spar_dec_matrices_t *pSpar_coeffs, ivas_spar_dec_matrices_t *pSpar_coeffs_prev, const int16_t *valid_bands, int16_t *base_band_age, const int16_t num_bands, const int16_t numch_out, const int16_t num_md_sub_frames ); static ivas_error ivas_spar_set_dec_config( ivas_spar_md_dec_state_t *hMdDec, const int16_t nchan_transport, float *pFC ); @@ -118,23 +97,12 @@ static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder static ivas_error ivas_spar_md_dec_matrix_open( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_channels /* i : number of internal channels */ -#ifdef HODIRAC , - const int16_t num_md_sub_frames -#endif -) + const int16_t num_md_sub_frames ) { int16_t i, j; -#ifndef HODIRAC - int16_t num_md_sub_frames; - num_md_sub_frames = MAX_PARAM_SPATIAL_SUBFRAMES; -#endif -#ifdef HODIRAC if ( ( hMdDec->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * num_md_sub_frames * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) -#else - if ( ( hMdDec->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } @@ -150,11 +118,7 @@ static ivas_error ivas_spar_md_dec_matrix_open( } for ( j = 0; j < num_channels; j++ ) { -#ifdef HODIRAC if ( ( hMdDec->mixer_mat[i][j] = (float *) malloc( num_md_sub_frames * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) -#else - if ( ( hMdDec->mixer_mat[i][j] = (float *) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } @@ -173,11 +137,7 @@ static ivas_error ivas_spar_md_dec_matrix_open( } for ( j = 0; j < num_channels; j++ ) { -#ifdef HODIRAC if ( ( hMdDec->spar_coeffs.C_re[i][j] = (float *) malloc( num_md_sub_frames * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) -#else - if ( ( hMdDec->spar_coeffs.C_re[i][j] = (float *) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } @@ -196,11 +156,7 @@ static ivas_error ivas_spar_md_dec_matrix_open( } for ( j = 0; j < num_channels; j++ ) { -#ifdef HODIRAC if ( ( hMdDec->spar_coeffs.P_re[i][j] = (float *) malloc( num_md_sub_frames * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) -#else - if ( ( hMdDec->spar_coeffs.P_re[i][j] = (float *) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } @@ -286,7 +242,6 @@ static ivas_error ivas_spar_md_dec_matrix_open( return IVAS_ERR_OK; } -#ifdef HODIRAC int16_t ivas_get_spar_dec_md_num_subframes( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int32_t ivas_total_brate ) @@ -302,7 +257,6 @@ int16_t ivas_get_spar_dec_md_num_subframes( } return ( num_subframes ); } -#endif /*------------------------------------------------------------------------- * ivas_spar_md_dec_open() @@ -320,9 +274,7 @@ ivas_error ivas_spar_md_dec_open( { ivas_spar_md_dec_state_t *hMdDec; ivas_error error; -#ifdef HODIRAC int16_t num_md_sub_frames; -#endif error = IVAS_ERR_OK; @@ -331,15 +283,9 @@ ivas_error ivas_spar_md_dec_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD decoder" ); } -#ifdef HODIRAC num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, hDecoderConfig->ivas_total_brate ); -#endif - if ( ( error = ivas_spar_md_dec_matrix_open( hMdDec, num_channels -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_spar_md_dec_matrix_open( hMdDec, num_channels, + num_md_sub_frames ) ) != IVAS_ERR_OK ) { return error; } @@ -516,15 +462,9 @@ ivas_error ivas_spar_md_dec_init( int16_t nchan_transport; float pFC[IVAS_MAX_NUM_BANDS], PR_minmax[2]; -#ifdef HODIRAC ivas_sba_get_spar_hoa_md_flag( sba_order, hDecoderConfig->ivas_total_brate, &hMdDec->spar_hoa_md_flag, &hMdDec->spar_hoa_dirac2spar_md_flag ); -#else - hMdDec->spar_hoa_md_flag = ivas_sba_get_spar_hoa_md_flag( sba_order, hDecoderConfig->ivas_total_brate ); -#endif -#ifdef HODIRAC ivas_sba_get_spar_hoa_ch_ind( num_channels, hDecoderConfig->ivas_total_brate, hMdDec->HOA_md_ind ); -#endif hMdDec->spar_md.num_bands = ( hMdDec->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); @@ -618,25 +558,11 @@ ivas_error ivas_spar_md_dec_init( set_f( hMdDec->spar_md.en_ratio_slow, 0.0f, IVAS_MAX_NUM_BANDS ); set_f( hMdDec->spar_md.ref_pow_slow, 0.0f, IVAS_MAX_NUM_BANDS ); -#ifdef LBR_ADAP_SMOOTHING_OPT set_zero( hMdDec->smooth_fac, IVAS_MAX_NUM_BANDS ); for ( i = 0; i < IVAS_MAX_NUM_BANDS; i++ ) { set_zero( hMdDec->smooth_buf[i], 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); } -#else - for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ ) - { - set_zero( hMdDec->smooth_fac[i], IVAS_MAX_NUM_BANDS ); - } - for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ ) - { - for ( j = 0; j < IVAS_MAX_NUM_BANDS; j++ ) - { - set_zero( hMdDec->smooth_buf[i][j], 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); - } - } -#endif for ( i = 0; i < IVAS_SPAR_MAX_CH; i++ ) { for ( j = 0; j < IVAS_SPAR_MAX_CH; j++ ) @@ -667,12 +593,8 @@ static ivas_error ivas_spar_set_dec_config( hMdDec->spar_md_cfg.max_freq_per_chan[i] = ivas_spar_br_table_consts[hMdDec->table_idx].fpcs; } - nchan = ivas_sba_get_nchan_metadata( ivas_spar_br_table_consts[hMdDec->table_idx].sba_order -#ifdef HODIRAC - , - ivas_spar_br_table_consts[hMdDec->table_idx].ivas_total_brate -#endif - ); + nchan = ivas_sba_get_nchan_metadata( ivas_spar_br_table_consts[hMdDec->table_idx].sba_order, + ivas_spar_br_table_consts[hMdDec->table_idx].ivas_total_brate ); switch ( nchan ) { @@ -732,9 +654,7 @@ void ivas_spar_md_dec_process( { int16_t j, k, b, bw, dtx_vad, nB, i_ts; ivas_spar_md_dec_state_t *hMdDec; -#ifdef HODIRAC int16_t num_md_chs; -#endif int16_t num_md_sub_frames; hMdDec = st_ivas->hSpar->hMdDec; @@ -742,14 +662,8 @@ void ivas_spar_md_dec_process( int16_t active_w_vlbr; active_w_vlbr = ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; -#ifdef HODIRAC num_md_chs = ivas_sba_get_nchan_metadata( sba_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif -#ifdef HODIRAC num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#else - num_md_sub_frames = MAX_PARAM_SPATIAL_SUBFRAMES; -#endif ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate, @@ -761,10 +675,8 @@ void ivas_spar_md_dec_process( int16_t num_bands = nB; int16_t num_subframes = 1, num_block_groups = 1, num_elements = 1, byte_size = sizeof( float ); int16_t num_ch = ivas_sba_get_nchan_metadata( sba_order -#ifdef HODIRAC , st_ivas->hDecoderConfig->ivas_total_brate -#endif ); for ( b = 0; b < num_bands; b++ ) { @@ -898,9 +810,7 @@ void ivas_spar_md_dec_process( }*/ #endif /* SPAR to DirAC conversion */ -#ifdef HODIRAC if ( hMdDec->spar_hoa_dirac2spar_md_flag == 1 ) -#endif { ivas_spar_to_dirac( st_ivas, hMdDec, dtx_vad, num_bands_out, bw ); } @@ -1035,11 +945,7 @@ void ivas_spar_md_dec_process( }*/ #endif /* expand DirAC MD to all time slots */ -#ifdef HODIRAC for ( i_ts = 1; i_ts < num_md_sub_frames; i_ts++ ) -#else - for ( i_ts = 1; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) -#endif { for ( b = 0; b < hMdDec->spar_md.num_bands; b++ ) { @@ -1063,16 +969,8 @@ void ivas_spar_md_dec_process( } } -#ifdef HODIRAC ivas_get_spar_matrices( hMdDec, num_bands_out, num_md_sub_frames, bw, dtx_vad, nB, -#else - ivas_get_spar_matrices( hMdDec, num_bands_out, MAX_PARAM_SPATIAL_SUBFRAMES, bw, dtx_vad, nB, -#endif -#ifdef HODIRAC num_md_chs, -#else - sba_order, -#endif active_w_vlbr ); @@ -1098,16 +996,8 @@ void ivas_spar_md_dec_process( } ivas_spar_md_fill_invalid_bands( &hMdDec->spar_coeffs, &hMdDec->spar_coeffs_prev, &hMdDec->valid_bands[0], &hMdDec->base_band_age[0], num_bands_out, -#ifdef HODIRAC - num_md_chs -#else - sba_order -#endif -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ); + num_md_chs, + num_md_sub_frames ); hMdDec->dtx_md_smoothing_cntr = 1; @@ -1127,10 +1017,8 @@ void ivas_spar_md_dec_process( void ivas_spar_smooth_md_dtx( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_bands_out /* i : number of output bands */ -#ifdef HODIRAC , const int16_t num_md_sub_frames /* i : number of metadata subframes */ -#endif ) { int16_t j, k, b, dmx_ch; @@ -1166,11 +1054,7 @@ void ivas_spar_smooth_md_dtx( } /* expand MD to all time slots */ -#ifdef HODIRAC for ( int16_t i_ts = 1; i_ts < num_md_sub_frames; i_ts++ ) -#else - for ( int16_t i_ts = 1; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) -#endif { for ( b = 0; b < num_bands_out; b++ ) { @@ -1210,10 +1094,8 @@ void ivas_spar_smooth_md_dtx( void ivas_spar_setup_md_smoothing( ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ const int16_t num_bands_out /* i : number of output bands */ -#ifdef HODIRAC , const int16_t num_md_sub_frames /* i : number of metadata subframes */ -#endif ) { /* copy the coeffs */ @@ -1265,12 +1147,8 @@ void ivas_spar_setup_md_smoothing( } } - ivas_spar_smooth_md_dtx( hMdDec, num_bands_out -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ); + ivas_spar_smooth_md_dtx( hMdDec, num_bands_out, + num_md_sub_frames ); return; } @@ -1350,25 +1228,14 @@ static void ivas_get_spar_matrices( const int16_t bw, const int16_t dtx_vad, const int16_t nB, -#ifdef HODIRAC const int16_t numch_out, -#else - const int16_t sba_order, -#endif const int16_t active_w_vlbr ) { -#ifndef HODIRAC - int16_t numch_out, num_bands, dmx_ch, split_band; -#else int16_t num_bands, dmx_ch, split_band; -#endif int16_t i, j, k, m, b, i_ts, active_w; const int16_t *order; float active_w_dm_fac, re; -#ifndef HODIRAC - numch_out = ivas_sba_get_nchan_metadata( sba_order ); -#endif num_bands = num_bands_out; order = remix_order_set[hMdDec->spar_md_cfg.remix_unmix_order]; @@ -1747,21 +1614,14 @@ void ivas_spar_dec_gen_umx_mat( const int16_t nchan_transport, /* i : number of transport channels */ const int16_t num_bands_out, /* i : number of output bands */ const int16_t bfi /* i : bad frame indicator */ -#ifdef HODIRAC , - const int16_t num_md_sub_frames -#endif -) + const int16_t num_md_sub_frames ) { int16_t i, j, b, i_ts, num_out_ch; num_out_ch = hMdDec->spar_md_cfg.num_umx_chs; -#ifdef HODIRAC for ( i_ts = 0; i_ts < num_md_sub_frames; i_ts++ ) -#else - for ( i_ts = 0; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) -#endif { if ( hMdDec->td_decorr_flag == 1 ) { @@ -1822,12 +1682,8 @@ void ivas_spar_dec_gen_umx_mat( #endif } - ivas_spar_dec_compute_ramp_down_post_matrix( hMdDec, num_bands_out, bfi -#ifdef HODIRAC - , - num_md_sub_frames -#endif - ); + ivas_spar_dec_compute_ramp_down_post_matrix( hMdDec, num_bands_out, bfi, + num_md_sub_frames ); return; } @@ -2205,11 +2061,7 @@ static void ivas_decode_arith_bs( else { pred_cell_dims[i].dim1 = ndm + ndec - 1; - if ( hMdDec->spar_hoa_md_flag -#ifdef HODIRAC - && hMdDec->spar_hoa_dirac2spar_md_flag -#endif - ) + if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag ) { if ( i >= SPAR_DIRAC_SPLIT_START_BAND ) { @@ -2238,11 +2090,7 @@ static void ivas_decode_arith_bs( if ( any_diff == 1 ) { -#ifdef HODIRAC if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdDec->spar_hoa_md_flag ) -#endif { for ( i = 0; i < nB; i++ ) { @@ -2264,11 +2112,7 @@ static void ivas_decode_arith_bs( ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF, planarCP ); -#ifdef HODIRAC if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdDec->spar_hoa_md_flag ) -#endif { for ( i = 0; i < nB; i++ ) { @@ -2533,11 +2377,7 @@ static void ivas_decode_huffman_bs( drct_dim = ndec * ( ndm - 1 ); decd_dim = ndec; pred_offset = 0; -#ifdef HODIRAC if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdDec->spar_hoa_md_flag ) -#endif { if ( i >= SPAR_DIRAC_SPLIT_START_BAND ) { @@ -2551,11 +2391,7 @@ static void ivas_decode_huffman_bs( &hMdDec->spar_md.band_coeffs_idx[i].pred_index_re[j] ); } -#ifdef HODIRAC if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdDec->spar_hoa_md_flag ) -#endif { if ( i >= SPAR_DIRAC_SPLIT_START_BAND ) { @@ -2608,26 +2444,13 @@ static void ivas_spar_md_fill_invalid_bands( const int16_t *valid_bands, int16_t *base_band_age, const int16_t num_bands, -#ifdef HODIRAC - const int16_t num_channels -#else - const int16_t sba_order -#endif -#ifdef HODIRAC - , - const int16_t num_md_sub_frames -#endif -) + const int16_t num_channels, + const int16_t num_md_sub_frames ) { int16_t i, j, b, all_valid; int16_t valid_band_idx[IVAS_MAX_NUM_BANDS], idx = -1; int16_t last_valid_band_idx[IVAS_MAX_NUM_BANDS]; float w = 0; -#ifndef HODIRAC - int16_t num_channels; - - num_channels = ivas_sba_get_nchan_metadata( sba_order ); -#endif set_s( valid_band_idx, 0, IVAS_MAX_NUM_BANDS ); set_s( last_valid_band_idx, 0, IVAS_MAX_NUM_BANDS ); @@ -2714,11 +2537,7 @@ static void ivas_spar_md_fill_invalid_bands( { for ( j = 0; j < num_channels; j++ ) { -#ifdef HODIRAC for ( i_ts = 1; i_ts < num_md_sub_frames; i_ts++ ) -#else - for ( i_ts = 1; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) -#endif { pSpar_coeffs->C_re[i][j][b + i_ts * IVAS_MAX_NUM_BANDS] = pSpar_coeffs->C_re[i][j][b]; pSpar_coeffs->P_re[i][j][b + i_ts * IVAS_MAX_NUM_BANDS] = pSpar_coeffs->P_re[i][j][b]; @@ -2742,12 +2561,8 @@ static void ivas_spar_md_fill_invalid_bands( static void ivas_spar_dec_compute_ramp_down_post_matrix( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, - const int16_t bfi -#ifdef HODIRAC - , - const int16_t num_md_sub_frames -#endif -) + const int16_t bfi, + const int16_t num_md_sub_frames ) { int16_t num_in_ch, num_out_ch, i, j, b; @@ -2786,11 +2601,7 @@ static void ivas_spar_dec_compute_ramp_down_post_matrix( } /* apply the post matrix */ -#ifdef HODIRAC for ( int16_t i_ts = 0; i_ts < num_md_sub_frames; i_ts++ ) -#else - for ( int16_t i_ts = 0; i_ts < MAX_PARAM_SPATIAL_SUBFRAMES; i_ts++ ) -#endif { for ( i = 0; i < num_out_ch; i++ ) { @@ -3065,11 +2876,7 @@ void ivas_spar_to_dirac( enc_param_start_band = st_ivas->hSpar->enc_param_start_band / bw; active_w_vlbr = ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; - if ( hDirAC != NULL -#ifdef HODIRAC - && ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ) == 0 -#endif - ) + if ( hDirAC != NULL && ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ) == 0 ) { band_grouping = hDirAC->band_grouping; #ifdef ENABLE_DITHER diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h old mode 100755 new mode 100644 index 727b01c0ed3b6a9c67bf9d0e8de453775f6f1bda..af9d5da5f4f7fe0dd5d67026fff4ac1f3ad6ceb9 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -732,9 +732,7 @@ typedef struct ivas_dirac_dec_data_structure PARAM_ISM_RENDERING_HANDLE hParamIsmRendering; IVAS_FB_MIXER_HANDLE hFbMdft; int16_t dirac_to_spar_md_bands[DIRAC_MAX_NBANDS]; -#ifdef HODIRAC const int16_t *sba_map_tc; -#endif } DIRAC_DEC_DATA, *DIRAC_DEC_HANDLE; @@ -805,7 +803,6 @@ typedef struct ivas_param_mc_dec_data_structure } PARAM_MC_DEC_DATA, *PARAM_MC_DEC_HANDLE; -#ifdef MC_PARAMUPMIX_MODE /*----------------------------------------------------------------------------------* * MC Param-Upmix Mode structures *----------------------------------------------------------------------------------*/ @@ -825,7 +822,6 @@ typedef struct ivas_mc_paramupmix_dec_data_structure float *pcm_delay[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS]; } MC_PARAMUPMIX_DEC_DATA, *MC_PARAMUPMIX_DEC_HANDLE; -#endif /*------------------------------------------------------------------------------------------* * SPAR decoder structures *------------------------------------------------------------------------------------------*/ @@ -861,17 +857,10 @@ typedef struct ivas_spar_md_dec_state_t int16_t table_idx; int16_t dtx_vad; int16_t spar_hoa_md_flag; -#ifdef HODIRAC int16_t spar_hoa_dirac2spar_md_flag; int16_t HOA_md_ind[IVAS_SPAR_MAX_CH]; -#endif -#ifdef LBR_ADAP_SMOOTHING_OPT float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[IVAS_MAX_NUM_BANDS]; -#else - float smooth_buf[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; - float smooth_fac[IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; -#endif float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; } ivas_spar_md_dec_state_t; @@ -1224,13 +1213,9 @@ typedef struct decoder_config_structure #else int16_t orientation_tracking; /* indicates orientation tracking type */ #endif -#ifdef NON_DIEGETIC_PAN int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ float non_diegetic_pan_gain; /* non diegetic panning gain*/ -#else - float no_diegetic_pan; -#endif - int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ + int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ /* temp. development parameters */ #ifdef DEBUGGING @@ -1316,9 +1301,7 @@ typedef struct Decoder_Struct IVAS_QMETADATA_HANDLE hQMetaData; /* q_metadata handle */ MCT_DEC_HANDLE hMCT; /* MCT handle */ PARAM_MC_DEC_HANDLE hParamMC; /* Parametric MC handle */ -#ifdef MC_PARAMUPMIX_MODE MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; /* MC Param-Upmix handle */ -#endif MASA_DECODER_HANDLE hMasa; /* MASA handle */ LFE_DEC_HANDLE hLFE; /* LFE handle */ diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 2e31375996857b5ea68e38c8d90cb5b41793cfd8..c12498c015e6a9d54b79278ec89f36c8bacbf6c7 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -90,12 +90,7 @@ void stereo_dft_dec_sid_coh( int16_t bits_tmp; int16_t b; -#ifdef FIX_418_SID_BITRATE nr_of_sid_stereo_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; -#else - /* TODO: still use old number of bits to keep bitexactness in output */ - nr_of_sid_stereo_bits = ( 4400 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; -#endif /* If the coherence is not encoded due to lack of bits set alpha to zero which leads to that the coherence */ /* from the previous frame is used. */ @@ -178,9 +173,6 @@ void stereo_dft_dec_sid_coh( ( *nb_bits )++; } -#ifndef FIX_418_SID_BITRATE - dtx_read_padding_bits( st, ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC ); -#endif return; } diff --git a/lib_dec/ivas_stereo_dft_dec.c b/lib_dec/ivas_stereo_dft_dec.c index cf5542f1e0dd6e8aaccc22fddcfc2606cc709383..02fd3a41d309f7237c43b7b07fbdc7b71ca36838 100644 --- a/lib_dec/ivas_stereo_dft_dec.c +++ b/lib_dec/ivas_stereo_dft_dec.c @@ -1605,11 +1605,7 @@ void stereo_dft_dec( if ( hStereoDft->frame_sid_nodata || st0->VAD == 0 ) { -#ifdef FIX_I414_OOA_CNA hFdCngDec->cna_band_limits[hFdCngDec->cna_nbands] = hStereoDft->band_limits[hFdCngDec->cna_nbands]; -#else - hFdCngDec->cna_band_limits[b] = hStereoDft->band_limits[hFdCngDec->cna_nbands]; -#endif } if ( hStereoDft->frame_sid_nodata && !sba_dirac_stereo_flag ) diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index 0e788a0821103ce0b6b3e1c8a3891fb9579e3f29..efc9ebe845d7fffafea2ff96565a9f82de09aa64 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -468,14 +468,7 @@ ivas_error initMdctStereoDtxData( /* Init FD-CNG */ initFdCngDec( st ); -#ifndef FIX_413_SBA_DTX - if ( ch == 1 && st->cng_sba_flag ) - { - st->hFdCngDec->hFdCngCom->seed += 3; - } -#endif } -#ifdef FIX_413_SBA_DTX if ( st->first_CNG == 0 ) { if ( ch == 1 && st->cng_sba_flag ) @@ -483,7 +476,6 @@ ivas_error initMdctStereoDtxData( st->hFdCngDec->hFdCngCom->seed += 3; } } -#endif if ( st->cldfbAna == NULL ) { diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 898908c96e4dda4e55538efeb2c4bb0bdd51b51b..88d82ac17b8d7732c94bd2260191d40e91185d3b 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -963,11 +963,7 @@ ivas_error stereo_memory_dec( if ( ivas_format == MC_FORMAT && hCPE->element_mode == IVAS_CPE_MDCT ) { -#ifdef MC_PARAMUPMIX_MODE if ( mc_mode == MC_MODE_MCT || mc_mode == MC_MODE_PARAMUPMIX ) -#else - if ( mc_mode == MC_MODE_MCT ) -#endif { /* deallocate the FdCNG handle */ for ( i = 0; i < CPE_CHANNELS; ++i ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c5d1173c8dcc8cd0b8594c5cc2db3b1205ca9c69..996e2afc19804702e956dcf1ed9a19172ef037a6 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -116,17 +116,9 @@ static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSampl #endif static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled ); #ifdef FIX_439_OTR_PARAMS -#ifdef NON_DIEGETIC_PAN static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); #else -static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const float non_diegetic_pan ); -#endif -#else -#ifdef NON_DIEGETIC_PAN static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int16_t orientation_tracking ); -#else -static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int16_t orientation_tracking, const float non_diegetic_pan ); -#endif #endif #ifdef JBM_TSM_ON_TCS static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas ); @@ -152,10 +144,6 @@ ivas_error IVAS_DEC_Open( , const int16_t orientation_tracking /* i : orientation tracking type */ #endif -#ifndef NON_DIEGETIC_PAN - , - float no_diegetic_pan /* i : non diegetic panning gain */ -#endif ) { IVAS_DEC_HANDLE hIvasDec; @@ -210,17 +198,9 @@ ivas_error IVAS_DEC_Open( /* initialize Decoder Config. handle */ #ifdef FIX_439_OTR_PARAMS -#ifdef NON_DIEGETIC_PAN init_decoder_config( hIvasDec->st_ivas->hDecoderConfig ); #else - init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, no_diegetic_pan ); -#endif -#else -#ifdef NON_DIEGETIC_PAN init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, orientation_tracking ); -#else - init_decoder_config( hIvasDec->st_ivas->hDecoderConfig, orientation_tracking, no_diegetic_pan ); -#endif #endif /* initialize pointers to handles to NULL */ ivas_initialize_handles_dec( st_ivas ); @@ -276,10 +256,6 @@ static void init_decoder_config( , const int16_t orientation_tracking #endif -#ifndef NON_DIEGETIC_PAN - , - const float no_diegetic_pan -#endif ) { hDecoderConfig->Opt_AMR_WB = 0; @@ -294,12 +270,8 @@ static void init_decoder_config( #else hDecoderConfig->orientation_tracking = orientation_tracking; #endif -#ifdef NON_DIEGETIC_PAN hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; -#else - hDecoderConfig->no_diegetic_pan = no_diegetic_pan; -#endif #ifdef JBM_TSM_ON_TCS hDecoderConfig->voip_active = 0; @@ -468,13 +440,9 @@ ivas_error IVAS_DEC_Configure( #ifdef FIX_439_OTR_PARAMS const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ #endif -#ifdef NON_DIEGETIC_PAN const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ const float non_diegetic_pan_gain /* i : non diegetic panning gain */ -#else - const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ -#endif ) { Decoder_Struct *st_ivas; @@ -492,18 +460,11 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NON_DIEGETIC_PAN if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputFormat == IVAS_DEC_OUTPUT_MONO && Opt_non_diegetic_pan == 0 ) || ( outputFormat == IVAS_DEC_OUTPUT_STEREO && Opt_non_diegetic_pan == 1 ) ) ) { return IVAS_ERR_WRONG_MODE; } -#else - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && outputFormat != IVAS_DEC_OUTPUT_MONO ) - { - return IVAS_ERR_WRONG_MODE; - } -#endif st_ivas = hIvasDec->st_ivas; @@ -535,10 +496,8 @@ ivas_error IVAS_DEC_Configure( #endif hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; -#ifdef NON_DIEGETIC_PAN hDecoderConfig->Opt_non_diegetic_pan = Opt_non_diegetic_pan; hDecoderConfig->non_diegetic_pan_gain = non_diegetic_pan_gain; -#endif /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) @@ -1211,9 +1170,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( metadata->gainFactor = 1.f; metadata->yaw = 0.f; metadata->pitch = 0.f; -#ifdef ISM_NON_DIEGETIC_PAN metadata->non_diegetic_flag = 0; -#endif } else { @@ -1224,9 +1181,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( metadata->pitch = hIsmMeta->pitch; metadata->spread = 0.f; metadata->gainFactor = 1.f; -#ifdef ISM_NON_DIEGETIC_PAN metadata->non_diegetic_flag = hIsmMeta->non_diegetic_flag; -#endif } return IVAS_ERR_OK; @@ -2697,14 +2652,12 @@ static ivas_error printConfigInfo_dec( if ( st_ivas->ivas_format == MONO_FORMAT ) { -#ifdef NON_DIEGETIC_PAN if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) { fprintf( stdout, "Output configuration: mono EVS bit-exact decoding to stereo\n" ); fprintf( stdout, "Non-diegetic panning: %.2f\n", st_ivas->hDecoderConfig->non_diegetic_pan_gain * 90.f ); } else -#endif { fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); } @@ -2807,12 +2760,10 @@ static ivas_error printConfigInfo_dec( } #endif -#ifdef NON_DIEGETIC_PAN if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) { fprintf( stdout, "Non-diegetic panning: %.2f\n", st_ivas->hDecoderConfig->non_diegetic_pan_gain * 90.f ); } -#endif } return IVAS_ERR_OK; @@ -2919,15 +2870,11 @@ static ivas_error evs_dec_main( int16_t *pcmBuf ) { DEC_CORE_HANDLE *hCoreCoder; -#ifdef NON_DIEGETIC_PAN float output[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN][L_FRAME48k]; float mixer_left, mixer_rigth; #ifdef JBM_TSM_ON_TCS float *p_output[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN]; int16_t ch; -#endif -#else - float output[L_FRAME48k]; #endif ivas_error error; @@ -2939,12 +2886,10 @@ static ivas_error evs_dec_main( mdct_switching_dec( hCoreCoder[0] ); #ifdef JBM_TSM_ON_TCS -#ifdef NON_DIEGETIC_PAN for ( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) { p_output[ch] = output[ch]; } -#endif #endif /* run the main EVS decoding routine */ @@ -2952,22 +2897,14 @@ static ivas_error evs_dec_main( { if ( hCoreCoder[0]->Opt_AMR_WB ) { -#ifdef NON_DIEGETIC_PAN if ( ( error = amr_wb_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0] ) ) != IVAS_ERR_OK ) -#else - if ( ( error = amr_wb_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output ) ) != IVAS_ERR_OK ) -#endif { return error; } } else { -#ifdef NON_DIEGETIC_PAN if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output, FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2977,33 +2914,21 @@ static ivas_error evs_dec_main( { if ( hCoreCoder[0]->bfi == 0 ) { -#ifdef NON_DIEGETIC_PAN if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output, FRAMEMODE_NORMAL ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( hCoreCoder[0]->bfi == 2 ) { -#ifdef NON_DIEGETIC_PAN if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_FUTURE ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output, FRAMEMODE_FUTURE ) ) != IVAS_ERR_OK ) -#endif { return error; } } else { -#ifdef NON_DIEGETIC_PAN if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output[0], FRAMEMODE_MISSING ) ) != IVAS_ERR_OK ) -#else - if ( ( error = evs_dec( hCoreCoder[0], st_ivas->mem_hp20_out[0], output, FRAMEMODE_MISSING ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3012,7 +2937,6 @@ static ivas_error evs_dec_main( st_ivas->BER_detect = hCoreCoder[0]->BER_detect; -#ifdef NON_DIEGETIC_PAN if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { mixer_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; @@ -3020,7 +2944,6 @@ static ivas_error evs_dec_main( v_multc( output[0], mixer_rigth, output[1], nOutSamples ); v_multc( output[0], mixer_left, output[0], nOutSamples ); } -#endif #ifdef JBM_TSM_ON_TCS if ( floatBuf != NULL ) @@ -3033,16 +2956,8 @@ static ivas_error evs_dec_main( #ifdef DEBUGGING st_ivas->noClipping += #endif -#ifdef NON_DIEGETIC_PAN ivas_syn_output( p_output, nOutSamples, st_ivas->hDecoderConfig->nchan_out, pcm_buf_local ); -#else - syn_output( output, nOutSamples, pcm_buf_local ); -#endif -#ifdef NON_DIEGETIC_PAN mvs2r( pcm_buf_local, floatBuf, nOutSamples * st_ivas->hDecoderConfig->nchan_out ); -#else - mvs2r( pcm_buf_local, floatBuf, nOutSamples ); -#endif } else { @@ -3050,14 +2965,10 @@ static ivas_error evs_dec_main( #ifdef DEBUGGING st_ivas->noClipping += #endif -#ifdef NON_DIEGETIC_PAN #ifdef JBM_TSM_ON_TCS ivas_syn_output( p_output, nOutSamples, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); #else - ivas_syn_output( output, nOutSamples, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); -#endif -#else - syn_output( output, nOutSamples, pcmBuf ); + ivas_syn_output( output, nOutSamples, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); #endif #ifdef JBM_TSM_ON_TCS } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index c61d3f91fd9feafa9b1dfd8479075b6584c2021f..65e36b055ba91935b429c60c6cd4fd97eff99136 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -76,14 +76,12 @@ typedef enum IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF = 4, /* RTP payload: only Header-Full format without zero padding for size collision avoidance */ } IVAS_DEC_INPUT_FORMAT; -#ifdef COMPLEXITY_LEVEL_INDICATION typedef enum _IVAS_DEC_COMPLEXITY_LEVEL { IVAS_DEC_COMPLEXITY_LEVEL_ONE = 1, IVAS_DEC_COMPLEXITY_LEVEL_TWO = 2, IVAS_DEC_COMPLEXITY_LEVEL_THREE = 3 } IVAS_DEC_COMPLEXITY_LEVEL; -#endif #ifdef VARIABLE_SPEED_DECODING @@ -139,10 +137,6 @@ ivas_error IVAS_DEC_Open( , const int16_t orientation_tracking /* i : orientation tracking type */ #endif -#ifndef NON_DIEGETIC_PAN - , - float no_diegetic_pan_gain /* i : non diegetic panning gain */ -#endif ); /*! r: error code */ @@ -156,13 +150,9 @@ ivas_error IVAS_DEC_Configure( #ifdef FIX_439_OTR_PARAMS const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ #endif -#ifdef NON_DIEGETIC_PAN const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ const float non_diegetic_pan_gain /* i : non diegetic panning gain */ -#else - const int16_t renderConfigEnabled /* i : enable Renderer config. file for binaural output */ -#endif ); void IVAS_DEC_Close( diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 9d3adbb18193ce2fd2e544a82d52661eb4734214..c971cf0e21f1d08f3f3c0ca19c4d774e6f4ffc0f 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -105,23 +105,15 @@ typedef struct float cna_LR_LT; /* stereo CNA - long-term L/R correlation factor calculated on stereo upmix */ float cna_ILD_LT; /* stereo CNA - long-term ILD factor calculated on stereo upmix */ float cna_g_state[STEREO_DFT_BAND_MAX]; /* stereo CNA - side gains from the last inactive frame */ -#ifdef FIX_I414_OOA_CNA - float cna_cm[STEREO_DFT_BAND_MAX]; /* stereo CNA - coherence from the last inactive frame */ -#else - float cna_cm[STEREO_DFT_BAND_MAX + 1]; /* stereo CNA - coherence from the last inactive frame */ -#endif - int16_t first_cna_noise_updated; /* stereo CNA - flag indicating that comfort noise has been properly initialized during warmup */ - int16_t first_cna_noise_update_cnt; /* stereo CNA - counter of CN initialization frames */ - int16_t cna_nbands; /* stereo CNA - number of frequency bands used by the CNA in DFT stereo mode */ + float cna_cm[STEREO_DFT_BAND_MAX]; /* stereo CNA - coherence from the last inactive frame */ + int16_t first_cna_noise_updated; /* stereo CNA - flag indicating that comfort noise has been properly initialized during warmup */ + int16_t first_cna_noise_update_cnt; /* stereo CNA - counter of CN initialization frames */ + int16_t cna_nbands; /* stereo CNA - number of frequency bands used by the CNA in DFT stereo mode */ -#ifdef FIX_I414_OOA_CNA int16_t cna_band_limits[STEREO_DFT_BAND_MAX + 1]; /* stereo CNA - band limits used by the CNA in DFT stereo mode */ -#else - int16_t cna_band_limits[MAX_CNA_NBANDS + 1]; /* stereo CNA - band limits used by the CNA in DFT stereo mode */ -#endif - float cna_act_fact; /* stereo CNA - long-term signal activity factor (0-1) */ - float cna_rescale_fact; /* stereo CNA - CN energy re-scaling factor to maintain decoded energy */ - int16_t cna_seed; /* stereo CNA - seed for random CN generator */ + float cna_act_fact; /* stereo CNA - long-term signal activity factor (0-1) */ + float cna_rescale_fact; /* stereo CNA - CN energy re-scaling factor to maintain decoded energy */ + int16_t cna_seed; /* stereo CNA - seed for random CN generator */ int16_t flag_dtx_mode; float lp_speech; @@ -1354,10 +1346,7 @@ typedef struct Decoder_State /* MCT Channel mode indication: LFE, ignore channel? */ MCT_CHAN_MODE mct_chan_mode; - int16_t cng_ism_flag; /* CNG in ISM format flag */ -#ifndef FIX_ISM_DTX_CNG_BWIDTH_ALT - int16_t read_sid_info; /* For ParamISM, use the transmitted noise */ -#endif + int16_t cng_ism_flag; /* CNG in ISM format flag */ int16_t is_ism_format; /* Indication whether the codec operates in ISM format */ } Decoder_State, *DEC_CORE_HANDLE; diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index df6ffe6b8f7e0e68b510b1dd5c3721d3da45896e..8357dd3a82c2dedcf99d2b534d1ae36b5c7e12b8 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -63,12 +63,8 @@ #define LTE_VAR -4.0f -#define MAX_BRATE_DTX_EVS ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */ -#ifndef FIX_368_SBA_MODE -#define MAX_BRATE_DTX_IVAS IVAS_64k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ -#else -#define MAX_BRATE_DTX_IVAS IVAS_80k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ -#endif +#define MAX_BRATE_DTX_EVS ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */ +#define MAX_BRATE_DTX_IVAS IVAS_80k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ @@ -238,11 +234,7 @@ void dtx( } else { -#ifdef FIX_357_DTX_32K if ( ( st->cng_type == FD_CNG && ( st->total_brate <= MAX_BRATE_DTX_EVS || ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) ) ) || ( st->element_mode == IVAS_CPE_MDCT ) ) /* at highest bitrates, use exclusively LP_CNG */ -#else - if ( ( st->cng_type == FD_CNG && ( st->total_brate <= MAX_BRATE_DTX_EVS || ( st->element_mode == IVAS_SCE && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) ) ) || ( st->element_mode == IVAS_CPE_MDCT ) ) /* at highest bitrates, use exclusively LP_CNG */ -#endif { if ( st->element_mode == EVS_MONO && ( st->total_brate == ACELP_9k60 || st->total_brate == ACELP_16k40 || st->total_brate == ACELP_24k40 ) ) { diff --git a/lib_enc/ext_sig_ana.c b/lib_enc/ext_sig_ana.c old mode 100755 new mode 100644 index f79fbb5f95f2def7067e134ead944591d9d6882a..e76457e61c941f689e42359149bc27bfb3702a39 --- a/lib_enc/ext_sig_ana.c +++ b/lib_enc/ext_sig_ana.c @@ -443,20 +443,13 @@ void core_signal_analysis_high_bitrate( { ProcessIGF( st, hTcxEnc->spectrum[frameno], hTcxEnc->spectrum[frameno], powerSpec, transform_type[frameno] == TCX_20, frameno, 0, vad_hover_flag ); } - -#ifndef FIX_446_STEREO_DMX_CRASH - /* Copy memory */ - mvr2r( lsp_new, st->lspold_enc, M ); -#endif } } -#ifdef FIX_446_STEREO_DMX_CRASH if ( st->element_mode != IVAS_CPE_MDCT ) { /* Copy memory */ mvr2r( lsp_new, st->lspold_enc, M ); } -#endif return; } diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index f838fe36d399832e7afb26411dae40cb88a28770..439a0f6c63916f60cdb25a74be7b84768ea6c9bc 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -399,11 +399,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( n_CoreCoder_existing > cpe_id * CPE_CHANNELS + n ) { -#ifdef FIX_386_CORECODER_RECONFIG_2 mvr2r( input_buff[n], st_ivas->hCPE[cpe_id]->hCoreCoder[n]->input_buff, len_inp_memory ); -#else - mvr2r( input_buff[n], st_ivas->hCPE[cpe_id]->hCoreCoder[0]->input_buff, len_inp_memory ); /* TODO VoiceAge: Please check if this should be hCoreCoder[n] */ -#endif } } diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index e3a5db6f7f9de8cb37882afe5ebe40525c56fddb..efeb322d8508eb51ca073b7342b83d3f0d33a927 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -100,18 +100,9 @@ ivas_error ivas_dirac_enc_open( else { if ( ( error = ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_DIRAC, -#ifdef HODIRAC - FOA_CHANNELS -#else - DIRAC_MAX_ANA_CHANS -#endif - , - 0, 0, input_Fs -#ifdef HODIRAC - , - FOA_CHANNELS -#endif - ) ) != IVAS_ERR_OK ) + FOA_CHANNELS, + 0, 0, input_Fs, + FOA_CHANNELS ) ) != IVAS_ERR_OK ) { return error; } @@ -247,7 +238,6 @@ ivas_error ivas_dirac_enc_reconfigure( /* :TODO: if the number of parameter bands change, do a meaningful mapping of parameter buffers from old to new band setting */ -#ifdef LBR_SBA_DIRAC_FIX if ( st_ivas->hQMetaData->useLowerRes ) { @@ -258,10 +248,6 @@ ivas_error ivas_dirac_enc_reconfigure( { mvs2s( DirAC_block_grouping_5ms_MDFT, hDirAC->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); } -#else - - mvs2s( DirAC_block_grouping, hDirAC->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); -#endif return error; } @@ -389,13 +375,9 @@ void ivas_dirac_enc( set_zero( data_f[2], input_frame ); } - ivas_dirac_param_est_enc( hDirAC, &( hQMetaData->q_direction[0] ), hQMetaData->useLowerRes, data_f, NULL, NULL, input_frame, SBA_MODE_DIRAC -#ifdef HODIRAC - , + ivas_dirac_param_est_enc( hDirAC, &( hQMetaData->q_direction[0] ), hQMetaData->useLowerRes, data_f, NULL, NULL, input_frame, SBA_MODE_DIRAC, 0, - FOA_CHANNELS -#endif - ); + FOA_CHANNELS ); /* encode parameters */ if ( sba_planar || hQMetaData->useLowerRes ) @@ -407,12 +389,8 @@ void ivas_dirac_enc( } } - ivas_qmetadata_enc_encode( hMetaData, hQMetaData -#ifdef HODIRAC - , - 0 -#endif - ); + ivas_qmetadata_enc_encode( hMetaData, hQMetaData, + 0 ); *nb_bits_metadata = hMetaData->nb_bits_tot; @@ -576,10 +554,8 @@ void computeReferencePower_enc( const int16_t enc_param_start_band, /* i : first band to process */ const int16_t num_freq_bands, /* i : Number of frequency bands */ const SBA_MODE sba_mode /* i : SBA mode */ -#ifdef HODIRAC , const int16_t nchan_ana /* i : number of analysis channels */ -#endif ) { int16_t brange[2]; @@ -600,11 +576,7 @@ void computeReferencePower_enc( } reference_power[i] += reference_power_W[i]; -#ifdef HODIRAC for ( ch_idx = 1; ch_idx < nchan_ana; ch_idx++ ) -#else - for ( ch_idx = 1; ch_idx < DIRAC_MAX_ANA_CHANS; ch_idx++ ) -#endif { /* abs()^2 */ for ( j = brange[0]; j < brange[1]; j++ ) @@ -641,13 +613,9 @@ void ivas_dirac_param_est_enc( float **pp_fr_real, float **pp_fr_imag, const int16_t input_frame, - const SBA_MODE sba_mode -#ifdef HODIRAC - , + const SBA_MODE sba_mode, const int16_t hodirac_flag, - const int16_t nchan_fb_in -#endif -) + const int16_t nchan_fb_in ) { int16_t i, d, ts, index, l_ts, num_freq_bands; int16_t band_m_idx, block_m_idx; @@ -668,18 +636,14 @@ void ivas_dirac_param_est_enc( float reference_power[CLDFB_NO_COL_MAX][DIRAC_NO_FB_BANDS_MAX]; -#ifdef HODIRAC float azi_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 }; float ele_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 }; float diff_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 }; float ene_secs[2 * DIRAC_MAX_ANA_CHANS * DIRAC_MAX_NBANDS] = { 0 }; -#endif push_wmops( "dirac_enc_param_est" ); -#ifdef HODIRAC num_freq_bands = hDirAC->hConfig->nbands; -#endif /* Initialization */ l_ts = input_frame / MAX_PARAM_SPATIAL_SUBFRAMES; @@ -702,11 +666,7 @@ void ivas_dirac_param_est_enc( } /* Copy current frame to memory for delay compensation */ -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) -#endif { pcm_in[i] = &data_f[i][0]; p_Cldfb_RealBuffer[i] = &Cldfb_RealBuffer[i][0]; @@ -731,24 +691,12 @@ void ivas_dirac_param_est_enc( { if ( hDirAC->hFbMixer ) { - ivas_fb_mixer_get_windowed_fr( hDirAC->hFbMixer, pcm_in, p_Cldfb_RealBuffer, p_Cldfb_ImagBuffer, l_ts, l_ts -#ifdef HODIRAC - , - hDirAC->hFbMixer->fb_cfg->num_in_chans -#endif - ); - ivas_fb_mixer_update_prior_input( hDirAC->hFbMixer, pcm_in, l_ts -#ifdef HODIRAC - , - hDirAC->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_get_windowed_fr( hDirAC->hFbMixer, pcm_in, p_Cldfb_RealBuffer, p_Cldfb_ImagBuffer, l_ts, l_ts, + hDirAC->hFbMixer->fb_cfg->num_in_chans ); + ivas_fb_mixer_update_prior_input( hDirAC->hFbMixer, pcm_in, l_ts, + hDirAC->hFbMixer->fb_cfg->num_in_chans ); -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) -#endif { pcm_in[i] += l_ts; } @@ -760,24 +708,12 @@ void ivas_dirac_param_est_enc( assert( pp_fr_imag ); #endif -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) -#endif { -#ifdef LBR_SBA_DIRAC_FIX mvr2r( &pp_fr_real[i][ts * l_ts], Cldfb_RealBuffer[i], l_ts ); mvr2r( &pp_fr_imag[i][ts * l_ts], Cldfb_ImagBuffer[i], l_ts ); -#else - mvr2r( &pp_fr_real[i][block_m_idx * l_ts], Cldfb_RealBuffer[i], l_ts ); - mvr2r( &pp_fr_imag[i][block_m_idx * l_ts], Cldfb_ImagBuffer[i], l_ts ); -#endif } } -#ifndef HODIRAC - num_freq_bands = hDirAC->hConfig->nbands; -#endif computeReferencePower_enc( hDirAC->band_grouping, @@ -786,16 +722,8 @@ void ivas_dirac_param_est_enc( reference_power[ts], hDirAC->hConfig->enc_param_start_band, num_freq_bands, -#ifdef HODIRAC - hodirac_flag ? SBA_MODE_DIRAC : sba_mode -#else - sba_mode -#endif -#ifdef HODIRAC - , - FOA_CHANNELS -#endif - ); + hodirac_flag ? SBA_MODE_DIRAC : sba_mode, + FOA_CHANNELS ); computeIntensityVector_enc( hDirAC, @@ -805,9 +733,7 @@ void ivas_dirac_param_est_enc( num_freq_bands, intensity_real ); -#ifdef HODIRAC if ( !hodirac_flag ) -#endif { computeDirectionVectors( intensity_real[0], @@ -832,15 +758,12 @@ void ivas_dirac_param_est_enc( computeDiffuseness_mdft( hDirAC->buffer_intensity_real, hDirAC->buffer_energy, num_freq_bands, hDirAC->no_col_avg_diff, diffuseness_vector ); -#ifdef HODIRAC if ( hodirac_flag ) { calculate_hodirac_sector_parameters( Cldfb_RealBuffer, Cldfb_ImagBuffer, l_ts, 0.20f, hDirAC->band_grouping, hDirAC->hConfig->nbands, hDirAC->hConfig->enc_param_start_band, azi_secs, ele_secs, diff_secs, ene_secs ); } -#endif -#ifdef HODIRAC if ( hodirac_flag ) { for ( band_m_idx = 0; band_m_idx < hDirAC->hConfig->nbands; band_m_idx++ ) @@ -850,7 +773,6 @@ void ivas_dirac_param_est_enc( } } else -#endif { for ( band_m_idx = 0; band_m_idx < hDirAC->hConfig->nbands; band_m_idx++ ) { @@ -867,9 +789,7 @@ void ivas_dirac_param_est_enc( } } -#ifdef HODIRAC if ( !hodirac_flag ) -#endif { @@ -909,7 +829,6 @@ void ivas_dirac_param_est_enc( } /* Sectors */ -#ifdef HODIRAC if ( hodirac_flag ) { for ( band_m_idx = 0; band_m_idx < hDirAC->hConfig->nbands; band_m_idx++ ) @@ -923,7 +842,6 @@ void ivas_dirac_param_est_enc( q_direction[1].band_data[band_m_idx].energy_ratio[block_m_idx] = ( 1.f - diff_secs[band_m_idx] ) / ( ( 1.f - diff_secs[band_m_idx] ) + ( 1.f - diff_secs[num_freq_bands + band_m_idx] ) + EPSILON ); } } -#endif } /* Diffuseness */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 0faa86af3a2792f929308f45542d6ad796e3498d..854f638491781ce15292d970f9c502099bbf196c 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -132,17 +132,9 @@ ivas_error ivas_enc( /* bypass EVS coding in float precision, emulating EVS encoder/decoder delay */ for ( i = 0; i < n; i++ ) { - if ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) -#ifdef HODIRAC - && !( st_ivas->sba_analysis_order > 1 ) -#endif - ) + if ( ( ivas_format == SBA_FORMAT ) && ( st_ivas->sba_mode == SBA_MODE_SPAR ) && !( st_ivas->sba_analysis_order > 1 ) ) { -#ifdef HODIRAC hp20( data_f[HOA_keep_ind[st_ivas->hSpar->hMdEnc->HOA_md_ind[i]]], input_frame, st_ivas->mem_hp20_in[i], input_Fs ); -#else - hp20( data_f[HOA_keep_ind[i]], input_frame, st_ivas->mem_hp20_in[i], input_Fs ); -#endif } else if ( !( ivas_format == MC_FORMAT && i == LFE_CHANNEL ) ) /*TODO: is the HPF needed for LFE channel? */ { @@ -308,7 +300,6 @@ ivas_error ivas_enc( return error; } } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { @@ -323,7 +314,6 @@ ivas_error ivas_enc( return error; } } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { /* encode Parametric MC parameters and write bitstream */ diff --git a/lib_enc/ivas_enc_cov_handler.c b/lib_enc/ivas_enc_cov_handler.c index 6575d751a9a366c0e32b5a389d65f2e6cc84841c..2d1c5425bf37e061f1d25340ef70b0397c40e7e6 100644 --- a/lib_enc/ivas_enc_cov_handler.c +++ b/lib_enc/ivas_enc_cov_handler.c @@ -34,9 +34,7 @@ #include "options.h" #include "prot.h" #include "ivas_prot.h" -#ifdef HODIRAC #include "ivas_rom_com.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -56,12 +54,7 @@ * Local functions declarations *------------------------------------------------------------------------------------------*/ -static void ivas_band_cov( float **ppIn_FR_real, float **ppIn_FR_imag, const int16_t num_chans, const int16_t num_bins, int16_t stride, float **pFb_bin_to_band, const int16_t *pFb_start_bin_per_band, const int16_t *pFb_active_bins_per_band, const int16_t start_band, const int16_t end_band, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] -#ifdef HODIRAC - , - const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] -#endif -); +static void ivas_band_cov( float **ppIn_FR_real, float **ppIn_FR_imag, const int16_t num_chans, const int16_t num_bins, int16_t stride, float **pFb_bin_to_band, const int16_t *pFb_start_bin_per_band, const int16_t *pFb_active_bins_per_band, const int16_t start_band, const int16_t end_band, float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] ); /*------------------------------------------------------------------------- * ivas_spar_covar_enc_open() @@ -92,13 +85,11 @@ ivas_error ivas_spar_covar_enc_open( cov_smooth_cfg.max_bands = IVAS_MAX_NUM_BANDS; cov_smooth_cfg.max_update_rate = MAX_UPDATE_RATE; cov_smooth_cfg.min_pool_size = MIN_POOL_SIZE; -#ifdef MC_PARAMUPMIX_MODE if ( nchan_inp == 3 ) /* to discriminate between SPAR and mc there could be a better solution */ { cov_smooth_cfg.max_update_rate = 1.0f; cov_smooth_cfg.min_pool_size = 20; } -#endif if ( ( error = ivas_spar_covar_smooth_enc_open( &hCovState->pCov_state, &cov_smooth_cfg, pFb, nchan_inp, ivas_total_brate ) ) != IVAS_ERR_OK ) { @@ -169,12 +160,8 @@ void ivas_enc_cov_handler_process( const int16_t end_band, const int16_t num_ch, const int16_t dtx_vad, - const int16_t transient_det[2] -#ifdef HODIRAC - , - const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] -#endif -) + const int16_t transient_det[2], + const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] ) { int16_t i, j; int16_t dtx_cov_flag; @@ -187,12 +174,8 @@ void ivas_enc_cov_handler_process( pFb->fb_bin_to_band.p_short_stride_start_bin_per_band, pFb->fb_bin_to_band.p_short_stride_num_bins_per_band, start_band, end_band, - cov_real -#ifdef HODIRAC - , - HOA_md_ind -#endif - ); + cov_real, + HOA_md_ind ); #ifdef DEBUG_SPAR_WRITE_OUT_COV { @@ -284,12 +267,8 @@ static void ivas_band_cov( const int16_t *pFb_active_bins_per_band, const int16_t start_band, const int16_t end_band, - float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] -#ifdef HODIRAC - , - const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] -#endif -) + float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], + const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] ) { int16_t i, j, k; float pV_re[L_FRAME48k]; @@ -300,23 +279,12 @@ static void ivas_band_cov( for ( j = i; j < num_chans; j++ ) { -#ifdef HODIRAC -#ifdef HODIRAC int16_t i1 = HOA_md_ind[i]; int16_t j1 = HOA_md_ind[j]; -#else - int16_t i1 = HOA_keep_ind_spar[i]; - int16_t j1 = HOA_keep_ind_spar[j]; -#endif -#endif for ( k = 0; k < num_bins; k++ ) { -#ifdef HODIRAC pV_re[k] = ppIn_FR_real[i1][k] * ppIn_FR_real[j1][k] + ppIn_FR_imag[i1][k] * ppIn_FR_imag[j1][k]; -#else - pV_re[k] = ppIn_FR_real[i][k] * ppIn_FR_real[j][k] + ppIn_FR_imag[i][k] * ppIn_FR_imag[j][k]; -#endif } for ( k = start_band; k < end_band; k++ ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 1a53481270220d7e9b08669c7353f11c111e661c..d96442835275a54e21750d0efe088cfbc99c62a6 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -57,11 +57,7 @@ void ivas_write_format( ind = 0; nBits = IVAS_FORMAT_SIGNALING_NBITS; -#ifdef COMBINED_FORMAT_SIGNALING extra_bits = ( IVAS_FORMAT_SIGNALING_NBITS_EXTENDED - IVAS_FORMAT_SIGNALING_NBITS ); -#else - extra_bits = ( IVAS_FORMAT_SIGNALING_NBITS_SBA - IVAS_FORMAT_SIGNALING_NBITS ); -#endif switch ( st_ivas->hEncoderConfig->ivas_format ) { @@ -70,13 +66,11 @@ void ivas_write_format( break; case ISM_FORMAT: ind = 2; -#ifdef COMBINED_FORMAT_SIGNALING if ( st_ivas->hEncoderConfig->ivas_total_brate >= IVAS_24k4 ) { ind = 4; nBits += extra_bits; } -#endif break; case MC_FORMAT: ind = 1; @@ -195,26 +189,16 @@ int16_t getNumChanAnalysis( n = st_ivas->nSCE + CPE_CHANNELS * st_ivas->nCPE; if ( st_ivas->hEncoderConfig->ivas_format == SBA_FORMAT ) { -#ifdef HODIRAC n = ( st_ivas->sba_analysis_order + 1 ) * ( st_ivas->sba_analysis_order + 1 ); -#else -#ifdef HODIRAC - n = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->ivas_total_brate ); -#else - n = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); -#endif -#endif } else if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_PARAMMC || st_ivas->mc_mode == MC_MODE_MCMASA ) ) { n = st_ivas->hEncoderConfig->nchan_inp; } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { n = st_ivas->hEncoderConfig->nchan_inp; } -#endif else if ( st_ivas->hEncoderConfig->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) { n = st_ivas->hEncoderConfig->nchan_inp; @@ -315,10 +299,8 @@ void ivas_initialize_handles_enc( /* MCT handle */ st_ivas->hMCT = NULL; -#ifdef MC_PARAMUPMIX_MODE /* MC Param-Upmix handle */ st_ivas->hMCParamUpmix = NULL; -#endif /* Parametric MC handle */ st_ivas->hParamMC = NULL; @@ -667,7 +649,6 @@ ivas_error ivas_init_encoder( st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels( st_ivas->hEncoderConfig->mc_input_setup ); } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { st_ivas->nSCE = 0; @@ -713,7 +694,6 @@ ivas_error ivas_init_encoder( return error; } } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { if ( ( error = ivas_param_mc_enc_open( st_ivas ) ) != IVAS_ERR_OK ) @@ -1106,10 +1086,8 @@ void ivas_destroy_enc( /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); -#ifdef MC_PARAMUPMIX_MODE /* Param-Upmix MC handle */ ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); -#endif /* Parametric MC handle */ ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); diff --git a/lib_enc/ivas_ism_dtx_enc.c b/lib_enc/ivas_ism_dtx_enc.c index 8f856ff07e8d1cf674ca9b12f0965c8b2282b5e5..907997cf988a94f7ad4408080fbc2bd3fd0d27a7 100644 --- a/lib_enc/ivas_ism_dtx_enc.c +++ b/lib_enc/ivas_ism_dtx_enc.c @@ -257,7 +257,6 @@ int16_t ivas_ism_dtx_enc( /* IVAS format signaling was erased in dtx() */ if ( hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot == 0 ) { -#ifdef COMBINED_FORMAT_SIGNALING /* replicate ivas_write_format() */ int16_t ind = 2; nBits = IVAS_FORMAT_SIGNALING_NBITS; @@ -268,9 +267,6 @@ int16_t ivas_ism_dtx_enc( } push_indice( hSCE[0]->hCoreCoder[0]->hBstr, IND_IVAS_FORMAT, ind, nBits ); -#else - push_indice( hSCE[0]->hCoreCoder[0]->hBstr, IND_IVAS_FORMAT, 2 /* == ISM format */, IVAS_FORMAT_SIGNALING_NBITS ); -#endif } } else /* ism_dtx_flag == 1 */ diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index bfa1342bb57400cee47cd58112384a41707c12c4..8780573773897d6fefa66e19af82cff6919f80d1 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -417,11 +417,7 @@ ivas_error ivas_ism_enc_config( st_ivas->nSCE = st_ivas->nchan_transport; st_ivas->nCPE = 0; -#ifdef ISM_NON_DIEGETIC_PAN 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 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hEncoderConfig->nchan_inp, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 36d15266d26272e82485d1ebadf9936b57cdfc59..a8c4982e4b39bb22a706951690e3d69be4caef77 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -55,15 +55,11 @@ #define ISM_MAX_ELEVATION_DIFF_IDX ( ISM_ELEVATION_NBITS - 1 /*zero*/ - 1 /*sign*/ ) #define ISM_MAX_RADIUS_DIFF_IDX ( ISM_RADIUS_NBITS - 1 /*zero*/ - 1 /*sign*/ ) -#define ISM_FEC_MAX 10 -#ifdef FIX_387_ISM_MD_FEC -#define ISM_MD_FEC_DIFF 10 -#define ISM_MD_INC_DIFF_CNT_MAX 6 -#define ISM_MD_FEC_CNT_MAX 25 -#endif -#ifdef FIX_435_ISM_MERGE_BUG -#define ISM_MD_RAD_FEC_DIFF 1 -#endif +#define ISM_FEC_MAX 10 +#define ISM_MD_FEC_DIFF 10 +#define ISM_MD_INC_DIFF_CNT_MAX 6 +#define ISM_MD_FEC_CNT_MAX 25 +#define ISM_MD_RAD_FEC_DIFF 1 #define INTER_OBJECT_PARAM_CHECK ( ( ISM_FEC_MAX / 2 ) - 2 ) /* note: constant must be less than (ISM_FEC_MAX / number of coded parameters) */ @@ -83,17 +79,13 @@ static void encode_radius( BSTR_ENC_HANDLE hBstr, int16_t *last_radius_idx, int1 *-------------------------------------------------------------------------*/ ivas_error ivas_set_ism_metadata( - ISM_METADATA_HANDLE hIsmMeta, /* o : ISM metadata handle */ - const float azimuth, /* i : azimuth value */ - const float elevation, /* i : elevation */ - const float radius_meta, /* i : radius */ - const float yaw, /* i : yaw */ -#ifdef ISM_NON_DIEGETIC_PAN + ISM_METADATA_HANDLE hIsmMeta, /* o : ISM metadata handle */ + const float azimuth, /* i : azimuth value */ + const float elevation, /* i : elevation */ + const float radius_meta, /* i : radius */ + const float yaw, /* i : yaw */ const float pitch, /* i : pitch */ const int16_t non_diegetic_flag /* i : non-diegetic object flag*/ -#else - const float pitch /* i : pitch */ -#endif ) { if ( hIsmMeta == NULL ) @@ -109,9 +101,7 @@ ivas_error ivas_set_ism_metadata( hIsmMeta->radius = radius_meta; hIsmMeta->yaw = yaw; hIsmMeta->pitch = pitch; -#ifdef ISM_NON_DIEGETIC_PAN hIsmMeta->non_diegetic_flag = non_diegetic_flag; -#endif return IVAS_ERR_OK; } @@ -202,9 +192,7 @@ ivas_error ivas_ism_metadata_enc( ISM_METADATA_HANDLE hIsmMetaData; int32_t element_brate[MAX_NUM_OBJECTS], total_brate[MAX_NUM_OBJECTS]; int16_t ism_metadata_flag_global; -#ifdef ISM_NON_DIEGETIC_PAN int16_t non_diegetic_flag_global; -#endif int16_t ism_imp[MAX_NUM_OBJECTS]; int16_t nbands, nblocks; ivas_error error; @@ -215,9 +203,7 @@ ivas_error ivas_ism_metadata_enc( /* initialization */ ism_metadata_flag_global = 0; -#ifdef ISM_NON_DIEGETIC_PAN non_diegetic_flag_global = 0; -#endif set_s( nb_bits_metadata, 0, nchan_transport ); set_s( flag_abs_azimuth, 0, nchan_ism ); set_s( flag_abs_elevation, 0, nchan_ism ); @@ -237,24 +223,15 @@ ivas_error ivas_ism_metadata_enc( } else if ( ism_mode == ISM_MODE_DISC ) { -#ifdef FIX_435_ISM_MERGE_BUG if ( hIsmMeta[ch]->ism_metadata_flag == 1 ) { /* In case of low level noise for low bitrate inactive frames, do not sent metadata */ hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10 || hSCE[ch]->hCoreCoder[0]->tcxonly; -#else - hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10; -#endif -#ifdef FIX_387_ISM_MD_FEC /* in inactive frames, send MD 1) in ISM_MD_INC_DIFF_CNT_MAX consecutive frames when MD significantly change, 2) at least every ISM_MD_FEC_DIFF frames */ if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { if ( ( fabsf( hIsmMeta[ch]->azimuth - hIsmMeta[ch]->last_true_azimuth ) > ISM_MD_FEC_DIFF ) || - ( fabsf( hIsmMeta[ch]->elevation - hIsmMeta[ch]->last_true_elevation ) > ISM_MD_FEC_DIFF ) -#ifdef FIX_435_ISM_MERGE_BUG - || ( fabsf( hIsmMeta[ch]->radius - hIsmMeta[ch]->last_true_radius ) > ISM_MD_RAD_FEC_DIFF ) -#endif - ) + ( fabsf( hIsmMeta[ch]->elevation - hIsmMeta[ch]->last_true_elevation ) > ISM_MD_FEC_DIFF ) || ( fabsf( hIsmMeta[ch]->radius - hIsmMeta[ch]->last_true_radius ) > ISM_MD_RAD_FEC_DIFF ) ) { hIsmMeta[ch]->ism_metadata_flag = 1; hIsmMeta[ch]->ism_md_inc_diff_cnt = 0; @@ -278,10 +255,7 @@ ivas_error ivas_ism_metadata_enc( hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; } } -#endif -#ifdef FIX_435_ISM_MERGE_BUG } -#endif } } @@ -303,26 +277,22 @@ ivas_error ivas_ism_metadata_enc( } push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); -#ifdef ISM_NON_DIEGETIC_PAN for ( ch = 0; ch < nchan_ism; ch++ ) { ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; non_diegetic_flag_global |= hIsmMeta[ch]->non_diegetic_flag; } -#endif /* write extended metadata presence flag */ if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) { push_indice( hBstr, IND_ISM_EXTENDED_FLAG, ism_extended_metadata_flag, ISM_EXTENDED_METADATA_BITS ); -#ifdef ISM_NON_DIEGETIC_PAN /* Write global non-diegetic object flag */ if ( ism_extended_metadata_flag ) { push_indice( hBstr, IND_ISM_EXTENDED_NDP_FLAG, non_diegetic_flag_global, ISM_EXTENDED_METADATA_BITS ); } -#endif } /* write ISM metadata flag (one per object) */ @@ -331,12 +301,6 @@ ivas_error ivas_ism_metadata_enc( push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); } -#ifndef ISM_NON_DIEGETIC_PAN - for ( ch = 0; ch < nchan_ism; ch++ ) - { - ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; - } -#endif if ( ism_mode == ISM_MODE_DISC ) { /* write VAD flag */ @@ -378,7 +342,6 @@ ivas_error ivas_ism_metadata_enc( * Quantize and encode azimuth and elevation *----------------------------------------------------------------*/ -#ifdef ISM_NON_DIEGETIC_PAN if ( ism_extended_metadata_flag && non_diegetic_flag_global ) { /* Write non-diegetic flag for each object */ @@ -403,7 +366,6 @@ ivas_error ivas_ism_metadata_enc( } else { -#endif if ( ism_mode == ISM_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 ); @@ -430,9 +392,7 @@ ivas_error ivas_ism_metadata_enc( 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] ); encode_radius( hBstr, &hIsmMetaData->last_radius_idx, &hIsmMetaData->radius_diff_cnt, hIsmMetaData->last_ism_metadata_flag, idx_radius_abs, &flag_abs_radius[ch] ); } -#ifdef ISM_NON_DIEGETIC_PAN } -#endif /* save number of metadata bits written */ if ( ism_mode == ISM_MODE_DISC ) @@ -440,14 +400,10 @@ ivas_error ivas_ism_metadata_enc( nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; } -#ifdef FIX_387_ISM_MD_FEC /* Updates */ hIsmMeta[ch]->last_true_azimuth = hIsmMeta[ch]->azimuth; hIsmMeta[ch]->last_true_elevation = hIsmMeta[ch]->elevation; -#endif -#ifdef FIX_435_ISM_MERGE_BUG hIsmMeta[ch]->last_true_radius = hIsmMeta[ch]->radius; -#endif } } @@ -576,11 +532,7 @@ ivas_error ivas_ism_metadata_enc( * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ -#ifdef ISM_NON_DIEGETIC_PAN if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, ism_extended_metadata_flag, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -589,7 +541,6 @@ ivas_error ivas_ism_metadata_enc( { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; -#ifdef FIX_387_ISM_MD_FEC if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { hIsmMeta[ch]->ism_md_fec_cnt_enc++; @@ -600,19 +551,13 @@ ivas_error ivas_ism_metadata_enc( } hIsmMeta[ch]->ism_md_inc_diff_cnt++; hIsmMeta[ch]->ism_md_inc_diff_cnt = min( hIsmMeta[ch]->ism_md_inc_diff_cnt, ISM_MD_INC_DIFF_CNT_MAX ); -#endif } for ( ch = 0; ch < nchan_transport; ch++ ) { -#ifdef FIX_419_ISM_BRATE_SW_DTX hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; -#endif if ( ism_mode == ISM_MODE_DISC ) { -#ifndef FIX_419_ISM_BRATE_SW_DTX - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; -#endif if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; @@ -691,22 +636,14 @@ ivas_error ivas_ism_metadata_enc_create( st_ivas->hIsmMetaData[ch]->last_azimuth = 0.0f; st_ivas->hIsmMetaData[ch]->last_elevation = 0.0f; -#ifdef FIX_387_ISM_MD_FEC st_ivas->hIsmMetaData[ch]->last_true_azimuth = 0.0f; st_ivas->hIsmMetaData[ch]->last_true_elevation = 0.0f; st_ivas->hIsmMetaData[ch]->ism_md_fec_cnt_enc = 0; st_ivas->hIsmMetaData[ch]->ism_md_inc_diff_cnt = ISM_MD_INC_DIFF_CNT_MAX; -#endif -#ifdef FIX_435_ISM_MERGE_BUG st_ivas->hIsmMetaData[ch]->last_true_radius = 1.0f; -#endif } -#ifdef ISM_NON_DIEGETIC_PAN 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 ) -#else - if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -915,11 +852,7 @@ static void encode_angle_indices( if ( *flag_abs_angle1 == 0 ) { angle->angle1_diff_cnt++; -#ifdef FIX_419_ISM_MD_FIX angle->angle1_diff_cnt = min( angle->angle1_diff_cnt, ISM_FEC_MAX ); -#else - angle->angle2_diff_cnt = min( angle->angle2_diff_cnt, ISM_FEC_MAX ); -#endif } else { @@ -942,10 +875,8 @@ static void encode_angle_indices( * Elevation/pitch index encoding *----------------------------------------------------------------*/ -#ifdef ISM_NON_DIEGETIC_PAN if ( flag_abs_angle2 ) { -#endif idx_angle2 = idx_angle2_abs; nbits_diff_angle2 = 0; *flag_abs_angle2 = 0; /* differential coding by default */ @@ -1056,9 +987,7 @@ static void encode_angle_indices( { push_indice( hBstr, IND_ISM_ELEVATION, idx_angle2, nbits_diff_angle2 ); } -#ifdef ISM_NON_DIEGETIC_PAN } -#endif /*----------------------------------------------------------------* * Updates @@ -1197,10 +1126,8 @@ void ivas_ism_metadata_sid_enc( hIsmMetaData->position_angle.last_angle2_idx = idx_elevation << ( ISM_ELEVATION_NBITS - nBits_elevation ); } -#ifdef FIX_387_ISM_MD_FEC hIsmMetaData->ism_md_fec_cnt_enc = 0; hIsmMeta[ch]->ism_md_inc_diff_cnt = ISM_MD_INC_DIFF_CNT_MAX; -#endif } } diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index db7ab98b10ea552895204aece8dff4bc424e739d..6afb57c1557831c6c65c8060a68a2b92d7edd410 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -55,12 +55,10 @@ static void ivas_param_ism_compute_obj_parameters( int16_t i, b, m, br, mr; int16_t brange_start, brange_end, mrange_start, mrange_end, time_merge_fac; float power_ratios_m[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS]; -#ifdef FIX_440_PARAM_ISM_DIR_NOISE float ref_power_local_frame[MAX_NUM_OBJECTS]; float tmp_ratio; set_f( ref_power_local_frame, 0, MAX_NUM_OBJECTS ); -#endif assert( nchan_ism == 3 || nchan_ism == 4 ); @@ -96,10 +94,8 @@ static void ivas_param_ism_compute_obj_parameters( ref_power_local[i] += reference_power_obj[i][mr][br]; } } -#ifdef FIX_440_PARAM_ISM_DIR_NOISE /* Sum up T/F tiles per object */ ref_power_local_frame[i] += ref_power_local[i]; -#endif } /* find two dominant objects and derive object indices for current T/F tile */ @@ -155,7 +151,6 @@ static void ivas_param_ism_compute_obj_parameters( } } -#ifdef FIX_440_PARAM_ISM_DIR_NOISE /* Check if objects have roughly equal power by comparing reference power of first object against all others*/ hParamIsm->flag_equal_energy = 1; for ( i = 1; i < nchan_ism; i++ ) @@ -175,7 +170,6 @@ static void ivas_param_ism_compute_obj_parameters( } } } -#endif return; } @@ -305,12 +299,8 @@ ivas_error ivas_param_ism_enc_open( /* set FB config. */ - if ( ( error = ivas_fb_set_cfg( &fb_cfg, ISM_FORMAT, SBA_MODE_NONE, st_ivas->hEncoderConfig->nchan_inp, 0, 0, input_Fs -#ifdef HODIRAC - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_fb_set_cfg( &fb_cfg, ISM_FORMAT, SBA_MODE_NONE, st_ivas->hEncoderConfig->nchan_inp, 0, 0, input_Fs, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -420,19 +410,11 @@ void ivas_param_ism_enc( for ( ts = 0; ts < num_time_slots; ts++ ) { - ivas_fb_mixer_get_windowed_fr( hDirAC->hFbMixer, pcm_in, p_fb_RealBuffer, p_fb_ImagBuffer, l_ts, l_ts -#ifdef HODIRAC - , - hDirAC->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_get_windowed_fr( hDirAC->hFbMixer, pcm_in, p_fb_RealBuffer, p_fb_ImagBuffer, l_ts, l_ts, + hDirAC->hFbMixer->fb_cfg->num_in_chans ); - ivas_fb_mixer_update_prior_input( hDirAC->hFbMixer, pcm_in, l_ts -#ifdef HODIRAC - , - hDirAC->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_update_prior_input( hDirAC->hFbMixer, pcm_in, l_ts, + hDirAC->hFbMixer->fb_cfg->num_in_chans ); for ( i = 0; i < nchan_ism; i++ ) { @@ -473,36 +455,6 @@ void ivas_param_ism_compute_noisy_speech_flag( st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i + 1]; } -#ifndef FIX_440_PARAM_ISM_DIR_NOISE - /* For the current frame, make a decision based on some core-coder flags */ - if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr ) - { -#ifdef FIX_422 - if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag || st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) -#else - if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag && st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) -#endif - { - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; - } - else - { - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 1; - } - } - else - { - - st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; - } - - /* Do a decision based on hysterisis */ - st_ivas->hDirAC->hParamIsm->flag_noisy_speech = 1; - for ( i = 0; i < PARAM_ISM_HYS_BUF_SIZE; i++ ) - { - st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i]; - } -#else /* Set flag_noisy_speech to 0 for cases where object energies are not roughly equal */ if ( !st_ivas->hDirAC->hParamIsm->flag_equal_energy ) { @@ -514,11 +466,7 @@ void ivas_param_ism_compute_noisy_speech_flag( /* For the current frame, make a decision based on some core-coder flags */ if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr ) { -#ifdef FIX_422 if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag || st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) -#else - if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag && st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) -#endif { st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; } @@ -539,7 +487,6 @@ void ivas_param_ism_compute_noisy_speech_flag( st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i]; } } -#endif return; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 2527fa91aabc9fc6f29477f31246637889489b33..2de3fa05cfefafa48b234a254fbada16e3720267 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -76,9 +76,7 @@ static uint8_t are_masa_subframes_similar( const MASA_METADATA_HANDLE frame1, co static void detect_framing_async( MASA_ENCODER_HANDLE hMasa ); -#ifdef FIX_398_MASA_DIRECTION_ALIGNMENT static void masa_metadata_direction_alignment( MASA_ENCODER_HANDLE hMasa ); -#endif /*-----------------------------------------------------------------------* * Local constants @@ -150,12 +148,10 @@ ivas_error ivas_masa_enc_open( hMasa->data.sync_state.prev_offset = 0; hMasa->data.sync_state.frame_mode = MASA_FRAME_4SF; -#ifdef FIX_398_MASA_DIRECTION_ALIGNMENT set_zero( hMasa->data.dir_align_state.previous_azi_dir1, MASA_FREQUENCY_BANDS ); set_zero( hMasa->data.dir_align_state.previous_ele_dir1, MASA_FREQUENCY_BANDS ); 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 ); -#endif st_ivas->hMasa = hMasa; @@ -342,12 +338,8 @@ ivas_error ivas_masa_encode( else { #endif - ivas_qmetadata_enc_encode( hMetaData, hQMetaData -#ifdef HODIRAC - , - 0 -#endif - ); + ivas_qmetadata_enc_encode( hMetaData, hQMetaData, + 0 ); #ifdef HR_METADATA } #endif @@ -525,9 +517,7 @@ ivas_error ivas_masa_enc_config( if ( ivas_format == MASA_FORMAT ) { -#ifdef FIX_398_MASA_DIRECTION_ALIGNMENT masa_metadata_direction_alignment( hMasa ); -#endif detect_framing_async( hMasa ); /* detect the offset, set 1sf/4sf mode based on this. potentially also shift the metadata using a history buffer */ @@ -2177,7 +2167,6 @@ static void detect_framing_async( } -#ifdef FIX_398_MASA_DIRECTION_ALIGNMENT /*-------------------------------------------------------------------* * masa_metadata_direction_alignment() * @@ -2339,4 +2328,3 @@ static void masa_metadata_direction_alignment( return; } -#endif diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index f32a5b60d3deaf136a848945b794141c46601116..ff01bd3aa19dfd28470ea75a06a3094efb165f8d 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -140,12 +140,8 @@ ivas_error ivas_param_mc_enc_open( hParamMC->dmx_factors = ivas_param_mc_conf[config_index].dmx_fac; /* set FB config. */ - if ( ( error = ivas_fb_set_cfg( &fb_cfg, MC_FORMAT, SBA_MODE_DIRAC, nchan_inp, 0, 0, input_Fs -#ifdef HODIRAC - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_fb_set_cfg( &fb_cfg, MC_FORMAT, SBA_MODE_DIRAC, nchan_inp, 0, 0, input_Fs, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -204,11 +200,7 @@ ivas_error ivas_param_mc_enc_open( /* parameter band grouping: 60 band CLDFB to 240 band MDFT resolution */ for ( i = 0; i < hParamMC->hMetadataPMC.num_parameter_bands + 1; i++ ) { -#ifdef PARAMMC_SHORT_ENC_MDFT hParamMC->band_grouping[i] *= PARAM_MC_CLDFB_TO_MDFT_FAC; -#else - hParamMC->band_grouping[i] *= CLDFB_TO_MDFT_FAC; -#endif } /* set correct coded band width */ @@ -344,11 +336,7 @@ ivas_error ivas_param_mc_enc_reconfig( /* parameter band grouping: 60 band CLDFB to 240 band MDFT resolution */ for ( i = 0; i < hParamMC->hMetadataPMC.num_parameter_bands + 1; i++ ) { -#ifdef PARAMMC_SHORT_ENC_MDFT hParamMC->band_grouping[i] *= PARAM_MC_CLDFB_TO_MDFT_FAC; -#else - hParamMC->band_grouping[i] *= CLDFB_TO_MDFT_FAC; -#endif } /* set correct coded band width */ @@ -686,12 +674,8 @@ static void ivas_param_mc_param_est_enc( for ( ts = 0; ts < start_ts; ts++ ) { - ivas_fb_mixer_update_prior_input( hParamMC->hFbMixer, pcm_in, l_ts -#ifdef HODIRAC - , - hParamMC->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_update_prior_input( hParamMC->hFbMixer, pcm_in, l_ts, + hParamMC->hFbMixer->fb_cfg->num_in_chans ); for ( i = 0; i < nchan_input; i++ ) { pcm_in[i] += l_ts; @@ -700,22 +684,10 @@ static void ivas_param_mc_param_est_enc( for ( ts = start_ts; ts < num_time_slots; ts++ ) { -#ifdef PARAMMC_SHORT_ENC_MDFT - ivas_fb_mixer_get_windowed_fr( hParamMC->hFbMixer, pcm_in, p_slot_frame_f_real, p_slot_frame_f_imag, l_ts, l_ts -#ifdef HODIRAC - , - hParamMC->hFbMixer->fb_cfg->num_in_chans -#endif - ); -#else - ivas_fb_mixer_get_windowed_fr( hParamMC->hFbMixer, pcm_in, p_slot_frame_f_real, p_slot_frame_f_imag, l_ts, 2 * l_ts ); -#endif - ivas_fb_mixer_update_prior_input( hParamMC->hFbMixer, pcm_in, l_ts -#ifdef HODIRAC - , - hParamMC->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_get_windowed_fr( hParamMC->hFbMixer, pcm_in, p_slot_frame_f_real, p_slot_frame_f_imag, l_ts, l_ts, + hParamMC->hFbMixer->fb_cfg->num_in_chans ); + ivas_fb_mixer_update_prior_input( hParamMC->hFbMixer, pcm_in, l_ts, + hParamMC->hFbMixer->fb_cfg->num_in_chans ); for ( i = 0; i < nchan_input; i++ ) { diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index 6363ee3b130f9d7599b940f5db81fc674bf25bf0..fc093c3f59644e9a5538fbe5a389a8ed126fab8d 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -49,7 +49,6 @@ #endif #include "wmc_auto.h" -#ifdef MC_PARAMUPMIX_MODE /*------------------------------------------------------------------------- * Local function prototypes *------------------------------------------------------------------------*/ @@ -185,12 +184,8 @@ ivas_error ivas_mc_paramupmix_enc_open( /* set FB config. */ /* need to set num output channels to a value > 0 to get pFb != NULL */ - if ( ( error = ivas_fb_set_cfg( &fb_cfg, MC_FORMAT, SBA_MODE_SPAR, MC_PARAMUPMIX_COMBINATIONS * MC_PARAMUPMIX_NCH, MC_PARAMUPMIX_COMBINATIONS, 0, input_Fs -#ifdef HODIRAC - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_fb_set_cfg( &fb_cfg, MC_FORMAT, SBA_MODE_SPAR, MC_PARAMUPMIX_COMBINATIONS * MC_PARAMUPMIX_NCH, MC_PARAMUPMIX_COMBINATIONS, 0, input_Fs, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -740,9 +735,7 @@ static void ivas_mc_paramupmix_param_est_enc( int16_t chan1s[4] = { 4, 5, 8, 9 }; int16_t chan2s[4] = { 6, 7, 10, 11 }; -#ifdef HODIRAC const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; -#endif for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { @@ -778,18 +771,10 @@ static void ivas_mc_paramupmix_param_est_enc( l_ts = input_frame / MAX_PARAM_SPATIAL_SUBFRAMES; for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { - ivas_fb_mixer_get_windowed_fr( hMCParamUpmix->hFbMixer, pcm_in, pp_in_fr_real, pp_in_fr_imag, l_ts, l_ts -#ifdef HODIRAC - , - hMCParamUpmix->hFbMixer->fb_cfg->num_in_chans -#endif - ); - ivas_fb_mixer_update_prior_input( hMCParamUpmix->hFbMixer, pcm_in, l_ts -#ifdef HODIRAC - , - hMCParamUpmix->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_get_windowed_fr( hMCParamUpmix->hFbMixer, pcm_in, pp_in_fr_real, pp_in_fr_imag, l_ts, l_ts, + hMCParamUpmix->hFbMixer->fb_cfg->num_in_chans ); + ivas_fb_mixer_update_prior_input( hMCParamUpmix->hFbMixer, pcm_in, l_ts, + hMCParamUpmix->hFbMixer->fb_cfg->num_in_chans ); for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS * MC_PARAMUPMIX_NCH; i++ ) { pcm_in[i] += l_ts; @@ -817,11 +802,7 @@ static void ivas_mc_paramupmix_param_est_enc( cov_dtx_real[i][j] = hMCParamUpmix->cov_dtx_real[b][i][j]; } } -#ifdef HODIRAC ivas_enc_cov_handler_process( hMCParamUpmix->hCovEnc[b], pp_in_fr_real, pp_in_fr_imag, cov_real, cov_dtx_real, hMCParamUpmix->hFbMixer->pFb, 0, hMCParamUpmix->hFbMixer->pFb->filterbank_num_bands, MC_PARAMUPMIX_NCH, 0 /*dtx_vad*/, transient_det[b], HOA_md_ind ); -#else - ivas_enc_cov_handler_process( hMCParamUpmix->hCovEnc[b], pp_in_fr_real, pp_in_fr_imag, cov_real, cov_dtx_real, hMCParamUpmix->hFbMixer->pFb, 0, hMCParamUpmix->hFbMixer->pFb->filterbank_num_bands, MC_PARAMUPMIX_NCH, 0 /*dtx_vad*/, transient_det[b] ); -#endif } for ( b = 0; b < MC_PARAMUPMIX_COMBINATIONS; b++ ) @@ -844,5 +825,3 @@ static void ivas_mc_paramupmix_param_est_enc( return; } - -#endif diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index ba378ab1d68b673a3ffde43e29e168c2444ce7d8..ec3a49956b727532e24dec28ba6a94314e8e6442 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -188,12 +188,8 @@ ivas_error ivas_mcmasa_enc_open( } /* set FB config. */ - if ( ( error = ivas_fb_set_cfg( &fb_cfg, MASA_FORMAT, SBA_MODE_NONE, numAnalysisChannels, 0, 0, input_Fs -#ifdef HODIRAC - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_fb_set_cfg( &fb_cfg, MASA_FORMAT, SBA_MODE_NONE, numAnalysisChannels, 0, 0, input_Fs, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -224,12 +220,8 @@ ivas_error ivas_mcmasa_enc_open( else { /* Allocate and initialize FB mixer handle for LFE channel */ - if ( ( error = ivas_fb_set_cfg( &fb_cfgLfe, MASA_FORMAT, SBA_MODE_NONE, 1, 0, 0, input_Fs -#ifdef HODIRAC - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_fb_set_cfg( &fb_cfgLfe, MASA_FORMAT, SBA_MODE_NONE, 1, 0, 0, input_Fs, + 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -755,17 +747,10 @@ void ivas_mcmasa_param_est_enc( float Chnl_ImagBuffer[MCMASA_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX]; float *p_Chnl_RealBuffer[MCMASA_MAX_ANA_CHANS]; float *p_Chnl_ImagBuffer[MCMASA_MAX_ANA_CHANS]; -#ifdef HODIRAC float Foa_RealBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; float Foa_ImagBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; float FoaEven_RealBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; float FoaEven_ImagBuffer[FOA_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; -#else - float Foa_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX]; - float Foa_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX]; - float FoaEven_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX]; - float FoaEven_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX]; -#endif float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float intensity_even_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float direction_vector[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; @@ -848,18 +833,10 @@ void ivas_mcmasa_param_est_enc( for ( ts = mrange[0]; ts < mrange[1]; ts++ ) { - ivas_fb_mixer_get_windowed_fr( hMcMasa->hFbMixer, pcm_in, p_Chnl_RealBuffer, p_Chnl_ImagBuffer, l_ts, l_ts -#ifdef HODIRAC - , - hMcMasa->hFbMixer->fb_cfg->num_in_chans -#endif - ); - ivas_fb_mixer_update_prior_input( hMcMasa->hFbMixer, pcm_in, l_ts -#ifdef HODIRAC - , - hMcMasa->hFbMixer->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_get_windowed_fr( hMcMasa->hFbMixer, pcm_in, p_Chnl_RealBuffer, p_Chnl_ImagBuffer, l_ts, l_ts, + hMcMasa->hFbMixer->fb_cfg->num_in_chans ); + ivas_fb_mixer_update_prior_input( hMcMasa->hFbMixer, pcm_in, l_ts, + hMcMasa->hFbMixer->fb_cfg->num_in_chans ); for ( i = 0; i < numAnalysisChannels; i++ ) { pcm_in[i] += l_ts; @@ -1000,12 +977,8 @@ void ivas_mcmasa_param_est_enc( reference_power[ts], 0, num_freq_bands, - SBA_MODE_NONE -#ifdef HODIRAC - , - FOA_CHANNELS -#endif - ); + SBA_MODE_NONE, + FOA_CHANNELS ); /* Fill buffers of length "averaging_length" time slots for intensity and energy */ hMcMasa->index_buffer_intensity = ( hMcMasa->index_buffer_intensity % hMcMasa->no_col_avg_diff ) + 1; /* averaging_length = 32 */ @@ -1734,18 +1707,10 @@ static void computeLfeEnergy( for ( ts = mrange[0]; ts < mrange[1]; ts++ ) { - ivas_fb_mixer_get_windowed_fr( hMcMasa->hFbMixerLfe, pcm_in, p_Chnl_RealBuffer, p_Chnl_ImagBuffer, l_ts, l_ts -#ifdef HODIRAC - , - hMcMasa->hFbMixerLfe->fb_cfg->num_in_chans -#endif - ); - ivas_fb_mixer_update_prior_input( hMcMasa->hFbMixerLfe, pcm_in, l_ts -#ifdef HODIRAC - , - hMcMasa->hFbMixerLfe->fb_cfg->num_in_chans -#endif - ); + ivas_fb_mixer_get_windowed_fr( hMcMasa->hFbMixerLfe, pcm_in, p_Chnl_RealBuffer, p_Chnl_ImagBuffer, l_ts, l_ts, + hMcMasa->hFbMixerLfe->fb_cfg->num_in_chans ); + ivas_fb_mixer_update_prior_input( hMcMasa->hFbMixerLfe, pcm_in, l_ts, + hMcMasa->hFbMixerLfe->fb_cfg->num_in_chans ); pcm_in[0] += l_ts; /* Compute low frequency energy for LFE, for other channels it is computed in ivas_chnl_param_est_enc() */ diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 1d57a61e91d399a0db3b2ff3636505d789eb52f2..3bd05fca9273da133393856ddd848a8829dd34a9 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -484,11 +484,7 @@ void ivas_mct_core_enc( } else if ( ivas_format == SBA_FORMAT ) { -#ifdef COMBINED_FORMAT_SIGNALING nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS_EXTENDED; -#else - nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS_SBA; -#endif nAvailBits -= SBA_ORDER_BITS + SBA_PLANAR_BITS; } @@ -563,11 +559,7 @@ void ivas_mct_core_enc( } #ifdef DEBUGGING -#ifdef COMBINED_FORMAT_SIGNALING 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 ); -#else - format_bits = ( ivas_format == MC_FORMAT ? IVAS_FORMAT_SIGNALING_NBITS + MC_LS_SETUP_BITS : IVAS_FORMAT_SIGNALING_NBITS_SBA + SBA_ORDER_BITS + SBA_PLANAR_BITS ); -#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 b9f55e25e1219fb9304527089275119b9e73382b..af743deaa1c4c6d6f1827335d3df9b70f2c4ec09 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -116,11 +116,7 @@ static void map_input_to_cpe_channels( pdata[i] = data[n]; i++; } -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#else - if ( st_ivas->hEncoderConfig->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) -#endif { for ( n = LFE_CHANNEL + 1; n < st_ivas->nchan_transport; n++ ) { @@ -139,11 +135,7 @@ static void map_input_to_cpe_channels( } /* odd channel CPE*/ -#ifdef MC_PARAMUPMIX_MODE 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 ( ( st_ivas->nchan_transport < st_ivas->nCPE * CPE_CHANNELS ) || ( st_ivas->mc_mode == MC_MODE_MCT && st_ivas->hMCT->nchan_out_woLFE < st_ivas->nCPE * CPE_CHANNELS ) ) -#endif { pdata[st_ivas->nCPE * CPE_CHANNELS - 1] = NULL; } @@ -241,19 +233,11 @@ ivas_error ivas_mct_enc( } /* joint MCT encoding */ -#ifdef MC_PARAMUPMIX_MODE ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE, ivas_total_brate, switch_bw, ( ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order ); -#else - ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, - hMCT->nchan_out_woLFE, - ivas_total_brate, switch_bw, - ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, - st_ivas->hEncoderConfig->sba_order ); -#endif /* Spectrum quantization and coding */ for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) @@ -331,12 +315,10 @@ ivas_error create_mct_enc( { hMCT->nchan_out_woLFE = ivas_param_mc_getNumTransportChannels( ivas_total_brate, st_ivas->hEncoderConfig->mc_input_setup ); } -#ifdef MC_PARAMUPMIX_MODE else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { hMCT->nchan_out_woLFE = ivas_mc_paramupmix_getNumTransportChannels(); } -#endif else if ( ivas_format == SBA_FORMAT ) { hMCT->nchan_out_woLFE = ivas_sba_get_nchan( st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); @@ -445,12 +427,10 @@ ivas_error mct_enc_reconfigure( { hMCT->nchan_out_woLFE = st_ivas->hEncoderConfig->nchan_inp - 1; /* LFE channel is coded separately */ } -#ifdef MC_PARAMUPMIX_MODE else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { hMCT->nchan_out_woLFE = ivas_mc_paramupmix_getNumTransportChannels(); } -#endif else if ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC ) { hMCT->nchan_out_woLFE = ivas_param_mc_getNumTransportChannels( ivas_total_brate, st_ivas->hEncoderConfig->mc_input_setup ); @@ -690,13 +670,11 @@ static ivas_error ivas_mc_enc_reconfig( if ( last_mc_mode != MC_MODE_MCT ) { -#ifdef MC_PARAMUPMIX_MODE if ( st_ivas->hLFE != NULL ) { /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); } -#endif /* create LFE handle */ if ( ( error = ivas_create_lfe_enc( &st_ivas->hLFE, st_ivas->hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) { @@ -706,9 +684,7 @@ static ivas_error ivas_mc_enc_reconfig( /*De-allocate handles for other MC modes*/ ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); -#ifdef MC_PARAMUPMIX_MODE ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); -#endif /* De-allocate McMasa-related handles */ ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); @@ -717,7 +693,6 @@ static ivas_error ivas_mc_enc_reconfig( ivas_qmetadata_close( &st_ivas->hQMetaData ); } } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { st_ivas->nSCE = 0; @@ -762,7 +737,6 @@ static ivas_error ivas_mc_enc_reconfig( ivas_qmetadata_close( &st_ivas->hQMetaData ); } -#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { if ( last_mc_mode != MC_MODE_PARAMMC ) @@ -788,14 +762,12 @@ static ivas_error ivas_mc_enc_reconfig( ivas_masa_enc_close( &( st_ivas->hMasa ) ); st_ivas->hMasa = NULL; } -#ifdef MC_PARAMUPMIX_MODE ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); if ( last_mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hLFE != NULL ) { /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); } -#endif ivas_qmetadata_close( &st_ivas->hQMetaData ); @@ -842,14 +814,12 @@ static ivas_error ivas_mc_enc_reconfig( } ivas_param_mc_enc_close( &( st_ivas->hParamMC ), st_ivas->hEncoderConfig->input_Fs ); -#ifdef MC_PARAMUPMIX_MODE ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); if ( last_mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hLFE != NULL ) { /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); } -#endif if ( last_mc_mode == MC_MODE_MCT ) { @@ -924,13 +894,11 @@ static ivas_error ivas_mc_enc_reconfig( new_brate_SCE = 0; new_brate_CPE = ( st_ivas->hEncoderConfig->ivas_total_brate / ( st_ivas->nchan_transport - 1 ) ) * CPE_CHANNELS; } -#ifdef MC_PARAMUPMIX_MODE else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { new_brate_SCE = 0; new_brate_CPE = ( st_ivas->hEncoderConfig->ivas_total_brate / ( st_ivas->nchan_transport - 1 ) ) * CPE_CHANNELS; } -#endif else { new_brate_SCE = 0; /*st_ivas->hEncoderConfig->ivas_total_brate / st_ivas->nchan_transport;*/ diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index b3f76cc4ab7c611a04e97e8f99cb7c09ae231181..edc9ea1e504b954a8bffd936633c307a2fa0b0d8 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -39,9 +39,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#ifdef SNS_MSVQ #include "ivas_rom_com.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -582,12 +580,10 @@ void ivas_mdct_core_whitening_enc( { int16_t n, ch, nSubframes, L_subframe, L_subframeTCX, tcx_subframe_coded_lines; float A_q[CPE_CHANNELS][NB_DIV][M + 1]; -#ifdef SNS_MSVQ int16_t sns_vq_indices[CPE_CHANNELS * NB_DIV * SNS_MSVQ_NSTAGES_TCX10]; int16_t nbits_sns; int16_t sns_stereo_mode[NB_DIV]; int16_t idx; -#endif int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW]; int16_t param_core[CPE_CHANNELS][2 * NPRM_DIV]; int16_t ltpBits[CPE_CHANNELS]; @@ -606,9 +602,7 @@ void ivas_mdct_core_whitening_enc( int16_t nbits_start_sns; int16_t num_sns; int8_t skipped_first_channel; -#ifdef SNS_MSVQ int16_t zero_side_flag[NB_DIV]; -#endif push_wmops( "mdct_core_whitening" ); @@ -881,11 +875,7 @@ void ivas_mdct_core_whitening_enc( chE[n] = sum_f( powerSpec, L_subframeTCX ); } -#ifdef FIX_445_SNS_BUGFIXES sns_compute_scf( powerSpec, st->hTcxCfg->psychParamsCurrent, st->L_frame, scf[ch][n] ); -#else - sns_compute_scf( powerSpec, st->hTcxCfg->psychParamsCurrent, st->last_core == ACELP_CORE ? L_subframe : st->L_frame, scf[ch][n] ); -#endif } /* MCT: detect whether there are silent channels and set mct_chan_mode accordingly */ @@ -916,7 +906,6 @@ void ivas_mdct_core_whitening_enc( sns_low_br_mode = 0; } -#ifdef SNS_MSVQ if ( !mct_on && sts[0]->sr_core == 25600 && ( ( hCPE->element_brate == IVAS_48k || hCPE->element_brate == IVAS_64k ) ) ) { nbits_sns = quantize_sns( scf, scf_q, sts, sns_vq_indices, zero_side_flag, sns_stereo_mode ); @@ -926,11 +915,7 @@ void ivas_mdct_core_whitening_enc( if ( sts[0]->hTcxEnc->tcxMode == TCX_20 && sts[1]->hTcxEnc->tcxMode == TCX_20 && sts[0]->mct_chan_mode == MCT_CHAN_MODE_REGULAR && sts[1]->mct_chan_mode == MCT_CHAN_MODE_REGULAR ) { -#ifdef FIX_445_SNS_BUGFIXES sns_avq_cod_stereo( scf[0][0], scf[1][0], sts[0]->L_frame, scf_q[0][0], scf_q[1][0], param_lpc[0], param_lpc[1] ); -#else - sns_avq_cod_stereo( scf[0][0], scf[1][0], scf_q[0][0], scf_q[1][0], param_lpc[0], param_lpc[1] ); -#endif } else { @@ -953,71 +938,15 @@ void ivas_mdct_core_whitening_enc( if ( st->hTcxEnc->tcxMode == TCX_20 ) { -#ifdef FIX_445_SNS_BUGFIXES sns_avq_cod( scf[ch][0], NULL, scf_q[ch][0], NULL, ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, st->L_frame, sns_low_br_mode ); -#else - sns_avq_cod( scf[ch][0], NULL, scf_q[ch][0], NULL, ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, sns_low_br_mode ); -#endif } else { -#ifdef FIX_445_SNS_BUGFIXES sns_avq_cod( scf[ch][1], scf[ch][0], scf_q[ch][1], scf_q[ch][0], ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, st->L_frame, sns_low_br_mode ); -#else - sns_avq_cod( scf[ch][1], scf[ch][0], scf_q[ch][1], scf_q[ch][0], ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, sns_low_br_mode ); -#endif } } } } -#else // else of SNS_MSVQ - if ( sts[0]->hTcxEnc->tcxMode == TCX_20 && sts[1]->hTcxEnc->tcxMode == TCX_20 && - sts[0]->mct_chan_mode == MCT_CHAN_MODE_REGULAR && sts[1]->mct_chan_mode == MCT_CHAN_MODE_REGULAR ) - { -#ifdef FIX_445_SNS_BUGFIXES - sns_avq_cod_stereo( scf[0][0], scf[1][0], sts[0]->L_frame, scf_q[0][0], scf_q[1][0], param_lpc[0], param_lpc[1] ); -#else - sns_avq_cod_stereo( scf[0][0], scf[1][0], scf_q[0][0], scf_q[1][0], param_lpc[0], param_lpc[1] ); -#endif - } - else - { -#ifdef DEBUG_MODE_MDCT - { - float ener_side = 0; - float ener_mid = 0; - dbgwrite( &ener_side, sizeof( float ), 1, 1, "./res/ener_side" ); - dbgwrite( &ener_mid, sizeof( float ), 1, 1, "./res/ener_mid" ); - } -#endif - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - param_lpc[ch][0] = ch; - if ( sts[ch]->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) - { - continue; - } - st = sts[ch]; - - if ( st->hTcxEnc->tcxMode == TCX_20 ) - { -#ifdef FIX_445_SNS_BUGFIXES - sns_avq_cod( scf[ch][0], NULL, scf_q[ch][0], NULL, ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, st->L_frame, sns_low_br_mode ); -#else - sns_avq_cod( scf[ch][0], NULL, scf_q[ch][0], NULL, ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, sns_low_br_mode ); -#endif - } - else - { -#ifdef FIX_445_SNS_BUGFIXES - sns_avq_cod( scf[ch][1], scf[ch][0], scf_q[ch][1], scf_q[ch][0], ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, st->L_frame, sns_low_br_mode ); -#else - sns_avq_cod( scf[ch][1], scf[ch][0], scf_q[ch][1], scf_q[ch][0], ¶m_lpc[ch][1], st->hTcxEnc->tcxMode, sns_low_br_mode ); -#endif - } - } - } -#endif // SNS_AVQ4TCX20_MSVQ4TCX10 for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -1160,7 +1089,6 @@ void ivas_mdct_core_whitening_enc( /*--------------------------------------------------------------------------------* * SNS parameters *--------------------------------------------------------------------------------*/ -#ifdef SNS_MSVQ if ( !mct_on && sts[0]->sr_core == 25600 && ( ( hCPE->element_brate == IVAS_48k || hCPE->element_brate == IVAS_64k ) ) ) { nbits_sns = 0; @@ -1251,39 +1179,6 @@ void ivas_mdct_core_whitening_enc( st->side_bits_frame_channel += hBstr->nb_bits_tot - nbits_start_sns; } } -#else // else of SNS_MSVQ - /* write SNS parameter separately since at the decoder, both channels' cores need to be decoded before, so the joint SNS decoding can be done */ - skipped_first_channel = 0; - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - st = sts[ch]; - - if ( st->mct_chan_mode == MCT_CHAN_MODE_IGNORE ) - { - skipped_first_channel = 1; - continue; - } - - nbits_start_sns = hBstr->nb_bits_tot; - - num_sns = ( st->core == TCX_20_CORE ) ? 1 : 2; - - if ( ch == 0 || skipped_first_channel ) - { - push_next_indice( hBstr, param_lpc[0][0] >> 1, 1 ); - - if ( st->element_brate == IVAS_48k && !( ( sts[0]->core == TCX_20 && sts[1]->core == TCX_20 ) ) ) - { - /* write classifier decision to signal low br mode for SNS encoding, for all other configs, low_br mode is not possible */ - push_next_indice( hBstr, sns_low_br_mode, 1 ); - } - } - encode_lpc_avq( hBstr, num_sns, param_lpc[ch], st->core, st->element_mode ); - - st->side_bits_frame_channel += hBstr->nb_bits_tot - nbits_start_sns; - } - -#endif // MSVQ_SNS /*update pitch buffer*/ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 909871f8fdcf55281b25422792283e5de4ce096b..2de45098702962b89da2cf964c715767d59684c1 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -52,12 +52,7 @@ static float direction_distance( float elevation[DIRAC_MAX_NBANDS][MAX_PARAM_SPA #endif -static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( IVAS_QMETADATA_HANDLE hQMetaData, int16_t *needed_bits, int16_t *nbits_diff, int16_t *dfRatioBits -#ifdef HODIRAC - , - const int16_t hodirac_flag -#endif -); +static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( IVAS_QMETADATA_HANDLE hQMetaData, int16_t *needed_bits, int16_t *nbits_diff, int16_t *dfRatioBits, const int16_t hodirac_flag ); static int16_t ivas_qmetadata_entropy_encode_diffuseness( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, uint16_t *diffuseness_index_max_ec_frame ); @@ -162,10 +157,8 @@ static int16_t ivas_qmetadata_quantize_coherence_hr_512( IVAS_QMETADATA *hQMetaD ivas_error ivas_qmetadata_enc_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *hQMetaData /* i/o: metadata handle */ -#ifdef HODIRAC , const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode*/ -#endif ) { int16_t i, bit_pos_start, bit_pos_start_coh; @@ -253,9 +246,7 @@ ivas_error ivas_qmetadata_enc_encode( assert( ndirections == 2 ); #endif /* Reorder 2dir bands for more efficient encoding. */ -#ifdef HODIRAC if ( !hodirac_flag ) -#endif { ivas_qmetadata_reorder_2dir_bands( hQMetaData ); } @@ -292,12 +283,8 @@ ivas_error ivas_qmetadata_enc_encode( } /*Quantization of the Diffuseness */ - ivas_qmetadata_quantize_diffuseness_nrg_ratios( hQMetaData, bits_dir_raw_pre, bits_diff, dfRatio_bits -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + ivas_qmetadata_quantize_diffuseness_nrg_ratios( hQMetaData, bits_dir_raw_pre, bits_diff, dfRatio_bits, + hodirac_flag ); bits_diff_sum = 0; bits_diff[0] = ivas_qmetadata_entropy_encode_diffuseness( hMetaData, &( hQMetaData->q_direction[0] ), &diffuseness_index_max_ec_frame_pre[0] ); @@ -1488,12 +1475,8 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios_hr( * fact that with 2dir data, it is harder to achieve separate high direct-to-total ratio values * which are assumed by the direction quantization system. In practice, this improves direction * accuracy when it is perceptual meaningful. */ - masa_compensate_two_dir_energy_ratio_index( index_dirRatio1Inv, index_dirRatio2Inv, &index_dirRatio1Inv_mod, &index_dirRatio2Inv_mod -#ifdef HODIRAC - , - 0 -#endif - ); + masa_compensate_two_dir_energy_ratio_index( index_dirRatio1Inv, index_dirRatio2Inv, &index_dirRatio1Inv_mod, &index_dirRatio2Inv_mod, + 0 ); for ( k = 0; k < hQMetaData->q_direction[0].cfg.nblocks; k++ ) { @@ -1718,12 +1701,8 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( IVAS_QMETADATA_HANDLE hQMetaData, int16_t *needed_bits, int16_t *nbits_diff, - int16_t *dfRatioBits -#ifdef HODIRAC - , - const int16_t hodirac_flag -#endif -) + int16_t *dfRatioBits, + const int16_t hodirac_flag ) { int16_t j, k, dir2band; int16_t index_dirRatio1Inv, index_dirRatio2Inv, index_dirRatio1Inv_mod, index_dirRatio2Inv_mod; @@ -1747,7 +1726,6 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( * distribution factor of direct-to-total ratios (dFRatio). This is more efficient and * accurate than simple separate quantization of each direct-to-total ratio or their * separate inverses. */ -#ifdef HODIRAC if ( hodirac_flag ) { /* already encoded as total and ratios in HO-DirAC */ @@ -1755,7 +1733,6 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( dfRatio = hQMetaData->q_direction[1].band_data[dir2band].energy_ratio[0]; } else -#endif { dirRatio1 = hQMetaData->q_direction[0].band_data[j].energy_ratio[0]; dirRatio2 = hQMetaData->q_direction[1].band_data[dir2band].energy_ratio[0]; @@ -1768,13 +1745,11 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( index_diff = masa_sq( diffRatio, diffuseness_thresholds, DIRAC_DIFFUSE_LEVELS ); diffRatioQ = diffuseness_reconstructions[index_diff]; -#ifdef HODIRAC if ( hodirac_flag ) { dfRatio_bits = ivas_get_df_ratio_bits_hodirac( index_diff ); } else -#endif { dfRatio_bits = ivas_get_df_ratio_bits( index_diff ); } @@ -1782,7 +1757,6 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( dfRatioBits[dir2band] = dfRatio_bits; dfRatio_qsteps = ( 1 << dfRatio_bits ); -#ifdef HODIRAC if ( hodirac_flag ) { dfRatio_index = usquant( dfRatio, &dfRatioQ, 0.0f, 1.f / ( dfRatio_qsteps - 1 ), dfRatio_qsteps ); @@ -1790,7 +1764,6 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( dirRatio2Q = dfRatioQ; } else -#endif { dfRatio_index = usquant( dfRatio, &dfRatioQ, 0.5f, 0.5f / ( dfRatio_qsteps - 1 ), dfRatio_qsteps ); @@ -1811,14 +1784,12 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( } nbits_diff[0] += MASA_BITS_ER; -#ifdef HODIRAC if ( hodirac_flag ) { float tmp; index_dirRatio2Inv = usquant( dirRatio2Q, &tmp, 0.0f, 1.f / ( DIRAC_DIFFUSE_LEVELS - 1 ), DIRAC_DIFFUSE_LEVELS ); } else -#endif { index_dirRatio2Inv = masa_sq( 1.0f - dirRatio2Q, diffuseness_thresholds, DIRAC_DIFFUSE_LEVELS ); } @@ -1834,12 +1805,8 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios( * fact that with 2dir data, it is harder to achieve separate high direct-to-total ratio values * which are assumed by the direction quantization system. In practice, this improves direction * accuracy when it is perceptual meaningful. */ - masa_compensate_two_dir_energy_ratio_index( index_dirRatio1Inv, index_dirRatio2Inv, &index_dirRatio1Inv_mod, &index_dirRatio2Inv_mod -#ifdef HODIRAC - , - hodirac_flag -#endif - ); + masa_compensate_two_dir_energy_ratio_index( index_dirRatio1Inv, index_dirRatio2Inv, &index_dirRatio1Inv_mod, &index_dirRatio2Inv_mod, + hodirac_flag ); for ( k = 0; k < hQMetaData->q_direction[0].cfg.nblocks; k++ ) { @@ -5928,18 +5895,14 @@ static void ivas_qmetadata_reorder_2dir_bands( hQMetaData->q_direction[0].band_data[band].distance[sf] = hQMetaData->q_direction[1].band_data[band].distance[sf]; hQMetaData->q_direction[1].band_data[band].distance[sf] = uint8_tmp; -#ifdef HODIRAC if ( hQMetaData->coherence_flag ) -#endif { uint8_tmp = hQMetaData->q_direction[0].coherence_band_data[band].spread_coherence[sf]; hQMetaData->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hQMetaData->q_direction[1].coherence_band_data[band].spread_coherence[sf]; hQMetaData->q_direction[1].coherence_band_data[band].spread_coherence[sf] = uint8_tmp; } } -#ifdef HODIRAC if ( hQMetaData->coherence_flag ) -#endif { flt_tmp = hQMetaData->q_direction[0].band_data[band].energy_ratio[0]; hQMetaData->q_direction[0].band_data[band].energy_ratio[0] = hQMetaData->q_direction[1].band_data[band].energy_ratio[0]; @@ -6090,7 +6053,6 @@ static void transform_azimuth_dir2( { hQMetaData->q_direction[1].band_data[i].azimuth[b] += 360; } -#ifdef HODIRAC if ( hQMetaData->q_direction[1].band_data[i].azimuth[b] >= 180 ) { hQMetaData->q_direction[1].band_data[i].azimuth[b] -= 360; @@ -6099,7 +6061,6 @@ static void transform_azimuth_dir2( { hQMetaData->q_direction[1].band_data[i].azimuth[b] += 360; } -#endif #ifdef DEBUGGING assert( hQMetaData->q_direction[1].band_data[i].azimuth[b] < 180 && hQMetaData->q_direction[1].band_data[i].azimuth[b] >= -180 ); #endif diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index 3a26ce03e52c9d9c2d85b805f01b6549176d5dfa..45651008836d2e2f33a52992d2cb3e9b77da220b 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -723,7 +723,6 @@ const float Stereo_dmx_wnd_coef_48k[L_FRAME48k] = { }; -#ifdef MC_PARAMUPMIX_MODE const HUFF_TABLE huff_alpha_table[2] = { { /* Alfa Fine */ @@ -838,6 +837,5 @@ const HUFF_TABLE huff_beta_table[2] = const int16_t mc_paramupmix_fb_remix_order[4] = {0, 1, 2, 3}; -#endif /* clang-format on */ diff --git a/lib_enc/ivas_rom_enc.h b/lib_enc/ivas_rom_enc.h index 9fe2015eee5d579314cbc1c5a6f3223031aed5ed..c208259ed6052b15f17bc946754c8fa311b5e395 100644 --- a/lib_enc/ivas_rom_enc.h +++ b/lib_enc/ivas_rom_enc.h @@ -126,10 +126,8 @@ extern const float Stereo_dmx_s_wnd_coef_48k[L_FRAME48k >> 4]; extern const float Stereo_dmx_wnd_coef_32k[L_FRAME32k]; extern const float Stereo_dmx_wnd_coef_48k[L_FRAME48k]; -#ifdef MC_PARAMUPMIX_MODE extern const HUFF_TABLE huff_alpha_table[2]; extern const HUFF_TABLE huff_beta_table[2]; extern const int16_t mc_paramupmix_fb_remix_order[4]; -#endif #endif diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index d013df5f4e5d064524c42e057eda823c9ad51b4b..3a2dd72820778d2af4230f2d0426aa54406e63cf 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -142,13 +142,8 @@ ivas_error ivas_sba_enc_reconfigure( int16_t i, n_old; float **old_mem_hp20_in; -#ifdef HODIRAC n_old = ( analysis_order_old + 1 ) * ( analysis_order_old + 1 ); n = ( st_ivas->sba_analysis_order + 1 ) * ( st_ivas->sba_analysis_order + 1 ); -#else - n_old = ivas_sba_get_nchan_metadata( analysis_order_old ); - n = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); -#endif if ( n > n_old ) { @@ -229,11 +224,7 @@ ivas_error ivas_sba_enc_reconfigure( { hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } - if ( nchan_transport_old != st_ivas->nchan_transport -#ifdef HODIRAC - || ( ivas_total_brate < IVAS_512k && hEncoderConfig->last_ivas_total_brate >= IVAS_512k ) || ( ivas_total_brate >= IVAS_512k && hEncoderConfig->last_ivas_total_brate < IVAS_512k ) -#endif - ) + if ( nchan_transport_old != st_ivas->nchan_transport || ( ivas_total_brate < IVAS_512k && hEncoderConfig->last_ivas_total_brate >= IVAS_512k ) || ( ivas_total_brate >= IVAS_512k && hEncoderConfig->last_ivas_total_brate < IVAS_512k ) ) { /* FB mixer handle */ if ( hDirAC->hFbMixer != NULL ) diff --git a/lib_enc/ivas_sns_enc.c b/lib_enc/ivas_sns_enc.c index 7a93e335f21b775e1dda2463edc3391db354585f..5197a260b9ab0ad830176956a6c33a550cb8e522 100644 --- a/lib_enc/ivas_sns_enc.c +++ b/lib_enc/ivas_sns_enc.c @@ -38,10 +38,8 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#ifdef SNS_MSVQ #include "ivas_rom_com.h" #include "ivas_cnst.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -55,7 +53,6 @@ *-------------------------------------------------------------------*/ /* r : codebook index */ -#ifdef FIX_445_SNS_BUGFIXES static int16_t sns_1st_cod( const float *sns, /* i : vector to quantize */ const int16_t L_frame, @@ -143,84 +140,6 @@ static int16_t sns_1st_cod( return index; } -#else -static int16_t sns_1st_cod( - const float *sns, /* i : vector to quantize */ - float *snsq /* i/o: i:prediction o:quantized sns */ -) -{ - int16_t i, j, index; - int16_t j0, j1, index0, index1; - float dist_min, dist, temp; - const float *p_dico; - - j0 = 0; - j1 = M / 2; - dist_min = 1.0e30f; - p_dico = sns_vq_cdk1; - index0 = 0; - - for ( i = 0; i < 32; i++ ) - { - dist = 0.0; - - for ( j = j0; j < j1; j++ ) - { - temp = sns[j] - *p_dico++; - dist += temp * temp; - } - - if ( dist < dist_min ) - { - dist_min = dist; - index0 = i; - } - } - - /* quantized vector */ - p_dico = &sns_vq_cdk1[index0 * ( M / 2 )]; - - for ( j = j0; j < j1; j++ ) - { - snsq[j] = *p_dico++; /* += cause it's differential */ - } - - j0 = M / 2; - j1 = M; - dist_min = 1.0e30f; - p_dico = sns_vq_cdk2; - index1 = 0; - - for ( i = 0; i < 32; i++ ) - { - dist = 0.0; - - for ( j = j0; j < j1; j++ ) - { - temp = sns[j] - *p_dico++; - dist += temp * temp; - } - - if ( dist < dist_min ) - { - dist_min = dist; - index1 = i; - } - } - - /* quantized vector */ - p_dico = &sns_vq_cdk2[index1 * ( M / 2 )]; - - for ( j = j0; j < j1; j++ ) - { - snsq[j] = *p_dico++; /* += cause it's differential */ - } - - index = index0 + ( index1 << 5 ); - - return index; -} -#endif /*------------------------------------------------------------------- @@ -293,9 +212,7 @@ void sns_avq_cod( float *snsmid_q, /* o : Quantized mid-LFS vectors */ int16_t *index, /* o : Quantization indices */ const int16_t core, /* i : core */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif const int16_t low_brate_mode /* i : flag low bit operating mode */ ) { @@ -303,11 +220,7 @@ void sns_avq_cod( float snsmid_q0[M]; int16_t indxt[256], nbits, nbt, nit; -#ifdef FIX_445_SNS_BUGFIXES index[0] = sns_1st_cod( sns, L_frame, core, sns_q ); -#else - index[0] = sns_1st_cod( sns, sns_q ); -#endif nit = 1 + 2; if ( !low_brate_mode ) { @@ -328,11 +241,7 @@ void sns_avq_cod( { index++; -#ifdef FIX_445_SNS_BUGFIXES index[0] = sns_1st_cod( snsmid, L_frame, core, snsmid_q ); -#else - index[0] = sns_1st_cod( snsmid, snsmid_q ); -#endif nit = 1 + 2; if ( !low_brate_mode ) { @@ -389,9 +298,7 @@ void sns_avq_cod( void sns_avq_cod_stereo( const float *snsl, /* i : Input sns vector (left channel) */ const float *snsr, /* i : Input sns vector (right channel) */ -#ifdef FIX_445_SNS_BUGFIXES const int16_t L_frame, -#endif float *snsl_q, /* o : Quantized sns vector (left channel) */ float *snsr_q, /* o : Quantized sns vector (right channel) */ int16_t *indexl, /* o : Quantization indices (left channel) */ @@ -435,11 +342,7 @@ void sns_avq_cod_stereo( } /* Quantize mid */ -#ifdef FIX_445_SNS_BUGFIXES indexl[0] = sns_1st_cod( mid, L_frame, TCX_20_CORE, mid_q ); -#else - indexl[0] = sns_1st_cod( mid, mid_q ); -#endif sns_2st_cod( mid, mid_q, &indexl[1] ); /* Quantize side */ @@ -479,26 +382,17 @@ void sns_avq_cod_stereo( *indexr++ = 1; /* Quantize left */ -#ifdef FIX_445_SNS_BUGFIXES indexl[0] = sns_1st_cod( snsl, L_frame, TCX_20_CORE, snsl_q ); -#else - indexl[0] = sns_1st_cod( snsl, snsl_q ); -#endif sns_2st_cod( snsl, snsl_q, &indexl[1] ); /* Quantize right */ -#ifdef FIX_445_SNS_BUGFIXES indexr[0] = sns_1st_cod( snsr, L_frame, TCX_20_CORE, snsr_q ); -#else - indexr[0] = sns_1st_cod( snsr, snsr_q ); -#endif sns_2st_cod( snsr, snsr_q, &indexr[1] ); } return; } -#ifdef SNS_MSVQ int16_t quantize_sns( float sns_in[CPE_CHANNELS][NB_DIV][M], float snsQ_out[CPE_CHANNELS][NB_DIV][M], @@ -511,9 +405,6 @@ int16_t quantize_sns( int16_t nbits, idxIndices; Encoder_State *st; float weights[M]; -#ifndef FIX_445_SNS_BUGFIXES - const float *means; -#endif nbits = 0; idxIndices = 0; @@ -525,7 +416,6 @@ int16_t quantize_sns( zero_side_flag[0] = 0; zero_side_flag[1] = 0; -#ifdef FIX_445_SNS_BUGFIXES /* use snsQ_out as buffer, move input vectors */ for ( ch = 0; ch < CPE_CHANNELS; ++ch ) { @@ -535,7 +425,6 @@ int16_t quantize_sns( mvr2r( sns_in[ch][k], snsQ_out[ch][k], M ); } } -#endif if ( sts[0]->core == sts[1]->core ) { @@ -543,50 +432,25 @@ int16_t quantize_sns( for ( k = 0; k < nSubframes; ++k ) { -#ifdef FIX_445_SNS_BUGFIXES float side[M]; -#else - float *side; -#endif float ener_side; -#ifdef FIX_445_SNS_BUGFIXES v_sub( snsQ_out[0][k], snsQ_out[1][k], side, M ); -#else - side = &snsQ_out[1][k][0]; - v_sub( sns_in[0][k], sns_in[1][k], side, M ); -#endif ener_side = dotp( side, side, M ); sns_stereo_mode[k] = ener_side < 12.f; zero_side_flag[k] = ener_side < 1.f; -#ifdef FIX_445_SNS_BUGFIXES if ( sns_stereo_mode[k] == SNS_STEREO_MODE_MS ) { convertToMS( M, snsQ_out[0][k], snsQ_out[1][k], 0.5f ); } -#endif } } /* prepare buffers depending on the chosen stereo mode */ -#ifndef FIX_445_SNS_BUGFIXES - /* remove means of L/R SNS parameters */ - for ( ch = 0; ch < CPE_CHANNELS; ++ch ) - { - st = sts[ch]; - nSubframes = ( st->core == TCX_20_CORE ) ? 1 : NB_DIV; - means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_tcx20 : ivas_sns_means_tcx10; - for ( k = 0; k < nSubframes; ++k ) - { - v_sub( sns_in[ch][k], means, snsQ_out[ch][k], M ); - } - } -#endif -#ifdef FIX_445_SNS_BUGFIXES nSubframes = ( sts[0]->core == TCX_20_CORE ) ? 1 : NB_DIV; for ( k = 0; k < nSubframes; ++k ) { @@ -597,19 +461,6 @@ int16_t quantize_sns( convertToMS( M, snsQ_out[0][k], snsQ_out[1][k], 0.5f ); } } -#else - if ( sns_stereo_mode[0] == SNS_STEREO_MODE_MS || sns_stereo_mode[1] == SNS_STEREO_MODE_MS ) - { - nSubframes = ( sts[0]->core == TCX_20_CORE ) ? 1 : NB_DIV; - for ( k = 0; k < nSubframes; ++k ) - { - if ( sns_stereo_mode[k] == SNS_STEREO_MODE_MS ) - { - convertToMS( M, snsQ_out[0][k], snsQ_out[1][k], 0.5f ); - } - } - } -#endif for ( ch = 0; ch < CPE_CHANNELS; ++ch ) { @@ -639,16 +490,8 @@ int16_t quantize_sns( nStages = SNS_MSVQ_NSTAGES_SIDE; bits = ( st->core == TCX_20_CORE ) ? ivas_sns_cdbks_side_tcx20_bits : ivas_sns_cdbks_side_tcx10_bits; -#ifndef FIX_445_SNS_BUGFIXES - means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_side_tcx20 : ivas_sns_means_side_tcx10; - - v_sub( sns_ptr, means, snsQ, M ); -#endif msvq_enc( side_cdbks, NULL, NULL, snsQ, side_levels, 3, nStages, weights, M, M, 0, NULL, &indices[idxIndices] ); msvq_dec( side_cdbks, NULL, NULL, nStages, M, M, &indices[idxIndices], 0, NULL, snsQ, NULL ); -#ifndef FIX_445_SNS_BUGFIXES - v_add( snsQ, means, snsQ, M ); -#endif } else { @@ -676,20 +519,6 @@ int16_t quantize_sns( } } -#ifndef FIX_445_SNS_BUGFIXES - /* add means back */ - for ( ch = 0; ch < CPE_CHANNELS; ++ch ) - { - st = sts[ch]; - nSubframes = ( st->core == TCX_20_CORE ) ? 1 : NB_DIV; - means = ( st->core == TCX_20_CORE ) ? ivas_sns_means_tcx20 : ivas_sns_means_tcx10; - for ( k = 0; k < nSubframes; ++k ) - { - v_add( snsQ_out[ch][k], means, snsQ_out[ch][k], M ); - } - } -#endif return nbits; } -#endif // SNS_MSVQ diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 4837fcbb8a4030a92457ff494be61c2fe1f2b27c..39d1d6ead71169e342e9c841f70c8d142dc9fdca 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -66,9 +66,7 @@ ivas_error ivas_spar_enc_open( ENCODER_CONFIG_HANDLE hEncoderConfig; IVAS_FB_CFG *fb_cfg; int16_t nchan_inp, nchan_transport, sba_order_internal; -#ifdef HODIRAC int16_t nchan_fb_in; -#endif int16_t table_idx, active_w_mixing; int32_t input_Fs, ivas_total_brate; ivas_error error; @@ -88,16 +86,11 @@ ivas_error ivas_spar_enc_open( input_Fs = hEncoderConfig->input_Fs; sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); - nchan_inp = ivas_sba_get_nchan_metadata( sba_order_internal -#ifdef HODIRAC - , - hEncoderConfig->ivas_total_brate -#endif - ); + nchan_inp = ivas_sba_get_nchan_metadata( sba_order_internal, + hEncoderConfig->ivas_total_brate ); assert( nchan_inp <= hEncoderConfig->nchan_inp ); ivas_total_brate = hEncoderConfig->ivas_total_brate; -#ifdef HODIRAC nchan_fb_in = 0; if ( st_ivas->sba_analysis_order == 1 ) { @@ -115,7 +108,6 @@ ivas_error ivas_spar_enc_open( { assert( 0 && "sba_order must be 1,2, or 3!" ); } -#endif nchan_transport = ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, sba_order_internal ); @@ -131,12 +123,8 @@ ivas_error ivas_spar_enc_open( /* set FB config. */ active_w_mixing = ivas_spar_br_table_consts[table_idx].active_w; - ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_inp, nchan_transport, active_w_mixing, input_Fs -#ifdef HODIRAC - , - nchan_fb_in -#endif - ); + ivas_fb_set_cfg( &fb_cfg, SBA_FORMAT, SBA_MODE_SPAR, nchan_inp, nchan_transport, active_w_mixing, input_Fs, + nchan_fb_in ); fb_cfg->remix_order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; /* FB mixer handle */ @@ -426,13 +414,8 @@ static ivas_error ivas_spar_enc_process( float data_f[][L_FRAME48k] /* i/o: input/transport audio channels */ ) { -#ifdef HODIRAC float pcm_tmp[DIRAC_MAX_ANA_CHANS][L_FRAME48k * 2]; float *p_pcm_tmp[DIRAC_MAX_ANA_CHANS]; -#else - float pcm_tmp[IVAS_SPAR_MAX_CH][L_FRAME48k * 2]; - float *p_pcm_tmp[IVAS_SPAR_MAX_CH]; -#endif int16_t i, j, b, i_ts, input_frame, dtx_vad; int16_t transient_det[2]; @@ -450,16 +433,10 @@ static ivas_error ivas_spar_enc_process( int16_t ts, l_ts, orig_dirac_bands, num_del_samples; float *ppIn_FR_real[IVAS_SPAR_MAX_CH], *ppIn_FR_imag[IVAS_SPAR_MAX_CH]; -#ifdef SBA_TD_RESIDUAL float wyzx_del_buf[FOA_CHANNELS][IVAS_FB_1MS_48K_SAMP]; -#else - float w_del_buf[IVAS_FB_1MS_48K_SAMP]; -#endif float dir[3], avg_dir[3]; float energySum, vecLen; -#ifdef HODIRAC int16_t nchan_fb_in; -#endif push_wmops( "ivas_spar_enc_process" ); @@ -475,25 +452,17 @@ static ivas_error ivas_spar_enc_process( input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); sba_order = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); - nchan_inp = ivas_sba_get_nchan_metadata( sba_order -#ifdef HODIRAC - , - hEncoderConfig->ivas_total_brate -#endif - ); + nchan_inp = ivas_sba_get_nchan_metadata( sba_order, + hEncoderConfig->ivas_total_brate ); assert( nchan_inp <= hEncoderConfig->nchan_inp ); int16_t active_w_vlbr; active_w_vlbr = ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; -#ifdef HODIRAC nchan_fb_in = hSpar->hFbMixer->fb_cfg->nchan_fb_in; nchan_transport = st_ivas->nchan_transport; for ( i = FOA_CHANNELS + 1; i < nchan_fb_in; i++ ) -#else - for ( i = FOA_CHANNELS + 1; i < nchan_inp; i++ ) -#endif { mvr2r( data_f[HOA_keep_ind[i]], data_f[i], input_frame ); } @@ -503,19 +472,12 @@ static ivas_error ivas_spar_enc_process( *-----------------------------------------------------------------------------------------*/ ivas_transient_det_process( hSpar->hTranDet, data_f[0], input_frame, transient_det ); -#ifndef FIX_331_ALL_BRS - if ( sba_order == 1 ) - { - transient_det[1] = transient_det[0]; - } -#endif if ( ivas_total_brate < IVAS_24k4 ) { transient_det[1] = 0; } /* store previous input samples for W in local buffer */ assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); -#ifdef SBA_TD_RESIDUAL if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { /* fill delay (1 ms) buffer for all Transport channels */ @@ -525,37 +487,22 @@ static ivas_error ivas_spar_enc_process( mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[idx][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], wyzx_del_buf[idx], num_del_samples ); } } -#else - mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[0][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], w_del_buf, num_del_samples ); -#endif /*-----------------------------------------------------------------------------------------* * FB mixer ingest *-----------------------------------------------------------------------------------------*/ -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < nchan_inp; i++ ) -#endif { p_pcm_tmp[i] = pcm_tmp[i]; } /* run Filter Bank overlapping MDFT analysis first, then we can use the temporary buffer for Parameter MDFT analysis*/ - ivas_fb_mixer_pcm_ingest( hSpar->hFbMixer, data_f, p_pcm_tmp, input_frame -#ifdef HODIRAC - , - hSpar->hMdEnc->HOA_md_ind -#endif - ); + ivas_fb_mixer_pcm_ingest( hSpar->hFbMixer, data_f, p_pcm_tmp, input_frame, + hSpar->hMdEnc->HOA_md_ind ); /* prepare Parameter MDFT analysis */ -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < nchan_inp; i++ ) -#endif { ppIn_FR_real[i] = p_pcm_tmp[i]; ppIn_FR_imag[i] = p_pcm_tmp[i] + input_frame; @@ -566,25 +513,13 @@ static ivas_error ivas_spar_enc_process( for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { - ivas_fb_mixer_get_windowed_fr( hSpar->hFbMixer, p_pcm_tmp, ppIn_FR_real, ppIn_FR_imag, l_ts, l_ts -#ifdef HODIRAC - , - nchan_fb_in -#endif - ); + ivas_fb_mixer_get_windowed_fr( hSpar->hFbMixer, p_pcm_tmp, ppIn_FR_real, ppIn_FR_imag, l_ts, l_ts, + nchan_fb_in ); - ivas_fb_mixer_update_prior_input( hSpar->hFbMixer, p_pcm_tmp, l_ts -#ifdef HODIRAC - , - nchan_fb_in -#endif - ); + ivas_fb_mixer_update_prior_input( hSpar->hFbMixer, p_pcm_tmp, l_ts, + nchan_fb_in ); -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < nchan_inp; i++ ) -#endif { p_pcm_tmp[i] += l_ts; ppIn_FR_real[i] += l_ts; @@ -593,11 +528,7 @@ static ivas_error ivas_spar_enc_process( } /* turn pointers back to the local buffer, needed for the following processing */ -#ifdef HODIRAC for ( i = 0; i < nchan_fb_in; i++ ) -#else - for ( i = 0; i < nchan_inp; i++ ) -#endif { ppIn_FR_real[i] = pcm_tmp[i]; ppIn_FR_imag[i] = pcm_tmp[i] + input_frame; @@ -610,13 +541,9 @@ static ivas_error ivas_spar_enc_process( * DirAC encoding *-----------------------------------------------------------------------------------------*/ /*tyagiri: TODO: HODIRAC should be disabled for 256 kbps and outputs should be BE w.r.t baseline*/ - ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, st_ivas->sba_mode -#ifdef HODIRAC - , + ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, st_ivas->sba_mode, st_ivas->sba_analysis_order > 1 && ivas_total_brate > IVAS_256k, - st_ivas->sba_analysis_order > 1 && ivas_total_brate > IVAS_256k ? HOA2_CHANNELS : FOA_CHANNELS -#endif - ); + st_ivas->sba_analysis_order > 1 && ivas_total_brate > IVAS_256k ? HOA2_CHANNELS : FOA_CHANNELS ); if ( hQMetaData->q_direction->cfg.nbands > 0 ) { @@ -627,23 +554,15 @@ static ivas_error ivas_spar_enc_process( /* WB 4TC mode bit : disable for now*/ push_next_indice( hMetaData, 0, 1 ); - ivas_qmetadata_enc_encode( hMetaData, hQMetaData -#ifdef HODIRAC - , - ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) -#endif - ); + ivas_qmetadata_enc_encode( hMetaData, hQMetaData, + ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ); } else { hQMetaData->q_direction[0].cfg.nbands = DIRAC_DTX_BANDS; /* compute directions */ -#ifdef HODIRAC for ( i = 0; i < hQMetaData->q_direction[0].cfg.nblocks; i++ ) -#else - for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) -#endif { set_zero( dir, 3 ); set_zero( avg_dir, 3 ); @@ -754,12 +673,8 @@ static ivas_error ivas_spar_enc_process( hSpar->hFbMixer->pFb->filterbank_num_bands, nchan_inp, dtx_vad, - transient_det -#ifdef HODIRAC - , - hSpar->hMdEnc->HOA_md_ind -#endif - ); + transient_det, + hSpar->hMdEnc->HOA_md_ind ); nchan_transport = st_ivas->nchan_transport; /*-----------------------------------------------------------------------------------------* @@ -771,9 +686,7 @@ static ivas_error ivas_spar_enc_process( ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order, hSpar->hFbMixer->prior_mixer ); } -#ifdef HODIRAC if ( hSpar->hMdEnc->spar_hoa_dirac2spar_md_flag ) -#endif { float azi_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; float ele_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; @@ -935,7 +848,6 @@ static ivas_error ivas_spar_enc_process( #ifdef DEBUG_SBA_AUDIO_DUMP ivas_spar_dump_signal_wav( input_frame, p_pcm_tmp, NULL, nchan_transport, spar_foa_enc_wav[1], "ivas_fb_mixer_process()" ); #endif -#ifdef SBA_TD_RESIDUAL if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { /* delayed W */ @@ -951,14 +863,6 @@ static ivas_error ivas_spar_enc_process( v_add( data_f[idx], p_pcm_tmp[i] + num_del_samples, p_pcm_tmp[i] + num_del_samples, input_frame - num_del_samples ); } } -#else - /* move delayed W into output buffer unless activeW operation*/ - if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) - { - mvr2r( w_del_buf, p_pcm_tmp[0], num_del_samples ); - mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples ); - } -#endif #if 0 /* SBA_TD_RESIDUAL */ { static FILE *fid = 0; diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index d96526375f11a80bc98d1b66c42f0a5553301c3c..f93c9e6ca5fc88b38627278762fe1e829f72e2a5 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -119,12 +119,8 @@ ivas_error ivas_spar_md_enc_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD encoder" ); } - num_channels = ivas_sba_get_nchan_metadata( sba_order -#ifdef HODIRAC - , - hEncoderConfig->ivas_total_brate -#endif - ); + num_channels = ivas_sba_get_nchan_metadata( sba_order, + hEncoderConfig->ivas_total_brate ); if ( ( hMdEnc->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { @@ -319,20 +315,10 @@ ivas_error ivas_spar_md_enc_init( float PR_minmax[2]; int16_t num_channels, i, j, k; -#ifdef HODIRAC ivas_sba_get_spar_hoa_md_flag( sba_order, hEncoderConfig->ivas_total_brate, &hMdEnc->spar_hoa_md_flag, &hMdEnc->spar_hoa_dirac2spar_md_flag ); -#else - hMdEnc->spar_hoa_md_flag = ivas_sba_get_spar_hoa_md_flag( sba_order, hEncoderConfig->ivas_total_brate ); -#endif - num_channels = ivas_sba_get_nchan_metadata( sba_order -#ifdef HODIRAC - , - hEncoderConfig->ivas_total_brate -#endif - ); -#ifdef HODIRAC + num_channels = ivas_sba_get_nchan_metadata( sba_order, + hEncoderConfig->ivas_total_brate ); ivas_sba_get_spar_hoa_ch_ind( num_channels, hEncoderConfig->ivas_total_brate, hMdEnc->HOA_md_ind ); -#endif table_idx = ivas_get_spar_table_idx( hEncoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL ); ivas_spar_set_bitrate_config( &hMdEnc->spar_md_cfg, table_idx, ( hMdEnc->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : SPAR_DIRAC_SPLIT_START_BAND ); @@ -598,12 +584,8 @@ ivas_error ivas_spar_md_enc_process( float Wscale[IVAS_MAX_NUM_BANDS]; num_quant_strats = hMdEnc->spar_md_cfg.num_quant_strats; - num_ch = ivas_sba_get_nchan_metadata( sba_order -#ifdef HODIRAC - , - hEncoderConfig->ivas_total_brate -#endif - ); + num_ch = ivas_sba_get_nchan_metadata( sba_order, + hEncoderConfig->ivas_total_brate ); active_w = hMdEnc->spar_md_cfg.active_w; nchan_transport = hMdEnc->spar_md_cfg.nchan_transport; @@ -684,11 +666,7 @@ ivas_error ivas_spar_md_enc_process( nB = num_bands; bands_bw = 1; } -#ifdef HODIRAC if ( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdEnc->spar_hoa_md_flag ) -#endif { for ( b = SPAR_DIRAC_SPLIT_START_BAND; b < num_bands; b++ ) { @@ -865,11 +843,7 @@ ivas_error ivas_spar_md_enc_process( } } -#ifdef HODIRAC if ( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdEnc->spar_hoa_md_flag ) -#endif { for ( b = SPAR_DIRAC_SPLIT_START_BAND; b < num_bands; b++ ) { @@ -1463,11 +1437,7 @@ static void ivas_get_huffman_coded_bs( pred_coeff_dim = ndm + ndec - 1; pred_offset = 0; -#ifdef HODIRAC if ( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdEnc->spar_hoa_md_flag ) -#endif { if ( i >= SPAR_DIRAC_SPLIT_START_BAND ) { @@ -1573,11 +1543,7 @@ static void ivas_get_arith_coded_bs( else { pred_cell_dims[i].dim1 = ndm + ndec - 1; - if ( hMdEnc->spar_hoa_md_flag -#ifdef HODIRAC - && hMdEnc->spar_hoa_dirac2spar_md_flag -#endif - ) + if ( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) { if ( i >= SPAR_DIRAC_SPLIT_START_BAND ) { @@ -1603,11 +1569,7 @@ static void ivas_get_arith_coded_bs( break; } } -#ifdef HODIRAC if ( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdEnc->spar_hoa_md_flag ) -#endif { for ( i = 0; i < nB; i++ ) { @@ -1637,11 +1599,7 @@ static void ivas_get_arith_coded_bs( ivas_arith_encode_cmplx_cell_array( &hMdEnc->arith_coeffs.pred_arith_re[qsi], &hMdEnc->arith_coeffs.pred_arith_re_diff[qsi], pDo_diff, nB, symbol_arr_re, symbol_arr_old_re, pred_cell_dims, hMetaData, any_diff ); -#ifdef HODIRAC if ( hMdEnc->spar_hoa_md_flag && hMdEnc->spar_hoa_dirac2spar_md_flag ) -#else - if ( hMdEnc->spar_hoa_md_flag ) -#endif { for ( i = 0; i < nB; i++ ) { diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 35ff4b483f2e1cc2e881c24eabd2e453a84aa416..daff0851ef2d8f58420cd6775ebffccc1d993bb2 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -666,10 +666,8 @@ typedef struct ivas_spar_md_enc_state_t ivas_huff_coeffs_t huff_coeffs; int16_t table_idx; int16_t spar_hoa_md_flag; -#ifdef HODIRAC int16_t spar_hoa_dirac2spar_md_flag; int16_t HOA_md_ind[IVAS_SPAR_MAX_CH]; -#endif } ivas_spar_md_enc_state_t; /* PCA structure */ @@ -729,7 +727,6 @@ typedef struct ivas_param_mc_enc_data_structure } PARAM_MC_ENC_DATA, *PARAM_MC_ENC_HANDLE; -#ifdef MC_PARAMUPMIX_MODE /*----------------------------------------------------------------------------------* * MC ParamUpmix Mode encoder structures *----------------------------------------------------------------------------------*/ @@ -745,13 +742,11 @@ typedef struct ivas_mc_paramupmix_enc_data_structure int32_t beta_quant_prev[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS]; bool first_frame; } MC_PARAMUPMIX_ENC_DATA, *MC_PARAMUPMIX_ENC_HANDLE; -#endif /*----------------------------------------------------------------------------------* * MASA encoder structures *----------------------------------------------------------------------------------*/ -#ifdef FIX_398_MASA_DIRECTION_ALIGNMENT typedef struct ivas_masa_dir_align_struct { float previous_azi_dir1[MASA_FREQUENCY_BANDS]; @@ -761,7 +756,6 @@ typedef struct ivas_masa_dir_align_struct float previous_ele_dir2[MASA_FREQUENCY_BANDS]; } MASA_DIR_ALIGN_STATE, *MASA_DIR_ALIGN_HANDLE; -#endif /* structure storing MASA framing sync detection and compensation data */ typedef struct ivas_masa_sync_struct @@ -791,9 +785,7 @@ typedef struct ivas_masa_encoder_data_struct MASA_SYNC_STATE sync_state; -#ifdef FIX_398_MASA_DIRECTION_ALIGNMENT MASA_DIR_ALIGN_STATE dir_align_state; -#endif } MASA_ENCODER_DATA; @@ -837,13 +829,8 @@ typedef struct ivas_mcmasa_enc_data_structure float **buffer_intensity_real_vert; float *buffer_energy; -#ifdef HODIRAC float chnlToFoaMtx[FOA_CHANNELS][MCMASA_MAX_ANA_CHANS]; float chnlToFoaEvenMtx[FOA_CHANNELS][MCMASA_MAX_ANA_CHANS]; -#else - float chnlToFoaMtx[DIRAC_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; - float chnlToFoaEvenMtx[DIRAC_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; -#endif float ls_azimuth[MCMASA_MAX_ANA_CHANS]; int16_t leftNearest[MCMASA_MAX_ANA_CHANS]; int16_t rightNearest[MCMASA_MAX_ANA_CHANS]; @@ -1127,9 +1114,7 @@ typedef struct IVAS_QMETADATA_HANDLE hQMetaData; /* Metadata handle for q_metadata parametric spatial coding DirAC/MASA*/ MCT_ENC_HANDLE hMCT; /* MCT handle */ PARAM_MC_ENC_HANDLE hParamMC; /* Parametric MC handle */ -#ifdef MC_PARAMUPMIX_MODE MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix; /* MC Param-Upmix handle */ -#endif MCMASA_ENC_HANDLE hMcMasa; /* Multi-channel MASA data handle */ LFE_ENC_HANDLE hLFE; /* LFE data handle */ diff --git a/lib_enc/ivas_stereo_cng_enc.c b/lib_enc/ivas_stereo_cng_enc.c index 2eb838bf5c5bbac673ae0308c93df86e4c972cf9..76f56532dc7a9f9917c228eefb9efc9524431d13 100644 --- a/lib_enc/ivas_stereo_cng_enc.c +++ b/lib_enc/ivas_stereo_cng_enc.c @@ -173,12 +173,7 @@ void stereo_dft_enc_sid_coh( int16_t alpha_level; int16_t n; -#ifdef FIX_418_SID_BITRATE nr_of_sid_stereo_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; -#else - /* TODO: still use old number of bits to keep bitexactness in output */ - nr_of_sid_stereo_bits = ( 4400 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; -#endif zeropad = 0; /* Encode coherence vector. Find best fixed predictor by minimizing prediction error on input vector. @@ -333,9 +328,6 @@ void stereo_dft_enc_sid_coh( ( *nb_bits )++; } -#ifndef FIX_418_SID_BITRATE - push_next_indice( hBstr, zeropad, ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC ); -#endif return; } diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 3da409f6aed9736df3c61e2e3abf3f51bf9d915e..240cbb0e5a54ef73e75d36af5a83e330167735e7 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -447,11 +447,7 @@ ivas_error IVAS_ENC_FeedObjectMetadata( return IVAS_ERR_INDEX_OUT_OF_BOUNDS; } -#ifdef ISM_NON_DIEGETIC_PAN error = ivas_set_ism_metadata( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth, metadata.elevation, metadata.radius, metadata.yaw, metadata.pitch, metadata.non_diegetic_flag ); -#else - error = ivas_set_ism_metadata( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth, metadata.elevation, metadata.radius, metadata.yaw, metadata.pitch ); -#endif if ( error != IVAS_ERR_OK ) { diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 3a6a619f7368b2db1398edd65f3d5cb4f12d3a57..a4a3726b45003fba91b8c9163cc77f0876216be6 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -94,14 +94,12 @@ typedef enum _IVAS_ENC_MASA_VARIANT IVAS_ENC_MASA_UNDEFINED = 0xffff } IVAS_ENC_MASA_VARIANT; -#ifdef COMPLEXITY_LEVEL_INDICATION typedef enum _IVAS_ENC_COMPLEXITY_LEVEL { IVAS_ENC_COMPLEXITY_LEVEL_ONE = 1, IVAS_ENC_COMPLEXITY_LEVEL_TWO = 2, IVAS_ENC_COMPLEXITY_LEVEL_THREE = 3 } IVAS_ENC_COMPLEXITY_LEVEL; -#endif #ifdef DEBUGGING typedef enum _IVAS_ENC_STEREO_MODE diff --git a/lib_enc/lsf_msvq_ma_enc.c b/lib_enc/lsf_msvq_ma_enc.c index 0f7a798a75a8971530b55965a1ae43a7cb1b5a64..9c7bed762948c8b29da305cca7bd148f4f5adad1 100644 --- a/lib_enc/lsf_msvq_ma_enc.c +++ b/lib_enc/lsf_msvq_ma_enc.c @@ -54,8 +54,6 @@ // void dctT2_N_apply_matrix( const float *input, float *output, const int16_t dct_dim, int16_t fdcngvq_dim, const float *idctT2_24_X_matrixQ16, const int16_t matrix_1st_dim, DCTTYPE dcttype ); -#ifdef ERI_MSVQ_CLEANUP - int16_t msvq_stage1_dct_search( /* o : (p_max , best candidate sofar ) */ const float *u, /* i : target */ @@ -304,7 +302,6 @@ int16_t msvq_stage1_dct_recalc_candidates_fdcng_wb( return p_max_local; } -#endif /*--------------------------------------------------------------------------* @@ -337,36 +334,9 @@ void msvq_enc( float resid_buf[2 * LSFMBEST_MAX * M_MAX], dist_buf[2 * LSFMBEST_MAX], Tmp[M_MAX]; int16_t idx_buf[2 * LSFMBEST_MAX * MAX_VQ_STAGES_USED], parents[LSFMBEST_MAX]; int16_t n, maxn, start; -#ifndef ERI_MSVQ_CLEANUP - /* buffers */ - float dct_target[FDCNG_VQ_DCT_MAXTRUNC]; - float u_mr[FDCNG_VQ_MAX_LEN]; - float u_mr_scaled[FDCNG_VQ_MAX_LEN]; - float mse_trunc_all_segms; - float mse_trunc_segm[FDCNG_VQ_DCT_NSEGM]; - float mse; - - const Word8 *cbpW8; - const Word16 *dct_col_shift_tab; - - float *st1_mse_pair; - int16_t *st1_idx_pair; + float *st1_syn_vec_ptr; /* ptr to buffer in dynRAM */ + float *st1_mse_ptr; /* ptr to buffer in existing dRAM used for stage 1 candidate analysis */ int16_t indices_st1_local[FDCNG_VQ_DCT_NSEGM * 2]; /* after stage#1 DCT search this is copied to the global indices[1][s*stages] structure */ - int16_t n_ana, p_mins[2], idx_min[2]; - DCTTYPE dcttype = DCT_T2_24_XX; - float tmp2; - - int16_t check_ind[FDCNG_VQ_DCT_NPOST]; - int16_t segm, j_full, maxC_pre; -#endif - float *st1_syn_vec_ptr; /* ptr to buffer in dynRAM */ - float *st1_mse_ptr; /* ptr to buffer in existing dRAM used for stage 1 candidate analysis */ -#ifdef ERI_MSVQ_CLEANUP - int16_t indices_st1_local[FDCNG_VQ_DCT_NSEGM * 2]; /* after stage#1 DCT search this is copied to the global indices[1][s*stages] structure */ -#else - float res24, high_diff[FDCNG_VQ_MAX_LEN - FDCNG_VQ_MAX_LEN_WB]; - maxC_pre = ( FDCNG_VQ_DCT_NSEGM * 2 ); -#endif assert( maxC <= LSFMBEST_MAX ); assert( ( LSFMBEST_MAX * M_MAX ) > ( N * maxC ) ); /* top of resid_buf is resid[1] and used for stage#1 residuals (input target u), @@ -375,10 +345,6 @@ void msvq_enc( st1_syn_vec_ptr = &( resid_buf[1 * LSFMBEST_MAX * M_MAX] ) - FDCNG_VQ_MAX_LEN * maxC; /* reuse top of resid[0] scratch RAM for residual */ -#ifndef ERI_MSVQ_CLEANUP - dcttype = DCT_T2_24_XX; -#endif - /*----------------------------------------------------------------* * Allocate memory for previous (parent) and current nodes. @@ -462,7 +428,6 @@ void msvq_enc( dist[1][j] = FLT_MAX; } -#ifdef ERI_MSVQ_CLEANUP if ( !s && applyDCT_flag != 0 ) /* means: m==1 */ { /* stage 1 candidates search in truncated dct24 domain without any weights */ @@ -495,167 +460,6 @@ void msvq_enc( indices[1][c * stages] = indices_st1_local[c]; } } -#else - if ( !s && applyDCT_flag != 0 ) /* means: m==1 */ - { /* stage 1 search in truncated dct domain without any weights */ - - n_ana = FDCNG_VQ_MAX_LEN; /* VQ stage#1 core is always using stored DCT24 coeffs */ - /*remove mean/mid fdcng stage#1 vector, in original subband domain */ - v_sub( u, cdk1r_tr_midQ_truncQ, u_mr, n_ana ); - - v_multc( u_mr, fdcng_dct_invScaleF[1], u_mr_scaled, n_ana ); /*scale up target to upscaled W8x storage domain */ - /* 16.0-->scale up from Q0 to search domain in Q4, not really needed in BASOP , impl. by shifts */ - - assert( n_ana >= FDCNG_VQ_DCT_MAXTRUNC ); /* check for WB , SWB, FB operation */ - - dctT2_N_apply_matrix( (const float *) u_mr_scaled, dct_target, min( FDCNG_VQ_DCT_MAXTRUNC, n_ana ), n_ana, invTrfMatrix, FDCNG_VQ_DCT_MAXTRUNC, dcttype ); - - mse_trunc_all_segms = 0; - mse = 0; - - /* init search state ptr's at the top */ - for ( segm = 0; segm < FDCNG_VQ_DCT_NSEGM; segm++ ) - { - /* point to a new paired location */ - st1_mse_pair = &( dist[1][2 * segm] ); /* req. ptr init +=2 */ - st1_mse_pair[0] = FLT_MAX; /* req */ - st1_mse_pair[1] = FLT_MAX; /* req */ - st1_idx_pair = &( indices_st1_local[2 * segm] ); /* +=2 */ - p_max = 0; /* req. to point to 1 or 0 */ - - /* compute segment common trunction error in dct domain */ - mse_trunc_segm[segm] = mse_trunc_all_segms; - mse_trunc_segm[segm] += sum2_f( (const float *) ( &( dct_target[cdk1_ivas_cols_per_segment[segm]] ) ), cdk1_ivas_trunc_dct_cols_per_segment[segm] ); - - cbpW8 = cdk_37bits_ivas_stage1_W8Qx_dct_sections[segm]; /* Word8 column variable Qx storage*/ - - for ( j = 0; j < cdk1_ivas_entries_per_segment[segm]; j++ ) - { - /* unweighted segmented search DCT domain loop */ - j_full = j + cdk1_ivas_cum_entries_per_segment[segm]; /* or simply use j_full++ */ - - mse = mse_trunc_segm[segm]; /* move32() init mse with with common mse truncation part */ - - dct_col_shift_tab = stage1_dct_col_syn_shift[segm]; /* ptr init */ - - for ( c2 = 0; c2 < cdk1_ivas_cols_per_segment[segm]; c2++ ) - { - -#define WMC_TOOL_SKIP - tmp = dct_target[c2] - (float) ( ( (Word16) cbpW8[c2] ) << dct_col_shift_tab[c2] ); /* Word8 storage MSE inner loop */ - LOGIC( 1 ); - SHIFT( 1 ); - ADD( 1 ); /* in BASOP: s_and(for W8->W16), shl(), sub()*/ -#undef WMC_TOOL_SKIP - - mse += tmp * tmp; /* L_mac or L_mac0() square Word16 -> Word32*/ - } - st1_mse_ptr[j_full] = mse; /* save MSE in shared dynamic 2^7=128 RAM, move32() in BASOP */ - -#define WMC_TOOL_SKIP - cbpW8 += cdk1_ivas_cols_per_segment[segm]; /* pointer increment */ -#undef WMC_TOOL_SKIP - /* overwrite with a new worst index at p_max */ - - /* The three inner loop if's below are not really properly instrumented by WMC tool */ - /* a ptr to worst index will be in use */ - if ( mse < st1_mse_pair[p_max] ) /* L_sub */ - { - st1_idx_pair[p_max] = j_full; /* simplified */ - } /* BASOP 2 ops */ - - if ( st1_idx_pair[p_max] == j_full ) /* simplified */ - { /*idx updated to j_full --> also update mse */ - st1_mse_pair[p_max] = mse; /* move32(), single BASOP */ - } /* BASOP 3 ops */ - /* avoid WC costly list management by always updating p_max, as we have only a pair to maintain */ - p_max = 0; /* move16() */ - if ( ( st1_mse_pair[0] - st1_mse_pair[1] ) < 0 ) /* L_sub()*/ - { - p_max = 1; /* move16() */ - } /* BASOP 3 ops ,Note 2 ops possible in BASOP with L_sub and L_lshr */ - - /* Note: logical shift right not available in ANSI-C */ - /* p_max = (st1_mse_pair[0] - st1_mse_pair[1]) ">>>" 31; */ - /* in java logical shift right is available as >>> , in BASOP it is L_lshr */ - - /* Cost: weighted sum with cond moves ('if') => 8 in float , 7 in BASOP with L_lshr */ - } /* j in section */ - - } /* next segment */ - - for ( j = 0; j < maxC_pre; j++ ) - { - /* compute_full mse using stored DCT24 domain MSE's */ - /* calculate MSE from stage1 inner using existing inner DCT domain variables */ - dist[1][j] *= fdcng_dct_scaleF[2]; /* single multiplication to get the MSE scale to the correct input domain */ - } - - p_max = maximum( dist[1], maxC_pre, NULL ); /* establish current worst candidate for stage#2 among all maxC_pre candidates */ - - p_mins[0] = minimum( dist[1], maxC_pre, NULL ); /* find best entry among all maxC_pre */ - tmp = dist[1][p_mins[0]]; - dist[1][p_mins[0]] = FLT_MAX; /* exclude 1st */ - - p_mins[1] = minimum( dist[1], maxC_pre, NULL ); /* find 2nd best entry */ - tmp2 = dist[1][p_mins[1]]; - dist[1][p_mins[1]] = FLT_MAX; /* exclude 2nd*/ - - dist[1][p_mins[0]] = tmp; /* restore 1st */ - dist[1][p_mins[1]] = tmp2; /* restore 2nd */ - - idx_min[0] = indices_st1_local[p_mins[0]]; - idx_min[1] = indices_st1_local[p_mins[1]]; - - - /* use global exclusion list to never reselect the two (best) mse values sofar */ - st1_mse_ptr[idx_min[0]] = FLT_MAX; /* move32() */ - st1_mse_ptr[idx_min[1]] = FLT_MAX; /* move32() */ - - /* circular MSE-neigbour list in use to potentially replace some segment search candidates */ - /* using both 1st and 2nd best neighbours in fwd and rev directions */ - check_ind[0] = cdk1_ivas_segm_neighbour_fwd[idx_min[0]]; - check_ind[1] = cdk1_ivas_segm_neighbour_rev[idx_min[0]]; - - check_ind[2] = cdk1_ivas_segm_neighbour_fwd[idx_min[1]]; - check_ind[3] = cdk1_ivas_segm_neighbour_rev[idx_min[1]]; - - check_ind[4] = cdk1_ivas_segm_neighbour_fwd[check_ind[0]]; - check_ind[5] = cdk1_ivas_segm_neighbour_rev[check_ind[1]]; - - check_ind[6] = cdk1_ivas_segm_neighbour_fwd[check_ind[2]]; - check_ind[7] = cdk1_ivas_segm_neighbour_rev[check_ind[3]]; - - for ( i = 0; i < FDCNG_VQ_DCT_NPOST; i++ ) - { - float check_mse = st1_mse_ptr[check_ind[i]] * fdcng_dct_scaleF[2]; - /* *= fdcng_dct_scaleF[2]; */ /* multiplication in use to get the float outer loop scale correct */ - - if ( check_mse < dist[1][p_max] ) - { - /* new winner , replace */ - dist[1][p_max] = check_mse; - indices_st1_local[p_max] = check_ind[i]; - st1_mse_ptr[check_ind[i]] = FLT_MAX; /* BASOP: move32() */ - p_max = maximum( dist[1], maxC_pre, NULL ); /* establish a new current worst candidate among all maxC */ - } - } - - for ( c = 0; c < maxC_pre; c++ ) - { - indices[1][c * stages] = indices_st1_local[c]; /* move established stage#1 indices to global MSVQ list structure */ - } - - /* extract the selected stage one vectors in DCT domain , apply IDCT_N and scale up */ - /*always extract full length signal(24) to be able to update WB( N==21) candidate MSE values */ - for ( c = 0; c < maxC_pre; c++ ) - { - dec_FDCNG_MSVQ_stage1( indices_st1_local[c], FDCNG_VQ_MAX_LEN, invTrfMatrix, dcttype + 1, &( st1_syn_vec_ptr[c * FDCNG_VQ_MAX_LEN] ), NULL ); - } - - assert( maxC == maxC_pre ); - } -#endif else /* non-DCT Stage #1 code below */ if ( !s ) /* means: m==1 */ @@ -784,28 +588,10 @@ void msvq_enc( essentially subtract res21^2 ,res22^2, res23^2 that was included in stage1 MSE in the DCT24 domain truncated search, excludes the waveform contributions at pos 21,22,23 to the MSE, important to keep WB MSEs update for the subsequent stages */ -#ifdef ERI_MSVQ_CLEANUP if ( s == 0 && applyDCT_flag != 0 && n == FDCNG_VQ_MAX_LEN_WB ) { p_max = msvq_stage1_dct_recalc_candidates_fdcng_wb( st1_syn_vec_ptr, u, maxC, dist[1] ); } -#else - if ( s == 0 && applyDCT_flag != 0 && n == FDCNG_VQ_MAX_LEN_WB ) - { - assert( start == 0 ); - for ( c = 0; c < maxC; c++ ) - { /* point to extended synthesis part */ - p2 = (const float *) &( st1_syn_vec_ptr[c * FDCNG_VQ_MAX_LEN + FDCNG_VQ_MAX_LEN_WB] ); /* ptr init */ - /* for stage#1 use "u" instead of the shortened resid[0], to access the extended/extrapolated input target */ - v_sub( p2, &( u[FDCNG_VQ_MAX_LEN_WB] ), high_diff, FDCNG_VQ_MAX_LEN - FDCNG_VQ_MAX_LEN_WB ); - res24 = dotp( high_diff, high_diff, FDCNG_VQ_MAX_LEN - FDCNG_VQ_MAX_LEN_WB ); /* sum squared over 3 env. values */ - - dist[1][c] -= res24; /* remove DCT24 high band error contribution */ - } - /* update p_max, as it may potentially change, due to the core DCT24 search originally optimizing over longer basis vectors than 21 */ - p_max = maximum( dist[1], maxC, NULL ); - } -#endif m = maxC; } /* for (m=1, s=0; shSpMusClas; @@ -1861,7 +1859,6 @@ void ivas_smc_mode_selection( S_ave = sum_f( st->hSpMusClas->tod_lt_Bin_E, TOD_NSPEC ) / TOD_NSPEC; S_p2a = S_max - S_ave; -#ifdef FIX_SP2A if ( element_brate <= IVAS_16k4 ) { thr_sp2a = THR_P2A_HIGH; @@ -1870,14 +1867,9 @@ void ivas_smc_mode_selection( { thr_sp2a = THR_P2A; } -#endif /* initial 3-way selection of coding modes (ACELP/GSC/TCX) */ -#ifdef FIX_SP2A if ( relE > -10.0f && ( S_p2a > thr_sp2a || ton > hSpMusClas->tod_thr_lt ) ) -#else - if ( relE > -10.0f && ( S_p2a > THR_P2A || ton > hSpMusClas->tod_thr_lt ) ) -#endif { /* select TCX to encode extremely peaky signals or strongly tonal signals */ st->sp_aud_decision1 = 1; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 06fd160bb2819cdb9c10a65cfa6b668ff536592b..f19e0dbf1a4657f63f4961b27c21c6a6d10dbc47 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -52,11 +52,9 @@ * Local constants *------------------------------------------------------------------------*/ -#define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f -#ifdef FIX_417_TD_DECORR_BRATE_SW +#define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) -#endif /* powf(0.95f, 4.0f) for sub-frame smoothing instead of CLDFB slot */ #define ADAPT_HTPROTO_IIR_FAC 0.81450625f @@ -70,7 +68,6 @@ * Local function prototypes *------------------------------------------------------------------------*/ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, float *output_f[], const int16_t nchan_transport, const int16_t subframe ); #else @@ -79,17 +76,9 @@ static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, float out static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_HANDLE hDirAC, const int16_t slot, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ); static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( Decoder_Struct *st_ivas, 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 ); -#else -static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, float output_f[][L_FRAME48k], const int16_t nchan_transport, const uint8_t firstSubframe, const uint8_t nSubframes ); - -static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_HANDLE hDirAC, const int8_t slot, float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ); - -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( Decoder_Struct *st_ivas, float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Rmat[3][3], const uint8_t firstSubframe, const uint8_t nSubFrames ); -#endif static void ivas_dirac_dec_binaural_determine_processing_matrices( Decoder_Struct *st_ivas, const int16_t max_band_decorr, float Rmat[3][3] ); -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS static void ivas_dirac_dec_binaural_process_output( Decoder_Struct *st_ivas, 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 subframe ); @@ -104,14 +93,6 @@ static void adaptTransportSignalsHeadtracked( HEAD_TRACK_DATA_HANDLE hHeadTrackD static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( HEAD_TRACK_DATA_HANDLE hHeadTrackData, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t nBins, float Rmat[3][3] ); #endif -#else -static void ivas_dirac_dec_binaural_process_output( Decoder_Struct *st_ivas, float output_f[][L_FRAME48k], float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_band_decorr, const uint8_t numInputChannels, const uint8_t firstSlot, const uint8_t slotEnd ); - -static void adaptTransportSignalsHeadtracked( HEAD_TRACK_DATA_HANDLE hHeadTrackData, float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const uint8_t firstSlot, const uint8_t slotEnd, const uint8_t nBins, float Rmat[3][3] ); - -static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( HEAD_TRACK_DATA_HANDLE hHeadTrackData, float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const uint8_t firstSlot, const uint8_t slotEnd, const uint8_t nBins, float Rmat[3][3] ); - -#endif static void formulate2x2MixingMatrix( float Ein1, float Ein2, float CinRe, float CinIm, float Eout1, float Eout2, float CoutRe, float CoutIm, float Q[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], const float regularizationFactor ); @@ -123,22 +104,8 @@ static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Ai static void matrixTransp2Mul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); -#ifndef FIX_417_TD_DECORR_BRATE_SW -static float configure_reqularization_factor( const IVAS_FORMAT ivas_format, const int32_t ivas_brate ); -#endif #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_binaural_process_output_sf( Decoder_Struct *st_ivas, float *output_f[], float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t max_band_decorr, const uint8_t numInChannels ); - -static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_sf( HEAD_TRACK_DATA_HANDLE hHeadTrackData, float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const uint8_t slotEnd, const uint8_t nBins, float Rmat[3][3] ); - -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_sf( Decoder_Struct *st_ivas, float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], int16_t azimuth[CLDFB_NO_CHANNELS_MAX], int16_t elevation[CLDFB_NO_CHANNELS_MAX], float energy_ratio1[CLDFB_NO_CHANNELS_MAX], float spreadCoherence[CLDFB_NO_CHANNELS_MAX], float surroundingCoherence[CLDFB_NO_CHANNELS_MAX], float Rmat[3][3] ); - -static void ivas_dirac_dec_binaural_internal_sf( Decoder_Struct *st_ivas, float *output_f[], const int16_t nchan_transport ); - -static void ivas_dirac_dec_decorrelate_slot_sf( DIRAC_DEC_HANDLE hDirAC, const int8_t slot, float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ); -#endif #endif /*------------------------------------------------------------------------- * ivas_dirac_dec_init_binaural_data() @@ -198,34 +165,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( set_zero( hBinaural->ChCrossImOutPrev, nBins ); hBinaural->renderStereoOutputInsteadOfBinaural = 0; -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS - hBinaural->useSubframeMode = 1; -#endif - -#ifndef FIX_417_TD_DECORR_BRATE_SW - hBinaural->useTdDecorr = 0; - if ( st_ivas->ivas_format == SBA_FORMAT ) - { - if ( st_ivas->nchan_transport == 1 ) - { - hBinaural->useTdDecorr = 1; - } - } - else if ( st_ivas->ivas_format == MASA_FORMAT ) - { - if ( ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) || st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - hBinaural->useTdDecorr = 1; - } - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - if ( ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_48k && st_ivas->nchan_transport == 1 ) ) - { - hBinaural->useTdDecorr = 1; - } - } -#endif for ( bin = 0; bin < nBins; bin++ ) { @@ -252,7 +191,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hBinaural->earlyPartEneCorrection, nBins ); /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS if ( hBinaural->hReverb != NULL && ( ( hBinaural->hReverb->numBins != nBins ) || ( hBinaural->hReverb->blockSize != CLDFB_SLOTS_PER_SUBFRAME ) ) ) { @@ -261,18 +199,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hBinaural->hReverb == NULL ) { -#if defined( JBM_TSM_ON_TCS ) && !defined( FIX_355_REFACTOR_PARAMBIN_TO_5MS ) - int16_t reverbBlockSize = st_ivas->hDecoderConfig->voip_active ? 1 : CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; - if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, - nBins, - reverbBlockSize, NULL, - st_ivas->hIntSetup.output_config, - output_Fs, - RENDERER_BINAURAL_PARAMETRIC_ROOM, - st_ivas->hHrtfFastConv, - st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) - -#else if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, @@ -281,65 +207,10 @@ ivas_error ivas_dirac_dec_init_binaural_data( RENDERER_BINAURAL_PARAMETRIC_ROOM, st_ivas->hHrtfFastConv, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } } -#else - if ( hBinaural->hReverb != NULL && ( ( hBinaural->hReverb->numBins != nBins ) || - ( hBinaural->useSubframeMode && hBinaural->hReverb->blockSize != CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ) || - ( !hBinaural->useSubframeMode && hBinaural->hReverb->blockSize != CLDFB_NO_COL_MAX ) ) ) - { - ivas_binaural_reverb_close( &( hBinaural->hReverb ) ); - } - - if ( hBinaural->hReverb == NULL ) - { - if ( hBinaural->useSubframeMode ) - { -#ifdef JBM_TSM_ON_TCS - reverbBlockSize = st_ivas->hDecoderConfig->voip_active ? 1 : CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; - if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, - nBins, - reverbBlockSize, NULL, - st_ivas->hIntSetup.output_config, - output_Fs, - RENDERER_BINAURAL_PARAMETRIC_ROOM, - st_ivas->hHrtfFastConv, - st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) - -#else - if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, - nBins, - CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, - st_ivas->hIntSetup.output_config, - output_Fs, - RENDERER_BINAURAL_PARAMETRIC_ROOM, - st_ivas->hHrtfFastConv, - st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif - { - return error; - } - } - else - { - if ( ( error = ivas_binaural_reverb_open( &hBinaural->hReverb, - nBins, - CLDFB_NO_COL_MAX, - NULL, - st_ivas->hIntSetup.output_config, - output_Fs, - RENDERER_BINAURAL_PARAMETRIC_ROOM, - st_ivas->hHrtfFastConv, - st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } -#endif } else if ( renderer_type == RENDERER_STEREO_PARAMETRIC ) { @@ -352,7 +223,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( assert( false ); } -#ifdef FIX_417_TD_DECORR_BRATE_SW if ( hBinaural->hTdDecorr == NULL ) { hBinaural->useTdDecorr = 0; @@ -362,35 +232,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( { return error; } -#else - if ( hBinaural->useTdDecorr ) - { - if ( st_ivas->hDecoderConfig->ivas_total_brate >= IVAS_13k2 && st_ivas->ivas_format == SBA_FORMAT ) - { - if ( hBinaural->hTdDecorr == NULL ) - { - ivas_td_decorr_dec_open( &( hBinaural->hTdDecorr ), output_Fs, 3, 1 ); - } - - if ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_24k4 ) - { - hBinaural->hTdDecorr->pTrans_det->duck_mult_fac = IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR; - } - else - { - hBinaural->hTdDecorr->pTrans_det->duck_mult_fac = IVAS_TDET_DUCK_MULT_FAC_PARA_BIN; - } - } - else - { - ivas_td_decorr_dec_open( &( hBinaural->hTdDecorr ), output_Fs, 3, 0 ); - } - } - else - { - ivas_td_decorr_dec_close( &( hBinaural->hTdDecorr ) ); - } -#endif hBinaural->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); @@ -531,11 +372,7 @@ void ivas_dirac_dec_binaural_render( for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * hDirAC->subframe_nbslots[subframe_idx]; -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS ivas_dirac_dec_binaural_internal( st_ivas, output_f_local, nchan_transport, subframe_idx ); -#else - ivas_dirac_dec_binaural_internal_sf( st_ivas, output_f_local, nchan_transport ); -#endif for ( ch = 0; ch < nchan_out; ch++ ) { output_f_local[ch] += n_samples_sf; @@ -563,9 +400,7 @@ void ivas_dirac_dec_binaural( const int16_t nchan_transport /* i : number of transport channels */ ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS int16_t subframe; -#endif #ifdef JBM_TSM_ON_TCS float cng_td_buffer[L_FRAME16k]; float *p_output[MAX_OUTPUT_CHANNELS]; @@ -629,7 +464,6 @@ void ivas_dirac_dec_binaural( } #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS for ( subframe = 0; subframe < MAX_PARAM_SPATIAL_SUBFRAMES; subframe++ ) { #ifdef JBM_TSM_ON_TCS @@ -644,20 +478,6 @@ void ivas_dirac_dec_binaural( ivas_dirac_dec_binaural_internal( st_ivas, output_f, nchan_transport, subframe ); #endif } -#else - if ( st_ivas->hDiracDecBin->useSubframeMode ) - { - uint8_t subframe; - for ( subframe = 0; subframe < MAX_PARAM_SPATIAL_SUBFRAMES; subframe++ ) - { - ivas_dirac_dec_binaural_internal( st_ivas, output_f, nchan_transport, subframe, 1u ); - } - } - else - { - ivas_dirac_dec_binaural_internal( st_ivas, output_f, nchan_transport, 0u, (uint8_t) MAX_PARAM_SPATIAL_SUBFRAMES ); - } -#endif #ifdef JBM_TSM_ON_TCS for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ ) { @@ -672,209 +492,8 @@ void ivas_dirac_dec_binaural( * Local functions *------------------------------------------------------------------------*/ #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_binaural_internal_sf( - Decoder_Struct *st_ivas, - float *output_f[], - const int16_t nchan_transport ) -{ - DIRAC_DEC_HANDLE hDirAC; - uint8_t slot, ch, nBins, numInChannels; - float Cldfb_RealBuffer_in[2 * BINAURAL_CHANNELS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_in[2 * BINAURAL_CHANNELS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - /* local copies of azi, ele, diffuseness */ - int16_t azimuth[CLDFB_NO_CHANNELS_MAX]; - int16_t elevation[CLDFB_NO_CHANNELS_MAX]; - float spreadCoherence[CLDFB_NO_CHANNELS_MAX]; - float surroundingCoherence[CLDFB_NO_CHANNELS_MAX]; - float energy_ratio1[CLDFB_NO_CHANNELS_MAX]; - float Rmat[3][3]; - uint16_t subframe_idx, slot_idx_start; - int16_t max_band_decorr; - DIFFUSE_DISTRIBUTION_DATA diffuseDistData; - - - hDirAC = st_ivas->hDirAC; - nBins = (uint8_t) hDirAC->num_freq_bands; - - /* The input channel number at this processing function (not nchan_transport) */ - numInChannels = BINAURAL_CHANNELS; - if ( st_ivas->hOutSetup.separateChannelEnabled ) - { - numInChannels++; - } - - Rmat[0][0] = 1.0f; - Rmat[0][1] = 0.0f; - Rmat[0][2] = 0.0f; - - Rmat[1][0] = 0.0f; - Rmat[1][1] = 1.0f; - Rmat[1][2] = 0.0f; - - Rmat[2][0] = 0.0f; - Rmat[2][1] = 0.0f; - Rmat[2][2] = 1.0f; - - slot_idx_start = hDirAC->slots_rendered; - subframe_idx = hDirAC->subframes_rendered; - - /* copy parameters into local buffers*/ - mvs2s( hDirAC->azimuth[hDirAC->render_to_md_map[subframe_idx]], azimuth, hDirAC->num_freq_bands ); - mvs2s( hDirAC->elevation[hDirAC->render_to_md_map[subframe_idx]], elevation, hDirAC->num_freq_bands ); - mvr2r( hDirAC->spreadCoherence[hDirAC->render_to_md_map[subframe_idx]], spreadCoherence, hDirAC->num_freq_bands ); - mvr2r( hDirAC->surroundingCoherence[hDirAC->render_to_md_map[subframe_idx]], surroundingCoherence, hDirAC->num_freq_bands ); - mvr2r( hDirAC->energy_ratio1[hDirAC->render_to_md_map[subframe_idx]], energy_ratio1, hDirAC->num_freq_bands ); - - /* CLDFB Analysis of input */ - for ( slot = 0; slot < hDirAC->subframe_nbslots[hDirAC->subframes_rendered]; slot++ ) - { - for ( ch = 0; ch < numInChannels; ch++ ) - { - if ( ch == 0 || nchan_transport == 2 ) - { - cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[ch][nBins * ( slot + slot_idx_start )] ), - Cldfb_RealBuffer_in[ch][slot], - Cldfb_ImagBuffer_in[ch][slot], - nBins, st_ivas->cldfbAnaDec[ch] ); - } - else if ( st_ivas->nchan_transport == 2 ) /* Stereo signal transmitted as mono with DFT stereo */ - { - /* At mono input duplicate the channel to dual-mono */ - mvr2r( Cldfb_RealBuffer_in[0][slot], Cldfb_RealBuffer_in[1][slot], nBins ); - mvr2r( Cldfb_ImagBuffer_in[0][slot], Cldfb_ImagBuffer_in[1][slot], nBins ); - } - else /* when nchan_transport == 1 and ch == 1 */ - { - /* CNA and HB FD-CNG*/ - if ( st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) - { - int16_t numCoreBands, b; - - numCoreBands = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->numCoreBands; - - - generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, - st_ivas->cldfbAnaDec[1], - st_ivas->hTcBuffer->tc[nchan_transport], - Cldfb_RealBuffer_in[2][slot], Cldfb_ImagBuffer_in[2][slot], - slot + slot_idx_start, - st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, - ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); - - generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, - st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ - NULL, - Cldfb_RealBuffer_in[1][slot], Cldfb_ImagBuffer_in[1][slot], - slot + slot_idx_start, - st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, - ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); - - /* LB: Copy first channel + LB-CNG to first and second channels with same scaling (dual-mono)*/ - for ( b = 0; b < numCoreBands; b++ ) - { - Cldfb_RealBuffer_in[0][slot][b] = INV_SQRT2 * ( Cldfb_RealBuffer_in[0][slot][b] + Cldfb_RealBuffer_in[2][slot][b] ); - Cldfb_RealBuffer_in[1][slot][b] = Cldfb_RealBuffer_in[0][slot][b]; - Cldfb_ImagBuffer_in[0][slot][b] = INV_SQRT2 * ( Cldfb_ImagBuffer_in[0][slot][b] + Cldfb_ImagBuffer_in[2][slot][b] ); - Cldfb_ImagBuffer_in[1][slot][b] = Cldfb_ImagBuffer_in[0][slot][b]; - } - - /* HB: Copy first channel to second channel and add HB-CNGs with different scalings*/ - for ( ; b < nBins; b++ ) - { - Cldfb_RealBuffer_in[0][slot][b] *= INV_SQRT2; - Cldfb_RealBuffer_in[1][slot][b] = Cldfb_RealBuffer_in[0][slot][b] + 0.5f * Cldfb_RealBuffer_in[1][slot][b] + Cldfb_RealBuffer_in[0][slot][b]; - Cldfb_RealBuffer_in[0][slot][b] += 0.5f * Cldfb_RealBuffer_in[2][slot][b]; - - Cldfb_ImagBuffer_in[0][slot][b] *= INV_SQRT2; - Cldfb_ImagBuffer_in[1][slot][b] = Cldfb_ImagBuffer_in[0][slot][b] + 0.5f * Cldfb_ImagBuffer_in[1][slot][b]; - Cldfb_ImagBuffer_in[0][slot][b] += 0.5f * Cldfb_ImagBuffer_in[2][slot][b]; - } - } - else - { - /* At mono input duplicate the channel to dual-mono, and apply gain - correction to ensure same overall level as in stereo mode */ - v_multc( Cldfb_RealBuffer_in[0][slot], INV_SQRT_2, Cldfb_RealBuffer_in[0][slot], nBins ); - v_multc( Cldfb_ImagBuffer_in[0][slot], INV_SQRT_2, Cldfb_ImagBuffer_in[0][slot], nBins ); - - mvr2r( Cldfb_RealBuffer_in[0][slot], Cldfb_RealBuffer_in[1][slot], nBins ); - mvr2r( Cldfb_ImagBuffer_in[0][slot], Cldfb_ImagBuffer_in[1][slot], nBins ); - } - } - } - - if ( st_ivas->hDiracDecBin->useTdDecorr ) - { - for ( ch = BINAURAL_CHANNELS; ch < ( 2 * BINAURAL_CHANNELS ); ch++ ) - { - cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[ch][nBins * ( slot + slot_idx_start )] ), - Cldfb_RealBuffer_in[ch][slot], - Cldfb_ImagBuffer_in[ch][slot], - nBins, st_ivas->cldfbAnaDec[ch] ); - - if ( st_ivas->nchan_transport == 1 && st_ivas->ivas_format == SBA_FORMAT ) - { - 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 ); - } - } - } - } - - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) - { - st_ivas->hDirAC->hDiffuseDist = &diffuseDistData; - ivas_spar_param_to_masa_param_mapping_sf( st_ivas, azimuth, elevation, energy_ratio1, spreadCoherence, surroundingCoherence, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in ); - - ivas_sba_prototype_renderer_sf( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in ); - - /* we are done with SPAR, update SPAR info*/ - st_ivas->hSpar->slots_rendered += st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; - st_ivas->hSpar->subframes_rendered++; - } - - if ( st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) - { - QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[subframe_idx], Rmat ); - - if ( nchan_transport == 2 ) - { - ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_sf( st_ivas->hHeadTrackData, Cldfb_ImagBuffer_in, Cldfb_RealBuffer_in, (uint8_t) hDirAC->subframe_nbslots[subframe_idx], nBins, Rmat ); - } - } - - ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_sf( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, azimuth, elevation, energy_ratio1, spreadCoherence, surroundingCoherence, Rmat ); - - if ( st_ivas->ivas_format == ISM_FORMAT ) - { - max_band_decorr = 0; - } - else if ( st_ivas->hDiracDecBin->useTdDecorr ) - { - max_band_decorr = CLDFB_NO_CHANNELS_MAX; - } - else - { - max_band_decorr = st_ivas->hDirAC->h_freq_domain_decorr_ap_params->max_band_decorr; - } - - ivas_dirac_dec_binaural_determine_processing_matrices( st_ivas, max_band_decorr, Rmat ); - - ivas_dirac_dec_binaural_process_output_sf( st_ivas, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels ); - - /* we are done with DirAC, update DirAC info*/ - st_ivas->hDirAC->slots_rendered += st_ivas->hDirAC->subframe_nbslots[st_ivas->hDirAC->subframes_rendered]; - st_ivas->hDirAC->subframes_rendered++; - - st_ivas->hDirAC->hDiffuseDist = NULL; - - return; -} -#endif #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, #ifdef JBM_TSM_ON_TCS @@ -1098,205 +717,8 @@ static void ivas_dirac_dec_binaural_internal( return; } -#else -static void ivas_dirac_dec_binaural_internal( - Decoder_Struct *st_ivas, - float output_f[][L_FRAME48k], - const int16_t nchan_transport, - const uint8_t firstSubframe, - const uint8_t nSubframes ) -{ - DIRAC_DEC_HANDLE hDirAC; - uint8_t slot, ch, nBins, numInChannels; - float Cldfb_RealBuffer_in[4][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_in[4][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float Rmat[3][3]; - uint8_t firstSlot, slotEnd; - int16_t max_band_decorr; - DIFFUSE_DISTRIBUTION_DATA diffuseDistData; - - firstSlot = firstSubframe * ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); - slotEnd = ( firstSubframe + nSubframes ) * ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); - - hDirAC = st_ivas->hDirAC; - nBins = (uint8_t) hDirAC->num_freq_bands; - - /* The input channel number at this processing function (not nchan_transport) */ - numInChannels = BINAURAL_CHANNELS; - if ( st_ivas->hOutSetup.separateChannelEnabled ) - { - numInChannels++; - } - - Rmat[0][0] = 1.0f; - Rmat[0][1] = 0.0f; - Rmat[0][2] = 0.0f; - - Rmat[1][0] = 0.0f; - Rmat[1][1] = 1.0f; - Rmat[1][2] = 0.0f; - - Rmat[2][0] = 0.0f; - Rmat[2][1] = 0.0f; - Rmat[2][2] = 1.0f; - - /* CLDFB Analysis of input */ - for ( slot = firstSlot; slot < slotEnd; slot++ ) - { - for ( ch = 0; ch < numInChannels; ch++ ) - { - if ( ch == 0 || nchan_transport == 2 ) - { - cldfbAnalysis_ts( &( output_f[ch][nBins * slot] ), - Cldfb_RealBuffer_in[ch][slot], - Cldfb_ImagBuffer_in[ch][slot], - nBins, st_ivas->cldfbAnaDec[ch] ); - } - else if ( st_ivas->nchan_transport == 2 ) /* Stereo signal transmitted as mono with DFT stereo */ - { - /* At mono input duplicate the channel to dual-mono */ - mvr2r( Cldfb_RealBuffer_in[0][slot], Cldfb_RealBuffer_in[1][slot], nBins ); - mvr2r( Cldfb_ImagBuffer_in[0][slot], Cldfb_ImagBuffer_in[1][slot], nBins ); - } - else /* when nchan_transport == 1 and ch == 1 */ - { - /* CNA and HB FD-CNG*/ - if ( st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) - { - int16_t numCoreBands, b; - - numCoreBands = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->numCoreBands; - - generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, - st_ivas->cldfbAnaDec[1], -#ifdef JBM_TSM_ON_TCS - st_ivas->hTcBuffer->tc[1], -#else - &( output_f[1][L_FRAME48k - L_FRAME16k] ), /*used as temporary static buffer for the whole frame*/ -#endif - Cldfb_RealBuffer_in[2][slot], Cldfb_ImagBuffer_in[2][slot], - slot, - st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, - ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); - - generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, - st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ - NULL, - Cldfb_RealBuffer_in[1][slot], Cldfb_ImagBuffer_in[1][slot], - slot, - st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, - ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); - - /* LB: Copy first channel + LB-CNG to first and second channels with same scaling (dual-mono)*/ - for ( b = 0; b < numCoreBands; b++ ) - { - Cldfb_RealBuffer_in[0][slot][b] = INV_SQRT2 * ( Cldfb_RealBuffer_in[0][slot][b] + Cldfb_RealBuffer_in[2][slot][b] ); - Cldfb_RealBuffer_in[1][slot][b] = Cldfb_RealBuffer_in[0][slot][b]; - Cldfb_ImagBuffer_in[0][slot][b] = INV_SQRT2 * ( Cldfb_ImagBuffer_in[0][slot][b] + Cldfb_ImagBuffer_in[2][slot][b] ); - Cldfb_ImagBuffer_in[1][slot][b] = Cldfb_ImagBuffer_in[0][slot][b]; - } - - /* HB: Copy first channel to second channel and add HB-CNGs with different scalings*/ - for ( ; b < nBins; b++ ) - { - Cldfb_RealBuffer_in[0][slot][b] *= INV_SQRT2; - Cldfb_RealBuffer_in[1][slot][b] = Cldfb_RealBuffer_in[0][slot][b] + 0.5f * Cldfb_RealBuffer_in[1][slot][b] + Cldfb_RealBuffer_in[0][slot][b]; - Cldfb_RealBuffer_in[0][slot][b] += 0.5f * Cldfb_RealBuffer_in[2][slot][b]; - - Cldfb_ImagBuffer_in[0][slot][b] *= INV_SQRT2; - Cldfb_ImagBuffer_in[1][slot][b] = Cldfb_ImagBuffer_in[0][slot][b] + 0.5f * Cldfb_ImagBuffer_in[1][slot][b]; - Cldfb_ImagBuffer_in[0][slot][b] += 0.5f * Cldfb_ImagBuffer_in[2][slot][b]; - } - } - else - { - /* At mono input duplicate the channel to dual-mono, and apply gain - correction to ensure same overall level as in stereo mode */ - v_multc( Cldfb_RealBuffer_in[0][slot], INV_SQRT_2, Cldfb_RealBuffer_in[0][slot], nBins ); - v_multc( Cldfb_ImagBuffer_in[0][slot], INV_SQRT_2, Cldfb_ImagBuffer_in[0][slot], nBins ); - - mvr2r( Cldfb_RealBuffer_in[0][slot], Cldfb_RealBuffer_in[1][slot], nBins ); - mvr2r( Cldfb_ImagBuffer_in[0][slot], Cldfb_ImagBuffer_in[1][slot], nBins ); - } - } - } - - if ( st_ivas->hDiracDecBin->useTdDecorr ) - { - for ( ch = BINAURAL_CHANNELS; ch < ( 2 * BINAURAL_CHANNELS ); ch++ ) - { - cldfbAnalysis_ts( -#ifdef JBM_TSM_ON_TCS - &( st_ivas->hTcBuffer->tc[ch][nBins * slot] ), -#else - &( output_f[ch][nBins * slot] ), -#endif - Cldfb_RealBuffer_in[ch][slot], - Cldfb_ImagBuffer_in[ch][slot], - nBins, st_ivas->cldfbAnaDec[ch] ); - - if ( st_ivas->nchan_transport == 1 && st_ivas->ivas_format == SBA_FORMAT ) - { - 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 ); - } - } - } - } - - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR ) - { - st_ivas->hDirAC->hDiffuseDist = &diffuseDistData; - - ivas_spar_param_to_masa_param_mapping( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, firstSubframe, nSubframes ); - - ivas_sba_prototype_renderer( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, firstSubframe, nSubframes ); - } - if ( st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) - { - QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[firstSubframe], Rmat ); - - if ( nchan_transport == 2 ) - { - adaptTransportSignalsHeadtracked( st_ivas->hHeadTrackData, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, firstSlot, slotEnd, nBins, Rmat ); - - ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( st_ivas->hHeadTrackData, Cldfb_ImagBuffer_in, Cldfb_RealBuffer_in, firstSlot, slotEnd, nBins, Rmat ); - } - } - - ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, firstSubframe, nSubframes ); - - if ( st_ivas->ivas_format == ISM_FORMAT ) - { - max_band_decorr = 0; - } - else if ( st_ivas->hDiracDecBin->useTdDecorr ) - { - max_band_decorr = CLDFB_NO_CHANNELS_MAX; - } - else - { - max_band_decorr = st_ivas->hDirAC->h_freq_domain_decorr_ap_params->max_band_decorr; - } - - ivas_dirac_dec_binaural_determine_processing_matrices( st_ivas, max_band_decorr, Rmat ); - - ivas_dirac_dec_binaural_process_output( st_ivas, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, firstSlot, slotEnd ); - - st_ivas->hDirAC->hDiffuseDist = NULL; - -#ifdef JBM_TSM_ON_TCS - st_ivas->hDirAC->slots_rendered += ( slotEnd - firstSlot ); - st_ivas->hDirAC->subframes_rendered += nSubframes; -#endif - - return; -} -#endif - -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_HANDLE hDirAC, const int16_t slot, @@ -1304,15 +726,6 @@ static void ivas_dirac_dec_decorrelate_slot( float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ) -#else -static void ivas_dirac_dec_decorrelate_slot( - DIRAC_DEC_HANDLE hDirAC, - const int8_t slot, - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float decRe[][CLDFB_NO_CHANNELS_MAX], - float decIm[][CLDFB_NO_CHANNELS_MAX] ) -#endif { int16_t offset, ch, bin; float onset_filter[BINAURAL_CHANNELS * CLDFB_NO_CHANNELS_MAX]; /* 2 ch, 60 bins */ @@ -1358,72 +771,19 @@ static void ivas_dirac_dec_decorrelate_slot( } #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_decorrelate_slot_sf( - DIRAC_DEC_HANDLE hDirAC, - const int8_t slot, - float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - float decRe[][CLDFB_NO_CHANNELS_MAX], - float decIm[][CLDFB_NO_CHANNELS_MAX] ) -{ - int16_t offset, ch, bin; - float onset_filter[BINAURAL_CHANNELS * CLDFB_NO_CHANNELS_MAX]; /* 2 ch, 60 bins */ - float decorrelatedFrameInterleaved[2 * BINAURAL_CHANNELS * CLDFB_NO_CHANNELS_MAX]; /* 2 ch, real + imag, 60 bins */ - - /* Decorrelation needs interleaved data. Copy left and right signals to proto_frame_f */ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - offset = hDirAC->num_freq_bands * BINAURAL_CHANNELS * ch; - for ( bin = 0; bin < hDirAC->num_freq_bands; bin++ ) - { - hDirAC->proto_frame_f[( bin * BINAURAL_CHANNELS ) + offset] = inRe[ch][slot][bin]; - hDirAC->proto_frame_f[( bin * BINAURAL_CHANNELS ) + offset + 1] = inIm[ch][slot][bin]; - } - } - - /* Decorrelate proto signal to decorrelatedFrameInterleaved */ - ivas_dirac_dec_decorr_process( hDirAC->num_freq_bands, - hDirAC->num_outputs_diff, - hDirAC->num_protos_diff, - hDirAC->synthesisConf, - BINAURAL_CHANNELS, - hDirAC->proto_frame_f, - hDirAC->num_protos_diff, - hDirAC->proto_index_diff, - decorrelatedFrameInterleaved, - onset_filter, - hDirAC->h_freq_domain_decorr_ap_params, - hDirAC->h_freq_domain_decorr_ap_state ); - - /* De-interleave decorrelated signals*/ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - offset = hDirAC->num_freq_bands * BINAURAL_CHANNELS * ch; - for ( bin = 0; bin < hDirAC->num_freq_bands; bin++ ) - { - decRe[ch][bin] = decorrelatedFrameInterleaved[( bin * BINAURAL_CHANNELS ) + offset]; - decIm[ch][bin] = decorrelatedFrameInterleaved[( bin * BINAURAL_CHANNELS ) + offset + 1]; - } - } +#endif - return; -} -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices_sf( +static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( Decoder_Struct *st_ivas, - float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - int16_t azimuth[CLDFB_NO_CHANNELS_MAX], - int16_t elevation[CLDFB_NO_CHANNELS_MAX], - float energy_ratio1[CLDFB_NO_CHANNELS_MAX], - float spreadCoherence[CLDFB_NO_CHANNELS_MAX], - float surroundingCoherence[CLDFB_NO_CHANNELS_MAX], - float Rmat[3][3] ) + 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 ) { - uint8_t ch, slot, bin; + int16_t ch, slot, bin; uint8_t separateCenterChannelRendering; - int16_t nBins, idx, subframe; + int16_t nBins, idx; float frameMeanDiffusenessEneWeight[CLDFB_NO_CHANNELS_MAX]; DIRAC_DEC_HANDLE hDirAC; DIRAC_DEC_BIN_HANDLE h; @@ -1431,15 +791,13 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric float qualityBasedSmFactor; float lowBitRateEQ[CLDFB_NO_CHANNELS_MAX]; uint8_t applyLowBitRateEQ; + int16_t dirac_read_idx; float subFrameTotalEne[CLDFB_NO_CHANNELS_MAX]; - int16_t md_idx; hDirAC = st_ivas->hDirAC; h = st_ivas->hDiracDecBin; separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; nBins = hDirAC->num_freq_bands; /* Actually bins */ - subframe = hDirAC->subframes_rendered; - md_idx = hDirAC->render_to_md_map[hDirAC->subframes_rendered]; set_zero( h->ChCrossRe, nBins ); set_zero( h->ChCrossIm, nBins ); @@ -1475,11 +833,20 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } } - /* Formulate input and target covariance matrices combining all subframes */ + /* Formulate input and target covariance matrices for this subframe */ set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); +#ifdef JBM_TSM_ON_TCS + dirac_read_idx = hDirAC->render_to_md_map[subframe]; +#else + dirac_read_idx = hDirAC->dirac_read_idx; +#endif /* Calculate input covariance matrix */ - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots[subframe]; slot++ ) +#ifdef JBM_TSM_ON_TCS + for ( slot = 0; slot < hDirAC->subframe_nbslots[subframe]; slot++ ) +#else + for ( slot = 0; slot < hDirAC->subframe_nbslots; slot++ ) +#endif { for ( bin = 0; bin < nBins; bin++ ) { @@ -1520,7 +887,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots[subframe]; slot++ ) +#ifdef JBM_TSM_ON_TCS + for ( slot = 0; slot < hDirAC->subframe_nbslots[subframe]; slot++ ) +#else + for ( slot = 0; slot < hDirAC->subframe_nbslots; slot++ ) +#endif { for ( bin = 0; bin < nBins; bin++ ) { @@ -1537,7 +908,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ float diffEne, dirEne, meanEnePerCh; - uint16_t dirIndex; + int16_t dirIndex; /* When BINAURAL_ROOM is not indicated, hBinaural->earlyPartEneCorrection[bin] values are all 1.0f. * When BINAURAL_ROOM is indicated, the binaural audio output is based on combined use of the @@ -1556,17 +927,17 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ { - aziDeg = azimuth[bin]; - eleDeg = elevation[bin]; - ratio = energy_ratio1[bin]; - spreadCoh = spreadCoherence[bin]; + aziDeg = hDirAC->azimuth[dirac_read_idx][bin]; + eleDeg = hDirAC->elevation[dirac_read_idx][bin]; + ratio = hDirAC->energy_ratio1[dirac_read_idx][bin]; + spreadCoh = hDirAC->spreadCoherence[dirac_read_idx][bin]; } else /* For second of the two simultaneous directions */ { - aziDeg = hDirAC->azimuth2[md_idx][bin]; - eleDeg = hDirAC->elevation2[md_idx][bin]; - ratio = hDirAC->energy_ratio2[md_idx][bin]; - spreadCoh = hDirAC->spreadCoherence2[md_idx][bin]; + aziDeg = hDirAC->azimuth2[dirac_read_idx][bin]; + eleDeg = hDirAC->elevation2[dirac_read_idx][bin]; + ratio = hDirAC->energy_ratio2[dirac_read_idx][bin]; + spreadCoh = hDirAC->spreadCoherence2[dirac_read_idx][bin]; } diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ @@ -1704,7 +1075,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Add diffuse / ambient part covariance matrix */ diffuseness = max( 0.0f, diffuseness ); diffEne = diffuseness * meanEnePerCh; - surCoh = surroundingCoherence[bin]; + surCoh = hDirAC->surroundingCoherence[dirac_read_idx][bin]; if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { if ( !h->renderStereoOutputInsteadOfBinaural ) @@ -1727,7 +1098,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) { float diffuseFieldCoherence; +#ifdef JBM_TSM_ON_TCS diffuseFieldCoherence = hDirAC->hDiffuseDist->diffuseRatioX[bin] * h->diffuseFieldCoherenceX[bin] + hDirAC->hDiffuseDist->diffuseRatioY[bin] * h->diffuseFieldCoherenceY[bin] + hDirAC->hDiffuseDist->diffuseRatioZ[bin] * h->diffuseFieldCoherenceZ[bin]; +#else + diffuseFieldCoherence = hDirAC->hDiffuseDist->diffuseRatioX[subframe][bin] * h->diffuseFieldCoherenceX[bin] + hDirAC->hDiffuseDist->diffuseRatioY[subframe][bin] * h->diffuseFieldCoherenceY[bin] + hDirAC->hDiffuseDist->diffuseRatioZ[subframe][bin] * h->diffuseFieldCoherenceZ[bin]; +#endif h->ChCrossReOut[bin] += ( ( 1.0f - surCoh ) * diffuseFieldCoherence + surCoh ) * diffEne; } else @@ -1741,7 +1116,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } - /* Formulate average diffuseness over frame */ for ( bin = 0; bin < nBins; bin++ ) { @@ -1812,858 +1186,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric return; } -#endif -#endif - - -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( - Decoder_Struct *st_ivas, - 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 ) -{ - int16_t ch, slot, bin; - uint8_t separateCenterChannelRendering; - int16_t nBins, idx; - float frameMeanDiffusenessEneWeight[CLDFB_NO_CHANNELS_MAX]; - DIRAC_DEC_HANDLE hDirAC; - DIRAC_DEC_BIN_HANDLE h; - float IIReneLimiterFactor; - float qualityBasedSmFactor; - float lowBitRateEQ[CLDFB_NO_CHANNELS_MAX]; - uint8_t applyLowBitRateEQ; - int16_t dirac_read_idx; - float subFrameTotalEne[CLDFB_NO_CHANNELS_MAX]; - - hDirAC = st_ivas->hDirAC; - h = st_ivas->hDiracDecBin; - separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; - nBins = hDirAC->num_freq_bands; /* Actually bins */ - - set_zero( h->ChCrossRe, nBins ); - set_zero( h->ChCrossIm, nBins ); - set_zero( h->ChCrossReOut, nBins ); - set_zero( h->ChCrossImOut, nBins ); - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - set_zero( h->ChEne[ch], nBins ); - set_zero( h->ChEneOut[ch], nBins ); - } - set_zero( h->frameMeanDiffuseness, nBins ); - - set_zero( frameMeanDiffusenessEneWeight, CLDFB_NO_CHANNELS_MAX ); - - /* Determine EQ for low bit rates (13.2 and 16.4 kbps) */ - applyLowBitRateEQ = 0; - if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MC_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - applyLowBitRateEQ = 1; - if ( st_ivas->hDecoderConfig->ivas_total_brate == IVAS_16k4 ) - { - for ( bin = 0; bin < LOW_BIT_RATE_BINAURAL_EQ_BINS; bin++ ) - { - lowBitRateEQ[bin + LOW_BIT_RATE_BINAURAL_EQ_OFFSET] = lowBitRateBinauralEQ[bin] * 0.5f + 0.5f; - } - } - else - { - for ( bin = 0; bin < LOW_BIT_RATE_BINAURAL_EQ_BINS; bin++ ) - { - lowBitRateEQ[bin + LOW_BIT_RATE_BINAURAL_EQ_OFFSET] = lowBitRateBinauralEQ[bin]; - } - } - } - - /* Formulate input and target covariance matrices for this subframe */ - set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); -#ifdef JBM_TSM_ON_TCS - dirac_read_idx = hDirAC->render_to_md_map[subframe]; -#else - dirac_read_idx = hDirAC->dirac_read_idx; -#endif - - /* Calculate input covariance matrix */ -#ifdef JBM_TSM_ON_TCS - for ( slot = 0; slot < hDirAC->subframe_nbslots[subframe]; slot++ ) -#else - for ( slot = 0; slot < hDirAC->subframe_nbslots; slot++ ) -#endif - { - for ( bin = 0; bin < nBins; bin++ ) - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - float instEne; - - instEne = ( inRe[ch][slot][bin] * inRe[ch][slot][bin] ); - instEne += ( inIm[ch][slot][bin] * inIm[ch][slot][bin] ); - h->ChEne[ch][bin] += instEne; - subFrameTotalEne[bin] += instEne; - } - h->ChCrossRe[bin] += inRe[0][slot][bin] * inRe[1][slot][bin]; - h->ChCrossRe[bin] += inIm[0][slot][bin] * inIm[1][slot][bin]; - h->ChCrossIm[bin] += inRe[0][slot][bin] * inIm[1][slot][bin]; - h->ChCrossIm[bin] -= inIm[0][slot][bin] * inRe[1][slot][bin]; - } - } - - /* Apply EQ at low bit rates */ - if ( applyLowBitRateEQ ) - { - int16_t lastEqBin = LOW_BIT_RATE_BINAURAL_EQ_OFFSET + LOW_BIT_RATE_BINAURAL_EQ_BINS - 1; - - for ( bin = LOW_BIT_RATE_BINAURAL_EQ_OFFSET; bin < lastEqBin; bin++ ) - { - subFrameTotalEne[bin] *= lowBitRateEQ[bin]; - } - for ( ; bin < nBins; bin++ ) - { - subFrameTotalEne[bin] *= lowBitRateEQ[lastEqBin]; - } - } - - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport == 2 ) - { - float tempRe, tempIm; - - set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); - -#ifdef JBM_TSM_ON_TCS - for ( slot = 0; slot < hDirAC->subframe_nbslots[subframe]; slot++ ) -#else - for ( slot = 0; slot < hDirAC->subframe_nbslots; slot++ ) -#endif - { - for ( bin = 0; bin < nBins; bin++ ) - { - tempRe = inRe[0][slot][bin] + inRe[1][slot][bin]; - tempIm = inIm[0][slot][bin] + inIm[1][slot][bin]; - subFrameTotalEne[bin] += tempRe * tempRe + tempIm * tempIm; - } - } - } - - /* Determine target covariance matrix containing target binaural properties */ - for ( bin = 0; bin < nBins; bin++ ) - { - float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ - float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ - float diffEne, dirEne, meanEnePerCh; - int16_t dirIndex; - - /* When BINAURAL_ROOM is not indicated, hBinaural->earlyPartEneCorrection[bin] values are all 1.0f. - * When BINAURAL_ROOM is indicated, the binaural audio output is based on combined use of the - * HRTF data set and a BRIR-based data set. The HRTF data set is spectrally corrected to match - * the early spectrum of the BRIR data, using the spectral correction data in - * hBinaural->earlyPartEneCorrection[bin], based on the BRIR set. */ - meanEnePerCh = h->earlyPartEneCorrection[bin] * subFrameTotalEne[bin] / 2.0f; - - /* Determine direct part target covariance matrix (for 1 or 2 directions) */ - for ( dirIndex = 0; dirIndex < hDirAC->numSimultaneousDirections; dirIndex++ ) - { - int16_t aziDeg, eleDeg; - float lRealp, lImagp, rRealp, rImagp; - float lRealpTmp, lImagpTmp, rRealpTmp, rImagpTmp; - float hrtfEne[BINAURAL_CHANNELS], hrtfCrossRe, hrtfCrossIm, ratio; - - if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ - { - aziDeg = hDirAC->azimuth[dirac_read_idx][bin]; - eleDeg = hDirAC->elevation[dirac_read_idx][bin]; - ratio = hDirAC->energy_ratio1[dirac_read_idx][bin]; - spreadCoh = hDirAC->spreadCoherence[dirac_read_idx][bin]; - } - else /* For second of the two simultaneous directions */ - { - aziDeg = hDirAC->azimuth2[dirac_read_idx][bin]; - eleDeg = hDirAC->elevation2[dirac_read_idx][bin]; - ratio = hDirAC->energy_ratio2[dirac_read_idx][bin]; - spreadCoh = hDirAC->spreadCoherence2[dirac_read_idx][bin]; - } - diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ - - if ( separateCenterChannelRendering ) - { - /* In masa + mono rendering mode, the center directions originate from phantom sources, so the - * spread coherence is increased */ - float aziRad, eleRad, doaVectorX, spatialAngleDeg, altSpreadCoh; - - aziRad = (float) aziDeg * PI_OVER_180; - eleRad = (float) eleDeg * PI_OVER_180; - doaVectorX = cosf( aziRad ) * cosf( eleRad ); - spatialAngleDeg = acosf( doaVectorX ) * _180_OVER_PI; - altSpreadCoh = 1.0f - ( spatialAngleDeg / 30.0f ); - spreadCoh = max( spreadCoh, altSpreadCoh ); - } - - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - if ( h->renderStereoOutputInsteadOfBinaural ) - { - /* Synthesizing spread coherence is not needed for stereo loudspeaker output, - * as directional sound is reproduced with two loudspeakers in any case */ - spreadCoh = 0.0f; - } - - if ( spreadCoh > 0.0f ) - { - float centerMul, sidesMul; - float hrtfEneCenter, hrtfEneSides, hrtfEneRealized, eneCorrectionFactor; - float w1, w2, w3, eq; - - hrtfEneCenter = ( lRealp * lRealp ) + ( lImagp * lImagp ) + ( rRealp * rRealp ) + ( rImagp * rImagp ); - - /* Spread coherence is synthesized as coherent sources at 30 degree horizontal spacing. - * The following formulas determine the gains for these sources. - * spreadCoh = 0: Only panning - * spreadCoh = 0.5: Three sources coherent panning (e.g. 30 0 -30 deg azi) - * spreadCoh = 1.0: Two sources coherent panning with gap (as above, but center is silent) */ - if ( spreadCoh < 0.5f ) - { - /* 0.0f < spreadCoh < 0.5f */ - sidesMul = 0.5774f * spreadCoh * 2.0f; /* sqrt(1/3) = 0.5774f */ - centerMul = 1.0f - ( spreadCoh * 2.0f ) + sidesMul; - } - else - { - /* 0.5f <= spreadCoh < 1.0f */ - centerMul = 2.0f - ( 2.0f * spreadCoh ); - sidesMul = inv_sqrt( centerMul + 2.0f ); - centerMul *= sidesMul; - } - - /* Apply the gain for the center source of the three coherent sources */ - lRealp *= centerMul; - lImagp *= centerMul; - rRealp *= centerMul; - rImagp *= centerMul; - - /* Apply the gain for the left source of the three coherent sources */ - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); - lRealp += sidesMul * lRealpTmp; - lImagp += sidesMul * lImagpTmp; - rRealp += sidesMul * rRealpTmp; - rImagp += sidesMul * rImagpTmp; - - /* Apply the gain for the right source of the three coherent sources. - * -30 degrees to 330 wrapping due to internal functions. */ - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); - lRealp += sidesMul * lRealpTmp; - lImagp += sidesMul * lImagpTmp; - rRealp += sidesMul * rRealpTmp; - rImagp += sidesMul * rImagpTmp; - - /* Formulate an eneCorrectionFactor that compensates for the coherent summation of the HRTFs */ - hrtfEneRealized = ( lRealp * lRealp ) + ( lImagp * lImagp ) + ( rRealp * rRealp ) + ( rImagp * rImagp ); - eneCorrectionFactor = ( ( hrtfEneSides * sidesMul * sidesMul ) + - ( hrtfEneCenter * centerMul * centerMul ) ) / - max( 1e-12f, hrtfEneRealized ); - - /* Weighting factors to determine appropriate target spectrum for spread coherent sound */ - if ( spreadCoh < 0.5 ) - { - w1 = 1.0f - 2.0f * spreadCoh; - w2 = 2.0f * spreadCoh; - w3 = 0.0f; - } - else - { - w1 = 0.0f; - w2 = 2.0f - 2.0f * spreadCoh; - w3 = 2.0f * spreadCoh - 1.0f; - } - - if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) - { - idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); - - /* Apply the target spectrum to the eneCorrectionFactor */ - if ( separateCenterChannelRendering ) /* spreadCoh mostly originates from phantom sources in separate channel rendering mode */ - { - eneCorrectionFactor *= w1 * 1.0f + ( w2 + w3 ) * spreadCohEne1[idx]; - } - else - { - eneCorrectionFactor *= w1 * 1.0f + w2 * spreadCohEne05[idx] + w3 * spreadCohEne1[idx]; - } - } - - /* Equalize the spread coherent combined HRTFs */ - eq = min( 4.0f, sqrtf( eneCorrectionFactor ) ); - lRealp *= eq; - lImagp *= eq; - rRealp *= eq; - rImagp *= eq; - } - - hrtfEne[0] = ( lRealp * lRealp ) + ( lImagp * lImagp ); - hrtfEne[1] = ( rRealp * rRealp ) + ( rImagp * rImagp ); - hrtfCrossRe = ( lRealp * rRealp ) + ( lImagp * rImagp ); - hrtfCrossIm = ( -lImagp * rRealp ) + ( lRealp * rImagp ); - - /* Add direct part (1 or 2) covariance matrix */ - dirEne = ratio * meanEnePerCh; - h->ChEneOut[0][bin] += dirEne * hrtfEne[0]; /* Dir ene part*/ - h->ChEneOut[1][bin] += dirEne * hrtfEne[1]; - h->ChCrossReOut[bin] += dirEne * hrtfCrossRe; /* Dir cross re */ - h->ChCrossImOut[bin] += dirEne * hrtfCrossIm; /* Dir cross im */ - } - - /* Add diffuse / ambient part covariance matrix */ - diffuseness = max( 0.0f, diffuseness ); - diffEne = diffuseness * meanEnePerCh; - surCoh = hDirAC->surroundingCoherence[dirac_read_idx][bin]; - if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) - { - if ( !h->renderStereoOutputInsteadOfBinaural ) - { - 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]; - } - } - h->ChEneOut[0][bin] += diffEne; /* Diff ene part*/ - h->ChEneOut[1][bin] += diffEne; - - if ( h->renderStereoOutputInsteadOfBinaural ) - { - /* When rendering stereo, ambience (except for surround coherent sound) has zero ICC. */ - h->ChCrossReOut[bin] += surCoh * diffEne; - } - else /* When rendering binaural, ambience has frequency dependent ICC. */ - { - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) - { - float diffuseFieldCoherence; -#ifdef JBM_TSM_ON_TCS - diffuseFieldCoherence = hDirAC->hDiffuseDist->diffuseRatioX[bin] * h->diffuseFieldCoherenceX[bin] + hDirAC->hDiffuseDist->diffuseRatioY[bin] * h->diffuseFieldCoherenceY[bin] + hDirAC->hDiffuseDist->diffuseRatioZ[bin] * h->diffuseFieldCoherenceZ[bin]; -#else - diffuseFieldCoherence = hDirAC->hDiffuseDist->diffuseRatioX[subframe][bin] * h->diffuseFieldCoherenceX[bin] + hDirAC->hDiffuseDist->diffuseRatioY[subframe][bin] * h->diffuseFieldCoherenceY[bin] + hDirAC->hDiffuseDist->diffuseRatioZ[subframe][bin] * h->diffuseFieldCoherenceZ[bin]; -#endif - h->ChCrossReOut[bin] += ( ( 1.0f - surCoh ) * diffuseFieldCoherence + surCoh ) * diffEne; - } - else - { - h->ChCrossReOut[bin] += ( ( 1.0f - surCoh ) * h->diffuseFieldCoherence[bin] + surCoh ) * diffEne; - } - } - - /* Store parameters for formulating average diffuseness over frame */ - h->frameMeanDiffuseness[bin] += diffEne; - frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; - } - - /* Formulate average diffuseness over frame */ - for ( bin = 0; bin < nBins; bin++ ) - { - h->frameMeanDiffuseness[bin] /= fmaxf( 1e-12f, frameMeanDiffusenessEneWeight[bin] ); - } - - /* Determine encoding quality based additional smoothing factor */ - qualityBasedSmFactor = 1.0f; - if ( st_ivas->hMasa != NULL ) - { - qualityBasedSmFactor = st_ivas->hMasa->data.dir_decode_quality; - qualityBasedSmFactor *= qualityBasedSmFactor; - } - - /* Temporal IIR-type smoothing of covariance matrices */ - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - IIReneLimiterFactor = 16.0f + ( 1.0f - qualityBasedSmFactor ); - } - else - { - IIReneLimiterFactor = 8.0f + ( 1.0f - qualityBasedSmFactor ); - } - for ( bin = 0; bin < nBins; bin++ ) - { - float eneRatio, IIReneLimiter; - - /* Temporally smooth cov mtx estimates for resulting mixing matrix stability. The design principle is that - * the energy history (IIR) must not be more than double of the current frame energy. This provides more - * robust performance at energy offsets when compared to typical IIR averaging. */ - eneRatio = ( h->ChEne[0][bin] + h->ChEne[1][bin] ) / fmaxf( 1e-12f, ( h->ChEnePrev[0][bin] + h->ChEnePrev[1][bin] ) ); - IIReneLimiter = fminf( 1.0f, eneRatio * IIReneLimiterFactor ); - - h->ChCrossRe[bin] *= qualityBasedSmFactor; - h->ChCrossIm[bin] *= qualityBasedSmFactor; - h->ChCrossReOut[bin] *= qualityBasedSmFactor; - h->ChCrossImOut[bin] *= qualityBasedSmFactor; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - h->ChEne[ch][bin] *= qualityBasedSmFactor; - h->ChEneOut[ch][bin] *= qualityBasedSmFactor; - } - - h->ChCrossRe[bin] += IIReneLimiter * h->ChCrossRePrev[bin]; - h->ChCrossIm[bin] += IIReneLimiter * h->ChCrossImPrev[bin]; - h->ChCrossReOut[bin] += IIReneLimiter * h->ChCrossReOutPrev[bin]; - h->ChCrossImOut[bin] += IIReneLimiter * h->ChCrossImOutPrev[bin]; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - h->ChEne[ch][bin] += IIReneLimiter * h->ChEnePrev[ch][bin]; - h->ChEneOut[ch][bin] += IIReneLimiter * h->ChEneOutPrev[ch][bin]; - } - - /* Store energy values and coefficients for next round */ - h->ChCrossRePrev[bin] = h->ChCrossRe[bin]; - h->ChCrossImPrev[bin] = h->ChCrossIm[bin]; - h->ChCrossReOutPrev[bin] = h->ChCrossReOut[bin]; - h->ChCrossImOutPrev[bin] = h->ChCrossImOut[bin]; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - h->ChEnePrev[ch][bin] = h->ChEne[ch][bin]; - h->ChEneOutPrev[ch][bin] = h->ChEneOut[ch][bin]; - } - } - - return; -} -#else -static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( - Decoder_Struct *st_ivas, - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Rmat[3][3], - const uint8_t firstSubframe, - const uint8_t nSubframes ) -{ - uint8_t ch, slot, bin, subframe; - uint8_t separateCenterChannelRendering; - int16_t nBins, idx; - float frameMeanDiffusenessEneWeight[CLDFB_NO_CHANNELS_MAX]; - DIRAC_DEC_HANDLE hDirAC; - DIRAC_DEC_BIN_HANDLE h; - float IIReneLimiterFactor; - float qualityBasedSmFactor; - float lowBitRateEQ[CLDFB_NO_CHANNELS_MAX]; - uint8_t applyLowBitRateEQ; - int16_t dirac_read_idx; -#ifdef JBM_TSM_ON_TCS - int16_t slot_idx_start; -#endif - - hDirAC = st_ivas->hDirAC; - h = st_ivas->hDiracDecBin; - separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; - nBins = hDirAC->num_freq_bands; /* Actually bins */ - - set_zero( h->ChCrossRe, nBins ); - set_zero( h->ChCrossIm, nBins ); - set_zero( h->ChCrossReOut, nBins ); - set_zero( h->ChCrossImOut, nBins ); - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - set_zero( h->ChEne[ch], nBins ); - set_zero( h->ChEneOut[ch], nBins ); - } - set_zero( h->frameMeanDiffuseness, nBins ); - - set_zero( frameMeanDiffusenessEneWeight, CLDFB_NO_CHANNELS_MAX ); - - /* Determine EQ for low bit rates (13.2 and 16.4 kbps) */ - applyLowBitRateEQ = 0; - if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MC_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - applyLowBitRateEQ = 1; - if ( st_ivas->hDecoderConfig->ivas_total_brate == IVAS_16k4 ) - { - for ( bin = 0; bin < LOW_BIT_RATE_BINAURAL_EQ_BINS; bin++ ) - { - lowBitRateEQ[bin + LOW_BIT_RATE_BINAURAL_EQ_OFFSET] = lowBitRateBinauralEQ[bin] * 0.5f + 0.5f; - } - } - else - { - for ( bin = 0; bin < LOW_BIT_RATE_BINAURAL_EQ_BINS; bin++ ) - { - lowBitRateEQ[bin + LOW_BIT_RATE_BINAURAL_EQ_OFFSET] = lowBitRateBinauralEQ[bin]; - } - } - } - -#ifdef JBM_TSM_ON_TCS - slot_idx_start = hDirAC->slots_rendered; -#endif - - /* Formulate input and target covariance matrices combining all subframes */ - for ( subframe = firstSubframe; subframe < ( firstSubframe + nSubframes ); subframe++ ) - { - float subFrameTotalEne[CLDFB_NO_CHANNELS_MAX]; - - set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); - - dirac_read_idx = hDirAC->dirac_read_idx; - - /* Calculate input covariance matrix */ -#ifdef JBM_TSM_ON_TCS - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots[subframe]; slot++ ) -#else - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots; slot++ ) -#endif - { -#ifdef JBM_TSM_ON_TCS - int16_t slotThis = slot + slot_idx_start; -#else - int16_t slotThis = slot + ( hDirAC->subframe_nbslots * subframe ); -#endif - - for ( bin = 0; bin < nBins; bin++ ) - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - float instEne; - - instEne = ( inRe[ch][slotThis][bin] * inRe[ch][slotThis][bin] ); - instEne += ( inIm[ch][slotThis][bin] * inIm[ch][slotThis][bin] ); - h->ChEne[ch][bin] += instEne; - subFrameTotalEne[bin] += instEne; - } - h->ChCrossRe[bin] += inRe[0][slotThis][bin] * inRe[1][slotThis][bin]; - h->ChCrossRe[bin] += inIm[0][slotThis][bin] * inIm[1][slotThis][bin]; - h->ChCrossIm[bin] += inRe[0][slotThis][bin] * inIm[1][slotThis][bin]; - h->ChCrossIm[bin] -= inIm[0][slotThis][bin] * inRe[1][slotThis][bin]; - } - } - - /* Apply EQ at low bit rates */ - if ( applyLowBitRateEQ ) - { - int16_t lastEqBin = LOW_BIT_RATE_BINAURAL_EQ_OFFSET + LOW_BIT_RATE_BINAURAL_EQ_BINS - 1; - - for ( bin = LOW_BIT_RATE_BINAURAL_EQ_OFFSET; bin < lastEqBin; bin++ ) - { - subFrameTotalEne[bin] *= lowBitRateEQ[bin]; - } - for ( ; bin < nBins; bin++ ) - { - subFrameTotalEne[bin] *= lowBitRateEQ[lastEqBin]; - } - } - - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport == 2 ) - { - float tempRe, tempIm; - - set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX ); - -#ifdef JBM_TSM_ON_TCS - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots[subframe]; slot++ ) -#else - for ( slot = 0; slot < (uint8_t) hDirAC->subframe_nbslots; slot++ ) -#endif - { -#ifdef JBM_TSM_ON_TCS - int16_t slotThis = slot + slot_idx_start; -#else - int16_t slotThis = slot + ( hDirAC->subframe_nbslots * subframe ); -#endif - - for ( bin = 0; bin < nBins; bin++ ) - { - tempRe = inRe[0][slotThis][bin] + inRe[1][slotThis][bin]; - tempIm = inIm[0][slotThis][bin] + inIm[1][slotThis][bin]; - subFrameTotalEne[bin] += tempRe * tempRe + tempIm * tempIm; - } - } - } - - /* Determine target covariance matrix containing target binaural properties */ - for ( bin = 0; bin < nBins; bin++ ) - { - float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ - float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ - float diffEne, dirEne, meanEnePerCh; - uint16_t dirIndex; - - /* When BINAURAL_ROOM is not indicated, hBinaural->earlyPartEneCorrection[bin] values are all 1.0f. - * When BINAURAL_ROOM is indicated, the binaural audio output is based on combined use of the - * HRTF data set and a BRIR-based data set. The HRTF data set is spectrally corrected to match - * the early spectrum of the BRIR data, using the spectral correction data in - * hBinaural->earlyPartEneCorrection[bin], based on the BRIR set. */ - meanEnePerCh = h->earlyPartEneCorrection[bin] * subFrameTotalEne[bin] / 2.0f; - - /* Determine direct part target covariance matrix (for 1 or 2 directions) */ - for ( dirIndex = 0; dirIndex < hDirAC->numSimultaneousDirections; dirIndex++ ) - { - int16_t aziDeg, eleDeg; - float lRealp, lImagp, rRealp, rImagp; - float lRealpTmp, lImagpTmp, rRealpTmp, rImagpTmp; - float hrtfEne[BINAURAL_CHANNELS], hrtfCrossRe, hrtfCrossIm, ratio; - - if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ - { - aziDeg = hDirAC->azimuth[dirac_read_idx][bin]; - eleDeg = hDirAC->elevation[dirac_read_idx][bin]; - ratio = hDirAC->energy_ratio1[dirac_read_idx][bin]; - spreadCoh = hDirAC->spreadCoherence[dirac_read_idx][bin]; - } - else /* For second of the two simultaneous directions */ - { - aziDeg = hDirAC->azimuth2[dirac_read_idx][bin]; - eleDeg = hDirAC->elevation2[dirac_read_idx][bin]; - ratio = hDirAC->energy_ratio2[dirac_read_idx][bin]; - spreadCoh = hDirAC->spreadCoherence2[dirac_read_idx][bin]; - } - diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ - - if ( separateCenterChannelRendering ) - { - /* In masa + mono rendering mode, the center directions originate from phantom sources, so the - * spread coherence is increased */ - float aziRad, eleRad, doaVectorX, spatialAngleDeg, altSpreadCoh; - - aziRad = (float) aziDeg * PI_OVER_180; - eleRad = (float) eleDeg * PI_OVER_180; - doaVectorX = cosf( aziRad ) * cosf( eleRad ); - spatialAngleDeg = acosf( doaVectorX ) * _180_OVER_PI; - altSpreadCoh = 1.0f - ( spatialAngleDeg / 30.0f ); - spreadCoh = max( spreadCoh, altSpreadCoh ); - } - - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - if ( h->renderStereoOutputInsteadOfBinaural ) - { - /* Synthesizing spread coherence is not needed for stereo loudspeaker output, - * as directional sound is reproduced with two loudspeakers in any case */ - spreadCoh = 0.0f; - } - - if ( spreadCoh > 0.0f ) - { - float centerMul, sidesMul; - float hrtfEneCenter, hrtfEneSides, hrtfEneRealized, eneCorrectionFactor; - float w1, w2, w3, eq; - - hrtfEneCenter = ( lRealp * lRealp ) + ( lImagp * lImagp ) + ( rRealp * rRealp ) + ( rImagp * rImagp ); - - /* Spread coherence is synthesized as coherent sources at 30 degree horizontal spacing. - * The following formulas determine the gains for these sources. - * spreadCoh = 0: Only panning - * spreadCoh = 0.5: Three sources coherent panning (e.g. 30 0 -30 deg azi) - * spreadCoh = 1.0: Two sources coherent panning with gap (as above, but center is silent) */ - if ( spreadCoh < 0.5f ) - { - /* 0.0f < spreadCoh < 0.5f */ - sidesMul = 0.5774f * spreadCoh * 2.0f; /* sqrt(1/3) = 0.5774f */ - centerMul = 1.0f - ( spreadCoh * 2.0f ) + sidesMul; - } - else - { - /* 0.5f <= spreadCoh < 1.0f */ - centerMul = 2.0f - ( 2.0f * spreadCoh ); - sidesMul = inv_sqrt( centerMul + 2.0f ); - centerMul *= sidesMul; - } - - /* Apply the gain for the center source of the three coherent sources */ - lRealp *= centerMul; - lImagp *= centerMul; - rRealp *= centerMul; - rImagp *= centerMul; - - /* Apply the gain for the left source of the three coherent sources */ - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); - lRealp += sidesMul * lRealpTmp; - lImagp += sidesMul * lImagpTmp; - rRealp += sidesMul * rRealpTmp; - rImagp += sidesMul * rImagpTmp; - - /* Apply the gain for the right source of the three coherent sources. - * -30 degrees to 330 wrapping due to internal functions. */ - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); - lRealp += sidesMul * lRealpTmp; - lImagp += sidesMul * lImagpTmp; - rRealp += sidesMul * rRealpTmp; - rImagp += sidesMul * rImagpTmp; - - /* Formulate an eneCorrectionFactor that compensates for the coherent summation of the HRTFs */ - hrtfEneRealized = ( lRealp * lRealp ) + ( lImagp * lImagp ) + ( rRealp * rRealp ) + ( rImagp * rImagp ); - eneCorrectionFactor = ( ( hrtfEneSides * sidesMul * sidesMul ) + - ( hrtfEneCenter * centerMul * centerMul ) ) / - max( 1e-12f, hrtfEneRealized ); - - /* Weighting factors to determine appropriate target spectrum for spread coherent sound */ - if ( spreadCoh < 0.5 ) - { - w1 = 1.0f - 2.0f * spreadCoh; - w2 = 2.0f * spreadCoh; - w3 = 0.0f; - } - else - { - w1 = 0.0f; - w2 = 2.0f - 2.0f * spreadCoh; - w3 = 2.0f * spreadCoh - 1.0f; - } - - if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) - { - idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); - - /* Apply the target spectrum to the eneCorrectionFactor */ - if ( separateCenterChannelRendering ) /* spreadCoh mostly originates from phantom sources in separate channel rendering mode */ - { - eneCorrectionFactor *= w1 * 1.0f + ( w2 + w3 ) * spreadCohEne1[idx]; - } - else - { - eneCorrectionFactor *= w1 * 1.0f + w2 * spreadCohEne05[idx] + w3 * spreadCohEne1[idx]; - } - } - - /* Equalize the spread coherent combined HRTFs */ - eq = min( 4.0f, sqrtf( eneCorrectionFactor ) ); - lRealp *= eq; - lImagp *= eq; - rRealp *= eq; - rImagp *= eq; - } - - hrtfEne[0] = ( lRealp * lRealp ) + ( lImagp * lImagp ); - hrtfEne[1] = ( rRealp * rRealp ) + ( rImagp * rImagp ); - hrtfCrossRe = ( lRealp * rRealp ) + ( lImagp * rImagp ); - hrtfCrossIm = ( -lImagp * rRealp ) + ( lRealp * rImagp ); - - /* Add direct part (1 or 2) covariance matrix */ - dirEne = ratio * meanEnePerCh; - h->ChEneOut[0][bin] += dirEne * hrtfEne[0]; /* Dir ene part*/ - h->ChEneOut[1][bin] += dirEne * hrtfEne[1]; - h->ChCrossReOut[bin] += dirEne * hrtfCrossRe; /* Dir cross re */ - h->ChCrossImOut[bin] += dirEne * hrtfCrossIm; /* Dir cross im */ - } - - /* Add diffuse / ambient part covariance matrix */ - diffuseness = max( 0.0f, diffuseness ); - diffEne = diffuseness * meanEnePerCh; - surCoh = hDirAC->surroundingCoherence[dirac_read_idx][bin]; - if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) - { - if ( !h->renderStereoOutputInsteadOfBinaural ) - { - 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]; - } - } - h->ChEneOut[0][bin] += diffEne; /* Diff ene part*/ - h->ChEneOut[1][bin] += diffEne; - - if ( h->renderStereoOutputInsteadOfBinaural ) - { - /* When rendering stereo, ambience (except for surround coherent sound) has zero ICC. */ - h->ChCrossReOut[bin] += surCoh * diffEne; - } - else /* When rendering binaural, ambience has frequency dependent ICC. */ - { - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->sba_mode == SBA_MODE_SPAR && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS ) - { - float diffuseFieldCoherence; - diffuseFieldCoherence = hDirAC->hDiffuseDist->diffuseRatioX[subframe][bin] * h->diffuseFieldCoherenceX[bin] + hDirAC->hDiffuseDist->diffuseRatioY[subframe][bin] * h->diffuseFieldCoherenceY[bin] + hDirAC->hDiffuseDist->diffuseRatioZ[subframe][bin] * h->diffuseFieldCoherenceZ[bin]; - h->ChCrossReOut[bin] += ( ( 1.0f - surCoh ) * diffuseFieldCoherence + surCoh ) * diffEne; - } - else - { - h->ChCrossReOut[bin] += ( ( 1.0f - surCoh ) * h->diffuseFieldCoherence[bin] + surCoh ) * diffEne; - } - } - - /* Store parameters for formulating average diffuseness over frame */ - h->frameMeanDiffuseness[bin] += diffEne; - frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; - } - hDirAC->dirac_read_idx = ( hDirAC->dirac_read_idx + 1 ) % hDirAC->dirac_md_buffer_length; -#ifdef JBM_TSM_ON_TCS - slot_idx_start += hDirAC->subframe_nbslots[subframe]; -#endif - } - - /* Formulate average diffuseness over frame */ - for ( bin = 0; bin < nBins; bin++ ) - { - h->frameMeanDiffuseness[bin] /= fmaxf( 1e-12f, frameMeanDiffusenessEneWeight[bin] ); - } - - /* Determine encoding quality based additional smoothing factor */ - qualityBasedSmFactor = 1.0f; - if ( st_ivas->hMasa != NULL ) - { - qualityBasedSmFactor = st_ivas->hMasa->data.dir_decode_quality; - qualityBasedSmFactor *= qualityBasedSmFactor; - } - - /* Temporal IIR-type smoothing of covariance matrices */ - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) - { - IIReneLimiterFactor = 16.0f / (float) nSubframes + ( 1.0f - qualityBasedSmFactor ); - } - else - { - IIReneLimiterFactor = 8.0f / (float) nSubframes + ( 1.0f - qualityBasedSmFactor ); - } - for ( bin = 0; bin < nBins; bin++ ) - { - float eneRatio, IIReneLimiter; - - /* Temporally smooth cov mtx estimates for resulting mixing matrix stability. The design principle is that - * the energy history (IIR) must not be more than double of the current frame energy. This provides more - * robust performance at energy offsets when compared to typical IIR averaging. */ - eneRatio = ( h->ChEne[0][bin] + h->ChEne[1][bin] ) / fmaxf( 1e-12f, ( h->ChEnePrev[0][bin] + h->ChEnePrev[1][bin] ) ); - IIReneLimiter = fminf( 1.0f, eneRatio * IIReneLimiterFactor ); - - h->ChCrossRe[bin] *= qualityBasedSmFactor; - h->ChCrossIm[bin] *= qualityBasedSmFactor; - h->ChCrossReOut[bin] *= qualityBasedSmFactor; - h->ChCrossImOut[bin] *= qualityBasedSmFactor; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - h->ChEne[ch][bin] *= qualityBasedSmFactor; - h->ChEneOut[ch][bin] *= qualityBasedSmFactor; - } - - h->ChCrossRe[bin] += IIReneLimiter * h->ChCrossRePrev[bin]; - h->ChCrossIm[bin] += IIReneLimiter * h->ChCrossImPrev[bin]; - h->ChCrossReOut[bin] += IIReneLimiter * h->ChCrossReOutPrev[bin]; - h->ChCrossImOut[bin] += IIReneLimiter * h->ChCrossImOutPrev[bin]; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - h->ChEne[ch][bin] += IIReneLimiter * h->ChEnePrev[ch][bin]; - h->ChEneOut[ch][bin] += IIReneLimiter * h->ChEneOutPrev[ch][bin]; - } - - /* Store energy values and coefficients for next round */ - h->ChCrossRePrev[bin] = h->ChCrossRe[bin]; - h->ChCrossImPrev[bin] = h->ChCrossIm[bin]; - h->ChCrossReOutPrev[bin] = h->ChCrossReOut[bin]; - h->ChCrossImOutPrev[bin] = h->ChCrossImOut[bin]; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - h->ChEnePrev[ch][bin] = h->ChEne[ch][bin]; - h->ChEneOutPrev[ch][bin] = h->ChEneOut[ch][bin]; - } - } - - return; -} -#endif static void ivas_dirac_dec_binaural_determine_processing_matrices( @@ -2671,11 +1193,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( const int16_t max_band_decorr, float Rmat[3][3] ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS int16_t chA, chB, bin; -#else - uint8_t chA, chB, bin; -#endif uint8_t separateCenterChannelRendering; int16_t nBins; DIRAC_DEC_BIN_HANDLE h; @@ -2807,325 +1325,98 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( h->processMtxDecRe[chA][chB][bin] = MdecRe[chA][chB]; h->processMtxDecIm[chA][chB][bin] = MdecIm[chA][chB]; } - } - - if ( separateCenterChannelRendering ) - { - /* The rendering of the separate center channel in masa + mono mode. - * The center channel is processed with a gain factor 0.8414f to match the loudness of different processing paths */ - float lRealp, lImagp, rRealp, rImagp; - float gainFactor; - int16_t aziDeg = 0; - int16_t eleDeg = 0; - - gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); - for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) - { - h->processMtxRePrev[chA][2][bin] = h->processMtxRe[chA][2][bin]; - h->processMtxImPrev[chA][2][bin] = h->processMtxIm[chA][2][bin]; - } - - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - - h->processMtxRe[0][2][bin] = lRealp * gainFactor; - h->processMtxIm[0][2][bin] = lImagp * gainFactor; - h->processMtxRe[1][2][bin] = rRealp * gainFactor; - h->processMtxIm[1][2][bin] = rImagp * gainFactor; - } - } - - return; -} - -#ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_binaural_process_output_sf( - Decoder_Struct *st_ivas, - float *output_f[], - float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - const int16_t max_band_decorr, - const uint8_t numInChannels ) -{ - uint8_t slot, bin, chA, chB; - int16_t nBins; - float outSlotRe[CLDFB_NO_CHANNELS_MAX], outSlotIm[CLDFB_NO_CHANNELS_MAX]; - float decSlotRe[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], decSlotIm[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; - float reverbRe[BINAURAL_CHANNELS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float reverbIm[BINAURAL_CHANNELS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - uint16_t numSlots; - DIRAC_DEC_BIN_HANDLE h; - float interpVal; - float *decSlotRePointer; - float *decSlotImPointer; - - numSlots = st_ivas->hDirAC->subframe_nbslots[st_ivas->hDirAC->subframes_rendered]; - h = st_ivas->hDiracDecBin; - nBins = st_ivas->hDirAC->num_freq_bands; - - - interpVal = 0.0f; - for ( slot = 0; slot < numSlots; slot++ ) - { - interpVal += 1.0f / (float) numSlots; - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - /* Process second / room effect part of binaural output when needed */ - ivas_binaural_reverb_processSlot( st_ivas->hDiracDecBin->hReverb, numInChannels, inRe, inIm, reverbRe, reverbIm, slot ); - } - if ( !st_ivas->hDiracDecBin->useTdDecorr && max_band_decorr > 0 ) - { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS - ivas_dirac_dec_decorrelate_slot( st_ivas->hDirAC, slot, inRe, inIm, decSlotRe, decSlotIm ); -#else - ivas_dirac_dec_decorrelate_slot_sf( st_ivas->hDirAC, slot, inRe, inIm, decSlotRe, decSlotIm ); -#endif - } - - for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) - { - float *outSlotRePr, *outSlotImPr; /* Pointers needed for function call compatibility */ - - set_zero( outSlotRe, CLDFB_NO_CHANNELS_MAX ); - set_zero( outSlotIm, CLDFB_NO_CHANNELS_MAX ); - - /* Processing of the first / HRTF part of the binaural output. */ - for ( chB = 0; chB < numInChannels; chB++ ) - { - if ( st_ivas->hDiracDecBin->useTdDecorr ) - { - decSlotRePointer = inRe[chB + 2][slot]; - decSlotImPointer = inIm[chB + 2][slot]; - } - else - { - decSlotRePointer = decSlotRe[chB]; - decSlotImPointer = decSlotIm[chB]; - } - - for ( bin = 0; bin < nBins; bin++ ) - { - float gain; - - /* Mixing using the formulated processing matrix M */ - gain = ( 1.0f - interpVal ) * h->processMtxRePrev[chA][chB][bin] + - interpVal * h->processMtxRe[chA][chB][bin]; - outSlotRe[bin] += gain * inRe[chB][slot][bin]; - outSlotIm[bin] += gain * inIm[chB][slot][bin]; - - gain = ( 1.0f - interpVal ) * h->processMtxImPrev[chA][chB][bin] + - interpVal * h->processMtxIm[chA][chB][bin]; - outSlotRe[bin] -= gain * inIm[chB][slot][bin]; - outSlotIm[bin] += gain * inRe[chB][slot][bin]; - - /* Mixing decorrelated signals using the formulated residual processing matrix Mdec */ - if ( bin < max_band_decorr && chB < 2 ) - { - gain = ( 1.0f - interpVal ) * h->processMtxDecRePrev[chA][chB][bin] + - interpVal * h->processMtxDecRe[chA][chB][bin]; - outSlotRe[bin] += gain * decSlotRePointer[bin]; - outSlotIm[bin] += gain * decSlotImPointer[bin]; - - gain = ( 1.0f - interpVal ) * h->processMtxDecImPrev[chA][chB][bin] + - interpVal * h->processMtxDecIm[chA][chB][bin]; - outSlotRe[bin] -= gain * decSlotImPointer[bin]; - outSlotIm[bin] += gain * decSlotRePointer[bin]; - } - } - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */ - v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX ); - v_add( outSlotIm, reverbIm[chA][slot], outSlotIm, CLDFB_NO_CHANNELS_MAX ); - } - - outSlotRePr = &( outSlotRe[0] ); - outSlotImPr = &( outSlotIm[0] ); - - /* Inverse filter bank */ - cldfbSynthesis( &outSlotRePr, &outSlotImPr, &( output_f[chA][nBins * slot] ), nBins, st_ivas->cldfbSynDec[chA] ); - } - } - - return; -} -#endif -#endif - -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_binaural_process_output( - Decoder_Struct *st_ivas, -#ifdef JBM_TSM_ON_TCS - float *output_f[], -#else - float output_f[][L_FRAME48k], -#endif - 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 subframe ) -{ - int16_t slot, bin, chA, chB; - int16_t nBins; - float outSlotRe[CLDFB_NO_CHANNELS_MAX], outSlotIm[CLDFB_NO_CHANNELS_MAX]; - float decSlotRe[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], decSlotIm[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; - float reverbRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - DIRAC_DEC_BIN_HANDLE h; - float interpVal; - float *decSlotRePointer; - float *decSlotImPointer; - int16_t offsetSamples; -#ifdef JBM_TSM_ON_TCS - int16_t nSlots; -#endif - - h = st_ivas->hDiracDecBin; - nBins = st_ivas->hDirAC->num_freq_bands; -#ifdef JBM_TSM_ON_TCS - offsetSamples = 0; - nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; -#else - offsetSamples = subframe * CLDFB_SLOTS_PER_SUBFRAME * nBins; -#endif - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - /* Process second / room effect part of binaural output when needed */ -#ifdef JBM_TSM_ON_TCS - ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm ); -#else - ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, inRe, inIm, reverbRe, reverbIm ); -#endif - } - - interpVal = 0.0f; -#ifdef JBM_TSM_ON_TCS - for ( slot = 0; slot < nSlots; slot++ ) -#else - for ( slot = 0; slot < CLDFB_SLOTS_PER_SUBFRAME; slot++ ) -#endif - { -#ifdef JBM_TSM_ON_TCS - interpVal += 1.0f / (float) nSlots; -#else - interpVal += 1.0f / ( (float) CLDFB_SLOTS_PER_SUBFRAME ); -#endif - if ( !st_ivas->hDiracDecBin->useTdDecorr && max_band_decorr > 0 ) - { - ivas_dirac_dec_decorrelate_slot( st_ivas->hDirAC, slot, inRe, inIm, decSlotRe, decSlotIm ); - } - - for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) - { - float *outSlotRePr, *outSlotImPr; /* Pointers needed for function call compatibility */ - - set_zero( outSlotRe, CLDFB_NO_CHANNELS_MAX ); - set_zero( outSlotIm, CLDFB_NO_CHANNELS_MAX ); - - /* Processing of the first / HRTF part of the binaural output. */ - for ( chB = 0; chB < numInChannels; chB++ ) - { - if ( st_ivas->hDiracDecBin->useTdDecorr ) - { - decSlotRePointer = inRe[chB + 2][slot]; - decSlotImPointer = inIm[chB + 2][slot]; - } - else - { - decSlotRePointer = decSlotRe[chB]; - decSlotImPointer = decSlotIm[chB]; - } - - for ( bin = 0; bin < nBins; bin++ ) - { - float gain; - - /* Mixing using the formulated processing matrix M */ - gain = ( 1.0f - interpVal ) * h->processMtxRePrev[chA][chB][bin] + - interpVal * h->processMtxRe[chA][chB][bin]; - outSlotRe[bin] += gain * inRe[chB][slot][bin]; - outSlotIm[bin] += gain * inIm[chB][slot][bin]; - - gain = ( 1.0f - interpVal ) * h->processMtxImPrev[chA][chB][bin] + - interpVal * h->processMtxIm[chA][chB][bin]; - outSlotRe[bin] -= gain * inIm[chB][slot][bin]; - outSlotIm[bin] += gain * inRe[chB][slot][bin]; - - /* Mixing decorrelated signals using the formulated residual processing matrix Mdec */ - if ( bin < max_band_decorr && chB < 2 ) - { - gain = ( 1.0f - interpVal ) * h->processMtxDecRePrev[chA][chB][bin] + - interpVal * h->processMtxDecRe[chA][chB][bin]; - outSlotRe[bin] += gain * decSlotRePointer[bin]; - outSlotIm[bin] += gain * decSlotImPointer[bin]; - - gain = ( 1.0f - interpVal ) * h->processMtxDecImPrev[chA][chB][bin] + - interpVal * h->processMtxDecIm[chA][chB][bin]; - outSlotRe[bin] -= gain * decSlotImPointer[bin]; - outSlotIm[bin] += gain * decSlotRePointer[bin]; - } - } - } + } - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) + if ( separateCenterChannelRendering ) + { + /* The rendering of the separate center channel in masa + mono mode. + * The center channel is processed with a gain factor 0.8414f to match the loudness of different processing paths */ + float lRealp, lImagp, rRealp, rImagp; + float gainFactor; + int16_t aziDeg = 0; + int16_t eleDeg = 0; + + gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); + for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { - /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */ - v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX ); - v_add( outSlotIm, reverbIm[chA][slot], outSlotIm, CLDFB_NO_CHANNELS_MAX ); + h->processMtxRePrev[chA][2][bin] = h->processMtxRe[chA][2][bin]; + h->processMtxImPrev[chA][2][bin] = h->processMtxIm[chA][2][bin]; } - outSlotRePr = &( outSlotRe[0] ); - outSlotImPr = &( outSlotIm[0] ); + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat ); - /* Inverse filter bank */ - cldfbSynthesis( &outSlotRePr, &outSlotImPr, &( output_f[chA][nBins * slot + offsetSamples] ), nBins, st_ivas->cldfbSynDec[chA] ); + h->processMtxRe[0][2][bin] = lRealp * gainFactor; + h->processMtxIm[0][2][bin] = lImagp * gainFactor; + h->processMtxRe[1][2][bin] = rRealp * gainFactor; + h->processMtxIm[1][2][bin] = rImagp * gainFactor; } } return; } -#else + +#ifdef JBM_TSM_ON_TCS +#endif + static void ivas_dirac_dec_binaural_process_output( Decoder_Struct *st_ivas, +#ifdef JBM_TSM_ON_TCS + float *output_f[], +#else float output_f[][L_FRAME48k], - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], +#endif + 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 uint8_t numInChannels, - const uint8_t firstSlot, - const uint8_t slotEnd ) + const int16_t numInChannels, + const int16_t subframe ) { - uint8_t slot, bin, chA, chB; + int16_t slot, bin, chA, chB; int16_t nBins; float outSlotRe[CLDFB_NO_CHANNELS_MAX], outSlotIm[CLDFB_NO_CHANNELS_MAX]; float decSlotRe[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], decSlotIm[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; - float reverbRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float reverbIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - uint8_t numSlots; + float reverbRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; DIRAC_DEC_BIN_HANDLE h; float interpVal; float *decSlotRePointer; float *decSlotImPointer; + int16_t offsetSamples; +#ifdef JBM_TSM_ON_TCS + int16_t nSlots; +#endif - numSlots = slotEnd - firstSlot; h = st_ivas->hDiracDecBin; nBins = st_ivas->hDirAC->num_freq_bands; +#ifdef JBM_TSM_ON_TCS + offsetSamples = 0; + nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; +#else + offsetSamples = subframe * CLDFB_SLOTS_PER_SUBFRAME * nBins; +#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { /* Process second / room effect part of binaural output when needed */ - ivas_binaural_reverb_processFrame( st_ivas->hDiracDecBin->hReverb, numInChannels, inRe, inIm, reverbRe, reverbIm, firstSlot ); +#ifdef JBM_TSM_ON_TCS + ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm ); +#else + ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, inRe, inIm, reverbRe, reverbIm ); +#endif } interpVal = 0.0f; - for ( slot = firstSlot; slot < ( firstSlot + numSlots ); slot++ ) +#ifdef JBM_TSM_ON_TCS + for ( slot = 0; slot < nSlots; slot++ ) +#else + for ( slot = 0; slot < CLDFB_SLOTS_PER_SUBFRAME; slot++ ) +#endif { - interpVal += 1.0f / (float) numSlots; +#ifdef JBM_TSM_ON_TCS + interpVal += 1.0f / (float) nSlots; +#else + interpVal += 1.0f / ( (float) CLDFB_SLOTS_PER_SUBFRAME ); +#endif if ( !st_ivas->hDiracDecBin->useTdDecorr && max_band_decorr > 0 ) { ivas_dirac_dec_decorrelate_slot( st_ivas->hDirAC, slot, inRe, inIm, decSlotRe, decSlotIm ); @@ -3194,121 +1485,16 @@ static void ivas_dirac_dec_binaural_process_output( outSlotImPr = &( outSlotIm[0] ); /* Inverse filter bank */ - cldfbSynthesis( &outSlotRePr, &outSlotImPr, &( output_f[chA][nBins * slot] ), nBins, st_ivas->cldfbSynDec[chA] ); + cldfbSynthesis( &outSlotRePr, &outSlotImPr, &( output_f[chA][nBins * slot + offsetSamples] ), nBins, st_ivas->cldfbSynDec[chA] ); } } return; } -#endif #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_sf( - HEAD_TRACK_DATA_HANDLE hHeadTrackData, - float inIm[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - float inRe[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - const uint8_t slotEnd, - const uint8_t nBins, - float Rmat[3][3] ) -{ - uint8_t slot, bin, ch; - float tmpVal; - - /* When not currently in prototype signal left-right switching procedure, check if such switching is needed */ - if ( hHeadTrackData->lrSwitchedNext == hHeadTrackData->lrSwitchedCurrent ) - { - float thresholdDotProduct = 0.17f; /* Corresponds to 10-degree switching threshold */ - if ( ( hHeadTrackData->lrSwitchedCurrent == 0 ) && ( Rmat[1][1] < -thresholdDotProduct ) ) - { - hHeadTrackData->lrSwitchedNext = 1; - } - if ( ( hHeadTrackData->lrSwitchedCurrent == 1 ) && ( Rmat[1][1] > thresholdDotProduct ) ) - { - hHeadTrackData->lrSwitchedNext = 0; - } - } - - /* When currently in interpolation */ - if ( hHeadTrackData->lrSwitchedNext != hHeadTrackData->lrSwitchedCurrent ) - { - for ( slot = 0; slot < slotEnd; slot++ ) - { - float switchOrderFactor, origOrderFactor; - - hHeadTrackData->lrSwitchInterpVal += 0.0025f; /* Corresponds to 0.5 seconds interpolation time */ - - if ( hHeadTrackData->lrSwitchInterpVal > 0.999f ) - { - /* Stop interpolation, reset values */ - hHeadTrackData->lrSwitchInterpVal = 0.0f; - hHeadTrackData->lrSwitchedCurrent = hHeadTrackData->lrSwitchedNext; - } - - /* Gains for determining portion of switched channel order and original channel order */ - tmpVal = (float) hHeadTrackData->lrSwitchedNext * hHeadTrackData->lrSwitchInterpVal; - tmpVal += (float) hHeadTrackData->lrSwitchedCurrent * ( 1.0f - hHeadTrackData->lrSwitchInterpVal ); - switchOrderFactor = sqrtf( tmpVal ); - origOrderFactor = sqrtf( 1.0f - tmpVal ); - - for ( bin = 0; bin < nBins; bin++ ) - { - /* determine original order (1) signals and switched order (2) signals */ - float re1[BINAURAL_CHANNELS], re2[BINAURAL_CHANNELS], im1[BINAURAL_CHANNELS], im2[BINAURAL_CHANNELS]; - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - re1[ch] = inRe[ch][slot][bin] * origOrderFactor; - re2[ch] = inRe[1 - ch][slot][bin] * switchOrderFactor; - im1[ch] = inIm[ch][slot][bin] * origOrderFactor; - im2[ch] = inIm[1 - ch][slot][bin] * switchOrderFactor; - } - - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - float eneRef, ene, eq; - - /* Interpolate / mix original and switched order signals */ - inRe[ch][slot][bin] = re1[ch] + re2[ch]; - inIm[ch][slot][bin] = im1[ch] + im2[ch]; - - /* Equalize interpolated signals to preserve energy per bin */ - eneRef = ( re1[ch] * re1[ch] ) + ( re2[ch] * re2[ch] ) + ( im1[ch] * im1[ch] ) + ( im2[ch] * im2[ch] ); - ene = ( inRe[ch][slot][bin] * inRe[ch][slot][bin] ) + ( inIm[ch][slot][bin] * inIm[ch][slot][bin] ); - eq = sqrtf( eneRef / fmaxf( 1e-12f, ene ) ); - eq = fminf( 4.0f, eq ); - inRe[ch][slot][bin] *= eq; - inIm[ch][slot][bin] *= eq; - } - } - } - } - else - { - /* If not in interpolation, but in switched prototype situation, then switch left and right channels */ - if ( hHeadTrackData->lrSwitchedCurrent == 1 ) - { - for ( slot = 0; slot < slotEnd; slot++ ) - { - for ( bin = 0; bin < nBins; bin++ ) - { - tmpVal = inRe[0][slot][bin]; - inRe[0][slot][bin] = inRe[1][slot][bin]; - inRe[1][slot][bin] = tmpVal; - tmpVal = inIm[0][slot][bin]; - inIm[0][slot][bin] = inIm[1][slot][bin]; - inIm[1][slot][bin] = tmpVal; - } - } - } - } - - return; -} -#endif #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS static void adaptTransportSignalsHeadtracked( HEAD_TRACK_DATA_HANDLE hHeadTrackData, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], @@ -3437,158 +1623,18 @@ static void adaptTransportSignalsHeadtracked( return; } -#else -static void adaptTransportSignalsHeadtracked( - HEAD_TRACK_DATA_HANDLE hHeadTrackData, - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const uint8_t firstSlot, - const uint8_t slotEnd, - const uint8_t nBins, - float Rmat[3][3] ) -{ - int16_t slot, ch, bin, louderCh; - float ILD, mono_factor_ILD, mono_factor_rotation, mono_factor, y_val, ene_proc, ene_target; - uint8_t n_slots_per_sf, sf_idx, n_sf; - int16_t max_band; - - /* Determine head-orientation-based mono factor. - Rmat[1][1] entry informs how close the ears are aligned according to transport signals. */ - y_val = 1.0f - fabsf( Rmat[1][1] ); - mono_factor_rotation = ( y_val - ADAPT_HTPROTO_ROT_LIM_0 ) / ( ADAPT_HTPROTO_ROT_LIM_1 - ADAPT_HTPROTO_ROT_LIM_0 ); - mono_factor_rotation = fmaxf( 0.0f, fminf( 1.0f, mono_factor_rotation ) ); - - /* Adapt transport signals in frequency bands */ - /* optimization grouping CLDFB bins into MASA bands (they are readily available in ROM and suitable for the task) AND group CLDFB slots into sub-frames */ - n_slots_per_sf = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; - n_sf = ( slotEnd - firstSlot ) / n_slots_per_sf; - - max_band = 0; - while ( max_band < MASA_FREQUENCY_BANDS && MASA_band_grouping_24[max_band] < nBins ) - { - max_band++; - } - - for ( sf_idx = 0; sf_idx < n_sf; sf_idx++ ) - { - float eqVal; - uint8_t start_slot, stop_slot; - int16_t band_idx, bin_lo, bin_hi; - - start_slot = firstSlot + sf_idx * n_slots_per_sf; - stop_slot = start_slot + n_slots_per_sf; - - for ( band_idx = 0; band_idx < max_band; band_idx++ ) - { - float ch_nrg[2]; /* storage for input signal channel energies */ - bin_lo = MASA_band_grouping_24[band_idx]; - bin_hi = min( MASA_band_grouping_24[band_idx + 1], (int16_t) nBins ); - for ( ch = 0; ch < 2; ch++ ) - { - ch_nrg[ch] = 0.0f; - for ( slot = start_slot; slot < stop_slot; slot++ ) - { - for ( bin = bin_lo; bin < bin_hi; bin++ ) - { - ch_nrg[ch] += ( inRe[ch][slot][bin] * inRe[ch][slot][bin] ) + ( inIm[ch][slot][bin] * inIm[ch][slot][bin] ); - } - } - hHeadTrackData->chEneIIR[ch][band_idx] *= ADAPT_HTPROTO_IIR_FAC; - hHeadTrackData->chEneIIR[ch][band_idx] += ( 1.0f - ADAPT_HTPROTO_IIR_FAC ) * ch_nrg[ch]; - } - - /* Determine ILD */ - ILD = fabsf( 10.0f * log10f( fmaxf( 1e-12f, hHeadTrackData->chEneIIR[0][band_idx] ) / fmaxf( 1e-12f, hHeadTrackData->chEneIIR[1][band_idx] ) ) ); - if ( hHeadTrackData->chEneIIR[1][band_idx] > hHeadTrackData->chEneIIR[0][band_idx] ) - { - louderCh = 1; - } - else - { - louderCh = 0; - } - - /* Determine ILD-based mono factor */ - mono_factor_ILD = ( ILD - ADAPT_HTPROTO_ILD_LIM_DB0 ) / ( ADAPT_HTPROTO_ILD_LIM_DB1 - ADAPT_HTPROTO_ILD_LIM_DB0 ); - mono_factor_ILD = fmaxf( 0.0f, fminf( 1.0f, mono_factor_ILD ) ); - - /* Combine mono factors */ - mono_factor = mono_factor_ILD * mono_factor_rotation; - - /* Mix original audio and sum signal according to determined mono factor */ - for ( ch = 0; ch < 2; ch++ ) - { - if ( ch != louderCh ) - { - float band_nrg = 0.0f; - - for ( slot = start_slot; slot < stop_slot; slot++ ) - { - for ( bin = bin_lo; bin < bin_hi; bin++ ) - { - /* mono sum signal with the computed weight + rest from the original channel */ - inRe[ch][slot][bin] = mono_factor * ( inRe[0][slot][bin] + inRe[1][slot][bin] ) + ( 1.0f - mono_factor ) * inRe[ch][slot][bin]; - inIm[ch][slot][bin] = mono_factor * ( inIm[0][slot][bin] + inIm[1][slot][bin] ) + ( 1.0f - mono_factor ) * inIm[ch][slot][bin]; - band_nrg += ( inRe[ch][slot][bin] * inRe[ch][slot][bin] ) + ( inIm[ch][slot][bin] * inIm[ch][slot][bin] ); - } - } - hHeadTrackData->procChEneIIR[ch][band_idx] *= ADAPT_HTPROTO_IIR_FAC; - hHeadTrackData->procChEneIIR[ch][band_idx] += ( 1.0f - ADAPT_HTPROTO_IIR_FAC ) * band_nrg; - } - else - { - /* processed signal is input. use the original channel, so no need to compute new signals or signal energy */ - hHeadTrackData->procChEneIIR[ch][band_idx] *= ADAPT_HTPROTO_IIR_FAC; - hHeadTrackData->procChEneIIR[ch][band_idx] += ( 1.0f - ADAPT_HTPROTO_IIR_FAC ) * ch_nrg[ch]; - } - } - - /* Equalize */ - ene_target = hHeadTrackData->chEneIIR[0][band_idx] + hHeadTrackData->chEneIIR[1][band_idx]; - ene_proc = hHeadTrackData->procChEneIIR[0][band_idx] + hHeadTrackData->procChEneIIR[1][band_idx]; - eqVal = fminf( 4.0f, sqrtf( ene_target / fmaxf( 1e-12f, ene_proc ) ) ); - - for ( slot = start_slot; slot < stop_slot; slot++ ) - { - for ( ch = 0; ch < 2; ch++ ) - { - for ( bin = bin_lo; bin < bin_hi; bin++ ) - { - inRe[ch][slot][bin] *= eqVal; - inIm[ch][slot][bin] *= eqVal; - } - } - } - } - } - - return; -} -#endif static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( HEAD_TRACK_DATA_HANDLE hHeadTrackData, -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t nBins, -#else - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const uint8_t firstSlot, - const uint8_t slotEnd, - const uint8_t nBins, -#endif #ifdef JBM_TSM_ON_TCS const int16_t nSlots, #endif float Rmat[3][3] ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS int16_t slot, bin, ch; -#else - uint8_t slot, bin, ch; -#endif float tmpVal; /* When not currently in prototype signal left-right switching procedure, check if such switching is needed */ @@ -3608,14 +1654,10 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( /* When currently in interpolation */ if ( hHeadTrackData->lrSwitchedNext != hHeadTrackData->lrSwitchedCurrent ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS for ( slot = 0; slot < nSlots; slot++ ) #else for ( slot = 0; slot < CLDFB_SLOTS_PER_SUBFRAME; slot++ ) -#endif -#else - for ( slot = firstSlot; slot < slotEnd; slot++ ) #endif { float switchOrderFactor, origOrderFactor; @@ -3672,14 +1714,10 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( /* If not in interpolation, but in switched prototype situation, then switch left and right channels */ if ( hHeadTrackData->lrSwitchedCurrent == 1 ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS for ( slot = 0; slot < nSlots; slot++ ) #else for ( slot = 0; slot < CLDFB_SLOTS_PER_SUBFRAME; slot++ ) -#endif -#else - for ( slot = firstSlot; slot < slotEnd; slot++ ) #endif { for ( bin = 0; bin < nBins; bin++ ) @@ -4142,39 +2180,20 @@ static void hrtfShGetHrtf( *------------------------------------------------------------------------*/ /*! r: Configured reqularization factor value */ -#ifndef FIX_417_TD_DECORR_BRATE_SW -static -#endif - float - configure_reqularization_factor( - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ - ) +float configure_reqularization_factor( + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +) { float reqularizationFactor; reqularizationFactor = 1.0f; /* Default value */ if ( ivas_format == MASA_FORMAT ) { -#ifdef FIX_447_PARAMBIN_MASA_REGU_FAC if ( ivas_total_brate >= IVAS_160k ) { reqularizationFactor = 0.4f; } -#else - if ( ivas_total_brate >= IVAS_256k ) - { - reqularizationFactor = 0.2f; - } - else if ( ivas_total_brate == IVAS_192k ) - { - reqularizationFactor = 0.3f; - } - else if ( ivas_total_brate == IVAS_160k ) - { - reqularizationFactor = 0.4f; - } -#endif else if ( ivas_total_brate == IVAS_128k ) { reqularizationFactor = 0.5f; @@ -4197,11 +2216,7 @@ static { if ( ivas_total_brate >= IVAS_96k ) { -#ifdef FIX_447_PARAMBIN_MASA_REGU_FAC reqularizationFactor = 0.4f; -#else - reqularizationFactor = 0.3f; -#endif } else if ( ivas_total_brate >= IVAS_80k ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index e163862eebf722628dc4ce1169ddf113621dbe02..f4063edc48001f134d5a482b894084fe3c9a31ef 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -34,9 +34,7 @@ #include #include "options.h" #include "prot.h" -#ifdef ISM_NON_DIEGETIC_PAN #include "ivas_prot.h" -#endif #include "ivas_prot_rend.h" #include #include "ivas_rom_com.h" @@ -354,9 +352,7 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifdef ISM_NON_DIEGETIC_PAN float pan_left, pan_right; -#endif error = IVAS_ERR_OK; @@ -378,11 +374,7 @@ ivas_error TDREND_GetMix( SrcRend_p = Src_p->SrcRend_p; /* Update rendering params if needed */ -#ifdef ISM_NON_DIEGETIC_PAN if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) -#else - if ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) -#endif { TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_idx ); @@ -394,7 +386,6 @@ ivas_error TDREND_GetMix( error = TDREND_REND_RenderSourceHRFilt( Src_p, hrf_left_delta, hrf_right_delta, intp_count, output_buf, subframe_length ); } -#ifdef ISM_NON_DIEGETIC_PAN if ( ( SrcRend_p->InputAvailable == TRUE ) && ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ) ) { pan_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; @@ -402,7 +393,6 @@ ivas_error TDREND_GetMix( v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_left, output_buf[0], subframe_length ); v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_right, output_buf[1], subframe_length ); } -#endif } /* Populate output variable */ @@ -454,7 +444,7 @@ void TDREND_Update_object_positions( #ifdef JBM_TSM_ON_TCS float *output[] #else - float output[][L_FRAME48k] /* i/o: SCE/MC channels */ + float output[][L_FRAME48k] /* i/o: SCE/MC channels */ #endif ) { @@ -494,7 +484,6 @@ void TDREND_Update_object_positions( TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos ); TDREND_MIX_SRC_SetDirAtten( hBinRendererTd, nS, DirAtten_p ); -#ifdef ISM_NON_DIEGETIC_PAN if ( hIsmMetaData[nS]->non_diegetic_flag ) { Pos[0] = 0; @@ -507,9 +496,6 @@ void TDREND_Update_object_positions( { TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); } -#else - TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); -#endif TDREND_MIX_SRC_SetDir( hBinRendererTd, nS, Dir ); } } @@ -693,9 +679,7 @@ ivas_error ivas_td_binaural_renderer_ext( hIsmMetaData[0]->yaw = currentPos->yaw; hIsmMetaData[0]->pitch = currentPos->pitch; hIsmMetaData[0]->radius = currentPos->radius; -#ifdef ISM_NON_DIEGETIC_PAN hIsmMetaData[0]->non_diegetic_flag = currentPos->non_diegetic_flag; -#endif } #ifdef JBM_TSM_ON_TCS diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 97d0b68fb8e83c6fb28f6e35b001800be2f9f5ac..6a2bf00278d535f817c46af256111b1a5acd87a4 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -69,21 +69,11 @@ ivas_error TDREND_REND_RenderSourceHRFilt( { float LeftOutputFrame[L_SPATIAL_SUBFR_48k]; float RightOutputFrame[L_SPATIAL_SUBFR_48k]; -#ifndef FIX_379_GAININTP - float Gain; - - Gain = ( *Src_p->SrcRend_p->DirGain_p ) * ( *Src_p->SrcRend_p->DistGain_p ); -#endif TDREND_Apply_ITD( Src_p->InputFrame_p, LeftOutputFrame, RightOutputFrame, &Src_p->previtd, Src_p->itd, Src_p->mem_itd, subframe_length ); -#ifdef FIX_379_GAININTP TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength, Src_p->Gain, Src_p->prevGain ); TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength, Src_p->Gain, Src_p->prevGain ); Src_p->prevGain = Src_p->Gain; -#else - TDREND_firfilt( LeftOutputFrame, Src_p->hrf_left_prev, hrf_left_delta, intp_count, Src_p->mem_hrf_left, subframe_length, Src_p->filterlength, Gain ); - TDREND_firfilt( RightOutputFrame, Src_p->hrf_right_prev, hrf_right_delta, intp_count, Src_p->mem_hrf_right, subframe_length, Src_p->filterlength, Gain ); -#endif /* Copy to accumulative output frame */ v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index af3231df613a8717b5e8ada8603bc5fa92f94848..d988ad53d2ac65baf5a69da192b9261b6efe7d22 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -236,12 +236,8 @@ void TDREND_firfilt( float *mem, /* i/o: filter memory */ const int16_t subframe_length, /* i : Length of signal */ const int16_t filterlength, /* i : Filter length */ -#ifdef FIX_379_GAININTP - const float Gain, /* i : Gain */ - const float prevGain /* i : Previous gain */ -#else - const float Gain /* i : Gain */ -#endif + const float Gain, /* i : Gain */ + const float prevGain /* i : Previous gain */ ) { float buffer[SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1 + L_SUBFRAME5MS_48k]; @@ -250,13 +246,11 @@ void TDREND_firfilt( float *p_filter; float tmp; int16_t i, j; -#ifdef FIX_379_GAININTP float step, gain_tmp, gain_delta; gain_delta = ( Gain - prevGain ); step = gain_delta / ( subframe_length ); gain_tmp = prevGain; -#endif /* Handle memory */ p_signal = buffer + filterlength - 1; @@ -274,13 +268,9 @@ void TDREND_firfilt( { tmp += ( *p_filter++ ) * ( *p_tmp-- ); } -#ifdef FIX_379_GAININTP /* Apply linear gain interpolation in case of abrupt gain changes */ gain_tmp = gain_tmp + step; signal[i] = tmp * gain_tmp; -#else - signal[i] = tmp * Gain; -#endif if ( i < intp_count ) { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 91253748b2eb4ee2554f80c6d8f2782b72c31fe8..0d307ea442316cb100b799c6532517a7edf8b0b0 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -687,9 +687,7 @@ void TDREND_SRC_Init( Src_p->hrf_right_prev[0] = 1; Src_p->azim_prev = 0.0f; Src_p->elev_prev = 0.0f; -#ifdef FIX_379_GAININTP Src_p->prevGain = 1.0f; -#endif return; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 402b98a4d035034f287ed368cf93786d6909f912..f8c730bd14fb8be1e19774c20c109473f0659b9a 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -140,22 +140,12 @@ void efap_determine_gains( * SBA rendering *----------------------------------------------------------------------------------*/ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS void ivas_sba_prototype_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ const int16_t subframe /* i : Subframe to render */ ); -#else -void ivas_sba_prototype_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ - const int16_t firstSubframe, /* i : First subframe to map */ - const int16_t nSubframes /* i : Number of subframes to map */ -); -#endif ivas_error ivas_sba_get_hoa_dec_matrix( const IVAS_OUTPUT_SETUP hOutSetup, /* i : target output setup */ @@ -498,12 +488,8 @@ void TDREND_firfilt( float *mem, /* i/o: filter memory */ const int16_t subframe_length, /* i : Length of signal */ const int16_t filterlength, /* i : Filter length */ -#ifdef FIX_379_GAININTP const float Gain, /* i : Gain */ const float prevGain /* i : Previous gain */ -#else - const float Gain /* i : Gain */ -#endif ); @@ -596,7 +582,6 @@ void ivas_binaural_reverb_close( REVERB_STRUCT_HANDLE *hReverb /* i/o: binaural reverb handle */ ); -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS void ivas_binaural_reverb_processSubframe( REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ const int16_t numInChannels, /* i : num input channels to be processed */ @@ -608,30 +593,8 @@ void ivas_binaural_reverb_processSubframe( float outReal[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ float outImag[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /* o : output CLDFB data imag */ ); -#else -void ivas_binaural_reverb_processFrame( - REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ - const int16_t numInChannels, /* i : num input channels to be processed */ - float inReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data real */ - float inImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data imag */ - float outReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ - float outImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data imag */ - const uint8_t offsetSamplesIO /* i : number of offset samples */ -); -#endif #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -void ivas_binaural_reverb_processSlot( - REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ - const int16_t numInChannels, /* i : num inputs to be processed */ - float inReal[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data real, Comment: This change swaps two first dimensions as first dimension is not constant. */ - float inImag[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data imag */ - float outReal[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ - float outImag[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data imag */ - const uint8_t offsetSamplesIO /* i : number of offset samples */ -); -#endif #endif ivas_error ivas_reverb_open( diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 12a8b55ddbcbdd2e053170d24711c20ab5d7bddd..baa83fad0e58d61fb16a3eb6ccee7f1e0f353728 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1625,7 +1625,6 @@ ivas_error ivas_reverb_process( * Compute the reverberation - room effect *------------------------------------------------------------------------*/ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS void ivas_binaural_reverb_processSubframe( REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ const int16_t numInChannels, /* i : num inputs to be processed */ @@ -1637,17 +1636,6 @@ void ivas_binaural_reverb_processSubframe( float outReal[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ float outImag[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /* o : output CLDFB data imag */ ) -#else -void ivas_binaural_reverb_processFrame( - REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ - const int16_t numInChannels, /* i : num inputs to be processed */ - float inReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data real, Comment: This change swaps two first dimensions as first dimension is not constant. */ - float inImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data imag */ - float outReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ - float outImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data imag */ - const uint8_t offsetSamplesIO /* i : number of offset samples */ -) -#endif { /* Declare the required variables */ int16_t idx, bin, ch, sample, invertSampleIndex, tapIdx, *phaseShiftTypePr; @@ -1690,10 +1678,6 @@ void ivas_binaural_reverb_processFrame( for ( sample = 0; sample < hReverb->blockSize; sample++ ) #endif { -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS - uint16_t sampleWithOffset; - sampleWithOffset = sample + offsetSamplesIO; -#endif #ifdef JBM_TSM_ON_TCS invertSampleIndex = numSlots - sample - 1; #else @@ -1712,7 +1696,6 @@ void ivas_binaural_reverb_processFrame( /* Add every second input channel as is to the pre-delay buffer, and every second input channel with * 90 degrees phase shift to reduce energy imbalances between coherent and incoherent sounds */ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS for ( ch = 0; ch < numInChannels; ch++ ) { if ( ch % 2 ) @@ -1728,23 +1711,6 @@ void ivas_binaural_reverb_processFrame( } idx = ( idx + 1 ) % hReverb->preDelayBufferLength; } -#else - for ( ch = 0; ch < numInChannels; ch++ ) - { - if ( ch % 2 ) - { - v_add( hReverb->preDelayBufferReal[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); - v_add( hReverb->preDelayBufferImag[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); - } - else - { - v_sub( hReverb->preDelayBufferReal[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); - v_add( hReverb->preDelayBufferImag[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); - } - } - idx = ( idx + 1 ) % hReverb->preDelayBufferLength; - } -#endif hReverb->preDelayBufferIndex = idx; /* 3) Perform the filtering/decorrelating, using complex and sparse FIR filtering */ @@ -1847,11 +1813,6 @@ void ivas_binaural_reverb_processFrame( for ( sample = 0; sample < hReverb->blockSize; sample++ ) #endif { -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS - uint16_t sampleWithOffset; - - sampleWithOffset = sample + offsetSamplesIO; -#endif /* Audio was in the temporally inverted order for convolution, re-invert audio to output */ #ifdef JBM_TSM_ON_TCS invertSampleIndex = numSlots - sample - 1; @@ -1859,7 +1820,6 @@ void ivas_binaural_reverb_processFrame( invertSampleIndex = hReverb->blockSize - sample - 1; #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS for ( bin = 0; bin < hReverb->numBins; bin++ ) { outReal[ch][sample][bin] = hReverb->outputBufferReal[bin][ch][invertSampleIndex]; @@ -1870,18 +1830,6 @@ void ivas_binaural_reverb_processFrame( outReal[ch][sample][bin] = 0.0f; outImag[ch][sample][bin] = 0.0f; } -#else - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - outReal[ch][sampleWithOffset][bin] = hReverb->outputBufferReal[bin][ch][invertSampleIndex]; - outImag[ch][sampleWithOffset][bin] = hReverb->outputBufferImag[bin][ch][invertSampleIndex]; - } - for ( ; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) - { - outReal[ch][sampleWithOffset][bin] = 0.0f; - outImag[ch][sampleWithOffset][bin] = 0.0f; - } -#endif } } @@ -1890,174 +1838,6 @@ void ivas_binaural_reverb_processFrame( } #ifdef JBM_TSM_ON_TCS -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS -/*------------------------------------------------------------------------- - * ivas_binaural_reverb_processSlot() - * - * Compute the reverberation - room effect - *------------------------------------------------------------------------*/ - -void ivas_binaural_reverb_processSlot( - REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ - const int16_t numInChannels, /* i : num inputs to be processed */ - float inReal[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data real, Comment: This change swaps two first dimensions as first dimension is not constant. */ - float inImag[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data imag */ - float outReal[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ - float outImag[][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data imag */ - const uint8_t offsetSamplesIO /* i : number of offset samples */ -) -{ - /* Declare the required variables */ - int16_t idx, bin, ch, sample, invertSampleIndex, tapIdx, *phaseShiftTypePr; - float **tapRealPr, **tapImagPr; - -#ifdef DEBUGGING - assert( hReverb->blockSize == 1 ); -#endif - - push_wmops( "binaural_reverb" ); - /* 1) Rotate the data in the loop buffer of the reverberator. - * Notice that the audio at the loop buffers is at time-inverted order - * for convolution purposes later on. */ - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - /* Move the data forwards by blockSize (i.e. by the frame size of 16 CLDFB slots) */ - mvr2r( hReverb->loopBufReal[bin], hReverb->loopBufReal[bin] + hReverb->blockSize, hReverb->loopBufLength[bin] ); - mvr2r( hReverb->loopBufImag[bin], hReverb->loopBufImag[bin] + hReverb->blockSize, hReverb->loopBufLength[bin] ); - - /* Add the data from the end of the loop to the beginning, with an attenuation factor - * according to RT60. This procedure generates an IIR decaying response. The response - * is decorrelated later on. */ - v_multc( hReverb->loopBufReal[bin] + hReverb->loopBufLength[bin], hReverb->loopAttenuationFactor[bin], hReverb->loopBufReal[bin], hReverb->blockSize ); - v_multc( hReverb->loopBufImag[bin] + hReverb->loopBufLength[bin], hReverb->loopAttenuationFactor[bin], hReverb->loopBufImag[bin], hReverb->blockSize ); - } - - /* 2) Apply the determined pre-delay to the input audio, and add the delayed audio to the loop. */ - idx = hReverb->preDelayBufferIndex; - for ( sample = 0; sample < hReverb->blockSize; sample++ ) - { - uint16_t sampleWithOffset; - sampleWithOffset = sample + offsetSamplesIO; - invertSampleIndex = hReverb->blockSize - sample - 1; - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - /* Add from pre-delay buffer a sample to the loop buffer, in a time-inverted order. - * Also apply the spectral gains determined for the reverberation */ - hReverb->loopBufReal[bin][invertSampleIndex] += hReverb->preDelayBufferReal[idx][bin] * hReverb->reverbEqGains[bin]; - hReverb->loopBufImag[bin][invertSampleIndex] += hReverb->preDelayBufferImag[idx][bin] * hReverb->reverbEqGains[bin]; - hReverb->preDelayBufferReal[idx][bin] = 0.0f; - hReverb->preDelayBufferImag[idx][bin] = 0.0f; - } - - /* Add every second input channel as is to the pre-delay buffer, and every second input channel with - * 90 degrees phase shift to reduce energy imbalances between coherent and incoherent sounds */ - for ( ch = 0; ch < numInChannels; ch++ ) - { - if ( ch % 2 ) - { - v_add( hReverb->preDelayBufferReal[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); - v_add( hReverb->preDelayBufferImag[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); - } - else - { - v_sub( hReverb->preDelayBufferReal[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); - v_add( hReverb->preDelayBufferImag[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); - } - } - idx = ( idx + 1 ) % hReverb->preDelayBufferLength; - } - hReverb->preDelayBufferIndex = idx; - - /* 3) Perform the filtering/decorrelating, using complex and sparse FIR filtering */ - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - /* These tap pointers have been determined to point to the loop buffer at sparse locations */ - tapRealPr = hReverb->tapPointersReal[bin][ch]; - tapImagPr = hReverb->tapPointersImag[bin][ch]; - phaseShiftTypePr = hReverb->tapPhaseShiftType[bin][ch]; - - /* Flush output */ - set_f( hReverb->outputBufferReal[bin][ch], 0.0f, hReverb->blockSize ); - set_f( hReverb->outputBufferImag[bin][ch], 0.0f, hReverb->blockSize ); - - /* Add from temporally decaying sparse tap locations the audio to the output. */ - for ( tapIdx = 0; tapIdx < hReverb->taps[bin][ch]; tapIdx++ ) - { - switch ( phaseShiftTypePr[tapIdx] ) - { - case 0: /* 0 degrees phase */ - v_add( hReverb->outputBufferReal[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_add( hReverb->outputBufferImag[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - case 1: /* 90 degrees phase */ - v_sub( hReverb->outputBufferReal[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_add( hReverb->outputBufferImag[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - case 2: /* 180 degrees phase */ - v_sub( hReverb->outputBufferReal[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_sub( hReverb->outputBufferImag[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - default: /* 270 degrees phase */ - v_add( hReverb->outputBufferReal[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_sub( hReverb->outputBufferImag[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - } - } - } - - /* Generate diffuse field binaural coherence by mixing the incoherent reverberated channels with pre-defined gains */ - if ( bin <= hReverb->highestBinauralCoherenceBin ) - { - if ( hReverb->useBinauralCoherence ) - { - for ( sample = 0; sample < hReverb->blockSize; sample++ ) - { - float leftRe, rightRe, leftIm, rightIm; - - leftRe = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferReal[bin][0][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferReal[bin][1][sample]; - rightRe = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferReal[bin][1][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferReal[bin][0][sample]; - leftIm = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferImag[bin][0][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferImag[bin][1][sample]; - rightIm = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferImag[bin][1][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferImag[bin][0][sample]; - - hReverb->outputBufferReal[bin][0][sample] = leftRe; - hReverb->outputBufferReal[bin][1][sample] = rightRe; - hReverb->outputBufferImag[bin][0][sample] = leftIm; - hReverb->outputBufferImag[bin][1][sample] = rightIm; - } - } - } - } - - /* 4) Write data to output */ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - for ( sample = 0; sample < hReverb->blockSize; sample++ ) - { - uint16_t sampleWithOffset; - - sampleWithOffset = sample + offsetSamplesIO; - /* Audio was in the temporally inverted order for convolution, re-invert audio to output */ - invertSampleIndex = hReverb->blockSize - sample - 1; - - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - outReal[ch][sampleWithOffset][bin] = hReverb->outputBufferReal[bin][ch][invertSampleIndex]; - outImag[ch][sampleWithOffset][bin] = hReverb->outputBufferImag[bin][ch][invertSampleIndex]; - } - for ( ; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) - { - outReal[ch][sampleWithOffset][bin] = 0.0f; - outImag[ch][sampleWithOffset][bin] = 0.0f; - } - } - } - - pop_wmops(); - return; -} -#endif #endif /*------------------------------------------------------------------------- diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 5719e2ffddf4f5079d8d6dde0922434cd679115b..6809cdee2bcf9869dbe8918d5bb820746c242f29 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -165,24 +165,13 @@ void Euler2Quat( float cr = cosf( roll * 0.5f ); float sr = sinf( roll * 0.5f ); float cp = cosf( pitch * 0.5f ); -#ifdef EUALER2QUAT_FIX float sp = sinf( pitch * 0.5f ); -#else - float sp = sinf( -pitch * 0.5f ); -#endif float cy = cosf( yaw * 0.5f ); float sy = sinf( yaw * 0.5f ); -#ifdef EUALER2QUAT_FIX quat->w = cr * cp * cy + sr * sp * sy; quat->x = sr * cp * cy - cr * sp * sy; quat->y = sr * cp * sy + cr * sp * cy; quat->z = cr * cp * sy - sr * sp * cy; -#else - quat->w = cr * cp * cy - sr * sp * sy; - quat->x = sr * cp * cy + cr * sp * sy; - quat->y = cr * sp * cy - sr * cp * sy; - quat->z = cr * cp * sy + sr * sp * cy; -#endif return; } diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index c549461c37f2f4275be8899bc39fd913782250ba..eeeb505dea009192cd800ae5acbc8ceb3026e320 100644 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -202,22 +202,12 @@ void ivas_sba_prototype_renderer_sf( } #endif -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS void ivas_sba_prototype_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ const int16_t subframe /* i : Subframe to render */ ) -#else -void ivas_sba_prototype_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, real */ - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Input audio in CLDFB domain, imag */ - const int16_t firstSubframe, /* i : First subframe to map */ - const int16_t nSubframes /* i : Number of subframes to map */ -) -#endif { float mixer_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; SPAR_DEC_HANDLE hSpar; @@ -227,12 +217,7 @@ void ivas_sba_prototype_renderer( int16_t num_cldfb_bands, numch_in, numch_out; int16_t cldfb_band; int16_t out_ch, in_ch; -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS int16_t firstInCh, inChEnd, firstOutCh, outChEnd; -#else - int16_t firstSlot, slotEnd, firstInCh, inChEnd, firstOutCh, outChEnd; - int16_t sf_idx; -#endif #ifdef JBM_TSM_ON_TCS int16_t slot_idx_start, md_idx; #endif @@ -243,10 +228,6 @@ void ivas_sba_prototype_renderer( hDecoderConfig = st_ivas->hDecoderConfig; num_spar_bands = hSpar->hFbMixer->pFb->filterbank_num_bands; -#ifndef FIX_355_REFACTOR_PARAMBIN_TO_5MS - firstSlot = firstSubframe * ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); - slotEnd = ( firstSubframe + nSubframes ) * ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif num_cldfb_bands = hSpar->hFbMixer->pFb->fb_bin_to_band.num_cldfb_bands; numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; numch_out = hSpar->hFbMixer->fb_cfg->num_out_chans; @@ -270,7 +251,6 @@ void ivas_sba_prototype_renderer( } /* Apply mixing matrix */ -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) #else @@ -373,90 +353,14 @@ void ivas_sba_prototype_renderer( } } #endif -#else - for ( ts = firstSlot; ts < slotEnd; ts++ ) - { - /* determine SPAR parameters for this time slot */ - ivas_spar_get_parameters( hSpar, hDecoderConfig, ts, numch_out, numch_in, num_spar_bands, mixer_mat ); - - for ( cldfb_band = 0; cldfb_band < num_cldfb_bands; cldfb_band++ ) - { - float out_re[IVAS_SPAR_MAX_CH]; - float out_im[IVAS_SPAR_MAX_CH]; - float cldfb_par; - ivas_fb_bin_to_band_data_t *bin2band = &hSpar->hFbMixer->pFb->fb_bin_to_band; - - for ( out_ch = firstOutCh; out_ch < outChEnd; out_ch++ ) - { - out_re[out_ch] = 0.0f; - out_im[out_ch] = 0.0f; - - for ( in_ch = firstInCh; in_ch < inChEnd; in_ch++ ) - { - if ( cldfb_band < CLDFB_PAR_WEIGHT_START_BAND ) /* tuning parameter, depends on how much SPAR Filters overlap for the CLDFB bands */ - { - spar_band = bin2band->p_cldfb_map_to_spar_band[cldfb_band]; - cldfb_par = mixer_mat[out_ch][in_ch][spar_band]; - } - else - { - cldfb_par = 0.0f; - for ( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ ) - { - /* accumulate contributions from all SPAR bands */ - cldfb_par += mixer_mat[out_ch][in_ch][spar_band] * bin2band->pp_cldfb_weights_per_spar_band[cldfb_band][spar_band]; - } - } - - out_re[out_ch] += inRe[in_ch][ts][cldfb_band] * cldfb_par; - out_im[out_ch] += inIm[in_ch][ts][cldfb_band] * cldfb_par; - } - } - - /*update CLDFB data with the parameter-modified data*/ - for ( out_ch = firstOutCh; out_ch < outChEnd; out_ch++ ) - { - inRe[out_ch][ts][cldfb_band] = out_re[out_ch]; - inIm[out_ch][ts][cldfb_band] = out_im[out_ch]; - } - } - - /* Update mixing matrices */ - if ( ( ( ts + 1 ) % MAX_PARAM_SPATIAL_SUBFRAMES ) == 0 ) - { - sf_idx = ts / MAX_PARAM_SPATIAL_SUBFRAMES; - hSpar->i_subframe++; - hSpar->i_subframe = min( hSpar->i_subframe, MAX_PARAM_SPATIAL_SUBFRAMES ); - mvr2r( hSpar->hMdDec->mixer_mat_prev[1][0][0], hSpar->hMdDec->mixer_mat_prev[0][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); - mvr2r( hSpar->hMdDec->mixer_mat_prev[2][0][0], hSpar->hMdDec->mixer_mat_prev[1][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); - mvr2r( hSpar->hMdDec->mixer_mat_prev[3][0][0], hSpar->hMdDec->mixer_mat_prev[2][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); - mvr2r( hSpar->hMdDec->mixer_mat_prev[4][0][0], hSpar->hMdDec->mixer_mat_prev[3][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); - - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) - { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( b = 0; b < num_spar_bands; b++ ) - { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + sf_idx * IVAS_MAX_NUM_BANDS]; - } - } - } - } - } -#endif /* Create prototypes */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { -#ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS #ifdef JBM_TSM_ON_TCS for ( ts = 0; ts < hSpar->subframe_nbslots[subframe]; ts++ ) #else for ( ts = 0; ts < CLDFB_SLOTS_PER_SUBFRAME; ts++ ) -#endif -#else - for ( ts = firstSlot; ts < slotEnd; ts++ ) #endif { if ( st_ivas->nchan_transport == 1 ) /* Dual mono */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index a987a1f83509570c2fc82a9b2f75c3baf1f0d128..09c0bbff8035970eb52dd34a75fa7473550304c8 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -608,9 +608,7 @@ typedef struct float mem_hrf_left[SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1]; float mem_hrf_right[SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1]; float Gain; -#ifdef FIX_379_GAININTP float prevGain; -#endif } TDREND_SRC_t; /* Top level TD binaural renderer handle */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5becd351d61fae13361dd175be3d33356f594cc6..cfea5510c93a30d65e6f6a16406d38e755b647c5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -118,10 +118,8 @@ typedef struct CREND_WRAPPER_HANDLE crendWrapper; REVERB_HANDLE hReverb; rotation_matrix rot_mat_prev; -#ifdef NON_DIEGETIC_PAN int16_t nonDiegeticPan; float nonDiegeticPanGain; -#endif } input_ism; typedef struct @@ -148,10 +146,8 @@ typedef struct CREND_WRAPPER_HANDLE crendWrapper; REVERB_HANDLE hReverb; rotation_gains rot_gains_prev; -#ifdef NON_DIEGETIC_PAN int16_t nonDiegeticPan; float nonDiegeticPanGain; -#endif lfe_routing lfeRouting; } input_mc; @@ -1018,9 +1014,7 @@ static IVAS_REND_AudioObjectPosition defaultObjectPosition( pos.radius = 1.0f; pos.yaw = 0.0f; pos.pitch = 0.0f; -#ifdef ISM_NON_DIEGETIC_PAN pos.non_diegetic_flag = 0; -#endif return pos; } @@ -1626,7 +1620,6 @@ static ivas_error updateMcPanGainsForMcOut( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO || inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { -#ifdef NON_DIEGETIC_PAN if ( ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) ) { inputMc->panGains[0][0] = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f; @@ -1634,7 +1627,6 @@ static ivas_error updateMcPanGainsForMcOut( error = IVAS_ERR_OK; } else -#endif { error = initMcPanGainsWithEfap( inputMc, outConfig ); } @@ -2217,9 +2209,7 @@ static ivas_error initMasaDummyDecForMcOut( output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); decDummy->hDecoderConfig->output_config = output_config; -#ifdef HODIRAC decDummy->sba_analysis_order = 1; -#endif decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ decDummy->sba_mode = SBA_MODE_NONE; /* Todo Nokia: This is done to prevent ivas_dirac_dec_config() to not use uninitialized value. It could be considered if this should not be even accessed when not in SBA. */ @@ -2308,9 +2298,7 @@ static ivas_error initMasaDummyDecForSbaOut( decDummy->sba_mode = SBA_MODE_NONE; /* Todo Nokia: This is done to prevent ivas_dirac_dec_config() to not use uninitialized value. It could be considered if this should not be even accessed when not in SBA. */ decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ -#ifdef HODIRAC decDummy->sba_analysis_order = 1; -#endif ivas_output_init( &( decDummy->hOutSetup ), output_config ); ivas_output_init( &( decDummy->hIntSetup ), output_config ); @@ -2378,9 +2366,7 @@ static ivas_error initMasaDummyDecForBinauralOut( output_config = decDummy->hDecoderConfig->output_config; -#ifdef HODIRAC decDummy->sba_analysis_order = 1; -#endif decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ decDummy->sba_mode = SBA_MODE_NONE; /* Todo Nokia: This is done to prevent ivas_dirac_dec_config() to not use uninitialized value. It could be considered if this should not be even accessed when not in SBA. */ @@ -2673,14 +2659,9 @@ static void clearInputMasa( ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, -#ifdef NON_DIEGETIC_PAN const IVAS_REND_AudioConfig outConfig, const int16_t nonDiegeticPan, - const float nonDiegeticPanGain -#else - const IVAS_REND_AudioConfig outConfig -#endif -) + const float nonDiegeticPanGain ) { int16_t i; IVAS_REND_HANDLE hIvasRend; @@ -2750,10 +2731,8 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; -#ifdef NON_DIEGETIC_PAN hIvasRend->inputsIsm[i].nonDiegeticPan = nonDiegeticPan; hIvasRend->inputsIsm[i].nonDiegeticPanGain = nonDiegeticPanGain; -#endif } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) @@ -2763,10 +2742,8 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsMc[i].crendWrapper = NULL; hIvasRend->inputsMc[i].hReverb = NULL; hIvasRend->inputsMc[i].tdRendWrapper.hBinRendererTd = NULL; -#ifdef NON_DIEGETIC_PAN hIvasRend->inputsMc[i].nonDiegeticPan = nonDiegeticPan; hIvasRend->inputsMc[i].nonDiegeticPanGain = nonDiegeticPanGain; -#endif } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) @@ -3844,9 +3821,7 @@ int16_t IVAS_REND_FeedRenderConfig( mvr2r( renderConfig.room_acoustics.pFc_input, hRenderConfig->roomAcoustics.pFc_input, CLDFB_NO_CHANNELS_MAX ); mvr2r( renderConfig.room_acoustics.pAcoustic_rt60, hRenderConfig->roomAcoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( renderConfig.room_acoustics.pAcoustic_dsr, hRenderConfig->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); -#ifdef ISM_NON_DIEGETIC_PAN mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 ); -#endif return IVAS_ERR_OK; } @@ -4567,7 +4542,6 @@ static ivas_error renderIsmToMc( /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ if ( *ismInput->base.ctx.pOutConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) { -#ifdef NON_DIEGETIC_PAN if ( ismInput->nonDiegeticPan ) { previousPanGains[0] = currentPanGains[0] = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; @@ -4576,7 +4550,6 @@ static ivas_error renderIsmToMc( } else { -#endif set_zero( currentPanGains, 16 ); ivas_ism_get_stereo_gains( ismInput->currentPos.azimuth, ismInput->currentPos.elevation, @@ -4588,9 +4561,7 @@ static ivas_error renderIsmToMc( ismInput->previousPos.elevation, &previousPanGains[0], &previousPanGains[1] ); -#ifdef NON_DIEGETIC_PAN } -#endif } else { diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index aaec5f4658de01327280a70cdc19744a9a53afda..727a0d8928bbb18d67de68a351407aa85d4ea2f8 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -134,13 +134,9 @@ typedef uint16_t IVAS_REND_InputId; ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ -#ifdef NON_DIEGETIC_PAN const IVAS_REND_AudioConfig outConfig, /* i : output audio config */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain /* i : non-diegetic panning gain */ -#else - const IVAS_REND_AudioConfig outConfig /* i : output audio config */ -#endif ); /* Note: this will reset custom LFE routings set for any MC input */ diff --git a/lib_util/cmdln_parser.c b/lib_util/cmdln_parser.c index a239412f25f914b497ae1e053b1c94853f8fc1d5..6ac2b0ec2d0ebf5e58c7637c5c00e3e813dd4444 100644 --- a/lib_util/cmdln_parser.c +++ b/lib_util/cmdln_parser.c @@ -120,11 +120,7 @@ static int16_t initOpts( static int8_t stringLooksLikeOption( const char *str ) { -#ifdef NON_DIEGETIC_PAN if ( ( str[0] == '-' ) && is_number( str ) == false ) -#else - if ( str[0] == '-' ) -#endif { return 1; } @@ -135,11 +131,7 @@ static int8_t stringLooksLikeOption( static const char *stringToOptionName( const char *str ) { -#ifdef NON_DIEGETIC_PAN while ( ( *str == '-' ) && ( ( str[1] != '0' ) || ( str[1] != '1' ) ) ) -#else - while ( *str == '-' ) -#endif { ++str; } diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index add6a85a7a5534fcd03af8b90fea19ae3cbd6a89..7054d2081bc8b4f59ceef6574eb71efc08ac0dfd 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -35,14 +35,9 @@ #include #include -#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ -#ifdef ISM_NON_DIEGETIC_PAN -#define NUM_ISM_METADATA_PER_LINE 8 /* Number of ISM metadata per line in a metadata file */ -#define NUM_MIN_ISM_METADATA 1 /* Minimum number of metadata parameters (azimuth) */ -#else -#define NUM_ISM_METADATA_PER_LINE 7 /* Number of ISM metadata per line in a metadata file */ -#define NUM_MIN_ISM_METADATA 2 /* Minimum number of metadata parameters (azimuth and elevation) */ -#endif +#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */ +#define NUM_ISM_METADATA_PER_LINE 8 /* Number of ISM metadata per line in a metadata file */ +#define NUM_MIN_ISM_METADATA 1 /* Minimum number of metadata parameters (azimuth) */ struct IsmFileReader @@ -100,11 +95,7 @@ ivas_error IsmFileReader_readNextFrame( { char char_buff[META_LINE_LENGTH]; float meta_prm[NUM_ISM_METADATA_PER_LINE]; -#ifdef ISM_NON_DIEGETIC_PAN const float meta_prm_default[NUM_ISM_METADATA_PER_LINE] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f }; -#else - const float meta_prm_default[NUM_ISM_METADATA_PER_LINE] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f }; -#endif char *char_ptr; int16_t i; FILE *file; @@ -157,17 +148,13 @@ ivas_error IsmFileReader_readNextFrame( ismMetadata->gainFactor = meta_prm[4]; ismMetadata->yaw = meta_prm[5]; ismMetadata->pitch = meta_prm[6]; -#ifdef ISM_NON_DIEGETIC_PAN ismMetadata->non_diegetic_flag = (int16_t) meta_prm[7]; -#endif /* verify whether the read metadata values are in an expected range */ -#ifdef ISM_NON_DIEGETIC_PAN if ( ( ismMetadata->non_diegetic_flag ) != 0 && ( ismMetadata->non_diegetic_flag != 1 ) ) { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#endif if ( ismMetadata->azimuth > 180 || ismMetadata->azimuth < -180 ) { diff --git a/lib_util/ism_file_writer.c b/lib_util/ism_file_writer.c index 18571aa1504e536ad6a3722196d51287ead87720..470b02e698b61da0d4f3dbb375fcd6c312cfe9e0 100644 --- a/lib_util/ism_file_writer.c +++ b/lib_util/ism_file_writer.c @@ -114,11 +114,7 @@ ivas_error IsmFileWriter_writeFrame( file = ismWriter->file; /* IVAS_fmToDo: work in progress; currently position_azimuth, position_elevation, position_radius, spread, gain_factor */ -#ifdef ISM_NON_DIEGETIC_PAN snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f,%d\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch, ismMetadata.non_diegetic_flag ); -#else - snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch ); -#endif if ( file ) { fputs( char_buff, file );