Commit a13a0855 authored by Jan Kiene's avatar Jan Kiene
Browse files

port MR 1382 from float

correct energy in BINAURAL_ROOM_REVERB with head rotation
for parametric multichannel modes
parent 82add814
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -224,6 +224,8 @@
#define FIX_699_FILE_READER_JBM_TSM                     /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */
#define FIX_997_REMOVE_SPAR_DEC_UPMIXER                 /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */

#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 ############################ */

/* clang-format on */
+39 −13
Original line number Diff line number Diff line
@@ -948,6 +948,31 @@ static void ivas_binaural_obtain_DMX(
            set_zero( outRealRightPtr, CLDFB_NO_CHANNELS_MAX );
            set_zero( outImagRightPtr, CLDFB_NO_CHANNELS_MAX );

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

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

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

                for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ )
                {
                    outRealLeftPtr[bandIdx] = inRealPtr_W[bandIdx] + inRealPtr_Y[bandIdx];
                    outImagLeftPtr[bandIdx] = inImagPtr_W[bandIdx] + inImagPtr_Y[bandIdx];

                    outRealRightPtr[bandIdx] = inRealPtr_W[bandIdx] - inRealPtr_Y[bandIdx];
                    outImagRightPtr[bandIdx] = inImagPtr_W[bandIdx] - inImagPtr_Y[bandIdx];
                }
            }
            else
#endif
            {
                for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
                {
                    float foa_const = hBinRenderer->hReverb->foa_enc[chIdx][1];
@@ -966,6 +991,7 @@ static void ivas_binaural_obtain_DMX(
                }
            }
        }
    }

    return;
}