Commit ca7fe75a authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_BASOP_2351_EXTREND_SCALE

parent a53bb94c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@
#define FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */
#define FIX_1478_UNINIT_ON_BFI                          /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */
#define FIX_BASOP_2358_SCALING_OOB                      /* Eri: Basip issue 2358: Clang-18 reports OOB access where scaling is applied to L_FRAME48k instead of output_frame */
#define FIX_BASOP_2351_EXTREND_SCALE                    /* FhG: basop issue 2351: Only scale initialized samples in renderer, related to 2326 */
#define FIX_2331_CLANG18_MSAN_UNINIT_VARIABLE           /* FhG: Fix issue 2331: Uninitialized variable */
#define FIX_2362_TOTAL_BRATE_CALCULATION                /* FhG: basop issue 2362: fix calculation of st->total_brate in ivas_cpe_enc_fx() */
#define FIX_2330_CLANG_18_WARNINGS_REND                 /* FhG: Fix renderer warnings */
+0 −88
Original line number Diff line number Diff line
@@ -6487,17 +6487,9 @@ static ivas_error renderIsmToBinaural(
    ism_md_subframe_update_ext = extract_l( Mpy_32_32( ismInput->ism_metadata_delay_ms_fx, ONE_BY_SUBFRAME_LEN_MS_Q31 ) );
    copyBufferTo2dArray_fx( ismInput->base.inputBuffer, tmpTDRendBuffer );

#ifdef FIX_BASOP_2351_EXTREND_SCALE
    FOR( i = 0; i < ismInput->base.inputBuffer.config.numChannels; ++i )
#else
    FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
    {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
        Scale_sig32( tmpTDRendBuffer[i], ismInput->base.inputBuffer.config.numSamplesPerChannel, sub( Q11, exp ) ); /* Q11 */
#else
        Scale_sig32( tmpTDRendBuffer[i], L_FRAME48k, sub( Q11, exp ) ); /* Q11 */
#endif
    }

    IF( NE_32( ( error = ivas_td_binaural_renderer_ext_fx( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, ism_md_subframe_update_ext,
@@ -6507,17 +6499,9 @@ static ivas_error renderIsmToBinaural(
        return error;
    }

#ifdef FIX_BASOP_2351_EXTREND_SCALE
    FOR( i = 0; i < outAudio.config.numChannels; ++i )
#else
    FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
    {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
        Scale_sig32( tmpTDRendBuffer[i], outAudio.config.numSamplesPerChannel, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#else
        Scale_sig32( tmpTDRendBuffer[i], L_FRAME48k, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#endif
    }

    IF( ismInput->hReverb != NULL )
@@ -6780,17 +6764,9 @@ static ivas_error renderIsmToBinauralReverb(
    ism_md_subframe_update_ext = extract_l( Mpy_32_32( ismInput->ism_metadata_delay_ms_fx, ONE_BY_SUBFRAME_LEN_MS_Q31 ) );
    copyBufferTo2dArray_fx( ismInput->base.inputBuffer, tmpRendBuffer_fx );

#ifdef FIX_BASOP_2351_EXTREND_SCALE
    FOR( i = 0; i < ismInput->base.inputBuffer.config.numChannels; ++i )
#else
    FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
    {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
        Scale_sig32( tmpRendBuffer_fx[i], ismInput->base.inputBuffer.config.numSamplesPerChannel, sub( Q11, exp ) ); /* Q11 */
#else
        Scale_sig32( tmpRendBuffer_fx[i], L_FRAME48k, sub( Q11, exp ) ); /* Q11 */
#endif
    }

    IF( NE_32( ( error = ivas_td_binaural_renderer_ext_fx( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, ism_md_subframe_update_ext, *ismInput->base.ctx.pOutSampleRate, outAudio.config.numSamplesPerChannel, tmpRendBuffer_fx, &exp ) ), IVAS_ERR_OK ) )
@@ -6798,17 +6774,9 @@ static ivas_error renderIsmToBinauralReverb(
        return error;
    }

#ifdef FIX_BASOP_2351_EXTREND_SCALE
    FOR( i = 0; i < outAudio.config.numChannels; ++i )
#else
    FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
    {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
        Scale_sig32( tmpRendBuffer_fx[i], outAudio.config.numSamplesPerChannel, negate( sub( 11, exp ) ) ); /* Q(exp) */
#else
        Scale_sig32( tmpRendBuffer_fx[i], L_FRAME48k, negate( sub( 11, exp ) ) ); /* Q(exp) */
#endif
    }

    IF( ismInput->hReverb != NULL )
@@ -7111,17 +7079,9 @@ static ivas_error renderIsmToSplitBinaural(
        }


#ifdef FIX_BASOP_2351_EXTREND_SCALE
        FOR( i = 0; i < ismInput->base.inputBuffer.config.numChannels; ++i )
#else
        FOR( i = 0; i < MAX_NUM_OBJECTS; ++i )
#endif
        {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
            Scale_sig32( tmpProcessing[i], ismInput->base.inputBuffer.config.numSamplesPerChannel, sub( Q11, exp ) ); /* Q11 */
#else
            Scale_sig32( tmpProcessing[i], L_FRAME48k, sub( Q11, exp ) );           /* Q11 */
#endif
        }

        /* Render */
@@ -7133,11 +7093,7 @@ static ivas_error renderIsmToSplitBinaural(

        FOR( i = 0; i < BINAURAL_CHANNELS; ++i )
        {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
            Scale_sig32( tmpProcessing[i], output_frame, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#else
            Scale_sig32( tmpProcessing[i], L_FRAME48k, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#endif
        }

        IF( ismInput->hReverb != NULL )
@@ -7540,17 +7496,9 @@ static ivas_error renderMcToBinaural(
    {
        copyBufferTo2dArray_fx( mcInput->base.inputBuffer, tmpRendBuffer_fx );

#ifdef FIX_BASOP_2351_EXTREND_SCALE
        FOR( i = 0; i < mcInput->base.inputBuffer.config.numChannels; ++i )
#else
        FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
        {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
            Scale_sig32( tmpRendBuffer_fx[i], mcInput->base.inputBuffer.config.numSamplesPerChannel, sub( Q11, exp ) ); /* Q11 */
#else
            Scale_sig32( tmpRendBuffer_fx[i], L_FRAME48k, sub( Q11, exp ) ); /* Q11 */
#endif
        }
        IF( NE_32( ( error = ivas_td_binaural_renderer_ext_fx( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData, NULL, mcInput->hReverb,
                                                               0, *mcInput->base.ctx.pOutSampleRate, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer_fx, &exp ) ),
@@ -7559,17 +7507,9 @@ static ivas_error renderMcToBinaural(
            return error;
        }

#ifdef FIX_BASOP_2351_EXTREND_SCALE
        FOR( i = 0; i < outAudio.config.numChannels; ++i )
#else
        FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
        {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
            Scale_sig32( tmpRendBuffer_fx[i], outAudio.config.numSamplesPerChannel, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#else
            Scale_sig32( tmpRendBuffer_fx[i], L_FRAME48k, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#endif
        }
    }
    ELSE
@@ -7679,17 +7619,9 @@ static ivas_error renderMcToBinauralRoom(
    {
        copyBufferTo2dArray_fx( mcInput->base.inputBuffer, tmpRendBuffer );

#ifdef FIX_BASOP_2351_EXTREND_SCALE
        FOR( i = 0; i < mcInput->base.inputBuffer.config.numChannels; ++i )
#else
        FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
        {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
            Scale_sig32( tmpRendBuffer[i], mcInput->base.inputBuffer.config.numSamplesPerChannel, sub( Q11, exp ) ); /* Q11 */
#else
            Scale_sig32( tmpRendBuffer[i], L_FRAME48k, sub( Q11, exp ) ); /* Q11 */
#endif
        }

        IF( NE_32( ( error = ivas_td_binaural_renderer_ext_fx( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData, NULL, mcInput->hReverb,
@@ -7699,17 +7631,9 @@ static ivas_error renderMcToBinauralRoom(
            return error;
        }

#ifdef FIX_BASOP_2351_EXTREND_SCALE
        FOR( i = 0; i < outAudio.config.numChannels; ++i )
#else
        FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
        {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
            Scale_sig32( tmpRendBuffer[i], outAudio.config.numSamplesPerChannel, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#else
            Scale_sig32( tmpRendBuffer[i], L_FRAME48k, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#endif
        }
    }
    ELSE
@@ -8052,17 +7976,9 @@ static ivas_error renderMcToSplitBinaural(
            /* perform rotation in source format to tmpRotBuffer */
            pCombinedOrientationDataLocal = &combinedOrientationDataLocal;

#ifdef FIX_BASOP_2351_EXTREND_SCALE
            FOR( i = 0; i < mcInput->base.inputBuffer.config.numChannels; ++i )
#else
            FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i )
#endif
            {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
                Scale_sig32( tmpRendBuffer[i], mcInput->base.inputBuffer.config.numSamplesPerChannel, sub( Q11, exp ) ); /* Q11 */
#else
                Scale_sig32( tmpRendBuffer[i], L_FRAME48k, sub( Q11, exp ) );               /* Q11 */
#endif
            }
            /* Render */
            IF( ( error = ivas_td_binaural_renderer_ext_fx( ( pos_idx == 0 ) ? &mcInput->tdRendWrapper : &mcInput->splitTdRendWrappers[pos_idx - 1], mcInput->base.inConfig, &mcInput->customLsInput, &pCombinedOrientationDataLocal, NULL, mcInput->hReverb, 0, /* Ism Audio Metadata Delay Sync in ms for External Renderer */ *mcInput->base.ctx.pOutSampleRate, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer, &exp ) ) != IVAS_ERR_OK )
@@ -8071,11 +7987,7 @@ static ivas_error renderMcToSplitBinaural(
            }
            FOR( i = 0; i < BINAURAL_CHANNELS; ++i )
            {
#ifdef FIX_BASOP_2351_EXTREND_SCALE
                Scale_sig32( tmpRendBuffer[i], mcInput->base.inputBuffer.config.numSamplesPerChannel, negate( sub( Q11, exp ) ) ); /* Q(exp) */
#else
                Scale_sig32( tmpRendBuffer[i], L_FRAME48k, negate( sub( Q11, exp ) ) );     /* Q(exp) */
#endif
            }

            /* Copy rendered audio to tmp storage buffer. Copying directly to output would