Skip to content
Commits on Source (379)
......@@ -4,8 +4,8 @@ variables:
IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF main
include:
- local: .gitlab-ci/variables.yml
- local: .gitlab-ci/rules-basis.yml
- project: ivas-codec-pc/ivas-codec-ci
ref: *IVAS_CODEC_CI_REF
file: main-basop.yml
- local: .gitlab-ci/variables.yml
- local: .gitlab-ci/rules-basis.yml
......@@ -212,6 +212,7 @@
<ClCompile Include="..\lib_com\ivas_mdct_imdct_fx.c" />
<ClCompile Include="..\lib_com\ivas_mdft_imdft_fx.c" />
<ClCompile Include="..\lib_com\ivas_omasa_com_fx.c" />
<ClCompile Include="..\lib_com\ivas_osba_com_fx.c" />
<ClCompile Include="..\lib_com\ivas_pca_tools_fx.c" />
<ClCompile Include="..\lib_com\ivas_qmetadata_com_fx.c" />
<ClCompile Include="..\lib_com\ivas_qspherical_com_fx.c" />
......
......@@ -512,6 +512,7 @@
<Filter>common_ivas_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_com\ivas_rotation_com.c">
<ClCompile Include="..\lib_com\ivas_osba_com_fx.c">
<Filter>common_ivas_c</Filter>
</ClCompile>
</ItemGroup>
......
......@@ -124,7 +124,7 @@
<ItemGroup>
<ClCompile Include="..\lib_isar\isar_lcld_decoder.c" />
<ClCompile Include="..\lib_isar\isar_lcld_encoder.c" />
<ClCompile Include="..\lib_isar\isar_lcld_rom_tables.c" />
<ClCompile Include="..\lib_isar\isar_rom_lcld_tables.c" />
<ClCompile Include="..\lib_isar\isar_splitRend_lcld_enc.c" />
<ClCompile Include="..\lib_isar\isar_splitRend_lcld_dec.c" />
<ClCompile Include="..\lib_isar\isar_lc3plus_common.c" />
......@@ -150,7 +150,7 @@
<ClInclude Include="..\lib_isar\isar_prot.h" />
<ClInclude Include="..\lib_isar\isar_stat.h" />
<ClInclude Include="..\lib_isar\isar_cnst.h" />
<ClInclude Include="..\lib_isar\isar_lcld_rom_tables.h" />
<ClInclude Include="..\lib_isar\isar_rom_lcld_tables.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_common.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_dec.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_enc.h" />
......
......@@ -80,6 +80,18 @@ static
* Local structure for storing cmdln arguments
*------------------------------------------------------------------------------------------*/
#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
uint16_t *pID;
uint16_t *pValidity;
uint16_t count;
uint16_t selected;
uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif
typedef struct
{
char *inputBitstreamFilename;
......@@ -119,7 +131,11 @@ typedef struct
IVAS_DEC_COMPLEXITY_LEVEL complexityLevel;
bool tsmEnabled;
IVAS_RENDER_FRAMESIZE renderFramesize;
#ifdef FIX_1053_REVERB_RECONFIGURATION
AcousticEnvironmentSequence aeSequence;
#else
uint16_t acousticEnvironmentId;
#endif
int16_t Opt_dpid_on;
uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
......@@ -383,9 +399,14 @@ int main(
*------------------------------------------------------------------------------------------*/
asked_frame_size = arg.renderFramesize;
#ifdef FIX_1053_REVERB_RECONFIGURATION
uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;
if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain_fx,
arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain_fx,
arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
{
fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
......@@ -467,18 +488,30 @@ int main(
goto cleanup;
}
#ifdef CONF_DISTATT
if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK )
#else
if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
#endif
{
fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
goto cleanup;
}
#ifndef CONF_DISTATT
FOR( Word16 i = 0; i < 4; i++ )
{
renderConfig.directivity_fx[i * 3] = (Word16) ( renderConfig.directivity[i * 3] * ( 1u << 6 ) );
renderConfig.directivity_fx[i * 3 + 1] = (Word16) ( renderConfig.directivity[i * 3 + 1] * ( 1u << 6 ) );
renderConfig.directivity_fx[i * 3 + 2] = (Word16) ( renderConfig.directivity[i * 3 + 2] * ( ( 1u << 15 ) - 1 ) );
}
#endif
#ifdef CONF_DISTATT
if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt_fx ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
goto cleanup;
}
#endif
if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
......@@ -507,7 +540,11 @@ int main(
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
......@@ -517,7 +554,11 @@ int main(
}
else
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
#endif
goto cleanup;
}
renderConfig.roomAcoustics.override = true;
......@@ -715,6 +756,14 @@ cleanup:
free( pcmBuf );
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( arg.aeSequence.count > 0 )
{
free( arg.aeSequence.pID );
free( arg.aeSequence.pValidity );
}
#endif
if ( arg.hrtfReaderEnabled )
{
IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
......@@ -904,7 +953,15 @@ static bool parseCmdlIVAS_dec(
arg->non_diegetic_pan_gain = 0.f;
arg->tsmEnabled = false;
arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
#ifdef FIX_1053_REVERB_RECONFIGURATION
arg->aeSequence.count = 0;
arg->aeSequence.pID = NULL;
arg->aeSequence.pValidity = NULL;
arg->aeSequence.selected = 0;
arg->aeSequence.frameCounter = 0;
#else
arg->acousticEnvironmentId = 65535;
#endif
for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
{
arg->directivityPatternId[i] = 65535;
......@@ -1226,11 +1283,90 @@ static bool parseCmdlIVAS_dec(
if ( !is_digits_only( argv[i] ) )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
uint16_t k;
char *s = argv[i];
char *token = argv[i];
for ( k = 0; s[k]; )
{
s[k] == ',' ? k++ : *s++;
}
k++;
if ( k == 0 )
{
fprintf( stdout, "Error: Invalid acoustic environment sequence specified: %s\n\n", argv[i] );
usage_dec();
return false;
}
if ( NULL == ( arg->aeSequence.pID = malloc( sizeof( uint16_t ) * k ) ) ||
NULL == ( arg->aeSequence.pValidity = malloc( sizeof( uint16_t ) * k ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", argv[i] );
usage_dec();
return false;
}
arg->aeSequence.count = k;
k = 0;
token = strtok( argv[i++], ":" );
while ( token != NULL )
{
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, argv[i] );
usage_dec();
return false;
}
arg->aeSequence.pID[k] = (uint16_t) atoi( token );
token = strtok( NULL, "," );
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, argv[i] );
usage_dec();
return false;
}
arg->aeSequence.pValidity[k] = (uint16_t) atoi( token );
token = strtok( NULL, ":" );
k++;
}
if ( k != arg->aeSequence.count )
{
fprintf( stdout, "Error while parsing acoustic environment sequence: %s\n\n", argv[i] );
usage_dec();
return false;
}
#else
fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] );
usage_dec();
return false;
#endif
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
else
{
/* A single acoustic environment */
if ( NULL == ( arg->aeSequence.pID = malloc( sizeof( uint16_t ) ) ) ||
NULL == ( arg->aeSequence.pValidity = malloc( sizeof( uint16_t ) ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", argv[i] );
usage_dec();
return false;
}
arg->aeSequence.count = 1;
arg->aeSequence.pID[0] = (int16_t) atoi( argv[i++] );
arg->aeSequence.pValidity[0] = 0;
}
#else
arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
#endif
}
else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
{
......@@ -1454,7 +1590,15 @@ static void usage_dec( void )
fprintf( stdout, " output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
fprintf( stdout, " ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
fprintf( stdout, " otherwise a default directivity pattern is used.\n" );
#ifdef FIX_1053_REVERB_RECONFIGURATION
fprintf( stdout, "-aeid ID : Acoustic environment ID (number > 0) or\n" );
fprintf( stdout, " a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" );
fprintf( stdout, " without braces and spaces, with ':' character separating ID from duration and ',' separating\n" );
fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" );
fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" );
#else
fprintf( stdout, "-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
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" );
fprintf( stdout, "-q : Quiet mode, no frame counter\n" );
......@@ -1798,6 +1942,32 @@ static ivas_error decodeG192(
int16_t vec_pos_update, vec_pos_len;
SplitFileReadWrite *splitRendWriter = NULL;
#ifdef FIX_1053_REVERB_RECONFIGURATION
IVAS_RENDER_CONFIG_DATA renderConfig;
RenderConfigReader *renderConfigReader = NULL;
if ( arg.renderConfigEnabled )
{
if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
goto cleanup;
}
if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
}
if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
goto cleanup;
}
}
#endif
for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
{
ismWriters[i] = NULL;
......@@ -1964,6 +2134,38 @@ static ivas_error decodeG192(
{
if ( needNewFrame )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 )
{
if ( ++arg.aeSequence.frameCounter >= arg.aeSequence.pValidity[arg.aeSequence.selected] )
{
if ( ++arg.aeSequence.selected >= arg.aeSequence.count )
{
arg.aeSequence.selected = 0;
}
arg.aeSequence.frameCounter = 0;
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
fprintf( stderr, "Invalid acoustic environment configuratoin parameters\n\n" );
goto cleanup;
}
}
else
{
fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] );
goto cleanup;
}
if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
}
}
}
#endif
if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK )
{
if ( error == IVAS_ERR_END_OF_FILE )
......@@ -2351,6 +2553,10 @@ static ivas_error decodeG192(
cleanup:
#ifdef FIX_1053_REVERB_RECONFIGURATION
RenderConfigReader_close( &renderConfigReader );
#endif
split_rend_reader_writer_close( &splitRendWriter );
AudioFileWriter_close( &afWriter );
MasaFileWriter_close( &masaWriter );
......
......@@ -143,6 +143,17 @@ typedef struct
IVAS_CUSTOM_LS_DATA outSetupCustom;
} OutputConfig;
#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
uint16_t *pID;
uint16_t *pValidity;
uint16_t count;
uint16_t selected;
uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif
typedef struct
{
char executableName[RENDERER_MAX_CLI_ARG_LENGTH];
......@@ -178,7 +189,11 @@ typedef struct
float syncMdDelay;
IVAS_RENDER_FRAMESIZE render_framesize;
uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
#ifdef FIX_1053_REVERB_RECONFIGURATION
AcousticEnvironmentSequence aeSequence;
#else
uint16_t acousticEnvironmentId;
#endif
} CmdlnArgs;
typedef enum
......@@ -373,7 +388,11 @@ static const CmdLnParser_Option cliOptions[] = {
.id = CmdLnOptionId_acousticEnvironmentId,
.match = "acoustic_environment_id",
.matchShort = "aeid",
.description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output.",
#ifdef FIX_1053_REVERB_RECONFIGURATION
.description = "Acoustic environment ID( number > 0 ) or a sequence thereof in the format [ID1:duration1,ID2:duration2...] without braces and spaces, with ':' character separating ID from duration and ',' separating ID and duration pairs, where duration is specified in frames for BINAURAL_ROOM_REVERB output configuration.",
#else
.description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration",
#endif
},
};
......@@ -769,6 +788,9 @@ int main(
int16_t zeroPadToWrite = 0;
int32_t delayTimeScale = 0;
int16_t i, numChannels;
#ifdef FIX_1053_REVERB_RECONFIGURATION
uint16_t aeID;
#endif
ivas_error error = IVAS_ERR_OK;
#ifdef WMOPS
......@@ -1146,7 +1168,12 @@ int main(
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535;
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
......@@ -1156,7 +1183,11 @@ int main(
}
else
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
#endif
goto cleanup;
}
renderConfig.roomAcoustics.override = 1;
......@@ -1599,6 +1630,41 @@ int main(
num_in_channels = inBuffer.config.numChannels;
const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0;
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 )
{
if ( ++args.aeSequence.frameCounter >= args.aeSequence.pValidity[args.aeSequence.selected] )
{
IVAS_RENDER_CONFIG_DATA renderConfig;
if ( ++args.aeSequence.selected >= args.aeSequence.count )
{
args.aeSequence.selected = 0;
}
args.aeSequence.frameCounter = 0;
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.aeSequence.pID[args.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
fprintf( stderr, "Invalid acoustic environment configuratoin parameters\n\n" );
goto cleanup;
}
}
else
{
fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", args.aeSequence.pID[args.aeSequence.selected] );
goto cleanup;
}
if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed: %s\n\n", ivas_error_to_string( error ) );
goto cleanup;
}
}
}
#endif
numSamplesRead = 0;
/* Read the input data */
......@@ -2064,6 +2130,15 @@ cleanup:
{
free( bitsBufferData );
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( args.aeSequence.count > 0 )
{
free( args.aeSequence.pID );
free( args.aeSequence.pValidity );
}
#endif
for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
{
MasaFileReader_close( &masaReaders[i] );
......@@ -2530,6 +2605,93 @@ static bool parseLfePositionConfig(
return true;
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
static bool parseAcousticEnvironmentIds(
const char *value,
AcousticEnvironmentSequence *aeSequence )
{
uint16_t k;
char config_string[RENDERER_MAX_METADATA_LINE_LENGTH];
char *s;
char *token;
strncpy( config_string, value, RENDERER_MAX_METADATA_LINE_LENGTH );
s = config_string;
token = config_string;
if ( !is_digits_only( config_string ) )
{
for ( k = 0; s[k]; )
{
s[k] == ',' ? k++ : *s++;
}
k++;
if ( k == 0 )
{
fprintf( stdout, "Error: Invalid acoustic environment sequence specified: %s\n\n", config_string );
return false;
}
if ( NULL == ( aeSequence->pID = malloc( sizeof( uint16_t ) * k ) ) ||
NULL == ( aeSequence->pValidity = malloc( sizeof( uint16_t ) * k ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", config_string );
return false;
}
aeSequence->count = k;
k = 0;
token = strtok( config_string, ":" );
while ( token != NULL )
{
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, config_string );
return false;
}
aeSequence->pID[k] = (uint16_t) atoi( token );
token = strtok( NULL, "," );
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, config_string );
return false;
}
aeSequence->pValidity[k] = (uint16_t) atoi( token );
token = strtok( NULL, ":" );
k++;
}
if ( k != aeSequence->count )
{
fprintf( stdout, "Error while parsing acoustic environment sequence: %s\n\n", config_string );
return false;
}
}
else
{
/* A single acoustic environment */
if ( NULL == ( aeSequence->pID = malloc( sizeof( uint16_t ) ) ) ||
NULL == ( aeSequence->pValidity = malloc( sizeof( uint16_t ) ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", config_string );
return false;
}
aeSequence->count = 1;
aeSequence->pID[0] = (int16_t) atoi( config_string );
aeSequence->pValidity[0] = 0;
}
return true;
}
#endif
static bool checkRequiredArgs(
CmdlnArgs args )
......@@ -2637,7 +2799,15 @@ static CmdlnArgs defaultArgs(
args.directivityPatternId[i] = 65535;
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
args.aeSequence.count = 0;
args.aeSequence.pID = NULL;
args.aeSequence.pValidity = NULL;
args.aeSequence.selected = 0;
args.aeSequence.frameCounter = 0;
#else
args.acousticEnvironmentId = 65535;
#endif
return args;
}
......@@ -2807,12 +2977,19 @@ static void parseOption(
break;
case CmdLnOptionId_acousticEnvironmentId:
assert( numOptionValues == 1 );
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( !parseAcousticEnvironmentIds( optionValues[0], &args->aeSequence ) )
{
fprintf( stderr, "Invalid acoustic environment ID specified: %s\n", optionValues[0] );
}
#else
if ( !is_digits_only( optionValues[0] ) )
{
fprintf( stderr, "Invalid acousting environment ID specified: %s\n", optionValues[0] );
exit( -1 );
}
args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
#endif
break;
case CmdLnOptionId_syncMdDelay:
assert( numOptionValues == 1 );
......
......@@ -271,7 +271,11 @@ void tcx_arith_scale_envelope(
tmp2 = BASOP_Util_Add_MantExp( negate( b ), b_e, tmp, tmp2, &scale ); /* exp(scale) */
scale = BASOP_Util_Divide1616_Scale( scale, round_fx( a ), &tmp );
#ifdef ISSUE_1796_replace_shl_o
scale = shl_sat( scale, sub( sub( add( tmp, tmp2 ), a_e ), 1 ) ); /* Q15 */
#else
scale = shl_o( scale, sub( sub( add( tmp, tmp2 ), a_e ), 1 ), &Overflow ); /* Q15 */
#endif
/* iscale = 1.0f / scale; */
iscale_e = 0;
......
......@@ -1408,11 +1408,7 @@ Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, Word32 y, Word16 *s )
*s = 0;
return ( (Word32) 0 );
}
#ifdef FIX_USAN_BASOP_UTIL_DIVIDE3232
IF( EQ_32( y, (Word32) 0x80000000 ) )
#else
IF( EQ_32( y, 0x80000000 ) )
#endif
{
/* Division by -1.0: same as negation of numerator */
/* Return normalized negated numerator */
......
......@@ -245,9 +245,11 @@ Word16 BitAllocF_fx(
Word16 tmp, exp1, exp2;
Word32 Rsubband_w32_fx[NB_SFM]; /* Q15 */
Word16 B_w16_fx;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
Flag Overflow = 0;
move32();
#endif
#endif
set32_fx( Rsubband_w32_fx, 0, NB_SFM );
......@@ -442,7 +444,11 @@ Word16 BitAllocF_fx(
exp1 = sub( norm_l( L_tmp2 ), 1 );
exp2 = norm_s( n );
tmp = div_s( extract_h( L_shl( L_tmp2, exp1 ) ), shl( n, exp2 ) ); /*15 + 15 + exp1 - 16 - exp2*/
#ifdef ISSUE_1796_replace_shl_o
m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/
#else
m_fx = shl_o( tmp, sub( exp2, exp1 ), &Overflow ); /*Q14*/
#endif
if ( L_tmp1 < 0 )
{
m_fx = negate( m_fx );
......
......@@ -893,7 +893,11 @@ ivas_error check_ind_list_limits(
}
ELSE
{
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#ifdef DEBUGGING
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", frame, hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#else
return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#endif
}
}
......@@ -2799,7 +2803,11 @@ ivas_error push_indice(
/* check the limits of the list of indices */
IF( NE_32( ( error = check_ind_list_limits( hBstr ) ), IVAS_ERR_OK ) )
{
return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n" );
#ifdef DEBUGGING
return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame );
#else
return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices!\n" );
#endif
}
/* find the location in the list of indices based on ID */
......@@ -2957,7 +2965,11 @@ ivas_error push_next_bits(
/* check the limits of the list of indices */
IF( NE_32( ( error = check_ind_list_limits( hBstr ) ), IVAS_ERR_OK ) )
{
return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n" );
#ifdef DEBUGGING
return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
#else
return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" );
#endif
}
ptr = &hBstr->ind_list[hBstr->nb_ind_tot];
......@@ -2981,7 +2993,11 @@ ivas_error push_next_bits(
/* check the limits of the list of indices */
IF( NE_32( ( error = check_ind_list_limits( hBstr ) ), IVAS_ERR_OK ) )
{
return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n" );
#ifdef DEBUGGING
return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
#else
return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" );
#endif
}
ptr = &hBstr->ind_list[hBstr->nb_ind_tot];
......@@ -3127,31 +3143,6 @@ UWord16 get_next_indice(
return value;
}
/*-------------------------------------------------------------------*
* get_next_indice_1()
*
* Get the next 1-bit indice from the buffer
*-------------------------------------------------------------------*/
/*! r: value of the indice */
UWord16 get_next_indice_1(
Decoder_State *st /* i/o: decoder state structure */
)
{
Word32 nbits_total;
nbits_total = st->total_brate / FRAMES_PER_SEC;
/* detect corrupted bitstream */
if ( ( st->next_bit_pos + 1 > nbits_total && st->codec_mode == MODE1 ) ||
( ( st->next_bit_pos + 1 > nbits_total + ( 2 * 8 ) ) && st->codec_mode == MODE2 ) /* add two zero bytes for arithmetic coder flush */
)
{
st->BER_detect = 1;
return ( 0 );
}
return st->bit_stream[st->next_bit_pos++];
}
/*-------------------------------------------------------------------*
* get_next_indice_tmp()
*
......
......@@ -327,42 +327,6 @@ void get_next_indice_tmp_fx(
move16();
}
/*-------------------------------------------------------------------*
* get_indice_fx( )
*
* Get indice at specific position in the buffer
*-------------------------------------------------------------------*/
UWord16 get_indice_fx( /* o : value of the indice */
Decoder_State *st_fx, /* i/o: decoder state structure */
Word16 pos, /* i : absolute position in the bitstream (update after the read) */
Word16 nb_bits /* i : number of bits that were used to quantize the indice */
)
{
UWord16 value;
Word16 i;
assert( nb_bits <= 16 );
/* detect corrupted bitstream */
IF( GT_16( add( pos, nb_bits ), st_fx->total_num_bits ) )
{
st_fx->BER_detect = 1;
move16();
return ( 0 );
}
value = 0;
move16();
FOR( i = 0; i < nb_bits; i++ )
{
value = lshl( value, 1 );
value = add( value, st_fx->bit_stream[pos + i] );
}
return value;
}
/*-------------------------------------------------------------------*
* get_indice_1_fx( )
*
......@@ -413,179 +377,6 @@ void reset_indices_enc_fx(
return;
}
/*-------------------------------------------------------------------*
* reset_indices_dec_fx()
*
* Reset the buffer of decoder indices
*-------------------------------------------------------------------*/
void reset_indices_dec_fx(
Decoder_State *st_fx )
{
st_fx->next_bit_pos = 0;
move16();
return;
}
/*-------------------------------------------------------------------*
* write_indices_fx()
*
* Write the buffer of indices to a file
*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*
* write_indices_buf_fx()
*
* Write the buffer of indices to a file
*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*
* indices_to_serial()
*
* pack indices into serialized payload format
*-------------------------------------------------------------------*/
void indices_to_serial(
const Encoder_State *st_fx, /* i: encoder state structure */
BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
UWord8 *pFrame, /* o: byte array with bit packet and byte aligned coded speech data */
Word16 *pFrame_size /* o: size of the binary encoded access unit [bits] */
)
{
Word16 i, k, j;
Word16 cmi = 0, core_mode = 0;
Word32 mask;
Word16 amrwb_bits[( ACELP_23k85 / 50 )];
UWord8 omask = 0x80;
UWord8 *pt_pFrame = pFrame;
Word16 isAmrWb = 0;
move16();
move16();
move16();
move16();
IF( st_fx->Opt_AMR_WB )
{
cmi = rate2EVSmode( st_fx->total_brate, &isAmrWb );
core_mode = rate2EVSmode( L_mult0( hBstr->nb_bits_tot, 50 ), &isAmrWb );
j = 0;
move16();
FOR( i = 0; i < MAX_NUM_INDICES; i++ )
{
IF( NE_16( hBstr->ind_list[i].nb_bits, -1 ) )
{
/* mask from MSB to LSB */
mask = L_shl( 1, sub( hBstr->ind_list[i].nb_bits, 1 ) );
/* temporarily save bit */
FOR( k = 0; k < hBstr->ind_list[i].nb_bits; k++ )
{
amrwb_bits[j++] = L_and( hBstr->ind_list[i].value, mask ) > 0;
move16();
mask = L_shr( mask, 1 );
}
}
}
}
*pFrame_size = hBstr->nb_bits_tot;
move16();
/*----------------------------------------------------------------*
* Bitstream packing (conversion of individual indices into a serial stream)
*----------------------------------------------------------------*/
j = 0;
move16();
FOR( i = 0; i < MAX_NUM_INDICES; i++ )
{
IF( NE_16( hBstr->ind_list[i].nb_bits, -1 ) )
{
/* mask from MSB to LSB */
mask = L_shl( 1, sub( hBstr->ind_list[i].nb_bits, 1 ) );
/* write bit by bit */
FOR( k = 0; k < hBstr->ind_list[i].nb_bits; k++ )
{
IF( st_fx->Opt_AMR_WB )
{
pack_bit( amrwb_bits[sort_ptr[core_mode][j++]], &pt_pFrame, &omask );
}
ELSE
{
pack_bit( hBstr->ind_list[i].value & mask, &pt_pFrame, &omask );
j = add( j, 1 );
}
mask = L_shr( mask, 1 );
}
}
}
test();
IF( st_fx->Opt_AMR_WB && EQ_16( core_mode, AMRWB_IO_SID ) ) /* SID UPD frame always written now .... */
{
/* insert STI bit and CMI */
pack_bit( 1, &pt_pFrame, &omask );
FOR( mask = 0x08; mask > 0; mask >>= 1 )
{
pack_bit( cmi & mask, &pt_pFrame, &omask );
}
}
}
/*-------------------------------------------------------------------*
* indices_to_serial_generic()
*
* pack indices into serialized payload format
*-------------------------------------------------------------------*/
void indices_to_serial_generic(
const Indice *ind_list, /* i: indices list */
const Word16 num_indices, /* i: number of indices to write */
UWord8 *pFrame, /* o: byte array with bit packet and byte aligned coded speech data */
Word16 *pFrame_size /* i/o: number of bits in the binary encoded access unit [bits] */
)
{
Word16 i, k, j;
Word32 mask;
UWord8 omask;
UWord8 *pt_pFrame = pFrame;
Word16 nb_bits_tot;
nb_bits_tot = 0;
move16();
omask = (UWord8) shr( 0x80, s_and( *pFrame_size, 0x7 ) );
move16();
pt_pFrame += shr( *pFrame_size, 3 );
/*----------------------------------------------------------------*
* Bitstream packing (conversion of individual indices into a serial stream)
*----------------------------------------------------------------*/
j = 0;
move16();
FOR( i = 0; i < num_indices; i++ ){
IF( NE_16( ind_list[i].nb_bits, -1 ) ){
/* mask from MSB to LSB */
mask = L_shl( 1, sub( ind_list[i].nb_bits, 1 ) );
/* write bit by bit */
FOR( k = 0; k < ind_list[i].nb_bits; k++ )
{
pack_bit( ind_list[i].value & mask, &pt_pFrame, &omask );
j = add( j, 1 );
mask = L_shr( mask, 1 );
}
nb_bits_tot = add( nb_bits_tot, ind_list[i].nb_bits );
}
}
*pFrame_size = add( *pFrame_size, nb_bits_tot );
move16();
return;
}
static void dec_prm_core( Decoder_State *st )
{
......
......@@ -1329,7 +1329,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead)
{
FOR( j = 20; j < numberBandsM; j++ )
{
#ifdef ISSUE_1799_replace_L_shr_o
nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
}
}
......@@ -1352,7 +1356,11 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead)
{
FOR( j = 20; j < numberBandsM; j++ )
{
#ifdef ISSUE_1799_replace_L_shr_o
nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
}
}
......
......@@ -104,12 +104,7 @@ void cldfbAnalysis_ivas_fx(
Word32 iBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX];
const Word32 *rot_vctr_re_fx;
const Word32 *rot_vctr_im_fx;
#ifdef OPT_IVAS_FILTER_ROM
const Word32 *ptr_pf_fx;
#else /* OPT_IVAS_FILTER_ROM */
const Word16 *ptr_pf_fx;
Word16 ptr_pf_sf;
#endif /* OPT_IVAS_FILTER_ROM */
Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )];
Word16 offset, frameSize;
......@@ -151,12 +146,7 @@ void cldfbAnalysis_ivas_fx(
rot_vctr_re_fx = h_cldfb->rot_vec_ana_re_fx;
rot_vctr_im_fx = h_cldfb->rot_vec_ana_im_fx;
#ifdef OPT_IVAS_FILTER_ROM
ptr_pf_fx = h_cldfb->p_filter_32;
#else /* OPT_IVAS_FILTER_ROM */
ptr_pf_fx = h_cldfb->p_filter;
ptr_pf_sf = h_cldfb->p_filter_sf; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
FOR( i = 0; i < no_col; i++ )
......@@ -164,7 +154,6 @@ void cldfbAnalysis_ivas_fx(
FOR( k = 0; k < M4; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx
......@@ -189,36 +178,6 @@ void cldfbAnalysis_ivas_fx(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // Qx
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // Qx - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // Qx - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // Qx - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // Qx - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_sub( r1_fx, r2_fx ); // Qx - 1
......@@ -242,7 +201,6 @@ void cldfbAnalysis_ivas_fx(
FOR( k = M4; k < M2; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx
......@@ -266,36 +224,6 @@ void cldfbAnalysis_ivas_fx(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // Qx - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // Qx - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // Qx - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // Qx - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_add( r1_fx, r2_fx ); // Qx - 1
......@@ -384,12 +312,7 @@ void cldfbAnalysis_ts_fx(
const Word32 *rot_vctr_im_fx;
const Word32 *rot_vctr_delay_re_fx;
const Word32 *rot_vctr_delay_im_fx;
#ifdef OPT_IVAS_FILTER_ROM
const Word32 *ptr_pf_fx;
#else /* OPT_IVAS_FILTER_ROM */
const Word16 *ptr_pf_fx;
Word16 ptr_pf_sf;
#endif /* OPT_IVAS_FILTER_ROM */
Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )];
Word16 offset, frameSize;
......@@ -436,12 +359,7 @@ void cldfbAnalysis_ts_fx(
rot_vctr_delay_re_fx = h_cldfb->rot_vec_ana_delay_re_fx; // q = 31
rot_vctr_delay_im_fx = h_cldfb->rot_vec_ana_delay_im_fx; // q = 31
#ifdef OPT_IVAS_FILTER_ROM
ptr_pf_fx = h_cldfb->p_filter_32;
#else /* OPT_IVAS_FILTER_ROM */
ptr_pf_fx = h_cldfb->p_filter;
ptr_pf_sf = h_cldfb->p_filter_sf; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
FOR( i = 0; i < no_col; i++ )
......@@ -449,7 +367,6 @@ void cldfbAnalysis_ts_fx(
FOR( k = 0; k < M4; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[L2 - M2 - 1 - ( 2 * k ) + 0 * L2] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
......@@ -473,36 +390,6 @@ void cldfbAnalysis_ts_fx(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[L2 - M2 - 1 - ( 2 * k ) + 0 * L2] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // q
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_sub( r1_fx, r2_fx ); // q -1
......@@ -526,7 +413,6 @@ void cldfbAnalysis_ts_fx(
FOR( k = M4; k < M2; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
......@@ -550,36 +436,6 @@ void cldfbAnalysis_ts_fx(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_add( r1_fx, r2_fx ); // q - 1
......@@ -727,12 +583,7 @@ void cldfbAnalysis_ts_fx_var_q(
const Word32 *rot_vctr_im_fx;
const Word32 *rot_vctr_delay_re_fx;
const Word32 *rot_vctr_delay_im_fx;
#ifdef OPT_IVAS_FILTER_ROM
const Word32 *ptr_pf_fx;
#else /* OPT_IVAS_FILTER_ROM */
const Word16 *ptr_pf_fx;
Word16 ptr_pf_sf;
#endif /* OPT_IVAS_FILTER_ROM */
Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )];
Word16 offset, frameSize;
......@@ -796,12 +647,7 @@ void cldfbAnalysis_ts_fx_var_q(
rot_vctr_delay_re_fx = h_cldfb->rot_vec_ana_delay_re_fx; // q = 31
rot_vctr_delay_im_fx = h_cldfb->rot_vec_ana_delay_im_fx; // q = 31
#ifdef OPT_IVAS_FILTER_ROM
ptr_pf_fx = h_cldfb->p_filter_32;
#else /* OPT_IVAS_FILTER_ROM */
ptr_pf_fx = h_cldfb->p_filter;
ptr_pf_sf = h_cldfb->p_filter_sf; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
FOR( i = 0; i < no_col; i++ )
......@@ -809,7 +655,6 @@ void cldfbAnalysis_ts_fx_var_q(
FOR( k = 0; k < M4; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
......@@ -833,36 +678,6 @@ void cldfbAnalysis_ts_fx_var_q(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // q
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_sub( r1_fx, r2_fx ); // q -1
......@@ -886,7 +701,6 @@ void cldfbAnalysis_ts_fx_var_q(
FOR( k = M4; k < M2; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
......@@ -911,36 +725,6 @@ void cldfbAnalysis_ts_fx_var_q(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_add( r1_fx, r2_fx ); // q - 1
......@@ -1059,12 +843,7 @@ void cldfbAnalysis_ts_fx_fixed_q(
const Word32 *rot_vctr_im_fx;
const Word32 *rot_vctr_delay_re_fx;
const Word32 *rot_vctr_delay_im_fx;
#ifdef OPT_IVAS_FILTER_ROM
const Word32 *ptr_pf_fx;
#else /* OPT_IVAS_FILTER_ROM */
const Word16 *ptr_pf_fx;
Word16 ptr_pf_sf;
#endif /* OPT_IVAS_FILTER_ROM */
Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )];
Word16 offset, frameSize, gb, hr, shift;
......@@ -1110,12 +889,7 @@ void cldfbAnalysis_ts_fx_fixed_q(
rot_vctr_delay_re_fx = h_cldfb->rot_vec_ana_delay_re_fx; // q = 31
rot_vctr_delay_im_fx = h_cldfb->rot_vec_ana_delay_im_fx; // q = 31
#ifdef OPT_IVAS_FILTER_ROM
ptr_pf_fx = h_cldfb->p_filter_32;
#else /* OPT_IVAS_FILTER_ROM */
ptr_pf_fx = h_cldfb->p_filter;
ptr_pf_sf = h_cldfb->p_filter_sf; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
FOR( i = 0; i < no_col; i++ )
......@@ -1123,7 +897,6 @@ void cldfbAnalysis_ts_fx_fixed_q(
FOR( k = 0; k < M4; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
......@@ -1147,36 +920,6 @@ void cldfbAnalysis_ts_fx_fixed_q(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // q
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_sub( r1_fx, r2_fx ); // q -1
......@@ -1200,7 +943,6 @@ void cldfbAnalysis_ts_fx_fixed_q(
FOR( k = M4; k < M2; k++ )
{
/* prototype filter */
#ifdef OPT_IVAS_FILTER_ROM
r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
......@@ -1224,36 +966,6 @@ void cldfbAnalysis_ts_fx_fixed_q(
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
#else /* OPT_IVAS_FILTER_ROM */
r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
r2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
r2_fx = Msub_32_16( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
i1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q
i1_fx = Msub_32_16( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q
i2_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q
i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q
r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1
r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1
i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1
i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1
#endif /* OPT_IVAS_FILTER_ROM */
/* folding + pre modulation of DST IV */
rr12_fx = L_add( r1_fx, r2_fx ); // q - 1
......@@ -1409,12 +1121,7 @@ void cldfbSynthesis_ivas_fx(
Word32 new_samples_fx[2 * CLDFB_NO_CHANNELS_MAX];
Word32 *ptr_time_out_fx;
#ifdef OPT_IVAS_FILTER_ROM
const Word32 *p_filter_32;
#else /* OPT_IVAS_FILTER_ROM */
const Word16 *p_filter;
Word16 p_filter_sf;
#endif /* OPT_IVAS_FILTER_ROM */
Word32 accu0, accu1, accu2, accu3, accu4;
Word16 no_col = h_cldfb->no_col;
......@@ -1444,12 +1151,7 @@ void cldfbSynthesis_ivas_fx(
synthesisBuffer_fx = buffer_fx;
Copy32( h_cldfb->cldfb_state_fx, synthesisBuffer_fx + i_mult( M1, no_col ), h_cldfb->p_filter_length );
#ifdef OPT_IVAS_FILTER_ROM
p_filter_32 = h_cldfb->p_filter_32;
#else /* OPT_IVAS_FILTER_ROM */
p_filter = h_cldfb->p_filter;
p_filter_sf = h_cldfb->p_filter_sf; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
ptr_time_out_fx = timeOut_fx;
/*synthesisBuffer += M1 * h_cldfb->no_col;*/
......@@ -1560,19 +1262,11 @@ void cldfbSynthesis_ivas_fx(
{
FOR( i = 0; i < L2; i++ )
{
#ifdef OPT_IVAS_FILTER_ROM
accu0 = Madd_32_32( synthesisBuffer_fx[i], new_samples_fx[L2 - 1 - i], p_filter_32[i] ); // Qx - 1
accu1 = Madd_32_32( synthesisBuffer_fx[1 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 1 * L2 + i )] ); // Qx - 1
accu2 = Madd_32_32( synthesisBuffer_fx[2 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 2 * L2 + i )] ); // Qx - 1
accu3 = Madd_32_32( synthesisBuffer_fx[3 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 3 * L2 + i )] ); // Qx - 1
accu4 = Madd_32_32( synthesisBuffer_fx[4 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 4 * L2 + i )] ); // Qx - 1
#else /* OPT_IVAS_FILTER_ROM */
accu0 = Madd_32_16( synthesisBuffer_fx[i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[i] ), p_filter_sf ); // Qx - 1
accu1 = Madd_32_16( synthesisBuffer_fx[1 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 1 * L2 + i )] ), p_filter_sf ); // Qx - 1
accu2 = Madd_32_16( synthesisBuffer_fx[2 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 2 * L2 + i )] ), p_filter_sf ); // Qx - 1
accu3 = Madd_32_16( synthesisBuffer_fx[3 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 3 * L2 + i )] ), p_filter_sf ); // Qx - 1
accu4 = Madd_32_16( synthesisBuffer_fx[4 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 4 * L2 + i )] ), p_filter_sf ); // Qx - 1
#endif /* OPT_IVAS_FILTER_ROM */
synthesisBuffer_fx[i] = accu0;
move32();
......@@ -1591,21 +1285,12 @@ void cldfbSynthesis_ivas_fx(
FOR( i = 0; i < L2; i++ )
{
#ifdef OPT_IVAS_FILTER_ROM
Word32 prod = L_shl_sat( ( new_samples_fx[L2 - 1 - i] ), shift );
accu0 = Madd_32_32( synthesisBuffer_fx[i], prod, p_filter_32[i] ); // Qx -1 + shift
accu1 = Madd_32_32( synthesisBuffer_fx[1 * L2 + i], prod, p_filter_32[( 1 * L2 + i )] ); // Qx -1 + shift
accu2 = Madd_32_32( synthesisBuffer_fx[2 * L2 + i], prod, p_filter_32[( 2 * L2 + i )] ); // Qx -1 + shift
accu3 = Madd_32_32( synthesisBuffer_fx[3 * L2 + i], prod, p_filter_32[( 3 * L2 + i )] ); // Qx -1 + shift
accu4 = Madd_32_32( synthesisBuffer_fx[4 * L2 + i], prod, p_filter_32[( 4 * L2 + i )] ); // Qx -1 + shift
#else /* OPT_IVAS_FILTER_ROM */
Word32 prod = L_shl_sat( Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter_sf ), shift );
accu0 = Madd_32_16( synthesisBuffer_fx[i], prod, p_filter[i] ); // Qx -1 + shift
accu1 = Madd_32_16( synthesisBuffer_fx[1 * L2 + i], prod, p_filter[( 1 * L2 + i )] ); // Qx -1 + shift
accu2 = Madd_32_16( synthesisBuffer_fx[2 * L2 + i], prod, p_filter[( 2 * L2 + i )] ); // Qx -1 + shift
accu3 = Madd_32_16( synthesisBuffer_fx[3 * L2 + i], prod, p_filter[( 3 * L2 + i )] ); // Qx -1 + shift
accu4 = Madd_32_16( synthesisBuffer_fx[4 * L2 + i], prod, p_filter[( 4 * L2 + i )] ); // Qx -1 + shift
#endif /* OPT_IVAS_FILTER_ROM */
synthesisBuffer_fx[i] = accu0;
move32();
......@@ -1905,7 +1590,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e
{
FOR( j = 20; j < numberBandsM; j++ )
{
#ifdef ISSUE_1799_replace_L_shr_o
nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
}
}
......@@ -1928,7 +1617,11 @@ static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_e
{
FOR( j = 20; j < numberBandsM; j++ )
{
#ifdef ISSUE_1799_replace_L_shr_o
nrg = L_add_o( nrg, L_shr_sat( energyValues[k][j], s ), &Overflow );
#else
nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow );
#endif
}
}
......@@ -2074,12 +1767,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_10_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17036; // Q14
hs->p_filter = CLDFB80_10_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_10_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2090,12 +1778,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_10_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15388; // Q14
hs->p_filter = LDQMF_10_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_10_SCALE_FX_Q8;
}
BREAK;
......@@ -2113,12 +1796,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_16_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17051; // Q14
hs->p_filter = CLDFB80_16_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_16_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2129,12 +1807,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_16_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15388; // Q14
hs->p_filter = LDQMF_16_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_16_SCALE_FX_Q8;
}
BREAK;
......@@ -2152,12 +1825,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_20_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17050; // Q14
hs->p_filter = CLDFB80_20_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_20_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2168,12 +1836,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_20_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15390; // Q14
hs->p_filter = LDQMF_20_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_20_SCALE_FX_Q8;
}
BREAK;
......@@ -2191,12 +1854,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_30_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17051; // Q14
hs->p_filter = CLDFB80_30_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_30_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2207,12 +1865,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_30_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15388; // Q14
hs->p_filter = LDQMF_30_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_30_SCALE_FX_Q8;
}
BREAK;
......@@ -2230,12 +1883,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_32_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17050; // Q14
hs->p_filter = CLDFB80_32_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_32_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2246,12 +1894,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_32_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15392; // Q14
hs->p_filter = LDQMF_32_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_32_SCALE_FX_Q8;
}
BREAK;
......@@ -2269,12 +1912,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_40_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17051; // Q14
hs->p_filter = CLDFB80_40_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_40_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2285,12 +1923,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_40_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15391; // Q14
hs->p_filter = LDQMF_40_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_40_SCALE_FX_Q8;
}
BREAK;
......@@ -2308,12 +1941,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_60_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17051; // Q14
hs->p_filter = CLDFB80_60_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = CLDFB80_60_SCALE_FX_Q8;
}
ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
......@@ -2324,12 +1952,7 @@ static void cldfb_init_proto_and_twiddles(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_60_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15391; // Q14
hs->p_filter = LDQMF_60_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = LDQMF_60_SCALE_FX_Q8;
}
BREAK;
......@@ -2379,12 +2002,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->scale = cldfb_scale_2_5ms[0];
move16();
move16();
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_10_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17036; // Q14
hs->p_filter = CLDFB80_10_fx;
#endif /* OPT_IVAS_FILTER_ROM */
}
ELSE IF( EQ_16( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
{
......@@ -2396,12 +2014,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_10_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15388; // Q14
hs->p_filter = LDQMF_10_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_5_0ms[0];
move16();
move16();
......@@ -2429,12 +2042,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_16_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17051; // Q14
hs->p_filter = CLDFB80_16_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_2_5ms[1];
move16();
move16();
......@@ -2449,12 +2057,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_16_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15388; // Q14
hs->p_filter = LDQMF_16_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_5_0ms[1];
move16();
move16();
......@@ -2489,12 +2092,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_20_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17050; // Q14
hs->p_filter = CLDFB80_20_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_2_5ms[2];
move16();
move16();
......@@ -2509,12 +2107,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_20_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15390; // Q14
hs->p_filter = LDQMF_20_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_5_0ms[2];
move16();
move16();
......@@ -2549,12 +2142,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->scale = cldfb_scale_2_5ms[6];
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_30_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter = CLDFB80_30_fx;
hs->p_filter_sf = (Word16) 17051; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
}
ELSE IF( EQ_16( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) )
{
......@@ -2567,12 +2155,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->scale = cldfb_scale_5_0ms[6];
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_30_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter = LDQMF_30_fx;
hs->p_filter_sf = (Word16) 15388; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
move16();
}
......@@ -2599,12 +2182,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_32_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17050; // Q14
hs->p_filter = CLDFB80_32_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_2_5ms[3];
move16();
move16();
......@@ -2620,12 +2198,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->scale = cldfb_scale_5_0ms[3];
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_32_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter = LDQMF_32_fx;
hs->p_filter_sf = (Word16) 15392; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
move16();
}
......@@ -2659,12 +2232,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
hs->scale = cldfb_scale_2_5ms[4];
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_40_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter = CLDFB80_40_fx;
hs->p_filter_sf = (Word16) 17051; // Q14
#endif /* OPT_IVAS_FILTER_ROM */
move16();
move16();
}
......@@ -2678,12 +2246,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_40_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15391; // Q14
hs->p_filter = LDQMF_40_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_5_0ms[4];
move16();
move16();
......@@ -2717,12 +2280,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = NULL;
hs->rot_vec_syn_delay_re_fx = NULL;
hs->rot_vec_syn_delay_im_fx = NULL;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = CLDFB80_60_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 17051; // Q14
hs->p_filter = CLDFB80_60_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_2_5ms[5];
move16();
move16();
......@@ -2737,12 +2295,7 @@ static void cldfb_init_proto_and_twiddles_enc_fx(
hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx;
hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx;
#ifdef OPT_IVAS_FILTER_ROM
hs->p_filter_32 = LDQMF_60_fx;
#else /* OPT_IVAS_FILTER_ROM */
hs->p_filter_sf = (Word16) 15391; // Q14
hs->p_filter = LDQMF_60_fx;
#endif /* OPT_IVAS_FILTER_ROM */
hs->scale = cldfb_scale_5_0ms[5];
move16();
move16();
......
......@@ -904,7 +904,11 @@ void cng_params_upd_fx(
tmpv = shl( *pt_exc2, scale );
L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#else
L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#endif
}
}
ELSE /* L_FRAME16k */
......@@ -917,10 +921,18 @@ void cng_params_upd_fx(
tmpv = shl( *pt_exc2, scale );
L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#else
L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#endif
}
}
#ifdef ISSUE_1799_replace_L_shr_o
L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#else
L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#endif
/* update the circular buffer of old energies */
ho_ener_circ[*ho_circ_ptr] = L_ener;
......@@ -1082,7 +1094,11 @@ void cng_params_upd_ivas_fx(
tmpv = shl( *pt_exc2, scale );
L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
L_ener = L_add_o( L_ener, L_shr_sat( L_tmp, 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#else
L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */
#endif
}
}
ELSE /* L_FRAME16k */
......@@ -1095,10 +1111,18 @@ void cng_params_upd_ivas_fx(
tmpv = shl( *pt_exc2, scale );
L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow );
pt_exc2++;
#ifdef ISSUE_1799_replace_L_shr_o
L_ener = L_add_o( L_ener, L_shr_sat( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#else
L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */
#endif
}
}
#ifdef ISSUE_1799_replace_L_shr_o
L_ener = L_shr_sat( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#else
L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */
#endif
/* update the circular buffer of old energies */
ho_ener_circ[*ho_circ_ptr] = L_ener;
......@@ -1137,7 +1161,11 @@ void cng_params_upd_ivas_fx(
L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */
L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */
tmp = add( add( Q_exc, Q_exc ), 1 );
#ifdef ISSUE_1799_replace_L_shr_o
sp[i] = L_shr_sat( L_tmp, sub( tmp, 6 ) );
#else
sp[i] = L_shr_o( L_tmp, sub( tmp, 6 ), &Overflow );
#endif
move32(); /* Q6 */
ptR++;
ptI--;
......
......@@ -788,9 +788,7 @@ enum
#define L_HP20_MEM 4 /* HP20 filter memory length */
#define CLDFB_NO_CHANNELS_MAX 60 /* CLDFB resampling - max number of CLDFB channels, == IVAS_CLDFB_NO_CHANNELS_MAX */
#ifdef FIX_867_CLDFB_NRG_SCALE
#define CLDFB_NO_CHANNELS_HALF 30 /* CLDFB resampling - max number of CLDFB channels, == IVAS_CLDFB_NO_CHANNELS_MAX */
#endif
#define CLDFB_NO_CHANNELS_MAX_FX 30720 /*Q9*/
#define CLDFB_NO_COL_MAX 16 /* CLDFB resampling - max number of CLDFB col., == IVAS_CLDFB_NO_COL_MAX */
#define CLDFB_NO_COL_MAX_LOG2 4 /* To be used for shift operation instead of division */
......
......@@ -61,9 +61,11 @@ void tcxFormantEnhancement(
Word16 i, j, k, l, n;
Word16 fac, fac0, fac1, fac_e, d, tmp;
Word16 xn_buf_e, xn_one, m, e;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
Flag Overflow = 0;
move32();
#endif
#endif
k = shr( L_frame, 6 ); /* FDNS_NPTS = 64 */
......@@ -139,7 +141,11 @@ void tcxFormantEnhancement(
{
fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) );
BASOP_SATURATE_WARNING_OFF_EVS;
#ifdef ISSUE_1796_replace_shl_o
xn_buf[l + j] = s_min( xn_one, shl_sat( mult( xn_buf[l + j], fac ), fac_e ) );
#else
xn_buf[l + j] = s_min( xn_one, shl_o( mult( xn_buf[l + j], fac ), fac_e, &Overflow ) );
#endif
move16();
BASOP_SATURATE_WARNING_ON_EVS;
}
......@@ -227,9 +233,11 @@ void tcxFormantEnhancement_with_shift(
Word16 i, j, k, l, n;
Word16 fac, fac0, fac1, fac_e, d, tmp;
Word16 xn_buf_e, xn_one, m, e;
#ifndef ISSUE_1796_replace_shl_o
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
Flag Overflow = 0;
move32();
#endif
#endif
k = shr( L_frame, 6 ); /* FDNS_NPTS = 64 */
......@@ -309,7 +317,11 @@ void tcxFormantEnhancement_with_shift(
{
fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) );
BASOP_SATURATE_WARNING_OFF_EVS;
#ifdef ISSUE_1796_replace_shl_o
xn_buf[l + j] = s_min( xn_one, shl_sat( mult( xn_buf[l + j], fac ), fac_e ) );
#else
xn_buf[l + j] = s_min( xn_one, shl_o( mult( xn_buf[l + j], fac ), fac_e, &Overflow ) );
#endif
move16();
BASOP_SATURATE_WARNING_ON_EVS;
}
......@@ -354,7 +366,11 @@ void tcxFormantEnhancement_with_shift(
{
fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) );
BASOP_SATURATE_WARNING_OFF_EVS;
#ifdef ISSUE_1796_replace_shl_o
xn_buf[l + j] = s_min( xn_one, shl_sat( mult( xn_buf[l + j], fac ), fac_e ) );
#else
xn_buf[l + j] = s_min( xn_one, shl_o( mult( xn_buf[l + j], fac ), fac_e, &Overflow ) );
#endif
move16();
BASOP_SATURATE_WARNING_ON_EVS;
}
......
......@@ -347,6 +347,10 @@ typedef struct _IVAS_RENDER_CONFIG
ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
float directivity[IVAS_MAX_NUM_OBJECTS * 3];
Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15}
#ifdef CONF_DISTATT
float distAtt[3];
Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;
typedef struct
......
......@@ -197,11 +197,7 @@ void E_UTIL_deemph2( Word16 shift, Word16 *x, const Word16 mu, const Word16 L, W
{
FOR( i = 0; i < L; i++ )
{
#ifdef ISSUE_1772_replace_shr_o
L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_sat( x[i], shift ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/
#else
L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_o( x[i], shift, &Overflow ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/
#endif
x[i] = round_fx_o( L_tmp, &Overflow ); /*Qx-shift*/
move16();
}
......
......@@ -46,8 +46,8 @@ int16_t print_disclaimer( FILE *fPtr )
fprintf( fPtr, "\n==================================================================================================\n" );
fprintf( fPtr, " IVAS Codec BASOP Baseline\n" );
fprintf( fPtr, " \n" );
fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" );
fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" );
fprintf( fPtr, " Based on EVS Codec (BASOP) 3GPP TS26.442 Aug 12, 2021,\n" );
fprintf( fPtr, " Version 12.15.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.4.0\n" );
fprintf( fPtr, "==================================================================================================\n\n" );
return 0;
......
......@@ -504,12 +504,20 @@ void edct_16fx(
L_tmp = L_mult( re[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */
Lacc = L_mac_o( L_tmp, im[i], *pt, &Overflow ); /*Q(Qx+Q_edct+16) */
#ifdef ISSUE_1799_replace_L_shr_o
y[i2] = round_fx_o( L_shr_sat( Lacc, Q_edct ), &Overflow ); /* Q(Qx) */
#else
y[i2] = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */
#endif
move16();
L_tmp = L_mult( re[i], edct_table[sub( shr( length, 1 ), add( 1, i ) )] ); /*Q(Qx+Q_edct+16) */
Lacc = L_msu( L_tmp, im[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */
#ifdef ISSUE_1799_replace_L_shr_o
*py = round_fx_o( L_shr_sat( Lacc, Q_edct ), &Overflow ); /* Q(Qx) */
#else
*py = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */
#endif
move16();
py -= 2;
......