Commit 6c6563c3 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_1263_fix' into 'main'

Fix for 3GPP issue 1263: Fixed point renderer crashed when rendering ISM stream to FOA at 16kHz

See merge request !1096
parents 24cb7eef 560e0abc
Loading
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -4564,40 +4564,58 @@ static void renderBufferChannelLerp_fx(
            {
                i = 0;
                Word32 tmp = Q31_BY_SUB_FRAME_240;
                Word32 tmp1 = 239;
                move32();
                move32();
                move32();
                SWITCH( outAudio.config.numSamplesPerChannel )
                {
                    case NUM_SAMPLES_960:
                        tmp = Q31_BY_NUM_SAMPLES_960;
                        tmp1 = 959;
                        move32();
                        move32();
                        BREAK;
                    case NUM_SAMPLES_720:
                        tmp = Q31_BY_NUM_SAMPLES_720;
                        tmp1 = 719;
                        move32();
                        move32();
                        BREAK;
                    case NUM_SAMPLES_320:
                        tmp = Q31_BY_NUM_SAMPLES_320;
                        tmp1 = 319;
                        move32();
                        move32();
                        BREAK;
                    case NUM_SAMPLES_160:
                        tmp = Q31_BY_NUM_SAMPLES_160;
                        tmp1 = 159;
                        move32();
                        move32();
                        BREAK;
                    case L_SUBFRAME_48k:
                        tmp = Q31_BY_SUB_FRAME_240;
                        tmp1 = 239;
                        move32();
                        move32();
                        BREAK;
                    case L_SUBFRAME_32k:
                        tmp = Q31_BY_SUB_FRAME_180;
                        tmp1 = 179;
                        move32();
                        move32();
                        BREAK;
                    case L_SUBFRAME_16k:
                        tmp = Q31_BY_SUB_FRAME_80;
                        tmp1 = 79;
                        move32();
                        move32();
                        BREAK;
                    case L_SUBFRAME_8k:
                        tmp = Q31_BY_SUB_FRAME_40;
                        tmp1 = 39;
                        move32();
                        move32();
                        BREAK;
                    default:
@@ -4605,8 +4623,16 @@ static void renderBufferChannelLerp_fx(
                }
                /* Otherwise use weighted average between previous and current gain */
                DO
                {
                    IF( EQ_32( i, tmp1 ) )
                    {
                        fadeIn = ONE_IN_Q31;
                        move32();
                    }
                    ELSE
                    {
                        fadeIn = UL_Mpy_32_32( i, tmp );
                    }
                    fadeOut = L_sub( ONE_IN_Q31, fadeIn );

                    *outSmpl = L_add( Mpy_32_32( L_add( Mpy_32_32( fadeIn, currentGain ), Mpy_32_32( fadeOut, previousGain ) ), ( *inSmpl ) ), *outSmpl );