Missing basop instrumentation
The fixed point basop instrumentation is inconsistent across the delivered code and sometimes entirely missing. To help addressing this, we have added a wiki page on BASOP complexity counting basop complexity counting .
Here are some examples of code that need to be addressed (results of a math operation stored into an array need a move()):
static void ivas_ifft_cplx(
Word32 *re,
Word32 *im,
const Word16 length )
{
Word16 i;
Word32 ivas_imdct_one_by_powergain = IVAS_ONE_BY_IMDCT_SCALING_GAIN_Q16;
/*re-arrange inputs to use fft as ifft */
re[0] = Mult_32_32(re[0], ivas_imdct_one_by_powergain);
im[0] = Mult_32_32(im[0], ivas_imdct_one_by_powergain);
FOR ( i = 1; i <= shr(length, 1); i++ )
{
Word32 tmp = Mult_32_32(re[length - i], ivas_imdct_one_by_powergain);
re[length - i] = Mult_32_32(re[i], ivas_imdct_one_by_powergain);
re[i] = tmp;
tmp = Mult_32_32(im[length - i], ivas_imdct_one_by_powergain);
im[length - i] = Mult_32_32(im[i], ivas_imdct_one_by_powergain);
im[i] = tmp;
}
DoFFT_fx( re, im, (Word16) length );
return;
}
In the next code, the moves are missing, but also the complex addressing (length - 2 * i - 1 and 2 * i) needs to be accounted for:
void ivas_imdct_fx(
const Word32 *pIn,
Word32 *pOut,
const Word16 length,
Word16 *q_out)
{
const Word16 *pTwid_re, *pTwid_im;
Word16 len_by_2 = shr(length, 1);
Word16 i;
Word32 re[IVAS_480_PT_LEN];
Word32 im[IVAS_480_PT_LEN];
ivas_get_twid_factors_fx1( length, &pTwid_re, &pTwid_im );
FOR ( i = 0; i < len_by_2; i++ )
{
re[i] = L_add(Mpy_32_16_1(pIn[length - 2 * i - 1], pTwid_re[i]), Mpy_32_16_1(pIn[2 * i], pTwid_im[i])); /*stl_arr_index*/
im[i] = L_sub( Mpy_32_16_1( pIn[2 * i], pTwid_re[i] ), Mpy_32_16_1( pIn[length - 2 * i - 1], pTwid_im[i] ) ); /*stl_arr_index*/
}
...
Additionally, math operation within if/else, like the following example, needs to be addressed :
void sns_avq_dec_stereo_fx(
...
)
{
Word16 i, stereo_mode;
...
Word16 tmp_dIFf_q = 0;
-> IF( stereo_mode == 2 ) <-
{
...
-> IF( *indexr++ == -1 ) <-
{
sns_2st_dec_fx( side_q_fx, &q_side, indexr );
}
Word32 tmp_c = 0;
FOR( i = 0; i < M; i++ )
{
tmp_c = L_shr( side_q_fx[i], 1 ); // q_side
-> IF( q_mid >= q_side ) <-
{
...
For a proper complexity evaluation, these kind of issues will need to be corrected in most of the submitted fixed point files. However, it has no impact on the quality of the fixed point synthesis obtained.