Commit 71126a82 authored by Jan Kiene's avatar Jan Kiene
Browse files

port MR 1382 from float

correct energy for BINAURAL_ROOM_REVERB output with head rotation
for parameteric multichannel modes
parent 5cde2757
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@
#define NONBE_FIX_947_STEREO_DMX_FADOPT                       /* Orange: Fading optimisation */  
#endif
#define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN        /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig                    */
#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING       /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */

/* #################### End BASOP porting switches ############################ */

+49 −16
Original line number Diff line number Diff line
@@ -1095,6 +1095,31 @@ static void ivas_binaural_obtain_DMX_fx(
            set32_fx( outRealRightPtr_fx, 0, CLDFB_NO_CHANNELS_MAX );
            set32_fx( outImagRightPtr_fx, 0, CLDFB_NO_CHANNELS_MAX );

#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
            /*Ambisonics input requires different processing*/
            if ( EQ_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) )
            {
                Word32 *inRealPtr_W, *inImagPtr_W;
                Word32 *inRealPtr_Y, *inImagPtr_Y;

                inRealPtr_W = (Word32 *) &( RealBuffer[0][k][0] );
                inImagPtr_W = (Word32 *) &( ImagBuffer[0][k][0] );

                inRealPtr_Y = (Word32 *) &( RealBuffer[1][k][0] );
                inImagPtr_Y = (Word32 *) &( ImagBuffer[1][k][0] );

                FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
                {
                    outRealLeftPtr_fx[bandIdx] = L_add( inRealPtr_W[bandIdx], inRealPtr_Y[bandIdx] );
                    outImagLeftPtr_fx[bandIdx] = L_add( inImagPtr_W[bandIdx], inImagPtr_Y[bandIdx] );

                    outRealRightPtr_fx[bandIdx] = L_sub( inRealPtr_W[bandIdx], inRealPtr_Y[bandIdx] );
                    outImagRightPtr_fx[bandIdx] = L_sub( inImagPtr_W[bandIdx], inImagPtr_Y[bandIdx] );
                }
            }
            else
#endif
            {
                FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
                {
                    Word32 foa_const_fx = L_shl( hBinRenderer->hReverb->foa_enc_fx[chIdx][1], 1 ); // Q30
@@ -1121,6 +1146,7 @@ static void ivas_binaural_obtain_DMX_fx(
                }
            }
        }
    }

    return;
}
@@ -1462,8 +1488,15 @@ ivas_error ivas_binRenderer_open_fx(
    {
        test();
        test();
        /* NOTE to future self by @kiene: this should have been changed by NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM, but the BASOP repo code is not at that point yet, so not change needed here */
#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM
        IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 )
#else
#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
        IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) )
#else
        IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 )
#endif
#endif
        {
            FOR( k = 0; k < 11; k++ )
            {