Commit 132d0801 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_2283_ACCU_CLDFB

parent e88b6206
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -96,7 +96,6 @@

#define FIX_2448_RENDERER_MSAN_ERROR                    /* FhG: basop issue 2448: fix MSAN error with MSA rendering */
#define FIX_2283_ISM_MD_DELAY                           /* Dolby: Fix ISM metadata delay round-off */
#define FIX_2283_ACCU_CLDFB                             /* FhG: Fix to consider Q-format differences in accumulateCLDFBArrayToBuffer_fx() */
#define FIX_1530_Codec_Level_Harmonization_Non_diegetic_panning /* FhG: Adjust non-diegetic panning law to harmonize codec levels with 3GPP reference software */
#define FIX_FLOAT_1518                                  /* FhG: fix issue 1518: loudness differences in OSBA decoding to mono or stereo output */
#define FIX_FLOAT_1533_BLEND_SUBFR2                     /* FhG: float issue 1533: correct blending in blend_subfr2() */
+0 −63
Original line number Diff line number Diff line
@@ -413,40 +413,6 @@ static void copyBufferToCLDFBarray_fx(
    return;
}

#ifndef FIX_2283_ACCU_CLDFB
static void accumulateCLDFBArrayToBuffer_fx(
    Word32 re[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    Word32 im[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    const IVAS_REND_AudioBuffer *buffer )
{
    UWord32 smplIdx, slotIdx;
    UWord32 numCldfbSamples, num_bands;
    Word16 chnlIdx;
    Word32 *writePtr;

    assert( ( buffer->config.is_cldfb == 1 ) && "for time domain input call copyBufferTo2dArray()" );
    writePtr = buffer->data_fx;
    numCldfbSamples = (UWord32) shr( buffer->config.numSamplesPerChannel, 1 );
    num_bands = (UWord32) Mpy_32_32( numCldfbSamples, ONE_BY_CLDFB_NO_COL_MAX_Q31 );

    FOR( chnlIdx = 0; chnlIdx < buffer->config.numChannels; ++chnlIdx )
    {
        FOR( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx )
        {
            FOR( smplIdx = 0; smplIdx < num_bands; ++smplIdx )
            {
                *writePtr++ += re[chnlIdx][slotIdx][smplIdx];
            }
            FOR( smplIdx = 0; smplIdx < num_bands; ++smplIdx )
            {
                *writePtr++ += im[chnlIdx][slotIdx][smplIdx];
            }
        }
    }

    return;
}
#else
static void accumulateCLDFBArrayToBuffer_fx(
    Word32 re[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
    Word32 im[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],
@@ -518,7 +484,6 @@ static void accumulateCLDFBArrayToBuffer_fx(

    return;
}
#endif

static void copyBufferTo2dArray_fx(
    const IVAS_REND_AudioBuffer buffer,
@@ -7218,21 +7183,12 @@ static ivas_error renderIsmToSplitBinaural(
                        Word32 *imagBuffer_fx = &tmpBinaural_CldfbIm[BINAURAL_CHANNELS * pos_idx + ch][slot_idx][0];
                        Word16 noChannels = ismInput->base.ctx.pSplitRendWrapper->hCldfbHandles->cldfbAna[pos_idx + ch]->no_channels;

#ifdef FIX_2283_ACCU_CLDFB
                        Word16 scale = sub( exp, q_cldfb );
                        FOR( Word16 j = 0; j < noChannels; j++ )
                        {
                            realBuffer_fx[j] = L_shl( realBuffer_fx[j], scale ); /*Q(exp)*/
                            imagBuffer_fx[j] = L_shl( imagBuffer_fx[j], scale ); /*Q(exp)*/
                        }
#else
                        Word16 scale = sub( sub( exp, q_cldfb ), 1 );
                        FOR( Word16 j = 0; j < noChannels; j++ )
                        {
                            realBuffer_fx[j] = L_shl( realBuffer_fx[j], scale ); /*Q(exp)*/
                            imagBuffer_fx[j] = L_shl( imagBuffer_fx[j], scale ); /*Q(exp)*/
                        }
#endif
                        q_cldfb = exp;
                    }
                }
@@ -7259,11 +7215,7 @@ static ivas_error renderIsmToSplitBinaural(

    if ( outAudio.config.is_cldfb )
    {
#ifdef FIX_2283_ACCU_CLDFB
        accumulateCLDFBArrayToBuffer_fx( tmpBinaural_CldfbRe, tmpBinaural_CldfbIm, exp, &outAudio );
#else
        accumulateCLDFBArrayToBuffer_fx( tmpBinaural_CldfbRe, tmpBinaural_CldfbIm, &outAudio );
#endif
    }
    else
    {
@@ -8508,11 +8460,7 @@ static ivas_error renderSbaToSplitBinaural(
            return error;
        }

#ifdef FIX_2283_ACCU_CLDFB
        accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, *outAudio.pq_fact, &outAudio );
#else
        accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, &outAudio );
#endif
    }
    ELSE
    {
@@ -8562,11 +8510,7 @@ static ivas_error renderSbaToBinaural(
            return error;
        }

#ifdef FIX_2283_ACCU_CLDFB
        accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, *outAudio.pq_fact, &outAudio );
#else
        accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, &outAudio );
#endif
    }
    ELSE
    {
@@ -9244,14 +9188,7 @@ static ivas_error renderInputMasa(

            ivas_masa_ext_rend_parambin_render_fx( masaInput->hMasaExtRend, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer_fx, num_subframes, masaInput->base.ctx.pSplitRendWrapper, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural );

#ifdef FIX_2283_ACCU_CLDFB
            accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Q6, &outAudio );
#else
            accumulateCLDFBArrayToBuffer_fx( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, &outAudio );

            *outAudio.pq_fact = Q6;
            move16();
#endif
        }
        ELSE
        {