Commit 9b586f31 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1379-increase-accuracy-of-azimuth-and-elevation-angles-in-masa-metadata-with-dirac-rendering
parents b40fc402 a6ac7971
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -439,6 +439,7 @@ static Word16 fcb_table(
 * Routine to allocate fixed innovation codebook bit-budget
 *--------------------------------------------------------------------*/

#ifndef REMOVE_EVS_DUPLICATES
static ivas_error acelp_FCB_allocator(
    Word16 *nBits,            /* i/o: available bit-budget    */
    Word16 fixed_cdk_index[], /* o  : codebook index       Q0 */
@@ -599,7 +600,7 @@ static ivas_error acelp_FCB_allocator(

    return error;
}

#endif
static ivas_error acelp_FCB_allocator_ivas(
    Word16 *nBits,            /* i/o: available bit-budget    */
    Word16 fixed_cdk_index[], /* o  : codebook index       Q0 */
@@ -761,6 +762,7 @@ static ivas_error acelp_FCB_allocator_ivas(
 *   - per channel bitrate minimum is 13250 kbps for ACELP@16kHz
 *--------------------------------------------------------------------*/

#ifndef REMOVE_EVS_DUPLICATES
ivas_error config_acelp1(
    const Word16 enc_dec,                  /* i  : encoder/decoder flag            */
    const Word32 total_brate,              /* i  : total bitrate                   */
@@ -1885,7 +1887,7 @@ ivas_error config_acelp1(
 *   - should be in range of <6700; 24350> for ACELP@12.8kHz
 *   - per channel bitrate minimum is 13250 kbps for ACELP@16kHz
 *--------------------------------------------------------------------*/

#endif
ivas_error config_acelp1_IVAS(
    const Word16 enc_dec,                  /* i  : encoder/decoder flag            */
    const Word32 total_brate,              /* i  : total bitrate                   */
+54 −16
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@
/* RETURN ARGUMENTS :													  */
/* _ None																  */
/*========================================================================*/

#ifndef REMOVE_EVS_DUPLICATES
void Inac_swtch_ematch_fx(
    Word16 exc2[],             /* i/o: CELP/GSC excitation buffer       Q_exc*/
    Word16 dct_exc_tmp[],      /* i  : GSC excitation in DCT domain          */
@@ -155,8 +157,7 @@ void Inac_swtch_ematch_fx(

    return;
}


#endif
void Inac_switch_ematch_ivas_fx(
    Word16 exc2[],                         /* i/o: CELP/GSC excitation buffer       Q_exc*/
    Word16 dct_exc_tmp[],                  /* i  : GSC excitation in DCT domain          */
@@ -250,6 +251,21 @@ void Inac_switch_ematch_ivas_fx(
            exp = sub( exp, 14 );
            IF( LT_16( i, 2 ) )
            {
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
                    FOR( j = 0; j < 8; j++ )
                    {
                        L_tmp = L_mult( *pt_exc, ftmp );
                        L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/
                        *pt_exc = round_fx_sat( L_tmp );            /*Q_exc - 1*/
                        move16();
                        pt_exc++;
                    }
                }
                ELSE
#endif
                {
                    FOR( j = 0; j < 8; j++ )
                    {
                        L_tmp = L_mult0( *pt_exc, ftmp );
@@ -259,8 +275,24 @@ void Inac_switch_ematch_ivas_fx(
                        pt_exc++;
                    }
                }
            }
            ELSE
            {
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
                    FOR( j = 0; j < 16; j++ )
                    {
                        L_tmp = L_mult( *pt_exc, ftmp );
                        L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/
                        *pt_exc = round_fx_sat( L_tmp );            /*Q_exc - 1*/
                        move16();
                        pt_exc++;
                    }
                }
                ELSE
#endif
                {
                    FOR( j = 0; j < 16; j++ )
                    {
                        L_tmp = L_mult0( *pt_exc, ftmp );
@@ -271,10 +303,16 @@ void Inac_switch_ematch_ivas_fx(
                    }
                }
            }
        }

        /* Going back to time */
#ifdef REMOVE_EVS_DUPLICATES
        IF( GT_16( element_mode, EVS_MONO ) )
#endif
        {
            Scale_sig( dct_exc_tmp, 240, 1 ); // Q_exc
            Scale_sig( exc2, 240, 1 );        // Q_exc
        }
        edct_16fx( dct_exc_tmp, exc2, L_frame, 5, element_mode );
    }

+42 −18
Original line number Diff line number Diff line
@@ -1332,6 +1332,21 @@ void highband_exc_dct_in_ivas_fx(
        }
    }


#ifdef REMOVE_EVS_DUPLICATES
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
        Comp_and_apply_gain_fx( exc_diffQ, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 0, Qexc_diffQ, *Q_exc );

        IF( exc_wo_nf != NULL )
        {
            Comp_and_apply_gain_fx( exc_wo_nf, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 1, Qexc_diffQ, *Q_exc );
            Vr_add( exc_dct_in, exc_wo_nf, exc_wo_nf, L_frame );
        }
    }
    ELSE
    {
#endif
        Word16 Q_tmp = *Q_exc;
        move16();
        Word16 Q_old = *Q_exc;
@@ -1358,6 +1373,10 @@ void highband_exc_dct_in_ivas_fx(
        {
            Scale_sig( exc_dct_in, L_frame, sub( *Q_exc, Q_old ) );
        }
#ifdef REMOVE_EVS_DUPLICATES
    }
#endif

    /*--------------------------------------------------------------------------------------*
     * add the correction layer to the LF bins,
     * and add the quantized pulses or the noise for the higher part of the spectrum
@@ -1397,7 +1416,12 @@ void highband_exc_dct_in_ivas_fx(
            Q_hb_exc = 0;
            move16();
            envelop_modify_fx( exc_diffQ, seed_tcx, last_bin, Ener_per_bd_iQ, *Q_exc, &Q_hb_exc );
#ifdef REMOVE_EVS_DUPLICATES
            test();
            IF( GT_16( *Q_exc, Q_hb_exc ) && GT_16( element_mode, EVS_MONO ) )
#else
            IF( GT_16( *Q_exc, Q_hb_exc ) )
#endif
            {
                Scale_sig( exc_wo_nf, L_frame, sub( Q_hb_exc, *Q_exc ) );
                *Q_exc = Q_hb_exc;
+1 −1
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ void pre_echo_att_ivas_fx(
            tmp = BASOP_Util_Divide3232_Scale( *Last_frame_ener_fx, etmp_fx, &tmp_e ); /* numerator Q = 2 * Q_new + 1;  denominator Q = 31 - tmp_e */
            tmp_e = add( tmp_e, sub( sub( 31, etmp_e ), add( shl( Q_new, 1 ), 1 ) ) ); /* tmp_e = tmp_e + (31 - tmp_e) - (2 * Q_new + 1) */
            tmp = Sqrt16( tmp, &tmp_e );
            ratio_fx = shr( tmp, sub( 2, tmp_e ) ); /* Q13 */
            ratio_fx = shr_sat( tmp, sub( 2, tmp_e ) ); /* Q13 */

            /* Pre-echo atttenuation should never increase the energy */
            ratio_fx = s_min( ratio_fx, 8192 /* 1 in Q13 */ ); /* Q13 */
+93 −91
Original line number Diff line number Diff line
@@ -90,4 +90,6 @@

#define TEST_HR


#define REMOVE_EVS_DUPLICATES                   /* remove core-coder duplicated functions, ACELP low-band decoder */
#endif
Loading