Commit d1d9fb04 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept CODE_IMPROVEMENTS

parent 78384026
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -131,7 +131,6 @@
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK             /* Nokia: add sanity check for Euler angles for external orientations */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */
#define CODE_IMPROVEMENTS
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
#define FIX_1383_HEAD_TRACK_SANITIZER                   /* Nok: issue 1383: Fix head tracking struc values reading in renderer */
+0 −6
Original line number Diff line number Diff line
@@ -81,15 +81,9 @@ const Word32 ap_lattice_coeffs_2_fx[132] /* Q31 */ = { 1360843264, 1462880896,
const Word32 ap_lattice_coeffs_3_fx[66] /* Q31 */ = { 1360843264,  1462880896,  -106124344,  615715776,  313579872,  290773568,  -880779712,  -444026592,  -1410828032,  -218497872,  936944960,  729753600,  -282142848,  -1661606912,  -647739072,  703431872,  713452032,  442076704,  1541038592,  -1186205568,  -322414592,  117158120,  514363136,  -1392593792,  -1550156800,  406684000,  146426176,  13348758,  165409920,  83060376,  909276800,  -233341280,  927820288,  -890434752,  596656832,  898691840,  167097856,  -607873152,  -766668864,  9951439,  -950562176,  -799540352,  866157440,  521887904,  675097984,  954584384,  746287104,  1065244224,  232804400,  1007990144,  -365686400,  700745408,  369704352,  945610048,  125449552,  729442240,  -418684160,  1054884800,  -604078592,  -92599496,  -1036132928,  -719417728,  -721895936,  421913952,  -353525216,  950242176};
const Word32 * const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS] =
{
#ifdef CODE_IMPROVEMENTS
    ap_lattice_coeffs_1_fx,
    ap_lattice_coeffs_2_fx,
    ap_lattice_coeffs_3_fx,
#else
    &ap_lattice_coeffs_1_fx[0],
    &ap_lattice_coeffs_2_fx[0],
    &ap_lattice_coeffs_3_fx[0],
#endif
};

