Commit 30751c55 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

implement downmixing of HOA3 to stereo for the reverberator input

parent b123958c
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -177,7 +177,8 @@
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_LCLD_5MS                                   /* Dlb: LCLD 5ms framing operation  */
#endif
#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A      /* FhG: issue 987: fix broken output with ParamMC to BINAURAL_REVERB rendering */
//#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_A      /* FhG: issue 987: solution a: switch to SD */
#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING_B        /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */

#define NONBE_FIX_984_OMASA_EXT_OUTPUT                        /* Nokia: issue #984: complete the OMASA EXT output implementation */
#define NONBE_FIX_1000_G1_G2_SWB_TBE                          /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */
+38 −12
Original line number Diff line number Diff line
@@ -952,6 +952,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_B
            /*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];
@@ -970,6 +995,7 @@ static void ivas_binaural_obtain_DMX(
				}
			}
        }
    }

    return;
}