Loading apps/renderer.c +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include "split_rend_bfi_file_reader.h" #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "basop32.h" #define WMC_TOOL_SKIP Loading lib_com/basop32.c +1 −1 Original line number Diff line number Diff line Loading @@ -1268,7 +1268,7 @@ Word16 round_fx( Word32 L_var1 ) Word32 L_rounded; BASOP_SATURATE_WARNING_OFF L_rounded = L_add( L_var1, (Word32) 0x00008000L ); L_rounded = L_add_sat( L_var1, (Word32) 0x00008000L ); BASOP_SATURATE_WARNING_ON var_out = extract_h( L_rounded ); Loading lib_com/basop_util.c +21 −0 Original line number Diff line number Diff line Loading @@ -2085,6 +2085,8 @@ Word32 norm_llQ31( /* o : normalized result Q31 */ return L_sum; } #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW /* note: now available in basop_util.h */ Word32 w_norm_llQ31( Word64 L_sum, Word16 *exp ); Word32 w_norm_llQ31( /* o : normalized result Q31 */ Word64 L_sum, /* i : upper and lower bits of accu, unsigned Q31 */ Loading @@ -2111,6 +2113,7 @@ Word32 w_norm_llQ31( /* o : normalized result Q31 */ L_tmp = W_extract_h( L64_inp64 ); return L_tmp; } #endif Word32 Dot_product16HQ( /* o : normalized result Q31 */ const Word32 L_off, /* i : initial sum value Qn */ Loading @@ -2135,6 +2138,24 @@ Word32 Dot_product16HQ( /* o : normalized result return L_sum; } Word32 sum_array_norm( /* o : normalized result Q31 */ const Word32 x[], /* i : x vector Qn */ const Word16 lg, /* i : vector length, range [0..7FFF] Q0 */ Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ) { Word16 i; Word64 W_tmp = 0; Word32 L_tmp; FOR( i = 0; i < lg; i++ ) { W_tmp = W_add( W_tmp, x[i] ); /*Q31*/ } L_tmp = w_norm_llQ31( W_tmp, exp ); /*Q31 - *exp*/ return L_tmp; } Word32 Norm32Norm( const Word32 *x, const Word16 headroom, const Word16 length, Word16 *result_e ) { Word32 L_tmp, L_tmp2; Loading lib_com/basop_util.h +31 −0 Original line number Diff line number Diff line Loading @@ -612,6 +612,20 @@ Word32 Dot_product16HQ( /*<! o : normalized result Word16 *exp /*<! o : exponent of result in [-32,31] Q0 */ ); /*------------------------------------------------------------------* * sum_array_norm: * * \brief Compute array summation of x[] using 64-bit accumulator. * * Performs normalization of the result, returns the exponent * Note: no headroom is required for data in x[] *------------------------------------------------------------------*/ Word32 sum_array_norm( /* o : normalized result Q31 */ const Word32 x[], /* i : x vector Qn */ const Word16 lg, /* i : vector length, range [0..7FFF] Q0 */ Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ); /*------------------------------------------------------------------* * norm_llQ31: * Loading @@ -627,6 +641,23 @@ Word32 norm_llQ31( /* o : normalized result Q31 */ Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ); #ifdef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW /*------------------------------------------------------------------* * w_norm_llQ31: * * \brief Compute normalized Q31 Values out of overflowed Q31 value * using 64-bit operators *------------------------------------------------------------------*/ static inline Word32 w_norm_llQ31( Word64 L64_var1, Word16 *S_var2 ) /*Q31 - L_tmp_exp*/ { Word32 L_result; Word16 sh = W_norm( L64_var1 ); L_result = W_extract_h( W_shl( L64_var1, sh ) ); *S_var2 = ( L_result == 0 ) ? -32 : 32 - sh; return L_result; } #endif /** * \brief Compute dot product of 1 32 bit vectors with itself * \param x input vector 1 Loading lib_com/bits_alloc_fx.c +12 −4 Original line number Diff line number Diff line Loading @@ -623,7 +623,9 @@ ivas_error config_acelp1_fx( const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const Word16 idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 active_cnt, /* i : Active frame counter */ #endif const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -806,7 +808,9 @@ ivas_error config_acelp1_fx( test(); test(); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC test(); #endif IF( !tdm_lp_reuse_flag || idchan == 0 ) { /* LSF Q bit-budget */ Loading Loading @@ -883,7 +887,11 @@ ivas_error config_acelp1_fx( bits = sub( bits, acelp_cfg->mid_lsf_bits ); } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) ) #else ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) && NE_16( active_cnt, 1 ) ) #endif { bits = sub( bits, TDM_IC_LSF_PRED_BITS ); } Loading Loading
apps/renderer.c +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include "split_rend_bfi_file_reader.h" #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "basop32.h" #define WMC_TOOL_SKIP Loading
lib_com/basop32.c +1 −1 Original line number Diff line number Diff line Loading @@ -1268,7 +1268,7 @@ Word16 round_fx( Word32 L_var1 ) Word32 L_rounded; BASOP_SATURATE_WARNING_OFF L_rounded = L_add( L_var1, (Word32) 0x00008000L ); L_rounded = L_add_sat( L_var1, (Word32) 0x00008000L ); BASOP_SATURATE_WARNING_ON var_out = extract_h( L_rounded ); Loading
lib_com/basop_util.c +21 −0 Original line number Diff line number Diff line Loading @@ -2085,6 +2085,8 @@ Word32 norm_llQ31( /* o : normalized result Q31 */ return L_sum; } #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW /* note: now available in basop_util.h */ Word32 w_norm_llQ31( Word64 L_sum, Word16 *exp ); Word32 w_norm_llQ31( /* o : normalized result Q31 */ Word64 L_sum, /* i : upper and lower bits of accu, unsigned Q31 */ Loading @@ -2111,6 +2113,7 @@ Word32 w_norm_llQ31( /* o : normalized result Q31 */ L_tmp = W_extract_h( L64_inp64 ); return L_tmp; } #endif Word32 Dot_product16HQ( /* o : normalized result Q31 */ const Word32 L_off, /* i : initial sum value Qn */ Loading @@ -2135,6 +2138,24 @@ Word32 Dot_product16HQ( /* o : normalized result return L_sum; } Word32 sum_array_norm( /* o : normalized result Q31 */ const Word32 x[], /* i : x vector Qn */ const Word16 lg, /* i : vector length, range [0..7FFF] Q0 */ Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ) { Word16 i; Word64 W_tmp = 0; Word32 L_tmp; FOR( i = 0; i < lg; i++ ) { W_tmp = W_add( W_tmp, x[i] ); /*Q31*/ } L_tmp = w_norm_llQ31( W_tmp, exp ); /*Q31 - *exp*/ return L_tmp; } Word32 Norm32Norm( const Word32 *x, const Word16 headroom, const Word16 length, Word16 *result_e ) { Word32 L_tmp, L_tmp2; Loading
lib_com/basop_util.h +31 −0 Original line number Diff line number Diff line Loading @@ -612,6 +612,20 @@ Word32 Dot_product16HQ( /*<! o : normalized result Word16 *exp /*<! o : exponent of result in [-32,31] Q0 */ ); /*------------------------------------------------------------------* * sum_array_norm: * * \brief Compute array summation of x[] using 64-bit accumulator. * * Performs normalization of the result, returns the exponent * Note: no headroom is required for data in x[] *------------------------------------------------------------------*/ Word32 sum_array_norm( /* o : normalized result Q31 */ const Word32 x[], /* i : x vector Qn */ const Word16 lg, /* i : vector length, range [0..7FFF] Q0 */ Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ); /*------------------------------------------------------------------* * norm_llQ31: * Loading @@ -627,6 +641,23 @@ Word32 norm_llQ31( /* o : normalized result Q31 */ Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ); #ifdef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW /*------------------------------------------------------------------* * w_norm_llQ31: * * \brief Compute normalized Q31 Values out of overflowed Q31 value * using 64-bit operators *------------------------------------------------------------------*/ static inline Word32 w_norm_llQ31( Word64 L64_var1, Word16 *S_var2 ) /*Q31 - L_tmp_exp*/ { Word32 L_result; Word16 sh = W_norm( L64_var1 ); L_result = W_extract_h( W_shl( L64_var1, sh ) ); *S_var2 = ( L_result == 0 ) ? -32 : 32 - sh; return L_result; } #endif /** * \brief Compute dot product of 1 32 bit vectors with itself * \param x input vector 1 Loading
lib_com/bits_alloc_fx.c +12 −4 Original line number Diff line number Diff line Loading @@ -623,7 +623,9 @@ ivas_error config_acelp1_fx( const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const Word16 idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 active_cnt, /* i : Active frame counter */ #endif const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -806,7 +808,9 @@ ivas_error config_acelp1_fx( test(); test(); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC test(); #endif IF( !tdm_lp_reuse_flag || idchan == 0 ) { /* LSF Q bit-budget */ Loading Loading @@ -883,7 +887,11 @@ ivas_error config_acelp1_fx( bits = sub( bits, acelp_cfg->mid_lsf_bits ); } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) ) #else ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) && NE_16( active_cnt, 1 ) ) #endif { bits = sub( bits, TDM_IC_LSF_PRED_BITS ); } Loading