Commit c9427822 authored by emerit's avatar emerit
Browse files

fix missing code

parent 003c1486
Loading
Loading
Loading
Loading
+41 −2
Original line number Diff line number Diff line
@@ -2876,6 +2876,24 @@ static ivas_error updateMcPanGainsForBinauralOut(
    setZeroPanMatrix_fx( inputMc->panGains_fx );
    IF( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO )
    {
#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
        IF( EQ_32( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
        {
            inputMc->panGains_fx[0][0] = ONE_IN_Q31;
            inputMc->panGains_fx[0][1] = 0;
        }
        ELSE IF( EQ_32( L_add( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ), 0 ) )
        {
            inputMc->panGains_fx[0][0] = 0;
            inputMc->panGains_fx[0][1] = ONE_IN_Q31;
        }
        ELSE
        {
            Word16 pan = add( mult_r( extract_h( inputMc->nonDiegeticPanGain_fx ), 256 ), 256 );
            inputMc->panGains_fx[0][0] = L_deposit_h( sin_scale_tbl_512[pan] );
            inputMc->panGains_fx[0][1] = L_deposit_h( cos_scale_tbl_512[pan] );
        }
#else
        IF( EQ_32( inputMc->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
        {
            inputMc->panGains_fx[0][0] = ONE_IN_Q31;
@@ -2887,6 +2905,7 @@ static ivas_error updateMcPanGainsForBinauralOut(
        move32();
        inputMc->panGains_fx[0][1] = L_sub( ONE_IN_Q31, inputMc->panGains_fx[0][0] );
        move32();
#endif
    }
    ELSE
    {
@@ -6980,8 +6999,28 @@ static ivas_error renderIsmToMc(
    {
        IF( ismInput->nonDiegeticPan )
        {
#ifdef FIX_2482_NON_DIEGETIC_PANNING_LIMITATION_SATURATION
            IF( EQ_32( ismInput->nonDiegeticPanGain_fx, ONE_IN_Q31 ) )
            {
                currentPanGains_fx[0] = ONE_IN_Q31;
                currentPanGains_fx[1] = 0;
            }
            ELSE IF( EQ_32( L_add( ismInput->nonDiegeticPanGain_fx, ONE_IN_Q31 ), 0 ) )
            {
                currentPanGains_fx[0] = 0;
                currentPanGains_fx[1] = ONE_IN_Q31;
            }
            ELSE
            {
                Word16 pan = add( mult_r( extract_h( ismInput->nonDiegeticPanGain_fx ), 256 ), 256 );
                currentPanGains_fx[0] = L_deposit_h( sin_scale_tbl_512[pan] );
                currentPanGains_fx[1] = L_deposit_h( cos_scale_tbl_512[pan] );
            }
#else

            currentPanGains_fx[0] = L_add( L_shr( ismInput->nonDiegeticPanGain_fx, 1 ), ONE_IN_Q30 ); /* Q31 */
            currentPanGains_fx[1] = L_sub( ONE_IN_Q31, currentPanGains_fx[0] );                       /* Q31 */
#endif
            ismInput->prev_pan_gains_fx[0] = currentPanGains_fx[0]; /* Q31 */
            ismInput->prev_pan_gains_fx[1] = currentPanGains_fx[1]; /* Q31 */
            move32();