Unverified Commit 4b0dc2dc authored by norvell's avatar norvell
Browse files

Merge branch 'main' into...

Merge branch 'main' into basop-2235-td-renderer-mismatch-between-model-data-word16-and-calculations-word32
parents 98cba803 cf7f073c
Loading
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -1601,6 +1601,7 @@ void ivas_hq_core_dec_fx(
    Word16 *Q_output 
);

#ifndef HARMONIZE_TBE
void ivas_HQ_FEC_Mem_update_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
    Word32 *t_audio_q_fx,                                       /*Q12*/
@@ -1616,6 +1617,7 @@ void ivas_HQ_FEC_Mem_update_fx(
    Word16 hq_core_type,                                        /* i : normal or low-rate MDCT(HQ) core         */
    Word16 output_frame 
);
#endif
/* o  : Consumed bits  Q0 */
Word16 ivas_hq_classifier_dec_fx(                          
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
@@ -1865,6 +1867,7 @@ void stereoFdCngCoherence_fx(
    Word16 fft_exp 
);

#ifndef HARMONIZE_TBE
void ivas_wb_tbe_dec_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
    const Word16 coder_type,                                    /* i  : coding type                             */
@@ -1893,7 +1896,7 @@ void GenShapedWBExcitation_ivas_fx(
    const Word16 uv_flag,                                       /* i : unvoiced flag                            */
    const Word16 igf_flag 
);

#endif
/* o : Q_syn_hb*/
Word16 ivas_wb_bwe_dec_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
@@ -2060,19 +2063,37 @@ UWord32 ivas_syn_output_fx(
    Word16 *synth_out                                           /* o  : integer 16 bits synthesis signal            */
);

#ifdef FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER
void ivas_buffer_interleaved_to_deinterleaved_fx(
    Word32 *audio_in,                                           /* i  : interleaved audio buffer                                */
    Word32 *audio_out[],                                        /* o  : pointers to each channel of deinterleaved audio buffer  */
    const Word16 n_channels,                                    /* i  : number of channels                                      */
    const Word16 frame_length                                   /* i  : frame length (one channel)                              */
);
#else
void ivas_buffer_interleaved_to_deinterleaved_fx(
    Word32 *audio,                                              /* i/o: audio buffer                                */
    const Word16 n_channels,                                    /* i  : number of channels                          */
    const Word16 frame_length,                                  /* i  : frame length (one channel)                  */
    const Word16 n_samp_full                                    /* i  : full frame length (one channel)             */
);
#endif

#ifdef FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER
void ivas_buffer_deinterleaved_to_interleaved_fx(
    Word32 *audio_in[],                                         /* i  : pointers to each channel of deinterleaved audio buffer  */
    Word32 *audio_out,                                          /* o  : interleaved audio buffer                                */
    const Word16 n_channels,                                    /* i  : number of channels                                      */
    const Word16 frame_length                                   /* i  : frame length (one channel)                              */
);
#else
void ivas_buffer_deinterleaved_to_interleaved_fx(
    Word32 *audio[],                                            /* i  : deinterleaved audio buffer                  */
    const Word16 n_channels,                                    /* i  : number of channels                          */
    const Word16 frame_length,                                  /* i  : frame length (one channel)                  */
    Word32 *audio_out                                           /* o  : interleaved audio buffer                    */
);
#endif

void stereo_tcx_core_dec_fx(
    Decoder_State *st,                                          /* i/o: decoder state structure                     */
+16 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ void Copy_Quat_fx(


/*-------------------------------------------------------------------------
 * Scale_Quat_fx()
 * modify_Quat_q_fx()
 *
 * Quaternion q factor modification
 *------------------------------------------------------------------------*/
@@ -124,10 +124,18 @@ void modify_Quat_q_fx(
    Word16 q_new                    /* i  : quaternion describing the rotation             */
)
{
#ifdef FIX_BASOP_2361_OTR
    Word16 shift = sub( q_new, in_quat->q_fact );
    out_quat->w_fx = L_shl_sat( in_quat->w_fx, shift ); // q_new
    out_quat->x_fx = L_shl_sat( in_quat->x_fx, shift ); // q_new
    out_quat->y_fx = L_shl_sat( in_quat->y_fx, shift ); // q_new
    out_quat->z_fx = L_shl_sat( in_quat->z_fx, shift ); // q_new
#else
    out_quat->w_fx = L_shl_sat( in_quat->w_fx, sub( q_new, in_quat->q_fact ) ); // q_new
    out_quat->x_fx = L_shl_sat( in_quat->x_fx, sub( q_new, in_quat->q_fact ) ); // q_new
    out_quat->y_fx = L_shl_sat( in_quat->y_fx, sub( q_new, in_quat->q_fact ) ); // q_new
    out_quat->z_fx = L_shl_sat( in_quat->z_fx, sub( q_new, in_quat->q_fact ) ); // q_new
#endif
    out_quat->q_fact = q_new;
    return;
}
@@ -147,12 +155,19 @@ void modify_Rmat_q_fx(
)
{
    Word16 j, k;
#ifdef FIX_BASOP_2361_OTR
    Word16 shift = sub( q_new, q_cur );
#endif

    FOR( j = 0; j < 3; j++ )
    {
        FOR( k = 0; k < 3; k++ )
        {
#ifdef FIX_BASOP_2361_OTR
            Rmat_out[j][k] = L_shl( Rmat_in[j][k], shift );
#else
            Rmat_out[j][k] = L_shl( Rmat_in[j][k], sub( q_new, q_cur ) );
#endif
            move32();
        }
    }
+66 −0
Original line number Diff line number Diff line
@@ -160,6 +160,38 @@ UWord32 ivas_syn_output_fx(
 * Convert an interleaved buffer of audio channels to deinterleaved one
 *-------------------------------------------------------------------*/

#ifdef FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER
void ivas_buffer_interleaved_to_deinterleaved_fx(
    Word32 *audio_in,         /* i  : interleaved audio buffer                                */
    Word32 *audio_out[],      /* o  : pointers to each channel of deinterleaved audio buffer  */
    const Word16 n_channels,  /* i  : number of channels                                      */
    const Word16 frame_length /* i  : frame length (one channel)                              */
)
{
    Word16 ch, s;
    Word32 buffer[MAX_TRANSPORT_CHANNELS][MAX_JBM_L_FRAME48k]; /* temp buffer needed when "*audio_in" and "*audio_out[]" point to the same memory */

    FOR( ch = 0; ch < n_channels; ch++ )
    {
        FOR( s = 0; s < frame_length; s++ )
        {
            buffer[ch][s] = audio_in[s * n_channels + ch];
            move32();
        }
    }

    FOR( ch = 0; ch < n_channels; ch++ )
    {
        FOR( s = 0; s < frame_length; s++ )
        {
            audio_out[ch][s] = buffer[ch][s];
            move32();
        }
    }

    return;
}
#else
void ivas_buffer_interleaved_to_deinterleaved_fx(
    Word32 *audio,             /* i/o: audio buffer                    */
    const Word16 n_channels,   /* i  : number of channels              */
@@ -189,6 +221,7 @@ void ivas_buffer_interleaved_to_deinterleaved_fx(

    return;
}
#endif


/*-------------------------------------------------------------------*
@@ -197,6 +230,38 @@ void ivas_buffer_interleaved_to_deinterleaved_fx(
 * Convert a deinterleaved buffer of audio channels to interleaved one
 *-------------------------------------------------------------------*/

#ifdef FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER
void ivas_buffer_deinterleaved_to_interleaved_fx(
    Word32 *audio_in[],       /* i  : pointers to each channel of deinterleaved audio buffer  */
    Word32 *audio_out,        /* o  : interleaved audio buffer                                */
    const Word16 n_channels,  /* i  : number of channels                                      */
    const Word16 frame_length /* i  : frame length (one channel)                              */
)
{
    Word16 ch, s;
    Word32 buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio_in[]" and "*audio_out" point to the same memory */

    FOR( ch = 0; ch < n_channels; ch++ )
    {
        FOR( s = 0; s < frame_length; s++ )
        {
            buffer[ch][s] = audio_in[ch][s];
            move32();
        }
    }

    FOR( ch = 0; ch < n_channels; ch++ )
    {
        FOR( s = 0; s < frame_length; s++ )
        {
            audio_out[s * n_channels + ch] = buffer[ch][s];
            move32();
        }
    }

    return;
}
#else
void ivas_buffer_deinterleaved_to_interleaved_fx(
    Word32 *audio[],           /* i/o: deinterleaved audio buffer      */
    const Word16 n_channels,   /* i  : number of channels              */
@@ -224,6 +289,7 @@ void ivas_buffer_deinterleaved_to_interleaved_fx(

    return;
}
#endif


/*-------------------------------------------------------------------*
+4 −0
Original line number Diff line number Diff line
@@ -108,6 +108,8 @@
#define FIX_2383_INIT_Q_A_ITF                           /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2391_INIT_HQ_GENERIC_OFFSET                 /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */
#define FIX_2397_COPY_AQ_MDCT_CORE_BFI                  /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */
#define HARMONIZE_TBE                                   /* VA: harmonize core-coder TBE function duplications */

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

@@ -117,8 +119,10 @@
#define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT  /* Dolby: Issue 2250:  random vector generation in GenShapedSHBExcitation() */
#define FIX_2338_HARM_GSC_GAIN_COMP                     /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */
#define FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG       /* Eri: Basop issue 2317: Uninitialized value read in case of DTX and BW switching   */
#define FIX_BASOP_2361_OTR                              /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */
#define FIX_1283_STEREO_DFT_COLLAPSE                    /* FhG: float issue 1283: fix for critical issue with DFT stereo core coder */
#define FIX_2379_REMOVE_previoussynth_fx_32             /* VA: basop issue 2379: remove duplicated buffer st->previoussynth_fx_32[] */
#define FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER           /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */

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

+75 −47
Original line number Diff line number Diff line
@@ -2856,11 +2856,12 @@ void Calc_rc0_h(
    Word16 *rc0 /* o  : 1st parcor */
);
#ifndef HARMONIZE_TBE
void Calc_rc0_h_ivas_enc_fx(
    Word16 *h,  /* i  : impulse response of composed filter */
    Word16 *rc0 /* o  : 1st parcor */
);
#endif
void PostShortTerm_fx(
    Word16 *sig_in,             /* i  : i   signal (pointer to current subframe */
    Word16 *lpccoeff,           /* i  : LPC coefficients for current subframe */
@@ -2915,12 +2916,33 @@ void GenShapedWBExcitation_fx(
    const Word16 coder_type,          /* i   : coding type                            */
    const Word16 element_mode,        /* i   : element mode                           */
    const Word16 *bwe_exc_extended,   /* i   : bandwidth extended exciatation         */
    const Word16 Q_bwe_exc,
    const Word16 Q_bwe_exc,           /* i   : Q for memories                         */
    Word16 bwe_seed[],                /* i/o : random number generator seed           */
    const Word16 voice_factors[],     /* i   : voicing factor                         */
    const Word16 signal_type,
    const Word16 igf_flag );
#ifdef HARMONIZE_TBE
void GenShapedWBExcitation_ivas_fx(
    Word16 *excSHB,                   /* o  : synthesized shaped shb exctiation   Q_bwe_exc*/
    const Word16 *lpc_shb,            /* i  : lpc coefficients Q12                         */
    Word16 *exc4kWhtnd,               /* o  : whitened synthesized shb excitation Q_bwe_exc*/
    Word32 *mem_csfilt,               /* i/o: memory                           Q_bwe_exc+16*/
    Word16 *mem_genSHBexc_filt_down1, /* i/o: memory                              Q_bwe_exc*/
    Word16 *mem_genSHBexc_filt_down2, /* i/o: memory                              Q_bwe_exc*/
    Word16 *mem_genSHBexc_filt_down3, /* i/o: memory                              Q_bwe_exc*/
    Word16 *state_lpc_syn,            /* i/o: memory                              Q_bwe_exc*/
    const Word16 coder_type,          /* i  : coding type                                  */
    const Word16 element_mode,        /* i  : element mode                                 */
    const Word16 *bwe_exc_extended,   /* i  : bwidth extended exciatation         Q_bwe_exc*/
    const Word16 Q_bwe_exc,           /* i  : Q for memories                               */
    Word16 bwe_seed[],                /* i/o: random number generator seed                 */
    const Word16 voice_factors[],     /* i  : voicing factor                            Q15*/
    const Word16 uv_flag,             /* i  : unvoiced flag                                */
    const Word16 igf_flag             /* i  : IGF flag                                     */
);
#endif
void GenWBSynth_fx(
    const Word16 *input_synspeech, /* i  : i   synthesized speech                  */
    Word16 *shb_syn_speech_16k,    /* o  : output highband compnent                */
@@ -3094,7 +3116,7 @@ void ScaleShapedWB_fx(
    const Word32 frame_gain, /* i  : frame gain                                                  */
    const Word16 *win,       /* i  : window                                                      */
    const Word16 *subwin,    /* i  : subframes window                                            */
    const Word16 Q_bwe_exc,
    const Word16 Q_bwe_exc,  /* i  : Q for memories                                              */
    Word16 L_frame,          /* i  : Frame length - determines whether 12.8 or 16kHz core in-use */
    Word16 dynQ,             /* i  : indicate whether output is dynamic Q, or Q0                 */
    Word16 *Qx,              /* o  : newly computed Q factor for  synSHB                         */
@@ -5775,6 +5797,7 @@ void swb_tbe_dec_fx(
    Word16 *Q_synth,
    Word16 *pitch_buf );
#ifndef HARMONIZE_TBE
void ivas_dequantizeSHBparams_fx_9_1(
    Decoder_State *st_fx,
    const Word16 extl,        /* i  : extension layer                 */
@@ -5787,8 +5810,9 @@ void ivas_dequantizeSHBparams_fx_9_1(
    Word16 *Q_shb_res_gshape, /* o  : Q14                                         */
    Word16 *Q_mixFactors,     /* o  : Q15                                         */
    Word16 *MSFlag );
#endif
void fb_tbe_dec_fx(
#ifndef HARMONIZE_TBE
    Decoder_State *st,     /* i/o: encoder state structure                 */
    const Word16 fb_exc[], /* i  : FB excitation from the SWB part         */
    Word16 Q_fb_exc,
@@ -5796,9 +5820,13 @@ void fb_tbe_dec_fx(
    Word16 hb_synth_exp );
void fb_tbe_dec_ivas_fx(
#endif
    Decoder_State *st,     /* i/o: encoder state structure                 */
    const Word16 fb_exc[], /* i  : FB excitation from the SWB part         */
    Word16 Q_fb_exc,
#ifdef HARMONIZE_TBE
    Word16 *hb_synth16, /* o  : high-band synthesis                    Q(15 - hb_synth_exp) */
#endif
    Word32 *hb_synth, /* o  : high-band synthesis                     */
    Word16 hb_synth_exp,
    Word16 *fb_synth_ref,
Loading