Commit b413e549 authored by Manuel Jander's avatar Manuel Jander
Browse files

Resolve merge conflict.

parents 28f004f9 98e55cf7
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -1257,8 +1257,8 @@ int main(
    /* Set up output custom layout configuration */
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.azimuth, args.outConfig.outSetupCustom.azimuth_fx, Q22, args.outConfig.outSetupCustom.num_spk );
        floatToFixed_arrL_app( args.outConfig.outSetupCustom.elevation, args.outConfig.outSetupCustom.elevation_fx, Q22, args.outConfig.outSetupCustom.num_spk );
        if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_ConfigureCustomOutputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) );
@@ -1362,8 +1362,8 @@ int main(

        if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
        {
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, RENDERER_MAX_OUTPUT_CHANNELS );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.azimuth, args.inConfig.inSetupCustom.azimuth_fx, Q22, args.inConfig.inSetupCustom.num_spk );
            floatToFixed_arrL_app( args.inConfig.inSetupCustom.elevation, args.inConfig.inSetupCustom.elevation_fx, Q22, args.inConfig.inSetupCustom.num_spk );
            if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in IVAS_REND_ConfigureCustomInputLoudspeakerLayout(): %s\n", ivas_error_to_string( error ) );
@@ -2763,6 +2763,13 @@ static CmdlnArgs defaultArgs(

    args.inConfig.inSetupCustom.num_spk = 0;
    args.inConfig.inSetupCustom.num_lfe = 0;
    for ( i = 0; i < RENDERER_MAX_INPUT_CHANNELS; i++ )
    {
        args.inConfig.inSetupCustom.azimuth[i] = 0.f;
        args.inConfig.inSetupCustom.azimuth_fx[i] = 0;
        args.inConfig.inSetupCustom.elevation[i] = 0.f;
        args.inConfig.inSetupCustom.elevation_fx[i] = 0;
    }
    args.inConfig.numAudioObjects = 0;
    args.inConfig.numAmbisonicsBuses = 0;
    args.inConfig.numMultiChannelBuses = 0;
@@ -2771,6 +2778,13 @@ static CmdlnArgs defaultArgs(
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID;
    args.outConfig.outSetupCustom.num_spk = 0;
    args.outConfig.outSetupCustom.num_lfe = 0;
    for ( i = 0; i < RENDERER_MAX_OUTPUT_CHANNELS; i++ )
    {
        args.outConfig.outSetupCustom.azimuth[i] = 0.f;
        args.outConfig.outSetupCustom.azimuth_fx[i] = 0;
        args.outConfig.outSetupCustom.elevation[i] = 0.f;
        args.outConfig.outSetupCustom.elevation_fx[i] = 0;
    }
    for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i )
    {
        args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID;
+24 −6
Original line number Diff line number Diff line
@@ -180,12 +180,14 @@ IF( GT_16( element_mode, IVAS_SCE ) )
{
    return;
}

/*---------------------------------------------------------------------*
 * Generate white noise vector
 *---------------------------------------------------------------------*/

/*for ( i=0; i<L_frame; i++ )exc2[i] = (float)own_random( seed );*/
Random_Fill( seed, L_frame, exc2, 4 );

/*------------------------------------------------------------*
 * Insert random variation for excitation energy
 *  (random variation is scaled according to *lp_ener value)
@@ -240,6 +242,7 @@ FOR( i_subfr = 0; i_subfr < L_frame; i_subfr += L_SUBFR )
        move16();
    }
}

IF( NE_16( Opt_AMR_WB, 1 ) )
{
    Copy( exc2, exc3, L_FRAME16k );
@@ -538,7 +541,6 @@ IF( NE_16( Opt_AMR_WB, 1 ) )
    }
    L_tmp2 = L_shr( L_tmp2, sub( add( Q_exc, Q_exc ), 5 ) ); /*Q6*/


    /*  enr = (*lp_ener)/enr; */
    /*  ftmp = sqrt(enr); */
    L_tmp = L_max( 1, *lp_ener ); /*Q6*/
@@ -592,12 +594,15 @@ ELSE
return;
}


/*-------------------------------------------------------*
 * cng_params_postupd_fx
 *
 * Post-update of CNG parameters
 *-------------------------------------------------------*/

void cng_params_postupd_fx(
#ifndef HARM_NON_LINEARITY
    const Word16 ho_circ_ptr,          /* i  : pointer for CNG averaging buffers                  Q0    */
    Word16 *cng_buf_cnt,               /* i/o: counter for CNG store buffers                      Q0    */
    const Word16 *const cng_exc2_buf,  /* i  : Excitation buffer                                  Q_exc */
@@ -702,6 +707,7 @@ void cng_params_postupd_fx(
}

void cng_params_postupd_ivas_fx(
#endif
    const Word16 ho_circ_ptr,          /* i  : pointer for CNG averaging buffers                  Q0    */
    Word16 *cng_buf_cnt,               /* i/o: counter for CNG store buffers                      Q0    */
    const Word16 *const cng_exc2_buf,  /* i  : Excitation buffer                                  Q_exc */
@@ -781,7 +787,6 @@ void cng_params_postupd_ivas_fx(
        }
        ELSE
        {

            CNG_mode = get_cng_mode( last_active_brate );

            /* att = 1/pow(2,ENR_ATT_fx[CNG_mode]); */
@@ -828,6 +833,7 @@ void cng_params_postupd_ivas_fx(
 *
 * update CNG parameters
 *-------------------------------------------------------*/
#ifndef HARM_NON_LINEARITY
void cng_params_upd_fx(
    const Word16 lsp_new[],        /* i  : LSP aprameters                                     Q15   */
    const Word16 exc2[],           /* i  : current enhanced excitation                        Q_exc */
@@ -997,8 +1003,13 @@ void cng_params_upd_fx(

    return;
}
#endif

#ifdef HARM_NON_LINEARITY
void cng_params_upd_fx(
#else
void cng_params_upd_ivas_fx(
#endif
    const Word16 lsp_new[],         /* i  : LSP aprameters                                     Q15   */
    const Word16 exc2[],            /* i  : current enhanced excitation                        Q_exc */
    const Word16 L_frame,           /* i  : frame length                                       Q0    */
@@ -1008,7 +1019,7 @@ void cng_params_upd_ivas_fx(
    Word16 ho_lsp_circ[],           /* o  : old LSP buffer for CNG averaging                   Q15   */
    const Word16 Q_exc,             /* i  : Q value of excitation                                    */
    const Word16 enc_dec_flag,      /* i  : Flag indicating encoder or decoder (ENC,DEC)             */
    Word32 ho_env_circ[],           /* i/o: Envelope buffer                                    Q(6+shift)    */
    Word32 ho_env_circ[],           /* i/o: Envelope buffer                            Q6/Q(6+shift) */
    Word16 *cng_buf_cnt,            /* i/o: Counter of postponed FFT-processing instances            */
    Word16 cng_exc2_buf[],          /* i/o: Excitation buffer                                  Q_exc */
    Word16 cng_Qexc_buf[],          /* i/o: Q_exc buffer                                       Q0    */
@@ -1176,10 +1187,17 @@ void cng_params_upd_ivas_fx(
        /* update the circular buffer of old residual envelope */
        /* Copy32( env, &(ho_env_circ[add(shl(*ho_circ_ptr,4),shl(*ho_circ_ptr,2))]), NUM_ENV_CNG ); */
        Copy32( env, &( ho_env_circ[( *ho_circ_ptr ) * NUM_ENV_CNG] ), NUM_ENV_CNG );
#ifdef HARM_NON_LINEARITY
        IF( NE_16( element_mode, EVS_MONO ) )
#endif
        {
            scale_sig32( &( ho_env_circ[( *ho_circ_ptr ) * NUM_ENV_CNG] ), NUM_ENV_CNG, shift ); // Q(6+shift)
        }
    }

    *ho_circ_size = add( *ho_circ_size, 1 );
    move16();

    if ( GT_16( *ho_circ_size, HO_HIST_SIZE ) )
    {
        *ho_circ_size = HO_HIST_SIZE;
+12 −0
Original line number Diff line number Diff line
@@ -1150,11 +1150,19 @@ void highband_exc_dct_in_ivas_fx(
    test();
    IF( bfi || LT_32( core_brate, 6000 ) || ( LT_32( core_brate, 8600 ) && EQ_16( coder_type, UNVOICED ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107, MBANDS_GN ); /*0.4 in Q15 */
#else
        set16_fx( noisepb, 13107, last_bin ); /*0.4 in Q15 */
#endif
    }
    ELSE IF( EQ_16( GSC_IVAS_mode, 3 ) || ( GSC_IVAS_mode > 0 && EQ_16( GSC_noisy_speech, 1 ) ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 13107 /*0.4f*/, MBANDS_GN16k );
#else
        set16_fx( noisepb, 13107 /*0.4f*/, last_bin );
#endif
    }
    ELSE
    {
@@ -1171,7 +1179,11 @@ void highband_exc_dct_in_ivas_fx(

    IF( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && LE_16( element_mode, IVAS_SCE ) )
    {
#ifndef FIX_1478_UNINIT_ON_BFI
        set16_fx( noisepb, 3277, MBANDS_GN );
#else
        set16_fx( noisepb, 3277, last_bin );
#endif
    }

    test();
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@
#define HARM_CORECODER_UPDT                             /* VA: basop issue 2342: Remove duplicated code in core-coder common update functions */
#define HARM_CORE_SW                                    /* VA: basop issue 2314: Remove duplicated code in the core switching */
#define HARM_PREPROC                                    /* VA: basop issue 2339: Remove duplicated code in the core-coder DTX  */
#define HARM_NON_LINEARITY                              /* VA: basop issue 2345: Remove duplicated code in core-coder: non_linearity_fx() and LP CNG */

/* #################### End BE switches ################################## */

@@ -118,6 +119,7 @@
#define OPT_2308_FIND_TARGET                            /* VA: Issue 2308, Speeds up computation and improve accuracy of the impulse response */
#define OPT_NBE_2311_HARM_GSC_GAIN                      /* VA: issue 2311: non-BE part of the GSC gain harmonization */
#define FIX_2261_REMOVE_LP_RESCALING                    /* VA: Remove of unnecessary lpc coefficient rescaling */
#define FIX_2320_OOB_SCE_SWITCHING                      /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */

/* ##################### End NON-BE switches ########################### */

+25 −15
Original line number Diff line number Diff line
@@ -3165,16 +3165,20 @@ void ScaleShapedWB_fx(
);
void non_linearity_fx(
#ifdef HARM_NON_LINEARITY
    const Word16 element_mode, /* i  : element mode               */
#endif
    const Word16 i[],        /* i  : i signal    Q_inp          */
    Word32 output[],         /* o  : output signal   2*Q_inp    */
    const Word16 length,     /* i  : i length                   */
    Word32 *prev_scale,      /* i/o: memory          Q30        */
    Word16 Q_inp,
    Word16 coder_type,     /* i  : Coder Type                     */
    const Word16 Q_inp,      /* i  : scaling of input           */
    const Word16 coder_type, /* i  : Coder Type                 */
    Word16 *voice_factors,   /* i  : Voice Factors              */
    const Word16 L_frame     /* i  : ACELP frame length         */
);
#ifndef HARM_NON_LINEARITY
void non_linearity_ivas_fx(
    const Word16 i[],    /* i  : i   signal    Q_inp          */
    Word32 output[],     /* o  : output signal   2*Q_inp      */
@@ -3185,7 +3189,7 @@ void non_linearity_ivas_fx(
    Word16 *voice_factors, /* i  : Voice Factors                  */
    const Word16 L_frame   /* i  : ACELP frame length             */
);
#endif
void interp_code_5over2_fx(
    const Word16 inp_code[], /* i  : i   vector                */
    Word16 interp_code[],    /* o  : output vector             */
@@ -4003,6 +4007,7 @@ void CNG_exc_fx(
);
void cng_params_postupd_fx(
#ifndef HARM_NON_LINEARITY
    const Word16 ho_circ_ptr,          /* i  : pointer for CNG averaging buffers                  Q0    */
    Word16 *cng_buf_cnt,               /* i/o: counter for CNG store buffers                      Q0    */
    const Word16 *const cng_exc2_buf,  /* i  : Excitation buffer                                  Q_exc */
@@ -4012,6 +4017,7 @@ void cng_params_postupd_fx(
);
void cng_params_postupd_ivas_fx(
#endif
    const Word16 ho_circ_ptr,          /* i  : pointer for CNG averaging buffers                  Q0    */
    Word16 *cng_buf_cnt,               /* i/o: counter for CNG store buffers                      Q0    */
    const Word16 *const cng_exc2_buf,  /* i  : Excitation buffer                                  Q_exc */
@@ -4023,6 +4029,7 @@ void cng_params_postupd_ivas_fx(
);
void cng_params_upd_fx(
#ifndef HARM_NON_LINEARITY
    const Word16 lsp_new[],        /* i  : LSP parameters                                     Q15   */
    const Word16 exc2[],           /* i  : current enhanced excitation                        Q_exc */
    const Word16 L_frame,          /* i  : frame length                                       Q0    */
@@ -4041,6 +4048,7 @@ void cng_params_upd_fx(
);
void cng_params_upd_ivas_fx(
#endif
    const Word16 lsp_new[],         /* i  : LSP aprameters                                     Q15   */
    const Word16 exc2[],            /* i  : current enhanced excitation                        Q_exc */
    const Word16 L_frame,           /* i  : frame length                                       Q0    */
@@ -6159,6 +6167,7 @@ void swb_CNG_dec_fx(
    const Word16 Qsyn       /* i  : Q value of ACELP core synthesis          */
);
#ifndef HARM_NON_LINEARITY
void swb_CNG_dec_ivas_fx(
    Decoder_State *st_fx,   /* i/o: State structure                          */
    const Word16 *synth_fx, /* i  : ACELP core synthesis at 32kHz        Qsyn*/
@@ -6166,7 +6175,7 @@ void swb_CNG_dec_ivas_fx(
    const Word16 sid_bw,    /* i  : 0-NB/WB, 1-SWB SID                     Q0*/
    const Word16 Qsyn       /* i  : Q value of ACELP core synthesis          */
);
#endif
void td_cng_dec_init_fx(
    DEC_CORE_HANDLE st /* i/o: decoder state structure     */
);
@@ -10722,12 +10731,13 @@ void writeTCXparam_fx(
    const Word16 target_bitsTCX10[2],
    const Word16 pre_past_flag );
#ifndef HARM_NON_LINEARITY
void calculate_hangover_attenuation_gain_ivas_fx(
    Encoder_State *st,          /* i  : encoder state structure         */
    Word16 *att,                /* o  : attenuation factor              */
    const Word16 vad_hover_flag /* i  : VAD hangover flag               */
);
#endif
void init_coder_ace_plus_ivas_fx(
    Encoder_State *st,             /* i  : Encoder state                          */
    const Word32 last_total_brate, /* i  : last total bitrate                     */
Loading