Commit 9773847c authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_784_fix_2' into 'main'

Fix for 3GPP issue 784: BASOP decoder without JBM not BE to BASOP decoder with zero-delay profile [allow regression]

See merge request !1904
parents 570b1115 ac07b6ee
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -4066,16 +4066,16 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx(
                                             &cldfb_real_buffer_fx[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands],
                                             &cldfb_imag_buffer_fx[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands],
                                             num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch], &Q_tc );
            }
        }
        IF( EQ_16( (Word16) st_ivas->ivas_format, (Word16) MC_FORMAT ) )
        {
                    st_ivas->hParamMC->Cldfb_RealBuffer_tc_e = sub( 31, Q_tc );
                    st_ivas->hParamMC->Cldfb_ImagBuffer_tc_e = sub( 31, Q_tc );
            st_ivas->hParamMC->Cldfb_RealBuffer_tc_e = 25; // 31-Q_tc = 31-(11-5)
            st_ivas->hParamMC->Cldfb_ImagBuffer_tc_e = 25; // 31-Q_tc = 31-(11-5)
            move16();
            move16();
        }
    }
        }
    }
    hTcBuffer->n_samples_rendered = 0;
    move16();
    hTcBuffer->subframes_rendered = 0;
+4 −1
Original line number Diff line number Diff line
@@ -528,12 +528,15 @@ ivas_error ivas_param_mc_dec_open_fx(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
        }
        set32_fx( hParamMC->Cldfb_RealBuffer_tc_fx, 0, cldfb_buf_size );
        hParamMC->Cldfb_RealBuffer_tc_e = 25; // Q6 , Initialised with Q6 to match non jbm and jbm cases
        move16();
        IF( ( hParamMC->Cldfb_ImagBuffer_tc_fx = (Word32 *) malloc( cldfb_buf_size * sizeof( Word32 ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC JBM\n" ) );
        }
        set32_fx( hParamMC->Cldfb_ImagBuffer_tc_fx, 0, cldfb_buf_size );

        hParamMC->Cldfb_ImagBuffer_tc_e = 25; // Q6 , Initialised with Q6 to match non jbm and jbm  cases
        move16();
        hParamMC->sz = imult1616( imult1616( n_cldfb_slots, nchan_transport ), hParamMC->num_freq_bands );
        move16();

+56 −49
Original line number Diff line number Diff line
@@ -964,16 +964,28 @@ UWord8 apa_exec_ivas_fx(
    {
        Word16 a_tmp[APA_BUF];
        Word16 *buf_out_ptr = &( ps->buf_out_fx[ps->l_buf_out - ps->l_frm] );
        Word16 *frm_in_ptr = &( frm_in[ps->l_frm] );

        Q_a_out = s_min( Q_a_out, ps->Q_buf_out );
        Scale_sig( ps->buf_out_fx, ps->buf_out_capacity, sub( Q_a_out, ps->Q_buf_out ) ); // Q_buf_out -> Q_a_out
        IF( EQ_32( ps->scale, 100 ) )
        {
            FOR( i = 0; i < ps->num_channels * APA_BUF_PER_CHANNEL; i++ )
            {
            a_tmp[i] = extract_h( L_shl( a_in[i], add( Q_a_out, Q5 ) ) ); // Q_a_out
                a_out[i] = a_in[i]; // Q11
                move32();
            }
            l_frm_out = ps->l_frm;
            move16();
        }
        Scale_sig( ps->buf_out_fx, ps->buf_out_capacity, sub( Q_a_out, ps->Q_buf_out ) ); // Q_buf_out -> Q_a_out
        ELSE
        {
            Word16 *frm_in_ptr = &( frm_in[ps->l_frm] );

            FOR( i = 0; i < ps->num_channels * APA_BUF_PER_CHANNEL; i++ )
            {
                a_tmp[i] = extract_h( L_shl( a_in[i], add( Q_a_out, Q5 ) ) ); // Q_a_out
                move16();
            }
            /* fill input frame */
            /* 1st input frame: previous output samples */
            FOR( i = 0; i < ps->l_frm; i++ )
@@ -987,13 +999,8 @@ UWord8 apa_exec_ivas_fx(
                frm_in_ptr[i] = a_tmp[i];
                move16();
            }
        /* no scaling */
        IF( EQ_32( ps->scale, 100 ) )
        {
            copy_frm_fx( ps, frm_in, a_tmp, &l_frm_out );
        }
            /* shrink */
        ELSE IF( LT_32( ps->scale, 100 ) )
            IF( LT_32( ps->scale, 100 ) )
            {
                shrink_frm_ivas_fx( ps, frm_in, maxScaling, a_tmp, Q_a_out, &l_frm_out );
            }
@@ -1030,6 +1037,7 @@ UWord8 apa_exec_ivas_fx(
                move32();
            }
        }
    }

    /* copy output to internal buffer */
    /* avoid buffer overflow: */
@@ -1532,7 +1540,6 @@ static bool copy_frm_fx(
    return 0;
}


/*
********************************************************************************
*