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

Q info addition for decoder and renderer files - 1

parent 01446363
Loading
Loading
Loading
Loading
Loading
+92 −91
Original line number Diff line number Diff line
@@ -827,7 +827,7 @@ void compute_poly_product_fx( Word16 *coef, Word32 *p, Word16 order );
void dec_prm_hm_fx(
    Decoder_State *st,
    Word16 *prm_hm,
    Word16 *prm_hm, /* Q0 */
    const Word16 L_frame );
void msvq_dec(
    const Word16 *const *cb, /* i  : Codebook (indexed cb[*stages][levels][p])     (0Q15) */
@@ -6358,9 +6358,9 @@ void TonalMDCTConceal_SaveTimeSignal(
// decision_matrix_dec_fx.c
void decision_matrix_dec_fx(
    Decoder_State *st,          /* i/o: decoder state structure                   */
    Word16 *sharpFlag,          /* o  : formant sharpening flag                   */
    Word16 *hq_core_type,       /* o  : HQ core type                              */
    Word16 *core_switching_flag /* o  : ACELP->HQ switching frame flag            */
    Word16 *sharpFlag,          /* o  : formant sharpening flag Q0                */
    Word16 *hq_core_type,       /* o  : HQ core type Q0                           */
    Word16 *core_switching_flag /* o  : ACELP->HQ switching frame flag Q0         */
);
// hf_synth_fx.c
@@ -6627,60 +6627,60 @@ void PulseResynchronization_fx(
// gs_dec_fx.c
void decod_audio_fx(
    Decoder_State *st_fx,  /* i/o: decoder static memory                     */
    Word16 dct_epit[],     /* o  : GSC excitation in DCT domain              */
    const Word16 *Aq,      /* i  : LP filter coefficient                     */
    Word16 *pitch_buf,     /* o  : floating pitch values for each subframe   */
    Word16 *voice_factors, /* o  : voicing factors                           */
    Word16 *exc,           /* i/o: adapt. excitation exc                     */
    Word16 *exc2,          /* i/o: adapt. excitation/total exc               */
    Word16 *bwe_exc,       /* o  : excitation for SWB TBE                    */
    Word16 *lsf_new        /* i  : ISFs at the end of the frame              */
    Word16 dct_epit[],     /* o  : GSC excitation in DCT domain              Qx*/
    const Word16 *Aq,      /* i  : LP filter coefficient                     Q12*/
    Word16 *pitch_buf,     /* o  : floating pitch values for each subframe   Q6*/
    Word16 *voice_factors, /* o  : voicing factors                           Q15*/
    Word16 *exc,           /* i/o: adapt. excitation exc                     Q_exc*/
    Word16 *exc2,          /* i/o: adapt. excitation/total exc               Q_exc*/
    Word16 *bwe_exc,       /* o  : excitation for SWB TBE                    Q_exc*/
    Word16 *lsf_new        /* i  : ISFs at the end of the frame              Qx*/
    ,
    Word16 *gain_buf /*Q14*/
);
void decod_audio_ivas_fx(
    Decoder_State *st_fx,  /* i/o: decoder static memory						*/
    Word16 dct_epit[],     /* o  : GSC excitation in DCT domain              */
    const Word16 *Aq,      /* i  : LP filter coefficient                     */
    Word16 *pitch_buf,     /* o  : floating pitch values for each subframe   */
    Word16 *voice_factors, /* o  : voicing factors                           */
    Word16 *exc,           /* i/o: adapt. excitation exc                     */
    Word16 *exc2,          /* i/o: adapt. excitation/total exc               */
    Word16 *bwe_exc,       /* o  : excitation for SWB TBE                    */
    Word16 *lsf_new        /* i  : ISFs at the end of the frame              */
    Word16 dct_epit[],     /* o  : GSC excitation in DCT domain              Qx*/
    const Word16 *Aq,      /* i  : LP filter coefficient                     Q12*/
    Word16 *pitch_buf,     /* o  : Word16 pitch values for each subframe      Q6*/
    Word16 *voice_factors, /* o  : voicing factors                           Q15*/
    Word16 *exc,           /* i/o: adapt. excitation exc                     Q_exc*/
    Word16 *exc2,          /* i/o: adapt. excitation/total exc               Q_exc*/
    Word16 *bwe_exc,       /* o  : excitation for SWB TBE                    Q_exc*/
    Word16 *lsf_new        /* i  : ISFs at the end of the frame              Qx*/
    ,
    Word16 *gain_buf,                  /*Q14*/
    const Word16 tdm_lp_reuse_flag,    /* i  : LPC reuse flag                            */
    const Word16 tdm_low_rate_mode,    /* i  : secondary channel low rate mode flag      */
    const Word16 tdm_Pitch_reuse_flag, /* i  : primary channel pitch reuse flag          */
    const Word16 tdm_Pri_pitch_buf[]   /* i  : primary channel pitch buffer              */
    const Word16 tdm_lp_reuse_flag,    /* i  : LPC reuse flag                            Q0*/
    const Word16 tdm_low_rate_mode,    /* i  : secondary channel low rate mode flag      Q0*/
    const Word16 tdm_Pitch_reuse_flag, /* i  : primary channel pitch reuse flag          Q0*/
    const Word16 tdm_Pri_pitch_buf[]   /* i  : primary channel pitch buffer              Q6*/
);
void gsc_dec_fx(
    Decoder_State *st_fx,      /* i/o: State structure                                     */
    Word16 exc_dct_in[],       /* i/o: dct of pitch-only excitation / total excitation */
    const Word16 pit_band_idx, /* i  : bin position of the cut-off frequency   */
    const Word16 Diff_len,     /* i  : Lenght of the difference signal (before pure spectral)*/
    const Word16 bits_used,    /* i  : Number of bit used before frequency Q                 */
    const Word16 nb_subfr,     /* i  : Number of subframe considered             */
    const Word16 coder_type,   /* i  : coding type                                           */
    Word16 *last_bin,          /* i  : last bin of bit allocation                            */
    const Word16 *lsf_new,     /* i  : ISFs at the end of the frame                          */
    Word16 *exc_wo_nf,         /* o  : excitation (in f domain) without noisefill   */
    Word16 exc_dct_in[],       /* i/o: dct of pitch-only excitation / total excitation     Q_exc*/
    const Word16 pit_band_idx, /* i  : bin position of the cut-off frequency               Q0*/
    const Word16 Diff_len,     /* i  : Lenght of the difference signal (before pure spectral)	Q0*/
    const Word16 bits_used,    /* i  : Number of bit used before frequency Q               Q0*/
    const Word16 nb_subfr,     /* i  : Number of subframe considered                       Q0*/
    const Word16 coder_type,   /* i  : coding type                                         Q0*/
    Word16 *last_bin,          /* i  : last bin of bit allocation                          Q0*/
    const Word16 *lsf_new,     /* i  : ISFs at the end of the frame                        Qx*/
    Word16 *exc_wo_nf,         /* o  : excitation (in f domain) without noisefill          Q_exc*/
    Word16 Q_exc );
void gsc_dec_ivas_fx(
    Decoder_State *st_fx,      /* i/o: State structure                                     */
    Word16 exc_dct_in[],       /* i/o: dct of pitch-only excitation / total excitation     */
    const Word16 pit_band_idx, /* i  : bin position of the cut-off frequency               */
    const Word16 Diff_len,     /* i  : Lenght of the difference signal (before pure spectral)*/
    const Word16 bits_used,    /* i  : Number of bit used before frequency Q               */
    const Word16 nb_subfr,     /* i  : Number of subframe considered                       */
    const Word16 coder_type,   /* i  : coding type                                         */
    Word16 *last_bin,          /* i  : last bin of bit allocation                          */
    const Word16 *lsf_new,     /* i  : ISFs at the end of the frame                        */
    Word16 *exc_wo_nf,         /* o  : excitation (in f domain) without noisefill          */
    Word16 exc_dct_in[],       /* i/o: dct of pitch-only excitation / total excitation     Q_exc*/
    const Word16 pit_band_idx, /* i  : bin position of the cut-off frequency               `	Q0*/
    const Word16 Diff_len,     /* i  : Lenght of the difference signal (before pure spectral)	Q0*/
    const Word16 bits_used,    /* i  : Number of bit used before frequency Q					Q0*/
    const Word16 nb_subfr,     /* i  : Number of subframe considered							Q0*/
    const Word16 coder_type,   /* i  : coding type												Q0*/
    Word16 *last_bin,          /* i  : last bin of bit allocation								Q0*/
    const Word16 *lsf_new,     /* i  : ISFs at the end of the frame                        Qx*/
    Word16 *exc_wo_nf,         /* o  : excitation (in f domain) without noisefill          Q_exc*/
    Word16 *Q_exc );
void GSC_dec_init(
@@ -7647,8 +7647,8 @@ void dequantize_norms_fx(
// hdecnrm_fx.c
void hdecnrm_fx(
    Decoder_State *st_fx,  /* i/o: decoder state structure */
    const Word16 numNorms, /* (i)    number of norms */
    Word16 *index );       /* (o)    indices of quantized norms */
    const Word16 numNorms, /* (i)    number of norms				Q0*/
    Word16 *index );       /* (o)    indices of quantized norms		Q0*/
Word16 decode_huff_context_fx(
@@ -7658,31 +7658,32 @@ Word16 decode_huff_context_fx(
void hdecnrm_context_fx(
    Decoder_State *st_fx, /* i/o: decoder state structure */
    const Word16 N,
    Word16 *index,
    Word16 *n_length );
    const Word16 N,       /* Q0 */
    Word16 *index,        /* Q0 */
    Word16 *n_length      /* Q0 */
);
void hdecnrm_resize_fx(
    Decoder_State *st_fx, /* i/o: decoder state structure */
    const Word16 N,       /* (i)  number of SFMs */
    Word16 *index         /* (o)  norm quantization index vector */
    const Word16 N,       /* (i)  number of SFMs	Q0*/
    Word16 *index         /* (o)  norm quantization index vector	Q0*/
);
void huff_dec_fx(
    Decoder_State *st_fx,     /* i/o: decoder state structure                         */
    const Word16 N,           /* i  : Number of codewords to decode                   */
    const Word16 buffer_len,  /* i  : Number of bits to read                          */
    const Word16 num_lengths, /* i  : Number of different huffman codeword lengths    */
    const Word16 *thres,      /* i  : Threshold of first codeword of each length      */
    const Word16 *offset,     /* i  : Offset for first codeword                       */
    const Word16 *huff_tab,   /* i  : Huffman table order by codeword lengths         */
    Word16 *index             /* o  : Decoded index                                   */
    const Word16 N,           /* i  : Number of codewords to decode                   Q0*/
    const Word16 buffer_len,  /* i  : Number of bits to read                          Q0*/
    const Word16 num_lengths, /* i  : Number of different huffman codeword lengths    Q0*/
    const Word16 *thres,      /* i  : Threshold of first codeword of each length      Q0*/
    const Word16 *offset,     /* i  : Offset for first codeword                       Q0*/
    const Word16 *huff_tab,   /* i  : Huffman table order by codeword lengths         Q0*/
    Word16 *index             /* o  : Decoded index                                   Q0*/
);
void hdecnrm_tran_fx(
    Decoder_State *st_fx, /* i/o: decoder state structure		  */
    const Word16 N,       /* i  : number of norms           */
    Word16 *index         /* o  : indices of quantized norms */
    const Word16 N,       /* i  : number of norms				Q0*/
    Word16 *index         /* o  : indices of quantized norms	Q0*/
);
#endif
@@ -8129,24 +8130,24 @@ void music_postfilt_init(
// gs_dec_amr_wb.c
void improv_amr_wb_gs_fx(
    const Word16 clas,                 /* i  : signal frame class                  */
    const Word16 coder_type,           /* i  : coder type                          */
    const Word32 core_brate,           /* i  : bitrate allocated to the core       */
    Word16 *seed_tcx,                  /* i/o: Seed used for noise generation      */
    Word16 *old_Aq_fx,                 /* i/o: old LPC filter coefficient          */
    Word16 *mem_syn2_fx,               /* i/o: synthesis memory                    */
    const Word16 lt_voice_fac_fx,      /* i/o: long term voice factor       Q15    */
    const Word16 locattack,            /* i  : Flag for a detected attack          */
    Word16 *Aq_fx,                     /* i/o: Decoded LP filter coefficient       */
    Word16 *exc2_fx,                   /* i/o: Decoded complete excitation         */
    const Word16 clas,                 /* i  : signal frame class					Q0*/
    const Word16 coder_type,           /* i  : coder type							Q0*/
    const Word32 core_brate,           /* i  : bitrate allocated to the core		Q0*/
    Word16 *seed_tcx,                  /* i/o: Seed used for noise generation		Q0*/
    Word16 *old_Aq_fx,                 /* i/o: old LPC filter coefficient			q_old_Aq*/
    Word16 *mem_syn2_fx,               /* i/o: synthesis memory                    Q_syn*/
    const Word16 lt_voice_fac_fx,      /* i/o: long term voice factor			   Q14*/
    const Word16 locattack,            /* i  : Flag for a detected attack          Q0*/
    Word16 *Aq_fx,                     /* i/o: Decoded LP filter coefficient       q_Aq*/
    Word16 *exc2_fx,                   /* i/o: Decoded complete excitation         Q_exc2*/
    const Word16 Q_exc2,               /* i  : Exponent of Exc2						  */
    Word16 *mem_tmp_fx,                /* i/o: synthesis temporary memory          */
    Word16 *syn_fx,                    /*   o: Decoded synthesis to be updated     */
    const Word16 Q_syn,                /* i  : Synthesis scaling             Q0    */
    const Word16 *pitch_buf_fx,        /* i  : Decoded pitch buffer                */
    const Word16 Last_ener_fx,         /* i  : Last energy (Q8) */
    const Word16 rate_switching_reset, /* i  : rate switching reset flag           */
    const Word16 last_coder_type       /* i  : Last coder_type */
    Word16 *mem_tmp_fx,                /* i/o: synthesis temporary memory		   Q_syn*/
    Word16 *syn_fx,                    /*   o: Decoded synthesis to be updated     Q_syn*/
    const Word16 Q_syn,                /* i  : Synthesis scaling					  */
    const Word16 *pitch_buf_fx,        /* i  : Decoded pitch buffer				    Q6*/
    const Word16 Last_ener_fx,         /* i  : Last energy (Q8)                     Q0*/
    const Word16 rate_switching_reset, /* i  : rate switching reset flag            Q0*/
    const Word16 last_coder_type       /* i  : Last coder_type                      Q0*/
#ifdef ADD_IVAS_GS_DEC_IMPR
    ,
    const Word16 VeryLowRateSTflag /* i  : Enable the noise enhancement for very low rate stereo generic mode */
@@ -8715,13 +8716,13 @@ void getTCXparam_fx(
    Decoder_State *st,          /* i/o: Decoder State handle        */
    Decoder_State *st0,         /* i  : bitstream                   */
    CONTEXT_HM_CONFIG hm_cfg,   /* i/o: HM config                   */
    Word16 param[],             /* o  : decoded parameters          */
    const Word16 bits_common,   /* i  : number of common bits       */
    const Word16 start_bit_pos, /* i  : position of the start bit   */
    const Word16 *no_param_tns, /* i  : number of TNS parameters per subframe */
    Word16 p_param[2],          /* o  : pointer to parameters for next round of bs reading*/
    Word16 nTnsBitsTCX10[2],
    const Word16 pre_past_flag );
    Word16 param[],             /* o  : decoded parameters Q0         */
    const Word16 bits_common,   /* i  : number of common bits Q0       */
    const Word16 start_bit_pos, /* i  : position of the start bit Q0   */
    const Word16 *no_param_tns, /* i  : number of TNS parameters per subframe Q0 */
    Word16 p_param[2],          /* o  : pointer to parameters for next round of bs reading Q0 */
    Word16 nTnsBitsTCX10[2],    /*Q0*/
    const Word16 pre_past_flag /*Q0*/ );
void dec_prm_fx(
    Word16 *coder_type,
    Word16 param[],       /* (o) : decoded parameters               */
@@ -8733,10 +8734,10 @@ void dec_prm_fx(
void getLPCparam_fx(
    Decoder_State *st,           /* i/o: decoder memory state          */
    Word16 param_lpc[],          /* o  : LTP parameters                      */
    Word16 param_lpc[],          /* o  : LTP parameters Q0             */
    Decoder_State *st0,          /* i  : bitstream                     */
    const Word16 ch,             /* i  : channel                             */
    const Word16 sns_low_br_mode /* i  : SNS low-bitrate mode                */
    const Word16 ch,             /* i  : channel Q0                    */
    const Word16 sns_low_br_mode /* i  : SNS low-bitrate mode Q0       */
);
// ari_hm_fx.c
+13 −12
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
/*--------------------------------------------------------------------------*/
/* OUTPUT ARGUMENTS :													    */
/* _ (Word16*) pitch_buf_fx	: floating pitch values for each subframe Q6    */
/* _ (Word16*)	code_fx     : innovation                                    */
/* _ (Word16*)	code_fx     : innovation Q12                                    */
/*--------------------------------------------------------------------------*/
/* INPUT/OUTPUT ARGUMENTS :  											    */
/*  Decoder_State_fx *st_fx     : decoder state structure                   */
@@ -80,6 +80,7 @@ void dec_pit_exc_fx(
    Word16 gp_mem[NB_SUBFR - 1]; /* gain_pitch from previous subframes                   */
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move16();
#endif

    use_fcb = 0;
@@ -269,7 +270,7 @@ void dec_pit_exc_fx(
         * Find the total excitation
         *----------------------------------------------------------------------*/

        Rescale_exc( hMusicPF->dct_post_old_exc_fx, &exc_fx[i_subfr_fx], &bwe_exc_fx[shr( imult1616( i_subfr_fx, 2 * HIBND_ACB_L_FAC ), 1 )], hGSCDec->last_exc_dct_in_fx,
        Rescale_exc( hMusicPF->dct_post_old_exc_fx, &exc_fx[i_subfr_fx], &bwe_exc_fx[( i_subfr_fx * ( 2 * HIBND_ACB_L_FAC ) ) / 2], hGSCDec->last_exc_dct_in_fx,
                     L_subfr_fx, shr( imult1616( L_subfr_fx, 2 * HIBND_ACB_L_FAC ), 1 ), gain_code_fx, &( st_fx->Q_exc ), st_fx->Q_subfr, NULL, i_subfr_fx, coder_type );

        gain_code16 = round_fx( L_shl( gain_code_fx, st_fx->Q_exc ) ); /*Q_exc*/
@@ -285,7 +286,7 @@ void dec_pit_exc_fx(
                FOR( i = 0; i < L_subfr_fx; i++ )
                {
#ifdef BASOP_NOGLOB
                    L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[add( i, i_subfr_fx )] ), 1 ); /*Q16+Q_exc*/
                    L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); /*Q16+Q_exc*/
                    exc_fx[i + i_subfr_fx] = round_fx_sat( L_tmp );                        /*Q_exc*/
#else
                    L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 );                         /*Q16+Q_exc*/
@@ -300,7 +301,7 @@ void dec_pit_exc_fx(

                FOR( i = 0; i < L_subfr_fx; i++ )
                {
                    L_tmp = L_mult( gain_pitx2, exc_fx[add( i, i_subfr_fx )] ); /*Q16+Q_exc*/
                    L_tmp = L_mult( gain_pitx2, exc_fx[i + i_subfr_fx] ); /*Q16+Q_exc*/
#ifdef BASOP_NOGLOB
                    exc_fx[i + i_subfr_fx] = round_fx_sat( L_tmp ); /*Q_exc*/
#else
@@ -695,7 +696,7 @@ void dec_pit_exc_ivas_fx(
                move16();
            }
#ifdef BASOP_NOGLOB
            gain_code_fx = L_mult0( s_max( sub( 32767, shl_o( gain_pit_fx, 1, &Overflow ) ), 16384 ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/
            gain_code_fx = L_mult0( s_max( sub( 32767, shl_o( gain_pit_fx, 1, &Overflow ) ), 16384 /*0.5.Q15*/ ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/
#else
            gain_code_fx = L_mult0( s_max( sub( 32767, shl( gain_pit_fx, 1 ) ), 16384 ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/
#endif
@@ -704,7 +705,7 @@ void dec_pit_exc_ivas_fx(
        /*----------------------------------------------------------------------*
         * Find the total excitation
         *----------------------------------------------------------------------*/
        Rescale_exc( hMusicPF->dct_post_old_exc_fx, &exc_fx[i_subfr_fx], &bwe_exc_fx[shr( imult1616( i_subfr_fx, 2 * HIBND_ACB_L_FAC ), 1 )], hGSCDec->last_exc_dct_in_fx,
        Rescale_exc( hMusicPF->dct_post_old_exc_fx, &exc_fx[i_subfr_fx], &bwe_exc_fx[( i_subfr_fx * ( 2 * HIBND_ACB_L_FAC ) ) / 2], hGSCDec->last_exc_dct_in_fx,
                     L_subfr_fx, shr( imult1616( L_subfr_fx, 2 * HIBND_ACB_L_FAC ), 1 ), gain_code_fx, &( st_fx->Q_exc ), st_fx->Q_subfr, NULL, i_subfr_fx, coder_type );

        gain_code16 = round_fx( L_shl( gain_code_fx, st_fx->Q_exc ) ); /*Q_exc*/
@@ -726,8 +727,8 @@ void dec_pit_exc_ivas_fx(
            {
                FOR( i = 0; i < L_subfr_fx; i++ )
                {
                    L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[add( i, i_subfr_fx )] ), 1 ); /*Q16+Q_exc*/
                    exc_fx[add( i, i_subfr_fx )] = round_fx( L_tmp );                        /*Q_exc*/
                    L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); /*Q16+Q_exc*/
                    exc_fx[i + i_subfr_fx] = round_fx( L_tmp );                        /*Q_exc*/
                    move16();
                }
            }
@@ -737,8 +738,8 @@ void dec_pit_exc_ivas_fx(

                FOR( i = 0; i < L_subfr_fx; i++ )
                {
                    L_tmp = L_mult( gain_pitx2, exc_fx[add( i, i_subfr_fx )] ); /*Q16+Q_exc*/
                    exc_fx[add( i, i_subfr_fx )] = round_fx( L_tmp );           /*Q_exc*/
                    L_tmp = L_mult( gain_pitx2, exc_fx[i + i_subfr_fx] ); /*Q16+Q_exc*/
                    exc_fx[i + i_subfr_fx] = round_fx( L_tmp );           /*Q_exc*/
                    move16();
                }
            }
@@ -859,7 +860,7 @@ void dec_pit_exc_ivas_fx(
            p_Aq_fx += 4 * ( M + 1 );

            /* update gains for FEC - equivalent to lp_gain_updt() */
            st_fx->lp_gainp_fx = gain_pit_fx;
            st_fx->lp_gainp_fx = gain_pit_fx; // Q14
            move16();
            st_fx->lp_gainc_fx = 0;
            move16();
+141 −137

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ ivas_error decod_ppp_fx(
    /* call voiced decoder at this point */
    FOR( k = 0; k < M; k++ )
    {
        p_Aq_curr_fx[k] = Aq_fx[add( k, ( 3 * ( M + 1 ) ) + 1 )];
        p_Aq_curr_fx[k] = Aq_fx[( k + ( 3 * ( M + 1 ) ) + 1 )];
        move16(); /*Q12 */
    }

+306 −273

File changed.

Preview size limit exceeded, changes collapsed.

Loading