const Word16 ap_split_frequencies_fx[DIRAC_DECORR_NUM_SPLIT_BANDS + 1]/*Q14*/ = {
+0 −59
Original line number Diff line number Diff line
@@ -4199,7 +4199,6 @@ static ivas_error getConstInputById(
    return IVAS_ERR_OK;
}

#ifdef CODE_IMPROVEMENTS
static void *getInputByIndex_fx(
    void *inputsArray,
    const size_t index,
@@ -4224,57 +4223,31 @@ static void *getInputByIndex_fx(
    /* include a final return to make the linter happy and avoid problems with wmc_tool (see #1355) */
    return NULL;
}
#endif

static ivas_error findFreeInputSlot_fx(
#ifdef CODE_IMPROVEMENTS
    void *inputs,
    const IVAS_REND_AudioConfigType inputType,
#else
    const void *inputs,
    const int32_t inputStructSize,
#endif
    const Word32 maxInputs,
    Word32 *inputIndex )
{
#ifdef CODE_IMPROVEMENTS
    /* Using a void pointer and a separately provided type is a hack for this function
       to be reusable for arrays of any input type (input_ism, input_mc, input_sba, input_masa).
        Assumptions:
            - input_base is always the first member in the input struct
            - memory alignments of original input type and input_base are the same
    */
#else
    /* Using a void pointer and a separately provided size is a hack for this function
       to be reusable for arrays of any input type (input_ism, input_mc, input_sba, input_masa).
        Assumptions:
            - input_base is always the first member in the input struct
            - provided size is correct
    */
#endif

    Word32 i;
    bool canAddInput;
#ifndef CODE_IMPROVEMENTS
    const UWord8 *pByte;
#endif
    const input_base *pInputBase;

    canAddInput = false;
    move16();

    /* Find first unused input in array */
#ifdef CODE_IMPROVEMENTS
    FOR( i = 0; i < maxInputs; ++i )
#else
    FOR( i = 0, pByte = inputs; i < maxInputs; ++i, pByte += inputStructSize )
#endif
    {
#ifdef CODE_IMPROVEMENTS
        pInputBase = (const input_base *) getInputByIndex_fx( inputs, i, inputType );
#else
        pInputBase = (const input_base *) pByte;
#endif

        IF( EQ_32( pInputBase->inConfig, IVAS_AUDIO_CONFIG_INVALID ) )
        {
@@ -4549,11 +4522,7 @@ ivas_error IVAS_REND_AddInput_fx(
    ivas_error error;
    Word32 maxNumInputsOfType;
    void *inputsArray;
#ifdef CODE_IMPROVEMENTS
    IVAS_REND_AudioConfigType inputType;
#else
    Word32 inputStructSize;
#endif
    ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles *hrtfs );
    void ( *setInputDelay )( void *, bool );
    Word32 inputIndex;
@@ -4588,19 +4557,12 @@ ivas_error IVAS_REND_AddInput_fx(
    }


#ifdef CODE_IMPROVEMENTS
    inputType = getAudioConfigType( inConfig );
    SWITCH( inputType )
#else
    SWITCH( getAudioConfigType( inConfig ) )
#endif
    {
        case IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED:
            maxNumInputsOfType = RENDERER_MAX_ISM_INPUTS;
            inputsArray = hIvasRend->inputsIsm;
#ifndef CODE_IMPROVEMENTS
            inputStructSize = sizeof( *hIvasRend->inputsIsm );
#endif
            activateInput = setRendInputActiveIsm;
            setInputDelay = setRendInputDelayIsm;
            move32();
@@ -4609,9 +4571,6 @@ ivas_error IVAS_REND_AddInput_fx(
        case IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED:
            maxNumInputsOfType = RENDERER_MAX_MC_INPUTS;
            inputsArray = hIvasRend->inputsMc;
#ifndef CODE_IMPROVEMENTS
            inputStructSize = sizeof( *hIvasRend->inputsMc );
#endif
            activateInput = setRendInputActiveMc;
            setInputDelay = setRendInputDelayMc;
            move32();
@@ -4620,9 +4579,6 @@ ivas_error IVAS_REND_AddInput_fx(
        case IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS:
            maxNumInputsOfType = RENDERER_MAX_SBA_INPUTS;
            inputsArray = hIvasRend->inputsSba;
#ifndef CODE_IMPROVEMENTS
            inputStructSize = sizeof( *hIvasRend->inputsSba );
#endif
            activateInput = setRendInputActiveSba;
            setInputDelay = setRendInputDelaySba;
            move32();
@@ -4631,9 +4587,6 @@ ivas_error IVAS_REND_AddInput_fx(
        case IVAS_REND_AUDIO_CONFIG_TYPE_MASA:
            maxNumInputsOfType = RENDERER_MAX_MASA_INPUTS;
            inputsArray = hIvasRend->inputsMasa;
#ifndef CODE_IMPROVEMENTS
            inputStructSize = sizeof( *hIvasRend->inputsMasa );
#endif
            activateInput = setRendInputActiveMasa;
            setInputDelay = setRendInputDelayMasa;
            move32();
@@ -4644,31 +4597,19 @@ ivas_error IVAS_REND_AddInput_fx(
    }

        /* Find first free input in array corresponding to input type */
#ifdef CODE_IMPROVEMENTS
    IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) )
#else
    IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputStructSize, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) )
#endif
    {
        return error;
    }

    *inputId = makeInputId( inConfig, inputIndex );
    move16();
#ifdef CODE_IMPROVEMENTS
    IF( NE_32( ( error = activateInput( getInputByIndex_fx( inputsArray, inputIndex, inputType ), inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) )
#else
    IF( NE_32( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) )
#endif
    {
        return error;
    }

#ifdef CODE_IMPROVEMENTS
    setInputDelay( getInputByIndex_fx( inputsArray, inputIndex, inputType ), splitPreRendCldfb );
#else
    setInputDelay( (Word8 *) inputsArray + inputStructSize * inputIndex, splitPreRendCldfb );
#endif

    /* set global maximum delay after adding an input */
    setMaxGlobalDelayNs( hIvasRend );
+0 −4
Original line number Diff line number Diff line
@@ -317,11 +317,7 @@ static bool readByte( FILE *file, uint8_t *value )
static bool readLong( FILE *file, uint16_t *value )
{
    char buffer[4] = { 0 };
#ifdef CODE_IMPROVEMENTS
    if ( fread( buffer, 1, 4, file ) != 1U )
#else
    if ( fread( buffer, 4, 1, file ) != 1U )
#endif
    {
        return false;
    }
+0 −8
Original line number Diff line number Diff line
@@ -81,11 +81,7 @@ static unsigned char *parseByte( unsigned char *buffer, unsigned char *value )
static int readLong( FILE *file, unsigned int *value )
{
    char buffer[4] = { 0 };
#ifdef CODE_IMPROVEMENTS
    if ( fread( buffer, 1, 4, file ) != 1U )
#else
    if ( fread( buffer, 4, 1, file ) != 1U )
#endif
    {
        return -1;
    }
@@ -101,11 +97,7 @@ static int readLong( FILE *file, unsigned int *value )
static int readShort( FILE *file, unsigned short *value )
{
    char buffer[2] = { 0 };
#ifdef CODE_IMPROVEMENTS
    if ( fread( buffer, 1, 2, file ) != 1U )
#else
    if ( fread( buffer, 2, 1, file ) != 1U )
#endif
    {
        return -1;
    }
Loading