Skip to content

Replace carry/overflow-using 32-bit operators by 64-bit version

In the legacy code, some array energies are computed using rather deprecated operators like

  • L_add_c/L_add_co
  • L_macNs_co, L_msu_co that have to handle pointers to "Carry" and "Overflow" in sophisticated way. In this context also a function norm_llQ31 is used to normalize those results.

Meanwhile, there are 64-bit operators and functions, that are much easier to handle.

  • basop_util.c: Dot_productSq16HQ computes the 16-bit array energy, incl. start sum
  • basop_util.c: w_norm_llQ31: Normalizes 64-bit dotProduct

It is expected, that the simplifications are bit-exact to all previous ones.

Here are the only locations, where we need changes:

  • lib_dec/dec_tcx_fx.c: CalculateAbsEnergy_fx: L_macNs_co, L_msuNs_co, norm_llQ31
  • lib_dec/fd_cng_dec_fx.c: ApplyFdCng_fx: L_add_co, L_msuNs_co, L_macNs_co, norm_llQ31
Edited by Arthur Tritthart