Commit 1591c3ed authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Manuel Jander
Browse files

Fix for 3GPP issue 1408: Decoder crash for ParamMC 5.1 at 48/64/80 kbps...

Fix for 3GPP issue 1408: Decoder crash for ParamMC 5.1 at 48/64/80 kbps decoding to mono in ivas_ls_setup_conversion_fx()

Link #1408
parent 6d069331
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -1288,18 +1288,7 @@ ivas_error ivas_jbm_dec_tc_fx(
            test();
            IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) )
            {
                s = Q16 - Q11;
                move16();
                s = sub( s, find_guarded_bits_fx( st_ivas->nchan_transport ) );
                FOR( i = 0; i < s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); ++i )
                {
                    Scale_sig32( p_output_fx[i], output_frame, s );
                }
                ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, output_frame, p_output_fx, p_output_fx );
                FOR( i = 0; i < s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); ++i )
                {
                    Scale_sig32( p_output_fx[i], output_frame, negate( s ) );
                }
            }
        }
        ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCMASA ) )
+12 −5
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ ivas_error ivas_param_mc_dec_open_fx(
    Word16 nchan_out_transport;
    Word16 nchan_out_cov;
    Word32 proto_matrix_fx[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS];
    Word32 proto_mtx_norm_fx;
    Word32 proto_mtx_norm_fx, tmp32;
    Word16 frequency_axis_fx[CLDFB_NO_CHANNELS_MAX];
    Word16 max_param_band_residual;
    UWord16 config_index;
@@ -374,20 +374,27 @@ ivas_error ivas_param_mc_dec_open_fx(
        Scale_sig32( hParamMC->ls_conv_dmx_matrix_fx, imult1616( nchan_out_transport, nchan_out_cov ), 4 );                                                                                                 /*Q.26*/
        IF( EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) )
        {
            proto_mtx_norm_fx = ONE_IN_Q26; /*Q26*/
            tmp32 = ONE_IN_Q26; /*Q26*/
            move32();
            FOR( k = 0; k < nchan_transport * nchan_out_cov; k++ )
            {
                proto_mtx_norm_fx = L_max( L_abs( proto_mtx_norm_fx ), L_abs( proto_matrix_fx[k] ) ); /*Q.26*/
                tmp32 = L_max( L_abs( tmp32 ), L_abs( proto_matrix_fx[k] ) ); /*Q.26*/
            }
            proto_mtx_norm_fx = divide3232( ONE_IN_Q26, proto_mtx_norm_fx ); /*Q15*/
            proto_mtx_norm_fx = divide3232( ONE_IN_Q26, tmp32 ); /*Q15*/

            /* transfer flattened proto_matrix to 2D in hLsSetupConversion->dmxMtx */
            FOR( k = 0; k < nchan_transport; k++ )
            {
                FOR( Word16 i = 0; i < nchan_out_cov; i++ )
                {
                    IF( EQ_32( proto_matrix_fx[k * nchan_out_cov + i], tmp32 ) )
                    {
                        st_ivas->hLsSetUpConversion->dmxMtx_fx[k][i] = ONE_IN_Q30; // Q30
                    }
                    ELSE
                    {
                        st_ivas->hLsSetUpConversion->dmxMtx_fx[k][i] = L_shl( Mult_32_16( proto_matrix_fx[k * nchan_out_cov + i], extract_l( proto_mtx_norm_fx ) ), 4 ); /*Q.30*/
                    }
                    move32();
                }
            }
+3 −3
Original line number Diff line number Diff line
@@ -586,14 +586,14 @@ void ivas_ls_setup_conversion_fx(
    Decoder_Struct *st_ivas,   /* i  : IVAS decoder structure           */
    const Word16 input_chans,  /* i  : number of input channels to the renderer        */
    const Word16 output_frame, /* i  : frame length                     */
    Word32 *input[],           /* i  : LS input/output synthesis signal Q16*/
    Word32 *output[]           /* i/o: LS input/output synthesis signal Q16*/
    Word32 *input[],           /* i  : LS input/output synthesis signal Qx*/
    Word32 *output[]           /* i/o: LS input/output synthesis signal Qx*/
)
{
    Word16 chInIdx, chOutIdx, idx;
    LSSETUP_CONVERSION_HANDLE hLsSetUpConversion;
    Word32 dmxCoeff, tmpVal;
    Word32 output_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // Q16
    Word32 output_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // Qx

    push_wmops( "LS_Renderer" );