ixheaace_api.c:ixheaac_min32:
   23|  4.76k|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|  4.76k|  WORD32 min_val;
   25|       |
   26|  4.76k|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 418, False: 4.34k]
  ------------------
   27|       |
   28|  4.76k|  return min_val;
   29|  4.76k|}
ixheaace_api.c:ixheaac_max32:
   31|  5.67k|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  5.67k|  WORD32 max_val;
   33|       |
   34|  5.67k|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 935, False: 4.74k]
  ------------------
   35|       |
   36|  5.67k|  return max_val;
   37|  5.67k|}
ixheaace_api.c:ixheaac_div32:
  328|    916|static PLATFORM_INLINE WORD32 ixheaac_div32(WORD32 a, WORD32 b, WORD *q_format) {
  329|    916|  WORD32 quotient;
  330|    916|  UWORD32 mantissa_nr, mantissa_dr;
  331|    916|  WORD16 sign = 0;
  332|       |
  333|    916|  LOOPINDEX i;
  334|    916|  WORD q_nr, q_dr;
  335|       |
  336|    916|  if ((a < 0) && (0 != b)) {
  ------------------
  |  Branch (336:7): [True: 0, False: 916]
  |  Branch (336:18): [True: 0, False: 0]
  ------------------
  337|      0|    a = -a;
  338|      0|    sign = (WORD16)(sign ^ -1);
  339|      0|  }
  340|       |
  341|    916|  if (b < 0) {
  ------------------
  |  Branch (341:7): [True: 0, False: 916]
  ------------------
  342|      0|    b = -b;
  343|      0|    sign = (WORD16)(sign ^ -1);
  344|      0|  }
  345|       |
  346|    916|  if (0 == b) {
  ------------------
  |  Branch (346:7): [True: 0, False: 916]
  ------------------
  347|      0|    *q_format = 0;
  348|      0|    return (a);
  349|      0|  }
  350|       |
  351|    916|  quotient = 0;
  352|       |
  353|    916|  q_nr = ixheaac_norm32(a);
  354|    916|  mantissa_nr = (UWORD32)a << (q_nr);
  355|    916|  q_dr = ixheaac_norm32(b);
  356|    916|  mantissa_dr = (UWORD32)b << (q_dr);
  357|    916|  *q_format = (WORD)(30 + q_nr - q_dr);
  358|       |
  359|  29.3k|  for (i = 0; i < 31; i++) {
  ------------------
  |  Branch (359:15): [True: 28.3k, False: 916]
  ------------------
  360|  28.3k|    quotient = quotient << 1;
  361|       |
  362|  28.3k|    if (mantissa_nr >= mantissa_dr) {
  ------------------
  |  Branch (362:9): [True: 5.95k, False: 22.4k]
  ------------------
  363|  5.95k|      mantissa_nr = mantissa_nr - mantissa_dr;
  364|  5.95k|      quotient += 1;
  365|  5.95k|    }
  366|       |
  367|  28.3k|    mantissa_nr = (UWORD32)mantissa_nr << 1;
  368|  28.3k|  }
  369|       |
  370|    916|  if (sign < 0) {
  ------------------
  |  Branch (370:7): [True: 0, False: 916]
  ------------------
  371|      0|    quotient = -quotient;
  372|      0|  }
  373|       |
  374|    916|  return quotient;
  375|    916|}
ixheaace_api.c:ixheaac_norm32:
  236|  1.83k|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|  1.83k|  WORD norm_val;
  238|       |
  239|  1.83k|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 1.83k]
  ------------------
  240|      0|    norm_val = 31;
  241|  1.83k|  } else {
  242|  1.83k|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 1.83k]
  ------------------
  243|      0|      norm_val = 31;
  244|  1.83k|    } else {
  245|  1.83k|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 1.83k]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|  16.5k|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 14.7k, False: 1.83k]
  ------------------
  249|  14.7k|        a <<= 1;
  250|  14.7k|      }
  251|  1.83k|    }
  252|  1.83k|  }
  253|       |
  254|  1.83k|  return norm_val;
  255|  1.83k|}
ixheaace_sbr_main.c:ixheaac_max32:
   31|  4.72k|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  4.72k|  WORD32 max_val;
   33|       |
   34|  4.72k|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 4.68k, False: 39]
  ------------------
   35|       |
   36|  4.72k|  return max_val;
   37|  4.72k|}
ixheaace_sbr_main.c:ixheaac_shl32:
   39|  8.64k|static PLATFORM_INLINE WORD32 ixheaac_shl32(WORD32 a, WORD b) {
   40|  8.64k|  WORD32 out_val;
   41|       |
   42|  8.64k|  b = ((UWORD32)(b << 24) >> 24);
   43|  8.64k|  if (b > 31)
  ------------------
  |  Branch (43:7): [True: 0, False: 8.64k]
  ------------------
   44|      0|    out_val = 0;
   45|  8.64k|  else
   46|  8.64k|    out_val = (WORD32)a << b;
   47|       |
   48|  8.64k|  return out_val;
   49|  8.64k|}
ixheaace_sbr_main.c:ixheaac_min32:
   23|  8.64k|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|  8.64k|  WORD32 min_val;
   25|       |
   26|  8.64k|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 5.63k, False: 3.01k]
  ------------------
   27|       |
   28|  8.64k|  return min_val;
   29|  8.64k|}
ixheaace_sbr_ton_corr.c:ixheaac_abs32:
  271|  20.2k|static PLATFORM_INLINE WORD32 ixheaac_abs32(WORD32 a) {
  272|  20.2k|  WORD32 abs_val;
  273|       |
  274|  20.2k|  abs_val = a;
  275|       |
  276|  20.2k|  if (a < 0) {
  ------------------
  |  Branch (276:7): [True: 8.36k, False: 11.8k]
  ------------------
  277|  8.36k|    abs_val = -a;
  278|  8.36k|  }
  279|       |
  280|  20.2k|  return abs_val;
  281|  20.2k|}
iusace_fft.c:ixheaac_norm32:
  236|   396k|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|   396k|  WORD norm_val;
  238|       |
  239|   396k|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 396k]
  ------------------
  240|      0|    norm_val = 31;
  241|   396k|  } else {
  242|   396k|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 396k]
  ------------------
  243|      0|      norm_val = 31;
  244|   396k|    } else {
  245|   396k|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 396k]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|  8.32M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 7.92M, False: 396k]
  ------------------
  249|  7.92M|        a <<= 1;
  250|  7.92M|      }
  251|   396k|    }
  252|   396k|  }
  253|       |
  254|   396k|  return norm_val;
  255|   396k|}
ixheaace_sbr_env_est.c:ixheaac_abs32:
  271|  14.3M|static PLATFORM_INLINE WORD32 ixheaac_abs32(WORD32 a) {
  272|  14.3M|  WORD32 abs_val;
  273|       |
  274|  14.3M|  abs_val = a;
  275|       |
  276|  14.3M|  if (a < 0) {
  ------------------
  |  Branch (276:7): [True: 11.3M, False: 2.95M]
  ------------------
  277|  11.3M|    abs_val = -a;
  278|  11.3M|  }
  279|       |
  280|  14.3M|  return abs_val;
  281|  14.3M|}
ixheaace_sbr_frame_info_gen.c:ixheaac_shr32:
   51|   139k|static PLATFORM_INLINE WORD32 ixheaac_shr32(WORD32 a, WORD b) {
   52|   139k|  WORD32 out_val;
   53|       |
   54|   139k|  b = ((UWORD32)(b << 24) >> 24);
   55|   139k|  if (b >= 31) {
  ------------------
  |  Branch (55:7): [True: 0, False: 139k]
  ------------------
   56|      0|    if (a < 0)
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|      out_val = -1;
   58|      0|    else
   59|      0|      out_val = 0;
   60|   139k|  } else {
   61|   139k|    out_val = (WORD32)a >> b;
   62|   139k|  }
   63|       |
   64|   139k|  return out_val;
   65|   139k|}
ixheaace_sbr_frame_info_gen.c:ixheaac_min32:
   23|   139k|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|   139k|  WORD32 min_val;
   25|       |
   26|   139k|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 45.9k, False: 93.2k]
  ------------------
   27|       |
   28|   139k|  return min_val;
   29|   139k|}
ixheaace_sbr_hbe_fft_ifft_32x32.c:ixheaac_norm32:
  236|  1.94M|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|  1.94M|  WORD norm_val;
  238|       |
  239|  1.94M|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 1.94M]
  ------------------
  240|      0|    norm_val = 31;
  241|  1.94M|  } else {
  242|  1.94M|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 1.94M]
  ------------------
  243|      0|      norm_val = 31;
  244|  1.94M|    } else {
  245|  1.94M|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 1.94M]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|  49.3M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 47.3M, False: 1.94M]
  ------------------
  249|  47.3M|        a <<= 1;
  250|  47.3M|      }
  251|  1.94M|    }
  252|  1.94M|  }
  253|       |
  254|  1.94M|  return norm_val;
  255|  1.94M|}
ixheaace_sbr_inv_filtering_estimation.c:ixheaac_max32:
   31|  1.55M|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  1.55M|  WORD32 max_val;
   33|       |
   34|  1.55M|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 165k, False: 1.38M]
  ------------------
   35|       |
   36|  1.55M|  return max_val;
   37|  1.55M|}
ixheaace_sbr_missing_harmonics_det.c:ixheaac_abs32:
  271|  56.3k|static PLATFORM_INLINE WORD32 ixheaac_abs32(WORD32 a) {
  272|  56.3k|  WORD32 abs_val;
  273|       |
  274|  56.3k|  abs_val = a;
  275|       |
  276|  56.3k|  if (a < 0) {
  ------------------
  |  Branch (276:7): [True: 0, False: 56.3k]
  ------------------
  277|      0|    abs_val = -a;
  278|      0|  }
  279|       |
  280|  56.3k|  return abs_val;
  281|  56.3k|}
ixheaace_sbr_write_bitstream.c:ixheaac_shl32:
   39|  1.16M|static PLATFORM_INLINE WORD32 ixheaac_shl32(WORD32 a, WORD b) {
   40|  1.16M|  WORD32 out_val;
   41|       |
   42|  1.16M|  b = ((UWORD32)(b << 24) >> 24);
   43|  1.16M|  if (b > 31)
  ------------------
  |  Branch (43:7): [True: 0, False: 1.16M]
  ------------------
   44|      0|    out_val = 0;
   45|  1.16M|  else
   46|  1.16M|    out_val = (WORD32)a << b;
   47|       |
   48|  1.16M|  return out_val;
   49|  1.16M|}
ixheaace_sbr_write_bitstream.c:ixheaac_max32:
   31|  5.57M|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  5.57M|  WORD32 max_val;
   33|       |
   34|  5.57M|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 5.56M, False: 6.14k]
  ------------------
   35|       |
   36|  5.57M|  return max_val;
   37|  5.57M|}
ixheaace_sbr_write_bitstream.c:ixheaac_min32:
   23|  20.5M|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|  20.5M|  WORD32 min_val;
   25|       |
   26|  20.5M|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 20.5M, False: 7.72k]
  ------------------
   27|       |
   28|  20.5M|  return min_val;
   29|  20.5M|}
ixheaac_esbr_fft.c:ixheaac_norm32:
  236|  36.4M|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|  36.4M|  WORD norm_val;
  238|       |
  239|  36.4M|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 36.4M]
  ------------------
  240|      0|    norm_val = 31;
  241|  36.4M|  } else {
  242|  36.4M|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 36.4M]
  ------------------
  243|      0|      norm_val = 31;
  244|  36.4M|    } else {
  245|  36.4M|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 36.4M]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|   997M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 960M, False: 36.4M]
  ------------------
  249|   960M|        a <<= 1;
  250|   960M|      }
  251|  36.4M|    }
  252|  36.4M|  }
  253|       |
  254|  36.4M|  return norm_val;
  255|  36.4M|}
ixheaace_sbr_code_envelope_lp.c:ixheaac_shr32:
   51|  28.4M|static PLATFORM_INLINE WORD32 ixheaac_shr32(WORD32 a, WORD b) {
   52|  28.4M|  WORD32 out_val;
   53|       |
   54|  28.4M|  b = ((UWORD32)(b << 24) >> 24);
   55|  28.4M|  if (b >= 31) {
  ------------------
  |  Branch (55:7): [True: 0, False: 28.4M]
  ------------------
   56|      0|    if (a < 0)
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|      out_val = -1;
   58|      0|    else
   59|      0|      out_val = 0;
   60|  28.4M|  } else {
   61|  28.4M|    out_val = (WORD32)a >> b;
   62|  28.4M|  }
   63|       |
   64|  28.4M|  return out_val;
   65|  28.4M|}
ixheaace_sbr_code_envelope_lp.c:ixheaac_sub32_sat:
  225|  13.8M|static PLATFORM_INLINE WORD32 ixheaac_sub32_sat(WORD32 a, WORD32 b) {
  226|  13.8M|  WORD64 diff;
  227|       |
  228|  13.8M|  diff = (WORD64)a - (WORD64)b;
  229|       |
  230|  13.8M|  if (diff >= MAX_32) return MAX_32;
  ------------------
  |  |   60|  13.8M|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
                if (diff >= MAX_32) return MAX_32;
  ------------------
  |  |   60|   497k|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
  |  Branch (230:7): [True: 497k, False: 13.3M]
  ------------------
  231|  13.3M|  if (diff <= MIN_32) return MIN_32;
  ------------------
  |  |   61|  13.3M|#define MIN_32 (WORD32)0x80000000L
  ------------------
                if (diff <= MIN_32) return MIN_32;
  ------------------
  |  |   61|   351k|#define MIN_32 (WORD32)0x80000000L
  ------------------
  |  Branch (231:7): [True: 351k, False: 13.0M]
  ------------------
  232|       |
  233|  13.0M|  return (WORD32)diff;
  234|  13.3M|}

ixheaac_real_synth_fft_p2:
   42|  12.7M|void ixheaac_real_synth_fft_p2(FLOAT32 *ptr_x, FLOAT32 *ptr_y, WORD32 npoints) {
   43|  12.7M|  WORD32 i, j, k, n_stages, h2;
   44|  12.7M|  FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
   45|  12.7M|  WORD32 del, nodespacing, in_loop_cnt;
   46|  12.7M|  WORD32 not_power_4;
   47|  12.7M|  WORD32 dig_rev_shift;
   48|  12.7M|  const FLOAT32 *ptr_w;
   49|       |
   50|  12.7M|  dig_rev_shift = ixheaac_norm32(npoints) + 1 - 16;
   51|  12.7M|  n_stages = 30 - ixheaac_norm32(npoints);
   52|  12.7M|  not_power_4 = n_stages & 1;
   53|       |
   54|  12.7M|  n_stages = n_stages >> 1;
   55|       |
   56|  12.7M|  ptr_w = ixheaac_twiddle_table_fft_float;
   57|       |
   58|  51.6M|  for (i = 0; i < npoints; i += 4) {
  ------------------
  |  Branch (58:15): [True: 38.9M, False: 12.7M]
  ------------------
   59|  38.9M|    FLOAT32 *inp = ptr_x;
   60|       |
   61|  38.9M|    DIG_REV(i, dig_rev_shift, h2);
  ------------------
  |  |   30|  38.9M|  do {                                                      \
  |  |   31|  38.9M|    unsigned _ = (i);                                       \
  |  |   32|  38.9M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   33|  38.9M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   34|  38.9M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   35|  38.9M|    (j) = _ >> (m);                                         \
  |  |   36|  38.9M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 38.9M]
  |  |  ------------------
  ------------------
   62|  38.9M|    if (not_power_4) {
  ------------------
  |  Branch (62:9): [True: 38.9M, False: 0]
  ------------------
   63|  38.9M|      h2 += 1;
   64|  38.9M|      h2 &= ~1;
   65|  38.9M|    }
   66|  38.9M|    inp += (h2 >> 1);
   67|       |
   68|  38.9M|    x0r = *inp;
   69|  38.9M|    inp += (npoints >> 2);
   70|       |
   71|  38.9M|    x1r = *inp;
   72|  38.9M|    inp += (npoints >> 2);
   73|       |
   74|  38.9M|    x2r = *inp;
   75|  38.9M|    inp += (npoints >> 2);
   76|       |
   77|  38.9M|    x3r = *inp;
   78|       |
   79|  38.9M|    x0r = x0r + x2r;
   80|  38.9M|    x2r = x0r - (x2r * 2);
   81|  38.9M|    x1r = x1r + x3r;
   82|  38.9M|    x3r = x1r - (x3r * 2);
   83|  38.9M|    x0r = x0r + x1r;
   84|  38.9M|    x1r = x0r - (x1r * 2);
   85|       |
   86|  38.9M|    *ptr_y++ = x0r;
   87|  38.9M|    *ptr_y++ = 0;
   88|  38.9M|    *ptr_y++ = x2r;
   89|  38.9M|    *ptr_y++ = x3r;
   90|  38.9M|    *ptr_y++ = x1r;
   91|  38.9M|    *ptr_y++ = 0;
   92|  38.9M|    *ptr_y++ = x2r;
   93|  38.9M|    *ptr_y++ = -x3r;
   94|  38.9M|  }
   95|  12.7M|  ptr_y -= 2 * npoints;
   96|  12.7M|  del = 4;
   97|  12.7M|  nodespacing = 64;
   98|  12.7M|  in_loop_cnt = npoints >> 4;
   99|  14.9M|  for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (99:26): [True: 2.25M, False: 12.7M]
  ------------------
  100|  2.25M|    const FLOAT32 *twiddles = ptr_w;
  101|  2.25M|    FLOAT32 *data = ptr_y;
  102|  2.25M|    FLOAT32 W1, W2, W3, W4, W5, W6;
  103|  2.25M|    WORD32 sec_loop_cnt;
  104|       |
  105|  6.75M|    for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (105:27): [True: 4.50M, False: 2.25M]
  ------------------
  106|  4.50M|      x0r = (*data);
  107|  4.50M|      x0i = (*(data + 1));
  108|  4.50M|      data += ((SIZE_T)del << 1);
  109|       |
  110|  4.50M|      x1r = (*data);
  111|  4.50M|      x1i = (*(data + 1));
  112|  4.50M|      data += ((SIZE_T)del << 1);
  113|       |
  114|  4.50M|      x2r = (*data);
  115|  4.50M|      x2i = (*(data + 1));
  116|  4.50M|      data += ((SIZE_T)del << 1);
  117|       |
  118|  4.50M|      x3r = (*data);
  119|  4.50M|      x3i = (*(data + 1));
  120|  4.50M|      data -= 3 * ((SIZE_T)del << 1);
  121|       |
  122|  4.50M|      x0r = x0r + x2r;
  123|  4.50M|      x0i = x0i + x2i;
  124|  4.50M|      x2r = x0r - (x2r * 2);
  125|  4.50M|      x2i = x0i - (x2i * 2);
  126|  4.50M|      x1r = x1r + x3r;
  127|  4.50M|      x1i = x1i + x3i;
  128|  4.50M|      x3r = x1r - (x3r * 2);
  129|  4.50M|      x3i = x1i - (x3i * 2);
  130|       |
  131|  4.50M|      x0r = x0r + x1r;
  132|  4.50M|      x0i = x0i + x1i;
  133|  4.50M|      x1r = x0r - (x1r * 2);
  134|  4.50M|      x1i = x0i - (x1i * 2);
  135|  4.50M|      x2r = x2r - x3i;
  136|  4.50M|      x2i = x2i + x3r;
  137|  4.50M|      x3i = x2r + (x3i * 2);
  138|  4.50M|      x3r = x2i - (x3r * 2);
  139|       |
  140|  4.50M|      *data = x0r;
  141|  4.50M|      *(data + 1) = x0i;
  142|  4.50M|      data += ((SIZE_T)del << 1);
  143|       |
  144|  4.50M|      *data = x2r;
  145|  4.50M|      *(data + 1) = x2i;
  146|  4.50M|      data += ((SIZE_T)del << 1);
  147|       |
  148|  4.50M|      *data = x1r;
  149|  4.50M|      *(data + 1) = x1i;
  150|  4.50M|      data += ((SIZE_T)del << 1);
  151|       |
  152|  4.50M|      *data = x3i;
  153|  4.50M|      *(data + 1) = x3r;
  154|  4.50M|      data += ((SIZE_T)del << 1);
  155|  4.50M|    }
  156|  2.25M|    data = ptr_y + 2;
  157|       |
  158|  2.25M|    sec_loop_cnt = (nodespacing * del);
  159|  2.25M|    sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
  160|  2.25M|                   (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
  161|  2.25M|                   (sec_loop_cnt / 256);
  162|       |
  163|  4.50M|    for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (163:27): [True: 2.25M, False: 2.25M]
  ------------------
  164|  2.25M|      W1 = *(twiddles + j);
  165|  2.25M|      W4 = *(twiddles + j + 257);
  166|  2.25M|      W2 = *(twiddles + ((SIZE_T)j << 1));
  167|  2.25M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 257);
  168|  2.25M|      W3 = *(twiddles + j + ((SIZE_T)j << 1));
  169|  2.25M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) + 257);
  170|       |
  171|  6.75M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (171:29): [True: 4.50M, False: 2.25M]
  ------------------
  172|  4.50M|        FLOAT32 tmp;
  173|  4.50M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  174|       |
  175|  4.50M|        data += ((SIZE_T)del << 1);
  176|       |
  177|  4.50M|        x1r = *data;
  178|  4.50M|        x1i = *(data + 1);
  179|  4.50M|        data += ((SIZE_T)del << 1);
  180|       |
  181|  4.50M|        x2r = *data;
  182|  4.50M|        x2i = *(data + 1);
  183|  4.50M|        data += ((SIZE_T)del << 1);
  184|       |
  185|  4.50M|        x3r = *data;
  186|  4.50M|        x3i = *(data + 1);
  187|  4.50M|        data -= 3 * ((SIZE_T)del << 1);
  188|       |
  189|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  190|  4.50M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  191|  4.50M|        x1r = tmp;
  192|       |
  193|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  194|  4.50M|        x2i = (FLOAT32)(-((FLOAT32)x2r * W5) + (FLOAT32)x2i * W2);
  195|  4.50M|        x2r = tmp;
  196|       |
  197|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x3r * W3) + ((FLOAT32)x3i * W6));
  198|  4.50M|        x3i = (FLOAT32)(-((FLOAT32)x3r * W6) + (FLOAT32)x3i * W3);
  199|  4.50M|        x3r = tmp;
  200|       |
  201|  4.50M|        x0r = (*data);
  202|  4.50M|        x0i = (*(data + 1));
  203|       |
  204|  4.50M|        x0r = x0r + (x2r);
  205|  4.50M|        x0i = x0i + (x2i);
  206|  4.50M|        x2r = x0r - (x2r * 2);
  207|  4.50M|        x2i = x0i - (x2i * 2);
  208|  4.50M|        x1r = x1r + x3r;
  209|  4.50M|        x1i = x1i + x3i;
  210|  4.50M|        x3r = x1r - (x3r * 2);
  211|  4.50M|        x3i = x1i - (x3i * 2);
  212|       |
  213|  4.50M|        x0r = x0r + (x1r);
  214|  4.50M|        x0i = x0i + (x1i);
  215|  4.50M|        x1r = x0r - (x1r * 2);
  216|  4.50M|        x1i = x0i - (x1i * 2);
  217|  4.50M|        x2r = x2r - (x3i);
  218|  4.50M|        x2i = x2i + (x3r);
  219|  4.50M|        x3i = x2r + (x3i * 2);
  220|  4.50M|        x3r = x2i - (x3r * 2);
  221|       |
  222|  4.50M|        *data = x0r;
  223|  4.50M|        *(data + 1) = x0i;
  224|  4.50M|        data += ((SIZE_T)del << 1);
  225|       |
  226|  4.50M|        *data = x2r;
  227|  4.50M|        *(data + 1) = x2i;
  228|  4.50M|        data += ((SIZE_T)del << 1);
  229|       |
  230|  4.50M|        *data = x1r;
  231|  4.50M|        *(data + 1) = x1i;
  232|  4.50M|        data += ((SIZE_T)del << 1);
  233|       |
  234|  4.50M|        *data = x3i;
  235|  4.50M|        *(data + 1) = x3r;
  236|  4.50M|        data += ((SIZE_T)del << 1);
  237|  4.50M|      }
  238|  2.25M|      data -= 2 * npoints;
  239|  2.25M|      data += 2;
  240|  2.25M|    }
  241|  4.50M|    for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (241:12): [True: 2.25M, False: 2.25M]
  ------------------
  242|  2.25M|      W1 = *(twiddles + j);
  243|  2.25M|      W4 = *(twiddles + j + 257);
  244|  2.25M|      W2 = *(twiddles + ((SIZE_T)j << 1));
  245|  2.25M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 257);
  246|  2.25M|      W3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
  247|  2.25M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
  248|       |
  249|  6.75M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (249:29): [True: 4.50M, False: 2.25M]
  ------------------
  250|  4.50M|        FLOAT32 tmp;
  251|  4.50M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  252|       |
  253|  4.50M|        data += ((SIZE_T)del << 1);
  254|       |
  255|  4.50M|        x1r = *data;
  256|  4.50M|        x1i = *(data + 1);
  257|  4.50M|        data += ((SIZE_T)del << 1);
  258|       |
  259|  4.50M|        x2r = *data;
  260|  4.50M|        x2i = *(data + 1);
  261|  4.50M|        data += ((SIZE_T)del << 1);
  262|       |
  263|  4.50M|        x3r = *data;
  264|  4.50M|        x3i = *(data + 1);
  265|  4.50M|        data -= 3 * ((SIZE_T)del << 1);
  266|       |
  267|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  268|  4.50M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  269|  4.50M|        x1r = tmp;
  270|       |
  271|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  272|  4.50M|        x2i = (FLOAT32)(-((FLOAT32)x2r * W5) + (FLOAT32)x2i * W2);
  273|  4.50M|        x2r = tmp;
  274|       |
  275|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x3r * W6) - ((FLOAT32)x3i * W3));
  276|  4.50M|        x3i = (FLOAT32)(((FLOAT32)x3r * W3) + ((FLOAT32)x3i * W6));
  277|  4.50M|        x3r = tmp;
  278|       |
  279|  4.50M|        x0r = (*data);
  280|  4.50M|        x0i = (*(data + 1));
  281|       |
  282|  4.50M|        x0r = x0r + (x2r);
  283|  4.50M|        x0i = x0i + (x2i);
  284|  4.50M|        x2r = x0r - (x2r * 2);
  285|  4.50M|        x2i = x0i - (x2i * 2);
  286|  4.50M|        x1r = x1r + x3r;
  287|  4.50M|        x1i = x1i + x3i;
  288|  4.50M|        x3r = x1r - (x3r * 2);
  289|  4.50M|        x3i = x1i - (x3i * 2);
  290|       |
  291|  4.50M|        x0r = x0r + (x1r);
  292|  4.50M|        x0i = x0i + (x1i);
  293|  4.50M|        x1r = x0r - (x1r * 2);
  294|  4.50M|        x1i = x0i - (x1i * 2);
  295|  4.50M|        x2r = x2r - (x3i);
  296|  4.50M|        x2i = x2i + (x3r);
  297|  4.50M|        x3i = x2r + (x3i * 2);
  298|  4.50M|        x3r = x2i - (x3r * 2);
  299|       |
  300|  4.50M|        *data = x0r;
  301|  4.50M|        *(data + 1) = x0i;
  302|  4.50M|        data += ((SIZE_T)del << 1);
  303|       |
  304|  4.50M|        *data = x2r;
  305|  4.50M|        *(data + 1) = x2i;
  306|  4.50M|        data += ((SIZE_T)del << 1);
  307|       |
  308|  4.50M|        *data = x1r;
  309|  4.50M|        *(data + 1) = x1i;
  310|  4.50M|        data += ((SIZE_T)del << 1);
  311|       |
  312|  4.50M|        *data = x3i;
  313|  4.50M|        *(data + 1) = x3r;
  314|  4.50M|        data += ((SIZE_T)del << 1);
  315|  4.50M|      }
  316|  2.25M|      data -= 2 * npoints;
  317|  2.25M|      data += 2;
  318|  2.25M|    }
  319|  2.25M|    for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (319:12): [True: 0, False: 2.25M]
  ------------------
  320|      0|      W1 = *(twiddles + j);
  321|      0|      W4 = *(twiddles + j + 257);
  322|      0|      W2 = *(twiddles + ((SIZE_T)j << 1) - 256);
  323|      0|      W5 = *(twiddles + ((SIZE_T)j << 1) + 1);
  324|      0|      W3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
  325|      0|      W6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
  326|       |
  327|      0|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (327:29): [True: 0, False: 0]
  ------------------
  328|      0|        FLOAT32 tmp;
  329|      0|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  330|       |
  331|      0|        data += ((SIZE_T)del << 1);
  332|       |
  333|      0|        x1r = *data;
  334|      0|        x1i = *(data + 1);
  335|      0|        data += ((SIZE_T)del << 1);
  336|       |
  337|      0|        x2r = *data;
  338|      0|        x2i = *(data + 1);
  339|      0|        data += ((SIZE_T)del << 1);
  340|       |
  341|      0|        x3r = *data;
  342|      0|        x3i = *(data + 1);
  343|      0|        data -= 3 * ((SIZE_T)del << 1);
  344|       |
  345|      0|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  346|      0|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  347|      0|        x1r = tmp;
  348|       |
  349|      0|        tmp = (FLOAT32)(((FLOAT32)x2r * W5) - ((FLOAT32)x2i * W2));
  350|      0|        x2i = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  351|      0|        x2r = tmp;
  352|       |
  353|      0|        tmp = (FLOAT32)(((FLOAT32)x3r * W6) - ((FLOAT32)x3i * W3));
  354|      0|        x3i = (FLOAT32)(((FLOAT32)x3r * W3) + ((FLOAT32)x3i * W6));
  355|      0|        x3r = tmp;
  356|       |
  357|      0|        x0r = (*data);
  358|      0|        x0i = (*(data + 1));
  359|       |
  360|      0|        x0r = x0r + (x2r);
  361|      0|        x0i = x0i + (x2i);
  362|      0|        x2r = x0r - (x2r * 2);
  363|      0|        x2i = x0i - (x2i * 2);
  364|      0|        x1r = x1r + x3r;
  365|      0|        x1i = x1i + x3i;
  366|      0|        x3r = x1r - (x3r * 2);
  367|      0|        x3i = x1i - (x3i * 2);
  368|       |
  369|      0|        x0r = x0r + (x1r);
  370|      0|        x0i = x0i + (x1i);
  371|      0|        x1r = x0r - (x1r * 2);
  372|      0|        x1i = x0i - (x1i * 2);
  373|      0|        x2r = x2r - (x3i);
  374|      0|        x2i = x2i + (x3r);
  375|      0|        x3i = x2r + (x3i * 2);
  376|      0|        x3r = x2i - (x3r * 2);
  377|       |
  378|      0|        *data = x0r;
  379|      0|        *(data + 1) = x0i;
  380|      0|        data += ((SIZE_T)del << 1);
  381|       |
  382|      0|        *data = x2r;
  383|      0|        *(data + 1) = x2i;
  384|      0|        data += ((SIZE_T)del << 1);
  385|       |
  386|      0|        *data = x1r;
  387|      0|        *(data + 1) = x1i;
  388|      0|        data += ((SIZE_T)del << 1);
  389|       |
  390|      0|        *data = x3i;
  391|      0|        *(data + 1) = x3r;
  392|      0|        data += ((SIZE_T)del << 1);
  393|      0|      }
  394|      0|      data -= 2 * npoints;
  395|      0|      data += 2;
  396|      0|    }
  397|  4.50M|    for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (397:12): [True: 2.25M, False: 2.25M]
  ------------------
  398|  2.25M|      W1 = *(twiddles + j);
  399|  2.25M|      W4 = *(twiddles + j + 257);
  400|  2.25M|      W2 = *(twiddles + ((SIZE_T)j << 1) - 256);
  401|  2.25M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 1);
  402|  2.25M|      W3 = *(twiddles + j + ((SIZE_T)j << 1) - 512);
  403|  2.25M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) - 512 + 257);
  404|       |
  405|  6.75M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (405:29): [True: 4.50M, False: 2.25M]
  ------------------
  406|  4.50M|        FLOAT32 tmp;
  407|  4.50M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  408|       |
  409|  4.50M|        data += ((SIZE_T)del << 1);
  410|       |
  411|  4.50M|        x1r = *data;
  412|  4.50M|        x1i = *(data + 1);
  413|  4.50M|        data += ((SIZE_T)del << 1);
  414|       |
  415|  4.50M|        x2r = *data;
  416|  4.50M|        x2i = *(data + 1);
  417|  4.50M|        data += ((SIZE_T)del << 1);
  418|       |
  419|  4.50M|        x3r = *data;
  420|  4.50M|        x3i = *(data + 1);
  421|  4.50M|        data -= 3 * ((SIZE_T)del << 1);
  422|       |
  423|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  424|  4.50M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  425|  4.50M|        x1r = tmp;
  426|       |
  427|  4.50M|        tmp = (FLOAT32)(((FLOAT32)x2r * W5) - ((FLOAT32)x2i * W2));
  428|  4.50M|        x2i = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  429|  4.50M|        x2r = tmp;
  430|       |
  431|  4.50M|        tmp = (FLOAT32)(-((FLOAT32)x3r * W3) - ((FLOAT32)x3i * W6));
  432|  4.50M|        x3i = (FLOAT32)(-((FLOAT32)x3r * W6) + (FLOAT32)x3i * W3);
  433|  4.50M|        x3r = tmp;
  434|       |
  435|  4.50M|        x0r = (*data);
  436|  4.50M|        x0i = (*(data + 1));
  437|       |
  438|  4.50M|        x0r = x0r + (x2r);
  439|  4.50M|        x0i = x0i + (x2i);
  440|  4.50M|        x2r = x0r - (x2r * 2);
  441|  4.50M|        x2i = x0i - (x2i * 2);
  442|  4.50M|        x1r = x1r + x3r;
  443|  4.50M|        x1i = x1i - x3i;
  444|  4.50M|        x3r = x1r - (x3r * 2);
  445|  4.50M|        x3i = x1i + (x3i * 2);
  446|       |
  447|  4.50M|        x0r = x0r + (x1r);
  448|  4.50M|        x0i = x0i + (x1i);
  449|  4.50M|        x1r = x0r - (x1r * 2);
  450|  4.50M|        x1i = x0i - (x1i * 2);
  451|  4.50M|        x2r = x2r - (x3i);
  452|  4.50M|        x2i = x2i + (x3r);
  453|  4.50M|        x3i = x2r + (x3i * 2);
  454|  4.50M|        x3r = x2i - (x3r * 2);
  455|       |
  456|  4.50M|        *data = x0r;
  457|  4.50M|        *(data + 1) = x0i;
  458|  4.50M|        data += ((SIZE_T)del << 1);
  459|       |
  460|  4.50M|        *data = x2r;
  461|  4.50M|        *(data + 1) = x2i;
  462|  4.50M|        data += ((SIZE_T)del << 1);
  463|       |
  464|  4.50M|        *data = x1r;
  465|  4.50M|        *(data + 1) = x1i;
  466|  4.50M|        data += ((SIZE_T)del << 1);
  467|       |
  468|  4.50M|        *data = x3i;
  469|  4.50M|        *(data + 1) = x3r;
  470|  4.50M|        data += ((SIZE_T)del << 1);
  471|  4.50M|      }
  472|  2.25M|      data -= 2 * npoints;
  473|  2.25M|      data += 2;
  474|  2.25M|    }
  475|  2.25M|    nodespacing >>= 2;
  476|  2.25M|    del <<= 2;
  477|  2.25M|    in_loop_cnt >>= 2;
  478|  2.25M|  }
  479|       |
  480|  12.7M|  if (not_power_4) {
  ------------------
  |  Branch (480:7): [True: 12.7M, False: 0]
  ------------------
  481|  12.7M|    const FLOAT32 *twiddles = ptr_w;
  482|  12.7M|    nodespacing <<= 1;
  483|       |
  484|  51.6M|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (484:23): [True: 38.9M, False: 12.7M]
  ------------------
  485|  38.9M|      FLOAT32 W1 = *twiddles;
  486|  38.9M|      FLOAT32 W4 = *(twiddles + 257);
  487|  38.9M|      FLOAT32 tmp;
  488|  38.9M|      twiddles += nodespacing;
  489|       |
  490|  38.9M|      x0r = *ptr_y;
  491|  38.9M|      x0i = *(ptr_y + 1);
  492|  38.9M|      ptr_y += ((SIZE_T)del << 1);
  493|       |
  494|  38.9M|      x1r = *ptr_y;
  495|  38.9M|      x1i = *(ptr_y + 1);
  496|       |
  497|  38.9M|      tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  498|  38.9M|      x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  499|  38.9M|      x1r = tmp;
  500|       |
  501|  38.9M|      *ptr_y = (x0r) - (x1r);
  502|  38.9M|      *(ptr_y + 1) = (x0i) - (x1i);
  503|  38.9M|      ptr_y -= ((SIZE_T)del << 1);
  504|       |
  505|  38.9M|      *ptr_y = (x0r) + (x1r);
  506|  38.9M|      *(ptr_y + 1) = (x0i) + (x1i);
  507|  38.9M|      ptr_y += 2;
  508|  38.9M|    }
  509|  12.7M|    twiddles = ptr_w;
  510|  51.6M|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (510:23): [True: 38.9M, False: 12.7M]
  ------------------
  511|  38.9M|      FLOAT32 W1 = *twiddles;
  512|  38.9M|      FLOAT32 W4 = *(twiddles + 257);
  513|  38.9M|      FLOAT32 tmp;
  514|  38.9M|      twiddles += nodespacing;
  515|       |
  516|  38.9M|      x0r = *ptr_y;
  517|  38.9M|      x0i = *(ptr_y + 1);
  518|  38.9M|      ptr_y += ((SIZE_T)del << 1);
  519|       |
  520|  38.9M|      x1r = *ptr_y;
  521|  38.9M|      x1i = *(ptr_y + 1);
  522|  38.9M|      tmp = (FLOAT32)(((FLOAT32)x1r * W4) - ((FLOAT32)x1i * W1));
  523|  38.9M|      x1i = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  524|  38.9M|      x1r = tmp;
  525|       |
  526|  38.9M|      *ptr_y = (x0r) - (x1r);
  527|  38.9M|      *(ptr_y + 1) = (x0i) - (x1i);
  528|  38.9M|      ptr_y -= ((SIZE_T)del << 1);
  529|       |
  530|  38.9M|      *ptr_y = (x0r) + (x1r);
  531|  38.9M|      *(ptr_y + 1) = (x0i) + (x1i);
  532|  38.9M|      ptr_y += 2;
  533|  38.9M|    }
  534|  12.7M|  }
  535|  12.7M|}
ixheaac_cmplx_anal_fft_p2:
  537|  5.50M|void ixheaac_cmplx_anal_fft_p2(FLOAT32 *ptr_x, FLOAT32 *ptr_y, WORD32 npoints) {
  538|  5.50M|  WORD32 i, j, k, n_stages, h2;
  539|  5.50M|  FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  540|  5.50M|  WORD32 del, nodespacing, in_loop_cnt;
  541|  5.50M|  WORD32 not_power_4;
  542|  5.50M|  WORD32 dig_rev_shift;
  543|  5.50M|  const FLOAT32 *ptr_w;
  544|       |
  545|  5.50M|  dig_rev_shift = ixheaac_norm32(npoints) + 1 - 16;
  546|  5.50M|  n_stages = 30 - ixheaac_norm32(npoints);
  547|  5.50M|  not_power_4 = n_stages & 1;
  548|       |
  549|  5.50M|  n_stages = n_stages >> 1;
  550|       |
  551|  5.50M|  ptr_w = ixheaac_twiddle_table_fft_float;
  552|       |
  553|  38.8M|  for (i = 0; i < npoints; i += 4) {
  ------------------
  |  Branch (553:15): [True: 33.3M, False: 5.50M]
  ------------------
  554|  33.3M|    FLOAT32 *inp = ptr_x;
  555|       |
  556|  33.3M|    DIG_REV(i, dig_rev_shift, h2);
  ------------------
  |  |   30|  33.3M|  do {                                                      \
  |  |   31|  33.3M|    unsigned _ = (i);                                       \
  |  |   32|  33.3M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   33|  33.3M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   34|  33.3M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   35|  33.3M|    (j) = _ >> (m);                                         \
  |  |   36|  33.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (36:12): [Folded, False: 33.3M]
  |  |  ------------------
  ------------------
  557|  33.3M|    if (not_power_4) {
  ------------------
  |  Branch (557:9): [True: 0, False: 33.3M]
  ------------------
  558|      0|      h2 += 1;
  559|      0|      h2 &= ~1;
  560|      0|    }
  561|  33.3M|    inp += (h2);
  562|       |
  563|  33.3M|    x0r = *inp;
  564|  33.3M|    x0i = *(inp + 1);
  565|  33.3M|    inp += (npoints >> 1);
  566|       |
  567|  33.3M|    x1r = *inp;
  568|  33.3M|    x1i = *(inp + 1);
  569|  33.3M|    inp += (npoints >> 1);
  570|       |
  571|  33.3M|    x2r = *inp;
  572|  33.3M|    x2i = *(inp + 1);
  573|  33.3M|    inp += (npoints >> 1);
  574|       |
  575|  33.3M|    x3r = *inp;
  576|  33.3M|    x3i = *(inp + 1);
  577|       |
  578|  33.3M|    x0r = x0r + x2r;
  579|  33.3M|    x0i = x0i + x2i;
  580|  33.3M|    x2r = x0r - (x2r * 2);
  581|  33.3M|    x2i = x0i - (x2i * 2);
  582|  33.3M|    x1r = x1r + x3r;
  583|  33.3M|    x1i = x1i + x3i;
  584|  33.3M|    x3r = x1r - (x3r * 2);
  585|  33.3M|    x3i = x1i - (x3i * 2);
  586|       |
  587|  33.3M|    x0r = x0r + x1r;
  588|  33.3M|    x0i = x0i + x1i;
  589|  33.3M|    x1r = x0r - (x1r * 2);
  590|  33.3M|    x1i = x0i - (x1i * 2);
  591|  33.3M|    x2r = x2r - x3i;
  592|  33.3M|    x2i = x2i + x3r;
  593|  33.3M|    x3i = x2r + (x3i * 2);
  594|  33.3M|    x3r = x2i - (x3r * 2);
  595|       |
  596|  33.3M|    *ptr_y++ = x0r;
  597|  33.3M|    *ptr_y++ = x0i;
  598|  33.3M|    *ptr_y++ = x2r;
  599|  33.3M|    *ptr_y++ = x2i;
  600|  33.3M|    *ptr_y++ = x1r;
  601|  33.3M|    *ptr_y++ = x1i;
  602|  33.3M|    *ptr_y++ = x3i;
  603|  33.3M|    *ptr_y++ = x3r;
  604|  33.3M|  }
  605|  5.50M|  ptr_y -= 2 * npoints;
  606|  5.50M|  del = 4;
  607|  5.50M|  nodespacing = 64;
  608|  5.50M|  in_loop_cnt = npoints >> 4;
  609|  11.9M|  for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (609:26): [True: 6.44M, False: 5.50M]
  ------------------
  610|  6.44M|    const FLOAT32 *twiddles = ptr_w;
  611|  6.44M|    FLOAT32 *data = ptr_y;
  612|  6.44M|    FLOAT32 W1, W2, W3, W4, W5, W6;
  613|  6.44M|    WORD32 sec_loop_cnt;
  614|       |
  615|  15.7M|    for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (615:27): [True: 9.26M, False: 6.44M]
  ------------------
  616|  9.26M|      x0r = (*data);
  617|  9.26M|      x0i = (*(data + 1));
  618|  9.26M|      data += ((SIZE_T)del << 1);
  619|       |
  620|  9.26M|      x1r = (*data);
  621|  9.26M|      x1i = (*(data + 1));
  622|  9.26M|      data += ((SIZE_T)del << 1);
  623|       |
  624|  9.26M|      x2r = (*data);
  625|  9.26M|      x2i = (*(data + 1));
  626|  9.26M|      data += ((SIZE_T)del << 1);
  627|       |
  628|  9.26M|      x3r = (*data);
  629|  9.26M|      x3i = (*(data + 1));
  630|  9.26M|      data -= 3 * ((SIZE_T)del << 1);
  631|       |
  632|  9.26M|      x0r = x0r + x2r;
  633|  9.26M|      x0i = x0i + x2i;
  634|  9.26M|      x2r = x0r - (x2r * 2);
  635|  9.26M|      x2i = x0i - (x2i * 2);
  636|  9.26M|      x1r = x1r + x3r;
  637|  9.26M|      x1i = x1i + x3i;
  638|  9.26M|      x3r = x1r - (x3r * 2);
  639|  9.26M|      x3i = x1i - (x3i * 2);
  640|       |
  641|  9.26M|      x0r = x0r + x1r;
  642|  9.26M|      x0i = x0i + x1i;
  643|  9.26M|      x1r = x0r - (x1r * 2);
  644|  9.26M|      x1i = x0i - (x1i * 2);
  645|  9.26M|      x2r = x2r - x3i;
  646|  9.26M|      x2i = x2i + x3r;
  647|  9.26M|      x3i = x2r + (x3i * 2);
  648|  9.26M|      x3r = x2i - (x3r * 2);
  649|       |
  650|  9.26M|      *data = x0r;
  651|  9.26M|      *(data + 1) = x0i;
  652|  9.26M|      data += ((SIZE_T)del << 1);
  653|       |
  654|  9.26M|      *data = x2r;
  655|  9.26M|      *(data + 1) = x2i;
  656|  9.26M|      data += ((SIZE_T)del << 1);
  657|       |
  658|  9.26M|      *data = x1r;
  659|  9.26M|      *(data + 1) = x1i;
  660|  9.26M|      data += ((SIZE_T)del << 1);
  661|       |
  662|  9.26M|      *data = x3i;
  663|  9.26M|      *(data + 1) = x3r;
  664|  9.26M|      data += ((SIZE_T)del << 1);
  665|  9.26M|    }
  666|  6.44M|    data = ptr_y + 2;
  667|       |
  668|  6.44M|    sec_loop_cnt = (nodespacing * del);
  669|  6.44M|    sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
  670|  6.44M|                   (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
  671|  6.44M|                   (sec_loop_cnt / 256);
  672|       |
  673|  16.6M|    for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (673:27): [True: 10.2M, False: 6.44M]
  ------------------
  674|  10.2M|      W1 = *(twiddles + j);
  675|  10.2M|      W4 = *(twiddles + j + 257);
  676|  10.2M|      W2 = *(twiddles + ((SIZE_T)j << 1));
  677|  10.2M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 257);
  678|  10.2M|      W3 = *(twiddles + j + ((SIZE_T)j << 1));
  679|  10.2M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) + 257);
  680|       |
  681|  23.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (681:29): [True: 13.0M, False: 10.2M]
  ------------------
  682|  13.0M|        FLOAT32 tmp;
  683|  13.0M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  684|       |
  685|  13.0M|        data += ((SIZE_T)del << 1);
  686|       |
  687|  13.0M|        x1r = *data;
  688|  13.0M|        x1i = *(data + 1);
  689|  13.0M|        data += ((SIZE_T)del << 1);
  690|       |
  691|  13.0M|        x2r = *data;
  692|  13.0M|        x2i = *(data + 1);
  693|  13.0M|        data += ((SIZE_T)del << 1);
  694|       |
  695|  13.0M|        x3r = *data;
  696|  13.0M|        x3i = *(data + 1);
  697|  13.0M|        data -= 3 * ((SIZE_T)del << 1);
  698|       |
  699|  13.0M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  700|  13.0M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  701|  13.0M|        x1r = tmp;
  702|       |
  703|  13.0M|        tmp = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  704|  13.0M|        x2i = (FLOAT32)(-((FLOAT32)x2r * W5) + (FLOAT32)x2i * W2);
  705|  13.0M|        x2r = tmp;
  706|       |
  707|  13.0M|        tmp = (FLOAT32)(((FLOAT32)x3r * W3) + ((FLOAT32)x3i * W6));
  708|  13.0M|        x3i = (FLOAT32)(-((FLOAT32)x3r * W6) + (FLOAT32)x3i * W3);
  709|  13.0M|        x3r = tmp;
  710|       |
  711|  13.0M|        x0r = (*data);
  712|  13.0M|        x0i = (*(data + 1));
  713|       |
  714|  13.0M|        x0r = x0r + (x2r);
  715|  13.0M|        x0i = x0i + (x2i);
  716|  13.0M|        x2r = x0r - (x2r * 2);
  717|  13.0M|        x2i = x0i - (x2i * 2);
  718|  13.0M|        x1r = x1r + x3r;
  719|  13.0M|        x1i = x1i + x3i;
  720|  13.0M|        x3r = x1r - (x3r * 2);
  721|  13.0M|        x3i = x1i - (x3i * 2);
  722|       |
  723|  13.0M|        x0r = x0r + (x1r);
  724|  13.0M|        x0i = x0i + (x1i);
  725|  13.0M|        x1r = x0r - (x1r * 2);
  726|  13.0M|        x1i = x0i - (x1i * 2);
  727|  13.0M|        x2r = x2r - (x3i);
  728|  13.0M|        x2i = x2i + (x3r);
  729|  13.0M|        x3i = x2r + (x3i * 2);
  730|  13.0M|        x3r = x2i - (x3r * 2);
  731|       |
  732|  13.0M|        *data = x0r;
  733|  13.0M|        *(data + 1) = x0i;
  734|  13.0M|        data += ((SIZE_T)del << 1);
  735|       |
  736|  13.0M|        *data = x2r;
  737|  13.0M|        *(data + 1) = x2i;
  738|  13.0M|        data += ((SIZE_T)del << 1);
  739|       |
  740|  13.0M|        *data = x1r;
  741|  13.0M|        *(data + 1) = x1i;
  742|  13.0M|        data += ((SIZE_T)del << 1);
  743|       |
  744|  13.0M|        *data = x3i;
  745|  13.0M|        *(data + 1) = x3r;
  746|  13.0M|        data += ((SIZE_T)del << 1);
  747|  13.0M|      }
  748|  10.2M|      data -= 2 * npoints;
  749|  10.2M|      data += 2;
  750|  10.2M|    }
  751|  14.7M|    for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (751:12): [True: 8.32M, False: 6.44M]
  ------------------
  752|  8.32M|      W1 = *(twiddles + j);
  753|  8.32M|      W4 = *(twiddles + j + 257);
  754|  8.32M|      W2 = *(twiddles + ((SIZE_T)j << 1));
  755|  8.32M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 257);
  756|  8.32M|      W3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
  757|  8.32M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
  758|       |
  759|  19.4M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (759:29): [True: 11.1M, False: 8.32M]
  ------------------
  760|  11.1M|        FLOAT32 tmp;
  761|  11.1M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  762|       |
  763|  11.1M|        data += ((SIZE_T)del << 1);
  764|       |
  765|  11.1M|        x1r = *data;
  766|  11.1M|        x1i = *(data + 1);
  767|  11.1M|        data += ((SIZE_T)del << 1);
  768|       |
  769|  11.1M|        x2r = *data;
  770|  11.1M|        x2i = *(data + 1);
  771|  11.1M|        data += ((SIZE_T)del << 1);
  772|       |
  773|  11.1M|        x3r = *data;
  774|  11.1M|        x3i = *(data + 1);
  775|  11.1M|        data -= 3 * ((SIZE_T)del << 1);
  776|       |
  777|  11.1M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  778|  11.1M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  779|  11.1M|        x1r = tmp;
  780|       |
  781|  11.1M|        tmp = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  782|  11.1M|        x2i = (FLOAT32)(-((FLOAT32)x2r * W5) + (FLOAT32)x2i * W2);
  783|  11.1M|        x2r = tmp;
  784|       |
  785|  11.1M|        tmp = (FLOAT32)(((FLOAT32)x3r * W6) - ((FLOAT32)x3i * W3));
  786|  11.1M|        x3i = (FLOAT32)(((FLOAT32)x3r * W3) + ((FLOAT32)x3i * W6));
  787|  11.1M|        x3r = tmp;
  788|       |
  789|  11.1M|        x0r = (*data);
  790|  11.1M|        x0i = (*(data + 1));
  791|       |
  792|  11.1M|        x0r = x0r + (x2r);
  793|  11.1M|        x0i = x0i + (x2i);
  794|  11.1M|        x2r = x0r - (x2r * 2);
  795|  11.1M|        x2i = x0i - (x2i * 2);
  796|  11.1M|        x1r = x1r + x3r;
  797|  11.1M|        x1i = x1i + x3i;
  798|  11.1M|        x3r = x1r - (x3r * 2);
  799|  11.1M|        x3i = x1i - (x3i * 2);
  800|       |
  801|  11.1M|        x0r = x0r + (x1r);
  802|  11.1M|        x0i = x0i + (x1i);
  803|  11.1M|        x1r = x0r - (x1r * 2);
  804|  11.1M|        x1i = x0i - (x1i * 2);
  805|  11.1M|        x2r = x2r - (x3i);
  806|  11.1M|        x2i = x2i + (x3r);
  807|  11.1M|        x3i = x2r + (x3i * 2);
  808|  11.1M|        x3r = x2i - (x3r * 2);
  809|       |
  810|  11.1M|        *data = x0r;
  811|  11.1M|        *(data + 1) = x0i;
  812|  11.1M|        data += ((SIZE_T)del << 1);
  813|       |
  814|  11.1M|        *data = x2r;
  815|  11.1M|        *(data + 1) = x2i;
  816|  11.1M|        data += ((SIZE_T)del << 1);
  817|       |
  818|  11.1M|        *data = x1r;
  819|  11.1M|        *(data + 1) = x1i;
  820|  11.1M|        data += ((SIZE_T)del << 1);
  821|       |
  822|  11.1M|        *data = x3i;
  823|  11.1M|        *(data + 1) = x3r;
  824|  11.1M|        data += ((SIZE_T)del << 1);
  825|  11.1M|      }
  826|  8.32M|      data -= 2 * npoints;
  827|  8.32M|      data += 2;
  828|  8.32M|    }
  829|  8.32M|    for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (829:12): [True: 1.88M, False: 6.44M]
  ------------------
  830|  1.88M|      W1 = *(twiddles + j);
  831|  1.88M|      W4 = *(twiddles + j + 257);
  832|  1.88M|      W2 = *(twiddles + ((SIZE_T)j << 1) - 256);
  833|  1.88M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 1);
  834|  1.88M|      W3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
  835|  1.88M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
  836|       |
  837|  3.76M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (837:29): [True: 1.88M, False: 1.88M]
  ------------------
  838|  1.88M|        FLOAT32 tmp;
  839|  1.88M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  840|       |
  841|  1.88M|        data += ((SIZE_T)del << 1);
  842|       |
  843|  1.88M|        x1r = *data;
  844|  1.88M|        x1i = *(data + 1);
  845|  1.88M|        data += ((SIZE_T)del << 1);
  846|       |
  847|  1.88M|        x2r = *data;
  848|  1.88M|        x2i = *(data + 1);
  849|  1.88M|        data += ((SIZE_T)del << 1);
  850|       |
  851|  1.88M|        x3r = *data;
  852|  1.88M|        x3i = *(data + 1);
  853|  1.88M|        data -= 3 * ((SIZE_T)del << 1);
  854|       |
  855|  1.88M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  856|  1.88M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  857|  1.88M|        x1r = tmp;
  858|       |
  859|  1.88M|        tmp = (FLOAT32)(((FLOAT32)x2r * W5) - ((FLOAT32)x2i * W2));
  860|  1.88M|        x2i = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  861|  1.88M|        x2r = tmp;
  862|       |
  863|  1.88M|        tmp = (FLOAT32)(((FLOAT32)x3r * W6) - ((FLOAT32)x3i * W3));
  864|  1.88M|        x3i = (FLOAT32)(((FLOAT32)x3r * W3) + ((FLOAT32)x3i * W6));
  865|  1.88M|        x3r = tmp;
  866|       |
  867|  1.88M|        x0r = (*data);
  868|  1.88M|        x0i = (*(data + 1));
  869|       |
  870|  1.88M|        x0r = x0r + (x2r);
  871|  1.88M|        x0i = x0i + (x2i);
  872|  1.88M|        x2r = x0r - (x2r * 2);
  873|  1.88M|        x2i = x0i - (x2i * 2);
  874|  1.88M|        x1r = x1r + x3r;
  875|  1.88M|        x1i = x1i + x3i;
  876|  1.88M|        x3r = x1r - (x3r * 2);
  877|  1.88M|        x3i = x1i - (x3i * 2);
  878|       |
  879|  1.88M|        x0r = x0r + (x1r);
  880|  1.88M|        x0i = x0i + (x1i);
  881|  1.88M|        x1r = x0r - (x1r * 2);
  882|  1.88M|        x1i = x0i - (x1i * 2);
  883|  1.88M|        x2r = x2r - (x3i);
  884|  1.88M|        x2i = x2i + (x3r);
  885|  1.88M|        x3i = x2r + (x3i * 2);
  886|  1.88M|        x3r = x2i - (x3r * 2);
  887|       |
  888|  1.88M|        *data = x0r;
  889|  1.88M|        *(data + 1) = x0i;
  890|  1.88M|        data += ((SIZE_T)del << 1);
  891|       |
  892|  1.88M|        *data = x2r;
  893|  1.88M|        *(data + 1) = x2i;
  894|  1.88M|        data += ((SIZE_T)del << 1);
  895|       |
  896|  1.88M|        *data = x1r;
  897|  1.88M|        *(data + 1) = x1i;
  898|  1.88M|        data += ((SIZE_T)del << 1);
  899|       |
  900|  1.88M|        *data = x3i;
  901|  1.88M|        *(data + 1) = x3r;
  902|  1.88M|        data += ((SIZE_T)del << 1);
  903|  1.88M|      }
  904|  1.88M|      data -= 2 * npoints;
  905|  1.88M|      data += 2;
  906|  1.88M|    }
  907|  16.6M|    for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (907:12): [True: 10.2M, False: 6.44M]
  ------------------
  908|  10.2M|      W1 = *(twiddles + j);
  909|  10.2M|      W4 = *(twiddles + j + 257);
  910|  10.2M|      W2 = *(twiddles + ((SIZE_T)j << 1) - 256);
  911|  10.2M|      W5 = *(twiddles + ((SIZE_T)j << 1) + 1);
  912|  10.2M|      W3 = *(twiddles + j + ((SIZE_T)j << 1) - 512);
  913|  10.2M|      W6 = *(twiddles + j + ((SIZE_T)j << 1) - 512 + 257);
  914|       |
  915|  23.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (915:29): [True: 13.0M, False: 10.2M]
  ------------------
  916|  13.0M|        FLOAT32 tmp;
  917|  13.0M|        FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  918|       |
  919|  13.0M|        data += ((SIZE_T)del << 1);
  920|       |
  921|  13.0M|        x1r = *data;
  922|  13.0M|        x1i = *(data + 1);
  923|  13.0M|        data += ((SIZE_T)del << 1);
  924|       |
  925|  13.0M|        x2r = *data;
  926|  13.0M|        x2i = *(data + 1);
  927|  13.0M|        data += ((SIZE_T)del << 1);
  928|       |
  929|  13.0M|        x3r = *data;
  930|  13.0M|        x3i = *(data + 1);
  931|  13.0M|        data -= 3 * ((SIZE_T)del << 1);
  932|       |
  933|  13.0M|        tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
  934|  13.0M|        x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
  935|  13.0M|        x1r = tmp;
  936|       |
  937|  13.0M|        tmp = (FLOAT32)(((FLOAT32)x2r * W5) - ((FLOAT32)x2i * W2));
  938|  13.0M|        x2i = (FLOAT32)(((FLOAT32)x2r * W2) + ((FLOAT32)x2i * W5));
  939|  13.0M|        x2r = tmp;
  940|       |
  941|  13.0M|        tmp = (FLOAT32)(-((FLOAT32)x3r * W3) - ((FLOAT32)x3i * W6));
  942|  13.0M|        x3i = (FLOAT32)(-((FLOAT32)x3r * W6) + (FLOAT32)x3i * W3);
  943|  13.0M|        x3r = tmp;
  944|       |
  945|  13.0M|        x0r = (*data);
  946|  13.0M|        x0i = (*(data + 1));
  947|       |
  948|  13.0M|        x0r = x0r + (x2r);
  949|  13.0M|        x0i = x0i + (x2i);
  950|  13.0M|        x2r = x0r - (x2r * 2);
  951|  13.0M|        x2i = x0i - (x2i * 2);
  952|  13.0M|        x1r = x1r + x3r;
  953|  13.0M|        x1i = x1i - x3i;
  954|  13.0M|        x3r = x1r - (x3r * 2);
  955|  13.0M|        x3i = x1i + (x3i * 2);
  956|       |
  957|  13.0M|        x0r = x0r + (x1r);
  958|  13.0M|        x0i = x0i + (x1i);
  959|  13.0M|        x1r = x0r - (x1r * 2);
  960|  13.0M|        x1i = x0i - (x1i * 2);
  961|  13.0M|        x2r = x2r - (x3i);
  962|  13.0M|        x2i = x2i + (x3r);
  963|  13.0M|        x3i = x2r + (x3i * 2);
  964|  13.0M|        x3r = x2i - (x3r * 2);
  965|       |
  966|  13.0M|        *data = x0r;
  967|  13.0M|        *(data + 1) = x0i;
  968|  13.0M|        data += ((SIZE_T)del << 1);
  969|       |
  970|  13.0M|        *data = x2r;
  971|  13.0M|        *(data + 1) = x2i;
  972|  13.0M|        data += ((SIZE_T)del << 1);
  973|       |
  974|  13.0M|        *data = x1r;
  975|  13.0M|        *(data + 1) = x1i;
  976|  13.0M|        data += ((SIZE_T)del << 1);
  977|       |
  978|  13.0M|        *data = x3i;
  979|  13.0M|        *(data + 1) = x3r;
  980|  13.0M|        data += ((SIZE_T)del << 1);
  981|  13.0M|      }
  982|  10.2M|      data -= 2 * npoints;
  983|  10.2M|      data += 2;
  984|  10.2M|    }
  985|  6.44M|    nodespacing >>= 2;
  986|  6.44M|    del <<= 2;
  987|  6.44M|    in_loop_cnt >>= 2;
  988|  6.44M|  }
  989|       |
  990|  5.50M|  if (not_power_4) {
  ------------------
  |  Branch (990:7): [True: 0, False: 5.50M]
  ------------------
  991|      0|    const FLOAT32 *twiddles = ptr_w;
  992|      0|    nodespacing <<= 1;
  993|       |
  994|      0|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (994:23): [True: 0, False: 0]
  ------------------
  995|      0|      FLOAT32 W1 = *twiddles;
  996|      0|      FLOAT32 W4 = *(twiddles + 257);
  997|      0|      FLOAT32 tmp;
  998|      0|      twiddles += nodespacing;
  999|       |
 1000|      0|      x0r = *ptr_y;
 1001|      0|      x0i = *(ptr_y + 1);
 1002|      0|      ptr_y += ((SIZE_T)del << 1);
 1003|       |
 1004|      0|      x1r = *ptr_y;
 1005|      0|      x1i = *(ptr_y + 1);
 1006|       |
 1007|      0|      tmp = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
 1008|      0|      x1i = (FLOAT32)(-((FLOAT32)x1r * W4) + (FLOAT32)x1i * W1);
 1009|      0|      x1r = tmp;
 1010|       |
 1011|      0|      *ptr_y = (x0r) - (x1r);
 1012|      0|      *(ptr_y + 1) = (x0i) - (x1i);
 1013|      0|      ptr_y -= ((SIZE_T)del << 1);
 1014|       |
 1015|      0|      *ptr_y = (x0r) + (x1r);
 1016|      0|      *(ptr_y + 1) = (x0i) + (x1i);
 1017|      0|      ptr_y += 2;
 1018|      0|    }
 1019|      0|    twiddles = ptr_w;
 1020|      0|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (1020:23): [True: 0, False: 0]
  ------------------
 1021|      0|      FLOAT32 W1 = *twiddles;
 1022|      0|      FLOAT32 W4 = *(twiddles + 257);
 1023|      0|      FLOAT32 tmp;
 1024|      0|      twiddles += nodespacing;
 1025|       |
 1026|      0|      x0r = *ptr_y;
 1027|      0|      x0i = *(ptr_y + 1);
 1028|      0|      ptr_y += ((SIZE_T)del << 1);
 1029|       |
 1030|      0|      x1r = *ptr_y;
 1031|      0|      x1i = *(ptr_y + 1);
 1032|       |
 1033|      0|      tmp = (FLOAT32)(((FLOAT32)x1r * W4) - ((FLOAT32)x1i * W1));
 1034|      0|      x1i = (FLOAT32)(((FLOAT32)x1r * W1) + ((FLOAT32)x1i * W4));
 1035|      0|      x1r = tmp;
 1036|       |
 1037|      0|      *ptr_y = (x0r) - (x1r);
 1038|      0|      *(ptr_y + 1) = (x0i) - (x1i);
 1039|      0|      ptr_y -= ((SIZE_T)del << 1);
 1040|       |
 1041|      0|      *ptr_y = (x0r) + (x1r);
 1042|      0|      *(ptr_y + 1) = (x0i) + (x1i);
 1043|      0|      ptr_y += 2;
 1044|      0|    }
 1045|      0|  }
 1046|  5.50M|}
ixheaac_real_synth_fft_p3:
 1084|  3.49M|void ixheaac_real_synth_fft_p3(FLOAT32 *x_in, FLOAT32 *x_out, WORD32 npoints) {
 1085|  3.49M|  WORD32 i, j;
 1086|  3.49M|  FLOAT32 x_3[8];
 1087|  3.49M|  FLOAT32 y_3[16];
 1088|  3.49M|  FLOAT32 y[48];
 1089|  3.49M|  FLOAT32 x[48];
 1090|  3.49M|  FLOAT32 *ptr_y = y;
 1091|  3.49M|  FLOAT32 *y_p3 = y;
 1092|  3.49M|  FLOAT32 *x_p3 = x;
 1093|       |
 1094|  13.9M|  for (i = 0; i < 3; i += 1) {
  ------------------
  |  Branch (1094:15): [True: 10.4M, False: 3.49M]
  ------------------
 1095|  94.2M|    for (j = 0; j < (npoints / 3); j++) {
  ------------------
  |  Branch (1095:17): [True: 83.7M, False: 10.4M]
  ------------------
 1096|  83.7M|      x_3[j] = x_in[3 * j + i];
 1097|  83.7M|    }
 1098|       |
 1099|  10.4M|    ixheaac_real_synth_fft_p2(x_3, y_3, 8);
 1100|       |
 1101|  94.2M|    for (j = 0; j < 16; j += 2) {
  ------------------
  |  Branch (1101:17): [True: 83.7M, False: 10.4M]
  ------------------
 1102|  83.7M|      x[3 * j + 2 * i] = y_3[j];
 1103|  83.7M|      x[3 * j + 2 * i + 1] = y_3[j + 1];
 1104|  83.7M|    }
 1105|  10.4M|  }
 1106|       |
 1107|  3.49M|  {
 1108|  3.49M|    FLOAT32 *wr;
 1109|  3.49M|    FLOAT32 tmp;
 1110|  3.49M|    FLOAT32 *x_tw = x;
 1111|  3.49M|    wr = (FLOAT32 *)ixheaac_twidle_tbl_24;
 1112|  3.49M|    x_tw += 2;
 1113|       |
 1114|  31.4M|    for (i = 0; i < (npoints / 3); i++) {
  ------------------
  |  Branch (1114:17): [True: 27.9M, False: 3.49M]
  ------------------
 1115|  27.9M|      tmp = ((*x_tw) * (*wr) + (*(x_tw + 1)) * (*(wr + 1)));
 1116|  27.9M|      *(x_tw + 1) = (-(*x_tw) * (*(wr + 1)) + (*(x_tw + 1)) * (*wr));
 1117|  27.9M|      *x_tw = tmp;
 1118|       |
 1119|  27.9M|      wr += 2;
 1120|  27.9M|      x_tw += 2;
 1121|       |
 1122|  27.9M|      tmp = ((*x_tw) * (*wr) + (*(x_tw + 1)) * (*(wr + 1)));
 1123|  27.9M|      *(x_tw + 1) = (-(*x_tw) * (*(wr + 1)) + (*(x_tw + 1)) * (*wr));
 1124|  27.9M|      *x_tw = tmp;
 1125|       |
 1126|  27.9M|      wr += 2;
 1127|  27.9M|      x_tw += 4;
 1128|  27.9M|    }
 1129|  3.49M|  }
 1130|       |
 1131|  31.4M|  for (i = 0; i < (npoints / 3); i++) {
  ------------------
  |  Branch (1131:15): [True: 27.9M, False: 3.49M]
  ------------------
 1132|  27.9M|    ixheaac_aac_ld_dec_fft_3_float(x_p3, y_p3);
 1133|       |
 1134|  27.9M|    x_p3 = x_p3 + 6;
 1135|  27.9M|    y_p3 = y_p3 + 6;
 1136|  27.9M|  }
 1137|       |
 1138|  31.4M|  for (i = 0; i < 16; i += 2) {
  ------------------
  |  Branch (1138:15): [True: 27.9M, False: 3.49M]
  ------------------
 1139|  27.9M|    x_out[i] = *ptr_y++;
 1140|  27.9M|    x_out[i + 1] = *ptr_y++;
 1141|  27.9M|    x_out[16 + i] = *ptr_y++;
 1142|  27.9M|    x_out[16 + i + 1] = *ptr_y++;
 1143|  27.9M|    x_out[32 + i] = *ptr_y++;
 1144|  27.9M|    x_out[32 + i + 1] = *ptr_y++;
 1145|  27.9M|  }
 1146|  3.49M|}
ixheaac_cmplx_anal_fft_p3:
 1148|  1.52M|void ixheaac_cmplx_anal_fft_p3(FLOAT32 *x_in, FLOAT32 *x_out, WORD32 npoints) {
 1149|  1.52M|  WORD32 i, j;
 1150|  1.52M|  FLOAT32 x_3[32];
 1151|  1.52M|  FLOAT32 y_3[32];
 1152|  1.52M|  FLOAT32 y[96];
 1153|  1.52M|  FLOAT32 *ptr_x = x_in;
 1154|  1.52M|  FLOAT32 *ptr_y = y;
 1155|  1.52M|  FLOAT32 *y_p3 = y;
 1156|       |
 1157|  6.08M|  for (i = 0; i < 6; i += 2) {
  ------------------
  |  Branch (1157:15): [True: 4.56M, False: 1.52M]
  ------------------
 1158|  77.5M|    for (j = 0; j < 32; j += 2) {
  ------------------
  |  Branch (1158:17): [True: 72.9M, False: 4.56M]
  ------------------
 1159|  72.9M|      x_3[j] = x_in[3 * j + i];
 1160|  72.9M|      x_3[j + 1] = x_in[3 * j + i + 1];
 1161|  72.9M|    }
 1162|       |
 1163|  4.56M|    ixheaac_cmplx_anal_fft_p2(x_3, y_3, 16);
 1164|       |
 1165|  77.5M|    for (j = 0; j < 32; j += 2) {
  ------------------
  |  Branch (1165:17): [True: 72.9M, False: 4.56M]
  ------------------
 1166|  72.9M|      x_in[3 * j + i] = y_3[j];
 1167|  72.9M|      x_in[3 * j + i + 1] = y_3[j + 1];
 1168|  72.9M|    }
 1169|  4.56M|  }
 1170|       |
 1171|  1.52M|  {
 1172|  1.52M|    FLOAT32 *wr;
 1173|  1.52M|    FLOAT32 tmp;
 1174|  1.52M|    wr = (FLOAT32 *)ixheaac_twidle_tbl_48;
 1175|  1.52M|    x_in += 2;
 1176|       |
 1177|  25.8M|    for (i = 0; i < (npoints / 3); i++) {
  ------------------
  |  Branch (1177:17): [True: 24.3M, False: 1.52M]
  ------------------
 1178|  24.3M|      tmp = ((*x_in) * (*wr) + (*(x_in + 1)) * (*(wr + 1)));
 1179|  24.3M|      *(x_in + 1) = (-(*x_in) * (*(wr + 1)) + (*(x_in + 1)) * (*wr));
 1180|  24.3M|      *x_in = tmp;
 1181|       |
 1182|  24.3M|      wr += 2;
 1183|  24.3M|      x_in += 2;
 1184|       |
 1185|  24.3M|      tmp = ((*x_in) * (*wr) + (*(x_in + 1)) * (*(wr + 1)));
 1186|  24.3M|      *(x_in + 1) = (-(*x_in) * (*(wr + 1)) + (*(x_in + 1)) * (*wr));
 1187|  24.3M|      *x_in = tmp;
 1188|       |
 1189|  24.3M|      wr += 2;
 1190|  24.3M|      x_in += 4;
 1191|  24.3M|    }
 1192|  1.52M|  }
 1193|       |
 1194|  25.8M|  for (i = 0; i < (npoints / 3); i++) {
  ------------------
  |  Branch (1194:15): [True: 24.3M, False: 1.52M]
  ------------------
 1195|  24.3M|    ixheaac_aac_ld_dec_fft_3_float(ptr_x, ptr_y);
 1196|       |
 1197|  24.3M|    ptr_x = ptr_x + 6;
 1198|  24.3M|    ptr_y = ptr_y + 6;
 1199|  24.3M|  }
 1200|       |
 1201|  25.8M|  for (i = 0; i < 32; i += 2) {
  ------------------
  |  Branch (1201:15): [True: 24.3M, False: 1.52M]
  ------------------
 1202|  24.3M|    x_out[i] = *y_p3++;
 1203|  24.3M|    x_out[i + 1] = *y_p3++;
 1204|  24.3M|    x_out[32 + i] = *y_p3++;
 1205|  24.3M|    x_out[32 + i + 1] = *y_p3++;
 1206|  24.3M|    x_out[64 + i] = *y_p3++;
 1207|  24.3M|    x_out[64 + i + 1] = *y_p3++;
 1208|  24.3M|  }
 1209|  1.52M|}
ixheaac_esbr_fft.c:ixheaac_aac_ld_dec_fft_3_float:
 1048|  52.2M|static PLATFORM_INLINE void ixheaac_aac_ld_dec_fft_3_float(FLOAT32 *inp, FLOAT32 *op) {
 1049|  52.2M|  FLOAT32 add_r, sub_r;
 1050|  52.2M|  FLOAT32 add_i, sub_i;
 1051|  52.2M|  FLOAT32 temp_real, temp_imag, temp;
 1052|       |
 1053|  52.2M|  FLOAT32 p1, p2, p3, p4;
 1054|       |
 1055|  52.2M|  FLOAT32 sinmu;
 1056|  52.2M|  sinmu = -0.866025403784439f;
 1057|       |
 1058|  52.2M|  temp_real = inp[0] + inp[2];
 1059|  52.2M|  temp_imag = inp[1] + inp[3];
 1060|       |
 1061|  52.2M|  add_r = inp[2] + inp[4];
 1062|  52.2M|  add_i = inp[3] + inp[5];
 1063|       |
 1064|  52.2M|  sub_r = inp[2] - inp[4];
 1065|  52.2M|  sub_i = inp[3] - inp[5];
 1066|       |
 1067|  52.2M|  p1 = add_r / 2.0f;
 1068|  52.2M|  p4 = add_i / 2.0f;
 1069|  52.2M|  p2 = sub_i * sinmu;
 1070|  52.2M|  p3 = sub_r * sinmu;
 1071|       |
 1072|  52.2M|  temp = inp[0] - p1;
 1073|       |
 1074|  52.2M|  op[0] = temp_real + inp[4];
 1075|  52.2M|  op[1] = temp_imag + inp[5];
 1076|  52.2M|  op[2] = temp + p2;
 1077|  52.2M|  op[3] = (inp[1] - p3) - p4;
 1078|  52.2M|  op[4] = temp - p2;
 1079|  52.2M|  op[5] = (inp[1] + p3) - p4;
 1080|       |
 1081|  52.2M|  return;
 1082|  52.2M|}

impd_drc_validate_config_params:
   44|  2.23k|IA_ERRORCODE impd_drc_validate_config_params(ia_drc_input_config *pstr_inp_config) {
   45|  2.23k|  LOOPIDX i, j, k;
   46|  2.23k|  WORD32 curr_start_subband_idx, next_start_subband_idx;
   47|  2.23k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config = &pstr_inp_config->str_uni_drc_config;
   48|  2.23k|  ia_drc_loudness_info_set_struct *pstr_enc_loudness_info_set =
   49|  2.23k|      &pstr_inp_config->str_enc_loudness_info_set;
   50|       |
   51|  2.23k|  IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->drc_instructions_uni_drc_count, 0,
  ------------------
  |  |   39|  2.23k|  {                                                         \
  |  |   40|  2.23k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.23k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.19k, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.23k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.23k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 551, False: 1.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.23k|  }
  ------------------
   52|  2.23k|                       MAX_DRC_INSTRUCTIONS_COUNT);
   53|  13.1k|  for (i = 0; i < pstr_uni_drc_config->drc_instructions_uni_drc_count; i++) {
  ------------------
  |  Branch (53:15): [True: 10.9k, False: 2.23k]
  ------------------
   54|  10.9k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_id, 0,
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 8.68k, False: 2.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.05k, False: 6.85k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   55|  10.9k|                         MAX_DRC_SET_ID);
   56|  10.9k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 8.44k, False: 2.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.33k, False: 7.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   57|  10.9k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].additional_downmix_id_count, 0,
   58|  10.9k|        ADDITIONAL_DOWNMIX_ID_COUNT_MAX);
   59|  10.9k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_location, 0,
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.51k, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.15k, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   60|  10.9k|                         MAX_DRC_LOCATION);
   61|  10.9k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.15k, False: 3.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.60k, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   62|  10.9k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_target_loudness_value_upper,
   63|  10.9k|        MIN_DRC_TARGET_LOUDNESS, 0);
   64|  10.9k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.67k, False: 5.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.46k, False: 3.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   65|  10.9k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_target_loudness_value_lower,
   66|  10.9k|        MIN_DRC_TARGET_LOUDNESS, 0);
   67|  98.2k|    for (j = 0; j < MAX_CHANNEL_COUNT; j++) {
  ------------------
  |  |   25|  98.2k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (67:17): [True: 87.2k, False: 10.9k]
  ------------------
   68|  87.2k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].gain_set_index[j],
  ------------------
  |  |   39|  87.2k|  {                                                         \
  |  |   40|  87.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  87.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 64.6k, False: 22.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  87.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  87.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 29.4k, False: 57.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  87.2k|  }
  ------------------
   69|  87.2k|                           0, GAIN_SET_COUNT_MAX - 1);
   70|  87.2k|    }
   71|  10.9k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.2k, False: 645]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.92k, False: 2.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   72|  10.9k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].num_drc_channel_groups, 0,
   73|  10.9k|        MAX_CHANNEL_GROUP_COUNT);
   74|  43.4k|    for (j = 0; j < pstr_uni_drc_config->str_drc_instructions_uni_drc[i].num_drc_channel_groups;
  ------------------
  |  Branch (74:17): [True: 32.5k, False: 10.9k]
  ------------------
   75|  32.5k|         j++) {
   76|  32.5k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i]
  ------------------
  |  |   39|  32.5k|  {                                                         \
  |  |   40|  32.5k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  32.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.9k, False: 21.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  32.5k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  32.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 21.5k, False: 10.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  32.5k|  }
  ------------------
   77|  32.5k|                               .str_gain_modifiers[j]
   78|  32.5k|                               .attenuation_scaling[0],
   79|  32.5k|                           0, MAX_ATTENUATION_SCALING);
   80|  32.5k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i]
  ------------------
  |  |   39|  32.5k|  {                                                         \
  |  |   40|  32.5k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  32.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.8k, False: 21.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  32.5k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  32.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 21.7k, False: 10.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  32.5k|  }
  ------------------
   81|  32.5k|                               .str_gain_modifiers[j]
   82|  32.5k|                               .amplification_scaling[0],
   83|  32.5k|                           0, MAX_AMPLIFICATION_SCALING);
   84|  32.5k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i]
  ------------------
  |  |   39|  32.5k|  {                                                         \
  |  |   40|  32.5k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  32.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.8k, False: 21.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  32.5k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  32.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 21.8k, False: 10.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  32.5k|  }
  ------------------
   85|  32.5k|                               .str_gain_modifiers[j]
   86|  32.5k|                               .gain_offset[0],
   87|  32.5k|                           MIN_DRC_GAIN_OFFSET, MAX_DRC_GAIN_OFFSET);
   88|  32.5k|    }
   89|  10.9k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].limiter_peak_target,
  ------------------
  |  |   39|  10.9k|  {                                                         \
  |  |   40|  10.9k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.17k, False: 5.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.9k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 5.74k, False: 5.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.9k|  }
  ------------------
   90|  10.9k|                         MIN_LIMITER_PEAK_TARGET, 0.0f);
   91|  10.9k|#ifdef LOUDNESS_LEVELING_SUPPORT
   92|  10.9k|    if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_effect &
  ------------------
  |  Branch (92:9): [True: 4.88k, False: 6.02k]
  ------------------
   93|  10.9k|        EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  10.9k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
   94|  4.88k|      if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present != 0 &&
  ------------------
  |  Branch (94:11): [True: 3.28k, False: 1.60k]
  ------------------
   95|  3.28k|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present != 1) {
  ------------------
  |  Branch (95:11): [True: 0, False: 3.28k]
  ------------------
   96|      0|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present = 0;
   97|      0|      }
   98|  4.88k|      if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present != 0 &&
  ------------------
  |  Branch (98:11): [True: 3.41k, False: 1.47k]
  ------------------
   99|  3.41k|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present != 1) {
  ------------------
  |  Branch (99:11): [True: 0, False: 3.41k]
  ------------------
  100|      0|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present = 0;
  101|      0|      }
  102|  4.88k|    }
  103|  10.9k|#endif
  104|  10.9k|  }
  105|       |
  106|  2.23k|  IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->drc_coefficients_uni_drc_count, 0,
  ------------------
  |  |   39|  2.23k|  {                                                         \
  |  |   40|  2.23k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.23k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.03k, False: 201]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.23k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.23k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.15k, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.23k|  }
  ------------------
  107|  2.23k|                       MAX_DRC_COEFF_COUNT);
  108|  4.46k|  for (i = 0; i < pstr_uni_drc_config->drc_coefficients_uni_drc_count; i++) {
  ------------------
  |  Branch (108:15): [True: 2.61k, False: 1.84k]
  ------------------
  109|  2.61k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].drc_location, 0,
  ------------------
  |  |   39|  2.61k|  {                                                         \
  |  |   40|  2.61k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.61k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.05k, False: 562]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.61k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.61k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.14k, False: 1.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.61k|  }
  ------------------
  110|  2.61k|                         MAX_DRC_LOCATION);
  111|  2.61k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].gain_set_count, 0,
  ------------------
  |  |   39|  2.61k|  {                                                         \
  |  |   40|  2.61k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.61k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.54k, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.61k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.61k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.29k, False: 1.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.61k|  }
  ------------------
  112|  2.61k|                         MAX_CHANNEL_GROUP_COUNT);
  113|  5.91k|    for (j = 0; j < pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].gain_set_count; j++) {
  ------------------
  |  Branch (113:17): [True: 3.69k, False: 2.22k]
  ------------------
  114|  3.69k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.69k|  {                                                         \
  |  |   40|  3.69k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.69k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.09k, False: 602]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.69k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.69k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.10k, False: 2.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.69k|  }
  ------------------
  115|  3.69k|                               .str_gain_set_params[j]
  116|  3.69k|                               .gain_coding_profile,
  117|  3.69k|                           0, MAX_GAIN_CODING_PROFILE);
  118|  3.69k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.69k|  {                                                         \
  |  |   40|  3.69k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.69k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.65k, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.69k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.69k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.01k, False: 1.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.69k|  }
  ------------------
  119|  3.69k|          pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count,
  120|  3.69k|          0, MAX_BAND_COUNT);
  121|  3.69k|      for (k = 0;
  122|  7.37k|           k <
  ------------------
  |  Branch (122:12): [True: 3.68k, False: 3.69k]
  ------------------
  123|  7.37k|           pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count;
  124|  3.69k|           k++) {
  125|  3.68k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.68k|  {                                                         \
  |  |   40|  3.68k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.59k, False: 86]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.68k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.68k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.92k, False: 1.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.68k|  }
  ------------------
  126|  3.68k|                                 .str_gain_set_params[j]
  127|  3.68k|                                 .gain_params[k]
  128|  3.68k|                                 .nb_points,
  129|  3.68k|                             0, MAX_GAIN_POINTS);
  130|  3.68k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.68k|  {                                                         \
  |  |   40|  3.68k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.02k, False: 656]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.68k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.68k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.09k, False: 2.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.68k|  }
  ------------------
  131|  3.68k|                                 .str_gain_set_params[j]
  132|  3.68k|                                 .gain_params[k]
  133|  3.68k|                                 .drc_characteristic,
  134|  3.68k|                             0, MAX_DRC_CHARACTERISTIC_VALUE);
  135|  3.68k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.68k|  {                                                         \
  |  |   40|  3.68k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.66k, False: 1.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.68k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.68k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.15k, False: 2.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.68k|  }
  ------------------
  136|  3.68k|                                 .str_gain_set_params[j]
  137|  3.68k|                                 .gain_params[k]
  138|  3.68k|                                 .crossover_freq_index,
  139|  3.68k|                             0, MAX_CROSSOVER_FREQ_INDEX);
  140|  3.68k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.68k|  {                                                         \
  |  |   40|  3.68k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.79k, False: 885]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.68k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.68k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.18k, False: 2.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.68k|  }
  ------------------
  141|  3.68k|                                 .str_gain_set_params[j]
  142|  3.68k|                                 .gain_params[k]
  143|  3.68k|                                 .start_sub_band_index,
  144|  3.68k|                             0, STFT256_HOP_SIZE - 1);
  145|  3.68k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.68k|  {                                                         \
  |  |   40|  3.68k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.47k, False: 1.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.68k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.68k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.22k, False: 2.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.68k|  }
  ------------------
  146|  3.68k|                                 .str_gain_set_params[j]
  147|  3.68k|                                 .gain_params[k]
  148|  3.68k|                                 .width,
  149|  3.68k|                             -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  150|   143k|        for (WORD32 m = 0; m < pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  Branch (150:28): [True: 139k, False: 3.68k]
  ------------------
  151|   143k|                                   .str_gain_set_params[j]
  152|   143k|                                   .gain_params[k]
  153|   143k|                                   .nb_points;
  154|   139k|             m++) {
  155|   139k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|   139k|  {                                                         \
  |  |   40|   139k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   139k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 74.8k, False: 65.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   139k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   139k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 65.8k, False: 74.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   139k|  }
  ------------------
  156|   139k|                                   .str_gain_set_params[j]
  157|   139k|                                   .gain_params[k]
  158|   139k|                                   .gain_points[m]
  159|   139k|                                   .x,
  160|   139k|                               -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  161|   139k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|   139k|  {                                                         \
  |  |   40|   139k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   139k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 74.7k, False: 65.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   139k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   139k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 65.6k, False: 74.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   139k|  }
  ------------------
  162|   139k|                                   .str_gain_set_params[j]
  163|   139k|                                   .gain_params[k]
  164|   139k|                                   .gain_points[m]
  165|   139k|                                   .y,
  166|   139k|                               -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  167|   139k|        }
  168|  3.68k|      }
  169|  4.12k|      for (k = 0; k < pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  Branch (169:19): [True: 814, False: 3.30k]
  ------------------
  170|  4.12k|                              .str_gain_set_params[j]
  171|  4.12k|                              .band_count -
  172|  4.12k|                          1;
  173|  3.69k|           k++) {
  174|    814|        curr_start_subband_idx = pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  175|    814|                                     .str_gain_set_params[j]
  176|    814|                                     .gain_params[k]
  177|    814|                                     .start_sub_band_index;
  178|    814|        next_start_subband_idx = pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  179|    814|                                     .str_gain_set_params[j]
  180|    814|                                     .gain_params[k + 1]
  181|    814|                                     .start_sub_band_index;
  182|       |        /* It is assumed that the start index of a subband is greater than
  183|       |           the start index of its previous subbands for a multiband */
  184|    814|        if (next_start_subband_idx <= curr_start_subband_idx) {
  ------------------
  |  Branch (184:13): [True: 386, False: 428]
  ------------------
  185|    386|          return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_SUBBAND_INDEX;
  186|    386|        }
  187|    814|      }
  188|  3.69k|    }
  189|  2.61k|  }
  190|  1.84k|  IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->downmix_instructions_count, 0,
  ------------------
  |  |   39|  1.84k|  {                                                         \
  |  |   40|  1.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.76k, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 881, False: 967]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.84k|  }
  ------------------
  191|  1.84k|                       MAX_DOWNMIX_INSTRUCTION_COUNT);
  192|       |
  193|  1.84k|  IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->loudness_info_count, 0,
  ------------------
  |  |   39|  1.84k|  {                                                         \
  |  |   40|  1.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.84k, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 234, False: 1.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.84k|  }
  ------------------
  194|  1.84k|                       MAX_LOUDNESS_INFO_COUNT);
  195|  5.41k|  for (i = 0; i < pstr_enc_loudness_info_set->loudness_info_count; i++) {
  ------------------
  |  Branch (195:15): [True: 3.57k, False: 1.84k]
  ------------------
  196|  3.57k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i].sample_peak_level,
  ------------------
  |  |   39|  3.57k|  {                                                         \
  |  |   40|  3.57k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.57k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.60k, False: 971]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.57k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.57k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.35k, False: 216]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.57k|  }
  ------------------
  197|  3.57k|                         MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  198|  3.57k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i].true_peak_level,
  ------------------
  |  |   39|  3.57k|  {                                                         \
  |  |   40|  3.57k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.57k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.64k, False: 924]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.57k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.57k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.29k, False: 276]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.57k|  }
  ------------------
  199|  3.57k|                         MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  200|  3.57k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.57k|  {                                                         \
  |  |   40|  3.57k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.57k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.10k, False: 464]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.57k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.57k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 698, False: 2.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.57k|  }
  ------------------
  201|  3.57k|        pstr_enc_loudness_info_set->str_loudness_info[i].true_peak_level_measurement_system, 0,
  202|  3.57k|        MAX_MEASUREMENT_SYSTEM_TYPE);
  203|  3.57k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.57k|  {                                                         \
  |  |   40|  3.57k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.57k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.00k, False: 564]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.57k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.57k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 687, False: 2.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.57k|  }
  ------------------
  204|  3.57k|        pstr_enc_loudness_info_set->str_loudness_info[i].true_peak_level_reliability, 0,
  205|  3.57k|        MAX_RELIABILITY_TYPE);
  206|  3.57k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i].measurement_count, 0,
  ------------------
  |  |   39|  3.57k|  {                                                         \
  |  |   40|  3.57k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.57k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.11k, False: 458]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.57k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.57k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.93k, False: 1.63k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.57k|  }
  ------------------
  207|  3.57k|                         MAX_MEASUREMENT_COUNT);
  208|  19.8k|    for (j = 0; j < pstr_enc_loudness_info_set->str_loudness_info[i].measurement_count; j++) {
  ------------------
  |  Branch (208:17): [True: 16.2k, False: 3.57k]
  ------------------
  209|  16.2k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i]
  ------------------
  |  |   39|  16.2k|  {                                                         \
  |  |   40|  16.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.5k, False: 5.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.13k, False: 9.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.2k|  }
  ------------------
  210|  16.2k|                               .str_loudness_measure[j]
  211|  16.2k|                               .method_definition,
  212|  16.2k|                           0, MAX_METHOD_DEFINITION_TYPE);
  213|  16.2k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  16.2k|  {                                                         \
  |  |   40|  16.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.68k, False: 8.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 8.65k, False: 7.63k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.2k|  }
  ------------------
  214|  16.2k|          pstr_enc_loudness_info_set->str_loudness_info[i].str_loudness_measure[j].method_value,
  215|  16.2k|          MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  216|  16.2k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i]
  ------------------
  |  |   39|  16.2k|  {                                                         \
  |  |   40|  16.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.4k, False: 5.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.25k, False: 9.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.2k|  }
  ------------------
  217|  16.2k|                               .str_loudness_measure[j]
  218|  16.2k|                               .measurement_system,
  219|  16.2k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  220|  16.2k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  16.2k|  {                                                         \
  |  |   40|  16.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.79k, False: 6.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.05k, False: 9.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.2k|  }
  ------------------
  221|  16.2k|          pstr_enc_loudness_info_set->str_loudness_info[i].str_loudness_measure[j].reliability, 0,
  222|  16.2k|          MAX_RELIABILITY_TYPE);
  223|  16.2k|    }
  224|  3.57k|  }
  225|  1.84k|  IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->loudness_info_album_count, 0,
  ------------------
  |  |   39|  1.84k|  {                                                         \
  |  |   40|  1.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.84k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 333, False: 1.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.84k|  }
  ------------------
  226|  1.84k|                       MAX_LOUDNESS_INFO_COUNT);
  227|  7.93k|  for (i = 0; i < pstr_enc_loudness_info_set->loudness_info_album_count; i++) {
  ------------------
  |  Branch (227:15): [True: 6.09k, False: 1.84k]
  ------------------
  228|  6.09k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i].sample_peak_level,
  ------------------
  |  |   39|  6.09k|  {                                                         \
  |  |   40|  6.09k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  6.09k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.93k, False: 1.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  6.09k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  6.09k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 5.72k, False: 367]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  6.09k|  }
  ------------------
  229|  6.09k|                         MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  230|  6.09k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i].true_peak_level,
  ------------------
  |  |   39|  6.09k|  {                                                         \
  |  |   40|  6.09k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  6.09k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.93k, False: 1.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  6.09k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  6.09k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.66k, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  6.09k|  }
  ------------------
  231|  6.09k|                         MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  232|  6.09k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  6.09k|  {                                                         \
  |  |   40|  6.09k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  6.09k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.44k, False: 648]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  6.09k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  6.09k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 880, False: 5.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  6.09k|  }
  ------------------
  233|  6.09k|        pstr_enc_loudness_info_set->str_loudness_info_album[i].true_peak_level_measurement_system,
  234|  6.09k|        0, MAX_MEASUREMENT_SYSTEM_TYPE);
  235|  6.09k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  6.09k|  {                                                         \
  |  |   40|  6.09k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  6.09k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.29k, False: 793]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  6.09k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  6.09k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 895, False: 5.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  6.09k|  }
  ------------------
  236|  6.09k|        pstr_enc_loudness_info_set->str_loudness_info_album[i].true_peak_level_reliability, 0,
  237|  6.09k|        MAX_RELIABILITY_TYPE);
  238|  6.09k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i].measurement_count,
  ------------------
  |  |   39|  6.09k|  {                                                         \
  |  |   40|  6.09k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  6.09k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.30k, False: 781]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  6.09k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  6.09k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.58k, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  6.09k|  }
  ------------------
  239|  6.09k|                         0, MAX_MEASUREMENT_COUNT);
  240|  31.9k|    for (j = 0; j < pstr_enc_loudness_info_set->str_loudness_info_album[i].measurement_count;
  ------------------
  |  Branch (240:17): [True: 25.8k, False: 6.09k]
  ------------------
  241|  25.8k|         j++) {
  242|  25.8k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  25.8k|  {                                                         \
  |  |   40|  25.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  25.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 18.1k, False: 7.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  25.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  25.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 9.23k, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  25.8k|  }
  ------------------
  243|  25.8k|                               .str_loudness_measure[j]
  244|  25.8k|                               .method_definition,
  245|  25.8k|                           0, MAX_METHOD_DEFINITION_TYPE);
  246|  25.8k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  25.8k|  {                                                         \
  |  |   40|  25.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  25.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 12.6k, False: 13.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  25.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  25.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 13.2k, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  25.8k|  }
  ------------------
  247|  25.8k|                               .str_loudness_measure[j]
  248|  25.8k|                               .method_value,
  249|  25.8k|                           MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  250|  25.8k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  25.8k|  {                                                         \
  |  |   40|  25.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  25.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 16.7k, False: 9.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  25.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  25.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 10.8k, False: 15.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  25.8k|  }
  ------------------
  251|  25.8k|                               .str_loudness_measure[j]
  252|  25.8k|                               .measurement_system,
  253|  25.8k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  254|  25.8k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  25.8k|  {                                                         \
  |  |   40|  25.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  25.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 16.8k, False: 9.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  25.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  25.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 9.52k, False: 16.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  25.8k|  }
  ------------------
  255|  25.8k|                               .str_loudness_measure[j]
  256|  25.8k|                               .reliability,
  257|  25.8k|                           0, MAX_RELIABILITY_TYPE);
  258|  25.8k|    }
  259|  6.09k|  }
  260|       |
  261|  1.84k|  if (pstr_uni_drc_config->uni_drc_config_ext_present != 0 &&
  ------------------
  |  Branch (261:7): [True: 961, False: 887]
  ------------------
  262|    961|      pstr_uni_drc_config->uni_drc_config_ext_present != 1) {
  ------------------
  |  Branch (262:7): [True: 0, False: 961]
  ------------------
  263|      0|    pstr_uni_drc_config->uni_drc_config_ext_present = 0;
  264|      0|  }
  265|       |
  266|  1.84k|  if (pstr_uni_drc_config->uni_drc_config_ext_present &&
  ------------------
  |  Branch (266:7): [True: 961, False: 887]
  ------------------
  267|    961|      (pstr_uni_drc_config->drc_instructions_uni_drc_count > 0 ||
  ------------------
  |  Branch (267:8): [True: 67, False: 894]
  ------------------
  268|    894|       pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0)) {
  ------------------
  |  Branch (268:8): [True: 111, False: 783]
  ------------------
  269|    178|    memset(pstr_uni_drc_config->str_drc_instructions_uni_drc, 0,
  270|    178|           sizeof(pstr_uni_drc_config->str_drc_instructions_uni_drc[0]) *
  271|    178|               pstr_uni_drc_config->drc_instructions_uni_drc_count);
  272|    178|    memset(pstr_uni_drc_config->str_drc_coefficients_uni_drc, 0,
  273|    178|           sizeof(pstr_uni_drc_config->str_drc_coefficients_uni_drc[0]) *
  274|    178|               pstr_uni_drc_config->drc_coefficients_uni_drc_count);
  275|    178|    pstr_uni_drc_config->drc_instructions_uni_drc_count = 0;
  276|    178|    pstr_uni_drc_config->drc_coefficients_uni_drc_count = 0;
  277|    178|  }
  278|  1.84k|  if (pstr_uni_drc_config->uni_drc_config_ext_present) {
  ------------------
  |  Branch (278:7): [True: 961, False: 887]
  ------------------
  279|    961|    ia_drc_uni_drc_config_ext_struct *pstr_uni_drc_config_ext =
  280|    961|        &pstr_uni_drc_config->str_uni_drc_config_ext;
  281|    961|    if (pstr_uni_drc_config_ext->downmix_instructions_v1_present != 0 &&
  ------------------
  |  Branch (281:9): [True: 418, False: 543]
  ------------------
  282|    418|        pstr_uni_drc_config_ext->downmix_instructions_v1_present != 1) {
  ------------------
  |  Branch (282:9): [True: 0, False: 418]
  ------------------
  283|      0|      pstr_uni_drc_config_ext->downmix_instructions_v1_present = 0;
  284|      0|    }
  285|    961|    if (pstr_uni_drc_config_ext->downmix_instructions_v1_present) {
  ------------------
  |  Branch (285:9): [True: 418, False: 543]
  ------------------
  286|    418|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->downmix_instructions_v1_count, 0,
  ------------------
  |  |   39|    418|  {                                                         \
  |  |   40|    418|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    418|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 401, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    418|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    418|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 372, False: 46]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    418|  }
  ------------------
  287|    418|                           DOWNMIX_INSTRUCTIONS_COUNT_MAX);
  288|  1.89k|      for (i = 0; i < pstr_uni_drc_config_ext->downmix_instructions_v1_count; i++) {
  ------------------
  |  Branch (288:19): [True: 1.47k, False: 418]
  ------------------
  289|  1.47k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.40k, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 449, False: 1.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  290|  1.47k|            pstr_uni_drc_config_ext->str_downmix_instructions_v1[i].target_layout, 0,
  291|  1.47k|            MAX_TARGET_LAYOUT_COUNT);
  292|  1.47k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.06k, False: 409]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 475, False: 999]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  293|  1.47k|            pstr_uni_drc_config_ext->str_downmix_instructions_v1[i].target_ch_count, 0,
  294|  1.47k|            MAX_CHANNEL_COUNT);
  295|  1.47k|      }
  296|    418|    }
  297|       |
  298|    961|    if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present != 0 &&
  ------------------
  |  Branch (298:9): [True: 891, False: 70]
  ------------------
  299|    891|        pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present != 1) {
  ------------------
  |  Branch (299:9): [True: 0, False: 891]
  ------------------
  300|      0|      pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present = 0;
  301|      0|    }
  302|    961|    if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present) {
  ------------------
  |  Branch (302:9): [True: 891, False: 70]
  ------------------
  303|    891|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count, 0,
  ------------------
  |  |   39|    891|  {                                                         \
  |  |   40|    891|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    891|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 306, False: 585]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    891|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    891|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 820, False: 71]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    891|  }
  ------------------
  304|    891|                           DRC_COEFFICIENTS_UNIDRC_V1_COUNT_MAX);
  305|  1.71k|      for (i = 0; i < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (305:19): [True: 1.19k, False: 516]
  ------------------
  306|  1.19k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.19k|  {                                                         \
  |  |   40|  1.19k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.19k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.09k, False: 103]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.19k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.19k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.12k, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.19k|  }
  ------------------
  307|  1.19k|            pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i].gain_set_count, 0,
  308|  1.19k|            GAIN_SET_COUNT_MAX);
  309|  1.19k|        for (j = 0;
  310|  3.42k|             j < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i].gain_set_count;
  ------------------
  |  Branch (310:14): [True: 2.60k, False: 819]
  ------------------
  311|  2.60k|             j++) {
  312|  2.60k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  2.60k|  {                                                         \
  |  |   40|  2.60k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.60k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.62k, False: 982]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.60k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.60k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.03k, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.60k|  }
  ------------------
  313|  2.60k|                                   .str_gain_set_params[j]
  314|  2.60k|                                   .gain_coding_profile,
  315|  2.60k|                               0, MAX_GAIN_CODING_PROFILE);
  316|  2.60k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  2.60k|  {                                                         \
  |  |   40|  2.60k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.60k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.57k, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.60k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.60k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.91k, False: 691]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.60k|  }
  ------------------
  317|  2.60k|                                   .str_gain_set_params[j]
  318|  2.60k|                                   .band_count,
  319|  2.60k|                               0, MAX_BAND_COUNT);
  320|  6.63k|          for (k = 0; k < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  Branch (320:23): [True: 4.03k, False: 2.60k]
  ------------------
  321|  6.63k|                              .str_gain_set_params[j]
  322|  6.63k|                              .band_count;
  323|  4.03k|               k++) {
  324|  4.03k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  4.03k|  {                                                         \
  |  |   40|  4.03k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  4.03k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.96k, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  4.03k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  4.03k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.42k, False: 2.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  4.03k|  }
  ------------------
  325|  4.03k|                                     .str_gain_set_params[j]
  326|  4.03k|                                     .gain_params[k]
  327|  4.03k|                                     .nb_points,
  328|  4.03k|                                 0, MAX_GAIN_POINTS);
  329|  4.03k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  4.03k|  {                                                         \
  |  |   40|  4.03k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  4.03k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.02k, False: 1.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  4.03k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  4.03k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.17k, False: 2.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  4.03k|  }
  ------------------
  330|  4.03k|                                     .str_gain_set_params[j]
  331|  4.03k|                                     .gain_params[k]
  332|  4.03k|                                     .drc_characteristic,
  333|  4.03k|                                 0, MAX_DRC_CHARACTERISTIC_VALUE);
  334|  4.03k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  4.03k|  {                                                         \
  |  |   40|  4.03k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  4.03k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.75k, False: 1.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  4.03k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  4.03k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.36k, False: 2.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  4.03k|  }
  ------------------
  335|  4.03k|                                     .str_gain_set_params[j]
  336|  4.03k|                                     .gain_params[k]
  337|  4.03k|                                     .crossover_freq_index,
  338|  4.03k|                                 0, MAX_CROSSOVER_FREQ_INDEX);
  339|  4.03k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  4.03k|  {                                                         \
  |  |   40|  4.03k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  4.03k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.04k, False: 991]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  4.03k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  4.03k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.16k, False: 2.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  4.03k|  }
  ------------------
  340|  4.03k|                                     .str_gain_set_params[j]
  341|  4.03k|                                     .gain_params[k]
  342|  4.03k|                                     .start_sub_band_index,
  343|  4.03k|                                 0, STFT256_HOP_SIZE - 1);
  344|  4.03k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  4.03k|  {                                                         \
  |  |   40|  4.03k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  4.03k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.82k, False: 1.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  4.03k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  4.03k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.22k, False: 2.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  4.03k|  }
  ------------------
  345|  4.03k|                                     .str_gain_set_params[j]
  346|  4.03k|                                     .gain_params[k]
  347|  4.03k|                                     .width,
  348|  4.03k|                                 -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  349|   158k|            for (WORD32 m = 0; m < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  Branch (349:32): [True: 154k, False: 4.03k]
  ------------------
  350|   158k|                                       .str_gain_set_params[j]
  351|   158k|                                       .gain_params[k]
  352|   158k|                                       .nb_points;
  353|   154k|                 m++) {
  354|   154k|              IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|   154k|  {                                                         \
  |  |   40|   154k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   154k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 73.4k, False: 81.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   154k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   154k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 83.2k, False: 71.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   154k|  }
  ------------------
  355|   154k|                                       .str_gain_set_params[j]
  356|   154k|                                       .gain_params[k]
  357|   154k|                                       .gain_points[m]
  358|   154k|                                       .x,
  359|   154k|                                   -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  360|   154k|              IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|   154k|  {                                                         \
  |  |   40|   154k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   154k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 80.2k, False: 74.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   154k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   154k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 75.2k, False: 79.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   154k|  }
  ------------------
  361|   154k|                                       .str_gain_set_params[j]
  362|   154k|                                       .gain_params[k]
  363|   154k|                                       .gain_points[m]
  364|   154k|                                       .y,
  365|   154k|                                   -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  366|   154k|            }
  367|  4.03k|          }
  368|  3.18k|          for (k = 0; k < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  Branch (368:23): [True: 959, False: 2.22k]
  ------------------
  369|  3.18k|                                  .str_gain_set_params[j]
  370|  3.18k|                                  .band_count -
  371|  3.18k|                              1;
  372|  2.60k|               k++) {
  373|    959|            curr_start_subband_idx = pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  374|    959|                                         .str_gain_set_params[j]
  375|    959|                                         .gain_params[k]
  376|    959|                                         .start_sub_band_index;
  377|    959|            next_start_subband_idx = pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  378|    959|                                         .str_gain_set_params[j]
  379|    959|                                         .gain_params[k + 1]
  380|    959|                                         .start_sub_band_index;
  381|       |            /* It is assumed that the start index of a subband is greater than
  382|       |               the start index of its previous subbands for a multiband */
  383|    959|            if (next_start_subband_idx <= curr_start_subband_idx) {
  ------------------
  |  Branch (383:17): [True: 375, False: 584]
  ------------------
  384|    375|              return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_SUBBAND_INDEX;
  385|    375|            }
  386|    959|          }
  387|  2.60k|        }
  388|  1.19k|      }
  389|       |
  390|    516|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count, 0,
  ------------------
  |  |   39|    516|  {                                                         \
  |  |   40|    516|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    516|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 424, False: 92]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    516|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    516|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 320, False: 196]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    516|  }
  ------------------
  391|    516|                           DRC_INSTRUCTIONS_UNIDRC_V1_COUNT_MAX);
  392|  1.99k|      for (i = 0; i < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (392:19): [True: 1.47k, False: 516]
  ------------------
  393|  1.47k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.22k, False: 258]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 407, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  394|  1.47k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_set_id, 0,
  395|  1.47k|            MAX_DRC_SET_ID);
  396|  1.47k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.12k, False: 356]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 392, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  397|  1.47k|                                 .additional_downmix_id_count,
  398|  1.47k|                             0, MAX_ADDITIONAL_DOWNMIX_ID);
  399|  1.47k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.11k, False: 367]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 393, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  400|  1.47k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_location, 0,
  401|  1.47k|            MAX_DRC_LOCATION);
  402|  1.47k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.00k, False: 470]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 710, False: 769]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  403|  1.47k|                                 .drc_set_target_loudness_value_upper,
  404|  1.47k|                             MIN_DRC_TARGET_LOUDNESS, 0);
  405|  1.47k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.02k, False: 459]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 663, False: 816]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  406|  1.47k|                                 .drc_set_target_loudness_value_lower,
  407|  1.47k|                             MIN_DRC_TARGET_LOUDNESS, 0);
  408|  13.3k|        for (j = 0; j < MAX_CHANNEL_COUNT; j++) {
  ------------------
  |  |   25|  13.3k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (408:21): [True: 11.8k, False: 1.47k]
  ------------------
  409|  11.8k|          IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  11.8k|  {                                                         \
  |  |   40|  11.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  11.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.21k, False: 2.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  11.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  11.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.88k, False: 8.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  11.8k|  }
  ------------------
  410|  11.8k|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].gain_set_index[j], 0,
  411|  11.8k|              GAIN_SET_COUNT_MAX - 1);
  412|  11.8k|        }
  413|  1.47k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.39k, False: 80]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.07k, False: 406]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  414|  1.47k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].num_drc_channel_groups, 0,
  415|  1.47k|            MAX_CHANNEL_GROUP_COUNT);
  416|  1.47k|        for (j = 0;
  417|  4.24k|             j <
  ------------------
  |  Branch (417:14): [True: 2.76k, False: 1.47k]
  ------------------
  418|  4.24k|             pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].num_drc_channel_groups;
  419|  2.76k|             j++) {
  420|  2.76k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  2.76k|  {                                                         \
  |  |   40|  2.76k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.76k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.25k, False: 1.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.76k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.76k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.50k, False: 1.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.76k|  }
  ------------------
  421|  2.76k|                                   .str_gain_modifiers[j]
  422|  2.76k|                                   .attenuation_scaling[0],
  423|  2.76k|                               0, MAX_ATTENUATION_SCALING);
  424|  2.76k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  2.76k|  {                                                         \
  |  |   40|  2.76k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.76k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.28k, False: 1.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.76k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.76k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.47k, False: 1.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.76k|  }
  ------------------
  425|  2.76k|                                   .str_gain_modifiers[j]
  426|  2.76k|                                   .amplification_scaling[0],
  427|  2.76k|                               0, MAX_AMPLIFICATION_SCALING);
  428|  2.76k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  2.76k|  {                                                         \
  |  |   40|  2.76k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.76k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.30k, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.76k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.76k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.47k, False: 1.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.76k|  }
  ------------------
  429|  2.76k|                                   .str_gain_modifiers[j]
  430|  2.76k|                                   .gain_offset[0],
  431|  2.76k|                               MIN_DRC_GAIN_OFFSET, MAX_DRC_GAIN_OFFSET);
  432|  2.76k|        }
  433|  1.47k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.47k|  {                                                         \
  |  |   40|  1.47k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.47k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 998, False: 481]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.47k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.47k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 481, False: 998]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.47k|  }
  ------------------
  434|  1.47k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].limiter_peak_target,
  435|  1.47k|            MIN_LIMITER_PEAK_TARGET, 0.0f);
  436|  1.47k|#ifdef LOUDNESS_LEVELING_SUPPORT
  437|  1.47k|        if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_set_effect &
  ------------------
  |  Branch (437:13): [True: 620, False: 859]
  ------------------
  438|  1.47k|            EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.47k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  439|    620|          if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present != 0 &&
  ------------------
  |  Branch (439:15): [True: 290, False: 330]
  ------------------
  440|    290|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present != 1) {
  ------------------
  |  Branch (440:15): [True: 0, False: 290]
  ------------------
  441|      0|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present = 0;
  442|      0|          }
  443|    620|          if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (443:15): [True: 261, False: 359]
  ------------------
  444|    620|                      .ducking_only_set_present != 0 &&
  445|    261|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (445:15): [True: 0, False: 261]
  ------------------
  446|    261|                      .ducking_only_set_present != 1) {
  447|      0|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].ducking_only_set_present =
  448|      0|                0;
  449|      0|          }
  450|    620|        }
  451|  1.47k|#endif
  452|  1.47k|      }
  453|    516|    }
  454|    961|  }
  455|       |
  456|  1.47k|  if (pstr_enc_loudness_info_set->loudness_info_set_ext_present != 0 &&
  ------------------
  |  Branch (456:7): [True: 495, False: 978]
  ------------------
  457|    495|      pstr_enc_loudness_info_set->loudness_info_set_ext_present != 1) {
  ------------------
  |  Branch (457:7): [True: 0, False: 495]
  ------------------
  458|      0|    pstr_enc_loudness_info_set->loudness_info_set_ext_present = 0;
  459|      0|  }
  460|  1.47k|  if (pstr_enc_loudness_info_set->loudness_info_set_ext_present) {
  ------------------
  |  Branch (460:7): [True: 495, False: 978]
  ------------------
  461|    495|    ia_drc_loudness_info_set_ext_eq_struct *pstr_enc_loudness_info_set_ext =
  462|    495|        &pstr_enc_loudness_info_set->str_loudness_info_set_extension.str_loudness_info_set_ext_eq;
  463|    495|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->loudness_info_v1_count, 0,
  ------------------
  |  |   39|    495|  {                                                         \
  |  |   40|    495|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    495|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 479, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    495|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    495|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 169, False: 326]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    495|  }
  ------------------
  464|    495|                         MAX_LOUDNESS_INFO_COUNT);
  465|  3.93k|    for (i = 0; i < pstr_enc_loudness_info_set_ext->loudness_info_v1_count; i++) {
  ------------------
  |  Branch (465:17): [True: 3.44k, False: 495]
  ------------------
  466|  3.44k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.44k|  {                                                         \
  |  |   40|  3.44k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.44k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.27k, False: 1.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.44k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.44k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.24k, False: 195]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.44k|  }
  ------------------
  467|  3.44k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].sample_peak_level,
  468|  3.44k|          MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  469|  3.44k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.44k|  {                                                         \
  |  |   40|  3.44k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.44k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.28k, False: 1.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.44k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.44k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.01k, False: 430]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.44k|  }
  ------------------
  470|  3.44k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].true_peak_level,
  471|  3.44k|          MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  472|  3.44k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i]
  ------------------
  |  |   39|  3.44k|  {                                                         \
  |  |   40|  3.44k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.44k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.81k, False: 625]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.44k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.44k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 782, False: 2.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.44k|  }
  ------------------
  473|  3.44k|                               .true_peak_level_measurement_system,
  474|  3.44k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  475|  3.44k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.44k|  {                                                         \
  |  |   40|  3.44k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.44k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.71k, False: 727]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.44k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.44k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 781, False: 2.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.44k|  }
  ------------------
  476|  3.44k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].true_peak_level_reliability, 0,
  477|  3.44k|          MAX_RELIABILITY_TYPE);
  478|  3.44k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.44k|  {                                                         \
  |  |   40|  3.44k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.44k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.74k, False: 698]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.44k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.44k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.22k, False: 1.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.44k|  }
  ------------------
  479|  3.44k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].measurement_count, 0,
  480|  3.44k|          MAX_MEASUREMENT_COUNT);
  481|  22.7k|      for (j = 0; j < pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].measurement_count;
  ------------------
  |  Branch (481:19): [True: 19.2k, False: 3.44k]
  ------------------
  482|  19.2k|           j++) {
  483|  19.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i]
  ------------------
  |  |   39|  19.2k|  {                                                         \
  |  |   40|  19.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  19.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.6k, False: 8.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 10.1k, False: 9.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  19.2k|  }
  ------------------
  484|  19.2k|                                 .str_loudness_measure[j]
  485|  19.2k|                                 .method_definition,
  486|  19.2k|                             0, MAX_METHOD_DEFINITION_TYPE);
  487|  19.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i]
  ------------------
  |  |   39|  19.2k|  {                                                         \
  |  |   40|  19.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  19.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.16k, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.1k, False: 7.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  19.2k|  }
  ------------------
  488|  19.2k|                                 .str_loudness_measure[j]
  489|  19.2k|                                 .method_value,
  490|  19.2k|                             MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  491|  19.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i]
  ------------------
  |  |   39|  19.2k|  {                                                         \
  |  |   40|  19.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  19.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.2k, False: 9.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 10.4k, False: 8.85k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  19.2k|  }
  ------------------
  492|  19.2k|                                 .str_loudness_measure[j]
  493|  19.2k|                                 .measurement_system,
  494|  19.2k|                             0, MAX_MEASUREMENT_SYSTEM_TYPE);
  495|  19.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i]
  ------------------
  |  |   39|  19.2k|  {                                                         \
  |  |   40|  19.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  19.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.52k, False: 9.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 9.97k, False: 9.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  19.2k|  }
  ------------------
  496|  19.2k|                                 .str_loudness_measure[j]
  497|  19.2k|                                 .reliability,
  498|  19.2k|                             0, MAX_RELIABILITY_TYPE);
  499|  19.2k|      }
  500|  3.44k|    }
  501|       |
  502|    495|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->loudness_info_v1_album_count, 0,
  ------------------
  |  |   39|    495|  {                                                         \
  |  |   40|    495|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    495|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 464, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    495|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    495|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 250, False: 245]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    495|  }
  ------------------
  503|    495|                         MAX_LOUDNESS_INFO_COUNT);
  504|  5.61k|    for (i = 0; i < pstr_enc_loudness_info_set_ext->loudness_info_v1_album_count; i++) {
  ------------------
  |  Branch (504:17): [True: 5.12k, False: 495]
  ------------------
  505|  5.12k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.12k|  {                                                         \
  |  |   40|  5.12k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.12k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.60k, False: 1.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.12k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.12k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.79k, False: 331]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.12k|  }
  ------------------
  506|  5.12k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].sample_peak_level,
  507|  5.12k|          MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  508|  5.12k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.12k|  {                                                         \
  |  |   40|  5.12k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.12k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.57k, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.12k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.12k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.52k, False: 604]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.12k|  }
  ------------------
  509|  5.12k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].true_peak_level,
  510|  5.12k|          MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  511|  5.12k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  5.12k|  {                                                         \
  |  |   40|  5.12k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.12k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.23k, False: 886]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.12k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.12k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.13k, False: 3.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.12k|  }
  ------------------
  512|  5.12k|                               .true_peak_level_measurement_system,
  513|  5.12k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  514|  5.12k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  5.12k|  {                                                         \
  |  |   40|  5.12k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.12k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.03k, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.12k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.12k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.19k, False: 3.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.12k|  }
  ------------------
  515|  5.12k|                               .true_peak_level_reliability,
  516|  5.12k|                           0, MAX_RELIABILITY_TYPE);
  517|  5.12k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.12k|  {                                                         \
  |  |   40|  5.12k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.12k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.39k, False: 729]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.12k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.12k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.93k, False: 2.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.12k|  }
  ------------------
  518|  5.12k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].measurement_count, 0,
  519|  5.12k|          MAX_MEASUREMENT_COUNT);
  520|  5.12k|      for (j = 0;
  521|  28.7k|           j < pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].measurement_count;
  ------------------
  |  Branch (521:12): [True: 23.6k, False: 5.12k]
  ------------------
  522|  23.6k|           j++) {
  523|  23.6k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.6k|  {                                                         \
  |  |   40|  23.6k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 12.9k, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.6k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.1k, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.6k|  }
  ------------------
  524|  23.6k|                                 .str_loudness_measure[j]
  525|  23.6k|                                 .method_definition,
  526|  23.6k|                             0, MAX_METHOD_DEFINITION_TYPE);
  527|  23.6k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.6k|  {                                                         \
  |  |   40|  23.6k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.18k, False: 14.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.6k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 14.5k, False: 9.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.6k|  }
  ------------------
  528|  23.6k|                                 .str_loudness_measure[j]
  529|  23.6k|                                 .method_value,
  530|  23.6k|                             MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  531|  23.6k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.6k|  {                                                         \
  |  |   40|  23.6k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 12.5k, False: 11.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.6k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.5k, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.6k|  }
  ------------------
  532|  23.6k|                                 .str_loudness_measure[j]
  533|  23.6k|                                 .measurement_system,
  534|  23.6k|                             0, MAX_MEASUREMENT_SYSTEM_TYPE);
  535|  23.6k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.6k|  {                                                         \
  |  |   40|  23.6k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 11.4k, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.6k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.4k, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.6k|  }
  ------------------
  536|  23.6k|                                 .str_loudness_measure[j]
  537|  23.6k|                                 .reliability,
  538|  23.6k|                             0, MAX_RELIABILITY_TYPE);
  539|  23.6k|      }
  540|  5.12k|    }
  541|    495|  }
  542|       |
  543|  1.47k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  1.47k|#define IA_NO_ERROR 0x00000000
  ------------------
  544|  1.84k|}
impd_drc_enc_init:
  649|  1.44k|                               ia_drc_input_config *pstr_inp_config) {
  650|  1.44k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.44k|#define IA_NO_ERROR 0x00000000
  ------------------
  651|  1.44k|  WORD32 bit_count = 0;
  652|  1.44k|  ia_drc_enc_state *pstr_drc_state_local = pstr_drc_state;
  653|       |
  654|  1.44k|  pstr_drc_state_local->drc_scratch_mem = ptr_drc_scratch;
  655|  1.44k|  pstr_drc_state_local->drc_scratch_used = 0;
  656|       |
  657|  1.44k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg,
  658|  1.44k|                           pstr_drc_state_local->bit_buf_base_cfg,
  659|  1.44k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg), 1);
  660|       |
  661|  1.44k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_ext,
  662|  1.44k|                           pstr_drc_state_local->bit_buf_base_cfg_ext,
  663|  1.44k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg_ext), 1);
  664|       |
  665|  1.44k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_tmp,
  666|  1.44k|                           pstr_drc_state_local->bit_buf_base_cfg_tmp,
  667|  1.44k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg_tmp), 1);
  668|       |
  669|  1.44k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_out,
  670|  1.44k|                           pstr_drc_state_local->bit_buf_base_out,
  671|  1.44k|                           sizeof(pstr_drc_state_local->bit_buf_base_out), 1);
  672|       |
  673|  1.44k|  err_code = impd_drc_gain_enc_init(
  674|  1.44k|      &pstr_drc_state_local->str_gain_enc, &pstr_inp_config->str_uni_drc_config,
  675|  1.44k|      &pstr_inp_config->str_enc_loudness_info_set, pstr_inp_config->str_enc_params.frame_size,
  676|  1.44k|      pstr_inp_config->str_enc_params.sample_rate, pstr_inp_config->str_enc_params.delay_mode,
  677|  1.44k|      pstr_inp_config->str_enc_params.domain);
  678|  1.44k|  if (err_code) {
  ------------------
  |  Branch (678:7): [True: 82, False: 1.36k]
  ------------------
  679|     82|    return err_code;
  680|     82|  }
  681|       |
  682|  1.36k|  err_code = impd_drc_validate_drc_instructions(&pstr_inp_config->str_uni_drc_config);
  683|       |
  684|  1.36k|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.36k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (684:7): [True: 581, False: 780]
  ------------------
  685|    581|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  686|    581|  }
  687|       |
  688|    780|  pstr_drc_state_local->str_enc_params = pstr_inp_config->str_enc_params;
  689|    780|  pstr_drc_state_local->str_uni_drc_config = pstr_inp_config->str_uni_drc_config;
  690|    780|  pstr_drc_state_local->str_enc_gain_extension = pstr_inp_config->str_enc_gain_extension;
  691|    780|  pstr_drc_state_local->str_gain_enc.str_uni_drc_config = pstr_inp_config->str_uni_drc_config;
  692|       |
  693|    780|  pstr_drc_state_local->str_enc_params.gain_sequence_present = FALSE;
  ------------------
  |  |   26|    780|#define FALSE (0)
  ------------------
  694|    951|  for (WORD16 k = 0; k < pstr_drc_state_local->str_uni_drc_config.drc_coefficients_uni_drc_count;
  ------------------
  |  Branch (694:22): [True: 624, False: 327]
  ------------------
  695|    780|       k++) {
  696|    624|    if ((pstr_drc_state_local->str_uni_drc_config.str_drc_coefficients_uni_drc[k].drc_location ==
  ------------------
  |  Branch (696:9): [True: 508, False: 116]
  ------------------
  697|    624|         1) &&
  698|    508|        (pstr_drc_state_local->str_uni_drc_config.str_drc_coefficients_uni_drc[k].gain_set_count >
  ------------------
  |  Branch (698:9): [True: 453, False: 55]
  ------------------
  699|    508|         0)) {
  700|    453|      pstr_drc_state_local->str_enc_params.gain_sequence_present = TRUE;
  ------------------
  |  |   23|    453|#define TRUE (1)
  ------------------
  701|    453|      break;
  702|    453|    }
  703|    624|  }
  704|       |
  705|    780|  if (pstr_drc_state_local->str_enc_params.gain_sequence_present == FALSE) {
  ------------------
  |  |   26|    780|#define FALSE (0)
  ------------------
  |  Branch (705:7): [True: 327, False: 453]
  ------------------
  706|    579|    for (WORD16 k = 0; k < pstr_drc_state_local->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (706:24): [True: 513, False: 66]
  ------------------
  707|    579|                               .drc_coefficients_uni_drc_v1_count;
  708|    513|         k++) {
  709|    513|      if ((pstr_drc_state_local->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (709:11): [True: 288, False: 225]
  ------------------
  710|    513|               .str_drc_coefficients_uni_drc_v1[k]
  711|    513|               .drc_location == 1) &&
  712|    288|          (pstr_drc_state_local->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (712:11): [True: 261, False: 27]
  ------------------
  713|    288|               .str_drc_coefficients_uni_drc_v1[k]
  714|    288|               .gain_set_count > 0)) {
  715|    261|        pstr_drc_state_local->str_enc_params.gain_sequence_present = TRUE;
  ------------------
  |  |   23|    261|#define TRUE (1)
  ------------------
  716|    261|        break;
  717|    261|      }
  718|    513|    }
  719|    327|  }
  720|       |
  721|    780|  err_code = impd_drc_write_uni_drc_config(pstr_drc_state_local, &bit_count, 1);
  722|    780|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    780|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (722:7): [True: 119, False: 661]
  ------------------
  723|    119|    return err_code;
  724|    119|  }
  725|    661|  pstr_drc_state_local->drc_config_data_size_bit = bit_count;
  726|       |
  727|       |  // Loudness info set
  728|    661|  if (pstr_drc_state_local->str_gain_enc.str_uni_drc_config.loudness_info_set_present == 1) {
  ------------------
  |  Branch (728:7): [True: 511, False: 150]
  ------------------
  729|    511|    bit_count = 0;
  730|    511|    iusace_reset_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_ext);
  731|    511|    memset(pstr_drc_state_local->bit_buf_base_cfg_ext, 0,
  732|    511|           sizeof(MAX_DRC_PAYLOAD_BYTES * sizeof(pstr_drc_state_local->bit_buf_base_cfg_ext[0])));
  ------------------
  |  |   22|    511|#define MAX_DRC_PAYLOAD_BYTES (2048)
  ------------------
  733|    511|    err_code = impd_drc_write_loudness_info_set(
  734|    511|        pstr_drc_state, &pstr_drc_state_local->str_bit_buf_cfg_ext, &bit_count, 1);
  735|    511|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    511|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (735:9): [True: 6, False: 505]
  ------------------
  736|      6|      return (err_code);
  737|      6|    }
  738|    505|    pstr_drc_state_local->drc_config_ext_data_size_bit = bit_count;
  739|    505|  }
  740|       |
  741|    655|  return err_code;
  742|    661|}
impd_loudness_info_init:
  744|  2.72k|IA_ERRORCODE impd_loudness_info_init(VOID *pstr_drc_state, ia_drc_input_config *pstr_inp_config) {
  745|  2.72k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.72k|#define IA_NO_ERROR 0x00000000
  ------------------
  746|  2.72k|  ia_drc_enc_state *pstr_drc_state_local = pstr_drc_state;
  747|       |
  748|  2.72k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_ext,
  749|  2.72k|                           pstr_drc_state_local->bit_buf_base_cfg_ext,
  750|  2.72k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg_ext), 1);
  751|       |
  752|  2.72k|  memcpy(&pstr_drc_state_local->str_gain_enc.str_loudness_info_set,
  753|  2.72k|         &pstr_inp_config->str_enc_loudness_info_set, sizeof(ia_drc_loudness_info_set_struct));
  754|       |
  755|  2.72k|  err_code = impd_drc_write_measured_loudness_info(pstr_drc_state_local);
  756|  2.72k|  return err_code;
  757|  2.72k|}
impd_drc_enc:
  760|  75.6k|                          WORD32 *ptr_bits_written, VOID *pstr_scratch) {
  761|  75.6k|  LOOPIDX i, j, k;
  762|  75.6k|  WORD32 band_count = 0;
  763|  75.6k|  WORD32 stop_sub_band_index;
  764|  75.6k|  WORD32 num_bits_payload = 0;
  765|  75.6k|  UWORD8 is_fft_ready[MAX_NUM_CHANNELS] = {0};
  766|  75.6k|  ia_drc_enc_state *pstr_drc_state_local = pstr_drc_state;
  767|  75.6k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state_local->str_gain_enc;
  768|  75.6k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config = &pstr_drc_state_local->str_uni_drc_config;
  769|  75.6k|  ia_drc_compand_struct *pstr_drc_compand;
  770|  75.6k|  ia_drc_stft_gain_calc_struct *pstr_drc_stft_gain_calc;
  771|  75.6k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  75.6k|#define IA_NO_ERROR 0x00000000
  ------------------
  772|  75.6k|  ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc;
  773|       |
  774|  75.6k|  if (pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count > 0) {
  ------------------
  |  Branch (774:7): [True: 19.2k, False: 56.3k]
  ------------------
  775|  19.2k|    pstr_drc_coefficients_uni_drc =
  776|  19.2k|        &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0];
  777|  56.3k|  } else {
  778|  56.3k|    pstr_drc_coefficients_uni_drc = &pstr_uni_drc_config->str_drc_coefficients_uni_drc[0];
  779|  56.3k|  }
  780|       |
  781|  75.6k|  if (pstr_drc_state_local->str_enc_params.gain_sequence_present) {
  ------------------
  |  Branch (781:7): [True: 74.1k, False: 1.51k]
  ------------------
  782|   592k|    for (i = 0; i < MAX_DRC_COEFF_COUNT; i++) {
  ------------------
  |  |   30|   592k|#define MAX_DRC_COEFF_COUNT (7)
  ------------------
  |  Branch (782:17): [True: 518k, False: 74.1k]
  ------------------
  783|   668k|      for (j = 0; j < GAIN_SET_COUNT_MAX; j++) {
  ------------------
  |  |   49|   668k|#define GAIN_SET_COUNT_MAX 8                         /* reduced size */
  ------------------
  |  Branch (783:19): [True: 666k, False: 1.81k]
  ------------------
  784|   666k|        pstr_drc_stft_gain_calc = &pstr_gain_enc->str_drc_stft_gain_handle[i][j][0];
  785|   666k|        pstr_drc_compand = &pstr_gain_enc->str_drc_compand[i][j];
  786|   666k|        if ((pstr_drc_compand->is_valid == 0) && (pstr_drc_stft_gain_calc->is_valid == 0)) {
  ------------------
  |  Branch (786:13): [True: 539k, False: 127k]
  |  Branch (786:50): [True: 516k, False: 22.1k]
  ------------------
  787|   516k|          break;
  788|   516k|        }
  789|       |
  790|   150k|        if (pstr_drc_compand->is_valid == 0) {
  ------------------
  |  Branch (790:13): [True: 22.1k, False: 127k]
  ------------------
  791|  22.1k|          if (is_fft_ready[pstr_drc_stft_gain_calc->ch_idx] == 0) {
  ------------------
  |  Branch (791:15): [True: 19.8k, False: 2.31k]
  ------------------
  792|  19.8k|            impd_drc_stft_drc_convert_to_fd(
  793|  19.8k|                pstr_gain_enc, &pptr_input[pstr_drc_stft_gain_calc->ch_idx][inp_offset],
  794|  19.8k|                pstr_drc_stft_gain_calc->ch_idx, pstr_drc_state_local->str_enc_params.frame_size,
  795|  19.8k|                pstr_gain_enc->complex_fft_ptr[pstr_drc_stft_gain_calc->ch_idx], pstr_scratch);
  796|  19.8k|            is_fft_ready[pstr_drc_stft_gain_calc->ch_idx] = 1;
  797|  19.8k|          }
  798|       |
  799|  67.3k|          for (k = 0; k < pstr_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count;
  ------------------
  |  Branch (799:23): [True: 45.1k, False: 22.1k]
  ------------------
  800|  45.1k|               k++) {
  801|  45.1k|            if (k == pstr_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count - 1) {
  ------------------
  |  Branch (801:17): [True: 22.1k, False: 22.9k]
  ------------------
  802|  22.1k|              stop_sub_band_index = STFT256_HOP_SIZE - 1;
  ------------------
  |  |   39|  22.1k|#define STFT256_HOP_SIZE (256)
  ------------------
  803|  22.9k|            } else {
  804|  22.9k|              stop_sub_band_index = pstr_drc_coefficients_uni_drc[i]
  805|  22.9k|                                        .str_gain_set_params[j]
  806|  22.9k|                                        .gain_params[k + 1]
  807|  22.9k|                                        .start_sub_band_index -
  808|  22.9k|                                    1;
  809|  22.9k|            }
  810|       |
  811|  45.1k|            impd_drc_stft_drc_gain_calc_process(
  812|  45.1k|                pstr_gain_enc, i, j, k,
  813|  45.1k|                pstr_drc_coefficients_uni_drc[i]
  814|  45.1k|                    .str_gain_set_params[j]
  815|  45.1k|                    .gain_params[k]
  816|  45.1k|                    .start_sub_band_index,
  817|  45.1k|                stop_sub_band_index, pstr_drc_state_local->str_enc_params.frame_size,
  818|  45.1k|                pstr_gain_enc->complex_fft_ptr[pstr_drc_stft_gain_calc->ch_idx],
  819|  45.1k|                pstr_drc_state_local->gain_buffer[band_count + k]);
  820|  45.1k|          }
  821|   127k|        } else {
  822|   127k|          impd_drc_td_drc_gain_calc_process(pstr_gain_enc, i, j,
  823|   127k|                                            pstr_drc_state_local->str_enc_params.frame_size,
  824|   127k|                                            &pptr_input[pstr_drc_compand->ch_idx][inp_offset],
  825|   127k|                                            pstr_drc_state_local->gain_buffer[band_count]);
  826|   127k|        }
  827|       |
  828|   150k|        band_count += pstr_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count;
  829|   150k|      }
  830|   518k|    }
  831|  74.1k|  }
  832|  75.6k|  err_code = impd_drc_encode_uni_drc_gain(pstr_gain_enc, pstr_drc_state_local->gain_buffer[0],
  833|  75.6k|                                          pstr_scratch);
  834|  75.6k|  if (err_code) {
  ------------------
  |  Branch (834:7): [True: 0, False: 75.6k]
  ------------------
  835|      0|    return err_code;
  836|      0|  }
  837|       |
  838|  75.6k|  if (pstr_drc_state_local->is_first_drc_process_complete == 1) {
  ------------------
  |  Branch (838:7): [True: 75.0k, False: 601]
  ------------------
  839|  75.0k|    impd_drc_write_uni_drc_gain(pstr_drc_state_local, &num_bits_payload);
  840|  75.0k|  }
  841|       |
  842|  75.6k|  *ptr_bits_written = num_bits_payload;
  843|  75.6k|  return err_code;
  844|  75.6k|}
impd_drc_api.c:impd_drc_validate_drc_instructions:
  547|  1.36k|    ia_drc_uni_drc_config_struct *pstr_uni_drc_config) {
  548|  1.36k|  LOOPIDX i, j;
  549|  1.36k|  WORD32 profile_found = FALSE;
  ------------------
  |  |   26|  1.36k|#define FALSE (0)
  ------------------
  550|       |
  551|  1.81k|  for (j = 0; j < pstr_uni_drc_config->drc_coefficients_uni_drc_count; j++) {
  ------------------
  |  Branch (551:15): [True: 942, False: 868]
  ------------------
  552|    942|    if (pstr_uni_drc_config->str_drc_coefficients_uni_drc[j].drc_location == 1) {
  ------------------
  |  Branch (552:9): [True: 493, False: 449]
  ------------------
  553|    493|      profile_found = TRUE;
  ------------------
  |  |   23|    493|#define TRUE (1)
  ------------------
  554|    493|      break;
  555|    493|    }
  556|    942|  }
  557|  1.36k|  if (pstr_uni_drc_config->uni_drc_config_ext_present &&
  ------------------
  |  Branch (557:7): [True: 538, False: 823]
  ------------------
  558|    538|      pstr_uni_drc_config->str_uni_drc_config_ext.parametric_drc_present &&
  ------------------
  |  Branch (558:7): [True: 0, False: 538]
  ------------------
  559|      0|      pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coeff_parametric_drc.drc_location ==
  ------------------
  |  Branch (559:7): [True: 0, False: 0]
  ------------------
  560|      0|          1) {
  561|      0|    profile_found = TRUE;
  ------------------
  |  |   23|      0|#define TRUE (1)
  ------------------
  562|      0|  }
  563|  1.36k|  if ((pstr_uni_drc_config->uni_drc_config_ext_present == 0) && profile_found == FALSE) {
  ------------------
  |  |   26|    823|#define FALSE (0)
  ------------------
  |  Branch (563:7): [True: 823, False: 538]
  |  Branch (563:65): [True: 330, False: 493]
  ------------------
  564|    330|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  565|    330|  }
  566|  1.03k|#ifdef LOUDNESS_LEVELING_SUPPORT
  567|  1.54k|  for (i = 0; i < pstr_uni_drc_config->drc_instructions_uni_drc_count; i++) {
  ------------------
  |  Branch (567:15): [True: 514, False: 1.03k]
  ------------------
  568|    514|    if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_effect &
  ------------------
  |  Branch (568:9): [True: 302, False: 212]
  ------------------
  569|    514|        EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|    514|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  570|    302|      if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present &&
  ------------------
  |  Branch (570:11): [True: 120, False: 182]
  ------------------
  571|    120|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present) {
  ------------------
  |  Branch (571:11): [True: 97, False: 23]
  ------------------
  572|     97|        if (i < pstr_uni_drc_config->drc_instructions_uni_drc_count - 1) {
  ------------------
  |  Branch (572:13): [True: 91, False: 6]
  ------------------
  573|     91|          if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].drc_set_effect !=
  ------------------
  |  Branch (573:15): [True: 91, False: 0]
  ------------------
  574|     91|                  EFFECT_BIT_DUCK_SELF &&
  ------------------
  |  |   38|    182|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  575|     91|              pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].drc_set_effect !=
  ------------------
  |  Branch (575:15): [True: 91, False: 0]
  ------------------
  576|     91|                  EFFECT_BIT_DUCK_OTHER) {
  ------------------
  |  |   37|     91|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
  577|     91|            pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].drc_set_effect =
  578|     91|                EFFECT_BIT_DUCK_SELF;
  ------------------
  |  |   38|     91|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  579|     91|          }
  580|     91|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].leveling_present = 0;
  581|     91|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].ducking_only_set_present = 0;
  582|     91|        } else {
  583|      6|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present = 0;
  584|      6|        }
  585|    205|      } else if (!pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present &&
  ------------------
  |  Branch (585:18): [True: 182, False: 23]
  ------------------
  586|    182|                 pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present) {
  ------------------
  |  Branch (586:18): [True: 28, False: 154]
  ------------------
  587|     28|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present = 0;
  588|     28|      }
  589|    302|    }
  590|    514|  }
  591|  1.03k|#endif
  592|       |
  593|  1.03k|  if (pstr_uni_drc_config->uni_drc_config_ext_present) {
  ------------------
  |  Branch (593:7): [True: 538, False: 493]
  ------------------
  594|    538|    ia_drc_uni_drc_config_ext_struct *pstr_uni_drc_config_ext =
  595|    538|        &pstr_uni_drc_config->str_uni_drc_config_ext;
  596|    538|    profile_found = FALSE;
  ------------------
  |  |   26|    538|#define FALSE (0)
  ------------------
  597|    909|    for (j = 0; j < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; j++) {
  ------------------
  |  Branch (597:17): [True: 658, False: 251]
  ------------------
  598|    658|      if (pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[j].drc_location == 1) {
  ------------------
  |  Branch (598:11): [True: 287, False: 371]
  ------------------
  599|    287|        profile_found = TRUE;
  ------------------
  |  |   23|    287|#define TRUE (1)
  ------------------
  600|    287|        break;
  601|    287|      }
  602|    658|    }
  603|    538|    if (pstr_uni_drc_config->str_uni_drc_config_ext.parametric_drc_present &&
  ------------------
  |  Branch (603:9): [True: 0, False: 538]
  ------------------
  604|      0|        pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coeff_parametric_drc.drc_location ==
  ------------------
  |  Branch (604:9): [True: 0, False: 0]
  ------------------
  605|      0|            1) {
  606|      0|      profile_found = TRUE;
  ------------------
  |  |   23|      0|#define TRUE (1)
  ------------------
  607|      0|    }
  608|    538|    if (profile_found == FALSE) {
  ------------------
  |  |   26|    538|#define FALSE (0)
  ------------------
  |  Branch (608:9): [True: 251, False: 287]
  ------------------
  609|    251|      return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  610|    251|    }
  611|    287|#ifdef LOUDNESS_LEVELING_SUPPORT
  612|  1.07k|    for (i = 0; i < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (612:17): [True: 783, False: 287]
  ------------------
  613|    783|      if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_set_effect &
  ------------------
  |  Branch (613:11): [True: 464, False: 319]
  ------------------
  614|    783|          EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|    783|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  615|    464|        if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present &&
  ------------------
  |  Branch (615:13): [True: 167, False: 297]
  ------------------
  616|    167|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (616:13): [True: 111, False: 56]
  ------------------
  617|    167|                .ducking_only_set_present) {
  618|    111|          if (i < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count - 1) {
  ------------------
  |  Branch (618:15): [True: 101, False: 10]
  ------------------
  619|    101|            if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i + 1].drc_set_effect !=
  ------------------
  |  Branch (619:17): [True: 95, False: 6]
  ------------------
  620|    101|                    EFFECT_BIT_DUCK_SELF &&
  ------------------
  |  |   38|    202|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  621|     95|                pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i + 1].drc_set_effect !=
  ------------------
  |  Branch (621:17): [True: 92, False: 3]
  ------------------
  622|     95|                    EFFECT_BIT_DUCK_OTHER) {
  ------------------
  |  |   37|     95|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
  623|     92|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i + 1].drc_set_effect =
  624|     92|                  EFFECT_BIT_DUCK_SELF;
  ------------------
  |  |   38|     92|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  625|     92|            }
  626|    101|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i + 1].leveling_present = 0;
  627|    101|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i + 1]
  628|    101|                .ducking_only_set_present = 0;
  629|    101|          } else {
  630|     10|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].ducking_only_set_present =
  631|     10|                0;
  632|     10|          }
  633|    353|        } else if (!pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (633:20): [True: 297, False: 56]
  ------------------
  634|    353|                        .leveling_present &&
  635|    297|                   pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (635:20): [True: 34, False: 263]
  ------------------
  636|    297|                       .ducking_only_set_present) {
  637|     34|          pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].ducking_only_set_present =
  638|     34|              0;
  639|     34|        }
  640|    464|      }
  641|    783|    }
  642|    287|#endif
  643|    287|  }
  644|       |
  645|    780|  return IA_NO_ERROR;
  ------------------
  |  |   23|    780|#define IA_NO_ERROR 0x00000000
  ------------------
  646|  1.03k|}

impd_drc_gain_enc_init:
   85|  1.44k|                                    const WORD32 delay_mode, const WORD32 domain) {
   86|  1.44k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.44k|#define IA_NO_ERROR 0x00000000
  ------------------
   87|  1.44k|  LOOPIDX i, j, k, l, m, ch;
   88|  1.44k|  WORD32 num_gain_values_max;
   89|  1.44k|  UWORD8 found_ch_idx;
   90|  1.44k|  UWORD32 ch_idx;
   91|       |
   92|  1.44k|  ia_drc_uni_drc_config_ext_struct *pstr_uni_drc_config_ext =
   93|  1.44k|      &pstr_uni_drc_config->str_uni_drc_config_ext;
   94|  1.44k|  ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc =
   95|  1.44k|      &pstr_uni_drc_config->str_drc_coefficients_uni_drc[0];
   96|  1.44k|  ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc_v1 =
   97|  1.44k|      &pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[0];
   98|       |
   99|  1.44k|  if (pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count <= 0) {
  ------------------
  |  Branch (99:7): [True: 1.00k, False: 443]
  ------------------
  100|  1.00k|    WORD32 all_band_gain_count = 0;
  101|  1.00k|    WORD32 gain_set_count = pstr_drc_coefficients_uni_drc->gain_set_count;
  102|  3.26k|    for (i = 0; i < gain_set_count; i++) {
  ------------------
  |  Branch (102:17): [True: 2.26k, False: 1.00k]
  ------------------
  103|  2.26k|      all_band_gain_count += pstr_drc_coefficients_uni_drc->str_gain_set_params[i].band_count;
  104|  2.26k|    }
  105|  1.00k|    pstr_gain_enc->n_sequences = all_band_gain_count;
  106|  1.00k|  } else {
  107|  1.19k|    for (i = 0; i < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (107:17): [True: 749, False: 443]
  ------------------
  108|    749|      WORD32 all_band_gain_count = 0;
  109|  2.50k|      for (j = 0; j < pstr_drc_coefficients_uni_drc_v1[i].gain_set_count; j++) {
  ------------------
  |  Branch (109:19): [True: 1.75k, False: 749]
  ------------------
  110|  1.75k|        all_band_gain_count +=
  111|  1.75k|            pstr_drc_coefficients_uni_drc_v1[i].str_gain_set_params[j].band_count;
  112|  1.75k|      }
  113|    749|      pstr_drc_coefficients_uni_drc_v1[i].gain_sequence_count = all_band_gain_count;
  114|    749|      pstr_gain_enc->n_sequences += all_band_gain_count;
  115|    749|    }
  116|    443|  }
  117|       |
  118|  1.44k|  if (pstr_gain_enc->n_sequences > IMPD_DRCMAX_NSEQ) {
  ------------------
  |  |   42|  1.44k|#define IMPD_DRCMAX_NSEQ (40)
  ------------------
  |  Branch (118:7): [True: 0, False: 1.44k]
  ------------------
  119|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  120|      0|  }
  121|       |
  122|  1.44k|  if ((pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count > 0) &&
  ------------------
  |  Branch (122:7): [True: 443, False: 1.00k]
  ------------------
  123|    443|      (pstr_drc_coefficients_uni_drc_v1->drc_frame_size_present)) {
  ------------------
  |  Branch (123:7): [True: 0, False: 443]
  ------------------
  124|      0|    pstr_gain_enc->drc_frame_size = pstr_drc_coefficients_uni_drc_v1->drc_frame_size;
  125|  1.44k|  } else if ((pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) &&
  ------------------
  |  Branch (125:14): [True: 613, False: 830]
  ------------------
  126|    613|             (pstr_drc_coefficients_uni_drc->drc_frame_size_present)) {
  ------------------
  |  Branch (126:14): [True: 99, False: 514]
  ------------------
  127|     99|    pstr_gain_enc->drc_frame_size = pstr_drc_coefficients_uni_drc->drc_frame_size;
  128|  1.34k|  } else {
  129|  1.34k|    pstr_gain_enc->drc_frame_size = frame_size;
  130|  1.34k|  }
  131|       |
  132|  1.44k|  if (pstr_gain_enc->drc_frame_size > IMPD_DRCMAX_FRAMESIZE) {
  ------------------
  |  |   43|  1.44k|#define IMPD_DRCMAX_FRAMESIZE (4096)
  ------------------
  |  Branch (132:7): [True: 0, False: 1.44k]
  ------------------
  133|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  134|      0|  }
  135|  1.44k|  if (pstr_gain_enc->drc_frame_size < 1) {
  ------------------
  |  Branch (135:7): [True: 0, False: 1.44k]
  ------------------
  136|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  137|      0|  }
  138|       |
  139|  1.44k|  if (!pstr_uni_drc_config->sample_rate_present) {
  ------------------
  |  Branch (139:7): [True: 313, False: 1.13k]
  ------------------
  140|    313|    pstr_gain_enc->sample_rate = sample_rate;
  141|  1.13k|  } else {
  142|  1.13k|    pstr_gain_enc->sample_rate = pstr_uni_drc_config->sample_rate;
  143|  1.13k|  }
  144|       |
  145|  1.44k|  pstr_gain_enc->domain = domain;
  146|  1.44k|  pstr_gain_enc->delay_mode = delay_mode;
  147|  1.44k|  pstr_gain_enc->delta_tmin_default = impd_drc_get_delta_t_min(pstr_gain_enc->sample_rate);
  148|       |
  149|  1.44k|  if ((pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count > 0) &&
  ------------------
  |  Branch (149:7): [True: 443, False: 1.00k]
  ------------------
  150|    443|      (pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[0].time_delta_min_present == 1)) {
  ------------------
  |  Branch (150:7): [True: 312, False: 131]
  ------------------
  151|    312|    pstr_gain_enc->delta_tmin =
  152|    312|        pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[0].delta_tmin;
  153|  1.13k|  } else if ((pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) &&
  ------------------
  |  Branch (153:14): [True: 613, False: 518]
  ------------------
  154|    613|             (pstr_drc_coefficients_uni_drc->str_gain_set_params[0].time_delta_min_present ==
  ------------------
  |  Branch (154:14): [True: 458, False: 155]
  ------------------
  155|    613|              1)) {
  156|    458|    pstr_gain_enc->delta_tmin = pstr_drc_coefficients_uni_drc->str_gain_set_params[0].delta_tmin;
  157|    673|  } else {
  158|    673|    pstr_gain_enc->delta_tmin = impd_drc_get_delta_t_min(pstr_gain_enc->sample_rate);
  159|    673|  }
  160|       |
  161|  1.44k|  num_gain_values_max = pstr_gain_enc->drc_frame_size / pstr_gain_enc->delta_tmin;
  162|  1.44k|  pstr_gain_enc->base_ch_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
  163|       |
  164|  1.44k|  memcpy(&pstr_gain_enc->str_uni_drc_config, pstr_uni_drc_config,
  165|  1.44k|         sizeof(ia_drc_uni_drc_config_struct));
  166|  1.44k|  memcpy(&pstr_gain_enc->str_loudness_info_set, pstr_loudness_info_set,
  167|  1.44k|         sizeof(ia_drc_loudness_info_set_struct));
  168|       |
  169|  1.44k|  k = 0;
  170|  1.44k|  if (pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) {
  ------------------
  |  Branch (170:7): [True: 613, False: 830]
  ------------------
  171|  2.77k|    for (j = 0; j < pstr_drc_coefficients_uni_drc->gain_set_count; j++) {
  ------------------
  |  Branch (171:17): [True: 2.20k, False: 572]
  ------------------
  172|  2.20k|      ch_idx = 0;
  173|  2.20k|      found_ch_idx = 0;
  174|  2.20k|      ia_drc_gain_set_params_struct *pstr_gain_set_params =
  175|  2.20k|          &pstr_drc_coefficients_uni_drc->str_gain_set_params[j];
  176|       |
  177|  3.62k|      for (m = 0; m < pstr_uni_drc_config->drc_instructions_uni_drc_count; m++) {
  ------------------
  |  Branch (177:19): [True: 1.47k, False: 2.15k]
  ------------------
  178|  1.47k|        if (pstr_uni_drc_config->str_drc_instructions_uni_drc[m].drc_location ==
  ------------------
  |  Branch (178:13): [True: 469, False: 1.00k]
  ------------------
  179|  1.47k|            pstr_drc_coefficients_uni_drc->drc_location) {
  180|  3.86k|          for (ch = 0; ch < MAX_CHANNEL_COUNT; ch++) {
  ------------------
  |  |   25|  3.86k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (180:24): [True: 3.44k, False: 420]
  ------------------
  181|  3.44k|            if (pstr_uni_drc_config->str_drc_instructions_uni_drc[m].gain_set_index[ch] == j) {
  ------------------
  |  Branch (181:17): [True: 49, False: 3.39k]
  ------------------
  182|     49|              ch_idx = ch;
  183|     49|              found_ch_idx = 1;
  184|     49|              break;
  185|     49|            }
  186|  3.44k|          }
  187|    469|        }
  188|  1.47k|        if (found_ch_idx) {
  ------------------
  |  Branch (188:13): [True: 49, False: 1.42k]
  ------------------
  189|     49|          break;
  190|     49|        }
  191|  1.47k|      }
  192|  2.20k|      if (ch_idx >= (UWORD32)pstr_gain_enc->base_ch_count) {
  ------------------
  |  Branch (192:11): [True: 9, False: 2.19k]
  ------------------
  193|      9|        return IA_EXHEAACE_INIT_FATAL_DRC_INVALID_CHANNEL_INDEX;
  194|      9|      }
  195|  2.19k|      if (pstr_gain_set_params->band_count > 1) {
  ------------------
  |  Branch (195:11): [True: 141, False: 2.05k]
  ------------------
  196|    141|        impd_drc_util_stft_read_gain_config(pstr_gain_enc->str_drc_stft_gain_handle[0][j],
  197|    141|                                            pstr_gain_set_params->band_count,
  198|    141|                                            pstr_gain_set_params);
  199|       |
  200|    444|        for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (200:21): [True: 319, False: 125]
  ------------------
  201|    319|          err_code = impd_drc_stft_drc_gain_calc_init(pstr_gain_enc, 0, j, l);
  202|    319|          if (err_code) {
  ------------------
  |  Branch (202:15): [True: 16, False: 303]
  ------------------
  203|     16|            return err_code;
  204|     16|          }
  205|    303|          pstr_gain_enc->str_drc_stft_gain_handle[0][j][l].ch_idx = ch_idx;
  206|    303|          pstr_gain_enc->str_drc_stft_gain_handle[0][j][l].is_valid = 1;
  207|    303|        }
  208|  2.05k|      } else if (pstr_gain_set_params->band_count == 1) {
  ------------------
  |  Branch (208:18): [True: 918, False: 1.13k]
  ------------------
  209|    918|        impd_drc_util_td_read_gain_config(&pstr_gain_enc->str_drc_compand[0][j],
  210|    918|                                          pstr_gain_set_params);
  211|       |
  212|    918|        pstr_gain_enc->str_drc_compand[0][j].initial_volume = 0.0f;
  213|       |
  214|    918|        err_code = impd_drc_td_drc_gain_calc_init(pstr_gain_enc, 0, j);
  215|    918|        if (err_code) {
  ------------------
  |  Branch (215:13): [True: 16, False: 902]
  ------------------
  216|     16|          return err_code;
  217|     16|        }
  218|    902|        pstr_gain_enc->str_drc_compand[0][j].ch_idx = ch_idx;
  219|    902|        pstr_gain_enc->str_drc_compand[0][j].is_valid = 1;
  220|    902|      }
  221|       |
  222|  3.35k|      for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (222:19): [True: 1.19k, False: 2.15k]
  ------------------
  223|  1.19k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_drc_group.n_gain_values = 1;
  224|  1.19k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_gain_set_params =
  225|  1.19k|            pstr_drc_coefficients_uni_drc->str_gain_set_params[j];
  226|  1.19k|        k++;
  227|  1.19k|      }
  228|  2.15k|    }
  229|    613|  }
  230|  1.40k|  k = 0;
  231|  2.09k|  for (i = 0; i < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (231:15): [True: 733, False: 1.36k]
  ------------------
  232|    733|    pstr_drc_coefficients_uni_drc_v1 =
  233|    733|        &pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i];
  234|  2.37k|    for (j = 0; j < pstr_drc_coefficients_uni_drc_v1->gain_set_count; j++) {
  ------------------
  |  Branch (234:17): [True: 1.67k, False: 692]
  ------------------
  235|  1.67k|      ch_idx = 0;
  236|  1.67k|      found_ch_idx = 0;
  237|  1.67k|      ia_drc_gain_set_params_struct *pstr_gain_set_params =
  238|  1.67k|          &pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[j];
  239|       |
  240|  5.54k|      for (m = 0; m < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; m++) {
  ------------------
  |  Branch (240:19): [True: 3.90k, False: 1.63k]
  ------------------
  241|  3.90k|        if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[m].drc_location ==
  ------------------
  |  Branch (241:13): [True: 162, False: 3.74k]
  ------------------
  242|  3.90k|            pstr_drc_coefficients_uni_drc_v1->drc_location) {
  243|  1.18k|          for (ch = 0; ch < MAX_CHANNEL_COUNT; ch++) {
  ------------------
  |  |   25|  1.18k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (243:24): [True: 1.06k, False: 121]
  ------------------
  244|  1.06k|            if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[m].gain_set_index[ch] ==
  ------------------
  |  Branch (244:17): [True: 41, False: 1.02k]
  ------------------
  245|  1.06k|                j) {
  246|     41|              ch_idx = ch;
  247|     41|              found_ch_idx = 1;
  248|     41|              break;
  249|     41|            }
  250|  1.06k|          }
  251|    162|        }
  252|  3.90k|        if (found_ch_idx) {
  ------------------
  |  Branch (252:13): [True: 41, False: 3.86k]
  ------------------
  253|     41|          break;
  254|     41|        }
  255|  3.90k|      }
  256|       |
  257|  1.67k|      if (ch_idx >= (UWORD32)pstr_gain_enc->base_ch_count) {
  ------------------
  |  Branch (257:11): [True: 13, False: 1.66k]
  ------------------
  258|     13|        return IA_EXHEAACE_INIT_FATAL_DRC_INVALID_CHANNEL_INDEX;
  259|     13|      }
  260|       |
  261|  1.66k|      if (pstr_gain_set_params->band_count > 1) {
  ------------------
  |  Branch (261:11): [True: 334, False: 1.33k]
  ------------------
  262|    334|        impd_drc_util_stft_read_gain_config(pstr_gain_enc->str_drc_stft_gain_handle[i][j],
  263|    334|                                            pstr_gain_set_params->band_count,
  264|    334|                                            pstr_gain_set_params);
  265|       |
  266|  1.01k|        for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (266:21): [True: 695, False: 324]
  ------------------
  267|    695|          err_code = impd_drc_stft_drc_gain_calc_init(pstr_gain_enc, i, j, l);
  268|    695|          if (err_code) {
  ------------------
  |  Branch (268:15): [True: 10, False: 685]
  ------------------
  269|     10|            return err_code;
  270|     10|          }
  271|    685|          pstr_gain_enc->str_drc_stft_gain_handle[i][j][l].ch_idx = ch_idx;
  272|    685|          pstr_gain_enc->str_drc_stft_gain_handle[i][j][l].is_valid = 1;
  273|    685|        }
  274|  1.33k|      } else if (pstr_gain_set_params->band_count == 1) {
  ------------------
  |  Branch (274:18): [True: 851, False: 480]
  ------------------
  275|    851|        impd_drc_util_td_read_gain_config(&pstr_gain_enc->str_drc_compand[i][j],
  276|    851|                                          pstr_gain_set_params);
  277|       |
  278|    851|        pstr_gain_enc->str_drc_compand[i][j].initial_volume = 0.0f;
  279|       |
  280|    851|        err_code = impd_drc_td_drc_gain_calc_init(pstr_gain_enc, i, j);
  281|    851|        if (err_code) {
  ------------------
  |  Branch (281:13): [True: 18, False: 833]
  ------------------
  282|     18|          return err_code;
  283|     18|        }
  284|    833|        pstr_gain_enc->str_drc_compand[i][j].ch_idx = ch_idx;
  285|    833|        pstr_gain_enc->str_drc_compand[i][j].is_valid = 1;
  286|    833|      }
  287|       |
  288|  3.14k|      for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (288:19): [True: 1.51k, False: 1.63k]
  ------------------
  289|  1.51k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_drc_group.n_gain_values = 1;
  290|  1.51k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_gain_set_params =
  291|  1.51k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[j];
  292|  1.51k|        k++;
  293|  1.51k|      }
  294|  1.63k|    }
  295|    733|  }
  296|       |
  297|  1.36k|  impd_drc_generate_delta_time_code_table(num_gain_values_max,
  298|  1.36k|                                          pstr_gain_enc->str_delta_time_code_table);
  299|       |
  300|  97.1k|  for (i = num_gain_values_max - 1; i >= 0; i--) {
  ------------------
  |  Branch (300:37): [True: 95.8k, False: 1.36k]
  ------------------
  301|  95.8k|    pstr_gain_enc->delta_time_quant_table[i] = pstr_gain_enc->delta_tmin * (i + 1);
  302|  95.8k|  }
  303|       |
  304|  1.36k|  return err_code;
  305|  1.40k|}
impd_drc_encode_uni_drc_gain:
  308|  75.6k|                                          FLOAT32 *ptr_gain_buffer, VOID *pstr_scratch) {
  309|  75.6k|  LOOPIDX idx;
  310|  75.6k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  75.6k|#define IA_NO_ERROR 0x00000000
  ------------------
  311|   253k|  for (idx = 0; idx < pstr_gain_enc->n_sequences; idx++) {
  ------------------
  |  Branch (311:17): [True: 178k, False: 75.6k]
  ------------------
  312|   178k|    err_code = impd_drc_quantize_and_encode_drc_gain(
  313|   178k|        pstr_gain_enc, &ptr_gain_buffer[idx * MAX_DRC_FRAME_SIZE],
  ------------------
  |  |   23|   178k|#define MAX_DRC_FRAME_SIZE (4096)
  ------------------
  314|   178k|        &(pstr_gain_enc->drc_gain_per_sample_with_prev_frame[idx][0]),
  315|   178k|        pstr_gain_enc->str_delta_time_code_table, &(pstr_gain_enc->str_drc_gain_seq_buf[idx]),
  316|   178k|        pstr_scratch);
  317|       |
  318|   178k|    if (err_code) {
  ------------------
  |  Branch (318:9): [True: 0, False: 178k]
  ------------------
  319|      0|      return err_code;
  320|      0|    }
  321|   178k|  }
  322|  75.6k|  return err_code;
  323|  75.6k|}
impd_drc_get_delta_t_min:
  325|  6.67k|WORD32 impd_drc_get_delta_t_min(const WORD32 sample_rate) {
  326|  6.67k|  WORD32 lower_bound;
  327|  6.67k|  WORD32 result = 1;
  328|  6.67k|  WORD32 sample_rate_local = sample_rate;
  329|       |
  330|  6.67k|  if (sample_rate_local < 1000) {
  ------------------
  |  Branch (330:7): [True: 0, False: 6.67k]
  ------------------
  331|      0|    sample_rate_local = 1000;
  332|      0|  }
  333|  6.67k|  lower_bound = (WORD32)((0.0005f * sample_rate_local) + 0.5f);
  334|       |
  335|  38.4k|  while (result <= lower_bound) {
  ------------------
  |  Branch (335:10): [True: 31.7k, False: 6.67k]
  ------------------
  336|  31.7k|    result = result << 1;
  337|  31.7k|  }
  338|  6.67k|  return result;
  339|  6.67k|}
impd_drc_enc.c:impd_drc_util_stft_read_gain_config:
   39|    475|    ia_drc_gain_set_params_struct *str_gain_set_params) {
   40|    475|  LOOPIDX i, j;
   41|    475|  WORD32 num_points;
   42|       |
   43|  1.50k|  for (i = 0; i < band_count; i++) {
  ------------------
  |  Branch (43:15): [True: 1.03k, False: 475]
  ------------------
   44|  1.03k|    num_points = str_gain_set_params->gain_params[i].nb_points;
   45|  1.03k|    pstr_stft_drc_gain_handle[i].nb_points = num_points;
   46|  5.97k|    for (j = 0; j < num_points; j++) {
  ------------------
  |  Branch (46:17): [True: 4.94k, False: 1.03k]
  ------------------
   47|  4.94k|      pstr_stft_drc_gain_handle[i].str_segment[2 * (j + 1)].x =
   48|  4.94k|          str_gain_set_params->gain_params[i].gain_points[j].x;
   49|  4.94k|      pstr_stft_drc_gain_handle[i].str_segment[2 * (j + 1)].y =
   50|  4.94k|          str_gain_set_params->gain_params[i].gain_points[j].y;
   51|  4.94k|    }
   52|       |
   53|  1.03k|    pstr_stft_drc_gain_handle[i].width_db = str_gain_set_params->gain_params[i].width;
   54|  1.03k|    pstr_stft_drc_gain_handle[i].attack_ms = str_gain_set_params->gain_params[i].attack;
   55|  1.03k|    pstr_stft_drc_gain_handle[i].release_ms = str_gain_set_params->gain_params[i].decay;
   56|  1.03k|  }
   57|    475|}
impd_drc_enc.c:impd_drc_util_td_read_gain_config:
   60|  1.76k|    ia_drc_compand_struct *pstr_drc_compand, ia_drc_gain_set_params_struct *str_gain_set_params) {
   61|  1.76k|  LOOPIDX idx;
   62|  1.76k|  WORD32 num_points;
   63|       |
   64|  1.76k|  num_points = str_gain_set_params->gain_params[0].nb_points;
   65|  1.76k|  pstr_drc_compand->nb_points = num_points;
   66|  9.98k|  for (idx = 0; idx < num_points; idx++) {
  ------------------
  |  Branch (66:17): [True: 8.22k, False: 1.76k]
  ------------------
   67|  8.22k|    pstr_drc_compand->str_segment[2 * (idx + 1)].x =
   68|  8.22k|        str_gain_set_params->gain_params[0].gain_points[idx].x;
   69|  8.22k|    pstr_drc_compand->str_segment[2 * (idx + 1)].y =
   70|  8.22k|        str_gain_set_params->gain_params[0].gain_points[idx].y;
   71|  8.22k|  }
   72|       |
   73|  1.76k|  pstr_drc_compand->width_db = str_gain_set_params->gain_params[0].width;
   74|  1.76k|  pstr_drc_compand->str_channel_param.attack = str_gain_set_params->gain_params[0].attack;
   75|  1.76k|  pstr_drc_compand->str_channel_param.decay = str_gain_set_params->gain_params[0].decay;
   76|       |
   77|  1.76k|  pstr_drc_compand->str_channel_param.attack /= 1000.0;
   78|  1.76k|  pstr_drc_compand->str_channel_param.decay /= 1000.0;
   79|  1.76k|}

impd_drc_td_drc_gain_calc_process:
   95|   127k|                                       WORD32 num_samples, FLOAT32 *in_buff, FLOAT32 *out_buff) {
   96|   127k|  LOOPIDX idx;
   97|   127k|  FLOAT64 gain;
   98|   127k|  ia_drc_compand_chan_param_struct *pstr_channel_param;
   99|   127k|  ia_drc_compand_struct *pstr_drc_compand =
  100|   127k|      &pstr_drc_gain_enc->str_drc_compand[drc_coefficients_uni_drc_idx][gain_set_idx];
  101|       |
  102|   127k|  pstr_channel_param = &pstr_drc_compand->str_channel_param;
  103|       |
  104|   219M|  for (idx = 0; idx < num_samples; idx++) {
  ------------------
  |  Branch (104:17): [True: 219M, False: 127k]
  ------------------
  105|   219M|    impd_drc_compand_update_volume(pstr_channel_param, fabs((FLOAT64)in_buff[idx] / 32768.0));
  106|       |
  107|   219M|    gain = impd_drc_compand_get_volume(pstr_drc_compand, pstr_channel_param->volume);
  108|   219M|    out_buff[idx] = (FLOAT32)(20.0 * log10(gain));
  109|   219M|  }
  110|   127k|}
impd_drc_td_drc_gain_calc_init:
  114|  1.76k|                                            WORD32 gain_set_idx) {
  115|  1.76k|  ULOOPIDX i, j;
  116|  1.76k|  UWORD32 num_points;
  117|  1.76k|  FLOAT64 g1, g2;
  118|  1.76k|  FLOAT64 x, y, cx, cy, r;
  119|  1.76k|  FLOAT64 inp_1, inp_2, out_1, out_2, theta, length, radius;
  120|  1.76k|  ia_drc_compand_struct *pstr_drc_compand;
  121|  1.76k|  ia_drc_compand_chan_param_struct *pstr_chan_param;
  122|       |
  123|  1.76k|  if ((drc_coefficients_uni_drc_idx >= MAX_DRC_COEFF_COUNT) ||
  ------------------
  |  |   30|  1.76k|#define MAX_DRC_COEFF_COUNT (7)
  ------------------
  |  Branch (123:7): [True: 0, False: 1.76k]
  ------------------
  124|  1.76k|      (gain_set_idx >= GAIN_SET_COUNT_MAX)) {
  ------------------
  |  |   49|  1.76k|#define GAIN_SET_COUNT_MAX 8                         /* reduced size */
  ------------------
  |  Branch (124:7): [True: 0, False: 1.76k]
  ------------------
  125|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_COMPAND_FAILED;
  126|      0|  }
  127|       |
  128|  1.76k|  pstr_drc_compand =
  129|  1.76k|      &pstr_drc_gain_enc->str_drc_compand[drc_coefficients_uni_drc_idx][gain_set_idx];
  130|       |
  131|  6.86k|  for (i = 0; i < pstr_drc_compand->nb_points; i++) {
  ------------------
  |  Branch (131:15): [True: 5.12k, False: 1.73k]
  ------------------
  132|  5.12k|    if (i && pstr_drc_compand->str_segment[2 * ((i - 1) + 1)].x >
  ------------------
  |  Branch (132:9): [True: 4.29k, False: 834]
  |  Branch (132:14): [True: 30, False: 4.26k]
  ------------------
  133|  4.29k|                 pstr_drc_compand->str_segment[2 * ((i) + 1)].x) {
  134|     30|      return IA_EXHEAACE_CONFIG_FATAL_DRC_COMPAND_FAILED;
  135|     30|    }
  136|  5.09k|    pstr_drc_compand->str_segment[2 * (i + 1)].y -= pstr_drc_compand->str_segment[2 * (i + 1)].x;
  137|  5.09k|  }
  138|  1.73k|  num_points = pstr_drc_compand->nb_points;
  139|       |
  140|  1.73k|  if (num_points == 0 || pstr_drc_compand->str_segment[2 * ((num_points - 1) + 1)].x) {
  ------------------
  |  Branch (140:7): [True: 935, False: 804]
  |  Branch (140:26): [True: 485, False: 319]
  ------------------
  141|  1.42k|    num_points++;
  142|  1.42k|  }
  143|       |
  144|  1.73k|  pstr_drc_compand->str_segment[0].x =
  145|  1.73k|      pstr_drc_compand->str_segment[2].x - 2 * pstr_drc_compand->width_db;
  146|  1.73k|  pstr_drc_compand->str_segment[0].y = pstr_drc_compand->str_segment[2].y;
  147|  1.73k|  num_points++;
  148|       |
  149|  1.73k|  radius = pstr_drc_compand->width_db * M_LN10_DIV_20;
  ------------------
  |  |   34|  1.73k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  150|       |
  151|  5.97k|  for (i = 2; i < num_points; i++) {
  ------------------
  |  Branch (151:15): [True: 4.23k, False: 1.73k]
  ------------------
  152|  4.23k|    g1 = (pstr_drc_compand->str_segment[2 * (i - 1)].y -
  153|  4.23k|          pstr_drc_compand->str_segment[2 * (i - 2)].y) *
  154|  4.23k|         (pstr_drc_compand->str_segment[2 * i].x - pstr_drc_compand->str_segment[2 * (i - 1)].x);
  155|  4.23k|    g2 = (pstr_drc_compand->str_segment[2 * i].y - pstr_drc_compand->str_segment[2 * (i - 1)].y) *
  156|  4.23k|         (pstr_drc_compand->str_segment[2 * (i - 1)].x -
  157|  4.23k|          pstr_drc_compand->str_segment[2 * (i - 2)].x);
  158|       |
  159|  4.23k|    if (fabs(g1 - g2)) {
  ------------------
  |  Branch (159:9): [True: 972, False: 3.26k]
  ------------------
  160|    972|      continue;
  161|    972|    }
  162|  3.26k|    num_points--;
  163|       |
  164|   194k|    for (j = --i; j < num_points; j++) {
  ------------------
  |  Branch (164:19): [True: 190k, False: 3.26k]
  ------------------
  165|   190k|      pstr_drc_compand->str_segment[2 * j] = pstr_drc_compand->str_segment[2 * (j + 1)];
  166|   190k|    }
  167|  3.26k|  }
  168|       |
  169|  1.73k|  pstr_drc_compand->nb_segments = num_points * 2;
  170|  6.18k|  for (i = 0; i < pstr_drc_compand->nb_segments; i += 2) {
  ------------------
  |  Branch (170:15): [True: 4.45k, False: 1.73k]
  ------------------
  171|  4.45k|    pstr_drc_compand->str_segment[i].y += pstr_drc_compand->gain_db;
  172|  4.45k|    pstr_drc_compand->str_segment[i].x *= M_LN10_DIV_20;
  ------------------
  |  |   34|  4.45k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  173|  4.45k|    pstr_drc_compand->str_segment[i].y *= M_LN10_DIV_20;
  ------------------
  |  |   34|  4.45k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  174|  4.45k|  }
  175|       |
  176|  2.70k|  for (i = 4; i < pstr_drc_compand->nb_segments; i += 2) {
  ------------------
  |  Branch (176:15): [True: 972, False: 1.73k]
  ------------------
  177|    972|    FLOAT64 num = 0.0;
  178|    972|    FLOAT64 den = 0.0f;
  179|       |
  180|    972|    num = pstr_drc_compand->str_segment[i - 2].y - pstr_drc_compand->str_segment[i - 4].y;
  181|    972|    den = pstr_drc_compand->str_segment[i - 2].x - pstr_drc_compand->str_segment[i - 4].x;
  182|    972|    length = hypot(num, den);
  183|    972|    if (length < FLT_EPSILON) {
  ------------------
  |  Branch (183:9): [True: 0, False: 972]
  ------------------
  184|      0|      return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_GAIN_POINTS;
  185|      0|    }
  186|    972|    pstr_drc_compand->str_segment[i - 4].a = 0;
  187|    972|    pstr_drc_compand->str_segment[i - 4].b = ixheaace_div64(num, den);
  188|    972|    theta = atan2(num, den);
  189|    972|    r = MIN(radius, length);
  ------------------
  |  |   86|    972|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 942, False: 30]
  |  |  ------------------
  ------------------
  190|    972|    pstr_drc_compand->str_segment[i - 3].x =
  191|    972|        pstr_drc_compand->str_segment[i - 2].x - r * cos(theta);
  192|    972|    pstr_drc_compand->str_segment[i - 3].y =
  193|    972|        pstr_drc_compand->str_segment[i - 2].y - r * sin(theta);
  194|       |
  195|    972|    num = pstr_drc_compand->str_segment[i].y - pstr_drc_compand->str_segment[i - 2].y;
  196|    972|    den = pstr_drc_compand->str_segment[i].x - pstr_drc_compand->str_segment[i - 2].x;
  197|    972|    length = hypot(num, den);
  198|    972|    if (length < FLT_EPSILON) {
  ------------------
  |  Branch (198:9): [True: 4, False: 968]
  ------------------
  199|      4|      return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_GAIN_POINTS;
  200|      4|    }
  201|    968|    pstr_drc_compand->str_segment[i - 2].a = 0;
  202|    968|    pstr_drc_compand->str_segment[i - 2].b = ixheaace_div64(num, den);
  203|    968|    theta = atan2(num, den);
  204|    968|    r = MIN(radius, length / 2);
  ------------------
  |  |   86|    968|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 920, False: 48]
  |  |  ------------------
  ------------------
  205|    968|    x = pstr_drc_compand->str_segment[i - 2].x + r * cos(theta);
  206|    968|    y = pstr_drc_compand->str_segment[i - 2].y + r * sin(theta);
  207|       |
  208|    968|    cx =
  209|    968|        (pstr_drc_compand->str_segment[i - 3].x + pstr_drc_compand->str_segment[i - 2].x + x) / 3;
  210|    968|    cy =
  211|    968|        (pstr_drc_compand->str_segment[i - 3].y + pstr_drc_compand->str_segment[i - 2].y + y) / 3;
  212|       |
  213|    968|    pstr_drc_compand->str_segment[i - 2].x = x;
  214|    968|    pstr_drc_compand->str_segment[i - 2].y = y;
  215|       |
  216|    968|    inp_1 = cx - pstr_drc_compand->str_segment[i - 3].x;
  217|    968|    out_1 = cy - pstr_drc_compand->str_segment[i - 3].y;
  218|    968|    inp_2 = pstr_drc_compand->str_segment[i - 2].x - pstr_drc_compand->str_segment[i - 3].x;
  219|    968|    out_2 = pstr_drc_compand->str_segment[i - 2].y - pstr_drc_compand->str_segment[i - 3].y;
  220|       |
  221|    968|    num = (out_2 * inp_1) - (inp_2 * out_1);
  222|    968|    den = (inp_2 - inp_1) * inp_1 * inp_2;
  223|    968|    pstr_drc_compand->str_segment[i - 3].a = ixheaace_div64(num, den);
  224|       |
  225|    968|    num = out_1 - (pstr_drc_compand->str_segment[i - 3].a * inp_1 * inp_1);
  226|    968|    den = inp_1;
  227|    968|    pstr_drc_compand->str_segment[i - 3].b = ixheaace_div64(num, den);
  228|    968|  }
  229|  1.73k|  pstr_drc_compand->str_segment[i - 3].x = 0;
  230|  1.73k|  pstr_drc_compand->str_segment[i - 3].y = pstr_drc_compand->str_segment[i - 3].y;
  231|       |
  232|  1.73k|  pstr_drc_compand->in_min_lin = exp(pstr_drc_compand->str_segment[1].x);
  233|  1.73k|  pstr_drc_compand->out_min_lin = exp(pstr_drc_compand->str_segment[1].y);
  234|       |
  235|  1.73k|  pstr_chan_param = &pstr_drc_compand->str_channel_param;
  236|       |
  237|  1.73k|  if (pstr_chan_param->attack < 1.0 / pstr_drc_gain_enc->sample_rate) {
  ------------------
  |  Branch (237:7): [True: 1.48k, False: 253]
  ------------------
  238|       |    // Decreasing the upper limit of alphaAttack from 1 -> 1 - 1/EPSILON to avoid DRC payload overflow.
  239|  1.48k|    pstr_chan_param->attack = 1.0 - exp(-1);
  240|  1.48k|  } else {
  241|    253|    pstr_chan_param->attack =
  242|    253|        1.0 - exp(-1.0 / (pstr_drc_gain_enc->sample_rate * pstr_chan_param->attack));
  243|    253|  }
  244|       |
  245|  1.73k|  if (pstr_chan_param->decay < 1.0 / pstr_drc_gain_enc->sample_rate) {
  ------------------
  |  Branch (245:7): [True: 1.41k, False: 317]
  ------------------
  246|       |    // Decreasing the upper limit of alphaDecay from 1 -> 1 - 1/EPSILON to avoid DRC payload overflow.
  247|  1.41k|    pstr_chan_param->decay = 1.0 - exp(-1);
  248|  1.41k|  } else {
  249|    317|    pstr_chan_param->decay =
  250|    317|        1.0 - exp(-1.0 / (pstr_drc_gain_enc->sample_rate * pstr_chan_param->decay));
  251|    317|  }
  252|  1.73k|  pstr_chan_param->volume = EXP10(pstr_drc_compand->initial_volume / 20);
  ------------------
  |  |   36|  1.73k|#define EXP10(x) (exp2(M_LOG2_10 * x))
  |  |  ------------------
  |  |  |  |   27|  1.73k|#define M_LOG2_10 (3.32192809488736234787) /* log_2 10 */
  |  |  ------------------
  ------------------
  253|       |
  254|  1.73k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  1.73k|#define IA_NO_ERROR 0x00000000
  ------------------
  255|  1.73k|}
impd_drc_stft_drc_gain_calc_process:
  287|  45.1k|                                         FLOAT32 *in_buff, FLOAT32 *gain_values) {
  288|  45.1k|  ULOOPIDX idx;
  289|  45.1k|  LOOPIDX band;
  290|  45.1k|  FLOAT32 xg, xl, yl, cdb;
  291|  45.1k|  FLOAT32 in_real, in_imag;
  292|  45.1k|  FLOAT32 abs_val_sqr;
  293|  45.1k|  UWORD32 num_time_slot = num_frames / STFT256_HOP_SIZE;
  ------------------
  |  |   39|  45.1k|#define STFT256_HOP_SIZE (256)
  ------------------
  294|       |
  295|  45.1k|  ia_drc_stft_gain_calc_struct *pstr_drc_stft_gain_handle =
  296|  45.1k|      &pstr_drc_gain_enc
  297|  45.1k|           ->str_drc_stft_gain_handle[drc_coefficients_uni_drc_idx][gain_set_idx][band_idx];
  298|       |
  299|   322k|  for (idx = 0; idx < num_time_slot; idx++) {
  ------------------
  |  Branch (299:17): [True: 276k, False: 45.1k]
  ------------------
  300|   276k|    abs_val_sqr = 0.0f;
  301|  34.9M|    for (band = start_sub_band_index; band <= stop_sub_band_index; band++) {
  ------------------
  |  Branch (301:39): [True: 34.6M, False: 276k]
  ------------------
  302|  34.6M|      in_imag = in_buff[((idx * STFT256_HOP_SIZE + band) << 1) + 1];
  ------------------
  |  |   39|  34.6M|#define STFT256_HOP_SIZE (256)
  ------------------
  303|  34.6M|      in_real = in_buff[(idx * STFT256_HOP_SIZE + band) << 1];
  ------------------
  |  |   39|  34.6M|#define STFT256_HOP_SIZE (256)
  ------------------
  304|       |
  305|  34.6M|      abs_val_sqr += sqrtf(powf(in_real, 2.0f) + powf(in_imag, 2.0f));
  306|  34.6M|    }
  307|       |
  308|   276k|    abs_val_sqr /= (FLOAT32)((stop_sub_band_index - start_sub_band_index + 1) << 4);
  309|       |
  310|   276k|    abs_val_sqr = powf(abs_val_sqr, 2.0f);
  311|   276k|    xg = 10.0f * log10f((abs_val_sqr) + 2e-13f);
  312|       |
  313|   276k|    xl = -impd_drc_stft_drc_compand_get_volume(pstr_drc_stft_gain_handle, xg);
  314|       |
  315|   276k|    if (xl > pstr_drc_stft_gain_handle->yl_z1[band]) {
  ------------------
  |  Branch (315:9): [True: 1.98k, False: 274k]
  ------------------
  316|  1.98k|      yl = (pstr_drc_stft_gain_handle->alpha_a * pstr_drc_stft_gain_handle->yl_z1[band]) +
  317|  1.98k|           ((1.0f - pstr_drc_stft_gain_handle->alpha_a) * xl);
  318|   274k|    } else {
  319|   274k|      yl = (pstr_drc_stft_gain_handle->alpha_r * pstr_drc_stft_gain_handle->yl_z1[band]) +
  320|   274k|           ((1.0f - pstr_drc_stft_gain_handle->alpha_r) * xl);
  321|   274k|    }
  322|       |
  323|   276k|    pstr_drc_stft_gain_handle->yl_z1[band] = yl;
  324|   276k|    cdb = -yl;
  325|   276k|    cdb = MAX(IMPD_DRCSPECTRAL_FLOOR, (powf(10.0f, cdb / 20.0f)));
  ------------------
  |  |   89|   276k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 4.93k, False: 271k]
  |  |  ------------------
  ------------------
  326|   276k|    cdb = 20.0f * log10f(cdb);
  327|       |
  328|  71.1M|    for (band = 0; band < STFT256_HOP_SIZE; band++) {
  ------------------
  |  |   39|  71.1M|#define STFT256_HOP_SIZE (256)
  ------------------
  |  Branch (328:20): [True: 70.8M, False: 276k]
  ------------------
  329|  70.8M|      gain_values[idx * STFT256_HOP_SIZE + band] = cdb;
  ------------------
  |  |   39|  70.8M|#define STFT256_HOP_SIZE (256)
  ------------------
  330|  70.8M|    }
  331|   276k|  }
  332|  45.1k|}
impd_drc_stft_drc_gain_calc_init:
  336|  1.01k|                                              WORD32 gain_set_idx, WORD32 band_idx) {
  337|  1.01k|  ULOOPIDX i, j;
  338|  1.01k|  UWORD32 num_points;
  339|  1.01k|  FLOAT32 width_e, tmp;
  340|  1.01k|  FLOAT64 g1, g2;
  341|  1.01k|  FLOAT64 x, y, cx, cy, r;
  342|  1.01k|  FLOAT64 inp_1, inp_2, out_1, out_2, theta, len;
  343|  1.01k|  ia_drc_compand_chan_param_struct *pstr_chan_param;
  344|  1.01k|  ia_drc_stft_gain_calc_struct *pstr_drc_stft_gain_handle;
  345|       |
  346|  1.01k|  if ((drc_coefficients_uni_drc_idx >= MAX_DRC_COEFF_COUNT) ||
  ------------------
  |  |   30|  1.01k|#define MAX_DRC_COEFF_COUNT (7)
  ------------------
  |  Branch (346:7): [True: 0, False: 1.01k]
  ------------------
  347|  1.01k|      (gain_set_idx >= GAIN_SET_COUNT_MAX) || (band_idx >= MAX_BAND_COUNT)) {
  ------------------
  |  |   49|  1.01k|#define GAIN_SET_COUNT_MAX 8                         /* reduced size */
  ------------------
                    (gain_set_idx >= GAIN_SET_COUNT_MAX) || (band_idx >= MAX_BAND_COUNT)) {
  ------------------
  |  |   26|  1.01k|#define MAX_BAND_COUNT (8)
  ------------------
  |  Branch (347:7): [True: 0, False: 1.01k]
  |  Branch (347:47): [True: 0, False: 1.01k]
  ------------------
  348|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_COMPAND_FAILED;
  349|      0|  }
  350|       |
  351|  1.01k|  pstr_drc_stft_gain_handle =
  352|  1.01k|      &pstr_drc_gain_enc
  353|  1.01k|           ->str_drc_stft_gain_handle[drc_coefficients_uni_drc_idx][gain_set_idx][band_idx];
  354|       |
  355|  1.01k|  width_e = (FLOAT32)(pstr_drc_stft_gain_handle->width_db * M_LN10_DIV_20);
  ------------------
  |  |   34|  1.01k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  356|       |
  357|  2.36k|  for (i = 0; i < pstr_drc_stft_gain_handle->nb_points; i++) {
  ------------------
  |  Branch (357:15): [True: 1.37k, False: 989]
  ------------------
  358|  1.37k|    if (i && pstr_drc_stft_gain_handle->str_segment[2 * ((i - 1) + 1)].x >
  ------------------
  |  Branch (358:9): [True: 1.19k, False: 189]
  |  Branch (358:14): [True: 25, False: 1.16k]
  ------------------
  359|  1.19k|                 pstr_drc_stft_gain_handle->str_segment[2 * (i + 1)].x) {
  360|     25|      return IA_EXHEAACE_CONFIG_FATAL_DRC_COMPAND_FAILED;
  361|     25|    }
  362|  1.35k|    pstr_drc_stft_gain_handle->str_segment[2 * (i + 1)].y -=
  363|  1.35k|        pstr_drc_stft_gain_handle->str_segment[2 * (i + 1)].x;
  364|  1.35k|  }
  365|    989|  num_points = pstr_drc_stft_gain_handle->nb_points;
  366|       |
  367|    989|  if (num_points == 0 || pstr_drc_stft_gain_handle->str_segment[2 * ((num_points - 1) + 1)].x) {
  ------------------
  |  Branch (367:7): [True: 825, False: 164]
  |  Branch (367:26): [True: 159, False: 5]
  ------------------
  368|    984|    num_points++;
  369|    984|  }
  370|       |
  371|    989|  pstr_drc_stft_gain_handle->str_segment[0].x =
  372|    989|      pstr_drc_stft_gain_handle->str_segment[2].x - pstr_drc_stft_gain_handle->width_db;
  373|    989|  pstr_drc_stft_gain_handle->str_segment[0].y = pstr_drc_stft_gain_handle->str_segment[2].y;
  374|    989|  num_points++;
  375|       |
  376|  2.21k|  for (i = 2; i < num_points; i++) {
  ------------------
  |  Branch (376:15): [True: 1.22k, False: 989]
  ------------------
  377|  1.22k|    g1 = (pstr_drc_stft_gain_handle->str_segment[2 * (i - 1)].y -
  378|  1.22k|          pstr_drc_stft_gain_handle->str_segment[2 * (i - 2)].y) *
  379|  1.22k|         (pstr_drc_stft_gain_handle->str_segment[2 * i].x -
  380|  1.22k|          pstr_drc_stft_gain_handle->str_segment[2 * (i - 1)].x);
  381|  1.22k|    g2 = (pstr_drc_stft_gain_handle->str_segment[2 * i].y -
  382|  1.22k|          pstr_drc_stft_gain_handle->str_segment[2 * (i - 1)].y) *
  383|  1.22k|         (pstr_drc_stft_gain_handle->str_segment[2 * (i - 1)].x -
  384|  1.22k|          pstr_drc_stft_gain_handle->str_segment[2 * (i - 2)].x);
  385|       |
  386|  1.22k|    if (fabs(g1 - g2)) {
  ------------------
  |  Branch (386:9): [True: 240, False: 987]
  ------------------
  387|    240|      continue;
  388|    240|    }
  389|    987|    num_points--;
  390|       |
  391|  50.7k|    for (j = --i; j < num_points; j++) {
  ------------------
  |  Branch (391:19): [True: 49.7k, False: 987]
  ------------------
  392|  49.7k|      pstr_drc_stft_gain_handle->str_segment[2 * j] =
  393|  49.7k|          pstr_drc_stft_gain_handle->str_segment[2 * (j + 1)];
  394|  49.7k|    }
  395|    987|  }
  396|    989|  pstr_drc_stft_gain_handle->nb_segments = num_points * 2;
  397|  3.20k|  for (i = 0; i < pstr_drc_stft_gain_handle->nb_segments; i += 2) {
  ------------------
  |  Branch (397:15): [True: 2.21k, False: 989]
  ------------------
  398|  2.21k|    pstr_drc_stft_gain_handle->str_segment[i].y += pstr_drc_stft_gain_handle->gain_db;
  399|  2.21k|    pstr_drc_stft_gain_handle->str_segment[i].x *= M_LN10_DIV_20;
  ------------------
  |  |   34|  2.21k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  400|  2.21k|    pstr_drc_stft_gain_handle->str_segment[i].y *= M_LN10_DIV_20;
  ------------------
  |  |   34|  2.21k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  401|  2.21k|  }
  402|       |
  403|  1.22k|  for (i = 4; i < pstr_drc_stft_gain_handle->nb_segments; i += 2) {
  ------------------
  |  Branch (403:15): [True: 240, False: 988]
  ------------------
  404|    240|    FLOAT64 denominator;
  405|    240|    FLOAT64 numerator;
  406|       |
  407|    240|    denominator = pstr_drc_stft_gain_handle->str_segment[i - 2].x -
  408|    240|                  pstr_drc_stft_gain_handle->str_segment[i - 4].x;
  409|    240|    numerator = pstr_drc_stft_gain_handle->str_segment[i - 2].y -
  410|    240|                pstr_drc_stft_gain_handle->str_segment[i - 4].y;
  411|    240|    len = hypot(denominator , numerator);
  412|    240|    if (len < FLT_EPSILON) {
  ------------------
  |  Branch (412:9): [True: 0, False: 240]
  ------------------
  413|      0|      return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_GAIN_POINTS;
  414|      0|    }
  415|    240|    pstr_drc_stft_gain_handle->str_segment[i - 4].a = 0;
  416|    240|    pstr_drc_stft_gain_handle->str_segment[i - 4].b = ixheaace_div64(numerator, denominator);
  417|    240|    theta = atan2(numerator, denominator);
  418|    240|    r = MIN(width_e / (2.0f * cos(theta)), len / 2);
  ------------------
  |  |   86|    240|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 70, False: 170]
  |  |  ------------------
  ------------------
  419|       |
  420|    240|    pstr_drc_stft_gain_handle->str_segment[i - 3].x =
  421|    240|      pstr_drc_stft_gain_handle->str_segment[i - 2].x - r * cos(theta);
  422|    240|    pstr_drc_stft_gain_handle->str_segment[i - 3].y =
  423|    240|      pstr_drc_stft_gain_handle->str_segment[i - 2].y - r * sin(theta);
  424|       |
  425|    240|    denominator = pstr_drc_stft_gain_handle->str_segment[i].x -
  426|    240|                  pstr_drc_stft_gain_handle->str_segment[i - 2].x;
  427|    240|    numerator = pstr_drc_stft_gain_handle->str_segment[i].y -
  428|    240|                pstr_drc_stft_gain_handle->str_segment[i - 2].y;
  429|    240|    len = hypot(denominator, numerator);
  430|    240|    if (len < FLT_EPSILON) {
  ------------------
  |  Branch (430:9): [True: 1, False: 239]
  ------------------
  431|      1|      return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_GAIN_POINTS;
  432|      1|    }
  433|    239|    pstr_drc_stft_gain_handle->str_segment[i - 2].a = 0;
  434|    239|    pstr_drc_stft_gain_handle->str_segment[i - 2].b = ixheaace_div64(numerator, denominator);
  435|       |
  436|    239|    theta = atan2(numerator, denominator);
  437|    239|    r = MIN(width_e / (2.0f * cos(theta)), len / 2);
  ------------------
  |  |   86|    239|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 126, False: 113]
  |  |  ------------------
  ------------------
  438|    239|    x = pstr_drc_stft_gain_handle->str_segment[i - 2].x + r * cos(theta);
  439|    239|    y = pstr_drc_stft_gain_handle->str_segment[i - 2].y + r * sin(theta);
  440|       |
  441|    239|    cx = (pstr_drc_stft_gain_handle->str_segment[i - 3].x +
  442|    239|          pstr_drc_stft_gain_handle->str_segment[i - 2].x + x) /
  443|    239|         3;
  444|    239|    cy = (pstr_drc_stft_gain_handle->str_segment[i - 3].y +
  445|    239|          pstr_drc_stft_gain_handle->str_segment[i - 2].y + y) /
  446|    239|         3;
  447|       |
  448|    239|    pstr_drc_stft_gain_handle->str_segment[i - 2].x = x;
  449|    239|    pstr_drc_stft_gain_handle->str_segment[i - 2].y = y;
  450|       |
  451|    239|    inp_1 = cx - pstr_drc_stft_gain_handle->str_segment[i - 3].x;
  452|    239|    out_1 = cy - pstr_drc_stft_gain_handle->str_segment[i - 3].y;
  453|    239|    inp_2 = pstr_drc_stft_gain_handle->str_segment[i - 2].x -
  454|    239|            pstr_drc_stft_gain_handle->str_segment[i - 3].x;
  455|    239|    out_2 = pstr_drc_stft_gain_handle->str_segment[i - 2].y -
  456|    239|            pstr_drc_stft_gain_handle->str_segment[i - 3].y;
  457|    239|    numerator = (out_2 * inp_1) - (inp_2 * out_1);
  458|    239|    denominator = (inp_2 - inp_1) * inp_2 * inp_1;
  459|    239|    pstr_drc_stft_gain_handle->str_segment[i - 3].a = ixheaace_div64(numerator, denominator);
  460|       |
  461|    239|    numerator = out_1 - (pstr_drc_stft_gain_handle->str_segment[i - 3].a * inp_1 * inp_1);
  462|    239|    denominator = inp_1;
  463|    239|    pstr_drc_stft_gain_handle->str_segment[i - 3].b = ixheaace_div64(numerator, denominator);
  464|    239|  }
  465|    988|  pstr_drc_stft_gain_handle->str_segment[i - 3].x = 0;
  466|    988|  pstr_drc_stft_gain_handle->str_segment[i - 3].y =
  467|    988|      pstr_drc_stft_gain_handle->str_segment[i - 2].y;
  468|       |
  469|    988|  pstr_drc_stft_gain_handle->in_min_db =
  470|    988|      (FLOAT32)(pstr_drc_stft_gain_handle->str_segment[1].x * M_LOG10_E * 20.0f);
  ------------------
  |  |   31|    988|#define M_LOG10_E (0.4342944819) /* log_10 e */
  ------------------
  471|    988|  pstr_drc_stft_gain_handle->out_min_db =
  472|    988|      (FLOAT32)(pstr_drc_stft_gain_handle->str_segment[1].y * M_LOG10_E * 20.0f);
  ------------------
  |  |   31|    988|#define M_LOG10_E (0.4342944819) /* log_10 e */
  ------------------
  473|       |
  474|    988|  pstr_chan_param = &pstr_drc_stft_gain_handle->str_channel_param;
  475|       |
  476|    988|  pstr_chan_param->volume = EXP10(pstr_drc_stft_gain_handle->initial_volume / 20.0f);
  ------------------
  |  |   36|    988|#define EXP10(x) (exp2(M_LOG2_10 * x))
  |  |  ------------------
  |  |  |  |   27|    988|#define M_LOG2_10 (3.32192809488736234787) /* log_2 10 */
  |  |  ------------------
  ------------------
  477|       |
  478|   253k|  for (i = 0; i < STFT256_HOP_SIZE; i++) {
  ------------------
  |  |   39|   253k|#define STFT256_HOP_SIZE (256)
  ------------------
  |  Branch (478:15): [True: 252k, False: 988]
  ------------------
  479|   252k|    pstr_drc_stft_gain_handle->yl_z1[i] = 0.0f;
  480|   252k|  }
  481|       |
  482|    988|  tmp = (pstr_drc_stft_gain_handle->attack_ms / STFT256_HOP_SIZE) *
  ------------------
  |  |   39|    988|#define STFT256_HOP_SIZE (256)
  ------------------
  483|    988|      pstr_drc_gain_enc->sample_rate * 0.001f;
  484|    988|  if ((fabs(tmp) < FLT_EPSILON) && (tmp >= 0.0f)) {
  ------------------
  |  Branch (484:7): [True: 55, False: 933]
  |  Branch (484:36): [True: 55, False: 0]
  ------------------
  485|     55|    pstr_drc_stft_gain_handle->alpha_a = 0;
  486|     55|  }
  487|    933|  else {
  488|    933|    pstr_drc_stft_gain_handle->alpha_a = expf(ixheaace_div32(-1.0f, tmp));
  489|    933|  }
  490|       |
  491|    988|  tmp = (pstr_drc_stft_gain_handle->release_ms / STFT256_HOP_SIZE) *
  ------------------
  |  |   39|    988|#define STFT256_HOP_SIZE (256)
  ------------------
  492|    988|      pstr_drc_gain_enc->sample_rate * 0.001f;
  493|    988|  if ((fabs(tmp) < FLT_EPSILON) && (tmp >= 0.0f)) {
  ------------------
  |  Branch (493:7): [True: 7, False: 981]
  |  Branch (493:36): [True: 7, False: 0]
  ------------------
  494|      7|    pstr_drc_stft_gain_handle->alpha_r = 0;
  495|      7|  }
  496|    981|  else {
  497|    981|    pstr_drc_stft_gain_handle->alpha_r = expf(ixheaace_div32(-1.0f, tmp));
  498|    981|  }
  499|       |
  500|    988|  return IA_NO_ERROR;
  ------------------
  |  |   23|    988|#define IA_NO_ERROR 0x00000000
  ------------------
  501|    989|}
impd_drc_stft_drc_convert_to_fd:
  505|  19.8k|                                     FLOAT32 *ptr_output, VOID *pstr_scratch) {
  506|  19.8k|  ULOOPIDX i, j;
  507|  19.8k|  UWORD32 num_time_slot = frame_size / STFT256_HOP_SIZE;
  ------------------
  |  |   39|  19.8k|#define STFT256_HOP_SIZE (256)
  ------------------
  508|  19.8k|  FLOAT32 time_sample_vector;
  509|  19.8k|  iusace_scratch_mem *ptr_scratch = (iusace_scratch_mem *)(pstr_scratch);
  510|  19.8k|  pFLOAT32 scratch_buff = ptr_scratch->ptr_drc_scratch_buf;
  511|       |
  512|   137k|  for (i = 0; i < num_time_slot; i++) {
  ------------------
  |  Branch (512:15): [True: 118k, False: 19.8k]
  ------------------
  513|  30.3M|    for (j = 0; j < STFT256_HOP_SIZE; j++) {
  ------------------
  |  |   39|  30.3M|#define STFT256_HOP_SIZE (256)
  ------------------
  |  Branch (513:17): [True: 30.2M, False: 118k]
  ------------------
  514|  30.2M|      time_sample_vector = (FLOAT32)(ptr_input[i * STFT256_HOP_SIZE + j] / (32768.0));
  ------------------
  |  |   39|  30.2M|#define STFT256_HOP_SIZE (256)
  ------------------
  515|       |
  516|  30.2M|      scratch_buff[(j << 1)] =
  517|  30.2M|          (FLOAT32)(pstr_drc_gain_enc->stft_tmp_in_buf_time[ch_idx][j] * iusace_sine_win_256[j]);
  518|  30.2M|      scratch_buff[(j << 1) + 1] = 0.0f;
  519|       |
  520|  30.2M|      scratch_buff[(STFT256_HOP_SIZE + j) << 1] =
  ------------------
  |  |   39|  30.2M|#define STFT256_HOP_SIZE (256)
  ------------------
  521|  30.2M|          (FLOAT32)(iusace_sine_win_256[STFT256_HOP_SIZE - 1 - j] * time_sample_vector);
  ------------------
  |  |   39|  30.2M|#define STFT256_HOP_SIZE (256)
  ------------------
  522|  30.2M|      scratch_buff[((STFT256_HOP_SIZE + j) << 1) + 1] = 0.0f;
  ------------------
  |  |   39|  30.2M|#define STFT256_HOP_SIZE (256)
  ------------------
  523|       |
  524|  30.2M|      pstr_drc_gain_enc->stft_tmp_in_buf_time[ch_idx][j] = time_sample_vector;
  525|  30.2M|    }
  526|       |
  527|   118k|    iusace_complex_fft(scratch_buff, STFT256_HOP_SIZE << 1, ptr_scratch);
  ------------------
  |  |   39|   118k|#define STFT256_HOP_SIZE (256)
  ------------------
  528|       |
  529|   118k|    ptr_output[(i * STFT256_HOP_SIZE) << 1] = scratch_buff[0];
  ------------------
  |  |   39|   118k|#define STFT256_HOP_SIZE (256)
  ------------------
  530|   118k|    ptr_output[((i * STFT256_HOP_SIZE) << 1) + 1] = scratch_buff[STFT256_HOP_SIZE << 1];
  ------------------
  |  |   39|   118k|#define STFT256_HOP_SIZE (256)
  ------------------
                  ptr_output[((i * STFT256_HOP_SIZE) << 1) + 1] = scratch_buff[STFT256_HOP_SIZE << 1];
  ------------------
  |  |   39|   118k|#define STFT256_HOP_SIZE (256)
  ------------------
  531|       |
  532|  30.2M|    for (j = 1; j < STFT256_HOP_SIZE; j++) {
  ------------------
  |  |   39|  30.2M|#define STFT256_HOP_SIZE (256)
  ------------------
  |  Branch (532:17): [True: 30.0M, False: 118k]
  ------------------
  533|  30.0M|      ptr_output[(i * STFT256_HOP_SIZE + j) << 1] = scratch_buff[j << 1];
  ------------------
  |  |   39|  30.0M|#define STFT256_HOP_SIZE (256)
  ------------------
  534|  30.0M|      ptr_output[((i * STFT256_HOP_SIZE + j) << 1) + 1] = scratch_buff[(j << 1) + 1];
  ------------------
  |  |   39|  30.0M|#define STFT256_HOP_SIZE (256)
  ------------------
  535|  30.0M|    }
  536|   118k|  }
  537|  19.8k|}
impd_drc_gain_calculator.c:impd_drc_compand_update_volume:
   52|   219M|                                           FLOAT64 in_value) {
   53|   219M|  FLOAT64 delta = in_value - pstr_channel_param->volume;
   54|       |
   55|   219M|  if (delta <= 0.0) {
  ------------------
  |  Branch (55:7): [True: 190M, False: 28.3M]
  ------------------
   56|   190M|    pstr_channel_param->volume += delta * pstr_channel_param->decay;
   57|   190M|  } else {
   58|  28.3M|    pstr_channel_param->volume += delta * pstr_channel_param->attack;
   59|  28.3M|  }
   60|   219M|}
impd_drc_gain_calculator.c:impd_drc_compand_get_volume:
   63|   219M|                                           FLOAT64 in_lin) {
   64|   219M|  ULOOPIDX idx;
   65|   219M|  FLOAT64 in_log, out_log;
   66|   219M|  ia_drc_compand_segment_struct *pstr_compand_segment;
   67|       |
   68|   219M|  if (in_lin < pstr_drc_compand->in_min_lin) {
  ------------------
  |  Branch (68:7): [True: 96.2M, False: 122M]
  ------------------
   69|  96.2M|    return pstr_drc_compand->out_min_lin;
   70|  96.2M|  }
   71|       |
   72|   122M|  if (fabs(in_lin) <= FLT_EPSILON) {
  ------------------
  |  Branch (72:7): [True: 3.93M, False: 118M]
  ------------------
   73|  3.93M|    in_log = log(FLT_EPSILON);
   74|  3.93M|  }
   75|   118M|  else {
   76|   118M|    in_log = log(fabs(in_lin));
   77|   118M|  }
   78|       |
   79|   465M|  for (idx = 1; idx < pstr_drc_compand->nb_segments; idx++) {
  ------------------
  |  Branch (79:17): [True: 448M, False: 16.8M]
  ------------------
   80|   448M|    if (in_log <= pstr_drc_compand->str_segment[idx].x) {
  ------------------
  |  Branch (80:9): [True: 106M, False: 342M]
  ------------------
   81|   106M|      break;
   82|   106M|    }
   83|   448M|  }
   84|       |
   85|   122M|  pstr_compand_segment = &pstr_drc_compand->str_segment[idx - 1];
   86|   122M|  in_log -= pstr_compand_segment->x;
   87|   122M|  out_log = pstr_compand_segment->y +
   88|   122M|            in_log * (pstr_compand_segment->a * in_log + pstr_compand_segment->b);
   89|       |
   90|   122M|  return exp(out_log);
   91|   219M|}
impd_drc_gain_calculator.c:impd_drc_stft_drc_compand_get_volume:
  258|   276k|    ia_drc_stft_gain_calc_struct *pstr_drc_stft_gain_handle, FLOAT32 in_db) {
  259|   276k|  ULOOPIDX idx;
  260|   276k|  FLOAT32 in_log, out_log;
  261|   276k|  ia_drc_compand_segment_struct *pstr_compand_segment;
  262|       |
  263|   276k|  if (in_db < pstr_drc_stft_gain_handle->in_min_db) {
  ------------------
  |  Branch (263:7): [True: 266k, False: 10.8k]
  ------------------
  264|   266k|    return pstr_drc_stft_gain_handle->out_min_db;
  265|   266k|  }
  266|       |
  267|  10.8k|  in_log = (FLOAT32)(in_db * M_LN10_DIV_20);
  ------------------
  |  |   34|  10.8k|#define M_LN10_DIV_20 (0.115129254649702284201) /* (log_e 10  / 20) */
  ------------------
  268|       |
  269|  46.5k|  for (idx = 1; idx < pstr_drc_stft_gain_handle->nb_segments; idx++) {
  ------------------
  |  Branch (269:17): [True: 43.7k, False: 2.83k]
  ------------------
  270|  43.7k|    if (in_log <= pstr_drc_stft_gain_handle->str_segment[idx].x) {
  ------------------
  |  Branch (270:9): [True: 8.05k, False: 35.6k]
  ------------------
  271|  8.05k|      break;
  272|  8.05k|    }
  273|  43.7k|  }
  274|       |
  275|  10.8k|  pstr_compand_segment = &pstr_drc_stft_gain_handle->str_segment[idx - 1];
  276|  10.8k|  in_log -= (FLOAT32)(pstr_compand_segment->x);
  277|  10.8k|  out_log = (FLOAT32)(pstr_compand_segment->y +
  278|  10.8k|                      in_log * (pstr_compand_segment->a * in_log + pstr_compand_segment->b));
  279|       |
  280|  10.8k|  return (FLOAT32)(out_log * M_LOG10_E * 20.0f);
  ------------------
  |  |   31|  10.8k|#define M_LOG10_E (0.4342944819) /* log_10 e */
  ------------------
  281|   276k|}

impd_drc_quantize_and_encode_drc_gain:
  995|   178k|    ia_drc_gain_seq_buf_struct *pstr_drc_gain_seq_buf, VOID *pstr_scratch) {
  996|   178k|  WORD32 drc_frame_size = pstr_gain_enc->drc_frame_size;
  997|   178k|  const WORD32 *ptr_delta_time_quant_table = pstr_gain_enc->delta_time_quant_table;
  998|   178k|  ia_drc_group_struct *pstr_drc_group;
  999|   178k|  ia_drc_group_for_output_struct *pstr_drc_group_for_output;
 1000|   178k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   178k|#define IA_NO_ERROR 0x00000000
  ------------------
 1001|   178k|  impd_drc_advance_nodes(pstr_gain_enc, pstr_drc_gain_seq_buf);
 1002|       |
 1003|   178k|  pstr_drc_group = &(pstr_drc_gain_seq_buf->str_drc_group);
 1004|   178k|  pstr_drc_group_for_output = &(pstr_drc_gain_seq_buf->str_drc_group_for_output);
 1005|       |
 1006|   178k|  impd_drc_get_preliminary_nodes(
 1007|   178k|      pstr_gain_enc, ptr_drc_gain_per_sample, ptr_drc_gain_per_sample_with_prev_frame,
 1008|   178k|      pstr_drc_group, pstr_drc_gain_seq_buf->str_gain_set_params.full_frame, pstr_scratch);
 1009|       |
 1010|   178k|  err_code = impd_drc_quantize_drc_frame(
 1011|   178k|      drc_frame_size, pstr_gain_enc->delta_tmin,
 1012|   178k|      pstr_gain_enc->drc_frame_size / pstr_gain_enc->delta_tmin,
 1013|   178k|      ptr_drc_gain_per_sample_with_prev_frame, ptr_delta_time_quant_table,
 1014|   178k|      pstr_drc_gain_seq_buf->str_gain_set_params.gain_coding_profile, pstr_drc_group,
 1015|   178k|      pstr_drc_group_for_output);
 1016|       |
 1017|   178k|  if (err_code) {
  ------------------
  |  Branch (1017:7): [True: 0, False: 178k]
  ------------------
 1018|      0|    return err_code;
 1019|      0|  }
 1020|       |
 1021|   178k|  err_code = impd_drc_post_process_nodes(pstr_gain_enc, pstr_delta_time_code_table,
 1022|   178k|                                         pstr_drc_gain_seq_buf, pstr_scratch);
 1023|   178k|  return err_code;
 1024|   178k|}
impd_drc_gain_enc.c:impd_drc_advance_nodes:
  365|   178k|                                   ia_drc_gain_seq_buf_struct *pstr_drc_gain_seq_buf) {
  366|   178k|  LOOPIDX idx;
  367|   178k|  ia_drc_group_struct *pstr_drc_group = &(pstr_drc_gain_seq_buf->str_drc_group);
  368|   178k|  ia_drc_group_for_output_struct *pstr_drc_group_for_output =
  369|   178k|      &(pstr_drc_gain_seq_buf->str_drc_group_for_output);
  370|       |
  371|   178k|  if (pstr_drc_group_for_output->n_gain_values > 0) {
  ------------------
  |  Branch (371:7): [True: 176k, False: 1.55k]
  ------------------
  372|   176k|    pstr_drc_group_for_output->time_quant_prev =
  373|   176k|        pstr_drc_group_for_output->ts_gain_quant[pstr_drc_group_for_output->n_gain_values - 1] -
  374|   176k|        pstr_gain_enc->drc_frame_size;
  375|   176k|    pstr_drc_group_for_output->slope_code_index_prev =
  376|   176k|        pstr_drc_group_for_output->slope_code_index[pstr_drc_group_for_output->n_gain_values - 1];
  377|   176k|    pstr_drc_group_for_output->drc_gain_quant_prev =
  378|   176k|        pstr_drc_group_for_output->drc_gain_quant[pstr_drc_group_for_output->n_gain_values - 1];
  379|   176k|  }
  380|  1.30M|  for (idx = 0; idx < pstr_drc_group->n_gain_values; idx++) {
  ------------------
  |  Branch (380:17): [True: 1.12M, False: 178k]
  ------------------
  381|  1.12M|    pstr_drc_group_for_output->ts_gain_quant[idx] = pstr_drc_group->ts_gain_quant[idx];
  382|  1.12M|    pstr_drc_group_for_output->time_delta_quant[idx] = pstr_drc_group->time_delta_quant[idx];
  383|  1.12M|    pstr_drc_group_for_output->slope_quant[idx] = pstr_drc_group->slope_quant[idx];
  384|  1.12M|    pstr_drc_group_for_output->slope_code_index[idx] = pstr_drc_group->slope_code_index[idx];
  385|  1.12M|    pstr_drc_group_for_output->gain_code[idx] = pstr_drc_group->gain_code[idx];
  386|  1.12M|    pstr_drc_group_for_output->gain_code_length[idx] = pstr_drc_group->gain_code_length[idx];
  387|  1.12M|    pstr_drc_group_for_output->drc_gain_quant[idx] = pstr_drc_group->drc_gain_quant[idx];
  388|  1.12M|  }
  389|   178k|  pstr_drc_group_for_output->n_gain_values = pstr_drc_group->n_gain_values;
  390|   178k|}
impd_drc_gain_enc.c:impd_drc_get_preliminary_nodes:
  242|   178k|                                           const WORD32 full_frame, VOID *pstr_scratch) {
  243|   178k|  LOOPIDX n, k;
  244|   178k|  WORD32 t, index;
  245|   178k|  WORD32 drc_frame_size = pstr_gain_enc->drc_frame_size;
  246|   178k|  WORD32 time_delta_min = pstr_gain_enc->delta_tmin;
  247|   178k|  WORD32 num_values = drc_frame_size / time_delta_min;
  248|   178k|  WORD32 offset = time_delta_min / 2;
  249|   178k|  WORD32 num_gain_values;
  250|   178k|  WORD32 n_left, n_right;
  251|       |
  252|   178k|  FLOAT32 gain, gain_quant, gain_quant_prev;
  253|   178k|  FLOAT32 quant_error_prev = -1.0f;
  254|   178k|  FLOAT32 quant_error;
  255|   178k|  FLOAT32 slope_prev, slope_next;
  256|   178k|  FLOAT32 f0 = 0.9f;
  257|   178k|  FLOAT32 f1 = 1.0f - f0;
  258|       |
  259|   178k|  WORD32 *ptr_time_at_node = pstr_drc_group->ts_gain;
  260|   178k|  FLOAT32 *ptr_gain_at_node = pstr_drc_group->drc_gain;
  261|   178k|  FLOAT32 *ptr_slope_at_node = pstr_drc_group->slope;
  262|   178k|  FLOAT32 *ptr_gain = ptr_drc_gain_per_sample_with_prev_frame + drc_frame_size;
  263|   178k|  iusace_scratch_mem *ptr_scratch = (iusace_scratch_mem *)(pstr_scratch);
  264|   178k|  FLOAT32 *ptr_slope = (FLOAT32 *)ptr_scratch->ptr_drc_scratch_buf;
  265|       |
  266|   178k|  memcpy(ptr_drc_gain_per_sample_with_prev_frame,
  267|   178k|         &(ptr_drc_gain_per_sample_with_prev_frame[drc_frame_size]),
  268|   178k|         drc_frame_size * sizeof(FLOAT32));
  269|   178k|  memcpy(&(ptr_drc_gain_per_sample_with_prev_frame[drc_frame_size]), ptr_drc_gain_per_sample,
  270|   178k|         drc_frame_size * sizeof(FLOAT32));
  271|       |
  272|   299M|  for (n = 0; n < drc_frame_size; n++) {
  ------------------
  |  Branch (272:15): [True: 299M, False: 178k]
  ------------------
  273|   299M|    ptr_gain[n] *= SCALE_APPROXIMATE_DB;
  ------------------
  |  |   57|   299M|  (0.99657842f) /* factor for converting dB to approximate dB: log2(10)*6/20 */
  ------------------
  274|   299M|  }
  275|   299M|  for (n = 0; n < drc_frame_size; n++) {
  ------------------
  |  Branch (275:15): [True: 299M, False: 178k]
  ------------------
  276|   299M|    ptr_gain[n] = f0 * ptr_gain[n - 1] + f1 * ptr_gain[n];
  277|   299M|  }
  278|       |
  279|   178k|  if (pstr_drc_group->gain_prev_node < 0.f) {
  ------------------
  |  Branch (279:7): [True: 31.3k, False: 146k]
  ------------------
  280|  31.3k|    gain_quant_prev =
  281|  31.3k|        GAIN_QUANT_STEP_SIZE *
  ------------------
  |  |   51|  31.3k|#define GAIN_QUANT_STEP_SIZE (0.125f)
  ------------------
  282|  31.3k|        ((WORD32)(-0.5f + GAIN_QUANT_STEP_SIZE_INV * pstr_drc_group->gain_prev_node));
  ------------------
  |  |   52|  31.3k|#define GAIN_QUANT_STEP_SIZE_INV (8.0f)
  ------------------
  283|   146k|  } else {
  284|   146k|    gain_quant_prev =
  285|   146k|        GAIN_QUANT_STEP_SIZE *
  ------------------
  |  |   51|   146k|#define GAIN_QUANT_STEP_SIZE (0.125f)
  ------------------
  286|   146k|        ((WORD32)(0.5f + GAIN_QUANT_STEP_SIZE_INV * pstr_drc_group->gain_prev_node));
  ------------------
  |  |   52|   146k|#define GAIN_QUANT_STEP_SIZE_INV (8.0f)
  ------------------
  287|   146k|  }
  288|       |
  289|   178k|  k = -1;
  290|  14.1M|  for (n = 1; n < num_values + 1; n++) {
  ------------------
  |  Branch (290:15): [True: 13.9M, False: 178k]
  ------------------
  291|  13.9M|    gain = ptr_gain[n * time_delta_min - 1];
  292|  13.9M|    if (gain < 0.f) {
  ------------------
  |  Branch (292:9): [True: 2.34M, False: 11.6M]
  ------------------
  293|  2.34M|      gain_quant = GAIN_QUANT_STEP_SIZE * ((WORD32)(-0.5f + GAIN_QUANT_STEP_SIZE_INV * gain));
  ------------------
  |  |   51|  2.34M|#define GAIN_QUANT_STEP_SIZE (0.125f)
  ------------------
                    gain_quant = GAIN_QUANT_STEP_SIZE * ((WORD32)(-0.5f + GAIN_QUANT_STEP_SIZE_INV * gain));
  ------------------
  |  |   52|  2.34M|#define GAIN_QUANT_STEP_SIZE_INV (8.0f)
  ------------------
  294|  11.6M|    } else {
  295|  11.6M|      gain_quant = GAIN_QUANT_STEP_SIZE * ((WORD32)(0.5f + GAIN_QUANT_STEP_SIZE_INV * gain));
  ------------------
  |  |   51|  11.6M|#define GAIN_QUANT_STEP_SIZE (0.125f)
  ------------------
                    gain_quant = GAIN_QUANT_STEP_SIZE * ((WORD32)(0.5f + GAIN_QUANT_STEP_SIZE_INV * gain));
  ------------------
  |  |   52|  11.6M|#define GAIN_QUANT_STEP_SIZE_INV (8.0f)
  ------------------
  296|  11.6M|    }
  297|  13.9M|    quant_error = (FLOAT32)fabs((FLOAT64)(gain - gain_quant));
  298|       |
  299|  13.9M|    slope_prev = (gain - ptr_gain[(n - 1) * time_delta_min - 1]);
  300|  13.9M|    if (n == num_values) {
  ------------------
  |  Branch (300:9): [True: 178k, False: 13.7M]
  ------------------
  301|   178k|      slope_next = 0.2f;
  302|  13.7M|    } else {
  303|  13.7M|      slope_next = (ptr_gain[(n + 1) * time_delta_min - 1] - gain);
  304|  13.7M|    }
  305|       |
  306|  13.9M|    if (gain_quant_prev != gain_quant) {
  ------------------
  |  Branch (306:9): [True: 984k, False: 12.9M]
  ------------------
  307|   984k|      k++;
  308|   984k|      quant_error_prev = quant_error;
  309|   984k|      gain_quant_prev = gain_quant;
  310|   984k|      ptr_time_at_node[k] = n * time_delta_min - 1;
  311|   984k|      if ((FLOAT32)fabs((FLOAT64)slope_prev) > 0.1f) {
  ------------------
  |  Branch (311:11): [True: 875k, False: 109k]
  ------------------
  312|   875k|        gain_quant_prev = 1000.0f;
  313|   875k|      }
  314|  12.9M|    } else {
  315|  12.9M|      if ((FLOAT32)fabs((FLOAT64)slope_next) > 0.1f) {
  ------------------
  |  Branch (315:11): [True: 206k, False: 12.7M]
  ------------------
  316|   206k|        if (k < 0) {
  ------------------
  |  Branch (316:13): [True: 154k, False: 52.2k]
  ------------------
  317|   154k|          k = 0;
  318|   154k|        }
  319|   206k|        ptr_time_at_node[k] = n * time_delta_min - 1;
  320|  12.7M|      } else {
  321|  12.7M|        if (quant_error_prev > quant_error) {
  ------------------
  |  Branch (321:13): [True: 424k, False: 12.3M]
  ------------------
  322|   424k|          if (k < 0) {
  ------------------
  |  Branch (322:15): [True: 0, False: 424k]
  ------------------
  323|      0|            k = 0;
  324|      0|          }
  325|   424k|          quant_error_prev = quant_error;
  326|   424k|          ptr_time_at_node[k] = n * time_delta_min - 1;
  327|   424k|        }
  328|  12.7M|      }
  329|  12.9M|    }
  330|  13.9M|  }
  331|   178k|  if (full_frame == 1) {
  ------------------
  |  Branch (331:7): [True: 67.0k, False: 110k]
  ------------------
  332|  67.0k|    if (ptr_time_at_node[k] != drc_frame_size - 1) {
  ------------------
  |  Branch (332:9): [True: 0, False: 67.0k]
  ------------------
  333|      0|      k++;
  334|      0|      ptr_time_at_node[k] = drc_frame_size - 1;
  335|      0|    }
  336|  67.0k|  }
  337|       |
  338|   178k|  num_gain_values = k + 1;
  339|   178k|  if (num_gain_values <= 0) {
  ------------------
  |  Branch (339:7): [True: 0, False: 178k]
  ------------------
  340|      0|    if (k < 0) {
  ------------------
  |  Branch (340:9): [True: 0, False: 0]
  ------------------
  341|      0|      k = 0;
  342|      0|    }
  343|      0|    n = num_values / 2;
  344|      0|    index = offset + n * time_delta_min - 1;
  345|      0|    ptr_slope[n] =
  346|      0|        ptr_drc_gain_per_sample[index + time_delta_min] - ptr_drc_gain_per_sample[index];
  347|      0|    t = (n + 1) * time_delta_min - 1;
  348|      0|    ptr_time_at_node[k] = t;
  349|      0|    ptr_slope_at_node[k] = ptr_slope[n];
  350|      0|    ptr_gain_at_node[k] = ptr_drc_gain_per_sample[t];
  351|      0|    num_gain_values++;
  352|      0|  }
  353|       |
  354|  1.31M|  for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (354:15): [True: 1.13M, False: 178k]
  ------------------
  355|  1.13M|    n_left = MAX(0, ptr_time_at_node[k] - time_delta_min);
  ------------------
  |  |   89|  1.13M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 12.3k, False: 1.12M]
  |  |  ------------------
  ------------------
  356|  1.13M|    n_right = n_left + time_delta_min;
  357|  1.13M|    ptr_slope_at_node[k] = ptr_gain[n_right] - ptr_gain[n_left];
  358|  1.13M|    ptr_gain_at_node[k] = ptr_gain[ptr_time_at_node[k]];
  359|  1.13M|  }
  360|       |
  361|   178k|  pstr_drc_group->n_gain_values = num_gain_values;
  362|   178k|}
impd_drc_gain_enc.c:impd_drc_quantize_drc_frame:
  855|   178k|    ia_drc_group_for_output_struct *pstr_drc_group_for_output) {
  856|   178k|  LOOPIDX i, n;
  857|   178k|  WORD32 t, k = 0;
  858|   178k|  WORD32 num_bits = 0, code = 0, tmp;
  859|   178k|  WORD32 t_left, t_right;
  860|   178k|  WORD32 time_delta_left, time_delta_right;
  861|   178k|  WORD32 restart = TRUE;
  ------------------
  |  |   23|   178k|#define TRUE (1)
  ------------------
  862|   178k|  WORD32 num_drc_gain_values = pstr_drc_group->n_gain_values;
  863|       |
  864|   178k|  FLOAT32 slope;
  865|   178k|  FLOAT32 delta_gain;
  866|   178k|  FLOAT32 gain_value_quant = 0;
  867|   178k|  FLOAT32 delta_gain_quant;
  868|   178k|  FLOAT32 max_time_deviation;
  869|   178k|  FLOAT32 drc_gain_per_sample_limited;
  870|       |
  871|   178k|  WORD32 *ptr_time_at_node = pstr_drc_group->ts_gain;
  872|   178k|  WORD32 *ptr_ts_gain_quant = pstr_drc_group->ts_gain_quant;
  873|   178k|  WORD32 *ptr_slope_code_index = pstr_drc_group->slope_code_index;
  874|   178k|  FLOAT32 *drc_gain_quant_prev = &(pstr_drc_group->drc_gain_quant_prev);
  875|   178k|  FLOAT32 *ptr_gain_at_node = pstr_drc_group->drc_gain;
  876|   178k|  FLOAT32 *ptr_slope_at_node = pstr_drc_group->slope;
  877|   178k|  FLOAT32 *ptr_slope_quant = pstr_drc_group->slope_quant;
  878|   178k|  const FLOAT32 *ptr_drc_gain_per_sample =
  879|   178k|      ptr_drc_gain_per_sample_with_prev_frame + drc_frame_size;
  880|   178k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   178k|#define IA_NO_ERROR 0x00000000
  ------------------
  881|       |
  882|   356k|  while (restart) {
  ------------------
  |  Branch (882:10): [True: 178k, False: 178k]
  ------------------
  883|   178k|    n = 0;
  884|   178k|    restart = FALSE;
  ------------------
  |  |   26|   178k|#define FALSE (0)
  ------------------
  885|  1.31M|    while ((n < num_drc_gain_values) && (restart == FALSE)) {
  ------------------
  |  |   26|  1.13M|#define FALSE (0)
  ------------------
  |  Branch (885:12): [True: 1.13M, False: 178k]
  |  Branch (885:41): [True: 1.13M, False: 0]
  ------------------
  886|  1.13M|      if (n == 0) {
  ------------------
  |  Branch (886:11): [True: 178k, False: 961k]
  ------------------
  887|   178k|        time_delta_left = ptr_time_at_node[n];
  888|   178k|        time_delta_right = ptr_time_at_node[n + 1] - ptr_time_at_node[n];
  889|   961k|      } else if (n < num_drc_gain_values - 1) {
  ------------------
  |  Branch (889:18): [True: 916k, False: 44.2k]
  ------------------
  890|   916k|        time_delta_left = ptr_time_at_node[n] - ptr_time_at_node[n - 1];
  891|   916k|        time_delta_right = ptr_time_at_node[n + 1] - ptr_time_at_node[n];
  892|   916k|      } else {
  893|  44.2k|        time_delta_left = ptr_time_at_node[n] - ptr_time_at_node[n - 1];
  894|  44.2k|        time_delta_right = drc_frame_size - ptr_time_at_node[n];
  895|  44.2k|      }
  896|  1.13M|      max_time_deviation = MAX_TIME_DEVIATION_FACTOR * MIN(time_delta_left, time_delta_right);
  ------------------
  |  |   47|  1.13M|#define MAX_TIME_DEVIATION_FACTOR (0.25f)
  ------------------
                    max_time_deviation = MAX_TIME_DEVIATION_FACTOR * MIN(time_delta_left, time_delta_right);
  ------------------
  |  |   86|  1.13M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 64.6k, False: 1.07M]
  |  |  ------------------
  ------------------
  897|  1.13M|      max_time_deviation = MAX(time_delta_min, max_time_deviation);
  ------------------
  |  |   89|  1.13M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 1.12M, False: 16.8k]
  |  |  ------------------
  ------------------
  898|       |
  899|  1.13M|      i = 0;
  900|  13.8M|      while ((i < num_gain_values_max - 2) && (ptr_delta_time_quant_table[i] < time_delta_left)) {
  ------------------
  |  Branch (900:14): [True: 13.7M, False: 133k]
  |  Branch (900:47): [True: 12.6M, False: 1.00M]
  ------------------
  901|  12.6M|        i++;
  902|  12.6M|      }
  903|  1.13M|      if (i > 0) {
  ------------------
  |  Branch (903:11): [True: 233k, False: 905k]
  ------------------
  904|   233k|        if (ptr_delta_time_quant_table[i] - time_delta_left >
  ------------------
  |  Branch (904:13): [True: 0, False: 233k]
  ------------------
  905|   233k|            time_delta_left - ptr_delta_time_quant_table[i - 1]) {
  906|      0|          i--;
  907|      0|        }
  908|   233k|        if (ptr_delta_time_quant_table[i] >= drc_frame_size) {
  ------------------
  |  Branch (908:13): [True: 0, False: 233k]
  ------------------
  909|      0|          i--;
  910|      0|        }
  911|   233k|      }
  912|  1.13M|      if (abs(ptr_delta_time_quant_table[i] - time_delta_left) > max_time_deviation) {
  ------------------
  |  Branch (912:11): [True: 0, False: 1.13M]
  ------------------
  913|      0|        if (ptr_delta_time_quant_table[i] > time_delta_left) {
  ------------------
  |  Branch (913:13): [True: 0, False: 0]
  ------------------
  914|      0|          i--;
  915|      0|        }
  916|      0|        for (k = num_drc_gain_values; k > n; k--) {
  ------------------
  |  Branch (916:39): [True: 0, False: 0]
  ------------------
  917|      0|          ptr_time_at_node[k] = ptr_time_at_node[k - 1];
  918|      0|          ptr_slope_at_node[k] = ptr_slope_at_node[k - 1];
  919|      0|          ptr_gain_at_node[k] = ptr_gain_at_node[k - 1];
  920|      0|        }
  921|      0|        if (n <= 0) {
  ------------------
  |  Branch (921:13): [True: 0, False: 0]
  ------------------
  922|      0|          ptr_time_at_node[n] = ptr_delta_time_quant_table[i];
  923|      0|        } else {
  924|      0|          ptr_time_at_node[n] = ptr_time_at_node[n - 1] + ptr_delta_time_quant_table[i];
  925|      0|        }
  926|       |
  927|      0|        t = ptr_time_at_node[n];
  928|      0|        ptr_gain_at_node[n] = ptr_drc_gain_per_sample[t];
  929|      0|        t_left = MAX(0, t - time_delta_min / 2);
  ------------------
  |  |   89|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  930|      0|        t_right = MIN(drc_frame_size, t_left + time_delta_min / 2);
  ------------------
  |  |   86|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  931|      0|        ptr_slope_at_node[n] = ptr_drc_gain_per_sample[t_right] - ptr_drc_gain_per_sample[t_left];
  932|      0|        num_drc_gain_values++;
  933|      0|        restart = TRUE;
  ------------------
  |  |   23|      0|#define TRUE (1)
  ------------------
  934|      0|      }
  935|  1.13M|      n++;
  936|  1.13M|    }
  937|   178k|  }
  938|       |
  939|   178k|  ptr_ts_gain_quant[0] =
  940|   178k|      (WORD32)(time_delta_min * (ptr_time_at_node[0] + 0.5f) / (FLOAT32)time_delta_min);
  941|   178k|  k = 1;
  942|  1.13M|  for (n = 1; n < num_drc_gain_values; n++) {
  ------------------
  |  Branch (942:15): [True: 961k, False: 178k]
  ------------------
  943|   961k|    tmp = (WORD32)(time_delta_min * (ptr_time_at_node[n] + 0.5f) / (FLOAT32)time_delta_min);
  944|   961k|    if (tmp > ptr_ts_gain_quant[k - 1]) {
  ------------------
  |  Branch (944:9): [True: 961k, False: 0]
  ------------------
  945|   961k|      ptr_ts_gain_quant[k] = tmp;
  946|   961k|      k++;
  947|   961k|    }
  948|   961k|  }
  949|       |
  950|   178k|  num_drc_gain_values = k;
  951|   178k|  pstr_drc_group->n_gain_values = num_drc_gain_values;
  952|  1.31M|  for (n = 0; n < num_drc_gain_values; n++) {
  ------------------
  |  Branch (952:15): [True: 1.13M, False: 178k]
  ------------------
  953|  1.13M|    ptr_gain_at_node[n] = ptr_drc_gain_per_sample[ptr_ts_gain_quant[n]];
  954|  1.13M|    drc_gain_per_sample_limited =
  955|  1.13M|        impd_drc_limit_drc_gain(gain_coding_profile, ptr_gain_at_node[n]);
  956|       |
  957|  1.13M|    if (n != 0) {
  ------------------
  |  Branch (957:9): [True: 961k, False: 178k]
  ------------------
  958|   961k|      delta_gain = drc_gain_per_sample_limited - *drc_gain_quant_prev;
  959|   961k|      impd_drc_get_quantized_delta_drc_gain(gain_coding_profile, delta_gain, &delta_gain_quant,
  960|   961k|                                            &num_bits, &code);
  961|   961k|      gain_value_quant = delta_gain_quant + *drc_gain_quant_prev;
  962|   961k|    } else {
  963|   178k|      err_code = impd_drc_enc_initial_gain(gain_coding_profile, drc_gain_per_sample_limited,
  964|   178k|                                           &gain_value_quant, &num_bits, &code);
  965|   178k|      if (err_code) {
  ------------------
  |  Branch (965:11): [True: 0, False: 178k]
  ------------------
  966|      0|        return err_code;
  967|      0|      }
  968|   178k|    }
  969|  1.13M|    pstr_drc_group->gain_code[n] = code;
  970|  1.13M|    pstr_drc_group->gain_code_length[n] = num_bits;
  971|  1.13M|    pstr_drc_group->drc_gain_quant[n] = gain_value_quant;
  972|  1.13M|    *drc_gain_quant_prev = gain_value_quant;
  973|       |
  974|  1.13M|    t_right = MIN(drc_frame_size - 1, ptr_ts_gain_quant[n] + time_delta_min / 2);
  ------------------
  |  |   86|  1.13M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 178k, False: 961k]
  |  |  ------------------
  ------------------
  975|  1.13M|    t_left = t_right - time_delta_min;
  976|  1.13M|    slope = ptr_drc_gain_per_sample[t_right] - ptr_drc_gain_per_sample[t_left];
  977|  1.13M|    ptr_slope_at_node[n] = slope;
  978|  1.13M|    impd_drc_quantize_slope(slope, &(ptr_slope_quant[n]), &(ptr_slope_code_index[n]));
  979|  1.13M|  }
  980|       |
  981|   178k|  pstr_drc_group->n_gain_values = num_drc_gain_values;
  982|   178k|  pstr_drc_group->gain_prev_node = ptr_gain_at_node[num_drc_gain_values - 1];
  983|   178k|  pstr_drc_group_for_output->time_quant_next = pstr_drc_group->ts_gain_quant[0] + drc_frame_size;
  984|   178k|  pstr_drc_group_for_output->slope_code_index_next = pstr_drc_group->slope_code_index[0];
  985|   178k|  pstr_drc_group_for_output->drc_gain_quant_next = pstr_drc_group->drc_gain_quant[0];
  986|   178k|  pstr_drc_group_for_output->drc_gain_quant_prev = pstr_drc_group->drc_gain_quant_prev;
  987|       |
  988|   178k|  return err_code;
  989|   178k|}
impd_drc_gain_enc.c:impd_drc_limit_drc_gain:
   50|  1.13M|static FLOAT32 impd_drc_limit_drc_gain(const WORD32 gain_coding_profile, const FLOAT32 gain) {
   51|  1.13M|  FLOAT32 limited_drc_gain;
   52|       |
   53|  1.13M|  switch (gain_coding_profile) {
   54|   242k|    case GAIN_CODING_PROFILE_CONSTANT:
  ------------------
  |  |   43|   242k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (54:5): [True: 242k, False: 896k]
  ------------------
   55|   242k|      limited_drc_gain = gain;
   56|   242k|      break;
   57|   251k|    case GAIN_CODING_PROFILE_CLIPPING:
  ------------------
  |  |   42|   251k|#define GAIN_CODING_PROFILE_CLIPPING 2
  ------------------
  |  Branch (57:5): [True: 251k, False: 888k]
  ------------------
   58|   251k|      limited_drc_gain =
   59|   251k|          MAX(MIN(MAX_DRC_GAIN_CODING_PROFILE2, gain), MIN_DRC_GAIN_CODING_PROFILE2);
  ------------------
  |  |   89|   502k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 26.5k, False: 224k]
  |  |  |  Branch (89:21): [True: 1.88k, False: 249k]
  |  |  |  Branch (89:33): [True: 1.88k, False: 24.6k]
  |  |  ------------------
  ------------------
   60|   251k|      break;
   61|  69.5k|    case GAIN_CODING_PROFILE_FADING:
  ------------------
  |  |   41|  69.5k|#define GAIN_CODING_PROFILE_FADING 1
  ------------------
  |  Branch (61:5): [True: 69.5k, False: 1.06M]
  ------------------
   62|  69.5k|      limited_drc_gain =
   63|  69.5k|          MAX(MIN(MAX_DRC_GAIN_CODING_PROFILE1, gain), MIN_DRC_GAIN_CODING_PROFILE1);
  ------------------
  |  |   89|   139k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 6.45k, False: 63.1k]
  |  |  |  Branch (89:21): [True: 2.56k, False: 67.0k]
  |  |  |  Branch (89:33): [True: 2.56k, False: 3.88k]
  |  |  ------------------
  ------------------
   64|  69.5k|      break;
   65|   576k|    case GAIN_CODING_PROFILE_REGULAR:
  ------------------
  |  |   40|   576k|#define GAIN_CODING_PROFILE_REGULAR 0
  ------------------
  |  Branch (65:5): [True: 576k, False: 563k]
  ------------------
   66|   576k|      limited_drc_gain =
   67|   576k|          MAX(MIN(MAX_DRC_GAIN_CODING_PROFILE0, gain), MIN_DRC_GAIN_CODING_PROFILE0);
  ------------------
  |  |   89|  1.15M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 551k, False: 24.6k]
  |  |  |  Branch (89:21): [True: 117k, False: 458k]
  |  |  |  Branch (89:33): [True: 117k, False: 433k]
  |  |  ------------------
  ------------------
   68|   576k|      break;
   69|      0|    default:
  ------------------
  |  Branch (69:5): [True: 0, False: 1.13M]
  ------------------
   70|      0|      limited_drc_gain = gain;
   71|      0|      break;
   72|  1.13M|  }
   73|       |
   74|  1.13M|  return limited_drc_gain;
   75|  1.13M|}
impd_drc_gain_enc.c:impd_drc_get_quantized_delta_drc_gain:
   80|  1.59M|                                                  WORD32 *gain_code) {
   81|  1.59M|  LOOPIDX idx;
   82|  1.59M|  WORD32 num_entries, opt_index;
   83|  1.59M|  WORD32 min_pos_diff_idx = 0;
   84|  1.59M|  WORD32 min_neg_diff_idx = 0;
   85|  1.59M|  FLOAT32 difference;
   86|  1.59M|  FLOAT32 min_pos_diff = 1000.0f;
   87|  1.59M|  FLOAT32 min_neg_diff = -1000.0f;
   88|  1.59M|  ia_drc_delta_gain_code_entry_struct const *pstr_delta_gain_code_table;
   89|       |
   90|  1.59M|  impd_drc_get_delta_gain_code_table(gain_coding_profile, &pstr_delta_gain_code_table,
   91|  1.59M|                                     &num_entries);
   92|  47.5M|  for (idx = 0; idx < num_entries; idx++) {
  ------------------
  |  Branch (92:17): [True: 46.0M, False: 1.59M]
  ------------------
   93|  46.0M|    difference = delta_gain - pstr_delta_gain_code_table[idx].value;
   94|  46.0M|    if (difference <= 0.0f) {
  ------------------
  |  Branch (94:9): [True: 16.8M, False: 29.1M]
  ------------------
   95|  16.8M|      if (difference > min_neg_diff) {
  ------------------
  |  Branch (95:11): [True: 3.10M, False: 13.7M]
  ------------------
   96|  3.10M|        min_neg_diff = difference;
   97|  3.10M|        min_neg_diff_idx = idx;
   98|  3.10M|      }
   99|  29.1M|    } else {
  100|  29.1M|      if (difference < min_pos_diff) {
  ------------------
  |  Branch (100:11): [True: 5.15M, False: 24.0M]
  ------------------
  101|  5.15M|        min_pos_diff = difference;
  102|  5.15M|        min_pos_diff_idx = idx;
  103|  5.15M|      }
  104|  29.1M|    }
  105|  46.0M|  }
  106|  1.59M|  if (min_pos_diff >= -min_neg_diff) {
  ------------------
  |  Branch (106:7): [True: 1.20M, False: 390k]
  ------------------
  107|  1.20M|    opt_index = min_neg_diff_idx;
  108|  1.20M|  } else {
  109|   390k|    opt_index = min_pos_diff_idx;
  110|   390k|  }
  111|       |
  112|  1.59M|  *delta_gain_quant = pstr_delta_gain_code_table[opt_index].value;
  113|  1.59M|  *num_bits = pstr_delta_gain_code_table[opt_index].size;
  114|  1.59M|  *gain_code = pstr_delta_gain_code_table[opt_index].code;
  115|  1.59M|}
impd_drc_gain_enc.c:impd_drc_quantize_slope:
  221|  1.13M|                                    WORD32 *slope_code_index) {
  222|  1.13M|  LOOPIDX idx = 0;
  223|  1.13M|  const ia_drc_slope_code_table_entry_struct *pstr_slope_code_table =
  224|  1.13M|      impd_drc_get_slope_code_table_by_value();
  225|       |
  226|  9.39M|  while ((idx < 14) && (slope > pstr_slope_code_table[idx].value)) {
  ------------------
  |  Branch (226:10): [True: 9.09M, False: 305k]
  |  Branch (226:24): [True: 8.25M, False: 833k]
  ------------------
  227|  8.25M|    idx++;
  228|  8.25M|  }
  229|  1.13M|  if (idx > 0 && ((pstr_slope_code_table[idx].value - slope) >
  ------------------
  |  Branch (229:7): [True: 947k, False: 191k]
  |  Branch (229:18): [True: 298k, False: 648k]
  ------------------
  230|   947k|                  (slope - pstr_slope_code_table[idx - 1].value))) {
  231|   298k|    idx--;
  232|   298k|  }
  233|       |
  234|  1.13M|  *slope_quant = pstr_slope_code_table[idx].value;
  235|  1.13M|  *slope_code_index = pstr_slope_code_table[idx].index;
  236|  1.13M|}
impd_drc_gain_enc.c:impd_drc_post_process_nodes:
  395|   178k|    ia_drc_gain_seq_buf_struct *pstr_drc_gain_seq_buf, VOID *pstr_scratch) {
  396|   178k|  LOOPIDX k, n;
  397|   178k|  WORD32 time_mandatory_node;
  398|   178k|  WORD32 n_removed, move_on;
  399|   178k|  WORD32 idx_left, idx_right;
  400|   178k|  WORD32 idx_0, idx_1, idx_2, idx_3;
  401|   178k|  WORD32 left, mid, right;
  402|   178k|  WORD32 overshoot_right, overshoot_left;
  403|   178k|  WORD32 cod_slope_zero = 0x7;
  404|   178k|  WORD32 slope_changed = TRUE;
  ------------------
  |  |   23|   178k|#define TRUE (1)
  ------------------
  405|   178k|  WORD32 repeat_check = TRUE;
  ------------------
  |  |   23|   178k|#define TRUE (1)
  ------------------
  406|   178k|  WORD32 time_prev = -1;
  407|   178k|  WORD32 time_delta_min = pstr_gain_enc->delta_tmin;
  408|       |
  409|   178k|  FLOAT32 delta_gain;
  410|   178k|  FLOAT32 delta_gain_quant;
  411|   178k|  FLOAT32 gain_value_quant = 0;
  412|   178k|  FLOAT32 slope_average;
  413|   178k|  FLOAT32 slope_of_nodes_left;
  414|   178k|  FLOAT32 slope_of_nodes_right;
  415|   178k|  FLOAT32 thr_low, thr_high;
  416|   178k|  FLOAT32 delta_left, delta_right;
  417|   178k|  FLOAT32 slope_0, slope_1, slope_2;
  418|   178k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   178k|#define IA_NO_ERROR 0x00000000
  ------------------
  419|       |
  420|   178k|  const ia_drc_slope_code_table_entry_struct *pstr_slope_code_table;
  421|   178k|  ia_drc_group_for_output_struct *pstr_drc_group_for_output =
  422|   178k|      &(pstr_drc_gain_seq_buf->str_drc_group_for_output);
  423|   178k|  WORD32 num_gain_values = pstr_drc_group_for_output->n_gain_values;
  424|   178k|  FLOAT32 drc_gain_quant_prev = pstr_drc_group_for_output->drc_gain_quant_prev;
  425|       |
  426|   178k|  iusace_scratch_mem *ptr_scratch = (iusace_scratch_mem *)(pstr_scratch);
  427|   178k|  FLOAT32 *ptr_gain_buf = (FLOAT32 *)((UWORD8 *)ptr_scratch->ptr_drc_scratch_buf);
  428|   178k|  WORD32 *ptr_time_buf =
  429|   178k|      (WORD32 *)(((UWORD8 *)ptr_gain_buf) + (N_UNIDRC_GAIN_MAX + 2) * sizeof(ptr_gain_buf[0]));
  ------------------
  |  |   24|   178k|#define N_UNIDRC_GAIN_MAX (MAX_NODE_COUNT)
  |  |  ------------------
  |  |  |  |   35|   178k|#define MAX_NODE_COUNT (MAX_DRC_CODEC_FRAME_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   178k|#define MAX_DRC_CODEC_FRAME_SIZE (MAX_AUDIO_CODEC_FRAME_SIZE / 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   33|   178k|#define MAX_AUDIO_CODEC_FRAME_SIZE (2048)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|   178k|  WORD32 *ptr_slope_code_index_buf =
  431|   178k|      (WORD32 *)(((UWORD8 *)ptr_time_buf) + (N_UNIDRC_GAIN_MAX + 2) * sizeof(ptr_time_buf[0]));
  ------------------
  |  |   24|   178k|#define N_UNIDRC_GAIN_MAX (MAX_NODE_COUNT)
  |  |  ------------------
  |  |  |  |   35|   178k|#define MAX_NODE_COUNT (MAX_DRC_CODEC_FRAME_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   178k|#define MAX_DRC_CODEC_FRAME_SIZE (MAX_AUDIO_CODEC_FRAME_SIZE / 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   33|   178k|#define MAX_AUDIO_CODEC_FRAME_SIZE (2048)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|   178k|  WORD32 *ptr_remove = (WORD32 *)(((UWORD8 *)ptr_slope_code_index_buf) +
  433|   178k|                                  (N_UNIDRC_GAIN_MAX + 2) * sizeof(ptr_slope_code_index_buf[0]));
  ------------------
  |  |   24|   178k|#define N_UNIDRC_GAIN_MAX (MAX_NODE_COUNT)
  |  |  ------------------
  |  |  |  |   35|   178k|#define MAX_NODE_COUNT (MAX_DRC_CODEC_FRAME_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   178k|#define MAX_DRC_CODEC_FRAME_SIZE (MAX_AUDIO_CODEC_FRAME_SIZE / 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   33|   178k|#define MAX_AUDIO_CODEC_FRAME_SIZE (2048)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|       |
  435|   178k|  if (pstr_drc_gain_seq_buf->str_gain_set_params.full_frame != 1) {
  ------------------
  |  Branch (435:7): [True: 110k, False: 67.0k]
  ------------------
  436|   110k|    time_mandatory_node = 99999999;
  437|   110k|  } else {
  438|  67.0k|    time_mandatory_node = pstr_gain_enc->drc_frame_size - 1;
  439|  67.0k|  }
  440|       |
  441|   178k|  ptr_time_buf[0] = pstr_drc_group_for_output->time_quant_prev;
  442|   178k|  ptr_gain_buf[0] = pstr_drc_group_for_output->drc_gain_quant_prev;
  443|  1.30M|  for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (443:15): [True: 1.12M, False: 178k]
  ------------------
  444|  1.12M|    ptr_time_buf[k + 1] = pstr_drc_group_for_output->ts_gain_quant[k];
  445|  1.12M|    ptr_gain_buf[k + 1] = pstr_drc_group_for_output->drc_gain_quant[k];
  446|  1.12M|  }
  447|   178k|  ptr_time_buf[k + 1] = pstr_drc_group_for_output->time_quant_next;
  448|   178k|  ptr_gain_buf[k + 1] = pstr_drc_group_for_output->drc_gain_quant_next;
  449|       |
  450|   178k|  if (num_gain_values > 1) {
  ------------------
  |  Branch (450:7): [True: 43.7k, False: 134k]
  ------------------
  451|  43.7k|    idx_left = 0;
  452|  43.7k|    idx_right = 2;
  453|  43.7k|    n_removed = 0;
  454|  1.12M|    for (k = 0; k <= num_gain_values + 1; k++) {
  ------------------
  |  Branch (454:17): [True: 1.07M, False: 43.7k]
  ------------------
  455|  1.07M|      ptr_remove[k] = FALSE;
  ------------------
  |  |   26|  1.07M|#define FALSE (0)
  ------------------
  456|  1.07M|    }
  457|  1.03M|    while (idx_right <= num_gain_values + 1) {
  ------------------
  |  Branch (457:12): [True: 991k, False: 43.7k]
  ------------------
  458|   991k|      if ((ptr_gain_buf[idx_left] == ptr_gain_buf[idx_right - 1]) &&
  ------------------
  |  Branch (458:11): [True: 342k, False: 648k]
  ------------------
  459|   342k|          (ptr_gain_buf[idx_right - 1] == ptr_gain_buf[idx_right]) &&
  ------------------
  |  Branch (459:11): [True: 314k, False: 27.7k]
  ------------------
  460|   314k|          (num_gain_values - n_removed > 1) &&
  ------------------
  |  Branch (460:11): [True: 307k, False: 6.81k]
  ------------------
  461|   307k|          (ptr_time_buf[idx_right - 1] != time_mandatory_node)) {
  ------------------
  |  Branch (461:11): [True: 305k, False: 1.82k]
  ------------------
  462|   305k|        ptr_remove[idx_right - 1] = TRUE;
  ------------------
  |  |   23|   305k|#define TRUE (1)
  ------------------
  463|   305k|        idx_right++;
  464|   305k|        n_removed++;
  465|   685k|      } else {
  466|   685k|        idx_left = idx_right - 1;
  467|   685k|        idx_right++;
  468|   685k|      }
  469|   991k|    }
  470|       |
  471|  43.7k|    n = 1;
  472|  1.07M|    for (k = 1; k <= num_gain_values + 1; k++) {
  ------------------
  |  Branch (472:17): [True: 1.03M, False: 43.7k]
  ------------------
  473|  1.03M|      if (!ptr_remove[k]) {
  ------------------
  |  Branch (473:11): [True: 729k, False: 305k]
  ------------------
  474|   729k|        ptr_time_buf[n] = ptr_time_buf[k];
  475|   729k|        ptr_gain_buf[n] = ptr_gain_buf[k];
  476|   729k|        n++;
  477|   729k|      }
  478|  1.03M|    }
  479|       |
  480|  43.7k|    n = 0;
  481|  1.03M|    for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (481:17): [True: 991k, False: 43.7k]
  ------------------
  482|   991k|      if (!ptr_remove[k + 1]) {
  ------------------
  |  Branch (482:11): [True: 685k, False: 305k]
  ------------------
  483|   685k|        pstr_drc_group_for_output->ts_gain_quant[n] = pstr_drc_group_for_output->ts_gain_quant[k];
  484|   685k|        pstr_drc_group_for_output->time_delta_quant[n] =
  485|   685k|            pstr_drc_group_for_output->time_delta_quant[k];
  486|   685k|        pstr_drc_group_for_output->slope_quant[n] = pstr_drc_group_for_output->slope_quant[k];
  487|   685k|        pstr_drc_group_for_output->slope_code_index[n] =
  488|   685k|            pstr_drc_group_for_output->slope_code_index[k];
  489|   685k|        pstr_drc_group_for_output->gain_code[n] = pstr_drc_group_for_output->gain_code[k];
  490|   685k|        pstr_drc_group_for_output->gain_code_length[n] =
  491|   685k|            pstr_drc_group_for_output->gain_code_length[k];
  492|   685k|        pstr_drc_group_for_output->drc_gain_quant[n] =
  493|   685k|            pstr_drc_group_for_output->drc_gain_quant[k];
  494|   685k|        n++;
  495|   685k|      }
  496|   991k|    }
  497|  43.7k|    num_gain_values = n;
  498|  43.7k|  }
  499|       |
  500|   178k|  if (num_gain_values > 2) {
  ------------------
  |  Branch (500:7): [True: 34.2k, False: 143k]
  ------------------
  501|  34.2k|    move_on = FALSE;
  ------------------
  |  |   26|  34.2k|#define FALSE (0)
  ------------------
  502|  34.2k|    idx_0 = 0;
  503|  34.2k|    idx_1 = 1;
  504|  34.2k|    idx_2 = 2;
  505|  34.2k|    idx_3 = 3;
  506|  34.2k|    n_removed = 0;
  507|   777k|    for (k = 0; k <= num_gain_values + 1; k++) {
  ------------------
  |  Branch (507:17): [True: 742k, False: 34.2k]
  ------------------
  508|   742k|      ptr_remove[k] = FALSE;
  ------------------
  |  |   26|   742k|#define FALSE (0)
  ------------------
  509|   742k|    }
  510|   673k|    while (idx_3 < num_gain_values + 1) {
  ------------------
  |  Branch (510:12): [True: 639k, False: 34.2k]
  ------------------
  511|   639k|      if (move_on) {
  ------------------
  |  Branch (511:11): [True: 603k, False: 35.7k]
  ------------------
  512|   603k|        move_on = FALSE;
  ------------------
  |  |   26|   603k|#define FALSE (0)
  ------------------
  513|   603k|        idx_0 = idx_1;
  514|   603k|        idx_1 = idx_2;
  515|   603k|        idx_2 = idx_3;
  516|   603k|        idx_3++;
  517|   603k|      }
  518|   639k|      if (ptr_gain_buf[idx_1] != ptr_gain_buf[idx_2]) {
  ------------------
  |  Branch (518:11): [True: 613k, False: 25.3k]
  ------------------
  519|   613k|        move_on = TRUE;
  ------------------
  |  |   23|   613k|#define TRUE (1)
  ------------------
  520|   613k|      } else {
  521|  25.3k|        delta_left = ptr_gain_buf[idx_1] - ptr_gain_buf[idx_0];
  522|  25.3k|        delta_right = ptr_gain_buf[idx_3] - ptr_gain_buf[idx_2];
  523|       |
  524|  25.3k|        if (((FLOAT32)fabs((FLOAT64)delta_left) < 0.26f) ||
  ------------------
  |  Branch (524:13): [True: 3.05k, False: 22.3k]
  ------------------
  525|  22.3k|            ((FLOAT32)fabs((FLOAT64)delta_right) < 0.26f)) {
  ------------------
  |  Branch (525:13): [True: 2.40k, False: 19.9k]
  ------------------
  526|  5.46k|          if ((delta_left > 0.0f) && (delta_right > 0.0f) &&
  ------------------
  |  Branch (526:15): [True: 2.16k, False: 3.30k]
  |  Branch (526:38): [True: 726, False: 1.43k]
  ------------------
  527|    726|              (ptr_time_buf[idx_1] != time_mandatory_node)) {
  ------------------
  |  Branch (527:15): [True: 726, False: 0]
  ------------------
  528|    726|            ptr_remove[idx_1] = TRUE;
  ------------------
  |  |   23|    726|#define TRUE (1)
  ------------------
  529|    726|            pstr_drc_group_for_output->gain_code[idx_2 - 1] =
  530|    726|                pstr_drc_group_for_output->gain_code[idx_1 - 1];
  531|    726|            pstr_drc_group_for_output->gain_code_length[idx_2 - 1] =
  532|    726|                pstr_drc_group_for_output->gain_code_length[idx_1 - 1];
  533|    726|            idx_1 = idx_2;
  534|    726|            idx_2 = idx_3;
  535|    726|            idx_3++;
  536|    726|            n_removed++;
  537|  4.74k|          } else if ((delta_left < 0.0f) && (delta_right < 0.0f) &&
  ------------------
  |  Branch (537:22): [True: 3.30k, False: 1.43k]
  |  Branch (537:45): [True: 1.99k, False: 1.30k]
  ------------------
  538|  1.99k|                     (ptr_time_buf[idx_2] != time_mandatory_node)) {
  ------------------
  |  Branch (538:22): [True: 1.65k, False: 344]
  ------------------
  539|  1.65k|            ptr_remove[idx_2] = TRUE;
  ------------------
  |  |   23|  1.65k|#define TRUE (1)
  ------------------
  540|  1.65k|            idx_2 = idx_3;
  541|  1.65k|            idx_3++;
  542|  1.65k|            n_removed++;
  543|  3.08k|          } else {
  544|  3.08k|            move_on = TRUE;
  ------------------
  |  |   23|  3.08k|#define TRUE (1)
  ------------------
  545|  3.08k|          }
  546|  19.9k|        } else {
  547|  19.9k|          move_on = TRUE;
  ------------------
  |  |   23|  19.9k|#define TRUE (1)
  ------------------
  548|  19.9k|        }
  549|  25.3k|      }
  550|   639k|    }
  551|       |
  552|  34.2k|    n = 1;
  553|   742k|    for (k = 1; k <= num_gain_values + 1; k++) {
  ------------------
  |  Branch (553:17): [True: 708k, False: 34.2k]
  ------------------
  554|   708k|      if (!ptr_remove[k]) {
  ------------------
  |  Branch (554:11): [True: 706k, False: 2.38k]
  ------------------
  555|   706k|        ptr_gain_buf[n] = ptr_gain_buf[k];
  556|   706k|        ptr_time_buf[n] = ptr_time_buf[k];
  557|   706k|        n++;
  558|   706k|      }
  559|   708k|    }
  560|       |
  561|  34.2k|    n = 0;
  562|   708k|    for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (562:17): [True: 674k, False: 34.2k]
  ------------------
  563|   674k|      if (!ptr_remove[k + 1]) {
  ------------------
  |  Branch (563:11): [True: 671k, False: 2.38k]
  ------------------
  564|   671k|        pstr_drc_group_for_output->ts_gain_quant[n] = pstr_drc_group_for_output->ts_gain_quant[k];
  565|   671k|        pstr_drc_group_for_output->time_delta_quant[n] =
  566|   671k|            pstr_drc_group_for_output->time_delta_quant[k];
  567|   671k|        pstr_drc_group_for_output->slope_quant[n] = pstr_drc_group_for_output->slope_quant[k];
  568|   671k|        pstr_drc_group_for_output->slope_code_index[n] =
  569|   671k|            pstr_drc_group_for_output->slope_code_index[k];
  570|   671k|        pstr_drc_group_for_output->gain_code[n] = pstr_drc_group_for_output->gain_code[k];
  571|   671k|        pstr_drc_group_for_output->gain_code_length[n] =
  572|   671k|            pstr_drc_group_for_output->gain_code_length[k];
  573|   671k|        pstr_drc_group_for_output->drc_gain_quant[n] =
  574|   671k|            pstr_drc_group_for_output->drc_gain_quant[k];
  575|   671k|        n++;
  576|   671k|      }
  577|   674k|    }
  578|  34.2k|    num_gain_values = n;
  579|  34.2k|  }
  580|       |
  581|   995k|  for (k = 1; k <= num_gain_values; k++) {
  ------------------
  |  Branch (581:15): [True: 817k, False: 178k]
  ------------------
  582|   817k|    if ((ptr_gain_buf[k - 1] < ptr_gain_buf[k]) && (ptr_gain_buf[k] > ptr_gain_buf[k + 1])) {
  ------------------
  |  Branch (582:9): [True: 381k, False: 436k]
  |  Branch (582:52): [True: 114k, False: 266k]
  ------------------
  583|   114k|      pstr_drc_group_for_output->slope_code_index[k - 1] = cod_slope_zero;
  584|   114k|      pstr_drc_group_for_output->slope_quant[k - 1] = 0.0f;
  585|   114k|    }
  586|   817k|    if ((ptr_gain_buf[k - 1] > ptr_gain_buf[k]) && (ptr_gain_buf[k] < ptr_gain_buf[k + 1])) {
  ------------------
  |  Branch (586:9): [True: 276k, False: 540k]
  |  Branch (586:52): [True: 120k, False: 156k]
  ------------------
  587|   120k|      pstr_drc_group_for_output->slope_code_index[k - 1] = cod_slope_zero;
  588|   120k|      pstr_drc_group_for_output->slope_quant[k - 1] = 0.0f;
  589|   120k|    }
  590|   817k|  }
  591|       |
  592|   178k|  if (ptr_gain_buf[0] == ptr_gain_buf[1]) {
  ------------------
  |  Branch (592:7): [True: 135k, False: 42.1k]
  ------------------
  593|   135k|    pstr_drc_group_for_output->slope_code_index[0] = cod_slope_zero;
  594|   135k|    pstr_drc_group_for_output->slope_quant[0] = 0.0f;
  595|   135k|  }
  596|   817k|  for (k = 0; k < num_gain_values - 1; k++) {
  ------------------
  |  Branch (596:15): [True: 639k, False: 178k]
  ------------------
  597|   639k|    if (ptr_gain_buf[k + 1] == ptr_gain_buf[k + 2]) {
  ------------------
  |  Branch (597:9): [True: 23.5k, False: 615k]
  ------------------
  598|  23.5k|      pstr_drc_group_for_output->slope_code_index[k] = cod_slope_zero;
  599|  23.5k|      pstr_drc_group_for_output->slope_code_index[k + 1] = cod_slope_zero;
  600|  23.5k|      pstr_drc_group_for_output->slope_quant[k] = 0.0f;
  601|  23.5k|      pstr_drc_group_for_output->slope_quant[k + 1] = 0.0f;
  602|  23.5k|    }
  603|   639k|  }
  604|   178k|  if (ptr_gain_buf[k + 1] == ptr_gain_buf[k + 2]) {
  ------------------
  |  Branch (604:7): [True: 146k, False: 31.6k]
  ------------------
  605|   146k|    pstr_drc_group_for_output->slope_code_index[k] = cod_slope_zero;
  606|   146k|    pstr_drc_group_for_output->slope_quant[k] = 0.0f;
  607|   146k|  }
  608|       |
  609|   178k|  ptr_slope_code_index_buf[0] = pstr_drc_group_for_output->slope_code_index_prev;
  610|   995k|  for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (610:15): [True: 817k, False: 178k]
  ------------------
  611|   817k|    ptr_slope_code_index_buf[k + 1] = pstr_drc_group_for_output->slope_code_index[k];
  612|   817k|  }
  613|   178k|  ptr_slope_code_index_buf[k + 1] = pstr_drc_group_for_output->slope_code_index_next;
  614|       |
  615|  1.35M|  for (k = 0; k <= num_gain_values + 1; k++) {
  ------------------
  |  Branch (615:15): [True: 1.17M, False: 178k]
  ------------------
  616|  1.17M|    ptr_remove[k] = FALSE;
  ------------------
  |  |   26|  1.17M|#define FALSE (0)
  ------------------
  617|  1.17M|  }
  618|       |
  619|   178k|  if (num_gain_values > 1) {
  ------------------
  |  Branch (619:7): [True: 35.8k, False: 142k]
  ------------------
  620|  35.8k|    left = 0;
  621|  35.8k|    mid = 1;
  622|  35.8k|    right = 2;
  623|  35.8k|    n_removed = 0;
  624|   710k|    while ((right <= num_gain_values + 1) && (num_gain_values - n_removed > 1)) {
  ------------------
  |  Branch (624:12): [True: 675k, False: 35.8k]
  |  Branch (624:46): [True: 675k, False: 4]
  ------------------
  625|   675k|      if (((ptr_time_buf[mid] - ptr_time_buf[left]) > 0) &&
  ------------------
  |  Branch (625:11): [True: 675k, False: 0]
  ------------------
  626|   675k|          (FLOAT32)fabs((FLOAT64)(ptr_gain_buf[left] - ptr_gain_buf[right])) <
  ------------------
  |  Branch (626:11): [True: 258k, False: 416k]
  ------------------
  627|   675k|              MAX_DRC_GAIN_DELTA_BEFORE_QUANT) {
  ------------------
  |  |   54|   675k|#define MAX_DRC_GAIN_DELTA_BEFORE_QUANT (1.0f + 0.5f * GAIN_QUANT_STEP_SIZE)
  |  |  ------------------
  |  |  |  |   51|   675k|#define GAIN_QUANT_STEP_SIZE (0.125f)
  |  |  ------------------
  ------------------
  628|   258k|        slope_of_nodes_left =
  629|   258k|            (ptr_gain_buf[mid] - ptr_gain_buf[left]) / (ptr_time_buf[mid] - ptr_time_buf[left]);
  630|   258k|        slope_of_nodes_right =
  631|   258k|            (ptr_gain_buf[right] - ptr_gain_buf[mid]) / (ptr_time_buf[right] - ptr_time_buf[mid]);
  632|       |
  633|   258k|        if (slope_of_nodes_left >= 0.0f) {
  ------------------
  |  Branch (633:13): [True: 134k, False: 124k]
  ------------------
  634|   134k|          if ((slope_of_nodes_left < slope_of_nodes_right * SLOPE_CHANGE_THR) &&
  ------------------
  |  |   48|   134k|#define SLOPE_CHANGE_THR (3.0f)
  ------------------
  |  Branch (634:15): [True: 22.6k, False: 111k]
  ------------------
  635|  22.6k|              (slope_of_nodes_left * SLOPE_CHANGE_THR > slope_of_nodes_right)) {
  ------------------
  |  |   48|  22.6k|#define SLOPE_CHANGE_THR (3.0f)
  ------------------
  |  Branch (635:15): [True: 12.6k, False: 9.98k]
  ------------------
  636|  12.6k|            slope_average = 0.5f * time_delta_min * (slope_of_nodes_left + slope_of_nodes_right);
  637|  12.6k|            thr_low = slope_average / SLOPE_QUANT_THR;
  ------------------
  |  |   49|  12.6k|#define SLOPE_QUANT_THR (8.0f)
  ------------------
  638|  12.6k|            thr_high = slope_average * SLOPE_QUANT_THR;
  ------------------
  |  |   49|  12.6k|#define SLOPE_QUANT_THR (8.0f)
  ------------------
  639|  12.6k|            slope_0 = impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[left]);
  640|  12.6k|            slope_1 = impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[mid]);
  641|  12.6k|            slope_2 = impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[right]);
  642|       |
  643|  12.6k|            if (((slope_0 < thr_high) && (slope_0 > thr_low)) &&
  ------------------
  |  Branch (643:18): [True: 12.5k, False: 112]
  |  Branch (643:42): [True: 5.58k, False: 6.95k]
  ------------------
  644|  5.58k|                ((slope_1 < thr_high) && (slope_1 > thr_low)) &&
  ------------------
  |  Branch (644:18): [True: 5.57k, False: 13]
  |  Branch (644:42): [True: 5.30k, False: 266]
  ------------------
  645|  5.30k|                ((slope_2 < thr_high) && (slope_2 > thr_low)) &&
  ------------------
  |  Branch (645:18): [True: 4.98k, False: 321]
  |  Branch (645:42): [True: 4.40k, False: 581]
  ------------------
  646|  4.40k|                (ptr_time_buf[mid] != time_mandatory_node)) {
  ------------------
  |  Branch (646:17): [True: 3.85k, False: 553]
  ------------------
  647|  3.85k|              ptr_remove[mid] = TRUE;
  ------------------
  |  |   23|  3.85k|#define TRUE (1)
  ------------------
  648|  3.85k|              n_removed++;
  649|  3.85k|              mid = right;
  650|  3.85k|              right++;
  651|  8.80k|            } else {
  652|  8.80k|              left = mid;
  653|  8.80k|              mid = right;
  654|  8.80k|              right++;
  655|  8.80k|            }
  656|   121k|          } else {
  657|   121k|            left = mid;
  658|   121k|            mid = right;
  659|   121k|            right++;
  660|   121k|          }
  661|   134k|        } else {
  662|   124k|          if ((-slope_of_nodes_left < -slope_of_nodes_right * SLOPE_CHANGE_THR) &&
  ------------------
  |  |   48|   124k|#define SLOPE_CHANGE_THR (3.0f)
  ------------------
  |  Branch (662:15): [True: 16.8k, False: 107k]
  ------------------
  663|  16.8k|              (-slope_of_nodes_left * SLOPE_CHANGE_THR > -slope_of_nodes_right)) {
  ------------------
  |  |   48|  16.8k|#define SLOPE_CHANGE_THR (3.0f)
  ------------------
  |  Branch (663:15): [True: 14.6k, False: 2.11k]
  ------------------
  664|  14.6k|            slope_average = -0.5f * time_delta_min * (slope_of_nodes_left + slope_of_nodes_right);
  665|  14.6k|            thr_low = slope_average / SLOPE_QUANT_THR;
  ------------------
  |  |   49|  14.6k|#define SLOPE_QUANT_THR (8.0f)
  ------------------
  666|  14.6k|            thr_high = slope_average * SLOPE_QUANT_THR;
  ------------------
  |  |   49|  14.6k|#define SLOPE_QUANT_THR (8.0f)
  ------------------
  667|  14.6k|            slope_0 = -impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[left]);
  668|  14.6k|            slope_1 = -impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[mid]);
  669|  14.6k|            slope_2 = -impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[right]);
  670|       |
  671|  14.6k|            if (((slope_0 < thr_high) && (slope_0 > thr_low)) &&
  ------------------
  |  Branch (671:18): [True: 14.1k, False: 563]
  |  Branch (671:42): [True: 6.55k, False: 7.57k]
  ------------------
  672|  6.55k|                ((slope_1 < thr_high) && (slope_1 > thr_low)) &&
  ------------------
  |  Branch (672:18): [True: 6.53k, False: 13]
  |  Branch (672:42): [True: 6.33k, False: 206]
  ------------------
  673|  6.33k|                ((slope_2 < thr_high) && (slope_2 > thr_low)) &&
  ------------------
  |  Branch (673:18): [True: 6.24k, False: 90]
  |  Branch (673:42): [True: 5.36k, False: 879]
  ------------------
  674|  5.36k|                (ptr_time_buf[mid] != time_mandatory_node)) {
  ------------------
  |  Branch (674:17): [True: 5.17k, False: 185]
  ------------------
  675|  5.17k|              ptr_remove[mid] = TRUE;
  ------------------
  |  |   23|  5.17k|#define TRUE (1)
  ------------------
  676|  5.17k|              n_removed++;
  677|  5.17k|              mid = right;
  678|  5.17k|              right++;
  679|  9.51k|            } else {
  680|  9.51k|              left = mid;
  681|  9.51k|              mid = right;
  682|  9.51k|              right++;
  683|  9.51k|            }
  684|   110k|          } else {
  685|   110k|            left = mid;
  686|   110k|            mid = right;
  687|   110k|            right++;
  688|   110k|          }
  689|   124k|        }
  690|   416k|      } else {
  691|   416k|        left = mid;
  692|   416k|        mid = right;
  693|   416k|        right++;
  694|   416k|      }
  695|   675k|    }
  696|       |
  697|  35.8k|    n = 1;
  698|   746k|    for (k = 1; k <= num_gain_values + 1; k++) {
  ------------------
  |  Branch (698:17): [True: 710k, False: 35.8k]
  ------------------
  699|   710k|      if (!ptr_remove[k]) {
  ------------------
  |  Branch (699:11): [True: 701k, False: 9.02k]
  ------------------
  700|   701k|        ptr_time_buf[n] = ptr_time_buf[k];
  701|   701k|        ptr_gain_buf[n] = ptr_gain_buf[k];
  702|   701k|        ptr_slope_code_index_buf[n] = ptr_slope_code_index_buf[k];
  703|   701k|        n++;
  704|   701k|      }
  705|   710k|    }
  706|       |
  707|  35.8k|    n = 0;
  708|   710k|    for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (708:17): [True: 675k, False: 35.8k]
  ------------------
  709|   675k|      if (!ptr_remove[k + 1]) {
  ------------------
  |  Branch (709:11): [True: 666k, False: 9.02k]
  ------------------
  710|   666k|        pstr_drc_group_for_output->ts_gain_quant[n] = pstr_drc_group_for_output->ts_gain_quant[k];
  711|   666k|        pstr_drc_group_for_output->time_delta_quant[n] =
  712|   666k|            pstr_drc_group_for_output->time_delta_quant[k];
  713|   666k|        pstr_drc_group_for_output->gain_code[n] = pstr_drc_group_for_output->gain_code[k];
  714|   666k|        pstr_drc_group_for_output->gain_code_length[n] =
  715|   666k|            pstr_drc_group_for_output->gain_code_length[k];
  716|   666k|        pstr_drc_group_for_output->slope_quant[n] = pstr_drc_group_for_output->slope_quant[k];
  717|   666k|        pstr_drc_group_for_output->slope_code_index[n] =
  718|   666k|            pstr_drc_group_for_output->slope_code_index[k];
  719|   666k|        pstr_drc_group_for_output->drc_gain_quant[n] =
  720|   666k|            pstr_drc_group_for_output->drc_gain_quant[k];
  721|   666k|        n++;
  722|   666k|      }
  723|   675k|    }
  724|  35.8k|    num_gain_values = n;
  725|  35.8k|  }
  726|   178k|  pstr_drc_group_for_output->n_gain_values = num_gain_values;
  727|       |
  728|   178k|  k = 0;
  729|   359k|  while (repeat_check) {
  ------------------
  |  Branch (729:10): [True: 181k, False: 178k]
  ------------------
  730|   181k|    repeat_check = FALSE;
  ------------------
  |  |   26|   181k|#define FALSE (0)
  ------------------
  731|       |
  732|  1.21M|    while (k < num_gain_values) {
  ------------------
  |  Branch (732:12): [True: 1.03M, False: 181k]
  ------------------
  733|  1.03M|      if (slope_changed) {
  ------------------
  |  Branch (733:11): [True: 227k, False: 808k]
  ------------------
  734|   227k|        slope_changed = FALSE;
  ------------------
  |  |   26|   227k|#define FALSE (0)
  ------------------
  735|   808k|      } else {
  736|   808k|        k++;
  737|   808k|      }
  738|  1.03M|      if ((ptr_slope_code_index_buf[k] != cod_slope_zero) ||
  ------------------
  |  Branch (738:11): [True: 398k, False: 637k]
  ------------------
  739|   637k|          (ptr_slope_code_index_buf[k + 1] != cod_slope_zero)) {
  ------------------
  |  Branch (739:11): [True: 209k, False: 428k]
  ------------------
  740|   607k|        impd_drc_check_overshoot(ptr_time_buf[k + 1] - ptr_time_buf[k], ptr_gain_buf[k],
  741|   607k|                                 ptr_gain_buf[k + 1],
  742|   607k|                                 impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[k]),
  743|   607k|                                 impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[k + 1]),
  744|   607k|                                 time_delta_min, &overshoot_left, &overshoot_right);
  745|       |
  746|   607k|        if (overshoot_right || overshoot_left) {
  ------------------
  |  Branch (746:13): [True: 18.9k, False: 588k]
  |  Branch (746:32): [True: 52.8k, False: 536k]
  ------------------
  747|  71.7k|          if ((k == 0) ||
  ------------------
  |  Branch (747:15): [True: 612, False: 71.1k]
  ------------------
  748|  71.1k|              (impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[k]) <
  ------------------
  |  Branch (748:15): [True: 59.6k, False: 11.4k]
  ------------------
  749|  71.1k|               impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[k + 1]))) {
  750|  60.3k|            if (ptr_slope_code_index_buf[k + 1] < cod_slope_zero) {
  ------------------
  |  Branch (750:17): [True: 44.5k, False: 15.7k]
  ------------------
  751|  44.5k|              ptr_slope_code_index_buf[k + 1] = ptr_slope_code_index_buf[k + 1] + 1;
  752|  44.5k|              slope_changed = TRUE;
  ------------------
  |  |   23|  44.5k|#define TRUE (1)
  ------------------
  753|  44.5k|            } else if (ptr_slope_code_index_buf[k + 1] > cod_slope_zero) {
  ------------------
  |  Branch (753:24): [True: 15.5k, False: 181]
  ------------------
  754|  15.5k|              ptr_slope_code_index_buf[k + 1] = ptr_slope_code_index_buf[k + 1] - 1;
  755|  15.5k|              slope_changed = TRUE;
  ------------------
  |  |   23|  15.5k|#define TRUE (1)
  ------------------
  756|  15.5k|            }
  757|  60.3k|          } else if ((k == num_gain_values) ||
  ------------------
  |  Branch (757:22): [True: 449, False: 11.0k]
  ------------------
  758|  11.0k|                     (impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[k]) >
  ------------------
  |  Branch (758:22): [True: 6.21k, False: 4.79k]
  ------------------
  759|  11.0k|                      impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[k + 1]))) {
  760|  6.66k|            if (ptr_slope_code_index_buf[k] < cod_slope_zero) {
  ------------------
  |  Branch (760:17): [True: 4.36k, False: 2.30k]
  ------------------
  761|  4.36k|              ptr_slope_code_index_buf[k] = ptr_slope_code_index_buf[k] + 1;
  762|  4.36k|              slope_changed = TRUE;
  ------------------
  |  |   23|  4.36k|#define TRUE (1)
  ------------------
  763|  4.36k|              repeat_check = TRUE;
  ------------------
  |  |   23|  4.36k|#define TRUE (1)
  ------------------
  764|  4.36k|            } else if (ptr_slope_code_index_buf[k] > cod_slope_zero) {
  ------------------
  |  Branch (764:24): [True: 2.30k, False: 0]
  ------------------
  765|  2.30k|              ptr_slope_code_index_buf[k] = ptr_slope_code_index_buf[k] - 1;
  766|  2.30k|              slope_changed = TRUE;
  ------------------
  |  |   23|  2.30k|#define TRUE (1)
  ------------------
  767|  2.30k|              repeat_check = TRUE;
  ------------------
  |  |   23|  2.30k|#define TRUE (1)
  ------------------
  768|  2.30k|            }
  769|  6.66k|          }
  770|  71.7k|        }
  771|   607k|      }
  772|  1.03M|    }
  773|   181k|  }
  774|   986k|  for (k = 0; k < num_gain_values; k++) {
  ------------------
  |  Branch (774:15): [True: 808k, False: 178k]
  ------------------
  775|   808k|    pstr_drc_group_for_output->slope_code_index[k] = ptr_slope_code_index_buf[k + 1];
  776|   808k|    pstr_drc_group_for_output->slope_quant[k] =
  777|   808k|        impd_drc_decode_slope_idx_value(ptr_slope_code_index_buf[k + 1]);
  778|   808k|  }
  779|       |
  780|   986k|  for (n = 0; n < num_gain_values; n++) {
  ------------------
  |  Branch (780:15): [True: 808k, False: 178k]
  ------------------
  781|   808k|    pstr_drc_group_for_output->time_delta_code_index[n] =
  782|   808k|        MAX((pstr_drc_group_for_output->ts_gain_quant[n] - time_prev) / time_delta_min, 1);
  ------------------
  |  |   89|   808k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 217k, False: 590k]
  |  |  ------------------
  ------------------
  783|       |
  784|   808k|    time_prev += (pstr_drc_group_for_output->time_delta_code_index[n]) * time_delta_min;
  785|       |
  786|   808k|    if (n != 0) {
  ------------------
  |  Branch (786:9): [True: 630k, False: 178k]
  ------------------
  787|   630k|      delta_gain = pstr_drc_group_for_output->drc_gain_quant[n] - drc_gain_quant_prev;
  788|   630k|      impd_drc_get_quantized_delta_drc_gain(
  789|   630k|          pstr_drc_gain_seq_buf->str_gain_set_params.gain_coding_profile, delta_gain,
  790|   630k|          &delta_gain_quant, &(pstr_drc_group_for_output->gain_code_length[n]),
  791|   630k|          &(pstr_drc_group_for_output->gain_code[n]));
  792|   630k|      gain_value_quant = delta_gain_quant + drc_gain_quant_prev;
  793|   630k|    } else {
  794|   178k|      err_code = impd_drc_enc_initial_gain(
  795|   178k|          pstr_drc_gain_seq_buf->str_gain_set_params.gain_coding_profile,
  796|   178k|          pstr_drc_group_for_output->drc_gain_quant[n], &gain_value_quant,
  797|   178k|          &(pstr_drc_group_for_output->gain_code_length[n]),
  798|   178k|          &(pstr_drc_group_for_output->gain_code[n]));
  799|   178k|      if (err_code) {
  ------------------
  |  Branch (799:11): [True: 0, False: 178k]
  ------------------
  800|      0|        return err_code;
  801|      0|      }
  802|   178k|    }
  803|   808k|    drc_gain_quant_prev = gain_value_quant;
  804|   808k|    pstr_drc_group_for_output->drc_gain_quant[n] = gain_value_quant;
  805|   808k|  }
  806|       |
  807|   178k|  pstr_drc_group_for_output->coding_mode = 1;
  808|   178k|  if (num_gain_values == 1) {
  ------------------
  |  Branch (808:7): [True: 142k, False: 35.6k]
  ------------------
  809|   142k|    if (pstr_drc_gain_seq_buf->str_gain_set_params.gain_interpolation_type !=
  ------------------
  |  Branch (809:9): [True: 28.8k, False: 113k]
  ------------------
  810|   142k|        GAIN_INTERPOLATION_TYPE_SPLINE) {
  ------------------
  |  |   45|   142k|#define GAIN_INTERPOLATION_TYPE_SPLINE 0
  ------------------
  811|  28.8k|      if (pstr_drc_group_for_output->time_delta_code_index[0] >
  ------------------
  |  Branch (811:11): [True: 0, False: 28.8k]
  ------------------
  812|  28.8k|          (pstr_gain_enc->drc_frame_size / pstr_gain_enc->delta_tmin)) {
  813|      0|        pstr_drc_group_for_output->coding_mode = 0;
  814|      0|      }
  815|   113k|    } else {
  816|   113k|      if (impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[1]) == 0.0f) {
  ------------------
  |  Branch (816:11): [True: 113k, False: 248]
  ------------------
  817|   113k|        if ((pstr_drc_group_for_output->time_delta_code_index[0] == 0) ||
  ------------------
  |  Branch (817:13): [True: 0, False: 113k]
  ------------------
  818|   113k|            (pstr_drc_group_for_output->time_delta_code_index[0] > 28)) {
  ------------------
  |  Branch (818:13): [True: 107k, False: 5.60k]
  ------------------
  819|   107k|          pstr_drc_group_for_output->coding_mode = 0;
  820|   107k|        }
  821|   113k|        if ((impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[0]) == 0.0f) &&
  ------------------
  |  Branch (821:13): [True: 111k, False: 2.18k]
  ------------------
  822|   111k|            (impd_drc_decode_slope_idx_magnitude(ptr_slope_code_index_buf[2]) == 0.0f) &&
  ------------------
  |  Branch (822:13): [True: 97.8k, False: 13.2k]
  ------------------
  823|  97.8k|            ((FLOAT32)fabs((FLOAT64)(ptr_gain_buf[1] - ptr_gain_buf[0])) < 0.126f) &&
  ------------------
  |  Branch (823:13): [True: 97.5k, False: 294]
  ------------------
  824|  97.5k|            ((FLOAT32)fabs((FLOAT64)(ptr_gain_buf[2] - ptr_gain_buf[1])) < 0.126f)) {
  ------------------
  |  Branch (824:13): [True: 97.5k, False: 0]
  ------------------
  825|  97.5k|          pstr_drc_group_for_output->coding_mode = 0;
  826|  97.5k|        }
  827|   113k|      }
  828|   113k|    }
  829|   142k|  }
  830|       |
  831|   178k|  if (pstr_drc_group_for_output->coding_mode == 1) {
  ------------------
  |  Branch (831:7): [True: 68.3k, False: 109k]
  ------------------
  832|  68.3k|    pstr_slope_code_table = impd_drc_get_slope_code_table_by_value();
  833|   766k|    for (n = 0; n < num_gain_values; n++) {
  ------------------
  |  Branch (833:17): [True: 698k, False: 68.3k]
  ------------------
  834|   698k|      pstr_drc_group_for_output->slope_code_size[n] =
  835|   698k|          pstr_slope_code_table[ptr_slope_code_index_buf[n + 1]].size;
  836|   698k|      pstr_drc_group_for_output->slope_code[n] =
  837|   698k|          pstr_slope_code_table[ptr_slope_code_index_buf[n + 1]].code;
  838|   698k|    }
  839|       |
  840|   766k|    for (n = 0; n < num_gain_values; n++) {
  ------------------
  |  Branch (840:17): [True: 698k, False: 68.3k]
  ------------------
  841|   698k|      pstr_drc_group_for_output->time_delta_code_size[n] =
  842|   698k|          pstr_delta_time_code_table[pstr_drc_group_for_output->time_delta_code_index[n]].size;
  843|   698k|      pstr_drc_group_for_output->time_delta_code[n] =
  844|   698k|          pstr_delta_time_code_table[pstr_drc_group_for_output->time_delta_code_index[n]].code;
  845|   698k|    }
  846|  68.3k|  }
  847|   178k|  return err_code;
  848|   178k|}
impd_drc_gain_enc.c:impd_drc_check_overshoot:
  120|   607k|                                     WORD32 *overshoot_left, WORD32 *overshoot_right) {
  121|   607k|  WORD32 t_connect;
  122|   607k|  FLOAT32 norm_slope_0, norm_slope_1;
  123|   607k|  FLOAT32 gain_left, gain_right;
  124|   607k|  FLOAT32 t_gain_step_inv, t_gain_step_inv_2;
  125|   607k|  FLOAT32 temp_a, temp_b, temp_c, temp_d;
  126|   607k|  FLOAT32 curve_left, curve_right;
  127|   607k|  FLOAT32 max_val, min_val;
  128|   607k|  FLOAT32 tmp, tmp2;
  129|   607k|  FLOAT32 g_extreme, t_extreme;
  130|   607k|  FLOAT32 k1, k2;
  131|   607k|  FLOAT32 slope_norm = 1.0f / (FLOAT32)time_delta_min;
  132|   607k|  FLOAT32 margin = 0.2f;
  133|   607k|  FLOAT32 step_inv_2 = ixheaace_div32(2.0f, (FLOAT32)t_gain_step);
  134|       |
  135|   607k|  *overshoot_left = FALSE;
  ------------------
  |  |   26|   607k|#define FALSE (0)
  ------------------
  136|   607k|  *overshoot_right = FALSE;
  ------------------
  |  |   26|   607k|#define FALSE (0)
  ------------------
  137|       |
  138|   607k|  gain_left = (FLOAT32)pow((FLOAT64)10.0, (FLOAT64)(0.05f * gain_0));
  139|   607k|  gain_right = (FLOAT32)pow((FLOAT64)10.0, (FLOAT64)(0.05f * gain_1));
  140|       |
  141|   607k|  norm_slope_0 = slope_0 * slope_norm * SLOPE_FACTOR_DB_TO_LINEAR * gain_left;
  ------------------
  |  |   81|   607k|#define SLOPE_FACTOR_DB_TO_LINEAR (0.1151f) /* ln(10) / 20 */
  ------------------
  142|   607k|  norm_slope_1 = slope_1 * slope_norm * SLOPE_FACTOR_DB_TO_LINEAR * gain_right;
  ------------------
  |  |   81|   607k|#define SLOPE_FACTOR_DB_TO_LINEAR (0.1151f) /* ln(10) / 20 */
  ------------------
  143|       |
  144|   607k|  if ((FLOAT32)fabs((FLOAT64)norm_slope_0) < (FLOAT32)fabs((FLOAT64)norm_slope_1)) {
  ------------------
  |  Branch (144:7): [True: 332k, False: 275k]
  ------------------
  145|   332k|    t_connect = (WORD32)(0.5f + 2.0f * (gain_left - gain_right + norm_slope_0 * t_gain_step) /
  146|   332k|                                    (norm_slope_0 - norm_slope_1));
  147|   332k|    if ((t_gain_step >= t_connect) && (t_connect > 0)) {
  ------------------
  |  Branch (147:9): [True: 223k, False: 108k]
  |  Branch (147:39): [True: 81.2k, False: 142k]
  ------------------
  148|  81.2k|      return;
  149|  81.2k|    }
  150|   332k|  } else if ((FLOAT32)fabs((FLOAT64)norm_slope_0) > (FLOAT32)fabs((FLOAT64)norm_slope_1)) {
  ------------------
  |  Branch (150:14): [True: 275k, False: 0]
  ------------------
  151|   275k|    t_connect = (WORD32)(0.5f + 2.0f * (gain_right - gain_left - norm_slope_1 * t_gain_step) /
  152|   275k|                                    (norm_slope_0 - norm_slope_1));
  153|   275k|    if ((t_connect >= 0) && (t_connect < t_gain_step)) {
  ------------------
  |  Branch (153:9): [True: 186k, False: 88.9k]
  |  Branch (153:29): [True: 63.2k, False: 123k]
  ------------------
  154|  63.2k|      return;
  155|  63.2k|    }
  156|   275k|  }
  157|       |
  158|   463k|  tmp = 1.5f * step_inv_2 * (gain_right - gain_left) - norm_slope_1 - norm_slope_0;
  159|   463k|  curve_left = step_inv_2 * (tmp - norm_slope_0);
  160|   463k|  curve_right = step_inv_2 * (norm_slope_1 - tmp);
  161|       |
  162|   463k|  tmp = -norm_slope_0 * t_gain_step - gain_left + gain_right;
  163|   463k|  if (curve_left >= 0.0f) {
  ------------------
  |  Branch (163:7): [True: 257k, False: 206k]
  ------------------
  164|   257k|    if (tmp + margin < 0.0f) {
  ------------------
  |  Branch (164:9): [True: 1.40k, False: 255k]
  ------------------
  165|  1.40k|      *overshoot_left = TRUE;
  ------------------
  |  |   23|  1.40k|#define TRUE (1)
  ------------------
  166|  1.40k|    }
  167|   257k|  } else {
  168|   206k|    if (tmp - margin > 0.0f) {
  ------------------
  |  Branch (168:9): [True: 1.37k, False: 204k]
  ------------------
  169|  1.37k|      *overshoot_left = TRUE;
  ------------------
  |  |   23|  1.37k|#define TRUE (1)
  ------------------
  170|  1.37k|    }
  171|   206k|  }
  172|   463k|  tmp = norm_slope_1 * t_gain_step - gain_right + gain_left;
  173|   463k|  if (curve_right >= 0.0f) {
  ------------------
  |  Branch (173:7): [True: 219k, False: 244k]
  ------------------
  174|   219k|    if (tmp + margin < 0.0f) {
  ------------------
  |  Branch (174:9): [True: 13.5k, False: 205k]
  ------------------
  175|  13.5k|      *overshoot_right = TRUE;
  ------------------
  |  |   23|  13.5k|#define TRUE (1)
  ------------------
  176|  13.5k|    }
  177|   244k|  } else {
  178|   244k|    if (tmp - margin > 0.0f) {
  ------------------
  |  Branch (178:9): [True: 5.36k, False: 238k]
  ------------------
  179|  5.36k|      *overshoot_right = TRUE;
  ------------------
  |  |   23|  5.36k|#define TRUE (1)
  ------------------
  180|  5.36k|    }
  181|   244k|  }
  182|       |
  183|   463k|  if ((!*overshoot_left) && (!*overshoot_right)) {
  ------------------
  |  Branch (183:7): [True: 460k, False: 2.78k]
  |  Branch (183:29): [True: 441k, False: 18.9k]
  ------------------
  184|   441k|    t_gain_step_inv = ixheaace_div32(1.0f, (FLOAT32)t_gain_step);
  185|   441k|    t_gain_step_inv_2 = t_gain_step_inv * t_gain_step_inv;
  186|   441k|    k1 = (gain_right - gain_left) * t_gain_step_inv_2;
  187|   441k|    k2 = norm_slope_1 + norm_slope_0;
  188|       |
  189|   441k|    temp_a = t_gain_step_inv * (t_gain_step_inv * k2 - 2.0f * k1);
  190|   441k|    temp_b = 3.0f * k1 - t_gain_step_inv * (k2 + norm_slope_0);
  191|   441k|    temp_c = norm_slope_0;
  192|   441k|    temp_d = gain_left;
  193|   441k|    tmp = temp_b * temp_b - 3.0f * temp_a * temp_c;
  194|       |
  195|   441k|    if (!((tmp < 0.0f) || (temp_a == 0.0f))) {
  ------------------
  |  Branch (195:11): [True: 17.7k, False: 423k]
  |  Branch (195:27): [True: 0, False: 423k]
  ------------------
  196|   423k|      max_val = MAX(gain_left, gain_right) + margin;
  ------------------
  |  |   89|   423k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 157k, False: 265k]
  |  |  ------------------
  ------------------
  197|   423k|      min_val = MIN(gain_left, gain_right) - margin;
  ------------------
  |  |   86|   423k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 245k, False: 178k]
  |  |  ------------------
  ------------------
  198|   423k|      tmp = (FLOAT32)sqrt((FLOAT64)tmp);
  199|   423k|      tmp2 = (1.0f / (3.0f * temp_a));
  200|       |
  201|   423k|      t_extreme = tmp2 * (-temp_b + tmp);
  202|   423k|      if ((t_extreme > 0.0f) && (t_extreme < t_gain_step)) {
  ------------------
  |  Branch (202:11): [True: 270k, False: 153k]
  |  Branch (202:33): [True: 161k, False: 108k]
  ------------------
  203|   161k|        g_extreme = (((temp_a * t_extreme + temp_b) * t_extreme + temp_c) * t_extreme) + temp_d;
  204|   161k|        if ((g_extreme > max_val) || (g_extreme < min_val)) {
  ------------------
  |  Branch (204:13): [True: 0, False: 161k]
  |  Branch (204:38): [True: 17.7k, False: 144k]
  ------------------
  205|  17.7k|          *overshoot_left = TRUE;
  ------------------
  |  |   23|  17.7k|#define TRUE (1)
  ------------------
  206|  17.7k|        }
  207|   161k|      }
  208|       |
  209|   423k|      t_extreme = tmp2 * (-temp_b - tmp);
  210|   423k|      if ((t_extreme > 0.0f) && (t_extreme < t_gain_step)) {
  ------------------
  |  Branch (210:11): [True: 292k, False: 131k]
  |  Branch (210:33): [True: 166k, False: 126k]
  ------------------
  211|   166k|        g_extreme = (((temp_a * t_extreme + temp_b) * t_extreme + temp_c) * t_extreme) + temp_d;
  212|   166k|        if ((g_extreme > max_val) || (g_extreme < min_val)) {
  ------------------
  |  Branch (212:13): [True: 32.9k, False: 133k]
  |  Branch (212:38): [True: 0, False: 133k]
  ------------------
  213|  32.9k|          *overshoot_left = TRUE;
  ------------------
  |  |   23|  32.9k|#define TRUE (1)
  ------------------
  214|  32.9k|        }
  215|   166k|      }
  216|   423k|    }
  217|   441k|  }
  218|   463k|}

impd_drc_write_loudness_info_set_extension:
 2907|    623|    WORD32 *ptr_bit_cnt, FLAG write_bs) {
 2908|    623|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    623|#define IA_NO_ERROR 0x00000000
  ------------------
 2909|    623|  LOOPIDX idx;
 2910|    623|  WORD32 counter = 0, version = 1;
 2911|    623|  WORD32 ext_size_bits = 0, bit_size_len = 0, bit_size = 0;
 2912|    623|  WORD32 bit_cnt_local = 0;
 2913|    623|  WORD32 bit_cnt_local_tmp = 0;
 2914|    623|  ia_drc_loudness_info_set_ext_eq_struct *pstr_loudness_info_set_ext_eq =
 2915|    623|      &pstr_loudness_info_set_extension->str_loudness_info_set_ext_eq;
 2916|    623|  ia_bit_buf_struct *ptr_bit_buf_tmp = NULL;
 2917|       |
 2918|    623|  if (write_bs) {
  ------------------
  |  Branch (2918:7): [True: 130, False: 493]
  ------------------
 2919|    130|    ptr_bit_buf_tmp = &pstr_drc_state->str_bit_buf_cfg_tmp;
 2920|       |
 2921|    130|    iusace_reset_bit_buffer(ptr_bit_buf_tmp);
 2922|    130|  }
 2923|       |
 2924|    623|  bit_cnt_local += iusace_write_bits_buf(
 2925|    623|      it_bit_buf, pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter], 4);
 2926|  1.22k|  while ((counter < 2) &&
  ------------------
  |  Branch (2926:10): [True: 1.22k, False: 0]
  ------------------
 2927|  1.22k|         (pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter] !=
  ------------------
  |  Branch (2927:10): [True: 623, False: 606]
  ------------------
 2928|  1.22k|          UNIDRC_LOUD_EXT_TERM)) {
  ------------------
  |  |   48|  1.22k|#define UNIDRC_LOUD_EXT_TERM (0x0)
  ------------------
 2929|    623|    switch (pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter]) {
 2930|    623|      case UNIDRC_LOUD_EXT_EQ: {
  ------------------
  |  |   52|    623|#define UNIDRC_LOUD_EXT_EQ (0x1)
  ------------------
  |  Branch (2930:7): [True: 623, False: 0]
  ------------------
 2931|    623|        bit_cnt_local_tmp += iusace_write_bits_buf(
 2932|    623|            ptr_bit_buf_tmp, pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count, 6);
 2933|       |
 2934|    623|        bit_cnt_local_tmp += iusace_write_bits_buf(
 2935|    623|            ptr_bit_buf_tmp, pstr_loudness_info_set_ext_eq->loudness_info_v1_count, 6);
 2936|  7.01k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count; idx++) {
  ------------------
  |  Branch (2936:23): [True: 6.39k, False: 615]
  ------------------
 2937|  6.39k|          err_code = impd_drc_write_loudness_info(
 2938|  6.39k|              ptr_bit_buf_tmp, version,
 2939|  6.39k|              &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[idx]),
 2940|  6.39k|              &bit_cnt_local_tmp);
 2941|  6.39k|          if (err_code) {
  ------------------
  |  Branch (2941:15): [True: 8, False: 6.38k]
  ------------------
 2942|      8|            return err_code;
 2943|      8|          }
 2944|  6.39k|        }
 2945|  4.82k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_count; idx++) {
  ------------------
  |  Branch (2945:23): [True: 4.21k, False: 606]
  ------------------
 2946|  4.21k|          err_code = impd_drc_write_loudness_info(
 2947|  4.21k|              ptr_bit_buf_tmp, version,
 2948|  4.21k|              &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1[idx]), &bit_cnt_local_tmp);
 2949|  4.21k|          if (err_code) {
  ------------------
  |  Branch (2949:15): [True: 9, False: 4.20k]
  ------------------
 2950|      9|            return (err_code);
 2951|      9|          }
 2952|  4.21k|        }
 2953|    615|      } break;
 2954|    606|      default:
  ------------------
  |  Branch (2954:7): [True: 0, False: 623]
  ------------------
 2955|      0|        break;
 2956|    623|    }
 2957|    606|    pstr_loudness_info_set_extension->ext_bit_size[counter] = bit_cnt_local_tmp;
 2958|    606|    bit_size = pstr_loudness_info_set_extension->ext_bit_size[counter] - 1;
 2959|    606|    ext_size_bits = (WORD32)(log((FLOAT32)bit_size) / log(2.f)) + 1;
 2960|    606|    bit_size_len = ext_size_bits - 4;
 2961|    606|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size_len, 4);
 2962|    606|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size, (UWORD8)ext_size_bits);
 2963|       |
 2964|    606|    switch (pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter]) {
 2965|    606|      case UNIDRC_LOUD_EXT_EQ: {
  ------------------
  |  |   52|    606|#define UNIDRC_LOUD_EXT_EQ (0x1)
  ------------------
  |  Branch (2965:7): [True: 606, False: 0]
  ------------------
 2966|    606|        bit_cnt_local += iusace_write_bits_buf(
 2967|    606|            it_bit_buf, pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count, 6);
 2968|       |
 2969|    606|        bit_cnt_local += iusace_write_bits_buf(
 2970|    606|            it_bit_buf, pstr_loudness_info_set_ext_eq->loudness_info_v1_count, 6);
 2971|  6.77k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count; idx++) {
  ------------------
  |  Branch (2971:23): [True: 6.16k, False: 606]
  ------------------
 2972|  6.16k|          err_code = impd_drc_write_loudness_info(
 2973|  6.16k|              it_bit_buf, version,
 2974|  6.16k|              &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[idx]), &bit_cnt_local);
 2975|  6.16k|          if (err_code) {
  ------------------
  |  Branch (2975:15): [True: 0, False: 6.16k]
  ------------------
 2976|      0|            return err_code;
 2977|      0|          }
 2978|  6.16k|        }
 2979|  4.72k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_count; idx++) {
  ------------------
  |  Branch (2979:23): [True: 4.11k, False: 606]
  ------------------
 2980|  4.11k|          err_code = impd_drc_write_loudness_info(
 2981|  4.11k|              it_bit_buf, version, &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1[idx]),
 2982|  4.11k|              &bit_cnt_local);
 2983|  4.11k|          if (err_code) {
  ------------------
  |  Branch (2983:15): [True: 0, False: 4.11k]
  ------------------
 2984|      0|            return (err_code);
 2985|      0|          }
 2986|  4.11k|        }
 2987|    606|      } break;
 2988|    606|      default:
  ------------------
  |  Branch (2988:7): [True: 0, False: 606]
  ------------------
 2989|      0|        for (idx = 0; idx < pstr_loudness_info_set_extension->ext_bit_size[counter]; idx++) {
  ------------------
  |  Branch (2989:23): [True: 0, False: 0]
  ------------------
 2990|      0|          bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 2991|      0|        }
 2992|      0|        break;
 2993|    606|    }
 2994|    606|    counter++;
 2995|       |
 2996|    606|    bit_cnt_local += iusace_write_bits_buf(
 2997|    606|        it_bit_buf, pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter], 4);
 2998|    606|  }
 2999|       |
 3000|    606|  *ptr_bit_cnt += bit_cnt_local;
 3001|       |
 3002|    606|  return IA_NO_ERROR;
  ------------------
  |  |   23|    606|#define IA_NO_ERROR 0x00000000
  ------------------
 3003|    623|}
impd_drc_write_loudness_info_set:
 3007|  4.70k|                                              FLAG write_bs) {
 3008|  4.70k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  4.70k|#define IA_NO_ERROR 0x00000000
  ------------------
 3009|  4.70k|  LOOPIDX idx;
 3010|  4.70k|  WORD32 version = 0;
 3011|  4.70k|  WORD32 bit_cnt_local = 0;
 3012|  4.70k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state->str_gain_enc;
 3013|  4.70k|  ia_drc_loudness_info_set_struct *pstr_loudness_info_set =
 3014|  4.70k|      &(pstr_gain_enc->str_loudness_info_set);
 3015|       |
 3016|  4.70k|  bit_cnt_local +=
 3017|  4.70k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info_set->loudness_info_album_count, 6);
 3018|       |
 3019|  4.70k|  bit_cnt_local +=
 3020|  4.70k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info_set->loudness_info_count, 6);
 3021|       |
 3022|  8.83k|  for (idx = 0; idx < pstr_loudness_info_set->loudness_info_album_count; idx++) {
  ------------------
  |  Branch (3022:17): [True: 4.13k, False: 4.70k]
  ------------------
 3023|  4.13k|    err_code = impd_drc_write_loudness_info(it_bit_buf, version,
 3024|  4.13k|                                            &pstr_loudness_info_set->str_loudness_info_album[idx],
 3025|  4.13k|                                            &bit_cnt_local);
 3026|  4.13k|    if (err_code) {
  ------------------
  |  Branch (3026:9): [True: 5, False: 4.12k]
  ------------------
 3027|      5|      return err_code;
 3028|      5|    }
 3029|  4.13k|  }
 3030|       |
 3031|  12.1k|  for (idx = 0; idx < pstr_loudness_info_set->loudness_info_count; idx++) {
  ------------------
  |  Branch (3031:17): [True: 7.50k, False: 4.69k]
  ------------------
 3032|  7.50k|    err_code = impd_drc_write_loudness_info(
 3033|  7.50k|        it_bit_buf, version, &pstr_loudness_info_set->str_loudness_info[idx], &bit_cnt_local);
 3034|  7.50k|    if (err_code) {
  ------------------
  |  Branch (3034:9): [True: 6, False: 7.49k]
  ------------------
 3035|      6|      return err_code;
 3036|      6|    }
 3037|  7.50k|  }
 3038|       |
 3039|  4.69k|  bit_cnt_local +=
 3040|  4.69k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info_set->loudness_info_set_ext_present, 1);
 3041|  4.69k|  if (pstr_loudness_info_set->loudness_info_set_ext_present) {
  ------------------
  |  Branch (3041:7): [True: 623, False: 4.07k]
  ------------------
 3042|    623|    err_code = impd_drc_write_loudness_info_set_extension(
 3043|    623|        pstr_drc_state, it_bit_buf, &pstr_loudness_info_set->str_loudness_info_set_extension,
 3044|    623|        &bit_cnt_local, write_bs);
 3045|    623|    if (err_code) {
  ------------------
  |  Branch (3045:9): [True: 17, False: 606]
  ------------------
 3046|     17|      return err_code;
 3047|     17|    }
 3048|    623|  }
 3049|       |
 3050|  4.68k|  *ptr_bit_cnt += bit_cnt_local;
 3051|       |
 3052|  4.68k|  return err_code;
 3053|  4.69k|}
impd_drc_write_uni_drc_config:
 3056|  2.25k|                                           FLAG write_bs) {
 3057|  2.25k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.25k|#define IA_NO_ERROR 0x00000000
  ------------------
 3058|  2.25k|  LOOPIDX idx;
 3059|  2.25k|  WORD32 version = 0;
 3060|  2.25k|  WORD32 bit_cnt_local = 0;
 3061|  2.25k|  VOID *ptr_scratch = pstr_drc_state->drc_scratch_mem;
 3062|  2.25k|  ia_bit_buf_struct *it_bit_buf = NULL;
 3063|  2.25k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state->str_gain_enc;
 3064|  2.25k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config = &(pstr_gain_enc->str_uni_drc_config);
 3065|       |
 3066|  2.25k|  if (write_bs) {
  ------------------
  |  Branch (3066:7): [True: 780, False: 1.47k]
  ------------------
 3067|    780|    it_bit_buf = &pstr_drc_state->str_bit_buf_cfg;
 3068|    780|  }
 3069|       |
 3070|  2.25k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->sample_rate_present, 1);
 3071|       |
 3072|  2.25k|  if (1 == pstr_uni_drc_config->sample_rate_present) {
  ------------------
  |  Branch (3072:7): [True: 1.74k, False: 506]
  ------------------
 3073|  1.74k|    bit_cnt_local +=
 3074|  1.74k|        iusace_write_bits_buf(it_bit_buf, (pstr_uni_drc_config->sample_rate - 1000), 18);
 3075|  1.74k|  }
 3076|       |
 3077|  2.25k|  bit_cnt_local +=
 3078|  2.25k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->downmix_instructions_count, 7);
 3079|       |
 3080|  2.25k|  bit_cnt_local +=
 3081|  2.25k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_description_basic_present, 1);
 3082|       |
 3083|  2.25k|  if (1 == pstr_uni_drc_config->drc_description_basic_present) {
  ------------------
  |  Branch (3083:7): [True: 735, False: 1.51k]
  ------------------
 3084|    735|    bit_cnt_local +=
 3085|    735|        iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_coefficients_basic_count, 3);
 3086|    735|    bit_cnt_local +=
 3087|    735|        iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_instructions_basic_count, 4);
 3088|    735|  }
 3089|       |
 3090|  2.25k|  bit_cnt_local +=
 3091|  2.25k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_coefficients_uni_drc_count, 3);
 3092|       |
 3093|  2.25k|#ifdef LOUDNESS_LEVELING_SUPPORT
 3094|  2.25k|  UWORD32 num_ducking_only_drc_sets =
 3095|  2.25k|      get_num_ducking_only_drc_sets(pstr_uni_drc_config->str_drc_instructions_uni_drc,
 3096|  2.25k|                                    pstr_uni_drc_config->drc_instructions_uni_drc_count);
 3097|  2.25k|  bit_cnt_local += iusace_write_bits_buf(
 3098|  2.25k|      it_bit_buf, pstr_uni_drc_config->drc_instructions_uni_drc_count - num_ducking_only_drc_sets,
 3099|  2.25k|      6);
 3100|       |#else
 3101|       |  bit_cnt_local +=
 3102|       |      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_instructions_uni_drc_count, 6);
 3103|       |#endif
 3104|  2.25k|  bit_cnt_local +=
 3105|  2.25k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->str_channel_layout.base_ch_count, 7);
 3106|  2.25k|  bit_cnt_local += iusace_write_bits_buf(
 3107|  2.25k|      it_bit_buf, pstr_uni_drc_config->str_channel_layout.layout_signaling_present, 1);
 3108|  2.25k|  if (1 == pstr_uni_drc_config->str_channel_layout.layout_signaling_present) {
  ------------------
  |  Branch (3108:7): [True: 195, False: 2.05k]
  ------------------
 3109|    195|    bit_cnt_local += iusace_write_bits_buf(
 3110|    195|        it_bit_buf, pstr_uni_drc_config->str_channel_layout.defined_layout, 8);
 3111|    195|    if (0 == pstr_uni_drc_config->str_channel_layout.defined_layout) {
  ------------------
  |  Branch (3111:9): [True: 15, False: 180]
  ------------------
 3112|     43|      for (idx = 0; idx < pstr_uni_drc_config->str_channel_layout.base_ch_count; idx++) {
  ------------------
  |  Branch (3112:21): [True: 28, False: 15]
  ------------------
 3113|     28|        bit_cnt_local += iusace_write_bits_buf(
 3114|     28|            it_bit_buf, pstr_uni_drc_config->str_channel_layout.speaker_position[idx], 7);
 3115|     28|      }
 3116|     15|    }
 3117|    195|  }
 3118|       |
 3119|  8.36k|  for (idx = 0; idx < pstr_uni_drc_config->downmix_instructions_count; idx++) {
  ------------------
  |  Branch (3119:17): [True: 6.11k, False: 2.25k]
  ------------------
 3120|       |    // downmixInstructions();
 3121|  6.11k|  }
 3122|       |
 3123|  2.25k|  for (idx = 0; idx < pstr_uni_drc_config->drc_coefficients_basic_count; idx++) {
  ------------------
  |  Branch (3123:17): [True: 0, False: 2.25k]
  ------------------
 3124|       |    // drcCoefficientsBasic();
 3125|      0|  }
 3126|       |
 3127|  2.25k|  for (idx = 0; idx < pstr_uni_drc_config->drc_instructions_basic_count; idx++) {
  ------------------
  |  Branch (3127:17): [True: 0, False: 2.25k]
  ------------------
 3128|       |    // drcInstructionsBasics();
 3129|      0|  }
 3130|       |
 3131|  4.97k|  for (idx = 0; idx < pstr_uni_drc_config->drc_coefficients_uni_drc_count; idx++) {
  ------------------
  |  Branch (3131:17): [True: 2.71k, False: 2.25k]
  ------------------
 3132|  2.71k|    impd_drc_write_drc_coeff_uni_drc(it_bit_buf, version,
 3133|  2.71k|                                     &(pstr_uni_drc_config->str_drc_coefficients_uni_drc[idx]),
 3134|  2.71k|                                     &bit_cnt_local);
 3135|  2.71k|  }
 3136|       |
 3137|  3.71k|  for (idx = 0; idx < pstr_uni_drc_config->drc_instructions_uni_drc_count; idx++) {
  ------------------
  |  Branch (3137:17): [True: 1.65k, False: 2.06k]
  ------------------
 3138|  1.65k|#ifdef LOUDNESS_LEVELING_SUPPORT
 3139|  1.65k|    if (idx > 0 &&
  ------------------
  |  Branch (3139:9): [True: 1.40k, False: 243]
  ------------------
 3140|  1.40k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[idx - 1].ducking_only_set_present) {
  ------------------
  |  Branch (3140:9): [True: 316, False: 1.09k]
  ------------------
 3141|    316|      continue;
 3142|    316|    }
 3143|  1.33k|#endif
 3144|  1.33k|    err_code = impd_drc_write_drc_instruct_uni_drc(
 3145|  1.33k|        it_bit_buf, version, pstr_uni_drc_config, pstr_gain_enc,
 3146|  1.33k|        &(pstr_uni_drc_config->str_drc_instructions_uni_drc[idx]), ptr_scratch, &bit_cnt_local);
 3147|  1.33k|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.33k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3147:9): [True: 186, False: 1.14k]
  ------------------
 3148|    186|      return err_code;
 3149|    186|    }
 3150|  1.33k|  }
 3151|       |
 3152|  2.06k|  bit_cnt_local +=
 3153|  2.06k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->uni_drc_config_ext_present, 1);
 3154|  2.06k|  if (pstr_uni_drc_config->uni_drc_config_ext_present) {
  ------------------
  |  Branch (3154:7): [True: 873, False: 1.19k]
  ------------------
 3155|    873|    err_code = impd_drc_write_uni_drc_config_extn(
 3156|    873|        pstr_drc_state, pstr_gain_enc, pstr_uni_drc_config,
 3157|    873|        &(pstr_uni_drc_config->str_uni_drc_config_ext), &bit_cnt_local, write_bs);
 3158|    873|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    873|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3158:9): [True: 316, False: 557]
  ------------------
 3159|    316|      return (err_code);
 3160|    316|    }
 3161|    873|  }
 3162|       |
 3163|  1.75k|  *ptr_bit_cnt += bit_cnt_local;
 3164|       |
 3165|  1.75k|  return err_code;
 3166|  2.06k|}
impd_drc_write_measured_loudness_info:
 3168|  2.72k|IA_ERRORCODE impd_drc_write_measured_loudness_info(ia_drc_enc_state *pstr_drc_state) {
 3169|       |
 3170|  2.72k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.72k|#define IA_NO_ERROR 0x00000000
  ------------------
 3171|  2.72k|  ia_bit_buf_struct *it_bit_buf_lis = &pstr_drc_state->str_bit_buf_cfg_ext;
 3172|  2.72k|  WORD32 bit_cnt_lis = 0;
 3173|  2.72k|  err_code = impd_drc_write_loudness_info_set(pstr_drc_state, it_bit_buf_lis, &bit_cnt_lis, 1);
 3174|  2.72k|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  2.72k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3174:7): [True: 0, False: 2.72k]
  ------------------
 3175|      0|    return (err_code);
 3176|      0|  }
 3177|  2.72k|  pstr_drc_state->drc_config_ext_data_size_bit = bit_cnt_lis;
 3178|       |
 3179|  2.72k|  return err_code;
 3180|  2.72k|}
impd_drc_enc_initial_gain:
 3184|   356k|                                       WORD32 *code) {
 3185|   356k|  WORD32 sign, magnitude, bits, size;
 3186|       |
 3187|   356k|  switch (gain_coding_profile) {
 3188|   101k|    case GAIN_CODING_PROFILE_CONSTANT: {
  ------------------
  |  |   43|   101k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (3188:5): [True: 101k, False: 254k]
  ------------------
 3189|   101k|      bits = 0;
 3190|   101k|      size = 0;
 3191|   101k|    } break;
 3192|  49.8k|    case GAIN_CODING_PROFILE_CLIPPING: {
  ------------------
  |  |   42|  49.8k|#define GAIN_CODING_PROFILE_CLIPPING 2
  ------------------
  |  Branch (3192:5): [True: 49.8k, False: 306k]
  ------------------
 3193|  49.8k|      if (gain_initial > -0.0625f) {
  ------------------
  |  Branch (3193:11): [True: 25.7k, False: 24.0k]
  ------------------
 3194|  25.7k|        sign = 0;
 3195|  25.7k|        *gain_initial_quant = 0.0f;
 3196|  25.7k|        bits = sign;
 3197|  25.7k|        size = 1;
 3198|  25.7k|      } else {
 3199|  24.0k|        sign = 1;
 3200|  24.0k|        gain_initial = MAX(-1000.0f, gain_initial);
  ------------------
  |  |   89|  24.0k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 24.0k]
  |  |  ------------------
  ------------------
 3201|  24.0k|        magnitude = (WORD32)(-1.0f + 0.5f - 8.0f * gain_initial);
 3202|  24.0k|        magnitude = MIN(0xFF, magnitude);
  ------------------
  |  |   86|  24.0k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 24.0k]
  |  |  ------------------
  ------------------
 3203|  24.0k|        *gain_initial_quant = -(magnitude + 1) * 0.125f;
 3204|  24.0k|        bits = (sign << 8) + magnitude;
 3205|  24.0k|        size = 9;
 3206|  24.0k|      }
 3207|  49.8k|    } break;
 3208|  17.9k|    case GAIN_CODING_PROFILE_FADING: {
  ------------------
  |  |   41|  17.9k|#define GAIN_CODING_PROFILE_FADING 1
  ------------------
  |  Branch (3208:5): [True: 17.9k, False: 338k]
  ------------------
 3209|  17.9k|      if (gain_initial > -0.0625f) {
  ------------------
  |  Branch (3209:11): [True: 6.34k, False: 11.6k]
  ------------------
 3210|  6.34k|        sign = 0;
 3211|  6.34k|        *gain_initial_quant = 0.0f;
 3212|  6.34k|        bits = sign;
 3213|  6.34k|        size = 1;
 3214|  11.6k|      } else {
 3215|  11.6k|        sign = 1;
 3216|  11.6k|        gain_initial = MAX(-1000.0f, gain_initial);
  ------------------
  |  |   89|  11.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 11.6k]
  |  |  ------------------
  ------------------
 3217|  11.6k|        magnitude = (WORD32)(-1.0f + 0.5f - 8.0f * gain_initial);
 3218|  11.6k|        magnitude = MIN(0x3FF, magnitude);
  ------------------
  |  |   86|  11.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 11.6k]
  |  |  ------------------
  ------------------
 3219|  11.6k|        *gain_initial_quant = -(magnitude + 1) * 0.125f;
 3220|  11.6k|        bits = (sign << 10) + magnitude;
 3221|  11.6k|        size = 11;
 3222|  11.6k|      }
 3223|  17.9k|    } break;
 3224|   186k|    case GAIN_CODING_PROFILE_REGULAR: {
  ------------------
  |  |   40|   186k|#define GAIN_CODING_PROFILE_REGULAR 0
  ------------------
  |  Branch (3224:5): [True: 186k, False: 169k]
  ------------------
 3225|   186k|      if (gain_initial < 0.0f) {
  ------------------
  |  Branch (3225:11): [True: 10.6k, False: 176k]
  ------------------
 3226|  10.6k|        sign = 1;
 3227|  10.6k|        gain_initial = MAX(-1000.0f, gain_initial);
  ------------------
  |  |   89|  10.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 3228|  10.6k|        magnitude = (WORD32)(0.5f - 8.0f * gain_initial);
 3229|  10.6k|        magnitude = MIN(0xFF, magnitude);
  ------------------
  |  |   86|  10.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 3230|  10.6k|        *gain_initial_quant = -magnitude * 0.125f;
 3231|   176k|      } else {
 3232|   176k|        sign = 0;
 3233|   176k|        gain_initial = MIN(1000.0f, gain_initial);
  ------------------
  |  |   86|   176k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 176k]
  |  |  ------------------
  ------------------
 3234|   176k|        magnitude = (WORD32)(0.5f + 8.0f * gain_initial);
 3235|   176k|        magnitude = MIN(0xFF, magnitude);
  ------------------
  |  |   86|   176k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 176k]
  |  |  ------------------
  ------------------
 3236|   176k|        *gain_initial_quant = magnitude * 0.125f;
 3237|   176k|      }
 3238|   186k|      bits = (sign << 8) + magnitude;
 3239|   186k|      size = 9;
 3240|   186k|    } break;
 3241|      0|    default:
  ------------------
  |  Branch (3241:5): [True: 0, False: 356k]
  ------------------
 3242|      0|      return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
 3243|   356k|  }
 3244|       |
 3245|   356k|  *code = bits;
 3246|   356k|  *code_size = size;
 3247|       |
 3248|   356k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   356k|#define IA_NO_ERROR 0x00000000
  ------------------
 3249|   356k|}
impd_drc_write_uni_drc_gain:
 3339|  75.0k|VOID impd_drc_write_uni_drc_gain(ia_drc_enc_state *pstr_drc_state, WORD32 *ptr_bit_cnt) {
 3340|  75.0k|  LOOPIDX idx;
 3341|  75.0k|  WORD32 bit_cnt_local = 0;
 3342|  75.0k|  ia_bit_buf_struct *it_bit_buf = &pstr_drc_state->str_bit_buf_out;
 3343|  75.0k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state->str_gain_enc;
 3344|  75.0k|  ia_drc_group_for_output_struct *pstr_drc_group_for_output;
 3345|  75.0k|  ia_drc_gain_set_params_struct *pstr_gain_set_params;
 3346|  75.0k|  ia_drc_uni_drc_gain_ext_struct str_uni_drc_gain_extension =
 3347|  75.0k|      pstr_drc_state->str_enc_gain_extension;
 3348|       |
 3349|   251k|  for (idx = 0; idx < pstr_gain_enc->n_sequences; idx++) {
  ------------------
  |  Branch (3349:17): [True: 176k, False: 75.0k]
  ------------------
 3350|   176k|    pstr_drc_group_for_output =
 3351|   176k|        &(pstr_gain_enc->str_drc_gain_seq_buf[idx].str_drc_group_for_output);
 3352|   176k|    pstr_gain_set_params = &(pstr_gain_enc->str_drc_gain_seq_buf[idx].str_gain_set_params);
 3353|       |
 3354|   176k|    if (pstr_gain_set_params->gain_coding_profile < GAIN_CODING_PROFILE_CONSTANT) {
  ------------------
  |  |   43|   176k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (3354:9): [True: 126k, False: 50.3k]
  ------------------
 3355|   126k|      impd_drc_write_spline_nodes(it_bit_buf, pstr_gain_enc, pstr_gain_set_params,
 3356|   126k|                                  pstr_drc_group_for_output, &bit_cnt_local);
 3357|   126k|    }
 3358|   176k|  }
 3359|       |
 3360|  75.0k|  bit_cnt_local +=
 3361|  75.0k|      iusace_write_bits_buf(it_bit_buf, str_uni_drc_gain_extension.uni_drc_gain_ext_present, 1);
 3362|  75.0k|  if (str_uni_drc_gain_extension.uni_drc_gain_ext_present) {
  ------------------
  |  Branch (3362:7): [True: 3.71k, False: 71.3k]
  ------------------
 3363|  3.71k|    impd_drc_write_uni_drc_gain_extension(it_bit_buf, &str_uni_drc_gain_extension,
 3364|  3.71k|                                          &bit_cnt_local);
 3365|  3.71k|  }
 3366|       |
 3367|  75.0k|  if (bit_cnt_local & 0x07) {
  ------------------
  |  Branch (3367:7): [True: 70.6k, False: 4.34k]
  ------------------
 3368|  70.6k|    pstr_drc_state->bit_buf_base_out[bit_cnt_local >> 3] |= 0xFF >> (bit_cnt_local & 0x07);
 3369|       |
 3370|  70.6k|    bit_cnt_local += 8 - (bit_cnt_local & 0x07);
 3371|  70.6k|  }
 3372|       |
 3373|  75.0k|  *ptr_bit_cnt += bit_cnt_local;
 3374|  75.0k|}
impd_drc_mux.c:impd_drc_write_loudness_info:
  733|  32.5k|                                                 WORD32 *ptr_bit_cnt) {
  734|  32.5k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  32.5k|#define IA_NO_ERROR 0x00000000
  ------------------
  735|  32.5k|  LOOPIDX idx;
  736|  32.5k|  WORD32 code, code_size;
  737|  32.5k|  WORD32 bit_cnt_local = 0;
  738|       |
  739|  32.5k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->drc_set_id, 6);
  740|  32.5k|  if (version >= 1) {
  ------------------
  |  Branch (740:7): [True: 20.8k, False: 11.6k]
  ------------------
  741|  20.8k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->eq_set_id, 6);
  742|  20.8k|  }
  743|  32.5k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->downmix_id, 7);
  744|       |
  745|  32.5k|  bit_cnt_local +=
  746|  32.5k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->sample_peak_level_present, 1);
  747|  32.5k|  if (pstr_loudness_info->sample_peak_level_present) {
  ------------------
  |  Branch (747:7): [True: 14.1k, False: 18.3k]
  ------------------
  748|  14.1k|    impd_drc_enc_peak(pstr_loudness_info->sample_peak_level, &code, &code_size);
  749|       |
  750|  14.1k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
  751|  14.1k|  }
  752|       |
  753|  32.5k|  bit_cnt_local +=
  754|  32.5k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->true_peak_level_present, 1);
  755|  32.5k|  if (pstr_loudness_info->true_peak_level_present) {
  ------------------
  |  Branch (755:7): [True: 12.1k, False: 20.3k]
  ------------------
  756|  12.1k|    impd_drc_enc_peak(pstr_loudness_info->true_peak_level, &code, &code_size);
  757|       |
  758|  12.1k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
  759|       |
  760|  12.1k|    bit_cnt_local += iusace_write_bits_buf(
  761|  12.1k|        it_bit_buf, pstr_loudness_info->true_peak_level_measurement_system, 4);
  762|       |
  763|  12.1k|    bit_cnt_local +=
  764|  12.1k|        iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->true_peak_level_reliability, 2);
  765|  12.1k|  }
  766|       |
  767|  32.5k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->measurement_count, 4);
  768|       |
  769|   178k|  for (idx = 0; idx < pstr_loudness_info->measurement_count; idx++) {
  ------------------
  |  Branch (769:17): [True: 146k, False: 32.5k]
  ------------------
  770|   146k|    err_code = impd_drc_write_loudness_measure(
  771|   146k|        it_bit_buf, &(pstr_loudness_info->str_loudness_measure[idx]), &bit_cnt_local);
  772|       |
  773|   146k|    if (err_code) return (err_code);
  ------------------
  |  Branch (773:9): [True: 28, False: 146k]
  ------------------
  774|   146k|  }
  775|       |
  776|  32.5k|  *ptr_bit_cnt += bit_cnt_local;
  777|       |
  778|  32.5k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  32.5k|#define IA_NO_ERROR 0x00000000
  ------------------
  779|  32.5k|}
impd_drc_mux.c:impd_drc_enc_peak:
  454|  26.3k|static VOID impd_drc_enc_peak(const FLOAT32 peak_level, WORD32 *code, WORD32 *code_size) {
  455|  26.3k|  WORD32 bits;
  456|       |
  457|  26.3k|  bits = ((WORD32)(0.5f + 32.0f * (20.0f - peak_level) + 10000.0f)) - 10000;
  458|  26.3k|  bits = MIN(0x0FFF, bits);
  ------------------
  |  |   86|  26.3k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 26.3k]
  |  |  ------------------
  ------------------
  459|  26.3k|  bits = MAX(0x1, bits);
  ------------------
  |  |   89|  26.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 16.8k, False: 9.44k]
  |  |  ------------------
  ------------------
  460|       |
  461|  26.3k|  *code = bits;
  462|  26.3k|  *code_size = 12;
  463|  26.3k|}
impd_drc_mux.c:impd_drc_write_loudness_measure:
  709|   146k|    WORD32 *ptr_bit_cnt) {
  710|   146k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   146k|#define IA_NO_ERROR 0x00000000
  ------------------
  711|   146k|  WORD32 code, code_size;
  712|   146k|  WORD32 bit_cnt_local = 0;
  713|       |
  714|   146k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_measure->method_definition, 4);
  715|       |
  716|   146k|  err_code = impd_drc_enc_method_value(pstr_loudness_measure->method_definition,
  717|   146k|                                       pstr_loudness_measure->method_value, &code_size, &code);
  718|   146k|  if (err_code) return (err_code);
  ------------------
  |  Branch (718:7): [True: 28, False: 146k]
  ------------------
  719|       |
  720|   146k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
  721|   146k|  bit_cnt_local +=
  722|   146k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_measure->measurement_system, 4);
  723|   146k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_measure->reliability, 2);
  724|       |
  725|   146k|  *ptr_bit_cnt += bit_cnt_local;
  726|       |
  727|   146k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   146k|#define IA_NO_ERROR 0x00000000
  ------------------
  728|   146k|}
impd_drc_mux.c:impd_drc_enc_method_value:
  467|   146k|                                              WORD32 *code) {
  468|   146k|  WORD32 bits;
  469|   146k|  switch (method_definition) {
  470|  74.7k|    case METHOD_DEFINITION_UNKNOWN_OTHER:
  ------------------
  |  |   23|  74.7k|#define METHOD_DEFINITION_UNKNOWN_OTHER 0
  ------------------
  |  Branch (470:5): [True: 74.7k, False: 71.5k]
  ------------------
  471|  79.1k|    case METHOD_DEFINITION_PROGRAM_LOUDNESS:
  ------------------
  |  |   24|  79.1k|#define METHOD_DEFINITION_PROGRAM_LOUDNESS 1
  ------------------
  |  Branch (471:5): [True: 4.41k, False: 141k]
  ------------------
  472|  80.2k|    case METHOD_DEFINITION_ANCHOR_LOUDNESS:
  ------------------
  |  |   25|  80.2k|#define METHOD_DEFINITION_ANCHOR_LOUDNESS 2
  ------------------
  |  Branch (472:5): [True: 1.09k, False: 145k]
  ------------------
  473|  82.0k|    case METHOD_DEFINITION_MAX_OF_LOUDNESS_RANGE:
  ------------------
  |  |   26|  82.0k|#define METHOD_DEFINITION_MAX_OF_LOUDNESS_RANGE 3
  ------------------
  |  Branch (473:5): [True: 1.79k, False: 144k]
  ------------------
  474|  82.4k|    case METHOD_DEFINITION_MOMENTARY_LOUDNESS_MAX:
  ------------------
  |  |   27|  82.4k|#define METHOD_DEFINITION_MOMENTARY_LOUDNESS_MAX 4
  ------------------
  |  Branch (474:5): [True: 415, False: 145k]
  ------------------
  475|  83.7k|    case METHOD_DEFINITION_SHORT_TERM_LOUDNESS_MAX:
  ------------------
  |  |   28|  83.7k|#define METHOD_DEFINITION_SHORT_TERM_LOUDNESS_MAX 5
  ------------------
  |  Branch (475:5): [True: 1.30k, False: 145k]
  ------------------
  476|  83.7k|      bits = ((WORD32)(0.5f + 4.0f * (method_value + 57.75f) + 10000.0f)) - 10000;
  477|  83.7k|      bits = MIN(0x0FF, bits);
  ------------------
  |  |   86|  83.7k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 41.0k, False: 42.7k]
  |  |  ------------------
  ------------------
  478|  83.7k|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|  83.7k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 38.8k, False: 44.9k]
  |  |  ------------------
  ------------------
  479|  83.7k|      *code_size = 8;
  480|  83.7k|      break;
  481|    855|    case METHOD_DEFINITION_LOUDNESS_RANGE:
  ------------------
  |  |   29|    855|#define METHOD_DEFINITION_LOUDNESS_RANGE 6
  ------------------
  |  Branch (481:5): [True: 855, False: 145k]
  ------------------
  482|    855|      if (method_value >= 121.0f) {
  ------------------
  |  Branch (482:11): [True: 205, False: 650]
  ------------------
  483|    205|        bits = 255;
  484|    650|      } else if (method_value > 70.0f) {
  ------------------
  |  Branch (484:18): [True: 0, False: 650]
  ------------------
  485|      0|        bits = ((WORD32)((method_value - 70.0f) + 0.5f)) + 204;
  486|    650|      } else if (method_value > 32.0f) {
  ------------------
  |  Branch (486:18): [True: 0, False: 650]
  ------------------
  487|      0|        bits = ((WORD32)(2.0f * (method_value - 32.0f) + 0.5f)) + 128;
  488|    650|      } else if (method_value >= 0.0f) {
  ------------------
  |  Branch (488:18): [True: 45, False: 605]
  ------------------
  489|     45|        bits = (WORD32)(4.0f * method_value + 0.5f);
  490|    605|      } else {
  491|    605|        bits = 0;
  492|    605|      }
  493|    855|      *code_size = 8;
  494|    855|      break;
  495|  1.21k|    case METHOD_DEFINITION_MIXING_LEVEL:
  ------------------
  |  |   30|  1.21k|#define METHOD_DEFINITION_MIXING_LEVEL 7
  ------------------
  |  Branch (495:5): [True: 1.21k, False: 145k]
  ------------------
  496|  1.21k|      bits = (WORD32)(0.5f + method_value - 80.0f);
  497|  1.21k|      bits = MIN(0x1F, bits);
  ------------------
  |  |   86|  1.21k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 1.14k, False: 73]
  |  |  ------------------
  ------------------
  498|  1.21k|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|  1.21k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 73, False: 1.14k]
  |  |  ------------------
  ------------------
  499|  1.21k|      *code_size = 5;
  500|  1.21k|      break;
  501|    592|    case METHOD_DEFINITION_ROOM_TYPE:
  ------------------
  |  |   31|    592|#define METHOD_DEFINITION_ROOM_TYPE 8
  ------------------
  |  Branch (501:5): [True: 592, False: 145k]
  ------------------
  502|    592|      bits = (WORD32)(0.5f + method_value);
  503|    592|      if (bits > 0x2) {
  ------------------
  |  Branch (503:11): [True: 28, False: 564]
  ------------------
  504|     28|        return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  505|     28|      }
  506|    564|      bits = MIN(0x2, bits);
  ------------------
  |  |   86|    564|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 564]
  |  |  ------------------
  ------------------
  507|    564|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|    564|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 546, False: 18]
  |  |  ------------------
  ------------------
  508|    564|      *code_size = 2;
  509|    564|      break;
  510|  59.8k|    case METHOD_DEFINITION_SHORT_TERM_LOUDNESS:
  ------------------
  |  |   32|  59.8k|#define METHOD_DEFINITION_SHORT_TERM_LOUDNESS 9
  ------------------
  |  Branch (510:5): [True: 59.8k, False: 86.4k]
  ------------------
  511|  59.8k|      bits = ((WORD32)(0.5f + 2.0f * (method_value + 116.f) + 10000.0f)) - 10000;
  512|  59.8k|      bits = MIN(0x0FF, bits);
  ------------------
  |  |   86|  59.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 44.1k, False: 15.6k]
  |  |  ------------------
  ------------------
  513|  59.8k|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|  59.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 59.8k]
  |  |  ------------------
  ------------------
  514|  59.8k|      *code_size = 8;
  515|  59.8k|      break;
  516|      0|    default: {
  ------------------
  |  Branch (516:5): [True: 0, False: 146k]
  ------------------
  517|      0|      return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  518|    592|    }
  519|   146k|  }
  520|   146k|  *code = bits;
  521|       |
  522|   146k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   146k|#define IA_NO_ERROR 0x00000000
  ------------------
  523|   146k|}
impd_drc_mux.c:get_num_ducking_only_drc_sets:
 1105|  3.59k|    UWORD32 drc_intructions_uni_drc_count) {
 1106|  3.59k|  UWORD32 num_ducking_only_drc_sets = 0;
 1107|  10.9k|  for (UWORD16 i = 0; i < drc_intructions_uni_drc_count; i++) {
  ------------------
  |  Branch (1107:23): [True: 7.33k, False: 3.59k]
  ------------------
 1108|  7.33k|    if (pstr_drc_instructions_uni_drc[i].ducking_only_set_present) {
  ------------------
  |  Branch (1108:9): [True: 1.12k, False: 6.20k]
  ------------------
 1109|  1.12k|      num_ducking_only_drc_sets++;
 1110|  1.12k|    }
 1111|  7.33k|  }
 1112|       |
 1113|  3.59k|  return num_ducking_only_drc_sets;
 1114|  3.59k|}
impd_drc_mux.c:impd_drc_write_drc_coeff_uni_drc:
 1391|  4.90k|    ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc, WORD32 *ptr_bit_cnt) {
 1392|  4.90k|  LOOPIDX idx;
 1393|  4.90k|  WORD32 bit_cnt_local = 0;
 1394|       |
 1395|  4.90k|  bit_cnt_local +=
 1396|  4.90k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->drc_location, 4);
 1397|       |
 1398|  4.90k|  bit_cnt_local +=
 1399|  4.90k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->drc_frame_size_present, 1);
 1400|       |
 1401|  4.90k|  if (pstr_drc_coefficients_uni_drc->drc_frame_size_present) {
  ------------------
  |  Branch (1401:7): [True: 135, False: 4.77k]
  ------------------
 1402|    135|    bit_cnt_local += iusace_write_bits_buf(
 1403|    135|        it_bit_buf, (pstr_drc_coefficients_uni_drc->drc_frame_size - 1), 15);
 1404|    135|  }
 1405|       |
 1406|  4.90k|  if (version != 1) {
  ------------------
  |  Branch (1406:7): [True: 2.71k, False: 2.19k]
  ------------------
 1407|  2.71k|    bit_cnt_local +=
 1408|  2.71k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->gain_set_count, 6);
 1409|       |
 1410|  7.64k|    for (idx = 0; idx < pstr_drc_coefficients_uni_drc->gain_set_count; idx++) {
  ------------------
  |  Branch (1410:19): [True: 4.92k, False: 2.71k]
  ------------------
 1411|  4.92k|      impd_drc_write_gain_set_params(it_bit_buf, version,
 1412|  4.92k|                                     &(pstr_drc_coefficients_uni_drc->str_gain_set_params[idx]),
 1413|  4.92k|                                     &bit_cnt_local);
 1414|  4.92k|    }
 1415|  2.71k|  } else {
 1416|  2.19k|    bit_cnt_local += iusace_write_bits_buf(
 1417|  2.19k|        it_bit_buf, pstr_drc_coefficients_uni_drc->drc_characteristic_left_present, 1);
 1418|  2.19k|    if (pstr_drc_coefficients_uni_drc->drc_characteristic_left_present) {
  ------------------
  |  Branch (1418:9): [True: 0, False: 2.19k]
  ------------------
 1419|      0|      bit_cnt_local += iusace_write_bits_buf(
 1420|      0|          it_bit_buf, pstr_drc_coefficients_uni_drc->characteristic_left_count, 4);
 1421|       |
 1422|      0|      for (idx = 1; idx <= pstr_drc_coefficients_uni_drc->characteristic_left_count; idx++) {
  ------------------
  |  Branch (1422:21): [True: 0, False: 0]
  ------------------
 1423|      0|        impd_drc_write_split_drc_characteristic(
 1424|      0|            it_bit_buf, LEFT_SIDE,
  ------------------
  |  |   51|      0|#define LEFT_SIDE 0
  ------------------
 1425|      0|            &pstr_drc_coefficients_uni_drc->str_split_characteristic_left[idx], &bit_cnt_local);
 1426|      0|      }
 1427|      0|    }
 1428|       |
 1429|  2.19k|    bit_cnt_local += iusace_write_bits_buf(
 1430|  2.19k|        it_bit_buf, pstr_drc_coefficients_uni_drc->drc_characteristic_right_present, 1);
 1431|  2.19k|    if (pstr_drc_coefficients_uni_drc->drc_characteristic_right_present) {
  ------------------
  |  Branch (1431:9): [True: 0, False: 2.19k]
  ------------------
 1432|      0|      bit_cnt_local += iusace_write_bits_buf(
 1433|      0|          it_bit_buf, pstr_drc_coefficients_uni_drc->characteristic_right_count, 4);
 1434|      0|      for (idx = 1; idx <= pstr_drc_coefficients_uni_drc->characteristic_right_count; idx++) {
  ------------------
  |  Branch (1434:21): [True: 0, False: 0]
  ------------------
 1435|      0|        impd_drc_write_split_drc_characteristic(
 1436|      0|            it_bit_buf, RIGHT_SIDE,
  ------------------
  |  |   52|      0|#define RIGHT_SIDE 1
  ------------------
 1437|      0|            &pstr_drc_coefficients_uni_drc->str_split_characteristic_right[idx], &bit_cnt_local);
 1438|      0|      }
 1439|      0|    }
 1440|       |
 1441|  2.19k|    bit_cnt_local += iusace_write_bits_buf(
 1442|  2.19k|        it_bit_buf, pstr_drc_coefficients_uni_drc->shape_filters_present, 1);
 1443|  2.19k|    if (pstr_drc_coefficients_uni_drc->shape_filters_present) {
  ------------------
  |  Branch (1443:9): [True: 0, False: 2.19k]
  ------------------
 1444|      0|      bit_cnt_local +=
 1445|      0|          iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->shape_filter_count, 4);
 1446|      0|      for (idx = 1; idx <= pstr_drc_coefficients_uni_drc->shape_filter_count; idx++) {
  ------------------
  |  Branch (1446:21): [True: 0, False: 0]
  ------------------
 1447|      0|        impd_drc_write_shape_filter_block_params(
 1448|      0|            it_bit_buf, &pstr_drc_coefficients_uni_drc->str_shape_filter_block_params[idx],
 1449|      0|            &bit_cnt_local);
 1450|      0|      }
 1451|      0|    }
 1452|       |
 1453|  2.19k|    bit_cnt_local +=
 1454|  2.19k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->gain_sequence_count, 6);
 1455|       |
 1456|  2.19k|    bit_cnt_local +=
 1457|  2.19k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->gain_set_count, 6);
 1458|       |
 1459|  7.21k|    for (idx = 0; idx < pstr_drc_coefficients_uni_drc->gain_set_count; idx++) {
  ------------------
  |  Branch (1459:19): [True: 5.02k, False: 2.19k]
  ------------------
 1460|  5.02k|      impd_drc_write_gain_set_params(it_bit_buf, version,
 1461|  5.02k|                                     &(pstr_drc_coefficients_uni_drc->str_gain_set_params[idx]),
 1462|  5.02k|                                     &bit_cnt_local);
 1463|  5.02k|    }
 1464|  2.19k|  }
 1465|       |
 1466|  4.90k|  *ptr_bit_cnt += bit_cnt_local;
 1467|  4.90k|}
impd_drc_mux.c:impd_drc_write_gain_set_params:
 1245|  9.95k|                                           WORD32 *ptr_bit_cnt) {
 1246|  9.95k|  WORD32 bit_cnt_local = 0;
 1247|       |
 1248|  9.95k|  bit_cnt_local +=
 1249|  9.95k|      iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->gain_coding_profile, 2);
 1250|       |
 1251|  9.95k|  bit_cnt_local +=
 1252|  9.95k|      iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->gain_interpolation_type, 1);
 1253|       |
 1254|  9.95k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->full_frame, 1);
 1255|       |
 1256|  9.95k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->time_alignment, 1);
 1257|       |
 1258|  9.95k|  bit_cnt_local +=
 1259|  9.95k|      iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->time_delta_min_present, 1);
 1260|       |
 1261|  9.95k|  if (pstr_gain_set_params->time_delta_min_present) {
  ------------------
  |  Branch (1261:7): [True: 4.04k, False: 5.91k]
  ------------------
 1262|  4.04k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->delta_tmin - 1, 11);
 1263|  4.04k|  }
 1264|  9.95k|  if (pstr_gain_set_params->gain_coding_profile != GAIN_CODING_PROFILE_CONSTANT) {
  ------------------
  |  |   43|  9.95k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (1264:7): [True: 7.47k, False: 2.48k]
  ------------------
 1265|  7.47k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->band_count, 4);
 1266|  7.47k|    if (pstr_gain_set_params->band_count > 1) {
  ------------------
  |  Branch (1266:9): [True: 1.23k, False: 6.23k]
  ------------------
 1267|  1.23k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->drc_band_type, 1);
 1268|  1.23k|    }
 1269|       |
 1270|  7.47k|    impd_drc_write_gain_params(it_bit_buf, version, pstr_gain_set_params->band_count,
 1271|  7.47k|                               pstr_gain_set_params->drc_band_type,
 1272|  7.47k|                               pstr_gain_set_params->gain_params, &bit_cnt_local);
 1273|  7.47k|  }
 1274|       |
 1275|  9.95k|  *ptr_bit_cnt += bit_cnt_local;
 1276|  9.95k|}
impd_drc_mux.c:impd_drc_write_gain_params:
 1185|  7.47k|                                       WORD32 *ptr_bit_cnt) {
 1186|  7.47k|  LOOPIDX idx;
 1187|  7.47k|  WORD32 bit_cnt_local = 0;
 1188|       |
 1189|  7.47k|  if (version != 1) {
  ------------------
  |  Branch (1189:7): [True: 4.30k, False: 3.16k]
  ------------------
 1190|  6.66k|    for (idx = 0; idx < band_count; idx++) {
  ------------------
  |  Branch (1190:19): [True: 2.35k, False: 4.30k]
  ------------------
 1191|  2.35k|      bit_cnt_local +=
 1192|  2.35k|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].drc_characteristic, 7);
 1193|  2.35k|    }
 1194|  4.30k|  } else {
 1195|  3.16k|    WORD32 index_present;
 1196|  3.16k|    WORD32 gain_sequence_index_last = -1;
 1197|  6.17k|    for (idx = 0; idx < band_count; idx++) {
  ------------------
  |  Branch (1197:19): [True: 3.00k, False: 3.16k]
  ------------------
 1198|  3.00k|      if (pstr_gain_params[idx].gain_sequence_index == gain_sequence_index_last + 1) {
  ------------------
  |  Branch (1198:11): [True: 3.00k, False: 0]
  ------------------
 1199|  3.00k|        index_present = 0;
 1200|  3.00k|      } else {
 1201|      0|        index_present = 1;
 1202|      0|      }
 1203|  3.00k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, index_present, 1);
 1204|       |
 1205|  3.00k|      if (index_present == 1) {
  ------------------
  |  Branch (1205:11): [True: 0, False: 3.00k]
  ------------------
 1206|      0|        bit_cnt_local +=
 1207|      0|            iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].gain_sequence_index, 6);
 1208|      0|        gain_sequence_index_last = pstr_gain_params[idx].gain_sequence_index;
 1209|      0|      }
 1210|       |
 1211|  3.00k|      bit_cnt_local +=
 1212|  3.00k|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].drc_characteristic_present, 1);
 1213|  3.00k|      if (pstr_gain_params[idx].drc_characteristic_present) {
  ------------------
  |  Branch (1213:11): [True: 0, False: 3.00k]
  ------------------
 1214|      0|        bit_cnt_local += iusace_write_bits_buf(
 1215|      0|            it_bit_buf, pstr_gain_params[idx].drc_characteristic_format_is_cicp, 1);
 1216|      0|        if (pstr_gain_params[idx].drc_characteristic_format_is_cicp == 1) {
  ------------------
  |  Branch (1216:13): [True: 0, False: 0]
  ------------------
 1217|      0|          bit_cnt_local +=
 1218|      0|              iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].drc_characteristic, 7);
 1219|      0|        } else {
 1220|      0|          bit_cnt_local += iusace_write_bits_buf(
 1221|      0|              it_bit_buf, pstr_gain_params[idx].drc_characteristic_left_index, 4);
 1222|       |
 1223|      0|          bit_cnt_local += iusace_write_bits_buf(
 1224|      0|              it_bit_buf, pstr_gain_params[idx].drc_characteristic_right_index, 4);
 1225|      0|        }
 1226|      0|      }
 1227|  3.00k|    }
 1228|  3.16k|  }
 1229|       |
 1230|  8.84k|  for (idx = 1; idx < band_count; idx++) {
  ------------------
  |  Branch (1230:17): [True: 1.37k, False: 7.47k]
  ------------------
 1231|  1.37k|    if (drc_band_type) {
  ------------------
  |  Branch (1231:9): [True: 197, False: 1.17k]
  ------------------
 1232|    197|      bit_cnt_local +=
 1233|    197|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].crossover_freq_index, 4);
 1234|  1.17k|    } else {
 1235|  1.17k|      bit_cnt_local +=
 1236|  1.17k|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].start_sub_band_index, 10);
 1237|  1.17k|    }
 1238|  1.37k|  }
 1239|       |
 1240|  7.47k|  *ptr_bit_cnt += bit_cnt_local;
 1241|  7.47k|}
impd_drc_mux.c:impd_drc_write_drc_instruct_uni_drc:
  785|  3.26k|    WORD32 *ptr_bit_cnt) {
  786|  3.26k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  3.26k|#define IA_NO_ERROR 0x00000000
  ------------------
  787|  3.26k|  LOOPIDX i, j, n;
  788|  3.26k|  WORD32 g, k, tmp, tmp_2, match, channel_count;
  789|  3.26k|  WORD32 bs_sequence_index, sequence_index_prev, repeat_sequence_count;
  790|  3.26k|  WORD32 ducking_sequence, index;
  791|  3.26k|  WORD32 repeat_parameters_count;
  792|  3.26k|  WORD32 bit_cnt_local = 0;
  793|  3.26k|  WORD32 band_count = 0;
  794|  3.26k|  WORD32 *unique_index;
  795|  3.26k|  FLOAT32 *unique_scaling;
  796|  3.26k|  FLOAT32 ducking_scaling_quantized_prev, factor;
  797|  3.26k|  ia_drc_ducking_modifiers_struct *pstr_ducking_modifiers;
  798|       |
  799|  3.26k|  bit_cnt_local +=
  800|  3.26k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_id, 6);
  801|  3.26k|  if (version == 1) {
  ------------------
  |  Branch (801:7): [True: 1.93k, False: 1.33k]
  ------------------
  802|  1.93k|    err_code = impd_drc_get_drc_complexity_level(pstr_uni_drc_config, pstr_gain_enc,
  803|  1.93k|                                                 pstr_drc_instructions_uni_drc, ptr_scratch);
  804|  1.93k|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.93k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (804:9): [True: 313, False: 1.61k]
  ------------------
  805|    313|      return (err_code);
  806|    313|    }
  807|       |
  808|  1.61k|    bit_cnt_local += iusace_write_bits_buf(
  809|  1.61k|        it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_complexity_level, 4);
  810|  1.61k|  }
  811|       |
  812|  2.95k|  unique_index = (WORD32 *)ptr_scratch;
  813|  2.95k|  unique_scaling =
  814|  2.95k|      (FLOAT32 *)((UWORD8 *)ptr_scratch + (MAX_CHANNEL_COUNT) * sizeof(unique_index[0]));
  ------------------
  |  |   25|  2.95k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  815|  2.95k|  bit_cnt_local +=
  816|  2.95k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->drc_location, 4);
  817|       |
  818|  2.95k|  if (version != 1) {
  ------------------
  |  Branch (818:7): [True: 1.33k, False: 1.61k]
  ------------------
  819|  1.33k|    pstr_drc_instructions_uni_drc->downmix_id_present = 1;
  820|  1.61k|  } else {
  821|  1.61k|    bit_cnt_local +=
  822|  1.61k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->downmix_id_present, 1);
  823|  1.61k|  }
  824|       |
  825|  2.95k|  if (pstr_drc_instructions_uni_drc->downmix_id_present != 1) {
  ------------------
  |  Branch (825:7): [True: 1.61k, False: 1.33k]
  ------------------
  826|  1.61k|    pstr_drc_instructions_uni_drc->downmix_id = 0;
  827|  1.61k|  } else {
  828|  1.33k|    bit_cnt_local +=
  829|  1.33k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->downmix_id, 7);
  830|  1.33k|    if (version == 1) {
  ------------------
  |  Branch (830:9): [True: 0, False: 1.33k]
  ------------------
  831|      0|      bit_cnt_local += iusace_write_bits_buf(
  832|      0|          it_bit_buf, pstr_drc_instructions_uni_drc->drc_apply_to_downmix, 1);
  833|      0|    }
  834|  1.33k|    bit_cnt_local += iusace_write_bits_buf(
  835|  1.33k|        it_bit_buf, pstr_drc_instructions_uni_drc->additional_downmix_id_present, 1);
  836|       |
  837|  1.33k|    if (pstr_drc_instructions_uni_drc->additional_downmix_id_present) {
  ------------------
  |  Branch (837:9): [True: 797, False: 538]
  ------------------
  838|    797|      bit_cnt_local += iusace_write_bits_buf(
  839|    797|          it_bit_buf, pstr_drc_instructions_uni_drc->additional_downmix_id_count, 3);
  840|  4.44k|      for (i = 0; i < pstr_drc_instructions_uni_drc->additional_downmix_id_count; i++) {
  ------------------
  |  Branch (840:19): [True: 3.65k, False: 797]
  ------------------
  841|  3.65k|        bit_cnt_local += iusace_write_bits_buf(
  842|  3.65k|            it_bit_buf, pstr_drc_instructions_uni_drc->additional_downmix_id[i], 7);
  843|  3.65k|      }
  844|    797|    } else {
  845|    538|      pstr_drc_instructions_uni_drc->additional_downmix_id_count = 0;
  846|    538|    }
  847|  1.33k|  }
  848|       |
  849|  2.95k|  bit_cnt_local +=
  850|  2.95k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_effect, 16);
  851|       |
  852|  2.95k|  if ((pstr_drc_instructions_uni_drc->drc_set_effect &
  ------------------
  |  Branch (852:7): [True: 1.21k, False: 1.73k]
  ------------------
  853|  2.95k|       (EFFECT_BIT_DUCK_OTHER | EFFECT_BIT_DUCK_SELF)) == 0) {
  ------------------
  |  |   37|  2.95k|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
                     (EFFECT_BIT_DUCK_OTHER | EFFECT_BIT_DUCK_SELF)) == 0) {
  ------------------
  |  |   38|  2.95k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  854|  1.21k|    bit_cnt_local += iusace_write_bits_buf(
  855|  1.21k|        it_bit_buf, pstr_drc_instructions_uni_drc->limiter_peak_target_present, 1);
  856|  1.21k|    if (pstr_drc_instructions_uni_drc->limiter_peak_target_present) {
  ------------------
  |  Branch (856:9): [True: 665, False: 551]
  ------------------
  857|    665|      tmp = (WORD32)(0.5f - 8.0f * pstr_drc_instructions_uni_drc->limiter_peak_target);
  858|    665|      tmp = MAX(0, tmp);
  ------------------
  |  |   89|    665|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 665]
  |  |  ------------------
  ------------------
  859|    665|      tmp = MIN(0xFF, tmp);
  ------------------
  |  |   86|    665|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 665]
  |  |  ------------------
  ------------------
  860|    665|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 8);
  861|    665|    }
  862|  1.21k|  }
  863|       |
  864|  2.95k|  bit_cnt_local += iusace_write_bits_buf(
  865|  2.95k|      it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_target_loudness_present, 1);
  866|       |
  867|  2.95k|  if (pstr_drc_instructions_uni_drc->drc_set_target_loudness_present == 1) {
  ------------------
  |  Branch (867:7): [True: 1.42k, False: 1.53k]
  ------------------
  868|  1.42k|    bit_cnt_local += iusace_write_bits_buf(
  869|  1.42k|        it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_upper + 63, 6);
  870|       |
  871|  1.42k|    bit_cnt_local += iusace_write_bits_buf(
  872|  1.42k|        it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower_present,
  873|  1.42k|        1);
  874|  1.42k|    if (pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower_present == 1) {
  ------------------
  |  Branch (874:9): [True: 1.19k, False: 230]
  ------------------
  875|  1.19k|      bit_cnt_local += iusace_write_bits_buf(
  876|  1.19k|          it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower + 63, 6);
  877|  1.19k|    }
  878|  1.42k|  }
  879|       |
  880|  2.95k|  bit_cnt_local += iusace_write_bits_buf(
  881|  2.95k|      it_bit_buf, pstr_drc_instructions_uni_drc->depends_on_drc_set_present, 1);
  882|       |
  883|  2.95k|  if (pstr_drc_instructions_uni_drc->depends_on_drc_set_present) {
  ------------------
  |  Branch (883:7): [True: 1.49k, False: 1.46k]
  ------------------
  884|  1.49k|    bit_cnt_local +=
  885|  1.49k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->depends_on_drc_set, 6);
  886|  1.49k|  } else {
  887|  1.46k|    bit_cnt_local +=
  888|  1.46k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->no_independent_use, 1);
  889|  1.46k|  }
  890|       |
  891|  2.95k|  if (version == 1) {
  ------------------
  |  Branch (891:7): [True: 1.61k, False: 1.33k]
  ------------------
  892|  1.61k|    bit_cnt_local +=
  893|  1.61k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->requires_eq, 1);
  894|  1.61k|  }
  895|       |
  896|  2.95k|  channel_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
  897|  2.95k|  if (pstr_drc_instructions_uni_drc->drc_set_effect &
  ------------------
  |  Branch (897:7): [True: 1.73k, False: 1.21k]
  ------------------
  898|  2.95k|      (EFFECT_BIT_DUCK_OTHER | EFFECT_BIT_DUCK_SELF)) {
  ------------------
  |  |   37|  2.95k|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
                    (EFFECT_BIT_DUCK_OTHER | EFFECT_BIT_DUCK_SELF)) {
  ------------------
  |  |   38|  2.95k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  899|  1.73k|    i = 0;
  900|  5.04k|    while (i < channel_count) {
  ------------------
  |  Branch (900:12): [True: 3.30k, False: 1.73k]
  ------------------
  901|  3.30k|      pstr_ducking_modifiers = pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel;
  902|  3.30k|      bs_sequence_index = pstr_drc_instructions_uni_drc->gain_set_index[i] + 1;
  903|       |
  904|  3.30k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bs_sequence_index, 6);
  905|       |
  906|  3.30k|      impd_drc_enc_ducking_modifiers(it_bit_buf, &(pstr_ducking_modifiers[i]), &bit_cnt_local);
  907|       |
  908|  3.30k|      sequence_index_prev = pstr_drc_instructions_uni_drc->gain_set_index[i];
  909|  3.30k|      ducking_scaling_quantized_prev = pstr_ducking_modifiers[i].ducking_scaling_quantized;
  910|  3.30k|      i++;
  911|       |
  912|  3.30k|      if (i < channel_count) {
  ------------------
  |  Branch (912:11): [True: 1.56k, False: 1.73k]
  ------------------
  913|  1.56k|        impd_drc_quantize_ducking_scaling(&(pstr_ducking_modifiers[i]));
  914|  1.56k|      }
  915|       |
  916|  3.30k|      repeat_parameters_count = 0;
  917|  3.30k|      while ((i < channel_count) && (repeat_parameters_count <= 32) &&
  ------------------
  |  Branch (917:14): [True: 1.56k, False: 1.73k]
  |  Branch (917:37): [True: 1.56k, False: 0]
  ------------------
  918|  1.56k|             (sequence_index_prev == pstr_drc_instructions_uni_drc->gain_set_index[i]) &&
  ------------------
  |  Branch (918:14): [True: 1.47k, False: 95]
  ------------------
  919|  1.47k|             (ducking_scaling_quantized_prev ==
  ------------------
  |  Branch (919:14): [True: 0, False: 1.47k]
  ------------------
  920|  1.47k|              pstr_ducking_modifiers[i].ducking_scaling_quantized)) {
  921|      0|        repeat_parameters_count++;
  922|      0|        i++;
  923|      0|        if (i < channel_count) {
  ------------------
  |  Branch (923:13): [True: 0, False: 0]
  ------------------
  924|      0|          impd_drc_quantize_ducking_scaling(&(pstr_ducking_modifiers[i]));
  925|      0|        }
  926|      0|      }
  927|  3.30k|      if (repeat_parameters_count <= 0) {
  ------------------
  |  Branch (927:11): [True: 3.30k, False: 0]
  ------------------
  928|  3.30k|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
  929|  3.30k|      } else {
  930|      0|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 1, 1);
  931|      0|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, repeat_parameters_count - 1, 5);
  932|      0|      }
  933|  3.30k|    }
  934|  15.6k|    for (j = 0; j < MAX_CHANNEL_COUNT; j++) {
  ------------------
  |  |   25|  15.6k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (934:17): [True: 13.9k, False: 1.73k]
  ------------------
  935|  13.9k|      unique_index[j] = -10;
  936|  13.9k|      unique_scaling[j] = -10.0f;
  937|  13.9k|    }
  938|       |
  939|  1.73k|    ducking_sequence = -1;
  940|  1.73k|    g = 0;
  941|       |
  942|  1.73k|    if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.73k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (942:9): [True: 1.46k, False: 275]
  ------------------
  943|  4.28k|      for (j = 0; j < channel_count; j++) {
  ------------------
  |  Branch (943:19): [True: 2.82k, False: 1.46k]
  ------------------
  944|  2.82k|        match = FALSE;
  ------------------
  |  |   26|  2.82k|#define FALSE (0)
  ------------------
  945|  2.82k|        index = pstr_drc_instructions_uni_drc->gain_set_index[j];
  946|  2.82k|        factor =
  947|  2.82k|            pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel[j].ducking_scaling;
  948|  2.89k|        for (n = 0; n < g; n++) {
  ------------------
  |  Branch (948:21): [True: 1.35k, False: 1.54k]
  ------------------
  949|  1.35k|          if ((index >= 0) && (unique_index[n] == index) && (unique_scaling[n] == factor)) {
  ------------------
  |  Branch (949:15): [True: 1.35k, False: 0]
  |  Branch (949:31): [True: 1.27k, False: 79]
  |  Branch (949:61): [True: 1.27k, False: 0]
  ------------------
  950|  1.27k|            match = TRUE;
  ------------------
  |  |   23|  1.27k|#define TRUE (1)
  ------------------
  951|  1.27k|            break;
  952|  1.27k|          }
  953|  1.35k|        }
  954|  2.82k|        if (match == FALSE) {
  ------------------
  |  |   26|  2.82k|#define FALSE (0)
  ------------------
  |  Branch (954:13): [True: 1.54k, False: 1.27k]
  ------------------
  955|  1.54k|          if (index >= 0) {
  ------------------
  |  Branch (955:15): [True: 1.54k, False: 0]
  ------------------
  956|  1.54k|            unique_index[g] = index;
  957|  1.54k|            unique_scaling[g] = factor;
  958|  1.54k|            g++;
  959|  1.54k|          }
  960|  1.54k|        }
  961|  2.82k|      }
  962|  1.46k|      pstr_drc_instructions_uni_drc->num_drc_channel_groups = g;
  963|  1.46k|    } else if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_OTHER) {
  ------------------
  |  |   37|    275|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
  |  Branch (963:16): [True: 275, False: 0]
  ------------------
  964|    746|      for (j = 0; j < channel_count; j++) {
  ------------------
  |  Branch (964:19): [True: 484, False: 262]
  ------------------
  965|    484|        match = FALSE;
  ------------------
  |  |   26|    484|#define FALSE (0)
  ------------------
  966|    484|        index = pstr_drc_instructions_uni_drc->gain_set_index[j];
  967|    484|        factor =
  968|    484|            pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel[j].ducking_scaling;
  969|    484|        for (n = 0; n < g; n++) {
  ------------------
  |  Branch (969:21): [True: 0, False: 484]
  ------------------
  970|      0|          if (((index >= 0) && (unique_index[n] == index)) ||
  ------------------
  |  Branch (970:16): [True: 0, False: 0]
  |  Branch (970:32): [True: 0, False: 0]
  ------------------
  971|      0|              ((index < 0) && (unique_scaling[n] == factor))) {
  ------------------
  |  Branch (971:16): [True: 0, False: 0]
  |  Branch (971:31): [True: 0, False: 0]
  ------------------
  972|      0|            match = TRUE;
  ------------------
  |  |   23|      0|#define TRUE (1)
  ------------------
  973|      0|            break;
  974|      0|          }
  975|      0|        }
  976|    484|        if (match == FALSE) {
  ------------------
  |  |   26|    484|#define FALSE (0)
  ------------------
  |  Branch (976:13): [True: 484, False: 0]
  ------------------
  977|    484|          if (index < 0) {
  ------------------
  |  Branch (977:15): [True: 0, False: 484]
  ------------------
  978|      0|            unique_index[g] = index;
  979|      0|            unique_scaling[g] = factor;
  980|      0|            g++;
  981|    484|          } else {
  982|    484|            if ((ducking_sequence > 0) && (ducking_sequence != index)) {
  ------------------
  |  Branch (982:17): [True: 88, False: 396]
  |  Branch (982:43): [True: 13, False: 75]
  ------------------
  983|     13|              return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  984|     13|            }
  985|    471|            ducking_sequence = index;
  986|    471|          }
  987|    484|        }
  988|    484|      }
  989|    262|      pstr_drc_instructions_uni_drc->num_drc_channel_groups = g;
  990|    262|      if (ducking_sequence < 0) {
  ------------------
  |  Branch (990:11): [True: 0, False: 262]
  ------------------
  991|      0|        return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  992|      0|      }
  993|    262|    }
  994|       |
  995|  3.26k|    for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (995:17): [True: 1.54k, False: 1.72k]
  ------------------
  996|  1.54k|      if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.54k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (996:11): [True: 1.54k, False: 0]
  ------------------
  997|  1.54k|        pstr_drc_instructions_uni_drc->gain_set_index_for_channel_group[g] = unique_index[g];
  998|  1.54k|      } else if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_OTHER) {
  ------------------
  |  |   37|      0|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
  |  Branch (998:18): [True: 0, False: 0]
  ------------------
  999|      0|        pstr_drc_instructions_uni_drc->gain_set_index_for_channel_group[g] = -1;
 1000|      0|      }
 1001|       |
 1002|  1.54k|      pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel_group[g].ducking_scaling =
 1003|  1.54k|          unique_scaling[g];
 1004|  1.54k|      if (unique_scaling[g] == 1.0f) {
  ------------------
  |  Branch (1004:11): [True: 0, False: 1.54k]
  ------------------
 1005|      0|        pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel_group[g]
 1006|      0|            .ducking_scaling_present = FALSE;
  ------------------
  |  |   26|      0|#define FALSE (0)
  ------------------
 1007|  1.54k|      } else {
 1008|  1.54k|        pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel_group[g]
 1009|  1.54k|            .ducking_scaling_present = TRUE;
  ------------------
  |  |   23|  1.54k|#define TRUE (1)
  ------------------
 1010|  1.54k|      }
 1011|  1.54k|    }
 1012|  1.72k|  } else {
 1013|  1.21k|    if ((version == 0 || pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0) &&
  ------------------
  |  Branch (1013:10): [True: 652, False: 564]
  |  Branch (1013:26): [True: 0, False: 564]
  ------------------
 1014|    652|        ((pstr_drc_instructions_uni_drc->downmix_id == 0x7F) ||
  ------------------
  |  Branch (1014:10): [True: 47, False: 605]
  ------------------
 1015|    605|         (pstr_drc_instructions_uni_drc->additional_downmix_id_count != 0))) {
  ------------------
  |  Branch (1015:10): [True: 357, False: 248]
  ------------------
 1016|    404|      channel_count = 1;
 1017|    812|    } else if ((version == 0 || pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0) &&
  ------------------
  |  Branch (1017:17): [True: 248, False: 564]
  |  Branch (1017:33): [True: 0, False: 564]
  ------------------
 1018|    248|               (pstr_drc_instructions_uni_drc->downmix_id != 0) &&
  ------------------
  |  Branch (1018:16): [True: 176, False: 72]
  ------------------
 1019|    176|               (pstr_drc_instructions_uni_drc->downmix_id != 0x7F) &&
  ------------------
  |  Branch (1019:16): [True: 176, False: 0]
  ------------------
 1020|    176|               (pstr_drc_instructions_uni_drc->additional_downmix_id_count == 0)) {
  ------------------
  |  Branch (1020:16): [True: 176, False: 0]
  ------------------
 1021|    385|      for (i = 0; i < pstr_uni_drc_config->downmix_instructions_count; i++) {
  ------------------
  |  Branch (1021:19): [True: 209, False: 176]
  ------------------
 1022|    209|        if (pstr_drc_instructions_uni_drc->downmix_id ==
  ------------------
  |  Branch (1022:13): [True: 0, False: 209]
  ------------------
 1023|    209|            pstr_uni_drc_config->str_downmix_instructions[i].downmix_id) {
 1024|      0|          break;
 1025|      0|        }
 1026|    209|      }
 1027|    176|      if (i == pstr_uni_drc_config->downmix_instructions_count) {
  ------------------
  |  Branch (1027:11): [True: 176, False: 0]
  ------------------
 1028|    176|        return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
 1029|    176|      }
 1030|      0|      channel_count = pstr_uni_drc_config->str_downmix_instructions[i].target_ch_count;
 1031|      0|    }
 1032|       |
 1033|  1.04k|    i = 0;
 1034|  2.17k|    while (i < channel_count) {
  ------------------
  |  Branch (1034:12): [True: 1.13k, False: 1.04k]
  ------------------
 1035|  1.13k|      bs_sequence_index = pstr_drc_instructions_uni_drc->gain_set_index[i] + 1;
 1036|  1.13k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bs_sequence_index, 6);
 1037|  1.13k|      sequence_index_prev = pstr_drc_instructions_uni_drc->gain_set_index[i];
 1038|  1.13k|      i++;
 1039|       |
 1040|  1.13k|      repeat_sequence_count = 0;
 1041|  1.62k|      while ((i < channel_count) &&
  ------------------
  |  Branch (1041:14): [True: 585, False: 1.04k]
  ------------------
 1042|    585|             (sequence_index_prev == pstr_drc_instructions_uni_drc->gain_set_index[i]) &&
  ------------------
  |  Branch (1042:14): [True: 489, False: 96]
  ------------------
 1043|    489|             (repeat_sequence_count <= 32)) {
  ------------------
  |  Branch (1043:14): [True: 489, False: 0]
  ------------------
 1044|    489|        repeat_sequence_count++;
 1045|    489|        i++;
 1046|    489|      }
 1047|  1.13k|      if (repeat_sequence_count <= 0) {
  ------------------
  |  Branch (1047:11): [True: 647, False: 489]
  ------------------
 1048|    647|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 1049|    647|      } else {
 1050|    489|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 1, 1);
 1051|    489|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, repeat_sequence_count - 1, 5);
 1052|    489|      }
 1053|  1.13k|    }
 1054|  9.36k|    for (i = 0; i < MAX_CHANNEL_COUNT; i++) {
  ------------------
  |  |   25|  9.36k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (1054:17): [True: 8.32k, False: 1.04k]
  ------------------
 1055|  8.32k|      unique_index[i] = -1;
 1056|  8.32k|    }
 1057|       |
 1058|  1.04k|    k = 0;
 1059|  2.66k|    for (i = 0; i < channel_count; i++) {
  ------------------
  |  Branch (1059:17): [True: 1.62k, False: 1.04k]
  ------------------
 1060|  1.62k|      tmp_2 = pstr_drc_instructions_uni_drc->gain_set_index[i];
 1061|  1.62k|      if (tmp_2 >= 0) {
  ------------------
  |  Branch (1061:11): [True: 1.62k, False: 0]
  ------------------
 1062|  1.62k|        match = FALSE;
  ------------------
  |  |   26|  1.62k|#define FALSE (0)
  ------------------
 1063|  2.21k|        for (n = 0; n < k; n++) {
  ------------------
  |  Branch (1063:21): [True: 585, False: 1.62k]
  ------------------
 1064|    585|          if (unique_index[n] == tmp_2) {
  ------------------
  |  Branch (1064:15): [True: 489, False: 96]
  ------------------
 1065|    489|            match = TRUE;
  ------------------
  |  |   23|    489|#define TRUE (1)
  ------------------
 1066|    489|          }
 1067|    585|        }
 1068|  1.62k|        if (match == FALSE) {
  ------------------
  |  |   26|  1.62k|#define FALSE (0)
  ------------------
  |  Branch (1068:13): [True: 1.13k, False: 489]
  ------------------
 1069|  1.13k|          unique_index[k] = tmp_2;
 1070|  1.13k|          k++;
 1071|  1.13k|        }
 1072|  1.62k|      }
 1073|  1.62k|    }
 1074|  1.04k|    pstr_drc_instructions_uni_drc->num_drc_channel_groups = k;
 1075|  2.17k|    for (i = 0; i < pstr_drc_instructions_uni_drc->num_drc_channel_groups; i++) {
  ------------------
  |  Branch (1075:17): [True: 1.13k, False: 1.04k]
  ------------------
 1076|  1.13k|      band_count = 0;
 1077|  1.13k|      pstr_drc_instructions_uni_drc->gain_set_index_for_channel_group[i] = unique_index[i];
 1078|       |
 1079|  1.13k|      if (pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count > 0) {
  ------------------
  |  Branch (1079:11): [True: 585, False: 551]
  ------------------
 1080|    585|        band_count =
 1081|    585|            pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
 1082|    585|                .str_gain_set_params[pstr_drc_instructions_uni_drc
 1083|    585|                                         ->gain_set_index_for_channel_group[i]]
 1084|    585|                .band_count;
 1085|    585|      } else if (pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) {
  ------------------
  |  Branch (1085:18): [True: 260, False: 291]
  ------------------
 1086|    260|        band_count = pstr_uni_drc_config->str_drc_coefficients_uni_drc[0]
 1087|    260|                         .str_gain_set_params[pstr_drc_instructions_uni_drc
 1088|    260|                                                  ->gain_set_index_for_channel_group[i]]
 1089|    260|                         .band_count;
 1090|    260|      }
 1091|       |
 1092|  1.13k|      impd_drc_enc_gain_modifiers(it_bit_buf, version, band_count,
 1093|  1.13k|                                  &(pstr_drc_instructions_uni_drc->str_gain_modifiers[i]),
 1094|  1.13k|                                  &bit_cnt_local);
 1095|  1.13k|    }
 1096|  1.04k|  }
 1097|       |
 1098|  2.76k|  *ptr_bit_cnt += bit_cnt_local;
 1099|  2.76k|  return err_code;
 1100|  2.95k|}
impd_drc_mux.c:impd_drc_get_drc_complexity_level:
   42|  1.93k|    ia_drc_instructions_uni_drc *pstr_drc_instructions_uni_drc, VOID *ptr_scratch) {
   43|  1.93k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.93k|#define IA_NO_ERROR 0x00000000
  ------------------
   44|  1.93k|  LOOPIDX c, g, k, i, group;
   45|  1.93k|  WORD32 band_count;
   46|  1.93k|  WORD32 gain_set_index;
   47|  1.93k|  WORD32 skip_set;
   48|  1.93k|  WORD32 gain_set_index_offset;
   49|  1.93k|  WORD32 parametric_drc_type = 0;
   50|  1.93k|  WORD32 channel_count_side_chain;
   51|  1.93k|  WORD32 channel_count_drom_downmix_id;
   52|  1.93k|  WORD32 channel_count_temp;
   53|  1.93k|  WORD32 weighting_filter_order;
   54|  1.93k|  WORD32 channel_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
   55|  1.93k|  FLOAT32 w_mod, cplx, cplx_tmp, ratio;
   56|  1.93k|  ia_drc_gain_modifiers_struct *pstr_gain_modifiers = NULL;
   57|  1.93k|  ia_drc_shape_filter_block_params_struct *pstr_shape_filter_block_params = NULL;
   58|  1.93k|  ia_drc_gain_set_params_struct *pstr_gain_set_params = NULL;
   59|  1.93k|  ia_drc_parametric_drc_instructions_struct *pstr_parametric_drc_instructions = NULL;
   60|  1.93k|  ia_drc_parametric_drc_gain_set_params_struct *pstr_parametric_drc_gain_set_params = NULL;
   61|       |
   62|  1.93k|  if (pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0 &&
  ------------------
  |  Branch (62:7): [True: 0, False: 1.93k]
  ------------------
   63|      0|      ((pstr_drc_instructions_uni_drc->downmix_id == 0x7F) ||
  ------------------
  |  Branch (63:8): [True: 0, False: 0]
  ------------------
   64|      0|       (pstr_drc_instructions_uni_drc->additional_downmix_id_count != 0))) {
  ------------------
  |  Branch (64:8): [True: 0, False: 0]
  ------------------
   65|      0|    channel_count = 1;
   66|  1.93k|  } else if ((pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0) &&
  ------------------
  |  Branch (66:14): [True: 0, False: 1.93k]
  ------------------
   67|      0|             (pstr_drc_instructions_uni_drc->downmix_id != 0) &&
  ------------------
  |  Branch (67:14): [True: 0, False: 0]
  ------------------
   68|      0|             (pstr_drc_instructions_uni_drc->downmix_id != 0x7F) &&
  ------------------
  |  Branch (68:14): [True: 0, False: 0]
  ------------------
   69|      0|             (pstr_drc_instructions_uni_drc->additional_downmix_id_count == 0)) {
  ------------------
  |  Branch (69:14): [True: 0, False: 0]
  ------------------
   70|      0|    for (i = 0; i < pstr_uni_drc_config->downmix_instructions_count; i++) {
  ------------------
  |  Branch (70:17): [True: 0, False: 0]
  ------------------
   71|      0|      if (pstr_drc_instructions_uni_drc->downmix_id ==
  ------------------
  |  Branch (71:11): [True: 0, False: 0]
  ------------------
   72|      0|          pstr_uni_drc_config->str_downmix_instructions[i].downmix_id) {
   73|      0|        break;
   74|      0|      }
   75|      0|    }
   76|      0|    if (i == pstr_uni_drc_config->downmix_instructions_count) {
  ------------------
  |  Branch (76:9): [True: 0, False: 0]
  ------------------
   77|      0|      return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
   78|      0|    }
   79|      0|    channel_count = pstr_uni_drc_config->str_downmix_instructions[i].target_ch_count;
   80|      0|  }
   81|       |
   82|  1.93k|  pstr_drc_instructions_uni_drc->drc_channel_count = channel_count;
   83|  1.93k|  group = 0;
   84|  5.63k|  for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (84:15): [True: 3.70k, False: 1.93k]
  ------------------
   85|  3.70k|    gain_set_index = pstr_drc_instructions_uni_drc->gain_set_index[c];
   86|  3.70k|    skip_set = FALSE;
  ------------------
  |  |   26|  3.70k|#define FALSE (0)
  ------------------
   87|  3.70k|    if (gain_set_index < 0) {
  ------------------
  |  Branch (87:9): [True: 0, False: 3.70k]
  ------------------
   88|      0|      pstr_drc_instructions_uni_drc->channel_group_for_channel[c] = -1;
   89|  3.70k|    } else {
   90|  5.48k|      for (k = c - 1; k >= 0; k--) {
  ------------------
  |  Branch (90:23): [True: 1.77k, False: 3.70k]
  ------------------
   91|  1.77k|        if (pstr_drc_instructions_uni_drc->gain_set_index[k] == gain_set_index) {
  ------------------
  |  Branch (91:13): [True: 1.63k, False: 140]
  ------------------
   92|  1.63k|          pstr_drc_instructions_uni_drc->channel_group_for_channel[c] =
   93|  1.63k|              pstr_drc_instructions_uni_drc->channel_group_for_channel[k];
   94|  1.63k|          skip_set = TRUE;
  ------------------
  |  |   23|  1.63k|#define TRUE (1)
  ------------------
   95|  1.63k|        }
   96|  1.77k|      }
   97|  3.70k|      if (skip_set == FALSE) {
  ------------------
  |  |   26|  3.70k|#define FALSE (0)
  ------------------
  |  Branch (97:11): [True: 2.07k, False: 1.63k]
  ------------------
   98|  2.07k|        pstr_drc_instructions_uni_drc->channel_group_for_channel[c] = group;
   99|  2.07k|        group++;
  100|  2.07k|      }
  101|  3.70k|    }
  102|  3.70k|  }
  103|  1.93k|  if (group != pstr_drc_instructions_uni_drc->num_drc_channel_groups) {
  ------------------
  |  Branch (103:7): [True: 296, False: 1.63k]
  ------------------
  104|    296|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  105|    296|  }
  106|       |
  107|  3.38k|  for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (107:15): [True: 1.75k, False: 1.63k]
  ------------------
  108|  1.75k|    pstr_drc_instructions_uni_drc->num_channels_per_channel_group[g] = 0;
  109|  5.17k|    for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (109:17): [True: 3.42k, False: 1.75k]
  ------------------
  110|  3.42k|      if (pstr_drc_instructions_uni_drc->channel_group_for_channel[c] == g) {
  ------------------
  |  Branch (110:11): [True: 3.19k, False: 230]
  ------------------
  111|  3.19k|        pstr_drc_instructions_uni_drc->num_channels_per_channel_group[g]++;
  112|  3.19k|      }
  113|  3.42k|    }
  114|  1.75k|  }
  115|       |
  116|  1.63k|  cplx = 0.0f;
  117|       |
  118|  1.63k|  if (pstr_drc_gain_enc->domain == TIME_DOMAIN) {
  ------------------
  |  |   79|  1.63k|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (118:7): [True: 722, False: 914]
  ------------------
  119|    722|    w_mod = COMPLEXITY_W_MOD_TIME;
  ------------------
  |  |  103|    722|#define COMPLEXITY_W_MOD_TIME 1.0f
  ------------------
  120|    914|  } else {
  121|    914|    w_mod = COMPLEXITY_W_MOD_SUBBAND;
  ------------------
  |  |  104|    914|#define COMPLEXITY_W_MOD_SUBBAND 2.0f
  ------------------
  122|    914|  }
  123|  4.83k|  for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (123:15): [True: 3.19k, False: 1.63k]
  ------------------
  124|  3.19k|    if (pstr_drc_instructions_uni_drc->gain_set_index[c] >= 0) {
  ------------------
  |  Branch (124:9): [True: 3.19k, False: 0]
  ------------------
  125|  3.19k|      cplx += w_mod;
  126|  3.19k|    }
  127|  3.19k|  }
  128|       |
  129|  1.63k|  if (pstr_drc_gain_enc->domain != TIME_DOMAIN) {
  ------------------
  |  |   79|  1.63k|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (129:7): [True: 914, False: 722]
  ------------------
  130|    914|    pstr_gain_set_params =
  131|    914|        pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  132|    914|            .str_gain_set_params;
  133|  2.69k|    for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (133:17): [True: 1.77k, False: 914]
  ------------------
  134|  1.77k|      gain_set_index = pstr_drc_instructions_uni_drc->gain_set_index[c];
  135|  1.77k|      if (gain_set_index >= 0) {
  ------------------
  |  Branch (135:11): [True: 1.77k, False: 0]
  ------------------
  136|  1.77k|        if (pstr_gain_set_params[gain_set_index].drc_band_type == 1) {
  ------------------
  |  Branch (136:13): [True: 0, False: 1.77k]
  ------------------
  137|      0|          band_count = pstr_gain_set_params[gain_set_index].band_count;
  138|      0|          if (band_count > 1) {
  ------------------
  |  Branch (138:15): [True: 0, False: 0]
  ------------------
  139|      0|            cplx += COMPLEXITY_W_LAP * band_count;
  ------------------
  |  |  105|      0|#define COMPLEXITY_W_LAP 2.0f
  ------------------
  140|      0|          }
  141|      0|        }
  142|  1.77k|      }
  143|  1.77k|    }
  144|    914|  } else {
  145|    722|    err_code = impd_drc_init_all_filter_banks(
  146|    722|        &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0],
  147|    722|        pstr_drc_instructions_uni_drc, &pstr_drc_gain_enc->str_filter_banks, ptr_scratch);
  148|       |
  149|    722|    if (err_code) return err_code;
  ------------------
  |  Branch (149:9): [True: 17, False: 705]
  ------------------
  150|       |
  151|    705|    cplx += COMPLEXITY_W_IIR * pstr_drc_gain_enc->str_filter_banks.complexity;
  ------------------
  |  |  102|    705|#define COMPLEXITY_W_IIR 5.0f
  ------------------
  152|       |
  153|  1.44k|    for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (153:17): [True: 740, False: 705]
  ------------------
  154|    740|      pstr_gain_modifiers = &pstr_drc_instructions_uni_drc->str_gain_modifiers[g];
  155|    740|      if (pstr_gain_modifiers->shape_filter_present == 1) {
  ------------------
  |  Branch (155:11): [True: 0, False: 740]
  ------------------
  156|      0|        cplx_tmp = 0.0f;
  157|      0|        pstr_shape_filter_block_params =
  158|      0|            &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  159|      0|                 .str_shape_filter_block_params[pstr_gain_modifiers->shape_filter_index];
  160|      0|        if (pstr_shape_filter_block_params->lf_cut_filter_present == 1) {
  ------------------
  |  Branch (160:13): [True: 0, False: 0]
  ------------------
  161|      0|          cplx_tmp += COMPLEXITY_W_SHAPE;
  ------------------
  |  |  106|      0|#define COMPLEXITY_W_SHAPE 6.0f
  ------------------
  162|      0|        }
  163|      0|        if (pstr_shape_filter_block_params->lf_boost_filter_present == 1) {
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|          cplx_tmp += COMPLEXITY_W_SHAPE;
  ------------------
  |  |  106|      0|#define COMPLEXITY_W_SHAPE 6.0f
  ------------------
  165|      0|        }
  166|      0|        if (pstr_shape_filter_block_params->hf_cut_filter_present == 1) {
  ------------------
  |  Branch (166:13): [True: 0, False: 0]
  ------------------
  167|      0|          cplx_tmp += COMPLEXITY_W_SHAPE * 2.0f;
  ------------------
  |  |  106|      0|#define COMPLEXITY_W_SHAPE 6.0f
  ------------------
  168|      0|        }
  169|      0|        if (pstr_shape_filter_block_params->hf_boost_filter_present == 1) {
  ------------------
  |  Branch (169:13): [True: 0, False: 0]
  ------------------
  170|      0|          cplx_tmp += COMPLEXITY_W_SHAPE * 2.0f;
  ------------------
  |  |  106|      0|#define COMPLEXITY_W_SHAPE 6.0f
  ------------------
  171|      0|        }
  172|      0|        cplx += cplx_tmp * pstr_drc_instructions_uni_drc->num_channels_per_channel_group[g];
  173|      0|      }
  174|    740|    }
  175|    705|  }
  176|       |
  177|  3.34k|  for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (177:15): [True: 1.72k, False: 1.61k]
  ------------------
  178|  1.72k|    gain_set_index_offset = 0;
  179|  1.72k|    gain_set_index = -1;
  180|  1.83k|    for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (180:17): [True: 1.83k, False: 0]
  ------------------
  181|  1.83k|      if (pstr_drc_instructions_uni_drc->channel_group_for_channel[c] == g) {
  ------------------
  |  Branch (181:11): [True: 1.72k, False: 106]
  ------------------
  182|  1.72k|        gain_set_index = pstr_drc_instructions_uni_drc->gain_set_index[c];
  183|  1.72k|        break;
  184|  1.72k|      }
  185|  1.83k|    }
  186|  1.72k|    if (pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count > 0) {
  ------------------
  |  Branch (186:9): [True: 1.63k, False: 94]
  ------------------
  187|  1.63k|      gain_set_index_offset =
  188|  1.63k|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  189|  1.63k|              .gain_set_count;
  190|  1.63k|      pstr_gain_set_params =
  191|  1.63k|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  192|  1.63k|              .str_gain_set_params;
  193|  1.63k|    }
  194|  1.72k|    if (gain_set_index >= gain_set_index_offset) {
  ------------------
  |  Branch (194:9): [True: 305, False: 1.42k]
  ------------------
  195|    305|      pstr_parametric_drc_instructions = NULL;
  196|    305|      pstr_parametric_drc_gain_set_params =
  197|    305|          &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coeff_parametric_drc
  198|    305|               .parametric_drc_gain_set_params[gain_set_index - gain_set_index_offset];
  199|    305|      for (i = 0;
  200|    305|           i < pstr_uni_drc_config->str_uni_drc_config_ext.parametric_drc_instructions_count;
  ------------------
  |  Branch (200:12): [True: 0, False: 305]
  ------------------
  201|    305|           i++) {
  202|      0|        if (pstr_parametric_drc_gain_set_params->parametric_drc_id ==
  ------------------
  |  Branch (202:13): [True: 0, False: 0]
  ------------------
  203|      0|            pstr_uni_drc_config->str_uni_drc_config_ext.str_parametric_drc_instructions[i]
  204|      0|                .parametric_drc_id) {
  205|      0|          pstr_parametric_drc_instructions =
  206|      0|              &pstr_uni_drc_config->str_uni_drc_config_ext.str_parametric_drc_instructions[i];
  207|      0|          break;
  208|      0|        }
  209|      0|      }
  210|    305|      if (pstr_parametric_drc_instructions != NULL) {
  ------------------
  |  Branch (210:11): [True: 0, False: 305]
  ------------------
  211|      0|        if (pstr_parametric_drc_instructions->parametric_drc_preset_id_present) {
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|          switch (pstr_parametric_drc_instructions->parametric_drc_preset_id) {
  213|      0|            case 0:
  ------------------
  |  Branch (213:13): [True: 0, False: 0]
  ------------------
  214|      0|            case 1:
  ------------------
  |  Branch (214:13): [True: 0, False: 0]
  ------------------
  215|      0|            case 2:
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            case 3:
  ------------------
  |  Branch (216:13): [True: 0, False: 0]
  ------------------
  217|      0|            case 4:
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|              parametric_drc_type = PARAM_DRC_TYPE_FF;
  ------------------
  |  |   59|      0|#define PARAM_DRC_TYPE_FF (0x0)
  ------------------
  219|      0|              break;
  220|      0|            case 5:
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  ------------------
  221|      0|              parametric_drc_type = PARAM_DRC_TYPE_LIM;
  ------------------
  |  |   62|      0|#define PARAM_DRC_TYPE_LIM (0x1)
  ------------------
  222|      0|              break;
  223|      0|            default:
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|              return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  225|      0|              break;
  226|      0|          }
  227|      0|        } else {
  228|      0|          parametric_drc_type = pstr_parametric_drc_instructions->parametric_drc_type;
  229|      0|        }
  230|      0|      }
  231|    305|      channel_count_side_chain = pstr_drc_instructions_uni_drc->num_channels_per_channel_group[g];
  232|    305|      if (pstr_parametric_drc_gain_set_params->side_chain_config_type == 1) {
  ------------------
  |  Branch (232:11): [True: 0, False: 305]
  ------------------
  233|      0|        channel_count_temp = 0;
  234|      0|        if (pstr_parametric_drc_gain_set_params->downmix_id == 0x0) {
  ------------------
  |  Branch (234:13): [True: 0, False: 0]
  ------------------
  235|      0|          channel_count_drom_downmix_id = pstr_uni_drc_config->str_channel_layout.base_ch_count;
  236|      0|        } else if (pstr_parametric_drc_gain_set_params->downmix_id == 0x7F) {
  ------------------
  |  Branch (236:20): [True: 0, False: 0]
  ------------------
  237|      0|          channel_count_drom_downmix_id = 1;
  238|      0|        } else {
  239|      0|          for (i = 0; i < pstr_uni_drc_config->downmix_instructions_count; i++) {
  ------------------
  |  Branch (239:23): [True: 0, False: 0]
  ------------------
  240|      0|            if (pstr_parametric_drc_gain_set_params->downmix_id ==
  ------------------
  |  Branch (240:17): [True: 0, False: 0]
  ------------------
  241|      0|                pstr_uni_drc_config->str_downmix_instructions[i].downmix_id) {
  242|      0|              break;
  243|      0|            }
  244|      0|          }
  245|      0|          if (i == pstr_uni_drc_config->downmix_instructions_count) {
  ------------------
  |  Branch (245:15): [True: 0, False: 0]
  ------------------
  246|      0|            return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  247|      0|          }
  248|      0|          channel_count_drom_downmix_id =
  249|      0|              pstr_uni_drc_config->str_downmix_instructions[i].target_ch_count;
  250|      0|        }
  251|       |
  252|      0|        for (i = 0; i < channel_count_drom_downmix_id; i++) {
  ------------------
  |  Branch (252:21): [True: 0, False: 0]
  ------------------
  253|      0|          if (pstr_parametric_drc_gain_set_params->level_estim_channel_weight[i] != 0) {
  ------------------
  |  Branch (253:15): [True: 0, False: 0]
  ------------------
  254|      0|            channel_count_temp++;
  255|      0|          }
  256|      0|        }
  257|      0|        channel_count_side_chain = channel_count_temp;
  258|      0|      }
  259|    305|      if (pstr_parametric_drc_instructions != NULL) {
  ------------------
  |  Branch (259:11): [True: 0, False: 305]
  ------------------
  260|      0|        if (pstr_drc_gain_enc->domain == TIME_DOMAIN) {
  ------------------
  |  |   79|      0|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|          if (parametric_drc_type == PARAM_DRC_TYPE_FF) {
  ------------------
  |  |   59|      0|#define PARAM_DRC_TYPE_FF (0x0)
  ------------------
  |  Branch (261:15): [True: 0, False: 0]
  ------------------
  262|      0|            weighting_filter_order = 2;
  263|      0|            if (pstr_parametric_drc_instructions->parametric_drc_preset_id_present == 0) {
  ------------------
  |  Branch (263:17): [True: 0, False: 0]
  ------------------
  264|      0|              if (pstr_parametric_drc_instructions->str_parametric_drc_type_feed_forward
  ------------------
  |  Branch (264:19): [True: 0, False: 0]
  ------------------
  265|      0|                      .level_estim_k_weighting_type == 0) {
  266|      0|                weighting_filter_order = 0;
  267|      0|              } else if (pstr_parametric_drc_instructions->str_parametric_drc_type_feed_forward
  ------------------
  |  Branch (267:26): [True: 0, False: 0]
  ------------------
  268|      0|                             .level_estim_k_weighting_type == 1) {
  269|      0|                weighting_filter_order = 1;
  270|      0|              }
  271|      0|            }
  272|      0|            cplx += channel_count_side_chain *
  273|      0|                        (COMPLEXITY_W_PARAM_DRC_FILT * weighting_filter_order + 1) +
  ------------------
  |  |  109|      0|#define COMPLEXITY_W_PARAM_DRC_FILT 5.0f
  ------------------
  274|      0|                    3;
  275|      0|          } else if (parametric_drc_type == PARAM_DRC_TYPE_LIM) {
  ------------------
  |  |   62|      0|#define PARAM_DRC_TYPE_LIM (0x1)
  ------------------
  |  Branch (275:22): [True: 0, False: 0]
  ------------------
  276|      0|            ratio = 1.0f;
  277|      0|            if (pstr_parametric_drc_instructions->parametric_drc_look_ahead_present == 1) {
  ------------------
  |  Branch (277:17): [True: 0, False: 0]
  ------------------
  278|      0|              ratio = (FLOAT32)pstr_parametric_drc_instructions->parametric_drc_look_ahead /
  279|      0|                      (FLOAT32)PARAM_DRC_TYPE_LIM_ATTACK_DEFAULT;
  ------------------
  |  |   63|      0|#define PARAM_DRC_TYPE_LIM_ATTACK_DEFAULT (5)
  ------------------
  280|      0|            }
  281|      0|            cplx += (FLOAT32)(channel_count_side_chain * COMPLEXITY_W_PARAM_LIM_FILT +
  ------------------
  |  |  111|      0|#define COMPLEXITY_W_PARAM_LIM_FILT 4.5f
  ------------------
  282|      0|                              COMPLEXITY_W_PARAM_DRC_ATTACK * sqrt(ratio));
  ------------------
  |  |  112|      0|#define COMPLEXITY_W_PARAM_DRC_ATTACK 136.0f
  ------------------
  283|      0|          }
  284|      0|        } else {
  285|      0|          if (parametric_drc_type == PARAM_DRC_TYPE_FF) {
  ------------------
  |  |   59|      0|#define PARAM_DRC_TYPE_FF (0x0)
  ------------------
  |  Branch (285:15): [True: 0, False: 0]
  ------------------
  286|      0|            cplx += channel_count_side_chain * COMPLEXITY_W_PARAM_DRC_SUBBAND;
  ------------------
  |  |  110|      0|#define COMPLEXITY_W_PARAM_DRC_SUBBAND 5.0f
  ------------------
  287|      0|          }
  288|      0|        }
  289|      0|      }
  290|  1.42k|    } else {
  291|  1.42k|      if (pstr_drc_gain_enc->domain == TIME_DOMAIN && pstr_gain_set_params != NULL) {
  ------------------
  |  |   79|  2.84k|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (291:11): [True: 674, False: 746]
  |  Branch (291:55): [True: 674, False: 0]
  ------------------
  292|    674|        if (pstr_gain_set_params[gain_set_index].gain_interpolation_type ==
  ------------------
  |  Branch (292:13): [True: 340, False: 334]
  ------------------
  293|    674|            GAIN_INTERPOLATION_TYPE_SPLINE) {
  ------------------
  |  |   45|    674|#define GAIN_INTERPOLATION_TYPE_SPLINE 0
  ------------------
  294|    340|          cplx += COMPLEXITY_W_SPLINE;
  ------------------
  |  |  107|    340|#define COMPLEXITY_W_SPLINE 5.0f
  ------------------
  295|    340|        }
  296|    674|        if (pstr_gain_set_params[gain_set_index].gain_interpolation_type ==
  ------------------
  |  Branch (296:13): [True: 334, False: 340]
  ------------------
  297|    674|            GAIN_INTERPOLATION_TYPE_LINEAR) {
  ------------------
  |  |   46|    674|#define GAIN_INTERPOLATION_TYPE_LINEAR 1
  ------------------
  298|    334|          cplx += COMPLEXITY_W_LINEAR;
  ------------------
  |  |  108|    334|#define COMPLEXITY_W_LINEAR 2.5f
  ------------------
  299|    334|        }
  300|    674|      }
  301|  1.42k|    }
  302|  1.72k|  }
  303|       |
  304|  1.61k|  if (pstr_drc_instructions_uni_drc->downmix_id == 0x7F) {
  ------------------
  |  Branch (304:7): [True: 35, False: 1.58k]
  ------------------
  305|     35|    channel_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
  306|     35|  }
  307|       |
  308|  1.61k|  cplx = (FLOAT32)(log10(cplx / channel_count) / log10(2.0f));
  309|  1.61k|  pstr_drc_instructions_uni_drc->drc_set_complexity_level = (WORD32)MAX(0, ceil(cplx));
  ------------------
  |  |   89|  1.61k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 1.61k]
  |  |  ------------------
  ------------------
  310|       |
  311|  1.61k|  if (pstr_drc_instructions_uni_drc->drc_set_complexity_level > DRC_COMPLEXITY_LEVEL_MAX) {
  ------------------
  |  |   98|  1.61k|#define DRC_COMPLEXITY_LEVEL_MAX 15
  ------------------
  |  Branch (311:7): [True: 0, False: 1.61k]
  ------------------
  312|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  313|      0|  }
  314|       |
  315|  1.61k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  1.61k|#define IA_NO_ERROR 0x00000000
  ------------------
  316|  1.61k|}
impd_drc_mux.c:impd_drc_enc_ducking_modifiers:
  593|  3.30k|    WORD32 *ptr_bit_cnt) {
  594|  3.30k|  WORD32 bits;
  595|  3.30k|  WORD32 remove_scaling_value;
  596|  3.30k|  WORD32 bit_cnt_local = 0;
  597|       |
  598|  3.30k|  if (pstr_ducking_modifiers->ducking_scaling_present == FALSE) {
  ------------------
  |  |   26|  3.30k|#define FALSE (0)
  ------------------
  |  Branch (598:7): [True: 3.30k, False: 0]
  ------------------
  599|  3.30k|    bit_cnt_local +=
  600|  3.30k|        iusace_write_bits_buf(it_bit_buf, pstr_ducking_modifiers->ducking_scaling_present, 1);
  601|  3.30k|  } else {
  602|      0|    impd_drc_enc_ducking_scaling(pstr_ducking_modifiers->ducking_scaling, &bits,
  603|      0|                                 &(pstr_ducking_modifiers->ducking_scaling_quantized),
  604|      0|                                 &remove_scaling_value);
  605|       |
  606|      0|    if (remove_scaling_value) {
  ------------------
  |  Branch (606:9): [True: 0, False: 0]
  ------------------
  607|      0|      pstr_ducking_modifiers->ducking_scaling_present = FALSE;
  ------------------
  |  |   26|      0|#define FALSE (0)
  ------------------
  608|      0|    }
  609|       |
  610|      0|    bit_cnt_local +=
  611|      0|        iusace_write_bits_buf(it_bit_buf, pstr_ducking_modifiers->ducking_scaling_present, 1);
  612|       |
  613|      0|    if (pstr_ducking_modifiers->ducking_scaling_present) {
  ------------------
  |  Branch (613:9): [True: 0, False: 0]
  ------------------
  614|      0|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bits, 4);
  615|      0|    }
  616|      0|  }
  617|       |
  618|  3.30k|  *ptr_bit_cnt += bit_cnt_local;
  619|  3.30k|}
impd_drc_mux.c:impd_drc_quantize_ducking_scaling:
  526|  1.56k|    ia_drc_ducking_modifiers_struct *pstr_ducking_modifiers) {
  527|  1.56k|  WORD32 mu;
  528|  1.56k|  FLOAT32 delta;
  529|       |
  530|  1.56k|  if (pstr_ducking_modifiers->ducking_scaling_present) {
  ------------------
  |  Branch (530:7): [True: 0, False: 1.56k]
  ------------------
  531|      0|    delta = pstr_ducking_modifiers->ducking_scaling - 1.0f;
  532|       |
  533|      0|    if (delta <= 0.0f) {
  ------------------
  |  Branch (533:9): [True: 0, False: 0]
  ------------------
  534|      0|      mu = -1 + (WORD32)(0.5f - 8.0f * delta);
  535|      0|      if (mu != -1) {
  ------------------
  |  Branch (535:11): [True: 0, False: 0]
  ------------------
  536|      0|        mu = MIN(7, mu);
  ------------------
  |  |   86|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  537|      0|        mu = MAX(0, mu);
  ------------------
  |  |   89|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  538|      0|        pstr_ducking_modifiers->ducking_scaling_quantized = 1.0f - 0.125f * (1.0f + mu);
  539|      0|      } else {
  540|      0|        pstr_ducking_modifiers->ducking_scaling_quantized = 1.0f;
  541|      0|        pstr_ducking_modifiers->ducking_scaling_present = FALSE;
  ------------------
  |  |   26|      0|#define FALSE (0)
  ------------------
  542|      0|      }
  543|      0|    } else {
  544|      0|      mu = -1 + (WORD32)(0.5f + 8.0f * delta);
  545|      0|      if (mu != -1) {
  ------------------
  |  Branch (545:11): [True: 0, False: 0]
  ------------------
  546|      0|        mu = MIN(7, mu);
  ------------------
  |  |   86|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  547|      0|        mu = MAX(0, mu);
  ------------------
  |  |   89|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  548|      0|        pstr_ducking_modifiers->ducking_scaling_quantized = 1.0f + 0.125f * (1.0f + mu);
  549|      0|      } else {
  550|      0|        pstr_ducking_modifiers->ducking_scaling_quantized = 1.0f;
  551|      0|        pstr_ducking_modifiers->ducking_scaling_present = FALSE;
  ------------------
  |  |   26|      0|#define FALSE (0)
  ------------------
  552|      0|      }
  553|      0|    }
  554|  1.56k|  } else {
  555|  1.56k|    pstr_ducking_modifiers->ducking_scaling_quantized = 1.0f;
  556|  1.56k|  }
  557|  1.56k|}
impd_drc_mux.c:impd_drc_enc_gain_modifiers:
  624|  1.13k|                                        WORD32 *ptr_bit_cnt) {
  625|  1.13k|  LOOPIDX idx;
  626|  1.13k|  WORD32 tmp, sign;
  627|  1.13k|  WORD32 bit_cnt_local = 0;
  628|       |
  629|  1.13k|  if (version == 1) {
  ------------------
  |  Branch (629:7): [True: 641, False: 495]
  ------------------
  630|  1.31k|    for (idx = 0; idx < band_count; idx++) {
  ------------------
  |  Branch (630:19): [True: 670, False: 641]
  ------------------
  631|    670|      bit_cnt_local += iusace_write_bits_buf(
  632|    670|          it_bit_buf, pstr_gain_modifiers->target_characteristic_left_present[idx], 1);
  633|    670|      if (pstr_gain_modifiers->target_characteristic_left_present[idx]) {
  ------------------
  |  Branch (633:11): [True: 0, False: 670]
  ------------------
  634|      0|        bit_cnt_local += iusace_write_bits_buf(
  635|      0|            it_bit_buf, pstr_gain_modifiers->target_characteristic_left_index[idx], 4);
  636|      0|      }
  637|       |
  638|    670|      bit_cnt_local += iusace_write_bits_buf(
  639|    670|          it_bit_buf, pstr_gain_modifiers->target_characteristic_right_present[idx], 1);
  640|    670|      if (pstr_gain_modifiers->target_characteristic_right_present[idx]) {
  ------------------
  |  Branch (640:11): [True: 0, False: 670]
  ------------------
  641|      0|        bit_cnt_local += iusace_write_bits_buf(
  642|      0|            it_bit_buf, pstr_gain_modifiers->target_characteristic_right_index[idx], 4);
  643|      0|      }
  644|       |
  645|    670|      bit_cnt_local +=
  646|    670|          iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_scaling_present[idx], 1);
  647|    670|      if (pstr_gain_modifiers->gain_scaling_present[idx]) {
  ------------------
  |  Branch (647:11): [True: 304, False: 366]
  ------------------
  648|    304|        tmp = (WORD32)(0.5f + 8.0f * pstr_gain_modifiers->attenuation_scaling[idx]);
  649|    304|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 4);
  650|       |
  651|    304|        tmp = (WORD32)(0.5f + 8.0f * pstr_gain_modifiers->amplification_scaling[idx]);
  652|    304|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 4);
  653|    304|      }
  654|       |
  655|    670|      bit_cnt_local +=
  656|    670|          iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_offset_present[idx], 1);
  657|    670|      if (pstr_gain_modifiers->gain_offset_present[idx]) {
  ------------------
  |  Branch (657:11): [True: 280, False: 390]
  ------------------
  658|    280|        if (pstr_gain_modifiers->gain_offset[idx] >= 0.0f) {
  ------------------
  |  Branch (658:13): [True: 266, False: 14]
  ------------------
  659|    266|          tmp = (WORD32)(0.5f + MAX(0.0f, 4.0f * pstr_gain_modifiers->gain_offset[idx] - 1.0f));
  ------------------
  |  |   89|    266|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 7, False: 259]
  |  |  ------------------
  ------------------
  660|    266|          sign = 0;
  661|    266|        } else {
  662|     14|          tmp = (WORD32)(0.5f + MAX(0.0f, -4.0f * pstr_gain_modifiers->gain_offset[idx] - 1.0f));
  ------------------
  |  |   89|     14|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  663|     14|          sign = 1;
  664|     14|        }
  665|    280|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, sign, 1);
  666|    280|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 5);
  667|    280|      }
  668|    670|    }
  669|    641|    if (band_count == 1) {
  ------------------
  |  Branch (669:9): [True: 256, False: 385]
  ------------------
  670|    256|      bit_cnt_local +=
  671|    256|          iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->shape_filter_present, 1);
  672|    256|      if (pstr_gain_modifiers->shape_filter_present) {
  ------------------
  |  Branch (672:11): [True: 0, False: 256]
  ------------------
  673|      0|        bit_cnt_local +=
  674|      0|            iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->shape_filter_index, 4);
  675|      0|      }
  676|    256|    }
  677|    641|  } else if (version == 0) {
  ------------------
  |  Branch (677:14): [True: 495, False: 0]
  ------------------
  678|    495|    bit_cnt_local +=
  679|    495|        iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_scaling_present[0], 1);
  680|       |
  681|    495|    if (pstr_gain_modifiers->gain_scaling_present[0]) {
  ------------------
  |  Branch (681:9): [True: 271, False: 224]
  ------------------
  682|    271|      tmp = (WORD32)(0.5f + 8.0f * pstr_gain_modifiers->attenuation_scaling[0]);
  683|    271|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 4);
  684|       |
  685|    271|      tmp = (WORD32)(0.5f + 8.0f * pstr_gain_modifiers->amplification_scaling[0]);
  686|    271|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 4);
  687|    271|    }
  688|       |
  689|    495|    bit_cnt_local +=
  690|    495|        iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_offset_present[0], 1);
  691|    495|    if (pstr_gain_modifiers->gain_offset_present[0]) {
  ------------------
  |  Branch (691:9): [True: 256, False: 239]
  ------------------
  692|    256|      if (pstr_gain_modifiers->gain_offset[0] >= 0.0f) {
  ------------------
  |  Branch (692:11): [True: 227, False: 29]
  ------------------
  693|    227|        tmp = (WORD32)(0.5f + MAX(0.0f, 4.0f * pstr_gain_modifiers->gain_offset[0] - 1.0f));
  ------------------
  |  |   89|    227|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 3, False: 224]
  |  |  ------------------
  ------------------
  694|    227|        sign = 0;
  695|    227|      } else {
  696|     29|        tmp = (WORD32)(0.5f + MAX(0.0f, -4.0f * pstr_gain_modifiers->gain_offset[0] - 1.0f));
  ------------------
  |  |   89|     29|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 29]
  |  |  ------------------
  ------------------
  697|     29|        sign = 1;
  698|     29|      }
  699|    256|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, sign, 1);
  700|    256|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 5);
  701|    256|    }
  702|    495|  }
  703|       |
  704|  1.13k|  *ptr_bit_cnt += bit_cnt_local;
  705|  1.13k|}
impd_drc_mux.c:impd_drc_write_uni_drc_config_extn:
 2594|    873|    FLAG write_bs) {
 2595|    873|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    873|#define IA_NO_ERROR 0x00000000
  ------------------
 2596|    873|  LOOPIDX idx;
 2597|    873|  WORD32 version;
 2598|    873|  WORD32 counter = 0;
 2599|    873|  WORD32 ext_size_bits = 0, bit_size_len = 0, bit_size = 0;
 2600|    873|  WORD32 bit_cnt_local = 0, bit_cnt_local_ext = 0;
 2601|    873|  WORD32 *scratch_used = &pstr_drc_state->drc_scratch_used;
 2602|    873|  VOID *ptr_scratch = &pstr_drc_state->drc_scratch_mem;
 2603|    873|  ia_bit_buf_struct *it_bit_buf = NULL;
 2604|    873|  ia_bit_buf_struct *ptr_bit_buf_ext = NULL;
 2605|       |
 2606|    873|  if (write_bs) {
  ------------------
  |  Branch (2606:7): [True: 287, False: 586]
  ------------------
 2607|    287|    it_bit_buf = &pstr_drc_state->str_bit_buf_cfg;
 2608|    287|    ptr_bit_buf_ext = &pstr_drc_state->str_bit_buf_cfg_ext;
 2609|       |
 2610|    287|    iusace_reset_bit_buffer(ptr_bit_buf_ext);
 2611|    287|  }
 2612|       |
 2613|    873|  bit_cnt_local += iusace_write_bits_buf(
 2614|    873|      it_bit_buf, pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter], 4);
 2615|  1.63k|  while (counter < 2 &&
  ------------------
  |  Branch (2615:10): [True: 1.45k, False: 182]
  ------------------
 2616|  1.45k|         pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter] != UNIDRC_CONF_EXT_TERM) {
  ------------------
  |  |   49|  1.45k|#define UNIDRC_CONF_EXT_TERM (0x0)
  ------------------
  |  Branch (2616:10): [True: 1.08k, False: 375]
  ------------------
 2617|  1.08k|    switch (pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter]) {
 2618|      0|      case UNIDRC_CONF_EXT_PARAM_DRC: {
  ------------------
  |  |   50|      0|#define UNIDRC_CONF_EXT_PARAM_DRC (0x1)
  ------------------
  |  Branch (2618:7): [True: 0, False: 1.08k]
  ------------------
 2619|      0|#ifdef LOUDNESS_LEVELING_SUPPORT
 2620|      0|        bit_cnt_local_ext = 0;
 2621|      0|#endif  // LOUDNESS_LEVELING_SUPPORT
 2622|      0|        err_code = impd_drc_write_drc_coeff_parametric_drc(
 2623|      0|            ptr_bit_buf_ext, pstr_uni_drc_config,
 2624|      0|            &(pstr_uni_drc_config_ext->str_drc_coeff_parametric_drc), &bit_cnt_local_ext);
 2625|       |
 2626|      0|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2626:13): [True: 0, False: 0]
  ------------------
 2627|      0|          return err_code;
 2628|      0|        }
 2629|       |
 2630|      0|        bit_cnt_local_ext += iusace_write_bits_buf(
 2631|      0|            ptr_bit_buf_ext, pstr_uni_drc_config_ext->parametric_drc_instructions_count, 4);
 2632|      0|        for (idx = 0; idx < pstr_uni_drc_config_ext->parametric_drc_instructions_count; idx++) {
  ------------------
  |  Branch (2632:23): [True: 0, False: 0]
  ------------------
 2633|      0|          err_code = impd_drc_write_parametric_drc_instructions(
 2634|      0|              ptr_bit_buf_ext,
 2635|      0|              pstr_uni_drc_config_ext->str_drc_coeff_parametric_drc.parametric_drc_frame_size,
 2636|      0|              &(pstr_uni_drc_config_ext->str_parametric_drc_instructions[idx]),
 2637|      0|              &bit_cnt_local_ext);
 2638|      0|          if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2638:15): [True: 0, False: 0]
  ------------------
 2639|      0|            return err_code;
 2640|      0|          }
 2641|      0|        }
 2642|      0|      } break;
 2643|    873|      case UNIDRC_CONF_EXT_V1: {
  ------------------
  |  |   51|    873|#define UNIDRC_CONF_EXT_V1 (0x2)
  ------------------
  |  Branch (2643:7): [True: 873, False: 207]
  ------------------
 2644|    873|        version = 1;
 2645|    873|#ifdef LOUDNESS_LEVELING_SUPPORT
 2646|    873|        bit_cnt_local_ext = 0;
 2647|    873|#endif  // LOUDNESS_LEVELING_SUPPORT
 2648|    873|        bit_cnt_local_ext += iusace_write_bits_buf(
 2649|    873|            ptr_bit_buf_ext, pstr_uni_drc_config_ext->downmix_instructions_v1_present, 1);
 2650|    873|        if (pstr_uni_drc_config_ext->downmix_instructions_v1_present == 1) {
  ------------------
  |  Branch (2650:13): [True: 232, False: 641]
  ------------------
 2651|    232|          bit_cnt_local_ext += iusace_write_bits_buf(
 2652|    232|              ptr_bit_buf_ext, pstr_uni_drc_config_ext->downmix_instructions_v1_count, 7);
 2653|    887|          for (idx = 0; idx < pstr_uni_drc_config_ext->downmix_instructions_v1_count; idx++) {
  ------------------
  |  Branch (2653:25): [True: 655, False: 232]
  ------------------
 2654|    655|            impd_drc_write_downmix_instructions(
 2655|    655|                ptr_bit_buf_ext, version, pstr_gain_enc,
 2656|    655|                &(pstr_uni_drc_config_ext->str_downmix_instructions_v1[idx]), &bit_cnt_local_ext);
 2657|    655|          }
 2658|    232|        }
 2659|       |
 2660|    873|        bit_cnt_local_ext += iusace_write_bits_buf(
 2661|    873|            ptr_bit_buf_ext,
 2662|    873|            pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present, 1);
 2663|    873|        if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present == 1) {
  ------------------
  |  Branch (2663:13): [True: 803, False: 70]
  ------------------
 2664|    803|          bit_cnt_local_ext += iusace_write_bits_buf(
 2665|    803|              ptr_bit_buf_ext, pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count, 3);
 2666|  2.06k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2666:25): [True: 1.26k, False: 803]
  ------------------
 2667|  1.26k|            impd_drc_write_drc_coeff_uni_drc(
 2668|  1.26k|                ptr_bit_buf_ext, version,
 2669|  1.26k|                &(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[idx]),
 2670|  1.26k|                &bit_cnt_local_ext);
 2671|  1.26k|          }
 2672|    803|#ifdef LOUDNESS_LEVELING_SUPPORT
 2673|    803|          UWORD32 num_ducking_only_drc_sets = get_num_ducking_only_drc_sets(
 2674|    803|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1,
 2675|    803|              pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count);
 2676|       |
 2677|    803|          bit_cnt_local_ext +=
 2678|    803|              iusace_write_bits_buf(ptr_bit_buf_ext,
 2679|    803|                                    pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count -
 2680|    803|                                        num_ducking_only_drc_sets,
 2681|    803|                                    6);
 2682|       |#else
 2683|       |          bit_cnt_local_ext += iusace_write_bits_buf(
 2684|       |              ptr_bit_buf_ext, pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count, 6);
 2685|       |#endif
 2686|  1.89k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2686:25): [True: 1.36k, False: 538]
  ------------------
 2687|  1.36k|#ifdef LOUDNESS_LEVELING_SUPPORT
 2688|  1.36k|            if (idx > 0 && pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx - 1]
  ------------------
  |  Branch (2688:17): [True: 884, False: 477]
  |  Branch (2688:28): [True: 219, False: 665]
  ------------------
 2689|    884|                               .ducking_only_set_present) {
 2690|    219|              continue;
 2691|    219|            }
 2692|  1.14k|#endif
 2693|  1.14k|            err_code = impd_drc_write_drc_instruct_uni_drc(
 2694|  1.14k|                ptr_bit_buf_ext, version, pstr_uni_drc_config, pstr_gain_enc,
 2695|  1.14k|                &(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx]), ptr_scratch,
 2696|  1.14k|                &bit_cnt_local_ext);
 2697|  1.14k|            if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.14k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2697:17): [True: 265, False: 877]
  ------------------
 2698|    265|              return (err_code);
 2699|    265|            }
 2700|  1.14k|          }
 2701|    803|        }
 2702|       |
 2703|    608|        bit_cnt_local_ext += iusace_write_bits_buf(
 2704|    608|            ptr_bit_buf_ext, pstr_uni_drc_config_ext->loud_eq_instructions_present, 1);
 2705|    608|        if (pstr_uni_drc_config_ext->loud_eq_instructions_present == 1) {
  ------------------
  |  Branch (2705:13): [True: 0, False: 608]
  ------------------
 2706|      0|          bit_cnt_local_ext += iusace_write_bits_buf(
 2707|      0|              ptr_bit_buf_ext, pstr_uni_drc_config_ext->loud_eq_instructions_count, 4);
 2708|      0|          for (idx = 0; idx < pstr_uni_drc_config_ext->loud_eq_instructions_count; idx++) {
  ------------------
  |  Branch (2708:25): [True: 0, False: 0]
  ------------------
 2709|      0|            impd_drc_write_loud_eq_instructions(
 2710|      0|                ptr_bit_buf_ext, &(pstr_uni_drc_config_ext->str_loud_eq_instructions[idx]),
 2711|      0|                &bit_cnt_local_ext);
 2712|      0|          }
 2713|      0|        }
 2714|       |
 2715|    608|        bit_cnt_local_ext +=
 2716|    608|            iusace_write_bits_buf(ptr_bit_buf_ext, pstr_uni_drc_config_ext->eq_present, 1);
 2717|    608|        if (pstr_uni_drc_config_ext->eq_present == 1) {
  ------------------
  |  Branch (2717:13): [True: 0, False: 608]
  ------------------
 2718|      0|          err_code = impd_drc_write_eq_coefficients(
 2719|      0|              ptr_bit_buf_ext, &(pstr_uni_drc_config_ext->str_eq_coefficients),
 2720|      0|              &bit_cnt_local_ext);
 2721|      0|          if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2721:15): [True: 0, False: 0]
  ------------------
 2722|      0|            return err_code;
 2723|      0|          }
 2724|       |
 2725|      0|          bit_cnt_local_ext += iusace_write_bits_buf(
 2726|      0|              ptr_bit_buf_ext, pstr_uni_drc_config_ext->eq_instructions_count, 4);
 2727|      0|          for (idx = 0; idx < pstr_uni_drc_config_ext->eq_instructions_count; idx++) {
  ------------------
  |  Branch (2727:25): [True: 0, False: 0]
  ------------------
 2728|      0|            err_code = impd_drc_write_eq_instructions(
 2729|      0|                ptr_bit_buf_ext, pstr_uni_drc_config_ext, pstr_gain_enc,
 2730|      0|                &(pstr_uni_drc_config_ext->str_eq_instructions[idx]), &bit_cnt_local_ext,
 2731|      0|                ptr_scratch, scratch_used);
 2732|      0|            if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2732:17): [True: 0, False: 0]
  ------------------
 2733|      0|              return (err_code);
 2734|      0|            }
 2735|      0|          }
 2736|      0|        }
 2737|    608|      } break;
 2738|       |
 2739|    608|#ifdef LOUDNESS_LEVELING_SUPPORT
 2740|    608|      case UNIDRCCONFEXT_LEVELING: {
  ------------------
  |  |   54|    207|#define UNIDRCCONFEXT_LEVELING (0x4)
  ------------------
  |  Branch (2740:7): [True: 207, False: 873]
  ------------------
 2741|    207|        bit_cnt_local_ext = 0;
 2742|    207|        err_code = write_loudness_leveling_extension(
 2743|    207|            ptr_bit_buf_ext, pstr_uni_drc_config, pstr_gain_enc, ptr_scratch, &bit_cnt_local_ext);
 2744|    207|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    207|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2744:13): [True: 24, False: 183]
  ------------------
 2745|     24|          return (err_code);
 2746|     24|        }
 2747|    207|      } break;
 2748|    183|#endif
 2749|    183|      default:
  ------------------
  |  Branch (2749:7): [True: 0, False: 1.08k]
  ------------------
 2750|      0|        break;
 2751|  1.08k|    }
 2752|       |
 2753|    791|    pstr_uni_drc_config_ext->ext_bit_size[counter] = bit_cnt_local_ext;
 2754|    791|    bit_size = pstr_uni_drc_config_ext->ext_bit_size[counter] - 1;
 2755|    791|    ext_size_bits = (WORD32)(log((FLOAT32)bit_size) / log(2.f)) + 1;
 2756|    791|#ifdef LOUDNESS_LEVELING_SUPPORT
 2757|    791|    ext_size_bits = (ext_size_bits < 4) ? 4 : ext_size_bits;
  ------------------
  |  Branch (2757:21): [True: 145, False: 646]
  ------------------
 2758|    791|#endif  // LOUDNESS_LEVELING_SUPPORT
 2759|    791|    bit_size_len = ext_size_bits - 4;
 2760|       |
 2761|    791|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size_len, 4);
 2762|       |
 2763|    791|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size, (UWORD8)ext_size_bits);
 2764|       |
 2765|    791|    switch (pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter]) {
 2766|      0|      case UNIDRC_CONF_EXT_PARAM_DRC: {
  ------------------
  |  |   50|      0|#define UNIDRC_CONF_EXT_PARAM_DRC (0x1)
  ------------------
  |  Branch (2766:7): [True: 0, False: 791]
  ------------------
 2767|      0|        err_code = impd_drc_write_drc_coeff_parametric_drc(
 2768|      0|            it_bit_buf, pstr_uni_drc_config,
 2769|      0|            &(pstr_uni_drc_config_ext->str_drc_coeff_parametric_drc), &bit_cnt_local);
 2770|       |
 2771|      0|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2771:13): [True: 0, False: 0]
  ------------------
 2772|      0|          return (err_code);
 2773|      0|        }
 2774|       |
 2775|      0|        bit_cnt_local += iusace_write_bits_buf(
 2776|      0|            it_bit_buf, pstr_uni_drc_config_ext->parametric_drc_instructions_count, 4);
 2777|      0|        for (idx = 0; idx < pstr_uni_drc_config_ext->parametric_drc_instructions_count; idx++) {
  ------------------
  |  Branch (2777:23): [True: 0, False: 0]
  ------------------
 2778|      0|          err_code = impd_drc_write_parametric_drc_instructions(
 2779|      0|              it_bit_buf,
 2780|      0|              pstr_uni_drc_config_ext->str_drc_coeff_parametric_drc.parametric_drc_frame_size,
 2781|      0|              &(pstr_uni_drc_config_ext->str_parametric_drc_instructions[idx]), &bit_cnt_local);
 2782|      0|          if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2782:15): [True: 0, False: 0]
  ------------------
 2783|      0|            return (err_code);
 2784|      0|          }
 2785|      0|        }
 2786|      0|      } break;
 2787|    608|      case UNIDRC_CONF_EXT_V1: {
  ------------------
  |  |   51|    608|#define UNIDRC_CONF_EXT_V1 (0x2)
  ------------------
  |  Branch (2787:7): [True: 608, False: 183]
  ------------------
 2788|    608|        version = 1;
 2789|    608|        bit_cnt_local += iusace_write_bits_buf(
 2790|    608|            it_bit_buf, pstr_uni_drc_config_ext->downmix_instructions_v1_present, 1);
 2791|    608|        if (pstr_uni_drc_config_ext->downmix_instructions_v1_present == 1) {
  ------------------
  |  Branch (2791:13): [True: 157, False: 451]
  ------------------
 2792|    157|          bit_cnt_local += iusace_write_bits_buf(
 2793|    157|              it_bit_buf, pstr_uni_drc_config_ext->downmix_instructions_v1_count, 7);
 2794|    656|          for (idx = 0; idx < pstr_uni_drc_config_ext->downmix_instructions_v1_count; idx++) {
  ------------------
  |  Branch (2794:25): [True: 499, False: 157]
  ------------------
 2795|    499|            impd_drc_write_downmix_instructions(
 2796|    499|                it_bit_buf, version, pstr_gain_enc,
 2797|    499|                &(pstr_uni_drc_config_ext->str_downmix_instructions_v1[idx]), &bit_cnt_local);
 2798|    499|          }
 2799|    157|        }
 2800|       |
 2801|    608|        bit_cnt_local += iusace_write_bits_buf(
 2802|    608|            it_bit_buf, pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present,
 2803|    608|            1);
 2804|    608|        if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present == 1) {
  ------------------
  |  Branch (2804:13): [True: 538, False: 70]
  ------------------
 2805|    538|          version = 1;
 2806|    538|          bit_cnt_local += iusace_write_bits_buf(
 2807|    538|              it_bit_buf, pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count, 3);
 2808|  1.46k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2808:25): [True: 926, False: 538]
  ------------------
 2809|    926|            impd_drc_write_drc_coeff_uni_drc(
 2810|    926|                it_bit_buf, version,
 2811|    926|                &(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[idx]), &bit_cnt_local);
 2812|    926|          }
 2813|    538|#ifdef LOUDNESS_LEVELING_SUPPORT
 2814|    538|          UWORD32 num_ducking_only_drc_sets = get_num_ducking_only_drc_sets(
 2815|    538|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1,
 2816|    538|              pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count);
 2817|    538|          bit_cnt_local +=
 2818|    538|              iusace_write_bits_buf(it_bit_buf,
 2819|    538|                                    pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count -
 2820|    538|                                        num_ducking_only_drc_sets,
 2821|    538|                                    6);
 2822|       |#else
 2823|       |          bit_cnt_local += iusace_write_bits_buf(
 2824|       |              it_bit_buf, pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count, 6);
 2825|       |#endif
 2826|  1.30k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2826:25): [True: 790, False: 512]
  ------------------
 2827|    790|#ifdef LOUDNESS_LEVELING_SUPPORT
 2828|    790|            if (idx > 0 && pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx - 1]
  ------------------
  |  Branch (2828:17): [True: 578, False: 212]
  |  Branch (2828:28): [True: 171, False: 407]
  ------------------
 2829|    578|                               .ducking_only_set_present) {
 2830|    171|              continue;
 2831|    171|            }
 2832|    619|#endif
 2833|    619|            err_code = impd_drc_write_drc_instruct_uni_drc(
 2834|    619|                it_bit_buf, version, pstr_uni_drc_config, pstr_gain_enc,
 2835|    619|                &(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx]), ptr_scratch,
 2836|    619|                &bit_cnt_local);
 2837|    619|            if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    619|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2837:17): [True: 26, False: 593]
  ------------------
 2838|     26|              return (err_code);
 2839|     26|            }
 2840|    619|          }
 2841|    538|        }
 2842|       |
 2843|    582|        bit_cnt_local += iusace_write_bits_buf(
 2844|    582|            it_bit_buf, pstr_uni_drc_config_ext->loud_eq_instructions_present, 1);
 2845|    582|        if (pstr_uni_drc_config_ext->loud_eq_instructions_present == 1) {
  ------------------
  |  Branch (2845:13): [True: 0, False: 582]
  ------------------
 2846|      0|          bit_cnt_local += iusace_write_bits_buf(
 2847|      0|              it_bit_buf, pstr_uni_drc_config_ext->loud_eq_instructions_count, 4);
 2848|      0|          for (idx = 0; idx < pstr_uni_drc_config_ext->loud_eq_instructions_count; idx++) {
  ------------------
  |  Branch (2848:25): [True: 0, False: 0]
  ------------------
 2849|      0|            impd_drc_write_loud_eq_instructions(
 2850|      0|                it_bit_buf, &(pstr_uni_drc_config_ext->str_loud_eq_instructions[idx]),
 2851|      0|                &bit_cnt_local);
 2852|      0|          }
 2853|      0|        }
 2854|       |
 2855|    582|        bit_cnt_local +=
 2856|    582|            iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config_ext->eq_present, 1);
 2857|    582|        if (pstr_uni_drc_config_ext->eq_present == 1) {
  ------------------
  |  Branch (2857:13): [True: 0, False: 582]
  ------------------
 2858|      0|          err_code = impd_drc_write_eq_coefficients(
 2859|      0|              it_bit_buf, &(pstr_uni_drc_config_ext->str_eq_coefficients), &bit_cnt_local);
 2860|      0|          if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2860:15): [True: 0, False: 0]
  ------------------
 2861|      0|            return err_code;
 2862|      0|          }
 2863|       |
 2864|      0|          bit_cnt_local += iusace_write_bits_buf(
 2865|      0|              it_bit_buf, pstr_uni_drc_config_ext->eq_instructions_count, 4);
 2866|      0|          for (idx = 0; idx < pstr_uni_drc_config_ext->eq_instructions_count; idx++) {
  ------------------
  |  Branch (2866:25): [True: 0, False: 0]
  ------------------
 2867|      0|            err_code = impd_drc_write_eq_instructions(
 2868|      0|                it_bit_buf, pstr_uni_drc_config_ext, pstr_gain_enc,
 2869|      0|                &(pstr_uni_drc_config_ext->str_eq_instructions[idx]), &bit_cnt_local, ptr_scratch,
 2870|      0|                scratch_used);
 2871|      0|            if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2871:17): [True: 0, False: 0]
  ------------------
 2872|      0|              return err_code;
 2873|      0|            }
 2874|      0|          }
 2875|      0|        }
 2876|    582|      } break;
 2877|    582|#ifdef LOUDNESS_LEVELING_SUPPORT
 2878|    582|      case UNIDRCCONFEXT_LEVELING: {
  ------------------
  |  |   54|    183|#define UNIDRCCONFEXT_LEVELING (0x4)
  ------------------
  |  Branch (2878:7): [True: 183, False: 608]
  ------------------
 2879|    183|        err_code = write_loudness_leveling_extension(it_bit_buf, pstr_uni_drc_config,
 2880|    183|                                                     pstr_gain_enc, ptr_scratch, &bit_cnt_local);
 2881|    183|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    183|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2881:13): [True: 1, False: 182]
  ------------------
 2882|      1|          return (err_code);
 2883|      1|        }
 2884|    183|      } break;
 2885|    182|#endif
 2886|    182|      default:
  ------------------
  |  Branch (2886:7): [True: 0, False: 791]
  ------------------
 2887|      0|        for (idx = 0; idx < pstr_uni_drc_config_ext->ext_bit_size[counter]; idx++) {
  ------------------
  |  Branch (2887:23): [True: 0, False: 0]
  ------------------
 2888|      0|          bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 2889|      0|        }
 2890|      0|        break;
 2891|    791|    }
 2892|       |
 2893|    764|    counter++;
 2894|       |
 2895|    764|    bit_cnt_local += iusace_write_bits_buf(
 2896|    764|        it_bit_buf, pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter], 4);
 2897|    764|  }
 2898|       |
 2899|    557|  *ptr_bit_cnt += bit_cnt_local;
 2900|       |
 2901|    557|  return err_code;
 2902|    873|}
impd_drc_mux.c:impd_drc_write_downmix_instructions:
 1471|  1.15k|    ia_drc_downmix_instructions_struct *pstr_downmix_instructions, WORD32 *ptr_bit_cnt) {
 1472|  1.15k|  LOOPIDX idx;
 1473|  1.15k|  WORD32 code, code_size;
 1474|  1.15k|  WORD32 bit_cnt_local = 0;
 1475|       |
 1476|  1.15k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_downmix_instructions->downmix_id, 7);
 1477|       |
 1478|  1.15k|  bit_cnt_local +=
 1479|  1.15k|      iusace_write_bits_buf(it_bit_buf, pstr_downmix_instructions->target_ch_count, 7);
 1480|       |
 1481|  1.15k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_downmix_instructions->target_layout, 8);
 1482|       |
 1483|  1.15k|  bit_cnt_local += iusace_write_bits_buf(
 1484|  1.15k|      it_bit_buf, pstr_downmix_instructions->downmix_coefficients_present, 1);
 1485|       |
 1486|  1.15k|  if (pstr_downmix_instructions->downmix_coefficients_present) {
  ------------------
  |  Branch (1486:7): [True: 755, False: 399]
  ------------------
 1487|    755|    if (version != 1) {
  ------------------
  |  Branch (1487:9): [True: 0, False: 755]
  ------------------
 1488|      0|      WORD32 is_lfe_channel = FALSE;
  ------------------
  |  |   26|      0|#define FALSE (0)
  ------------------
 1489|      0|      for (idx = 0;
 1490|      0|           idx < (pstr_downmix_instructions->target_ch_count * pstr_gain_enc->base_ch_count);
  ------------------
  |  Branch (1490:12): [True: 0, False: 0]
  ------------------
 1491|      0|           idx++) {
 1492|      0|        impd_drc_enc_downmix_coeff(pstr_downmix_instructions->downmix_coeff[idx], is_lfe_channel,
 1493|      0|                                   &code_size, &code);
 1494|      0|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
 1495|      0|      }
 1496|    755|    } else {
 1497|    755|      impd_drc_dec_write_downmix_coeff_v1(
 1498|    755|          it_bit_buf, pstr_downmix_instructions->downmix_coeff, pstr_gain_enc->base_ch_count,
 1499|    755|          pstr_downmix_instructions->target_ch_count, &bit_cnt_local);
 1500|    755|    }
 1501|    755|  }
 1502|       |
 1503|  1.15k|  *ptr_bit_cnt += bit_cnt_local;
 1504|  1.15k|}
impd_drc_mux.c:impd_drc_dec_write_downmix_coeff_v1:
  384|    755|                                                WORD32 *ptr_bit_cnt) {
  385|    755|  LOOPIDX i, j;
  386|    755|  WORD32 bs_downmix_offset = 0, code;
  387|    755|  WORD32 bit_cnt_local = 0;
  388|    755|  FLOAT32 downmix_offset[3];
  389|    755|  FLOAT32 tmp;
  390|    755|  FLOAT32 quant_err, quant_err_min;
  391|    755|  const FLOAT32 *coeff_table;
  392|       |
  393|    755|  coeff_table = impd_drc_downmix_coeff_v1;
  394|    755|  tmp = (FLOAT32)log10((FLOAT32)target_ch_count / (FLOAT32)base_ch_count);
  395|    755|  downmix_offset[0] = 0.0f;
  396|    755|  downmix_offset[1] = (FLOAT32)(0.5f * floor(0.5f + 20.0f * tmp));
  397|    755|  downmix_offset[2] = (FLOAT32)(0.5f * floor(0.5f + 40.0f * tmp));
  398|       |
  399|    755|  quant_err_min = 1000.0f;
  400|  3.02k|  for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (400:15): [True: 2.26k, False: 755]
  ------------------
  401|  2.26k|    quant_err = 0.0f;
  402|  11.2k|    for (j = 0; j < (target_ch_count * base_ch_count); j++) {
  ------------------
  |  Branch (402:17): [True: 8.96k, False: 2.26k]
  ------------------
  403|  8.96k|      code = impd_drc_encode_downmix_coefficient(downmix_coeff[j], downmix_offset[i]);
  404|  8.96k|      quant_err += (FLOAT32)fabs(20.0f * log10(downmix_coeff[j]) -
  405|  8.96k|                                 (coeff_table[code] + downmix_offset[i]));
  406|  8.96k|    }
  407|  2.26k|    if (quant_err_min > quant_err) {
  ------------------
  |  Branch (407:9): [True: 500, False: 1.76k]
  ------------------
  408|    500|      quant_err_min = quant_err;
  409|    500|      bs_downmix_offset = i;
  410|    500|    }
  411|  2.26k|  }
  412|       |
  413|    755|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bs_downmix_offset, 4);
  414|       |
  415|  3.74k|  for (j = 0; j < target_ch_count * base_ch_count; j++) {
  ------------------
  |  Branch (415:15): [True: 2.98k, False: 755]
  ------------------
  416|  2.98k|    code =
  417|  2.98k|        impd_drc_encode_downmix_coefficient(downmix_coeff[j], downmix_offset[bs_downmix_offset]);
  418|  2.98k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, 5);
  419|  2.98k|  }
  420|       |
  421|    755|  *ptr_bit_cnt += bit_cnt_local;
  422|    755|}
impd_drc_mux.c:impd_drc_encode_downmix_coefficient:
  356|  11.9k|static WORD32 impd_drc_encode_downmix_coefficient(FLOAT32 downmix_coeff, FLOAT32 downmix_offset) {
  357|  11.9k|  WORD32 idx, code;
  358|  11.9k|  FLOAT32 coeff_db;
  359|  11.9k|  const FLOAT32 *coeff_table;
  360|       |
  361|  11.9k|  coeff_table = impd_drc_downmix_coeff_v1;
  362|  11.9k|  coeff_db = 20.0f * (FLOAT32)log10(downmix_coeff) - downmix_offset;
  363|       |
  364|  11.9k|  if (coeff_db >= coeff_table[30]) {
  ------------------
  |  Branch (364:7): [True: 0, False: 11.9k]
  ------------------
  365|      0|    idx = 0;
  366|      0|    while (coeff_db < coeff_table[idx]) {
  ------------------
  |  Branch (366:12): [True: 0, False: 0]
  ------------------
  367|      0|      idx++;
  368|      0|    }
  369|      0|    if ((idx > 0) && (coeff_db > 0.5f * (coeff_table[idx - 1] + coeff_table[idx]))) {
  ------------------
  |  Branch (369:9): [True: 0, False: 0]
  |  Branch (369:22): [True: 0, False: 0]
  ------------------
  370|      0|      idx--;
  371|      0|    }
  372|      0|    code = idx;
  373|  11.9k|  } else {
  374|  11.9k|    code = 31;
  375|  11.9k|  }
  376|       |
  377|  11.9k|  return code;
  378|  11.9k|}
impd_drc_mux.c:write_loudness_leveling_extension:
 1119|    390|                                                VOID *ptr_scratch, WORD32 *bit_cnt) {
 1120|    390|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    390|#define IA_NO_ERROR 0x00000000
  ------------------
 1121|    390|  WORD32 bit_cnt_local = 0;
 1122|    390|  WORD32 drc_instructions_uni_drc_count_v1 =
 1123|    390|      pstr_uni_drc_config->str_uni_drc_config_ext.drc_instructions_uni_drc_v1_count;
 1124|    390|  WORD32 drc_instructions_uni_drc_count = pstr_uni_drc_config->drc_instructions_uni_drc_count;
 1125|    390|  WORD32 version = 0;
 1126|       |  // V0 instructions
 1127|    390|  for (WORD16 i = 0; i < drc_instructions_uni_drc_count; i++) {
  ------------------
  |  Branch (1127:22): [True: 0, False: 390]
  ------------------
 1128|      0|    ia_drc_instructions_uni_drc *pstr_drc_instruction =
 1129|      0|        &pstr_uni_drc_config->str_drc_instructions_uni_drc[i];
 1130|      0|    if (pstr_drc_instruction->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|      0|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (1130:9): [True: 0, False: 0]
  ------------------
 1131|      0|      if (i > 0 && pstr_uni_drc_config->str_drc_instructions_uni_drc[i - 1].leveling_present &&
  ------------------
  |  Branch (1131:11): [True: 0, False: 0]
  |  Branch (1131:20): [True: 0, False: 0]
  ------------------
 1132|      0|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i - 1].ducking_only_set_present) {
  ------------------
  |  Branch (1132:11): [True: 0, False: 0]
  ------------------
 1133|      0|        err_code = impd_drc_write_drc_instruct_uni_drc(it_bit_buf, version, pstr_uni_drc_config,
 1134|      0|                                                       pstr_gain_enc, pstr_drc_instruction,
 1135|      0|                                                       ptr_scratch, &bit_cnt_local);
 1136|      0|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|      0|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (1136:13): [True: 0, False: 0]
  ------------------
 1137|      0|          return (err_code);
 1138|      0|        }
 1139|      0|      } else {
 1140|      0|        bit_cnt_local +=
 1141|      0|            iusace_write_bits_buf(it_bit_buf, pstr_drc_instruction->leveling_present, 1);
 1142|      0|        if (pstr_drc_instruction->leveling_present) {
  ------------------
  |  Branch (1142:13): [True: 0, False: 0]
  ------------------
 1143|      0|          bit_cnt_local += iusace_write_bits_buf(
 1144|      0|              it_bit_buf, pstr_drc_instruction->ducking_only_set_present, 1);
 1145|      0|        }
 1146|      0|      }
 1147|      0|    }
 1148|      0|  }
 1149|       |
 1150|       |  // V1 instructions
 1151|    390|  version = 1;
 1152|  1.49k|  for (WORD16 i = 0; i < drc_instructions_uni_drc_count_v1; i++) {
  ------------------
  |  Branch (1152:22): [True: 1.13k, False: 365]
  ------------------
 1153|  1.13k|    ia_drc_instructions_uni_drc *pstr_drc_instruction =
 1154|  1.13k|        &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[i];
 1155|  1.13k|    if (pstr_drc_instruction->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.13k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (1155:9): [True: 821, False: 312]
  ------------------
 1156|    821|      if (i > 0 &&
  ------------------
  |  Branch (1156:11): [True: 564, False: 257]
  ------------------
 1157|    564|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[i - 1]
  ------------------
  |  Branch (1157:11): [True: 247, False: 317]
  ------------------
 1158|    564|              .leveling_present &&
 1159|    247|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[i - 1]
  ------------------
  |  Branch (1159:11): [True: 171, False: 76]
  ------------------
 1160|    247|              .ducking_only_set_present) {
 1161|    171|        err_code = impd_drc_write_drc_instruct_uni_drc(it_bit_buf, version, pstr_uni_drc_config,
 1162|    171|                                                       pstr_gain_enc, pstr_drc_instruction,
 1163|    171|                                                       ptr_scratch, &bit_cnt_local);
 1164|    171|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    171|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (1164:13): [True: 25, False: 146]
  ------------------
 1165|     25|          return (err_code);
 1166|     25|        }
 1167|    650|      } else {
 1168|    650|        bit_cnt_local +=
 1169|    650|            iusace_write_bits_buf(it_bit_buf, pstr_drc_instruction->leveling_present, 1);
 1170|    650|        if (pstr_drc_instruction->leveling_present) {
  ------------------
  |  Branch (1170:13): [True: 338, False: 312]
  ------------------
 1171|    338|          bit_cnt_local += iusace_write_bits_buf(
 1172|    338|              it_bit_buf, pstr_drc_instruction->ducking_only_set_present, 1);
 1173|    338|        }
 1174|    650|      }
 1175|    821|    }
 1176|  1.13k|  }
 1177|    365|  *bit_cnt += bit_cnt_local;
 1178|    365|  return IA_NO_ERROR;
  ------------------
  |  |   23|    365|#define IA_NO_ERROR 0x00000000
  ------------------
 1179|    390|}
impd_drc_mux.c:impd_drc_write_spline_nodes:
 3255|   126k|                                        WORD32 *ptr_bit_cnt) {
 3256|   126k|  LOOPIDX idx;
 3257|   126k|  WORD32 frame_end_flag;
 3258|   126k|  WORD32 bit_cnt_local = 0;
 3259|       |
 3260|   126k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->coding_mode, 1);
 3261|   126k|  if (pstr_drc_group_for_output->coding_mode != 0) {
  ------------------
  |  Branch (3261:7): [True: 51.3k, False: 74.7k]
  ------------------
 3262|   492k|    for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values - 1; idx++) {
  ------------------
  |  Branch (3262:19): [True: 440k, False: 51.3k]
  ------------------
 3263|   440k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 3264|   440k|    }
 3265|  51.3k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 1, 1);
 3266|       |
 3267|  51.3k|    if (pstr_gain_set_params->gain_interpolation_type == GAIN_INTERPOLATION_TYPE_SPLINE) {
  ------------------
  |  |   45|  51.3k|#define GAIN_INTERPOLATION_TYPE_SPLINE 0
  ------------------
  |  Branch (3267:9): [True: 32.9k, False: 18.4k]
  ------------------
 3268|   491k|      for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values; idx++) {
  ------------------
  |  Branch (3268:21): [True: 458k, False: 32.9k]
  ------------------
 3269|   458k|        bit_cnt_local +=
 3270|   458k|            iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->slope_code[idx],
 3271|   458k|                                  (UWORD8)pstr_drc_group_for_output->slope_code_size[idx]);
 3272|   458k|      }
 3273|  32.9k|    }
 3274|       |
 3275|  51.3k|    if (pstr_gain_set_params->full_frame == 0 && pstr_drc_group_for_output->n_gain_values > 0) {
  ------------------
  |  Branch (3275:9): [True: 28.1k, False: 23.2k]
  |  Branch (3275:50): [True: 28.1k, False: 0]
  ------------------
 3276|  28.1k|      if (pstr_drc_group_for_output->ts_gain_quant[pstr_drc_group_for_output->n_gain_values -
  ------------------
  |  Branch (3276:11): [True: 24.4k, False: 3.66k]
  ------------------
 3277|  28.1k|                                                   1] == (pstr_gain_enc->drc_frame_size - 1)) {
 3278|  24.4k|        frame_end_flag = 1;
 3279|  24.4k|      } else {
 3280|  3.66k|        frame_end_flag = 0;
 3281|  3.66k|      }
 3282|  28.1k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, frame_end_flag, 1);
 3283|  28.1k|    } else {
 3284|  23.2k|      frame_end_flag = 1;
 3285|  23.2k|    }
 3286|       |
 3287|   543k|    for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values; idx++) {
  ------------------
  |  Branch (3287:19): [True: 492k, False: 51.3k]
  ------------------
 3288|   492k|      if (idx < (pstr_drc_group_for_output->n_gain_values - 1) || !frame_end_flag) {
  ------------------
  |  Branch (3288:11): [True: 440k, False: 51.3k]
  |  Branch (3288:67): [True: 3.66k, False: 47.6k]
  ------------------
 3289|   444k|        bit_cnt_local +=
 3290|   444k|            iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->time_delta_code[idx],
 3291|   444k|                                  (UWORD8)pstr_drc_group_for_output->time_delta_code_size[idx]);
 3292|   444k|      }
 3293|   492k|    }
 3294|   543k|    for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values; idx++) {
  ------------------
  |  Branch (3294:19): [True: 492k, False: 51.3k]
  ------------------
 3295|   492k|      bit_cnt_local +=
 3296|   492k|          iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->gain_code[idx],
 3297|   492k|                                (UWORD8)pstr_drc_group_for_output->gain_code_length[idx]);
 3298|   492k|    }
 3299|  74.7k|  } else {
 3300|  74.7k|    bit_cnt_local +=
 3301|  74.7k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->gain_code[0],
 3302|  74.7k|                              (UWORD8)pstr_drc_group_for_output->gain_code_length[0]);
 3303|  74.7k|  }
 3304|       |
 3305|   126k|  *ptr_bit_cnt += bit_cnt_local;
 3306|   126k|}
impd_drc_mux.c:impd_drc_write_uni_drc_gain_extension:
 3310|  3.71k|    WORD32 *ptr_bit_cnt) {
 3311|  3.71k|  LOOPIDX idx;
 3312|  3.71k|  WORD32 counter = 0;
 3313|  3.71k|  WORD32 ext_size_bits, bit_size_len, bit_size;
 3314|  3.71k|  WORD32 bit_cnt_local = 0;
 3315|       |
 3316|  3.71k|  bit_cnt_local +=
 3317|  3.71k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_gain_ext->uni_drc_gain_ext_type[counter], 4);
 3318|  3.71k|  while (pstr_uni_drc_gain_ext->uni_drc_gain_ext_type[counter] != UNIDRC_GAIN_EXT_TERM) {
  ------------------
  |  |   47|  3.71k|#define UNIDRC_GAIN_EXT_TERM (0x0)
  ------------------
  |  Branch (3318:10): [True: 0, False: 3.71k]
  ------------------
 3319|      0|    bit_size = pstr_uni_drc_gain_ext->ext_bit_size[counter] - 1;
 3320|      0|    ext_size_bits = (WORD32)(log((FLOAT32)bit_size) / log(2.f)) + 1;
 3321|      0|    bit_size_len = ext_size_bits - 4;
 3322|      0|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size_len, 3);
 3323|      0|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size, (UWORD8)ext_size_bits);
 3324|      0|    switch (pstr_uni_drc_gain_ext->uni_drc_gain_ext_type[counter]) {
 3325|      0|      default:
  ------------------
  |  Branch (3325:7): [True: 0, False: 0]
  ------------------
 3326|      0|        for (idx = 0; idx < pstr_uni_drc_gain_ext->ext_bit_size[counter]; idx++) {
  ------------------
  |  Branch (3326:23): [True: 0, False: 0]
  ------------------
 3327|      0|          bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 3328|      0|        }
 3329|      0|    }
 3330|      0|    counter++;
 3331|       |
 3332|      0|    bit_cnt_local += iusace_write_bits_buf(
 3333|      0|        it_bit_buf, pstr_uni_drc_gain_ext->uni_drc_gain_ext_type[counter], 4);
 3334|      0|  }
 3335|       |
 3336|  3.71k|  *ptr_bit_cnt += bit_cnt_local;
 3337|  3.71k|}

impd_drc_get_slope_code_table_by_value:
  151|  3.81M|const ia_drc_slope_code_table_entry_struct *impd_drc_get_slope_code_table_by_value(VOID) {
  152|  3.81M|  return (&(impd_drc_slope_code_table_entry_by_value[0]));
  153|  3.81M|}
impd_drc_get_delta_gain_code_table:
  157|  1.59M|    ia_drc_delta_gain_code_entry_struct const **pstr_delta_gain_code_table, WORD32 *num_entries) {
  158|  1.59M|  if (gain_coding_profile != GAIN_CODING_PROFILE_CLIPPING) {
  ------------------
  |  |   42|  1.59M|#define GAIN_CODING_PROFILE_CLIPPING 2
  ------------------
  |  Branch (158:7): [True: 1.33M, False: 259k]
  ------------------
  159|  1.33M|    *pstr_delta_gain_code_table = impd_drc_delta_gain_code_table_by_size;
  160|  1.33M|    *num_entries = k_num_delta_gain_values_table;
  161|  1.33M|  } else {
  162|   259k|    *pstr_delta_gain_code_table = impd_drc_delta_gain_code_table_profile_2_by_size;
  163|   259k|    *num_entries = k_num_delta_gain_values_table_profile_2;
  164|   259k|  }
  165|  1.59M|}
impd_drc_generate_delta_time_code_table:
  169|  1.36k|    ia_drc_delta_time_code_table_entry_struct *pstr_delta_time_code_table) {
  170|  1.36k|  LOOPIDX idx;
  171|  1.36k|  WORD32 max_val, temp = 1;
  172|       |
  173|  9.49k|  while ((1 << temp) < 2 * num_gain_values_max) {
  ------------------
  |  Branch (173:10): [True: 8.13k, False: 1.36k]
  ------------------
  174|  8.13k|    temp++;
  175|  8.13k|  }
  176|  1.36k|  pstr_delta_time_code_table[0].size = -1;
  177|  1.36k|  pstr_delta_time_code_table[0].code = -1;
  178|  1.36k|  pstr_delta_time_code_table[0].value = -1;
  179|  1.36k|  pstr_delta_time_code_table[1].size = 2;
  180|  1.36k|  pstr_delta_time_code_table[1].code = 0x0;
  181|  1.36k|  pstr_delta_time_code_table[1].value = 1;
  182|       |
  183|  6.80k|  for (idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (183:17): [True: 5.44k, False: 1.36k]
  ------------------
  184|  5.44k|    pstr_delta_time_code_table[idx + 2].size = 4;
  185|  5.44k|    pstr_delta_time_code_table[idx + 2].code = 0x4 + idx;
  186|  5.44k|    pstr_delta_time_code_table[idx + 2].value = idx + 2;
  187|  5.44k|  }
  188|  12.2k|  for (idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (188:17): [True: 10.8k, False: 1.36k]
  ------------------
  189|  10.8k|    pstr_delta_time_code_table[idx + 6].size = 5;
  190|  10.8k|    pstr_delta_time_code_table[idx + 6].code = 0x10 + idx;
  191|  10.8k|    pstr_delta_time_code_table[idx + 6].value = idx + 6;
  192|  10.8k|  }
  193|       |
  194|  1.36k|  max_val = 2 * num_gain_values_max - 14 + 1;
  195|   175k|  for (idx = 0; idx < max_val; idx++) {
  ------------------
  |  Branch (195:17): [True: 173k, False: 1.36k]
  ------------------
  196|   173k|    pstr_delta_time_code_table[idx + 14].size = 2 + temp;
  197|   173k|    pstr_delta_time_code_table[idx + 14].code = (0x3 << temp) + idx;
  198|   173k|    pstr_delta_time_code_table[idx + 14].value = idx + 14;
  199|   173k|  }
  200|  1.36k|}
impd_drc_decode_slope_idx_value:
  202|  2.10M|FLOAT32 impd_drc_decode_slope_idx_value(const WORD32 slope_code_idx) {
  203|  2.10M|  const ia_drc_slope_code_table_entry_struct *pstr_slope_code_table =
  204|  2.10M|      impd_drc_get_slope_code_table_by_value();
  205|       |
  206|  2.10M|  return pstr_slope_code_table[slope_code_idx].value;
  207|  2.10M|}
impd_drc_decode_slope_idx_magnitude:
  209|   502k|FLOAT32 impd_drc_decode_slope_idx_magnitude(const WORD32 slope_code_idx) {
  210|   502k|  const ia_drc_slope_code_table_entry_struct *pstr_slope_code_table =
  211|   502k|      impd_drc_get_slope_code_table_by_value();
  212|       |
  213|   502k|  return (FLOAT32)fabs((FLOAT64)pstr_slope_code_table[slope_code_idx].value);
  214|   502k|}

impd_drc_init_all_filter_banks:
   58|    722|    ia_drc_filter_banks_struct *pstr_filter_banks, VOID *ptr_scratch) {
   59|    722|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    722|#define IA_NO_ERROR 0x00000000
  ------------------
   60|    722|  LOOPIDX band_idx, group_idx, i, j, k;
   61|    722|  WORD32 crossover_freq_index, num_ch_in_groups, num_phase_alignment_ch_groups;
   62|    722|  WORD32 index_found = FALSE;
  ------------------
  |  |   26|    722|#define FALSE (0)
  ------------------
   63|    722|  WORD32 group_count[MAX_CHANNEL_GROUP_COUNT + 1] = {0};
   64|    722|  WORD32 *ptr_cascade_crossover_indices[MAX_CHANNEL_GROUP_COUNT + 1];
   65|       |
   66|  7.22k|  for (i = 0; i < MAX_CHANNEL_GROUP_COUNT + 1; i++) {
  ------------------
  |  |   36|  7.22k|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|  7.22k|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
  |  Branch (66:15): [True: 6.49k, False: 722]
  ------------------
   67|  6.49k|    ptr_cascade_crossover_indices[i] = (WORD32 *)(ptr_scratch);
   68|  6.49k|    ptr_scratch = (UWORD8 *)ptr_scratch +
   69|  6.49k|                  (MAX_CHANNEL_GROUP_COUNT * 3) * sizeof(ptr_cascade_crossover_indices[i][0]);
  ------------------
  |  |   36|  6.49k|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|  6.49k|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
   70|  6.49k|  }
   71|       |
   72|    722|  num_ch_in_groups = 0;
   73|  1.48k|  for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (73:23): [True: 766, False: 722]
  ------------------
   74|    766|       group_idx++) {
   75|    766|    num_ch_in_groups += pstr_drc_instructions_uni_drc->num_channels_per_channel_group[group_idx];
   76|    766|  }
   77|    722|  num_phase_alignment_ch_groups = pstr_drc_instructions_uni_drc->num_drc_channel_groups;
   78|    722|  if (num_ch_in_groups < pstr_drc_instructions_uni_drc->drc_channel_count) {
  ------------------
  |  Branch (78:7): [True: 0, False: 722]
  ------------------
   79|      0|    num_phase_alignment_ch_groups++;
   80|      0|  }
   81|    722|  if (num_phase_alignment_ch_groups > IMPD_DRCMAX_PHASE_ALIGN_CH_GROUP) {
  ------------------
  |  |   22|    722|#define IMPD_DRCMAX_PHASE_ALIGN_CH_GROUP (32)
  ------------------
  |  Branch (81:7): [True: 0, False: 722]
  ------------------
   82|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
   83|      0|  }
   84|       |
   85|    722|  memset(pstr_filter_banks->str_drc_filter_bank, 0,
   86|    722|         sizeof(pstr_filter_banks->str_drc_filter_bank));
   87|    722|  pstr_filter_banks->num_phase_alignment_ch_groups = num_phase_alignment_ch_groups;
   88|    722|  pstr_filter_banks->num_filter_banks = pstr_drc_instructions_uni_drc->num_drc_channel_groups;
   89|    722|  if (pstr_drc_coefficients_uni_drc != NULL) {
  ------------------
  |  Branch (89:7): [True: 722, False: 0]
  ------------------
   90|  1.46k|    for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (90:25): [True: 761, False: 705]
  ------------------
   91|    761|         group_idx++) {
   92|    761|      err_code = impd_drc_filter_bank_complexity(
   93|    761|          pstr_drc_coefficients_uni_drc
   94|    761|              ->str_gain_set_params[pstr_drc_instructions_uni_drc
   95|    761|                                        ->gain_set_index_for_channel_group[group_idx]]
   96|    761|              .band_count,
   97|    761|          &(pstr_filter_banks->str_drc_filter_bank[group_idx]));
   98|    761|      if (err_code) {
  ------------------
  |  Branch (98:11): [True: 17, False: 744]
  ------------------
   99|     17|        return err_code;
  100|     17|      }
  101|    761|    }
  102|    722|  } else {
  103|      0|    pstr_filter_banks->str_drc_filter_bank->num_bands = 1;
  104|      0|  }
  105|       |
  106|    705|  if (pstr_drc_coefficients_uni_drc != NULL) {
  ------------------
  |  Branch (106:7): [True: 705, False: 0]
  ------------------
  107|  1.44k|    for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (107:25): [True: 740, False: 705]
  ------------------
  108|    740|         group_idx++) {
  109|    740|      for (band_idx = 1;
  110|  1.02k|           band_idx < pstr_drc_coefficients_uni_drc
  ------------------
  |  Branch (110:12): [True: 289, False: 740]
  ------------------
  111|  1.02k|                          ->str_gain_set_params[pstr_drc_instructions_uni_drc
  112|  1.02k|                                                    ->gain_set_index_for_channel_group[group_idx]]
  113|  1.02k|                          .band_count;
  114|    740|           band_idx++) {
  115|    289|        crossover_freq_index =
  116|    289|            pstr_drc_coefficients_uni_drc
  117|    289|                ->str_gain_set_params[pstr_drc_instructions_uni_drc
  118|    289|                                          ->gain_set_index_for_channel_group[group_idx]]
  119|    289|                .gain_params[band_idx]
  120|    289|                .crossover_freq_index;
  121|       |
  122|    615|        for (j = 0; j < num_phase_alignment_ch_groups; j++) {
  ------------------
  |  Branch (122:21): [True: 326, False: 289]
  ------------------
  123|    326|          if (j != group_idx) {
  ------------------
  |  Branch (123:15): [True: 37, False: 289]
  ------------------
  124|     37|            ptr_cascade_crossover_indices[j][group_count[j]] = crossover_freq_index;
  125|     37|            group_count[j]++;
  126|     37|            if (group_count[j] > MAX_CHANNEL_GROUP_COUNT * 3) {
  ------------------
  |  |   36|     37|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|     37|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
  |  Branch (126:17): [True: 0, False: 37]
  ------------------
  127|      0|              return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  128|      0|            }
  129|     37|          }
  130|    326|        }
  131|    289|      }
  132|    740|    }
  133|    705|  }
  134|       |
  135|    705|  i = 0;
  136|    723|  while (i < group_count[0]) {
  ------------------
  |  Branch (136:10): [True: 18, False: 705]
  ------------------
  137|     18|    crossover_freq_index = ptr_cascade_crossover_indices[0][i];
  138|     18|    index_found = FALSE;
  ------------------
  |  |   26|     18|#define FALSE (0)
  ------------------
  139|     35|    for (group_idx = 1; group_idx < num_phase_alignment_ch_groups; group_idx++) {
  ------------------
  |  Branch (139:25): [True: 18, False: 17]
  ------------------
  140|     18|      index_found = FALSE;
  ------------------
  |  |   26|     18|#define FALSE (0)
  ------------------
  141|     18|      for (j = 0; j < group_count[group_idx]; j++) {
  ------------------
  |  Branch (141:19): [True: 17, False: 1]
  ------------------
  142|     17|        if (ptr_cascade_crossover_indices[group_idx][j] == crossover_freq_index) {
  ------------------
  |  Branch (142:13): [True: 17, False: 0]
  ------------------
  143|     17|          index_found = TRUE;
  ------------------
  |  |   23|     17|#define TRUE (1)
  ------------------
  144|     17|          break;
  145|     17|        }
  146|     17|      }
  147|     18|      if (index_found == FALSE) {
  ------------------
  |  |   26|     18|#define FALSE (0)
  ------------------
  |  Branch (147:11): [True: 1, False: 17]
  ------------------
  148|      1|        break;
  149|      1|      }
  150|     18|    }
  151|     18|    if (index_found == FALSE) {
  ------------------
  |  |   26|     18|#define FALSE (0)
  ------------------
  |  Branch (151:9): [True: 1, False: 17]
  ------------------
  152|      1|      i++;
  153|     17|    } else {
  154|     51|      for (group_idx = 0; group_idx < num_phase_alignment_ch_groups; group_idx++) {
  ------------------
  |  Branch (154:27): [True: 34, False: 17]
  ------------------
  155|     34|        for (j = 0; j < group_count[group_idx]; j++) {
  ------------------
  |  Branch (155:21): [True: 34, False: 0]
  ------------------
  156|     34|          if (ptr_cascade_crossover_indices[group_idx][j] == crossover_freq_index) {
  ------------------
  |  Branch (156:15): [True: 34, False: 0]
  ------------------
  157|     34|            for (k = j + 1; k < group_count[group_idx]; k++) {
  ------------------
  |  Branch (157:29): [True: 0, False: 34]
  ------------------
  158|      0|              ptr_cascade_crossover_indices[group_idx][k - 1] =
  159|      0|                  ptr_cascade_crossover_indices[group_idx][k];
  160|      0|            }
  161|     34|            group_count[group_idx]--;
  162|     34|            break;
  163|     34|          }
  164|     34|        }
  165|     34|      }
  166|     17|      i = 0;
  167|     17|    }
  168|     18|  }
  169|  1.44k|  for (group_idx = 0; group_idx < num_phase_alignment_ch_groups; group_idx++) {
  ------------------
  |  Branch (169:23): [True: 740, False: 705]
  ------------------
  170|    740|    if (group_count[group_idx] > 0) {
  ------------------
  |  Branch (170:9): [True: 3, False: 737]
  ------------------
  171|      3|      pstr_filter_banks->str_drc_filter_bank[group_idx].complexity +=
  172|      3|          (group_count[group_idx] << 1);
  173|      3|    }
  174|    740|  }
  175|    705|  pstr_filter_banks->complexity = 0;
  176|  1.44k|  for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (176:23): [True: 740, False: 705]
  ------------------
  177|    740|       group_idx++) {
  178|    740|    pstr_filter_banks->complexity +=
  179|    740|        pstr_drc_instructions_uni_drc->num_channels_per_channel_group[group_idx] *
  180|    740|        pstr_filter_banks->str_drc_filter_bank[group_idx].complexity;
  181|    740|  }
  182|       |
  183|    705|  return err_code;
  184|    705|}
impd_drc_uni_drc_filter_bank.c:impd_drc_filter_bank_complexity:
   32|    761|    const WORD32 num_bands, ia_drc_filter_bank_struct *pstr_drc_filter_bank) {
   33|    761|  pstr_drc_filter_bank->complexity = 0;
   34|    761|  pstr_drc_filter_bank->num_bands = num_bands;
   35|    761|  switch (num_bands) {
   36|    453|    case 1:
  ------------------
  |  Branch (36:5): [True: 453, False: 308]
  ------------------
   37|    453|      break;
   38|    291|    case 2:
  ------------------
  |  Branch (38:5): [True: 291, False: 470]
  ------------------
   39|    291|      pstr_drc_filter_bank->complexity = 8;
   40|    291|      break;
   41|      0|    case 3:
  ------------------
  |  Branch (41:5): [True: 0, False: 761]
  ------------------
   42|      0|      pstr_drc_filter_bank->complexity = 18;
   43|      0|      break;
   44|      0|    case 4:
  ------------------
  |  Branch (44:5): [True: 0, False: 761]
  ------------------
   45|      0|      pstr_drc_filter_bank->complexity = 28;
   46|      0|      break;
   47|     17|    default:
  ------------------
  |  Branch (47:5): [True: 17, False: 744]
  ------------------
   48|     17|      return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
   49|      0|      break;
   50|    761|  }
   51|       |
   52|    744|  return IA_NO_ERROR;
  ------------------
  |  |   23|    744|#define IA_NO_ERROR 0x00000000
  ------------------
   53|    761|}

iusace_acelp_encode:
   53|   556k|                         WORD32 *acelp_params, iusace_scratch_mem *pstr_scratch) {
   54|   556k|  WORD32 i, i_subfr, num_bits, t;
   55|   556k|  WORD32 t0, t0_min, t0_max, index, subfrm_flag;
   56|   556k|  WORD32 t0_frac;
   57|   556k|  FLOAT32 temp, energy, max_ener, mean_ener_code;
   58|   556k|  FLOAT32 pitch_gain, code_gain, gain1, gain2;
   59|   556k|  FLOAT32 tgt_cb_corr[5], tgt_cb_corr2[2];
   60|   556k|  FLOAT32 *p_lp_filt_coeff, *p_quant_lp_filt_coeff, weighted_lpc[ORDER + 1];
   61|   556k|  FLOAT32 imp_res[LEN_SUBFR];
   62|   556k|  FLOAT32 code[LEN_SUBFR];
   63|   556k|  WORD16 cb_exc[LEN_SUBFR];
   64|   556k|  FLOAT32 error[ORDER + LEN_SUBFR + 8];
   65|   556k|  FLOAT32 cn[LEN_SUBFR];
   66|   556k|  FLOAT32 xn[LEN_SUBFR];
   67|   556k|  FLOAT32 xn2[LEN_SUBFR];
   68|   556k|  FLOAT32 dn[LEN_SUBFR];
   69|   556k|  FLOAT32 y0[LEN_SUBFR];
   70|   556k|  FLOAT32 y1[LEN_SUBFR];
   71|   556k|  FLOAT32 y2[LEN_SUBFR];
   72|   556k|  WORD32 min_pitch_lag_res1_4;
   73|   556k|  WORD32 min_pitch_lag_res1_2;
   74|   556k|  WORD32 min_pitch_lag_res1;
   75|   556k|  WORD32 max_pitch_lag;
   76|   556k|  FLOAT32 *exc_buf = pstr_scratch->p_acelp_exc_buf;
   77|   556k|  FLOAT32 *exc;
   78|   556k|  FLOAT32 mem_txn, mem_txnq;
   79|   556k|  WORD32 fac_length = len_subfrm / 2;
   80|   556k|  if (lpd_state->mode > 0) {
  ------------------
  |  Branch (80:7): [True: 316k, False: 240k]
  ------------------
   81|  38.0M|    for (i = 0; i < fac_length; i++) {
  ------------------
  |  Branch (81:17): [True: 37.7M, False: 316k]
  ------------------
   82|  37.7M|      acelp_params[i] = lpd_state->avq_params[i];
   83|  37.7M|    }
   84|   316k|    acelp_params += fac_length;
   85|   316k|  }
   86|       |
   87|   556k|  if (pit_adj == SR_MAX)
  ------------------
  |  |   90|   556k|#define SR_MAX (32000)
  ------------------
  |  Branch (87:7): [True: 92.0k, False: 464k]
  ------------------
   88|  92.0k|    exc = exc_buf + (2 * len_subfrm) + 41;
   89|   464k|  else
   90|   464k|    exc = exc_buf + (2 * len_subfrm);
   91|       |
   92|   556k|  memset(exc_buf, 0, (2 * len_subfrm) * sizeof(exc_buf[0]));
   93|   556k|  memcpy(exc_buf, lpd_state->acelp_exc, 2 * len_subfrm * sizeof(FLOAT32));
   94|   556k|  memcpy(synth_out - 128, &(lpd_state->synth[ORDER]), 128 * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
   95|   556k|  memcpy(wsynth_out - 128, &(lpd_state->wsynth[1]), 128 * sizeof(FLOAT32));
   96|       |
   97|   556k|  num_bits = ((iusace_acelp_core_numbits_1024[acelp_core_mode] - NBITS_MODE) / 4) - NBITS_LPC;
  ------------------
  |  |  142|   556k|#define NBITS_MODE (4 * 2)
  ------------------
                num_bits = ((iusace_acelp_core_numbits_1024[acelp_core_mode] - NBITS_MODE) / 4) - NBITS_LPC;
  ------------------
  |  |  143|   556k|#define NBITS_LPC (46)
  ------------------
   98|       |
   99|   556k|  if (pit_adj == 0) {
  ------------------
  |  Branch (99:7): [True: 0, False: 556k]
  ------------------
  100|      0|    min_pitch_lag_res1_4 = TMIN;
  ------------------
  |  |   99|      0|#define TMIN (34)
  ------------------
  101|      0|    min_pitch_lag_res1_2 = TFR2;
  ------------------
  |  |  100|      0|#define TFR2 (128)
  ------------------
  102|      0|    min_pitch_lag_res1 = TFR1;
  ------------------
  |  |  101|      0|#define TFR1 (160)
  ------------------
  103|      0|    max_pitch_lag = TMAX;
  ------------------
  |  |  102|      0|#define TMAX (231)
  ------------------
  104|   556k|  } else {
  105|   556k|    i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   99|   556k|#define TMIN (34)
  ------------------
                  i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   92|   556k|#define FSCALE_DENOM (12800)
  ------------------
                  i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   92|   556k|#define FSCALE_DENOM (12800)
  ------------------
                  i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   99|   556k|#define TMIN (34)
  ------------------
  106|   556k|    min_pitch_lag_res1_4 = TMIN + i;
  ------------------
  |  |   99|   556k|#define TMIN (34)
  ------------------
  107|   556k|    min_pitch_lag_res1_2 = TFR2 - i;
  ------------------
  |  |  100|   556k|#define TFR2 (128)
  ------------------
  108|   556k|    min_pitch_lag_res1 = TFR1;
  ------------------
  |  |  101|   556k|#define TFR1 (160)
  ------------------
  109|   556k|    max_pitch_lag = TMAX + (6 * i);
  ------------------
  |  |  102|   556k|#define TMAX (231)
  ------------------
  110|   556k|  }
  111|       |
  112|   556k|  ol_pitch_lag1 *= OPL_DECIM;
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
  113|   556k|  ol_pitch_lag2 *= OPL_DECIM;
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
  114|       |
  115|   556k|  t0_min = ol_pitch_lag1 - 8;
  116|       |
  117|   556k|  t = MIN(ol_pitch_lag1, ol_pitch_lag2) - 4;
  ------------------
  |  |   86|   556k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 124k, False: 432k]
  |  |  ------------------
  ------------------
  118|   556k|  if (t0_min < t) t0_min = t;
  ------------------
  |  Branch (118:7): [True: 378k, False: 178k]
  ------------------
  119|       |
  120|   556k|  if (t0_min < min_pitch_lag_res1_4) {
  ------------------
  |  Branch (120:7): [True: 150k, False: 406k]
  ------------------
  121|   150k|    t0_min = min_pitch_lag_res1_4;
  122|   150k|  }
  123|   556k|  t0_max = t0_min + 15;
  124|   556k|  t = MAX(ol_pitch_lag1, ol_pitch_lag2) + 4;
  ------------------
  |  |   89|   556k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 179k, False: 377k]
  |  |  ------------------
  ------------------
  125|   556k|  if (t0_max > t) t0_max = t;
  ------------------
  |  Branch (125:7): [True: 443k, False: 113k]
  ------------------
  126|       |
  127|   556k|  if (t0_max > max_pitch_lag) {
  ------------------
  |  Branch (127:7): [True: 21.9k, False: 534k]
  ------------------
  128|  21.9k|    t0_max = max_pitch_lag;
  129|  21.9k|    t0_min = t0_max - 15;
  130|  21.9k|  }
  131|       |
  132|   556k|  max_ener = 0.0;
  133|   556k|  mean_ener_code = 0.0;
  134|   556k|  p_quant_lp_filt_coeff = quant_lp_filt_coeff;
  135|  2.62M|  for (i_subfr = 0; i_subfr < len_subfrm; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (135:21): [True: 2.06M, False: 556k]
  ------------------
  136|  2.06M|    iusace_compute_lp_residual(p_quant_lp_filt_coeff, &speech_in[i_subfr], &exc[i_subfr],
  137|  2.06M|                               LEN_SUBFR);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  138|  2.06M|    energy = 0.01f;
  139|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (139:17): [True: 132M, False: 2.06M]
  ------------------
  140|   132M|      energy += exc[i + i_subfr] * exc[i + i_subfr];
  141|   132M|    }
  142|  2.06M|    energy = 10.0f * (FLOAT32)log10(energy / ((FLOAT32)LEN_SUBFR));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  143|  2.06M|    if (energy < 0.0) {
  ------------------
  |  Branch (143:9): [True: 1.14M, False: 926k]
  ------------------
  144|  1.14M|      energy = 0.0;
  145|  1.14M|    }
  146|  2.06M|    if (energy > max_ener) {
  ------------------
  |  Branch (146:9): [True: 493k, False: 1.57M]
  ------------------
  147|   493k|      max_ener = energy;
  148|   493k|    }
  149|  2.06M|    mean_ener_code += 0.25f * energy;
  150|  2.06M|    p_quant_lp_filt_coeff += (ORDER + 1);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  151|  2.06M|  }
  152|       |
  153|   556k|  mean_ener_code -= 5.0f * norm_corr;
  154|   556k|  mean_ener_code -= 5.0f * norm_corr2;
  155|       |
  156|   556k|  temp = (mean_ener_code - 18.0f) / 12.0f;
  157|   556k|  index = (WORD32)floor(temp + 0.5);
  158|   556k|  if (index < 0) {
  ------------------
  |  Branch (158:7): [True: 347k, False: 209k]
  ------------------
  159|   347k|    index = 0;
  160|   347k|  }
  161|   556k|  if (index > 3) {
  ------------------
  |  Branch (161:7): [True: 18.4k, False: 538k]
  ------------------
  162|  18.4k|    index = 3;
  163|  18.4k|  }
  164|   556k|  mean_ener_code = (((FLOAT32)index) * 12.0f) + 18.0f;
  165|       |
  166|   604k|  while ((mean_ener_code < (max_ener - 27.0)) && (index < 3)) {
  ------------------
  |  Branch (166:10): [True: 77.1k, False: 527k]
  |  Branch (166:50): [True: 47.3k, False: 29.7k]
  ------------------
  167|  47.3k|    index++;
  168|  47.3k|    mean_ener_code += 12.0;
  169|  47.3k|  }
  170|   556k|  *acelp_params = index;
  171|   556k|  acelp_params++;
  172|       |
  173|   556k|  p_lp_filt_coeff = lp_filt_coeff;
  174|   556k|  p_quant_lp_filt_coeff = quant_lp_filt_coeff;
  175|  2.62M|  for (i_subfr = 0; i_subfr < len_subfrm; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (175:21): [True: 2.06M, False: 556k]
  ------------------
  176|  2.06M|    subfrm_flag = i_subfr;
  177|  2.06M|    if ((len_subfrm == 256) && (i_subfr == (2 * LEN_SUBFR))) {
  ------------------
  |  |   77|  1.58M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (177:9): [True: 1.58M, False: 479k]
  |  Branch (177:32): [True: 396k, False: 1.19M]
  ------------------
  178|   396k|      subfrm_flag = 0;
  179|       |
  180|   396k|      t0_min = ol_pitch_lag2 - 8;
  181|       |
  182|   396k|      t = MIN(ol_pitch_lag1, ol_pitch_lag2) - 4;
  ------------------
  |  |   86|   396k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 124k, False: 272k]
  |  |  ------------------
  ------------------
  183|   396k|      if (t0_min < t) t0_min = t;
  ------------------
  |  Branch (183:11): [True: 276k, False: 120k]
  ------------------
  184|       |
  185|   396k|      if (t0_min < min_pitch_lag_res1_4) {
  ------------------
  |  Branch (185:11): [True: 81.3k, False: 315k]
  ------------------
  186|  81.3k|        t0_min = min_pitch_lag_res1_4;
  187|  81.3k|      }
  188|   396k|      t0_max = t0_min + 15;
  189|       |
  190|   396k|      t = MAX(ol_pitch_lag1, ol_pitch_lag2) + 4;
  ------------------
  |  |   89|   396k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 179k, False: 217k]
  |  |  ------------------
  ------------------
  191|   396k|      if (t0_max > t) t0_max = t;
  ------------------
  |  Branch (191:11): [True: 221k, False: 175k]
  ------------------
  192|       |
  193|   396k|      if (t0_max > max_pitch_lag) {
  ------------------
  |  Branch (193:11): [True: 6.80k, False: 390k]
  ------------------
  194|  6.80k|        t0_max = max_pitch_lag;
  195|  6.80k|        t0_min = t0_max - 15;
  196|  6.80k|      }
  197|   396k|    }
  198|       |
  199|  2.06M|    memcpy(xn, &wsig_in[i_subfr], LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  200|       |
  201|  2.06M|    memcpy(error, &synth_out[i_subfr - ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  memcpy(error, &synth_out[i_subfr - ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  202|  2.06M|    memset(error + ORDER, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  memset(error + ORDER, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  203|  2.06M|    iusace_synthesis_tool_float(p_quant_lp_filt_coeff, error + ORDER, error + ORDER, LEN_SUBFR,
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_synthesis_tool_float(p_quant_lp_filt_coeff, error + ORDER, error + ORDER, LEN_SUBFR,
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_synthesis_tool_float(p_quant_lp_filt_coeff, error + ORDER, error + ORDER, LEN_SUBFR,
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  204|  2.06M|                                error, pstr_scratch->p_buf_synthesis_tool);
  205|  2.06M|    iusace_get_weighted_lpc(p_lp_filt_coeff, weighted_lpc);
  206|  2.06M|    iusace_compute_lp_residual(weighted_lpc, error + ORDER, xn2, LEN_SUBFR);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_compute_lp_residual(weighted_lpc, error + ORDER, xn2, LEN_SUBFR);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  207|       |
  208|  2.06M|    temp = wsynth_out[i_subfr - 1];
  209|  2.06M|    iusace_apply_deemph(xn2, TILT_FAC, LEN_SUBFR, &temp);
  ------------------
  |  |  118|  2.06M|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(xn2, TILT_FAC, LEN_SUBFR, &temp);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  210|  2.06M|    memcpy(y0, xn2, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  211|       |
  212|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (212:17): [True: 132M, False: 2.06M]
  ------------------
  213|   132M|      xn[i] -= xn2[i];
  214|   132M|    }
  215|  2.06M|    iusace_compute_lp_residual(p_quant_lp_filt_coeff, &speech_in[i_subfr], &exc[i_subfr],
  216|  2.06M|                               LEN_SUBFR);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  217|       |
  218|  2.06M|    memset(&code[0], 0, ORDER * sizeof(code[0]));
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  219|  2.06M|    memcpy(code + ORDER, xn, (LEN_SUBFR / 2) * sizeof(FLOAT32));
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  memcpy(code + ORDER, xn, (LEN_SUBFR / 2) * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  220|  2.06M|    temp = 0.0;
  221|  2.06M|    iusace_apply_preemph(code + ORDER, TILT_FAC, LEN_SUBFR / 2, &temp);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_apply_preemph(code + ORDER, TILT_FAC, LEN_SUBFR / 2, &temp);
  ------------------
  |  |  118|  2.06M|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_preemph(code + ORDER, TILT_FAC, LEN_SUBFR / 2, &temp);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  222|  2.06M|    iusace_get_weighted_lpc(p_lp_filt_coeff, weighted_lpc);
  223|  2.06M|    iusace_synthesis_tool_float(weighted_lpc, code + ORDER, code + ORDER, LEN_SUBFR / 2, code,
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_synthesis_tool_float(weighted_lpc, code + ORDER, code + ORDER, LEN_SUBFR / 2, code,
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_synthesis_tool_float(weighted_lpc, code + ORDER, code + ORDER, LEN_SUBFR / 2, code,
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  224|  2.06M|                                pstr_scratch->p_buf_synthesis_tool);
  225|  2.06M|    iusace_compute_lp_residual(p_quant_lp_filt_coeff, code + ORDER, cn, LEN_SUBFR / 2);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
                  iusace_compute_lp_residual(p_quant_lp_filt_coeff, code + ORDER, cn, LEN_SUBFR / 2);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  226|  2.06M|    memcpy(cn + (LEN_SUBFR / 2), &exc[i_subfr + (LEN_SUBFR / 2)],
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
                  memcpy(cn + (LEN_SUBFR / 2), &exc[i_subfr + (LEN_SUBFR / 2)],
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  227|  2.06M|           (LEN_SUBFR / 2) * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  228|       |
  229|  2.06M|    iusace_get_weighted_lpc(p_lp_filt_coeff, weighted_lpc);
  230|  2.06M|    memset(imp_res, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  231|  2.06M|    memcpy(imp_res, weighted_lpc, (ORDER + 1) * sizeof(FLOAT32));
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  232|  2.06M|    iusace_synthesis_tool_float(p_quant_lp_filt_coeff, imp_res, imp_res, LEN_SUBFR,
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  233|  2.06M|                                &imp_res[ORDER + 1], pstr_scratch->p_buf_synthesis_tool);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  234|  2.06M|    temp = 0.0;
  235|  2.06M|    iusace_apply_deemph(imp_res, TILT_FAC, LEN_SUBFR, &temp);
  ------------------
  |  |  118|  2.06M|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(imp_res, TILT_FAC, LEN_SUBFR, &temp);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  236|       |
  237|  2.06M|    iusace_closed_loop_search(&exc[i_subfr], xn, imp_res, t0_min, t0_max, &t0_frac, subfrm_flag,
  238|  2.06M|                              min_pitch_lag_res1_2, min_pitch_lag_res1, &t0);
  239|       |
  240|  2.06M|    if (subfrm_flag == 0) {
  ------------------
  |  Branch (240:9): [True: 953k, False: 1.11M]
  ------------------
  241|   953k|      if (t0 < min_pitch_lag_res1_2) {
  ------------------
  |  Branch (241:11): [True: 580k, False: 373k]
  ------------------
  242|   580k|        index = t0 * 4 + t0_frac - (min_pitch_lag_res1_4 * 4);
  243|   580k|      } else if (t0 < min_pitch_lag_res1) {
  ------------------
  |  Branch (243:18): [True: 139k, False: 233k]
  ------------------
  244|   139k|        index = t0 * 2 + (t0_frac >> 1) - (min_pitch_lag_res1_2 * 2) +
  245|   139k|                ((min_pitch_lag_res1_2 - min_pitch_lag_res1_4) * 4);
  246|   233k|      } else {
  247|   233k|        index = t0 - min_pitch_lag_res1 + ((min_pitch_lag_res1_2 - min_pitch_lag_res1_4) * 4) +
  248|   233k|                ((min_pitch_lag_res1 - min_pitch_lag_res1_2) * 2);
  249|   233k|      }
  250|       |
  251|   953k|      t0_min = t0 - 8;
  252|   953k|      if (t0_min < min_pitch_lag_res1_4) {
  ------------------
  |  Branch (252:11): [True: 351k, False: 602k]
  ------------------
  253|   351k|        t0_min = min_pitch_lag_res1_4;
  254|   351k|      }
  255|   953k|      t0_max = t0_min + 15;
  256|   953k|      if (t0_max > max_pitch_lag) {
  ------------------
  |  Branch (256:11): [True: 15.7k, False: 937k]
  ------------------
  257|  15.7k|        t0_max = max_pitch_lag;
  258|  15.7k|        t0_min = t0_max - 15;
  259|  15.7k|      }
  260|  1.11M|    } else {
  261|  1.11M|      i = t0 - t0_min;
  262|  1.11M|      index = i * 4 + t0_frac;
  263|  1.11M|    }
  264|  2.06M|    *acelp_params = index;
  265|  2.06M|    acelp_params++;
  266|       |
  267|  2.06M|    iusace_acelp_ltpred_cb_exc(&exc[i_subfr], t0, t0_frac, LEN_SUBFR + 1);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  268|  2.06M|    iusace_convolve(&exc[i_subfr], imp_res, y1);
  269|  2.06M|    gain1 = iusace_acelp_tgt_cb_corr2(xn, y1, tgt_cb_corr);
  270|  2.06M|    iusace_acelp_cb_target_update(xn, xn2, y1, gain1);
  271|  2.06M|    energy = 0.0;
  272|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (272:17): [True: 132M, False: 2.06M]
  ------------------
  273|   132M|      energy += xn2[i] * xn2[i];
  274|   132M|    }
  275|       |
  276|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (276:17): [True: 132M, False: 2.06M]
  ------------------
  277|   132M|      code[i] = (FLOAT32)(0.18 * exc[i - 1 + i_subfr] + 0.64 * exc[i + i_subfr] +
  278|   132M|                          0.18 * exc[i + 1 + i_subfr]);
  279|   132M|    }
  280|  2.06M|    iusace_convolve(code, imp_res, y2);
  281|  2.06M|    gain2 = iusace_acelp_tgt_cb_corr2(xn, y2, tgt_cb_corr2);
  282|       |
  283|  2.06M|    iusace_acelp_cb_target_update(xn, xn2, y2, gain2);
  284|  2.06M|    temp = 0.0;
  285|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (285:17): [True: 132M, False: 2.06M]
  ------------------
  286|   132M|      temp += xn2[i] * xn2[i];
  287|   132M|    }
  288|       |
  289|  2.06M|    if (temp < energy) {
  ------------------
  |  Branch (289:9): [True: 824k, False: 1.24M]
  ------------------
  290|   824k|      *acelp_params = 0;
  291|   824k|      memcpy(&exc[i_subfr], code, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|   824k|#define LEN_SUBFR (64)
  ------------------
  292|   824k|      memcpy(y1, y2, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|   824k|#define LEN_SUBFR (64)
  ------------------
  293|   824k|      pitch_gain = gain2;
  294|   824k|      tgt_cb_corr[0] = tgt_cb_corr2[0];
  295|   824k|      tgt_cb_corr[1] = tgt_cb_corr2[1];
  296|  1.24M|    } else {
  297|  1.24M|      *acelp_params = 1;
  298|  1.24M|      pitch_gain = gain1;
  299|  1.24M|    }
  300|  2.06M|    acelp_params++;
  301|       |
  302|  2.06M|    iusace_acelp_cb_target_update(xn, xn2, y1, pitch_gain);
  303|  2.06M|    iusace_acelp_cb_target_update(cn, cn, &exc[i_subfr], pitch_gain);
  304|       |
  305|  2.06M|    temp = 0.0;
  306|  2.06M|    iusace_apply_preemph(imp_res, TILT_CODE, LEN_SUBFR, &temp);
  ------------------
  |  |  120|  2.06M|#define TILT_CODE (0.3f)
  ------------------
                  iusace_apply_preemph(imp_res, TILT_CODE, LEN_SUBFR, &temp);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  307|  2.06M|    if (t0_frac > 2) {
  ------------------
  |  Branch (307:9): [True: 391k, False: 1.67M]
  ------------------
  308|   391k|      t0++;
  309|   391k|    }
  310|       |
  311|  20.9M|    for (i = t0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|  20.9M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (311:18): [True: 18.9M, False: 2.06M]
  ------------------
  312|  18.9M|      imp_res[i] += imp_res[i - t0] * PIT_SHARP;
  ------------------
  |  |  119|  18.9M|#define PIT_SHARP (0.85f)
  ------------------
  313|  18.9M|    }
  314|       |
  315|  2.06M|    iusace_acelp_tgt_ir_corr(xn2, imp_res, dn);
  316|       |
  317|  2.06M|    if (acelp_core_mode == ACELP_CORE_MODE_9k6) {
  ------------------
  |  |  123|  2.06M|#define ACELP_CORE_MODE_9k6 (0)
  ------------------
  |  Branch (317:9): [True: 0, False: 2.06M]
  ------------------
  318|      0|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_20, acelp_params,
  ------------------
  |  |  130|      0|#define ACELP_NUM_BITS_20 (20)
  ------------------
  319|      0|                          pstr_scratch->p_acelp_ir_buf);
  320|      0|      acelp_params += 4;
  321|  2.06M|    } else if (acelp_core_mode == ACELP_CORE_MODE_11k2) {
  ------------------
  |  |  124|  2.06M|#define ACELP_CORE_MODE_11k2 (1)
  ------------------
  |  Branch (321:16): [True: 0, False: 2.06M]
  ------------------
  322|      0|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_28, acelp_params,
  ------------------
  |  |  131|      0|#define ACELP_NUM_BITS_28 (28)
  ------------------
  323|      0|                          pstr_scratch->p_acelp_ir_buf);
  324|      0|      acelp_params += 4;
  325|  2.06M|    } else if (acelp_core_mode == ACELP_CORE_MODE_12k8) {
  ------------------
  |  |  125|  2.06M|#define ACELP_CORE_MODE_12k8 (2)
  ------------------
  |  Branch (325:16): [True: 224k, False: 1.84M]
  ------------------
  326|   224k|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_36, acelp_params,
  ------------------
  |  |  132|   224k|#define ACELP_NUM_BITS_36 (36)
  ------------------
  327|   224k|                          pstr_scratch->p_acelp_ir_buf);
  328|   224k|      acelp_params += 4;
  329|  1.84M|    } else if (acelp_core_mode == ACELP_CORE_MODE_14k4) {
  ------------------
  |  |  126|  1.84M|#define ACELP_CORE_MODE_14k4 (3)
  ------------------
  |  Branch (329:16): [True: 0, False: 1.84M]
  ------------------
  330|      0|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_44, acelp_params,
  ------------------
  |  |  133|      0|#define ACELP_NUM_BITS_44 (44)
  ------------------
  331|      0|                          pstr_scratch->p_acelp_ir_buf);
  332|      0|      acelp_params += 4;
  333|  1.84M|    } else if (acelp_core_mode == ACELP_CORE_MODE_16k) {
  ------------------
  |  |  127|  1.84M|#define ACELP_CORE_MODE_16k (4)
  ------------------
  |  Branch (333:16): [True: 14.3k, False: 1.82M]
  ------------------
  334|  14.3k|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_52, acelp_params,
  ------------------
  |  |  134|  14.3k|#define ACELP_NUM_BITS_52 (52)
  ------------------
  335|  14.3k|                          pstr_scratch->p_acelp_ir_buf);
  336|  14.3k|      acelp_params += 4;
  337|  1.82M|    } else if (acelp_core_mode == ACELP_CORE_MODE_18k4) {
  ------------------
  |  |  128|  1.82M|#define ACELP_CORE_MODE_18k4 (5)
  ------------------
  |  Branch (337:16): [True: 1.82M, False: 0]
  ------------------
  338|  1.82M|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_64, acelp_params,
  ------------------
  |  |  135|  1.82M|#define ACELP_NUM_BITS_64 (64)
  ------------------
  339|  1.82M|                          pstr_scratch->p_acelp_ir_buf);
  340|  1.82M|      acelp_params += 8;
  341|  1.82M|    } else {
  342|      0|      iusace_acelp_cb_exc(dn, cn, imp_res, cb_exc, y2, ACELP_NUM_BITS_64, acelp_params,
  ------------------
  |  |  135|      0|#define ACELP_NUM_BITS_64 (64)
  ------------------
  343|      0|                          pstr_scratch->p_acelp_ir_buf);
  344|      0|      acelp_params += 8;
  345|      0|    }
  346|       |
  347|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (347:17): [True: 132M, False: 2.06M]
  ------------------
  348|   132M|      code[i] = (FLOAT32)(cb_exc[i] / 512);
  349|   132M|    }
  350|       |
  351|  2.06M|    temp = 0.0;
  352|  2.06M|    iusace_apply_preemph(code, TILT_CODE, LEN_SUBFR, &temp);
  ------------------
  |  |  120|  2.06M|#define TILT_CODE (0.3f)
  ------------------
                  iusace_apply_preemph(code, TILT_CODE, LEN_SUBFR, &temp);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  353|  20.9M|    for (i = t0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|  20.9M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (353:18): [True: 18.9M, False: 2.06M]
  ------------------
  354|  18.9M|      code[i] += code[i - t0] * PIT_SHARP;
  ------------------
  |  |  119|  18.9M|#define PIT_SHARP (0.85f)
  ------------------
  355|  18.9M|    }
  356|       |
  357|  2.06M|    iusace_acelp_tgt_cb_corr1(xn, y1, y2, tgt_cb_corr);
  358|  2.06M|    iusace_acelp_quant_gain(code, &pitch_gain, &code_gain, tgt_cb_corr, mean_ener_code,
  359|  2.06M|                            acelp_params);
  360|  2.06M|    acelp_params++;
  361|       |
  362|  2.06M|    temp = 0.0;
  363|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (363:17): [True: 132M, False: 2.06M]
  ------------------
  364|   132M|      temp += code[i] * code[i];
  365|   132M|    }
  366|  2.06M|    temp *= code_gain * code_gain;
  367|       |
  368|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (368:17): [True: 132M, False: 2.06M]
  ------------------
  369|   132M|      wsynth_out[i + i_subfr] = y0[i] + (pitch_gain * y1[i]) + (code_gain * y2[i]);
  370|   132M|    }
  371|       |
  372|   134M|    for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (372:17): [True: 132M, False: 2.06M]
  ------------------
  373|   132M|      exc[i + i_subfr] = pitch_gain * exc[i + i_subfr] + code_gain * code[i];
  374|   132M|    }
  375|       |
  376|  2.06M|    iusace_synthesis_tool_float(p_quant_lp_filt_coeff, &exc[i_subfr], &synth_out[i_subfr],
  377|  2.06M|                                LEN_SUBFR, &synth_out[i_subfr - ORDER],
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
                                              LEN_SUBFR, &synth_out[i_subfr - ORDER],
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  378|  2.06M|                                pstr_scratch->p_buf_synthesis_tool);
  379|  2.06M|    p_lp_filt_coeff += (ORDER + 1);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  380|  2.06M|    p_quant_lp_filt_coeff += (ORDER + 1);
  ------------------
  |  |   71|  2.06M|#define ORDER (16)
  ------------------
  381|  2.06M|  }
  382|       |
  383|   556k|  memcpy(lpd_state->acelp_exc, exc - len_subfrm, 2 * len_subfrm * sizeof(FLOAT32));
  384|   556k|  memcpy(lpd_state->synth, synth_out + len_subfrm - (ORDER + 128),
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  385|   556k|         (ORDER + 128) * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  386|   556k|  memcpy(lpd_state->wsynth, wsynth_out + len_subfrm - (1 + 128), (1 + 128) * sizeof(FLOAT32));
  387|   556k|  memcpy(lpd_state->lpc_coeffs_quant, p_quant_lp_filt_coeff - (2 * (ORDER + 1)),
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  388|   556k|         (2 * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  389|   556k|  memcpy(lpd_state->lpc_coeffs, p_lp_filt_coeff - (2 * (ORDER + 1)),
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  390|   556k|         (2 * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  391|       |
  392|   556k|  mem_txn = lpd_state->tcx_mem[128 - 1];
  393|   556k|  mem_txnq = lpd_state->tcx_fac;
  394|       |
  395|   556k|  p_quant_lp_filt_coeff = quant_lp_filt_coeff;
  396|  1.51M|  for (i_subfr = 0; i_subfr < (len_subfrm - 2 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  1.51M|#define LEN_SUBFR (64)
  ------------------
                for (i_subfr = 0; i_subfr < (len_subfrm - 2 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|   953k|#define LEN_SUBFR (64)
  ------------------
  |  Branch (396:21): [True: 953k, False: 556k]
  ------------------
  397|   953k|    iusace_get_weighted_lpc(p_quant_lp_filt_coeff, weighted_lpc);
  398|       |
  399|   953k|    memcpy(error, &speech_in[i_subfr], LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|   953k|#define LEN_SUBFR (64)
  ------------------
  400|   953k|    iusace_apply_deemph(error, TILT_FAC, LEN_SUBFR, &mem_txn);
  ------------------
  |  |  118|   953k|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(error, TILT_FAC, LEN_SUBFR, &mem_txn);
  ------------------
  |  |   77|   953k|#define LEN_SUBFR (64)
  ------------------
  401|       |
  402|   953k|    memcpy(error, &synth_out[i_subfr], LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|   953k|#define LEN_SUBFR (64)
  ------------------
  403|   953k|    iusace_apply_deemph(error, TILT_FAC, LEN_SUBFR, &mem_txnq);
  ------------------
  |  |  118|   953k|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(error, TILT_FAC, LEN_SUBFR, &mem_txnq);
  ------------------
  |  |   77|   953k|#define LEN_SUBFR (64)
  ------------------
  404|       |
  405|   953k|    p_quant_lp_filt_coeff += (ORDER + 1);
  ------------------
  |  |   71|   953k|#define ORDER (16)
  ------------------
  406|   953k|  }
  407|       |
  408|   556k|  lpd_state->tcx_quant[0] = mem_txnq;
  409|  1.67M|  for (i_subfr = 0; i_subfr < (2 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  1.67M|#define LEN_SUBFR (64)
  ------------------
                for (i_subfr = 0; i_subfr < (2 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (409:21): [True: 1.11M, False: 556k]
  ------------------
  410|  1.11M|    iusace_get_weighted_lpc(p_quant_lp_filt_coeff, weighted_lpc);
  411|       |
  412|  1.11M|    memcpy(&(lpd_state->tcx_mem[i_subfr]), &speech_in[i_subfr + (len_subfrm - 2 * LEN_SUBFR)],
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  413|  1.11M|           LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  414|  1.11M|    iusace_apply_deemph(&(lpd_state->tcx_mem[i_subfr]), TILT_FAC, LEN_SUBFR, &mem_txn);
  ------------------
  |  |  118|  1.11M|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(&(lpd_state->tcx_mem[i_subfr]), TILT_FAC, LEN_SUBFR, &mem_txn);
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  415|       |
  416|  1.11M|    memcpy(&(lpd_state->tcx_quant[1 + i_subfr]),
  417|  1.11M|           &synth_out[i_subfr + (len_subfrm - 2 * LEN_SUBFR)], LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
                         &synth_out[i_subfr + (len_subfrm - 2 * LEN_SUBFR)], LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  418|  1.11M|    iusace_apply_deemph(&(lpd_state->tcx_quant[1 + i_subfr]), TILT_FAC, LEN_SUBFR, &mem_txnq);
  ------------------
  |  |  118|  1.11M|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(&(lpd_state->tcx_quant[1 + i_subfr]), TILT_FAC, LEN_SUBFR, &mem_txnq);
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  419|  1.11M|    p_quant_lp_filt_coeff += (ORDER + 1);
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
  420|  1.11M|  }
  421|   556k|  lpd_state->tcx_fac = mem_txnq;
  422|       |
  423|   556k|  iusace_get_weighted_lpc(p_quant_lp_filt_coeff, weighted_lpc);
  424|       |
  425|   556k|  memcpy(error, &synth_out[len_subfrm - ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
                memcpy(error, &synth_out[len_subfrm - ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  426|  1.67M|  for (i_subfr = (2 * LEN_SUBFR); i_subfr < (4 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|   556k|#define LEN_SUBFR (64)
  ------------------
                for (i_subfr = (2 * LEN_SUBFR); i_subfr < (4 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  1.67M|#define LEN_SUBFR (64)
  ------------------
                for (i_subfr = (2 * LEN_SUBFR); i_subfr < (4 * LEN_SUBFR); i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (426:35): [True: 1.11M, False: 556k]
  ------------------
  427|  1.11M|    memset(error + ORDER, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
                  memset(error + ORDER, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  428|       |
  429|  1.11M|    iusace_synthesis_tool_float(p_quant_lp_filt_coeff, error + ORDER, error + ORDER, LEN_SUBFR,
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
                  iusace_synthesis_tool_float(p_quant_lp_filt_coeff, error + ORDER, error + ORDER, LEN_SUBFR,
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
                  iusace_synthesis_tool_float(p_quant_lp_filt_coeff, error + ORDER, error + ORDER, LEN_SUBFR,
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  430|  1.11M|                                error, pstr_scratch->p_buf_synthesis_tool);
  431|  1.11M|    memcpy(&(lpd_state->tcx_quant[1 + i_subfr]), error + ORDER, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
                  memcpy(&(lpd_state->tcx_quant[1 + i_subfr]), error + ORDER, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  432|  1.11M|    iusace_apply_deemph(&(lpd_state->tcx_quant[1 + i_subfr]), TILT_FAC, LEN_SUBFR, &mem_txnq);
  ------------------
  |  |  118|  1.11M|#define TILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(&(lpd_state->tcx_quant[1 + i_subfr]), TILT_FAC, LEN_SUBFR, &mem_txnq);
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  433|  1.11M|    memcpy(error, error + LEN_SUBFR, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
                  memcpy(error, error + LEN_SUBFR, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
  434|  1.11M|  }
  435|       |
  436|   556k|  lpd_state->mode = 0;
  437|       |
  438|   556k|  lpd_state->num_bits = num_bits;
  439|   556k|}

iusace_acelp_tgt_ir_corr:
  386|  2.06M|VOID iusace_acelp_tgt_ir_corr(FLOAT32 *x, FLOAT32 *ir_wsyn, FLOAT32 *corr_out) {
  387|  2.06M|  WORD16 i, j;
  388|  2.06M|  FLOAT32 sum;
  389|   134M|  for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (389:15): [True: 132M, False: 2.06M]
  ------------------
  390|   132M|    sum = 0.0F;
  391|  4.43G|    for (j = i; j < LEN_SUBFR; j++) {
  ------------------
  |  |   77|  4.43G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (391:17): [True: 4.30G, False: 132M]
  ------------------
  392|  4.30G|      sum += x[j] * ir_wsyn[j - i];
  393|  4.30G|    }
  394|   132M|    corr_out[i] = sum;
  395|   132M|  }
  396|  2.06M|}
iusace_acelp_tgt_cb_corr2:
  398|  4.13M|FLOAT32 iusace_acelp_tgt_cb_corr2(FLOAT32 *xn, FLOAT32 *y1, FLOAT32 *corr_out) {
  399|  4.13M|  FLOAT32 gain;
  400|  4.13M|  FLOAT32 t0, t1;
  401|  4.13M|  WORD16 i;
  402|  4.13M|  t0 = xn[0] * y1[0];
  403|  4.13M|  t1 = y1[0] * y1[0];
  404|  41.3M|  for (i = 1; i < LEN_SUBFR; i += 7) {
  ------------------
  |  |   77|  41.3M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (404:15): [True: 37.2M, False: 4.13M]
  ------------------
  405|  37.2M|    t0 += xn[i] * y1[i];
  406|  37.2M|    t1 += y1[i] * y1[i];
  407|  37.2M|    t0 += xn[i + 1] * y1[i + 1];
  408|  37.2M|    t1 += y1[i + 1] * y1[i + 1];
  409|  37.2M|    t0 += xn[i + 2] * y1[i + 2];
  410|  37.2M|    t1 += y1[i + 2] * y1[i + 2];
  411|  37.2M|    t0 += xn[i + 3] * y1[i + 3];
  412|  37.2M|    t1 += y1[i + 3] * y1[i + 3];
  413|  37.2M|    t0 += xn[i + 4] * y1[i + 4];
  414|  37.2M|    t1 += y1[i + 4] * y1[i + 4];
  415|  37.2M|    t0 += xn[i + 5] * y1[i + 5];
  416|  37.2M|    t1 += y1[i + 5] * y1[i + 5];
  417|  37.2M|    t0 += xn[i + 6] * y1[i + 6];
  418|  37.2M|    t1 += y1[i + 6] * y1[i + 6];
  419|  37.2M|  }
  420|  4.13M|  corr_out[0] = t1;
  421|  4.13M|  corr_out[1] = -2.0F * t0 + 0.01F;
  422|       |
  423|  4.13M|  if (t1) {
  ------------------
  |  Branch (423:7): [True: 4.07M, False: 63.7k]
  ------------------
  424|  4.07M|    gain = t0 / t1;
  425|  4.07M|  } else {
  426|  63.7k|    gain = 1.0F;
  427|  63.7k|  }
  428|  4.13M|  if (gain < 0.0) {
  ------------------
  |  Branch (428:7): [True: 766k, False: 3.36M]
  ------------------
  429|   766k|    gain = 0.0;
  430|  3.36M|  } else if (gain > 1.2F) {
  ------------------
  |  Branch (430:14): [True: 454k, False: 2.91M]
  ------------------
  431|   454k|    gain = 1.2F;
  432|   454k|  }
  433|  4.13M|  return gain;
  434|  4.13M|}
iusace_acelp_tgt_cb_corr1:
  436|  2.06M|VOID iusace_acelp_tgt_cb_corr1(FLOAT32 *xn, FLOAT32 *y1, FLOAT32 *y2, FLOAT32 *corr_out) {
  437|  2.06M|  WORD32 i;
  438|  2.06M|  FLOAT32 temp1, temp2, temp3;
  439|  2.06M|  temp1 = 0.01F + y2[0] * y2[0];
  440|  2.06M|  temp2 = 0.01F + xn[0] * y2[0];
  441|  2.06M|  temp3 = 0.01F + y1[0] * y2[0];
  442|  2.06M|  temp1 += y2[1] * y2[1];
  443|  2.06M|  temp2 += xn[1] * y2[1];
  444|  2.06M|  temp3 += y1[1] * y2[1];
  445|  2.06M|  temp1 += y2[2] * y2[2];
  446|  2.06M|  temp2 += xn[2] * y2[2];
  447|  2.06M|  temp3 += y1[2] * y2[2];
  448|  2.06M|  temp1 += y2[3] * y2[3];
  449|  2.06M|  temp2 += xn[3] * y2[3];
  450|  2.06M|  temp3 += y1[3] * y2[3];
  451|  22.7M|  for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  22.7M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (451:15): [True: 20.6M, False: 2.06M]
  ------------------
  452|  20.6M|    temp1 += y2[i] * y2[i];
  453|  20.6M|    temp2 += xn[i] * y2[i];
  454|  20.6M|    temp3 += y1[i] * y2[i];
  455|  20.6M|    temp1 += y2[i + 1] * y2[i + 1];
  456|  20.6M|    temp2 += xn[i + 1] * y2[i + 1];
  457|  20.6M|    temp3 += y1[i + 1] * y2[i + 1];
  458|  20.6M|    temp1 += y2[i + 2] * y2[i + 2];
  459|  20.6M|    temp2 += xn[i + 2] * y2[i + 2];
  460|  20.6M|    temp3 += y1[i + 2] * y2[i + 2];
  461|  20.6M|    temp1 += y2[i + 3] * y2[i + 3];
  462|  20.6M|    temp2 += xn[i + 3] * y2[i + 3];
  463|  20.6M|    temp3 += y1[i + 3] * y2[i + 3];
  464|  20.6M|    temp1 += y2[i + 4] * y2[i + 4];
  465|  20.6M|    temp2 += xn[i + 4] * y2[i + 4];
  466|  20.6M|    temp3 += y1[i + 4] * y2[i + 4];
  467|  20.6M|    temp1 += y2[i + 5] * y2[i + 5];
  468|  20.6M|    temp2 += xn[i + 5] * y2[i + 5];
  469|  20.6M|    temp3 += y1[i + 5] * y2[i + 5];
  470|  20.6M|  }
  471|  2.06M|  corr_out[2] = temp1;
  472|  2.06M|  corr_out[3] = -2.0F * temp2;
  473|  2.06M|  corr_out[4] = 2.0F * temp3;
  474|  2.06M|}
iusace_acelp_cb_target_update:
  476|  8.26M|VOID iusace_acelp_cb_target_update(FLOAT32 *x, FLOAT32 *new_x, FLOAT32 *cb_vec, FLOAT32 gain) {
  477|  8.26M|  WORD16 i;
  478|   537M|  for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   537M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (478:15): [True: 529M, False: 8.26M]
  ------------------
  479|   529M|    new_x[i] = x[i] - gain * cb_vec[i];
  480|   529M|  }
  481|  8.26M|}
iusace_acelp_cb_exc:
  485|  2.06M|                         WORD32 *acelp_param_out, FLOAT32 *scratch_acelp_ir_buf) {
  486|  2.06M|  FLOAT32 sign[LEN_SUBFR], vec[LEN_SUBFR];
  487|  2.06M|  FLOAT32 corr_x[16], corr_y[16];
  488|  2.06M|  FLOAT32 *ir_buf = scratch_acelp_ir_buf;
  489|  2.06M|  FLOAT32 corr_ir[4][16];
  490|  2.06M|  FLOAT32 corr_p1p2[4][256];
  491|  2.06M|  FLOAT32 dn2[LEN_SUBFR];
  492|  2.06M|  WORD32 pulse_pos[NPMAXPT * 4] = {0};
  493|  2.06M|  WORD32 codvec[MAX_NUM_PULSES] = {0};
  494|  2.06M|  WORD32 num_pulse_position[10] = {0};
  495|  2.06M|  WORD32 pos_max[4];
  496|  2.06M|  WORD32 dn2_pos[8 * 4];
  497|  2.06M|  UWORD8 ipos[MAX_NUM_PULSES] = {0};
  498|  2.06M|  WORD32 i, j, k, st, pos = 0, index, track, num_pulses = 0, num_iter = 4;
  499|  2.06M|  WORD32 l_index;
  500|  2.06M|  FLOAT32 psk, ps, alpk, alp = 0.0F;
  501|  2.06M|  FLOAT32 val;
  502|  2.06M|  FLOAT32 s, cor;
  503|  2.06M|  FLOAT32 *p0, *p1, *p2, *p3, *psign;
  504|  2.06M|  FLOAT32 *p1_ir_buf, *p2_ir_buf, *p3_ir_buf, *p4_ir_buf, *ir_sign_inv;
  505|  2.06M|  switch (num_bits_cb) {
  ------------------
  |  Branch (505:11): [True: 2.06M, False: 0]
  ------------------
  506|      0|    case ACELP_NUM_BITS_20:
  ------------------
  |  |  130|      0|#define ACELP_NUM_BITS_20 (20)
  ------------------
  |  Branch (506:5): [True: 0, False: 2.06M]
  ------------------
  507|      0|      num_iter = 4;
  508|      0|      alp = 2.0;
  509|      0|      num_pulses = 4;
  510|      0|      num_pulse_position[0] = 4;
  511|      0|      num_pulse_position[1] = 8;
  512|      0|      break;
  513|      0|    case ACELP_NUM_BITS_28:
  ------------------
  |  |  131|      0|#define ACELP_NUM_BITS_28 (28)
  ------------------
  |  Branch (513:5): [True: 0, False: 2.06M]
  ------------------
  514|      0|      num_iter = 4;
  515|      0|      alp = 1.5;
  516|      0|      num_pulses = 6;
  517|      0|      num_pulse_position[0] = 4;
  518|      0|      num_pulse_position[1] = 8;
  519|      0|      num_pulse_position[2] = 8;
  520|      0|      break;
  521|       |
  522|   224k|    case ACELP_NUM_BITS_36:
  ------------------
  |  |  132|   224k|#define ACELP_NUM_BITS_36 (36)
  ------------------
  |  Branch (522:5): [True: 224k, False: 1.84M]
  ------------------
  523|   224k|      num_iter = 4;
  524|   224k|      alp = 1.0;
  525|   224k|      num_pulses = 8;
  526|   224k|      num_pulse_position[0] = 4;
  527|   224k|      num_pulse_position[1] = 8;
  528|   224k|      num_pulse_position[2] = 8;
  529|   224k|      break;
  530|      0|    case ACELP_NUM_BITS_44:
  ------------------
  |  |  133|      0|#define ACELP_NUM_BITS_44 (44)
  ------------------
  |  Branch (530:5): [True: 0, False: 2.06M]
  ------------------
  531|      0|      num_iter = 4;
  532|      0|      alp = 1.0;
  533|      0|      num_pulses = 10;
  534|      0|      num_pulse_position[0] = 4;
  535|      0|      num_pulse_position[1] = 6;
  536|      0|      num_pulse_position[2] = 8;
  537|      0|      num_pulse_position[3] = 8;
  538|      0|      break;
  539|  14.3k|    case ACELP_NUM_BITS_52:
  ------------------
  |  |  134|  14.3k|#define ACELP_NUM_BITS_52 (52)
  ------------------
  |  Branch (539:5): [True: 14.3k, False: 2.05M]
  ------------------
  540|  14.3k|      num_iter = 4;
  541|  14.3k|      alp = 1.0;
  542|  14.3k|      num_pulses = 12;
  543|  14.3k|      num_pulse_position[0] = 4;
  544|  14.3k|      num_pulse_position[1] = 6;
  545|  14.3k|      num_pulse_position[2] = 8;
  546|  14.3k|      num_pulse_position[3] = 8;
  547|  14.3k|      break;
  548|  1.82M|    case ACELP_NUM_BITS_64:
  ------------------
  |  |  135|  1.82M|#define ACELP_NUM_BITS_64 (64)
  ------------------
  |  Branch (548:5): [True: 1.82M, False: 239k]
  ------------------
  549|  1.82M|      num_iter = 3;
  550|  1.82M|      alp = 0.8F;
  551|  1.82M|      num_pulses = 16;
  552|  1.82M|      num_pulse_position[0] = 4;
  553|  1.82M|      num_pulse_position[1] = 4;
  554|  1.82M|      num_pulse_position[2] = 6;
  555|  1.82M|      num_pulse_position[3] = 6;
  556|  1.82M|      num_pulse_position[4] = 8;
  557|  1.82M|      num_pulse_position[5] = 8;
  558|  1.82M|      break;
  559|  2.06M|  }
  560|       |
  561|  2.06M|  val = (lp_residual[0] * lp_residual[0]) + 1.0F;
  562|  2.06M|  cor = (corr_input[0] * corr_input[0]) + 1.0F;
  563|  20.6M|  for (i = 1; i < LEN_SUBFR; i += 7) {
  ------------------
  |  |   77|  20.6M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (563:15): [True: 18.6M, False: 2.06M]
  ------------------
  564|  18.6M|    val += (lp_residual[i] * lp_residual[i]);
  565|  18.6M|    cor += (corr_input[i] * corr_input[i]);
  566|  18.6M|    val += (lp_residual[i + 1] * lp_residual[i + 1]);
  567|  18.6M|    cor += (corr_input[i + 1] * corr_input[i + 1]);
  568|  18.6M|    val += (lp_residual[i + 2] * lp_residual[i + 2]);
  569|  18.6M|    cor += (corr_input[i + 2] * corr_input[i + 2]);
  570|  18.6M|    val += (lp_residual[i + 3] * lp_residual[i + 3]);
  571|  18.6M|    cor += (corr_input[i + 3] * corr_input[i + 3]);
  572|  18.6M|    val += (lp_residual[i + 4] * lp_residual[i + 4]);
  573|  18.6M|    cor += (corr_input[i + 4] * corr_input[i + 4]);
  574|  18.6M|    val += (lp_residual[i + 5] * lp_residual[i + 5]);
  575|  18.6M|    cor += (corr_input[i + 5] * corr_input[i + 5]);
  576|  18.6M|    val += (lp_residual[i + 6] * lp_residual[i + 6]);
  577|  18.6M|    cor += (corr_input[i + 6] * corr_input[i + 6]);
  578|  18.6M|  }
  579|  2.06M|  s = (FLOAT32)sqrt(cor / val);
  580|   134M|  for (j = 0; j < LEN_SUBFR; j++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (580:15): [True: 132M, False: 2.06M]
  ------------------
  581|   132M|    cor = (s * lp_residual[j]) + (alp * corr_input[j]);
  582|   132M|    if (cor >= 0.0F) {
  ------------------
  |  Branch (582:9): [True: 66.0M, False: 66.2M]
  ------------------
  583|  66.0M|      sign[j] = 1.0F;
  584|  66.0M|      vec[j] = -1.0F;
  585|  66.0M|      dn2[j] = cor;
  586|  66.2M|    } else {
  587|  66.2M|      sign[j] = -1.0F;
  588|  66.2M|      vec[j] = 1.0F;
  589|  66.2M|      corr_input[j] = -corr_input[j];
  590|  66.2M|      dn2[j] = -cor;
  591|  66.2M|    }
  592|   132M|  }
  593|  10.3M|  for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (593:15): [True: 8.26M, False: 2.06M]
  ------------------
  594|  74.4M|    for (k = 0; k < 8; k++) {
  ------------------
  |  Branch (594:17): [True: 66.1M, False: 8.26M]
  ------------------
  595|  66.1M|      ps = -1;
  596|  1.12G|      for (j = i; j < LEN_SUBFR; j += 4) {
  ------------------
  |  |   77|  1.12G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (596:19): [True: 1.05G, False: 66.1M]
  ------------------
  597|  1.05G|        if (dn2[j] > ps) {
  ------------------
  |  Branch (597:13): [True: 171M, False: 886M]
  ------------------
  598|   171M|          ps = dn2[j];
  599|   171M|          pos = j;
  600|   171M|        }
  601|  1.05G|      }
  602|  66.1M|      dn2[pos] = (FLOAT32)k - 8;
  603|  66.1M|      dn2_pos[i * 8 + k] = pos;
  604|  66.1M|    }
  605|  8.26M|    pos_max[i] = dn2_pos[i * 8];
  606|  8.26M|  }
  607|       |
  608|  2.06M|  memset(ir_buf, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  609|  2.06M|  memset(ir_buf + (2 * LEN_SUBFR), 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
                memset(ir_buf + (2 * LEN_SUBFR), 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  610|  2.06M|  p1_ir_buf = ir_buf + LEN_SUBFR;
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  611|  2.06M|  ir_sign_inv = ir_buf + (3 * LEN_SUBFR);
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  612|  2.06M|  memcpy(p1_ir_buf, ir_wsyn, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  613|  2.06M|  ir_sign_inv[0] = -p1_ir_buf[0];
  614|  2.06M|  ir_sign_inv[1] = -p1_ir_buf[1];
  615|  2.06M|  ir_sign_inv[2] = -p1_ir_buf[2];
  616|  2.06M|  ir_sign_inv[3] = -p1_ir_buf[3];
  617|  22.7M|  for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  22.7M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (617:15): [True: 20.6M, False: 2.06M]
  ------------------
  618|  20.6M|    ir_sign_inv[i] = -p1_ir_buf[i];
  619|  20.6M|    ir_sign_inv[i + 1] = -p1_ir_buf[i + 1];
  620|  20.6M|    ir_sign_inv[i + 2] = -p1_ir_buf[i + 2];
  621|  20.6M|    ir_sign_inv[i + 3] = -p1_ir_buf[i + 3];
  622|  20.6M|    ir_sign_inv[i + 4] = -p1_ir_buf[i + 4];
  623|  20.6M|    ir_sign_inv[i + 5] = -p1_ir_buf[i + 5];
  624|  20.6M|  }
  625|       |
  626|  2.06M|  p0 = &corr_ir[0][16 - 1];
  627|  2.06M|  p1 = &corr_ir[1][16 - 1];
  628|  2.06M|  p2 = &corr_ir[2][16 - 1];
  629|  2.06M|  p3 = &corr_ir[3][16 - 1];
  630|  2.06M|  p2_ir_buf = p1_ir_buf;
  631|  2.06M|  cor = 0.0F;
  632|  35.1M|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (632:15): [True: 33.0M, False: 2.06M]
  ------------------
  633|  33.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  634|  33.0M|    p2_ir_buf++;
  635|  33.0M|    *p3-- = cor * 0.5F;
  636|  33.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  637|  33.0M|    p2_ir_buf++;
  638|  33.0M|    *p2-- = cor * 0.5F;
  639|  33.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  640|  33.0M|    p2_ir_buf++;
  641|  33.0M|    *p1-- = cor * 0.5F;
  642|  33.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  643|  33.0M|    p2_ir_buf++;
  644|  33.0M|    *p0-- = cor * 0.5F;
  645|  33.0M|  }
  646|  2.06M|  pos = 256 - 1;
  647|  2.06M|  p4_ir_buf = p1_ir_buf + 1;
  648|  35.1M|  for (k = 0; k < 16; k++) {
  ------------------
  |  Branch (648:15): [True: 33.0M, False: 2.06M]
  ------------------
  649|  33.0M|    p3 = &corr_p1p2[2][pos];
  650|  33.0M|    p2 = &corr_p1p2[1][pos];
  651|  33.0M|    p1 = &corr_p1p2[0][pos];
  652|  33.0M|    if (k == 15) {
  ------------------
  |  Branch (652:9): [True: 2.06M, False: 31.0M]
  ------------------
  653|  2.06M|      p0 = &corr_p1p2[3][pos - 15];
  654|  31.0M|    } else {
  655|  31.0M|      p0 = &corr_p1p2[3][pos - 16];
  656|  31.0M|    }
  657|  33.0M|    cor = 0.0F;
  658|  33.0M|    p2_ir_buf = p1_ir_buf;
  659|  33.0M|    p3_ir_buf = p4_ir_buf;
  660|   281M|    for (i = k + 1; i < 16; i++) {
  ------------------
  |  Branch (660:21): [True: 248M, False: 33.0M]
  ------------------
  661|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  662|   248M|      p2_ir_buf++;
  663|   248M|      p3_ir_buf++;
  664|   248M|      *p3 = cor;
  665|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  666|   248M|      p2_ir_buf++;
  667|   248M|      p3_ir_buf++;
  668|   248M|      *p2 = cor;
  669|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  670|   248M|      p2_ir_buf++;
  671|   248M|      p3_ir_buf++;
  672|   248M|      *p1 = cor;
  673|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  674|   248M|      p2_ir_buf++;
  675|   248M|      p3_ir_buf++;
  676|   248M|      *p0 = cor;
  677|   248M|      p3 -= (16 + 1);
  678|   248M|      p2 -= (16 + 1);
  679|   248M|      p1 -= (16 + 1);
  680|   248M|      p0 -= (16 + 1);
  681|   248M|    }
  682|  33.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  683|  33.0M|    p2_ir_buf++;
  684|  33.0M|    p3_ir_buf++;
  685|  33.0M|    *p3 = cor;
  686|  33.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  687|  33.0M|    p2_ir_buf++;
  688|  33.0M|    p3_ir_buf++;
  689|  33.0M|    *p2 = cor;
  690|  33.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  691|  33.0M|    p2_ir_buf++;
  692|  33.0M|    p3_ir_buf++;
  693|  33.0M|    *p1 = cor;
  694|  33.0M|    pos -= 16;
  695|  33.0M|    p4_ir_buf += 4;
  696|  33.0M|  }
  697|  2.06M|  pos = 256 - 1;
  698|  2.06M|  p4_ir_buf = p1_ir_buf + 3;
  699|  35.1M|  for (k = 0; k < 16; k++) {
  ------------------
  |  Branch (699:15): [True: 33.0M, False: 2.06M]
  ------------------
  700|  33.0M|    p3 = &corr_p1p2[3][pos];
  701|  33.0M|    p2 = &corr_p1p2[2][pos - 1];
  702|  33.0M|    p1 = &corr_p1p2[1][pos - 1];
  703|  33.0M|    p0 = &corr_p1p2[0][pos - 1];
  704|  33.0M|    cor = 0.0F;
  705|  33.0M|    p2_ir_buf = p1_ir_buf;
  706|  33.0M|    p3_ir_buf = p4_ir_buf;
  707|   281M|    for (i = k + 1; i < 16; i++) {
  ------------------
  |  Branch (707:21): [True: 248M, False: 33.0M]
  ------------------
  708|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  709|   248M|      p2_ir_buf++;
  710|   248M|      p3_ir_buf++;
  711|   248M|      *p3 = cor;
  712|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  713|   248M|      p2_ir_buf++;
  714|   248M|      p3_ir_buf++;
  715|   248M|      *p2 = cor;
  716|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  717|   248M|      p2_ir_buf++;
  718|   248M|      p3_ir_buf++;
  719|   248M|      *p1 = cor;
  720|   248M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  721|   248M|      p2_ir_buf++;
  722|   248M|      p3_ir_buf++;
  723|   248M|      *p0 = cor;
  724|   248M|      p3 -= (16 + 1);
  725|   248M|      p2 -= (16 + 1);
  726|   248M|      p1 -= (16 + 1);
  727|   248M|      p0 -= (16 + 1);
  728|   248M|    }
  729|  33.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  730|  33.0M|    p2_ir_buf++;
  731|  33.0M|    p3_ir_buf++;
  732|  33.0M|    *p3 = cor;
  733|  33.0M|    pos--;
  734|  33.0M|    p4_ir_buf += 4;
  735|  33.0M|  }
  736|       |
  737|  2.06M|  p0 = &corr_p1p2[0][0];
  738|  10.3M|  for (k = 0; k < 4; k++) {
  ------------------
  |  Branch (738:15): [True: 8.26M, False: 2.06M]
  ------------------
  739|   140M|    for (i = k; i < LEN_SUBFR; i += 4) {
  ------------------
  |  |   77|   140M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (739:17): [True: 132M, False: 8.26M]
  ------------------
  740|   132M|      psign = sign;
  741|   132M|      if (psign[i] < 0.0F) {
  ------------------
  |  Branch (741:11): [True: 66.2M, False: 66.0M]
  ------------------
  742|  66.2M|        psign = vec;
  743|  66.2M|      }
  744|   132M|      j = (k + 1) % 4;
  745|   132M|      p0[0] = p0[0] * psign[j];
  746|   132M|      p0[1] = p0[1] * psign[j + 4];
  747|   132M|      p0[2] = p0[2] * psign[j + 8];
  748|   132M|      p0[3] = p0[3] * psign[j + 12];
  749|   132M|      p0[4] = p0[4] * psign[j + 16];
  750|   132M|      p0[5] = p0[5] * psign[j + 20];
  751|   132M|      p0[6] = p0[6] * psign[j + 24];
  752|   132M|      p0[7] = p0[7] * psign[j + 28];
  753|   132M|      p0[8] = p0[8] * psign[j + 32];
  754|   132M|      p0[9] = p0[9] * psign[j + 36];
  755|   132M|      p0[10] = p0[10] * psign[j + 40];
  756|   132M|      p0[11] = p0[11] * psign[j + 44];
  757|   132M|      p0[12] = p0[12] * psign[j + 48];
  758|   132M|      p0[13] = p0[13] * psign[j + 52];
  759|   132M|      p0[14] = p0[14] * psign[j + 56];
  760|   132M|      p0[15] = p0[15] * psign[j + 60];
  761|   132M|      p0 += 16;
  762|   132M|    }
  763|  8.26M|  }
  764|  2.06M|  psk = -1.0;
  765|  2.06M|  alpk = 1.0;
  766|  8.50M|  for (k = 0; k < num_iter; k++) {
  ------------------
  |  Branch (766:15): [True: 6.44M, False: 2.06M]
  ------------------
  767|  35.8M|    for (i = 0; i < num_pulses - (num_pulses % 3); i += 3) {
  ------------------
  |  Branch (767:17): [True: 29.4M, False: 6.44M]
  ------------------
  768|  29.4M|      ipos[i] = iusace_acelp_ipos[(k * 4) + i];
  769|  29.4M|      ipos[i + 1] = iusace_acelp_ipos[(k * 4) + i + 1];
  770|  29.4M|      ipos[i + 2] = iusace_acelp_ipos[(k * 4) + i + 2];
  771|  29.4M|    }
  772|  13.7M|    for (; i < num_pulses; i++) {
  ------------------
  |  Branch (772:12): [True: 7.28M, False: 6.44M]
  ------------------
  773|  7.28M|      ipos[i] = iusace_acelp_ipos[(k * 4) + i];
  774|  7.28M|    }
  775|       |
  776|  6.44M|    if ((num_bits_cb == 20) | (num_bits_cb == 28) | (num_bits_cb == 12) | (num_bits_cb == 16)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 6.44M]
  ------------------
  777|      0|      pos = 0;
  778|      0|      ps = 0.0F;
  779|      0|      alp = 0.0F;
  780|      0|      memset(vec, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|      0|#define LEN_SUBFR (64)
  ------------------
  781|      0|      if (num_bits_cb == 28) {
  ------------------
  |  Branch (781:11): [True: 0, False: 0]
  ------------------
  782|      0|        ipos[4] = 0;
  783|      0|        ipos[5] = 1;
  784|      0|      }
  785|       |
  786|      0|      if (num_bits_cb == 16) {
  ------------------
  |  Branch (786:11): [True: 0, False: 0]
  ------------------
  787|      0|        ipos[0] = 0;
  788|      0|        ipos[1] = 2;
  789|      0|        ipos[2] = 1;
  790|      0|        ipos[3] = 3;
  791|      0|      }
  792|  6.44M|    } else if ((num_bits_cb == 36) | (num_bits_cb == 44)) {
  ------------------
  |  Branch (792:16): [True: 899k, False: 5.54M]
  ------------------
  793|   899k|      pos = 2;
  794|   899k|      pulse_pos[0] = pos_max[ipos[0]];
  795|   899k|      pulse_pos[1] = pos_max[ipos[1]];
  796|   899k|      ps = corr_input[pulse_pos[0]] + corr_input[pulse_pos[1]];
  797|   899k|      alp = corr_ir[ipos[0]][pulse_pos[0] >> 2] + corr_ir[ipos[1]][pulse_pos[1] >> 2] +
  798|   899k|            corr_p1p2[ipos[0]][((pulse_pos[0] >> 2) << 4) + (pulse_pos[1] >> 2)];
  799|   899k|      if (sign[pulse_pos[0]] < 0.0) {
  ------------------
  |  Branch (799:11): [True: 484k, False: 415k]
  ------------------
  800|   484k|        p0 = ir_sign_inv - pulse_pos[0];
  801|   484k|      } else {
  802|   415k|        p0 = p1_ir_buf - pulse_pos[0];
  803|   415k|      }
  804|   899k|      if (sign[pulse_pos[1]] < 0.0) {
  ------------------
  |  Branch (804:11): [True: 484k, False: 415k]
  ------------------
  805|   484k|        p1 = ir_sign_inv - pulse_pos[1];
  806|   484k|      } else {
  807|   415k|        p1 = p1_ir_buf - pulse_pos[1];
  808|   415k|      }
  809|   899k|      vec[0] = p0[0] + p1[0];
  810|   899k|      vec[1] = p0[1] + p1[1];
  811|   899k|      vec[2] = p0[2] + p1[2];
  812|   899k|      vec[3] = p0[3] + p1[3];
  813|  9.89M|      for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  9.89M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (813:19): [True: 8.99M, False: 899k]
  ------------------
  814|  8.99M|        vec[i] = p0[i] + p1[i];
  815|  8.99M|        vec[i + 1] = p0[i + 1] + p1[i + 1];
  816|  8.99M|        vec[i + 2] = p0[i + 2] + p1[i + 2];
  817|  8.99M|        vec[i + 3] = p0[i + 3] + p1[i + 3];
  818|  8.99M|        vec[i + 4] = p0[i + 4] + p1[i + 4];
  819|  8.99M|        vec[i + 5] = p0[i + 5] + p1[i + 5];
  820|  8.99M|      }
  821|   899k|      if (num_bits_cb == 44) {
  ------------------
  |  Branch (821:11): [True: 0, False: 899k]
  ------------------
  822|      0|        ipos[8] = 0;
  823|      0|        ipos[9] = 1;
  824|      0|      }
  825|  5.54M|    } else {
  826|  5.54M|      pos = 4;
  827|  5.54M|      pulse_pos[0] = pos_max[ipos[0]];
  828|  5.54M|      pulse_pos[1] = pos_max[ipos[1]];
  829|  5.54M|      pulse_pos[2] = pos_max[ipos[2]];
  830|  5.54M|      pulse_pos[3] = pos_max[ipos[3]];
  831|  5.54M|      ps = corr_input[pulse_pos[0]] + corr_input[pulse_pos[1]] + corr_input[pulse_pos[2]] +
  832|  5.54M|           corr_input[pulse_pos[3]];
  833|  5.54M|      p0 = p1_ir_buf - pulse_pos[0];
  834|  5.54M|      if (sign[pulse_pos[0]] < 0.0) {
  ------------------
  |  Branch (834:11): [True: 2.75M, False: 2.78M]
  ------------------
  835|  2.75M|        p0 = ir_sign_inv - pulse_pos[0];
  836|  2.75M|      }
  837|  5.54M|      p1 = p1_ir_buf - pulse_pos[1];
  838|  5.54M|      if (sign[pulse_pos[1]] < 0.0) {
  ------------------
  |  Branch (838:11): [True: 2.74M, False: 2.79M]
  ------------------
  839|  2.74M|        p1 = ir_sign_inv - pulse_pos[1];
  840|  2.74M|      }
  841|  5.54M|      p2 = p1_ir_buf - pulse_pos[2];
  842|  5.54M|      if (sign[pulse_pos[2]] < 0.0) {
  ------------------
  |  Branch (842:11): [True: 2.75M, False: 2.78M]
  ------------------
  843|  2.75M|        p2 = ir_sign_inv - pulse_pos[2];
  844|  2.75M|      }
  845|  5.54M|      p3 = p1_ir_buf - pulse_pos[3];
  846|  5.54M|      if (sign[pulse_pos[3]] < 0.0) {
  ------------------
  |  Branch (846:11): [True: 2.75M, False: 2.78M]
  ------------------
  847|  2.75M|        p3 = ir_sign_inv - pulse_pos[3];
  848|  2.75M|      }
  849|  5.54M|      vec[0] = p0[0] + p1[0] + p2[0] + p3[0];
  850|   121M|      for (i = 1; i < LEN_SUBFR; i += 3) {
  ------------------
  |  |   77|   121M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (850:19): [True: 116M, False: 5.54M]
  ------------------
  851|   116M|        vec[i] = p0[i] + p1[i] + p2[i] + p3[i];
  852|   116M|        vec[i + 1] = p0[i + 1] + p1[i + 1] + p2[i + 1] + p3[i + 1];
  853|   116M|        vec[i + 2] = p0[i + 2] + p1[i + 2] + p2[i + 2] + p3[i + 2];
  854|   116M|      }
  855|  5.54M|      alp = 0.0F;
  856|  5.54M|      alp += vec[0] * vec[0] + vec[1] * vec[1];
  857|  5.54M|      alp += vec[2] * vec[2] + vec[3] * vec[3];
  858|  60.9M|      for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  60.9M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (858:19): [True: 55.4M, False: 5.54M]
  ------------------
  859|  55.4M|        alp += vec[i] * vec[i];
  860|  55.4M|        alp += vec[i + 1] * vec[i + 1];
  861|  55.4M|        alp += vec[i + 2] * vec[i + 2];
  862|  55.4M|        alp += vec[i + 3] * vec[i + 3];
  863|  55.4M|        alp += vec[i + 4] * vec[i + 4];
  864|  55.4M|        alp += vec[i + 5] * vec[i + 5];
  865|  55.4M|      }
  866|  5.54M|      alp *= 0.5F;
  867|  5.54M|      if (num_bits_cb == 72) {
  ------------------
  |  Branch (867:11): [True: 0, False: 5.54M]
  ------------------
  868|      0|        ipos[16] = 0;
  869|      0|        ipos[17] = 1;
  870|      0|      }
  871|  5.54M|    }
  872|       |
  873|  42.2M|    for (j = pos, st = 0; j < num_pulses; j += 2, st++) {
  ------------------
  |  Branch (873:27): [True: 35.8M, False: 6.44M]
  ------------------
  874|  35.8M|      if ((num_pulses - j) >= 2) {
  ------------------
  |  Branch (874:11): [True: 35.8M, False: 0]
  ------------------
  875|  35.8M|        iusace_acelp_ir_vec_corr1(p1_ir_buf, vec, ipos[j], sign, corr_ir, corr_x, dn2_pos,
  876|  35.8M|                                  num_pulse_position[st]);
  877|  35.8M|        iusace_acelp_ir_vec_corr2(p1_ir_buf, vec, ipos[j + 1], sign, corr_ir, corr_y);
  878|       |
  879|  35.8M|        iusace_acelp_get_2p_pos(num_pulse_position[st], ipos[j], ipos[j + 1], &ps, &alp,
  880|  35.8M|                                &pulse_pos[j], &pulse_pos[j + 1], corr_input, dn2_pos, corr_x,
  881|  35.8M|                                corr_y, corr_p1p2);
  882|  35.8M|      } else {
  883|      0|        iusace_acelp_ir_vec_corr2(p1_ir_buf, vec, ipos[j], sign, corr_ir, corr_x);
  884|      0|        iusace_acelp_ir_vec_corr2(p1_ir_buf, vec, ipos[j + 1], sign, corr_ir, corr_y);
  885|      0|        iusace_acelp_get_1p_pos(ipos[j], ipos[j + 1], &ps, &alp, &pulse_pos[j], corr_input,
  886|      0|                                corr_x, corr_y);
  887|      0|      }
  888|  35.8M|      if (j < (num_pulses - 2)) {
  ------------------
  |  Branch (888:11): [True: 29.3M, False: 6.44M]
  ------------------
  889|  29.3M|        p0 = p1_ir_buf - pulse_pos[j];
  890|  29.3M|        if (sign[pulse_pos[j]] < 0.0) {
  ------------------
  |  Branch (890:13): [True: 14.6M, False: 14.7M]
  ------------------
  891|  14.6M|          p0 = ir_sign_inv - pulse_pos[j];
  892|  14.6M|        }
  893|  29.3M|        p1 = p1_ir_buf - pulse_pos[j + 1];
  894|  29.3M|        if (sign[pulse_pos[j + 1]] < 0.0) {
  ------------------
  |  Branch (894:13): [True: 14.6M, False: 14.7M]
  ------------------
  895|  14.6M|          p1 = ir_sign_inv - pulse_pos[j + 1];
  896|  14.6M|        }
  897|  29.3M|        vec[0] += p0[0] + p1[0];
  898|  29.3M|        vec[1] += p0[1] + p1[1];
  899|  29.3M|        vec[2] += p0[2] + p1[2];
  900|  29.3M|        vec[3] += p0[3] + p1[3];
  901|   323M|        for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|   323M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (901:21): [True: 293M, False: 29.3M]
  ------------------
  902|   293M|          vec[i] += p0[i] + p1[i];
  903|   293M|          vec[i + 1] += p0[i + 1] + p1[i + 1];
  904|   293M|          vec[i + 2] += p0[i + 2] + p1[i + 2];
  905|   293M|          vec[i + 3] += p0[i + 3] + p1[i + 3];
  906|   293M|          vec[i + 4] += p0[i + 4] + p1[i + 4];
  907|   293M|          vec[i + 5] += p0[i + 5] + p1[i + 5];
  908|   293M|        }
  909|  29.3M|      }
  910|  35.8M|    }
  911|  6.44M|    ps = ps * ps;
  912|  6.44M|    s = (alpk * ps) - (psk * alp);
  913|  6.44M|    if (s > 0.0F) {
  ------------------
  |  Branch (913:9): [True: 3.75M, False: 2.68M]
  ------------------
  914|  3.75M|      psk = ps;
  915|  3.75M|      alpk = alp;
  916|  3.75M|      memcpy(codvec, pulse_pos, num_pulses * sizeof(WORD32));
  917|  3.75M|    }
  918|  6.44M|  }
  919|       |
  920|  2.06M|  memset(alg_cb_exc_out, 0, LEN_SUBFR * sizeof(WORD16));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  921|  2.06M|  memset(filt_cb_exc, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
  922|  2.06M|  memset(pulse_pos, 0xffffffff, NPMAXPT * 4 * sizeof(WORD32));
  ------------------
  |  |  176|  2.06M|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  2.06M|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  923|  33.2M|  for (k = 0; k < num_pulses; k++) {
  ------------------
  |  Branch (923:15): [True: 31.2M, False: 2.06M]
  ------------------
  924|  31.2M|    i = codvec[k];
  925|  31.2M|    val = sign[i];
  926|  31.2M|    index = i / 4;
  927|  31.2M|    track = i % 4;
  928|  31.2M|    if (val > 0) {
  ------------------
  |  Branch (928:9): [True: 15.6M, False: 15.5M]
  ------------------
  929|  15.6M|      alg_cb_exc_out[i] += 512;
  930|  15.6M|      codvec[k] += (2 * LEN_SUBFR);
  ------------------
  |  |   77|  15.6M|#define LEN_SUBFR (64)
  ------------------
  931|  15.6M|    } else {
  932|  15.5M|      alg_cb_exc_out[i] -= 512;
  933|  15.5M|      index += 16;
  934|  15.5M|    }
  935|  31.2M|    i = track * NPMAXPT;
  ------------------
  |  |  176|  31.2M|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  31.2M|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  936|  76.1M|    while (pulse_pos[i] >= 0) {
  ------------------
  |  Branch (936:12): [True: 44.9M, False: 31.2M]
  ------------------
  937|  44.9M|      i++;
  938|  44.9M|    }
  939|  31.2M|    pulse_pos[i] = index;
  940|  31.2M|    p0 = ir_sign_inv - codvec[k];
  941|  31.2M|    filt_cb_exc[0] += p0[0];
  942|   686M|    for (i = 1; i < LEN_SUBFR; i += 3) {
  ------------------
  |  |   77|   686M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (942:17): [True: 655M, False: 31.2M]
  ------------------
  943|   655M|      filt_cb_exc[i] += p0[i];
  944|   655M|      filt_cb_exc[i + 1] += p0[i + 1];
  945|   655M|      filt_cb_exc[i + 2] += p0[i + 2];
  946|   655M|    }
  947|  31.2M|  }
  948|       |
  949|  2.06M|  if (num_bits_cb == ACELP_NUM_BITS_20) {
  ------------------
  |  |  130|  2.06M|#define ACELP_NUM_BITS_20 (20)
  ------------------
  |  Branch (949:7): [True: 0, False: 2.06M]
  ------------------
  950|      0|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (950:21): [True: 0, False: 0]
  ------------------
  951|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  952|      0|      acelp_param_out[track] = iusace_acelp_quant_1p_n1bits(pulse_pos[k], 4);
  953|      0|    }
  954|  2.06M|  } else if (num_bits_cb == ACELP_NUM_BITS_28) {
  ------------------
  |  |  131|  2.06M|#define ACELP_NUM_BITS_28 (28)
  ------------------
  |  Branch (954:14): [True: 0, False: 2.06M]
  ------------------
  955|      0|    for (track = 0; track < (4 - 2); track++) {
  ------------------
  |  Branch (955:21): [True: 0, False: 0]
  ------------------
  956|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  957|      0|      acelp_param_out[track] = iusace_acelp_quant_2p_2n1bits(pulse_pos[k], pulse_pos[k + 1], 4);
  958|      0|    }
  959|      0|    for (track = 2; track < 4; track++) {
  ------------------
  |  Branch (959:21): [True: 0, False: 0]
  ------------------
  960|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  961|      0|      acelp_param_out[track] = iusace_acelp_quant_1p_n1bits(pulse_pos[k], 4);
  962|      0|    }
  963|  2.06M|  } else if (num_bits_cb == ACELP_NUM_BITS_36) {
  ------------------
  |  |  132|  2.06M|#define ACELP_NUM_BITS_36 (36)
  ------------------
  |  Branch (963:14): [True: 224k, False: 1.84M]
  ------------------
  964|  1.12M|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (964:21): [True: 899k, False: 224k]
  ------------------
  965|   899k|      k = track * NPMAXPT;
  ------------------
  |  |  176|   899k|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|   899k|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  966|   899k|      acelp_param_out[track] = iusace_acelp_quant_2p_2n1bits(pulse_pos[k], pulse_pos[k + 1], 4);
  967|   899k|    }
  968|  1.84M|  } else if (num_bits_cb == ACELP_NUM_BITS_44) {
  ------------------
  |  |  133|  1.84M|#define ACELP_NUM_BITS_44 (44)
  ------------------
  |  Branch (968:14): [True: 0, False: 1.84M]
  ------------------
  969|      0|    for (track = 0; track < (4 - 2); track++) {
  ------------------
  |  Branch (969:21): [True: 0, False: 0]
  ------------------
  970|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  971|      0|      acelp_param_out[track] =
  972|      0|          iusace_acelp_quant_3p_3n1bits(pulse_pos[k], pulse_pos[k + 1], pulse_pos[k + 2], 4);
  973|      0|    }
  974|      0|    for (track = 2; track < 4; track++) {
  ------------------
  |  Branch (974:21): [True: 0, False: 0]
  ------------------
  975|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  976|      0|      acelp_param_out[track] = iusace_acelp_quant_2p_2n1bits(pulse_pos[k], pulse_pos[k + 1], 4);
  977|      0|    }
  978|  1.84M|  } else if (num_bits_cb == ACELP_NUM_BITS_52) {
  ------------------
  |  |  134|  1.84M|#define ACELP_NUM_BITS_52 (52)
  ------------------
  |  Branch (978:14): [True: 14.3k, False: 1.82M]
  ------------------
  979|  71.6k|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (979:21): [True: 57.3k, False: 14.3k]
  ------------------
  980|  57.3k|      k = track * NPMAXPT;
  ------------------
  |  |  176|  57.3k|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  57.3k|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  981|  57.3k|      acelp_param_out[track] =
  982|  57.3k|          iusace_acelp_quant_3p_3n1bits(pulse_pos[k], pulse_pos[k + 1], pulse_pos[k + 2], 4);
  983|  57.3k|    }
  984|  1.82M|  } else if (num_bits_cb == ACELP_NUM_BITS_64) {
  ------------------
  |  |  135|  1.82M|#define ACELP_NUM_BITS_64 (64)
  ------------------
  |  Branch (984:14): [True: 1.82M, False: 0]
  ------------------
  985|  9.14M|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (985:21): [True: 7.31M, False: 1.82M]
  ------------------
  986|  7.31M|      k = track * NPMAXPT;
  ------------------
  |  |  176|  7.31M|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  7.31M|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  987|  7.31M|      l_index = iusace_acelp_quant_4p_4nbits(&pulse_pos[k], 4);
  988|  7.31M|      acelp_param_out[track] = ((l_index >> 14) & 3);
  989|  7.31M|      acelp_param_out[track + 4] = (l_index & 0x3FFF);
  990|  7.31M|    }
  991|  1.82M|  } else if (num_bits_cb == ACELP_NUM_BITS_72) {
  ------------------
  |  |  136|      0|#define ACELP_NUM_BITS_72 (72)
  ------------------
  |  Branch (991:14): [True: 0, False: 0]
  ------------------
  992|      0|    for (track = 0; track < (4 - 2); track++) {
  ------------------
  |  Branch (992:21): [True: 0, False: 0]
  ------------------
  993|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  994|      0|      l_index = iusace_acelp_quant_5p_5nbits(&pulse_pos[k], 4);
  995|      0|      acelp_param_out[track] = ((l_index >> 10) & 0x03FF);
  996|      0|      acelp_param_out[track + 4] = (l_index & 0x03FF);
  997|      0|    }
  998|      0|    for (track = 2; track < 4; track++) {
  ------------------
  |  Branch (998:21): [True: 0, False: 0]
  ------------------
  999|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
 1000|      0|      l_index = iusace_acelp_quant_4p_4nbits(&pulse_pos[k], 4);
 1001|      0|      acelp_param_out[track] = ((l_index >> 14) & 3);
 1002|      0|      acelp_param_out[track + 4] = (l_index & 0x3FFF);
 1003|      0|    }
 1004|      0|  } else if (num_bits_cb == ACELP_NUM_BITS_88) {
  ------------------
  |  |  137|      0|#define ACELP_NUM_BITS_88 (88)
  ------------------
  |  Branch (1004:14): [True: 0, False: 0]
  ------------------
 1005|      0|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (1005:21): [True: 0, False: 0]
  ------------------
 1006|      0|      k = track * NPMAXPT;
  ------------------
  |  |  176|      0|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|      0|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
 1007|      0|      l_index = iusace_acelp_quant_6p_6n_2bits(&pulse_pos[k], 4);
 1008|      0|      acelp_param_out[track] = ((l_index >> 11) & 0x07FF);
 1009|      0|      acelp_param_out[track + 4] = (l_index & 0x07FF);
 1010|      0|    }
 1011|      0|  }
 1012|  2.06M|  return;
 1013|  2.06M|}
iusace_acelp_ltpred_cb_exc:
 1015|  2.06M|VOID iusace_acelp_ltpred_cb_exc(FLOAT32 *exc, WORD32 t0, WORD32 t0_frac, WORD32 len_subfrm) {
 1016|  2.06M|  WORD32 i, j;
 1017|  2.06M|  FLOAT32 s, *x0, *x1, *x2;
 1018|  2.06M|  const FLOAT32 *c1, *c2;
 1019|       |
 1020|  2.06M|  x0 = &exc[-t0];
 1021|  2.06M|  t0_frac = -t0_frac;
 1022|  2.06M|  if (t0_frac < 0) {
  ------------------
  |  Branch (1022:7): [True: 1.05M, False: 1.01M]
  ------------------
 1023|  1.05M|    t0_frac += T_UP_SAMP;
  ------------------
  |  |  104|  1.05M|#define T_UP_SAMP (4)
  ------------------
 1024|  1.05M|    x0--;
 1025|  1.05M|  }
 1026|   136M|  for (j = 0; j < len_subfrm; j++) {
  ------------------
  |  Branch (1026:15): [True: 134M, False: 2.06M]
  ------------------
 1027|   134M|    x1 = x0++;
 1028|   134M|    x2 = x1 + 1;
 1029|   134M|    c1 = &iusace_res_interp_filter1_4[t0_frac];
 1030|   134M|    c2 = &iusace_res_interp_filter1_4[T_UP_SAMP - t0_frac];
  ------------------
  |  |  104|   134M|#define T_UP_SAMP (4)
  ------------------
 1031|   134M|    s = 0.0;
 1032|  2.28G|    for (i = 0; i < INTER_LP_FIL_ORDER; i++, c1 += T_UP_SAMP, c2 += T_UP_SAMP) {
  ------------------
  |  |  105|  2.28G|#define INTER_LP_FIL_ORDER (16)
  ------------------
                  for (i = 0; i < INTER_LP_FIL_ORDER; i++, c1 += T_UP_SAMP, c2 += T_UP_SAMP) {
  ------------------
  |  |  104|  2.15G|#define T_UP_SAMP (4)
  ------------------
                  for (i = 0; i < INTER_LP_FIL_ORDER; i++, c1 += T_UP_SAMP, c2 += T_UP_SAMP) {
  ------------------
  |  |  104|  2.15G|#define T_UP_SAMP (4)
  ------------------
  |  Branch (1032:17): [True: 2.15G, False: 134M]
  ------------------
 1033|  2.15G|      s += (*x1--) * (*c1) + (*x2++) * (*c2);
 1034|  2.15G|    }
 1035|   134M|    exc[j] = s;
 1036|   134M|  }
 1037|  2.06M|}
iusace_acelp_quant_gain:
 1040|  2.06M|                             FLOAT32 *tgt_cb_corr_data, FLOAT32 mean_energy, WORD32 *qunt_idx) {
 1041|  2.06M|  WORD32 i, indice = 0, min_pitch_idx;
 1042|  2.06M|  FLOAT32 ener_code, pred_code_gain;
 1043|  2.06M|  FLOAT32 dist, dist_min, g_pitch, g_code;
 1044|  2.06M|  const FLOAT32 *p1_qua_gain_table, *p2_qua_gain_table;
 1045|       |
 1046|  2.06M|  p1_qua_gain_table = iusace_acelp_quant_gain_table;
 1047|  2.06M|  p2_qua_gain_table = (const FLOAT32 *)(iusace_acelp_quant_gain_table + ACELP_GAIN_TBL_OFFSET);
  ------------------
  |  |  177|  2.06M|#define ACELP_GAIN_TBL_OFFSET (64)
  ------------------
 1048|  2.06M|  min_pitch_idx = 0;
 1049|  2.06M|  g_pitch = *pitch_gain;
 1050|   134M|  for (i = 0; i < ACELP_RANGE_GAIN_PT_IDX_SEARCH; i++, p2_qua_gain_table += 2) {
  ------------------
  |  |  178|   134M|#define ACELP_RANGE_GAIN_PT_IDX_SEARCH (NUM_QUANTIZATION_LEVEL - ACELP_GAIN_TBL_OFFSET)
  |  |  ------------------
  |  |  |  |  163|   134M|#define NUM_QUANTIZATION_LEVEL (128)
  |  |  ------------------
  |  |               #define ACELP_RANGE_GAIN_PT_IDX_SEARCH (NUM_QUANTIZATION_LEVEL - ACELP_GAIN_TBL_OFFSET)
  |  |  ------------------
  |  |  |  |  177|   134M|#define ACELP_GAIN_TBL_OFFSET (64)
  |  |  ------------------
  ------------------
  |  Branch (1050:15): [True: 132M, False: 2.06M]
  ------------------
 1051|   132M|    if (g_pitch > *p2_qua_gain_table) {
  ------------------
  |  Branch (1051:9): [True: 38.5M, False: 93.7M]
  ------------------
 1052|  38.5M|      continue;
 1053|  38.5M|    }
 1054|   132M|  }
 1055|  2.06M|  ener_code = 0.01F;
 1056|       |
 1057|   134M|  for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   134M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (1057:15): [True: 132M, False: 2.06M]
  ------------------
 1058|   132M|    ener_code += code[i] * code[i];
 1059|   132M|  }
 1060|       |
 1061|  2.06M|  ener_code = (FLOAT32)(10.0 * log10(ener_code / (FLOAT32)LEN_SUBFR));
  ------------------
  |  |   77|  2.06M|#define LEN_SUBFR (64)
  ------------------
 1062|  2.06M|  pred_code_gain = mean_energy - ener_code;
 1063|  2.06M|  pred_code_gain = (FLOAT32)pow(10.0, pred_code_gain / 20.0);
 1064|       |
 1065|  2.06M|  dist_min = MAX_FLT_VAL;
  ------------------
  |  |  181|  2.06M|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
 1066|  2.06M|  p2_qua_gain_table = (const FLOAT32 *)(p1_qua_gain_table + min_pitch_idx * 2);
 1067|   266M|  for (i = 0; i < ACELP_SEARCH_RANGE_QUANTIZER_IDX; i++) {
  ------------------
  |  |  179|   266M|#define ACELP_SEARCH_RANGE_QUANTIZER_IDX (128)
  ------------------
  |  Branch (1067:15): [True: 264M, False: 2.06M]
  ------------------
 1068|   264M|    g_pitch = *p2_qua_gain_table++;
 1069|   264M|    g_code = pred_code_gain * *p2_qua_gain_table++;
 1070|   264M|    dist = g_pitch * g_pitch * tgt_cb_corr_data[0] + g_pitch * tgt_cb_corr_data[1] +
 1071|   264M|           g_code * g_code * tgt_cb_corr_data[2] + g_code * tgt_cb_corr_data[3] +
 1072|   264M|           g_pitch * g_code * tgt_cb_corr_data[4];
 1073|   264M|    if (dist < dist_min) {
  ------------------
  |  Branch (1073:9): [True: 14.5M, False: 250M]
  ------------------
 1074|  14.5M|      dist_min = dist;
 1075|  14.5M|      indice = i;
 1076|  14.5M|    }
 1077|   264M|  }
 1078|  2.06M|  indice += min_pitch_idx;
 1079|  2.06M|  *pitch_gain = p1_qua_gain_table[indice * 2];
 1080|  2.06M|  *code_gain = p1_qua_gain_table[indice * 2 + 1] * pred_code_gain;
 1081|  2.06M|  *qunt_idx = indice;
 1082|  2.06M|}
iusace_acelp_tools.c:iusace_acelp_ir_vec_corr1:
   29|  35.8M|                                      WORD32 num_pluse_pos) {
   30|  35.8M|  WORD16 i, j;
   31|  35.8M|  WORD32 dn;
   32|  35.8M|  WORD32 *dn2;
   33|  35.8M|  FLOAT32 *p0;
   34|  35.8M|  FLOAT32 s;
   35|  35.8M|  dn2 = &dn2_pos[track * 8];
   36|  35.8M|  p0 = corr_ir[track];
   37|   252M|  for (i = 0; i < num_pluse_pos; i++) {
  ------------------
  |  Branch (37:15): [True: 216M, False: 35.8M]
  ------------------
   38|   216M|    dn = dn2[i];
   39|   216M|    s = 0.0F;
   40|  8.80G|    for (j = 0; j < (LEN_SUBFR - dn); j++) {
  ------------------
  |  |   77|  8.80G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (40:17): [True: 8.59G, False: 216M]
  ------------------
   41|  8.59G|      s += ir[j] * vec[dn + j];
   42|  8.59G|    }
   43|   216M|    corr_out[dn >> 2] = sign[dn] * s + p0[dn >> 2];
   44|   216M|  }
   45|  35.8M|}
iusace_acelp_tools.c:iusace_acelp_ir_vec_corr2:
   48|  35.8M|                                      FLOAT32 (*corr_ir)[16], FLOAT32 *corr_out) {
   49|  35.8M|  WORD32 i, j;
   50|  35.8M|  FLOAT32 *p0;
   51|  35.8M|  FLOAT32 s;
   52|  35.8M|  p0 = corr_ir[track];
   53|   609M|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (53:15): [True: 573M, False: 35.8M]
  ------------------
   54|   573M|    s = 0.0F;
   55|  19.2G|    for (j = 0; j < LEN_SUBFR - track; j++) {
  ------------------
  |  |   77|  19.2G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (55:17): [True: 18.6G, False: 573M]
  ------------------
   56|  18.6G|      s += ir[j] * vec[track + j];
   57|  18.6G|    }
   58|   573M|    corr_out[i] = s * sign[track] + p0[i];
   59|   573M|    track += 4;
   60|   573M|  }
   61|  35.8M|}
iusace_acelp_tools.c:iusace_acelp_get_2p_pos:
   66|  35.8M|                                    FLOAT32 *corr_p2, FLOAT32 (*corr_p1p2)[256]) {
   67|  35.8M|  WORD32 x, x2, y, x_save = 0, y_save = 0, i, *pos_x;
   68|  35.8M|  FLOAT32 ps0, alp0;
   69|  35.8M|  FLOAT32 ps1, ps2, sq, sqk;
   70|  35.8M|  FLOAT32 alp1, alp2, alpk;
   71|  35.8M|  FLOAT32 *p1, *p2;
   72|  35.8M|  FLOAT32 s;
   73|  35.8M|  pos_x = &dn2[track_p1 << 3];
   74|  35.8M|  ps0 = *corr_pulses;
   75|  35.8M|  alp0 = *ener_pulses;
   76|  35.8M|  sqk = -1.0F;
   77|  35.8M|  alpk = 1.0F;
   78|       |
   79|   252M|  for (i = 0; i < nb_pos_ix; i++) {
  ------------------
  |  Branch (79:15): [True: 216M, False: 35.8M]
  ------------------
   80|   216M|    x = pos_x[i];
   81|   216M|    x2 = x >> 2;
   82|       |
   83|   216M|    ps1 = ps0 + dn[x];
   84|   216M|    alp1 = alp0 + corr_p1[x2];
   85|   216M|    p1 = corr_p2;
   86|   216M|    p2 = &corr_p1p2[track_p1][x2 << 4];
   87|  3.68G|    for (y = track_p2; y < LEN_SUBFR; y += 4) {
  ------------------
  |  |   77|  3.68G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (87:24): [True: 3.47G, False: 216M]
  ------------------
   88|  3.47G|      ps2 = ps1 + dn[y];
   89|  3.47G|      alp2 = alp1 + (*p1++) + (*p2++);
   90|  3.47G|      sq = ps2 * ps2;
   91|  3.47G|      s = (alpk * sq) - (sqk * alp2);
   92|  3.47G|      if (s > 0.0F) {
  ------------------
  |  Branch (92:11): [True: 210M, False: 3.26G]
  ------------------
   93|   210M|        sqk = sq;
   94|   210M|        alpk = alp2;
   95|   210M|        y_save = y;
   96|   210M|        x_save = x;
   97|   210M|      }
   98|  3.47G|    }
   99|   216M|  }
  100|  35.8M|  *corr_pulses = ps0 + dn[x_save] + dn[y_save];
  101|  35.8M|  *ener_pulses = alpk;
  102|  35.8M|  *pos_p1 = x_save;
  103|  35.8M|  *pos_p2 = y_save;
  104|  35.8M|}
iusace_acelp_tools.c:iusace_acelp_quant_1p_n1bits:
  151|  6.37M|static WORD32 iusace_acelp_quant_1p_n1bits(WORD32 pos_pulse, WORD32 num_bits_pos) {
  152|  6.37M|  WORD32 mask;
  153|  6.37M|  WORD32 index;
  154|  6.37M|  mask = ((1 << num_bits_pos) - 1);
  155|       |
  156|  6.37M|  index = (pos_pulse & mask);
  157|  6.37M|  if ((pos_pulse & 16) != 0) {
  ------------------
  |  Branch (157:7): [True: 3.19M, False: 3.17M]
  ------------------
  158|  3.19M|    index += 1 << num_bits_pos;
  159|  3.19M|  }
  160|  6.37M|  return (index);
  161|  6.37M|}
iusace_acelp_tools.c:iusace_acelp_quant_2p_2n1bits:
  163|  12.4M|static WORD32 iusace_acelp_quant_2p_2n1bits(WORD32 pos_p1, WORD32 pos_p2, WORD32 num_bits_pos) {
  164|  12.4M|  WORD32 mask;
  165|  12.4M|  WORD32 index;
  166|  12.4M|  mask = ((1 << num_bits_pos) - 1);
  167|       |
  168|  12.4M|  if (((pos_p2 ^ pos_p1) & 16) == 0) {
  ------------------
  |  Branch (168:7): [True: 8.55M, False: 3.87M]
  ------------------
  169|  8.55M|    if ((pos_p1 - pos_p2) <= 0) {
  ------------------
  |  Branch (169:9): [True: 6.16M, False: 2.38M]
  ------------------
  170|  6.16M|      index = ((pos_p1 & mask) << num_bits_pos) + (pos_p2 & mask);
  171|  6.16M|    } else {
  172|  2.38M|      index = ((pos_p2 & mask) << num_bits_pos) + (pos_p1 & mask);
  173|  2.38M|    }
  174|  8.55M|    if ((pos_p1 & 16) != 0) {
  ------------------
  |  Branch (174:9): [True: 4.25M, False: 4.29M]
  ------------------
  175|  4.25M|      index += 1 << (2 * num_bits_pos);
  176|  4.25M|    }
  177|  8.55M|  } else {
  178|  3.87M|    if (((pos_p1 & mask) - (pos_p2 & mask)) <= 0) {
  ------------------
  |  Branch (178:9): [True: 2.18M, False: 1.68M]
  ------------------
  179|  2.18M|      index = ((pos_p2 & mask) << num_bits_pos) + (pos_p1 & mask);
  180|  2.18M|      if ((pos_p2 & 16) != 0) {
  ------------------
  |  Branch (180:11): [True: 1.09M, False: 1.08M]
  ------------------
  181|  1.09M|        index += 1 << (2 * num_bits_pos);
  182|  1.09M|      }
  183|  2.18M|    } else {
  184|  1.68M|      index = ((pos_p1 & mask) << num_bits_pos) + (pos_p2 & mask);
  185|  1.68M|      if ((pos_p1 & 16) != 0) {
  ------------------
  |  Branch (185:11): [True: 848k, False: 841k]
  ------------------
  186|   848k|        index += 1 << (2 * num_bits_pos);
  187|   848k|      }
  188|  1.68M|    }
  189|  3.87M|  }
  190|  12.4M|  return (index);
  191|  12.4M|}
iusace_acelp_tools.c:iusace_acelp_quant_3p_3n1bits:
  194|  3.21M|                                            WORD32 num_bits_pos) {
  195|  3.21M|  WORD32 nb_pos;
  196|  3.21M|  WORD32 index;
  197|  3.21M|  nb_pos = (1 << (num_bits_pos - 1));
  198|       |
  199|  3.21M|  if (((pos_p1 ^ pos_p2) & nb_pos) == 0) {
  ------------------
  |  Branch (199:7): [True: 1.73M, False: 1.48M]
  ------------------
  200|  1.73M|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p2, (num_bits_pos - 1));
  201|  1.73M|    index += (pos_p1 & nb_pos) << num_bits_pos;
  202|  1.73M|    index += iusace_acelp_quant_1p_n1bits(pos_p3, num_bits_pos) << (2 * num_bits_pos);
  203|  1.73M|  } else if (((pos_p1 ^ pos_p3) & nb_pos) == 0) {
  ------------------
  |  Branch (203:14): [True: 814k, False: 667k]
  ------------------
  204|   814k|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p3, (num_bits_pos - 1));
  205|   814k|    index += (pos_p1 & nb_pos) << num_bits_pos;
  206|   814k|    index += iusace_acelp_quant_1p_n1bits(pos_p2, num_bits_pos) << (2 * num_bits_pos);
  207|   814k|  } else {
  208|   667k|    index = iusace_acelp_quant_2p_2n1bits(pos_p2, pos_p3, (num_bits_pos - 1));
  209|   667k|    index += (pos_p2 & nb_pos) << num_bits_pos;
  210|   667k|    index += iusace_acelp_quant_1p_n1bits(pos_p1, num_bits_pos) << (2 * num_bits_pos);
  211|   667k|  }
  212|  3.21M|  return (index);
  213|  3.21M|}
iusace_acelp_tools.c:iusace_acelp_quant_4p_4nbits:
  237|  7.31M|static WORD32 iusace_acelp_quant_4p_4nbits(WORD32 *pos_pulses, WORD32 num_bits_pos) {
  238|  7.31M|  WORD32 i, j, k, nb_pos, n_1;
  239|  7.31M|  WORD32 pos_a[4], pos_b[4];
  240|  7.31M|  WORD32 index = 0;
  241|  7.31M|  n_1 = num_bits_pos - 1;
  242|  7.31M|  nb_pos = (1 << n_1);
  243|  7.31M|  i = 0;
  244|  7.31M|  j = 0;
  245|  36.5M|  for (k = 0; k < 4; k++) {
  ------------------
  |  Branch (245:15): [True: 29.2M, False: 7.31M]
  ------------------
  246|  29.2M|    if ((pos_pulses[k] & nb_pos) == 0) {
  ------------------
  |  Branch (246:9): [True: 19.0M, False: 10.2M]
  ------------------
  247|  19.0M|      pos_a[i++] = pos_pulses[k];
  248|  19.0M|    } else {
  249|  10.2M|      pos_b[j++] = pos_pulses[k];
  250|  10.2M|    }
  251|  29.2M|  }
  252|  7.31M|  switch (i) {
  ------------------
  |  Branch (252:11): [True: 7.31M, False: 0]
  ------------------
  253|   197k|    case 0:
  ------------------
  |  Branch (253:5): [True: 197k, False: 7.11M]
  ------------------
  254|   197k|      index = 1 << ((4 * num_bits_pos) - 3);
  255|   197k|      index += iusace_acelp_quant_4p_4n1bits(pos_b[0], pos_b[1], pos_b[2], pos_b[3], n_1);
  256|   197k|      break;
  257|   983k|    case 1:
  ------------------
  |  Branch (257:5): [True: 983k, False: 6.32M]
  ------------------
  258|   983k|      index = iusace_acelp_quant_1p_n1bits(pos_a[0], n_1) << ((3 * n_1) + 1);
  259|   983k|      index += iusace_acelp_quant_3p_3n1bits(pos_b[0], pos_b[1], pos_b[2], n_1);
  260|   983k|      break;
  261|  2.16M|    case 2:
  ------------------
  |  Branch (261:5): [True: 2.16M, False: 5.15M]
  ------------------
  262|  2.16M|      index = iusace_acelp_quant_2p_2n1bits(pos_a[0], pos_a[1], n_1) << ((2 * n_1) + 1);
  263|  2.16M|      index += iusace_acelp_quant_2p_2n1bits(pos_b[0], pos_b[1], n_1);
  264|  2.16M|      break;
  265|  2.17M|    case 3:
  ------------------
  |  Branch (265:5): [True: 2.17M, False: 5.13M]
  ------------------
  266|  2.17M|      index = iusace_acelp_quant_3p_3n1bits(pos_a[0], pos_a[1], pos_a[2], n_1) << num_bits_pos;
  267|  2.17M|      index += iusace_acelp_quant_1p_n1bits(pos_b[0], n_1);
  268|  2.17M|      break;
  269|  1.79M|    case 4:
  ------------------
  |  Branch (269:5): [True: 1.79M, False: 5.51M]
  ------------------
  270|  1.79M|      index = iusace_acelp_quant_4p_4n1bits(pos_a[0], pos_a[1], pos_a[2], pos_a[3], n_1);
  271|  1.79M|      break;
  272|  7.31M|  }
  273|  7.31M|  index += (i & 3) << ((4 * num_bits_pos) - 2);
  274|  7.31M|  return (index);
  275|  7.31M|}
iusace_acelp_tools.c:iusace_acelp_quant_4p_4n1bits:
  216|  1.99M|                                            WORD32 pos_p4, WORD32 num_bits_pos) {
  217|  1.99M|  WORD32 nb_pos;
  218|  1.99M|  WORD32 index;
  219|  1.99M|  nb_pos = (1 << (num_bits_pos - 1));
  220|       |
  221|  1.99M|  if (((pos_p1 ^ pos_p2) & nb_pos) == 0) {
  ------------------
  |  Branch (221:7): [True: 1.34M, False: 648k]
  ------------------
  222|  1.34M|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p2, (num_bits_pos - 1));
  223|  1.34M|    index += (pos_p1 & nb_pos) << num_bits_pos;
  224|  1.34M|    index += iusace_acelp_quant_2p_2n1bits(pos_p3, pos_p4, num_bits_pos) << (2 * num_bits_pos);
  225|  1.34M|  } else if (((pos_p1 ^ pos_p3) & nb_pos) == 0) {
  ------------------
  |  Branch (225:14): [True: 415k, False: 233k]
  ------------------
  226|   415k|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p3, (num_bits_pos - 1));
  227|   415k|    index += (pos_p1 & nb_pos) << num_bits_pos;
  228|   415k|    index += iusace_acelp_quant_2p_2n1bits(pos_p2, pos_p4, num_bits_pos) << (2 * num_bits_pos);
  229|   415k|  } else {
  230|   233k|    index = iusace_acelp_quant_2p_2n1bits(pos_p2, pos_p3, (num_bits_pos - 1));
  231|   233k|    index += (pos_p2 & nb_pos) << num_bits_pos;
  232|   233k|    index += iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p4, num_bits_pos) << (2 * num_bits_pos);
  233|   233k|  }
  234|  1.99M|  return (index);
  235|  1.99M|}

iusace_arith_enc_spec:
  294|   946k|                             WORD32 arith_reset_flag, WORD32 ccfl) {
  295|   946k|  LOOPIDX i;
  296|   946k|  WORD32 write_flag = (it_bit_buf != NULL);
  297|   946k|  WORD32 size;
  298|   946k|  WORD32 num_wins = (window_sequence == EIGHT_SHORT_SEQUENCE) ? MAX_SHORT_WINDOWS : 1;
  ------------------
  |  |   40|   946k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
                WORD32 num_wins = (window_sequence == EIGHT_SHORT_SEQUENCE) ? MAX_SHORT_WINDOWS : 1;
  ------------------
  |  |   52|   356k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (298:21): [True: 356k, False: 590k]
  ------------------
  299|   946k|  WORD32 bits_data_written = 0;
  300|       |
  301|   946k|  switch (window_sequence) {
  302|   410k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|   410k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (302:5): [True: 410k, False: 535k]
  ------------------
  303|   504k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   46|   504k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (303:5): [True: 94.3k, False: 852k]
  ------------------
  304|   505k|    case STOP_START_SEQUENCE:
  ------------------
  |  |   49|   505k|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (304:5): [True: 424, False: 946k]
  ------------------
  305|   590k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|   590k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (305:5): [True: 84.6k, False: 861k]
  ------------------
  306|   590k|      size = ccfl;
  307|   590k|      break;
  308|   356k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|   356k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (308:5): [True: 356k, False: 590k]
  ------------------
  309|   356k|      size = ccfl >> 3;
  310|   356k|      break;
  311|      0|    default:
  ------------------
  |  Branch (311:5): [True: 0, False: 946k]
  ------------------
  312|      0|      size = ccfl >> 3;
  313|      0|      break;
  314|   946k|  }
  315|       |
  316|   946k|  iusace_arith_map_context(size, *ptr_size_prev, ptr_c_pres, ptr_c_prev, arith_reset_flag);
  317|       |
  318|   946k|  if (max_spec_coefficients > 0) {
  ------------------
  |  Branch (318:7): [True: 912k, False: 33.5k]
  ------------------
  319|  4.32M|    for (i = 0; i < num_wins; i++) {
  ------------------
  |  Branch (319:17): [True: 3.40M, False: 912k]
  ------------------
  320|  3.40M|      bits_data_written = iusace_arith_encode_level2(
  321|  3.40M|          it_bit_buf, bits_data_written, ptr_c_pres + 2, ptr_c_prev + 2, &ptr_x_ac_enc[i * size],
  322|  3.40M|          max_spec_coefficients / 2, size / 2, 2);
  323|  3.40M|    }
  324|   912k|  }
  325|       |
  326|   946k|  if (write_flag) {
  ------------------
  |  Branch (326:7): [True: 416k, False: 529k]
  ------------------
  327|   416k|    *ptr_size_prev = size;
  328|   416k|  }
  329|       |
  330|   946k|  return bits_data_written;
  331|   946k|}
iusace_tcx_coding:
  334|   193k|                         WORD32 max_tcx_size, WORD32 *ptr_quant, WORD32 *c_pres, WORD32 *c_prev) {
  335|   193k|  WORD32 bits_written = 0;
  336|       |
  337|   193k|  iusace_arith_map_context(tcx_size, max_tcx_size, c_pres, c_prev, 0);
  338|       |
  339|   193k|  bits_written =
  340|   193k|      iusace_arith_encode_level2(pstr_it_bit_buff, bits_written, c_pres + 2, c_prev + 2,
  341|   193k|                                 &ptr_quant[0], tcx_size / 2, tcx_size / 2, 2);
  342|       |
  343|   193k|  iusace_arith_map_context(max_tcx_size, tcx_size, c_pres, c_prev, 0);
  344|       |
  345|   193k|  return bits_written;
  346|   193k|}
iusace_arith_done:
  348|  9.92M|WORD32 iusace_arith_done(ia_bit_buf_struct *pstr_it_bit_buff, WORD32 bp, iusace_state_arith *s) {
  349|  9.92M|  WORD32 low, high;
  350|  9.92M|  WORD32 bits_to_follow;
  351|       |
  352|  9.92M|  low = s->low;
  353|  9.92M|  high = s->high;
  354|  9.92M|  bits_to_follow = s->value + 1;
  355|       |
  356|  9.92M|  if (low < 16384) {
  ------------------
  |  Branch (356:7): [True: 6.54M, False: 3.38M]
  ------------------
  357|  6.54M|    iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  358|  6.54M|    bp++;
  359|  17.2M|    while (bits_to_follow) {
  ------------------
  |  Branch (359:12): [True: 10.6M, False: 6.54M]
  ------------------
  360|  10.6M|      iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  361|  10.6M|      bp++;
  362|  10.6M|      bits_to_follow--;
  363|  10.6M|    }
  364|  6.54M|  } else {
  365|  3.38M|    iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  366|  3.38M|    bp++;
  367|  8.94M|    while (bits_to_follow) {
  ------------------
  |  Branch (367:12): [True: 5.56M, False: 3.38M]
  ------------------
  368|  5.56M|      iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  369|  5.56M|      bp++;
  370|  5.56M|      bits_to_follow--;
  371|  5.56M|    }
  372|  3.38M|  }
  373|       |
  374|  9.92M|  s->low = low;
  375|  9.92M|  s->high = high;
  376|  9.92M|  s->value = bits_to_follow;
  377|       |
  378|  9.92M|  return bp;
  379|  9.92M|}
iusace_arith_encode:
  382|  1.07G|                           WORD32 symbol, UWORD16 const *cum_freq) {
  383|  1.07G|  WORD32 low, high, range;
  384|  1.07G|  WORD32 bits_to_follow;
  385|       |
  386|  1.07G|  high = s->high;
  387|  1.07G|  low = s->low;
  388|  1.07G|  range = high - low + 1;
  389|       |
  390|  1.07G|  if (symbol > 0) {
  ------------------
  |  Branch (390:7): [True: 652M, False: 427M]
  ------------------
  391|   652M|    high = low + ((range * cum_freq[symbol - 1]) >> 14) - 1;
  392|   652M|  }
  393|       |
  394|  1.07G|  low = low + ((range * cum_freq[symbol]) >> 14);
  395|       |
  396|  1.07G|  bits_to_follow = s->value;
  397|       |
  398|  3.05G|  for (;;) {
  399|  3.05G|    if (high < 32768) {
  ------------------
  |  Branch (399:9): [True: 757M, False: 2.29G]
  ------------------
  400|   757M|      iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  401|   757M|      bp++;
  402|  1.06G|      while (bits_to_follow) {
  ------------------
  |  Branch (402:14): [True: 309M, False: 757M]
  ------------------
  403|   309M|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  404|   309M|        bp++;
  405|   309M|        bits_to_follow--;
  406|   309M|      }
  407|  2.29G|    } else if (low >= 32768) {
  ------------------
  |  Branch (407:16): [True: 688M, False: 1.60G]
  ------------------
  408|   688M|      iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  409|   688M|      bp++;
  410|   903M|      while (bits_to_follow) {
  ------------------
  |  Branch (410:14): [True: 215M, False: 688M]
  ------------------
  411|   215M|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  412|   215M|        bp++;
  413|   215M|        bits_to_follow--;
  414|   215M|      }
  415|   688M|      low -= 32768;
  416|   688M|      high -= 32768;
  417|  1.60G|    } else if (low >= 16384 && high < 49152) {
  ------------------
  |  Branch (417:16): [True: 976M, False: 631M]
  |  Branch (417:32): [True: 528M, False: 447M]
  ------------------
  418|   528M|      bits_to_follow += 1;
  419|   528M|      low -= 16384;
  420|   528M|      high -= 16384;
  421|   528M|    } else
  422|  1.07G|      break;
  423|       |
  424|  1.97G|    low += low;
  425|  1.97G|    high += high + 1;
  426|  1.97G|  }
  427|       |
  428|  1.07G|  s->low = low;
  429|  1.07G|  s->high = high;
  430|  1.07G|  s->value = bits_to_follow;
  431|       |
  432|  1.07G|  return bp;
  433|  1.07G|}
iusace_arith_enc.c:iusace_arith_map_context:
   50|  1.33M|                                     WORD32 *ptr_c_pres, WORD32 arith_reset_flag) {
   51|  1.33M|  WORD32 i, k;
   52|  1.33M|  FLOAT32 ratio;
   53|  1.33M|  WORD32 c_prev[516];
   54|  1.33M|  WORD32 c_pres[516];
   55|       |
   56|  1.33M|  if (arith_reset_flag) {
  ------------------
  |  Branch (56:7): [True: 946k, False: 386k]
  ------------------
   57|   946k|    memset(ptr_c_pres, 0, 516 * sizeof(WORD32));
   58|   946k|    memset(ptr_c_prev, 0, 516 * sizeof(WORD32));
   59|   946k|  } else {
   60|   386k|    memcpy(&c_prev[2], &ptr_c_prev[2], (prev_n / 2 + 2) * sizeof(WORD32));
   61|   386k|    memcpy(&c_pres[2], &ptr_c_pres[2], (prev_n / 2 + 2) * sizeof(WORD32));
   62|       |
   63|   386k|    ratio = (FLOAT32)(prev_n) / (FLOAT32)(pres_n);
   64|   131M|    for (i = 0; i < (pres_n / 2); i++) {
  ------------------
  |  Branch (64:17): [True: 130M, False: 386k]
  ------------------
   65|   130M|      k = (WORD32)((FLOAT32)(i)*ratio);
   66|   130M|      ptr_c_pres[2 + i] = c_pres[2 + k];
   67|   130M|      ptr_c_prev[2 + i] = c_prev[2 + k];
   68|   130M|    }
   69|       |
   70|   386k|    ptr_c_pres[(pres_n / 2) + 2] = c_pres[(prev_n / 2) + 2];
   71|   386k|    ptr_c_pres[(pres_n / 2) + 3] = c_pres[(prev_n / 2) + 3];
   72|   386k|    ptr_c_prev[(pres_n / 2) + 2] = c_prev[(prev_n / 2) + 2];
   73|   386k|    ptr_c_prev[(pres_n / 2) + 3] = c_prev[(prev_n / 2) + 3];
   74|   386k|  }
   75|  1.33M|  return;
   76|  1.33M|}
iusace_arith_enc.c:iusace_arith_encode_level2:
  128|  7.20M|                                         WORD32 n, WORD32 nt, WORD32 use_stop) {
  129|  7.20M|  WORD32 qs[32];
  130|  7.20M|  iusace_state_arith as, as_stop;
  131|       |
  132|  7.20M|  WORD32 a, b, a1, b1, m;
  133|  7.20M|  WORD32 s, t, i, l, lev, esc_nb;
  134|  7.20M|  UWORD16 pki;
  135|  7.20M|  WORD32 bp_start = bp;
  136|  7.20M|  WORD32 bp_stop = bp;
  137|  7.20M|  WORD32 stop = 0;
  138|  7.20M|  WORD32 sopt;
  139|  7.20M|  WORD32 a2, b2;
  140|  7.20M|  ia_bit_buf_struct it_bit_buff_temp;
  141|  7.20M|  memset(&it_bit_buff_temp, 0, sizeof(it_bit_buff_temp));
  142|  7.20M|  iusace_copy_bit_buf(&it_bit_buff_temp, pstr_it_bit_buff);
  143|       |
  144|  7.20M|  as.low = 0;
  145|  7.20M|  as.high = 65535;
  146|  7.20M|  as.value = 0;
  147|       |
  148|  7.20M|  sopt = ptr_c_prev[0] << 12;
  149|       |
  150|   635M|  for (i = 0; i < n; i++) {
  ------------------
  |  Branch (150:15): [True: 630M, False: 5.31M]
  ------------------
  151|   630M|    if ((use_stop == 1 || use_stop == 2) && (stop == 0)) {
  ------------------
  |  Branch (151:10): [True: 24.9M, False: 605M]
  |  Branch (151:27): [True: 394M, False: 211M]
  |  Branch (151:45): [True: 250M, False: 168M]
  ------------------
  152|   250M|      WORD32 j;
  153|       |
  154|   250M|      stop = 1;
  155|  8.38G|      for (j = i; j < n; j++) {
  ------------------
  |  Branch (155:19): [True: 8.38G, False: 4.60M]
  ------------------
  156|  8.38G|        if (quant[2 * j] != 0 || quant[2 * j + 1] != 0) {
  ------------------
  |  Branch (156:13): [True: 185M, False: 8.19G]
  |  Branch (156:34): [True: 61.0M, False: 8.13G]
  ------------------
  157|   246M|          stop = 0;
  158|   246M|          break;
  159|   246M|        }
  160|  8.38G|      }
  161|       |
  162|   250M|      if (stop) {
  ------------------
  |  Branch (162:11): [True: 4.60M, False: 246M]
  ------------------
  163|  4.60M|        s = iusace_arith_get_state(ptr_c_pres, ptr_c_prev, &sopt, i);
  164|  4.60M|        t = s & 0xFFFFF;
  165|       |
  166|  4.60M|        pki = iusace_arith_get_pk(t);
  167|       |
  168|  4.60M|        if (use_stop == 1) {
  ------------------
  |  Branch (168:13): [True: 1.88M, False: 2.71M]
  ------------------
  169|  1.88M|          bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, ARITH_ESCAPE, iusace_ari_cf_m[pki]);
  ------------------
  |  |   47|  1.88M|#define ARITH_ESCAPE (16)
  ------------------
  170|  1.88M|          pki = iusace_arith_get_pk(t + (1 << 17));
  171|  1.88M|          bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, 0, iusace_ari_cf_m[pki]);
  172|       |
  173|  1.88M|          break;
  174|  2.71M|        } else {
  175|  2.71M|          bp_stop = bp;
  176|  2.71M|          as_stop.low = as.low;
  177|  2.71M|          as_stop.high = as.high;
  178|  2.71M|          as_stop.value = as.value;
  179|       |
  180|  2.71M|          bp_stop =
  181|  2.71M|              iusace_arith_encode(NULL, bp_stop, &as_stop, ARITH_ESCAPE, iusace_ari_cf_m[pki]);
  ------------------
  |  |   47|  2.71M|#define ARITH_ESCAPE (16)
  ------------------
  182|       |
  183|  2.71M|          pki = iusace_arith_get_pk(t + (1 << 17));
  184|  2.71M|          bp_stop = iusace_arith_encode(NULL, bp_stop, &as_stop, (0), iusace_ari_cf_m[pki]);
  185|  2.71M|        }
  186|  4.60M|      }
  187|   250M|    }
  188|   628M|    s = iusace_arith_get_state(ptr_c_pres, ptr_c_prev, &sopt, i);
  189|   628M|    t = s & 0xFFFFF;
  190|       |
  191|   628M|    a = quant[2 * i];
  192|   628M|    b = quant[2 * i + 1];
  193|   628M|    a1 = abs(a);
  194|   628M|    b1 = abs(b);
  195|       |
  196|   628M|    ptr_c_pres[i] = a1 + b1 + 1;
  197|   628M|    if (ptr_c_pres[i] > 0xF) {
  ------------------
  |  Branch (197:9): [True: 45.7M, False: 582M]
  ------------------
  198|  45.7M|      ptr_c_pres[i] = 0xF;
  199|  45.7M|    }
  200|       |
  201|   628M|    lev = 0;
  202|   628M|    esc_nb = 0;
  203|       |
  204|   849M|    while ((a1) > 3 || (b1) > 3) {
  ------------------
  |  Branch (204:12): [True: 186M, False: 662M]
  |  Branch (204:24): [True: 34.2M, False: 628M]
  ------------------
  205|   220M|      pki = iusace_arith_get_pk(t + (esc_nb << 17));
  206|       |
  207|   220M|      bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, ARITH_ESCAPE, iusace_ari_cf_m[pki]);
  ------------------
  |  |   47|   220M|#define ARITH_ESCAPE (16)
  ------------------
  208|       |
  209|   220M|      qs[lev++] = (a1 & 1) | ((b1 & 1) << 1);
  210|   220M|      a1 >>= 1;
  211|   220M|      b1 >>= 1;
  212|   220M|      esc_nb++;
  213|       |
  214|   220M|      if (esc_nb > 7) {
  ------------------
  |  Branch (214:11): [True: 4.86M, False: 215M]
  ------------------
  215|  4.86M|        esc_nb = 7;
  216|  4.86M|      }
  217|   220M|    }
  218|   628M|    m = a1 + (b1 << 2);
  219|   628M|    pki = iusace_arith_get_pk(t + (esc_nb << 17));
  220|   628M|    bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, m, iusace_ari_cf_m[pki]);
  221|       |
  222|   628M|    a2 = a1;
  223|   628M|    b2 = b1;
  224|       |
  225|   849M|    for (l = lev - 1; l >= 0; l--) {
  ------------------
  |  Branch (225:23): [True: 220M, False: 628M]
  ------------------
  226|   220M|      WORD32 lsbidx = (a2 == 0) ? 1 : ((b2 == 0) ? 0 : 2);
  ------------------
  |  Branch (226:23): [True: 13.8M, False: 206M]
  |  Branch (226:40): [True: 31.6M, False: 175M]
  ------------------
  227|   220M|      bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, qs[l], iusace_ari_cf_r[lsbidx]);
  228|       |
  229|   220M|      a2 = (a2 << 1) | (qs[l] & 1);
  230|   220M|      b2 = (b2 << 1) | ((qs[l] >> 1) & 1);
  231|   220M|    }
  232|   628M|  }
  233|       |
  234|  7.20M|  if (use_stop == 2) {
  ------------------
  |  Branch (234:7): [True: 3.60M, False: 3.60M]
  ------------------
  235|  3.60M|    bp = iusace_arith_done(pstr_it_bit_buff, bp, &as);
  236|  3.60M|    if (stop) {
  ------------------
  |  Branch (236:9): [True: 2.71M, False: 881k]
  ------------------
  237|  2.71M|      bp_stop = iusace_arith_done(NULL, bp_stop, &as_stop);
  238|       |
  239|  2.71M|      if (bp_stop < bp) {
  ------------------
  |  Branch (239:11): [True: 1.88M, False: 831k]
  ------------------
  240|  1.88M|        iusace_copy_bit_buf(pstr_it_bit_buff, &it_bit_buff_temp);
  241|  1.88M|        bp = iusace_arith_encode_level2(pstr_it_bit_buff, bp_start, ptr_c_pres, ptr_c_prev, quant,
  242|  1.88M|                                        n, nt, 1);
  243|  1.88M|      } else {
  244|   831k|        iusace_copy_bit_buf(pstr_it_bit_buff, &it_bit_buff_temp);
  245|   831k|        bp = iusace_arith_encode_level2(pstr_it_bit_buff, bp_start, ptr_c_pres, ptr_c_prev, quant,
  246|   831k|                                        n, nt, 0);
  247|   831k|      }
  248|  2.71M|    } else {
  249|   881k|      iusace_copy_bit_buf(pstr_it_bit_buff, &it_bit_buff_temp);
  250|   881k|      bp = iusace_arith_encode_level2(pstr_it_bit_buff, bp_start, ptr_c_pres, ptr_c_prev, quant,
  251|   881k|                                      n, nt, 0);
  252|   881k|    }
  253|  3.60M|  } else {
  254|  3.60M|    bp = iusace_arith_done(pstr_it_bit_buff, bp, &as);
  255|       |
  256|   237M|    for (; i < nt; i++) {
  ------------------
  |  Branch (256:12): [True: 234M, False: 3.60M]
  ------------------
  257|   234M|      ptr_c_pres[i] = 1;
  258|   234M|    }
  259|       |
  260|   397M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (260:17): [True: 394M, False: 3.60M]
  ------------------
  261|   394M|      if (quant[2 * i] != 0) {
  ------------------
  |  Branch (261:11): [True: 122M, False: 271M]
  ------------------
  262|   122M|        if (quant[2 * i] > 0) {
  ------------------
  |  Branch (262:13): [True: 61.4M, False: 61.0M]
  ------------------
  263|  61.4M|          iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  264|  61.4M|          bp++;
  265|  61.4M|        } else {
  266|  61.0M|          iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  267|  61.0M|          bp++;
  268|  61.0M|        }
  269|   122M|      }
  270|       |
  271|   394M|      if (quant[2 * i + 1] != 0) {
  ------------------
  |  Branch (271:11): [True: 121M, False: 272M]
  ------------------
  272|   121M|        if (quant[2 * i + 1] > 0) {
  ------------------
  |  Branch (272:13): [True: 60.8M, False: 60.8M]
  ------------------
  273|  60.8M|          iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  274|  60.8M|          bp++;
  275|  60.8M|        } else {
  276|  60.8M|          iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  277|  60.8M|          bp++;
  278|  60.8M|        }
  279|   121M|      }
  280|   394M|    }
  281|       |
  282|   472M|    for (i = 0; i < nt; i++) {
  ------------------
  |  Branch (282:17): [True: 468M, False: 3.60M]
  ------------------
  283|   468M|      ptr_c_prev[i] = ptr_c_pres[i];
  284|   468M|      ptr_c_pres[i] = 1;
  285|   468M|    }
  286|  3.60M|  }
  287|       |
  288|  7.20M|  return bp;
  289|  7.20M|}
iusace_arith_enc.c:iusace_copy_bit_buf:
  117|  10.8M|                                ia_bit_buf_struct *it_bit_buff_src) {
  118|  10.8M|  if (it_bit_buff_src != NULL && it_bit_buff_dest != NULL) {
  ------------------
  |  Branch (118:7): [True: 6.68M, False: 4.12M]
  |  Branch (118:34): [True: 4.62M, False: 2.06M]
  ------------------
  119|  4.62M|    it_bit_buff_dest->cnt_bits = it_bit_buff_src->cnt_bits;
  120|  4.62M|    it_bit_buff_dest->ptr_write_next = it_bit_buff_src->ptr_write_next;
  121|  4.62M|    it_bit_buff_dest->write_position = it_bit_buff_src->write_position;
  122|  4.62M|  }
  123|  10.8M|  return;
  124|  10.8M|}
iusace_arith_enc.c:iusace_arith_get_state:
   78|   633M|static WORD32 iusace_arith_get_state(WORD32 *c_pres, WORD32 *c_prev, WORD32 *s, WORD32 idx) {
   79|   633M|  WORD32 s_tmp = *s;
   80|       |
   81|   633M|  s_tmp = s_tmp >> 4;
   82|   633M|  s_tmp = s_tmp + (c_prev[idx + 1] << 12);
   83|   633M|  s_tmp = (s_tmp & 0xFFF0) + c_pres[idx - 1];
   84|       |
   85|   633M|  *s = s_tmp;
   86|       |
   87|   633M|  if (idx > 3) {
  ------------------
  |  Branch (87:7): [True: 606M, False: 26.5M]
  ------------------
   88|   606M|    if ((c_pres[idx - 1] + c_pres[idx - 2] + c_pres[idx - 3]) < 5) {
  ------------------
  |  Branch (88:9): [True: 333M, False: 273M]
  ------------------
   89|   333M|      return (s_tmp + 0x10000);
   90|   333M|    }
   91|   606M|  }
   92|       |
   93|   300M|  return (s_tmp);
   94|   633M|}
iusace_arith_enc.c:iusace_arith_get_pk:
   96|   858M|static UWORD16 iusace_arith_get_pk(WORD32 c) {
   97|   858M|  WORD32 j;
   98|   858M|  WORD32 i, i_min, i_max;
   99|       |
  100|   858M|  i_min = -1;
  101|   858M|  i_max = (sizeof(iusace_ari_lookup_m) / sizeof(iusace_ari_lookup_m[0])) - 1;
  102|  8.51G|  while ((i_max - i_min) > 1) {
  ------------------
  |  Branch (102:10): [True: 7.99G, False: 521M]
  ------------------
  103|  7.99G|    i = i_min + ((i_max - i_min) / 2);
  104|  7.99G|    j = iusace_ari_hash_m[i];
  105|  7.99G|    if (c < j)
  ------------------
  |  Branch (105:9): [True: 3.49G, False: 4.49G]
  ------------------
  106|  3.49G|      i_max = i;
  107|  4.49G|    else if (c > j)
  ------------------
  |  Branch (107:14): [True: 4.16G, False: 336M]
  ------------------
  108|  4.16G|      i_min = i;
  109|   336M|    else
  110|   336M|      return (iusace_ari_hash_m_lsb[i]);
  111|  7.99G|  }
  112|       |
  113|   521M|  return (iusace_ari_lookup_m[i_max]);
  114|   858M|}

iusace_find_nearest_neighbor:
  177|  31.1M|VOID iusace_find_nearest_neighbor(FLOAT32 *bk, WORD32 *ck) {
  178|  31.1M|  WORD32 i, y1[8], y2[8];
  179|  31.1M|  FLOAT32 e1k, e2k, x1[8], tmp;
  180|       |
  181|  31.1M|  iusace_nearest_neighbor_2d(bk, y1);
  182|       |
  183|   280M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (183:15): [True: 249M, False: 31.1M]
  ------------------
  184|   249M|    x1[i] = bk[i] - 1.0f;
  185|   249M|  }
  186|  31.1M|  iusace_nearest_neighbor_2d(x1, y2);
  187|   280M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (187:15): [True: 249M, False: 31.1M]
  ------------------
  188|   249M|    y2[i] += 1;
  189|   249M|  }
  190|       |  /* Compute e1k = (Bk - y1k)^2 and e2k = (Bk – y2k)^2 */
  191|  31.1M|  e1k = e2k = 0.0;
  192|   280M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (192:15): [True: 249M, False: 31.1M]
  ------------------
  193|   249M|    tmp = bk[i] - y1[i];
  194|   249M|    e1k += tmp * tmp;
  195|   249M|    tmp = bk[i] - y2[i];
  196|   249M|    e2k += tmp * tmp;
  197|   249M|  }
  198|       |
  199|       |  /* Select best lattice point */
  200|  31.1M|  if (e1k < e2k) {
  ------------------
  |  Branch (200:7): [True: 22.5M, False: 8.62M]
  ------------------
  201|   202M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (201:17): [True: 180M, False: 22.5M]
  ------------------
  202|   180M|      ck[i] = y1[i];
  203|   180M|    }
  204|  22.5M|  } else {
  205|  77.5M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (205:17): [True: 68.9M, False: 8.62M]
  ------------------
  206|  68.9M|      ck[i] = y2[i];
  207|  68.9M|    }
  208|  8.62M|  }
  209|  31.1M|  return;
  210|  31.1M|}
iusace_apply_voronoi_ext:
  248|  3.58M|VOID iusace_apply_voronoi_ext(WORD32 *x, WORD32 *n, WORD32 *idx, WORD32 *k) {
  249|  3.58M|  WORD32 ka, c[8];
  250|  3.58M|  WORD32 i, r, m, v[8], c_tmp[8], k_mod[8], k_tmp[8], iter, ka_tmp, n_tmp, mask;
  251|  3.58M|  FLOAT32 sphere;
  252|  3.58M|  ka = iusace_find_absolute_leader(x);
  253|  3.58M|  *n = iusace_da_nq[ka];
  254|  3.58M|  if (*n <= 4) {
  ------------------
  |  Branch (254:7): [True: 2.46M, False: 1.12M]
  ------------------
  255|  22.1M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (255:17): [True: 19.6M, False: 2.46M]
  ------------------
  256|  19.6M|      c[i] = x[i];
  257|  19.6M|    }
  258|  2.46M|  } else {
  259|  1.12M|    sphere = 0.0;
  260|  10.1M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (260:17): [True: 9.01M, False: 1.12M]
  ------------------
  261|  9.01M|      sphere += (FLOAT32)x[i] * (FLOAT32)x[i];
  262|  9.01M|    }
  263|  1.12M|    sphere *= 0.125;
  264|  1.12M|    r = 1;
  265|  1.12M|    sphere *= 0.25;
  266|  1.47M|    while (sphere > 11.0) {
  ------------------
  |  Branch (266:12): [True: 351k, False: 1.12M]
  ------------------
  267|   351k|      r++;
  268|   351k|      sphere *= 0.25;
  269|   351k|    }
  270|  1.12M|    iusace_compute_coord(x, k_mod);
  271|  1.12M|    m = 1 << r;
  272|  1.12M|    mask = m - 1;
  273|  3.38M|    for (iter = 0; iter < 2; iter++) {
  ------------------
  |  Branch (273:20): [True: 2.25M, False: 1.12M]
  ------------------
  274|  20.2M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (274:19): [True: 18.0M, False: 2.25M]
  ------------------
  275|  18.0M|        k_tmp[i] = k_mod[i] & mask;
  276|  18.0M|      }
  277|  2.25M|      iusace_vononoi_idx(k_tmp, m, v);
  278|  20.2M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (278:19): [True: 18.0M, False: 2.25M]
  ------------------
  279|  18.0M|        c_tmp[i] = (x[i] - v[i]) / m;
  280|  18.0M|      }
  281|  2.25M|      ka_tmp = iusace_find_absolute_leader(c_tmp);
  282|  2.25M|      n_tmp = iusace_da_nq[ka_tmp];
  283|  2.25M|      if (n_tmp > 4) {
  ------------------
  |  Branch (283:11): [True: 1.12M, False: 1.13M]
  ------------------
  284|  1.12M|        r++;
  285|  1.12M|        m = m << 1;
  286|  1.12M|        mask = ((mask << 1) + 1);
  287|  1.13M|      } else {
  288|  1.13M|        if (n_tmp < 3) {
  ------------------
  |  Branch (288:13): [True: 86.6k, False: 1.04M]
  ------------------
  289|  86.6k|          n_tmp = 3;
  290|  86.6k|        }
  291|  1.13M|        ka = ka_tmp;
  292|  1.13M|        *n = n_tmp + 2 * r;
  293|  10.1M|        for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (293:21): [True: 9.05M, False: 1.13M]
  ------------------
  294|  9.05M|          k[i] = k_tmp[i];
  295|  9.05M|        }
  296|  10.1M|        for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (296:21): [True: 9.05M, False: 1.13M]
  ------------------
  297|  9.05M|          c[i] = c_tmp[i];
  298|  9.05M|        }
  299|  1.13M|        r--;
  300|  1.13M|        m = m >> 1;
  301|  1.13M|        mask = mask >> 1;
  302|  1.13M|      }
  303|  2.25M|    }
  304|  1.12M|  }
  305|       |
  306|  3.58M|  if (*n > 0) {
  ------------------
  |  Branch (306:7): [True: 2.68M, False: 904k]
  ------------------
  307|  2.68M|    iusace_gosset_compute_base_idx(c, ka, idx);
  308|  2.68M|  }
  309|  3.58M|  return;
  310|  3.58M|}
iusace_alg_vec_quant:
  312|  1.02M|VOID iusace_alg_vec_quant(FLOAT32 *ptr_input, WORD32 *ptr_out, WORD32 *ptr_lpc_idx) {
  313|  1.02M|  WORD32 i, l, nq, pos, c[8], kv[8];
  314|  1.02M|  FLOAT32 x1[8];
  315|  1.02M|  WORD32 lpc_index;
  316|       |
  317|  1.02M|  pos = 2;
  318|  3.06M|  for (l = 0; l < 2; l++) {
  ------------------
  |  Branch (318:15): [True: 2.04M, False: 1.02M]
  ------------------
  319|  18.4M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (319:17): [True: 16.3M, False: 2.04M]
  ------------------
  320|  16.3M|      x1[i] = ptr_input[l * 8 + i];
  321|  16.3M|      kv[i] = 0;
  322|  16.3M|    }
  323|       |
  324|  2.04M|    iusace_find_nearest_neighbor(x1, c);
  325|       |
  326|  2.04M|    iusace_apply_voronoi_ext(c, &nq, &lpc_index, kv);
  327|       |
  328|  18.4M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (328:17): [True: 16.3M, False: 2.04M]
  ------------------
  329|  16.3M|      ptr_out[l * 8 + i] = c[i];
  330|  16.3M|    }
  331|       |
  332|  2.04M|    ptr_lpc_idx[l] = nq;
  333|       |
  334|  2.04M|    if (nq > 0) {
  ------------------
  |  Branch (334:9): [True: 1.85M, False: 187k]
  ------------------
  335|  1.85M|      ptr_lpc_idx[pos++] = lpc_index;
  336|  16.7M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (336:19): [True: 14.8M, False: 1.85M]
  ------------------
  337|  14.8M|        ptr_lpc_idx[pos++] = kv[i];
  338|  14.8M|      }
  339|  1.85M|    }
  340|  2.04M|  }
  341|       |
  342|  1.02M|  return;
  343|  1.02M|}
iusace_avq_enc.c:iusace_nearest_neighbor_2d:
  143|  62.3M|static VOID iusace_nearest_neighbor_2d(FLOAT32 *x, WORD32 *y) {
  144|  62.3M|  WORD32 i, j;
  145|  62.3M|  WORD64 sum;
  146|  62.3M|  FLOAT32 diff[8], em;
  147|  62.3M|  sum = 0;
  148|   560M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (148:15): [True: 498M, False: 62.3M]
  ------------------
  149|   498M|    if (x[i] < 0) {
  ------------------
  |  Branch (149:9): [True: 328M, False: 169M]
  ------------------
  150|   328M|      y[i] = -2 * (((WORD32)(1.0 - x[i])) >> 1);
  151|   328M|    } else {
  152|   169M|      y[i] = 2 * (((WORD32)(1.0 + x[i])) >> 1);
  153|   169M|    }
  154|   498M|    sum += y[i];
  155|   498M|  }
  156|  62.3M|  if (sum % 4) {
  ------------------
  |  Branch (156:7): [True: 21.0M, False: 41.2M]
  ------------------
  157|  21.0M|    FLOAT32 s;
  158|  21.0M|    em = 0;
  159|  21.0M|    j = 0;
  160|   189M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (160:17): [True: 168M, False: 21.0M]
  ------------------
  161|   168M|      diff[i] = x[i] - y[i];
  162|   168M|      s = (FLOAT32)fabs(diff[i]);
  163|   168M|      if (em < s) {
  ------------------
  |  Branch (163:11): [True: 52.6M, False: 115M]
  ------------------
  164|  52.6M|        em = s;
  165|  52.6M|        j = i;
  166|  52.6M|      }
  167|   168M|    }
  168|  21.0M|    if (diff[j] < 0) {
  ------------------
  |  Branch (168:9): [True: 9.99M, False: 11.0M]
  ------------------
  169|  9.99M|      y[j] -= 2;
  170|  11.0M|    } else {
  171|  11.0M|      y[j] += 2;
  172|  11.0M|    }
  173|  21.0M|  }
  174|  62.3M|  return;
  175|  62.3M|}
iusace_avq_enc.c:iusace_find_absolute_leader:
  108|  5.84M|static WORD32 iusace_find_absolute_leader(WORD32 *y) {
  109|  5.84M|  WORD32 i, nb, pos, ka;
  110|  5.84M|  WORD64 s, C[8], id;
  111|  52.5M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (111:15): [True: 46.7M, False: 5.84M]
  ------------------
  112|  46.7M|    C[i] = (WORD64)y[i] * y[i];
  113|  46.7M|  }
  114|  5.84M|  s = 0;
  115|  52.5M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (115:15): [True: 46.7M, False: 5.84M]
  ------------------
  116|  46.7M|    s += C[i];
  117|  46.7M|  }
  118|  5.84M|  s >>= 3;
  119|  5.84M|  ka = LEN_ABS_LEADER + 1;
  ------------------
  |  |   23|  5.84M|#define LEN_ABS_LEADER 37
  ------------------
  120|  5.84M|  if (s == 0) {
  ------------------
  |  Branch (120:7): [True: 904k, False: 4.93M]
  ------------------
  121|   904k|    ka = LEN_ABS_LEADER;
  ------------------
  |  |   23|   904k|#define LEN_ABS_LEADER 37
  ------------------
  122|  4.93M|  } else {
  123|  4.93M|    if (s <= NB_SPHERE) {
  ------------------
  |  |   22|  4.93M|#define NB_SPHERE 32
  ------------------
  |  Branch (123:9): [True: 4.64M, False: 292k]
  ------------------
  124|  4.64M|      id = 0;
  125|  41.8M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (125:19): [True: 37.1M, False: 4.64M]
  ------------------
  126|  37.1M|        id += C[i] * C[i];
  127|  37.1M|      }
  128|  4.64M|      id = id >> 3;
  129|  4.64M|      nb = iusace_da_num_bits[s - 1];
  130|  4.64M|      pos = iusace_da_pos[s - 1];
  131|  8.75M|      for (i = 0; i < nb; i++) {
  ------------------
  |  Branch (131:19): [True: 6.80M, False: 1.95M]
  ------------------
  132|  6.80M|        if (id == (long)iusace_da_id[pos]) {
  ------------------
  |  Branch (132:13): [True: 2.68M, False: 4.11M]
  ------------------
  133|  2.68M|          ka = pos;
  134|  2.68M|          break;
  135|  2.68M|        }
  136|  4.11M|        pos++;
  137|  4.11M|      }
  138|  4.64M|    }
  139|  4.93M|  }
  140|  5.84M|  return (ka);
  141|  5.84M|}
iusace_avq_enc.c:iusace_compute_coord:
  236|  1.12M|static VOID iusace_compute_coord(WORD32 *y, WORD32 *k) {
  237|  1.12M|  WORD32 i, tmp, sum;
  238|  1.12M|  k[7] = y[7];
  239|  1.12M|  tmp = y[7];
  240|  1.12M|  sum = 5 * y[7];
  241|  7.89M|  for (i = 6; i >= 1; i--) {
  ------------------
  |  Branch (241:15): [True: 6.76M, False: 1.12M]
  ------------------
  242|  6.76M|    k[i] = (y[i] - tmp) >> 1;
  243|  6.76M|    sum -= y[i];
  244|  6.76M|  }
  245|  1.12M|  k[0] = (y[0] + sum) >> 2;
  246|  1.12M|}
iusace_avq_enc.c:iusace_vononoi_idx:
  212|  2.25M|static VOID iusace_vononoi_idx(WORD32 *kv, WORD32 m, WORD32 *y) {
  213|  2.25M|  WORD32 i, v[8], tmp, sum, *ptr1, *ptr2;
  214|  2.25M|  FLOAT32 z[8];
  215|  20.2M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (215:15): [True: 18.0M, False: 2.25M]
  ------------------
  216|  18.0M|    y[i] = kv[7];
  217|  18.0M|  }
  218|  2.25M|  z[7] = (FLOAT32)y[7] / m;
  219|  2.25M|  sum = 0;
  220|  15.7M|  for (i = 6; i >= 1; i--) {
  ------------------
  |  Branch (220:15): [True: 13.5M, False: 2.25M]
  ------------------
  221|  13.5M|    tmp = kv[i] << 1;
  222|  13.5M|    sum += tmp;
  223|  13.5M|    y[i] += tmp;
  224|  13.5M|    z[i] = (FLOAT32)y[i] / m;
  225|  13.5M|  }
  226|  2.25M|  y[0] += (4 * kv[0] + sum);
  227|  2.25M|  z[0] = (FLOAT32)(y[0] - 2) / m;
  228|  2.25M|  iusace_find_nearest_neighbor(z, v);
  229|  2.25M|  ptr1 = y;
  230|  2.25M|  ptr2 = v;
  231|  20.2M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (231:15): [True: 18.0M, False: 2.25M]
  ------------------
  232|  18.0M|    *ptr1++ -= m * *ptr2++;
  233|  18.0M|  }
  234|  2.25M|}
iusace_avq_enc.c:iusace_gosset_compute_base_idx:
   90|  2.68M|static VOID iusace_gosset_compute_base_idx(WORD32 *x, WORD32 ka, WORD32 *idx) {
   91|  2.68M|  WORD32 rank, offset, code, i, ks;
   92|  2.68M|  iusace_gosset_compute_rank_and_sign(x, &rank, &code);
   93|  2.68M|  ks = -1;
   94|  10.4M|  for (i = iusace_iso_code_index_table[ka]; i < LEN_SIGN_LEADER; i++) {
  ------------------
  |  |   24|  10.4M|#define LEN_SIGN_LEADER 226
  ------------------
  |  Branch (94:45): [True: 10.4M, False: 0]
  ------------------
   95|  10.4M|    if (code == iusace_iso_code_data_table[i]) {
  ------------------
  |  Branch (95:9): [True: 2.68M, False: 7.72M]
  ------------------
   96|  2.68M|      ks = i;
   97|  2.68M|      break;
   98|  2.68M|    }
   99|  10.4M|  }
  100|  2.68M|  if (ks == -1) {
  ------------------
  |  Branch (100:7): [True: 0, False: 2.68M]
  ------------------
  101|      0|    ks = 0;
  102|      0|  }
  103|  2.68M|  offset = iusace_signed_leader_is[ks];
  104|  2.68M|  *idx = offset + rank;
  105|  2.68M|  return;
  106|  2.68M|}
iusace_avq_enc.c:iusace_gosset_compute_rank_and_sign:
   26|  2.68M|static VOID iusace_gosset_compute_rank_and_sign(WORD32 *x, WORD32 *rank, WORD32 *sign_code) {
   27|  2.68M|  WORD32 xs[8], a[8], q, d[8], w[8], A, B, idx, tmp, abs_i, abs_j;
   28|  2.68M|  WORD32 i, j, k;
   29|  24.1M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (29:15): [True: 21.4M, False: 2.68M]
  ------------------
   30|  21.4M|    xs[i] = x[i];
   31|  21.4M|  }
   32|  21.4M|  for (k = 0; k < 7; k++) {
  ------------------
  |  Branch (32:15): [True: 18.7M, False: 2.68M]
  ------------------
   33|  18.7M|    j = k;
   34|  93.9M|    for (i = k + 1; i < 8; i++) {
  ------------------
  |  Branch (34:21): [True: 75.1M, False: 18.7M]
  ------------------
   35|  75.1M|      abs_j = abs(xs[j]);
   36|  75.1M|      abs_i = abs(xs[i]);
   37|  75.1M|      if (abs_i >= abs_j) {
  ------------------
  |  Branch (37:11): [True: 57.0M, False: 18.1M]
  ------------------
   38|  57.0M|        if (abs_i > xs[j]) {
  ------------------
  |  Branch (38:13): [True: 20.4M, False: 36.5M]
  ------------------
   39|  20.4M|          j = i;
   40|  20.4M|        }
   41|  57.0M|      }
   42|  75.1M|    }
   43|  18.7M|    if (j > k) {
  ------------------
  |  Branch (43:9): [True: 10.5M, False: 8.20M]
  ------------------
   44|  10.5M|      tmp = xs[k];
   45|  10.5M|      xs[k] = xs[j];
   46|  10.5M|      xs[j] = tmp;
   47|  10.5M|    }
   48|  18.7M|  }
   49|  2.68M|  *sign_code = 0;
   50|  24.1M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (50:15): [True: 21.4M, False: 2.68M]
  ------------------
   51|  21.4M|    if (xs[i] < 0) {
  ------------------
  |  Branch (51:9): [True: 7.01M, False: 14.4M]
  ------------------
   52|  7.01M|      *sign_code += iusace_pow2_table[i];
   53|  7.01M|    }
   54|  21.4M|  }
   55|  2.68M|  a[0] = xs[0];
   56|  2.68M|  q = 1;
   57|  21.4M|  for (i = 1; i < 8; i++) {
  ------------------
  |  Branch (57:15): [True: 18.7M, False: 2.68M]
  ------------------
   58|  18.7M|    if (xs[i] != xs[i - 1]) {
  ------------------
  |  Branch (58:9): [True: 4.40M, False: 14.3M]
  ------------------
   59|  4.40M|      a[q] = xs[i];
   60|  4.40M|      q++;
   61|  4.40M|    }
   62|  18.7M|  }
   63|  24.1M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (63:15): [True: 21.4M, False: 2.68M]
  ------------------
   64|  43.1M|    for (j = 0; j < q; j++) {
  ------------------
  |  Branch (64:17): [True: 43.1M, False: 0]
  ------------------
   65|  43.1M|      if (x[i] == a[j]) {
  ------------------
  |  Branch (65:11): [True: 21.4M, False: 21.6M]
  ------------------
   66|  21.4M|        d[i] = j;
   67|  21.4M|        break;
   68|  21.4M|      }
   69|  43.1M|    }
   70|  21.4M|  }
   71|  2.68M|  *rank = 0;
   72|  9.76M|  for (j = 0; j < q; j++) {
  ------------------
  |  Branch (72:15): [True: 7.08M, False: 2.68M]
  ------------------
   73|  7.08M|    w[j] = 0;
   74|  7.08M|  }
   75|  2.68M|  B = 1;
   76|  24.1M|  for (i = 7; i >= 0; i--) {
  ------------------
  |  Branch (76:15): [True: 21.4M, False: 2.68M]
  ------------------
   77|  21.4M|    idx = d[i];
   78|  21.4M|    w[idx]++;
   79|  21.4M|    B *= w[idx];
   80|  21.4M|    A = 0;
   81|  43.1M|    for (j = 0; j < idx; j++) {
  ------------------
  |  Branch (81:17): [True: 21.6M, False: 21.4M]
  ------------------
   82|  21.6M|      A += w[j];
   83|  21.6M|    }
   84|  21.4M|    if (A > 0) {
  ------------------
  |  Branch (84:9): [True: 8.29M, False: 13.1M]
  ------------------
   85|  8.29M|      *rank += A * iusace_factorial_table[i] / B;
   86|  8.29M|    }
   87|  21.4M|  }
   88|  2.68M|}

iusace_fft.c:ixheaace_dmult:
   23|  11.8G|static FLOAT64 ixheaace_dmult(FLOAT64 a, FLOAT64 b) { return (a * b); }
iusace_fft.c:ixheaace_dmac:
   25|  2.57G|static FLOAT64 ixheaace_dmac(FLOAT64 a, FLOAT64 b, FLOAT64 c) { return (a + b * c); }
ixheaace_fft.c:ixheaace_dmult:
   23|  2.61G|static FLOAT64 ixheaace_dmult(FLOAT64 a, FLOAT64 b) { return (a * b); }
ixheaace_fft.c:ixheaace_dmac:
   25|   523M|static FLOAT64 ixheaace_dmac(FLOAT64 a, FLOAT64 b, FLOAT64 c) { return (a + b * c); }
ixheaace_sbr_hbe_fft_ifft_32x32.c:ixheaace_dmult:
   23|   198M|static FLOAT64 ixheaace_dmult(FLOAT64 a, FLOAT64 b) { return (a * b); }
ixheaace_sbr_hbe_fft_ifft_32x32.c:ixheaace_dmac:
   25|  45.4M|static FLOAT64 ixheaace_dmac(FLOAT64 a, FLOAT64 b, FLOAT64 c) { return (a + b * c); }

iusace_create_bit_buffer:
   31|   349k|                                            WORD32 init) {
   32|   349k|  it_bit_buf->ptr_bit_buf_base = ptr_bit_buf_base;
   33|   349k|  it_bit_buf->ptr_bit_buf_end = ptr_bit_buf_base + bit_buffer_size - 1;
   34|   349k|  it_bit_buf->ptr_read_next = ptr_bit_buf_base;
   35|   349k|  it_bit_buf->ptr_write_next = ptr_bit_buf_base;
   36|       |
   37|   349k|  if (init) {
  ------------------
  |  Branch (37:7): [True: 349k, False: 0]
  ------------------
   38|   349k|    it_bit_buf->write_position = 7;
   39|   349k|    it_bit_buf->read_position = 7;
   40|   349k|    it_bit_buf->cnt_bits = 0;
   41|   349k|    it_bit_buf->size = bit_buffer_size * 8;
   42|   349k|  }
   43|       |
   44|   349k|  return (it_bit_buf);
   45|   349k|}
iusace_reset_bit_buffer:
   47|  81.1k|VOID iusace_reset_bit_buffer(ia_bit_buf_struct *it_bit_buf) {
   48|  81.1k|  it_bit_buf->ptr_read_next = it_bit_buf->ptr_bit_buf_base;
   49|  81.1k|  it_bit_buf->ptr_write_next = it_bit_buf->ptr_bit_buf_base;
   50|       |
   51|  81.1k|  it_bit_buf->write_position = 7;
   52|  81.1k|  it_bit_buf->read_position = 7;
   53|  81.1k|  it_bit_buf->cnt_bits = 0;
   54|       |
   55|  81.1k|  return;
   56|  81.1k|}
iusace_write_bits_buf:
   58|  2.40G|UWORD8 iusace_write_bits_buf(ia_bit_buf_struct *it_bit_buf, UWORD32 write_val, UWORD8 num_bits) {
   59|  2.40G|  WORD8 bits_to_write;
   60|  2.40G|  WORD32 write_position;
   61|  2.40G|  UWORD8 *ptr_write_next;
   62|  2.40G|  UWORD8 *ptr_bit_buf_end;
   63|  2.40G|  UWORD8 *ptr_bit_buf_base;
   64|  2.40G|  UWORD8 bits_written = num_bits;
   65|  2.40G|  if (it_bit_buf) {
  ------------------
  |  Branch (65:7): [True: 1.29G, False: 1.10G]
  ------------------
   66|  1.29G|    it_bit_buf->cnt_bits += num_bits;
   67|       |
   68|  1.29G|    write_position = it_bit_buf->write_position;
   69|  1.29G|    ptr_write_next = it_bit_buf->ptr_write_next;
   70|  1.29G|    ptr_bit_buf_end = it_bit_buf->ptr_bit_buf_end;
   71|  1.29G|    ptr_bit_buf_base = it_bit_buf->ptr_bit_buf_base;
   72|  2.69G|    while (num_bits) {
  ------------------
  |  Branch (72:12): [True: 1.39G, False: 1.29G]
  ------------------
   73|  1.39G|      UWORD8 tmp, msk;
   74|       |
   75|  1.39G|      bits_to_write = (WORD8)MIN(write_position + 1, num_bits);
  ------------------
  |  |   23|  1.39G|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 101M, False: 1.29G]
  |  |  ------------------
  ------------------
   76|       |
   77|  1.39G|      tmp = (UWORD8)(write_val << (32 - num_bits) >> (32 - bits_to_write)
   78|  1.39G|                                                         << (write_position + 1 - bits_to_write));
   79|       |
   80|  1.39G|      msk = ~(((1 << bits_to_write) - 1) << (write_position + 1 - bits_to_write));
   81|       |
   82|  1.39G|      *ptr_write_next &= msk;
   83|  1.39G|      *ptr_write_next |= tmp;
   84|       |
   85|  1.39G|      write_position -= bits_to_write;
   86|       |
   87|  1.39G|      num_bits -= bits_to_write;
   88|       |
   89|  1.39G|      if (write_position < 0) {
  ------------------
  |  Branch (89:11): [True: 264M, False: 1.13G]
  ------------------
   90|   264M|        write_position += 8;
   91|   264M|        ptr_write_next++;
   92|       |
   93|   264M|        if (ptr_write_next > ptr_bit_buf_end) {
  ------------------
  |  Branch (93:13): [True: 19, False: 264M]
  ------------------
   94|     19|          ptr_write_next = ptr_bit_buf_base;
   95|     19|        }
   96|   264M|      }
   97|  1.39G|    }
   98|       |
   99|  1.29G|    it_bit_buf->write_position = write_position;
  100|  1.29G|    it_bit_buf->ptr_write_next = ptr_write_next;
  101|  1.29G|  }
  102|       |
  103|  2.40G|  return (bits_written);
  104|  2.40G|}
iusace_write_escape_value:
  107|   172k|                                 UWORD8 no_bits1, UWORD8 no_bits2, UWORD8 no_bits3) {
  108|   172k|  WORD32 bit_cnt = 0;
  109|   172k|  UWORD32 esc_val = 0;
  110|   172k|  UWORD32 max_val1 = (1 << no_bits1) - 1;
  111|   172k|  UWORD32 max_val2 = (1 << no_bits2) - 1;
  112|   172k|  UWORD32 max_val3 = (1 << no_bits3) - 1;
  113|       |
  114|   172k|  esc_val = MIN(value, max_val1);
  ------------------
  |  |   23|   172k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 154k, False: 18.4k]
  |  |  ------------------
  ------------------
  115|   172k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, esc_val, no_bits1);
  116|       |
  117|   172k|  if (esc_val == max_val1) {
  ------------------
  |  Branch (117:7): [True: 18.4k, False: 154k]
  ------------------
  118|  18.4k|    value = value - esc_val;
  119|       |
  120|  18.4k|    esc_val = MIN(value, max_val2);
  ------------------
  |  |   23|  18.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 17.1k, False: 1.30k]
  |  |  ------------------
  ------------------
  121|  18.4k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, esc_val, no_bits2);
  122|       |
  123|  18.4k|    if (esc_val == max_val2) {
  ------------------
  |  Branch (123:9): [True: 1.30k, False: 17.1k]
  ------------------
  124|  1.30k|      value = value - esc_val;
  125|       |
  126|  1.30k|      esc_val = MIN(value, max_val3);
  ------------------
  |  |   23|  1.30k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 1.20k, False: 98]
  |  |  ------------------
  ------------------
  127|  1.30k|      bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, esc_val, no_bits3);
  128|  1.30k|    }
  129|  18.4k|  }
  130|       |
  131|   172k|  return bit_cnt;
  132|   172k|}

iusace_init_block_switching:
   33|  5.77k|                                 const WORD32 bit_rate, const WORD32 num_chans) {
   34|  5.77k|  WORD32 i, w;
   35|       |
   36|  5.77k|  if ((num_chans == 1 && bit_rate > 24000) || (num_chans > 1 && bit_rate / num_chans > 16000)) {
  ------------------
  |  Branch (36:8): [True: 993, False: 4.78k]
  |  Branch (36:26): [True: 975, False: 18]
  |  Branch (36:48): [True: 4.78k, False: 18]
  |  Branch (36:65): [True: 4.78k, False: 0]
  ------------------
   37|  5.75k|    pstr_blk_switch_ctrl->inv_attack_ratio = INV_ATTACK_RATIO_HIGH_BR;
  ------------------
  |  |   41|  5.75k|#define INV_ATTACK_RATIO_HIGH_BR 0.1f
  ------------------
   38|  5.75k|  } else {
   39|     18|    pstr_blk_switch_ctrl->inv_attack_ratio = INV_ATTACK_RATIO_LOW_BR;
  ------------------
  |  |   42|     18|#define INV_ATTACK_RATIO_LOW_BR 0.056f
  ------------------
   40|     18|  }
   41|       |
   42|  17.3k|  for (i = 0; i < BLK_SWITCH_FILT_LEN; i++) {
  ------------------
  |  |   25|  17.3k|#define BLK_SWITCH_FILT_LEN 2
  ------------------
  |  Branch (42:15): [True: 11.5k, False: 5.77k]
  ------------------
   43|  11.5k|    pstr_blk_switch_ctrl->iir_states[i] = 0;
   44|  11.5k|  }
   45|       |
   46|       |  /* Clear Filtered Window Energies */
   47|  51.9k|  for (w = 0; w < MAX_SHORT_WINDOWS; w++) {
  ------------------
  |  |   52|  51.9k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (47:15): [True: 46.2k, False: 5.77k]
  ------------------
   48|  46.2k|    pstr_blk_switch_ctrl->win_energy_filt[0][w] = 0;
   49|  46.2k|    pstr_blk_switch_ctrl->win_energy_filt[1][w] = 0;
   50|  46.2k|    pstr_blk_switch_ctrl->win_energy[0][w] = 0;
   51|  46.2k|    pstr_blk_switch_ctrl->win_energy[1][w] = 0;
   52|  46.2k|  }
   53|  5.77k|  pstr_blk_switch_ctrl->acc_win_energy = 0;
   54|       |
   55|  5.77k|  pstr_blk_switch_ctrl->window_seq = ONLY_LONG_SEQUENCE;
  ------------------
  |  |   45|  5.77k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
   56|  5.77k|  pstr_blk_switch_ctrl->next_win_seq = ONLY_LONG_SEQUENCE;
  ------------------
  |  |   45|  5.77k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
   57|       |
   58|  5.77k|  pstr_blk_switch_ctrl->attack = 0;
   59|  5.77k|  pstr_blk_switch_ctrl->lastattack = 0;
   60|  5.77k|  pstr_blk_switch_ctrl->attack_idx = 0;
   61|  5.77k|  pstr_blk_switch_ctrl->last_attack_idx = 0;
   62|       |
   63|  5.77k|  return;
   64|  5.77k|}
iusace_block_switching:
  150|   427k|                            WORD32 ccfl) {
  151|   427k|  WORD32 i;
  152|       |
  153|   427k|  FLOAT32 temp1, temp2;
  154|   427k|  FLOAT32 max;
  155|   427k|  FLOAT32 energy, energy_max;
  156|       |
  157|  3.84M|  for (i = 0; i < MAX_SHORT_WINDOWS; i++) {
  ------------------
  |  |   52|  3.84M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (157:15): [True: 3.42M, False: 427k]
  ------------------
  158|  3.42M|    ptr_blk_switch_ctrl->group_len[i] = 0;
  159|  3.42M|  }
  160|       |
  161|   427k|  ptr_blk_switch_ctrl->max_win_energy =
  162|   427k|      iusace_srch_max_with_idx(&ptr_blk_switch_ctrl->win_energy[0][MAX_SHORT_WINDOWS - 1],
  ------------------
  |  |   52|   427k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  163|   427k|                               &ptr_blk_switch_ctrl->attack_idx);
  164|       |
  165|   427k|  ptr_blk_switch_ctrl->attack_idx = ptr_blk_switch_ctrl->last_attack_idx;
  166|   427k|  ptr_blk_switch_ctrl->tot_grps_cnt = MAXIMUM_NO_OF_GROUPS;
  ------------------
  |  |   37|   427k|#define MAXIMUM_NO_OF_GROUPS 4
  ------------------
  167|       |
  168|  2.13M|  for (i = 0; i < MAXIMUM_NO_OF_GROUPS; i++) {
  ------------------
  |  |   37|  2.13M|#define MAXIMUM_NO_OF_GROUPS 4
  ------------------
  |  Branch (168:15): [True: 1.71M, False: 427k]
  ------------------
  169|  1.71M|    ptr_blk_switch_ctrl->group_len[i] =
  170|  1.71M|        iusace_suggested_grouping_table[ptr_blk_switch_ctrl->attack_idx][i];
  171|  1.71M|  }
  172|       |
  173|  3.84M|  for (i = 0; i < MAX_SHORT_WINDOWS; i++) {
  ------------------
  |  |   52|  3.84M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (173:15): [True: 3.42M, False: 427k]
  ------------------
  174|  3.42M|    ptr_blk_switch_ctrl->win_energy[0][i] = ptr_blk_switch_ctrl->win_energy[1][i];
  175|  3.42M|    ptr_blk_switch_ctrl->win_energy_filt[0][i] = ptr_blk_switch_ctrl->win_energy_filt[1][i];
  176|  3.42M|  }
  177|       |
  178|   427k|  iusace_calc_window_energy(ptr_blk_switch_ctrl, ptr_in, &max, ccfl);
  179|       |
  180|   427k|  ptr_blk_switch_ctrl->attack = FALSE;
  ------------------
  |  |   26|   427k|#define FALSE (0)
  ------------------
  181|       |
  182|   427k|  energy_max = 0.0f;
  183|       |
  184|   427k|  energy = ptr_blk_switch_ctrl->win_energy_filt[0][MAX_SHORT_WINDOWS - 1];
  ------------------
  |  |   52|   427k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  185|       |
  186|  3.84M|  for (i = 0; i < MAX_SHORT_WINDOWS; i++) {
  ------------------
  |  |   52|  3.84M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (186:15): [True: 3.42M, False: 427k]
  ------------------
  187|  3.42M|    temp1 = iusace_fmult(ONE_MINUS_ACC_WINDOW_NRG_FAC, ptr_blk_switch_ctrl->acc_win_energy);
  ------------------
  |  |   40|  3.42M|#define ONE_MINUS_ACC_WINDOW_NRG_FAC 0.7f
  ------------------
  188|  3.42M|    temp2 = iusace_fmult(ACC_WINDOW_NRG_FAC, energy);
  ------------------
  |  |   39|  3.42M|#define ACC_WINDOW_NRG_FAC 0.3f
  ------------------
  189|  3.42M|    ptr_blk_switch_ctrl->acc_win_energy = iusace_fadd(temp1, temp2);
  190|       |
  191|  3.42M|    temp1 = iusace_fmult(ptr_blk_switch_ctrl->win_energy_filt[1][i],
  192|  3.42M|                         ptr_blk_switch_ctrl->inv_attack_ratio);
  193|  3.42M|    if (temp1 > ptr_blk_switch_ctrl->acc_win_energy) {
  ------------------
  |  Branch (193:9): [True: 124k, False: 3.29M]
  ------------------
  194|   124k|      ptr_blk_switch_ctrl->attack = TRUE;
  ------------------
  |  |   23|   124k|#define TRUE (1)
  ------------------
  195|   124k|      ptr_blk_switch_ctrl->last_attack_idx = i;
  196|   124k|    }
  197|       |
  198|  3.42M|    energy = ptr_blk_switch_ctrl->win_energy_filt[1][i];
  199|  3.42M|    if (energy_max < energy) energy_max = energy;
  ------------------
  |  Branch (199:9): [True: 779k, False: 2.64M]
  ------------------
  200|  3.42M|  }
  201|       |
  202|   427k|  if (ccfl == LEN_SUPERFRAME_768) {
  ------------------
  |  |   67|   427k|#define LEN_SUPERFRAME_768 (768)
  ------------------
  |  Branch (202:7): [True: 108k, False: 319k]
  ------------------
  203|   108k|    energy_max = (energy_max * 4) / 3.0f;
  204|   108k|  }
  205|   427k|  if (energy_max < USAC_MIN_ATTACK_NRG) {
  ------------------
  |  |   43|   427k|#define USAC_MIN_ATTACK_NRG 1e+6
  ------------------
  |  Branch (205:7): [True: 213k, False: 214k]
  ------------------
  206|   213k|    ptr_blk_switch_ctrl->attack = FALSE;
  ------------------
  |  |   26|   213k|#define FALSE (0)
  ------------------
  207|   213k|  }
  208|       |
  209|   427k|  if ((!ptr_blk_switch_ctrl->attack) && (ptr_blk_switch_ctrl->lastattack)) {
  ------------------
  |  Branch (209:7): [True: 313k, False: 114k]
  |  Branch (209:41): [True: 65.2k, False: 248k]
  ------------------
  210|  65.2k|    if (ptr_blk_switch_ctrl->attack_idx == MAX_SHORT_WINDOWS - 1) {
  ------------------
  |  |   52|  65.2k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (210:9): [True: 2.05k, False: 63.1k]
  ------------------
  211|  2.05k|      ptr_blk_switch_ctrl->attack = TRUE;
  ------------------
  |  |   23|  2.05k|#define TRUE (1)
  ------------------
  212|  2.05k|    }
  213|  65.2k|    ptr_blk_switch_ctrl->lastattack = FALSE;
  ------------------
  |  |   26|  65.2k|#define FALSE (0)
  ------------------
  214|   362k|  } else {
  215|   362k|    ptr_blk_switch_ctrl->lastattack = ptr_blk_switch_ctrl->attack;
  216|   362k|  }
  217|   427k|  ptr_blk_switch_ctrl->window_seq = ptr_blk_switch_ctrl->next_win_seq;
  218|       |
  219|   427k|  if (ptr_blk_switch_ctrl->attack) {
  ------------------
  |  Branch (219:7): [True: 116k, False: 311k]
  ------------------
  220|   116k|    ptr_blk_switch_ctrl->next_win_seq = EIGHT_SHORT_SEQUENCE;
  ------------------
  |  |   40|   116k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  221|   311k|  } else {
  222|   311k|    ptr_blk_switch_ctrl->next_win_seq = ONLY_LONG_SEQUENCE;
  ------------------
  |  |   45|   311k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  223|   311k|  }
  224|   427k|  if (ptr_blk_switch_ctrl->next_win_seq == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (224:7): [True: 116k, False: 311k]
  ------------------
  225|   116k|    if (ptr_blk_switch_ctrl->window_seq == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|   116k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (225:9): [True: 46.8k, False: 69.2k]
  ------------------
  226|  46.8k|      ptr_blk_switch_ctrl->window_seq = LONG_START_SEQUENCE;
  ------------------
  |  |   46|  46.8k|#define LONG_START_SEQUENCE (1)
  ------------------
  227|  46.8k|    }
  228|       |
  229|   116k|    if (ptr_blk_switch_ctrl->window_seq == LONG_STOP_SEQUENCE) {
  ------------------
  |  |   48|   116k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (229:9): [True: 21.0k, False: 94.9k]
  ------------------
  230|  21.0k|      ptr_blk_switch_ctrl->window_seq = EIGHT_SHORT_SEQUENCE;
  ------------------
  |  |   40|  21.0k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  231|  21.0k|      ptr_blk_switch_ctrl->tot_grps_cnt = 3;
  232|  21.0k|      ptr_blk_switch_ctrl->group_len[0] = 3;
  233|  21.0k|      ptr_blk_switch_ctrl->group_len[1] = 3;
  234|  21.0k|      ptr_blk_switch_ctrl->group_len[2] = 2;
  235|  21.0k|    }
  236|   116k|  }
  237|       |
  238|   427k|  if (ptr_blk_switch_ctrl->next_win_seq == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|   427k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (238:7): [True: 311k, False: 116k]
  ------------------
  239|   311k|    if (ptr_blk_switch_ctrl->window_seq == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   311k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (239:9): [True: 64.5k, False: 247k]
  ------------------
  240|  64.5k|      ptr_blk_switch_ctrl->next_win_seq = LONG_STOP_SEQUENCE;
  ------------------
  |  |   48|  64.5k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  241|  64.5k|    }
  242|   311k|  }
  243|   427k|  return;
  244|   427k|}
iusace_sync_block_switching:
  247|   230k|                                 ia_block_switch_ctrl *ptr_blk_switch_right_ctrl) {
  248|   230k|  WORD32 i;
  249|   230k|  WORD32 patch_type = ONLY_LONG_SEQUENCE;
  ------------------
  |  |   45|   230k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  250|       |
  251|   230k|  patch_type = iusace_synchronized_block_types[patch_type][ptr_blk_switch_left_ctrl->window_seq];
  252|   230k|  patch_type = iusace_synchronized_block_types[patch_type][ptr_blk_switch_right_ctrl->window_seq];
  253|       |
  254|   230k|  ptr_blk_switch_left_ctrl->window_seq = patch_type;
  255|   230k|  ptr_blk_switch_right_ctrl->window_seq = patch_type;
  256|       |
  257|   230k|  if (patch_type != EIGHT_SHORT_SEQUENCE) { /* tns_data_long Blocks */
  ------------------
  |  |   40|   230k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (257:7): [True: 161k, False: 69.0k]
  ------------------
  258|   161k|    ptr_blk_switch_left_ctrl->tot_grps_cnt = 1;
  259|   161k|    ptr_blk_switch_right_ctrl->tot_grps_cnt = 1;
  260|   161k|    ptr_blk_switch_left_ctrl->group_len[0] = 1;
  261|   161k|    ptr_blk_switch_right_ctrl->group_len[0] = 1;
  262|       |
  263|  1.29M|    for (i = 1; i < MAX_SHORT_WINDOWS; i++) {
  ------------------
  |  |   52|  1.29M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (263:17): [True: 1.12M, False: 161k]
  ------------------
  264|  1.12M|      ptr_blk_switch_left_ctrl->group_len[i] = 0;
  265|  1.12M|      ptr_blk_switch_right_ctrl->group_len[i] = 0;
  266|  1.12M|    }
  267|   161k|  } else { /* tns_data_short Blocks */
  268|  69.0k|    if (ptr_blk_switch_left_ctrl->max_win_energy > ptr_blk_switch_right_ctrl->max_win_energy) {
  ------------------
  |  Branch (268:9): [True: 27.3k, False: 41.7k]
  ------------------
  269|  27.3k|      ptr_blk_switch_right_ctrl->tot_grps_cnt = ptr_blk_switch_left_ctrl->tot_grps_cnt;
  270|   133k|      for (i = 0; i < ptr_blk_switch_right_ctrl->tot_grps_cnt; i++) {
  ------------------
  |  Branch (270:19): [True: 105k, False: 27.3k]
  ------------------
  271|   105k|        ptr_blk_switch_right_ctrl->group_len[i] = ptr_blk_switch_left_ctrl->group_len[i];
  272|   105k|      }
  273|  41.7k|    } else {
  274|  41.7k|      ptr_blk_switch_left_ctrl->tot_grps_cnt = ptr_blk_switch_right_ctrl->tot_grps_cnt;
  275|   202k|      for (i = 0; i < ptr_blk_switch_left_ctrl->tot_grps_cnt; i++) {
  ------------------
  |  Branch (275:19): [True: 160k, False: 41.7k]
  ------------------
  276|   160k|        ptr_blk_switch_left_ctrl->group_len[i] = ptr_blk_switch_right_ctrl->group_len[i];
  277|   160k|      }
  278|  41.7k|    }
  279|  69.0k|  }
  280|       |
  281|   230k|  return;
  282|   230k|}
iusace_block_switch.c:iusace_srch_max_with_idx:
   66|   427k|static FLOAT32 iusace_srch_max_with_idx(const FLOAT32 *ptr_in, WORD32 *index) {
   67|   427k|  FLOAT32 max;
   68|   427k|  WORD32 i, idx;
   69|       |
   70|   427k|  max = 0;
   71|   427k|  idx = 0;
   72|       |
   73|  3.84M|  for (i = 0; i < MAX_SHORT_WINDOWS; i++) {
  ------------------
  |  |   52|  3.84M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (73:15): [True: 3.42M, False: 427k]
  ------------------
   74|  3.42M|    if (ptr_in[i + 1] > max) {
  ------------------
  |  Branch (74:9): [True: 787k, False: 2.63M]
  ------------------
   75|   787k|      max = ptr_in[i + 1];
   76|   787k|      idx = i;
   77|   787k|    }
   78|  3.42M|  }
   79|   427k|  *index = idx;
   80|       |
   81|   427k|  return max;
   82|   427k|}
iusace_block_switch.c:iusace_calc_window_energy:
  129|   427k|                                      const FLOAT32 *ptr_in, FLOAT32 *max, WORD32 ccfl) {
  130|   427k|  WORD32 w;
  131|       |
  132|   427k|  FLOAT32 energy_accu[2];
  133|   427k|  *max = 0.0f;
  134|       |
  135|  3.84M|  for (w = 0; w < MAX_SHORT_WINDOWS; w++) {
  ------------------
  |  |   52|  3.84M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (135:15): [True: 3.42M, False: 427k]
  ------------------
  136|       |    // block length for calculating energy is corecoder frame length / MAX_SHORT_WINDOWS
  137|  3.42M|    iusace_blk_switch_iir_filt(ptr_in, iusace_iir_hipass_coeffs, w,
  138|  3.42M|                               ptr_blk_switch_ctrl->iir_states, &energy_accu[0], ccfl >> 3);
  139|       |
  140|  3.42M|    ptr_blk_switch_ctrl->win_energy[1][w] = energy_accu[0];
  141|  3.42M|    ptr_blk_switch_ctrl->win_energy_filt[1][w] = energy_accu[1];
  142|       |
  143|  3.42M|    if (ptr_blk_switch_ctrl->win_energy_filt[1][w] > *max)
  ------------------
  |  Branch (143:9): [True: 779k, False: 2.64M]
  ------------------
  144|   779k|      *max = ptr_blk_switch_ctrl->win_energy_filt[1][w];
  145|  3.42M|  }
  146|   427k|  return;
  147|   427k|}
iusace_block_switch.c:iusace_blk_switch_iir_filt:
   86|  3.42M|                                       FLOAT32 *energy_accu, WORD32 block_len) {
   87|  3.42M|  FLOAT32 accu1;
   88|       |
   89|  3.42M|  WORD32 i;
   90|       |
   91|  3.42M|  FLOAT32 accu_unfilt = 0.0f;
   92|  3.42M|  FLOAT32 accu_filt = 0.0f;
   93|  3.42M|  FLOAT32 accu2, temp2, temp1;
   94|       |
   95|  3.42M|  FLOAT32 state0 = ptr_iir_states[0];
   96|  3.42M|  FLOAT32 state1 = ptr_iir_states[1];
   97|       |
   98|  3.42M|  FLOAT32 coeff0 = ptr_iir_coeff[0];
   99|  3.42M|  FLOAT32 coeff1 = ptr_iir_coeff[1];
  100|       |
  101|  3.42M|  const FLOAT32 *p_time_signal = &ptr_in[(block_len * w)];
  102|       |
  103|   413M|  for (i = 0; i < block_len; i++) {
  ------------------
  |  Branch (103:15): [True: 410M, False: 3.42M]
  ------------------
  104|   410M|    accu2 = iusace_fmult(state0, coeff1);
  105|   410M|    accu1 = iusace_fmult(state1, coeff0);
  106|   410M|    accu1 += accu2;
  107|       |
  108|   410M|    state0 = p_time_signal[i];
  109|   410M|    state1 = iusace_fmult(state0, coeff1);
  110|   410M|    state1 = (state1 - accu1);
  111|       |
  112|   410M|    temp1 = iusace_fmult(state0, state0);
  113|   410M|    temp2 = iusace_fmult(state1, state1);
  114|       |
  115|   410M|    accu_unfilt = iusace_fadd(accu_unfilt, temp1);
  116|   410M|    accu_filt = iusace_fadd(accu_filt, temp2);
  117|   410M|  }
  118|       |
  119|  3.42M|  energy_accu[0] = accu_unfilt;
  120|  3.42M|  energy_accu[1] = accu_filt;
  121|       |
  122|  3.42M|  ptr_iir_states[0] = state0;
  123|  3.42M|  ptr_iir_states[1] = state1;
  124|       |
  125|  3.42M|  return;
  126|  3.42M|}
iusace_block_switch.c:iusace_fmult:
   28|  2.06G|static FLOAT32 iusace_fmult(FLOAT32 a, FLOAT32 b) { return (a * b); }
iusace_block_switch.c:iusace_fadd:
   30|   823M|static FLOAT32 iusace_fadd(FLOAT32 a, FLOAT32 b) { return (a + b); }

iusace_encode_fac_params:
  300|   139k|                              ia_bit_buf_struct *pstr_it_bit_buff, WORD32 ch_idx) {
  301|   139k|  WORD32 *total_nbbits = &usac_data->total_nbbits[ch_idx];
  302|   139k|  ia_usac_td_encoder_struct *pstr_td = usac_data->td_encoder[ch_idx];
  303|   139k|  WORD32 codec_mode = pstr_td->acelp_core_mode;
  304|   139k|  WORD16 *bit_buf = usac_data->td_serial_out[ch_idx];
  305|   139k|  WORD32 is_bass_post_filter = 1;
  306|   139k|  WORD32 first_lpd_flag = (usac_data->core_mode_prev[ch_idx] == CORE_MODE_FD);
  ------------------
  |  |   33|   139k|#define CORE_MODE_FD (0)
  ------------------
  307|   139k|  WORD32 *param_lpc = usac_data->param_buf + (NUM_FRAMES * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                WORD32 *param_lpc = usac_data->param_buf + (NUM_FRAMES * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   139k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   139k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   139k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   139k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|   139k|  WORD32 *param = usac_data->param_buf;
  309|   139k|  WORD32 j, k, n, sfr, lpd_mode, num_bits, sq_bits, *prm;
  310|   139k|  WORD16 first_tcx_flag = 1;
  311|   139k|  WORD32 nbits_fac, nb_bits_lpc;
  312|   139k|  WORD32 core_mode_last = (first_lpd_flag) ? 0 : 1;
  ------------------
  |  Branch (312:27): [True: 4.19k, False: 135k]
  ------------------
  313|   139k|  WORD32 fac_data_present;
  314|   139k|  WORD32 num_frames = NUM_FRAMES;
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
  315|   139k|  WORD16 *ptr_bit_buf = bit_buf;
  316|       |
  317|   139k|  pstr_td->num_bits_per_supfrm = 0;
  318|   139k|  *total_nbbits = 0;
  319|       |
  320|   139k|  iusace_write_bits_buf(pstr_it_bit_buff, pstr_td->acelp_core_mode, 3);
  321|       |
  322|   139k|  if (mod[0] == 3) {
  ------------------
  |  Branch (322:7): [True: 33.9k, False: 105k]
  ------------------
  323|  33.9k|    lpd_mode = 25;
  324|   105k|  } else if ((mod[0] == 2) && (mod[2] == 2)) {
  ------------------
  |  Branch (324:14): [True: 15.6k, False: 89.6k]
  |  Branch (324:31): [True: 9.56k, False: 6.03k]
  ------------------
  325|  9.56k|    lpd_mode = 24;
  326|  95.6k|  } else {
  327|  95.6k|    if (mod[0] == 2) {
  ------------------
  |  Branch (327:9): [True: 6.03k, False: 89.6k]
  ------------------
  328|  6.03k|      lpd_mode = 16 + mod[2] + 2 * mod[3];
  329|  89.6k|    } else if (mod[2] == 2) {
  ------------------
  |  Branch (329:16): [True: 6.76k, False: 82.8k]
  ------------------
  330|  6.76k|      lpd_mode = 20 + mod[0] + 2 * mod[1];
  331|  82.8k|    } else {
  332|  82.8k|      lpd_mode = mod[0] + 2 * mod[1] + 4 * mod[2] + 8 * mod[3];
  333|  82.8k|    }
  334|  95.6k|  }
  335|   139k|  iusace_write_bits_buf(pstr_it_bit_buff, lpd_mode, 5);
  336|   139k|  pstr_td->num_bits_per_supfrm = 5;
  337|   139k|  *total_nbbits += 5;
  338|       |
  339|   139k|  iusace_write_bits_buf(pstr_it_bit_buff, is_bass_post_filter, 1);
  340|   139k|  *total_nbbits += 1;
  341|       |
  342|   139k|  iusace_write_bits_buf(pstr_it_bit_buff, core_mode_last, 1);
  343|   139k|  *total_nbbits += 1;
  344|       |
  345|   139k|  if (((mod[0] == 0) && (mod[-1] != 0)) || ((mod[0] > 0) && (mod[-1] == 0))) {
  ------------------
  |  Branch (345:8): [True: 52.6k, False: 86.5k]
  |  Branch (345:25): [True: 12.7k, False: 39.9k]
  |  Branch (345:45): [True: 86.5k, False: 39.9k]
  |  Branch (345:61): [True: 10.2k, False: 76.2k]
  ------------------
  346|  23.0k|    fac_data_present = 1;
  347|   116k|  } else {
  348|   116k|    fac_data_present = 0;
  349|   116k|  }
  350|       |
  351|   139k|  iusace_write_bits_buf(pstr_it_bit_buff, fac_data_present, 1);
  352|   139k|  *total_nbbits += 1;
  353|       |
  354|   139k|  num_bits = (iusace_acelp_core_numbits_1024[codec_mode] / 4) - 2;
  355|       |
  356|   139k|  k = 0;
  357|   562k|  while (k < num_frames) {
  ------------------
  |  Branch (357:10): [True: 422k, False: 139k]
  ------------------
  358|   422k|    lpd_mode = mod[k];
  359|   422k|    prm = param + (k * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   422k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   422k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   422k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   422k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|   422k|    j = 0;
  361|       |
  362|   422k|    if (((mod[k - 1] == 0) && (mod[k] > 0)) || ((mod[k - 1] > 0) && (mod[k] == 0))) {
  ------------------
  |  Branch (362:10): [True: 227k, False: 195k]
  |  Branch (362:31): [True: 48.8k, False: 178k]
  |  Branch (362:49): [True: 191k, False: 182k]
  |  Branch (362:69): [True: 48.0k, False: 143k]
  ------------------
  363|  96.9k|      nbits_fac = iusace_fd_encode_fac(&prm[j], ptr_bit_buf, (pstr_td->len_subfrm) / 2);
  364|  96.9k|      j += (pstr_td->len_subfrm) / 2;
  365|  96.9k|      *total_nbbits += nbits_fac;
  366|  16.3M|      for (WORD32 i = 0; i < nbits_fac; i++) {
  ------------------
  |  Branch (366:26): [True: 16.2M, False: 96.9k]
  ------------------
  367|  16.2M|        iusace_write_bits_buf(pstr_it_bit_buff, ptr_bit_buf[i], 1);
  368|  16.2M|      }
  369|  96.9k|    }
  370|       |
  371|   422k|    if (lpd_mode == 0) {
  ------------------
  |  Branch (371:9): [True: 229k, False: 193k]
  ------------------
  372|   229k|      iusace_write_bits_buf(pstr_it_bit_buff, prm[j++], 2);
  373|       |
  374|  1.08M|      for (sfr = 0; sfr < (pstr_td->num_subfrm); sfr++) {
  ------------------
  |  Branch (374:21): [True: 852k, False: 229k]
  ------------------
  375|   852k|        n = 6;
  376|   852k|        if ((sfr == 0) || (((pstr_td->len_subfrm) == 256) && (sfr == 2))) n = 9;
  ------------------
  |  Branch (376:13): [True: 229k, False: 622k]
  |  Branch (376:28): [True: 489k, False: 132k]
  |  Branch (376:62): [True: 163k, False: 326k]
  ------------------
  377|   852k|        iusace_write_bits_buf(pstr_it_bit_buff, prm[j], (UWORD8)n);
  378|   852k|        j++;
  379|   852k|        iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 1);
  380|   852k|        j++;
  381|   852k|        if (codec_mode == ACELP_CORE_MODE_9k6) {
  ------------------
  |  |  123|   852k|#define ACELP_CORE_MODE_9k6 (0)
  ------------------
  |  Branch (381:13): [True: 0, False: 852k]
  ------------------
  382|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 5);
  383|      0|          j++;
  384|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 5);
  385|      0|          j++;
  386|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 5);
  387|      0|          j++;
  388|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 5);
  389|      0|          j++;
  390|   852k|        } else if (codec_mode == ACELP_CORE_MODE_11k2) {
  ------------------
  |  |  124|   852k|#define ACELP_CORE_MODE_11k2 (1)
  ------------------
  |  Branch (390:20): [True: 0, False: 852k]
  ------------------
  391|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  392|      0|          j++;
  393|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  394|      0|          j++;
  395|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 5);
  396|      0|          j++;
  397|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 5);
  398|      0|          j++;
  399|   852k|        } else if (codec_mode == ACELP_CORE_MODE_12k8) {
  ------------------
  |  |  125|   852k|#define ACELP_CORE_MODE_12k8 (2)
  ------------------
  |  Branch (399:20): [True: 49.7k, False: 802k]
  ------------------
  400|  49.7k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  401|  49.7k|          j++;
  402|  49.7k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  403|  49.7k|          j++;
  404|  49.7k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  405|  49.7k|          j++;
  406|  49.7k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  407|  49.7k|          j++;
  408|   802k|        } else if (codec_mode == ACELP_CORE_MODE_14k4) {
  ------------------
  |  |  126|   802k|#define ACELP_CORE_MODE_14k4 (3)
  ------------------
  |  Branch (408:20): [True: 0, False: 802k]
  ------------------
  409|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  410|      0|          j++;
  411|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  412|      0|          j++;
  413|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  414|      0|          j++;
  415|      0|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  416|      0|          j++;
  417|   802k|        } else if (codec_mode == ACELP_CORE_MODE_16k) {
  ------------------
  |  |  127|   802k|#define ACELP_CORE_MODE_16k (4)
  ------------------
  |  Branch (417:20): [True: 5.05k, False: 797k]
  ------------------
  418|  5.05k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  419|  5.05k|          j++;
  420|  5.05k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  421|  5.05k|          j++;
  422|  5.05k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  423|  5.05k|          j++;
  424|  5.05k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  425|  5.05k|          j++;
  426|   797k|        } else if (codec_mode == ACELP_CORE_MODE_18k4) {
  ------------------
  |  |  128|   797k|#define ACELP_CORE_MODE_18k4 (5)
  ------------------
  |  Branch (426:20): [True: 797k, False: 0]
  ------------------
  427|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  428|   797k|          j++;
  429|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  430|   797k|          j++;
  431|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  432|   797k|          j++;
  433|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  434|   797k|          j++;
  435|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  436|   797k|          j++;
  437|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  438|   797k|          j++;
  439|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  440|   797k|          j++;
  441|   797k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  442|   797k|          j++;
  443|   797k|        }
  444|   852k|        iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 7);
  445|   852k|        j++;
  446|   852k|      }
  447|   229k|      *total_nbbits += (num_bits - NBITS_LPC);
  ------------------
  |  |  143|   229k|#define NBITS_LPC (46)
  ------------------
  448|   229k|      pstr_td->num_bits_per_supfrm += (num_bits - NBITS_LPC);
  ------------------
  |  |  143|   229k|#define NBITS_LPC (46)
  ------------------
  449|   229k|      k++;
  450|   229k|    } else {
  451|   193k|      iusace_write_bits_buf(pstr_it_bit_buff, prm[j++], 3);
  452|   193k|      *total_nbbits += 3;
  453|   193k|      pstr_td->num_bits_per_supfrm += 3;
  454|   193k|      iusace_write_bits_buf(pstr_it_bit_buff, prm[j++], 7);
  455|   193k|      *total_nbbits += 7;
  456|   193k|      pstr_td->num_bits_per_supfrm += 7;
  457|       |
  458|   193k|      if (first_tcx_flag) {
  ------------------
  |  Branch (458:11): [True: 109k, False: 83.3k]
  ------------------
  459|   109k|        first_tcx_flag = 0;
  460|   109k|        if (usac_independency_flag) {
  ------------------
  |  Branch (460:13): [True: 4.28k, False: 105k]
  ------------------
  461|  4.28k|          pstr_td->arith_reset_flag = 1;
  462|  4.28k|          memset(pstr_td->c_pres, 0, 516 * sizeof(WORD32));
  463|  4.28k|          memset(pstr_td->c_prev, 0, 516 * sizeof(WORD32));
  464|   105k|        } else {
  465|   105k|          if (pstr_td->arith_reset_flag) {
  ------------------
  |  Branch (465:15): [True: 105k, False: 0]
  ------------------
  466|   105k|            memset(pstr_td->c_pres, 0, 516 * sizeof(WORD32));
  467|   105k|            memset(pstr_td->c_prev, 0, 516 * sizeof(WORD32));
  468|   105k|          }
  469|   105k|          iusace_write_bits_buf(pstr_it_bit_buff, pstr_td->arith_reset_flag, 1);
  470|   105k|          *total_nbbits += 1;
  471|   105k|          pstr_td->num_bits_per_supfrm += 1;
  472|   105k|        }
  473|   109k|      }
  474|       |
  475|   193k|      sq_bits = iusace_tcx_coding(pstr_it_bit_buff, n_param_tcx[k], pstr_td->len_frame, prm + j,
  476|   193k|                                  pstr_td->c_pres, pstr_td->c_prev);
  477|       |
  478|   193k|      *total_nbbits += sq_bits;
  479|   193k|      pstr_td->num_bits_per_supfrm += sq_bits;
  480|       |
  481|   193k|      k += (1 << (lpd_mode - 1));
  482|   193k|    }
  483|   422k|  }
  484|       |
  485|   139k|  nb_bits_lpc = pstr_it_bit_buff->cnt_bits;
  486|       |
  487|   139k|  iusace_write_lpc_data(pstr_it_bit_buff, param_lpc, first_lpd_flag, mod, num_frames);
  488|       |
  489|   139k|  nb_bits_lpc = pstr_it_bit_buff->cnt_bits - nb_bits_lpc;
  490|   139k|  *total_nbbits += nb_bits_lpc;
  491|   139k|  pstr_td->num_bits_per_supfrm += nb_bits_lpc;
  492|       |
  493|   139k|  if ((core_mode_last == 0) && (fac_data_present == 1)) {
  ------------------
  |  Branch (493:7): [True: 4.19k, False: 135k]
  |  Branch (493:32): [True: 3.43k, False: 764]
  ------------------
  494|  3.43k|    WORD32 short_fac_flag = (mod[-1] == -2) ? 1 : 0;
  ------------------
  |  Branch (494:29): [True: 0, False: 3.43k]
  ------------------
  495|  3.43k|    iusace_write_bits_buf(pstr_it_bit_buff, short_fac_flag, 1);
  496|  3.43k|    *total_nbbits += 1;
  497|  3.43k|  }
  498|       |
  499|   139k|  return;
  500|   139k|}
iusace_fd_encode_fac:
  502|   102k|WORD32 iusace_fd_encode_fac(WORD32 *prm, WORD16 *ptr_bit_buf, WORD32 fac_length) {
  503|   102k|  WORD32 i, j, n, nb, qn, kv[8], nk, fac_bits;
  504|   102k|  WORD32 I;
  505|       |
  506|   102k|  fac_bits = 0;
  507|       |
  508|  1.64M|  for (i = 0; i < fac_length; i += 8) {
  ------------------
  |  Branch (508:15): [True: 1.54M, False: 102k]
  ------------------
  509|  1.54M|    iusace_apply_voronoi_ext(&prm[i], &qn, &I, kv);
  510|       |
  511|  1.54M|    nb = iusace_unary_code(qn, ptr_bit_buf);
  512|  1.54M|    ptr_bit_buf += nb;
  513|       |
  514|  1.54M|    fac_bits += nb;
  515|       |
  516|  1.54M|    nk = 0;
  517|  1.54M|    n = qn;
  518|  1.54M|    if (qn > 4) {
  ------------------
  |  Branch (518:9): [True: 198k, False: 1.34M]
  ------------------
  519|   198k|      nk = (qn - 3) >> 1;
  520|   198k|      n = qn - nk * 2;
  521|   198k|    }
  522|       |
  523|  1.54M|    if (qn != 0) {
  ------------------
  |  Branch (523:9): [True: 827k, False: 716k]
  ------------------
  524|   827k|      iusace_write_bits2buf(I, 4 * n, ptr_bit_buf);
  525|   827k|      ptr_bit_buf += 4 * n;
  526|   827k|    }
  527|  1.54M|    if (qn > 4) {
  ------------------
  |  Branch (527:9): [True: 198k, False: 1.34M]
  ------------------
  528|  1.78M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (528:19): [True: 1.58M, False: 198k]
  ------------------
  529|  1.58M|        iusace_write_bits2buf(kv[j], nk, ptr_bit_buf);
  530|  1.58M|        ptr_bit_buf += nk;
  531|  1.58M|      }
  532|   198k|    }
  533|  1.54M|    fac_bits += 4 * qn;
  534|  1.54M|  }
  535|       |
  536|   102k|  return fac_bits;
  537|   102k|}
iusace_enc_fac.c:iusace_write_lpc_data:
  212|   139k|                                  WORD32 first_lpd_flag, WORD32 *mod, WORD32 num_frames) {
  213|   139k|  WORD32 nk_mode = 0;
  214|   139k|  WORD32 j = 0, k;
  215|   139k|  WORD32 mode_lpc = 0;
  216|   139k|  WORD32 qn[2] = {0};
  217|       |
  218|   139k|  iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 4);
  219|       |
  220|   139k|  iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  221|       |
  222|   417k|  for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (222:15): [True: 278k, False: 139k]
  ------------------
  223|   278k|    qn[k] = param_lpc[j++];
  224|   278k|  }
  225|       |
  226|   139k|  iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  227|       |
  228|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (228:7): [True: 4.19k, False: 135k]
  ------------------
  229|  4.19k|    mode_lpc = param_lpc[j++];
  230|  4.19k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 0);
  231|       |
  232|  4.19k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (232:9): [True: 245, False: 3.95k]
  ------------------
  233|    245|      iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  234|    245|    }
  235|       |
  236|  12.5k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (236:17): [True: 8.39k, False: 4.19k]
  ------------------
  237|  8.39k|      qn[k] = param_lpc[j++];
  238|  8.39k|    }
  239|       |
  240|  4.19k|    iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  241|  4.19k|  }
  242|       |
  243|   139k|  mode_lpc = param_lpc[j++];
  244|       |
  245|   139k|  if (num_frames == 4 && mod[0] < 3) {
  ------------------
  |  Branch (245:7): [True: 139k, False: 0]
  |  Branch (245:26): [True: 105k, False: 33.9k]
  ------------------
  246|   105k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 2);
  247|       |
  248|   105k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (248:9): [True: 33.9k, False: 71.3k]
  ------------------
  249|  33.9k|      iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  250|  33.9k|    }
  251|       |
  252|   315k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (252:17): [True: 210k, False: 105k]
  ------------------
  253|   210k|      qn[k] = param_lpc[j++];
  254|   210k|    }
  255|       |
  256|   105k|    iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  257|   105k|  }
  258|   139k|  mode_lpc = param_lpc[j++];
  259|   139k|  if (mod[0] < 2) {
  ------------------
  |  Branch (259:7): [True: 89.6k, False: 49.5k]
  ------------------
  260|  89.6k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 1);
  261|       |
  262|  89.6k|    if (mode_lpc != 1) {
  ------------------
  |  Branch (262:9): [True: 61.3k, False: 28.2k]
  ------------------
  263|  61.3k|      if (mode_lpc == 0) {
  ------------------
  |  Branch (263:11): [True: 18.4k, False: 42.9k]
  ------------------
  264|  18.4k|        iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  265|  18.4k|      }
  266|       |
  267|   184k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (267:19): [True: 122k, False: 61.3k]
  ------------------
  268|   122k|        qn[k] = param_lpc[j++];
  269|   122k|      }
  270|       |
  271|  61.3k|      iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  272|  61.3k|    }
  273|  89.6k|  } else if (mode_lpc != 1) {
  ------------------
  |  Branch (273:14): [True: 38.8k, False: 10.7k]
  ------------------
  274|  38.8k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (274:9): [True: 21.1k, False: 17.7k]
  ------------------
  275|  21.1k|      j++;
  276|  21.1k|    }
  277|   116k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (277:17): [True: 77.6k, False: 38.8k]
  ------------------
  278|  77.6k|      qn[k] = param_lpc[j++];
  279|  77.6k|    }
  280|  38.8k|    j += ((qn[0] > 0) ? 9 : 0) + ((qn[1] > 0) ? 9 : 0);
  ------------------
  |  Branch (280:11): [True: 37.5k, False: 1.29k]
  |  Branch (280:35): [True: 35.5k, False: 3.33k]
  ------------------
  281|  38.8k|  }
  282|       |
  283|   139k|  mode_lpc = param_lpc[j++];
  284|   139k|  if (num_frames != 2 && mod[2] < 2) {
  ------------------
  |  Branch (284:7): [True: 139k, False: 0]
  |  Branch (284:26): [True: 88.8k, False: 50.3k]
  ------------------
  285|  88.8k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 3);
  286|  88.8k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (286:9): [True: 1.32k, False: 87.5k]
  ------------------
  287|  1.32k|      iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  288|  1.32k|    }
  289|       |
  290|   266k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (290:17): [True: 177k, False: 88.8k]
  ------------------
  291|   177k|      qn[k] = param_lpc[j++];
  292|   177k|    }
  293|  88.8k|    iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  294|  88.8k|  }
  295|   139k|  return;
  296|   139k|}
iusace_enc_fac.c:iusace_get_nk_mode:
   73|   427k|                               WORD32 *nk_mode, WORD32 lpc_set) {
   74|   427k|  switch (lpc_set) {
  ------------------
  |  Branch (74:11): [True: 427k, False: 0]
  ------------------
   75|   139k|    case 4:
  ------------------
  |  Branch (75:5): [True: 139k, False: 287k]
  ------------------
   76|   139k|      break;
   77|  4.19k|    case 0:
  ------------------
  |  Branch (77:5): [True: 4.19k, False: 422k]
  ------------------
   78|   109k|    case 2:
  ------------------
  |  Branch (78:5): [True: 105k, False: 321k]
  ------------------
   79|   109k|      *nk_mode = 3;
   80|   109k|      iusace_write_bits_buf(pstr_it_bit_buff, mode_lpc, 1);
   81|   109k|      break;
   82|  89.6k|    case 1:
  ------------------
  |  Branch (82:5): [True: 89.6k, False: 337k]
  ------------------
   83|  89.6k|      *nk_mode = mode_lpc;
   84|  89.6k|      if (mode_lpc == 2) {
  ------------------
  |  Branch (84:11): [True: 42.9k, False: 46.7k]
  ------------------
   85|  42.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
   86|  46.7k|      } else if (mode_lpc == 1) {
  ------------------
  |  Branch (86:18): [True: 28.2k, False: 18.4k]
  ------------------
   87|  28.2k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   88|  28.2k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   89|  28.2k|      } else if (mode_lpc == 0) {
  ------------------
  |  Branch (89:18): [True: 18.4k, False: 0]
  ------------------
   90|  18.4k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   91|  18.4k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
   92|  18.4k|      }
   93|  89.6k|      break;
   94|  88.8k|    case 3:
  ------------------
  |  Branch (94:5): [True: 88.8k, False: 338k]
  ------------------
   95|  88.8k|      if (mode_lpc == 0) {
  ------------------
  |  Branch (95:11): [True: 1.32k, False: 87.5k]
  ------------------
   96|  1.32k|        *nk_mode = 0;
   97|  1.32k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   98|  1.32k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
   99|  87.5k|      } else if (mode_lpc == 1) {
  ------------------
  |  Branch (99:18): [True: 52.2k, False: 35.3k]
  ------------------
  100|  52.2k|        *nk_mode = 1;
  101|  52.2k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  102|  52.2k|      } else if (mode_lpc == 2) {
  ------------------
  |  Branch (102:18): [True: 3.38k, False: 31.9k]
  ------------------
  103|  3.38k|        *nk_mode = 2;
  104|  3.38k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  105|  3.38k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  106|  3.38k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  107|  31.9k|      } else {
  108|  31.9k|        *nk_mode = 2;
  109|  31.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  110|  31.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  111|  31.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  112|  31.9k|      }
  113|  88.8k|      break;
  114|   427k|  }
  115|   427k|  return;
  116|   427k|}
iusace_enc_fac.c:iusace_write_cb_indices:
  181|   398k|                                    WORD32 num_frames) {
  182|   398k|  WORD32 k;
  183|   398k|  WORD32 j = *idx;
  184|       |
  185|   398k|  iusace_write_qn_data(qn, pstr_it_bit_buff, nk_mode, num_frames);
  186|       |
  187|  1.19M|  for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (187:15): [True: 797k, False: 398k]
  ------------------
  188|   797k|    if (qn[k] > 0) {
  ------------------
  |  Branch (188:9): [True: 583k, False: 214k]
  ------------------
  189|   583k|      WORD32 n, nk, i;
  190|   583k|      if (qn[k] > 4) {
  ------------------
  |  Branch (190:11): [True: 242k, False: 340k]
  ------------------
  191|   242k|        nk = (qn[k] - 3) >> 1;
  192|   242k|        n = qn[k] - nk * 2;
  193|   340k|      } else {
  194|   340k|        nk = 0;
  195|   340k|        n = qn[k];
  196|   340k|      }
  197|       |
  198|   583k|      iusace_write_bits_buf(pstr_it_bit_buff, ptr_params[j++], (UWORD8)(4 * n));
  199|       |
  200|  5.24M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (200:19): [True: 4.66M, False: 583k]
  ------------------
  201|  4.66M|        iusace_write_bits_buf(pstr_it_bit_buff, ptr_params[j++], (UWORD8)nk);
  202|  4.66M|      }
  203|   583k|    }
  204|   797k|  }
  205|       |
  206|   398k|  *idx = j;
  207|       |
  208|   398k|  return;
  209|   398k|}
iusace_enc_fac.c:iusace_write_qn_data:
  119|   398k|                                 WORD32 num_frames) {
  120|   398k|  WORD32 k, i;
  121|   398k|  switch (nk_mode) {
  ------------------
  |  Branch (121:11): [True: 398k, False: 0]
  ------------------
  122|  52.2k|    case 1:
  ------------------
  |  Branch (122:5): [True: 52.2k, False: 346k]
  ------------------
  123|   156k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (123:19): [True: 104k, False: 52.2k]
  ------------------
  124|   172k|        for (i = 0; i < qn[k] - 1; i++) {
  ------------------
  |  Branch (124:21): [True: 68.3k, False: 104k]
  ------------------
  125|  68.3k|          iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  126|  68.3k|        }
  127|   104k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  128|   104k|      }
  129|  52.2k|      break;
  130|   158k|    case 0:
  ------------------
  |  Branch (130:5): [True: 158k, False: 239k]
  ------------------
  131|   237k|    case 2:
  ------------------
  |  Branch (131:5): [True: 78.2k, False: 320k]
  ------------------
  132|   346k|    case 3:
  ------------------
  |  Branch (132:5): [True: 109k, False: 289k]
  ------------------
  133|  1.03M|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (133:19): [True: 693k, False: 346k]
  ------------------
  134|   693k|        WORD32 qn1 = qn[k] - 2;
  135|   693k|        if (qn1 < 0 || qn1 > 3) {
  ------------------
  |  Branch (135:13): [True: 151k, False: 541k]
  |  Branch (135:24): [True: 185k, False: 356k]
  ------------------
  136|   337k|          qn1 = 3;
  137|   337k|        }
  138|   693k|        iusace_write_bits_buf(pstr_it_bit_buff, qn1, 2);
  139|   693k|      }
  140|   346k|      if ((nk_mode == 2) && num_frames != 2) {
  ------------------
  |  Branch (140:11): [True: 78.2k, False: 268k]
  |  Branch (140:29): [True: 78.2k, False: 0]
  ------------------
  141|   234k|        for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (141:21): [True: 156k, False: 78.2k]
  ------------------
  142|   156k|          if (qn[k] > 4) {
  ------------------
  |  Branch (142:15): [True: 30.1k, False: 126k]
  ------------------
  143|  87.0k|            for (i = 0; i < qn[k] - 4; i++) {
  ------------------
  |  Branch (143:25): [True: 56.8k, False: 30.1k]
  ------------------
  144|  56.8k|              iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  145|  56.8k|            }
  146|  30.1k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  147|  30.1k|          }
  148|   156k|          if (qn[k] == 0) {
  ------------------
  |  Branch (148:15): [True: 25.0k, False: 131k]
  ------------------
  149|  25.0k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  150|  25.0k|          }
  151|   156k|        }
  152|   268k|      } else {
  153|   805k|        for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (153:21): [True: 536k, False: 268k]
  ------------------
  154|   536k|          if (qn[k] == 5) {
  ------------------
  |  Branch (154:15): [True: 42.1k, False: 494k]
  ------------------
  155|  42.1k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  156|   494k|          } else if (qn[k] == 6) {
  ------------------
  |  Branch (156:22): [True: 122k, False: 372k]
  ------------------
  157|   122k|            iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  158|   122k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  159|   372k|          } else if (qn[k] == 0) {
  ------------------
  |  Branch (159:22): [True: 126k, False: 245k]
  ------------------
  160|   126k|            iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  161|   126k|            iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  162|   126k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  163|   245k|          } else {
  164|   245k|            WORD32 qn_ext = qn[k] - 4;
  165|   245k|            if (qn_ext > 0) {
  ------------------
  |  Branch (165:17): [True: 45.7k, False: 199k]
  ------------------
  166|   208k|              for (i = 0; i < qn_ext; i++) {
  ------------------
  |  Branch (166:27): [True: 163k, False: 45.7k]
  ------------------
  167|   163k|                iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  168|   163k|              }
  169|  45.7k|              iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  170|  45.7k|            }
  171|   245k|          }
  172|   536k|        }
  173|   268k|      }
  174|   346k|      break;
  175|   398k|  }
  176|   398k|  return;
  177|   398k|}
iusace_enc_fac.c:iusace_unary_code:
   56|  1.54M|static WORD32 iusace_unary_code(WORD32 idx, WORD16 *ptr_bit_buf) {
   57|  1.54M|  WORD32 num_bits;
   58|       |
   59|  1.54M|  num_bits = 1;
   60|       |
   61|  1.54M|  idx -= 1;
   62|  3.93M|  while (idx-- > 0) {
  ------------------
  |  Branch (62:10): [True: 2.39M, False: 1.54M]
  ------------------
   63|  2.39M|    *ptr_bit_buf++ = 1;
   64|  2.39M|    num_bits++;
   65|  2.39M|  }
   66|       |
   67|  1.54M|  *ptr_bit_buf = 0;
   68|       |
   69|  1.54M|  return (num_bits);
   70|  1.54M|}

iusace_scratch_mem_init:
  149|  4.16k|VOID iusace_scratch_mem_init(ia_usac_data_struct *usac_data, WORD32 total_ch, WORD32 sr) {
  150|  4.16k|  iusace_scratch_mem *pstr_scratch = &usac_data->str_scratch;
  151|  4.16k|  UWORD8 *temp_ptr = pstr_scratch->ptr_scratch_buf;
  152|       |
  153|  4.16k|  pstr_scratch->ptr_stack_mem = (FLOAT32 *)(temp_ptr);
  154|  4.16k|  temp_ptr += USACE_SCR_STACK;
  ------------------
  |  |  202|  4.16k|#define USACE_SCR_STACK (10 * 1024)
  ------------------
  155|       |
  156|  4.16k|  pstr_scratch->p_fd_mdct_windowed_long_buf = (FLOAT64 *)(temp_ptr);
  157|  4.16k|  temp_ptr += (2 * FRAME_LEN_LONG) * sizeof(FLOAT64);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  158|       |
  159|  4.16k|  pstr_scratch->p_fd_mdct_windowed_short_buf = (FLOAT64 *)(temp_ptr);
  160|       |  // Size needed for above pointer is (2 * FRAME_LEN_LONG) * sizeof(FLOAT64)
  161|       |
  162|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_fd_mdct_windowed_short_buf;
  163|       |
  164|  4.16k|  pstr_scratch->p_tns_filter = (FLOAT64 *)(temp_ptr);
  165|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT64);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  166|       |
  167|  4.16k|  pstr_scratch->ptr_tns_scratch = (FLOAT64 *)(temp_ptr);
  168|  4.16k|  temp_ptr +=
  169|  4.16k|      (MAX_SHIFT_LEN_LONG + (TNS_MAX_ORDER + 1) * 2) * sizeof(pstr_scratch->ptr_tns_scratch[0]);
  ------------------
  |  |   58|  4.16k|#define MAX_SHIFT_LEN_LONG (4096)
  ------------------
                    (MAX_SHIFT_LEN_LONG + (TNS_MAX_ORDER + 1) * 2) * sizeof(pstr_scratch->ptr_tns_scratch[0]);
  ------------------
  |  |   27|  4.16k|#define TNS_MAX_ORDER 31
  ------------------
  170|       |
  171|  4.16k|  pstr_scratch->p_left_fac_time_data = (FLOAT64 *)(temp_ptr);
  172|  4.16k|  temp_ptr += (2 * FAC_LENGTH + ORDER) * sizeof(FLOAT64);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
                temp_ptr += (2 * FAC_LENGTH + ORDER) * sizeof(FLOAT64);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  173|       |
  174|  4.16k|  pstr_scratch->p_fac_win = (FLOAT64 *)(temp_ptr);
  175|       |  // Size needed for above pointer is (2 * FAC_LENGTH) * sizeof(FLOAT64)
  176|       |
  177|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_left_fac_time_data;
  178|       |
  179|  4.16k|  pstr_scratch->p_sort_grouping_scratch = (FLOAT64 *)(temp_ptr);
  180|       |  // Size needed for above pointer is (LN2) * sizeof(FLOAT64)
  181|       |
  182|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_sort_grouping_scratch;
  183|       |
  184|  4.16k|  pstr_scratch->p_noise_filling_highest_tone = (FLOAT64 *)(temp_ptr);
  185|  4.16k|  temp_ptr += (LN2) * sizeof(FLOAT64);
  ------------------
  |  |   24|  4.16k|#define LN2 (LN / 2)
  |  |  ------------------
  |  |  |  |   22|  4.16k|#define LN (2048)
  |  |  ------------------
  ------------------
  186|       |
  187|  4.16k|  pstr_scratch->p_quant_spectrum_spec_scratch = (FLOAT64 *)(temp_ptr);
  188|  4.16k|  temp_ptr += (2 * FRAME_LEN_LONG) * sizeof(FLOAT64);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  189|       |
  190|  4.16k|  pstr_scratch->p_cmpx_mdct_temp_buf = (FLOAT64 *)(temp_ptr);
  191|       |  // Size needed for above pointer is (LN2) * sizeof(FLOAT64)
  192|       |
  193|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_noise_filling_highest_tone;
  194|       |
  195|  11.2k|  for (WORD32 i = 0; i < total_ch; i++) {
  ------------------
  |  Branch (195:22): [True: 7.04k, False: 4.16k]
  ------------------
  196|  7.04k|    pstr_scratch->p_reconstructed_time_signal[i] = (FLOAT64 *)(temp_ptr);
  197|  7.04k|    temp_ptr += (4 * FRAME_LEN_LONG) * sizeof(FLOAT64);
  ------------------
  |  |   54|  7.04k|#define FRAME_LEN_LONG 1024
  ------------------
  198|  7.04k|  }
  199|  4.16k|  pstr_scratch->ptr_next_win_scratch = (WORD32 *)(temp_ptr);
  200|  4.16k|  temp_ptr += (2 * MAX_TIME_CHANNELS) * sizeof(pstr_scratch->ptr_next_win_scratch[0]);
  ------------------
  |  |   56|  4.16k|#define MAX_TIME_CHANNELS (2)
  ------------------
  201|       |
  202|  4.16k|  pstr_scratch->p_fft_p2_y = (FLOAT32 *)(temp_ptr);
  203|  4.16k|  temp_ptr += (2 * FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  204|       |
  205|  4.16k|  pstr_scratch->p_fft_p3_data_3 = (FLOAT32 *)(temp_ptr);
  206|  4.16k|  temp_ptr += (800) * sizeof(FLOAT32);
  207|       |
  208|  4.16k|  pstr_scratch->p_fft_p3_y = (FLOAT32 *)(temp_ptr);
  209|  4.16k|  temp_ptr += (2 * FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  210|       |
  211|  4.16k|  pstr_scratch->p_time_signal = (FLOAT32 *)(temp_ptr);
  212|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  213|       |
  214|  4.16k|  pstr_scratch->p_complex_fft = (FLOAT32 *)(temp_ptr);
  215|  4.16k|  temp_ptr += (2 * FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  216|       |
  217|  4.16k|  pstr_scratch->p_tonal_flag = (WORD32 *)(temp_ptr);
  218|  4.16k|  temp_ptr += (FRAME_LEN_LONG / 2) * sizeof(WORD32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  219|       |
  220|  4.16k|  pstr_scratch->p_pow_spec = (FLOAT32 *)(temp_ptr);
  221|       |  // Size needed for above pointer is (FRAME_LEN_LONG / 2) * sizeof(FLOAT32)
  222|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_time_signal;
  223|       |
  224|  4.16k|  pstr_scratch->p_temp_mdct = (FLOAT32 *)(temp_ptr);
  225|  4.16k|  temp_ptr += (1024) * sizeof(FLOAT32);
  226|       |
  227|  4.16k|  pstr_scratch->p_buf_synthesis_tool = (FLOAT32 *)(temp_ptr);
  228|  4.16k|  temp_ptr += (LEN_FRAME_16K + ORDER_LP_FILT_16K) * sizeof(FLOAT32);
  ------------------
  |  |  166|  4.16k|#define LEN_FRAME_16K 320
  ------------------
                temp_ptr += (LEN_FRAME_16K + ORDER_LP_FILT_16K) * sizeof(FLOAT32);
  ------------------
  |  |  167|  4.16k|#define ORDER_LP_FILT_16K (20)
  ------------------
  229|       |
  230|  4.16k|  pstr_scratch->p_mdct_spec_float = (FLOAT32 *)(temp_ptr);
  231|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  232|       |
  233|  4.16k|  pstr_scratch->p_sq_gain_en = (FLOAT32 *)(temp_ptr);
  234|  4.16k|  temp_ptr += (FRAME_LEN_LONG / 4) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  235|       |
  236|  4.16k|  pstr_scratch->p_fft_mdct_buf = (FLOAT32 *)(temp_ptr);
  237|  4.16k|  temp_ptr += (4 * FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  238|       |
  239|  4.16k|  pstr_scratch->p_arith_map_prev_scratch = (WORD32 *)(temp_ptr);
  240|  4.16k|  temp_ptr += (516) * sizeof(WORD32);
  241|       |
  242|  4.16k|  pstr_scratch->p_arith_map_pres_scratch = (WORD32 *)(temp_ptr);
  243|  4.16k|  temp_ptr += (516) * sizeof(WORD32);
  244|       |
  245|  4.16k|  pstr_scratch->p_ol_pitch_buf_tmp = (FLOAT32 *)(temp_ptr);
  246|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  247|       |
  248|  4.16k|  pstr_scratch->p_ol_pitch_speech_buf = (FLOAT32 *)(temp_ptr);
  249|  4.16k|  temp_ptr += (FRAME_LEN_LONG + LAG_MAX) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
                temp_ptr += (FRAME_LEN_LONG + LAG_MAX) * sizeof(FLOAT32);
  ------------------
  |  |  187|  4.16k|#define LAG_MAX (408)  // if 48k is max sr-- corresponding pitch_max/2
  ------------------
  250|       |
  251|  4.16k|  pstr_scratch->p_ol_pitch_w_table = (FLOAT32 *)(temp_ptr);
  252|  4.16k|  temp_ptr += (LEN_CORR_R) * sizeof(FLOAT32);
  ------------------
  |  |  188|  4.16k|#define LEN_CORR_R (LAG_MAX - LAG_MIN + 1)
  |  |  ------------------
  |  |  |  |  187|  4.16k|#define LAG_MAX (408)  // if 48k is max sr-- corresponding pitch_max/2
  |  |  ------------------
  |  |               #define LEN_CORR_R (LAG_MAX - LAG_MIN + 1)
  |  |  ------------------
  |  |  |  |  186|  4.16k|#define LAG_MIN (64)   // if 48k is max sr-- corresponding pitch_min/2
  |  |  ------------------
  ------------------
  253|       |
  254|  4.16k|  pstr_scratch->p_ol_pitch_R = (FLOAT32 *)(temp_ptr);
  255|  4.16k|  temp_ptr += (LEN_CORR_R) * sizeof(FLOAT32);
  ------------------
  |  |  188|  4.16k|#define LEN_CORR_R (LAG_MAX - LAG_MIN + 1)
  |  |  ------------------
  |  |  |  |  187|  4.16k|#define LAG_MAX (408)  // if 48k is max sr-- corresponding pitch_max/2
  |  |  ------------------
  |  |               #define LEN_CORR_R (LAG_MAX - LAG_MIN + 1)
  |  |  ------------------
  |  |  |  |  186|  4.16k|#define LAG_MIN (64)   // if 48k is max sr-- corresponding pitch_min/2
  |  |  ------------------
  ------------------
  256|       |
  257|  4.16k|  WORD32 R0_size = (54 + 6 * ((WORD32)(34.f * ((FLOAT32)sr / 2.f) / 12800.f + 0.5f) * 2)) / 2;
  258|  4.16k|  pstr_scratch->p_ol_pitch_R0 = (FLOAT32 *)(temp_ptr);
  259|  4.16k|  temp_ptr += (R0_size) * sizeof(FLOAT32);
  260|       |
  261|  4.16k|  pstr_scratch->p_lpd_frm_enc_scratch = (FLOAT32 *)(temp_ptr);
  262|  4.16k|  temp_ptr += (LEN_FRAME + 1) * sizeof(FLOAT32);
  ------------------
  |  |   74|  4.16k|#define LEN_FRAME (256)
  ------------------
  263|       |
  264|  4.16k|  pstr_scratch->p_wsig_buf = (FLOAT32 *)(temp_ptr + 128 * sizeof(FLOAT32));
  265|  4.16k|  temp_ptr += (128 + FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  266|       |
  267|  4.16k|  pstr_scratch->p_wsyn_tcx_buf = (FLOAT32 *)(temp_ptr + 128 * sizeof(FLOAT32));
  268|  4.16k|  temp_ptr += (128 + FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  269|       |
  270|  4.16k|  pstr_scratch->p_synth_tcx_buf = (FLOAT32 *)(temp_ptr + 128 * sizeof(FLOAT32));
  271|  4.16k|  temp_ptr += (128 + FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  272|       |
  273|  4.16k|  pstr_scratch->p_wsyn_buf = (FLOAT32 *)(temp_ptr + 128 * sizeof(FLOAT32));
  274|  4.16k|  temp_ptr += (128 + FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  275|       |
  276|  4.16k|  pstr_scratch->p_synth_buf = (FLOAT32 *)(temp_ptr + 128 * sizeof(FLOAT32));
  277|  4.16k|  temp_ptr += (128 + FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  278|       |
  279|  4.16k|  pstr_scratch->p_temp_wsyn_buf = (FLOAT32 *)temp_ptr;
  280|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  281|       |
  282|  4.16k|  pstr_scratch->p_lp_filter_coeff = (FLOAT32 *)(temp_ptr);
  283|  4.16k|  temp_ptr += ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32);
  ------------------
  |  |   81|  4.16k|#define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   75|  4.16k|#define NUM_FRAMES (4)
  |  |  ------------------
  |  |               #define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   76|  4.16k|#define MAX_NUM_SUBFR (4)
  |  |  ------------------
  ------------------
                temp_ptr += ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  284|       |
  285|  4.16k|  pstr_scratch->p_lp_filter_coeff_q = (FLOAT32 *)(temp_ptr);
  286|  4.16k|  temp_ptr += ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32);
  ------------------
  |  |   81|  4.16k|#define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   75|  4.16k|#define NUM_FRAMES (4)
  |  |  ------------------
  |  |               #define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   76|  4.16k|#define MAX_NUM_SUBFR (4)
  |  |  ------------------
  ------------------
                temp_ptr += ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  287|       |
  288|  4.16k|  pstr_scratch->p_wsp_prev_buf = (FLOAT32 *)(temp_ptr);
  289|  4.16k|  temp_ptr += ((MAX_PITCH1 / OPL_DECIM) + LEN_FRAME) * sizeof(FLOAT32);
  ------------------
  |  |  113|  4.16k|#define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|  4.16k|#define TMAX (231)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  4.16k|#define TMIN (34)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  4.16k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  4.16k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  4.16k|#define TMIN (34)
  |  |  ------------------
  ------------------
                temp_ptr += ((MAX_PITCH1 / OPL_DECIM) + LEN_FRAME) * sizeof(FLOAT32);
  ------------------
  |  |  116|  4.16k|#define OPL_DECIM (2)
  ------------------
                temp_ptr += ((MAX_PITCH1 / OPL_DECIM) + LEN_FRAME) * sizeof(FLOAT32);
  ------------------
  |  |   74|  4.16k|#define LEN_FRAME (256)
  ------------------
  290|       |
  291|  4.16k|  pstr_scratch->ptr_lpd_scratch = (UWORD8 *)temp_ptr;
  292|  4.16k|  temp_ptr += ((2 * (NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) + (4 * (NUM_FRAMES + 1) * ORDER) +
  ------------------
  |  |   81|  4.16k|#define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   75|  4.16k|#define NUM_FRAMES (4)
  |  |  ------------------
  |  |               #define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   76|  4.16k|#define MAX_NUM_SUBFR (4)
  |  |  ------------------
  ------------------
                temp_ptr += ((2 * (NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) + (4 * (NUM_FRAMES + 1) * ORDER) +
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
                temp_ptr += ((2 * (NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) + (4 * (NUM_FRAMES + 1) * ORDER) +
  ------------------
  |  |   75|  4.16k|#define NUM_FRAMES (4)
  ------------------
                temp_ptr += ((2 * (NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) + (4 * (NUM_FRAMES + 1) * ORDER) +
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  293|  4.16k|               (((NUM_FRAMES >> 1) + 1) * ORDER) * 4) *
  ------------------
  |  |   75|  4.16k|#define NUM_FRAMES (4)
  ------------------
                             (((NUM_FRAMES >> 1) + 1) * ORDER) * 4) *
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  294|  4.16k|                  sizeof(FLOAT32) +
  295|  4.16k|              100 * sizeof(WORD32) + 6 * sizeof(ia_usac_lpd_scratch);
  296|       |
  297|  4.16k|  pstr_scratch->p_prm_tcx = (WORD32 *)(temp_ptr);
  298|  4.16k|  temp_ptr += (NUM_TCX80_PRM) * sizeof(WORD32);
  ------------------
  |  |  147|  4.16k|#define NUM_TCX80_PRM (FAC_LENGTH + 2 + NUM_RE8_PRM)
  |  |  ------------------
  |  |  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NUM_TCX80_PRM (FAC_LENGTH + 2 + NUM_RE8_PRM)
  |  |  ------------------
  |  |  |  |  145|  4.16k|#define NUM_RE8_PRM (LEN_SUPERFRAME + (LEN_SUPERFRAME / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  4.16k|#define LEN_SUPERFRAME (1024)
  |  |  |  |  ------------------
  |  |  |  |               #define NUM_RE8_PRM (LEN_SUPERFRAME + (LEN_SUPERFRAME / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  4.16k|#define LEN_SUPERFRAME (1024)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  299|       |
  300|  4.16k|  pstr_scratch->p_buf_speech = (FLOAT32 *)(temp_ptr);
  301|  4.16k|  temp_ptr += (2 * LEN_FRAME + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   74|  4.16k|#define LEN_FRAME (256)
  ------------------
                temp_ptr += (2 * LEN_FRAME + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  302|       |
  303|  4.16k|  pstr_scratch->p_buf_res = (FLOAT32 *)(temp_ptr);
  304|  4.16k|  temp_ptr += (2 * LEN_FRAME) * sizeof(FLOAT32);
  ------------------
  |  |   74|  4.16k|#define LEN_FRAME (256)
  ------------------
  305|       |
  306|  4.16k|  pstr_scratch->p_buf_signal = (FLOAT32 *)(temp_ptr);
  307|  4.16k|  temp_ptr += (ORDER + LEN_FRAME) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
                temp_ptr += (ORDER + LEN_FRAME) * sizeof(FLOAT32);
  ------------------
  |  |   74|  4.16k|#define LEN_FRAME (256)
  ------------------
  308|       |
  309|  4.16k|  pstr_scratch->p_xn1_tcx = (FLOAT32 *)(temp_ptr);
  310|  4.16k|  temp_ptr += (2 * FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  311|       |
  312|  4.16k|  pstr_scratch->p_xn_buf_tcx = (FLOAT32 *)(temp_ptr);
  313|  4.16k|  temp_ptr += (128 + FRAME_LEN_LONG + 128) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  314|       |
  315|  4.16k|  pstr_scratch->p_x_tcx = (FLOAT32 *)(temp_ptr);
  316|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  317|       |
  318|  4.16k|  pstr_scratch->p_x_tmp_tcx = (FLOAT32 *)(temp_ptr);
  319|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  320|       |
  321|  4.16k|  pstr_scratch->p_en_tcx = (FLOAT32 *)(temp_ptr);
  322|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  323|       |
  324|  4.16k|  pstr_scratch->p_alfd_gains_tcx = (FLOAT32 *)(temp_ptr);
  325|  4.16k|  temp_ptr += (FRAME_LEN_LONG / (4 * 8)) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  326|       |
  327|  4.16k|  pstr_scratch->p_sq_enc_tcx = (FLOAT32 *)(temp_ptr);
  328|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  329|       |
  330|  4.16k|  pstr_scratch->p_sq_quant_tcx = (WORD32 *)(temp_ptr);
  331|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(WORD32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  332|       |
  333|  4.16k|  pstr_scratch->p_gain1_tcx = (FLOAT32 *)(temp_ptr);
  334|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  335|       |
  336|  4.16k|  pstr_scratch->p_gain2_tcx = (FLOAT32 *)(temp_ptr);
  337|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  338|       |
  339|  4.16k|  pstr_scratch->p_facelp_tcx = (FLOAT32 *)(temp_ptr);
  340|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  341|       |
  342|  4.16k|  pstr_scratch->p_xn2_tcx = (FLOAT32 *)(temp_ptr);
  343|  4.16k|  temp_ptr += (2 * FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  344|       |
  345|  4.16k|  pstr_scratch->p_fac_window_tcx = (FLOAT32 *)(temp_ptr);
  346|  4.16k|  temp_ptr += (2 * FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  347|       |
  348|  4.16k|  pstr_scratch->p_x1_tcx = (FLOAT32 *)(temp_ptr);
  349|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  350|       |
  351|  4.16k|  pstr_scratch->p_x2_tcx = (FLOAT32 *)(temp_ptr);
  352|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  353|       |
  354|  4.16k|  pstr_scratch->p_y_tcx = (WORD32 *)(temp_ptr);
  355|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(WORD32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  356|       |
  357|  4.16k|  pstr_scratch->p_in_out_tcx = (FLOAT32 *)(temp_ptr);
  358|  4.16k|  temp_ptr += (FRAME_LEN_LONG * 2 * 2) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  359|       |
  360|  4.16k|  pstr_scratch->p_tcx_input = (FLOAT32 *)(temp_ptr);
  361|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  362|       |
  363|  4.16k|  pstr_scratch->ptr_tcx_scratch = (FLOAT32 *)(temp_ptr);
  364|  4.16k|  temp_ptr += 3 * (FRAME_LEN_LONG) * sizeof(pstr_scratch->ptr_tcx_scratch[0]);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  365|       |
  366|  4.16k|  pstr_scratch->p_tcx_output = (FLOAT32 *)(temp_ptr);
  367|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  368|       |
  369|  4.16k|  pstr_scratch->p_buf_aut_corr = (FLOAT32 *)(temp_ptr);
  370|       |  // Size needed for above pointer is (LEN_WIN_PLUS) * sizeof(FLOAT32)
  371|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_buf_aut_corr;
  372|       |
  373|  4.16k|  pstr_scratch->p_xn2 = (FLOAT32 *)(temp_ptr);
  374|  4.16k|  temp_ptr += (FAC_LENGTH + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
                temp_ptr += (FAC_LENGTH + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  375|       |
  376|  4.16k|  pstr_scratch->p_fac_dec = (FLOAT32 *)(temp_ptr);
  377|  4.16k|  temp_ptr += (2 * FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  378|       |
  379|  4.16k|  pstr_scratch->p_right_fac_spec = (FLOAT32 *)(temp_ptr);
  380|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  381|       |
  382|  4.16k|  pstr_scratch->p_x2 = (FLOAT32 *)(temp_ptr);
  383|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  384|       |
  385|  4.16k|  pstr_scratch->p_param = (WORD32 *)(temp_ptr);
  386|  4.16k|  temp_ptr += (FAC_LENGTH + 1) * sizeof(WORD32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  387|       |
  388|  4.16k|  pstr_scratch->p_x = (FLOAT32 *)(temp_ptr);
  389|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  390|       |
  391|  4.16k|  pstr_scratch->p_xn_2 = (FLOAT32 *)(temp_ptr);
  392|  4.16k|  temp_ptr += (2 * FAC_LENGTH + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
                temp_ptr += (2 * FAC_LENGTH + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  393|       |
  394|  4.16k|  pstr_scratch->p_fac_window = (FLOAT32 *)(temp_ptr);
  395|  4.16k|  temp_ptr += (2 * FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  396|       |
  397|  4.16k|  pstr_scratch->p_fir_sig_buf = (FLOAT32 *)(temp_ptr);
  398|       |  // Size needed for above pointer is (3 + LEN_FRAME) * sizeof(FLOAT32)
  399|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_fir_sig_buf;
  400|       |
  401|  4.16k|  pstr_scratch->p_acelp_ir_buf = (FLOAT32 *)(temp_ptr);
  402|       |
  403|  4.16k|  temp_ptr += (4 * LEN_SUBFR) * sizeof(FLOAT32);
  ------------------
  |  |   77|  4.16k|#define LEN_SUBFR (64)
  ------------------
  404|       |
  405|  4.16k|  pstr_scratch->ptr_acelp_scratch = (FLOAT32 *)(temp_ptr);
  406|  4.16k|  temp_ptr += ((11 * LEN_SUBFR) + (ORDER + LEN_SUBFR + 8) + 1024) *
  ------------------
  |  |   77|  4.16k|#define LEN_SUBFR (64)
  ------------------
                temp_ptr += ((11 * LEN_SUBFR) + (ORDER + LEN_SUBFR + 8) + 1024) *
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
                temp_ptr += ((11 * LEN_SUBFR) + (ORDER + LEN_SUBFR + 8) + 1024) *
  ------------------
  |  |   77|  4.16k|#define LEN_SUBFR (64)
  ------------------
  407|  4.16k|              sizeof(pstr_scratch->ptr_acelp_scratch[0]);
  408|       |
  409|  4.16k|  pstr_scratch->p_acelp_exc_buf = (FLOAT32 *)(temp_ptr);
  410|       |  // Size needed for above pointer is ((3 * LEN_FRAME) + 1 + 41) * sizeof(FLOAT32)
  411|       |
  412|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_lpd_frm_enc_scratch;
  413|       |
  414|  4.16k|  pstr_scratch->p_fac_bits_word = (WORD16 *)(temp_ptr);
  415|  4.16k|  temp_ptr += (5000) * sizeof(WORD16);
  416|       |
  417|  4.16k|  pstr_scratch->p_left_fac_timedata_flt = (FLOAT32 *)(temp_ptr);
  418|  4.16k|  temp_ptr += (2 * FAC_LENGTH + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
                temp_ptr += (2 * FAC_LENGTH + ORDER) * sizeof(FLOAT32);
  ------------------
  |  |   71|  4.16k|#define ORDER (16)
  ------------------
  419|       |
  420|  4.16k|  pstr_scratch->p_left_fac_spec = (FLOAT32 *)(temp_ptr);
  421|  4.16k|  temp_ptr += (FAC_LENGTH) * sizeof(FLOAT32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  422|       |
  423|  4.16k|  pstr_scratch->p_fac_prm = (WORD32 *)(temp_ptr);
  424|  4.16k|  temp_ptr += (FAC_LENGTH + 1) * sizeof(WORD32);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  425|       |
  426|  4.16k|  pstr_scratch->p_acelp_folded_scratch = (FLOAT32 *)(temp_ptr);
  427|       |  // Size needed for above pointer is (FAC_LENGTH) * sizeof(FLOAT32)
  428|       |
  429|  4.16k|  temp_ptr = (UWORD8 *)pstr_scratch->p_fac_bits_word;
  430|       |
  431|  4.16k|  pstr_scratch->p_exp_spec = (FLOAT32 *)(temp_ptr);
  432|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  433|       |
  434|  4.16k|  pstr_scratch->p_adjthr_ptr_exp_spec = (FLOAT32 *)(temp_ptr);
  435|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  436|       |
  437|  4.16k|  pstr_scratch->p_adjthr_mdct_spec_float = (FLOAT32 *)(temp_ptr);
  438|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(FLOAT32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  439|       |
  440|  4.16k|  pstr_scratch->p_adjthr_quant_spec_temp = (WORD16 *)(temp_ptr);
  441|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(WORD16);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  442|       |
  443|  4.16k|  pstr_scratch->p_degroup_scratch = (WORD32 *)(temp_ptr);
  444|  4.16k|  temp_ptr += (FRAME_LEN_LONG) * sizeof(WORD32);
  ------------------
  |  |   54|  4.16k|#define FRAME_LEN_LONG 1024
  ------------------
  445|       |
  446|       |  /*Newly added*/
  447|  4.16k|  pstr_scratch->ptr_drc_scratch_buf = (UWORD8 *)(temp_ptr);
  448|       |
  449|  4.16k|  pstr_scratch->ptr_num_fac_bits = (WORD32 *)temp_ptr;
  450|  4.16k|  temp_ptr += MAX_TIME_CHANNELS * sizeof(pstr_scratch->ptr_num_fac_bits[0]);
  ------------------
  |  |   56|  4.16k|#define MAX_TIME_CHANNELS (2)
  ------------------
  451|  4.16k|  pstr_scratch->ptr_tns_data_present = (WORD32 *)temp_ptr;
  452|  4.16k|  temp_ptr += MAX_TIME_CHANNELS * sizeof(pstr_scratch->ptr_tns_data_present[0]);
  ------------------
  |  |   56|  4.16k|#define MAX_TIME_CHANNELS (2)
  ------------------
  453|       |
  454|  4.16k|  pstr_scratch->ptr_tmp_lp_res = (FLOAT32 *)temp_ptr;
  455|  4.16k|  temp_ptr += FAC_LENGTH * sizeof(pstr_scratch->ptr_tmp_lp_res[0]);
  ------------------
  |  |   80|  4.16k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.16k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
  456|       |
  457|  11.2k|  for (WORD32 i = 0; i < total_ch; i++) {
  ------------------
  |  Branch (457:22): [True: 7.04k, False: 4.16k]
  ------------------
  458|  7.04k|    pstr_scratch->ptr_sfb_form_fac[i] = (FLOAT32 *)temp_ptr;
  459|  7.04k|    temp_ptr += (MAX_NUM_GROUPED_SFB) * sizeof(FLOAT32);
  ------------------
  |  |   24|  7.04k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  460|  7.04k|  }
  461|  11.2k|  for (WORD32 i = 0; i < total_ch; i++) {
  ------------------
  |  Branch (461:22): [True: 7.04k, False: 4.16k]
  ------------------
  462|  7.04k|    pstr_scratch->ptr_sfb_num_relevant_lines[i] = (FLOAT32 *)temp_ptr;
  463|  7.04k|    temp_ptr += (MAX_NUM_GROUPED_SFB) * sizeof(FLOAT32);
  ------------------
  |  |   24|  7.04k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  464|  7.04k|  }
  465|  11.2k|  for (WORD32 i = 0; i < total_ch; i++) {
  ------------------
  |  Branch (465:22): [True: 7.04k, False: 4.16k]
  ------------------
  466|  7.04k|    pstr_scratch->ptr_sfb_ld_energy[i] = (FLOAT32 *)temp_ptr;
  467|  7.04k|    temp_ptr += (MAX_NUM_GROUPED_SFB) * sizeof(FLOAT32);
  ------------------
  |  |   24|  7.04k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  468|  7.04k|  }
  469|  4.16k|  pstr_scratch->ptr_num_scfs = (WORD32 *)temp_ptr;
  470|  4.16k|  temp_ptr += (MAX_TIME_CHANNELS) * sizeof(pstr_scratch->ptr_num_scfs[0]);
  ------------------
  |  |   56|  4.16k|#define MAX_TIME_CHANNELS (2)
  ------------------
  471|       |
  472|  4.16k|  pstr_scratch->ptr_max_ch_dyn_bits = (WORD32 *)temp_ptr;
  473|  4.16k|  temp_ptr += (MAX_TIME_CHANNELS) * sizeof(pstr_scratch->ptr_max_ch_dyn_bits[0]);
  ------------------
  |  |   56|  4.16k|#define MAX_TIME_CHANNELS (2)
  ------------------
  474|  4.16k|  pstr_scratch->ptr_ch_bit_dist = (FLOAT32 *)temp_ptr;
  475|  4.16k|  temp_ptr += (MAX_TIME_CHANNELS) * sizeof(pstr_scratch->ptr_ch_bit_dist[0]);
  ------------------
  |  |   56|  4.16k|#define MAX_TIME_CHANNELS (2)
  ------------------
  476|  4.16k|  pstr_scratch->ptr_fd_scratch = (UWORD8 *)temp_ptr;
  477|       |  // Size needed for above pointer is (IXHEAACE_MAX_CH_IN_BS_ELE * MAX_NUM_GROUPED_SFB * 3) *
  478|       |  // sizeof(WORD32)
  479|       |
  480|  4.16k|  return;
  481|  4.16k|}
iusace_map_sample_rate:
  508|   688k|{
  509|   688k|  WORD32 mapped_sample_rate = sample_rate;
  510|       |
  511|   688k|  if ((mapped_sample_rate >= 0) && (mapped_sample_rate < 9391))
  ------------------
  |  Branch (511:7): [True: 688k, False: 30]
  |  Branch (511:36): [True: 48.4k, False: 639k]
  ------------------
  512|  48.4k|  {
  513|  48.4k|    mapped_sample_rate = 8000;
  514|  48.4k|  }
  515|   639k|  else if ((mapped_sample_rate >= 9391) && (mapped_sample_rate < 11502))
  ------------------
  |  Branch (515:12): [True: 639k, False: 30]
  |  Branch (515:44): [True: 29.4k, False: 610k]
  ------------------
  516|  29.4k|  {
  517|  29.4k|    mapped_sample_rate = 11025;
  518|  29.4k|  }
  519|   610k|  else if ((mapped_sample_rate >= 11502) && (mapped_sample_rate < 13856))
  ------------------
  |  Branch (519:12): [True: 610k, False: 30]
  |  Branch (519:45): [True: 89.9k, False: 520k]
  ------------------
  520|  89.9k|  {
  521|  89.9k|    mapped_sample_rate = 12000;
  522|  89.9k|  }
  523|   520k|  else if ((mapped_sample_rate >= 13856) && (mapped_sample_rate < 18783))
  ------------------
  |  Branch (523:12): [True: 520k, False: 30]
  |  Branch (523:45): [True: 63.5k, False: 456k]
  ------------------
  524|  63.5k|  {
  525|  63.5k|    mapped_sample_rate = 16000;
  526|  63.5k|  }
  527|   456k|  else if ((mapped_sample_rate >= 18783) && (mapped_sample_rate < 23004))
  ------------------
  |  Branch (527:12): [True: 456k, False: 30]
  |  Branch (527:45): [True: 37.2k, False: 419k]
  ------------------
  528|  37.2k|  {
  529|  37.2k|    mapped_sample_rate = 22050;
  530|  37.2k|  }
  531|   419k|  else if ((mapped_sample_rate >= 23004) && (mapped_sample_rate < 27713))
  ------------------
  |  Branch (531:12): [True: 419k, False: 30]
  |  Branch (531:45): [True: 115k, False: 304k]
  ------------------
  532|   115k|  {
  533|   115k|    mapped_sample_rate = 24000;
  534|   115k|  }
  535|   304k|  else if ((mapped_sample_rate >= 27713) && (mapped_sample_rate < 37566))
  ------------------
  |  Branch (535:12): [True: 304k, False: 30]
  |  Branch (535:45): [True: 80.6k, False: 223k]
  ------------------
  536|  80.6k|  {
  537|  80.6k|    mapped_sample_rate = 32000;
  538|  80.6k|  }
  539|   223k|  else if ((mapped_sample_rate >= 37566) && (mapped_sample_rate < 46009))
  ------------------
  |  Branch (539:12): [True: 223k, False: 30]
  |  Branch (539:45): [True: 22.6k, False: 201k]
  ------------------
  540|  22.6k|  {
  541|  22.6k|    mapped_sample_rate = 44100;
  542|  22.6k|  }
  543|   201k|  else if ((mapped_sample_rate >= 46009) && (mapped_sample_rate < 55426))
  ------------------
  |  Branch (543:12): [True: 201k, False: 30]
  |  Branch (543:45): [True: 23.8k, False: 177k]
  ------------------
  544|  23.8k|  {
  545|  23.8k|    mapped_sample_rate = 48000;
  546|  23.8k|  }
  547|   177k|  else if ((mapped_sample_rate >= 55426) && (mapped_sample_rate < 75132))
  ------------------
  |  Branch (547:12): [True: 177k, False: 30]
  |  Branch (547:45): [True: 11.0k, False: 166k]
  ------------------
  548|  11.0k|  {
  549|  11.0k|    mapped_sample_rate = 64000;
  550|  11.0k|  }
  551|   166k|  else if ((mapped_sample_rate >= 75132) && (mapped_sample_rate < 92017))
  ------------------
  |  Branch (551:12): [True: 166k, False: 30]
  |  Branch (551:45): [True: 14.9k, False: 151k]
  ------------------
  552|  14.9k|  {
  553|  14.9k|    mapped_sample_rate = 88200;
  554|  14.9k|  }
  555|   151k|  else if (mapped_sample_rate >= 92017)
  ------------------
  |  Branch (555:12): [True: 151k, False: 30]
  ------------------
  556|   151k|  {
  557|   151k|    mapped_sample_rate = 96000;
  558|   151k|  }
  559|     30|  else
  560|     30|  {
  561|     30|    mapped_sample_rate = 48000;
  562|     30|  }
  563|   688k|  return mapped_sample_rate;
  564|   688k|}
iusace_enc_init:
  579|  4.16k|                             ia_usac_data_struct *pstr_state) {
  580|  4.16k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  4.16k|#define IA_NO_ERROR 0x00000000
  ------------------
  581|  4.16k|  WORD32 i, j, k, idx, i_ch;
  582|  4.16k|  UWORD32 elem_idx = 0;
  583|  4.16k|  ia_usac_data_struct *usac_data = (pstr_state);
  584|  4.16k|  ixheaace_audio_specific_config_struct *p_audio_specific_config = pstr_asc;
  585|  4.16k|  ia_usac_config_struct *pstr_asc_usac_config = &(p_audio_specific_config->str_usac_config);
  586|  4.16k|  WORD32 nbuff = 2048;
  587|  4.16k|  usac_data->usac_independency_flag_count = 0;
  588|  4.16k|  usac_data->usac_independency_flag_interval = 25;
  589|  4.16k|  usac_data->use_acelp_only = ptr_usac_config->use_acelp_only;
  590|  12.5k|  for (j = 0; j < MAX_TIME_CHANNELS; j++) {
  ------------------
  |  |   56|  12.5k|#define MAX_TIME_CHANNELS (2)
  ------------------
  |  Branch (590:15): [True: 8.33k, False: 4.16k]
  ------------------
  591|  8.33k|    memset(usac_data->overlap_buf[j], 0, nbuff * sizeof(FLOAT64 *));
  592|       |
  593|  8.33k|    usac_data->str_ms_info[j].ms_mask = 0;
  594|  75.0k|    for (i = 0; i < MAX_SHORT_WINDOWS; i++) {
  ------------------
  |  |   52|  75.0k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (594:17): [True: 66.6k, False: 8.33k]
  ------------------
  595|  3.46M|      for (k = 0; k < MAX_SFB_LONG; k++) {
  ------------------
  |  |   53|  3.46M|#define MAX_SFB_LONG 51
  ------------------
  |  Branch (595:19): [True: 3.40M, False: 66.6k]
  ------------------
  596|  3.40M|        usac_data->str_ms_info[j].ms_used[i][k] = 0;
  597|  3.40M|      }
  598|  66.6k|    }
  599|  8.33k|  }
  600|       |
  601|  4.16k|  iusace_scratch_mem_init(usac_data, ptr_usac_config->channels,
  602|  4.16k|                          ptr_usac_config->core_sample_rate);
  603|       |
  604|  12.5k|  for (i = 0; i < MAX_TIME_CHANNELS; i++) {
  ------------------
  |  |   56|  12.5k|#define MAX_TIME_CHANNELS (2)
  ------------------
  |  Branch (604:15): [True: 8.33k, False: 4.16k]
  ------------------
  605|  8.33k|    if (ptr_usac_config->cmplx_pred_flag) {
  ------------------
  |  Branch (605:9): [True: 5.21k, False: 3.12k]
  ------------------
  606|  5.21k|      usac_data->str_ms_info[i].ms_mask = 3;
  607|  5.21k|    }
  608|  8.33k|    usac_data->ptr_dmx_re_save[i] = &usac_data->arr_dmx_save_float[i][0];
  609|  8.33k|    usac_data->ptr_dmx_im[i] = &usac_data->arr_dmx_im[i][0];
  610|  8.33k|  }
  611|       |
  612|  4.16k|  pstr_asc_usac_config->num_elements = 0;
  613|  4.16k|  pstr_asc_usac_config->usac_cfg_ext_present = 0;
  614|  4.16k|  pstr_asc_usac_config->num_config_extensions = 0;
  615|       |
  616|  4.16k|  if (ptr_usac_config->channels > 0) {
  ------------------
  |  Branch (616:7): [True: 4.16k, False: 0]
  ------------------
  617|  4.16k|    if (ptr_usac_config->channels < 7) {
  ------------------
  |  Branch (617:9): [True: 4.16k, False: 0]
  ------------------
  618|  4.16k|      p_audio_specific_config->channel_configuration = ptr_usac_config->channels;
  619|  4.16k|    }
  620|  4.16k|  }
  621|  4.16k|  ia_usac_enc_element_config_struct *pstr_usac_elem_config =
  622|  4.16k|      &(pstr_asc_usac_config->str_usac_element_config[pstr_asc_usac_config->num_elements]);
  623|  4.16k|  pstr_asc_usac_config->usac_element_type[pstr_asc_usac_config->num_elements] = ID_USAC_EXT;
  ------------------
  |  |  139|  4.16k|#define ID_USAC_EXT 3
  ------------------
  624|  4.16k|  pstr_usac_elem_config->usac_ext_ele_type = ID_EXT_ELE_AUDIOPREROLL;
  ------------------
  |  |  146|  4.16k|#define ID_EXT_ELE_AUDIOPREROLL (3)
  ------------------
  625|  4.16k|  pstr_usac_elem_config->usac_ext_ele_dflt_len_present = 0;
  626|  4.16k|  pstr_usac_elem_config->usac_ext_ele_payload_present = 0;
  627|  4.16k|  pstr_usac_elem_config->usac_ext_ele_cfg_len = 0;
  628|  4.16k|  pstr_asc_usac_config->num_elements++;
  629|       |  // DRC Config
  630|  4.16k|  if (ptr_usac_config->use_drc_element) {
  ------------------
  |  Branch (630:7): [True: 1.44k, False: 2.72k]
  ------------------
  631|  1.44k|    ptr_usac_config->str_drc_cfg.str_uni_drc_config.str_channel_layout.base_ch_count =
  632|  1.44k|        ptr_usac_config->channels;
  633|       |
  634|  1.44k|    memset(&usac_data->str_drc_state, 0, sizeof(ia_drc_enc_state));
  635|       |
  636|  1.44k|    err_code = impd_drc_enc_init(&usac_data->str_drc_state, pstr_state->str_scratch.drc_scratch,
  637|  1.44k|                                 &ptr_usac_config->str_drc_cfg);
  638|  1.44k|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.44k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (638:9): [True: 783, False: 660]
  ------------------
  639|    783|      return err_code;
  640|    783|    }
  641|    660|    if (err_code) {
  ------------------
  |  Branch (641:9): [True: 5, False: 655]
  ------------------
  642|      5|      ptr_usac_config->use_drc_element = 0;
  643|      5|      err_code = IA_NO_ERROR;
  ------------------
  |  |   23|      5|#define IA_NO_ERROR 0x00000000
  ------------------
  644|      5|    }
  645|       |
  646|    660|    if (ptr_usac_config->use_drc_element) {
  ------------------
  |  Branch (646:9): [True: 655, False: 5]
  ------------------
  647|    655|      ia_usac_enc_element_config_struct *pstr_usac_elem_config =
  648|    655|          &(pstr_asc_usac_config->str_usac_element_config[pstr_asc_usac_config->num_elements]);
  649|    655|      pstr_asc_usac_config->usac_element_type[pstr_asc_usac_config->num_elements] = ID_USAC_EXT;
  ------------------
  |  |  139|    655|#define ID_USAC_EXT 3
  ------------------
  650|    655|      pstr_usac_elem_config->usac_ext_ele_type = ID_EXT_ELE_UNI_DRC;
  ------------------
  |  |  145|    655|#define ID_EXT_ELE_UNI_DRC 4
  ------------------
  651|    655|      pstr_usac_elem_config->usac_ext_ele_dflt_len_present = 0;
  652|    655|      pstr_usac_elem_config->usac_ext_ele_payload_present = 0;
  653|    655|      pstr_usac_elem_config->drc_config_data = usac_data->str_drc_state.bit_buf_base_cfg;
  654|    655|      pstr_usac_elem_config->usac_ext_ele_cfg_len =
  655|    655|          (usac_data->str_drc_state.drc_config_data_size_bit + 7) >> 3;
  656|    655|      pstr_asc_usac_config->num_elements++;
  657|    655|    }
  658|  2.72k|  } else {
  659|  2.72k|    err_code =
  660|  2.72k|        impd_loudness_info_init(&usac_data->str_drc_state, &ptr_usac_config->str_drc_cfg);
  661|  2.72k|    if (err_code) {
  ------------------
  |  Branch (661:9): [True: 0, False: 2.72k]
  ------------------
  662|      0|      return err_code;
  663|      0|    }
  664|  2.72k|  }
  665|       |
  666|  3.38k|  pstr_asc_usac_config->usac_config_ext_type[pstr_asc_usac_config->num_config_extensions] =
  667|  3.38k|      ID_CONFIG_EXT_STREAM_ID;
  ------------------
  |  |  151|  3.38k|#define ID_CONFIG_EXT_STREAM_ID (7)
  ------------------
  668|  3.38k|  pstr_asc_usac_config->usac_config_ext_len[pstr_asc_usac_config->num_config_extensions] =
  669|  3.38k|      CONFIG_EXT_LEN_STREAM_ID;
  ------------------
  |  |  152|  3.38k|#define CONFIG_EXT_LEN_STREAM_ID (2)
  ------------------
  670|  3.38k|  pstr_asc_usac_config->num_config_extensions++;
  671|  3.38k|  pstr_asc_usac_config->stream_identifier = ptr_usac_config->stream_id;
  672|       |
  673|  3.38k|  pstr_asc_usac_config->usac_config_ext_type[pstr_asc_usac_config->num_config_extensions] =
  674|  3.38k|      ID_CONFIG_EXT_LOUDNESS_INFO;
  ------------------
  |  |  150|  3.38k|#define ID_CONFIG_EXT_LOUDNESS_INFO (2)
  ------------------
  675|  3.38k|  pstr_asc_usac_config->usac_config_ext_len[pstr_asc_usac_config->num_config_extensions] =
  676|  3.38k|      (usac_data->str_drc_state.drc_config_ext_data_size_bit + 7) >> 3;
  677|  3.38k|  pstr_asc_usac_config->usac_config_ext_buf[pstr_asc_usac_config->num_config_extensions] =
  678|  3.38k|      usac_data->str_drc_state.bit_buf_base_cfg_ext;
  679|  3.38k|  pstr_asc_usac_config->num_config_extensions++;
  680|       |
  681|  3.38k|  if (pstr_asc_usac_config->num_config_extensions) {
  ------------------
  |  Branch (681:7): [True: 3.38k, False: 0]
  ------------------
  682|  3.38k|    pstr_asc_usac_config->usac_cfg_ext_present = 1;
  683|  3.38k|  }
  684|       |
  685|  3.38k|  p_audio_specific_config->sampling_frequency = ptr_usac_config->native_sample_rate;
  686|  3.38k|  p_audio_specific_config->num_audio_channels = ptr_usac_config->channels;
  687|  3.38k|  elem_idx = pstr_asc_usac_config->num_elements;
  688|  3.38k|  ptr_usac_config->num_ext_elements = elem_idx;
  689|  3.38k|  pstr_asc_usac_config->num_ext_elements = elem_idx;
  690|  3.38k|  i = elem_idx;
  691|       |
  692|  3.38k|  if (ptr_usac_config->channels != 0) {
  ------------------
  |  Branch (692:7): [True: 3.38k, False: 0]
  ------------------
  693|  3.38k|    ptr_usac_config->num_elements = iusace_get_num_elements(ptr_usac_config->channels);
  694|  3.38k|    pstr_asc_usac_config->num_elements += ptr_usac_config->num_elements;
  695|       |
  696|  6.76k|    for (; i < (WORD32)pstr_asc_usac_config->num_elements; i++) {
  ------------------
  |  Branch (696:12): [True: 3.38k, False: 3.38k]
  ------------------
  697|  3.38k|      pstr_asc_usac_config->usac_element_type[i] = iusace_get_element_type(
  698|  3.38k|          (i - ptr_usac_config->num_ext_elements), ptr_usac_config->channels);
  699|  3.38k|    }
  700|  3.38k|  }
  701|       |
  702|  3.38k|  WORD32 count = ptr_usac_config->num_elements;
  703|  3.38k|  ptr_usac_config->num_elements = pstr_asc_usac_config->num_elements;
  704|  3.38k|  iusace_qc_create(&usac_data->str_qc_main);
  705|       |
  706|  3.38k|  if (count > 2) {
  ------------------
  |  Branch (706:7): [True: 0, False: 3.38k]
  ------------------
  707|      0|    WORD32 num_mono = 0, num_stereo = 0, num_lfe = 0;
  708|       |
  709|      0|    for (WORD8 ch_idx = 0; ch_idx < count; ch_idx++) {
  ------------------
  |  Branch (709:28): [True: 0, False: 0]
  ------------------
  710|      0|      switch (
  711|      0|          pstr_asc_usac_config->usac_element_type[ch_idx + ptr_usac_config->num_ext_elements]) {
  712|      0|        case ID_USAC_SCE:
  ------------------
  |  |  137|      0|#define ID_USAC_SCE 0
  ------------------
  |  Branch (712:9): [True: 0, False: 0]
  ------------------
  713|      0|          num_mono++;
  714|      0|          break;
  715|      0|        case ID_USAC_CPE:
  ------------------
  |  |  138|      0|#define ID_USAC_CPE 1
  ------------------
  |  Branch (715:9): [True: 0, False: 0]
  ------------------
  716|      0|          num_stereo++;
  717|      0|          break;
  718|      0|        case ID_USAC_EXT:
  ------------------
  |  |  139|      0|#define ID_USAC_EXT 3
  ------------------
  |  Branch (718:9): [True: 0, False: 0]
  ------------------
  719|      0|          break;
  720|      0|        default:
  ------------------
  |  Branch (720:9): [True: 0, False: 0]
  ------------------
  721|      0|          return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_ELEMENT_TYPE;
  722|      0|      }
  723|      0|    }
  724|       |
  725|      0|    WORD32 bitrate_per_stereo = (WORD32)((ptr_usac_config->basic_bitrate - (num_lfe)*8000) /
  726|      0|                                         (num_mono * 0.625 + num_stereo));
  727|      0|    WORD32 bitrate_per_mono = (WORD32)(0.625 * bitrate_per_stereo);
  728|       |
  729|      0|    for (WORD8 ch_idx = 0; ch_idx < count; ch_idx++) {
  ------------------
  |  Branch (729:28): [True: 0, False: 0]
  ------------------
  730|      0|      switch (
  731|      0|          pstr_asc_usac_config->usac_element_type[ch_idx + ptr_usac_config->num_ext_elements]) {
  732|      0|        case ID_USAC_SCE:
  ------------------
  |  |  137|      0|#define ID_USAC_SCE 0
  ------------------
  |  Branch (732:9): [True: 0, False: 0]
  ------------------
  733|      0|          usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate = bitrate_per_mono;
  734|      0|          break;
  735|      0|        case ID_USAC_CPE:
  ------------------
  |  |  138|      0|#define ID_USAC_CPE 1
  ------------------
  |  Branch (735:9): [True: 0, False: 0]
  ------------------
  736|      0|          usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate = bitrate_per_stereo;
  737|      0|          break;
  738|      0|        case ID_USAC_EXT:
  ------------------
  |  |  139|      0|#define ID_USAC_EXT 3
  ------------------
  |  Branch (738:9): [True: 0, False: 0]
  ------------------
  739|      0|          break;
  740|      0|        default:
  ------------------
  |  Branch (740:9): [True: 0, False: 0]
  ------------------
  741|      0|          return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_ELEMENT_TYPE;
  742|      0|      }
  743|       |
  744|      0|      usac_data->str_qc_main.str_qc_data[ch_idx].num_ch = 1;
  745|      0|      if (ID_USAC_CPE ==
  ------------------
  |  |  138|      0|#define ID_USAC_CPE 1
  ------------------
  |  Branch (745:11): [True: 0, False: 0]
  ------------------
  746|      0|          pstr_asc_usac_config->usac_element_type[ch_idx + ptr_usac_config->num_ext_elements]) {
  747|      0|        usac_data->str_qc_main.str_qc_data[ch_idx].num_ch = 2;
  748|      0|      }
  749|       |
  750|      0|      usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate =
  751|      0|          MIN(360000 * usac_data->str_qc_main.str_qc_data[ch_idx].num_ch,
  ------------------
  |  |   86|      0|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  752|      0|              usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate);
  753|      0|      usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate =
  754|      0|          MAX(8000 * usac_data->str_qc_main.str_qc_data[ch_idx].num_ch,
  ------------------
  |  |   89|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  755|      0|              usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate);
  756|       |
  757|      0|      usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate =
  758|      0|          iusace_limitbitrate(ptr_usac_config->core_sample_rate, 512,
  759|      0|                              usac_data->str_qc_main.str_qc_data[ch_idx].num_ch,
  760|      0|                              usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate);
  761|       |
  762|      0|      usac_data->str_qc_main.str_qc_data[ch_idx].avg_bits =
  763|      0|          (usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate * ptr_usac_config->ccfl) /
  764|      0|          ptr_usac_config->core_sample_rate;
  765|      0|    }
  766|  3.38k|  } else {
  767|  6.76k|    for (WORD8 ch_idx = 0; ch_idx < count; ch_idx++) {
  ------------------
  |  Branch (767:28): [True: 3.38k, False: 3.38k]
  ------------------
  768|  3.38k|      usac_data->str_qc_main.str_qc_data[ch_idx].num_ch = (WORD8)ptr_usac_config->channels;
  769|  3.38k|      usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate = ptr_usac_config->basic_bitrate;
  770|  3.38k|      usac_data->str_qc_main.str_qc_data[ch_idx].avg_bits =
  771|  3.38k|          (usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate * ptr_usac_config->ccfl) /
  772|  3.38k|          ptr_usac_config->core_sample_rate;
  773|  3.38k|    }
  774|  3.38k|  }
  775|       |
  776|  3.38k|  for (i_ch = 0;
  777|  6.76k|       i_ch < (WORD32)(ptr_usac_config->num_elements - ptr_usac_config->num_ext_elements);
  ------------------
  |  Branch (777:8): [True: 3.38k, False: 3.38k]
  ------------------
  778|  3.38k|       i_ch++) {
  779|  3.38k|    iusace_bw_init(ptr_usac_config, p_audio_specific_config, i_ch);
  780|       |
  781|  3.38k|    usac_data->noise_filling[i_ch] = ptr_usac_config->flag_noiseFilling;
  782|  3.38k|  }
  783|       |
  784|  3.38k|  memset(&usac_data->str_psy_mod.str_psy_out_data, 0,
  785|  3.38k|         sizeof(ia_psy_mod_out_data_struct) * MAX_TIME_CHANNELS);
  ------------------
  |  |   56|  3.38k|#define MAX_TIME_CHANNELS (2)
  ------------------
  786|       |
  787|  3.38k|  i_ch = 0;
  788|  3.38k|  for (UWORD32 ch_idx = 0;
  789|  6.76k|       ch_idx < pstr_asc_usac_config->num_elements - ptr_usac_config->num_ext_elements;
  ------------------
  |  Branch (789:8): [True: 3.38k, False: 3.38k]
  ------------------
  790|  3.38k|       ch_idx++) {
  791|  3.38k|    iusace_psy_mod_init(
  792|  3.38k|        &usac_data->str_psy_mod,
  793|  3.38k|        ((LEN_SUPERFRAME_768 == ptr_usac_config->ccfl) && (0 == ptr_usac_config->sbr_enable)) ?
  ------------------
  |  |   67|  3.38k|#define LEN_SUPERFRAME_768 (768)
  ------------------
  |  Branch (793:10): [True: 795, False: 2.58k]
  |  Branch (793:59): [True: 452, False: 343]
  ------------------
  794|    452|        (iusace_map_sample_rate((ptr_usac_config->core_sample_rate * 4) / 3)) :
  795|  3.38k|        (ptr_usac_config->core_sample_rate),
  796|  3.38k|        usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate, ptr_usac_config->bw_limit[ch_idx],
  797|  3.38k|        usac_data->str_qc_main.str_qc_data[ch_idx].num_ch, i_ch, ch_idx, ptr_usac_config->ccfl);
  798|  3.38k|    i_ch += usac_data->str_qc_main.str_qc_data[ch_idx].num_ch;
  799|  3.38k|  }
  800|       |
  801|  6.76k|  for (; elem_idx < pstr_asc_usac_config->num_elements; elem_idx++) {
  ------------------
  |  Branch (801:10): [True: 3.38k, False: 3.38k]
  ------------------
  802|  3.38k|    idx = elem_idx - pstr_asc_usac_config->num_ext_elements;
  803|  3.38k|    pstr_asc_usac_config->str_usac_element_config[elem_idx].noise_filling =
  804|  3.38k|        usac_data->noise_filling[idx];
  805|  3.38k|    usac_data->channel_elem_type[idx] = pstr_asc_usac_config->usac_element_type[elem_idx];
  806|  3.38k|  }
  807|       |
  808|  3.38k|  if (ptr_usac_config->use_fill_element) {
  ------------------
  |  Branch (808:7): [True: 3.38k, False: 0]
  ------------------
  809|  3.38k|    ia_usac_enc_element_config_struct *pstr_usac_elem_config =
  810|  3.38k|        &(pstr_asc_usac_config->str_usac_element_config[pstr_asc_usac_config->num_elements]);
  811|  3.38k|    pstr_asc_usac_config->usac_element_type[pstr_asc_usac_config->num_elements] = ID_USAC_EXT;
  ------------------
  |  |  139|  3.38k|#define ID_USAC_EXT 3
  ------------------
  812|  3.38k|    pstr_usac_elem_config->usac_ext_ele_type = ID_EXT_ELE_FILL;
  ------------------
  |  |  144|  3.38k|#define ID_EXT_ELE_FILL 0
  ------------------
  813|  3.38k|    pstr_usac_elem_config->usac_ext_ele_cfg_len = 0;
  814|  3.38k|    pstr_usac_elem_config->usac_ext_ele_dflt_len_present = 0;
  815|  3.38k|    pstr_usac_elem_config->usac_ext_ele_payload_present = 0;
  816|  3.38k|    pstr_asc_usac_config->num_elements++;
  817|  3.38k|    ptr_usac_config->num_ext_elements++;
  818|  3.38k|    ptr_usac_config->num_elements++;
  819|  3.38k|  }
  820|       |
  821|  3.38k|  if (ptr_usac_config->codec_mode == USAC_SWITCHED) {
  ------------------
  |  |   35|  3.38k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (821:7): [True: 1.33k, False: 2.04k]
  ------------------
  822|  1.33k|    iusace_init_classification(&usac_data->str_sig_class_data);
  823|  1.33k|  }
  824|       |
  825|  3.38k|  i_ch = 0;
  826|  3.38k|  for (UWORD32 ch_idx = 0;
  827|  6.76k|       ch_idx < pstr_asc_usac_config->num_elements - ptr_usac_config->num_ext_elements;
  ------------------
  |  Branch (827:8): [True: 3.38k, False: 3.38k]
  ------------------
  828|  3.38k|       ch_idx++) {
  829|  9.15k|    for (idx = 0; idx < usac_data->str_qc_main.str_qc_data[ch_idx].num_ch; idx++, i_ch++) {
  ------------------
  |  Branch (829:19): [True: 5.77k, False: 3.38k]
  ------------------
  830|  5.77k|      iusace_init_block_switching(&usac_data->block_switch_ctrl[i_ch],
  831|  5.77k|                                  usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate,
  832|  5.77k|                                  usac_data->str_qc_main.str_qc_data[ch_idx].num_ch);
  833|  5.77k|    }
  834|  3.38k|  }
  835|       |
  836|  3.38k|  pstr_asc_usac_config->str_usac_element_config[elem_idx].stereo_config_index = 0;
  837|       |
  838|  9.15k|  for (i_ch = 0; i_ch < ptr_usac_config->channels; i_ch++) {
  ------------------
  |  Branch (838:18): [True: 5.77k, False: 3.38k]
  ------------------
  839|  5.77k|    ptr_usac_config->window_sequence[i_ch] = ONLY_LONG_SEQUENCE;
  ------------------
  |  |   45|  5.77k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  840|  5.77k|    ptr_usac_config->window_shape_prev[i_ch] = WIN_SEL_0;
  ------------------
  |  |   63|  5.77k|#define WIN_SEL_0 0
  ------------------
  841|  5.77k|  }
  842|       |
  843|  9.15k|  for (i_ch = 0; i_ch < ptr_usac_config->channels; i_ch++) {
  ------------------
  |  Branch (843:18): [True: 5.77k, False: 3.38k]
  ------------------
  844|  5.77k|    memset(usac_data->td_in_buf[i_ch], 0,
  845|  5.77k|           (FRAME_LEN_LONG + LEN_NEXT_HIGH_RATE) * sizeof(usac_data->td_in_buf[i_ch][0]));
  ------------------
  |  |   54|  5.77k|#define FRAME_LEN_LONG 1024
  ------------------
                         (FRAME_LEN_LONG + LEN_NEXT_HIGH_RATE) * sizeof(usac_data->td_in_buf[i_ch][0]));
  ------------------
  |  |   84|  5.77k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
  846|  5.77k|  }
  847|       |
  848|  3.38k|  usac_data->max_bitreservoir_bits = MAX_CHANNEL_BITS * ptr_usac_config->channels;
  ------------------
  |  |   41|  3.38k|#define MAX_CHANNEL_BITS 6144
  ------------------
  849|  3.38k|  usac_data->available_bitreservoir_bits = usac_data->max_bitreservoir_bits;
  850|  3.38k|  usac_data->available_bitreservoir_bits -=
  851|  3.38k|      (ptr_usac_config->bit_rate * ptr_usac_config->ccfl) / ptr_usac_config->core_sample_rate;
  852|       |
  853|  3.38k|  if (usac_data->available_bitreservoir_bits < 0) {
  ------------------
  |  Branch (853:7): [True: 0, False: 3.38k]
  ------------------
  854|      0|    return IA_EXHEAACE_INIT_FATAL_USAC_BITRES_SIZE_TOO_SMALL;
  855|      0|  }
  856|  3.38k|  i_ch = 0;
  857|  3.38k|  for (UWORD32 ch_idx = 0;
  858|  6.74k|       ch_idx < pstr_asc_usac_config->num_elements - ptr_usac_config->num_ext_elements;
  ------------------
  |  Branch (858:8): [True: 3.38k, False: 3.36k]
  ------------------
  859|  3.38k|       ch_idx++) {
  860|  9.13k|    for (idx = 0; idx < usac_data->str_qc_main.str_qc_data[ch_idx].num_ch; idx++, i_ch++) {
  ------------------
  |  Branch (860:19): [True: 5.76k, False: 3.36k]
  ------------------
  861|  5.76k|      usac_data->td_encoder[i_ch]->max_sfb_short =
  862|  5.76k|          usac_data->str_psy_mod.str_psy_short_config[ch_idx].sfb_count;
  863|  5.76k|      if (ptr_usac_config->tns_select == 0) {
  ------------------
  |  Branch (863:11): [True: 2.83k, False: 2.93k]
  ------------------
  864|  2.83k|        usac_data->pstr_tns_info[i_ch] = NULL;
  865|  2.93k|      } else {
  866|  2.93k|        usac_data->pstr_tns_info[i_ch]->sfb_offset_table_short =
  867|  2.93k|            usac_data->str_psy_mod.str_psy_short_config[ch_idx].sfb_offset;
  868|  2.93k|        usac_data->pstr_tns_info[i_ch]->sfb_offset_table_long =
  869|  2.93k|            usac_data->str_psy_mod.str_psy_long_config[ch_idx].sfb_offset;
  870|  2.93k|        usac_data->pstr_tns_info[i_ch]->max_sfb_short =
  871|  2.93k|            usac_data->str_psy_mod.str_psy_short_config[ch_idx].sfb_count;
  872|  2.93k|        usac_data->pstr_tns_info[i_ch]->max_sfb_long =
  873|  2.93k|            usac_data->str_psy_mod.str_psy_long_config[ch_idx].sfb_count;
  874|       |
  875|  2.93k|        err_code = iusace_tns_init(ptr_usac_config->core_sample_rate,
  876|  2.93k|                            usac_data->str_qc_main.str_qc_data[ch_idx].ch_bitrate /
  877|  2.93k|                                usac_data->str_qc_main.str_qc_data[ch_idx].num_ch,
  878|  2.93k|                            usac_data->pstr_tns_info[i_ch],
  879|  2.93k|                            usac_data->str_qc_main.str_qc_data[ch_idx].num_ch);
  880|  2.93k|        if (err_code) {
  ------------------
  |  Branch (880:13): [True: 22, False: 2.91k]
  ------------------
  881|     22|          return err_code;
  882|     22|        }
  883|  2.93k|      }
  884|  5.76k|    }
  885|  3.38k|  }
  886|       |
  887|  10.0k|  for (i = 0; i < MAX_TIME_CHANNELS; i++) usac_data->str_quant_info[i].reset = 1;
  ------------------
  |  |   56|  10.0k|#define MAX_TIME_CHANNELS (2)
  ------------------
  |  Branch (887:15): [True: 6.72k, False: 3.36k]
  ------------------
  888|       |
  889|  3.36k|  if (ptr_usac_config->codec_mode == USAC_SWITCHED ||
  ------------------
  |  |   35|  6.72k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (889:7): [True: 1.33k, False: 2.02k]
  ------------------
  890|  2.02k|      ptr_usac_config->codec_mode == USAC_ONLY_TD) {
  ------------------
  |  |   37|  2.02k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (890:7): [True: 82, False: 1.94k]
  ------------------
  891|  3.66k|    for (i_ch = 0; i_ch < ptr_usac_config->channels; i_ch++) {
  ------------------
  |  Branch (891:20): [True: 2.25k, False: 1.41k]
  ------------------
  892|  2.25k|      if ((ptr_usac_config->core_sample_rate) < SR_MIN ||
  ------------------
  |  |   89|  4.50k|#define SR_MIN (6000)
  ------------------
  |  Branch (892:11): [True: 1, False: 2.25k]
  ------------------
  893|  2.25k|          (ptr_usac_config->core_sample_rate) > SR_MAX) {
  ------------------
  |  |   90|  2.25k|#define SR_MAX (32000)
  ------------------
  |  Branch (893:11): [True: 3, False: 2.24k]
  ------------------
  894|      4|        return IA_EXHEAACE_CONFIG_FATAL_USAC_SAMP_FREQ;
  895|  2.24k|      } else {
  896|  2.24k|        usac_data->td_encoder[i_ch]->fscale = ptr_usac_config->core_sample_rate;
  897|       |
  898|  2.24k|        iusace_init_td_data(usac_data->td_encoder[i_ch], ptr_usac_config->ccfl);
  899|  2.24k|      }
  900|       |
  901|  2.24k|      usac_data->td_bitrate[i_ch] = ptr_usac_config->bit_rate;
  902|  2.24k|      usac_data->td_bitrate[i_ch] /= ptr_usac_config->channels;
  903|  2.24k|      iusace_config_acelp_core_mode(usac_data->td_encoder[i_ch],
  904|  2.24k|                                    ptr_usac_config->core_sample_rate,
  905|  2.24k|                                    usac_data->td_bitrate[i_ch]);
  906|       |
  907|  2.24k|      usac_data->acelp_core_mode[i_ch] = (usac_data->td_encoder[i_ch])->acelp_core_mode;
  908|  2.24k|      if (ptr_usac_config->core_sample_rate == 8000) {
  ------------------
  |  Branch (908:11): [True: 155, False: 2.09k]
  ------------------
  909|    155|        usac_data->use_acelp_only = 1;
  910|    155|      }
  911|  2.24k|    }
  912|  1.94k|  } else {
  913|  1.94k|    usac_data->acelp_core_mode[0] = 0;
  914|  1.94k|  }
  915|       |
  916|  3.35k|  for (UWORD32 ch = 0;
  917|  6.71k|       ch < pstr_asc_usac_config->num_elements - ptr_usac_config->num_ext_elements; ch++) {
  ------------------
  |  Branch (917:8): [True: 3.35k, False: 3.35k]
  ------------------
  918|  3.35k|    iusace_qc_init(&usac_data->str_qc_main.str_qc_data[ch], MAX_CHANNEL_BITS,
  ------------------
  |  |   41|  3.35k|#define MAX_CHANNEL_BITS 6144
  ------------------
  919|  3.35k|                   ptr_usac_config->core_sample_rate, ptr_usac_config->bw_limit[ch],
  920|  3.35k|                   usac_data->str_qc_main.str_qc_data[ch].num_ch, ptr_usac_config->ccfl);
  921|  3.35k|  }
  922|       |
  923|  3.35k|  return err_code;
  924|  3.36k|}
ixheaace_usac_encode:
 1046|   336k|                                  WORD32 *is_quant_spec_zero, WORD32 *is_gain_limited) {
 1047|   336k|  IA_ERRORCODE err = IA_NO_ERROR;
  ------------------
  |  |   23|   336k|#define IA_NO_ERROR 0x00000000
  ------------------
 1048|   336k|  WORD32 i_ch, i, k;
 1049|   336k|  ia_usac_data_struct *ptr_usac_data = pstr_state;
 1050|   336k|  iusace_scratch_mem *pstr_scratch = &ptr_usac_data->str_scratch;
 1051|   336k|  WORD32 bits_written = 0;
 1052|       |
 1053|   336k|  WORD32 *next_window_sequence = pstr_scratch->ptr_next_win_scratch;
 1054|   336k|  WORD32 *new_win_seq = pstr_scratch->ptr_next_win_scratch + MAX_TIME_CHANNELS;
  ------------------
  |  |   56|   336k|#define MAX_TIME_CHANNELS (2)
  ------------------
 1055|   336k|  memset(next_window_sequence, 0, MAX_TIME_CHANNELS * sizeof(next_window_sequence));
  ------------------
  |  |   56|   336k|#define MAX_TIME_CHANNELS (2)
  ------------------
 1056|   336k|  memset(new_win_seq, 0, MAX_TIME_CHANNELS * sizeof(new_win_seq));
  ------------------
  |  |   56|   336k|#define MAX_TIME_CHANNELS (2)
  ------------------
 1057|   336k|  ia_sfb_params_struct *pstr_sfb_prms = &ptr_usac_config->str_sfb_prms;
 1058|   336k|  memset(pstr_sfb_prms, 0, sizeof(ia_sfb_params_struct));
 1059|       |
 1060|   336k|  WORD32 *num_window_groups = pstr_sfb_prms->num_window_groups;
 1061|   336k|  WORD32 average_bits_total;
 1062|   336k|  WORD32 num_bits;
 1063|   336k|  WORD32 padding_bits;
 1064|   336k|  WORD32 *common_win = pstr_sfb_prms->common_win;
 1065|   336k|  WORD32 usac_independency_flg;
 1066|   336k|  WORD32 mod[NUM_FRAMES] = {0};
 1067|   336k|  WORD32 len_frame;
 1068|   336k|  WORD32 len_lpc0;
 1069|   336k|  WORD32 len_next_high_rate;
 1070|   336k|  WORD8 elem_idx, nr_core_coder_channels = 0, chn = 0;
 1071|   336k|  WORD32 ch_offset = 0;
 1072|   336k|  WORD32 elem_idx_max = ptr_usac_config->num_elements - ptr_usac_config->num_ext_elements;
 1073|   336k|  WORD32 td_buffer_offset = (TD_BUFFER_OFFSET * ptr_usac_config->ccfl) / FRAME_LEN_LONG;
  ------------------
  |  |   59|   336k|#define TD_BUFFER_OFFSET (448 + 64)
  ------------------
                WORD32 td_buffer_offset = (TD_BUFFER_OFFSET * ptr_usac_config->ccfl) / FRAME_LEN_LONG;
  ------------------
  |  |   54|   336k|#define FRAME_LEN_LONG 1024
  ------------------
 1074|   336k|  usac_independency_flg = ptr_usac_data->usac_independency_flag;
 1075|       |
 1076|   336k|  len_frame = ptr_usac_config->ccfl;
 1077|   336k|  len_lpc0 = (LEN_LPC0 * len_frame) / FRAME_LEN_LONG;
  ------------------
  |  |   85|   336k|#define LEN_LPC0 (256)
  ------------------
                len_lpc0 = (LEN_LPC0 * len_frame) / FRAME_LEN_LONG;
  ------------------
  |  |   54|   336k|#define FRAME_LEN_LONG 1024
  ------------------
 1078|   336k|  len_next_high_rate = (LEN_NEXT_HIGH_RATE * len_frame) / FRAME_LEN_LONG;
  ------------------
  |  |   84|   336k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                len_next_high_rate = (LEN_NEXT_HIGH_RATE * len_frame) / FRAME_LEN_LONG;
  ------------------
  |  |   54|   336k|#define FRAME_LEN_LONG 1024
  ------------------
 1079|       |
 1080|   336k|  average_bits_total =
 1081|   336k|      (ptr_usac_config->bit_rate * ptr_usac_config->ccfl) / ptr_usac_config->core_sample_rate;
 1082|       |
 1083|   336k|  ptr_usac_data->min_bits_needed =
 1084|   336k|      (long)(ptr_usac_data->available_bitreservoir_bits + 2 * average_bits_total -
 1085|   336k|             ptr_usac_data->max_bitreservoir_bits);
 1086|   336k|  if (ptr_usac_data->min_bits_needed < 0) {
  ------------------
  |  Branch (1086:7): [True: 62.0k, False: 274k]
  ------------------
 1087|  62.0k|    ptr_usac_data->min_bits_needed = 0;
 1088|  62.0k|  }
 1089|       |
 1090|   336k|  num_bits = 0;
 1091|   336k|  if (ptr_usac_config->preroll_flag) {
  ------------------
  |  Branch (1091:7): [True: 336k, False: 0]
  ------------------
 1092|   336k|    if (ptr_usac_config->iframes_interval != ptr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1092:9): [True: 331k, False: 4.59k]
  ------------------
 1093|   331k|      iusace_write_bits_buf(pstr_it_bit_buff, usac_independency_flg, 1);
 1094|   331k|      num_bits++;
 1095|   331k|    }
 1096|   336k|  } else {
 1097|      0|    iusace_write_bits_buf(pstr_it_bit_buff, usac_independency_flg, 1);
 1098|      0|    num_bits++;
 1099|      0|  }
 1100|   667k|  for (elem_idx = 0; elem_idx < elem_idx_max; elem_idx++) {
  ------------------
  |  Branch (1100:22): [True: 336k, False: 330k]
  ------------------
 1101|   336k|    switch (ptr_usac_data->channel_elem_type[elem_idx]) {
  ------------------
  |  Branch (1101:13): [True: 336k, False: 0]
  ------------------
 1102|   105k|      case USAC_ELEMENT_TYPE_SCE:
  ------------------
  |  Branch (1102:7): [True: 105k, False: 230k]
  ------------------
 1103|   105k|        nr_core_coder_channels = 1;
 1104|   105k|        break;
 1105|   230k|      case USAC_ELEMENT_TYPE_CPE:
  ------------------
  |  Branch (1105:7): [True: 230k, False: 105k]
  ------------------
 1106|   230k|        nr_core_coder_channels = 2;
 1107|   230k|        break;
 1108|   336k|    }
 1109|       |
 1110|   336k|    if (ptr_usac_data->core_mode[0] == CORE_MODE_FD) {
  ------------------
  |  |   33|   336k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1110:9): [True: 239k, False: 96.9k]
  ------------------
 1111|   667k|      for (chn = 0, i_ch = ch_offset; chn < nr_core_coder_channels; chn++, i_ch++) {
  ------------------
  |  Branch (1111:39): [True: 427k, False: 239k]
  ------------------
 1112|   427k|        iusace_block_switching(&ptr_usac_data->block_switch_ctrl[i_ch], ptr_input[i_ch],
 1113|   427k|                               ptr_usac_config->ccfl);
 1114|   427k|      }
 1115|   239k|    }
 1116|       |
 1117|   336k|    i_ch = ch_offset;
 1118|   336k|    if (nr_core_coder_channels == 2) {
  ------------------
  |  Branch (1118:9): [True: 230k, False: 105k]
  ------------------
 1119|   230k|      iusace_sync_block_switching(&ptr_usac_data->block_switch_ctrl[i_ch],
 1120|   230k|                                  &ptr_usac_data->block_switch_ctrl[i_ch + 1]);
 1121|   230k|    }
 1122|       |
 1123|   903k|    for (chn = 0, i_ch = ch_offset; chn < nr_core_coder_channels; chn++, i_ch++) {
  ------------------
  |  Branch (1123:37): [True: 566k, False: 336k]
  ------------------
 1124|   566k|      switch (ptr_usac_config->codec_mode) {
 1125|   168k|        case USAC_SWITCHED:
  ------------------
  |  |   35|   168k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (1125:9): [True: 168k, False: 398k]
  ------------------
 1126|   168k|          if (ptr_usac_data->str_sig_class_data.coding_mode == 2) {
  ------------------
  |  Branch (1126:15): [True: 32.2k, False: 136k]
  ------------------
 1127|  32.2k|            ptr_usac_data->core_mode_next[i_ch] = CORE_MODE_FD;
  ------------------
  |  |   33|  32.2k|#define CORE_MODE_FD (0)
  ------------------
 1128|   136k|          } else {
 1129|   136k|            ptr_usac_data->core_mode_next[i_ch] = CORE_MODE_TD;
  ------------------
  |  |   34|   136k|#define CORE_MODE_TD (1)
  ------------------
 1130|   136k|          }
 1131|   168k|          break;
 1132|   393k|        case USAC_ONLY_FD:
  ------------------
  |  |   36|   393k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (1132:9): [True: 393k, False: 173k]
  ------------------
 1133|   393k|          ptr_usac_data->core_mode_next[i_ch] = CORE_MODE_FD;
  ------------------
  |  |   33|   393k|#define CORE_MODE_FD (0)
  ------------------
 1134|   393k|          break;
 1135|  4.69k|        case USAC_ONLY_TD:
  ------------------
  |  |   37|  4.69k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (1135:9): [True: 4.69k, False: 562k]
  ------------------
 1136|  4.69k|          ptr_usac_data->core_mode_next[i_ch] = CORE_MODE_TD;
  ------------------
  |  |   34|  4.69k|#define CORE_MODE_TD (1)
  ------------------
 1137|  4.69k|          break;
 1138|      0|        default:
  ------------------
  |  Branch (1138:9): [True: 0, False: 566k]
  ------------------
 1139|      0|          return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_CODEC_MODE;
 1140|   566k|      }
 1141|   566k|      if (ptr_usac_data->core_mode[i_ch] == CORE_MODE_TD) {
  ------------------
  |  |   34|   566k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1141:11): [True: 139k, False: 427k]
  ------------------
 1142|   132M|        for (i = 0; i < ptr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (1142:21): [True: 132M, False: 139k]
  ------------------
 1143|   132M|          ptr_usac_data->ptr_2frame_time_data[i_ch][i] = ptr_usac_data->ptr_time_data[i_ch][i];
 1144|   132M|          ptr_usac_data->ptr_2frame_time_data[i_ch][ptr_usac_config->ccfl + i] =
 1145|   132M|              ptr_usac_data->ptr_look_ahead_time_data[i_ch][i];
 1146|   132M|          ptr_usac_data->ptr_time_data[i_ch][i] =
 1147|   132M|              ptr_usac_data->ptr_look_ahead_time_data[i_ch][i];
 1148|   132M|          ptr_usac_data->ptr_look_ahead_time_data[i_ch][i] = (FLOAT64)ptr_input[i_ch][i];
 1149|   132M|        }
 1150|   427k|      } else {
 1151|   410M|        for (i = 0; i < ptr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (1151:21): [True: 410M, False: 427k]
  ------------------
 1152|   410M|          ptr_usac_data->ptr_2frame_time_data[i_ch][i] = ptr_usac_data->ptr_time_data[i_ch][i];
 1153|   410M|          ptr_usac_data->ptr_2frame_time_data[i_ch][ptr_usac_config->ccfl + i] =
 1154|   410M|              ptr_usac_data->ptr_look_ahead_time_data[i_ch][i];
 1155|   410M|          ptr_usac_data->ptr_time_data[i_ch][i] = ptr_input[i_ch][i];
 1156|   410M|          ptr_usac_data->ptr_look_ahead_time_data[i_ch][i] = (FLOAT64)ptr_input[i_ch][i];
 1157|   410M|        }
 1158|   427k|      }
 1159|       |
 1160|   695M|      for (i = 0; i < len_frame + len_next_high_rate; i++) {
  ------------------
  |  Branch (1160:19): [True: 695M, False: 566k]
  ------------------
 1161|   695M|        ptr_usac_data->td_in_buf[i_ch][i] =
 1162|   695M|            (FLOAT32)(ptr_usac_data->ptr_2frame_time_data[i_ch][i + td_buffer_offset]);
 1163|   695M|      }
 1164|   831M|      for (i = 0; i < len_frame + len_next_high_rate + len_lpc0; i++) {
  ------------------
  |  Branch (1164:19): [True: 830M, False: 566k]
  ------------------
 1165|   830M|        ptr_usac_data->td_in_prev_buf[i_ch][i] =
 1166|   830M|            (FLOAT32)(ptr_usac_data->ptr_2frame_time_data[i_ch][i + td_buffer_offset - len_lpc0]);
 1167|   830M|      }
 1168|       |
 1169|   566k|      if (ptr_usac_data->core_mode[i_ch] == CORE_MODE_FD) {
  ------------------
  |  |   33|   566k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1169:11): [True: 427k, False: 139k]
  ------------------
 1170|   427k|        ptr_usac_data->window_size_samples[i_ch] = ptr_usac_config->ccfl;
 1171|   427k|        pstr_sfb_prms->window_sequence[i_ch] = ptr_usac_data->block_switch_ctrl[i_ch].window_seq;
 1172|   427k|        ptr_usac_config->window_sequence[i_ch] = pstr_sfb_prms->window_sequence[i_ch];
 1173|   427k|        new_win_seq[i_ch] = ptr_usac_data->block_switch_ctrl[i_ch].next_win_seq;
 1174|   427k|      }
 1175|       |
 1176|   566k|      err = iusace_sfb_params_init(((LEN_SUPERFRAME_768 == ptr_usac_config->ccfl) &&
  ------------------
  |  |   67|   566k|#define LEN_SUPERFRAME_768 (768)
  ------------------
  |  Branch (1176:37): [True: 148k, False: 418k]
  ------------------
 1177|   148k|                                  (0 == ptr_usac_config->sbr_enable)) ?
  ------------------
  |  Branch (1177:35): [True: 106k, False: 41.5k]
  ------------------
 1178|   106k|                                  (iusace_map_sample_rate((ptr_usac_config->core_sample_rate
 1179|   459k|                                   * 4) / 3)) :(ptr_usac_config->core_sample_rate),
 1180|   566k|                                   ptr_usac_config->ccfl, pstr_sfb_prms->sfb_width_table[i_ch],
 1181|   566k|                                   &pstr_sfb_prms->num_sfb[i_ch],
 1182|   566k|                                   pstr_sfb_prms->window_sequence[i_ch]);
 1183|       |
 1184|   566k|      if (err) {
  ------------------
  |  Branch (1184:11): [True: 0, False: 566k]
  ------------------
 1185|      0|        return err;
 1186|      0|      }
 1187|       |
 1188|   566k|      pstr_sfb_prms->sfb_offset[i_ch][0] = 0;
 1189|   566k|      k = 0;
 1190|  21.0M|      for (i = 0; i < pstr_sfb_prms->num_sfb[i_ch]; i++) {
  ------------------
  |  Branch (1190:19): [True: 20.5M, False: 566k]
  ------------------
 1191|  20.5M|        pstr_sfb_prms->sfb_offset[i_ch][i] = k;
 1192|  20.5M|        k += pstr_sfb_prms->sfb_width_table[i_ch][i];
 1193|  20.5M|      }
 1194|   566k|      pstr_sfb_prms->sfb_offset[i_ch][i] = k;
 1195|       |
 1196|   566k|      if (ptr_usac_data->core_mode[i_ch] != CORE_MODE_TD) {
  ------------------
  |  |   34|   566k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1196:11): [True: 427k, False: 139k]
  ------------------
 1197|   427k|        next_window_sequence[i_ch] = new_win_seq[i_ch];
 1198|   427k|        if (ptr_usac_data->core_mode_next[i_ch] == CORE_MODE_TD) {
  ------------------
  |  |   34|   427k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1198:13): [True: 4.21k, False: 423k]
  ------------------
 1199|  4.21k|          next_window_sequence[i_ch] = EIGHT_SHORT_SEQUENCE;
  ------------------
  |  |   40|  4.21k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
 1200|  4.21k|        }
 1201|       |
 1202|   427k|        if (ptr_usac_data->core_mode[i_ch] == CORE_MODE_TD &&
  ------------------
  |  |   34|   855k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1202:13): [True: 0, False: 427k]
  ------------------
 1203|      0|            ptr_usac_data->core_mode_next[i_ch] != CORE_MODE_TD) {
  ------------------
  |  |   34|      0|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1203:13): [True: 0, False: 0]
  ------------------
 1204|      0|          next_window_sequence[i_ch] = LONG_STOP_SEQUENCE;
  ------------------
  |  |   48|      0|#define LONG_STOP_SEQUENCE (3)
  ------------------
 1205|      0|        }
 1206|       |
 1207|   427k|        if (next_window_sequence[i_ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1207:13): [True: 117k, False: 309k]
  ------------------
 1208|   117k|          if (pstr_sfb_prms->window_sequence[i_ch] == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|   117k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (1208:15): [True: 915, False: 116k]
  ------------------
 1209|    915|            pstr_sfb_prms->window_sequence[i_ch] = LONG_START_SEQUENCE;
  ------------------
  |  |   46|    915|#define LONG_START_SEQUENCE (1)
  ------------------
 1210|    915|          }
 1211|   117k|          if (pstr_sfb_prms->window_sequence[i_ch] == LONG_STOP_SEQUENCE) {
  ------------------
  |  |   48|   117k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (1211:15): [True: 212, False: 117k]
  ------------------
 1212|    212|            pstr_sfb_prms->window_sequence[i_ch] = STOP_START_SEQUENCE;
  ------------------
  |  |   49|    212|#define STOP_START_SEQUENCE (4)
  ------------------
 1213|    212|          }
 1214|   117k|        }
 1215|       |
 1216|   427k|        if (next_window_sequence[i_ch] == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|   427k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (1216:13): [True: 245k, False: 181k]
  ------------------
 1217|   245k|          if (pstr_sfb_prms->window_sequence[i_ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   245k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1217:15): [True: 6.53k, False: 239k]
  ------------------
 1218|  6.53k|            next_window_sequence[i_ch] = LONG_STOP_SEQUENCE;
  ------------------
  |  |   48|  6.53k|#define LONG_STOP_SEQUENCE (3)
  ------------------
 1219|  6.53k|          }
 1220|   245k|        }
 1221|       |
 1222|   427k|        if (pstr_sfb_prms->window_sequence[i_ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1222:13): [True: 142k, False: 285k]
  ------------------
 1223|   142k|          num_window_groups[i_ch] = ptr_usac_data->block_switch_ctrl[i_ch].tot_grps_cnt;
 1224|  1.28M|          for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (1224:23): [True: 1.13M, False: 142k]
  ------------------
 1225|  1.13M|            pstr_sfb_prms->window_group_length[i_ch][i] =
 1226|  1.13M|                ptr_usac_data->block_switch_ctrl[i_ch].group_len[i];
 1227|  1.13M|          }
 1228|   285k|        } else {
 1229|   285k|          num_window_groups[i_ch] = 1;
 1230|   285k|          pstr_sfb_prms->window_group_length[i_ch][0] = 1;
 1231|   285k|        }
 1232|       |
 1233|   427k|        pstr_sfb_prms->window_shape[i_ch] = ptr_usac_config->window_shape_prev[i_ch];
 1234|       |
 1235|   427k|        err = iusace_fd_mdct(ptr_usac_data, ptr_usac_config, i_ch);
 1236|       |
 1237|   427k|        if (err) {
  ------------------
  |  Branch (1237:13): [True: 0, False: 427k]
  ------------------
 1238|      0|          return err;
 1239|      0|        }
 1240|       |
 1241|   427k|        if (pstr_sfb_prms->window_sequence[i_ch] != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1241:13): [True: 285k, False: 142k]
  ------------------
 1242|   285k|          iusace_psy_mod_lb(&ptr_usac_data->str_psy_mod, pstr_sfb_prms,
 1243|   285k|                            ptr_usac_data->spectral_line_vector[i_ch],
 1244|   285k|                            ptr_usac_data->pstr_tns_info, ptr_usac_config->tns_select, i_ch, chn,
 1245|   285k|                            ptr_usac_data->channel_elem_type[elem_idx],
 1246|   285k|                            pstr_scratch->p_tns_filter, elem_idx, pstr_scratch->ptr_tns_scratch,
 1247|   285k|                            ptr_usac_config->ccfl);
 1248|   285k|        } else {
 1249|   142k|          iusace_psy_mod_sb(&(ptr_usac_data->str_psy_mod), pstr_sfb_prms,
 1250|   142k|                            ptr_usac_data->spectral_line_vector[i_ch],
 1251|   142k|                            ptr_usac_data->pstr_tns_info, ptr_usac_config->tns_select, i_ch, chn,
 1252|   142k|                            ptr_usac_data->channel_elem_type[elem_idx],
 1253|   142k|                            pstr_scratch->p_tns_filter, elem_idx, pstr_scratch->ptr_tns_scratch,
 1254|   142k|                            ptr_usac_config->ccfl);
 1255|   142k|        }
 1256|       |
 1257|   427k|        pstr_sfb_prms->max_sfb[i_ch] =
 1258|   427k|            ptr_usac_data->str_psy_mod.str_psy_out_data[i_ch].max_sfb_per_grp;
 1259|   427k|      }
 1260|   566k|    }
 1261|   672k|    for (chn = 0, i_ch = ch_offset; chn < nr_core_coder_channels; chn++, i_ch++) {
  ------------------
  |  Branch (1261:37): [True: 336k, False: 336k]
  ------------------
 1262|   336k|      if (nr_core_coder_channels == 2) {
  ------------------
  |  Branch (1262:11): [True: 230k, False: 105k]
  ------------------
 1263|   230k|        if ((pstr_sfb_prms->window_shape[i_ch] == pstr_sfb_prms->window_shape[i_ch + 1]) &&
  ------------------
  |  Branch (1263:13): [True: 230k, False: 0]
  ------------------
 1264|   230k|            (pstr_sfb_prms->window_sequence[i_ch] == pstr_sfb_prms->window_sequence[i_ch + 1]) &&
  ------------------
  |  Branch (1264:13): [True: 230k, False: 0]
  ------------------
 1265|   230k|            (ptr_usac_data->core_mode[i_ch] == ptr_usac_data->core_mode[i_ch + 1])) {
  ------------------
  |  Branch (1265:13): [True: 230k, False: 0]
  ------------------
 1266|   230k|          common_win[i_ch] = common_win[i_ch + 1] = 1;
 1267|   230k|        } else {
 1268|      0|          common_win[i_ch] = 0;
 1269|      0|        }
 1270|   230k|        chn++;
 1271|   230k|      } else {
 1272|   105k|        common_win[i_ch] = 0;
 1273|   105k|      }
 1274|   336k|    }
 1275|   336k|    if (nr_core_coder_channels == 2) {
  ------------------
  |  Branch (1275:9): [True: 230k, False: 105k]
  ------------------
 1276|   230k|      if (i_ch == (ch_offset + 1)) {
  ------------------
  |  Branch (1276:11): [True: 230k, False: 0]
  ------------------
 1277|   230k|        if (pstr_sfb_prms->window_sequence[i_ch] != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   230k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1277:13): [True: 166k, False: 64.4k]
  ------------------
 1278|   166k|          iusace_calc_ms_band_energy(
 1279|   166k|              ptr_usac_data->spectral_line_vector[ch_offset],
 1280|   166k|              ptr_usac_data->spectral_line_vector[ch_offset + 1],
 1281|   166k|              ptr_usac_data->str_psy_mod.str_psy_long_config[elem_idx].sfb_offset,
 1282|   166k|              ptr_usac_data->str_psy_mod.str_psy_long_config[elem_idx].sfb_active,
 1283|   166k|              ptr_usac_data->str_psy_mod.str_psy_data[ch_offset].ptr_sfb_energy_long_ms,
 1284|   166k|              ptr_usac_data->str_psy_mod.str_psy_data[ch_offset + 1].ptr_sfb_energy_long_ms);
 1285|   166k|        } else {
 1286|  64.4k|          WORD32 frame_len_short = (ptr_usac_config->ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   46|  64.4k|#define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   54|  64.4k|#define FRAME_LEN_LONG 1024
  |  |  ------------------
  |  |               #define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   22|  64.4k|#define TRANS_FAC 8
  |  |  ------------------
  ------------------
                        WORD32 frame_len_short = (ptr_usac_config->ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   54|  64.4k|#define FRAME_LEN_LONG 1024
  ------------------
 1287|   580k|          for (WORD32 w = 0; w < MAX_SHORT_WINDOWS; w++) {
  ------------------
  |  |   52|   580k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (1287:30): [True: 515k, False: 64.4k]
  ------------------
 1288|   515k|            WORD32 w_offset = w * frame_len_short;
 1289|       |
 1290|   515k|            iusace_calc_ms_band_energy(
 1291|   515k|                ptr_usac_data->spectral_line_vector[ch_offset] + w_offset,
 1292|   515k|                ptr_usac_data->spectral_line_vector[ch_offset + 1] + w_offset,
 1293|   515k|                ptr_usac_data->str_psy_mod.str_psy_short_config[elem_idx].sfb_offset,
 1294|   515k|                ptr_usac_data->str_psy_mod.str_psy_short_config[elem_idx].sfb_active,
 1295|   515k|                ptr_usac_data->str_psy_mod.str_psy_data[ch_offset].ptr_sfb_energy_short_ms[w],
 1296|   515k|                ptr_usac_data->str_psy_mod.str_psy_data[ch_offset + 1]
 1297|   515k|                    .ptr_sfb_energy_short_ms[w]);
 1298|   515k|          }
 1299|  64.4k|        }
 1300|   230k|      }
 1301|   230k|    }
 1302|   336k|    if ((nr_core_coder_channels == 2)
  ------------------
  |  Branch (1302:9): [True: 230k, False: 105k]
  |  Branch (1302:9): [True: 239k, False: 96.9k]
  ------------------
 1303|   336k|            ? ((ptr_usac_data->core_mode[ch_offset] == CORE_MODE_FD) &&
  ------------------
  |  |   33|   230k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1303:16): [True: 188k, False: 42.3k]
  ------------------
 1304|   188k|               (ptr_usac_data->core_mode[ch_offset + 1] == CORE_MODE_FD))
  ------------------
  |  |   33|   188k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1304:16): [True: 188k, False: 0]
  ------------------
 1305|   336k|            : ((ptr_usac_data->core_mode[ch_offset] == CORE_MODE_FD))) {
  ------------------
  |  |   33|   105k|#define CORE_MODE_FD (0)
  ------------------
 1306|   239k|      iusace_grouping(pstr_sfb_prms, nr_core_coder_channels, ptr_usac_data, ptr_usac_config,
 1307|   239k|                      ch_offset, elem_idx);
 1308|       |
 1309|   239k|      if (nr_core_coder_channels == 2) {
  ------------------
  |  Branch (1309:11): [True: 188k, False: 51.3k]
  ------------------
 1310|   188k|        err = iusace_stereo_proc(pstr_sfb_prms, usac_independency_flg, ptr_usac_data,
 1311|   188k|                                 ptr_usac_config, ch_offset);
 1312|   188k|        if (err != IA_NO_ERROR) {
  ------------------
  |  |   23|   188k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (1312:13): [True: 0, False: 188k]
  ------------------
 1313|      0|          return err;
 1314|      0|        }
 1315|   188k|      }
 1316|   239k|    }
 1317|   336k|    if (ptr_usac_config->preroll_flag) {
  ------------------
  |  Branch (1317:9): [True: 336k, False: 0]
  ------------------
 1318|   336k|      if (ptr_usac_config->iframes_interval != ptr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1318:11): [True: 331k, False: 4.59k]
  ------------------
 1319|   331k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);  // extension element present
 1320|   331k|        num_bits++;
 1321|   331k|      }
 1322|   336k|    }
 1323|   336k|    if (ptr_usac_config->use_drc_element) {
  ------------------
  |  Branch (1323:9): [True: 75.0k, False: 261k]
  ------------------
 1324|  75.0k|      WORD32 num_bits_ext_elem = 0;
 1325|  75.0k|      err = iusace_enc_ext_elemts(ID_EXT_ELE_UNI_DRC, ptr_usac_config, pstr_state, pstr_asc,
  ------------------
  |  |  145|  75.0k|#define ID_EXT_ELE_UNI_DRC 4
  ------------------
 1326|  75.0k|                                  pp_drc_inp, pstr_it_bit_buff, &num_bits_ext_elem);
 1327|  75.0k|      if (err & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  75.0k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (1327:11): [True: 0, False: 75.0k]
  ------------------
 1328|      0|        return err;
 1329|      0|      }
 1330|  75.0k|      num_bits += num_bits_ext_elem;
 1331|  75.0k|      ptr_usac_data->num_drc_bits = num_bits_ext_elem;
 1332|       |#ifdef DRC_BITRATE_CONSIDERATION
 1333|       |      ptr_usac_data->drc_data_bit_cnt = num_bits_ext_elem;
 1334|       |#endif
 1335|  75.0k|    }
 1336|       |
 1337|   903k|    for (chn = 0, i_ch = ch_offset; chn < nr_core_coder_channels; chn++, i_ch++) {
  ------------------
  |  Branch (1337:37): [True: 566k, False: 336k]
  ------------------
 1338|   566k|      iusace_write_bits_buf(pstr_it_bit_buff, ptr_usac_data->core_mode[i_ch], 1);
 1339|   566k|      num_bits++;
 1340|   566k|    }
 1341|       |
 1342|   903k|    for (chn = 0, i_ch = ch_offset; chn < nr_core_coder_channels; chn++, i_ch++) {
  ------------------
  |  Branch (1342:37): [True: 566k, False: 336k]
  ------------------
 1343|   566k|      if (ptr_usac_data->core_mode[i_ch] == CORE_MODE_FD) {
  ------------------
  |  |   33|   566k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1343:11): [True: 427k, False: 139k]
  ------------------
 1344|   427k|        ptr_usac_data->window_size_samples[i_ch] = ptr_usac_config->ccfl;
 1345|   427k|        pstr_sfb_prms->window_sequence[i_ch] = ptr_usac_data->block_switch_ctrl[i_ch].window_seq;
 1346|   427k|        ptr_usac_config->window_sequence[i_ch] = pstr_sfb_prms->window_sequence[i_ch];
 1347|   427k|        new_win_seq[i_ch] = ptr_usac_data->block_switch_ctrl[i_ch].next_win_seq;
 1348|   427k|      }
 1349|       |
 1350|   566k|      if (ptr_usac_data->core_mode[i_ch] == CORE_MODE_TD) {
  ------------------
  |  |   34|   566k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1350:11): [True: 139k, False: 427k]
  ------------------
 1351|   139k|        WORD32 error;
 1352|       |
 1353|   139k|        error = iusace_lpd_frm_enc(ptr_usac_data, mod, usac_independency_flg, len_frame, i_ch,
 1354|   139k|                                   pstr_it_bit_buff);
 1355|   139k|        if (error) return error;
  ------------------
  |  Branch (1355:13): [True: 0, False: 139k]
  ------------------
 1356|       |
 1357|   139k|        num_bits = pstr_it_bit_buff->cnt_bits;
 1358|       |
 1359|   139k|        if ((ptr_usac_data->core_mode_prev[i_ch] == CORE_MODE_FD) && (mod[0] == 0)) {
  ------------------
  |  |   33|   139k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1359:13): [True: 4.19k, False: 135k]
  |  Branch (1359:70): [True: 3.43k, False: 764]
  ------------------
 1360|   224k|          for (i = 0; i < ptr_usac_data->num_td_fac_bits[i_ch]; i++) {
  ------------------
  |  Branch (1360:23): [True: 220k, False: 3.43k]
  ------------------
 1361|   220k|            iusace_write_bits_buf(pstr_it_bit_buff, ptr_usac_data->fac_out_stream[i_ch][i], 1);
 1362|   220k|            num_bits++;
 1363|   220k|          }
 1364|  3.43k|        }
 1365|   427k|      } else {
 1366|   427k|        next_window_sequence[i_ch] = new_win_seq[i_ch];
 1367|   427k|        if (ptr_usac_data->core_mode_next[i_ch] == CORE_MODE_TD) {
  ------------------
  |  |   34|   427k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1367:13): [True: 4.21k, False: 423k]
  ------------------
 1368|  4.21k|          next_window_sequence[i_ch] = EIGHT_SHORT_SEQUENCE;
  ------------------
  |  |   40|  4.21k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
 1369|  4.21k|        }
 1370|       |
 1371|   427k|        if (ptr_usac_data->core_mode[i_ch] == CORE_MODE_TD &&
  ------------------
  |  |   34|   855k|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1371:13): [True: 0, False: 427k]
  ------------------
 1372|      0|            ptr_usac_data->core_mode_next[i_ch] != CORE_MODE_TD) {
  ------------------
  |  |   34|      0|#define CORE_MODE_TD (1)
  ------------------
  |  Branch (1372:13): [True: 0, False: 0]
  ------------------
 1373|      0|          next_window_sequence[i_ch] = LONG_STOP_SEQUENCE;
  ------------------
  |  |   48|      0|#define LONG_STOP_SEQUENCE (3)
  ------------------
 1374|      0|        }
 1375|       |
 1376|   427k|        if (next_window_sequence[i_ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1376:13): [True: 117k, False: 309k]
  ------------------
 1377|   117k|          if (pstr_sfb_prms->window_sequence[i_ch] == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|   117k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (1377:15): [True: 915, False: 116k]
  ------------------
 1378|    915|            pstr_sfb_prms->window_sequence[i_ch] = LONG_START_SEQUENCE;
  ------------------
  |  |   46|    915|#define LONG_START_SEQUENCE (1)
  ------------------
 1379|    915|          }
 1380|   117k|          if (pstr_sfb_prms->window_sequence[i_ch] == LONG_STOP_SEQUENCE) {
  ------------------
  |  |   48|   117k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (1380:15): [True: 212, False: 117k]
  ------------------
 1381|    212|            pstr_sfb_prms->window_sequence[i_ch] = STOP_START_SEQUENCE;
  ------------------
  |  |   49|    212|#define STOP_START_SEQUENCE (4)
  ------------------
 1382|    212|          }
 1383|   117k|        }
 1384|   427k|        if (next_window_sequence[i_ch] == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|   427k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (1384:13): [True: 245k, False: 181k]
  ------------------
 1385|   245k|          if (pstr_sfb_prms->window_sequence[i_ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   245k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1385:15): [True: 6.53k, False: 239k]
  ------------------
 1386|  6.53k|            next_window_sequence[i_ch] = LONG_STOP_SEQUENCE;
  ------------------
  |  |   48|  6.53k|#define LONG_STOP_SEQUENCE (3)
  ------------------
 1387|  6.53k|          }
 1388|   245k|        }
 1389|   427k|        if (pstr_sfb_prms->window_sequence[i_ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (1389:13): [True: 142k, False: 285k]
  ------------------
 1390|   142k|          num_window_groups[i_ch] = ptr_usac_data->block_switch_ctrl[i_ch].tot_grps_cnt;
 1391|  1.28M|          for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (1391:23): [True: 1.13M, False: 142k]
  ------------------
 1392|  1.13M|            pstr_sfb_prms->window_group_length[i_ch][i] =
 1393|  1.13M|                ptr_usac_data->block_switch_ctrl[i_ch].group_len[i];
 1394|  1.13M|          }
 1395|   285k|        } else {
 1396|   285k|          num_window_groups[i_ch] = 1;
 1397|   285k|          pstr_sfb_prms->window_group_length[i_ch][0] = 1;
 1398|   285k|        }
 1399|   427k|        pstr_sfb_prms->window_shape[i_ch] = ptr_usac_config->window_shape_prev[i_ch];
 1400|   427k|      }
 1401|   566k|    }
 1402|       |
 1403|   336k|    if ((nr_core_coder_channels == 2)
  ------------------
  |  Branch (1403:9): [True: 230k, False: 105k]
  |  Branch (1403:9): [True: 239k, False: 96.9k]
  ------------------
 1404|   336k|            ? ((ptr_usac_data->core_mode[ch_offset] == CORE_MODE_FD) &&
  ------------------
  |  |   33|   230k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1404:16): [True: 188k, False: 42.3k]
  ------------------
 1405|   188k|               (ptr_usac_data->core_mode[ch_offset + 1] == CORE_MODE_FD))
  ------------------
  |  |   33|   188k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (1405:16): [True: 188k, False: 0]
  ------------------
 1406|   336k|            : ((ptr_usac_data->core_mode[ch_offset] == CORE_MODE_FD))) {
  ------------------
  |  |   33|   105k|#define CORE_MODE_FD (0)
  ------------------
 1407|   239k|      err = iusace_fd_encode(pstr_sfb_prms, usac_independency_flg, ptr_usac_data, ptr_usac_config,
 1408|   239k|                             pstr_it_bit_buff, nr_core_coder_channels, ch_offset, elem_idx,
 1409|   239k|                             &bits_written, is_quant_spec_zero, is_gain_limited);
 1410|       |
 1411|   239k|      if (err) {
  ------------------
  |  Branch (1411:11): [True: 5.55k, False: 233k]
  ------------------
 1412|  5.55k|        return err;
 1413|  5.55k|      }
 1414|       |
 1415|   233k|      num_bits += bits_written;
 1416|   233k|    }
 1417|       |
 1418|   886k|    for (chn = 0, i_ch = ch_offset; chn < nr_core_coder_channels; chn++, i_ch++) {
  ------------------
  |  Branch (1418:37): [True: 555k, False: 330k]
  ------------------
 1419|   555k|      ptr_usac_config->window_shape_prev[i_ch] = pstr_sfb_prms->window_shape[i_ch];
 1420|   555k|      ptr_usac_config->window_sequence_prev[i_ch] = ptr_usac_config->window_sequence[i_ch];
 1421|   555k|      ptr_usac_config->window_sequence[i_ch] = next_window_sequence[i_ch];
 1422|   555k|      ptr_usac_data->core_mode_prev[i_ch] = ptr_usac_data->core_mode[i_ch];
 1423|   555k|      ptr_usac_data->core_mode[i_ch] = ptr_usac_data->core_mode_next[i_ch];
 1424|   555k|    }
 1425|   330k|    ch_offset += nr_core_coder_channels;
 1426|   330k|  }
 1427|       |
 1428|   330k|  if (1 == ptr_usac_config->sbr_enable) {
  ------------------
  |  Branch (1428:7): [True: 201k, False: 128k]
  ------------------
 1429|       |    // Append SBR bits
 1430|   201k|    ixheaace_bit_buf_handle pstr_it_bit_buff_temp =
 1431|   201k|        &ptr_env_encoder->str_cmon_data.str_sbr_bit_buf;
 1432|   201k|    WORD32 check_num_bits = ia_enhaacplus_enc_get_bits_available(pstr_it_bit_buff_temp);
 1433|       |
 1434|   201k|    num_bits += iexheaax_append_bitstream((ixheaace_bit_buf_handle)pstr_it_bit_buff,
 1435|   201k|                                          pstr_it_bit_buff_temp, check_num_bits);
 1436|   201k|  }
 1437|       |
 1438|   330k|  if (ptr_usac_config->use_fill_element) {
  ------------------
  |  Branch (1438:7): [True: 330k, False: 0]
  ------------------
 1439|   330k|    WORD32 full_elem_num_bits = 0;
 1440|   330k|    padding_bits = ptr_usac_data->min_bits_needed - num_bits;
 1441|   330k|    full_elem_num_bits = iusace_write_fill_ele(pstr_it_bit_buff, padding_bits);
 1442|   330k|    num_bits += full_elem_num_bits;
 1443|   330k|  }
 1444|       |
 1445|   330k|  ptr_usac_data->available_bitreservoir_bits -= num_bits;
 1446|       |
 1447|   330k|  if (num_bits % 8) {
  ------------------
  |  Branch (1447:7): [True: 286k, False: 44.5k]
  ------------------
 1448|   286k|    ptr_usac_data->available_bitreservoir_bits -= 8 - (num_bits % 8);
 1449|   286k|  }
 1450|   330k|  ptr_usac_data->available_bitreservoir_bits += average_bits_total;
 1451|       |
 1452|   330k|  if (ptr_usac_data->available_bitreservoir_bits > ptr_usac_data->max_bitreservoir_bits) {
  ------------------
  |  Branch (1452:7): [True: 0, False: 330k]
  ------------------
 1453|      0|    ptr_usac_data->available_bitreservoir_bits = ptr_usac_data->max_bitreservoir_bits;
 1454|      0|  }
 1455|       |
 1456|   330k|  return err;
 1457|   336k|}
iusace_validate_baseline_profile_sample_rate:
 1459|  4.29k|IA_ERRORCODE iusace_validate_baseline_profile_sample_rate(WORD32 sample_rate) {
 1460|  4.29k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  4.29k|#define IA_NO_ERROR 0x00000000
  ------------------
 1461|       |
 1462|  4.29k|  if ((sample_rate != 7350) && (sample_rate != 8000) && (sample_rate != 9600) &&
  ------------------
  |  Branch (1462:7): [True: 4.14k, False: 150]
  |  Branch (1462:32): [True: 4.02k, False: 119]
  |  Branch (1462:57): [True: 4.00k, False: 12]
  ------------------
 1463|  4.00k|      (sample_rate != 11025) && (sample_rate != 12000) && (sample_rate != 12800) &&
  ------------------
  |  Branch (1463:7): [True: 3.91k, False: 98]
  |  Branch (1463:33): [True: 3.76k, False: 147]
  |  Branch (1463:59): [True: 3.75k, False: 7]
  ------------------
 1464|  3.75k|      (sample_rate != 16000) && (sample_rate != 19200) && (sample_rate != 22050) &&
  ------------------
  |  Branch (1464:7): [True: 3.52k, False: 229]
  |  Branch (1464:33): [True: 3.51k, False: 9]
  |  Branch (1464:59): [True: 3.42k, False: 98]
  ------------------
 1465|  3.42k|      (sample_rate != 24000) && (sample_rate != 32000) && (sample_rate != 38400) &&
  ------------------
  |  Branch (1465:7): [True: 3.16k, False: 252]
  |  Branch (1465:33): [True: 2.45k, False: 711]
  |  Branch (1465:59): [True: 2.44k, False: 13]
  ------------------
 1466|  2.44k|      (sample_rate != 44100) && (sample_rate != 48000) && (sample_rate != 64000) &&
  ------------------
  |  Branch (1466:7): [True: 1.99k, False: 450]
  |  Branch (1466:33): [True: 1.00k, False: 990]
  |  Branch (1466:59): [True: 552, False: 453]
  ------------------
 1467|    552|      (sample_rate != 88200) && (sample_rate != 96000)) {
  ------------------
  |  Branch (1467:7): [True: 214, False: 338]
  |  Branch (1467:33): [True: 85, False: 129]
  ------------------
 1468|     85|    err_code = IA_EXHEAACE_CONFIG_FATAL_USAC_BASELINE_INVALID_SAMP_FREQ;
 1469|     85|  }
 1470|       |
 1471|  4.29k|  return err_code;
 1472|  4.29k|}
iusace_enc_main.c:iusace_get_num_elements:
  104|  3.38k|static WORD32 iusace_get_num_elements(WORD32 num_channels) {
  105|  3.38k|  WORD32 num_of_elements = 0;
  106|       |
  107|  3.38k|  switch (num_channels) {
  108|    993|    case 1:
  ------------------
  |  Branch (108:5): [True: 993, False: 2.39k]
  ------------------
  109|  3.38k|    case 2:
  ------------------
  |  Branch (109:5): [True: 2.39k, False: 993]
  ------------------
  110|  3.38k|      num_of_elements = 1;
  111|  3.38k|      break;
  112|      0|    default:
  ------------------
  |  Branch (112:5): [True: 0, False: 3.38k]
  ------------------
  113|      0|      num_of_elements = num_channels;
  114|      0|      break;
  115|  3.38k|  }
  116|       |
  117|  3.38k|  return num_of_elements;
  118|  3.38k|}
iusace_enc_main.c:iusace_get_element_type:
  120|  3.38k|static UWORD32 iusace_get_element_type(WORD32 elem_idx, WORD32 num_channels) {
  121|  3.38k|  UWORD32 elem_type = (UWORD32)USAC_ELEMENT_TYPE_INVALID;
  122|  3.38k|  (VOID) elem_idx;
  123|       |
  124|  3.38k|  switch (num_channels) {
  125|    993|    case 1:
  ------------------
  |  Branch (125:5): [True: 993, False: 2.39k]
  ------------------
  126|    993|      elem_type = USAC_ELEMENT_TYPE_SCE;
  127|    993|      break;
  128|  2.39k|    case 2:
  ------------------
  |  Branch (128:5): [True: 2.39k, False: 993]
  ------------------
  129|  2.39k|      elem_type = USAC_ELEMENT_TYPE_CPE;
  130|  2.39k|      break;
  131|      0|    default:
  ------------------
  |  Branch (131:5): [True: 0, False: 3.38k]
  ------------------
  132|      0|      elem_type = USAC_ELEMENT_TYPE_SCE;
  133|      0|      break;
  134|  3.38k|  }
  135|       |
  136|  3.38k|  return elem_type;
  137|  3.38k|}
iusace_enc_main.c:iusace_bw_init:
  140|  3.38k|                           ixheaace_audio_specific_config_struct *pstr_asc, WORD32 ele_idx) {
  141|  3.38k|  ptr_usac_config->bw_limit[ele_idx] = 20000;
  142|  3.38k|  (VOID) pstr_asc;
  143|  3.38k|  ptr_usac_config->bw_limit[ele_idx] =
  144|  3.38k|      MIN(ptr_usac_config->bw_limit[ele_idx], ptr_usac_config->core_sample_rate / 2);
  ------------------
  |  |   86|  3.38k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 535, False: 2.84k]
  |  |  ------------------
  ------------------
  145|       |
  146|  3.38k|  return;
  147|  3.38k|}
iusace_enc_main.c:iusace_enc_ext_elemts:
  958|  75.0k|                                          WORD32 *num_bits_written) {
  959|  75.0k|  WORD8 idx = 0;
  960|  75.0k|  LOOPIDX idx_2 = 0;
  961|  75.0k|  WORD32 num_bits_payload = 0;
  962|  75.0k|  WORD32 num_byts_payload = 0;
  963|  75.0k|  ia_usac_config_struct *pstr_asc_usac_config = &(pstr_asc->str_usac_config);
  964|  75.0k|  VOID *pstr_scratch = &pstr_usac_data->str_scratch;
  965|  75.0k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  75.0k|#define IA_NO_ERROR 0x00000000
  ------------------
  966|       |
  967|   375k|  for (idx = 0; idx < (WORD32)pstr_asc_usac_config->num_elements; idx++) {
  ------------------
  |  Branch (967:17): [True: 300k, False: 75.0k]
  ------------------
  968|   300k|    if (ID_USAC_EXT != pstr_asc_usac_config->usac_element_type[idx]) {
  ------------------
  |  |  139|   300k|#define ID_USAC_EXT 3
  ------------------
  |  Branch (968:9): [True: 75.0k, False: 225k]
  ------------------
  969|  75.0k|      continue;
  970|  75.0k|    }
  971|       |
  972|   225k|    ia_usac_enc_element_config_struct *pstr_usac_elem_config =
  973|   225k|        &(pstr_asc_usac_config->str_usac_element_config[idx]);
  974|       |
  975|   225k|    if (usac_ext_ele_type != pstr_usac_elem_config->usac_ext_ele_type) {
  ------------------
  |  Branch (975:9): [True: 150k, False: 75.0k]
  ------------------
  976|   150k|      continue;
  977|   150k|    }
  978|       |
  979|  75.0k|    switch (pstr_usac_elem_config->usac_ext_ele_type) {
  980|  75.0k|      case ID_EXT_ELE_UNI_DRC: {
  ------------------
  |  |  145|  75.0k|#define ID_EXT_ELE_UNI_DRC 4
  ------------------
  |  Branch (980:7): [True: 75.0k, False: 0]
  ------------------
  981|  75.0k|        if (pstr_usac_data->str_drc_state.is_first_drc_process_complete == 0) {
  ------------------
  |  Branch (981:13): [True: 601, False: 74.4k]
  ------------------
  982|    601|          iusace_reset_bit_buffer(&pstr_usac_data->str_drc_state.str_bit_buf_out);
  983|    601|          err_code = impd_drc_enc(&pstr_usac_data->str_drc_state, pptr_input, 0,
  984|    601|                                  &num_bits_payload, pstr_scratch);
  985|    601|          if (err_code) {
  ------------------
  |  Branch (985:15): [True: 0, False: 601]
  ------------------
  986|      0|            return err_code;
  987|      0|          }
  988|    601|          pstr_usac_data->str_drc_state.is_first_drc_process_complete = 1;
  989|    601|          num_bits_payload = 0;
  990|    601|        }
  991|       |
  992|  75.0k|        iusace_reset_bit_buffer(&pstr_usac_data->str_drc_state.str_bit_buf_out);
  993|  75.0k|        err_code =
  994|  75.0k|            impd_drc_enc(&pstr_usac_data->str_drc_state, pptr_input,
  995|  75.0k|                         pstr_usac_config->drc_frame_size, &num_bits_payload, pstr_scratch);
  996|  75.0k|        if (err_code) {
  ------------------
  |  Branch (996:13): [True: 0, False: 75.0k]
  ------------------
  997|      0|          return err_code;
  998|      0|        }
  999|  75.0k|        num_byts_payload = (num_bits_payload + 7) >> 3;
 1000|  75.0k|      } break;
 1001|      0|      default: {
  ------------------
  |  Branch (1001:7): [True: 0, False: 75.0k]
  ------------------
 1002|      0|      } break;
 1003|  75.0k|    }
 1004|       |
 1005|  75.0k|    if (num_byts_payload <= 0) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 75.0k]
  ------------------
 1006|      0|      *num_bits_written += iusace_write_bits_buf(it_bit_buff, 0, 1);  // usacExtElementPresent
 1007|  75.0k|    } else {
 1008|  75.0k|      *num_bits_written += iusace_write_bits_buf(it_bit_buff, 1, 1);  // usacExtElementPresent
 1009|       |
 1010|  75.0k|      *num_bits_written +=
 1011|  75.0k|          iusace_write_bits_buf(it_bit_buff, 0, 1);  // usacExtElementUseDefaultLength
 1012|       |
 1013|  75.0k|      if (num_byts_payload >= 255) {
  ------------------
  |  Branch (1013:11): [True: 10, False: 75.0k]
  ------------------
 1014|     10|        *num_bits_written +=
 1015|     10|            iusace_write_bits_buf(it_bit_buff, 255, 8);  // usacExtElementPayloadLength
 1016|       |
 1017|     10|        UWORD16 value_add = (UWORD16)(num_byts_payload - 255 + 2);
 1018|     10|        *num_bits_written += iusace_write_bits_buf(it_bit_buff, value_add, 16);
 1019|  75.0k|      } else {
 1020|  75.0k|        *num_bits_written += iusace_write_bits_buf(it_bit_buff, num_byts_payload,
 1021|  75.0k|                                                   8);  // usacExtElementPayloadLength
 1022|  75.0k|      }
 1023|       |
 1024|  75.0k|      switch (pstr_usac_elem_config->usac_ext_ele_type) {
 1025|  75.0k|        case ID_EXT_ELE_UNI_DRC: {
  ------------------
  |  |  145|  75.0k|#define ID_EXT_ELE_UNI_DRC 4
  ------------------
  |  Branch (1025:9): [True: 75.0k, False: 0]
  ------------------
 1026|  1.01M|          for (idx_2 = 0; idx_2 < num_byts_payload; idx_2++) {
  ------------------
  |  Branch (1026:27): [True: 940k, False: 75.0k]
  ------------------
 1027|   940k|            *num_bits_written += iusace_write_bits_buf(
 1028|   940k|                it_bit_buff, pstr_usac_data->str_drc_state.bit_buf_base_out[idx_2], 8);
 1029|   940k|          }
 1030|  75.0k|        } break;
 1031|      0|        default: {
  ------------------
  |  Branch (1031:9): [True: 0, False: 75.0k]
  ------------------
 1032|      0|        } break;
 1033|  75.0k|      }
 1034|  75.0k|    }
 1035|  75.0k|  }
 1036|       |
 1037|  75.0k|  return err_code;
 1038|  75.0k|}
iusace_enc_main.c:iexheaax_append_bitstream:
  928|   201k|                                        WORD32 num_bits) {
  929|   201k|  WORD32 idx;
  930|   201k|  UWORD32 value;
  931|       |
  932|   201k|  if (num_bits > 16) {
  ------------------
  |  Branch (932:7): [True: 201k, False: 718]
  ------------------
  933|   201k|    WORD32 cnt, rem;
  934|   201k|    cnt = num_bits >> 4;
  935|   201k|    rem = num_bits % 16;
  936|       |
  937|  1.37M|    for (idx = 0; idx < cnt; idx++) {
  ------------------
  |  Branch (937:19): [True: 1.17M, False: 201k]
  ------------------
  938|  1.17M|      value = ixheaace_readbits(hdl_bitbuf_read, 16);
  939|  1.17M|      ixheaace_write_bits(hdl_bitbuf_write, value, 16);
  940|  1.17M|    }
  941|   201k|    if (rem) {
  ------------------
  |  Branch (941:9): [True: 186k, False: 14.9k]
  ------------------
  942|   186k|      value = ixheaace_readbits(hdl_bitbuf_read, (UWORD8)rem);
  943|   186k|      ixheaace_write_bits(hdl_bitbuf_write, value, (UWORD8)rem);
  944|   186k|    }
  945|   201k|  } else {
  946|    718|    value = ixheaace_readbits(hdl_bitbuf_read, (UWORD8)num_bits);
  947|    718|    ixheaace_write_bits(hdl_bitbuf_write, value, (UWORD8)num_bits);
  948|    718|  }
  949|       |
  950|   201k|  return num_bits;
  951|   201k|}

ixheaace_init_esbr_inter_tes:
   39|  8.64k|                                  WORD32 sbr_ratio_index) {
   40|  8.64k|  WORD32 ts;
   41|  8.64k|  WORD32 memset_sz = IXHEAACE_QMF_CHANNELS * sizeof(pstr_tes_enc->qmf_buf_real[0][0]);
  ------------------
  |  |   66|  8.64k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   42|       |
   43|  8.64k|  switch (sbr_ratio_index) {
  ------------------
  |  Branch (43:11): [True: 3.44k, False: 5.19k]
  ------------------
   44|  2.62k|    case USAC_SBR_RATIO_INDEX_2_1:
  ------------------
  |  |  186|  2.62k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  |  Branch (44:5): [True: 2.62k, False: 6.02k]
  ------------------
   45|  2.62k|      pstr_tes_enc->op_delay = 6;
   46|  2.62k|      pstr_tes_enc->codec_delay = 32;
   47|  2.62k|      pstr_tes_enc->sbr_ratio_index = sbr_ratio_index;
   48|  2.62k|      break;
   49|    826|    case USAC_SBR_RATIO_INDEX_4_1:
  ------------------
  |  |  188|    826|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (49:5): [True: 826, False: 7.81k]
  ------------------
   50|    826|      pstr_tes_enc->op_delay = 6 * 2;
   51|    826|      pstr_tes_enc->codec_delay = 64;
   52|    826|      pstr_tes_enc->sbr_ratio_index = sbr_ratio_index;
   53|    826|      break;
   54|  8.64k|  }
   55|       |
   56|  8.64k|  memset(&pstr_tes_enc->bw_array_prev[0], 0,
   57|  8.64k|         IXHEAACE_MAX_NUM_PATCHES * sizeof(pstr_tes_enc->bw_array_prev[0]));
  ------------------
  |  |   30|  8.64k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
   58|  8.64k|  memset(&pstr_tes_enc->inv_filt_mode_prev[0], 0,
   59|  8.64k|         IXHEAACE_MAX_NUM_NOISE_VALUES * sizeof(pstr_tes_enc->inv_filt_mode_prev[0]));
  ------------------
  |  |   28|  8.64k|#define IXHEAACE_MAX_NUM_NOISE_VALUES (IXHEAACE_MAX_NOISE_ENVELOPES * IXHEAACE_MAX_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   26|  8.64k|#define IXHEAACE_MAX_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define IXHEAACE_MAX_NUM_NOISE_VALUES (IXHEAACE_MAX_NOISE_ENVELOPES * IXHEAACE_MAX_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   27|  8.64k|#define IXHEAACE_MAX_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
   60|       |
   61|  8.64k|  for (ts = 0;
   62|   188k|       ts < pstr_tes_enc->op_delay + pstr_tes_enc->codec_delay + IXHEAACE_SBR_HF_ADJ_OFFSET;
  ------------------
  |  |   36|   188k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  |  Branch (62:8): [True: 179k, False: 8.64k]
  ------------------
   63|   179k|       ts++) {
   64|   179k|    memset(pstr_tes_enc->qmf_buf_real[ts], 0, memset_sz);
   65|   179k|    memset(pstr_tes_enc->qmf_buf_imag[ts], 0, memset_sz);
   66|   179k|  }
   67|  8.64k|  return;
   68|  8.64k|}
ixheaace_process_inter_tes:
  706|  91.0k|                                        WORD8 *ptr_scr) {
  707|  91.0k|  WORD32 gi = 0, env, tes_enable = 0, ts, bd, start_ts, stop_ts;
  708|  91.0k|  WORD32 is_sound_activity[IXHEAACE_MAX_ENVELOPES] = {0},
  709|  91.0k|         is_transient[IXHEAACE_MAX_ENVELOPES] = {0};
  710|  91.0k|  WORD32 tes_shape_mode = 0;
  711|  91.0k|  WORD32 num_samples, num_bands;
  712|  91.0k|  WORD32 len;
  713|  91.0k|  IA_ERRORCODE status = IA_NO_ERROR;
  ------------------
  |  |   23|  91.0k|#define IA_NO_ERROR 0x00000000
  ------------------
  714|  91.0k|  FLOAT32 energy_high[64] = {0};
  715|  91.0k|  FLOAT32 energy[64] = {0};
  716|  91.0k|  FLOAT32 gamma[IXHEAACE_ESBR_NUM_GAMMA_IDXS] = {0};
  717|  91.0k|  FLOAT32 gamma_min = MAX_FLT_VAL;
  ------------------
  |  |   30|  91.0k|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  718|  91.0k|  ixheaace_str_inter_tes_scr *tes_scr = (ixheaace_str_inter_tes_scr *)ptr_scr;
  719|  91.0k|  num_bands = pstr_tes_enc->sub_band_end - pstr_tes_enc->sub_band_start;
  720|       |
  721|   200k|  for (env = 0; env < pstr_tes_enc->num_env; env++) {
  ------------------
  |  Branch (721:17): [True: 109k, False: 91.0k]
  ------------------
  722|   109k|    tes_shape_mode = 0;
  723|   109k|    len = 2 * (pstr_tes_enc->border_vec[env + 1] - pstr_tes_enc->border_vec[env]);
  724|   109k|    is_sound_activity[env] = ixheaace_inter_tes_sound_activity(
  725|   109k|        &pstr_tes_enc
  726|   109k|             ->qmf_buf_real[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]],
  ------------------
  |  |   36|   109k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  727|   109k|        &pstr_tes_enc
  728|   109k|             ->qmf_buf_imag[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]],
  ------------------
  |  |   36|   109k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  729|   109k|        &energy_high[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]], len,
  ------------------
  |  |   36|   109k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  730|   109k|        pstr_tes_enc->sub_band_start, pstr_tes_enc->sub_band_end, &is_transient[env]);
  731|   109k|    if (1 == is_transient[env] && 1 == is_sound_activity[env]) {
  ------------------
  |  Branch (731:9): [True: 46.0k, False: 62.9k]
  |  Branch (731:35): [True: 16.3k, False: 29.7k]
  ------------------
  732|  16.3k|      tes_enable = 1;
  733|  16.3k|    }
  734|   109k|  }
  735|       |
  736|  91.0k|  if (1 == tes_enable) {
  ------------------
  |  Branch (736:7): [True: 14.1k, False: 76.8k]
  ------------------
  737|  14.1k|    status = ixheaace_generate_hf(&pstr_tes_enc->qmf_buf_real[IXHEAACE_SBR_HF_ADJ_OFFSET],
  ------------------
  |  |   36|  14.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  738|  14.1k|                                  &pstr_tes_enc->qmf_buf_imag[IXHEAACE_SBR_HF_ADJ_OFFSET], NULL,
  ------------------
  |  |   36|  14.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  739|  14.1k|                                  NULL, &tes_scr->dst_qmf_r[IXHEAACE_SBR_HF_ADJ_OFFSET],
  ------------------
  |  |   36|  14.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  740|  14.1k|                                  &tes_scr->dst_qmf_i[IXHEAACE_SBR_HF_ADJ_OFFSET], pstr_tes_enc);
  ------------------
  |  |   36|  14.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  741|       |
  742|  14.1k|    if (status) {
  ------------------
  |  Branch (742:9): [True: 0, False: 14.1k]
  ------------------
  743|      0|      return status;
  744|      0|    }
  745|  35.0k|    for (env = 0; env < pstr_tes_enc->num_env; env++) {
  ------------------
  |  Branch (745:19): [True: 20.8k, False: 14.1k]
  ------------------
  746|  20.8k|      if ((1 == is_sound_activity[env]) && (1 == is_transient[env])) {
  ------------------
  |  Branch (746:11): [True: 17.4k, False: 3.41k]
  |  Branch (746:44): [True: 16.3k, False: 1.09k]
  ------------------
  747|  16.3k|        num_samples = (pstr_tes_enc->border_vec[env + 1] - pstr_tes_enc->border_vec[env]) * 2;
  748|  16.3k|        start_ts = IXHEAACE_SBR_HF_ADJ_OFFSET + pstr_tes_enc->border_vec[env] * 2;
  ------------------
  |  |   36|  16.3k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  749|  16.3k|        stop_ts = start_ts + num_samples;
  750|       |
  751|  81.7k|        for (gi = 0; gi < IXHEAACE_ESBR_NUM_GAMMA_IDXS; gi++) {
  ------------------
  |  |   34|  81.7k|#define IXHEAACE_ESBR_NUM_GAMMA_IDXS (4)
  ------------------
  |  Branch (751:22): [True: 65.3k, False: 16.3k]
  ------------------
  752|  65.3k|          ixheaace_apply_inter_tes(
  753|  65.3k|              &tes_scr
  754|  65.3k|                   ->dst_qmf_r[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]][0],
  ------------------
  |  |   36|  65.3k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  755|  65.3k|              &tes_scr
  756|  65.3k|                   ->dst_qmf_i[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]][0],
  ------------------
  |  |   36|  65.3k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  757|  65.3k|              &pstr_tes_enc->qmf_buf_real[IXHEAACE_SBR_HF_ADJ_OFFSET +
  ------------------
  |  |   36|  65.3k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  758|  65.3k|                                          2 * pstr_tes_enc->border_vec[env]][0],
  759|  65.3k|              &pstr_tes_enc->qmf_buf_imag[IXHEAACE_SBR_HF_ADJ_OFFSET +
  ------------------
  |  |   36|  65.3k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  760|  65.3k|                                          2 * pstr_tes_enc->border_vec[env]][0],
  761|  65.3k|              num_samples, pstr_tes_enc->sub_band_start, num_bands, gi);
  762|  1.38M|          for (ts = start_ts; ts < stop_ts; ts++) {
  ------------------
  |  Branch (762:31): [True: 1.31M, False: 65.3k]
  ------------------
  763|  1.31M|            energy[ts] = 0.0f;
  764|  40.6M|            for (bd = pstr_tes_enc->sub_band_start; bd < pstr_tes_enc->sub_band_end; bd++) {
  ------------------
  |  Branch (764:53): [True: 39.2M, False: 1.31M]
  ------------------
  765|  39.2M|              energy[ts] += tes_scr->dst_qmf_r[ts][bd] * tes_scr->dst_qmf_r[ts][bd];
  766|  39.2M|              energy[ts] += tes_scr->dst_qmf_i[ts][bd] * tes_scr->dst_qmf_i[ts][bd];
  767|  39.2M|            }
  768|  1.31M|            gamma[gi] += (FLOAT32)fabs(energy[ts] - energy_high[ts]) /
  769|  1.31M|                         (FLOAT32)(pow((energy_high[ts] + 1e-6f), 0.9f));
  770|  1.31M|          }
  771|  65.3k|          if (gamma[gi] < gamma_min) {
  ------------------
  |  Branch (771:15): [True: 14.1k, False: 51.2k]
  ------------------
  772|  14.1k|            gamma_min = gamma[gi];
  773|  14.1k|            tes_shape_mode = gi;
  774|  14.1k|          }
  775|  65.3k|        }
  776|  16.3k|      }
  777|       |
  778|  20.8k|      if (tes_shape_mode > 0) {
  ------------------
  |  Branch (778:11): [True: 0, False: 20.8k]
  ------------------
  779|      0|        pstr_tes_enc->bs_tes_shape[env] = 1;
  780|      0|        pstr_tes_enc->bs_tes_shape_mode[env] = tes_shape_mode;
  781|  20.8k|      } else {
  782|  20.8k|        pstr_tes_enc->bs_tes_shape[env] = 0;
  783|  20.8k|        pstr_tes_enc->bs_tes_shape_mode[env] = 0;
  784|  20.8k|      }
  785|  20.8k|    }
  786|  76.8k|  } else {
  787|   165k|    for (env = 0; env < pstr_tes_enc->num_env; env++) {
  ------------------
  |  Branch (787:19): [True: 88.1k, False: 76.8k]
  ------------------
  788|  88.1k|      pstr_tes_enc->bs_tes_shape[env] = 0;
  789|  88.1k|      pstr_tes_enc->bs_tes_shape_mode[env] = 0;
  790|  88.1k|    }
  791|  76.8k|  }
  792|  91.0k|  return status;
  793|  91.0k|}
iusace_esbr_inter_tes.c:ixheaace_inter_tes_sound_activity:
  146|   109k|                                                WORD32 stop, WORD32 *is_transient) {
  147|   109k|  WORD32 snd_act = 0, ts, idx;
  148|   109k|  FLOAT32 ene_min = MAX_FLT_VAL, ene_max = 0.0f;
  ------------------
  |  |   30|   109k|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  149|       |
  150|  2.69M|  for (ts = 0; ts < len; ts++) {
  ------------------
  |  Branch (150:16): [True: 2.58M, False: 109k]
  ------------------
  151|  2.58M|    idx = start;
  152|  78.8M|    while (idx < stop) {
  ------------------
  |  Branch (152:12): [True: 76.2M, False: 2.58M]
  ------------------
  153|  76.2M|      energy[ts] += (qmf_real[ts][idx] * qmf_real[ts][idx]);
  154|  76.2M|      energy[ts] += (qmf_imag[ts][idx] * qmf_imag[ts][idx]);
  155|  76.2M|      idx++;
  156|  76.2M|    }
  157|       |
  158|  2.58M|    if (energy[ts] > ene_max) {
  ------------------
  |  Branch (158:9): [True: 328k, False: 2.25M]
  ------------------
  159|   328k|      ene_max = energy[ts];
  160|   328k|    }
  161|  2.58M|    if (energy[ts] < ene_min) {
  ------------------
  |  Branch (161:9): [True: 409k, False: 2.17M]
  ------------------
  162|   409k|      ene_min = energy[ts];
  163|   409k|    }
  164|  2.58M|  }
  165|       |
  166|   109k|  snd_act = (ene_max > IXHEAACE_ESBR_TES_ENERGY_MAX_THR) ? 1 : 0;
  ------------------
  |  |   23|   109k|#define IXHEAACE_ESBR_TES_ENERGY_MAX_THR (1.0e6f)
  ------------------
  |  Branch (166:13): [True: 20.4k, False: 88.5k]
  ------------------
  167|       |
  168|   109k|  if ((ene_max / (ene_min + 1.0e-6f)) > 20) {
  ------------------
  |  Branch (168:7): [True: 46.0k, False: 62.9k]
  ------------------
  169|  46.0k|    *is_transient = 1;
  170|  62.9k|  } else {
  171|  62.9k|    *is_transient = 0;
  172|  62.9k|  }
  173|   109k|  return snd_act;
  174|   109k|}
iusace_esbr_inter_tes.c:ixheaace_generate_hf:
  389|  14.1k|                                         ixheaace_str_inter_tes_params *pstr_tes_enc) {
  390|  14.1k|  WORD32 bw_index, i, k, k2, patch = 0;
  391|  14.1k|  WORD32 co_var_len;
  392|  14.1k|  WORD32 start_sample, end_sample, goal_sb;
  393|  14.1k|  WORD32 sb, source_start_band, patch_stride, num_bands_in_patch;
  394|  14.1k|  WORD32 hbe_flag = 0;
  395|  14.1k|  FLOAT32 a0r, a0i, a1r, a1i;
  396|  14.1k|  FLOAT32 ptr_bw_array[IXHEAACE_MAX_NUM_PATCHES] = {0};
  397|       |
  398|  14.1k|  ixheaace_str_auto_corr_ele str_auto_corr;
  399|       |
  400|  14.1k|  WORD16 *ptr_invf_band_tbl = &pstr_tes_enc->invf_band_tbl[1];
  401|  14.1k|  WORD32 num_if_bands = pstr_tes_enc->num_if_bands;
  402|  14.1k|  WORD32 sub_band_start = pstr_tes_enc->sub_band_start;
  403|  14.1k|  WORD16 *ptr_master_tab = pstr_tes_enc->f_master_tbl;
  404|  14.1k|  WORD32 num_mf_bands = pstr_tes_enc->num_mf_bands;
  405|  14.1k|  WORD32 *ptr_inv_filt_mode = pstr_tes_enc->inv_filt_mode;
  406|  14.1k|  WORD32 *ptr_inv_filt_mode_prev = pstr_tes_enc->inv_filt_mode_prev;
  407|  14.1k|  WORD32 sbr_patching_mode = 1;
  408|  14.1k|  WORD32 pre_proc_flag = 0;
  409|  14.1k|  WORD32 fs = pstr_tes_enc->out_fs;
  410|  14.1k|  WORD32 cov_count;
  411|  14.1k|  WORD32 lsb = ptr_master_tab[0];
  412|  14.1k|  WORD32 usb = ptr_master_tab[num_mf_bands];
  413|  14.1k|  WORD32 memset_sz = (IXHEAACE_QMF_CHANNELS - usb) * sizeof(FLOAT32);
  ------------------
  |  |   66|  14.1k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  414|  14.1k|  WORD32 xover_offset = sub_band_start - ptr_master_tab[0];
  415|  14.1k|  FLOAT32 bw = 0.0f;
  416|  14.1k|  FLOAT32 fac = 0.0f;
  417|  14.1k|  FLOAT32 gain;
  418|  14.1k|  FLOAT32 ptr_gain_vector[64];
  419|  14.1k|  WORD32 slope_length = 0;
  420|  14.1k|  WORD32 first_slot_offset = pstr_tes_enc->border_vec[0];
  421|  14.1k|  WORD32 end_slot_offs = 0;
  422|  14.1k|  FLOAT32 *ptr_bw_array_prev = pstr_tes_enc->bw_array_prev;
  423|       |
  424|  14.1k|  end_slot_offs = pstr_tes_enc->border_vec[pstr_tes_enc->num_env] - 16;
  425|       |
  426|  14.1k|  switch (pstr_tes_enc->sbr_ratio_index) {
  427|  10.1k|    case USAC_SBR_RATIO_INDEX_2_1:
  ------------------
  |  |  186|  10.1k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  |  Branch (427:5): [True: 10.1k, False: 3.98k]
  ------------------
  428|  10.1k|      start_sample = first_slot_offset * 2;
  429|  10.1k|      end_sample = 32 + end_slot_offs * 2;
  430|  10.1k|      co_var_len = 38;
  431|  10.1k|      break;
  432|    916|    case USAC_SBR_RATIO_INDEX_4_1:
  ------------------
  |  |  188|    916|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (432:5): [True: 916, False: 13.2k]
  ------------------
  433|    916|      start_sample = first_slot_offset * 4;
  434|    916|      end_sample = 64 + end_slot_offs * 4;
  435|    916|      co_var_len = 76;
  436|    916|      break;
  437|  3.06k|    default:
  ------------------
  |  Branch (437:5): [True: 3.06k, False: 11.0k]
  ------------------
  438|  3.06k|      start_sample = first_slot_offset * 2;
  439|  3.06k|      end_sample = 32 + end_slot_offs * 2;
  440|  3.06k|      co_var_len = 38;
  441|  3.06k|      break;
  442|  14.1k|  }
  443|       |
  444|  14.1k|  if (pre_proc_flag) {
  ------------------
  |  Branch (444:7): [True: 0, False: 14.1k]
  ------------------
  445|      0|    ixheaace_pre_processing(ptr_src_buf_real, ptr_src_buf_imag, ptr_gain_vector,
  446|      0|                            ptr_master_tab[0], start_sample, end_sample);
  447|      0|  }
  448|       |
  449|  14.1k|  ixheaace_esbr_chirp_fac_calc(ptr_inv_filt_mode, ptr_inv_filt_mode_prev, num_if_bands,
  450|  14.1k|                               ptr_bw_array, ptr_bw_array_prev);
  451|       |
  452|   431k|  for (i = start_sample; i < end_sample; i++) {
  ------------------
  |  Branch (452:26): [True: 416k, False: 14.1k]
  ------------------
  453|   416k|    memset(ptr_dst_buf_real[i] + usb, 0, memset_sz);
  454|   416k|    memset(ptr_dst_buf_imag[i] + usb, 0, memset_sz);
  455|   416k|  }
  456|       |
  457|  14.1k|  if (sbr_patching_mode || !hbe_flag) {
  ------------------
  |  Branch (457:7): [True: 14.1k, False: 0]
  |  Branch (457:28): [True: 0, False: 0]
  ------------------
  458|  14.1k|    FLOAT32 alpha_real[IXHEAACE_QMF_CHANNELS][2] = {{0}},
  459|  14.1k|            alpha_imag[IXHEAACE_QMF_CHANNELS][2] = {{0}};
  460|  14.1k|    cov_count = ptr_master_tab[0];
  461|       |
  462|   339k|    for (k = 1; k < cov_count; k++) {
  ------------------
  |  Branch (462:17): [True: 324k, False: 14.1k]
  ------------------
  463|   324k|      ixheaace_esbr_calc_co_variance(&str_auto_corr, &ptr_src_buf_real[0], &ptr_src_buf_imag[0],
  464|   324k|                                     k, co_var_len);
  465|   324k|      if (str_auto_corr.det == 0.0f) {
  ------------------
  |  Branch (465:11): [True: 7.63k, False: 317k]
  ------------------
  466|  7.63k|        alpha_real[k][1] = alpha_imag[k][1] = 0;
  467|   317k|      } else {
  468|   317k|        fac = 1.0f / str_auto_corr.det;
  469|   317k|        alpha_real[k][1] = (str_auto_corr.phi_0_1_real * str_auto_corr.phi_1_2_real -
  470|   317k|                            str_auto_corr.phi_0_1_imag * str_auto_corr.phi_1_2_imag -
  471|   317k|                            str_auto_corr.phi_0_2_real * str_auto_corr.phi_1_1) *
  472|   317k|                           fac;
  473|   317k|        alpha_imag[k][1] = (str_auto_corr.phi_0_1_imag * str_auto_corr.phi_1_2_real +
  474|   317k|                            str_auto_corr.phi_0_1_real * str_auto_corr.phi_1_2_imag -
  475|   317k|                            str_auto_corr.phi_0_2_imag * str_auto_corr.phi_1_1) *
  476|   317k|                           fac;
  477|   317k|      }
  478|       |
  479|   324k|      if (str_auto_corr.phi_1_1 == 0) {
  ------------------
  |  Branch (479:11): [True: 7.62k, False: 317k]
  ------------------
  480|  7.62k|        alpha_real[k][0] = alpha_imag[k][0] = 0;
  481|   317k|      } else {
  482|   317k|        fac = 1.0f / str_auto_corr.phi_1_1;
  483|   317k|        alpha_real[k][0] =
  484|   317k|            -(str_auto_corr.phi_0_1_real + alpha_real[k][1] * str_auto_corr.phi_1_2_real +
  485|   317k|              alpha_imag[k][1] * str_auto_corr.phi_1_2_imag) *
  486|   317k|            fac;
  487|   317k|        alpha_imag[k][0] =
  488|   317k|            -(str_auto_corr.phi_0_1_imag + alpha_imag[k][1] * str_auto_corr.phi_1_2_real -
  489|   317k|              alpha_real[k][1] * str_auto_corr.phi_1_2_imag) *
  490|   317k|            fac;
  491|   317k|      }
  492|       |
  493|   324k|      if ((alpha_real[k][0] * alpha_real[k][0] + alpha_imag[k][0] * alpha_imag[k][0] >= 16.0f) ||
  ------------------
  |  Branch (493:11): [True: 282, False: 324k]
  ------------------
  494|   324k|          (alpha_real[k][1] * alpha_real[k][1] + alpha_imag[k][1] * alpha_imag[k][1] >= 16.0f)) {
  ------------------
  |  Branch (494:11): [True: 742, False: 323k]
  ------------------
  495|  1.02k|        alpha_real[k][0] = 0.0f;
  496|  1.02k|        alpha_imag[k][0] = 0.0f;
  497|  1.02k|        alpha_real[k][1] = 0.0f;
  498|  1.02k|        alpha_imag[k][1] = 0.0f;
  499|  1.02k|      }
  500|   324k|    }
  501|       |
  502|  14.1k|    goal_sb = (WORD32)(2.048e6f / fs + 0.5f);
  503|  14.1k|    {
  504|  14.1k|      WORD32 index;
  505|  14.1k|      if (goal_sb < ptr_master_tab[num_mf_bands]) {
  ------------------
  |  Branch (505:11): [True: 6.15k, False: 7.99k]
  ------------------
  506|  12.3k|        for (index = 0; (ptr_master_tab[index] < goal_sb); index++)
  ------------------
  |  Branch (506:25): [True: 6.15k, False: 6.15k]
  ------------------
  507|  6.15k|          goal_sb = ptr_master_tab[index];
  508|  7.99k|      } else {
  509|  7.99k|        goal_sb = ptr_master_tab[num_mf_bands];
  510|  7.99k|      }
  511|  14.1k|    }
  512|       |
  513|  14.1k|    source_start_band = xover_offset + 1;
  514|       |
  515|  14.1k|    sb = lsb + xover_offset;
  516|       |
  517|  14.1k|    patch = 0;
  518|  49.4k|    while (sb < usb) {
  ------------------
  |  Branch (518:12): [True: 35.2k, False: 14.1k]
  ------------------
  519|  35.2k|      if (IXHEAACE_MAX_NUM_PATCHES <= patch) {
  ------------------
  |  |   30|  35.2k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (519:11): [True: 0, False: 35.2k]
  ------------------
  520|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_NUM_PATCH;
  521|      0|      }
  522|       |
  523|  35.2k|      num_bands_in_patch = goal_sb - sb;
  524|       |
  525|  35.2k|      if (num_bands_in_patch + source_start_band >= lsb) {
  ------------------
  |  Branch (525:11): [True: 14.9k, False: 20.3k]
  ------------------
  526|  14.9k|        patch_stride = sb - source_start_band;
  527|  14.9k|        patch_stride = patch_stride & ~1;
  528|  14.9k|        num_bands_in_patch = lsb - (sb - patch_stride);
  529|  14.9k|        num_bands_in_patch = ixheaace_find_closest_entry(sb + num_bands_in_patch, ptr_master_tab,
  530|  14.9k|                                                         (WORD16)(num_mf_bands), 0) -
  531|  14.9k|                             (WORD32)(sb);
  532|  14.9k|      }
  533|       |
  534|  35.2k|      patch_stride = num_bands_in_patch + sb - lsb;
  535|  35.2k|      patch_stride = (patch_stride + 1) & ~1;
  536|       |
  537|  35.2k|      source_start_band = 1;
  538|       |
  539|  35.2k|      if (goal_sb - (sb + num_bands_in_patch) < 3) {
  ------------------
  |  Branch (539:11): [True: 20.3k, False: 14.9k]
  ------------------
  540|  20.3k|        goal_sb = usb;
  541|  20.3k|      }
  542|       |
  543|  35.2k|      if ((num_bands_in_patch < 3) && (patch > 0) && (sb + num_bands_in_patch == usb)) {
  ------------------
  |  Branch (543:11): [True: 6.15k, False: 29.1k]
  |  Branch (543:39): [True: 0, False: 6.15k]
  |  Branch (543:54): [True: 0, False: 0]
  ------------------
  544|      0|        for (i = start_sample + slope_length; i < end_sample + slope_length; i++) {
  ------------------
  |  Branch (544:47): [True: 0, False: 0]
  ------------------
  545|      0|          for (k2 = sb; k2 < sb + num_bands_in_patch; k2++) {
  ------------------
  |  Branch (545:25): [True: 0, False: 0]
  ------------------
  546|      0|            if (k2 < 0 || k2 >= 64) {
  ------------------
  |  Branch (546:17): [True: 0, False: 0]
  |  Branch (546:27): [True: 0, False: 0]
  ------------------
  547|      0|              break;
  548|      0|            }
  549|      0|            ptr_dst_buf_real[i][k2] = 0.0f;
  550|      0|            ptr_dst_buf_imag[i][k2] = 0.0f;
  551|      0|          }
  552|      0|        }
  553|      0|        break;
  554|      0|      }
  555|       |
  556|  35.2k|      if (num_bands_in_patch <= 0) {
  ------------------
  |  Branch (556:11): [True: 6.15k, False: 29.1k]
  ------------------
  557|  6.15k|        continue;
  558|  6.15k|      }
  559|       |
  560|   445k|      for (k2 = sb; k2 < sb + num_bands_in_patch; k2++) {
  ------------------
  |  Branch (560:21): [True: 416k, False: 29.1k]
  ------------------
  561|   416k|        k = k2 - patch_stride;
  562|   416k|        bw_index = 0;
  563|   925k|        while (k2 >= ptr_invf_band_tbl[bw_index]) {
  ------------------
  |  Branch (563:16): [True: 508k, False: 416k]
  ------------------
  564|   508k|          bw_index++;
  565|   508k|          if (bw_index >= IXHEAACE_MAX_NOISE_COEFFS) {
  ------------------
  |  |   27|   508k|#define IXHEAACE_MAX_NOISE_COEFFS (5)
  ------------------
  |  Branch (565:15): [True: 0, False: 508k]
  ------------------
  566|      0|            return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_BANDWIDTH_INDEX;
  567|      0|          }
  568|   508k|        }
  569|       |
  570|   416k|        if (bw_index >= IXHEAACE_MAX_NUM_PATCHES) {
  ------------------
  |  |   30|   416k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (570:13): [True: 0, False: 416k]
  ------------------
  571|      0|          return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_BANDWIDTH_INDEX;
  572|      0|        }
  573|   416k|        bw = ptr_bw_array[bw_index];
  574|       |
  575|   416k|        a0r = bw * alpha_real[k][0];
  576|   416k|        a0i = bw * alpha_imag[k][0];
  577|   416k|        bw *= bw;
  578|   416k|        a1r = bw * alpha_real[k][1];
  579|   416k|        a1i = bw * alpha_imag[k][1];
  580|       |
  581|   416k|        if (pre_proc_flag) {
  ------------------
  |  Branch (581:13): [True: 0, False: 416k]
  ------------------
  582|      0|          gain = ptr_gain_vector[k];
  583|   416k|        } else {
  584|   416k|          gain = 1.0f;
  585|   416k|        }
  586|       |
  587|  12.9M|        for (i = start_sample + slope_length; i < end_sample + slope_length; i++) {
  ------------------
  |  Branch (587:47): [True: 12.5M, False: 416k]
  ------------------
  588|  12.5M|          ptr_dst_buf_real[i][k2] = ptr_src_buf_real[i][k] * gain;
  589|       |
  590|  12.5M|          ptr_dst_buf_imag[i][k2] = ptr_src_buf_imag[i][k] * gain;
  591|       |
  592|  12.5M|          if (bw > 0.0f) {
  ------------------
  |  Branch (592:15): [True: 0, False: 12.5M]
  ------------------
  593|      0|            ptr_dst_buf_real[i][k2] +=
  594|      0|                (a0r * ptr_src_buf_real[i - 1][k] - a0i * ptr_src_buf_imag[i - 1][k] +
  595|      0|                 a1r * ptr_src_buf_real[i - 2][k] - a1i * ptr_src_buf_imag[i - 2][k]) *
  596|      0|                gain;
  597|      0|            ptr_dst_buf_imag[i][k2] +=
  598|      0|                (a0i * ptr_src_buf_real[i - 1][k] + a0r * ptr_src_buf_imag[i - 1][k] +
  599|      0|                 a1i * ptr_src_buf_real[i - 2][k] + a1r * ptr_src_buf_imag[i - 2][k]) *
  600|      0|                gain;
  601|      0|          }
  602|  12.5M|        }
  603|   416k|      }
  604|  29.1k|      sb += num_bands_in_patch;
  605|  29.1k|      patch++;
  606|  29.1k|    }
  607|  14.1k|  }
  608|       |
  609|  14.1k|  if (hbe_flag && !sbr_patching_mode) {
  ------------------
  |  Branch (609:7): [True: 0, False: 14.1k]
  |  Branch (609:19): [True: 0, False: 0]
  ------------------
  610|      0|    FLOAT32 alpha_real[2], alpha_imag[2];
  611|       |
  612|      0|    bw_index = 0, patch = 1;
  613|      0|    if (NULL == ptr_ph_vocod_buf_real || NULL == ptr_ph_vocod_buf_imag) {
  ------------------
  |  Branch (613:9): [True: 0, False: 0]
  |  Branch (613:42): [True: 0, False: 0]
  ------------------
  614|      0|      return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_VOCOD_BUF;
  615|      0|    }
  616|       |
  617|      0|    for (k2 = sub_band_start; k2 < ptr_master_tab[num_mf_bands]; k2++) {
  ------------------
  |  Branch (617:31): [True: 0, False: 0]
  ------------------
  618|      0|      ixheaace_esbr_calc_co_variance(&str_auto_corr, &ptr_ph_vocod_buf_real[0],
  619|      0|                                     &ptr_ph_vocod_buf_imag[0], k2, co_var_len);
  620|       |
  621|      0|      if (str_auto_corr.det == 0.0f) {
  ------------------
  |  Branch (621:11): [True: 0, False: 0]
  ------------------
  622|      0|        alpha_real[1] = alpha_imag[1] = 0;
  623|      0|      } else {
  624|      0|        fac = 1.0f / str_auto_corr.det;
  625|      0|        alpha_real[1] = (str_auto_corr.phi_0_1_real * str_auto_corr.phi_1_2_real -
  626|      0|                         str_auto_corr.phi_0_1_imag * str_auto_corr.phi_1_2_imag -
  627|      0|                         str_auto_corr.phi_0_2_real * str_auto_corr.phi_1_1) *
  628|      0|                        fac;
  629|      0|        alpha_imag[1] = (str_auto_corr.phi_0_1_imag * str_auto_corr.phi_1_2_real +
  630|      0|                         str_auto_corr.phi_0_1_real * str_auto_corr.phi_1_2_imag -
  631|      0|                         str_auto_corr.phi_0_2_imag * str_auto_corr.phi_1_1) *
  632|      0|                        fac;
  633|      0|      }
  634|       |
  635|      0|      if (str_auto_corr.phi_1_1 == 0) {
  ------------------
  |  Branch (635:11): [True: 0, False: 0]
  ------------------
  636|      0|        alpha_real[0] = alpha_imag[0] = 0;
  637|      0|      } else {
  638|      0|        fac = 1.0f / str_auto_corr.phi_1_1;
  639|      0|        alpha_real[0] =
  640|      0|            -(str_auto_corr.phi_0_1_real + alpha_real[1] * str_auto_corr.phi_1_2_real +
  641|      0|              alpha_imag[1] * str_auto_corr.phi_1_2_imag) *
  642|      0|            fac;
  643|      0|        alpha_imag[0] =
  644|      0|            -(str_auto_corr.phi_0_1_imag + alpha_imag[1] * str_auto_corr.phi_1_2_real -
  645|      0|              alpha_real[1] * str_auto_corr.phi_1_2_imag) *
  646|      0|            fac;
  647|      0|      }
  648|       |
  649|      0|      if (alpha_real[0] * alpha_real[0] + alpha_imag[0] * alpha_imag[0] >= 16.0f ||
  ------------------
  |  Branch (649:11): [True: 0, False: 0]
  ------------------
  650|      0|          alpha_real[1] * alpha_real[1] + alpha_imag[1] * alpha_imag[1] >= 16.0f) {
  ------------------
  |  Branch (650:11): [True: 0, False: 0]
  ------------------
  651|      0|        alpha_real[0] = 0.0f;
  652|      0|        alpha_imag[0] = 0.0f;
  653|      0|        alpha_real[1] = 0.0f;
  654|      0|        alpha_imag[1] = 0.0f;
  655|      0|      }
  656|       |
  657|      0|      while (k2 >= ptr_invf_band_tbl[bw_index]) {
  ------------------
  |  Branch (657:14): [True: 0, False: 0]
  ------------------
  658|      0|        bw_index++;
  659|      0|        if (bw_index >= IXHEAACE_MAX_NOISE_COEFFS) {
  ------------------
  |  |   27|      0|#define IXHEAACE_MAX_NOISE_COEFFS (5)
  ------------------
  |  Branch (659:13): [True: 0, False: 0]
  ------------------
  660|      0|          return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_BANDWIDTH_INDEX;
  661|      0|        }
  662|      0|      }
  663|       |
  664|      0|      if (bw_index >= IXHEAACE_MAX_NUM_PATCHES) {
  ------------------
  |  |   30|      0|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (664:11): [True: 0, False: 0]
  ------------------
  665|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_BANDWIDTH_INDEX;
  666|      0|      }
  667|      0|      bw = ptr_bw_array[bw_index];
  668|       |
  669|      0|      a0r = bw * alpha_real[0];
  670|      0|      a0i = bw * alpha_imag[0];
  671|      0|      bw *= bw;
  672|      0|      a1r = bw * alpha_real[1];
  673|      0|      a1i = bw * alpha_imag[1];
  674|       |
  675|      0|      if (bw > 0.0f) {
  ------------------
  |  Branch (675:11): [True: 0, False: 0]
  ------------------
  676|      0|        for (i = start_sample; i < end_sample; i++) {
  ------------------
  |  Branch (676:32): [True: 0, False: 0]
  ------------------
  677|      0|          FLOAT32 real1, imag1, real2, imag2;
  678|       |
  679|      0|          real1 = ptr_ph_vocod_buf_real[i - 1][k2];
  680|      0|          imag1 = ptr_ph_vocod_buf_imag[i - 1][k2];
  681|      0|          real2 = ptr_ph_vocod_buf_real[i - 2][k2];
  682|      0|          imag2 = ptr_ph_vocod_buf_imag[i - 2][k2];
  683|      0|          ptr_dst_buf_real[i][k2] = ptr_ph_vocod_buf_real[i][k2] +
  684|      0|                                    ((a0r * real1 - a0i * imag1) + (a1r * real2 - a1i * imag2));
  685|      0|          ptr_dst_buf_imag[i][k2] = ptr_ph_vocod_buf_imag[i][k2] +
  686|      0|                                    ((a0i * real1 + a0r * imag1) + (a1i * real2 + a1r * imag2));
  687|      0|        }
  688|      0|      } else {
  689|      0|        for (i = start_sample; i < end_sample; i++) {
  ------------------
  |  Branch (689:32): [True: 0, False: 0]
  ------------------
  690|      0|          ptr_dst_buf_real[i][k2] = ptr_ph_vocod_buf_real[i][k2];
  691|      0|          ptr_dst_buf_imag[i][k2] = ptr_ph_vocod_buf_imag[i][k2];
  692|      0|        }
  693|      0|      }
  694|      0|    }
  695|      0|  }
  696|  14.1k|  if (patch >= (IXHEAACE_MAX_NUM_PATCHES + 1)) {
  ------------------
  |  |   30|  14.1k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (696:7): [True: 0, False: 14.1k]
  ------------------
  697|      0|    return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_NUM_PATCH;
  698|      0|  }
  699|  53.7k|  for (i = 0; i < num_if_bands; i++) {
  ------------------
  |  Branch (699:15): [True: 39.5k, False: 14.1k]
  ------------------
  700|  39.5k|    ptr_bw_array_prev[i] = ptr_bw_array[i];
  701|  39.5k|  }
  702|  14.1k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  14.1k|#define IA_NO_ERROR 0x00000000
  ------------------
  703|  14.1k|}
iusace_esbr_inter_tes.c:ixheaace_esbr_chirp_fac_calc:
  324|  14.1k|                                         FLOAT32 *ptr_bw_array, FLOAT32 *ptr_bw_array_prev) {
  325|  14.1k|  WORD32 i;
  326|       |
  327|  53.7k|  for (i = 0; i < num_if_bands; i++) {
  ------------------
  |  Branch (327:15): [True: 39.5k, False: 14.1k]
  ------------------
  328|  39.5k|    ptr_bw_array[i] = ixheaace_new_bw_tab[ptr_inv_filt_mode_prev[i]][ptr_inv_filt_mode[i]];
  329|       |
  330|  39.5k|    if (ptr_bw_array[i] < ptr_bw_array_prev[i]) {
  ------------------
  |  Branch (330:9): [True: 0, False: 39.5k]
  ------------------
  331|      0|      ptr_bw_array[i] = 0.75000f * ptr_bw_array[i] + 0.25000f * ptr_bw_array_prev[i];
  332|  39.5k|    } else {
  333|  39.5k|      ptr_bw_array[i] = 0.90625f * ptr_bw_array[i] + 0.09375f * ptr_bw_array_prev[i];
  334|  39.5k|    }
  335|       |
  336|  39.5k|    if (ptr_bw_array[i] < 0.015625) {
  ------------------
  |  Branch (336:9): [True: 39.5k, False: 0]
  ------------------
  337|  39.5k|      ptr_bw_array[i] = 0;
  338|  39.5k|    }
  339|  39.5k|  }
  340|  14.1k|}
iusace_esbr_inter_tes.c:ixheaace_esbr_calc_co_variance:
  202|   324k|                                           WORD32 bd, WORD32 len) {
  203|   324k|  WORD32 j = 0;
  204|       |
  205|   324k|  FLOAT32 xr_j;
  206|   324k|  FLOAT32 xr_j_minus_1 = ptr_vec_x_real[j - 1][bd];
  207|   324k|  FLOAT32 xr_j_minus_2 = ptr_vec_x_real[j - 2][bd];
  208|       |
  209|   324k|  FLOAT32 xi_j;
  210|   324k|  FLOAT32 xi_j_minus_1 = ptr_vec_x_imag[j - 1][bd];
  211|   324k|  FLOAT32 xi_j_minus_2 = ptr_vec_x_imag[j - 2][bd];
  212|       |
  213|   324k|  memset(pstr_auto_corr, 0, sizeof(ixheaace_str_auto_corr_ele));
  214|       |
  215|  13.1M|  for (j = 0; j < len; j++) {
  ------------------
  |  Branch (215:15): [True: 12.7M, False: 324k]
  ------------------
  216|  12.7M|    xr_j = ptr_vec_x_real[j][bd];
  217|  12.7M|    xi_j = ptr_vec_x_imag[j][bd];
  218|       |
  219|  12.7M|    pstr_auto_corr->phi_0_1_real += xr_j * xr_j_minus_1 + xi_j * xi_j_minus_1;
  220|       |
  221|  12.7M|    pstr_auto_corr->phi_0_1_imag += xi_j * xr_j_minus_1 - xr_j * xi_j_minus_1;
  222|       |
  223|  12.7M|    pstr_auto_corr->phi_0_2_real += xr_j * xr_j_minus_2 + xi_j * xi_j_minus_2;
  224|       |
  225|  12.7M|    pstr_auto_corr->phi_0_2_imag += xi_j * xr_j_minus_2 - xr_j * xi_j_minus_2;
  226|       |
  227|  12.7M|    pstr_auto_corr->phi_1_1 += xr_j_minus_1 * xr_j_minus_1 + xi_j_minus_1 * xi_j_minus_1;
  228|       |
  229|  12.7M|    pstr_auto_corr->phi_1_2_real += xr_j_minus_1 * xr_j_minus_2 + xi_j_minus_1 * xi_j_minus_2;
  230|       |
  231|  12.7M|    pstr_auto_corr->phi_1_2_imag += xi_j_minus_1 * xr_j_minus_2 - xr_j_minus_1 * xi_j_minus_2;
  232|       |
  233|  12.7M|    pstr_auto_corr->phi_2_2 += xr_j_minus_2 * xr_j_minus_2 + xi_j_minus_2 * xi_j_minus_2;
  234|       |
  235|  12.7M|    xr_j_minus_2 = xr_j_minus_1;
  236|  12.7M|    xr_j_minus_1 = xr_j;
  237|       |
  238|  12.7M|    xi_j_minus_2 = xi_j_minus_1;
  239|  12.7M|    xi_j_minus_1 = xi_j;
  240|  12.7M|  }
  241|       |
  242|   324k|  pstr_auto_corr->det = pstr_auto_corr->phi_1_1 * pstr_auto_corr->phi_2_2 -
  243|   324k|                        (pstr_auto_corr->phi_1_2_real * pstr_auto_corr->phi_1_2_real +
  244|   324k|                         pstr_auto_corr->phi_1_2_imag * pstr_auto_corr->phi_1_2_imag) *
  245|   324k|                            IXHEAACE_SBR_HF_RELAXATION_PARAM;
  ------------------
  |  |   33|   324k|#define IXHEAACE_SBR_HF_RELAXATION_PARAM (0.999999f)
  ------------------
  246|   324k|}
iusace_esbr_inter_tes.c:ixheaace_find_closest_entry:
  177|  14.9k|                                          WORD16 num_mf_bands, WORD16 direction) {
  178|  14.9k|  WORD32 index;
  179|       |
  180|  14.9k|  if (goal_sb <= ptr_master_tab[0]) return ptr_master_tab[0];
  ------------------
  |  Branch (180:7): [True: 0, False: 14.9k]
  ------------------
  181|       |
  182|  14.9k|  if (goal_sb >= ptr_master_tab[num_mf_bands]) return ptr_master_tab[num_mf_bands];
  ------------------
  |  Branch (182:7): [True: 0, False: 14.9k]
  ------------------
  183|       |
  184|  14.9k|  if (direction) {
  ------------------
  |  Branch (184:7): [True: 0, False: 14.9k]
  ------------------
  185|      0|    index = 0;
  186|      0|    while (ptr_master_tab[index] < goal_sb) {
  ------------------
  |  Branch (186:12): [True: 0, False: 0]
  ------------------
  187|      0|      index++;
  188|      0|    }
  189|  14.9k|  } else {
  190|  14.9k|    index = num_mf_bands;
  191|  56.2k|    while (ptr_master_tab[index] > goal_sb) {
  ------------------
  |  Branch (191:12): [True: 41.2k, False: 14.9k]
  ------------------
  192|  41.2k|      index--;
  193|  41.2k|    }
  194|  14.9k|  }
  195|       |
  196|  14.9k|  return ptr_master_tab[index];
  197|  14.9k|}
iusace_esbr_inter_tes.c:ixheaace_apply_inter_tes:
   72|  65.3k|                                     WORD32 num_subband, WORD32 gamma_idx) {
   73|  65.3k|  WORD32 sub_band_end = sub_band_start + num_subband;
   74|  65.3k|  FLOAT32 subsample_power_high[IXHEAACE_TIMESLOT_BUFFER_SIZE],
   75|  65.3k|      subsample_power_low[IXHEAACE_TIMESLOT_BUFFER_SIZE];
   76|  65.3k|  FLOAT32 total_power_high = 0.0f;
   77|  65.3k|  FLOAT32 total_power_low = 0.0f, total_power_high_after = 1.0e-6f;
   78|  65.3k|  FLOAT32 gain[IXHEAACE_TIMESLOT_BUFFER_SIZE];
   79|  65.3k|  FLOAT32 gain_adj, gain_adj_2;
   80|  65.3k|  FLOAT32 gamma = ixheaace_gamma_tab[gamma_idx];
   81|  65.3k|  WORD32 i, j;
   82|  65.3k|  WORD32 memcpy_sz = sub_band_start * sizeof(FLOAT32);
   83|       |
   84|  65.3k|  if (gamma > 0) {
  ------------------
  |  Branch (84:7): [True: 49.0k, False: 16.3k]
  ------------------
   85|  1.03M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (85:17): [True: 989k, False: 49.0k]
  ------------------
   86|   989k|      memcpy(&qmf_real[IXHEAACE_QMF_CHANNELS * i], &qmf_real1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   989k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                    memcpy(&qmf_real[IXHEAACE_QMF_CHANNELS * i], &qmf_real1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   989k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   87|   989k|             memcpy_sz);
   88|   989k|      memcpy(&qmf_imag[IXHEAACE_QMF_CHANNELS * i], &qmf_imag1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   989k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                    memcpy(&qmf_imag[IXHEAACE_QMF_CHANNELS * i], &qmf_imag1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   989k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   89|   989k|             memcpy_sz);
   90|   989k|    }
   91|       |
   92|  1.03M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (92:17): [True: 989k, False: 49.0k]
  ------------------
   93|   989k|      j = 0;
   94|   989k|      subsample_power_low[i] = 0.0f;
   95|  24.6M|      while (j < sub_band_start) {
  ------------------
  |  Branch (95:14): [True: 23.6M, False: 989k]
  ------------------
   96|  23.6M|        subsample_power_low[i] +=
   97|  23.6M|            qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.6M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.6M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   98|  23.6M|        subsample_power_low[i] +=
   99|  23.6M|            qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.6M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.6M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  100|  23.6M|        j++;
  101|  23.6M|      }
  102|   989k|      subsample_power_high[i] = 0.0f;
  103|  30.4M|      while (j < sub_band_end) {
  ------------------
  |  Branch (103:14): [True: 29.4M, False: 989k]
  ------------------
  104|  29.4M|        subsample_power_high[i] +=
  105|  29.4M|            qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  29.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  29.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  106|  29.4M|        subsample_power_high[i] +=
  107|  29.4M|            qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  29.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  29.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  108|  29.4M|        j++;
  109|  29.4M|      }
  110|   989k|      total_power_low += subsample_power_low[i];
  111|   989k|      total_power_high += subsample_power_high[i];
  112|   989k|    }
  113|       |
  114|  1.03M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (114:17): [True: 989k, False: 49.0k]
  ------------------
  115|   989k|      gain[i] =
  116|   989k|          (FLOAT32)(sqrt(subsample_power_low[i] * num_sample / (total_power_low + 1.0e-6f)));
  117|   989k|      gain[i] = (FLOAT32)(1.0f + gamma * (gain[i] - 1.0f));
  118|       |
  119|   989k|      if (gain[i] < 0.2f) {
  ------------------
  |  Branch (119:11): [True: 786k, False: 202k]
  ------------------
  120|   786k|        gain[i] = 0.2f;
  121|   786k|      }
  122|       |
  123|   989k|      subsample_power_high[i] *= gain[i] * gain[i];
  124|   989k|      total_power_high_after += subsample_power_high[i];
  125|   989k|    }
  126|       |
  127|  49.0k|    gain_adj_2 = total_power_high / total_power_high_after;
  128|  49.0k|    gain_adj = (FLOAT32)(sqrt(gain_adj_2));
  129|       |
  130|  1.03M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (130:17): [True: 989k, False: 49.0k]
  ------------------
  131|   989k|      gain[i] *= gain_adj;
  132|       |
  133|   989k|      j = sub_band_start;
  134|  30.4M|      while (j < sub_band_end) {
  ------------------
  |  Branch (134:14): [True: 29.4M, False: 989k]
  ------------------
  135|  29.4M|        qmf_real[IXHEAACE_QMF_CHANNELS * i + j] *= gain[i];
  ------------------
  |  |   66|  29.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  136|  29.4M|        qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] *= gain[i];
  ------------------
  |  |   66|  29.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  137|  29.4M|        j++;
  138|  29.4M|      }
  139|   989k|    }
  140|  49.0k|  }
  141|  65.3k|}

ixheaace_pvc_enc_init:
   38|  2.93k|IA_ERRORCODE ixheaace_pvc_enc_init(ixheaace_pvc_enc *pstr_pvc_enc, WORD32 sbr_pvc_rate) {
   39|  2.93k|  pstr_pvc_enc->pvc_prv_param.pvc_flag = IXHEAACE_ESBR_PVC_FLAG_PREV_DFLT;
  ------------------
  |  |   45|  2.93k|#define IXHEAACE_ESBR_PVC_FLAG_PREV_DFLT (0)
  ------------------
   40|  2.93k|  pstr_pvc_enc->pvc_prv_param.pvc_id = IXHEAACE_ESBR_PVC_ID_PREV_DFLT;
  ------------------
  |  |   46|  2.93k|#define IXHEAACE_ESBR_PVC_ID_PREV_DFLT (0xFF)
  ------------------
   41|  2.93k|  pstr_pvc_enc->pvc_prv_param.pvc_rate = IXHEAACE_ESBR_PVC_RATE_PREV_DFLT;
  ------------------
  |  |   47|  2.93k|#define IXHEAACE_ESBR_PVC_RATE_PREV_DFLT (0xFF)
  ------------------
   42|  2.93k|  pstr_pvc_enc->pvc_prv_param.start_band = IXHEAACE_ESBR_PVC_STRT_BAND_PREV_DFLT;
  ------------------
  |  |   48|  2.93k|#define IXHEAACE_ESBR_PVC_STRT_BAND_PREV_DFLT (0xFF)
  ------------------
   43|  2.93k|  pstr_pvc_enc->pvc_param.pvc_rate = (UWORD8)sbr_pvc_rate;
   44|       |
   45|  2.93k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  2.93k|#define IA_NO_ERROR 0x00000000
  ------------------
   46|  2.93k|}
ixheaace_pvc_calc_grp_energy:
  285|  26.0k|                                  FLOAT32 *ptr_sb_grp_energy_hi_ref) {
  286|  26.0k|  WORD32 ts, res_init_flg = 1, pvc_id, i;
  287|  26.0k|  FLOAT32 res_all[128] = {0}, res_min, sb_grp_energy_blwsbr[3], sb_grp_energy_hi[8], res = 0;
  288|  26.0k|  UWORD16 *ptr_pvc_id, tmp = 0;
  289|       |
  290|  26.0k|  ptr_pvc_id = pstr_pvc_enc->pvc_param.pvc_id;
  291|   442k|  for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS; ts++) {
  ------------------
  |  |   26|   442k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (291:16): [True: 416k, False: 26.0k]
  ------------------
  292|   416k|    ixheaace_pvc_calc_grp_energy_below_sbr(pstr_pvc_enc, ts, sb_grp_energy_blwsbr);
  293|  53.7M|    for (pvc_id = 0; pvc_id < pstr_pvc_enc->pvc_param.num_pvc_id; pvc_id++) {
  ------------------
  |  Branch (293:22): [True: 53.3M, False: 416k]
  ------------------
  294|  53.3M|      pstr_pvc_enc->pvc_param.pvc_id[ts] = (UWORD16)pvc_id;
  295|  53.3M|      ixheaace_pvc_predict(pstr_pvc_enc, ts, sb_grp_energy_blwsbr, sb_grp_energy_hi);
  296|       |
  297|  53.3M|      res = ixheaace_pvc_calc_res(
  298|  53.3M|          &(ptr_sb_grp_energy_hi_ref[ts * pstr_pvc_enc->pvc_param.num_grp_sbr]), sb_grp_energy_hi,
  299|  53.3M|          pstr_pvc_enc->pvc_param.num_grp_sbr);
  300|  53.3M|      if (res_init_flg) {
  ------------------
  |  Branch (300:11): [True: 6.66M, False: 46.6M]
  ------------------
  301|  6.66M|        res_all[pvc_id] = res;
  302|  46.6M|      } else {
  303|  46.6M|        res_all[pvc_id] += res;
  304|  46.6M|      }
  305|  53.3M|    }
  306|       |
  307|   416k|    res_init_flg = 0;
  308|   416k|    if ((ts & (IXHEAACE_ESBR_PVC_NTS_GRP_ID - 1)) == (IXHEAACE_ESBR_PVC_NTS_GRP_ID - 1)) {
  ------------------
  |  |   37|   416k|#define IXHEAACE_ESBR_PVC_NTS_GRP_ID (8)
  ------------------
                  if ((ts & (IXHEAACE_ESBR_PVC_NTS_GRP_ID - 1)) == (IXHEAACE_ESBR_PVC_NTS_GRP_ID - 1)) {
  ------------------
  |  |   37|   416k|#define IXHEAACE_ESBR_PVC_NTS_GRP_ID (8)
  ------------------
  |  Branch (308:9): [True: 52.0k, False: 364k]
  ------------------
  309|  52.0k|      res_min = IXHEAACE_ESBR_PVC_RESIDUAL_VAL;
  ------------------
  |  |   36|  52.0k|#define IXHEAACE_ESBR_PVC_RESIDUAL_VAL (1000000.0f)
  ------------------
  310|  52.0k|      pvc_id = 0;
  311|  6.71M|      while (pvc_id < pstr_pvc_enc->pvc_param.num_pvc_id) {
  ------------------
  |  Branch (311:14): [True: 6.66M, False: 52.0k]
  ------------------
  312|  6.66M|        if (res_all[pvc_id] < res_min) {
  ------------------
  |  Branch (312:13): [True: 261k, False: 6.40M]
  ------------------
  313|   261k|          tmp = (UWORD16)pvc_id;
  314|   261k|          res_min = res_all[pvc_id];
  315|   261k|        }
  316|  6.66M|        pvc_id++;
  317|  6.66M|      }
  318|   468k|      for (i = 0; i < IXHEAACE_ESBR_PVC_NTS_GRP_ID; i++) {
  ------------------
  |  |   37|   468k|#define IXHEAACE_ESBR_PVC_NTS_GRP_ID (8)
  ------------------
  |  Branch (318:19): [True: 416k, False: 52.0k]
  ------------------
  319|   416k|        *(ptr_pvc_id++) = tmp;
  320|   416k|      }
  321|  52.0k|      res_init_flg = 1;
  322|  52.0k|    }
  323|   416k|  }
  324|       |
  325|   416k|  for (ts = 0; ts < 15; ts++) {
  ------------------
  |  Branch (325:16): [True: 390k, False: 26.0k]
  ------------------
  326|   390k|    memcpy(&pstr_pvc_enc->sb_grp_energy[ts][0],
  327|   390k|           &pstr_pvc_enc->sb_grp_energy[ts + IXHEAACE_ESBR_PVC_NUM_TS][0],
  ------------------
  |  |   26|   390k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  328|   390k|           IXHEAACE_ESBR_PVC_NUM_BANDS_CORE * sizeof(pstr_pvc_enc->sb_grp_energy[ts][0]));
  ------------------
  |  |   29|   390k|#define IXHEAACE_ESBR_PVC_NUM_BANDS_CORE (3)
  ------------------
  329|   390k|  }
  330|  26.0k|}
ixheaace_pvc_calc_ref_ene_update_tabs:
  333|  26.0k|                                           FLOAT32 *ptr_sb_grp_energy_hi_ref) {
  334|  26.0k|  WORD32 ts, band;
  335|  26.0k|  FLOAT32 sum, prev_sum = 0;
  336|  26.0k|  pstr_pvc_enc->pvc_param.ns_mode = 0;
  337|       |
  338|  26.0k|  switch (pstr_pvc_enc->pvc_param.pvc_mode) {
  339|      0|    case 1: {
  ------------------
  |  Branch (339:5): [True: 0, False: 26.0k]
  ------------------
  340|      0|      pstr_pvc_enc->pvc_param.time_smth_ts = IXHEAACE_ESBR_PVC_NUM_TS;
  ------------------
  |  |   26|      0|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  341|      0|      pstr_pvc_enc->pvc_tabs.smoothing_coef = ixheaace_pvc_tabs.pvc_smth_win_ns_16;
  342|      0|      break;
  343|      0|    }
  344|  26.0k|    case 2: {
  ------------------
  |  Branch (344:5): [True: 26.0k, False: 0]
  ------------------
  345|  26.0k|      pstr_pvc_enc->pvc_param.time_smth_ts = 12;
  346|  26.0k|      pstr_pvc_enc->pvc_tabs.smoothing_coef = ixheaace_pvc_tabs.pvc_smth_win_ns_12;
  347|  26.0k|      break;
  348|      0|    }
  349|      0|    default: {
  ------------------
  |  Branch (349:5): [True: 0, False: 26.0k]
  ------------------
  350|       |      // No assignment
  351|      0|      break;
  352|      0|    }
  353|  26.0k|  }
  354|       |
  355|   442k|  for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS; ts++) {
  ------------------
  |  |   26|   442k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (355:16): [True: 416k, False: 26.0k]
  ------------------
  356|   416k|    FLOAT32 *ptr_grp_energy =
  357|   416k|        &(ptr_sb_grp_energy_hi_ref[ts * pstr_pvc_enc->pvc_param.num_grp_sbr]);
  358|   416k|    sum = 0.0f;
  359|  2.91M|    for (band = 0; band < pstr_pvc_enc->pvc_param.num_grp_sbr; band++) {
  ------------------
  |  Branch (359:20): [True: 2.49M, False: 416k]
  ------------------
  360|  2.49M|      sum += *ptr_grp_energy;
  361|       |
  362|  2.49M|      *ptr_grp_energy = 10 * (FLOAT32)log10(*ptr_grp_energy);
  363|  2.49M|      ptr_grp_energy++;
  364|  2.49M|    }
  365|   416k|    if (ts && (sum > prev_sum * IXHEAACE_ESBR_PVC_NS_MODE_PRD_THRS)) {
  ------------------
  |  |   34|   390k|#define IXHEAACE_ESBR_PVC_NS_MODE_PRD_THRS (2)
  ------------------
  |  Branch (365:9): [True: 390k, False: 26.0k]
  |  Branch (365:15): [True: 25.6k, False: 364k]
  ------------------
  366|  25.6k|      pstr_pvc_enc->pvc_param.ns_mode = 1;
  367|  25.6k|    }
  368|   416k|    prev_sum = sum;
  369|   416k|  }
  370|       |
  371|  26.0k|  if (pstr_pvc_enc->pvc_param.ns_mode == 1) {
  ------------------
  |  Branch (371:7): [True: 10.4k, False: 15.5k]
  ------------------
  372|  10.4k|    switch (pstr_pvc_enc->pvc_param.pvc_mode) {
  373|      0|      case 1: {
  ------------------
  |  Branch (373:7): [True: 0, False: 10.4k]
  ------------------
  374|      0|        pstr_pvc_enc->pvc_param.time_smth_ts = 4;
  375|      0|        pstr_pvc_enc->pvc_tabs.smoothing_coef = ixheaace_pvc_tabs.pvc_smth_win_ns_4;
  376|      0|        break;
  377|      0|      }
  378|  10.4k|      case 2: {
  ------------------
  |  Branch (378:7): [True: 10.4k, False: 0]
  ------------------
  379|  10.4k|        pstr_pvc_enc->pvc_param.time_smth_ts = 3;
  380|  10.4k|        pstr_pvc_enc->pvc_tabs.smoothing_coef = ixheaace_pvc_tabs.pvc_smth_win_ns_3;
  381|  10.4k|        break;
  382|      0|      }
  383|      0|      default: {
  ------------------
  |  Branch (383:7): [True: 0, False: 10.4k]
  ------------------
  384|       |        // No assignment
  385|      0|        break;
  386|      0|      }
  387|  10.4k|    }
  388|  10.4k|  }
  389|  26.0k|}
ixheaace_pvc_encode_frame:
  393|  49.8k|                                       UWORD8 start_band, UWORD8 stop_band) {
  394|  49.8k|  IA_ERRORCODE ret;
  395|  49.8k|  FLOAT32 sb_grp_energy_hi_ref[IXHEAACE_ESBR_PVC_NUM_TS * 8];
  396|       |
  397|  49.8k|  pstr_pvc_enc->pvc_param.pvc_mode = pvc_mode;
  398|       |  /* PVC encoding process */
  399|  49.8k|  if (pstr_pvc_enc->pvc_param.pvc_mode) {
  ------------------
  |  Branch (399:7): [True: 26.0k, False: 23.8k]
  ------------------
  400|  26.0k|    ret = ixheaace_set_pvc_mode_param(&(pstr_pvc_enc->pvc_param), &(pstr_pvc_enc->pvc_tabs));
  401|  26.0k|    if (IA_NO_ERROR != ret) {
  ------------------
  |  |   23|  26.0k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (401:9): [True: 0, False: 26.0k]
  ------------------
  402|      0|      return ret;
  403|      0|    }
  404|       |
  405|  26.0k|    ixheaace_pvc_sb_grouping(pstr_pvc_enc, start_band, ptr_qmf_low,
  406|  26.0k|                             (FLOAT32 *)pstr_pvc_enc->sb_grp_energy, 0);
  407|       |
  408|  26.0k|    ixheaace_pvc_sb_grouping_ref(&(pstr_pvc_enc->pvc_param), start_band, stop_band, ptr_qmf_high,
  409|  26.0k|                                 sb_grp_energy_hi_ref);
  410|  26.0k|    ixheaace_pvc_calc_ref_ene_update_tabs(pstr_pvc_enc, sb_grp_energy_hi_ref);
  411|       |
  412|  26.0k|    ixheaace_pvc_calc_grp_energy(pstr_pvc_enc, sb_grp_energy_hi_ref);
  413|       |
  414|  26.0k|    ixheaace_pvc_packing(pstr_pvc_enc, pstr_pvc_enc->pvc_param.usac_indep_flag);
  415|  26.0k|  }
  416|       |
  417|  49.8k|  pstr_pvc_enc->pvc_prv_param.pvc_id =
  418|  49.8k|      (pstr_pvc_enc->pvc_param.pvc_mode == 0)
  ------------------
  |  Branch (418:7): [True: 23.8k, False: 26.0k]
  ------------------
  419|  49.8k|          ? 0xFF
  420|  49.8k|          : pstr_pvc_enc->pvc_param.pvc_id[IXHEAACE_ESBR_PVC_NUM_TS - 1];
  ------------------
  |  |   26|  26.0k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  421|  49.8k|  pstr_pvc_enc->pvc_prv_param.start_band = start_band;
  422|  49.8k|  pstr_pvc_enc->pvc_prv_param.pvc_flag = (pstr_pvc_enc->pvc_param.pvc_mode == 0) ? 0 : 1;
  ------------------
  |  Branch (422:42): [True: 23.8k, False: 26.0k]
  ------------------
  423|  49.8k|  pstr_pvc_enc->pvc_prv_param.pvc_rate = pstr_pvc_enc->pvc_param.pvc_rate;
  424|       |
  425|  49.8k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  49.8k|#define IA_NO_ERROR 0x00000000
  ------------------
  426|  49.8k|}
iusace_esbr_pvc.c:ixheaace_pvc_calc_grp_energy_below_sbr:
  182|   416k|                                                   FLOAT32 *ptr_sb_grp_ene_blsbr) {
  183|   416k|  WORD32 ksg = 0, idx;
  184|   416k|  ixheaace_pvc_params *pstr_pvc_params = &pstr_pvc_enc->pvc_param;
  185|       |
  186|   416k|  memset(ptr_sb_grp_ene_blsbr, 0,
  187|   416k|         pstr_pvc_params->num_grp_core * sizeof(ptr_sb_grp_ene_blsbr[0]));
  188|       |
  189|  1.66M|  while (ksg < pstr_pvc_params->num_grp_core) {
  ------------------
  |  Branch (189:10): [True: 1.24M, False: 416k]
  ------------------
  190|  11.7M|    for (idx = 0; idx < pstr_pvc_params->time_smth_ts; idx++) {
  ------------------
  |  Branch (190:19): [True: 10.4M, False: 1.24M]
  ------------------
  191|  10.4M|      ptr_sb_grp_ene_blsbr[ksg] +=
  192|  10.4M|          pstr_pvc_enc->sb_grp_energy[ts + IXHEAACE_ESBR_PVC_NUM_TS - 1 - idx][ksg] *
  ------------------
  |  |   26|  10.4M|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  193|  10.4M|          pstr_pvc_enc->pvc_tabs.smoothing_coef[idx];
  194|  10.4M|    }
  195|  1.24M|    ksg++;
  196|  1.24M|  }
  197|   416k|  return;
  198|   416k|}
iusace_esbr_pvc.c:ixheaace_pvc_predict:
  201|  53.3M|                                 FLOAT32 *ptr_sb_grp_ene_blsbr, FLOAT32 *ptr_sb_grp_energy_high) {
  202|  53.3M|  ixheaace_pvc_params *pstr_pvc_params = &(pstr_pvc_enc->pvc_param);
  203|  53.3M|  ixheaace_pvc_coef_tabs *pstr_pvc_tabs = &(pstr_pvc_enc->pvc_tabs);
  204|       |
  205|  53.3M|  WORD32 ksg, kb, idx_tab_1, idx_tab_2;
  206|  53.3M|  const UWORD8 *ptr_tab;
  207|  53.3M|  FLOAT32 prod;
  208|       |
  209|  53.3M|  idx_tab_2 = pstr_pvc_params->pvc_id[ts];
  210|       |
  211|  53.3M|  if (idx_tab_2 < pstr_pvc_tabs->pvc_idx_tab[0]) {
  ------------------
  |  Branch (211:7): [True: 6.66M, False: 46.6M]
  ------------------
  212|  6.66M|    idx_tab_1 = 0;
  213|  46.6M|  } else if (idx_tab_2 < pstr_pvc_tabs->pvc_idx_tab[1]) {
  ------------------
  |  Branch (213:14): [True: 14.9M, False: 31.6M]
  ------------------
  214|  14.9M|    idx_tab_1 = 1;
  215|  31.6M|  } else {
  216|  31.6M|    idx_tab_1 = 2;
  217|  31.6M|  }
  218|       |
  219|  53.3M|  memset(ptr_sb_grp_energy_high, 0,
  220|  53.3M|         pstr_pvc_params->num_grp_sbr * sizeof(ptr_sb_grp_energy_high[0]));
  221|       |
  222|  53.3M|  ptr_tab = &(pstr_pvc_tabs->pvc_pred_coef_kb_012[idx_tab_1 * pstr_pvc_params->num_grp_core *
  223|  53.3M|                                                  pstr_pvc_params->num_grp_sbr]);
  224|       |
  225|   213M|  for (kb = 0; kb < pstr_pvc_params->num_grp_core; kb++) {
  ------------------
  |  Branch (225:16): [True: 159M, False: 53.3M]
  ------------------
  226|   159M|    prod = pstr_pvc_tabs->scaling_coef[kb] * ptr_sb_grp_ene_blsbr[kb];
  227|  1.11G|    for (ksg = 0; ksg < pstr_pvc_params->num_grp_sbr; ksg++) {
  ------------------
  |  Branch (227:19): [True: 959M, False: 159M]
  ------------------
  228|   959M|      ptr_sb_grp_energy_high[ksg] += ((FLOAT32)(WORD8)(*(ptr_tab++)) * prod);
  229|   959M|    }
  230|   159M|  }
  231|       |
  232|  53.3M|  ptr_tab = &(pstr_pvc_tabs->pvc_pred_coef_kb_3[idx_tab_2 * pstr_pvc_params->num_grp_sbr]);
  233|  53.3M|  prod = pstr_pvc_tabs->scaling_coef[pstr_pvc_params->num_grp_core];
  234|       |
  235|   373M|  for (ksg = 0; ksg < pstr_pvc_params->num_grp_sbr; ksg++) {
  ------------------
  |  Branch (235:17): [True: 319M, False: 53.3M]
  ------------------
  236|   319M|    ptr_sb_grp_energy_high[ksg] += (FLOAT32)(WORD8)(*(ptr_tab++)) * prod;
  237|   319M|  }
  238|       |
  239|  53.3M|  return;
  240|  53.3M|}
iusace_esbr_pvc.c:ixheaace_pvc_calc_res:
  270|  53.3M|static FLOAT32 ixheaace_pvc_calc_res(FLOAT32 *ptr_org, FLOAT32 *ptr_prd, UWORD8 ng_sb_sbr) {
  271|  53.3M|  FLOAT32 residual = 0, diff;
  272|  53.3M|  WORD32 band = 0;
  273|       |
  274|   373M|  while (band < ng_sb_sbr) {
  ------------------
  |  Branch (274:10): [True: 319M, False: 53.3M]
  ------------------
  275|   319M|    diff = ptr_org[band] - ptr_prd[band];
  276|   319M|    residual += diff * diff;
  277|   319M|    band++;
  278|   319M|  }
  279|  53.3M|  residual = (FLOAT32)sqrt(residual);
  280|       |
  281|  53.3M|  return residual;
  282|  53.3M|}
iusace_esbr_pvc.c:ixheaace_set_pvc_mode_param:
  100|  26.0k|                                                ixheaace_pvc_coef_tabs *pstr_pvc_tabs) {
  101|  26.0k|  pstr_pvc_param->num_grp_core = IXHEAACE_ESBR_PVC_NUM_BANDS_CORE;
  ------------------
  |  |   29|  26.0k|#define IXHEAACE_ESBR_PVC_NUM_BANDS_CORE (3)
  ------------------
  102|  26.0k|  pstr_pvc_param->num_pvc_id = IXHEAACE_ESBR_PVC_NUM_PVCID;
  ------------------
  |  |   25|  26.0k|#define IXHEAACE_ESBR_PVC_NUM_PVCID (128)
  ------------------
  103|       |
  104|  26.0k|  switch (pstr_pvc_param->pvc_mode) {
  105|      0|    case IXHEAACE_ESBR_PVC_MODE_1:
  ------------------
  |  |   50|      0|#define IXHEAACE_ESBR_PVC_MODE_1 (1)
  ------------------
  |  Branch (105:5): [True: 0, False: 26.0k]
  ------------------
  106|      0|      pstr_pvc_param->num_grp_sbr = IXHEAACE_ESBR_PVC_NUM_BANDS_SBR_MODE1;
  ------------------
  |  |   30|      0|#define IXHEAACE_ESBR_PVC_NUM_BANDS_SBR_MODE1 (8)
  ------------------
  107|      0|      pstr_pvc_param->hbw = 8 / pstr_pvc_param->pvc_rate;
  108|      0|      pstr_pvc_tabs->pvc_pred_coef_kb_012 =
  109|      0|          (UWORD8 *)ixheaace_pvc_tabs.pvc_prd_coef_kb_012_mode_1;
  110|      0|      pstr_pvc_tabs->pvc_pred_coef_kb_3 = (UWORD8 *)ixheaace_pvc_tabs.pvc_prd_coef_kb_3_mode_1;
  111|      0|      pstr_pvc_tabs->pvc_idx_tab = ixheaace_pvc_tabs.pvc_idx_mode_1;
  112|      0|      pstr_pvc_tabs->scaling_coef = ixheaace_pvc_tabs.pvc_scaling_coef_mode_1;
  113|      0|      break;
  114|       |
  115|  26.0k|    case IXHEAACE_ESBR_PVC_MODE_2:
  ------------------
  |  |   51|  26.0k|#define IXHEAACE_ESBR_PVC_MODE_2 (2)
  ------------------
  |  Branch (115:5): [True: 26.0k, False: 0]
  ------------------
  116|  26.0k|      pstr_pvc_param->num_grp_sbr = IXHEAACE_ESBR_PVC_NUM_BANDS_SBR_MODE2;
  ------------------
  |  |   31|  26.0k|#define IXHEAACE_ESBR_PVC_NUM_BANDS_SBR_MODE2 (6)
  ------------------
  117|  26.0k|      pstr_pvc_param->hbw = 12 / pstr_pvc_param->pvc_rate;
  118|  26.0k|      pstr_pvc_tabs->pvc_pred_coef_kb_012 =
  119|  26.0k|          (UWORD8 *)ixheaace_pvc_tabs.pvc_prd_coef_kb_012_mode_2;
  120|  26.0k|      pstr_pvc_tabs->pvc_pred_coef_kb_3 = (UWORD8 *)ixheaace_pvc_tabs.pvc_prd_coef_kb_3_mode_2;
  121|  26.0k|      pstr_pvc_tabs->pvc_idx_tab = ixheaace_pvc_tabs.pvc_idx_mode_2;
  122|  26.0k|      pstr_pvc_tabs->scaling_coef = ixheaace_pvc_tabs.pvc_scaling_coef_mode_2;
  123|  26.0k|      break;
  124|       |
  125|      0|    default:
  ------------------
  |  Branch (125:5): [True: 0, False: 26.0k]
  ------------------
  126|      0|      return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_PVC_MODE;
  127|  26.0k|  }
  128|  26.0k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  26.0k|#define IA_NO_ERROR 0x00000000
  ------------------
  129|  26.0k|}
iusace_esbr_pvc.c:ixheaace_pvc_sb_grouping:
   50|  26.0k|                                     WORD32 first_pvc_ts) {
   51|  26.0k|  WORD32 ksg, ts, band;
   52|  26.0k|  FLOAT32 tmp_sb_grp_energy;
   53|  26.0k|  WORD32 lbw, sb;
   54|  26.0k|  WORD32 nqmf_lb;
   55|  26.0k|  FLOAT32 *ptr_tmp_qmfl;
   56|       |
   57|  26.0k|  ixheaace_pvc_params *pstr_params = &pstr_pvc_enc->pvc_param;
   58|  26.0k|  ixheaace_pvc_prv_frm_params *pstr_prv_params = &pstr_pvc_enc->pvc_prv_param;
   59|       |
   60|  26.0k|  nqmf_lb = IXHEAACE_ESBR_PVC_NUM_QMF_BANDS / pstr_params->pvc_rate;
  ------------------
  |  |   27|  26.0k|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
   61|  26.0k|  lbw = 8 / pstr_params->pvc_rate;
   62|       |
   63|   442k|  for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS; ts++) {
  ------------------
  |  |   26|   442k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (63:16): [True: 416k, False: 26.0k]
  ------------------
   64|   416k|    sb = start_band - lbw * pstr_params->num_grp_core;
   65|   416k|    ksg = 0;
   66|  1.66M|    while (ksg < pstr_params->num_grp_core) {
  ------------------
  |  Branch (66:12): [True: 1.24M, False: 416k]
  ------------------
   67|  1.24M|      tmp_sb_grp_energy = 0.0f;
   68|  1.24M|      if (sb >= 0) {
  ------------------
  |  Branch (68:11): [True: 1.24M, False: 0]
  ------------------
   69|  1.24M|        ptr_tmp_qmfl = &ptr_qmf_low[ts * nqmf_lb + sb];
   70|  1.24M|        band = 0;
   71|  5.34M|        while (band < lbw) {
  ------------------
  |  Branch (71:16): [True: 4.09M, False: 1.24M]
  ------------------
   72|  4.09M|          tmp_sb_grp_energy += ptr_tmp_qmfl[band];
   73|  4.09M|          band++;
   74|  4.09M|        }
   75|  1.24M|        tmp_sb_grp_energy /= lbw;
   76|  1.24M|      }
   77|       |
   78|  1.24M|      tmp_sb_grp_energy = max(IXHEAACE_ESBR_PVC_POW_THRS, tmp_sb_grp_energy);
  ------------------
  |  |   74|  1.24M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 201k, False: 1.04M]
  |  |  ------------------
  ------------------
   79|  1.24M|      ptr_sb_grp_energy[(ts + IXHEAACE_ESBR_PVC_NUM_TS - 1) * 3 + ksg] =
  ------------------
  |  |   26|  1.24M|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
   80|  1.24M|          10 * (FLOAT32)log10(tmp_sb_grp_energy);
   81|  1.24M|      sb += lbw;
   82|  1.24M|      ksg++;
   83|  1.24M|    }
   84|   416k|  }
   85|       |
   86|  26.0k|  if ((pstr_prv_params->pvc_flag == 0) ||
  ------------------
  |  Branch (86:7): [True: 589, False: 25.4k]
  ------------------
   87|  25.4k|      ((start_band * pstr_params->pvc_rate) !=
  ------------------
  |  Branch (87:7): [True: 0, False: 25.4k]
  ------------------
   88|  25.4k|       (pstr_prv_params->start_band * pstr_prv_params->pvc_rate))) {
   89|  9.42k|    for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS - 1 + first_pvc_ts; ts++) {
  ------------------
  |  |   26|  9.42k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (89:18): [True: 8.83k, False: 589]
  ------------------
   90|  8.83k|      memcpy(&ptr_sb_grp_energy[ts * 3],
   91|  8.83k|             &ptr_sb_grp_energy[(IXHEAACE_ESBR_PVC_NUM_TS - 1 + first_pvc_ts) * 3],
  ------------------
  |  |   26|  8.83k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
   92|  8.83k|             pstr_params->num_grp_core * sizeof(ptr_sb_grp_energy[0]));
   93|  8.83k|    }
   94|    589|  }
   95|       |
   96|  26.0k|  return;
   97|  26.0k|}
iusace_esbr_pvc.c:ixheaace_pvc_sb_grouping_ref:
  133|  26.0k|                                         FLOAT32 *ptr_sb_grp_energy) {
  134|  26.0k|  WORD32 ksg, ts, band;
  135|  26.0k|  UWORD8 min_sb;
  136|  26.0k|  WORD32 sb, eb;
  137|  26.0k|  FLOAT32 tmp_sb_grp_energy;
  138|       |
  139|  26.0k|  min_sb = start_band + pstr_pvc_param->num_grp_sbr * pstr_pvc_param->hbw - 1;
  140|  26.0k|  stop_band = max(stop_band, min_sb);
  ------------------
  |  |   74|  26.0k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 16.6k, False: 9.38k]
  |  |  ------------------
  ------------------
  141|       |
  142|   442k|  for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS; ts++) {
  ------------------
  |  |   26|   442k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (142:16): [True: 416k, False: 26.0k]
  ------------------
  143|   416k|    sb = start_band;
  144|   416k|    eb = min((sb + pstr_pvc_param->hbw - 1), (IXHEAACE_ESBR_PVC_NUM_QMF_BANDS - 1));
  ------------------
  |  |   75|   416k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 416k, False: 0]
  |  |  ------------------
  ------------------
  145|       |
  146|  2.08M|    for (ksg = 0; ksg < (pstr_pvc_param->num_grp_sbr - 2); ksg++) {
  ------------------
  |  Branch (146:19): [True: 1.66M, False: 416k]
  ------------------
  147|  1.66M|      tmp_sb_grp_energy = 0.0f;
  148|  1.66M|      band = sb;
  149|  9.85M|      while (band <= eb) {
  ------------------
  |  Branch (149:14): [True: 8.18M, False: 1.66M]
  ------------------
  150|  8.18M|        tmp_sb_grp_energy += ptr_qmf_high[ts * IXHEAACE_ESBR_PVC_NUM_QMF_BANDS + band];
  ------------------
  |  |   27|  8.18M|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
  151|  8.18M|        band++;
  152|  8.18M|      }
  153|  1.66M|      tmp_sb_grp_energy = tmp_sb_grp_energy / (eb - sb + 1);
  154|       |
  155|  1.66M|      ptr_sb_grp_energy[ts * pstr_pvc_param->num_grp_sbr + ksg] =
  156|  1.66M|          max(IXHEAACE_ESBR_PVC_POW_THRS, tmp_sb_grp_energy);
  ------------------
  |  |   74|  1.66M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 387k, False: 1.27M]
  |  |  ------------------
  ------------------
  157|  1.66M|      sb += pstr_pvc_param->hbw;
  158|  1.66M|      eb = min((sb + pstr_pvc_param->hbw - 1), stop_band);
  ------------------
  |  |   75|  1.66M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 1.66M, False: 0]
  |  |  ------------------
  ------------------
  159|  1.66M|      eb = min(eb, (IXHEAACE_ESBR_PVC_NUM_QMF_BANDS - 1));
  ------------------
  |  |   75|  1.66M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 1.66M, False: 0]
  |  |  ------------------
  ------------------
  160|  1.66M|    }
  161|       |
  162|  1.24M|    while (ksg < pstr_pvc_param->num_grp_sbr) {
  ------------------
  |  Branch (162:12): [True: 833k, False: 416k]
  ------------------
  163|   833k|      tmp_sb_grp_energy = 0.0f;
  164|   833k|      band = sb;
  165|  8.10M|      while (band <= eb) {
  ------------------
  |  Branch (165:14): [True: 7.27M, False: 833k]
  ------------------
  166|  7.27M|        tmp_sb_grp_energy += ptr_qmf_high[ts * IXHEAACE_ESBR_PVC_NUM_QMF_BANDS + band];
  ------------------
  |  |   27|  7.27M|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
  167|  7.27M|        band++;
  168|  7.27M|      }
  169|   833k|      tmp_sb_grp_energy = tmp_sb_grp_energy / (eb - sb + 1);
  170|       |
  171|   833k|      ptr_sb_grp_energy[ts * pstr_pvc_param->num_grp_sbr + ksg] =
  172|   833k|          max(IXHEAACE_ESBR_PVC_POW_THRS, tmp_sb_grp_energy);
  ------------------
  |  |   74|   833k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 241k, False: 591k]
  |  |  ------------------
  ------------------
  173|   833k|      sb += pstr_pvc_param->hbw;
  174|   833k|      eb = min(stop_band, (IXHEAACE_ESBR_PVC_NUM_QMF_BANDS - 1));
  ------------------
  |  |   75|   833k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 695k, False: 137k]
  |  |  ------------------
  ------------------
  175|   833k|      ksg++;
  176|   833k|    }
  177|   416k|  }
  178|  26.0k|  return;
  179|  26.0k|}
iusace_esbr_pvc.c:ixheaace_pvc_packing:
  242|  26.0k|static VOID ixheaace_pvc_packing(ixheaace_pvc_enc *pstr_pvc_enc, WORD32 const usac_indep_flag) {
  243|  26.0k|  UWORD16 *ptr_pvc_bs;
  244|  26.0k|  ixheaace_pvc_params *pstr_params = &pstr_pvc_enc->pvc_param;
  245|  26.0k|  ixheaace_pvc_prv_frm_params *pstr_prv_params = &pstr_pvc_enc->pvc_prv_param;
  246|  26.0k|  ixheaace_pvc_bs_info *pstr_pvc_bs_info = &pstr_pvc_enc->pvc_bs_info;
  247|       |
  248|  26.0k|  ptr_pvc_bs = pstr_pvc_bs_info->pvc_id_bs;
  249|       |
  250|  26.0k|  pstr_pvc_bs_info->ns_mode = pstr_params->ns_mode;
  251|       |
  252|  26.0k|  if ((usac_indep_flag == 1) || (pstr_params->pvc_id[1] != pstr_prv_params->pvc_id)) {
  ------------------
  |  Branch (252:7): [True: 3.11k, False: 22.9k]
  |  Branch (252:33): [True: 8.10k, False: 14.8k]
  ------------------
  253|  11.2k|    pstr_pvc_bs_info->grid_info[0] = 1;
  254|  11.2k|    *(ptr_pvc_bs++) = pstr_params->pvc_id[0];
  255|  14.8k|  } else {
  256|  14.8k|    pstr_pvc_bs_info->grid_info[0] = 0;
  257|  14.8k|  }
  258|       |
  259|  26.0k|  if (pstr_params->pvc_id[8] == pstr_params->pvc_id[7]) {
  ------------------
  |  Branch (259:7): [True: 15.8k, False: 10.1k]
  ------------------
  260|  15.8k|    pstr_pvc_bs_info->div_mode = 0;
  261|  15.8k|  } else {
  262|  10.1k|    pstr_pvc_bs_info->div_mode = 4;
  263|  10.1k|    pstr_pvc_bs_info->num_grid_info = 2;
  264|  10.1k|    pstr_pvc_bs_info->grid_info[1] = 1;
  265|  10.1k|    *(ptr_pvc_bs++) = pstr_params->pvc_id[8];
  266|  10.1k|  }
  267|  26.0k|  return;
  268|  26.0k|}

iusace_fac_apply:
  110|  4.19k|                      iusace_scratch_mem *pstr_scratch) {
  111|  4.19k|  FLOAT32 *xn2 = pstr_scratch->p_xn2;
  112|  4.19k|  FLOAT32 *fac_dec = pstr_scratch->p_fac_dec;
  113|  4.19k|  FLOAT32 *right_fac_spec = pstr_scratch->p_right_fac_spec;
  114|  4.19k|  FLOAT32 *x2 = pstr_scratch->p_x2;
  115|  4.19k|  WORD32 *param = pstr_scratch->p_param;
  116|  4.19k|  FLOAT32 ap[ORDER + 1];
  117|  4.19k|  FLOAT32 fac_gain;
  118|  4.19k|  WORD32 i, index;
  119|  4.19k|  WORD32 num_enc_bits = 0;
  120|  4.19k|  WORD32 start_right = 2 * len_subfrm - fac_len;
  121|       |
  122|  4.19k|  *num_fac_bits = 0;
  123|       |
  124|  4.19k|  memset(xn2, 0, (FAC_LENGTH + ORDER) * sizeof(FLOAT32));
  ------------------
  |  |   80|  4.19k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  ------------------
  |  |  |  |   74|  4.19k|#define LEN_FRAME (256)
  |  |  ------------------
  ------------------
                memset(xn2, 0, (FAC_LENGTH + ORDER) * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  125|       |
  126|  4.19k|  memcpy(xn2 + ORDER, &orig[start_right], fac_len * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  127|   515k|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (127:15): [True: 511k, False: 4.19k]
  ------------------
  128|   511k|    xn2[ORDER + i] -= synth[start_right + i];
  ------------------
  |  |   71|   511k|#define ORDER (16)
  ------------------
  129|   511k|  }
  130|       |
  131|  4.19k|  iusace_get_weighted_lpc(ptr_lpc_coeffs, ap);
  132|  4.19k|  iusace_compute_lp_residual(ap, xn2 + ORDER, x2, fac_len);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  133|   515k|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (133:15): [True: 511k, False: 4.19k]
  ------------------
  134|   511k|    x2[i] = x2[i] * (2.0f / (FLOAT32)fac_len);
  135|   511k|  }
  136|       |
  137|  4.19k|  iusace_tcx_mdct(x2, right_fac_spec, fac_len, pstr_scratch);
  138|       |
  139|  4.19k|  memset(&right_fac_spec[low_pass_line], 0, (fac_len - low_pass_line) * sizeof(FLOAT32));
  140|       |
  141|  4.19k|  fac_gain = iusace_calc_sq_gain(right_fac_spec, target_br, fac_len, pstr_scratch->p_sq_gain_en);
  142|  4.19k|  index = (WORD32)floor(0.5f + (28.0f * (FLOAT32)log10(fac_gain)));
  143|  4.19k|  if (index < 0) index = 0;
  ------------------
  |  Branch (143:7): [True: 0, False: 4.19k]
  ------------------
  144|  4.19k|  if (index > 127) index = 127;
  ------------------
  |  Branch (144:7): [True: 0, False: 4.19k]
  ------------------
  145|  4.19k|  param[0] = index;
  146|  4.19k|  fac_gain = (FLOAT32)pow(10.0f, ((FLOAT32)index) / 28.0f);
  147|   515k|  for (i = 0; i < fac_len; i++) right_fac_spec[i] /= fac_gain;
  ------------------
  |  Branch (147:15): [True: 511k, False: 4.19k]
  ------------------
  148|       |
  149|  68.0k|  for (i = 0; i < fac_len; i += 8) {
  ------------------
  |  Branch (149:15): [True: 63.8k, False: 4.19k]
  ------------------
  150|  63.8k|    iusace_find_nearest_neighbor(&right_fac_spec[i], &param[i + 1]);
  151|  63.8k|  }
  152|       |
  153|  4.19k|  iusace_write_bits2buf(index, 7, fac_bits_word);
  154|  4.19k|  num_enc_bits += 7;
  155|  4.19k|  num_enc_bits += iusace_fd_encode_fac(&param[1], &fac_bits_word[7], fac_len);
  156|  4.19k|  iusace_decode_fd_fac(&param[0], len_subfrm, fac_len, ptr_lpc_coeffs, NULL, fac_dec,
  157|  4.19k|                       pstr_scratch);
  158|  4.19k|  *num_fac_bits = num_enc_bits;
  159|       |
  160|   515k|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (160:15): [True: 511k, False: 4.19k]
  ------------------
  161|   511k|    synth[start_right + i] += fac_dec[i];
  162|   511k|  }
  163|  4.19k|  return;
  164|  4.19k|}
iusace_fd_fac:
  170|   427k|                           iusace_scratch_mem *pstr_scratch) {
  171|   427k|  const FLOAT32 *sin_window = NULL;
  172|   427k|  LOOPIDX i;
  173|   427k|  FLOAT32 *zir_sig = NULL;
  174|   427k|  FLOAT32 *lpc_coeffs_q = NULL;
  175|   427k|  WORD32 index;
  176|   427k|  WORD32 low_pass_line = 0;
  177|   427k|  WORD32 fac_len;
  178|   427k|  FLOAT64 *left_fac_time_data = pstr_scratch->p_left_fac_time_data;
  179|   427k|  FLOAT32 *left_fac_timedata_flt = pstr_scratch->p_left_fac_timedata_flt;
  180|   427k|  FLOAT32 *left_fac_spec = pstr_scratch->p_left_fac_spec;
  181|   427k|  FLOAT64 *fac_win = pstr_scratch->p_fac_win;
  182|   427k|  WORD32 *fac_prm = pstr_scratch->p_fac_prm;
  183|   427k|  WORD16 *fac_bits_word = pstr_scratch->p_fac_bits_word;
  184|   427k|  FLOAT32 *acelp_folded = pstr_scratch->p_acelp_folded_scratch;
  185|       |
  186|   427k|  *num_fac_bits = 0;
  187|       |
  188|   427k|  if (last_subfr_was_acelp || next_frm_lpd)
  ------------------
  |  Branch (188:7): [True: 1.75k, False: 425k]
  |  Branch (188:31): [True: 3.94k, False: 422k]
  ------------------
  189|  5.70k|  {
  190|  5.70k|    if (window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   40|  5.70k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (190:9): [True: 1.96k, False: 3.74k]
  ------------------
  191|  1.96k|      fac_len = (pstr_acelp->len_frame / 16);
  192|  3.74k|    else
  193|  3.74k|      fac_len = (pstr_acelp->len_frame / 8);
  194|       |
  195|  5.70k|    low_pass_line = (WORD32)(sfb_offsets[sfb_active] * fac_len /
  196|  5.70k|      (FLOAT32)pstr_acelp->len_frame);
  197|  5.70k|  }
  198|       |
  199|   427k|  if (last_subfr_was_acelp) {
  ------------------
  |  Branch (199:7): [True: 1.75k, False: 425k]
  ------------------
  200|  1.75k|    FLOAT32 *tmp_lp_res = pstr_scratch->ptr_tmp_lp_res;
  201|  1.75k|    FLOAT32 lpc_coeffs[ORDER + 1];
  202|  1.75k|    FLOAT32 ener, fac_gain;
  203|  1.75k|    WORD32 left_start;
  204|       |
  205|  1.75k|    switch (fac_len) {
  206|     62|      case 48:
  ------------------
  |  Branch (206:7): [True: 62, False: 1.69k]
  ------------------
  207|     62|        sin_window = iusace_sin_window_96;
  208|     62|        break;
  209|    920|      case 64:
  ------------------
  |  Branch (209:7): [True: 920, False: 833]
  ------------------
  210|    920|        sin_window = iusace_sin_window_128;
  211|    920|        break;
  212|    148|      case 96:
  ------------------
  |  Branch (212:7): [True: 148, False: 1.60k]
  ------------------
  213|    148|        sin_window = iusace_sin_window_192;
  214|    148|        break;
  215|    623|      case 128:
  ------------------
  |  Branch (215:7): [True: 623, False: 1.13k]
  ------------------
  216|    623|        sin_window = iusace_sin_window_256;
  217|    623|        break;
  218|      0|      default:
  ------------------
  |  Branch (218:7): [True: 0, False: 1.75k]
  ------------------
  219|      0|        return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_FAC_LEN;
  220|  1.75k|    }
  221|       |
  222|   157k|    for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (222:17): [True: 155k, False: 1.75k]
  ------------------
  223|   155k|      fac_win[i] = sin_window[i] * sin_window[(2 * fac_len) - 1 - i];
  224|   155k|      fac_win[fac_len + i] = 1.0f - (sin_window[fac_len + i] * sin_window[fac_len + i]);
  225|   155k|    }
  226|       |
  227|  1.75k|    left_start = (pstr_acelp->len_frame / 2) - fac_len - ORDER;
  ------------------
  |  |   71|  1.75k|#define ORDER (16)
  ------------------
  228|       |
  229|   341k|    for (i = 0; i < 2 * fac_len + ORDER; i++) {
  ------------------
  |  |   71|   341k|#define ORDER (16)
  ------------------
  |  Branch (229:17): [True: 339k, False: 1.75k]
  ------------------
  230|   339k|      left_fac_time_data[i] = orig_sig_dbl[left_start + i];
  231|   339k|    }
  232|       |
  233|   157k|    for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (233:17): [True: 155k, False: 1.75k]
  ------------------
  234|   155k|      left_fac_time_data[fac_len + ORDER + i] =
  ------------------
  |  |   71|   155k|#define ORDER (16)
  ------------------
  235|   155k|          left_fac_time_data[fac_len + ORDER + i] - synth_time[left_start + fac_len + ORDER + i];
  ------------------
  |  |   71|   155k|#define ORDER (16)
  ------------------
                        left_fac_time_data[fac_len + ORDER + i] - synth_time[left_start + fac_len + ORDER + i];
  ------------------
  |  |   71|   155k|#define ORDER (16)
  ------------------
  236|   155k|    }
  237|       |
  238|  1.75k|    zir_sig = pstr_acelp->lpd_state.tcx_quant;
  239|       |
  240|  29.8k|    for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  29.8k|#define ORDER (16)
  ------------------
  |  Branch (240:17): [True: 28.0k, False: 1.75k]
  ------------------
  241|  28.0k|      left_fac_time_data[fac_len + i] =
  242|  28.0k|          left_fac_time_data[fac_len + i] - zir_sig[1 + 128 - ORDER + i];
  ------------------
  |  |   71|  28.0k|#define ORDER (16)
  ------------------
  243|  28.0k|    }
  244|       |
  245|   157k|    for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (245:17): [True: 155k, False: 1.75k]
  ------------------
  246|   155k|      acelp_folded[i] = zir_sig[1 + 128 + i] * (FLOAT32)fac_win[fac_len + i] +
  247|   155k|                        zir_sig[1 + 128 - 1 - i] * (FLOAT32)fac_win[fac_len - 1 - i];
  248|   155k|    }
  249|       |
  250|  1.75k|    {
  251|  1.75k|      FLOAT32 ener_tmp;
  252|  1.75k|      ener = 0.0f;
  253|  1.75k|      ener_tmp = 0.0f;
  254|       |
  255|   157k|      for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (255:19): [True: 155k, False: 1.75k]
  ------------------
  256|   155k|        ener += (FLOAT32)(left_fac_time_data[i + ORDER + fac_len] *
  ------------------
  |  |   71|   155k|#define ORDER (16)
  ------------------
  257|   155k|                          left_fac_time_data[i + ORDER + fac_len]);
  ------------------
  |  |   71|   155k|#define ORDER (16)
  ------------------
  258|   155k|      }
  259|  1.75k|      ener *= 2.0f;
  260|       |
  261|   157k|      for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (261:19): [True: 155k, False: 1.75k]
  ------------------
  262|   155k|        ener_tmp += acelp_folded[i] * acelp_folded[i];
  263|   155k|      }
  264|       |
  265|  1.75k|      if (ener_tmp > ener)
  ------------------
  |  Branch (265:11): [True: 16, False: 1.73k]
  ------------------
  266|     16|        fac_gain = (FLOAT32)sqrt(ener / ener_tmp);
  267|  1.73k|      else
  268|  1.73k|        fac_gain = 1.0f;
  269|       |
  270|   157k|      for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (270:19): [True: 155k, False: 1.75k]
  ------------------
  271|   155k|        left_fac_time_data[i + ORDER + fac_len] -= fac_gain * acelp_folded[i];
  ------------------
  |  |   71|   155k|#define ORDER (16)
  ------------------
  272|   155k|      }
  273|  1.75k|    }
  274|       |
  275|   341k|    for (i = 0; i < 2 * fac_len + ORDER; i++) {
  ------------------
  |  |   71|   341k|#define ORDER (16)
  ------------------
  |  Branch (275:17): [True: 339k, False: 1.75k]
  ------------------
  276|   339k|      left_fac_timedata_flt[i] = (FLOAT32)left_fac_time_data[i];
  277|   339k|    }
  278|       |
  279|  1.75k|    lpc_coeffs_q = pstr_acelp->lpd_state.lpc_coeffs_quant;
  280|  1.75k|    lpc_coeffs_q += ORDER + 1;
  ------------------
  |  |   71|  1.75k|#define ORDER (16)
  ------------------
  281|  1.75k|    iusace_get_weighted_lpc(lpc_coeffs_q, lpc_coeffs);
  282|  1.75k|    iusace_compute_lp_residual(lpc_coeffs, left_fac_timedata_flt + ORDER + fac_len, tmp_lp_res,
  ------------------
  |  |   71|  1.75k|#define ORDER (16)
  ------------------
  283|  1.75k|                               fac_len);
  284|  1.75k|    FLOAT32 coeff = (2.0f / (FLOAT32)fac_len);
  285|   157k|    for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (285:17): [True: 155k, False: 1.75k]
  ------------------
  286|   155k|      tmp_lp_res[i] = tmp_lp_res[i] * coeff;
  287|   155k|    }
  288|       |
  289|  1.75k|    iusace_tcx_mdct(tmp_lp_res, left_fac_spec, fac_len, pstr_scratch);
  290|  1.75k|    memset(&left_fac_spec[low_pass_line], 0, (fac_len - low_pass_line) * sizeof(FLOAT32));
  291|       |
  292|  1.75k|    fac_gain = iusace_calc_sq_gain(left_fac_spec, 240, fac_len, pstr_scratch->p_sq_gain_en);
  293|       |
  294|  1.75k|    index = (WORD32)floor(0.5f + (28.0f * (FLOAT32)log10(fac_gain)));
  295|  1.75k|    if (index < 0) index = 0;
  ------------------
  |  Branch (295:9): [True: 0, False: 1.75k]
  ------------------
  296|  1.75k|    if (index > 127) index = 127;
  ------------------
  |  Branch (296:9): [True: 0, False: 1.75k]
  ------------------
  297|  1.75k|    iusace_write_bits2buf(index, 7, fac_bits_word);
  298|  1.75k|    *num_fac_bits += 7;
  299|  1.75k|    fac_gain = (FLOAT32)pow(10.0f, ((FLOAT32)index) / 28.0f);
  300|       |
  301|   157k|    for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (301:17): [True: 155k, False: 1.75k]
  ------------------
  302|   155k|      left_fac_spec[i] /= fac_gain;
  303|   155k|    }
  304|       |
  305|  21.2k|    for (i = 0; i < fac_len; i += 8) {
  ------------------
  |  Branch (305:17): [True: 19.4k, False: 1.75k]
  ------------------
  306|  19.4k|      iusace_find_nearest_neighbor(&left_fac_spec[i], &fac_prm[i]);
  307|  19.4k|    }
  308|       |
  309|  1.75k|    *num_fac_bits += iusace_fd_encode_fac(fac_prm, &fac_bits_word[7], fac_len);
  310|       |
  311|  40.2k|    for (i = 0; i < (*num_fac_bits + 7) / 8; i++) {
  ------------------
  |  Branch (311:17): [True: 38.4k, False: 1.75k]
  ------------------
  312|  38.4k|      fac_prm_out[i] =
  313|  38.4k|          (WORD16)((fac_bits_word[8 * i + 0] & 0x1) << 7 | (fac_bits_word[8 * i + 1] & 0x1) << 6 |
  314|  38.4k|                   (fac_bits_word[8 * i + 2] & 0x1) << 5 | (fac_bits_word[8 * i + 3] & 0x1) << 4 |
  315|  38.4k|                   (fac_bits_word[8 * i + 4] & 0x1) << 3 | (fac_bits_word[8 * i + 5] & 0x1) << 2 |
  316|  38.4k|                   (fac_bits_word[8 * i + 6] & 0x1) << 1 | (fac_bits_word[8 * i + 7] & 0x1) << 0);
  317|  38.4k|    }
  318|   425k|  } else {
  319|   425k|    *num_fac_bits = 0;
  320|   425k|  }
  321|       |
  322|   427k|  if (next_frm_lpd) {
  ------------------
  |  Branch (322:7): [True: 4.21k, False: 423k]
  ------------------
  323|  2.23M|    for (i = 0; i < 1024 / 2 + 1 + ORDER; i++) {
  ------------------
  |  |   71|  2.23M|#define ORDER (16)
  ------------------
  |  Branch (323:17): [True: 2.22M, False: 4.21k]
  ------------------
  324|  2.22M|      pstr_acelp->fd_synth[i] = (FLOAT32)synth_time[pstr_acelp->len_frame - 1 + i - ORDER];
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  325|  2.22M|      pstr_acelp->fd_orig[i] = (FLOAT32)orig_sig_dbl[pstr_acelp->len_frame + i - ORDER];
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  326|  2.22M|    }
  327|       |
  328|  4.21k|    pstr_acelp->low_pass_line = low_pass_line;
  329|  4.21k|  }
  330|       |
  331|   427k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   427k|#define IA_NO_ERROR 0x00000000
  ------------------
  332|   427k|}
iusace_fd_fac.c:iusace_decode_fd_fac:
   63|  4.19k|                                 iusace_scratch_mem *pstr_scratch) {
   64|  4.19k|  FLOAT32 *x = pstr_scratch->p_x;
   65|  4.19k|  FLOAT32 *xn2 = pstr_scratch->p_xn_2;
   66|  4.19k|  FLOAT32 fac_gain;
   67|  4.19k|  WORD32 i;
   68|  4.19k|  const FLOAT32 *sin_window;
   69|  4.19k|  FLOAT32 *fac_window = pstr_scratch->p_fac_window;
   70|  4.19k|  FLOAT32 ap[ORDER + 1];
   71|       |
   72|  4.19k|  if (fac_len == 64) {
  ------------------
  |  Branch (72:7): [True: 0, False: 4.19k]
  ------------------
   73|      0|    sin_window = iusace_sin_window_128;
   74|  4.19k|  } else {
   75|  4.19k|    sin_window = iusace_sin_window_256;
   76|  4.19k|  }
   77|       |
   78|  4.19k|  if (ptr_lpc_coeffs != NULL && ptr_fac_dec != NULL) {
  ------------------
  |  Branch (78:7): [True: 4.19k, False: 0]
  |  Branch (78:33): [True: 4.19k, False: 0]
  ------------------
   79|  4.19k|    fac_gain = (FLOAT32)pow(10.0f, ((FLOAT32)ptr_fac_prms[0]) / 28.0f);
   80|   515k|    for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (80:17): [True: 511k, False: 4.19k]
  ------------------
   81|   511k|      x[i] = (FLOAT32)ptr_fac_prms[i + 1] * fac_gain;
   82|   511k|    }
   83|       |
   84|  4.19k|    iusace_tcx_mdct(x, xn2, fac_len, pstr_scratch);
   85|       |
   86|  4.19k|    iusace_get_weighted_lpc(ptr_lpc_coeffs, ap);
   87|       |
   88|  4.19k|    memset(xn2 + fac_len, 0, fac_len * sizeof(FLOAT32));
   89|  4.19k|    iusace_synthesis_tool_float(ap, xn2, ptr_fac_dec, 2 * fac_len, xn2 + fac_len,
   90|  4.19k|                                pstr_scratch->p_buf_synthesis_tool);
   91|       |
   92|  4.19k|    if (zir_sig != NULL) {
  ------------------
  |  Branch (92:9): [True: 0, False: 4.19k]
  ------------------
   93|      0|      for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (93:19): [True: 0, False: 0]
  ------------------
   94|      0|        fac_window[i] = sin_window[i] * sin_window[(2 * fac_len) - 1 - i];
   95|      0|        fac_window[fac_len + i] = 1.0f - (sin_window[fac_len + i] * sin_window[fac_len + i]);
   96|      0|      }
   97|      0|      for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (97:19): [True: 0, False: 0]
  ------------------
   98|      0|        ptr_fac_dec[i] += zir_sig[1 + (len_subfrm / 2) + i] * fac_window[fac_len + i] +
   99|      0|                          zir_sig[1 + (len_subfrm / 2) - 1 - i] * fac_window[fac_len - 1 - i];
  100|      0|      }
  101|      0|    }
  102|  4.19k|  }
  103|       |
  104|  4.19k|  return;
  105|  4.19k|}

iusace_complex_fft_p2:
  116|  22.7M|VOID iusace_complex_fft_p2(FLOAT32 *ptr_x, WORD32 nlength, FLOAT32 *scratch_fft_p2_y) {
  117|  22.7M|  WORD32 i, j, k, n_stages, h2;
  118|  22.7M|  FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  119|  22.7M|  FLOAT32 tmp;
  120|  22.7M|  WORD32 del, nodespacing, in_loop_cnt;
  121|  22.7M|  WORD32 not_power_4;
  122|  22.7M|  WORD32 dig_rev_shift;
  123|  22.7M|  FLOAT32 *y = scratch_fft_p2_y;
  124|  22.7M|  WORD32 mpass = nlength;
  125|  22.7M|  WORD32 npoints = nlength;
  126|  22.7M|  FLOAT32 *ptr_y = y;
  127|  22.7M|  const FLOAT64 *ptr_w;
  128|       |
  129|  22.7M|  dig_rev_shift = iusace_calc_norm(mpass) + 1 - 16;
  130|  22.7M|  n_stages = 30 - iusace_calc_norm(mpass);
  131|  22.7M|  not_power_4 = n_stages & 1;
  132|       |
  133|  22.7M|  n_stages = n_stages >> 1;
  134|       |
  135|  22.7M|  ptr_w = iusace_twiddle_table_fft_32x32;
  136|       |
  137|  22.7M|  if (dig_rev_shift < 0) {
  ------------------
  |  Branch (137:7): [True: 0, False: 22.7M]
  ------------------
  138|      0|    dig_rev_shift = 0;
  139|      0|  }
  140|       |
  141|   474M|  for (i = 0; i < npoints; i += 4) {
  ------------------
  |  Branch (141:15): [True: 452M, False: 22.7M]
  ------------------
  142|   452M|    FLOAT32 *inp = ptr_x;
  143|   452M|    FLOAT32 tmk;
  144|       |
  145|   452M|    DIG_REV(i, dig_rev_shift, h2);
  ------------------
  |  |   52|   452M|  do {                                                      \
  |  |   53|   452M|    unsigned _ = (i);                                       \
  |  |   54|   452M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   55|   452M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   56|   452M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   57|   452M|    (j) = _ >> (m);                                         \
  |  |   58|   452M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 452M]
  |  |  ------------------
  ------------------
  146|   452M|    if (not_power_4) {
  ------------------
  |  Branch (146:9): [True: 210M, False: 241M]
  ------------------
  147|   210M|      h2 += 1;
  148|   210M|      h2 &= ~1;
  149|   210M|    }
  150|   452M|    inp += (h2);
  151|       |
  152|   452M|    x0r = *inp;
  153|   452M|    x0i = *(inp + 1);
  154|   452M|    inp += (npoints >> 1);
  155|       |
  156|   452M|    x1r = *inp;
  157|   452M|    x1i = *(inp + 1);
  158|   452M|    inp += (npoints >> 1);
  159|       |
  160|   452M|    x2r = *inp;
  161|   452M|    x2i = *(inp + 1);
  162|   452M|    inp += (npoints >> 1);
  163|       |
  164|   452M|    x3r = *inp;
  165|   452M|    x3i = *(inp + 1);
  166|       |
  167|   452M|    x0r = x0r + x2r;
  168|   452M|    x0i = x0i + x2i;
  169|       |
  170|   452M|    tmk = x0r - x2r;
  171|   452M|    x2r = tmk - x2r;
  172|   452M|    tmk = x0i - x2i;
  173|   452M|    x2i = tmk - x2i;
  174|       |
  175|   452M|    x1r = x1r + x3r;
  176|   452M|    x1i = x1i + x3i;
  177|       |
  178|   452M|    tmk = x1r - x3r;
  179|   452M|    x3r = tmk - x3r;
  180|   452M|    tmk = x1i - x3i;
  181|   452M|    x3i = tmk - x3i;
  182|       |
  183|   452M|    x0r = x0r + x1r;
  184|   452M|    x0i = x0i + x1i;
  185|       |
  186|   452M|    tmk = x0r - x1r;
  187|   452M|    x1r = tmk - x1r;
  188|   452M|    tmk = x0i - x1i;
  189|   452M|    x1i = tmk - x1i;
  190|       |
  191|   452M|    x2r = x2r + x3i;
  192|   452M|    x2i = x2i - x3r;
  193|       |
  194|   452M|    tmk = x2r - x3i;
  195|   452M|    x3i = tmk - x3i;
  196|   452M|    tmk = x2i + x3r;
  197|   452M|    x3r = tmk + x3r;
  198|       |
  199|   452M|    *ptr_y++ = x0r;
  200|   452M|    *ptr_y++ = x0i;
  201|   452M|    *ptr_y++ = x2r;
  202|   452M|    *ptr_y++ = x2i;
  203|   452M|    *ptr_y++ = x1r;
  204|   452M|    *ptr_y++ = x1i;
  205|   452M|    *ptr_y++ = x3i;
  206|   452M|    *ptr_y++ = x3r;
  207|   452M|  }
  208|  22.7M|  ptr_y -= 2 * npoints;
  209|  22.7M|  del = 4;
  210|  22.7M|  nodespacing = 64;
  211|  22.7M|  in_loop_cnt = npoints >> 4;
  212|  50.5M|  for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (212:26): [True: 27.8M, False: 22.7M]
  ------------------
  213|  27.8M|    const FLOAT64 *twiddles = ptr_w;
  214|  27.8M|    FLOAT32 *data = ptr_y;
  215|  27.8M|    FLOAT64 w_1, w_2, w_3, w_4, w_5, w_6;
  216|  27.8M|    WORD32 sec_loop_cnt;
  217|       |
  218|   167M|    for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (218:27): [True: 139M, False: 27.8M]
  ------------------
  219|   139M|      x0r = (*data);
  220|   139M|      x0i = (*(data + 1));
  221|   139M|      data += ((SIZE_T)del << 1);
  222|       |
  223|   139M|      x1r = (*data);
  224|   139M|      x1i = (*(data + 1));
  225|   139M|      data += ((SIZE_T)del << 1);
  226|       |
  227|   139M|      x2r = (*data);
  228|   139M|      x2i = (*(data + 1));
  229|   139M|      data += ((SIZE_T)del << 1);
  230|       |
  231|   139M|      x3r = (*data);
  232|   139M|      x3i = (*(data + 1));
  233|   139M|      data -= 3 * (del << 1);
  234|       |
  235|   139M|      x0r = x0r + x2r;
  236|   139M|      x0i = x0i + x2i;
  237|   139M|      x2r = x0r - (x2r * 2);
  238|   139M|      x2i = x0i - (x2i * 2);
  239|   139M|      x1r = x1r + x3r;
  240|   139M|      x1i = x1i + x3i;
  241|   139M|      x3r = x1r - (x3r * 2);
  242|   139M|      x3i = x1i - (x3i * 2);
  243|       |
  244|   139M|      x0r = x0r + x1r;
  245|   139M|      x0i = x0i + x1i;
  246|   139M|      x1r = x0r - (x1r * 2);
  247|   139M|      x1i = x0i - (x1i * 2);
  248|   139M|      x2r = x2r + x3i;
  249|   139M|      x2i = x2i - x3r;
  250|   139M|      x3i = x2r - (x3i * 2);
  251|   139M|      x3r = x2i + (x3r * 2);
  252|       |
  253|   139M|      *data = x0r;
  254|   139M|      *(data + 1) = x0i;
  255|   139M|      data += ((SIZE_T)del << 1);
  256|       |
  257|   139M|      *data = x2r;
  258|   139M|      *(data + 1) = x2i;
  259|   139M|      data += ((SIZE_T)del << 1);
  260|       |
  261|   139M|      *data = x1r;
  262|   139M|      *(data + 1) = x1i;
  263|   139M|      data += ((SIZE_T)del << 1);
  264|       |
  265|   139M|      *data = x3i;
  266|   139M|      *(data + 1) = x3r;
  267|   139M|      data += ((SIZE_T)del << 1);
  268|   139M|    }
  269|  27.8M|    data = ptr_y + 2;
  270|       |
  271|  27.8M|    sec_loop_cnt = (nodespacing * del);
  272|  27.8M|    sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
  273|  27.8M|                   (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
  274|  27.8M|                   (sec_loop_cnt / 256);
  275|       |
  276|   162M|    for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (276:27): [True: 134M, False: 27.8M]
  ------------------
  277|   134M|      w_1 = *(twiddles + j);
  278|   134M|      w_4 = *(twiddles + j + 257);
  279|   134M|      w_2 = *(twiddles + ((SIZE_T)j << 1));
  280|   134M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 257);
  281|   134M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1));
  282|   134M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) + 257);
  283|       |
  284|   487M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (284:29): [True: 352M, False: 134M]
  ------------------
  285|   352M|        data += ((SIZE_T)del << 1);
  286|       |
  287|   352M|        x1r = *data;
  288|   352M|        x1i = *(data + 1);
  289|   352M|        data += ((SIZE_T)del << 1);
  290|       |
  291|   352M|        x2r = *data;
  292|   352M|        x2i = *(data + 1);
  293|   352M|        data += ((SIZE_T)del << 1);
  294|       |
  295|   352M|        x3r = *data;
  296|   352M|        x3i = *(data + 1);
  297|   352M|        data -= 3 * (del << 1);
  298|       |
  299|   352M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_1) - ixheaace_dmult((FLOAT64)x1i, w_4));
  300|   352M|        x1i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r, w_4), (FLOAT64)x1i, w_1);
  301|   352M|        x1r = tmp;
  302|       |
  303|   352M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2r, w_2) - ixheaace_dmult((FLOAT64)x2i, w_5));
  304|   352M|        x2i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x2r, w_5), (FLOAT64)x2i, w_2);
  305|   352M|        x2r = tmp;
  306|       |
  307|   352M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x3r, w_3) - ixheaace_dmult((FLOAT64)x3i, w_6));
  308|   352M|        x3i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x3r, w_6), (FLOAT64)x3i, w_3);
  309|   352M|        x3r = tmp;
  310|       |
  311|   352M|        x0r = (*data);
  312|   352M|        x0i = (*(data + 1));
  313|       |
  314|   352M|        x0r = x0r + (x2r);
  315|   352M|        x0i = x0i + (x2i);
  316|   352M|        x2r = x0r - (x2r * 2);
  317|   352M|        x2i = x0i - (x2i * 2);
  318|   352M|        x1r = x1r + x3r;
  319|   352M|        x1i = x1i + x3i;
  320|   352M|        x3r = x1r - (x3r * 2);
  321|   352M|        x3i = x1i - (x3i * 2);
  322|       |
  323|   352M|        x0r = x0r + (x1r);
  324|   352M|        x0i = x0i + (x1i);
  325|   352M|        x1r = x0r - (x1r * 2);
  326|   352M|        x1i = x0i - (x1i * 2);
  327|   352M|        x2r = x2r + (x3i);
  328|   352M|        x2i = x2i - (x3r);
  329|   352M|        x3i = x2r - (x3i * 2);
  330|   352M|        x3r = x2i + (x3r * 2);
  331|       |
  332|   352M|        *data = x0r;
  333|   352M|        *(data + 1) = x0i;
  334|   352M|        data += ((SIZE_T)del << 1);
  335|       |
  336|   352M|        *data = x2r;
  337|   352M|        *(data + 1) = x2i;
  338|   352M|        data += ((SIZE_T)del << 1);
  339|       |
  340|   352M|        *data = x1r;
  341|   352M|        *(data + 1) = x1i;
  342|   352M|        data += ((SIZE_T)del << 1);
  343|       |
  344|   352M|        *data = x3i;
  345|   352M|        *(data + 1) = x3r;
  346|   352M|        data += ((SIZE_T)del << 1);
  347|   352M|      }
  348|   134M|      data -= 2 * npoints;
  349|   134M|      data += 2;
  350|   134M|    }
  351|   109M|    for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (351:12): [True: 81.2M, False: 27.8M]
  ------------------
  352|  81.2M|      w_1 = *(twiddles + j);
  353|  81.2M|      w_4 = *(twiddles + j + 257);
  354|  81.2M|      w_2 = *(twiddles + ((SIZE_T)j << 1));
  355|  81.2M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 257);
  356|  81.2M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
  357|  81.2M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
  358|       |
  359|   327M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (359:29): [True: 246M, False: 81.2M]
  ------------------
  360|   246M|        data += ((SIZE_T)del << 1);
  361|       |
  362|   246M|        x1r = *data;
  363|   246M|        x1i = *(data + 1);
  364|   246M|        data += ((SIZE_T)del << 1);
  365|       |
  366|   246M|        x2r = *data;
  367|   246M|        x2i = *(data + 1);
  368|   246M|        data += ((SIZE_T)del << 1);
  369|       |
  370|   246M|        x3r = *data;
  371|   246M|        x3i = *(data + 1);
  372|   246M|        data -= 3 * (del << 1);
  373|       |
  374|   246M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_1) - ixheaace_dmult((FLOAT64)x1i, w_4));
  375|   246M|        x1i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r, w_4), (FLOAT64)x1i, w_1);
  376|   246M|        x1r = tmp;
  377|       |
  378|   246M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2r, w_2) - ixheaace_dmult((FLOAT64)x2i, w_5));
  379|   246M|        x2i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x2r, w_5), (FLOAT64)x2i, w_2);
  380|   246M|        x2r = tmp;
  381|       |
  382|   246M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x3r, w_6) + ixheaace_dmult((FLOAT64)x3i, w_3));
  383|   246M|        x3i = (FLOAT32)(-ixheaace_dmult((FLOAT64)x3r, w_3) + ixheaace_dmult((FLOAT64)x3i, w_6));
  384|   246M|        x3r = tmp;
  385|       |
  386|   246M|        x0r = (*data);
  387|   246M|        x0i = (*(data + 1));
  388|       |
  389|   246M|        x0r = x0r + (x2r);
  390|   246M|        x0i = x0i + (x2i);
  391|   246M|        x2r = x0r - (x2r * 2);
  392|   246M|        x2i = x0i - (x2i * 2);
  393|   246M|        x1r = x1r + x3r;
  394|   246M|        x1i = x1i + x3i;
  395|   246M|        x3r = x1r - (x3r * 2);
  396|   246M|        x3i = x1i - (x3i * 2);
  397|       |
  398|   246M|        x0r = x0r + (x1r);
  399|   246M|        x0i = x0i + (x1i);
  400|   246M|        x1r = x0r - (x1r * 2);
  401|   246M|        x1i = x0i - (x1i * 2);
  402|   246M|        x2r = x2r + (x3i);
  403|   246M|        x2i = x2i - (x3r);
  404|   246M|        x3i = x2r - (x3i * 2);
  405|   246M|        x3r = x2i + (x3r * 2);
  406|       |
  407|   246M|        *data = x0r;
  408|   246M|        *(data + 1) = x0i;
  409|   246M|        data += ((SIZE_T)del << 1);
  410|       |
  411|   246M|        *data = x2r;
  412|   246M|        *(data + 1) = x2i;
  413|   246M|        data += ((SIZE_T)del << 1);
  414|       |
  415|   246M|        *data = x1r;
  416|   246M|        *(data + 1) = x1i;
  417|   246M|        data += ((SIZE_T)del << 1);
  418|       |
  419|   246M|        *data = x3i;
  420|   246M|        *(data + 1) = x3r;
  421|   246M|        data += ((SIZE_T)del << 1);
  422|   246M|      }
  423|  81.2M|      data -= 2 * npoints;
  424|  81.2M|      data += 2;
  425|  81.2M|    }
  426|  81.2M|    for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (426:12): [True: 53.4M, False: 27.8M]
  ------------------
  427|  53.4M|      w_1 = *(twiddles + j);
  428|  53.4M|      w_4 = *(twiddles + j + 257);
  429|  53.4M|      w_2 = *(twiddles + ((SIZE_T)j << 1) - 256);
  430|  53.4M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 1);
  431|  53.4M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
  432|  53.4M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
  433|       |
  434|   160M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (434:29): [True: 106M, False: 53.4M]
  ------------------
  435|   106M|        data += ((SIZE_T)del << 1);
  436|       |
  437|   106M|        x1r = *data;
  438|   106M|        x1i = *(data + 1);
  439|   106M|        data += ((SIZE_T)del << 1);
  440|       |
  441|   106M|        x2r = *data;
  442|   106M|        x2i = *(data + 1);
  443|   106M|        data += ((SIZE_T)del << 1);
  444|       |
  445|   106M|        x3r = *data;
  446|   106M|        x3i = *(data + 1);
  447|   106M|        data -= 3 * (del << 1);
  448|       |
  449|   106M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_1) - ixheaace_dmult((FLOAT64)x1i, w_4));
  450|   106M|        x1i = (FLOAT32)ixheaace_dmac(ixheaace_dmult(x1r, w_4), x1i, w_1);
  451|   106M|        x1r = tmp;
  452|       |
  453|   106M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2r, w_5) + ixheaace_dmult((FLOAT64)x2i, w_2));
  454|   106M|        x2i = (FLOAT32)(-ixheaace_dmult(x2r, w_2) + ixheaace_dmult(x2i, w_5));
  455|   106M|        x2r = tmp;
  456|       |
  457|   106M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x3r, w_6) + ixheaace_dmult((FLOAT64)x3i, w_3));
  458|   106M|        x3i = (FLOAT32)(-ixheaace_dmult((FLOAT64)x3r, w_3) + ixheaace_dmult((FLOAT64)x3i, w_6));
  459|   106M|        x3r = tmp;
  460|       |
  461|   106M|        x0r = (*data);
  462|   106M|        x0i = (*(data + 1));
  463|       |
  464|   106M|        x0r = x0r + (x2r);
  465|   106M|        x0i = x0i + (x2i);
  466|   106M|        x2r = x0r - (x2r * 2);
  467|   106M|        x2i = x0i - (x2i * 2);
  468|   106M|        x1r = x1r + x3r;
  469|   106M|        x1i = x1i + x3i;
  470|   106M|        x3r = x1r - (x3r * 2);
  471|   106M|        x3i = x1i - (x3i * 2);
  472|       |
  473|   106M|        x0r = x0r + (x1r);
  474|   106M|        x0i = x0i + (x1i);
  475|   106M|        x1r = x0r - (x1r * 2);
  476|   106M|        x1i = x0i - (x1i * 2);
  477|   106M|        x2r = x2r + (x3i);
  478|   106M|        x2i = x2i - (x3r);
  479|   106M|        x3i = x2r - (x3i * 2);
  480|   106M|        x3r = x2i + (x3r * 2);
  481|       |
  482|   106M|        *data = x0r;
  483|   106M|        *(data + 1) = x0i;
  484|   106M|        data += ((SIZE_T)del << 1);
  485|       |
  486|   106M|        *data = x2r;
  487|   106M|        *(data + 1) = x2i;
  488|   106M|        data += ((SIZE_T)del << 1);
  489|       |
  490|   106M|        *data = x1r;
  491|   106M|        *(data + 1) = x1i;
  492|   106M|        data += ((SIZE_T)del << 1);
  493|       |
  494|   106M|        *data = x3i;
  495|   106M|        *(data + 1) = x3r;
  496|   106M|        data += ((SIZE_T)del << 1);
  497|   106M|      }
  498|  53.4M|      data -= 2 * npoints;
  499|  53.4M|      data += 2;
  500|  53.4M|    }
  501|   162M|    for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (501:12): [True: 134M, False: 27.8M]
  ------------------
  502|   134M|      w_1 = *(twiddles + j);
  503|   134M|      w_4 = *(twiddles + j + 257);
  504|   134M|      w_2 = *(twiddles + ((SIZE_T)j << 1) - 256);
  505|   134M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 1);
  506|   134M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1) - 512);
  507|   134M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) - 512 + 257);
  508|       |
  509|   487M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (509:29): [True: 352M, False: 134M]
  ------------------
  510|   352M|        data += ((SIZE_T)del << 1);
  511|       |
  512|   352M|        x1r = *data;
  513|   352M|        x1i = *(data + 1);
  514|   352M|        data += ((SIZE_T)del << 1);
  515|       |
  516|   352M|        x2r = *data;
  517|   352M|        x2i = *(data + 1);
  518|   352M|        data += ((SIZE_T)del << 1);
  519|       |
  520|   352M|        x3r = *data;
  521|   352M|        x3i = *(data + 1);
  522|   352M|        data -= 3 * ((SIZE_T)del << 1);
  523|       |
  524|   352M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_1) - ixheaace_dmult((FLOAT64)x1i, w_4));
  525|   352M|        x1i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r, w_4), (FLOAT64)x1i, w_1);
  526|   352M|        x1r = tmp;
  527|       |
  528|   352M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2r, w_5) + ixheaace_dmult((FLOAT64)x2i, w_2));
  529|   352M|        x2i = (FLOAT32)(-ixheaace_dmult((FLOAT64)x2r, w_2) + ixheaace_dmult((FLOAT64)x2i, w_5));
  530|   352M|        x2r = tmp;
  531|       |
  532|   352M|        tmp = (FLOAT32)(-ixheaace_dmult((FLOAT64)x3r, w_3) + ixheaace_dmult((FLOAT64)x3i, w_6));
  533|   352M|        x3i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x3r, w_6), (FLOAT64)x3i, w_3);
  534|   352M|        x3r = tmp;
  535|       |
  536|   352M|        x0r = (*data);
  537|   352M|        x0i = (*(data + 1));
  538|       |
  539|   352M|        x0r = x0r + (x2r);
  540|   352M|        x0i = x0i + (x2i);
  541|   352M|        x2r = x0r - (x2r * 2);
  542|   352M|        x2i = x0i - (x2i * 2);
  543|   352M|        x1r = x1r + x3r;
  544|   352M|        x1i = x1i - x3i;
  545|   352M|        x3r = x1r - (x3r * 2);
  546|   352M|        x3i = x1i + (x3i * 2);
  547|       |
  548|   352M|        x0r = x0r + (x1r);
  549|   352M|        x0i = x0i + (x1i);
  550|   352M|        x1r = x0r - (x1r * 2);
  551|   352M|        x1i = x0i - (x1i * 2);
  552|   352M|        x2r = x2r + (x3i);
  553|   352M|        x2i = x2i - (x3r);
  554|   352M|        x3i = x2r - (x3i * 2);
  555|   352M|        x3r = x2i + (x3r * 2);
  556|       |
  557|   352M|        *data = x0r;
  558|   352M|        *(data + 1) = x0i;
  559|   352M|        data += ((SIZE_T)del << 1);
  560|       |
  561|   352M|        *data = x2r;
  562|   352M|        *(data + 1) = x2i;
  563|   352M|        data += ((SIZE_T)del << 1);
  564|       |
  565|   352M|        *data = x1r;
  566|   352M|        *(data + 1) = x1i;
  567|   352M|        data += ((SIZE_T)del << 1);
  568|       |
  569|   352M|        *data = x3i;
  570|   352M|        *(data + 1) = x3r;
  571|   352M|        data += ((SIZE_T)del << 1);
  572|   352M|      }
  573|   134M|      data -= 2 * npoints;
  574|   134M|      data += 2;
  575|   134M|    }
  576|  27.8M|    nodespacing >>= 2;
  577|  27.8M|    del <<= 2;
  578|  27.8M|    in_loop_cnt >>= 2;
  579|  27.8M|  }
  580|  22.7M|  if (not_power_4) {
  ------------------
  |  Branch (580:7): [True: 11.7M, False: 11.0M]
  ------------------
  581|  11.7M|    const FLOAT64 *twiddles = ptr_w;
  582|  11.7M|    nodespacing <<= 1;
  583|       |
  584|   222M|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (584:23): [True: 210M, False: 11.7M]
  ------------------
  585|   210M|      FLOAT64 w_1 = *twiddles;
  586|   210M|      FLOAT64 w_4 = *(twiddles + 257);
  587|   210M|      twiddles += nodespacing;
  588|       |
  589|   210M|      x0r = *ptr_y;
  590|   210M|      x0i = *(ptr_y + 1);
  591|   210M|      ptr_y += ((SIZE_T)del << 1);
  592|       |
  593|   210M|      x1r = *ptr_y;
  594|   210M|      x1i = *(ptr_y + 1);
  595|       |
  596|   210M|      tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_1) - ixheaace_dmult((FLOAT64)x1i, w_4));
  597|   210M|      x1i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r, w_4), (FLOAT64)x1i, w_1);
  598|   210M|      x1r = tmp;
  599|       |
  600|   210M|      *ptr_y = (x0r) - (x1r);
  601|   210M|      *(ptr_y + 1) = (x0i) - (x1i);
  602|   210M|      ptr_y -= ((SIZE_T)del << 1);
  603|       |
  604|   210M|      *ptr_y = (x0r) + (x1r);
  605|   210M|      *(ptr_y + 1) = (x0i) + (x1i);
  606|   210M|      ptr_y += 2;
  607|   210M|    }
  608|  11.7M|    twiddles = ptr_w;
  609|   222M|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (609:23): [True: 210M, False: 11.7M]
  ------------------
  610|   210M|      FLOAT64 w_1 = *twiddles;
  611|   210M|      FLOAT64 w_4 = *(twiddles + 257);
  612|   210M|      twiddles += nodespacing;
  613|       |
  614|   210M|      x0r = *ptr_y;
  615|   210M|      x0i = *(ptr_y + 1);
  616|   210M|      ptr_y += ((SIZE_T)del << 1);
  617|       |
  618|   210M|      x1r = *ptr_y;
  619|   210M|      x1i = *(ptr_y + 1);
  620|       |
  621|   210M|      tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_4) + ixheaace_dmult((FLOAT64)x1i, w_1));
  622|   210M|      x1i = (FLOAT32)(-ixheaace_dmult((FLOAT64)x1r, w_1) + ixheaace_dmult((FLOAT64)x1i, w_4));
  623|   210M|      x1r = tmp;
  624|       |
  625|   210M|      *ptr_y = (x0r) - (x1r);
  626|   210M|      *(ptr_y + 1) = (x0i) - (x1i);
  627|   210M|      ptr_y -= ((SIZE_T)del << 1);
  628|       |
  629|   210M|      *ptr_y = (x0r) + (x1r);
  630|   210M|      *(ptr_y + 1) = (x0i) + (x1i);
  631|   210M|      ptr_y += 2;
  632|   210M|    }
  633|  11.7M|  }
  634|       |
  635|  1.83G|  for (i = 0; i < nlength; i++) {
  ------------------
  |  Branch (635:15): [True: 1.80G, False: 22.7M]
  ------------------
  636|  1.80G|    *(ptr_x + 2 * i) = y[2 * i];
  637|  1.80G|    *(ptr_x + 2 * i + 1) = y[2 * i + 1];
  638|  1.80G|  }
  639|  22.7M|}
iusace_complex_fft:
  852|  10.3M|VOID iusace_complex_fft(FLOAT32 *data, WORD32 nlength, iusace_scratch_mem *pstr_scratch) {
  853|  10.3M|  if (nlength & (nlength - 1)) {
  ------------------
  |  Branch (853:7): [True: 3.11M, False: 7.21M]
  ------------------
  854|  3.11M|    iusace_complex_fft_p3(data, nlength, pstr_scratch);
  855|  7.21M|  } else {
  856|  7.21M|    iusace_complex_fft_p2(data, nlength, pstr_scratch->p_fft_p2_y);
  857|  7.21M|  }
  858|  10.3M|}
iusace_fft_based_mdct:
  887|  2.84M|                                   const WORD32 tx_flag, iusace_scratch_mem *pstr_scratch) {
  888|  2.84M|  FLOAT32 *ptr_scratch1 = pstr_scratch->p_fft_mdct_buf;
  889|  2.84M|  const FLOAT64 *cos_ptr = NULL;
  890|  2.84M|  const FLOAT64 *sin_ptr = NULL;
  891|  2.84M|  WORD32 nlength = npoints >> 1;
  892|  2.84M|  WORD32 n_total = npoints << 1;
  893|       |
  894|  2.84M|  memset(ptr_scratch1, 0, ((SIZE_T)n_total << 1) * sizeof(*ptr_scratch1));
  895|       |
  896|  2.84M|  switch (npoints) {
  897|   782k|    case (96):
  ------------------
  |  Branch (897:5): [True: 782k, False: 2.06M]
  ------------------
  898|   782k|      cos_ptr = iexheaac_pre_post_twid_cos_192;
  899|   782k|      sin_ptr = iexheaac_pre_post_twid_sin_192;
  900|   782k|      break;
  901|  1.49M|    case (128):
  ------------------
  |  Branch (901:5): [True: 1.49M, False: 1.35M]
  ------------------
  902|  1.49M|      cos_ptr = iusace_pre_post_twid_cos_256;
  903|  1.49M|      sin_ptr = iusace_pre_post_twid_sin_256;
  904|  1.49M|      break;
  905|   119k|    case (768):
  ------------------
  |  Branch (905:5): [True: 119k, False: 2.72M]
  ------------------
  906|   119k|      cos_ptr = iexheaac_pre_post_twid_cos_1536;
  907|   119k|      sin_ptr = iexheaac_pre_post_twid_sin_1536;
  908|   119k|      break;
  909|   451k|    case (1024):
  ------------------
  |  Branch (909:5): [True: 451k, False: 2.39M]
  ------------------
  910|   451k|      cos_ptr = iusace_pre_post_twid_cos_2048;
  911|   451k|      sin_ptr = iusace_pre_post_twid_sin_2048;
  912|   451k|      break;
  913|      0|    default:
  ------------------
  |  Branch (913:5): [True: 0, False: 2.84M]
  ------------------
  914|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_LENGTH;
  915|  2.84M|  }
  916|       |
  917|       |  /* pre-twiddle */
  918|  2.84M|  iusace_calc_pre_twid_enc(ptr_in, ptr_scratch1, npoints << 1, cos_ptr, sin_ptr, tx_flag);
  919|       |
  920|       |  /* complex FFT */
  921|  2.84M|  iusace_complex_fft(ptr_scratch1, nlength, pstr_scratch);
  922|       |
  923|       |  /* post-twiddle */
  924|  2.84M|  iusace_calc_post_twid_enc(ptr_out, ptr_scratch1, npoints << 1, cos_ptr, sin_ptr, tx_flag);
  925|       |
  926|  2.84M|  return IA_NO_ERROR;
  ------------------
  |  |   23|  2.84M|#define IA_NO_ERROR 0x00000000
  ------------------
  927|  2.84M|}
iusace_complex_fft_2048:
  929|   188k|VOID iusace_complex_fft_2048(FLOAT32 *ptr_x, FLOAT32 *scratch_fft) {
  930|   188k|  WORD32 i;
  931|   188k|  FLOAT32 re, im, c_v, s_v, tmp_re, tmp_im;
  932|   188k|  FLOAT32 *ptr_re, *ptr_im, *ptr_re_h, *ptr_im_h;
  933|   188k|  FLOAT32 *ptr_cos_val, *ptr_sin_val;
  934|   188k|  iusace_complex_fft_p2(ptr_x, 1024, scratch_fft);
  935|   188k|  iusace_complex_fft_p2(ptr_x + 2048, 1024, scratch_fft);
  936|       |
  937|   188k|  ptr_re = ptr_x;
  938|   188k|  ptr_im = ptr_x + 1;
  939|   188k|  ptr_re_h = ptr_x + 2048;
  940|   188k|  ptr_im_h = ptr_x + 2048 + 1;
  941|   188k|  ptr_cos_val = (FLOAT32 *)&iusace_twiddle_cos_2048[0];
  942|   188k|  ptr_sin_val = (FLOAT32 *)&iusace_twiddle_sin_2048[0];
  943|   193M|  for (i = 0; i < 1024; i++) {
  ------------------
  |  Branch (943:15): [True: 193M, False: 188k]
  ------------------
  944|   193M|    re = *ptr_re_h;
  945|   193M|    im = *ptr_im_h;
  946|   193M|    c_v = ptr_cos_val[i];
  947|   193M|    s_v = ptr_sin_val[i];
  948|   193M|    tmp_re = (re * c_v) + (im * s_v);
  949|   193M|    tmp_im = -(re * s_v) + (im * c_v);
  950|   193M|    re = *ptr_re;
  951|   193M|    im = *ptr_im;
  952|       |
  953|   193M|    *ptr_re = re + tmp_re;
  954|   193M|    *ptr_im = im + tmp_im;
  955|   193M|    *ptr_re_h = re - tmp_re;
  956|   193M|    *ptr_im_h = im - tmp_im;
  957|       |
  958|   193M|    ptr_re += 2;
  959|   193M|    ptr_im += 2;
  960|   193M|    ptr_re_h += 2;
  961|   193M|    ptr_im_h += 2;
  962|   193M|  }
  963|   188k|}
iusace_complex_fft_4096:
 1538|  49.5k|VOID iusace_complex_fft_4096(FLOAT32 *ptr_x_r, FLOAT32 *ptr_x_i, FLOAT32 *ptr_scratch_buf) {
 1539|  49.5k|  FLOAT32 *ptr_data_r;
 1540|  49.5k|  FLOAT32 *ptr_data_i;
 1541|  49.5k|  WORD32 fft_len = 4096;
 1542|  49.5k|  FLOAT32 *ptr_fft_interim_buf = &ptr_scratch_buf[2 * fft_len];
 1543|  49.5k|  WORD32 i, j;
 1544|  49.5k|  WORD32 dim2 = fft_len >> 10;
 1545|  49.5k|  WORD32 dim1 = fft_len / dim2;
 1546|  49.5k|  WORD32 fac = 4;
 1547|       |
 1548|   247k|  for (i = 0; i < dim2; i++) {
  ------------------
  |  Branch (1548:15): [True: 198k, False: 49.5k]
  ------------------
 1549|   198k|    ptr_data_r = &ptr_scratch_buf[(2 * i + 0) * dim1];
 1550|   198k|    ptr_data_i = &ptr_scratch_buf[(2 * i + 1) * dim1];
 1551|   203M|    for (j = 0; j < dim1; j++) {
  ------------------
  |  Branch (1551:17): [True: 202M, False: 198k]
  ------------------
 1552|   202M|      ptr_data_r[j] = ptr_x_r[(dim2 * j + i)];
 1553|   202M|      ptr_data_i[j] = 0;
 1554|   202M|    }
 1555|   198k|    ixheaace_rad2_cplx_fft(ptr_data_r, ptr_data_i, dim1, ptr_fft_interim_buf);
 1556|   198k|  }
 1557|  49.5k|  ptr_data_r = &ptr_scratch_buf[0];
 1558|  49.5k|  ptr_data_i = &ptr_scratch_buf[0];
 1559|  50.7M|  for (i = 0; i < dim1; i++) {
  ------------------
  |  Branch (1559:15): [True: 50.7M, False: 49.5k]
  ------------------
 1560|  50.7M|    FLOAT32 *ptr_cos_val = (FLOAT32 *)&ia_mixed_rad_twiddle_cos[i * dim2 * fac];
 1561|  50.7M|    FLOAT32 *ptr_sin_val = (FLOAT32 *)&ia_mixed_rad_twiddle_sin[i * dim2 * fac];
 1562|   253M|    for (j = 0; j < dim2; j++) {
  ------------------
  |  Branch (1562:17): [True: 202M, False: 50.7M]
  ------------------
 1563|   202M|      FLOAT32 real = ptr_data_r[(2 * j + 0) * dim1 + i];
 1564|   202M|      FLOAT32 imag = ptr_data_i[(2 * j + 1) * dim1 + i];
 1565|   202M|      FLOAT32 cos_val = ptr_cos_val[j * fac];
 1566|   202M|      FLOAT32 sin_val = ptr_sin_val[j * fac];
 1567|   202M|      FLOAT32 temp_real = (FLOAT32)(real * cos_val + imag * sin_val);
 1568|   202M|      FLOAT32 temp_imag = (FLOAT32)(imag * cos_val - real * sin_val);
 1569|   202M|      ptr_fft_interim_buf[(2 * i + 0) * dim2 + j] = temp_real;
 1570|   202M|      ptr_fft_interim_buf[(2 * i + 1) * dim2 + j] = temp_imag;
 1571|   202M|    }
 1572|  50.7M|  }
 1573|  50.7M|  for (i = 0; i < dim1; i++) {
  ------------------
  |  Branch (1573:15): [True: 50.7M, False: 49.5k]
  ------------------
 1574|  50.7M|    ptr_data_r = &ptr_fft_interim_buf[(2 * i + 0) * dim2];
 1575|  50.7M|    ptr_data_i = &ptr_fft_interim_buf[(2 * i + 1) * dim2];
 1576|  50.7M|    ixheaace_cplx_fft_4(ptr_data_r, ptr_data_i);
 1577|  50.7M|  }
 1578|  49.5k|  ptr_data_r = &ptr_fft_interim_buf[0];
 1579|  49.5k|  ptr_data_i = &ptr_fft_interim_buf[0];
 1580|  50.7M|  for (i = 0; i < dim1; i++) {
  ------------------
  |  Branch (1580:15): [True: 50.7M, False: 49.5k]
  ------------------
 1581|   253M|    for (j = 0; j < dim2; j++) {
  ------------------
  |  Branch (1581:17): [True: 202M, False: 50.7M]
  ------------------
 1582|   202M|      ptr_x_r[(j * dim1 + i)] = ptr_data_r[(2 * i + 0) * dim2 + j];
 1583|   202M|      ptr_x_i[(j * dim1 + i)] = ptr_data_i[(2 * i + 1) * dim2 + j];
 1584|   202M|    }
 1585|  50.7M|  }
 1586|  49.5k|}
iusace_fft.c:iusace_calc_norm:
   60|  45.5M|static PLATFORM_INLINE WORD8 iusace_calc_norm(WORD32 a) {
   61|  45.5M|  WORD8 norm_val;
   62|       |
   63|  45.5M|  if (a == 0) {
  ------------------
  |  Branch (63:7): [True: 0, False: 45.5M]
  ------------------
   64|      0|    norm_val = 31;
   65|  45.5M|  } else {
   66|  45.5M|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 45.5M]
  ------------------
   67|      0|      norm_val = 31;
   68|  45.5M|    } else {
   69|  45.5M|      if (a < 0) {
  ------------------
  |  Branch (69:11): [True: 0, False: 45.5M]
  ------------------
   70|      0|        a = ~a;
   71|      0|      }
   72|  1.18G|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (72:26): [True: 1.13G, False: 45.5M]
  ------------------
   73|  1.13G|        a <<= 1;
   74|  1.13G|      }
   75|  45.5M|    }
   76|  45.5M|  }
   77|       |
   78|  45.5M|  return norm_val;
   79|  45.5M|}
iusace_fft.c:iusace_complex_3point_fft:
   81|   102M|static PLATFORM_INLINE VOID iusace_complex_3point_fft(FLOAT32 *ptr_in, FLOAT32 *ptr_out) {
   82|   102M|  FLOAT32 add_r, sub_r;
   83|   102M|  FLOAT32 add_i, sub_i;
   84|   102M|  FLOAT32 x01r, x01i, temp;
   85|   102M|  FLOAT32 p1, p2, p3, p4;
   86|   102M|  FLOAT64 sinmu;
   87|       |
   88|   102M|  sinmu = 0.866025403784439;
   89|       |
   90|   102M|  x01r = ptr_in[0] + ptr_in[2];
   91|   102M|  x01i = ptr_in[1] + ptr_in[3];
   92|       |
   93|   102M|  add_r = ptr_in[2] + ptr_in[4];
   94|   102M|  add_i = ptr_in[3] + ptr_in[5];
   95|       |
   96|   102M|  sub_r = ptr_in[2] - ptr_in[4];
   97|   102M|  sub_i = ptr_in[3] - ptr_in[5];
   98|       |
   99|   102M|  p1 = add_r / (FLOAT32)2.0;
  100|   102M|  p4 = add_i / (FLOAT32)2.0;
  101|   102M|  p2 = (FLOAT32)((FLOAT64)sub_i * sinmu);
  102|   102M|  p3 = (FLOAT32)((FLOAT64)sub_r * sinmu);
  103|       |
  104|   102M|  temp = ptr_in[0] - p1;
  105|       |
  106|   102M|  ptr_out[0] = x01r + ptr_in[4];
  107|   102M|  ptr_out[1] = x01i + ptr_in[5];
  108|   102M|  ptr_out[2] = temp + p2;
  109|   102M|  ptr_out[3] = (ptr_in[1] - p3) - p4;
  110|   102M|  ptr_out[4] = temp - p2;
  111|   102M|  ptr_out[5] = (ptr_in[1] + p3) - p4;
  112|       |
  113|   102M|  return;
  114|   102M|}
iusace_fft.c:iusace_complex_fft_p3:
  642|  3.11M|                                  iusace_scratch_mem *pstr_scratch) {
  643|  3.11M|  WORD32 i, j;
  644|  3.11M|  FLOAT32 *data_3 = pstr_scratch->p_fft_p3_data_3;
  645|  3.11M|  FLOAT32 *y = pstr_scratch->p_fft_p3_y;
  646|  3.11M|  WORD32 cnfac;
  647|  3.11M|  WORD32 mpass = nlength;
  648|  3.11M|  FLOAT32 *ptr_x = data;
  649|  3.11M|  FLOAT32 *ptr_y = y;
  650|       |
  651|  3.11M|  cnfac = 0;
  652|  6.22M|  while (mpass % 3 == 0) {
  ------------------
  |  Branch (652:10): [True: 3.11M, False: 3.11M]
  ------------------
  653|  3.11M|    mpass /= 3;
  654|  3.11M|    cnfac++;
  655|  3.11M|  }
  656|       |
  657|  12.4M|  for (i = 0; i < 3 * cnfac; i++) {
  ------------------
  |  Branch (657:15): [True: 9.33M, False: 3.11M]
  ------------------
  658|   315M|    for (j = 0; j < mpass; j++) {
  ------------------
  |  Branch (658:17): [True: 306M, False: 9.33M]
  ------------------
  659|   306M|      data_3[2 * j] = data[3 * (2 * j) + (2 * i)];
  660|   306M|      data_3[2 * j + 1] = data[3 * (2 * j) + 1 + (2 * i)];
  661|   306M|    }
  662|  9.33M|    iusace_complex_fft_p2(data_3, mpass, pstr_scratch->p_fft_p2_y);
  663|       |
  664|   315M|    for (j = 0; j < mpass; j++) {
  ------------------
  |  Branch (664:17): [True: 306M, False: 9.33M]
  ------------------
  665|   306M|      data[3 * (2 * j) + (2 * i)] = data_3[2 * j];
  666|   306M|      data[3 * (2 * j) + 1 + (2 * i)] = data_3[2 * j + 1];
  667|   306M|    }
  668|  9.33M|  }
  669|       |
  670|  3.11M|  {
  671|  3.11M|    const FLOAT64 *w1r, *w1i;
  672|  3.11M|    FLOAT32 tmp;
  673|  3.11M|    w1r = iusace_twiddle_table_3pr;
  674|  3.11M|    w1i = iusace_twiddle_table_3pi;
  675|       |
  676|   105M|    for (i = 0; i < nlength; i += 3) {
  ------------------
  |  Branch (676:17): [True: 102M, False: 3.11M]
  ------------------
  677|   102M|      tmp = (FLOAT32)((FLOAT64)data[2 * i] * (*w1r) - (FLOAT64)data[2 * i + 1] * (*w1i));
  678|   102M|      data[2 * i + 1] =
  679|   102M|          (FLOAT32)((FLOAT64)data[2 * i] * (*w1i) + (FLOAT64)data[2 * i + 1] * (*w1r));
  680|   102M|      data[2 * i] = tmp;
  681|       |
  682|   102M|      w1r++;
  683|   102M|      w1i++;
  684|       |
  685|   102M|      tmp = (FLOAT32)((FLOAT64)data[2 * (i + 1)] * (*w1r) -
  686|   102M|                      (FLOAT64)data[2 * (i + 1) + 1] * (*w1i));
  687|   102M|      data[2 * (i + 1) + 1] = (FLOAT32)((FLOAT64)data[2 * (i + 1)] * (*w1i) +
  688|   102M|                                        (FLOAT64)data[2 * (i + 1) + 1] * (*w1r));
  689|   102M|      data[2 * (i + 1)] = tmp;
  690|       |
  691|   102M|      w1r++;
  692|   102M|      w1i++;
  693|       |
  694|   102M|      tmp = (FLOAT32)((FLOAT64)data[2 * (i + 2)] * (*w1r) -
  695|   102M|                      (FLOAT64)data[2 * (i + 2) + 1] * (*w1i));
  696|   102M|      data[2 * (i + 2) + 1] = (FLOAT32)((FLOAT64)data[2 * (i + 2)] * (*w1i) +
  697|   102M|                                        (FLOAT64)data[2 * (i + 2) + 1] * (*w1r));
  698|   102M|      data[2 * (i + 2)] = tmp;
  699|       |
  700|   102M|      w1r += 3 * (128 / mpass - 1) + 1;
  701|   102M|      w1i += 3 * (128 / mpass - 1) + 1;
  702|   102M|    }
  703|  3.11M|  }
  704|       |
  705|   105M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (705:15): [True: 102M, False: 3.11M]
  ------------------
  706|   102M|    iusace_complex_3point_fft(ptr_x, ptr_y);
  707|       |
  708|   102M|    ptr_x = ptr_x + 6;
  709|   102M|    ptr_y = ptr_y + 6;
  710|   102M|  }
  711|       |
  712|   105M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (712:15): [True: 102M, False: 3.11M]
  ------------------
  713|   102M|    data[2 * i] = y[6 * i];
  714|   102M|    data[2 * i + 1] = y[6 * i + 1];
  715|   102M|  }
  716|       |
  717|   105M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (717:15): [True: 102M, False: 3.11M]
  ------------------
  718|   102M|    data[2 * (i + mpass)] = y[6 * i + 2];
  719|   102M|    data[2 * (i + mpass) + 1] = y[6 * i + 3];
  720|   102M|  }
  721|       |
  722|   105M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (722:15): [True: 102M, False: 3.11M]
  ------------------
  723|   102M|    data[2 * (i + 2 * mpass)] = y[6 * i + 4];
  724|   102M|    data[2 * (i + 2 * mpass) + 1] = y[6 * i + 5];
  725|   102M|  }
  726|  3.11M|}
iusace_fft.c:iusace_calc_pre_twid_enc:
  818|  2.84M|                                     const WORD32 tx_flag) {
  819|  2.84M|  WORD32 i, n;
  820|  2.84M|  WORD32 b = npoints >> 1;
  821|  2.84M|  WORD32 a = npoints - b;
  822|  2.84M|  WORD32 nlength = npoints >> 2;
  823|  2.84M|  FLOAT64 tempr, tempi;
  824|       |
  825|  2.84M|  if (tx_flag == 0) {
  ------------------
  |  Branch (825:7): [True: 1.42M, False: 1.42M]
  ------------------
  826|  1.42M|    FLOAT64 norm;
  827|   411M|    for (i = 0; i < b; i++) {
  ------------------
  |  Branch (827:17): [True: 410M, False: 1.42M]
  ------------------
  828|   410M|      norm = ptr_in[i]; /* reuse MDCT: spectrally reverse all bins */
  829|   410M|      ptr_in[i] = ptr_in[npoints - 1 - i];
  830|   410M|      ptr_in[npoints - 1 - i] = norm;
  831|   410M|    }
  832|  1.42M|  }
  833|   413M|  for (i = 0; i < nlength; i++) {
  ------------------
  |  Branch (833:15): [True: 410M, False: 2.84M]
  ------------------
  834|   410M|    n = npoints / 2 - 1 - 2 * i;
  835|   410M|    if (i < b / 4) {
  ------------------
  |  Branch (835:9): [True: 205M, False: 205M]
  ------------------
  836|   205M|      tempr = ptr_in[a / 2 + n] + ptr_in[npoints + a / 2 - 1 - n];
  837|   205M|    } else {
  838|   205M|      tempr = ptr_in[a / 2 + n] - ptr_in[a / 2 - 1 - n];
  839|   205M|    }
  840|   410M|    n = 2 * i;
  841|   410M|    if (i < a / 4) {
  ------------------
  |  Branch (841:9): [True: 205M, False: 205M]
  ------------------
  842|   205M|      tempi = ptr_in[a / 2 + n] - ptr_in[a / 2 - 1 - n];
  843|   205M|    } else {
  844|   205M|      tempi = ptr_in[a / 2 + n] + ptr_in[npoints + a / 2 - 1 - n];
  845|   205M|    }
  846|       |
  847|   410M|    fft_ptr[2 * i] = (FLOAT32)(tempr * (*cos_ptr) + tempi * (*sin_ptr));
  848|   410M|    fft_ptr[2 * i + 1] = (FLOAT32)(tempi * (*cos_ptr++) - tempr * (*sin_ptr++));
  849|   410M|  }
  850|  2.84M|}
iusace_fft.c:iusace_calc_post_twid_enc:
  862|  2.84M|                                      const WORD32 tx_flag) {
  863|  2.84M|  WORD32 i;
  864|  2.84M|  WORD32 nlength = npoints >> 2;
  865|  2.84M|  FLOAT64 tempr, tempi;
  866|       |
  867|       |  /* post-twiddle FFT output and then get output data */
  868|   413M|  for (i = 0; i < nlength; i++) {
  ------------------
  |  Branch (868:15): [True: 410M, False: 2.84M]
  ------------------
  869|   410M|    tempr =
  870|   410M|        2 * ((FLOAT64)(fft_ptr[2 * i]) * (*cos_ptr) + (FLOAT64)(fft_ptr[2 * i + 1]) * (*sin_ptr));
  871|   410M|    tempi = 2 * ((FLOAT64)(fft_ptr[2 * i + 1]) * (*cos_ptr++) -
  872|   410M|                 (FLOAT64)(fft_ptr[2 * i]) * (*sin_ptr++));
  873|       |
  874|   410M|    ptr_out[2 * i] = -tempr;
  875|   410M|    ptr_out[npoints / 2 - 1 - 2 * i] = tempi;
  876|   410M|    ptr_out[npoints / 2 + 2 * i] = -tempi;
  877|   410M|    ptr_out[npoints - 1 - 2 * i] = tempr;
  878|   410M|  }
  879|  2.84M|  if (tx_flag == 0) {
  ------------------
  |  Branch (879:7): [True: 1.42M, False: 1.42M]
  ------------------
  880|   411M|    for (i = 0; i < npoints; i += 2) {
  ------------------
  |  Branch (880:17): [True: 410M, False: 1.42M]
  ------------------
  881|   410M|      ptr_out[i] *= -1; /* reuse MDCT: flip signs at odd indices */
  882|   410M|    }
  883|  1.42M|  }
  884|  2.84M|}
iusace_fft.c:ixheaace_rad2_cplx_fft:
  965|   198k|                                   FLOAT32 *ptr_scratch) {
  966|   198k|  WORD32 i, j, k, n_stages, h2;
  967|   198k|  FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  968|   198k|  WORD32 del, nodespacing, in_loop_cnt;
  969|   198k|  WORD32 not_power_4;
  970|   198k|  WORD32 dig_rev_shift;
  971|   198k|  WORD32 m_points = n_points;
  972|   198k|  FLOAT32 *ptr_x = ptr_scratch;
  973|   198k|  FLOAT32 *y = ptr_scratch + 2048;
  974|   198k|  FLOAT32 *ptr_y = y;
  975|   198k|  const FLOAT32 *ptr_w;
  976|       |
  977|   198k|  dig_rev_shift = ixheaac_norm32(m_points) + 1 - 16;
  978|   198k|  n_stages = 30 - ixheaac_norm32(m_points);
  979|   198k|  not_power_4 = n_stages & 1;
  980|       |
  981|   198k|  n_stages = n_stages >> 1;
  982|       |
  983|   198k|  ptr_w = ia_fft_twiddle_table_float;
  984|       |
  985|   203M|  for (i = 0; i < n_points; i++) {
  ------------------
  |  Branch (985:15): [True: 202M, False: 198k]
  ------------------
  986|   202M|    ptr_x[2 * i] = ptr_real[i];
  987|   202M|    ptr_x[2 * i + 1] = ptr_imag[i];
  988|   202M|  }
  989|   198k|  dig_rev_shift = max(dig_rev_shift, 0);
  ------------------
  |  |   74|   198k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 198k, False: 0]
  |  |  ------------------
  ------------------
  990|  50.9M|  for (i = 0; i < n_points; i += 4) {
  ------------------
  |  Branch (990:15): [True: 50.7M, False: 198k]
  ------------------
  991|  50.7M|    FLOAT32 *inp = ptr_x;
  992|  50.7M|    FLOAT32 tmk;
  993|       |
  994|  50.7M|    DIG_REV(i, dig_rev_shift, h2);
  ------------------
  |  |   52|  50.7M|  do {                                                      \
  |  |   53|  50.7M|    unsigned _ = (i);                                       \
  |  |   54|  50.7M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   55|  50.7M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   56|  50.7M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   57|  50.7M|    (j) = _ >> (m);                                         \
  |  |   58|  50.7M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (58:12): [Folded, False: 50.7M]
  |  |  ------------------
  ------------------
  995|  50.7M|    if (not_power_4) {
  ------------------
  |  Branch (995:9): [True: 0, False: 50.7M]
  ------------------
  996|      0|      h2 += 1;
  997|      0|      h2 &= ~1;
  998|      0|    }
  999|  50.7M|    inp += (h2);
 1000|       |
 1001|  50.7M|    x0r = *inp;
 1002|  50.7M|    x0i = *(inp + 1);
 1003|  50.7M|    inp += (n_points >> 1);
 1004|       |
 1005|  50.7M|    x1r = *inp;
 1006|  50.7M|    x1i = *(inp + 1);
 1007|  50.7M|    inp += (n_points >> 1);
 1008|       |
 1009|  50.7M|    x2r = *inp;
 1010|  50.7M|    x2i = *(inp + 1);
 1011|  50.7M|    inp += (n_points >> 1);
 1012|       |
 1013|  50.7M|    x3r = *inp;
 1014|  50.7M|    x3i = *(inp + 1);
 1015|       |
 1016|  50.7M|    x0r = ia_add_flt(x0r, x2r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1017|  50.7M|    x0i = ia_add_flt(x0i, x2i);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1018|       |
 1019|  50.7M|    tmk = ia_sub_flt(x0r, x2r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1020|  50.7M|    x2r = ia_sub_flt(tmk, x2r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1021|  50.7M|    tmk = ia_sub_flt(x0i, x2i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1022|  50.7M|    x2i = ia_sub_flt(tmk, x2i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1023|       |
 1024|  50.7M|    x1r = ia_add_flt(x1r, x3r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1025|  50.7M|    x1i = ia_add_flt(x1i, x3i);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1026|       |
 1027|  50.7M|    tmk = ia_sub_flt(x1r, x3r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1028|  50.7M|    x3r = ia_sub_flt(tmk, x3r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1029|  50.7M|    tmk = ia_sub_flt(x1i, x3i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1030|  50.7M|    x3i = ia_sub_flt(tmk, x3i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1031|       |
 1032|  50.7M|    x0r = ia_add_flt(x0r, x1r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1033|  50.7M|    x0i = ia_add_flt(x0i, x1i);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1034|       |
 1035|  50.7M|    tmk = ia_sub_flt(x0r, x1r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1036|  50.7M|    x1r = ia_sub_flt(tmk, x1r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1037|  50.7M|    tmk = ia_sub_flt(x0i, x1i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1038|  50.7M|    x1i = ia_sub_flt(tmk, x1i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1039|       |
 1040|  50.7M|    x2r = ia_add_flt(x2r, x3i);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1041|  50.7M|    x2i = ia_sub_flt(x2i, x3r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1042|       |
 1043|  50.7M|    tmk = ia_sub_flt(x2r, x3i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1044|  50.7M|    x3i = ia_sub_flt(tmk, x3i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1045|  50.7M|    tmk = ia_add_flt(x2i, x3r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1046|  50.7M|    x3r = ia_add_flt(tmk, x3r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1047|       |
 1048|  50.7M|    *ptr_y++ = x0r;
 1049|  50.7M|    *ptr_y++ = x0i;
 1050|  50.7M|    *ptr_y++ = x2r;
 1051|  50.7M|    *ptr_y++ = x2i;
 1052|  50.7M|    *ptr_y++ = x1r;
 1053|  50.7M|    *ptr_y++ = x1i;
 1054|  50.7M|    *ptr_y++ = x3i;
 1055|  50.7M|    *ptr_y++ = x3r;
 1056|  50.7M|  }
 1057|   198k|  ptr_y -= 2 * n_points;
 1058|   198k|  del = 4;
 1059|   198k|  nodespacing = 64;
 1060|   198k|  in_loop_cnt = n_points >> 4;
 1061|   990k|  for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (1061:26): [True: 792k, False: 198k]
  ------------------
 1062|   792k|    const FLOAT32 *twiddles = ptr_w;
 1063|   792k|    FLOAT32 *data = ptr_y;
 1064|   792k|    FLOAT32 w_1, w_2, w_3, w_4, w_5, w_6;
 1065|   792k|    WORD32 sec_loop_cnt;
 1066|       |
 1067|  17.6M|    for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1067:27): [True: 16.8M, False: 792k]
  ------------------
 1068|  16.8M|      x0r = (*data);
 1069|  16.8M|      x0i = (*(data + 1));
 1070|  16.8M|      data += ((SIZE_T)del << 1);
 1071|       |
 1072|  16.8M|      x1r = (*data);
 1073|  16.8M|      x1i = (*(data + 1));
 1074|  16.8M|      data += ((SIZE_T)del << 1);
 1075|       |
 1076|  16.8M|      x2r = (*data);
 1077|  16.8M|      x2i = (*(data + 1));
 1078|  16.8M|      data += ((SIZE_T)del << 1);
 1079|       |
 1080|  16.8M|      x3r = (*data);
 1081|  16.8M|      x3i = (*(data + 1));
 1082|  16.8M|      data -= 3 * (del << 1);
 1083|       |
 1084|  16.8M|      x0r = ia_add_flt(x0r, x2r);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1085|  16.8M|      x0i = ia_add_flt(x0i, x2i);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1086|  16.8M|      x2r = ia_msu_flt(x0r, x2r, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1087|  16.8M|      x2i = ia_msu_flt(x0i, x2i, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1088|  16.8M|      x1r = ia_add_flt(x1r, x3r);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1089|  16.8M|      x1i = ia_add_flt(x1i, x3i);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1090|  16.8M|      x3r = ia_msu_flt(x1r, x3r, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1091|  16.8M|      x3i = ia_msu_flt(x1i, x3i, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1092|       |
 1093|  16.8M|      x0r = ia_add_flt(x0r, x1r);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1094|  16.8M|      x0i = ia_add_flt(x0i, x1i);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1095|  16.8M|      x1r = ia_msu_flt(x0r, x1r, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1096|  16.8M|      x1i = ia_msu_flt(x0i, x1i, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1097|  16.8M|      x2r = ia_add_flt(x2r, x3i);
  ------------------
  |  |   23|  16.8M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1098|  16.8M|      x2i = ia_sub_flt(x2i, x3r);
  ------------------
  |  |   24|  16.8M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1099|  16.8M|      x3i = ia_msu_flt(x2r, x3i, 2);
  ------------------
  |  |   26|  16.8M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1100|  16.8M|      x3r = ia_mac_flt(x2i, x3r, 2);
  ------------------
  |  |   25|  16.8M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1101|       |
 1102|  16.8M|      *data = x0r;
 1103|  16.8M|      *(data + 1) = x0i;
 1104|  16.8M|      data += ((SIZE_T)del << 1);
 1105|       |
 1106|  16.8M|      *data = x2r;
 1107|  16.8M|      *(data + 1) = x2i;
 1108|  16.8M|      data += ((SIZE_T)del << 1);
 1109|       |
 1110|  16.8M|      *data = x1r;
 1111|  16.8M|      *(data + 1) = x1i;
 1112|  16.8M|      data += ((SIZE_T)del << 1);
 1113|       |
 1114|  16.8M|      *data = x3i;
 1115|  16.8M|      *(data + 1) = x3r;
 1116|  16.8M|      data += ((SIZE_T)del << 1);
 1117|  16.8M|    }
 1118|   792k|    data = ptr_y + 2;
 1119|       |
 1120|   792k|    sec_loop_cnt = (nodespacing * del);
 1121|   792k|    sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
 1122|   792k|                   (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
 1123|   792k|                   (sec_loop_cnt / 256);
 1124|       |
 1125|  22.9M|    for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (1125:27): [True: 22.1M, False: 792k]
  ------------------
 1126|  22.1M|      w_1 = *(twiddles + j);
 1127|  22.1M|      w_4 = *(twiddles + j + 257);
 1128|  22.1M|      w_2 = *(twiddles + ((SIZE_T)j << 1));
 1129|  22.1M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 257);
 1130|  22.1M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1));
 1131|  22.1M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) + 257);
 1132|       |
 1133|  84.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1133:29): [True: 62.0M, False: 22.1M]
  ------------------
 1134|  62.0M|        FLOAT32 tmp;
 1135|       |        /*x0 is loaded later to avoid register crunch*/
 1136|       |
 1137|  62.0M|        data += ((SIZE_T)del << 1);
 1138|       |
 1139|  62.0M|        x1r = *data;
 1140|  62.0M|        x1i = *(data + 1);
 1141|  62.0M|        data += ((SIZE_T)del << 1);
 1142|       |
 1143|  62.0M|        x2r = *data;
 1144|  62.0M|        x2i = *(data + 1);
 1145|  62.0M|        data += ((SIZE_T)del << 1);
 1146|       |
 1147|  62.0M|        x3r = *data;
 1148|  62.0M|        x3i = *(data + 1);
 1149|  62.0M|        data -= 3 * (del << 1);
 1150|       |
 1151|  62.0M|        tmp = ia_sub_flt(ia_mul_flt(x1r, w_1), ia_mul_flt(x1i, w_4));
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1152|  62.0M|        x1i = ia_mac_flt(ia_mul_flt(x1r, w_4), x1i, w_1);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1153|  62.0M|        x1r = tmp;
 1154|       |
 1155|  62.0M|        tmp = ia_sub_flt(ia_mul_flt(x2r, w_2), ia_mul_flt(x2i, w_5));
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1156|  62.0M|        x2i = ia_mac_flt(ia_mul_flt(x2r, w_5), x2i, w_2);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1157|  62.0M|        x2r = tmp;
 1158|       |
 1159|  62.0M|        tmp = ia_sub_flt(ia_mul_flt(x3r, w_3), ia_mul_flt(x3i, w_6));
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1160|  62.0M|        x3i = ia_mac_flt(ia_mul_flt(x3r, w_6), x3i, w_3);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1161|  62.0M|        x3r = tmp;
 1162|       |
 1163|  62.0M|        x0r = (*data);
 1164|  62.0M|        x0i = (*(data + 1));
 1165|       |
 1166|  62.0M|        x0r = ia_add_flt(x0r, (x2r));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1167|  62.0M|        x0i = ia_add_flt(x0i, (x2i));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1168|  62.0M|        x2r = ia_msu_flt(x0r, x2r, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1169|  62.0M|        x2i = ia_msu_flt(x0i, x2i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1170|  62.0M|        x1r = ia_add_flt(x1r, x3r);
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1171|  62.0M|        x1i = ia_add_flt(x1i, x3i);
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1172|  62.0M|        x3r = ia_msu_flt(x1r, x3r, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1173|  62.0M|        x3i = ia_msu_flt(x1i, x3i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1174|       |
 1175|  62.0M|        x0r = ia_add_flt(x0r, (x1r));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1176|  62.0M|        x0i = ia_add_flt(x0i, (x1i));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1177|  62.0M|        x1r = ia_msu_flt(x0r, x1r, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1178|  62.0M|        x1i = ia_msu_flt(x0i, x1i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1179|  62.0M|        x2r = ia_add_flt(x2r, (x3i));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1180|  62.0M|        x2i = ia_sub_flt(x2i, (x3r));
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1181|  62.0M|        x3i = ia_msu_flt(x2r, x3i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1182|  62.0M|        x3r = ia_mac_flt(x2i, x3r, 2);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1183|       |
 1184|  62.0M|        *data = x0r;
 1185|  62.0M|        *(data + 1) = x0i;
 1186|  62.0M|        data += ((SIZE_T)del << 1);
 1187|       |
 1188|  62.0M|        *data = x2r;
 1189|  62.0M|        *(data + 1) = x2i;
 1190|  62.0M|        data += ((SIZE_T)del << 1);
 1191|       |
 1192|  62.0M|        *data = x1r;
 1193|  62.0M|        *(data + 1) = x1i;
 1194|  62.0M|        data += ((SIZE_T)del << 1);
 1195|       |
 1196|  62.0M|        *data = x3i;
 1197|  62.0M|        *(data + 1) = x3r;
 1198|  62.0M|        data += ((SIZE_T)del << 1);
 1199|  62.0M|      }
 1200|  22.1M|      data -= 2 * n_points;
 1201|  22.1M|      data += 2;
 1202|  22.1M|    }
 1203|  12.2M|    for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (1203:12): [True: 11.4M, False: 792k]
  ------------------
 1204|  11.4M|      w_1 = *(twiddles + j);
 1205|  11.4M|      w_4 = *(twiddles + j + 257);
 1206|  11.4M|      w_2 = *(twiddles + ((SIZE_T)j << 1));
 1207|  11.4M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 257);
 1208|  11.4M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
 1209|  11.4M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
 1210|       |
 1211|  50.9M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1211:29): [True: 39.4M, False: 11.4M]
  ------------------
 1212|  39.4M|        FLOAT32 tmp;
 1213|       |        /*x0 is loaded later to avoid register crunch*/
 1214|       |
 1215|  39.4M|        data += ((SIZE_T)del << 1);
 1216|       |
 1217|  39.4M|        x1r = *data;
 1218|  39.4M|        x1i = *(data + 1);
 1219|  39.4M|        data += ((SIZE_T)del << 1);
 1220|       |
 1221|  39.4M|        x2r = *data;
 1222|  39.4M|        x2i = *(data + 1);
 1223|  39.4M|        data += ((SIZE_T)del << 1);
 1224|       |
 1225|  39.4M|        x3r = *data;
 1226|  39.4M|        x3i = *(data + 1);
 1227|  39.4M|        data -= 3 * (del << 1);
 1228|       |
 1229|  39.4M|        tmp = ia_sub_flt(ia_mul_flt(x1r, w_1), ia_mul_flt(x1i, w_4));
  ------------------
  |  |   24|  39.4M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1230|  39.4M|        x1i = ia_mac_flt(ia_mul_flt(x1r, w_4), x1i, w_1);
  ------------------
  |  |   25|  39.4M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1231|  39.4M|        x1r = tmp;
 1232|       |
 1233|  39.4M|        tmp = ia_sub_flt(ia_mul_flt(x2r, w_2), ia_mul_flt(x2i, w_5));
  ------------------
  |  |   24|  39.4M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1234|  39.4M|        x2i = ia_mac_flt(ia_mul_flt(x2r, w_5), x2i, w_2);
  ------------------
  |  |   25|  39.4M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1235|  39.4M|        x2r = tmp;
 1236|       |
 1237|  39.4M|        tmp = ia_add_flt(ia_mul_flt(x3r, w_6), ia_mul_flt(x3i, w_3));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1238|  39.4M|        x3i = ia_add_flt(ia_negate_flt(ia_mul_flt(x3r, w_3)), ia_mul_flt(x3i, w_6));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1239|  39.4M|        x3r = tmp;
 1240|       |
 1241|  39.4M|        x0r = (*data);
 1242|  39.4M|        x0i = (*(data + 1));
 1243|       |
 1244|  39.4M|        x0r = ia_add_flt(x0r, (x2r));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1245|  39.4M|        x0i = ia_add_flt(x0i, (x2i));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1246|  39.4M|        x2r = ia_msu_flt(x0r, x2r, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1247|  39.4M|        x2i = ia_msu_flt(x0i, x2i, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1248|  39.4M|        x1r = ia_add_flt(x1r, x3r);
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1249|  39.4M|        x1i = ia_add_flt(x1i, x3i);
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1250|  39.4M|        x3r = ia_msu_flt(x1r, x3r, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1251|  39.4M|        x3i = ia_msu_flt(x1i, x3i, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1252|       |
 1253|  39.4M|        x0r = ia_add_flt(x0r, (x1r));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1254|  39.4M|        x0i = ia_add_flt(x0i, (x1i));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1255|  39.4M|        x1r = ia_msu_flt(x0r, x1r, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1256|  39.4M|        x1i = ia_msu_flt(x0i, x1i, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1257|  39.4M|        x2r = ia_add_flt(x2r, (x3i));
  ------------------
  |  |   23|  39.4M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1258|  39.4M|        x2i = ia_sub_flt(x2i, (x3r));
  ------------------
  |  |   24|  39.4M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1259|  39.4M|        x3i = ia_msu_flt(x2r, x3i, 2);
  ------------------
  |  |   26|  39.4M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1260|  39.4M|        x3r = ia_mac_flt(x2i, x3r, 2);
  ------------------
  |  |   25|  39.4M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1261|       |
 1262|  39.4M|        *data = x0r;
 1263|  39.4M|        *(data + 1) = x0i;
 1264|  39.4M|        data += ((SIZE_T)del << 1);
 1265|       |
 1266|  39.4M|        *data = x2r;
 1267|  39.4M|        *(data + 1) = x2i;
 1268|  39.4M|        data += ((SIZE_T)del << 1);
 1269|       |
 1270|  39.4M|        *data = x1r;
 1271|  39.4M|        *(data + 1) = x1i;
 1272|  39.4M|        data += ((SIZE_T)del << 1);
 1273|       |
 1274|  39.4M|        *data = x3i;
 1275|  39.4M|        *(data + 1) = x3r;
 1276|  39.4M|        data += ((SIZE_T)del << 1);
 1277|  39.4M|      }
 1278|  11.4M|      data -= 2 * n_points;
 1279|  11.4M|      data += 2;
 1280|  11.4M|    }
 1281|  11.4M|    for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (1281:12): [True: 10.7M, False: 792k]
  ------------------
 1282|  10.7M|      w_1 = *(twiddles + j);
 1283|  10.7M|      w_4 = *(twiddles + j + 257);
 1284|  10.7M|      w_2 = *(twiddles + ((SIZE_T)j << 1) - 256);
 1285|  10.7M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 1);
 1286|  10.7M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1) - 256);
 1287|  10.7M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) + 1);
 1288|       |
 1289|  33.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1289:29): [True: 22.5M, False: 10.7M]
  ------------------
 1290|  22.5M|        FLOAT32 tmp;
 1291|       |        /*x0 is loaded later to avoid register crunch*/
 1292|       |
 1293|  22.5M|        data += ((SIZE_T)del << 1);
 1294|       |
 1295|  22.5M|        x1r = *data;
 1296|  22.5M|        x1i = *(data + 1);
 1297|  22.5M|        data += ((SIZE_T)del << 1);
 1298|       |
 1299|  22.5M|        x2r = *data;
 1300|  22.5M|        x2i = *(data + 1);
 1301|  22.5M|        data += ((SIZE_T)del << 1);
 1302|       |
 1303|  22.5M|        x3r = *data;
 1304|  22.5M|        x3i = *(data + 1);
 1305|  22.5M|        data -= 3 * (del << 1);
 1306|       |
 1307|  22.5M|        tmp = ia_sub_flt(ia_mul_flt(x1r, w_1), ia_mul_flt(x1i, w_4));
  ------------------
  |  |   24|  22.5M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1308|  22.5M|        x1i = ia_mac_flt(ia_mul_flt(x1r, w_4), x1i, w_1);
  ------------------
  |  |   25|  22.5M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1309|  22.5M|        x1r = tmp;
 1310|       |
 1311|  22.5M|        tmp = ia_add_flt(ia_mul_flt(x2r, w_5), ia_mul_flt(x2i, w_2));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1312|  22.5M|        x2i = ia_add_flt(ia_negate_flt(ia_mul_flt(x2r, w_2)), ia_mul_flt(x2i, w_5));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1313|  22.5M|        x2r = tmp;
 1314|       |
 1315|  22.5M|        tmp = ia_add_flt(ia_mul_flt(x3r, w_6), ia_mul_flt(x3i, w_3));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1316|  22.5M|        x3i = ia_add_flt(ia_negate_flt(ia_mul_flt(x3r, w_3)), ia_mul_flt(x3i, w_6));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1317|  22.5M|        x3r = tmp;
 1318|       |
 1319|  22.5M|        x0r = (*data);
 1320|  22.5M|        x0i = (*(data + 1));
 1321|       |
 1322|  22.5M|        x0r = ia_add_flt(x0r, (x2r));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1323|  22.5M|        x0i = ia_add_flt(x0i, (x2i));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1324|  22.5M|        x2r = ia_msu_flt(x0r, x2r, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1325|  22.5M|        x2i = ia_msu_flt(x0i, x2i, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1326|  22.5M|        x1r = ia_add_flt(x1r, x3r);
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1327|  22.5M|        x1i = ia_add_flt(x1i, x3i);
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1328|  22.5M|        x3r = ia_msu_flt(x1r, x3r, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1329|  22.5M|        x3i = ia_msu_flt(x1i, x3i, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1330|       |
 1331|  22.5M|        x0r = ia_add_flt(x0r, (x1r));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1332|  22.5M|        x0i = ia_add_flt(x0i, (x1i));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1333|  22.5M|        x1r = ia_msu_flt(x0r, x1r, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1334|  22.5M|        x1i = ia_msu_flt(x0i, x1i, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1335|  22.5M|        x2r = ia_add_flt(x2r, (x3i));
  ------------------
  |  |   23|  22.5M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1336|  22.5M|        x2i = ia_sub_flt(x2i, (x3r));
  ------------------
  |  |   24|  22.5M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1337|  22.5M|        x3i = ia_msu_flt(x2r, x3i, 2);
  ------------------
  |  |   26|  22.5M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1338|  22.5M|        x3r = ia_mac_flt(x2i, x3r, 2);
  ------------------
  |  |   25|  22.5M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1339|       |
 1340|  22.5M|        *data = x0r;
 1341|  22.5M|        *(data + 1) = x0i;
 1342|  22.5M|        data += ((SIZE_T)del << 1);
 1343|       |
 1344|  22.5M|        *data = x2r;
 1345|  22.5M|        *(data + 1) = x2i;
 1346|  22.5M|        data += ((SIZE_T)del << 1);
 1347|       |
 1348|  22.5M|        *data = x1r;
 1349|  22.5M|        *(data + 1) = x1i;
 1350|  22.5M|        data += ((SIZE_T)del << 1);
 1351|       |
 1352|  22.5M|        *data = x3i;
 1353|  22.5M|        *(data + 1) = x3r;
 1354|  22.5M|        data += ((SIZE_T)del << 1);
 1355|  22.5M|      }
 1356|  10.7M|      data -= 2 * n_points;
 1357|  10.7M|      data += 2;
 1358|  10.7M|    }
 1359|  22.9M|    for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (1359:12): [True: 22.1M, False: 792k]
  ------------------
 1360|  22.1M|      w_1 = *(twiddles + j);
 1361|  22.1M|      w_4 = *(twiddles + j + 257);
 1362|  22.1M|      w_2 = *(twiddles + ((SIZE_T)j << 1) - 256);
 1363|  22.1M|      w_5 = *(twiddles + ((SIZE_T)j << 1) + 1);
 1364|  22.1M|      w_3 = *(twiddles + j + ((SIZE_T)j << 1) - 512);
 1365|  22.1M|      w_6 = *(twiddles + j + ((SIZE_T)j << 1) - 512 + 257);
 1366|       |
 1367|  84.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1367:29): [True: 62.0M, False: 22.1M]
  ------------------
 1368|  62.0M|        FLOAT32 tmp;
 1369|       |        /*x0 is loaded later to avoid register crunch*/
 1370|       |
 1371|  62.0M|        data += ((SIZE_T)del << 1);
 1372|       |
 1373|  62.0M|        x1r = *data;
 1374|  62.0M|        x1i = *(data + 1);
 1375|  62.0M|        data += ((SIZE_T)del << 1);
 1376|       |
 1377|  62.0M|        x2r = *data;
 1378|  62.0M|        x2i = *(data + 1);
 1379|  62.0M|        data += ((SIZE_T)del << 1);
 1380|       |
 1381|  62.0M|        x3r = *data;
 1382|  62.0M|        x3i = *(data + 1);
 1383|  62.0M|        data -= 3 * (del << 1);
 1384|       |
 1385|  62.0M|        tmp = ia_sub_flt(ia_mul_flt(x1r, w_1), ia_mul_flt(x1i, w_4));
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1386|  62.0M|        x1i = ia_mac_flt(ia_mul_flt(x1r, w_4), x1i, w_1);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1387|  62.0M|        x1r = tmp;
 1388|       |
 1389|  62.0M|        tmp = ia_add_flt(ia_mul_flt(x2r, w_5), ia_mul_flt(x2i, w_2));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1390|  62.0M|        x2i = ia_add_flt(ia_negate_flt(ia_mul_flt(x2r, w_2)), ia_mul_flt(x2i, w_5));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1391|  62.0M|        x2r = tmp;
 1392|       |
 1393|  62.0M|        tmp = ia_add_flt(ia_negate_flt(ia_mul_flt(x3r, w_3)), ia_mul_flt(x3i, w_6));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1394|  62.0M|        x3i = ia_mac_flt(ia_mul_flt(x3r, w_6), x3i, w_3);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1395|  62.0M|        x3r = tmp;
 1396|       |
 1397|  62.0M|        x0r = (*data);
 1398|  62.0M|        x0i = (*(data + 1));
 1399|       |
 1400|  62.0M|        x0r = ia_add_flt(x0r, (x2r));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1401|  62.0M|        x0i = ia_add_flt(x0i, (x2i));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1402|  62.0M|        x2r = ia_msu_flt(x0r, x2r, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1403|  62.0M|        x2i = ia_msu_flt(x0i, x2i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1404|  62.0M|        x1r = ia_add_flt(x1r, x3r);
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1405|  62.0M|        x1i = ia_sub_flt(x1i, x3i);
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1406|  62.0M|        x3r = ia_msu_flt(x1r, x3r, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1407|  62.0M|        x3i = ia_mac_flt(x1i, x3i, 2);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1408|       |
 1409|  62.0M|        x0r = ia_add_flt(x0r, (x1r));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1410|  62.0M|        x0i = ia_add_flt(x0i, (x1i));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1411|  62.0M|        x1r = ia_msu_flt(x0r, x1r, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1412|  62.0M|        x1i = ia_msu_flt(x0i, x1i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1413|  62.0M|        x2r = ia_add_flt(x2r, (x3i));
  ------------------
  |  |   23|  62.0M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1414|  62.0M|        x2i = ia_sub_flt(x2i, (x3r));
  ------------------
  |  |   24|  62.0M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1415|  62.0M|        x3i = ia_msu_flt(x2r, x3i, 2);
  ------------------
  |  |   26|  62.0M|#define ia_msu_flt(x, a, b) ((x) - (a) * (b))
  ------------------
 1416|  62.0M|        x3r = ia_mac_flt(x2i, x3r, 2);
  ------------------
  |  |   25|  62.0M|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1417|       |
 1418|  62.0M|        *data = x0r;
 1419|  62.0M|        *(data + 1) = x0i;
 1420|  62.0M|        data += ((SIZE_T)del << 1);
 1421|       |
 1422|  62.0M|        *data = x2r;
 1423|  62.0M|        *(data + 1) = x2i;
 1424|  62.0M|        data += ((SIZE_T)del << 1);
 1425|       |
 1426|  62.0M|        *data = x1r;
 1427|  62.0M|        *(data + 1) = x1i;
 1428|  62.0M|        data += ((SIZE_T)del << 1);
 1429|       |
 1430|  62.0M|        *data = x3i;
 1431|  62.0M|        *(data + 1) = x3r;
 1432|  62.0M|        data += ((SIZE_T)del << 1);
 1433|  62.0M|      }
 1434|  22.1M|      data -= 2 * n_points;
 1435|  22.1M|      data += 2;
 1436|  22.1M|    }
 1437|   792k|    nodespacing >>= 2;
 1438|   792k|    del <<= 2;
 1439|   792k|    in_loop_cnt >>= 2;
 1440|   792k|  }
 1441|   198k|  if (not_power_4) {
  ------------------
  |  Branch (1441:7): [True: 0, False: 198k]
  ------------------
 1442|      0|    const FLOAT32 *twiddles = ptr_w;
 1443|      0|    nodespacing <<= 1;
 1444|       |
 1445|      0|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (1445:23): [True: 0, False: 0]
  ------------------
 1446|      0|      FLOAT32 w_1 = *twiddles;
 1447|      0|      FLOAT32 w_4 = *(twiddles + 257);
 1448|      0|      FLOAT32 tmp;
 1449|      0|      twiddles += nodespacing;
 1450|       |
 1451|      0|      x0r = *ptr_y;
 1452|      0|      x0i = *(ptr_y + 1);
 1453|      0|      ptr_y += ((SIZE_T)del << 1);
 1454|       |
 1455|      0|      x1r = *ptr_y;
 1456|      0|      x1i = *(ptr_y + 1);
 1457|       |
 1458|      0|      tmp = ia_sub_flt(ia_mul_flt(x1r, w_1), ia_mul_flt(x1i, w_4));
  ------------------
  |  |   24|      0|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1459|      0|      x1i = (FLOAT32)ia_mac_flt(ia_mul_flt(x1r, w_4), x1i, w_1);
  ------------------
  |  |   25|      0|#define ia_mac_flt(x, a, b) ((x) + (a) * (b))
  ------------------
 1460|      0|      x1r = tmp;
 1461|       |
 1462|      0|      *ptr_y = ia_sub_flt((x0r), (x1r));
  ------------------
  |  |   24|      0|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1463|      0|      *(ptr_y + 1) = ia_sub_flt((x0i), (x1i));
  ------------------
  |  |   24|      0|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1464|      0|      ptr_y -= ((SIZE_T)del << 1);
 1465|       |
 1466|      0|      *ptr_y = ia_add_flt((x0r), (x1r));
  ------------------
  |  |   23|      0|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1467|      0|      *(ptr_y + 1) = ia_add_flt((x0i), (x1i));
  ------------------
  |  |   23|      0|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1468|      0|      ptr_y += 2;
 1469|      0|    }
 1470|      0|    twiddles = ptr_w;
 1471|      0|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (1471:23): [True: 0, False: 0]
  ------------------
 1472|      0|      FLOAT32 w_1 = *twiddles;
 1473|      0|      FLOAT32 w_4 = *(twiddles + 257);
 1474|      0|      FLOAT32 tmp;
 1475|      0|      twiddles += nodespacing;
 1476|       |
 1477|      0|      x0r = *ptr_y;
 1478|      0|      x0i = *(ptr_y + 1);
 1479|      0|      ptr_y += ((SIZE_T)del << 1);
 1480|       |
 1481|      0|      x1r = *ptr_y;
 1482|      0|      x1i = *(ptr_y + 1);
 1483|       |
 1484|      0|      tmp = ia_add_flt(ia_mul_flt(x1r, w_4), ia_mul_flt(x1i, w_1));
  ------------------
  |  |   23|      0|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1485|      0|      x1i = ia_add_flt(ia_negate_flt(ia_mul_flt(x1r, w_1)), ia_mul_flt(x1i, w_4));
  ------------------
  |  |   23|      0|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1486|      0|      x1r = tmp;
 1487|       |
 1488|      0|      *ptr_y = ia_sub_flt((x0r), (x1r));
  ------------------
  |  |   24|      0|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1489|      0|      *(ptr_y + 1) = ia_sub_flt((x0i), (x1i));
  ------------------
  |  |   24|      0|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1490|      0|      ptr_y -= ((SIZE_T)del << 1);
 1491|       |
 1492|      0|      *ptr_y = ia_add_flt((x0r), (x1r));
  ------------------
  |  |   23|      0|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1493|      0|      *(ptr_y + 1) = ia_add_flt((x0i), (x1i));
  ------------------
  |  |   23|      0|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1494|      0|      ptr_y += 2;
 1495|      0|    }
 1496|      0|  }
 1497|       |
 1498|   203M|  for (i = 0; i < n_points; i++) {
  ------------------
  |  Branch (1498:15): [True: 202M, False: 198k]
  ------------------
 1499|   202M|    ptr_real[i] = y[2 * i];
 1500|   202M|    ptr_imag[i] = y[2 * i + 1];
 1501|   202M|  }
 1502|   198k|}
iusace_fft.c:ixheaace_cplx_fft_4:
 1503|  50.7M|static VOID ixheaace_cplx_fft_4(FLOAT32 *x_r, FLOAT32 *x_i) {
 1504|  50.7M|  FLOAT32 x_0, x_1, x_2, x_3;
 1505|  50.7M|  FLOAT32 x_4, x_5, x_6, x_7;
 1506|  50.7M|  FLOAT32 x0r, x1r, x2r, x3r;
 1507|  50.7M|  FLOAT32 x0i, x1i, x2i, x3i;
 1508|       |
 1509|       |  // 4 Point FFT
 1510|  50.7M|  x_0 = x_r[0];
 1511|  50.7M|  x_1 = x_i[0];
 1512|  50.7M|  x_2 = x_r[1];
 1513|  50.7M|  x_3 = x_i[1];
 1514|  50.7M|  x_4 = x_r[2];
 1515|  50.7M|  x_5 = x_i[2];
 1516|  50.7M|  x_6 = x_r[3];
 1517|  50.7M|  x_7 = x_i[3];
 1518|       |
 1519|  50.7M|  x0r = ia_add_flt(x_0, x_4);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1520|  50.7M|  x0i = ia_add_flt(x_1, x_5);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1521|  50.7M|  x2r = ia_sub_flt(x_0, x_4);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1522|  50.7M|  x2i = ia_sub_flt(x_1, x_5);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1523|  50.7M|  x1r = ia_add_flt(x_2, x_6);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1524|  50.7M|  x1i = ia_add_flt(x_3, x_7);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1525|  50.7M|  x3r = ia_sub_flt(x_2, x_6);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1526|  50.7M|  x3i = ia_sub_flt(x_3, x_7);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1527|       |
 1528|  50.7M|  x_r[0] = ia_add_flt(x0r, x1r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1529|  50.7M|  x_i[0] = ia_add_flt(x0i, x1i);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1530|  50.7M|  x_r[2] = ia_sub_flt(x0r, x1r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1531|  50.7M|  x_i[2] = ia_sub_flt(x0i, x1i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1532|  50.7M|  x_r[1] = ia_add_flt(x2r, x3i);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1533|  50.7M|  x_i[1] = ia_sub_flt(x2i, x3r);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1534|  50.7M|  x_r[3] = ia_sub_flt(x2r, x3i);
  ------------------
  |  |   24|  50.7M|#define ia_sub_flt(a, b) ((a) - (b))
  ------------------
 1535|  50.7M|  x_i[3] = ia_add_flt(x2i, x3r);
  ------------------
  |  |   23|  50.7M|#define ia_add_flt(a, b) ((a) + (b))
  ------------------
 1536|  50.7M|  return;
 1537|  50.7M|}

iusace_lpc_2_lsp_conversion:
   44|   561k|VOID iusace_lpc_2_lsp_conversion(FLOAT32 *lpc, FLOAT32 *lsp, FLOAT32 *prev_lsp) {
   45|   561k|  FLOAT32 sum_polyn[(ORDER_BY_2) + 1], diff_polyn[(ORDER_BY_2) + 1];
   46|   561k|  FLOAT32 *p1_lpc, *p2_lpc, *p_sum_polyn, *p_diff_polyn;
   47|   561k|  WORD32 i, j = 0, num_found_freeq = 0, is_first_polyn = 0;
   48|   561k|  FLOAT32 x_low, y_low, x_high, y_high, x_mid, y_mid, x_lin_interp;
   49|       |
   50|   561k|  p_sum_polyn = sum_polyn;
   51|   561k|  p_diff_polyn = diff_polyn;
   52|   561k|  *p_sum_polyn++ = 1.0f;
   53|   561k|  *p_diff_polyn++ = 1.0f;
   54|   561k|  sum_polyn[0] = 1.0f;
   55|   561k|  diff_polyn[0] = 1.0f;
   56|   561k|  p1_lpc = lpc + 1;
   57|   561k|  p2_lpc = lpc + ORDER;
  ------------------
  |  |   71|   561k|#define ORDER (16)
  ------------------
   58|  5.04M|  for (i = 0; i <= ORDER_BY_2 - 1; i++) {
  ------------------
  |  |   72|  5.04M|#define ORDER_BY_2 (8)
  ------------------
  |  Branch (58:15): [True: 4.48M, False: 561k]
  ------------------
   59|  4.48M|    *p_sum_polyn = *p1_lpc + *p2_lpc - *(p_sum_polyn - 1);
   60|  4.48M|    p_sum_polyn++;
   61|  4.48M|    *p_diff_polyn = *p1_lpc++ - *p2_lpc-- + *(p_diff_polyn - 1);
   62|  4.48M|    p_diff_polyn++;
   63|  4.48M|  }
   64|   561k|  p_sum_polyn = sum_polyn;
   65|   561k|  x_low = iusace_chebyshev_polyn_grid[0];
   66|   561k|  y_low = iusace_lpc_eval_chebyshev_polyn(x_low, p_sum_polyn, ORDER_BY_2);
  ------------------
  |  |   72|   561k|#define ORDER_BY_2 (8)
  ------------------
   67|       |
   68|  63.1M|  while ((num_found_freeq < ORDER) && (j < CHEBYSHEV_NUM_POINTS)) {
  ------------------
  |  |   71|  63.1M|#define ORDER (16)
  ------------------
                while ((num_found_freeq < ORDER) && (j < CHEBYSHEV_NUM_POINTS)) {
  ------------------
  |  |  172|  62.6M|#define CHEBYSHEV_NUM_POINTS (100)
  ------------------
  |  Branch (68:10): [True: 62.6M, False: 561k]
  |  Branch (68:39): [True: 62.6M, False: 0]
  ------------------
   69|  62.6M|    j++;
   70|  62.6M|    x_high = x_low;
   71|  62.6M|    y_high = y_low;
   72|  62.6M|    x_low = iusace_chebyshev_polyn_grid[j];
   73|  62.6M|    y_low = iusace_lpc_eval_chebyshev_polyn(x_low, p_sum_polyn, ORDER_BY_2);
  ------------------
  |  |   72|  62.6M|#define ORDER_BY_2 (8)
  ------------------
   74|       |
   75|  62.6M|    if (y_low * y_high <= 0.0) /* if sign change new root exists */
  ------------------
  |  Branch (75:9): [True: 8.97M, False: 53.6M]
  ------------------
   76|  8.97M|    {
   77|  8.97M|      j--;
   78|  44.8M|      for (i = 0; i < CHEBYSHEV_NUM_ITER; i++) {
  ------------------
  |  |  171|  44.8M|#define CHEBYSHEV_NUM_ITER (4)
  ------------------
  |  Branch (78:19): [True: 35.9M, False: 8.97M]
  ------------------
   79|  35.9M|        x_mid = 0.5f * (x_low + x_high);
   80|  35.9M|        y_mid = iusace_lpc_eval_chebyshev_polyn(x_mid, p_sum_polyn, ORDER_BY_2);
  ------------------
  |  |   72|  35.9M|#define ORDER_BY_2 (8)
  ------------------
   81|  35.9M|        if (y_low * y_mid <= 0.0) {
  ------------------
  |  Branch (81:13): [True: 18.1M, False: 17.7M]
  ------------------
   82|  18.1M|          y_high = y_mid;
   83|  18.1M|          x_high = x_mid;
   84|  18.1M|        } else {
   85|  17.7M|          y_low = y_mid;
   86|  17.7M|          x_low = x_mid;
   87|  17.7M|        }
   88|  35.9M|      }
   89|       |
   90|       |      /* linear interpolation for evaluating the root */
   91|  8.97M|      x_lin_interp = x_low - y_low * (x_high - x_low) / (y_high - y_low);
   92|       |
   93|  8.97M|      lsp[num_found_freeq] = x_lin_interp;
   94|  8.97M|      num_found_freeq++;
   95|       |
   96|  8.97M|      is_first_polyn = 1 - is_first_polyn;
   97|  8.97M|      p_sum_polyn = is_first_polyn ? diff_polyn : sum_polyn;
  ------------------
  |  Branch (97:21): [True: 4.48M, False: 4.48M]
  ------------------
   98|       |
   99|  8.97M|      x_low = x_lin_interp;
  100|  8.97M|      y_low = iusace_lpc_eval_chebyshev_polyn(x_low, p_sum_polyn, ORDER_BY_2);
  ------------------
  |  |   72|  8.97M|#define ORDER_BY_2 (8)
  ------------------
  101|  8.97M|    }
  102|  62.6M|  }
  103|       |
  104|       |  /* Check if ORDER roots found */
  105|       |  /* if not use the LSPs from previous frame */
  106|   561k|  if (num_found_freeq < ORDER) {
  ------------------
  |  |   71|   561k|#define ORDER (16)
  ------------------
  |  Branch (106:7): [True: 0, False: 561k]
  ------------------
  107|      0|    for (i = 0; i < ORDER; i++) lsp[i] = prev_lsp[i];
  ------------------
  |  |   71|      0|#define ORDER (16)
  ------------------
  |  Branch (107:17): [True: 0, False: 0]
  ------------------
  108|      0|  }
  109|   561k|}
iusace_lsp_to_lp_conversion:
  131|  7.99M|VOID iusace_lsp_to_lp_conversion(FLOAT32 *lsp, FLOAT32 *lp_flt_coff_a) {
  132|  7.99M|  WORD32 i;
  133|  7.99M|  FLOAT32 *ppoly_f1, *ppoly_f2;
  134|  7.99M|  FLOAT32 *plp_flt_coff_a_bott, *plp_flt_coff_a_top;
  135|  7.99M|  FLOAT32 poly1[ORDER_BY_2 + 2], poly2[ORDER_BY_2 + 2];
  136|       |
  137|  7.99M|  poly1[0] = 0.0f;
  138|  7.99M|  poly2[0] = 0.0f;
  139|       |
  140|  7.99M|  iusace_compute_coeff_poly_f(lsp, &poly1[1], &poly2[1]);
  141|       |
  142|  7.99M|  ppoly_f1 = poly1 + ORDER_BY_2 + 1;
  ------------------
  |  |   72|  7.99M|#define ORDER_BY_2 (8)
  ------------------
  143|  7.99M|  ppoly_f2 = poly2 + ORDER_BY_2 + 1;
  ------------------
  |  |   72|  7.99M|#define ORDER_BY_2 (8)
  ------------------
  144|       |
  145|  71.9M|  for (i = 0; i < ORDER_BY_2; i++) {
  ------------------
  |  |   72|  71.9M|#define ORDER_BY_2 (8)
  ------------------
  |  Branch (145:15): [True: 63.9M, False: 7.99M]
  ------------------
  146|  63.9M|    ppoly_f1[0] += ppoly_f1[-1];
  147|  63.9M|    ppoly_f2[0] -= ppoly_f2[-1];
  148|  63.9M|    ppoly_f1--;
  149|  63.9M|    ppoly_f2--;
  150|  63.9M|  }
  151|       |
  152|  7.99M|  plp_flt_coff_a_bott = lp_flt_coff_a;
  153|  7.99M|  *plp_flt_coff_a_bott++ = 1.0f;
  154|  7.99M|  plp_flt_coff_a_top = lp_flt_coff_a + ORDER;
  ------------------
  |  |   71|  7.99M|#define ORDER (16)
  ------------------
  155|  7.99M|  ppoly_f1 = poly1 + 2;
  156|  7.99M|  ppoly_f2 = poly2 + 2;
  157|  71.9M|  for (i = 0; i < ORDER_BY_2; i++) {
  ------------------
  |  |   72|  71.9M|#define ORDER_BY_2 (8)
  ------------------
  |  Branch (157:15): [True: 63.9M, False: 7.99M]
  ------------------
  158|  63.9M|    *plp_flt_coff_a_bott++ = 0.5f * (*ppoly_f1 + *ppoly_f2);
  159|  63.9M|    *plp_flt_coff_a_top-- = 0.5f * (*ppoly_f1++ - *ppoly_f2++);
  160|  63.9M|  }
  161|  7.99M|}
iusace_levinson_durbin_algo:
  163|   561k|VOID iusace_levinson_durbin_algo(FLOAT32 *auto_corr_input, FLOAT32 *lpc) {
  164|   561k|  WORD32 i, j;
  165|   561k|  FLOAT32 lpc_val, sum, sigma;
  166|   561k|  FLOAT32 reflection_coeffs[LEV_DUR_MAX_ORDER];
  167|       |
  168|   561k|  lpc[0] = 1.0f;
  169|       |
  170|   561k|  reflection_coeffs[0] = -auto_corr_input[1] / auto_corr_input[0];
  171|   561k|  lpc[1] = reflection_coeffs[0];
  172|   561k|  sigma = auto_corr_input[0] + auto_corr_input[1] * reflection_coeffs[0];
  173|       |
  174|  8.97M|  for (i = 2; i <= ORDER; i++) {
  ------------------
  |  |   71|  8.97M|#define ORDER (16)
  ------------------
  |  Branch (174:15): [True: 8.41M, False: 561k]
  ------------------
  175|  8.41M|    sum = 0.0f;
  176|  84.1M|    for (j = 0; j < i; j++) sum += auto_corr_input[i - j] * lpc[j];
  ------------------
  |  Branch (176:17): [True: 75.7M, False: 8.41M]
  ------------------
  177|  8.41M|    reflection_coeffs[i - 1] = -sum / sigma;
  178|       |
  179|  8.41M|    sigma = sigma * (1.0f - reflection_coeffs[i - 1] * reflection_coeffs[i - 1]);
  180|       |
  181|  8.41M|    if (sigma <= 1.0E-09f) {
  ------------------
  |  Branch (181:9): [True: 0, False: 8.41M]
  ------------------
  182|      0|      for (j = i; j <= ORDER; j++) {
  ------------------
  |  |   71|      0|#define ORDER (16)
  ------------------
  |  Branch (182:19): [True: 0, False: 0]
  ------------------
  183|      0|        reflection_coeffs[j - 1] = 0.0f;
  184|      0|        lpc[j] = 0.0f;
  185|      0|      }
  186|      0|      break;
  187|      0|    }
  188|       |
  189|  44.3M|    for (j = 1; j <= (i / 2); j++) {
  ------------------
  |  Branch (189:17): [True: 35.9M, False: 8.41M]
  ------------------
  190|  35.9M|      lpc_val = lpc[j] + reflection_coeffs[i - 1] * lpc[i - j];
  191|  35.9M|      lpc[i - j] += reflection_coeffs[i - 1] * lpc[j];
  192|  35.9M|      lpc[j] = lpc_val;
  193|  35.9M|    }
  194|       |
  195|  8.41M|    lpc[i] = reflection_coeffs[i - 1];
  196|  8.41M|  }
  197|   561k|}
iusace_get_weighted_lpc:
  199|  31.0M|VOID iusace_get_weighted_lpc(FLOAT32 *lpc, FLOAT32 *weighted_lpc) {
  200|  31.0M|  WORD32 i;
  201|   558M|  for (i = 0; i <= ORDER; i++) {
  ------------------
  |  |   71|   558M|#define ORDER (16)
  ------------------
  |  Branch (201:15): [True: 527M, False: 31.0M]
  ------------------
  202|   527M|    weighted_lpc[i] = iusace_gamma_table[i] * lpc[i];
  203|   527M|  }
  204|  31.0M|}
iusace_lsp_2_lsf_conversion:
  206|   696k|VOID iusace_lsp_2_lsf_conversion(FLOAT32 *lsp, FLOAT32 *lsf) {
  207|   696k|  WORD32 i;
  208|  11.8M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  11.8M|#define ORDER (16)
  ------------------
  |  Branch (208:15): [True: 11.1M, False: 696k]
  ------------------
  209|  11.1M|    lsf[i] = (FLOAT32)(acos(lsp[i]) * LSP_2_LSF_SCALE);
  ------------------
  |  |  168|  11.1M|#define LSP_2_LSF_SCALE (6400.0 / PI)
  |  |  ------------------
  |  |  |  |   30|  11.1M|#define PI (3.14159265358979323846f)
  |  |  ------------------
  ------------------
  210|  11.1M|  }
  211|   696k|}
iusace_lsf_2_lsp_conversion:
  213|   561k|VOID iusace_lsf_2_lsp_conversion(FLOAT32 *lsf, FLOAT32 *lsp) {
  214|   561k|  WORD32 i;
  215|  9.53M|  for (i = 0; i < ORDER; i++) lsp[i] = (FLOAT32)cos((FLOAT64)lsf[i] * (FLOAT64)PI_BY_6400);
  ------------------
  |  |   71|  9.53M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsp[i] = (FLOAT32)cos((FLOAT64)lsf[i] * (FLOAT64)PI_BY_6400);
  ------------------
  |  |  165|  8.97M|#define PI_BY_6400 (PI / 6400.0)
  |  |  ------------------
  |  |  |  |   30|  8.97M|#define PI (3.14159265358979323846f)
  |  |  ------------------
  ------------------
  |  Branch (215:15): [True: 8.97M, False: 561k]
  ------------------
  216|   561k|}
iusace_lpc.c:iusace_lpc_eval_chebyshev_polyn:
   30|   108M|static FLOAT32 iusace_lpc_eval_chebyshev_polyn(FLOAT32 x, FLOAT32 *coefs, WORD32 order) {
   31|   108M|  WORD32 i;
   32|   108M|  FLOAT32 b0, b1, b2, x2;
   33|   108M|  x2 = 2.0f * x;
   34|   108M|  b2 = 1.0f;
   35|   108M|  b1 = x2 + coefs[1];
   36|   756M|  for (i = 2; i < order; i++) {
  ------------------
  |  Branch (36:15): [True: 648M, False: 108M]
  ------------------
   37|   648M|    b0 = x2 * b1 - b2 + coefs[i];
   38|   648M|    b2 = b1;
   39|   648M|    b1 = b0;
   40|   648M|  }
   41|   108M|  return (x * b1 - b2 + 0.5f * coefs[order]);
   42|   108M|}
iusace_lpc.c:iusace_compute_coeff_poly_f:
  111|  7.99M|static VOID iusace_compute_coeff_poly_f(FLOAT32 *lsp, FLOAT32 *poly1, FLOAT32 *poly2) {
  112|  7.99M|  FLOAT32 b1, b2;
  113|  7.99M|  FLOAT32 *ptr_lsp;
  114|  7.99M|  WORD32 i, j;
  115|       |
  116|  7.99M|  ptr_lsp = lsp;
  117|  7.99M|  poly1[0] = poly2[0] = 1.0f;
  118|       |
  119|  71.9M|  for (i = 1; i <= ORDER_BY_2; i++) {
  ------------------
  |  |   72|  71.9M|#define ORDER_BY_2 (8)
  ------------------
  |  Branch (119:15): [True: 63.9M, False: 7.99M]
  ------------------
  120|  63.9M|    b1 = -2.0f * (*ptr_lsp++);
  121|  63.9M|    b2 = -2.0f * (*ptr_lsp++);
  122|  63.9M|    poly1[i] = (b1 * poly1[i - 1]) + (2.0f * poly1[i - 2]);
  123|  63.9M|    poly2[i] = (b2 * poly2[i - 1]) + (2.0f * poly2[i - 2]);
  124|   287M|    for (j = i - 1; j > 0; j--) {
  ------------------
  |  Branch (124:21): [True: 223M, False: 63.9M]
  ------------------
  125|   223M|      poly1[j] += (b1 * poly1[j - 1]) + poly1[j - 2];
  126|   223M|      poly2[j] += (b2 * poly2[j - 1]) + poly2[j - 2];
  127|   223M|    }
  128|  63.9M|  }
  129|  7.99M|}

iusace_quantize_lpc_avq:
  206|   139k|                             WORD32 *ptr_lpc_idx, WORD32 *nb_indices, WORD32 *nbbits) {
  207|   139k|  WORD32 i;
  208|   139k|  FLOAT32 lsfq[ORDER];
  209|   139k|  WORD32 *ptr_index, indxt[100], num_bits, nbt, nit;
  210|       |
  211|   139k|  ptr_index = &ptr_lpc_idx[0];
  212|   139k|  *nb_indices = 0;
  213|   139k|  *nbbits = 0;
  214|       |
  215|   139k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER]);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER]);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  216|       |
  217|   139k|  nbt = iusace_avq_first_approx_rel(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                nbt = iusace_avq_first_approx_rel(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  218|   139k|  nit = 1 + iusace_get_num_params(&ptr_lpc_idx[1]);
  219|       |
  220|   139k|  ptr_index += nit;
  221|   139k|  *nb_indices += nit;
  222|   139k|  *nbbits += 8 + nbt;
  223|       |
  224|   139k|  if (lpc0) {
  ------------------
  |  Branch (224:7): [True: 4.19k, False: 135k]
  ------------------
  225|  4.19k|    *ptr_index = 0;
  226|  4.19k|    ptr_index++;
  227|  4.19k|    *nb_indices += 1;
  228|  4.19k|    *nbbits += 1;
  229|       |
  230|  4.19k|    ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER]);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER]);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  231|       |
  232|  4.19k|    num_bits = iusace_avq_first_approx_rel(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  233|  4.19k|    nbt = 8 + num_bits;
  234|  4.19k|    nit = 1 + iusace_get_num_params(&ptr_index[1]);
  235|       |
  236|  71.3k|    for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  71.3k|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  67.1k|#define ORDER (16)
  ------------------
  |  Branch (236:17): [True: 67.1k, False: 4.19k]
  ------------------
  237|       |
  238|  4.19k|    num_bits = iusace_avq_first_approx_rel(&ptr_lsf[-ORDER], &lsfq[0], indxt, 3);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  239|       |
  240|  4.19k|    if (num_bits < nbt) {
  ------------------
  |  Branch (240:9): [True: 3.95k, False: 245]
  ------------------
  241|  3.95k|      nbt = num_bits;
  242|  3.95k|      nit = iusace_get_num_params(&indxt[0]);
  243|  3.95k|      ptr_index[-1] = 1;
  244|  67.1k|      for (i = 0; i < ORDER; i++) ptr_lsfq[-ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  67.1k|#define ORDER (16)
  ------------------
                    for (i = 0; i < ORDER; i++) ptr_lsfq[-ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  63.2k|#define ORDER (16)
  ------------------
  |  Branch (244:19): [True: 63.2k, False: 3.95k]
  ------------------
  245|  55.2k|      for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (245:19): [True: 51.2k, False: 3.95k]
  ------------------
  246|  3.95k|    }
  247|       |
  248|  4.19k|    ptr_index += nit;
  249|  4.19k|    *nb_indices += nit;
  250|  4.19k|    *nbbits += nbt;
  251|  4.19k|  }
  252|       |
  253|   139k|  *ptr_index = 0;
  254|   139k|  ptr_index++;
  255|   139k|  *nb_indices += 1;
  256|   139k|  *nbbits += 1;
  257|       |
  258|   139k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[ORDER], &ptr_lsfq[ORDER]);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[ORDER], &ptr_lsfq[ORDER]);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  259|       |
  260|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[ORDER], &ptr_lsfq[ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                num_bits = iusace_avq_first_approx_rel(&ptr_lsf[ORDER], &ptr_lsfq[ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  261|   139k|  nbt = 8 + num_bits;
  262|   139k|  nit = 1 + iusace_get_num_params(&ptr_index[1]);
  263|       |
  264|  2.36M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.36M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  |  Branch (264:15): [True: 2.22M, False: 139k]
  ------------------
  265|       |
  266|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[ORDER], &lsfq[0], indxt, 3);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  267|       |
  268|   139k|  if (num_bits < nbt) {
  ------------------
  |  Branch (268:7): [True: 103k, False: 35.2k]
  ------------------
  269|   103k|    nbt = num_bits;
  270|   103k|    nit = iusace_get_num_params(&indxt[0]);
  271|   103k|    ptr_index[-1] = 1;
  272|  1.76M|    for (i = 0; i < ORDER; i++) ptr_lsfq[ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  1.76M|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  1.66M|#define ORDER (16)
  ------------------
  |  Branch (272:17): [True: 1.66M, False: 103k]
  ------------------
  273|  1.27M|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (273:17): [True: 1.17M, False: 103k]
  ------------------
  274|   103k|  }
  275|       |
  276|   139k|  ptr_index += nit;
  277|   139k|  *nb_indices += nit;
  278|   139k|  *nbbits += nbt;
  279|       |
  280|   139k|  *ptr_index = 0;
  281|   139k|  ptr_index++;
  282|   139k|  *nb_indices += 1;
  283|       |
  284|   139k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[0], &ptr_lsfq[0]);
  285|       |
  286|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[0], &ptr_lsfq[0], &ptr_index[1], 0);
  287|   139k|  nbt = 2 + 8 + num_bits;
  288|   139k|  nit = 1 + iusace_get_num_params(&ptr_index[1]);
  289|       |
  290|  2.36M|  for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[-ORDER + i] + ptr_lsfq[ORDER + i]);
  ------------------
  |  |   71|  2.36M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[-ORDER + i] + ptr_lsfq[ORDER + i]);
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[-ORDER + i] + ptr_lsfq[ORDER + i]);
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  |  Branch (290:15): [True: 2.22M, False: 139k]
  ------------------
  291|       |
  292|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[0], lsfq, indxt, 1);
  293|       |
  294|   139k|  if (num_bits < 10) {
  ------------------
  |  Branch (294:7): [True: 65.9k, False: 73.2k]
  ------------------
  295|  65.9k|    nbt = 2;
  296|  65.9k|    nit = 0;
  297|  65.9k|    ptr_index[-1] = 1;
  298|  1.12M|    for (i = 0; i < ORDER; i++) ptr_lsfq[i] = lsfq[i];
  ------------------
  |  |   71|  1.12M|#define ORDER (16)
  ------------------
  |  Branch (298:17): [True: 1.05M, False: 65.9k]
  ------------------
  299|  65.9k|  }
  300|       |
  301|  2.36M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.36M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  |  Branch (301:15): [True: 2.22M, False: 139k]
  ------------------
  302|       |
  303|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[0], lsfq, indxt, 2);
  304|   139k|  num_bits += 1;
  305|       |
  306|   139k|  if (num_bits < nbt) {
  ------------------
  |  Branch (306:7): [True: 54.1k, False: 85.0k]
  ------------------
  307|  54.1k|    nbt = num_bits;
  308|  54.1k|    nit = iusace_get_num_params(&indxt[0]);
  309|  54.1k|    ptr_index[-1] = 2;
  310|   920k|    for (i = 0; i < ORDER; i++) ptr_lsfq[i] = lsfq[i];
  ------------------
  |  |   71|   920k|#define ORDER (16)
  ------------------
  |  Branch (310:17): [True: 865k, False: 54.1k]
  ------------------
  311|  1.02M|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (311:17): [True: 966k, False: 54.1k]
  ------------------
  312|  54.1k|  }
  313|       |
  314|   139k|  ptr_index += nit;
  315|   139k|  *nb_indices += nit;
  316|   139k|  *nbbits += nbt;
  317|       |
  318|   139k|  *ptr_index = 0;
  319|   139k|  ptr_index++;
  320|   139k|  *nb_indices += 1;
  321|       |
  322|   139k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER]);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER]);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  323|       |
  324|   139k|  num_bits =
  325|   139k|      iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                    iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  326|   139k|  nbt = 2 + 8 + num_bits;
  327|   139k|  nit = 1 + iusace_get_num_params(&ptr_index[1]);
  328|       |
  329|  2.36M|  for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[ORDER + i] + ptr_lsfq[3 * ORDER + i]);
  ------------------
  |  |   71|  2.36M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[ORDER + i] + ptr_lsfq[3 * ORDER + i]);
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[ORDER + i] + ptr_lsfq[3 * ORDER + i]);
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  |  Branch (329:15): [True: 2.22M, False: 139k]
  ------------------
  330|       |
  331|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], lsfq, indxt, 1);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  332|   139k|  num_bits += 1;
  333|       |
  334|   139k|  if (num_bits < nbt) {
  ------------------
  |  Branch (334:7): [True: 133k, False: 6.12k]
  ------------------
  335|   133k|    nbt = num_bits;
  336|   133k|    nit = iusace_get_num_params(&indxt[0]);
  337|   133k|    ptr_index[-1] = 1;
  338|  2.26M|    for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  2.26M|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  2.12M|#define ORDER (16)
  ------------------
  |  Branch (338:17): [True: 2.12M, False: 133k]
  ------------------
  339|  1.47M|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (339:17): [True: 1.34M, False: 133k]
  ------------------
  340|   133k|  }
  341|       |
  342|  2.36M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.36M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  |  Branch (342:15): [True: 2.22M, False: 139k]
  ------------------
  343|       |
  344|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], lsfq, indxt, 2);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  345|   139k|  num_bits += 3;
  346|       |
  347|   139k|  if (num_bits < nbt) {
  ------------------
  |  Branch (347:7): [True: 6.35k, False: 132k]
  ------------------
  348|  6.35k|    nbt = num_bits;
  349|  6.35k|    nit = iusace_get_num_params(&indxt[0]);
  350|  6.35k|    ptr_index[-1] = 2;
  351|   108k|    for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   108k|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   101k|#define ORDER (16)
  ------------------
  |  Branch (351:17): [True: 101k, False: 6.35k]
  ------------------
  352|  86.4k|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (352:17): [True: 80.1k, False: 6.35k]
  ------------------
  353|  6.35k|  }
  354|       |
  355|  2.36M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.36M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.22M|#define ORDER (16)
  ------------------
  |  Branch (355:15): [True: 2.22M, False: 139k]
  ------------------
  356|       |
  357|   139k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], lsfq, indxt, 2);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  358|   139k|  num_bits += 3;
  359|       |
  360|   139k|  if (num_bits < nbt) {
  ------------------
  |  Branch (360:7): [True: 33.9k, False: 105k]
  ------------------
  361|  33.9k|    nbt = num_bits;
  362|  33.9k|    nit = iusace_get_num_params(&indxt[0]);
  363|  33.9k|    ptr_index[-1] = 3;
  364|   577k|    for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   577k|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   543k|#define ORDER (16)
  ------------------
  |  Branch (364:17): [True: 543k, False: 33.9k]
  ------------------
  365|   575k|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (365:17): [True: 541k, False: 33.9k]
  ------------------
  366|  33.9k|  }
  367|       |
  368|   139k|  *nb_indices += nit;
  369|   139k|  *nbbits += nbt;
  370|       |
  371|   139k|  return;
  372|   139k|}
iusace_lpc_avq.c:iusace_avq_first_approx_abs:
   86|   561k|static WORD32 iusace_avq_first_approx_abs(FLOAT32 *lsf, FLOAT32 *lsfq) {
   87|   561k|  WORD32 i, j, index;
   88|   561k|  FLOAT32 w[ORDER];
   89|   561k|  FLOAT32 dist_min, dist, temp;
   90|   561k|  const FLOAT32 *p_dico;
   91|       |
   92|   561k|  iusace_lsf_weight(lsf, w);
   93|       |
   94|   561k|  dist_min = 1.0e30f;
   95|   561k|  p_dico = iusace_dico_lsf_abs_8b_flt;
   96|   561k|  index = 0;
   97|       |
   98|   144M|  for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (98:15): [True: 143M, False: 561k]
  ------------------
   99|   143M|    dist = 0.0;
  100|  2.44G|    for (j = 0; j < ORDER; j++) {
  ------------------
  |  |   71|  2.44G|#define ORDER (16)
  ------------------
  |  Branch (100:17): [True: 2.29G, False: 143M]
  ------------------
  101|  2.29G|      temp = lsf[j] - *p_dico++;
  102|  2.29G|      dist += w[j] * temp * temp;
  103|  2.29G|    }
  104|   143M|    if (dist < dist_min) {
  ------------------
  |  Branch (104:9): [True: 3.89M, False: 139M]
  ------------------
  105|  3.89M|      dist_min = dist;
  106|  3.89M|      index = i;
  107|  3.89M|    }
  108|   143M|  }
  109|       |
  110|  9.53M|  for (j = 0; j < ORDER; j++) {
  ------------------
  |  |   71|  9.53M|#define ORDER (16)
  ------------------
  |  Branch (110:15): [True: 8.97M, False: 561k]
  ------------------
  111|  8.97M|    lsfq[j] = iusace_dico_lsf_abs_8b_flt[index * ORDER + j];
  ------------------
  |  |   71|  8.97M|#define ORDER (16)
  ------------------
  112|  8.97M|  }
  113|       |
  114|   561k|  return index;
  115|   561k|}
iusace_lpc_avq.c:iusace_lsf_weight:
   69|   561k|static VOID iusace_lsf_weight(FLOAT32 *lsf, FLOAT32 *ptr_w) {
   70|   561k|  WORD32 i;
   71|   561k|  FLOAT32 d[ORDER + 1];
   72|       |
   73|   561k|  d[0] = lsf[0];
   74|   561k|  d[ORDER] = FREQ_MAX - lsf[ORDER - 1];
  ------------------
  |  |   71|   561k|#define ORDER (16)
  ------------------
                d[ORDER] = FREQ_MAX - lsf[ORDER - 1];
  ------------------
  |  |  169|   561k|#define FREQ_MAX (6400.0f)
  ------------------
                d[ORDER] = FREQ_MAX - lsf[ORDER - 1];
  ------------------
  |  |   71|   561k|#define ORDER (16)
  ------------------
   75|  8.97M|  for (i = 1; i < ORDER; i++) {
  ------------------
  |  |   71|  8.97M|#define ORDER (16)
  ------------------
  |  Branch (75:15): [True: 8.41M, False: 561k]
  ------------------
   76|  8.41M|    d[i] = lsf[i] - lsf[i - 1];
   77|  8.41M|  }
   78|       |
   79|  9.53M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  9.53M|#define ORDER (16)
  ------------------
  |  Branch (79:15): [True: 8.97M, False: 561k]
  ------------------
   80|  8.97M|    ptr_w[i] = (1.0f / d[i]) + (1.0f / d[i + 1]);
   81|  8.97M|  }
   82|       |
   83|   561k|  return;
   84|   561k|}
iusace_lpc_avq.c:iusace_avq_first_approx_rel:
  118|  1.40M|                                          WORD32 mode) {
  119|  1.40M|  WORD32 i, num_bits;
  120|  1.40M|  FLOAT32 w[ORDER], x[ORDER], temp;
  121|  1.40M|  WORD32 nq, avq[ORDER];
  122|  1.40M|  FLOAT32 lsf_min;
  123|       |
  124|  1.40M|  iusace_lsf_weight_2st_flt(ptr_lsf, w, 1);
  125|       |
  126|  1.40M|  temp = 0.0f;
  127|  23.8M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  23.8M|#define ORDER (16)
  ------------------
  |  Branch (127:15): [True: 22.4M, False: 1.40M]
  ------------------
  128|  22.4M|    x[i] = (ptr_lsf[i] - ptr_lsfq[i]) / w[i];
  129|  22.4M|    temp += x[i] * x[i];
  130|  22.4M|  }
  131|       |
  132|  1.40M|  if (temp < 8.0f) {
  ------------------
  |  Branch (132:7): [True: 378k, False: 1.02M]
  ------------------
  133|   378k|    idx[0] = 0;
  134|   378k|    idx[1] = 0;
  135|   378k|    if ((mode == 0) || (mode == 3)) {
  ------------------
  |  Branch (135:9): [True: 31.1k, False: 347k]
  |  Branch (135:24): [True: 47.9k, False: 299k]
  ------------------
  136|  79.1k|      return (10);
  137|   299k|    } else if (mode == 1) {
  ------------------
  |  Branch (137:16): [True: 133k, False: 166k]
  ------------------
  138|   133k|      return (2);
  139|   166k|    } else {
  140|   166k|      return (6);
  141|   166k|    }
  142|   378k|  }
  143|       |
  144|  1.02M|  iusace_lsf_weight_2st_flt(ptr_lsfq, w, mode);
  145|       |
  146|  17.3M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  17.3M|#define ORDER (16)
  ------------------
  |  Branch (146:15): [True: 16.3M, False: 1.02M]
  ------------------
  147|  16.3M|    x[i] = (ptr_lsf[i] - ptr_lsfq[i]) / w[i];
  148|  16.3M|  }
  149|       |
  150|  1.02M|  iusace_alg_vec_quant(x, avq, idx);
  151|       |
  152|  17.3M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  17.3M|#define ORDER (16)
  ------------------
  |  Branch (152:15): [True: 16.3M, False: 1.02M]
  ------------------
  153|  16.3M|    ptr_lsfq[i] += (w[i] * (FLOAT32)avq[i]);
  154|  16.3M|  }
  155|       |
  156|  1.02M|  num_bits = 0;
  157|  3.06M|  for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (157:15): [True: 2.04M, False: 1.02M]
  ------------------
  158|  2.04M|    nq = idx[i];
  159|       |
  160|  2.04M|    if ((mode == 0) || (mode == 3)) {
  ------------------
  |  Branch (160:9): [True: 1.05M, False: 984k]
  |  Branch (160:24): [True: 190k, False: 793k]
  ------------------
  161|  1.25M|      num_bits += (2 + (nq * 4));
  162|  1.25M|      if (nq > 6) {
  ------------------
  |  Branch (162:11): [True: 202k, False: 1.04M]
  ------------------
  163|   202k|        num_bits += nq - 3;
  164|  1.04M|      } else if (nq > 4) {
  ------------------
  |  Branch (164:18): [True: 510k, False: 537k]
  ------------------
  165|   510k|        num_bits += nq - 4;
  166|   537k|      } else if (nq == 0) {
  ------------------
  |  Branch (166:18): [True: 126k, False: 411k]
  ------------------
  167|   126k|        num_bits += 3;
  168|   126k|      }
  169|  1.25M|    } else if (mode == 1) {
  ------------------
  |  Branch (169:16): [True: 290k, False: 503k]
  ------------------
  170|   290k|      num_bits += nq * 5;
  171|   290k|      if (nq == 0) {
  ------------------
  |  Branch (171:11): [True: 33.5k, False: 257k]
  ------------------
  172|  33.5k|        num_bits += 1;
  173|  33.5k|      }
  174|   503k|    } else {
  175|   503k|      num_bits += (2 + (nq * 4));
  176|   503k|      if (nq == 0) {
  ------------------
  |  Branch (176:11): [True: 28.2k, False: 474k]
  ------------------
  177|  28.2k|        num_bits += 1;
  178|   474k|      } else if (nq > 4) {
  ------------------
  |  Branch (178:18): [True: 139k, False: 335k]
  ------------------
  179|   139k|        num_bits += nq - 3;
  180|   139k|      }
  181|   503k|    }
  182|  2.04M|  }
  183|       |
  184|  1.02M|  lsf_min = LSF_GAP;
  ------------------
  |  |  173|  1.02M|#define LSF_GAP (50.0f)
  ------------------
  185|  17.3M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  17.3M|#define ORDER (16)
  ------------------
  |  Branch (185:15): [True: 16.3M, False: 1.02M]
  ------------------
  186|  16.3M|    if (ptr_lsfq[i] < lsf_min) {
  ------------------
  |  Branch (186:9): [True: 518k, False: 15.8M]
  ------------------
  187|   518k|      ptr_lsfq[i] = lsf_min;
  188|   518k|    }
  189|       |
  190|  16.3M|    lsf_min = ptr_lsfq[i] + LSF_GAP;
  ------------------
  |  |  173|  16.3M|#define LSF_GAP (50.0f)
  ------------------
  191|  16.3M|  }
  192|       |
  193|  1.02M|  lsf_min = FREQ_MAX - LSF_GAP;
  ------------------
  |  |  169|  1.02M|#define FREQ_MAX (6400.0f)
  ------------------
                lsf_min = FREQ_MAX - LSF_GAP;
  ------------------
  |  |  173|  1.02M|#define LSF_GAP (50.0f)
  ------------------
  194|  17.3M|  for (i = ORDER - 1; i >= 0; i--) {
  ------------------
  |  |   71|  1.02M|#define ORDER (16)
  ------------------
  |  Branch (194:23): [True: 16.3M, False: 1.02M]
  ------------------
  195|  16.3M|    if (ptr_lsfq[i] > lsf_min) {
  ------------------
  |  Branch (195:9): [True: 43.8k, False: 16.3M]
  ------------------
  196|  43.8k|      ptr_lsfq[i] = lsf_min;
  197|  43.8k|    }
  198|       |
  199|  16.3M|    lsf_min = ptr_lsfq[i] - LSF_GAP;
  ------------------
  |  |  173|  16.3M|#define LSF_GAP (50.0f)
  ------------------
  200|  16.3M|  }
  201|       |
  202|  1.02M|  return (num_bits);
  203|  1.40M|}
iusace_lpc_avq.c:iusace_lsf_weight_2st_flt:
   54|  2.42M|static VOID iusace_lsf_weight_2st_flt(FLOAT32 *lsfq, FLOAT32 *w, WORD32 mode) {
   55|  2.42M|  WORD32 i;
   56|  2.42M|  FLOAT32 d[ORDER + 1];
   57|       |
   58|  2.42M|  d[0] = lsfq[0];
   59|  2.42M|  d[ORDER] = FREQ_MAX - lsfq[ORDER - 1];
  ------------------
  |  |   71|  2.42M|#define ORDER (16)
  ------------------
                d[ORDER] = FREQ_MAX - lsfq[ORDER - 1];
  ------------------
  |  |  169|  2.42M|#define FREQ_MAX (6400.0f)
  ------------------
                d[ORDER] = FREQ_MAX - lsfq[ORDER - 1];
  ------------------
  |  |   71|  2.42M|#define ORDER (16)
  ------------------
   60|  38.7M|  for (i = 1; i < ORDER; i++) {
  ------------------
  |  |   71|  38.7M|#define ORDER (16)
  ------------------
  |  Branch (60:15): [True: 36.3M, False: 2.42M]
  ------------------
   61|  36.3M|    d[i] = lsfq[i] - lsfq[i - 1];
   62|  36.3M|  }
   63|       |
   64|  41.1M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  41.1M|#define ORDER (16)
  ------------------
  |  Branch (64:15): [True: 38.7M, False: 2.42M]
  ------------------
   65|  38.7M|    w[i] = (FLOAT32)(iusace_wlsf_factor_table[mode] / (FREQ_DIV / sqrt(d[i] * d[i + 1])));
  ------------------
  |  |  170|  38.7M|#define FREQ_DIV (400.0f)
  ------------------
   66|  38.7M|  }
   67|  2.42M|}

iusace_init_td_data:
   59|  2.24k|VOID iusace_init_td_data(ia_usac_td_encoder_struct *st, WORD32 len_frame) {
   60|  2.24k|  WORD32 len_window;
   61|  2.24k|  WORD32 num_frames = NUM_FRAMES;
  ------------------
  |  |   75|  2.24k|#define NUM_FRAMES (4)
  ------------------
   62|  2.24k|  st->len_subfrm = len_frame / num_frames;
   63|       |
   64|  2.24k|  st->len_frame = len_frame;
   65|  2.24k|  st->num_subfrm = (MAX_NUM_SUBFR * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   76|  2.24k|#define MAX_NUM_SUBFR (4)
  ------------------
                st->num_subfrm = (MAX_NUM_SUBFR * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   66|  2.24k|#define LEN_SUPERFRAME (1024)
  ------------------
   66|       |
   67|  2.24k|  iusace_reset_td_enc(st);
   68|  2.24k|  st->prev_mode = -1;
   69|  2.24k|  st->arith_reset_flag = 1;
   70|       |
   71|  2.24k|  if (st->fscale <= FSCALE_DENOM) {
  ------------------
  |  |   92|  2.24k|#define FSCALE_DENOM (12800)
  ------------------
  |  Branch (71:7): [True: 886, False: 1.36k]
  ------------------
   72|    886|    len_window = (LEN_LP_WINDOW * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   86|    886|#define LEN_LP_WINDOW (448)
  ------------------
                  len_window = (LEN_LP_WINDOW * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   66|    886|#define LEN_SUPERFRAME (1024)
  ------------------
   73|  1.36k|  } else {
   74|  1.36k|    len_window = (LEN_LP_WINDOW_HIGH_RATE * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   87|  1.36k|#define LEN_LP_WINDOW_HIGH_RATE (512)
  ------------------
                  len_window = (LEN_LP_WINDOW_HIGH_RATE * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   66|  1.36k|#define LEN_SUPERFRAME (1024)
  ------------------
   75|  1.36k|  }
   76|       |
   77|  2.24k|  switch (len_window) {
   78|  1.02k|    case 512:
  ------------------
  |  Branch (78:5): [True: 1.02k, False: 1.22k]
  ------------------
   79|  1.02k|      st->lp_analysis_window = iusace_cos_window_512;
   80|  1.02k|      break;
   81|    726|    case 448:
  ------------------
  |  Branch (81:5): [True: 726, False: 1.52k]
  ------------------
   82|    726|      st->lp_analysis_window = iusace_cos_window_448;
   83|    726|      break;
   84|    341|    case 384:
  ------------------
  |  Branch (84:5): [True: 341, False: 1.90k]
  ------------------
   85|    341|      st->lp_analysis_window = iexheaac_cos_window_384;
   86|    341|      break;
   87|    160|    default:
  ------------------
  |  Branch (87:5): [True: 160, False: 2.08k]
  ------------------
   88|    160|      st->lp_analysis_window = iusace_cos_window_512;
   89|    160|      break;
   90|  2.24k|  }
   91|  2.24k|  return;
   92|  2.24k|}
iusace_config_acelp_core_mode:
   95|  2.24k|                                   WORD32 bitrate) {
   96|  2.24k|  WORD32 max_bits, coder_bits;
   97|  2.24k|  const WORD32 *p_acelp_core_numbits_table;
   98|       |
   99|  2.24k|  p_acelp_core_numbits_table = (WORD32 *)iusace_acelp_core_numbits_1024;
  100|       |
  101|  2.24k|  max_bits = (WORD32)((FLOAT32)(bitrate * LEN_SUPERFRAME) / (FLOAT32)sampling_rate);
  ------------------
  |  |   66|  2.24k|#define LEN_SUPERFRAME (1024)
  ------------------
  102|       |
  103|  3.12k|  for (st->acelp_core_mode = 5; st->acelp_core_mode >= 0; st->acelp_core_mode--) {
  ------------------
  |  Branch (103:33): [True: 3.12k, False: 0]
  ------------------
  104|  3.12k|    coder_bits = p_acelp_core_numbits_table[st->acelp_core_mode];
  105|  3.12k|    if (coder_bits <= max_bits) {
  ------------------
  |  Branch (105:9): [True: 2.24k, False: 878]
  ------------------
  106|  2.24k|      return;
  107|  2.24k|    }
  108|  3.12k|  }
  109|      0|  if (st->acelp_core_mode == -1) {
  ------------------
  |  Branch (109:7): [True: 0, False: 0]
  ------------------
  110|      0|    st->acelp_core_mode = 0;
  111|      0|  }
  112|      0|  return;
  113|  2.24k|}
iusace_reset_td_enc:
  115|  6.44k|VOID iusace_reset_td_enc(ia_usac_td_encoder_struct *st) {
  116|  6.44k|  WORD32 i;
  117|       |
  118|  6.44k|  memset(st->old_speech_pe, 0, (ORDER + LEN_NEXT_HIGH_RATE) * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
                memset(st->old_speech_pe, 0, (ORDER + LEN_NEXT_HIGH_RATE) * sizeof(FLOAT32));
  ------------------
  |  |   84|  6.44k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
  119|  6.44k|  memset(st->prev_exc, 0, (MAX_PITCH + LEN_INTERPOL) * sizeof(FLOAT32));
  ------------------
  |  |  110|  6.44k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|  6.44k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|  6.44k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  6.44k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  6.44k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  6.44k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  6.44k|#define TMIN (34)
  |  |  ------------------
  ------------------
                memset(st->prev_exc, 0, (MAX_PITCH + LEN_INTERPOL) * sizeof(FLOAT32));
  ------------------
  |  |  115|  6.44k|#define LEN_INTERPOL (16 + 1)
  ------------------
  120|  6.44k|  memset(st->prev_wsp, 0, (MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32));
  ------------------
  |  |  110|  6.44k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|  6.44k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|  6.44k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  6.44k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  6.44k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  6.44k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  6.44k|#define TMIN (34)
  |  |  ------------------
  ------------------
                memset(st->prev_wsp, 0, (MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32));
  ------------------
  |  |  116|  6.44k|#define OPL_DECIM (2)
  ------------------
  121|  6.44k|  memset(st->mem_lp_decim2, 0, 3 * sizeof(FLOAT32));
  122|  6.44k|  memset(st->weighted_sig, 0, 128 * sizeof(FLOAT32));
  123|       |
  124|  6.44k|  st->lpd_state.mode = -1;
  125|  6.44k|  st->lpd_state.num_bits = 0;
  126|  6.44k|  memset(st->lpd_state.lpc_coeffs_quant, 0, (2 * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
  127|  6.44k|  memset(st->lpd_state.lpc_coeffs, 0, (2 * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
  128|  6.44k|  memset(st->lpd_state.synth, 0, (ORDER + 128) * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
  129|  6.44k|  memset(st->lpd_state.wsynth, 0, (1 + 128) * sizeof(FLOAT32));
  130|       |
  131|  6.44k|  memset(st->lpd_state.acelp_exc, 0, (2 * LEN_FRAME) * sizeof(FLOAT32));
  ------------------
  |  |   74|  6.44k|#define LEN_FRAME (256)
  ------------------
  132|       |
  133|  6.44k|  memset(st->lpd_state.tcx_mem, 0, 128 * sizeof(FLOAT32));
  134|  6.44k|  memset(st->lpd_state.tcx_quant, 0, (1 + 256) * sizeof(FLOAT32));
  135|  6.44k|  st->lpd_state.tcx_fac = 0.0f;
  136|       |
  137|  6.44k|  memset(st->prev_hp_wsp, 0,
  138|  6.44k|         (LEN_SUPERFRAME / OPL_DECIM + (MAX_PITCH / OPL_DECIM)) * sizeof(FLOAT32));
  ------------------
  |  |   66|  6.44k|#define LEN_SUPERFRAME (1024)
  ------------------
                       (LEN_SUPERFRAME / OPL_DECIM + (MAX_PITCH / OPL_DECIM)) * sizeof(FLOAT32));
  ------------------
  |  |  116|  6.44k|#define OPL_DECIM (2)
  ------------------
                       (LEN_SUPERFRAME / OPL_DECIM + (MAX_PITCH / OPL_DECIM)) * sizeof(FLOAT32));
  ------------------
  |  |  110|  6.44k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|  6.44k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|  6.44k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  6.44k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  6.44k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  6.44k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  6.44k|#define TMIN (34)
  |  |  ------------------
  ------------------
                       (LEN_SUPERFRAME / OPL_DECIM + (MAX_PITCH / OPL_DECIM)) * sizeof(FLOAT32));
  ------------------
  |  |  116|  6.44k|#define OPL_DECIM (2)
  ------------------
  139|       |
  140|  6.44k|  memset(st->hp_ol_ltp_mem, 0, (3 * 2 + 1) * sizeof(FLOAT32));
  141|  38.6k|  for (i = 0; i < 5; i++) st->prev_ol_lags[i] = 40;
  ------------------
  |  Branch (141:15): [True: 32.2k, False: 6.44k]
  ------------------
  142|  6.44k|  st->prev_wsyn_mem = 0.0;
  143|  6.44k|  st->prev_wsp_mem = 0.0;
  144|  6.44k|  st->prev_xnq_mem = 0.0;
  145|  6.44k|  st->mem_wsp = 0.0;
  146|  6.44k|  st->prev_ovlp_size = 0;
  147|  6.44k|  st->prev_pitch_med = 40;
  148|  6.44k|  st->ol_wght_flg = 0;
  149|  6.44k|  st->ada_w = 0.0;
  150|       |
  151|  6.44k|  memcpy(st->isf_old, iusace_lsf_init, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
  152|  6.44k|  memcpy(st->isp_old, iusace_ispold_init, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
  153|  6.44k|  memcpy(st->isp_old_q, st->isp_old, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  6.44k|#define ORDER (16)
  ------------------
  154|       |
  155|  6.44k|  st->mem_preemph = 0.0;
  156|  6.44k|  memset(st->mem_sig_in, 0, 4 * sizeof(FLOAT32));
  157|  6.44k|  memset(st->xn_buffer, 0, 128 * sizeof(FLOAT32));
  158|       |
  159|  6.44k|  return;
  160|  6.44k|}
iusace_highpass_prev_wsp:
  163|  4.19k|                              WORD32 pitch_max) {
  164|  4.19k|  WORD32 i, k;
  165|  4.19k|  WORD32 wsp_offset = pitch_max / OPL_DECIM;
  ------------------
  |  |  116|  4.19k|#define OPL_DECIM (2)
  ------------------
  166|  4.19k|  WORD32 num_frames = (2 * LEN_SUBFR) / OPL_DECIM;
  ------------------
  |  |   77|  4.19k|#define LEN_SUBFR (64)
  ------------------
                WORD32 num_frames = (2 * LEN_SUBFR) / OPL_DECIM;
  ------------------
  |  |  116|  4.19k|#define OPL_DECIM (2)
  ------------------
  167|  4.19k|  FLOAT32 *hp_wsp_mem = st->hp_ol_ltp_mem;
  168|  4.19k|  FLOAT32 *prev_hp_wsp = st->prev_hp_wsp;
  169|  20.1k|  for (i = 0; i < 2 * st->len_subfrm / OPL_DECIM; i += num_frames) {
  ------------------
  |  |  116|  20.1k|#define OPL_DECIM (2)
  ------------------
  |  Branch (169:15): [True: 15.9k, False: 4.19k]
  ------------------
  170|  15.9k|    FLOAT32 *data_a, *data_b, *hp_wsp, o;
  171|  15.9k|    FLOAT32 *wsp = decim_sig + ORDER + i;
  ------------------
  |  |   71|  15.9k|#define ORDER (16)
  ------------------
  172|  15.9k|    data_a = hp_wsp_mem;
  173|  15.9k|    data_b = hp_wsp_mem + HP_ORDER;
  ------------------
  |  |  156|  15.9k|#define HP_ORDER (3)
  ------------------
  174|  15.9k|    hp_wsp = prev_hp_wsp + wsp_offset;
  175|  1.03M|    for (k = 0; k < num_frames; k++) {
  ------------------
  |  Branch (175:17): [True: 1.02M, False: 15.9k]
  ------------------
  176|  1.02M|      data_b[0] = data_b[1];
  177|  1.02M|      data_b[1] = data_b[2];
  178|  1.02M|      data_b[2] = data_b[3];
  179|  1.02M|      data_b[HP_ORDER] = wsp[k];
  ------------------
  |  |  156|  1.02M|#define HP_ORDER (3)
  ------------------
  180|  1.02M|      o = data_b[0] * 0.83787057505665F;
  181|  1.02M|      o += data_b[1] * -2.50975570071058F;
  182|  1.02M|      o += data_b[2] * 2.50975570071058F;
  183|  1.02M|      o += data_b[3] * -0.83787057505665F;
  184|  1.02M|      o -= data_a[0] * -2.64436711600664F;
  185|  1.02M|      o -= data_a[1] * 2.35087386625360F;
  186|  1.02M|      o -= data_a[2] * -0.70001156927424F;
  187|  1.02M|      data_a[2] = data_a[1];
  188|  1.02M|      data_a[1] = data_a[0];
  189|  1.02M|      data_a[0] = o;
  190|  1.02M|      hp_wsp[k] = o;
  191|  1.02M|    }
  192|  15.9k|    memmove(prev_hp_wsp, &prev_hp_wsp[num_frames], wsp_offset * sizeof(FLOAT32));
  193|  15.9k|  }
  194|  4.19k|}
iusace_find_weighted_speech:
  197|  2.02M|                                 FLOAT32 *mem_wsp, WORD32 length) {
  198|  2.02M|  WORD32 i_subfr;
  199|  2.02M|  FLOAT32 weighted_lpc[ORDER + 1];
  200|  11.9M|  for (i_subfr = 0; i_subfr < length; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  9.93M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (200:21): [True: 9.93M, False: 2.02M]
  ------------------
  201|  9.93M|    iusace_get_weighted_lpc(filter_coef, weighted_lpc);
  202|  9.93M|    iusace_compute_lp_residual(weighted_lpc, &speech[i_subfr], &wsp[i_subfr], LEN_SUBFR);
  ------------------
  |  |   77|  9.93M|#define LEN_SUBFR (64)
  ------------------
  203|  9.93M|    filter_coef += (ORDER + 1);
  ------------------
  |  |   71|  9.93M|#define ORDER (16)
  ------------------
  204|  9.93M|  }
  205|  2.02M|  iusace_apply_deemph(wsp, TILT_FAC, length, mem_wsp);
  ------------------
  |  |  118|  2.02M|#define TILT_FAC (0.68f)
  ------------------
  206|  2.02M|  return;
  207|  2.02M|}
iusace_get_interpolated_lpc:
  210|  4.19k|                                 WORD32 num_subfrm) {
  211|  4.19k|  FLOAT32 lsp[ORDER], *p_lpc, inc, fnew, fold;
  212|  4.19k|  WORD32 i, k;
  213|       |
  214|  4.19k|  inc = 1.0f / (FLOAT32)num_subfrm;
  215|  4.19k|  p_lpc = lpc;
  216|  4.19k|  fnew = 0.0f;
  217|       |
  218|  36.1k|  for (k = 0; k < num_subfrm; k++) {
  ------------------
  |  Branch (218:15): [True: 31.9k, False: 4.19k]
  ------------------
  219|  31.9k|    fold = 1.0f - fnew;
  220|   543k|    for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|   543k|#define ORDER (16)
  ------------------
  |  Branch (220:17): [True: 511k, False: 31.9k]
  ------------------
  221|   511k|      lsp[i] = (FLOAT32)(lsp_old[i] * fold + lsp_new[i] * fnew);
  222|   511k|    }
  223|  31.9k|    fnew += inc;
  224|  31.9k|    iusace_lsp_to_lp_conversion(lsp, p_lpc);
  225|  31.9k|    p_lpc += (ORDER + 1);
  ------------------
  |  |   71|  31.9k|#define ORDER (16)
  ------------------
  226|  31.9k|  }
  227|       |
  228|  4.19k|  iusace_lsp_to_lp_conversion(lsp_new, p_lpc);
  229|  4.19k|}
iusace_core_lpd_encode:
  232|   139k|                            WORD32 *num_tcx_param, WORD32 ch_idx) {
  233|   139k|  WORD32 first_lpd_flag = (usac_data->core_mode_prev[ch_idx] == CORE_MODE_FD);
  ------------------
  |  |   33|   139k|#define CORE_MODE_FD (0)
  ------------------
  234|   139k|  iusace_scratch_mem *pstr_scratch = &usac_data->str_scratch;
  235|   139k|  WORD32 pit_adj = usac_data->td_encoder[ch_idx]->fscale;
  236|   139k|  WORD32 *num_fac_bits = &usac_data->num_td_fac_bits[ch_idx];
  237|   139k|  WORD16 *serial_fac_out = usac_data->fac_out_stream[ch_idx];
  238|   139k|  WORD32 *lpc_params = usac_data->param_buf + (NUM_FRAMES * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                WORD32 *lpc_params = usac_data->param_buf + (NUM_FRAMES * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   139k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   139k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   139k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   139k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|   139k|  ia_usac_td_encoder_struct *st = usac_data->td_encoder[ch_idx];
  240|   139k|  WORD32 *acelp_tcx_params = usac_data->param_buf;
  241|   139k|  WORD16 *codec_mode = &st->acelp_core_mode;
  242|   139k|  const FLOAT32 *lp_analysis_window = st->lp_analysis_window;
  243|   139k|  FLOAT32 *lp_filter_coeff = pstr_scratch->p_lp_filter_coeff;
  244|   139k|  FLOAT32 *lp_filter_coeff_q = pstr_scratch->p_lp_filter_coeff_q;
  245|       |
  246|   139k|  FLOAT32 *ptr_stack_mem = (FLOAT32 *)pstr_scratch->ptr_stack_mem;
  247|       |
  248|   139k|  FLOAT32 *auto_corr_vector = ptr_stack_mem;
  249|   139k|  ptr_stack_mem += (ORDER + 1);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  250|   139k|  memset(auto_corr_vector, 0, sizeof(*auto_corr_vector) * (ORDER + 1));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  251|       |
  252|   139k|  FLOAT32 *isp_new = ptr_stack_mem;
  253|   139k|  ptr_stack_mem += ORDER;
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  254|   139k|  memset(isp_new, 0, sizeof(*isp_new) * (ORDER));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  255|       |
  256|   139k|  FLOAT32 *isp_curr = ptr_stack_mem;
  257|   139k|  ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  258|   139k|  memset(isp_curr, 0, sizeof(*isp_curr) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                memset(isp_curr, 0, sizeof(*isp_curr) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  259|       |
  260|   139k|  FLOAT32 *isp_curr_q = ptr_stack_mem;
  261|   139k|  ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  262|   139k|  memset(isp_curr_q, 0, sizeof(*isp_curr_q) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                memset(isp_curr_q, 0, sizeof(*isp_curr_q) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  263|       |
  264|   139k|  FLOAT32 *isf_curr = ptr_stack_mem;
  265|   139k|  ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  266|   139k|  memset(isf_curr, 0, sizeof(*isf_curr) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                memset(isf_curr, 0, sizeof(*isf_curr) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  267|       |
  268|   139k|  FLOAT32 *isf_curr_q = ptr_stack_mem;
  269|   139k|  ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                ptr_stack_mem += ((NUM_FRAMES + 1) * ORDER);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  270|   139k|  memset(isf_curr_q, 0, sizeof(*isf_curr_q) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                memset(isf_curr_q, 0, sizeof(*isf_curr_q) * ((NUM_FRAMES + 1) * ORDER));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  271|       |
  272|   139k|  FLOAT32 *auto_corr_lp_filter_coeff = ptr_stack_mem;
  273|   139k|  ptr_stack_mem += (ORDER + 1);
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  274|   139k|  memset(auto_corr_lp_filter_coeff, 0, sizeof(*auto_corr_lp_filter_coeff) * (ORDER + 1));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  275|       |
  276|   139k|  WORD32 num_indices = 0, num_bits = 0;
  277|   139k|  WORD32 *prm_tcx = pstr_scratch->p_prm_tcx;
  278|   139k|  FLOAT32 *p_wsp_prev_buf;
  279|   139k|  FLOAT32 *wsp_prev_buf = pstr_scratch->p_wsp_prev_buf;
  280|   139k|  memset(lp_filter_coeff, 0, ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   81|   139k|#define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   75|   139k|#define NUM_FRAMES (4)
  |  |  ------------------
  |  |               #define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   76|   139k|#define MAX_NUM_SUBFR (4)
  |  |  ------------------
  ------------------
                memset(lp_filter_coeff, 0, ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  281|   139k|  memset(lp_filter_coeff_q, 0, ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   81|   139k|#define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   75|   139k|#define NUM_FRAMES (4)
  |  |  ------------------
  |  |               #define NUM_SUBFR_SUPERFRAME (NUM_FRAMES * MAX_NUM_SUBFR)
  |  |  ------------------
  |  |  |  |   76|   139k|#define MAX_NUM_SUBFR (4)
  |  |  ------------------
  ------------------
                memset(lp_filter_coeff_q, 0, ((NUM_SUBFR_SUPERFRAME + 1) * (ORDER + 1)) * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  282|   139k|  memset(wsp_prev_buf, 0, ((MAX_PITCH1 / OPL_DECIM) + LEN_FRAME) * sizeof(FLOAT32));
  ------------------
  |  |  113|   139k|#define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|   139k|#define TMAX (231)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  ------------------
                memset(wsp_prev_buf, 0, ((MAX_PITCH1 / OPL_DECIM) + LEN_FRAME) * sizeof(FLOAT32));
  ------------------
  |  |  116|   139k|#define OPL_DECIM (2)
  ------------------
                memset(wsp_prev_buf, 0, ((MAX_PITCH1 / OPL_DECIM) + LEN_FRAME) * sizeof(FLOAT32));
  ------------------
  |  |   74|   139k|#define LEN_FRAME (256)
  ------------------
  283|   139k|  WORD32 i, j, k, i1, i2;
  284|   139k|  WORD32 *p_params;
  285|   139k|  FLOAT32 energy = 0, max_corr = 0, t0 = 0, *p, *p1;
  286|   139k|  WORD32 ol_pitch_lag[2 * NUM_FRAMES] = {0};
  287|   139k|  FLOAT32 norm_corr[2 * NUM_FRAMES] = {0};
  288|   139k|  WORD32 num_params, pitch_min, pitch_max;
  289|       |
  290|   139k|  ia_usac_lpd_state_struct *lpd_state[6], *lpd_state_temp;
  291|   139k|  lpd_state_temp = (ia_usac_lpd_state_struct *)ptr_stack_mem;
  292|   139k|  ptr_stack_mem +=
  293|   139k|      (sizeof(ia_usac_lpd_state_struct) + sizeof(*ptr_stack_mem)) / (sizeof(*ptr_stack_mem));
  294|   139k|  memset(lpd_state_temp, 0, sizeof(*lpd_state_temp));
  295|   974k|  for (j = 0; j < 6; j++) {
  ------------------
  |  Branch (295:15): [True: 835k, False: 139k]
  ------------------
  296|   835k|    lpd_state[j] = (ia_usac_lpd_state_struct *)ptr_stack_mem;
  297|   835k|    ptr_stack_mem +=
  298|   835k|        (sizeof(ia_usac_lpd_state_struct) + sizeof(*ptr_stack_mem)) / (sizeof(*ptr_stack_mem));
  299|   835k|    memset(lpd_state[j], 0, sizeof(*lpd_state[0]));
  300|   835k|  }
  301|       |
  302|   139k|  WORD32 num_bits_acelp = 0, num_bits_tcx = 0;
  303|   139k|  WORD32 range_pitch_search = 0;
  304|   139k|  WORD32 len_subfrm = 0;
  305|   139k|  WORD32 num_subfrm = 0;
  306|   139k|  WORD32 num_sbfrm_per_supfrm = 0;
  307|   139k|  WORD32 window_len = 0;
  308|   139k|  WORD32 len = (MAX_PITCH / OPL_DECIM);
  ------------------
  |  |  110|   139k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|   139k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|   139k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  ------------------
                WORD32 len = (MAX_PITCH / OPL_DECIM);
  ------------------
  |  |  116|   139k|#define OPL_DECIM (2)
  ------------------
  309|   139k|  FLOAT32 mem_wsyn;
  310|   139k|  FLOAT32 ssnr_256 = 0.0f, ssnr_512 = 0.0f, ssnr_1024 = 0.0f;
  311|   139k|  FLOAT32 tmp_ssnr = 0.0f;
  312|       |
  313|   139k|  len_subfrm = st->len_subfrm;
  314|   139k|  num_subfrm = st->num_subfrm;
  315|   139k|  num_sbfrm_per_supfrm = NUM_FRAMES * num_subfrm;
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
  316|       |
  317|   139k|  if (pit_adj <= FSCALE_DENOM) {
  ------------------
  |  |   92|   139k|#define FSCALE_DENOM (12800)
  ------------------
  |  Branch (317:7): [True: 62.1k, False: 77.1k]
  ------------------
  318|  62.1k|    window_len = (LEN_LP_WINDOW * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   86|  62.1k|#define LEN_LP_WINDOW (448)
  ------------------
                  window_len = (LEN_LP_WINDOW * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   74|  62.1k|#define LEN_FRAME (256)
  ------------------
  319|  77.1k|  } else {
  320|  77.1k|    window_len = (LEN_LP_WINDOW_HIGH_RATE * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   87|  77.1k|#define LEN_LP_WINDOW_HIGH_RATE (512)
  ------------------
                  window_len = (LEN_LP_WINDOW_HIGH_RATE * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   74|  77.1k|#define LEN_FRAME (256)
  ------------------
  321|  77.1k|  }
  322|       |
  323|   139k|  memcpy(pstr_scratch->p_wsig_buf, st->weighted_sig, 128 * sizeof(FLOAT32));
  324|       |
  325|   139k|  num_bits_acelp = (iusace_acelp_core_numbits_1024[*codec_mode] - NBITS_MODE) >> 2;
  ------------------
  |  |  142|   139k|#define NBITS_MODE (4 * 2)
  ------------------
  326|       |
  327|   139k|  num_bits_tcx = (WORD32)(0.85f * num_bits_acelp - NBITS_LPC);
  ------------------
  |  |  143|   139k|#define NBITS_LPC (46)
  ------------------
  328|       |
  329|   139k|  if (pit_adj == 0) {
  ------------------
  |  Branch (329:7): [True: 0, False: 139k]
  ------------------
  330|      0|    pitch_min = TMIN;
  ------------------
  |  |   99|      0|#define TMIN (34)
  ------------------
  331|      0|    pitch_max = TMAX;
  ------------------
  |  |  102|      0|#define TMAX (231)
  ------------------
  332|   139k|  } else {
  333|   139k|    i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   99|   139k|#define TMIN (34)
  ------------------
                  i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   92|   139k|#define FSCALE_DENOM (12800)
  ------------------
                  i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   92|   139k|#define FSCALE_DENOM (12800)
  ------------------
                  i = (((pit_adj * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN;
  ------------------
  |  |   99|   139k|#define TMIN (34)
  ------------------
  334|   139k|    pitch_min = TMIN + i;
  ------------------
  |  |   99|   139k|#define TMIN (34)
  ------------------
  335|   139k|    pitch_max = TMAX + (6 * i);
  ------------------
  |  |  102|   139k|#define TMAX (231)
  ------------------
  336|   139k|  }
  337|       |
  338|   139k|  p_wsp_prev_buf = wsp_prev_buf + MAX_PITCH1 / OPL_DECIM;
  ------------------
  |  |  113|   139k|#define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|   139k|#define TMAX (231)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |               #define MAX_PITCH1 (TMAX + (6 * ((((32000 * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  ------------------
                p_wsp_prev_buf = wsp_prev_buf + MAX_PITCH1 / OPL_DECIM;
  ------------------
  |  |  116|   139k|#define OPL_DECIM (2)
  ------------------
  339|   139k|  memcpy(wsp_prev_buf, st->prev_wsp, (WORD32)((MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32)));
  ------------------
  |  |  110|   139k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|   139k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|   139k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   139k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   139k|#define TMIN (34)
  |  |  ------------------
  ------------------
                memcpy(wsp_prev_buf, st->prev_wsp, (WORD32)((MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32)));
  ------------------
  |  |  116|   139k|#define OPL_DECIM (2)
  ------------------
  340|       |
  341|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (341:7): [True: 4.19k, False: 135k]
  ------------------
  342|  4.19k|    memcpy(st->isp_old, iusace_ispold_init, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  343|       |
  344|  4.19k|    iusace_autocorr_plus(&speech[-(window_len / 2)], auto_corr_vector, window_len,
  345|  4.19k|                         (FLOAT32 *)lp_analysis_window, pstr_scratch->p_buf_aut_corr);
  346|       |
  347|  75.5k|    for (j = 0; j <= ORDER; j++) {
  ------------------
  |  |   71|  75.5k|#define ORDER (16)
  ------------------
  |  Branch (347:17): [True: 71.3k, False: 4.19k]
  ------------------
  348|  71.3k|      auto_corr_vector[j] *= (FLOAT32)iusace_lag_window[j];
  349|  71.3k|    }
  350|       |
  351|  4.19k|    iusace_levinson_durbin_algo(auto_corr_vector, auto_corr_lp_filter_coeff);
  352|  4.19k|    iusace_lpc_2_lsp_conversion(auto_corr_lp_filter_coeff, isp_new, st->isp_old);
  353|  4.19k|    memcpy(st->isp_old, isp_new, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  354|  4.19k|    iusace_lsp_2_lsf_conversion(isp_new, isf_curr);
  355|  4.19k|    memcpy(st->isf_old, isf_curr, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  356|  4.19k|  }
  357|       |
  358|   139k|  memcpy(isp_curr, st->isp_old, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  359|       |
  360|   696k|  for (i = 0; i < NUM_FRAMES; i++) {
  ------------------
  |  |   75|   696k|#define NUM_FRAMES (4)
  ------------------
  |  Branch (360:15): [True: 556k, False: 139k]
  ------------------
  361|   556k|    iusace_autocorr_plus(&speech[((i + 1) * len_subfrm) - (window_len / 2)], auto_corr_vector,
  362|   556k|                         window_len, (FLOAT32 *)lp_analysis_window, pstr_scratch->p_buf_aut_corr);
  363|       |
  364|  10.0M|    for (j = 0; j <= ORDER; j++) {
  ------------------
  |  |   71|  10.0M|#define ORDER (16)
  ------------------
  |  Branch (364:17): [True: 9.46M, False: 556k]
  ------------------
  365|  9.46M|      auto_corr_vector[j] *= (FLOAT32)iusace_lag_window[j];
  366|  9.46M|    }
  367|       |
  368|   556k|    iusace_levinson_durbin_algo(auto_corr_vector, auto_corr_lp_filter_coeff);
  369|   556k|    iusace_lpc_2_lsp_conversion(auto_corr_lp_filter_coeff, isp_new, st->isp_old);
  370|   556k|    memcpy(&isp_curr[(i + 1) * ORDER], isp_new, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
                  memcpy(&isp_curr[(i + 1) * ORDER], isp_new, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  371|   556k|    iusace_interpolation_lsp_params(st->isp_old, isp_new,
  372|   556k|                                    &lp_filter_coeff[i * num_subfrm * (ORDER + 1)], num_subfrm);
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  373|   556k|    iusace_lsp_2_lsf_conversion(&isp_curr[(i + 1) * ORDER], &isf_curr[(i + 1) * ORDER]);
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
                  iusace_lsp_2_lsf_conversion(&isp_curr[(i + 1) * ORDER], &isf_curr[(i + 1) * ORDER]);
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  374|   556k|    memcpy(st->isp_old, isp_new, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  375|   556k|  }
  376|       |
  377|   139k|  memcpy(isf_curr, st->isf_old, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  378|   139k|  memcpy(st->isf_old, &isf_curr[NUM_FRAMES * ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                memcpy(st->isf_old, &isf_curr[NUM_FRAMES * ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                memcpy(st->isf_old, &isf_curr[NUM_FRAMES * ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  379|       |
  380|   139k|  if (!first_lpd_flag) {
  ------------------
  |  Branch (380:7): [True: 135k, False: 4.19k]
  ------------------
  381|   135k|    iusace_lsp_2_lsf_conversion(st->isp_old_q, isf_curr_q);
  382|   135k|  }
  383|       |
  384|   139k|  iusace_quantize_lpc_avq(&isf_curr[ORDER], &isf_curr_q[ORDER], first_lpd_flag, &lpc_params[0],
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                iusace_quantize_lpc_avq(&isf_curr[ORDER], &isf_curr_q[ORDER], first_lpd_flag, &lpc_params[0],
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  385|   139k|                          &num_indices, &num_bits);
  386|       |
  387|   696k|  for (i = 0; i < NUM_FRAMES; i++) {
  ------------------
  |  |   75|   696k|#define NUM_FRAMES (4)
  ------------------
  |  Branch (387:15): [True: 556k, False: 139k]
  ------------------
  388|   556k|    iusace_lsf_2_lsp_conversion(&isf_curr_q[(i + 1) * ORDER], &isp_curr_q[(i + 1) * ORDER]);
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
                  iusace_lsf_2_lsp_conversion(&isf_curr_q[(i + 1) * ORDER], &isp_curr_q[(i + 1) * ORDER]);
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  389|   556k|  }
  390|       |
  391|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (391:7): [True: 4.19k, False: 135k]
  ------------------
  392|  4.19k|    iusace_lsf_2_lsp_conversion(isf_curr_q, isp_curr_q);
  393|  4.19k|    memcpy(st->isp_old_q, isp_curr_q, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  394|  4.19k|  }
  395|       |
  396|   139k|  *num_fac_bits = 0;
  397|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (397:7): [True: 4.19k, False: 135k]
  ------------------
  398|  4.19k|    FLOAT32 *temp_speech = pstr_scratch->p_buf_speech;
  399|  4.19k|    FLOAT32 *temp_res = pstr_scratch->p_buf_res;
  400|  4.19k|    FLOAT32 lpc[9 * (ORDER + 1)];
  401|  4.19k|    FLOAT32 hp_mem[4];
  402|  4.19k|    FLOAT32 premph_mem = 0.0f;
  403|  4.19k|    WORD32 fac_length;
  404|  4.19k|    WORD32 num_bits_fac = (WORD32)((FLOAT32)num_bits_tcx / 2.f);
  405|  4.19k|    FLOAT32 *temp_signal = pstr_scratch->p_buf_signal;
  406|       |
  407|  4.19k|    if (st->last_was_short) {
  ------------------
  |  Branch (407:9): [True: 0, False: 4.19k]
  ------------------
  408|      0|      fac_length = (st->len_frame) / 16;
  409|  4.19k|    } else {
  410|  4.19k|      fac_length = len_subfrm / 2;
  411|  4.19k|    }
  412|       |
  413|  4.19k|    iusace_get_interpolated_lpc(st->isp_old_q, st->isp_old_q, lpc, (2 * len_subfrm) / LEN_SUBFR);
  ------------------
  |  |   77|  4.19k|#define LEN_SUBFR (64)
  ------------------
  414|       |
  415|  4.19k|    memset(temp_speech, 0, (ORDER + 2 * len_subfrm) * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  416|  4.19k|    memset(temp_res, 0, (2 * len_subfrm) * sizeof(FLOAT32));
  417|       |
  418|  4.19k|    iusace_fac_apply(&st->fd_orig[1 + ORDER], len_subfrm, fac_length, st->low_pass_line,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  419|  4.19k|                     num_bits_fac, &st->fd_synth[1 + ORDER], lpc, serial_fac_out, num_fac_bits,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  420|  4.19k|                     pstr_scratch);
  421|  4.19k|    memset(hp_mem, 0, 4 * sizeof(FLOAT32));
  422|  4.19k|    iusace_highpass_50hz_12k8(st->fd_orig, 2 * len_subfrm + 1 + ORDER, hp_mem, pit_adj);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  423|  4.19k|    premph_mem = 0.0f;
  424|  4.19k|    iusace_apply_preemph(st->fd_orig, PREEMPH_FILT_FAC, 2 * len_subfrm + 1 + ORDER, &premph_mem);
  ------------------
  |  |  117|  4.19k|#define PREEMPH_FILT_FAC (0.68f)
  ------------------
                  iusace_apply_preemph(st->fd_orig, PREEMPH_FILT_FAC, 2 * len_subfrm + 1 + ORDER, &premph_mem);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  425|       |
  426|  4.19k|    memcpy(temp_signal, st->fd_orig + len_subfrm + 1, (len_subfrm + ORDER) * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  427|  4.19k|    premph_mem = temp_signal[0];
  428|  4.19k|    iusace_apply_deemph(temp_signal, PREEMPH_FILT_FAC, len_subfrm + ORDER, &premph_mem);
  ------------------
  |  |  117|  4.19k|#define PREEMPH_FILT_FAC (0.68f)
  ------------------
                  iusace_apply_deemph(temp_signal, PREEMPH_FILT_FAC, len_subfrm + ORDER, &premph_mem);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  429|  4.19k|    memcpy(st->lpd_state.tcx_mem, &temp_signal[len_subfrm + ORDER - 128], 128 * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  430|       |
  431|  4.19k|    premph_mem = 0.0f;
  432|  4.19k|    iusace_apply_preemph(st->fd_synth, PREEMPH_FILT_FAC, 2 * len_subfrm + 1 + ORDER, &premph_mem);
  ------------------
  |  |  117|  4.19k|#define PREEMPH_FILT_FAC (0.68f)
  ------------------
                  iusace_apply_preemph(st->fd_synth, PREEMPH_FILT_FAC, 2 * len_subfrm + 1 + ORDER, &premph_mem);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  433|  4.19k|    memcpy(st->lpd_state.synth, st->fd_synth + 2 * len_subfrm - ORDER - 128 + 1 + ORDER,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  memcpy(st->lpd_state.synth, st->fd_synth + 2 * len_subfrm - ORDER - 128 + 1 + ORDER,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  434|  4.19k|           (ORDER + 128) * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  435|  4.19k|    memcpy(temp_speech + ORDER, st->fd_synth + 1 + ORDER, 2 * len_subfrm * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  memcpy(temp_speech + ORDER, st->fd_synth + 1 + ORDER, 2 * len_subfrm * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  436|       |
  437|  4.19k|    premph_mem = 0.0f;
  438|  4.19k|    iusace_find_weighted_speech(lpc, temp_speech + ORDER, temp_res, &premph_mem, 2 * len_subfrm);
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  439|  4.19k|    st->prev_wsyn_mem = premph_mem;
  440|  4.19k|    memcpy(st->lpd_state.wsynth, temp_res + 2 * len_subfrm - ORDER - 128,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  441|  4.19k|           (ORDER + 128) * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  442|  4.19k|    memcpy(temp_speech + ORDER, st->fd_synth + 1 + ORDER, 2 * len_subfrm * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  memcpy(temp_speech + ORDER, st->fd_synth + 1 + ORDER, 2 * len_subfrm * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  443|  4.19k|    memset(temp_res, 0, 2 * len_subfrm * sizeof(FLOAT32));
  444|  36.1k|    for (i = 0; i < 2 * len_subfrm; i += LEN_SUBFR) {
  ------------------
  |  |   77|  31.9k|#define LEN_SUBFR (64)
  ------------------
  |  Branch (444:17): [True: 31.9k, False: 4.19k]
  ------------------
  445|  31.9k|      iusace_compute_lp_residual(lpc, &temp_speech[ORDER + i], &temp_res[i], LEN_SUBFR);
  ------------------
  |  |   71|  31.9k|#define ORDER (16)
  ------------------
                    iusace_compute_lp_residual(lpc, &temp_speech[ORDER + i], &temp_res[i], LEN_SUBFR);
  ------------------
  |  |   77|  31.9k|#define LEN_SUBFR (64)
  ------------------
  446|  31.9k|    }
  447|  4.19k|    memcpy(st->lpd_state.acelp_exc, temp_res, 2 * len_subfrm * sizeof(FLOAT32));
  448|  4.19k|    premph_mem = 0.0f;
  449|  4.19k|    iusace_find_weighted_speech(lp_filter_coeff, st->fd_orig + 1 + ORDER, temp_speech + ORDER,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  iusace_find_weighted_speech(lp_filter_coeff, st->fd_orig + 1 + ORDER, temp_speech + ORDER,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  450|  4.19k|                                &(st->mem_wsp), 2 * len_subfrm);
  451|  4.19k|    memcpy(st->weighted_sig, temp_speech + ORDER + 2 * len_subfrm - 128, 128 * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  452|  4.19k|    memcpy(pstr_scratch->p_wsig_buf, st->weighted_sig, 128 * sizeof(FLOAT32));
  453|  12.5k|    for (i = 0; i < 2 * len_subfrm; i += len_subfrm) {
  ------------------
  |  Branch (453:17): [True: 8.39k, False: 4.19k]
  ------------------
  454|  8.39k|      iusace_decim2_fir_filter(&temp_speech[i + ORDER], len_subfrm, st->mem_lp_decim2,
  ------------------
  |  |   71|  8.39k|#define ORDER (16)
  ------------------
  455|  8.39k|                               pstr_scratch->p_fir_sig_buf);
  456|  8.39k|      memcpy(temp_speech + ORDER + i / OPL_DECIM, temp_speech + ORDER + i,
  ------------------
  |  |   71|  8.39k|#define ORDER (16)
  ------------------
                    memcpy(temp_speech + ORDER + i / OPL_DECIM, temp_speech + ORDER + i,
  ------------------
  |  |  116|  8.39k|#define OPL_DECIM (2)
  ------------------
                    memcpy(temp_speech + ORDER + i / OPL_DECIM, temp_speech + ORDER + i,
  ------------------
  |  |   71|  8.39k|#define ORDER (16)
  ------------------
  457|  8.39k|             (len_subfrm / OPL_DECIM) * sizeof(FLOAT32));
  ------------------
  |  |  116|  8.39k|#define OPL_DECIM (2)
  ------------------
  458|  8.39k|    }
  459|  4.19k|    memcpy(wsp_prev_buf, temp_speech + ORDER + 2 * len_subfrm / OPL_DECIM - MAX_PITCH / OPL_DECIM,
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                  memcpy(wsp_prev_buf, temp_speech + ORDER + 2 * len_subfrm / OPL_DECIM - MAX_PITCH / OPL_DECIM,
  ------------------
  |  |  116|  4.19k|#define OPL_DECIM (2)
  ------------------
                  memcpy(wsp_prev_buf, temp_speech + ORDER + 2 * len_subfrm / OPL_DECIM - MAX_PITCH / OPL_DECIM,
  ------------------
  |  |  110|  4.19k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|  4.19k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|  4.19k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  4.19k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  4.19k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  4.19k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  4.19k|#define TMIN (34)
  |  |  ------------------
  ------------------
                  memcpy(wsp_prev_buf, temp_speech + ORDER + 2 * len_subfrm / OPL_DECIM - MAX_PITCH / OPL_DECIM,
  ------------------
  |  |  116|  4.19k|#define OPL_DECIM (2)
  ------------------
  460|  4.19k|           (WORD32)((MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32)));
  ------------------
  |  |  110|  4.19k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|  4.19k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|  4.19k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  4.19k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  4.19k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|  4.19k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|  4.19k|#define TMIN (34)
  |  |  ------------------
  ------------------
                         (WORD32)((MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32)));
  ------------------
  |  |  116|  4.19k|#define OPL_DECIM (2)
  ------------------
  461|  4.19k|    iusace_highpass_prev_wsp(st, temp_speech, pitch_max);
  462|  4.19k|  }
  463|   139k|  memcpy(isp_curr_q, st->isp_old_q, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  464|   139k|  memcpy(st->isp_old_q, &isp_curr_q[NUM_FRAMES * ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   75|   139k|#define NUM_FRAMES (4)
  ------------------
                memcpy(st->isp_old_q, &isp_curr_q[NUM_FRAMES * ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                memcpy(st->isp_old_q, &isp_curr_q[NUM_FRAMES * ORDER], ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  465|       |
  466|   696k|  for (i = 0; i < NUM_FRAMES; i++) {
  ------------------
  |  |   75|   696k|#define NUM_FRAMES (4)
  ------------------
  |  Branch (466:15): [True: 556k, False: 139k]
  ------------------
  467|   556k|    iusace_find_weighted_speech(
  468|   556k|        &lp_filter_coeff[i * (num_sbfrm_per_supfrm / NUM_FRAMES) * (ORDER + 1)],
  ------------------
  |  |   75|   556k|#define NUM_FRAMES (4)
  ------------------
                      &lp_filter_coeff[i * (num_sbfrm_per_supfrm / NUM_FRAMES) * (ORDER + 1)],
  ------------------
  |  |   71|   556k|#define ORDER (16)
  ------------------
  469|   556k|        &speech[i * len_subfrm], &pstr_scratch->p_wsig_buf[i * len_subfrm], &(st->mem_wsp),
  470|   556k|        len_subfrm);
  471|   556k|    memcpy(p_wsp_prev_buf, &pstr_scratch->p_wsig_buf[i * len_subfrm],
  472|   556k|           len_subfrm * sizeof(FLOAT32));
  473|       |
  474|   556k|    iusace_decim2_fir_filter(p_wsp_prev_buf, len_subfrm, st->mem_lp_decim2,
  475|   556k|                             pstr_scratch->p_fir_sig_buf);
  476|   556k|    range_pitch_search = 2 * LEN_SUBFR;
  ------------------
  |  |   77|   556k|#define LEN_SUBFR (64)
  ------------------
  477|   556k|    if (num_subfrm < 4) {
  ------------------
  |  Branch (477:9): [True: 159k, False: 396k]
  ------------------
  478|   159k|      range_pitch_search = 3 * LEN_SUBFR;
  ------------------
  |  |   77|   159k|#define LEN_SUBFR (64)
  ------------------
  479|   159k|    }
  480|       |
  481|   556k|    iusace_open_loop_search(p_wsp_prev_buf, (pitch_min / OPL_DECIM) + 1, pitch_max / OPL_DECIM,
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
                  iusace_open_loop_search(p_wsp_prev_buf, (pitch_min / OPL_DECIM) + 1, pitch_max / OPL_DECIM,
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
  482|   556k|                            range_pitch_search / OPL_DECIM, &ol_pitch_lag[i * 2], st);
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
  483|       |
  484|   556k|    if (st->ol_gain > 0.6) {
  ------------------
  |  Branch (484:9): [True: 86.8k, False: 469k]
  ------------------
  485|  86.8k|      st->prev_pitch_med = iusace_get_ol_lag_median(ol_pitch_lag[i * 2], st->prev_ol_lags);
  486|  86.8k|      st->ada_w = 1.0;
  487|   469k|    } else {
  488|   469k|      st->ada_w = st->ada_w * 0.9f;
  489|   469k|    }
  490|   556k|    if (st->ada_w < 0.8) {
  ------------------
  |  Branch (490:9): [True: 406k, False: 150k]
  ------------------
  491|   406k|      st->ol_wght_flg = 0;
  492|   406k|    } else {
  493|   150k|      st->ol_wght_flg = 1;
  494|   150k|    }
  495|       |
  496|   556k|    max_corr = 0.0f;
  497|   556k|    p = &p_wsp_prev_buf[0];
  498|   556k|    p1 = p_wsp_prev_buf - ol_pitch_lag[i * 2];
  499|  41.3M|    for (j = 0; j < range_pitch_search / OPL_DECIM; j++) {
  ------------------
  |  |  116|  41.3M|#define OPL_DECIM (2)
  ------------------
  |  Branch (499:17): [True: 40.7M, False: 556k]
  ------------------
  500|  40.7M|      max_corr += *p++ * *p1++;
  501|  40.7M|    }
  502|       |
  503|   556k|    t0 = 0.01f;
  504|   556k|    p = p_wsp_prev_buf - ol_pitch_lag[i * 2];
  505|  41.3M|    for (j = 0; j < range_pitch_search / OPL_DECIM; j++, p++) {
  ------------------
  |  |  116|  41.3M|#define OPL_DECIM (2)
  ------------------
  |  Branch (505:17): [True: 40.7M, False: 556k]
  ------------------
  506|  40.7M|      t0 += *p * *p;
  507|  40.7M|    }
  508|   556k|    t0 = (FLOAT32)(1.0 / sqrt(t0));
  509|   556k|    norm_corr[i * 2] = max_corr * t0;
  510|       |
  511|   556k|    energy = 0.01f;
  512|  41.3M|    for (j = 0; j < range_pitch_search / OPL_DECIM; j++) {
  ------------------
  |  |  116|  41.3M|#define OPL_DECIM (2)
  ------------------
  |  Branch (512:17): [True: 40.7M, False: 556k]
  ------------------
  513|  40.7M|      energy += p_wsp_prev_buf[j] * p_wsp_prev_buf[j];
  514|  40.7M|    }
  515|   556k|    energy = (FLOAT32)(1.0 / sqrt(energy));
  516|   556k|    norm_corr[i * 2] *= energy;
  517|       |
  518|   556k|    if (num_subfrm < 4) {
  ------------------
  |  Branch (518:9): [True: 159k, False: 396k]
  ------------------
  519|   159k|      ol_pitch_lag[(i * 2) + 1] = ol_pitch_lag[i * 2];
  520|   159k|      norm_corr[(i * 2) + 1] = norm_corr[i * 2];
  521|   396k|    } else {
  522|   396k|      iusace_open_loop_search(p_wsp_prev_buf + ((2 * LEN_SUBFR) / OPL_DECIM),
  ------------------
  |  |   77|   396k|#define LEN_SUBFR (64)
  ------------------
                    iusace_open_loop_search(p_wsp_prev_buf + ((2 * LEN_SUBFR) / OPL_DECIM),
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
  523|   396k|                              (pitch_min / OPL_DECIM) + 1, pitch_max / OPL_DECIM,
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
                                            (pitch_min / OPL_DECIM) + 1, pitch_max / OPL_DECIM,
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
  524|   396k|                              (2 * LEN_SUBFR) / OPL_DECIM, &ol_pitch_lag[(i * 2) + 1], st);
  ------------------
  |  |   77|   396k|#define LEN_SUBFR (64)
  ------------------
                                            (2 * LEN_SUBFR) / OPL_DECIM, &ol_pitch_lag[(i * 2) + 1], st);
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
  525|       |
  526|   396k|      if (st->ol_gain > 0.6) {
  ------------------
  |  Branch (526:11): [True: 57.6k, False: 339k]
  ------------------
  527|  57.6k|        st->prev_pitch_med =
  528|  57.6k|            iusace_get_ol_lag_median(ol_pitch_lag[(i * 2) + 1], st->prev_ol_lags);
  529|  57.6k|        st->ada_w = 1.0;
  530|   339k|      } else {
  531|   339k|        st->ada_w = st->ada_w * 0.9f;
  532|   339k|      }
  533|   396k|      if (st->ada_w < 0.8) {
  ------------------
  |  Branch (533:11): [True: 291k, False: 105k]
  ------------------
  534|   291k|        st->ol_wght_flg = 0;
  535|   291k|      } else {
  536|   105k|        st->ol_wght_flg = 1;
  537|   105k|      }
  538|   396k|      max_corr = 0.0f;
  539|   396k|      p = p_wsp_prev_buf + (2 * LEN_SUBFR) / OPL_DECIM;
  ------------------
  |  |   77|   396k|#define LEN_SUBFR (64)
  ------------------
                    p = p_wsp_prev_buf + (2 * LEN_SUBFR) / OPL_DECIM;
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
  540|   396k|      p1 = p_wsp_prev_buf + ((2 * LEN_SUBFR) / OPL_DECIM) - ol_pitch_lag[(i * 2) + 1];
  ------------------
  |  |   77|   396k|#define LEN_SUBFR (64)
  ------------------
                    p1 = p_wsp_prev_buf + ((2 * LEN_SUBFR) / OPL_DECIM) - ol_pitch_lag[(i * 2) + 1];
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
  541|  25.7M|      for (j = 0; j < (2 * LEN_SUBFR) / OPL_DECIM; j++) {
  ------------------
  |  |   77|  25.7M|#define LEN_SUBFR (64)
  ------------------
                    for (j = 0; j < (2 * LEN_SUBFR) / OPL_DECIM; j++) {
  ------------------
  |  |  116|  25.7M|#define OPL_DECIM (2)
  ------------------
  |  Branch (541:19): [True: 25.4M, False: 396k]
  ------------------
  542|  25.4M|        max_corr += *p++ * *p1++;
  543|  25.4M|      }
  544|       |
  545|   396k|      t0 = 0.01f;
  546|   396k|      p = p_wsp_prev_buf + ((2 * LEN_SUBFR) / OPL_DECIM) - ol_pitch_lag[(i * 2) + 1];
  ------------------
  |  |   77|   396k|#define LEN_SUBFR (64)
  ------------------
                    p = p_wsp_prev_buf + ((2 * LEN_SUBFR) / OPL_DECIM) - ol_pitch_lag[(i * 2) + 1];
  ------------------
  |  |  116|   396k|#define OPL_DECIM (2)
  ------------------
  547|  25.7M|      for (j = 0; j < (2 * LEN_SUBFR) / OPL_DECIM; j++, p++) {
  ------------------
  |  |   77|  25.7M|#define LEN_SUBFR (64)
  ------------------
                    for (j = 0; j < (2 * LEN_SUBFR) / OPL_DECIM; j++, p++) {
  ------------------
  |  |  116|  25.7M|#define OPL_DECIM (2)
  ------------------
  |  Branch (547:19): [True: 25.4M, False: 396k]
  ------------------
  548|  25.4M|        t0 += *p * *p;
  549|  25.4M|      }
  550|   396k|      t0 = (FLOAT32)(1.0 / sqrt(t0));
  551|   396k|      norm_corr[(i * 2) + 1] = max_corr * t0;
  552|       |
  553|   396k|      energy = 0.01f;
  554|  25.7M|      for (j = 0; j < (2 * LEN_SUBFR) / OPL_DECIM; j++) {
  ------------------
  |  |   77|  25.7M|#define LEN_SUBFR (64)
  ------------------
                    for (j = 0; j < (2 * LEN_SUBFR) / OPL_DECIM; j++) {
  ------------------
  |  |  116|  25.7M|#define OPL_DECIM (2)
  ------------------
  |  Branch (554:19): [True: 25.4M, False: 396k]
  ------------------
  555|  25.4M|        energy += p_wsp_prev_buf[((2 * LEN_SUBFR) / OPL_DECIM) + j] *
  ------------------
  |  |   77|  25.4M|#define LEN_SUBFR (64)
  ------------------
                      energy += p_wsp_prev_buf[((2 * LEN_SUBFR) / OPL_DECIM) + j] *
  ------------------
  |  |  116|  25.4M|#define OPL_DECIM (2)
  ------------------
  556|  25.4M|                  p_wsp_prev_buf[((2 * LEN_SUBFR) / OPL_DECIM) + j];
  ------------------
  |  |   77|  25.4M|#define LEN_SUBFR (64)
  ------------------
                                p_wsp_prev_buf[((2 * LEN_SUBFR) / OPL_DECIM) + j];
  ------------------
  |  |  116|  25.4M|#define OPL_DECIM (2)
  ------------------
  557|  25.4M|      }
  558|   396k|      energy = (FLOAT32)(1.0 / sqrt(energy));
  559|   396k|      norm_corr[(i * 2) + 1] *= energy;
  560|   396k|    }
  561|       |
  562|   556k|    memmove(wsp_prev_buf, &wsp_prev_buf[len_subfrm / OPL_DECIM],
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
  563|   556k|            (WORD32)((MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32)));
  ------------------
  |  |  110|   556k|  (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |  102|   556k|#define TMAX (231)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   93|   556k|#define FAC_FSCALE_MAX (24000)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   556k|#define TMIN (34)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   556k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   92|   556k|#define FSCALE_DENOM (12800)
  |  |  ------------------
  |  |                 (TMAX + (6 * ((((FAC_FSCALE_MAX * TMIN) + (FSCALE_DENOM / 2)) / FSCALE_DENOM) - TMIN)))
  |  |  ------------------
  |  |  |  |   99|   556k|#define TMIN (34)
  |  |  ------------------
  ------------------
                          (WORD32)((MAX_PITCH / OPL_DECIM) * sizeof(FLOAT32)));
  ------------------
  |  |  116|   556k|#define OPL_DECIM (2)
  ------------------
  564|   556k|  }
  565|       |
  566|   139k|  memcpy(lpd_state[0], &st->lpd_state, sizeof(*lpd_state[0]));
  567|       |
  568|   139k|  ssnr_1024 = 0;
  569|   139k|  if (usac_data->use_acelp_only) {
  ------------------
  |  Branch (569:7): [True: 9.99k, False: 129k]
  ------------------
  570|  29.9k|    for (i1 = 0; i1 < 2; i1++) {
  ------------------
  |  Branch (570:18): [True: 19.9k, False: 9.99k]
  ------------------
  571|  59.9k|      for (i2 = 0; i2 < 2; i2++) {
  ------------------
  |  Branch (571:20): [True: 39.9k, False: 19.9k]
  ------------------
  572|  39.9k|        k = (i1 * 2) + i2;
  573|  39.9k|        p_params = acelp_tcx_params + (k * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|  39.9k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|  39.9k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|  39.9k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  39.9k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|       |
  575|  39.9k|        iusace_interpolation_lsp_params(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 1) * ORDER],
  ------------------
  |  |   71|  39.9k|#define ORDER (16)
  ------------------
                      iusace_interpolation_lsp_params(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 1) * ORDER],
  ------------------
  |  |   71|  39.9k|#define ORDER (16)
  ------------------
  576|  39.9k|          lp_filter_coeff_q, st->num_subfrm);
  577|       |
  578|  39.9k|        memcpy(lpd_state[k + 1], lpd_state[k], sizeof(*lpd_state[0]));
  579|       |
  580|  39.9k|        iusace_acelp_encode(
  581|  39.9k|          &lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)], lp_filter_coeff_q,
  ------------------
  |  |   71|  39.9k|#define ORDER (16)
  ------------------
  582|  39.9k|          &speech[k * st->len_subfrm], &pstr_scratch->p_wsig_buf[k * st->len_subfrm],
  583|  39.9k|          &pstr_scratch->p_synth_buf[k * st->len_subfrm],
  584|  39.9k|          &pstr_scratch->p_wsyn_buf[k * st->len_subfrm], *codec_mode, lpd_state[k + 1],
  585|  39.9k|          st->len_subfrm, norm_corr[k * 2], norm_corr[(k * 2) + 1], ol_pitch_lag[k * 2],
  586|  39.9k|          ol_pitch_lag[(k * 2) + 1], pit_adj, p_params, pstr_scratch);
  587|       |
  588|  39.9k|        mem_wsyn = lpd_state[k]->mem_wsyn;
  589|       |
  590|  39.9k|        iusace_find_weighted_speech(
  591|  39.9k|            &lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|  39.9k|#define ORDER (16)
  ------------------
  592|  39.9k|            &pstr_scratch->p_synth_buf[k * st->len_subfrm], pstr_scratch->p_temp_wsyn_buf,
  593|  39.9k|            &mem_wsyn, st->len_subfrm);
  594|       |
  595|  39.9k|        lpd_state[k + 1]->mem_wsyn = mem_wsyn;
  596|  39.9k|        mode[k] = 0;
  597|  39.9k|        num_tcx_param[k] = 0;
  598|  39.9k|      }
  599|  19.9k|    }
  600|  9.99k|    memcpy(&st->lpd_state, lpd_state[4], sizeof(*lpd_state[4]));
  601|  9.99k|    memcpy(st->weighted_sig, pstr_scratch->p_wsig_buf + (st->len_frame), 128 * sizeof(FLOAT32));
  602|  9.99k|    memcpy(st->prev_wsp, wsp_prev_buf, (len * sizeof(FLOAT32)));
  603|  9.99k|    return;
  604|  9.99k|  }
  605|   387k|  for (i1 = 0; i1 < 2; i1++) {
  ------------------
  |  Branch (605:16): [True: 258k, False: 129k]
  ------------------
  606|   258k|    ssnr_512 = 0;
  607|   775k|    for (i2 = 0; i2 < 2; i2++) {
  ------------------
  |  Branch (607:18): [True: 516k, False: 258k]
  ------------------
  608|   516k|      k = (i1 * 2) + i2;
  609|   516k|      p_params = acelp_tcx_params + (k * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   516k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   516k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   516k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   516k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|       |
  611|   516k|      iusace_interpolation_lsp_params(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 1) * ORDER],
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
                    iusace_interpolation_lsp_params(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 1) * ORDER],
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  612|   516k|                                      lp_filter_coeff_q, st->num_subfrm);
  613|       |
  614|   516k|      memcpy(lpd_state[k + 1], lpd_state[k], sizeof(*lpd_state[0]));
  615|       |
  616|   516k|      iusace_acelp_encode(
  617|   516k|          &lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)], lp_filter_coeff_q,
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  618|   516k|          &speech[k * st->len_subfrm], &pstr_scratch->p_wsig_buf[k * st->len_subfrm],
  619|   516k|          &pstr_scratch->p_synth_buf[k * st->len_subfrm],
  620|   516k|          &pstr_scratch->p_wsyn_buf[k * st->len_subfrm], *codec_mode, lpd_state[k + 1],
  621|   516k|          st->len_subfrm, norm_corr[k * 2], norm_corr[(k * 2) + 1], ol_pitch_lag[k * 2],
  622|   516k|          ol_pitch_lag[(k * 2) + 1], pit_adj, p_params, pstr_scratch);
  623|       |
  624|   516k|      mem_wsyn = lpd_state[k]->mem_wsyn;
  625|       |
  626|   516k|      iusace_find_weighted_speech(&lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  627|   516k|                                  &pstr_scratch->p_synth_buf[k * st->len_subfrm],
  628|   516k|                                  pstr_scratch->p_temp_wsyn_buf, &mem_wsyn, st->len_subfrm);
  629|       |
  630|   516k|      lpd_state[k + 1]->mem_wsyn = mem_wsyn;
  631|       |
  632|   516k|      ssnr_256 = iusace_cal_segsnr(&pstr_scratch->p_wsig_buf[k * st->len_subfrm],
  633|   516k|                                   pstr_scratch->p_temp_wsyn_buf, st->len_subfrm, LEN_SUBFR);
  ------------------
  |  |   77|   516k|#define LEN_SUBFR (64)
  ------------------
  634|       |
  635|   516k|      mode[k] = 0;
  636|   516k|      num_tcx_param[k] = 0;
  637|       |
  638|   516k|      iusace_lpc_coef_gen(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 1) * ORDER], lp_filter_coeff_q,
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
                    iusace_lpc_coef_gen(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 1) * ORDER], lp_filter_coeff_q,
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  639|   516k|                          st->num_subfrm, ORDER);
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  640|       |
  641|   516k|      memcpy(lpd_state_temp, lpd_state[k], sizeof(*lpd_state[0]));
  642|       |
  643|   516k|      iusace_tcx_fac_encode(usac_data,
  644|   516k|                            &lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  645|   516k|                            lp_filter_coeff_q, &speech[k * st->len_subfrm], st->len_subfrm,
  646|   516k|                            num_bits_tcx, lpd_state_temp, prm_tcx, &num_params, ch_idx, k);
  647|       |
  648|   516k|      mem_wsyn = lpd_state[k]->mem_wsyn;
  649|       |
  650|   516k|      iusace_find_weighted_speech(&lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   516k|#define ORDER (16)
  ------------------
  651|   516k|                                  pstr_scratch->p_synth_tcx_buf, pstr_scratch->p_temp_wsyn_buf,
  652|   516k|                                  &mem_wsyn, st->len_subfrm);
  653|       |
  654|   516k|      lpd_state_temp->mem_wsyn = mem_wsyn;
  655|       |
  656|   516k|      tmp_ssnr = iusace_cal_segsnr(&pstr_scratch->p_wsig_buf[k * st->len_subfrm],
  657|   516k|                                   pstr_scratch->p_temp_wsyn_buf, st->len_subfrm, LEN_SUBFR);
  ------------------
  |  |   77|   516k|#define LEN_SUBFR (64)
  ------------------
  658|       |
  659|   516k|      if (tmp_ssnr > ssnr_256) {
  ------------------
  |  Branch (659:11): [True: 312k, False: 204k]
  ------------------
  660|   312k|        ssnr_256 = tmp_ssnr;
  661|   312k|        mode[k] = 1;
  662|   312k|        num_tcx_param[k] = num_params;
  663|   312k|        memcpy(lpd_state[k + 1], lpd_state_temp, sizeof(*lpd_state[0]));
  664|       |
  665|   312k|        memcpy(&pstr_scratch->p_synth_buf[(k * st->len_subfrm) - 128],
  666|   312k|               pstr_scratch->p_synth_tcx_buf - 128, (st->len_subfrm + 128) * sizeof(FLOAT32));
  667|       |
  668|   312k|        memcpy(&pstr_scratch->p_wsyn_buf[(k * st->len_subfrm) - 128],
  669|   312k|               pstr_scratch->p_wsyn_tcx_buf - 128, (st->len_subfrm + 128) * sizeof(FLOAT32));
  670|       |
  671|   312k|        memcpy(p_params, prm_tcx, NUM_TCX20_PRM * sizeof(WORD32));
  ------------------
  |  |  149|   312k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  ------------------
  |  |  |  |   80|   312k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   312k|#define LEN_FRAME (256)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  672|   312k|      }
  673|   516k|      ssnr_512 += 0.50f * ssnr_256;
  674|   516k|    }
  675|       |
  676|   258k|    k = i1 * 2;
  677|       |
  678|   258k|    p_params = acelp_tcx_params + (k * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   258k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   258k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   258k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   258k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  679|       |
  680|   258k|    iusace_lpc_coef_gen(&isp_curr_q[2 * i1 * ORDER], &isp_curr_q[(2 * i1 + 2) * ORDER],
  ------------------
  |  |   71|   258k|#define ORDER (16)
  ------------------
                  iusace_lpc_coef_gen(&isp_curr_q[2 * i1 * ORDER], &isp_curr_q[(2 * i1 + 2) * ORDER],
  ------------------
  |  |   71|   258k|#define ORDER (16)
  ------------------
  681|   258k|                        lp_filter_coeff_q, (num_sbfrm_per_supfrm / 2), ORDER);
  ------------------
  |  |   71|   258k|#define ORDER (16)
  ------------------
  682|       |
  683|   258k|    memcpy(lpd_state_temp, lpd_state[2 * i1], sizeof(*lpd_state[0]));
  684|   258k|    iusace_tcx_fac_encode(usac_data,
  685|   258k|                          &lp_filter_coeff[2 * i1 * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   258k|#define ORDER (16)
  ------------------
  686|   258k|                          lp_filter_coeff_q, &speech[2 * i1 * st->len_subfrm], 2 * st->len_subfrm,
  687|   258k|                          2 * num_bits_tcx, lpd_state_temp, prm_tcx, &num_params, ch_idx, 2 * i1);
  688|       |
  689|   258k|    mem_wsyn = lpd_state[2 * i1]->mem_wsyn;
  690|       |
  691|   258k|    iusace_find_weighted_speech(
  692|   258k|        &lp_filter_coeff[2 * i1 * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   258k|#define ORDER (16)
  ------------------
  693|   258k|        pstr_scratch->p_synth_tcx_buf, pstr_scratch->p_temp_wsyn_buf, &mem_wsyn,
  694|   258k|        st->len_subfrm * 2);
  695|       |
  696|   258k|    lpd_state_temp->mem_wsyn = mem_wsyn;
  697|       |
  698|   258k|    tmp_ssnr = iusace_cal_segsnr(&pstr_scratch->p_wsig_buf[2 * i1 * st->len_subfrm],
  699|   258k|                                 pstr_scratch->p_temp_wsyn_buf, st->len_subfrm * 2, LEN_SUBFR);
  ------------------
  |  |   77|   258k|#define LEN_SUBFR (64)
  ------------------
  700|       |
  701|   258k|    if (tmp_ssnr > ssnr_512) {
  ------------------
  |  Branch (701:9): [True: 82.5k, False: 175k]
  ------------------
  702|  82.5k|      ssnr_512 = tmp_ssnr;
  703|   247k|      for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (703:19): [True: 165k, False: 82.5k]
  ------------------
  704|   165k|        mode[k + i] = 2;
  705|   165k|        num_tcx_param[k + i] = num_params;
  706|   165k|      }
  707|  82.5k|      memcpy(lpd_state[k + 2], lpd_state_temp, sizeof(*lpd_state[0]));
  708|       |
  709|  82.5k|      memcpy(&pstr_scratch->p_synth_buf[(2 * i1 * st->len_subfrm) - 128],
  710|  82.5k|             pstr_scratch->p_synth_tcx_buf - 128, ((2 * st->len_subfrm) + 128) * sizeof(FLOAT32));
  711|  82.5k|      memcpy(&pstr_scratch->p_wsyn_buf[(2 * i1 * st->len_subfrm) - 128],
  712|  82.5k|             pstr_scratch->p_wsyn_tcx_buf - 128, ((2 * st->len_subfrm) + 128) * sizeof(FLOAT32));
  713|  82.5k|      memcpy(p_params, prm_tcx, NUM_TCX40_PRM * sizeof(WORD32));
  ------------------
  |  |  148|  82.5k|#define NUM_TCX40_PRM (FAC_LENGTH + 2 + (NUM_RE8_PRM / 2))
  |  |  ------------------
  |  |  |  |   80|  82.5k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  82.5k|#define LEN_FRAME (256)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NUM_TCX40_PRM (FAC_LENGTH + 2 + (NUM_RE8_PRM / 2))
  |  |  ------------------
  |  |  |  |  145|  82.5k|#define NUM_RE8_PRM (LEN_SUPERFRAME + (LEN_SUPERFRAME / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  82.5k|#define LEN_SUPERFRAME (1024)
  |  |  |  |  ------------------
  |  |  |  |               #define NUM_RE8_PRM (LEN_SUPERFRAME + (LEN_SUPERFRAME / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  82.5k|#define LEN_SUPERFRAME (1024)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  714|  82.5k|    }
  715|   258k|    ssnr_1024 += 0.50f * ssnr_512;
  716|   258k|  }
  717|       |
  718|   129k|  k = 0;
  719|       |
  720|   129k|  p_params = acelp_tcx_params + (k * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   129k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   129k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   129k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   129k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  721|       |
  722|   129k|  iusace_lpc_coef_gen(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 4) * ORDER], lp_filter_coeff_q,
  ------------------
  |  |   71|   129k|#define ORDER (16)
  ------------------
                iusace_lpc_coef_gen(&isp_curr_q[k * ORDER], &isp_curr_q[(k + 4) * ORDER], lp_filter_coeff_q,
  ------------------
  |  |   71|   129k|#define ORDER (16)
  ------------------
  723|   129k|                      num_sbfrm_per_supfrm, ORDER);
  ------------------
  |  |   71|   129k|#define ORDER (16)
  ------------------
  724|       |
  725|   129k|  memcpy(lpd_state_temp, lpd_state[k], sizeof(*lpd_state[0]));
  726|       |
  727|   129k|  iusace_tcx_fac_encode(usac_data, &lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   129k|#define ORDER (16)
  ------------------
  728|   129k|                        lp_filter_coeff_q, &speech[k * st->len_subfrm], 4 * st->len_subfrm,
  729|   129k|                        4 * num_bits_tcx, lpd_state_temp, prm_tcx, &num_params, ch_idx, k);
  730|       |
  731|   129k|  mem_wsyn = lpd_state[k]->mem_wsyn;
  732|       |
  733|   129k|  iusace_find_weighted_speech(&lp_filter_coeff[k * (num_sbfrm_per_supfrm / 4) * (ORDER + 1)],
  ------------------
  |  |   71|   129k|#define ORDER (16)
  ------------------
  734|   129k|                              pstr_scratch->p_synth_tcx_buf, pstr_scratch->p_temp_wsyn_buf,
  735|   129k|                              &mem_wsyn, st->len_subfrm * 4);
  736|       |
  737|   129k|  lpd_state_temp->mem_wsyn = mem_wsyn;
  738|       |
  739|   129k|  tmp_ssnr = iusace_cal_segsnr(&pstr_scratch->p_wsig_buf[k * st->len_subfrm],
  740|   129k|                               pstr_scratch->p_temp_wsyn_buf, st->len_subfrm * 4, LEN_SUBFR);
  ------------------
  |  |   77|   129k|#define LEN_SUBFR (64)
  ------------------
  741|       |
  742|   129k|  if (tmp_ssnr > ssnr_1024) {
  ------------------
  |  Branch (742:7): [True: 33.9k, False: 95.2k]
  ------------------
  743|   169k|    for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (743:17): [True: 135k, False: 33.9k]
  ------------------
  744|   135k|      mode[k + i] = 3;
  745|   135k|      num_tcx_param[k + i] = num_params;
  746|   135k|    }
  747|  33.9k|    memcpy(lpd_state[k + 4], lpd_state_temp, sizeof(*lpd_state[0]));
  748|       |
  749|  33.9k|    memcpy(&pstr_scratch->p_synth_buf[(k * st->len_subfrm) - 128],
  750|  33.9k|           pstr_scratch->p_synth_tcx_buf - 128, ((4 * st->len_subfrm) + 128) * sizeof(FLOAT32));
  751|  33.9k|    memcpy(&pstr_scratch->p_wsyn_buf[(k * st->len_subfrm) - 128],
  752|  33.9k|           pstr_scratch->p_wsyn_tcx_buf - 128, ((4 * st->len_subfrm) + 128) * sizeof(FLOAT32));
  753|  33.9k|    memcpy(p_params, prm_tcx, NUM_TCX80_PRM * sizeof(WORD32));
  ------------------
  |  |  147|  33.9k|#define NUM_TCX80_PRM (FAC_LENGTH + 2 + NUM_RE8_PRM)
  |  |  ------------------
  |  |  |  |   80|  33.9k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  33.9k|#define LEN_FRAME (256)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NUM_TCX80_PRM (FAC_LENGTH + 2 + NUM_RE8_PRM)
  |  |  ------------------
  |  |  |  |  145|  33.9k|#define NUM_RE8_PRM (LEN_SUPERFRAME + (LEN_SUPERFRAME / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  33.9k|#define LEN_SUPERFRAME (1024)
  |  |  |  |  ------------------
  |  |  |  |               #define NUM_RE8_PRM (LEN_SUPERFRAME + (LEN_SUPERFRAME / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  33.9k|#define LEN_SUPERFRAME (1024)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|  33.9k|  }
  755|   129k|  memcpy(&st->lpd_state, lpd_state[4], sizeof(*lpd_state[4]));
  756|       |
  757|   129k|  memcpy(st->weighted_sig, pstr_scratch->p_wsig_buf + (st->len_frame), 128 * sizeof(FLOAT32));
  758|   129k|  memcpy(st->prev_wsp, wsp_prev_buf, (len * sizeof(FLOAT32)));
  759|       |
  760|   129k|  return;
  761|   139k|}
iusace_lpd_frm_enc:
  765|   139k|                                ia_bit_buf_struct *pstr_it_bit_buff) {
  766|   139k|  WORD32 i;
  767|   139k|  WORD32 len_next_high_rate = (LEN_NEXT_HIGH_RATE * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   84|   139k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                WORD32 len_next_high_rate = (LEN_NEXT_HIGH_RATE * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   66|   139k|#define LEN_SUPERFRAME (1024)
  ------------------
  768|   139k|  WORD32 len_lpc0 = (LEN_LPC0 * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   85|   139k|#define LEN_LPC0 (256)
  ------------------
                WORD32 len_lpc0 = (LEN_LPC0 * len_frame) / LEN_SUPERFRAME;
  ------------------
  |  |   66|   139k|#define LEN_SUPERFRAME (1024)
  ------------------
  769|   139k|  FLOAT32 *input_data = &usac_data->td_in_buf[i_ch][len_next_high_rate];
  770|   139k|  ia_usac_td_encoder_struct *td_encoder = usac_data->td_encoder[i_ch];
  771|   139k|  WORD32 fscale = usac_data->td_encoder[i_ch]->fscale;
  772|   139k|  WORD32 first_lpd_flag = (usac_data->core_mode_prev[i_ch] == CORE_MODE_FD);
  ------------------
  |  |   33|   139k|#define CORE_MODE_FD (0)
  ------------------
  773|   139k|  FLOAT32 *speech_buf = usac_data->speech_buf;
  774|   139k|  FLOAT32 *ptr_scratch_buf = usac_data->str_scratch.p_lpd_frm_enc_scratch;
  775|   139k|  FLOAT32 *speech, *new_speech;
  776|   139k|  WORD32 mode_buf[1 + NUM_FRAMES] = {0}, *mode;
  777|   139k|  WORD32 num_tcx_params[NUM_FRAMES] = {0};
  778|   139k|  WORD32 len_subfrm;
  779|       |
  780|   139k|  len_subfrm = td_encoder->len_subfrm;
  781|       |
  782|   139k|  if (usac_data->core_mode_prev[i_ch] == CORE_MODE_FD) {
  ------------------
  |  |   33|   139k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (782:7): [True: 4.19k, False: 135k]
  ------------------
  783|  4.19k|    iusace_reset_td_enc(usac_data->td_encoder[i_ch]);
  784|       |
  785|  4.19k|    FLOAT32 *in_data = usac_data->td_in_prev_buf[i_ch];
  786|  4.19k|    FLOAT32 *ptr_speech = usac_data->speech_buf;
  787|  4.19k|    WORD32 length = len_next_high_rate + len_lpc0;
  788|  4.19k|    ia_usac_td_encoder_struct *st = usac_data->td_encoder[i_ch];
  789|  4.19k|    memcpy(ptr_speech, in_data, length * sizeof(FLOAT32));
  790|       |
  791|  4.19k|    iusace_highpass_50hz_12k8(ptr_speech, length, st->mem_sig_in, st->fscale);
  792|       |
  793|  4.19k|    iusace_apply_preemph(ptr_speech, PREEMPH_FILT_FAC, length, &(st->mem_preemph));
  ------------------
  |  |  117|  4.19k|#define PREEMPH_FILT_FAC (0.68f)
  ------------------
  794|  4.19k|    memcpy(st->old_speech_pe + ORDER, ptr_speech, length * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
  795|  4.19k|  }
  796|       |
  797|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (797:7): [True: 4.19k, False: 135k]
  ------------------
  798|  4.19k|    td_encoder->prev_mode = -1;
  799|  4.19k|  }
  800|       |
  801|   139k|  mode = mode_buf + 1;
  802|   139k|  mode[-1] = td_encoder->prev_mode;
  803|   139k|  fscale = (fscale * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   74|   139k|#define LEN_FRAME (256)
  ------------------
  804|       |
  805|   139k|  new_speech = speech_buf + ORDER + (LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
                new_speech = speech_buf + ORDER + (LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   84|   139k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                new_speech = speech_buf + ORDER + (LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   74|   139k|#define LEN_FRAME (256)
  ------------------
  806|   139k|  speech = speech_buf + ORDER;
  ------------------
  |  |   71|   139k|#define ORDER (16)
  ------------------
  807|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (807:7): [True: 4.19k, False: 135k]
  ------------------
  808|  4.19k|    new_speech += (LEN_LPC0 * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   85|  4.19k|#define LEN_LPC0 (256)
  ------------------
                  new_speech += (LEN_LPC0 * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   74|  4.19k|#define LEN_FRAME (256)
  ------------------
  809|  4.19k|    speech += (LEN_LPC0 * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   85|  4.19k|#define LEN_LPC0 (256)
  ------------------
                  speech += (LEN_LPC0 * len_subfrm) / LEN_FRAME;
  ------------------
  |  |   74|  4.19k|#define LEN_FRAME (256)
  ------------------
  810|  4.19k|  }
  811|   139k|  memcpy(new_speech, input_data, td_encoder->len_frame * sizeof(FLOAT32));
  812|       |
  813|   139k|  iusace_highpass_50hz_12k8(new_speech, td_encoder->len_frame, td_encoder->mem_sig_in, fscale);
  814|   139k|  iusace_apply_preemph(new_speech, PREEMPH_FILT_FAC, td_encoder->len_frame,
  ------------------
  |  |  117|   139k|#define PREEMPH_FILT_FAC (0.68f)
  ------------------
  815|   139k|                       &(td_encoder->mem_preemph));
  816|       |
  817|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (817:7): [True: 4.19k, False: 135k]
  ------------------
  818|  4.19k|    memcpy(speech_buf, td_encoder->old_speech_pe,
  819|  4.19k|           ((ORDER + (((LEN_NEXT_HIGH_RATE + LEN_LPC0) * len_subfrm) / LEN_FRAME))) *
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                         ((ORDER + (((LEN_NEXT_HIGH_RATE + LEN_LPC0) * len_subfrm) / LEN_FRAME))) *
  ------------------
  |  |   84|  4.19k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                         ((ORDER + (((LEN_NEXT_HIGH_RATE + LEN_LPC0) * len_subfrm) / LEN_FRAME))) *
  ------------------
  |  |   85|  4.19k|#define LEN_LPC0 (256)
  ------------------
                         ((ORDER + (((LEN_NEXT_HIGH_RATE + LEN_LPC0) * len_subfrm) / LEN_FRAME))) *
  ------------------
  |  |   74|  4.19k|#define LEN_FRAME (256)
  ------------------
  820|  4.19k|               sizeof(FLOAT32));
  821|  1.03M|    for (i = 0; i < (len_subfrm + 1); i++) {
  ------------------
  |  Branch (821:17): [True: 1.02M, False: 4.19k]
  ------------------
  822|  1.02M|      ptr_scratch_buf[i] = speech[-len_subfrm - 1 + i];
  823|  1.02M|    }
  824|  4.19k|    iusace_apply_deemph(ptr_scratch_buf, PREEMPH_FILT_FAC, len_subfrm + 1, &ptr_scratch_buf[0]);
  ------------------
  |  |  117|  4.19k|#define PREEMPH_FILT_FAC (0.68f)
  ------------------
  825|  4.19k|    memcpy(td_encoder->lpd_state.tcx_mem, &ptr_scratch_buf[len_subfrm - 128 + 1],
  826|  4.19k|           128 * sizeof(FLOAT32));
  827|   135k|  } else {
  828|   135k|    memcpy(speech_buf, td_encoder->old_speech_pe,
  829|   135k|           ((ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME))) * sizeof(FLOAT32));
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                         ((ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME))) * sizeof(FLOAT32));
  ------------------
  |  |   84|   135k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                         ((ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME))) * sizeof(FLOAT32));
  ------------------
  |  |   74|   135k|#define LEN_FRAME (256)
  ------------------
  830|   135k|  }
  831|       |
  832|   139k|  iusace_core_lpd_encode(usac_data, speech, mode, num_tcx_params, i_ch);
  833|       |
  834|   139k|  if (first_lpd_flag) {
  ------------------
  |  Branch (834:7): [True: 4.19k, False: 135k]
  ------------------
  835|  4.19k|    memcpy(td_encoder->old_speech_pe,
  836|  4.19k|           &speech_buf[(td_encoder->len_frame) + (LEN_LPC0 * len_subfrm) / LEN_FRAME],
  ------------------
  |  |   85|  4.19k|#define LEN_LPC0 (256)
  ------------------
                         &speech_buf[(td_encoder->len_frame) + (LEN_LPC0 * len_subfrm) / LEN_FRAME],
  ------------------
  |  |   74|  4.19k|#define LEN_FRAME (256)
  ------------------
  837|  4.19k|           (ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME)) * sizeof(FLOAT32));
  ------------------
  |  |   71|  4.19k|#define ORDER (16)
  ------------------
                         (ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME)) * sizeof(FLOAT32));
  ------------------
  |  |   84|  4.19k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                         (ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME)) * sizeof(FLOAT32));
  ------------------
  |  |   74|  4.19k|#define LEN_FRAME (256)
  ------------------
  838|   135k|  } else {
  839|   135k|    memcpy(td_encoder->old_speech_pe, &speech_buf[(td_encoder->len_frame)],
  840|   135k|           (ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME)) * sizeof(FLOAT32));
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                         (ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME)) * sizeof(FLOAT32));
  ------------------
  |  |   84|   135k|#define LEN_NEXT_HIGH_RATE (288)
  ------------------
                         (ORDER + ((LEN_NEXT_HIGH_RATE * len_subfrm) / LEN_FRAME)) * sizeof(FLOAT32));
  ------------------
  |  |   74|   135k|#define LEN_FRAME (256)
  ------------------
  841|   135k|  }
  842|       |
  843|   139k|  iusace_encode_fac_params(mode, num_tcx_params, usac_data, usac_independency_flg,
  844|   139k|                           pstr_it_bit_buff, i_ch);
  845|       |
  846|   139k|  td_encoder->prev_mode = (WORD16)mode[3];
  847|       |
  848|   139k|  memcpy(mod_out, mode, 4 * sizeof(WORD32));
  849|   139k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   139k|#define IA_NO_ERROR 0x00000000
  ------------------
  850|   139k|}

ia_get_sample_rate:
   57|   147k|WORD32 ia_get_sample_rate(WORD32 sample_rate) {
   58|   147k|  if (92017 <= sample_rate) {
  ------------------
  |  Branch (58:7): [True: 0, False: 147k]
  ------------------
   59|      0|    return 11;
   60|      0|  }
   61|   147k|  if (75132 <= sample_rate) {
  ------------------
  |  Branch (61:7): [True: 0, False: 147k]
  ------------------
   62|      0|    return 10;
   63|      0|  }
   64|   147k|  if (55426 <= sample_rate) {
  ------------------
  |  Branch (64:7): [True: 0, False: 147k]
  ------------------
   65|      0|    return 9;
   66|      0|  }
   67|   147k|  if (46009 <= sample_rate) {
  ------------------
  |  Branch (67:7): [True: 0, False: 147k]
  ------------------
   68|      0|    return 8;
   69|      0|  }
   70|   147k|  if (37566 <= sample_rate) {
  ------------------
  |  Branch (70:7): [True: 0, False: 147k]
  ------------------
   71|      0|    return 7;
   72|      0|  }
   73|   147k|  if (27713 <= sample_rate) {
  ------------------
  |  Branch (73:7): [True: 17.3k, False: 130k]
  ------------------
   74|  17.3k|    return 6;
   75|  17.3k|  }
   76|   130k|  if (23004 <= sample_rate) {
  ------------------
  |  Branch (76:7): [True: 18.4k, False: 111k]
  ------------------
   77|  18.4k|    return 5;
   78|  18.4k|  }
   79|   111k|  if (18783 <= sample_rate) {
  ------------------
  |  Branch (79:7): [True: 10.5k, False: 101k]
  ------------------
   80|  10.5k|    return 4;
   81|  10.5k|  }
   82|   101k|  if (13856 <= sample_rate) {
  ------------------
  |  Branch (82:7): [True: 28.2k, False: 72.9k]
  ------------------
   83|  28.2k|    return 3;
   84|  28.2k|  }
   85|  72.9k|  if (11502 <= sample_rate) {
  ------------------
  |  Branch (85:7): [True: 37.4k, False: 35.4k]
  ------------------
   86|  37.4k|    return 2;
   87|  37.4k|  }
   88|  35.4k|  if (9391 <= sample_rate) {
  ------------------
  |  Branch (88:7): [True: 9.34k, False: 26.1k]
  ------------------
   89|  9.34k|    return 1;
   90|  9.34k|  }
   91|  26.1k|  return 0;
   92|  35.4k|}
iusace_write_bits2buf:
   94|  2.41M|VOID iusace_write_bits2buf(WORD32 value, WORD32 no_of_bits, WORD16 *bitstream) {
   95|  2.41M|  WORD16 *pt_bitstream;
   96|  2.41M|  WORD32 i;
   97|  2.41M|  pt_bitstream = bitstream + no_of_bits;
   98|  15.3M|  for (i = 0; i < no_of_bits; i++) {
  ------------------
  |  Branch (98:15): [True: 12.9M, False: 2.41M]
  ------------------
   99|  12.9M|    *--pt_bitstream = (WORD16)(value & MASK);
  ------------------
  |  |   30|  12.9M|#define MASK 0x0001
  ------------------
  100|  12.9M|    value >>= 1;
  101|  12.9M|  }
  102|  2.41M|  return;
  103|  2.41M|}
iusace_get_num_params:
  105|   896k|WORD32 iusace_get_num_params(WORD32 *qn) {
  106|   896k|  return 2 + ((qn[0] > 0) ? 9 : 0) + ((qn[1] > 0) ? 9 : 0);
  ------------------
  |  Branch (106:15): [True: 725k, False: 170k]
  |  Branch (106:39): [True: 610k, False: 285k]
  ------------------
  107|   896k|}
iusace_cal_segsnr:
  109|  1.42M|FLOAT32 iusace_cal_segsnr(FLOAT32 *sig1, FLOAT32 *sig2, WORD16 len, WORD16 nseg) {
  110|  1.42M|  FLOAT32 snr = 0.0f;
  111|  1.42M|  FLOAT32 signal, noise, error, fac;
  112|  1.42M|  WORD16 i, j;
  113|  9.07M|  for (i = 0; i < len; i += nseg) {
  ------------------
  |  Branch (113:15): [True: 7.64M, False: 1.42M]
  ------------------
  114|  7.64M|    signal = 1e-6f;
  115|  7.64M|    noise = 1e-6f;
  116|   497M|    for (j = 0; j < nseg; j++) {
  ------------------
  |  Branch (116:17): [True: 489M, False: 7.64M]
  ------------------
  117|   489M|      signal += (*sig1) * (*sig1);
  118|   489M|      error = *sig1++ - *sig2++;
  119|   489M|      noise += error * error;
  120|   489M|    }
  121|  7.64M|    snr += (FLOAT32)log10((FLOAT64)(signal / noise));
  122|  7.64M|  }
  123|  1.42M|  fac = ((FLOAT32)(10 * nseg)) / (FLOAT32)len;
  124|  1.42M|  snr = fac * snr;
  125|  1.42M|  if (snr < -99.0f) {
  ------------------
  |  Branch (125:7): [True: 2.40k, False: 1.41M]
  ------------------
  126|  2.40k|    snr = -99.0f;
  127|  2.40k|  }
  128|  1.42M|  return (snr);
  129|  1.42M|}
iusace_highpass_50hz_12k8:
  131|   147k|VOID iusace_highpass_50hz_12k8(FLOAT32 *signal, WORD32 lg, FLOAT32 *mem, WORD32 fscale) {
  132|   147k|  WORD32 i;
  133|   147k|  WORD32 sr_idx = 0;
  134|   147k|  FLOAT32 x0, x1, x2, y0, y1, y2;
  135|   147k|  const FLOAT32 *a = NULL, *b = NULL;
  136|       |
  137|   147k|  y1 = mem[0];
  138|   147k|  y2 = mem[1];
  139|   147k|  x0 = mem[2];
  140|   147k|  x1 = mem[3];
  141|   147k|  sr_idx = ia_get_sample_rate(fscale);
  142|   147k|  a = &iusace_hp20_filter_coeffs[sr_idx][0];
  143|   147k|  b = &iusace_hp20_filter_coeffs[sr_idx][2];
  144|       |
  145|   136M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (145:15): [True: 136M, False: 147k]
  ------------------
  146|   136M|    x2 = x1;
  147|   136M|    x1 = x0;
  148|   136M|    x0 = signal[i];
  149|   136M|    y0 = (y1 * a[0]) + (y2 * a[1]) + (x0 * b[1]) + (x1 * b[0]) + (x2 * b[1]);
  150|   136M|    signal[i] = y0;
  151|   136M|    y2 = y1;
  152|   136M|    y1 = y0;
  153|   136M|  }
  154|       |
  155|   147k|  mem[0] = ((y1 > 1e-10) | (y1 < -1e-10)) ? y1 : 0;
  ------------------
  |  Branch (155:12): [True: 142k, False: 5.28k]
  ------------------
  156|   147k|  mem[1] = ((y2 > 1e-10) | (y2 < -1e-10)) ? y2 : 0;
  ------------------
  |  Branch (156:12): [True: 142k, False: 5.29k]
  ------------------
  157|   147k|  mem[2] = ((x0 > 1e-10) | (x0 < -1e-10)) ? x0 : 0;
  ------------------
  |  Branch (157:12): [True: 133k, False: 13.6k]
  ------------------
  158|   147k|  mem[3] = ((x1 > 1e-10) | (x1 < -1e-10)) ? x1 : 0;
  ------------------
  |  Branch (158:12): [True: 133k, False: 13.6k]
  ------------------
  159|   147k|}
iusace_apply_preemph:
  161|  7.81M|VOID iusace_apply_preemph(FLOAT32 *signal, FLOAT32 factor, WORD32 length, FLOAT32 *mem) {
  162|  7.81M|  WORD32 i;
  163|  7.81M|  FLOAT32 temp;
  164|  7.81M|  temp = signal[length - 1];
  165|   903M|  for (i = length - 1; i > 0; i--) {
  ------------------
  |  Branch (165:24): [True: 895M, False: 7.81M]
  ------------------
  166|   895M|    signal[i] = signal[i] - factor * signal[i - 1];
  167|   895M|  }
  168|  7.81M|  signal[0] -= factor * (*mem);
  169|  7.81M|  *mem = temp;
  170|  7.81M|}
iusace_apply_deemph:
  172|  14.6M|VOID iusace_apply_deemph(FLOAT32 *signal, FLOAT32 factor, WORD32 length, FLOAT32 *mem) {
  173|  14.6M|  WORD32 i;
  174|  14.6M|  signal[0] = signal[0] + factor * (*mem);
  175|  2.14G|  for (i = 1; i < length; i++) {
  ------------------
  |  Branch (175:15): [True: 2.13G, False: 14.6M]
  ------------------
  176|  2.13G|    signal[i] = signal[i] + factor * signal[i - 1];
  177|  2.13G|  }
  178|  14.6M|  *mem = signal[length - 1];
  179|  14.6M|  if ((*mem < 1e-10) & (*mem > -1e-10)) {
  ------------------
  |  Branch (179:7): [True: 238k, False: 14.4M]
  ------------------
  180|   238k|    *mem = 0;
  181|   238k|  }
  182|  14.6M|}
iusace_synthesis_tool_float:
  185|  11.1M|                                 FLOAT32 *scratch_synth_tool) {
  186|  11.1M|  FLOAT32 s;
  187|  11.1M|  FLOAT32 *yy;
  188|  11.1M|  WORD32 i, j;
  189|  11.1M|  memcpy(scratch_synth_tool, mem, ORDER * sizeof(FLOAT32));
  ------------------
  |  |   71|  11.1M|#define ORDER (16)
  ------------------
  190|  11.1M|  yy = &scratch_synth_tool[ORDER];
  ------------------
  |  |   71|  11.1M|#define ORDER (16)
  ------------------
  191|   867M|  for (i = 0; i < l; i++) {
  ------------------
  |  Branch (191:15): [True: 856M, False: 11.1M]
  ------------------
  192|   856M|    s = x[i];
  193|  4.28G|    for (j = 1; j <= ORDER; j += 4) {
  ------------------
  |  |   71|  4.28G|#define ORDER (16)
  ------------------
  |  Branch (193:17): [True: 3.42G, False: 856M]
  ------------------
  194|  3.42G|      s -= a[j] * yy[i - j];
  195|  3.42G|      s -= a[j + 1] * yy[i - (j + 1)];
  196|  3.42G|      s -= a[j + 2] * yy[i - (j + 2)];
  197|  3.42G|      s -= a[j + 3] * yy[i - (j + 3)];
  198|  3.42G|    }
  199|   856M|    yy[i] = s;
  200|   856M|    y[i] = s;
  201|   856M|  }
  202|  11.1M|}
iusace_compute_lp_residual:
  204|  33.7M|VOID iusace_compute_lp_residual(FLOAT32 *a, FLOAT32 *x, FLOAT32 *y, WORD32 l) {
  205|  33.7M|  FLOAT32 s;
  206|  33.7M|  WORD32 i;
  207|  2.22G|  for (i = 0; i < l; i++) {
  ------------------
  |  Branch (207:15): [True: 2.18G, False: 33.7M]
  ------------------
  208|  2.18G|    s = x[i];
  209|  2.18G|    s += a[1] * x[i - 1];
  210|  2.18G|    s += a[2] * x[i - 2];
  211|  2.18G|    s += a[3] * x[i - 3];
  212|  2.18G|    s += a[4] * x[i - 4];
  213|  2.18G|    s += a[5] * x[i - 5];
  214|  2.18G|    s += a[6] * x[i - 6];
  215|  2.18G|    s += a[7] * x[i - 7];
  216|  2.18G|    s += a[8] * x[i - 8];
  217|  2.18G|    s += a[9] * x[i - 9];
  218|  2.18G|    s += a[10] * x[i - 10];
  219|  2.18G|    s += a[11] * x[i - 11];
  220|  2.18G|    s += a[12] * x[i - 12];
  221|  2.18G|    s += a[13] * x[i - 13];
  222|  2.18G|    s += a[14] * x[i - 14];
  223|  2.18G|    s += a[15] * x[i - 15];
  224|  2.18G|    s += a[16] * x[i - 16];
  225|  2.18G|    y[i] = s;
  226|  2.18G|  }
  227|  33.7M|}
iusace_convolve:
  229|  6.20M|VOID iusace_convolve(FLOAT32 *signal, FLOAT32 *wsynth_filter_ir, FLOAT32 *conv_out) {
  230|  6.20M|  FLOAT32 temp;
  231|  6.20M|  WORD32 i, n;
  232|   204M|  for (n = 0; n < LEN_SUBFR; n += 2) {
  ------------------
  |  |   77|   204M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (232:15): [True: 198M, False: 6.20M]
  ------------------
  233|   198M|    temp = 0.0f;
  234|  6.54G|    for (i = 0; i <= n; i++) {
  ------------------
  |  Branch (234:17): [True: 6.35G, False: 198M]
  ------------------
  235|  6.35G|      temp += signal[i] * wsynth_filter_ir[n - i];
  236|  6.35G|    }
  237|   198M|    conv_out[n] = temp;
  238|   198M|    temp = 0.0f;
  239|  3.47G|    for (i = 0; i <= (n + 1); i += 2) {
  ------------------
  |  Branch (239:17): [True: 3.27G, False: 198M]
  ------------------
  240|  3.27G|      temp += signal[i] * wsynth_filter_ir[(n + 1) - i];
  241|  3.27G|      temp += signal[i + 1] * wsynth_filter_ir[n - i];
  242|  3.27G|    }
  243|   198M|    conv_out[n + 1] = temp;
  244|   198M|  }
  245|  6.20M|}
iusace_autocorr_plus:
  248|   561k|                          const FLOAT32 *lp_analysis_win, FLOAT32 *temp_aut_corr) {
  249|   561k|  FLOAT32 val;
  250|   561k|  WORD16 i, j;
  251|   252M|  for (i = 0; i < window_len; i++) {
  ------------------
  |  Branch (251:15): [True: 251M, False: 561k]
  ------------------
  252|   251M|    temp_aut_corr[i] = speech[i] * lp_analysis_win[i];
  253|   251M|  }
  254|  10.0M|  for (i = 0; i <= ORDER; i++) {
  ------------------
  |  |   71|  10.0M|#define ORDER (16)
  ------------------
  |  Branch (254:15): [True: 9.53M, False: 561k]
  ------------------
  255|  9.53M|    val = 0.0f;
  256|  4.20G|    for (j = 0; j < window_len - i; j++) {
  ------------------
  |  Branch (256:17): [True: 4.19G, False: 9.53M]
  ------------------
  257|  4.19G|      val += temp_aut_corr[j] * temp_aut_corr[j + i];
  258|  4.19G|    }
  259|  9.53M|    auto_corr_vector[i] = val;
  260|  9.53M|  }
  261|   561k|  if (auto_corr_vector[0] < 1.0) {
  ------------------
  |  Branch (261:7): [True: 44.4k, False: 516k]
  ------------------
  262|  44.4k|    auto_corr_vector[0] = 1.0;
  263|  44.4k|  }
  264|   561k|}
iusace_open_loop_search:
  318|   953k|                             ia_usac_td_encoder_struct *st) {
  319|   953k|  WORD32 i, j, k;
  320|   953k|  FLOAT32 r, corr, energy1, energy2, corr_max = -1.0e23f;
  321|   953k|  const FLOAT32 *p1_ol_cw_table, *p2_ol_cw_table;
  322|   953k|  FLOAT32 *data_a, *data_b, *hp_wsp, *p, *p1;
  323|       |
  324|   953k|  p1_ol_cw_table = &iusace_ol_corr_weight[453];
  325|   953k|  p2_ol_cw_table = &iusace_ol_corr_weight[259 + max_pitch_lag - st->prev_pitch_med];
  326|   953k|  *ol_pitch_lag = 0;
  327|   126M|  for (i = max_pitch_lag; i > min_pitch_lag; i--) {
  ------------------
  |  Branch (327:27): [True: 125M, False: 953k]
  ------------------
  328|   125M|    p = &wsp[0];
  329|   125M|    p1 = &wsp[-i];
  330|   125M|    corr = 0.0;
  331|  4.48G|    for (j = 0; j < num_frame; j += 2) {
  ------------------
  |  Branch (331:17): [True: 4.35G, False: 125M]
  ------------------
  332|  4.35G|      corr += p[j] * p1[j];
  333|  4.35G|      corr += p[j + 1] * p1[j + 1];
  334|  4.35G|    }
  335|   125M|    corr *= *p1_ol_cw_table--;
  336|   125M|    if ((st->prev_pitch_med > 0) && (st->ol_wght_flg == 1)) {
  ------------------
  |  Branch (336:9): [True: 125M, False: 0]
  |  Branch (336:37): [True: 40.4M, False: 84.6M]
  ------------------
  337|  40.4M|      corr *= *p2_ol_cw_table--;
  338|  40.4M|    }
  339|   125M|    if (corr >= corr_max) {
  ------------------
  |  Branch (339:9): [True: 48.6M, False: 76.4M]
  ------------------
  340|  48.6M|      corr_max = corr;
  341|  48.6M|      *ol_pitch_lag = i;
  342|  48.6M|    }
  343|   125M|  }
  344|   953k|  data_a = st->hp_ol_ltp_mem;
  345|   953k|  data_b = st->hp_ol_ltp_mem + HP_ORDER;
  ------------------
  |  |  156|   953k|#define HP_ORDER (3)
  ------------------
  346|   953k|  hp_wsp = st->prev_hp_wsp + max_pitch_lag;
  347|  67.1M|  for (k = 0; k < num_frame; k++) {
  ------------------
  |  Branch (347:15): [True: 66.1M, False: 953k]
  ------------------
  348|  66.1M|    data_b[0] = data_b[1];
  349|  66.1M|    data_b[1] = data_b[2];
  350|  66.1M|    data_b[2] = data_b[3];
  351|  66.1M|    data_b[HP_ORDER] = wsp[k];
  ------------------
  |  |  156|  66.1M|#define HP_ORDER (3)
  ------------------
  352|  66.1M|    r = data_b[0] * 0.83787057505665F;
  353|  66.1M|    r += data_b[1] * -2.50975570071058F;
  354|  66.1M|    r += data_b[2] * 2.50975570071058F;
  355|  66.1M|    r += data_b[3] * -0.83787057505665F;
  356|  66.1M|    r -= data_a[0] * -2.64436711600664F;
  357|  66.1M|    r -= data_a[1] * 2.35087386625360F;
  358|  66.1M|    r -= data_a[2] * -0.70001156927424F;
  359|  66.1M|    data_a[2] = data_a[1];
  360|  66.1M|    data_a[1] = data_a[0];
  361|  66.1M|    data_a[0] = r;
  362|  66.1M|    hp_wsp[k] = r;
  363|  66.1M|  }
  364|   953k|  p = &hp_wsp[0];
  365|   953k|  p1 = &hp_wsp[-(*ol_pitch_lag)];
  366|   953k|  corr = 0.0F;
  367|   953k|  energy1 = 0.0F;
  368|   953k|  energy2 = 0.0F;
  369|  67.1M|  for (j = 0; j < num_frame; j++) {
  ------------------
  |  Branch (369:15): [True: 66.1M, False: 953k]
  ------------------
  370|  66.1M|    energy1 += p1[j] * p1[j];
  371|  66.1M|    energy2 += p[j] * p[j];
  372|  66.1M|    corr += p[j] * p1[j];
  373|  66.1M|  }
  374|   953k|  st->ol_gain = (FLOAT32)(corr / (sqrt(energy1 * energy2) + 1e-5));
  375|   953k|  memmove(st->prev_hp_wsp, &st->prev_hp_wsp[num_frame], max_pitch_lag * sizeof(FLOAT32));
  376|   953k|}
iusace_get_ol_lag_median:
  378|   144k|WORD32 iusace_get_ol_lag_median(WORD32 prev_ol_lag, WORD32 *prev_ol_lags) {
  379|   144k|  WORD32 sorted_ol_lags_out[NUM_OPEN_LOOP_LAGS + 1] = {0};
  380|   144k|  WORD32 i, j, idx, val;
  381|   144k|  WORD32 num_lags = NUM_OPEN_LOOP_LAGS;
  ------------------
  |  |  159|   144k|#define NUM_OPEN_LOOP_LAGS (5)
  ------------------
  382|   722k|  for (i = NUM_OPEN_LOOP_LAGS - 1; i > 0; i--) {
  ------------------
  |  |  159|   144k|#define NUM_OPEN_LOOP_LAGS (5)
  ------------------
  |  Branch (382:36): [True: 578k, False: 144k]
  ------------------
  383|   578k|    prev_ol_lags[i] = prev_ol_lags[i - 1];
  384|   578k|  }
  385|   144k|  prev_ol_lags[0] = prev_ol_lag;
  386|   867k|  for (i = 0; i < NUM_OPEN_LOOP_LAGS; i++) {
  ------------------
  |  |  159|   867k|#define NUM_OPEN_LOOP_LAGS (5)
  ------------------
  |  Branch (386:15): [True: 722k, False: 144k]
  ------------------
  387|   722k|    sorted_ol_lags_out[i + 1] = prev_ol_lags[i];
  388|   722k|  }
  389|       |
  390|   144k|  idx = (NUM_OPEN_LOOP_LAGS >> 1) + 1;
  ------------------
  |  |  159|   144k|#define NUM_OPEN_LOOP_LAGS (5)
  ------------------
  391|   867k|  for (;;) {
  392|   867k|    if (idx > 1) {
  ------------------
  |  Branch (392:9): [True: 289k, False: 578k]
  ------------------
  393|   289k|      val = sorted_ol_lags_out[--idx];
  394|   578k|    } else {
  395|   578k|      val = sorted_ol_lags_out[num_lags];
  396|   578k|      sorted_ol_lags_out[num_lags] = sorted_ol_lags_out[1];
  397|   578k|      if (--num_lags == 1) {
  ------------------
  |  Branch (397:11): [True: 144k, False: 433k]
  ------------------
  398|   144k|        sorted_ol_lags_out[1] = val;
  399|   144k|        break;
  400|   144k|      }
  401|   578k|    }
  402|   722k|    i = idx;
  403|   722k|    j = idx << 1;
  404|  1.57M|    while (j <= num_lags) {
  ------------------
  |  Branch (404:12): [True: 850k, False: 722k]
  ------------------
  405|   850k|      if (j < num_lags && sorted_ol_lags_out[j] < sorted_ol_lags_out[j + 1]) {
  ------------------
  |  Branch (405:11): [True: 642k, False: 207k]
  |  Branch (405:27): [True: 114k, False: 528k]
  ------------------
  406|   114k|        ++j;
  407|   114k|      }
  408|   850k|      if (val < sorted_ol_lags_out[j]) {
  ------------------
  |  Branch (408:11): [True: 348k, False: 502k]
  ------------------
  409|   348k|        sorted_ol_lags_out[i] = sorted_ol_lags_out[j];
  410|   348k|        i = j;
  411|   348k|        j *= 2;
  412|   502k|      } else {
  413|   502k|        j = num_lags + 1;
  414|   502k|      }
  415|   850k|    }
  416|   722k|    sorted_ol_lags_out[i] = val;
  417|   722k|  }
  418|       |
  419|   144k|  return sorted_ol_lags_out[OPEN_LOOP_LAG_MEDIAN];
  ------------------
  |  |  160|   144k|#define OPEN_LOOP_LAG_MEDIAN (3)
  ------------------
  420|   144k|}
iusace_closed_loop_search:
  425|  2.06M|                               WORD32 min_pitch_lag_res_1, WORD32 *pitch_lag_out) {
  426|  2.06M|  WORD32 i, fraction, step;
  427|  2.06M|  FLOAT32 corr_vector[15 + 2 * LEN_INTERPOL1 + 1] = {0};
  428|  2.06M|  FLOAT32 corr_max, temp;
  429|  2.06M|  FLOAT32 *p_norm_corr_vector;
  430|  2.06M|  WORD32 min_interval, max_interval;
  431|  2.06M|  min_interval = search_range_min - LEN_INTERPOL1;
  ------------------
  |  |  157|  2.06M|#define LEN_INTERPOL1 (4)
  ------------------
  432|  2.06M|  max_interval = search_range_max + LEN_INTERPOL1;
  ------------------
  |  |  157|  2.06M|#define LEN_INTERPOL1 (4)
  ------------------
  433|  2.06M|  p_norm_corr_vector = &corr_vector[0];
  434|  2.06M|  iusace_get_norm_correlation(exc, xn, wsyn_filt_ir, min_interval, max_interval,
  435|  2.06M|                              p_norm_corr_vector);
  436|       |
  437|  2.06M|  corr_max = p_norm_corr_vector[LEN_INTERPOL1];
  ------------------
  |  |  157|  2.06M|#define LEN_INTERPOL1 (4)
  ------------------
  438|  2.06M|  *pitch_lag_out = search_range_min;
  439|  29.6M|  for (i = search_range_min + 1; i <= search_range_max; i++) {
  ------------------
  |  Branch (439:34): [True: 27.5M, False: 2.06M]
  ------------------
  440|  27.5M|    if (p_norm_corr_vector[i - search_range_min + LEN_INTERPOL1] > corr_max) {
  ------------------
  |  |  157|  27.5M|#define LEN_INTERPOL1 (4)
  ------------------
  |  Branch (440:9): [True: 7.51M, False: 20.0M]
  ------------------
  441|  7.51M|      corr_max = p_norm_corr_vector[i - search_range_min + LEN_INTERPOL1];
  ------------------
  |  |  157|  7.51M|#define LEN_INTERPOL1 (4)
  ------------------
  442|  7.51M|      *pitch_lag_out = i;
  443|  7.51M|    }
  444|  27.5M|  }
  445|  2.06M|  if ((is_first_subfrm == 0) && (*pitch_lag_out >= min_pitch_lag_res_1)) {
  ------------------
  |  Branch (445:7): [True: 953k, False: 1.11M]
  |  Branch (445:33): [True: 233k, False: 720k]
  ------------------
  446|   233k|    *pit_frac = 0;
  447|  1.83M|  } else {
  448|  1.83M|    step = 1;
  449|  1.83M|    fraction = -3;
  450|  1.83M|    if (((is_first_subfrm == 0) && (*pitch_lag_out >= min_pitch_lag_res1_2)) ||
  ------------------
  |  Branch (450:10): [True: 720k, False: 1.11M]
  |  Branch (450:36): [True: 140k, False: 580k]
  ------------------
  451|  1.69M|        (min_pitch_lag_res1_2 == TMIN)) {
  ------------------
  |  |   99|  1.69M|#define TMIN (34)
  ------------------
  |  Branch (451:9): [True: 0, False: 1.69M]
  ------------------
  452|   140k|      step = 2;
  453|   140k|      fraction = -2;
  454|   140k|    }
  455|  1.83M|    if (*pitch_lag_out == search_range_min) {
  ------------------
  |  Branch (455:9): [True: 299k, False: 1.53M]
  ------------------
  456|   299k|      fraction = 0;
  457|   299k|    }
  458|  1.83M|    corr_max = iusace_corr_interpolate(
  459|  1.83M|        &p_norm_corr_vector[(*pitch_lag_out) - search_range_min + LEN_INTERPOL1], fraction);
  ------------------
  |  |  157|  1.83M|#define LEN_INTERPOL1 (4)
  ------------------
  460|  11.4M|    for (i = (fraction + step); i <= 3; i += step) {
  ------------------
  |  Branch (460:33): [True: 9.58M, False: 1.83M]
  ------------------
  461|  9.58M|      temp = iusace_corr_interpolate(
  462|  9.58M|          &p_norm_corr_vector[(*pitch_lag_out) - search_range_min + LEN_INTERPOL1], i);
  ------------------
  |  |  157|  9.58M|#define LEN_INTERPOL1 (4)
  ------------------
  463|  9.58M|      if (temp > corr_max) {
  ------------------
  |  Branch (463:11): [True: 4.70M, False: 4.88M]
  ------------------
  464|  4.70M|        corr_max = temp;
  465|  4.70M|        fraction = i;
  466|  4.70M|      }
  467|  9.58M|    }
  468|  1.83M|    if (fraction < 0) {
  ------------------
  |  Branch (468:9): [True: 433k, False: 1.40M]
  ------------------
  469|   433k|      fraction += 4;
  470|   433k|      (*pitch_lag_out) -= 1;
  471|   433k|    }
  472|  1.83M|    *pit_frac = fraction;
  473|  1.83M|  }
  474|  2.06M|}
iusace_decim2_fir_filter:
  477|   565k|                              FLOAT32 *scratch_fir_sig_buf) {
  478|   565k|  FLOAT32 *sig_buf = scratch_fir_sig_buf;
  479|   565k|  FLOAT32 temp;
  480|   565k|  WORD32 i, j;
  481|   565k|  memcpy(sig_buf, mem, DECIM2_FIR_FILT_MEM_SIZE * sizeof(FLOAT32));
  ------------------
  |  |  161|   565k|#define DECIM2_FIR_FILT_MEM_SIZE (3)
  ------------------
  482|   565k|  memcpy(sig_buf + DECIM2_FIR_FILT_MEM_SIZE, signal, length * sizeof(FLOAT32));
  ------------------
  |  |  161|   565k|#define DECIM2_FIR_FILT_MEM_SIZE (3)
  ------------------
  483|  2.26M|  for (i = 0; i < DECIM2_FIR_FILT_MEM_SIZE; i++) {
  ------------------
  |  |  161|  2.26M|#define DECIM2_FIR_FILT_MEM_SIZE (3)
  ------------------
  |  Branch (483:15): [True: 1.69M, False: 565k]
  ------------------
  484|  1.69M|    mem[i] = ((signal[length - DECIM2_FIR_FILT_MEM_SIZE + i] > 1e-10) ||
  ------------------
  |  |  161|  1.69M|#define DECIM2_FIR_FILT_MEM_SIZE (3)
  ------------------
  |  Branch (484:15): [True: 806k, False: 889k]
  ------------------
  485|   889k|              (signal[length - DECIM2_FIR_FILT_MEM_SIZE + i] < -1e-10))
  ------------------
  |  |  161|   889k|#define DECIM2_FIR_FILT_MEM_SIZE (3)
  ------------------
  |  Branch (485:15): [True: 841k, False: 48.3k]
  ------------------
  486|  1.69M|                 ? signal[length - DECIM2_FIR_FILT_MEM_SIZE + i]
  ------------------
  |  |  161|  1.64M|#define DECIM2_FIR_FILT_MEM_SIZE (3)
  ------------------
  487|  1.69M|                 : 0;
  488|  1.69M|  }
  489|  67.7M|  for (i = 0, j = 0; i < length; i += 2, j++) {
  ------------------
  |  Branch (489:22): [True: 67.1M, False: 565k]
  ------------------
  490|  67.1M|    temp = sig_buf[i] * 0.13F;
  491|  67.1M|    temp += sig_buf[i + 1] * 0.23F;
  492|  67.1M|    temp += sig_buf[i + 2] * 0.28F;
  493|       |#ifdef _WIN32
  494|       |#pragma warning(suppress : 6385)
  495|       |#endif
  496|  67.1M|    temp += sig_buf[i + 3] * 0.23F;
  497|  67.1M|    temp += sig_buf[i + 4] * 0.13F;
  498|  67.1M|    signal[j] = temp;
  499|  67.1M|  }
  500|   565k|}
iusace_calc_sq_gain:
  503|   910k|                            FLOAT32 *scratch_sq_gain_en) {
  504|   910k|  WORD32 i, j, k;
  505|   910k|  FLOAT32 gain, ener, temp, target, factor, offset;
  506|   910k|  FLOAT32 *en = scratch_sq_gain_en;
  507|       |
  508|  92.8M|  for (i = 0; i < length; i += 4) {
  ------------------
  |  Branch (508:15): [True: 91.9M, False: 910k]
  ------------------
  509|  91.9M|    ener = 0.01f;
  510|   459M|    for (j = i; j < i + 4; j++) {
  ------------------
  |  Branch (510:17): [True: 367M, False: 91.9M]
  ------------------
  511|   367M|      ener += x[j] * x[j];
  512|   367M|    }
  513|       |
  514|  91.9M|    temp = (FLOAT32)log10(ener);
  515|  91.9M|    en[i / 4] = 9.0f + 10.0f * temp;
  516|  91.9M|  }
  517|       |
  518|   910k|  target = (6.0f / 4.0f) * (FLOAT32)(num_bits - (length / 16));
  519|       |
  520|   910k|  factor = 128.0f;
  521|   910k|  offset = factor;
  522|       |
  523|  10.0M|  for (k = 0; k < 10; k++) {
  ------------------
  |  Branch (523:15): [True: 9.10M, False: 910k]
  ------------------
  524|  9.10M|    factor *= 0.5f;
  525|  9.10M|    offset -= factor;
  526|  9.10M|    ener = 0.0f;
  527|   928M|    for (i = 0; i < length / 4; i++) {
  ------------------
  |  Branch (527:17): [True: 919M, False: 9.10M]
  ------------------
  528|   919M|      temp = en[i] - offset;
  529|       |
  530|   919M|      if (temp > 3.0f) {
  ------------------
  |  Branch (530:11): [True: 407M, False: 511M]
  ------------------
  531|   407M|        ener += temp;
  532|   407M|      }
  533|   919M|    }
  534|  9.10M|    if (ener > target) {
  ------------------
  |  Branch (534:9): [True: 3.20M, False: 5.89M]
  ------------------
  535|  3.20M|      offset += factor;
  536|  3.20M|    }
  537|  9.10M|  }
  538|       |
  539|   910k|  gain = (FLOAT32)pow(10.0f, offset / 20.0f);
  540|       |
  541|   910k|  return (gain);
  542|   910k|}
iusace_lpc_coef_gen:
  545|   904k|                         WORD32 m) {
  546|   904k|  FLOAT32 lsf[ORDER] = {0}, *ptr_a;
  547|   904k|  FLOAT32 inc, fnew, fold;
  548|   904k|  WORD32 i = 0;
  549|       |
  550|   904k|  ptr_a = a;
  551|       |
  552|   904k|  inc = 1.0f / (FLOAT32)nb_subfr;
  553|   904k|  fnew = 0.5f - (0.5f * inc);
  554|   904k|  fold = 1.0f - fnew;
  555|  15.3M|  for (i = 0; i < m; i++) {
  ------------------
  |  Branch (555:15): [True: 14.4M, False: 904k]
  ------------------
  556|  14.4M|    lsf[i] = (lsf_old[i] * fold) + (lsf_new[i] * fnew);
  557|  14.4M|  }
  558|   904k|  iusace_lsp_to_lp_conversion(lsf, ptr_a);
  559|   904k|  ptr_a += (m + 1);
  560|   904k|  iusace_lsp_to_lp_conversion(lsf_old, ptr_a);
  561|   904k|  ptr_a += (m + 1);
  562|   904k|  iusace_lsp_to_lp_conversion(lsf_new, ptr_a);
  563|       |
  564|   904k|  return;
  565|   904k|}
iusace_interpolation_lsp_params:
  568|  1.11M|                                     WORD32 nb_subfr) {
  569|  1.11M|  FLOAT32 lsp[ORDER];
  570|  1.11M|  FLOAT32 factor;
  571|  1.11M|  WORD32 i, k;
  572|  1.11M|  FLOAT32 x_plus_y, x_minus_y;
  573|       |
  574|  1.11M|  factor = 1.0f / (FLOAT32)nb_subfr;
  575|       |
  576|  1.11M|  x_plus_y = 0.5f * factor;
  577|       |
  578|  5.24M|  for (k = 0; k < nb_subfr; k++) {
  ------------------
  |  Branch (578:15): [True: 4.13M, False: 1.11M]
  ------------------
  579|  4.13M|    x_minus_y = 1.0f - x_plus_y;
  580|  70.2M|    for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  70.2M|#define ORDER (16)
  ------------------
  |  Branch (580:17): [True: 66.1M, False: 4.13M]
  ------------------
  581|  66.1M|      lsp[i] = (lsp_old[i] * x_minus_y) + (lsp_new[i] * x_plus_y);
  582|  66.1M|    }
  583|  4.13M|    x_plus_y += factor;
  584|       |
  585|  4.13M|    iusace_lsp_to_lp_conversion(lsp, lp_flt_coff_a);
  586|       |
  587|  4.13M|    lp_flt_coff_a += (ORDER + 1);
  ------------------
  |  |   71|  4.13M|#define ORDER (16)
  ------------------
  588|  4.13M|  }
  589|       |
  590|  1.11M|  iusace_lsp_to_lp_conversion(lsp_new, lp_flt_coff_a);
  591|       |
  592|  1.11M|  return;
  593|  1.11M|}
iusace_lpd_utils.c:iusace_get_norm_correlation:
  268|  2.06M|                                        FLOAT32 *norm_corr) {
  269|  2.06M|  WORD32 i, j, k;
  270|  2.06M|  FLOAT32 filt_prev_exc[LEN_SUBFR];
  271|  2.06M|  FLOAT32 energy_filt_exc, corr, norm;
  272|  2.06M|  k = -min_interval;
  273|       |
  274|  2.06M|  iusace_convolve(&exc[k], wsyn_filt_ir, filt_prev_exc);
  275|       |
  276|  48.2M|  for (i = min_interval; i <= max_interval; i++) {
  ------------------
  |  Branch (276:26): [True: 46.1M, False: 2.06M]
  ------------------
  277|  46.1M|    corr = 0.0F;
  278|  46.1M|    energy_filt_exc = 0.01F;
  279|  3.00G|    for (j = 0; j < LEN_SUBFR; j++) {
  ------------------
  |  |   77|  3.00G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (279:17): [True: 2.95G, False: 46.1M]
  ------------------
  280|  2.95G|      corr += xn[j] * filt_prev_exc[j];
  281|  2.95G|      energy_filt_exc += filt_prev_exc[j] * filt_prev_exc[j];
  282|  2.95G|    }
  283|       |
  284|  46.1M|    norm = (FLOAT32)(1.0f / sqrt(energy_filt_exc));
  285|  46.1M|    norm_corr[i - min_interval] = corr * norm;
  286|       |
  287|  46.1M|    if (i != max_interval) {
  ------------------
  |  Branch (287:9): [True: 44.0M, False: 2.06M]
  ------------------
  288|  44.0M|      k--;
  289|  2.82G|      for (j = LEN_SUBFR - 1; j > 0; j--) {
  ------------------
  |  |   77|  44.0M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (289:31): [True: 2.77G, False: 44.0M]
  ------------------
  290|  2.77G|        filt_prev_exc[j] = filt_prev_exc[j - 1] + exc[k] * wsyn_filt_ir[j];
  291|  2.77G|      }
  292|  44.0M|      filt_prev_exc[0] = exc[k];
  293|  44.0M|    }
  294|  46.1M|  }
  295|  2.06M|}
iusace_lpd_utils.c:iusace_corr_interpolate:
  297|  11.4M|static FLOAT32 iusace_corr_interpolate(FLOAT32 *x, WORD32 fraction) {
  298|  11.4M|  FLOAT32 interpol_value, *x1, *x2;
  299|  11.4M|  const FLOAT32 *p1_interp4_1_table, *p2_interp4_1_table;
  300|  11.4M|  if (fraction < 0) {
  ------------------
  |  Branch (300:7): [True: 4.36M, False: 7.05M]
  ------------------
  301|  4.36M|    fraction += 4;
  302|  4.36M|    x--;
  303|  4.36M|  }
  304|  11.4M|  x1 = &x[0];
  305|  11.4M|  x2 = &x[1];
  306|  11.4M|  p1_interp4_1_table = &iusace_interp4_1[fraction];
  307|  11.4M|  p2_interp4_1_table = &iusace_interp4_1[4 - fraction];
  308|  11.4M|  interpol_value = x1[0] * p1_interp4_1_table[0] + x2[0] * p2_interp4_1_table[0];
  309|  11.4M|  interpol_value += x1[-1] * p1_interp4_1_table[4] + x2[1] * p2_interp4_1_table[4];
  310|  11.4M|  interpol_value += x1[-2] * p1_interp4_1_table[8] + x2[2] * p2_interp4_1_table[8];
  311|  11.4M|  interpol_value += x1[-3] * p1_interp4_1_table[12] + x2[3] * p2_interp4_1_table[12];
  312|       |
  313|  11.4M|  return interpol_value;
  314|  11.4M|}

iusace_ms_apply:
   35|   156k|                     const WORD32 *ptr_sfb_offsets, WORD32 chn, FLOAT64 *ptr_ms_spec) {
   36|   156k|  FLOAT32 *ptr_sfb_enegry_left = pstr_psy_data[chn].ptr_sfb_energy_long;
   37|   156k|  FLOAT32 *ptr_sfb_energy_right = pstr_psy_data[chn + 1].ptr_sfb_energy_long;
   38|   156k|  const FLOAT32 *ptr_sfb_energy_mid = pstr_psy_data[chn].ptr_sfb_energy_long_ms;
   39|   156k|  const FLOAT32 *ptr_sfb_energy_side = pstr_psy_data[chn + 1].ptr_sfb_energy_long_ms;
   40|   156k|  FLOAT32 *ptr_sfb_thr_left = pstr_psy_data[chn].ptr_sfb_thr_long;
   41|   156k|  FLOAT32 *ptr_sfb_thr_right = pstr_psy_data[chn + 1].ptr_sfb_thr_long;
   42|   156k|  FLOAT32 *ptr_sfb_spread_energy_left = pstr_psy_data[chn].ptr_sfb_spreaded_energy_long;
   43|   156k|  FLOAT32 *ptr_sfb_spread_energy_right = pstr_psy_data[chn + 1].ptr_sfb_spreaded_energy_long;
   44|   156k|  WORD32 sfb, sfb_offsets, j;
   45|   156k|  WORD32 grp = 0;
   46|   156k|  WORD32 ms_counter = 0;
   47|   156k|  WORD32 lr_counter = 0;
   48|       |
   49|   156k|  *ms_select = 0;
   50|       |
   51|   447k|  for (sfb = 0; sfb < sfb_count; sfb += sfb_per_group, grp++) {
  ------------------
  |  Branch (51:17): [True: 291k, False: 156k]
  ------------------
   52|  7.01M|    for (sfb_offsets = 0; sfb_offsets < max_sfb_per_grp; sfb_offsets++) {
  ------------------
  |  Branch (52:27): [True: 6.72M, False: 291k]
  ------------------
   53|  6.72M|      FLOAT32 left_right, mid_side, min_thr;
   54|  6.72M|      WORD32 use_ms;
   55|  6.72M|      ms_used[grp][sfb_offsets] = 0;
   56|       |
   57|  6.72M|      min_thr = MIN(ptr_sfb_thr_left[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]);
  ------------------
  |  |   23|  6.72M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 374k, False: 6.34M]
  |  |  ------------------
  ------------------
   58|       |
   59|  6.72M|      left_right =
   60|  6.72M|          (ptr_sfb_thr_left[sfb + sfb_offsets] /
   61|  6.72M|           MAX(ptr_sfb_enegry_left[sfb + sfb_offsets], ptr_sfb_thr_left[sfb + sfb_offsets])) *
  ------------------
  |  |   24|  6.72M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 4.60M, False: 2.11M]
  |  |  ------------------
  ------------------
   62|  6.72M|          (ptr_sfb_thr_right[sfb + sfb_offsets] /
   63|  6.72M|           max(ptr_sfb_energy_right[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]));
  ------------------
  |  |   74|  6.72M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 4.58M, False: 2.13M]
  |  |  ------------------
  ------------------
   64|       |
   65|  6.72M|      mid_side = (min_thr / max(ptr_sfb_energy_mid[sfb + sfb_offsets], min_thr)) *
  ------------------
  |  |   74|  6.72M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 4.62M, False: 2.10M]
  |  |  ------------------
  ------------------
   66|  6.72M|                 (min_thr / max(ptr_sfb_energy_side[sfb + sfb_offsets], min_thr));
  ------------------
  |  |   74|  6.72M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 1.66M, False: 5.05M]
  |  |  ------------------
  ------------------
   67|       |
   68|  6.72M|      use_ms = (mid_side >= left_right);
   69|       |
   70|  6.72M|      if (use_ms) {
  ------------------
  |  Branch (70:11): [True: 6.52M, False: 194k]
  ------------------
   71|  6.52M|        ms_used[grp][sfb_offsets] = 1;
   72|       |
   73|   134M|        for (j = ptr_sfb_offsets[sfb + sfb_offsets]; j < ptr_sfb_offsets[sfb + sfb_offsets + 1];
  ------------------
  |  Branch (73:54): [True: 127M, False: 6.52M]
  ------------------
   74|   127M|             j++) {
   75|   127M|          if (ptr_ms_spec != NULL) {
  ------------------
  |  Branch (75:15): [True: 64.5M, False: 63.4M]
  ------------------
   76|  64.5M|            ptr_spec_left[j] = ptr_ms_spec[j];
   77|  64.5M|            ptr_spec_right[j] = ptr_ms_spec[1024 + j];
   78|  64.5M|          } else {
   79|  63.4M|            FLOAT64 tmp = ptr_spec_left[j];
   80|       |
   81|  63.4M|            ptr_spec_left[j] = 0.5f * (ptr_spec_left[j] + ptr_spec_right[j]);
   82|       |
   83|  63.4M|            ptr_spec_right[j] = 0.5f * (tmp - ptr_spec_right[j]);
   84|  63.4M|          }
   85|   127M|        }
   86|       |
   87|  6.52M|        ptr_sfb_thr_left[sfb + sfb_offsets] = ptr_sfb_thr_right[sfb + sfb_offsets] = min_thr;
   88|       |
   89|  6.52M|        ptr_sfb_enegry_left[sfb + sfb_offsets] = ptr_sfb_energy_mid[sfb + sfb_offsets];
   90|  6.52M|        ptr_sfb_energy_right[sfb + sfb_offsets] = ptr_sfb_energy_side[sfb + sfb_offsets];
   91|       |
   92|  6.52M|        ptr_sfb_spread_energy_left[sfb + sfb_offsets] =
   93|  6.52M|            ptr_sfb_spread_energy_right[sfb + sfb_offsets] =
   94|  6.52M|                min(ptr_sfb_spread_energy_left[sfb + sfb_offsets],
  ------------------
  |  |   75|  6.52M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 1.26M, False: 5.25M]
  |  |  ------------------
  ------------------
   95|  6.52M|                    ptr_sfb_spread_energy_right[sfb + sfb_offsets]) *
   96|  6.52M|                0.5f;
   97|       |
   98|  6.52M|        ms_counter++;
   99|  6.52M|      } else {
  100|   194k|        ms_used[grp][sfb_offsets] = 0;
  101|   194k|        lr_counter++;
  102|   194k|      }
  103|  6.72M|    }
  104|   291k|  }
  105|       |
  106|   156k|  if (ms_counter == 0) {
  ------------------
  |  Branch (106:7): [True: 7.41k, False: 149k]
  ------------------
  107|  7.41k|    *ms_select = 0;
  108|   149k|  } else {
  109|   149k|    if (lr_counter != 0) {
  ------------------
  |  Branch (109:9): [True: 25.2k, False: 123k]
  ------------------
  110|  25.2k|      *ms_select = 1;
  111|   123k|    } else {
  112|   123k|      *ms_select = 2;
  113|   123k|    }
  114|   149k|  }
  115|   156k|  return;
  116|   156k|}
iusace_calc_ms_band_energy:
  120|   681k|                                FLOAT32 *ptr_band_energy_mid, FLOAT32 *ptr_band_energy_side) {
  121|   681k|  WORD32 i, j;
  122|       |
  123|   681k|  j = 0;
  124|  14.1M|  for (i = 0; i < num_bands; i++) {
  ------------------
  |  Branch (124:15): [True: 13.5M, False: 681k]
  ------------------
  125|  13.5M|    ptr_band_energy_mid[i] = 0.0f;
  126|  13.5M|    ptr_band_energy_side[i] = 0.0f;
  127|       |
  128|   211M|    while (j < ptr_band_offset[i + 1]) {
  ------------------
  |  Branch (128:12): [True: 198M, False: 13.5M]
  ------------------
  129|   198M|      FLOAT32 specm, specs;
  130|       |
  131|   198M|      specm = (FLOAT32)(0.5f * (ptr_spec_left[j] + ptr_spec_right[j]));
  132|   198M|      specs = (FLOAT32)(0.5f * (ptr_spec_left[j] - ptr_spec_right[j]));
  133|       |
  134|   198M|      ptr_band_energy_mid[i] += specm * specm;
  135|   198M|      ptr_band_energy_side[i] += specs * specs;
  136|       |
  137|   198M|      j++;
  138|   198M|    }
  139|  13.5M|  }
  140|       |
  141|   681k|  return;
  142|   681k|}

iusace_psy_mod_init:
   62|  3.38k|                         WORD32 ccfl) {
   63|  3.38k|  WORD32 i;
   64|       |
   65|  9.15k|  for (i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (65:15): [True: 5.77k, False: 3.38k]
  ------------------
   66|  5.77k|    iusace_psy_long_config_init(bit_rate / num_channels, sample_rate, band_width,
   67|  5.77k|                                &(pstr_psy_mod->str_psy_long_config[ele_id]), ccfl);
   68|       |
   69|  5.77k|    iusace_psy_short_config_init(bit_rate / num_channels, sample_rate, band_width,
   70|  5.77k|                                 &(pstr_psy_mod->str_psy_short_config[ele_id]), ccfl);
   71|       |
   72|  5.77k|    pstr_psy_mod->str_psy_data[ch].ptr_sfb_thr_long =
   73|  5.77k|        (FLOAT32 *)pstr_psy_mod->str_psy_data[ch].sfb_thr_short;
   74|  5.77k|    pstr_psy_mod->str_psy_data[ch].ptr_sfb_energy_long =
   75|  5.77k|        (FLOAT32 *)pstr_psy_mod->str_psy_data[ch].sfb_energy_short;
   76|  5.77k|    pstr_psy_mod->str_psy_data[ch].ptr_sfb_spreaded_energy_long =
   77|  5.77k|        (FLOAT32 *)pstr_psy_mod->str_psy_data[ch].sfb_spreaded_energy_short;
   78|       |
   79|  5.77k|    memcpy(pstr_psy_mod->str_psy_data[ch].sfb_thr_nm1,
   80|  5.77k|           pstr_psy_mod->str_psy_long_config[ele_id].sfb_thr_quiet,
   81|  5.77k|           pstr_psy_mod->str_psy_long_config[ele_id].sfb_count * sizeof(FLOAT32));
   82|       |
   83|  5.77k|    ch++;
   84|  5.77k|  }
   85|       |
   86|  3.38k|  return;
   87|  3.38k|}
iusace_psy_mod_lb:
   93|   285k|                       WORD32 ccfl) {
   94|   285k|  ia_psy_mod_data_struct *pstr_psy_data = &(pstr_psy_mod->str_psy_data[i_ch]);
   95|   285k|  ia_psy_mod_long_config_struct *pstr_psy_config = &(pstr_psy_mod->str_psy_long_config[elem_idx]);
   96|   285k|  WORD32 window_sequence = pstr_sfb_prms->window_sequence[i_ch];
   97|   285k|  WORD32 num_sfb = pstr_sfb_prms->num_sfb[i_ch];
   98|   285k|  ia_tns_info *ptr_tns_info = pstr_tns_info[i_ch];
   99|   285k|  WORD32 sfb, line;
  100|   285k|  WORD32 i;
  101|   285k|  WORD32 frame_len_long = ccfl;
  102|   285k|  FLOAT32 energy_shift = 0.25f;
  103|   285k|  FLOAT32 clip_energy = pstr_psy_config->clip_energy * energy_shift;
  104|   285k|  (VOID) channel_type;
  105|       |
  106|   285k|  pstr_psy_data->window_sequence = window_sequence;
  107|   285k|  memset(&ptr_spec_in[pstr_psy_config->low_pass_line], 0,
  108|   285k|         (frame_len_long - pstr_psy_config->low_pass_line) * sizeof(FLOAT64));
  109|       |
  110|   285k|  iusace_calc_band_energy(ptr_spec_in, pstr_psy_config->sfb_offset, pstr_psy_config->sfb_active,
  111|   285k|                          pstr_psy_data->ptr_sfb_energy_long, pstr_psy_config->sfb_count);
  112|       |
  113|   285k|  if (tns_select != 0) {
  ------------------
  |  Branch (113:7): [True: 142k, False: 142k]
  ------------------
  114|   142k|    ia_tns_info *ptr_tns_info_ch2 = pstr_tns_info[i_ch - chn];
  115|   142k|    ptr_tns_info->number_of_bands = num_sfb;
  116|   142k|    ptr_tns_info->block_type = window_sequence;
  117|   142k|    ptr_tns_info->spec = ptr_spec_in;
  118|   142k|    iusace_tns_encode(ptr_tns_info_ch2, ptr_tns_info, pstr_psy_data->ptr_sfb_energy_long, 0, chn,
  119|   142k|                      pstr_psy_config->low_pass_line, scratch_tns_filter, 0, ptr_tns_scratch);
  120|   142k|  }
  121|       |
  122|  12.7M|  for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (122:15): [True: 12.5M, False: 285k]
  ------------------
  123|  12.5M|    pstr_psy_data->ptr_sfb_thr_long[i] =
  124|  12.5M|        pstr_psy_data->ptr_sfb_energy_long[i] * pstr_psy_config->ratio;
  125|  12.5M|    pstr_psy_data->ptr_sfb_thr_long[i] = MIN(pstr_psy_data->ptr_sfb_thr_long[i], clip_energy);
  ------------------
  |  |   86|  12.5M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 10.9M, False: 1.58M]
  |  |  ------------------
  ------------------
  126|  12.5M|  }
  127|       |
  128|   285k|  if (tns_select != 0) {
  ------------------
  |  Branch (128:7): [True: 142k, False: 142k]
  ------------------
  129|   142k|    if (ptr_tns_info->tns_data_present == 1) {
  ------------------
  |  Branch (129:9): [True: 98.5k, False: 44.0k]
  ------------------
  130|  98.5k|      iusace_calc_band_energy(ptr_spec_in, pstr_psy_config->sfb_offset,
  131|  98.5k|                              pstr_psy_config->sfb_active, pstr_psy_data->ptr_sfb_energy_long,
  132|  98.5k|                              pstr_psy_config->sfb_count);
  133|  98.5k|    }
  134|   142k|  }
  135|       |
  136|   285k|  iusace_find_max_spreading(pstr_psy_config->sfb_count, pstr_psy_config->sfb_mask_low_fac,
  137|   285k|                            pstr_psy_config->sfb_mask_high_fac, pstr_psy_data->ptr_sfb_thr_long);
  138|       |
  139|  12.7M|  for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (139:15): [True: 12.5M, False: 285k]
  ------------------
  140|  12.5M|    pstr_psy_data->ptr_sfb_thr_long[i] = MAX(pstr_psy_data->ptr_sfb_thr_long[i],
  ------------------
  |  |   89|  12.5M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 6.13M, False: 6.37M]
  |  |  ------------------
  ------------------
  141|  12.5M|                                             (pstr_psy_config->sfb_thr_quiet[i] * energy_shift));
  142|  12.5M|  }
  143|       |
  144|   285k|  if (pstr_psy_data->window_sequence == LONG_STOP_SEQUENCE) {
  ------------------
  |  |   48|   285k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (144:7): [True: 41.7k, False: 243k]
  ------------------
  145|  1.86M|    for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (145:17): [True: 1.82M, False: 41.7k]
  ------------------
  146|  1.82M|      pstr_psy_data->sfb_thr_nm1[i] = 1.0e20f;
  147|  1.82M|    }
  148|  41.7k|  }
  149|       |
  150|   285k|  iusace_pre_echo_control(pstr_psy_data->sfb_thr_nm1, pstr_psy_config->sfb_count,
  151|   285k|                          pstr_psy_config->max_allowed_inc_fac,
  152|   285k|                          pstr_psy_config->min_remaining_thr_fac,
  153|   285k|                          pstr_psy_data->ptr_sfb_thr_long);
  154|       |
  155|   285k|  if (pstr_psy_data->window_sequence == LONG_START_SEQUENCE) {
  ------------------
  |  |   46|   285k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (155:7): [True: 47.0k, False: 238k]
  ------------------
  156|  2.10M|    for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (156:17): [True: 2.05M, False: 47.0k]
  ------------------
  157|  2.05M|      pstr_psy_data->sfb_thr_nm1[i] = 1.0e20f;
  158|  2.05M|    }
  159|  47.0k|  }
  160|       |
  161|  12.7M|  for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (161:15): [True: 12.5M, False: 285k]
  ------------------
  162|  12.5M|    pstr_psy_data->ptr_sfb_spreaded_energy_long[i] = pstr_psy_data->ptr_sfb_energy_long[i];
  163|  12.5M|  }
  164|   285k|  iusace_find_max_spreading(
  165|   285k|      pstr_psy_config->sfb_count, pstr_psy_config->sfb_mask_low_fac_spr_ener,
  166|   285k|      pstr_psy_config->sfb_mask_high_fac_spr_ener, pstr_psy_data->ptr_sfb_spreaded_energy_long);
  167|       |
  168|  1.55M|  for (sfb = pstr_psy_config->sfb_count - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (168:46): [True: 1.53M, False: 16.7k]
  ------------------
  169|  1.53M|    for (line = pstr_psy_config->sfb_offset[sfb + 1] - 1;
  170|  47.6M|         line >= pstr_psy_config->sfb_offset[sfb]; line--) {
  ------------------
  |  Branch (170:10): [True: 46.3M, False: 1.26M]
  ------------------
  171|  46.3M|      if (ptr_spec_in[line] != 0) break;
  ------------------
  |  Branch (171:11): [True: 268k, False: 46.1M]
  ------------------
  172|  46.3M|    }
  173|  1.53M|    if (line >= pstr_psy_config->sfb_offset[sfb]) break;
  ------------------
  |  Branch (173:9): [True: 268k, False: 1.26M]
  ------------------
  174|  1.53M|  }
  175|       |
  176|   285k|  pstr_psy_mod->str_psy_out_data[i_ch].max_sfb_per_grp = sfb + 1;
  177|       |
  178|   285k|  return;
  179|   285k|}
iusace_psy_mod_sb:
  185|   142k|                       WORD32 ccfl) {
  186|   142k|  ia_psy_mod_data_struct *pstr_psy_data = &(pstr_psy_mod->str_psy_data[i_ch]);
  187|   142k|  ia_psy_mod_short_config_struct *pstr_psy_config =
  188|   142k|      &(pstr_psy_mod->str_psy_short_config[elem_idx]);
  189|   142k|  WORD32 max_sfb = 0, sfb, line;
  190|   142k|  WORD32 window_sequence = pstr_sfb_prms->window_sequence[i_ch];
  191|   142k|  WORD32 num_sfb = pstr_sfb_prms->num_sfb[i_ch];
  192|   142k|  ia_tns_info *ptr_tns_info = pstr_tns_info[i_ch];
  193|   142k|  WORD32 i, w;
  194|   142k|  WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   46|   142k|#define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   54|   142k|#define FRAME_LEN_LONG 1024
  |  |  ------------------
  |  |               #define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   44|   142k|#define TRANS_FAC 8
  |  |  ------------------
  ------------------
                WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   54|   142k|#define FRAME_LEN_LONG 1024
  ------------------
  195|   142k|  FLOAT32 energy_shift = 0.25f;
  196|   142k|  FLOAT32 clip_energy = pstr_psy_config->clip_energy * energy_shift;
  197|   142k|  (VOID) channel_type;
  198|       |
  199|   142k|  pstr_psy_data->window_sequence = window_sequence;
  200|       |
  201|  1.28M|  for (w = 0; w < MAX_SHORT_WINDOWS; w++) {
  ------------------
  |  |   52|  1.28M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (201:15): [True: 1.13M, False: 142k]
  ------------------
  202|  1.13M|    WORD32 w_offset = w * frame_len_short;
  203|  1.13M|    WORD32 offset;
  204|  1.13M|    FLOAT64 *pmdct_double = &ptr_spec_in[pstr_psy_config->low_pass_line + w_offset];
  205|       |
  206|  1.13M|    offset = frame_len_short - pstr_psy_config->low_pass_line;
  207|       |
  208|  1.13M|    memset(pmdct_double, 0, sizeof(FLOAT64) * offset);
  209|       |
  210|  1.13M|    iusace_calc_band_energy(ptr_spec_in + w_offset, pstr_psy_config->sfb_offset,
  211|  1.13M|                            pstr_psy_config->sfb_active, pstr_psy_data->sfb_energy_short[w],
  212|  1.13M|                            pstr_psy_config->sfb_count);
  213|       |
  214|  1.13M|    if (tns_select != 0) {
  ------------------
  |  Branch (214:9): [True: 531k, False: 606k]
  ------------------
  215|   531k|      ia_tns_info *ptr_tns_info_ch2 = pstr_tns_info[i_ch - chn];
  216|   531k|      ptr_tns_info->number_of_bands = num_sfb;
  217|   531k|      ptr_tns_info->block_type = window_sequence;
  218|   531k|      ptr_tns_info->spec = ptr_spec_in + w_offset;
  219|   531k|      iusace_tns_encode(ptr_tns_info_ch2, ptr_tns_info, pstr_psy_data->sfb_energy_short[w], w,
  220|   531k|                        chn, pstr_psy_config->low_pass_line, scratch_tns_filter, 0,
  221|   531k|                        ptr_tns_scratch);
  222|   531k|    }
  223|       |
  224|  16.8M|    for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (224:17): [True: 15.6M, False: 1.13M]
  ------------------
  225|  15.6M|      pstr_psy_data->sfb_thr_short[w][i] =
  226|  15.6M|          pstr_psy_data->sfb_energy_short[w][i] * pstr_psy_config->ratio;
  227|  15.6M|      pstr_psy_data->sfb_thr_short[w][i] = MIN(pstr_psy_data->sfb_thr_short[w][i], clip_energy);
  ------------------
  |  |   86|  15.6M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 12.5M, False: 3.15M]
  |  |  ------------------
  ------------------
  228|  15.6M|    }
  229|       |
  230|  1.13M|    if (tns_select != 0) {
  ------------------
  |  Branch (230:9): [True: 531k, False: 606k]
  ------------------
  231|   531k|      if (ptr_tns_info->tns_data_present == 1) {
  ------------------
  |  Branch (231:11): [True: 174k, False: 357k]
  ------------------
  232|   174k|        iusace_calc_band_energy(ptr_spec_in + w_offset, pstr_psy_config->sfb_offset,
  233|   174k|                                pstr_psy_config->sfb_active, pstr_psy_data->sfb_energy_short[w],
  234|   174k|                                pstr_psy_config->sfb_count);
  235|   174k|      }
  236|   531k|    }
  237|       |
  238|  1.13M|    iusace_find_max_spreading(pstr_psy_config->sfb_count, pstr_psy_config->sfb_mask_low_fac,
  239|  1.13M|                              pstr_psy_config->sfb_mask_high_fac,
  240|  1.13M|                              pstr_psy_data->sfb_thr_short[w]);
  241|       |
  242|  16.8M|    for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (242:17): [True: 15.6M, False: 1.13M]
  ------------------
  243|  15.6M|      pstr_psy_data->sfb_thr_short[w][i] =
  244|  15.6M|          MAX(pstr_psy_data->sfb_thr_short[w][i], (pstr_psy_config->sfb_thr_quiet[i] * 0.25f));
  ------------------
  |  |   89|  15.6M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 5.33M, False: 10.3M]
  |  |  ------------------
  ------------------
  245|  15.6M|    }
  246|       |
  247|  1.13M|    iusace_pre_echo_control(pstr_psy_data->sfb_thr_nm1, pstr_psy_config->sfb_count,
  248|  1.13M|                            pstr_psy_config->max_allowed_inc_fac,
  249|  1.13M|                            pstr_psy_config->min_remaining_thr_fac,
  250|  1.13M|                            pstr_psy_data->sfb_thr_short[w]);
  251|       |
  252|  16.8M|    for (i = 0; i < pstr_psy_config->sfb_count; i++) {
  ------------------
  |  Branch (252:17): [True: 15.6M, False: 1.13M]
  ------------------
  253|  15.6M|      pstr_psy_data->sfb_spreaded_energy_short[w][i] = pstr_psy_data->sfb_energy_short[w][i];
  254|  15.6M|    }
  255|  1.13M|    iusace_find_max_spreading(
  256|  1.13M|        pstr_psy_config->sfb_count, pstr_psy_config->sfb_mask_low_fac_spr_ener,
  257|  1.13M|        pstr_psy_config->sfb_mask_high_fac_spr_ener, pstr_psy_data->sfb_spreaded_energy_short[w]);
  258|  1.13M|  }
  259|       |
  260|  1.28M|  for (WORD32 wnd = 0; wnd < MAX_SHORT_WINDOWS; wnd++) {
  ------------------
  |  |   52|  1.28M|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (260:24): [True: 1.13M, False: 142k]
  ------------------
  261|  4.28M|    for (sfb = pstr_psy_config->sfb_count - 1; sfb >= max_sfb; sfb--) {
  ------------------
  |  Branch (261:48): [True: 4.10M, False: 181k]
  ------------------
  262|  4.10M|      for (line = pstr_psy_config->sfb_offset[sfb + 1] - 1;
  263|  39.3M|           line >= pstr_psy_config->sfb_offset[sfb]; line--) {
  ------------------
  |  Branch (263:12): [True: 36.1M, False: 3.14M]
  ------------------
  264|  36.1M|        if (ptr_spec_in[wnd * frame_len_short + line] != 0.0) break;
  ------------------
  |  Branch (264:13): [True: 957k, False: 35.2M]
  ------------------
  265|  36.1M|      }
  266|  4.10M|      if (line >= pstr_psy_config->sfb_offset[sfb]) break;
  ------------------
  |  Branch (266:11): [True: 957k, False: 3.14M]
  ------------------
  267|  4.10M|    }
  268|  1.13M|    max_sfb = MAX(max_sfb, sfb);
  ------------------
  |  |   89|  1.13M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 181k, False: 957k]
  |  |  ------------------
  ------------------
  269|  1.13M|  }
  270|   142k|  max_sfb = max_sfb > 0 ? max_sfb : 0;
  ------------------
  |  Branch (270:13): [True: 136k, False: 5.61k]
  ------------------
  271|       |
  272|   142k|  pstr_psy_mod->str_psy_out_data[i_ch].max_sfb_per_grp = max_sfb + 1;
  273|       |
  274|   142k|  return;
  275|   142k|}

iusace_calc_band_energy:
   59|  1.69M|                             const WORD32 num_bands, FLOAT32 *ptr_band_energy, WORD32 sfb_count) {
   60|  1.69M|  WORD32 i, j;
   61|       |
   62|  1.69M|  j = 0;
   63|  1.69M|  memset(ptr_band_energy, 0, sfb_count * sizeof(FLOAT32));
   64|  34.7M|  for (i = 0; i < num_bands; i++) {
  ------------------
  |  Branch (64:15): [True: 33.0M, False: 1.69M]
  ------------------
   65|   500M|    while (j < band_offset[i + 1]) {
  ------------------
  |  Branch (65:12): [True: 467M, False: 33.0M]
  ------------------
   66|   467M|      ptr_band_energy[i] += (FLOAT32)(ptr_spec_coeffs[j] * ptr_spec_coeffs[j]);
   67|   467M|      j++;
   68|   467M|    }
   69|  33.0M|  }
   70|  1.69M|  return;
   71|  1.69M|}
iusace_find_max_spreading:
   74|  2.84M|                               const FLOAT32 *ptr_mask_high_fac, FLOAT32 *ptr_spreaded_enegry) {
   75|  2.84M|  WORD32 i;
   76|       |
   77|  56.3M|  for (i = 1; i < sfb_count; i++) {
  ------------------
  |  Branch (77:15): [True: 53.5M, False: 2.84M]
  ------------------
   78|  53.5M|    ptr_spreaded_enegry[i] =
   79|  53.5M|        MAX(ptr_spreaded_enegry[i], ptr_mask_high_fac[i] * ptr_spreaded_enegry[i - 1]);
  ------------------
  |  |   89|  53.5M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 34.5M, False: 18.9M]
  |  |  ------------------
  ------------------
   80|  53.5M|  }
   81|       |
   82|  56.3M|  for (i = sfb_count - 2; i >= 0; i--) {
  ------------------
  |  Branch (82:27): [True: 53.5M, False: 2.84M]
  ------------------
   83|  53.5M|    ptr_spreaded_enegry[i] =
   84|  53.5M|        MAX(ptr_spreaded_enegry[i], ptr_mask_low_fac[i] * ptr_spreaded_enegry[i + 1]);
  ------------------
  |  |   89|  53.5M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 48.1M, False: 5.37M]
  |  |  ------------------
  ------------------
   85|  53.5M|  }
   86|  2.84M|  return;
   87|  2.84M|}
iusace_pre_echo_control:
   90|  1.42M|                             FLOAT32 min_remaining_thr_fac, FLOAT32 *ptr_threshold) {
   91|  1.42M|  WORD32 i;
   92|  1.42M|  FLOAT32 thr1, thr2;
   93|       |
   94|  29.6M|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (94:15): [True: 28.1M, False: 1.42M]
  ------------------
   95|  28.1M|    thr1 = max_allowed_inc_fac * (ptr_thr_nm1[i]);
   96|  28.1M|    thr2 = min_remaining_thr_fac * ptr_threshold[i];
   97|       |
   98|  28.1M|    ptr_thr_nm1[i] = ptr_threshold[i];
   99|       |
  100|  28.1M|    if (ptr_threshold[i] > thr1) {
  ------------------
  |  Branch (100:9): [True: 2.69M, False: 25.5M]
  ------------------
  101|  2.69M|      ptr_threshold[i] = thr1;
  102|  2.69M|    }
  103|  28.1M|    if (thr2 > ptr_threshold[i]) {
  ------------------
  |  Branch (103:9): [True: 1.34M, False: 26.8M]
  ------------------
  104|  1.34M|      ptr_threshold[i] = thr2;
  105|  1.34M|    }
  106|  28.1M|  }
  107|  1.42M|  return;
  108|  1.42M|}
iusace_psy_long_config_init:
  374|  5.77k|                                 ia_psy_mod_long_config_struct *pstr_psy_config, WORD32 ccfl) {
  375|  5.77k|  WORD32 sfb;
  376|  5.77k|  FLOAT32 sfb_bark_val[MAX_NUM_GROUPED_SFB];
  377|       |
  378|  5.77k|  iusace_sfb_init(sample_rate, ONLY_LONG_SEQUENCE, pstr_psy_config->sfb_offset,
  ------------------
  |  |   45|  5.77k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  379|  5.77k|                  &(pstr_psy_config->sfb_count), ccfl);
  380|       |
  381|  5.77k|  iusace_bark_values_init(pstr_psy_config->sfb_count, pstr_psy_config->sfb_offset,
  382|  5.77k|                          pstr_psy_config->sfb_offset[pstr_psy_config->sfb_count], sample_rate,
  383|  5.77k|                          sfb_bark_val);
  384|       |
  385|  5.77k|  iusace_thr_quiet_init(pstr_psy_config->sfb_count, pstr_psy_config->sfb_offset, sfb_bark_val,
  386|  5.77k|                        pstr_psy_config->sfb_thr_quiet);
  387|       |
  388|  5.77k|  iusace_spreading_init(
  389|  5.77k|      pstr_psy_config->sfb_count, sfb_bark_val, pstr_psy_config->sfb_mask_low_fac,
  390|  5.77k|      pstr_psy_config->sfb_mask_high_fac, pstr_psy_config->sfb_mask_low_fac_spr_ener,
  391|  5.77k|      pstr_psy_config->sfb_mask_high_fac_spr_ener, bit_rate, ONLY_LONG_SEQUENCE);
  ------------------
  |  |   45|  5.77k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  392|       |
  393|  5.77k|  pstr_psy_config->ratio = C_RATIO;
  ------------------
  |  |   33|  5.77k|#define C_RATIO (0.001258925f)
  ------------------
  394|  5.77k|  pstr_psy_config->max_allowed_inc_fac = 2.0f;
  395|  5.77k|  pstr_psy_config->min_remaining_thr_fac = 0.01f;
  396|       |
  397|  5.77k|  pstr_psy_config->clip_energy = (CLIP_ENERGY_VALUE_LONG * ccfl) / FRAME_LEN_LONG;
  ------------------
  |  |   44|  5.77k|#define CLIP_ENERGY_VALUE_LONG (1.0e9f)
  ------------------
                pstr_psy_config->clip_energy = (CLIP_ENERGY_VALUE_LONG * ccfl) / FRAME_LEN_LONG;
  ------------------
  |  |   54|  5.77k|#define FRAME_LEN_LONG 1024
  ------------------
  398|  5.77k|  pstr_psy_config->low_pass_line = (WORD32)((2 * band_width * ccfl) / sample_rate);
  399|       |
  400|   254k|  for (sfb = 0; sfb < pstr_psy_config->sfb_count; sfb++) {
  ------------------
  |  Branch (400:17): [True: 249k, False: 4.47k]
  ------------------
  401|   249k|    if (pstr_psy_config->sfb_offset[sfb] >= pstr_psy_config->low_pass_line) break;
  ------------------
  |  Branch (401:9): [True: 1.30k, False: 248k]
  ------------------
  402|   249k|  }
  403|  5.77k|  pstr_psy_config->sfb_active = sfb;
  404|       |
  405|  5.77k|  iusace_min_snr_init(bit_rate, sample_rate,
  406|  5.77k|                      pstr_psy_config->sfb_offset[pstr_psy_config->sfb_count],
  407|  5.77k|                      pstr_psy_config->sfb_offset, sfb_bark_val, pstr_psy_config->sfb_active,
  408|  5.77k|                      pstr_psy_config->sfb_min_snr);
  409|       |
  410|  5.77k|  return;
  411|  5.77k|}
iusace_psy_short_config_init:
  414|  5.77k|                                  ia_psy_mod_short_config_struct *pstr_psy_config, WORD32 ccfl) {
  415|  5.77k|  WORD32 sfb;
  416|  5.77k|  WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   46|  5.77k|#define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   54|  5.77k|#define FRAME_LEN_LONG 1024
  |  |  ------------------
  |  |               #define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   44|  5.77k|#define TRANS_FAC 8
  |  |  ------------------
  ------------------
                WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   54|  5.77k|#define FRAME_LEN_LONG 1024
  ------------------
  417|  5.77k|  FLOAT32 sfb_bark_val[MAX_NUM_GROUPED_SFB];
  418|       |
  419|  5.77k|  iusace_sfb_init(sample_rate, EIGHT_SHORT_SEQUENCE, pstr_psy_config->sfb_offset,
  ------------------
  |  |   40|  5.77k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  420|  5.77k|                  &(pstr_psy_config->sfb_count), ccfl);
  421|       |
  422|  5.77k|  iusace_bark_values_init(pstr_psy_config->sfb_count, pstr_psy_config->sfb_offset,
  423|  5.77k|                          pstr_psy_config->sfb_offset[pstr_psy_config->sfb_count], sample_rate,
  424|  5.77k|                          sfb_bark_val);
  425|       |
  426|  5.77k|  iusace_thr_quiet_init(pstr_psy_config->sfb_count, pstr_psy_config->sfb_offset, sfb_bark_val,
  427|  5.77k|                        pstr_psy_config->sfb_thr_quiet);
  428|       |
  429|  5.77k|  iusace_spreading_init(
  430|  5.77k|      pstr_psy_config->sfb_count, sfb_bark_val, pstr_psy_config->sfb_mask_low_fac,
  431|  5.77k|      pstr_psy_config->sfb_mask_high_fac, pstr_psy_config->sfb_mask_low_fac_spr_ener,
  432|  5.77k|      pstr_psy_config->sfb_mask_high_fac_spr_ener, bit_rate, EIGHT_SHORT_SEQUENCE);
  ------------------
  |  |   40|  5.77k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  433|       |
  434|  5.77k|  pstr_psy_config->ratio = C_RATIO;
  ------------------
  |  |   33|  5.77k|#define C_RATIO (0.001258925f)
  ------------------
  435|  5.77k|  pstr_psy_config->max_allowed_inc_fac = 2.0f;
  436|  5.77k|  pstr_psy_config->min_remaining_thr_fac = 0.01f;
  437|       |
  438|  5.77k|  pstr_psy_config->clip_energy =
  439|  5.77k|      (CLIP_ENERGY_VALUE_SHORT * frame_len_short) / FRAME_LEN_SHORT_128;
  ------------------
  |  |   45|  5.77k|#define CLIP_ENERGY_VALUE_SHORT (15625000.0f)
  ------------------
                    (CLIP_ENERGY_VALUE_SHORT * frame_len_short) / FRAME_LEN_SHORT_128;
  ------------------
  |  |   46|  5.77k|#define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   54|  5.77k|#define FRAME_LEN_LONG 1024
  |  |  ------------------
  |  |               #define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   44|  5.77k|#define TRANS_FAC 8
  |  |  ------------------
  ------------------
  440|  5.77k|  pstr_psy_config->low_pass_line = (WORD32)((2 * band_width * frame_len_short) / sample_rate);
  441|       |
  442|  86.1k|  for (sfb = 0; sfb < pstr_psy_config->sfb_count; sfb++) {
  ------------------
  |  Branch (442:17): [True: 81.4k, False: 4.68k]
  ------------------
  443|  81.4k|    if (pstr_psy_config->sfb_offset[sfb] >= pstr_psy_config->low_pass_line) break;
  ------------------
  |  Branch (443:9): [True: 1.09k, False: 80.3k]
  ------------------
  444|  81.4k|  }
  445|  5.77k|  pstr_psy_config->sfb_active = sfb;
  446|       |
  447|  5.77k|  iusace_min_snr_init(bit_rate, sample_rate,
  448|  5.77k|                      pstr_psy_config->sfb_offset[pstr_psy_config->sfb_count],
  449|  5.77k|                      pstr_psy_config->sfb_offset, sfb_bark_val, pstr_psy_config->sfb_active,
  450|  5.77k|                      pstr_psy_config->sfb_min_snr);
  451|       |
  452|  5.77k|  return;
  453|  5.77k|}
iusace_sfb_params_init:
  456|   566k|                                    WORD32 *num_sfb, WORD32 win_seq) {
  457|   566k|  WORD32 i, j, k;
  458|   566k|  ia_sfb_info_struct *ptr_sr_info = NULL;
  459|   566k|  WORD32 sampling_rate_mapped = 0;
  460|       |
  461|   566k|  if (frame_len == 1024) {
  ------------------
  |  Branch (461:7): [True: 418k, False: 148k]
  ------------------
  462|   418k|    ptr_sr_info = &iusace_sfb_info_1024[0];
  463|   418k|  } else {
  464|   148k|    ptr_sr_info = &iusace_sfb_info_768[0];
  465|   148k|  }
  466|       |
  467|   566k|  if (sample_rate < 0)
  ------------------
  |  Branch (467:7): [True: 0, False: 566k]
  ------------------
  468|      0|  {
  469|      0|    return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_CORE_SAMPLE_RATE;
  470|      0|  }
  471|       |
  472|   566k|  sampling_rate_mapped = iusace_map_sample_rate(sample_rate);
  473|       |
  474|  3.39M|  while (ptr_sr_info->sample_rate != sampling_rate_mapped) {
  ------------------
  |  Branch (474:10): [True: 2.82M, False: 566k]
  ------------------
  475|  2.82M|    if (ptr_sr_info->sample_rate == -1) {
  ------------------
  |  Branch (475:9): [True: 0, False: 2.82M]
  ------------------
  476|      0|      return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_CORE_SAMPLE_RATE;
  477|      0|    }
  478|  2.82M|    ptr_sr_info++;
  479|  2.82M|  }
  480|       |
  481|   566k|  j = 0;
  482|  25.2M|  for (i = 0; i < ptr_sr_info->num_sfb_long; i++) {
  ------------------
  |  Branch (482:15): [True: 24.6M, False: 566k]
  ------------------
  483|  24.6M|    k = ptr_sr_info->cb_offset_long[i];
  484|  24.6M|    ptr_sr_info->sfb_width_long[i] = k - j;
  485|  24.6M|    j = k;
  486|  24.6M|  }
  487|   566k|  j = 0;
  488|  8.56M|  for (i = 0; i < ptr_sr_info->num_sfb_short; i++) {
  ------------------
  |  Branch (488:15): [True: 7.99M, False: 566k]
  ------------------
  489|  7.99M|    k = ptr_sr_info->cb_offset_short[i];
  490|  7.99M|    ptr_sr_info->sfb_width_short[i] = k - j;
  491|  7.99M|    j = k;
  492|  7.99M|  }
  493|       |
  494|   566k|  switch (win_seq) {
  495|   142k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|   142k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (495:5): [True: 142k, False: 424k]
  ------------------
  496|   142k|      memcpy(ptr_sfb_width, ptr_sr_info->sfb_width_short, (MAX_SFB_SHORT) * sizeof(WORD32));
  ------------------
  |  |   42|   142k|#define MAX_SFB_SHORT 15
  ------------------
  497|   142k|      *num_sfb = ptr_sr_info->num_sfb_short;
  498|   142k|      break;
  499|   336k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|   336k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (499:5): [True: 336k, False: 230k]
  ------------------
  500|   382k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   46|   382k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (500:5): [True: 46.0k, False: 520k]
  ------------------
  501|   382k|    case STOP_START_SEQUENCE:
  ------------------
  |  |   49|   382k|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (501:5): [True: 0, False: 566k]
  ------------------
  502|   424k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|   424k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (502:5): [True: 41.9k, False: 524k]
  ------------------
  503|   424k|    default:
  ------------------
  |  Branch (503:5): [True: 0, False: 566k]
  ------------------
  504|   424k|      memcpy(ptr_sfb_width, ptr_sr_info->sfb_width_long, MAX_SFB_LONG * sizeof(WORD32));
  ------------------
  |  |   53|   424k|#define MAX_SFB_LONG 51
  ------------------
  505|   424k|      *num_sfb = ptr_sr_info->num_sfb_long;
  506|   424k|      break;
  507|   566k|  }
  508|       |
  509|   566k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   566k|#define IA_NO_ERROR 0x00000000
  ------------------
  510|   566k|}
iusace_psy_utils.c:iusace_sfb_init:
  111|  11.5k|                            WORD32 *ptr_sfb_count, WORD32 ccfl) {
  112|  11.5k|  const WORD16 *ptr_sfb_params = 0;
  113|  11.5k|  WORD32 start_offset, block_len = 0;
  114|  11.5k|  const ia_sfb_info_struct *pstr_sfb_info_tbls = &iusace_sfb_info_1024[0];
  115|  11.5k|  WORD32 sampling_rate_mapped = iusace_map_sample_rate(sample_rate);
  116|  11.5k|  WORD16 prev_val = 0;
  117|  11.5k|  if (ccfl == LEN_SUPERFRAME_768) {
  ------------------
  |  |   67|  11.5k|#define LEN_SUPERFRAME_768 (768)
  ------------------
  |  Branch (117:7): [True: 2.43k, False: 9.11k]
  ------------------
  118|  2.43k|    pstr_sfb_info_tbls = &iusace_sfb_info_768[0];
  119|  2.43k|  }
  120|       |
  121|       |
  122|  11.5k|  if (block_type == ONLY_LONG_SEQUENCE) {
  ------------------
  |  |   45|  11.5k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (122:7): [True: 5.77k, False: 5.77k]
  ------------------
  123|  5.77k|    block_len = ccfl;
  124|  5.77k|    switch (sampling_rate_mapped) {
  125|    346|      case 96000:
  ------------------
  |  Branch (125:7): [True: 346, False: 5.42k]
  ------------------
  126|    346|        ptr_sfb_params = pstr_sfb_info_tbls[11].cb_offset_long;
  127|    346|        break;
  128|     98|      case 88200:
  ------------------
  |  Branch (128:7): [True: 98, False: 5.67k]
  ------------------
  129|     98|        ptr_sfb_params = pstr_sfb_info_tbls[10].cb_offset_long;
  130|     98|        break;
  131|     91|      case 64000:
  ------------------
  |  Branch (131:7): [True: 91, False: 5.68k]
  ------------------
  132|     91|        ptr_sfb_params = pstr_sfb_info_tbls[9].cb_offset_long;
  133|     91|        break;
  134|    247|      case 48000:
  ------------------
  |  Branch (134:7): [True: 247, False: 5.52k]
  ------------------
  135|    247|        ptr_sfb_params = pstr_sfb_info_tbls[8].cb_offset_long;
  136|    247|        break;
  137|    243|      case 44100:
  ------------------
  |  Branch (137:7): [True: 243, False: 5.53k]
  ------------------
  138|    243|        ptr_sfb_params = pstr_sfb_info_tbls[7].cb_offset_long;
  139|    243|        break;
  140|    644|      case 32000:
  ------------------
  |  Branch (140:7): [True: 644, False: 5.13k]
  ------------------
  141|    644|      case 29400:
  ------------------
  |  Branch (141:7): [True: 0, False: 5.77k]
  ------------------
  142|    644|        ptr_sfb_params = pstr_sfb_info_tbls[6].cb_offset_long;
  143|    644|        break;
  144|  1.16k|      case 24000:
  ------------------
  |  Branch (144:7): [True: 1.16k, False: 4.61k]
  ------------------
  145|  1.16k|        ptr_sfb_params = pstr_sfb_info_tbls[5].cb_offset_long;
  146|  1.16k|        break;
  147|    434|      case 22050:
  ------------------
  |  Branch (147:7): [True: 434, False: 5.34k]
  ------------------
  148|    434|        ptr_sfb_params = pstr_sfb_info_tbls[4].cb_offset_long;
  149|    434|        break;
  150|    951|      case 16000:
  ------------------
  |  Branch (150:7): [True: 951, False: 4.82k]
  ------------------
  151|    951|      case 14700:
  ------------------
  |  Branch (151:7): [True: 0, False: 5.77k]
  ------------------
  152|    951|        ptr_sfb_params = pstr_sfb_info_tbls[3].cb_offset_long;
  153|    951|        break;
  154|    715|      case 12000:
  ------------------
  |  Branch (154:7): [True: 715, False: 5.06k]
  ------------------
  155|    715|        ptr_sfb_params = pstr_sfb_info_tbls[2].cb_offset_long;
  156|    715|        break;
  157|    296|      case 11025:
  ------------------
  |  Branch (157:7): [True: 296, False: 5.47k]
  ------------------
  158|    296|        ptr_sfb_params = pstr_sfb_info_tbls[1].cb_offset_long;
  159|    296|        break;
  160|    549|      case 8000:
  ------------------
  |  Branch (160:7): [True: 549, False: 5.22k]
  ------------------
  161|    549|        ptr_sfb_params = pstr_sfb_info_tbls[0].cb_offset_long;
  162|    549|        break;
  163|      0|      default:
  ------------------
  |  Branch (163:7): [True: 0, False: 5.77k]
  ------------------
  164|      0|        ptr_sfb_params = pstr_sfb_info_tbls[8].cb_offset_long;
  165|      0|        break;
  166|  5.77k|    }
  167|  5.77k|  } else {
  168|  5.77k|    block_len = ccfl >> 3;
  169|  5.77k|    switch (sampling_rate_mapped) {
  170|    346|      case 96000:
  ------------------
  |  Branch (170:7): [True: 346, False: 5.42k]
  ------------------
  171|    346|        ptr_sfb_params = pstr_sfb_info_tbls[11].cb_offset_short;
  172|    346|        break;
  173|     98|      case 88200:
  ------------------
  |  Branch (173:7): [True: 98, False: 5.67k]
  ------------------
  174|     98|        ptr_sfb_params = pstr_sfb_info_tbls[10].cb_offset_short;
  175|     98|        break;
  176|     91|      case 64000:
  ------------------
  |  Branch (176:7): [True: 91, False: 5.68k]
  ------------------
  177|     91|        ptr_sfb_params = pstr_sfb_info_tbls[9].cb_offset_short;
  178|     91|        break;
  179|    247|      case 48000:
  ------------------
  |  Branch (179:7): [True: 247, False: 5.52k]
  ------------------
  180|    247|        ptr_sfb_params = pstr_sfb_info_tbls[8].cb_offset_short;
  181|    247|        break;
  182|    243|      case 44100:
  ------------------
  |  Branch (182:7): [True: 243, False: 5.53k]
  ------------------
  183|    243|        ptr_sfb_params = pstr_sfb_info_tbls[7].cb_offset_short;
  184|    243|        break;
  185|    644|      case 32000:
  ------------------
  |  Branch (185:7): [True: 644, False: 5.13k]
  ------------------
  186|    644|      case 29400:
  ------------------
  |  Branch (186:7): [True: 0, False: 5.77k]
  ------------------
  187|    644|        ptr_sfb_params = pstr_sfb_info_tbls[6].cb_offset_short;
  188|    644|        break;
  189|  1.16k|      case 24000:
  ------------------
  |  Branch (189:7): [True: 1.16k, False: 4.61k]
  ------------------
  190|  1.16k|        ptr_sfb_params = pstr_sfb_info_tbls[5].cb_offset_short;
  191|  1.16k|        break;
  192|    434|      case 22050:
  ------------------
  |  Branch (192:7): [True: 434, False: 5.34k]
  ------------------
  193|    434|        ptr_sfb_params = pstr_sfb_info_tbls[4].cb_offset_short;
  194|    434|        break;
  195|    951|      case 16000:
  ------------------
  |  Branch (195:7): [True: 951, False: 4.82k]
  ------------------
  196|    951|      case 14700:
  ------------------
  |  Branch (196:7): [True: 0, False: 5.77k]
  ------------------
  197|    951|        ptr_sfb_params = pstr_sfb_info_tbls[3].cb_offset_short;
  198|    951|        break;
  199|    715|      case 12000:
  ------------------
  |  Branch (199:7): [True: 715, False: 5.06k]
  ------------------
  200|    715|        ptr_sfb_params = pstr_sfb_info_tbls[2].cb_offset_short;
  201|    715|        break;
  202|    296|      case 11025:
  ------------------
  |  Branch (202:7): [True: 296, False: 5.47k]
  ------------------
  203|    296|        ptr_sfb_params = pstr_sfb_info_tbls[1].cb_offset_short;
  204|    296|        break;
  205|    549|      case 8000:
  ------------------
  |  Branch (205:7): [True: 549, False: 5.22k]
  ------------------
  206|    549|        ptr_sfb_params = pstr_sfb_info_tbls[0].cb_offset_short;
  207|    549|        break;
  208|      0|      default:
  ------------------
  |  Branch (208:7): [True: 0, False: 5.77k]
  ------------------
  209|      0|        ptr_sfb_params = pstr_sfb_info_tbls[8].cb_offset_short;
  210|      0|        break;
  211|  5.77k|    }
  212|  5.77k|  }
  213|       |
  214|  11.5k|  *ptr_sfb_count = 0;
  215|  11.5k|  start_offset = 0;
  216|       |
  217|   337k|  do {
  218|   337k|    ptr_sfb_offset[*ptr_sfb_count] = start_offset;
  219|   337k|    if (*ptr_sfb_count == 0)
  ------------------
  |  Branch (219:9): [True: 11.5k, False: 326k]
  ------------------
  220|  11.5k|      prev_val = 0;
  221|   326k|    else
  222|   326k|      prev_val = ptr_sfb_params[*ptr_sfb_count - 1];
  223|   337k|    start_offset += ptr_sfb_params[*ptr_sfb_count] - prev_val;
  224|   337k|    (*ptr_sfb_count)++;
  225|   337k|  } while (start_offset < block_len);
  ------------------
  |  Branch (225:12): [True: 326k, False: 11.5k]
  ------------------
  226|       |
  227|  11.5k|  ptr_sfb_offset[*ptr_sfb_count] = start_offset;
  228|       |
  229|  11.5k|  return;
  230|  11.5k|}
iusace_psy_utils.c:iusace_bark_values_init:
  253|  11.5k|                                    WORD32 sample_rate, FLOAT32 *ptr_b_value) {
  254|  11.5k|  WORD32 i;
  255|  11.5k|  FLOAT32 b_val0, b_val1;
  256|  11.5k|  b_val0 = 0.0f;
  257|       |
  258|   349k|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (258:15): [True: 337k, False: 11.5k]
  ------------------
  259|   337k|    b_val1 = iusace_calc_bark_line_value(num_lines, ptr_sfb_offset[i + 1], sample_rate);
  260|   337k|    ptr_b_value[i] = (b_val0 + b_val1) * (FLOAT32)0.5f;
  261|   337k|    b_val0 = b_val1;
  262|   337k|  }
  263|  11.5k|  return;
  264|  11.5k|}
iusace_psy_utils.c:iusace_calc_bark_line_value:
  241|   337k|                                           WORD32 sample_rate) {
  242|   337k|  FLOAT32 center_freq, temp, b_value;
  243|       |
  244|   337k|  center_freq = (FLOAT32)fft_line * ((FLOAT32)sample_rate * (FLOAT32)0.5f) / (FLOAT32)num_lines;
  245|   337k|  temp = (FLOAT32)iusace_atan_approx((FLOAT32)1.3333333e-4f * center_freq);
  246|   337k|  b_value = (FLOAT32)13.3f * iusace_atan_approx((FLOAT32)0.00076f * center_freq) +
  247|   337k|            (FLOAT32)3.5f * temp * temp;
  248|       |
  249|   337k|  return (b_value);
  250|   337k|}
iusace_psy_utils.c:iusace_atan_approx:
  232|   675k|static FLOAT32 iusace_atan_approx(FLOAT32 val) {
  233|   675k|  if (val < (FLOAT32)1.0) {
  ------------------
  |  Branch (233:7): [True: 399k, False: 276k]
  ------------------
  234|   399k|    return (val / ((FLOAT32)1.0f + (FLOAT32)0.280872f * val * val));
  235|   399k|  } else {
  236|   276k|    return ((FLOAT32)1.57079633f - val / ((FLOAT32)0.280872f + val * val));
  237|   276k|  }
  238|   675k|}
iusace_psy_utils.c:iusace_thr_quiet_init:
  267|  11.5k|                                  FLOAT32 *ptr_thr_quiet) {
  268|  11.5k|  WORD32 i;
  269|  11.5k|  FLOAT32 bark_thr_quiet;
  270|       |
  271|   349k|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (271:15): [True: 337k, False: 11.5k]
  ------------------
  272|   337k|    WORD32 b_val1, b_val2;
  273|       |
  274|   337k|    if (i > 0) {
  ------------------
  |  Branch (274:9): [True: 326k, False: 11.5k]
  ------------------
  275|   326k|      b_val1 = (WORD32)(ptr_bark_val[i] + ptr_bark_val[i - 1]) >> 1;
  276|   326k|    } else {
  277|  11.5k|      b_val1 = (WORD32)(ptr_bark_val[i]) >> 1;
  278|  11.5k|    }
  279|       |
  280|   337k|    if (i < sfb_count - 1) {
  ------------------
  |  Branch (280:9): [True: 326k, False: 11.5k]
  ------------------
  281|   326k|      b_val2 = (WORD32)(ptr_bark_val[i] + ptr_bark_val[i + 1]) >> 1;
  282|   326k|    } else {
  283|  11.5k|      b_val2 = (WORD32)(ptr_bark_val[i]);
  284|  11.5k|    }
  285|   337k|    b_val1 = MIN(b_val1, (WORD32)MAX_BARK_VALUE);
  ------------------
  |  |   86|   337k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 324k, False: 13.1k]
  |  |  ------------------
  ------------------
  286|   337k|    b_val2 = MIN(b_val2, (WORD32)MAX_BARK_VALUE);
  ------------------
  |  |   86|   337k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 322k, False: 15.8k]
  |  |  ------------------
  ------------------
  287|   337k|    bark_thr_quiet = MIN(iusace_bark_quiet_thr_val[b_val1], iusace_bark_quiet_thr_val[b_val2]);
  ------------------
  |  |   86|   337k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 27.1k, False: 310k]
  |  |  ------------------
  ------------------
  288|       |
  289|   337k|    ptr_thr_quiet[i] = (FLOAT32)pow(10.0f, (bark_thr_quiet - 20.0f) * (FLOAT32)0.1f) * 16887.8f *
  290|   337k|                       (FLOAT32)(ptr_sfb_offset[i + 1] - ptr_sfb_offset[i]);
  291|   337k|  }
  292|  11.5k|  return;
  293|  11.5k|}
iusace_psy_utils.c:iusace_spreading_init:
  299|  11.5k|                                  WORD32 block_type) {
  300|  11.5k|  WORD32 i;
  301|  11.5k|  FLOAT32 mask_low_spr_energy, mask_high_spr_energy;
  302|       |
  303|  11.5k|  if (block_type != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|  11.5k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (303:7): [True: 5.77k, False: 5.77k]
  ------------------
  304|  5.77k|    mask_low_spr_energy = MASK_LOW_SP_ENERGY_L;
  ------------------
  |  |   28|  5.77k|#define MASK_LOW_SP_ENERGY_L (3.0f)
  ------------------
  305|  5.77k|    mask_high_spr_energy = (bit_rate > 22000) ? MASK_HIGH_SP_ENERGY_L : MASK_HIGH_SP_ENERGY_L_LBR;
  ------------------
  |  |   29|  5.73k|#define MASK_HIGH_SP_ENERGY_L (2.0f)
  ------------------
                  mask_high_spr_energy = (bit_rate > 22000) ? MASK_HIGH_SP_ENERGY_L : MASK_HIGH_SP_ENERGY_L_LBR;
  ------------------
  |  |   30|  5.81k|#define MASK_HIGH_SP_ENERGY_L_LBR (1.5f)
  ------------------
  |  Branch (305:28): [True: 5.73k, False: 42]
  ------------------
  306|  5.77k|  } else {
  307|  5.77k|    mask_low_spr_energy = MASK_LOW_SP_ENERGY_S;
  ------------------
  |  |   31|  5.77k|#define MASK_LOW_SP_ENERGY_S (2.0f)
  ------------------
  308|  5.77k|    mask_high_spr_energy = MASK_HIGH_SP_ENERGY_S;
  ------------------
  |  |   32|  5.77k|#define MASK_HIGH_SP_ENERGY_S (1.5f)
  ------------------
  309|  5.77k|  }
  310|       |
  311|   349k|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (311:15): [True: 337k, False: 11.5k]
  ------------------
  312|   337k|    if (i > 0) {
  ------------------
  |  Branch (312:9): [True: 326k, False: 11.5k]
  ------------------
  313|   326k|      FLOAT32 db_val;
  314|   326k|      FLOAT32 diff_val = (ptr_bark_val[i] - ptr_bark_val[i - 1]);
  315|       |
  316|   326k|      db_val = MASK_HIGH_FAC * diff_val;
  ------------------
  |  |   27|   326k|#define MASK_HIGH_FAC (1.5f)
  ------------------
  317|   326k|      ptr_mask_high_fac[i] = (FLOAT32)pow(10.0f, -db_val);
  318|   326k|      db_val = MASK_LOW_FAC * diff_val;
  ------------------
  |  |   26|   326k|#define MASK_LOW_FAC (3.0f)
  ------------------
  319|   326k|      ptr_mask_low_fac[i - 1] = (FLOAT32)pow(10.0f, -db_val);
  320|   326k|      db_val = mask_high_spr_energy * diff_val;
  321|   326k|      ptr_mask_high_fac_spr_energy[i] = (FLOAT32)pow(10.0f, -db_val);
  322|   326k|      db_val = mask_low_spr_energy * diff_val;
  323|   326k|      ptr_mask_low_fac_spr_energy[i - 1] = (FLOAT32)pow(10.0f, -db_val);
  324|   326k|    } else {
  325|  11.5k|      ptr_mask_high_fac[i] = 0.0f;
  326|  11.5k|      ptr_mask_low_fac[sfb_count - 1] = 0.0f;
  327|  11.5k|      ptr_mask_high_fac_spr_energy[i] = 0.0f;
  328|  11.5k|      ptr_mask_low_fac_spr_energy[sfb_count - 1] = 0.0f;
  329|  11.5k|    }
  330|   337k|  }
  331|  11.5k|  return;
  332|  11.5k|}
iusace_psy_utils.c:iusace_min_snr_init:
  337|  11.5k|                                FLOAT32 *ptr_sfb_min_snr) {
  338|  11.5k|  WORD32 sfb;
  339|  11.5k|  FLOAT32 bark_fac;
  340|  11.5k|  FLOAT32 bark_width;
  341|  11.5k|  FLOAT32 pe_per_window, pe_part;
  342|  11.5k|  FLOAT32 snr;
  343|  11.5k|  FLOAT32 b_val0, b_val1;
  344|       |
  345|  11.5k|  if (sfb_active == 0) {
  ------------------
  |  Branch (345:7): [True: 0, False: 11.5k]
  ------------------
  346|      0|    bark_fac = 1.0f;
  347|  11.5k|  } else {
  348|  11.5k|    bark_fac = (FLOAT32)1.0 / MIN(ptr_bark_value[sfb_active - 1] / MAX_BARK_VALUE, (FLOAT32)1.0);
  ------------------
  |  |   86|  11.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 8.93k, False: 2.61k]
  |  |  ------------------
  ------------------
  349|  11.5k|  }
  350|       |
  351|  11.5k|  pe_per_window =
  352|  11.5k|      iusace_bits_to_pe((FLOAT32)bit_rate / (FLOAT32)sample_rate * (FLOAT32)num_lines);
  353|       |
  354|  11.5k|  b_val0 = (FLOAT32)0.0f;
  355|       |
  356|   340k|  for (sfb = 0; sfb < sfb_active; sfb++) {
  ------------------
  |  Branch (356:17): [True: 328k, False: 11.5k]
  ------------------
  357|   328k|    b_val1 = (FLOAT32)2.0 * ptr_bark_value[sfb] - b_val0;
  358|   328k|    bark_width = b_val1 - b_val0;
  359|   328k|    b_val0 = b_val1;
  360|       |
  361|   328k|    pe_part = pe_per_window * (FLOAT32)0.024f * bark_fac;
  362|   328k|    pe_part *= bark_width;
  363|   328k|    pe_part /= (FLOAT32)(ptr_sfb_offset[sfb + 1] - ptr_sfb_offset[sfb]);
  364|   328k|    snr = (FLOAT32)pow(2.0f, pe_part) - 1.5f;
  365|   328k|    snr = 1.0f / MAX(snr, 1.0f);
  ------------------
  |  |   89|   328k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 219k, False: 109k]
  |  |  ------------------
  ------------------
  366|   328k|    snr = MIN(snr, 0.8f);
  ------------------
  |  |   86|   328k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 210k, False: 118k]
  |  |  ------------------
  ------------------
  367|   328k|    snr = MAX(snr, 0.003f);
  ------------------
  |  |   89|   328k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 304k, False: 23.9k]
  |  |  ------------------
  ------------------
  368|   328k|    ptr_sfb_min_snr[sfb] = snr;
  369|   328k|  }
  370|  11.5k|  return;
  371|  11.5k|}

iusace_tcx_fac_encode:
  284|   904k|                           WORD32 *params, WORD32 *n_param, WORD32 ch_idx, WORD32 k_idx) {
  285|   904k|  ia_usac_td_encoder_struct *st = usac_data->td_encoder[ch_idx];
  286|   904k|  iusace_scratch_mem *pstr_scratch = &usac_data->str_scratch;
  287|   904k|  FLOAT32 *weighted_sig = &pstr_scratch->p_wsig_buf[k_idx * st->len_subfrm];
  288|   904k|  FLOAT32 *wsynth = pstr_scratch->p_wsyn_tcx_buf;
  289|   904k|  FLOAT32 *synth = pstr_scratch->p_synth_tcx_buf;
  290|   904k|  WORD32 i, k, n, mode, i_subfr, lg, lext, index, target_bits;
  291|   904k|  FLOAT32 tmp, gain, fac_ns, energy, gain_tcx, nsfill_en_thres;
  292|   904k|  FLOAT32 *ptr_lp_flt_coeffs, lp_flt_coeffs[ORDER + 1];
  293|   904k|  const FLOAT32 *sine_window_prev, *sine_window;
  294|   904k|  FLOAT32 mem_tcx_q;
  295|   904k|  FLOAT32 *xn;
  296|   904k|  FLOAT32 *xn1 = pstr_scratch->p_xn1_tcx;
  297|   904k|  FLOAT32 *xn_buf = pstr_scratch->p_xn_buf_tcx;
  298|   904k|  FLOAT32 *x = pstr_scratch->p_x_tcx;
  299|   904k|  FLOAT32 *x_tmp = pstr_scratch->p_x_tmp_tcx;
  300|   904k|  FLOAT32 *en = pstr_scratch->p_en_tcx;
  301|   904k|  FLOAT32 sq_gain;
  302|   904k|  FLOAT32 gain_prev, gain_next;
  303|   904k|  FLOAT32 *alfd_gains = pstr_scratch->p_alfd_gains_tcx;
  304|   904k|  FLOAT32 *sq_enc = pstr_scratch->p_sq_enc_tcx;
  305|   904k|  WORD32 *sq_quant = pstr_scratch->p_sq_quant_tcx;
  306|   904k|  FLOAT32 sq_err_energy;
  307|   904k|  WORD32 max_k;
  308|   904k|  FLOAT32 *gain1 = pstr_scratch->p_gain1_tcx;
  309|   904k|  FLOAT32 *gain2 = pstr_scratch->p_gain2_tcx;
  310|   904k|  FLOAT32 *facelp = pstr_scratch->p_facelp_tcx;
  311|   904k|  FLOAT32 *xn2 = pstr_scratch->p_xn2_tcx;
  312|   904k|  FLOAT32 *fac_window = pstr_scratch->p_fac_window_tcx;
  313|   904k|  FLOAT32 *x1 = pstr_scratch->p_x1_tcx;
  314|   904k|  FLOAT32 *x2 = pstr_scratch->p_x2_tcx;
  315|   904k|  WORD32 *y = pstr_scratch->p_y_tcx;
  316|       |
  317|   904k|  WORD32 TTT;
  318|   904k|  FLOAT32 corr = 0;
  319|   904k|  WORD32 len_subfrm = st->len_subfrm;
  320|   904k|  WORD32 fac_length = len_subfrm >> 1;
  321|   904k|  WORD32 fac_len_prev, fac_len;
  322|       |
  323|   904k|  if (frame_len == 4 * st->len_subfrm) {
  ------------------
  |  Branch (323:7): [True: 129k, False: 775k]
  ------------------
  324|   129k|    if (st->last_was_short) {
  ------------------
  |  Branch (324:9): [True: 0, False: 129k]
  ------------------
  325|      0|      fac_len_prev = (st->len_frame) / 16;
  326|   129k|    } else {
  327|   129k|      fac_len_prev = st->len_subfrm / 2;
  328|   129k|    }
  329|   129k|    if (st->next_is_short) {
  ------------------
  |  Branch (329:9): [True: 0, False: 129k]
  ------------------
  330|      0|      fac_len = (st->len_frame) / 16;
  331|   129k|    } else {
  332|   129k|      fac_len = st->len_subfrm / 2;
  333|   129k|    }
  334|   775k|  } else if (frame_len == 2 * st->len_subfrm) {
  ------------------
  |  Branch (334:14): [True: 258k, False: 516k]
  ------------------
  335|   258k|    if (k_idx == 0 && st->last_was_short) {
  ------------------
  |  Branch (335:9): [True: 129k, False: 129k]
  |  Branch (335:23): [True: 0, False: 129k]
  ------------------
  336|      0|      fac_len_prev = (st->len_frame) / 16;
  337|   258k|    } else {
  338|   258k|      fac_len_prev = st->len_subfrm / 2;
  339|   258k|    }
  340|   258k|    if (k_idx == 2 && st->next_is_short) {
  ------------------
  |  Branch (340:9): [True: 129k, False: 129k]
  |  Branch (340:23): [True: 0, False: 129k]
  ------------------
  341|      0|      fac_len = (st->len_frame) / 16;
  342|   258k|    } else {
  343|   258k|      fac_len = st->len_subfrm / 2;
  344|   258k|    }
  345|   516k|  } else {
  346|   516k|    if (k_idx == 0 && st->last_was_short) {
  ------------------
  |  Branch (346:9): [True: 129k, False: 387k]
  |  Branch (346:23): [True: 0, False: 129k]
  ------------------
  347|      0|      fac_len_prev = (st->len_frame) / 16;
  348|   516k|    } else {
  349|   516k|      fac_len_prev = st->len_subfrm / 2;
  350|   516k|    }
  351|   516k|    if (k_idx == 3 && st->next_is_short) {
  ------------------
  |  Branch (351:9): [True: 129k, False: 387k]
  |  Branch (351:23): [True: 0, False: 129k]
  ------------------
  352|      0|      fac_len = (st->len_frame) / 16;
  353|   516k|    } else {
  354|   516k|      fac_len = st->len_subfrm / 2;
  355|   516k|    }
  356|   516k|  }
  357|       |
  358|   904k|  memset(xn_buf, 0, (128 + frame_len + 128) * sizeof(FLOAT32));
  359|       |
  360|   904k|  mode = frame_len / len_subfrm;
  361|       |
  362|   904k|  if (mode > 2) {
  ------------------
  |  Branch (362:7): [True: 129k, False: 775k]
  ------------------
  363|   129k|    mode = 3;
  364|   129k|  }
  365|       |
  366|   904k|  if (lpd_state->mode == 0) {
  ------------------
  |  Branch (366:7): [True: 333k, False: 570k]
  ------------------
  367|   333k|    params += fac_len_prev;
  368|   333k|  }
  369|   904k|  switch (fac_len_prev) {
  370|      0|    case 64:
  ------------------
  |  Branch (370:5): [True: 0, False: 904k]
  ------------------
  371|      0|      sine_window_prev = iusace_sin_window_128;
  372|      0|      break;
  373|   904k|    default:
  ------------------
  |  Branch (373:5): [True: 904k, False: 0]
  ------------------
  374|   904k|      sine_window_prev = iusace_sin_window_256;
  375|   904k|      break;
  376|   904k|  }
  377|   904k|  switch (fac_len) {
  378|      0|    case 64:
  ------------------
  |  Branch (378:5): [True: 0, False: 904k]
  ------------------
  379|      0|      sine_window = iusace_sin_window_128;
  380|      0|      break;
  381|   904k|    default:
  ------------------
  |  Branch (381:5): [True: 904k, False: 0]
  ------------------
  382|   904k|      sine_window = iusace_sin_window_256;
  383|   904k|      break;
  384|   904k|  }
  385|       |
  386|   904k|  lg = frame_len;
  387|   904k|  lext = fac_length;
  388|   904k|  xn = xn_buf + fac_length;
  389|       |
  390|   904k|  *n_param = lg;
  391|       |
  392|   904k|  target_bits = num_bits_per_supfrm - 10;
  393|       |
  394|   107M|  for (i = 0; i < fac_length; i++) {
  ------------------
  |  Branch (394:15): [True: 107M, False: 904k]
  ------------------
  395|   107M|    xn_buf[i] = lpd_state->tcx_mem[i + 128 - fac_length];
  396|   107M|  }
  397|       |
  398|   904k|  memcpy(xn, speech, (frame_len + fac_length) * sizeof(FLOAT32));
  399|       |
  400|   904k|  tmp = xn[-1];
  401|       |
  402|   904k|  iusace_apply_deemph(xn, TILT_FAC, frame_len, &tmp);
  ------------------
  |  |  118|   904k|#define TILT_FAC (0.68f)
  ------------------
  403|       |
  404|   904k|  memcpy(lpd_state->tcx_mem, &xn[frame_len - 128], 128 * sizeof(FLOAT32));
  405|       |
  406|   904k|  memcpy(&xn[frame_len], &speech[frame_len], lext * sizeof(FLOAT32));
  407|   904k|  iusace_apply_deemph(&xn[frame_len], TILT_FAC, lext, &tmp);
  ------------------
  |  |  118|   904k|#define TILT_FAC (0.68f)
  ------------------
  408|       |
  409|   122M|  for (i = 0; i < ORDER + fac_len_prev; i++) {
  ------------------
  |  |   71|   122M|#define ORDER (16)
  ------------------
  |  Branch (409:15): [True: 121M, False: 904k]
  ------------------
  410|   121M|    xn1[i] = xn_buf[fac_length - ORDER + i];
  ------------------
  |  |   71|   121M|#define ORDER (16)
  ------------------
  411|   121M|  }
  412|   122M|  for (i = 0; i < ORDER + fac_len; i++) {
  ------------------
  |  |   71|   122M|#define ORDER (16)
  ------------------
  |  Branch (412:15): [True: 121M, False: 904k]
  ------------------
  413|   121M|    xn2[i] = xn_buf[frame_len - ORDER + i];
  ------------------
  |  |   71|   121M|#define ORDER (16)
  ------------------
  414|   121M|  }
  415|       |
  416|   904k|  if (lpd_state->mode >= -1) {
  ------------------
  |  Branch (416:7): [True: 904k, False: 0]
  ------------------
  417|   904k|    for (i = 0; i < fac_length - fac_len_prev; i++) {
  ------------------
  |  Branch (417:17): [True: 0, False: 904k]
  ------------------
  418|      0|      xn_buf[i] = 0.0f;
  419|      0|    }
  420|   215M|    for (i = fac_length - fac_len_prev; i < (fac_length + fac_len_prev); i++) {
  ------------------
  |  Branch (420:41): [True: 214M, False: 904k]
  ------------------
  421|   214M|      xn_buf[i] *= sine_window_prev[i - fac_length + fac_len_prev];
  422|   214M|    }
  423|   215M|    for (i = 0; i < (2 * fac_len); i++) {
  ------------------
  |  Branch (423:17): [True: 214M, False: 904k]
  ------------------
  424|   214M|      xn_buf[frame_len + fac_length - fac_len + i] *= sine_window[(2 * fac_len) - 1 - i];
  425|   214M|    }
  426|   904k|    for (i = 0; i < fac_length - fac_len; i++) {
  ------------------
  |  Branch (426:17): [True: 0, False: 904k]
  ------------------
  427|      0|      xn_buf[frame_len + fac_length + fac_len + i] = 0.0f;
  428|      0|    }
  429|   904k|  }
  430|       |
  431|   904k|  iusace_tcx_mdct_main(xn_buf, x, (2 * fac_length), frame_len - (2 * fac_length),
  432|   904k|                       (2 * fac_length), pstr_scratch);
  433|       |
  434|   904k|  iusace_get_weighted_lpc(lpc_coeffs_quant + (ORDER + 1), lp_flt_coeffs);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  435|   904k|  iusace_lpc_mdct(lp_flt_coeffs, gain1, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME) << 1,
  ------------------
  |  |   82|   904k|#define FDNS_RESOLUTION (64)
  ------------------
                iusace_lpc_mdct(lp_flt_coeffs, gain1, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME) << 1,
  ------------------
  |  |   74|   904k|#define LEN_FRAME (256)
  ------------------
  436|   904k|                  pstr_scratch);
  437|       |
  438|   904k|  iusace_get_weighted_lpc(lpc_coeffs_quant + (2 * (ORDER + 1)), lp_flt_coeffs);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  439|   904k|  iusace_lpc_mdct(lp_flt_coeffs, gain2, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME) << 1,
  ------------------
  |  |   82|   904k|#define FDNS_RESOLUTION (64)
  ------------------
                iusace_lpc_mdct(lp_flt_coeffs, gain2, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME) << 1,
  ------------------
  |  |   74|   904k|#define LEN_FRAME (256)
  ------------------
  440|   904k|                  pstr_scratch);
  441|       |
  442|   904k|  iusace_pre_shaping(x, lg, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME), gain1, gain2);
  ------------------
  |  |   82|   904k|#define FDNS_RESOLUTION (64)
  ------------------
                iusace_pre_shaping(x, lg, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME), gain1, gain2);
  ------------------
  |  |   74|   904k|#define LEN_FRAME (256)
  ------------------
  443|       |
  444|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (444:15): [True: 367M, False: 904k]
  ------------------
  445|   367M|    x_tmp[i] = x[i];
  446|   367M|  }
  447|       |
  448|   904k|  iusace_adapt_lo_freq_emph(x, lg);
  449|       |
  450|   904k|  sq_gain = iusace_calc_sq_gain(x, target_bits, lg, pstr_scratch->p_sq_gain_en);
  451|       |
  452|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (452:15): [True: 367M, False: 904k]
  ------------------
  453|   367M|    sq_enc[i] = x[i] / sq_gain;
  454|       |
  455|   367M|    if (sq_enc[i] > 0.f)
  ------------------
  |  Branch (455:9): [True: 180M, False: 186M]
  ------------------
  456|   180M|      sq_quant[i] = ((WORD32)(0.5f + sq_enc[i]));
  457|   186M|    else
  458|   186M|      sq_quant[i] = ((WORD32)(-0.5f + sq_enc[i]));
  459|   367M|  }
  460|       |
  461|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (461:15): [True: 367M, False: 904k]
  ------------------
  462|   367M|    params[i + 2] = sq_quant[i];
  463|   367M|    x[i] = (FLOAT32)sq_quant[i];
  464|   367M|  }
  465|       |
  466|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (466:15): [True: 367M, False: 904k]
  ------------------
  467|   367M|    en[i] = x[i] * x[i];
  468|   367M|  }
  469|   904k|  if (mode == 3) {
  ------------------
  |  Branch (469:7): [True: 129k, False: 775k]
  ------------------
  470|   129k|    tmp = 0.9441f;
  471|   775k|  } else if (mode == 2) {
  ------------------
  |  Branch (471:14): [True: 258k, False: 516k]
  ------------------
  472|   258k|    tmp = 0.8913f;
  473|   516k|  } else {
  474|   516k|    tmp = 0.7943f;
  475|   516k|  }
  476|   904k|  energy = 0.0f;
  477|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (477:15): [True: 367M, False: 904k]
  ------------------
  478|   367M|    if (en[i] > energy) {
  ------------------
  |  Branch (478:9): [True: 44.8M, False: 322M]
  ------------------
  479|  44.8M|      energy = en[i];
  480|  44.8M|    }
  481|   367M|    en[i] = energy;
  482|   367M|    energy *= tmp;
  483|   367M|  }
  484|   904k|  energy = 0.0f;
  485|   368M|  for (i = lg - 1; i >= 0; i--) {
  ------------------
  |  Branch (485:20): [True: 367M, False: 904k]
  ------------------
  486|   367M|    if (en[i] > energy) {
  ------------------
  |  Branch (486:9): [True: 233M, False: 133M]
  ------------------
  487|   233M|      energy = en[i];
  488|   233M|    }
  489|   367M|    en[i] = energy;
  490|   367M|    energy *= tmp;
  491|   367M|  }
  492|       |
  493|   904k|  nsfill_en_thres = 0.707f;
  494|       |
  495|   904k|  tmp = 0.0625f;
  496|   904k|  k = 1;
  497|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (497:15): [True: 367M, False: 904k]
  ------------------
  498|   367M|    if (en[i] <= nsfill_en_thres) {
  ------------------
  |  Branch (498:9): [True: 205M, False: 161M]
  ------------------
  499|   205M|      tmp += sq_enc[i] * sq_enc[i];
  500|   205M|      k++;
  501|   205M|    }
  502|   367M|  }
  503|       |
  504|   904k|  iusace_adapt_lo_freq_deemph(x, lg, alfd_gains);
  505|       |
  506|   904k|  energy = 1e-6f;
  507|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (507:15): [True: 367M, False: 904k]
  ------------------
  508|   367M|    corr += x_tmp[i] * x[i];
  509|   367M|    energy += x[i] * x[i];
  510|   367M|  }
  511|   904k|  gain_tcx = (corr / energy);
  512|       |
  513|   904k|  if (gain_tcx == 0.0f) {
  ------------------
  |  Branch (513:7): [True: 36.7k, False: 867k]
  ------------------
  514|  36.7k|    gain_tcx = sq_gain;
  515|  36.7k|  }
  516|       |
  517|   904k|  energy = 0.0001f;
  518|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (518:15): [True: 367M, False: 904k]
  ------------------
  519|   367M|    tmp = x_tmp[i] - gain_tcx * x[i];
  520|   367M|    energy += tmp * tmp;
  521|   367M|  }
  522|       |
  523|   904k|  tmp = (FLOAT32)sqrt((energy * (2.0f / (FLOAT32)lg)) / (FLOAT32)lg);
  524|       |
  525|   368M|  for (i = 0; i < frame_len; i++) {
  ------------------
  |  Branch (525:15): [True: 367M, False: 904k]
  ------------------
  526|   367M|    wsynth[i] = weighted_sig[i] + tmp;
  527|   367M|  }
  528|       |
  529|   904k|  energy = 0.01f;
  530|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (530:15): [True: 367M, False: 904k]
  ------------------
  531|   367M|    energy += x[i] * x[i];
  532|   367M|  }
  533|       |
  534|   904k|  tmp = (FLOAT32)(2.0f * sqrt(energy) / (FLOAT32)lg);
  535|   904k|  gain = gain_tcx * tmp;
  536|       |
  537|   904k|  index = (WORD32)floor(0.5f + (28.0f * (FLOAT32)log10(gain)));
  538|   904k|  if (index < 0) {
  ------------------
  |  Branch (538:7): [True: 255k, False: 648k]
  ------------------
  539|   255k|    index = 0;
  540|   255k|  }
  541|   904k|  if (index > 127) {
  ------------------
  |  Branch (541:7): [True: 15.7k, False: 888k]
  ------------------
  542|  15.7k|    index = 127;
  543|  15.7k|  }
  544|   904k|  params[1] = index;
  545|       |
  546|   904k|  gain_tcx = (FLOAT32)pow(10.0f, ((FLOAT32)index) / 28.0f) / tmp;
  547|   904k|  st->gain_tcx = gain_tcx;
  548|       |
  549|   904k|  sq_err_energy = 0.f;
  550|   904k|  n = 0;
  551|  23.8M|  for (k = lg / 2; k < lg;) {
  ------------------
  |  Branch (551:20): [True: 22.9M, False: 904k]
  ------------------
  552|  22.9M|    tmp = 0.f;
  553|       |
  554|  22.9M|    max_k = MIN(lg, k + 8);
  ------------------
  |  |   86|  22.9M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 22.9M]
  |  |  ------------------
  ------------------
  555|   206M|    for (i = k; i < max_k; i++) {
  ------------------
  |  Branch (555:17): [True: 183M, False: 22.9M]
  ------------------
  556|   183M|      tmp += (FLOAT32)sq_quant[i] * sq_quant[i];
  557|   183M|    }
  558|  22.9M|    if (tmp == 0.f) {
  ------------------
  |  Branch (558:9): [True: 16.1M, False: 6.82M]
  ------------------
  559|  16.1M|      tmp = 0.f;
  560|   145M|      for (i = k; i < max_k; i++) {
  ------------------
  |  Branch (560:19): [True: 128M, False: 16.1M]
  ------------------
  561|   128M|        tmp += sq_enc[i] * sq_enc[i];
  562|   128M|      }
  563|       |
  564|  16.1M|      sq_err_energy += (FLOAT32)log10((tmp / (FLOAT64)8) + 0.000000001);
  565|  16.1M|      n += 1;
  566|  16.1M|    }
  567|  22.9M|    k = max_k;
  568|  22.9M|  }
  569|   904k|  if (n > 0) {
  ------------------
  |  Branch (569:7): [True: 886k, False: 17.7k]
  ------------------
  570|   886k|    fac_ns = (FLOAT32)pow(10., sq_err_energy / (FLOAT64)(2 * n));
  571|   886k|  } else {
  572|  17.7k|    fac_ns = 0.f;
  573|  17.7k|  }
  574|       |
  575|   904k|  tmp = 8.0f - (16.0f * fac_ns);
  576|       |
  577|   904k|  index = (WORD32)floor(tmp + 0.5);
  578|   904k|  if (index < 0) {
  ------------------
  |  Branch (578:7): [True: 0, False: 904k]
  ------------------
  579|      0|    index = 0;
  580|      0|  }
  581|   904k|  if (index > 7) {
  ------------------
  |  Branch (581:7): [True: 197k, False: 707k]
  ------------------
  582|   197k|    index = 7;
  583|   197k|  }
  584|       |
  585|   904k|  params[0] = index;
  586|       |
  587|   904k|  iusace_noise_shaping(x, lg, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME), gain1, gain2);
  ------------------
  |  |   82|   904k|#define FDNS_RESOLUTION (64)
  ------------------
                iusace_noise_shaping(x, lg, ((FDNS_RESOLUTION * len_subfrm) / LEN_FRAME), gain1, gain2);
  ------------------
  |  |   74|   904k|#define LEN_FRAME (256)
  ------------------
  588|       |
  589|   904k|  iusace_tcx_imdct(x, xn_buf, (2 * fac_length), frame_len - (2 * fac_length), (2 * fac_length),
  590|   904k|                   pstr_scratch);
  591|   582M|  for (i = 0; i < frame_len + (2 * fac_length); i++) {
  ------------------
  |  Branch (591:15): [True: 581M, False: 904k]
  ------------------
  592|   581M|    xn_buf[i] = xn_buf[i] * (2.0f / lg);
  593|   581M|  }
  594|       |
  595|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (595:15): [True: 107M, False: 904k]
  ------------------
  596|   107M|    fac_window[i] = sine_window_prev[i] * sine_window_prev[(2 * fac_len_prev) - 1 - i];
  597|   107M|    fac_window[fac_len_prev + i] =
  598|   107M|        1.0f - (sine_window_prev[fac_len_prev + i] * sine_window_prev[fac_len_prev + i]);
  599|   107M|  }
  600|       |
  601|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (601:15): [True: 107M, False: 904k]
  ------------------
  602|   107M|    xn1[ORDER + i] -= sq_gain * xn_buf[fac_length + i] * sine_window_prev[fac_len_prev + i];
  ------------------
  |  |   71|   107M|#define ORDER (16)
  ------------------
  603|   107M|  }
  604|   107M|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (604:15): [True: 107M, False: 904k]
  ------------------
  605|   107M|    xn2[ORDER + i] -= sq_gain * xn_buf[i + frame_len] * sine_window[(2 * fac_len) - 1 - i];
  ------------------
  |  |   71|   107M|#define ORDER (16)
  ------------------
  606|   107M|  }
  607|       |
  608|  15.3M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  15.3M|#define ORDER (16)
  ------------------
  |  Branch (608:15): [True: 14.4M, False: 904k]
  ------------------
  609|  14.4M|    xn1[i] -= lpd_state->tcx_quant[1 + 128 - ORDER + i];
  ------------------
  |  |   71|  14.4M|#define ORDER (16)
  ------------------
  610|  14.4M|    xn2[i] -= sq_gain * xn_buf[frame_len - ORDER + i];
  ------------------
  |  |   71|  14.4M|#define ORDER (16)
  ------------------
  611|  14.4M|  }
  612|       |
  613|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (613:15): [True: 107M, False: 904k]
  ------------------
  614|   107M|    facelp[i] = lpd_state->tcx_quant[1 + 128 + i] * fac_window[fac_len_prev + i] +
  615|   107M|                lpd_state->tcx_quant[1 + 128 - 1 - i] * fac_window[fac_len_prev - 1 - i];
  616|   107M|  }
  617|       |
  618|   904k|  energy = 0.0f;
  619|   107M|  for (i = 0; i < fac_len_prev; i++) energy += xn1[ORDER + i] * xn1[ORDER + i];
  ------------------
  |  |   71|   107M|#define ORDER (16)
  ------------------
                for (i = 0; i < fac_len_prev; i++) energy += xn1[ORDER + i] * xn1[ORDER + i];
  ------------------
  |  |   71|   107M|#define ORDER (16)
  ------------------
  |  Branch (619:15): [True: 107M, False: 904k]
  ------------------
  620|   904k|  energy *= 2.0f;
  621|   904k|  tmp = 0.0f;
  622|   107M|  for (i = 0; i < fac_len_prev; i++) tmp += facelp[i] * facelp[i];
  ------------------
  |  Branch (622:15): [True: 107M, False: 904k]
  ------------------
  623|   904k|  if (tmp > energy)
  ------------------
  |  Branch (623:7): [True: 197k, False: 706k]
  ------------------
  624|   197k|    gain = (FLOAT32)sqrt(energy / tmp);
  625|   706k|  else
  626|   706k|    gain = 1.0f;
  627|       |
  628|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (628:15): [True: 107M, False: 904k]
  ------------------
  629|   107M|    xn1[ORDER + i] -= gain * facelp[i];
  ------------------
  |  |   71|   107M|#define ORDER (16)
  ------------------
  630|   107M|  }
  631|       |
  632|   904k|  iusace_get_weighted_lpc(lpc_coeffs_quant + (ORDER + 1), lp_flt_coeffs);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  633|   904k|  iusace_compute_lp_residual(lp_flt_coeffs, xn1 + ORDER, x1, fac_len_prev);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  634|       |
  635|   904k|  iusace_get_weighted_lpc(lpc_coeffs_quant + (2 * (ORDER + 1)), lp_flt_coeffs);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  636|   904k|  iusace_compute_lp_residual(lp_flt_coeffs, xn2 + ORDER, x2, fac_len);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  637|       |
  638|   904k|  iusace_tcx_mdct(x1, x1, fac_len_prev, pstr_scratch);
  639|   904k|  iusace_tcx_mdct(x2, x2, fac_len, pstr_scratch);
  640|       |
  641|   904k|  gain_prev = (FLOAT32)(sq_gain * 0.5f * sqrt(((FLOAT32)fac_len_prev) / (FLOAT32)frame_len));
  642|   904k|  gain_next = (FLOAT32)(sq_gain * 0.5f * sqrt(((FLOAT32)fac_len) / (FLOAT32)frame_len));
  643|       |
  644|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (644:15): [True: 107M, False: 904k]
  ------------------
  645|   107M|    x1[i] /= gain_prev;
  646|   107M|  }
  647|   107M|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (647:15): [True: 107M, False: 904k]
  ------------------
  648|   107M|    x2[i] /= gain_next;
  649|   107M|  }
  650|  27.6M|  for (i = 0; i < fac_len_prev / 4; i++) {
  ------------------
  |  Branch (650:15): [True: 26.7M, False: 904k]
  ------------------
  651|  26.7M|    k = i * lg / (8 * fac_len_prev);
  652|  26.7M|    x1[i] /= alfd_gains[k];
  653|  26.7M|  }
  654|  27.6M|  for (i = 0; i < fac_len / 4; i++) {
  ------------------
  |  Branch (654:15): [True: 26.7M, False: 904k]
  ------------------
  655|  26.7M|    k = i * lg / (8 * fac_len);
  656|  26.7M|    x2[i] /= alfd_gains[k];
  657|  26.7M|  }
  658|       |
  659|  14.2M|  for (i = 0; i < fac_len; i += 8) {
  ------------------
  |  Branch (659:15): [True: 13.3M, False: 904k]
  ------------------
  660|  13.3M|    iusace_find_nearest_neighbor(&x2[i], &y[i]);
  661|  13.3M|  }
  662|   107M|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (662:15): [True: 107M, False: 904k]
  ------------------
  663|   107M|    lpd_state->avq_params[i] = y[i];
  664|   107M|    x2[i] = (FLOAT32)y[i];
  665|   107M|  }
  666|       |
  667|  14.2M|  for (i = 0; i < fac_len_prev; i += 8) {
  ------------------
  |  Branch (667:15): [True: 13.3M, False: 904k]
  ------------------
  668|  13.3M|    iusace_find_nearest_neighbor(&x1[i], &y[i]);
  669|  13.3M|  }
  670|       |
  671|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (671:15): [True: 107M, False: 904k]
  ------------------
  672|   107M|    x1[i] = (FLOAT32)y[i];
  673|   107M|  }
  674|       |
  675|   904k|  gain_prev = (FLOAT32)(gain_tcx * 0.5f * sqrt(((FLOAT32)fac_len_prev) / (FLOAT32)frame_len));
  676|   904k|  gain_next = (FLOAT32)(gain_tcx * 0.5f * sqrt(((FLOAT32)fac_len) / (FLOAT32)frame_len));
  677|       |
  678|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (678:15): [True: 107M, False: 904k]
  ------------------
  679|   107M|    x1[i] *= gain_prev;
  680|   107M|  }
  681|   107M|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (681:15): [True: 107M, False: 904k]
  ------------------
  682|   107M|    x2[i] *= gain_next;
  683|   107M|  }
  684|  27.6M|  for (i = 0; i<fac_len_prev>> 2; i++) {
  ------------------
  |  Branch (684:15): [True: 26.7M, False: 904k]
  ------------------
  685|  26.7M|    k = i * lg / (fac_len_prev << 3);
  686|  26.7M|    x1[i] *= alfd_gains[k];
  687|  26.7M|  }
  688|  27.6M|  for (i = 0; i<fac_len>> 2; i++) {
  ------------------
  |  Branch (688:15): [True: 26.7M, False: 904k]
  ------------------
  689|  26.7M|    k = i * lg / (fac_len << 3);
  690|  26.7M|    x2[i] *= alfd_gains[k];
  691|  26.7M|  }
  692|   904k|  iusace_tcx_mdct(x1, xn1, fac_len_prev, pstr_scratch);
  693|   904k|  iusace_tcx_mdct(x2, xn2, fac_len, pstr_scratch);
  694|       |
  695|   904k|  FLOAT32 coeff1 = (2.0f / (FLOAT32)fac_len_prev), coeff2 = (2.0f / (FLOAT32)fac_len);
  696|       |
  697|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (697:15): [True: 107M, False: 904k]
  ------------------
  698|   107M|    xn1[i] = xn1[i] * coeff1;
  699|   107M|  }
  700|       |
  701|   107M|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (701:15): [True: 107M, False: 904k]
  ------------------
  702|   107M|    xn2[i] = xn2[i] * coeff2;
  703|   107M|  }
  704|       |
  705|   904k|  memset(xn1 + fac_len_prev, 0, fac_len_prev * sizeof(FLOAT32));
  706|   904k|  memset(xn2 + fac_len, 0, fac_len * sizeof(FLOAT32));
  707|       |
  708|   904k|  iusace_get_weighted_lpc(lpc_coeffs_quant + (ORDER + 1), lp_flt_coeffs);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  709|   904k|  iusace_synthesis_tool_float(lp_flt_coeffs, xn1, xn1, 2 * fac_len_prev, xn1 + fac_len_prev,
  710|   904k|                              pstr_scratch->p_buf_synthesis_tool);
  711|       |
  712|   904k|  iusace_get_weighted_lpc(lpc_coeffs_quant + (2 * (ORDER + 1)), lp_flt_coeffs);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  713|   904k|  iusace_synthesis_tool_float(lp_flt_coeffs, xn2, xn2, fac_len, xn2 + fac_len,
  714|   904k|                              pstr_scratch->p_buf_synthesis_tool);
  715|       |
  716|   107M|  for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (716:15): [True: 107M, False: 904k]
  ------------------
  717|   107M|    xn1[i] += facelp[i];
  718|   107M|  }
  719|       |
  720|   582M|  for (i = 0; i < frame_len + (fac_length << 1); i++) {
  ------------------
  |  Branch (720:15): [True: 581M, False: 904k]
  ------------------
  721|   581M|    xn_buf[i] *= gain_tcx;
  722|   581M|  }
  723|       |
  724|   904k|  if (lpd_state->mode >= -1) {
  ------------------
  |  Branch (724:7): [True: 904k, False: 0]
  ------------------
  725|   215M|    for (i = 0; i < (2 * fac_len_prev); i++) {
  ------------------
  |  Branch (725:17): [True: 214M, False: 904k]
  ------------------
  726|   214M|      xn_buf[i + fac_length - fac_len_prev] *= sine_window_prev[i];
  727|   214M|    }
  728|   904k|    for (i = 0; i < fac_length - fac_len_prev; i++) {
  ------------------
  |  Branch (728:17): [True: 0, False: 904k]
  ------------------
  729|      0|      xn_buf[i] = 0.0f;
  730|      0|    }
  731|   904k|  }
  732|   215M|  for (i = 0; i < (2 * fac_len); i++) {
  ------------------
  |  Branch (732:15): [True: 214M, False: 904k]
  ------------------
  733|   214M|    xn_buf[i + frame_len + fac_length - fac_len] *= sine_window[(2 * fac_len) - 1 - i];
  734|   214M|  }
  735|   904k|  for (i = 0; i < fac_length - fac_len; i++) {
  ------------------
  |  Branch (735:15): [True: 0, False: 904k]
  ------------------
  736|      0|    xn_buf[i + frame_len + fac_length + fac_len] = 0.0f;
  737|      0|  }
  738|       |
  739|   904k|  if (lpd_state->mode != 0) {
  ------------------
  |  Branch (739:7): [True: 570k, False: 333k]
  ------------------
  740|   136M|    for (i = 0; i < (2 * fac_length); i++) {
  ------------------
  |  Branch (740:17): [True: 136M, False: 570k]
  ------------------
  741|   136M|      xn_buf[i] += lpd_state->tcx_quant[1 + 128 - fac_length + i];
  742|   136M|    }
  743|       |
  744|   570k|    mem_tcx_q = lpd_state->tcx_quant[128 - fac_length];
  745|   570k|  } else {
  746|  39.3M|    for (i = 0; i < fac_len_prev; i++) {
  ------------------
  |  Branch (746:17): [True: 39.0M, False: 333k]
  ------------------
  747|  39.0M|      params[i - fac_len_prev] = y[i];
  748|  39.0M|    }
  749|       |
  750|  78.3M|    for (i = 0; i < (2 * fac_len_prev); i++) {
  ------------------
  |  Branch (750:17): [True: 78.0M, False: 333k]
  ------------------
  751|  78.0M|      xn_buf[i + fac_length] += xn1[i];
  752|  78.0M|    }
  753|   333k|    mem_tcx_q = lpd_state->tcx_quant[128];
  754|   333k|  }
  755|       |
  756|   904k|  memcpy(lpd_state->tcx_quant, xn_buf + frame_len + fac_length - 128 - 1,
  757|   904k|         (1 + 256) * sizeof(FLOAT32));
  758|       |
  759|   107M|  for (i = 0; i < fac_len; i++) {
  ------------------
  |  Branch (759:15): [True: 107M, False: 904k]
  ------------------
  760|   107M|    xn_buf[i + frame_len + (fac_length - fac_len)] += xn2[i];
  761|   107M|  }
  762|       |
  763|   904k|  if (lpd_state->mode > 0) {
  ------------------
  |  Branch (763:7): [True: 558k, False: 345k]
  ------------------
  764|   558k|    iusace_apply_preemph(xn_buf, TILT_FAC, fac_length, &mem_tcx_q);
  ------------------
  |  |  118|   558k|#define TILT_FAC (0.68f)
  ------------------
  765|       |
  766|   558k|    ptr_lp_flt_coeffs = lpd_state->lpc_coeffs_quant;
  767|       |
  768|   558k|    TTT = fac_length % LEN_SUBFR;
  ------------------
  |  |   77|   558k|#define LEN_SUBFR (64)
  ------------------
  769|   558k|    if (TTT != 0) {
  ------------------
  |  Branch (769:9): [True: 153k, False: 405k]
  ------------------
  770|   153k|      memcpy(&(lpd_state->synth[ORDER + 128 - fac_length]), &xn_buf[0], TTT * sizeof(FLOAT32));
  ------------------
  |  |   71|   153k|#define ORDER (16)
  ------------------
  771|   153k|      iusace_compute_lp_residual(ptr_lp_flt_coeffs, &(lpd_state->synth[ORDER + 128 - fac_length]),
  ------------------
  |  |   71|   153k|#define ORDER (16)
  ------------------
  772|   153k|                                 &(lpd_state->acelp_exc[(2 * len_subfrm) - fac_length]), TTT);
  773|       |
  774|   153k|      ptr_lp_flt_coeffs += (ORDER + 1);
  ------------------
  |  |   71|   153k|#define ORDER (16)
  ------------------
  775|   153k|    }
  776|       |
  777|  1.52M|    for (i_subfr = TTT; i_subfr < fac_length; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|   964k|#define LEN_SUBFR (64)
  ------------------
  |  Branch (777:25): [True: 964k, False: 558k]
  ------------------
  778|   964k|      memcpy(&(lpd_state->synth[ORDER + 128 - fac_length + i_subfr]), &xn_buf[i_subfr],
  ------------------
  |  |   71|   964k|#define ORDER (16)
  ------------------
  779|   964k|             LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|   964k|#define LEN_SUBFR (64)
  ------------------
  780|   964k|      iusace_compute_lp_residual(
  781|   964k|          ptr_lp_flt_coeffs, &(lpd_state->synth[ORDER + 128 - fac_length + i_subfr]),
  ------------------
  |  |   71|   964k|#define ORDER (16)
  ------------------
  782|   964k|          &(lpd_state->acelp_exc[(2 * len_subfrm) - fac_length + i_subfr]), LEN_SUBFR);
  ------------------
  |  |   77|   964k|#define LEN_SUBFR (64)
  ------------------
  783|   964k|      ptr_lp_flt_coeffs += (ORDER + 1);
  ------------------
  |  |   71|   964k|#define ORDER (16)
  ------------------
  784|   964k|    }
  785|       |
  786|   558k|    ptr_lp_flt_coeffs = lpd_state->lpc_coeffs;
  787|  1.67M|    for (i_subfr = 0; i_subfr < fac_length; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (787:23): [True: 1.11M, False: 558k]
  ------------------
  788|  1.11M|      iusace_get_weighted_lpc(ptr_lp_flt_coeffs, lp_flt_coeffs);
  789|  1.11M|      iusace_compute_lp_residual(lp_flt_coeffs,
  790|  1.11M|                                 &(lpd_state->synth[ORDER + 128 - fac_length + i_subfr]),
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
  791|  1.11M|                                 &(lpd_state->wsynth[1 + 128 - fac_length + i_subfr]), LEN_SUBFR);
  ------------------
  |  |   77|  1.11M|#define LEN_SUBFR (64)
  ------------------
  792|  1.11M|      ptr_lp_flt_coeffs += (ORDER + 1);
  ------------------
  |  |   71|  1.11M|#define ORDER (16)
  ------------------
  793|  1.11M|    }
  794|   558k|    tmp = lpd_state->wsynth[0 + 128 - fac_length];
  795|   558k|    iusace_apply_deemph(&(lpd_state->wsynth[1 + 128 - fac_length]), TILT_FAC, fac_length, &tmp);
  ------------------
  |  |  118|   558k|#define TILT_FAC (0.68f)
  ------------------
  796|   558k|  }
  797|       |
  798|   904k|  k = ((frame_len / LEN_SUBFR) - 2) * (ORDER + 1);
  ------------------
  |  |   77|   904k|#define LEN_SUBFR (64)
  ------------------
                k = ((frame_len / LEN_SUBFR) - 2) * (ORDER + 1);
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  799|   904k|  memcpy(lpd_state->lpc_coeffs, lpc_coeffs + k, 2 * (ORDER + 1) * sizeof(FLOAT32));
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  800|       |
  801|   904k|  memcpy(lpd_state->lpc_coeffs_quant, lpc_coeffs_quant + (2 * (ORDER + 1)),
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  802|   904k|         (ORDER + 1) * sizeof(FLOAT32));
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  803|   904k|  memcpy(lpd_state->lpc_coeffs_quant + (ORDER + 1), lpd_state->lpc_coeffs_quant,
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  804|   904k|         (ORDER + 1) * sizeof(FLOAT32));
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  805|       |
  806|   904k|  memcpy(synth - 128, &(lpd_state->synth[ORDER]), 128 * sizeof(FLOAT32));
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  807|   904k|  lpd_state->tcx_fac = xn[frame_len - 1];
  808|       |
  809|   904k|  iusace_apply_preemph(xn, TILT_FAC, frame_len, &mem_tcx_q);
  ------------------
  |  |  118|   904k|#define TILT_FAC (0.68f)
  ------------------
  810|  6.64M|  for (i_subfr = 0; i_subfr < frame_len; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  5.73M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (810:21): [True: 5.73M, False: 904k]
  ------------------
  811|  5.73M|    memcpy(&synth[i_subfr], &xn[i_subfr], LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  5.73M|#define LEN_SUBFR (64)
  ------------------
  812|  5.73M|    iusace_compute_lp_residual(lpc_coeffs_quant + (2 * (ORDER + 1)), &synth[i_subfr],
  ------------------
  |  |   71|  5.73M|#define ORDER (16)
  ------------------
  813|  5.73M|                               &xn[i_subfr], LEN_SUBFR);
  ------------------
  |  |   77|  5.73M|#define LEN_SUBFR (64)
  ------------------
  814|  5.73M|  }
  815|   904k|  memcpy(lpd_state->synth, synth + frame_len - (ORDER + 128), (ORDER + 128) * sizeof(FLOAT32));
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
                memcpy(lpd_state->synth, synth + frame_len - (ORDER + 128), (ORDER + 128) * sizeof(FLOAT32));
  ------------------
  |  |   71|   904k|#define ORDER (16)
  ------------------
  816|       |
  817|   904k|  if (frame_len == len_subfrm) {
  ------------------
  |  Branch (817:7): [True: 516k, False: 387k]
  ------------------
  818|   516k|    memcpy(x, lpd_state->acelp_exc + len_subfrm, len_subfrm * sizeof(FLOAT32));
  819|   516k|    memcpy(lpd_state->acelp_exc, x, len_subfrm * sizeof(FLOAT32));
  820|   516k|    memcpy(lpd_state->acelp_exc + len_subfrm, xn, len_subfrm * sizeof(FLOAT32));
  821|   516k|  } else {
  822|   387k|    memcpy(lpd_state->acelp_exc, xn + frame_len - (2 * len_subfrm),
  823|   387k|           2 * len_subfrm * sizeof(FLOAT32));
  824|   387k|  }
  825|       |
  826|   904k|  memcpy(wsynth - 128, &(lpd_state->wsynth[1]), 128 * sizeof(FLOAT32));
  827|       |
  828|   904k|  ptr_lp_flt_coeffs = lpc_coeffs;
  829|  6.64M|  for (i_subfr = 0; i_subfr < frame_len; i_subfr += LEN_SUBFR) {
  ------------------
  |  |   77|  5.73M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (829:21): [True: 5.73M, False: 904k]
  ------------------
  830|  5.73M|    iusace_get_weighted_lpc(ptr_lp_flt_coeffs, lp_flt_coeffs);
  831|  5.73M|    iusace_compute_lp_residual(lp_flt_coeffs, &synth[i_subfr], &wsynth[i_subfr], LEN_SUBFR);
  ------------------
  |  |   77|  5.73M|#define LEN_SUBFR (64)
  ------------------
  832|  5.73M|    ptr_lp_flt_coeffs += (ORDER + 1);
  ------------------
  |  |   71|  5.73M|#define ORDER (16)
  ------------------
  833|  5.73M|  }
  834|   904k|  tmp = wsynth[-1];
  835|   904k|  iusace_apply_deemph(wsynth, TILT_FAC, frame_len, &tmp);
  ------------------
  |  |  118|   904k|#define TILT_FAC (0.68f)
  ------------------
  836|       |
  837|   904k|  memcpy(lpd_state->wsynth, wsynth + frame_len - (1 + 128), (1 + 128) * sizeof(FLOAT32));
  838|       |
  839|   904k|  lpd_state->mode = mode;
  840|       |
  841|   904k|  lpd_state->num_bits = 10 + target_bits;
  842|       |
  843|   904k|  return;
  844|   904k|}
iusace_tcx_enc.c:iusace_lpc_mdct:
  114|  1.80M|                            iusace_scratch_mem *pstr_scratch) {
  115|  1.80M|  FLOAT32 *in_out = pstr_scratch->p_in_out_tcx;
  116|  1.80M|  WORD32 i;
  117|       |
  118|  32.5M|  for (i = 0; i < ORDER + 1; i++) {
  ------------------
  |  |   71|  32.5M|#define ORDER (16)
  ------------------
  |  Branch (118:15): [True: 30.7M, False: 1.80M]
  ------------------
  119|  30.7M|    in_out[2 * i] = (FLOAT32)(ptr_lpc_coeffs[i] * iusace_lpc_pre_twid_cos[i]);
  120|  30.7M|    in_out[2 * i + 1] = (FLOAT32)(-ptr_lpc_coeffs[i] * iusace_lpc_pre_twid_sin[i]);
  121|  30.7M|  }
  122|   185M|  for (; i < length; i++) {
  ------------------
  |  Branch (122:10): [True: 183M, False: 1.80M]
  ------------------
  123|   183M|    in_out[2 * i] = 0.f;
  124|   183M|    in_out[2 * i + 1] = 0.f;
  125|   183M|  }
  126|       |
  127|  1.80M|  iusace_complex_fft(in_out, length, pstr_scratch);
  128|       |
  129|   108M|  for (i = 0; i<length>> 1; i++) {
  ------------------
  |  Branch (129:15): [True: 107M, False: 1.80M]
  ------------------
  130|   107M|    mdct_gains[i] = (FLOAT32)(
  131|   107M|        1.0f / sqrt(in_out[2 * i] * in_out[2 * i] + in_out[2 * i + 1] * in_out[2 * i + 1]));
  132|   107M|  }
  133|       |
  134|  1.80M|  return;
  135|  1.80M|}
iusace_tcx_enc.c:iusace_pre_shaping:
  185|   904k|static VOID iusace_pre_shaping(FLOAT32 *rr, WORD32 lg, WORD32 M, FLOAT32 *gain1, FLOAT32 *gain2) {
  186|   904k|  WORD32 i, k;
  187|   904k|  FLOAT32 r, r_prev, g1, g2, a = 0, b = 0;
  188|       |
  189|   904k|  k = lg / M;
  190|       |
  191|   904k|  r_prev = 0;
  192|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (192:15): [True: 367M, False: 904k]
  ------------------
  193|   367M|    if ((i % k) == 0) {
  ------------------
  |  Branch (193:9): [True: 53.5M, False: 313M]
  ------------------
  194|  53.5M|      g1 = gain1[i / k];
  195|  53.5M|      g2 = gain2[i / k];
  196|       |
  197|  53.5M|      a = (g1 + g2) / (2.0f * g1 * g2);
  198|  53.5M|      b = (g1 - g2) / (2.0f * g1 * g2);
  199|  53.5M|    }
  200|       |
  201|   367M|    r = a * rr[i] + b * r_prev;
  202|       |
  203|   367M|    r_prev = rr[i];
  204|   367M|    rr[i] = r;
  205|   367M|  }
  206|       |
  207|   904k|  return;
  208|   904k|}
iusace_tcx_enc.c:iusace_adapt_lo_freq_emph:
  210|   904k|static VOID iusace_adapt_lo_freq_emph(FLOAT32 *signal, WORD32 length) {
  211|   904k|  WORD32 i, j, i_max;
  212|   904k|  FLOAT32 max_energy, factor, temp;
  213|       |
  214|   904k|  i_max = length >> 2;
  215|       |
  216|   904k|  max_energy = 0.01f;
  217|  12.3M|  for (i = 0; i < i_max; i += 8) {
  ------------------
  |  Branch (217:15): [True: 11.4M, False: 904k]
  ------------------
  218|  11.4M|    temp = 0.01f;
  219|   103M|    for (j = i; j < i + 8; j++) {
  ------------------
  |  Branch (219:17): [True: 91.7M, False: 11.4M]
  ------------------
  220|  91.7M|      temp += signal[j] * signal[j];
  221|  91.7M|    }
  222|  11.4M|    if (temp > max_energy) {
  ------------------
  |  Branch (222:9): [True: 1.17M, False: 10.2M]
  ------------------
  223|  1.17M|      max_energy = temp;
  224|  1.17M|    }
  225|  11.4M|  }
  226|       |
  227|   904k|  factor = 10.0f;
  228|  12.3M|  for (i = 0; i < i_max; i += 8) {
  ------------------
  |  Branch (228:15): [True: 11.4M, False: 904k]
  ------------------
  229|  11.4M|    temp = 0.01f;
  230|   103M|    for (j = i; j < i + 8; j++) {
  ------------------
  |  Branch (230:17): [True: 91.7M, False: 11.4M]
  ------------------
  231|  91.7M|      temp += signal[j] * signal[j];
  232|  91.7M|    }
  233|  11.4M|    temp = (FLOAT32)sqrt(sqrt(max_energy / temp));
  234|  11.4M|    if (temp < factor) {
  ------------------
  |  Branch (234:9): [True: 1.19M, False: 10.2M]
  ------------------
  235|  1.19M|      factor = temp;
  236|  1.19M|    }
  237|   103M|    for (j = i; j < i + 8; j++) {
  ------------------
  |  Branch (237:17): [True: 91.7M, False: 11.4M]
  ------------------
  238|  91.7M|      signal[j] *= factor;
  239|  91.7M|    }
  240|  11.4M|  }
  241|   904k|  return;
  242|   904k|}
iusace_tcx_enc.c:iusace_adapt_lo_freq_deemph:
  244|   904k|static VOID iusace_adapt_lo_freq_deemph(FLOAT32 *signal, WORD32 length, FLOAT32 *gains) {
  245|   904k|  WORD32 i, j, i_max;
  246|   904k|  FLOAT32 max_energy, factor, energy, rm;
  247|       |
  248|   904k|  i_max = length >> 2;
  249|       |
  250|   904k|  max_energy = 0.01f;
  251|  12.3M|  for (i = 0; i < i_max; i += 8) {
  ------------------
  |  Branch (251:15): [True: 11.4M, False: 904k]
  ------------------
  252|  11.4M|    energy = 0.01f;
  253|   103M|    for (j = i; j < i + 8; j++) {
  ------------------
  |  Branch (253:17): [True: 91.7M, False: 11.4M]
  ------------------
  254|  91.7M|      energy += signal[j] * signal[j];
  255|  91.7M|    }
  256|  11.4M|    if (energy > max_energy) {
  ------------------
  |  Branch (256:9): [True: 1.07M, False: 10.3M]
  ------------------
  257|  1.07M|      max_energy = energy;
  258|  1.07M|    }
  259|  11.4M|  }
  260|       |
  261|   904k|  factor = 0.1f;
  262|  12.3M|  for (i = 0; i < i_max; i += 8) {
  ------------------
  |  Branch (262:15): [True: 11.4M, False: 904k]
  ------------------
  263|  11.4M|    energy = 0.01f;
  264|   103M|    for (j = i; j < i + 8; j++) {
  ------------------
  |  Branch (264:17): [True: 91.7M, False: 11.4M]
  ------------------
  265|  91.7M|      energy += signal[j] * signal[j];
  266|  91.7M|    }
  267|       |
  268|  11.4M|    rm = (FLOAT32)sqrt(energy / max_energy);
  269|  11.4M|    if (rm > factor) {
  ------------------
  |  Branch (269:9): [True: 1.11M, False: 10.3M]
  ------------------
  270|  1.11M|      factor = rm;
  271|  1.11M|    }
  272|   103M|    for (j = i; j < i + 8; j++) {
  ------------------
  |  Branch (272:17): [True: 91.7M, False: 11.4M]
  ------------------
  273|  91.7M|      signal[j] *= factor;
  274|  91.7M|    }
  275|  11.4M|    gains[i / 8] = factor;
  276|  11.4M|  }
  277|       |
  278|   904k|  return;
  279|   904k|}
iusace_tcx_enc.c:iusace_noise_shaping:
  161|   904k|                                 FLOAT32 *gain2) {
  162|   904k|  WORD32 i, k;
  163|   904k|  FLOAT32 r, r_prev, g1, g2, a = 0, b = 0;
  164|       |
  165|   904k|  k = lg/M;
  166|       |
  167|   904k|  r_prev = 0;
  168|   368M|  for (i = 0; i < lg; i++) {
  ------------------
  |  Branch (168:15): [True: 367M, False: 904k]
  ------------------
  169|   367M|    if ((i % k) == 0) {
  ------------------
  |  Branch (169:9): [True: 53.5M, False: 313M]
  ------------------
  170|  53.5M|      g1 = gain1[i / k];
  171|  53.5M|      g2 = gain2[i / k];
  172|  53.5M|      a = 2.0f * g1 * g2 / (g1 + g2);
  173|  53.5M|      b = (g2 - g1) / (g1 + g2);
  174|  53.5M|    }
  175|       |
  176|   367M|    r = a * rr[i] + b * r_prev;
  177|       |
  178|   367M|    rr[i] = r;
  179|   367M|    r_prev = r;
  180|   367M|  }
  181|       |
  182|   904k|  return;
  183|   904k|}

iusace_tcx_mdct_main:
   45|   904k|                          iusace_scratch_mem *pstr_scratch) {
   46|   904k|  WORD32 length = l / 2 + m + r / 2;
   47|   904k|  FLOAT32 *input = pstr_scratch->p_tcx_input;
   48|   904k|  WORD32 i;
   49|       |
   50|  77.3M|  for (i = 0; i < m / 2; i++) {
  ------------------
  |  Branch (50:15): [True: 76.4M, False: 904k]
  ------------------
   51|  76.4M|    input[m / 2 + r / 2 + i] = -ptr_in[l + m / 2 - 1 - i];
   52|  76.4M|  }
   53|   107M|  for (i = 0; i < l / 2; i++) {
  ------------------
  |  Branch (53:15): [True: 107M, False: 904k]
  ------------------
   54|   107M|    input[m / 2 + r / 2 + m / 2 + i] = ptr_in[i] - ptr_in[l - 1 - i];
   55|   107M|  }
   56|  77.3M|  for (i = 0; i < m / 2; i++) {
  ------------------
  |  Branch (56:15): [True: 76.4M, False: 904k]
  ------------------
   57|  76.4M|    input[m / 2 + r / 2 - 1 - i] = -ptr_in[l + m / 2 + i];
   58|  76.4M|  }
   59|   107M|  for (i = 0; i < r / 2; i++) {
  ------------------
  |  Branch (59:15): [True: 107M, False: 904k]
  ------------------
   60|   107M|    input[m / 2 + r / 2 - 1 - m / 2 - i] = -ptr_in[l + m + i] - ptr_in[l + m + r - 1 - i];
   61|   107M|  }
   62|       |
   63|   904k|  iusace_tcx_mdct(input, ptr_out, length, pstr_scratch);
   64|       |
   65|   904k|  return;
   66|   904k|}
iusace_tcx_imdct:
   69|   904k|                      iusace_scratch_mem *pstr_scratch) {
   70|   904k|  WORD32 length = l / 2 + m + r / 2;
   71|   904k|  FLOAT32 *output = pstr_scratch->p_tcx_output;
   72|   904k|  iusace_tcx_mdct(ptr_in, output, length, pstr_scratch);
   73|       |
   74|   904k|  WORD32 i;
   75|       |
   76|  77.3M|  for (i = 0; i < m / 2; i++) {
  ------------------
  |  Branch (76:15): [True: 76.4M, False: 904k]
  ------------------
   77|  76.4M|    ptr_out[l + m / 2 - 1 - i] = -1.0f * output[m / 2 + r / 2 + i];
   78|  76.4M|  }
   79|   107M|  for (i = 0; i < l / 2; i++) {
  ------------------
  |  Branch (79:15): [True: 107M, False: 904k]
  ------------------
   80|   107M|    ptr_out[i] = output[m / 2 + r / 2 + m / 2 + i];
   81|   107M|    ptr_out[l - 1 - i] = -1.0f * output[m / 2 + r / 2 + m / 2 + i];
   82|   107M|  }
   83|  77.3M|  for (i = 0; i < m / 2; i++) {
  ------------------
  |  Branch (83:15): [True: 76.4M, False: 904k]
  ------------------
   84|  76.4M|    ptr_out[l + m / 2 + i] = -1.0f * output[m / 2 + r / 2 - 1 - i];
   85|  76.4M|  }
   86|   107M|  for (i = 0; i < r / 2; i++) {
  ------------------
  |  Branch (86:15): [True: 107M, False: 904k]
  ------------------
   87|   107M|    ptr_out[l + m + i] = -1.0f * output[m / 2 + r / 2 - 1 - m / 2 - i];
   88|   107M|    ptr_out[l + m + r - 1 - i] = -1.0f * output[m / 2 + r / 2 - 1 - m / 2 - i];
   89|   107M|  }
   90|   904k|  return;
   91|   904k|}
iusace_tcx_mdct:
  157|  5.43M|                     iusace_scratch_mem *pstr_scratch) {
  158|  5.43M|  FLOAT32 *ptr_pre_twid_re, *ptr_pre_twid_im;
  159|  5.43M|  FLOAT32 *ptr_post_twid_re, *ptr_post_twid_im;
  160|  5.43M|  WORD32 i;
  161|  5.43M|  FLOAT32 *ptr_real = pstr_scratch->p_temp_mdct;
  162|  5.43M|  WORD32 len_by_2 = length >> 1;
  163|       |
  164|  5.43M|  iusace_get_pre_post_twid(&ptr_pre_twid_re, &ptr_pre_twid_im, &ptr_post_twid_re,
  165|  5.43M|                           &ptr_post_twid_im, length);
  166|       |
  167|   587M|  for (i = 0; i < len_by_2; i++) {
  ------------------
  |  Branch (167:15): [True: 581M, False: 5.43M]
  ------------------
  168|   581M|    ptr_real[2 * i] = ptr_in[2 * i];
  169|   581M|    ptr_real[2 * i + 1] = ptr_in[length - 1 - 2 * i];
  170|   581M|  }
  171|       |
  172|       |  /* pre twiddle */
  173|  5.43M|  iusace_pre_twid(ptr_pre_twid_re, ptr_pre_twid_im, ptr_real, len_by_2);
  174|       |
  175|  5.43M|  iusace_complex_fft(ptr_real, len_by_2, pstr_scratch);
  176|       |
  177|       |  /* post twiddle */
  178|  5.43M|  iusace_post_twid(ptr_post_twid_re, ptr_post_twid_im, ptr_real, len_by_2);
  179|       |
  180|   587M|  for (i = 0; i < len_by_2; i++) {
  ------------------
  |  Branch (180:15): [True: 581M, False: 5.43M]
  ------------------
  181|   581M|    ptr_out[2 * i] = ptr_real[2 * i];
  182|   581M|    ptr_out[length - 1 - 2 * i] = ptr_real[2 * i + 1];
  183|   581M|  }
  184|       |
  185|  5.43M|  return;
  186|  5.43M|}
iusace_tcx_mdct.c:iusace_get_pre_post_twid:
   95|  5.43M|                                     WORD32 length) {
   96|  5.43M|  switch (length) {
   97|   361k|    case 512:
  ------------------
  |  Branch (97:5): [True: 361k, False: 5.07M]
  ------------------
   98|   361k|      *ptr_pre_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_256[0][0];
   99|   361k|      *ptr_pre_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_256[1][0];
  100|   361k|      *ptr_post_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_256[2][0];
  101|   361k|      *ptr_post_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_256[3][0];
  102|   361k|      break;
  103|   723k|    case 256:
  ------------------
  |  Branch (103:5): [True: 723k, False: 4.71M]
  ------------------
  104|   723k|      *ptr_pre_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_128[0][0];
  105|   723k|      *ptr_pre_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_128[1][0];
  106|   723k|      *ptr_post_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_128[2][0];
  107|   723k|      *ptr_post_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_128[3][0];
  108|   723k|      break;
  109|  2.54M|    case 128:
  ------------------
  |  Branch (109:5): [True: 2.54M, False: 2.89M]
  ------------------
  110|  2.54M|      *ptr_pre_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_64[0][0];
  111|  2.54M|      *ptr_pre_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_64[1][0];
  112|  2.54M|      *ptr_post_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_64[2][0];
  113|  2.54M|      *ptr_post_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_64[3][0];
  114|  2.54M|      break;
  115|    920|    case 64:
  ------------------
  |  Branch (115:5): [True: 920, False: 5.43M]
  ------------------
  116|    920|      *ptr_pre_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_32[0][0];
  117|    920|      *ptr_pre_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_32[1][0];
  118|    920|      *ptr_post_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_32[2][0];
  119|    920|      *ptr_post_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_32[3][0];
  120|    920|      break;
  121|  1.81M|    default:
  ------------------
  |  Branch (121:5): [True: 1.81M, False: 3.62M]
  ------------------
  122|  1.81M|      *ptr_pre_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_512[0][0];
  123|  1.81M|      *ptr_pre_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_512[1][0];
  124|  1.81M|      *ptr_post_twid_re = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_512[2][0];
  125|  1.81M|      *ptr_post_twid_im = (FLOAT32 *)&iusace_pre_post_twid_cos_sin_512[3][0];
  126|  5.43M|  }
  127|       |
  128|  5.43M|  return;
  129|  5.43M|}
iusace_tcx_mdct.c:iusace_pre_twid:
  132|  5.43M|                            WORD32 length) {
  133|  5.43M|  WORD32 i;
  134|   587M|  for (i = 0; i < length; i++) {
  ------------------
  |  Branch (134:15): [True: 581M, False: 5.43M]
  ------------------
  135|   581M|    FLOAT32 temp = ptr_in[2 * i] * ptr_twid_re[i] - ptr_in[2 * i + 1] * ptr_twid_im[i];
  136|       |
  137|   581M|    ptr_in[2 * i + 1] = ptr_in[2 * i] * ptr_twid_im[i] + ptr_in[2 * i + 1] * ptr_twid_re[i];
  138|       |
  139|   581M|    ptr_in[2 * i] = temp;
  140|   581M|  }
  141|  5.43M|  return;
  142|  5.43M|}
iusace_tcx_mdct.c:iusace_post_twid:
  145|  5.43M|                             WORD32 length) {
  146|  5.43M|  WORD32 i;
  147|   587M|  for (i = 0; i < length; i++) {
  ------------------
  |  Branch (147:15): [True: 581M, False: 5.43M]
  ------------------
  148|   581M|    FLOAT32 temp = ptr_in[2 * i] * ptr_twid_re[i] - ptr_in[2 * i + 1] * ptr_twid_im[i];
  149|       |
  150|   581M|    ptr_in[2 * i + 1] = -ptr_in[2 * i] * ptr_twid_im[i] - ptr_in[2 * i + 1] * ptr_twid_re[i];
  151|   581M|    ptr_in[2 * i] = temp;
  152|   581M|  }
  153|  5.43M|  return;
  154|  5.43M|}

iusace_tns_init:
   96|  2.93k|                             WORD32 num_channels) {
   97|  2.93k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.93k|#define IA_NO_ERROR 0x00000000
  ------------------
   98|  2.93k|  WORD32 fs_index = 0;
   99|  2.93k|  WORD32 lpc_stop_freq = 16000;
  100|  2.93k|  WORD32 lpc_start_freq_long = 2500, lpc_start_freq_short = 3750;
  101|  2.93k|  tns_info->threshold = 1.41f;
  102|  2.93k|  tns_info->tns_time_res_short = 0.6f;
  103|  2.93k|  tns_info->tns_time_res_long = 0.6f;
  104|       |
  105|  2.93k|  if (sampling_rate == 14700) {
  ------------------
  |  Branch (105:7): [True: 0, False: 2.93k]
  ------------------
  106|      0|    sampling_rate = 16000;
  107|      0|  }
  108|  2.93k|  if (sampling_rate == 29400) {
  ------------------
  |  Branch (108:7): [True: 0, False: 2.93k]
  ------------------
  109|      0|    sampling_rate = 32000;
  110|      0|  }
  111|       |
  112|  2.93k|  if (bit_rate < 32000) {
  ------------------
  |  Branch (112:7): [True: 8, False: 2.93k]
  ------------------
  113|      8|    if (num_channels == 1) {
  ------------------
  |  Branch (113:9): [True: 4, False: 4]
  ------------------
  114|      4|      tns_info->threshold = 1.2f;
  115|      4|      lpc_start_freq_long = 2000;
  116|      4|    }
  117|  2.93k|  } else if (bit_rate < 36000) {
  ------------------
  |  Branch (117:14): [True: 190, False: 2.74k]
  ------------------
  118|    190|    if (num_channels == 1) {
  ------------------
  |  Branch (118:9): [True: 1, False: 189]
  ------------------
  119|      1|      tns_info->tns_time_res_long = 0.8f;
  120|    189|    } else {
  121|    189|      tns_info->tns_time_res_long = 0.5f;
  122|    189|    }
  123|    190|    tns_info->tns_time_res_short = 0.3f;
  124|  2.74k|  } else {
  125|  2.74k|    tns_info->tns_time_res_long = 0.5f;
  126|  2.74k|    tns_info->tns_time_res_short = 0.3f;
  127|  2.74k|  }
  128|       |
  129|       |  /** Determine if sampling rate is supported
  130|       |   */
  131|  21.3k|  while (sampling_rate != iusace_tns_supported_sampling_rates[fs_index]) {
  ------------------
  |  Branch (131:10): [True: 18.4k, False: 2.91k]
  ------------------
  132|  18.4k|    if (!iusace_tns_supported_sampling_rates[fs_index]) {
  ------------------
  |  Branch (132:9): [True: 22, False: 18.3k]
  ------------------
  133|     22|      return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_CORE_SAMPLE_RATE;
  134|     22|    }
  135|  18.3k|    fs_index++;
  136|  18.3k|  }
  137|       |
  138|  2.91k|  tns_info->tns_max_bands_long = iusace_tns_max_bands_table[fs_index][0];
  139|  2.91k|  tns_info->tns_max_bands_short = iusace_tns_max_bands_table[fs_index][1];
  140|  2.91k|  tns_info->tns_max_order_long = 15;
  141|  2.91k|  tns_info->tns_max_order_short = 7;
  142|       |
  143|  2.91k|  tns_info->tns_min_band_number_long = iusace_tns_min_band_number_long[fs_index];
  144|  2.91k|  tns_info->tns_min_band_number_short = iusace_tns_min_band_number_short[fs_index];
  145|       |
  146|  2.91k|  tns_info->lpc_start_band_long =
  147|  2.91k|      iusace_freq_to_band_mapping(lpc_start_freq_long, sampling_rate, tns_info->max_sfb_long,
  148|  2.91k|                                  tns_info->sfb_offset_table_long);
  149|       |
  150|  2.91k|  tns_info->lpc_start_band_short =
  151|  2.91k|      iusace_freq_to_band_mapping(lpc_start_freq_short, sampling_rate, tns_info->max_sfb_short,
  152|  2.91k|                                  tns_info->sfb_offset_table_short);
  153|       |
  154|  2.91k|  tns_info->lpc_stop_band_long = iusace_freq_to_band_mapping(
  155|  2.91k|      lpc_stop_freq, sampling_rate, tns_info->max_sfb_long, tns_info->sfb_offset_table_long);
  156|       |
  157|  2.91k|  tns_info->lpc_stop_band_short = iusace_freq_to_band_mapping(
  158|  2.91k|      lpc_stop_freq, sampling_rate, tns_info->max_sfb_short, tns_info->sfb_offset_table_short);
  159|       |
  160|  2.91k|  iusace_calc_gauss_win(tns_info->win_long, tns_info->tns_max_order_long + 1, sampling_rate,
  161|  2.91k|                        ONLY_LONG_SEQUENCE, tns_info->tns_time_res_long);
  ------------------
  |  |   45|  2.91k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  162|       |
  163|  2.91k|  iusace_calc_gauss_win(tns_info->win_short, tns_info->tns_max_order_short + 1, sampling_rate,
  164|  2.91k|                        EIGHT_SHORT_SEQUENCE, tns_info->tns_time_res_short);
  ------------------
  |  |   40|  2.91k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  165|  2.91k|  return err_code;
  166|  2.93k|}
iusace_tns_filter:
  169|   272k|                       FLOAT64 *scratch_tns_filter) {
  170|   272k|  WORD32 i, j, k = 0;
  171|   272k|  WORD32 order = filter->order;
  172|   272k|  FLOAT64 *a = filter->a_coeffs;
  173|   272k|  FLOAT64 *temp = scratch_tns_filter;
  174|       |
  175|       |  /** Determine loop parameters for given direction
  176|       |   */
  177|   272k|  if (filter->direction) {
  ------------------
  |  Branch (177:7): [True: 0, False: 272k]
  ------------------
  178|       |    /** Startup, initial state is zero
  179|       |     */
  180|      0|    temp[length - 1] = spec[length - 1];
  181|      0|    for (i = length - 2; i > (length - 1 - order); i--) {
  ------------------
  |  Branch (181:26): [True: 0, False: 0]
  ------------------
  182|      0|      temp[i] = spec[i];
  183|      0|      k++;
  184|      0|      for (j = 1; j <= k; j++) {
  ------------------
  |  Branch (184:19): [True: 0, False: 0]
  ------------------
  185|      0|        spec[i] += temp[i + j] * a[j];
  186|      0|      }
  187|      0|    }
  188|       |
  189|       |    /** Now filter the rest
  190|       |     */
  191|      0|    for (i = length - 1 - order; i >= 0; i--) {
  ------------------
  |  Branch (191:34): [True: 0, False: 0]
  ------------------
  192|      0|      temp[i] = spec[i];
  193|      0|      for (j = 1; j <= order; j++) {
  ------------------
  |  Branch (193:19): [True: 0, False: 0]
  ------------------
  194|      0|        spec[i] += temp[i + j] * a[j];
  195|      0|      }
  196|      0|    }
  197|   272k|  } else {
  198|       |    /** Startup, initial state is zero
  199|       |     */
  200|   272k|    temp[0] = spec[0];
  201|  1.34M|    for (i = 1; i < order; i++) {
  ------------------
  |  Branch (201:17): [True: 1.07M, False: 272k]
  ------------------
  202|  1.07M|      temp[i] = spec[i];
  203|  5.83M|      for (j = 1; j <= i; j++) {
  ------------------
  |  Branch (203:19): [True: 4.76M, False: 1.07M]
  ------------------
  204|  4.76M|        spec[i] += temp[i - j] * a[j];
  205|  4.76M|      }
  206|  1.07M|    }
  207|       |
  208|       |    /** Now filter the rest
  209|       |     */
  210|  86.1M|    for (i = order; i < length; i++) {
  ------------------
  |  Branch (210:21): [True: 85.8M, False: 272k]
  ------------------
  211|  85.8M|      temp[i] = spec[i];
  212|   791M|      for (j = 1; j <= order; j++) {
  ------------------
  |  Branch (212:19): [True: 705M, False: 85.8M]
  ------------------
  213|   705M|        spec[i] += temp[i - j] * a[j];
  214|   705M|      }
  215|  85.8M|    }
  216|   272k|  }
  217|       |
  218|   272k|  return;
  219|   272k|}
iusace_quantize_reflection_coeffs:
  233|   272k|                                       WORD32 *index_array) {
  234|   272k|  FLOAT64 iqfac, iqfac_m;
  235|   272k|  WORD32 i;
  236|       |
  237|   272k|  iqfac = (((SIZE_T)1 << (coeff_res - 1)) - 0.5) / (PI / 2);
  ------------------
  |  |   38|   272k|#define PI (3.1415926535897932f)
  ------------------
  238|   272k|  iqfac_m = (((SIZE_T)1 << (coeff_res - 1)) + 0.5) / (PI / 2);
  ------------------
  |  |   38|   272k|#define PI (3.1415926535897932f)
  ------------------
  239|       |
  240|       |  /* Quantize and inverse quantize */
  241|  2.97M|  for (i = 1; i <= f_order; i++) {
  ------------------
  |  Branch (241:15): [True: 2.69M, False: 272k]
  ------------------
  242|  2.69M|    index_array[i] = (WORD32)(0.5 + (asin(k_array[i]) * ((k_array[i] >= 0) ? iqfac : iqfac_m)));
  ------------------
  |  Branch (242:58): [True: 1.77M, False: 920k]
  ------------------
  243|  2.69M|    k_array[i] = sin((FLOAT64)index_array[i] / ((index_array[i] >= 0) ? iqfac : iqfac_m));
  ------------------
  |  Branch (243:49): [True: 2.57M, False: 120k]
  ------------------
  244|  2.69M|  }
  245|   272k|  return;
  246|   272k|}
iusace_tns_auto_corr:
  248|   674k|VOID iusace_tns_auto_corr(WORD32 max_order, WORD32 data_size, FLOAT64 *data, FLOAT64 *r_array) {
  249|   674k|  WORD32 i, j;
  250|   674k|  FLOAT64 tmp_var;
  251|  66.3M|  for (i = 0; i < data_size; i += 2) {
  ------------------
  |  Branch (251:15): [True: 65.6M, False: 674k]
  ------------------
  252|  65.6M|    const FLOAT64 *input1 = &data[i];
  253|  65.6M|    FLOAT64 temp1 = *input1;
  254|  65.6M|    FLOAT64 temp2 = *(input1 + 1);
  255|  65.6M|    FLOAT64 inp_tmp1 = *input1++;
  256|   517M|    for (j = 0; j <= max_order; j++) {
  ------------------
  |  Branch (256:17): [True: 451M, False: 65.6M]
  ------------------
  257|   451M|      FLOAT64 inp_tmp2;
  258|   451M|      tmp_var = temp1 * inp_tmp1;
  259|   451M|      inp_tmp2 = *input1++;
  260|   451M|      tmp_var += temp2 * inp_tmp2;
  261|   451M|      r_array[j] += tmp_var;
  262|   451M|      j++;
  263|   451M|      tmp_var = temp1 * inp_tmp2;
  264|   451M|      inp_tmp1 = *input1++;
  265|   451M|      tmp_var += temp2 * inp_tmp1;
  266|   451M|      r_array[j] += tmp_var;
  267|   451M|    }
  268|  65.6M|  }
  269|   674k|  return;
  270|   674k|}
iusace_tns_data_sync:
  400|   314k|                          WORD32 order) {
  401|   314k|  ia_tns_window_data *win_data_src = &ptr_tns_src->window_data[w];
  402|   314k|  ia_tns_window_data *win_data_dest = &ptr_tns_dest->window_data[w];
  403|   314k|  WORD32 i;
  404|   314k|  if (fabs(win_data_dest->tns_pred_gain - win_data_src->tns_pred_gain) <
  ------------------
  |  Branch (404:7): [True: 140k, False: 173k]
  ------------------
  405|   314k|      ((FLOAT32)0.03f * win_data_dest->tns_pred_gain)) {
  406|   140k|    win_data_dest->tns_active = win_data_src->tns_active;
  407|       |
  408|  1.35M|    for (i = 0; i < order; i++) {
  ------------------
  |  Branch (408:17): [True: 1.21M, False: 140k]
  ------------------
  409|  1.21M|      win_data_dest->tns_filter->k_coeffs[i] = win_data_src->tns_filter->k_coeffs[i];
  410|  1.21M|    }
  411|   140k|  }
  412|   314k|  return;
  413|   314k|}
iusace_tns_encode:
  418|   674k|                       FLOAT64 *ptr_tns_scratch) {
  419|   674k|  WORD32 number_of_bands = pstr_tns_info->number_of_bands;
  420|   674k|  WORD32 block_type = pstr_tns_info->block_type;
  421|   674k|  FLOAT64 *ptr_spec = pstr_tns_info->spec;
  422|   674k|  WORD32 start_band, stop_band, order; /**< bands over which to apply TNS */
  423|   674k|  WORD32 length_in_bands;              /**< Length to filter, in bands */
  424|   674k|  WORD32 start_index, length;
  425|   674k|  WORD32 nbands;
  426|   674k|  WORD32 coeff_res;
  427|   674k|  FLOAT64 *ptr_weighted_spec = ptr_tns_scratch;
  428|   674k|  memset(ptr_weighted_spec, 0, 4096 * sizeof(ptr_weighted_spec[0]));
  429|   674k|  FLOAT64 *ptr_scratch = ptr_tns_scratch + 4096;
  430|   674k|  FLOAT64 *ptr_window = NULL;
  431|   674k|  WORD32 lpc_start_band, lpc_stop_band;
  432|   674k|  WORD32 *ptr_sfb_offset_table;
  433|       |
  434|   674k|  switch (block_type) {
  435|   531k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|   531k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (435:5): [True: 531k, False: 142k]
  ------------------
  436|   531k|      start_band = pstr_tns_info->tns_min_band_number_short;
  437|   531k|      stop_band = number_of_bands;
  438|   531k|      length_in_bands = stop_band - start_band;
  439|   531k|      order = pstr_tns_info->tns_max_order_short;
  440|   531k|      start_band = MIN(start_band, pstr_tns_info->tns_max_bands_short);
  ------------------
  |  |   23|   531k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 531k, False: 0]
  |  |  ------------------
  ------------------
  441|   531k|      stop_band = MIN(stop_band, pstr_tns_info->tns_max_bands_short);
  ------------------
  |  |   23|   531k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 67.9k, False: 463k]
  |  |  ------------------
  ------------------
  442|   531k|      coeff_res = 3;
  443|   531k|      ptr_window = pstr_tns_info->win_short;
  444|   531k|      nbands = pstr_tns_info->max_sfb_short;
  445|   531k|      lpc_start_band = pstr_tns_info->lpc_start_band_short;
  446|   531k|      lpc_stop_band = pstr_tns_info->lpc_stop_band_short;
  447|   531k|      if (core_mode == CORE_MODE_FD) {
  ------------------
  |  |   33|   531k|#define CORE_MODE_FD (0)
  ------------------
  |  Branch (447:11): [True: 531k, False: 0]
  ------------------
  448|   531k|        ptr_sfb_offset_table = pstr_tns_info->sfb_offset_table_short;
  449|   531k|      } else {
  450|      0|        ptr_sfb_offset_table = pstr_tns_info->sfb_offset_table_short_tcx;
  451|      0|      }
  452|   531k|      break;
  453|       |
  454|   142k|    default:
  ------------------
  |  Branch (454:5): [True: 142k, False: 531k]
  ------------------
  455|   142k|      start_band = pstr_tns_info->tns_min_band_number_long;
  456|   142k|      stop_band = number_of_bands;
  457|   142k|      length_in_bands = stop_band - start_band;
  458|   142k|      order = pstr_tns_info->tns_max_order_long;
  459|   142k|      start_band = MIN(start_band, pstr_tns_info->tns_max_bands_long);
  ------------------
  |  |   23|   142k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 142k, False: 0]
  |  |  ------------------
  ------------------
  460|   142k|      stop_band = MIN(stop_band, pstr_tns_info->tns_max_bands_long);
  ------------------
  |  |   23|   142k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 6.82k, False: 135k]
  |  |  ------------------
  ------------------
  461|   142k|      coeff_res = 4;
  462|   142k|      ptr_window = pstr_tns_info->win_long;
  463|   142k|      nbands = pstr_tns_info->max_sfb_long;
  464|   142k|      lpc_start_band = pstr_tns_info->lpc_start_band_long;
  465|   142k|      lpc_stop_band = pstr_tns_info->lpc_stop_band_long;
  466|   142k|      ptr_sfb_offset_table = pstr_tns_info->sfb_offset_table_long;
  467|   142k|      break;
  468|   674k|  }
  469|       |
  470|       |  /** Make sure that start and stop bands < max_sfb
  471|       |   * Make sure that start and stop bands >= 0
  472|       |   */
  473|   674k|  start_band = MIN(start_band, nbands);
  ------------------
  |  |   23|   674k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 674k, False: 0]
  |  |  ------------------
  ------------------
  474|   674k|  stop_band = MIN(stop_band, nbands);
  ------------------
  |  |   23|   674k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 105k, False: 568k]
  |  |  ------------------
  ------------------
  475|   674k|  start_band = MAX(start_band, 0);
  ------------------
  |  |   24|   674k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 674k, False: 0]
  |  |  ------------------
  ------------------
  476|   674k|  stop_band = MAX(stop_band, 0);
  ------------------
  |  |   24|   674k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 674k, False: 0]
  |  |  ------------------
  ------------------
  477|       |
  478|   674k|  pstr_tns_info->tns_data_present = 0; /**< default TNS not used */
  479|       |
  480|       |  /** Perform analysis and filtering for each window
  481|       |   */
  482|   674k|  {
  483|   674k|    ia_tns_window_data *window_data = &pstr_tns_info->window_data[w];
  484|   674k|    ia_tns_filter_data *tns_filter = window_data->tns_filter;
  485|   674k|    FLOAT64 *k = tns_filter->k_coeffs; /**< reflection coeffs */
  486|   674k|    FLOAT64 *a = tns_filter->a_coeffs; /**< prediction coeffs */
  487|       |
  488|   674k|    iusace_calc_weighted_spec(ptr_spec, ptr_weighted_spec, ptr_sfb_energy, ptr_sfb_offset_table,
  489|   674k|                              lpc_start_band, lpc_stop_band, ptr_scratch);
  490|       |
  491|   674k|    window_data->n_filt = 0;
  492|   674k|    window_data->coef_res = coeff_res;
  493|       |
  494|   674k|    start_index = ptr_sfb_offset_table[lpc_start_band];
  495|   674k|    length =
  496|   674k|        ptr_sfb_offset_table[lpc_stop_band] -
  497|   674k|        ptr_sfb_offset_table[lpc_start_band]; /**< The length of the spectral data to be
  498|       |                                                                                         processed
  499|       |                                               */
  500|       |
  501|   674k|    window_data->tns_pred_gain = iusace_levinson_durbin(
  502|   674k|        order, length, &ptr_weighted_spec[start_index], k, ptr_window, ptr_scratch);
  503|       |
  504|   674k|    window_data->tns_active = 0;
  505|   674k|    if (window_data->tns_pred_gain > DEF_TNS_GAIN_THRESH) {
  ------------------
  |  |   28|   674k|#define DEF_TNS_GAIN_THRESH 1.41
  ------------------
  |  Branch (505:9): [True: 272k, False: 401k]
  ------------------
  506|   272k|      window_data->tns_active = 1;
  507|   272k|    }
  508|       |
  509|   674k|    if (i_ch == 1) {
  ------------------
  |  Branch (509:9): [True: 314k, False: 359k]
  ------------------
  510|   314k|      iusace_tns_data_sync(pstr_tns_info, pstr_tns_info_ch2, w, order);
  511|   314k|    }
  512|       |
  513|   674k|    if (window_data->tns_pred_gain > DEF_TNS_GAIN_THRESH) {
  ------------------
  |  |   28|   674k|#define DEF_TNS_GAIN_THRESH 1.41
  ------------------
  |  Branch (513:9): [True: 272k, False: 401k]
  ------------------
  514|       |      /** Use TNS
  515|       |       */
  516|   272k|      WORD32 truncated_order;
  517|   272k|      window_data->n_filt++;
  518|   272k|      pstr_tns_info->tns_data_present = 1;
  519|   272k|      tns_filter->direction = 0;
  520|   272k|      tns_filter->coef_compress = 0;
  521|   272k|      tns_filter->length = length_in_bands;
  522|   272k|      iusace_quantize_reflection_coeffs(order, coeff_res, k, tns_filter->index);
  523|   272k|      truncated_order = iusace_truncate_coeffs(order, DEF_TNS_COEFF_THRESH, k);
  ------------------
  |  |   29|   272k|#define DEF_TNS_COEFF_THRESH 0.1
  ------------------
  524|   272k|      tns_filter->order = truncated_order;
  525|   272k|      iusace_step_up(truncated_order, k, a, ptr_scratch); /**< Compute prediction coefficients */
  526|   272k|      start_index = ptr_sfb_offset_table[start_band];
  527|   272k|      length = MIN(ptr_sfb_offset_table[stop_band], low_pass_line) - start_index;
  ------------------
  |  |   23|   272k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 16.6k, False: 256k]
  |  |  ------------------
  ------------------
  528|   272k|      if (block_type == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   272k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (528:11): [True: 174k, False: 98.5k]
  ------------------
  529|   174k|        length = ptr_sfb_offset_table[stop_band] - start_index;
  530|   174k|      }
  531|   272k|      iusace_tns_filter(length, &ptr_spec[start_index], tns_filter,
  532|   272k|                        ptr_scratch_tns_filter); /**< filter */
  533|   272k|    }
  534|   674k|  }
  535|   674k|  return;
  536|   674k|}
iusace_tns_usac.c:iusace_freq_to_band_mapping:
   61|  11.6k|                                          const WORD32 *ptr_band_start_offset) {
   62|  11.6k|  WORD32 line_num, band;
   63|       |
   64|  11.6k|  line_num = (freq * ptr_band_start_offset[num_bands] * 4 / sample_rate + 1) / 2;
   65|       |
   66|  11.6k|  if (line_num >= ptr_band_start_offset[num_bands]) {
  ------------------
  |  Branch (66:7): [True: 4.79k, False: 6.87k]
  ------------------
   67|  4.79k|    return num_bands;
   68|  4.79k|  }
   69|       |
   70|   126k|  for (band = 0; band < num_bands; band++) {
  ------------------
  |  Branch (70:18): [True: 126k, False: 0]
  ------------------
   71|   126k|    if (ptr_band_start_offset[band + 1] > line_num) break;
  ------------------
  |  Branch (71:9): [True: 6.87k, False: 119k]
  ------------------
   72|   126k|  }
   73|       |
   74|  6.87k|  if (line_num - ptr_band_start_offset[band] > ptr_band_start_offset[band + 1] - line_num) {
  ------------------
  |  Branch (74:7): [True: 1.98k, False: 4.88k]
  ------------------
   75|  1.98k|    band++;
   76|  1.98k|  }
   77|       |
   78|  6.87k|  return band;
   79|  11.6k|};
iusace_tns_usac.c:iusace_calc_gauss_win:
   82|  5.83k|                                  const WORD32 win_seq, const FLOAT32 time_resolution) {
   83|  5.83k|  WORD32 i;
   84|  5.83k|  FLOAT32 gauss_exp = 3.14159265358979323f * sample_rate * 0.001f * (FLOAT32)time_resolution /
   85|  5.83k|                      (win_seq != EIGHT_SHORT_SEQUENCE ? 1024.0f : 128.0f);
  ------------------
  |  |   40|  5.83k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (85:24): [True: 2.91k, False: 2.91k]
  ------------------
   86|       |
   87|  5.83k|  gauss_exp = -0.5f * gauss_exp * gauss_exp;
   88|       |
   89|  75.8k|  for (i = 0; i < length; i++) {
  ------------------
  |  Branch (89:15): [True: 69.9k, False: 5.83k]
  ------------------
   90|  69.9k|    ptr_win[i] = (FLOAT32)exp(gauss_exp * (i + 0.5) * (i + 0.5));
   91|  69.9k|  }
   92|  5.83k|  return;
   93|  5.83k|}
iusace_tns_usac.c:iusace_calc_weighted_spec:
  359|   674k|                                      FLOAT64 *ptr_scratch) {
  360|   674k|  WORD32 i, sfb;
  361|   674k|  FLOAT32 temp;
  362|   674k|  FLOAT32 *ptr_tns_sfb_mean = (FLOAT32 *)ptr_scratch;
  363|   674k|  memset(ptr_scratch, 0, MAX_NUM_GROUPED_SFB * sizeof(ptr_tns_sfb_mean[0]));
  ------------------
  |  |   24|   674k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  364|   674k|  WORD32 lpc_stop_line = ptr_sfb_offset[lpc_stop_band];
  365|   674k|  WORD32 lpc_start_line = ptr_sfb_offset[lpc_start_band];
  366|       |
  367|  6.39M|  for (sfb = lpc_start_band; sfb < lpc_stop_band; sfb++) {
  ------------------
  |  Branch (367:30): [True: 5.72M, False: 674k]
  ------------------
  368|  5.72M|    ptr_tns_sfb_mean[sfb] = (FLOAT32)(1.0 / sqrt(ptr_sfb_en[sfb] + 1e-30f));
  369|  5.72M|  }
  370|       |
  371|   674k|  sfb = lpc_start_band;
  372|   674k|  temp = ptr_tns_sfb_mean[sfb];
  373|       |
  374|   132M|  for (i = lpc_start_line; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (374:28): [True: 131M, False: 674k]
  ------------------
  375|   131M|    if (ptr_sfb_offset[sfb + 1] == i) {
  ------------------
  |  Branch (375:9): [True: 5.05M, False: 126M]
  ------------------
  376|  5.05M|      sfb++;
  377|       |
  378|  5.05M|      if (sfb + 1 < lpc_stop_band) {
  ------------------
  |  Branch (378:11): [True: 4.39M, False: 659k]
  ------------------
  379|  4.39M|        temp = ptr_tns_sfb_mean[sfb];
  380|  4.39M|      }
  381|  5.05M|    }
  382|   131M|    ptr_wgt_spec[i] = temp;
  383|   131M|  }
  384|       |
  385|   131M|  for (i = lpc_stop_line - 2; i >= lpc_start_line; i--) {
  ------------------
  |  Branch (385:31): [True: 130M, False: 674k]
  ------------------
  386|   130M|    ptr_wgt_spec[i] = (ptr_wgt_spec[i] + ptr_wgt_spec[i + 1]) * 0.5f;
  387|   130M|  }
  388|       |
  389|   131M|  for (i = lpc_start_line + 1; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (389:32): [True: 130M, False: 674k]
  ------------------
  390|   130M|    ptr_wgt_spec[i] = (ptr_wgt_spec[i] + ptr_wgt_spec[i - 1]) * 0.5f;
  391|   130M|  }
  392|       |
  393|   132M|  for (i = lpc_start_line; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (393:28): [True: 131M, False: 674k]
  ------------------
  394|   131M|    ptr_wgt_spec[i] = ptr_wgt_spec[i] * ptr_spec[i];
  395|   131M|  }
  396|   674k|  return;
  397|   674k|}
iusace_tns_usac.c:iusace_levinson_durbin:
  273|   674k|                                      FLOAT64 *ptr_k, FLOAT64 *ptr_win, FLOAT64 *ptr_scratch) {
  274|   674k|  WORD32 i, j;
  275|   674k|  FLOAT64 *ptr_work_buffer_temp;
  276|   674k|  FLOAT64 *ptr_work_buffer = ptr_scratch;
  277|   674k|  FLOAT64 *ptr_input = ptr_scratch + TNS_MAX_ORDER + 1;
  ------------------
  |  |   27|   674k|#define TNS_MAX_ORDER 31
  ------------------
  278|   674k|  memset(ptr_input, 0, (TNS_MAX_ORDER + 1) * sizeof(ptr_input[0]));
  ------------------
  |  |   27|   674k|#define TNS_MAX_ORDER 31
  ------------------
  279|   674k|  iusace_tns_auto_corr(order, data_size, ptr_data, ptr_input);
  280|       |
  281|   674k|  WORD32 num_of_coeff = order;
  282|   674k|  FLOAT64 *ptr_refl_coeff = ptr_k;
  283|   674k|  ptr_k[0] = 1.0;
  284|       |
  285|   674k|  if (ptr_input[0] == 0) {
  ------------------
  |  Branch (285:7): [True: 118k, False: 555k]
  ------------------
  286|   118k|    return 0;
  287|   118k|  }
  288|       |
  289|  6.05M|  for (i = 0; i < num_of_coeff + 1; i++) {
  ------------------
  |  Branch (289:15): [True: 5.50M, False: 555k]
  ------------------
  290|  5.50M|    ptr_input[i] = ptr_input[i] * ptr_win[i];
  291|  5.50M|  }
  292|       |
  293|   555k|  FLOAT64 tmp_var;
  294|   555k|  ptr_work_buffer[0] = ptr_input[0];
  295|       |
  296|  4.94M|  for (i = 1; i < num_of_coeff; i++) {
  ------------------
  |  Branch (296:15): [True: 4.38M, False: 555k]
  ------------------
  297|  4.38M|    tmp_var = ptr_input[i];
  298|  4.38M|    ptr_work_buffer[i] = tmp_var;
  299|  4.38M|    ptr_work_buffer[i + num_of_coeff - 1] = tmp_var;
  300|  4.38M|  }
  301|   555k|  ptr_work_buffer[i + num_of_coeff - 1] = ptr_input[i];
  302|       |
  303|  5.50M|  for (i = 0; i < num_of_coeff; i++) {
  ------------------
  |  Branch (303:15): [True: 4.94M, False: 555k]
  ------------------
  304|  4.94M|    FLOAT64 refc, tmp;
  305|  4.94M|    tmp = ptr_work_buffer[num_of_coeff + i];
  306|  4.94M|    if (tmp < 0) {
  ------------------
  |  Branch (306:9): [True: 2.70M, False: 2.23M]
  ------------------
  307|  2.70M|      tmp = -tmp;
  308|  2.70M|    } else {
  309|  2.23M|      if (ptr_work_buffer[0] < tmp) {
  ------------------
  |  Branch (309:11): [True: 0, False: 2.23M]
  ------------------
  310|      0|        break;
  311|      0|      }
  312|  2.23M|    }
  313|  4.94M|    if (ptr_work_buffer[0] == 0) {
  ------------------
  |  Branch (313:9): [True: 0, False: 4.94M]
  ------------------
  314|      0|      refc = 0;
  315|  4.94M|    } else {
  316|  4.94M|      refc = tmp / ptr_work_buffer[0];
  317|  4.94M|    }
  318|       |
  319|  4.94M|    if (ptr_work_buffer[num_of_coeff + i] > 0) {
  ------------------
  |  Branch (319:9): [True: 2.01M, False: 2.92M]
  ------------------
  320|  2.01M|      refc = -refc;
  321|  2.01M|    }
  322|  4.94M|    ptr_refl_coeff[i + 1] = refc;
  323|  4.94M|    ptr_work_buffer_temp = &(ptr_work_buffer[num_of_coeff]);
  324|       |
  325|  32.6M|    for (j = i; j < num_of_coeff; j++) {
  ------------------
  |  Branch (325:17): [True: 27.6M, False: 4.94M]
  ------------------
  326|  27.6M|      FLOAT64 accu1, accu2;
  327|  27.6M|      accu1 = refc * ptr_work_buffer[j - i];
  328|  27.6M|      accu1 += ptr_work_buffer_temp[j];
  329|  27.6M|      accu2 = refc * ptr_work_buffer_temp[j];
  330|  27.6M|      accu2 += ptr_work_buffer[j - i];
  331|  27.6M|      ptr_work_buffer_temp[j] = accu1;
  332|  27.6M|      ptr_work_buffer[j - i] = accu2;
  333|  27.6M|    }
  334|  4.94M|  }
  335|   555k|  return (ptr_input[0] / ptr_work_buffer[0]);
  336|   674k|}
iusace_tns_usac.c:iusace_truncate_coeffs:
  221|   272k|static WORD32 iusace_truncate_coeffs(WORD32 f_order, FLOAT64 threshold, FLOAT64 *k_array) {
  222|   272k|  WORD32 i;
  223|  1.62M|  for (i = f_order; i >= 0; i--) {
  ------------------
  |  Branch (223:21): [True: 1.62M, False: 0]
  ------------------
  224|  1.62M|    k_array[i] = (fabs(k_array[i]) > threshold) ? k_array[i] : 0.0;
  ------------------
  |  Branch (224:18): [True: 272k, False: 1.35M]
  ------------------
  225|  1.62M|    if (k_array[i] != 0.0) {
  ------------------
  |  Branch (225:9): [True: 272k, False: 1.35M]
  ------------------
  226|   272k|      return i;
  227|   272k|    }
  228|  1.62M|  }
  229|      0|  return 0;
  230|   272k|}
iusace_tns_usac.c:iusace_step_up:
  338|   272k|static VOID iusace_step_up(WORD32 f_order, FLOAT64 *ptr_k, FLOAT64 *ptr_a, FLOAT64 *ptr_scratch) {
  339|   272k|  FLOAT64 *ptr_a_temp = ptr_scratch;
  340|   272k|  WORD32 i, order;
  341|       |
  342|   272k|  ptr_a[0] = 1.0;
  343|   272k|  ptr_a_temp[0] = 1.0;
  344|  1.61M|  for (order = 1; order <= f_order; order++) {
  ------------------
  |  Branch (344:19): [True: 1.34M, False: 272k]
  ------------------
  345|  1.34M|    ptr_a[order] = 0.0;
  346|  7.45M|    for (i = 1; i <= order; i++) {
  ------------------
  |  Branch (346:17): [True: 6.10M, False: 1.34M]
  ------------------
  347|  6.10M|      ptr_a_temp[i] = ptr_a[i] + ptr_k[order] * ptr_a[order - i];
  348|  6.10M|    }
  349|  7.45M|    for (i = 1; i <= order; i++) {
  ------------------
  |  Branch (349:17): [True: 6.10M, False: 1.34M]
  ------------------
  350|  6.10M|      ptr_a[i] = ptr_a_temp[i];
  351|  6.10M|    }
  352|  1.34M|  }
  353|   272k|  return;
  354|   272k|}

iusace_calc_window:
   29|   658k|IA_ERRORCODE iusace_calc_window(FLOAT64 **win, WORD32 win_sz, WORD32 win_sel) {
   30|   658k|  switch (win_sel) {
   31|   380k|    case WIN_SEL_0:
  ------------------
  |  |   63|   380k|#define WIN_SEL_0 0
  ------------------
  |  Branch (31:5): [True: 380k, False: 277k]
  ------------------
   32|   380k|      switch (win_sz) {
   33|   119k|        case WIN_LEN_96:
  ------------------
  |  |   36|   119k|#define WIN_LEN_96 96
  ------------------
  |  Branch (33:9): [True: 119k, False: 261k]
  ------------------
   34|   119k|          *win = (FLOAT64 *)iexheaac_sine_win_96;
   35|   119k|          break;
   36|    426|        case WIN_LEN_192:
  ------------------
  |  |   35|    426|#define WIN_LEN_192 192
  ------------------
  |  Branch (36:9): [True: 426, False: 380k]
  ------------------
   37|    426|          *win = (FLOAT64 *)iexheaac_sine_win_192;
   38|    426|          break;
   39|   249k|        case WIN_LEN_128:
  ------------------
  |  |   33|   249k|#define WIN_LEN_128 128
  ------------------
  |  Branch (39:9): [True: 249k, False: 130k]
  ------------------
   40|   249k|          *win = (FLOAT64 *)iusace_sine_win_128;
   41|   249k|          break;
   42|  1.81k|        case WIN_LEN_256:
  ------------------
  |  |   34|  1.81k|#define WIN_LEN_256 256
  ------------------
  |  Branch (42:9): [True: 1.81k, False: 378k]
  ------------------
   43|  1.81k|          *win = (FLOAT64 *)iusace_sine_win_256;
   44|  1.81k|          break;
   45|  4.68k|        case WIN_LEN_768:
  ------------------
  |  |   32|  4.68k|#define WIN_LEN_768 768
  ------------------
  |  Branch (45:9): [True: 4.68k, False: 375k]
  ------------------
   46|  4.68k|          *win = (FLOAT64 *)iexheaac_sine_win_768;
   47|  4.68k|          break;
   48|  4.61k|        case WIN_LEN_1024:
  ------------------
  |  |   31|  4.61k|#define WIN_LEN_1024 1024
  ------------------
  |  Branch (48:9): [True: 4.61k, False: 376k]
  ------------------
   49|  4.61k|          *win = (FLOAT64 *)iusace_sine_win_1024;
   50|  4.61k|          break;
   51|      0|        default:
  ------------------
  |  Branch (51:9): [True: 0, False: 380k]
  ------------------
   52|      0|          return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_LENGTH;
   53|      0|          break;
   54|   380k|      }
   55|   380k|      break;
   56|   380k|    case WIN_SEL_1:
  ------------------
  |  |   64|   277k|#define WIN_SEL_1 1
  ------------------
  |  Branch (56:5): [True: 277k, False: 380k]
  ------------------
   57|   277k|      switch (win_sz) {
   58|  1.28k|        case WIN_LEN_96:
  ------------------
  |  |   36|  1.28k|#define WIN_LEN_96 96
  ------------------
  |  Branch (58:9): [True: 1.28k, False: 276k]
  ------------------
   59|  1.28k|          *win = (FLOAT64 *)iexheaac_kbd_win_96;
   60|  1.28k|          break;
   61|      0|        case WIN_LEN_128:
  ------------------
  |  |   33|      0|#define WIN_LEN_128 128
  ------------------
  |  Branch (61:9): [True: 0, False: 277k]
  ------------------
   62|      0|          *win = (FLOAT64 *)iusace_sine_win_128;
   63|      0|          break;
   64|      0|        case WIN_LEN_192:
  ------------------
  |  |   35|      0|#define WIN_LEN_192 192
  ------------------
  |  Branch (64:9): [True: 0, False: 277k]
  ------------------
   65|      0|          *win = (FLOAT64 *)iexheaac_kbd_win_192;
   66|      0|          break;
   67|      0|        case WIN_LEN_256:
  ------------------
  |  |   34|      0|#define WIN_LEN_256 256
  ------------------
  |  Branch (67:9): [True: 0, False: 277k]
  ------------------
   68|      0|          *win = (FLOAT64 *)iusace_kbd_win256;
   69|      0|          break;
   70|  54.9k|        case WIN_LEN_768:
  ------------------
  |  |   32|  54.9k|#define WIN_LEN_768 768
  ------------------
  |  Branch (70:9): [True: 54.9k, False: 222k]
  ------------------
   71|  54.9k|          *win = (FLOAT64 *)iexheaac_kbd_win_768;
   72|  54.9k|          break;
   73|   221k|        case WIN_LEN_1024:
  ------------------
  |  |   31|   221k|#define WIN_LEN_1024 1024
  ------------------
  |  Branch (73:9): [True: 221k, False: 56.2k]
  ------------------
   74|   221k|          *win = (FLOAT64 *)iusace_kbd_win1024;
   75|   221k|          break;
   76|      0|        default:
  ------------------
  |  Branch (76:9): [True: 0, False: 277k]
  ------------------
   77|      0|          return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_LENGTH;
   78|      0|          break;
   79|   277k|      }
   80|   277k|      break;
   81|       |
   82|   277k|    default:
  ------------------
  |  Branch (82:5): [True: 0, False: 658k]
  ------------------
   83|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_SHAPE;
   84|      0|      break;
   85|   658k|  }
   86|   658k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   658k|#define IA_NO_ERROR 0x00000000
  ------------------
   87|   658k|}
iusace_windowing_long:
   90|   197k|                           FLOAT64 *ptr_in_data, WORD32 n_long) {
   91|   197k|  WORD32 i;
   92|   197k|  FLOAT64 *ptr_win = ptr_win_long + n_long - 1;
   93|   197k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|   197k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|   197k|#define LEN_SUPERFRAME (1024)
  ------------------
   94|       |
   95|   192M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (95:15): [True: 192M, False: 197k]
  ------------------
   96|   192M|    ptr_win_buf[i] = ptr_overlap[i] * ptr_win_long[i];
   97|   192M|  }
   98|       |
   99|   197k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(ptr_overlap[0]));
  100|   197k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(ptr_overlap[0]));
  101|       |
  102|   192M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (102:15): [True: 192M, False: 197k]
  ------------------
  103|   192M|    ptr_win_buf[i + n_long] = ptr_overlap[i] * (*ptr_win--);
  104|   192M|  }
  105|       |
  106|   197k|  return;
  107|   197k|}
iusace_windowing_long_start:
  111|  46.0k|                                 WORD32 nflat_ls, FLOAT64 *ptr_win_med, WORD32 win_sz) {
  112|  46.0k|  WORD32 i;
  113|  46.0k|  FLOAT64 *ptr_win = ptr_win_buf + 2 * n_long - 1;
  114|  46.0k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|  46.0k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|  46.0k|#define LEN_SUPERFRAME (1024)
  ------------------
  115|       |
  116|  44.1M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (116:15): [True: 44.1M, False: 46.0k]
  ------------------
  117|  44.1M|    ptr_win_buf[i] = ptr_overlap[i] * ptr_win_long[i];
  118|  44.1M|  }
  119|       |
  120|  46.0k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(ptr_overlap[0]));
  121|  46.0k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(ptr_overlap[0]));
  122|  46.0k|  memcpy(ptr_win_buf + n_long, ptr_overlap, nflat_ls * sizeof(ptr_win_buf[0]));
  123|       |
  124|  46.0k|  ptr_win_med = ptr_win_med + win_sz - 1;
  125|  46.0k|  win_sz = n_long - 2 * nflat_ls;
  126|       |
  127|  5.80M|  for (i = 0; i < win_sz; i++) {
  ------------------
  |  Branch (127:15): [True: 5.75M, False: 46.0k]
  ------------------
  128|  5.75M|    ptr_win_buf[i + n_long + nflat_ls] = ptr_overlap[i + nflat_ls] * (*ptr_win_med--);
  129|  5.75M|  }
  130|       |
  131|  19.2M|  for (i = 0; i < nflat_ls; i++) {
  ------------------
  |  Branch (131:15): [True: 19.1M, False: 46.0k]
  ------------------
  132|  19.1M|    *ptr_win-- = 0;
  133|  19.1M|  }
  134|       |
  135|  46.0k|  return;
  136|  46.0k|}
iusace_windowing_long_stop:
  140|  41.9k|                                FLOAT64 *ptr_win_med, WORD32 win_sz) {
  141|  41.9k|  WORD32 i;
  142|  41.9k|  FLOAT64 *ptr_win = ptr_win_long + n_long - 1;
  143|  41.9k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|  41.9k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|  41.9k|#define LEN_SUPERFRAME (1024)
  ------------------
  144|       |
  145|  41.9k|  memset(ptr_win_buf, 0, nflat_ls * sizeof(FLOAT64));
  146|  5.09M|  for (i = 0; i < win_sz; i++) {
  ------------------
  |  Branch (146:15): [True: 5.04M, False: 41.9k]
  ------------------
  147|  5.04M|    ptr_win_buf[i + nflat_ls] = ptr_overlap[i + nflat_ls] * ptr_win_med[i];
  148|  5.04M|  }
  149|       |
  150|  41.9k|  memcpy(ptr_win_buf + nflat_ls + win_sz, ptr_overlap + nflat_ls + win_sz,
  151|  41.9k|         nflat_ls * sizeof(ptr_win_buf[0]));
  152|  41.9k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(ptr_overlap[0]));
  153|  41.9k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(ptr_overlap[0]));
  154|       |
  155|  40.1M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (155:15): [True: 40.1M, False: 41.9k]
  ------------------
  156|  40.1M|    ptr_win_buf[i + n_long] = ptr_overlap[i] * (*ptr_win--);
  157|  40.1M|  }
  158|  41.9k|  return;
  159|  41.9k|}

iusace_write_scf_data:
   58|   946k|                             WORD32 global_gain, const WORD32 huff_tab[CODE_BOOK_ALPHA_LAV][2]) {
   59|   946k|  WORD32 write_flag = (it_bit_buf != NULL);
   60|   946k|  WORD32 i, j, bit_count = 0;
   61|   946k|  WORD32 diff, length, codeword;
   62|   946k|  WORD32 index = 0;
   63|   946k|  WORD32 previous_scale_factor = global_gain;
   64|       |
   65|  2.90M|  for (j = 0; j < num_win_grps; j++) {
  ------------------
  |  Branch (65:15): [True: 1.96M, False: 946k]
  ------------------
   66|  40.6M|    for (i = 0; i < max_sfb; i++) {
  ------------------
  |  Branch (66:17): [True: 38.6M, False: 1.96M]
  ------------------
   67|  38.6M|      if (!((i == 0) && (j == 0))) {
  ------------------
  |  Branch (67:13): [True: 1.92M, False: 36.7M]
  |  Branch (67:25): [True: 912k, False: 1.01M]
  ------------------
   68|  37.7M|        diff = ptr_scale_factors[index] - previous_scale_factor;
   69|  37.7M|        length = huff_tab[diff + 60][0];
   70|  37.7M|        bit_count += length;
   71|  37.7M|        previous_scale_factor = ptr_scale_factors[index];
   72|  37.7M|        if (write_flag == 1) {
  ------------------
  |  Branch (72:13): [True: 17.2M, False: 20.4M]
  ------------------
   73|  17.2M|          codeword = huff_tab[diff + 60][1];
   74|  17.2M|          iusace_write_bits_buf(it_bit_buf, codeword, (UWORD8)length);
   75|  17.2M|        }
   76|  37.7M|      }
   77|  38.6M|      index++;
   78|  38.6M|    }
   79|  7.38M|    for (; i < num_sfb; i++) {
  ------------------
  |  Branch (79:12): [True: 5.42M, False: 1.96M]
  ------------------
   80|  5.42M|      index++;
   81|  5.42M|    }
   82|  1.96M|  }
   83|       |
   84|   946k|  return (bit_count);
   85|   946k|}
iusace_write_ms_data:
   89|   182k|                            WORD32 nr_of_sfb) {
   90|   182k|  WORD32 write_flag = (it_bit_buf != NULL);
   91|   182k|  WORD32 bit_count = 0;
   92|   182k|  WORD32 i, j;
   93|   182k|  WORD32 ms_mask_write = ms_mask;
   94|       |
   95|   182k|  if (write_flag) iusace_write_bits_buf(it_bit_buf, ms_mask_write, 2);
  ------------------
  |  Branch (95:7): [True: 182k, False: 0]
  ------------------
   96|   182k|  bit_count += 2;
   97|       |
   98|   182k|  if (ms_mask_write == 1) {
  ------------------
  |  Branch (98:7): [True: 25.2k, False: 157k]
  ------------------
   99|  87.8k|    for (i = 0; i < num_win_grps; i++) {
  ------------------
  |  Branch (99:17): [True: 62.6k, False: 25.2k]
  ------------------
  100|  1.29M|      for (j = 0; j < nr_of_sfb; j++) {
  ------------------
  |  Branch (100:19): [True: 1.23M, False: 62.6k]
  ------------------
  101|  1.23M|        if (write_flag) iusace_write_bits_buf(it_bit_buf, ms_used[i][j], 1);
  ------------------
  |  Branch (101:13): [True: 1.23M, False: 0]
  ------------------
  102|  1.23M|        bit_count += 1;
  103|  1.23M|      }
  104|  62.6k|    }
  105|  25.2k|  }
  106|       |
  107|   182k|  return bit_count;
  108|   182k|}
iusace_write_tns_data:
  111|   219k|                             WORD32 window_sequence, WORD32 core_mode) {
  112|   219k|  WORD32 write_flag = (it_bit_buf != NULL);
  113|   219k|  WORD32 bit_count = 0;
  114|   219k|  WORD32 num_windows;
  115|   219k|  WORD32 len_tns_nfilt;
  116|   219k|  WORD32 len_tns_length;
  117|   219k|  WORD32 len_tns_order;
  118|   219k|  WORD32 filt;
  119|   219k|  WORD32 res_bits;
  120|   219k|  UWORD32 coeff;
  121|   219k|  WORD32 w;
  122|       |
  123|   219k|  if (window_sequence == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   219k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (123:7): [True: 26.6k, False: 193k]
  ------------------
  124|  26.6k|    num_windows = MAX_SHORT_WINDOWS;
  ------------------
  |  |   52|  26.6k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  125|  26.6k|    len_tns_nfilt = 1;
  126|  26.6k|    len_tns_length = 4;
  127|  26.6k|    len_tns_order = 3;
  128|   193k|  } else {
  129|   193k|    num_windows = 1;
  130|   193k|    len_tns_nfilt = 2;
  131|   193k|    len_tns_length = 6;
  132|   193k|    len_tns_order = 4;
  133|   193k|  }
  134|   219k|  if (core_mode == 1) {
  ------------------
  |  Branch (134:7): [True: 0, False: 219k]
  ------------------
  135|      0|    num_windows = 1;
  136|      0|  }
  137|       |
  138|   626k|  for (w = 0; w < num_windows; w++) {
  ------------------
  |  Branch (138:15): [True: 406k, False: 219k]
  ------------------
  139|   406k|    ia_tns_window_data *ptr_win_data = &pstr_tns_info->window_data[w];
  140|   406k|    WORD32 n_filt = ptr_win_data->n_filt;
  141|   406k|    if (write_flag) {
  ------------------
  |  Branch (141:9): [True: 201k, False: 205k]
  ------------------
  142|   201k|      iusace_write_bits_buf(it_bit_buf, n_filt, (UWORD8)len_tns_nfilt);
  143|   201k|    }
  144|   406k|    bit_count += len_tns_nfilt;
  145|   406k|    if (n_filt) {
  ------------------
  |  Branch (145:9): [True: 320k, False: 86.2k]
  ------------------
  146|   320k|      res_bits = ptr_win_data->coef_res;
  147|   320k|      if (write_flag) {
  ------------------
  |  Branch (147:11): [True: 158k, False: 162k]
  ------------------
  148|   158k|        iusace_write_bits_buf(it_bit_buf, res_bits - DEF_TNS_RES_OFFSET, 1);
  ------------------
  |  |   30|   158k|#define DEF_TNS_RES_OFFSET 3
  ------------------
  149|   158k|      }
  150|   320k|      bit_count += 1;
  151|   640k|      for (filt = 0; filt < n_filt; filt++) {
  ------------------
  |  Branch (151:22): [True: 320k, False: 320k]
  ------------------
  152|   320k|        ia_tns_filter_data *ptr_tns_filt = &ptr_win_data->tns_filter[filt];
  153|   320k|        WORD32 order = ptr_tns_filt->order;
  154|   320k|        if (write_flag) {
  ------------------
  |  Branch (154:13): [True: 158k, False: 162k]
  ------------------
  155|   158k|          iusace_write_bits_buf(it_bit_buf, ptr_tns_filt->length, (UWORD8)len_tns_length);
  156|   158k|          iusace_write_bits_buf(it_bit_buf, order, (UWORD8)len_tns_order);
  157|   158k|        }
  158|   320k|        bit_count += (len_tns_length + len_tns_order);
  159|   320k|        if (order) {
  ------------------
  |  Branch (159:13): [True: 319k, False: 1.36k]
  ------------------
  160|   319k|          WORD32 i;
  161|   319k|          if (write_flag) {
  ------------------
  |  Branch (161:15): [True: 157k, False: 161k]
  ------------------
  162|   157k|            iusace_write_bits_buf(it_bit_buf, ptr_tns_filt->direction, 1);
  163|   157k|            iusace_write_bits_buf(it_bit_buf, ptr_tns_filt->coef_compress, 1);
  164|   157k|          }
  165|   319k|          bit_count += 2;
  166|  2.42M|          for (i = 1; i <= order; i++) {
  ------------------
  |  Branch (166:23): [True: 2.10M, False: 319k]
  ------------------
  167|  2.10M|            if (write_flag) {
  ------------------
  |  Branch (167:17): [True: 1.03M, False: 1.07M]
  ------------------
  168|  1.03M|              coeff = (UWORD32)(ptr_tns_filt->index[i]) & ((1 << res_bits) - 1);
  169|  1.03M|              iusace_write_bits_buf(it_bit_buf, coeff, (UWORD8)res_bits);
  170|  1.03M|            }
  171|  2.10M|            bit_count += res_bits;
  172|  2.10M|          }
  173|   319k|        }
  174|   320k|      }
  175|   320k|    }
  176|   406k|  }
  177|       |
  178|   219k|  return bit_count;
  179|   219k|}
iusace_write_ics_info:
  204|   233k|                             WORD32 ch) {
  205|   233k|  WORD32 write_flag = (it_bit_buf != NULL);
  206|   233k|  WORD32 bit_count = 0;
  207|   233k|  WORD32 win_seq = 0;
  208|   233k|  WORD32 grouping_bits = 0;
  209|   233k|  WORD32 max_sfb = pstr_sfb_prms->max_sfb[ch];
  210|   233k|  WORD32 window_sequence = pstr_sfb_prms->window_sequence[ch];
  211|   233k|  WORD32 window_shape = pstr_sfb_prms->window_shape[ch];
  212|   233k|  WORD32 num_win_grps = pstr_sfb_prms->num_window_groups[ch];
  213|       |
  214|   233k|  switch (window_sequence) {
  215|  74.3k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|  74.3k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (215:5): [True: 74.3k, False: 159k]
  ------------------
  216|  74.3k|      win_seq = 2;
  217|  74.3k|      break;
  218|   110k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|   110k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (218:5): [True: 110k, False: 123k]
  ------------------
  219|   110k|      win_seq = 0;
  220|   110k|      break;
  221|  26.3k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   46|  26.3k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (221:5): [True: 26.3k, False: 207k]
  ------------------
  222|  26.5k|    case STOP_START_SEQUENCE:
  ------------------
  |  |   49|  26.5k|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (222:5): [True: 153, False: 233k]
  ------------------
  223|  26.5k|      win_seq = 1;
  224|  26.5k|      break;
  225|  23.0k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|  23.0k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (225:5): [True: 23.0k, False: 210k]
  ------------------
  226|  23.0k|      win_seq = 3;
  227|  23.0k|      break;
  228|      0|    default:
  ------------------
  |  Branch (228:5): [True: 0, False: 233k]
  ------------------
  229|      0|      win_seq = 3;
  230|      0|      break;
  231|   233k|  }
  232|   233k|  if (write_flag) iusace_write_bits_buf(it_bit_buf, win_seq, 2);
  ------------------
  |  Branch (232:7): [True: 233k, False: 0]
  ------------------
  233|   233k|  bit_count += 2;
  234|       |
  235|   233k|  if (write_flag) iusace_write_bits_buf(it_bit_buf, window_shape, 1);
  ------------------
  |  Branch (235:7): [True: 233k, False: 0]
  ------------------
  236|   233k|  bit_count += 1;
  237|       |
  238|   233k|  if (window_sequence == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   233k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (238:7): [True: 74.3k, False: 159k]
  ------------------
  239|  74.3k|    if (write_flag) iusace_write_bits_buf(it_bit_buf, max_sfb, 4);
  ------------------
  |  Branch (239:9): [True: 74.3k, False: 0]
  ------------------
  240|  74.3k|    bit_count += 4;
  241|       |
  242|  74.3k|    grouping_bits =
  243|  74.3k|        iusace_calc_grouping_bits(pstr_sfb_prms->window_group_length[ch], num_win_grps);
  244|  74.3k|    if (write_flag) iusace_write_bits_buf(it_bit_buf, grouping_bits, 7);
  ------------------
  |  Branch (244:9): [True: 74.3k, False: 0]
  ------------------
  245|  74.3k|    bit_count += 7;
  246|   159k|  } else {
  247|   159k|    if (write_flag) iusace_write_bits_buf(it_bit_buf, max_sfb, 6);
  ------------------
  |  Branch (247:9): [True: 159k, False: 0]
  ------------------
  248|   159k|    bit_count += 6;
  249|   159k|  }
  250|       |
  251|   233k|  return (bit_count);
  252|   233k|}
iusace_write_cplx_pred_data:
  262|  26.0k|                                   WORD32 *ptr_prev_alpha_coeff_im, WORD32 *delta_code_time) {
  263|  26.0k|  WORD32 write_flag = (it_bit_buf != NULL);
  264|  26.0k|  WORD32 bit_count = 0;
  265|  26.0k|  WORD32 i, j;
  266|  26.0k|  WORD32 g;
  267|  26.0k|  WORD32 sfb;
  268|  26.0k|  const WORD32 sfb_per_pred_band = 2;
  269|  26.0k|  WORD32 length_temp1_re[MAX_SHORT_WINDOWS][MAX_SFB_LONG],
  270|  26.0k|      length_temp2_re[MAX_SHORT_WINDOWS][MAX_SFB_LONG],
  271|  26.0k|      length_temp1_im[MAX_SHORT_WINDOWS][MAX_SFB_LONG],
  272|  26.0k|      length_temp2_im[MAX_SHORT_WINDOWS][MAX_SFB_LONG];
  273|  26.0k|  WORD32 code_word_temp1_re[MAX_SHORT_WINDOWS][MAX_SFB_LONG],
  274|  26.0k|      code_word_temp2_re[MAX_SHORT_WINDOWS][MAX_SFB_LONG],
  275|  26.0k|      code_word_temp1_im[MAX_SHORT_WINDOWS][MAX_SFB_LONG],
  276|  26.0k|      code_word_temp2_im[MAX_SHORT_WINDOWS][MAX_SFB_LONG];
  277|  26.0k|  WORD32 length_tot1 = 0, length_tot2 = 0;
  278|       |
  279|  26.0k|  if (write_flag) iusace_write_bits_buf(it_bit_buf, cplx_pred_all, 1);
  ------------------
  |  Branch (279:7): [True: 9.86k, False: 16.2k]
  ------------------
  280|  26.0k|  bit_count += 1;
  281|       |
  282|  26.0k|  if (cplx_pred_all == 0) {
  ------------------
  |  Branch (282:7): [True: 0, False: 26.0k]
  ------------------
  283|      0|    for (g = 0; g < num_win_grps; g++) {
  ------------------
  |  Branch (283:17): [True: 0, False: 0]
  ------------------
  284|      0|      for (sfb = 0; sfb < num_sfb; sfb += sfb_per_pred_band) {
  ------------------
  |  Branch (284:21): [True: 0, False: 0]
  ------------------
  285|      0|        iusace_write_bits_buf(it_bit_buf, cplx_pred_used[g][sfb], 1);
  286|      0|        bit_count += 1;
  287|      0|      }
  288|      0|    }
  289|      0|  }
  290|       |
  291|  26.0k|  if (write_flag) iusace_write_bits_buf(it_bit_buf, pred_dir, 1);
  ------------------
  |  Branch (291:7): [True: 9.86k, False: 16.2k]
  ------------------
  292|  26.0k|  bit_count += 1;
  293|       |
  294|  26.0k|  if (write_flag) iusace_write_bits_buf(it_bit_buf, complex_coef, 1);
  ------------------
  |  Branch (294:7): [True: 9.86k, False: 16.2k]
  ------------------
  295|  26.0k|  bit_count += 1;
  296|       |
  297|  26.0k|  if (complex_coef) {
  ------------------
  |  Branch (297:7): [True: 94, False: 26.0k]
  ------------------
  298|     94|    if (!usac_independency_flg) {
  ------------------
  |  Branch (298:9): [True: 84, False: 10]
  ------------------
  299|     84|      if (write_flag) iusace_write_bits_buf(it_bit_buf, 1, 1); /* use_prev_frame */
  ------------------
  |  Branch (299:11): [True: 38, False: 46]
  ------------------
  300|     84|      bit_count += 1;
  301|     84|    }
  302|     94|  }
  303|       |
  304|  26.0k|  if (usac_independency_flg) {
  ------------------
  |  Branch (304:7): [True: 636, False: 25.4k]
  ------------------
  305|    636|    *delta_code_time = 0;
  306|    636|  }
  307|       |
  308|       |  /* Switching mechanism for delta_code_time */
  309|  26.0k|  WORD32 prev_pred_coeff_re_temp1 = 0, prev_pred_coeff_re_temp2 = 0;
  310|  26.0k|  WORD32 diff_pred_coeff_re_temp1 = 0, diff_pred_coeff_re_temp2 = 0;
  311|  26.0k|  WORD32 prev_pred_coeff_im_temp1 = 0, prev_pred_coeff_im_temp2 = 0;
  312|  26.0k|  WORD32 diff_pred_coeff_im_temp1 = 0, diff_pred_coeff_im_temp2 = 0;
  313|       |
  314|  92.0k|  for (i = 0; i < num_win_grps; i++) {
  ------------------
  |  Branch (314:15): [True: 66.0k, False: 26.0k]
  ------------------
  315|       |    /* delta_code_time = 0*/
  316|  66.0k|    prev_pred_coeff_re_temp1 = 0;
  317|  66.0k|    if (complex_coef == 1) {
  ------------------
  |  Branch (317:9): [True: 250, False: 65.7k]
  ------------------
  318|    250|      prev_pred_coeff_im_temp1 = 0;
  319|    250|    }
  320|       |
  321|   521k|    for (j = 0; j < num_sfb; j += 2) {
  ------------------
  |  Branch (321:17): [True: 455k, False: 66.0k]
  ------------------
  322|   455k|      if (!usac_independency_flg) {
  ------------------
  |  Branch (322:11): [True: 439k, False: 15.8k]
  ------------------
  323|       |        /* delta_code_time = 1*/
  324|   439k|        if (i > 0) {
  ------------------
  |  Branch (324:13): [True: 181k, False: 258k]
  ------------------
  325|   181k|          prev_pred_coeff_re_temp2 = pred_coeffs_re[i - 1][j];
  326|   181k|          if (complex_coef == 1) {
  ------------------
  |  Branch (326:15): [True: 894, False: 180k]
  ------------------
  327|    894|            prev_pred_coeff_im_temp2 = pred_coeffs_im[i - 1][j];
  328|    894|          }
  329|   258k|        } else {
  330|   258k|          prev_pred_coeff_re_temp2 = ptr_prev_alpha_coeff_re[j];
  331|   258k|          if (complex_coef == 1) {
  ------------------
  |  Branch (331:15): [True: 1.18k, False: 256k]
  ------------------
  332|  1.18k|            prev_pred_coeff_im_temp2 = ptr_prev_alpha_coeff_im[j];
  333|  1.18k|          }
  334|   258k|        }
  335|   439k|      }
  336|       |
  337|   455k|      if (cplx_pred_used[i][j] == 1) {
  ------------------
  |  Branch (337:11): [True: 455k, False: 0]
  ------------------
  338|       |        /*Differential Huffman coding of real prediction coefficients*/
  339|   455k|        diff_pred_coeff_re_temp1 =
  340|   455k|            pred_coeffs_re[i][j] - prev_pred_coeff_re_temp1; /* delta_code_time = 0 */
  341|   455k|        prev_pred_coeff_re_temp1 = pred_coeffs_re[i][j];     /* delta_code_time = 0 */
  342|   455k|        if (!usac_independency_flg) {
  ------------------
  |  Branch (342:13): [True: 439k, False: 15.8k]
  ------------------
  343|   439k|          diff_pred_coeff_re_temp2 =
  344|   439k|              pred_coeffs_re[i][j] - prev_pred_coeff_re_temp2; /* delta_code_time = 1 */
  345|   439k|        }
  346|       |
  347|       |        /* delta_code_time = 0 */
  348|   455k|        length_temp1_re[i][j] = huff_tab[diff_pred_coeff_re_temp1 + 60][0];
  349|   455k|        code_word_temp1_re[i][j] = huff_tab[diff_pred_coeff_re_temp1 + 60][1];
  350|       |
  351|   455k|        length_tot1 += length_temp1_re[i][j];
  352|       |
  353|   455k|        if (!usac_independency_flg) {
  ------------------
  |  Branch (353:13): [True: 439k, False: 15.8k]
  ------------------
  354|       |          /*delta_code_time = 1 */
  355|   439k|          length_temp2_re[i][j] = huff_tab[diff_pred_coeff_re_temp2 + 60][0];
  356|   439k|          code_word_temp2_re[i][j] = huff_tab[diff_pred_coeff_re_temp2 + 60][1];
  357|       |
  358|   439k|          length_tot2 += length_temp2_re[i][j];
  359|   439k|        }
  360|       |
  361|   455k|        if (complex_coef == 1) {
  ------------------
  |  Branch (361:13): [True: 2.39k, False: 453k]
  ------------------
  362|       |          /*Differential Huffman coding of imaginary prediction coefficients*/
  363|  2.39k|          diff_pred_coeff_im_temp1 =
  364|  2.39k|              pred_coeffs_im[i][j] - prev_pred_coeff_im_temp1; /* delta_code_time = 0 */
  365|  2.39k|          prev_pred_coeff_im_temp1 = pred_coeffs_im[i][j];     /* delta_code_time = 0*/
  366|       |
  367|  2.39k|          if (!usac_independency_flg) {
  ------------------
  |  Branch (367:15): [True: 2.07k, False: 320]
  ------------------
  368|  2.07k|            diff_pred_coeff_im_temp2 =
  369|  2.07k|                pred_coeffs_im[i][j] - prev_pred_coeff_im_temp2; /* delta_code_time = 1 */
  370|  2.07k|          }
  371|       |
  372|       |          /*delta_code_time = 0*/
  373|  2.39k|          length_temp1_im[i][j] = huff_tab[diff_pred_coeff_im_temp1 + 60][0];
  374|  2.39k|          code_word_temp1_im[i][j] = huff_tab[diff_pred_coeff_im_temp1 + 60][1];
  375|       |
  376|  2.39k|          length_tot1 += length_temp1_im[i][j];
  377|       |
  378|  2.39k|          if (!usac_independency_flg) {
  ------------------
  |  Branch (378:15): [True: 2.07k, False: 320]
  ------------------
  379|       |            /*delta_code_time = 1*/
  380|  2.07k|            length_temp2_im[i][j] = huff_tab[diff_pred_coeff_im_temp2 + 60][0];
  381|  2.07k|            code_word_temp2_im[i][j] = huff_tab[diff_pred_coeff_im_temp2 + 60][1];
  382|       |
  383|  2.07k|            length_tot2 += length_temp2_im[i][j];
  384|  2.07k|          }
  385|  2.39k|        }
  386|   455k|      } else {
  387|      0|        pred_coeffs_re[i][j] = 0;
  388|       |        /*delta_code_time = 0*/
  389|      0|        prev_pred_coeff_re_temp1 = pred_coeffs_re[i][j];
  390|      0|        if (complex_coef == 1) {
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|          pred_coeffs_im[i][j] = 0;
  392|       |          /*delta_code_time = 0*/
  393|      0|          prev_pred_coeff_im_temp1 = pred_coeffs_im[i][j];
  394|      0|        }
  395|      0|      }
  396|       |
  397|   455k|      ptr_prev_alpha_coeff_re[j] = pred_coeffs_re[i][j];
  398|   455k|      if (complex_coef == 1) {
  ------------------
  |  Branch (398:11): [True: 2.39k, False: 453k]
  ------------------
  399|  2.39k|        ptr_prev_alpha_coeff_im[j] = pred_coeffs_im[i][j];
  400|  2.39k|      }
  401|   455k|    }
  402|       |
  403|  2.53M|    for (j = num_sfb; j < MAX_SFB_LONG; j++) {
  ------------------
  |  |   53|  2.53M|#define MAX_SFB_LONG 51
  ------------------
  |  Branch (403:23): [True: 2.47M, False: 66.0k]
  ------------------
  404|  2.47M|      pred_coeffs_re[i][j] = 0;
  405|  2.47M|      ptr_prev_alpha_coeff_re[j] = 0;
  406|  2.47M|      if (complex_coef == 1) {
  ------------------
  |  Branch (406:11): [True: 8.13k, False: 2.46M]
  ------------------
  407|  8.13k|        pred_coeffs_im[i][j] = 0;
  408|  8.13k|        ptr_prev_alpha_coeff_im[j] = 0;
  409|  8.13k|      }
  410|  2.47M|    }
  411|  66.0k|  }
  412|       |
  413|       |  /*Make a decison on the value of delta_code_time per frame */
  414|  26.0k|  if (!usac_independency_flg) {
  ------------------
  |  Branch (414:7): [True: 25.4k, False: 636]
  ------------------
  415|       |    // Compare the code-word lengths
  416|  25.4k|    if (length_tot1 <= length_tot2) {
  ------------------
  |  Branch (416:9): [True: 13.3k, False: 12.1k]
  ------------------
  417|  13.3k|      *delta_code_time = 0;
  418|  13.3k|    } else {
  419|  12.1k|      *delta_code_time = 1;
  420|  12.1k|    }
  421|       |
  422|       |    /* Write the value of delta_code_time to bitstream */
  423|  25.4k|    if (write_flag) iusace_write_bits_buf(it_bit_buf, *delta_code_time, 1);
  ------------------
  |  Branch (423:9): [True: 9.55k, False: 15.9k]
  ------------------
  424|  25.4k|    bit_count += 1;
  425|  25.4k|  }
  426|       |
  427|  26.0k|  if (*delta_code_time == 0) {
  ------------------
  |  Branch (427:7): [True: 13.9k, False: 12.1k]
  ------------------
  428|  52.5k|    for (i = 0; i < num_win_grps; i++) {
  ------------------
  |  Branch (428:17): [True: 38.5k, False: 13.9k]
  ------------------
  429|   313k|      for (j = 0; j < num_sfb; j += 2) {
  ------------------
  |  Branch (429:19): [True: 275k, False: 38.5k]
  ------------------
  430|   275k|        if (cplx_pred_used[i][j] == 1) {
  ------------------
  |  Branch (430:13): [True: 275k, False: 0]
  ------------------
  431|   275k|          if (write_flag)
  ------------------
  |  Branch (431:15): [True: 107k, False: 168k]
  ------------------
  432|   107k|            iusace_write_bits_buf(it_bit_buf, code_word_temp1_re[i][j],
  433|   107k|                                  (UWORD8)length_temp1_re[i][j]);
  434|   275k|          bit_count += length_temp1_re[i][j];
  435|       |
  436|   275k|          if (complex_coef == 1) {
  ------------------
  |  Branch (436:15): [True: 1.92k, False: 273k]
  ------------------
  437|  1.92k|            if (write_flag)
  ------------------
  |  Branch (437:17): [True: 876, False: 1.04k]
  ------------------
  438|    876|              iusace_write_bits_buf(it_bit_buf, code_word_temp1_im[i][j],
  439|    876|                                    (UWORD8)length_temp1_im[i][j]);
  440|  1.92k|            bit_count += length_temp1_im[i][j];
  441|  1.92k|          }
  442|   275k|        }
  443|   275k|      }
  444|  38.5k|    }
  445|  13.9k|  } else {
  446|  39.5k|    for (i = 0; i < num_win_grps; i++) {
  ------------------
  |  Branch (446:17): [True: 27.4k, False: 12.1k]
  ------------------
  447|   207k|      for (j = 0; j < num_sfb; j += 2) {
  ------------------
  |  Branch (447:19): [True: 180k, False: 27.4k]
  ------------------
  448|   180k|        if (cplx_pred_used[i][j] == 1) {
  ------------------
  |  Branch (448:13): [True: 180k, False: 0]
  ------------------
  449|   180k|          if (write_flag)
  ------------------
  |  Branch (449:15): [True: 69.3k, False: 110k]
  ------------------
  450|  69.3k|            iusace_write_bits_buf(it_bit_buf, code_word_temp2_re[i][j],
  451|  69.3k|                                  (UWORD8)length_temp2_re[i][j]);
  452|   180k|          bit_count += length_temp2_re[i][j];
  453|       |
  454|   180k|          if (complex_coef == 1) {
  ------------------
  |  Branch (454:15): [True: 476, False: 179k]
  ------------------
  455|    476|            if (write_flag)
  ------------------
  |  Branch (455:17): [True: 226, False: 250]
  ------------------
  456|    226|              iusace_write_bits_buf(it_bit_buf, code_word_temp2_im[i][j],
  457|    226|                                    (UWORD8)length_temp2_im[i][j]);
  458|    476|            bit_count += length_temp2_im[i][j];
  459|    476|          }
  460|   180k|        }
  461|   180k|      }
  462|  27.4k|    }
  463|  12.1k|  }
  464|       |
  465|  26.0k|  return bit_count;
  466|  26.0k|}
iusace_write_cpe:
  471|   182k|                        ia_usac_data_struct *pstr_usac_data, WORD32 ch) {
  472|   182k|  WORD32 bit_count = 0;
  473|   182k|  WORD32 ms_mask = pstr_usac_data->str_ms_info[ch].ms_mask;
  474|   182k|  WORD32 common_max_sfb = 1;
  475|   182k|  WORD32 tns_active = tns_data_present[0] || tns_data_present[1];
  ------------------
  |  Branch (475:23): [True: 52.3k, False: 130k]
  |  Branch (475:46): [True: 3.38k, False: 126k]
  ------------------
  476|   182k|  ia_tns_info *pstr_tns_info = pstr_usac_data->pstr_tns_info[ch];
  477|   182k|  (VOID) pstr_usac_config;
  478|       |
  479|   182k|  iusace_write_bits_buf(it_bit_buf, tns_active, 1);
  480|   182k|  bit_count += 1;
  481|       |
  482|   182k|  iusace_write_bits_buf(it_bit_buf, pstr_sfb_prms->common_win[ch], 1);
  483|   182k|  bit_count += 1;
  484|       |
  485|   182k|  if (pstr_sfb_prms->max_sfb[ch] != pstr_sfb_prms->max_sfb[ch + 1]) {
  ------------------
  |  Branch (485:7): [True: 1.35k, False: 181k]
  ------------------
  486|  1.35k|    common_max_sfb = 0;
  487|  1.35k|  }
  488|       |
  489|   182k|  if (pstr_sfb_prms->common_win[ch]) {
  ------------------
  |  Branch (489:7): [True: 182k, False: 0]
  ------------------
  490|   182k|    bit_count += iusace_write_ics_info(it_bit_buf, pstr_sfb_prms, ch);
  491|       |
  492|   182k|    iusace_write_bits_buf(it_bit_buf, common_max_sfb, 1);
  493|   182k|    bit_count += 1;
  494|       |
  495|   182k|    if (common_max_sfb == 0) {
  ------------------
  |  Branch (495:9): [True: 1.35k, False: 181k]
  ------------------
  496|  1.35k|      if (pstr_sfb_prms->window_sequence[ch] != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|  1.35k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (496:11): [True: 650, False: 704]
  ------------------
  497|    650|        iusace_write_bits_buf(it_bit_buf, pstr_sfb_prms->max_sfb[ch + 1], 6);
  498|    650|        bit_count += 6;
  499|    704|      } else {
  500|    704|        iusace_write_bits_buf(it_bit_buf, pstr_sfb_prms->max_sfb[ch + 1], 4);
  501|    704|        bit_count += 4;
  502|    704|      }
  503|  1.35k|    }
  504|       |
  505|   182k|    pstr_sfb_prms->max_sfb_ste = MAX(pstr_sfb_prms->max_sfb[ch], pstr_sfb_prms->max_sfb[ch + 1]);
  ------------------
  |  |   89|   182k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 734, False: 181k]
  |  |  ------------------
  ------------------
  506|       |
  507|   182k|    bit_count +=
  508|   182k|        iusace_write_ms_data(it_bit_buf, ms_mask, pstr_usac_data->str_ms_info[ch].ms_used,
  509|   182k|                             pstr_sfb_prms->num_window_groups[ch], pstr_sfb_prms->max_sfb_ste);
  510|       |
  511|   182k|    {
  512|   182k|      if ((ms_mask == 3) && (pstr_usac_data->stereo_config_index == 0)) {
  ------------------
  |  Branch (512:11): [True: 10.6k, False: 171k]
  |  Branch (512:29): [True: 9.86k, False: 807]
  ------------------
  513|  9.86k|        bit_count += iusace_write_cplx_pred_data(
  514|  9.86k|            it_bit_buf, pstr_sfb_prms->num_window_groups[ch], pstr_sfb_prms->max_sfb_ste,
  515|  9.86k|            pstr_usac_data->complex_coef[ch], pstr_usac_data->pred_coef_re[ch],
  516|  9.86k|            pstr_usac_data->pred_coef_im[ch], iusace_huffman_code_table, usac_independency_flg,
  517|  9.86k|            pstr_usac_data->pred_dir_idx[ch], pstr_usac_data->cplx_pred_used[ch],
  518|  9.86k|            pstr_usac_data->cplx_pred_all[ch], pstr_usac_data->pred_coef_re_prev[ch],
  519|  9.86k|            pstr_usac_data->pred_coef_im_prev[ch], &pstr_usac_data->delta_code_time[ch]);
  520|  9.86k|      }
  521|   182k|    }
  522|   182k|  }
  523|       |
  524|   182k|  if (tns_active) {
  ------------------
  |  Branch (524:7): [True: 55.7k, False: 126k]
  ------------------
  525|  55.7k|    WORD32 common_tns = 0;
  526|  55.7k|    WORD32 tns_on_lr = 1;
  527|  55.7k|    WORD32 tns_present_both = tns_data_present[0] && tns_data_present[1];
  ------------------
  |  Branch (527:31): [True: 52.3k, False: 3.38k]
  |  Branch (527:54): [True: 43.8k, False: 8.58k]
  ------------------
  528|  55.7k|    WORD32 tns_data_present1 = tns_data_present[1];
  529|       |
  530|  55.7k|    if (pstr_sfb_prms->common_win[ch]) {
  ------------------
  |  Branch (530:9): [True: 55.7k, False: 0]
  ------------------
  531|  55.7k|      iusace_write_bits_buf(it_bit_buf, common_tns, 1);
  532|  55.7k|      bit_count += 1;
  533|  55.7k|    }
  534|       |
  535|  55.7k|    iusace_write_bits_buf(it_bit_buf, tns_on_lr, 1);
  536|  55.7k|    bit_count += 1;
  537|       |
  538|  55.7k|    if (common_tns) {
  ------------------
  |  Branch (538:9): [True: 0, False: 55.7k]
  ------------------
  539|      0|      bit_count +=
  540|      0|          iusace_write_tns_data(it_bit_buf, pstr_tns_info, pstr_sfb_prms->window_sequence[ch], 0);
  541|  55.7k|    } else {
  542|  55.7k|      iusace_write_bits_buf(it_bit_buf, tns_present_both, 1);
  543|  55.7k|      bit_count += 1;
  544|       |
  545|  55.7k|      if (!tns_present_both) {
  ------------------
  |  Branch (545:11): [True: 11.9k, False: 43.8k]
  ------------------
  546|  11.9k|        iusace_write_bits_buf(it_bit_buf, tns_data_present1, 1);
  547|  11.9k|        bit_count += 1;
  548|  11.9k|      }
  549|  55.7k|    }
  550|  55.7k|  }
  551|       |
  552|   182k|  return (bit_count);
  553|   182k|}
iusace_write_fd_data:
  559|   416k|                            WORD32 ele_id, WORD32 idx) {
  560|   416k|  WORD32 bit_count = 0;
  561|   416k|  WORD32 fac_data_present = (num_fac_bits > 0) ? 1 : 0;
  ------------------
  |  Branch (561:29): [True: 1.75k, False: 414k]
  ------------------
  562|   416k|  WORD16 *ptr_fac_data = pstr_usac_data->fac_out_stream[ch_idx];
  563|       |
  564|   416k|  WORD32 is_noise_filling = pstr_usac_data->noise_filling[ele_id];
  565|   416k|  WORD32 common_window = pstr_sfb_prms->common_win[ch_idx];
  566|   416k|  ia_usac_quant_info_struct *pstr_quant_info = &(pstr_usac_data->str_quant_info[idx]);
  567|   416k|  ia_tns_info *pstr_tns_info = pstr_usac_data->pstr_tns_info[ch_idx];
  568|   416k|  WORD32 global_gain = pstr_usac_data->str_quant_info[idx].scale_factor[0];
  569|       |
  570|   416k|  iusace_write_bits_buf(it_bit_buf, global_gain, 8);
  571|   416k|  bit_count += 8;
  572|       |
  573|   416k|  if (is_noise_filling) {
  ------------------
  |  Branch (573:7): [True: 210k, False: 205k]
  ------------------
  574|   210k|    iusace_write_bits_buf(it_bit_buf, pstr_usac_data->noise_level[idx], 3);
  575|       |
  576|   210k|    iusace_write_bits_buf(it_bit_buf, pstr_usac_data->noise_offset[idx], 5);
  577|   210k|    bit_count += 8;
  578|   210k|  }
  579|       |
  580|   416k|  if (!common_window) {
  ------------------
  |  Branch (580:7): [True: 51.3k, False: 365k]
  ------------------
  581|  51.3k|    bit_count += iusace_write_ics_info(it_bit_buf, pstr_sfb_prms, ch_idx);
  582|  51.3k|  }
  583|       |
  584|   416k|  bit_count += iusace_write_scf_data(
  585|   416k|      it_bit_buf, pstr_sfb_prms->max_sfb[ch_idx], pstr_sfb_prms->num_sfb[ch_idx],
  586|   416k|      pstr_quant_info->scale_factor, pstr_sfb_prms->num_window_groups[ch_idx], global_gain,
  587|   416k|      iusace_huffman_code_table);
  588|       |
  589|   416k|  if (pstr_tns_info != NULL && pstr_tns_info->tns_data_present == 1) {
  ------------------
  |  Branch (589:7): [True: 204k, False: 212k]
  |  Branch (589:32): [True: 107k, False: 96.4k]
  ------------------
  590|   107k|    bit_count += iusace_write_tns_data(it_bit_buf, pstr_tns_info,
  591|   107k|                                       pstr_sfb_prms->window_sequence[ch_idx], 0);
  592|   107k|  }
  593|       |
  594|   416k|  if (!usac_independency_flg) {
  ------------------
  |  Branch (594:7): [True: 396k, False: 20.5k]
  ------------------
  595|   396k|    iusace_write_bits_buf(it_bit_buf, pstr_quant_info->reset, 1);
  596|   396k|    bit_count += 1;
  597|   396k|  }
  598|       |
  599|   416k|  if (pstr_quant_info->max_spec_coeffs == FRAME_LEN_SHORT_768) {
  ------------------
  |  |   55|   416k|#define FRAME_LEN_SHORT_768 (96)
  ------------------
  |  Branch (599:7): [True: 5.16k, False: 411k]
  ------------------
  600|  5.16k|    pstr_quant_info->max_spec_coeffs = pstr_quant_info->max_spec_coeffs;
  601|  5.16k|  }
  602|   416k|  bit_count += iusace_arith_enc_spec(
  603|   416k|      it_bit_buf, pstr_sfb_prms->window_sequence[ch_idx], pstr_quant_info->quant_degroup,
  604|   416k|      pstr_quant_info->max_spec_coeffs, pstr_quant_info->c_pres, pstr_quant_info->c_prev,
  605|   416k|      &(pstr_quant_info->arith_size_prev), usac_independency_flg || pstr_quant_info->reset,
  ------------------
  |  Branch (605:44): [True: 20.5k, False: 396k]
  |  Branch (605:69): [True: 396k, False: 0]
  ------------------
  606|   416k|      pstr_usac_config->ccfl);
  607|       |
  608|   416k|  iusace_write_bits_buf(it_bit_buf, fac_data_present, 1);
  609|   416k|  bit_count += 1;
  610|       |
  611|   416k|  if (fac_data_present) {
  ------------------
  |  Branch (611:7): [True: 1.75k, False: 414k]
  ------------------
  612|  1.75k|    WORD32 i;
  613|  40.2k|    for (i = 0; i < num_fac_bits; i += 8) {
  ------------------
  |  Branch (613:17): [True: 38.4k, False: 1.75k]
  ------------------
  614|  38.4k|      WORD32 bits_to_write = MIN(8, num_fac_bits - i);
  ------------------
  |  |   86|  38.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 36.7k, False: 1.75k]
  |  |  ------------------
  ------------------
  615|  38.4k|      iusace_write_bits_buf(it_bit_buf, ptr_fac_data[i / 8] >> (8 - bits_to_write),
  616|  38.4k|                            (UWORD8)bits_to_write);
  617|  38.4k|    }
  618|  1.75k|    bit_count += num_fac_bits;
  619|  1.75k|  }
  620|       |
  621|   416k|  return (bit_count);
  622|   416k|}
iusace_count_fd_bits:
  627|   529k|                            WORD32 idx) {
  628|   529k|  WORD32 bit_count = 0;
  629|   529k|  ia_usac_quant_info_struct *pstr_quant_info = &pstr_usac_data->str_quant_info[idx];
  630|   529k|  WORD32 window_sequence = pstr_sfb_prms->window_sequence[ch_idx];
  631|   529k|  WORD32 global_gain = pstr_quant_info->scale_factor[0];
  632|   529k|  WORD32 max_sfb = pstr_sfb_prms->max_sfb[ch_idx];
  633|   529k|  WORD32 num_sfb = pstr_sfb_prms->num_sfb[ch_idx];
  634|   529k|  WORD32 num_win_grps = pstr_sfb_prms->num_window_groups[ch_idx];
  635|       |
  636|   529k|  bit_count += iusace_write_scf_data(NULL, max_sfb, num_sfb, pstr_quant_info->scale_factor,
  637|   529k|                                     num_win_grps, global_gain, iusace_huffman_code_table);
  638|       |
  639|   529k|  WORD32 temp_c_pres[516], temp_c_prev[516], temp_size = pstr_quant_info->arith_size_prev;
  640|   529k|  memcpy(temp_c_pres, pstr_quant_info->c_pres, 516 * sizeof(pstr_quant_info->c_pres[0]));
  641|   529k|  memcpy(temp_c_prev, pstr_quant_info->c_prev, 516 * sizeof(pstr_quant_info->c_prev[0]));
  642|   529k|  bit_count += iusace_arith_enc_spec(
  643|   529k|      NULL, window_sequence, pstr_quant_info->quant_degroup, pstr_quant_info->max_spec_coeffs,
  644|   529k|      temp_c_pres, temp_c_prev, &(temp_size), usac_independency_flg || pstr_quant_info->reset,
  ------------------
  |  Branch (644:47): [True: 20.5k, False: 509k]
  |  Branch (644:72): [True: 509k, False: 0]
  ------------------
  645|   529k|      pstr_usac_config->ccfl);
  646|       |
  647|   529k|  return (bit_count);
  648|   529k|}
iusace_write_fill_ele:
  650|   330k|WORD32 iusace_write_fill_ele(ia_bit_buf_struct *it_bit_buf, WORD32 num_bits) {
  651|   330k|  WORD32 write_flag = (it_bit_buf != NULL);
  652|   330k|  WORD32 bit_count = 0;
  653|       |
  654|   330k|  if (num_bits <= 8) {
  ------------------
  |  Branch (654:7): [True: 114k, False: 216k]
  ------------------
  655|   114k|    if (write_flag) {
  ------------------
  |  Branch (655:9): [True: 114k, False: 0]
  ------------------
  656|   114k|      iusace_write_bits_buf(it_bit_buf, 0, 1);
  657|   114k|    }
  658|   114k|    bit_count++;
  659|   114k|    num_bits--;
  660|   216k|  } else {
  661|   216k|    if (write_flag) {
  ------------------
  |  Branch (661:9): [True: 216k, False: 0]
  ------------------
  662|   216k|      iusace_write_bits_buf(it_bit_buf, 1, 1);
  663|   216k|    }
  664|   216k|    bit_count++;
  665|   216k|    num_bits--;
  666|       |
  667|   216k|    if (num_bits <= 8) {
  ------------------
  |  Branch (667:9): [True: 153, False: 216k]
  ------------------
  668|    153|      if (write_flag) {
  ------------------
  |  Branch (668:11): [True: 153, False: 0]
  ------------------
  669|    153|        iusace_write_bits_buf(it_bit_buf, 1, 1);
  670|    153|      }
  671|    153|      bit_count++;
  672|    153|      num_bits--;
  673|   216k|    } else {
  674|   216k|      WORD32 bytes_to_write = 0;
  675|   216k|      if (write_flag) {
  ------------------
  |  Branch (675:11): [True: 216k, False: 0]
  ------------------
  676|   216k|        iusace_write_bits_buf(it_bit_buf, 0, 1);
  677|   216k|      }
  678|   216k|      bit_count++;
  679|   216k|      num_bits--;
  680|   216k|      bytes_to_write = num_bits >> 3;
  681|       |
  682|   216k|      if (bytes_to_write > 255) {
  ------------------
  |  Branch (682:11): [True: 141k, False: 74.1k]
  ------------------
  683|   141k|        bytes_to_write -= 3;
  684|   141k|        if (write_flag) {
  ------------------
  |  Branch (684:13): [True: 141k, False: 0]
  ------------------
  685|   141k|          iusace_write_bits_buf(it_bit_buf, 255, 8);
  686|   141k|        }
  687|   141k|        if (write_flag) {
  ------------------
  |  Branch (687:13): [True: 141k, False: 0]
  ------------------
  688|   141k|          iusace_write_bits_buf(it_bit_buf, bytes_to_write - 253, 16);
  689|   141k|        }
  690|   141k|        bit_count += 24;
  691|   141k|        num_bits -= 24;
  692|   141k|      } else {
  693|  74.1k|        bytes_to_write--;
  694|  74.1k|        if (write_flag) {
  ------------------
  |  Branch (694:13): [True: 74.1k, False: 0]
  ------------------
  695|  74.1k|          iusace_write_bits_buf(it_bit_buf, bytes_to_write, 8);
  696|  74.1k|        }
  697|  74.1k|        bit_count += 8;
  698|  74.1k|        num_bits -= 8;
  699|  74.1k|      }
  700|       |
  701|  88.7M|      while (bytes_to_write > 0) {
  ------------------
  |  Branch (701:14): [True: 88.5M, False: 216k]
  ------------------
  702|  88.5M|        if (write_flag) {
  ------------------
  |  Branch (702:13): [True: 88.5M, False: 0]
  ------------------
  703|  88.5M|          iusace_write_bits_buf(it_bit_buf, 0xA9, 8);
  704|  88.5M|        }
  705|  88.5M|        bit_count += 8;
  706|  88.5M|        num_bits -= 8;
  707|  88.5M|        bytes_to_write--;
  708|  88.5M|      }
  709|   216k|    }
  710|   216k|  }
  711|   330k|  return bit_count;
  712|   330k|}
iusace_write_bitstream.c:iusace_calc_grouping_bits:
  181|  74.3k|static WORD32 iusace_calc_grouping_bits(const WORD32 *ptr_win_grp_len, WORD32 num_win_grps) {
  182|  74.3k|  WORD32 grouping_bits = 0;
  183|  74.3k|  WORD32 tmp[8] = {0};
  184|  74.3k|  WORD32 i, j;
  185|  74.3k|  WORD32 index = 0;
  186|       |
  187|   360k|  for (i = 0; i < num_win_grps; i++) {
  ------------------
  |  Branch (187:15): [True: 285k, False: 74.3k]
  ------------------
  188|   880k|    for (j = 0; j < ptr_win_grp_len[i]; j++) {
  ------------------
  |  Branch (188:17): [True: 594k, False: 285k]
  ------------------
  189|   594k|      tmp[index++] = i;
  190|   594k|    }
  191|   285k|  }
  192|       |
  193|   594k|  for (i = 1; i < 8; i++) {
  ------------------
  |  Branch (193:15): [True: 520k, False: 74.3k]
  ------------------
  194|   520k|    grouping_bits = grouping_bits << 1;
  195|   520k|    if (tmp[i] == tmp[i - 1]) {
  ------------------
  |  Branch (195:9): [True: 309k, False: 211k]
  ------------------
  196|   309k|      grouping_bits++;
  197|   309k|    }
  198|   520k|  }
  199|       |
  200|  74.3k|  return (grouping_bits);
  201|  74.3k|}

iaace_adj_thr_init:
   57|  4.74k|                        WORD32 ch_bitrate, WORD32 aot) {
   58|  4.74k|  ia_adj_thr_elem_struct *pstr_adj_thr_ele = &pstr_adj_thr_state->str_adj_thr_ele;
   59|  4.74k|  ia_min_snr_adapt_param_struct *pstr_min_snr_params =
   60|  4.74k|      &pstr_adj_thr_ele->str_min_snr_adapt_params;
   61|       |
   62|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.clip_save_low = CLIP_SAVE_LO_LONG;
  ------------------
  |  |   53|  4.74k|#define CLIP_SAVE_LO_LONG (0.2f)
  ------------------
   63|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.clip_save_high = CLIP_SAVE_HI_LONG;
  ------------------
  |  |   54|  4.74k|#define CLIP_SAVE_HI_LONG (0.95f)
  ------------------
   64|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.min_bit_save = MIN_BITS_SAVE_LONG;
  ------------------
  |  |   55|  4.74k|#define MIN_BITS_SAVE_LONG (-0.05f)
  ------------------
   65|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.max_bit_save = MAX_BITS_SAVE_LONG;
  ------------------
  |  |   56|  4.74k|#define MAX_BITS_SAVE_LONG (0.3f)
  ------------------
   66|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.clip_spend_low = CLIP_SPEND_LO_LONG;
  ------------------
  |  |   57|  4.74k|#define CLIP_SPEND_LO_LONG (0.2f)
  ------------------
   67|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.clip_spend_high = CLIP_SPEND_HI_LONG;
  ------------------
  |  |   58|  4.74k|#define CLIP_SPEND_HI_LONG (0.95f)
  ------------------
   68|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.min_bits_spend = MIN_BITS_SPEND_LONG;
  ------------------
  |  |   59|  4.74k|#define MIN_BITS_SPEND_LONG (-0.10f)
  ------------------
   69|  4.74k|  pstr_adj_thr_state->str_bitres_params_long.max_bits_spend = MAX_BITS_SPEND_LONG;
  ------------------
  |  |   60|  4.74k|#define MAX_BITS_SPEND_LONG (0.4f)
  ------------------
   70|       |
   71|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.clip_save_low = CLIP_SAVE_LO_SHORT;
  ------------------
  |  |   61|  4.74k|#define CLIP_SAVE_LO_SHORT (0.2f)
  ------------------
   72|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.clip_save_high = CLIP_SAVE_HI_SHORT;
  ------------------
  |  |   62|  4.74k|#define CLIP_SAVE_HI_SHORT (0.75f)
  ------------------
   73|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.min_bit_save = MIN_BITS_SAVE_SHORT;
  ------------------
  |  |   63|  4.74k|#define MIN_BITS_SAVE_SHORT (0.0f)
  ------------------
   74|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.max_bit_save = MAX_BITS_SAVE_SHORT;
  ------------------
  |  |   64|  4.74k|#define MAX_BITS_SAVE_SHORT (0.2f)
  ------------------
   75|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.clip_spend_low = CLIP_SPEND_LO_SHORT;
  ------------------
  |  |   65|  4.74k|#define CLIP_SPEND_LO_SHORT (0.2f)
  ------------------
   76|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.clip_spend_high = CLIP_SPEND_HI_SHORT;
  ------------------
  |  |   66|  4.74k|#define CLIP_SPEND_HI_SHORT (0.75f)
  ------------------
   77|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.min_bits_spend = MIN_BITS_SPEND_SHORT;
  ------------------
  |  |   67|  4.74k|#define MIN_BITS_SPEND_SHORT (-0.05f)
  ------------------
   78|  4.74k|  pstr_adj_thr_state->str_bitres_params_short.max_bits_spend = MAX_BITS_SPEND_SHORT;
  ------------------
  |  |   68|  4.74k|#define MAX_BITS_SPEND_SHORT (0.5f)
  ------------------
   79|       |
   80|  4.74k|  pstr_adj_thr_ele->pe_min = (FLOAT32)0.8f * mean_pe;
   81|  4.74k|  pstr_adj_thr_ele->pe_max = (FLOAT32)1.2f * mean_pe;
   82|  4.74k|  pstr_adj_thr_ele->pe_offset = 0.0f;
   83|  4.74k|  switch (aot) {
  ------------------
  |  Branch (83:11): [True: 4.74k, False: 0]
  ------------------
   84|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (84:5): [True: 1.00k, False: 3.74k]
  ------------------
   85|  2.69k|    case AOT_SBR:
  ------------------
  |  |   35|  2.69k|#define AOT_SBR (5)
  ------------------
  |  Branch (85:5): [True: 1.69k, False: 3.04k]
  ------------------
   86|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (86:5): [True: 246, False: 4.49k]
  ------------------
   87|  2.94k|      if (ch_bitrate < 32000) {
  ------------------
  |  Branch (87:11): [True: 2.09k, False: 851]
  ------------------
   88|  2.09k|        pstr_adj_thr_ele->pe_offset = MAX(
  ------------------
  |  |   24|  2.09k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 481, False: 1.60k]
  |  |  ------------------
  ------------------
   89|  2.09k|            (FLOAT32)50.0f, (FLOAT32)(100.0f) - (FLOAT32)(100.0f / 32000) * (FLOAT32)ch_bitrate);
   90|  2.09k|      }
   91|  2.94k|      break;
   92|       |
   93|    529|    case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (93:5): [True: 529, False: 4.21k]
  ------------------
   94|  1.80k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (94:5): [True: 1.27k, False: 3.47k]
  ------------------
   95|       |
   96|  1.80k|      if (ch_bitrate <= 32000) {
  ------------------
  |  Branch (96:11): [True: 1.01k, False: 784]
  ------------------
   97|  1.01k|        pstr_adj_thr_ele->pe_offset = MAX(
  ------------------
  |  |   24|  1.01k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 833, False: 185]
  |  |  ------------------
  ------------------
   98|  1.01k|            (FLOAT32)50.0f, (FLOAT32)(100.0f) - (FLOAT32)(100.0f / 32000) * (FLOAT32)ch_bitrate);
   99|  1.01k|      }
  100|  1.80k|      break;
  101|  4.74k|  }
  102|       |
  103|  4.74k|  if (ch_bitrate > 20000) {
  ------------------
  |  Branch (103:7): [True: 2.49k, False: 2.24k]
  ------------------
  104|  2.49k|    pstr_adj_thr_ele->str_ah_param.modify_min_snr = TRUE;
  ------------------
  |  |   23|  2.49k|#define TRUE (1)
  ------------------
  105|  2.49k|    pstr_adj_thr_ele->str_ah_param.start_sfb_long = 15;
  106|  2.49k|    pstr_adj_thr_ele->str_ah_param.start_sfb_short = 3;
  107|  2.49k|  } else {
  108|  2.24k|    pstr_adj_thr_ele->str_ah_param.modify_min_snr = FALSE;
  ------------------
  |  |   26|  2.24k|#define FALSE (0)
  ------------------
  109|  2.24k|    pstr_adj_thr_ele->str_ah_param.start_sfb_long = 0;
  110|  2.24k|    pstr_adj_thr_ele->str_ah_param.start_sfb_short = 0;
  111|  2.24k|  }
  112|       |
  113|  4.74k|  pstr_min_snr_params->max_red = (FLOAT32)0.25f;
  114|       |
  115|  4.74k|  pstr_min_snr_params->start_ratio = (FLOAT32)1.e1f;
  116|       |
  117|  4.74k|  pstr_min_snr_params->max_ratio = (FLOAT32)1.e3f;
  118|       |
  119|  4.74k|  pstr_min_snr_params->red_ratio_fac =
  120|  4.74k|      (1.0f - pstr_min_snr_params->max_red) /
  121|  4.74k|      (10.0f * (FLOAT32)log10(pstr_min_snr_params->start_ratio / pstr_min_snr_params->max_ratio));
  122|       |
  123|  4.74k|  pstr_min_snr_params->red_offs = 1.0f - pstr_min_snr_params->red_ratio_fac * 10.0f *
  124|  4.74k|                                             (FLOAT32)log10(pstr_min_snr_params->start_ratio);
  125|       |
  126|  4.74k|  pstr_adj_thr_ele->pe_last = (FLOAT32)0.0f;
  127|  4.74k|  pstr_adj_thr_ele->dyn_bits_last = 0;
  128|  4.74k|  pstr_adj_thr_ele->pe_correction_fac = (FLOAT32)1.0f;
  129|  4.74k|}
iaace_bits_to_pe:
  130|   809k|FLOAT32 iaace_bits_to_pe(const FLOAT32 bits) { return (bits * 1.18f); }
iaace_adjust_threshold:
  928|   308k|                            WORD32 aot, WORD8 *ptr_scratch) {
  929|   308k|  FLOAT32 no_red_pe, granted_pe, granted_pe_corr;
  930|   308k|  WORD32 curr_win_sequence;
  931|   308k|  ia_qc_pe_data_struct *pstr_qc_pe_data = (ia_qc_pe_data_struct *)ptr_scratch;
  932|   308k|  FLOAT32 bit_factor;
  933|   308k|  WORD32 ch;
  934|       |
  935|   757k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (935:18): [True: 448k, False: 308k]
  ------------------
  936|   448k|    pstr_qc_pe_data->pe_ch_data[ch].sfb_lines =
  937|   448k|        ptr_sfb_n_relevant_lines + MAXIMUM_GROUPED_SCALE_FACTOR_BAND * ch;
  ------------------
  |  |   73|   448k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|   448k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|   448k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|   448k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 448k, Folded]
  |  |  ------------------
  |  |   74|   448k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|   448k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|   448k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|   448k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  938|   448k|    pstr_qc_pe_data->pe_ch_data[ch].sfb_ld_energy =
  939|   448k|        ptr_sfb_ld_energy + MAXIMUM_GROUPED_SCALE_FACTOR_BAND * ch;
  ------------------
  |  |   73|   448k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|   448k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|   448k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|   448k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 448k, Folded]
  |  |  ------------------
  |  |   74|   448k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|   448k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|   448k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|   448k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  940|   448k|  }
  941|   308k|  pstr_qc_pe_data->offset = pstr_adj_thr_elem->pe_offset;
  942|       |
  943|   308k|  iaace_calc_sfb_pe_data(pstr_qc_pe_data, pstr_psy_out, num_channels, chn);
  944|       |
  945|   308k|  no_red_pe = pstr_qc_pe_data->pe;
  946|       |
  947|   308k|  curr_win_sequence = LONG_WINDOW;
  ------------------
  |  |   31|   308k|#define LONG_WINDOW 0
  ------------------
  948|   308k|  if (num_channels == 2) {
  ------------------
  |  Branch (948:7): [True: 140k, False: 167k]
  ------------------
  949|   140k|    if ((pstr_psy_out[chn]->window_sequence == SHORT_WINDOW) ||
  ------------------
  |  |   33|   140k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (949:9): [True: 35.8k, False: 104k]
  ------------------
  950|   104k|        (pstr_psy_out[chn + 1]->window_sequence == SHORT_WINDOW)) {
  ------------------
  |  |   33|   104k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (950:9): [True: 0, False: 104k]
  ------------------
  951|  35.8k|      curr_win_sequence = SHORT_WINDOW;
  ------------------
  |  |   33|  35.8k|#define SHORT_WINDOW 2
  ------------------
  952|  35.8k|    }
  953|   167k|  } else {
  954|   167k|    curr_win_sequence = pstr_psy_out[chn]->window_sequence;
  955|   167k|  }
  956|       |
  957|   308k|  bit_factor = iaace_bitres_calc_bitfac(
  958|   308k|      bitres_bits, max_bitres_bits, no_red_pe + 5.0f * side_info_bits, curr_win_sequence,
  959|   308k|      avg_bits, *max_bit_fac, pstr_adj_thr_state, pstr_adj_thr_elem);
  960|       |
  961|   308k|  granted_pe = bit_factor * iaace_bits_to_pe((FLOAT32)avg_bits);
  962|       |
  963|   308k|  iaace_calc_pe_correction(&(pstr_adj_thr_elem->pe_correction_fac), MIN(granted_pe, no_red_pe),
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 181k, False: 127k]
  |  |  ------------------
  ------------------
  964|   308k|                           pstr_adj_thr_elem->pe_last, pstr_adj_thr_elem->dyn_bits_last);
  965|       |
  966|   308k|  granted_pe_corr = granted_pe * pstr_adj_thr_elem->pe_correction_fac;
  967|       |
  968|   308k|  if (granted_pe_corr < no_red_pe) {
  ------------------
  |  Branch (968:7): [True: 181k, False: 126k]
  ------------------
  969|   181k|    iaace_adapt_thr_to_pe(pstr_psy_out, pstr_qc_pe_data, granted_pe_corr,
  970|   181k|                          &pstr_adj_thr_elem->str_ah_param,
  971|   181k|                          &pstr_adj_thr_elem->str_min_snr_adapt_params, num_channels, chn, aot);
  972|   181k|  }
  973|       |
  974|   757k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (974:18): [True: 448k, False: 308k]
  ------------------
  975|   448k|    FLOAT32 tmp_var, temp1;
  976|   448k|    if (pstr_qc_pe_data->pe) {
  ------------------
  |  Branch (976:9): [True: 403k, False: 45.4k]
  ------------------
  977|   403k|      tmp_var = 1.0f - num_channels * 0.2f;
  978|   403k|      temp1 = pstr_qc_pe_data->pe_ch_data[ch].pe / pstr_qc_pe_data->pe;
  979|   403k|      temp1 = temp1 * tmp_var;
  980|   403k|      ptr_ch_bit_dist[ch] = temp1 + 0.2f;
  981|   403k|      if (ptr_ch_bit_dist[ch] < 0.2f) {
  ------------------
  |  Branch (981:11): [True: 0, False: 403k]
  ------------------
  982|      0|        ptr_ch_bit_dist[ch] = 0.2f;
  983|      0|      }
  984|   403k|    } else {
  985|  45.4k|      ptr_ch_bit_dist[ch] = 0.2f;
  986|  45.4k|    }
  987|   448k|  }
  988|       |
  989|   308k|  pstr_qc_out_el->pe = no_red_pe;
  990|   308k|  pstr_adj_thr_elem->pe_last = granted_pe;
  991|   308k|}
ixheaace_adjust_threshold.c:iaace_calc_sfb_pe_data:
  133|   760k|                                   WORD32 chn) {
  134|   760k|  WORD32 ch;
  135|   760k|  WORD32 scf_band_grp;
  136|   760k|  FLOAT32 num_lines;
  137|   760k|  FLOAT32 ld_thr, ld_ratio;
  138|   760k|  WORD32 i = 0, scf;
  139|   760k|  WORD32 sfb_count;
  140|   760k|  WORD32 scf_band_per_grp;
  141|   760k|  WORD32 max_sfb_per_grp;
  142|   760k|  FLOAT32 *ptr_sfb_energy;
  143|   760k|  FLOAT32 *ptr_sfb_thr;
  144|   760k|  ia_qc_pe_chan_data_struct *pstr_qc_pe_chan_data;
  145|       |
  146|   760k|  pstr_qc_pe_data->pe = pstr_qc_pe_data->offset;
  147|   760k|  pstr_qc_pe_data->const_part = 0.0f;
  148|   760k|  pstr_qc_pe_data->num_active_lines = 0.0f;
  149|       |
  150|  1.85M|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (150:18): [True: 1.09M, False: 760k]
  ------------------
  151|  1.09M|    sfb_count = pstr_psy_out[ch]->sfb_count;
  152|  1.09M|    scf_band_per_grp = pstr_psy_out[ch]->sfb_per_group;
  153|  1.09M|    max_sfb_per_grp = pstr_psy_out[ch]->max_sfb_per_grp;
  154|  1.09M|    ptr_sfb_energy = pstr_psy_out[ch]->ptr_sfb_energy;
  155|  1.09M|    ptr_sfb_thr = pstr_psy_out[ch]->ptr_sfb_thr;
  156|  1.09M|    pstr_qc_pe_chan_data = &pstr_qc_pe_data->pe_ch_data[ch];
  157|  1.09M|    pstr_qc_pe_chan_data->pe = 0;
  158|  1.09M|    pstr_qc_pe_chan_data->num_active_lines = 0;
  159|  1.09M|    pstr_qc_pe_chan_data->const_part = 0;
  160|       |
  161|  2.89M|    for (scf_band_grp = 0; scf_band_grp < sfb_count; scf_band_grp += scf_band_per_grp) {
  ------------------
  |  Branch (161:28): [True: 1.80M, False: 1.09M]
  ------------------
  162|  1.80M|      i = scf_band_grp;
  163|  35.3M|      for (scf = max_sfb_per_grp - 1; scf >= 0; scf--, i++) {
  ------------------
  |  Branch (163:39): [True: 33.5M, False: 1.80M]
  ------------------
  164|  33.5M|        if (ptr_sfb_energy[i] > ptr_sfb_thr[i]) {
  ------------------
  |  Branch (164:13): [True: 22.6M, False: 10.9M]
  ------------------
  165|  22.6M|          ld_thr = (FLOAT32)log(ptr_sfb_thr[i]) * LOG2_1;
  ------------------
  |  |   76|  22.6M|#define LOG2_1 1.442695041f
  ------------------
  166|  22.6M|          ld_ratio = pstr_qc_pe_chan_data->sfb_ld_energy[i] - ld_thr;
  167|  22.6M|          num_lines = pstr_qc_pe_chan_data->sfb_lines[i];
  168|  22.6M|          if (ld_ratio >= PE_C1) {
  ------------------
  |  |   80|  22.6M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (168:15): [True: 13.6M, False: 8.92M]
  ------------------
  169|  13.6M|            pstr_qc_pe_chan_data->sfb_pe[i] = num_lines * ld_ratio;
  170|  13.6M|            pstr_qc_pe_chan_data->sfb_const_part[i] =
  171|  13.6M|                num_lines * pstr_qc_pe_chan_data->sfb_ld_energy[i];
  172|  13.6M|          } else {
  173|  8.92M|            pstr_qc_pe_chan_data->sfb_pe[i] = num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   81|  8.92M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                          pstr_qc_pe_chan_data->sfb_pe[i] = num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   82|  8.92M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  174|  8.92M|            pstr_qc_pe_chan_data->sfb_const_part[i] =
  175|  8.92M|                num_lines * (PE_C2 + PE_C3 * pstr_qc_pe_chan_data->sfb_ld_energy[i]);
  ------------------
  |  |   81|  8.92M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                              num_lines * (PE_C2 + PE_C3 * pstr_qc_pe_chan_data->sfb_ld_energy[i]);
  ------------------
  |  |   82|  8.92M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  176|  8.92M|            num_lines = num_lines * PE_C3;
  ------------------
  |  |   82|  8.92M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  177|  8.92M|          }
  178|  22.6M|          pstr_qc_pe_chan_data->num_sfb_active_lines[i] = num_lines;
  179|  22.6M|        } else {
  180|  10.9M|          pstr_qc_pe_chan_data->sfb_pe[i] = 0.0f;
  181|  10.9M|          pstr_qc_pe_chan_data->sfb_const_part[i] = 0.0f;
  182|  10.9M|          pstr_qc_pe_chan_data->num_sfb_active_lines[i] = 0.0;
  183|  10.9M|        }
  184|       |
  185|  33.5M|        pstr_qc_pe_chan_data->pe += pstr_qc_pe_chan_data->sfb_pe[i];
  186|  33.5M|        pstr_qc_pe_chan_data->const_part += pstr_qc_pe_chan_data->sfb_const_part[i];
  187|  33.5M|        pstr_qc_pe_chan_data->num_active_lines += pstr_qc_pe_chan_data->num_sfb_active_lines[i];
  188|  33.5M|      }
  189|  1.80M|    }
  190|  1.09M|    pstr_qc_pe_data->pe += pstr_qc_pe_chan_data->pe;
  191|  1.09M|    pstr_qc_pe_data->const_part += pstr_qc_pe_chan_data->const_part;
  192|  1.09M|    pstr_qc_pe_data->num_active_lines += pstr_qc_pe_chan_data->num_active_lines;
  193|  1.09M|    pstr_psy_out[ch]->pe = pstr_qc_pe_data->pe;
  194|  1.09M|  }
  195|   760k|}
ixheaace_adjust_threshold.c:iaace_bitres_calc_bitfac:
  262|   308k|                                        ia_adj_thr_elem_struct *pstr_adj_the_elem) {
  263|   308k|  ia_bitres_param_struct *pstr_bitres_params;
  264|   308k|  FLOAT32 pex;
  265|   308k|  FLOAT32 fill_lvl = 0.0f;
  266|   308k|  FLOAT32 bit_save, bit_spend, bitres_factor;
  267|       |
  268|   308k|  if (max_bitres_bits) {
  ------------------
  |  Branch (268:7): [True: 212k, False: 95.6k]
  ------------------
  269|   212k|    fill_lvl = (FLOAT32)bitres_bits / max_bitres_bits;
  270|   212k|  }
  271|       |
  272|   308k|  if (win_seq != SHORT_WINDOW) {
  ------------------
  |  |   33|   308k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (272:7): [True: 257k, False: 51.0k]
  ------------------
  273|   257k|    pstr_bitres_params = &(pstr_adj_thr_state->str_bitres_params_long);
  274|   257k|  } else {
  275|  51.0k|    pstr_bitres_params = &(pstr_adj_thr_state->str_bitres_params_short);
  276|  51.0k|  }
  277|       |
  278|   308k|  pex = MAX(pe, pstr_adj_the_elem->pe_min);
  ------------------
  |  |   24|   308k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 101k, False: 206k]
  |  |  ------------------
  ------------------
  279|   308k|  pex = MIN(pex, pstr_adj_the_elem->pe_max);
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 290k, False: 17.8k]
  |  |  ------------------
  ------------------
  280|       |
  281|   308k|  bit_save = iaace_calc_bit_save(pstr_bitres_params, fill_lvl);
  282|   308k|  bit_spend = iaace_calc_bit_spend(pstr_bitres_params, fill_lvl);
  283|       |
  284|   308k|  bitres_factor =
  285|   308k|      (FLOAT32)1.0f - bit_save +
  286|   308k|      ((bit_spend + bit_save) / (pstr_adj_the_elem->pe_max - pstr_adj_the_elem->pe_min)) *
  287|   308k|          (pex - pstr_adj_the_elem->pe_min);
  288|   308k|  if (avg_bits)
  ------------------
  |  Branch (288:7): [True: 308k, False: 10]
  ------------------
  289|   308k|  {
  290|   308k|    bitres_factor = MIN(bitres_factor,
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 205k, False: 102k]
  |  |  ------------------
  ------------------
  291|   308k|      (FLOAT32)1.0f - (FLOAT32)0.3f + (FLOAT32)bitres_bits / (FLOAT32)avg_bits);
  292|   308k|  }
  293|       |
  294|   308k|  bitres_factor = MIN(bitres_factor, max_bit_fac);
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 308k, False: 0]
  |  |  ------------------
  ------------------
  295|       |
  296|   308k|  iaace_adjust_pe_minmax(pe, &pstr_adj_the_elem->pe_min, &pstr_adj_the_elem->pe_max);
  297|       |
  298|   308k|  return bitres_factor;
  299|   308k|}
ixheaace_adjust_threshold.c:iaace_calc_bit_save:
  196|   308k|static FLOAT32 iaace_calc_bit_save(ia_bitres_param_struct *pstr_bitres_params, FLOAT32 fill_lvl) {
  197|   308k|  FLOAT32 bit_save;
  198|   308k|  const FLOAT32 clip_low = pstr_bitres_params->clip_save_low;
  199|   308k|  const FLOAT32 clip_high = pstr_bitres_params->clip_save_high;
  200|   308k|  const FLOAT32 min_bit_save = pstr_bitres_params->min_bit_save;
  201|   308k|  const FLOAT32 max_bit_save = pstr_bitres_params->max_bit_save;
  202|       |
  203|   308k|  fill_lvl = MAX(fill_lvl, clip_low);
  ------------------
  |  |   24|   308k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 196k, False: 111k]
  |  |  ------------------
  ------------------
  204|   308k|  fill_lvl = MIN(fill_lvl, clip_high);
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 232k, False: 75.8k]
  |  |  ------------------
  ------------------
  205|   308k|  bit_save = max_bit_save -
  206|   308k|             ((max_bit_save - min_bit_save) / (clip_high - clip_low)) * (fill_lvl - clip_low);
  207|       |
  208|   308k|  return bit_save;
  209|   308k|}
ixheaace_adjust_threshold.c:iaace_calc_bit_spend:
  212|   308k|                                    FLOAT32 fill_lvl) {
  213|   308k|  FLOAT32 bit_spend;
  214|   308k|  const FLOAT32 clip_low = pstr_bitres_params->clip_spend_low;
  215|   308k|  const FLOAT32 clip_high = pstr_bitres_params->clip_spend_high;
  216|   308k|  const FLOAT32 min_bits_spend = pstr_bitres_params->min_bits_spend;
  217|   308k|  const FLOAT32 max_bits_spend = pstr_bitres_params->max_bits_spend;
  218|       |
  219|   308k|  fill_lvl = MAX(fill_lvl, clip_low);
  ------------------
  |  |   24|   308k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 196k, False: 111k]
  |  |  ------------------
  ------------------
  220|   308k|  fill_lvl = MIN(fill_lvl, clip_high);
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 232k, False: 75.8k]
  |  |  ------------------
  ------------------
  221|   308k|  bit_spend = min_bits_spend + ((max_bits_spend - min_bits_spend) / (clip_high - clip_low)) *
  222|   308k|                                   (fill_lvl - clip_low);
  223|       |
  224|   308k|  return bit_spend;
  225|   308k|}
ixheaace_adjust_threshold.c:iaace_adjust_pe_minmax:
  228|   308k|                                   FLOAT32 *ptr_pe_max) {
  229|   308k|  FLOAT32 min_hi_fac = 0.3f, max_hi_fac = 1.0f, min_low_fac = 0.14f, max_low_fac = 0.07f;
  230|   308k|  FLOAT32 diff;
  231|   308k|  FLOAT32 min_diff = curr_pe * (FLOAT32)0.1666666667f;
  232|       |
  233|   308k|  if (curr_pe > *ptr_pe_max) {
  ------------------
  |  Branch (233:7): [True: 17.8k, False: 290k]
  ------------------
  234|  17.8k|    diff = (curr_pe - *ptr_pe_max);
  235|  17.8k|    *ptr_pe_min += diff * min_hi_fac;
  236|  17.8k|    *ptr_pe_max += diff * max_hi_fac;
  237|   290k|  } else {
  238|   290k|    if (curr_pe < *ptr_pe_min) {
  ------------------
  |  Branch (238:9): [True: 206k, False: 83.8k]
  ------------------
  239|   206k|      diff = (*ptr_pe_min - curr_pe);
  240|   206k|      *ptr_pe_min -= diff * min_low_fac;
  241|   206k|      *ptr_pe_max -= diff * max_low_fac;
  242|   206k|    } else {
  243|  83.8k|      *ptr_pe_min += (curr_pe - *ptr_pe_min) * min_hi_fac;
  244|  83.8k|      *ptr_pe_max -= (*ptr_pe_max - curr_pe) * max_low_fac;
  245|  83.8k|    }
  246|   290k|  }
  247|       |
  248|   308k|  if ((*ptr_pe_max - *ptr_pe_min) < min_diff) {
  ------------------
  |  Branch (248:7): [True: 26.8k, False: 281k]
  ------------------
  249|  26.8k|    FLOAT32 low_part, high_part;
  250|  26.8k|    low_part = MAX((FLOAT32)0.0f, curr_pe - *ptr_pe_min);
  ------------------
  |  |   24|  26.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 3, False: 26.8k]
  |  |  ------------------
  ------------------
  251|  26.8k|    high_part = MAX((FLOAT32)0.0f, *ptr_pe_max - curr_pe);
  ------------------
  |  |   24|  26.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 26.8k]
  |  |  ------------------
  ------------------
  252|  26.8k|    *ptr_pe_max = curr_pe + high_part / (low_part + high_part) * min_diff;
  253|  26.8k|    *ptr_pe_min = curr_pe - low_part / (low_part + high_part) * min_diff;
  254|  26.8k|    *ptr_pe_min = MAX((FLOAT32)0.0f, *ptr_pe_min);
  ------------------
  |  |   24|  26.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 26.8k]
  |  |  ------------------
  ------------------
  255|  26.8k|  }
  256|   308k|}
ixheaace_adjust_threshold.c:iaace_calc_pe_correction:
  302|   308k|                                     const FLOAT32 pe_last, const WORD32 bits_prev) {
  303|   308k|  if ((bits_prev > 0) && (pe_act < (FLOAT32)1.5f * pe_last) &&
  ------------------
  |  Branch (303:7): [True: 251k, False: 56.3k]
  |  Branch (303:26): [True: 248k, False: 3.57k]
  ------------------
  304|   248k|      (pe_act > (FLOAT32)0.7f * pe_last) &&
  ------------------
  |  Branch (304:7): [True: 185k, False: 62.3k]
  ------------------
  305|   185k|      ((FLOAT32)1.2f * iaace_bits_to_pe((FLOAT32)bits_prev) > pe_last) &&
  ------------------
  |  Branch (305:7): [True: 163k, False: 22.7k]
  ------------------
  306|   163k|      ((FLOAT32)0.65f * iaace_bits_to_pe((FLOAT32)bits_prev) < pe_last)) {
  ------------------
  |  Branch (306:7): [True: 152k, False: 10.6k]
  ------------------
  307|   152k|    FLOAT32 new_fac = pe_last / iaace_bits_to_pe((FLOAT32)bits_prev);
  308|       |
  309|   152k|    if (new_fac < (FLOAT32)1.0f) {
  ------------------
  |  Branch (309:9): [True: 97.9k, False: 54.6k]
  ------------------
  310|  97.9k|      new_fac = MIN((FLOAT32)1.1f * new_fac, (FLOAT32)1.0f);
  ------------------
  |  |   23|  97.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 55.2k, False: 42.7k]
  |  |  ------------------
  ------------------
  311|  97.9k|      new_fac = MAX(new_fac, (FLOAT32)0.85f);
  ------------------
  |  |   24|  97.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 80.2k, False: 17.6k]
  |  |  ------------------
  ------------------
  312|  97.9k|    } else {
  313|  54.6k|      new_fac = MAX((FLOAT32)0.9f * new_fac, (FLOAT32)1.0f);
  ------------------
  |  |   24|  54.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 18.3k, False: 36.3k]
  |  |  ------------------
  ------------------
  314|  54.6k|      new_fac = MIN(new_fac, (FLOAT32)1.15f);
  ------------------
  |  |   23|  54.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 54.6k, False: 0]
  |  |  ------------------
  ------------------
  315|  54.6k|    }
  316|   152k|    if (((new_fac > (FLOAT32)1.0f) && (*ptr_correction_fac < (FLOAT32)1.0f)) ||
  ------------------
  |  Branch (316:10): [True: 18.3k, False: 134k]
  |  Branch (316:39): [True: 1.43k, False: 16.8k]
  ------------------
  317|   151k|        ((new_fac < (FLOAT32)1.0f) && (*ptr_correction_fac > (FLOAT32)1.0f))) {
  ------------------
  |  Branch (317:10): [True: 55.2k, False: 95.9k]
  |  Branch (317:39): [True: 1.31k, False: 53.8k]
  ------------------
  318|  2.75k|      *ptr_correction_fac = (FLOAT32)1.0f;
  319|  2.75k|    }
  320|       |
  321|   152k|    if ((*ptr_correction_fac < (FLOAT32)1.0f && new_fac < *ptr_correction_fac) ||
  ------------------
  |  Branch (321:10): [True: 67.2k, False: 85.2k]
  |  Branch (321:49): [True: 33.3k, False: 33.9k]
  ------------------
  322|   119k|        (*ptr_correction_fac > (FLOAT32)1.0f && new_fac > *ptr_correction_fac)) {
  ------------------
  |  Branch (322:10): [True: 24.1k, False: 95.1k]
  |  Branch (322:49): [True: 8.79k, False: 15.3k]
  ------------------
  323|  42.1k|      *ptr_correction_fac = (FLOAT32)0.85f * (*ptr_correction_fac) + (FLOAT32)0.15f * new_fac;
  324|   110k|    } else {
  325|   110k|      *ptr_correction_fac = (FLOAT32)0.7f * (*ptr_correction_fac) + (FLOAT32)0.3f * new_fac;
  326|   110k|    }
  327|       |
  328|   152k|    *ptr_correction_fac = MIN(*ptr_correction_fac, (FLOAT32)1.15f);
  ------------------
  |  |   23|   152k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 152k, False: 0]
  |  |  ------------------
  ------------------
  329|   152k|    *ptr_correction_fac = MAX(*ptr_correction_fac, (FLOAT32)0.85f);
  ------------------
  |  |   24|   152k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 152k, False: 0]
  |  |  ------------------
  ------------------
  330|   155k|  } else {
  331|   155k|    *ptr_correction_fac = (FLOAT32)1.0f;
  332|   155k|  }
  333|   308k|}
ixheaace_adjust_threshold.c:iaace_adapt_thr_to_pe:
  857|   181k|    WORD32 num_channels, WORD32 chn, WORD32 aot) {
  858|   181k|  FLOAT32 no_red_pe, red_pe, red_pe_no_ah;
  859|   181k|  FLOAT32 const_part, const_part_no_ah;
  860|   181k|  FLOAT32 num_active_lines, num_active_lines_no_ah;
  861|   181k|  FLOAT32 desired_pe_no_ah;
  862|   181k|  FLOAT32 redval = 0.0f;
  863|   181k|  WORD32 ah_flag[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  864|   181k|  FLOAT32 thr_exp[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  865|   181k|  WORD32 iteration;
  866|       |
  867|   181k|  iaace_calc_thr_exp(thr_exp, pstr_psy_out, num_channels, chn);
  868|   181k|  iaace_adapt_min_snr(pstr_psy_out, pstr_msa_param, num_channels, chn);
  869|   181k|  iaace_init_avoid_hole_flag(ah_flag, pstr_psy_out, pstr_ah_param, num_channels, chn, aot);
  870|       |
  871|   181k|  no_red_pe = pstr_qs_pe_data->pe;
  872|   181k|  const_part = pstr_qs_pe_data->const_part;
  873|   181k|  num_active_lines = pstr_qs_pe_data->num_active_lines;
  874|   181k|  if (num_active_lines > FLT_EPSILON) {
  ------------------
  |  Branch (874:7): [True: 181k, False: 26]
  ------------------
  875|   181k|    FLOAT32 avg_thr_exp =
  876|   181k|        (FLOAT32)pow(2.0f, (const_part - no_red_pe) / (INV_RED_EXP_VAL * num_active_lines));
  ------------------
  |  |   71|   181k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   70|   181k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  877|   181k|    redval = (FLOAT32)pow(2.0f, (const_part - desired_pe) / (INV_RED_EXP_VAL * num_active_lines))
  ------------------
  |  |   71|   181k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   70|   181k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  878|   181k|             - avg_thr_exp;
  879|   181k|    redval = MAX(0.0f, redval);
  ------------------
  |  |   24|   181k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 181k]
  |  |  ------------------
  ------------------
  880|   181k|    iaace_reduce_thr(pstr_psy_out, ah_flag, thr_exp, redval, num_channels, chn);
  881|   181k|  }
  882|       |
  883|   181k|  iaace_calc_sfb_pe_data(pstr_qs_pe_data, pstr_psy_out, num_channels, chn);
  884|   181k|  red_pe = pstr_qs_pe_data->pe;
  885|       |
  886|   181k|  iteration = 0;
  887|   271k|  do {
  888|   271k|    iaace_calc_pe_no_active_holes(&red_pe_no_ah, &const_part_no_ah, &num_active_lines_no_ah,
  889|   271k|                                  pstr_qs_pe_data, ah_flag, pstr_psy_out, num_channels, chn);
  890|       |
  891|   271k|    desired_pe_no_ah = MAX(desired_pe - (red_pe - red_pe_no_ah), 0);
  ------------------
  |  |   24|   271k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 197k, False: 73.6k]
  |  |  ------------------
  ------------------
  892|       |
  893|   271k|    if (num_active_lines_no_ah > FLT_EPSILON) {
  ------------------
  |  Branch (893:9): [True: 268k, False: 3.06k]
  ------------------
  894|   268k|      FLOAT32 avg_thr_exp = (FLOAT32)pow(
  895|   268k|          2.0f, (const_part_no_ah - red_pe_no_ah) / (INV_RED_EXP_VAL * num_active_lines_no_ah));
  ------------------
  |  |   71|   268k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   70|   268k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  896|   268k|      redval += (FLOAT32)pow(2.0f, (const_part_no_ah - desired_pe_no_ah) /
  897|   268k|                                       (INV_RED_EXP_VAL * num_active_lines_no_ah)) -
  ------------------
  |  |   71|   268k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   70|   268k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  898|   268k|                avg_thr_exp;
  899|   268k|      redval = MAX(0.0f, redval);
  ------------------
  |  |   24|   268k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 91, False: 268k]
  |  |  ------------------
  ------------------
  900|   268k|      iaace_reduce_thr(pstr_psy_out, ah_flag, thr_exp, redval, num_channels, chn);
  901|   268k|    }
  902|       |
  903|   271k|    iaace_calc_sfb_pe_data(pstr_qs_pe_data, pstr_psy_out, num_channels, chn);
  904|       |
  905|   271k|    red_pe = pstr_qs_pe_data->pe;
  906|   271k|    iteration++;
  907|   271k|  } while ((fabs(red_pe - desired_pe) > (0.05f) * desired_pe) && (iteration < 2));
  ------------------
  |  Branch (907:12): [True: 157k, False: 114k]
  |  Branch (907:66): [True: 90.0k, False: 67.0k]
  ------------------
  908|       |
  909|   181k|  if (red_pe < 1.15f * desired_pe) {
  ------------------
  |  Branch (909:7): [True: 128k, False: 52.4k]
  ------------------
  910|   128k|    iaace_correct_thr(pstr_psy_out, ah_flag, pstr_qs_pe_data, thr_exp, redval,
  911|   128k|                      desired_pe - red_pe, num_channels, chn);
  912|   128k|  } else {
  913|  52.4k|    iaace_reduce_min_snr(pstr_psy_out, pstr_qs_pe_data, ah_flag, 1.05f * desired_pe, num_channels,
  914|  52.4k|                         chn);
  915|  52.4k|    iaace_allow_more_holes(pstr_psy_out, pstr_qs_pe_data, ah_flag, pstr_ah_param,
  916|  52.4k|                           1.05f * desired_pe, num_channels, chn);
  917|  52.4k|  }
  918|   181k|}
ixheaace_adjust_threshold.c:iaace_calc_thr_exp:
  337|   181k|    ixheaace_psy_out_channel **pstr_psy_out, WORD32 num_chans, WORD32 chn) {
  338|   181k|  WORD32 sfb, ch, scf_band_grp;
  339|   181k|  ixheaace_psy_out_channel *pstr_psy_chan_out;
  340|   181k|  FLOAT32 *ptr_scf_band_thr;
  341|   181k|  FLOAT32 *ptr_thr_exp;
  342|   439k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (342:18): [True: 258k, False: 181k]
  ------------------
  343|   258k|    pstr_psy_chan_out = pstr_psy_out[ch];
  344|   258k|    ptr_thr_exp = thr_exp[ch];
  345|   709k|    for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (345:28): [True: 451k, False: 258k]
  ------------------
  346|   451k|         scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  347|   451k|      FLOAT32 *ptr_thr_exp1 = &ptr_thr_exp[scf_band_grp];
  348|   451k|      ptr_scf_band_thr = &pstr_psy_chan_out->ptr_sfb_thr[scf_band_grp];
  349|  9.02M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (349:21): [True: 8.57M, False: 451k]
  ------------------
  350|  8.57M|        ptr_thr_exp1[sfb] = (FLOAT32)pow(*ptr_scf_band_thr++, RED_EXP_VAL);
  ------------------
  |  |   70|  8.57M|#define RED_EXP_VAL 0.25f
  ------------------
  351|  8.57M|      }
  352|   451k|    }
  353|   258k|  }
  354|   181k|}
ixheaace_adjust_threshold.c:iaace_adapt_min_snr:
  358|   181k|                                WORD32 num_chans, WORD32 chn) {
  359|   181k|  WORD32 num_scf_band = 0, ch, scf_band_cnt, scf_band_offs, sfb;
  360|   181k|  FLOAT32 avg_energy = 0.0f, db_ratio, min_snr_red;
  361|   181k|  WORD32 i;
  362|       |
  363|   439k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (363:18): [True: 258k, False: 181k]
  ------------------
  364|   258k|    ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  365|   258k|    num_scf_band = 0;
  366|   258k|    avg_energy = 0;
  367|   258k|    scf_band_cnt = pstr_psy_chan_out->max_sfb_per_grp;
  368|       |
  369|   709k|    for (scf_band_offs = 0; scf_band_offs < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (369:29): [True: 451k, False: 258k]
  ------------------
  370|   451k|         scf_band_offs += pstr_psy_chan_out->sfb_per_group) {
  371|   451k|      FLOAT32 *ptr_sfb_energy = &pstr_psy_chan_out->ptr_sfb_energy[scf_band_offs];
  372|  9.02M|      for (sfb = scf_band_cnt - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (372:36): [True: 8.57M, False: 451k]
  ------------------
  373|  8.57M|        avg_energy += ptr_sfb_energy[sfb];
  374|  8.57M|      }
  375|   451k|      num_scf_band += scf_band_cnt;
  376|   451k|    }
  377|       |
  378|   258k|    if (num_scf_band > 0) {
  ------------------
  |  Branch (378:9): [True: 258k, False: 0]
  ------------------
  379|   258k|      avg_energy /= num_scf_band;
  380|   258k|    }
  381|       |
  382|   709k|    for (scf_band_offs = 0; scf_band_offs < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (382:29): [True: 451k, False: 258k]
  ------------------
  383|   451k|         scf_band_offs += pstr_psy_chan_out->sfb_per_group) {
  384|   451k|      i = scf_band_offs;
  385|  9.02M|      for (sfb = scf_band_cnt - 1; sfb >= 0; sfb--, i++) {
  ------------------
  |  Branch (385:36): [True: 8.57M, False: 451k]
  ------------------
  386|  8.57M|        if (pstr_min_snr_params->start_ratio * pstr_psy_chan_out->ptr_sfb_energy[i] <
  ------------------
  |  Branch (386:13): [True: 5.41M, False: 3.15M]
  ------------------
  387|  8.57M|            avg_energy) {
  388|  5.41M|          db_ratio =
  389|  5.41M|              (FLOAT32)(10.0f * log10((MIN_FLT_VAL + avg_energy) /
  ------------------
  |  |   58|  5.41M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  390|  5.41M|                                      (MIN_FLT_VAL + pstr_psy_chan_out->ptr_sfb_energy[i])));
  ------------------
  |  |   58|  5.41M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  391|  5.41M|          min_snr_red =
  392|  5.41M|              pstr_min_snr_params->red_offs + pstr_min_snr_params->red_ratio_fac * db_ratio;
  393|  5.41M|          min_snr_red = MAX(min_snr_red, pstr_min_snr_params->max_red);
  ------------------
  |  |   24|  5.41M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.39M, False: 3.02M]
  |  |  ------------------
  ------------------
  394|  5.41M|          pstr_psy_chan_out->sfb_min_snr[i] =
  395|  5.41M|              (FLOAT32)pow(pstr_psy_out[ch]->sfb_min_snr[i], min_snr_red);
  396|  5.41M|          pstr_psy_chan_out->sfb_min_snr[i] =
  397|  5.41M|              MIN(MIN_SNR_LIMIT, pstr_psy_out[ch]->sfb_min_snr[i]);
  ------------------
  |  |   23|  5.41M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3.26M, False: 2.15M]
  |  |  ------------------
  ------------------
  398|  5.41M|        }
  399|  8.57M|      }
  400|   451k|    }
  401|   258k|  }
  402|   181k|}
ixheaace_adjust_threshold.c:iaace_init_avoid_hole_flag:
  407|   181k|    WORD32 chn, WORD32 aot) {
  408|   181k|  WORD32 ch;
  409|   181k|  FLOAT32 sfb_energy;
  410|   181k|  FLOAT32 scale_spread_energy = 0.0f;
  411|   181k|  WORD32 scf_band_grp, scf_band_cnt, scf_band;
  412|   181k|  FLOAT32 *ptr_scf_band_spread_energy, *ptr_scf_band_energy, *ptr_scf_band_min_snr;
  413|   439k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (413:18): [True: 258k, False: 181k]
  ------------------
  414|   258k|    ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  415|       |
  416|   258k|    if (pstr_psy_chan_out->window_sequence != SHORT_WINDOW) {
  ------------------
  |  |   33|   258k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (416:9): [True: 192k, False: 65.6k]
  ------------------
  417|   192k|      switch (aot) {
  ------------------
  |  Branch (417:15): [True: 192k, False: 0]
  ------------------
  418|  43.5k|        case AOT_AAC_LC:
  ------------------
  |  |   34|  43.5k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (418:9): [True: 43.5k, False: 149k]
  ------------------
  419|   108k|        case AOT_SBR:
  ------------------
  |  |   35|   108k|#define AOT_SBR (5)
  ------------------
  |  Branch (419:9): [True: 65.2k, False: 127k]
  ------------------
  420|   111k|        case AOT_PS:
  ------------------
  |  |   39|   111k|#define AOT_PS (29)
  ------------------
  |  Branch (420:9): [True: 3.02k, False: 189k]
  ------------------
  421|   111k|          scale_spread_energy = 0.5f;
  422|   111k|          break;
  423|       |
  424|  16.1k|        case AOT_AAC_LD:
  ------------------
  |  |   36|  16.1k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (424:9): [True: 16.1k, False: 176k]
  ------------------
  425|  81.0k|        case AOT_AAC_ELD:
  ------------------
  |  |   37|  81.0k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (425:9): [True: 64.8k, False: 128k]
  ------------------
  426|  81.0k|          scale_spread_energy = 0.56f;
  427|  81.0k|          break;
  428|   192k|      }
  429|   192k|    } else {
  430|  65.6k|      scale_spread_energy = 0.63f;
  431|  65.6k|    }
  432|       |
  433|   709k|    for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (433:28): [True: 451k, False: 258k]
  ------------------
  434|   451k|         scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  435|   451k|      ptr_scf_band_spread_energy = &pstr_psy_chan_out->ptr_sfb_spread_energy[scf_band_grp];
  436|   451k|      scf_band_cnt = pstr_psy_chan_out->max_sfb_per_grp;
  437|  9.02M|      for (scf_band = scf_band_cnt - 1; scf_band >= 0; scf_band--) {
  ------------------
  |  Branch (437:41): [True: 8.57M, False: 451k]
  ------------------
  438|  8.57M|        *ptr_scf_band_spread_energy = *ptr_scf_band_spread_energy * scale_spread_energy;
  439|  8.57M|        ptr_scf_band_spread_energy++;
  440|  8.57M|      }
  441|   451k|    }
  442|   258k|  }
  443|       |
  444|   181k|  if (pstr_ah_param->modify_min_snr) {
  ------------------
  |  Branch (444:7): [True: 93.4k, False: 87.8k]
  ------------------
  445|   212k|    for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (445:20): [True: 118k, False: 93.4k]
  ------------------
  446|   118k|      ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  447|   118k|      ptr_scf_band_energy = pstr_psy_chan_out->ptr_sfb_energy;
  448|       |
  449|   118k|      ptr_scf_band_min_snr = pstr_psy_chan_out->sfb_min_snr;
  450|       |
  451|   302k|      for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (451:30): [True: 183k, False: 118k]
  ------------------
  452|   183k|           scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  453|  4.22M|        for (scf_band = 0; scf_band < pstr_psy_chan_out->max_sfb_per_grp; scf_band++) {
  ------------------
  |  Branch (453:28): [True: 4.03M, False: 183k]
  ------------------
  454|  4.03M|          FLOAT32 sfb_en_m1, sfb_en_p1, avg_energy;
  455|  4.03M|          if (scf_band > 0) {
  ------------------
  |  Branch (455:15): [True: 3.85M, False: 183k]
  ------------------
  456|  3.85M|            sfb_en_m1 = ptr_scf_band_energy[scf_band_grp + scf_band - 1];
  457|  3.85M|          } else {
  458|   183k|            sfb_en_m1 = ptr_scf_band_energy[scf_band_grp];
  459|   183k|          }
  460|  4.03M|          if (scf_band < pstr_psy_chan_out->max_sfb_per_grp - 1) {
  ------------------
  |  Branch (460:15): [True: 3.85M, False: 183k]
  ------------------
  461|  3.85M|            sfb_en_p1 = ptr_scf_band_energy[scf_band_grp + scf_band + 1];
  462|  3.85M|          } else {
  463|   183k|            sfb_en_p1 = ptr_scf_band_energy[scf_band_grp + scf_band];
  464|   183k|          }
  465|       |
  466|  4.03M|          avg_energy = (sfb_en_m1 + sfb_en_p1) / (FLOAT32)2.0f;
  467|  4.03M|          sfb_energy = ptr_scf_band_energy[scf_band_grp + scf_band];
  468|  4.03M|          FLOAT32 temp_min_snr = 0.0f;
  469|  4.03M|          if (sfb_energy > avg_energy) {
  ------------------
  |  Branch (469:15): [True: 1.56M, False: 2.47M]
  ------------------
  470|  1.56M|            switch (aot) {
  ------------------
  |  Branch (470:21): [True: 1.56M, False: 0]
  ------------------
  471|   178k|              case AOT_AAC_LC:
  ------------------
  |  |   34|   178k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (471:15): [True: 178k, False: 1.38M]
  ------------------
  472|  1.04M|              case AOT_SBR:
  ------------------
  |  |   35|  1.04M|#define AOT_SBR (5)
  ------------------
  |  Branch (472:15): [True: 865k, False: 698k]
  ------------------
  473|  1.22M|              case AOT_PS:
  ------------------
  |  |   39|  1.22M|#define AOT_PS (29)
  ------------------
  |  Branch (473:15): [True: 180k, False: 1.38M]
  ------------------
  474|  1.22M|                temp_min_snr = MAX((FLOAT32)0.8f * avg_energy / sfb_energy, (FLOAT32)0.316f);
  ------------------
  |  |   24|  1.22M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.07M, False: 152k]
  |  |  ------------------
  ------------------
  475|  1.22M|                break;
  476|       |
  477|  57.6k|              case AOT_AAC_LD:
  ------------------
  |  |   36|  57.6k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (477:15): [True: 57.6k, False: 1.50M]
  ------------------
  478|   339k|              case AOT_AAC_ELD:
  ------------------
  |  |   37|   339k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (478:15): [True: 282k, False: 1.28M]
  ------------------
  479|   339k|                temp_min_snr = MAX((FLOAT32)0.8f * avg_energy / sfb_energy, (FLOAT32)0.408f);
  ------------------
  |  |   24|   339k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 268k, False: 71.2k]
  |  |  ------------------
  ------------------
  480|   339k|                break;
  481|  1.56M|            }
  482|  1.56M|            if (pstr_psy_chan_out->window_sequence != SHORT_WINDOW) {
  ------------------
  |  |   33|  1.56M|#define SHORT_WINDOW 2
  ------------------
  |  Branch (482:17): [True: 1.07M, False: 485k]
  ------------------
  483|  1.07M|              switch (aot) {
  ------------------
  |  Branch (483:23): [True: 261k, False: 816k]
  ------------------
  484|   162k|                case AOT_AAC_LC:
  ------------------
  |  |   34|   162k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (484:17): [True: 162k, False: 915k]
  ------------------
  485|   203k|                case AOT_PS:
  ------------------
  |  |   39|   203k|#define AOT_PS (29)
  ------------------
  |  Branch (485:17): [True: 41.2k, False: 1.03M]
  ------------------
  486|   203k|                  temp_min_snr = MAX(temp_min_snr, (FLOAT32)0.316f);
  ------------------
  |  |   24|   203k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 181k, False: 22.6k]
  |  |  ------------------
  ------------------
  487|   203k|                  break;
  488|       |
  489|  57.6k|                case AOT_AAC_LD:
  ------------------
  |  |   36|  57.6k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (489:17): [True: 57.6k, False: 1.02M]
  ------------------
  490|  57.6k|                  temp_min_snr = MAX(temp_min_snr, (FLOAT32)0.408f);
  ------------------
  |  |   24|  57.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 47.9k, False: 9.71k]
  |  |  ------------------
  ------------------
  491|  57.6k|                  break;
  492|  1.07M|              }
  493|  1.07M|            } else {
  494|   485k|              temp_min_snr = MAX(temp_min_snr, (FLOAT32)0.5f);
  ------------------
  |  |   24|   485k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 277k, False: 207k]
  |  |  ------------------
  ------------------
  495|   485k|            }
  496|  1.56M|            ptr_scf_band_min_snr[scf_band_grp + scf_band] =
  497|  1.56M|                MIN(ptr_scf_band_min_snr[scf_band_grp + scf_band], temp_min_snr);
  ------------------
  |  |   23|  1.56M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 842k, False: 720k]
  |  |  ------------------
  ------------------
  498|  1.56M|          }
  499|       |
  500|  4.03M|          if (((FLOAT32)2.0f * sfb_energy < avg_energy) && (sfb_energy > (FLOAT32)0.0f)) {
  ------------------
  |  Branch (500:15): [True: 835k, False: 3.20M]
  |  Branch (500:60): [True: 828k, False: 6.37k]
  ------------------
  501|   828k|            temp_min_snr = avg_energy / ((FLOAT32)2.0f * sfb_energy) *
  502|   828k|                           ptr_scf_band_min_snr[scf_band_grp + scf_band];
  503|   828k|            temp_min_snr = MIN((FLOAT32)0.8f, temp_min_snr);
  ------------------
  |  |   23|   828k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 504k, False: 323k]
  |  |  ------------------
  ------------------
  504|   828k|            ptr_scf_band_min_snr[scf_band_grp + scf_band] =
  505|   828k|                MIN(temp_min_snr, ptr_scf_band_min_snr[scf_band_grp + scf_band] * (FLOAT32)3.16f);
  ------------------
  |  |   23|   828k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 682k, False: 145k]
  |  |  ------------------
  ------------------
  506|   828k|          }
  507|  4.03M|        }
  508|   183k|      }
  509|   118k|    }
  510|  93.4k|  }
  511|       |
  512|   181k|  if (num_chans == 2) {
  ------------------
  |  Branch (512:7): [True: 77.3k, False: 103k]
  ------------------
  513|  77.3k|    ixheaace_psy_out_channel *pstr_psy_out_mid = pstr_psy_out[chn];
  514|  77.3k|    ixheaace_psy_out_channel *pstr_psy_out_side = pstr_psy_out[chn + 1];
  515|  77.3k|    WORD32 sfb;
  516|       |
  517|  3.31M|    for (sfb = 0; sfb < pstr_psy_out_mid->sfb_count; sfb++) {
  ------------------
  |  Branch (517:19): [True: 3.23M, False: 77.3k]
  ------------------
  518|  3.23M|      if (pstr_psy_out[chn]->ms_used[sfb]) {
  ------------------
  |  Branch (518:11): [True: 2.63M, False: 604k]
  ------------------
  519|  2.63M|        FLOAT32 sfb_en_mid = pstr_psy_out_mid->ptr_sfb_energy[sfb];
  520|  2.63M|        FLOAT32 sfb_en_side = pstr_psy_out_side->ptr_sfb_energy[sfb];
  521|  2.63M|        FLOAT32 max_sfb_en = MAX(sfb_en_mid, sfb_en_side);
  ------------------
  |  |   24|  2.63M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.17M, False: 456k]
  |  |  ------------------
  ------------------
  522|  2.63M|        FLOAT32 max_thr = 0.25f * pstr_psy_out_mid->sfb_min_snr[sfb] * max_sfb_en;
  523|       |
  524|  2.63M|        pstr_psy_out_mid->sfb_min_snr[sfb] = (FLOAT32)MAX(
  ------------------
  |  |   24|  5.26M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.32M, False: 310k]
  |  |  |  Branch (24:27): [True: 62, False: 2.63M]
  |  |  |  Branch (24:39): [True: 62, False: 310k]
  |  |  ------------------
  ------------------
  525|  2.63M|            pstr_psy_out_mid->sfb_min_snr[sfb],
  526|  2.63M|            MIN(MAX_FLT_VAL, ((FLOAT32)max_thr / (MIN_FLT_VAL + (FLOAT32)sfb_en_mid))));
  527|       |
  528|  2.63M|        if (pstr_psy_out_mid->ptr_sfb_energy[sfb] <= 1.0f) {
  ------------------
  |  Branch (528:13): [True: 421k, False: 2.21M]
  ------------------
  529|   421k|          pstr_psy_out_mid->ptr_sfb_energy[sfb] =
  530|   421k|              MIN(pstr_psy_out_mid->ptr_sfb_energy[sfb], 0.8f);
  ------------------
  |  |   23|   421k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 419k, False: 1.94k]
  |  |  ------------------
  ------------------
  531|   421k|        }
  532|       |
  533|  2.63M|        pstr_psy_out_side->sfb_min_snr[sfb] = (FLOAT32)MAX(
  ------------------
  |  |   24|  5.26M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 400k, False: 2.23M]
  |  |  |  Branch (24:27): [True: 1.01M, False: 1.61M]
  |  |  |  Branch (24:39): [True: 1.01M, False: 1.21M]
  |  |  ------------------
  ------------------
  534|  2.63M|            pstr_psy_out_side->sfb_min_snr[sfb],
  535|  2.63M|            MIN(MAX_FLT_VAL, ((FLOAT32)max_thr / (MIN_FLT_VAL + (FLOAT32)sfb_en_side))));
  536|       |
  537|  2.63M|        if (pstr_psy_out_side->sfb_min_snr[sfb] <= 1.0f) {
  ------------------
  |  Branch (537:13): [True: 877k, False: 1.75M]
  ------------------
  538|   877k|          pstr_psy_out_side->sfb_min_snr[sfb] = MIN(pstr_psy_out_side->sfb_min_snr[sfb], 0.8f);
  ------------------
  |  |   23|   877k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 606k, False: 271k]
  |  |  ------------------
  ------------------
  539|   877k|        }
  540|  2.63M|      }
  541|  3.23M|    }
  542|  77.3k|  }
  543|       |
  544|   439k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (544:18): [True: 258k, False: 181k]
  ------------------
  545|   258k|    ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  546|   709k|    for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (546:28): [True: 451k, False: 258k]
  ------------------
  547|   451k|         scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  548|  9.02M|      for (scf_band = 0; scf_band < pstr_psy_chan_out->max_sfb_per_grp; scf_band++) {
  ------------------
  |  Branch (548:26): [True: 8.57M, False: 451k]
  ------------------
  549|  8.57M|        if (pstr_psy_chan_out->ptr_sfb_spread_energy[scf_band_grp + scf_band] >
  ------------------
  |  Branch (549:13): [True: 2.62M, False: 5.94M]
  ------------------
  550|  8.57M|                pstr_psy_chan_out->ptr_sfb_energy[scf_band_grp + scf_band] ||
  551|  5.94M|            pstr_psy_chan_out->sfb_min_snr[scf_band_grp + scf_band] > 1.0f) {
  ------------------
  |  Branch (551:13): [True: 7.07k, False: 5.93M]
  ------------------
  552|  2.63M|          ah_flag[ch][scf_band_grp + scf_band] = NO_AH;
  553|  5.93M|        } else {
  554|  5.93M|          ah_flag[ch][scf_band_grp + scf_band] = AH_INACTIVE;
  555|  5.93M|        }
  556|  8.57M|      }
  557|       |
  558|   451k|      for (scf_band = pstr_psy_chan_out->max_sfb_per_grp;
  559|  2.50M|           scf_band < pstr_psy_chan_out->sfb_per_group; scf_band++) {
  ------------------
  |  Branch (559:12): [True: 2.05M, False: 451k]
  ------------------
  560|  2.05M|        ah_flag[ch][scf_band_grp + scf_band] = NO_AH;
  561|  2.05M|      }
  562|   451k|    }
  563|   258k|  }
  564|   181k|}
ixheaace_adjust_threshold.c:iaace_reduce_thr:
  570|   449k|    const FLOAT32 red_value, WORD32 num_channels, WORD32 chn) {
  571|   449k|  WORD32 ch, sfb_group, sfb;
  572|   449k|  FLOAT32 sfb_energy, sfb_threshold, sfb_thr_reduced;
  573|   449k|  FLOAT32 *ptr_sfb_energy_fix, *ptr_sfb_threshold_fix, *ptr_sfb_min_snr_fix, *ptr_thr_exp_fix;
  574|       |
  575|  1.08M|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (575:18): [True: 639k, False: 449k]
  ------------------
  576|   639k|    ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  577|   639k|    ptr_sfb_energy_fix = pstr_psy_chan_out->ptr_sfb_energy;
  578|   639k|    ptr_sfb_threshold_fix = pstr_psy_chan_out->ptr_sfb_thr;
  579|   639k|    ptr_sfb_min_snr_fix = pstr_psy_chan_out->sfb_min_snr;
  580|   639k|    ptr_thr_exp_fix = &thr_exp[ch][0];
  581|  1.73M|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (581:25): [True: 1.09M, False: 639k]
  ------------------
  582|  1.09M|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  583|  21.9M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (583:21): [True: 20.8M, False: 1.09M]
  ------------------
  584|  20.8M|        sfb_energy = ptr_sfb_energy_fix[sfb_group + sfb];
  585|  20.8M|        sfb_threshold = ptr_sfb_threshold_fix[sfb_group + sfb];
  586|  20.8M|        if (sfb_energy > sfb_threshold) {
  ------------------
  |  Branch (586:13): [True: 14.9M, False: 5.85M]
  ------------------
  587|  14.9M|          sfb_thr_reduced =
  588|  14.9M|              (FLOAT32)pow((ptr_thr_exp_fix[sfb_group + sfb] + red_value), INV_RED_EXP_VAL);
  ------------------
  |  |   71|  14.9M|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   70|  14.9M|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  589|       |
  590|  14.9M|          if ((sfb_thr_reduced > ptr_sfb_min_snr_fix[sfb_group + sfb] * sfb_energy) &&
  ------------------
  |  Branch (590:15): [True: 6.15M, False: 8.84M]
  ------------------
  591|  6.15M|              (ah_flag[ch][sfb_group + sfb] != NO_AH)) {
  ------------------
  |  Branch (591:15): [True: 5.64M, False: 505k]
  ------------------
  592|  5.64M|            sfb_thr_reduced =
  593|  5.64M|                MAX(ptr_sfb_min_snr_fix[sfb_group + sfb] * sfb_energy, sfb_threshold);
  ------------------
  |  |   24|  5.64M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.55M, False: 3.08M]
  |  |  ------------------
  ------------------
  594|  5.64M|            ah_flag[ch][sfb_group + sfb] = AH_ACTIVE;
  595|  5.64M|          }
  596|  14.9M|          ptr_sfb_threshold_fix[sfb_group + sfb] = sfb_thr_reduced;
  597|  14.9M|        }
  598|  20.8M|      }
  599|  1.09M|    }
  600|   639k|  }
  601|   449k|}
ixheaace_adjust_threshold.c:iaace_calc_pe_no_active_holes:
  607|   271k|    ixheaace_psy_out_channel **pstr_psy_out, WORD32 num_channels, WORD32 chn) {
  608|   271k|  WORD32 ch, sfb_group, sfb;
  609|   271k|  *ptr_pe = 0.0f;
  610|   271k|  *ptr_const_part = 0.0f;
  611|   271k|  *ptr_num_active_lines = 0;
  612|       |
  613|   656k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (613:18): [True: 385k, False: 271k]
  ------------------
  614|   385k|    ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  615|   385k|    ia_qc_pe_chan_data_struct *ptr_pe_chan_data = &pstr_qs_pe_data->pe_ch_data[ch];
  616|       |
  617|  1.03M|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (617:25): [True: 652k, False: 385k]
  ------------------
  618|   652k|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  619|  13.0M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (619:21): [True: 12.4M, False: 652k]
  ------------------
  620|  12.4M|        if (ah_flag[ch][sfb_group + sfb] < AH_ACTIVE) {
  ------------------
  |  Branch (620:13): [True: 9.24M, False: 3.15M]
  ------------------
  621|  9.24M|          *ptr_pe += ptr_pe_chan_data->sfb_pe[sfb_group + sfb];
  622|  9.24M|          *ptr_const_part += ptr_pe_chan_data->sfb_const_part[sfb_group + sfb];
  623|  9.24M|          *ptr_num_active_lines += ptr_pe_chan_data->num_sfb_active_lines[sfb_group + sfb];
  624|  9.24M|        }
  625|  12.4M|      }
  626|   652k|    }
  627|   385k|  }
  628|   271k|}
ixheaace_adjust_threshold.c:iaace_correct_thr:
  635|   128k|    const FLOAT32 red_value, const FLOAT32 delta_pe, WORD32 num_channels, WORD32 chn) {
  636|   128k|  WORD32 i, ch, sfb_group, sfb;
  637|   128k|  FLOAT32 delta_sfb_pe;
  638|   128k|  FLOAT32 thr_factor;
  639|   128k|  FLOAT32 sfb_pe_factors[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_GROUPED_SCALE_FACTOR_BAND],
  640|   128k|      norm_factor[IXHEAACE_MAX_CH_IN_BS_ELE] = {MIN_FLT_VAL};
  ------------------
  |  |   58|   128k|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  641|   128k|  FLOAT32 sfb_en, sfb_thr, sfb_thr_reduced;
  642|   128k|  FLOAT32 *ptr_thr_exp;
  643|   128k|  FLOAT32 *ptr_sfb_energy, *ptr_sfb_thr, *ptr_sfb_min_snr;
  644|   128k|  ixheaace_psy_out_channel *pstr_psy_chan_out = NULL;
  645|   128k|  ia_qc_pe_chan_data_struct *pstr_pe_chan_data = NULL;
  646|       |
  647|   316k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (647:18): [True: 187k, False: 128k]
  ------------------
  648|   187k|    pstr_psy_chan_out = pstr_psy_out[ch];
  649|   187k|    pstr_pe_chan_data = &pstr_qs_pe_data->pe_ch_data[ch];
  650|   187k|    norm_factor[ch] = MIN_FLT_VAL;
  ------------------
  |  |   58|   187k|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  651|   187k|    ptr_thr_exp = thr_exp[ch];
  652|       |
  653|   553k|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (653:25): [True: 366k, False: 187k]
  ------------------
  654|   366k|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  655|  6.89M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (655:21): [True: 6.52M, False: 366k]
  ------------------
  656|  6.52M|        if ((ah_flag[ch][sfb_group + sfb] < AH_ACTIVE) || (delta_pe > 0)) {
  ------------------
  |  Branch (656:13): [True: 5.33M, False: 1.19M]
  |  Branch (656:59): [True: 308k, False: 884k]
  ------------------
  657|  5.64M|          sfb_pe_factors[ch][sfb_group + sfb] =
  658|  5.64M|              pstr_pe_chan_data->num_sfb_active_lines[sfb_group + sfb] /
  659|  5.64M|              (ptr_thr_exp[sfb_group + sfb] + red_value);
  660|  5.64M|          norm_factor[ch] += sfb_pe_factors[ch][sfb_group + sfb];
  661|  5.64M|        } else {
  662|   884k|          sfb_pe_factors[ch][sfb_group + sfb] = 0.0f;
  663|   884k|        }
  664|  6.52M|      }
  665|   366k|    }
  666|   187k|  }
  667|   128k|  if (num_channels > 1) {
  ------------------
  |  Branch (667:7): [True: 58.4k, False: 70.3k]
  ------------------
  668|  58.4k|    norm_factor[chn] = norm_factor[chn] + norm_factor[chn + 1];
  669|  58.4k|  }
  670|   128k|  norm_factor[chn] = 1.0f / norm_factor[chn];
  671|       |
  672|   316k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (672:18): [True: 187k, False: 128k]
  ------------------
  673|   187k|    pstr_psy_chan_out = pstr_psy_out[ch];
  674|   187k|    pstr_pe_chan_data = &pstr_qs_pe_data->pe_ch_data[ch];
  675|   187k|    ptr_sfb_energy = pstr_psy_chan_out->ptr_sfb_energy;
  676|   187k|    ptr_sfb_thr = pstr_psy_chan_out->ptr_sfb_thr;
  677|   187k|    ptr_sfb_min_snr = pstr_psy_chan_out->sfb_min_snr;
  678|       |
  679|   553k|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (679:25): [True: 366k, False: 187k]
  ------------------
  680|   366k|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  681|   366k|      i = sfb_group;
  682|  6.89M|      for (sfb = pstr_psy_chan_out->max_sfb_per_grp - 1; sfb >= 0; sfb--, i++) {
  ------------------
  |  Branch (682:58): [True: 6.52M, False: 366k]
  ------------------
  683|  6.52M|        delta_sfb_pe = sfb_pe_factors[ch][i] * norm_factor[chn] * delta_pe;
  684|  6.52M|        if (pstr_pe_chan_data->num_sfb_active_lines[i] > (FLOAT32)0.5f) {
  ------------------
  |  Branch (684:13): [True: 4.40M, False: 2.11M]
  ------------------
  685|  4.40M|          sfb_en = ptr_sfb_energy[i];
  686|  4.40M|          sfb_thr = ptr_sfb_thr[i];
  687|  4.40M|          thr_factor = MIN(-delta_sfb_pe / pstr_pe_chan_data->num_sfb_active_lines[i], 20.f);
  ------------------
  |  |   23|  4.40M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 4.40M, False: 296]
  |  |  ------------------
  ------------------
  688|  4.40M|          thr_factor = (FLOAT32)pow(2.0f, thr_factor);
  689|  4.40M|          sfb_thr_reduced = sfb_thr * thr_factor;
  690|       |
  691|  4.40M|          if ((sfb_thr_reduced > ptr_sfb_min_snr[i] * sfb_en) &&
  ------------------
  |  Branch (691:15): [True: 116k, False: 4.28M]
  ------------------
  692|   116k|              (ah_flag[ch][i] == AH_INACTIVE)) {
  ------------------
  |  Branch (692:15): [True: 39.8k, False: 76.8k]
  ------------------
  693|  39.8k|            sfb_thr_reduced = MAX(ptr_sfb_min_snr[i] * sfb_en, sfb_thr);
  ------------------
  |  |   24|  39.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 39.8k, False: 1]
  |  |  ------------------
  ------------------
  694|  39.8k|            ah_flag[ch][i] = AH_ACTIVE;
  695|  39.8k|          }
  696|  4.40M|          ptr_sfb_thr[i] = sfb_thr_reduced;
  697|  4.40M|        }
  698|  6.52M|      }
  699|   366k|    }
  700|   187k|  }
  701|   128k|}
ixheaace_adjust_threshold.c:iaace_reduce_min_snr:
  706|  52.4k|    const FLOAT32 desired_pe, WORD32 num_channels, WORD32 chn) {
  707|  52.4k|  WORD32 sfb, sfb_sub_win, ch;
  708|  52.4k|  FLOAT32 delta_pe;
  709|       |
  710|  52.4k|  sfb_sub_win = pstr_psy_out[chn]->max_sfb_per_grp;
  711|       |
  712|  1.48M|  while (pstr_qs_pe_data->pe > desired_pe && sfb_sub_win > 0) {
  ------------------
  |  Branch (712:10): [True: 1.47M, False: 5.38k]
  |  Branch (712:46): [True: 1.42M, False: 47.0k]
  ------------------
  713|  1.42M|    sfb_sub_win--;
  714|  2.92M|    for (sfb = sfb_sub_win; sfb < pstr_psy_out[chn]->sfb_count;
  ------------------
  |  Branch (714:29): [True: 1.50M, False: 1.42M]
  ------------------
  715|  1.50M|         sfb += pstr_psy_out[chn]->sfb_per_group) {
  716|  3.53M|      for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (716:22): [True: 2.03M, False: 1.50M]
  ------------------
  717|  2.03M|        if (ah_flag[ch][sfb] != NO_AH && pstr_psy_out[ch]->sfb_min_snr[sfb] < MIN_SNR_LIMIT) {
  ------------------
  |  |   72|  1.52M|#define MIN_SNR_LIMIT 0.8f
  ------------------
  |  Branch (717:13): [True: 1.52M, False: 506k]
  |  Branch (717:42): [True: 529k, False: 999k]
  ------------------
  718|   529k|          pstr_psy_out[ch]->sfb_min_snr[sfb] = MIN_SNR_LIMIT;
  ------------------
  |  |   72|   529k|#define MIN_SNR_LIMIT 0.8f
  ------------------
  719|   529k|          pstr_psy_out[ch]->ptr_sfb_thr[sfb] =
  720|   529k|              pstr_psy_out[ch]->ptr_sfb_energy[sfb] * pstr_psy_out[ch]->sfb_min_snr[sfb];
  721|   529k|          delta_pe = pstr_qs_pe_data->pe_ch_data[ch].sfb_lines[sfb] * 1.5f -
  722|   529k|                     pstr_qs_pe_data->pe_ch_data[ch].sfb_pe[sfb];
  723|   529k|          pstr_qs_pe_data->pe += delta_pe;
  724|   529k|          pstr_qs_pe_data->pe_ch_data[ch].pe += delta_pe;
  725|   529k|        }
  726|  2.03M|      }
  727|  1.50M|      if (pstr_qs_pe_data->pe <= desired_pe) {
  ------------------
  |  Branch (727:11): [True: 5.38k, False: 1.49M]
  ------------------
  728|  5.38k|        break;
  729|  5.38k|      }
  730|  1.50M|    }
  731|  1.42M|  }
  732|  52.4k|}
ixheaace_adjust_threshold.c:iaace_allow_more_holes:
  738|  52.4k|    WORD32 chn) {
  739|  52.4k|  WORD32 sfb, ch;
  740|  52.4k|  FLOAT32 act_pe = pstr_qs_pe_data->pe;
  741|       |
  742|  52.4k|  if (num_channels == 2 &&
  ------------------
  |  Branch (742:7): [True: 18.8k, False: 33.5k]
  ------------------
  743|  18.8k|      pstr_psy_out[chn]->window_sequence == pstr_psy_out[chn + 1]->window_sequence) {
  ------------------
  |  Branch (743:7): [True: 18.8k, False: 0]
  ------------------
  744|  18.8k|    ixheaace_psy_out_channel *pstr_psy_out_left = pstr_psy_out[chn];
  745|  18.8k|    ixheaace_psy_out_channel *pstr_psy_out_right = pstr_psy_out[chn + 1];
  746|       |
  747|   635k|    for (sfb = 0; sfb < pstr_psy_out_left->sfb_count; sfb++) {
  ------------------
  |  Branch (747:19): [True: 618k, False: 16.6k]
  ------------------
  748|   618k|      if (pstr_psy_out[chn]->ms_used[sfb]) {
  ------------------
  |  Branch (748:11): [True: 462k, False: 156k]
  ------------------
  749|   462k|        if (ah_flag[chn + 1][sfb] != NO_AH &&
  ------------------
  |  Branch (749:13): [True: 80.7k, False: 381k]
  ------------------
  750|  80.7k|            0.4f * pstr_psy_out_left->sfb_min_snr[sfb] * pstr_psy_out_left->ptr_sfb_energy[sfb] >
  ------------------
  |  Branch (750:13): [True: 7.06k, False: 73.6k]
  ------------------
  751|  80.7k|                pstr_psy_out_right->ptr_sfb_energy[sfb]) {
  752|  7.06k|          ah_flag[chn + 1][sfb] = NO_AH;
  753|       |
  754|  7.06k|          pstr_psy_out_right->ptr_sfb_thr[sfb] = 2.0f * pstr_psy_out_right->ptr_sfb_energy[sfb];
  755|       |
  756|  7.06k|          act_pe -= pstr_qs_pe_data->pe_ch_data[chn + 1].sfb_pe[sfb];
  757|   455k|        } else {
  758|   455k|          if (ah_flag[chn][sfb] != NO_AH && 0.4f * pstr_psy_out_right->sfb_min_snr[sfb] *
  ------------------
  |  Branch (758:15): [True: 358k, False: 96.9k]
  |  Branch (758:45): [True: 3.13k, False: 355k]
  ------------------
  759|   358k|                                                    pstr_psy_out_right->ptr_sfb_energy[sfb] >
  760|   358k|                                                pstr_psy_out_left->ptr_sfb_energy[sfb]) {
  761|  3.13k|            ah_flag[chn][sfb] = NO_AH;
  762|       |
  763|  3.13k|            pstr_psy_out_left->ptr_sfb_thr[sfb] = 2.0f * pstr_psy_out_left->ptr_sfb_energy[sfb];
  764|       |
  765|  3.13k|            act_pe -= pstr_qs_pe_data->pe_ch_data[chn].sfb_pe[sfb];
  766|  3.13k|          }
  767|   455k|        }
  768|   462k|        if (act_pe < desired_pe) {
  ------------------
  |  Branch (768:13): [True: 2.21k, False: 460k]
  ------------------
  769|  2.21k|          break;
  770|  2.21k|        }
  771|   462k|      }
  772|   618k|    }
  773|  18.8k|  }
  774|  52.4k|  if (act_pe > desired_pe) {
  ------------------
  |  Branch (774:7): [True: 46.4k, False: 5.91k]
  ------------------
  775|  46.4k|    WORD32 start_sfb[IXHEAACE_MAX_CH_IN_BS_ELE] = {0};
  776|  46.4k|    FLOAT32 average_energy, min_energy;
  777|  46.4k|    WORD32 ah_cnt;
  778|  46.4k|    WORD32 en_idx;
  779|  46.4k|    FLOAT32 energy[4];
  780|  46.4k|    WORD32 min_sfb, max_sfb;
  781|  46.4k|    WORD32 done;
  782|       |
  783|   109k|    for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (783:20): [True: 63.1k, False: 46.4k]
  ------------------
  784|  63.1k|      if (pstr_psy_out[ch]->window_sequence != SHORT_WINDOW) {
  ------------------
  |  |   33|  63.1k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (784:11): [True: 59.3k, False: 3.74k]
  ------------------
  785|  59.3k|        start_sfb[ch] = pstr_str_ah_param->start_sfb_long;
  786|  59.3k|      } else {
  787|  3.74k|        start_sfb[ch] = pstr_str_ah_param->start_sfb_short;
  788|  3.74k|      }
  789|  63.1k|    }
  790|       |
  791|  46.4k|    average_energy = 0.0f;
  792|  46.4k|    min_energy = MAX_FLT_VAL;
  ------------------
  |  |   57|  46.4k|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  793|  46.4k|    ah_cnt = 0;
  794|   109k|    for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (794:20): [True: 63.1k, False: 46.4k]
  ------------------
  795|  63.1k|      ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  796|  2.12M|      for (sfb = start_sfb[ch]; sfb < pstr_psy_chan_out->sfb_count; sfb++) {
  ------------------
  |  Branch (796:33): [True: 2.05M, False: 63.1k]
  ------------------
  797|  2.05M|        if ((ah_flag[ch][sfb] != NO_AH) &&
  ------------------
  |  Branch (797:13): [True: 1.10M, False: 954k]
  ------------------
  798|  1.10M|            (pstr_psy_chan_out->ptr_sfb_energy[sfb] > pstr_psy_chan_out->ptr_sfb_thr[sfb])) {
  ------------------
  |  Branch (798:13): [True: 1.04M, False: 64.3k]
  ------------------
  799|  1.04M|          min_energy = MIN(min_energy, pstr_psy_chan_out->ptr_sfb_energy[sfb]);
  ------------------
  |  |   23|  1.04M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 570k, False: 470k]
  |  |  ------------------
  ------------------
  800|  1.04M|          average_energy += pstr_psy_chan_out->ptr_sfb_energy[sfb];
  801|  1.04M|          ah_cnt++;
  802|  1.04M|        }
  803|  2.05M|      }
  804|  63.1k|    }
  805|       |
  806|  46.4k|    average_energy = MIN(MAX_FLT_VAL, average_energy / (ah_cnt + MIN_FLT_VAL));
  ------------------
  |  |   23|  46.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 46.4k]
  |  |  ------------------
  ------------------
  807|       |
  808|   232k|    for (en_idx = 0; en_idx < 4; en_idx++) {
  ------------------
  |  Branch (808:22): [True: 185k, False: 46.4k]
  ------------------
  809|   185k|      energy[en_idx] = min_energy * (FLOAT32)pow(average_energy / (min_energy + MIN_FLT_VAL),
  ------------------
  |  |   58|   185k|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  810|   185k|                                                 (2 * en_idx + 1) / 7.0f);
  811|   185k|    }
  812|  46.4k|    max_sfb = pstr_psy_out[chn]->sfb_count - 1;
  813|  46.4k|    min_sfb = start_sfb[chn];
  814|       |
  815|  46.4k|    if (num_channels == 2) {
  ------------------
  |  Branch (815:9): [True: 16.6k, False: 29.8k]
  ------------------
  816|  16.6k|      max_sfb = MAX(max_sfb, pstr_psy_out[chn + 1]->sfb_count - 1);
  ------------------
  |  |   24|  16.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 16.6k]
  |  |  ------------------
  ------------------
  817|       |
  818|  16.6k|      min_sfb = MIN(min_sfb, start_sfb[chn + 1]);
  ------------------
  |  |   23|  16.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 16.6k]
  |  |  ------------------
  ------------------
  819|  16.6k|    }
  820|       |
  821|  46.4k|    sfb = max_sfb;
  822|  46.4k|    en_idx = 0;
  823|  46.4k|    done = 0;
  824|  2.31M|    while (!done) {
  ------------------
  |  Branch (824:12): [True: 2.27M, False: 46.4k]
  ------------------
  825|  5.27M|      for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (825:22): [True: 3.04M, False: 2.23M]
  ------------------
  826|  3.04M|        ixheaace_psy_out_channel *pstr_psy_chan_out = pstr_psy_out[ch];
  827|  3.04M|        if (sfb >= start_sfb[ch] && sfb < pstr_psy_chan_out->sfb_count) {
  ------------------
  |  Branch (827:13): [True: 3.04M, False: 0]
  |  Branch (827:37): [True: 3.04M, False: 0]
  ------------------
  828|  3.04M|          if (ah_flag[ch][sfb] != NO_AH &&
  ------------------
  |  Branch (828:15): [True: 1.32M, False: 1.72M]
  ------------------
  829|  1.32M|              pstr_psy_chan_out->ptr_sfb_energy[sfb] < energy[en_idx]) {
  ------------------
  |  Branch (829:15): [True: 441k, False: 879k]
  ------------------
  830|   441k|            ah_flag[ch][sfb] = NO_AH;
  831|   441k|            pstr_psy_chan_out->ptr_sfb_thr[sfb] = 2.0f * pstr_psy_chan_out->ptr_sfb_energy[sfb];
  832|   441k|            act_pe -= pstr_qs_pe_data->pe_ch_data[ch].sfb_pe[sfb];
  833|   441k|          }
  834|       |
  835|  3.04M|          if (act_pe < desired_pe) {
  ------------------
  |  Branch (835:15): [True: 37.2k, False: 3.00M]
  ------------------
  836|  37.2k|            done = 1;
  837|  37.2k|            break;
  838|  37.2k|          }
  839|  3.04M|        }
  840|  3.04M|      }
  841|  2.27M|      sfb--;
  842|  2.27M|      if (sfb < min_sfb) {
  ------------------
  |  Branch (842:11): [True: 65.3k, False: 2.20M]
  ------------------
  843|  65.3k|        sfb = max_sfb;
  844|  65.3k|        en_idx++;
  845|  65.3k|        if (en_idx >= 4) {
  ------------------
  |  Branch (845:13): [True: 9.39k, False: 55.9k]
  ------------------
  846|  9.39k|          done = 1;
  847|  9.39k|        }
  848|  65.3k|      }
  849|  2.27M|    }
  850|  46.4k|  }
  851|  52.4k|}

ixheaace_allocate:
 3552|  7.19k|IA_ERRORCODE ixheaace_allocate(pVOID pv_input, pVOID pv_output) {
 3553|  7.19k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  7.19k|#define IA_NO_ERROR 0x00000000
  ------------------
 3554|  7.19k|  WORD32 ui_api_size;
 3555|  7.19k|  pVOID pv_value;
 3556|  7.19k|  ixheaace_input_config *pstr_input_config = (ixheaace_input_config *)pv_input;
 3557|  7.19k|  ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;
 3558|  7.19k|  ixheaace_api_struct *pstr_api_struct;
 3559|  7.19k|  if (1 == pstr_input_config->usac_en) {
  ------------------
  |  Branch (3559:7): [True: 4.26k, False: 2.92k]
  ------------------
 3560|  4.26k|    pstr_input_config->aot = AOT_USAC;
  ------------------
  |  |  142|  4.26k|#define AOT_USAC (42)
  ------------------
 3561|  4.26k|  }
 3562|  7.19k|  if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   37|  14.3k|#define AOT_AAC_ELD (39)
  ------------------
                if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  13.4k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3562:7): [True: 6.25k, False: 942]
  |  Branch (3562:48): [True: 5.94k, False: 310]
  ------------------
 3563|  5.94k|      pstr_input_config->aot != AOT_AAC_LD && pstr_input_config->aot != AOT_SBR &&
  ------------------
  |  |   36|  13.1k|#define AOT_AAC_LD (23)
  ------------------
                    pstr_input_config->aot != AOT_AAC_LD && pstr_input_config->aot != AOT_SBR &&
  ------------------
  |  |  141|  12.9k|#define AOT_SBR (5)
  ------------------
  |  Branch (3563:7): [True: 5.74k, False: 197]
  |  Branch (3563:47): [True: 5.15k, False: 593]
  ------------------
 3564|  5.15k|      pstr_input_config->aot != AOT_PS && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |   39|  12.3k|#define AOT_PS (29)
  ------------------
                    pstr_input_config->aot != AOT_PS && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  4.66k|#define AOT_USAC (42)
  ------------------
  |  Branch (3564:7): [True: 4.66k, False: 488]
  |  Branch (3564:43): [True: 377, False: 4.29k]
  ------------------
 3565|    377|    return IA_EXHEAACE_API_FATAL_UNSUPPORTED_AOT;
 3566|    377|  }
 3567|  6.82k|  ui_api_size = sizeof(ixheaace_api_struct);
 3568|  6.82k|  pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] =
 3569|  6.82k|      pstr_output_config->malloc_xheaace(ui_api_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   83|  6.82k|#define EIGHT_BYTE_SIZE (8)
  ------------------
                    pstr_output_config->malloc_xheaace(ui_api_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  6.82k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
 3570|  6.82k|  if (NULL == pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count]) {
  ------------------
  |  Branch (3570:7): [True: 0, False: 6.82k]
  ------------------
 3571|      0|    return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 3572|      0|  }
 3573|  6.82k|  memset(pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count], 0, ui_api_size);
 3574|       |
 3575|  6.82k|  pstr_output_config->ui_rem =
 3576|  6.82k|      (SIZE_T)((SIZE_T)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] %
 3577|  6.82k|               BYTE_ALIGN_8);
  ------------------
  |  |   30|  6.82k|#define BYTE_ALIGN_8 (8)
  ------------------
 3578|       |
 3579|  6.82k|  pstr_output_config->pv_ia_process_api_obj =
 3580|  6.82k|      (pVOID)((WORD8 *)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] +
 3581|  6.82k|              BYTE_ALIGN_8 - pstr_output_config->ui_rem);
  ------------------
  |  |   30|  6.82k|#define BYTE_ALIGN_8 (8)
  ------------------
 3582|  6.82k|  pstr_output_config->malloc_count++;
 3583|       |
 3584|  6.82k|  pstr_api_struct = (ixheaace_api_struct *)pstr_output_config->pv_ia_process_api_obj;
 3585|  6.82k|  memset(pstr_api_struct, 0, sizeof(*pstr_api_struct));
 3586|       |
 3587|  6.82k|  ixheaace_set_default_config(pstr_api_struct, pstr_input_config);
 3588|       |
 3589|  6.82k|  err_code = ixheaace_set_config_params(pstr_api_struct, pstr_input_config);
 3590|  6.82k|  if (err_code) {
  ------------------
  |  Branch (3590:7): [True: 294, False: 6.52k]
  ------------------
 3591|    294|    return err_code;
 3592|    294|  }
 3593|       |
 3594|  6.52k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.52k|#define AOT_USAC (42)
  ------------------
  |  Branch (3594:7): [True: 4.20k, False: 2.32k]
  ------------------
 3595|  4.20k|    if (pstr_api_struct->config[0].usac_config.is_loudness_configured == 0) {
  ------------------
  |  Branch (3595:9): [True: 3.64k, False: 558]
  ------------------
 3596|  3.64k|      ixheaace_get_measured_loudness_info(pstr_api_struct, pstr_input_config);
 3597|  3.64k|      memcpy(pstr_input_config->pv_drc_cfg, &pstr_api_struct->config[0].usac_config.str_drc_cfg,
 3598|  3.64k|             sizeof(ia_drc_input_config));
 3599|  3.64k|    }
 3600|  4.20k|  }
 3601|       |
 3602|  6.52k|  pstr_output_config->ui_proc_mem_tabs_size =
 3603|  6.52k|      (sizeof(ixheaace_mem_info_struct) + sizeof(pVOID *)) * 4;
 3604|  6.52k|  pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] =
 3605|  6.52k|      pstr_output_config->malloc_xheaace(
 3606|  6.52k|          pstr_output_config->ui_proc_mem_tabs_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   83|  6.52k|#define EIGHT_BYTE_SIZE (8)
  ------------------
                        pstr_output_config->ui_proc_mem_tabs_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  6.52k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
 3607|  6.52k|  if (NULL == pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count]) {
  ------------------
  |  Branch (3607:7): [True: 0, False: 6.52k]
  ------------------
 3608|      0|    return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 3609|      0|  }
 3610|  6.52k|  memset(pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count], 0,
 3611|  6.52k|         pstr_output_config->ui_proc_mem_tabs_size);
 3612|       |
 3613|  6.52k|  pstr_output_config->ui_rem =
 3614|  6.52k|      (SIZE_T)((SIZE_T)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] %
 3615|  6.52k|               BYTE_ALIGN_8);
  ------------------
  |  |   30|  6.52k|#define BYTE_ALIGN_8 (8)
  ------------------
 3616|       |
 3617|  6.52k|  pv_value =
 3618|  6.52k|      (pVOID)((WORD8 *)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] +
 3619|  6.52k|              BYTE_ALIGN_8 - pstr_output_config->ui_rem);
  ------------------
  |  |   30|  6.52k|#define BYTE_ALIGN_8 (8)
  ------------------
 3620|  6.52k|  if (pv_value == NULL) {
  ------------------
  |  Branch (3620:7): [True: 0, False: 6.52k]
  ------------------
 3621|      0|    return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 3622|      0|  }
 3623|  6.52k|  memset(pv_value, 0, (sizeof(ixheaace_mem_info_struct) + sizeof(pVOID *)) * 4);
 3624|       |
 3625|  6.52k|  pstr_api_struct->pstr_mem_info = (ixheaace_mem_info_struct *)pv_value;
 3626|  6.52k|  pstr_api_struct->pp_mem = (pVOID *)((WORD8 *)pv_value + sizeof(ixheaace_mem_info_struct) * 4);
 3627|       |
 3628|  6.52k|  pstr_output_config->malloc_count++;
 3629|       |
 3630|  6.52k|  ixheaace_fill_mem_tabs(pstr_api_struct, pstr_input_config->aot);
 3631|       |
 3632|  6.52k|  err_code =
 3633|  6.52k|      ixheaace_alloc_and_assign_mem(pstr_api_struct, pstr_output_config, pstr_input_config);
 3634|  6.52k|  if (err_code) {
  ------------------
  |  Branch (3634:7): [True: 0, False: 6.52k]
  ------------------
 3635|      0|    return err_code;
 3636|      0|  }
 3637|       |
 3638|  6.52k|  pstr_output_config->is_loudness_configured =
 3639|  6.52k|      pstr_api_struct->config[0].usac_config.is_loudness_configured;
 3640|       |
 3641|  6.52k|  return err_code;
 3642|  6.52k|}
ixheaace_init:
 3644|  6.52k|IA_ERRORCODE ixheaace_init(pVOID pstr_obj_ixheaace, pVOID pv_input, pVOID pv_output) {
 3645|  6.52k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  6.52k|#define IA_NO_ERROR 0x00000000
  ------------------
 3646|  6.52k|  WORD32 frame_length;
 3647|  6.52k|  WORD32 channels, ele_idx;
 3648|  6.52k|  ixheaace_api_struct *pstr_api_struct = (ixheaace_api_struct *)pstr_obj_ixheaace;
 3649|  6.52k|  ixheaace_input_config *pstr_input_config = (ixheaace_input_config *)pv_input;
 3650|  6.52k|  ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;
 3651|  6.52k|  WORD32 total_bitrate_used = 0;
 3652|  6.52k|  frame_length = pstr_input_config->frame_length;
 3653|  6.52k|  channels = 0;
 3654|  15.5k|  for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (3654:21): [True: 8.97k, False: 6.52k]
  ------------------
 3655|  8.97k|    channels += pstr_api_struct->config[ele_idx].i_channels;
 3656|  8.97k|  }
 3657|  6.52k|  pstr_api_struct->pstr_state->aot = pstr_input_config->aot;
 3658|       |
 3659|  6.52k|  if ((pstr_api_struct->config[0].use_mps == 1) &&
  ------------------
  |  Branch (3659:7): [True: 1.79k, False: 4.72k]
  ------------------
 3660|  1.79k|      (0 == pstr_api_struct->config->aac_classic ||
  ------------------
  |  Branch (3660:8): [True: 557, False: 1.24k]
  ------------------
 3661|  1.78k|       pstr_api_struct->pstr_state->aot == AOT_USAC)) {
  ------------------
  |  |  142|  1.24k|#define AOT_USAC (42)
  ------------------
  |  Branch (3661:8): [True: 1.22k, False: 16]
  ------------------
 3662|  1.78k|    pstr_api_struct->pstr_state->mps_enable = pstr_api_struct->config[0].use_mps;
 3663|  1.78k|    pstr_api_struct->pstr_state->mps_tree_config = pstr_api_struct->config[0].mps_tree_config;
 3664|  1.78k|  }
 3665|  6.52k|  if (pstr_api_struct->config[0].num_bs_elements == 1) {
  ------------------
  |  Branch (3665:7): [True: 5.43k, False: 1.09k]
  ------------------
 3666|  5.43k|    pstr_api_struct->config[ele_idx].write_program_config_element = 0;
 3667|  5.43k|  }
 3668|       |
 3669|  6.52k|  if (pstr_api_struct->pstr_state->aot != AOT_USAC) {
  ------------------
  |  |  142|  6.52k|#define AOT_USAC (42)
  ------------------
  |  Branch (3669:7): [True: 2.32k, False: 4.20k]
  ------------------
 3670|  7.06k|    for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (3670:23): [True: 4.76k, False: 2.30k]
  ------------------
 3671|       |      /* Set config pointer in api obj */
 3672|  4.76k|      pstr_api_struct->pstr_state->pstr_config[ele_idx] = &pstr_api_struct->config[ele_idx];
 3673|       |
 3674|  4.76k|      error = ia_enhaacplus_enc_init(pstr_api_struct, ele_idx);
 3675|  4.76k|      if (error) {
  ------------------
  |  Branch (3675:11): [True: 18, False: 4.74k]
  ------------------
 3676|     18|        return error;
 3677|     18|      }
 3678|       |
 3679|  4.74k|      pstr_api_struct->pstr_state->ui_init_done = 1;
 3680|  4.74k|      total_bitrate_used += pstr_api_struct->config[ele_idx].aac_config.bit_rate;
 3681|  4.74k|    }
 3682|  2.30k|    if (pstr_input_config->i_bitrate != total_bitrate_used) {
  ------------------
  |  Branch (3682:9): [True: 1.62k, False: 679]
  ------------------
 3683|  1.62k|      pstr_input_config->i_bitrate = total_bitrate_used;
 3684|  1.62k|    }
 3685|  2.30k|    if (pstr_api_struct->config[0].aac_config.bitreservoir_size != -1) {
  ------------------
  |  Branch (3685:9): [True: 2.15k, False: 149]
  ------------------
 3686|  2.15k|      WORD32 avg_bytes_per_frame_per_ch = pstr_api_struct->config[0].aac_config.bitreservoir_size;
 3687|  2.15k|      if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (3687:11): [True: 866, False: 1.28k]
  ------------------
 3688|    866|        if (pstr_api_struct->config[0].aot == AOT_AAC_LC ||
  ------------------
  |  |   34|  1.73k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3688:13): [True: 132, False: 734]
  ------------------
 3689|    734|            pstr_api_struct->config[0].aot == AOT_PS ||
  ------------------
  |  |   39|  1.60k|#define AOT_PS (29)
  ------------------
  |  Branch (3689:13): [True: 106, False: 628]
  ------------------
 3690|    628|            pstr_api_struct->config[0].aot == AOT_SBR) {
  ------------------
  |  |  141|    628|#define AOT_SBR (5)
  ------------------
  |  Branch (3690:13): [True: 182, False: 446]
  ------------------
 3691|    420|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3692|    420|                                       FRAME_LEN_960 /
  ------------------
  |  |   94|    420|#define FRAME_LEN_960 960
  ------------------
 3693|    420|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3694|    420|                                        pstr_api_struct->config[0].i_channels * 8);
 3695|    420|        }
 3696|    866|        if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  1.73k|#define AOT_AAC_LD (23)
  ------------------
                      if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|    791|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (3696:13): [True: 75, False: 791]
  |  Branch (3696:53): [True: 371, False: 420]
  ------------------
 3697|    446|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3698|    446|                                       FRAME_LEN_480 /
  ------------------
  |  |   93|    446|#define FRAME_LEN_480 480
  ------------------
 3699|    446|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3700|    446|                                        pstr_api_struct->config[0].i_channels * 8);
 3701|    446|        }
 3702|  1.28k|      } else {
 3703|  1.28k|        if (pstr_api_struct->config[0].aot == AOT_AAC_LC ||
  ------------------
  |  |   34|  2.57k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3703:13): [True: 152, False: 1.13k]
  ------------------
 3704|  1.13k|            pstr_api_struct->config[0].aot == AOT_PS ||
  ------------------
  |  |   39|  2.42k|#define AOT_PS (29)
  ------------------
  |  Branch (3704:13): [True: 150, False: 986]
  ------------------
 3705|    986|            pstr_api_struct->config[0].aot == AOT_SBR) {
  ------------------
  |  |  141|    986|#define AOT_SBR (5)
  ------------------
  |  Branch (3705:13): [True: 440, False: 546]
  ------------------
 3706|    742|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3707|    742|                                       FRAME_LEN_1024 /
  ------------------
  |  |   91|    742|#define FRAME_LEN_1024 1024
  ------------------
 3708|    742|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3709|    742|                                        pstr_api_struct->config[0].i_channels * 8);
 3710|    742|        }
 3711|  1.28k|        if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  2.57k|#define AOT_AAC_LD (23)
  ------------------
                      if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.16k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (3711:13): [True: 123, False: 1.16k]
  |  Branch (3711:53): [True: 423, False: 742]
  ------------------
 3712|    546|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3713|    546|                                       FRAME_LEN_512 /
  ------------------
  |  |   92|    546|#define FRAME_LEN_512 512
  ------------------
 3714|    546|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3715|    546|                                        pstr_api_struct->config[0].i_channels * 8);
 3716|    546|        }
 3717|  1.28k|      }
 3718|       |
 3719|  2.15k|      if (pstr_api_struct->config[0].aac_config.bitreservoir_size < avg_bytes_per_frame_per_ch) {
  ------------------
  |  Branch (3719:11): [True: 175, False: 1.97k]
  ------------------
 3720|    175|        return IA_EXHEAACE_CONFIG_NONFATAL_BITRES_SIZE_TOO_SMALL;
 3721|    175|      }
 3722|  2.15k|    }
 3723|  2.12k|    if (pstr_input_config->i_use_es) {
  ------------------
  |  Branch (3723:9): [True: 1.69k, False: 437]
  ------------------
 3724|       |      // Write GA header
 3725|  1.69k|      ia_bit_buf_struct *pstr_ia_asc_bit_buf;
 3726|  1.69k|      pstr_ia_asc_bit_buf = iusace_create_bit_buffer(
 3727|  1.69k|          &(pstr_api_struct->pstr_state->str_bit_buf), pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT],
  ------------------
  |  |   26|  1.69k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3728|  1.69k|          pstr_api_struct->pstr_mem_info[IA_MEMTYPE_OUTPUT].ui_size, 1);
  ------------------
  |  |   26|  1.69k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3729|       |
 3730|  1.69k|      ixheaace_get_audiospecific_config_bytes(pstr_ia_asc_bit_buf,
 3731|  1.69k|                                              &pstr_api_struct->pstr_state->audio_specific_config,
 3732|  1.69k|                                              pstr_api_struct->pstr_state->aot,
 3733|  1.69k|                                              pstr_input_config->ccfl_idx);
 3734|       |
 3735|  1.69k|      pstr_api_struct->pstr_state->i_out_bytes = (pstr_ia_asc_bit_buf->cnt_bits + 7) >> 3;
 3736|  1.69k|    }
 3737|  2.12k|    if (pstr_api_struct->config->aac_classic) {
  ------------------
  |  Branch (3737:9): [True: 609, False: 1.51k]
  ------------------
 3738|    609|      pstr_output_config->input_size =
 3739|    609|          frame_length * channels * pstr_api_struct->config[0].ui_pcm_wd_sz / 8;
 3740|  1.51k|    } else {
 3741|  1.51k|      pstr_output_config->input_size =
 3742|  1.51k|          2 * frame_length * channels * pstr_api_struct->config[0].ui_pcm_wd_sz / 8;
 3743|  1.51k|    }
 3744|  2.12k|    pstr_output_config->samp_freq = pstr_api_struct->config[0].native_sample_rate;
 3745|  2.12k|    pstr_output_config->header_samp_freq = pstr_api_struct->config[0].aac_config.core_sample_rate;
 3746|  2.12k|    pstr_output_config->down_sampling_ratio =
 3747|  2.12k|        pstr_api_struct->config->aac_classic == 0 ? 2.0f : 1.0f;
  ------------------
  |  Branch (3747:9): [True: 1.51k, False: 609]
  ------------------
 3748|  2.12k|    switch (pstr_api_struct->config->aot) {
 3749|    274|      case AOT_AAC_LC:
  ------------------
  |  |   34|    274|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3749:7): [True: 274, False: 1.85k]
  ------------------
 3750|    274|        pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_LC_L5;
  ------------------
  |  |   43|    274|#define AUDIO_PROFILE_AAC_LC_L5 (0x2B)
  ------------------
 3751|    274|        break;
 3752|    685|      case AOT_SBR:
  ------------------
  |  |  141|    685|#define AOT_SBR (5)
  ------------------
  |  Branch (3752:7): [True: 685, False: 1.44k]
  ------------------
 3753|    685|        pstr_output_config->audio_profile = AUDIO_PROFILE_HEAAC_L5;
  ------------------
  |  |   44|    685|#define AUDIO_PROFILE_HEAAC_L5 (0x2F)
  ------------------
 3754|    685|        break;
 3755|    221|      case AOT_PS:
  ------------------
  |  |   39|    221|#define AOT_PS (29)
  ------------------
  |  Branch (3755:7): [True: 221, False: 1.90k]
  ------------------
 3756|    221|        pstr_output_config->audio_profile = AUDIO_PROFILE_HEAAC_V2_L5;
  ------------------
  |  |   45|    221|#define AUDIO_PROFILE_HEAAC_V2_L5 (0x33)
  ------------------
 3757|    221|        break;
 3758|    149|      case AOT_AAC_LD:
  ------------------
  |  |   36|    149|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (3758:7): [True: 149, False: 1.97k]
  ------------------
 3759|    149|        pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_LD_L4;
  ------------------
  |  |   46|    149|#define AUDIO_PROFILE_AAC_LD_L4 (0x19)
  ------------------
 3760|    149|        break;
 3761|    799|      case AOT_AAC_ELD:
  ------------------
  |  |   37|    799|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (3761:7): [True: 799, False: 1.32k]
  ------------------
 3762|    799|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (3762:13): [True: 481, False: 318]
  ------------------
 3763|    481|          if (pstr_api_struct->config[0].mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    481|#define TREE_212 (0)
  ------------------
  |  Branch (3763:15): [True: 123, False: 358]
  ------------------
 3764|    123|            pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_ELD_L2;
  ------------------
  |  |   48|    123|#define AUDIO_PROFILE_AAC_ELD_L2 (0x4D)
  ------------------
 3765|    358|          } else {
 3766|    358|            pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_ELD_L4;
  ------------------
  |  |   49|    358|#define AUDIO_PROFILE_AAC_ELD_L4 (0x4F)
  ------------------
 3767|    358|          }
 3768|    481|        } else {
 3769|    318|          pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_ELD_L1;
  ------------------
  |  |   47|    318|#define AUDIO_PROFILE_AAC_ELD_L1 (0x4C)
  ------------------
 3770|    318|        }
 3771|    799|        break;
 3772|      0|      default:
  ------------------
  |  Branch (3772:7): [True: 0, False: 2.12k]
  ------------------
 3773|      0|        pstr_output_config->audio_profile = AUDIO_PROFILE_NOT_SPECIFIED;
  ------------------
  |  |   51|      0|#define AUDIO_PROFILE_NOT_SPECIFIED (0xFE)
  ------------------
 3774|      0|        break;
 3775|  2.12k|    }
 3776|  2.12k|  }
 3777|       |
 3778|  4.20k|  else {
 3779|  4.20k|    pstr_api_struct->pstr_state->pstr_config[0] = &pstr_api_struct->config[0];
 3780|  4.20k|    error = ia_usac_enc_init(pstr_api_struct, pstr_input_config->ccfl_idx);
 3781|  4.20k|    if (error) {
  ------------------
  |  Branch (3781:9): [True: 847, False: 3.35k]
  ------------------
 3782|    847|      return error;
 3783|    847|    }
 3784|       |
 3785|  3.35k|    pstr_output_config->input_size =
 3786|  3.35k|        frame_length * channels * (pstr_api_struct->config[0].usac_config.ui_pcm_wd_sz >> 3);
 3787|       |
 3788|  3.35k|    if (pstr_api_struct->config[0].usac_config.use_drc_element) {
  ------------------
  |  Branch (3788:9): [True: 655, False: 2.70k]
  ------------------
 3789|    655|      ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)(pstr_input_config->pv_drc_cfg);
 3790|    655|      memcpy(pstr_drc_cfg, &pstr_api_struct->config[0].usac_config.str_drc_cfg,
 3791|    655|             sizeof(ia_drc_input_config));
 3792|    655|    }
 3793|       |
 3794|  3.35k|    pstr_output_config->down_sampling_ratio = 1;
 3795|  3.35k|    if (pstr_api_struct->config[0].usac_config.sbr_enable == 1) {
  ------------------
  |  Branch (3795:9): [True: 2.38k, False: 973]
  ------------------
 3796|  2.38k|      switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (3796:15): [True: 2.38k, False: 0]
  ------------------
 3797|    338|        case SBR_8_3:
  ------------------
  |  |  197|    338|#define SBR_8_3 (2)
  ------------------
  |  Branch (3797:9): [True: 338, False: 2.04k]
  ------------------
 3798|    338|          pstr_output_config->input_size *= 8;
 3799|    338|          pstr_output_config->input_size /= 3;
 3800|    338|          pstr_output_config->down_sampling_ratio = 8.0f / 3.0f;
 3801|    338|          break;
 3802|       |
 3803|  1.49k|        case SBR_2_1:
  ------------------
  |  |  198|  1.49k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3803:9): [True: 1.49k, False: 886]
  ------------------
 3804|  1.49k|          pstr_output_config->input_size *= 2;
 3805|  1.49k|          pstr_output_config->down_sampling_ratio = 2;
 3806|  1.49k|          break;
 3807|       |
 3808|    548|        case SBR_4_1:
  ------------------
  |  |  199|    548|#define SBR_4_1 (4)
  ------------------
  |  Branch (3808:9): [True: 548, False: 1.83k]
  ------------------
 3809|    548|          pstr_output_config->input_size *= 4;
 3810|    548|          pstr_output_config->down_sampling_ratio = 4;
 3811|    548|          break;
 3812|  2.38k|      }
 3813|  2.38k|    }
 3814|  3.35k|    pstr_output_config->samp_freq = pstr_api_struct->config[0].usac_config.native_sample_rate;
 3815|  3.35k|    pstr_output_config->header_samp_freq =
 3816|  3.35k|        pstr_api_struct->config[0].usac_config.native_sample_rate;
 3817|  3.35k|    pstr_output_config->audio_profile = AUDIO_PROFILE_USAC_L2;
  ------------------
  |  |   50|  3.35k|#define AUDIO_PROFILE_USAC_L2 (0x45)
  ------------------
 3818|  3.35k|    if (pstr_input_config->use_drc_element !=
  ------------------
  |  Branch (3818:9): [True: 5, False: 3.35k]
  ------------------
 3819|  3.35k|        pstr_api_struct->config[0].usac_config.use_drc_element) {
 3820|      5|      error = IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_GAIN_POINTS;
 3821|      5|    }
 3822|  3.35k|    pstr_input_config->use_drc_element = pstr_api_struct->config[0].usac_config.use_drc_element;
 3823|  3.35k|  }
 3824|       |
 3825|  5.48k|  pstr_api_struct->pstr_state->ui_init_done = 1;
 3826|  5.48k|  pstr_output_config->i_out_bytes = pstr_api_struct->pstr_state->i_out_bytes;
 3827|  5.48k|  if (pstr_output_config->input_size) {
  ------------------
  |  Branch (3827:7): [True: 5.48k, False: 0]
  ------------------
 3828|  5.48k|    pstr_output_config->expected_frame_count =
 3829|  5.48k|        (pstr_input_config->aac_config.length + (pstr_output_config->input_size - 1)) /
 3830|  5.48k|        pstr_output_config->input_size;
 3831|  5.48k|    if (pstr_api_struct->config[0].usac_config.use_delay_adjustment == 1) {
  ------------------
  |  Branch (3831:9): [True: 3.21k, False: 2.27k]
  ------------------
 3832|  3.21k|      pstr_output_config->expected_frame_count -=
 3833|  3.21k|          pstr_api_struct->config[0].usac_config.num_preroll_frames;
 3834|  3.21k|    }
 3835|  5.48k|  }
 3836|       |
 3837|  5.48k|  return error;
 3838|  6.52k|}
ixheaace_create:
 3840|  7.19k|IA_ERRORCODE ixheaace_create(pVOID pv_input, pVOID pv_output) {
 3841|  7.19k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  7.19k|#define IA_NO_ERROR 0x00000000
  ------------------
 3842|  7.19k|  ixheaace_output_config *pstr_out_cfg = (ixheaace_output_config *)pv_output;
 3843|  7.19k|  err_code = ixheaace_allocate(pv_input, pv_output);
 3844|  7.19k|  if (!err_code) {
  ------------------
  |  Branch (3844:7): [True: 6.52k, False: 671]
  ------------------
 3845|  6.52k|    err_code = ixheaace_init(pstr_out_cfg->pv_ia_process_api_obj, pv_input, pv_output);
 3846|  6.52k|  }
 3847|  7.19k|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  7.19k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3847:7): [True: 1.53k, False: 5.66k]
  ------------------
 3848|  1.53k|    IXHEAACE_MEM_FREE(pv_output);
  ------------------
  |  |   24|  1.53k|  {                                                                                    \
  |  |   25|  1.53k|    WORD32 idx;                                                                        \
  |  |   26|  1.53k|    ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;  \
  |  |   27|  1.53k|    if (pstr_output_config->malloc_count > 0) {                                        \
  |  |  ------------------
  |  |  |  Branch (27:9): [True: 1.15k, False: 377]
  |  |  ------------------
  |  |   28|  6.64k|      for (idx = pstr_output_config->malloc_count - 1; idx >= 0; idx--) {              \
  |  |  ------------------
  |  |  |  Branch (28:56): [True: 5.48k, False: 1.15k]
  |  |  ------------------
  |  |   29|  5.48k|        if (pstr_output_config->arr_alloc_memory[idx]) {                               \
  |  |  ------------------
  |  |  |  Branch (29:13): [True: 5.48k, False: 0]
  |  |  ------------------
  |  |   30|  5.48k|          pstr_output_config->free_xheaace(pstr_output_config->arr_alloc_memory[idx]); \
  |  |   31|  5.48k|        }                                                                              \
  |  |   32|  5.48k|      }                                                                                \
  |  |   33|  1.15k|      pstr_output_config->malloc_count = 0;                                            \
  |  |   34|  1.15k|    }                                                                                  \
  |  |   35|  1.53k|  }
  ------------------
 3849|  1.53k|  }
 3850|  7.19k|  return err_code;
 3851|  7.19k|}
ixheaace_process:
 3853|   508k|IA_ERRORCODE ixheaace_process(pVOID pstr_obj_ixheaace, pVOID pv_input, pVOID pv_output) {
 3854|   508k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   508k|#define IA_NO_ERROR 0x00000000
  ------------------
 3855|   508k|  WORD32 ele_idx;
 3856|   508k|  (VOID) pv_input;
 3857|   508k|  ixheaace_api_struct *pstr_api_struct = (ixheaace_api_struct *)pstr_obj_ixheaace;
 3858|   508k|  ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;
 3859|   508k|  pstr_api_struct->pstr_state->is_quant_spec_zero = 0;
 3860|   508k|  pstr_api_struct->pstr_state->is_gain_limited = 0;
 3861|   508k|  if (!pstr_api_struct->usac_en) {
  ------------------
  |  Branch (3861:7): [True: 162k, False: 345k]
  ------------------
 3862|   430k|    for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (3862:23): [True: 309k, False: 120k]
  ------------------
 3863|   309k|      error = ia_enhaacplus_enc_execute(pstr_api_struct, ele_idx);
 3864|   309k|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   309k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3864:11): [True: 42.3k, False: 267k]
  ------------------
 3865|  42.3k|        return error;
 3866|  42.3k|      }
 3867|   309k|    }
 3868|   120k|    if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_quant_spec_zero)) {
  ------------------
  |  |   23|   120k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3868:9): [True: 120k, False: 0]
  |  Branch (3868:35): [True: 423, False: 119k]
  ------------------
 3869|    423|      error = IA_EXHEAACE_EXE_NONFATAL_QUANTIZATION_SPECTRUM_ZERO;
 3870|    423|    }
 3871|   120k|    if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_gain_limited)) {
  ------------------
  |  |   23|   120k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3871:9): [True: 119k, False: 423]
  |  Branch (3871:35): [True: 0, False: 119k]
  ------------------
 3872|      0|      error = IA_EXHEAACE_EXE_NONFATAL_QUANTIZATION_INSUFFICIENT_BITRES;
 3873|      0|    }
 3874|   345k|  } else {
 3875|   345k|    ia_usac_encoder_config_struct *usac_config = &pstr_api_struct->config[0].usac_config;
 3876|   345k|    if (usac_config->iframes_interval <= usac_config->num_preroll_frames) {
  ------------------
  |  Branch (3876:9): [True: 24.5k, False: 321k]
  ------------------
 3877|  24.5k|      pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 1;
 3878|  24.5k|      if (usac_config->iframes_interval == usac_config->num_preroll_frames &&
  ------------------
  |  Branch (3878:11): [True: 4.59k, False: 19.9k]
  ------------------
 3879|  4.59k|          usac_config->is_first_frame == 0) {
  ------------------
  |  Branch (3879:11): [True: 1.60k, False: 2.98k]
  ------------------
 3880|  1.60k|        usac_config->is_ipf = 1;
 3881|  1.60k|      }
 3882|   321k|    } else {
 3883|   321k|      pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 0;
 3884|   321k|    }
 3885|   345k|    if (pstr_api_struct->pstr_state->str_usac_enc_data.frame_count >
  ------------------
  |  Branch (3885:9): [True: 326k, False: 19.6k]
  ------------------
 3886|   345k|        usac_config->num_preroll_frames) {
 3887|   326k|      if (usac_config->iframes_interval <= usac_config->num_preroll_frames) {
  ------------------
  |  Branch (3887:11): [True: 4.89k, False: 321k]
  ------------------
 3888|  4.89k|        pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 1;
 3889|   321k|      } else {
 3890|   321k|        pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 0;
 3891|   321k|      }
 3892|   326k|    }
 3893|       |
 3894|   345k|    {
 3895|   345k|      error = iusace_process(pstr_api_struct);
 3896|   345k|      if (error & IA_FATAL_ERROR) {
  ------------------
  |  |   25|   345k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3896:11): [True: 15.0k, False: 330k]
  ------------------
 3897|  15.0k|        pstr_output_config->i_out_bytes = 0;
 3898|  15.0k|        return error;
 3899|  15.0k|      }
 3900|   330k|      if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_quant_spec_zero)) {
  ------------------
  |  |   23|   330k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3900:11): [True: 330k, False: 0]
  |  Branch (3900:37): [True: 341, False: 330k]
  ------------------
 3901|    341|        error = IA_EXHEAACE_EXE_NONFATAL_USAC_QUANTIZATION_SPECTRUM_ZERO;
 3902|    341|      }
 3903|   330k|      if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_gain_limited)) {
  ------------------
  |  |   23|   330k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3903:11): [True: 330k, False: 341]
  |  Branch (3903:37): [True: 13, False: 330k]
  ------------------
 3904|     13|        error = IA_EXHEAACE_EXE_NONFATAL_USAC_QUANTIZATION_INSUFFICIENT_BITRES;
 3905|     13|      }
 3906|   330k|    }
 3907|       |
 3908|      0|    usac_config->iframes_interval++;
 3909|   330k|    if (usac_config->iframes_interval ==
  ------------------
  |  Branch (3909:9): [True: 1.63k, False: 329k]
  ------------------
 3910|   330k|        (usac_config->random_access_interval - usac_config->num_preroll_frames)) {
 3911|  1.63k|      usac_config->iframes_interval = 0;
 3912|  1.63k|    }
 3913|   330k|  }
 3914|   450k|  pstr_output_config->i_out_bytes = pstr_api_struct->pstr_state->i_out_bytes;
 3915|   450k|  return error;
 3916|   508k|}
ixheaace_delete:
 3918|  8.18k|IA_ERRORCODE ixheaace_delete(pVOID pv_output) {
 3919|  8.18k|  IXHEAACE_MEM_FREE(pv_output);
  ------------------
  |  |   24|  8.18k|  {                                                                                    \
  |  |   25|  8.18k|    WORD32 idx;                                                                        \
  |  |   26|  8.18k|    ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;  \
  |  |   27|  8.18k|    if (pstr_output_config->malloc_count > 0) {                                        \
  |  |  ------------------
  |  |  |  Branch (27:9): [True: 5.66k, False: 2.52k]
  |  |  ------------------
  |  |   28|  39.6k|      for (idx = pstr_output_config->malloc_count - 1; idx >= 0; idx--) {              \
  |  |  ------------------
  |  |  |  Branch (28:56): [True: 33.9k, False: 5.66k]
  |  |  ------------------
  |  |   29|  33.9k|        if (pstr_output_config->arr_alloc_memory[idx]) {                               \
  |  |  ------------------
  |  |  |  Branch (29:13): [True: 33.9k, False: 0]
  |  |  ------------------
  |  |   30|  33.9k|          pstr_output_config->free_xheaace(pstr_output_config->arr_alloc_memory[idx]); \
  |  |   31|  33.9k|        }                                                                              \
  |  |   32|  33.9k|      }                                                                                \
  |  |   33|  5.66k|      pstr_output_config->malloc_count = 0;                                            \
  |  |   34|  5.66k|    }                                                                                  \
  |  |   35|  8.18k|  }
  ------------------
 3920|  8.18k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  8.18k|#define IA_NO_ERROR 0x00000000
  ------------------
 3921|  8.18k|}
ixheaace_api.c:ixheaace_set_default_config:
  494|  6.82k|                                        ixheaace_input_config *pstr_input_config) {
  495|  6.82k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_api_struct->config[0].usac_config;
  496|  6.82k|  WORD32 i;
  497|       |
  498|  61.3k|  for (i = 0; i < MAXIMUM_BS_ELE; i++) {
  ------------------
  |  |   89|  61.3k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (498:15): [True: 54.5k, False: 6.82k]
  ------------------
  499|  54.5k|    ia_enhaacplus_enc_aac_init_default_config(&pstr_api_struct->config[i].aac_config,
  500|  54.5k|                                              pstr_input_config->aot);
  501|       |
  502|  54.5k|    pstr_api_struct->config[i].i_channels = NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   25|  54.5k|#define NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE (2)
  ------------------
  503|  54.5k|    pstr_api_struct->config[i].sample_rate = AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   26|  54.5k|#define AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (44100)
  ------------------
  504|  54.5k|    pstr_api_struct->config[i].native_sample_rate = AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   26|  54.5k|#define AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (44100)
  ------------------
  505|  54.5k|    pstr_api_struct->config[i].i_n_memtabs = NUM_MEMTABS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   27|  54.5k|#define NUM_MEMTABS_CONFIG_PARAM_DEFAULT_VALUE (10)
  ------------------
  506|  54.5k|    pstr_api_struct->config[i].aac_classic = AAC_CLASSIC_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   28|  54.5k|#define AAC_CLASSIC_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  507|  54.5k|    pstr_api_struct->config[i].use_parametric_stereo = USE_PS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   29|  54.5k|#define USE_PS_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  508|  54.5k|    pstr_api_struct->config[i].chmode_nchannels = CHMODE_NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   30|  54.5k|#define CHMODE_NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE (2)
  ------------------
  509|  54.5k|    pstr_api_struct->config[i].chmode = CHMODE_CONFIG_PARAM_DEFAULT_VALUE; /*stereo*/
  ------------------
  |  |   31|  54.5k|#define CHMODE_CONFIG_PARAM_DEFAULT_VALUE (1)
  ------------------
  510|  54.5k|    pstr_api_struct->config[i].adts_flag = ADTS_FLAG_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   32|  54.5k|#define ADTS_FLAG_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  511|  54.5k|    pstr_api_struct->config[i].num_bs_elements = NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   38|  54.5k|#define NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE (1)
  ------------------
  512|  54.5k|    pstr_api_struct->config[i].i_channels_mask = CHANNEL_MASK_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   34|  54.5k|#define CHANNEL_MASK_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  513|  54.5k|    pstr_api_struct->config[i].i_num_coupling_chan =
  514|  54.5k|        NUM_COUPLING_CHANNEL_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   35|  54.5k|#define NUM_COUPLING_CHANNEL_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  515|  54.5k|    pstr_api_struct->config[i].element_type = ELEMENT_TYPE_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   36|  54.5k|#define ELEMENT_TYPE_CONFIG_PARAM_DEFAULT_VALUE (-1)
  ------------------
  516|  54.5k|    pstr_api_struct->config[i].element_slot = ELEMENT_SLOT_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   37|  54.5k|#define ELEMENT_SLOT_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  517|  54.5k|    pstr_api_struct->config[i].num_bs_elements = NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   38|  54.5k|#define NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE (1)
  ------------------
  518|  54.5k|    pstr_api_struct->config[i].element_instance_tag =
  519|  54.5k|        ELEMENT_INSTANCE_TAG_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   39|  54.5k|#define ELEMENT_INSTANCE_TAG_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  520|  54.5k|    pstr_api_struct->config[i].aac_config.calc_crc = AAC_CFG_CALC_CRC_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   40|  54.5k|#define AAC_CFG_CALC_CRC_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  521|  54.5k|    pstr_api_struct->config[i].aac_config.full_bandwidth =
  522|  54.5k|        AAC_CFG_FULL_BW_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   41|  54.5k|#define AAC_CFG_FULL_BW_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  523|  54.5k|    pstr_api_struct->config[i].eldsbr_found = ELDSBR_FOUND_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   42|  54.5k|#define ELDSBR_FOUND_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  524|  54.5k|    pstr_api_struct->config[i].use_mps = USE_MPS_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   43|  54.5k|#define USE_MPS_PARAM_DEFAULT_VALUE (0)
  ------------------
  525|  54.5k|    pstr_api_struct->config[i].mps_tree_config = USE_MPS_TREE_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   44|  54.5k|#define USE_MPS_TREE_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  526|  54.5k|  }
  527|  6.82k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.82k|#define AOT_USAC (42)
  ------------------
  |  Branch (527:7): [True: 4.29k, False: 2.53k]
  ------------------
  528|  4.29k|    memset(pstr_usac_config, 0, sizeof(*pstr_usac_config));
  529|  4.29k|    pstr_usac_config->channels = NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   25|  4.29k|#define NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE (2)
  ------------------
  530|  4.29k|    pstr_usac_config->sample_rate = USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   48|  4.29k|#define USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (48000)
  ------------------
  531|  4.29k|    pstr_usac_config->core_sample_rate = USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   48|  4.29k|#define USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (48000)
  ------------------
  532|  4.29k|    pstr_usac_config->native_sample_rate = USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   48|  4.29k|#define USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (48000)
  ------------------
  533|  4.29k|    pstr_usac_config->sbr_pvc_active = USAC_SBR_PVC_DEFAULT_VALUE;
  ------------------
  |  |   49|  4.29k|#define USAC_SBR_PVC_DEFAULT_VALUE (0)
  ------------------
  534|  4.29k|    pstr_usac_config->sbr_inter_tes_active = USAC_SBR_INTER_TES_DEFAULT_VALUE;
  ------------------
  |  |   50|  4.29k|#define USAC_SBR_INTER_TES_DEFAULT_VALUE (0)
  ------------------
  535|  4.29k|    pstr_usac_config->sbr_harmonic = USAC_SBR_HARMONIC_DEFAULT_VALUE;
  ------------------
  |  |   51|  4.29k|#define USAC_SBR_HARMONIC_DEFAULT_VALUE (0)
  ------------------
  536|  4.29k|    pstr_usac_config->bit_rate = USAC_BITRATE_DEFAULT_VALUE;
  ------------------
  |  |   57|  4.29k|#define USAC_BITRATE_DEFAULT_VALUE (96000)
  ------------------
  537|  4.29k|    pstr_usac_config->use_fill_element = USAC_FILL_ELEMENT_DEFAULT_VALUE;
  ------------------
  |  |   52|  4.29k|#define USAC_FILL_ELEMENT_DEFAULT_VALUE (1)
  ------------------
  538|  4.29k|    pstr_usac_config->use_drc_element = USAC_DRC_DEFAULT_VALUE;
  ------------------
  |  |   53|  4.29k|#define USAC_DRC_DEFAULT_VALUE (0)
  ------------------
  539|  4.29k|    pstr_usac_config->cmplx_pred_flag = USAC_COMPLEX_PREDECTION_DEFAULT_VALUE;
  ------------------
  |  |   54|  4.29k|#define USAC_COMPLEX_PREDECTION_DEFAULT_VALUE (0)
  ------------------
  540|  4.29k|    pstr_usac_config->tns_select = USAC_TNS_DEFAULT_VALUE;
  ------------------
  |  |   55|  4.29k|#define USAC_TNS_DEFAULT_VALUE (0)
  ------------------
  541|  4.29k|    pstr_usac_config->flag_noiseFilling = USAC_FLAG_NOISE_FILLING_DEFAULT_VALUE;
  ------------------
  |  |   56|  4.29k|#define USAC_FLAG_NOISE_FILLING_DEFAULT_VALUE (0)
  ------------------
  542|  4.29k|    pstr_usac_config->use_acelp_only = USAC_DEFAULT_ACELP_FLAG_VALUE;
  ------------------
  |  |   58|  4.29k|#define USAC_DEFAULT_ACELP_FLAG_VALUE (0)
  ------------------
  543|  4.29k|    pstr_usac_config->is_first_frame = USAC_FIRST_FRAME_FLAG_DEFAULT_VALUE;
  ------------------
  |  |  212|  4.29k|#define USAC_FIRST_FRAME_FLAG_DEFAULT_VALUE (1)
  ------------------
  544|  4.29k|    pstr_usac_config->num_preroll_frames = CC_NUM_PREROLL_FRAMES;
  ------------------
  |  |  211|  4.29k|#define CC_NUM_PREROLL_FRAMES (1)
  ------------------
  545|  4.29k|    pstr_usac_config->stream_id = USAC_DEFAULT_STREAM_ID_VALUE;
  ------------------
  |  |   59|  4.29k|#define USAC_DEFAULT_STREAM_ID_VALUE (0)
  ------------------
  546|  4.29k|    pstr_usac_config->use_delay_adjustment = USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE;
  ------------------
  |  |  213|  4.29k|#define USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE (1)
  ------------------
  547|  4.29k|    pstr_usac_config->is_loudness_configured = USAC_DEFAULT_MEASURED_LOUDNESS_FLAG_VALUE;
  ------------------
  |  |  214|  4.29k|#define USAC_DEFAULT_MEASURED_LOUDNESS_FLAG_VALUE (1)
  ------------------
  548|  4.29k|  }
  549|       |  /* Initialize table pointers */
  550|  6.82k|  ia_enhaacplus_enc_init_aac_tabs(&(pstr_api_struct->pstr_aac_tabs));
  551|  6.82k|  ia_enhaacplus_enc_init_sbr_tabs(&(pstr_api_struct->spectral_band_replication_tabs));
  552|  6.82k|  pstr_api_struct->common_tabs.pstr_common_tab =
  553|  6.82k|      (ixheaace_common_tables *)&ia_enhaacplus_enc_common_tab;
  554|  6.82k|}
ixheaace_api.c:ixheaace_set_config_params:
  833|  6.82k|                                               ixheaace_input_config *pstr_input_config) {
  834|  6.82k|  WORD32 ele_idx;
  835|  6.82k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  6.82k|#define IA_NO_ERROR 0x00000000
  ------------------
  836|  6.82k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_api_struct->config[0].usac_config;
  837|  6.82k|  err_code = ixheaace_validate_config_params(pstr_input_config);
  838|  6.82k|  if (err_code) {
  ------------------
  |  Branch (838:7): [True: 85, False: 6.73k]
  ------------------
  839|     85|    return err_code;
  840|     85|  }
  841|       |
  842|  6.73k|  if (pstr_input_config->ui_pcm_wd_sz != 16) {
  ------------------
  |  Branch (842:7): [True: 137, False: 6.59k]
  ------------------
  843|    137|    return (IA_EXHEAACE_CONFIG_FATAL_PCM_WDSZ);
  844|    137|  }
  845|  6.59k|  if ((pstr_input_config->aac_config.inv_quant != 0) &&
  ------------------
  |  Branch (845:7): [True: 0, False: 6.59k]
  ------------------
  846|      0|      (pstr_input_config->aac_config.inv_quant != 1) &&
  ------------------
  |  Branch (846:7): [True: 0, False: 0]
  ------------------
  847|      0|      (pstr_input_config->aac_config.inv_quant != 2)) {
  ------------------
  |  Branch (847:7): [True: 0, False: 0]
  ------------------
  848|      0|    return (IA_EXHEAACE_CONFIG_FATAL_QUALITY_LEVEL);
  849|      0|  }
  850|  6.59k|  if ((pstr_input_config->write_program_config_element != 0) &&
  ------------------
  |  Branch (850:7): [True: 0, False: 6.59k]
  ------------------
  851|      0|      (pstr_input_config->write_program_config_element != 1)) {
  ------------------
  |  Branch (851:7): [True: 0, False: 0]
  ------------------
  852|      0|    return (IA_EXHEAACE_CONFIG_FATAL_WRITE_PCE);
  853|      0|  }
  854|  6.59k|  if ((pstr_input_config->aac_config.f_no_stereo_preprocessing != 0) &&
  ------------------
  |  Branch (854:7): [True: 0, False: 6.59k]
  ------------------
  855|      0|      (pstr_input_config->aac_config.f_no_stereo_preprocessing != 1)) {
  ------------------
  |  Branch (855:7): [True: 0, False: 0]
  ------------------
  856|      0|    return (IA_EXHEAACE_CONFIG_FATAL_USE_STEREO_PRE_PROC);
  857|      0|  }
  858|  6.59k|  if ((pstr_input_config->aac_config.use_tns != 0) &&
  ------------------
  |  Branch (858:7): [True: 3.61k, False: 2.98k]
  ------------------
  859|  3.61k|      (pstr_input_config->aac_config.use_tns != 1)) {
  ------------------
  |  Branch (859:7): [True: 0, False: 3.61k]
  ------------------
  860|      0|    return (IA_EXHEAACE_CONFIG_FATAL_USE_TNS);
  861|      0|  }
  862|  6.59k|  if ((pstr_input_config->aac_config.full_bandwidth != 0) &&
  ------------------
  |  Branch (862:7): [True: 2.81k, False: 3.78k]
  ------------------
  863|  2.81k|      (pstr_input_config->aac_config.full_bandwidth != 1)) {
  ------------------
  |  Branch (863:7): [True: 0, False: 2.81k]
  ------------------
  864|      0|    return (IA_EXHEAACE_CONFIG_FATAL_USE_FULL_BANDWIDTH);
  865|      0|  }
  866|       |
  867|  59.3k|  for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  59.3k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (867:21): [True: 52.7k, False: 6.59k]
  ------------------
  868|  52.7k|    pstr_api_struct->config[ele_idx].aac_classic = 1;
  869|  52.7k|    pstr_api_struct->config[ele_idx].firstframe = 1;
  870|  52.7k|    pstr_api_struct->config[ele_idx].aot = pstr_input_config->aot;
  871|  52.7k|    pstr_api_struct->config[ele_idx].adts_flag = pstr_input_config->i_use_adts;
  872|  52.7k|    pstr_api_struct->config[ele_idx].sample_rate = pstr_input_config->i_samp_freq;
  873|  52.7k|    pstr_api_struct->config[ele_idx].native_sample_rate = pstr_input_config->i_native_samp_freq;
  874|       |
  875|  52.7k|    pstr_api_struct->config[ele_idx].i_channels = pstr_input_config->i_channels;
  876|  52.7k|    pstr_api_struct->config[ele_idx].i_native_channels = pstr_input_config->i_channels;
  877|  52.7k|    pstr_api_struct->config[ele_idx].i_channels_mode = pstr_input_config->i_channels;
  878|  52.7k|    pstr_api_struct->config[ele_idx].aac_config.bit_rate = pstr_input_config->i_bitrate;
  879|  52.7k|    pstr_api_struct->config[ele_idx].esbr_flag = pstr_input_config->esbr_flag;
  880|  52.7k|    pstr_api_struct->config[ele_idx].use_mps = pstr_input_config->i_use_mps;
  881|  52.7k|    pstr_api_struct->config[ele_idx].mps_tree_config = pstr_input_config->i_mps_tree_config;
  882|  52.7k|    pstr_api_struct->config[ele_idx].i_num_coupling_chan = pstr_input_config->i_num_coupling_chan;
  883|  52.7k|    pstr_api_struct->config[ele_idx].ui_pcm_wd_sz = pstr_input_config->ui_pcm_wd_sz;
  884|  52.7k|    pstr_api_struct->config[ele_idx].write_program_config_element =
  885|  52.7k|        pstr_input_config->write_program_config_element;
  886|  52.7k|    pstr_api_struct->config[ele_idx].frame_length = pstr_input_config->frame_length;
  887|  52.7k|    pstr_api_struct->config[ele_idx].aac_config.num_stereo_preprocessing =
  888|  52.7k|        pstr_input_config->aac_config.f_no_stereo_preprocessing;
  889|       |
  890|  52.7k|    pstr_api_struct->config[ele_idx].aac_config.use_tns = pstr_input_config->aac_config.use_tns;
  891|  52.7k|    if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   105k|#define AOT_AAC_LD (23)
  ------------------
                  if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  50.8k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (891:9): [True: 1.90k, False: 50.8k]
  |  Branch (891:49): [True: 6.79k, False: 44.0k]
  ------------------
  892|  8.69k|      pstr_api_struct->config[ele_idx].aac_config.inv_quant =
  893|  8.69k|          pstr_input_config->aac_config.inv_quant;
  894|  8.69k|      if (pstr_input_config->frame_length == FRAME_LEN_512) {
  ------------------
  |  |   92|  8.69k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (894:11): [True: 4.72k, False: 3.97k]
  ------------------
  895|  4.72k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 0;
  896|  4.72k|      } else if (pstr_input_config->frame_length == FRAME_LEN_480) {
  ------------------
  |  |   93|  3.97k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (896:18): [True: 3.97k, False: 0]
  ------------------
  897|  3.97k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 1;
  898|  3.97k|      }
  899|  44.0k|    } else if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |   34|  88.1k|#define AOT_AAC_LC (2)
  ------------------
                  } else if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |  141|  84.9k|#define AOT_SBR (5)
  ------------------
  |  Branch (899:16): [True: 3.26k, False: 40.8k]
  |  Branch (899:56): [True: 5.20k, False: 35.6k]
  ------------------
  900|  35.6k|               pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  35.6k|#define AOT_PS (29)
  ------------------
  |  Branch (900:16): [True: 1.98k, False: 33.6k]
  ------------------
  901|  10.4k|      pstr_api_struct->config[ele_idx].aac_config.inv_quant = 0;
  902|  10.4k|      if (pstr_input_config->frame_length == FRAME_LEN_1024) {
  ------------------
  |  |   91|  10.4k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (902:11): [True: 6.78k, False: 3.66k]
  ------------------
  903|  6.78k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 0;
  904|  6.78k|      } else if (pstr_input_config->frame_length == FRAME_LEN_960) {
  ------------------
  |  |   94|  3.66k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (904:18): [True: 3.66k, False: 0]
  ------------------
  905|  3.66k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 1;
  906|  3.66k|      }
  907|  10.4k|    }
  908|  52.7k|    if ((AOT_SBR == pstr_input_config->aot) || (AOT_PS == pstr_input_config->aot) ||
  ------------------
  |  |  141|  52.7k|#define AOT_SBR (5)
  ------------------
                  if ((AOT_SBR == pstr_input_config->aot) || (AOT_PS == pstr_input_config->aot) ||
  ------------------
  |  |   39|  47.5k|#define AOT_PS (29)
  ------------------
  |  Branch (908:9): [True: 5.20k, False: 47.5k]
  |  Branch (908:48): [True: 1.98k, False: 45.5k]
  ------------------
  909|  45.5k|        (AOT_AAC_ELD == pstr_input_config->aot)) {
  ------------------
  |  |   37|  45.5k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (909:9): [True: 6.79k, False: 38.8k]
  ------------------
  910|  13.9k|      pstr_api_struct->config[ele_idx].aac_classic = 0;
  911|  13.9k|    }
  912|  52.7k|    if (pstr_api_struct->config[ele_idx].sample_rate < 32000) {
  ------------------
  |  Branch (912:9): [True: 11.5k, False: 41.2k]
  ------------------
  913|  11.5k|      if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (913:11): [True: 209, False: 11.2k]
  ------------------
  914|    209|        pstr_api_struct->config[ele_idx].aac_classic = 1;
  915|    209|      }
  916|  11.5k|      if (pstr_input_config->aot == AOT_SBR || pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |  141|  23.0k|#define AOT_SBR (5)
  ------------------
                    if (pstr_input_config->aot == AOT_SBR || pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  11.3k|#define AOT_PS (29)
  ------------------
  |  Branch (916:11): [True: 120, False: 11.3k]
  |  Branch (916:48): [True: 11, False: 11.3k]
  ------------------
  917|    131|        pstr_input_config->aot = AOT_AAC_LC;
  ------------------
  |  |   34|    131|#define AOT_AAC_LC (2)
  ------------------
  918|    131|      }
  919|  11.5k|      if (pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  11.5k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (919:11): [True: 78, False: 11.4k]
  ------------------
  920|     78|        pstr_input_config->aot = AOT_AAC_LD;
  ------------------
  |  |   36|     78|#define AOT_AAC_LD (23)
  ------------------
  921|     78|      }
  922|  11.5k|    }
  923|  52.7k|    pstr_api_struct->config[ele_idx].eldsbr_found =
  924|  52.7k|        !(pstr_api_struct->config[ele_idx].aac_classic);
  925|  52.7k|  }
  926|  6.59k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.59k|#define AOT_USAC (42)
  ------------------
  |  Branch (926:7): [True: 4.20k, False: 2.39k]
  ------------------
  927|  4.20k|    if (pstr_input_config->i_channels > 2) {
  ------------------
  |  Branch (927:9): [True: 0, False: 4.20k]
  ------------------
  928|      0|      return IA_EXHEAACE_CONFIG_FATAL_NUM_CHANNELS;
  929|      0|    }
  930|  4.20k|    if ((pstr_input_config->i_samp_freq < 6000) || (pstr_input_config->i_samp_freq > 96000)) {
  ------------------
  |  Branch (930:9): [True: 0, False: 4.20k]
  |  Branch (930:52): [True: 0, False: 4.20k]
  ------------------
  931|      0|      return (IA_EXHEAACE_CONFIG_FATAL_SAMP_FREQ);
  932|      0|    }
  933|  4.20k|    pstr_api_struct->usac_en = 1;
  934|       |
  935|  4.20k|    pstr_usac_config->codec_mode = pstr_input_config->codec_mode;
  936|  4.20k|    pstr_usac_config->channels = pstr_input_config->i_channels;
  937|       |
  938|  4.20k|    pstr_usac_config->core_sample_rate = pstr_input_config->i_samp_freq;
  939|  4.20k|    pstr_usac_config->sample_rate = pstr_input_config->i_samp_freq;
  940|  4.20k|    pstr_usac_config->native_sample_rate = pstr_input_config->i_native_samp_freq;
  941|       |
  942|  4.20k|    pstr_usac_config->ui_pcm_wd_sz = pstr_input_config->ui_pcm_wd_sz;
  943|  4.20k|    pstr_usac_config->ccfl_idx = pstr_input_config->ccfl_idx;
  944|  4.20k|    pstr_usac_config->bit_rate = pstr_input_config->i_bitrate;
  945|  4.20k|    pstr_usac_config->basic_bitrate = pstr_input_config->i_bitrate;
  946|  4.20k|    pstr_usac_config->tns_select = pstr_input_config->aac_config.use_tns;
  947|  4.20k|    pstr_usac_config->cmplx_pred_flag = pstr_input_config->cplx_pred;
  948|  4.20k|    pstr_usac_config->flag_noiseFilling = pstr_input_config->aac_config.noise_filling;
  949|  4.20k|    pstr_usac_config->sbr_pvc_active = pstr_input_config->pvc_active;
  950|  4.20k|    pstr_usac_config->sbr_harmonic = pstr_input_config->harmonic_sbr;
  951|  4.20k|    pstr_usac_config->hq_esbr = pstr_input_config->hq_esbr;
  952|  4.20k|    pstr_usac_config->sbr_inter_tes_active = pstr_input_config->inter_tes_active;
  953|  4.20k|    pstr_api_struct->config[0].chmode_nchannels = pstr_api_struct->config[0].i_channels;
  954|       |
  955|  4.20k|    switch (pstr_input_config->ccfl_idx) {
  956|    469|      case NO_SBR_CCFL_768:
  ------------------
  |  |  195|    469|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (956:7): [True: 469, False: 3.73k]
  ------------------
  957|    469|        pstr_usac_config->ccfl = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    469|#define LEN_SUPERFRAME_768 (768)
  ------------------
  958|    469|        pstr_usac_config->in_frame_length = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    469|#define LEN_SUPERFRAME_768 (768)
  ------------------
  959|    469|        pstr_usac_config->sbr_enable = 0;
  960|    469|        pstr_usac_config->drc_frame_size = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    469|#define LEN_SUPERFRAME_768 (768)
  ------------------
  961|    469|        break;
  962|    768|      case NO_SBR_CCFL_1024:
  ------------------
  |  |  196|    768|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (962:7): [True: 768, False: 3.43k]
  ------------------
  963|    768|        pstr_usac_config->ccfl = LEN_SUPERFRAME;
  ------------------
  |  |   66|    768|#define LEN_SUPERFRAME (1024)
  ------------------
  964|    768|        pstr_usac_config->in_frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|    768|#define LEN_SUPERFRAME (1024)
  ------------------
  965|    768|        pstr_usac_config->sbr_enable = 0;
  966|    768|        pstr_usac_config->drc_frame_size = LEN_SUPERFRAME;
  ------------------
  |  |   66|    768|#define LEN_SUPERFRAME (1024)
  ------------------
  967|    768|        break;
  968|    366|      case SBR_8_3:
  ------------------
  |  |  197|    366|#define SBR_8_3 (2)
  ------------------
  |  Branch (968:7): [True: 366, False: 3.83k]
  ------------------
  969|    366|        pstr_usac_config->ccfl = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    366|#define LEN_SUPERFRAME_768 (768)
  ------------------
  970|    366|        pstr_usac_config->in_frame_length = (LEN_SUPERFRAME_768 * 8) / 3;
  ------------------
  |  |   67|    366|#define LEN_SUPERFRAME_768 (768)
  ------------------
  971|    366|        pstr_usac_config->sbr_enable = 1;
  972|    366|        pstr_usac_config->drc_frame_size = (LEN_SUPERFRAME_768 * 8) / 3;
  ------------------
  |  |   67|    366|#define LEN_SUPERFRAME_768 (768)
  ------------------
  973|    366|        break;
  974|  2.02k|      case SBR_2_1:
  ------------------
  |  |  198|  2.02k|#define SBR_2_1 (3)
  ------------------
  |  Branch (974:7): [True: 2.02k, False: 2.18k]
  ------------------
  975|  2.02k|        pstr_usac_config->ccfl = LEN_SUPERFRAME;
  ------------------
  |  |   66|  2.02k|#define LEN_SUPERFRAME (1024)
  ------------------
  976|  2.02k|        pstr_usac_config->in_frame_length = (LEN_SUPERFRAME * 2);
  ------------------
  |  |   66|  2.02k|#define LEN_SUPERFRAME (1024)
  ------------------
  977|  2.02k|        pstr_usac_config->sbr_enable = 1;
  978|  2.02k|        pstr_usac_config->drc_frame_size = (LEN_SUPERFRAME * 2);
  ------------------
  |  |   66|  2.02k|#define LEN_SUPERFRAME (1024)
  ------------------
  979|  2.02k|        break;
  980|    578|      case SBR_4_1:
  ------------------
  |  |  199|    578|#define SBR_4_1 (4)
  ------------------
  |  Branch (980:7): [True: 578, False: 3.62k]
  ------------------
  981|    578|        pstr_usac_config->ccfl = LEN_SUPERFRAME;
  ------------------
  |  |   66|    578|#define LEN_SUPERFRAME (1024)
  ------------------
  982|    578|        pstr_usac_config->in_frame_length = (LEN_SUPERFRAME * 4);
  ------------------
  |  |   66|    578|#define LEN_SUPERFRAME (1024)
  ------------------
  983|    578|        pstr_usac_config->sbr_enable = 1;
  984|    578|        pstr_usac_config->drc_frame_size = (LEN_SUPERFRAME * 4);
  ------------------
  |  |   66|    578|#define LEN_SUPERFRAME (1024)
  ------------------
  985|    578|        break;
  986|      0|      default:
  ------------------
  |  Branch (986:7): [True: 0, False: 4.20k]
  ------------------
  987|      0|        pstr_usac_config->ccfl = LEN_SUPERFRAME;
  ------------------
  |  |   66|      0|#define LEN_SUPERFRAME (1024)
  ------------------
  988|      0|        pstr_usac_config->in_frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|      0|#define LEN_SUPERFRAME (1024)
  ------------------
  989|      0|        pstr_usac_config->sbr_enable = 0;
  990|      0|        pstr_usac_config->drc_frame_size = LEN_SUPERFRAME;
  ------------------
  |  |   66|      0|#define LEN_SUPERFRAME (1024)
  ------------------
  991|      0|        break;
  992|  4.20k|    }
  993|  4.20k|    pstr_usac_config->random_access_interval = pstr_input_config->random_access_interval;
  994|  4.20k|    if (pstr_usac_config->random_access_interval > 0) {
  ------------------
  |  Branch (994:9): [True: 2.37k, False: 1.82k]
  ------------------
  995|  2.37k|      pstr_usac_config->random_access_interval =
  996|  2.37k|          (WORD32)((((WORD64)pstr_usac_config->random_access_interval *
  997|  2.37k|                     pstr_input_config->i_native_samp_freq) +
  998|  2.37k|                    (pstr_usac_config->ccfl * 1000 - 1)) /
  999|  2.37k|                   (pstr_usac_config->ccfl * 1000));
 1000|  2.37k|    }
 1001|  4.20k|    pstr_usac_config->use_delay_adjustment = pstr_input_config->use_delay_adjustment;
 1002|  4.20k|    if (pstr_usac_config->random_access_interval) {
  ------------------
  |  Branch (1002:9): [True: 4.20k, False: 0]
  ------------------
 1003|  4.20k|      pstr_usac_config->preroll_flag = 1;
 1004|  4.20k|    }
 1005|  4.20k|    if (pstr_usac_config->sbr_enable == 1) {
  ------------------
  |  Branch (1005:9): [True: 2.96k, False: 1.23k]
  ------------------
 1006|  2.96k|      pstr_usac_config->num_preroll_frames++;
 1007|  2.96k|      if (pstr_usac_config->sbr_harmonic == 1) {
  ------------------
  |  Branch (1007:11): [True: 1.48k, False: 1.48k]
  ------------------
 1008|  1.48k|        pstr_usac_config->num_preroll_frames++;
 1009|  1.48k|      }
 1010|  2.96k|    } else {
 1011|  1.23k|      if (pstr_usac_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (1011:11): [True: 1.14k, False: 94]
  ------------------
 1012|  1.14k|        pstr_usac_config->num_preroll_frames++;
 1013|  1.14k|      }
 1014|  1.23k|    }
 1015|  4.20k|    pstr_usac_config->stream_id = pstr_input_config->stream_id;
 1016|  4.20k|    if (pstr_input_config->ccfl_idx < NO_SBR_CCFL_768 || pstr_input_config->ccfl_idx > SBR_4_1) {
  ------------------
  |  |  195|  8.41k|#define NO_SBR_CCFL_768 (0)
  ------------------
                  if (pstr_input_config->ccfl_idx < NO_SBR_CCFL_768 || pstr_input_config->ccfl_idx > SBR_4_1) {
  ------------------
  |  |  199|  4.20k|#define SBR_4_1 (4)
  ------------------
  |  Branch (1016:9): [True: 0, False: 4.20k]
  |  Branch (1016:58): [True: 0, False: 4.20k]
  ------------------
 1017|      0|      pstr_api_struct->config[0].ccfl_idx = NO_SBR_CCFL_1024;  // default value
  ------------------
  |  |  196|      0|#define NO_SBR_CCFL_1024 (1)
  ------------------
 1018|  4.20k|    } else {
 1019|  4.20k|      pstr_api_struct->config[0].ccfl_idx = pstr_input_config->ccfl_idx;
 1020|  4.20k|    }
 1021|  4.20k|    if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  4.20k|#define SBR_8_3 (2)
  ------------------
  |  Branch (1021:9): [True: 366, False: 3.83k]
  ------------------
 1022|    366|      pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab =
 1023|    366|          (ixheaace_resampler_sos_table *)&iixheaace_resamp_1_to_3_filt_params;
 1024|       |
 1025|    366|      pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab =
 1026|    366|          (ixheaace_resampler_sos_table *)&iixheaace_resamp_8_to_1_filt_params;
 1027|  3.83k|    } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1) {
  ------------------
  |  |  198|  3.83k|#define SBR_2_1 (3)
  ------------------
  |  Branch (1027:16): [True: 2.02k, False: 1.81k]
  ------------------
 1028|  2.02k|      pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab =
 1029|  2.02k|          (ixheaace_resampler_table *)&ixheaace_resamp_2_to_1_iir_filt_params;
 1030|  2.02k|    } else if (pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|  1.81k|#define SBR_4_1 (4)
  ------------------
  |  Branch (1030:16): [True: 578, False: 1.23k]
  ------------------
 1031|    578|      pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab =
 1032|    578|          (ixheaace_resampler_table *)&ixheaace_resamp_4_to_1_iir_filt_params;
 1033|    578|    }
 1034|  4.20k|    pstr_usac_config->use_drc_element = pstr_input_config->use_drc_element;
 1035|  4.20k|    {
 1036|  4.20k|      ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)pstr_input_config->pv_drc_cfg;
 1037|  4.20k|      pstr_drc_cfg->str_uni_drc_config.str_channel_layout.base_ch_count =
 1038|  4.20k|          pstr_input_config->i_channels;
 1039|  4.20k|      pstr_drc_cfg->str_enc_params.sample_rate = pstr_input_config->i_samp_freq;
 1040|  4.20k|      pstr_drc_cfg->str_enc_params.domain = TIME_DOMAIN;
  ------------------
  |  |   79|  4.20k|#define TIME_DOMAIN (1)
  ------------------
 1041|  4.20k|      pstr_drc_cfg->str_uni_drc_config.sample_rate = pstr_drc_cfg->str_enc_params.sample_rate;
 1042|  4.20k|      if (pstr_usac_config->use_drc_element) {
  ------------------
  |  Branch (1042:11): [True: 1.47k, False: 2.73k]
  ------------------
 1043|  3.08k|        for (WORD32 i = 0; i < pstr_drc_cfg->str_uni_drc_config.drc_coefficients_uni_drc_count;
  ------------------
  |  Branch (1043:28): [True: 1.61k, False: 1.47k]
  ------------------
 1044|  1.61k|             i++) {
 1045|  1.61k|          for (WORD32 j = 0;
 1046|  4.41k|               j <
  ------------------
  |  Branch (1046:16): [True: 2.79k, False: 1.61k]
  ------------------
 1047|  4.41k|               pstr_drc_cfg->str_uni_drc_config.str_drc_coefficients_uni_drc[i].gain_set_count;
 1048|  2.79k|               j++) {
 1049|  2.79k|            pstr_drc_cfg->str_uni_drc_config.str_drc_coefficients_uni_drc[i]
 1050|  2.79k|                .str_gain_set_params[j]
 1051|  2.79k|                .delta_tmin =
 1052|  2.79k|                impd_drc_get_delta_t_min(pstr_drc_cfg->str_uni_drc_config.sample_rate);
 1053|  2.79k|          }
 1054|  1.61k|        }
 1055|  2.22k|        for (WORD32 i = 0; i < pstr_drc_cfg->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (1055:28): [True: 751, False: 1.47k]
  ------------------
 1056|  2.22k|                                   .drc_coefficients_uni_drc_v1_count;
 1057|  1.47k|             i++) {
 1058|  2.51k|          for (WORD32 j = 0; j < pstr_drc_cfg->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (1058:30): [True: 1.76k, False: 751]
  ------------------
 1059|  2.51k|                                     .str_drc_coefficients_uni_drc_v1[i]
 1060|  2.51k|                                     .gain_set_count;
 1061|  1.76k|               j++) {
 1062|  1.76k|            pstr_drc_cfg->str_uni_drc_config.str_uni_drc_config_ext
 1063|  1.76k|                .str_drc_coefficients_uni_drc_v1[i]
 1064|  1.76k|                .str_gain_set_params[j]
 1065|  1.76k|                .delta_tmin =
 1066|  1.76k|                impd_drc_get_delta_t_min(pstr_drc_cfg->str_uni_drc_config.sample_rate);
 1067|  1.76k|          }
 1068|    751|        }
 1069|  1.47k|      }
 1070|  4.20k|      pstr_usac_config->str_drc_cfg = *pstr_drc_cfg;
 1071|  4.20k|      pstr_usac_config->str_drc_cfg.str_enc_params.frame_size = pstr_usac_config->drc_frame_size;
 1072|  4.20k|      pstr_usac_config->str_drc_cfg.str_uni_drc_config.str_drc_coefficients_uni_drc
 1073|  4.20k|          ->drc_frame_size = pstr_usac_config->drc_frame_size;
 1074|  4.20k|      pstr_input_config->drc_frame_size = pstr_usac_config->drc_frame_size;
 1075|       |
 1076|  4.20k|      ia_drc_loudness_info_set_struct *pstr_enc_loudness_info_set =
 1077|  4.20k|          &pstr_usac_config->str_drc_cfg.str_enc_loudness_info_set;
 1078|       |
 1079|  4.20k|      if ((pstr_usac_config->use_drc_element &&
  ------------------
  |  Branch (1079:12): [True: 1.47k, False: 2.73k]
  ------------------
 1080|  1.47k|           ((pstr_enc_loudness_info_set->loudness_info_count != 0) ||
  ------------------
  |  Branch (1080:13): [True: 213, False: 1.26k]
  ------------------
 1081|  1.26k|            (pstr_enc_loudness_info_set->loudness_info_album_count != 0) ||
  ------------------
  |  Branch (1081:13): [True: 105, False: 1.15k]
  ------------------
 1082|  1.15k|            (pstr_enc_loudness_info_set->str_loudness_info_set_extension
  ------------------
  |  Branch (1082:13): [True: 143, False: 1.01k]
  ------------------
 1083|  1.15k|                 .str_loudness_info_set_ext_eq.loudness_info_v1_count != 0) ||
 1084|  1.01k|            (pstr_enc_loudness_info_set->str_loudness_info_set_extension
  ------------------
  |  Branch (1084:13): [True: 97, False: 915]
  ------------------
 1085|  1.01k|                 .str_loudness_info_set_ext_eq.loudness_info_v1_album_count != 0)))) {
 1086|    558|        pstr_usac_config->is_loudness_configured = 1;
 1087|  3.64k|      } else {
 1088|  3.64k|        pstr_usac_config->is_loudness_configured = 0;
 1089|  3.64k|      }
 1090|  4.20k|    }
 1091|  4.20k|  } else {
 1092|  2.39k|    WORD32 max_bitreservoir_size;
 1093|  2.39k|    if ((pstr_input_config->i_channels > MAX_NUM_CORE_CODER_CHANNELS)) {
  ------------------
  |  |  115|  2.39k|#define MAX_NUM_CORE_CODER_CHANNELS (6)
  ------------------
  |  Branch (1093:9): [True: 0, False: 2.39k]
  ------------------
 1094|      0|      return (IA_EXHEAACE_CONFIG_FATAL_NUM_CHANNELS);
 1095|      0|    }
 1096|  2.39k|    if (!((pstr_input_config->i_native_samp_freq == 7350) ||
  ------------------
  |  Branch (1096:11): [True: 43, False: 2.35k]
  ------------------
 1097|  2.35k|          (pstr_input_config->i_native_samp_freq == 8000) ||
  ------------------
  |  Branch (1097:11): [True: 34, False: 2.31k]
  ------------------
 1098|  2.31k|          (pstr_input_config->i_native_samp_freq == 11025) ||
  ------------------
  |  Branch (1098:11): [True: 41, False: 2.27k]
  ------------------
 1099|  2.27k|          (pstr_input_config->i_native_samp_freq == 12000) ||
  ------------------
  |  Branch (1099:11): [True: 72, False: 2.20k]
  ------------------
 1100|  2.20k|          (pstr_input_config->i_native_samp_freq == 16000) ||
  ------------------
  |  Branch (1100:11): [True: 31, False: 2.17k]
  ------------------
 1101|  2.17k|          (pstr_input_config->i_native_samp_freq == 22050) ||
  ------------------
  |  Branch (1101:11): [True: 18, False: 2.15k]
  ------------------
 1102|  2.15k|          (pstr_input_config->i_native_samp_freq == 24000) ||
  ------------------
  |  Branch (1102:11): [True: 69, False: 2.08k]
  ------------------
 1103|  2.08k|          (pstr_input_config->i_native_samp_freq == 32000) ||
  ------------------
  |  Branch (1103:11): [True: 574, False: 1.51k]
  ------------------
 1104|  1.51k|          (pstr_input_config->i_native_samp_freq == 44100) ||
  ------------------
  |  Branch (1104:11): [True: 578, False: 933]
  ------------------
 1105|    933|          (pstr_input_config->i_native_samp_freq == 48000) ||
  ------------------
  |  Branch (1105:11): [True: 663, False: 270]
  ------------------
 1106|    270|          (pstr_input_config->i_native_samp_freq == 64000) ||
  ------------------
  |  Branch (1106:11): [True: 54, False: 216]
  ------------------
 1107|    216|          (pstr_input_config->i_native_samp_freq == 88200) ||
  ------------------
  |  Branch (1107:11): [True: 103, False: 113]
  ------------------
 1108|    113|          (pstr_input_config->i_native_samp_freq == 96000))) {
  ------------------
  |  Branch (1108:11): [True: 71, False: 42]
  ------------------
 1109|     42|      return (IA_EXHEAACE_CONFIG_FATAL_SAMP_FREQ);
 1110|     42|    }
 1111|       |
 1112|  2.35k|    if ((pstr_input_config->aot == AOT_AAC_ELD) && (pstr_input_config->i_use_mps == 1) &&
  ------------------
  |  |   37|  2.35k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1112:9): [True: 836, False: 1.51k]
  |  Branch (1112:52): [True: 557, False: 279]
  ------------------
 1113|    557|        (pstr_input_config->i_channels > 2)) {
  ------------------
  |  Branch (1113:9): [True: 402, False: 155]
  ------------------
 1114|    402|      pstr_api_struct->config[0].num_bs_elements = 1;
 1115|    402|      pstr_api_struct->config[0].i_channels = pstr_input_config->i_channels;
 1116|    402|      pstr_api_struct->config[0].i_native_channels = pstr_input_config->i_channels;
 1117|    402|      pstr_api_struct->config[0].chmode_nchannels = pstr_input_config->i_channels;
 1118|    402|      pstr_api_struct->config[0].element_type = ID_SCE;
 1119|    402|      if (pstr_api_struct->config[0].mps_tree_config == TREE_525) {
  ------------------
  |  |   42|    402|#define TREE_525 (3)
  ------------------
  |  Branch (1119:11): [True: 232, False: 170]
  ------------------
 1120|    232|        pstr_api_struct->config[0].element_type = ID_CPE;
 1121|    232|      }
 1122|    402|      pstr_api_struct->config[0].element_slot = 0;
 1123|    402|      pstr_api_struct->config[0].element_instance_tag = 0;
 1124|    402|      pstr_api_struct->config[0].aac_config.bit_rate = pstr_input_config->i_bitrate;
 1125|    402|      pstr_api_struct->config[0].use_parametric_stereo = 0;
 1126|    402|    }
 1127|  2.35k|    if (pstr_input_config->i_channels_mask == 0) {
  ------------------
  |  Branch (1127:9): [True: 1.70k, False: 648]
  ------------------
 1128|  1.70k|      ixheaace_set_default_channel_mask(&pstr_input_config->i_channels_mask,
 1129|  1.70k|                                        pstr_input_config->i_channels);
 1130|  1.70k|    }
 1131|  2.35k|    if (pstr_api_struct->config[0].aac_config.dual_mono != 1) {
  ------------------
  |  Branch (1131:9): [True: 2.35k, False: 0]
  ------------------
 1132|  2.35k|      if (pstr_input_config->aot != AOT_AAC_ELD || (pstr_input_config->i_use_mps != 1)) {
  ------------------
  |  |   37|  4.70k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1132:11): [True: 1.51k, False: 836]
  |  Branch (1132:52): [True: 279, False: 557]
  ------------------
 1133|  1.79k|        WORD32 num_bs_elements, chan_config[MAXIMUM_BS_ELE], element_type[MAXIMUM_BS_ELE],
 1134|  1.79k|            element_slot[MAXIMUM_BS_ELE], element_instance_tag[MAXIMUM_BS_ELE],
 1135|  1.79k|            bitrate[MAXIMUM_BS_ELE];
 1136|  1.79k|        if ((pstr_input_config->i_channels_mask > 0x3FFFF)) {
  ------------------
  |  Branch (1136:13): [True: 0, False: 1.79k]
  ------------------
 1137|      0|          return (IA_EXHEAACE_CONFIG_FATAL_CHANNELS_MASK);
 1138|      0|        }
 1139|  1.79k|        if (ixheaace_validate_channel_mask(pstr_input_config->i_channels_mask,
  ------------------
  |  Branch (1139:13): [True: 30, False: 1.76k]
  ------------------
 1140|  1.79k|                                           pstr_input_config->i_channels)) {
 1141|     30|          return IA_EXHEAACE_CONFIG_FATAL_CHANNELS_MASK;
 1142|     30|        }
 1143|  15.8k|        for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  15.8k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1143:27): [True: 14.1k, False: 1.76k]
  ------------------
 1144|  14.1k|          pstr_api_struct->config[ele_idx].i_channels_mask = pstr_input_config->i_channels_mask;
 1145|  14.1k|        }
 1146|  1.76k|        ia_enhaacplus_enc_find_channel_config(
 1147|  1.76k|            &num_bs_elements, chan_config, element_type, element_slot, element_instance_tag,
 1148|  1.76k|            pstr_api_struct->config[0].i_num_coupling_chan, pstr_input_config->i_channels_mask);
 1149|  5.97k|        for (ele_idx = 0; ele_idx < num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1149:27): [True: 4.21k, False: 1.76k]
  ------------------
 1150|  4.21k|          pstr_api_struct->config[ele_idx].i_channels = chan_config[ele_idx];
 1151|  4.21k|          pstr_api_struct->config[ele_idx].i_native_channels = chan_config[ele_idx];
 1152|  4.21k|          pstr_api_struct->config[ele_idx].chmode_nchannels = chan_config[ele_idx];
 1153|  4.21k|          pstr_api_struct->config[ele_idx].element_type = element_type[ele_idx];
 1154|  4.21k|          pstr_api_struct->config[ele_idx].element_slot = element_slot[ele_idx];
 1155|  4.21k|          pstr_api_struct->config[ele_idx].num_bs_elements = num_bs_elements;
 1156|  4.21k|          pstr_api_struct->config[ele_idx].element_instance_tag = element_instance_tag[ele_idx];
 1157|  4.21k|        }
 1158|       |
 1159|  1.76k|        if (pstr_api_struct->config[0].num_bs_elements > 1) {
  ------------------
  |  Branch (1159:13): [True: 1.09k, False: 674]
  ------------------
 1160|  1.09k|          ia_enhaacplus_enc_allocate_bitrate_between_channels(pstr_api_struct, bitrate,
 1161|  1.09k|                                                              pstr_input_config->i_bitrate);
 1162|       |
 1163|  4.63k|          for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1163:29): [True: 3.54k, False: 1.09k]
  ------------------
 1164|  3.54k|            pstr_api_struct->config[ele_idx].aac_config.bit_rate = bitrate[ele_idx];
 1165|  3.54k|          }
 1166|       |
 1167|  9.81k|          for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  9.81k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1167:29): [True: 8.72k, False: 1.09k]
  ------------------
 1168|  8.72k|            pstr_api_struct->config[ele_idx].use_parametric_stereo = 0;
 1169|  8.72k|          }
 1170|  1.09k|        }
 1171|  1.76k|      }
 1172|  2.35k|    } else {
 1173|      0|      WORD32 num_bs_elements;
 1174|      0|      WORD32 bitrate[MAXIMUM_BS_ELE];
 1175|       |
 1176|      0|      num_bs_elements = 2;
 1177|       |
 1178|      0|      pstr_api_struct->config[0].i_channels = 1;
 1179|      0|      pstr_api_struct->config[0].chmode_nchannels = 1;
 1180|      0|      pstr_api_struct->config[0].element_type = ID_SCE;
 1181|      0|      pstr_api_struct->config[0].element_slot = 0;
 1182|      0|      pstr_api_struct->config[0].num_bs_elements = num_bs_elements;
 1183|      0|      pstr_api_struct->config[0].element_instance_tag = 0;
 1184|       |
 1185|      0|      pstr_api_struct->config[1].i_channels = 1;
 1186|      0|      pstr_api_struct->config[1].chmode_nchannels = 1;
 1187|      0|      pstr_api_struct->config[1].element_type = ID_SCE;
 1188|      0|      pstr_api_struct->config[1].element_slot = 1;
 1189|      0|      pstr_api_struct->config[1].num_bs_elements = num_bs_elements;
 1190|      0|      pstr_api_struct->config[1].element_instance_tag = 1;
 1191|       |
 1192|      0|      if (pstr_api_struct->config[0].num_bs_elements > 1) {
  ------------------
  |  Branch (1192:11): [True: 0, False: 0]
  ------------------
 1193|      0|        ia_enhaacplus_enc_allocate_bitrate_between_channels(
 1194|      0|            pstr_api_struct, bitrate, pstr_api_struct->config[0].aac_config.bit_rate);
 1195|       |
 1196|      0|        for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1196:27): [True: 0, False: 0]
  ------------------
 1197|      0|          pstr_api_struct->config[ele_idx].aac_config.bit_rate = bitrate[ele_idx];
 1198|      0|        }
 1199|       |
 1200|      0|        for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|      0|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1200:27): [True: 0, False: 0]
  ------------------
 1201|      0|          pstr_api_struct->config[ele_idx].use_parametric_stereo = 0;
 1202|      0|        }
 1203|      0|      }
 1204|      0|    }
 1205|       |
 1206|  2.32k|    if (pstr_input_config->aot == AOT_PS && pstr_input_config->i_channels == 2) {
  ------------------
  |  |   39|  4.64k|#define AOT_PS (29)
  ------------------
  |  Branch (1206:9): [True: 246, False: 2.07k]
  |  Branch (1206:45): [True: 246, False: 0]
  ------------------
 1207|    246|      pstr_api_struct->config[0].use_parametric_stereo = 1;
 1208|    246|      pstr_api_struct->config[0].chmode_nchannels = 2;
 1209|  2.07k|    } else {
 1210|  6.60k|      for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1210:25): [True: 4.52k, False: 2.07k]
  ------------------
 1211|  4.52k|        pstr_api_struct->config[ele_idx].chmode_nchannels =
 1212|  4.52k|            pstr_api_struct->config[ele_idx].i_channels;
 1213|  4.52k|      }
 1214|  2.07k|    }
 1215|       |
 1216|       |    /* Right shift by 10 as 768 is the max bit reservoir calculated for framelength 1024 */
 1217|  2.32k|    max_bitreservoir_size = (BITRESERVOIR_SIZE_CONFIG_PARAM_DEFAULT_VALUE *
  ------------------
  |  |   24|  2.32k|#define BITRESERVOIR_SIZE_CONFIG_PARAM_DEFAULT_VALUE (768)
  ------------------
 1218|  2.32k|                             pstr_api_struct->config[0].frame_length) >>
 1219|  2.32k|                            10;
 1220|  2.32k|    if ((pstr_input_config->aac_config.bitreservoir_size > max_bitreservoir_size) ||
  ------------------
  |  Branch (1220:9): [True: 1.20k, False: 1.11k]
  ------------------
 1221|  1.82k|        (pstr_input_config->aac_config.bitreservoir_size < -1)) {
  ------------------
  |  Branch (1221:9): [True: 623, False: 494]
  ------------------
 1222|  1.82k|      pstr_input_config->aac_config.bitreservoir_size = max_bitreservoir_size;
 1223|  1.82k|    }
 1224|  20.8k|    for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  20.8k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1224:23): [True: 18.5k, False: 2.32k]
  ------------------
 1225|  18.5k|      pstr_api_struct->config[ele_idx].aac_config.bitreservoir_size =
 1226|  18.5k|        pstr_input_config->aac_config.bitreservoir_size;
 1227|  18.5k|      pstr_api_struct->config[ele_idx].aac_config.full_bandwidth =
 1228|  18.5k|        pstr_input_config->aac_config.full_bandwidth;
 1229|  18.5k|    }
 1230|  2.32k|  }
 1231|       |
 1232|  6.52k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  6.52k|#define IA_NO_ERROR 0x00000000
  ------------------
 1233|  6.59k|}
ixheaace_api.c:ixheaace_validate_config_params:
  556|  6.82k|static IA_ERRORCODE ixheaace_validate_config_params(ixheaace_input_config *pstr_input_config) {
  557|  6.82k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  6.82k|#define IA_NO_ERROR 0x00000000
  ------------------
  558|  6.82k|  if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   37|  13.6k|#define AOT_AAC_ELD (39)
  ------------------
                if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  12.6k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (558:7): [True: 5.87k, False: 942]
  |  Branch (558:48): [True: 5.56k, False: 310]
  ------------------
  559|  5.56k|      pstr_input_config->aot != AOT_AAC_LD && pstr_input_config->aot != AOT_PS &&
  ------------------
  |  |   36|  12.3k|#define AOT_AAC_LD (23)
  ------------------
                    pstr_input_config->aot != AOT_AAC_LD && pstr_input_config->aot != AOT_PS &&
  ------------------
  |  |   39|  12.1k|#define AOT_PS (29)
  ------------------
  |  Branch (559:7): [True: 5.37k, False: 197]
  |  Branch (559:47): [True: 4.88k, False: 488]
  ------------------
  560|  4.88k|      pstr_input_config->aot != AOT_SBR && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  141|  11.7k|#define AOT_SBR (5)
  ------------------
                    pstr_input_config->aot != AOT_SBR && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  4.29k|#define AOT_USAC (42)
  ------------------
  |  Branch (560:7): [True: 4.29k, False: 593]
  |  Branch (560:44): [True: 0, False: 4.29k]
  ------------------
  561|      0|    pstr_input_config->aot = AOT_AAC_LC;
  ------------------
  |  |   34|      0|#define AOT_AAC_LC (2)
  ------------------
  562|      0|  }
  563|  6.82k|  pstr_input_config->i_native_samp_freq = pstr_input_config->i_samp_freq;
  564|  6.82k|  if (pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  6.82k|#define AOT_USAC (42)
  ------------------
  |  Branch (564:7): [True: 2.53k, False: 4.29k]
  ------------------
  565|  2.53k|    pstr_input_config->i_samp_freq = iusace_map_sample_rate(pstr_input_config->i_samp_freq);
  566|  4.29k|  } else {
  567|  4.29k|    err_code = iusace_validate_baseline_profile_sample_rate(pstr_input_config->i_samp_freq);
  568|  4.29k|    if (err_code) {
  ------------------
  |  Branch (568:9): [True: 85, False: 4.20k]
  ------------------
  569|     85|      return err_code;
  570|     85|    }
  571|  4.29k|  }
  572|       |
  573|  6.73k|  if ((pstr_input_config->i_channels < MIN_NUM_CORE_CODER_CHANNELS) ||
  ------------------
  |  |  116|  6.73k|#define MIN_NUM_CORE_CODER_CHANNELS (1)
  ------------------
  |  Branch (573:7): [True: 196, False: 6.53k]
  ------------------
  574|  6.53k|      (pstr_input_config->i_channels > MAX_NUM_CORE_CODER_CHANNELS)) {
  ------------------
  |  |  115|  6.53k|#define MAX_NUM_CORE_CODER_CHANNELS (6)
  ------------------
  |  Branch (574:7): [True: 263, False: 6.27k]
  ------------------
  575|    459|    pstr_input_config->i_channels = 1;
  576|    459|  }
  577|  6.73k|  if (pstr_input_config->esbr_flag != 1 && pstr_input_config->esbr_flag != 0) {
  ------------------
  |  Branch (577:7): [True: 2.54k, False: 4.19k]
  |  Branch (577:44): [True: 0, False: 2.54k]
  ------------------
  578|      0|    pstr_input_config->esbr_flag = 0;
  579|      0|  }
  580|  6.73k|  if ((pstr_input_config->esbr_flag == 1) &&
  ------------------
  |  Branch (580:7): [True: 4.19k, False: 2.54k]
  ------------------
  581|  4.19k|      ((pstr_input_config->aot != AOT_SBR) && (pstr_input_config->aot != AOT_PS) &&
  ------------------
  |  |  141|  4.19k|#define AOT_SBR (5)
  ------------------
                    ((pstr_input_config->aot != AOT_SBR) && (pstr_input_config->aot != AOT_PS) &&
  ------------------
  |  |   39|  3.73k|#define AOT_PS (29)
  ------------------
  |  Branch (581:8): [True: 3.73k, False: 460]
  |  Branch (581:47): [True: 3.39k, False: 335]
  ------------------
  582|  3.39k|       (pstr_input_config->aot != AOT_USAC))) {
  ------------------
  |  |  142|  3.39k|#define AOT_USAC (42)
  ------------------
  |  Branch (582:8): [True: 1.00k, False: 2.39k]
  ------------------
  583|  1.00k|    pstr_input_config->esbr_flag = 0;
  584|  1.00k|  }
  585|  6.73k|  if (pstr_input_config->i_use_mps != 1 && pstr_input_config->i_use_mps != 0) {
  ------------------
  |  Branch (585:7): [True: 3.63k, False: 3.09k]
  |  Branch (585:44): [True: 0, False: 3.63k]
  ------------------
  586|      0|    pstr_input_config->i_use_mps = 0;
  587|      0|  }
  588|       |
  589|  6.73k|  if ((pstr_input_config->i_channels != 2) && (pstr_input_config->i_channels != 6)) {
  ------------------
  |  Branch (589:7): [True: 3.26k, False: 3.46k]
  |  Branch (589:47): [True: 2.44k, False: 829]
  ------------------
  590|  2.44k|    pstr_input_config->i_use_mps = 0;
  591|  2.44k|  }
  592|  6.73k|  if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |   37|  13.4k|#define AOT_AAC_ELD (39)
  ------------------
                if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  5.79k|#define AOT_USAC (42)
  ------------------
  |  Branch (592:7): [True: 5.79k, False: 942]
  |  Branch (592:48): [True: 1.58k, False: 4.20k]
  ------------------
  593|  1.58k|    pstr_input_config->i_use_mps = 0;
  594|  1.58k|  }
  595|  6.73k|  if (pstr_input_config->aot == AOT_USAC && pstr_input_config->i_use_mps == 1) {
  ------------------
  |  |  142|  13.4k|#define AOT_USAC (42)
  ------------------
  |  Branch (595:7): [True: 4.20k, False: 2.53k]
  |  Branch (595:45): [True: 1.52k, False: 2.67k]
  ------------------
  596|  1.52k|    if (pstr_input_config->ccfl_idx < SBR_8_3) {
  ------------------
  |  |  197|  1.52k|#define SBR_8_3 (2)
  ------------------
  |  Branch (596:9): [True: 891, False: 635]
  ------------------
  597|    891|      pstr_input_config->ccfl_idx = SBR_2_1;
  ------------------
  |  |  198|    891|#define SBR_2_1 (3)
  ------------------
  598|    891|    }
  599|  1.52k|  }
  600|  6.73k|  if (AOT_USAC == pstr_input_config->aot) {
  ------------------
  |  |  142|  6.73k|#define AOT_USAC (42)
  ------------------
  |  Branch (600:7): [True: 4.20k, False: 2.53k]
  ------------------
  601|  4.20k|    if ((pstr_input_config->i_channels != 2) || (pstr_input_config->i_samp_freq > 48000)) {
  ------------------
  |  Branch (601:9): [True: 1.29k, False: 2.91k]
  |  Branch (601:49): [True: 769, False: 2.14k]
  ------------------
  602|       |      // Num qmf bands is mapped only till 48000. Hence, disable mps if fs > 48000 or if input
  603|       |      // channels is not 2
  604|  2.06k|      pstr_input_config->i_use_mps = 0;
  605|  2.06k|    }
  606|  4.20k|  }
  607|  6.73k|  if (pstr_input_config->i_use_mps == 1) {
  ------------------
  |  Branch (607:7): [True: 1.80k, False: 4.93k]
  ------------------
  608|  1.80k|    if (pstr_input_config->i_channels == 2) {
  ------------------
  |  Branch (608:9): [True: 1.38k, False: 414]
  ------------------
  609|  1.38k|      if (pstr_input_config->i_mps_tree_config != TREE_212) {
  ------------------
  |  |   39|  1.38k|#define TREE_212 (0)
  ------------------
  |  Branch (609:11): [True: 1.35k, False: 31]
  ------------------
  610|  1.35k|        pstr_input_config->i_mps_tree_config = TREE_212;
  ------------------
  |  |   39|  1.35k|#define TREE_212 (0)
  ------------------
  611|  1.35k|      }
  612|  1.38k|    } else {
  613|    414|      if (pstr_input_config->i_mps_tree_config != TREE_5151 &&
  ------------------
  |  |   40|    828|#define TREE_5151 (1)
  ------------------
  |  Branch (613:11): [True: 413, False: 1]
  ------------------
  614|    413|          pstr_input_config->i_mps_tree_config != TREE_5152 &&
  ------------------
  |  |   41|    827|#define TREE_5152 (2)
  ------------------
  |  Branch (614:11): [True: 373, False: 40]
  ------------------
  615|    373|          pstr_input_config->i_mps_tree_config != TREE_525) {
  ------------------
  |  |   42|    373|#define TREE_525 (3)
  ------------------
  |  Branch (615:11): [True: 138, False: 235]
  ------------------
  616|    138|        pstr_input_config->i_mps_tree_config = TREE_5151;
  ------------------
  |  |   40|    138|#define TREE_5151 (1)
  ------------------
  617|    138|      }
  618|    414|    }
  619|  4.93k|  } else {
  620|  4.93k|    pstr_input_config->i_mps_tree_config = INVALID_TREE_CONFIG;
  ------------------
  |  |   43|  4.93k|#define INVALID_TREE_CONFIG (-1)
  ------------------
  621|  4.93k|  }
  622|  6.73k|  if (pstr_input_config->aot == AOT_USAC || pstr_input_config->aot == AOT_AAC_ELD ||
  ------------------
  |  |  142|  13.4k|#define AOT_USAC (42)
  ------------------
                if (pstr_input_config->aot == AOT_USAC || pstr_input_config->aot == AOT_AAC_ELD ||
  ------------------
  |  |   37|  9.26k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (622:7): [True: 4.20k, False: 2.53k]
  |  Branch (622:45): [True: 942, False: 1.58k]
  ------------------
  623|  5.34k|      pstr_input_config->aot == AOT_AAC_LD) {
  ------------------
  |  |   36|  1.58k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (623:7): [True: 197, False: 1.39k]
  ------------------
  624|  5.34k|    pstr_input_config->i_use_adts = 0;
  625|  5.34k|    pstr_input_config->i_use_es = 1;
  626|  5.34k|  }
  627|  6.73k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.73k|#define AOT_USAC (42)
  ------------------
  |  Branch (627:7): [True: 4.20k, False: 2.53k]
  ------------------
  628|  4.20k|    if (pstr_input_config->codec_mode != USAC_SWITCHED &&
  ------------------
  |  |   35|  8.41k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (628:9): [True: 2.80k, False: 1.39k]
  ------------------
  629|  2.80k|        pstr_input_config->codec_mode != USAC_ONLY_FD &&
  ------------------
  |  |   36|  7.01k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (629:9): [True: 2.78k, False: 20]
  ------------------
  630|  2.78k|        pstr_input_config->codec_mode != USAC_ONLY_TD) {
  ------------------
  |  |   37|  2.78k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (630:9): [True: 2.67k, False: 116]
  ------------------
  631|  2.67k|      pstr_input_config->codec_mode = USAC_ONLY_FD;
  ------------------
  |  |   36|  2.67k|#define USAC_ONLY_FD (1)
  ------------------
  632|  2.67k|    }
  633|  4.20k|    if (pstr_input_config->ccfl_idx < NO_SBR_CCFL_768 || pstr_input_config->ccfl_idx > SBR_4_1) {
  ------------------
  |  |  195|  8.41k|#define NO_SBR_CCFL_768 (0)
  ------------------
                  if (pstr_input_config->ccfl_idx < NO_SBR_CCFL_768 || pstr_input_config->ccfl_idx > SBR_4_1) {
  ------------------
  |  |  199|  3.48k|#define SBR_4_1 (4)
  ------------------
  |  Branch (633:9): [True: 716, False: 3.48k]
  |  Branch (633:58): [True: 761, False: 2.72k]
  ------------------
  634|  1.47k|      pstr_input_config->ccfl_idx = NO_SBR_CCFL_1024;  // default value
  ------------------
  |  |  196|  1.47k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  635|  1.47k|    }
  636|  4.20k|    if ((pstr_input_config->ccfl_idx == SBR_4_1) && (pstr_input_config->i_samp_freq < 32000))
  ------------------
  |  |  199|  4.20k|#define SBR_4_1 (4)
  ------------------
  |  Branch (636:9): [True: 801, False: 3.40k]
  |  Branch (636:53): [True: 223, False: 578]
  ------------------
  637|    223|    {
  638|    223|      if (pstr_input_config->i_samp_freq >= 16000)
  ------------------
  |  Branch (638:11): [True: 166, False: 57]
  ------------------
  639|    166|      {
  640|    166|        pstr_input_config->ccfl_idx = SBR_2_1;
  ------------------
  |  |  198|    166|#define SBR_2_1 (3)
  ------------------
  641|    166|      }
  642|     57|      else
  643|     57|      {
  644|     57|        pstr_input_config->ccfl_idx = NO_SBR_CCFL_1024;
  ------------------
  |  |  196|     57|#define NO_SBR_CCFL_1024 (1)
  ------------------
  645|     57|      }
  646|    223|    }
  647|  4.20k|    if (pstr_input_config->cplx_pred != 1 && pstr_input_config->cplx_pred != 0) {
  ------------------
  |  Branch (647:9): [True: 1.56k, False: 2.63k]
  |  Branch (647:46): [True: 0, False: 1.56k]
  ------------------
  648|      0|      pstr_input_config->cplx_pred = 0;
  649|      0|    }
  650|  4.20k|    if (pstr_input_config->use_drc_element != 0 && pstr_input_config->use_drc_element != 1) {
  ------------------
  |  Branch (650:9): [True: 2.23k, False: 1.97k]
  |  Branch (650:52): [True: 0, False: 2.23k]
  ------------------
  651|      0|      pstr_input_config->use_drc_element = 0;
  652|      0|    }
  653|       |
  654|  4.20k|    if (pstr_input_config->hq_esbr != 0 && pstr_input_config->hq_esbr != 1) {
  ------------------
  |  Branch (654:9): [True: 1.62k, False: 2.57k]
  |  Branch (654:44): [True: 0, False: 1.62k]
  ------------------
  655|      0|      pstr_input_config->hq_esbr = 0;
  656|      0|    }
  657|  4.20k|    if (pstr_input_config->harmonic_sbr != 0 && pstr_input_config->harmonic_sbr != 1) {
  ------------------
  |  Branch (657:9): [True: 2.38k, False: 1.81k]
  |  Branch (657:49): [True: 0, False: 2.38k]
  ------------------
  658|      0|      pstr_input_config->harmonic_sbr = 0;
  659|      0|    }
  660|  4.20k|    if (pstr_input_config->pvc_active != 0 && pstr_input_config->pvc_active != 1) {
  ------------------
  |  Branch (660:9): [True: 1.70k, False: 2.50k]
  |  Branch (660:47): [True: 0, False: 1.70k]
  ------------------
  661|      0|      pstr_input_config->pvc_active = 0;
  662|      0|    }
  663|  4.20k|    if (pstr_input_config->inter_tes_active != 0 && pstr_input_config->inter_tes_active != 1) {
  ------------------
  |  Branch (663:9): [True: 1.61k, False: 2.59k]
  |  Branch (663:53): [True: 0, False: 1.61k]
  ------------------
  664|      0|      pstr_input_config->inter_tes_active = 0;
  665|      0|    }
  666|  4.20k|    if ((pstr_input_config->ccfl_idx != 3 && pstr_input_config->ccfl_idx != 4)) {
  ------------------
  |  Branch (666:10): [True: 2.96k, False: 1.24k]
  |  Branch (666:46): [True: 2.38k, False: 578]
  ------------------
  667|  2.38k|      pstr_input_config->harmonic_sbr = 0;
  668|  2.38k|    }
  669|  4.20k|    if (pstr_input_config->harmonic_sbr != 1) {
  ------------------
  |  Branch (669:9): [True: 2.72k, False: 1.48k]
  ------------------
  670|  2.72k|      pstr_input_config->hq_esbr = 0;
  671|  2.72k|    }
  672|  4.20k|    if (pstr_input_config->i_bitrate != 64000 && pstr_input_config->i_bitrate != 96000) {
  ------------------
  |  Branch (672:9): [True: 3.84k, False: 356]
  |  Branch (672:50): [True: 3.84k, False: 5]
  ------------------
  673|  3.84k|      pstr_input_config->i_bitrate = USAC_BITRATE_DEFAULT_VALUE;
  ------------------
  |  |   57|  3.84k|#define USAC_BITRATE_DEFAULT_VALUE (96000)
  ------------------
  674|  3.84k|    }
  675|  4.20k|    {
  676|  4.20k|      if (pstr_input_config->i_bitrate < MINIMUM_BITRATE * pstr_input_config->i_channels) {
  ------------------
  |  |   23|  4.20k|#define MINIMUM_BITRATE 8000
  ------------------
  |  Branch (676:11): [True: 0, False: 4.20k]
  ------------------
  677|      0|        pstr_input_config->i_bitrate = MINIMUM_BITRATE * pstr_input_config->i_channels;
  ------------------
  |  |   23|      0|#define MINIMUM_BITRATE 8000
  ------------------
  678|      0|      }
  679|  4.20k|      if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768 ||
  ------------------
  |  |  195|  8.41k|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (679:11): [True: 654, False: 3.55k]
  ------------------
  680|  3.55k|          pstr_input_config->ccfl_idx == NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|  3.55k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (680:11): [True: 1.54k, False: 2.00k]
  ------------------
  681|  2.20k|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (681:13): [True: 307, False: 1.89k]
  ------------------
  682|  2.20k|            (WORD32)(6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels)) {
  683|    307|          pstr_input_config->i_bitrate =
  684|    307|              (6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels);
  685|    307|        }
  686|  2.20k|      } else if (pstr_input_config->ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  2.00k|#define SBR_8_3 (2)
  ------------------
  |  Branch (686:18): [True: 181, False: 1.82k]
  ------------------
  687|    181|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (687:13): [True: 137, False: 44]
  ------------------
  688|    181|            (WORD32)(6 * ((pstr_input_config->i_samp_freq * 3) / 8) *
  689|    181|                     pstr_input_config->i_channels)) {
  690|    137|          pstr_input_config->i_bitrate =
  691|    137|              (6 * ((pstr_input_config->i_samp_freq * 3) / 8) * pstr_input_config->i_channels);
  692|    137|        }
  693|  1.82k|      } else if (pstr_input_config->ccfl_idx == SBR_2_1) {
  ------------------
  |  |  198|  1.82k|#define SBR_2_1 (3)
  ------------------
  |  Branch (693:18): [True: 1.24k, False: 578]
  ------------------
  694|  1.24k|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (694:13): [True: 114, False: 1.13k]
  ------------------
  695|  1.24k|            (WORD32)(6 * (pstr_input_config->i_samp_freq / 2) * pstr_input_config->i_channels)) {
  696|    114|          pstr_input_config->i_bitrate =
  697|    114|              (6 * (pstr_input_config->i_samp_freq / 2) * pstr_input_config->i_channels);
  698|    114|        }
  699|  1.24k|      } else if (pstr_input_config->ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|    578|#define SBR_4_1 (4)
  ------------------
  |  Branch (699:18): [True: 578, False: 0]
  ------------------
  700|    578|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (700:13): [True: 165, False: 413]
  ------------------
  701|    578|            (WORD32)(6 * (pstr_input_config->i_samp_freq / 4) * pstr_input_config->i_channels)) {
  702|    165|          pstr_input_config->i_bitrate =
  703|    165|              (6 * (pstr_input_config->i_samp_freq / 4) * pstr_input_config->i_channels);
  704|    165|        }
  705|    578|      }
  706|  4.20k|    }
  707|       |
  708|  4.20k|    {
  709|  4.20k|      if ((pstr_input_config->codec_mode == USAC_SWITCHED ||
  ------------------
  |  |   35|  8.41k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (709:12): [True: 1.39k, False: 2.80k]
  ------------------
  710|  2.80k|           pstr_input_config->codec_mode == USAC_ONLY_TD) && pstr_input_config->esbr_flag &&
  ------------------
  |  |   37|  2.80k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (710:12): [True: 116, False: 2.69k]
  |  Branch (710:62): [True: 943, False: 570]
  ------------------
  711|    943|          pstr_input_config->i_samp_freq > 24000) {
  ------------------
  |  Branch (711:11): [True: 764, False: 179]
  ------------------
  712|    764|        if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768) {
  ------------------
  |  |  195|    764|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (712:13): [True: 159, False: 605]
  ------------------
  713|    159|          pstr_input_config->ccfl_idx = SBR_8_3;  // Use 8:3 eSBR
  ------------------
  |  |  197|    159|#define SBR_8_3 (2)
  ------------------
  714|    159|        }
  715|    764|        if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|    764|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (715:13): [True: 151, False: 613]
  ------------------
  716|    151|          pstr_input_config->ccfl_idx = SBR_2_1;  // Use 2:1 eSBR
  ------------------
  |  |  198|    151|#define SBR_2_1 (3)
  ------------------
  717|    151|        }
  718|    764|      }
  719|       |
  720|  4.20k|      if (pstr_input_config->codec_mode == USAC_ONLY_FD &&
  ------------------
  |  |   36|  8.41k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (720:11): [True: 2.69k, False: 1.51k]
  ------------------
  721|  2.69k|          pstr_input_config->i_samp_freq > 24000 && pstr_input_config->esbr_flag &&
  ------------------
  |  Branch (721:11): [True: 2.00k, False: 683]
  |  Branch (721:53): [True: 1.06k, False: 940]
  ------------------
  722|  1.06k|          pstr_input_config->i_bitrate <= MAX_USAC_ESBR_BITRATE) {
  ------------------
  |  |  203|  1.06k|#define MAX_USAC_ESBR_BITRATE (96000)
  ------------------
  |  Branch (722:11): [True: 1.06k, False: 0]
  ------------------
  723|  1.06k|        if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768) {
  ------------------
  |  |  195|  1.06k|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (723:13): [True: 26, False: 1.04k]
  ------------------
  724|     26|          pstr_input_config->ccfl_idx = SBR_8_3;  // Use 8:3 eSBR
  ------------------
  |  |  197|     26|#define SBR_8_3 (2)
  ------------------
  725|     26|        }
  726|  1.06k|        if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|  1.06k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (726:13): [True: 629, False: 440]
  ------------------
  727|    629|          pstr_input_config->ccfl_idx = SBR_2_1;  // Use 2:1 eSBR
  ------------------
  |  |  198|    629|#define SBR_2_1 (3)
  ------------------
  728|    629|        }
  729|  1.06k|      }
  730|       |
  731|  4.20k|      if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768 ||
  ------------------
  |  |  195|  8.41k|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (731:11): [True: 469, False: 3.73k]
  ------------------
  732|  3.73k|          pstr_input_config->ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  3.73k|#define SBR_8_3 (2)
  ------------------
  |  Branch (732:11): [True: 366, False: 3.37k]
  ------------------
  733|    835|        pstr_input_config->frame_length = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    835|#define LEN_SUPERFRAME_768 (768)
  ------------------
  734|  3.37k|      } else {
  735|  3.37k|        pstr_input_config->frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|  3.37k|#define LEN_SUPERFRAME (1024)
  ------------------
  736|  3.37k|      }
  737|  4.20k|    }
  738|  4.20k|    if (pstr_input_config->random_access_interval < MIN_RAP_INTERVAL_IN_MS) {
  ------------------
  |  |  209|  4.20k|#define MIN_RAP_INTERVAL_IN_MS (1000)
  ------------------
  |  Branch (738:9): [True: 1.82k, False: 2.37k]
  ------------------
  739|  1.82k|      pstr_input_config->random_access_interval = DEFAULT_RAP_INTERVAL_IN_MS;
  ------------------
  |  |  208|  1.82k|#define DEFAULT_RAP_INTERVAL_IN_MS (-1)
  ------------------
  740|  1.82k|    }
  741|  4.20k|    if (pstr_input_config->method_def > MAX_METHOD_DEFINITION_TYPE) {
  ------------------
  |  |  131|  4.20k|#define MAX_METHOD_DEFINITION_TYPE (9)
  ------------------
  |  Branch (741:9): [True: 3.12k, False: 1.08k]
  ------------------
  742|  3.12k|      pstr_input_config->method_def = METHOD_DEFINITION_PROGRAM_LOUDNESS;
  ------------------
  |  |   24|  3.12k|#define METHOD_DEFINITION_PROGRAM_LOUDNESS 1
  ------------------
  743|  3.12k|    }
  744|  4.20k|    if (pstr_input_config->measurement_system != MEASUREMENT_SYSTEM_BS_1770_3) {
  ------------------
  |  |   34|  4.20k|#define MEASUREMENT_SYSTEM_BS_1770_3 2
  ------------------
  |  Branch (744:9): [True: 4.20k, False: 1]
  ------------------
  745|  4.20k|      pstr_input_config->measurement_system = MEASUREMENT_SYSTEM_BS_1770_3;
  ------------------
  |  |   34|  4.20k|#define MEASUREMENT_SYSTEM_BS_1770_3 2
  ------------------
  746|  4.20k|    }
  747|  4.20k|    if (pstr_input_config->measured_loudness > MAX_METHOD_VALUE ||
  ------------------
  |  |  133|  8.41k|#define MAX_METHOD_VALUE (121.0f)
  ------------------
  |  Branch (747:9): [True: 0, False: 4.20k]
  ------------------
  748|  4.20k|        pstr_input_config->measured_loudness < MIN_METHOD_VALUE) {
  ------------------
  |  |  132|  4.20k|#define MIN_METHOD_VALUE (-116.0f)
  ------------------
  |  Branch (748:9): [True: 124, False: 4.08k]
  ------------------
  749|    124|      pstr_input_config->measured_loudness = DEFAULT_METHOD_VALUE;
  ------------------
  |  |  135|    124|#define DEFAULT_METHOD_VALUE (-31.0f)
  ------------------
  750|    124|    }
  751|  4.20k|    if (pstr_input_config->sample_peak_level > MAX_SAMPLE_PEAK_LEVEL ||
  ------------------
  |  |  126|  8.41k|#define MAX_SAMPLE_PEAK_LEVEL (20.0f)
  ------------------
  |  Branch (751:9): [True: 0, False: 4.20k]
  ------------------
  752|  4.20k|        pstr_input_config->sample_peak_level < MIN_SAMPLE_PEAK_LEVEL) {
  ------------------
  |  |  125|  4.20k|#define MIN_SAMPLE_PEAK_LEVEL (-107.0f)
  ------------------
  |  Branch (752:9): [True: 0, False: 4.20k]
  ------------------
  753|      0|      pstr_input_config->sample_peak_level = DEFAULT_SAMPLE_PEAK_VALUE;
  ------------------
  |  |  136|      0|#define DEFAULT_SAMPLE_PEAK_VALUE (-31.0f)
  ------------------
  754|      0|    }
  755|  4.20k|    if (pstr_input_config->use_delay_adjustment != 0 &&
  ------------------
  |  Branch (755:9): [True: 4.04k, False: 158]
  ------------------
  756|  4.04k|        pstr_input_config->use_delay_adjustment != 1) {
  ------------------
  |  Branch (756:9): [True: 4.04k, False: 0]
  ------------------
  757|  4.04k|      pstr_input_config->use_delay_adjustment = USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE;
  ------------------
  |  |  213|  4.04k|#define USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE (1)
  ------------------
  758|  4.04k|    }
  759|  4.20k|    if (pstr_input_config->use_drc_element) {
  ------------------
  |  Branch (759:9): [True: 2.23k, False: 1.97k]
  ------------------
  760|  2.23k|      ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)pstr_input_config->pv_drc_cfg;
  761|  2.23k|      err_code = impd_drc_validate_config_params(pstr_drc_cfg);
  762|  2.23k|      if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  2.23k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (762:11): [True: 0, False: 2.23k]
  ------------------
  763|      0|        return err_code;
  764|      0|      }
  765|  2.23k|      if (err_code) {
  ------------------
  |  Branch (765:11): [True: 761, False: 1.47k]
  ------------------
  766|    761|        pstr_input_config->use_drc_element = 0;
  767|    761|        err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    761|#define IA_NO_ERROR 0x00000000
  ------------------
  768|    761|      }
  769|  2.23k|    }
  770|  4.20k|  } else {
  771|  2.53k|    pstr_input_config->cplx_pred = 0;
  772|  2.53k|    pstr_input_config->harmonic_sbr = 0;
  773|  2.53k|    pstr_input_config->pvc_active = 0;
  774|  2.53k|    pstr_input_config->inter_tes_active = 0;
  775|  2.53k|    pstr_input_config->use_drc_element = 0;
  776|  2.53k|    pstr_input_config->hq_esbr = 0;
  777|  2.53k|    pstr_input_config->use_delay_adjustment = 0;
  778|  2.53k|    if (pstr_input_config->i_channels != 2 && pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  1.97k|#define AOT_PS (29)
  ------------------
  |  Branch (778:9): [True: 1.97k, False: 556]
  |  Branch (778:47): [True: 230, False: 1.74k]
  ------------------
  779|    230|      pstr_input_config->aot = AOT_SBR;
  ------------------
  |  |  141|    230|#define AOT_SBR (5)
  ------------------
  780|    230|    }
  781|  2.53k|    if (pstr_input_config->aac_config.use_tns != 1 &&
  ------------------
  |  Branch (781:9): [True: 812, False: 1.71k]
  ------------------
  782|    812|        pstr_input_config->aac_config.use_tns != 0) {
  ------------------
  |  Branch (782:9): [True: 0, False: 812]
  ------------------
  783|      0|      pstr_input_config->aac_config.use_tns = 0;
  784|      0|    }
  785|  2.53k|    if (pstr_input_config->aac_config.noise_filling != 1 &&
  ------------------
  |  Branch (785:9): [True: 1.02k, False: 1.50k]
  ------------------
  786|  1.02k|        pstr_input_config->aac_config.noise_filling != 0) {
  ------------------
  |  Branch (786:9): [True: 0, False: 1.02k]
  ------------------
  787|      0|      pstr_input_config->aac_config.noise_filling = 0;
  788|      0|    }
  789|  2.53k|    if (pstr_input_config->i_use_adts != 1 && pstr_input_config->i_use_adts != 0) {
  ------------------
  |  Branch (789:9): [True: 1.85k, False: 671]
  |  Branch (789:47): [True: 0, False: 1.85k]
  ------------------
  790|      0|      pstr_input_config->i_use_adts = 0;
  791|      0|      pstr_input_config->i_use_es = 1;
  792|      0|    }
  793|  2.53k|    if (pstr_input_config->aac_config.full_bandwidth != 1 &&
  ------------------
  |  Branch (793:9): [True: 1.49k, False: 1.03k]
  ------------------
  794|  1.49k|        pstr_input_config->aac_config.full_bandwidth != 0) {
  ------------------
  |  Branch (794:9): [True: 0, False: 1.49k]
  ------------------
  795|      0|      pstr_input_config->aac_config.full_bandwidth = 0;
  796|      0|    }
  797|  2.53k|    {
  798|  2.53k|      if (pstr_input_config->i_bitrate < MINIMUM_BITRATE * pstr_input_config->i_channels) {
  ------------------
  |  |   23|  2.53k|#define MINIMUM_BITRATE 8000
  ------------------
  |  Branch (798:11): [True: 1.24k, False: 1.28k]
  ------------------
  799|  1.24k|        pstr_input_config->i_bitrate = MINIMUM_BITRATE * pstr_input_config->i_channels;
  ------------------
  |  |   23|  1.24k|#define MINIMUM_BITRATE 8000
  ------------------
  800|  1.24k|      }
  801|  2.53k|      if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (801:11): [True: 772, False: 1.75k]
  ------------------
  802|  2.53k|          (WORD32)(6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels)) {
  803|    772|        pstr_input_config->i_bitrate =
  804|    772|            (6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels);
  805|    772|      }
  806|  2.53k|    }
  807|       |
  808|  2.53k|    {
  809|  2.53k|      if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |   34|  5.06k|#define AOT_AAC_LC (2)
  ------------------
                    if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |  141|  4.75k|#define AOT_SBR (5)
  ------------------
  |  Branch (809:11): [True: 310, False: 2.22k]
  |  Branch (809:51): [True: 823, False: 1.39k]
  ------------------
  810|  1.39k|          pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  1.39k|#define AOT_PS (29)
  ------------------
  |  Branch (810:11): [True: 258, False: 1.13k]
  ------------------
  811|  1.39k|        if (pstr_input_config->frame_length != LEN_SUPERFRAME &&
  ------------------
  |  |   66|  2.78k|#define LEN_SUPERFRAME (1024)
  ------------------
  |  Branch (811:13): [True: 1.19k, False: 201]
  ------------------
  812|  1.19k|            pstr_input_config->frame_length != FRAME_LEN_960) {
  ------------------
  |  |   94|  1.19k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (812:13): [True: 714, False: 476]
  ------------------
  813|    714|          pstr_input_config->frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|    714|#define LEN_SUPERFRAME (1024)
  ------------------
  814|    714|        }
  815|  1.39k|      } else if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  2.27k|#define AOT_AAC_LD (23)
  ------------------
                    } else if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|    942|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (815:18): [True: 197, False: 942]
  |  Branch (815:58): [True: 942, False: 0]
  ------------------
  816|  1.13k|        if (pstr_input_config->frame_length != FRAME_LEN_512 &&
  ------------------
  |  |   92|  2.27k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (816:13): [True: 1.02k, False: 112]
  ------------------
  817|  1.02k|            pstr_input_config->frame_length != FRAME_LEN_480) {
  ------------------
  |  |   93|  1.02k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (817:13): [True: 524, False: 503]
  ------------------
  818|    524|          pstr_input_config->frame_length = FRAME_LEN_512;
  ------------------
  |  |   92|    524|#define FRAME_LEN_512 512
  ------------------
  819|    524|        }
  820|  1.13k|      } else {
  821|      0|        pstr_input_config->frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|      0|#define LEN_SUPERFRAME (1024)
  ------------------
  822|      0|      }
  823|  2.53k|    }
  824|  2.53k|    if ((pstr_input_config->frame_length == FRAME_LEN_960) &&
  ------------------
  |  |   94|  2.53k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (824:9): [True: 476, False: 2.05k]
  ------------------
  825|    476|        (pstr_input_config->esbr_flag == 1)) {
  ------------------
  |  Branch (825:9): [True: 267, False: 209]
  ------------------
  826|    267|      pstr_input_config->esbr_flag = 0;
  827|    267|    }
  828|  2.53k|  }
  829|  6.73k|  return err_code;
  830|  6.73k|}
ixheaace_api.c:ixheaace_set_default_channel_mask:
  469|  1.70k|static VOID ixheaace_set_default_channel_mask(WORD32 *ch_mask, WORD32 num_ch) {
  470|  1.70k|  switch (num_ch) {
  ------------------
  |  Branch (470:11): [True: 1.70k, False: 0]
  ------------------
  471|    233|  case 1:
  ------------------
  |  Branch (471:3): [True: 233, False: 1.47k]
  ------------------
  472|    233|    *ch_mask = CH_MASK_CENTER_FRONT;
  ------------------
  |  |  104|    233|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
  473|    233|    break;
  474|    401|  case 2:
  ------------------
  |  Branch (474:3): [True: 401, False: 1.30k]
  ------------------
  475|    401|    *ch_mask = CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  105|    401|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  476|    401|    break;
  477|    156|  case 3:
  ------------------
  |  Branch (477:3): [True: 156, False: 1.54k]
  ------------------
  478|    156|    *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT);
  ------------------
  |  |  104|    156|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT);
  ------------------
  |  |  105|    156|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  479|    156|    break;
  480|    181|  case 4:
  ------------------
  |  Branch (480:3): [True: 181, False: 1.52k]
  ------------------
  481|    181|    *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER);
  ------------------
  |  |  104|    181|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER);
  ------------------
  |  |  105|    181|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER);
  ------------------
  |  |  106|    181|#define CH_MASK_REAR_CENTER (0x100)
  ------------------
  482|    181|    break;
  483|    322|  case 5:
  ------------------
  |  Branch (483:3): [True: 322, False: 1.38k]
  ------------------
  484|    322|    *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK);
  ------------------
  |  |  104|    322|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK);
  ------------------
  |  |  105|    322|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK);
  ------------------
  |  |  107|    322|#define CH_MASK_LEFT_RIGHT_BACK (0X30)
  ------------------
  485|    322|    break;
  486|    410|  case 6:
  ------------------
  |  Branch (486:3): [True: 410, False: 1.29k]
  ------------------
  487|    410|    *ch_mask =
  488|    410|      (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE);
  ------------------
  |  |  104|    410|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE);
  ------------------
  |  |  105|    410|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                    (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE);
  ------------------
  |  |  107|    410|#define CH_MASK_LEFT_RIGHT_BACK (0X30)
  ------------------
                    (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE);
  ------------------
  |  |  108|    410|#define CH_MASK_LFE (0x08)
  ------------------
  489|    410|    break;
  490|  1.70k|  }
  491|  1.70k|}
ixheaace_api.c:ixheaace_validate_channel_mask:
  435|  1.79k|static IA_ERRORCODE ixheaace_validate_channel_mask(WORD32 ch_mask, WORD32 num_ch) {
  436|  1.79k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.79k|#define IA_NO_ERROR 0x00000000
  ------------------
  437|       |  // If ch_mask not supported, return error
  438|  1.79k|  WORD32 temp_mask;
  439|  1.79k|  switch (num_ch) {
  440|    306|    case 1:
  ------------------
  |  Branch (440:5): [True: 306, False: 1.48k]
  ------------------
  441|    306|      temp_mask = CH_MASK_CENTER_FRONT;
  ------------------
  |  |  104|    306|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
  442|    306|      break;
  443|    396|    case 2:
  ------------------
  |  Branch (443:5): [True: 396, False: 1.39k]
  ------------------
  444|    396|      temp_mask = CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  105|    396|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  445|    396|      break;
  446|    156|    case 3:
  ------------------
  |  Branch (446:5): [True: 156, False: 1.63k]
  ------------------
  447|    156|      temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  104|    156|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  105|    156|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  448|    156|      break;
  449|    182|    case 4:
  ------------------
  |  Branch (449:5): [True: 182, False: 1.61k]
  ------------------
  450|    182|      temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER;
  ------------------
  |  |  104|    182|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER;
  ------------------
  |  |  105|    182|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER;
  ------------------
  |  |  106|    182|#define CH_MASK_REAR_CENTER (0x100)
  ------------------
  451|    182|      break;
  452|    327|    case 5:
  ------------------
  |  Branch (452:5): [True: 327, False: 1.46k]
  ------------------
  453|    327|      temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK;
  ------------------
  |  |  104|    327|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK;
  ------------------
  |  |  105|    327|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK;
  ------------------
  |  |  107|    327|#define CH_MASK_LEFT_RIGHT_BACK (0X30)
  ------------------
  454|    327|      break;
  455|    427|    case 6:
  ------------------
  |  Branch (455:5): [True: 427, False: 1.36k]
  ------------------
  456|    427|      temp_mask =
  457|    427|          CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE;
  ------------------
  |  |  104|    427|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                        CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE;
  ------------------
  |  |  105|    427|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                        CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE;
  ------------------
  |  |  107|    427|#define CH_MASK_LEFT_RIGHT_BACK (0X30)
  ------------------
                        CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE;
  ------------------
  |  |  108|    427|#define CH_MASK_LFE (0x08)
  ------------------
  458|    427|      break;
  459|      0|    default:
  ------------------
  |  Branch (459:5): [True: 0, False: 1.79k]
  ------------------
  460|      0|      temp_mask = 0;
  461|      0|      break;
  462|  1.79k|  }
  463|  1.79k|  if (ch_mask != temp_mask) {
  ------------------
  |  Branch (463:7): [True: 30, False: 1.76k]
  ------------------
  464|     30|    err_code =  IA_EXHEAACE_CONFIG_FATAL_CHANNELS_MASK;
  465|     30|  }
  466|  1.79k|  return err_code;
  467|  1.79k|}
ixheaace_api.c:ia_enhaacplus_enc_find_channel_config:
  329|  1.76k|                                                  WORD32 i_channel_mask) {
  330|  1.76k|  WORD32 i;
  331|  1.76k|  WORD32 slots_for_elements[2 * MAXIMUM_BS_ELE];
  332|  1.76k|  *num_bs_elements = 0;
  333|       |
  334|  1.76k|  ia_enhaacplus_enc_find_slots_for_elements(i_channel_mask, slots_for_elements,
  335|  1.76k|                                            i_num_coupling_chan);
  336|       |
  337|  1.76k|  if ((i_channel_mask & 0x4)) {
  ------------------
  |  Branch (337:7): [True: 1.37k, False: 392]
  ------------------
  338|       |    /*Front Center Present*/
  339|  1.37k|    chan_config[*num_bs_elements] = 1;
  340|  1.37k|    element_type[*num_bs_elements] = ID_SCE;
  341|  1.37k|    element_slot[*num_bs_elements] = slots_for_elements[FRONT_CENTER];
  342|  1.37k|    element_instance_tag[*num_bs_elements] = 0;
  343|  1.37k|    (*num_bs_elements)++;
  344|  1.37k|  }
  345|       |
  346|  1.76k|  if ((i_channel_mask & 0x3)) {
  ------------------
  |  Branch (346:7): [True: 1.48k, False: 282]
  ------------------
  347|       |    /*Front Left and Right Present*/
  348|  1.48k|    chan_config[*num_bs_elements] = 2;
  349|  1.48k|    element_type[*num_bs_elements] = ID_CPE;
  350|  1.48k|    element_slot[*num_bs_elements] = slots_for_elements[FRONT_LEFT_RIGHT];
  351|  1.48k|    element_instance_tag[*num_bs_elements] = 0;
  352|  1.48k|    (*num_bs_elements)++;
  353|  1.48k|  }
  354|       |
  355|  1.76k|  if ((i_channel_mask & 0x30)) {
  ------------------
  |  Branch (355:7): [True: 753, False: 1.01k]
  ------------------
  356|       |    /*Back Left and Right Present*/
  357|    753|    chan_config[*num_bs_elements] = 2;
  358|    753|    element_type[*num_bs_elements] = ID_CPE;
  359|    753|    element_slot[*num_bs_elements] = slots_for_elements[BACK_LEFT_RIGHT];
  360|    753|    element_instance_tag[*num_bs_elements] = 1;
  361|    753|    (*num_bs_elements)++;
  362|    753|  }
  363|       |
  364|  1.76k|  if ((i_channel_mask & 0x100)) {
  ------------------
  |  Branch (364:7): [True: 181, False: 1.58k]
  ------------------
  365|       |    /* Rear Center Present*/
  366|    181|    chan_config[*num_bs_elements] = 1;
  367|    181|    element_type[*num_bs_elements] = ID_SCE;
  368|    181|    element_slot[*num_bs_elements] = slots_for_elements[REAR_CENTER];
  369|    181|    element_instance_tag[*num_bs_elements] = 1;
  370|    181|    (*num_bs_elements)++;
  371|    181|  }
  372|       |
  373|  1.76k|  if ((i_channel_mask & 0x8)) {
  ------------------
  |  Branch (373:7): [True: 427, False: 1.33k]
  ------------------
  374|       |    /*LFE channel Present*/
  375|    427|    chan_config[*num_bs_elements] = 1;
  376|    427|    element_type[*num_bs_elements] = ID_LFE;
  377|    427|    element_slot[*num_bs_elements] = slots_for_elements[LFE_CHANNEL];
  378|    427|    element_instance_tag[*num_bs_elements] = 0;
  379|    427|    (*num_bs_elements)++;
  380|    427|  }
  381|       |
  382|  1.76k|  if (i_num_coupling_chan != 0) {
  ------------------
  |  Branch (382:7): [True: 0, False: 1.76k]
  ------------------
  383|      0|    for (i = 0; i < i_num_coupling_chan; i++) {
  ------------------
  |  Branch (383:17): [True: 0, False: 0]
  ------------------
  384|       |      /*Coupling Channel Present*/
  385|      0|      chan_config[*num_bs_elements] = 1;
  386|      0|      element_type[*num_bs_elements] = ID_CCE;
  387|      0|      element_slot[*num_bs_elements] = slots_for_elements[COUPLING_CH + i];
  388|      0|      element_instance_tag[*num_bs_elements] = i_num_coupling_chan - i - 1;
  389|      0|      (*num_bs_elements)++;
  390|      0|    }
  391|      0|  }
  392|  1.76k|}
ixheaace_api.c:ia_enhaacplus_enc_find_slots_for_elements:
  287|  1.76k|                                                      WORD32 i_num_coupling_chan) {
  288|  1.76k|  WORD32 slot = 0, i;
  289|       |
  290|  1.76k|  if ((i_channel_mask & 0x3)) {
  ------------------
  |  Branch (290:7): [True: 1.48k, False: 282]
  ------------------
  291|  1.48k|    slots_for_elements[FRONT_LEFT_RIGHT] = slot;
  292|  1.48k|    slot += 2;
  293|  1.48k|  }
  294|       |
  295|  1.76k|  if ((i_channel_mask & 0x4)) {
  ------------------
  |  Branch (295:7): [True: 1.37k, False: 392]
  ------------------
  296|  1.37k|    slots_for_elements[FRONT_CENTER] = slot;
  297|  1.37k|    slot += 1;
  298|  1.37k|  }
  299|       |
  300|  1.76k|  if ((i_channel_mask & 0x8)) {
  ------------------
  |  Branch (300:7): [True: 427, False: 1.33k]
  ------------------
  301|    427|    slots_for_elements[LFE_CHANNEL] = slot;
  302|    427|    slot += 1;
  303|    427|  }
  304|       |
  305|  1.76k|  if ((i_channel_mask & 0x30)) {
  ------------------
  |  Branch (305:7): [True: 753, False: 1.01k]
  ------------------
  306|    753|    slots_for_elements[BACK_LEFT_RIGHT] = slot;
  307|    753|    slot += 2;
  308|    753|  }
  309|       |
  310|  1.76k|  if ((i_channel_mask & 0x100)) {
  ------------------
  |  Branch (310:7): [True: 181, False: 1.58k]
  ------------------
  311|    181|    slots_for_elements[REAR_CENTER] = slot;
  312|    181|    slot += 1;
  313|    181|  }
  314|       |
  315|  1.76k|  if (i_num_coupling_chan != 0) {
  ------------------
  |  Branch (315:7): [True: 0, False: 1.76k]
  ------------------
  316|      0|    for (i = 0; i < i_num_coupling_chan; i++) {
  ------------------
  |  Branch (316:17): [True: 0, False: 0]
  ------------------
  317|      0|      slots_for_elements[COUPLING_CH + i] = slot;
  318|      0|      slot += 1;
  319|      0|    }
  320|      0|  }
  321|       |
  322|  1.76k|  return;
  323|  1.76k|}
ixheaace_api.c:ia_enhaacplus_enc_allocate_bitrate_between_channels:
  395|  1.09k|    ixheaace_api_struct *pstr_api_struct, WORD32 *bitrate, WORD32 inp_bitrate) {
  396|  1.09k|  WORD32 ele_idx;
  397|  1.09k|  WORD32 num_lfe = 0, num_mono = 0, num_stereo = 0;
  398|  1.09k|  WORD32 bitrate_per_stereo, bitrate_per_mono;
  399|  4.63k|  for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (399:21): [True: 3.54k, False: 1.09k]
  ------------------
  400|  3.54k|    switch (pstr_api_struct->config[ele_idx].element_type) {
  401|  1.27k|      case ID_SCE:
  ------------------
  |  Branch (401:7): [True: 1.27k, False: 2.27k]
  ------------------
  402|  1.27k|      case ID_CCE:
  ------------------
  |  Branch (402:7): [True: 0, False: 3.54k]
  ------------------
  403|  1.27k|        num_mono++;
  404|  1.27k|        break;
  405|  1.84k|      case ID_CPE:
  ------------------
  |  Branch (405:7): [True: 1.84k, False: 1.69k]
  ------------------
  406|  1.84k|        num_stereo++;
  407|  1.84k|        break;
  408|    427|      case ID_LFE:
  ------------------
  |  Branch (408:7): [True: 427, False: 3.11k]
  ------------------
  409|    427|        num_lfe++;
  410|    427|        break;
  411|      0|      default:
  ------------------
  |  Branch (411:7): [True: 0, False: 3.54k]
  ------------------
  412|      0|        return;
  413|  3.54k|    }
  414|  3.54k|  }
  415|  1.09k|  bitrate_per_stereo = (WORD32)((inp_bitrate - (num_lfe)*8000) / (num_mono * 0.625 + num_stereo));
  416|  1.09k|  bitrate_per_mono = (WORD32)(0.625 * bitrate_per_stereo);
  417|  4.63k|  for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (417:21): [True: 3.54k, False: 1.09k]
  ------------------
  418|  3.54k|    switch (pstr_api_struct->config[ele_idx].element_type) {
  419|  1.27k|      case ID_SCE:
  ------------------
  |  Branch (419:7): [True: 1.27k, False: 2.27k]
  ------------------
  420|  1.27k|      case ID_CCE:
  ------------------
  |  Branch (420:7): [True: 0, False: 3.54k]
  ------------------
  421|  1.27k|        bitrate[ele_idx] = bitrate_per_mono;
  422|  1.27k|        break;
  423|  1.84k|      case ID_CPE:
  ------------------
  |  Branch (423:7): [True: 1.84k, False: 1.69k]
  ------------------
  424|  1.84k|        bitrate[ele_idx] = bitrate_per_stereo;
  425|  1.84k|        break;
  426|    427|      case ID_LFE:
  ------------------
  |  Branch (426:7): [True: 427, False: 3.11k]
  ------------------
  427|    427|        bitrate[ele_idx] = 8000;
  428|    427|        break;
  429|      0|      default:
  ------------------
  |  Branch (429:7): [True: 0, False: 3.54k]
  ------------------
  430|      0|        return;
  431|  3.54k|    }
  432|  3.54k|  }
  433|  1.09k|}
ixheaace_api.c:ixheaace_get_measured_loudness_info:
 3512|  3.64k|                                                ixheaace_input_config *pstr_input_config) {
 3513|  3.64k|  ia_drc_input_config *pstr_internal_drc_cfg;
 3514|  3.64k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config;
 3515|  3.64k|  ia_drc_loudness_info_set_struct *pstr_enc_loudness_info_set;
 3516|  3.64k|  WORD32 n, m;
 3517|       |
 3518|  3.64k|  pstr_internal_drc_cfg =
 3519|  3.64k|      (ia_drc_input_config *)&pstr_api_struct->config[0].usac_config.str_drc_cfg;
 3520|  3.64k|  if (pstr_input_config->use_drc_element == 0) {
  ------------------
  |  Branch (3520:7): [True: 2.73k, False: 915]
  ------------------
 3521|  2.73k|    memset(pstr_internal_drc_cfg, 0, sizeof(ia_drc_input_config));
 3522|  2.73k|  }
 3523|  3.64k|  pstr_uni_drc_config = &pstr_internal_drc_cfg->str_uni_drc_config;
 3524|  3.64k|  pstr_enc_loudness_info_set = &pstr_internal_drc_cfg->str_enc_loudness_info_set;
 3525|       |
 3526|  3.64k|  pstr_uni_drc_config->sample_rate_present = 1;
 3527|  3.64k|  pstr_uni_drc_config->loudness_info_set_present = 1;
 3528|  3.64k|  pstr_enc_loudness_info_set->loudness_info_count = 1;
 3529|       |
 3530|  7.29k|  for (n = 0; n < pstr_enc_loudness_info_set->loudness_info_count; n++) {
  ------------------
  |  Branch (3530:15): [True: 3.64k, False: 3.64k]
  ------------------
 3531|  3.64k|    pstr_enc_loudness_info_set->str_loudness_info[n].drc_set_id = 0;
 3532|  3.64k|    pstr_enc_loudness_info_set->str_loudness_info[n].downmix_id = 0;
 3533|  3.64k|    pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level_present = 1;
 3534|  3.64k|    pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level =
 3535|  3.64k|        pstr_input_config->sample_peak_level;
 3536|  3.64k|    pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level_present = 0;
 3537|  3.64k|    pstr_enc_loudness_info_set->str_loudness_info[n].measurement_count = 1;
 3538|       |
 3539|  7.29k|    for (m = 0; m < pstr_enc_loudness_info_set->str_loudness_info[n].measurement_count; m++) {
  ------------------
  |  Branch (3539:17): [True: 3.64k, False: 3.64k]
  ------------------
 3540|  3.64k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].method_definition =
 3541|  3.64k|          pstr_input_config->method_def;
 3542|  3.64k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].method_value =
 3543|  3.64k|          (FLOAT32)pstr_input_config->measured_loudness;
 3544|  3.64k|      pstr_enc_loudness_info_set->str_loudness_info[n]
 3545|  3.64k|          .str_loudness_measure[m]
 3546|  3.64k|          .measurement_system = pstr_input_config->measurement_system;
 3547|  3.64k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].reliability = 3;
 3548|  3.64k|    }
 3549|  3.64k|  }
 3550|  3.64k|}
ixheaace_api.c:ixheaace_fill_mem_tabs:
 1235|  6.52k|static VOID ixheaace_fill_mem_tabs(ixheaace_api_struct *pstr_api_struct, WORD32 aot) {
 1236|  6.52k|  WORD32 ele_idx;
 1237|  6.52k|  WORD32 num_channel;
 1238|  6.52k|  WORD32 frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|  6.52k|#define LEN_SUPERFRAME (1024)
  ------------------
 1239|  6.52k|  ixheaace_mem_info_struct *pstr_mem_info;
 1240|  6.52k|  frame_length = pstr_api_struct->config[0].frame_length;
 1241|  6.52k|  WORD32 offset_size = 0;
 1242|  6.52k|  if (pstr_api_struct->usac_en) {
  ------------------
  |  Branch (1242:7): [True: 4.20k, False: 2.32k]
  ------------------
 1243|  4.20k|    WORD32 fac_downsample = 1;
 1244|  4.20k|    if (pstr_api_struct->config[0].ccfl_idx > NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|  4.20k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (1244:9): [True: 2.96k, False: 1.23k]
  ------------------
 1245|  2.96k|      fac_downsample = pstr_api_struct->config[0].ccfl_idx >> 1;
 1246|  2.96k|    } else {
 1247|  1.23k|      fac_downsample = 1;
 1248|  1.23k|    }
 1249|       |    /* persistant */
 1250|  4.20k|    {
 1251|  4.20k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_PERSIST_IDX];
  ------------------
  |  |   29|  4.20k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
 1252|  4.20k|      {
 1253|  4.20k|        pstr_mem_info->ui_size =
 1254|  4.20k|            IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8) +
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1255|  4.20k|            iusace_calc_pers_buf_sizes(pstr_api_struct);
 1256|  4.20k|        if (pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1256:13): [True: 2.96k, False: 1.23k]
  ------------------
 1257|  2.96k|          pstr_mem_info->ui_size += ixheaace_sbr_enc_pers_size(
 1258|  2.96k|              2, 0, pstr_api_struct->config[0].usac_config.sbr_harmonic);
 1259|  2.96k|        }
 1260|  4.20k|        offset_size = 2 *
 1261|  4.20k|                      ia_enhaacplus_enc_sizeof_delay_buffer(
 1262|  4.20k|                          0, AOT_USAC, pstr_api_struct->config[0].ccfl_idx,
  ------------------
  |  |  142|  4.20k|#define AOT_USAC (42)
  ------------------
 1263|  4.20k|                          sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1264|  4.20k|                          pstr_api_struct->config[0].use_mps) *
 1265|  4.20k|                      pstr_api_struct->config[0].num_bs_elements;
 1266|  4.20k|        pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1267|       |
 1268|  4.20k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1268:13): [True: 1.22k, False: 2.98k]
  ------------------
 1269|  1.22k|          offset_size =
 1270|  1.22k|              (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
  ------------------
  |  |  111|  1.22k|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|  1.22k|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|  1.22k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.22k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1271|  1.22k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.22k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1272|       |
 1273|  1.22k|          offset_size =
 1274|  1.22k|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]);
  ------------------
  |  |   64|  1.22k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1275|  1.22k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.22k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1276|       |
 1277|  1.22k|          pstr_mem_info->ui_size +=
 1278|  1.22k|              IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.22k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1279|  1.22k|        }
 1280|  4.20k|        if (1 == pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1280:13): [True: 2.96k, False: 1.23k]
  ------------------
 1281|  2.96k|          offset_size =
 1282|  2.96k|              (MAX_FRAME_LEN * (1 << fac_downsample) + MAX_DS_8_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  101|  2.96k|#define MAX_FRAME_LEN (1024)
  ------------------
                            (MAX_FRAME_LEN * (1 << fac_downsample) + MAX_DS_8_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |   85|  2.96k|#define MAX_DS_8_1_FILTER_DELAY (248)
  ------------------
                            (MAX_FRAME_LEN * (1 << fac_downsample) + MAX_DS_8_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  152|  2.96k|#define INPUT_DELAY ((CORE_DELAY)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  148|  2.96k|#define CORE_DELAY (1600)
  |  |  ------------------
  ------------------
 1283|  2.96k|              MAX_CHANNELS * sizeof(pstr_mem_info->ui_size);
  ------------------
  |  |   77|  2.96k|#define MAX_CHANNELS (2)
  ------------------
 1284|  2.96k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.96k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1285|  2.96k|        }
 1286|  4.20k|        if ((2 != pstr_api_struct->config[0].usac_config.channels) &&
  ------------------
  |  Branch (1286:13): [True: 1.29k, False: 2.91k]
  ------------------
 1287|  1.29k|            (1 == pstr_api_struct->config[0].usac_config.sbr_enable)) {
  ------------------
  |  Branch (1287:13): [True: 763, False: 532]
  ------------------
 1288|    763|          offset_size = (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal[0]);
  ------------------
  |  |  111|    763|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    763|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    763|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    763|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1289|    763|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    763|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1290|    763|        }
 1291|  4.20k|      }
 1292|       |
 1293|  4.20k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  4.20k|#define BYTE_ALIGN_8 (8)
  ------------------
 1294|  4.20k|      pstr_mem_info->ui_type = IA_MEMTYPE_PERSIST;
  ------------------
  |  |   28|  4.20k|#define IA_MEMTYPE_PERSIST 0x00
  ------------------
 1295|  4.20k|      pstr_mem_info->ui_placement[0] = 0;
 1296|  4.20k|      pstr_mem_info->ui_placement[1] = 0;
 1297|  4.20k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.20k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1298|  4.20k|      pstr_mem_info->ui_placed[0] = 0;
 1299|  4.20k|      pstr_mem_info->ui_placed[1] = 0;
 1300|  4.20k|    }
 1301|       |
 1302|       |    /* scratch */
 1303|  4.20k|    {
 1304|  4.20k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  4.20k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 1305|  4.20k|      UWORD32 usac_scr_size = iusace_scratch_size();
 1306|  4.20k|      if (pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1306:11): [True: 2.96k, False: 1.23k]
  ------------------
 1307|  2.96k|        UWORD32 sbr_scr_size = ixheaace_sbr_enc_scr_size() + ixheaace_resampler_scr_size();
 1308|  2.96k|        pstr_mem_info->ui_size = max(usac_scr_size, sbr_scr_size);
  ------------------
  |  |   74|  2.96k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 2.96k, False: 0]
  |  |  ------------------
  ------------------
 1309|  2.96k|      } else {
 1310|  1.23k|        pstr_mem_info->ui_size = usac_scr_size;
 1311|  1.23k|      }
 1312|       |
 1313|  4.20k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  4.20k|#define BYTE_ALIGN_8 (8)
  ------------------
 1314|  4.20k|      pstr_mem_info->ui_type = IA_MEMTYPE_SCRATCH;
  ------------------
  |  |   30|  4.20k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1315|  4.20k|      pstr_mem_info->ui_placement[0] = 0;
 1316|  4.20k|      pstr_mem_info->ui_placement[1] = 0;
 1317|  4.20k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.20k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1318|  4.20k|      pstr_mem_info->ui_placed[0] = 0;
 1319|  4.20k|      pstr_mem_info->ui_placed[1] = 0;
 1320|  4.20k|    }
 1321|       |
 1322|       |    /* input */
 1323|  4.20k|    {
 1324|  4.20k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_INPUT_IDX];
  ------------------
  |  |   31|  4.20k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
 1325|  4.20k|      WORD32 pcm_wd_sz;
 1326|  4.20k|      num_channel = pstr_api_struct->config[0].i_channels;
 1327|  4.20k|      pcm_wd_sz = pstr_api_struct->config[0].usac_config.ui_pcm_wd_sz;
 1328|  4.20k|      pstr_mem_info->ui_size = frame_length * num_channel * (pcm_wd_sz >> 3);
 1329|  4.20k|      if (1 == pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1329:11): [True: 2.96k, False: 1.23k]
  ------------------
 1330|  2.96k|        switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (1330:17): [True: 2.96k, False: 0]
  ------------------
 1331|    366|          case SBR_8_3:  // 8:3
  ------------------
  |  |  197|    366|#define SBR_8_3 (2)
  ------------------
  |  Branch (1331:11): [True: 366, False: 2.60k]
  ------------------
 1332|    366|            pstr_mem_info->ui_size *= 8;
 1333|    366|            pstr_mem_info->ui_size /= 3;
 1334|    366|            break;
 1335|       |
 1336|  2.02k|          case SBR_2_1:  // 2:1
  ------------------
  |  |  198|  2.02k|#define SBR_2_1 (3)
  ------------------
  |  Branch (1336:11): [True: 2.02k, False: 944]
  ------------------
 1337|  2.02k|            pstr_mem_info->ui_size *= 2;
 1338|  2.02k|            break;
 1339|       |
 1340|    578|          case SBR_4_1:  // 4:1
  ------------------
  |  |  199|    578|#define SBR_4_1 (4)
  ------------------
  |  Branch (1340:11): [True: 578, False: 2.39k]
  ------------------
 1341|    578|            pstr_mem_info->ui_size *= 4;
 1342|    578|            break;
 1343|  2.96k|        }
 1344|  2.96k|      }
 1345|       |
 1346|  4.20k|      pstr_mem_info->ui_alignment =
 1347|  4.20k|          BYTE_ALIGN_8; /* As input is used as scratch memory internally */
  ------------------
  |  |   30|  4.20k|#define BYTE_ALIGN_8 (8)
  ------------------
 1348|  4.20k|      pstr_mem_info->ui_type = IA_MEMTYPE_INPUT;
  ------------------
  |  |   24|  4.20k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
 1349|  4.20k|      pstr_mem_info->ui_placement[0] = 0;
 1350|  4.20k|      pstr_mem_info->ui_placement[1] = 0;
 1351|  4.20k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.20k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1352|  4.20k|      pstr_mem_info->ui_placed[0] = 0;
 1353|  4.20k|      pstr_mem_info->ui_placed[1] = 0;
 1354|  4.20k|    }
 1355|       |
 1356|       |    /* output */
 1357|      0|    {
 1358|  4.20k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_OUTPUT_IDX];
  ------------------
  |  |   32|  4.20k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 1359|  4.20k|      pstr_mem_info->ui_size =
 1360|  4.20k|          ((MAX_PREROLL_FRAMES + 1) * (MAX_CHANNEL_BITS / BYTE_NUMBIT) * num_channel) +
  ------------------
  |  |  205|  4.20k|#define MAX_PREROLL_FRAMES (3)
  ------------------
                        ((MAX_PREROLL_FRAMES + 1) * (MAX_CHANNEL_BITS / BYTE_NUMBIT) * num_channel) +
  ------------------
  |  |   41|  4.20k|#define MAX_CHANNEL_BITS 6144
  ------------------
                        ((MAX_PREROLL_FRAMES + 1) * (MAX_CHANNEL_BITS / BYTE_NUMBIT) * num_channel) +
  ------------------
  |  |   82|  4.20k|#define BYTE_NUMBIT 8
  ------------------
 1361|  4.20k|          MAX_PREROLL_CONFIG_SIZE;
  ------------------
  |  |  210|  4.20k|#define MAX_PREROLL_CONFIG_SIZE (1024)
  ------------------
 1362|  4.20k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  4.20k|#define BYTE_ALIGN_8 (8)
  ------------------
 1363|  4.20k|      pstr_mem_info->ui_type = IA_MEMTYPE_OUTPUT;
  ------------------
  |  |   26|  4.20k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1364|  4.20k|      pstr_mem_info->ui_placement[0] = 0;
 1365|  4.20k|      pstr_mem_info->ui_placement[1] = 0;
 1366|  4.20k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.20k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1367|  4.20k|      pstr_mem_info->ui_placed[0] = 0;
 1368|  4.20k|      pstr_mem_info->ui_placed[1] = 0;
 1369|  4.20k|    }
 1370|  4.20k|  } else {
 1371|       |    /* persistant */
 1372|  2.32k|    {
 1373|  2.32k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_PERSIST_IDX];
  ------------------
  |  |   29|  2.32k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
 1374|  2.32k|      {
 1375|  2.32k|        if (pstr_api_struct->config[0].num_bs_elements == 1) {
  ------------------
  |  Branch (1375:13): [True: 1.23k, False: 1.09k]
  ------------------
 1376|  1.23k|          num_channel = pstr_api_struct->config[0].aac_classic
  ------------------
  |  Branch (1376:25): [True: 235, False: 996]
  ------------------
 1377|  1.23k|                            ? pstr_api_struct->config[0].chmode_nchannels
 1378|  1.23k|                            : (pstr_api_struct->config[0].use_parametric_stereo
  ------------------
  |  Branch (1378:32): [True: 246, False: 750]
  ------------------
 1379|    996|                                   ? 1
 1380|    996|                                   : pstr_api_struct->config[0].chmode_nchannels);
 1381|  1.23k|          pstr_mem_info->ui_size =
 1382|  1.23k|              IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8) +
  ------------------
  |  |   87|  1.23k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1383|  1.23k|              ia_enhaacplus_enc_aac_enc_pers_size(num_channel, aot);
 1384|  1.23k|          if (pstr_api_struct->config[0].aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  2.46k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (1384:15): [True: 1.14k, False: 89]
  ------------------
 1385|  1.14k|              pstr_api_struct->config[0].aot != AOT_AAC_LD) {
  ------------------
  |  |   36|  1.14k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (1385:15): [True: 1.07k, False: 63]
  ------------------
 1386|  1.07k|            pstr_mem_info->ui_size += ixheaace_sbr_enc_pers_size(
 1387|  1.07k|                num_channel, pstr_api_struct->config[0].use_parametric_stereo, 0);
 1388|  1.07k|          }
 1389|  1.23k|          offset_size = ia_enhaacplus_enc_sizeof_delay_buffer(
 1390|  1.23k|                            pstr_api_struct->config[0].aac_config.flag_framelength_small, aot, 3,
 1391|  1.23k|                            sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1392|  1.23k|                            pstr_api_struct->config[0].use_mps) *
 1393|  1.23k|                        pstr_api_struct->config[0].num_bs_elements;
 1394|  1.23k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.23k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1395|  1.23k|        }
 1396|  2.32k|        if (pstr_api_struct->config[0].num_bs_elements > 1) {
  ------------------
  |  Branch (1396:13): [True: 1.09k, False: 1.23k]
  ------------------
 1397|  1.09k|          offset_size = IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8) +
  ------------------
  |  |   87|  1.09k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1398|  1.09k|                        ia_enhaacplus_enc_sizeof_delay_buffer(
 1399|  1.09k|                            pstr_api_struct->config[0].aac_config.flag_framelength_small, aot, 3,
 1400|  1.09k|                            sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1401|  1.09k|                            pstr_api_struct->config[0].use_mps) *
 1402|  1.09k|                            pstr_api_struct->config[0].num_bs_elements;
 1403|  1.09k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.09k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1404|  4.63k|          for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1404:29): [True: 3.54k, False: 1.09k]
  ------------------
 1405|  3.54k|            num_channel = pstr_api_struct->config[ele_idx].i_channels;
 1406|  3.54k|            if (pstr_api_struct->config[ele_idx].element_type != ID_LFE)
  ------------------
  |  Branch (1406:17): [True: 3.11k, False: 427]
  ------------------
 1407|  3.11k|              pstr_mem_info->ui_size += ixheaace_sbr_enc_pers_size(num_channel, 0, 0);
 1408|  3.54k|            pstr_mem_info->ui_size += ia_enhaacplus_enc_aac_enc_pers_size(num_channel, aot) + 32;
 1409|  3.54k|          }
 1410|  1.09k|        }
 1411|       |
 1412|  2.32k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1412:13): [True: 573, False: 1.74k]
  ------------------
 1413|    573|          if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (1413:15): [True: 287, False: 286]
  ------------------
 1414|    287|            offset_size =
 1415|    287|                (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    287|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    287|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    287|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    287|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  147|    287|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|    287|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    287|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1416|    287|                sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
 1417|    287|          } else {
 1418|    286|            offset_size =
 1419|    286|                (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    286|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    286|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    286|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    286|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  139|    286|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    286|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    286|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1420|    286|                sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
 1421|    286|          }
 1422|    573|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    573|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1423|    573|          if (pstr_api_struct->config[0].mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    573|#define TREE_212 (0)
  ------------------
  |  Branch (1423:15): [True: 159, False: 414]
  ------------------
 1424|    159|            pstr_mem_info->ui_size +=
 1425|    159|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    159|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1426|    414|          } else {
 1427|    414|            pstr_mem_info->ui_size +=
 1428|    414|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_515_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    414|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1429|    414|          }
 1430|    573|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|    573|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1431|    573|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]),
 1432|    573|              BYTE_ALIGN_8);
 1433|    573|        }
 1434|       |
 1435|  2.32k|        offset_size = IXHEAACE_MAX_PAYLOAD_SIZE * pstr_api_struct->config[0].num_bs_elements;
  ------------------
  |  |   23|  2.32k|#define IXHEAACE_MAX_PAYLOAD_SIZE (256)
  ------------------
 1436|  2.32k|        pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.32k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1437|  2.32k|        offset_size = (MAX_FRAME_LEN * 2 + MAX_DS_2_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  101|  2.32k|#define MAX_FRAME_LEN (1024)
  ------------------
                      offset_size = (MAX_FRAME_LEN * 2 + MAX_DS_2_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |   79|  2.32k|#define MAX_DS_2_1_FILTER_DELAY (16)
  ------------------
                      offset_size = (MAX_FRAME_LEN * 2 + MAX_DS_2_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  152|  2.32k|#define INPUT_DELAY ((CORE_DELAY)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  148|  2.32k|#define CORE_DELAY (1600)
  |  |  ------------------
  ------------------
 1438|  2.32k|                      MAX_INPUT_CHAN * sizeof(pstr_mem_info->ui_size);
  ------------------
  |  |   99|  2.32k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  ------------------
  |  |  |  |   22|  2.32k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  ------------------
  ------------------
 1439|  2.32k|        pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.32k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1440|  2.32k|      }
 1441|       |
 1442|  2.32k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  2.32k|#define BYTE_ALIGN_8 (8)
  ------------------
 1443|  2.32k|      pstr_mem_info->ui_type = IA_MEMTYPE_PERSIST;
  ------------------
  |  |   28|  2.32k|#define IA_MEMTYPE_PERSIST 0x00
  ------------------
 1444|  2.32k|      pstr_mem_info->ui_placement[0] = 0;
 1445|  2.32k|      pstr_mem_info->ui_placement[1] = 0;
 1446|  2.32k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.32k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1447|  2.32k|      pstr_mem_info->ui_placed[0] = 0;
 1448|  2.32k|      pstr_mem_info->ui_placed[1] = 0;
 1449|  2.32k|    }
 1450|       |
 1451|       |    /* scratch */
 1452|  2.32k|    {
 1453|  2.32k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  2.32k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 1454|  2.32k|      {
 1455|  2.32k|        pstr_mem_info->ui_size = ia_enhaacplus_enc_aac_enc_scr_size();
 1456|  2.32k|        UWORD32 sbr_scr_size = ixheaace_sbr_enc_scr_size() + ixheaace_resampler_scr_size();
 1457|  2.32k|        UWORD32 mps_scr_size = 0;
 1458|  2.32k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1458:13): [True: 573, False: 1.74k]
  ------------------
 1459|    573|          if (pstr_api_struct->config[0].mps_tree_config != TREE_212) {
  ------------------
  |  |   39|    573|#define TREE_212 (0)
  ------------------
  |  Branch (1459:15): [True: 414, False: 159]
  ------------------
 1460|    414|            mps_scr_size = ixheaace_mps_515_scratch_size();
 1461|    414|          }
 1462|    573|        }
 1463|  2.32k|        pstr_mem_info->ui_size += MAX(sbr_scr_size, mps_scr_size);
  ------------------
  |  |   31|  2.32k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (31:20): [True: 1.90k, False: 414]
  |  |  ------------------
  ------------------
 1464|  2.32k|      }
 1465|  2.32k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  2.32k|#define BYTE_ALIGN_8 (8)
  ------------------
 1466|  2.32k|      pstr_mem_info->ui_type = IA_MEMTYPE_SCRATCH;
  ------------------
  |  |   30|  2.32k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1467|  2.32k|      pstr_mem_info->ui_placement[0] = 0;
 1468|  2.32k|      pstr_mem_info->ui_placement[1] = 0;
 1469|  2.32k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.32k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1470|  2.32k|      pstr_mem_info->ui_placed[0] = 0;
 1471|  2.32k|      pstr_mem_info->ui_placed[1] = 0;
 1472|  2.32k|    }
 1473|       |
 1474|       |    /* input */
 1475|  2.32k|    {
 1476|  2.32k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_INPUT_IDX];
  ------------------
  |  |   31|  2.32k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
 1477|       |
 1478|  2.32k|      WORD32 pcm_wd_sz;
 1479|  2.32k|      pcm_wd_sz = pstr_api_struct->config[0].ui_pcm_wd_sz;
 1480|  2.32k|      num_channel = 0;
 1481|  7.09k|      for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1481:25): [True: 4.77k, False: 2.32k]
  ------------------
 1482|  4.77k|        num_channel += pstr_api_struct->config[ele_idx].i_channels;
 1483|  4.77k|      }
 1484|  2.32k|      {
 1485|  2.32k|        if (pstr_api_struct->config[0].aac_classic) {
  ------------------
  |  Branch (1485:13): [True: 635, False: 1.68k]
  ------------------
 1486|    635|          pstr_mem_info->ui_size = (frame_length * (pcm_wd_sz >> 3)) * num_channel;
 1487|  1.68k|        } else {
 1488|  1.68k|          pstr_mem_info->ui_size = (frame_length * (pcm_wd_sz >> 3)) * 2 * num_channel;
 1489|  1.68k|        }
 1490|  2.32k|      }
 1491|  2.32k|      pstr_mem_info->ui_alignment =
 1492|  2.32k|          BYTE_ALIGN_8; /* As input is used as scratch memory internally */
  ------------------
  |  |   30|  2.32k|#define BYTE_ALIGN_8 (8)
  ------------------
 1493|  2.32k|      pstr_mem_info->ui_type = IA_MEMTYPE_INPUT;
  ------------------
  |  |   24|  2.32k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
 1494|  2.32k|      pstr_mem_info->ui_placement[0] = 0;
 1495|  2.32k|      pstr_mem_info->ui_placement[1] = 0;
 1496|  2.32k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.32k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1497|  2.32k|      pstr_mem_info->ui_placed[0] = 0;
 1498|  2.32k|      pstr_mem_info->ui_placed[1] = 0;
 1499|  2.32k|    }
 1500|       |
 1501|       |    /* output */
 1502|  2.32k|    {
 1503|  2.32k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_OUTPUT_IDX];
  ------------------
  |  |   32|  2.32k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 1504|  2.32k|      if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  4.64k|#define AOT_AAC_LC (2)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|  4.23k|#define AOT_SBR (5)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  1.30k|#define AOT_PS (29)
  ------------------
  |  Branch (1504:11): [True: 405, False: 1.91k]
  |  Branch (1504:32): [True: 609, False: 1.30k]
  |  Branch (1504:50): [True: 246, False: 1.06k]
  ------------------
 1505|  1.26k|        pstr_mem_info->ui_size = (6 * frame_length / 8) * num_channel;
 1506|  1.26k|        pstr_mem_info->ui_size += (7) * IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_BS_ELE;
  ------------------
  |  |   22|  1.26k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                      pstr_mem_info->ui_size += (7) * IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_BS_ELE;
  ------------------
  |  |   89|  1.26k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
 1507|  1.26k|      } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  2.12k|#define AOT_AAC_LD (23)
  ------------------
                    } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|    831|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1507:18): [True: 230, False: 831]
  |  Branch (1507:39): [True: 831, False: 0]
  ------------------
 1508|  1.06k|        pstr_mem_info->ui_size = (6 * frame_length / 8) * num_channel;
 1509|  1.06k|      }
 1510|  2.32k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  2.32k|#define BYTE_ALIGN_8 (8)
  ------------------
 1511|  2.32k|      pstr_mem_info->ui_type = IA_MEMTYPE_OUTPUT;
  ------------------
  |  |   26|  2.32k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1512|  2.32k|      pstr_mem_info->ui_placement[0] = 0;
 1513|  2.32k|      pstr_mem_info->ui_placement[1] = 0;
 1514|  2.32k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.32k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1515|  2.32k|      pstr_mem_info->ui_placed[0] = 0;
 1516|  2.32k|      pstr_mem_info->ui_placed[1] = 0;
 1517|  2.32k|    }
 1518|  2.32k|  }
 1519|       |
 1520|  6.52k|  return;
 1521|  6.52k|}
ixheaace_api.c:iusace_calc_pers_buf_sizes:
  148|  4.20k|static WORD32 iusace_calc_pers_buf_sizes(ixheaace_api_struct *pstr_api_struct) {
  149|  4.20k|  WORD32 pers_size = 0;
  150|  4.20k|  ia_usac_encoder_config_struct *pstr_config = &pstr_api_struct->config[0].usac_config;
  151|       |
  152|  4.20k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  153|  4.20k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  154|  4.20k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  155|  4.20k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  156|       |
  157|  4.20k|  pers_size +=
  158|  4.20k|      (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->ccfl * sizeof(FLOAT32)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  159|  4.20k|       pstr_config->channels);
  160|  4.20k|  pers_size += (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->drc_frame_size * sizeof(FLOAT32)),
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  161|  4.20k|                                         BYTE_ALIGN_8) *
  162|  4.20k|                pstr_config->channels);
  163|  4.20k|  if (pstr_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (163:7): [True: 4.04k, False: 158]
  ------------------
  164|  4.04k|    pers_size +=
  165|  4.04k|        (IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  4.04k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  166|  4.04k|             ((CC_DELAY_ADJUSTMENT * pstr_config->ccfl) / FRAME_LEN_1024) * sizeof(FLOAT32),
  167|  4.04k|             BYTE_ALIGN_8) *
  168|  4.04k|         pstr_config->channels);
  169|  4.04k|    pers_size += (IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  4.04k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  170|  4.04k|                      ((CC_DELAY_ADJUSTMENT * pstr_config->drc_frame_size) / FRAME_LEN_1024) *
  171|  4.04k|                          sizeof(FLOAT32),
  172|  4.04k|                      BYTE_ALIGN_8) *
  173|  4.04k|                  pstr_config->channels);
  174|  4.04k|  }
  175|       |
  176|  4.20k|  pers_size +=
  177|  4.20k|      (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  178|  4.20k|       pstr_config->channels);
  179|       |
  180|  4.20k|  pers_size += (IXHEAAC_GET_SIZE_ALIGNED((pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  181|  4.20k|                pstr_config->channels);
  182|       |
  183|  4.20k|  pers_size +=
  184|  4.20k|      (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  185|  4.20k|       pstr_config->channels);
  186|       |
  187|  4.20k|  pers_size +=
  188|  4.20k|      (IXHEAAC_GET_SIZE_ALIGNED((3 * pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  189|  4.20k|       pstr_config->channels);
  190|       |
  191|  4.20k|  if (pstr_config->tns_select != 0) {
  ------------------
  |  Branch (191:7): [True: 1.95k, False: 2.24k]
  ------------------
  192|  1.95k|    pers_size +=
  193|  1.95k|        (IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_tns_info), BYTE_ALIGN_8) * pstr_config->channels);
  ------------------
  |  |   87|  1.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  194|  1.95k|  }
  195|       |
  196|  4.20k|  pers_size += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_usac_td_encoder_struct), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  197|  4.20k|                pstr_config->channels);
  198|  4.20k|  return pers_size;
  199|  4.20k|}
ixheaace_api.c:ia_enhaacplus_enc_sizeof_delay_buffer:
  203|  13.0k|                                                    FLAG mps_enable) {
  204|  13.0k|  WORD32 downsample_fac;
  205|  13.0k|  if (resamp_idx > 1) {
  ------------------
  |  Branch (205:7): [True: 10.5k, False: 2.47k]
  ------------------
  206|  10.5k|    downsample_fac = resamp_idx / 2;
  207|  10.5k|  } else {
  208|  2.47k|    downsample_fac = 1;
  209|  2.47k|  }
  210|       |  // Set the downsampler delay
  211|  13.0k|  WORD32 max_downsamp_delay, max_upsamp_delay;
  212|  13.0k|  if (resamp_idx == 2)  // 8:3
  ------------------
  |  Branch (212:7): [True: 732, False: 12.3k]
  ------------------
  213|    732|  {
  214|    732|    max_downsamp_delay = MAXIMUM_DS_8_1_FILTER_DELAY;
  ------------------
  |  |  161|    732|#define MAXIMUM_DS_8_1_FILTER_DELAY (248)
  ------------------
  215|    732|    max_upsamp_delay = MAXIMUM_DS_1_3_FILTER_DELAY;
  ------------------
  |  |  164|    732|#define MAXIMUM_DS_1_3_FILTER_DELAY (36)
  ------------------
  216|  12.3k|  } else if (resamp_idx == 3)  // 2:1
  ------------------
  |  Branch (216:14): [True: 8.69k, False: 3.63k]
  ------------------
  217|  8.69k|  {
  218|  8.69k|    max_downsamp_delay = MAXIMUM_DS_2_1_FILTER_DELAY;
  ------------------
  |  |  155|  8.69k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
  219|  8.69k|    max_upsamp_delay = 0;
  220|  8.69k|  } else if (resamp_idx == 4)  // 4:1
  ------------------
  |  Branch (220:14): [True: 1.15k, False: 2.47k]
  ------------------
  221|  1.15k|  {
  222|  1.15k|    max_downsamp_delay = MAXIMUM_DS_4_1_FILTER_DELAY;
  ------------------
  |  |  158|  1.15k|#define MAXIMUM_DS_4_1_FILTER_DELAY (64)
  ------------------
  223|  1.15k|    max_upsamp_delay = 0;
  224|  2.47k|  } else {
  225|  2.47k|    max_downsamp_delay = MAXIMUM_DS_2_1_FILTER_DELAY;
  ------------------
  |  |  155|  2.47k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
  226|  2.47k|    max_upsamp_delay = 0;
  227|  2.47k|  }
  228|       |
  229|  13.0k|  if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|  26.1k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  11.7k|#define AOT_PS (29)
  ------------------
  |  Branch (229:7): [True: 1.32k, False: 11.7k]
  |  Branch (229:25): [True: 502, False: 11.2k]
  ------------------
  230|  1.82k|    if (flag_framelength_small)
  ------------------
  |  Branch (230:9): [True: 601, False: 1.22k]
  ------------------
  231|    601|      return (FRAME_LEN_960 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   94|    601|#define FRAME_LEN_960 960
  ------------------
  232|    601|              INPUT_DELAY_LC) *
  ------------------
  |  |  132|    601|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|    601|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  233|    601|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    601|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  234|  1.22k|    else
  235|  1.22k|      return (FRAME_LEN_1024 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   91|  1.22k|#define FRAME_LEN_1024 1024
  ------------------
  236|  1.22k|              INPUT_DELAY_LC) *
  ------------------
  |  |  132|  1.22k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|  1.22k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  237|  1.22k|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|  1.22k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  238|  11.2k|  } else if (aot == AOT_AAC_LC) {
  ------------------
  |  |   34|  11.2k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (238:14): [True: 691, False: 10.5k]
  ------------------
  239|    691|    if (flag_framelength_small)
  ------------------
  |  Branch (239:9): [True: 311, False: 380]
  ------------------
  240|    311|      return (FRAME_LEN_960 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |   94|    311|#define FRAME_LEN_960 960
  ------------------
                    return (FRAME_LEN_960 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|    311|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_960 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|    311|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|    311|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  241|    311|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    311|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  242|    380|    else
  243|    380|      return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |   91|    380|#define FRAME_LEN_1024 1024
  ------------------
                    return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|    380|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|    380|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|    380|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  244|    380|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    380|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  245|  10.5k|  } else if (aot == AOT_USAC) {
  ------------------
  |  |  142|  10.5k|#define AOT_USAC (42)
  ------------------
  |  Branch (245:14): [True: 8.41k, False: 2.12k]
  ------------------
  246|  8.41k|    return (FRAME_LEN_1024 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   91|  8.41k|#define FRAME_LEN_1024 1024
  ------------------
  247|  8.41k|            INPUT_DELAY_LC) *
  ------------------
  |  |  132|  8.41k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|  8.41k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  248|  8.41k|           IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|  8.41k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  249|  8.41k|  } else if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|  2.12k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (249:14): [True: 386, False: 1.73k]
  ------------------
  250|    386|    if (flag_framelength_small)
  ------------------
  |  Branch (250:9): [True: 163, False: 223]
  ------------------
  251|    163|      return (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |   93|    163|#define FRAME_LEN_480 480
  ------------------
                    return (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |  155|    163|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |  142|    163|#define INPUT_DELAY_LD_480 ((CORE_DELAY_LD_480)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  141|    163|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
  252|    163|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    163|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  253|    223|    else
  254|    223|      return (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |   92|    223|#define FRAME_LEN_512 512
  ------------------
                    return (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |  155|    223|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |  134|    223|#define INPUT_DELAY_LD_512 ((CORE_DELAY_LD_512)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  133|    223|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
  255|    223|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    223|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  256|  1.73k|  } else if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.73k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (256:14): [True: 1.73k, False: 0]
  ------------------
  257|  1.73k|    if (flag_framelength_small) {
  ------------------
  |  Branch (257:9): [True: 825, False: 911]
  ------------------
  258|    825|      if (mps_enable) {
  ------------------
  |  Branch (258:11): [True: 568, False: 257]
  ------------------
  259|    568|        return (FRAME_LEN_480 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   93|    568|#define FRAME_LEN_480 480
  ------------------
  260|    568|                INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |  147|    568|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|    568|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
  261|    568|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    568|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  262|    568|      } else {
  263|    257|        return (FRAME_LEN_480 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   93|    257|#define FRAME_LEN_480 480
  ------------------
  264|    257|                INPUT_DELAY_ELD_480) *
  ------------------
  |  |  144|    257|#define INPUT_DELAY_ELD_480 ((CORE_DELAY_LD_480 / 2) * 2 + 0 - (15 * 64) + 576)
  |  |  ------------------
  |  |  |  |  141|    257|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
  265|    257|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    257|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  266|    257|      }
  267|    911|    } else {
  268|    911|      if (mps_enable) {
  ------------------
  |  Branch (268:11): [True: 562, False: 349]
  ------------------
  269|    562|        return (FRAME_LEN_512 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   92|    562|#define FRAME_LEN_512 512
  ------------------
  270|    562|                INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |  139|    562|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    562|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
  271|    562|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    562|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  272|    562|      } else {
  273|    349|        return (FRAME_LEN_512 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   92|    349|#define FRAME_LEN_512 512
  ------------------
  274|    349|                INPUT_DELAY_ELD_512) *
  ------------------
  |  |  136|    349|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|    349|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
  275|    349|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    349|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  276|    349|      }
  277|    911|    }
  278|  1.73k|  } else {
  279|       |    // return LC Delay buffer size by default
  280|      0|    return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |   91|      0|#define FRAME_LEN_1024 1024
  ------------------
                  return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|      0|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                  return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|      0|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|      0|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  281|      0|           IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|      0|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  282|      0|  }
  283|  13.0k|}
ixheaace_api.c:iusace_scratch_size:
  142|  4.20k|static WORD32 iusace_scratch_size(VOID) {
  143|  4.20k|  WORD32 scr_size;
  144|  4.20k|  scr_size = IXHEAAC_GET_SIZE_ALIGNED(USACE_MAX_SCR_SIZE, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  145|  4.20k|  return scr_size;
  146|  4.20k|}
ixheaace_api.c:ixheaace_alloc_and_assign_mem:
 1557|  6.52k|                                                  ixheaace_input_config *ptr_in_cfg) {
 1558|  6.52k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  6.52k|#define IA_NO_ERROR 0x00000000
  ------------------
 1559|  6.52k|  UWORD32 i_idx;
 1560|  6.52k|  pVOID pv_value;
 1561|  32.6k|  for (i_idx = 0; i_idx < 4; i_idx++) {
  ------------------
  |  Branch (1561:19): [True: 26.1k, False: 6.52k]
  ------------------
 1562|  26.1k|    if (i_idx == IA_ENHAACPLUSENC_OUTPUT_IDX &&
  ------------------
  |  |   32|  52.2k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
  |  Branch (1562:9): [True: 6.52k, False: 19.5k]
  ------------------
 1563|  6.52k|        pstr_api_struct->config[0].usac_config.use_drc_element) {
  ------------------
  |  Branch (1563:9): [True: 1.47k, False: 5.05k]
  ------------------
 1564|  1.47k|      WORD32 drc_config_size_expected =
 1565|  1.47k|          get_drc_config_size(pstr_api_struct, ptr_in_cfg);
 1566|  1.47k|      if (drc_config_size_expected > MAX_DRC_CONFIG_SIZE_EXPECTED) {
  ------------------
  |  |   83|  1.47k|#define MAX_DRC_CONFIG_SIZE_EXPECTED (14336) /* 14 KB*/
  ------------------
  |  Branch (1566:11): [True: 0, False: 1.47k]
  ------------------
 1567|      0|        return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
 1568|      0|      }
 1569|  1.47k|      pstr_api_struct->pstr_mem_info[i_idx].ui_size += drc_config_size_expected;
 1570|  1.47k|    }
 1571|  26.1k|    ptr_out_cfg->mem_info_table[i_idx].ui_size = pstr_api_struct->pstr_mem_info[i_idx].ui_size;
 1572|  26.1k|    ptr_out_cfg->mem_info_table[i_idx].ui_alignment =
 1573|  26.1k|        pstr_api_struct->pstr_mem_info[i_idx].ui_alignment;
 1574|  26.1k|    ptr_out_cfg->mem_info_table[i_idx].ui_type = pstr_api_struct->pstr_mem_info[i_idx].ui_type;
 1575|       |
 1576|  26.1k|    ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count] =
 1577|  26.1k|        ptr_out_cfg->malloc_xheaace(ptr_out_cfg->mem_info_table[i_idx].ui_size +
 1578|  26.1k|                                        ptr_out_cfg->mem_info_table[i_idx].ui_alignment,
 1579|  26.1k|                                    ptr_out_cfg->mem_info_table[i_idx].ui_alignment);
 1580|       |
 1581|  26.1k|    if (NULL == ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count]) {
  ------------------
  |  Branch (1581:9): [True: 0, False: 26.1k]
  ------------------
 1582|      0|      return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 1583|      0|    }
 1584|  26.1k|    memset(ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count], 0,
 1585|  26.1k|           ptr_out_cfg->mem_info_table[i_idx].ui_size);
 1586|  26.1k|    if ((i_idx == IA_ENHAACPLUSENC_PERSIST_IDX) || (i_idx == IA_ENHAACPLUSENC_SCRATCH_IDX)) {
  ------------------
  |  |   29|  26.1k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
                  if ((i_idx == IA_ENHAACPLUSENC_PERSIST_IDX) || (i_idx == IA_ENHAACPLUSENC_SCRATCH_IDX)) {
  ------------------
  |  |   30|  19.5k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
  |  Branch (1586:9): [True: 6.52k, False: 19.5k]
  |  Branch (1586:52): [True: 6.52k, False: 13.0k]
  ------------------
 1587|  13.0k|      ptr_out_cfg->ui_rem =
 1588|  13.0k|          (SIZE_T)((SIZE_T)ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count] %
 1589|  13.0k|                   ptr_out_cfg->mem_info_table[i_idx].ui_alignment);
 1590|       |
 1591|  13.0k|      pv_value = ptr_out_cfg->mem_info_table[i_idx].mem_ptr =
 1592|  13.0k|          (pVOID)((WORD8 *)ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count] +
 1593|  13.0k|                  ptr_out_cfg->mem_info_table[i_idx].ui_alignment - ptr_out_cfg->ui_rem);
 1594|  13.0k|    } else {
 1595|  13.0k|      pv_value = ptr_out_cfg->mem_info_table[i_idx].mem_ptr =
 1596|  13.0k|          ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count];
 1597|  13.0k|    }
 1598|       |
 1599|  26.1k|    pstr_api_struct->pp_mem[i_idx] = ptr_out_cfg->mem_info_table[i_idx].mem_ptr;
 1600|  26.1k|    memset(pstr_api_struct->pp_mem[i_idx], 0, pstr_api_struct->pstr_mem_info[i_idx].ui_size);
 1601|       |
 1602|  26.1k|    pstr_api_struct->pp_mem[i_idx] = pv_value;
 1603|       |
 1604|  26.1k|    if (i_idx == IA_ENHAACPLUSENC_PERSIST_IDX) {
  ------------------
  |  |   29|  26.1k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
  |  Branch (1604:9): [True: 6.52k, False: 19.5k]
  ------------------
 1605|  6.52k|      WORD32 offset_size = IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.52k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1606|  6.52k|      WORD8 *p_offset = NULL;
 1607|       |
 1608|       |      /* Set persistent memory pointer in api obj */
 1609|  6.52k|      pstr_api_struct->pstr_state = (ixheaace_state_struct *)pv_value;
 1610|  6.52k|      WORD32 i, inp_delay_size;
 1611|  6.52k|      WORD8 *p_temp;
 1612|  6.52k|      if (pstr_api_struct->usac_en) {
  ------------------
  |  Branch (1612:11): [True: 4.20k, False: 2.32k]
  ------------------
 1613|  4.20k|        memset(pstr_api_struct->pstr_state, 0, sizeof(*(pstr_api_struct->pstr_state)));
 1614|  4.20k|        ia_usac_encoder_config_struct *pstr_usac_config = &pstr_api_struct->config[0].usac_config;
 1615|  4.20k|        ixheaace_state_struct *pstr_state = pstr_api_struct->pstr_state;
 1616|  4.20k|        ia_usac_data_struct *pstr_usac_enc_data = &(pstr_state->str_usac_enc_data);
 1617|       |
 1618|  4.20k|        pstr_state->ptr_in_buf = (FLOAT32 **)((WORD8 *)pstr_state + offset_size);
 1619|       |
 1620|  4.20k|        offset_size = pstr_usac_config->channels * sizeof(FLOAT32 *);
 1621|  4.20k|        p_offset = (WORD8 *)pstr_state->ptr_in_buf +
 1622|  4.20k|                   IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1623|       |
 1624|       |        // Input delay
 1625|  4.20k|        pstr_state->inp_delay = (FLOAT32 *)(p_offset);
 1626|  4.20k|        inp_delay_size =
 1627|  4.20k|            2 *
 1628|  4.20k|            ia_enhaacplus_enc_sizeof_delay_buffer(
 1629|  4.20k|                0, AOT_USAC, pstr_api_struct->config[0].ccfl_idx,
  ------------------
  |  |  142|  4.20k|#define AOT_USAC (42)
  ------------------
 1630|  4.20k|                sizeof(pstr_state->inp_delay[0]), pstr_api_struct->config[0].use_mps) *
 1631|  4.20k|            pstr_api_struct->config[0].num_bs_elements;
 1632|  4.20k|        memset(pstr_state->inp_delay, 0, inp_delay_size);
 1633|  4.20k|        p_offset += IXHEAAC_GET_SIZE_ALIGNED(inp_delay_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.20k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1634|  4.20k|        if (1 == pstr_usac_config->sbr_enable) {
  ------------------
  |  Branch (1634:13): [True: 2.96k, False: 1.23k]
  ------------------
 1635|  2.96k|          if (2 != pstr_usac_config->channels) {
  ------------------
  |  Branch (1635:15): [True: 763, False: 2.20k]
  ------------------
 1636|    763|            pstr_api_struct->pstr_state->time_signal = (FLOAT32 *)(p_offset);
 1637|       |
 1638|    763|            memset(pstr_api_struct->pstr_state->time_signal, 0,
 1639|    763|                   (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal[0]));
  ------------------
  |  |  111|    763|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    763|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    763|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    763|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|    763|            offset_size =
 1641|    763|                (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal[0]);
  ------------------
  |  |  111|    763|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    763|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    763|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    763|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1642|    763|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    763|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1643|    763|          }
 1644|       |
 1645|  2.96k|          pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[0] =
 1646|  2.96k|              (struct ixheaace_str_sbr_enc *)p_offset;
 1647|  2.96k|          p_offset = p_offset + ixheaace_sbr_enc_pers_size(pstr_usac_config->channels, 0,
 1648|  2.96k|                                                           pstr_usac_config->sbr_harmonic);
 1649|  2.96k|        }
 1650|  4.20k|        if (1 == pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1650:13): [True: 1.22k, False: 2.98k]
  ------------------
 1651|  1.22k|          pstr_api_struct->pstr_state->time_signal_mps = (FLOAT32 *)(p_offset);
 1652|       |
 1653|  1.22k|          memset(pstr_api_struct->pstr_state->time_signal_mps, 0,
 1654|  1.22k|                 (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]));
  ------------------
  |  |  111|  1.22k|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|  1.22k|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|  1.22k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.22k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1655|  1.22k|          offset_size =
 1656|  1.22k|              (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
  ------------------
  |  |  111|  1.22k|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|  1.22k|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|  1.22k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.22k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1657|  1.22k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.22k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1658|  1.22k|          pstr_api_struct->pstr_state->mps_bs = (UWORD8 *)(p_offset);
 1659|       |
 1660|  1.22k|          memset(pstr_api_struct->pstr_state->mps_bs, 0,
 1661|  1.22k|                 (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]));
  ------------------
  |  |   64|  1.22k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1662|       |
 1663|  1.22k|          offset_size =
 1664|  1.22k|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]);
  ------------------
  |  |   64|  1.22k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1665|  1.22k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.22k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1666|       |
 1667|  1.22k|          pstr_api_struct->pstr_state->mps_pers_mem = (ixheaace_mps_212_memory_struct *)p_offset;
 1668|  1.22k|          p_offset +=
 1669|  1.22k|              IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.22k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1670|  2.98k|        } else {
 1671|  2.98k|          pstr_api_struct->pstr_state->mps_bs = NULL;
 1672|  2.98k|        }
 1673|  4.20k|        if (1 == pstr_usac_config->use_drc_element) {
  ------------------
  |  Branch (1673:13): [True: 1.47k, False: 2.73k]
  ------------------
 1674|  1.47k|          pstr_state->pp_drc_in_buf = (FLOAT32 **)((WORD8 *)p_offset);
 1675|  1.47k|          offset_size = pstr_usac_config->channels * sizeof(pstr_state->pp_drc_in_buf[0]);
 1676|  1.47k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.47k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1677|  1.47k|          p_temp = p_offset;
 1678|       |
 1679|  3.97k|          for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1679:23): [True: 2.50k, False: 1.47k]
  ------------------
 1680|  2.50k|            pstr_state->pp_drc_in_buf[i] = (FLOAT32 *)(p_offset);
 1681|  2.50k|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  2.50k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1682|  2.50k|                (pstr_usac_config->drc_frame_size * sizeof(pstr_state->pp_drc_in_buf[0][0]) * 2),
 1683|  2.50k|                BYTE_ALIGN_8);
 1684|  2.50k|            if (pstr_usac_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (1684:17): [True: 2.43k, False: 69]
  ------------------
 1685|  2.43k|              p_offset += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  2.43k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1686|  2.43k|                  ((CC_DELAY_ADJUSTMENT * pstr_usac_config->drc_frame_size) / FRAME_LEN_1024) *
 1687|  2.43k|                      sizeof(pstr_state->pp_drc_in_buf[0][0]),
 1688|  2.43k|                  BYTE_ALIGN_8);
 1689|  2.43k|            }
 1690|  2.50k|          }
 1691|  1.47k|          memset(p_temp, 0, (p_offset - p_temp));
 1692|  1.47k|        }
 1693|  4.20k|        p_temp = p_offset;
 1694|       |
 1695|  11.3k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1695:21): [True: 7.11k, False: 4.20k]
  ------------------
 1696|  7.11k|          pstr_state->ptr_in_buf[i] = (FLOAT32 *)(p_offset);
 1697|  7.11k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((pstr_usac_config->ccfl * sizeof(FLOAT32) * 2),
  ------------------
  |  |   87|  7.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1698|  7.11k|                                               BYTE_ALIGN_8);
 1699|  7.11k|          if (pstr_usac_config->use_delay_adjustment) {
  ------------------
  |  Branch (1699:15): [True: 6.87k, False: 238]
  ------------------
 1700|  6.87k|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  6.87k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1701|  6.87k|                ((CC_DELAY_ADJUSTMENT * pstr_usac_config->ccfl) / FRAME_LEN_1024) *
 1702|  6.87k|                    sizeof(FLOAT32),
 1703|  6.87k|                BYTE_ALIGN_8);
 1704|  6.87k|          }
 1705|  7.11k|        }
 1706|  4.20k|        memset(p_temp, 0, (p_offset - p_temp));
 1707|       |
 1708|  4.20k|        p_temp = p_offset;
 1709|  11.3k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1709:21): [True: 7.11k, False: 4.20k]
  ------------------
 1710|  7.11k|          pstr_usac_enc_data->ptr_time_data[i] = (FLOAT64 *)(p_offset);
 1711|  7.11k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((2 * (pstr_usac_config->ccfl) * sizeof(FLOAT64)),
  ------------------
  |  |   87|  7.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1712|  7.11k|                                                BYTE_ALIGN_8);
 1713|  7.11k|        }
 1714|       |
 1715|  11.3k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1715:21): [True: 7.11k, False: 4.20k]
  ------------------
 1716|  7.11k|          pstr_usac_enc_data->ptr_look_ahead_time_data[i] = (FLOAT64 *)(p_offset);
 1717|  7.11k|          p_offset +=
 1718|  7.11k|              IXHEAAC_GET_SIZE_ALIGNED((pstr_usac_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8);
  ------------------
  |  |   87|  7.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1719|  7.11k|        }
 1720|       |
 1721|  11.3k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1721:21): [True: 7.11k, False: 4.20k]
  ------------------
 1722|  7.11k|          pstr_usac_enc_data->spectral_line_vector[i] = (FLOAT64 *)(p_offset);
 1723|  7.11k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_usac_config->ccfl * sizeof(FLOAT64)),
  ------------------
  |  |   87|  7.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1724|  7.11k|                                                BYTE_ALIGN_8);
 1725|  7.11k|        }
 1726|       |
 1727|  11.3k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1727:21): [True: 7.11k, False: 4.20k]
  ------------------
 1728|  7.11k|          pstr_usac_enc_data->ptr_2frame_time_data[i] = (FLOAT64 *)(p_offset);
 1729|  7.11k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((3 * pstr_usac_config->ccfl * sizeof(FLOAT64)),
  ------------------
  |  |   87|  7.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1730|  7.11k|                                                BYTE_ALIGN_8);
 1731|  7.11k|        }
 1732|  4.20k|        memset(p_temp, 0, p_offset - p_temp);
 1733|       |
 1734|  4.20k|        if (pstr_usac_config->tns_select != 0) {
  ------------------
  |  Branch (1734:13): [True: 1.95k, False: 2.24k]
  ------------------
 1735|  1.95k|          p_temp = p_offset;
 1736|  5.34k|          for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1736:23): [True: 3.38k, False: 1.95k]
  ------------------
 1737|  3.38k|            pstr_usac_enc_data->pstr_tns_info[i] = (ia_tns_info *)(p_offset);
 1738|  3.38k|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_tns_info), BYTE_ALIGN_8);
  ------------------
  |  |   87|  3.38k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1739|  3.38k|          }
 1740|  1.95k|          memset(p_temp, 0, p_offset - p_temp);
 1741|  1.95k|        }
 1742|       |
 1743|  4.20k|        p_temp = p_offset;
 1744|  11.3k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1744:21): [True: 7.11k, False: 4.20k]
  ------------------
 1745|  7.11k|          pstr_usac_enc_data->td_encoder[i] = (ia_usac_td_encoder_struct *)(p_offset);
 1746|  7.11k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_usac_td_encoder_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  7.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1747|  7.11k|        }
 1748|  4.20k|        memset(p_temp, 0, p_offset - p_temp);
 1749|  4.20k|      } else {
 1750|  2.32k|        WORD32 num_aac_chan;
 1751|  2.32k|        ixheaace_state_struct *pstr_state = pstr_api_struct->pstr_state;
 1752|  2.32k|        memset(pstr_api_struct->pstr_state, 0, sizeof(*(pstr_api_struct->pstr_state)));
 1753|       |
 1754|  2.32k|        pstr_api_struct->pstr_state->inp_delay = (FLOAT32 *)((WORD8 *)pstr_state + offset_size);
 1755|  2.32k|        offset_size = ia_enhaacplus_enc_sizeof_delay_buffer(
 1756|  2.32k|                          pstr_api_struct->config[0].aac_config.flag_framelength_small,
 1757|  2.32k|                          pstr_api_struct->config[0].aot, 3,
 1758|  2.32k|                          sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1759|  2.32k|                          pstr_api_struct->config[0].use_mps) *
 1760|  2.32k|                      pstr_api_struct->config[0].num_bs_elements;
 1761|  2.32k|        p_offset = (WORD8 *)pstr_api_struct->pstr_state->inp_delay +
 1762|  2.32k|                   IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.32k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1763|       |
 1764|  2.32k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1764:13): [True: 573, False: 1.74k]
  ------------------
 1765|    573|          pstr_api_struct->pstr_state->time_signal_mps = (FLOAT32 *)(p_offset);
 1766|       |
 1767|    573|          memset(pstr_api_struct->pstr_state->time_signal_mps, 0,
 1768|    573|                 (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    573|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    573|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    573|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    573|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                               (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  139|    573|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    573|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                               (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    573|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1769|    573|                     sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]));
 1770|    573|          offset_size =
 1771|    573|              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    573|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    573|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    573|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    573|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                            (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  139|    573|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    573|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                            (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    573|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1772|    573|              sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
 1773|    573|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    573|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1774|       |
 1775|    573|          pstr_api_struct->pstr_state->mps_bs = (UWORD8 *)(p_offset);
 1776|    573|          memset(pstr_api_struct->pstr_state->mps_bs, 0,
 1777|    573|                 (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]));
  ------------------
  |  |   64|    573|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1778|    573|          offset_size =
 1779|    573|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]);
  ------------------
  |  |   64|    573|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1780|    573|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    573|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1781|       |
 1782|    573|          if (pstr_api_struct->config[0].mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    573|#define TREE_212 (0)
  ------------------
  |  Branch (1782:15): [True: 159, False: 414]
  ------------------
 1783|    159|            pstr_api_struct->pstr_state->mps_pers_mem =
 1784|    159|                (ixheaace_mps_212_memory_struct *)p_offset;
 1785|    159|            p_offset +=
 1786|    159|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    159|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1787|    414|          } else {
 1788|    414|            pstr_api_struct->pstr_state->mps_515_pers_mem =
 1789|    414|                (ixheaace_mps_515_memory_struct *)p_offset;
 1790|    414|            p_offset +=
 1791|    414|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_515_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    414|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1792|    414|          }
 1793|  1.74k|        } else {
 1794|  1.74k|          pstr_api_struct->pstr_state->mps_bs = NULL;
 1795|  1.74k|        }
 1796|       |
 1797|  7.09k|        for (WORD32 ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements;
  ------------------
  |  Branch (1797:34): [True: 4.77k, False: 2.32k]
  ------------------
 1798|  4.77k|             ele_idx++) {
 1799|  4.77k|          num_aac_chan = pstr_api_struct->config[ele_idx].aac_classic
  ------------------
  |  Branch (1799:26): [True: 1.52k, False: 3.24k]
  ------------------
 1800|  4.77k|                             ? pstr_api_struct->config[ele_idx].chmode_nchannels
 1801|  4.77k|                             : (pstr_api_struct->config[ele_idx].use_parametric_stereo
  ------------------
  |  Branch (1801:33): [True: 246, False: 2.99k]
  ------------------
 1802|  3.24k|                                    ? 1
 1803|  3.24k|                                    : pstr_api_struct->config[ele_idx].chmode_nchannels);
 1804|       |
 1805|       |          /* Set aac enc persistent memory pointer in api obj */
 1806|  4.77k|          pstr_api_struct->pstr_state->aac_enc_pers_mem[ele_idx] =
 1807|  4.77k|              (iexheaac_encoder_str *)p_offset;
 1808|  4.77k|          p_offset = p_offset + ia_enhaacplus_enc_aac_enc_pers_size(
 1809|  4.77k|                                    num_aac_chan, pstr_api_struct->config[ele_idx].aot);
 1810|       |
 1811|  4.77k|          if (pstr_api_struct->config[ele_idx].aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  9.54k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (1811:15): [True: 3.89k, False: 881]
  ------------------
 1812|  3.89k|              pstr_api_struct->config[ele_idx].aot != AOT_AAC_LD) {
  ------------------
  |  |   36|  3.89k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (1812:15): [True: 3.43k, False: 455]
  ------------------
 1813|  3.43k|            if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (1813:17): [True: 3.17k, False: 257]
  ------------------
 1814|       |              /* Set spectral_band_replication_ enc persistent memory pointer in api obj */
 1815|  3.17k|              pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[ele_idx] =
 1816|  3.17k|                  (struct ixheaace_str_sbr_enc *)p_offset;
 1817|       |
 1818|  3.17k|              p_offset =
 1819|  3.17k|                  p_offset +
 1820|  3.17k|                  ixheaace_sbr_enc_pers_size(
 1821|  3.17k|                      num_aac_chan, pstr_api_struct->config[ele_idx].use_parametric_stereo, 0);
 1822|  3.17k|            }
 1823|  3.43k|          }
 1824|  4.77k|        }
 1825|  2.32k|      }
 1826|  6.52k|    }
 1827|       |
 1828|  26.1k|    if ((i_idx == IA_MEMTYPE_SCRATCH) && pstr_api_struct->usac_en) {
  ------------------
  |  |   30|  26.1k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
  |  Branch (1828:9): [True: 6.52k, False: 19.5k]
  |  Branch (1828:42): [True: 4.20k, False: 2.32k]
  ------------------
 1829|  4.20k|      pstr_api_struct->pstr_state->str_usac_enc_data.str_scratch.ptr_scratch_buf =
 1830|  4.20k|          (UWORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_SCRATCH];
  ------------------
  |  |   30|  4.20k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1831|  4.20k|      memset(pstr_api_struct->pp_mem[IA_MEMTYPE_SCRATCH], 0,
  ------------------
  |  |   30|  4.20k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1832|  4.20k|             pstr_api_struct->pstr_mem_info[i_idx].ui_size);
 1833|  4.20k|    }
 1834|  26.1k|    if (i_idx == IA_ENHAACPLUSENC_INPUT_IDX) {
  ------------------
  |  |   31|  26.1k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
  |  Branch (1834:9): [True: 6.52k, False: 19.5k]
  ------------------
 1835|  6.52k|      ptr_out_cfg->ui_inp_buf_size = ptr_out_cfg->mem_info_table[i_idx].ui_size;
 1836|  6.52k|    }
 1837|  26.1k|    ptr_out_cfg->malloc_count++;
 1838|  26.1k|  }
 1839|  6.52k|  return err_code;
 1840|  6.52k|}
ixheaace_api.c:get_drc_config_size:
 1524|  1.47k|                                  ixheaace_input_config *ptr_in_cfg) {
 1525|  1.47k|  WORD32 bit_count = 0;
 1526|  1.47k|  WORD32 total_byte_cnt = 0;
 1527|       |
 1528|  1.47k|  ia_drc_enc_state *pstr_drc_state =
 1529|  1.47k|      &pstr_api_struct->pstr_state->str_usac_enc_data.str_drc_state;
 1530|  1.47k|  ia_drc_input_config *pstr_in_drc_cfg = (ia_drc_input_config *)ptr_in_cfg->pv_drc_cfg;
 1531|       |
 1532|  1.47k|  memset(pstr_drc_state, 0, sizeof(*pstr_drc_state));
 1533|       |
 1534|  1.47k|  pstr_drc_state->str_enc_params = pstr_in_drc_cfg->str_enc_params;
 1535|  1.47k|  pstr_drc_state->str_uni_drc_config = pstr_in_drc_cfg->str_uni_drc_config;
 1536|  1.47k|  pstr_drc_state->str_gain_enc.str_loudness_info_set = pstr_in_drc_cfg->str_enc_loudness_info_set;
 1537|  1.47k|  pstr_drc_state->str_enc_gain_extension = pstr_in_drc_cfg->str_enc_gain_extension;
 1538|  1.47k|  pstr_drc_state->str_gain_enc.str_uni_drc_config = pstr_in_drc_cfg->str_uni_drc_config;
 1539|  1.47k|  pstr_drc_state->drc_scratch_mem =
 1540|  1.47k|      pstr_api_struct->pstr_state->str_usac_enc_data.str_scratch.ptr_scratch_buf;
 1541|  1.47k|  pstr_drc_state->str_gain_enc.base_ch_count = ptr_in_cfg->i_channels;
 1542|       |
 1543|       |  //uniDrc payload size
 1544|  1.47k|  impd_drc_write_uni_drc_config(pstr_drc_state, &bit_count, 0);
 1545|  1.47k|  total_byte_cnt += ((bit_count + 7) >> 3);
 1546|  1.47k|  bit_count = 0;
 1547|       |
 1548|       |  // LoudnessInfo payload size
 1549|  1.47k|  impd_drc_write_loudness_info_set(pstr_drc_state, NULL, &bit_count, 0);
 1550|  1.47k|  total_byte_cnt += ((bit_count + 7) >> 3);
 1551|       |
 1552|  1.47k|  return total_byte_cnt;
 1553|  1.47k|}
ixheaace_api.c:ia_enhaacplus_enc_init:
 2264|  4.76k|static IA_ERRORCODE ia_enhaacplus_enc_init(ixheaace_api_struct *pstr_api_struct, WORD32 ele_idx) {
 2265|  4.76k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.76k|#define IA_NO_ERROR 0x00000000
  ------------------
 2266|  4.76k|  WORD32 anc_flag = 0;
 2267|  4.76k|  WORD32 anc_rate = -1;
 2268|  4.76k|  WORD32 anc_mode = 0;
 2269|  4.76k|  WORD32 core_ch;
 2270|  4.76k|  WORD32 asc_channels;
 2271|  4.76k|  WORD8 *ptr_resampler_scratch;
 2272|  4.76k|  iaace_scratch *pstr_aac_scratch;
 2273|  4.76k|  WORD8 *ptr_spectral_band_replication_scratch;
 2274|  4.76k|  UWORD32 core_sample_rate;
 2275|  4.76k|  ixheaace_state_struct *pstr_enc_state = pstr_api_struct->pstr_state;
 2276|  4.76k|  ixheaace_audio_specific_config_struct *pstr_asc = &pstr_enc_state->audio_specific_config;
 2277|       |
 2278|  4.76k|  iaace_config *pstr_aac_config = &(pstr_api_struct->config[ele_idx].aac_config);
 2279|       |
 2280|  4.76k|  ixheaace_config_ancillary *pstr_ancillary = &(pstr_api_struct->config[ele_idx].pstr_ancillary);
 2281|  4.76k|  pstr_aac_scratch = (iaace_scratch *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  4.76k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2282|  4.76k|  ptr_spectral_band_replication_scratch =
 2283|  4.76k|      ((pWORD8)pstr_aac_scratch) + ia_enhaacplus_enc_aac_enc_scr_size();
 2284|  4.76k|  ptr_resampler_scratch = ((pWORD8)pstr_aac_scratch) + ia_enhaacplus_enc_aac_enc_scr_size() +
 2285|  4.76k|                          ixheaace_sbr_enc_scr_size();
 2286|       |
 2287|       |  /* fill pstr_ancillary data */
 2288|  4.76k|  pstr_ancillary->anc_flag = anc_flag;
 2289|  4.76k|  pstr_ancillary->anc_mode = anc_mode;
 2290|  4.76k|  pstr_ancillary->anc_rate = anc_rate;
 2291|  4.76k|  pstr_api_struct->pstr_state->temp_buff_aac =
 2292|  4.76k|      (void *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  4.76k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2293|  4.76k|  pstr_api_struct->pstr_state->temp_buff_sbr =
 2294|  4.76k|      (void *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|  4.76k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2295|  4.76k|               ia_enhaacplus_enc_aac_enc_scr_size());
 2296|       |
 2297|  4.76k|  if (pstr_api_struct->config[ele_idx].use_mps &&
  ------------------
  |  Branch (2297:7): [True: 609, False: 4.15k]
  ------------------
 2298|    609|      pstr_api_struct->config[ele_idx].mps_tree_config != TREE_212) {
  ------------------
  |  |   39|    609|#define TREE_212 (0)
  ------------------
  |  Branch (2298:7): [True: 450, False: 159]
  ------------------
 2299|    450|    pstr_api_struct->pstr_state->mps_scratch =
 2300|    450|        (FLOAT32 *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|    450|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2301|    450|                    ia_enhaacplus_enc_aac_enc_scr_size());
 2302|       |
 2303|    450|    pstr_api_struct->pstr_state->ptr_temp_buff_resamp =
 2304|    450|        (void *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|    450|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2305|    450|                 ia_enhaacplus_enc_aac_enc_scr_size() + ixheaace_sbr_enc_scr_size());
 2306|  4.31k|  } else {
 2307|  4.31k|    pstr_api_struct->pstr_state->ptr_temp_buff_resamp =
 2308|  4.31k|        (void *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|  4.31k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2309|  4.31k|                 ia_enhaacplus_enc_aac_enc_scr_size() + ixheaace_sbr_enc_scr_size());
 2310|  4.31k|  }
 2311|       |
 2312|  4.76k|  if (pstr_api_struct->config[ele_idx].chmode_nchannels == 2) {
  ------------------
  |  Branch (2312:7): [True: 2.38k, False: 2.37k]
  ------------------
 2313|       |    /* When the chmode option is not used,
 2314|       |      the number of channels depends on the input file */
 2315|  2.38k|    pstr_api_struct->config[ele_idx].chmode_nchannels =
 2316|  2.38k|        pstr_api_struct->config[ele_idx].i_channels;
 2317|  2.38k|  }
 2318|       |
 2319|  4.76k|  switch (pstr_api_struct->pstr_state->aot) {
  ------------------
  |  Branch (2319:11): [True: 4.76k, False: 0]
  ------------------
 2320|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2320:5): [True: 1.00k, False: 3.76k]
  ------------------
 2321|  2.70k|    case AOT_SBR:
  ------------------
  |  |  141|  2.70k|#define AOT_SBR (5)
  ------------------
  |  Branch (2321:5): [True: 1.70k, False: 3.05k]
  ------------------
 2322|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (2322:5): [True: 246, False: 4.51k]
  ------------------
 2323|  2.94k|      pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_LC;
  ------------------
  |  |  132|  2.94k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|  2.94k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
 2324|  2.94k|      break;
 2325|       |
 2326|    529|    case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2326:5): [True: 529, False: 4.23k]
  ------------------
 2327|    529|      if (pstr_aac_config->flag_framelength_small == 1) {
  ------------------
  |  Branch (2327:11): [True: 250, False: 279]
  ------------------
 2328|    250|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_LD_480;
  ------------------
  |  |  142|    250|#define INPUT_DELAY_LD_480 ((CORE_DELAY_LD_480)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  141|    250|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2329|    279|      } else {
 2330|    279|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_LD_512;
  ------------------
  |  |  134|    279|#define INPUT_DELAY_LD_512 ((CORE_DELAY_LD_512)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  133|    279|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2331|    279|      }
 2332|    529|      break;
 2333|       |
 2334|  1.28k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2334:5): [True: 1.28k, False: 3.47k]
  ------------------
 2335|  1.28k|      if (pstr_aac_config->flag_framelength_small == 1) {
  ------------------
  |  Branch (2335:11): [True: 580, False: 704]
  ------------------
 2336|    580|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_ELD_480;
  ------------------
  |  |  144|    580|#define INPUT_DELAY_ELD_480 ((CORE_DELAY_LD_480 / 2) * 2 + 0 - (15 * 64) + 576)
  |  |  ------------------
  |  |  |  |  141|    580|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2337|    704|      } else {
 2338|    704|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_ELD_512;
  ------------------
  |  |  136|    704|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|    704|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2339|    704|      }
 2340|  1.28k|      break;
 2341|  4.76k|  }
 2342|  4.76k|  pstr_api_struct->pstr_state->downsample[ele_idx] = 0;
 2343|  4.76k|  pstr_api_struct->config->frame_count = 0;
 2344|  4.76k|  core_ch = pstr_api_struct->config[ele_idx].chmode_nchannels;
 2345|  4.76k|  pstr_aac_config->sample_rate = pstr_api_struct->config[ele_idx].sample_rate;
 2346|  4.76k|  pstr_aac_config->core_sample_rate = pstr_api_struct->config[ele_idx].sample_rate;
 2347|  4.76k|  pstr_aac_config->native_sample_rate = pstr_api_struct->config[ele_idx].native_sample_rate;
 2348|  4.76k|  pstr_aac_config->num_in_channels = pstr_api_struct->config[ele_idx].i_channels;
 2349|  4.76k|  pstr_aac_config->num_out_channels = pstr_api_struct->config[ele_idx].chmode_nchannels;
 2350|  4.76k|  if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (2350:7): [True: 3.23k, False: 1.52k]
  ------------------
 2351|  3.23k|    pstr_aac_config->core_sample_rate = pstr_aac_config->core_sample_rate / 2;
 2352|  3.23k|  }
 2353|  4.76k|  if (pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2353:7): [True: 557, False: 4.20k]
  ------------------
 2354|    557|    switch (pstr_api_struct->pstr_state->mps_tree_config) {
  ------------------
  |  Branch (2354:13): [True: 557, False: 0]
  ------------------
 2355|    155|      case TREE_212:
  ------------------
  |  |   39|    155|#define TREE_212 (0)
  ------------------
  |  Branch (2355:7): [True: 155, False: 402]
  ------------------
 2356|    285|      case TREE_5151:
  ------------------
  |  |   40|    285|#define TREE_5151 (1)
  ------------------
  |  Branch (2356:7): [True: 130, False: 427]
  ------------------
 2357|    325|      case TREE_5152:
  ------------------
  |  |   41|    325|#define TREE_5152 (2)
  ------------------
  |  Branch (2357:7): [True: 40, False: 517]
  ------------------
 2358|    325|        pstr_aac_config->num_out_channels = 1;
 2359|    325|        core_ch = 1;
 2360|    325|        break;
 2361|       |
 2362|    232|      case TREE_525:
  ------------------
  |  |   42|    232|#define TREE_525 (3)
  ------------------
  |  Branch (2362:7): [True: 232, False: 325]
  ------------------
 2363|    232|        pstr_aac_config->num_out_channels = 2;
 2364|    232|        core_ch = 2;
 2365|    232|        break;
 2366|    557|    }
 2367|    557|  }
 2368|       |
 2369|  4.76k|  if (pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2369:7): [True: 246, False: 4.51k]
  ------------------
 2370|    246|    pstr_api_struct->config[ele_idx].chmode_nchannels = 2;
 2371|    246|    pstr_aac_config->num_out_channels = 1;
 2372|    246|    core_ch = 1;
 2373|    246|    pstr_api_struct->config[ele_idx].element_type = ID_SCE;
 2374|    246|  }
 2375|  4.76k|  if ((pstr_api_struct->config[ele_idx].i_channels == 2) &&
  ------------------
  |  Branch (2375:7): [True: 2.38k, False: 2.37k]
  ------------------
 2376|  2.38k|      (pstr_api_struct->config[ele_idx].chmode == 0)) {
  ------------------
  |  Branch (2376:7): [True: 0, False: 2.38k]
  ------------------
 2377|      0|    pstr_api_struct->config[ele_idx].chmode_nchannels = 1;
 2378|      0|    pstr_aac_config->num_out_channels = 1;
 2379|      0|  }
 2380|  4.76k|  if ((pstr_api_struct->config[ele_idx].use_parametric_stereo) &&
  ------------------
  |  Branch (2380:7): [True: 246, False: 4.51k]
  ------------------
 2381|    246|      (pstr_api_struct->config[ele_idx].aac_classic)) {
  ------------------
  |  Branch (2381:7): [True: 0, False: 246]
  ------------------
 2382|      0|    return (IA_EXHEAACE_CONFIG_FATAL_AAC_CLASSIC_WITH_PS);
 2383|      0|  }
 2384|       |
 2385|  4.76k|  if (!(pstr_api_struct->config[ele_idx].adts_flag) &&
  ------------------
  |  Branch (2385:7): [True: 3.19k, False: 1.56k]
  ------------------
 2386|  3.19k|      (pstr_api_struct->config[0].aac_config.calc_crc)) {
  ------------------
  |  Branch (2386:7): [True: 0, False: 3.19k]
  ------------------
 2387|       |    // set here default for crc as 0
 2388|      0|    pstr_api_struct->config[0].aac_config.calc_crc = 0;
 2389|      0|    return (IA_EXHEAACE_CONFIG_NONFATAL_INVALID_CONFIG);
 2390|      0|  }
 2391|       |
 2392|  4.76k|  if ((pstr_api_struct->config[0].chmode == 3) &&
  ------------------
  |  Branch (2392:7): [True: 0, False: 4.76k]
  ------------------
 2393|      0|      (pstr_api_struct->config[0].aac_config.calc_crc == 1)) {
  ------------------
  |  Branch (2393:7): [True: 0, False: 0]
  ------------------
 2394|       |    // dual mono case so crc if enabled must be disabled
 2395|      0|    pstr_api_struct->config[0].aac_config.calc_crc = 0;
 2396|      0|    return (IA_EXHEAACE_CONFIG_NONFATAL_INVALID_CONFIG);
 2397|      0|  }
 2398|       |
 2399|  4.76k|  pstr_aac_config->bit_rate = ixheaac_min32(360000 * core_ch, pstr_aac_config->bit_rate);
 2400|  4.76k|  pstr_aac_config->bit_rate = ixheaac_max32(8000 * core_ch, pstr_aac_config->bit_rate);
 2401|  4.76k|  switch (pstr_api_struct->pstr_state->aot) {
  ------------------
  |  Branch (2401:11): [True: 4.76k, False: 0]
  ------------------
 2402|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2402:5): [True: 1.00k, False: 3.76k]
  ------------------
 2403|  2.70k|    case AOT_SBR:
  ------------------
  |  |  141|  2.70k|#define AOT_SBR (5)
  ------------------
  |  Branch (2403:5): [True: 1.70k, False: 3.05k]
  ------------------
 2404|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (2404:5): [True: 246, False: 4.51k]
  ------------------
 2405|  2.94k|      pstr_aac_config->bit_rate = ia_enhaacplus_aac_limitbitrate(
 2406|  2.94k|          pstr_aac_config->core_sample_rate,
 2407|  2.94k|          (pstr_aac_config->flag_framelength_small ? FRAME_LEN_960 : FRAME_LEN_1024), core_ch,
  ------------------
  |  |   94|  1.01k|#define FRAME_LEN_960 960
  ------------------
                        (pstr_aac_config->flag_framelength_small ? FRAME_LEN_960 : FRAME_LEN_1024), core_ch,
  ------------------
  |  |   91|  1.93k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2407:12): [True: 1.01k, False: 1.93k]
  ------------------
 2408|  2.94k|          pstr_aac_config->bit_rate);
 2409|  2.94k|      break;
 2410|       |
 2411|    529|    case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2411:5): [True: 529, False: 4.23k]
  ------------------
 2412|  1.81k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.81k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2412:5): [True: 1.28k, False: 3.47k]
  ------------------
 2413|  1.81k|      pstr_aac_config->bit_rate = ia_enhaacplus_aac_limitbitrate(
 2414|  1.81k|          pstr_aac_config->core_sample_rate,
 2415|  1.81k|          (pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 : FRAME_LEN_512), core_ch,
  ------------------
  |  |   93|    830|#define FRAME_LEN_480 480
  ------------------
                        (pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 : FRAME_LEN_512), core_ch,
  ------------------
  |  |   92|    983|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2415:12): [True: 830, False: 983]
  ------------------
 2416|  1.81k|          pstr_aac_config->bit_rate);
 2417|  1.81k|      break;
 2418|  4.76k|  }
 2419|  4.76k|  if (pstr_api_struct->config[ele_idx].eldsbr_found == 1) {
  ------------------
  |  Branch (2419:7): [True: 3.23k, False: 1.52k]
  ------------------
 2420|  3.23k|    WORD32 num_iter = 0;
 2421|  3.23k|    WORD32 initial_bitrate, adjusted_bitrate;
 2422|  3.23k|    adjusted_bitrate = pstr_aac_config->bit_rate;
 2423|       |
 2424|       |    /* Find total bitrate which provides valid configuration for each SBR element. */
 2425|  3.69k|    do {
 2426|  3.69k|      WORD32 e;
 2427|  3.69k|      WORD32 q_format;
 2428|  3.69k|      initial_bitrate = adjusted_bitrate;
 2429|       |
 2430|  10.9k|      for (e = 0; e < pstr_api_struct->config[ele_idx].num_bs_elements; e++) {
  ------------------
  |  Branch (2430:19): [True: 8.15k, False: 2.77k]
  ------------------
 2431|  8.15k|        WORD32 sbr_element_bitate_in, sbr_bitrate_out;
 2432|       |
 2433|  8.15k|        sbr_element_bitate_in = pstr_aac_config->bit_rate;
 2434|  8.15k|        sbr_bitrate_out = ixheaace_sbr_limit_bitrate(
 2435|  8.15k|            sbr_element_bitate_in, core_ch, pstr_aac_config->core_sample_rate,
 2436|  8.15k|            pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2437|  8.15k|            pstr_api_struct->pstr_state->aot);
 2438|       |
 2439|  8.15k|        if (sbr_bitrate_out == 0) {
  ------------------
  |  Branch (2439:13): [True: 0, False: 8.15k]
  ------------------
 2440|      0|          pstr_aac_config->bit_rate = 0;
 2441|      0|        }
 2442|       |
 2443|       |        /* If bitrates don't match, distribution and limiting needs to be determined again.
 2444|       |        Abort element loop and restart with adapted bitrate. */
 2445|  8.15k|        if (sbr_element_bitate_in != sbr_bitrate_out) {
  ------------------
  |  Branch (2445:13): [True: 916, False: 7.24k]
  ------------------
 2446|    916|          if (sbr_element_bitate_in < sbr_bitrate_out) {
  ------------------
  |  Branch (2446:15): [True: 916, False: 0]
  ------------------
 2447|    916|            adjusted_bitrate = ixheaac_max32(
 2448|    916|                initial_bitrate,
 2449|    916|                (WORD32)ixheaac_div32((WORD32)(sbr_bitrate_out + 8), MAX_32, &q_format));
  ------------------
  |  |   60|    916|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
 2450|    916|            adjusted_bitrate = adjusted_bitrate >> (q_format - 31);
 2451|    916|            break;
 2452|    916|          }
 2453|       |
 2454|      0|          if (sbr_element_bitate_in > sbr_bitrate_out) {
  ------------------
  |  Branch (2454:15): [True: 0, False: 0]
  ------------------
 2455|      0|            adjusted_bitrate = ixheaac_min32(
 2456|      0|                initial_bitrate,
 2457|      0|                (WORD32)ixheaac_div32((WORD32)(sbr_bitrate_out - 8), MAX_32, &q_format));
  ------------------
  |  |   60|      0|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
 2458|      0|            break;
 2459|      0|          }
 2460|       |
 2461|      0|        } /* sbr_element_bitate_in != sbr_bitrate_out */
 2462|       |
 2463|  8.15k|      } /* elements */
 2464|       |
 2465|  3.69k|      num_iter++; /* restrict iteration to worst case of num elements */
 2466|       |
 2467|  3.69k|    } while ((initial_bitrate != adjusted_bitrate) &&
  ------------------
  |  Branch (2467:14): [True: 458, False: 3.23k]
  ------------------
 2468|    458|             (num_iter <= pstr_api_struct->config[ele_idx].num_bs_elements));
  ------------------
  |  Branch (2468:14): [True: 458, False: 0]
  ------------------
 2469|       |
 2470|       |    /* Unequal bitrates mean that no reasonable bitrate configuration found. */
 2471|  3.23k|    pstr_aac_config->bit_rate = (initial_bitrate == adjusted_bitrate) ? adjusted_bitrate : 0;
  ------------------
  |  Branch (2471:33): [True: 3.23k, False: 0]
  ------------------
 2472|  3.23k|  }
 2473|       |
 2474|  4.76k|  pstr_asc->str_aac_config.frame_length_flag = pstr_aac_config->flag_framelength_small;
 2475|  4.76k|  pstr_asc->sampling_frequency = pstr_api_struct->config[0].native_sample_rate;
 2476|  4.76k|  asc_channels = pstr_api_struct->config[ele_idx].i_channels_mode;
 2477|  4.76k|  pstr_asc->channel_configuration =
 2478|  4.76k|      (pstr_api_struct->pstr_state->mps_enable ? core_ch : asc_channels);
  ------------------
  |  Branch (2478:8): [True: 557, False: 4.20k]
  ------------------
 2479|  4.76k|  pstr_asc->channel_configuration =
 2480|  4.76k|      pstr_api_struct->config[ele_idx].use_parametric_stereo
  ------------------
  |  Branch (2480:7): [True: 246, False: 4.51k]
  ------------------
 2481|  4.76k|          ? 1
 2482|  4.76k|          : (pstr_api_struct->pstr_state->mps_enable
  ------------------
  |  Branch (2482:14): [True: 557, False: 3.95k]
  ------------------
 2483|  4.51k|                 ? core_ch
 2484|  4.51k|                 : pstr_api_struct->config[ele_idx].i_channels_mode);
 2485|       |
 2486|  4.76k|  if (!(pstr_api_struct->config[ele_idx].aac_classic) &&
  ------------------
  |  Branch (2486:7): [True: 3.23k, False: 1.52k]
  ------------------
 2487|  3.23k|      ixheaace_is_sbr_setting_available(
  ------------------
  |  Branch (2487:7): [True: 3.21k, False: 18]
  ------------------
 2488|  3.23k|          pstr_aac_config->bit_rate,
 2489|  3.23k|          (pstr_api_struct->pstr_state->mps_enable
  ------------------
  |  Branch (2489:12): [True: 557, False: 2.67k]
  ------------------
 2490|  3.23k|               ? 1
 2491|  3.23k|               : pstr_api_struct->config[ele_idx].chmode_nchannels),
 2492|  3.23k|          pstr_aac_config->sample_rate, &core_sample_rate,
 2493|  3.23k|          pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2494|  3.23k|          pstr_api_struct->pstr_state->aot)) {
 2495|  3.21k|    ixheaace_str_sbr_cfg spectral_band_replication_config;
 2496|  3.21k|    ixheaace_initialize_sbr_defaults(&spectral_band_replication_config);
 2497|       |
 2498|  3.21k|    spectral_band_replication_config.use_ps =
 2499|  3.21k|        pstr_api_struct->config[ele_idx].use_parametric_stereo;
 2500|  3.21k|    spectral_band_replication_config.crc_sbr = 0;
 2501|  3.21k|    spectral_band_replication_config.parametric_coding = 1;
 2502|  3.21k|    spectral_band_replication_config.is_esbr = pstr_api_struct->config[0].esbr_flag;
 2503|  3.21k|    if (pstr_api_struct->pstr_state->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  3.21k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2503:9): [True: 1.27k, False: 1.94k]
  ------------------
 2504|  1.27k|      spectral_band_replication_config.is_ld_sbr = 1;
 2505|  1.27k|      spectral_band_replication_config.sbr_codec = ELD_SBR;
 2506|  1.27k|      spectral_band_replication_config.frame_flag_480 = pstr_aac_config->flag_framelength_small;
 2507|  1.94k|    } else if (pstr_api_struct->pstr_state->aot == AOT_SBR ||
  ------------------
  |  |  141|  3.88k|#define AOT_SBR (5)
  ------------------
  |  Branch (2507:16): [True: 1.69k, False: 246]
  ------------------
 2508|  1.94k|               pstr_api_struct->pstr_state->aot == AOT_PS) {
  ------------------
  |  |   39|    246|#define AOT_PS (29)
  ------------------
  |  Branch (2508:16): [True: 246, False: 0]
  ------------------
 2509|  1.94k|      spectral_band_replication_config.frame_flag_960 = pstr_aac_config->flag_framelength_small;
 2510|  1.94k|      spectral_band_replication_config.sbr_codec = HEAAC_SBR;
 2511|  1.94k|    }
 2512|       |
 2513|  3.21k|    if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (2513:9): [True: 3.21k, False: 0]
  ------------------
 2514|  3.21k|      pstr_api_struct->pstr_state->downsample[ele_idx] = 1;
 2515|  3.21k|    }
 2516|       |
 2517|  3.21k|    if (pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2517:9): [True: 553, False: 2.66k]
  ------------------
 2518|    553|      if (pstr_api_struct->pstr_state->mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    553|#define TREE_212 (0)
  ------------------
  |  Branch (2518:11): [True: 151, False: 402]
  ------------------
 2519|    151|        WORD32 delay =
 2520|    151|            ((pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 / 2 : FRAME_LEN_512 / 2) *
  ------------------
  |  |   93|     82|#define FRAME_LEN_480 480
  ------------------
                          ((pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 / 2 : FRAME_LEN_512 / 2) *
  ------------------
  |  |   92|     69|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2520:15): [True: 82, False: 69]
  ------------------
 2521|    151|                 2 +
 2522|    151|             4);
 2523|    151|        ixheaace_mps_212_memory_struct *pstr_mps_memory;
 2524|    151|        pstr_mps_memory = pstr_api_struct->pstr_state->mps_pers_mem;
 2525|    151|        ixheaace_mps_212_open(&pstr_api_struct->pstr_mps_212_enc, pstr_mps_memory);
 2526|       |
 2527|    151|        pstr_asc->str_aac_config.num_sac_cfg_bits = 0;
 2528|       |
 2529|    151|        error = ixheaace_mps_212_initialise(
 2530|    151|            pstr_api_struct->pstr_mps_212_enc, AOT_AAC_ELD, pstr_aac_config->sample_rate,
  ------------------
  |  |   37|    151|#define AOT_AAC_ELD (39)
  ------------------
 2531|    151|            &pstr_aac_config->bit_rate,
 2532|    151|            pstr_api_struct->config[ele_idx].eldsbr_found ? 2 /*hAacConfig->sbrRatio*/ : 0,
  ------------------
  |  Branch (2532:13): [True: 151, False: 0]
  ------------------
 2533|    151|            (pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 * 2 : FRAME_LEN_512 * 2),
  ------------------
  |  |   93|     82|#define FRAME_LEN_480 480
  ------------------
                          (pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 * 2 : FRAME_LEN_512 * 2),
  ------------------
  |  |   92|     69|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2533:14): [True: 82, False: 69]
  ------------------
 2534|       |            /* for dual rate sbr this value is already multiplied by 2 */
 2535|    151|            (pstr_aac_config->flag_framelength_small
  ------------------
  |  Branch (2535:14): [True: 82, False: 69]
  ------------------
 2536|    151|                 ? FRAME_LEN_480 * 2
  ------------------
  |  |   93|     82|#define FRAME_LEN_480 480
  ------------------
 2537|    151|                 : FRAME_LEN_512 * 2) /* samples read per ch*/,
  ------------------
  |  |   92|     69|#define FRAME_LEN_512 512
  ------------------
 2538|    151|            delay, (WORD8 *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp);
 2539|    151|        if (error) {
  ------------------
  |  Branch (2539:13): [True: 0, False: 151]
  ------------------
 2540|      0|          return error;
 2541|      0|        }
 2542|       |
 2543|    151|        pstr_asc->str_aac_config.num_sac_cfg_bits = ixheaace_mps_212_get_spatial_specific_config(
 2544|    151|            pstr_api_struct->pstr_mps_212_enc, (WORD8 *)pstr_asc->str_aac_config.sac_cfg_data,
 2545|    151|            sizeof(pstr_asc->str_aac_config.sac_cfg_data), AOT_AAC_ELD);
  ------------------
  |  |   37|    151|#define AOT_AAC_ELD (39)
  ------------------
 2546|    151|        pstr_asc->str_aac_config.eld_ext_type[0] = IAAC_ELDEXT_LDSAC;
 2547|    151|        pstr_asc->str_aac_config.eld_ext_len[0] =
 2548|    151|            (pstr_asc->str_aac_config.num_sac_cfg_bits + 7) >> 3;
 2549|    402|      } else {
 2550|    402|        WORD32 tree_config;
 2551|    402|        WORD32 bits_written;
 2552|    402|        ixheaace_bit_buf bit_buf;
 2553|    402|        ixheaace_bit_buf_handle ptr_bit_buf;
 2554|    402|        ixheaace_mps_515_memory_struct *pstr_mps_memory;
 2555|    402|        if (pstr_api_struct->pstr_state->mps_tree_config == TREE_525) {
  ------------------
  |  |   42|    402|#define TREE_525 (3)
  ------------------
  |  Branch (2555:13): [True: 232, False: 170]
  ------------------
 2556|    232|          tree_config = 525;
 2557|    232|        } else if (pstr_api_struct->pstr_state->mps_tree_config == TREE_5152) {
  ------------------
  |  |   41|    170|#define TREE_5152 (2)
  ------------------
  |  Branch (2557:20): [True: 40, False: 130]
  ------------------
 2558|     40|          tree_config = 5152;
 2559|    130|        } else {
 2560|    130|          tree_config = 5151;
 2561|    130|        }
 2562|    402|        pstr_mps_memory = pstr_api_struct->pstr_state->mps_515_pers_mem;
 2563|    402|        ptr_bit_buf = ia_enhaacplus_enc_create_bitbuffer(
 2564|    402|            &bit_buf, (UWORD8 *)pstr_asc->str_aac_config.sac_cfg_data,
 2565|    402|            sizeof(pstr_asc->str_aac_config.sac_cfg_data));
 2566|       |
 2567|    402|        error = ixheaace_mps_515_open(
 2568|    402|            &pstr_api_struct->pstr_mps_515_enc, pstr_aac_config->sample_rate, tree_config,
 2569|    402|            ptr_bit_buf, &bits_written, pstr_mps_memory, pstr_aac_config->flag_framelength_small);
 2570|    402|        pstr_asc->str_aac_config.num_sac_cfg_bits = bits_written;
 2571|    402|        pstr_asc->str_aac_config.eld_ext_type[0] = IAAC_ELDEXT_LDSAC;
 2572|    402|        pstr_asc->str_aac_config.eld_ext_len[0] = (bits_written + 7) >> 3;
 2573|    402|        if (error) {
  ------------------
  |  Branch (2573:13): [True: 0, False: 402]
  ------------------
 2574|      0|          return error;
 2575|      0|        }
 2576|    402|      }
 2577|    553|    }
 2578|       |
 2579|  3.21k|    ixheaace_adjust_sbr_settings(
 2580|  3.21k|        &spectral_band_replication_config, pstr_aac_config->bit_rate,
 2581|  3.21k|        pstr_aac_config->num_out_channels, core_sample_rate, AACENC_TRANS_FAC, 24000,
  ------------------
  |  |   23|  3.21k|#define AACENC_TRANS_FAC 8    /* encoder WORD16 long ratio */
  ------------------
 2582|  3.21k|        pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2583|  3.21k|        pstr_api_struct->pstr_state->aot, (pstr_api_struct->config[0].ccfl_idx == SBR_4_1));
  ------------------
  |  |  199|  3.21k|#define SBR_4_1 (4)
  ------------------
 2584|       |
 2585|  3.21k|    if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (2585:9): [True: 2.95k, False: 255]
  ------------------
 2586|       |      /* open SBR PART, set core bandwidth */
 2587|  2.95k|      error = ixheaace_env_open(
 2588|  2.95k|          &pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[ele_idx],
 2589|  2.95k|          &spectral_band_replication_config, &pstr_aac_config->band_width,
 2590|  2.95k|          ptr_spectral_band_replication_scratch,
 2591|  2.95k|          &(pstr_api_struct->spectral_band_replication_tabs),
 2592|  2.95k|          &pstr_asc->str_aac_config.sbr_config);
 2593|  2.95k|      pstr_asc->str_aac_config.ld_sbr_present_flag =
 2594|  2.95k|          pstr_api_struct->config[ele_idx].eldsbr_found;
 2595|  2.95k|      if (error) {
  ------------------
  |  Branch (2595:11): [True: 0, False: 2.95k]
  ------------------
 2596|      0|        return error;
 2597|      0|      }
 2598|  2.95k|      pstr_asc->str_aac_config.ld_sbr_sample_rate =
 2599|  2.95k|          (spectral_band_replication_config.codec_settings.sample_freq !=
  ------------------
  |  Branch (2599:11): [True: 2.95k, False: 0]
  ------------------
 2600|  2.95k|           pstr_aac_config->sample_rate)
 2601|  2.95k|              ? 1
 2602|  2.95k|              : 0;
 2603|  2.95k|      pstr_asc->str_aac_config.ld_sbr_crc_flag = spectral_band_replication_config.crc_sbr;
 2604|  2.95k|    }
 2605|       |
 2606|  3.21k|    if (!pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2606:9): [True: 2.96k, False: 246]
  ------------------
 2607|  2.96k|      IA_ERRORCODE resamp_error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.96k|#define IA_NO_ERROR 0x00000000
  ------------------
 2608|  2.96k|      WORD32 ch_idx = 0;
 2609|       |
 2610|  2.96k|      resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2611|  2.96k|          &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx]), 2,
 2612|  2.96k|          pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2613|  2.96k|      if (resamp_error) {
  ------------------
  |  Branch (2613:11): [True: 0, False: 2.96k]
  ------------------
 2614|      0|        return resamp_error;
 2615|      0|      }
 2616|  2.96k|      if (pstr_api_struct->config[ele_idx].i_channels > 1) {
  ------------------
  |  Branch (2616:11): [True: 1.78k, False: 1.18k]
  ------------------
 2617|  1.78k|        resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2618|  1.78k|            &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx + 1]), 2,
 2619|  1.78k|            pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2620|  1.78k|        if (resamp_error) {
  ------------------
  |  Branch (2620:13): [True: 0, False: 1.78k]
  ------------------
 2621|      0|          return resamp_error;
 2622|      0|        }
 2623|  1.78k|      }
 2624|  2.96k|    }
 2625|  3.21k|  } else {
 2626|  1.54k|    if (!(pstr_api_struct->config[ele_idx].aac_classic &&
  ------------------
  |  Branch (2626:11): [True: 1.52k, False: 18]
  ------------------
 2627|  1.52k|          !(pstr_api_struct->config[ele_idx].eldsbr_found))) {
  ------------------
  |  Branch (2627:11): [True: 1.52k, False: 0]
  ------------------
 2628|     18|      if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (2628:11): [True: 18, False: 0]
  ------------------
 2629|     18|        error = IA_EXHEAACE_INIT_FATAL_AACPLUS_NOT_AVAIL;
 2630|     18|      } else {
 2631|      0|        error = IA_EXHEAACE_INIT_FATAL_BITRATE_NOT_SUPPORTED;
 2632|      0|      }
 2633|     18|      return error;
 2634|     18|    }
 2635|  1.52k|    pstr_api_struct->pstr_state->buffer_offset = 0;
 2636|  1.52k|    pstr_api_struct->config[ele_idx].aac_classic = 1;
 2637|  1.52k|  }
 2638|  4.74k|  {
 2639|  4.74k|    WORD32 *shared_buf1, *shared_buf2;
 2640|  4.74k|    WORD32 *shared_buf3;
 2641|  4.74k|    WORD8 *shared_buf4;
 2642|  4.74k|    switch (pstr_api_struct->pstr_state->aot) {
  ------------------
  |  Branch (2642:13): [True: 4.74k, False: 0]
  ------------------
 2643|  1.00k|      case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2643:7): [True: 1.00k, False: 3.74k]
  ------------------
 2644|  2.69k|      case AOT_SBR:
  ------------------
  |  |  141|  2.69k|#define AOT_SBR (5)
  ------------------
  |  Branch (2644:7): [True: 1.69k, False: 3.04k]
  ------------------
 2645|  2.94k|      case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (2645:7): [True: 246, False: 4.49k]
  ------------------
 2646|  2.94k|        ia_enhaacplus_enc_get_shared_bufs(
 2647|  2.94k|            ptr_spectral_band_replication_scratch, &shared_buf1, &shared_buf2, &shared_buf3,
 2648|  2.94k|            &shared_buf4,
 2649|  2.94k|            (pstr_aac_config->flag_framelength_small == 1) ? FRAME_LEN_960 : FRAME_LEN_1024);
  ------------------
  |  |   94|  1.01k|#define FRAME_LEN_960 960
  ------------------
                          (pstr_aac_config->flag_framelength_small == 1) ? FRAME_LEN_960 : FRAME_LEN_1024);
  ------------------
  |  |   91|  1.92k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2649:13): [True: 1.01k, False: 1.92k]
  ------------------
 2650|  2.94k|        break;
 2651|       |
 2652|    529|      case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2652:7): [True: 529, False: 4.21k]
  ------------------
 2653|  1.80k|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2653:7): [True: 1.27k, False: 3.47k]
  ------------------
 2654|  1.80k|        ia_enhaacplus_enc_get_shared_bufs(
 2655|  1.80k|            ptr_spectral_band_replication_scratch, &shared_buf1, &shared_buf2, &shared_buf3,
 2656|  1.80k|            &shared_buf4,
 2657|  1.80k|            (pstr_aac_config->flag_framelength_small == 1) ? FRAME_LEN_480 : FRAME_LEN_512);
  ------------------
  |  |   93|    825|#define FRAME_LEN_480 480
  ------------------
                          (pstr_aac_config->flag_framelength_small == 1) ? FRAME_LEN_480 : FRAME_LEN_512);
  ------------------
  |  |   92|    977|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2657:13): [True: 825, False: 977]
  ------------------
 2658|  1.80k|        break;
 2659|  4.74k|    }
 2660|       |
 2661|  4.74k|    ia_enhaacplus_enc_set_shared_bufs(pstr_aac_scratch, &shared_buf1, &shared_buf2, &shared_buf3,
 2662|  4.74k|                                      &ptr_resampler_scratch);
 2663|       |
 2664|  4.74k|    error = ia_enhaacplus_enc_aac_enc_open(
 2665|  4.74k|        &(pstr_api_struct->pstr_state->aac_enc_pers_mem[ele_idx]),
 2666|  4.74k|        *pstr_aac_config /*, *pstr_ancillary*/, pstr_aac_scratch,
 2667|  4.74k|        &(pstr_api_struct->pstr_aac_tabs), pstr_api_struct->config[ele_idx].element_type,
 2668|  4.74k|        pstr_api_struct->config[ele_idx].element_instance_tag, pstr_api_struct->pstr_state->aot);
 2669|  4.74k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (2669:9): [True: 0, False: 4.74k]
  ------------------
 2670|      0|      return error;
 2671|      0|    }
 2672|  4.74k|    if (error) {
  ------------------
  |  Branch (2672:9): [True: 0, False: 4.74k]
  ------------------
 2673|      0|      if (pstr_api_struct->pstr_mps_212_enc && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2673:11): [True: 0, False: 0]
  |  Branch (2673:48): [True: 0, False: 0]
  ------------------
 2674|      0|        ixheaace_mps_212_close(&(pstr_api_struct->pstr_mps_212_enc));
 2675|      0|      }
 2676|      0|      if (pstr_api_struct->pstr_mps_515_enc && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2676:11): [True: 0, False: 0]
  |  Branch (2676:48): [True: 0, False: 0]
  ------------------
 2677|      0|        ixheaace_mps_515_close(pstr_api_struct->pstr_mps_212_enc);
 2678|      0|      }
 2679|       |
 2680|      0|      return (IA_EXHEAACE_INIT_FATAL_AAC_INIT_FAILED);
 2681|      0|    }
 2682|  4.74k|  }
 2683|       |
 2684|  4.74k|  return error;
 2685|  4.74k|}
ixheaace_api.c:ia_usac_enc_init:
 1973|  4.20k|static IA_ERRORCODE ia_usac_enc_init(ixheaace_api_struct *pstr_api_struct, WORD32 ccfl_idx) {
 1974|  4.20k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.20k|#define IA_NO_ERROR 0x00000000
  ------------------
 1975|  4.20k|  WORD32 i = 0;
 1976|  4.20k|  ixheaace_config_struct *pstr_config = &pstr_api_struct->config[0];
 1977|  4.20k|  ixheaace_state_struct *pstr_enc_state = pstr_api_struct->pstr_state;
 1978|  4.20k|  ia_usac_data_struct *pstr_enc_data = &pstr_enc_state->str_usac_enc_data;
 1979|  4.20k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_config->usac_config;
 1980|       |
 1981|  4.20k|  pstr_usac_config->bit_rate = pstr_api_struct->config[0].aac_config.bit_rate;
 1982|       |
 1983|  4.20k|  if ((pstr_usac_config->codec_mode == USAC_SWITCHED) ||
  ------------------
  |  |   35|  4.20k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (1983:7): [True: 1.39k, False: 2.80k]
  ------------------
 1984|  4.08k|      (pstr_usac_config->codec_mode == USAC_ONLY_FD)) {
  ------------------
  |  |   36|  2.80k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (1984:7): [True: 2.69k, False: 116]
  ------------------
 1985|  4.08k|    pstr_usac_config->aac_allow_scalefacs = 1;
 1986|  4.08k|    if (pstr_usac_config->aac_scale_facs == 0) pstr_usac_config->aac_allow_scalefacs = 0;
  ------------------
  |  Branch (1986:9): [True: 4.08k, False: 0]
  ------------------
 1987|  4.08k|  }
 1988|       |
 1989|  4.20k|  if (pstr_usac_config->codec_mode == USAC_ONLY_TD) {
  ------------------
  |  |   37|  4.20k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (1989:7): [True: 116, False: 4.08k]
  ------------------
 1990|    308|    for (i = 0; i < pstr_config->i_channels; i++) {
  ------------------
  |  Branch (1990:17): [True: 192, False: 116]
  ------------------
 1991|    192|      pstr_enc_data->core_mode_prev[i] = CORE_MODE_FD;
  ------------------
  |  |   33|    192|#define CORE_MODE_FD (0)
  ------------------
 1992|    192|      pstr_enc_data->core_mode[i] = CORE_MODE_TD;
  ------------------
  |  |   34|    192|#define CORE_MODE_TD (1)
  ------------------
 1993|    192|    }
 1994|  4.08k|  } else {
 1995|  11.0k|    for (i = 0; i < pstr_config->i_channels; i++) {
  ------------------
  |  Branch (1995:17): [True: 6.92k, False: 4.08k]
  ------------------
 1996|  6.92k|      pstr_enc_data->core_mode_prev[i] = CORE_MODE_FD;
  ------------------
  |  |   33|  6.92k|#define CORE_MODE_FD (0)
  ------------------
 1997|  6.92k|      pstr_enc_data->core_mode[i] = CORE_MODE_FD;
  ------------------
  |  |   33|  6.92k|#define CORE_MODE_FD (0)
  ------------------
 1998|  6.92k|    }
 1999|  4.08k|  }
 2000|       |
 2001|  4.20k|  if (1 == pstr_usac_config->use_drc_element) {
  ------------------
  |  Branch (2001:7): [True: 1.47k, False: 2.73k]
  ------------------
 2002|  1.47k|    pstr_enc_data->str_scratch.drc_scratch = pstr_enc_data->str_scratch.ptr_scratch_buf;
 2003|  1.47k|  }
 2004|  4.20k|  if (pstr_usac_config->sbr_enable) {
  ------------------
  |  Branch (2004:7): [True: 2.96k, False: 1.23k]
  ------------------
 2005|  2.96k|    WORD8 *sbr_scr_ptr = (WORD8 *)pstr_enc_data->str_scratch.ptr_scratch_buf;
 2006|  2.96k|    ixheaace_audio_specific_config_struct *pstr_asc = &pstr_enc_state->audio_specific_config;
 2007|  2.96k|    ixheaace_str_sbr_cfg spectral_band_replication_config;
 2008|       |    // SBR defaults
 2009|  2.96k|    iaace_config *pstr_sbr_config = &(pstr_api_struct->config[0].aac_config);
 2010|  2.96k|    WORD32 sbr_ratio = 0;
 2011|  2.96k|    WORD32 samples = pstr_usac_config->ccfl;
 2012|       |    // Set scratch buffers for SBR and resampler
 2013|  2.96k|    pstr_api_struct->pstr_state->temp_buff_sbr =
 2014|  2.96k|        (WORD8 *)pstr_enc_data->str_scratch.ptr_scratch_buf;
 2015|  2.96k|    pstr_api_struct->pstr_state->ptr_temp_buff_resamp =
 2016|  2.96k|        (WORD8 *)pstr_enc_data->str_scratch.ptr_scratch_buf + ixheaace_sbr_enc_scr_size();
 2017|       |
 2018|  2.96k|    ixheaace_initialize_sbr_defaults(&spectral_band_replication_config);
 2019|       |    // Set SBR codec as USAC
 2020|  2.96k|    spectral_band_replication_config.sbr_codec = USAC_SBR;
 2021|  2.96k|    spectral_band_replication_config.sbr_pvc_active = pstr_usac_config->sbr_pvc_active;
 2022|  2.96k|    spectral_band_replication_config.sbr_harmonic = pstr_usac_config->sbr_harmonic;
 2023|  2.96k|    spectral_band_replication_config.hq_esbr = pstr_usac_config->hq_esbr;
 2024|  2.96k|    pstr_usac_config->core_sample_rate = pstr_usac_config->sample_rate / 2;
 2025|  2.96k|    switch (pstr_usac_config->ccfl_idx) {
 2026|    578|      case SBR_4_1:
  ------------------
  |  |  199|    578|#define SBR_4_1 (4)
  ------------------
  |  Branch (2026:7): [True: 578, False: 2.39k]
  ------------------
 2027|    578|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_INDEX_4_1;
  ------------------
  |  |  188|    578|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
 2028|    578|        spectral_band_replication_config.sbr_pvc_rate = USAC_SBR_DOWNSAMPLE_RATIO_4_1;
  ------------------
  |  |  191|    578|#define USAC_SBR_DOWNSAMPLE_RATIO_4_1 (4)
  ------------------
 2029|    578|        pstr_usac_config->core_sample_rate = pstr_usac_config->sample_rate / 4;
 2030|    578|        sbr_ratio = 4;
 2031|    578|        samples *= 4;
 2032|    578|        break;
 2033|    366|      case SBR_8_3:
  ------------------
  |  |  197|    366|#define SBR_8_3 (2)
  ------------------
  |  Branch (2033:7): [True: 366, False: 2.60k]
  ------------------
 2034|    366|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_INDEX_8_3;
  ------------------
  |  |  187|    366|#define USAC_SBR_RATIO_INDEX_8_3 (2)
  ------------------
 2035|    366|        spectral_band_replication_config.sbr_pvc_rate = USAC_SBR_DOWNSAMPLE_RATIO_2_1;
  ------------------
  |  |  190|    366|#define USAC_SBR_DOWNSAMPLE_RATIO_2_1 (2)
  ------------------
 2036|    366|        sbr_ratio = 2;
 2037|    366|        samples *= 8;
 2038|    366|        samples /= 3;
 2039|    366|        break;
 2040|  2.02k|      case SBR_2_1:
  ------------------
  |  |  198|  2.02k|#define SBR_2_1 (3)
  ------------------
  |  Branch (2040:7): [True: 2.02k, False: 944]
  ------------------
 2041|  2.02k|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_INDEX_2_1;
  ------------------
  |  |  186|  2.02k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
 2042|  2.02k|        spectral_band_replication_config.sbr_pvc_rate = USAC_SBR_DOWNSAMPLE_RATIO_2_1;
  ------------------
  |  |  190|  2.02k|#define USAC_SBR_DOWNSAMPLE_RATIO_2_1 (2)
  ------------------
 2043|  2.02k|        sbr_ratio = 2;
 2044|  2.02k|        samples *= 2;
 2045|  2.02k|        break;
 2046|      0|      default:
  ------------------
  |  Branch (2046:7): [True: 0, False: 2.96k]
  ------------------
 2047|      0|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_NO_SBR;
  ------------------
  |  |  185|      0|#define USAC_SBR_RATIO_NO_SBR (0)
  ------------------
 2048|      0|        spectral_band_replication_config.sbr_pvc_rate = 2;
 2049|      0|        sbr_ratio = 2;
 2050|      0|        break;
 2051|  2.96k|    }
 2052|  2.96k|    if (pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2052:9): [True: 1.15k, False: 1.81k]
  ------------------
 2053|  1.15k|      ixheaace_mps_212_memory_struct *pstr_mps_memory;
 2054|  1.15k|      pstr_mps_memory = pstr_api_struct->pstr_state->mps_pers_mem;
 2055|  1.15k|      ixheaace_mps_212_open(&pstr_api_struct->pstr_mps_212_enc, pstr_mps_memory);
 2056|  1.15k|      pstr_asc->str_aac_config.num_sac_cfg_bits = 0;
 2057|       |
 2058|  1.15k|      error = ixheaace_mps_212_initialise(
 2059|  1.15k|          pstr_api_struct->pstr_mps_212_enc, AOT_USAC, pstr_usac_config->sample_rate,
  ------------------
  |  |  142|  1.15k|#define AOT_USAC (42)
  ------------------
 2060|  1.15k|          &pstr_sbr_config->bit_rate, sbr_ratio, (WORD32)samples, samples, 515 * sbr_ratio,
 2061|  1.15k|          (WORD8 *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp);
 2062|  1.15k|      if (error) {
  ------------------
  |  Branch (2062:11): [True: 28, False: 1.12k]
  ------------------
 2063|     28|        return error;
 2064|     28|      }
 2065|       |
 2066|  1.12k|      pstr_asc->str_aac_config.num_sac_cfg_bits = ixheaace_mps_212_get_spatial_specific_config(
 2067|  1.12k|          pstr_api_struct->pstr_mps_212_enc, (WORD8 *)pstr_asc->str_aac_config.sac_cfg_data,
 2068|  1.12k|          sizeof(pstr_asc->str_aac_config.sac_cfg_data), AOT_USAC);
  ------------------
  |  |  142|  1.12k|#define AOT_USAC (42)
  ------------------
 2069|  1.12k|    }
 2070|  2.94k|    ixheaace_adjust_sbr_settings(
 2071|  2.94k|        &spectral_band_replication_config, pstr_sbr_config->bit_rate,
 2072|  2.94k|        (pstr_api_struct->pstr_state->mps_enable != 1) ? pstr_config->i_channels : 1,
  ------------------
  |  Branch (2072:9): [True: 1.81k, False: 1.12k]
  ------------------
 2073|  2.94k|        pstr_usac_config->core_sample_rate, AACENC_TRANS_FAC, 24000,
  ------------------
  |  |   23|  2.94k|#define AACENC_TRANS_FAC 8    /* encoder WORD16 long ratio */
  ------------------
 2074|  2.94k|        pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2075|  2.94k|        pstr_api_struct->pstr_state->aot, (pstr_api_struct->config[0].ccfl_idx == SBR_4_1));
  ------------------
  |  |  199|  2.94k|#define SBR_4_1 (4)
  ------------------
 2076|       |
 2077|  2.94k|    error = ixheaace_env_open(
 2078|  2.94k|        &pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[0],
 2079|  2.94k|        &spectral_band_replication_config, &pstr_sbr_config->band_width, sbr_scr_ptr,
 2080|  2.94k|        &(pstr_api_struct->spectral_band_replication_tabs), &pstr_asc->str_aac_config.sbr_config);
 2081|  2.94k|    if (error) {
  ------------------
  |  Branch (2081:9): [True: 10, False: 2.93k]
  ------------------
 2082|     10|      return error;
 2083|     10|    }
 2084|       |
 2085|  2.93k|    if (pstr_api_struct->config[0].ccfl_idx >= 2) {
  ------------------
  |  Branch (2085:9): [True: 2.93k, False: 0]
  ------------------
 2086|  2.93k|      pstr_api_struct->pstr_state->downsample[0] = 1;
 2087|  2.93k|    } else {
 2088|      0|      pstr_api_struct->pstr_state->downsample[0] = 0;
 2089|      0|    }
 2090|       |
 2091|  2.93k|    if (pstr_api_struct->pstr_state->downsample[0]) {
  ------------------
  |  Branch (2091:9): [True: 2.93k, False: 0]
  ------------------
 2092|  2.93k|      IA_ERRORCODE resamp_error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.93k|#define IA_NO_ERROR 0x00000000
  ------------------
 2093|  2.93k|      WORD32 resamp_ratio = 0, upsamp_fac = 0, downsamp_fac = 0;
 2094|  2.93k|      WORD32 ele_idx = 0, ch_idx = 0;
 2095|       |
 2096|  2.93k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  2.93k|#define SBR_8_3 (2)
  ------------------
  |  Branch (2096:11): [True: 366, False: 2.56k]
  ------------------
 2097|    366|        upsamp_fac = 3;
 2098|    366|        downsamp_fac = 8;
 2099|    366|        pstr_usac_config->sample_rate /= 2;
 2100|  2.56k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1) {
  ------------------
  |  |  198|  2.56k|#define SBR_2_1 (3)
  ------------------
  |  Branch (2100:18): [True: 1.98k, False: 575]
  ------------------
 2101|  1.98k|        resamp_ratio = 2;
 2102|  1.98k|        pstr_usac_config->sample_rate /= 2;
 2103|  1.98k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|    575|#define SBR_4_1 (4)
  ------------------
  |  Branch (2103:18): [True: 575, False: 0]
  ------------------
 2104|    575|        resamp_ratio = 4;
 2105|    575|        pstr_usac_config->sample_rate /= 4;
 2106|    575|      }
 2107|       |
 2108|  2.93k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  2.93k|#define SBR_8_3 (2)
  ------------------
  |  Branch (2108:11): [True: 366, False: 2.56k]
  ------------------
 2109|    366|        if (upsamp_fac != 3 || downsamp_fac != 8) {
  ------------------
  |  Branch (2109:13): [True: 0, False: 366]
  |  Branch (2109:32): [True: 0, False: 366]
  ------------------
 2110|      0|          return IA_EXHEAACE_CONFIG_FATAL_USAC_RESAMPLER_RATIO;
 2111|      0|        }
 2112|  2.56k|      } else {
 2113|  2.56k|        if (resamp_ratio != 2 && resamp_ratio != 4) {
  ------------------
  |  Branch (2113:13): [True: 575, False: 1.98k]
  |  Branch (2113:34): [True: 0, False: 575]
  ------------------
 2114|      0|          return IA_EXHEAACE_CONFIG_FATAL_USAC_RESAMPLER_RATIO;
 2115|      0|        }
 2116|  2.56k|      }
 2117|  2.93k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {  // Upsampler initialization
  ------------------
  |  |  197|  2.93k|#define SBR_8_3 (2)
  ------------------
  |  Branch (2117:11): [True: 366, False: 2.56k]
  ------------------
 2118|    366|        resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2119|    366|            &(pstr_api_struct->pstr_state->up_sampler[ele_idx][ch_idx]), upsamp_fac,
 2120|    366|            pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab);
 2121|    366|        if (resamp_error) {
  ------------------
  |  Branch (2121:13): [True: 0, False: 366]
  ------------------
 2122|      0|          return resamp_error;
 2123|      0|        }
 2124|    366|        if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2124:13): [True: 173, False: 193]
  ------------------
 2125|    173|          resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2126|    173|              &(pstr_api_struct->pstr_state->up_sampler[ele_idx][ch_idx + 1]), upsamp_fac,
 2127|    173|              pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab);
 2128|    173|          if (resamp_error) {
  ------------------
  |  Branch (2128:15): [True: 0, False: 173]
  ------------------
 2129|      0|            return resamp_error;
 2130|      0|          }
 2131|    173|        }
 2132|    366|        if (pstr_usac_config->sbr_harmonic) {
  ------------------
  |  Branch (2132:13): [True: 0, False: 366]
  ------------------
 2133|      0|          resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2134|      0|              &(pstr_api_struct->pstr_state->hbe_up_sampler[ele_idx][ch_idx]), upsamp_fac,
 2135|      0|              pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab);
 2136|      0|          if (resamp_error) {
  ------------------
  |  Branch (2136:15): [True: 0, False: 0]
  ------------------
 2137|      0|            return resamp_error;
 2138|      0|          }
 2139|      0|          if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2139:15): [True: 0, False: 0]
  ------------------
 2140|      0|            resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2141|      0|                &(pstr_api_struct->pstr_state->hbe_up_sampler[ele_idx][ch_idx + 1]), upsamp_fac,
 2142|      0|                pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab);
 2143|      0|            if (resamp_error) {
  ------------------
  |  Branch (2143:17): [True: 0, False: 0]
  ------------------
 2144|      0|              return resamp_error;
 2145|      0|            }
 2146|      0|          }
 2147|      0|        }
 2148|       |        // Downsampler initialization
 2149|    366|        resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2150|    366|            &(pstr_api_struct->pstr_state->down_samp_sos[ele_idx][ch_idx]), downsamp_fac,
 2151|    366|            pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab);
 2152|    366|        if (resamp_error) {
  ------------------
  |  Branch (2152:13): [True: 0, False: 366]
  ------------------
 2153|      0|          return resamp_error;
 2154|      0|        }
 2155|    366|        if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2155:13): [True: 173, False: 193]
  ------------------
 2156|    173|          resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2157|    173|              &(pstr_api_struct->pstr_state->down_samp_sos[ele_idx][ch_idx + 1]), downsamp_fac,
 2158|    173|              pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab);
 2159|    173|          if (resamp_error) {
  ------------------
  |  Branch (2159:15): [True: 0, False: 173]
  ------------------
 2160|      0|            return resamp_error;
 2161|      0|          }
 2162|    173|        }
 2163|    366|        if (pstr_usac_config->sbr_harmonic) {
  ------------------
  |  Branch (2163:13): [True: 0, False: 366]
  ------------------
 2164|      0|          resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2165|      0|              &(pstr_api_struct->pstr_state->hbe_down_samp_sos[ele_idx][ch_idx]), downsamp_fac,
 2166|      0|              pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab);
 2167|      0|          if (resamp_error) {
  ------------------
  |  Branch (2167:15): [True: 0, False: 0]
  ------------------
 2168|      0|            return resamp_error;
 2169|      0|          }
 2170|      0|          if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2170:15): [True: 0, False: 0]
  ------------------
 2171|      0|            resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2172|      0|                &(pstr_api_struct->pstr_state->hbe_down_samp_sos[ele_idx][ch_idx + 1]),
 2173|      0|                downsamp_fac,
 2174|      0|                pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab);
 2175|      0|            if (resamp_error) {
  ------------------
  |  Branch (2175:17): [True: 0, False: 0]
  ------------------
 2176|      0|              return resamp_error;
 2177|      0|            }
 2178|      0|          }
 2179|      0|        }
 2180|  2.56k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1 ||
  ------------------
  |  |  198|  5.12k|#define SBR_2_1 (3)
  ------------------
  |  Branch (2180:18): [True: 1.98k, False: 575]
  ------------------
 2181|  2.56k|                 pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|    575|#define SBR_4_1 (4)
  ------------------
  |  Branch (2181:18): [True: 575, False: 0]
  ------------------
 2182|  2.56k|        resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2183|  2.56k|            &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx]), resamp_ratio,
 2184|  2.56k|            pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2185|  2.56k|        if (resamp_error) {
  ------------------
  |  Branch (2185:13): [True: 0, False: 2.56k]
  ------------------
 2186|      0|          return resamp_error;
 2187|      0|        }
 2188|  2.56k|        if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2188:13): [True: 2.00k, False: 563]
  ------------------
 2189|  2.00k|          resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2190|  2.00k|              &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx + 1]), resamp_ratio,
 2191|  2.00k|              pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2192|  2.00k|          if (resamp_error) {
  ------------------
  |  Branch (2192:15): [True: 0, False: 2.00k]
  ------------------
 2193|      0|            return resamp_error;
 2194|      0|          }
 2195|  2.00k|        }
 2196|  2.56k|        if (pstr_usac_config->sbr_harmonic) {
  ------------------
  |  Branch (2196:13): [True: 1.47k, False: 1.09k]
  ------------------
 2197|  1.47k|          resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2198|  1.47k|              &(pstr_api_struct->pstr_state->hbe_down_sampler[ele_idx][ch_idx]), resamp_ratio,
 2199|  1.47k|              pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2200|  1.47k|          if (resamp_error) {
  ------------------
  |  Branch (2200:15): [True: 0, False: 1.47k]
  ------------------
 2201|      0|            return resamp_error;
 2202|      0|          }
 2203|  1.47k|          if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2203:15): [True: 1.35k, False: 114]
  ------------------
 2204|  1.35k|            resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2205|  1.35k|                &(pstr_api_struct->pstr_state->hbe_down_sampler[ele_idx][ch_idx + 1]),
 2206|  1.35k|                resamp_ratio, pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2207|  1.35k|            if (resamp_error) {
  ------------------
  |  Branch (2207:17): [True: 0, False: 1.35k]
  ------------------
 2208|      0|              return resamp_error;
 2209|      0|            }
 2210|  1.35k|          }
 2211|  1.47k|        }
 2212|  2.56k|      }
 2213|  2.93k|    }
 2214|  2.93k|  }
 2215|       |
 2216|  4.16k|  error = iusace_enc_init(pstr_usac_config, &pstr_api_struct->pstr_state->audio_specific_config,
 2217|  4.16k|                          &pstr_api_struct->pstr_state->str_usac_enc_data);
 2218|  4.16k|  if (error & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  4.16k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2218:7): [True: 809, False: 3.35k]
  ------------------
 2219|    809|    return error;
 2220|    809|  }
 2221|  3.35k|  pstr_api_struct->pstr_state->str_usac_enc_data.frame_count = 0;
 2222|  3.35k|  pstr_usac_config->is_ipf = 1;
 2223|  3.35k|  pstr_enc_data->stereo_config_index = (pstr_enc_state->mps_enable == 1) ? 2 : 0;
  ------------------
  |  Branch (2223:40): [True: 934, False: 2.42k]
  ------------------
 2224|  3.35k|  ia_bit_buf_struct *pstr_ia_asc_bit_buf;
 2225|  3.35k|  pstr_ia_asc_bit_buf = iusace_create_bit_buffer(
 2226|  3.35k|      &(pstr_api_struct->pstr_state->str_bit_buf), pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT],
  ------------------
  |  |   26|  3.35k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 2227|  3.35k|      pstr_api_struct->pstr_mem_info[IA_MEMTYPE_OUTPUT].ui_size, 1);
  ------------------
  |  |   26|  3.35k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 2228|  3.35k|  if (pstr_usac_config->sbr_enable) {
  ------------------
  |  Branch (2228:7): [True: 2.38k, False: 973]
  ------------------
 2229|  10.0k|    for (UWORD32 idx = 0; idx < pstr_usac_config->num_elements; idx++) {
  ------------------
  |  Branch (2229:27): [True: 7.63k, False: 2.38k]
  ------------------
 2230|  7.63k|      switch (pstr_enc_state->audio_specific_config.str_usac_config.usac_element_type[idx]) {
 2231|    605|        case ID_USAC_SCE:
  ------------------
  |  |  137|    605|#define ID_USAC_SCE 0
  ------------------
  |  Branch (2231:9): [True: 605, False: 7.02k]
  ------------------
 2232|  2.38k|        case ID_USAC_CPE:
  ------------------
  |  |  138|  2.38k|#define ID_USAC_CPE 1
  ------------------
  |  Branch (2232:9): [True: 1.78k, False: 5.85k]
  ------------------
 2233|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2234|  2.38k|              .stereo_config_index = pstr_enc_data->stereo_config_index;
 2235|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2236|  2.38k|              .str_usac_sbr_config.bs_inter_tes = pstr_usac_config->sbr_inter_tes_active;
 2237|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2238|  2.38k|              .str_usac_sbr_config.bs_pvc = pstr_usac_config->sbr_pvc_active;
 2239|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2240|  2.38k|              .str_usac_sbr_config.dflt_header_extra1 = 0;
 2241|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2242|  2.38k|              .str_usac_sbr_config.dflt_header_extra2 = 0;
 2243|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2244|  2.38k|              .str_usac_sbr_config.dflt_start_freq = 0;
 2245|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2246|  2.38k|              .str_usac_sbr_config.dflt_stop_freq = 4;
 2247|  2.38k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2248|  2.38k|              .str_usac_sbr_config.harmonic_sbr = pstr_usac_config->sbr_harmonic;
 2249|  2.38k|          break;
 2250|  5.24k|        default:
  ------------------
  |  Branch (2250:9): [True: 5.24k, False: 2.38k]
  ------------------
 2251|  5.24k|          continue;
 2252|  7.63k|      }
 2253|  7.63k|    }
 2254|  2.38k|  }
 2255|       |
 2256|  3.35k|  ixheaace_get_audiospecific_config_bytes(pstr_ia_asc_bit_buf,
 2257|  3.35k|                                          &pstr_api_struct->pstr_state->audio_specific_config,
 2258|  3.35k|                                          AOT_USAC, ccfl_idx);
  ------------------
  |  |  142|  3.35k|#define AOT_USAC (42)
  ------------------
 2259|  3.35k|  pstr_api_struct->pstr_state->i_out_bytes = (pstr_ia_asc_bit_buf->cnt_bits + 7) >> 3;
 2260|       |
 2261|  3.35k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  3.35k|#define IA_NO_ERROR 0x00000000
  ------------------
 2262|  3.35k|}
ixheaace_api.c:ia_enhaacplus_enc_execute:
 2688|   309k|                                              WORD32 ele_idx) {
 2689|   309k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   309k|#define IA_NO_ERROR 0x00000000
  ------------------
 2690|   309k|  WORD32 downsample;
 2691|   309k|  WORD32 aot;
 2692|   309k|  WORD32 idx;
 2693|   309k|  WORD32 header_bytes = 0;
 2694|   309k|  WORD32 num_samples_read;
 2695|   309k|  WORD32 env_read_offset = 0;
 2696|   309k|  WORD32 write_off_set = 0;
 2697|   309k|  WORD32 aacenc_blocksize;
 2698|   309k|  WORD32 ch, out_samples;
 2699|   309k|  WORD32 total_channels = 0, ele, slot;
 2700|   309k|  WORD32 time_in_stride;
 2701|   309k|  WORD32 num_bs_elements;
 2702|   309k|  FLAG flag_last_element;
 2703|   309k|  WORD32 i_num_coup_channels;
 2704|   309k|  WORD32 i_channels_mask;
 2705|   309k|  ixheaace_pstr_sbr_enc pstr_sbr_encoder = NULL;
 2706|   309k|  iexheaac_encoder_str **pstr_aac_enc;
 2707|   309k|  iaace_config *pstr_aac_config;
 2708|   309k|  pWORD16 pw_inp_buf = NULL;
 2709|   309k|  pUWORD8 pub_out_buf = NULL;
 2710|   309k|  FLOAT32 *ptr_input_buffer = NULL;
 2711|   309k|  FLOAT32 *ptr_input_buffer_mps = NULL;
 2712|   309k|  FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 2713|   309k|  WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   309k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2714|   309k|  WORD32 *pstr_aac_scratch = (pWORD32)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|   309k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2715|   309k|  WORD8 *ptr_spectral_band_replication_scratch =
 2716|   309k|      ((pWORD8)pstr_aac_scratch) + ia_enhaacplus_enc_aac_enc_scr_size();
 2717|   309k|  WORD32 *total_fill_bits = &(pstr_api_struct->pstr_state->total_fill_bits);
 2718|   309k|  WORD32 *write_program_config_element =
 2719|   309k|      &(pstr_api_struct->config[0].write_program_config_element);
 2720|       |
 2721|   309k|  aot = pstr_api_struct->pstr_state->aot;
 2722|   309k|  num_bs_elements = pstr_api_struct->config[0].num_bs_elements;
 2723|   309k|  flag_last_element = (ele_idx == (num_bs_elements - 1));
 2724|   309k|  i_num_coup_channels = pstr_api_struct->config[0].i_num_coupling_chan;
 2725|   309k|  i_channels_mask = pstr_api_struct->config[0].i_channels_mask;
 2726|   309k|  aacenc_blocksize = pstr_api_struct->config[0].frame_length;
 2727|   309k|  downsample = pstr_api_struct->pstr_state->downsample[ele_idx];
 2728|   309k|  num_samples_read =
 2729|   309k|      aacenc_blocksize * pstr_api_struct->config[ele_idx].i_native_channels * (1 << downsample);
 2730|  1.12M|  for (ele = 0; ele < num_bs_elements; ele++) {
  ------------------
  |  Branch (2730:17): [True: 810k, False: 309k]
  ------------------
 2731|   810k|    total_channels += pstr_api_struct->config[ele].i_native_channels;
 2732|   810k|  }
 2733|   309k|  pstr_aac_config = &(pstr_api_struct->config[ele_idx].aac_config);
 2734|   309k|  if ((pstr_api_struct->config[ele_idx].aac_classic == 0) &&
  ------------------
  |  Branch (2734:7): [True: 225k, False: 84.4k]
  ------------------
 2735|   225k|      pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2735:7): [True: 19.7k, False: 205k]
  ------------------
 2736|  19.7k|    time_in_stride = 1;
 2737|   290k|  } else if ((pstr_api_struct->config[ele_idx].aac_classic == 1) &&
  ------------------
  |  Branch (2737:14): [True: 84.4k, False: 205k]
  ------------------
 2738|  84.4k|             (pstr_api_struct->config[ele_idx].num_bs_elements == 1)) {
  ------------------
  |  Branch (2738:14): [True: 9.36k, False: 75.0k]
  ------------------
 2739|  9.36k|    time_in_stride = pstr_aac_config->num_out_channels;
 2740|   280k|  } else {
 2741|   280k|    time_in_stride = IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   280k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2742|   280k|  }
 2743|   309k|  pstr_aac_enc = pstr_api_struct->pstr_state->aac_enc_pers_mem;
 2744|       |
 2745|   309k|  pw_inp_buf = (pWORD16)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_INPUT_IDX];
  ------------------
  |  |   31|   309k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
 2746|   309k|  if (ele_idx == 0) {
  ------------------
  |  Branch (2746:7): [True: 162k, False: 147k]
  ------------------
 2747|   162k|    pstr_api_struct->pstr_state->i_out_bytes = 0;
 2748|   162k|    pub_out_buf = ((pUWORD8)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_OUTPUT_IDX]);
  ------------------
  |  |   32|   162k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 2749|   162k|    *total_fill_bits = 0;
 2750|   162k|  }
 2751|       |
 2752|   309k|  if (pstr_api_struct->config->adts_flag) {
  ------------------
  |  Branch (2752:7): [True: 78.9k, False: 230k]
  ------------------
 2753|  78.9k|    pub_out_buf = (pUWORD8)(pub_out_buf + 7);
 2754|  78.9k|  }
 2755|       |
 2756|   929k|  for (ch = 0; ch < IXHEAACE_MAX_CH_IN_BS_ELE; ch++)
  ------------------
  |  |   22|   929k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (2756:16): [True: 619k, False: 309k]
  ------------------
 2757|   619k|    pstr_api_struct->pstr_state->num_anc_data_bytes[ele_idx][ch] = 0;
 2758|       |
 2759|   309k|  if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|   619k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   184k|#define AOT_PS (29)
  ------------------
  |  Branch (2759:7): [True: 125k, False: 184k]
  |  Branch (2759:25): [True: 19.7k, False: 164k]
  ------------------
 2760|   145k|    write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  132|   145k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|   145k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
                  write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   145k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2761|   164k|  } else if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable != 1) {
  ------------------
  |  |   37|   329k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2761:14): [True: 80.1k, False: 84.4k]
  |  Branch (2761:36): [True: 45.9k, False: 34.2k]
  ------------------
 2762|  45.9k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small)
  ------------------
  |  Branch (2762:9): [True: 17.5k, False: 28.4k]
  ------------------
 2763|  17.5k|      write_off_set = INPUT_DELAY_ELD_480 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  144|  17.5k|#define INPUT_DELAY_ELD_480 ((CORE_DELAY_LD_480 / 2) * 2 + 0 - (15 * 64) + 576)
  |  |  ------------------
  |  |  |  |  141|  17.5k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELD_480 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  17.5k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2764|  28.4k|    else
 2765|  28.4k|      write_off_set = INPUT_DELAY_ELD_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  136|  28.4k|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|  28.4k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELD_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  28.4k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2766|   118k|  } else if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable == 1 &&
  ------------------
  |  |   37|   237k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2766:14): [True: 34.2k, False: 84.4k]
  |  Branch (2766:36): [True: 34.2k, False: 0]
  ------------------
 2767|  34.2k|             pstr_api_struct->pstr_state->mps_tree_config == TREE_212) {
  ------------------
  |  |   39|  34.2k|#define TREE_212 (0)
  ------------------
  |  Branch (2767:14): [True: 12.2k, False: 21.9k]
  ------------------
 2768|  12.2k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small)
  ------------------
  |  Branch (2768:9): [True: 7.53k, False: 4.68k]
  ------------------
 2769|  7.53k|      write_off_set = INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  147|  7.53k|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|  7.53k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  7.53k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2770|  4.68k|    else
 2771|  4.68k|      write_off_set = INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  139|  4.68k|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|  4.68k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  4.68k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2772|   106k|  } else if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable == 1 &&
  ------------------
  |  |   37|   212k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2772:14): [True: 21.9k, False: 84.4k]
  |  Branch (2772:36): [True: 21.9k, False: 0]
  ------------------
 2773|  21.9k|             pstr_api_struct->pstr_state->mps_tree_config != TREE_212) {
  ------------------
  |  |   39|  21.9k|#define TREE_212 (0)
  ------------------
  |  Branch (2773:14): [True: 21.9k, False: 0]
  ------------------
 2774|  21.9k|    write_off_set = INPUT_DELAY_ELD_512_MPS * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  138|  21.9k|#define INPUT_DELAY_ELD_512_MPS ((CORE_DELAY_LD_512)*2 + 1)
  |  |  ------------------
  |  |  |  |  133|  21.9k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                  write_off_set = INPUT_DELAY_ELD_512_MPS * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  21.9k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2775|  21.9k|  }
 2776|   309k|  if (pstr_api_struct->config[ele_idx].aac_classic == 1) {
  ------------------
  |  Branch (2776:7): [True: 84.4k, False: 225k]
  ------------------
 2777|  84.4k|    write_off_set = 0;
 2778|  84.4k|  }
 2779|   309k|  if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  |   37|   619k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2779:7): [True: 80.1k, False: 229k]
  |  Branch (2779:29): [True: 34.2k, False: 45.9k]
  ------------------
 2780|  34.2k|    if (pstr_api_struct->pstr_state->mps_tree_config == TREE_212) {
  ------------------
  |  |   39|  34.2k|#define TREE_212 (0)
  ------------------
  |  Branch (2780:9): [True: 12.2k, False: 21.9k]
  ------------------
 2781|  12.2k|      env_read_offset = INPUT_DELAY_ELD_512_MPS;
  ------------------
  |  |  138|  12.2k|#define INPUT_DELAY_ELD_512_MPS ((CORE_DELAY_LD_512)*2 + 1)
  |  |  ------------------
  |  |  |  |  133|  12.2k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2782|  21.9k|    } else {
 2783|  21.9k|      env_read_offset = write_off_set;
 2784|  21.9k|    }
 2785|  34.2k|  }
 2786|   309k|  if (pstr_api_struct->pstr_state->downsample[ele_idx]) {
  ------------------
  |  Branch (2786:7): [True: 225k, False: 84.4k]
  ------------------
 2787|   225k|    if (!pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2787:9): [True: 205k, False: 19.7k]
  ------------------
 2788|   205k|      if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable != 1) {
  ------------------
  |  |   37|   411k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2788:11): [True: 80.1k, False: 125k]
  |  Branch (2788:33): [True: 45.9k, False: 34.2k]
  ------------------
 2789|  45.9k|        write_off_set +=
 2790|  45.9k|            4 * IXHEAACE_MAX_CH_IN_BS_ELE;  // Downsampler delay = 4 samples per channel @input SR
  ------------------
  |  |   22|  45.9k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2791|   159k|      } else {
 2792|   159k|        write_off_set += (pstr_api_struct->pstr_state->down_sampler[ele_idx][0].delay) *
 2793|   159k|                         IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   159k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2794|   159k|      }
 2795|   205k|    }
 2796|   225k|    if (pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2796:9): [True: 19.7k, False: 205k]
  ------------------
 2797|  19.7k|      env_read_offset = (MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  155|  19.7k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    env_read_offset = (MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  152|  19.7k|#define INPUT_DELAY ((CORE_DELAY)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  148|  19.7k|#define CORE_DELAY (1600)
  |  |  ------------------
  ------------------
                    env_read_offset = (MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  19.7k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2798|  19.7k|      write_off_set = env_read_offset;
 2799|  19.7k|    }
 2800|   225k|  }
 2801|       |
 2802|   309k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   619k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|   560k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   125k|#define AOT_PS (29)
  ------------------
  |  Branch (2802:7): [True: 59.0k, False: 250k]
  |  Branch (2802:28): [True: 125k, False: 125k]
  |  Branch (2802:46): [True: 19.7k, False: 105k]
  ------------------
 2803|   204k|    ptr_input_buffer = pstr_api_struct->pstr_state->inp_delay +
 2804|   204k|                       (aacenc_blocksize * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|   204k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                                     (aacenc_blocksize * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|   204k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|   204k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
 2805|   204k|                           IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|   204k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2806|   204k|  } else if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|   105k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2806:14): [True: 25.4k, False: 80.1k]
  ------------------
 2807|  25.4k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (2807:9): [True: 10.3k, False: 15.0k]
  ------------------
 2808|  10.3k|      ptr_input_buffer = pstr_api_struct->pstr_state->inp_delay +
 2809|  10.3k|                         (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |   93|  10.3k|#define FRAME_LEN_480 480
  ------------------
                                       (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |  155|  10.3k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                                       (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |  142|  10.3k|#define INPUT_DELAY_LD_480 ((CORE_DELAY_LD_480)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  141|  10.3k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2810|  10.3k|                             IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  10.3k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2811|  15.0k|    } else {
 2812|  15.0k|      ptr_input_buffer = pstr_api_struct->pstr_state->inp_delay +
 2813|  15.0k|                         (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |   92|  15.0k|#define FRAME_LEN_512 512
  ------------------
                                       (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |  155|  15.0k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                                       (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |  134|  15.0k|#define INPUT_DELAY_LD_512 ((CORE_DELAY_LD_512)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  133|  15.0k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2814|  15.0k|                             IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  15.0k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2815|  15.0k|    }
 2816|  80.1k|  } else if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  80.1k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2816:14): [True: 80.1k, False: 0]
  ------------------
 2817|  80.1k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (2817:9): [True: 36.0k, False: 44.1k]
  ------------------
 2818|  36.0k|      if (pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  Branch (2818:11): [True: 18.5k, False: 17.5k]
  ------------------
 2819|  18.5k|        ptr_input_buffer =
 2820|  18.5k|            pstr_api_struct->pstr_state->inp_delay +
 2821|  18.5k|            (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |   93|  18.5k|#define FRAME_LEN_480 480
  ------------------
                          (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |  155|  18.5k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |  147|  18.5k|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|  18.5k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2822|  18.5k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  18.5k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2823|  18.5k|      } else {
 2824|  17.5k|        ptr_input_buffer =
 2825|  17.5k|            pstr_api_struct->pstr_state->inp_delay +
 2826|  17.5k|            (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_480) *
  ------------------
  |  |   93|  17.5k|#define FRAME_LEN_480 480
  ------------------
                          (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_480) *
  ------------------
  |  |  155|  17.5k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_480) *
  ------------------
  |  |  144|  17.5k|#define INPUT_DELAY_ELD_480 ((CORE_DELAY_LD_480 / 2) * 2 + 0 - (15 * 64) + 576)
  |  |  ------------------
  |  |  |  |  141|  17.5k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2827|  17.5k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  17.5k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2828|  17.5k|      }
 2829|  44.1k|    } else {
 2830|  44.1k|      if (pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  Branch (2830:11): [True: 15.6k, False: 28.4k]
  ------------------
 2831|  15.6k|        ptr_input_buffer =
 2832|  15.6k|            pstr_api_struct->pstr_state->inp_delay +
 2833|  15.6k|            (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |   92|  15.6k|#define FRAME_LEN_512 512
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |  155|  15.6k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |  139|  15.6k|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|  15.6k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2834|  15.6k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  15.6k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2835|  28.4k|      } else {
 2836|  28.4k|        ptr_input_buffer =
 2837|  28.4k|            pstr_api_struct->pstr_state->inp_delay +
 2838|  28.4k|            (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_512) *
  ------------------
  |  |   92|  28.4k|#define FRAME_LEN_512 512
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_512) *
  ------------------
  |  |  155|  28.4k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_512) *
  ------------------
  |  |  136|  28.4k|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|  28.4k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2839|  28.4k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  28.4k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2840|  28.4k|      }
 2841|  44.1k|    }
 2842|  80.1k|  } else {
 2843|      0|    return IA_EXHEAACE_EXE_FATAL_UNSUPPORTED_AOT;
 2844|      0|  }
 2845|       |
 2846|   309k|  if (aot != AOT_AAC_LD && aot != AOT_AAC_LC) {
  ------------------
  |  |   36|   619k|#define AOT_AAC_LD (23)
  ------------------
                if (aot != AOT_AAC_LD && aot != AOT_AAC_LC) {
  ------------------
  |  |   34|   284k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2846:7): [True: 284k, False: 25.4k]
  |  Branch (2846:28): [True: 225k, False: 59.0k]
  ------------------
 2847|   225k|    pstr_sbr_encoder =
 2848|   225k|        pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[ele_idx];
 2849|   225k|    if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (2849:9): [True: 212k, False: 12.7k]
  ------------------
 2850|   212k|      ixheaace_sbr_set_scratch_ptr(pstr_sbr_encoder, ptr_spectral_band_replication_scratch);
 2851|   212k|    }
 2852|   225k|  }
 2853|       |
 2854|   309k|  {
 2855|   309k|    ixheaace_mps_enc_ext_payload mps_extension_payload;
 2856|   309k|    UWORD8 *mps_bs = pstr_api_struct->pstr_state->mps_bs;
 2857|   309k|    memset(&mps_extension_payload, 0, sizeof(ixheaace_mps_enc_ext_payload));
 2858|   309k|    mps_extension_payload.p_data = mps_bs;
 2859|       |
 2860|   309k|    if ((pstr_api_struct->config[ele_idx].num_bs_elements == 1) &&
  ------------------
  |  Branch (2860:9): [True: 77.8k, False: 232k]
  ------------------
 2861|  77.8k|        (pstr_api_struct->config[ele_idx].i_channels <= 2)) {
  ------------------
  |  Branch (2861:9): [True: 55.8k, False: 21.9k]
  ------------------
 2862|  55.8k|      if (pstr_api_struct->config[ele_idx].aac_classic != 1) {
  ------------------
  |  Branch (2862:11): [True: 46.4k, False: 9.36k]
  ------------------
 2863|  46.4k|        if ((pstr_api_struct->config[ele_idx].i_channels == 2 &&
  ------------------
  |  Branch (2863:14): [True: 41.4k, False: 5.01k]
  ------------------
 2864|  41.4k|             pstr_api_struct->config[ele_idx].chmode_nchannels == 2) &&
  ------------------
  |  Branch (2864:14): [True: 41.4k, False: 0]
  ------------------
 2865|  41.4k|            (!((pstr_api_struct->pstr_mps_212_enc != NULL) &&
  ------------------
  |  Branch (2865:16): [True: 12.2k, False: 29.2k]
  ------------------
 2866|  29.2k|               pstr_api_struct->pstr_state->mps_enable))) {
  ------------------
  |  Branch (2866:16): [True: 12.2k, False: 0]
  ------------------
 2867|   101M|          for (idx = 0; idx < (num_samples_read); idx++) {
  ------------------
  |  Branch (2867:25): [True: 101M, False: 29.2k]
  ------------------
 2868|   101M|            ptr_input_buffer[write_off_set + idx] = (FLOAT32)pw_inp_buf[idx];
 2869|   101M|          }
 2870|  29.2k|        } else if (pstr_api_struct->config[ele_idx].i_channels == 1) {
  ------------------
  |  Branch (2870:20): [True: 5.01k, False: 12.2k]
  ------------------
 2871|  9.67M|          for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2871:25): [True: 9.66M, False: 5.01k]
  ------------------
 2872|  9.66M|            ptr_input_buffer[write_off_set + (IXHEAACE_MAX_CH_IN_BS_ELE * idx)] =
  ------------------
  |  |   22|  9.66M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2873|  9.66M|                (FLOAT32)pw_inp_buf[idx];
 2874|  9.66M|          }
 2875|  12.2k|        } else if ((pstr_api_struct->pstr_mps_212_enc != NULL) &&
  ------------------
  |  Branch (2875:20): [True: 12.2k, False: 0]
  ------------------
 2876|  12.2k|                   pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2876:20): [True: 12.2k, False: 0]
  ------------------
 2877|  12.2k|          ptr_input_buffer_mps = pstr_api_struct->pstr_state->time_signal_mps;
 2878|  12.0M|          for (idx = 0; idx < (num_samples_read / 2); idx++) {
  ------------------
  |  Branch (2878:25): [True: 12.0M, False: 12.2k]
  ------------------
 2879|  12.0M|            ptr_input_buffer_mps[idx] = (FLOAT32)pw_inp_buf[2 * idx];
 2880|  12.0M|            ptr_input_buffer_mps[(num_samples_read / 2) + idx] =
 2881|  12.0M|                (FLOAT32)pw_inp_buf[(2 * idx) + 1];
 2882|  12.0M|          }
 2883|  12.2k|        }
 2884|  46.4k|      } else {
 2885|  10.5M|        for (idx = 0; idx < (num_samples_read + write_off_set); idx++) {
  ------------------
  |  Branch (2885:23): [True: 10.5M, False: 9.36k]
  ------------------
 2886|  10.5M|          ptr_input_buffer[idx] = (FLOAT32)pw_inp_buf[idx];
 2887|  10.5M|        }
 2888|  9.36k|      }
 2889|   254k|    } else {
 2890|   254k|      if (pstr_api_struct->config[ele_idx].i_channels == 2) {
  ------------------
  |  Branch (2890:11): [True: 115k, False: 138k]
  ------------------
 2891|   115k|        slot = pstr_api_struct->config[ele_idx].element_slot;
 2892|   167M|        for (idx = 0; idx < num_samples_read / 2; idx++) {
  ------------------
  |  Branch (2892:23): [True: 167M, False: 115k]
  ------------------
 2893|   167M|          ptr_input_buffer[2 * idx + write_off_set] =
 2894|   167M|              (FLOAT32)pw_inp_buf[total_channels * idx + slot];
 2895|   167M|          ptr_input_buffer[2 * idx + write_off_set + 1] =
 2896|   167M|              (FLOAT32)pw_inp_buf[total_channels * idx + slot + 1];
 2897|   167M|        }
 2898|   115k|      }
 2899|       |
 2900|   254k|      if (pstr_api_struct->config[ele_idx].i_channels == 1) {
  ------------------
  |  Branch (2900:11): [True: 116k, False: 137k]
  ------------------
 2901|   116k|        slot = pstr_api_struct->config[ele_idx].element_slot;
 2902|   172M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2902:23): [True: 172M, False: 116k]
  ------------------
 2903|   172M|          ptr_input_buffer[write_off_set + (IXHEAACE_MAX_CH_IN_BS_ELE * idx)] =
  ------------------
  |  |   22|   172M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2904|   172M|              (FLOAT32)pw_inp_buf[total_channels * idx + slot];
 2905|   172M|        }
 2906|   116k|      }
 2907|       |
 2908|   254k|      if (pstr_api_struct->config[ele_idx].i_channels == 6) {
  ------------------
  |  Branch (2908:11): [True: 21.9k, False: 232k]
  ------------------
 2909|  21.9k|        ptr_input_buffer_mps = pstr_api_struct->pstr_state->time_signal_mps;
 2910|   130M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2910:23): [True: 130M, False: 21.9k]
  ------------------
 2911|   130M|          ptr_input_buffer_mps[idx] = (FLOAT32)pw_inp_buf[idx];
 2912|   130M|        }
 2913|  21.9k|      }
 2914|   254k|    }
 2915|       |
 2916|   309k|    if ((pstr_api_struct->pstr_mps_212_enc != NULL) && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2916:9): [True: 12.2k, False: 297k]
  |  Branch (2916:56): [True: 12.2k, False: 0]
  ------------------
 2917|  12.2k|      ptr_input_buffer_mps = pstr_api_struct->pstr_state->time_signal_mps;
 2918|  12.2k|      error = ixheaace_mps_212_process(pstr_api_struct->pstr_mps_212_enc, ptr_input_buffer_mps,
 2919|  12.2k|                                       num_samples_read, &mps_extension_payload);
 2920|  12.2k|      if (error) {
  ------------------
  |  Branch (2920:11): [True: 0, False: 12.2k]
  ------------------
 2921|      0|        return error;
 2922|      0|      }
 2923|  12.2k|      num_samples_read /= 2;
 2924|  12.0M|      for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2924:21): [True: 12.0M, False: 12.2k]
  ------------------
 2925|  12.0M|        ptr_input_buffer[2 * idx + write_off_set] = (FLOAT32)ptr_input_buffer_mps[idx];
 2926|  12.0M|      }
 2927|  12.2k|      env_read_offset = write_off_set;
 2928|  12.2k|    }
 2929|   309k|    if ((pstr_api_struct->pstr_mps_515_enc != NULL) && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2929:9): [True: 21.9k, False: 287k]
  |  Branch (2929:56): [True: 21.9k, False: 0]
  ------------------
 2930|  21.9k|      ixheaace_bit_buf bit_buf;
 2931|  21.9k|      ixheaace_bit_buf_handle ptr_bit_buf = NULL;
 2932|  21.9k|      FLOAT32 *ptr_downmix_buffer_mps = pstr_api_struct->pstr_state->mps_scratch;
 2933|  21.9k|      VOID *ptr_scratch_515_mps = (VOID *)(pstr_api_struct->pstr_state->mps_scratch +
 2934|  21.9k|                                           (MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) +
  ------------------
  |  |   25|  21.9k|#define MAX_INPUT_CHANNELS (6)
  ------------------
                                                         (MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) +
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 2935|  21.9k|                                           (MAX_OUTPUT_CHANNELS * MAX_BUFFER_SIZE));
  ------------------
  |  |   26|  21.9k|#define MAX_OUTPUT_CHANNELS (2)
  ------------------
                                                         (MAX_OUTPUT_CHANNELS * MAX_BUFFER_SIZE));
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 2936|  21.9k|      ptr_bit_buf = ia_enhaacplus_enc_create_bitbuffer(&bit_buf, mps_bs, MAX_MPS_BS_PAYLOAD_SIZE);
  ------------------
  |  |   64|  21.9k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 2937|       |
 2938|  21.9k|      error =
 2939|  21.9k|          ixheaace_mps_515_apply(pstr_api_struct->pstr_mps_515_enc, &ptr_input_buffer_mps[0],
 2940|  21.9k|                                 &ptr_downmix_buffer_mps[0], ptr_bit_buf, ptr_scratch_515_mps);
 2941|  21.9k|      if (error) {
  ------------------
  |  Branch (2941:11): [True: 0, False: 21.9k]
  ------------------
 2942|      0|        return error;
 2943|      0|      }
 2944|  21.9k|      mps_extension_payload.data_size = ptr_bit_buf->cnt_bits;
 2945|  21.9k|      mps_extension_payload.data_type = IXHEAACE_MPS_EXT_LDSAC_DATA;
  ------------------
  |  |  174|  21.9k|#define IXHEAACE_MPS_EXT_LDSAC_DATA (0x09)
  ------------------
 2946|  21.9k|      mps_extension_payload.associated_ch_element = -1;
 2947|       |
 2948|  21.9k|      if (pstr_api_struct->pstr_state->mps_tree_config == TREE_5151 ||
  ------------------
  |  |   40|  43.9k|#define TREE_5151 (1)
  ------------------
  |  Branch (2948:11): [True: 5.69k, False: 16.2k]
  ------------------
 2949|  16.2k|          pstr_api_struct->pstr_state->mps_tree_config == TREE_5152) {
  ------------------
  |  |   41|  16.2k|#define TREE_5152 (2)
  ------------------
  |  Branch (2949:11): [True: 2.17k, False: 14.1k]
  ------------------
 2950|  7.87k|        num_samples_read /= 6;
 2951|  7.78M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2951:23): [True: 7.77M, False: 7.87k]
  ------------------
 2952|  7.77M|          ptr_input_buffer[2 * idx + write_off_set] = (FLOAT32)ptr_downmix_buffer_mps[idx];
 2953|  7.77M|        }
 2954|  14.1k|      } else {
 2955|  14.1k|        num_samples_read /= 3;
 2956|  28.1M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2956:23): [True: 28.0M, False: 14.1k]
  ------------------
 2957|  28.0M|          ptr_input_buffer[idx + write_off_set] = (FLOAT32)ptr_downmix_buffer_mps[idx];
 2958|  28.0M|        }
 2959|  14.1k|      }
 2960|  21.9k|      env_read_offset = write_off_set;
 2961|  21.9k|    }
 2962|       |
 2963|   309k|    if (pstr_api_struct->pstr_state->downsample[ele_idx]) {
  ------------------
  |  Branch (2963:9): [True: 225k, False: 84.4k]
  ------------------
 2964|   225k|      ixheaace_resampler_scratch *pstr_scratch_resampler =
 2965|   225k|          (ixheaace_resampler_scratch *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 2966|       |
 2967|   225k|      if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (2967:11): [True: 212k, False: 12.7k]
  ------------------
 2968|   212k|        error = ixheaace_env_encode_frame(
 2969|   212k|            pstr_sbr_encoder, ptr_input_buffer + env_read_offset, ptr_input_buffer,
 2970|   212k|            IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   212k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2971|   212k|            &(pstr_api_struct->pstr_state->num_anc_data_bytes[ele_idx][0]),
 2972|   212k|            pstr_api_struct->pstr_state->anc_data_bytes[ele_idx],
 2973|   212k|            &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs),
 2974|   212k|            &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size,
 2975|   212k|            pstr_api_struct->config[0].aac_config.flag_framelength_small, NULL);
 2976|       |
 2977|   212k|        if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   212k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (2977:13): [True: 1.52k, False: 211k]
  ------------------
 2978|  1.52k|          return error;
 2979|  1.52k|        }
 2980|   212k|      }
 2981|       |
 2982|   223k|      if (!pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2982:11): [True: 204k, False: 19.7k]
  ------------------
 2983|   506k|        for (ch = 0; ch < pstr_aac_config->num_out_channels; ch++) {
  ------------------
  |  Branch (2983:22): [True: 302k, False: 204k]
  ------------------
 2984|   302k|          ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 2985|   302k|                                             &shared_buf1_ring, &shared_buf2_ring);
 2986|   302k|          {
 2987|   302k|            ia_enhaacplus_enc_iir_downsampler(
 2988|   302k|                &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch]),
 2989|   302k|                ptr_input_buffer + write_off_set + ch,
 2990|   302k|                num_samples_read / pstr_aac_config->num_out_channels, IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   302k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2991|   302k|                ptr_input_buffer + ch, &out_samples, out_stride, shared_buf1_ring,
 2992|   302k|                shared_buf2_ring, pstr_scratch_resampler);
 2993|   302k|          }
 2994|   302k|        }
 2995|   204k|      }
 2996|   223k|    }
 2997|       |
 2998|   308k|    error = ia_enhaacplus_enc_aac_core_encode(
 2999|   308k|        pstr_aac_enc, ptr_input_buffer, time_in_stride,
 3000|   308k|        pstr_api_struct->pstr_state->anc_data_bytes[ele_idx],
 3001|   308k|        pstr_api_struct->pstr_state->num_anc_data_bytes[ele_idx], pub_out_buf,
 3002|   308k|        &(pstr_api_struct->pstr_state->i_out_bytes), &(pstr_api_struct->pstr_aac_tabs),
 3003|   308k|        pstr_api_struct->pstr_state->pstr_bit_stream_handle,
 3004|   308k|        &(pstr_api_struct->pstr_state->bit_stream), flag_last_element,
 3005|   308k|        write_program_config_element, i_num_coup_channels, i_channels_mask, ele_idx,
 3006|   308k|        total_fill_bits, total_channels, aot, pstr_api_struct->config->adts_flag,
 3007|   308k|        num_bs_elements, &pstr_api_struct->pstr_state->is_quant_spec_zero,
 3008|   308k|        &pstr_api_struct->pstr_state->is_gain_limited);
 3009|   308k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3009:9): [True: 40.7k, False: 267k]
  ------------------
 3010|  40.7k|      return error;
 3011|  40.7k|    }
 3012|   267k|    if (pstr_sbr_encoder && !(pstr_api_struct->config[ele_idx].use_parametric_stereo)) {
  ------------------
  |  Branch (3012:9): [True: 179k, False: 87.7k]
  |  Branch (3012:29): [True: 160k, False: 19.3k]
  ------------------
 3013|   160k|      if (pstr_sbr_encoder && (ptr_input_buffer != NULL)) {
  ------------------
  |  Branch (3013:11): [True: 160k, False: 0]
  |  Branch (3013:31): [True: 160k, False: 0]
  ------------------
 3014|   160k|        memmove(ptr_input_buffer,
 3015|   160k|                ptr_input_buffer + aacenc_blocksize * 2 * IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   160k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3016|   160k|                write_off_set * sizeof(ptr_input_buffer[0]));
 3017|   160k|      }
 3018|   160k|    }
 3019|   267k|  }
 3020|      0|  {}
 3021|       |  /*ADTS Header Write*/
 3022|   267k|  if (pstr_api_struct->config->adts_flag) {
  ------------------
  |  Branch (3022:7): [True: 74.2k, False: 193k]
  ------------------
 3023|  74.2k|    pub_out_buf = ((pUWORD8)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_OUTPUT_IDX]);
  ------------------
  |  |   32|  74.2k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 3024|  74.2k|    {
 3025|  74.2k|      WORD32 num_channels = 0;
 3026|       |
 3027|   304k|      for (ele = 0; ele < pstr_api_struct->config[0].num_bs_elements; ele++) {
  ------------------
  |  Branch (3027:21): [True: 229k, False: 74.2k]
  ------------------
 3028|   229k|        num_channels += pstr_api_struct->config[ele].i_channels;
 3029|   229k|      }
 3030|  74.2k|      {
 3031|  74.2k|        header_bytes = ia_enhaacplus_enc_write_ADTS_header(
 3032|  74.2k|            pub_out_buf, pstr_api_struct->pstr_state->i_out_bytes,
 3033|  74.2k|            pstr_api_struct->config->aac_config.core_sample_rate,
 3034|  74.2k|            (pstr_api_struct->config[0].num_bs_elements > 1)
  ------------------
  |  Branch (3034:13): [True: 67.9k, False: 6.34k]
  ------------------
 3035|  74.2k|                ? num_channels
 3036|  74.2k|                : pstr_api_struct->config[0].aac_config.num_out_channels);
 3037|  74.2k|      }
 3038|  74.2k|    }
 3039|       |
 3040|  74.2k|    pstr_api_struct->pstr_state->i_out_bytes += header_bytes;
 3041|  74.2k|  }
 3042|       |
 3043|   267k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   267k|#define IA_NO_ERROR 0x00000000
  ------------------
 3044|   308k|}
ixheaace_api.c:iusace_process:
 3045|   345k|static IA_ERRORCODE iusace_process(ixheaace_api_struct *pstr_api_struct) {
 3046|   345k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   345k|#define IA_NO_ERROR 0x00000000
  ------------------
 3047|   345k|  WORD32 idx;
 3048|   345k|  WORD32 write_off_set = 0;
 3049|   345k|  WORD32 core_coder_frame_length;
 3050|   345k|  WORD32 usac_independency_flg;
 3051|   345k|  UWORD32 padding_bits = 0;
 3052|   345k|  WORD32 core_sample;
 3053|   345k|  WORD32 drc_sample;
 3054|   345k|  WORD32 ptr_inp_buf_offset = 0;
 3055|   345k|  WORD32 num_ch;
 3056|   345k|  WORD16 *ps_inp_buf = NULL;
 3057|   345k|  WORD8 *ps_out_buf = NULL;
 3058|   345k|  FLOAT32 *ptr_input_buffer = NULL;
 3059|   345k|  FLOAT32 *ptr_inp_buf[MAX_TIME_CHANNELS];
 3060|   345k|  FLOAT32 *ptr_drc_inp_buf[MAX_TIME_CHANNELS];
 3061|   345k|  WORD32 delay = 0;
 3062|   345k|  ixheaace_state_struct *pstr_state = pstr_api_struct->pstr_state;
 3063|   345k|  ia_bit_buf_struct *pstr_it_bit_buff = &pstr_state->str_bit_buf;
 3064|   345k|  ia_usac_encoder_config_struct *pstr_config = &pstr_api_struct->config[0].usac_config;
 3065|   345k|  ia_usac_data_struct *pstr_usac_data = &pstr_api_struct->pstr_state->str_usac_enc_data;
 3066|   345k|  iusace_scratch_mem *pstr_scratch = &pstr_usac_data->str_scratch;
 3067|   345k|  ia_classification_struct *pstr_sig_class_data =
 3068|   345k|      &pstr_state->str_usac_enc_data.str_sig_class_data;
 3069|   345k|  core_sample = (pstr_config->ccfl * pstr_config->channels);
 3070|   345k|  drc_sample = pstr_config->drc_frame_size * pstr_config->channels;
 3071|   345k|  core_coder_frame_length = pstr_config->ccfl;
 3072|   345k|  num_ch = pstr_config->channels;
 3073|   345k|  usac_independency_flg = pstr_usac_data->usac_independency_flag;
 3074|   345k|  ps_inp_buf = (WORD16 *)pstr_api_struct->pp_mem[IA_MEMTYPE_INPUT];
  ------------------
  |  |   24|   345k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
 3075|   345k|  ps_out_buf = (WORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT];
  ------------------
  |  |   26|   345k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3076|       |
 3077|   345k|  if (pstr_config->use_drc_element) {
  ------------------
  |  Branch (3077:7): [True: 75.5k, False: 270k]
  ------------------
 3078|  75.5k|    if (pstr_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (3078:9): [True: 70.1k, False: 5.33k]
  ------------------
 3079|  70.1k|      delay = (CC_DELAY_ADJUSTMENT * pstr_config->drc_frame_size / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |  166|  70.1k|#define CC_DELAY_ADJUSTMENT (448)
  ------------------
                    delay = (CC_DELAY_ADJUSTMENT * pstr_config->drc_frame_size / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |   91|  70.1k|#define FRAME_LEN_1024 1024
  ------------------
 3080|  70.1k|    }
 3081|   232M|    for (idx = 0; idx < core_sample + delay; idx++) {
  ------------------
  |  Branch (3081:19): [True: 231M, False: 75.5k]
  ------------------
 3082|   231M|      pstr_api_struct->pstr_state->pp_drc_in_buf[idx % num_ch][idx / num_ch] =
 3083|   231M|          pstr_api_struct->pstr_state
 3084|   231M|              ->pp_drc_in_buf[idx % num_ch][idx / num_ch + pstr_config->drc_frame_size];
 3085|   231M|    }
 3086|  75.5k|    ptr_inp_buf_offset = pstr_config->drc_frame_size;
 3087|   209k|    for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3087:19): [True: 134k, False: 75.5k]
  ------------------
 3088|   134k|      ptr_drc_inp_buf[idx] = pstr_api_struct->pstr_state->pp_drc_in_buf[idx];
 3089|   134k|    }
 3090|  75.5k|  }
 3091|       |
 3092|   345k|  ixheaace_pstr_sbr_enc pstr_sbr_encoder =
 3093|   345k|      pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[0];
 3094|   345k|  if (pstr_config->sbr_enable) {
  ------------------
  |  Branch (3094:7): [True: 211k, False: 134k]
  ------------------
 3095|   211k|    ixheaace_mps_enc_ext_payload mps_extension_payload;
 3096|   211k|    UWORD8 *mps_bs = pstr_api_struct->pstr_state->mps_bs;
 3097|   211k|    FLOAT32 *time_signal_mps = pstr_api_struct->pstr_state->time_signal_mps;
 3098|   211k|    WORD32 sbr_pvc_mode = 0;
 3099|   211k|    WORD32 sbr_patching_mode = 1;
 3100|   211k|    WORD32 ccfl_size;
 3101|   211k|    WORD32 num_samples_read;
 3102|   211k|    WORD32 out_samples, ch;
 3103|   211k|    WORD32 resamp_ratio =
 3104|   211k|        ia_enhaacplus_enc_compute_resampling_ratio(pstr_api_struct->config[0].ccfl_idx);
 3105|   211k|    switch (pstr_config->codec_mode) {
  ------------------
  |  Branch (3105:13): [True: 211k, False: 0]
  ------------------
 3106|  93.9k|      case USAC_SWITCHED:
  ------------------
  |  |   35|  93.9k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (3106:7): [True: 93.9k, False: 117k]
  ------------------
 3107|  93.9k|        if (pstr_usac_data->str_sig_class_data.coding_mode == 2) {
  ------------------
  |  Branch (3107:13): [True: 16.5k, False: 77.4k]
  ------------------
 3108|  16.5k|          sbr_pvc_mode = 0;
 3109|  77.4k|        } else {
 3110|  77.4k|          sbr_pvc_mode = 2;
 3111|  77.4k|        }
 3112|  93.9k|        sbr_patching_mode = 1;
 3113|  93.9k|        break;
 3114|   113k|      case USAC_ONLY_FD:
  ------------------
  |  |   36|   113k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (3114:7): [True: 113k, False: 97.7k]
  ------------------
 3115|   113k|        sbr_pvc_mode = 0;
 3116|   113k|        sbr_patching_mode = 0;
 3117|   113k|        break;
 3118|  3.76k|      case USAC_ONLY_TD:
  ------------------
  |  |   37|  3.76k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (3118:7): [True: 3.76k, False: 207k]
  ------------------
 3119|  3.76k|        sbr_pvc_mode = 2;
 3120|  3.76k|        sbr_patching_mode = 1;
 3121|  3.76k|        break;
 3122|   211k|    }
 3123|       |
 3124|   211k|    write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  132|   211k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|   211k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
                  write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   211k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3125|       |
 3126|   211k|    if (pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|   211k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3126:9): [True: 51.3k, False: 160k]
  ------------------
 3127|  51.3k|      write_off_set = write_off_set * 2;
 3128|  51.3k|    }
 3129|       |
 3130|   211k|    if (pstr_api_struct->pstr_state->downsample[0]) {
  ------------------
  |  Branch (3130:9): [True: 211k, False: 0]
  ------------------
 3131|   211k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   211k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3131:11): [True: 30.9k, False: 180k]
  ------------------
 3132|  30.9k|        write_off_set +=
 3133|  30.9k|            (pstr_api_struct->pstr_state->down_samp_sos[0][0].delay) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  30.9k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3134|       |
 3135|  30.9k|        write_off_set +=
 3136|  30.9k|            (pstr_api_struct->pstr_state->up_sampler[0][0].delay) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  30.9k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3137|   180k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1 ||
  ------------------
  |  |  198|   361k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3137:18): [True: 129k, False: 51.3k]
  ------------------
 3138|   180k|                 pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|  51.3k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3138:18): [True: 51.3k, False: 0]
  ------------------
 3139|   180k|        write_off_set +=
 3140|   180k|            (pstr_api_struct->pstr_state->down_sampler[0][0].delay) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   180k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3141|   180k|      }
 3142|   211k|    }
 3143|       |
 3144|   211k|    ptr_input_buffer = pstr_api_struct->pstr_state->inp_delay;
 3145|   211k|    ccfl_size = pstr_api_struct->config[0].usac_config.ccfl;
 3146|   211k|    num_samples_read = ccfl_size * pstr_api_struct->config[0].i_channels;
 3147|   211k|    switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (3147:13): [True: 211k, False: 0]
  ------------------
 3148|  30.9k|      case SBR_8_3:
  ------------------
  |  |  197|  30.9k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3148:7): [True: 30.9k, False: 180k]
  ------------------
 3149|  30.9k|        num_samples_read *= 8;
 3150|  30.9k|        num_samples_read /= 3;
 3151|  30.9k|        break;
 3152|       |
 3153|   129k|      case SBR_2_1:
  ------------------
  |  |  198|   129k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3153:7): [True: 129k, False: 82.3k]
  ------------------
 3154|   129k|        num_samples_read *= 2;
 3155|   129k|        break;
 3156|       |
 3157|  51.3k|      case SBR_4_1:
  ------------------
  |  |  199|  51.3k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3157:7): [True: 51.3k, False: 160k]
  ------------------
 3158|  51.3k|        num_samples_read *= 4;
 3159|  51.3k|        break;
 3160|   211k|    }
 3161|       |
 3162|   211k|    mps_extension_payload.p_data = mps_bs;
 3163|   211k|    memset(&mps_extension_payload, 0, sizeof(ixheaace_mps_enc_ext_payload));
 3164|       |
 3165|   211k|    if ((pstr_api_struct->pstr_mps_212_enc != NULL) && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (3165:9): [True: 78.9k, False: 132k]
  |  Branch (3165:56): [True: 78.9k, False: 0]
  ------------------
 3166|   186M|      for (idx = 0; idx < num_samples_read / 2; idx++) {
  ------------------
  |  Branch (3166:21): [True: 186M, False: 78.9k]
  ------------------
 3167|   186M|        time_signal_mps[idx] = (FLOAT32)ps_inp_buf[2 * idx];
 3168|   186M|        time_signal_mps[num_samples_read / 2 + idx] = (FLOAT32)ps_inp_buf[2 * idx + 1];
 3169|   186M|      }
 3170|  78.9k|      ixheaace_mps_pstr_struct pstr_mps_enc =
 3171|  78.9k|          (ixheaace_mps_pstr_struct)pstr_api_struct->pstr_mps_212_enc;
 3172|  78.9k|      pstr_mps_enc->ptr_sac_encoder->independency_flag = usac_independency_flg;
 3173|       |
 3174|  78.9k|      error = ixheaace_mps_212_process(pstr_api_struct->pstr_mps_212_enc, time_signal_mps,
 3175|  78.9k|                                       num_samples_read, &mps_extension_payload);
 3176|  78.9k|      if (error) {
  ------------------
  |  Branch (3176:11): [True: 0, False: 78.9k]
  ------------------
 3177|      0|        return error;
 3178|      0|      }
 3179|  78.9k|      if (pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  Branch (3179:11): [True: 78.9k, False: 0]
  ------------------
 3180|   186M|        for (idx = 0; idx < num_samples_read / 2; idx++) {
  ------------------
  |  Branch (3180:23): [True: 186M, False: 78.9k]
  ------------------
 3181|   186M|          ptr_input_buffer[write_off_set + 2 * idx] = time_signal_mps[idx];
 3182|   186M|          ptr_input_buffer[write_off_set + 2 * idx + 1] =
 3183|   186M|              time_signal_mps[num_samples_read / 2 + idx];
 3184|   186M|        }
 3185|  78.9k|      }
 3186|   132k|    } else if (pstr_api_struct->config[0].i_channels == 2 &&
  ------------------
  |  Branch (3186:16): [True: 70.5k, False: 61.9k]
  ------------------
 3187|  70.5k|               pstr_api_struct->config[0].chmode_nchannels == 2) {
  ------------------
  |  Branch (3187:16): [True: 70.5k, False: 0]
  ------------------
 3188|   361M|      for (idx = 0; idx < (num_samples_read); idx++) {
  ------------------
  |  Branch (3188:21): [True: 360M, False: 70.5k]
  ------------------
 3189|   360M|        ptr_input_buffer[write_off_set + idx] = (FLOAT32)ps_inp_buf[idx];
 3190|   360M|      }
 3191|  70.5k|    } else if (pstr_api_struct->config[0].i_channels == 1) {
  ------------------
  |  Branch (3191:16): [True: 61.9k, False: 0]
  ------------------
 3192|   171M|      for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (3192:21): [True: 171M, False: 61.9k]
  ------------------
 3193|   171M|        ptr_input_buffer[write_off_set + (IXHEAACE_MAX_CH_IN_BS_ELE * idx)] =
  ------------------
  |  |   22|   171M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3194|   171M|            (FLOAT32)ps_inp_buf[idx];
 3195|   171M|      }
 3196|  61.9k|    }
 3197|       |
 3198|   211k|    if (num_ch == 2) {
  ------------------
  |  Branch (3198:9): [True: 149k, False: 61.9k]
  ------------------
 3199|   149k|      if (1 == pstr_config->use_drc_element) {
  ------------------
  |  Branch (3199:11): [True: 40.7k, False: 108k]
  ------------------
 3200|   167M|        for (idx = 0; idx < drc_sample; idx++) {
  ------------------
  |  Branch (3200:23): [True: 167M, False: 40.7k]
  ------------------
 3201|   167M|          ptr_drc_inp_buf[idx % num_ch][(idx >> 1) + ptr_inp_buf_offset] = ptr_input_buffer[idx];
 3202|   167M|        }
 3203|  40.7k|      }
 3204|       |
 3205|       |      // update Header and bit-stream parameters
 3206|   149k|      if (0 == pstr_config->sbr_pvc_active) {
  ------------------
  |  Branch (3206:11): [True: 107k, False: 42.4k]
  ------------------
 3207|   107k|        sbr_pvc_mode = 0;
 3208|   107k|      }
 3209|       |
 3210|   149k|      ixheaace_set_usac_sbr_params(
 3211|   149k|          pstr_sbr_encoder, usac_independency_flg, 0, pstr_config->sbr_pvc_active, sbr_pvc_mode,
 3212|   149k|          pstr_config->sbr_inter_tes_active, pstr_config->sbr_harmonic, sbr_patching_mode);
 3213|       |
 3214|       |      // Downsample SBR input buffer for Harmonic SBR
 3215|   149k|      if (pstr_config->sbr_harmonic) {
  ------------------
  |  Branch (3215:11): [True: 108k, False: 40.7k]
  ------------------
 3216|   108k|        FLOAT32 *in_buffer_temp;
 3217|   108k|        ixheaace_get_input_scratch_buf(pstr_api_struct->pstr_state->ptr_temp_buff_resamp,
 3218|   108k|                                       &in_buffer_temp);
 3219|   108k|        FLOAT32 *outbuf = ixheaace_get_hbe_resample_buffer(pstr_sbr_encoder);
 3220|   108k|        if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   108k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3220:13): [True: 0, False: 108k]
  ------------------
 3221|      0|          WORD32 input_tot = num_samples_read / pstr_api_struct->config[0].i_channels;
 3222|      0|          ixheaace_upsampling_inp_buf_generation(ptr_input_buffer, in_buffer_temp, input_tot,
 3223|      0|                                                 UPSAMPLE_FAC, 0);
  ------------------
  |  |   25|      0|#define UPSAMPLE_FAC (3)
  ------------------
 3224|      0|        }
 3225|       |
 3226|       |        // Resampler
 3227|   326k|        for (ch = 0; ch < num_ch; ch++) {
  ------------------
  |  Branch (3227:22): [True: 217k, False: 108k]
  ------------------
 3228|   217k|          FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 3229|   217k|          ixheaace_resampler_scratch *pstr_scratch_resampler =
 3230|   217k|              (ixheaace_resampler_scratch *)(ixheaace_resampler_scratch *)
 3231|   217k|                  pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 3232|       |
 3233|   217k|          ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 3234|   217k|                                             &shared_buf1_ring, &shared_buf2_ring);
 3235|       |
 3236|   217k|          if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   217k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3236:15): [True: 0, False: 217k]
  ------------------
 3237|       |            // Upsampling by factor 3 - SOS implementation
 3238|      0|            ia_enhaacplus_enc_iir_sos_upsampler(
 3239|      0|                &(pstr_api_struct->pstr_state->hbe_up_sampler[0][ch]), in_buffer_temp + ch,
 3240|      0|                num_samples_read / pstr_api_struct->config[0].i_channels,
 3241|      0|                IXHEAACE_MAX_CH_IN_BS_ELE, in_buffer_temp + ch, &out_samples, shared_buf1_ring,
  ------------------
  |  |   22|      0|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3242|      0|                shared_buf2_ring, pstr_scratch_resampler);
 3243|       |
 3244|       |            // Downsampling by factor 8
 3245|      0|            ia_enhaacplus_enc_iir_sos_downsampler(
 3246|      0|                &(pstr_api_struct->pstr_state->hbe_down_samp_sos[0][ch]), in_buffer_temp + ch,
 3247|      0|                out_samples, IXHEAACE_MAX_CH_IN_BS_ELE, outbuf + ch, &out_samples,
  ------------------
  |  |   22|      0|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3248|      0|                shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3249|   217k|          } else {
 3250|   217k|            WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE * resamp_ratio;
  ------------------
  |  |   22|   217k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3251|       |
 3252|   217k|            ia_enhaacplus_enc_iir_downsampler(
 3253|   217k|                &(pstr_api_struct->pstr_state->hbe_down_sampler[0][ch]), ptr_input_buffer + ch,
 3254|   217k|                num_samples_read / pstr_api_struct->config[0].i_channels,
 3255|   217k|                IXHEAACE_MAX_CH_IN_BS_ELE, outbuf + ch, &out_samples, out_stride,
  ------------------
  |  |   22|   217k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3256|   217k|                shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3257|   217k|          }
 3258|   217k|        }
 3259|   108k|      }
 3260|       |
 3261|       |      // SBR Encode
 3262|   149k|      error = ixheaace_env_encode_frame(
 3263|   149k|          pstr_sbr_encoder, ptr_input_buffer, ptr_input_buffer,
 3264|   149k|          pstr_api_struct->config[0].i_channels,
 3265|   149k|          &(pstr_api_struct->pstr_state->num_anc_data_bytes[0][0]),
 3266|   149k|          pstr_api_struct->pstr_state->anc_data_bytes[0],
 3267|   149k|          &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs),
 3268|   149k|          &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size, 0,
 3269|   149k|          &pstr_api_struct->pstr_state->str_usac_enc_data.num_sbr_bits);
 3270|   149k|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   149k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3270:11): [True: 7.52k, False: 141k]
  ------------------
 3271|  7.52k|        return error;
 3272|  7.52k|      }
 3273|   149k|    } else {
 3274|  61.9k|      if (0 == pstr_config->sbr_pvc_active) {
  ------------------
  |  Branch (3274:11): [True: 34.5k, False: 27.4k]
  ------------------
 3275|  34.5k|        sbr_pvc_mode = 0;
 3276|  34.5k|      }
 3277|       |
 3278|  61.9k|      ixheaace_set_usac_sbr_params(
 3279|  61.9k|          pstr_sbr_encoder, usac_independency_flg, 0, pstr_config->sbr_pvc_active, sbr_pvc_mode,
 3280|  61.9k|          pstr_config->sbr_inter_tes_active, pstr_config->sbr_harmonic, sbr_patching_mode);
 3281|  61.9k|      if (pstr_config->sbr_harmonic) {
  ------------------
  |  Branch (3281:11): [True: 8.39k, False: 53.5k]
  ------------------
 3282|  8.39k|        FLOAT32 *in_buffer_temp;
 3283|  8.39k|        ixheaace_get_input_scratch_buf(pstr_api_struct->pstr_state->ptr_temp_buff_resamp,
 3284|  8.39k|                                       &in_buffer_temp);
 3285|  8.39k|        FLOAT32 *outbuf = ixheaace_get_hbe_resample_buffer(pstr_sbr_encoder);
 3286|  8.39k|        if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  8.39k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3286:13): [True: 0, False: 8.39k]
  ------------------
 3287|      0|          WORD32 input_tot = num_samples_read / pstr_api_struct->config[0].i_channels;
 3288|      0|          ixheaace_upsampling_inp_buf_generation(ptr_input_buffer, in_buffer_temp, input_tot,
 3289|      0|                                                 UPSAMPLE_FAC, 0);
  ------------------
  |  |   25|      0|#define UPSAMPLE_FAC (3)
  ------------------
 3290|      0|        }
 3291|       |
 3292|       |        // Resampler
 3293|  16.7k|        for (ch = 0; ch < num_ch; ch++) {
  ------------------
  |  Branch (3293:22): [True: 8.39k, False: 8.39k]
  ------------------
 3294|  8.39k|          FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 3295|  8.39k|          ixheaace_resampler_scratch *pstr_scratch_resampler =
 3296|  8.39k|              (ixheaace_resampler_scratch *)(ixheaace_resampler_scratch *)
 3297|  8.39k|                  pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 3298|       |
 3299|  8.39k|          ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 3300|  8.39k|                                             &shared_buf1_ring, &shared_buf2_ring);
 3301|       |
 3302|  8.39k|          if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  8.39k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3302:15): [True: 0, False: 8.39k]
  ------------------
 3303|       |            // Upsampling by factor 3 - SOS implementation
 3304|      0|            ia_enhaacplus_enc_iir_sos_upsampler(
 3305|      0|                &(pstr_api_struct->pstr_state->hbe_up_sampler[0][ch]), in_buffer_temp + ch,
 3306|      0|                num_samples_read / pstr_api_struct->config[0].i_channels,
 3307|      0|                IXHEAACE_MAX_CH_IN_BS_ELE, in_buffer_temp + ch, &out_samples, shared_buf1_ring,
  ------------------
  |  |   22|      0|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3308|      0|                shared_buf2_ring, pstr_scratch_resampler);
 3309|       |
 3310|       |            // Downsampling by factor 8
 3311|      0|            ia_enhaacplus_enc_iir_sos_downsampler(
 3312|      0|                &(pstr_api_struct->pstr_state->hbe_down_samp_sos[0][ch]), in_buffer_temp + ch,
 3313|      0|                out_samples, IXHEAACE_MAX_CH_IN_BS_ELE, outbuf + ch, &out_samples,
  ------------------
  |  |   22|      0|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3314|      0|                shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3315|  8.39k|          } else {
 3316|  8.39k|            WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE * resamp_ratio;
  ------------------
  |  |   22|  8.39k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3317|       |
 3318|  8.39k|            ia_enhaacplus_enc_iir_downsampler(
 3319|  8.39k|                &(pstr_api_struct->pstr_state->hbe_down_sampler[0][ch]),
 3320|  8.39k|                ptr_input_buffer /*input_buffer_fix + write_off_set*/ + ch,
 3321|  8.39k|                num_samples_read / pstr_api_struct->config[0].i_channels,
 3322|  8.39k|                IXHEAACE_MAX_CH_IN_BS_ELE, outbuf + ch, &out_samples, out_stride,
  ------------------
  |  |   22|  8.39k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3323|  8.39k|                shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3324|  8.39k|          }
 3325|  8.39k|        }
 3326|  8.39k|      }
 3327|       |
 3328|  61.9k|      FLOAT32 *time_signal = pstr_api_struct->pstr_state->time_signal;
 3329|   171M|      for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (3329:21): [True: 171M, False: 61.9k]
  ------------------
 3330|   171M|        time_signal[idx] = (FLOAT32)ptr_input_buffer[idx << 1];
 3331|   171M|      }
 3332|       |
 3333|  61.9k|      if (1 == pstr_config->use_drc_element) {
  ------------------
  |  Branch (3333:11): [True: 7.35k, False: 54.6k]
  ------------------
 3334|  15.0M|        for (idx = 0; idx < drc_sample; idx++) {
  ------------------
  |  Branch (3334:23): [True: 15.0M, False: 7.35k]
  ------------------
 3335|  15.0M|          ptr_drc_inp_buf[0][idx + ptr_inp_buf_offset] = time_signal[idx];
 3336|  15.0M|        }
 3337|  7.35k|      }
 3338|       |
 3339|       |      // SBR Encode
 3340|  61.9k|      error = ixheaace_env_encode_frame(
 3341|  61.9k|          pstr_sbr_encoder, time_signal, time_signal, pstr_api_struct->config[0].i_channels,
 3342|  61.9k|          &(pstr_api_struct->pstr_state->num_anc_data_bytes[0][0]),
 3343|  61.9k|          pstr_api_struct->pstr_state->anc_data_bytes[0],
 3344|  61.9k|          &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs),
 3345|  61.9k|          &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size, 0,
 3346|  61.9k|          &pstr_api_struct->pstr_state->str_usac_enc_data.num_sbr_bits);
 3347|  61.9k|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  61.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3347:11): [True: 2.00k, False: 59.9k]
  ------------------
 3348|  2.00k|        return error;
 3349|  2.00k|      }
 3350|  61.9k|    }
 3351|       |
 3352|       |    /* Resampling for USAC core */
 3353|   201k|    {
 3354|   201k|      FLOAT32 *in_buffer_temp;
 3355|   201k|      ixheaace_get_input_scratch_buf(pstr_api_struct->pstr_state->ptr_temp_buff_resamp,
 3356|   201k|                                     &in_buffer_temp);
 3357|   201k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   201k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3357:11): [True: 30.9k, False: 170k]
  ------------------
 3358|  30.9k|        WORD32 input_tot = num_samples_read / pstr_api_struct->config[0].i_channels;
 3359|  30.9k|        ixheaace_upsampling_inp_buf_generation(ptr_input_buffer, in_buffer_temp, input_tot,
 3360|  30.9k|                                               UPSAMPLE_FAC, write_off_set - delay);
  ------------------
  |  |   25|  30.9k|#define UPSAMPLE_FAC (3)
  ------------------
 3361|  30.9k|      }
 3362|       |
 3363|   545k|      for (ch = 0; ch < num_ch; ch++) {
  ------------------
  |  Branch (3363:20): [True: 343k, False: 201k]
  ------------------
 3364|   343k|        FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 3365|   343k|        ixheaace_resampler_scratch *pstr_scratch_resampler =
 3366|   343k|            (ixheaace_resampler_scratch *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 3367|       |
 3368|   343k|        ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 3369|   343k|                                           &shared_buf1_ring, &shared_buf2_ring);
 3370|       |
 3371|   343k|        if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   343k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3371:13): [True: 41.5k, False: 302k]
  ------------------
 3372|       |          // Upsampling by factor 3 - SOS implementation
 3373|  41.5k|          ia_enhaacplus_enc_iir_sos_upsampler(
 3374|  41.5k|              &(pstr_api_struct->pstr_state->up_sampler[0][ch]), in_buffer_temp + ch,
 3375|  41.5k|              num_samples_read / pstr_api_struct->config[0].i_channels, IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|  41.5k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3376|  41.5k|              in_buffer_temp + ch, &out_samples, shared_buf1_ring, shared_buf2_ring,
 3377|  41.5k|              pstr_scratch_resampler);
 3378|       |
 3379|       |          // Downsampling by factor 8
 3380|  41.5k|          ia_enhaacplus_enc_iir_sos_downsampler(
 3381|  41.5k|              &(pstr_api_struct->pstr_state->down_samp_sos[0][ch]), in_buffer_temp + ch,
 3382|  41.5k|              out_samples, IXHEAACE_MAX_CH_IN_BS_ELE, ptr_input_buffer + ch, &out_samples,
  ------------------
  |  |   22|  41.5k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3383|  41.5k|              shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3384|   302k|        } else {
 3385|   302k|          WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE * resamp_ratio;
  ------------------
  |  |   22|   302k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3386|   302k|          ia_enhaacplus_enc_iir_downsampler(
 3387|   302k|              &(pstr_api_struct->pstr_state->down_sampler[0][ch]),
 3388|   302k|              ptr_input_buffer + write_off_set - delay + ch,
 3389|   302k|              num_samples_read / pstr_api_struct->config[0].i_channels, IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   302k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3390|   302k|              ptr_input_buffer + ch, &out_samples, out_stride, shared_buf1_ring, shared_buf2_ring,
 3391|   302k|              pstr_scratch_resampler);
 3392|   302k|        }
 3393|   343k|      }
 3394|   201k|    }
 3395|       |
 3396|   201k|    if (num_ch != 0) {
  ------------------
  |  Branch (3396:9): [True: 201k, False: 0]
  ------------------
 3397|   545k|      for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3397:21): [True: 343k, False: 201k]
  ------------------
 3398|   343k|        ptr_inp_buf[idx] = pstr_api_struct->pstr_state->ptr_in_buf[idx];
 3399|   343k|      }
 3400|       |
 3401|   201k|      if (num_ch == 1) {
  ------------------
  |  Branch (3401:11): [True: 59.9k, False: 141k]
  ------------------
 3402|  56.2M|        for (idx = 0; idx < core_sample; idx++) {
  ------------------
  |  Branch (3402:23): [True: 56.1M, False: 59.9k]
  ------------------
 3403|  56.1M|          ptr_inp_buf[0][idx] = ptr_input_buffer[idx << 1];
 3404|  56.1M|        }
 3405|   141k|      } else {
 3406|   285M|        for (idx = 0; idx < core_sample; idx++) {
  ------------------
  |  Branch (3406:23): [True: 285M, False: 141k]
  ------------------
 3407|   285M|          ptr_inp_buf[idx % num_ch][idx / num_ch] = ptr_input_buffer[idx];
 3408|   285M|        }
 3409|   141k|      }
 3410|   201k|    }
 3411|   201k|  } else {
 3412|   134k|    if (pstr_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (3412:9): [True: 126k, False: 8.32k]
  ------------------
 3413|   126k|      delay = ((CC_DELAY_ADJUSTMENT * core_coder_frame_length) / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |  166|   126k|#define CC_DELAY_ADJUSTMENT (448)
  ------------------
                    delay = ((CC_DELAY_ADJUSTMENT * core_coder_frame_length) / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |   91|   126k|#define FRAME_LEN_1024 1024
  ------------------
 3414|   126k|    }
 3415|   134k|    if (num_ch != 0) {
  ------------------
  |  Branch (3415:9): [True: 134k, False: 0]
  ------------------
 3416|   357k|      for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3416:21): [True: 223k, False: 134k]
  ------------------
 3417|   223k|        ptr_inp_buf[idx] = pstr_api_struct->pstr_state->ptr_in_buf[idx];
 3418|   223k|      }
 3419|       |
 3420|   201M|      for (idx = 0; idx < core_sample; idx++) {
  ------------------
  |  Branch (3420:21): [True: 200M, False: 134k]
  ------------------
 3421|   200M|        ptr_inp_buf[idx % num_ch][(idx + delay) / num_ch] = ps_inp_buf[idx];
 3422|   200M|      }
 3423|       |
 3424|   134k|      if (1 == pstr_config->use_drc_element) {
  ------------------
  |  Branch (3424:11): [True: 27.3k, False: 107k]
  ------------------
 3425|  45.4M|        for (idx = 0; idx < drc_sample; idx++) {
  ------------------
  |  Branch (3425:23): [True: 45.4M, False: 27.3k]
  ------------------
 3426|  45.4M|          ptr_drc_inp_buf[idx % num_ch][(idx + delay) / num_ch + ptr_inp_buf_offset] =
 3427|  45.4M|              ps_inp_buf[idx];
 3428|  45.4M|        }
 3429|  27.3k|      }
 3430|   134k|    }
 3431|   134k|  }
 3432|       |
 3433|   336k|  if (pstr_sig_class_data->is_switch_mode) {
  ------------------
  |  Branch (3433:7): [True: 115k, False: 220k]
  ------------------
 3434|   109M|    for (idx = 0; idx < core_coder_frame_length; idx++) {
  ------------------
  |  Branch (3434:19): [True: 108M, False: 115k]
  ------------------
 3435|   108M|      pstr_sig_class_data->input_samples[pstr_sig_class_data->n_buffer_samples + idx] =
 3436|   108M|          pstr_api_struct->pstr_state->ptr_in_buf[0][idx];
 3437|   108M|    }
 3438|   115k|    pstr_sig_class_data->n_buffer_samples += core_coder_frame_length;
 3439|   115k|    iusace_classification(pstr_sig_class_data, pstr_scratch, core_coder_frame_length);
 3440|   115k|  }
 3441|       |
 3442|   336k|  pstr_it_bit_buff =
 3443|   336k|      iusace_create_bit_buffer(pstr_it_bit_buff, pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT],
  ------------------
  |  |   26|   336k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3444|   336k|                               pstr_api_struct->pstr_mem_info[IA_MEMTYPE_OUTPUT].ui_size, 1);
  ------------------
  |  |   26|   336k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3445|   336k|  if (pstr_it_bit_buff == NULL) {
  ------------------
  |  Branch (3445:7): [True: 0, False: 336k]
  ------------------
 3446|      0|    return IA_EXHEAACE_INIT_FATAL_USAC_BITBUFFER_INIT_FAILED;
 3447|      0|  }
 3448|   336k|  error =
 3449|   336k|      ixheaace_usac_encode(pstr_api_struct->pstr_state->ptr_in_buf, pstr_config,
 3450|   336k|                           &pstr_api_struct->pstr_state->str_usac_enc_data,
 3451|   336k|                           &pstr_api_struct->pstr_state->audio_specific_config, pstr_it_bit_buff,
 3452|   336k|                           pstr_sbr_encoder, pstr_api_struct->pstr_state->pp_drc_in_buf,
 3453|   336k|                           &pstr_api_struct->pstr_state->is_quant_spec_zero,
 3454|   336k|                           &pstr_api_struct->pstr_state->is_gain_limited);
 3455|   336k|  if (error) return error;
  ------------------
  |  Branch (3455:7): [True: 5.55k, False: 330k]
  ------------------
 3456|       |
 3457|   330k|  padding_bits = 8 - (pstr_it_bit_buff->cnt_bits & 7);
 3458|   330k|  if (padding_bits > 0 && padding_bits < 8) {
  ------------------
  |  Branch (3458:7): [True: 330k, False: 0]
  |  Branch (3458:27): [True: 286k, False: 44.5k]
  ------------------
 3459|   286k|    ps_out_buf[pstr_it_bit_buff->cnt_bits >> 3] =
 3460|   286k|        (WORD8)((UWORD32)ps_out_buf[pstr_it_bit_buff->cnt_bits >> 3]) & (0xFF << padding_bits);
 3461|   286k|  }
 3462|   330k|  pstr_api_struct->pstr_state->i_out_bytes =
 3463|   330k|      (padding_bits > 0 && padding_bits < 8) ? (pstr_it_bit_buff->cnt_bits + padding_bits) >> 3
  ------------------
  |  Branch (3463:8): [True: 330k, False: 0]
  |  Branch (3463:28): [True: 286k, False: 44.5k]
  ------------------
 3464|   330k|                                             : pstr_it_bit_buff->cnt_bits >> 3;
 3465|   330k|  pstr_api_struct->pstr_state->i_out_bits = pstr_it_bit_buff->cnt_bits;
 3466|   330k|  ixheaace_write_audio_preroll_data(pstr_api_struct, pstr_it_bit_buff);
 3467|   330k|  pstr_state->str_usac_enc_data.frame_count++;
 3468|   330k|  pstr_usac_data->usac_independency_flag_count =
 3469|   330k|      (pstr_usac_data->usac_independency_flag_count + 1) %
 3470|   330k|      pstr_usac_data->usac_independency_flag_interval;
 3471|       |
 3472|   330k|  if (pstr_config->sbr_enable) {
  ------------------
  |  Branch (3472:7): [True: 201k, False: 128k]
  ------------------
 3473|   201k|    WORD32 num_samples = pstr_api_struct->config[0].usac_config.ccfl * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   201k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3474|   201k|    switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (3474:13): [True: 201k, False: 0]
  ------------------
 3475|  30.9k|      case SBR_8_3:
  ------------------
  |  |  197|  30.9k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3475:7): [True: 30.9k, False: 170k]
  ------------------
 3476|  30.9k|        num_samples *= 8;
 3477|  30.9k|        num_samples /= 3;
 3478|  30.9k|        break;
 3479|       |
 3480|   122k|      case SBR_2_1:
  ------------------
  |  |  198|   122k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3480:7): [True: 122k, False: 79.3k]
  ------------------
 3481|   122k|        num_samples *= 2;
 3482|   122k|        break;
 3483|       |
 3484|  48.3k|      case SBR_4_1:
  ------------------
  |  |  199|  48.3k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3484:7): [True: 48.3k, False: 153k]
  ------------------
 3485|  48.3k|        num_samples *= 4;
 3486|  48.3k|        break;
 3487|   201k|    }
 3488|       |
 3489|   201k|    if (ptr_input_buffer != NULL) {
  ------------------
  |  Branch (3489:9): [True: 201k, False: 0]
  ------------------
 3490|   201k|      memmove(ptr_input_buffer, ptr_input_buffer + num_samples,
 3491|   201k|              write_off_set * sizeof(ptr_input_buffer[0]));
 3492|   201k|    }
 3493|   201k|  } else if (!pstr_config->sbr_enable && pstr_config->use_delay_adjustment) {
  ------------------
  |  Branch (3493:14): [True: 128k, False: 0]
  |  Branch (3493:42): [True: 120k, False: 8.32k]
  ------------------
 3494|   318k|    for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3494:19): [True: 197k, False: 120k]
  ------------------
 3495|   197k|      memmove(&ptr_inp_buf[idx][0], &ptr_inp_buf[idx][core_sample / num_ch],
 3496|   197k|              sizeof(ptr_inp_buf[idx][0]) * delay / num_ch);
 3497|   197k|    }
 3498|   120k|  }
 3499|       |
 3500|   330k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   330k|#define IA_NO_ERROR 0x00000000
  ------------------
 3501|   330k|}
ixheaace_api.c:ixheaace_write_audio_preroll_data:
 1843|   330k|                                              ia_bit_buf_struct *it_bit_buff) {
 1844|   330k|  ixheaace_config_struct *pstr_config = &pstr_api_struct->config[0];
 1845|   330k|  ixheaace_state_struct *pstr_enc_state = pstr_api_struct->pstr_state;
 1846|   330k|  ia_usac_data_struct *pstr_usac_data = &pstr_enc_state->str_usac_enc_data;
 1847|   330k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_config->usac_config;
 1848|   330k|  WORD32 i, j, padding_bits;
 1849|       |
 1850|   330k|  if (pstr_usac_config->is_ipf) {
  ------------------
  |  Branch (1850:7): [True: 11.7k, False: 319k]
  ------------------
 1851|  11.7k|    if (pstr_usac_config->iframes_interval == pstr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1851:9): [True: 4.59k, False: 7.16k]
  ------------------
 1852|  4.59k|      WORD32 config_len = 0, num_bits = 0, au_len = 0, config_bits = 0;
 1853|  4.59k|      WORD32 bytes_to_write;
 1854|  4.59k|      UWORD8 *ptr_out = (UWORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT];
  ------------------
  |  |   26|  4.59k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1855|  4.59k|      WORD32 max_output_size =
 1856|  4.59k|          ((MAX_CHANNEL_BITS / BYTE_NUMBIT) * pstr_usac_config->channels) * MAX_PREROLL_FRAMES +
  ------------------
  |  |   41|  4.59k|#define MAX_CHANNEL_BITS 6144
  ------------------
                        ((MAX_CHANNEL_BITS / BYTE_NUMBIT) * pstr_usac_config->channels) * MAX_PREROLL_FRAMES +
  ------------------
  |  |   82|  4.59k|#define BYTE_NUMBIT 8
  ------------------
                        ((MAX_CHANNEL_BITS / BYTE_NUMBIT) * pstr_usac_config->channels) * MAX_PREROLL_FRAMES +
  ------------------
  |  |  205|  4.59k|#define MAX_PREROLL_FRAMES (3)
  ------------------
 1857|  4.59k|          MAX_PREROLL_CONFIG_SIZE;
  ------------------
  |  |  210|  4.59k|#define MAX_PREROLL_CONFIG_SIZE (1024)
  ------------------
 1858|  4.59k|      UWORD8 *out_data = ptr_out + max_output_size;
 1859|  4.59k|      UWORD8 residual_bits = 0, residual_data = 0;
 1860|  4.59k|      memmove(ptr_out + max_output_size, ptr_out, pstr_enc_state->i_out_bytes);
 1861|  4.59k|      pstr_usac_config->is_ipf = 0;
 1862|       |
 1863|  4.59k|      config_bits = ixheaace_get_usac_config_bytes(NULL, &pstr_enc_state->audio_specific_config,
 1864|  4.59k|                                                   pstr_config->ccfl_idx);
 1865|  4.59k|      config_len = (config_bits + 7) >> 3;
 1866|  4.59k|      num_bits = iusace_write_escape_value(NULL, config_len, 4, 4, 8);
 1867|  4.59k|      num_bits += (config_len * 8);  // config data bits
 1868|  4.59k|      num_bits++;                    // apply-crossfade
 1869|  4.59k|      num_bits++;                    // apr-reserved
 1870|       |      // bits for number of preroll frames
 1871|  4.59k|      num_bits += iusace_write_escape_value(NULL, pstr_usac_config->num_preroll_frames, 2, 4, 0);
 1872|       |      // bits for au_len
 1873|  14.8k|      for (i = 0; i < pstr_usac_config->num_preroll_frames; i++) {
  ------------------
  |  Branch (1873:19): [True: 10.2k, False: 4.59k]
  ------------------
 1874|  10.2k|        num_bits += iusace_write_escape_value(NULL, pstr_usac_data->prev_out_bytes[i], 16, 16, 0);
 1875|  10.2k|        au_len += pstr_usac_data->prev_out_bytes[i];
 1876|  10.2k|      }
 1877|  4.59k|      iusace_reset_bit_buffer(it_bit_buff);
 1878|       |      // total bytes to write
 1879|  4.59k|      bytes_to_write = (num_bits + 7) >> 3;
 1880|       |      // usacIndependencyFlag
 1881|  4.59k|      iusace_write_bits_buf(it_bit_buff, pstr_usac_data->usac_independency_flag, 1);
 1882|  4.59k|      iusace_write_bits_buf(it_bit_buff, 1, 1);  // usacExtElementPresent
 1883|  4.59k|      iusace_write_bits_buf(it_bit_buff, 0, 1);  // usacExtElementUseDefaultLength
 1884|       |
 1885|  4.59k|      if (au_len + bytes_to_write >= MAXIMUM_VALUE_8BIT) {
  ------------------
  |  |  207|  4.59k|#define MAXIMUM_VALUE_8BIT (255)
  ------------------
  |  Branch (1885:11): [True: 4.40k, False: 187]
  ------------------
 1886|  4.40k|        iusace_write_escape_value(it_bit_buff, au_len + bytes_to_write + 2, 8, 16, 0);
 1887|  4.40k|      } else {
 1888|    187|        iusace_write_bits_buf(it_bit_buff, au_len + bytes_to_write, 8);
 1889|    187|      }
 1890|       |
 1891|  4.59k|      iusace_write_escape_value(it_bit_buff, config_len, 4, 4, 8);  // configLen
 1892|       |      // Config
 1893|  4.59k|      ixheaace_get_usac_config_bytes(it_bit_buff, &pstr_enc_state->audio_specific_config,
 1894|  4.59k|                                     pstr_config->ccfl_idx);
 1895|       |
 1896|  4.59k|      if (config_bits % 8) {
  ------------------
  |  Branch (1896:11): [True: 2.82k, False: 1.76k]
  ------------------
 1897|  2.82k|        iusace_write_bits_buf(it_bit_buff, 0, (UWORD8)((config_len << 3) - config_bits));
 1898|  2.82k|      }
 1899|       |
 1900|  4.59k|      iusace_write_bits_buf(it_bit_buff, 0, 1);  // applyCrossfade
 1901|  4.59k|      iusace_write_bits_buf(it_bit_buff, 0, 1);  // apr_reserved
 1902|       |      // numPreRollFrames
 1903|  4.59k|      iusace_write_escape_value(it_bit_buff, pstr_usac_config->num_preroll_frames, 2, 4, 0);
 1904|  14.8k|      for (i = 0; i < pstr_usac_config->num_preroll_frames; i++) {
  ------------------
  |  Branch (1904:19): [True: 10.2k, False: 4.59k]
  ------------------
 1905|  10.2k|        au_len = pstr_usac_data->prev_out_bytes[i];
 1906|       |
 1907|  10.2k|        if (pstr_usac_config->iframes_interval != 0) {
  ------------------
  |  Branch (1907:13): [True: 10.2k, False: 0]
  ------------------
 1908|  10.2k|          out_data = pstr_usac_data->prev_out_data[i];
 1909|  10.2k|        }
 1910|       |
 1911|       |        // auLen
 1912|  10.2k|        iusace_write_escape_value(it_bit_buff, au_len, 16, 16, 0);
 1913|       |
 1914|       |        // AccessUnit
 1915|  8.11M|        for (j = 0; j < au_len; j++) {
  ------------------
  |  Branch (1915:21): [True: 8.10M, False: 10.2k]
  ------------------
 1916|  8.10M|          iusace_write_bits_buf(it_bit_buff, *out_data, 8);
 1917|  8.10M|          out_data++;
 1918|  8.10M|        }
 1919|  10.2k|      }
 1920|       |
 1921|  4.59k|      if (num_bits % 8) {
  ------------------
  |  Branch (1921:11): [True: 3.13k, False: 1.45k]
  ------------------
 1922|  3.13k|        iusace_write_bits_buf(it_bit_buff, 0, (UWORD8)((bytes_to_write << 3) - num_bits));
 1923|  3.13k|      }
 1924|       |      // current frame
 1925|  4.59k|      au_len = pstr_enc_state->i_out_bits >> 3;
 1926|  4.59k|      residual_bits = (UWORD8)(pstr_enc_state->i_out_bits - (au_len << 3));
 1927|  4.59k|      out_data = ptr_out + max_output_size;
 1928|  3.56M|      for (j = 0; j < au_len; j++) {
  ------------------
  |  Branch (1928:19): [True: 3.56M, False: 4.59k]
  ------------------
 1929|  3.56M|        iusace_write_bits_buf(it_bit_buff, *out_data, 8);
 1930|  3.56M|        out_data++;
 1931|  3.56M|      }
 1932|  4.59k|      residual_data = *out_data >> (8 - residual_bits);
 1933|  4.59k|      iusace_write_bits_buf(it_bit_buff, residual_data, residual_bits);
 1934|       |
 1935|  4.59k|      padding_bits = 8 - (it_bit_buff->cnt_bits & 7);
 1936|  4.59k|      if (padding_bits > 0 && padding_bits < 8) {
  ------------------
  |  Branch (1936:11): [True: 4.59k, False: 0]
  |  Branch (1936:31): [True: 3.94k, False: 649]
  ------------------
 1937|  3.94k|        ptr_out[it_bit_buff->cnt_bits >> 3] =
 1938|  3.94k|            (WORD8)((UWORD32)ptr_out[it_bit_buff->cnt_bits >> 3]) & (0xFF << padding_bits);
 1939|  3.94k|      }
 1940|  4.59k|      pstr_enc_state->i_out_bytes = (it_bit_buff->cnt_bits + 7) >> 3;
 1941|  4.59k|      pstr_usac_config->preroll_idx++;
 1942|       |
 1943|  4.59k|      if (!pstr_usac_config->is_first_frame) {
  ------------------
  |  Branch (1943:11): [True: 1.60k, False: 2.98k]
  ------------------
 1944|  1.60k|        pstr_usac_config->preroll_idx = pstr_usac_config->num_preroll_frames + 1;
 1945|  1.60k|      }
 1946|  4.59k|      if (pstr_usac_config->is_first_frame) {
  ------------------
  |  Branch (1946:11): [True: 2.98k, False: 1.60k]
  ------------------
 1947|  2.98k|        pstr_usac_config->is_first_frame = 0;
 1948|  2.98k|      }
 1949|  7.16k|    } else {
 1950|  7.16k|      if (pstr_usac_config->preroll_idx < pstr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1950:11): [True: 7.16k, False: 0]
  ------------------
 1951|  7.16k|        WORD32 *ptr_prev_out_bytes = pstr_usac_data->prev_out_bytes;
 1952|  7.16k|        WORD32 pr_idx = pstr_usac_config->preroll_idx;
 1953|  7.16k|        UWORD8 *ptr_out = (UWORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT];
  ------------------
  |  |   26|  7.16k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1954|  7.16k|        ptr_prev_out_bytes[pr_idx] = pstr_enc_state->i_out_bytes;
 1955|  7.16k|        memcpy(pstr_usac_data->prev_out_data[pr_idx++], ptr_out, pstr_enc_state->i_out_bytes);
 1956|  7.16k|        pstr_usac_config->preroll_idx = pr_idx;
 1957|  7.16k|        pstr_enc_state->i_out_bytes = 0;
 1958|  7.16k|      }
 1959|  7.16k|    }
 1960|   319k|  } else {
 1961|   733k|    for (j = 0; j < pstr_usac_config->num_preroll_frames - 1; j++) {
  ------------------
  |  Branch (1961:17): [True: 413k, False: 319k]
  ------------------
 1962|   413k|      pstr_usac_data->prev_out_bytes[j] = pstr_usac_data->prev_out_bytes[j + 1];
 1963|   413k|    }
 1964|   319k|    if (pstr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1964:9): [True: 319k, False: 0]
  ------------------
 1965|   319k|      pstr_usac_data->prev_out_bytes[pstr_usac_config->num_preroll_frames - 1] =
 1966|   319k|          pstr_enc_state->i_out_bytes;
 1967|   319k|    }
 1968|   319k|    pstr_usac_config->preroll_idx = pstr_usac_config->num_preroll_frames + 1;
 1969|   319k|  }
 1970|   330k|  return;
 1971|   330k|}

ixheaace_get_audiospecific_config_bytes:
  399|  5.04k|    WORD32 ccfl_idx) {
  400|  5.04k|  WORD32 bit_cnt = 0, i;
  401|  5.04k|  UWORD32 tmp = 0x0f;  // initialized to indicate no sampling frequency index field
  402|  5.04k|  WORD32 ext_aot = -1;
  403|  5.04k|  WORD32 ext_id = 0;
  404|  5.04k|  WORD32 sbr_present_flag = 0, ps_present_flag = 0;
  405|       |
  406|  5.04k|  if (((AOT_AAC_ELD == aot) &&
  ------------------
  |  |   37|  5.04k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (406:8): [True: 728, False: 4.32k]
  ------------------
  407|    728|       (1 == pstr_audio_specific_config->str_aac_config.ld_sbr_sample_rate)) ||
  ------------------
  |  Branch (407:8): [True: 728, False: 0]
  ------------------
  408|  4.32k|      (AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |  141|  4.32k|#define AOT_SBR (5)
  ------------------
                    (AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |   39|  3.99k|#define AOT_PS (29)
  ------------------
  |  Branch (408:7): [True: 329, False: 3.99k]
  |  Branch (408:27): [True: 194, False: 3.79k]
  ------------------
  409|       |    // dual rate
  410|  1.25k|    pstr_audio_specific_config->ext_sampling_frequency =
  411|  1.25k|        pstr_audio_specific_config->sampling_frequency;
  412|  1.25k|    pstr_audio_specific_config->sampling_frequency /= 2;
  413|       |
  414|  1.25k|    if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |  141|  1.25k|#define AOT_SBR (5)
  ------------------
                  if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |   39|    922|#define AOT_PS (29)
  ------------------
  |  Branch (414:9): [True: 329, False: 922]
  |  Branch (414:29): [True: 194, False: 728]
  ------------------
  415|    523|      aot = AOT_AAC_LC;
  ------------------
  |  |   34|    523|#define AOT_AAC_LC (2)
  ------------------
  416|    523|    }
  417|  1.25k|  }
  418|  5.04k|  pstr_audio_specific_config->audio_object_type = aot;
  419|  5.04k|  if (aot == AOT_USAC) {
  ------------------
  |  |  142|  5.04k|#define AOT_USAC (42)
  ------------------
  |  Branch (419:7): [True: 3.35k, False: 1.69k]
  ------------------
  420|  18.6k|    for (i = 0; i < sizeof(iusace_sampl_freq_idx_table) / sizeof(iusace_sampl_freq_idx_table[0]);
  ------------------
  |  Branch (420:17): [True: 18.6k, False: 0]
  ------------------
  421|  18.6k|         i++) {
  422|  18.6k|      if (pstr_audio_specific_config->sampling_frequency == iusace_sampl_freq_idx_table[i]) {
  ------------------
  |  Branch (422:11): [True: 3.35k, False: 15.2k]
  ------------------
  423|  3.35k|        tmp = i;
  424|  3.35k|        break;
  425|  3.35k|      }
  426|  18.6k|    }
  427|  3.35k|  } else {
  428|  12.6k|    for (i = 0; i < sizeof(ia_sampl_freq_table) / sizeof(ia_sampl_freq_table[0]); i++) {
  ------------------
  |  Branch (428:17): [True: 12.6k, False: 0]
  ------------------
  429|  12.6k|      if (ia_sampl_freq_table[i] == pstr_audio_specific_config->sampling_frequency) {
  ------------------
  |  Branch (429:11): [True: 1.69k, False: 10.9k]
  ------------------
  430|  1.69k|        tmp = i;
  431|  1.69k|        break;
  432|  1.69k|      }
  433|  12.6k|    }
  434|  1.69k|  }
  435|       |
  436|  5.04k|  pstr_audio_specific_config->samp_freq_index = (UWORD32)tmp;
  437|       |
  438|       |  // Write Audio Object Type
  439|  5.04k|  if (pstr_audio_specific_config->audio_object_type > 31) {
  ------------------
  |  Branch (439:7): [True: 4.08k, False: 963]
  ------------------
  440|  4.08k|    tmp = pstr_audio_specific_config->audio_object_type - 32;
  441|  4.08k|    pstr_audio_specific_config->audio_object_type = 31;
  442|  4.08k|  }
  443|  5.04k|  bit_cnt +=
  444|  5.04k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->audio_object_type), 5);
  445|  5.04k|  if (pstr_audio_specific_config->audio_object_type == 31) {
  ------------------
  |  Branch (445:7): [True: 4.08k, False: 963]
  ------------------
  446|  4.08k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, tmp, 6);
  447|  4.08k|    pstr_audio_specific_config->audio_object_type = tmp + 32;
  448|  4.08k|  }
  449|       |
  450|       |  // Write Audio Object Type
  451|  5.04k|  bit_cnt +=
  452|  5.04k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->samp_freq_index), 4);
  453|  5.04k|  if (pstr_audio_specific_config->samp_freq_index == 0xf) {
  ------------------
  |  Branch (453:7): [True: 0, False: 5.04k]
  ------------------
  454|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  455|      0|                                     (pstr_audio_specific_config->sampling_frequency), 24);
  456|  5.04k|  } else if (AOT_USAC != aot) {
  ------------------
  |  |  142|  5.04k|#define AOT_USAC (42)
  ------------------
  |  Branch (456:14): [True: 1.69k, False: 3.35k]
  ------------------
  457|  1.69k|    pstr_audio_specific_config->sampling_frequency =
  458|  1.69k|        ia_sampl_freq_table[pstr_audio_specific_config->samp_freq_index];
  459|  1.69k|  }
  460|  5.04k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  461|  5.04k|                                   (pstr_audio_specific_config->channel_configuration), 4);
  462|       |
  463|  5.04k|  if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |  141|  5.04k|#define AOT_SBR (5)
  ------------------
                if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |   39|  5.04k|#define AOT_PS (29)
  ------------------
  |  Branch (463:7): [True: 0, False: 5.04k]
  |  Branch (463:27): [True: 0, False: 5.04k]
  ------------------
  464|      0|    ext_aot = AOT_SBR;
  ------------------
  |  |  141|      0|#define AOT_SBR (5)
  ------------------
  465|      0|    sbr_present_flag = 1;
  466|      0|    tmp = 0x0f;
  467|      0|    for (i = 0; i < sizeof(ia_sampl_freq_table) / sizeof(ia_sampl_freq_table[0]); i++) {
  ------------------
  |  Branch (467:17): [True: 0, False: 0]
  ------------------
  468|      0|      if (ia_sampl_freq_table[i] == pstr_audio_specific_config->ext_sampling_frequency) {
  ------------------
  |  Branch (468:11): [True: 0, False: 0]
  ------------------
  469|      0|        tmp = i;
  470|      0|        break;
  471|      0|      }
  472|      0|    }
  473|      0|    pstr_audio_specific_config->ext_samp_freq_index = (UWORD32)tmp;
  474|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  475|      0|                                     (pstr_audio_specific_config->ext_samp_freq_index), 4);
  476|      0|    if (pstr_audio_specific_config->ext_samp_freq_index == 0xf) {
  ------------------
  |  Branch (476:9): [True: 0, False: 0]
  ------------------
  477|      0|      bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  478|      0|                                       (pstr_audio_specific_config->ext_sampling_frequency), 24);
  479|      0|    }
  480|      0|    if (AOT_PS == aot) {
  ------------------
  |  |   39|      0|#define AOT_PS (29)
  ------------------
  |  Branch (480:9): [True: 0, False: 0]
  ------------------
  481|      0|      ps_present_flag = 1;
  482|      0|    }
  483|       |
  484|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, AOT_AAC_LC, 5);
  ------------------
  |  |   34|      0|#define AOT_AAC_LC (2)
  ------------------
  485|      0|  }
  486|  5.04k|  switch (aot) {
  487|    728|    case AOT_AAC_ELD: {
  ------------------
  |  |   37|    728|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (487:5): [True: 728, False: 4.32k]
  ------------------
  488|    728|      bit_cnt += iaace_get_eld_specific_config_bytes(
  489|    728|          pstr_it_bit_buff, &pstr_audio_specific_config->str_aac_config,
  490|    728|          pstr_audio_specific_config->channel_configuration);
  491|    728|      break;
  492|      0|    }
  493|    220|    case AOT_AAC_LD:
  ------------------
  |  |   36|    220|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (493:5): [True: 220, False: 4.82k]
  ------------------
  494|    963|    case AOT_AAC_LC:
  ------------------
  |  |   34|    963|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (494:5): [True: 743, False: 4.30k]
  ------------------
  495|    963|    case AOT_SBR:
  ------------------
  |  |  141|    963|#define AOT_SBR (5)
  ------------------
  |  Branch (495:5): [True: 0, False: 5.04k]
  ------------------
  496|    963|    case AOT_PS: {
  ------------------
  |  |   39|    963|#define AOT_PS (29)
  ------------------
  |  Branch (496:5): [True: 0, False: 5.04k]
  ------------------
  497|    963|      bit_cnt += iaace_ga_specific_config_bytes(
  498|    963|          pstr_it_bit_buff, &pstr_audio_specific_config->str_aac_config,
  499|    963|          pstr_audio_specific_config->channel_configuration, aot);
  500|       |
  501|    963|      if (AOT_AAC_LD == aot) {
  ------------------
  |  |   36|    963|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (501:11): [True: 220, False: 743]
  ------------------
  502|       |        // epconfig
  503|    220|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, 0, 2);
  504|    220|      }
  505|    963|      if (AOT_SBR == ext_aot) {
  ------------------
  |  |  141|    963|#define AOT_SBR (5)
  ------------------
  |  Branch (505:11): [True: 0, False: 963]
  ------------------
  506|      0|        ext_id = 0x2b7;
  507|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, ext_id, 11);
  508|       |
  509|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, aot, 5);
  510|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, sbr_present_flag, 1);
  511|      0|        if (sbr_present_flag) {
  ------------------
  |  Branch (511:13): [True: 0, False: 0]
  ------------------
  512|      0|          bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  513|      0|                                           (pstr_audio_specific_config->ext_samp_freq_index), 4);
  514|      0|          if (pstr_audio_specific_config->ext_samp_freq_index == 0xf) {
  ------------------
  |  Branch (514:15): [True: 0, False: 0]
  ------------------
  515|      0|            bit_cnt += iusace_write_bits_buf(
  516|      0|                pstr_it_bit_buff, (pstr_audio_specific_config->ext_sampling_frequency), 24);
  517|      0|          }
  518|       |
  519|      0|          if (AOT_PS == aot) {
  ------------------
  |  |   39|      0|#define AOT_PS (29)
  ------------------
  |  Branch (519:15): [True: 0, False: 0]
  ------------------
  520|      0|            ext_id = 0x548;
  521|      0|            bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, ext_id, 11);
  522|      0|            bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, ps_present_flag, 1);
  523|      0|          }
  524|      0|        }
  525|      0|      }
  526|    963|      break;
  527|    963|    }
  528|       |
  529|  3.35k|    case AOT_USAC: {
  ------------------
  |  |  142|  3.35k|#define AOT_USAC (42)
  ------------------
  |  Branch (529:5): [True: 3.35k, False: 1.69k]
  ------------------
  530|  3.35k|      WORD32 sbr_ratio_idx;
  531|  3.35k|      ia_usac_config_struct *pstr_usac_config = &(pstr_audio_specific_config->str_usac_config);
  532|  3.35k|      WORD32 ia_ccfl_tbl[5] = {768, 1024, 768, 1024, 1024};
  533|  3.35k|      pstr_audio_specific_config->core_sbr_framelength_index =
  534|  3.35k|          ccfl_idx;  // 768 core coder frame length without SBR
  535|  3.35k|      pstr_usac_config->ccfl =
  536|  3.35k|          ia_ccfl_tbl[pstr_audio_specific_config->core_sbr_framelength_index];
  537|  3.35k|      tmp = 0x1f;
  538|  18.6k|      for (i = 0; i < sizeof(ia_usac_sampl_freq_table) / sizeof(ia_usac_sampl_freq_table[0]);
  ------------------
  |  Branch (538:19): [True: 18.6k, False: 0]
  ------------------
  539|  18.6k|           i++) {
  540|  18.6k|        if (ia_usac_sampl_freq_table[i] == pstr_audio_specific_config->sampling_frequency) {
  ------------------
  |  Branch (540:13): [True: 3.35k, False: 15.2k]
  ------------------
  541|  3.35k|          tmp = i;
  542|  3.35k|          break;
  543|  3.35k|        }
  544|  18.6k|      }
  545|  3.35k|      pstr_audio_specific_config->samp_freq_index = (UWORD32)tmp;
  546|       |
  547|  3.35k|      if (pstr_audio_specific_config->samp_freq_index == 0x1f) {
  ------------------
  |  Branch (547:11): [True: 0, False: 3.35k]
  ------------------
  548|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, 0x1f, 5);
  549|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  550|      0|                                         (pstr_audio_specific_config->sampling_frequency), 24);
  551|  3.35k|      } else {
  552|  3.35k|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  553|  3.35k|                                         (pstr_audio_specific_config->samp_freq_index), 5);
  554|  3.35k|      }
  555|       |
  556|  3.35k|      bit_cnt += iusace_write_bits_buf(
  557|  3.35k|          pstr_it_bit_buff, (pstr_audio_specific_config->core_sbr_framelength_index), 3);
  558|       |
  559|  3.35k|      bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  560|  3.35k|                                       (pstr_audio_specific_config->channel_configuration), 5);
  561|       |
  562|  3.35k|      if (pstr_audio_specific_config->channel_configuration == 0) {
  ------------------
  |  Branch (562:11): [True: 0, False: 3.35k]
  ------------------
  563|      0|        bit_cnt += iusace_write_escape_value(
  564|      0|            pstr_it_bit_buff, pstr_audio_specific_config->num_audio_channels, 5, 8, 16);
  565|       |
  566|      0|        for (i = 0; i < pstr_audio_specific_config->num_audio_channels; i++) {
  ------------------
  |  Branch (566:21): [True: 0, False: 0]
  ------------------
  567|      0|          tmp = pstr_audio_specific_config->output_channel_pos[i];
  568|      0|          bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, tmp, 5);
  569|      0|        }
  570|      0|      }
  571|       |
  572|  3.35k|      sbr_ratio_idx = ixheaace_sbr_ratio(pstr_audio_specific_config->core_sbr_framelength_index);
  573|       |
  574|  3.35k|      bit_cnt += iusace_encoder_config(pstr_it_bit_buff, pstr_usac_config, sbr_ratio_idx,
  575|  3.35k|                                       &pstr_audio_specific_config->str_aac_config);
  576|       |
  577|  3.35k|      bit_cnt +=
  578|  3.35k|          iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_config->usac_cfg_ext_present, 1);
  579|  3.35k|      if (pstr_usac_config->usac_cfg_ext_present) {
  ------------------
  |  Branch (579:11): [True: 3.35k, False: 0]
  ------------------
  580|  3.35k|        bit_cnt += iusace_config_extension(pstr_it_bit_buff, pstr_usac_config);
  581|  3.35k|      }
  582|       |
  583|  3.35k|      if (sbr_ratio_idx)
  ------------------
  |  Branch (583:11): [True: 2.38k, False: 973]
  ------------------
  584|  2.38k|        pstr_audio_specific_config->sbr_present_flag = 1;
  585|    973|      else
  586|    973|        pstr_audio_specific_config->sbr_present_flag = 0;
  587|       |
  588|  3.35k|      pstr_audio_specific_config->ext_audio_object_type = 0;
  589|       |
  590|  3.35k|      if (pstr_audio_specific_config->ext_audio_object_type == AOT_SBR) {
  ------------------
  |  |  141|  3.35k|#define AOT_SBR (5)
  ------------------
  |  Branch (590:11): [True: 0, False: 3.35k]
  ------------------
  591|      0|        pstr_audio_specific_config->ext_sync_word = 0x2b7;
  592|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  593|      0|                                         (pstr_audio_specific_config->ext_sync_word), 11);
  594|       |
  595|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  596|      0|                                         (pstr_audio_specific_config->ext_audio_object_type), 5);
  597|       |
  598|      0|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  599|      0|                                         (pstr_audio_specific_config->sbr_present_flag), 1);
  600|       |
  601|      0|        if (pstr_audio_specific_config->sbr_present_flag == 1) {
  ------------------
  |  Branch (601:13): [True: 0, False: 0]
  ------------------
  602|      0|          bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  603|      0|                                           (pstr_audio_specific_config->ext_samp_freq_index), 4);
  604|       |
  605|      0|          if (pstr_audio_specific_config->ext_samp_freq_index == 0xf) {
  ------------------
  |  Branch (605:15): [True: 0, False: 0]
  ------------------
  606|      0|            bit_cnt += iusace_write_bits_buf(
  607|      0|                pstr_it_bit_buff, (pstr_audio_specific_config->ext_sampling_frequency), 24);
  608|      0|          }
  609|      0|        }
  610|      0|      }
  611|  3.35k|    }
  612|  3.35k|    default:
  ------------------
  |  Branch (612:5): [True: 0, False: 5.04k]
  ------------------
  613|  3.35k|      break;
  614|  5.04k|  }
  615|  5.04k|  return bit_cnt;
  616|  5.04k|}
ixheaace_get_usac_config_bytes:
  620|  9.18k|    ixheaace_audio_specific_config_struct *pstr_audio_specific_config, WORD32 ccfl_idx) {
  621|  9.18k|  WORD32 sbr_ratio_idx;
  622|  9.18k|  ia_usac_config_struct *pstr_usac_config = &(pstr_audio_specific_config->str_usac_config);
  623|  9.18k|  WORD32 ia_ccfl_tbl[5] = {768, 1024, 768, 1024, 1024};
  624|  9.18k|  WORD32 i, tmp, bit_cnt = 0;
  625|  9.18k|  pstr_audio_specific_config->core_sbr_framelength_index =
  626|  9.18k|      ccfl_idx;  // 768 core coder frame length without SBR
  627|  9.18k|  pstr_usac_config->ccfl = ia_ccfl_tbl[pstr_audio_specific_config->core_sbr_framelength_index];
  628|  9.18k|  tmp = 0x1f;
  629|  67.6k|  for (i = 0; i < sizeof(ia_usac_sampl_freq_table) / sizeof(ia_usac_sampl_freq_table[0]); i++) {
  ------------------
  |  Branch (629:15): [True: 67.6k, False: 0]
  ------------------
  630|  67.6k|    if (ia_usac_sampl_freq_table[i] == pstr_audio_specific_config->sampling_frequency) {
  ------------------
  |  Branch (630:9): [True: 9.18k, False: 58.5k]
  ------------------
  631|  9.18k|      tmp = i;
  632|  9.18k|      break;
  633|  9.18k|    }
  634|  67.6k|  }
  635|  9.18k|  pstr_audio_specific_config->samp_freq_index = (UWORD32)tmp;
  636|       |
  637|  9.18k|  if (pstr_audio_specific_config->samp_freq_index == 0x1f) {
  ------------------
  |  Branch (637:7): [True: 0, False: 9.18k]
  ------------------
  638|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, 0x1f, 5);
  639|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  640|      0|                                     (pstr_audio_specific_config->sampling_frequency), 24);
  641|  9.18k|  } else {
  642|  9.18k|    bit_cnt +=
  643|  9.18k|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->samp_freq_index), 5);
  644|  9.18k|  }
  645|       |
  646|  9.18k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  647|  9.18k|                                   (pstr_audio_specific_config->core_sbr_framelength_index), 3);
  648|       |
  649|  9.18k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  650|  9.18k|                                   (pstr_audio_specific_config->channel_configuration), 5);
  651|       |
  652|  9.18k|  if (pstr_audio_specific_config->channel_configuration == 0) {
  ------------------
  |  Branch (652:7): [True: 0, False: 9.18k]
  ------------------
  653|      0|    bit_cnt += iusace_write_escape_value(
  654|      0|        pstr_it_bit_buff, pstr_audio_specific_config->num_audio_channels, 5, 8, 16);
  655|       |
  656|      0|    for (i = 0; i < pstr_audio_specific_config->num_audio_channels; i++) {
  ------------------
  |  Branch (656:17): [True: 0, False: 0]
  ------------------
  657|      0|      tmp = pstr_audio_specific_config->output_channel_pos[i];
  658|      0|      bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, tmp, 5);
  659|      0|    }
  660|      0|  }
  661|       |
  662|  9.18k|  sbr_ratio_idx = ixheaace_sbr_ratio(pstr_audio_specific_config->core_sbr_framelength_index);
  663|       |
  664|  9.18k|  bit_cnt += iusace_encoder_config(pstr_it_bit_buff, pstr_usac_config, sbr_ratio_idx,
  665|  9.18k|                                   &pstr_audio_specific_config->str_aac_config);
  666|       |
  667|  9.18k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_config->usac_cfg_ext_present, 1);
  668|  9.18k|  if (pstr_usac_config->usac_cfg_ext_present) {
  ------------------
  |  Branch (668:7): [True: 9.18k, False: 0]
  ------------------
  669|  9.18k|    bit_cnt += iusace_config_extension(pstr_it_bit_buff, pstr_usac_config);
  670|  9.18k|  }
  671|       |
  672|  9.18k|  if (sbr_ratio_idx)
  ------------------
  |  Branch (672:7): [True: 5.27k, False: 3.91k]
  ------------------
  673|  5.27k|    pstr_audio_specific_config->sbr_present_flag = 1;
  674|  3.91k|  else
  675|  3.91k|    pstr_audio_specific_config->sbr_present_flag = 0;
  676|       |
  677|  9.18k|  pstr_audio_specific_config->ext_audio_object_type = 0;
  678|       |
  679|  9.18k|  if (pstr_audio_specific_config->ext_audio_object_type == AOT_SBR) {
  ------------------
  |  |  141|  9.18k|#define AOT_SBR (5)
  ------------------
  |  Branch (679:7): [True: 0, False: 9.18k]
  ------------------
  680|      0|    pstr_audio_specific_config->ext_sync_word = 0x2b7;
  681|      0|    bit_cnt +=
  682|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->ext_sync_word), 11);
  683|       |
  684|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  685|      0|                                     (pstr_audio_specific_config->ext_audio_object_type), 5);
  686|       |
  687|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  688|      0|                                     (pstr_audio_specific_config->sbr_present_flag), 1);
  689|       |
  690|      0|    if (pstr_audio_specific_config->sbr_present_flag == 1) {
  ------------------
  |  Branch (690:9): [True: 0, False: 0]
  ------------------
  691|      0|      bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  692|      0|                                       (pstr_audio_specific_config->ext_samp_freq_index), 4);
  693|       |
  694|      0|      if (pstr_audio_specific_config->ext_samp_freq_index == 0xf) {
  ------------------
  |  Branch (694:11): [True: 0, False: 0]
  ------------------
  695|      0|        bit_cnt += iusace_write_bits_buf(
  696|      0|            pstr_it_bit_buff, (pstr_audio_specific_config->ext_sampling_frequency), 24);
  697|      0|      }
  698|      0|    }
  699|      0|  }
  700|  9.18k|  return bit_cnt;
  701|  9.18k|}
ixheaace_asc_write.c:iaace_get_eld_specific_config_bytes:
  327|    728|                                                  WORD32 channel_configuration) {
  328|    728|  WORD32 bit_cnt = 0;
  329|    728|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->frame_length_flag), 1);
  330|    728|  bit_cnt +=
  331|    728|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->aac_sec_data_resilience_flag), 1);
  332|    728|  bit_cnt +=
  333|    728|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->aac_sf_data_resilience_flag), 1);
  334|    728|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  335|    728|                                   (pstr_eld_config->aac_spec_data_resilience_flag), 1);
  336|    728|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->ld_sbr_present_flag), 1);
  337|       |
  338|    728|  if (pstr_eld_config->ld_sbr_present_flag) {
  ------------------
  |  Branch (338:7): [True: 728, False: 0]
  ------------------
  339|    728|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->ld_sbr_sample_rate), 1);
  340|    728|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->ld_sbr_crc_flag), 1);
  341|    728|    bit_cnt +=
  342|    728|        ld_sbr_header(pstr_it_bit_buff, pstr_eld_config->sbr_config, channel_configuration);
  343|    728|  }
  344|       |
  345|    728|  if (pstr_eld_config->num_sac_cfg_bits) {
  ------------------
  |  Branch (345:7): [True: 467, False: 261]
  ------------------
  346|    467|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->eld_ext_type[0]), 4);
  347|    467|    bit_cnt +=
  348|    467|        iusace_write_escape_value(pstr_it_bit_buff, (pstr_eld_config->eld_ext_len[0]), 4, 8, 16);
  349|    467|    if (IAAC_ELDEXT_LDSAC == pstr_eld_config->eld_ext_type[0]) {
  ------------------
  |  Branch (349:9): [True: 467, False: 0]
  ------------------
  350|    467|      bit_cnt += ixheaace_spatial_specific_config(pstr_it_bit_buff, pstr_eld_config);
  351|    467|    }
  352|    467|  }
  353|    728|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (IAAC_ELDEXT_TERM), 4);
  354|       |
  355|    728|  return bit_cnt;
  356|    728|}
ixheaace_asc_write.c:ld_sbr_header:
  297|    728|                            WORD32 channel_configuration) {
  298|    728|  WORD32 num_sbr_header, el, bit_cnt = 0;
  299|    728|  switch (channel_configuration) {
  300|    290|    case 1:
  ------------------
  |  Branch (300:5): [True: 290, False: 438]
  ------------------
  301|    544|    case 2:
  ------------------
  |  Branch (301:5): [True: 254, False: 474]
  ------------------
  302|    544|      num_sbr_header = 1;
  303|    544|      break;
  304|     23|    case 3:
  ------------------
  |  Branch (304:5): [True: 23, False: 705]
  ------------------
  305|     23|      num_sbr_header = 2;
  306|     23|      break;
  307|     38|    case 4:
  ------------------
  |  Branch (307:5): [True: 38, False: 690]
  ------------------
  308|     62|    case 5:
  ------------------
  |  Branch (308:5): [True: 24, False: 704]
  ------------------
  309|    161|    case 6:
  ------------------
  |  Branch (309:5): [True: 99, False: 629]
  ------------------
  310|    161|      num_sbr_header = 3;
  311|    161|      break;
  312|      0|    case 7:
  ------------------
  |  Branch (312:5): [True: 0, False: 728]
  ------------------
  313|      0|      num_sbr_header = 4;
  314|      0|      break;
  315|      0|    default:
  ------------------
  |  Branch (315:5): [True: 0, False: 728]
  ------------------
  316|      0|      num_sbr_header = 0;
  317|      0|      break;
  318|    728|  }
  319|  1.80k|  for (el = 0; el < num_sbr_header; el++) {
  ------------------
  |  Branch (319:16): [True: 1.07k, False: 728]
  ------------------
  320|  1.07k|    bit_cnt += sbr_header(pstr_it_bit_buff, pstr_sbr_config);
  321|  1.07k|  }
  322|    728|  return bit_cnt;
  323|    728|}
ixheaace_asc_write.c:sbr_header:
  270|  1.07k|                         ixheaace_pstr_sbr_hdr_data pstr_sbr_config) {
  271|  1.07k|  WORD32 bit_cnt = 0;
  272|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_amp_res), 1);
  273|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_start_freq), 4);
  274|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_stop_freq), 4);
  275|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_xover_band), 3);
  276|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (0), 2);  // reserved bits
  277|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->header_extra_1), 1);
  278|  1.07k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->header_extra_2), 1);
  279|  1.07k|  if (pstr_sbr_config->header_extra_1) {
  ------------------
  |  Branch (279:7): [True: 798, False: 275]
  ------------------
  280|    798|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->freq_scale), 2);
  281|    798|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->alter_scale), 1);
  282|    798|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_noise_bands), 2);
  283|    798|  }
  284|       |
  285|  1.07k|  if (pstr_sbr_config->header_extra_2) {
  ------------------
  |  Branch (285:7): [True: 0, False: 1.07k]
  ------------------
  286|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_limiter_bands), 2);
  287|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_limiter_gains), 2);
  288|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_interpol_freq), 1);
  289|      0|    bit_cnt +=
  290|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_smoothing_length), 1);
  291|      0|  }
  292|  1.07k|  return bit_cnt;
  293|  1.07k|}
ixheaace_asc_write.c:ixheaace_spatial_specific_config:
   51|  2.92k|                                               ia_aace_config_struct *pstr_eld_config) {
   52|  2.92k|  WORD32 bit_cnt = 0, cnt = 0;
   53|  2.92k|  WORD32 num_bytes = pstr_eld_config->num_sac_cfg_bits >> 3;
   54|  10.2k|  for (cnt = 0; cnt < num_bytes; cnt++) {
  ------------------
  |  Branch (54:17): [True: 7.33k, False: 2.92k]
  ------------------
   55|  7.33k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->sac_cfg_data[cnt]), 8);
   56|  7.33k|  }
   57|  2.92k|  if (pstr_eld_config->num_sac_cfg_bits & 0x7) {
  ------------------
  |  Branch (57:7): [True: 2.45k, False: 467]
  ------------------
   58|  2.45k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->sac_cfg_data[cnt]),
   59|  2.45k|                                     (pstr_eld_config->num_sac_cfg_bits & 0x7));
   60|  2.45k|  }
   61|       |
   62|  2.92k|  return bit_cnt;
   63|  2.92k|}
ixheaace_asc_write.c:iaace_ga_specific_config_bytes:
  360|    963|                                             WORD32 channel_configuration, WORD32 aot) {
  361|    963|  WORD32 bit_cnt = 0;
  362|    963|  bit_cnt +=
  363|    963|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_ga_specific_config->frame_length_flag), 1);
  364|    963|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  365|    963|                                   (pstr_ga_specific_config->depends_on_core_coder), 1);
  366|    963|  if (pstr_ga_specific_config->depends_on_core_coder) {
  ------------------
  |  Branch (366:7): [True: 0, False: 963]
  ------------------
  367|      0|    bit_cnt +=
  368|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_ga_specific_config->core_coder_delay), 14);
  369|      0|  }
  370|    963|  if (!channel_configuration) {
  ------------------
  |  Branch (370:7): [True: 0, False: 963]
  ------------------
  371|      0|  }
  372|       |
  373|    963|  if (AOT_AAC_LD == aot) {
  ------------------
  |  |   36|    963|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (373:7): [True: 220, False: 743]
  ------------------
  374|    220|    pstr_ga_specific_config->extension_flag = 1;
  375|    220|  }
  376|    963|  if (AOT_AAC_LC == aot) {
  ------------------
  |  |   34|    963|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (376:7): [True: 743, False: 220]
  ------------------
  377|    743|    pstr_ga_specific_config->extension_flag = 0;
  378|    743|  }
  379|    963|  bit_cnt +=
  380|    963|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_ga_specific_config->extension_flag), 1);
  381|       |
  382|    963|  if ((pstr_ga_specific_config->extension_flag) && ((AOT_AAC_LD == aot))) {
  ------------------
  |  |   36|    220|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (382:7): [True: 220, False: 743]
  |  Branch (382:52): [True: 220, False: 0]
  ------------------
  383|    220|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  384|    220|                                     (pstr_ga_specific_config->aac_sec_data_resilience_flag), 1);
  385|    220|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  386|    220|                                     (pstr_ga_specific_config->aac_sf_data_resilience_flag), 1);
  387|    220|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  388|    220|                                     (pstr_ga_specific_config->aac_spec_data_resilience_flag), 1);
  389|       |
  390|       |    // extension flag 3
  391|    220|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  392|    220|  }
  393|    963|  return bit_cnt;
  394|    963|}
ixheaace_asc_write.c:ixheaace_sbr_ratio:
  248|  12.5k|static UWORD32 ixheaace_sbr_ratio(UWORD32 core_sbr_framelength_idx) {
  249|  12.5k|  UWORD32 sbr_ratio_index = 0x0FF;
  250|       |
  251|  12.5k|  switch (core_sbr_framelength_idx) {
  ------------------
  |  Branch (251:11): [True: 12.5k, False: 0]
  ------------------
  252|  1.35k|    case 0:
  ------------------
  |  Branch (252:5): [True: 1.35k, False: 11.1k]
  ------------------
  253|  4.88k|    case 1:
  ------------------
  |  Branch (253:5): [True: 3.52k, False: 9.01k]
  ------------------
  254|  4.88k|      sbr_ratio_index = USAC_SBR_RATIO_NO_SBR;
  ------------------
  |  |  185|  4.88k|#define USAC_SBR_RATIO_NO_SBR (0)
  ------------------
  255|  4.88k|      break;
  256|  1.41k|    case 2:
  ------------------
  |  Branch (256:5): [True: 1.41k, False: 11.1k]
  ------------------
  257|  1.41k|      sbr_ratio_index = USAC_SBR_RATIO_INDEX_8_3;
  ------------------
  |  |  187|  1.41k|#define USAC_SBR_RATIO_INDEX_8_3 (2)
  ------------------
  258|  1.41k|      break;
  259|  4.58k|    case 3:
  ------------------
  |  Branch (259:5): [True: 4.58k, False: 7.95k]
  ------------------
  260|  4.58k|      sbr_ratio_index = USAC_SBR_RATIO_INDEX_2_1;
  ------------------
  |  |  186|  4.58k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  261|  4.58k|      break;
  262|  1.65k|    case 4:
  ------------------
  |  Branch (262:5): [True: 1.65k, False: 10.8k]
  ------------------
  263|  1.65k|      sbr_ratio_index = USAC_SBR_RATIO_INDEX_4_1;
  ------------------
  |  |  188|  1.65k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  264|  1.65k|      break;
  265|  12.5k|  }
  266|       |
  267|  12.5k|  return sbr_ratio_index;
  268|  12.5k|}
ixheaace_asc_write.c:iusace_encoder_config:
  202|  12.5k|                                    ia_aace_config_struct *pstr_eld_config) {
  203|  12.5k|  WORD32 bit_cnt = 0;
  204|  12.5k|  UWORD32 elem_idx = 0;
  205|  12.5k|  ia_usac_enc_element_config_struct *pstr_usac_enc_conf;
  206|       |
  207|  12.5k|  bit_cnt +=
  208|  12.5k|      iusace_write_escape_value(pstr_it_bit_buff, pstr_usac_cfg->num_elements - 1, 4, 8, 16);
  209|       |
  210|  52.0k|  for (elem_idx = 0; elem_idx < pstr_usac_cfg->num_elements; elem_idx++) {
  ------------------
  |  Branch (210:22): [True: 39.4k, False: 12.5k]
  ------------------
  211|  39.4k|    unsigned long tmp = pstr_usac_cfg->usac_element_type[elem_idx];
  212|  39.4k|    pstr_usac_enc_conf = &pstr_usac_cfg->str_usac_element_config[elem_idx];
  213|  39.4k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, tmp, 2);
  214|       |
  215|  39.4k|    switch (pstr_usac_cfg->usac_element_type[elem_idx]) {
  216|  3.32k|      case ID_USAC_SCE:
  ------------------
  |  |  137|  3.32k|#define ID_USAC_SCE 0
  ------------------
  |  Branch (216:7): [True: 3.32k, False: 36.1k]
  ------------------
  217|  3.32k|        bit_cnt += iusace_write_bits_buf(
  218|  3.32k|            pstr_it_bit_buff, (pstr_usac_enc_conf->tw_mdct),
  219|  3.32k|            1);  // For extended HE AAC profile tw_mdct shall be encoded with 0.
  220|  3.32k|        bit_cnt +=
  221|  3.32k|            iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_enc_conf->noise_filling), 1);
  222|  3.32k|        if (sbr_ratio_idx > 0) {
  ------------------
  |  Branch (222:13): [True: 2.00k, False: 1.32k]
  ------------------
  223|  2.00k|          bit_cnt +=
  224|  2.00k|              iusace_sbr_config(pstr_it_bit_buff, &(pstr_usac_enc_conf->str_usac_sbr_config));
  225|  2.00k|        }
  226|  3.32k|        break;
  227|  9.21k|      case ID_USAC_CPE:
  ------------------
  |  |  138|  9.21k|#define ID_USAC_CPE 1
  ------------------
  |  Branch (227:7): [True: 9.21k, False: 30.2k]
  ------------------
  228|  9.21k|        bit_cnt += iusace_write_bits_buf(
  229|  9.21k|            pstr_it_bit_buff, (pstr_usac_enc_conf->tw_mdct),
  230|  9.21k|            1);  // For extended HE AAC profile tw_mdct shall be encoded with 0.
  231|  9.21k|        bit_cnt +=
  232|  9.21k|            iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_enc_conf->noise_filling), 1);
  233|  9.21k|        bit_cnt += iusace_cpe_config(pstr_it_bit_buff, pstr_usac_enc_conf, sbr_ratio_idx,
  234|  9.21k|                                     pstr_eld_config);
  235|  9.21k|        break;
  236|  26.9k|      case ID_USAC_EXT:
  ------------------
  |  |  139|  26.9k|#define ID_USAC_EXT 3
  ------------------
  |  Branch (236:7): [True: 26.9k, False: 12.5k]
  ------------------
  237|  26.9k|        bit_cnt += iusace_ext_element_config(pstr_it_bit_buff, pstr_usac_enc_conf);
  238|  26.9k|        break;
  239|      0|      default:
  ------------------
  |  Branch (239:7): [True: 0, False: 39.4k]
  ------------------
  240|      0|        return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_ELEMENT_TYPE;
  241|      0|        break;
  242|  39.4k|    }
  243|  39.4k|  }
  244|       |
  245|  12.5k|  return bit_cnt;
  246|  12.5k|}
ixheaace_asc_write.c:iusace_sbr_config:
  108|  7.65k|                                ia_usac_enc_sbr_config_struct *pstr_usac_sbr_config) {
  109|  7.65k|  WORD32 bit_cnt = 0;
  110|       |
  111|  7.65k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->harmonic_sbr), 1);
  112|  7.65k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->bs_inter_tes), 1);
  113|  7.65k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->bs_pvc), 1);
  114|  7.65k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_start_freq), 4);
  115|  7.65k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_stop_freq), 4);
  116|  7.65k|  bit_cnt +=
  117|  7.65k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_header_extra1), 1);
  118|  7.65k|  bit_cnt +=
  119|  7.65k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_header_extra2), 1);
  120|       |
  121|  7.65k|  if (pstr_usac_sbr_config->dflt_header_extra1) {
  ------------------
  |  Branch (121:7): [True: 0, False: 7.65k]
  ------------------
  122|      0|    bit_cnt +=
  123|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_freq_scale), 2);
  124|      0|    bit_cnt +=
  125|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_alter_scale), 2);
  126|      0|    bit_cnt +=
  127|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_noise_bands), 2);
  128|      0|  }
  129|       |
  130|  7.65k|  if (pstr_usac_sbr_config->dflt_header_extra2) {
  ------------------
  |  Branch (130:7): [True: 0, False: 7.65k]
  ------------------
  131|      0|    bit_cnt +=
  132|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_limiter_bands), 2);
  133|      0|    bit_cnt +=
  134|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_limiter_gains), 2);
  135|      0|    bit_cnt +=
  136|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_interpol_freq), 1);
  137|      0|    bit_cnt +=
  138|      0|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_smoothing_mode), 1);
  139|      0|  }
  140|       |
  141|  7.65k|  return bit_cnt;
  142|  7.65k|}
ixheaace_asc_write.c:iusace_cpe_config:
  146|  9.21k|                                WORD32 sbr_ratio_idx, ia_aace_config_struct *pstr_eld_config) {
  147|  9.21k|  WORD32 bit_count = 0;
  148|       |
  149|  9.21k|  if (sbr_ratio_idx > 0) {
  ------------------
  |  Branch (149:7): [True: 5.65k, False: 3.56k]
  ------------------
  150|  5.65k|    bit_count += iusace_sbr_config(pstr_it_bit_buff, &(pstr_usac_enc_conf->str_usac_sbr_config));
  151|  5.65k|    bit_count +=
  152|  5.65k|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_enc_conf->stereo_config_index), 2);
  153|  5.65k|  }
  154|       |
  155|  9.21k|  if (pstr_usac_enc_conf->stereo_config_index > 0) {
  ------------------
  |  Branch (155:7): [True: 2.45k, False: 6.75k]
  ------------------
  156|  2.45k|    if (pstr_eld_config->num_sac_cfg_bits) {
  ------------------
  |  Branch (156:9): [True: 2.45k, False: 0]
  ------------------
  157|  2.45k|      {
  158|  2.45k|        bit_count += ixheaace_spatial_specific_config(pstr_it_bit_buff, pstr_eld_config);
  159|  2.45k|      }
  160|  2.45k|    }
  161|  2.45k|  }
  162|       |
  163|  9.21k|  return bit_count;
  164|  9.21k|}
ixheaace_asc_write.c:iusace_ext_element_config:
  166|  26.9k|                                        ia_usac_enc_element_config_struct *pstr_usac_enc_conf) {
  167|  26.9k|  WORD32 bit_count = 0;
  168|       |
  169|  26.9k|  bit_count += iusace_write_escape_value(pstr_it_bit_buff, pstr_usac_enc_conf->usac_ext_ele_type,
  170|  26.9k|                                         4, 8, 16);
  171|  26.9k|  bit_count += iusace_write_escape_value(pstr_it_bit_buff,
  172|  26.9k|                                         pstr_usac_enc_conf->usac_ext_ele_cfg_len, 4, 8, 16);
  173|  26.9k|  bit_count += iusace_write_bits_buf(pstr_it_bit_buff,
  174|  26.9k|                                     (pstr_usac_enc_conf->usac_ext_ele_dflt_len_present), 1);
  175|       |
  176|  26.9k|  if (pstr_usac_enc_conf->usac_ext_ele_dflt_len_present) {
  ------------------
  |  Branch (176:7): [True: 0, False: 26.9k]
  ------------------
  177|      0|    bit_count += iusace_write_escape_value(
  178|      0|        pstr_it_bit_buff, pstr_usac_enc_conf->usac_ext_ele_dflt_len - 1, 8, 16, 0);
  179|      0|  }
  180|  26.9k|  bit_count += iusace_write_bits_buf(pstr_it_bit_buff,
  181|  26.9k|                                     (pstr_usac_enc_conf->usac_ext_ele_payload_present), 1);
  182|       |
  183|  26.9k|  switch (pstr_usac_enc_conf->usac_ext_ele_type) {
  184|  12.5k|    case ID_EXT_ELE_FILL:
  ------------------
  |  |  144|  12.5k|#define ID_EXT_ELE_FILL 0
  ------------------
  |  Branch (184:5): [True: 12.5k, False: 14.3k]
  ------------------
  185|  12.5k|      break;
  186|  1.84k|    case ID_EXT_ELE_UNI_DRC: {
  ------------------
  |  |  145|  1.84k|#define ID_EXT_ELE_UNI_DRC 4
  ------------------
  |  Branch (186:5): [True: 1.84k, False: 25.0k]
  ------------------
  187|  1.84k|      UWORD32 i;
  188|  45.5k|      for (i = 0; i < pstr_usac_enc_conf->usac_ext_ele_cfg_len; i++) {
  ------------------
  |  Branch (188:19): [True: 43.7k, False: 1.84k]
  ------------------
  189|  43.7k|        bit_count +=
  190|  43.7k|            iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_enc_conf->drc_config_data[i], 8);
  191|  43.7k|      }
  192|  1.84k|    } break;
  193|  12.5k|    default:
  ------------------
  |  Branch (193:5): [True: 12.5k, False: 14.3k]
  ------------------
  194|  12.5k|      break;
  195|  26.9k|  }
  196|       |
  197|  26.9k|  return bit_count;
  198|  26.9k|}
ixheaace_asc_write.c:iusace_config_extension:
   65|  12.5k|                                      ia_usac_config_struct *pstr_usac_config) {
   66|  12.5k|  WORD32 bit_cnt = 0;
   67|  12.5k|  UWORD32 i, j;
   68|  12.5k|  UWORD32 fill_byte_val = 0xa5;
   69|       |
   70|  12.5k|  bit_cnt += iusace_write_escape_value(pstr_it_bit_buff,
   71|  12.5k|                                       pstr_usac_config->num_config_extensions - 1, 2, 4, 8);
   72|       |
   73|  37.6k|  for (j = 0; j < pstr_usac_config->num_config_extensions; j++) {
  ------------------
  |  Branch (73:15): [True: 25.0k, False: 12.5k]
  ------------------
   74|  25.0k|    bit_cnt += iusace_write_escape_value(pstr_it_bit_buff,
   75|  25.0k|                                         pstr_usac_config->usac_config_ext_type[j], 4, 8, 16);
   76|       |
   77|  25.0k|    bit_cnt += iusace_write_escape_value(pstr_it_bit_buff,
   78|  25.0k|                                         pstr_usac_config->usac_config_ext_len[j], 4, 8, 16);
   79|       |
   80|  25.0k|    switch (pstr_usac_config->usac_config_ext_type[j]) {
   81|      0|      case ID_CONFIG_EXT_FILL:
  ------------------
  |  |  148|      0|#define ID_CONFIG_EXT_FILL 0
  ------------------
  |  Branch (81:7): [True: 0, False: 25.0k]
  ------------------
   82|      0|        for (i = 0; i < pstr_usac_config->usac_config_ext_len[j]; i++) {
  ------------------
  |  Branch (82:21): [True: 0, False: 0]
  ------------------
   83|      0|          bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, fill_byte_val, 8);
   84|      0|        }
   85|      0|        break;
   86|  12.5k|      case ID_CONFIG_EXT_LOUDNESS_INFO:
  ------------------
  |  |  150|  12.5k|#define ID_CONFIG_EXT_LOUDNESS_INFO (2)
  ------------------
  |  Branch (86:7): [True: 12.5k, False: 12.5k]
  ------------------
   87|   262k|        for (i = 0; i < pstr_usac_config->usac_config_ext_len[j]; i++) {
  ------------------
  |  Branch (87:21): [True: 249k, False: 12.5k]
  ------------------
   88|   249k|          bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
   89|   249k|                                           pstr_usac_config->usac_config_ext_buf[j][i], 8);
   90|   249k|        }
   91|  12.5k|        break;
   92|  12.5k|      case ID_CONFIG_EXT_STREAM_ID:
  ------------------
  |  |  151|  12.5k|#define ID_CONFIG_EXT_STREAM_ID (7)
  ------------------
  |  Branch (92:7): [True: 12.5k, False: 12.5k]
  ------------------
   93|  12.5k|        bit_cnt +=
   94|  12.5k|            iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_config->stream_identifier, 16);
   95|  12.5k|        break;
   96|      0|      default:
  ------------------
  |  Branch (96:7): [True: 0, False: 25.0k]
  ------------------
   97|      0|        for (i = 0; i < pstr_usac_config->usac_config_ext_len[j]; i++) {
  ------------------
  |  Branch (97:21): [True: 0, False: 0]
  ------------------
   98|      0|          bit_cnt += iusace_write_bits_buf(
   99|      0|              pstr_it_bit_buff, (UWORD32)pstr_usac_config->usac_cfg_ext_info_buf[j][i], 8);
  100|      0|        }
  101|      0|        break;
  102|  25.0k|    }
  103|  25.0k|  }
  104|  12.5k|  return bit_cnt;
  105|  12.5k|}

ixheaace_div32:
   39|  51.4M|FLOAT32 ixheaace_div32(FLOAT32 num, FLOAT32 den) {
   40|  51.4M|  if (fabs(den) < FLT_EPSILON) {
  ------------------
  |  Branch (40:7): [True: 7.55M, False: 43.8M]
  ------------------
   41|  7.55M|    if (den < 0.0f) {
  ------------------
  |  Branch (41:9): [True: 0, False: 7.55M]
  ------------------
   42|      0|      return -num;
   43|      0|    }
   44|  7.55M|    else {
   45|  7.55M|      return num;
   46|  7.55M|    }
   47|  7.55M|  }
   48|  43.8M|  else {
   49|  43.8M|    return num / den;
   50|  43.8M|  }
   51|  51.4M|}
ixheaace_div64:
   53|  4.83k|FLOAT64 ixheaace_div64(FLOAT64 num, FLOAT64 den) {
   54|  4.83k|  if (fabs(den) < FLT_EPSILON) {
  ------------------
  |  Branch (54:7): [True: 552, False: 4.28k]
  ------------------
   55|    552|    if (den < 0.0) {
  ------------------
  |  Branch (55:9): [True: 1, False: 551]
  ------------------
   56|      1|      return -num;
   57|      1|    }
   58|    551|    else {
   59|    551|      return num;
   60|    551|    }
   61|    552|  }
   62|  4.28k|  else {
   63|  4.28k|    return num / den;
   64|  4.28k|  }
   65|  4.83k|}

ia_enhaacplus_enc_create_bitbuffer:
   43|   308k|                                                           UWORD32 bitbuf_size) {
   44|   308k|  pstr_bit_buf->ptr_bit_buf_base = ptr_bit_buf_base;
   45|       |
   46|   308k|  pstr_bit_buf->ptr_bit_buf_end = ptr_bit_buf_base + bitbuf_size - 1;
   47|       |
   48|   308k|  pstr_bit_buf->ptr_read_next = ptr_bit_buf_base;
   49|   308k|  pstr_bit_buf->ptr_write_next = ptr_bit_buf_base;
   50|       |
   51|   308k|  pstr_bit_buf->write_position = 7;
   52|   308k|  pstr_bit_buf->read_position = 7;
   53|       |
   54|   308k|  pstr_bit_buf->cnt_bits = 0;
   55|       |
   56|   308k|  pstr_bit_buf->size = bitbuf_size * 8;
   57|       |
   58|   308k|  return pstr_bit_buf;
   59|   308k|}
ixheaace_reset_bitbuf:
   66|   424k|                           UWORD32 bitbuf_size) {
   67|   424k|  pstr_bit_buf->ptr_bit_buf_base = ptr_bit_buf_base;
   68|       |
   69|   424k|  pstr_bit_buf->ptr_bit_buf_end = ptr_bit_buf_base + bitbuf_size - 1;
   70|       |
   71|   424k|  pstr_bit_buf->ptr_read_next = ptr_bit_buf_base;
   72|   424k|  pstr_bit_buf->ptr_write_next = ptr_bit_buf_base;
   73|       |
   74|   424k|  pstr_bit_buf->read_position = 7;
   75|   424k|  pstr_bit_buf->write_position = 7;
   76|       |
   77|   424k|  pstr_bit_buf->cnt_bits = 0;
   78|   424k|}
ixheaace_copy_bitbuf_to_and_fro:
   82|  19.4k|{
   83|  19.4k|  WORD32 i;
   84|  19.4k|  WORD32 bytes_to_go_src =
   85|  19.4k|      (WORD32)(h_bitbuf_src->ptr_bit_buf_end - h_bitbuf_src->ptr_bit_buf_base);
   86|       |
   87|  19.4k|  UWORD8 *dst = &h_bitbuf_dst->ptr_bit_buf_base[0];
   88|  19.4k|  UWORD8 *src = &h_bitbuf_src->ptr_bit_buf_base[0];
   89|  19.4k|  WORD32 temp321, temp322;
   90|  19.4k|  UWORD8 temp1, temp2, temp3;
   91|  19.4k|  WORD32 count;
   92|  19.4k|  WORD32 remaining;
   93|       |
   94|  19.4k|  count = bytes_to_go_src >> 1;
   95|  19.4k|  remaining = bytes_to_go_src - (count << 1);
   96|       |
   97|  2.49M|  for (i = count - 1; i >= 0; i--) {
  ------------------
  |  Branch (97:23): [True: 2.47M, False: 19.4k]
  ------------------
   98|  2.47M|    temp1 = *src;
   99|  2.47M|    temp2 = *dst;
  100|  2.47M|    temp3 = *(src + 1);
  101|  2.47M|    *dst++ = temp1;
  102|  2.47M|    temp1 = *dst;
  103|  2.47M|    *src++ = temp2;
  104|  2.47M|    *dst++ = temp3;
  105|  2.47M|    *src++ = temp1;
  106|  2.47M|  }
  107|  19.4k|  if (remaining)
  ------------------
  |  Branch (107:7): [True: 19.4k, False: 0]
  ------------------
  108|  38.9k|    for (i = remaining - 1; i >= 0; i--) {
  ------------------
  |  Branch (108:29): [True: 19.4k, False: 19.4k]
  ------------------
  109|  19.4k|      temp1 = *src;
  110|  19.4k|      temp2 = *dst;
  111|  19.4k|      *dst++ = temp1;
  112|  19.4k|      *src++ = temp2;
  113|  19.4k|    }
  114|       |
  115|  19.4k|  src = h_bitbuf_src->ptr_read_next;
  116|  19.4k|  dst = h_bitbuf_dst->ptr_read_next;
  117|       |
  118|  19.4k|  h_bitbuf_dst->ptr_read_next = src;
  119|  19.4k|  h_bitbuf_src->ptr_read_next = dst;
  120|       |
  121|  19.4k|  src = h_bitbuf_src->ptr_write_next;
  122|  19.4k|  dst = h_bitbuf_dst->ptr_write_next;
  123|       |
  124|  19.4k|  h_bitbuf_dst->ptr_write_next = src;
  125|  19.4k|  h_bitbuf_src->ptr_write_next = dst;
  126|       |
  127|  19.4k|  temp321 = h_bitbuf_dst->read_position;
  128|  19.4k|  temp322 = h_bitbuf_src->read_position;
  129|       |
  130|  19.4k|  h_bitbuf_dst->read_position = temp322;
  131|  19.4k|  h_bitbuf_src->read_position = temp321;
  132|       |
  133|  19.4k|  temp321 = h_bitbuf_dst->write_position;
  134|  19.4k|  temp322 = h_bitbuf_src->write_position;
  135|       |
  136|  19.4k|  h_bitbuf_dst->write_position = temp322;
  137|  19.4k|  h_bitbuf_src->write_position = temp321;
  138|       |
  139|  19.4k|  temp321 = h_bitbuf_dst->cnt_bits;
  140|  19.4k|  temp322 = h_bitbuf_src->cnt_bits;
  141|       |
  142|  19.4k|  h_bitbuf_dst->cnt_bits = temp322;
  143|  19.4k|  h_bitbuf_src->cnt_bits = temp321;
  144|  19.4k|}
ia_enhaacplus_enc_copy_bitbuf:
  147|    244|                                   ixheaace_bit_buf_handle h_bitbuf_dst) {
  148|    244|  WORD32 i;
  149|    244|  WORD32 bytes_to_go_src =
  150|    244|      (WORD32)(h_bitbuf_src->ptr_bit_buf_end - h_bitbuf_src->ptr_bit_buf_base);
  151|       |
  152|  62.4k|  for (i = 0; i < bytes_to_go_src; i++) {
  ------------------
  |  Branch (152:15): [True: 62.2k, False: 244]
  ------------------
  153|  62.2k|    h_bitbuf_dst->ptr_bit_buf_base[i] = h_bitbuf_src->ptr_bit_buf_base[i];
  154|  62.2k|  }
  155|       |
  156|    244|  h_bitbuf_dst->ptr_read_next = h_bitbuf_src->ptr_read_next;
  157|    244|  h_bitbuf_dst->ptr_write_next = h_bitbuf_src->ptr_write_next;
  158|       |
  159|    244|  h_bitbuf_dst->read_position = h_bitbuf_src->read_position;
  160|    244|  h_bitbuf_dst->write_position = h_bitbuf_src->write_position;
  161|       |
  162|    244|  h_bitbuf_dst->cnt_bits = h_bitbuf_src->cnt_bits;
  163|    244|}
ia_enhaacplus_enc_get_bits_available:
  165|  4.76M|WORD32 ia_enhaacplus_enc_get_bits_available(ixheaace_bit_buf_handle pstr_bit_buf_handle) {
  166|  4.76M|  return pstr_bit_buf_handle->cnt_bits;
  167|  4.76M|}
ixheaace_readbits:
  169|  1.39M|ixheaace_readbits(ixheaace_bit_buf_handle pstr_bit_buf, UWORD8 no_bits_to_read) {
  170|  1.39M|  UWORD32 return_value;
  171|       |
  172|  1.39M|  if (no_bits_to_read >= 25) {
  ------------------
  |  Branch (172:7): [True: 0, False: 1.39M]
  ------------------
  173|      0|    return 0;
  174|      0|  }
  175|       |
  176|  1.39M|  pstr_bit_buf->cnt_bits -= no_bits_to_read;
  177|  1.39M|  pstr_bit_buf->read_position -= no_bits_to_read;
  178|       |
  179|  1.39M|  return_value = (UWORD32)*pstr_bit_buf->ptr_read_next;
  180|       |
  181|  3.88M|  while (pstr_bit_buf->read_position < 0) {
  ------------------
  |  Branch (181:10): [True: 2.49M, False: 1.39M]
  ------------------
  182|  2.49M|    pstr_bit_buf->read_position += 8;
  183|  2.49M|    pstr_bit_buf->ptr_read_next++;
  184|       |
  185|  2.49M|    if (pstr_bit_buf->ptr_read_next > pstr_bit_buf->ptr_bit_buf_end) {
  ------------------
  |  Branch (185:9): [True: 86, False: 2.49M]
  ------------------
  186|     86|      pstr_bit_buf->ptr_read_next = pstr_bit_buf->ptr_bit_buf_base;
  187|     86|    }
  188|       |
  189|  2.49M|    return_value <<= 8;
  190|       |
  191|  2.49M|    return_value |= (UWORD32)*pstr_bit_buf->ptr_read_next;
  192|  2.49M|  }
  193|  1.39M|  return_value = return_value << (31 - no_bits_to_read - pstr_bit_buf->read_position) >>
  194|  1.39M|                 (32 - no_bits_to_read);
  195|       |
  196|  1.39M|  return (return_value);
  197|  1.39M|}

ixheaace_write_bits:
   35|   209M|                    UWORD8 num_bits_to_write) {
   36|   209M|  WORD8 bits_to_write;
   37|   209M|  WORD32 write_position;
   38|   209M|  UWORD8 *ptr_write_next;
   39|   209M|  UWORD8 *ptr_bit_buf_end;
   40|   209M|  UWORD8 *ptr_bit_buf_base;
   41|       |
   42|   209M|  UWORD8 bits_written = num_bits_to_write;
   43|       |
   44|   209M|  if (pstr_bit_buf == NULL) {
  ------------------
  |  Branch (44:7): [True: 5.06M, False: 204M]
  ------------------
   45|  5.06M|    return num_bits_to_write;
   46|  5.06M|  }
   47|       |
   48|   204M|  pstr_bit_buf->cnt_bits += num_bits_to_write;
   49|       |
   50|   204M|  write_position = pstr_bit_buf->write_position;
   51|   204M|  ptr_write_next = pstr_bit_buf->ptr_write_next;
   52|   204M|  ptr_bit_buf_end = pstr_bit_buf->ptr_bit_buf_end;
   53|   204M|  ptr_bit_buf_base = pstr_bit_buf->ptr_bit_buf_base;
   54|       |
   55|   499M|  while (num_bits_to_write) {
  ------------------
  |  Branch (55:10): [True: 294M, False: 204M]
  ------------------
   56|   294M|    UWORD8 tmp, msk;
   57|   294M|    bits_to_write = (WORD8)MIN(write_position + 1, num_bits_to_write);
  ------------------
  |  |   23|   294M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 93.3M, False: 201M]
  |  |  ------------------
  ------------------
   58|       |
   59|   294M|    tmp = (UWORD8)(write_value << (32 - num_bits_to_write) >>
   60|   294M|                   (32 - bits_to_write) << (write_position + 1 - bits_to_write));
   61|       |
   62|   294M|    msk = ~(((1 << bits_to_write) - 1) << (write_position + 1 - bits_to_write));
   63|       |
   64|   294M|    *ptr_write_next &= msk;
   65|   294M|    *ptr_write_next |= tmp;
   66|       |
   67|   294M|    write_position -= bits_to_write;
   68|       |
   69|   294M|    num_bits_to_write -= bits_to_write;
   70|       |
   71|   294M|    if (write_position < 0) {
  ------------------
  |  Branch (71:9): [True: 117M, False: 177M]
  ------------------
   72|   117M|      write_position += 8;
   73|   117M|      ptr_write_next++;
   74|       |
   75|   117M|      if (ptr_write_next > ptr_bit_buf_end) {
  ------------------
  |  Branch (75:11): [True: 23.9k, False: 117M]
  ------------------
   76|  23.9k|        ptr_write_next = ptr_bit_buf_base;
   77|  23.9k|      }
   78|   117M|    }
   79|   294M|  }
   80|       |
   81|   204M|  pstr_bit_buf->write_position = write_position;
   82|   204M|  pstr_bit_buf->ptr_write_next = ptr_write_next;
   83|       |
   84|   204M|  return bits_written;
   85|   209M|}
ixheaace_byte_align_buffer:
   87|  22.8k|UWORD32 ixheaace_byte_align_buffer(ixheaace_bit_buf_handle pstr_it_bit_buff) {
   88|  22.8k|  WORD alignment;
   89|  22.8k|  alignment = (WORD)((pstr_it_bit_buff->cnt_bits) & 0x07);
   90|       |
   91|  22.8k|  if (alignment) {
  ------------------
  |  Branch (91:7): [True: 17.6k, False: 5.19k]
  ------------------
   92|  17.6k|    ixheaace_write_bits(pstr_it_bit_buff, 0, (UWORD8)(8 - alignment));
   93|  17.6k|    return (8 - alignment);
   94|  17.6k|  }
   95|  5.19k|  return 0;
   96|  22.8k|}

ia_enhaacplus_enc_count1_2_3_4_5_6_7_8_9_10_11:
   49|  9.12M|                                                    WORD32 invalid_bitcnt) {
   50|  9.12M|  WORD32 i;
   51|  9.12M|  WORD32 bits1_2, bits3_4, bits5_6, bits7_8, bits9_10, bit11, sc;
   52|  9.12M|  WORD32 temp_0, temp_1, temp_2, temp_3;
   53|  9.12M|  (VOID) invalid_bitcnt;
   54|  9.12M|  bits1_2 = 0;
   55|  9.12M|  bits3_4 = 0;
   56|  9.12M|  bits5_6 = 0;
   57|  9.12M|  bits7_8 = 0;
   58|  9.12M|  bits9_10 = 0;
   59|  9.12M|  bit11 = 0;
   60|  9.12M|  sc = 0;
   61|       |
   62|  42.7M|  for (i = 0; i < width; i += 4) {
  ------------------
  |  Branch (62:15): [True: 33.6M, False: 9.12M]
  ------------------
   63|  33.6M|    temp_0 = values[i + 0];
   64|  33.6M|    temp_1 = values[i + 1];
   65|  33.6M|    temp_2 = values[i + 2];
   66|  33.6M|    temp_3 = values[i + 3];
   67|       |
   68|  33.6M|    bits1_2 +=
   69|  33.6M|        EXPAND(pstr_huffman_tbl->huff_ltab1_2[temp_0 + 1][temp_1 + 1][temp_2 + 1][temp_3 + 1]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   70|       |
   71|  33.6M|    bits5_6 += EXPAND(pstr_huffman_tbl->huff_ltab5_6[temp_0 + 4][temp_1 + 4]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   72|       |
   73|  33.6M|    bits5_6 += EXPAND(pstr_huffman_tbl->huff_ltab5_6[temp_2 + 4][temp_3 + 4]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   74|       |
   75|  33.6M|    sc += (temp_0 != 0) + (temp_1 != 0) + (temp_2 != 0) + (temp_3 != 0);
   76|       |
   77|  33.6M|    temp_0 = abs32(temp_0);
  ------------------
  |  |   25|  33.6M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.96M, False: 31.7M]
  |  |  ------------------
  ------------------
   78|  33.6M|    temp_1 = abs32(temp_1);
  ------------------
  |  |   25|  33.6M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.97M, False: 31.6M]
  |  |  ------------------
  ------------------
   79|  33.6M|    temp_2 = abs32(temp_2);
  ------------------
  |  |   25|  33.6M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.63M, False: 32.0M]
  |  |  ------------------
  ------------------
   80|  33.6M|    temp_3 = abs32(temp_3);
  ------------------
  |  |   25|  33.6M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.59M, False: 32.0M]
  |  |  ------------------
  ------------------
   81|       |
   82|  33.6M|    bits3_4 += EXPAND(pstr_huffman_tbl->huff_ltab3_4[temp_0][temp_1][temp_2][temp_3]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   83|       |
   84|  33.6M|    bits7_8 += EXPAND(pstr_huffman_tbl->huff_ltab7_8[temp_0][temp_1]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   85|       |
   86|  33.6M|    bits7_8 += EXPAND(pstr_huffman_tbl->huff_ltab7_8[temp_2][temp_3]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   87|       |
   88|  33.6M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   89|       |
   90|  33.6M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_2][temp_3]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   91|       |
   92|  33.6M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_0][temp_1]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   93|       |
   94|  33.6M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_2][temp_3]);
  ------------------
  |  |   31|  33.6M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
   95|  33.6M|  }
   96|       |
   97|  9.12M|  bitcnt[1] = HI_EXPLTAB(bits1_2);
  ------------------
  |  |   29|  9.12M|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
   98|       |
   99|  9.12M|  bitcnt[2] = LO_EXPLTAB(bits1_2);
  ------------------
  |  |   30|  9.12M|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  100|       |
  101|  9.12M|  bitcnt[3] = HI_EXPLTAB(bits3_4) + sc;
  ------------------
  |  |   29|  9.12M|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  102|       |
  103|  9.12M|  bitcnt[4] = LO_EXPLTAB(bits3_4) + sc;
  ------------------
  |  |   30|  9.12M|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  104|       |
  105|  9.12M|  bitcnt[5] = HI_EXPLTAB(bits5_6);
  ------------------
  |  |   29|  9.12M|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  106|       |
  107|  9.12M|  bitcnt[6] = LO_EXPLTAB(bits5_6);
  ------------------
  |  |   30|  9.12M|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  108|       |
  109|  9.12M|  bitcnt[7] = HI_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   29|  9.12M|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  110|       |
  111|  9.12M|  bitcnt[8] = LO_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   30|  9.12M|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  112|       |
  113|  9.12M|  bitcnt[9] = HI_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   29|  9.12M|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  114|       |
  115|  9.12M|  bitcnt[10] = LO_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   30|  9.12M|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  116|       |
  117|  9.12M|  bitcnt[11] = bit11 + sc;
  118|  9.12M|}
ia_enhaacplus_enc_bitcount:
  435|  13.4M|                                WORD32 aot) {
  436|  13.4M|  WORD32 invalid_bitcnt;
  437|       |
  438|  13.4M|  if (max_val == 0) {
  ------------------
  |  Branch (438:7): [True: 6.33M, False: 7.07M]
  ------------------
  439|  6.33M|    *bit_cnt = 0;
  440|  7.07M|  } else {
  441|  7.07M|    switch (aot) {
  ------------------
  |  Branch (441:13): [True: 7.07M, False: 0]
  ------------------
  442|   999k|      case AOT_AAC_LC:
  ------------------
  |  |   34|   999k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (442:7): [True: 999k, False: 6.07M]
  ------------------
  443|  4.68M|      case AOT_SBR:
  ------------------
  |  |   35|  4.68M|#define AOT_SBR (5)
  ------------------
  |  Branch (443:7): [True: 3.68M, False: 3.38M]
  ------------------
  444|  5.34M|      case AOT_PS:
  ------------------
  |  |   39|  5.34M|#define AOT_PS (29)
  ------------------
  |  Branch (444:7): [True: 665k, False: 6.40M]
  ------------------
  445|  5.34M|        *bit_cnt = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  5.34M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  446|  5.34M|        break;
  447|       |
  448|   366k|      case AOT_AAC_LD:
  ------------------
  |  |   36|   366k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (448:7): [True: 366k, False: 6.70M]
  ------------------
  449|  1.72M|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.72M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (449:7): [True: 1.35M, False: 5.71M]
  ------------------
  450|  1.72M|        *bit_cnt = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  1.72M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  451|  1.72M|        break;
  452|  7.07M|    }
  453|  7.07M|  }
  454|  13.4M|  invalid_bitcnt = *bit_cnt;
  455|  13.4M|  max_val = MIN(max_val, CODE_BCK_ESC_LAV);
  ------------------
  |  |   23|  13.4M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 11.9M, False: 1.47M]
  |  |  ------------------
  ------------------
  456|       |
  457|  13.4M|  ia_enhaacplus_enc_count_func_tab[max_val](ptr_values, width, bit_cnt, pstr_huffman_tbl,
  458|  13.4M|                                            invalid_bitcnt);
  459|  13.4M|}
ia_enhaacplus_enc_code_values:
  463|  12.5M|                                   ixheaace_huffman_tables *pstr_huffman_tbl) {
  464|  12.5M|  WORD32 i, temp_0, temp_1, temp_2, temp_3, t00, t01;
  465|  12.5M|  WORD32 code_word, code_length;
  466|  12.5M|  WORD32 sign, sign_length;
  467|  12.5M|  WORD16 *ptr_temp_values = ptr_values;
  468|       |
  469|  12.5M|  switch (code_book) {
  470|  5.46M|    case CODE_BCK_ZERO_NO:
  ------------------
  |  Branch (470:5): [True: 5.46M, False: 7.09M]
  ------------------
  471|  5.46M|      break;
  472|       |
  473|  1.15M|    case CODE_BCK_1_NO:
  ------------------
  |  Branch (473:5): [True: 1.15M, False: 11.4M]
  ------------------
  474|  1.15M|      width = width >> 2;
  475|       |
  476|  5.90M|      for (i = width - 1; i >= 0; i--) {
  ------------------
  |  Branch (476:27): [True: 4.74M, False: 1.15M]
  ------------------
  477|  4.74M|        temp_0 = *ptr_temp_values++;
  478|  4.74M|        temp_1 = *ptr_temp_values++;
  479|  4.74M|        temp_2 = *ptr_temp_values++;
  480|  4.74M|        temp_3 = *ptr_temp_values++;
  481|       |
  482|  4.74M|        code_word = pstr_huffman_tbl->huff_ctab1[temp_0 + 1][temp_1 + 1][temp_2 + 1][temp_3 + 1];
  483|       |
  484|  4.74M|        code_length = HI_LTAB(
  ------------------
  |  |   26|  4.74M|#define HI_LTAB(a) (a >> 8)
  ------------------
  485|  4.74M|            pstr_huffman_tbl->huff_ltab1_2[temp_0 + 1][temp_1 + 1][temp_2 + 1][temp_3 + 1]);
  486|       |
  487|  4.74M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  488|  4.74M|      }
  489|  1.15M|      break;
  490|       |
  491|   640k|    case CODE_BCK_2_NO:
  ------------------
  |  Branch (491:5): [True: 640k, False: 11.9M]
  ------------------
  492|       |
  493|   640k|      width = width >> 2;
  494|       |
  495|  2.76M|      for (i = width - 1; i >= 0; i--) {
  ------------------
  |  Branch (495:27): [True: 2.12M, False: 640k]
  ------------------
  496|  2.12M|        temp_0 = *ptr_temp_values++;
  497|  2.12M|        temp_1 = *ptr_temp_values++;
  498|  2.12M|        temp_2 = *ptr_temp_values++;
  499|  2.12M|        temp_3 = *ptr_temp_values++;
  500|       |
  501|  2.12M|        code_word = pstr_huffman_tbl->huff_ctab2[temp_0 + 1][temp_1 + 1][temp_2 + 1][temp_3 + 1];
  502|       |
  503|  2.12M|        code_length = LO_LTAB(
  ------------------
  |  |   27|  2.12M|#define LO_LTAB(a) (a & 0xff)
  ------------------
  504|  2.12M|            pstr_huffman_tbl->huff_ltab1_2[temp_0 + 1][temp_1 + 1][temp_2 + 1][temp_3 + 1]);
  505|       |
  506|  2.12M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  507|  2.12M|      }
  508|   640k|      break;
  509|       |
  510|   291k|    case CODE_BCK_3_NO:
  ------------------
  |  Branch (510:5): [True: 291k, False: 12.2M]
  ------------------
  511|       |
  512|  1.37M|      for (i = 0; i < width; i += 4) {
  ------------------
  |  Branch (512:19): [True: 1.08M, False: 291k]
  ------------------
  513|  1.08M|        sign = 0;
  514|  1.08M|        sign_length = 0;
  515|  1.08M|        temp_0 = ptr_values[i + 0];
  516|       |
  517|  1.08M|        if (temp_0 != 0) {
  ------------------
  |  Branch (517:13): [True: 225k, False: 860k]
  ------------------
  518|   225k|          sign_length++;
  519|       |
  520|   225k|          sign <<= 1;
  521|       |
  522|   225k|          if (temp_0 < 0) {
  ------------------
  |  Branch (522:15): [True: 114k, False: 110k]
  ------------------
  523|   114k|            sign |= 1;
  524|       |
  525|   114k|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|   114k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 114k]
  |  |  ------------------
  ------------------
  526|   114k|          }
  527|   225k|        }
  528|       |
  529|  1.08M|        temp_1 = ptr_values[i + 1];
  530|       |
  531|  1.08M|        if (temp_1 != 0) {
  ------------------
  |  Branch (531:13): [True: 235k, False: 850k]
  ------------------
  532|   235k|          sign_length++;
  533|       |
  534|   235k|          sign <<= 1;
  535|       |
  536|   235k|          if (temp_1 < 0) {
  ------------------
  |  Branch (536:15): [True: 114k, False: 121k]
  ------------------
  537|   114k|            sign |= 1;
  538|       |
  539|   114k|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|   114k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 114k]
  |  |  ------------------
  ------------------
  540|   114k|          }
  541|   235k|        }
  542|       |
  543|  1.08M|        temp_2 = ptr_values[i + 2];
  544|       |
  545|  1.08M|        if (temp_2 != 0) {
  ------------------
  |  Branch (545:13): [True: 230k, False: 856k]
  ------------------
  546|   230k|          sign_length++;
  547|       |
  548|   230k|          sign <<= 1;
  549|       |
  550|   230k|          if (temp_2 < 0) {
  ------------------
  |  Branch (550:15): [True: 120k, False: 109k]
  ------------------
  551|   120k|            sign |= 1;
  552|       |
  553|   120k|            temp_2 = abs32(temp_2);
  ------------------
  |  |   25|   120k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 120k]
  |  |  ------------------
  ------------------
  554|   120k|          }
  555|   230k|        }
  556|       |
  557|  1.08M|        temp_3 = ptr_values[i + 3];
  558|       |
  559|  1.08M|        if (temp_3 != 0) {
  ------------------
  |  Branch (559:13): [True: 224k, False: 861k]
  ------------------
  560|   224k|          sign_length++;
  561|       |
  562|   224k|          sign <<= 1;
  563|       |
  564|   224k|          if (temp_3 < 0) {
  ------------------
  |  Branch (564:15): [True: 119k, False: 105k]
  ------------------
  565|   119k|            sign |= 1;
  566|       |
  567|   119k|            temp_3 = abs32(temp_3);
  ------------------
  |  |   25|   119k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 119k]
  |  |  ------------------
  ------------------
  568|   119k|          }
  569|   224k|        }
  570|       |
  571|  1.08M|        code_word = pstr_huffman_tbl->huff_ctab3[temp_0][temp_1][temp_2][temp_3];
  572|       |
  573|  1.08M|        code_length = HI_LTAB(pstr_huffman_tbl->huff_ltab3_4[temp_0][temp_1][temp_2][temp_3]);
  ------------------
  |  |   26|  1.08M|#define HI_LTAB(a) (a >> 8)
  ------------------
  574|       |
  575|  1.08M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  576|       |
  577|  1.08M|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  578|  1.08M|      }
  579|   291k|      break;
  580|       |
  581|   842k|    case CODE_BCK_4_NO:
  ------------------
  |  Branch (581:5): [True: 842k, False: 11.7M]
  ------------------
  582|       |
  583|  2.95M|      for (i = 0; i < width; i += 4) {
  ------------------
  |  Branch (583:19): [True: 2.11M, False: 842k]
  ------------------
  584|  2.11M|        sign = 0;
  585|  2.11M|        sign_length = 0;
  586|  2.11M|        temp_0 = ptr_values[i + 0];
  587|       |
  588|  2.11M|        if (temp_0 != 0) {
  ------------------
  |  Branch (588:13): [True: 1.40M, False: 708k]
  ------------------
  589|  1.40M|          sign_length++;
  590|       |
  591|  1.40M|          sign <<= 1;
  592|       |
  593|  1.40M|          if (temp_0 < 0) {
  ------------------
  |  Branch (593:15): [True: 735k, False: 666k]
  ------------------
  594|   735k|            sign |= 1;
  595|       |
  596|   735k|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|   735k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 735k]
  |  |  ------------------
  ------------------
  597|   735k|          }
  598|  1.40M|        }
  599|       |
  600|  2.11M|        temp_1 = ptr_values[i + 1];
  601|       |
  602|  2.11M|        if (temp_1 != 0) {
  ------------------
  |  Branch (602:13): [True: 1.32M, False: 782k]
  ------------------
  603|  1.32M|          sign_length++;
  604|       |
  605|  1.32M|          sign <<= 1;
  606|       |
  607|  1.32M|          if (temp_1 < 0) {
  ------------------
  |  Branch (607:15): [True: 685k, False: 642k]
  ------------------
  608|   685k|            sign |= 1;
  609|       |
  610|   685k|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|   685k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 685k]
  |  |  ------------------
  ------------------
  611|   685k|          }
  612|  1.32M|        }
  613|       |
  614|  2.11M|        temp_2 = ptr_values[i + 2];
  615|       |
  616|  2.11M|        if (temp_2 != 0) {
  ------------------
  |  Branch (616:13): [True: 1.37M, False: 738k]
  ------------------
  617|  1.37M|          sign_length++;
  618|       |
  619|  1.37M|          sign <<= 1;
  620|       |
  621|  1.37M|          if (temp_2 < 0) {
  ------------------
  |  Branch (621:15): [True: 657k, False: 713k]
  ------------------
  622|   657k|            sign |= 1;
  623|       |
  624|   657k|            temp_2 = abs32(temp_2);
  ------------------
  |  |   25|   657k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 657k]
  |  |  ------------------
  ------------------
  625|   657k|          }
  626|  1.37M|        }
  627|       |
  628|  2.11M|        temp_3 = ptr_values[i + 3];
  629|       |
  630|  2.11M|        if (temp_3 != 0) {
  ------------------
  |  Branch (630:13): [True: 1.34M, False: 768k]
  ------------------
  631|  1.34M|          sign_length++;
  632|       |
  633|  1.34M|          sign <<= 1;
  634|       |
  635|  1.34M|          if (temp_3 < 0) {
  ------------------
  |  Branch (635:15): [True: 644k, False: 696k]
  ------------------
  636|   644k|            sign |= 1;
  637|       |
  638|   644k|            temp_3 = abs32(temp_3);
  ------------------
  |  |   25|   644k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 644k]
  |  |  ------------------
  ------------------
  639|   644k|          }
  640|  1.34M|        }
  641|       |
  642|  2.11M|        code_word = pstr_huffman_tbl->huff_ctab4[temp_0][temp_1][temp_2][temp_3];
  643|       |
  644|  2.11M|        code_length = LO_LTAB(pstr_huffman_tbl->huff_ltab3_4[temp_0][temp_1][temp_2][temp_3]);
  ------------------
  |  |   27|  2.11M|#define LO_LTAB(a) (a & 0xff)
  ------------------
  645|       |
  646|  2.11M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  647|       |
  648|  2.11M|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  649|  2.11M|      }
  650|   842k|      break;
  651|       |
  652|   199k|    case CODE_BCK_5_NO:
  ------------------
  |  Branch (652:5): [True: 199k, False: 12.3M]
  ------------------
  653|       |
  654|   199k|      width = width >> 1;
  655|       |
  656|  1.93M|      for (i = width - 1; i >= 0; i--) {
  ------------------
  |  Branch (656:27): [True: 1.73M, False: 199k]
  ------------------
  657|  1.73M|        temp_0 = *ptr_temp_values++;
  658|  1.73M|        temp_1 = *ptr_temp_values++;
  659|       |
  660|  1.73M|        code_word = pstr_huffman_tbl->huff_ctab5[temp_0 + 4][temp_1 + 4];
  661|       |
  662|  1.73M|        code_length = HI_LTAB(pstr_huffman_tbl->huff_ltab5_6[temp_0 + 4][temp_1 + 4]);
  ------------------
  |  |   26|  1.73M|#define HI_LTAB(a) (a >> 8)
  ------------------
  663|       |
  664|  1.73M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  665|  1.73M|      }
  666|   199k|      break;
  667|       |
  668|   618k|    case CODE_BCK_6_NO:
  ------------------
  |  Branch (668:5): [True: 618k, False: 11.9M]
  ------------------
  669|       |
  670|   618k|      width = width >> 1;
  671|       |
  672|  4.40M|      for (i = width - 1; i >= 0; i--) {
  ------------------
  |  Branch (672:27): [True: 3.78M, False: 618k]
  ------------------
  673|  3.78M|        temp_0 = *ptr_temp_values++;
  674|  3.78M|        temp_1 = *ptr_temp_values++;
  675|       |
  676|  3.78M|        code_word = pstr_huffman_tbl->huff_ctab6[temp_0 + 4][temp_1 + 4];
  677|       |
  678|  3.78M|        code_length = LO_LTAB(pstr_huffman_tbl->huff_ltab5_6[temp_0 + 4][temp_1 + 4]);
  ------------------
  |  |   27|  3.78M|#define LO_LTAB(a) (a & 0xff)
  ------------------
  679|       |
  680|  3.78M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  681|  3.78M|      }
  682|   618k|      break;
  683|       |
  684|  90.6k|    case CODE_BCK_7_NO:
  ------------------
  |  Branch (684:5): [True: 90.6k, False: 12.4M]
  ------------------
  685|       |
  686|  1.06M|      for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (686:19): [True: 970k, False: 90.6k]
  ------------------
  687|   970k|        sign = 0;
  688|   970k|        sign_length = 0;
  689|   970k|        temp_0 = ptr_values[i + 0];
  690|       |
  691|   970k|        if (temp_0 != 0) {
  ------------------
  |  Branch (691:13): [True: 373k, False: 597k]
  ------------------
  692|   373k|          sign_length++;
  693|       |
  694|   373k|          sign <<= 1;
  695|       |
  696|   373k|          if (temp_0 < 0) {
  ------------------
  |  Branch (696:15): [True: 191k, False: 182k]
  ------------------
  697|   191k|            sign |= 1;
  698|       |
  699|   191k|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|   191k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 191k]
  |  |  ------------------
  ------------------
  700|   191k|          }
  701|   373k|        }
  702|       |
  703|   970k|        temp_1 = ptr_values[i + 1];
  704|       |
  705|   970k|        if (temp_1 != 0) {
  ------------------
  |  Branch (705:13): [True: 333k, False: 637k]
  ------------------
  706|   333k|          sign_length++;
  707|       |
  708|   333k|          sign <<= 1;
  709|       |
  710|   333k|          if (temp_1 < 0) {
  ------------------
  |  Branch (710:15): [True: 156k, False: 176k]
  ------------------
  711|   156k|            sign |= 1;
  712|       |
  713|   156k|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|   156k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 156k]
  |  |  ------------------
  ------------------
  714|   156k|          }
  715|   333k|        }
  716|       |
  717|   970k|        code_word = pstr_huffman_tbl->huff_ctab7[temp_0][temp_1];
  718|       |
  719|   970k|        code_length = HI_LTAB(pstr_huffman_tbl->huff_ltab7_8[temp_0][temp_1]);
  ------------------
  |  |   26|   970k|#define HI_LTAB(a) (a >> 8)
  ------------------
  720|       |
  721|   970k|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  722|       |
  723|   970k|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  724|   970k|      }
  725|  90.6k|      break;
  726|       |
  727|   279k|    case CODE_BCK_8_NO:
  ------------------
  |  Branch (727:5): [True: 279k, False: 12.2M]
  ------------------
  728|       |
  729|  2.22M|      for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (729:19): [True: 1.94M, False: 279k]
  ------------------
  730|  1.94M|        sign = 0;
  731|  1.94M|        sign_length = 0;
  732|  1.94M|        temp_0 = ptr_values[i + 0];
  733|       |
  734|  1.94M|        if (temp_0 != 0) {
  ------------------
  |  Branch (734:13): [True: 1.66M, False: 275k]
  ------------------
  735|  1.66M|          sign_length++;
  736|       |
  737|  1.66M|          sign <<= 1;
  738|       |
  739|  1.66M|          if (temp_0 < 0) {
  ------------------
  |  Branch (739:15): [True: 824k, False: 844k]
  ------------------
  740|   824k|            sign |= 1;
  741|       |
  742|   824k|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|   824k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 824k]
  |  |  ------------------
  ------------------
  743|   824k|          }
  744|  1.66M|        }
  745|       |
  746|  1.94M|        temp_1 = ptr_values[i + 1];
  747|       |
  748|  1.94M|        if (temp_1 != 0) {
  ------------------
  |  Branch (748:13): [True: 1.68M, False: 258k]
  ------------------
  749|  1.68M|          sign_length++;
  750|       |
  751|  1.68M|          sign <<= 1;
  752|       |
  753|  1.68M|          if (temp_1 < 0) {
  ------------------
  |  Branch (753:15): [True: 855k, False: 830k]
  ------------------
  754|   855k|            sign |= 1;
  755|       |
  756|   855k|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|   855k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 855k]
  |  |  ------------------
  ------------------
  757|   855k|          }
  758|  1.68M|        }
  759|       |
  760|  1.94M|        code_word = pstr_huffman_tbl->huff_ctab8[temp_0][temp_1];
  761|       |
  762|  1.94M|        code_length = LO_LTAB(pstr_huffman_tbl->huff_ltab7_8[temp_0][temp_1]);
  ------------------
  |  |   27|  1.94M|#define LO_LTAB(a) (a & 0xff)
  ------------------
  763|       |
  764|  1.94M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  765|       |
  766|  1.94M|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  767|  1.94M|      }
  768|   279k|      break;
  769|       |
  770|  92.2k|    case CODE_BCK_9_NO:
  ------------------
  |  Branch (770:5): [True: 92.2k, False: 12.4M]
  ------------------
  771|       |
  772|   981k|      for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (772:19): [True: 889k, False: 92.2k]
  ------------------
  773|   889k|        sign = 0;
  774|   889k|        sign_length = 0;
  775|   889k|        temp_0 = ptr_values[i + 0];
  776|       |
  777|   889k|        if (temp_0 != 0) {
  ------------------
  |  Branch (777:13): [True: 314k, False: 574k]
  ------------------
  778|   314k|          sign_length++;
  779|       |
  780|   314k|          sign <<= 1;
  781|       |
  782|   314k|          if (temp_0 < 0) {
  ------------------
  |  Branch (782:15): [True: 161k, False: 152k]
  ------------------
  783|   161k|            sign |= 1;
  784|       |
  785|   161k|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|   161k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 161k]
  |  |  ------------------
  ------------------
  786|   161k|          }
  787|   314k|        }
  788|       |
  789|   889k|        temp_1 = ptr_values[i + 1];
  790|       |
  791|   889k|        if (temp_1 != 0) {
  ------------------
  |  Branch (791:13): [True: 304k, False: 585k]
  ------------------
  792|   304k|          sign_length++;
  793|       |
  794|   304k|          sign <<= 1;
  795|       |
  796|   304k|          if (temp_1 < 0) {
  ------------------
  |  Branch (796:15): [True: 154k, False: 149k]
  ------------------
  797|   154k|            sign |= 1;
  798|       |
  799|   154k|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|   154k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 154k]
  |  |  ------------------
  ------------------
  800|   154k|          }
  801|   304k|        }
  802|       |
  803|   889k|        code_word = pstr_huffman_tbl->huff_ctab9[temp_0][temp_1];
  804|       |
  805|   889k|        code_length = HI_LTAB(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   26|   889k|#define HI_LTAB(a) (a >> 8)
  ------------------
  806|       |
  807|   889k|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  808|       |
  809|   889k|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  810|   889k|      }
  811|  92.2k|      break;
  812|       |
  813|   830k|    case CODE_BCK_10_NO:
  ------------------
  |  Branch (813:5): [True: 830k, False: 11.7M]
  ------------------
  814|       |
  815|  6.45M|      for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (815:19): [True: 5.62M, False: 830k]
  ------------------
  816|  5.62M|        sign = 0;
  817|  5.62M|        sign_length = 0;
  818|  5.62M|        temp_0 = ptr_values[i + 0];
  819|       |
  820|  5.62M|        if (temp_0 != 0) {
  ------------------
  |  Branch (820:13): [True: 5.31M, False: 306k]
  ------------------
  821|  5.31M|          sign_length++;
  822|       |
  823|  5.31M|          sign <<= 1;
  824|       |
  825|  5.31M|          if (temp_0 < 0) {
  ------------------
  |  Branch (825:15): [True: 2.65M, False: 2.66M]
  ------------------
  826|  2.65M|            sign |= 1;
  827|       |
  828|  2.65M|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|  2.65M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 2.65M]
  |  |  ------------------
  ------------------
  829|  2.65M|          }
  830|  5.31M|        }
  831|       |
  832|  5.62M|        temp_1 = ptr_values[i + 1];
  833|       |
  834|  5.62M|        if (temp_1 != 0) {
  ------------------
  |  Branch (834:13): [True: 5.29M, False: 330k]
  ------------------
  835|  5.29M|          sign_length++;
  836|       |
  837|  5.29M|          sign <<= 1;
  838|       |
  839|  5.29M|          if (temp_1 < 0) {
  ------------------
  |  Branch (839:15): [True: 2.68M, False: 2.61M]
  ------------------
  840|  2.68M|            sign |= 1;
  841|       |
  842|  2.68M|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|  2.68M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 2.68M]
  |  |  ------------------
  ------------------
  843|  2.68M|          }
  844|  5.29M|        }
  845|       |
  846|  5.62M|        code_word = pstr_huffman_tbl->huff_ctab10[temp_0][temp_1];
  847|       |
  848|  5.62M|        code_length = LO_LTAB(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   27|  5.62M|#define LO_LTAB(a) (a & 0xff)
  ------------------
  849|       |
  850|  5.62M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  851|       |
  852|  5.62M|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  853|  5.62M|      }
  854|   830k|      break;
  855|       |
  856|  2.05M|    case CODE_BCK_ESC_NO:
  ------------------
  |  Branch (856:5): [True: 2.05M, False: 10.5M]
  ------------------
  857|       |
  858|  12.7M|      for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (858:19): [True: 10.7M, False: 2.05M]
  ------------------
  859|  10.7M|        sign = 0;
  860|  10.7M|        sign_length = 0;
  861|  10.7M|        temp_0 = ptr_values[i + 0];
  862|       |
  863|  10.7M|        if (temp_0 != 0) {
  ------------------
  |  Branch (863:13): [True: 9.31M, False: 1.38M]
  ------------------
  864|  9.31M|          sign_length++;
  865|       |
  866|  9.31M|          sign <<= 1;
  867|       |
  868|  9.31M|          if (temp_0 < 0) {
  ------------------
  |  Branch (868:15): [True: 4.52M, False: 4.79M]
  ------------------
  869|  4.52M|            sign |= 1;
  870|       |
  871|  4.52M|            temp_0 = abs32(temp_0);
  ------------------
  |  |   25|  4.52M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 4.52M]
  |  |  ------------------
  ------------------
  872|  4.52M|          }
  873|  9.31M|        }
  874|       |
  875|  10.7M|        temp_1 = ptr_values[i + 1];
  876|       |
  877|  10.7M|        if (temp_1 != 0) {
  ------------------
  |  Branch (877:13): [True: 9.12M, False: 1.57M]
  ------------------
  878|  9.12M|          sign_length++;
  879|       |
  880|  9.12M|          sign <<= 1;
  881|       |
  882|  9.12M|          if (temp_1 < 0) {
  ------------------
  |  Branch (882:15): [True: 4.59M, False: 4.53M]
  ------------------
  883|  4.59M|            sign |= 1;
  884|       |
  885|  4.59M|            temp_1 = abs32(temp_1);
  ------------------
  |  |   25|  4.59M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 4.59M]
  |  |  ------------------
  ------------------
  886|  4.59M|          }
  887|  9.12M|        }
  888|       |
  889|  10.7M|        t00 = MIN(temp_0, 16);
  ------------------
  |  |   23|  10.7M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.24M, False: 3.46M]
  |  |  ------------------
  ------------------
  890|  10.7M|        t01 = MIN(temp_1, 16);
  ------------------
  |  |   23|  10.7M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.67M, False: 3.03M]
  |  |  ------------------
  ------------------
  891|       |
  892|  10.7M|        code_word = pstr_huffman_tbl->huff_ctab11[t00][t01];
  893|  10.7M|        code_length = pstr_huffman_tbl->huff_ltab11[t00][t01];
  894|       |
  895|  10.7M|        ixheaace_write_bits(pstr_bitstream, code_word, (UWORD8)code_length);
  896|       |
  897|  10.7M|        ixheaace_write_bits(pstr_bitstream, sign, (UWORD8)sign_length);
  898|       |
  899|  10.7M|        if (temp_0 >= 16) {
  ------------------
  |  Branch (899:13): [True: 3.46M, False: 7.24M]
  ------------------
  900|  3.46M|          WORD32 n, p;
  901|       |
  902|  3.46M|          n = 0;
  903|  3.46M|          p = temp_0;
  904|       |
  905|  7.49M|          while ((p >>= 1) >= 16) {
  ------------------
  |  Branch (905:18): [True: 4.03M, False: 3.46M]
  ------------------
  906|  4.03M|            ixheaace_write_bits(pstr_bitstream, 1, 1);
  907|       |
  908|  4.03M|            n++;
  909|  4.03M|          }
  910|       |
  911|  3.46M|          ixheaace_write_bits(pstr_bitstream, 0, 1);
  912|       |
  913|  3.46M|          ixheaace_write_bits(pstr_bitstream, temp_0 - (1 << (n + 4)), (UWORD8)(n + 4));
  914|  3.46M|        }
  915|  10.7M|        if (temp_1 >= 16) {
  ------------------
  |  Branch (915:13): [True: 3.03M, False: 7.67M]
  ------------------
  916|  3.03M|          WORD32 n, p;
  917|       |
  918|  3.03M|          n = 0;
  919|  3.03M|          p = temp_1;
  920|       |
  921|  5.69M|          while ((p >>= 1) >= 16) {
  ------------------
  |  Branch (921:18): [True: 2.65M, False: 3.03M]
  ------------------
  922|  2.65M|            ixheaace_write_bits(pstr_bitstream, 1, 1);
  923|       |
  924|  2.65M|            n++;
  925|  2.65M|          }
  926|       |
  927|  3.03M|          ixheaace_write_bits(pstr_bitstream, 0, 1);
  928|       |
  929|  3.03M|          ixheaace_write_bits(pstr_bitstream, temp_1 - (1 << (n + 4)), (UWORD8)(n + 4));
  930|  3.03M|        }
  931|  10.7M|      }
  932|  2.05M|      break;
  933|       |
  934|      0|    default:
  ------------------
  |  Branch (934:5): [True: 0, False: 12.5M]
  ------------------
  935|      0|      break;
  936|  12.5M|  }
  937|  12.5M|}
ixheaace_bits_count.c:ia_enhaacplus_enc_count3_4_5_6_7_8_9_10_11:
  123|   793k|                                                       WORD32 invalid_bitcnt) {
  124|   793k|  WORD32 i;
  125|   793k|  WORD32 bits3_4, bits5_6, bits7_8, bits9_10, bit11, sc;
  126|   793k|  WORD32 temp_0, temp_1, temp_2, temp_3;
  127|       |
  128|   793k|  bits3_4 = 0;
  129|   793k|  bits5_6 = 0;
  130|   793k|  bits7_8 = 0;
  131|   793k|  bits9_10 = 0;
  132|   793k|  bit11 = 0;
  133|   793k|  sc = 0;
  134|       |
  135|  3.26M|  for (i = 0; i < width; i += 4) {
  ------------------
  |  Branch (135:15): [True: 2.47M, False: 793k]
  ------------------
  136|  2.47M|    temp_0 = values[i + 0];
  137|  2.47M|    temp_1 = values[i + 1];
  138|  2.47M|    temp_2 = values[i + 2];
  139|  2.47M|    temp_3 = values[i + 3];
  140|       |
  141|  2.47M|    bits5_6 += EXPAND(pstr_huffman_tbl->huff_ltab5_6[temp_0 + 4][temp_1 + 4]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  142|       |
  143|  2.47M|    bits5_6 += EXPAND(pstr_huffman_tbl->huff_ltab5_6[temp_2 + 4][temp_3 + 4]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  144|       |
  145|  2.47M|    temp_0 = abs32(temp_0);
  ------------------
  |  |   25|  2.47M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 797k, False: 1.67M]
  |  |  ------------------
  ------------------
  146|  2.47M|    temp_1 = abs32(temp_1);
  ------------------
  |  |   25|  2.47M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 801k, False: 1.67M]
  |  |  ------------------
  ------------------
  147|  2.47M|    temp_2 = abs32(temp_2);
  ------------------
  |  |   25|  2.47M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 791k, False: 1.68M]
  |  |  ------------------
  ------------------
  148|  2.47M|    temp_3 = abs32(temp_3);
  ------------------
  |  |   25|  2.47M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 768k, False: 1.70M]
  |  |  ------------------
  ------------------
  149|       |
  150|  2.47M|    bits3_4 += EXPAND(pstr_huffman_tbl->huff_ltab3_4[temp_0][temp_1][temp_2][temp_3]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  151|       |
  152|  2.47M|    bits7_8 += EXPAND(pstr_huffman_tbl->huff_ltab7_8[temp_0][temp_1]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  153|       |
  154|  2.47M|    bits7_8 += EXPAND(pstr_huffman_tbl->huff_ltab7_8[temp_2][temp_3]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  155|       |
  156|  2.47M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  157|       |
  158|  2.47M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_2][temp_3]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  159|       |
  160|  2.47M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_0][temp_1]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  161|       |
  162|  2.47M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_2][temp_3]);
  ------------------
  |  |   31|  2.47M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  163|       |
  164|  2.47M|    sc += (temp_0 > 0) + (temp_1 > 0) + (temp_2 > 0) + (temp_3 > 0);
  165|  2.47M|  }
  166|       |
  167|   793k|  bitcnt[1] = invalid_bitcnt;
  168|   793k|  bitcnt[2] = invalid_bitcnt;
  169|       |
  170|   793k|  bitcnt[3] = HI_EXPLTAB(bits3_4) + sc;
  ------------------
  |  |   29|   793k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  171|       |
  172|   793k|  bitcnt[4] = LO_EXPLTAB(bits3_4) + sc;
  ------------------
  |  |   30|   793k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  173|       |
  174|   793k|  bitcnt[5] = HI_EXPLTAB(bits5_6);
  ------------------
  |  |   29|   793k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  175|       |
  176|   793k|  bitcnt[6] = LO_EXPLTAB(bits5_6);
  ------------------
  |  |   30|   793k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  177|       |
  178|   793k|  bitcnt[7] = HI_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   29|   793k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  179|       |
  180|   793k|  bitcnt[8] = LO_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   30|   793k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  181|       |
  182|   793k|  bitcnt[9] = HI_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   29|   793k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  183|       |
  184|   793k|  bitcnt[10] = LO_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   30|   793k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  185|       |
  186|   793k|  bitcnt[11] = bit11 + sc;
  187|   793k|}
ixheaace_bits_count.c:ia_enhaacplus_enc_count5_6_7_8_9_10_11:
  192|   634k|                                                   WORD32 invalid_bitcnt) {
  193|   634k|  WORD32 i;
  194|   634k|  WORD32 bits5_6, bits7_8, bits9_10, bit11, sc;
  195|   634k|  WORD32 temp_0, temp_1;
  196|       |
  197|   634k|  bits5_6 = 0;
  198|   634k|  bits7_8 = 0;
  199|   634k|  bits9_10 = 0;
  200|   634k|  bit11 = 0;
  201|   634k|  sc = 0;
  202|       |
  203|  4.84M|  for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (203:15): [True: 4.21M, False: 634k]
  ------------------
  204|  4.21M|    temp_0 = values[i + 0];
  205|  4.21M|    temp_1 = values[i + 1];
  206|       |
  207|  4.21M|    bits5_6 += EXPAND(pstr_huffman_tbl->huff_ltab5_6[temp_0 + 4][temp_1 + 4]);
  ------------------
  |  |   31|  4.21M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  208|       |
  209|  4.21M|    temp_0 = abs32(temp_0);
  ------------------
  |  |   25|  4.21M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.50M, False: 2.70M]
  |  |  ------------------
  ------------------
  210|  4.21M|    temp_1 = abs32(temp_1);
  ------------------
  |  |   25|  4.21M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.51M, False: 2.69M]
  |  |  ------------------
  ------------------
  211|       |
  212|  4.21M|    bits7_8 += EXPAND(pstr_huffman_tbl->huff_ltab7_8[temp_0][temp_1]);
  ------------------
  |  |   31|  4.21M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  213|       |
  214|  4.21M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   31|  4.21M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  215|       |
  216|  4.21M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_0][temp_1]);
  ------------------
  |  |   31|  4.21M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  217|       |
  218|  4.21M|    sc += (temp_0 > 0) + (temp_1 > 0);
  219|  4.21M|  }
  220|       |
  221|   634k|  bitcnt[1] = invalid_bitcnt;
  222|   634k|  bitcnt[2] = invalid_bitcnt;
  223|   634k|  bitcnt[3] = invalid_bitcnt;
  224|   634k|  bitcnt[4] = invalid_bitcnt;
  225|       |
  226|   634k|  bitcnt[5] = HI_EXPLTAB(bits5_6);
  ------------------
  |  |   29|   634k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  227|       |
  228|   634k|  bitcnt[6] = LO_EXPLTAB(bits5_6);
  ------------------
  |  |   30|   634k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  229|       |
  230|   634k|  bitcnt[7] = HI_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   29|   634k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  231|       |
  232|   634k|  bitcnt[8] = LO_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   30|   634k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  233|       |
  234|   634k|  bitcnt[9] = HI_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   29|   634k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  235|       |
  236|   634k|  bitcnt[10] = LO_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   30|   634k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  237|       |
  238|   634k|  bitcnt[11] = bit11 + sc;
  239|   634k|}
ixheaace_bits_count.c:ia_enhaacplus_enc_count7_8_9_10_11:
  244|   608k|                                               WORD32 invalid_bitcnt) {
  245|   608k|  WORD32 i;
  246|   608k|  WORD32 bits7_8, bits9_10, bit11, sc;
  247|   608k|  WORD32 temp_0, temp_1;
  248|       |
  249|   608k|  bits7_8 = 0;
  250|   608k|  bits9_10 = 0;
  251|   608k|  bit11 = 0;
  252|   608k|  sc = 0;
  253|       |
  254|  4.91M|  for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (254:15): [True: 4.30M, False: 608k]
  ------------------
  255|  4.30M|    temp_0 = abs32(values[i + 0]);
  ------------------
  |  |   25|  4.30M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.74M, False: 2.56M]
  |  |  ------------------
  ------------------
  256|  4.30M|    temp_1 = abs32(values[i + 1]);
  ------------------
  |  |   25|  4.30M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.69M, False: 2.60M]
  |  |  ------------------
  ------------------
  257|       |
  258|  4.30M|    bits7_8 += EXPAND(pstr_huffman_tbl->huff_ltab7_8[temp_0][temp_1]);
  ------------------
  |  |   31|  4.30M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  259|       |
  260|  4.30M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   31|  4.30M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  261|       |
  262|  4.30M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_0][temp_1]);
  ------------------
  |  |   31|  4.30M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  263|       |
  264|  4.30M|    sc += (temp_0 > 0) + (temp_1 > 0);
  265|  4.30M|  }
  266|       |
  267|   608k|  bitcnt[1] = invalid_bitcnt;
  268|   608k|  bitcnt[2] = invalid_bitcnt;
  269|   608k|  bitcnt[3] = invalid_bitcnt;
  270|   608k|  bitcnt[4] = invalid_bitcnt;
  271|   608k|  bitcnt[5] = invalid_bitcnt;
  272|   608k|  bitcnt[6] = invalid_bitcnt;
  273|       |
  274|   608k|  bitcnt[7] = HI_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   29|   608k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  275|       |
  276|   608k|  bitcnt[8] = LO_EXPLTAB(bits7_8) + sc;
  ------------------
  |  |   30|   608k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  277|       |
  278|   608k|  bitcnt[9] = HI_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   29|   608k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  279|       |
  280|   608k|  bitcnt[10] = LO_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   30|   608k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  281|       |
  282|   608k|  bitcnt[11] = bit11 + sc;
  283|   608k|}
ixheaace_bits_count.c:ia_enhaacplus_enc_count9_10_11:
  288|   569k|                                           WORD32 invalid_bitcnt) {
  289|   569k|  WORD32 i;
  290|   569k|  WORD32 bits9_10, bit11, sc;
  291|   569k|  WORD32 temp_0, temp_1;
  292|       |
  293|   569k|  bits9_10 = 0;
  294|   569k|  bit11 = 0;
  295|   569k|  sc = 0;
  296|       |
  297|  5.09M|  for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (297:15): [True: 4.52M, False: 569k]
  ------------------
  298|  4.52M|    temp_0 = abs32(values[i + 0]);
  ------------------
  |  |   25|  4.52M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.91M, False: 2.60M]
  |  |  ------------------
  ------------------
  299|  4.52M|    temp_1 = abs32(values[i + 1]);
  ------------------
  |  |   25|  4.52M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 1.86M, False: 2.65M]
  |  |  ------------------
  ------------------
  300|       |
  301|  4.52M|    bits9_10 += EXPAND(pstr_huffman_tbl->huff_ltab9_10[temp_0][temp_1]);
  ------------------
  |  |   31|  4.52M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  302|       |
  303|  4.52M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_0][temp_1]);
  ------------------
  |  |   31|  4.52M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  304|       |
  305|  4.52M|    sc += (temp_0 > 0) + (temp_1 > 0);
  306|  4.52M|  }
  307|       |
  308|   569k|  bitcnt[1] = invalid_bitcnt;
  309|   569k|  bitcnt[2] = invalid_bitcnt;
  310|   569k|  bitcnt[3] = invalid_bitcnt;
  311|   569k|  bitcnt[4] = invalid_bitcnt;
  312|   569k|  bitcnt[5] = invalid_bitcnt;
  313|   569k|  bitcnt[6] = invalid_bitcnt;
  314|   569k|  bitcnt[7] = invalid_bitcnt;
  315|   569k|  bitcnt[8] = invalid_bitcnt;
  316|       |
  317|   569k|  bitcnt[9] = HI_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   29|   569k|#define HI_EXPLTAB(a) (a >> 16)
  ------------------
  318|       |
  319|   569k|  bitcnt[10] = LO_EXPLTAB(bits9_10) + sc;
  ------------------
  |  |   30|   569k|#define LO_EXPLTAB(a) (a & 0xffff)
  ------------------
  320|       |
  321|   569k|  bitcnt[11] = bit11 + sc;
  322|   569k|}
ixheaace_bits_count.c:ia_enhaacplus_enc_count11:
  326|   202k|                                      WORD32 invalid_bitcnt) {
  327|   202k|  WORD32 i;
  328|   202k|  WORD32 bit11, sc;
  329|   202k|  WORD32 temp_0, temp_1;
  330|       |
  331|   202k|  bit11 = 0;
  332|   202k|  sc = 0;
  333|       |
  334|  1.57M|  for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (334:15): [True: 1.37M, False: 202k]
  ------------------
  335|  1.37M|    temp_0 = abs32(values[i + 0]);
  ------------------
  |  |   25|  1.37M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 574k, False: 796k]
  |  |  ------------------
  ------------------
  336|  1.37M|    temp_1 = abs32(values[i + 1]);
  ------------------
  |  |   25|  1.37M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 558k, False: 811k]
  |  |  ------------------
  ------------------
  337|       |
  338|  1.37M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[temp_0][temp_1]);
  ------------------
  |  |   31|  1.37M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  339|       |
  340|  1.37M|    sc += (temp_0 > 0) + (temp_1 > 0);
  341|  1.37M|  }
  342|       |
  343|   202k|  bitcnt[1] = invalid_bitcnt;
  344|   202k|  bitcnt[2] = invalid_bitcnt;
  345|   202k|  bitcnt[3] = invalid_bitcnt;
  346|   202k|  bitcnt[4] = invalid_bitcnt;
  347|   202k|  bitcnt[5] = invalid_bitcnt;
  348|   202k|  bitcnt[6] = invalid_bitcnt;
  349|   202k|  bitcnt[7] = invalid_bitcnt;
  350|   202k|  bitcnt[8] = invalid_bitcnt;
  351|   202k|  bitcnt[9] = invalid_bitcnt;
  352|   202k|  bitcnt[10] = invalid_bitcnt;
  353|       |
  354|   202k|  bitcnt[11] = bit11 + sc;
  355|   202k|}
ixheaace_bits_count.c:ia_enhaacplus_enc_count_esc:
  359|  1.47M|                                        WORD32 invalid_bitcnt) {
  360|  1.47M|  WORD32 i;
  361|  1.47M|  WORD32 bit11, ec, sc;
  362|  1.47M|  WORD32 temp_0, temp_1, t00, t01;
  363|       |
  364|  1.47M|  bit11 = 0;
  365|  1.47M|  sc = 0;
  366|  1.47M|  ec = 0;
  367|       |
  368|  8.87M|  for (i = 0; i < width; i += 2) {
  ------------------
  |  Branch (368:15): [True: 7.40M, False: 1.47M]
  ------------------
  369|  7.40M|    temp_0 = abs32(values[i + 0]);
  ------------------
  |  |   25|  7.40M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 3.42M, False: 3.98M]
  |  |  ------------------
  ------------------
  370|  7.40M|    temp_1 = abs32(values[i + 1]);
  ------------------
  |  |   25|  7.40M|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 3.20M, False: 4.19M]
  |  |  ------------------
  ------------------
  371|       |
  372|  7.40M|    sc += (temp_0 > 0) + (temp_1 > 0);
  373|  7.40M|    t00 = MIN(temp_0, 16);
  ------------------
  |  |   23|  7.40M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3.84M, False: 3.55M]
  |  |  ------------------
  ------------------
  374|  7.40M|    t01 = MIN(temp_1, 16);
  ------------------
  |  |   23|  7.40M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 4.29M, False: 3.10M]
  |  |  ------------------
  ------------------
  375|       |
  376|  7.40M|    bit11 += EXPAND(pstr_huffman_tbl->huff_ltab11[t00][t01]);
  ------------------
  |  |   31|  7.40M|#define EXPAND(a) ((((WORD32)(a & 0xff00)) << 8) | (WORD32)(a & 0xff))
  ------------------
  377|       |
  378|  7.40M|    if (temp_0 >= 16) {
  ------------------
  |  Branch (378:9): [True: 3.55M, False: 3.84M]
  ------------------
  379|  3.55M|      ec += 5;
  380|       |
  381|  7.83M|      while ((temp_0 >>= 1) >= 16) {
  ------------------
  |  Branch (381:14): [True: 4.27M, False: 3.55M]
  ------------------
  382|  4.27M|        ec += 2;
  383|  4.27M|      }
  384|  3.55M|    }
  385|       |
  386|  7.40M|    if (temp_1 >= 16) {
  ------------------
  |  Branch (386:9): [True: 3.10M, False: 4.29M]
  ------------------
  387|  3.10M|      ec += 5;
  388|       |
  389|  5.90M|      while ((temp_1 >>= 1) >= 16) {
  ------------------
  |  Branch (389:14): [True: 2.80M, False: 3.10M]
  ------------------
  390|  2.80M|        ec += 2;
  391|  2.80M|      }
  392|  3.10M|    }
  393|  7.40M|  }
  394|       |
  395|  1.47M|  bitcnt[1] = invalid_bitcnt;
  396|  1.47M|  bitcnt[2] = invalid_bitcnt;
  397|  1.47M|  bitcnt[3] = invalid_bitcnt;
  398|  1.47M|  bitcnt[4] = invalid_bitcnt;
  399|  1.47M|  bitcnt[5] = invalid_bitcnt;
  400|  1.47M|  bitcnt[6] = invalid_bitcnt;
  401|  1.47M|  bitcnt[7] = invalid_bitcnt;
  402|  1.47M|  bitcnt[8] = invalid_bitcnt;
  403|  1.47M|  bitcnt[9] = invalid_bitcnt;
  404|  1.47M|  bitcnt[10] = invalid_bitcnt;
  405|       |
  406|  1.47M|  bitcnt[11] = bit11 + sc + ec;
  407|  1.47M|}

iaace_init_block_switching:
   42|  4.31k|                                const WORD32 bit_rate, const WORD32 num_chans) {
   43|  4.31k|  if ((num_chans == 1 && bit_rate > BLK_SWITCH_HIGH_BR_MONO) ||
  ------------------
  |  |   47|  1.56k|#define BLK_SWITCH_HIGH_BR_MONO (24000)
  ------------------
  |  Branch (43:8): [True: 1.56k, False: 2.74k]
  |  Branch (43:26): [True: 583, False: 986]
  ------------------
   44|  3.73k|      (num_chans > 1 && bit_rate / num_chans > BLK_SWITCH_HIGH_BR_STEREO)) {
  ------------------
  |  |   48|  2.74k|#define BLK_SWITCH_HIGH_BR_STEREO (16000)
  ------------------
  |  Branch (44:8): [True: 2.74k, False: 986]
  |  Branch (44:25): [True: 1.10k, False: 1.64k]
  ------------------
   45|  1.68k|    pstr_blk_switch_ctrl->inv_attack_ratio = INV_ATTACK_RATIO_HIGH_BR;
  ------------------
  |  |   44|  1.68k|#define INV_ATTACK_RATIO_HIGH_BR 0.1f
  ------------------
   46|  2.63k|  } else {
   47|  2.63k|    pstr_blk_switch_ctrl->inv_attack_ratio = INV_ATTACK_RATIO_LOW_BR;
  ------------------
  |  |   45|  2.63k|#define INV_ATTACK_RATIO_LOW_BR 0.056f
  ------------------
   48|  2.63k|  }
   49|       |
   50|  4.31k|  memset(pstr_blk_switch_ctrl->iir_states, 0,
   51|  4.31k|         BLK_SWITCH_FILT_LEN * sizeof(pstr_blk_switch_ctrl->iir_states[0]));
  ------------------
  |  |   28|  4.31k|#define BLK_SWITCH_FILT_LEN 2
  ------------------
   52|       |  /* Clear Filtered Window Energies */
   53|       |
   54|  4.31k|  memset(pstr_blk_switch_ctrl->win_energy_filt, 0,
   55|  4.31k|         BLK_SWITCH_WIN * sizeof(pstr_blk_switch_ctrl->win_energy_filt[0][0]));
  ------------------
  |  |   27|  4.31k|#define BLK_SWITCH_WIN 8
  ------------------
   56|  4.31k|  memset(pstr_blk_switch_ctrl->win_energy, 0,
   57|  4.31k|         BLK_SWITCH_WIN * sizeof(pstr_blk_switch_ctrl->win_energy[0][0]));
  ------------------
  |  |   27|  4.31k|#define BLK_SWITCH_WIN 8
  ------------------
   58|       |
   59|  4.31k|  pstr_blk_switch_ctrl->acc_win_energy = 0;
   60|       |
   61|  4.31k|  pstr_blk_switch_ctrl->win_seq = LONG_WINDOW;
  ------------------
  |  |   31|  4.31k|#define LONG_WINDOW 0
  ------------------
   62|  4.31k|  pstr_blk_switch_ctrl->nxt_win_seq = LONG_WINDOW;
  ------------------
  |  |   31|  4.31k|#define LONG_WINDOW 0
  ------------------
   63|       |
   64|  4.31k|  pstr_blk_switch_ctrl->attack = 0;
   65|  4.31k|  pstr_blk_switch_ctrl->lastattack = 0;
   66|  4.31k|  pstr_blk_switch_ctrl->attack_idx = 0;
   67|  4.31k|  pstr_blk_switch_ctrl->last_attack_idx = 0;
   68|  4.31k|}
iaace_block_switching:
  129|   281k|                           WORD32 num_chans) {
  130|   281k|  WORD32 win_idx;
  131|   281k|  FLOAT32 tmp_nrg_1, tmp_nrg_2;
  132|   281k|  FLOAT32 prev_win_nrg, max_nrg;
  133|       |
  134|   281k|  memset(pstr_blk_switch_ctrl->group_len, 0,
  135|   281k|         TRANS_FAC * sizeof(pstr_blk_switch_ctrl->group_len[0]));
  ------------------
  |  |   29|   281k|#define TRANS_FAC 8
  ------------------
  136|       |
  137|   281k|  pstr_blk_switch_ctrl->max_win_energy =
  138|   281k|      iaace_search_max_with_idx(&pstr_blk_switch_ctrl->win_energy[0][BLK_SWITCH_WIN - 1],
  ------------------
  |  |   27|   281k|#define BLK_SWITCH_WIN 8
  ------------------
  139|   281k|                                &pstr_blk_switch_ctrl->attack_idx, BLK_SWITCH_WIN);
  ------------------
  |  |   27|   281k|#define BLK_SWITCH_WIN 8
  ------------------
  140|       |
  141|   281k|  pstr_blk_switch_ctrl->attack_idx = pstr_blk_switch_ctrl->last_attack_idx;
  142|   281k|  pstr_blk_switch_ctrl->total_groups_cnt = MAXIMUM_NO_OF_GROUPS;
  ------------------
  |  |   40|   281k|#define MAXIMUM_NO_OF_GROUPS 4
  ------------------
  143|       |
  144|   281k|  memcpy(pstr_blk_switch_ctrl->group_len,
  145|   281k|         iaace_suggested_grouping_table[pstr_blk_switch_ctrl->attack_idx],
  146|   281k|         MAXIMUM_NO_OF_GROUPS * sizeof(pstr_blk_switch_ctrl->group_len[0]));
  ------------------
  |  |   40|   281k|#define MAXIMUM_NO_OF_GROUPS 4
  ------------------
  147|       |
  148|   281k|  memcpy(pstr_blk_switch_ctrl->win_energy[0], pstr_blk_switch_ctrl->win_energy[1],
  149|   281k|         BLK_SWITCH_WIN * sizeof(pstr_blk_switch_ctrl->win_energy[0][0]));
  ------------------
  |  |   27|   281k|#define BLK_SWITCH_WIN 8
  ------------------
  150|   281k|  memcpy(pstr_blk_switch_ctrl->win_energy_filt[0], pstr_blk_switch_ctrl->win_energy_filt[1],
  151|   281k|         BLK_SWITCH_WIN * sizeof(pstr_blk_switch_ctrl->win_energy_filt[0][0]));
  ------------------
  |  |   27|   281k|#define BLK_SWITCH_WIN 8
  ------------------
  152|       |
  153|   281k|  iaace_calc_window_energy(
  154|   281k|      pstr_blk_switch_ctrl, ptr_time_signal, num_chans,
  155|   281k|      (frame_length == FRAME_LEN_960 ? FRAME_LEN_SHORT_120 : FRAME_LEN_SHORT_128));
  ------------------
  |  |   94|   281k|#define FRAME_LEN_960 960
  ------------------
                    (frame_length == FRAME_LEN_960 ? FRAME_LEN_SHORT_120 : FRAME_LEN_SHORT_128));
  ------------------
  |  |   31|   112k|#define FRAME_LEN_SHORT_120 (120)
  ------------------
                    (frame_length == FRAME_LEN_960 ? FRAME_LEN_SHORT_120 : FRAME_LEN_SHORT_128));
  ------------------
  |  |   30|   168k|#define FRAME_LEN_SHORT_128 (128)
  ------------------
  |  Branch (155:8): [True: 112k, False: 168k]
  ------------------
  156|       |
  157|   281k|  pstr_blk_switch_ctrl->attack = FALSE;
  ------------------
  |  |   26|   281k|#define FALSE (0)
  ------------------
  158|       |
  159|   281k|  max_nrg = 0.0f;
  160|       |
  161|   281k|  prev_win_nrg = pstr_blk_switch_ctrl->win_energy_filt[0][BLK_SWITCH_WIN - 1];
  ------------------
  |  |   27|   281k|#define BLK_SWITCH_WIN 8
  ------------------
  162|       |
  163|  2.53M|  for (win_idx = 0; win_idx < BLK_SWITCH_WIN; win_idx++) {
  ------------------
  |  |   27|  2.53M|#define BLK_SWITCH_WIN 8
  ------------------
  |  Branch (163:21): [True: 2.25M, False: 281k]
  ------------------
  164|  2.25M|    tmp_nrg_1 = iaace_fmult(ONE_MINUS_ACC_WINDOW_NRG_FAC, pstr_blk_switch_ctrl->acc_win_energy);
  ------------------
  |  |   43|  2.25M|#define ONE_MINUS_ACC_WINDOW_NRG_FAC 0.7f
  ------------------
  165|  2.25M|    tmp_nrg_2 = iaace_fmult(ACC_WINDOW_NRG_FAC, prev_win_nrg);
  ------------------
  |  |   42|  2.25M|#define ACC_WINDOW_NRG_FAC 0.3f
  ------------------
  166|  2.25M|    pstr_blk_switch_ctrl->acc_win_energy = iaace_fadd(tmp_nrg_1, tmp_nrg_2);
  167|       |
  168|  2.25M|    tmp_nrg_1 = iaace_fmult(pstr_blk_switch_ctrl->win_energy_filt[1][win_idx],
  169|  2.25M|                            pstr_blk_switch_ctrl->inv_attack_ratio);
  170|  2.25M|    if (tmp_nrg_1 > pstr_blk_switch_ctrl->acc_win_energy) {
  ------------------
  |  Branch (170:9): [True: 74.7k, False: 2.17M]
  ------------------
  171|  74.7k|      pstr_blk_switch_ctrl->attack = TRUE;
  ------------------
  |  |   23|  74.7k|#define TRUE (1)
  ------------------
  172|  74.7k|      pstr_blk_switch_ctrl->last_attack_idx = win_idx;
  173|  74.7k|    }
  174|       |
  175|  2.25M|    prev_win_nrg = pstr_blk_switch_ctrl->win_energy_filt[1][win_idx];
  176|       |
  177|  2.25M|    max_nrg = MAX(prev_win_nrg, max_nrg);
  ------------------
  |  |   24|  2.25M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 415k, False: 1.83M]
  |  |  ------------------
  ------------------
  178|  2.25M|  }
  179|       |
  180|   281k|  if (max_nrg < MIN_ATTACK_NRG) {
  ------------------
  |  |   46|   281k|#define MIN_ATTACK_NRG (1000000)
  ------------------
  |  Branch (180:7): [True: 111k, False: 169k]
  ------------------
  181|   111k|    pstr_blk_switch_ctrl->attack = FALSE;
  ------------------
  |  |   26|   111k|#define FALSE (0)
  ------------------
  182|   111k|  }
  183|       |
  184|   281k|  if ((!pstr_blk_switch_ctrl->attack) && (pstr_blk_switch_ctrl->lastattack)) {
  ------------------
  |  Branch (184:7): [True: 210k, False: 70.8k]
  |  Branch (184:42): [True: 29.9k, False: 180k]
  ------------------
  185|  29.9k|    if (pstr_blk_switch_ctrl->attack_idx == (TRANS_FAC - 1)) {
  ------------------
  |  |   29|  29.9k|#define TRANS_FAC 8
  ------------------
  |  Branch (185:9): [True: 390, False: 29.5k]
  ------------------
  186|    390|      pstr_blk_switch_ctrl->attack = TRUE;
  ------------------
  |  |   23|    390|#define TRUE (1)
  ------------------
  187|    390|    }
  188|  29.9k|    pstr_blk_switch_ctrl->lastattack = FALSE;
  ------------------
  |  |   26|  29.9k|#define FALSE (0)
  ------------------
  189|   251k|  } else {
  190|   251k|    pstr_blk_switch_ctrl->lastattack = pstr_blk_switch_ctrl->attack;
  191|   251k|  }
  192|   281k|  pstr_blk_switch_ctrl->win_seq = pstr_blk_switch_ctrl->nxt_win_seq;
  193|       |
  194|   281k|  pstr_blk_switch_ctrl->nxt_win_seq =
  195|   281k|      (pstr_blk_switch_ctrl->attack == 1) ? SHORT_WINDOW : LONG_WINDOW;
  ------------------
  |  |   33|  71.2k|#define SHORT_WINDOW 2
  ------------------
                    (pstr_blk_switch_ctrl->attack == 1) ? SHORT_WINDOW : LONG_WINDOW;
  ------------------
  |  |   31|   491k|#define LONG_WINDOW 0
  ------------------
  |  Branch (195:7): [True: 71.2k, False: 210k]
  ------------------
  196|       |
  197|   281k|  if (pstr_blk_switch_ctrl->nxt_win_seq == SHORT_WINDOW) {
  ------------------
  |  |   33|   281k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (197:7): [True: 71.2k, False: 210k]
  ------------------
  198|  71.2k|    if (pstr_blk_switch_ctrl->win_seq == LONG_WINDOW) {
  ------------------
  |  |   31|  71.2k|#define LONG_WINDOW 0
  ------------------
  |  Branch (198:9): [True: 20.8k, False: 50.3k]
  ------------------
  199|  20.8k|      pstr_blk_switch_ctrl->win_seq = START_WINDOW;
  ------------------
  |  |   32|  20.8k|#define START_WINDOW 1
  ------------------
  200|  50.3k|    } else if (pstr_blk_switch_ctrl->win_seq == STOP_WINDOW) {
  ------------------
  |  |   34|  50.3k|#define STOP_WINDOW 3
  ------------------
  |  Branch (200:16): [True: 10.2k, False: 40.1k]
  ------------------
  201|  10.2k|      pstr_blk_switch_ctrl->win_seq = SHORT_WINDOW;
  ------------------
  |  |   33|  10.2k|#define SHORT_WINDOW 2
  ------------------
  202|  10.2k|      pstr_blk_switch_ctrl->total_groups_cnt = 3;
  203|  10.2k|      pstr_blk_switch_ctrl->group_len[0] = 3;
  204|  10.2k|      pstr_blk_switch_ctrl->group_len[1] = 3;
  205|  10.2k|      pstr_blk_switch_ctrl->group_len[2] = 2;
  206|  10.2k|    }
  207|  71.2k|  }
  208|       |
  209|   281k|  if (pstr_blk_switch_ctrl->nxt_win_seq == LONG_WINDOW &&
  ------------------
  |  |   31|   562k|#define LONG_WINDOW 0
  ------------------
  |  Branch (209:7): [True: 210k, False: 71.2k]
  ------------------
  210|   210k|      pstr_blk_switch_ctrl->win_seq == SHORT_WINDOW) {
  ------------------
  |  |   33|   210k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (210:7): [True: 29.7k, False: 180k]
  ------------------
  211|  29.7k|    pstr_blk_switch_ctrl->nxt_win_seq = STOP_WINDOW;
  ------------------
  |  |   34|  29.7k|#define STOP_WINDOW 3
  ------------------
  212|  29.7k|  }
  213|   281k|}
iaace_sync_block_switching:
  217|   204k|                                const WORD32 num_channels) {
  218|   204k|  WORD32 i;
  219|   204k|  WORD32 patch_type = LONG_WINDOW;
  ------------------
  |  |   31|   204k|#define LONG_WINDOW 0
  ------------------
  220|       |
  221|   204k|  if (num_channels == 1) {
  ------------------
  |  Branch (221:7): [True: 114k, False: 90.0k]
  ------------------
  222|   114k|    if (pstr_blk_switch_left_ctrl->win_seq != SHORT_WINDOW) {
  ------------------
  |  |   33|   114k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (222:9): [True: 99.0k, False: 15.2k]
  ------------------
  223|  99.0k|      pstr_blk_switch_left_ctrl->total_groups_cnt = 1;
  224|  99.0k|      pstr_blk_switch_left_ctrl->group_len[0] = 1;
  225|       |
  226|   792k|      for (i = 1; i < TRANS_FAC; i++) {
  ------------------
  |  |   29|   792k|#define TRANS_FAC 8
  ------------------
  |  Branch (226:19): [True: 693k, False: 99.0k]
  ------------------
  227|   693k|        pstr_blk_switch_left_ctrl->group_len[i] = 0;
  228|   693k|      }
  229|  99.0k|    }
  230|   114k|  } else {
  231|       |    /* Stereo */
  232|       |
  233|  90.0k|    patch_type = iaace_synchronized_block_types[patch_type][pstr_blk_switch_left_ctrl->win_seq];
  234|  90.0k|    patch_type = iaace_synchronized_block_types[patch_type][pstr_blk_switch_right_ctrl->win_seq];
  235|       |
  236|  90.0k|    pstr_blk_switch_left_ctrl->win_seq = patch_type;
  237|  90.0k|    pstr_blk_switch_right_ctrl->win_seq = patch_type;
  238|       |
  239|  90.0k|    if (patch_type != SHORT_WINDOW) { /* tns_data_long Blocks */
  ------------------
  |  |   33|  90.0k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (239:9): [True: 54.2k, False: 35.8k]
  ------------------
  240|  54.2k|      pstr_blk_switch_left_ctrl->total_groups_cnt = 1;
  241|  54.2k|      pstr_blk_switch_right_ctrl->total_groups_cnt = 1;
  242|  54.2k|      pstr_blk_switch_left_ctrl->group_len[0] = 1;
  243|  54.2k|      pstr_blk_switch_right_ctrl->group_len[0] = 1;
  244|       |
  245|   434k|      for (i = 1; i < TRANS_FAC; i++) {
  ------------------
  |  |   29|   434k|#define TRANS_FAC 8
  ------------------
  |  Branch (245:19): [True: 379k, False: 54.2k]
  ------------------
  246|   379k|        pstr_blk_switch_left_ctrl->group_len[i] = 0;
  247|   379k|        pstr_blk_switch_right_ctrl->group_len[i] = 0;
  248|   379k|      }
  249|  54.2k|    } else { /* tns_data_short Blocks */
  250|  35.8k|      if (pstr_blk_switch_left_ctrl->max_win_energy >
  ------------------
  |  Branch (250:11): [True: 8.72k, False: 27.0k]
  ------------------
  251|  35.8k|          pstr_blk_switch_right_ctrl->max_win_energy) {
  252|  8.72k|        pstr_blk_switch_right_ctrl->total_groups_cnt =
  253|  8.72k|            pstr_blk_switch_left_ctrl->total_groups_cnt;
  254|  78.5k|        for (i = 0; i < TRANS_FAC; i++) {
  ------------------
  |  |   29|  78.5k|#define TRANS_FAC 8
  ------------------
  |  Branch (254:21): [True: 69.8k, False: 8.72k]
  ------------------
  255|  69.8k|          pstr_blk_switch_right_ctrl->group_len[i] = pstr_blk_switch_left_ctrl->group_len[i];
  256|  69.8k|        }
  257|  27.0k|      } else {
  258|  27.0k|        pstr_blk_switch_left_ctrl->total_groups_cnt =
  259|  27.0k|            pstr_blk_switch_right_ctrl->total_groups_cnt;
  260|   243k|        for (i = 0; i < TRANS_FAC; i++) {
  ------------------
  |  |   29|   243k|#define TRANS_FAC 8
  ------------------
  |  Branch (260:21): [True: 216k, False: 27.0k]
  ------------------
  261|   216k|          pstr_blk_switch_left_ctrl->group_len[i] = pstr_blk_switch_right_ctrl->group_len[i];
  262|   216k|        }
  263|  27.0k|      }
  264|  35.8k|    }
  265|  90.0k|  }
  266|   204k|}
ixheaace_block_switch.c:iaace_search_max_with_idx:
   70|   281k|static FLOAT32 iaace_search_max_with_idx(const FLOAT32 *ptr_in, WORD32 *ptr_index, WORD32 len) {
   71|   281k|  FLOAT32 max = 0;
   72|   281k|  WORD32 i = 0, idx = 0;
   73|       |
   74|  2.25M|  do {
   75|  2.25M|    if (ptr_in[i + 1] > max) {
  ------------------
  |  Branch (75:9): [True: 481k, False: 1.76M]
  ------------------
   76|   481k|      max = ptr_in[i + 1];
   77|   481k|      idx = i;
   78|   481k|    }
   79|  2.25M|    i++;
   80|  2.25M|  } while (i < len);
  ------------------
  |  Branch (80:12): [True: 1.96M, False: 281k]
  ------------------
   81|       |
   82|   281k|  *ptr_index = idx;
   83|       |
   84|   281k|  return max;
   85|   281k|}
ixheaace_block_switch.c:iaace_calc_window_energy:
  105|   281k|                                     WORD32 win_len) {
  106|   281k|  WORD32 i, w;
  107|   281k|  FLOAT32 acc_nrg_unfilt, acc_nrg_filt;
  108|   281k|  FLOAT32 tmp_nrg_unfilt, tmp_nrg_filt;
  109|  2.53M|  for (w = 0; w < BLK_SWITCH_WIN; w++) {
  ------------------
  |  |   27|  2.53M|#define BLK_SWITCH_WIN 8
  ------------------
  |  Branch (109:15): [True: 2.25M, False: 281k]
  ------------------
  110|  2.25M|    acc_nrg_unfilt = 0.0f;
  111|  2.25M|    acc_nrg_filt = 0.0f;
  112|       |
  113|   283M|    for (i = 0; i < win_len; i++) {
  ------------------
  |  Branch (113:17): [True: 280M, False: 2.25M]
  ------------------
  114|   280M|      tmp_nrg_unfilt = ptr_time_signal[(win_len * w + i) * ch_increment];
  115|   280M|      tmp_nrg_filt = iaace_blk_switch_iir_filt(tmp_nrg_unfilt, iaace_iir_hipass_coeffs,
  116|   280M|                                               pstr_blk_switch_ctrl->iir_states);
  117|       |
  118|   280M|      acc_nrg_unfilt += (tmp_nrg_unfilt * tmp_nrg_unfilt);
  119|   280M|      acc_nrg_filt += (tmp_nrg_filt * tmp_nrg_filt);
  120|   280M|    }
  121|       |
  122|  2.25M|    pstr_blk_switch_ctrl->win_energy[1][w] = acc_nrg_unfilt;
  123|  2.25M|    pstr_blk_switch_ctrl->win_energy_filt[1][w] = acc_nrg_filt;
  124|  2.25M|  }
  125|   281k|}
ixheaace_block_switch.c:iaace_blk_switch_iir_filt:
   88|   280M|                                         FLOAT32 *ptr_iir_states) {
   89|   280M|  FLOAT32 accu_1, accu_2;
   90|   280M|  FLOAT32 out;
   91|       |
   92|   280M|  accu_1 = ptr_iir_coeff[1] * (input - ptr_iir_states[0]);
   93|       |
   94|   280M|  accu_2 = ptr_iir_coeff[0] * ptr_iir_states[1];
   95|       |
   96|   280M|  out = accu_1 - accu_2;
   97|   280M|  ptr_iir_states[0] = input;
   98|   280M|  ptr_iir_states[1] = out;
   99|       |
  100|   280M|  return out;
  101|   280M|}
ixheaace_block_switch.c:iaace_fmult:
   37|  6.75M|static FLOAT32 iaace_fmult(FLOAT32 a, FLOAT32 b) { return (a * b); }
ixheaace_block_switch.c:iaace_fadd:
   39|  2.25M|static FLOAT32 iaace_fadd(FLOAT32 a, FLOAT32 b) { return (a + b); }

ia_enhaacplus_enc_calc_band_energy:
   31|  1.40M|                                        FLOAT32 *ptr_band_energy_sum) {
   32|  1.40M|  WORD32 i, j;
   33|       |
   34|  1.40M|  j = 0;
   35|  1.40M|  memset(ptr_band_energy, 0, sfb_count * sizeof(*ptr_band_energy));
   36|  1.40M|  *ptr_band_energy_sum = 0;
   37|       |
   38|  27.9M|  for (i = 0; i < num_bands; i++) {
  ------------------
  |  Branch (38:15): [True: 26.5M, False: 1.40M]
  ------------------
   39|   332M|    while (j < ptr_band_offset[i + 1]) {
  ------------------
  |  Branch (39:12): [True: 306M, False: 26.5M]
  ------------------
   40|   306M|      ptr_band_energy[i] += (FLOAT32)((FLOAT64)ptr_spec_coeffs[j] * ptr_spec_coeffs[j]);
   41|   306M|      j++;
   42|   306M|    }
   43|  26.5M|    *ptr_band_energy_sum = *ptr_band_energy_sum + ptr_band_energy[i];
   44|  26.5M|  }
   45|  1.40M|}
ia_enhaacplus_enc_calc_band_energy_ms:
   51|   391k|    FLOAT32 *ptr_band_nrg_side_sum) {
   52|   391k|  WORD32 i;
   53|   391k|  const FLOAT32 *ptr_spec_left = ptr_mdct_spectrum_left_fix;
   54|   391k|  const FLOAT32 *ptr_spec_right = ptr_mdct_spectrum_right_fix;
   55|       |
   56|   391k|  *ptr_band_nrg_mid_sum = 0;
   57|   391k|  *ptr_band_nrg_side_sum = 0;
   58|       |
   59|  6.92M|  for (i = 0; i < num_sfb_active; i++) {
  ------------------
  |  Branch (59:15): [True: 6.53M, False: 391k]
  ------------------
   60|  6.53M|    WORD16 offset = (WORD16)(ptr_sfb_offset[i + 1] - ptr_sfb_offset[i]);
   61|  6.53M|    FLOAT32 band_nrgy_mid = 0, band_nrg_side = 0;
   62|  6.53M|    ptr_band_nrg_mid[i] = 0;
   63|  6.53M|    ptr_band_nrg_side[i] = 0;
   64|  6.53M|    FLOAT32 spec_mid, spec_side;
   65|  6.53M|    FLOAT32 temp_mid, temp_side;
   66|       |
   67|  76.2M|    while (offset--) {
  ------------------
  |  Branch (67:12): [True: 69.7M, False: 6.53M]
  ------------------
   68|  69.7M|      spec_mid = (*ptr_spec_left + *ptr_spec_right) * 0.5f;
   69|  69.7M|      spec_side = (*ptr_spec_left++ - *ptr_spec_right++) * 0.5f;
   70|       |
   71|  69.7M|      temp_mid = (spec_mid * spec_mid);
   72|  69.7M|      temp_side = (spec_side * spec_side);
   73|       |
   74|  69.7M|      band_nrgy_mid = (band_nrgy_mid + temp_mid);
   75|  69.7M|      band_nrg_side = (band_nrg_side + temp_side);
   76|  69.7M|    }
   77|       |
   78|  6.53M|    ptr_band_nrg_mid[i] = band_nrgy_mid;
   79|  6.53M|    ptr_band_nrg_side[i] = band_nrg_side;
   80|       |
   81|  6.53M|    *ptr_band_nrg_mid_sum += ptr_band_nrg_mid[i];
   82|  6.53M|    *ptr_band_nrg_side_sum += ptr_band_nrg_side[i];
   83|  6.53M|  }
   84|       |
   85|   391k|  memset(&ptr_band_nrg_mid[num_sfb_active], 0,
   86|   391k|         (num_sfb_total - num_sfb_active) * sizeof(*ptr_band_nrg_mid));
   87|   391k|  memset(&ptr_band_nrg_side[num_sfb_active], 0,
   88|   391k|         (num_sfb_total - num_sfb_active) * sizeof(*ptr_band_nrg_side));
   89|   391k|}

ia_enhaacplus_enc_init_element_info:
   93|  4.74k|                                                 WORD32 ele_type, WORD32 element_instance_tag) {
   94|  4.74k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
   95|       |
   96|  4.74k|  if (ele_type != ID_LFE) {
  ------------------
  |  Branch (96:7): [True: 4.31k, False: 425]
  ------------------
   97|  4.31k|    switch (num_channels) {
   98|  2.10k|      case NUM_CHANS_MONO:
  ------------------
  |  |  113|  2.10k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (98:7): [True: 2.10k, False: 2.20k]
  ------------------
   99|  2.10k|        if (ele_type == -1) {
  ------------------
  |  Branch (99:13): [True: 151, False: 1.95k]
  ------------------
  100|    151|          error = ia_enhaacplus_enc_init_element(pstr_element_info, ID_SCE, element_instance_tag);
  101|  1.95k|        } else {
  102|  1.95k|          error =
  103|  1.95k|              ia_enhaacplus_enc_init_element(pstr_element_info, ele_type, element_instance_tag);
  104|  1.95k|        }
  105|  2.10k|        break;
  106|       |
  107|  2.20k|      case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  2.20k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (107:7): [True: 2.20k, False: 2.10k]
  ------------------
  108|  2.20k|        error = ia_enhaacplus_enc_init_element(pstr_element_info, ID_CPE, element_instance_tag);
  109|  2.20k|        break;
  110|       |
  111|      0|      default:
  ------------------
  |  Branch (111:7): [True: 0, False: 4.31k]
  ------------------
  112|      0|        return IA_EXHEAACE_INIT_FATAL_NUM_CHANNELS_NOT_SUPPORTED;
  113|  4.31k|    }
  114|  4.31k|  } else {
  115|    425|    error = ia_enhaacplus_enc_init_element(pstr_element_info, ID_LFE, element_instance_tag);
  116|    425|  }
  117|       |
  118|  4.74k|  return error;
  119|  4.74k|}
ia_enhaacplus_enc_init_element_bits:
  125|  4.74k|                                                 WORD32 bit_res, FLAG flag_framelength_small) {
  126|  4.74k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  127|       |
  128|  4.74k|  switch (pstr_element_info.n_channels_in_el) {
  129|  2.53k|    case NUM_CHANS_MONO:
  ------------------
  |  |  113|  2.53k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (129:5): [True: 2.53k, False: 2.20k]
  ------------------
  130|  2.53k|      element_bits->ch_bitrate = bitrate_tot;
  131|       |
  132|  2.53k|      element_bits->average_bits = (average_bits_tot - static_bits_tot);
  133|  2.53k|      switch (aot) {
  ------------------
  |  Branch (133:15): [True: 2.53k, False: 0]
  ------------------
  134|    491|        case AOT_AAC_LC:
  ------------------
  |  |   34|    491|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (134:9): [True: 491, False: 2.04k]
  ------------------
  135|  1.32k|        case AOT_SBR:
  ------------------
  |  |   35|  1.32k|#define AOT_SBR (5)
  ------------------
  |  Branch (135:9): [True: 832, False: 1.70k]
  ------------------
  136|  1.56k|        case AOT_PS:
  ------------------
  |  |   39|  1.56k|#define AOT_PS (29)
  ------------------
  |  Branch (136:9): [True: 246, False: 2.28k]
  ------------------
  137|  1.56k|          if (flag_framelength_small) {
  ------------------
  |  Branch (137:15): [True: 515, False: 1.05k]
  ------------------
  138|    515|            element_bits->max_bits = MAXIMUM_CHANNEL_BITS_960;
  ------------------
  |  |   95|    515|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  139|       |
  140|    515|            element_bits->max_bit_res_bits = MAXIMUM_CHANNEL_BITS_960 - average_bits_tot;
  ------------------
  |  |   95|    515|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  141|  1.05k|          } else {
  142|  1.05k|            element_bits->max_bits = MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |   94|  1.05k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  143|       |
  144|  1.05k|            element_bits->max_bit_res_bits = MAXIMUM_CHANNEL_BITS_1024 - average_bits_tot;
  ------------------
  |  |   94|  1.05k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  145|  1.05k|          }
  146|  1.56k|          break;
  147|       |
  148|    292|        case AOT_AAC_LD:
  ------------------
  |  |   36|    292|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (148:9): [True: 292, False: 2.24k]
  ------------------
  149|    965|        case AOT_AAC_ELD:
  ------------------
  |  |   37|    965|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (149:9): [True: 673, False: 1.86k]
  ------------------
  150|    965|          if (bit_res) {
  ------------------
  |  Branch (150:15): [True: 628, False: 337]
  ------------------
  151|    628|            element_bits->max_bits = bit_res;
  152|    628|            element_bits->max_bit_res_bits = bit_res - average_bits_tot;
  153|    628|          } else {
  154|    337|            element_bits->max_bits = average_bits_tot;
  155|    337|            element_bits->max_bit_res_bits = 0;
  156|    337|          }
  157|    965|          break;
  158|  2.53k|      }
  159|       |
  160|  2.53k|      element_bits->max_bit_res_bits -= (element_bits[0].max_bit_res_bits % 8);
  161|  2.53k|      element_bits->bit_res_level = element_bits[0].max_bit_res_bits;
  162|  2.53k|      element_bits->relative_bits = 1;
  163|  2.53k|      break;
  164|       |
  165|  2.20k|    case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  2.20k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (165:5): [True: 2.20k, False: 2.53k]
  ------------------
  166|  2.20k|      element_bits->ch_bitrate = bitrate_tot >> 1;
  167|       |
  168|  2.20k|      element_bits->average_bits = (average_bits_tot - static_bits_tot);
  169|  2.20k|      switch (aot) {
  ------------------
  |  Branch (169:15): [True: 2.20k, False: 0]
  ------------------
  170|    509|        case AOT_AAC_LC:
  ------------------
  |  |   34|    509|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (170:9): [True: 509, False: 1.70k]
  ------------------
  171|  1.37k|        case AOT_SBR:
  ------------------
  |  |   35|  1.37k|#define AOT_SBR (5)
  ------------------
  |  Branch (171:9): [True: 863, False: 1.34k]
  ------------------
  172|  1.37k|        case AOT_PS:
  ------------------
  |  |   39|  1.37k|#define AOT_PS (29)
  ------------------
  |  Branch (172:9): [True: 0, False: 2.20k]
  ------------------
  173|  1.37k|          if (flag_framelength_small) {
  ------------------
  |  Branch (173:15): [True: 502, False: 870]
  ------------------
  174|    502|            element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960;
  ------------------
  |  |  114|    502|#define NUM_CHANS_STEREO (2)
  ------------------
                          element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960;
  ------------------
  |  |   95|    502|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  175|       |
  176|    502|            element_bits->max_bit_res_bits =
  177|    502|                NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960 - average_bits_tot;
  ------------------
  |  |  114|    502|#define NUM_CHANS_STEREO (2)
  ------------------
                              NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960 - average_bits_tot;
  ------------------
  |  |   95|    502|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  178|    870|          } else {
  179|    870|            element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |  114|    870|#define NUM_CHANS_STEREO (2)
  ------------------
                          element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |   94|    870|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  180|       |
  181|    870|            element_bits->max_bit_res_bits =
  182|    870|                NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024 - average_bits_tot;
  ------------------
  |  |  114|    870|#define NUM_CHANS_STEREO (2)
  ------------------
                              NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024 - average_bits_tot;
  ------------------
  |  |   94|    870|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  183|    870|          }
  184|  1.37k|          break;
  185|       |
  186|    237|        case AOT_AAC_LD:
  ------------------
  |  |   36|    237|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (186:9): [True: 237, False: 1.97k]
  ------------------
  187|    837|        case AOT_AAC_ELD:
  ------------------
  |  |   37|    837|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (187:9): [True: 600, False: 1.60k]
  ------------------
  188|    837|          if (bit_res) {
  ------------------
  |  Branch (188:15): [True: 558, False: 279]
  ------------------
  189|    558|            element_bits->max_bits = bit_res;
  190|    558|            element_bits->max_bit_res_bits = bit_res - average_bits_tot;
  191|    558|          } else {
  192|    279|            element_bits->max_bits = average_bits_tot;
  193|    279|            element_bits->max_bit_res_bits = 0;
  194|    279|          }
  195|    837|          break;
  196|  2.20k|      }
  197|       |
  198|  2.20k|      element_bits->max_bit_res_bits -= (element_bits[0].max_bit_res_bits % 8);
  199|       |
  200|  2.20k|      element_bits->bit_res_level = element_bits[0].max_bit_res_bits;
  201|  2.20k|      element_bits->relative_bits = 1;
  202|  2.20k|      break;
  203|       |
  204|      0|    default:
  ------------------
  |  Branch (204:5): [True: 0, False: 4.74k]
  ------------------
  205|      0|      return IA_EXHEAACE_INIT_FATAL_INVALID_NUM_CHANNELS_IN_ELE;
  206|  4.74k|  }
  207|       |  /* Bits carried over from previous frame */
  208|  4.74k|  element_bits->carry_bits = 0;
  209|       |
  210|  4.74k|  return error;
  211|  4.74k|}
ixheaace_channel_map.c:ia_enhaacplus_enc_init_element:
   51|  4.74k|                                                   WORD32 element_instance_tag) {
   52|  4.74k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
   53|       |
   54|  4.74k|  pstr_element_info->el_type = el_type;
   55|       |
   56|  4.74k|  switch (pstr_element_info->el_type) {
   57|  2.10k|    case ID_SCE:
  ------------------
  |  Branch (57:5): [True: 2.10k, False: 2.63k]
  ------------------
   58|  2.10k|    case ID_CCE:
  ------------------
  |  Branch (58:5): [True: 0, False: 4.74k]
  ------------------
   59|  2.10k|      pstr_element_info->n_channels_in_el = NUM_CHANS_MONO;
  ------------------
  |  |  113|  2.10k|#define NUM_CHANS_MONO (1)
  ------------------
   60|       |
   61|  2.10k|      pstr_element_info->channel_index[0] = 0;
   62|       |
   63|  2.10k|      pstr_element_info->instance_tag = element_instance_tag;
   64|  2.10k|      break;
   65|       |
   66|    425|    case ID_LFE:
  ------------------
  |  Branch (66:5): [True: 425, False: 4.31k]
  ------------------
   67|    425|      pstr_element_info->n_channels_in_el = NUM_CHANS_MONO;
  ------------------
  |  |  113|    425|#define NUM_CHANS_MONO (1)
  ------------------
   68|       |
   69|    425|      pstr_element_info->channel_index[0] = 0;
   70|       |
   71|    425|      pstr_element_info->instance_tag = element_instance_tag;
   72|    425|      break;
   73|       |
   74|  2.20k|    case ID_CPE:
  ------------------
  |  Branch (74:5): [True: 2.20k, False: 2.53k]
  ------------------
   75|       |
   76|  2.20k|      pstr_element_info->n_channels_in_el = NUM_CHANS_STEREO;
  ------------------
  |  |  114|  2.20k|#define NUM_CHANS_STEREO (2)
  ------------------
   77|       |
   78|  2.20k|      pstr_element_info->channel_index[0] = 0;
   79|  2.20k|      pstr_element_info->channel_index[1] = 1;
   80|       |
   81|  2.20k|      pstr_element_info->instance_tag = element_instance_tag;
   82|  2.20k|      break;
   83|       |
   84|      0|    default:
  ------------------
  |  Branch (84:5): [True: 0, False: 4.74k]
  ------------------
   85|      0|      return IA_EXHEAACE_INIT_FATAL_INVALID_ELEMENT_TYPE;
   86|  4.74k|  }
   87|       |
   88|  4.74k|  return error;
   89|  4.74k|}

iusace_cplx_pred_proc:
  407|  31.7k|    FLOAT64 *ptr_scratch_cmpx_mdct_buf, FLOAT64 *ptr_ms_spec, FLOAT32 nrg_mid, FLOAT32 nrg_side) {
  408|  31.7k|  IA_ERRORCODE err_code;
  409|  31.7k|  FLOAT32 *ptr_sfb_enegry_left = pstr_psy_data[chn].ptr_sfb_energy_long;
  410|  31.7k|  FLOAT32 *ptr_sfb_energy_right = pstr_psy_data[chn + 1].ptr_sfb_energy_long;
  411|  31.7k|  const FLOAT32 *ptr_sfb_energy_mid = pstr_psy_data[chn].ptr_sfb_energy_long_ms;
  412|  31.7k|  const FLOAT32 *ptr_sfb_energy_side = pstr_psy_data[chn + 1].ptr_sfb_energy_long_ms;
  413|  31.7k|  FLOAT32 *ptr_sfb_thr_left = pstr_psy_data[chn].ptr_sfb_thr_long;
  414|  31.7k|  FLOAT32 *ptr_sfb_thr_right = pstr_psy_data[chn + 1].ptr_sfb_thr_long;
  415|  31.7k|  FLOAT32 *ptr_sfb_spread_energy_left = pstr_psy_data[chn].ptr_sfb_spreaded_energy_long;
  416|  31.7k|  FLOAT32 *ptr_sfb_spread_energy_right = pstr_psy_data[chn + 1].ptr_sfb_spreaded_energy_long;
  417|  31.7k|  WORD32 sfb, sfb_offsets;
  418|  31.7k|  WORD32 *ptr_num_sfb = pstr_sfb_prms->num_sfb;
  419|  31.7k|  WORD32 *ptr_num_window_groups = pstr_sfb_prms->num_window_groups;
  420|  31.7k|  const WORD32 sfb_count = ptr_num_window_groups[chn] * ptr_num_sfb[chn];
  421|  31.7k|  const WORD32 sfb_per_group = ptr_num_sfb[chn];
  422|  31.7k|  WORD32 grp = 0, i, zero_flag;
  423|  31.7k|  const WORD32 sfb_per_pred_band = 2;
  424|  31.7k|  FLOAT32 min_thr_1, min_thr_2 = 0.0f;
  425|  31.7k|  FLOAT32 temp_1 = 0, temp_2 = 0;
  426|  31.7k|  ia_ms_info_struct *pstr_ms_info = &pstr_usac_data->str_ms_info[chn];
  427|       |
  428|  31.7k|  FLOAT64 ipd;
  429|       |  /* Compute IPD between L and R channels */
  430|  31.7k|  ipd = iusace_compute_ipd(&pstr_usac_data->spectral_line_vector[chn][0],
  431|  31.7k|                           &pstr_usac_data->mdst_spectrum[chn][0],
  432|  31.7k|                           &pstr_usac_data->spectral_line_vector[chn + 1][0],
  433|  31.7k|                           &pstr_usac_data->mdst_spectrum[chn + 1][0], pstr_usac_config->ccfl);
  434|       |
  435|       |  /* Decide value of complex_coef based on IPD */
  436|  31.7k|  if ((ipd > (PI / 2 - 5 * PI / 180) && ipd < (PI / 2 + 5 * PI / 180)) ||
  ------------------
  |  |   38|  31.7k|#define PI (3.1415926535897932f)
  ------------------
                if ((ipd > (PI / 2 - 5 * PI / 180) && ipd < (PI / 2 + 5 * PI / 180)) ||
  ------------------
  |  |   38|  31.7k|#define PI (3.1415926535897932f)
  ------------------
                if ((ipd > (PI / 2 - 5 * PI / 180) && ipd < (PI / 2 + 5 * PI / 180)) ||
  ------------------
  |  |   38|  25.6k|#define PI (3.1415926535897932f)
  ------------------
                if ((ipd > (PI / 2 - 5 * PI / 180) && ipd < (PI / 2 + 5 * PI / 180)) ||
  ------------------
  |  |   38|  25.6k|#define PI (3.1415926535897932f)
  ------------------
  |  Branch (436:8): [True: 25.6k, False: 6.10k]
  |  Branch (436:41): [True: 1.34k, False: 24.2k]
  ------------------
  437|  30.3k|      (ipd > (3 * PI / 2 - 5 * PI / 180) && ipd < (3 * PI / 2 + 5 * PI / 180))) {
  ------------------
  |  |   38|  30.3k|#define PI (3.1415926535897932f)
  ------------------
                    (ipd > (3 * PI / 2 - 5 * PI / 180) && ipd < (3 * PI / 2 + 5 * PI / 180))) {
  ------------------
  |  |   38|  30.3k|#define PI (3.1415926535897932f)
  ------------------
                    (ipd > (3 * PI / 2 - 5 * PI / 180) && ipd < (3 * PI / 2 + 5 * PI / 180))) {
  ------------------
  |  |   38|  6.97k|#define PI (3.1415926535897932f)
  ------------------
                    (ipd > (3 * PI / 2 - 5 * PI / 180) && ipd < (3 * PI / 2 + 5 * PI / 180))) {
  ------------------
  |  |   38|  6.97k|#define PI (3.1415926535897932f)
  ------------------
  |  Branch (437:8): [True: 6.97k, False: 23.3k]
  |  Branch (437:45): [True: 1.41k, False: 5.56k]
  ------------------
  438|  2.75k|    pstr_usac_data->complex_coef[chn] = 1;
  439|  28.9k|  } else {
  440|  28.9k|    pstr_usac_data->complex_coef[chn] = 0;
  441|  28.9k|  }
  442|       |
  443|       |  /* Compute M and S spectra */
  444|  27.3M|  for (i = 0; i < pstr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (444:15): [True: 27.3M, False: 31.7k]
  ------------------
  445|  27.3M|    pstr_usac_data->spectral_line_vector[chn][i] = ptr_ms_spec[i];
  446|  27.3M|    pstr_usac_data->spectral_line_vector[chn + 1][i] = ptr_ms_spec[pstr_usac_config->ccfl + i];
  447|  27.3M|  }
  448|       |
  449|  31.7k|  err_code = iusace_cplx_pred_main(
  450|  31.7k|      pstr_sfb_prms->num_sfb[chn], pstr_sfb_prms->num_window_groups[chn],
  451|  31.7k|      pstr_usac_data->spectral_line_vector[chn], pstr_usac_data->spectral_line_vector[chn + 1],
  452|  31.7k|      pstr_usac_data->pred_coef_re[chn], pstr_usac_data->pred_coef_im[chn],
  453|  31.7k|      &pstr_usac_data->pred_dir_idx[chn], pstr_usac_data, pstr_sfb_prms, usac_independancy_flag,
  454|  31.7k|      pstr_usac_config, ptr_scratch_cmpx_mdct_buf, pstr_usac_data->cplx_pred_used[chn], chn,
  455|  31.7k|      ptr_sfb_offsets, nrg_mid, nrg_side, &pstr_ms_info->ms_mask);
  456|  31.7k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  31.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (456:7): [True: 0, False: 31.7k]
  ------------------
  457|      0|    return err_code;
  458|      0|  }
  459|       |
  460|  31.7k|  if (pstr_ms_info->ms_mask == 3) {
  ------------------
  |  Branch (460:7): [True: 16.2k, False: 15.4k]
  ------------------
  461|       |    /* Compute thresholds required for quantization (similar to that in MS coding) */
  462|  58.2k|    for (sfb = 0; sfb < sfb_count; sfb += sfb_per_group, grp++) {
  ------------------
  |  Branch (462:19): [True: 42.0k, False: 16.2k]
  ------------------
  463|   408k|      for (sfb_offsets = 0; sfb_offsets < sfb_per_group; sfb_offsets += sfb_per_pred_band) {
  ------------------
  |  Branch (463:29): [True: 366k, False: 42.0k]
  ------------------
  464|   366k|        if (pstr_usac_data->cplx_pred_used[chn][grp][sfb_offsets] == 1) {
  ------------------
  |  Branch (464:13): [True: 366k, False: 0]
  ------------------
  465|   366k|          zero_flag = (ptr_sfb_offsets[sfb + sfb_offsets + 1] != pstr_usac_config->ccfl);
  466|   366k|          min_thr_1 =
  467|   366k|              MIN(ptr_sfb_thr_left[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]);
  ------------------
  |  |   86|   366k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 67.3k, False: 299k]
  |  |  ------------------
  ------------------
  468|   366k|          if (zero_flag) {
  ------------------
  |  Branch (468:15): [True: 358k, False: 7.69k]
  ------------------
  469|   358k|            min_thr_2 = MIN(ptr_sfb_thr_left[sfb + sfb_offsets + 1],
  ------------------
  |  |   86|   358k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 60.1k, False: 298k]
  |  |  ------------------
  ------------------
  470|   358k|                            ptr_sfb_thr_right[sfb + sfb_offsets + 1]);
  471|   358k|          }
  472|       |
  473|   366k|          ptr_sfb_thr_left[sfb + sfb_offsets] = ptr_sfb_thr_right[sfb + sfb_offsets] = min_thr_1;
  474|   366k|          ptr_sfb_enegry_left[sfb + sfb_offsets] = ptr_sfb_energy_mid[sfb + sfb_offsets];
  475|   366k|          ptr_sfb_energy_right[sfb + sfb_offsets] = ptr_sfb_energy_side[sfb + sfb_offsets];
  476|   366k|          if (zero_flag) {
  ------------------
  |  Branch (476:15): [True: 358k, False: 7.69k]
  ------------------
  477|   358k|            ptr_sfb_thr_left[sfb + sfb_offsets + 1] = ptr_sfb_thr_right[sfb + sfb_offsets + 1] =
  478|   358k|                min_thr_2;
  479|   358k|            ptr_sfb_enegry_left[sfb + sfb_offsets + 1] =
  480|   358k|                ptr_sfb_energy_mid[sfb + sfb_offsets + 1];
  481|   358k|            ptr_sfb_energy_right[sfb + sfb_offsets + 1] =
  482|   358k|                ptr_sfb_energy_side[sfb + sfb_offsets + 1];
  483|   358k|          }
  484|   366k|          ptr_sfb_spread_energy_left[sfb + sfb_offsets] =
  485|   366k|              ptr_sfb_spread_energy_right[sfb + sfb_offsets] =
  486|   366k|                  MIN(ptr_sfb_spread_energy_left[sfb + sfb_offsets],
  ------------------
  |  |   86|   366k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 130k, False: 235k]
  |  |  ------------------
  ------------------
  487|   366k|                      ptr_sfb_spread_energy_right[sfb + sfb_offsets]) *
  488|   366k|                  0.5f;
  489|   366k|          if (zero_flag) {
  ------------------
  |  Branch (489:15): [True: 358k, False: 7.69k]
  ------------------
  490|   358k|            ptr_sfb_spread_energy_left[sfb + sfb_offsets + 1] =
  491|   358k|                ptr_sfb_spread_energy_right[sfb + sfb_offsets + 1] =
  492|   358k|                    MIN(ptr_sfb_spread_energy_left[sfb + sfb_offsets + 1],
  ------------------
  |  |   86|   358k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 129k, False: 229k]
  |  |  ------------------
  ------------------
  493|   358k|                        ptr_sfb_spread_energy_right[sfb + sfb_offsets + 1]) *
  494|   358k|                    0.5f;
  495|   358k|          }
  496|   366k|        }
  497|   366k|      }
  498|  42.0k|    }
  499|       |
  500|  16.2k|    if (pstr_usac_data->pred_dir_idx[chn] == 1) {
  ------------------
  |  Branch (500:9): [True: 14.4k, False: 1.82k]
  ------------------
  501|  14.4k|      grp = 0;
  502|       |
  503|  51.2k|      for (sfb = 0; sfb < sfb_count; sfb += sfb_per_group, grp++) {
  ------------------
  |  Branch (503:21): [True: 36.8k, False: 14.4k]
  ------------------
  504|   357k|        for (sfb_offsets = 0; sfb_offsets < sfb_per_group; sfb_offsets += sfb_per_pred_band) {
  ------------------
  |  Branch (504:31): [True: 320k, False: 36.8k]
  ------------------
  505|   320k|          zero_flag = (ptr_sfb_offsets[sfb + sfb_offsets + 1] != pstr_usac_config->ccfl);
  506|       |
  507|   320k|          if (pstr_usac_data->cplx_pred_used[chn][grp][sfb_offsets] == 1) {
  ------------------
  |  Branch (507:15): [True: 320k, False: 0]
  ------------------
  508|   320k|            temp_1 = ptr_sfb_enegry_left[sfb + sfb_offsets];
  509|   320k|            ptr_sfb_enegry_left[sfb + sfb_offsets] = ptr_sfb_energy_right[sfb + sfb_offsets];
  510|   320k|            ptr_sfb_energy_right[sfb + sfb_offsets] = temp_1;
  511|   320k|            if (zero_flag) {
  ------------------
  |  Branch (511:17): [True: 313k, False: 6.83k]
  ------------------
  512|   313k|              temp_2 = ptr_sfb_enegry_left[sfb + sfb_offsets + 1];
  513|   313k|              ptr_sfb_enegry_left[sfb + sfb_offsets + 1] =
  514|   313k|                  ptr_sfb_energy_right[sfb + sfb_offsets + 1];
  515|   313k|              ptr_sfb_energy_right[sfb + sfb_offsets + 1] = temp_2;
  516|   313k|            }
  517|   320k|          }
  518|   320k|        }
  519|  36.8k|      }
  520|  14.4k|    }
  521|  16.2k|  }
  522|  31.7k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  31.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  523|  31.7k|}
ixheaace_cplx_pred.c:iusace_compute_ipd:
  236|  31.7k|                                  WORD32 num_lines) {
  237|  31.7k|  LOOPIDX i;
  238|       |
  239|  31.7k|  FLOAT64 ipd = 0.0f;
  240|  31.7k|  FLOAT64 cross_corr_real = 0.0f, cross_corr_imag = 0.0f;
  241|       |
  242|  27.3M|  for (i = 0; i < num_lines; i++) {
  ------------------
  |  Branch (242:15): [True: 27.3M, False: 31.7k]
  ------------------
  243|  27.3M|    cross_corr_real +=
  244|  27.3M|        ptr_spec_real1[i] * ptr_spec_real2[i] + ptr_spec_imag1[i] * ptr_spec_imag2[i];
  245|  27.3M|    cross_corr_imag +=
  246|  27.3M|        -ptr_spec_imag2[i] * ptr_spec_real1[i] + ptr_spec_imag1[i] * ptr_spec_real2[i];
  247|  27.3M|  }
  248|       |
  249|  31.7k|  ipd = (FLOAT64)atan2(cross_corr_imag, cross_corr_real);
  250|  31.7k|  ipd = ipd > 0 ? ipd : 2. * PI + ipd;
  ------------------
  |  |   38|  17.4k|#define PI (3.1415926535897932f)
  ------------------
  |  Branch (250:9): [True: 14.2k, False: 17.4k]
  ------------------
  251|       |
  252|  31.7k|  return ipd;
  253|  31.7k|}
ixheaace_cplx_pred.c:iusace_cplx_pred_main:
  263|  31.7k|    WORD32 *ms_mask_flag) {
  264|  31.7k|  LOOPIDX group, sfb, i;
  265|  31.7k|  FLOAT32 pred_coef_re, pred_coef_im, pred_coef_q_re, pred_coef_q_im = 0.0f;
  266|  31.7k|  const WORD32 sfb_per_pred_band = 2;
  267|  31.7k|  WORD32 left = 0, right = 0, save_zeros = 0, condition_2 = 0, samp_per_bk = 0, bins_per_sbk = 0,
  268|  31.7k|         num_sbk = 0;
  269|  31.7k|  FLOAT64 *ptr_dmx_re_prev;
  270|  31.7k|  FLOAT64 *ptr_spec_mdct_res = &ptr_scratch_cmpx_mdct_buf[0];
  271|  31.7k|  const WORD32 sfb_count = num_window_groups * num_sfb;
  272|  31.7k|  const WORD32 sfb_per_group = num_sfb;
  273|  31.7k|  WORD32 sfb_offsets = 0, zero_flag, spec_start, spec_end;
  274|       |
  275|  31.7k|  left = chn, right = chn + 1;
  276|       |
  277|       |  /* Number of sub-blocks */
  278|  31.7k|  if (pstr_usac_config->window_sequence[left] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|  31.7k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (278:7): [True: 17.0k, False: 14.6k]
  ------------------
  279|  17.0k|    num_sbk = MAX_SHORT_WINDOWS;
  ------------------
  |  |   52|  17.0k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  280|  17.0k|  }
  281|  31.7k|  if (pstr_usac_config->window_sequence[left] == ONLY_LONG_SEQUENCE ||
  ------------------
  |  |   45|  63.4k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (281:7): [True: 8.61k, False: 23.0k]
  ------------------
  282|  23.0k|      pstr_usac_config->window_sequence[left] == LONG_START_SEQUENCE ||
  ------------------
  |  |   46|  54.7k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (282:7): [True: 2.54k, False: 20.5k]
  ------------------
  283|  20.5k|      pstr_usac_config->window_sequence[left] == LONG_STOP_SEQUENCE ||
  ------------------
  |  |   48|  52.2k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (283:7): [True: 3.46k, False: 17.0k]
  ------------------
  284|  17.0k|      pstr_usac_config->window_sequence[left] == STOP_START_SEQUENCE) {
  ------------------
  |  |   49|  17.0k|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (284:7): [True: 0, False: 17.0k]
  ------------------
  285|  14.6k|    num_sbk = 1;
  286|  14.6k|  }
  287|       |
  288|  31.7k|  if (num_sbk == 0) {
  ------------------
  |  Branch (288:7): [True: 0, False: 31.7k]
  ------------------
  289|      0|    return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_NUM_SBK;
  290|      0|  }
  291|       |
  292|  31.7k|  samp_per_bk = pstr_usac_config->ccfl;
  293|  31.7k|  bins_per_sbk = samp_per_bk / num_sbk;
  294|       |
  295|       |  /* Compute prediction direction */
  296|  31.7k|  if (nrg_mid >= nrg_side) {
  ------------------
  |  Branch (296:7): [True: 12.8k, False: 18.8k]
  ------------------
  297|  12.8k|    *pred_dir = 0;
  298|  18.8k|  } else {
  299|  18.8k|    *pred_dir = 1;
  300|  18.8k|  }
  301|       |
  302|  31.7k|  if (pstr_usac_data->complex_coef[chn] == 1) {
  ------------------
  |  Branch (302:7): [True: 2.75k, False: 28.9k]
  ------------------
  303|  2.75k|    save_zeros = ((pstr_usac_config->window_sequence[left] == EIGHT_SHORT_SEQUENCE &&
  ------------------
  |  |   40|  5.50k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (303:20): [True: 1.86k, False: 888]
  ------------------
  304|  1.86k|                   pstr_usac_config->window_sequence[right] != EIGHT_SHORT_SEQUENCE) ||
  ------------------
  |  |   40|  1.86k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (304:20): [True: 0, False: 1.86k]
  ------------------
  305|  2.75k|                  (pstr_usac_config->window_sequence[left] != EIGHT_SHORT_SEQUENCE &&
  ------------------
  |  |   40|  5.50k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (305:20): [True: 888, False: 1.86k]
  ------------------
  306|    888|                   pstr_usac_config->window_sequence[right] == EIGHT_SHORT_SEQUENCE));
  ------------------
  |  |   40|    888|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (306:20): [True: 0, False: 888]
  ------------------
  307|       |
  308|  2.75k|    condition_2 = (usac_independancy_flag || pstr_usac_data->core_mode_prev[left] ||
  ------------------
  |  Branch (308:20): [True: 161, False: 2.59k]
  |  Branch (308:46): [True: 10, False: 2.58k]
  ------------------
  309|  2.58k|                   pstr_usac_data->core_mode_prev[right]);
  ------------------
  |  Branch (309:20): [True: 0, False: 2.58k]
  ------------------
  310|       |
  311|       |    /* Compute current frame's MDST down-mix*/
  312|  2.75k|    ptr_dmx_re_prev = !(usac_independancy_flag) ? pstr_usac_data->ptr_dmx_re_save[chn] : NULL;
  ------------------
  |  Branch (312:23): [True: 2.59k, False: 161]
  ------------------
  313|       |
  314|  2.75k|    memset(pstr_usac_data->ptr_dmx_im[chn], 0, sizeof(FLOAT64) * FRAME_LEN_LONG);
  ------------------
  |  |   54|  2.75k|#define FRAME_LEN_LONG 1024
  ------------------
  315|       |
  316|  2.75k|    iusace_estimate_dmx_im(*pred_dir == 0 ? ptr_spec_mdct_mid : ptr_spec_mdct_side,
  ------------------
  |  Branch (316:28): [True: 1.09k, False: 1.66k]
  ------------------
  317|  2.75k|                           ptr_dmx_re_prev, pstr_usac_data->ptr_dmx_im[chn],
  318|  2.75k|                           pstr_usac_config->window_sequence[left],
  319|  2.75k|                           pstr_sfb_prms->window_shape[left],
  320|  2.75k|                           pstr_usac_config->window_shape_prev[left], num_sbk, bins_per_sbk);
  321|       |
  322|       |    /* MCLT of downmix = dmx_re + j*dmx_im */
  323|       |    /*  Save MDCT down-mix for use as previous frame MDCT down-mix in the next frame */
  324|  2.75k|    iusace_usac_cplx_save_prev(*pred_dir == 0 ? &ptr_spec_mdct_mid[0] : &ptr_spec_mdct_side[0],
  ------------------
  |  Branch (324:32): [True: 1.09k, False: 1.66k]
  ------------------
  325|  2.75k|                               pstr_usac_data->ptr_dmx_re_save[chn], save_zeros, condition_2,
  326|  2.75k|                               samp_per_bk, bins_per_sbk);
  327|  2.75k|  }
  328|       |
  329|       |  /* Reset buffer to zero */
  330|   285k|  for (group = 0; group < MAX_SHORT_WINDOWS; group++) {
  ------------------
  |  |   52|   285k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (330:19): [True: 253k, False: 31.7k]
  ------------------
  331|   253k|    memset(pred_coef_q_int_re, 0, MAX_SFB_LONG * sizeof(WORD32));
  ------------------
  |  |   53|   253k|#define MAX_SFB_LONG 51
  ------------------
  332|   253k|    memset(pred_coef_q_int_im, 0, MAX_SFB_LONG * sizeof(WORD32));
  ------------------
  |  |   53|   253k|#define MAX_SFB_LONG 51
  ------------------
  333|   253k|  }
  334|       |
  335|  31.7k|  group = 0;
  336|   112k|  for (sfb = 0; sfb < sfb_count; sfb += sfb_per_group, group++) {
  ------------------
  |  Branch (336:17): [True: 80.7k, False: 31.7k]
  ------------------
  337|   820k|    for (sfb_offsets = 0; sfb_offsets < sfb_per_group; sfb_offsets += sfb_per_pred_band) {
  ------------------
  |  Branch (337:27): [True: 740k, False: 80.7k]
  ------------------
  338|   740k|      if (cplx_pred_used[group][sfb_offsets] == 1) {
  ------------------
  |  Branch (338:11): [True: 740k, False: 0]
  ------------------
  339|   740k|        zero_flag = (ptr_sfb_offsets[sfb + sfb_offsets + 1] != FRAME_LEN_LONG);
  ------------------
  |  |   54|   740k|#define FRAME_LEN_LONG 1024
  ------------------
  340|   740k|        spec_start = ptr_sfb_offsets[sfb + sfb_offsets];
  341|   740k|        spec_end = (zero_flag ? ptr_sfb_offsets[sfb + sfb_offsets + 2]
  ------------------
  |  Branch (341:21): [True: 732k, False: 7.74k]
  ------------------
  342|   740k|                              : ptr_sfb_offsets[sfb + sfb_offsets + 1]);
  343|       |
  344|       |        /* Calculate prediction coefficients */
  345|   740k|        iusace_compute_pred_coef(
  346|   740k|            spec_end - spec_start, pstr_usac_data->complex_coef[chn],
  347|   740k|            *pred_dir == 0 ? &ptr_spec_mdct_mid[spec_start] : &ptr_spec_mdct_side[spec_start],
  ------------------
  |  Branch (347:13): [True: 313k, False: 426k]
  ------------------
  348|   740k|            pstr_usac_data->complex_coef[chn] == 1 ? &pstr_usac_data->ptr_dmx_im[chn][spec_start]
  ------------------
  |  Branch (348:13): [True: 67.4k, False: 672k]
  ------------------
  349|   740k|                                                   : NULL,
  350|   740k|            *pred_dir == 0 ? &ptr_spec_mdct_side[spec_start] : &ptr_spec_mdct_mid[spec_start],
  ------------------
  |  Branch (350:13): [True: 313k, False: 426k]
  ------------------
  351|   740k|            &pred_coef_re, pstr_usac_data->complex_coef[chn] == 1 ? &pred_coef_im : NULL,
  ------------------
  |  Branch (351:28): [True: 67.4k, False: 672k]
  ------------------
  352|   740k|            &pred_coef_q_re, pstr_usac_data->complex_coef[chn] == 1 ? &pred_coef_q_im : NULL,
  ------------------
  |  Branch (352:30): [True: 67.4k, False: 672k]
  ------------------
  353|   740k|            &pred_coef_q_int_re[group][sfb_offsets],
  354|   740k|            pstr_usac_data->complex_coef[chn] == 1 ? &pred_coef_q_int_im[group][sfb_offsets]
  ------------------
  |  Branch (354:13): [True: 67.4k, False: 672k]
  ------------------
  355|   740k|                                                   : NULL);
  356|       |
  357|       |        /* Calculate residual */
  358|   740k|        iusace_compute_res(
  359|   740k|            spec_end - spec_start, pstr_usac_data->complex_coef[chn], pred_coef_q_re,
  360|   740k|            pstr_usac_data->complex_coef[chn] == 1 ? pred_coef_q_im : 0,
  ------------------
  |  Branch (360:13): [True: 67.4k, False: 672k]
  ------------------
  361|   740k|            *pred_dir == 0 ? &ptr_spec_mdct_mid[spec_start] : &ptr_spec_mdct_side[spec_start],
  ------------------
  |  Branch (361:13): [True: 313k, False: 426k]
  ------------------
  362|   740k|            pstr_usac_data->complex_coef[chn] == 1 ? &pstr_usac_data->ptr_dmx_im[chn][spec_start]
  ------------------
  |  Branch (362:13): [True: 67.4k, False: 672k]
  ------------------
  363|   740k|                                                   : NULL,
  364|   740k|            *pred_dir == 0 ? &ptr_spec_mdct_side[spec_start] : &ptr_spec_mdct_mid[spec_start],
  ------------------
  |  Branch (364:13): [True: 313k, False: 426k]
  ------------------
  365|   740k|            &ptr_spec_mdct_res[spec_start]);
  366|   740k|      }
  367|   740k|    }
  368|  80.7k|  }
  369|       |
  370|       |  /* Compute the prediction gain */
  371|  31.7k|  FLOAT32 pred_gain = 0.f, nrg_res = 0.f;
  372|  27.3M|  for (i = 0; i < pstr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (372:15): [True: 27.3M, False: 31.7k]
  ------------------
  373|  27.3M|    nrg_res += (FLOAT32)(ptr_spec_mdct_res[i] * ptr_spec_mdct_res[i]);
  374|  27.3M|  }
  375|  31.7k|  pred_gain = 10.f * log10f(ixheaace_div32((*pred_dir == 0 ? nrg_side : nrg_mid), nrg_res));
  ------------------
  |  Branch (375:45): [True: 12.8k, False: 18.8k]
  ------------------
  376|       |      /* Prediction gain in dB */
  377|       |
  378|  31.7k|  if (pred_gain > 20.f) /* Retain complex prediction */
  ------------------
  |  Branch (378:7): [True: 16.2k, False: 15.4k]
  ------------------
  379|  16.2k|  {
  380|  16.2k|    if (*pred_dir == 1) {
  ------------------
  |  Branch (380:9): [True: 14.4k, False: 1.82k]
  ------------------
  381|  11.7M|      for (i = 0; i < pstr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (381:19): [True: 11.6M, False: 14.4k]
  ------------------
  382|  11.6M|        ptr_spec_mdct_mid[i] = ptr_spec_mdct_side[i];
  383|  11.6M|        ptr_spec_mdct_side[i] = ptr_spec_mdct_res[i];
  384|  11.6M|      }
  385|  14.4k|    } else {
  386|  1.67M|      for (i = 0; i < pstr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (386:19): [True: 1.67M, False: 1.82k]
  ------------------
  387|  1.67M|        ptr_spec_mdct_side[i] = ptr_spec_mdct_res[i];
  388|  1.67M|      }
  389|  1.82k|    }
  390|  16.2k|  } else /* Use M/S */
  391|  15.4k|  {
  392|  15.4k|    *ms_mask_flag = 0;
  393|       |    /* Revert spectra to L and R */
  394|  14.0M|    for (i = 0; i < pstr_usac_config->ccfl; i++) {
  ------------------
  |  Branch (394:17): [True: 13.9M, False: 15.4k]
  ------------------
  395|  13.9M|      ptr_spec_mdct_mid[i] = pstr_usac_data->left_chan_save[chn][i];
  396|  13.9M|      ptr_spec_mdct_side[i] = pstr_usac_data->right_chan_save[chn][i];
  397|  13.9M|    }
  398|  15.4k|  }
  399|       |
  400|  31.7k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  31.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  401|  31.7k|}
ixheaace_cplx_pred.c:iusace_estimate_dmx_im:
  177|  2.75k|                                   WORD32 bins_per_sbk) {
  178|  2.75k|  LOOPIDX i;
  179|  2.75k|  const FLOAT64 *ptr_mdst_fcoeff_curr, *ptr_mdst_fcoeff_prev;
  180|       |
  181|  2.75k|  switch (window) {
  182|    532|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|    532|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (182:5): [True: 532, False: 2.22k]
  ------------------
  183|  2.39k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|  2.39k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (183:5): [True: 1.86k, False: 888]
  ------------------
  184|  2.39k|      ptr_mdst_fcoeff_curr = iusace_mdst_fcoeff_longshort_curr[prev_w_shape][w_shape];
  185|  2.39k|      ptr_mdst_fcoeff_prev = iusace_mdst_fcoeff_l_s_start_left_prev[prev_w_shape];
  186|  2.39k|      break;
  187|    140|    case LONG_START_SEQUENCE:
  ------------------
  |  |   46|    140|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (187:5): [True: 140, False: 2.61k]
  ------------------
  188|    140|      ptr_mdst_fcoeff_curr = iusace_mdst_fcoeff_start_curr[prev_w_shape][w_shape];
  189|    140|      ptr_mdst_fcoeff_prev = iusace_mdst_fcoeff_l_s_start_left_prev[prev_w_shape];
  190|    140|      break;
  191|    216|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|    216|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (191:5): [True: 216, False: 2.53k]
  ------------------
  192|    216|      ptr_mdst_fcoeff_curr = iusace_mdst_fcoeff_stop_cur[prev_w_shape][w_shape];
  193|    216|      ptr_mdst_fcoeff_prev = iusace_mdst_fcoeff_stop_stopstart_left_prev[prev_w_shape];
  194|    216|      break;
  195|      0|    case STOP_START_SEQUENCE:
  ------------------
  |  |   49|      0|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (195:5): [True: 0, False: 2.75k]
  ------------------
  196|      0|      ptr_mdst_fcoeff_curr = iusace_mdst_fcoeff_stopstart_cur[prev_w_shape][w_shape];
  197|      0|      ptr_mdst_fcoeff_prev = iusace_mdst_fcoeff_stop_stopstart_left_prev[prev_w_shape];
  198|      0|      break;
  199|      0|    default:
  ------------------
  |  Branch (199:5): [True: 0, False: 2.75k]
  ------------------
  200|      0|      ptr_mdst_fcoeff_curr = iusace_mdst_fcoeff_stopstart_cur[prev_w_shape][w_shape];
  201|      0|      ptr_mdst_fcoeff_prev = iusace_mdst_fcoeff_stop_stopstart_left_prev[prev_w_shape];
  202|      0|      break;
  203|  2.75k|  }
  204|       |
  205|  18.5k|  for (i = 0; i < num_sbk; i++) {
  ------------------
  |  Branch (205:15): [True: 15.8k, False: 2.75k]
  ------------------
  206|  15.8k|    iusace_filter_and_add(ptr_dmx_re, bins_per_sbk, ptr_mdst_fcoeff_curr, ptr_dmx_im, 1);
  207|       |
  208|  15.8k|    if (ptr_dmx_re_prev) {
  ------------------
  |  Branch (208:9): [True: 15.6k, False: 161]
  ------------------
  209|  15.6k|      iusace_filter_and_add(ptr_dmx_re_prev, bins_per_sbk, ptr_mdst_fcoeff_prev, ptr_dmx_im, -1);
  210|  15.6k|    }
  211|       |
  212|  15.8k|    ptr_dmx_re_prev = ptr_dmx_re;
  213|  15.8k|    ptr_dmx_re += bins_per_sbk;
  214|  15.8k|    ptr_dmx_im += bins_per_sbk;
  215|  15.8k|  }
  216|  2.75k|  return;
  217|  2.75k|}
ixheaace_cplx_pred.c:iusace_filter_and_add:
  124|  31.4k|                                  const WORD32 factor_even) {
  125|  31.4k|  LOOPIDX i;
  126|  31.4k|  FLOAT64 s;
  127|       |
  128|  31.4k|  i = 0;
  129|  31.4k|  s = ptr_filter[6] * ptr_in[2] + ptr_filter[5] * ptr_in[1] + ptr_filter[4] * ptr_in[0] +
  130|  31.4k|      ptr_filter[3] * ptr_in[0] + ptr_filter[2] * ptr_in[1] + ptr_filter[1] * ptr_in[2] +
  131|  31.4k|      ptr_filter[0] * ptr_in[3];
  132|  31.4k|  ptr_out[i] += s * factor_even;
  133|  31.4k|  i = 1;
  134|  31.4k|  s = ptr_filter[6] * ptr_in[1] + ptr_filter[5] * ptr_in[0] + ptr_filter[4] * ptr_in[0] +
  135|  31.4k|      ptr_filter[3] * ptr_in[1] + ptr_filter[2] * ptr_in[2] + ptr_filter[1] * ptr_in[3] +
  136|  31.4k|      ptr_filter[0] * ptr_in[4];
  137|  31.4k|  ptr_out[i] += s;
  138|  31.4k|  i = 2;
  139|  31.4k|  s = ptr_filter[6] * ptr_in[0] + ptr_filter[5] * ptr_in[0] + ptr_filter[4] * ptr_in[1] +
  140|  31.4k|      ptr_filter[3] * ptr_in[2] + ptr_filter[2] * ptr_in[3] + ptr_filter[1] * ptr_in[4] +
  141|  31.4k|      ptr_filter[0] * ptr_in[5];
  142|  31.4k|  ptr_out[i] += s * factor_even;
  143|       |
  144|  2.32M|  for (i = 3; i < length - 4; i += 2) {
  ------------------
  |  Branch (144:15): [True: 2.29M, False: 31.4k]
  ------------------
  145|  2.29M|    s = ptr_filter[6] * ptr_in[i - 3] + ptr_filter[5] * ptr_in[i - 2] +
  146|  2.29M|        ptr_filter[4] * ptr_in[i - 1] + ptr_filter[3] * ptr_in[i] +
  147|  2.29M|        ptr_filter[2] * ptr_in[i + 1] + ptr_filter[1] * ptr_in[i + 2] +
  148|  2.29M|        ptr_filter[0] * ptr_in[i + 3];
  149|  2.29M|    ptr_out[i] += s;
  150|  2.29M|    s = ptr_filter[6] * ptr_in[i - 2] + ptr_filter[5] * ptr_in[i - 1] +
  151|  2.29M|        ptr_filter[4] * ptr_in[i] + ptr_filter[3] * ptr_in[i + 1] +
  152|  2.29M|        ptr_filter[2] * ptr_in[i + 2] + ptr_filter[1] * ptr_in[i + 3] +
  153|  2.29M|        ptr_filter[0] * ptr_in[i + 4];
  154|  2.29M|    ptr_out[i + 1] += s * factor_even;
  155|  2.29M|  }
  156|       |
  157|  31.4k|  i = length - 3;
  158|  31.4k|  s = ptr_filter[6] * ptr_in[i - 3] + ptr_filter[5] * ptr_in[i - 2] +
  159|  31.4k|      ptr_filter[4] * ptr_in[i - 1] + ptr_filter[3] * ptr_in[i] + ptr_filter[2] * ptr_in[i + 1] +
  160|  31.4k|      ptr_filter[1] * ptr_in[i + 2] + ptr_filter[0] * ptr_in[i + 2];
  161|  31.4k|  ptr_out[i] += s;
  162|  31.4k|  i = length - 2;
  163|  31.4k|  s = ptr_filter[6] * ptr_in[i - 3] + ptr_filter[5] * ptr_in[i - 2] +
  164|  31.4k|      ptr_filter[4] * ptr_in[i - 1] + ptr_filter[3] * ptr_in[i] + ptr_filter[2] * ptr_in[i + 1] +
  165|  31.4k|      ptr_filter[1] * ptr_in[i + 1] + ptr_filter[0] * ptr_in[i];
  166|  31.4k|  ptr_out[i] += s * factor_even;
  167|  31.4k|  i = length - 1;
  168|  31.4k|  s = ptr_filter[6] * ptr_in[i - 3] + ptr_filter[5] * ptr_in[i - 2] +
  169|  31.4k|      ptr_filter[4] * ptr_in[i - 1] + ptr_filter[3] * ptr_in[i] + ptr_filter[2] * ptr_in[i] +
  170|  31.4k|      ptr_filter[1] * ptr_in[i - 1] + ptr_filter[0] * ptr_in[i - 2];
  171|  31.4k|  ptr_out[i] += s;
  172|  31.4k|}
ixheaace_cplx_pred.c:iusace_usac_cplx_save_prev:
  221|  2.75k|                                       WORD32 bins_per_sbk) {
  222|  2.75k|  WORD32 offset;
  223|       |
  224|  2.75k|  offset = samp_per_bk - bins_per_sbk;
  225|       |
  226|  2.75k|  if (save_zeros || condition_2) {
  ------------------
  |  Branch (226:7): [True: 0, False: 2.75k]
  |  Branch (226:21): [True: 171, False: 2.58k]
  ------------------
  227|    171|    memset(ptr_mdct_spec_prev + offset, 0, sizeof(FLOAT64) * bins_per_sbk);
  228|  2.58k|  } else {
  229|  2.58k|    memcpy(ptr_mdct_spec_prev + offset, ptr_mdct_spec + offset, sizeof(FLOAT64) * bins_per_sbk);
  230|  2.58k|  }
  231|  2.75k|  return;
  232|  2.75k|}
ixheaace_cplx_pred.c:iusace_compute_pred_coef:
   61|   740k|                                     WORD32 *pred_coef_q_int_im) {
   62|   740k|  LOOPIDX bin_idx;
   63|   740k|  FLOAT32 iprod_re = 0.0f, iprod_im = 0.0f;
   64|   740k|  FLOAT32 eps = 1.0e-6f;
   65|   740k|  const FLOAT32 k_delta = 0.1f;
   66|   740k|  const FLOAT32 k_max = 3.0f;
   67|   740k|  WORD32 pred_coef_sign_re, pred_coef_sign_im;
   68|   740k|  FLOAT32 pred_coef_abs_re, pred_coef_abs_im;
   69|   740k|  FLOAT32 abs_dmx = 0.0f;
   70|       |
   71|  27.5M|  for (bin_idx = 0; bin_idx < num_lines; bin_idx++) {
  ------------------
  |  Branch (71:21): [True: 26.7M, False: 740k]
  ------------------
   72|       |    /* D = Dr + jDi */
   73|       |    /* D*S = (Dr + jDi)*S = Dr*S + j(Di*S) */
   74|       |    /* alpha = alpha_r - jalpha_i */
   75|  26.7M|    if (complex_coef == 1) {
  ------------------
  |  Branch (75:9): [True: 2.39M, False: 24.3M]
  ------------------
   76|  2.39M|      iprod_re += (FLOAT32)(ptr_spec_mdct_dmx[bin_idx] * ptr_spec_mdct_mid_side[bin_idx]);
   77|  2.39M|      iprod_im += (FLOAT32)(ptr_spec_mdst_dmx[bin_idx] * ptr_spec_mdct_mid_side[bin_idx]);
   78|  2.39M|      abs_dmx += (FLOAT32)(ptr_spec_mdct_dmx[bin_idx] * ptr_spec_mdct_dmx[bin_idx] +
   79|  2.39M|                           ptr_spec_mdst_dmx[bin_idx] * ptr_spec_mdst_dmx[bin_idx]);
   80|  24.3M|    } else {
   81|  24.3M|      iprod_re += (FLOAT32)(ptr_spec_mdct_dmx[bin_idx] * ptr_spec_mdct_mid_side[bin_idx]);
   82|  24.3M|      abs_dmx += (FLOAT32)(ptr_spec_mdct_dmx[bin_idx] * ptr_spec_mdct_dmx[bin_idx]);
   83|  24.3M|    }
   84|  26.7M|  }
   85|       |
   86|       |  /* Compute real and imaginary parts of prediction coefficient  */
   87|   740k|  *pred_coef_re = iprod_re / (abs_dmx + eps);
   88|   740k|  pred_coef_sign_re = *pred_coef_re > 0 ? 1 : -1;
  ------------------
  |  Branch (88:23): [True: 307k, False: 433k]
  ------------------
   89|   740k|  pred_coef_abs_re = (FLOAT32)MIN(fabs(*pred_coef_re), k_max);
  ------------------
  |  |   86|   740k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 733k, False: 6.24k]
  |  |  ------------------
  ------------------
   90|   740k|  *pred_coef_q_int_re = pred_coef_sign_re * (WORD32)(pred_coef_abs_re / k_delta + 0.5f);
   91|   740k|  *pred_coef_q_re = *pred_coef_q_int_re * k_delta;
   92|       |
   93|   740k|  if (complex_coef == 1) {
  ------------------
  |  Branch (93:7): [True: 67.4k, False: 672k]
  ------------------
   94|  67.4k|    *pred_coef_im = iprod_im / (abs_dmx + eps);
   95|  67.4k|    pred_coef_sign_im = *pred_coef_im > 0 ? 1 : -1;
  ------------------
  |  Branch (95:25): [True: 23.0k, False: 44.3k]
  ------------------
   96|  67.4k|    pred_coef_abs_im = (FLOAT32)MIN(fabs(*pred_coef_im), k_max);
  ------------------
  |  |   86|  67.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 66.2k, False: 1.15k]
  |  |  ------------------
  ------------------
   97|  67.4k|    *pred_coef_q_int_im = pred_coef_sign_im * (WORD32)(pred_coef_abs_im / k_delta + 0.5f);
   98|  67.4k|    *pred_coef_q_im = *pred_coef_q_int_im * k_delta;
   99|  67.4k|  }
  100|   740k|}
ixheaace_cplx_pred.c:iusace_compute_res:
  105|   740k|                               FLOAT64 *ptr_spec_mdct_res) {
  106|   740k|  LOOPIDX i;
  107|       |
  108|  27.5M|  for (i = 0; i < num_lines; i++) {
  ------------------
  |  Branch (108:15): [True: 26.7M, False: 740k]
  ------------------
  109|       |    /* DMX = M; E = S - alpha*DMX if pred_dir = 0 */
  110|       |    /* DMX = S; E = M - alpha*DMX if pred_dir = 1 */
  111|  26.7M|    if (complex_coef == 1) {
  ------------------
  |  Branch (111:9): [True: 2.39M, False: 24.3M]
  ------------------
  112|  2.39M|      ptr_spec_mdct_res[i] =
  113|  2.39M|          (FLOAT32)(ptr_spec_mdct_mid_side[i] - pred_coef_q_re * ptr_spec_mdct_dmx[i] -
  114|  2.39M|                    pred_coef_q_im * ptr_spec_mdst_dmx[i]);
  115|  24.3M|    } else {
  116|  24.3M|      ptr_spec_mdct_res[i] =
  117|  24.3M|          (FLOAT32)(ptr_spec_mdct_mid_side[i] - pred_coef_q_re * ptr_spec_mdct_dmx[i]);
  118|  24.3M|    }
  119|  26.7M|  }
  120|   740k|}

ia_enhaacplus_enc_dyn_bitcount:
  550|   475k|    WORD32 *ptr_scratch_buf, WORD32 aot, WORD32 *bit_cnt) {
  551|   475k|  IA_ERRORCODE err_code;
  552|   475k|  WORD32(*ptr_bit_look_up)
  553|   475k|  [CODE_BCK_ESC_NDX + 1] = (WORD32(*)[CODE_BCK_ESC_NDX + 1]) ptr_scratch_buf;
  554|   475k|  WORD32 *ptr_merge_gain_look_up =
  555|   475k|      ptr_scratch_buf + MAXIMUM_SCALE_FACTOR_BAND_LONG * (CODE_BCK_ESC_NDX + 1);
  ------------------
  |  |   65|   475k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  ------------------
  556|   475k|  *bit_cnt = 0;
  557|   475k|  pstr_section_data->block_type = block_type;
  558|   475k|  pstr_section_data->sfb_cnt = sfb_cnt;
  559|   475k|  pstr_section_data->sfb_per_group = sfb_per_grp;
  560|       |
  561|   475k|  pstr_section_data->total_groups_cnt = sfb_cnt / sfb_per_grp;
  562|       |
  563|   475k|  pstr_section_data->max_sfb_per_grp = max_sfb_per_grp;
  564|       |
  565|   475k|  err_code = ia_enhaacplus_enc_noiseless_counter(
  566|   475k|      pstr_section_data, ptr_merge_gain_look_up, ptr_bit_look_up, ptr_quant_spec,
  567|   475k|      ptr_max_val_in_sfb, ptr_sfb_offset, block_type, ptr_side_info_tab_long,
  568|   475k|      ptr_side_info_tab_short, ptr_huffman_tbl, aot);
  569|       |
  570|   475k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   475k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (570:7): [True: 0, False: 475k]
  ------------------
  571|      0|    return err_code;
  572|      0|  }
  573|       |
  574|   475k|  err_code = ia_enhaacplus_enc_scf_count(ptr_scale_fac, ptr_max_val_in_sfb, pstr_section_data,
  575|   475k|                                         ptr_huffman_tbl);
  576|       |
  577|   475k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   475k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (577:7): [True: 0, False: 475k]
  ------------------
  578|      0|    return err_code;
  579|      0|  }
  580|       |
  581|   475k|  *bit_cnt = (pstr_section_data->huffman_bits + pstr_section_data->side_info_bits +
  582|   475k|              pstr_section_data->scale_fac_bits);
  583|   475k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   475k|#define IA_NO_ERROR 0x00000000
  ------------------
  584|   475k|}
ia_enhaacplus_enc_bitcount_init:
  586|  4.74k|VOID ia_enhaacplus_enc_bitcount_init(WORD32 *side_info_tab_long, WORD32 *side_info_tab_short) {
  587|  4.74k|  WORD32 i;
  588|       |
  589|       |  /* side_info_tab_long[] */
  590|   251k|  for (i = 0; i <= MAXIMUM_SCALE_FACTOR_BAND_LONG; i++) {
  ------------------
  |  |   65|   251k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  ------------------
  |  Branch (590:15): [True: 246k, False: 4.74k]
  ------------------
  591|   246k|    side_info_tab_long[i] = ia_enhaacplus_enc_calc_side_info_bits(i, LONG_WINDOW);
  592|   246k|  }
  593|       |
  594|       |  /* side_info_tab_short[] */
  595|  80.6k|  for (i = 0; i <= MAXIMUM_SCALE_FACTOR_BAND_SHORT; i++) {
  ------------------
  |  |   64|  80.6k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  ------------------
  |  Branch (595:15): [True: 75.8k, False: 4.74k]
  ------------------
  596|  75.8k|    side_info_tab_short[i] = ia_enhaacplus_enc_calc_side_info_bits(i, SHORT_WINDOW);
  597|  75.8k|  }
  598|  4.74k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_noiseless_counter:
  352|   475k|    ixheaace_huffman_tables *pstr_huffman_tbl, WORD32 aot) {
  353|   475k|  WORD32 grp_idx;
  354|   475k|  WORD32 *ptr_side_info_tab = 0;
  355|   475k|  ixheaace_section_info *pstr_section_info;
  356|   475k|  WORD32 i;
  357|       |
  358|  24.7M|  for (i = 0; i < MAXIMUM_SCALE_FACTOR_BAND_LONG; i++) {
  ------------------
  |  |   65|  24.7M|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  ------------------
  |  Branch (358:15): [True: 24.2M, False: 475k]
  ------------------
  359|  24.2M|    memset(bit_look_up[i], 0, (CODE_BCK_ESC_NDX + 1) * sizeof(bit_look_up[0][0]));
  360|  24.2M|  }
  361|       |
  362|       |  /* counting previous operations */
  363|   475k|  switch (block_type) {
  364|   342k|    case LONG_WINDOW:
  ------------------
  |  Branch (364:5): [True: 342k, False: 133k]
  ------------------
  365|   363k|    case START_WINDOW:
  ------------------
  |  Branch (365:5): [True: 20.8k, False: 454k]
  ------------------
  366|   381k|    case STOP_WINDOW:
  ------------------
  |  Branch (366:5): [True: 18.7k, False: 456k]
  ------------------
  367|       |
  368|   381k|      ptr_side_info_tab = ptr_side_info_tab_long;
  369|   381k|      break;
  370|  93.9k|    case SHORT_WINDOW:
  ------------------
  |  Branch (370:5): [True: 93.9k, False: 381k]
  ------------------
  371|       |
  372|  93.9k|      ptr_side_info_tab = ptr_side_info_tab_short;
  373|  93.9k|      break;
  374|      0|    default:
  ------------------
  |  Branch (374:5): [True: 0, False: 475k]
  ------------------
  375|      0|      return IA_EXHEAACE_EXE_FATAL_INVALID_BLOCK_TYPE;
  376|   475k|  }
  377|       |
  378|   475k|  pstr_section_data->num_of_sections = 0;
  379|   475k|  pstr_section_data->huffman_bits = 0;
  380|   475k|  pstr_section_data->side_info_bits = 0;
  381|       |
  382|   475k|  if (pstr_section_data->max_sfb_per_grp == 0) {
  ------------------
  |  Branch (382:7): [True: 75.1k, False: 400k]
  ------------------
  383|  75.1k|    return IA_NO_ERROR;
  ------------------
  |  |   23|  75.1k|#define IA_NO_ERROR 0x00000000
  ------------------
  384|  75.1k|  }
  385|       |
  386|  1.07M|  for (grp_idx = 0; grp_idx < pstr_section_data->sfb_cnt;
  ------------------
  |  Branch (386:21): [True: 671k, False: 400k]
  ------------------
  387|   671k|       grp_idx += pstr_section_data->sfb_per_group) {
  388|   671k|    pstr_section_info = pstr_section_data->section + pstr_section_data->num_of_sections;
  389|       |
  390|   671k|    ia_enhaacplus_enc_build_bit_look_up(ptr_quant_spec, pstr_section_data->max_sfb_per_grp,
  391|   671k|                                        ptr_sfb_offset + grp_idx, ptr_max_val_in_sfb + grp_idx,
  392|   671k|                                        bit_look_up, pstr_section_info, pstr_huffman_tbl, aot);
  393|       |
  394|   671k|    ia_enhaacplus_enc_gm_stage0(pstr_section_info, bit_look_up,
  395|   671k|                                pstr_section_data->max_sfb_per_grp, aot);
  396|       |
  397|   671k|    ia_enhaacplus_enc_gm_stage1(pstr_section_info, bit_look_up,
  398|   671k|                                pstr_section_data->max_sfb_per_grp, ptr_side_info_tab, aot);
  399|       |
  400|   671k|    ia_enhaacplus_enc_gm_stage2(pstr_section_info, merge_gain_look_up, bit_look_up,
  401|   671k|                                pstr_section_data->max_sfb_per_grp, ptr_side_info_tab, aot);
  402|       |
  403|  2.49M|    for (i = 0; i < pstr_section_data->max_sfb_per_grp; i += pstr_section_info[i].sfb_cnt) {
  ------------------
  |  Branch (403:17): [True: 1.82M, False: 671k]
  ------------------
  404|  1.82M|      ia_enhaacplus_enc_find_best_book(bit_look_up[i], &(pstr_section_info[i].code_book), aot);
  405|       |
  406|  1.82M|      pstr_section_info[i].sfb_start += (WORD8)grp_idx;
  407|       |
  408|  1.82M|      pstr_section_data->huffman_bits +=
  409|  1.82M|          pstr_section_info[i].section_bits - ptr_side_info_tab[pstr_section_info[i].sfb_cnt];
  410|       |
  411|  1.82M|      pstr_section_data->side_info_bits += ptr_side_info_tab[pstr_section_info[i].sfb_cnt];
  412|       |
  413|  1.82M|      pstr_section_data->section[pstr_section_data->num_of_sections++] = pstr_section_info[i];
  414|  1.82M|    }
  415|   671k|  }
  416|   400k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   400k|#define IA_NO_ERROR 0x00000000
  ------------------
  417|   475k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_build_bit_look_up:
   73|   671k|    WORD32 aot) {
   74|   671k|  WORD8 i;
   75|       |
   76|  14.0M|  for (i = 0; i < max_sfb; i++) {
  ------------------
  |  Branch (76:15): [True: 13.4M, False: 671k]
  ------------------
   77|  13.4M|    WORD32 sfb_width, max_val;
   78|       |
   79|  13.4M|    pstr_section_info[i].sfb_cnt = 1;
   80|  13.4M|    pstr_section_info[i].sfb_start = i;
   81|       |
   82|  13.4M|    switch (aot) {
  ------------------
  |  Branch (82:13): [True: 13.4M, False: 0]
  ------------------
   83|  3.02M|      case AOT_AAC_LC:
  ------------------
  |  |   34|  3.02M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (83:7): [True: 3.02M, False: 10.3M]
  ------------------
   84|  9.69M|      case AOT_SBR:
  ------------------
  |  |   35|  9.69M|#define AOT_SBR (5)
  ------------------
  |  Branch (84:7): [True: 6.67M, False: 6.73M]
  ------------------
   85|  10.4M|      case AOT_PS:
  ------------------
  |  |   39|  10.4M|#define AOT_PS (29)
  ------------------
  |  Branch (85:7): [True: 763k, False: 12.6M]
  ------------------
   86|  10.4M|        pstr_section_info[i].section_bits = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  10.4M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
   87|  10.4M|        break;
   88|       |
   89|   731k|      case AOT_AAC_LD:
  ------------------
  |  |   36|   731k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (89:7): [True: 731k, False: 12.6M]
  ------------------
   90|  2.95M|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  2.95M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (90:7): [True: 2.21M, False: 11.1M]
  ------------------
   91|  2.95M|        pstr_section_info[i].section_bits = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  2.95M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
   92|  2.95M|        break;
   93|  13.4M|    }
   94|       |
   95|  13.4M|    pstr_section_info[i].code_book = -1;
   96|       |
   97|  13.4M|    sfb_width = ptr_sfb_offset[i + 1] - ptr_sfb_offset[i];
   98|       |
   99|  13.4M|    max_val = sfb_max[i];
  100|       |
  101|  13.4M|    ia_enhaacplus_enc_bitcount(ptr_quant_spec + ptr_sfb_offset[i], sfb_width, max_val,
  102|  13.4M|                               bit_look_up[i], pstr_huffman_tbl, aot);
  103|  13.4M|  }
  104|   671k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_gm_stage0:
  241|   671k|    const WORD32 max_sfb, WORD32 aot) {
  242|   671k|  WORD32 i = 0;
  243|   671k|  WORD32 invalid_bitcnt = 0;
  244|       |
  245|   671k|  switch (aot) {
  ------------------
  |  Branch (245:11): [True: 671k, False: 0]
  ------------------
  246|   160k|    case AOT_AAC_LC:
  ------------------
  |  |   34|   160k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (246:5): [True: 160k, False: 510k]
  ------------------
  247|   496k|    case AOT_SBR:
  ------------------
  |  |   35|   496k|#define AOT_SBR (5)
  ------------------
  |  Branch (247:5): [True: 335k, False: 335k]
  ------------------
  248|   540k|    case AOT_PS:
  ------------------
  |  |   39|   540k|#define AOT_PS (29)
  ------------------
  |  Branch (248:5): [True: 44.1k, False: 627k]
  ------------------
  249|   540k|      invalid_bitcnt = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|   540k|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  250|   540k|      break;
  251|       |
  252|  34.4k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  34.4k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (252:5): [True: 34.4k, False: 637k]
  ------------------
  253|   130k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|   130k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (253:5): [True: 96.3k, False: 575k]
  ------------------
  254|       |
  255|   130k|      invalid_bitcnt = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|   130k|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  256|   130k|      break;
  257|   671k|  }
  258|  14.0M|  while (i < max_sfb) {
  ------------------
  |  Branch (258:10): [True: 13.4M, False: 671k]
  ------------------
  259|  13.4M|    if (pstr_section[i].section_bits == invalid_bitcnt) {
  ------------------
  |  Branch (259:9): [True: 13.4M, False: 0]
  ------------------
  260|  13.4M|      pstr_section[i].section_bits = (WORD16)ia_enhaacplus_enc_find_best_book(
  261|  13.4M|          bit_look_up[i], &(pstr_section[i].code_book), aot);
  262|  13.4M|    }
  263|  13.4M|    i++;
  264|  13.4M|  }
  265|   671k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_gm_stage1:
  270|   671k|    const WORD32 max_sfb, const WORD32 *ptr_side_info_tab, WORD32 aot) {
  271|   671k|  WORD32 merge_start = 0, merge_end;
  272|       |
  273|  4.15M|  do {
  274|  13.4M|    for (merge_end = merge_start + 1; merge_end < max_sfb; merge_end++) {
  ------------------
  |  Branch (274:39): [True: 12.7M, False: 671k]
  ------------------
  275|  12.7M|      if (pstr_section_info[merge_start].code_book != pstr_section_info[merge_end].code_book) {
  ------------------
  |  Branch (275:11): [True: 3.48M, False: 9.25M]
  ------------------
  276|  3.48M|        break;
  277|  3.48M|      }
  278|       |
  279|  9.25M|      pstr_section_info[merge_start].sfb_cnt++;
  280|       |
  281|  9.25M|      pstr_section_info[merge_start].section_bits += pstr_section_info[merge_end].section_bits;
  282|       |
  283|  9.25M|      ia_enhaacplus_enc_merge_bit_look_up(bit_look_up[merge_start], bit_look_up[merge_end], aot);
  284|  9.25M|    }
  285|       |
  286|  4.15M|    pstr_section_info[merge_start].section_bits +=
  287|  4.15M|        (WORD16)ptr_side_info_tab[pstr_section_info[merge_start].sfb_cnt];
  288|       |
  289|  4.15M|    pstr_section_info[merge_end - 1].sfb_start = pstr_section_info[merge_start].sfb_start;
  290|       |
  291|  4.15M|    merge_start = merge_end;
  292|       |
  293|  4.15M|  } while (merge_start < max_sfb);
  ------------------
  |  Branch (293:12): [True: 3.48M, False: 671k]
  ------------------
  294|   671k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_merge_bit_look_up:
  177|  11.5M|                                                WORD32 aot) {
  178|  11.5M|  WORD32 j, temp1, temp2, temp3, temp4;
  179|  11.5M|  WORD32 invalid_bitcnt = 0;
  180|       |
  181|  11.5M|  switch (aot) {
  ------------------
  |  Branch (181:11): [True: 11.5M, False: 0]
  ------------------
  182|  2.64M|    case AOT_AAC_LC:
  ------------------
  |  |   34|  2.64M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (182:5): [True: 2.64M, False: 8.93M]
  ------------------
  183|  8.41M|    case AOT_SBR:
  ------------------
  |  |   35|  8.41M|#define AOT_SBR (5)
  ------------------
  |  Branch (183:5): [True: 5.76M, False: 5.81M]
  ------------------
  184|  8.97M|    case AOT_PS:
  ------------------
  |  |   39|  8.97M|#define AOT_PS (29)
  ------------------
  |  Branch (184:5): [True: 558k, False: 11.0M]
  ------------------
  185|  8.97M|      invalid_bitcnt = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  8.97M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  186|  8.97M|      break;
  187|       |
  188|   647k|    case AOT_AAC_LD:
  ------------------
  |  |   36|   647k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (188:5): [True: 647k, False: 10.9M]
  ------------------
  189|  2.61M|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  2.61M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (189:5): [True: 1.96M, False: 9.62M]
  ------------------
  190|  2.61M|      invalid_bitcnt = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  2.61M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  191|  2.61M|      break;
  192|  11.5M|  }
  193|  81.1M|  for (j = 0; j <= CODE_BCK_ESC_NDX; j += 2) {
  ------------------
  |  Branch (193:15): [True: 69.5M, False: 11.5M]
  ------------------
  194|  69.5M|    temp1 = ptr_bit_cnt1[j];
  195|  69.5M|    temp2 = ptr_bit_cnt2[j];
  196|  69.5M|    temp3 = ptr_bit_cnt1[j + 1];
  197|       |
  198|  69.5M|    ptr_bit_cnt1[j] = MIN(temp1 + temp2, invalid_bitcnt);
  ------------------
  |  |   23|  69.5M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 50.3M, False: 19.2M]
  |  |  ------------------
  ------------------
  199|  69.5M|    temp4 = ptr_bit_cnt2[j + 1];
  200|  69.5M|    ptr_bit_cnt1[j + 1] = MIN(temp3 + temp4, invalid_bitcnt);
  ------------------
  |  |   23|  69.5M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 56.4M, False: 13.1M]
  |  |  ------------------
  ------------------
  201|  69.5M|  }
  202|  11.5M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_gm_stage2:
  300|   671k|    const WORD32 max_sfb, const WORD32 *ptr_side_info_tab, WORD32 aot) {
  301|   671k|  WORD32 i;
  302|       |
  303|  4.15M|  for (i = 0; i + pstr_section_info[i].sfb_cnt < max_sfb; i += pstr_section_info[i].sfb_cnt) {
  ------------------
  |  Branch (303:15): [True: 3.48M, False: 671k]
  ------------------
  304|  3.48M|    merge_gain_look_up[i] =
  305|  3.48M|        ia_enhaacplus_enc_calc_merge_gain(pstr_section_info, bit_look_up, ptr_side_info_tab, i,
  306|  3.48M|                                          i + pstr_section_info[i].sfb_cnt, aot);
  307|  3.48M|  }
  308|       |
  309|  3.00M|  while (TRUE) {
  ------------------
  |  |   23|  3.00M|#define TRUE (1)
  |  |  ------------------
  |  |  |  Branch (23:14): [True: 3.00M, Folded]
  |  |  ------------------
  ------------------
  310|  3.00M|    WORD32 max_merge_gain = 0, max_idx = 0, max_idx_next = 0, max_idx_last = 0;
  311|       |
  312|  3.00M|    max_merge_gain = ia_enhaacplus_enc_find_max_merge(merge_gain_look_up, pstr_section_info,
  313|  3.00M|                                                      max_sfb, &max_idx);
  314|       |
  315|  3.00M|    if (max_merge_gain <= 0) {
  ------------------
  |  Branch (315:9): [True: 671k, False: 2.33M]
  ------------------
  316|   671k|      break;
  317|   671k|    }
  318|       |
  319|  2.33M|    max_idx_next = max_idx + pstr_section_info[max_idx].sfb_cnt;
  320|       |
  321|  2.33M|    pstr_section_info[max_idx].sfb_cnt += pstr_section_info[max_idx_next].sfb_cnt;
  322|       |
  323|  2.33M|    pstr_section_info[max_idx].section_bits +=
  324|  2.33M|        pstr_section_info[max_idx_next].section_bits - (WORD16)max_merge_gain;
  325|       |
  326|  2.33M|    ia_enhaacplus_enc_merge_bit_look_up(bit_look_up[max_idx], bit_look_up[max_idx_next], aot);
  327|       |
  328|  2.33M|    if (max_idx != 0) {
  ------------------
  |  Branch (328:9): [True: 1.94M, False: 388k]
  ------------------
  329|  1.94M|      max_idx_last = pstr_section_info[max_idx - 1].sfb_start;
  330|       |
  331|  1.94M|      merge_gain_look_up[max_idx_last] = ia_enhaacplus_enc_calc_merge_gain(
  332|  1.94M|          pstr_section_info, bit_look_up, ptr_side_info_tab, max_idx_last, max_idx, aot);
  333|  1.94M|    }
  334|       |
  335|  2.33M|    max_idx_next = max_idx + pstr_section_info[max_idx].sfb_cnt;
  336|       |
  337|  2.33M|    pstr_section_info[max_idx_next - 1].sfb_start = pstr_section_info[max_idx].sfb_start;
  338|       |
  339|  2.33M|    if (max_idx_next < max_sfb) {
  ------------------
  |  Branch (339:9): [True: 2.12M, False: 210k]
  ------------------
  340|  2.12M|      merge_gain_look_up[max_idx] = ia_enhaacplus_enc_calc_merge_gain(
  341|  2.12M|          pstr_section_info, bit_look_up, ptr_side_info_tab, max_idx, max_idx_next, aot);
  342|  2.12M|    }
  343|  2.33M|  }
  344|   671k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_calc_merge_gain:
  222|  7.56M|    const WORD32 *pstr_side_info_tab, const WORD32 idx1, const WORD32 idx2, WORD32 aot) {
  223|  7.56M|  WORD32 split_bits;
  224|  7.56M|  WORD32 merge_bits;
  225|  7.56M|  WORD32 merge_gain;
  226|       |
  227|  7.56M|  split_bits = pstr_section_info[idx1].section_bits + pstr_section_info[idx2].section_bits;
  228|       |
  229|  7.56M|  merge_bits =
  230|  7.56M|      pstr_side_info_tab[pstr_section_info[idx1].sfb_cnt + pstr_section_info[idx2].sfb_cnt] +
  231|  7.56M|      ia_enhaacplus_enc_find_min_merge_bits(bit_look_up[idx1], bit_look_up[idx2], aot);
  232|       |
  233|  7.56M|  merge_gain = split_bits - merge_bits;
  234|       |
  235|  7.56M|  return merge_gain;
  236|  7.56M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_find_min_merge_bits:
  143|  7.56M|                                                    const WORD32 *ptr_bit_cnt2, WORD32 aot) {
  144|  7.56M|  WORD32 min_bits = 0, j, temp1, temp2, temp3, temp4;
  145|       |
  146|  7.56M|  switch (aot) {
  ------------------
  |  Branch (146:11): [True: 7.56M, False: 0]
  ------------------
  147|  1.34M|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.34M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (147:5): [True: 1.34M, False: 6.21M]
  ------------------
  148|  5.22M|    case AOT_SBR:
  ------------------
  |  |   35|  5.22M|#define AOT_SBR (5)
  ------------------
  |  Branch (148:5): [True: 3.88M, False: 3.67M]
  ------------------
  149|  5.93M|    case AOT_PS:
  ------------------
  |  |   39|  5.93M|#define AOT_PS (29)
  ------------------
  |  Branch (149:5): [True: 706k, False: 6.85M]
  ------------------
  150|  5.93M|      min_bits = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  5.93M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  151|  5.93M|      break;
  152|       |
  153|   442k|    case AOT_AAC_LD:
  ------------------
  |  |   36|   442k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (153:5): [True: 442k, False: 7.11M]
  ------------------
  154|  1.62M|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.62M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (154:5): [True: 1.18M, False: 6.37M]
  ------------------
  155|  1.62M|      min_bits = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  1.62M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  156|  1.62M|      break;
  157|  7.56M|  }
  158|       |
  159|  52.9M|  for (j = CODE_BCK_ESC_NDX; j >= 0; j -= 2) {
  ------------------
  |  Branch (159:30): [True: 45.3M, False: 7.56M]
  ------------------
  160|  45.3M|    temp1 = *ptr_bit_cnt1++;
  161|  45.3M|    temp2 = *ptr_bit_cnt2++;
  162|  45.3M|    temp3 = *ptr_bit_cnt1++;
  163|       |
  164|  45.3M|    temp1 = temp1 + temp2;
  165|       |
  166|  45.3M|    min_bits = MIN(temp1, min_bits);
  ------------------
  |  |   23|  45.3M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 4.46M, False: 40.8M]
  |  |  ------------------
  ------------------
  167|  45.3M|    temp4 = *ptr_bit_cnt2++;
  168|  45.3M|    temp1 = temp3 + temp4;
  169|       |
  170|  45.3M|    min_bits = MIN(temp1, min_bits);
  ------------------
  |  |   23|  45.3M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.76M, False: 37.5M]
  |  |  ------------------
  ------------------
  171|  45.3M|  }
  172|       |
  173|  7.56M|  return min_bits;
  174|  7.56M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_find_max_merge:
  206|  3.00M|    const ixheaace_section_info *section, const WORD32 max_sfb, WORD32 *max_ndx) {
  207|  3.00M|  WORD32 i, max_merge_gain = 0;
  208|       |
  209|  23.1M|  for (i = 0; i + section[i].sfb_cnt < max_sfb; i += section[i].sfb_cnt) {
  ------------------
  |  Branch (209:15): [True: 20.1M, False: 3.00M]
  ------------------
  210|  20.1M|    if (merge_gain_look_up[i] > max_merge_gain) {
  ------------------
  |  Branch (210:9): [True: 4.38M, False: 15.7M]
  ------------------
  211|  4.38M|      max_merge_gain = merge_gain_look_up[i];
  212|  4.38M|      *max_ndx = i;
  213|  4.38M|    }
  214|  20.1M|  }
  215|       |
  216|  3.00M|  return (max_merge_gain);
  217|  3.00M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_find_best_book:
  107|  15.2M|                                               WORD32 aot) {
  108|  15.2M|  WORD32 min_bits = 0, temp1, temp2;
  109|  15.2M|  WORD8 temp_book = CODE_BCK_ESC_NDX;
  110|  15.2M|  WORD8 j;
  111|       |
  112|  15.2M|  switch (aot) {
  ------------------
  |  Branch (112:11): [True: 15.2M, False: 0]
  ------------------
  113|  3.40M|    case AOT_AAC_LC:
  ------------------
  |  |   34|  3.40M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (113:5): [True: 3.40M, False: 11.8M]
  ------------------
  114|  10.9M|    case AOT_SBR:
  ------------------
  |  |   35|  10.9M|#define AOT_SBR (5)
  ------------------
  |  Branch (114:5): [True: 7.57M, False: 7.65M]
  ------------------
  115|  11.9M|    case AOT_PS:
  ------------------
  |  |   39|  11.9M|#define AOT_PS (29)
  ------------------
  |  Branch (115:5): [True: 968k, False: 14.2M]
  ------------------
  116|  11.9M|      min_bits = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  11.9M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  117|  11.9M|      break;
  118|       |
  119|   814k|    case AOT_AAC_LD:
  ------------------
  |  |   36|   814k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (119:5): [True: 814k, False: 14.4M]
  ------------------
  120|  3.28M|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  3.28M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (120:5): [True: 2.47M, False: 12.7M]
  ------------------
  121|  3.28M|      min_bits = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  3.28M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  122|  3.28M|      break;
  123|  15.2M|  }
  124|       |
  125|   106M|  for (j = 0; j <= CODE_BCK_ESC_NDX; j += 2) {
  ------------------
  |  Branch (125:15): [True: 91.3M, False: 15.2M]
  ------------------
  126|  91.3M|    temp1 = *ptr_bit_cnt++;
  127|  91.3M|    temp2 = *ptr_bit_cnt++;
  128|  91.3M|    if (temp1 < min_bits) {
  ------------------
  |  Branch (128:9): [True: 12.9M, False: 78.4M]
  ------------------
  129|  12.9M|      min_bits = temp1;
  130|  12.9M|      temp_book = j;
  131|  12.9M|    }
  132|  91.3M|    if (temp2 < min_bits) {
  ------------------
  |  Branch (132:9): [True: 8.64M, False: 82.7M]
  ------------------
  133|  8.64M|      min_bits = temp2;
  134|  8.64M|      temp_book = j + 1;
  135|  8.64M|    }
  136|  91.3M|  }
  137|       |
  138|  15.2M|  *ptr_codebook = temp_book;
  139|  15.2M|  return min_bits;
  140|  15.2M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_scf_count:
  427|   475k|                                                ixheaace_huffman_tables *pstr_huffman_tbl) {
  428|   475k|  WORD32 sect_idx1 = 0;
  429|   475k|  WORD32 sfb_idx1 = 0;
  430|   475k|  WORD32 scf_idx = 0;
  431|   475k|  WORD32 sect_idx2 = 0;
  432|   475k|  WORD32 sfb_idx2 = 0;
  433|       |
  434|   475k|  WORD32 last_val_scf = 0;
  435|   475k|  WORD32 delta_scf = 0;
  436|   475k|  WORD32 found = 0;
  437|   475k|  WORD32 scf_skip_counter = 0;
  438|       |
  439|   475k|  pstr_section_data->scale_fac_bits = 0;
  440|       |
  441|   475k|  if (ptr_scale_fac == 0) {
  ------------------
  |  Branch (441:7): [True: 0, False: 475k]
  ------------------
  442|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_SCALE_FACTOR_GAIN;
  443|      0|  }
  444|   475k|  last_val_scf = 0;
  445|   475k|  pstr_section_data->first_scf = 0;
  446|       |
  447|   639k|  for (sect_idx1 = 0; sect_idx1 < pstr_section_data->num_of_sections; sect_idx1++) {
  ------------------
  |  Branch (447:23): [True: 474k, False: 165k]
  ------------------
  448|   474k|    if (pstr_section_data->section[sect_idx1].code_book != CODE_BCK_ZERO_NO) {
  ------------------
  |  Branch (448:9): [True: 310k, False: 163k]
  ------------------
  449|   310k|      pstr_section_data->first_scf = pstr_section_data->section[sect_idx1].sfb_start;
  450|       |
  451|   310k|      last_val_scf = ptr_scale_fac[pstr_section_data->first_scf];
  452|   310k|      break;
  453|   310k|    }
  454|   474k|  }
  455|       |
  456|  2.29M|  for (sect_idx1 = 0; sect_idx1 < pstr_section_data->num_of_sections; sect_idx1++) {
  ------------------
  |  Branch (456:23): [True: 1.82M, False: 475k]
  ------------------
  457|  1.82M|    if ((pstr_section_data->section[sect_idx1].code_book != CODE_BCK_ZERO_NO) &&
  ------------------
  |  Branch (457:9): [True: 1.29M, False: 524k]
  ------------------
  458|  1.29M|        (pstr_section_data->section[sect_idx1].code_book != CODE_BCK_PNS_NO)) {
  ------------------
  |  Branch (458:9): [True: 1.29M, False: 0]
  ------------------
  459|  1.29M|      for (sfb_idx1 = pstr_section_data->section[sect_idx1].sfb_start;
  460|  8.83M|           sfb_idx1 < pstr_section_data->section[sect_idx1].sfb_start +
  ------------------
  |  Branch (460:12): [True: 7.53M, False: 1.29M]
  ------------------
  461|  8.83M|                          pstr_section_data->section[sect_idx1].sfb_cnt;
  462|  7.53M|           sfb_idx1++) {
  463|  7.53M|        if (ptr_max_val_in_sfb[sfb_idx1] == 0) {
  ------------------
  |  Branch (463:13): [True: 465k, False: 7.07M]
  ------------------
  464|   465k|          found = 0;
  465|       |
  466|   465k|          if (scf_skip_counter == 0) {
  ------------------
  |  Branch (466:15): [True: 326k, False: 139k]
  ------------------
  467|   326k|            if (sfb_idx1 == (pstr_section_data->section[sect_idx1].sfb_start +
  ------------------
  |  Branch (467:17): [True: 36.3k, False: 289k]
  ------------------
  468|   326k|                             pstr_section_data->section[sect_idx1].sfb_cnt - 1)) {
  469|  36.3k|              found = 0;
  470|   289k|            } else {
  471|   289k|              for (scf_idx = (sfb_idx1 + 1);
  472|   441k|                   scf_idx < pstr_section_data->section[sect_idx1].sfb_start +
  ------------------
  |  Branch (472:20): [True: 429k, False: 11.8k]
  ------------------
  473|   441k|                                 pstr_section_data->section[sect_idx1].sfb_cnt;
  474|   429k|                   scf_idx++) {
  475|   429k|                if (ptr_max_val_in_sfb[scf_idx] != 0) {
  ------------------
  |  Branch (475:21): [True: 277k, False: 151k]
  ------------------
  476|   277k|                  found = 1;
  477|       |
  478|   277k|                  if ((abs32(ptr_scale_fac[scf_idx] - last_val_scf)) < CODE_BCK_SCF_LAV) {
  ------------------
  |  |   25|   277k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 141k, False: 136k]
  |  |  ------------------
  ------------------
  |  Branch (478:23): [True: 275k, False: 2.51k]
  ------------------
  479|   275k|                    delta_scf = 0;
  480|   275k|                  } else {
  481|  2.51k|                    delta_scf = -(ptr_scale_fac[sfb_idx1] - last_val_scf);
  482|       |
  483|  2.51k|                    last_val_scf = ptr_scale_fac[sfb_idx1];
  484|  2.51k|                    scf_skip_counter = 0;
  485|  2.51k|                  }
  486|   277k|                  break;
  487|   277k|                }
  488|       |                /* count scalefactor skip */
  489|   151k|                scf_skip_counter = scf_skip_counter + 1;
  490|   151k|              }
  491|   289k|            }
  492|       |
  493|       |            /* search for the next ptr_max_val_in_sfb[] != 0 in all other sections */
  494|   326k|            for (sect_idx2 = (sect_idx1 + 1);
  495|   348k|                 (sect_idx2 < pstr_section_data->num_of_sections) && (found == 0); sect_idx2++) {
  ------------------
  |  Branch (495:18): [True: 247k, False: 100k]
  |  Branch (495:70): [True: 21.9k, False: 225k]
  ------------------
  496|  21.9k|              if ((pstr_section_data->section[sect_idx2].code_book != CODE_BCK_ZERO_NO) &&
  ------------------
  |  Branch (496:19): [True: 19.9k, False: 1.97k]
  ------------------
  497|  19.9k|                  (pstr_section_data->section[sect_idx2].code_book != CODE_BCK_PNS_NO)) {
  ------------------
  |  Branch (497:19): [True: 19.9k, False: 0]
  ------------------
  498|  19.9k|                for (sfb_idx2 = pstr_section_data->section[sect_idx2].sfb_start;
  499|  21.5k|                     sfb_idx2 < pstr_section_data->section[sect_idx2].sfb_start +
  ------------------
  |  Branch (499:22): [True: 21.5k, False: 0]
  ------------------
  500|  21.5k|                                    pstr_section_data->section[sect_idx2].sfb_cnt;
  501|  21.5k|                     sfb_idx2++) {
  502|  21.5k|                  if (ptr_max_val_in_sfb[sfb_idx2] != 0) {
  ------------------
  |  Branch (502:23): [True: 19.9k, False: 1.56k]
  ------------------
  503|  19.9k|                    found = 1;
  504|       |
  505|  19.9k|                    if ((abs32(ptr_scale_fac[sfb_idx2] - last_val_scf)) < CODE_BCK_SCF_LAV) {
  ------------------
  |  |   25|  19.9k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 5.95k, False: 14.0k]
  |  |  ------------------
  ------------------
  |  Branch (505:25): [True: 19.6k, False: 361]
  ------------------
  506|  19.6k|                      delta_scf = 0;
  507|  19.6k|                    } else {
  508|    361|                      delta_scf = -(ptr_scale_fac[sfb_idx1] - last_val_scf);
  509|       |
  510|    361|                      last_val_scf = ptr_scale_fac[sfb_idx1];
  511|    361|                      scf_skip_counter = 0;
  512|    361|                    }
  513|  19.9k|                    break;
  514|  19.9k|                  }
  515|       |
  516|  1.56k|                  scf_skip_counter = scf_skip_counter + 1;
  517|  1.56k|                }
  518|  19.9k|              }
  519|  21.9k|            }
  520|       |
  521|   326k|            if (found == 0) {
  ------------------
  |  Branch (521:17): [True: 28.2k, False: 297k]
  ------------------
  522|  28.2k|              delta_scf = 0;
  523|  28.2k|              scf_skip_counter = 0;
  524|  28.2k|            }
  525|   326k|          } else {
  526|   139k|            delta_scf = 0;
  527|       |
  528|   139k|            scf_skip_counter = scf_skip_counter - 1;
  529|   139k|          }
  530|  7.07M|        } else {
  531|  7.07M|          delta_scf = -(ptr_scale_fac[sfb_idx1] - last_val_scf);
  532|       |
  533|  7.07M|          last_val_scf = ptr_scale_fac[sfb_idx1];
  534|  7.07M|        }
  535|       |
  536|  7.53M|        pstr_section_data->scale_fac_bits +=
  537|  7.53M|            ia_enhaacplus_enc_bit_count_scalefactor_delta(delta_scf, pstr_huffman_tbl);
  538|  7.53M|      }
  539|  1.29M|    }
  540|  1.82M|  }
  541|   475k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   475k|#define IA_NO_ERROR 0x00000000
  ------------------
  542|   475k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_bit_count_scalefactor_delta:
  420|  7.53M|    WORD32 delta, ixheaace_huffman_tables *pstr_huffman_tbl) {
  421|  7.53M|  return pstr_huffman_tbl->huff_ltabscf[delta + CODE_BCK_SCF_LAV];
  422|  7.53M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_calc_side_info_bits:
   52|   322k|static WORD32 ia_enhaacplus_enc_calc_side_info_bits(WORD32 sfb_cnt, WORD32 block_type) {
   53|   322k|  WORD32 seg_len_bits = (block_type == SHORT_WINDOW ? 3 : 5);
  ------------------
  |  Branch (53:26): [True: 75.8k, False: 246k]
  ------------------
   54|   322k|  WORD32 escape_val = (block_type == SHORT_WINDOW ? 7 : 31);
  ------------------
  |  Branch (54:24): [True: 75.8k, False: 246k]
  ------------------
   55|   322k|  WORD32 side_info_bits, tmp;
   56|       |
   57|   322k|  side_info_bits = CODE_BCK_BITS;
  ------------------
  |  |   25|   322k|#define CODE_BCK_BITS 4
  ------------------
   58|   322k|  tmp = sfb_cnt;
   59|       |
   60|   796k|  while (tmp >= 0) {
  ------------------
  |  Branch (60:10): [True: 474k, False: 322k]
  ------------------
   61|   474k|    side_info_bits += seg_len_bits;
   62|   474k|    tmp -= escape_val;
   63|   474k|  }
   64|       |
   65|   322k|  return (side_info_bits);
   66|   322k|}

ia_enhaacplus_enc_aac_enc_pers_size:
  156|  9.54k|WORD32 ia_enhaacplus_enc_aac_enc_pers_size(WORD32 num_aac_chan, WORD32 aot) {
  157|  9.54k|  WORD32 num_bytes;
  158|  9.54k|  num_bytes = IXHEAAC_GET_SIZE_ALIGNED(sizeof(iexheaac_encoder_str), BYTE_ALIGN_8);
  ------------------
  |  |   87|  9.54k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  159|  9.54k|  num_bytes += (num_aac_chan *
  160|  9.54k|    IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_psy_out_channel), BYTE_ALIGN_8));
  ------------------
  |  |   87|  9.54k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  161|  9.54k|  num_bytes += (num_aac_chan *
  162|  9.54k|    IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_psy_data), BYTE_ALIGN_8));
  ------------------
  |  |   87|  9.54k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  163|  9.54k|  num_bytes += (num_aac_chan *
  164|  9.54k|    IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_temporal_noise_shaping_data), BYTE_ALIGN_8));
  ------------------
  |  |   87|  9.54k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  165|  9.54k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  19.0k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  17.2k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  4.14k|#define AOT_PS (29)
  ------------------
  |  Branch (165:7): [True: 1.88k, False: 7.66k]
  |  Branch (165:28): [True: 3.51k, False: 4.14k]
  |  Branch (165:46): [True: 502, False: 3.64k]
  ------------------
  166|  5.90k|    num_bytes += (num_aac_chan *
  167|  5.90k|      IXHEAAC_GET_SIZE_ALIGNED(BLK_SWITCH_OFFSET_LC_128 * sizeof(FLOAT32), BYTE_ALIGN_8));
  ------------------
  |  |   87|  5.90k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  168|  5.90k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  7.28k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  2.66k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (168:14): [True: 984, False: 2.66k]
  |  Branch (168:35): [True: 2.66k, False: 0]
  ------------------
  169|  3.64k|    num_bytes += (num_aac_chan *
  170|  3.64k|      IXHEAAC_GET_SIZE_ALIGNED(BLK_SWITCH_OFFSET_LD * sizeof(FLOAT32), BYTE_ALIGN_8));
  ------------------
  |  |   87|  3.64k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  171|  3.64k|  }
  172|       |
  173|  9.54k|  num_bytes += (num_aac_chan *
  174|  9.54k|    IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_qc_out_channel), BYTE_ALIGN_8));
  ------------------
  |  |   87|  9.54k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  175|  9.54k|  return num_bytes;
  176|  9.54k|}
ia_enhaacplus_enc_aac_enc_scr_size:
  178|   331k|WORD32 ia_enhaacplus_enc_aac_enc_scr_size(VOID) {
  179|   331k|  return IXHEAAC_GET_SIZE_ALIGNED(sizeof(iaace_scratch), BYTE_ALIGN_8);
  ------------------
  |  |   87|   331k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  180|   331k|}
ia_enhaacplus_enc_set_shared_bufs:
  184|  4.74k|                                       WORD8 **shared_buf5) {
  185|  4.74k|  iaace_scratch *pstr_aac_enc_scratch = scr;
  186|       |  /* Fill addresses of shared buffers */
  187|  4.74k|  pstr_aac_enc_scratch->shared_buffer1 = *shared_buf1;
  188|  4.74k|  pstr_aac_enc_scratch->shared_buffer_2 = *shared_buf2;
  189|  4.74k|  pstr_aac_enc_scratch->shared_buffer3 = *shared_buf3;
  190|  4.74k|  pstr_aac_enc_scratch->shared_buffer5 = (WORD8 *)*shared_buf5;
  191|  4.74k|}
ia_enhaacplus_enc_aac_init_default_config:
  193|  54.5k|VOID ia_enhaacplus_enc_aac_init_default_config(iaace_config *config, WORD32 aot) {
  194|  54.5k|  memset(config, 0, sizeof(iaace_config));
  195|       |
  196|       |  /* default configurations */
  197|  54.5k|  config->bit_rate = AAC_BITRATE_DEFAULT_VALUE;
  ------------------
  |  |   46|  54.5k|#define AAC_BITRATE_DEFAULT_VALUE (48000)
  ------------------
  198|  54.5k|  config->band_width = 0;
  199|  54.5k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   109k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   106k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  47.3k|#define AOT_PS (29)
  ------------------
  |  Branch (199:7): [True: 2.48k, False: 52.0k]
  |  Branch (199:28): [True: 4.74k, False: 47.3k]
  |  Branch (199:46): [True: 3.90k, False: 43.4k]
  ------------------
  200|  11.1k|    config->inv_quant = 0;
  201|  43.4k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  86.8k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  41.8k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (201:14): [True: 1.57k, False: 41.8k]
  |  Branch (201:35): [True: 7.53k, False: 34.3k]
  ------------------
  202|  9.11k|    config->inv_quant = 2;
  203|  9.11k|  }
  204|  54.5k|  config->bitreservoir_size = BITRESERVOIR_SIZE_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   24|  54.5k|#define BITRESERVOIR_SIZE_CONFIG_PARAM_DEFAULT_VALUE (768)
  ------------------
  205|  54.5k|  config->use_tns = 0;
  206|  54.5k|  config->flag_framelength_small =
  207|  54.5k|      USE_FRAMELENGTH_SMALL_PARAM_DEFAULT_VALUE;  // assume framelength large
  ------------------
  |  |   45|  54.5k|#define USE_FRAMELENGTH_SMALL_PARAM_DEFAULT_VALUE (0)
  ------------------
  208|  54.5k|}
ia_enhaacplus_enc_init_aac_tabs:
  215|  6.82k|VOID ia_enhaacplus_enc_init_aac_tabs(ixheaace_aac_tables *pstr_aac_tabs) {
  216|  6.82k|  pstr_aac_tabs->pstr_mdct_tab = (ixheaace_mdct_tables *)&ixheaace_enc_mdct_tab;
  217|  6.82k|  pstr_aac_tabs->pstr_huff_tab = (ixheaace_huffman_tables *)&ixheaace_enc_huff_tab;
  218|  6.82k|  pstr_aac_tabs->pstr_psycho_tab = (ixheaace_psycho_tables *)&ixheaace_enc_psycho_tab;
  219|  6.82k|  pstr_aac_tabs->pstr_quant_tab = (ixheaace_quant_tables *)&ixheaace_enc_quant_tab;
  220|  6.82k|  pstr_aac_tabs->pstr_tns_tab =
  221|  6.82k|      (ixheaace_temporal_noise_shaping_tables *)&ixheaace_enhaacplus_enc_tns_tab;
  222|  6.82k|}
ia_enhaacplus_enc_aac_enc_open:
  283|  4.74k|                                            WORD32 element_instance_tag, WORD32 aot) {
  284|  4.74k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  285|  4.74k|  WORD32 profile = 1;
  286|  4.74k|  ixheaace_element_info *pstr_element_info = NULL;
  287|  4.74k|  iexheaac_encoder_str *pstr_exheaac_encoder;
  288|  4.74k|  WORD32 frame_len_long = FRAME_LEN_1024;
  ------------------
  |  |   91|  4.74k|#define FRAME_LEN_1024 1024
  ------------------
  289|  4.74k|  switch (aot) {
  ------------------
  |  Branch (289:11): [True: 4.74k, False: 0]
  ------------------
  290|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (290:5): [True: 1.00k, False: 3.74k]
  ------------------
  291|  2.69k|    case AOT_SBR:
  ------------------
  |  |   35|  2.69k|#define AOT_SBR (5)
  ------------------
  |  Branch (291:5): [True: 1.69k, False: 3.04k]
  ------------------
  292|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (292:5): [True: 246, False: 4.49k]
  ------------------
  293|  2.94k|      if (config.flag_framelength_small) {
  ------------------
  |  Branch (293:11): [True: 1.01k, False: 1.92k]
  ------------------
  294|  1.01k|        frame_len_long = FRAME_LEN_960;
  ------------------
  |  |   94|  1.01k|#define FRAME_LEN_960 960
  ------------------
  295|  1.92k|      } else {
  296|  1.92k|        frame_len_long = FRAME_LEN_1024;
  ------------------
  |  |   91|  1.92k|#define FRAME_LEN_1024 1024
  ------------------
  297|  1.92k|      }
  298|  2.94k|      break;
  299|       |
  300|    529|    case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (300:5): [True: 529, False: 4.21k]
  ------------------
  301|  1.80k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (301:5): [True: 1.27k, False: 3.47k]
  ------------------
  302|  1.80k|      if (config.flag_framelength_small) {
  ------------------
  |  Branch (302:11): [True: 825, False: 977]
  ------------------
  303|    825|        frame_len_long = FRAME_LEN_480;
  ------------------
  |  |   93|    825|#define FRAME_LEN_480 480
  ------------------
  304|    977|      } else {
  305|    977|        frame_len_long = FRAME_LEN_512;
  ------------------
  |  |   92|    977|#define FRAME_LEN_512 512
  ------------------
  306|    977|      }
  307|  1.80k|      break;
  308|  4.74k|  }
  309|       |
  310|  4.74k|  if ((config.num_in_channels < 1) || (config.num_out_channels > IXHEAACE_MAX_CH_IN_BS_ELE) ||
  ------------------
  |  |   86|  4.74k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (310:7): [True: 0, False: 4.74k]
  |  Branch (310:39): [True: 0, False: 4.74k]
  ------------------
  311|  4.74k|    (config.num_out_channels < 1) || (config.num_in_channels < config.num_out_channels)) {
  ------------------
  |  Branch (311:5): [True: 0, False: 4.74k]
  |  Branch (311:38): [True: 0, False: 4.74k]
  ------------------
  312|      0|    return IA_EXHEAACE_INIT_FATAL_INVALID_NUM_CHANNELS_IN_ELE;
  313|      0|  }
  314|  4.74k|  if ((config.bit_rate != 0) && ((config.bit_rate / config.num_out_channels < 8000) ||
  ------------------
  |  Branch (314:7): [True: 4.74k, False: 0]
  |  Branch (314:34): [True: 0, False: 4.74k]
  ------------------
  315|  4.74k|    (config.bit_rate / config.num_out_channels > 576000))) {
  ------------------
  |  Branch (315:5): [True: 0, False: 4.74k]
  ------------------
  316|      0|    error = IA_EXHEAACE_INIT_FATAL_BITRATE_NOT_SUPPORTED;
  317|      0|  }
  318|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (318:7): [True: 0, False: 4.74k]
  ------------------
  319|      0|    return error;
  320|      0|  }
  321|       |
  322|  4.74k|  pstr_exheaac_encoder = *ppstr_exheaac_encoder;
  323|       |
  324|  4.74k|  memset(pstr_exheaac_encoder, 0, sizeof(iexheaac_encoder_str));
  325|       |
  326|  4.74k|  ia_enhaacplus_enc_aac_set_scratch_ptr(pstr_exheaac_encoder, pstr_aac_scratch);
  327|       |
  328|  4.74k|  ia_enhaacplus_enc_aac_set_persist_buf((WORD8 *)pstr_exheaac_encoder, config.num_out_channels,
  329|  4.74k|                                        aot);
  330|       |
  331|       |  /* check sample rate */
  332|       |
  333|  4.74k|  switch (config.core_sample_rate) {
  334|    170|    case 8000:
  ------------------
  |  Branch (334:5): [True: 170, False: 4.57k]
  ------------------
  335|    271|    case 11025:
  ------------------
  |  Branch (335:5): [True: 101, False: 4.64k]
  ------------------
  336|    447|    case 12000:
  ------------------
  |  Branch (336:5): [True: 176, False: 4.56k]
  ------------------
  337|  1.67k|    case 16000:
  ------------------
  |  Branch (337:5): [True: 1.22k, False: 3.51k]
  ------------------
  338|  2.73k|    case 22050:
  ------------------
  |  Branch (338:5): [True: 1.06k, False: 3.67k]
  ------------------
  339|  3.90k|    case 24000:
  ------------------
  |  Branch (339:5): [True: 1.17k, False: 3.57k]
  ------------------
  340|  4.01k|    case 32000:
  ------------------
  |  Branch (340:5): [True: 101, False: 4.64k]
  ------------------
  341|  4.08k|    case 44100:
  ------------------
  |  Branch (341:5): [True: 75, False: 4.66k]
  ------------------
  342|  4.22k|    case 48000:
  ------------------
  |  Branch (342:5): [True: 137, False: 4.60k]
  ------------------
  343|  4.32k|    case 64000:
  ------------------
  |  Branch (343:5): [True: 107, False: 4.63k]
  ------------------
  344|  4.61k|    case 88200:
  ------------------
  |  Branch (344:5): [True: 282, False: 4.46k]
  ------------------
  345|  4.74k|    case 96000:
  ------------------
  |  Branch (345:5): [True: 132, False: 4.61k]
  ------------------
  346|  4.74k|      break;
  347|       |
  348|      0|    default:
  ------------------
  |  Branch (348:5): [True: 0, False: 4.74k]
  ------------------
  349|      0|      return IA_EXHEAACE_INIT_FATAL_INVALID_CORE_SAMPLE_RATE;
  350|      0|      break;
  351|  4.74k|  }
  352|       |
  353|  4.74k|  pstr_exheaac_encoder->config = config;
  354|       |
  355|  4.74k|  error = ia_enhaacplus_enc_init_element_info(config.num_out_channels,
  356|  4.74k|                                              &pstr_exheaac_encoder->element_info, ele_type,
  357|  4.74k|                                              element_instance_tag);
  358|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (358:7): [True: 0, False: 4.74k]
  ------------------
  359|      0|    return error;
  360|      0|  }
  361|       |
  362|  4.74k|  pstr_element_info = &pstr_exheaac_encoder->element_info;
  363|       |
  364|       |  /* allocate the Psy aud Psy Out structure */
  365|       |
  366|  4.74k|  error = (ia_enhaacplus_enc_psy_new(
  367|  4.74k|      &pstr_exheaac_encoder->psy_kernel, pstr_element_info->n_channels_in_el,
  368|  4.74k|      pstr_exheaac_encoder->pstr_aac_scratch->shared_buffer_2, frame_len_long));
  369|       |
  370|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (370:7): [True: 0, False: 4.74k]
  ------------------
  371|      0|    return error;
  372|      0|  }
  373|       |
  374|  4.74k|  WORD32 tns_mask = config.use_tns;
  375|  4.74k|  if (config.full_bandwidth) {
  ------------------
  |  Branch (375:7): [True: 1.95k, False: 2.78k]
  ------------------
  376|  1.95k|    pstr_exheaac_encoder->config.band_width = config.core_sample_rate >> 2;
  377|  2.78k|  } else {
  378|  2.78k|    ixheaace_determine_bandwidth(pstr_exheaac_encoder->config.band_width, config.bit_rate,
  379|  2.78k|                                 config.core_sample_rate, pstr_element_info->n_channels_in_el,
  380|  2.78k|                                 &pstr_exheaac_encoder->config.band_width, aot);
  381|  2.78k|  }
  382|  4.74k|  pstr_exheaac_encoder->bandwidth_90_dB = (WORD32)pstr_exheaac_encoder->config.band_width;
  383|  4.74k|  if (ele_type == ID_LFE) {
  ------------------
  |  Branch (383:7): [True: 425, False: 4.31k]
  ------------------
  384|    425|    tns_mask = 0;
  385|    425|  }
  386|       |
  387|  4.74k|  error = ia_enhaacplus_enc_psy_main_init(
  388|  4.74k|      &pstr_exheaac_encoder->psy_kernel, config.core_sample_rate, config.bit_rate,
  389|  4.74k|      pstr_element_info->n_channels_in_el, tns_mask, pstr_exheaac_encoder->bandwidth_90_dB, aot,
  390|  4.74k|      pstr_aac_tabs, frame_len_long);
  391|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (391:7): [True: 0, False: 4.74k]
  ------------------
  392|      0|    return error;
  393|      0|  }
  394|       |
  395|       |  /* allocate the Q&C Out structure */
  396|  4.74k|  error = ia_enhaacplus_enc_qc_out_new(
  397|  4.74k|      &pstr_exheaac_encoder->qc_out, pstr_element_info->n_channels_in_el,
  398|  4.74k|      pstr_exheaac_encoder->pstr_aac_scratch->shared_buffer1,
  399|  4.74k|      pstr_exheaac_encoder->pstr_aac_scratch->shared_buffer3, frame_len_long);
  400|       |
  401|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (401:7): [True: 0, False: 4.74k]
  ------------------
  402|      0|    return error;
  403|      0|  }
  404|       |
  405|       |  /* allocate the Q&C kernel */
  406|  4.74k|  error = ia_enhaacplus_enc_qc_new(&pstr_exheaac_encoder->qc_kernel,
  407|  4.74k|                                   pstr_exheaac_encoder->pstr_aac_scratch->shared_buffer_2,
  408|  4.74k|                                   frame_len_long);
  409|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (409:7): [True: 0, False: 4.74k]
  ------------------
  410|      0|    return error;
  411|      0|  }
  412|       |
  413|  4.74k|  ixheaace_qc_init qc_init;
  414|       |
  415|  4.74k|  qc_init.pstr_element_info = &pstr_exheaac_encoder->element_info;
  416|       |
  417|  4.74k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  9.48k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  8.48k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.04k|#define AOT_PS (29)
  ------------------
  |  Branch (417:7): [True: 1.00k, False: 3.74k]
  |  Branch (417:28): [True: 1.69k, False: 2.04k]
  |  Branch (417:46): [True: 246, False: 1.80k]
  ------------------
  418|  2.94k|    if (config.flag_framelength_small) {
  ------------------
  |  Branch (418:9): [True: 1.01k, False: 1.92k]
  ------------------
  419|  1.01k|      qc_init.max_bits = MAXIMUM_CHANNEL_BITS_960 * pstr_element_info->n_channels_in_el;
  ------------------
  |  |   95|  1.01k|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  420|  1.92k|    } else {
  421|  1.92k|      qc_init.max_bits = MAXIMUM_CHANNEL_BITS_1024 * pstr_element_info->n_channels_in_el;
  ------------------
  |  |   94|  1.92k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  422|  1.92k|    }
  423|       |
  424|  2.94k|    qc_init.bit_res = qc_init.max_bits;
  425|  2.94k|  }
  426|       |
  427|  4.74k|  qc_init.average_bits = (config.bit_rate * frame_len_long) / config.core_sample_rate;
  428|       |
  429|  4.74k|  if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  9.48k|#define AOT_AAC_LD (23)
  ------------------
                if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  4.21k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (429:7): [True: 529, False: 4.21k]
  |  Branch (429:28): [True: 1.27k, False: 2.94k]
  ------------------
  430|  1.80k|    if (pstr_exheaac_encoder->config.bitreservoir_size != -1) {
  ------------------
  |  Branch (430:9): [True: 1.64k, False: 154]
  ------------------
  431|  1.64k|      qc_init.max_bits = (pstr_exheaac_encoder->config.bitreservoir_size * 8) *
  432|  1.64k|                         pstr_element_info->n_channels_in_el;
  433|  1.64k|      if (qc_init.max_bits > qc_init.average_bits) {
  ------------------
  |  Branch (433:11): [True: 1.18k, False: 462]
  ------------------
  434|  1.18k|        qc_init.bit_res = (pstr_exheaac_encoder->config.bitreservoir_size * 8) *
  435|  1.18k|                          pstr_element_info->n_channels_in_el;
  436|  1.18k|      } else {
  437|    462|        qc_init.max_bits = qc_init.average_bits;
  438|    462|        qc_init.bit_res = 0;
  439|    462|      }
  440|  1.64k|    } else {
  441|    154|      qc_init.max_bits = qc_init.average_bits;
  442|    154|      qc_init.bit_res = 0;
  443|    154|    }
  444|  1.80k|  }
  445|       |
  446|  4.74k|  qc_init.padding.padding_rest = config.core_sample_rate;
  447|       |
  448|  4.74k|  qc_init.mean_pe = ((FLOAT32)10 * frame_len_long * pstr_exheaac_encoder->bandwidth_90_dB * 2) /
  449|  4.74k|                    config.core_sample_rate;
  450|       |
  451|  4.74k|  switch (aot) {
  ------------------
  |  Branch (451:11): [True: 4.74k, False: 0]
  ------------------
  452|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (452:5): [True: 1.00k, False: 3.74k]
  ------------------
  453|  2.69k|    case AOT_SBR:
  ------------------
  |  |   35|  2.69k|#define AOT_SBR (5)
  ------------------
  |  Branch (453:5): [True: 1.69k, False: 3.04k]
  ------------------
  454|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (454:5): [True: 246, False: 4.49k]
  ------------------
  455|  2.94k|      if (config.flag_framelength_small) {
  ------------------
  |  Branch (455:11): [True: 1.01k, False: 1.92k]
  ------------------
  456|  1.01k|        qc_init.max_bit_fac =
  457|  1.01k|            (float)(MAXIMUM_CHANNEL_BITS_960 * pstr_element_info->n_channels_in_el) /
  ------------------
  |  |   95|  1.01k|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  458|  1.01k|            (float)(qc_init.average_bits ? qc_init.average_bits : 1);
  ------------------
  |  Branch (458:21): [True: 1.01k, False: 0]
  ------------------
  459|  1.92k|      } else {
  460|  1.92k|        qc_init.max_bit_fac =
  461|  1.92k|            (float)(MAXIMUM_CHANNEL_BITS_1024 * pstr_element_info->n_channels_in_el) /
  ------------------
  |  |   94|  1.92k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  462|  1.92k|            (float)(qc_init.average_bits ? qc_init.average_bits : 1);
  ------------------
  |  Branch (462:21): [True: 1.92k, False: 0]
  ------------------
  463|  1.92k|      }
  464|  2.94k|      break;
  465|       |
  466|    529|    case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (466:5): [True: 529, False: 4.21k]
  ------------------
  467|  1.80k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (467:5): [True: 1.27k, False: 3.47k]
  ------------------
  468|  1.80k|      if (config.flag_framelength_small) {
  ------------------
  |  Branch (468:11): [True: 825, False: 977]
  ------------------
  469|    825|        qc_init.max_bit_fac = (FLOAT32)((MAXIMUM_CHANNEL_BITS_480)*pstr_element_info
  ------------------
  |  |   97|    825|#define MAXIMUM_CHANNEL_BITS_480 2880
  ------------------
  470|    825|                                            ->n_channels_in_el);  // no anc data in aacld
  471|    977|      } else {
  472|    977|        qc_init.max_bit_fac = (FLOAT32)((MAXIMUM_CHANNEL_BITS_512)*pstr_element_info
  ------------------
  |  |   96|    977|#define MAXIMUM_CHANNEL_BITS_512 3072
  ------------------
  473|    977|                                            ->n_channels_in_el);  // no anc data in aacld
  474|    977|      }
  475|  1.80k|      qc_init.max_bit_fac =
  476|  1.80k|          qc_init.max_bit_fac / (qc_init.average_bits ? qc_init.average_bits : 1);
  ------------------
  |  Branch (476:34): [True: 1.80k, False: 0]
  ------------------
  477|  1.80k|      break;
  478|  4.74k|  }
  479|       |
  480|  4.74k|  qc_init.bitrate = config.bit_rate;
  481|  4.74k|  qc_init.inv_quant = config.inv_quant;
  482|       |
  483|  4.74k|  error = ia_enhaacplus_enc_qc_init(&pstr_exheaac_encoder->qc_kernel, aot, &qc_init,
  484|  4.74k|                                    config.flag_framelength_small);
  485|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (485:7): [True: 0, False: 4.74k]
  ------------------
  486|      0|    return error;
  487|      0|  }
  488|       |
  489|       |  /* init bitstream encoder */
  490|  4.74k|  pstr_exheaac_encoder->bse_init.num_channels = pstr_element_info->n_channels_in_el;
  491|  4.74k|  pstr_exheaac_encoder->bse_init.bitrate = config.bit_rate;
  492|  4.74k|  pstr_exheaac_encoder->bse_init.sample_rate = config.core_sample_rate;
  493|  4.74k|  pstr_exheaac_encoder->bse_init.profile = profile;
  494|       |
  495|  4.74k|  if (config.num_in_channels > config.num_out_channels) {
  ------------------
  |  Branch (495:7): [True: 799, False: 3.94k]
  ------------------
  496|    799|    pstr_exheaac_encoder->downmix = 1;
  497|    799|    pstr_exheaac_encoder->downmix_fac = config.num_in_channels / config.num_out_channels;
  498|    799|  }
  499|       |
  500|  4.74k|  if (pstr_element_info->el_type == ID_CPE &&
  ------------------
  |  Branch (500:7): [True: 2.20k, False: 2.53k]
  ------------------
  501|  2.20k|      (config.core_sample_rate <= 24000 &&
  ------------------
  |  Branch (501:8): [True: 1.79k, False: 419]
  ------------------
  502|  1.79k|       (config.bit_rate / pstr_element_info->n_channels_in_el * 2) < 60000)) {
  ------------------
  |  Branch (502:8): [True: 1.22k, False: 567]
  ------------------
  503|  1.22k|    FLOAT32 scf_used_ratio = (FLOAT32)pstr_exheaac_encoder->psy_kernel.psy_conf_long.sfb_active /
  504|  1.22k|                             pstr_exheaac_encoder->psy_kernel.psy_conf_long.sfb_cnt;
  505|       |
  506|  1.22k|    error = iaace_init_stereo_pre_processing(&(pstr_exheaac_encoder->str_stereo_pre_pro),
  507|  1.22k|                                             pstr_element_info->n_channels_in_el, config.bit_rate,
  508|  1.22k|                                             config.core_sample_rate, scf_used_ratio);
  509|  1.22k|  }
  510|       |
  511|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (511:7): [True: 0, False: 4.74k]
  ------------------
  512|      0|    return error;
  513|      0|  }
  514|       |
  515|  4.74k|  *ppstr_exheaac_encoder = pstr_exheaac_encoder;
  516|       |
  517|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  518|  4.74k|}
ixheaace_enc_init.c:ia_enhaacplus_enc_aac_set_scratch_ptr:
  211|  4.74k|                                                  iaace_scratch *pstr_scr) {
  212|  4.74k|  pstr_exheaac_encoder->pstr_aac_scratch = pstr_scr;
  213|  4.74k|}
ixheaace_enc_init.c:ia_enhaacplus_enc_aac_set_persist_buf:
  224|  4.74k|static VOID ia_enhaacplus_enc_aac_set_persist_buf(WORD8 *ptr_base, WORD32 num_chan, WORD32 aot) {
  225|  4.74k|  iexheaac_encoder_str *pstr_exheaac_encoder;
  226|  4.74k|  WORD8 *ptr_curr_mem = ptr_base +
  227|  4.74k|    IXHEAAC_GET_SIZE_ALIGNED(sizeof(iexheaac_encoder_str), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.74k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  228|  4.74k|  WORD32 i;
  229|       |
  230|  4.74k|  pstr_exheaac_encoder = (iexheaac_encoder_str *)ptr_base;
  231|       |
  232|  11.6k|  for (i = 0; i < num_chan; i++) {
  ------------------
  |  Branch (232:15): [True: 6.95k, False: 4.74k]
  ------------------
  233|  6.95k|    pstr_exheaac_encoder->psy_out.psy_out_ch[i] = (ixheaace_psy_out_channel *)(ptr_curr_mem);
  234|  6.95k|    ptr_curr_mem = ptr_curr_mem +
  235|  6.95k|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_psy_out_channel), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  236|  6.95k|  }
  237|       |
  238|  11.6k|  for (i = 0; i < num_chan; i++) {
  ------------------
  |  Branch (238:15): [True: 6.95k, False: 4.74k]
  ------------------
  239|  6.95k|    pstr_exheaac_encoder->psy_kernel.psy_data[i] = (ixheaace_psy_data *)(ptr_curr_mem);
  240|  6.95k|    ptr_curr_mem = ptr_curr_mem +
  241|  6.95k|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_psy_data), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  242|  6.95k|  }
  243|       |
  244|  11.6k|  for (i = 0; i < num_chan; i++) {
  ------------------
  |  Branch (244:15): [True: 6.95k, False: 4.74k]
  ------------------
  245|  6.95k|    pstr_exheaac_encoder->psy_kernel.temporal_noise_shaping_data[i] =
  246|  6.95k|        (ixheaace_temporal_noise_shaping_data *)(ptr_curr_mem);
  247|  6.95k|    ptr_curr_mem = ptr_curr_mem +
  248|  6.95k|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_temporal_noise_shaping_data), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  249|  6.95k|  }
  250|       |
  251|  11.6k|  for (i = 0; i < num_chan; i++) {
  ------------------
  |  Branch (251:15): [True: 6.95k, False: 4.74k]
  ------------------
  252|  6.95k|    switch (aot) {
  ------------------
  |  Branch (252:13): [True: 6.95k, False: 0]
  ------------------
  253|  1.50k|      case AOT_AAC_LC:
  ------------------
  |  |   34|  1.50k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (253:7): [True: 1.50k, False: 5.44k]
  ------------------
  254|  4.06k|      case AOT_SBR:
  ------------------
  |  |   35|  4.06k|#define AOT_SBR (5)
  ------------------
  |  Branch (254:7): [True: 2.55k, False: 4.39k]
  ------------------
  255|  4.31k|      case AOT_PS:
  ------------------
  |  |   39|  4.31k|#define AOT_PS (29)
  ------------------
  |  Branch (255:7): [True: 246, False: 6.70k]
  ------------------
  256|  4.31k|        pstr_exheaac_encoder->psy_kernel.psy_data[i]->ptr_mdct_delay_buf =
  257|  4.31k|            (FLOAT32 *)(ptr_curr_mem);
  258|  4.31k|        ptr_curr_mem = ptr_curr_mem +
  259|  4.31k|          IXHEAAC_GET_SIZE_ALIGNED(sizeof(FLOAT32) * BLK_SWITCH_OFFSET_LC_128, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.31k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  260|  4.31k|        break;
  261|       |
  262|    766|      case AOT_AAC_LD:
  ------------------
  |  |   36|    766|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (262:7): [True: 766, False: 6.18k]
  ------------------
  263|  2.63k|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  2.63k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (263:7): [True: 1.87k, False: 5.07k]
  ------------------
  264|  2.63k|        pstr_exheaac_encoder->psy_kernel.psy_data[i]->ptr_mdct_delay_buf =
  265|  2.63k|            (FLOAT32 *)(ptr_curr_mem);
  266|  2.63k|        ptr_curr_mem = ptr_curr_mem +
  267|  2.63k|          IXHEAAC_GET_SIZE_ALIGNED(sizeof(FLOAT32) * BLK_SWITCH_OFFSET_LD, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.63k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  268|  2.63k|        break;
  269|  6.95k|    }
  270|  6.95k|  }
  271|       |
  272|  11.6k|  for (i = 0; i < num_chan; i++) {
  ------------------
  |  Branch (272:15): [True: 6.95k, False: 4.74k]
  ------------------
  273|  6.95k|    pstr_exheaac_encoder->qc_out.qc_channel[i] = (ixheaace_qc_out_channel *)(ptr_curr_mem);
  274|  6.95k|    ptr_curr_mem = ptr_curr_mem +
  275|  6.95k|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_qc_out_channel), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  276|  6.95k|  }
  277|  4.74k|}
ixheaace_enc_init.c:ixheaace_determine_bandwidth:
  146|  2.78k|                                         WORD32 *const bandwidth, WORD32 aot) {
  147|  2.78k|  WORD32 channel_bit_rate = bitrate / channels;
  148|  2.78k|  if (proposed_bandwidth == 0) {
  ------------------
  |  Branch (148:7): [True: 1.08k, False: 1.70k]
  ------------------
  149|  1.08k|    *bandwidth = ixheaace_calculate_bandwidth(sample_rate, channel_bit_rate, channels, aot);
  150|  1.70k|  } else {
  151|  1.70k|    *bandwidth = MIN(proposed_bandwidth, MIN(20000, sample_rate >> 1));
  ------------------
  |  |   23|  3.40k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 1.55k, False: 147]
  |  |  |  Branch (23:27): [True: 0, False: 1.70k]
  |  |  |  Branch (23:39): [True: 0, False: 147]
  |  |  ------------------
  ------------------
  152|  1.70k|  }
  153|  2.78k|  *bandwidth = MIN(*bandwidth, sample_rate / 2);
  ------------------
  |  |   23|  2.78k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.41k, False: 368]
  |  |  ------------------
  ------------------
  154|  2.78k|}
ixheaace_enc_init.c:ixheaace_calculate_bandwidth:
   61|  1.08k|                                           WORD32 aot) {
   62|  1.08k|  WORD32 bandwidth = -1;
   63|  1.08k|  const ixheaace_bandwidth_table *pstr_bandwidth_table = NULL;
   64|  1.08k|  WORD32 bandwidth_table_size = 0;
   65|  1.08k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  2.16k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  1.62k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|    424|#define AOT_PS (29)
  ------------------
  |  Branch (65:7): [True: 542, False: 541]
  |  Branch (65:28): [True: 117, False: 424]
  |  Branch (65:46): [True: 0, False: 424]
  ------------------
   66|    659|    pstr_bandwidth_table = bandwidth_table_lc;
   67|    659|    bandwidth_table_size = sizeof(bandwidth_table_lc) / sizeof(ixheaace_bandwidth_table);
   68|    659|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|    848|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|     54|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (68:14): [True: 370, False: 54]
  |  Branch (68:35): [True: 54, False: 0]
  ------------------
   69|    424|    switch (sample_rate) {
  ------------------
  |  Branch (69:13): [True: 424, False: 0]
  ------------------
   70|     22|      case 48000:
  ------------------
  |  Branch (70:7): [True: 22, False: 402]
  ------------------
   71|     71|      case 64000:
  ------------------
  |  Branch (71:7): [True: 49, False: 375]
  ------------------
   72|    125|      case 88200:
  ------------------
  |  Branch (72:7): [True: 54, False: 370]
  ------------------
   73|    147|      case 96000:
  ------------------
  |  Branch (73:7): [True: 22, False: 402]
  ------------------
   74|    147|        pstr_bandwidth_table = bandwidth_table_ld_48000;
   75|    147|        bandwidth_table_size =
   76|    147|            sizeof(bandwidth_table_ld_48000) / sizeof(ixheaace_bandwidth_table);
   77|    147|        break;
   78|     17|      case 44100:
  ------------------
  |  Branch (78:7): [True: 17, False: 407]
  ------------------
   79|     17|        pstr_bandwidth_table = bandwidth_table_ld_44100;
   80|     17|        bandwidth_table_size =
   81|     17|            sizeof(bandwidth_table_ld_44100) / sizeof(ixheaace_bandwidth_table);
   82|     17|        break;
   83|     21|      case 32000:
  ------------------
  |  Branch (83:7): [True: 21, False: 403]
  ------------------
   84|     21|        pstr_bandwidth_table = bandwidth_table_ld_32000;
   85|     21|        bandwidth_table_size =
   86|     21|            sizeof(bandwidth_table_ld_32000) / sizeof(ixheaace_bandwidth_table);
   87|     21|        break;
   88|     97|      case 24000:
  ------------------
  |  Branch (88:7): [True: 97, False: 327]
  ------------------
   89|     97|        pstr_bandwidth_table = bandwidth_table_ld_24000;
   90|     97|        bandwidth_table_size =
   91|     97|            sizeof(bandwidth_table_ld_24000) / sizeof(ixheaace_bandwidth_table);
   92|     97|        break;
   93|     46|      case 8000:
  ------------------
  |  Branch (93:7): [True: 46, False: 378]
  ------------------
   94|     73|      case 11025:
  ------------------
  |  Branch (94:7): [True: 27, False: 397]
  ------------------
   95|     86|      case 12000:
  ------------------
  |  Branch (95:7): [True: 13, False: 411]
  ------------------
   96|    127|      case 16000:
  ------------------
  |  Branch (96:7): [True: 41, False: 383]
  ------------------
   97|    142|      case 22050:
  ------------------
  |  Branch (97:7): [True: 15, False: 409]
  ------------------
   98|    142|        pstr_bandwidth_table = bandwidth_table_ld_22050;
   99|    142|        bandwidth_table_size =
  100|    142|            sizeof(bandwidth_table_ld_22050) / sizeof(ixheaace_bandwidth_table);
  101|    142|        break;
  102|    424|    }
  103|    424|  }
  104|  2.63k|  for (WORD32 i = 0; i < bandwidth_table_size - 1; i++) {
  ------------------
  |  Branch (104:22): [True: 2.63k, False: 0]
  ------------------
  105|  2.63k|    if (channel_bit_rate >= 96000) {
  ------------------
  |  Branch (105:9): [True: 152, False: 2.47k]
  ------------------
  106|    152|      if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|    304|#define AOT_AAC_LC (2)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|    235|#define AOT_SBR (5)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|     83|#define AOT_PS (29)
  ------------------
  |  Branch (106:11): [True: 69, False: 83]
  |  Branch (106:32): [True: 0, False: 83]
  |  Branch (106:50): [True: 0, False: 83]
  ------------------
  107|     69|        bandwidth = 20000;
  108|     83|      } else {
  109|     83|        if (num_ch == 1) {
  ------------------
  |  Branch (109:13): [True: 42, False: 41]
  ------------------
  110|     42|          bandwidth = 19000;
  111|     42|        } else {
  112|     41|          bandwidth = 22000;
  113|     41|        }
  114|     83|      }
  115|    152|      break;
  116|  2.47k|    } else if (channel_bit_rate >= pstr_bandwidth_table[i].channel_bit_rate &&
  ------------------
  |  Branch (116:16): [True: 2.47k, False: 0]
  ------------------
  117|  2.47k|               channel_bit_rate < pstr_bandwidth_table[i + 1].channel_bit_rate) {
  ------------------
  |  Branch (117:16): [True: 931, False: 1.54k]
  ------------------
  118|    931|      if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  1.86k|#define AOT_AAC_LC (2)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  1.38k|#define AOT_SBR (5)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|    341|#define AOT_PS (29)
  ------------------
  |  Branch (118:11): [True: 473, False: 458]
  |  Branch (118:32): [True: 117, False: 341]
  |  Branch (118:50): [True: 0, False: 341]
  ------------------
  119|    590|        bandwidth = (num_ch == 1) ? pstr_bandwidth_table[i].bandwidth_mono
  ------------------
  |  Branch (119:21): [True: 363, False: 227]
  ------------------
  120|    590|                                  : pstr_bandwidth_table[i].bandwidth_stereo;
  121|    590|        bandwidth = bandwidth - (pstr_bandwidth_table[i].channel_bit_rate / 32);
  122|    590|        break;
  123|    590|      } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|    682|#define AOT_AAC_LD (23)
  ------------------
                    } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|     54|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (123:18): [True: 287, False: 54]
  |  Branch (123:39): [True: 54, False: 0]
  ------------------
  124|    341|        WORD32 start_bandwidth, end_bandwidth, start_bitrate, end_bitrate;
  125|    341|        FLOAT32 bandwidth_fac;
  126|    341|        start_bandwidth = (num_ch == 1) ? pstr_bandwidth_table[i].bandwidth_mono
  ------------------
  |  Branch (126:27): [True: 218, False: 123]
  ------------------
  127|    341|                                        : pstr_bandwidth_table[i].bandwidth_stereo;
  128|    341|        start_bandwidth = start_bandwidth - (pstr_bandwidth_table[i].channel_bit_rate / 32);
  129|    341|        end_bandwidth = (num_ch == 1) ? pstr_bandwidth_table[i + 1].bandwidth_mono
  ------------------
  |  Branch (129:25): [True: 218, False: 123]
  ------------------
  130|    341|                                      : pstr_bandwidth_table[i + 1].bandwidth_stereo;
  131|    341|        end_bandwidth = end_bandwidth - (pstr_bandwidth_table[i + 1].channel_bit_rate / 32);
  132|    341|        start_bitrate = pstr_bandwidth_table[i].channel_bit_rate;
  133|    341|        end_bitrate = pstr_bandwidth_table[i + 1].channel_bit_rate;
  134|    341|        bandwidth_fac =
  135|    341|            (FLOAT32)((channel_bit_rate - start_bitrate) / (end_bitrate - start_bitrate));
  136|    341|        bandwidth = (WORD32)(bandwidth_fac * (end_bandwidth - start_bandwidth) + start_bandwidth);
  137|    341|        break;
  138|    341|      }
  139|    931|    }
  140|  2.63k|  }
  141|  1.08k|  return bandwidth;
  142|  1.08k|}

ia_enhaacplus_enc_aac_core_encode:
   69|   308k|    WORD32 *is_quant_spec_zero, WORD32 *is_gain_limited) {
   70|   308k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
   71|   308k|  iexheaac_encoder_str *pstr_aac_encoder = pstr_aac_enc[ele_idx];
   72|   308k|  ixheaace_element_info *pstr_element_info = &pstr_aac_encoder->element_info;
   73|   308k|  WORD32 glob_used_bits;
   74|   308k|  WORD32 anc_data_bytes, anc_data_bytes_left;
   75|   308k|  WORD32 stat_bits_flag = 0;
   76|   308k|  WORD32 frame_len_long = FRAME_LEN_1024;
  ------------------
  |  |   91|   308k|#define FRAME_LEN_1024 1024
  ------------------
   77|   308k|  WORD32 ch;
   78|       |
   79|   308k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   616k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   557k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (79:7): [True: 59.0k, False: 249k]
  |  Branch (79:28): [True: 125k, False: 123k]
  |  Branch (79:46): [True: 19.7k, False: 104k]
  ------------------
   80|   204k|    frame_len_long =
   81|   204k|        (pstr_aac_encoder->config.flag_framelength_small == 1) ? FRAME_LEN_960 : FRAME_LEN_1024;
  ------------------
  |  |   94|  79.0k|#define FRAME_LEN_960 960
  ------------------
                      (pstr_aac_encoder->config.flag_framelength_small == 1) ? FRAME_LEN_960 : FRAME_LEN_1024;
  ------------------
  |  |   91|   329k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (81:9): [True: 79.0k, False: 125k]
  ------------------
   82|   204k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   208k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  78.6k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (82:14): [True: 25.4k, False: 78.6k]
  |  Branch (82:35): [True: 78.6k, False: 0]
  ------------------
   83|   104k|    frame_len_long =
   84|   104k|        (pstr_aac_encoder->config.flag_framelength_small == 1) ? FRAME_LEN_480 : FRAME_LEN_512;
  ------------------
  |  |   93|  46.2k|#define FRAME_LEN_480 480
  ------------------
                      (pstr_aac_encoder->config.flag_framelength_small == 1) ? FRAME_LEN_480 : FRAME_LEN_512;
  ------------------
  |  |   92|   161k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (84:9): [True: 46.2k, False: 57.7k]
  ------------------
   85|   104k|  }
   86|       |
   87|   308k|  if (ele_idx == 0) {
  ------------------
  |  Branch (87:7): [True: 160k, False: 147k]
  ------------------
   88|   160k|    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   321k|#define AOT_AAC_LC (2)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   297k|#define AOT_SBR (5)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  83.0k|#define AOT_PS (29)
  ------------------
  |  Branch (88:9): [True: 24.3k, False: 136k]
  |  Branch (88:30): [True: 53.5k, False: 83.0k]
  |  Branch (88:48): [True: 19.7k, False: 63.3k]
  ------------------
   89|  97.5k|      ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
   90|  97.5k|          ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
   91|  97.5k|          (((pstr_aac_encoder->config.flag_framelength_small == 1) ? MAXIMUM_CHANNEL_BITS_960
  ------------------
  |  |   95|  38.5k|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  |  Branch (91:13): [True: 38.5k, False: 59.0k]
  ------------------
   92|  97.5k|                                                                   : MAXIMUM_CHANNEL_BITS_1024) /
  ------------------
  |  |   94|  59.0k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
   93|  97.5k|           8) *
   94|  97.5k|              total_channels);
   95|  97.5k|    } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   126k|#define AOT_AAC_LD (23)
  ------------------
                  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  52.5k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (95:16): [True: 10.8k, False: 52.5k]
  |  Branch (95:37): [True: 52.5k, False: 0]
  ------------------
   96|  63.3k|      if (pstr_aac_encoder->config.bitreservoir_size != -1) {
  ------------------
  |  Branch (96:11): [True: 60.7k, False: 2.57k]
  ------------------
   97|  60.7k|        WORD32 avg_byte_perframe = (pstr_aac_encoder->config.bit_rate * frame_len_long /
   98|  60.7k|                                    (pstr_aac_encoder->config.core_sample_rate * 8));
   99|       |
  100|  60.7k|        if ((pstr_aac_encoder->config.bitreservoir_size * total_channels) > avg_byte_perframe) {
  ------------------
  |  Branch (100:13): [True: 47.8k, False: 12.9k]
  ------------------
  101|  47.8k|          ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
  102|  47.8k|              ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
  103|  47.8k|              pstr_aac_encoder->config.bitreservoir_size * total_channels);
  104|  47.8k|        } else {
  105|  12.9k|          ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
  106|  12.9k|              ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
  107|  12.9k|              (pstr_aac_encoder->config.bit_rate * frame_len_long /
  108|  12.9k|               (pstr_aac_encoder->config.core_sample_rate * 8)));
  109|  12.9k|        }
  110|  60.7k|      } else {
  111|  2.57k|        ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
  112|  2.57k|            ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
  113|  2.57k|            (pstr_aac_encoder->config.bit_rate * frame_len_long /
  114|  2.57k|             (pstr_aac_encoder->config.core_sample_rate * 8)));
  115|  2.57k|      }
  116|  63.3k|    }
  117|   160k|  } else {
  118|   147k|    ptr_bit_stream_handle = ptr_bit_stream;
  119|   147k|  }
  120|       |
  121|   308k|  if (adts_flag) {
  ------------------
  |  Branch (121:7): [True: 78.9k, False: 229k]
  ------------------
  122|  78.9k|    stat_bits_flag = 0; /* fix for low bit-rate */
  123|  78.9k|    if ((pstr_aac_encoder->config.core_sample_rate * 3) <= (pstr_aac_encoder->config.bit_rate)) {
  ------------------
  |  Branch (123:9): [True: 27.1k, False: 51.8k]
  ------------------
  124|  27.1k|      stat_bits_flag = 7; /* fix for low bit-rate */
  125|  27.1k|    }
  126|  78.9k|  }
  127|       |
  128|   308k|  anc_data_bytes = anc_data_bytes_left = *num_anc_bytes;
  129|       |
  130|   308k|  if (pstr_element_info->el_type == ID_CPE) {
  ------------------
  |  Branch (130:7): [True: 140k, False: 167k]
  ------------------
  131|   140k|    if (!pstr_aac_encoder->config.num_stereo_preprocessing) {
  ------------------
  |  Branch (131:9): [True: 140k, False: 0]
  ------------------
  132|   140k|      iaace_apply_stereo_preproc(&pstr_aac_encoder->str_stereo_pre_pro, time_sn_stride,
  133|   140k|                                 pstr_element_info, ptr_time_signal, frame_len_long);
  134|   140k|    }
  135|   140k|  }
  136|       |
  137|   308k|  err_code = ia_enhaacplus_enc_psy_main(
  138|   308k|      time_sn_stride, pstr_element_info, ptr_time_signal, aot,
  139|   308k|      pstr_aac_encoder->psy_kernel.psy_data,
  140|   308k|      pstr_aac_encoder->psy_kernel.temporal_noise_shaping_data,
  141|   308k|      &pstr_aac_encoder->psy_kernel.psy_conf_long, &pstr_aac_encoder->psy_kernel.psy_conf_short,
  142|   308k|      pstr_aac_encoder->psy_out.psy_out_ch,
  143|   308k|      &pstr_aac_encoder->psy_out.psy_out_element,
  144|   308k|      pstr_aac_encoder->psy_kernel.p_scratch_tns_float,
  145|   308k|      (FLOAT32 *)pstr_aac_encoder->pstr_aac_scratch->shared_buffer1,
  146|   308k|      pstr_aac_encoder->pstr_aac_scratch->shared_buffer5, pstr_aac_tabs, frame_len_long);
  147|       |
  148|   308k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (148:7): [True: 0, False: 308k]
  ------------------
  149|      0|    return err_code;
  150|      0|  }
  151|       |
  152|   308k|  ia_enhaacplus_enc_adjust_bitrate(
  153|   308k|      &pstr_aac_encoder->qc_kernel, pstr_aac_encoder->config.bit_rate,
  154|   308k|      pstr_aac_encoder->config.core_sample_rate, flag_last_element, frame_len_long);
  155|       |
  156|   757k|  for (ch = 0; ch < pstr_element_info->n_channels_in_el; ch++) {
  ------------------
  |  Branch (156:16): [True: 449k, False: 308k]
  ------------------
  157|   449k|    pstr_aac_encoder->psy_out.psy_out_ch[ch]->ms_digest =
  158|   449k|        pstr_aac_encoder->psy_out.psy_out_element.tools_info.ms_digest;
  159|       |
  160|   449k|    memcpy(
  161|   449k|        &pstr_aac_encoder->psy_out.psy_out_ch[ch]->ms_used[0],
  162|   449k|        &pstr_aac_encoder->psy_out.psy_out_element.tools_info.ms_mask[0],
  163|   449k|        MAXIMUM_GROUPED_SCALE_FACTOR_BAND *
  ------------------
  |  |   73|   449k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|   449k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|   449k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|   449k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 449k, Folded]
  |  |  ------------------
  |  |   74|   449k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|   449k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|   449k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|   449k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  164|   449k|            sizeof(pstr_aac_encoder->psy_out.psy_out_ch[ch]->ms_used[0]));
  165|   449k|  }
  166|       |
  167|   308k|  err_code = ia_enhaacplus_enc_qc_main(
  168|   308k|      &pstr_aac_encoder->qc_kernel, pstr_element_info->n_channels_in_el,
  169|   308k|      &pstr_aac_encoder->qc_kernel.element_bits,
  170|   308k|      pstr_aac_encoder->psy_out.psy_out_ch,
  171|   308k|      &pstr_aac_encoder->psy_out.psy_out_element,
  172|   308k|      pstr_aac_encoder->qc_out.qc_channel,
  173|   308k|      &pstr_aac_encoder->qc_out.qc_element, MIN(anc_data_bytes_left, anc_data_bytes),
  ------------------
  |  |   23|   308k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 308k]
  |  |  ------------------
  ------------------
  174|   308k|      pstr_aac_tabs, adts_flag, aot, stat_bits_flag, flag_last_element, frame_len_long,
  175|   308k|      pstr_aac_encoder->pstr_aac_scratch->shared_buffer5, is_quant_spec_zero,
  176|   308k|      is_gain_limited);
  177|       |
  178|   308k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (178:7): [True: 278, False: 308k]
  ------------------
  179|    278|    return err_code;
  180|    278|  }
  181|       |
  182|   308k|  if (pstr_element_info->el_type == ID_CPE) {
  ------------------
  |  Branch (182:7): [True: 140k, False: 167k]
  ------------------
  183|   140k|    if (!pstr_aac_encoder->config.num_stereo_preprocessing) {
  ------------------
  |  Branch (183:9): [True: 140k, False: 0]
  ------------------
  184|   140k|      iaace_update_stereo_pre_process(
  185|   140k|          pstr_aac_encoder->psy_out.psy_out_ch,
  186|   140k|          &pstr_aac_encoder->qc_out.qc_element, &pstr_aac_encoder->str_stereo_pre_pro,
  187|   140k|          pstr_aac_encoder->psy_out.psy_out_element.weight_ms_lr_pe_ratio);
  188|   140k|    }
  189|   140k|  }
  190|       |
  191|       |  /* Update bit reservoir levels */
  192|   308k|  ia_enhaacplus_enc_update_bit_reservoir(&pstr_aac_encoder->qc_kernel, &pstr_aac_encoder->qc_out);
  193|       |
  194|   308k|  err_code = ia_enhaacplus_enc_finalize_bit_consumption(
  195|   308k|      &pstr_aac_encoder->qc_kernel, &pstr_aac_encoder->qc_out, flag_last_element,
  196|   308k|      ((ixheaace_bit_buf_handle)ptr_bit_stream_handle)->cnt_bits, total_fill_bits, pstr_aac_enc,
  197|   308k|      num_bs_elements, aot);
  198|       |
  199|   308k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (199:7): [True: 0, False: 308k]
  ------------------
  200|      0|    return err_code;
  201|      0|  }
  202|       |
  203|   308k|  err_code = ia_enhaacplus_enc_write_bitstream(
  204|   308k|      ptr_bit_stream_handle, *pstr_element_info, &pstr_aac_encoder->qc_out,
  205|   308k|      &pstr_aac_encoder->psy_out, &glob_used_bits, ptr_anc_bytes, pstr_aac_tabs,
  206|   308k|      flag_last_element, write_program_config_element, i_num_coup_channels, i_channels_mask,
  207|   308k|      pstr_aac_encoder->config.core_sample_rate, ele_idx, aot, total_fill_bits);
  208|   308k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (208:7): [True: 651, False: 307k]
  ------------------
  209|    651|    return err_code;
  210|    651|  }
  211|       |  /* write out the bitstream */
  212|   307k|  *num_out_bytes = ia_enhaacplus_enc_get_bits_available(ptr_bit_stream_handle) / 8;
  213|       |
  214|       |  /* Validate that this frame is not too large */
  215|   307k|  if (pstr_aac_encoder->config.bitreservoir_size != -1) {
  ------------------
  |  Branch (215:7): [True: 248k, False: 59.3k]
  ------------------
  216|   248k|    WORD32 avg_bytes_perframe = (pstr_aac_encoder->config.bit_rate * frame_len_long /
  217|   248k|                                 (pstr_aac_encoder->config.core_sample_rate * 8));
  218|       |
  219|   248k|    if (pstr_aac_encoder->config.bitreservoir_size * total_channels > avg_bytes_perframe) {
  ------------------
  |  Branch (219:9): [True: 212k, False: 35.9k]
  ------------------
  220|   212k|      if (*num_out_bytes > (pstr_aac_encoder->config.bitreservoir_size * total_channels)) {
  ------------------
  |  Branch (220:11): [True: 4.10k, False: 208k]
  ------------------
  221|  4.10k|        err_code = IA_EXHEAACE_EXE_FATAL_INVALID_OUT_BYTES;
  222|  4.10k|      }
  223|   212k|    } else {
  224|  35.9k|      if (*num_out_bytes > avg_bytes_perframe) {
  ------------------
  |  Branch (224:11): [True: 7.33k, False: 28.6k]
  ------------------
  225|  7.33k|        err_code = IA_EXHEAACE_EXE_FATAL_INVALID_OUT_BYTES;
  226|  7.33k|      }
  227|  35.9k|    }
  228|   248k|  } else {
  229|  59.3k|    WORD32 avg_bytes_perframe = (pstr_aac_encoder->config.bit_rate * frame_len_long /
  230|  59.3k|                                 (pstr_aac_encoder->config.core_sample_rate * 8));
  231|  59.3k|    if (*num_out_bytes > avg_bytes_perframe) {
  ------------------
  |  Branch (231:9): [True: 28.4k, False: 30.9k]
  ------------------
  232|  28.4k|      err_code = IA_EXHEAACE_EXE_FATAL_INVALID_OUT_BYTES;
  233|  28.4k|    }
  234|  59.3k|  }
  235|       |
  236|   307k|  return err_code;
  237|   308k|}

iusace_fd_encode:
   60|   239k|                              WORD32 *is_quant_spec_zero, WORD32 *is_gain_limited) {
   61|   239k|  iusace_scratch_mem *pstr_scratch = &pstr_usac_data->str_scratch;
   62|   239k|  IA_ERRORCODE err_code = 0;
   63|   239k|  WORD32 i_ch, idx = 0;
   64|   239k|  WORD32 *ptr_num_fac_bits = pstr_scratch->ptr_num_fac_bits;
   65|   239k|  WORD32 tns_data_present[2] = {0};
   66|   239k|  WORD32 *ptr_core_mode_next = pstr_usac_data->core_mode_next;
   67|   239k|  WORD32 *ptr_core_mode_prev = pstr_usac_data->core_mode_prev;
   68|   239k|  *bit_written = 0;
   69|   239k|  memset(pstr_scratch->ptr_num_fac_bits, 0,
   70|   239k|         MAX_TIME_CHANNELS * sizeof(pstr_scratch->ptr_num_fac_bits[0]));
  ------------------
  |  |   56|   239k|#define MAX_TIME_CHANNELS (2)
  ------------------
   71|   667k|  for (i_ch = chn; i_ch < chn + nr_core_coder_ch; i_ch++) {
  ------------------
  |  Branch (71:20): [True: 427k, False: 239k]
  ------------------
   72|   427k|    tns_data_present[idx] = pstr_usac_data->pstr_tns_info[i_ch] != NULL;
   73|       |
   74|   427k|    if (tns_data_present[idx]) {
  ------------------
  |  Branch (74:9): [True: 209k, False: 218k]
  ------------------
   75|   209k|      tns_data_present[idx] = pstr_usac_data->pstr_tns_info[i_ch]->tns_data_present;
   76|   209k|    }
   77|   427k|    idx++;
   78|   427k|  }
   79|       |
   80|   239k|  idx = 0;
   81|   667k|  for (i_ch = chn; i_ch < chn + nr_core_coder_ch; i_ch++) {
  ------------------
  |  Branch (81:20): [True: 427k, False: 239k]
  ------------------
   82|   427k|    memset(pstr_scratch->p_reconstructed_time_signal[idx], 0, 4096 * sizeof(FLOAT64));
   83|   427k|    err_code = iusace_fd_fac(
   84|   427k|        pstr_sfb_prms->grouped_sfb_offset[i_ch], pstr_sfb_prms->max_sfb[i_ch],
   85|   427k|        pstr_usac_data->ptr_2frame_time_data[i_ch], pstr_sfb_prms->window_sequence[i_ch],
   86|   427k|        pstr_scratch->p_reconstructed_time_signal[idx], pstr_usac_data->td_encoder[i_ch],
   87|   427k|        ((pstr_usac_data->td_encoder[i_ch]->prev_mode == 0) && ptr_core_mode_prev[i_ch]) ==
  ------------------
  |  Branch (87:10): [True: 419k, False: 8.66k]
  |  Branch (87:64): [True: 1.75k, False: 417k]
  ------------------
   88|   427k|            CORE_MODE_TD,
  ------------------
  |  |   34|   427k|#define CORE_MODE_TD (1)
  ------------------
   89|   427k|        ptr_core_mode_next[i_ch] == CORE_MODE_TD, pstr_usac_data->fac_out_stream[i_ch],
  ------------------
  |  |   34|   427k|#define CORE_MODE_TD (1)
  ------------------
   90|   427k|        &ptr_num_fac_bits[i_ch], pstr_scratch);
   91|   427k|    if (err_code) {
  ------------------
  |  Branch (91:9): [True: 0, False: 427k]
  ------------------
   92|      0|      return err_code;
   93|      0|    }
   94|   427k|    idx++;
   95|   427k|  }
   96|       |
   97|   239k|  err_code = iusace_quantize_spec(pstr_sfb_prms, usac_independancy_flag, nr_core_coder_ch,
   98|   239k|                                  pstr_usac_data, pstr_usac_config, chn, ele_id,
   99|   239k|                                  is_quant_spec_zero, is_gain_limited);
  100|   239k|  if (err_code) return err_code;
  ------------------
  |  Branch (100:7): [True: 5.55k, False: 233k]
  ------------------
  101|       |
  102|   650k|  for (i_ch = chn; i_ch < chn + nr_core_coder_ch; i_ch++) {
  ------------------
  |  Branch (102:20): [True: 416k, False: 233k]
  ------------------
  103|   416k|    pstr_sfb_prms->window_shape[i_ch] =
  104|   416k|        pstr_usac_data->str_psy_mod.str_psy_out_data[i_ch].window_shape;
  105|   416k|  }
  106|       |
  107|   233k|  if (nr_core_coder_ch == 1) {
  ------------------
  |  Branch (107:7): [True: 51.3k, False: 182k]
  ------------------
  108|  51.3k|    iusace_write_bits_buf(pstr_it_bit_buff, tns_data_present[0], 1);
  109|  51.3k|    *bit_written = *bit_written + 1;
  110|  51.3k|  }
  111|   233k|  if (nr_core_coder_ch == 2) {
  ------------------
  |  Branch (111:7): [True: 182k, False: 51.3k]
  ------------------
  112|   182k|    *bit_written = *bit_written + iusace_write_cpe(pstr_sfb_prms, pstr_it_bit_buff,
  113|   182k|                                                   tns_data_present, usac_independancy_flag,
  114|   182k|                                                   pstr_usac_config, pstr_usac_data, chn);
  115|   182k|  }
  116|       |
  117|   233k|  idx = 0;
  118|   650k|  for (i_ch = chn; i_ch < chn + nr_core_coder_ch; i_ch++) {
  ------------------
  |  Branch (118:20): [True: 416k, False: 233k]
  ------------------
  119|   416k|    *bit_written =
  120|   416k|        *bit_written + iusace_write_fd_data(pstr_it_bit_buff, pstr_sfb_prms,
  121|   416k|                                            ptr_num_fac_bits[i_ch], usac_independancy_flag,
  122|   416k|                                            pstr_usac_data, pstr_usac_config, i_ch, ele_id, idx);
  123|   416k|    idx++;
  124|   416k|  }
  125|       |
  126|   233k|  return err_code;
  127|   239k|}

iusace_fd_mdct:
  204|   427k|                      ia_usac_encoder_config_struct *pstr_usac_config, WORD32 ch_idx) {
  205|   427k|  IA_ERRORCODE err_code = 0;
  206|   427k|  WORD32 window_sequence = pstr_usac_config->window_sequence[ch_idx];
  207|       |
  208|   427k|  if (window_sequence != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (208:7): [True: 285k, False: 142k]
  ------------------
  209|   285k|    err_code = iusace_fd_mdct_long(pstr_usac_data, pstr_usac_config, ch_idx, window_sequence);
  210|   285k|  } else {
  211|   142k|    err_code = iusace_fd_mdct_short(pstr_usac_data, pstr_usac_config, ch_idx);
  212|   142k|  }
  213|       |
  214|   427k|  return err_code;
  215|   427k|}
ixheaace_fd_mdct.c:iusace_fd_mdct_long:
  125|   285k|                                        WORD32 ch_idx, WORD32 window_sequence) {
  126|   285k|  IA_ERRORCODE err_code = 0;
  127|   285k|  iusace_scratch_mem *pstr_scratch = &pstr_usac_data->str_scratch;
  128|   285k|  IA_ERRORCODE err_code_2 = 0;
  129|   285k|  FLOAT64 *ptr_windowed_buf = pstr_scratch->p_fd_mdct_windowed_long_buf;
  130|   285k|  WORD32 n_long = pstr_usac_config->ccfl;
  131|   285k|  WORD32 n_short = pstr_usac_config->ccfl >> 3;
  132|   285k|  WORD32 prev_mode = (pstr_usac_data->core_mode_prev[ch_idx] == CORE_MODE_TD);
  ------------------
  |  |   34|   285k|#define CORE_MODE_TD (1)
  ------------------
  133|   285k|  WORD32 next_mode = (pstr_usac_data->core_mode_next[ch_idx] == CORE_MODE_TD);
  ------------------
  |  |   34|   285k|#define CORE_MODE_TD (1)
  ------------------
  134|   285k|  FLOAT64 *ptr_in_data = pstr_usac_data->ptr_time_data[ch_idx];
  135|   285k|  FLOAT64 *ptr_out_mdct = pstr_usac_data->spectral_line_vector[ch_idx];
  136|   285k|  FLOAT64 *ptr_out_mdst = pstr_usac_data->mdst_spectrum[ch_idx];
  137|   285k|  WORD32 window_shape = pstr_usac_config->window_shape_prev[ch_idx];
  138|   285k|  FLOAT64 *ptr_win_long = NULL, *ptr_win_med = NULL;
  139|   285k|  WORD32 win_len;
  140|   285k|  FLOAT64 *ptr_overlap = pstr_usac_data->overlap_buf[ch_idx];
  141|       |
  142|   285k|  WORD32 nflat_ls;
  143|       |
  144|   285k|  memset(ptr_windowed_buf, 0, 2 * n_long * sizeof(*ptr_windowed_buf));
  145|       |
  146|   285k|  switch (window_sequence) {
  ------------------
  |  Branch (146:11): [True: 285k, False: 0]
  ------------------
  147|   197k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|   197k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (147:5): [True: 197k, False: 88.0k]
  ------------------
  148|   197k|      err_code = iusace_calc_window(&ptr_win_long, n_long, window_shape);
  149|   197k|      if (err_code) return err_code;
  ------------------
  |  Branch (149:11): [True: 0, False: 197k]
  ------------------
  150|   197k|      iusace_windowing_long(ptr_overlap, ptr_win_long, ptr_windowed_buf, ptr_in_data, n_long);
  151|   197k|      break;
  152|       |
  153|  46.0k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   46|  46.0k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (153:5): [True: 46.0k, False: 239k]
  ------------------
  154|  46.0k|      win_len = n_short << next_mode;
  155|  46.0k|      nflat_ls = (n_long - win_len) >> 1;
  156|  46.0k|      err_code = iusace_calc_window(&ptr_win_long, n_long, window_shape);
  157|  46.0k|      if (err_code) return err_code;
  ------------------
  |  Branch (157:11): [True: 0, False: 46.0k]
  ------------------
  158|  46.0k|      err_code = iusace_calc_window(&ptr_win_med, win_len, 0);
  159|  46.0k|      if (err_code) return err_code;
  ------------------
  |  Branch (159:11): [True: 0, False: 46.0k]
  ------------------
  160|       |
  161|  46.0k|      iusace_windowing_long_start(ptr_overlap, ptr_win_long, ptr_windowed_buf, ptr_in_data,
  162|  46.0k|                                  n_long, nflat_ls, ptr_win_med, win_len);
  163|  46.0k|      break;
  164|       |
  165|  41.9k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|  41.9k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (165:5): [True: 41.9k, False: 243k]
  ------------------
  166|  41.9k|      win_len = n_short << prev_mode;
  167|  41.9k|      nflat_ls = (n_long - win_len) >> 1;
  168|  41.9k|      err_code = iusace_calc_window(&ptr_win_long, n_long, 1);
  169|  41.9k|      if (err_code) return err_code;
  ------------------
  |  Branch (169:11): [True: 0, False: 41.9k]
  ------------------
  170|  41.9k|      err_code = iusace_calc_window(&ptr_win_med, win_len, window_shape);
  171|  41.9k|      if (err_code) return err_code;
  ------------------
  |  Branch (171:11): [True: 0, False: 41.9k]
  ------------------
  172|  41.9k|      iusace_windowing_long_stop(ptr_overlap, ptr_win_long, ptr_windowed_buf, ptr_in_data, n_long,
  173|  41.9k|                                 nflat_ls, ptr_win_med, win_len);
  174|  41.9k|      break;
  175|       |
  176|      0|    case STOP_START_SEQUENCE:
  ------------------
  |  |   49|      0|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (176:5): [True: 0, False: 285k]
  ------------------
  177|      0|      win_len = n_short << (prev_mode | next_mode);
  178|      0|      err_code = iusace_calc_window(&ptr_win_med, win_len, window_shape);
  179|      0|      if (err_code) return err_code;
  ------------------
  |  Branch (179:11): [True: 0, False: 0]
  ------------------
  180|       |
  181|      0|      iusace_windowing_stop_start(ptr_overlap, ptr_windowed_buf, ptr_win_med, win_len, n_long);
  182|      0|      break;
  183|   285k|  }
  184|       |
  185|       |  // Compute MDCT
  186|   285k|  err_code =
  187|   285k|      iusace_fft_based_mdct(ptr_windowed_buf, ptr_out_mdct, n_long, MDCT_TX_FLAG, pstr_scratch);
  ------------------
  |  |  193|   285k|#define MDCT_TX_FLAG (1)
  ------------------
  188|   285k|  if (err_code) {
  ------------------
  |  Branch (188:7): [True: 0, False: 285k]
  ------------------
  189|      0|    return err_code;
  190|      0|  }
  191|       |
  192|       |  // Compute MDST
  193|   285k|  err_code_2 =
  194|   285k|      iusace_fft_based_mdct(ptr_windowed_buf, ptr_out_mdst, n_long, MDST_TX_FLAG, pstr_scratch);
  ------------------
  |  |  192|   285k|#define MDST_TX_FLAG (0)
  ------------------
  195|       |
  196|   285k|  if (err_code_2) {
  ------------------
  |  Branch (196:7): [True: 0, False: 285k]
  ------------------
  197|      0|    return err_code_2;
  198|      0|  }
  199|       |
  200|   285k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   285k|#define IA_NO_ERROR 0x00000000
  ------------------
  201|   285k|}
ixheaace_fd_mdct.c:iusace_fd_mdct_short:
   59|   142k|                                         WORD32 ch_idx) {
   60|   142k|  IA_ERRORCODE err_code = 0;
   61|   142k|  iusace_scratch_mem *pstr_scratch = &pstr_usac_data->str_scratch;
   62|   142k|  IA_ERRORCODE err_code_2 = 0;
   63|   142k|  FLOAT64 *ptr_windowed_buf = pstr_scratch->p_fd_mdct_windowed_short_buf;
   64|   142k|  WORD32 n_long = pstr_usac_config->ccfl;
   65|   142k|  WORD32 n_short = pstr_usac_config->ccfl >> 3;
   66|   142k|  FLOAT64 *ptr_in_data = pstr_usac_data->ptr_time_data[ch_idx];
   67|   142k|  FLOAT64 *ptr_out_mdct = pstr_usac_data->spectral_line_vector[ch_idx];
   68|   142k|  FLOAT64 *ptr_out_mdst = pstr_usac_data->mdst_spectrum[ch_idx];
   69|   142k|  WORD32 window_shape = pstr_usac_config->window_shape_prev[ch_idx];
   70|   142k|  FLOAT64 *ptr_win_gen_medium = NULL, *ptr_win_gen_short = NULL;
   71|   142k|  FLOAT64 *ptr_overlap = pstr_usac_data->overlap_buf[ch_idx];
   72|   142k|  WORD32 nflat_ls;
   73|   142k|  WORD32 i, k;
   74|   142k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|   142k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|   142k|#define LEN_SUPERFRAME (1024)
  ------------------
   75|       |
   76|   142k|  memset(ptr_windowed_buf, 0, 2 * n_short * sizeof(FLOAT64));
   77|   142k|  nflat_ls = (n_long - n_short) >> 1;
   78|   142k|  err_code = iusace_calc_window(&ptr_win_gen_short, n_short, window_shape);
   79|   142k|  if (err_code) return err_code;
  ------------------
  |  Branch (79:7): [True: 0, False: 142k]
  ------------------
   80|   142k|  err_code = iusace_calc_window(&ptr_win_gen_medium, n_short, 0);
   81|   142k|  if (err_code) return err_code;
  ------------------
  |  Branch (81:7): [True: 0, False: 142k]
  ------------------
   82|   142k|  ptr_overlap += nflat_ls;
   83|       |
   84|  1.28M|  for (k = MAX_SHORT_WINDOWS - 1; k-- >= 0;) {
  ------------------
  |  |   52|   142k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (84:35): [True: 1.13M, False: 142k]
  ------------------
   85|   134M|    for (i = 0; i < n_short; i++) {
  ------------------
  |  Branch (85:17): [True: 133M, False: 1.13M]
  ------------------
   86|   133M|      ptr_windowed_buf[i] = ptr_win_gen_short[i] * ptr_overlap[i];
   87|   133M|    }
   88|   134M|    for (i = 0; i < n_short; i++) {
  ------------------
  |  Branch (88:17): [True: 133M, False: 1.13M]
  ------------------
   89|   133M|      ptr_windowed_buf[i + n_short] =
   90|   133M|          ptr_win_gen_medium[n_short - 1 - i] * ptr_overlap[i + n_short];
   91|   133M|    }
   92|       |
   93|  1.13M|    ptr_win_gen_medium = ptr_win_gen_short;
   94|       |
   95|       |    // Compute MDCT
   96|  1.13M|    err_code = iusace_fft_based_mdct(ptr_windowed_buf, ptr_out_mdct, n_short, MDCT_TX_FLAG,
  ------------------
  |  |  193|  1.13M|#define MDCT_TX_FLAG (1)
  ------------------
   97|  1.13M|                                     pstr_scratch);
   98|       |
   99|  1.13M|    if (err_code) {
  ------------------
  |  Branch (99:9): [True: 0, False: 1.13M]
  ------------------
  100|      0|      return err_code;
  101|      0|    }
  102|       |
  103|       |    // Compute MDST
  104|  1.13M|    err_code_2 = iusace_fft_based_mdct(ptr_windowed_buf, ptr_out_mdst, n_short, MDST_TX_FLAG,
  ------------------
  |  |  192|  1.13M|#define MDST_TX_FLAG (0)
  ------------------
  105|  1.13M|                                       pstr_scratch);
  106|       |
  107|  1.13M|    if (err_code_2) {
  ------------------
  |  Branch (107:9): [True: 0, False: 1.13M]
  ------------------
  108|      0|      return err_code_2;
  109|      0|    }
  110|       |
  111|  1.13M|    ptr_out_mdct += n_short;
  112|  1.13M|    ptr_out_mdst += n_short;
  113|  1.13M|    ptr_overlap += n_short;
  114|  1.13M|  }
  115|       |
  116|   142k|  ptr_overlap = pstr_usac_data->overlap_buf[ch_idx];
  117|   142k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(*ptr_overlap));
  118|   142k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(*ptr_overlap));
  119|       |
  120|   142k|  return err_code;
  121|   142k|}

iusace_bits_to_pe:
   56|   614k|FLOAT32 iusace_bits_to_pe(const FLOAT32 bits) { return (bits * 1.18f); }
iusace_adj_thr_init:
   59|  3.35k|                         WORD32 ch_bitrate) {
   60|  3.35k|  ia_min_snr_adapt_param_struct *pstr_min_snr_params =
   61|  3.35k|      &pstr_adj_thr_ele->str_min_snr_adapt_params;
   62|       |
   63|  3.35k|  pstr_adj_thr_ele->pe_min = (FLOAT32)0.8f * mean_pe;
   64|  3.35k|  pstr_adj_thr_ele->pe_max = (FLOAT32)1.2f * mean_pe;
   65|  3.35k|  pstr_adj_thr_ele->pe_offset = 0.0f;
   66|       |
   67|  3.35k|  if (ch_bitrate < 32000) {
  ------------------
  |  Branch (67:7): [True: 55, False: 3.30k]
  ------------------
   68|     55|    pstr_adj_thr_ele->pe_offset =
   69|     55|        MAX((FLOAT32)50.0f, (FLOAT32)(100.0f) - (FLOAT32)(100.0f / 32000) * (FLOAT32)ch_bitrate);
  ------------------
  |  |   89|     55|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 55, False: 0]
  |  |  ------------------
  ------------------
   70|     55|  }
   71|       |
   72|  3.35k|  if (ch_bitrate > 20000) {
  ------------------
  |  Branch (72:7): [True: 3.33k, False: 25]
  ------------------
   73|  3.33k|    pstr_adj_thr_ele->str_ah_param.modify_min_snr = TRUE;
  ------------------
  |  |   23|  3.33k|#define TRUE (1)
  ------------------
   74|  3.33k|    pstr_adj_thr_ele->str_ah_param.start_sfb_long = 15;
   75|  3.33k|    pstr_adj_thr_ele->str_ah_param.start_sfb_short = 3;
   76|  3.33k|  } else {
   77|     25|    pstr_adj_thr_ele->str_ah_param.modify_min_snr = FALSE;
  ------------------
  |  |   26|     25|#define FALSE (0)
  ------------------
   78|     25|    pstr_adj_thr_ele->str_ah_param.start_sfb_long = 0;
   79|     25|    pstr_adj_thr_ele->str_ah_param.start_sfb_short = 0;
   80|     25|  }
   81|       |
   82|  3.35k|  pstr_min_snr_params->max_red = (FLOAT32)0.25f;
   83|       |
   84|  3.35k|  pstr_min_snr_params->start_ratio = (FLOAT32)10.0f;
   85|       |
   86|  3.35k|  pstr_min_snr_params->max_ratio = (FLOAT32)1000.0f;
   87|       |
   88|  3.35k|  pstr_min_snr_params->red_ratio_fac =
   89|  3.35k|      (1.0f - pstr_min_snr_params->max_red) /
   90|  3.35k|      (10.0f * (FLOAT32)log10(pstr_min_snr_params->start_ratio / pstr_min_snr_params->max_ratio));
   91|       |
   92|  3.35k|  pstr_min_snr_params->red_offs = 1.0f - pstr_min_snr_params->red_ratio_fac * 10.0f *
   93|  3.35k|                                             (FLOAT32)log10(pstr_min_snr_params->start_ratio);
   94|       |
   95|  3.35k|  pstr_adj_thr_ele->pe_last = (FLOAT32)0.0f;
   96|  3.35k|  pstr_adj_thr_ele->dyn_bits_last = 0;
   97|  3.35k|  pstr_adj_thr_ele->pe_correction_fac = (FLOAT32)1.0f;
   98|  3.35k|}
iusace_adj_thr:
  874|   239k|                            WORD32 num_channels, WORD32 chn, iusace_scratch_mem *pstr_scratch) {
  875|   239k|  IA_ERRORCODE err_code;
  876|   239k|  FLOAT32 no_red_pe, granted_pe, granted_pe_corr;
  877|   239k|  WORD32 curr_win_sequence;
  878|   239k|  ia_qc_pe_data_struct *pstr_qc_pe_data = (ia_qc_pe_data_struct *)pstr_scratch->ptr_fd_scratch;
  879|   239k|  pUWORD8 ptr_scratch = pstr_scratch->ptr_fd_scratch + sizeof(ia_qc_pe_data_struct);
  880|   239k|  FLOAT32 bit_factor;
  881|   239k|  WORD32 ch;
  882|       |
  883|   239k|  pstr_qc_pe_data->pe_ch_data[0].sfb_lines = pstr_scratch->ptr_sfb_num_relevant_lines[0];
  884|   239k|  pstr_qc_pe_data->pe_ch_data[0].sfb_ld_energy = pstr_scratch->ptr_sfb_ld_energy[0];
  885|   239k|  if (num_channels == 2) {
  ------------------
  |  Branch (885:7): [True: 188k, False: 51.3k]
  ------------------
  886|   188k|    pstr_qc_pe_data->pe_ch_data[1].sfb_lines = pstr_scratch->ptr_sfb_num_relevant_lines[1];
  887|   188k|    pstr_qc_pe_data->pe_ch_data[1].sfb_ld_energy = pstr_scratch->ptr_sfb_ld_energy[1];
  888|   188k|  }
  889|   239k|  pstr_qc_pe_data->offset = pstr_adj_thr_elem->pe_offset;
  890|       |
  891|   239k|  iusace_calc_sfb_pe_data(pstr_qc_pe_data, pstr_psy_out, num_channels, chn);
  892|   239k|  no_red_pe = pstr_qc_pe_data->pe;
  893|       |
  894|   239k|  curr_win_sequence = ONLY_LONG_SEQUENCE;
  ------------------
  |  |   45|   239k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  895|   239k|  if (num_channels == 2) {
  ------------------
  |  Branch (895:7): [True: 188k, False: 51.3k]
  ------------------
  896|   188k|    if ((pstr_psy_out[chn].window_sequence == EIGHT_SHORT_SEQUENCE) ||
  ------------------
  |  |   40|   188k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (896:9): [True: 64.4k, False: 123k]
  ------------------
  897|   123k|        (pstr_psy_out[chn + 1].window_sequence == EIGHT_SHORT_SEQUENCE)) {
  ------------------
  |  |   40|   123k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (897:9): [True: 0, False: 123k]
  ------------------
  898|  64.4k|      curr_win_sequence = EIGHT_SHORT_SEQUENCE;
  ------------------
  |  |   40|  64.4k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  899|  64.4k|    }
  900|   188k|  } else {
  901|  51.3k|    curr_win_sequence = pstr_psy_out[chn].window_sequence;
  902|  51.3k|  }
  903|       |
  904|   239k|  bit_factor =
  905|   239k|      iusace_bitres_calc_bitfac(bitres_bits, max_bitres_bits, no_red_pe + 5.0f * side_info_bits,
  906|   239k|                                curr_win_sequence, avg_bits, *max_bit_fac, pstr_adj_thr_elem);
  907|   239k|  granted_pe = bit_factor * iusace_bits_to_pe((FLOAT32)avg_bits);
  908|   239k|  iusace_calc_pe_correction(&(pstr_adj_thr_elem->pe_correction_fac), MIN(granted_pe, no_red_pe),
  ------------------
  |  |   86|   239k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 124k, False: 115k]
  |  |  ------------------
  ------------------
  909|   239k|                            pstr_adj_thr_elem->pe_last, pstr_adj_thr_elem->dyn_bits_last);
  910|   239k|  granted_pe_corr = granted_pe * pstr_adj_thr_elem->pe_correction_fac;
  911|       |
  912|   239k|  if (granted_pe_corr < no_red_pe) {
  ------------------
  |  Branch (912:7): [True: 124k, False: 114k]
  ------------------
  913|   124k|    err_code = iusace_adapt_thr_to_pe(
  914|   124k|        pstr_psy_out, pstr_qc_pe_data, granted_pe_corr, &pstr_adj_thr_elem->str_ah_param,
  915|   124k|        &pstr_adj_thr_elem->str_min_snr_adapt_params, num_channels, chn, ptr_scratch);
  916|   124k|    if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   124k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (916:9): [True: 0, False: 124k]
  ------------------
  917|      0|      return err_code;
  918|      0|    }
  919|   124k|  }
  920|       |
  921|   667k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (921:16): [True: 427k, False: 239k]
  ------------------
  922|   427k|    FLOAT32 tmp_var, temp1;
  923|   427k|    if (pstr_qc_pe_data->pe) {
  ------------------
  |  Branch (923:9): [True: 391k, False: 35.8k]
  ------------------
  924|   391k|      tmp_var = 1.0f - num_channels * 0.2f;
  925|   391k|      temp1 = pstr_qc_pe_data->pe_ch_data[ch].pe / pstr_qc_pe_data->pe;
  926|   391k|      temp1 = temp1 * tmp_var;
  927|   391k|      ch_bit_dist[ch] = temp1 + 0.2f;
  928|   391k|      if (ch_bit_dist[ch] < 0.2f) ch_bit_dist[ch] = 0.2f;
  ------------------
  |  Branch (928:11): [True: 0, False: 391k]
  ------------------
  929|   391k|    } else {
  930|  35.8k|      ch_bit_dist[ch] = 0.2f;
  931|  35.8k|    }
  932|   427k|  }
  933|       |
  934|   239k|  pstr_qc_out->pe = no_red_pe;
  935|   239k|  pstr_adj_thr_elem->pe_last = granted_pe;
  936|       |
  937|   239k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   239k|#define IA_NO_ERROR 0x00000000
  ------------------
  938|   239k|}
iusace_calc_form_fac_per_chan:
  941|   427k|                                   iusace_scratch_mem *pstr_scratch, WORD32 i_ch) {
  942|   427k|  WORD32 i, j, sfb_offs;
  943|   427k|  WORD32 sfb, sfb_width;
  944|   427k|  FLOAT32 *ptr_sfb_form_factor = pstr_scratch->ptr_sfb_form_fac[i_ch];
  945|   427k|  FLOAT32 *ptr_sfb_num_relevant_lines = pstr_scratch->ptr_sfb_num_relevant_lines[i_ch];
  946|   427k|  FLOAT32 *ptr_sfb_ld_energy = pstr_scratch->ptr_sfb_ld_energy[i_ch];
  947|   427k|  FLOAT64 spec_coef = 0;
  948|       |
  949|   427k|  memset(ptr_sfb_num_relevant_lines, 0, sizeof(FLOAT32) * pstr_psy_out_chan->sfb_count);
  950|       |
  951|  1.26M|  for (sfb_offs = 0; sfb_offs < pstr_psy_out_chan->sfb_count;
  ------------------
  |  Branch (951:22): [True: 833k, False: 427k]
  ------------------
  952|   833k|       sfb_offs += pstr_psy_out_chan->sfb_per_group) {
  953|   833k|    i = sfb_offs;
  954|  18.8M|    for (sfb = 0; sfb < pstr_psy_out_chan->max_sfb_per_grp; sfb++, i++) {
  ------------------
  |  Branch (954:19): [True: 17.9M, False: 833k]
  ------------------
  955|  17.9M|      ptr_sfb_form_factor[i] = MIN_FLT_VAL;
  ------------------
  |  |   31|  17.9M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  956|  17.9M|      if (pstr_psy_out_chan->ptr_sfb_energy[i] > pstr_psy_out_chan->ptr_sfb_thr[i]) {
  ------------------
  |  Branch (956:11): [True: 9.76M, False: 8.22M]
  ------------------
  957|  9.76M|        FLOAT32 avg_form_factor;
  958|       |
  959|   182M|        for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (959:53): [True: 173M, False: 9.76M]
  ------------------
  960|   173M|             j++) {
  961|   173M|          spec_coef = fabs(pstr_psy_out_chan->ptr_spec_coeffs[j]);
  962|   173M|          if (spec_coef < EPS && spec_coef != 0) spec_coef = EPS;
  ------------------
  |  |   33|   346M|#define EPS (1e-18)
  ------------------
                        if (spec_coef < EPS && spec_coef != 0) spec_coef = EPS;
  ------------------
  |  |   33|  22.4k|#define EPS (1e-18)
  ------------------
  |  Branch (962:15): [True: 7.31M, False: 165M]
  |  Branch (962:34): [True: 22.4k, False: 7.29M]
  ------------------
  963|   173M|          ptr_sfb_form_factor[i] += (FLOAT32)sqrt(spec_coef);
  964|   173M|        }
  965|       |
  966|  9.76M|        sfb_width = pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i];
  967|  9.76M|        avg_form_factor =
  968|  9.76M|            (FLOAT32)pow(pstr_psy_out_chan->ptr_sfb_energy[i] / (FLOAT32)sfb_width, 0.25);
  969|  9.76M|        ptr_sfb_num_relevant_lines[i] = ptr_sfb_form_factor[i] / avg_form_factor;
  970|  9.76M|        ptr_sfb_ld_energy[i] = (FLOAT32)(log(pstr_psy_out_chan->ptr_sfb_energy[i]) * LOG2_1);
  ------------------
  |  |   28|  9.76M|#define LOG2_1 1.442695041f
  ------------------
  971|  9.76M|      }
  972|  17.9M|    }
  973|   833k|  }
  974|       |
  975|   427k|  return;
  976|   427k|}
iusace_quantize_lines:
  979|  3.02M|                           WORD16 *ptr_quant_spectrum, FLOAT32 *ptr_mdct_spec) {
  980|  3.02M|  FLOAT32 quantizer;
  981|  3.02M|  FLOAT32 k = 0.4054f;
  982|  3.02M|  WORD32 line;
  983|       |
  984|  3.02M|  quantizer = ixheaace_fd_quant_table[gain + 128];
  985|  35.2M|  for (line = 0; line < num_lines; line++) {
  ------------------
  |  Branch (985:18): [True: 32.1M, False: 3.02M]
  ------------------
  986|  32.1M|    FLOAT32 tmp = ptr_mdct_spec[line];
  987|  32.1M|    if (tmp < 0.0f) {
  ------------------
  |  Branch (987:9): [True: 6.62M, False: 25.5M]
  ------------------
  988|  6.62M|      ptr_exp_spectrum[line] = (FLOAT32)sqrt(-tmp);
  989|  6.62M|      ptr_exp_spectrum[line] *= (FLOAT32)sqrt(ptr_exp_spectrum[line]);
  990|  6.62M|      ptr_quant_spectrum[line] = -(WORD16)(k + quantizer * ptr_exp_spectrum[line]);
  991|  25.5M|    } else {
  992|  25.5M|      ptr_exp_spectrum[line] = (FLOAT32)sqrt(tmp);
  993|  25.5M|      ptr_exp_spectrum[line] *= (FLOAT32)sqrt(ptr_exp_spectrum[line]);
  994|  25.5M|      ptr_quant_spectrum[line] = (WORD16)(k + quantizer * ptr_exp_spectrum[line]);
  995|  25.5M|    }
  996|  32.1M|  }
  997|  3.02M|  return;
  998|  3.02M|}
iusace_calculate_exp_spec:
 1001|  9.32M|                               FLOAT32 *ptr_mdct_spec) {
 1002|  9.32M|  WORD32 line;
 1003|       |
 1004|   174M|  for (line = 0; line < num_lines; line++) {
  ------------------
  |  Branch (1004:18): [True: 165M, False: 9.32M]
  ------------------
 1005|   165M|    ptr_exp_spectrum[line] = (FLOAT32)sqrt(fabs(ptr_mdct_spec[line]));
 1006|   165M|    ptr_exp_spectrum[line] *= (FLOAT32)sqrt(ptr_exp_spectrum[line]);
 1007|   165M|  }
 1008|  9.32M|  return;
 1009|  9.32M|}
iusace_calc_sfb_dist:
 1133|  55.2M|                             WORD16 *ptr_quant_spec, WORD32 sfb_width, WORD32 gain) {
 1134|  55.2M|  WORD32 i;
 1135|  55.2M|  FLOAT32 dist = 0;
 1136|  55.2M|  FLOAT32 k = 0.4054f;
 1137|  55.2M|  FLOAT32 quantizer = ixheaace_fd_quant_table[gain + 128];
 1138|  55.2M|  FLOAT32 inv_quantizer = ixheaace_fd_inv_quant_table[gain + 128];
 1139|       |
 1140|   870M|  for (i = 0; i < sfb_width; i++) {
  ------------------
  |  Branch (1140:15): [True: 815M, False: 55.2M]
  ------------------
 1141|   815M|    FLOAT32 iq_val;
 1142|   815M|    FLOAT32 diff;
 1143|       |
 1144|   815M|    ptr_quant_spec[i] = (WORD16)(k + quantizer * ptr_exp_spec[i]);
 1145|       |
 1146|   815M|    if (ptr_quant_spec[i] < 64) {
  ------------------
  |  Branch (1146:9): [True: 790M, False: 24.0M]
  ------------------
 1147|   790M|      iq_val = ixheaace_pow_4_3_table[ptr_quant_spec[i]] * inv_quantizer;
 1148|   790M|    } else {
 1149|  24.0M|      iq_val = (FLOAT32)((pow((FLOAT32)abs(ptr_quant_spec[i]), 4.0f / 3.0f)) * inv_quantizer);
 1150|  24.0M|    }
 1151|       |
 1152|   815M|    diff = (FLOAT32)fabs(ptr_spec[i]) - iq_val;
 1153|       |
 1154|   815M|    dist += diff * diff;
 1155|   815M|  }
 1156|       |
 1157|  55.2M|  return dist;
 1158|  55.2M|}
iusace_estimate_scfs_chan:
 1555|   239k|                               WORD32 chn, iusace_scratch_mem *pstr_scratch) {
 1556|   239k|  WORD16 *ptr_scalefactor;
 1557|   239k|  WORD32 *global_gain;
 1558|   239k|  FLOAT32 *p_sfb_form_factor;
 1559|   239k|  FLOAT32 *p_sfb_num_relevant_lines;
 1560|   239k|  WORD16 *ptr_quant_spec;
 1561|   239k|  WORD32 i, ch, j, idx = 0;
 1562|   239k|  FLOAT32 thresh, energy, energy_part, thr_part;
 1563|   239k|  FLOAT32 scf_float;
 1564|   239k|  WORD16 scf_int = 0, min_scf = 0, max_scf = 0;
 1565|   239k|  FLOAT64 max_spec = 0.0f;
 1566|   239k|  WORD16 min_sf_max_quant[MAX_NUM_GROUPED_SFB] = {0};
 1567|   239k|  pUWORD8 ptr_scratch = pstr_scratch->ptr_fd_scratch;
 1568|   239k|  FLOAT32 *ptr_sfb_dist = (FLOAT32 *)ptr_scratch;
 1569|   239k|  ptr_scratch += MAX_NUM_GROUPED_SFB * sizeof(ptr_sfb_dist[0]);
  ------------------
  |  |   24|   239k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
 1570|   239k|  WORD16 min_calc_scf[MAX_NUM_GROUPED_SFB] = {0};
 1571|       |
 1572|   239k|  WORD16 *ptr_quant_spec_temp = pstr_scratch->p_adjthr_quant_spec_temp;
 1573|   239k|  FLOAT32 *ptr_exp_spec = pstr_scratch->p_adjthr_ptr_exp_spec;
 1574|   239k|  FLOAT32 *ptr_mdct_spec_float = pstr_scratch->p_adjthr_mdct_spec_float;
 1575|   239k|  FLOAT32 *sfb_const_pe_part = (FLOAT32 *)ptr_scratch;
 1576|       |
 1577|   239k|  FLOAT32 **ptr_sfb_form_factor = &pstr_scratch->ptr_sfb_form_fac[0];
 1578|   239k|  FLOAT32 **ptr_sfb_num_relevant_lines = &pstr_scratch->ptr_sfb_num_relevant_lines[0];
 1579|       |
 1580|   239k|  ptr_scratch += MAX_NUM_GROUPED_SFB * sizeof(sfb_const_pe_part[0]);
  ------------------
  |  |   24|   239k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
 1581|       |
 1582|   239k|  memset(ptr_quant_spec_temp, 0, FRAME_LEN_LONG * sizeof(WORD16));
  ------------------
  |  |   54|   239k|#define FRAME_LEN_LONG 1024
  ------------------
 1583|   239k|  memset(ptr_mdct_spec_float, 0, FRAME_LEN_LONG * sizeof(FLOAT32));
  ------------------
  |  |   54|   239k|#define FRAME_LEN_LONG 1024
  ------------------
 1584|   239k|  memset(ptr_exp_spec, 0, FRAME_LEN_LONG * sizeof(FLOAT32));
  ------------------
  |  |   54|   239k|#define FRAME_LEN_LONG 1024
  ------------------
 1585|   239k|  memset(ptr_sfb_dist, 0, MAX_NUM_GROUPED_SFB * sizeof(FLOAT32));
  ------------------
  |  |   24|   239k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
 1586|   667k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (1586:18): [True: 427k, False: 239k]
  ------------------
 1587|   427k|    ia_psy_mod_out_data_struct *ptr_psy_out = &pstr_psy_out[ch];
 1588|   427k|    str_qc_out_chan[idx].global_gain = 0;
 1589|       |
 1590|   427k|    memset(str_qc_out_chan[idx].scalefactor, 0,
 1591|   427k|           sizeof(str_qc_out_chan[idx].scalefactor[0]) * pstr_psy_out[ch].sfb_count);
 1592|   427k|    memset(str_qc_out_chan[idx].quant_spec, 0,
 1593|   427k|           sizeof(str_qc_out_chan[idx].quant_spec[0]) * FRAME_LEN_LONG);
  ------------------
  |  |   54|   427k|#define FRAME_LEN_LONG 1024
  ------------------
 1594|       |
 1595|   427k|    ptr_scalefactor = str_qc_out_chan[idx].scalefactor;
 1596|   427k|    global_gain = &str_qc_out_chan[idx].global_gain;
 1597|   427k|    p_sfb_form_factor = &ptr_sfb_form_factor[idx][0];
 1598|   427k|    p_sfb_num_relevant_lines = &ptr_sfb_num_relevant_lines[idx][0];
 1599|   427k|    ptr_quant_spec = str_qc_out_chan[idx].quant_spec;
 1600|  20.4M|    for (i = 0; i < ptr_psy_out->sfb_count; i++) {
  ------------------
  |  Branch (1600:17): [True: 20.0M, False: 427k]
  ------------------
 1601|  20.0M|      thresh = ptr_psy_out->ptr_sfb_thr[i];
 1602|  20.0M|      energy = ptr_psy_out->ptr_sfb_energy[i];
 1603|  20.0M|      max_spec = 0.0;
 1604|       |
 1605|   428M|      for (j = ptr_psy_out->sfb_offsets[i]; j < ptr_psy_out->sfb_offsets[i + 1]; j++) {
  ------------------
  |  Branch (1605:45): [True: 408M, False: 20.0M]
  ------------------
 1606|   408M|        max_spec = MAX(max_spec, fabs(ptr_psy_out->ptr_spec_coeffs[j]));
  ------------------
  |  |   89|   408M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 230M, False: 177M]
  |  |  ------------------
  ------------------
 1607|   408M|      }
 1608|       |
 1609|  20.0M|      ptr_scalefactor[i] = MIN_SHRT_VAL;
  ------------------
  |  |  183|  20.0M|#define MIN_SHRT_VAL (-32768)
  ------------------
 1610|  20.0M|      min_sf_max_quant[i] = MIN_SHRT_VAL;
  ------------------
  |  |  183|  20.0M|#define MIN_SHRT_VAL (-32768)
  ------------------
 1611|       |
 1612|  20.0M|      if ((max_spec > 0.0) && (energy > thresh) && (p_sfb_form_factor[i] != MIN_FLT_VAL)) {
  ------------------
  |  |   31|  9.33M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (1612:11): [True: 14.3M, False: 5.66M]
  |  Branch (1612:31): [True: 9.33M, False: 5.02M]
  |  Branch (1612:52): [True: 9.32M, False: 10.0k]
  ------------------
 1613|  9.32M|        energy_part = (FLOAT32)log10(p_sfb_form_factor[i] + FLT_EPSILON);
 1614|       |
 1615|  9.32M|        thr_part = (FLOAT32)log10(6.75 * thresh + MIN_FLT_VAL);
  ------------------
  |  |   31|  9.32M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
 1616|  9.32M|        scf_float = 8.8585f * (thr_part - energy_part);
 1617|  9.32M|        scf_int = (WORD16)floor(scf_float);
 1618|  9.32M|        min_sf_max_quant[i] = (WORD16)ceil(C1_SF + C2_SF * log(max_spec));
  ------------------
  |  |   29|  9.32M|#define C1_SF -69.33295f /* -16/3*log(MAX_QUANT+0.5-logCon)/log(2) */
  ------------------
                      min_sf_max_quant[i] = (WORD16)ceil(C1_SF + C2_SF * log(max_spec));
  ------------------
  |  |   30|  9.32M|#define C2_SF 5.77078f   /* 4/log(2) */
  ------------------
 1619|  9.32M|        scf_int = MAX(scf_int, min_sf_max_quant[i]);
  ------------------
  |  |   89|  9.32M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 9.31M, False: 6.20k]
  |  |  ------------------
  ------------------
 1620|  9.32M|        scf_int = MAX(scf_int, MIN_GAIN_INDEX);
  ------------------
  |  |   89|  9.32M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 9.32M, False: 0]
  |  |  ------------------
  ------------------
 1621|  9.32M|        scf_int = MIN(scf_int, (MAX_GAIN_INDEX - SCF_COUNT_LIMIT_THREE));
  ------------------
  |  |   86|  9.32M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 9.32M, False: 1]
  |  |  ------------------
  ------------------
 1622|   174M|        for (j = 0; j < ptr_psy_out->sfb_offsets[i + 1] - ptr_psy_out->sfb_offsets[i]; j++) {
  ------------------
  |  Branch (1622:21): [True: 165M, False: 9.32M]
  ------------------
 1623|   165M|          ptr_exp_spec[ptr_psy_out->sfb_offsets[i] + j] =
 1624|   165M|              (FLOAT32)(ptr_psy_out->ptr_spec_coeffs[ptr_psy_out->sfb_offsets[i] + j]);
 1625|   165M|          ptr_mdct_spec_float[ptr_psy_out->sfb_offsets[i] + j] =
 1626|   165M|              (FLOAT32)(ptr_psy_out->ptr_spec_coeffs[ptr_psy_out->sfb_offsets[i] + j]);
 1627|   165M|        }
 1628|       |
 1629|  9.32M|        iusace_calculate_exp_spec(ptr_psy_out->sfb_offsets[i + 1] - ptr_psy_out->sfb_offsets[i],
 1630|  9.32M|                                  ptr_exp_spec + ptr_psy_out->sfb_offsets[i],
 1631|  9.32M|                                  ptr_mdct_spec_float + ptr_psy_out->sfb_offsets[i]);
 1632|       |
 1633|  9.32M|        scf_int = iusace_improve_scf(
 1634|  9.32M|            ptr_mdct_spec_float + ptr_psy_out->sfb_offsets[i],
 1635|  9.32M|            ptr_exp_spec + ptr_psy_out->sfb_offsets[i],
 1636|  9.32M|            ptr_quant_spec + ptr_psy_out->sfb_offsets[i],
 1637|  9.32M|            ptr_quant_spec_temp + ptr_psy_out->sfb_offsets[i],
 1638|  9.32M|            ptr_psy_out->sfb_offsets[i + 1] - ptr_psy_out->sfb_offsets[i], thresh, scf_int,
 1639|  9.32M|            min_sf_max_quant[i], &ptr_sfb_dist[i], &min_calc_scf[i]);
 1640|       |
 1641|  9.32M|        ptr_scalefactor[i] = scf_int;
 1642|  9.32M|      }
 1643|  20.0M|    }
 1644|       |
 1645|  20.4M|    for (i = 0; i < ptr_psy_out->sfb_count; i++) {
  ------------------
  |  Branch (1645:17): [True: 20.0M, False: 427k]
  ------------------
 1646|  20.0M|      sfb_const_pe_part[i] = MIN_FLT_VAL;
  ------------------
  |  |   31|  20.0M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
 1647|  20.0M|    }
 1648|       |
 1649|   427k|    iusace_assimilate_single_scf(ptr_psy_out, ptr_exp_spec, ptr_quant_spec, ptr_quant_spec_temp,
 1650|   427k|                                 ptr_scalefactor, min_sf_max_quant, ptr_sfb_dist,
 1651|   427k|                                 sfb_const_pe_part, p_sfb_form_factor, p_sfb_num_relevant_lines,
 1652|   427k|                                 min_calc_scf, ptr_mdct_spec_float);
 1653|       |
 1654|   427k|    iusace_assimilate_multiple_scf(ptr_psy_out, ptr_exp_spec, ptr_quant_spec, ptr_quant_spec_temp,
 1655|   427k|                                   ptr_scalefactor, min_sf_max_quant, ptr_sfb_dist,
 1656|   427k|                                   sfb_const_pe_part, p_sfb_form_factor, p_sfb_num_relevant_lines,
 1657|   427k|                                   ptr_mdct_spec_float, ptr_scratch);
 1658|       |
 1659|   427k|    max_scf = MIN_SHRT_VAL;
  ------------------
  |  |  183|   427k|#define MIN_SHRT_VAL (-32768)
  ------------------
 1660|   427k|    min_scf = MAX_SHRT_VAL;
  ------------------
  |  |  184|   427k|#define MAX_SHRT_VAL (32767)
  ------------------
 1661|  20.4M|    for (i = 0; i < ptr_psy_out->sfb_count; i++) {
  ------------------
  |  Branch (1661:17): [True: 20.0M, False: 427k]
  ------------------
 1662|  20.0M|      if (max_scf < ptr_scalefactor[i]) {
  ------------------
  |  Branch (1662:11): [True: 851k, False: 19.1M]
  ------------------
 1663|   851k|        max_scf = ptr_scalefactor[i];
 1664|   851k|      }
 1665|  20.0M|      if ((ptr_scalefactor[i] != MIN_SHRT_VAL) && (min_scf > ptr_scalefactor[i])) {
  ------------------
  |  |  183|  20.0M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (1665:11): [True: 9.32M, False: 10.6M]
  |  Branch (1665:51): [True: 1.52M, False: 7.80M]
  ------------------
 1666|  1.52M|        min_scf = ptr_scalefactor[i];
 1667|  1.52M|      }
 1668|  20.0M|    }
 1669|       |
 1670|  20.4M|    for (i = 0; i < pstr_psy_out[ch].sfb_count; i++) {
  ------------------
  |  Branch (1670:17): [True: 20.0M, False: 427k]
  ------------------
 1671|  20.0M|      if ((ptr_scalefactor[i] != MIN_SHRT_VAL) &&
  ------------------
  |  |  183|  20.0M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (1671:11): [True: 9.32M, False: 10.6M]
  ------------------
 1672|  9.32M|          (min_scf + MAX_SCF_DELTA) < ptr_scalefactor[i]) {
  ------------------
  |  |   26|  9.32M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (1672:11): [True: 2.26k, False: 9.31M]
  ------------------
 1673|  2.26k|        ptr_scalefactor[i] = min_scf + MAX_SCF_DELTA;
  ------------------
  |  |   26|  2.26k|#define MAX_SCF_DELTA 60
  ------------------
 1674|       |
 1675|  2.26k|        iusace_calc_sfb_dist(ptr_mdct_spec_float + ptr_psy_out->sfb_offsets[i],
 1676|  2.26k|                             ptr_exp_spec + ptr_psy_out->sfb_offsets[i],
 1677|  2.26k|                             ptr_quant_spec + ptr_psy_out->sfb_offsets[i],
 1678|  2.26k|                             ptr_psy_out->sfb_offsets[i + 1] - ptr_psy_out->sfb_offsets[i],
 1679|  2.26k|                             ptr_scalefactor[i]);
 1680|  2.26k|      }
 1681|  20.0M|    }
 1682|       |
 1683|   427k|    max_scf = MIN((min_scf + MAX_SCF_DELTA), max_scf);
  ------------------
  |  |   86|   427k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 1.61k, False: 426k]
  |  |  ------------------
  ------------------
 1684|       |
 1685|   427k|    if (max_scf > MIN_SHRT_VAL) {
  ------------------
  |  |  183|   427k|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (1685:9): [True: 322k, False: 104k]
  ------------------
 1686|   322k|      *global_gain = max_scf;
 1687|  15.5M|      for (i = 0; i < ptr_psy_out->sfb_count; i++) {
  ------------------
  |  Branch (1687:19): [True: 15.2M, False: 322k]
  ------------------
 1688|  15.2M|        if (ptr_scalefactor[i] == MIN_SHRT_VAL) {
  ------------------
  |  |  183|  15.2M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (1688:13): [True: 5.91M, False: 9.32M]
  ------------------
 1689|  5.91M|          ptr_scalefactor[i] = 0;
 1690|  5.91M|          memset(
 1691|  5.91M|              &ptr_psy_out->ptr_spec_coeffs[ptr_psy_out->sfb_offsets[i]], 0,
 1692|  5.91M|              (ptr_psy_out->sfb_offsets[i + 1] - ptr_psy_out->sfb_offsets[i]) * sizeof(FLOAT64));
 1693|  9.32M|        } else {
 1694|  9.32M|          ptr_scalefactor[i] = max_scf - ptr_scalefactor[i];
 1695|  9.32M|        }
 1696|  15.2M|      }
 1697|   322k|    } else {
 1698|   104k|      *global_gain = 0;
 1699|  4.88M|      for (i = 0; i < ptr_psy_out->sfb_count; i++) {
  ------------------
  |  Branch (1699:19): [True: 4.78M, False: 104k]
  ------------------
 1700|  4.78M|        ptr_scalefactor[i] = 0;
 1701|  4.78M|        memset(&ptr_psy_out->ptr_spec_coeffs[ptr_psy_out->sfb_offsets[i]], 0,
 1702|  4.78M|               (ptr_psy_out->sfb_offsets[i + 1] - ptr_psy_out->sfb_offsets[i]) * sizeof(FLOAT64));
 1703|  4.78M|      }
 1704|   104k|    }
 1705|   427k|    idx++;
 1706|   427k|  }
 1707|       |
 1708|   239k|  return;
 1709|   239k|}
ixheaace_fd_qc_adjthr.c:iusace_calc_sfb_pe_data:
  102|   513k|                                    WORD32 chn) {
  103|   513k|  WORD32 ch, idx = 0;
  104|   513k|  WORD32 scf_band_grp;
  105|   513k|  FLOAT32 num_lines;
  106|   513k|  FLOAT32 ld_thr, ld_ratio;
  107|   513k|  WORD32 i = 0, scf;
  108|   513k|  WORD32 sfb_count;
  109|   513k|  WORD32 scf_band_per_grp;
  110|   513k|  WORD32 max_sfb_per_grp;
  111|   513k|  FLOAT32 *ptr_sfb_energy;
  112|   513k|  FLOAT32 *ptr_sfb_thr;
  113|   513k|  ia_qc_pe_chan_data_struct *str_qc_pe_chan_data;
  114|       |
  115|   513k|  pstr_qc_pe_data->pe = pstr_qc_pe_data->offset;
  116|   513k|  pstr_qc_pe_data->const_part = 0.0f;
  117|   513k|  pstr_qc_pe_data->num_active_lines = 0.0f;
  118|       |
  119|  1.42M|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (119:18): [True: 913k, False: 513k]
  ------------------
  120|   913k|    sfb_count = pstr_psy_out[ch].sfb_count;
  121|   913k|    scf_band_per_grp = pstr_psy_out[ch].sfb_per_group;
  122|   913k|    max_sfb_per_grp = pstr_psy_out[ch].max_sfb_per_grp;
  123|   913k|    ptr_sfb_energy = pstr_psy_out[ch].ptr_sfb_energy;
  124|   913k|    ptr_sfb_thr = pstr_psy_out[ch].ptr_sfb_thr;
  125|   913k|    str_qc_pe_chan_data = &pstr_qc_pe_data->pe_ch_data[idx];
  126|   913k|    str_qc_pe_chan_data->pe = 0;
  127|   913k|    str_qc_pe_chan_data->num_active_lines = 0;
  128|   913k|    str_qc_pe_chan_data->const_part = 0;
  129|       |
  130|  2.76M|    for (scf_band_grp = 0; scf_band_grp < sfb_count; scf_band_grp += scf_band_per_grp) {
  ------------------
  |  Branch (130:28): [True: 1.84M, False: 913k]
  ------------------
  131|  1.84M|      i = scf_band_grp;
  132|  39.6M|      for (scf = max_sfb_per_grp - 1; scf >= 0; scf--, i++) {
  ------------------
  |  Branch (132:39): [True: 37.8M, False: 1.84M]
  ------------------
  133|  37.8M|        if (ptr_sfb_energy[i] > ptr_sfb_thr[i]) {
  ------------------
  |  Branch (133:13): [True: 23.4M, False: 14.3M]
  ------------------
  134|  23.4M|          ld_thr = (FLOAT32)log(ptr_sfb_thr[i]) * LOG2_1;
  ------------------
  |  |   28|  23.4M|#define LOG2_1 1.442695041f
  ------------------
  135|  23.4M|          ld_ratio = str_qc_pe_chan_data->sfb_ld_energy[i] - ld_thr;
  136|  23.4M|          num_lines = str_qc_pe_chan_data->sfb_lines[i];
  137|  23.4M|          if (ld_ratio >= PE_C1) {
  ------------------
  |  |   32|  23.4M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (137:15): [True: 17.5M, False: 5.89M]
  ------------------
  138|  17.5M|            str_qc_pe_chan_data->sfb_pe[i] = num_lines * ld_ratio;
  139|  17.5M|            str_qc_pe_chan_data->sfb_const_part[i] =
  140|  17.5M|                num_lines * str_qc_pe_chan_data->sfb_ld_energy[i];
  141|  17.5M|          } else {
  142|  5.89M|            str_qc_pe_chan_data->sfb_pe[i] = num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   33|  5.89M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                          str_qc_pe_chan_data->sfb_pe[i] = num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   34|  5.89M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  143|  5.89M|            str_qc_pe_chan_data->sfb_const_part[i] =
  144|  5.89M|                num_lines * (PE_C2 + PE_C3 * str_qc_pe_chan_data->sfb_ld_energy[i]);
  ------------------
  |  |   33|  5.89M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                              num_lines * (PE_C2 + PE_C3 * str_qc_pe_chan_data->sfb_ld_energy[i]);
  ------------------
  |  |   34|  5.89M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  145|  5.89M|            num_lines = num_lines * PE_C3;
  ------------------
  |  |   34|  5.89M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  146|  5.89M|          }
  147|  23.4M|          str_qc_pe_chan_data->num_sfb_active_lines[i] = num_lines;
  148|  23.4M|        } else {
  149|  14.3M|          str_qc_pe_chan_data->sfb_pe[i] = 0.0f;
  150|  14.3M|          str_qc_pe_chan_data->sfb_const_part[i] = 0.0f;
  151|  14.3M|          str_qc_pe_chan_data->num_sfb_active_lines[i] = 0.0;
  152|  14.3M|        }
  153|       |
  154|  37.8M|        str_qc_pe_chan_data->pe += str_qc_pe_chan_data->sfb_pe[i];
  155|  37.8M|        str_qc_pe_chan_data->const_part += str_qc_pe_chan_data->sfb_const_part[i];
  156|  37.8M|        str_qc_pe_chan_data->num_active_lines += str_qc_pe_chan_data->num_sfb_active_lines[i];
  157|  37.8M|      }
  158|  1.84M|    }
  159|   913k|    pstr_qc_pe_data->pe += str_qc_pe_chan_data->pe;
  160|   913k|    pstr_qc_pe_data->const_part += str_qc_pe_chan_data->const_part;
  161|   913k|    pstr_qc_pe_data->num_active_lines += str_qc_pe_chan_data->num_active_lines;
  162|   913k|    pstr_psy_out[ch].pe = pstr_qc_pe_data->pe;
  163|   913k|    idx++;
  164|   913k|  }
  165|   513k|  return;
  166|   513k|}
ixheaace_fd_qc_adjthr.c:iusace_bitres_calc_bitfac:
  203|   239k|                                         ia_adj_thr_elem_struct *pstr_adj_thr_elem) {
  204|   239k|  FLOAT32 pex;
  205|   239k|  FLOAT32 fill_lvl = 0.0f;
  206|   239k|  FLOAT32 bit_save, bit_spend, bitres_factor;
  207|       |
  208|   239k|  if (max_bitres_bits) {
  ------------------
  |  Branch (208:7): [True: 201k, False: 38.4k]
  ------------------
  209|   201k|    fill_lvl = (FLOAT32)bitres_bits / max_bitres_bits;
  210|   201k|  }
  211|       |
  212|   239k|  if (win_seq != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   239k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (212:7): [True: 161k, False: 77.7k]
  ------------------
  213|   161k|    fill_lvl = MAX(fill_lvl, CLIP_SAVE_LO_LONG);
  ------------------
  |  |   89|   161k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 121k, False: 40.4k]
  |  |  ------------------
  ------------------
  214|   161k|    fill_lvl = MIN(fill_lvl, CLIP_SAVE_HI_LONG);
  ------------------
  |  |   86|   161k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 83.5k, False: 78.1k]
  |  |  ------------------
  ------------------
  215|   161k|    bit_save = MAX_BITS_SAVE_LONG - (BITS_SAVE_RATIO_LONG * (fill_lvl - CLIP_SAVE_LO_LONG));
  ------------------
  |  |   56|   161k|#define MAX_BITS_SAVE_LONG (0.3f)
  ------------------
                  bit_save = MAX_BITS_SAVE_LONG - (BITS_SAVE_RATIO_LONG * (fill_lvl - CLIP_SAVE_LO_LONG));
  ------------------
  |  |   44|   161k|#define BITS_SAVE_RATIO_LONG (MIN_TO_MAX_SAVE_BITS_LONG / CLIP_SAVE_LO_TO_HI_LONG)
  |  |  ------------------
  |  |  |  |   40|   161k|#define MIN_TO_MAX_SAVE_BITS_LONG (MAX_BITS_SAVE_LONG - MIN_BITS_SAVE_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   56|   161k|#define MAX_BITS_SAVE_LONG (0.3f)
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_TO_MAX_SAVE_BITS_LONG (MAX_BITS_SAVE_LONG - MIN_BITS_SAVE_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   161k|#define MIN_BITS_SAVE_LONG (-0.05f)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BITS_SAVE_RATIO_LONG (MIN_TO_MAX_SAVE_BITS_LONG / CLIP_SAVE_LO_TO_HI_LONG)
  |  |  ------------------
  |  |  |  |   36|   161k|#define CLIP_SAVE_LO_TO_HI_LONG (CLIP_SAVE_HI_LONG - CLIP_SAVE_LO_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|   161k|#define CLIP_SAVE_HI_LONG (0.95f)
  |  |  |  |  ------------------
  |  |  |  |               #define CLIP_SAVE_LO_TO_HI_LONG (CLIP_SAVE_HI_LONG - CLIP_SAVE_LO_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   161k|#define CLIP_SAVE_LO_LONG (0.2f)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  bit_save = MAX_BITS_SAVE_LONG - (BITS_SAVE_RATIO_LONG * (fill_lvl - CLIP_SAVE_LO_LONG));
  ------------------
  |  |   53|   161k|#define CLIP_SAVE_LO_LONG (0.2f)
  ------------------
  216|   161k|    bit_spend = MIN_BITS_SPEND_LONG + (BITS_SPEND_RATIO_LONG * (fill_lvl - CLIP_SPEND_LO_LONG));
  ------------------
  |  |   59|   161k|#define MIN_BITS_SPEND_LONG (-0.10f)
  ------------------
                  bit_spend = MIN_BITS_SPEND_LONG + (BITS_SPEND_RATIO_LONG * (fill_lvl - CLIP_SPEND_LO_LONG));
  ------------------
  |  |   46|   161k|#define BITS_SPEND_RATIO_LONG (MIN_TO_MAX_SPEND_BITS_LONG / CLIP_SPEND_LO_TO_HI_LONG)
  |  |  ------------------
  |  |  |  |   42|   161k|#define MIN_TO_MAX_SPEND_BITS_LONG (MAX_BITS_SPEND_LONG - MIN_BITS_SPEND_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   161k|#define MAX_BITS_SPEND_LONG (0.4f)
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_TO_MAX_SPEND_BITS_LONG (MAX_BITS_SPEND_LONG - MIN_BITS_SPEND_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   161k|#define MIN_BITS_SPEND_LONG (-0.10f)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BITS_SPEND_RATIO_LONG (MIN_TO_MAX_SPEND_BITS_LONG / CLIP_SPEND_LO_TO_HI_LONG)
  |  |  ------------------
  |  |  |  |   38|   161k|#define CLIP_SPEND_LO_TO_HI_LONG (CLIP_SPEND_HI_LONG - CLIP_SPEND_LO_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   58|   161k|#define CLIP_SPEND_HI_LONG (0.95f)
  |  |  |  |  ------------------
  |  |  |  |               #define CLIP_SPEND_LO_TO_HI_LONG (CLIP_SPEND_HI_LONG - CLIP_SPEND_LO_LONG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   161k|#define CLIP_SPEND_LO_LONG (0.2f)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  bit_spend = MIN_BITS_SPEND_LONG + (BITS_SPEND_RATIO_LONG * (fill_lvl - CLIP_SPEND_LO_LONG));
  ------------------
  |  |   57|   161k|#define CLIP_SPEND_LO_LONG (0.2f)
  ------------------
  217|   161k|  } else {
  218|  77.7k|    fill_lvl = MAX(fill_lvl, CLIP_SPEND_LO_SHORT);
  ------------------
  |  |   89|  77.7k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 55.9k, False: 21.8k]
  |  |  ------------------
  ------------------
  219|  77.7k|    fill_lvl = MIN(fill_lvl, CLIP_SPEND_HI_SHORT);
  ------------------
  |  |   86|  77.7k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 39.9k, False: 37.8k]
  |  |  ------------------
  ------------------
  220|  77.7k|    bit_save = MAX_BITS_SAVE_SHORT - (BITS_SAVE_RATIO_SHORT * (fill_lvl - CLIP_SAVE_LO_SHORT));
  ------------------
  |  |   64|  77.7k|#define MAX_BITS_SAVE_SHORT (0.2f)
  ------------------
                  bit_save = MAX_BITS_SAVE_SHORT - (BITS_SAVE_RATIO_SHORT * (fill_lvl - CLIP_SAVE_LO_SHORT));
  ------------------
  |  |   45|  77.7k|#define BITS_SAVE_RATIO_SHORT (MIN_TO_MAX_SAVE_BITS_SHORT / CLIP_SAVE_LO_TO_HI_SHORT)
  |  |  ------------------
  |  |  |  |   41|  77.7k|#define MIN_TO_MAX_SAVE_BITS_SHORT (MAX_BITS_SAVE_SHORT - MIN_BITS_SAVE_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  77.7k|#define MAX_BITS_SAVE_SHORT (0.2f)
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_TO_MAX_SAVE_BITS_SHORT (MAX_BITS_SAVE_SHORT - MIN_BITS_SAVE_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  77.7k|#define MIN_BITS_SAVE_SHORT (0.0f)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BITS_SAVE_RATIO_SHORT (MIN_TO_MAX_SAVE_BITS_SHORT / CLIP_SAVE_LO_TO_HI_SHORT)
  |  |  ------------------
  |  |  |  |   37|  77.7k|#define CLIP_SAVE_LO_TO_HI_SHORT (CLIP_SAVE_HI_SHORT - CLIP_SAVE_LO_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  77.7k|#define CLIP_SAVE_HI_SHORT (0.75f)
  |  |  |  |  ------------------
  |  |  |  |               #define CLIP_SAVE_LO_TO_HI_SHORT (CLIP_SAVE_HI_SHORT - CLIP_SAVE_LO_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   61|  77.7k|#define CLIP_SAVE_LO_SHORT (0.2f)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  bit_save = MAX_BITS_SAVE_SHORT - (BITS_SAVE_RATIO_SHORT * (fill_lvl - CLIP_SAVE_LO_SHORT));
  ------------------
  |  |   61|  77.7k|#define CLIP_SAVE_LO_SHORT (0.2f)
  ------------------
  221|  77.7k|    bit_spend =
  222|  77.7k|        MIN_BITS_SPEND_SHORT + (BITS_SPEND_RATIO_SHORT * (fill_lvl - CLIP_SPEND_LO_SHORT));
  ------------------
  |  |   67|  77.7k|#define MIN_BITS_SPEND_SHORT (-0.05f)
  ------------------
                      MIN_BITS_SPEND_SHORT + (BITS_SPEND_RATIO_SHORT * (fill_lvl - CLIP_SPEND_LO_SHORT));
  ------------------
  |  |   47|  77.7k|#define BITS_SPEND_RATIO_SHORT (MIN_TO_MAX_SPEND_BITS_SHORT / CLIP_SPEND_LO_TO_HI_SHORT)
  |  |  ------------------
  |  |  |  |   43|  77.7k|#define MIN_TO_MAX_SPEND_BITS_SHORT (MAX_BITS_SPEND_SHORT - MIN_BITS_SPEND_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  77.7k|#define MAX_BITS_SPEND_SHORT (0.5f)
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_TO_MAX_SPEND_BITS_SHORT (MAX_BITS_SPEND_SHORT - MIN_BITS_SPEND_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|  77.7k|#define MIN_BITS_SPEND_SHORT (-0.05f)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BITS_SPEND_RATIO_SHORT (MIN_TO_MAX_SPEND_BITS_SHORT / CLIP_SPEND_LO_TO_HI_SHORT)
  |  |  ------------------
  |  |  |  |   39|  77.7k|#define CLIP_SPEND_LO_TO_HI_SHORT (CLIP_SPEND_HI_SHORT - CLIP_SPEND_LO_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|  77.7k|#define CLIP_SPEND_HI_SHORT (0.75f)
  |  |  |  |  ------------------
  |  |  |  |               #define CLIP_SPEND_LO_TO_HI_SHORT (CLIP_SPEND_HI_SHORT - CLIP_SPEND_LO_SHORT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|  77.7k|#define CLIP_SPEND_LO_SHORT (0.2f)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      MIN_BITS_SPEND_SHORT + (BITS_SPEND_RATIO_SHORT * (fill_lvl - CLIP_SPEND_LO_SHORT));
  ------------------
  |  |   65|  77.7k|#define CLIP_SPEND_LO_SHORT (0.2f)
  ------------------
  223|  77.7k|  }
  224|       |
  225|   239k|  pex = MAX(pe, pstr_adj_thr_elem->pe_min);
  ------------------
  |  |   89|   239k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 86.0k, False: 153k]
  |  |  ------------------
  ------------------
  226|   239k|  pex = MIN(pex, pstr_adj_thr_elem->pe_max);
  ------------------
  |  |   86|   239k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 220k, False: 18.7k]
  |  |  ------------------
  ------------------
  227|       |
  228|   239k|  bitres_factor =
  229|   239k|      (FLOAT32)1.0f - bit_save +
  230|   239k|      ((bit_spend + bit_save) / (pstr_adj_thr_elem->pe_max - pstr_adj_thr_elem->pe_min)) *
  231|   239k|          (pex - pstr_adj_thr_elem->pe_min);
  232|   239k|  bitres_factor = MIN(bitres_factor,
  ------------------
  |  |   86|   239k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 185k, False: 54.2k]
  |  |  ------------------
  ------------------
  233|   239k|                      (FLOAT32)1.0f - (FLOAT32)0.3f + (FLOAT32)bitres_bits / (FLOAT32)avg_bits);
  234|       |
  235|   239k|  bitres_factor = MIN(bitres_factor, max_bit_fac);
  ------------------
  |  |   86|   239k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 239k, False: 0]
  |  |  ------------------
  ------------------
  236|   239k|  iusace_adj_pe_minmax(pe, &pstr_adj_thr_elem->pe_min, &pstr_adj_thr_elem->pe_max);
  237|       |
  238|   239k|  return bitres_factor;
  239|   239k|}
ixheaace_fd_qc_adjthr.c:iusace_adj_pe_minmax:
  168|   239k|static VOID iusace_adj_pe_minmax(const FLOAT32 curr_pe, FLOAT32 *pe_min, FLOAT32 *pe_max) {
  169|   239k|  FLOAT32 min_hi_fac = 0.3f, max_hi_fac = 1.0f, min_low_fac = 0.14f, max_low_fac = 0.07f;
  170|   239k|  FLOAT32 diff;
  171|   239k|  FLOAT32 min_diff = curr_pe * (FLOAT32)0.1666666667f;
  172|       |
  173|   239k|  if (curr_pe > *pe_max) {
  ------------------
  |  Branch (173:7): [True: 18.0k, False: 221k]
  ------------------
  174|  18.0k|    diff = (curr_pe - *pe_max);
  175|  18.0k|    *pe_min += diff * min_hi_fac;
  176|  18.0k|    *pe_max += diff * max_hi_fac;
  177|   221k|  } else {
  178|   221k|    if (curr_pe < *pe_min) {
  ------------------
  |  Branch (178:9): [True: 153k, False: 67.9k]
  ------------------
  179|   153k|      diff = (*pe_min - curr_pe);
  180|   153k|      *pe_min -= diff * min_low_fac;
  181|   153k|      *pe_max -= diff * max_low_fac;
  182|   153k|    } else {
  183|  67.9k|      *pe_min += (curr_pe - *pe_min) * min_hi_fac;
  184|  67.9k|      *pe_max -= (*pe_max - curr_pe) * max_low_fac;
  185|  67.9k|    }
  186|   221k|  }
  187|       |
  188|   239k|  if ((*pe_max - *pe_min) < min_diff) {
  ------------------
  |  Branch (188:7): [True: 16.3k, False: 223k]
  ------------------
  189|  16.3k|    FLOAT32 low_part, high_part;
  190|  16.3k|    low_part = MAX((FLOAT32)0.0f, curr_pe - *pe_min);
  ------------------
  |  |   89|  16.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 16.3k]
  |  |  ------------------
  ------------------
  191|  16.3k|    high_part = MAX((FLOAT32)0.0f, *pe_max - curr_pe);
  ------------------
  |  |   89|  16.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 16.3k]
  |  |  ------------------
  ------------------
  192|  16.3k|    *pe_max = curr_pe + high_part / (low_part + high_part) * min_diff;
  193|  16.3k|    *pe_min = curr_pe - low_part / (low_part + high_part) * min_diff;
  194|  16.3k|    *pe_min = MAX((FLOAT32)0.0f, *pe_min);
  ------------------
  |  |   89|  16.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 16.3k]
  |  |  ------------------
  ------------------
  195|  16.3k|  }
  196|       |
  197|   239k|  return;
  198|   239k|}
ixheaace_fd_qc_adjthr.c:iusace_calc_pe_correction:
  242|   239k|                                      const FLOAT32 pe_last, const WORD32 bits_prev) {
  243|   239k|  if ((bits_prev > 0) && (pe_act < (FLOAT32)1.5f * pe_last) &&
  ------------------
  |  Branch (243:7): [True: 227k, False: 11.8k]
  |  Branch (243:26): [True: 226k, False: 790]
  ------------------
  244|   226k|      (pe_act > (FLOAT32)0.7f * pe_last) &&
  ------------------
  |  Branch (244:7): [True: 143k, False: 83.0k]
  ------------------
  245|   143k|      ((FLOAT32)1.2f * iusace_bits_to_pe((FLOAT32)bits_prev) > pe_last) &&
  ------------------
  |  Branch (245:7): [True: 114k, False: 29.4k]
  ------------------
  246|   114k|      ((FLOAT32)0.65f * iusace_bits_to_pe((FLOAT32)bits_prev) < pe_last)) {
  ------------------
  |  Branch (246:7): [True: 105k, False: 9.18k]
  ------------------
  247|   105k|    FLOAT32 new_fac = pe_last / iusace_bits_to_pe((FLOAT32)bits_prev);
  248|       |
  249|   105k|    if (new_fac < (FLOAT32)1.0f) {
  ------------------
  |  Branch (249:9): [True: 49.8k, False: 55.3k]
  ------------------
  250|  49.8k|      new_fac = MIN((FLOAT32)1.1f * new_fac, (FLOAT32)1.0f);
  ------------------
  |  |   86|  49.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 30.9k, False: 18.9k]
  |  |  ------------------
  ------------------
  251|  49.8k|      new_fac = MAX(new_fac, (FLOAT32)0.85f);
  ------------------
  |  |   89|  49.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 36.5k, False: 13.3k]
  |  |  ------------------
  ------------------
  252|  55.3k|    } else {
  253|  55.3k|      new_fac = MAX((FLOAT32)0.9f * new_fac, (FLOAT32)1.0f);
  ------------------
  |  |   89|  55.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 14.5k, False: 40.8k]
  |  |  ------------------
  ------------------
  254|  55.3k|      new_fac = MIN(new_fac, (FLOAT32)1.15f);
  ------------------
  |  |   86|  55.3k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 55.3k, False: 0]
  |  |  ------------------
  ------------------
  255|  55.3k|    }
  256|   105k|    if (((new_fac > (FLOAT32)1.0f) && (*correction_fac < (FLOAT32)1.0f)) ||
  ------------------
  |  Branch (256:10): [True: 14.5k, False: 90.6k]
  |  Branch (256:39): [True: 1.62k, False: 12.8k]
  ------------------
  257|   103k|        ((new_fac < (FLOAT32)1.0f) && (*correction_fac > (FLOAT32)1.0f))) {
  ------------------
  |  Branch (257:10): [True: 30.9k, False: 72.6k]
  |  Branch (257:39): [True: 1.83k, False: 29.1k]
  ------------------
  258|  3.45k|      *correction_fac = (FLOAT32)1.0f;
  259|  3.45k|    }
  260|       |
  261|   105k|    if ((*correction_fac < (FLOAT32)1.0f && new_fac < *correction_fac) ||
  ------------------
  |  Branch (261:10): [True: 32.4k, False: 72.7k]
  |  Branch (261:45): [True: 18.9k, False: 13.5k]
  ------------------
  262|  86.2k|        (*correction_fac > (FLOAT32)1.0f && new_fac > *correction_fac))
  ------------------
  |  Branch (262:10): [True: 27.8k, False: 58.4k]
  |  Branch (262:45): [True: 5.53k, False: 22.2k]
  ------------------
  263|  24.4k|      *correction_fac = (FLOAT32)0.85f * (*correction_fac) + (FLOAT32)0.15f * new_fac;
  264|  80.7k|    else
  265|  80.7k|      *correction_fac = (FLOAT32)0.7f * (*correction_fac) + (FLOAT32)0.3f * new_fac;
  266|       |
  267|   105k|    *correction_fac = MIN(*correction_fac, (FLOAT32)1.15f);
  ------------------
  |  |   86|   105k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 105k, False: 0]
  |  |  ------------------
  ------------------
  268|   105k|    *correction_fac = MAX(*correction_fac, (FLOAT32)0.85f);
  ------------------
  |  |   89|   105k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 105k, False: 0]
  |  |  ------------------
  ------------------
  269|   134k|  } else {
  270|   134k|    *correction_fac = (FLOAT32)1.0f;
  271|   134k|  }
  272|       |
  273|   239k|  return;
  274|   239k|}
ixheaace_fd_qc_adjthr.c:iusace_adapt_thr_to_pe:
  795|   124k|                                           WORD32 num_channels, WORD32 chn, UWORD8 *ptr_scratch) {
  796|   124k|  IA_ERRORCODE err_code;
  797|   124k|  FLOAT32 no_red_pe, red_pe, red_pe_no_ah;
  798|   124k|  FLOAT32 const_part, const_part_no_ah;
  799|   124k|  FLOAT32 nactive_lines, nactive_lines_no_ah;
  800|   124k|  FLOAT32 desired_pe_no_ah;
  801|   124k|  FLOAT32 redval = 0.0f;
  802|   124k|  WORD32 *ah_flag[2];
  803|   124k|  WORD32 iteration;
  804|   374k|  for (WORD32 i = 0; i < 2; i++) {
  ------------------
  |  Branch (804:22): [True: 249k, False: 124k]
  ------------------
  805|   249k|    ah_flag[i] = (WORD32 *)ptr_scratch;
  806|   249k|    ptr_scratch += (MAX_NUM_GROUPED_SFB) * sizeof(ah_flag[0][0]);
  ------------------
  |  |   24|   249k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  807|   249k|  }
  808|   124k|  FLOAT32 *thr_exp[2];
  809|   374k|  for (WORD32 i = 0; i < 2; i++) {
  ------------------
  |  Branch (809:22): [True: 249k, False: 124k]
  ------------------
  810|   249k|    thr_exp[i] = (FLOAT32 *)ptr_scratch;
  811|   249k|    ptr_scratch += (MAX_NUM_GROUPED_SFB) * sizeof(thr_exp[0][0]);
  ------------------
  |  |   24|   249k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  812|   249k|  }
  813|       |
  814|   124k|  iusace_calc_thr_exp(thr_exp, pstr_psy_out, num_channels, chn);
  815|   124k|  iusace_adapt_min_snr(pstr_psy_out, msa_param, num_channels, chn);
  816|   124k|  iusace_init_avoid_hole_flag(ah_flag, pstr_psy_out, str_ah_param, num_channels, chn);
  817|       |
  818|   124k|  no_red_pe = pstr_qs_pe_data->pe;
  819|   124k|  const_part = pstr_qs_pe_data->const_part;
  820|   124k|  nactive_lines = pstr_qs_pe_data->num_active_lines;
  821|   124k|  if (nactive_lines > FLT_EPSILON) {
  ------------------
  |  Branch (821:7): [True: 124k, False: 0]
  ------------------
  822|   124k|    FLOAT32 avg_thr_exp = (FLOAT32)pow(2.0f, (const_part - no_red_pe) /
  823|   124k|                  (INV_RED_EXP_VAL * nactive_lines));
  ------------------
  |  |   23|   124k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   22|   124k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  824|   124k|    redval = (FLOAT32)pow(2.0f, (const_part - desired_pe) / (INV_RED_EXP_VAL * nactive_lines)) -
  ------------------
  |  |   23|   124k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   22|   124k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  825|   124k|             avg_thr_exp;
  826|   124k|    redval = MAX(0.0f, redval);
  ------------------
  |  |   89|   124k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 124k]
  |  |  ------------------
  ------------------
  827|   124k|    iusace_reduce_thr(pstr_psy_out, ah_flag, thr_exp, redval, num_channels, chn);
  828|   124k|  }
  829|       |
  830|   124k|  iusace_calc_sfb_pe_data(pstr_qs_pe_data, pstr_psy_out, num_channels, chn);
  831|   124k|  red_pe = pstr_qs_pe_data->pe;
  832|       |
  833|   124k|  iteration = 0;
  834|   149k|  do {
  835|   149k|    iusace_calc_pe_no_active_holes(&red_pe_no_ah, &const_part_no_ah, &nactive_lines_no_ah,
  836|   149k|                                   pstr_qs_pe_data, ah_flag, pstr_psy_out, num_channels, chn);
  837|       |
  838|   149k|    desired_pe_no_ah = MAX(desired_pe - (red_pe - red_pe_no_ah), 0);
  ------------------
  |  |   89|   149k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 135k, False: 13.4k]
  |  |  ------------------
  ------------------
  839|   149k|    if (nactive_lines_no_ah > FLT_EPSILON) {
  ------------------
  |  Branch (839:9): [True: 146k, False: 2.31k]
  ------------------
  840|   146k|      FLOAT32 avg_thr_exp = (FLOAT32)pow(
  841|   146k|          2.0f, (const_part_no_ah - red_pe_no_ah) / (INV_RED_EXP_VAL * nactive_lines_no_ah));
  ------------------
  |  |   23|   146k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   22|   146k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  842|   146k|      redval += (FLOAT32)pow(2.0f, (const_part_no_ah - desired_pe_no_ah) /
  843|   146k|                                       (INV_RED_EXP_VAL * nactive_lines_no_ah)) -
  ------------------
  |  |   23|   146k|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   22|   146k|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  844|   146k|                avg_thr_exp;
  845|   146k|      redval = MAX(0.0f, redval);
  ------------------
  |  |   89|   146k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 59, False: 146k]
  |  |  ------------------
  ------------------
  846|   146k|      iusace_reduce_thr(pstr_psy_out, ah_flag, thr_exp, redval, num_channels, chn);
  847|   146k|    }
  848|       |
  849|   149k|    iusace_calc_sfb_pe_data(pstr_qs_pe_data, pstr_psy_out, num_channels, chn);
  850|   149k|    red_pe = pstr_qs_pe_data->pe;
  851|   149k|    iteration++;
  852|   149k|  } while ((fabs(red_pe - desired_pe) > (0.05f) * desired_pe) && (iteration < 2));
  ------------------
  |  Branch (852:12): [True: 41.2k, False: 108k]
  |  Branch (852:66): [True: 24.5k, False: 16.7k]
  ------------------
  853|   124k|  if (red_pe < 1.15f * desired_pe) {
  ------------------
  |  Branch (853:7): [True: 112k, False: 12.0k]
  ------------------
  854|   112k|    err_code = iusace_correct_thr(pstr_psy_out, ah_flag, pstr_qs_pe_data, thr_exp, redval,
  855|   112k|                                  desired_pe - red_pe, num_channels, chn, ptr_scratch);
  856|   112k|    if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   112k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (856:9): [True: 0, False: 112k]
  ------------------
  857|      0|      return err_code;
  858|      0|    }
  859|   112k|  } else {
  860|  12.0k|    iusace_reduce_min_snr(pstr_psy_out, pstr_qs_pe_data, ah_flag, 1.05f * desired_pe,
  861|  12.0k|                          num_channels, chn);
  862|  12.0k|    iusace_allow_more_holes(pstr_psy_out, pstr_qs_pe_data, ah_flag, str_ah_param,
  863|  12.0k|                            1.05f * desired_pe, num_channels, chn, ptr_scratch);
  864|  12.0k|  }
  865|       |
  866|   124k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   124k|#define IA_NO_ERROR 0x00000000
  ------------------
  867|   124k|}
ixheaace_fd_qc_adjthr.c:iusace_calc_thr_exp:
  277|   124k|                                WORD32 num_chans, WORD32 chn) {
  278|   124k|  WORD32 sfb, ch, scf_band_grp, idx = 0;
  279|   124k|  ia_psy_mod_out_data_struct *pstr_psy_chan_out;
  280|   124k|  FLOAT32 *scf_band_thr;
  281|   124k|  FLOAT32 *ptr_thr_exp;
  282|   344k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (282:18): [True: 219k, False: 124k]
  ------------------
  283|   219k|    pstr_psy_chan_out = &pstr_psy_out[ch];
  284|   219k|    ptr_thr_exp = thr_exp[idx];
  285|   687k|    for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (285:28): [True: 468k, False: 219k]
  ------------------
  286|   468k|         scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  287|   468k|      FLOAT32 *thr_exp1 = &ptr_thr_exp[scf_band_grp];
  288|   468k|      scf_band_thr = &pstr_psy_chan_out->ptr_sfb_thr[scf_band_grp];
  289|  9.61M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (289:21): [True: 9.14M, False: 468k]
  ------------------
  290|  9.14M|        thr_exp1[sfb] = (FLOAT32)pow(*scf_band_thr++, RED_EXP_VAL);
  ------------------
  |  |   22|  9.14M|#define RED_EXP_VAL 0.25f
  ------------------
  291|  9.14M|      }
  292|   468k|    }
  293|   219k|    idx++;
  294|   219k|  }
  295|       |
  296|   124k|  return;
  297|   124k|}
ixheaace_fd_qc_adjthr.c:iusace_adapt_min_snr:
  301|   124k|                                 WORD32 num_chans, WORD32 chn) {
  302|   124k|  WORD32 num_sfb = 0, ch, scf_band_cnt, sfb_off, sfb;
  303|   124k|  FLOAT32 avg_energy = 0.0f, db_ratio, min_snr_red;
  304|   124k|  WORD32 i;
  305|   344k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (305:18): [True: 219k, False: 124k]
  ------------------
  306|   219k|    ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  307|       |
  308|   219k|    num_sfb = 0;
  309|   219k|    avg_energy = 0;
  310|   219k|    scf_band_cnt = pstr_psy_chan_out->max_sfb_per_grp;
  311|       |
  312|   687k|    for (sfb_off = 0; sfb_off < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (312:23): [True: 468k, False: 219k]
  ------------------
  313|   468k|         sfb_off += pstr_psy_chan_out->sfb_per_group) {
  314|   468k|      FLOAT32 *sfb_energy = &pstr_psy_chan_out->ptr_sfb_energy[sfb_off];
  315|  9.61M|      for (sfb = scf_band_cnt - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (315:36): [True: 9.14M, False: 468k]
  ------------------
  316|  9.14M|        avg_energy += sfb_energy[sfb];
  317|  9.14M|      }
  318|   468k|      num_sfb += scf_band_cnt;
  319|   468k|    }
  320|       |
  321|   219k|    if (num_sfb > 0) {
  ------------------
  |  Branch (321:9): [True: 219k, False: 292]
  ------------------
  322|   219k|      avg_energy /= num_sfb;
  323|   219k|    }
  324|       |
  325|   687k|    for (sfb_off = 0; sfb_off < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (325:23): [True: 468k, False: 219k]
  ------------------
  326|   468k|         sfb_off += pstr_psy_chan_out->sfb_per_group) {
  327|   468k|      i = sfb_off;
  328|  9.61M|      for (sfb = scf_band_cnt - 1; sfb >= 0; sfb--, i++) {
  ------------------
  |  Branch (328:36): [True: 9.14M, False: 468k]
  ------------------
  329|  9.14M|        if (pstr_min_snr_params->start_ratio * pstr_psy_chan_out->ptr_sfb_energy[i] <
  ------------------
  |  Branch (329:13): [True: 6.25M, False: 2.89M]
  ------------------
  330|  9.14M|            avg_energy) {
  331|  6.25M|          db_ratio =
  332|  6.25M|              (FLOAT32)(10.0 * log10((MIN_FLT_VAL + avg_energy) /
  ------------------
  |  |   31|  6.25M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  333|  6.25M|                                     (MIN_FLT_VAL + pstr_psy_chan_out->ptr_sfb_energy[i])));
  ------------------
  |  |   31|  6.25M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  334|  6.25M|          min_snr_red =
  335|  6.25M|              pstr_min_snr_params->red_offs + pstr_min_snr_params->red_ratio_fac * db_ratio;
  336|  6.25M|          min_snr_red = MAX(min_snr_red, pstr_min_snr_params->max_red);
  ------------------
  |  |   89|  6.25M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 2.20M, False: 4.04M]
  |  |  ------------------
  ------------------
  337|  6.25M|          pstr_psy_chan_out->sfb_min_snr[i] =
  338|  6.25M|              (FLOAT32)pow(pstr_psy_out[ch].sfb_min_snr[i], min_snr_red);
  339|  6.25M|          pstr_psy_chan_out->sfb_min_snr[i] = MIN(MIN_SNR_LIMIT, pstr_psy_out[ch].sfb_min_snr[i]);
  ------------------
  |  |   86|  6.25M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 3.36M, False: 2.88M]
  |  |  ------------------
  ------------------
  340|  6.25M|        }
  341|  9.14M|      }
  342|   468k|    }
  343|   219k|  }
  344|       |
  345|   124k|  return;
  346|   124k|}
ixheaace_fd_qc_adjthr.c:iusace_init_avoid_hole_flag:
  351|   124k|                                        WORD32 chn) {
  352|   124k|  WORD32 ch, idx;
  353|   124k|  FLOAT32 sfb_energy;
  354|   124k|  FLOAT32 scale_spread_energy;
  355|   124k|  WORD32 scf_band_grp, sfb, scf_band;
  356|   124k|  FLOAT32 *ptr_scf_band_spread_energy, *ptr_scf_band_energy, *ptr_scf_band_min_snr;
  357|   344k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (357:18): [True: 219k, False: 124k]
  ------------------
  358|   219k|    ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  359|       |
  360|   219k|    if (pstr_psy_chan_out->window_sequence != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   219k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (360:9): [True: 134k, False: 84.9k]
  ------------------
  361|   134k|      scale_spread_energy = 0.5f;
  362|   134k|    } else {
  363|  84.9k|      scale_spread_energy = 0.63f;
  364|  84.9k|    }
  365|       |
  366|   687k|    for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (366:28): [True: 468k, False: 219k]
  ------------------
  367|   468k|         scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  368|   468k|      ptr_scf_band_spread_energy = &pstr_psy_chan_out->ptr_sfb_spread_energy[scf_band_grp];
  369|   468k|      sfb = pstr_psy_chan_out->max_sfb_per_grp;
  370|  9.61M|      for (scf_band = sfb - 1; scf_band >= 0; scf_band--) {
  ------------------
  |  Branch (370:32): [True: 9.14M, False: 468k]
  ------------------
  371|  9.14M|        *ptr_scf_band_spread_energy = *ptr_scf_band_spread_energy * scale_spread_energy;
  372|  9.14M|        ptr_scf_band_spread_energy++;
  373|  9.14M|      }
  374|   468k|    }
  375|   219k|  }
  376|       |
  377|   124k|  if (pstr_ah_param->modify_min_snr) {
  ------------------
  |  Branch (377:7): [True: 124k, False: 254]
  ------------------
  378|   343k|    for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (378:20): [True: 219k, False: 124k]
  ------------------
  379|   219k|      ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  380|   219k|      ptr_scf_band_energy = pstr_psy_chan_out->ptr_sfb_energy;
  381|       |
  382|   219k|      ptr_scf_band_min_snr = pstr_psy_chan_out->sfb_min_snr;
  383|       |
  384|   686k|      for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (384:30): [True: 467k, False: 219k]
  ------------------
  385|   467k|           scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  386|  9.60M|        for (scf_band = 0; scf_band < pstr_psy_chan_out->max_sfb_per_grp; scf_band++) {
  ------------------
  |  Branch (386:28): [True: 9.13M, False: 467k]
  ------------------
  387|  9.13M|          FLOAT32 sfb_en_m1, sfb_en_p1, avg_energy;
  388|  9.13M|          if (scf_band > 0) {
  ------------------
  |  Branch (388:15): [True: 8.66M, False: 466k]
  ------------------
  389|  8.66M|            sfb_en_m1 = ptr_scf_band_energy[scf_band_grp + scf_band - 1];
  390|  8.66M|          } else {
  391|   466k|            sfb_en_m1 = ptr_scf_band_energy[scf_band_grp];
  392|   466k|          }
  393|  9.13M|          if (scf_band < pstr_psy_chan_out->max_sfb_per_grp - 1)
  ------------------
  |  Branch (393:15): [True: 8.66M, False: 466k]
  ------------------
  394|  8.66M|            sfb_en_p1 = ptr_scf_band_energy[scf_band_grp + scf_band + 1];
  395|   466k|          else
  396|   466k|            sfb_en_p1 = ptr_scf_band_energy[scf_band_grp + scf_band];
  397|       |
  398|  9.13M|          avg_energy = (sfb_en_m1 + sfb_en_p1) / (FLOAT32)2.0f;
  399|  9.13M|          sfb_energy = ptr_scf_band_energy[scf_band_grp + scf_band];
  400|       |
  401|  9.13M|          if (sfb_energy > avg_energy) {
  ------------------
  |  Branch (401:15): [True: 2.84M, False: 6.28M]
  ------------------
  402|  2.84M|            FLOAT32 temp_min_snr = MAX((FLOAT32)0.8f * avg_energy / sfb_energy, (FLOAT32)0.316f);
  ------------------
  |  |   89|  2.84M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 2.46M, False: 384k]
  |  |  ------------------
  ------------------
  403|  2.84M|            if (pstr_psy_chan_out->window_sequence != EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   40|  2.84M|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (403:17): [True: 1.80M, False: 1.03M]
  ------------------
  404|  1.80M|              temp_min_snr = MAX(temp_min_snr, (FLOAT32)0.316f);
  ------------------
  |  |   89|  1.80M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 1.54M, False: 262k]
  |  |  ------------------
  ------------------
  405|  1.03M|            else
  406|  1.03M|              temp_min_snr = MAX(temp_min_snr, (FLOAT32)0.5f);
  ------------------
  |  |   89|  1.03M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 523k, False: 516k]
  |  |  ------------------
  ------------------
  407|  2.84M|            ptr_scf_band_min_snr[scf_band_grp + scf_band] =
  408|  2.84M|                MIN(ptr_scf_band_min_snr[scf_band_grp + scf_band], temp_min_snr);
  ------------------
  |  |   86|  2.84M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 1.33M, False: 1.51M]
  |  |  ------------------
  ------------------
  409|  2.84M|          }
  410|       |
  411|  9.13M|          if (((FLOAT32)2.0f * sfb_energy < avg_energy) && (sfb_energy > (FLOAT32)0.0f)) {
  ------------------
  |  Branch (411:15): [True: 1.73M, False: 7.39M]
  |  Branch (411:60): [True: 1.66M, False: 73.0k]
  ------------------
  412|  1.66M|            FLOAT32 temp_min_snr = avg_energy / ((FLOAT32)2.0f * sfb_energy) *
  413|  1.66M|                                   ptr_scf_band_min_snr[scf_band_grp + scf_band];
  414|  1.66M|            temp_min_snr = MIN((FLOAT32)0.8f, temp_min_snr);
  ------------------
  |  |   86|  1.66M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 1.16M, False: 499k]
  |  |  ------------------
  ------------------
  415|  1.66M|            ptr_scf_band_min_snr[scf_band_grp + scf_band] =
  416|  1.66M|                MIN(temp_min_snr, ptr_scf_band_min_snr[scf_band_grp + scf_band] * (FLOAT32)3.16f);
  ------------------
  |  |   86|  1.66M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 1.43M, False: 230k]
  |  |  ------------------
  ------------------
  417|  1.66M|          }
  418|  9.13M|        }
  419|   467k|      }
  420|   219k|    }
  421|   124k|  }
  422|       |
  423|   124k|  if (num_chans == 2) {
  ------------------
  |  Branch (423:7): [True: 94.8k, False: 29.9k]
  ------------------
  424|  94.8k|    ia_psy_mod_out_data_struct *psy_out_mid = &pstr_psy_out[chn];
  425|  94.8k|    ia_psy_mod_out_data_struct *psy_out_side = &pstr_psy_out[chn + 1];
  426|       |
  427|  4.50M|    for (sfb = 0; sfb < psy_out_mid->sfb_count; sfb++) {
  ------------------
  |  Branch (427:19): [True: 4.41M, False: 94.8k]
  ------------------
  428|  4.41M|      if (pstr_psy_out[chn].ms_used[sfb]) {
  ------------------
  |  Branch (428:11): [True: 3.41M, False: 991k]
  ------------------
  429|  3.41M|        FLOAT32 sfb_en_mid = psy_out_mid->ptr_sfb_energy[sfb];
  430|  3.41M|        FLOAT32 sfb_en_side = psy_out_side->ptr_sfb_energy[sfb];
  431|  3.41M|        FLOAT32 max_sfb_en = MAX(sfb_en_mid, sfb_en_side);
  ------------------
  |  |   89|  3.41M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 2.56M, False: 850k]
  |  |  ------------------
  ------------------
  432|  3.41M|        FLOAT32 max_thr = 0.25f * psy_out_mid->sfb_min_snr[sfb] * max_sfb_en;
  433|       |
  434|  3.41M|        psy_out_mid->sfb_min_snr[sfb] = (FLOAT32)MAX(
  ------------------
  |  |   89|  6.83M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 3.29M, False: 124k]
  |  |  |  Branch (89:27): [True: 1.70k, False: 3.41M]
  |  |  |  Branch (89:39): [True: 1.70k, False: 122k]
  |  |  ------------------
  ------------------
  435|  3.41M|            psy_out_mid->sfb_min_snr[sfb],
  436|  3.41M|            MIN(MAX_FLT_VAL, ((double)max_thr / (MIN_FLT_VAL + (double)sfb_en_mid))));
  437|       |
  438|  3.41M|        if (psy_out_mid->ptr_sfb_energy[sfb] <= 1.0f) {
  ------------------
  |  Branch (438:13): [True: 455k, False: 2.96M]
  ------------------
  439|   455k|          psy_out_mid->ptr_sfb_energy[sfb] = MIN(psy_out_mid->ptr_sfb_energy[sfb], 0.8f);
  ------------------
  |  |   86|   455k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 452k, False: 2.81k]
  |  |  ------------------
  ------------------
  440|   455k|        }
  441|       |
  442|  3.41M|        psy_out_side->sfb_min_snr[sfb] = (FLOAT32)MAX(
  ------------------
  |  |   89|  6.83M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 1.41M, False: 2.00M]
  |  |  |  Branch (89:27): [True: 932k, False: 2.48M]
  |  |  |  Branch (89:39): [True: 932k, False: 1.06M]
  |  |  ------------------
  ------------------
  443|  3.41M|            psy_out_side->sfb_min_snr[sfb],
  444|  3.41M|            MIN(MAX_FLT_VAL, ((double)max_thr / (MIN_FLT_VAL + (double)sfb_en_side))));
  445|       |
  446|  3.41M|        if (psy_out_side->sfb_min_snr[sfb] <= 1.0f) {
  ------------------
  |  Branch (446:13): [True: 1.66M, False: 1.75M]
  ------------------
  447|  1.66M|          psy_out_side->sfb_min_snr[sfb] = MIN(psy_out_side->sfb_min_snr[sfb], 0.8f);
  ------------------
  |  |   86|  1.66M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 957k, False: 705k]
  |  |  ------------------
  ------------------
  448|  1.66M|        }
  449|       |
  450|  3.41M|        if (sfb_en_mid > psy_out_mid->ptr_sfb_spread_energy[sfb]) {
  ------------------
  |  Branch (450:13): [True: 2.85M, False: 566k]
  ------------------
  451|  2.85M|          psy_out_side->ptr_sfb_spread_energy[sfb] = 0.9f * sfb_en_side;
  452|  2.85M|        }
  453|       |
  454|  3.41M|        if (sfb_en_side > psy_out_side->ptr_sfb_spread_energy[sfb]) {
  ------------------
  |  Branch (454:13): [True: 1.94M, False: 1.47M]
  ------------------
  455|  1.94M|          psy_out_mid->ptr_sfb_spread_energy[sfb] = 0.9f * sfb_en_mid;
  456|  1.94M|        }
  457|  3.41M|      }
  458|  4.41M|    }
  459|  94.8k|  }
  460|   124k|  idx = 0;
  461|   344k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (461:18): [True: 219k, False: 124k]
  ------------------
  462|   219k|    ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  463|   687k|    for (scf_band_grp = 0; scf_band_grp < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (463:28): [True: 468k, False: 219k]
  ------------------
  464|   468k|         scf_band_grp += pstr_psy_chan_out->sfb_per_group) {
  465|  9.61M|      for (scf_band = 0; scf_band < pstr_psy_chan_out->max_sfb_per_grp; scf_band++) {
  ------------------
  |  Branch (465:26): [True: 9.14M, False: 468k]
  ------------------
  466|  9.14M|        if (pstr_psy_chan_out->ptr_sfb_spread_energy[scf_band_grp + scf_band] >
  ------------------
  |  Branch (466:13): [True: 1.24M, False: 7.90M]
  ------------------
  467|  9.14M|                pstr_psy_chan_out->ptr_sfb_energy[scf_band_grp + scf_band] ||
  468|  7.90M|            pstr_psy_chan_out->sfb_min_snr[scf_band_grp + scf_band] > (float)1.0) {
  ------------------
  |  Branch (468:13): [True: 1.73M, False: 6.17M]
  ------------------
  469|  2.97M|          ah_flag[idx][scf_band_grp + scf_band] = NO_AH;
  470|  6.17M|        } else {
  471|  6.17M|          ah_flag[idx][scf_band_grp + scf_band] = AH_INACTIVE;
  472|  6.17M|        }
  473|  9.14M|      }
  474|       |
  475|   468k|      for (scf_band = pstr_psy_chan_out->max_sfb_per_grp;
  476|  1.47M|           scf_band < pstr_psy_chan_out->sfb_per_group; scf_band++) {
  ------------------
  |  Branch (476:12): [True: 1.00M, False: 468k]
  ------------------
  477|  1.00M|        ah_flag[idx][scf_band_grp + scf_band] = NO_AH;
  478|  1.00M|      }
  479|   468k|    }
  480|   219k|    idx++;
  481|   219k|  }
  482|       |
  483|   124k|  return;
  484|   124k|}
ixheaace_fd_qc_adjthr.c:iusace_reduce_thr:
  488|   271k|                              WORD32 chn) {
  489|   271k|  WORD32 ch, sfb_group, sfb, idx = 0;
  490|   271k|  FLOAT32 sfb_energy, sfb_threshold, sfb_thr_reduced;
  491|   271k|  FLOAT32 *sfb_energy_fix, *sfb_threshold_fix, *sfb_min_snr_fix, *thr_exp_fix;
  492|   753k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (492:18): [True: 481k, False: 271k]
  ------------------
  493|   481k|    ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  494|   481k|    sfb_energy_fix = pstr_psy_chan_out->ptr_sfb_energy;
  495|   481k|    sfb_threshold_fix = pstr_psy_chan_out->ptr_sfb_thr;
  496|   481k|    sfb_min_snr_fix = pstr_psy_chan_out->sfb_min_snr;
  497|   481k|    thr_exp_fix = &thr_exp[idx][0];
  498|  1.49M|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (498:25): [True: 1.01M, False: 481k]
  ------------------
  499|  1.01M|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  500|  20.6M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (500:21): [True: 19.6M, False: 1.01M]
  ------------------
  501|  19.6M|        sfb_energy = sfb_energy_fix[sfb_group + sfb];
  502|  19.6M|        sfb_threshold = sfb_threshold_fix[sfb_group + sfb];
  503|  19.6M|        if (sfb_energy > sfb_threshold) {
  ------------------
  |  Branch (503:13): [True: 13.8M, False: 5.79M]
  ------------------
  504|  13.8M|          sfb_thr_reduced =
  505|  13.8M|              (FLOAT32)pow((thr_exp_fix[sfb_group + sfb] + red_value), INV_RED_EXP_VAL);
  ------------------
  |  |   23|  13.8M|#define INV_RED_EXP_VAL (1.0f / RED_EXP_VAL)
  |  |  ------------------
  |  |  |  |   22|  13.8M|#define RED_EXP_VAL 0.25f
  |  |  ------------------
  ------------------
  506|       |
  507|  13.8M|          if ((sfb_thr_reduced > sfb_min_snr_fix[sfb_group + sfb] * sfb_energy) &&
  ------------------
  |  Branch (507:15): [True: 3.75M, False: 10.1M]
  ------------------
  508|  3.75M|              (ah_flag[idx][sfb_group + sfb] != NO_AH)) {
  ------------------
  |  Branch (508:15): [True: 3.48M, False: 264k]
  ------------------
  509|  3.48M|            sfb_thr_reduced = MAX(sfb_min_snr_fix[sfb_group + sfb] * sfb_energy, sfb_threshold);
  ------------------
  |  |   89|  3.48M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 1.69M, False: 1.79M]
  |  |  ------------------
  ------------------
  510|  3.48M|            ah_flag[idx][sfb_group + sfb] = AH_ACTIVE;
  511|  3.48M|          }
  512|  13.8M|          sfb_threshold_fix[sfb_group + sfb] = sfb_thr_reduced;
  513|  13.8M|        }
  514|  19.6M|      }
  515|  1.01M|    }
  516|   481k|    idx++;
  517|   481k|  }
  518|       |
  519|   271k|  return;
  520|   271k|}
ixheaace_fd_qc_adjthr.c:iusace_calc_pe_no_active_holes:
  527|   149k|                                           WORD32 num_channels, WORD32 chn) {
  528|   149k|  WORD32 ch, sfb_group, sfb, idx = 0;
  529|   149k|  *pe = 0.0f;
  530|   149k|  *const_part = 0.0f;
  531|   149k|  *nactive_lines = 0;
  532|   415k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (532:18): [True: 266k, False: 149k]
  ------------------
  533|   266k|    ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  534|   266k|    ia_qc_pe_chan_data_struct *pe_channel_data = &pstr_qs_pe_data->pe_ch_data[idx];
  535|       |
  536|   814k|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (536:25): [True: 547k, False: 266k]
  ------------------
  537|   547k|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  538|  11.2M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (538:21): [True: 10.6M, False: 547k]
  ------------------
  539|  10.6M|        if (ah_flag[idx][sfb_group + sfb] < AH_ACTIVE) {
  ------------------
  |  Branch (539:13): [True: 8.75M, False: 1.92M]
  ------------------
  540|  8.75M|          *pe += pe_channel_data->sfb_pe[sfb_group + sfb];
  541|  8.75M|          *const_part += pe_channel_data->sfb_const_part[sfb_group + sfb];
  542|  8.75M|          *nactive_lines += pe_channel_data->num_sfb_active_lines[sfb_group + sfb];
  543|  8.75M|        }
  544|  10.6M|      }
  545|   547k|    }
  546|   266k|    idx++;
  547|   266k|  }
  548|       |
  549|   149k|  return;
  550|   149k|}
ixheaace_fd_qc_adjthr.c:iusace_correct_thr:
  555|   112k|                                       WORD32 num_channels, WORD32 chn, UWORD8 *ptr_scratch) {
  556|   112k|  WORD32 i, ch, sfb_group, sfb, idx = 0;
  557|   112k|  FLOAT32 delta_sfb_pe;
  558|   112k|  FLOAT32 thr_factor;
  559|   112k|  FLOAT32 norm_factor[2] = {0};
  560|   112k|  FLOAT32 *sfb_pe_factors[2];
  561|   338k|  for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (561:15): [True: 225k, False: 112k]
  ------------------
  562|   225k|    sfb_pe_factors[i] = (FLOAT32 *)ptr_scratch;
  563|   225k|    ptr_scratch += (MAX_NUM_GROUPED_SFB) * sizeof(sfb_pe_factors[0][0]);
  ------------------
  |  |   24|   225k|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  564|   225k|  }
  565|   112k|  FLOAT32 sfb_en, sfb_thr, sfb_thr_reduced;
  566|   112k|  FLOAT32 *p_thr_exp;
  567|   112k|  FLOAT32 *p_sfb_energy, *p_sfb_thr, *p_sfb_min_snr;
  568|   112k|  ia_psy_mod_out_data_struct *pstr_psy_chan_out = NULL;
  569|   112k|  ia_qc_pe_chan_data_struct *pe_channel_data = NULL;
  570|       |
  571|   308k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (571:18): [True: 195k, False: 112k]
  ------------------
  572|   195k|    if (idx >= IXHEAACE_MAX_CH_IN_BS_ELE) {
  ------------------
  |  |   22|   195k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (572:9): [True: 0, False: 195k]
  ------------------
  573|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_NUM_CHANNEL;
  574|      0|    }
  575|   195k|    pstr_psy_chan_out = &pstr_psy_out[ch];
  576|   195k|    pe_channel_data = &pstr_qs_pe_data->pe_ch_data[idx];
  577|   195k|    norm_factor[idx] = MIN_FLT_VAL;
  ------------------
  |  |   31|   195k|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  578|   195k|    p_thr_exp = thr_exp[idx];
  579|       |
  580|   627k|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (580:25): [True: 431k, False: 195k]
  ------------------
  581|   431k|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  582|  8.84M|      for (sfb = 0; sfb < pstr_psy_chan_out->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (582:21): [True: 8.41M, False: 431k]
  ------------------
  583|  8.41M|        if ((ah_flag[idx][sfb_group + sfb] < AH_ACTIVE) || (delta_pe > 0)) {
  ------------------
  |  Branch (583:13): [True: 7.33M, False: 1.07M]
  |  Branch (583:60): [True: 215k, False: 862k]
  ------------------
  584|  7.55M|          sfb_pe_factors[idx][sfb_group + sfb] =
  585|  7.55M|              pe_channel_data->num_sfb_active_lines[sfb_group + sfb] /
  586|  7.55M|              (p_thr_exp[sfb_group + sfb] + red_value);
  587|  7.55M|          norm_factor[idx] += sfb_pe_factors[idx][sfb_group + sfb];
  588|  7.55M|        } else {
  589|   862k|          sfb_pe_factors[idx][sfb_group + sfb] = 0.0f;
  590|   862k|        }
  591|  8.41M|      }
  592|   431k|    }
  593|   195k|    idx++;
  594|   195k|  }
  595|   112k|  if (num_channels > 1) {
  ------------------
  |  Branch (595:7): [True: 83.2k, False: 29.4k]
  ------------------
  596|  83.2k|    norm_factor[0] = norm_factor[0] + norm_factor[1];
  597|  83.2k|  }
  598|   112k|  norm_factor[0] = 1.0f / norm_factor[0];
  599|   112k|  idx = 0;
  600|   308k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (600:18): [True: 195k, False: 112k]
  ------------------
  601|   195k|    if (idx >= IXHEAACE_MAX_CH_IN_BS_ELE) {
  ------------------
  |  |   22|   195k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (601:9): [True: 0, False: 195k]
  ------------------
  602|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_NUM_CHANNEL;
  603|      0|    }
  604|   195k|    pstr_psy_chan_out = &pstr_psy_out[ch];
  605|   195k|    pe_channel_data = &pstr_qs_pe_data->pe_ch_data[idx];
  606|   195k|    p_sfb_energy = pstr_psy_chan_out->ptr_sfb_energy;
  607|   195k|    p_sfb_thr = pstr_psy_chan_out->ptr_sfb_thr;
  608|   195k|    p_sfb_min_snr = pstr_psy_chan_out->sfb_min_snr;
  609|       |
  610|   627k|    for (sfb_group = 0; sfb_group < pstr_psy_chan_out->sfb_count;
  ------------------
  |  Branch (610:25): [True: 431k, False: 195k]
  ------------------
  611|   431k|         sfb_group += pstr_psy_chan_out->sfb_per_group) {
  612|   431k|      i = sfb_group;
  613|  8.84M|      for (sfb = pstr_psy_chan_out->max_sfb_per_grp - 1; sfb >= 0; sfb--, i++) {
  ------------------
  |  Branch (613:58): [True: 8.41M, False: 431k]
  ------------------
  614|  8.41M|        delta_sfb_pe = sfb_pe_factors[idx][i] * norm_factor[0] * delta_pe;
  615|  8.41M|        if (pe_channel_data->num_sfb_active_lines[i] > (FLOAT32)0.5f) {
  ------------------
  |  Branch (615:13): [True: 5.47M, False: 2.93M]
  ------------------
  616|  5.47M|          sfb_en = p_sfb_energy[i];
  617|  5.47M|          sfb_thr = p_sfb_thr[i];
  618|  5.47M|          thr_factor = MIN(-delta_sfb_pe / pe_channel_data->num_sfb_active_lines[i], 20.f);
  ------------------
  |  |   86|  5.47M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 5.47M, False: 206]
  |  |  ------------------
  ------------------
  619|  5.47M|          thr_factor = (FLOAT32)pow(2.0f, thr_factor);
  620|  5.47M|          sfb_thr_reduced = sfb_thr * thr_factor;
  621|       |
  622|  5.47M|          if ((sfb_thr_reduced > p_sfb_min_snr[i] * sfb_en) && (ah_flag[idx][i] == AH_INACTIVE)) {
  ------------------
  |  Branch (622:15): [True: 86.3k, False: 5.39M]
  |  Branch (622:64): [True: 25.9k, False: 60.3k]
  ------------------
  623|  25.9k|            sfb_thr_reduced = MAX(p_sfb_min_snr[i] * sfb_en, sfb_thr);
  ------------------
  |  |   89|  25.9k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 25.9k, False: 8]
  |  |  ------------------
  ------------------
  624|  25.9k|            ah_flag[idx][i] = AH_ACTIVE;
  625|  25.9k|          }
  626|  5.47M|          p_sfb_thr[i] = sfb_thr_reduced;
  627|  5.47M|        }
  628|  8.41M|      }
  629|   431k|    }
  630|   195k|    idx++;
  631|   195k|  }
  632|       |
  633|   112k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   112k|#define IA_NO_ERROR 0x00000000
  ------------------
  634|   112k|}
ixheaace_fd_qc_adjthr.c:iusace_reduce_min_snr:
  638|  12.0k|                                  const FLOAT32 desired_pe, WORD32 num_channels, WORD32 chn) {
  639|  12.0k|  WORD32 sfb, sfb_sub_win, ch, idx;
  640|  12.0k|  FLOAT32 delta_pe;
  641|       |
  642|  12.0k|  sfb_sub_win = pstr_psy_out[chn].max_sfb_per_grp;
  643|       |
  644|   329k|  while (pstr_qs_pe_data->pe > desired_pe && sfb_sub_win > 0) {
  ------------------
  |  Branch (644:10): [True: 327k, False: 2.05k]
  |  Branch (644:46): [True: 317k, False: 9.96k]
  ------------------
  645|   317k|    sfb_sub_win--;
  646|   685k|    for (sfb = sfb_sub_win; sfb < pstr_psy_out[chn].sfb_count;
  ------------------
  |  Branch (646:29): [True: 369k, False: 315k]
  ------------------
  647|   369k|         sfb += pstr_psy_out[chn].sfb_per_group) {
  648|   369k|      idx = 0;
  649|  1.09M|      for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (649:22): [True: 723k, False: 369k]
  ------------------
  650|   723k|        if (ah_flag[idx][sfb] != NO_AH && pstr_psy_out[ch].sfb_min_snr[sfb] < MIN_SNR_LIMIT) {
  ------------------
  |  |   24|   654k|#define MIN_SNR_LIMIT 0.8f
  ------------------
  |  Branch (650:13): [True: 654k, False: 69.0k]
  |  Branch (650:43): [True: 360k, False: 294k]
  ------------------
  651|   360k|          pstr_psy_out[ch].sfb_min_snr[sfb] = MIN_SNR_LIMIT;
  ------------------
  |  |   24|   360k|#define MIN_SNR_LIMIT 0.8f
  ------------------
  652|   360k|          pstr_psy_out[ch].ptr_sfb_thr[sfb] =
  653|   360k|              pstr_psy_out[ch].ptr_sfb_energy[sfb] * pstr_psy_out[ch].sfb_min_snr[sfb];
  654|   360k|          delta_pe = pstr_qs_pe_data->pe_ch_data[idx].sfb_lines[sfb] * 1.5f -
  655|   360k|                     pstr_qs_pe_data->pe_ch_data[idx].sfb_pe[sfb];
  656|   360k|          pstr_qs_pe_data->pe += delta_pe;
  657|   360k|          pstr_qs_pe_data->pe_ch_data[idx].pe += delta_pe;
  658|   360k|        }
  659|   723k|        idx++;
  660|   723k|      }
  661|   369k|      if (pstr_qs_pe_data->pe <= desired_pe) break;
  ------------------
  |  Branch (661:11): [True: 2.05k, False: 367k]
  ------------------
  662|   369k|    }
  663|   317k|  }
  664|       |
  665|  12.0k|  return;
  666|  12.0k|}
ixheaace_fd_qc_adjthr.c:iusace_allow_more_holes:
  672|  12.0k|                                    UWORD8 *ptr_scratch) {
  673|  12.0k|  WORD32 sfb, ch, idx;
  674|  12.0k|  FLOAT32 act_pe = pstr_qs_pe_data->pe;
  675|       |
  676|  12.0k|  if (num_channels == 2 &&
  ------------------
  |  Branch (676:7): [True: 11.5k, False: 484]
  ------------------
  677|  11.5k|      pstr_psy_out[chn].window_sequence == pstr_psy_out[chn + 1].window_sequence) {
  ------------------
  |  Branch (677:7): [True: 11.5k, False: 0]
  ------------------
  678|  11.5k|    ia_psy_mod_out_data_struct *psy_out_left = &pstr_psy_out[chn];
  679|  11.5k|    ia_psy_mod_out_data_struct *psy_out_right = &pstr_psy_out[chn + 1];
  680|       |
  681|   398k|    for (sfb = 0; sfb < psy_out_left->sfb_count; sfb++) {
  ------------------
  |  Branch (681:19): [True: 389k, False: 9.62k]
  ------------------
  682|   389k|      if (pstr_psy_out[chn].ms_used[sfb]) {
  ------------------
  |  Branch (682:11): [True: 189k, False: 199k]
  ------------------
  683|   189k|        if (ah_flag[1][sfb] != NO_AH &&
  ------------------
  |  Branch (683:13): [True: 141k, False: 48.1k]
  ------------------
  684|   141k|            0.4f * psy_out_left->sfb_min_snr[sfb] * psy_out_left->ptr_sfb_energy[sfb] >
  ------------------
  |  Branch (684:13): [True: 9.75k, False: 132k]
  ------------------
  685|   141k|                psy_out_right->ptr_sfb_energy[sfb]) {
  686|  9.75k|          ah_flag[1][sfb] = NO_AH;
  687|       |
  688|  9.75k|          psy_out_right->ptr_sfb_thr[sfb] = 2.0f * psy_out_right->ptr_sfb_energy[sfb];
  689|       |
  690|  9.75k|          act_pe -= pstr_qs_pe_data->pe_ch_data[1].sfb_pe[sfb];
  691|   180k|        } else {
  692|   180k|          if (ah_flag[0][sfb] != NO_AH &&
  ------------------
  |  Branch (692:15): [True: 158k, False: 22.1k]
  ------------------
  693|   158k|              0.4f * psy_out_right->sfb_min_snr[sfb] * psy_out_right->ptr_sfb_energy[sfb] >
  ------------------
  |  Branch (693:15): [True: 5.88k, False: 152k]
  ------------------
  694|   158k|                  psy_out_left->ptr_sfb_energy[sfb]) {
  695|  5.88k|            ah_flag[0][sfb] = NO_AH;
  696|       |
  697|  5.88k|            psy_out_left->ptr_sfb_thr[sfb] = 2.0f * psy_out_left->ptr_sfb_energy[sfb];
  698|       |
  699|  5.88k|            act_pe -= pstr_qs_pe_data->pe_ch_data[0].sfb_pe[sfb];
  700|  5.88k|          }
  701|   180k|        }
  702|   189k|        if (act_pe < desired_pe) break;
  ------------------
  |  Branch (702:13): [True: 1.91k, False: 188k]
  ------------------
  703|   189k|      }
  704|   389k|    }
  705|  11.5k|  }
  706|  12.0k|  if (act_pe > desired_pe) {
  ------------------
  |  Branch (706:7): [True: 9.53k, False: 2.48k]
  ------------------
  707|  9.53k|    WORD32 *start_sfb = (WORD32 *)ptr_scratch;
  708|  9.53k|    memset(start_sfb, 0, MAX_TIME_CHANNELS * sizeof(start_sfb[0]));
  ------------------
  |  |   56|  9.53k|#define MAX_TIME_CHANNELS (2)
  ------------------
  709|  9.53k|    FLOAT32 average_energy, min_energy;
  710|  9.53k|    WORD32 ah_cnt;
  711|  9.53k|    WORD32 en_idx;
  712|  9.53k|    FLOAT32 energy[4];
  713|  9.53k|    WORD32 min_sfb, max_sfb;
  714|  9.53k|    WORD32 done;
  715|  28.4k|    for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (715:20): [True: 18.9k, False: 9.53k]
  ------------------
  716|  18.9k|      if (pstr_psy_out[ch].window_sequence != EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   40|  18.9k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (716:11): [True: 15.8k, False: 3.07k]
  ------------------
  717|  15.8k|        start_sfb[ch] = str_ah_param->start_sfb_long;
  718|  3.07k|      else
  719|  3.07k|        start_sfb[ch] = str_ah_param->start_sfb_short;
  720|  18.9k|    }
  721|       |
  722|  9.53k|    average_energy = 0.0f;
  723|  9.53k|    min_energy = MAX_FLT_VAL;
  ------------------
  |  |   30|  9.53k|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  724|  9.53k|    ah_cnt = 0;
  725|  9.53k|    idx = 0;
  726|  28.4k|    for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (726:20): [True: 18.9k, False: 9.53k]
  ------------------
  727|  18.9k|      ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  728|   515k|      for (sfb = start_sfb[ch]; sfb < pstr_psy_chan_out->sfb_count; sfb++) {
  ------------------
  |  Branch (728:33): [True: 496k, False: 18.9k]
  ------------------
  729|   496k|        if ((ah_flag[idx][sfb] != NO_AH) &&
  ------------------
  |  Branch (729:13): [True: 305k, False: 191k]
  ------------------
  730|   305k|            (pstr_psy_chan_out->ptr_sfb_energy[sfb] > pstr_psy_chan_out->ptr_sfb_thr[sfb])) {
  ------------------
  |  Branch (730:13): [True: 298k, False: 7.26k]
  ------------------
  731|   298k|          min_energy = MIN(min_energy, pstr_psy_chan_out->ptr_sfb_energy[sfb]);
  ------------------
  |  |   86|   298k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 238k, False: 59.5k]
  |  |  ------------------
  ------------------
  732|   298k|          average_energy += pstr_psy_chan_out->ptr_sfb_energy[sfb];
  733|   298k|          ah_cnt++;
  734|   298k|        }
  735|   496k|      }
  736|  18.9k|      idx++;
  737|  18.9k|    }
  738|       |
  739|  9.53k|    average_energy = MIN(MAX_FLT_VAL, average_energy / (ah_cnt + MIN_FLT_VAL));
  ------------------
  |  |   86|  9.53k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 9.53k]
  |  |  ------------------
  ------------------
  740|       |
  741|  47.6k|    for (en_idx = 0; en_idx < 4; en_idx++) {
  ------------------
  |  Branch (741:22): [True: 38.1k, False: 9.53k]
  ------------------
  742|  38.1k|      energy[en_idx] = min_energy * (FLOAT32)pow(average_energy / (min_energy + MIN_FLT_VAL),
  ------------------
  |  |   31|  38.1k|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  743|  38.1k|                                                 (2 * en_idx + 1) / 7.0f);
  744|  38.1k|    }
  745|  9.53k|    max_sfb = pstr_psy_out[chn].sfb_count - 1;
  746|  9.53k|    min_sfb = start_sfb[chn];
  747|       |
  748|  9.53k|    if (num_channels == 2) {
  ------------------
  |  Branch (748:9): [True: 9.40k, False: 129]
  ------------------
  749|  9.40k|      max_sfb = MAX(max_sfb, pstr_psy_out[chn + 1].sfb_count - 1);
  ------------------
  |  |   89|  9.40k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 9.40k]
  |  |  ------------------
  ------------------
  750|       |
  751|  9.40k|      min_sfb = MIN(min_sfb, start_sfb[chn + 1]);
  ------------------
  |  |   86|  9.40k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 9.40k]
  |  |  ------------------
  ------------------
  752|  9.40k|    }
  753|       |
  754|  9.53k|    sfb = max_sfb;
  755|  9.53k|    en_idx = 0;
  756|  9.53k|    done = 0;
  757|   538k|    while (!done) {
  ------------------
  |  Branch (757:12): [True: 528k, False: 9.53k]
  ------------------
  758|   528k|      idx = 0;
  759|  1.56M|      for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (759:22): [True: 1.04M, False: 520k]
  ------------------
  760|  1.04M|        ia_psy_mod_out_data_struct *pstr_psy_chan_out = &pstr_psy_out[ch];
  761|  1.04M|        if (sfb >= start_sfb[ch] && sfb < pstr_psy_chan_out->sfb_count) {
  ------------------
  |  Branch (761:13): [True: 1.04M, False: 0]
  |  Branch (761:37): [True: 1.04M, False: 0]
  ------------------
  762|  1.04M|          if (ah_flag[idx][sfb] != NO_AH &&
  ------------------
  |  Branch (762:15): [True: 568k, False: 480k]
  ------------------
  763|   568k|              pstr_psy_chan_out->ptr_sfb_energy[sfb] < energy[en_idx]) {
  ------------------
  |  Branch (763:15): [True: 101k, False: 467k]
  ------------------
  764|   101k|            ah_flag[idx][sfb] = NO_AH;
  765|   101k|            pstr_psy_chan_out->ptr_sfb_thr[sfb] = 2.0f * pstr_psy_chan_out->ptr_sfb_energy[sfb];
  766|   101k|            act_pe -= pstr_qs_pe_data->pe_ch_data[idx].sfb_pe[sfb];
  767|   101k|          }
  768|       |
  769|  1.04M|          if (act_pe < desired_pe) {
  ------------------
  |  Branch (769:15): [True: 7.99k, False: 1.04M]
  ------------------
  770|  7.99k|            done = 1;
  771|  7.99k|            break;
  772|  7.99k|          }
  773|  1.04M|        }
  774|  1.04M|        idx++;
  775|  1.04M|      }
  776|   528k|      sfb--;
  777|   528k|      if (sfb < min_sfb) {
  ------------------
  |  Branch (777:11): [True: 16.7k, False: 511k]
  ------------------
  778|  16.7k|        sfb = max_sfb;
  779|  16.7k|        en_idx++;
  780|  16.7k|        if (en_idx >= 4) {
  ------------------
  |  Branch (780:13): [True: 1.58k, False: 15.1k]
  ------------------
  781|  1.58k|          done = 1;
  782|  1.58k|        }
  783|  16.7k|      }
  784|   528k|    }
  785|  9.53k|  }
  786|       |
  787|  12.0k|  return;
  788|  12.0k|}
ixheaace_fd_qc_adjthr.c:iusace_improve_scf:
 1163|  9.32M|                                 WORD16 *ptr_min_calc_scf) {
 1164|  9.32M|  FLOAT32 sfb_dist;
 1165|  9.32M|  WORD16 best_scf = scf;
 1166|  9.32M|  WORD32 j;
 1167|       |
 1168|  9.32M|  sfb_dist = iusace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec, sfb_width, scf);
 1169|       |
 1170|  9.32M|  *ptr_min_calc_scf = scf;
 1171|       |
 1172|  9.32M|  if (sfb_dist > (1.25 * threshold)) {
  ------------------
  |  Branch (1172:7): [True: 1.83M, False: 7.48M]
  ------------------
 1173|  1.83M|    WORD16 estimated_scf = scf;
 1174|  1.83M|    FLOAT32 best_sfb_dist = sfb_dist;
 1175|  1.83M|    WORD32 count;
 1176|       |
 1177|  1.83M|    count = 0;
 1178|       |
 1179|  5.59M|    while ((sfb_dist > (1.25 * threshold)) && (count++ < SCF_COUNT_LIMIT_THREE)) {
  ------------------
  |  |   52|  4.53M|#define SCF_COUNT_LIMIT_THREE (3)
  ------------------
  |  Branch (1179:12): [True: 4.53M, False: 1.05M]
  |  Branch (1179:47): [True: 3.75M, False: 781k]
  ------------------
 1180|  3.75M|      scf++;
 1181|       |
 1182|  3.75M|      sfb_dist =
 1183|  3.75M|          iusace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
 1184|       |
 1185|  3.75M|      if (sfb_dist < best_sfb_dist) {
  ------------------
  |  Branch (1185:11): [True: 1.31M, False: 2.43M]
  ------------------
 1186|  1.31M|        best_scf = scf;
 1187|  1.31M|        best_sfb_dist = sfb_dist;
 1188|       |
 1189|  1.31M|        memcpy(ptr_quant_spec, ptr_quant_spec_temp, sfb_width * sizeof(WORD16));
 1190|  1.31M|      }
 1191|  3.75M|    }
 1192|       |
 1193|  1.83M|    count = 0;
 1194|  1.83M|    scf = estimated_scf;
 1195|  1.83M|    sfb_dist = best_sfb_dist;
 1196|       |
 1197|  2.61M|    while ((sfb_dist > (1.25 * threshold)) && (count++ < SCF_COUNT_LIMIT_ONE) &&
  ------------------
  |  |   51|   940k|#define SCF_COUNT_LIMIT_ONE (1)
  ------------------
  |  Branch (1197:12): [True: 940k, False: 1.67M]
  |  Branch (1197:47): [True: 781k, False: 158k]
  ------------------
 1198|   781k|      (scf > min_scf)) {
  ------------------
  |  Branch (1198:7): [True: 776k, False: 5.04k]
  ------------------
 1199|   776k|      scf--;
 1200|       |
 1201|   776k|      sfb_dist =
 1202|   776k|          iusace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
 1203|       |
 1204|   776k|      if (sfb_dist < best_sfb_dist) {
  ------------------
  |  Branch (1204:11): [True: 696k, False: 79.9k]
  ------------------
 1205|   696k|        best_scf = scf;
 1206|   696k|        best_sfb_dist = sfb_dist;
 1207|       |
 1208|   696k|        memcpy(ptr_quant_spec, ptr_quant_spec_temp, sfb_width * sizeof(WORD16));
 1209|   696k|      }
 1210|   776k|      *ptr_min_calc_scf = scf;
 1211|   776k|    }
 1212|  1.83M|    *dist = best_sfb_dist;
 1213|  7.48M|  } else {
 1214|  7.48M|    FLOAT32 best_sfb_dist = sfb_dist;
 1215|  7.48M|    FLOAT32 allowed_sfb_dist = MIN(sfb_dist * 1.25f, threshold);
  ------------------
  |  |   86|  7.48M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 3.55M, False: 3.92M]
  |  |  ------------------
  ------------------
 1216|  7.48M|    WORD32 count;
 1217|       |
 1218|  29.9M|    for (count = 0; count < SCF_COUNT_LIMIT_THREE; count++) {
  ------------------
  |  |   52|  29.9M|#define SCF_COUNT_LIMIT_THREE (3)
  ------------------
  |  Branch (1218:21): [True: 22.4M, False: 7.48M]
  ------------------
 1219|  22.4M|      scf++;
 1220|       |
 1221|  22.4M|      sfb_dist =
 1222|  22.4M|          iusace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
 1223|       |
 1224|  22.4M|      if (sfb_dist < allowed_sfb_dist) {
  ------------------
  |  Branch (1224:11): [True: 3.73M, False: 18.7M]
  ------------------
 1225|  3.73M|        *ptr_min_calc_scf = best_scf + 1;
 1226|       |
 1227|  3.73M|        best_scf = scf;
 1228|  3.73M|        best_sfb_dist = sfb_dist;
 1229|  3.73M|        memcpy(ptr_quant_spec, ptr_quant_spec_temp, sfb_width * sizeof(WORD16));
 1230|  3.73M|      }
 1231|  22.4M|    }
 1232|  7.48M|    *dist = best_sfb_dist;
 1233|  7.48M|  }
 1234|       |
 1235|   174M|  for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (1235:15): [True: 165M, False: 9.32M]
  ------------------
 1236|   165M|    if (ptr_spec[j] < 0) {
  ------------------
  |  Branch (1236:9): [True: 79.2M, False: 86.1M]
  ------------------
 1237|  79.2M|      ptr_quant_spec[j] = -ptr_quant_spec[j];
 1238|  79.2M|    }
 1239|   165M|  }
 1240|       |
 1241|  9.32M|  return best_scf;
 1242|  9.32M|}
ixheaace_fd_qc_adjthr.c:iusace_assimilate_single_scf:
 1250|   427k|                                         WORD16 *ptr_min_calc_scf, FLOAT32 *ptr_mdct_spec_float) {
 1251|   427k|  WORD32 sfb_prev, sfb_act, sfb_next;
 1252|   427k|  WORD16 scf_act = 0, *scf_prev, *scf_next, min_scf, max_scf;
 1253|   427k|  WORD32 sfb_width, sfb_offs;
 1254|   427k|  FLOAT32 energy;
 1255|   427k|  FLOAT32 sfb_pe_prev, sfb_pe_new;
 1256|   427k|  FLOAT32 sfb_dist_new;
 1257|   427k|  WORD32 j;
 1258|   427k|  WORD32 success = 0;
 1259|   427k|  FLOAT32 delta_pe = 0.0f, delta_pe_new, delta_pe_temp;
 1260|   427k|  WORD16 prev_scf_last[MAX_NUM_GROUPED_SFB], prev_scf_next[MAX_NUM_GROUPED_SFB];
 1261|   427k|  FLOAT32 delta_pe_last[MAX_NUM_GROUPED_SFB];
 1262|   427k|  WORD32 update_min_scf;
 1263|       |
 1264|  20.4M|  for (j = 0; j < pstr_psy_out->sfb_count; j++) {
  ------------------
  |  Branch (1264:15): [True: 20.0M, False: 427k]
  ------------------
 1265|  20.0M|    prev_scf_last[j] = SHRT_MAX;
 1266|  20.0M|    prev_scf_next[j] = SHRT_MAX;
 1267|  20.0M|    delta_pe_last[j] = MAX_FLT_VAL;
  ------------------
  |  |   30|  20.0M|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
 1268|  20.0M|  }
 1269|       |
 1270|   427k|  sfb_prev = -1;
 1271|   427k|  sfb_act = -1;
 1272|   427k|  sfb_next = -1;
 1273|   427k|  scf_prev = 0;
 1274|   427k|  scf_next = 0;
 1275|   427k|  min_scf = SHRT_MAX;
 1276|   427k|  max_scf = SHRT_MAX;
 1277|       |
 1278|  41.6M|  do {
 1279|  41.6M|    sfb_next++;
 1280|       |
 1281|  66.1M|    while ((sfb_next < pstr_psy_out->sfb_count) && (scf[sfb_next] == SHRT_MIN)) {
  ------------------
  |  Branch (1281:12): [True: 65.7M, False: 459k]
  |  Branch (1281:52): [True: 24.5M, False: 41.1M]
  ------------------
 1282|  24.5M|      sfb_next++;
 1283|  24.5M|    }
 1284|       |
 1285|  41.6M|    if ((sfb_prev >= 0) && (sfb_act >= 0) && (sfb_next < pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (1285:9): [True: 35.3M, False: 6.26M]
  |  Branch (1285:28): [True: 35.3M, False: 0]
  |  Branch (1285:46): [True: 34.9M, False: 346k]
  ------------------
 1286|  34.9M|      scf_act = scf[sfb_act];
 1287|       |
 1288|  34.9M|      scf_prev = scf + sfb_prev;
 1289|  34.9M|      scf_next = scf + sfb_next;
 1290|       |
 1291|  34.9M|      min_scf = MIN(*scf_prev, *scf_next);
  ------------------
  |  |   86|  34.9M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 11.0M, False: 23.9M]
  |  |  ------------------
  ------------------
 1292|       |
 1293|  34.9M|      max_scf = MAX(*scf_prev, *scf_next);
  ------------------
  |  |   89|  34.9M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 14.9M, False: 20.0M]
  |  |  ------------------
  ------------------
 1294|  34.9M|    } else {
 1295|  6.61M|      if ((sfb_prev == -1) && (sfb_act >= 0) && (sfb_next < pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (1295:11): [True: 6.26M, False: 346k]
  |  Branch (1295:31): [True: 3.08M, False: 3.18M]
  |  Branch (1295:49): [True: 3.07M, False: 7.28k]
  ------------------
 1296|  3.07M|        scf_act = scf[sfb_act];
 1297|       |
 1298|  3.07M|        scf_prev = &scf_act;
 1299|       |
 1300|  3.07M|        scf_next = scf + sfb_next;
 1301|       |
 1302|  3.07M|        min_scf = *scf_next;
 1303|       |
 1304|  3.07M|        max_scf = *scf_next;
 1305|  3.54M|      } else {
 1306|  3.54M|        if ((sfb_prev >= 0) && (sfb_act >= 0) && (sfb_next == pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (1306:13): [True: 346k, False: 3.19M]
  |  Branch (1306:32): [True: 346k, False: 0]
  |  Branch (1306:50): [True: 346k, False: 0]
  ------------------
 1307|   346k|          scf_act = scf[sfb_act];
 1308|       |
 1309|   346k|          scf_prev = scf + sfb_prev;
 1310|       |
 1311|   346k|          scf_next = &scf_act;
 1312|       |
 1313|   346k|          min_scf = *scf_prev;
 1314|       |
 1315|   346k|          max_scf = *scf_prev;
 1316|   346k|        }
 1317|  3.54M|      }
 1318|  6.61M|    }
 1319|       |
 1320|  41.6M|    if (sfb_act >= 0) {
  ------------------
  |  Branch (1320:9): [True: 38.4M, False: 3.18M]
  ------------------
 1321|  38.4M|      min_scf = MAX(min_scf, ptr_min_scf[sfb_act]);
  ------------------
  |  |   89|  38.4M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 38.2M, False: 188k]
  |  |  ------------------
  ------------------
 1322|  38.4M|    }
 1323|       |
 1324|  41.6M|    if ((sfb_act >= 0) && (sfb_prev >= 0 || sfb_next < pstr_psy_out->sfb_count) &&
  ------------------
  |  Branch (1324:9): [True: 38.4M, False: 3.18M]
  |  Branch (1324:28): [True: 35.3M, False: 3.08M]
  |  Branch (1324:45): [True: 3.07M, False: 7.28k]
  ------------------
 1325|  38.4M|        (scf_act > min_scf) && (scf_act <= min_scf + MAX_SCF_DELTA) &&
  ------------------
  |  |   26|  18.4M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (1325:9): [True: 18.4M, False: 19.9M]
  |  Branch (1325:32): [True: 18.4M, False: 2.25k]
  ------------------
 1326|  18.4M|        (scf_act >= max_scf - MAX_SCF_DELTA) &&
  ------------------
  |  |   26|  18.4M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (1326:9): [True: 18.4M, False: 734]
  ------------------
 1327|  18.4M|        (*scf_prev != prev_scf_last[sfb_act] || *scf_next != prev_scf_next[sfb_act] ||
  ------------------
  |  Branch (1327:10): [True: 7.17M, False: 11.2M]
  |  Branch (1327:49): [True: 1.00M, False: 10.2M]
  ------------------
 1328|  10.4M|         delta_pe < delta_pe_last[sfb_act])) {
  ------------------
  |  Branch (1328:10): [True: 2.28M, False: 7.95M]
  ------------------
 1329|  10.4M|      success = 0;
 1330|       |
 1331|  10.4M|      sfb_width = pstr_psy_out->sfb_offsets[sfb_act + 1] - pstr_psy_out->sfb_offsets[sfb_act];
 1332|       |
 1333|  10.4M|      sfb_offs = pstr_psy_out->sfb_offsets[sfb_act];
 1334|       |
 1335|  10.4M|      energy = pstr_psy_out->ptr_sfb_energy[sfb_act];
 1336|       |
 1337|  10.4M|      if (ptr_sfb_const_pe_part[sfb_act] == MIN_FLT_VAL) {
  ------------------
  |  |   31|  10.4M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (1337:11): [True: 5.74M, False: 4.71M]
  ------------------
 1338|  5.74M|        ptr_sfb_const_pe_part[sfb_act] =
 1339|  5.74M|            (FLOAT32)log(energy * (FLOAT32)6.75f / ptr_sfb_form_fac[sfb_act]) * LOG2_1;
  ------------------
  |  |   28|  5.74M|#define LOG2_1 1.442695041f
  ------------------
 1340|  5.74M|      }
 1341|       |
 1342|  10.4M|      sfb_pe_prev = iusace_calc_single_spec_pe(scf_act, ptr_sfb_const_pe_part[sfb_act],
 1343|  10.4M|                                               ptr_sfb_num_lines[sfb_act]) +
 1344|  10.4M|                    iusace_count_single_scf_bits(scf_act, *scf_prev, *scf_next);
 1345|       |
 1346|  10.4M|      delta_pe_new = delta_pe;
 1347|  10.4M|      update_min_scf = 1;
 1348|       |
 1349|  36.2M|      do {
 1350|  36.2M|        scf_act--;
 1351|       |
 1352|  36.2M|        if (scf_act < ptr_min_calc_scf[sfb_act] && scf_act >= max_scf - MAX_SCF_DELTA) {
  ------------------
  |  |   26|  28.5M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (1352:13): [True: 28.5M, False: 7.65M]
  |  Branch (1352:52): [True: 28.5M, False: 1.36k]
  ------------------
 1353|  28.5M|          sfb_pe_new = iusace_calc_single_spec_pe(scf_act, ptr_sfb_const_pe_part[sfb_act],
 1354|  28.5M|                                                  ptr_sfb_num_lines[sfb_act]) +
 1355|  28.5M|                       (FLOAT32)iusace_count_single_scf_bits(scf_act, *scf_prev, *scf_next);
 1356|       |
 1357|  28.5M|          delta_pe_temp = delta_pe + sfb_pe_new - sfb_pe_prev;
 1358|       |
 1359|  28.5M|          if (delta_pe_temp < (FLOAT32)10.0f) {
  ------------------
  |  Branch (1359:15): [True: 10.5M, False: 18.0M]
  ------------------
 1360|  10.5M|            sfb_dist_new =
 1361|  10.5M|                iusace_calc_sfb_dist(ptr_mdct_spec_float + sfb_offs, ptr_exp_spec + sfb_offs,
 1362|  10.5M|                                     ptr_quant_spec_temp + sfb_offs, sfb_width, scf_act);
 1363|       |
 1364|  10.5M|            if (sfb_dist_new < ptr_sfb_dist[sfb_act]) {
  ------------------
  |  Branch (1364:17): [True: 5.02M, False: 5.48M]
  ------------------
 1365|  5.02M|              scf[sfb_act] = scf_act;
 1366|  5.02M|              ptr_sfb_dist[sfb_act] = sfb_dist_new;
 1367|       |
 1368|  44.3M|              for (j = sfb_offs; j < sfb_offs + sfb_width; j++) {
  ------------------
  |  Branch (1368:34): [True: 39.3M, False: 5.02M]
  ------------------
 1369|  39.3M|                ptr_quant_spec[j] = ptr_quant_spec_temp[j];
 1370|       |
 1371|  39.3M|                if (ptr_mdct_spec_float[j] < 0.0f) {
  ------------------
  |  Branch (1371:21): [True: 18.0M, False: 21.2M]
  ------------------
 1372|  18.0M|                  ptr_quant_spec[j] = -ptr_quant_spec[j];
 1373|  18.0M|                }
 1374|  39.3M|              }
 1375|  5.02M|              delta_pe_new = delta_pe_temp;
 1376|  5.02M|              success = 1;
 1377|  5.02M|            }
 1378|       |
 1379|  10.5M|            if (update_min_scf) {
  ------------------
  |  Branch (1379:17): [True: 9.98M, False: 526k]
  ------------------
 1380|  9.98M|              ptr_min_calc_scf[sfb_act] = scf_act;
 1381|  9.98M|            }
 1382|  18.0M|          } else {
 1383|  18.0M|            update_min_scf = 0;
 1384|  18.0M|          }
 1385|  28.5M|        }
 1386|  36.2M|      } while (scf_act > min_scf);
  ------------------
  |  Branch (1386:16): [True: 25.7M, False: 10.4M]
  ------------------
 1387|       |
 1388|  10.4M|      delta_pe = delta_pe_new;
 1389|       |
 1390|  10.4M|      prev_scf_last[sfb_act] = *scf_prev;
 1391|  10.4M|      prev_scf_next[sfb_act] = *scf_next;
 1392|  10.4M|      delta_pe_last[sfb_act] = delta_pe;
 1393|  10.4M|    }
 1394|       |
 1395|  41.6M|    if (success) {
  ------------------
  |  Branch (1395:9): [True: 2.75M, False: 38.8M]
  ------------------
 1396|  2.75M|      sfb_prev = -1;
 1397|  2.75M|      sfb_act = -1;
 1398|  2.75M|      sfb_next = -1;
 1399|  2.75M|      scf_prev = 0;
 1400|  2.75M|      scf_next = 0;
 1401|  2.75M|      min_scf = SHRT_MAX;
 1402|  2.75M|      max_scf = SHRT_MAX;
 1403|  2.75M|      success = 0;
 1404|  38.8M|    } else {
 1405|  38.8M|      sfb_prev = sfb_act;
 1406|  38.8M|      sfb_act = sfb_next;
 1407|  38.8M|    }
 1408|  41.6M|  } while (sfb_next < pstr_psy_out->sfb_count);
  ------------------
  |  Branch (1408:12): [True: 41.1M, False: 427k]
  ------------------
 1409|   427k|  return;
 1410|   427k|}
ixheaace_fd_qc_adjthr.c:iusace_calc_single_spec_pe:
 1031|  39.0M|                                          FLOAT32 num_lines) {
 1032|  39.0M|  FLOAT32 spec_pe;
 1033|  39.0M|  FLOAT32 ld_ratio;
 1034|       |
 1035|  39.0M|  ld_ratio = sfb_const_pe_part - (FLOAT32)0.375f * (FLOAT32)scf;
 1036|       |
 1037|  39.0M|  if (ld_ratio >= PE_C1) {
  ------------------
  |  |   32|  39.0M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (1037:7): [True: 30.2M, False: 8.71M]
  ------------------
 1038|  30.2M|    spec_pe = (FLOAT32)0.7f * num_lines * ld_ratio;
 1039|  30.2M|  } else {
 1040|  8.71M|    spec_pe = (FLOAT32)0.7f * num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   33|  8.71M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                  spec_pe = (FLOAT32)0.7f * num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   34|  8.71M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
 1041|  8.71M|  }
 1042|       |
 1043|  39.0M|  return spec_pe;
 1044|  39.0M|}
ixheaace_fd_qc_adjthr.c:iusace_count_single_scf_bits:
 1021|  39.0M|static WORD32 iusace_count_single_scf_bits(WORD32 scf, WORD32 left_scf, WORD32 right_scf) {
 1022|  39.0M|  WORD32 scf_bits;
 1023|       |
 1024|  39.0M|  scf_bits =
 1025|  39.0M|      iusace_scf_delta_bit_count(left_scf - scf) + iusace_scf_delta_bit_count(scf - right_scf);
 1026|       |
 1027|  39.0M|  return scf_bits;
 1028|  39.0M|}
ixheaace_fd_qc_adjthr.c:iusace_scf_delta_bit_count:
 1011|   196M|static WORD32 iusace_scf_delta_bit_count(WORD32 delta) {
 1012|   196M|  if (delta > 60) {
  ------------------
  |  Branch (1012:7): [True: 197, False: 196M]
  ------------------
 1013|    197|    return (iusace_huffman_code_table[120][0]);
 1014|    197|  }
 1015|   196M|  if (delta < -60) {
  ------------------
  |  Branch (1015:7): [True: 92, False: 196M]
  ------------------
 1016|     92|    return (iusace_huffman_code_table[0][0]);
 1017|     92|  }
 1018|   196M|  return (iusace_huffman_code_table[delta + 60][0]);
 1019|   196M|}
ixheaace_fd_qc_adjthr.c:iusace_assimilate_multiple_scf:
 1418|   427k|                                           FLOAT32 *ptr_mdct_spec_float, pUWORD8 pstr_scratch) {
 1419|   427k|  WORD32 sfb, start_sfb, stop_sfb;
 1420|   427k|  WORD16 scf_temp[MAX_NUM_GROUPED_SFB], min_scf, max_scf, scf_act;
 1421|   427k|  WORD32 possible_region_found;
 1422|   427k|  WORD32 sfb_width, sfb_offs, j;
 1423|   427k|  FLOAT32 prev_dist_sum, new_dist_sum;
 1424|   427k|  WORD32 delta_scf_bits;
 1425|   427k|  FLOAT32 delta_spec_pe;
 1426|   427k|  FLOAT32 delta_pe = 0.0f, delta_pe_new;
 1427|   427k|  WORD32 sfb_count = pstr_psy_out->sfb_count;
 1428|   427k|  FLOAT32 *sfb_dist_new = (FLOAT32 *)pstr_scratch;
 1429|   427k|  min_scf = SHRT_MAX;
 1430|   427k|  max_scf = SHRT_MIN;
 1431|       |
 1432|  20.4M|  for (sfb = 0; sfb < sfb_count; sfb++) {
  ------------------
  |  Branch (1432:17): [True: 20.0M, False: 427k]
  ------------------
 1433|  20.0M|    if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1433:9): [True: 9.32M, False: 10.6M]
  ------------------
 1434|  9.32M|      min_scf = MIN(min_scf, ptr_scf[sfb]);
  ------------------
  |  |   86|  9.32M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 5.71M, False: 3.60M]
  |  |  ------------------
  ------------------
 1435|       |
 1436|  9.32M|      max_scf = MAX(max_scf, ptr_scf[sfb]);
  ------------------
  |  |   89|  9.32M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 7.71M, False: 1.60M]
  |  |  ------------------
  ------------------
 1437|  9.32M|    }
 1438|  20.0M|  }
 1439|       |
 1440|   427k|  if (max_scf != SHRT_MIN && max_scf <= min_scf + MAX_SCF_DELTA) {
  ------------------
  |  |   26|   322k|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (1440:7): [True: 322k, False: 104k]
  |  Branch (1440:30): [True: 321k, False: 1.61k]
  ------------------
 1441|   321k|    scf_act = max_scf;
 1442|       |
 1443|  5.76M|    do {
 1444|  5.76M|      scf_act--;
 1445|       |
 1446|  5.76M|      memcpy(scf_temp, ptr_scf, MAX_NUM_GROUPED_SFB * sizeof(WORD16));
  ------------------
  |  |   24|  5.76M|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
 1447|       |
 1448|  5.76M|      stop_sfb = 0;
 1449|       |
 1450|  16.2M|      do {
 1451|  16.2M|        sfb = stop_sfb;
 1452|       |
 1453|   185M|        while (sfb < sfb_count && (ptr_scf[sfb] == SHRT_MIN || ptr_scf[sfb] <= scf_act)) {
  ------------------
  |  Branch (1453:16): [True: 179M, False: 5.76M]
  |  Branch (1453:36): [True: 53.1M, False: 126M]
  |  Branch (1453:64): [True: 116M, False: 10.4M]
  ------------------
 1454|   169M|          sfb++;
 1455|   169M|        }
 1456|       |
 1457|  16.2M|        start_sfb = sfb;
 1458|       |
 1459|  16.2M|        sfb++;
 1460|       |
 1461|   111M|        while (sfb < sfb_count && (ptr_scf[sfb] == SHRT_MIN || ptr_scf[sfb] > scf_act)) {
  ------------------
  |  Branch (1461:16): [True: 102M, False: 8.21M]
  |  Branch (1461:36): [True: 39.0M, False: 63.8M]
  |  Branch (1461:64): [True: 55.8M, False: 8.02M]
  ------------------
 1462|  94.9M|          sfb++;
 1463|  94.9M|        }
 1464|       |
 1465|  16.2M|        stop_sfb = sfb;
 1466|       |
 1467|  16.2M|        possible_region_found = 0;
 1468|       |
 1469|  16.2M|        if (start_sfb < sfb_count) {
  ------------------
  |  Branch (1469:13): [True: 10.4M, False: 5.76M]
  ------------------
 1470|  10.4M|          possible_region_found = 1;
 1471|       |
 1472|   101M|          for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (1472:33): [True: 92.4M, False: 9.09M]
  ------------------
 1473|  92.4M|            if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1473:17): [True: 57.0M, False: 35.4M]
  ------------------
 1474|  57.0M|              if (scf_act < ptr_min_scf[sfb]) {
  ------------------
  |  Branch (1474:19): [True: 1.38M, False: 55.6M]
  ------------------
 1475|  1.38M|                possible_region_found = 0;
 1476|  1.38M|                break;
 1477|  1.38M|              }
 1478|  57.0M|            }
 1479|  92.4M|          }
 1480|  10.4M|        }
 1481|       |
 1482|  16.2M|        if (possible_region_found) {
  ------------------
  |  Branch (1482:13): [True: 9.09M, False: 7.15M]
  ------------------
 1483|  99.6M|          for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (1483:33): [True: 90.6M, False: 9.09M]
  ------------------
 1484|  90.6M|            if (scf_temp[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1484:17): [True: 55.2M, False: 35.3M]
  ------------------
 1485|  55.2M|              scf_temp[sfb] = scf_act;
 1486|  55.2M|            }
 1487|  90.6M|          }
 1488|       |
 1489|  9.09M|          delta_scf_bits =
 1490|  9.09M|              iusace_count_scf_bits_diff(ptr_scf, scf_temp, sfb_count, start_sfb, stop_sfb);
 1491|       |
 1492|  9.09M|          delta_spec_pe =
 1493|  9.09M|              iusace_calc_spec_pe_diff(pstr_psy_out, ptr_scf, scf_temp, ptr_sfb_const_pe_part,
 1494|  9.09M|                                       ptr_sfb_form_fac, ptr_sfb_num_lines, start_sfb, stop_sfb);
 1495|       |
 1496|  9.09M|          delta_pe_new = delta_pe + (FLOAT32)delta_scf_bits + delta_spec_pe;
 1497|       |
 1498|  9.09M|          if (delta_pe_new < (FLOAT32)10.0f) {
  ------------------
  |  Branch (1498:15): [True: 3.84M, False: 5.24M]
  ------------------
 1499|  3.84M|            prev_dist_sum = new_dist_sum = 0.0f;
 1500|       |
 1501|  21.0M|            for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (1501:35): [True: 18.4M, False: 2.59M]
  ------------------
 1502|  18.4M|              if (scf_temp[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1502:19): [True: 8.44M, False: 9.99M]
  ------------------
 1503|  8.44M|                prev_dist_sum += ptr_sfb_dist[sfb];
 1504|       |
 1505|  8.44M|                sfb_width = pstr_psy_out->sfb_offsets[sfb + 1] - pstr_psy_out->sfb_offsets[sfb];
 1506|       |
 1507|  8.44M|                sfb_offs = pstr_psy_out->sfb_offsets[sfb];
 1508|       |
 1509|  8.44M|                sfb_dist_new[sfb] =
 1510|  8.44M|                    iusace_calc_sfb_dist(ptr_mdct_spec_float + sfb_offs, ptr_exp_spec + sfb_offs,
 1511|  8.44M|                                         ptr_quant_spec_temp + sfb_offs, sfb_width, scf_act);
 1512|       |
 1513|  8.44M|                if (sfb_dist_new[sfb] > pstr_psy_out->ptr_sfb_thr[sfb]) {
  ------------------
  |  Branch (1513:21): [True: 1.25M, False: 7.18M]
  ------------------
 1514|  1.25M|                  new_dist_sum = (FLOAT32)2.0f * prev_dist_sum;
 1515|  1.25M|                  break;
 1516|  1.25M|                }
 1517|       |
 1518|  7.18M|                new_dist_sum += sfb_dist_new[sfb];
 1519|  7.18M|              }
 1520|  18.4M|            }
 1521|       |
 1522|  3.84M|            if (new_dist_sum < prev_dist_sum) {
  ------------------
  |  Branch (1522:17): [True: 688k, False: 3.16M]
  ------------------
 1523|   688k|              delta_pe = delta_pe_new;
 1524|       |
 1525|  4.53M|              for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (1525:37): [True: 3.84M, False: 688k]
  ------------------
 1526|  3.84M|                if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1526:21): [True: 1.72M, False: 2.12M]
  ------------------
 1527|  1.72M|                  sfb_width = pstr_psy_out->sfb_offsets[sfb + 1] - pstr_psy_out->sfb_offsets[sfb];
 1528|       |
 1529|  1.72M|                  sfb_offs = pstr_psy_out->sfb_offsets[sfb];
 1530|  1.72M|                  ptr_scf[sfb] = scf_act;
 1531|  1.72M|                  ptr_sfb_dist[sfb] = sfb_dist_new[sfb];
 1532|       |
 1533|  21.3M|                  for (j = sfb_offs; j < sfb_offs + sfb_width; j++) {
  ------------------
  |  Branch (1533:38): [True: 19.6M, False: 1.72M]
  ------------------
 1534|  19.6M|                    ptr_quant_spec[j] = ptr_quant_spec_temp[j];
 1535|       |
 1536|  19.6M|                    if (ptr_mdct_spec_float[j] < 0.0f) {
  ------------------
  |  Branch (1536:25): [True: 8.57M, False: 11.0M]
  ------------------
 1537|  8.57M|                      ptr_quant_spec[j] = -ptr_quant_spec[j];
 1538|  8.57M|                    }
 1539|  19.6M|                  }
 1540|  1.72M|                }
 1541|  3.84M|              }
 1542|   688k|            }
 1543|  3.84M|          }
 1544|  9.09M|        }
 1545|       |
 1546|  16.2M|      } while (stop_sfb <= sfb_count);
  ------------------
  |  Branch (1546:16): [True: 10.4M, False: 5.76M]
  ------------------
 1547|       |
 1548|  5.76M|    } while (scf_act > min_scf);
  ------------------
  |  Branch (1548:14): [True: 5.44M, False: 321k]
  ------------------
 1549|   321k|  }
 1550|   427k|  return;
 1551|   427k|}
ixheaace_fd_qc_adjthr.c:iusace_count_scf_bits_diff:
 1047|  9.09M|                                         WORD32 sfb_count, WORD32 start_sfb, WORD32 stop_sfb) {
 1048|  9.09M|  WORD32 scf_bits_diff = 0;
 1049|  9.09M|  WORD32 sfb = 0, sfb_last;
 1050|  9.09M|  WORD32 sfb_prev, sfb_next;
 1051|       |
 1052|  9.09M|  sfb_last = start_sfb;
 1053|       |
 1054|  9.09M|  while ((sfb_last < stop_sfb) && (ptr_sfb_prev[sfb_last] == SHRT_MIN)) {
  ------------------
  |  Branch (1054:10): [True: 9.09M, False: 0]
  |  Branch (1054:35): [True: 0, False: 9.09M]
  ------------------
 1055|      0|    sfb_last++;
 1056|      0|  }
 1057|       |
 1058|  9.09M|  sfb_prev = start_sfb - 1;
 1059|       |
 1060|  18.1M|  while ((sfb_prev >= 0) && (ptr_sfb_prev[sfb_prev] == SHRT_MIN)) {
  ------------------
  |  Branch (1060:10): [True: 15.1M, False: 2.98M]
  |  Branch (1060:29): [True: 9.08M, False: 6.10M]
  ------------------
 1061|  9.08M|    sfb_prev--;
 1062|  9.08M|  }
 1063|       |
 1064|  9.09M|  if (sfb_prev >= 0) {
  ------------------
  |  Branch (1064:7): [True: 6.10M, False: 2.98M]
  ------------------
 1065|  6.10M|    scf_bits_diff += iusace_scf_delta_bit_count(ptr_sfb_new[sfb_prev] - ptr_sfb_new[sfb_last]) -
 1066|  6.10M|                     iusace_scf_delta_bit_count(ptr_sfb_prev[sfb_prev] - ptr_sfb_prev[sfb_last]);
 1067|  6.10M|  }
 1068|       |
 1069|  90.6M|  for (sfb = sfb_last + 1; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (1069:28): [True: 81.5M, False: 9.09M]
  ------------------
 1070|  81.5M|    if (ptr_sfb_prev[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1070:9): [True: 46.2M, False: 35.3M]
  ------------------
 1071|  46.2M|      scf_bits_diff += iusace_scf_delta_bit_count(ptr_sfb_new[sfb_last] - ptr_sfb_new[sfb]) -
 1072|  46.2M|                       iusace_scf_delta_bit_count(ptr_sfb_prev[sfb_last] - ptr_sfb_prev[sfb]);
 1073|       |
 1074|  46.2M|      sfb_last = sfb;
 1075|  46.2M|    }
 1076|  81.5M|  }
 1077|       |
 1078|  9.09M|  sfb_next = stop_sfb;
 1079|       |
 1080|  9.09M|  while ((sfb_next < sfb_count) && (ptr_sfb_prev[sfb_next] == SHRT_MIN)) {
  ------------------
  |  Branch (1080:10): [True: 6.71M, False: 2.37M]
  |  Branch (1080:36): [True: 0, False: 6.71M]
  ------------------
 1081|      0|    sfb_next++;
 1082|      0|  }
 1083|       |
 1084|  9.09M|  if (sfb_next < sfb_count) {
  ------------------
  |  Branch (1084:7): [True: 6.71M, False: 2.37M]
  ------------------
 1085|  6.71M|    scf_bits_diff += iusace_scf_delta_bit_count(ptr_sfb_new[sfb_last] - ptr_sfb_new[sfb_next]) -
 1086|  6.71M|                     iusace_scf_delta_bit_count(ptr_sfb_prev[sfb_last] - ptr_sfb_prev[sfb_next]);
 1087|  6.71M|  }
 1088|       |
 1089|  9.09M|  return scf_bits_diff;
 1090|  9.09M|}
ixheaace_fd_qc_adjthr.c:iusace_calc_spec_pe_diff:
 1096|  9.09M|                                        WORD32 stop_sfb) {
 1097|  9.09M|  FLOAT32 spec_pe_diff = 0.0f;
 1098|  9.09M|  WORD32 sfb;
 1099|       |
 1100|  99.6M|  for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (1100:25): [True: 90.6M, False: 9.09M]
  ------------------
 1101|  90.6M|    if (scf_prev[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (1101:9): [True: 55.2M, False: 35.3M]
  ------------------
 1102|  55.2M|      FLOAT32 ld_ratio_prev, ld_ratio_new, pe_prev, pe_new;
 1103|       |
 1104|  55.2M|      if (ptr_sfb_const_pe_part[sfb] == MIN_FLT_VAL) {
  ------------------
  |  |   31|  55.2M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (1104:11): [True: 2.67M, False: 52.6M]
  ------------------
 1105|  2.67M|        ptr_sfb_const_pe_part[sfb] = (FLOAT32)log(pstr_psy_out->ptr_sfb_energy[sfb] *
 1106|  2.67M|                                                  (FLOAT32)6.75f / ptr_sfb_form_fac[sfb]) *
 1107|  2.67M|                                     LOG2_1;
  ------------------
  |  |   28|  2.67M|#define LOG2_1 1.442695041f
  ------------------
 1108|  2.67M|      }
 1109|       |
 1110|  55.2M|      ld_ratio_prev = ptr_sfb_const_pe_part[sfb] - 0.375f * scf_prev[sfb];
 1111|  55.2M|      ld_ratio_new = ptr_sfb_const_pe_part[sfb] - 0.375f * scf_new[sfb];
 1112|       |
 1113|  55.2M|      if (ld_ratio_prev >= PE_C1) {
  ------------------
  |  |   32|  55.2M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (1113:11): [True: 39.0M, False: 16.2M]
  ------------------
 1114|  39.0M|        pe_prev = ld_ratio_prev;
 1115|  39.0M|      } else {
 1116|  16.2M|        pe_prev = PE_C2 + PE_C3 * ld_ratio_prev;
  ------------------
  |  |   33|  16.2M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                      pe_prev = PE_C2 + PE_C3 * ld_ratio_prev;
  ------------------
  |  |   34|  16.2M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
 1117|  16.2M|      }
 1118|       |
 1119|  55.2M|      if (ld_ratio_new >= PE_C1) {
  ------------------
  |  |   32|  55.2M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (1119:11): [True: 49.3M, False: 5.95M]
  ------------------
 1120|  49.3M|        pe_new = ld_ratio_new;
 1121|  49.3M|      } else {
 1122|  5.95M|        pe_new = PE_C2 + PE_C3 * ld_ratio_new;
  ------------------
  |  |   33|  5.95M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                      pe_new = PE_C2 + PE_C3 * ld_ratio_new;
  ------------------
  |  |   34|  5.95M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
 1123|  5.95M|      }
 1124|       |
 1125|  55.2M|      spec_pe_diff += (FLOAT32)0.7f * ptr_sfb_num_rel_lines[sfb] * (pe_new - pe_prev);
 1126|  55.2M|    }
 1127|  90.6M|  }
 1128|       |
 1129|  9.09M|  return spec_pe_diff;
 1130|  9.09M|}

iusace_qc_create:
   43|  3.38k|VOID iusace_qc_create(ia_qc_main_struct *pstr_qc_main) {
   44|  3.38k|  WORD32 i = 0;
   45|  3.38k|  memset(pstr_qc_main, 0, sizeof(ia_qc_main_struct));
   46|       |
   47|  10.1k|  for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (47:15): [True: 6.76k, False: 3.38k]
  ------------------
   48|  6.76k|    memset(pstr_qc_main->str_qc_out.str_qc_out_chan[i].quant_spec, 0,
   49|  6.76k|           sizeof(WORD16) * FRAME_LEN_LONG);
  ------------------
  |  |   54|  6.76k|#define FRAME_LEN_LONG 1024
  ------------------
   50|  6.76k|    memset(pstr_qc_main->str_qc_out.str_qc_out_chan[i].scalefactor, 0,
   51|  6.76k|           sizeof(WORD16) * FRAME_LEN_LONG);
  ------------------
  |  |   54|  6.76k|#define FRAME_LEN_LONG 1024
  ------------------
   52|  6.76k|  }
   53|  3.38k|  return;
   54|  3.38k|}
iusace_qc_init:
   57|  3.35k|                    WORD32 bw_limit, WORD32 channels, WORD32 ccfl) {
   58|  3.35k|  FLOAT32 mean_pe;
   59|  3.35k|  pstr_qc_data->tot_avg_bits = pstr_qc_data->avg_bits;
   60|  3.35k|  pstr_qc_data->static_bits = 1;
   61|  3.35k|  pstr_qc_data->avg_bits = (pstr_qc_data->avg_bits - pstr_qc_data->static_bits);
   62|  3.35k|  pstr_qc_data->max_bits = channels * max_bits;
   63|  3.35k|  pstr_qc_data->max_bitres_bits = channels * max_bits - pstr_qc_data->tot_avg_bits;
   64|  3.35k|  pstr_qc_data->max_bitres_bits =
   65|  3.35k|      pstr_qc_data->max_bitres_bits - (pstr_qc_data->max_bitres_bits % 8);
   66|  3.35k|  pstr_qc_data->bit_res_lvl = pstr_qc_data->max_bitres_bits;
   67|  3.35k|  pstr_qc_data->padding = sample_rate;
   68|       |
   69|  3.35k|  pstr_qc_data->max_bit_fac =
   70|  3.35k|      (FLOAT32)channels * (max_bits - 744) /
   71|  3.35k|      (FLOAT32)(pstr_qc_data->tot_avg_bits ? pstr_qc_data->tot_avg_bits : 1);
  ------------------
  |  Branch (71:17): [True: 3.35k, False: 0]
  ------------------
   72|  3.35k|  mean_pe = 10.0f * ccfl * bw_limit / (sample_rate / 2.0f);
   73|       |
   74|  3.35k|  iusace_adj_thr_init(&pstr_qc_data->str_adj_thr_ele, mean_pe,
   75|  3.35k|                      (channels > 0) ? pstr_qc_data->ch_bitrate / channels : 0);
  ------------------
  |  Branch (75:23): [True: 3.35k, False: 0]
  ------------------
   76|       |
   77|  3.35k|  return;
   78|  3.35k|}
iusace_adj_bitrate:
  115|   239k|                        WORD32 ccfl) {
  116|   239k|  WORD32 padding_on;
  117|   239k|  WORD32 frame_len;
  118|   239k|  WORD32 code_bits;
  119|   239k|  WORD32 code_bits_prev;
  120|   239k|  WORD32 total_bits = 0;
  121|       |
  122|   239k|  padding_on = iusace_get_frame_padding(bit_rate, sample_rate, &pstr_qc_data->padding, ccfl);
  123|   239k|  frame_len =
  124|   239k|      padding_on + iusace_calc_frame_len(bit_rate, sample_rate, FRAME_LEN_BYTES_INT, ccfl);
  ------------------
  |  |   28|   239k|#define FRAME_LEN_BYTES_INT (2)
  ------------------
  125|       |
  126|   239k|  frame_len <<= 3;
  127|   239k|  code_bits_prev = pstr_qc_data->tot_avg_bits - pstr_qc_data->static_bits;
  128|   239k|  code_bits = frame_len - pstr_qc_data->static_bits;
  129|       |
  130|   239k|  if (code_bits != code_bits_prev) {
  ------------------
  |  Branch (130:7): [True: 46.1k, False: 193k]
  ------------------
  131|  46.1k|    pstr_qc_data->avg_bits = (WORD32)code_bits;
  132|  46.1k|    total_bits += pstr_qc_data->avg_bits;
  133|  46.1k|    pstr_qc_data->avg_bits += code_bits - total_bits;
  134|  46.1k|  }
  135|       |
  136|   239k|  pstr_qc_data->tot_avg_bits = frame_len;
  137|       |
  138|   239k|  return;
  139|   239k|}
iusace_calc_max_val_in_sfb:
  142|   529k|                                  WORD32 *ptr_sfb_offset, WORD16 *ptr_quant_spec) {
  143|   529k|  WORD32 sfb;
  144|   529k|  WORD32 max = 0;
  145|   529k|  WORD32 sfb_offs;
  146|       |
  147|  1.68M|  for (sfb_offs = 0; sfb_offs < sfb_count; sfb_offs += sfb_per_group) {
  ------------------
  |  Branch (147:22): [True: 1.15M, False: 529k]
  ------------------
  148|  22.1M|    for (sfb = 0; sfb < max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (148:19): [True: 21.0M, False: 1.15M]
  ------------------
  149|  21.0M|      WORD32 line;
  150|  21.0M|      WORD32 local_max = 0;
  151|   394M|      for (line = ptr_sfb_offset[sfb + sfb_offs]; line < ptr_sfb_offset[sfb + sfb_offs + 1];
  ------------------
  |  Branch (151:51): [True: 373M, False: 21.0M]
  ------------------
  152|   373M|           line++) {
  153|   373M|        if (abs(ptr_quant_spec[line]) > local_max) {
  ------------------
  |  Branch (153:13): [True: 17.0M, False: 356M]
  ------------------
  154|  17.0M|          local_max = abs(ptr_quant_spec[line]);
  155|  17.0M|        }
  156|   373M|      }
  157|  21.0M|      if (local_max > max) {
  ------------------
  |  Branch (157:11): [True: 704k, False: 20.3M]
  ------------------
  158|   704k|        max = local_max;
  159|   704k|      }
  160|  21.0M|    }
  161|  1.15M|  }
  162|       |
  163|   529k|  return max;
  164|   529k|}
ixheaace_fd_qc_util.c:iusace_get_frame_padding:
   98|   239k|                                       WORD32 ccfl) {
   99|   239k|  WORD32 padding_on = 0;
  100|   239k|  WORD32 difference;
  101|       |
  102|   239k|  difference = iusace_calc_frame_len(bit_rate, sample_rate, FRAME_LEN_BYTES_MODULO, ccfl);
  ------------------
  |  |   27|   239k|#define FRAME_LEN_BYTES_MODULO (1)
  ------------------
  103|       |
  104|   239k|  *padding -= difference;
  105|       |
  106|   239k|  if (*padding <= 0) {
  ------------------
  |  Branch (106:7): [True: 44.9k, False: 194k]
  ------------------
  107|  44.9k|    padding_on = 1;
  108|  44.9k|    *padding += sample_rate;
  109|  44.9k|  }
  110|       |
  111|   239k|  return padding_on;
  112|   239k|}
ixheaace_fd_qc_util.c:iusace_calc_frame_len:
   81|   479k|                                    WORD32 ccfl) {
   82|   479k|  WORD32 result;
   83|       |
   84|   479k|  result = ((ccfl) >> 3) * (bit_rate);
   85|   479k|  switch (mode) {
  ------------------
  |  Branch (85:11): [True: 479k, False: 0]
  ------------------
   86|   239k|    case FRAME_LEN_BYTES_MODULO:
  ------------------
  |  |   27|   239k|#define FRAME_LEN_BYTES_MODULO (1)
  ------------------
  |  Branch (86:5): [True: 239k, False: 239k]
  ------------------
   87|   239k|      result %= sample_rate;
   88|   239k|      break;
   89|   239k|    case FRAME_LEN_BYTES_INT:
  ------------------
  |  |   28|   239k|#define FRAME_LEN_BYTES_INT (2)
  ------------------
  |  Branch (89:5): [True: 239k, False: 239k]
  ------------------
   90|   239k|      result /= sample_rate;
   91|   239k|      break;
   92|   479k|  }
   93|       |
   94|   479k|  return (result);
   95|   479k|}

iusace_stereo_proc:
  260|   188k|                                ia_usac_encoder_config_struct *ptr_usac_config, WORD32 chn) {
  261|   188k|  IA_ERRORCODE err_code;
  262|   188k|  WORD32 i = 0;
  263|   188k|  WORD32 j = 0;
  264|   188k|  iusace_scratch_mem *pstr_scratch = &ptr_usac_data->str_scratch;
  265|   188k|  ia_psy_mod_data_struct *pstr_psy_data = ptr_usac_data->str_psy_mod.str_psy_data;
  266|   188k|  ia_psy_mod_out_data_struct *pstr_psy_out = ptr_usac_data->str_psy_mod.str_psy_out_data;
  267|   188k|  WORD32 *ptr_num_sfb = pstr_sfb_prms->num_sfb;
  268|   188k|  WORD32 *ptr_num_window_groups = pstr_sfb_prms->num_window_groups;
  269|   188k|  WORD32 ccfl = ptr_usac_config->ccfl;
  270|   188k|  ia_ms_info_struct *pstr_ms_info = &ptr_usac_data->str_ms_info[chn];
  271|       |
  272|   188k|  FLOAT64 tmp = 0.0f;
  273|   188k|  FLOAT32 nrg_mid = 0.0f, nrg_side = 0.0f, nrg_left = 0.0f, nrg_right = 0.0f;
  274|   188k|  FLOAT64 *ptr_scratch_spec = pstr_scratch->p_quant_spectrum_spec_scratch;
  275|   188k|  FLOAT32 ratio_mid = 0.0f, ratio_side = 0.0f;
  276|   188k|  FLOAT32 eps = 1.0e-6f;
  277|       |  /* Save a copy of left and right channel MDCT spectra before they are modified */
  278|   188k|  memcpy(ptr_usac_data->left_chan_save[chn], ptr_usac_data->spectral_line_vector[chn],
  279|   188k|         ccfl * sizeof(FLOAT64));
  280|   188k|  memcpy(ptr_usac_data->right_chan_save[chn], ptr_usac_data->spectral_line_vector[chn + 1],
  281|   188k|         ccfl * sizeof(FLOAT64));
  282|       |
  283|   188k|  if (ptr_usac_config->cmplx_pred_flag == 1) {
  ------------------
  |  Branch (283:7): [True: 113k, False: 74.8k]
  ------------------
  284|       |    /* Refinement - decision on whether to use complex prediction or MS */
  285|   105M|    for (i = 0; i < ccfl; i++) {
  ------------------
  |  Branch (285:17): [True: 105M, False: 113k]
  ------------------
  286|   105M|      tmp = ptr_usac_data->spectral_line_vector[chn][i];
  287|   105M|      ptr_scratch_spec[i] = 0.5f * (ptr_usac_data->spectral_line_vector[chn][i] +
  288|   105M|                                    ptr_usac_data->spectral_line_vector[chn + 1][i]);
  289|   105M|      ptr_scratch_spec[ccfl + i] = 0.5f * (tmp - ptr_usac_data->spectral_line_vector[chn + 1][i]);
  290|   105M|    }
  291|       |
  292|   105M|    for (i = 0; i < ccfl; i++) {
  ------------------
  |  Branch (292:17): [True: 105M, False: 113k]
  ------------------
  293|   105M|      nrg_mid += (FLOAT32)(ptr_scratch_spec[i] * ptr_scratch_spec[i]);
  294|   105M|      nrg_side += (FLOAT32)(ptr_scratch_spec[ccfl + i] * ptr_scratch_spec[ccfl + i]);
  295|   105M|      nrg_left += (FLOAT32)(ptr_usac_data->spectral_line_vector[chn][i] *
  296|   105M|                            ptr_usac_data->spectral_line_vector[chn][i]);
  297|   105M|      nrg_right += (FLOAT32)(ptr_usac_data->spectral_line_vector[chn + 1][i] *
  298|   105M|                             ptr_usac_data->spectral_line_vector[chn + 1][i]);
  299|   105M|    }
  300|       |
  301|   113k|    ratio_mid = nrg_mid / (MAX(nrg_left, nrg_right) + eps);
  ------------------
  |  |   89|   113k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 35.2k, False: 78.0k]
  |  |  ------------------
  ------------------
  302|   113k|    ratio_side = nrg_side / (MAX(nrg_left, nrg_right) + eps);
  ------------------
  |  |   89|   113k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 35.2k, False: 78.0k]
  |  |  ------------------
  ------------------
  303|       |
  304|   113k|    if (ratio_mid >= 0.8f || ratio_side >= 0.8f || nrg_mid == 0.f || nrg_side == 0.f) {
  ------------------
  |  Branch (304:9): [True: 75.8k, False: 37.5k]
  |  Branch (304:30): [True: 19, False: 37.5k]
  |  Branch (304:52): [True: 5.55k, False: 31.9k]
  |  Branch (304:70): [True: 281, False: 31.7k]
  ------------------
  305|  81.6k|      pstr_ms_info->ms_mask = 0;
  306|  81.6k|    } else {
  307|  31.7k|      pstr_ms_info->ms_mask = 3;
  308|  31.7k|    }
  309|   113k|  }
  310|       |
  311|   188k|  if (pstr_ms_info->ms_mask != 3) {
  ------------------
  |  Branch (311:7): [True: 156k, False: 31.7k]
  ------------------
  312|   156k|    WORD32 idx = 0;
  313|   156k|    WORD32 sfb;
  314|       |
  315|  5.66M|    for (sfb = 0; sfb < ptr_num_sfb[chn]; sfb++) {
  ------------------
  |  Branch (315:19): [True: 5.50M, False: 156k]
  ------------------
  316|  5.50M|      ptr_usac_data->pred_coef_re_prev[chn][sfb] = 0;
  317|  5.50M|      ptr_usac_data->pred_coef_im_prev[chn][sfb] = 0;
  318|  5.50M|      ptr_usac_data->temp_pred_coef_re_prev[chn][sfb] = 0;
  319|  5.50M|      ptr_usac_data->temp_pred_coef_im_prev[chn][sfb] = 0;
  320|  5.50M|    }
  321|       |
  322|   156k|    memset(ptr_usac_data->str_ms_info[chn].ms_used, 0,
  323|   156k|           MAX_SFB_LONG * MAX_SHORT_WINDOWS * sizeof(WORD32));
  ------------------
  |  |   53|   156k|#define MAX_SFB_LONG 51
  ------------------
                         MAX_SFB_LONG * MAX_SHORT_WINDOWS * sizeof(WORD32));
  ------------------
  |  |   52|   156k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  324|       |
  325|   156k|    iusace_ms_apply(pstr_psy_data, ptr_usac_data->spectral_line_vector[chn],
  326|   156k|                    ptr_usac_data->spectral_line_vector[chn + 1],
  327|   156k|                    &ptr_usac_data->str_ms_info[chn].ms_mask,
  328|   156k|                    ptr_usac_data->str_ms_info[chn].ms_used,
  329|   156k|                    ptr_num_window_groups[chn] * ptr_num_sfb[chn], ptr_num_sfb[chn],
  330|   156k|                    pstr_psy_out[chn].max_sfb_per_grp, pstr_sfb_prms->grouped_sfb_offset[chn],
  331|   156k|                    chn, ptr_usac_config->cmplx_pred_flag == 1 ? ptr_scratch_spec : NULL);
  ------------------
  |  Branch (331:26): [True: 81.6k, False: 74.8k]
  ------------------
  332|       |
  333|   447k|    for (i = 0; i < ptr_num_window_groups[chn]; i++) {
  ------------------
  |  Branch (333:17): [True: 291k, False: 156k]
  ------------------
  334|  7.68M|      for (j = 0; j < ptr_num_sfb[chn]; j++) {
  ------------------
  |  Branch (334:19): [True: 7.39M, False: 291k]
  ------------------
  335|  7.39M|        pstr_psy_out[chn].ms_used[idx++] = ptr_usac_data->str_ms_info[chn].ms_used[i][j];
  336|  7.39M|      }
  337|   291k|    }
  338|   156k|  } else {
  339|       |    /* Reset buffer to zero */
  340|   285k|    for (WORD32 group = 0; group < MAX_SHORT_WINDOWS; group++) {
  ------------------
  |  |   52|   285k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (340:28): [True: 253k, False: 31.7k]
  ------------------
  341|   253k|      memset(ptr_usac_data->cplx_pred_used[chn][group], 0, MAX_SFB_LONG * sizeof(WORD32));
  ------------------
  |  |   53|   253k|#define MAX_SFB_LONG 51
  ------------------
  342|   253k|    }
  343|       |
  344|  31.7k|    ptr_usac_data->cplx_pred_all[chn] = 1; /* Disable bandwise switching to L/R */
  345|   112k|    for (i = 0; i < ptr_num_window_groups[chn]; i++) {
  ------------------
  |  Branch (345:17): [True: 80.7k, False: 31.7k]
  ------------------
  346|   820k|      for (j = 0; j < ptr_num_sfb[chn]; j += 2) {
  ------------------
  |  Branch (346:19): [True: 740k, False: 80.7k]
  ------------------
  347|   740k|        ptr_usac_data->cplx_pred_used[chn][i][j] = 1;
  348|   740k|        if ((j + 1) < ptr_num_sfb[chn]) {
  ------------------
  |  Branch (348:13): [True: 713k, False: 26.9k]
  ------------------
  349|   713k|          ptr_usac_data->cplx_pred_used[chn][i][j + 1] = ptr_usac_data->cplx_pred_used[chn][i][j];
  350|   713k|        }
  351|   740k|      }
  352|  80.7k|    }
  353|       |
  354|  31.7k|    err_code = iusace_cplx_pred_proc(
  355|  31.7k|        ptr_usac_data, ptr_usac_config, usac_independancy_flag, pstr_sfb_prms, chn, pstr_psy_data,
  356|  31.7k|        pstr_sfb_prms->grouped_sfb_offset[chn], pstr_scratch->p_cmpx_mdct_temp_buf,
  357|  31.7k|        ptr_scratch_spec, nrg_mid, nrg_side);
  358|  31.7k|    if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  31.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (358:9): [True: 0, False: 31.7k]
  ------------------
  359|      0|      return err_code;
  360|      0|    }
  361|  31.7k|  }
  362|   188k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   188k|#define IA_NO_ERROR 0x00000000
  ------------------
  363|   188k|}
iusace_grouping:
  368|   239k|                             WORD32 ele_id) {
  369|   239k|  WORD32 i = 0, grp, sfb, wnd;
  370|   239k|  WORD32 j = 0;
  371|   239k|  WORD32 k;
  372|   239k|  WORD32 ch;
  373|   239k|  ia_psy_mod_struct *pstr_psy_config = &ptr_usac_data->str_psy_mod;
  374|   239k|  ia_psy_mod_data_struct *pstr_psy_data = ptr_usac_data->str_psy_mod.str_psy_data;
  375|   239k|  WORD32 *ptr_window_sequence = pstr_sfb_prms->window_sequence;
  376|   239k|  WORD32 *ptr_num_sfb = pstr_sfb_prms->num_sfb;
  377|   239k|  WORD32 *ptr_num_window_groups = pstr_sfb_prms->num_window_groups;
  378|   239k|  ia_psy_mod_out_data_struct *pstr_psy_out = ptr_usac_data->str_psy_mod.str_psy_out_data;
  379|       |
  380|   667k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (380:18): [True: 427k, False: 239k]
  ------------------
  381|   427k|    if (ptr_window_sequence[ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   427k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (381:9): [True: 142k, False: 285k]
  ------------------
  382|   142k|      iusace_sort_for_grouping(
  383|   142k|          pstr_sfb_prms->grouped_sfb_offset[ch], pstr_sfb_prms->sfb_width_table[ch],
  384|   142k|          ptr_usac_data->str_scratch.p_sort_grouping_scratch,
  385|   142k|          ptr_usac_data->spectral_line_vector[ch], ptr_num_window_groups[ch],
  386|   142k|          pstr_sfb_prms->window_group_length[ch], ptr_num_sfb[ch], ptr_usac_config->ccfl);
  387|   285k|    } else if ((ptr_window_sequence[ch] == ONLY_LONG_SEQUENCE) ||
  ------------------
  |  |   45|   285k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (387:16): [True: 196k, False: 88.9k]
  ------------------
  388|  88.9k|               (ptr_window_sequence[ch] == LONG_START_SEQUENCE) ||
  ------------------
  |  |   46|  88.9k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (388:16): [True: 47.0k, False: 41.9k]
  ------------------
  389|  41.9k|               (ptr_window_sequence[ch] == LONG_STOP_SEQUENCE) ||
  ------------------
  |  |   48|  41.9k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (389:16): [True: 41.7k, False: 212]
  ------------------
  390|   285k|               (ptr_window_sequence[ch] == STOP_START_SEQUENCE)) {
  ------------------
  |  |   49|    212|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (390:16): [True: 212, False: 0]
  ------------------
  391|   285k|      pstr_sfb_prms->grouped_sfb_offset[ch][0] = 0;
  392|   285k|      k = 0;
  393|  12.7M|      for (i = 0; i < ptr_num_sfb[ch]; i++) {
  ------------------
  |  Branch (393:19): [True: 12.4M, False: 285k]
  ------------------
  394|  12.4M|        pstr_sfb_prms->grouped_sfb_offset[ch][i] = k;
  395|  12.4M|        k += pstr_sfb_prms->sfb_width_table[ch][i];
  396|  12.4M|      }
  397|   285k|      pstr_sfb_prms->grouped_sfb_offset[ch][i] = k;
  398|   285k|    } else {
  399|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_TYPE;
  400|      0|    }
  401|   427k|  }
  402|       |
  403|   667k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (403:18): [True: 427k, False: 239k]
  ------------------
  404|   427k|    if (pstr_psy_data[ch].window_sequence == 2) {
  ------------------
  |  Branch (404:9): [True: 142k, False: 285k]
  ------------------
  405|   142k|      i = 0;
  406|   690k|      for (grp = 0; grp < ptr_num_window_groups[ch]; grp++) {
  ------------------
  |  Branch (406:21): [True: 547k, False: 142k]
  ------------------
  407|  8.10M|        for (sfb = 0; sfb < ptr_num_sfb[ch]; sfb++) {
  ------------------
  |  Branch (407:23): [True: 7.55M, False: 547k]
  ------------------
  408|  7.55M|          pstr_psy_out[ch].sfb_min_snr[i++] =
  409|  7.55M|              pstr_psy_config->str_psy_short_config[ele_id].sfb_min_snr[sfb];
  410|  7.55M|        }
  411|   547k|      }
  412|   142k|      wnd = 0;
  413|   142k|      i = 0;
  414|   690k|      for (grp = 0; grp < ptr_num_window_groups[ch]; grp++) {
  ------------------
  |  Branch (414:21): [True: 547k, False: 142k]
  ------------------
  415|  8.10M|        for (sfb = 0; sfb < ptr_num_sfb[ch]; sfb++) {
  ------------------
  |  Branch (415:23): [True: 7.55M, False: 547k]
  ------------------
  416|  7.55M|          FLOAT32 threshold = pstr_psy_data[ch].sfb_thr_short[wnd][sfb];
  417|  7.55M|          FLOAT32 energy = pstr_psy_data[ch].sfb_energy_short[wnd][sfb];
  418|  7.55M|          FLOAT32 energy_ms = pstr_psy_data[ch].ptr_sfb_energy_short_ms[wnd][sfb];
  419|  7.55M|          FLOAT32 spread_energy = pstr_psy_data[ch].sfb_spreaded_energy_short[wnd][sfb];
  420|  15.6M|          for (j = 1; j < pstr_sfb_prms->window_group_length[ch][grp]; j++) {
  ------------------
  |  Branch (420:23): [True: 8.13M, False: 7.55M]
  ------------------
  421|  8.13M|            threshold = threshold + pstr_psy_data[ch].sfb_thr_short[wnd + j][sfb];
  422|  8.13M|            energy = energy + pstr_psy_data[ch].sfb_energy_short[wnd + j][sfb];
  423|  8.13M|            spread_energy =
  424|  8.13M|                spread_energy + pstr_psy_data[ch].sfb_spreaded_energy_short[wnd + j][sfb];
  425|  8.13M|            energy_ms = energy_ms + pstr_psy_data[ch].ptr_sfb_energy_short_ms[wnd + j][sfb];
  426|  8.13M|          }
  427|  7.55M|          pstr_psy_data[ch].ptr_sfb_thr_long[i] = threshold;
  428|  7.55M|          pstr_psy_data[ch].ptr_sfb_energy_long[i] = energy;
  429|  7.55M|          pstr_psy_data[ch].ptr_sfb_energy_long_ms[i] = energy_ms;
  430|  7.55M|          pstr_psy_data[ch].ptr_sfb_spreaded_energy_long[i++] = spread_energy;
  431|  7.55M|        }
  432|   547k|        wnd += pstr_sfb_prms->window_group_length[ch][grp];
  433|   547k|      }
  434|   285k|    } else {
  435|  12.7M|      for (sfb = 0; sfb < ptr_num_sfb[ch]; sfb++) {
  ------------------
  |  Branch (435:21): [True: 12.4M, False: 285k]
  ------------------
  436|  12.4M|        pstr_psy_out[ch].sfb_min_snr[sfb] =
  437|  12.4M|            pstr_psy_config->str_psy_long_config[ele_id].sfb_min_snr[sfb];
  438|  12.4M|      }
  439|   285k|    }
  440|   427k|  }
  441|   239k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   239k|#define IA_NO_ERROR 0x00000000
  ------------------
  442|   239k|}
iusace_quantize_spec:
  449|   239k|                                  WORD32 *is_gain_limited) {
  450|   239k|  IA_ERRORCODE err_code;
  451|   239k|  WORD32 i = 0, sfb;
  452|   239k|  WORD32 j = 0;
  453|   239k|  WORD32 k;
  454|   239k|  WORD32 max_bits;
  455|   239k|  WORD32 ch;
  456|   239k|  iusace_scratch_mem *pstr_scratch = &ptr_usac_data->str_scratch;
  457|   239k|  WORD32 num_scfs[2];
  458|   239k|  FLOAT32 **sfb_form_fac = &pstr_scratch->ptr_sfb_form_fac[0];
  459|   239k|  WORD32 max_ch_dyn_bits[2] = {0};
  460|   239k|  FLOAT32 ch_bit_dist[2];
  461|   239k|  WORD32 constraints_fulfilled;
  462|   239k|  WORD32 iterations = 0;
  463|   239k|  WORD32 max_val;
  464|   239k|  WORD32 kk, idx = 0;
  465|       |
  466|   239k|  FLOAT32 *ptr_exp_spec = pstr_scratch->p_exp_spec;
  467|   239k|  FLOAT32 *ptr_mdct_spec_float = pstr_scratch->p_mdct_spec_float;
  468|   239k|  ia_psy_mod_data_struct *pstr_psy_data = ptr_usac_data->str_psy_mod.str_psy_data;
  469|   239k|  ia_qc_out_data_struct *pstr_qc_out = &ptr_usac_data->str_qc_main.str_qc_out;
  470|   239k|  ia_psy_mod_out_data_struct *pstr_psy_out = ptr_usac_data->str_psy_mod.str_psy_out_data;
  471|   239k|  ia_qc_data_struct *pstr_qc_data = &ptr_usac_data->str_qc_main.str_qc_data[ele_id];
  472|   239k|  ia_adj_thr_elem_struct *pstr_adj_thr_elem = &pstr_qc_data->str_adj_thr_ele;
  473|   239k|  WORD32 *ptr_window_sequence = pstr_sfb_prms->window_sequence;
  474|   239k|  WORD32 *ptr_max_sfb = pstr_sfb_prms->max_sfb;
  475|   239k|  WORD32 *ptr_num_sfb = pstr_sfb_prms->num_sfb;
  476|   239k|  WORD32 *ptr_num_window_groups = pstr_sfb_prms->num_window_groups;
  477|   239k|  WORD32 bitres_bits, bitres_diff;
  478|   239k|  WORD32 gain;
  479|       |
  480|   239k|  memset(num_scfs, 0, 2 * sizeof(num_scfs[0]));
  481|       |
  482|   667k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (482:18): [True: 427k, False: 239k]
  ------------------
  483|   427k|    num_scfs[idx] = ptr_num_sfb[ch] * ptr_num_window_groups[ch];
  484|       |
  485|   427k|    pstr_psy_out[ch].sfb_count = num_scfs[idx];
  486|   427k|    pstr_psy_out[ch].sfb_per_group = num_scfs[idx] / ptr_num_window_groups[ch];
  487|   427k|    pstr_psy_out[ch].window_sequence = pstr_psy_data[ch].window_sequence;
  488|   427k|    pstr_psy_out[ch].window_shape = iusace_window_shape[pstr_psy_data[ch].window_sequence];
  489|   427k|    pstr_psy_out[ch].ptr_spec_coeffs = ptr_usac_data->spectral_line_vector[ch];
  490|   427k|    pstr_psy_out[ch].ptr_sfb_energy = pstr_psy_data[ch].ptr_sfb_energy_long;
  491|   427k|    pstr_psy_out[ch].ptr_sfb_thr = pstr_psy_data[ch].ptr_sfb_thr_long;
  492|   427k|    pstr_psy_out[ch].ptr_sfb_spread_energy = pstr_psy_data[ch].ptr_sfb_spreaded_energy_long;
  493|       |
  494|  20.4M|    for (j = 0; j < num_scfs[idx]; j++) {
  ------------------
  |  Branch (494:17): [True: 20.0M, False: 427k]
  ------------------
  495|  20.0M|      pstr_psy_out[ch].sfb_offsets[j] = pstr_sfb_prms->grouped_sfb_offset[ch][j];
  496|  20.0M|    }
  497|   427k|    pstr_psy_out[ch].sfb_offsets[num_scfs[idx]] =
  498|   427k|        pstr_sfb_prms->grouped_sfb_offset[ch][num_scfs[idx]];
  499|       |
  500|  26.0M|    for (j = 0; j < MAX_NUM_GROUPED_SFB; j++) {
  ------------------
  |  |   24|  26.0M|#define MAX_NUM_GROUPED_SFB (60)
  ------------------
  |  Branch (500:17): [True: 25.6M, False: 427k]
  ------------------
  501|  25.6M|      sfb_form_fac[idx][j] = MIN_FLT_VAL;
  ------------------
  |  |  182|  25.6M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  502|  25.6M|    }
  503|       |
  504|   427k|    iusace_calc_form_fac_per_chan(&pstr_psy_out[ch], pstr_scratch, idx);
  505|   427k|    idx++;
  506|   427k|  }
  507|       |
  508|   239k|  pstr_qc_out->static_bits =
  509|   239k|      iusace_count_static_bits(ptr_usac_data, ptr_usac_config, pstr_sfb_prms, pstr_psy_out,
  510|   239k|                               num_chans, chn, usac_independancy_flag, ele_id);
  511|       |
  512|   239k|  iusace_adj_bitrate(pstr_qc_data, pstr_qc_data->ch_bitrate, ptr_usac_config->core_sample_rate,
  513|   239k|                     ptr_usac_config->ccfl);
  514|   239k|  err_code =
  515|   239k|      iusace_adj_thr(pstr_adj_thr_elem, pstr_psy_out, ch_bit_dist, pstr_qc_out,
  516|   239k|                     pstr_qc_data->avg_bits - pstr_qc_out->static_bits, pstr_qc_data->bit_res_lvl,
  517|   239k|                     pstr_qc_data->max_bitres_bits, pstr_qc_out->static_bits,
  518|   239k|                     &pstr_qc_data->max_bit_fac, num_chans, chn, pstr_scratch);
  519|   239k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   239k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (519:7): [True: 0, False: 239k]
  ------------------
  520|      0|    return err_code;
  521|      0|  }
  522|       |
  523|   239k|  iusace_estimate_scfs_chan(pstr_psy_out, pstr_qc_out->str_qc_out_chan, num_chans, chn,
  524|   239k|                            pstr_scratch);
  525|   239k|  idx = 0;
  526|   667k|  for (ch = 0; ch < num_chans; ch++) {
  ------------------
  |  Branch (526:16): [True: 427k, False: 239k]
  ------------------
  527|   427k|    max_ch_dyn_bits[ch] = (WORD32)floor(
  528|   427k|        ch_bit_dist[ch] * (FLOAT32)(pstr_qc_data->avg_bits + pstr_qc_data->bit_res_lvl - 7 -
  529|   427k|                                    pstr_qc_out->static_bits));
  530|   427k|    idx++;
  531|   427k|  }
  532|       |
  533|   239k|  pstr_qc_out->dyn_bits = 0;
  534|   239k|  idx = 0;
  535|   667k|  for (ch = chn; ch < chn + num_chans; ch++) {
  ------------------
  |  Branch (535:18): [True: 427k, False: 239k]
  ------------------
  536|   427k|    iterations = 0;
  537|   427k|    gain = 0;
  538|   410M|    for (kk = 0; kk < ptr_usac_config->ccfl; kk++) {
  ------------------
  |  Branch (538:18): [True: 410M, False: 427k]
  ------------------
  539|   410M|      ptr_exp_spec[kk] = (FLOAT32)pstr_psy_out[ch].ptr_spec_coeffs[kk];
  540|   410M|      ptr_mdct_spec_float[kk] = (FLOAT32)pstr_psy_out[ch].ptr_spec_coeffs[kk];
  541|   410M|    }
  542|   529k|    do {
  543|   529k|      constraints_fulfilled = 1;
  544|   529k|      WORD32 quant_spec_is_zero = 1;
  545|   529k|      if (iterations > 0) {
  ------------------
  |  Branch (545:11): [True: 102k, False: 427k]
  ------------------
  546|   428k|        for (WORD32 sfb_offs = 0; sfb_offs < pstr_psy_out[ch].sfb_count;
  ------------------
  |  Branch (546:35): [True: 326k, False: 102k]
  ------------------
  547|   326k|             sfb_offs += pstr_psy_out[ch].sfb_per_group) {
  548|  3.35M|          for (sfb = 0; sfb < pstr_psy_out[ch].max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (548:25): [True: 3.02M, False: 326k]
  ------------------
  549|  3.02M|            WORD32 scalefactor = pstr_qc_out->str_qc_out_chan[idx].scalefactor[sfb + sfb_offs];
  550|  3.02M|            gain = MAX(gain, pstr_qc_out->str_qc_out_chan[idx].global_gain - scalefactor);
  ------------------
  |  |   89|  3.02M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 1.42M, False: 1.59M]
  |  |  ------------------
  ------------------
  551|  3.02M|            iusace_quantize_lines(
  552|  3.02M|                pstr_qc_out->str_qc_out_chan[idx].global_gain - scalefactor,
  553|  3.02M|                pstr_psy_out[ch].sfb_offsets[sfb_offs + sfb + 1] -
  554|  3.02M|                    pstr_psy_out[ch].sfb_offsets[sfb_offs + sfb],
  555|  3.02M|                ptr_exp_spec + pstr_psy_out[ch].sfb_offsets[sfb_offs + sfb],
  556|  3.02M|                pstr_qc_out->str_qc_out_chan[idx].quant_spec +
  557|  3.02M|                    pstr_psy_out[ch].sfb_offsets[sfb_offs + sfb],
  558|  3.02M|                ptr_mdct_spec_float + pstr_psy_out[ch].sfb_offsets[sfb_offs + sfb]);
  559|  3.02M|          }
  560|   326k|        }
  561|   102k|      }
  562|   529k|      max_val =
  563|   529k|          iusace_calc_max_val_in_sfb(pstr_psy_out[ch].sfb_count, pstr_psy_out[ch].max_sfb_per_grp,
  564|   529k|                                     pstr_psy_out[ch].sfb_per_group, pstr_psy_out[ch].sfb_offsets,
  565|   529k|                                     pstr_qc_out->str_qc_out_chan[idx].quant_spec);
  566|   529k|      if (max_val > MAX_QUANT) {
  ------------------
  |  |   22|   529k|#define MAX_QUANT 8192
  ------------------
  |  Branch (566:11): [True: 27, False: 529k]
  ------------------
  567|     27|        constraints_fulfilled = 0;
  568|     27|      }
  569|       |
  570|  25.0M|      for (k = 0; k < num_scfs[idx]; k++) {
  ------------------
  |  Branch (570:19): [True: 24.5M, False: 529k]
  ------------------
  571|  24.5M|        for (i = pstr_sfb_prms->grouped_sfb_offset[ch][k];
  572|   512M|             i < pstr_sfb_prms->grouped_sfb_offset[ch][k + 1]; i++) {
  ------------------
  |  Branch (572:14): [True: 488M, False: 24.5M]
  ------------------
  573|   488M|          ptr_usac_data->str_quant_info[idx].quant_degroup[i] =
  574|   488M|              (WORD32)pstr_qc_out->str_qc_out_chan[idx].quant_spec[i];
  575|   488M|          if (ptr_usac_data->str_quant_info[idx].quant_degroup[i] != 0) {
  ------------------
  |  Branch (575:15): [True: 117M, False: 370M]
  ------------------
  576|   117M|            quant_spec_is_zero = 0;
  577|   117M|          }
  578|   488M|        }
  579|  24.5M|      }
  580|       |
  581|   529k|      if (ptr_window_sequence[ch] == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   529k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (581:11): [True: 221k, False: 308k]
  ------------------
  582|   221k|        iusace_degroup_int(pstr_sfb_prms->grouped_sfb_offset[ch], ptr_num_sfb[ch],
  583|   221k|                           ptr_usac_data->str_scratch.p_degroup_scratch,
  584|   221k|                           ptr_usac_data->str_quant_info[idx].quant_degroup,
  585|   221k|                           ptr_num_window_groups[ch], pstr_sfb_prms->window_group_length[ch],
  586|   221k|                           ptr_usac_config->ccfl);
  587|   221k|      }
  588|       |
  589|   529k|      ptr_usac_data->str_quant_info[idx].max_spec_coeffs = 0;
  590|  14.8M|      for (k = 0; k < ptr_max_sfb[ch]; k++) {
  ------------------
  |  Branch (590:19): [True: 14.2M, False: 529k]
  ------------------
  591|  14.2M|        ptr_usac_data->str_quant_info[idx].max_spec_coeffs +=
  592|  14.2M|            pstr_sfb_prms->sfb_width_table[ch][k];
  593|  14.2M|      }
  594|       |
  595|  25.0M|      for (i = 0; i < num_scfs[idx]; i++) {
  ------------------
  |  Branch (595:19): [True: 24.5M, False: 529k]
  ------------------
  596|  24.5M|        ptr_usac_data->str_quant_info[idx].scale_factor[i] =
  597|  24.5M|            pstr_qc_out->str_qc_out_chan[idx].global_gain -
  598|  24.5M|            pstr_qc_out->str_qc_out_chan[idx].scalefactor[i] + SF_OFFSET;
  ------------------
  |  |   23|  24.5M|#define SF_OFFSET 100
  ------------------
  599|  24.5M|      }
  600|       |
  601|   529k|      max_bits = iusace_count_fd_bits(pstr_sfb_prms, ptr_usac_data, usac_independancy_flag,
  602|   529k|                                      ptr_usac_config, ch, idx);
  603|       |
  604|   529k|      if (max_bits > max_ch_dyn_bits[idx]) {
  ------------------
  |  Branch (604:11): [True: 109k, False: 420k]
  ------------------
  605|   109k|        constraints_fulfilled = 0;
  606|   109k|      }
  607|   529k|      if (quant_spec_is_zero == 1) {
  ------------------
  |  Branch (607:11): [True: 114k, False: 415k]
  ------------------
  608|   114k|        constraints_fulfilled = 1;
  609|       |        /*Bit consuption is exceding bit reservoir, there is no scope left for bit consumption
  610|       |          reduction, as spectrum is zero. Hence breaking the quantization loop. */
  611|   114k|        if (iterations > 0) {
  ------------------
  |  Branch (611:13): [True: 886, False: 113k]
  ------------------
  612|    886|          *is_quant_spec_zero = 1;
  613|    886|          max_bits = max_ch_dyn_bits[idx];
  614|    886|        }
  615|   114k|      }
  616|   529k|      if ((gain == MAX_GAIN_INDEX) && (constraints_fulfilled == 0)) {
  ------------------
  |  |  120|   529k|#define MAX_GAIN_INDEX (128)
  ------------------
  |  Branch (616:11): [True: 231, False: 529k]
  |  Branch (616:39): [True: 127, False: 104]
  ------------------
  617|       |        /* Bit consuption is exceding bit reservoir, there is no scope left for bit consumption
  618|       |           reduction, as gain has reached the maximum value. Hence breaking the quantization
  619|       |           loop. */
  620|    127|        constraints_fulfilled = 1;
  621|    127|        *is_gain_limited = 1;
  622|    127|        max_bits = max_ch_dyn_bits[idx];
  623|    127|      }
  624|   529k|      if (!constraints_fulfilled) {
  ------------------
  |  Branch (624:11): [True: 102k, False: 427k]
  ------------------
  625|   102k|        pstr_qc_out->str_qc_out_chan[idx].global_gain++;
  626|   102k|      }
  627|   529k|      iterations++;
  628|   529k|    } while (!constraints_fulfilled);
  ------------------
  |  Branch (628:14): [True: 102k, False: 427k]
  ------------------
  629|       |
  630|   427k|    pstr_qc_out->dyn_bits += max_bits;
  631|       |
  632|   427k|    if (ptr_usac_data->noise_filling[ele_id]) {
  ------------------
  |  Branch (632:9): [True: 215k, False: 212k]
  ------------------
  633|   215k|      WORD32 max_nf_sfb = ptr_max_sfb[ch];
  634|       |
  635|   215k|      if (ptr_window_sequence[ch] != EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   40|   215k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (635:11): [True: 144k, False: 70.6k]
  ------------------
  636|   144k|        iusace_noise_filling(
  637|   144k|            &ptr_usac_data->noise_level[idx], &ptr_usac_data->noise_offset[idx],
  638|   144k|            ptr_usac_data->spectral_line_vector[ch], &ptr_usac_data->str_quant_info[idx],
  639|   144k|            pstr_sfb_prms->grouped_sfb_offset[ch], max_nf_sfb, ptr_usac_config->ccfl,
  640|   144k|            ptr_num_window_groups[ch], pstr_sfb_prms->window_group_length[ch], 160,
  641|   144k|            ptr_usac_data->str_scratch.p_noise_filling_highest_tone);
  642|   144k|      } else {
  643|  70.6k|        iusace_noise_filling(
  644|  70.6k|            &ptr_usac_data->noise_level[idx], &ptr_usac_data->noise_offset[idx],
  645|  70.6k|            ptr_usac_data->spectral_line_vector[ch], &ptr_usac_data->str_quant_info[idx],
  646|  70.6k|            pstr_sfb_prms->grouped_sfb_offset[ch], max_nf_sfb, ptr_usac_config->ccfl >> 3,
  647|  70.6k|            ptr_num_window_groups[ch], pstr_sfb_prms->window_group_length[ch], 20,
  648|  70.6k|            (FLOAT64 *)ptr_usac_data->str_scratch.p_noise_filling_highest_tone);
  649|  70.6k|      }
  650|       |
  651|   215k|      if (ptr_usac_data->noise_level[idx] == 0 && ptr_usac_data->noise_offset[idx] != 0 &&
  ------------------
  |  Branch (651:11): [True: 183k, False: 31.8k]
  |  Branch (651:51): [True: 0, False: 183k]
  ------------------
  652|      0|          pstr_sfb_prms->common_win[ch]) {
  ------------------
  |  Branch (652:11): [True: 0, False: 0]
  ------------------
  653|      0|        ptr_usac_data->complex_coef[ch] = 0;
  654|      0|      }
  655|   215k|    }
  656|   427k|    idx++;
  657|   427k|  }
  658|       |
  659|   239k|  pstr_adj_thr_elem->dyn_bits_last = pstr_qc_out->dyn_bits;
  660|       |
  661|   239k|  bitres_bits = pstr_qc_data->max_bitres_bits - pstr_qc_data->bit_res_lvl;
  662|   239k|  bitres_diff = pstr_qc_data->avg_bits - (pstr_qc_out->static_bits + pstr_qc_out->dyn_bits);
  663|   239k|  pstr_qc_out->fill_bits = MAX(0, (bitres_diff - bitres_bits));
  ------------------
  |  |   89|   239k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 113k, False: 126k]
  |  |  ------------------
  ------------------
  664|       |
  665|   239k|  if (pstr_qc_data->avg_bits > 0) {
  ------------------
  |  Branch (665:7): [True: 239k, False: 0]
  ------------------
  666|   239k|    pstr_qc_data->bit_res_lvl +=
  667|   239k|        pstr_qc_data->avg_bits -
  668|   239k|        (pstr_qc_out->static_bits + pstr_qc_out->dyn_bits + pstr_qc_out->fill_bits);
  669|   239k|  } else {
  670|      0|    pstr_qc_data->bit_res_lvl = pstr_qc_data->max_bits;
  671|      0|  }
  672|       |
  673|   239k|  if (pstr_qc_data->bit_res_lvl < 0 ||
  ------------------
  |  Branch (673:7): [True: 5.55k, False: 233k]
  ------------------
  674|   233k|      pstr_qc_data->bit_res_lvl > pstr_qc_data->max_bitres_bits) {
  ------------------
  |  Branch (674:7): [True: 0, False: 233k]
  ------------------
  675|  5.55k|    return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_BIT_RSVR_LVL;
  676|  5.55k|  }
  677|       |
  678|   233k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   233k|#define IA_NO_ERROR 0x00000000
  ------------------
  679|   239k|}
ixheaace_fd_quant.c:iusace_sort_for_grouping:
  181|   142k|                                     WORD32 nr_of_sfb, WORD32 ccfl) {
  182|   142k|  WORD32 i, j, ii;
  183|   142k|  WORD32 index = 0;
  184|   142k|  WORD32 group_offset = 0;
  185|   142k|  WORD32 k = 0;
  186|   142k|  WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   46|   142k|#define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   54|   142k|#define FRAME_LEN_LONG 1024
  |  |  ------------------
  |  |               #define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   44|   142k|#define TRANS_FAC 8
  |  |  ------------------
  ------------------
                WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   54|   142k|#define FRAME_LEN_LONG 1024
  ------------------
  187|       |
  188|   142k|  sfb_offset[k] = 0;
  189|  2.10M|  for (k = 1; k < nr_of_sfb + 1; k++) {
  ------------------
  |  Branch (189:15): [True: 1.96M, False: 142k]
  ------------------
  190|  1.96M|    sfb_offset[k] = sfb_offset[k - 1] + sfb_width_table[k - 1];
  191|  1.96M|  }
  192|       |
  193|   142k|  index = 0;
  194|   142k|  group_offset = 0;
  195|   690k|  for (i = 0; i < num_window_groups; i++) {
  ------------------
  |  Branch (195:15): [True: 547k, False: 142k]
  ------------------
  196|  8.10M|    for (k = 0; k < nr_of_sfb; k++) {
  ------------------
  |  Branch (196:17): [True: 7.55M, False: 547k]
  ------------------
  197|  23.2M|      for (j = 0; j < window_group_length[i]; j++) {
  ------------------
  |  Branch (197:19): [True: 15.6M, False: 7.55M]
  ------------------
  198|   148M|        for (ii = 0; ii < sfb_width_table[k]; ii++) {
  ------------------
  |  Branch (198:22): [True: 133M, False: 15.6M]
  ------------------
  199|   133M|          ptr_scratch[index++] =
  200|   133M|              ptr_spec[ii + sfb_offset[k] + frame_len_short * j + group_offset];
  201|   133M|        }
  202|  15.6M|      }
  203|  7.55M|    }
  204|   547k|    group_offset += frame_len_short * window_group_length[i];
  205|   547k|  }
  206|       |
  207|   142k|  memcpy(ptr_spec, ptr_scratch, ccfl * sizeof(ptr_spec[0]));
  208|       |
  209|   142k|  index = 0;
  210|   142k|  sfb_offset[index++] = 0;
  211|   690k|  for (i = 0; i < num_window_groups; i++) {
  ------------------
  |  Branch (211:15): [True: 547k, False: 142k]
  ------------------
  212|  8.10M|    for (k = 0; k < nr_of_sfb; k++) {
  ------------------
  |  Branch (212:17): [True: 7.55M, False: 547k]
  ------------------
  213|  7.55M|      sfb_offset[index] = sfb_offset[index - 1] + sfb_width_table[k] * window_group_length[i];
  214|  7.55M|      index++;
  215|  7.55M|    }
  216|   547k|  }
  217|       |
  218|   142k|  return;
  219|   142k|}
ixheaace_fd_quant.c:iusace_count_static_bits:
   77|   239k|                                       WORD32 chn, WORD32 usac_independency_flag, WORD32 ele_id) {
   78|   239k|  WORD32 ms_mask = ptr_usac_data->str_ms_info[chn].ms_mask;
   79|   239k|  WORD32 noise_filling = ptr_usac_data->noise_filling[ele_id];
   80|   239k|  WORD32 stat_bits = 0, i;
   81|   239k|  WORD32 tns_active = 0, tns_present_both = 0;
   82|   239k|  WORD32 max_sfb = pstr_psy_out[chn].max_sfb_per_grp;
   83|   239k|  (VOID) ptr_usac_config;
   84|       |
   85|   239k|  if (channels == 1) {
  ------------------
  |  Branch (85:7): [True: 51.3k, False: 188k]
  ------------------
   86|  51.3k|    stat_bits += 1;  // core mode
   87|  51.3k|    stat_bits += 1;  // tns active
   88|       |
   89|  51.3k|    switch (pstr_psy_out[chn].window_sequence) {
  ------------------
  |  Branch (89:13): [True: 51.2k, False: 94]
  ------------------
   90|  27.6k|      case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|  27.6k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (90:7): [True: 27.6k, False: 23.7k]
  ------------------
   91|  33.3k|      case LONG_START_SEQUENCE:
  ------------------
  |  |   46|  33.3k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (91:7): [True: 5.76k, False: 45.5k]
  ------------------
   92|  37.9k|      case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|  37.9k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (92:7): [True: 4.53k, False: 46.7k]
  ------------------
   93|  37.9k|        stat_bits += SI_ICS_INFO_BITS_LONG;
   94|  37.9k|        break;
   95|  13.3k|      case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|  13.3k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (95:7): [True: 13.3k, False: 38.0k]
  ------------------
   96|  13.3k|        stat_bits += SI_ICS_INFO_BITS_SHORT;
   97|  13.3k|        break;
   98|  51.3k|    }
   99|   188k|  } else {
  100|   188k|    stat_bits += 2;  // core mode
  101|   188k|    stat_bits += 2;  // tns and common window
  102|       |
  103|   188k|    switch (pstr_psy_out[chn].window_sequence) {
  ------------------
  |  Branch (103:13): [True: 188k, False: 59]
  ------------------
  104|  84.4k|      case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|  84.4k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (104:7): [True: 84.4k, False: 103k]
  ------------------
  105|   105k|      case LONG_START_SEQUENCE:
  ------------------
  |  |   46|   105k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (105:7): [True: 20.6k, False: 167k]
  ------------------
  106|   123k|      case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|   123k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (106:7): [True: 18.6k, False: 169k]
  ------------------
  107|   123k|        stat_bits += SI_ICS_INFO_BITS_LONG;
  108|   123k|        break;
  109|  64.4k|      case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|  64.4k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (109:7): [True: 64.4k, False: 123k]
  ------------------
  110|  64.4k|        stat_bits += SI_ICS_INFO_BITS_SHORT;
  111|  64.4k|        break;
  112|   188k|    }
  113|       |
  114|   188k|    stat_bits += 1;  // common_max_sfb
  115|   188k|    stat_bits += SI_CPE_MS_MASK_BITS;
  116|       |
  117|   188k|    if (ms_mask != 3) {
  ------------------
  |  Branch (117:9): [True: 171k, False: 16.2k]
  ------------------
  118|   171k|      if (ms_mask == 1) {
  ------------------
  |  Branch (118:11): [True: 25.2k, False: 146k]
  ------------------
  119|  25.2k|        stat_bits += iusace_count_ms_bits(pstr_psy_out[chn].sfb_count,
  120|  25.2k|                                          pstr_psy_out[chn].sfb_per_group, max_sfb);
  121|  25.2k|      }
  122|   171k|    } else {
  123|  16.2k|      stat_bits += iusace_write_cplx_pred_data(
  124|  16.2k|          NULL, pstr_sfb_params->num_window_groups[chn], max_sfb,
  125|  16.2k|          ptr_usac_data->complex_coef[chn], ptr_usac_data->pred_coef_re[chn],
  126|  16.2k|          ptr_usac_data->pred_coef_im[chn], iusace_huffman_code_table, usac_independency_flag,
  127|  16.2k|          ptr_usac_data->pred_dir_idx[chn], ptr_usac_data->cplx_pred_used[chn],
  128|  16.2k|          ptr_usac_data->cplx_pred_all[chn], ptr_usac_data->temp_pred_coef_re_prev[chn],
  129|  16.2k|          ptr_usac_data->temp_pred_coef_im_prev[chn], &ptr_usac_data->delta_code_time[chn]);
  130|  16.2k|    }
  131|       |
  132|   188k|    if (ptr_usac_data->pstr_tns_info[chn] != NULL &&
  ------------------
  |  Branch (132:9): [True: 96.9k, False: 91.2k]
  ------------------
  133|  96.9k|        ptr_usac_data->pstr_tns_info[chn + 1] != NULL) {
  ------------------
  |  Branch (133:9): [True: 96.9k, False: 0]
  ------------------
  134|  96.9k|      tns_active = ptr_usac_data->pstr_tns_info[chn]->tns_data_present ||
  ------------------
  |  Branch (134:20): [True: 54.3k, False: 42.5k]
  ------------------
  135|  42.5k|                   ptr_usac_data->pstr_tns_info[chn + 1]->tns_data_present;
  ------------------
  |  Branch (135:20): [True: 3.38k, False: 39.1k]
  ------------------
  136|  96.9k|      tns_present_both = ptr_usac_data->pstr_tns_info[chn]->tns_data_present &&
  ------------------
  |  Branch (136:26): [True: 54.3k, False: 42.5k]
  ------------------
  137|  54.3k|                         ptr_usac_data->pstr_tns_info[chn + 1]->tns_data_present;
  ------------------
  |  Branch (137:26): [True: 45.8k, False: 8.58k]
  ------------------
  138|  96.9k|    }
  139|   188k|    if (tns_active) {
  ------------------
  |  Branch (139:9): [True: 57.7k, False: 130k]
  ------------------
  140|  57.7k|      stat_bits += 1;  // common_tns
  141|       |
  142|  57.7k|      stat_bits += 1;  // tns_present_both
  143|       |
  144|  57.7k|      if (!tns_present_both) {
  ------------------
  |  Branch (144:11): [True: 11.9k, False: 45.8k]
  ------------------
  145|  11.9k|        stat_bits += 1;  // tns_data_present1
  146|  11.9k|      }
  147|  57.7k|    }
  148|   188k|  }
  149|       |
  150|   667k|  for (i = chn; i < chn + channels; i++) {
  ------------------
  |  Branch (150:17): [True: 427k, False: 239k]
  ------------------
  151|   427k|    stat_bits += 8;  // global_gain
  152|       |
  153|   427k|    if (noise_filling) {
  ------------------
  |  Branch (153:9): [True: 215k, False: 212k]
  ------------------
  154|   215k|      stat_bits += 8;
  155|   215k|    }
  156|   427k|  }
  157|       |
  158|   667k|  for (i = chn; i < chn + channels; i++) {
  ------------------
  |  Branch (158:17): [True: 427k, False: 239k]
  ------------------
  159|   427k|    if (ptr_usac_data->pstr_tns_info[i] != NULL &&
  ------------------
  |  Branch (159:9): [True: 209k, False: 218k]
  ------------------
  160|   209k|        ptr_usac_data->pstr_tns_info[i]->tns_data_present == 1) {
  ------------------
  |  Branch (160:9): [True: 111k, False: 97.1k]
  ------------------
  161|   111k|      stat_bits += iusace_write_tns_data(NULL, ptr_usac_data->pstr_tns_info[i],
  162|   111k|                                         pstr_psy_out[i].window_sequence, 0);
  163|   111k|    }
  164|       |
  165|   427k|    if (!usac_independency_flag) {
  ------------------
  |  Branch (165:9): [True: 407k, False: 20.5k]
  ------------------
  166|   407k|      stat_bits += 1;  // arith_reset_flag
  167|   407k|    }
  168|       |
  169|   427k|    stat_bits += 1;  // fac_data_present
  170|   427k|    stat_bits += ptr_usac_data->str_scratch.ptr_num_fac_bits[i];
  171|   427k|  }
  172|       |
  173|   239k|  stat_bits += (ptr_usac_data->num_sbr_bits + ptr_usac_data->num_drc_bits);
  174|       |
  175|   239k|  return stat_bits;
  176|   239k|}
ixheaace_fd_quant.c:iusace_count_ms_bits:
   63|  25.2k|static WORD32 iusace_count_ms_bits(WORD32 sfb_count, WORD32 sfb_per_grp, WORD32 max_sfb_per_grp) {
   64|  25.2k|  WORD32 ms_bits = 0, sfb_offs, sfb;
   65|  87.8k|  for (sfb_offs = 0; sfb_offs < sfb_count; sfb_offs += sfb_per_grp) {
  ------------------
  |  Branch (65:22): [True: 62.6k, False: 25.2k]
  ------------------
   66|  1.29M|    for (sfb = 0; sfb < max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (66:19): [True: 1.22M, False: 62.6k]
  ------------------
   67|  1.22M|      ms_bits++;
   68|  1.22M|    }
   69|  62.6k|  }
   70|  25.2k|  return (ms_bits);
   71|  25.2k|}
ixheaace_fd_quant.c:iusace_degroup_int:
  225|   221k|{
  226|   221k|  WORD32 i, j, k, n;
  227|   221k|  WORD32 index, group_offset;
  228|   221k|  WORD32 loop1, loop2;
  229|   221k|  WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   46|   221k|#define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   54|   221k|#define FRAME_LEN_LONG 1024
  |  |  ------------------
  |  |               #define FRAME_LEN_SHORT_128 (FRAME_LEN_LONG / TRANS_FAC)
  |  |  ------------------
  |  |  |  |   44|   221k|#define TRANS_FAC 8
  |  |  ------------------
  ------------------
                WORD32 frame_len_short = (ccfl * FRAME_LEN_SHORT_128) / FRAME_LEN_LONG;
  ------------------
  |  |   54|   221k|#define FRAME_LEN_LONG 1024
  ------------------
  230|   221k|  index = 0;
  231|   221k|  group_offset = 0;
  232|       |
  233|   221k|  memset(ptr_scratch, 0, ccfl * sizeof(WORD32));
  234|       |
  235|  1.07M|  for (i = 0; i < num_window_groups; i++) {
  ------------------
  |  Branch (235:15): [True: 851k, False: 221k]
  ------------------
  236|  12.0M|    for (j = 0; j < sfb_per_group; j++) {
  ------------------
  |  Branch (236:17): [True: 11.1M, False: 851k]
  ------------------
  237|  11.1M|      WORD32 idx = i * sfb_per_group + j;
  238|  11.1M|      loop1 = ((ptr_grouped_sfb_offsets[idx + 1] - ptr_grouped_sfb_offsets[idx]) /
  239|  11.1M|               window_group_length[i]);
  240|       |
  241|  34.4M|      for (k = 0; k < window_group_length[i]; k++) {
  ------------------
  |  Branch (241:19): [True: 23.2M, False: 11.1M]
  ------------------
  242|  23.2M|        loop2 = ((ptr_grouped_sfb_offsets[idx] - group_offset) / window_group_length[i]) +
  243|  23.2M|                frame_len_short * k + group_offset;
  244|       |
  245|   216M|        for (n = 0; n < loop1; n++) {
  ------------------
  |  Branch (245:21): [True: 193M, False: 23.2M]
  ------------------
  246|   193M|          ptr_scratch[n + loop2] = ptr_spec[index++];
  247|   193M|        }
  248|  23.2M|      }
  249|  11.1M|    }
  250|   851k|    group_offset += frame_len_short * window_group_length[i];
  251|   851k|  }
  252|       |
  253|   221k|  memcpy(ptr_spec, ptr_scratch, ccfl * sizeof(WORD32));
  254|       |
  255|   221k|  return;
  256|   221k|}

ia_enhaacplus_enc_transform_real:
  228|  67.6k|                                      WORD32 long_frame_len) {
  229|  67.6k|  WORD32 n, n1;
  230|  67.6k|  FLOAT32 *ptr_windowed_buf = ptr_shared_buffer1;
  231|  67.6k|  const FLOAT32 *ptr_ws1;
  232|  67.6k|  WORD32 i, len = long_frame_len;
  233|  67.6k|  FLOAT32 *ptr_real_in;
  234|  67.6k|  FLOAT32 *ptr_data1, *ptr_data2, *ptr_data3, *ptr_data4;
  235|  67.6k|  FLOAT32 *ptr_op1;
  236|       |
  237|  67.6k|  ptr_real_in = ptr_mdct_delay_buffer;
  238|       |
  239|  67.6k|  n = long_frame_len << 1;
  240|  67.6k|  n1 = long_frame_len >> 1;
  241|       |
  242|  67.6k|  ptr_ws1 =
  243|  67.6k|      (long_frame_len == FRAME_LEN_512) ? pstr_mdct_tab->win_512_ld : pstr_mdct_tab->win_480_ld;
  ------------------
  |  |   92|  67.6k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (243:7): [True: 0, False: 67.6k]
  ------------------
  244|       |
  245|  67.6k|  ptr_op1 = ptr_real_out;
  246|  67.6k|  ptr_data1 = &ptr_real_in[n1];
  247|  67.6k|  ptr_data2 = &ptr_real_in[n + n1];
  248|  67.6k|  ptr_data3 = &ptr_real_in[n1 - 1];
  249|  67.6k|  ptr_data4 = &ptr_real_in[n + n1 - 1];
  250|       |
  251|  67.6k|  ia_enhaacplus_enc_tranform_mac4(ptr_op1, ptr_ws1, ptr_data1, ptr_data2, ptr_data3, ptr_data4,
  252|  67.6k|                                  n1, 1);
  253|  67.6k|  ptr_ws1 += ((SIZE_T)n1 << 2);
  254|       |
  255|  65.0M|  for (i = 0; i < long_frame_len << 1; i++) {
  ------------------
  |  Branch (255:15): [True: 64.9M, False: 67.6k]
  ------------------
  256|  64.9M|    ptr_mdct_delay_buffer[i] = ptr_mdct_delay_buffer[long_frame_len + i];
  257|  64.9M|  }
  258|  67.6k|  ia_enhaacplus_enc_shift_mdct_delay_buffer(&ptr_mdct_delay_buffer[2 * long_frame_len],
  259|  67.6k|                                            ptr_time_signal, ch_increment, long_frame_len);
  260|       |
  261|  67.6k|  ptr_op1 = &ptr_real_out[long_frame_len - 1];
  262|  67.6k|  ptr_data1 = &ptr_real_in[n + len - n1];
  263|  67.6k|  ptr_data2 = &ptr_real_in[len - n1];
  264|  67.6k|  ptr_data3 = &ptr_real_in[len - n1 - 1];
  265|  67.6k|  ptr_data4 = &ptr_real_in[n + len - n1 - 1];
  266|       |
  267|  67.6k|  ia_enhaacplus_enc_tranform_mac4(ptr_op1, ptr_ws1, ptr_data1, ptr_data2, ptr_data3, ptr_data4,
  268|  67.6k|                                  (n1 >> 1), -1);
  269|  67.6k|  ptr_op1 -= (n1 >> 1);
  270|  67.6k|  ptr_ws1 += ((SIZE_T)n1 << 1);
  271|  67.6k|  ptr_data2 += (n1 >> 1);
  272|  67.6k|  ptr_data3 -= (n1 >> 1);
  273|  67.6k|  ptr_data4 -= (n1 >> 1);
  274|  67.6k|  ia_enhaacplus_enc_tranform_mac3(ptr_op1, ptr_ws1, ptr_data2, ptr_data3, ptr_data4, (n1 >> 1),
  275|  67.6k|                                  -1);
  276|       |
  277|  67.6k|  if (long_frame_len == FRAME_LEN_480) {
  ------------------
  |  |   93|  67.6k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (277:7): [True: 67.6k, False: 0]
  ------------------
  278|  67.6k|    ia_aac_ld_enc_mdct_480(ptr_real_out, ptr_windowed_buf, 1, pstr_mdct_tab);
  279|  67.6k|  } else {
  280|      0|    ia_eaacp_enc_inverse_transform_512(ptr_real_out, ptr_windowed_buf,
  281|      0|                                       pstr_mdct_tab->cosine_array_1024, ptr_shared_buffer5);
  282|      0|  }
  283|  67.6k|}
ia_enhaacplus_enc_post_twiddle:
  318|  67.6k|                                    const FLOAT32 *ptr_cos_sin_tbl, WORD m) {
  319|  67.6k|  WORD i;
  320|  67.6k|  FLOAT32 c, c1, s, s1;
  321|  67.6k|  FLOAT32 tmp_var;
  322|  67.6k|  FLOAT32 tempr, tempr1, tempi, tempi1;
  323|  67.6k|  FLOAT32 *ptr_out1 = ptr_out + m - 1;
  324|  67.6k|  FLOAT32 *ptr_x1 = ptr_x + m - 1;
  325|       |
  326|  8.19M|  for (i = 0; i < (m >> 2); i++) {
  ------------------
  |  Branch (326:15): [True: 8.12M, False: 67.6k]
  ------------------
  327|  8.12M|    c = *ptr_cos_sin_tbl++;
  328|  8.12M|    s = *ptr_cos_sin_tbl++;
  329|  8.12M|    s1 = *ptr_cos_sin_tbl++;
  330|  8.12M|    c1 = *ptr_cos_sin_tbl++;
  331|  8.12M|    tempr = *ptr_x++;
  332|  8.12M|    tempi = *ptr_x++;
  333|  8.12M|    tempi1 = *ptr_x1--;
  334|  8.12M|    tempr1 = *ptr_x1--;
  335|       |
  336|  8.12M|    tmp_var = ((tempr * c) + (tempi * s));
  337|  8.12M|    *ptr_out++ = tmp_var;
  338|       |
  339|  8.12M|    tmp_var = ((tempr * s) - (tempi * c));
  340|  8.12M|    *ptr_out1-- = tmp_var;
  341|       |
  342|  8.12M|    tmp_var = ((tempr1 * c1) + (tempi1 * s1));
  343|  8.12M|    *ptr_out1-- = tmp_var;
  344|       |
  345|  8.12M|    tmp_var = ((tempr1 * s1) - (tempi1 * c1));
  346|  8.12M|    *ptr_out++ = tmp_var;
  347|  8.12M|  }
  348|  67.6k|}
ia_eaacp_enc_pre_twiddle_aac:
  351|  67.6k|                                  const FLOAT32 *ptr_cos_array) {
  352|  67.6k|  WORD n_by_4;
  353|  67.6k|  FLOAT32 *ptr_in1, *ptr_in2;
  354|       |
  355|  67.6k|  n_by_4 = n >> 2;
  356|       |
  357|  67.6k|  ptr_in1 = ptr_data;
  358|  67.6k|  ptr_in2 = ptr_data + n - 1;
  359|       |
  360|  67.6k|  ia_eaacp_enc_pre_twiddle_compute(ptr_in1, ptr_in2, ptr_x, ptr_cos_array, n_by_4);
  361|  67.6k|}
ia_enhaacplus_enc_complex_fft_p2:
  417|  16.5M|                                      FLOAT32 *ptr_scratch_fft_p2_y) {
  418|  16.5M|  WORD32 i, j, k, n_stages, h2;
  419|  16.5M|  FLOAT32 x0_r, x0_i, x1_r, x1_i, x2_r, x2_i, x3_r, x3_i;
  420|  16.5M|  WORD32 del, nodespacing, in_loop_cnt;
  421|  16.5M|  WORD32 not_power_4;
  422|  16.5M|  WORD32 dig_rev_shift;
  423|  16.5M|  FLOAT32 *ptr_p2_y = ptr_scratch_fft_p2_y;
  424|  16.5M|  WORD32 mpass = nlength;
  425|  16.5M|  WORD32 npoints = nlength;
  426|  16.5M|  FLOAT32 *ptr_y = ptr_p2_y;
  427|  16.5M|  const FLOAT64 *ptr_w;
  428|  16.5M|  FLOAT32 *ptr_inp;
  429|  16.5M|  FLOAT32 tmk;
  430|  16.5M|  const FLOAT64 *ptr_twiddles;
  431|  16.5M|  FLOAT32 *ptr_data;
  432|  16.5M|  FLOAT64 w_1, w_2, w_3, w_4, w_5, w_6;
  433|  16.5M|  WORD32 sec_loop_cnt;
  434|  16.5M|  FLOAT32 tmp;
  435|       |
  436|  16.5M|  memset(ptr_y, 0, nlength * 2 * sizeof(*ptr_y));
  437|       |
  438|  16.5M|  dig_rev_shift = ia_enhaacplus_enc_calc_norm(mpass) + 1 - 16;
  439|  16.5M|  n_stages = 30 - ia_enhaacplus_enc_calc_norm(mpass);
  440|  16.5M|  not_power_4 = n_stages & 1;
  441|       |
  442|  16.5M|  n_stages = n_stages >> 1;
  443|       |
  444|  16.5M|  ptr_w = ia_enhaacplus_enc_twiddle_table_fft_32x32;
  445|       |
  446|  16.5M|  dig_rev_shift = MAX(dig_rev_shift, 0);
  ------------------
  |  |   24|  16.5M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 16.5M, False: 0]
  |  |  ------------------
  ------------------
  447|       |
  448|   172M|  for (i = 0; i < npoints; i += 4) {
  ------------------
  |  Branch (448:15): [True: 155M, False: 16.5M]
  ------------------
  449|   155M|    ptr_inp = ptr_x;
  450|   155M|    DIG_REV_NEW(i, dig_rev_shift, h2);
  ------------------
  |  |   40|   155M|  do {                                                      \
  |  |   41|   155M|    unsigned _ = (i);                                       \
  |  |   42|   155M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   43|   155M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   44|   155M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   45|   155M|    (j) = _ >> (m);                                         \
  |  |   46|   155M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (46:12): [Folded, False: 155M]
  |  |  ------------------
  ------------------
  451|   155M|    if (not_power_4) {
  ------------------
  |  Branch (451:9): [True: 144M, False: 11.5M]
  ------------------
  452|   144M|      h2 += 1;
  453|   144M|      h2 &= ~1;
  454|   144M|    }
  455|   155M|    ptr_inp += (h2);
  456|       |
  457|   155M|    x0_r = *ptr_inp;
  458|   155M|    x0_i = *(ptr_inp + 1);
  459|   155M|    ptr_inp += (npoints >> 1);
  460|       |
  461|   155M|    x1_r = *ptr_inp;
  462|   155M|    x1_i = *(ptr_inp + 1);
  463|   155M|    ptr_inp += (npoints >> 1);
  464|       |
  465|   155M|    x2_r = *ptr_inp;
  466|   155M|    x2_i = *(ptr_inp + 1);
  467|   155M|    ptr_inp += (npoints >> 1);
  468|       |
  469|   155M|    x3_r = *ptr_inp;
  470|   155M|    x3_i = *(ptr_inp + 1);
  471|       |
  472|   155M|    x0_r = x0_r + x2_r;
  473|   155M|    x0_i = x0_i + x2_i;
  474|       |
  475|   155M|    tmk = x0_r - x2_r;
  476|   155M|    x2_r = tmk - x2_r;
  477|   155M|    tmk = x0_i - x2_i;
  478|   155M|    x2_i = tmk - x2_i;
  479|       |
  480|   155M|    x1_r = x1_r + x3_r;
  481|   155M|    x1_i = x1_i + x3_i;
  482|       |
  483|   155M|    tmk = x1_r - x3_r;
  484|   155M|    x3_r = tmk - x3_r;
  485|   155M|    tmk = x1_i - x3_i;
  486|   155M|    x3_i = tmk - x3_i;
  487|       |
  488|   155M|    x0_r = x0_r + x1_r;
  489|   155M|    x0_i = x0_i + x1_i;
  490|       |
  491|   155M|    tmk = x0_r - x1_r;
  492|   155M|    x1_r = tmk - x1_r;
  493|   155M|    tmk = x0_i - x1_i;
  494|   155M|    x1_i = tmk - x1_i;
  495|       |
  496|   155M|    x2_r = x2_r + x3_i;
  497|   155M|    x2_i = x2_i - x3_r;
  498|       |
  499|   155M|    tmk = x2_r - x3_i;
  500|   155M|    x3_i = tmk - x3_i;
  501|   155M|    tmk = x2_i + x3_r;
  502|   155M|    x3_r = tmk + x3_r;
  503|       |
  504|   155M|    *ptr_y++ = x0_r;
  505|   155M|    *ptr_y++ = x0_i;
  506|   155M|    *ptr_y++ = x2_r;
  507|   155M|    *ptr_y++ = x2_i;
  508|   155M|    *ptr_y++ = x1_r;
  509|   155M|    *ptr_y++ = x1_i;
  510|   155M|    *ptr_y++ = x3_i;
  511|   155M|    *ptr_y++ = x3_r;
  512|   155M|  }
  513|  16.5M|  ptr_y -= 2 * npoints;
  514|  16.5M|  del = 4;
  515|  16.5M|  nodespacing = 64;
  516|  16.5M|  in_loop_cnt = npoints >> 4;
  517|  33.8M|  for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (517:26): [True: 17.3M, False: 16.5M]
  ------------------
  518|  17.3M|    ptr_twiddles = ptr_w;
  519|  17.3M|    ptr_data = ptr_y;
  520|  58.4M|    for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (520:27): [True: 41.1M, False: 17.3M]
  ------------------
  521|  41.1M|      x0_r = (*ptr_data);
  522|  41.1M|      x0_i = (*(ptr_data + 1));
  523|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  524|       |
  525|  41.1M|      x1_r = (*ptr_data);
  526|  41.1M|      x1_i = (*(ptr_data + 1));
  527|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  528|       |
  529|  41.1M|      x2_r = (*ptr_data);
  530|  41.1M|      x2_i = (*(ptr_data + 1));
  531|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  532|       |
  533|  41.1M|      x3_r = (*ptr_data);
  534|  41.1M|      x3_i = (*(ptr_data + 1));
  535|  41.1M|      ptr_data -= 3 * (del << 1);
  536|       |
  537|  41.1M|      x0_r = x0_r + x2_r;
  538|  41.1M|      x0_i = x0_i + x2_i;
  539|  41.1M|      x2_r = x0_r - (x2_r * 2);
  540|  41.1M|      x2_i = x0_i - (x2_i * 2);
  541|  41.1M|      x1_r = x1_r + x3_r;
  542|  41.1M|      x1_i = x1_i + x3_i;
  543|  41.1M|      x3_r = x1_r - (x3_r * 2);
  544|  41.1M|      x3_i = x1_i - (x3_i * 2);
  545|       |
  546|  41.1M|      x0_r = x0_r + x1_r;
  547|  41.1M|      x0_i = x0_i + x1_i;
  548|  41.1M|      x1_r = x0_r - (x1_r * 2);
  549|  41.1M|      x1_i = x0_i - (x1_i * 2);
  550|  41.1M|      x2_r = x2_r + x3_i;
  551|  41.1M|      x2_i = x2_i - x3_r;
  552|  41.1M|      x3_i = x2_r - (x3_i * 2);
  553|  41.1M|      x3_r = x2_i + (x3_r * 2);
  554|       |
  555|  41.1M|      *ptr_data = x0_r;
  556|  41.1M|      *(ptr_data + 1) = x0_i;
  557|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  558|       |
  559|  41.1M|      *ptr_data = x2_r;
  560|  41.1M|      *(ptr_data + 1) = x2_i;
  561|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  562|       |
  563|  41.1M|      *ptr_data = x1_r;
  564|  41.1M|      *(ptr_data + 1) = x1_i;
  565|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  566|       |
  567|  41.1M|      *ptr_data = x3_i;
  568|  41.1M|      *(ptr_data + 1) = x3_r;
  569|  41.1M|      ptr_data += ((SIZE_T)del << 1);
  570|  41.1M|    }
  571|  17.3M|    ptr_data = ptr_y + 2;
  572|       |
  573|  17.3M|    sec_loop_cnt = (nodespacing * del);
  574|  17.3M|    sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
  575|  17.3M|                   (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
  576|  17.3M|                   (sec_loop_cnt / 256);
  577|       |
  578|  41.4M|    for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (578:27): [True: 24.0M, False: 17.3M]
  ------------------
  579|  24.0M|      w_1 = *(ptr_twiddles + j);
  580|  24.0M|      w_4 = *(ptr_twiddles + j + 257);
  581|  24.0M|      w_2 = *(ptr_twiddles + ((SIZE_T)j << 1));
  582|  24.0M|      w_5 = *(ptr_twiddles + ((SIZE_T)j << 1) + 257);
  583|  24.0M|      w_3 = *(ptr_twiddles + j + ((SIZE_T)j << 1));
  584|  24.0M|      w_6 = *(ptr_twiddles + j + ((SIZE_T)j << 1) + 257);
  585|       |
  586|  79.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (586:29): [True: 55.2M, False: 24.0M]
  ------------------
  587|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  588|       |
  589|  55.2M|        x1_r = *ptr_data;
  590|  55.2M|        x1_i = *(ptr_data + 1);
  591|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  592|       |
  593|  55.2M|        x2_r = *ptr_data;
  594|  55.2M|        x2_i = *(ptr_data + 1);
  595|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  596|       |
  597|  55.2M|        x3_r = *ptr_data;
  598|  55.2M|        x3_i = *(ptr_data + 1);
  599|  55.2M|        ptr_data -= 3 * (del << 1);
  600|       |
  601|  55.2M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1_r, w_1) - ixheaace_dmult((FLOAT64)x1_i, w_4));
  602|  55.2M|        x1_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1_r, w_4), (FLOAT64)x1_i, w_1);
  603|  55.2M|        x1_r = tmp;
  604|       |
  605|  55.2M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2_r, w_2) - ixheaace_dmult((FLOAT64)x2_i, w_5));
  606|  55.2M|        x2_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x2_r, w_5), (FLOAT64)x2_i, w_2);
  607|  55.2M|        x2_r = tmp;
  608|       |
  609|  55.2M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x3_r, w_3) - ixheaace_dmult((FLOAT64)x3_i, w_6));
  610|  55.2M|        x3_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x3_r, w_6), (FLOAT64)x3_i, w_3);
  611|  55.2M|        x3_r = tmp;
  612|       |
  613|  55.2M|        x0_r = (*ptr_data);
  614|  55.2M|        x0_i = (*(ptr_data + 1));
  615|       |
  616|  55.2M|        x0_r = x0_r + (x2_r);
  617|  55.2M|        x0_i = x0_i + (x2_i);
  618|  55.2M|        x2_r = x0_r - (x2_r * 2);
  619|  55.2M|        x2_i = x0_i - (x2_i * 2);
  620|  55.2M|        x1_r = x1_r + x3_r;
  621|  55.2M|        x1_i = x1_i + x3_i;
  622|  55.2M|        x3_r = x1_r - (x3_r * 2);
  623|  55.2M|        x3_i = x1_i - (x3_i * 2);
  624|       |
  625|  55.2M|        x0_r = x0_r + (x1_r);
  626|  55.2M|        x0_i = x0_i + (x1_i);
  627|  55.2M|        x1_r = x0_r - (x1_r * 2);
  628|  55.2M|        x1_i = x0_i - (x1_i * 2);
  629|  55.2M|        x2_r = x2_r + (x3_i);
  630|  55.2M|        x2_i = x2_i - (x3_r);
  631|  55.2M|        x3_i = x2_r - (x3_i * 2);
  632|  55.2M|        x3_r = x2_i + (x3_r * 2);
  633|       |
  634|  55.2M|        *ptr_data = x0_r;
  635|  55.2M|        *(ptr_data + 1) = x0_i;
  636|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  637|       |
  638|  55.2M|        *ptr_data = x2_r;
  639|  55.2M|        *(ptr_data + 1) = x2_i;
  640|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  641|       |
  642|  55.2M|        *ptr_data = x1_r;
  643|  55.2M|        *(ptr_data + 1) = x1_i;
  644|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  645|       |
  646|  55.2M|        *ptr_data = x3_i;
  647|  55.2M|        *(ptr_data + 1) = x3_r;
  648|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  649|  55.2M|      }
  650|  24.0M|      ptr_data -= 2 * npoints;
  651|  24.0M|      ptr_data += 2;
  652|  24.0M|    }
  653|  38.0M|    for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (653:12): [True: 20.7M, False: 17.3M]
  ------------------
  654|  20.7M|      w_1 = *(ptr_twiddles + j);
  655|  20.7M|      w_4 = *(ptr_twiddles + j + 257);
  656|  20.7M|      w_2 = *(ptr_twiddles + ((SIZE_T)j << 1));
  657|  20.7M|      w_5 = *(ptr_twiddles + ((SIZE_T)j << 1) + 257);
  658|  20.7M|      w_3 = *(ptr_twiddles + j + ((SIZE_T)j << 1) - 256);
  659|  20.7M|      w_6 = *(ptr_twiddles + j + ((SIZE_T)j << 1) + 1);
  660|       |
  661|  68.8M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (661:29): [True: 48.1M, False: 20.7M]
  ------------------
  662|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  663|       |
  664|  48.1M|        x1_r = *ptr_data;
  665|  48.1M|        x1_i = *(ptr_data + 1);
  666|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  667|       |
  668|  48.1M|        x2_r = *ptr_data;
  669|  48.1M|        x2_i = *(ptr_data + 1);
  670|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  671|       |
  672|  48.1M|        x3_r = *ptr_data;
  673|  48.1M|        x3_i = *(ptr_data + 1);
  674|  48.1M|        ptr_data -= 3 * (del << 1);
  675|       |
  676|  48.1M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1_r, w_1) - ixheaace_dmult((FLOAT64)x1_i, w_4));
  677|  48.1M|        x1_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1_r, w_4), (FLOAT64)x1_i, w_1);
  678|  48.1M|        x1_r = tmp;
  679|       |
  680|  48.1M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2_r, w_2) - ixheaace_dmult((FLOAT64)x2_i, w_5));
  681|  48.1M|        x2_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x2_r, w_5), (FLOAT64)x2_i, w_2);
  682|  48.1M|        x2_r = tmp;
  683|       |
  684|  48.1M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x3_r, w_6) + ixheaace_dmult((FLOAT64)x3_i, w_3));
  685|  48.1M|        x3_i =
  686|  48.1M|            (FLOAT32)(-ixheaace_dmult((FLOAT64)x3_r, w_3) + ixheaace_dmult((FLOAT64)x3_i, w_6));
  687|  48.1M|        x3_r = tmp;
  688|       |
  689|  48.1M|        x0_r = (*ptr_data);
  690|  48.1M|        x0_i = (*(ptr_data + 1));
  691|       |
  692|  48.1M|        x0_r = x0_r + (x2_r);
  693|  48.1M|        x0_i = x0_i + (x2_i);
  694|  48.1M|        x2_r = x0_r - (x2_r * 2);
  695|  48.1M|        x2_i = x0_i - (x2_i * 2);
  696|  48.1M|        x1_r = x1_r + x3_r;
  697|  48.1M|        x1_i = x1_i + x3_i;
  698|  48.1M|        x3_r = x1_r - (x3_r * 2);
  699|  48.1M|        x3_i = x1_i - (x3_i * 2);
  700|       |
  701|  48.1M|        x0_r = x0_r + (x1_r);
  702|  48.1M|        x0_i = x0_i + (x1_i);
  703|  48.1M|        x1_r = x0_r - (x1_r * 2);
  704|  48.1M|        x1_i = x0_i - (x1_i * 2);
  705|  48.1M|        x2_r = x2_r + (x3_i);
  706|  48.1M|        x2_i = x2_i - (x3_r);
  707|  48.1M|        x3_i = x2_r - (x3_i * 2);
  708|  48.1M|        x3_r = x2_i + (x3_r * 2);
  709|       |
  710|  48.1M|        *ptr_data = x0_r;
  711|  48.1M|        *(ptr_data + 1) = x0_i;
  712|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  713|       |
  714|  48.1M|        *ptr_data = x2_r;
  715|  48.1M|        *(ptr_data + 1) = x2_i;
  716|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  717|       |
  718|  48.1M|        *ptr_data = x1_r;
  719|  48.1M|        *(ptr_data + 1) = x1_i;
  720|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  721|       |
  722|  48.1M|        *ptr_data = x3_i;
  723|  48.1M|        *(ptr_data + 1) = x3_r;
  724|  48.1M|        ptr_data += ((SIZE_T)del << 1);
  725|  48.1M|      }
  726|  20.7M|      ptr_data -= 2 * npoints;
  727|  20.7M|      ptr_data += 2;
  728|  20.7M|    }
  729|  20.7M|    for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (729:12): [True: 3.37M, False: 17.3M]
  ------------------
  730|  3.37M|      w_1 = *(ptr_twiddles + j);
  731|  3.37M|      w_4 = *(ptr_twiddles + j + 257);
  732|  3.37M|      w_2 = *(ptr_twiddles + (SIZE_T)((j << 1) - 256));
  733|  3.37M|      w_5 = *(ptr_twiddles + (SIZE_T)((j << 1) + 1));
  734|  3.37M|      w_3 = *(ptr_twiddles + (SIZE_T)(j + (j << 1) - 256));
  735|  3.37M|      w_6 = *(ptr_twiddles + (SIZE_T)(j + (j << 1) + 1));
  736|       |
  737|  10.4M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (737:29): [True: 7.05M, False: 3.37M]
  ------------------
  738|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  739|       |
  740|  7.05M|        x1_r = *ptr_data;
  741|  7.05M|        x1_i = *(ptr_data + 1);
  742|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  743|       |
  744|  7.05M|        x2_r = *ptr_data;
  745|  7.05M|        x2_i = *(ptr_data + 1);
  746|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  747|       |
  748|  7.05M|        x3_r = *ptr_data;
  749|  7.05M|        x3_i = *(ptr_data + 1);
  750|  7.05M|        ptr_data -= 3 * (del << 1);
  751|       |
  752|  7.05M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1_r, w_1) - ixheaace_dmult((FLOAT64)x1_i, w_4));
  753|  7.05M|        x1_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult(x1_r, w_4), x1_i, w_1);
  754|  7.05M|        x1_r = tmp;
  755|       |
  756|  7.05M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2_r, w_5) + ixheaace_dmult((FLOAT64)x2_i, w_2));
  757|  7.05M|        x2_i = (FLOAT32)(-ixheaace_dmult(x2_r, w_2) + ixheaace_dmult(x2_i, w_5));
  758|  7.05M|        x2_r = tmp;
  759|       |
  760|  7.05M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x3_r, w_6) + ixheaace_dmult((FLOAT64)x3_i, w_3));
  761|  7.05M|        x3_i =
  762|  7.05M|            (FLOAT32)(-ixheaace_dmult((FLOAT64)x3_r, w_3) + ixheaace_dmult((FLOAT64)x3_i, w_6));
  763|  7.05M|        x3_r = tmp;
  764|       |
  765|  7.05M|        x0_r = (*ptr_data);
  766|  7.05M|        x0_i = (*(ptr_data + 1));
  767|       |
  768|  7.05M|        x0_r = x0_r + (x2_r);
  769|  7.05M|        x0_i = x0_i + (x2_i);
  770|  7.05M|        x2_r = x0_r - (x2_r * 2);
  771|  7.05M|        x2_i = x0_i - (x2_i * 2);
  772|  7.05M|        x1_r = x1_r + x3_r;
  773|  7.05M|        x1_i = x1_i + x3_i;
  774|  7.05M|        x3_r = x1_r - (x3_r * 2);
  775|  7.05M|        x3_i = x1_i - (x3_i * 2);
  776|       |
  777|  7.05M|        x0_r = x0_r + (x1_r);
  778|  7.05M|        x0_i = x0_i + (x1_i);
  779|  7.05M|        x1_r = x0_r - (x1_r * 2);
  780|  7.05M|        x1_i = x0_i - (x1_i * 2);
  781|  7.05M|        x2_r = x2_r + (x3_i);
  782|  7.05M|        x2_i = x2_i - (x3_r);
  783|  7.05M|        x3_i = x2_r - (x3_i * 2);
  784|  7.05M|        x3_r = x2_i + (x3_r * 2);
  785|       |
  786|  7.05M|        *ptr_data = x0_r;
  787|  7.05M|        *(ptr_data + 1) = x0_i;
  788|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  789|       |
  790|  7.05M|        *ptr_data = x2_r;
  791|  7.05M|        *(ptr_data + 1) = x2_i;
  792|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  793|       |
  794|  7.05M|        *ptr_data = x1_r;
  795|  7.05M|        *(ptr_data + 1) = x1_i;
  796|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  797|       |
  798|  7.05M|        *ptr_data = x3_i;
  799|  7.05M|        *(ptr_data + 1) = x3_r;
  800|  7.05M|        ptr_data += ((SIZE_T)del << 1);
  801|  7.05M|      }
  802|  3.37M|      ptr_data -= 2 * npoints;
  803|  3.37M|      ptr_data += 2;
  804|  3.37M|    }
  805|  41.4M|    for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (805:12): [True: 24.0M, False: 17.3M]
  ------------------
  806|  24.0M|      w_1 = *(ptr_twiddles + j);
  807|  24.0M|      w_4 = *(ptr_twiddles + j + 257);
  808|  24.0M|      w_2 = *(ptr_twiddles + (SIZE_T)((j << 1) - 256));
  809|  24.0M|      w_5 = *(ptr_twiddles + (SIZE_T)((j << 1) + 1));
  810|  24.0M|      w_3 = *(ptr_twiddles + (SIZE_T)(j + (j << 1) - 512));
  811|  24.0M|      w_6 = *(ptr_twiddles + (SIZE_T)(j + (j << 1) - 512 + 257));
  812|       |
  813|  79.2M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (813:29): [True: 55.2M, False: 24.0M]
  ------------------
  814|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  815|       |
  816|  55.2M|        x1_r = *ptr_data;
  817|  55.2M|        x1_i = *(ptr_data + 1);
  818|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  819|       |
  820|  55.2M|        x2_r = *ptr_data;
  821|  55.2M|        x2_i = *(ptr_data + 1);
  822|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  823|       |
  824|  55.2M|        x3_r = *ptr_data;
  825|  55.2M|        x3_i = *(ptr_data + 1);
  826|  55.2M|        ptr_data -= 3 * (del << 1);
  827|       |
  828|  55.2M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1_r, w_1) - ixheaace_dmult((FLOAT64)x1_i, w_4));
  829|  55.2M|        x1_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1_r, w_4), (FLOAT64)x1_i, w_1);
  830|  55.2M|        x1_r = tmp;
  831|       |
  832|  55.2M|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x2_r, w_5) + ixheaace_dmult((FLOAT64)x2_i, w_2));
  833|  55.2M|        x2_i =
  834|  55.2M|            (FLOAT32)(-ixheaace_dmult((FLOAT64)x2_r, w_2) + ixheaace_dmult((FLOAT64)x2_i, w_5));
  835|  55.2M|        x2_r = tmp;
  836|       |
  837|  55.2M|        tmp = (FLOAT32)(-ixheaace_dmult((FLOAT64)x3_r, w_3) + ixheaace_dmult((FLOAT64)x3_i, w_6));
  838|  55.2M|        x3_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x3_r, w_6), (FLOAT64)x3_i, w_3);
  839|  55.2M|        x3_r = tmp;
  840|       |
  841|  55.2M|        x0_r = (*ptr_data);
  842|  55.2M|        x0_i = (*(ptr_data + 1));
  843|       |
  844|  55.2M|        x0_r = x0_r + (x2_r);
  845|  55.2M|        x0_i = x0_i + (x2_i);
  846|  55.2M|        x2_r = x0_r - (x2_r * 2);
  847|  55.2M|        x2_i = x0_i - (x2_i * 2);
  848|  55.2M|        x1_r = x1_r + x3_r;
  849|  55.2M|        x1_i = x1_i - x3_i;
  850|  55.2M|        x3_r = x1_r - (x3_r * 2);
  851|  55.2M|        x3_i = x1_i + (x3_i * 2);
  852|       |
  853|  55.2M|        x0_r = x0_r + (x1_r);
  854|  55.2M|        x0_i = x0_i + (x1_i);
  855|  55.2M|        x1_r = x0_r - (x1_r * 2);
  856|  55.2M|        x1_i = x0_i - (x1_i * 2);
  857|  55.2M|        x2_r = x2_r + (x3_i);
  858|  55.2M|        x2_i = x2_i - (x3_r);
  859|  55.2M|        x3_i = x2_r - (x3_i * 2);
  860|  55.2M|        x3_r = x2_i + (x3_r * 2);
  861|       |
  862|  55.2M|        *ptr_data = x0_r;
  863|  55.2M|        *(ptr_data + 1) = x0_i;
  864|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  865|       |
  866|  55.2M|        *ptr_data = x2_r;
  867|  55.2M|        *(ptr_data + 1) = x2_i;
  868|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  869|       |
  870|  55.2M|        *ptr_data = x1_r;
  871|  55.2M|        *(ptr_data + 1) = x1_i;
  872|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  873|       |
  874|  55.2M|        *ptr_data = x3_i;
  875|  55.2M|        *(ptr_data + 1) = x3_r;
  876|  55.2M|        ptr_data += ((SIZE_T)del << 1);
  877|  55.2M|      }
  878|  24.0M|      ptr_data -= 2 * npoints;
  879|  24.0M|      ptr_data += 2;
  880|  24.0M|    }
  881|  17.3M|    nodespacing >>= 2;
  882|  17.3M|    del <<= 2;
  883|  17.3M|    in_loop_cnt >>= 2;
  884|  17.3M|  }
  885|  16.5M|  if (not_power_4) {
  ------------------
  |  Branch (885:7): [True: 16.0M, False: 460k]
  ------------------
  886|  16.0M|    ptr_twiddles = ptr_w;
  887|  16.0M|    nodespacing <<= 1;
  888|       |
  889|   160M|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (889:23): [True: 144M, False: 16.0M]
  ------------------
  890|   144M|      w_1 = *ptr_twiddles;
  891|   144M|      w_4 = *(ptr_twiddles + 257);
  892|   144M|      ptr_twiddles += nodespacing;
  893|       |
  894|   144M|      x0_r = *ptr_y;
  895|   144M|      x0_i = *(ptr_y + 1);
  896|   144M|      ptr_y += ((SIZE_T)del << 1);
  897|       |
  898|   144M|      x1_r = *ptr_y;
  899|   144M|      x1_i = *(ptr_y + 1);
  900|       |
  901|   144M|      tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1_r, w_1) - ixheaace_dmult((FLOAT64)x1_i, w_4));
  902|   144M|      x1_i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1_r, w_4), (FLOAT64)x1_i, w_1);
  903|   144M|      x1_r = tmp;
  904|       |
  905|   144M|      *ptr_y = (x0_r) - (x1_r);
  906|   144M|      *(ptr_y + 1) = (x0_i) - (x1_i);
  907|   144M|      ptr_y -= ((SIZE_T)del << 1);
  908|       |
  909|   144M|      *ptr_y = (x0_r) + (x1_r);
  910|   144M|      *(ptr_y + 1) = (x0_i) + (x1_i);
  911|   144M|      ptr_y += 2;
  912|   144M|    }
  913|  16.0M|    ptr_twiddles = ptr_w;
  914|   160M|    for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (914:23): [True: 144M, False: 16.0M]
  ------------------
  915|   144M|      w_1 = *ptr_twiddles;
  916|   144M|      w_4 = *(ptr_twiddles + 257);
  917|   144M|      ptr_twiddles += nodespacing;
  918|       |
  919|   144M|      x0_r = *ptr_y;
  920|   144M|      x0_i = *(ptr_y + 1);
  921|   144M|      ptr_y += ((SIZE_T)del << 1);
  922|       |
  923|   144M|      x1_r = *ptr_y;
  924|   144M|      x1_i = *(ptr_y + 1);
  925|       |
  926|   144M|      tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1_r, w_4) +
  927|   144M|                      ixheaace_dmult((FLOAT64)x1_i, w_1)) /*/2*/;
  928|   144M|      x1_i = (FLOAT32)(-ixheaace_dmult((FLOAT64)x1_r, w_1) +
  929|   144M|                       ixheaace_dmult((FLOAT64)x1_i, w_4)) /*/2*/;
  930|   144M|      x1_r = tmp;
  931|       |
  932|   144M|      *ptr_y = (x0_r) - (x1_r);
  933|   144M|      *(ptr_y + 1) = (x0_i) - (x1_i);
  934|   144M|      ptr_y -= ((SIZE_T)del << 1);
  935|       |
  936|   144M|      *ptr_y = (x0_r) + (x1_r);
  937|   144M|      *(ptr_y + 1) = (x0_i) + (x1_i);
  938|   144M|      ptr_y += 2;
  939|   144M|    }
  940|  16.0M|  }
  941|       |
  942|   640M|  for (i = 0; i < nlength; i++) {
  ------------------
  |  Branch (942:15): [True: 623M, False: 16.5M]
  ------------------
  943|   623M|    *(ptr_x + 2 * i) = ptr_p2_y[2 * i];
  944|   623M|    *(ptr_x + 2 * i + 1) = ptr_p2_y[2 * i + 1];
  945|   623M|  }
  946|  16.5M|}
ia_enhaacplus_enc_complex_fft:
 1036|  12.9M|                                   ixheaace_scratch_mem *pstr_scratch) {
 1037|  12.9M|  if (len & (len - 1)) {
  ------------------
  |  Branch (1037:7): [True: 0, False: 12.9M]
  ------------------
 1038|      0|    ia_enhaacplus_enc_complex_fft_p3(ptr_data, len, pstr_scratch);
 1039|  12.9M|  } else {
 1040|  12.9M|    ia_enhaacplus_enc_complex_fft_p2(ptr_data, len, pstr_scratch->p_fft_p2_y);
 1041|  12.9M|  }
 1042|  12.9M|}
ixheaace_transform_real_lc_ld:
 2207|   317k|                                   WORD32 frame_len, WORD8 *ptr_scratch) {
 2208|   317k|  WORD32 i, w;
 2209|   317k|  FLOAT32 ws1, ws2;
 2210|   317k|  FLOAT32 *ptr_dct_in;
 2211|   317k|  WORD32 frame_len_short = FRAME_LEN_SHORT_128;
  ------------------
  |  |   30|   317k|#define FRAME_LEN_SHORT_128 (128)
  ------------------
 2212|   317k|  WORD32 ls_trans = LS_TRANS_128;
  ------------------
  |  |   26|   317k|#define LS_TRANS_128 448  //((long_frame_len - FRAME_LEN_SHORT_128) / 2)
  ------------------
 2213|   317k|  WORD32 trans_offset = TRANSFORM_OFFSET_SHORT_128;
  ------------------
  |  |   99|   317k|#define TRANSFORM_OFFSET_SHORT_128 448
  ------------------
 2214|   317k|  const FLOAT32 *ptr_window;
 2215|   317k|  if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|   317k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2215:7): [True: 116k, False: 201k]
  ------------------
 2216|   116k|    ls_trans = LS_TRANS_120;
  ------------------
  |  |   27|   116k|#define LS_TRANS_120 420
  ------------------
 2217|   116k|    trans_offset = TRANSFORM_OFFSET_SHORT_120;
  ------------------
  |  |  100|   116k|#define TRANSFORM_OFFSET_SHORT_120 420
  ------------------
 2218|   116k|    frame_len_short = FRAME_LEN_SHORT_120;
  ------------------
  |  |   31|   116k|#define FRAME_LEN_SHORT_120 (120)
  ------------------
 2219|   116k|  }
 2220|   317k|  switch (block_type) {
  ------------------
  |  Branch (2220:11): [True: 317k, False: 0]
  ------------------
 2221|   191k|    case LONG_WINDOW:
  ------------------
  |  Branch (2221:5): [True: 191k, False: 125k]
  ------------------
 2222|   191k|      ptr_dct_in = ptr_real_out;
 2223|   191k|      ptr_window = &long_window_KBD[0];
 2224|   191k|      switch (frame_len) {
  ------------------
  |  Branch (2224:15): [True: 191k, False: 0]
  ------------------
 2225|   108k|        case FRAME_LEN_1024:
  ------------------
  |  |   91|   108k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2225:9): [True: 108k, False: 82.5k]
  ------------------
 2226|   108k|          ptr_window = &long_window_KBD[0];
 2227|   108k|          break;
 2228|       |
 2229|  59.6k|        case FRAME_LEN_960:
  ------------------
  |  |   94|  59.6k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2229:9): [True: 59.6k, False: 131k]
  ------------------
 2230|  59.6k|          ptr_window = &long_window_sine_960[0];
 2231|  59.6k|          break;
 2232|       |
 2233|  22.9k|        case FRAME_LEN_512:
  ------------------
  |  |   92|  22.9k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2233:9): [True: 22.9k, False: 168k]
  ------------------
 2234|  22.9k|          ptr_window = &long_window_sine_ld[0];
 2235|  22.9k|          break;
 2236|       |
 2237|      0|        case FRAME_LEN_480:
  ------------------
  |  |   93|      0|#define FRAME_LEN_480 480
  ------------------
  |  Branch (2237:9): [True: 0, False: 191k]
  ------------------
 2238|      0|          ptr_window = &long_window_sine_ld_480[0];
 2239|      0|          break;
 2240|   191k|      }
 2241|  90.4M|      for (i = 0; i < frame_len / 2; i++) {
  ------------------
  |  Branch (2241:19): [True: 90.2M, False: 191k]
  ------------------
 2242|  90.2M|        ws1 = ptr_mdct_delay_buffer[i] * ptr_window[i];
 2243|       |
 2244|  90.2M|        ws2 = ptr_mdct_delay_buffer[(frame_len - i - 1)] * ptr_window[frame_len - i - 1];
 2245|       |
 2246|  90.2M|        ptr_dct_in[frame_len / 2 + i] = ws1 - ws2;
 2247|  90.2M|      }
 2248|       |
 2249|   191k|      ixheaace_shift_mdct_delay_buffer(ptr_mdct_delay_buffer, ptr_time_signal, ch_increment,
 2250|   191k|                                       frame_len);
 2251|       |
 2252|  90.4M|      for (i = 0; i < frame_len / 2; i++) {
  ------------------
  |  Branch (2252:19): [True: 90.2M, False: 191k]
  ------------------
 2253|  90.2M|        ws1 = ptr_mdct_delay_buffer[i] * ptr_window[frame_len - i - 1];
 2254|       |
 2255|  90.2M|        ws2 = ptr_mdct_delay_buffer[(frame_len - i - 1)] * ptr_window[i];
 2256|       |
 2257|  90.2M|        ptr_dct_in[frame_len / 2 - i - 1] = -(ws1 + ws2);
 2258|  90.2M|      }
 2259|   191k|      switch (frame_len) {
  ------------------
  |  Branch (2259:15): [True: 191k, False: 0]
  ------------------
 2260|   108k|        case FRAME_LEN_1024:
  ------------------
  |  |   91|   108k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2260:9): [True: 108k, False: 82.5k]
  ------------------
 2261|   108k|          ixheaace_mdct(ptr_dct_in, fft_twiddle_tab, long_window_sine, frame_len, 10,
 2262|   108k|                        ptr_scratch);
 2263|   108k|          break;
 2264|       |
 2265|  59.6k|        case FRAME_LEN_960:
  ------------------
  |  |   94|  59.6k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2265:9): [True: 59.6k, False: 131k]
  ------------------
 2266|  59.6k|          ixheaace_mdct_960(ptr_dct_in, ptr_scratch);
 2267|  59.6k|          break;
 2268|       |
 2269|  22.9k|        case FRAME_LEN_512:
  ------------------
  |  |   92|  22.9k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2269:9): [True: 22.9k, False: 168k]
  ------------------
 2270|  22.9k|        case FRAME_LEN_480:
  ------------------
  |  |   93|  22.9k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (2270:9): [True: 0, False: 191k]
  ------------------
 2271|  22.9k|          ixheaace_mdct(ptr_dct_in, fft_twiddle_tab, ptr_window, frame_len, 9, ptr_scratch);
 2272|  22.9k|          break;
 2273|   191k|      }
 2274|   191k|      break;
 2275|       |
 2276|   191k|    case START_WINDOW:
  ------------------
  |  Branch (2276:5): [True: 20.6k, False: 296k]
  ------------------
 2277|  20.6k|      ptr_dct_in = ptr_real_out;
 2278|  20.6k|      ptr_window = &long_window_KBD[0];
 2279|  20.6k|      switch (frame_len) {
  ------------------
  |  Branch (2279:15): [True: 20.6k, False: 0]
  ------------------
 2280|  12.1k|        case FRAME_LEN_1024:
  ------------------
  |  |   91|  12.1k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2280:9): [True: 12.1k, False: 8.53k]
  ------------------
 2281|  12.1k|          ptr_window = &long_window_KBD[0];
 2282|  12.1k|          break;
 2283|       |
 2284|  8.53k|        case FRAME_LEN_960:
  ------------------
  |  |   94|  8.53k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2284:9): [True: 8.53k, False: 12.1k]
  ------------------
 2285|  8.53k|          ptr_window = &long_window_sine_960[0];
 2286|  8.53k|          break;
 2287|  20.6k|      }
 2288|  10.3M|      for (i = 0; i < frame_len / 2; i++) {
  ------------------
  |  Branch (2288:19): [True: 10.2M, False: 20.6k]
  ------------------
 2289|  10.2M|        ws1 = ptr_mdct_delay_buffer[i] * ptr_window[i];
 2290|       |
 2291|  10.2M|        ws2 = ptr_mdct_delay_buffer[(frame_len - i - 1)] * ptr_window[frame_len - i - 1];
 2292|       |
 2293|  10.2M|        ptr_dct_in[frame_len / 2 + i] = ws1 - ws2;
 2294|  10.2M|      }
 2295|       |
 2296|  20.6k|      ixheaace_shift_mdct_delay_buffer(ptr_mdct_delay_buffer, ptr_time_signal, ch_increment,
 2297|  20.6k|                                       frame_len);
 2298|       |
 2299|  20.6k|      if (frame_len == FRAME_LEN_1024) {
  ------------------
  |  |   91|  20.6k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2299:11): [True: 12.1k, False: 8.53k]
  ------------------
 2300|  12.1k|        ptr_window = &short_window_sine[0];
 2301|  12.1k|      } else if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  8.53k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2301:18): [True: 8.53k, False: 0]
  ------------------
 2302|  8.53k|        ptr_window = &short_window_sine_120[0];
 2303|  8.53k|      }
 2304|  9.02M|      for (i = 0; i < ls_trans; i++) {
  ------------------
  |  Branch (2304:19): [True: 9.00M, False: 20.6k]
  ------------------
 2305|  9.00M|        ws1 = ptr_mdct_delay_buffer[i];
 2306|  9.00M|        ws2 = 0.0f;
 2307|       |
 2308|  9.00M|        ptr_dct_in[frame_len / 2 - i - 1] = -(ws1 + ws2);
 2309|  9.00M|      }
 2310|       |
 2311|  1.30M|      for (i = 0; i < frame_len_short / 2; i++) {
  ------------------
  |  Branch (2311:19): [True: 1.28M, False: 20.6k]
  ------------------
 2312|  1.28M|        ws1 = ptr_mdct_delay_buffer[i + ls_trans] * ptr_window[frame_len_short - i - 1];
 2313|       |
 2314|  1.28M|        ws2 = ptr_mdct_delay_buffer[(frame_len - i - 1 - ls_trans)] * ptr_window[i];
 2315|       |
 2316|  1.28M|        ptr_dct_in[frame_len / 2 - i - 1 - ls_trans] = -(ws1 + ws2);
 2317|  1.28M|      }
 2318|  20.6k|      if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  20.6k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2318:11): [True: 8.53k, False: 12.1k]
  ------------------
 2319|  8.53k|        ixheaace_mdct_960(ptr_dct_in, ptr_scratch);
 2320|  12.1k|      } else {
 2321|  12.1k|        ixheaace_mdct(ptr_dct_in, fft_twiddle_tab, long_window_sine, frame_len, 10, ptr_scratch);
 2322|  12.1k|      }
 2323|       |
 2324|  20.6k|      break;
 2325|       |
 2326|  18.3k|    case STOP_WINDOW:
  ------------------
  |  Branch (2326:5): [True: 18.3k, False: 299k]
  ------------------
 2327|  18.3k|      ptr_window = &long_window_KBD[0];
 2328|  18.3k|      ptr_dct_in = ptr_real_out;
 2329|  18.3k|      if (frame_len == FRAME_LEN_1024) {
  ------------------
  |  |   91|  18.3k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2329:11): [True: 10.7k, False: 7.63k]
  ------------------
 2330|  10.7k|        ptr_window = &short_window_sine[0];
 2331|  10.7k|      } else if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  7.63k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2331:18): [True: 7.63k, False: 0]
  ------------------
 2332|  7.63k|        ptr_window = &short_window_sine_120[0];
 2333|  7.63k|      }
 2334|  8.03M|      for (i = 0; i < ls_trans; i++) {
  ------------------
  |  Branch (2334:19): [True: 8.01M, False: 18.3k]
  ------------------
 2335|  8.01M|        ws1 = 0.0f;
 2336|  8.01M|        ws2 = ptr_mdct_delay_buffer[(frame_len - i - 1)];
 2337|  8.01M|        ptr_dct_in[frame_len / 2 + i] = ws1 - ws2;
 2338|  8.01M|      }
 2339|       |
 2340|  1.16M|      for (i = 0; i < frame_len_short / 2; i++) {
  ------------------
  |  Branch (2340:19): [True: 1.14M, False: 18.3k]
  ------------------
 2341|  1.14M|        ws1 = ptr_mdct_delay_buffer[(i + ls_trans)] * ptr_window[i];
 2342|       |
 2343|  1.14M|        ws2 = ptr_mdct_delay_buffer[(frame_len - ls_trans - i - 1)] *
 2344|  1.14M|              ptr_window[frame_len_short - i - 1];
 2345|       |
 2346|  1.14M|        ptr_dct_in[frame_len / 2 + i + ls_trans] = ws1 - ws2;
 2347|  1.14M|      }
 2348|       |
 2349|  18.3k|      ixheaace_shift_mdct_delay_buffer(ptr_mdct_delay_buffer, ptr_time_signal, ch_increment,
 2350|  18.3k|                                       frame_len);
 2351|       |
 2352|  18.3k|      if (frame_len == FRAME_LEN_1024) {
  ------------------
  |  |   91|  18.3k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2352:11): [True: 10.7k, False: 7.63k]
  ------------------
 2353|  10.7k|        ptr_window = &long_window_KBD[0];
 2354|  10.7k|      } else if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  7.63k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2354:18): [True: 7.63k, False: 0]
  ------------------
 2355|  7.63k|        ptr_window = &long_window_sine_960[0];
 2356|  7.63k|      }
 2357|  9.17M|      for (i = 0; i < frame_len / 2; i++) {
  ------------------
  |  Branch (2357:19): [True: 9.16M, False: 18.3k]
  ------------------
 2358|  9.16M|        ws1 = ptr_mdct_delay_buffer[i] * ptr_window[frame_len - i - 1];
 2359|       |
 2360|  9.16M|        ws2 = ptr_mdct_delay_buffer[(frame_len - i - 1)] * ptr_window[i];
 2361|       |
 2362|  9.16M|        ptr_dct_in[frame_len / 2 - i - 1] = -(ws1 + ws2);
 2363|  9.16M|      }
 2364|       |
 2365|  18.3k|      if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  18.3k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2365:11): [True: 7.63k, False: 10.7k]
  ------------------
 2366|  7.63k|        ixheaace_mdct_960(ptr_dct_in, ptr_scratch);
 2367|  10.7k|      } else {
 2368|  10.7k|        ixheaace_mdct(ptr_dct_in, fft_twiddle_tab, long_window_sine, frame_len, 10, ptr_scratch);
 2369|  10.7k|      }
 2370|       |
 2371|  18.3k|      break;
 2372|       |
 2373|  86.9k|    case SHORT_WINDOW:
  ------------------
  |  Branch (2373:5): [True: 86.9k, False: 230k]
  ------------------
 2374|  86.9k|      ptr_window = &short_window_sine[0];
 2375|  86.9k|      if (frame_len == FRAME_LEN_1024) {
  ------------------
  |  |   91|  86.9k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2375:11): [True: 46.6k, False: 40.3k]
  ------------------
 2376|  46.6k|        ptr_window = &short_window_sine[0];
 2377|  46.6k|      } else if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  40.3k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2377:18): [True: 40.3k, False: 0]
  ------------------
 2378|  40.3k|        ptr_window = &short_window_sine_120[0];
 2379|  40.3k|      }
 2380|   782k|      for (w = 0; w < TRANS_FAC; w++) {
  ------------------
  |  |   29|   782k|#define TRANS_FAC 8
  ------------------
  |  Branch (2380:19): [True: 695k, False: 86.9k]
  ------------------
 2381|   695k|        ptr_dct_in = ptr_real_out + w * frame_len_short;
 2382|       |
 2383|  43.9M|        for (i = 0; i < frame_len_short / 2; i++) {
  ------------------
  |  Branch (2383:21): [True: 43.2M, False: 695k]
  ------------------
 2384|  43.2M|          ws1 = ptr_mdct_delay_buffer[trans_offset + w * frame_len_short + i] * ptr_window[i];
 2385|       |
 2386|  43.2M|          ws2 = ptr_mdct_delay_buffer[trans_offset + w * frame_len_short + frame_len_short - i -
 2387|  43.2M|                                      1] *
 2388|  43.2M|                ptr_window[frame_len_short - i - 1];
 2389|       |
 2390|  43.2M|          ptr_dct_in[frame_len_short / 2 + i] = ws1 - ws2;
 2391|       |
 2392|  43.2M|          ws1 = ptr_mdct_delay_buffer[trans_offset + w * frame_len_short + frame_len_short + i] *
 2393|  43.2M|                ptr_window[frame_len_short - i - 1];
 2394|       |
 2395|  43.2M|          ws2 = ptr_mdct_delay_buffer[trans_offset + w * frame_len_short + frame_len_short * 2 -
 2396|  43.2M|                                      i - 1] *
 2397|  43.2M|                ptr_window[i];
 2398|       |
 2399|  43.2M|          ptr_dct_in[frame_len_short / 2 - i - 1] = -(ws1 + ws2);
 2400|  43.2M|        }
 2401|   695k|        if (frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|   695k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2401:13): [True: 322k, False: 372k]
  ------------------
 2402|   322k|          ixheaace_mdct_120(ptr_dct_in, ptr_scratch);
 2403|   372k|        } else {
 2404|   372k|          ixheaace_mdct(ptr_dct_in, fft_twiddle_tab, short_window_sine, frame_len_short, 7,
 2405|   372k|                        ptr_scratch);
 2406|   372k|        }
 2407|   695k|      }
 2408|       |
 2409|  86.9k|      ixheaace_shift_mdct_delay_buffer(ptr_mdct_delay_buffer, ptr_time_signal, ch_increment,
 2410|  86.9k|                                       frame_len);
 2411|  86.9k|      break;
 2412|   317k|  }
 2413|   317k|}
ia_enhaacplus_enc_transform_real_eld:
 2418|  64.1k|                                          WORD32 frame_len) {
 2419|  64.1k|  WORD32 i, loop_len;
 2420|  64.1k|  FLOAT32 w1, w2;
 2421|  64.1k|  FLOAT32 *ptr_curr_data, *ptr_prev1_data, *ptr_prev2_data, *ptr_prev3_data;
 2422|  64.1k|  const FLOAT32 *ptr_win0, *ptr_win1, *ptr_win2, *ptr_win3;
 2423|       |
 2424|  64.1k|  loop_len = frame_len / 4;
 2425|       |
 2426|  64.1k|  ptr_curr_data = &ptr_mdct_delay_buffer[3 * frame_len];
 2427|  64.1k|  ptr_prev1_data = &ptr_mdct_delay_buffer[2 * frame_len];
 2428|  64.1k|  ptr_prev2_data = &ptr_mdct_delay_buffer[frame_len];
 2429|  64.1k|  ptr_prev3_data = &ptr_mdct_delay_buffer[0];
 2430|       |
 2431|  64.1k|  ptr_win0 = &low_delay_window_eld[0];
 2432|  64.1k|  ptr_win1 = &low_delay_window_eld[frame_len];
 2433|  64.1k|  ptr_win2 = &low_delay_window_eld[2 * frame_len];
 2434|  64.1k|  ptr_win3 = &low_delay_window_eld[3 * frame_len];
 2435|       |
 2436|  64.1k|  memmove(&ptr_mdct_delay_buffer[0], &ptr_mdct_delay_buffer[frame_len],
 2437|  64.1k|          (3 * frame_len) * sizeof(ptr_mdct_delay_buffer[0]));
 2438|       |
 2439|  32.8M|  for (i = 0; i < frame_len; i++) {
  ------------------
  |  Branch (2439:15): [True: 32.8M, False: 64.1k]
  ------------------
 2440|  32.8M|    ptr_curr_data[i] = ptr_time_signal[i * ch_increment];
 2441|  32.8M|  }
 2442|       |
 2443|  8.26M|  for (i = 0; i < loop_len; i++) {
  ------------------
  |  Branch (2443:15): [True: 8.20M, False: 64.1k]
  ------------------
 2444|  8.20M|    w1 = ptr_prev3_data[(frame_len / 2) + loop_len + i] * ptr_win3[(frame_len / 2) - 1 - i];
 2445|  8.20M|    w1 += ptr_prev3_data[(frame_len / 2) + loop_len - 1 - i] * ptr_win3[(frame_len / 2) + i];
 2446|       |
 2447|  8.20M|    w2 = (-ptr_prev1_data[(frame_len / 2) + loop_len + i] * ptr_win1[(frame_len / 2) - 1 - i]);
 2448|  8.20M|    w2 += (-ptr_prev1_data[(frame_len / 2) + loop_len - 1 - i] * ptr_win1[(frame_len / 2) + i]);
 2449|       |
 2450|  8.20M|    ptr_real_out[i] = w1 + w2;
 2451|  8.20M|  }
 2452|       |
 2453|  8.26M|  for (i = 0; i < loop_len; i++) {
  ------------------
  |  Branch (2453:15): [True: 8.20M, False: 64.1k]
  ------------------
 2454|  8.20M|    w1 = (-ptr_prev2_data[(frame_len / 2) + loop_len + i] * ptr_win2[(frame_len / 2) - 1 - i]);
 2455|  8.20M|    w1 += ptr_prev2_data[(frame_len / 2) + loop_len - 1 - i] * ptr_win2[(frame_len / 2) + i];
 2456|       |
 2457|  8.20M|    w2 = ptr_curr_data[(frame_len / 2) + loop_len + i] * ptr_win0[(frame_len / 2) - 1 - i];
 2458|  8.20M|    w2 += (-ptr_curr_data[(frame_len / 2) + loop_len - 1 - i] * ptr_win0[(frame_len / 2) + i]);
 2459|       |
 2460|  8.20M|    ptr_real_out[frame_len - 1 - i] = w1 + w2;
 2461|  8.20M|  }
 2462|       |
 2463|  8.26M|  for (i = 0; i < loop_len; i++) {
  ------------------
  |  Branch (2463:15): [True: 8.20M, False: 64.1k]
  ------------------
 2464|  8.20M|    w1 = ptr_prev2_data[loop_len - 1 - i] * ptr_win3[i];
 2465|  8.20M|    w1 += ptr_prev3_data[loop_len + i] * ptr_win3[frame_len - 1 - i];
 2466|       |
 2467|  8.20M|    w2 = (-ptr_curr_data[loop_len - 1 - i] * ptr_win1[i]);
 2468|  8.20M|    w2 += (-ptr_prev1_data[loop_len + i] * ptr_win1[frame_len - 1 - i]);
 2469|       |
 2470|  8.20M|    ptr_real_out[(frame_len / 2) - 1 - i] = w1 + w2;
 2471|  8.20M|  }
 2472|       |
 2473|  8.26M|  for (i = 0; i < loop_len; i++) {
  ------------------
  |  Branch (2473:15): [True: 8.20M, False: 64.1k]
  ------------------
 2474|  8.20M|    w1 = -(ptr_prev1_data[loop_len - 1 - i] * ptr_win2[i]);
 2475|  8.20M|    w1 += ptr_prev2_data[loop_len + i] * ptr_win2[frame_len - 1 - i];
 2476|       |
 2477|       |    /* First 128 coeffcients are zeros in the window table so they are not used in the code here*/
 2478|  8.20M|    w2 = (-ptr_curr_data[loop_len + i] * ptr_win0[frame_len - 1 - i]);
 2479|       |
 2480|  8.20M|    ptr_real_out[(frame_len / 2) + i] = w1 + w2;
 2481|  8.20M|  }
 2482|       |
 2483|  64.1k|  ixheaace_mdct(ptr_real_out, fft_twiddle_tab, long_window_sine_ld, frame_len, 9,
 2484|  64.1k|                ptr_shared_buffer5);
 2485|  64.1k|}
ixheaace_fft.c:ia_enhaacplus_enc_tranform_mac4:
  126|   135k|                                            WORD32 increment) {
  127|   135k|  WORD32 i;
  128|       |
  129|   135k|  if (increment > 0) {
  ------------------
  |  Branch (129:7): [True: 67.6k, False: 67.6k]
  ------------------
  130|  4.12M|    for (i = len >> 2; i > 0; i--) {
  ------------------
  |  Branch (130:24): [True: 4.06M, False: 67.6k]
  ------------------
  131|  4.06M|      *ptr_op = ((ptr_win[0] * (*ptr_buf1++)) + (ptr_win[1] * (*ptr_buf2++)));
  132|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[2] * (*ptr_buf3--)));
  133|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[3] * (*ptr_buf4--)));
  134|  4.06M|      ptr_op++;
  135|       |
  136|  4.06M|      *ptr_op = ((ptr_win[4] * (*ptr_buf1++)) + (ptr_win[5] * (*ptr_buf2++)));
  137|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[6] * (*ptr_buf3--)));
  138|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[7] * (*ptr_buf4--)));
  139|  4.06M|      ptr_op++;
  140|       |
  141|  4.06M|      *ptr_op = ((ptr_win[8] * (*ptr_buf1++)) + (ptr_win[9] * (*ptr_buf2++)));
  142|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[10] * (*ptr_buf3--)));
  143|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[11] * (*ptr_buf4--)));
  144|  4.06M|      ptr_op++;
  145|       |
  146|  4.06M|      *ptr_op = ((ptr_win[12] * (*ptr_buf1++)) + (ptr_win[13] * (*ptr_buf2++)));
  147|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[14] * (*ptr_buf3--)));
  148|  4.06M|      *ptr_op = (*ptr_op + (ptr_win[15] * (*ptr_buf4--)));
  149|  4.06M|      ptr_op++;
  150|  4.06M|      ptr_win += 16;
  151|  4.06M|    }
  152|  67.6k|  } else {
  153|  2.09M|    for (i = len >> 2; i > 0; i--) {
  ------------------
  |  Branch (153:24): [True: 2.03M, False: 67.6k]
  ------------------
  154|  2.03M|      *ptr_op = ((ptr_win[0] * (*ptr_buf1++)) + (ptr_win[1] * (*ptr_buf2++)));
  155|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[2] * (*ptr_buf3--)));
  156|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[3] * (*ptr_buf4--)));
  157|  2.03M|      ptr_op--;
  158|       |
  159|  2.03M|      *ptr_op = ((ptr_win[4] * (*ptr_buf1++)) + (ptr_win[5] * (*ptr_buf2++)));
  160|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[6] * (*ptr_buf3--)));
  161|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[7] * (*ptr_buf4--)));
  162|  2.03M|      ptr_op--;
  163|       |
  164|  2.03M|      *ptr_op = ((ptr_win[8] * (*ptr_buf1++)) + (ptr_win[9] * (*ptr_buf2++)));
  165|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[10] * (*ptr_buf3--)));
  166|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[11] * (*ptr_buf4--)));
  167|  2.03M|      ptr_op--;
  168|       |
  169|  2.03M|      *ptr_op = ((ptr_win[12] * (*ptr_buf1++)) + (ptr_win[13] * (*ptr_buf2++)));
  170|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[14] * (*ptr_buf3--)));
  171|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[15] * (*ptr_buf4--)));
  172|  2.03M|      ptr_op--;
  173|  2.03M|      ptr_win += 16;
  174|  2.03M|    }
  175|  67.6k|  }
  176|   135k|}
ixheaace_fft.c:ia_enhaacplus_enc_shift_mdct_delay_buffer:
   41|  67.6k|                                                      WORD32 long_frame_len) {
   42|  67.6k|  WORD32 i;
   43|  67.6k|  FLOAT32 *ptr_mdct_buff = ptr_mdct_delay_buffer;
   44|  67.6k|  if (ch_increment == 2) {
  ------------------
  |  Branch (44:7): [True: 67.2k, False: 468]
  ------------------
   45|  67.2k|    const FLOAT32 *ptr_input = ptr_time_signal;
   46|  67.2k|    FLOAT32 temp1, temp2, temp3, temp4;
   47|  67.2k|    temp1 = *ptr_input++;
   48|  67.2k|    ptr_input++;
   49|  67.2k|    temp2 = *ptr_input++;
   50|  67.2k|    ptr_input++;
   51|  67.2k|    temp3 = *ptr_input++;
   52|  67.2k|    ptr_input++;
   53|  8.06M|    for (i = ((long_frame_len >> 2) - 2); i >= 0; i--) {
  ------------------
  |  Branch (53:43): [True: 8.00M, False: 67.2k]
  ------------------
   54|  8.00M|      *ptr_mdct_buff++ = temp1;
   55|  8.00M|      temp4 = *ptr_input++;
   56|  8.00M|      ptr_input++;
   57|       |
   58|  8.00M|      *ptr_mdct_buff++ = temp2;
   59|  8.00M|      *ptr_mdct_buff++ = temp3;
   60|  8.00M|      *ptr_mdct_buff++ = temp4;
   61|       |
   62|  8.00M|      temp1 = *ptr_input++;
   63|  8.00M|      ptr_input++;
   64|  8.00M|      temp2 = *ptr_input++;
   65|  8.00M|      ptr_input++;
   66|  8.00M|      temp3 = *ptr_input++;
   67|  8.00M|      ptr_input++;
   68|  8.00M|    }
   69|  67.2k|    *ptr_mdct_buff++ = temp1;
   70|  67.2k|    temp4 = *ptr_input;
   71|  67.2k|    *ptr_mdct_buff++ = temp2;
   72|  67.2k|    *ptr_mdct_buff++ = temp3;
   73|  67.2k|    *ptr_mdct_buff++ = temp4;
   74|  67.2k|  } else {
   75|   112k|    for (i = 0; i < long_frame_len; i += 2) {
  ------------------
  |  Branch (75:17): [True: 112k, False: 468]
  ------------------
   76|   112k|      *ptr_mdct_buff++ = ptr_time_signal[i * ch_increment];
   77|   112k|      *ptr_mdct_buff++ = ptr_time_signal[(i + 1) * ch_increment];
   78|   112k|    }
   79|    468|  }
   80|  67.6k|}
ixheaace_fft.c:ia_enhaacplus_enc_tranform_mac3:
  180|  67.6k|                                            FLOAT32 *ptr_buf3, UWORD32 len, WORD32 increment) {
  181|  67.6k|  WORD32 i;
  182|       |
  183|  67.6k|  if (increment > 0) {
  ------------------
  |  Branch (183:7): [True: 0, False: 67.6k]
  ------------------
  184|      0|    for (i = len >> 2; i > 0; i--) {
  ------------------
  |  Branch (184:24): [True: 0, False: 0]
  ------------------
  185|      0|      *ptr_op = ((ptr_win[0] * (*ptr_buf1++)) + (ptr_win[1] * (*ptr_buf2--)));
  186|      0|      *ptr_op = (*ptr_op + (ptr_win[2] * (*ptr_buf3--)));
  187|      0|      ptr_op++;
  188|       |
  189|      0|      *ptr_op = ((ptr_win[3] * (*ptr_buf1++)) + (ptr_win[4] * (*ptr_buf2--)));
  190|      0|      *ptr_op = (*ptr_op + (ptr_win[5] * (*ptr_buf3--)));
  191|      0|      ptr_op++;
  192|       |
  193|      0|      *ptr_op = ((ptr_win[6] * (*ptr_buf1++)) + (ptr_win[7] * (*ptr_buf2--)));
  194|      0|      *ptr_op = (*ptr_op + (ptr_win[8] * (*ptr_buf3--)));
  195|      0|      ptr_op++;
  196|       |
  197|      0|      *ptr_op = ((ptr_win[9] * (*ptr_buf1++)) + (ptr_win[10] * (*ptr_buf2--)));
  198|      0|      *ptr_op = (*ptr_op + (ptr_win[11] * (*ptr_buf3--)));
  199|      0|      ptr_op++;
  200|      0|      ptr_win += 12;
  201|      0|    }
  202|  67.6k|  } else {
  203|  2.09M|    for (i = len >> 2; i > 0; i--) {
  ------------------
  |  Branch (203:24): [True: 2.03M, False: 67.6k]
  ------------------
  204|  2.03M|      *ptr_op = ((ptr_win[0] * (*ptr_buf1++)) + (ptr_win[1] * (*ptr_buf2--)));
  205|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[2] * (*ptr_buf3--)));
  206|  2.03M|      ptr_op--;
  207|       |
  208|  2.03M|      *ptr_op = ((ptr_win[3] * (*ptr_buf1++)) + (ptr_win[4] * (*ptr_buf2--)));
  209|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[5] * (*ptr_buf3--)));
  210|  2.03M|      ptr_op--;
  211|       |
  212|  2.03M|      *ptr_op = ((ptr_win[6] * (*ptr_buf1++)) + (ptr_win[7] * (*ptr_buf2--)));
  213|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[8] * (*ptr_buf3--)));
  214|  2.03M|      ptr_op--;
  215|       |
  216|  2.03M|      *ptr_op = ((ptr_win[9] * (*ptr_buf1++)) + (ptr_win[10] * (*ptr_buf2--)));
  217|  2.03M|      *ptr_op = (*ptr_op + (ptr_win[11] * (*ptr_buf3--)));
  218|  2.03M|      ptr_op--;
  219|  2.03M|      ptr_win += 12;
  220|  2.03M|    }
  221|  67.6k|  }
  222|  67.6k|}
ixheaace_fft.c:ia_eaacp_enc_pre_twiddle_compute:
  286|  67.6k|                                             const FLOAT32 *ptr_cos_sin, WORD n_by_4) {
  287|  67.6k|  WORD32 i;
  288|  67.6k|  FLOAT32 temp_r, temp_i;
  289|  67.6k|  FLOAT32 temp_r1, temp_i1;
  290|  67.6k|  FLOAT32 *ptr_x1 = ptr_x + (SIZE_T)((n_by_4 << 2) - 1);
  291|  67.6k|  FLOAT32 c, c1, s, s1;
  292|       |
  293|  8.19M|  for (i = 0; i < n_by_4; i++) {
  ------------------
  |  Branch (293:15): [True: 8.12M, False: 67.6k]
  ------------------
  294|  8.12M|    c = *ptr_cos_sin++;
  295|  8.12M|    s = *ptr_cos_sin++;
  296|  8.12M|    s1 = *ptr_cos_sin++;
  297|  8.12M|    c1 = *ptr_cos_sin++;
  298|       |
  299|  8.12M|    temp_r = *ptr_in1++;
  300|  8.12M|    temp_i1 = *ptr_in1++;
  301|  8.12M|    temp_i = *ptr_in2--;
  302|  8.12M|    temp_r1 = *ptr_in2--;
  303|  8.12M|    *ptr_x = ((temp_r * c) + (temp_i * s));
  304|  8.12M|    ptr_x++;
  305|       |
  306|  8.12M|    *ptr_x = ((temp_i * c) - (temp_r * s));
  307|  8.12M|    ptr_x++;
  308|       |
  309|  8.12M|    *ptr_x1 = ((temp_i1 * c1) - (temp_r1 * s1));
  310|  8.12M|    ptr_x1--;
  311|       |
  312|  8.12M|    *ptr_x1 = ((temp_r1 * c1) + (temp_i1 * s1));
  313|  8.12M|    ptr_x1--;
  314|  8.12M|  }
  315|  67.6k|}
ixheaace_fft.c:ia_enhaacplus_enc_calc_norm:
  363|  33.0M|static PLATFORM_INLINE WORD8 ia_enhaacplus_enc_calc_norm(WORD32 a) {
  364|  33.0M|  WORD8 norm_val;
  365|       |
  366|  33.0M|  if (a == 0) {
  ------------------
  |  Branch (366:7): [True: 0, False: 33.0M]
  ------------------
  367|      0|    norm_val = 31;
  368|  33.0M|  } else {
  369|  33.0M|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (369:9): [True: 0, False: 33.0M]
  ------------------
  370|      0|      norm_val = 31;
  371|  33.0M|    } else {
  372|  33.0M|      if (a < 0) {
  ------------------
  |  Branch (372:11): [True: 0, False: 33.0M]
  ------------------
  373|      0|        a = ~a;
  374|      0|      }
  375|   857M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (375:26): [True: 824M, False: 33.0M]
  ------------------
  376|   824M|        a <<= 1;
  377|   824M|      }
  378|  33.0M|    }
  379|  33.0M|  }
  380|       |
  381|  33.0M|  return norm_val;
  382|  33.0M|}
ixheaace_fft.c:ixheaace_shift_mdct_delay_buffer:
 2178|   317k|                                             WORD32 frame_len) {
 2179|   317k|  WORD32 i;
 2180|   317k|  WORD32 blk_switch_offset = frame_len;
 2181|   317k|  switch (frame_len) {
  ------------------
  |  Branch (2181:11): [True: 317k, False: 0]
  ------------------
 2182|   178k|    case FRAME_LEN_1024:
  ------------------
  |  |   91|   178k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2182:5): [True: 178k, False: 139k]
  ------------------
 2183|   178k|      blk_switch_offset = BLK_SWITCH_OFFSET_LC_128;
  ------------------
  |  |   90|   178k|#define BLK_SWITCH_OFFSET_LC_128 (1 * 1024 + 3 * 128 + 64 + 128)
  ------------------
 2184|   178k|      memmove(ptr_mdct_delay_buffer, ptr_mdct_delay_buffer + frame_len,
 2185|   178k|              (blk_switch_offset - frame_len) * sizeof(*ptr_mdct_delay_buffer));
 2186|   178k|      break;
 2187|       |
 2188|   116k|    case FRAME_LEN_960:
  ------------------
  |  |   94|   116k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2188:5): [True: 116k, False: 201k]
  ------------------
 2189|   116k|      blk_switch_offset = BLK_SWITCH_OFFSET_LC_120;
  ------------------
  |  |   91|   116k|#define BLK_SWITCH_OFFSET_LC_120 (1 * 960 + 3 * 120 + 60 + 120)
  ------------------
 2190|   116k|      memmove(ptr_mdct_delay_buffer, ptr_mdct_delay_buffer + frame_len,
 2191|   116k|              (blk_switch_offset - frame_len) * sizeof(*ptr_mdct_delay_buffer));
 2192|   116k|      break;
 2193|       |
 2194|  22.9k|    case FRAME_LEN_512:
  ------------------
  |  |   92|  22.9k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2194:5): [True: 22.9k, False: 294k]
  ------------------
 2195|  22.9k|    case FRAME_LEN_480:
  ------------------
  |  |   93|  22.9k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (2195:5): [True: 0, False: 317k]
  ------------------
 2196|  22.9k|      blk_switch_offset = frame_len;
 2197|  22.9k|      break;
 2198|   317k|  }
 2199|       |
 2200|   306M|  for (i = 0; i < frame_len; i++) {
  ------------------
  |  Branch (2200:15): [True: 305M, False: 317k]
  ------------------
 2201|   305M|    ptr_mdct_delay_buffer[blk_switch_offset - frame_len + i] = ptr_time_signal[i * ch_increment];
 2202|   305M|  }
 2203|   317k|}
ixheaace_fft.c:ixheaace_mdct:
 2166|   591k|                          WORD8 *ptr_scratch) {
 2167|   591k|  ixheaace_pre_mdct(ptr_dct_data, n, ptr_sine_window);
 2168|       |
 2169|   591k|  ixheaace_scratch_mem *pstr_scratch = (ixheaace_scratch_mem *)ptr_scratch;
 2170|   591k|  ia_enhaacplus_enc_complex_fft(ptr_dct_data, n / 2, pstr_scratch);
 2171|       |
 2172|   591k|  ixheaace_post_mdct(ptr_dct_data, n, ptr_trig_data,
 2173|   591k|                     1 << (LD_FFT_TWIDDLE_TABLE_SIZE - (ld_n - 1)), FFT_TWIDDLE_TABLE_SIZE);
  ------------------
  |  |   26|   591k|#define LD_FFT_TWIDDLE_TABLE_SIZE 9
  ------------------
                                   1 << (LD_FFT_TWIDDLE_TABLE_SIZE - (ld_n - 1)), FFT_TWIDDLE_TABLE_SIZE);
  ------------------
  |  |   27|   591k|#define FFT_TWIDDLE_TABLE_SIZE (1 << LD_FFT_TWIDDLE_TABLE_SIZE)
  |  |  ------------------
  |  |  |  |   26|   591k|#define LD_FFT_TWIDDLE_TABLE_SIZE 9
  |  |  ------------------
  ------------------
 2174|   591k|}
ixheaace_fft.c:ixheaace_pre_mdct:
   97|   591k|static VOID ixheaace_pre_mdct(FLOAT32 *ptr_x, WORD32 m, const FLOAT32 *ptr_sine_window) {
   98|   591k|  WORD32 i;
   99|   591k|  FLOAT32 wre, wim, re1, re2, im1, im2;
  100|       |
  101|  57.3M|  for (i = 0; i < m / 4; i++) {
  ------------------
  |  Branch (101:15): [True: 56.8M, False: 591k]
  ------------------
  102|  56.8M|    re1 = ptr_x[2 * i];
  103|  56.8M|    im2 = ptr_x[2 * i + 1];
  104|  56.8M|    re2 = ptr_x[m - 2 - 2 * i];
  105|  56.8M|    im1 = ptr_x[m - 1 - 2 * i];
  106|       |
  107|  56.8M|    wim = ptr_sine_window[i * 2];
  108|  56.8M|    wre = ptr_sine_window[m - 1 - 2 * i];
  109|       |
  110|  56.8M|    ptr_x[2 * i] = im1 * wim + re1 * wre;
  111|       |
  112|  56.8M|    ptr_x[2 * i + 1] = im1 * wre - re1 * wim;
  113|       |
  114|  56.8M|    wim = ptr_sine_window[m - 2 - 2 * i];
  115|  56.8M|    wre = ptr_sine_window[2 * i + 1];
  116|       |
  117|  56.8M|    ptr_x[m - 2 - 2 * i] = im2 * wim + re2 * wre;
  118|       |
  119|  56.8M|    ptr_x[m - 1 - 2 * i] = im2 * wre - re2 * wim;
  120|  56.8M|  }
  121|   591k|}
ixheaace_fft.c:ixheaace_post_mdct:
 1045|   591k|                               WORD32 step, WORD32 trig_data_size) {
 1046|   591k|  WORD32 i;
 1047|   591k|  FLOAT32 w_re, w_im, re1, re2, im1, im2;
 1048|   591k|  const FLOAT32 *ptr_sin = ptr_trig_data;
 1049|   591k|  const FLOAT32 *ptr_cos = ptr_trig_data + trig_data_size;
 1050|       |
 1051|   591k|  w_im = *ptr_sin;
 1052|   591k|  w_re = *ptr_cos;
 1053|       |
 1054|  57.3M|  for (i = 0; i < m / 4; i++) {
  ------------------
  |  Branch (1054:15): [True: 56.8M, False: 591k]
  ------------------
 1055|  56.8M|    re1 = ptr_x[2 * i];
 1056|  56.8M|    im1 = ptr_x[2 * i + 1];
 1057|  56.8M|    re2 = ptr_x[m - 2 - 2 * i];
 1058|  56.8M|    im2 = ptr_x[m - 1 - 2 * i];
 1059|       |
 1060|  56.8M|    ptr_x[2 * i] = (re1 * w_re + im1 * w_im);
 1061|       |
 1062|  56.8M|    ptr_x[m - 1 - 2 * i] = (re1 * w_im - im1 * w_re);
 1063|       |
 1064|  56.8M|    ptr_sin += step;
 1065|  56.8M|    ptr_cos -= step;
 1066|       |
 1067|  56.8M|    w_im = *ptr_sin;
 1068|  56.8M|    w_re = *ptr_cos;
 1069|       |
 1070|  56.8M|    ptr_x[m - 2 - 2 * i] = (re2 * w_im + im2 * w_re);
 1071|       |
 1072|  56.8M|    ptr_x[2 * i + 1] = (re2 * w_re - im2 * w_im);
 1073|  56.8M|  }
 1074|   591k|}
ixheaace_fft.c:ixheaace_mdct_960:
 2119|  75.8k|static VOID ixheaace_mdct_960(FLOAT32 *ptr_input_flt, WORD8 *ptr_scratch) {
 2120|  75.8k|  FLOAT32 *ptr_scratch_flt = (FLOAT32 *)ptr_scratch;
 2121|  75.8k|  FLOAT32 const_mult_fac = 3.142857143f;
 2122|  75.8k|  FLOAT32 *ptr_data = ptr_input_flt;
 2123|  75.8k|  WORD32 k;
 2124|       |
 2125|  75.8k|  memcpy(ptr_scratch_flt, ptr_input_flt, sizeof(*ptr_scratch_flt) * FRAME_LEN_960);
  ------------------
  |  |   94|  75.8k|#define FRAME_LEN_960 960
  ------------------
 2126|  75.8k|  ixheaace_pre_twiddle_960(ptr_input_flt, ptr_scratch_flt, FRAME_LEN_960, cos_sin_table_flt);
  ------------------
  |  |   94|  75.8k|#define FRAME_LEN_960 960
  ------------------
 2127|       |
 2128|  75.8k|  ixheaace_cfft_480(ptr_input_flt, ptr_scratch_flt);
 2129|       |
 2130|  75.8k|  ixheaace_post_twiddle_960(ptr_input_flt, ptr_scratch_flt, cos_sin_table_flt, FRAME_LEN_960);
  ------------------
  |  |   94|  75.8k|#define FRAME_LEN_960 960
  ------------------
 2131|       |
 2132|  36.4M|  for (k = FRAME_LEN_960 - 1; k >= 0; k -= 2) {
  ------------------
  |  |   94|  75.8k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (2132:31): [True: 36.3M, False: 75.8k]
  ------------------
 2133|  36.3M|    *ptr_data = (*ptr_data * const_mult_fac);
 2134|  36.3M|    ptr_data++;
 2135|  36.3M|    *ptr_data = (*ptr_data * const_mult_fac);
 2136|  36.3M|    ptr_data++;
 2137|  36.3M|  }
 2138|  75.8k|}
ixheaace_fft.c:ixheaace_pre_twiddle_960:
 2044|  75.8k|                                     const FLOAT32 *ptr_cos_sin_tbl) {
 2045|  75.8k|  WORD npoints_4, i;
 2046|  75.8k|  FLOAT32 tempr, tempi, temp;
 2047|  75.8k|  FLOAT32 c, c1, s, s1;
 2048|  75.8k|  FLOAT32 *ptr_in_1, *ptr_in_2;
 2049|  75.8k|  FLOAT32 *ptr_x_1 = ptr_x + (n - 1);
 2050|       |
 2051|  75.8k|  npoints_4 = n >> 2;
 2052|       |
 2053|  75.8k|  ptr_in_1 = ptr_data;
 2054|  75.8k|  ptr_in_2 = ptr_data + n - 1;
 2055|       |
 2056|  18.2M|  for (i = 0; i < npoints_4; i++) {
  ------------------
  |  Branch (2056:15): [True: 18.1M, False: 75.8k]
  ------------------
 2057|  18.1M|    c = *ptr_cos_sin_tbl++;
 2058|  18.1M|    s = *ptr_cos_sin_tbl++;
 2059|       |
 2060|  18.1M|    tempr = *ptr_in_1++;
 2061|  18.1M|    tempi = *ptr_in_2--;
 2062|       |
 2063|  18.1M|    temp = -((tempr * c) + (tempi * s));
 2064|  18.1M|    *ptr_x++ = temp;
 2065|       |
 2066|  18.1M|    temp = -((tempi * c) - (tempr * s));
 2067|  18.1M|    *ptr_x++ = temp;
 2068|       |
 2069|  18.1M|    c1 = *ptr_cos_sin_tbl++;
 2070|  18.1M|    s1 = *ptr_cos_sin_tbl++;
 2071|       |
 2072|  18.1M|    tempi = *ptr_in_1++;
 2073|  18.1M|    tempr = *ptr_in_2--;
 2074|       |
 2075|  18.1M|    temp = -((tempi * c1) - (tempr * s1));
 2076|  18.1M|    *ptr_x_1-- = temp;
 2077|       |
 2078|  18.1M|    temp = -((tempr * c1) + (tempi * s1));
 2079|  18.1M|    *ptr_x_1-- = temp;
 2080|  18.1M|  }
 2081|  75.8k|}
ixheaace_fft.c:ixheaace_cfft_480:
 2016|  75.8k|static VOID ixheaace_cfft_480(FLOAT32 *ptr_inp, FLOAT32 *ptr_op) {
 2017|  75.8k|  WORD32 i;
 2018|  75.8k|  FLOAT32 *ptr_buf1, *ptr_buf2;
 2019|  75.8k|  FLOAT32 fft5_out[FFT15X2] = {0};
 2020|       |
 2021|  75.8k|  ptr_buf1 = ptr_inp;
 2022|  75.8k|  ptr_buf2 = ptr_op;
 2023|       |
 2024|  2.50M|  for (i = 0; i < FFT32; i++) {
  ------------------
  |  |   53|  2.50M|#define FFT32 (32)
  ------------------
  |  Branch (2024:15): [True: 2.42M, False: 75.8k]
  ------------------
 2025|  2.42M|    ixheaace_cfft_15_480(ptr_buf1, ptr_buf2, &fft5_out[0]);
 2026|  2.42M|    ptr_buf1 += 2;
 2027|  2.42M|    ptr_buf2 += 2;
 2028|  2.42M|  }
 2029|       |
 2030|  75.8k|  ixheaace_cfft_twiddle_mult(ptr_op, ptr_inp, FFT15, FFT32, ixheaace_fft_mix_rad_twid_tbl_480,
  ------------------
  |  |   51|  75.8k|#define FFT15 (15)
  ------------------
                ixheaace_cfft_twiddle_mult(ptr_op, ptr_inp, FFT15, FFT32, ixheaace_fft_mix_rad_twid_tbl_480,
  ------------------
  |  |   53|  75.8k|#define FFT32 (32)
  ------------------
 2031|  75.8k|                             ixheaace_fft_mix_rad_twid_h_tbl_480);
 2032|       |
 2033|  75.8k|  ptr_buf1 = ptr_inp;
 2034|  75.8k|  ptr_buf2 = ptr_op;
 2035|       |
 2036|  1.21M|  for (i = 0; i < FFT15; i++) {
  ------------------
  |  |   51|  1.21M|#define FFT15 (15)
  ------------------
  |  Branch (2036:15): [True: 1.13M, False: 75.8k]
  ------------------
 2037|  1.13M|    ixheaace_cfft_32_480(ptr_buf1, ptr_buf2);
 2038|  1.13M|    ptr_buf1 += (FFT32X2);
  ------------------
  |  |   55|  1.13M|#define FFT32X2 (FFT32 * 2)
  |  |  ------------------
  |  |  |  |   53|  1.13M|#define FFT32 (32)
  |  |  ------------------
  ------------------
 2039|  1.13M|    ptr_buf2 += 2;
 2040|  1.13M|  }
 2041|  75.8k|}
ixheaace_fft.c:ixheaace_cfft_15_480:
 1102|  2.42M|static VOID ixheaace_cfft_15_480(FLOAT32 *ptr_inp, FLOAT32 *ptr_op, FLOAT32 *ptr_fft3_out) {
 1103|  2.42M|  WORD32 i, idx;
 1104|  2.42M|  FLOAT32 *ptr_buf1, *ptr_buf2, *ptr_buf3;
 1105|  2.42M|  FLOAT32 add_r, sub_r;
 1106|  2.42M|  FLOAT32 add_i, sub_i;
 1107|  2.42M|  FLOAT32 x_01_r, x_01_i, temp;
 1108|  2.42M|  FLOAT32 p1, p2, p3, p4;
 1109|       |
 1110|  2.42M|  FLOAT32 sin_mu_flt = 0.866027832f;
 1111|  2.42M|  FLOAT32 c51_flt = 0.951049805f;
 1112|  2.42M|  FLOAT32 c52_flt = -0.76940918f;
 1113|  2.42M|  FLOAT32 c53_flt = -0.36328125f;
 1114|  2.42M|  FLOAT32 c54_flt = 0.559020996f;
 1115|  2.42M|  FLOAT32 c55_flt = -0.625f;
 1116|       |
 1117|  2.42M|  FLOAT32 r1, r2, r3, r4;
 1118|  2.42M|  FLOAT32 s1, s2, s3, s4, t, temp1, temp2;
 1119|  2.42M|  FLOAT32 *ptr_out_fft3 = ptr_fft3_out;
 1120|       |
 1121|  2.42M|  FLOAT32 xr_0, xr_1, xr_2;
 1122|  2.42M|  FLOAT32 xi_0, xi_1, xi_2;
 1123|       |
 1124|  2.42M|  ptr_buf2 = ptr_fft3_out;
 1125|  2.42M|  ptr_buf1 = ptr_buf3 = ptr_fft3_out;
 1126|       |
 1127|  9.70M|  for (i = 0; i < FFT3; i++) {
  ------------------
  |  |   50|  9.70M|#define FFT3 (3)
  ------------------
  |  Branch (1127:15): [True: 7.27M, False: 2.42M]
  ------------------
 1128|  7.27M|    *ptr_buf1++ = ptr_inp[0 + 64 * i];
 1129|  7.27M|    *ptr_buf1++ = ptr_inp[1 + 64 * i];
 1130|       |
 1131|  7.27M|    *ptr_buf1++ = ptr_inp[192 + 64 * i];
 1132|  7.27M|    *ptr_buf1++ = ptr_inp[193 + 64 * i];
 1133|       |
 1134|  7.27M|    *ptr_buf1++ = ptr_inp[384 + 64 * i];
 1135|  7.27M|    *ptr_buf1++ = ptr_inp[385 + 64 * i];
 1136|       |
 1137|  7.27M|    *ptr_buf1++ = ptr_inp[576 + 64 * i];
 1138|  7.27M|    *ptr_buf1++ = ptr_inp[577 + 64 * i];
 1139|       |
 1140|  7.27M|    *ptr_buf1++ = ptr_inp[768 + 64 * i];
 1141|  7.27M|    *ptr_buf1++ = ptr_inp[769 + 64 * i];
 1142|       |
 1143|  7.27M|    r1 = ptr_buf3[2] + ptr_buf3[8];
 1144|  7.27M|    r4 = ptr_buf3[2] - ptr_buf3[8];
 1145|  7.27M|    r3 = ptr_buf3[4] + ptr_buf3[6];
 1146|  7.27M|    r2 = ptr_buf3[4] - ptr_buf3[6];
 1147|  7.27M|    t = ((r1 - r3) * c54_flt);
 1148|       |
 1149|  7.27M|    r1 = r1 + r3;
 1150|       |
 1151|  7.27M|    temp1 = ptr_buf3[0] + r1;
 1152|       |
 1153|  7.27M|    r1 = temp1 + ((r1 * c55_flt) * 2);
 1154|       |
 1155|  7.27M|    r3 = r1 - t;
 1156|  7.27M|    r1 = r1 + t;
 1157|       |
 1158|  7.27M|    t = ((r4 + r2) * c51_flt);
 1159|  7.27M|    r4 = t + ((r4 * c52_flt) * 2);
 1160|  7.27M|    r2 = t + (r2 * c53_flt);
 1161|       |
 1162|  7.27M|    s1 = ptr_buf3[3] + ptr_buf3[9];
 1163|  7.27M|    s4 = ptr_buf3[3] - ptr_buf3[9];
 1164|  7.27M|    s3 = ptr_buf3[5] + ptr_buf3[7];
 1165|  7.27M|    s2 = ptr_buf3[5] - ptr_buf3[7];
 1166|       |
 1167|  7.27M|    t = ((s1 - s3) * c54_flt);
 1168|       |
 1169|  7.27M|    s1 = s1 + s3;
 1170|       |
 1171|  7.27M|    temp2 = ptr_buf3[1] + s1;
 1172|       |
 1173|  7.27M|    s1 = temp2 + (((s1 * c55_flt)) * 2);
 1174|       |
 1175|  7.27M|    s3 = s1 - t;
 1176|  7.27M|    s1 = s1 + t;
 1177|       |
 1178|  7.27M|    t = ((s4 + s2) * c51_flt);
 1179|  7.27M|    s4 = t + (((s4 * c52_flt)) * 2);
 1180|  7.27M|    s2 = t + ((s2 * c53_flt));
 1181|       |
 1182|  7.27M|    *ptr_buf2++ = temp1;
 1183|  7.27M|    *ptr_buf2++ = temp2;
 1184|  7.27M|    *ptr_buf2++ = r1 + s2;
 1185|  7.27M|    *ptr_buf2++ = s1 - r2;
 1186|  7.27M|    *ptr_buf2++ = r3 - s4;
 1187|  7.27M|    *ptr_buf2++ = s3 + r4;
 1188|  7.27M|    *ptr_buf2++ = r3 + s4;
 1189|  7.27M|    *ptr_buf2++ = s3 - r4;
 1190|  7.27M|    *ptr_buf2++ = r1 - s2;
 1191|  7.27M|    *ptr_buf2++ = s1 + r2;
 1192|  7.27M|    ptr_buf3 = ptr_buf1;
 1193|  7.27M|  }
 1194|       |
 1195|  2.42M|  idx = 0;
 1196|  2.42M|  ixheaace_cfft_15_twiddle(ptr_out_fft3);
 1197|       |
 1198|  14.5M|  for (i = 0; i < FFT5; i++) {
  ------------------
  |  |   46|  14.5M|#define FFT5 (5)
  ------------------
  |  Branch (1198:15): [True: 12.1M, False: 2.42M]
  ------------------
 1199|  12.1M|    xr_0 = ptr_out_fft3[0];
 1200|  12.1M|    xi_0 = ptr_out_fft3[1];
 1201|       |
 1202|  12.1M|    xr_1 = ptr_out_fft3[10];
 1203|  12.1M|    xi_1 = ptr_out_fft3[11];
 1204|       |
 1205|  12.1M|    xr_2 = ptr_out_fft3[20];
 1206|  12.1M|    xi_2 = ptr_out_fft3[21];
 1207|       |
 1208|  12.1M|    x_01_r = (xr_0 + xr_1);
 1209|  12.1M|    x_01_i = (xi_0 + xi_1);
 1210|       |
 1211|  12.1M|    add_r = (xr_1 + xr_2);
 1212|  12.1M|    add_i = (xi_1 + xi_2);
 1213|       |
 1214|  12.1M|    sub_r = (xr_1 - xr_2);
 1215|  12.1M|    sub_i = (xi_1 - xi_2);
 1216|       |
 1217|  12.1M|    p1 = add_r / 2;
 1218|       |
 1219|  12.1M|    p2 = (sub_i * sin_mu_flt);
 1220|  12.1M|    p3 = (sub_r * sin_mu_flt);
 1221|       |
 1222|  12.1M|    p4 = add_i / 2;
 1223|       |
 1224|  12.1M|    temp = (xr_0 - p1);
 1225|  12.1M|    temp1 = (xi_0 + p3);
 1226|  12.1M|    temp2 = (xi_0 - p3);
 1227|       |
 1228|  12.1M|    ptr_op[idx] = (x_01_r + xr_2);
 1229|  12.1M|    ptr_op[idx + 1] = (x_01_i + xi_2);
 1230|       |
 1231|  12.1M|    idx = idx + 320;
 1232|  12.1M|    ptr_op[idx] = (temp + p2);
 1233|  12.1M|    ptr_op[idx + 1] = (temp2 - p4);
 1234|       |
 1235|  12.1M|    idx = idx + 320;
 1236|  12.1M|    ptr_op[idx] = (temp - p2);
 1237|  12.1M|    ptr_op[idx + 1] = (temp1 - p4);
 1238|  12.1M|    ptr_out_fft3 += 2;
 1239|  12.1M|    idx = idx - 576;
 1240|  12.1M|  }
 1241|  2.42M|}
ixheaace_fft.c:ixheaace_cfft_15_twiddle:
 1082|  2.42M|static VOID ixheaace_cfft_15_twiddle(FLOAT32 *ptr_inp) {
 1083|  2.42M|  const FLOAT32 *ptr_tw_flt = &ixheaace_mix_rad_twid_tbl[0];
 1084|  2.42M|  const FLOAT32 *ptr_tw_flt_h = &ixheaace_mix_rad_twid_tbl_h[0];
 1085|  2.42M|  FLOAT32 accu1, accu2;
 1086|  2.42M|  WORD32 i, j;
 1087|  2.42M|  ptr_inp += 12;
 1088|       |
 1089|  7.27M|  for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (1089:15): [True: 4.85M, False: 2.42M]
  ------------------
 1090|  24.2M|    for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (1090:17): [True: 19.4M, False: 4.85M]
  ------------------
 1091|  19.4M|      ixheaace_cplx_mult_twid(&accu1, &accu2, ptr_inp[2 * i + 0], ptr_inp[2 * i + 1],
 1092|  19.4M|                              ptr_tw_flt[i], ptr_tw_flt_h[i]);
 1093|  19.4M|      ptr_inp[2 * i + 0] = accu1;
 1094|  19.4M|      ptr_inp[2 * i + 1] = accu2;
 1095|  19.4M|    }
 1096|  4.85M|    ptr_inp += 10;
 1097|  4.85M|    ptr_tw_flt += 4;
 1098|  4.85M|    ptr_tw_flt_h += 4;
 1099|  4.85M|  }
 1100|  2.42M|}
ixheaace_fft.c:ixheaace_cplx_mult_twid:
 1077|  52.3M|                                    FLOAT32 twid_table, FLOAT32 twid_table_h) {
 1078|  52.3M|  *ptr_re = (a * twid_table) - (b * twid_table_h);
 1079|  52.3M|  *ptr_im = (a * twid_table_h) + (b * twid_table);
 1080|  52.3M|}
ixheaace_fft.c:ixheaace_cfft_twiddle_mult:
 1245|  75.8k|                                       const FLOAT32 *ptr_tw_h_flt) {
 1246|  75.8k|  FLOAT32 accu1, accu2;
 1247|  75.8k|  WORD32 i, j;
 1248|  75.8k|  WORD32 step_val = (dim2 - 1) << 1;
 1249|  2.50M|  for (i = 0; i < dim2; i++) {
  ------------------
  |  Branch (1249:15): [True: 2.42M, False: 75.8k]
  ------------------
 1250|  2.42M|    ptr_op[0] = ptr_inp[0];
 1251|  2.42M|    ptr_op[1] = ptr_inp[1];
 1252|  2.42M|    ptr_op += 2;
 1253|  2.42M|    ptr_inp += 2;
 1254|  2.42M|  }
 1255|       |
 1256|  1.13M|  for (j = 0; j < (dim1 - 1); j++) {
  ------------------
  |  Branch (1256:15): [True: 1.06M, False: 75.8k]
  ------------------
 1257|  1.06M|    ptr_op[0] = ptr_inp[0];
 1258|  1.06M|    ptr_op[1] = ptr_inp[1];
 1259|  1.06M|    ptr_inp += 2;
 1260|  1.06M|    ptr_op += 2;
 1261|  33.9M|    for (i = 0; i < (dim2 - 1); i++) {
  ------------------
  |  Branch (1261:17): [True: 32.8M, False: 1.06M]
  ------------------
 1262|  32.8M|      ixheaace_cplx_mult_twid(&accu1, &accu2, ptr_inp[2 * i + 0], ptr_inp[2 * i + 1],
 1263|  32.8M|                              ptr_tw_flt[i], ptr_tw_h_flt[i]);
 1264|  32.8M|      ptr_op[2 * i + 0] = accu1;
 1265|  32.8M|      ptr_op[2 * i + 1] = accu2;
 1266|  32.8M|    }
 1267|  1.06M|    ptr_inp += step_val;
 1268|  1.06M|    ptr_op += step_val;
 1269|  1.06M|    ptr_tw_flt += (dim2 - 1);
 1270|  1.06M|    ptr_tw_h_flt += (dim2 - 1);
 1271|  1.06M|  }
 1272|  75.8k|}
ixheaace_fft.c:ixheaace_cfft_32_480:
 1274|  1.13M|static VOID ixheaace_cfft_32_480(FLOAT32 *ptr_in, FLOAT32 *ptr_out) {
 1275|  1.13M|  WORD32 i, l1, l2, h2;
 1276|  1.13M|  FLOAT32 xh0_0, xh1_0, xl0_0, xl1_0;
 1277|  1.13M|  FLOAT32 xh0_1, xh1_1, xl0_1, xl1_1;
 1278|  1.13M|  FLOAT32 x_0, x_1, x_2, x_3;
 1279|  1.13M|  FLOAT32 x_4, x_5, x_6, x_7;
 1280|  1.13M|  FLOAT32 *ptr_x;
 1281|  1.13M|  FLOAT32 *ptr_y;
 1282|  1.13M|  FLOAT32 interm_y[FFT32X2];
 1283|  1.13M|  FLOAT32 n00, n10, n20, n30, n01, n11, n21, n31;
 1284|       |
 1285|  1.13M|  FLOAT32 inp_0qi, inp_0qr;
 1286|  1.13M|  FLOAT32 inp_1qi, inp_1qr;
 1287|  1.13M|  FLOAT32 inp_2qi, inp_2qr;
 1288|  1.13M|  FLOAT32 inp_3qi, inp_3qr;
 1289|  1.13M|  FLOAT32 mul_0qi, mul_0qr;
 1290|  1.13M|  FLOAT32 mul_1qi, mul_1qr;
 1291|  1.13M|  FLOAT32 mul_2qi, mul_2qr;
 1292|  1.13M|  FLOAT32 mul_3qi, mul_3qr;
 1293|  1.13M|  FLOAT32 sum_0qi, sum_0qr;
 1294|  1.13M|  FLOAT32 sum_1qi, sum_1qr;
 1295|  1.13M|  FLOAT32 sum_2qi, sum_2qr;
 1296|  1.13M|  FLOAT32 sum_3qi, sum_3qr;
 1297|  1.13M|  WORD32 idx1 = 0, idx2 = FFT15 * FFT32;
  ------------------
  |  |   51|  1.13M|#define FFT15 (15)
  ------------------
                WORD32 idx1 = 0, idx2 = FFT15 * FFT32;
  ------------------
  |  |   53|  1.13M|#define FFT32 (32)
  ------------------
 1298|  1.13M|  FLOAT32 mul_i, mul_r;
 1299|       |
 1300|  1.13M|  ptr_x = ptr_in;
 1301|       |
 1302|       |  // This computes first and second stage butterflies. So, 4-point FFT is done.
 1303|  10.2M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (1303:15): [True: 9.09M, False: 1.13M]
  ------------------
 1304|  9.09M|    x_0 = ptr_x[0];
 1305|  9.09M|    x_1 = ptr_x[1];
 1306|  9.09M|    x_2 = ptr_x[16];
 1307|  9.09M|    x_3 = ptr_x[16 + 1];
 1308|  9.09M|    x_4 = ptr_x[32];
 1309|  9.09M|    x_5 = ptr_x[32 + 1];
 1310|  9.09M|    x_6 = ptr_x[48];
 1311|  9.09M|    x_7 = ptr_x[48 + 1];
 1312|       |
 1313|  9.09M|    xh0_0 = x_0 + x_4;
 1314|  9.09M|    xh1_0 = x_1 + x_5;
 1315|  9.09M|    xl0_0 = x_0 - x_4;
 1316|  9.09M|    xl1_0 = x_1 - x_5;
 1317|  9.09M|    xh0_1 = x_2 + x_6;
 1318|  9.09M|    xh1_1 = x_3 + x_7;
 1319|  9.09M|    xl0_1 = x_2 - x_6;
 1320|  9.09M|    xl1_1 = x_3 - x_7;
 1321|       |
 1322|  9.09M|    n00 = xh0_0 + xh0_1;
 1323|  9.09M|    n01 = xh1_0 + xh1_1;
 1324|  9.09M|    n10 = xl0_0 + xl1_1;
 1325|  9.09M|    n11 = xl1_0 - xl0_1;
 1326|  9.09M|    n20 = xh0_0 - xh0_1;
 1327|  9.09M|    n21 = xh1_0 - xh1_1;
 1328|  9.09M|    n30 = xl0_0 - xl1_1;
 1329|  9.09M|    n31 = xl1_0 + xl0_1;
 1330|       |
 1331|  9.09M|    ptr_x[0] = n00;
 1332|  9.09M|    ptr_x[1] = n01;
 1333|  9.09M|    ptr_x[16] = n10;
 1334|  9.09M|    ptr_x[16 + 1] = n11;
 1335|  9.09M|    ptr_x[32] = n20;
 1336|  9.09M|    ptr_x[32 + 1] = n21;
 1337|  9.09M|    ptr_x[48] = n30;
 1338|  9.09M|    ptr_x[48 + 1] = n31;
 1339|       |
 1340|  9.09M|    ptr_x += 2;
 1341|  9.09M|  }
 1342|       |
 1343|       |  // This computes third and fourth stage butterflies. So, next 4-point FFT is done.
 1344|  1.13M|  {
 1345|  1.13M|    h2 = 16 >> 1;
 1346|  1.13M|    l1 = 16;
 1347|  1.13M|    l2 = 16 + (16 >> 1);
 1348|       |
 1349|  1.13M|    ptr_x = ptr_in;
 1350|  1.13M|    ptr_y = &interm_y[0];
 1351|       |
 1352|       |    /* Butter fly summation in 2 steps */
 1353|  1.13M|    inp_0qr = ptr_x[0];
 1354|  1.13M|    inp_0qi = ptr_x[1];
 1355|  1.13M|    inp_1qr = ptr_x[4];
 1356|  1.13M|    inp_1qi = ptr_x[5];
 1357|  1.13M|    inp_2qr = ptr_x[8];
 1358|  1.13M|    inp_2qi = ptr_x[9];
 1359|  1.13M|    inp_3qr = ptr_x[12];
 1360|  1.13M|    inp_3qi = ptr_x[13];
 1361|       |
 1362|  1.13M|    mul_0qr = inp_0qr;
 1363|  1.13M|    mul_0qi = inp_0qi;
 1364|  1.13M|    mul_1qr = inp_1qr;
 1365|  1.13M|    mul_1qi = inp_1qi;
 1366|  1.13M|    mul_2qr = inp_2qr;
 1367|  1.13M|    mul_2qi = inp_2qi;
 1368|  1.13M|    mul_3qr = inp_3qr;
 1369|  1.13M|    mul_3qi = inp_3qi;
 1370|       |
 1371|  1.13M|    sum_0qr = mul_0qr + mul_2qr;
 1372|  1.13M|    sum_0qi = mul_0qi + mul_2qi;
 1373|  1.13M|    sum_1qr = mul_0qr - mul_2qr;
 1374|  1.13M|    sum_1qi = mul_0qi - mul_2qi;
 1375|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1376|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1377|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1378|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1379|       |
 1380|  1.13M|    ptr_y[0] = sum_0qr + sum_2qr;
 1381|  1.13M|    ptr_y[1] = sum_0qi + sum_2qi;
 1382|  1.13M|    ptr_y[h2] = sum_1qr + sum_3qi;
 1383|  1.13M|    ptr_y[h2 + 1] = sum_1qi - sum_3qr;
 1384|  1.13M|    ptr_y[l1] = sum_0qr - sum_2qr;
 1385|  1.13M|    ptr_y[l1 + 1] = sum_0qi - sum_2qi;
 1386|  1.13M|    ptr_y[l2] = sum_1qr - sum_3qi;
 1387|  1.13M|    ptr_y[l2 + 1] = sum_1qi + sum_3qr;
 1388|       |
 1389|  1.13M|    ptr_y += 2;
 1390|  1.13M|    ptr_x += 16;
 1391|       |
 1392|       |    /* 2nd butter fly */
 1393|       |
 1394|  1.13M|    inp_0qr = ptr_x[0];
 1395|  1.13M|    inp_0qi = ptr_x[1];
 1396|  1.13M|    inp_1qr = ptr_x[4];
 1397|  1.13M|    inp_1qi = ptr_x[5];
 1398|  1.13M|    inp_2qr = ptr_x[8];
 1399|  1.13M|    inp_2qi = ptr_x[9];
 1400|  1.13M|    inp_3qr = ptr_x[12];
 1401|  1.13M|    inp_3qi = ptr_x[13];
 1402|       |
 1403|  1.13M|    mul_0qr = inp_0qr;
 1404|  1.13M|    mul_0qi = inp_0qi;
 1405|       |
 1406|  1.13M|    mul_1qr = (inp_1qr * 0.461929321f) + (inp_1qi * 0.191329956f);
 1407|  1.13M|    mul_1qi = (inp_1qr * -0.191329956f) + (inp_1qi * 0.461929321f);
 1408|       |
 1409|  1.13M|    mul_2qr = ((inp_2qr + inp_2qi) * 0.353546143f);
 1410|  1.13M|    mul_2qi = ((-inp_2qr + inp_2qi) * 0.353546143f);
 1411|       |
 1412|  1.13M|    mul_3qr = (inp_3qr * 0.191329956f) + (inp_3qi * 0.461929321f);
 1413|  1.13M|    mul_3qi = (inp_3qr * -0.461929321f) + (inp_3qi * 0.191329956f);
 1414|       |
 1415|  1.13M|    sum_0qr = mul_0qr + (mul_2qr * 2);
 1416|  1.13M|    sum_0qi = mul_0qi + (mul_2qi * 2);
 1417|  1.13M|    sum_1qr = mul_0qr - (mul_2qr * 2);
 1418|  1.13M|    sum_1qi = mul_0qi - (mul_2qi * 2);
 1419|       |
 1420|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1421|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1422|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1423|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1424|       |
 1425|  1.13M|    ptr_y[0] = sum_0qr + (sum_2qr * 2);
 1426|  1.13M|    ptr_y[1] = sum_0qi + (sum_2qi * 2);
 1427|  1.13M|    ptr_y[h2] = sum_1qr + (sum_3qi * 2);
 1428|  1.13M|    ptr_y[h2 + 1] = sum_1qi - (sum_3qr * 2);
 1429|  1.13M|    ptr_y[l1] = sum_0qr - (sum_2qr * 2);
 1430|  1.13M|    ptr_y[l1 + 1] = sum_0qi - (sum_2qi * 2);
 1431|  1.13M|    ptr_y[l2] = sum_1qr - (sum_3qi * 2);
 1432|  1.13M|    ptr_y[l2 + 1] = sum_1qi + (sum_3qr * 2);
 1433|       |
 1434|  1.13M|    ptr_y += 2;
 1435|  1.13M|    ptr_x += 16;
 1436|       |
 1437|       |    /* 3rd butter fly */
 1438|       |
 1439|  1.13M|    inp_0qr = ptr_x[0];
 1440|  1.13M|    inp_0qi = ptr_x[1];
 1441|  1.13M|    inp_1qr = ptr_x[4];
 1442|  1.13M|    inp_1qi = ptr_x[5];
 1443|  1.13M|    inp_2qr = ptr_x[8];
 1444|  1.13M|    inp_2qi = ptr_x[9];
 1445|  1.13M|    inp_3qr = ptr_x[12];
 1446|  1.13M|    inp_3qi = ptr_x[13];
 1447|       |
 1448|  1.13M|    mul_0qr = inp_0qr;
 1449|  1.13M|    mul_0qi = inp_0qi;
 1450|       |
 1451|  1.13M|    mul_1qr = ((inp_1qr + inp_1qi) * 0.353546143f);
 1452|  1.13M|    mul_1qi = ((-inp_1qr + inp_1qi) * 0.353546143f);
 1453|       |
 1454|  1.13M|    mul_2qr = inp_2qi;
 1455|  1.13M|    mul_2qi = inp_2qr;
 1456|       |
 1457|  1.13M|    mul_3qr = ((-inp_3qr + inp_3qi) * 0.353546143f);
 1458|  1.13M|    mul_3qi = ((inp_3qr + inp_3qi) * -0.353546143f);
 1459|       |
 1460|  1.13M|    sum_0qr = mul_0qr + mul_2qr;
 1461|  1.13M|    sum_0qi = mul_0qi - mul_2qi;
 1462|  1.13M|    sum_1qr = mul_0qr - mul_2qr;
 1463|  1.13M|    sum_1qi = mul_0qi + mul_2qi;
 1464|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1465|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1466|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1467|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1468|       |
 1469|  1.13M|    ptr_y[0] = sum_0qr + (sum_2qr * 2);
 1470|  1.13M|    ptr_y[1] = sum_0qi + (sum_2qi * 2);
 1471|  1.13M|    ptr_y[h2] = sum_1qr + (sum_3qi * 2);
 1472|  1.13M|    ptr_y[h2 + 1] = sum_1qi - (sum_3qr * 2);
 1473|  1.13M|    ptr_y[l1] = sum_0qr - (sum_2qr * 2);
 1474|  1.13M|    ptr_y[l1 + 1] = sum_0qi - (sum_2qi * 2);
 1475|  1.13M|    ptr_y[l2] = sum_1qr - (sum_3qi * 2);
 1476|  1.13M|    ptr_y[l2 + 1] = sum_1qi + (sum_3qr * 2);
 1477|       |
 1478|  1.13M|    ptr_y += 2;
 1479|  1.13M|    ptr_x += 16;
 1480|       |
 1481|       |    /* 4th butter fly */
 1482|       |
 1483|  1.13M|    inp_0qr = ptr_x[0];
 1484|  1.13M|    inp_0qi = ptr_x[1];
 1485|  1.13M|    inp_1qr = ptr_x[4];
 1486|  1.13M|    inp_1qi = ptr_x[5];
 1487|  1.13M|    inp_2qr = ptr_x[8];
 1488|  1.13M|    inp_2qi = ptr_x[9];
 1489|  1.13M|    inp_3qr = ptr_x[12];
 1490|  1.13M|    inp_3qi = ptr_x[13];
 1491|       |
 1492|  1.13M|    mul_0qr = inp_0qr;
 1493|  1.13M|    mul_0qi = inp_0qi;
 1494|       |
 1495|  1.13M|    mul_1qr = (inp_1qr * 0.191329956f) + (inp_1qi * 0.461929321f);
 1496|  1.13M|    mul_1qi = (inp_1qr * -0.461929321f) + (inp_1qi * 0.191329956f);
 1497|       |
 1498|  1.13M|    mul_2qr = ((-inp_2qr + inp_2qi) * 0.353546143f);
 1499|  1.13M|    mul_2qi = ((inp_2qr + inp_2qi) * -0.353546143f);
 1500|       |
 1501|  1.13M|    mul_3qr = (inp_3qr * -0.461929321f) + (inp_3qi * -0.191329956f);
 1502|  1.13M|    mul_3qi = (inp_3qr * 0.191329956f) + (inp_3qi * -0.461929321f);
 1503|       |
 1504|  1.13M|    sum_0qr = mul_0qr + (mul_2qr * 2);
 1505|  1.13M|    sum_0qi = mul_0qi + (mul_2qi * 2);
 1506|  1.13M|    sum_1qr = mul_0qr - (mul_2qr * 2);
 1507|  1.13M|    sum_1qi = mul_0qi - (mul_2qi * 2);
 1508|       |
 1509|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1510|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1511|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1512|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1513|       |
 1514|  1.13M|    ptr_y[0] = sum_0qr + (sum_2qr * 2);
 1515|  1.13M|    ptr_y[1] = sum_0qi + (sum_2qi * 2);
 1516|  1.13M|    ptr_y[h2] = sum_1qr + (sum_3qi * 2);
 1517|  1.13M|    ptr_y[h2 + 1] = sum_1qi - (sum_3qr * 2);
 1518|  1.13M|    ptr_y[l1] = sum_0qr - (sum_2qr * 2);
 1519|  1.13M|    ptr_y[l1 + 1] = sum_0qi - (sum_2qi * 2);
 1520|  1.13M|    ptr_y[l2] = sum_1qr - (sum_3qi * 2);
 1521|  1.13M|    ptr_y[l2 + 1] = sum_1qi + (sum_3qr * 2);
 1522|       |
 1523|  1.13M|    ptr_x = ptr_in;
 1524|  1.13M|    ptr_y = &interm_y[32];
 1525|       |
 1526|       |    /* Butter fly summation in 2 steps */
 1527|  1.13M|    inp_0qr = ptr_x[2];
 1528|  1.13M|    inp_0qi = ptr_x[3];
 1529|  1.13M|    inp_1qr = ptr_x[6];
 1530|  1.13M|    inp_1qi = ptr_x[7];
 1531|  1.13M|    inp_2qr = ptr_x[10];
 1532|  1.13M|    inp_2qi = ptr_x[11];
 1533|  1.13M|    inp_3qr = ptr_x[14];
 1534|  1.13M|    inp_3qi = ptr_x[15];
 1535|       |
 1536|  1.13M|    mul_0qr = inp_0qr;
 1537|  1.13M|    mul_0qi = inp_0qi;
 1538|  1.13M|    mul_1qr = inp_1qr;
 1539|  1.13M|    mul_1qi = inp_1qi;
 1540|  1.13M|    mul_2qr = inp_2qr;
 1541|  1.13M|    mul_2qi = inp_2qi;
 1542|  1.13M|    mul_3qr = inp_3qr;
 1543|  1.13M|    mul_3qi = inp_3qi;
 1544|       |
 1545|  1.13M|    sum_0qr = mul_0qr + mul_2qr;
 1546|  1.13M|    sum_0qi = mul_0qi + mul_2qi;
 1547|  1.13M|    sum_1qr = mul_0qr - mul_2qr;
 1548|  1.13M|    sum_1qi = mul_0qi - mul_2qi;
 1549|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1550|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1551|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1552|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1553|       |
 1554|  1.13M|    ptr_y[0] = sum_0qr + sum_2qr;
 1555|  1.13M|    ptr_y[1] = sum_0qi + sum_2qi;
 1556|  1.13M|    ptr_y[h2] = sum_1qr + sum_3qi;
 1557|  1.13M|    ptr_y[h2 + 1] = sum_1qi - sum_3qr;
 1558|  1.13M|    ptr_y[l1] = sum_0qr - sum_2qr;
 1559|  1.13M|    ptr_y[l1 + 1] = sum_0qi - sum_2qi;
 1560|  1.13M|    ptr_y[l2] = sum_1qr - sum_3qi;
 1561|  1.13M|    ptr_y[l2 + 1] = sum_1qi + sum_3qr;
 1562|       |
 1563|  1.13M|    ptr_y += 2;
 1564|  1.13M|    ptr_x += 16;
 1565|       |
 1566|       |    /* 2nd butter fly */
 1567|       |
 1568|  1.13M|    inp_0qr = ptr_x[2];
 1569|  1.13M|    inp_0qi = ptr_x[3];
 1570|  1.13M|    inp_1qr = ptr_x[6];
 1571|  1.13M|    inp_1qi = ptr_x[7];
 1572|  1.13M|    inp_2qr = ptr_x[10];
 1573|  1.13M|    inp_2qi = ptr_x[11];
 1574|  1.13M|    inp_3qr = ptr_x[14];
 1575|  1.13M|    inp_3qi = ptr_x[15];
 1576|       |
 1577|  1.13M|    mul_0qr = inp_0qr;
 1578|  1.13M|    mul_0qi = inp_0qi;
 1579|       |
 1580|  1.13M|    mul_1qr = (inp_1qr * 0.461929321f) + (inp_1qi * 0.191329956f);
 1581|  1.13M|    mul_1qi = (inp_1qr * -0.191329956f) + (inp_1qi * 0.461929321f);
 1582|       |
 1583|  1.13M|    mul_2qr = ((inp_2qr + inp_2qi) * 0.353546143f);
 1584|  1.13M|    mul_2qi = ((-inp_2qr + inp_2qi) * 0.353546143f);
 1585|       |
 1586|  1.13M|    mul_3qr = (inp_3qr * 0.191329956f) + (inp_3qi * 0.461929321f);
 1587|  1.13M|    mul_3qi = (inp_3qr * -0.461929321f) + (inp_3qi * 0.191329956f);
 1588|       |
 1589|  1.13M|    sum_0qr = mul_0qr + (mul_2qr * 2);
 1590|  1.13M|    sum_0qi = mul_0qi + (mul_2qi * 2);
 1591|  1.13M|    sum_1qr = mul_0qr - (mul_2qr * 2);
 1592|  1.13M|    sum_1qi = mul_0qi - (mul_2qi * 2);
 1593|       |
 1594|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1595|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1596|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1597|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1598|       |
 1599|  1.13M|    ptr_y[0] = sum_0qr + (sum_2qr * 2);
 1600|  1.13M|    ptr_y[1] = sum_0qi + (sum_2qi * 2);
 1601|  1.13M|    ptr_y[h2] = sum_1qr + (sum_3qi * 2);
 1602|  1.13M|    ptr_y[h2 + 1] = sum_1qi - (sum_3qr * 2);
 1603|  1.13M|    ptr_y[l1] = sum_0qr - (sum_2qr * 2);
 1604|  1.13M|    ptr_y[l1 + 1] = sum_0qi - (sum_2qi * 2);
 1605|  1.13M|    ptr_y[l2] = sum_1qr - (sum_3qi * 2);
 1606|  1.13M|    ptr_y[l2 + 1] = sum_1qi + (sum_3qr * 2);
 1607|       |
 1608|  1.13M|    ptr_y += 2;
 1609|  1.13M|    ptr_x += 16;
 1610|       |
 1611|       |    /* 3rd butter fly */
 1612|       |
 1613|  1.13M|    inp_0qr = ptr_x[2];
 1614|  1.13M|    inp_0qi = ptr_x[3];
 1615|  1.13M|    inp_1qr = ptr_x[6];
 1616|  1.13M|    inp_1qi = ptr_x[7];
 1617|  1.13M|    inp_2qr = ptr_x[10];
 1618|  1.13M|    inp_2qi = ptr_x[11];
 1619|  1.13M|    inp_3qr = ptr_x[14];
 1620|  1.13M|    inp_3qi = ptr_x[15];
 1621|       |
 1622|  1.13M|    mul_0qr = inp_0qr;
 1623|  1.13M|    mul_0qi = inp_0qi;
 1624|       |
 1625|  1.13M|    mul_1qr = ((inp_1qr + inp_1qi) * 0.353546143f);
 1626|  1.13M|    mul_1qi = ((-inp_1qr + inp_1qi) * 0.353546143f);
 1627|       |
 1628|  1.13M|    mul_2qr = inp_2qi;
 1629|  1.13M|    mul_2qi = inp_2qr;
 1630|       |
 1631|  1.13M|    mul_3qr = ((-inp_3qr + inp_3qi) * 0.353546143f);
 1632|  1.13M|    mul_3qi = ((inp_3qr + inp_3qi) * -0.353546143f);
 1633|       |
 1634|  1.13M|    sum_0qr = mul_0qr + mul_2qr;
 1635|  1.13M|    sum_0qi = mul_0qi - mul_2qi;
 1636|  1.13M|    sum_1qr = mul_0qr - mul_2qr;
 1637|  1.13M|    sum_1qi = mul_0qi + mul_2qi;
 1638|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1639|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1640|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1641|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1642|       |
 1643|  1.13M|    ptr_y[0] = sum_0qr + (sum_2qr * 2);
 1644|  1.13M|    ptr_y[1] = sum_0qi + (sum_2qi * 2);
 1645|  1.13M|    ptr_y[h2] = sum_1qr + (sum_3qi * 2);
 1646|  1.13M|    ptr_y[h2 + 1] = sum_1qi - (sum_3qr * 2);
 1647|  1.13M|    ptr_y[l1] = sum_0qr - (sum_2qr * 2);
 1648|  1.13M|    ptr_y[l1 + 1] = sum_0qi - (sum_2qi * 2);
 1649|  1.13M|    ptr_y[l2] = sum_1qr - (sum_3qi * 2);
 1650|  1.13M|    ptr_y[l2 + 1] = sum_1qi + (sum_3qr * 2);
 1651|       |
 1652|  1.13M|    ptr_y += 2;
 1653|  1.13M|    ptr_x += 16;
 1654|       |
 1655|       |    /* 4th butter fly */
 1656|       |
 1657|  1.13M|    inp_0qr = ptr_x[2];
 1658|  1.13M|    inp_0qi = ptr_x[3];
 1659|  1.13M|    inp_1qr = ptr_x[6];
 1660|  1.13M|    inp_1qi = ptr_x[7];
 1661|  1.13M|    inp_2qr = ptr_x[10];
 1662|  1.13M|    inp_2qi = ptr_x[11];
 1663|  1.13M|    inp_3qr = ptr_x[14];
 1664|  1.13M|    inp_3qi = ptr_x[15];
 1665|       |
 1666|  1.13M|    mul_0qr = inp_0qr;
 1667|  1.13M|    mul_0qi = inp_0qi;
 1668|       |
 1669|  1.13M|    mul_1qr = (inp_1qr * 0.191329956f) + (inp_1qi * 0.461929321f);
 1670|  1.13M|    mul_1qi = (inp_1qr * -0.461929321f) + (inp_1qi * 0.191329956f);
 1671|       |
 1672|  1.13M|    mul_2qr = ((-inp_2qr + inp_2qi) * 0.353546143f);
 1673|  1.13M|    mul_2qi = ((inp_2qr + inp_2qi) * -0.353546143f);
 1674|       |
 1675|  1.13M|    mul_3qr = (inp_3qr * -0.461929321f) + (inp_3qi * -0.191329956f);
 1676|  1.13M|    mul_3qi = (inp_3qr * 0.191329956f) + (inp_3qi * -0.461929321f);
 1677|       |
 1678|  1.13M|    sum_0qr = mul_0qr + (mul_2qr * 2);
 1679|  1.13M|    sum_0qi = mul_0qi + (mul_2qi * 2);
 1680|  1.13M|    sum_1qr = mul_0qr - (mul_2qr * 2);
 1681|  1.13M|    sum_1qi = mul_0qi - (mul_2qi * 2);
 1682|       |
 1683|  1.13M|    sum_2qr = mul_1qr + mul_3qr;
 1684|  1.13M|    sum_2qi = mul_1qi + mul_3qi;
 1685|  1.13M|    sum_3qr = mul_1qr - mul_3qr;
 1686|  1.13M|    sum_3qi = mul_1qi - mul_3qi;
 1687|       |
 1688|  1.13M|    ptr_y[0] = sum_0qr + (sum_2qr * 2);
 1689|  1.13M|    ptr_y[1] = sum_0qi + (sum_2qi * 2);
 1690|  1.13M|    ptr_y[h2] = sum_1qr + (sum_3qi * 2);
 1691|  1.13M|    ptr_y[h2 + 1] = sum_1qi - (sum_3qr * 2);
 1692|  1.13M|    ptr_y[l1] = sum_0qr - (sum_2qr * 2);
 1693|  1.13M|    ptr_y[l1 + 1] = sum_0qi - (sum_2qi * 2);
 1694|  1.13M|    ptr_y[l2] = sum_1qr - (sum_3qi * 2);
 1695|  1.13M|    ptr_y[l2 + 1] = sum_1qi + (sum_3qr * 2);
 1696|  1.13M|  }
 1697|       |
 1698|       |  // Last stage of 32 point FFT
 1699|  1.13M|  {
 1700|  1.13M|    ptr_y = ptr_out;
 1701|  1.13M|    ptr_y[idx1] = interm_y[0] + interm_y[32];
 1702|  1.13M|    ptr_y[idx1 + 1] = interm_y[1] + interm_y[33];
 1703|  1.13M|    ptr_y[idx2] = interm_y[0] - interm_y[32];
 1704|  1.13M|    ptr_y[idx2 + 1] = interm_y[1] - interm_y[33];
 1705|  1.13M|    idx1 += FFT15X2;
  ------------------
  |  |   52|  1.13M|#define FFT15X2 (30)
  ------------------
 1706|  1.13M|    idx2 += FFT15X2;
  ------------------
  |  |   52|  1.13M|#define FFT15X2 (30)
  ------------------
 1707|  18.1M|    for (i = 1; i < FFT16; i++) {
  ------------------
  |  |   48|  18.1M|#define FFT16 (16)
  ------------------
  |  Branch (1707:17): [True: 17.0M, False: 1.13M]
  ------------------
 1708|  17.0M|      mul_r = (interm_y[FFT32 + 2 * i + 0] * ixheaace_fft_mix_rad_twid_tbl_32[i - 1]) -
  ------------------
  |  |   53|  17.0M|#define FFT32 (32)
  ------------------
 1709|  17.0M|              (interm_y[FFT32 + 2 * i + 1] * ixheaace_fft_mix_rad_twid_tbl_h_32[i - 1]);
  ------------------
  |  |   53|  17.0M|#define FFT32 (32)
  ------------------
 1710|  17.0M|      mul_i = (interm_y[FFT32 + 2 * i + 0] * ixheaace_fft_mix_rad_twid_tbl_h_32[i - 1]) +
  ------------------
  |  |   53|  17.0M|#define FFT32 (32)
  ------------------
 1711|  17.0M|              (interm_y[FFT32 + 2 * i + 1] * ixheaace_fft_mix_rad_twid_tbl_32[i - 1]);
  ------------------
  |  |   53|  17.0M|#define FFT32 (32)
  ------------------
 1712|       |
 1713|  17.0M|      mul_r = mul_r / 2;
 1714|  17.0M|      mul_i = mul_i / 2;
 1715|  17.0M|      ptr_y[idx1] = interm_y[2 * i + 0] + (mul_r * 2);
 1716|  17.0M|      ptr_y[idx1 + 1] = interm_y[2 * i + 1] + (mul_i * 2);
 1717|  17.0M|      ptr_y[idx2] = interm_y[2 * i + 0] - (mul_r * 2);
 1718|  17.0M|      ptr_y[idx2 + 1] = interm_y[2 * i + 1] - (mul_i * 2);
 1719|  17.0M|      idx1 += FFT15X2;
  ------------------
  |  |   52|  17.0M|#define FFT15X2 (30)
  ------------------
 1720|  17.0M|      idx2 += FFT15X2;
  ------------------
  |  |   52|  17.0M|#define FFT15X2 (30)
  ------------------
 1721|  17.0M|    }
 1722|  1.13M|  }
 1723|  1.13M|}
ixheaace_fft.c:ixheaace_post_twiddle_960:
 2084|  75.8k|                                      const FLOAT32 *ptr_cos_sin_tbl, WORD m) {
 2085|  75.8k|  WORD i;
 2086|  75.8k|  FLOAT32 c, c1, s, s1;
 2087|  75.8k|  FLOAT32 tempr, tempi, temp;
 2088|  75.8k|  FLOAT32 *ptr_in2 = ptr_x + (m - 1);
 2089|  75.8k|  FLOAT32 *ptr_in1 = ptr_x;
 2090|  75.8k|  FLOAT32 *ptr_x1 = ptr_out;
 2091|  75.8k|  FLOAT32 *ptr_x2 = ptr_out + (m - 1);
 2092|       |
 2093|  18.2M|  for (i = 0; i < m; i += 4) {
  ------------------
  |  Branch (2093:15): [True: 18.1M, False: 75.8k]
  ------------------
 2094|  18.1M|    c = *ptr_cos_sin_tbl++;
 2095|  18.1M|    s = *ptr_cos_sin_tbl++;
 2096|  18.1M|    c1 = *ptr_cos_sin_tbl++;
 2097|  18.1M|    s1 = *ptr_cos_sin_tbl++;
 2098|       |
 2099|  18.1M|    tempr = *ptr_in1++;
 2100|  18.1M|    tempi = *ptr_in1++;
 2101|       |
 2102|  18.1M|    temp = -((tempr * s) - (tempi * c));
 2103|  18.1M|    *ptr_x2-- = temp;
 2104|       |
 2105|  18.1M|    temp = -((tempr * c) + (tempi * s));
 2106|  18.1M|    *ptr_x1++ = temp;
 2107|       |
 2108|  18.1M|    tempi = *ptr_in2--;
 2109|  18.1M|    tempr = *ptr_in2--;
 2110|       |
 2111|  18.1M|    temp = -((tempr * s1) - (tempi * c1));
 2112|  18.1M|    *ptr_x1++ = temp;
 2113|       |
 2114|  18.1M|    temp = -((tempr * c1) + (tempi * s1));
 2115|  18.1M|    *ptr_x2-- = temp;
 2116|  18.1M|  }
 2117|  75.8k|}
ixheaace_fft.c:ixheaace_mdct_120:
 2140|   322k|static VOID ixheaace_mdct_120(FLOAT32 *ptr_input_flt, WORD8 *ptr_scratch) {
 2141|   322k|  WORD32 n, k;
 2142|   322k|  WORD32 n_by_2;
 2143|   322k|  FLOAT32 *ptr_scratch_flt = (FLOAT32 *)ptr_scratch;
 2144|   322k|  FLOAT32 const_mltfac = 3.142857143f;
 2145|   322k|  FLOAT32 *ptr_data = ptr_input_flt;
 2146|   322k|  n = 120;
 2147|   322k|  n_by_2 = n >> 1;
 2148|   322k|  memcpy(ptr_scratch_flt, ptr_input_flt, sizeof(*ptr_scratch_flt) * n);
 2149|       |
 2150|   322k|  ixheaace_pre_twiddle_120(ptr_input_flt, ptr_scratch_flt, n, ixheaace_cosine_array_240);
 2151|       |
 2152|   322k|  ixheaace_fft_120(n_by_2, ptr_input_flt, ptr_scratch_flt);
 2153|       |
 2154|   322k|  ixheaace_post_twiddle_120(ptr_input_flt, ptr_scratch_flt, ixheaace_cosine_array_240, n);
 2155|       |
 2156|  19.6M|  for (k = n - 1; k >= 0; k -= 2) {
  ------------------
  |  Branch (2156:19): [True: 19.3M, False: 322k]
  ------------------
 2157|  19.3M|    *ptr_data = (*ptr_data * const_mltfac);
 2158|  19.3M|    ptr_data++;
 2159|  19.3M|    *ptr_data = (*ptr_data * const_mltfac);
 2160|  19.3M|    ptr_data++;
 2161|  19.3M|  }
 2162|   322k|}
ixheaace_fft.c:ixheaace_pre_twiddle_120:
 1828|   322k|                                     const FLOAT32 *ptr_cos_sin_tbl) {
 1829|   322k|  WORD npoints_4, i;
 1830|   322k|  FLOAT32 tempr, tempi, temp;
 1831|   322k|  FLOAT32 c, c1, s, s1;
 1832|   322k|  FLOAT32 *ptr_in1, *ptr_in2;
 1833|   322k|  FLOAT32 *ptr_x = ptr_in + (n - 1);
 1834|       |
 1835|   322k|  npoints_4 = n >> 2;
 1836|       |
 1837|   322k|  ptr_in1 = ptr_data;
 1838|   322k|  ptr_in2 = ptr_data + n - 1;
 1839|       |
 1840|  10.0M|  for (i = 0; i < npoints_4; i++) {
  ------------------
  |  Branch (1840:15): [True: 9.67M, False: 322k]
  ------------------
 1841|  9.67M|    c = *ptr_cos_sin_tbl++;
 1842|  9.67M|    s = *ptr_cos_sin_tbl++;
 1843|       |
 1844|  9.67M|    tempr = *ptr_in1++;
 1845|  9.67M|    tempi = *ptr_in2--;
 1846|       |
 1847|  9.67M|    temp = -((tempr * c) + (tempi * s));
 1848|  9.67M|    *ptr_in++ = temp;
 1849|       |
 1850|  9.67M|    temp = -((tempi * c) - (tempr * s));
 1851|  9.67M|    *ptr_in++ = temp;
 1852|       |
 1853|  9.67M|    c1 = *ptr_cos_sin_tbl++;
 1854|  9.67M|    s1 = *ptr_cos_sin_tbl++;
 1855|       |
 1856|  9.67M|    tempi = *ptr_in1++;
 1857|  9.67M|    tempr = *ptr_in2--;
 1858|       |
 1859|  9.67M|    temp = -((tempi * c1) - (tempr * s1));
 1860|  9.67M|    *ptr_x-- = temp;
 1861|       |
 1862|  9.67M|    temp = -((tempr * c1) + (tempi * s1));
 1863|  9.67M|    *ptr_x-- = temp;
 1864|  9.67M|  }
 1865|   322k|}
ixheaace_fft.c:ixheaace_fft_120:
 1930|   322k|static VOID ixheaace_fft_120(WORD32 npoints, FLOAT32 *ptr_x_flt, FLOAT32 *ptr_y_flt) {
 1931|   322k|  WORD32 i;
 1932|   322k|  FLOAT32 *ptr_buf1_flt, *ptr_buf2_flt;
 1933|   322k|  FLOAT32 *ptr_in_flt, *ptr_out_flt;
 1934|       |
 1935|   322k|  ptr_in_flt = ptr_x_flt;
 1936|   322k|  ptr_out_flt = ptr_y_flt;
 1937|   322k|  ixheaace_dec_rearrange_short_flt(ptr_in_flt, ptr_out_flt, 60, re_arr_tab_4);
 1938|       |
 1939|   322k|  ptr_buf1_flt = ptr_out_flt;
 1940|   322k|  ptr_buf2_flt = ptr_in_flt;
 1941|       |
 1942|  5.16M|  for (i = 0; i < FFT15; i++) {
  ------------------
  |  |   51|  5.16M|#define FFT15 (15)
  ------------------
  |  Branch (1942:15): [True: 4.83M, False: 322k]
  ------------------
 1943|  4.83M|    {
 1944|  4.83M|      FLOAT32 x_0, x_1, x_2, x_3, x_4, x_5, x_6, x_7;
 1945|  4.83M|      FLOAT32 *y0, *y1, *y2, *y3;
 1946|  4.83M|      FLOAT32 *x0;
 1947|  4.83M|      FLOAT32 xh0_0, xh1_0, xh0_1, xh1_1, xl0_0, xl1_0, xl0_1, xl1_1;
 1948|  4.83M|      WORD32 h2;
 1949|  4.83M|      FLOAT32 n00, n01, n10, n11, n20, n21, n30, n31;
 1950|       |
 1951|  4.83M|      ptr_x_flt = ptr_buf1_flt;
 1952|  4.83M|      ptr_y_flt = ptr_buf2_flt;
 1953|  4.83M|      npoints = 4;
 1954|  4.83M|      h2 = 0;
 1955|       |
 1956|  4.83M|      y0 = ptr_y_flt;
 1957|  4.83M|      y2 = ptr_y_flt + (WORD32)npoints;
 1958|  4.83M|      x0 = ptr_x_flt;
 1959|  4.83M|      y1 = y0 + (WORD32)(npoints >> 1);
 1960|  4.83M|      y3 = y2 + (WORD32)(npoints >> 1);
 1961|       |
 1962|  4.83M|      x_0 = x0[0];
 1963|  4.83M|      x_1 = x0[1];
 1964|  4.83M|      x_2 = x0[2];
 1965|  4.83M|      x_3 = x0[3];
 1966|  4.83M|      x_4 = x0[4];
 1967|  4.83M|      x_5 = x0[5];
 1968|  4.83M|      x_6 = x0[6];
 1969|  4.83M|      x_7 = x0[7];
 1970|       |
 1971|  4.83M|      xh0_0 = x_0 + x_4;
 1972|  4.83M|      xh1_0 = x_1 + x_5;
 1973|  4.83M|      xl0_0 = x_0 - x_4;
 1974|  4.83M|      xl1_0 = x_1 - x_5;
 1975|  4.83M|      xh0_1 = x_2 + x_6;
 1976|  4.83M|      xh1_1 = x_3 + x_7;
 1977|  4.83M|      xl0_1 = x_2 - x_6;
 1978|  4.83M|      xl1_1 = x_3 - x_7;
 1979|       |
 1980|  4.83M|      n00 = xh0_0 + xh0_1;
 1981|  4.83M|      n01 = xh1_0 + xh1_1;
 1982|  4.83M|      n10 = xl0_0 + xl1_1;
 1983|  4.83M|      n11 = xl1_0 - xl0_1;
 1984|  4.83M|      n20 = xh0_0 - xh0_1;
 1985|  4.83M|      n21 = xh1_0 - xh1_1;
 1986|  4.83M|      n30 = xl0_0 - xl1_1;
 1987|  4.83M|      n31 = xl1_0 + xl0_1;
 1988|       |
 1989|  4.83M|      y0[2 * h2] = n00;
 1990|  4.83M|      y0[2 * h2 + 1] = n01;
 1991|  4.83M|      y1[2 * h2] = n10;
 1992|  4.83M|      y1[2 * h2 + 1] = n11;
 1993|  4.83M|      y2[2 * h2] = n20;
 1994|  4.83M|      y2[2 * h2 + 1] = n21;
 1995|  4.83M|      y3[2 * h2] = n30;
 1996|  4.83M|      y3[2 * h2 + 1] = n31;
 1997|  4.83M|    }
 1998|       |
 1999|  4.83M|    ptr_buf1_flt += (FFT4 * 2);
  ------------------
  |  |   49|  4.83M|#define FFT4 (4)
  ------------------
 2000|  4.83M|    ptr_buf2_flt += (FFT4 * 2);
  ------------------
  |  |   49|  4.83M|#define FFT4 (4)
  ------------------
 2001|  4.83M|  }
 2002|       |
 2003|   322k|  ixheaace_dec_rearrange_short_flt(ptr_in_flt, ptr_out_flt, 60, re_arr_tab_15_4);
 2004|       |
 2005|   322k|  ptr_buf1_flt = ptr_out_flt;
 2006|   322k|  ptr_buf2_flt = ptr_in_flt;
 2007|  1.61M|  for (i = 0; i < FFT4; i++) {
  ------------------
  |  |   49|  1.61M|#define FFT4 (4)
  ------------------
  |  Branch (2007:15): [True: 1.29M, False: 322k]
  ------------------
 2008|  1.29M|    ixheaace_fft_960_15(ptr_buf1_flt, ptr_buf2_flt);
 2009|  1.29M|    ptr_buf1_flt += (FFT15 * 2);
  ------------------
  |  |   51|  1.29M|#define FFT15 (15)
  ------------------
 2010|  1.29M|    ptr_buf2_flt += (FFT15 * 2);
  ------------------
  |  |   51|  1.29M|#define FFT15 (15)
  ------------------
 2011|  1.29M|  }
 2012|       |
 2013|   322k|  ixheaace_dec_rearrange_short_flt(ptr_in_flt, ptr_out_flt, 60, re_arr_tab_120);
 2014|   322k|}
ixheaace_fft.c:ixheaace_dec_rearrange_short_flt:
 1726|  4.83M|                                             const WORD16 *ptr_re_arr_tab) {
 1727|  4.83M|  WORD32 n, i = 0;
 1728|       |
 1729|   120M|  for (n = 0; n < N; n++) {
  ------------------
  |  Branch (1729:15): [True: 116M, False: 4.83M]
  ------------------
 1730|   116M|    WORD32 idx = ptr_re_arr_tab[n] << 1;
 1731|   116M|    ptr_out[i++] = ptr_in[idx];
 1732|   116M|    ptr_out[i++] = ptr_in[idx + 1];
 1733|   116M|  }
 1734|  4.83M|}
ixheaace_fft.c:ixheaace_fft_960_15:
 1903|  1.29M|static VOID ixheaace_fft_960_15(FLOAT32 *ptr_in_flt, FLOAT32 *ptr_out_flt) {
 1904|  1.29M|  WORD32 i;
 1905|  1.29M|  FLOAT32 *ptr_buf1_flt, *ptr_buf2_flt;
 1906|  1.29M|  ixheaace_dec_rearrange_short_flt(ptr_in_flt, ptr_out_flt, FFT15, re_arr_tab_5);
  ------------------
  |  |   51|  1.29M|#define FFT15 (15)
  ------------------
 1907|       |
 1908|  1.29M|  ptr_buf1_flt = ptr_out_flt;
 1909|  1.29M|  ptr_buf2_flt = ptr_in_flt;
 1910|  5.16M|  for (i = 0; i < FFT3; i++) {
  ------------------
  |  |   50|  5.16M|#define FFT3 (3)
  ------------------
  |  Branch (1910:15): [True: 3.87M, False: 1.29M]
  ------------------
 1911|  3.87M|    ixheaace_fft_5_flt(ptr_buf1_flt, ptr_buf2_flt);
 1912|       |
 1913|  3.87M|    ptr_buf1_flt += (FFT5 * 2);
  ------------------
  |  |   46|  3.87M|#define FFT5 (5)
  ------------------
 1914|  3.87M|    ptr_buf2_flt += (FFT5 * 2);
  ------------------
  |  |   46|  3.87M|#define FFT5 (5)
  ------------------
 1915|  3.87M|  }
 1916|       |
 1917|  1.29M|  ixheaace_dec_rearrange_short_flt(ptr_in_flt, ptr_out_flt, FFT15, re_arr_tab_3);
  ------------------
  |  |   51|  1.29M|#define FFT15 (15)
  ------------------
 1918|  1.29M|  ptr_buf1_flt = ptr_out_flt;
 1919|  1.29M|  ptr_buf2_flt = ptr_in_flt;
 1920|  7.74M|  for (i = 0; i < FFT5; i++) {
  ------------------
  |  |   46|  7.74M|#define FFT5 (5)
  ------------------
  |  Branch (1920:15): [True: 6.45M, False: 1.29M]
  ------------------
 1921|  6.45M|    ixheaace_fft_3_flt(ptr_buf1_flt, ptr_buf2_flt);
 1922|       |
 1923|  6.45M|    ptr_buf1_flt += (FFT3 * 2);
  ------------------
  |  |   50|  6.45M|#define FFT3 (3)
  ------------------
 1924|  6.45M|    ptr_buf2_flt += (FFT3 * 2);
  ------------------
  |  |   50|  6.45M|#define FFT3 (3)
  ------------------
 1925|  6.45M|  }
 1926|       |
 1927|  1.29M|  ixheaace_dec_rearrange_short_flt(ptr_in_flt, ptr_out_flt, FFT15, re_arr_tab_sml);
  ------------------
  |  |   51|  1.29M|#define FFT15 (15)
  ------------------
 1928|  1.29M|}
ixheaace_fft.c:ixheaace_fft_5_flt:
 1736|  3.87M|static VOID ixheaace_fft_5_flt(FLOAT32 *ptr_in, FLOAT32 *ptr_out) {
 1737|  3.87M|  FLOAT32 C51 = 0.951056516f;
 1738|  3.87M|  FLOAT32 C52 = -0.769420885f;
 1739|  3.87M|  FLOAT32 C53 = -0.363271264f;
 1740|  3.87M|  FLOAT32 C54 = 0.559016994f;
 1741|  3.87M|  FLOAT32 C55 = -0.625f;
 1742|       |
 1743|  3.87M|  FLOAT32 r1, r2, r3, r4;
 1744|  3.87M|  FLOAT32 s1, s2, s3, s4, t, temp1, temp2;
 1745|       |
 1746|  3.87M|  r1 = (ptr_in[2] + ptr_in[8]);
 1747|  3.87M|  r4 = (ptr_in[2] - ptr_in[8]);
 1748|  3.87M|  r3 = (ptr_in[4] + ptr_in[6]);
 1749|  3.87M|  r2 = (ptr_in[4] - ptr_in[6]);
 1750|       |
 1751|  3.87M|  t = ((r1 - r3) * C54);
 1752|  3.87M|  r1 = (r1 + r3);
 1753|       |
 1754|  3.87M|  temp1 = (ptr_in[0] + r1);
 1755|  3.87M|  r1 = (temp1 + (((r1 * C55)) * 2));
 1756|       |
 1757|  3.87M|  r3 = (r1 - t);
 1758|  3.87M|  r1 = (r1 + t);
 1759|       |
 1760|  3.87M|  t = ((r4 + r2) * C51);
 1761|  3.87M|  r4 = (t + ((r4 * C52) * 2));
 1762|  3.87M|  r2 = (t + (r2 * C53));
 1763|       |
 1764|  3.87M|  s1 = (ptr_in[3] + ptr_in[9]);
 1765|  3.87M|  s4 = (ptr_in[3] - ptr_in[9]);
 1766|  3.87M|  s3 = (ptr_in[5] + ptr_in[7]);
 1767|  3.87M|  s2 = (ptr_in[5] - ptr_in[7]);
 1768|       |
 1769|  3.87M|  t = ((s1 - s3) * C54);
 1770|  3.87M|  s1 = (s1 + s3);
 1771|       |
 1772|  3.87M|  temp2 = (ptr_in[1] + s1);
 1773|       |
 1774|  3.87M|  s1 = (temp2 + (((s1 * C55)) * 2));
 1775|       |
 1776|  3.87M|  s3 = (s1 - t);
 1777|  3.87M|  s1 = (s1 + t);
 1778|       |
 1779|  3.87M|  t = ((s4 + s2) * C51);
 1780|  3.87M|  s4 = (t + (((s4 * C52)) * 2));
 1781|  3.87M|  s2 = (t + ((s2 * C53)));
 1782|       |
 1783|  3.87M|  ptr_out[0] = temp1;
 1784|  3.87M|  ptr_out[1] = temp2;
 1785|  3.87M|  ptr_out[2] = (r1 + s2);
 1786|  3.87M|  ptr_out[3] = (s1 - r2);
 1787|  3.87M|  ptr_out[4] = (r3 - s4);
 1788|  3.87M|  ptr_out[5] = (s3 + r4);
 1789|  3.87M|  ptr_out[6] = (r3 + s4);
 1790|  3.87M|  ptr_out[7] = (s3 - r4);
 1791|  3.87M|  ptr_out[8] = (r1 - s2);
 1792|  3.87M|  ptr_out[9] = (s1 + r2);
 1793|  3.87M|}
ixheaace_fft.c:ixheaace_fft_3_flt:
 1795|  6.45M|static VOID ixheaace_fft_3_flt(FLOAT32 *ptr_in, FLOAT32 *ptr_out) {
 1796|  6.45M|  FLOAT32 add_r, sub_r;
 1797|  6.45M|  FLOAT32 add_i, sub_i;
 1798|  6.45M|  FLOAT32 x_01_r, x_01_i, temp;
 1799|       |
 1800|  6.45M|  FLOAT32 p1, p2, p3, p4;
 1801|  6.45M|  FLOAT32 sinmu = 0.866025404f;
 1802|       |
 1803|  6.45M|  x_01_r = (ptr_in[0] + ptr_in[2]);
 1804|  6.45M|  x_01_i = (ptr_in[1] + ptr_in[3]);
 1805|       |
 1806|  6.45M|  add_r = (ptr_in[2] + ptr_in[4]);
 1807|  6.45M|  add_i = (ptr_in[3] + ptr_in[5]);
 1808|       |
 1809|  6.45M|  sub_r = (ptr_in[2] - ptr_in[4]);
 1810|  6.45M|  sub_i = (ptr_in[3] - ptr_in[5]);
 1811|       |
 1812|  6.45M|  p1 = add_r / 2;
 1813|  6.45M|  p2 = (sub_i * sinmu);
 1814|  6.45M|  p3 = (sub_r * sinmu);
 1815|  6.45M|  p4 = add_i / 2;
 1816|       |
 1817|  6.45M|  temp = (ptr_in[0] - p1);
 1818|       |
 1819|  6.45M|  ptr_out[0] = (x_01_r + ptr_in[4]);
 1820|  6.45M|  ptr_out[1] = (x_01_i + ptr_in[5]);
 1821|  6.45M|  ptr_out[2] = (temp + p2);
 1822|  6.45M|  ptr_out[3] = ((ptr_in[1] - p3) - p4);
 1823|  6.45M|  ptr_out[4] = (temp - p2);
 1824|  6.45M|  ptr_out[5] = ((ptr_in[1] + p3) - p4);
 1825|  6.45M|}
ixheaace_fft.c:ixheaace_post_twiddle_120:
 1868|   322k|                                      const FLOAT32 *ptr_cos_sin_tbl, WORD m) {
 1869|   322k|  WORD i;
 1870|   322k|  FLOAT32 c, c1, s, s1;
 1871|   322k|  FLOAT32 tempr, tempi, temp;
 1872|   322k|  FLOAT32 *ptr_in2 = ptr_x + (m - 1);
 1873|   322k|  FLOAT32 *ptr_in1 = ptr_x;
 1874|   322k|  FLOAT32 *ptr_x1 = ptr_out;
 1875|   322k|  FLOAT32 *ptr_x2 = ptr_out + (m - 1);
 1876|       |
 1877|  10.0M|  for (i = 0; i < m; i += 4) {
  ------------------
  |  Branch (1877:15): [True: 9.67M, False: 322k]
  ------------------
 1878|  9.67M|    c = *ptr_cos_sin_tbl++;
 1879|  9.67M|    s = *ptr_cos_sin_tbl++;
 1880|  9.67M|    c1 = *ptr_cos_sin_tbl++;
 1881|  9.67M|    s1 = *ptr_cos_sin_tbl++;
 1882|       |
 1883|  9.67M|    tempr = *ptr_in1++;
 1884|  9.67M|    tempi = *ptr_in1++;
 1885|       |
 1886|  9.67M|    temp = -((tempr * s) - (tempi * c));
 1887|  9.67M|    *ptr_x2-- = temp;
 1888|       |
 1889|  9.67M|    temp = -((tempr * c) + (tempi * s));
 1890|  9.67M|    *ptr_x1++ = temp;
 1891|       |
 1892|  9.67M|    tempi = *ptr_in2--;
 1893|  9.67M|    tempr = *ptr_in2--;
 1894|       |
 1895|  9.67M|    temp = -((tempr * s1) - (tempi * c1));
 1896|  9.67M|    *ptr_x1++ = temp;
 1897|       |
 1898|  9.67M|    temp = -((tempr * c1) + (tempi * s1));
 1899|  9.67M|    *ptr_x2-- = temp;
 1900|  9.67M|  }
 1901|   322k|}

iaace_group_short_data:
   50|  86.9k|                            const WORD32 *ptr_group_len, WORD32 frame_length) {
   51|  86.9k|  WORD32 i, j;
   52|  86.9k|  WORD32 line;
   53|  86.9k|  WORD32 sfb;
   54|  86.9k|  WORD32 grp;
   55|  86.9k|  WORD32 wnd;
   56|  86.9k|  WORD32 offset;
   57|  86.9k|  WORD32 highest_sfb;
   58|       |
   59|       |  /* For short: regroup and cumulate energies und thresholds group-wise */
   60|       |  /* Calculate sfb_cnt */
   61|       |
   62|  86.9k|  highest_sfb = 0;
   63|       |
   64|   782k|  for (wnd = 0; wnd < TRANS_FAC; wnd++) {
  ------------------
  |  |   29|   782k|#define TRANS_FAC 8
  ------------------
  |  Branch (64:17): [True: 695k, False: 86.9k]
  ------------------
   65|  2.66M|    for (sfb = sfb_cnt - 1; sfb >= highest_sfb; sfb--) {
  ------------------
  |  Branch (65:29): [True: 2.62M, False: 41.0k]
  ------------------
   66|  36.5M|      for (line = ptr_sfb_offset[sfb + 1] - 1; line >= ptr_sfb_offset[sfb]; line--) {
  ------------------
  |  Branch (66:48): [True: 34.5M, False: 1.96M]
  ------------------
   67|  34.5M|        if (ptr_mdct_spectrum[wnd * (frame_length / 8) + line] != 0.0) {
  ------------------
  |  Branch (67:13): [True: 654k, False: 33.9M]
  ------------------
   68|   654k|          break;
   69|   654k|        }
   70|  34.5M|      }
   71|       |
   72|  2.62M|      if (line >= ptr_sfb_offset[sfb]) {
  ------------------
  |  Branch (72:11): [True: 654k, False: 1.96M]
  ------------------
   73|   654k|        break;
   74|   654k|      }
   75|  2.62M|    }
   76|   695k|    highest_sfb = MAX(highest_sfb, sfb);
  ------------------
  |  |   24|   695k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 41.0k, False: 654k]
  |  |  ------------------
  ------------------
   77|   695k|  }
   78|       |
   79|  86.9k|  highest_sfb = highest_sfb > 0 ? highest_sfb : 0;
  ------------------
  |  Branch (79:17): [True: 86.3k, False: 598]
  ------------------
   80|       |
   81|  86.9k|  *ptr_max_sfb_per_group = highest_sfb + 1;
   82|       |
   83|       |  /* Calculate ptr_sfb_offset */
   84|  86.9k|  i = 0;
   85|  86.9k|  offset = 0;
   86|       |
   87|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (87:17): [True: 337k, False: 86.9k]
  ------------------
   88|  5.25M|    for (sfb = 0; sfb < sfb_cnt; sfb++) {
  ------------------
  |  Branch (88:19): [True: 4.92M, False: 337k]
  ------------------
   89|  4.92M|      ptr_grouped_sfb_offset[i++] = offset + ptr_sfb_offset[sfb] * ptr_group_len[grp];
   90|  4.92M|    }
   91|       |
   92|   337k|    offset += ptr_group_len[grp] * (frame_length / 8);
   93|   337k|  }
   94|       |
   95|  86.9k|  ptr_grouped_sfb_offset[i++] = frame_length;
   96|       |
   97|       |  /* Calculate min SNR */
   98|       |
   99|  86.9k|  i = 0;
  100|  86.9k|  offset = 0;
  101|       |
  102|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (102:17): [True: 337k, False: 86.9k]
  ------------------
  103|   337k|    memcpy(&ptr_grouped_sfb_min_snr[i], &ptr_sfb_min_snr[0], sfb_cnt * sizeof(*ptr_sfb_min_snr));
  104|   337k|    i += sfb_cnt;
  105|       |
  106|   337k|    offset += ptr_group_len[grp] * (frame_length / 8);
  107|   337k|  }
  108|       |
  109|  86.9k|  wnd = 0;
  110|  86.9k|  i = 0;
  111|       |
  112|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (112:17): [True: 337k, False: 86.9k]
  ------------------
  113|  5.25M|    for (sfb = 0; sfb < sfb_cnt; sfb++) {
  ------------------
  |  Branch (113:19): [True: 4.92M, False: 337k]
  ------------------
  114|  4.92M|      FLOAT32 thresh = pstr_sfb_threshold->short_nrg[wnd][sfb];
  115|       |
  116|  10.1M|      for (j = 1; j < ptr_group_len[grp]; j++) {
  ------------------
  |  Branch (116:19): [True: 5.21M, False: 4.92M]
  ------------------
  117|  5.21M|        thresh += pstr_sfb_threshold->short_nrg[wnd + j][sfb];
  118|  5.21M|      }
  119|       |
  120|  4.92M|      pstr_sfb_threshold->long_nrg[i++] = thresh;
  121|  4.92M|    }
  122|   337k|    wnd += ptr_group_len[grp];
  123|   337k|  }
  124|       |
  125|       |  /* Sum up sfb energies -  left/right */
  126|  86.9k|  wnd = 0;
  127|  86.9k|  i = 0;
  128|       |
  129|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (129:17): [True: 337k, False: 86.9k]
  ------------------
  130|  5.25M|    for (sfb = 0; sfb < sfb_cnt; sfb++) {
  ------------------
  |  Branch (130:19): [True: 4.92M, False: 337k]
  ------------------
  131|  4.92M|      FLOAT32 energy = pstr_sfb_energy->short_nrg[wnd][sfb];
  132|       |
  133|  10.1M|      for (j = 1; j < ptr_group_len[grp]; j++) {
  ------------------
  |  Branch (133:19): [True: 5.21M, False: 4.92M]
  ------------------
  134|  5.21M|        energy += pstr_sfb_energy->short_nrg[wnd + j][sfb];
  135|  5.21M|      }
  136|       |
  137|  4.92M|      pstr_sfb_energy->long_nrg[i++] = energy;
  138|  4.92M|    }
  139|   337k|    wnd += ptr_group_len[grp];
  140|   337k|  }
  141|       |
  142|       |  /* Sum up sfb energies mid/side */
  143|  86.9k|  wnd = 0;
  144|  86.9k|  i = 0;
  145|       |
  146|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (146:17): [True: 337k, False: 86.9k]
  ------------------
  147|  5.25M|    for (sfb = 0; sfb < sfb_cnt; sfb++) {
  ------------------
  |  Branch (147:19): [True: 4.92M, False: 337k]
  ------------------
  148|  4.92M|      FLOAT32 energy = pstr_sfb_energy_ms->short_nrg[wnd][sfb];
  149|       |
  150|  10.1M|      for (j = 1; j < ptr_group_len[grp]; j++) {
  ------------------
  |  Branch (150:19): [True: 5.21M, False: 4.92M]
  ------------------
  151|  5.21M|        energy += pstr_sfb_energy_ms->short_nrg[wnd + j][sfb];
  152|  5.21M|      }
  153|       |
  154|  4.92M|      pstr_sfb_energy_ms->long_nrg[i++] = energy;
  155|  4.92M|    }
  156|   337k|    wnd += ptr_group_len[grp];
  157|   337k|  }
  158|       |
  159|       |  /* Sum up sfb spreaded energies */
  160|  86.9k|  wnd = 0;
  161|  86.9k|  i = 0;
  162|       |
  163|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (163:17): [True: 337k, False: 86.9k]
  ------------------
  164|  5.25M|    for (sfb = 0; sfb < sfb_cnt; sfb++) {
  ------------------
  |  Branch (164:19): [True: 4.92M, False: 337k]
  ------------------
  165|  4.92M|      FLOAT32 energy = pstr_sfb_spreaded_energy->short_nrg[wnd][sfb];
  166|       |
  167|  10.1M|      for (j = 1; j < ptr_group_len[grp]; j++) {
  ------------------
  |  Branch (167:19): [True: 5.21M, False: 4.92M]
  ------------------
  168|  5.21M|        energy += pstr_sfb_spreaded_energy->short_nrg[wnd + j][sfb];
  169|  5.21M|      }
  170|  4.92M|      pstr_sfb_spreaded_energy->long_nrg[i++] = energy;
  171|  4.92M|    }
  172|   337k|    wnd += ptr_group_len[grp];
  173|   337k|  }
  174|       |
  175|       |  /* Re-group spectrum */
  176|  86.9k|  wnd = 0;
  177|  86.9k|  i = 0;
  178|       |
  179|   424k|  for (grp = 0; grp < no_of_groups; grp++) {
  ------------------
  |  Branch (179:17): [True: 337k, False: 86.9k]
  ------------------
  180|  5.25M|    for (sfb = 0; sfb < sfb_cnt; sfb++) {
  ------------------
  |  Branch (180:19): [True: 4.92M, False: 337k]
  ------------------
  181|  15.0M|      for (j = 0; j < ptr_group_len[grp]; j++) {
  ------------------
  |  Branch (181:19): [True: 10.1M, False: 4.92M]
  ------------------
  182|  96.5M|        for (line = ptr_sfb_offset[sfb]; line < ptr_sfb_offset[sfb + 1]; line++) {
  ------------------
  |  Branch (182:42): [True: 86.4M, False: 10.1M]
  ------------------
  183|  86.4M|          ptr_tmp_spectrum[i++] = ptr_mdct_spectrum[(wnd + j) * (frame_length / 8) + line];
  184|  86.4M|        }
  185|  10.1M|      }
  186|  4.92M|    }
  187|   337k|    wnd += ptr_group_len[grp];
  188|   337k|  }
  189|       |
  190|  86.9k|  memcpy(ptr_mdct_spectrum, ptr_tmp_spectrum, frame_length * sizeof(*ptr_mdct_spectrum));
  191|  86.9k|}

ixheaace_hybrid_analysis:
  262|  39.4k|                                      ixheaace_common_tables *pstr_common_tab) {
  263|  39.4k|  WORD32 band, i;
  264|  39.4k|  ixheaace_hybrid_res hybrid_res;
  265|  39.4k|  WORD32 ch_offset = 0;
  266|       |
  267|  39.4k|  FLOAT32 *ptr_re, *ptr_im;
  268|  39.4k|  const FLOAT32 *ptr_qmf_real, *ptr_qmf_imag;
  269|  39.4k|  FLOAT32 tmp1, tmp2;
  270|       |
  271|   157k|  for (band = 0; band < IXHEAACE_NUM_QMF_BANDS_IN_HYBRID; band++) {
  ------------------
  |  |   26|   157k|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  ------------------
  |  Branch (271:18): [True: 118k, False: 39.4k]
  ------------------
  272|   118k|    hybrid_res = (ixheaace_hybrid_res)pstr_ps_tab->a_hyb_res[band];
  273|       |
  274|   118k|    memcpy(pstr_hybrid->ptr_work_real, pstr_hybrid->ptr_qmf_buf_real[band],
  275|   118k|           IXHEAACE_QMF_BUFFER_MOVE * sizeof(FLOAT32));
  ------------------
  |  |   24|   118k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|   118k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  276|   118k|    memcpy(pstr_hybrid->ptr_work_imag, pstr_hybrid->ptr_qmf_buf_imag[band],
  277|   118k|           IXHEAACE_QMF_BUFFER_MOVE * sizeof(FLOAT32));
  ------------------
  |  |   24|   118k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|   118k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  278|   118k|    ptr_re = &pstr_hybrid->ptr_work_real[IXHEAACE_QMF_BUFFER_MOVE];
  ------------------
  |  |   24|   118k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|   118k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  279|   118k|    ptr_im = &pstr_hybrid->ptr_work_imag[IXHEAACE_QMF_BUFFER_MOVE];
  ------------------
  |  |   24|   118k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|   118k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  280|   118k|    ptr_qmf_real = &ptr_qmf_real_in[0][band];
  281|   118k|    ptr_qmf_imag = &ptr_qmf_imag_in[0][band];
  282|       |
  283|  3.90M|    for (i = IXHEAACE_QMF_TIME_SLOTS - 1; i >= 0; i--) {
  ------------------
  |  |   69|   118k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  |  Branch (283:43): [True: 3.78M, False: 118k]
  ------------------
  284|  3.78M|      tmp1 = *ptr_qmf_real;
  285|  3.78M|      tmp2 = *ptr_qmf_imag;
  286|       |
  287|  3.78M|      ptr_qmf_real += IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|  3.78M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  288|  3.78M|      ptr_qmf_imag += IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|  3.78M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  289|       |
  290|  3.78M|      *ptr_im++ = tmp2;
  291|  3.78M|      *ptr_re++ = tmp1;
  292|  3.78M|    }
  293|       |
  294|   118k|    ptr_re = &pstr_hybrid->ptr_qmf_buf_real[band][0];
  295|   118k|    ptr_im = &pstr_hybrid->ptr_qmf_buf_imag[band][0];
  296|       |
  297|   118k|    ptr_qmf_real = &ptr_qmf_real_in[IXHEAACE_QMF_TIME_SLOTS - IXHEAACE_QMF_BUFFER_MOVE][band];
  ------------------
  |  |   69|   118k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
                  ptr_qmf_real = &ptr_qmf_real_in[IXHEAACE_QMF_TIME_SLOTS - IXHEAACE_QMF_BUFFER_MOVE][band];
  ------------------
  |  |   24|   118k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|   118k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  298|   118k|    ptr_qmf_imag = &ptr_qmf_imag_in[IXHEAACE_QMF_TIME_SLOTS - IXHEAACE_QMF_BUFFER_MOVE][band];
  ------------------
  |  |   69|   118k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
                  ptr_qmf_imag = &ptr_qmf_imag_in[IXHEAACE_QMF_TIME_SLOTS - IXHEAACE_QMF_BUFFER_MOVE][band];
  ------------------
  |  |   24|   118k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|   118k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  299|       |
  300|  1.53M|    for (i = 0; i < IXHEAACE_QMF_BUFFER_MOVE; i++) {
  ------------------
  |  |   24|  1.53M|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|  1.53M|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
  |  Branch (300:17): [True: 1.41M, False: 118k]
  ------------------
  301|  1.41M|      tmp1 = *ptr_qmf_real;
  302|  1.41M|      ptr_qmf_real += IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|  1.41M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  303|  1.41M|      tmp2 = *ptr_qmf_imag;
  304|  1.41M|      ptr_qmf_imag += IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|  1.41M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  305|  1.41M|      *ptr_re++ = tmp1;
  306|  1.41M|      *ptr_im++ = tmp2;
  307|  1.41M|    }
  308|       |
  309|   118k|    switch (hybrid_res) {
  310|  78.8k|      case IXHEAACE_HYBRID_4_CPLX:
  ------------------
  |  Branch (310:7): [True: 78.8k, False: 39.4k]
  ------------------
  311|  78.8k|        ixheaace_four_chan_filtering(pstr_hybrid->ptr_work_real, pstr_hybrid->ptr_work_imag,
  312|  78.8k|                                     ptr_hyb_real_in, ptr_hyb_imag_in, ch_offset,
  313|  78.8k|                                     pstr_ps_tab->p4_13, pstr_common_tab);
  314|  78.8k|        break;
  315|  39.4k|      case IXHEAACE_HYBRID_8_CPLX:
  ------------------
  |  Branch (315:7): [True: 39.4k, False: 78.8k]
  ------------------
  316|  39.4k|        ixheaace_eight_chan_filtering(pstr_hybrid->ptr_work_real, pstr_hybrid->ptr_work_imag,
  317|  39.4k|                                      ptr_hyb_real_in, ptr_hyb_imag_in, pstr_ps_tab->p8_13,
  318|  39.4k|                                      pstr_common_tab);
  319|  39.4k|        break;
  320|      0|      default:
  ------------------
  |  Branch (320:7): [True: 0, False: 118k]
  ------------------
  321|      0|        return IA_EXHEAACE_EXE_FATAL_PS_INVALID_HYBRID_RES_VAL;
  322|      0|        break;
  323|   118k|    }
  324|   118k|    ch_offset += hybrid_res;
  325|   118k|  }
  326|  39.4k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  39.4k|#define IA_NO_ERROR 0x00000000
  ------------------
  327|  39.4k|}
ixheaace_hybrid_synthesis:
  331|  19.7k|                               FLOAT32 **ptr_qmf_imag_flt, const WORD32 *ptr_hyb_res) {
  332|  19.7k|  WORD32 k, n, band;
  333|  19.7k|  ixheaace_hybrid_res hybrid_res;
  334|  19.7k|  WORD32 ch_offset = 0;
  335|       |
  336|  19.7k|  FLOAT32 temp1, temp2;
  337|  19.7k|  FLOAT32 *ptr_qmf_real;
  338|  19.7k|  FLOAT32 *ptr_qmf_imag;
  339|       |
  340|  78.8k|  for (band = 0; band < IXHEAACE_NUM_QMF_BANDS_IN_HYBRID; band++) {
  ------------------
  |  |   26|  78.8k|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  ------------------
  |  Branch (340:18): [True: 59.1k, False: 19.7k]
  ------------------
  341|  59.1k|    const FLOAT32 *ptr_hybrid_real = &ptr_hybrid_real_flt[0][ch_offset];
  342|  59.1k|    const FLOAT32 *ptr_hybrid_imag = &ptr_hybrid_imag_flt[0][ch_offset];
  343|       |
  344|  59.1k|    hybrid_res = (ixheaace_hybrid_res)ptr_hyb_res[band];
  345|       |
  346|  59.1k|    ptr_qmf_real = &ptr_qmf_real_flt[0][band];
  347|  59.1k|    ptr_qmf_imag = &ptr_qmf_imag_flt[0][band];
  348|       |
  349|  1.95M|    for (n = 0; n < IXHEAACE_QMF_TIME_SLOTS; n++) {
  ------------------
  |  |   69|  1.95M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  |  Branch (349:17): [True: 1.89M, False: 59.1k]
  ------------------
  350|  1.89M|      FLOAT32 temo_real = 0, temo_imag = 0;
  351|       |
  352|  11.9M|      for (k = hybrid_res - 1; k >= 0; k--) {
  ------------------
  |  Branch (352:32): [True: 10.0M, False: 1.89M]
  ------------------
  353|  10.0M|        temp1 = *ptr_hybrid_real++;
  354|  10.0M|        temp2 = *ptr_hybrid_imag++;
  355|  10.0M|        temo_real += temp1;
  356|  10.0M|        temo_imag += temp2;
  357|  10.0M|      }
  358|       |
  359|  1.89M|      ptr_hybrid_real += IXHEAACE_QMF_TIME_SLOTS - hybrid_res;
  ------------------
  |  |   69|  1.89M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  360|  1.89M|      ptr_hybrid_imag += IXHEAACE_QMF_TIME_SLOTS - hybrid_res;
  ------------------
  |  |   69|  1.89M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  361|       |
  362|  1.89M|      *ptr_qmf_real = temo_real;
  363|  1.89M|      ptr_qmf_real += IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|  1.89M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  364|       |
  365|  1.89M|      *ptr_qmf_imag = temo_imag;
  366|  1.89M|      ptr_qmf_imag += IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|  1.89M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  367|  1.89M|    }
  368|  59.1k|    ch_offset += hybrid_res;
  369|  59.1k|  }
  370|  19.7k|}
ixheaace_hybrid.c:ixheaace_four_chan_filtering:
   39|  78.8k|                                         ixheaace_common_tables *pstr_common_tab) {
   40|  78.8k|  WORD32 i, k, n;
   41|  78.8k|  WORD32 mid_tap = IXHEAACE_HYBRID_FILTER_DELAY;
  ------------------
  |  |   25|  78.8k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
   42|       |
   43|  78.8k|  FLOAT32 cum[8], *ptr_cum;
   44|  78.8k|  FLOAT32 tmp1, tmp2, tmp_p4;
   45|  78.8k|  FLOAT32 real, imag;
   46|  78.8k|  const FLOAT32 *ptr_re, *ptr_im;
   47|  78.8k|  FLOAT32 *ptr_hy_im, *ptr_hy_re;
   48|  78.8k|  ptr_re = &ptr_qmf_real[0];
   49|  78.8k|  ptr_im = &ptr_qmf_imag[0];
   50|  78.8k|  ptr_hy_re = &ptr_hyb_real[0][ch_offset];
   51|  78.8k|  ptr_hy_im = &ptr_hyb_imag[0][ch_offset];
   52|       |
   53|  2.60M|  for (i = IXHEAACE_QMF_TIME_SLOTS - 1; i >= 0; i--) {
  ------------------
  |  |   69|  78.8k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  |  Branch (53:41): [True: 2.52M, False: 78.8k]
  ------------------
   54|  2.52M|    real = imag = 0;
   55|  12.6M|    for (k = 0; k < 16; k += 4) {
  ------------------
  |  Branch (55:17): [True: 10.0M, False: 2.52M]
  ------------------
   56|  10.0M|      tmp_p4 = ptr_p4_13[k];
   57|  10.0M|      tmp1 = ptr_re[k];
   58|  10.0M|      tmp2 = ptr_im[k];
   59|       |
   60|  10.0M|      tmp1 = tmp_p4 * tmp1;
   61|  10.0M|      real = real - tmp1;
   62|       |
   63|  10.0M|      tmp1 = tmp_p4 * tmp2;
   64|  10.0M|      imag = imag + tmp1;
   65|  10.0M|    }
   66|       |
   67|  2.52M|    cum[3] = imag;
   68|  2.52M|    cum[2] = real;
   69|  2.52M|    real = imag = 0;
   70|       |
   71|  10.0M|    for (k = 3; k < 15; k += 4) {
  ------------------
  |  Branch (71:17): [True: 7.56M, False: 2.52M]
  ------------------
   72|  7.56M|      tmp_p4 = ptr_p4_13[k];
   73|  7.56M|      tmp1 = ptr_re[k];
   74|  7.56M|      tmp2 = ptr_im[k];
   75|  7.56M|      tmp1 = tmp_p4 * tmp1;
   76|  7.56M|      real = real + tmp1;
   77|  7.56M|      tmp1 = tmp_p4 * tmp2;
   78|  7.56M|      imag = imag + tmp1;
   79|  7.56M|    }
   80|       |
   81|  2.52M|    tmp1 = imag + real;
   82|  2.52M|    cum[7] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  2.52M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
   83|  2.52M|    tmp1 = imag - real;
   84|  2.52M|    cum[6] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  2.52M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
   85|       |
   86|  2.52M|    cum[1] = ptr_p4_13[mid_tap] * ptr_re[mid_tap];
   87|  2.52M|    cum[0] = ptr_p4_13[mid_tap] * ptr_im[mid_tap];
   88|       |
   89|  2.52M|    real = imag = 0;
   90|       |
   91|  10.0M|    for (k = 1; k < 13; k += 4) {
  ------------------
  |  Branch (91:17): [True: 7.56M, False: 2.52M]
  ------------------
   92|  7.56M|      tmp_p4 = ptr_p4_13[k];
   93|  7.56M|      tmp1 = ptr_re[k];
   94|  7.56M|      tmp2 = ptr_im[k];
   95|  7.56M|      tmp1 = tmp_p4 * tmp1;
   96|  7.56M|      real = real + tmp1;
   97|  7.56M|      tmp1 = tmp_p4 * tmp2;
   98|  7.56M|      imag = imag + tmp1;
   99|  7.56M|    }
  100|       |
  101|  2.52M|    tmp1 = real - imag;
  102|  2.52M|    cum[5] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  2.52M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  103|  2.52M|    tmp1 = real + imag;
  104|  2.52M|    cum[4] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  2.52M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  105|       |
  106|  2.52M|    ia_enhaacplus_enc_fft((complex *)cum, 4, pstr_common_tab);
  107|       |
  108|  2.52M|    ptr_cum = &cum[0];
  109|       |
  110|  12.6M|    for (n = 3; n >= 0; n--) {
  ------------------
  |  Branch (110:17): [True: 10.0M, False: 2.52M]
  ------------------
  111|  10.0M|      tmp1 = *ptr_cum++;
  112|  10.0M|      tmp2 = *ptr_cum++;
  113|  10.0M|      *ptr_hy_im++ = tmp1;
  114|  10.0M|      *ptr_hy_re++ = tmp2;
  115|  10.0M|    }
  116|  2.52M|    ptr_re++;
  117|  2.52M|    ptr_im++;
  118|  2.52M|    ptr_hy_re += IXHEAACE_QMF_TIME_SLOTS - 4;
  ------------------
  |  |   69|  2.52M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  119|  2.52M|    ptr_hy_im += IXHEAACE_QMF_TIME_SLOTS - 4;
  ------------------
  |  |   69|  2.52M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  120|  2.52M|  }
  121|  78.8k|}
ixheaace_hybrid.c:ixheaace_eight_chan_filtering:
  128|  39.4k|{
  129|  39.4k|  LOOPINDEX i, n;
  130|  39.4k|  LOOPINDEX mid_tap = IXHEAACE_HYBRID_FILTER_DELAY;
  ------------------
  |  |   25|  39.4k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  131|  39.4k|  FLOAT32 real, imag;
  132|  39.4k|  FLOAT32 cum[16], *ptr_cum;
  133|  39.4k|  FLOAT32 tmp1, tmp2, tmp3;
  134|  39.4k|  const FLOAT32 *ptr_re, *ptr_im;
  135|  39.4k|  FLOAT32 *ptr_hy_re, *ptr_hy_im;
  136|  39.4k|  ptr_re = &ptr_qmf_real[0];
  137|  39.4k|  ptr_im = &ptr_qmf_imag[0];
  138|  39.4k|  ptr_hy_re = &ptr_hyb_real[0][0];
  139|  39.4k|  ptr_hy_im = &ptr_hyb_imag[0][0];
  140|       |
  141|  1.30M|  for (i = IXHEAACE_QMF_TIME_SLOTS - 1; i >= 0; i--) {
  ------------------
  |  |   69|  39.4k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  |  Branch (141:41): [True: 1.26M, False: 39.4k]
  ------------------
  142|  1.26M|    tmp1 = ptr_p8_13[4] * ptr_re[4];
  143|  1.26M|    tmp2 = ptr_p8_13[12] * ptr_re[12];
  144|       |
  145|  1.26M|    tmp3 = ptr_im[4];
  146|  1.26M|    real = tmp1 + tmp2;
  147|  1.26M|    tmp2 = ptr_im[12];
  148|  1.26M|    tmp1 = ptr_p8_13[4] * tmp3;
  149|  1.26M|    tmp2 = ptr_p8_13[12] * tmp2;
  150|  1.26M|    imag = tmp1 + tmp2;
  151|       |
  152|  1.26M|    tmp1 = imag - real;
  153|  1.26M|    cum[5] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  1.26M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  154|       |
  155|  1.26M|    tmp1 = imag + real;
  156|  1.26M|    tmp3 = ptr_re[3];
  157|  1.26M|    cum[4] = -tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  1.26M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  158|  1.26M|    tmp2 = ptr_re[11];
  159|  1.26M|    tmp1 = ptr_p8_13[3] * tmp3;
  160|  1.26M|    tmp2 = ptr_p8_13[11] * tmp2;
  161|  1.26M|    tmp3 = ptr_im[3];
  162|  1.26M|    real = tmp1 + tmp2;
  163|  1.26M|    tmp2 = ptr_im[11];
  164|  1.26M|    tmp1 = ptr_p8_13[3] * tmp3;
  165|  1.26M|    tmp2 = ptr_p8_13[11] * tmp2;
  166|  1.26M|    imag = tmp1 + tmp2;
  167|       |
  168|  1.26M|    tmp1 = imag * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  169|  1.26M|    tmp2 = real * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  170|  1.26M|    cum[13] = tmp1 - tmp2;
  171|       |
  172|  1.26M|    tmp1 = imag * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  173|  1.26M|    tmp2 = real * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  174|  1.26M|    tmp3 = ptr_re[2];
  175|  1.26M|    cum[12] = -tmp1 - tmp2;
  176|  1.26M|    tmp2 = ptr_re[10];
  177|  1.26M|    tmp1 = ptr_p8_13[2] * tmp3;
  178|  1.26M|    tmp2 = ptr_p8_13[10] * tmp2;
  179|  1.26M|    tmp3 = ptr_im[2];
  180|  1.26M|    cum[2] = -tmp1 - tmp2;
  181|  1.26M|    tmp2 = ptr_im[10];
  182|  1.26M|    tmp1 = ptr_p8_13[2] * tmp3;
  183|  1.26M|    tmp2 = ptr_p8_13[10] * tmp2;
  184|  1.26M|    cum[3] = tmp1 + tmp2;
  185|       |
  186|  1.26M|    tmp1 = ptr_p8_13[1] * ptr_re[1];
  187|  1.26M|    tmp2 = ptr_p8_13[9] * ptr_re[9];
  188|  1.26M|    real = tmp1 + tmp2;
  189|       |
  190|  1.26M|    tmp1 = ptr_p8_13[1] * ptr_im[1];
  191|  1.26M|    tmp2 = ptr_p8_13[9] * ptr_im[9];
  192|  1.26M|    imag = tmp1 + tmp2;
  193|       |
  194|  1.26M|    tmp1 = imag * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  195|  1.26M|    tmp2 = real * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  196|  1.26M|    cum[11] = tmp1 + tmp2;
  197|       |
  198|  1.26M|    tmp1 = imag * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  199|  1.26M|    tmp2 = real * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  200|  1.26M|    cum[10] = tmp1 - tmp2;
  201|       |
  202|  1.26M|    tmp1 = ptr_p8_13[0] * ptr_re[0];
  203|  1.26M|    tmp2 = ptr_p8_13[8] * ptr_re[8];
  204|  1.26M|    real = tmp1 + tmp2;
  205|       |
  206|  1.26M|    tmp1 = ptr_p8_13[0] * ptr_im[0];
  207|  1.26M|    tmp2 = ptr_p8_13[8] * ptr_im[8];
  208|  1.26M|    imag = tmp1 + tmp2;
  209|       |
  210|  1.26M|    tmp1 = imag + real;
  211|  1.26M|    cum[7] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  1.26M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  212|       |
  213|  1.26M|    tmp1 = imag - real;
  214|  1.26M|    cum[6] = tmp1 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  1.26M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  215|       |
  216|  1.26M|    real = ptr_p8_13[7] * ptr_re[7];
  217|  1.26M|    imag = ptr_p8_13[7] * ptr_im[7];
  218|       |
  219|  1.26M|    tmp1 = imag * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  220|  1.26M|    tmp2 = real * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  221|  1.26M|    cum[15] = tmp1 + tmp2;
  222|       |
  223|  1.26M|    tmp1 = imag * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  224|  1.26M|    tmp2 = real * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  225|  1.26M|    cum[14] = tmp1 - tmp2;
  226|       |
  227|  1.26M|    cum[1] = ptr_p8_13[mid_tap] * ptr_re[mid_tap];
  228|  1.26M|    cum[0] = ptr_p8_13[mid_tap] * ptr_im[mid_tap];
  229|       |
  230|  1.26M|    real = ptr_p8_13[5] * ptr_re[5];
  231|  1.26M|    imag = ptr_p8_13[5] * ptr_im[5];
  232|       |
  233|  1.26M|    tmp1 = real * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  234|  1.26M|    tmp2 = imag * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  235|  1.26M|    cum[9] = tmp1 - tmp2;
  236|       |
  237|  1.26M|    tmp1 = real * IXHEAACE_SIN_PI_BY_8;
  ------------------
  |  |   25|  1.26M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
  238|  1.26M|    tmp2 = imag * IXHEAACE_COS_PI_BY_8;
  ------------------
  |  |   24|  1.26M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
  239|  1.26M|    cum[8] = tmp1 + tmp2;
  240|       |
  241|  1.26M|    ia_enhaacplus_enc_fft((complex *)cum, 8, pstr_common_tab);
  242|       |
  243|  1.26M|    ptr_cum = &cum[0];
  244|       |
  245|  11.3M|    for (n = 7; n >= 0; n--) {
  ------------------
  |  Branch (245:17): [True: 10.0M, False: 1.26M]
  ------------------
  246|  10.0M|      tmp1 = *ptr_cum++;
  247|  10.0M|      tmp2 = *ptr_cum++;
  248|  10.0M|      *ptr_hy_im++ = tmp1;
  249|  10.0M|      *ptr_hy_re++ = tmp2;
  250|  10.0M|    }
  251|  1.26M|    ptr_re++;
  252|  1.26M|    ptr_im++;
  253|  1.26M|    ptr_hy_re += IXHEAACE_QMF_TIME_SLOTS - 8;
  ------------------
  |  |   69|  1.26M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  254|  1.26M|    ptr_hy_im += IXHEAACE_QMF_TIME_SLOTS - 8;
  ------------------
  |  |   69|  1.26M|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  255|  1.26M|  }
  256|  39.4k|}

ixheaace_create_hybrid_filter_bank:
   34|    492|ixheaace_create_hybrid_filter_bank(ixheaace_pstr_hybrid pstr_hybrid, FLOAT32 **pptr_flt) {
   35|    492|  LOOPINDEX i;
   36|    492|  FLOAT32 *ptr_flt = *pptr_flt;
   37|       |
   38|    492|  pstr_hybrid->ptr_work_real = ptr_flt;
   39|    492|  ptr_flt += (IXHEAACE_QMF_TIME_SLOTS + IXHEAACE_QMF_BUFFER_MOVE);
  ------------------
  |  |   69|    492|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
                ptr_flt += (IXHEAACE_QMF_TIME_SLOTS + IXHEAACE_QMF_BUFFER_MOVE);
  ------------------
  |  |   24|    492|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|    492|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
   40|    492|  pstr_hybrid->ptr_work_imag = ptr_flt;
   41|    492|  ptr_flt += (IXHEAACE_QMF_TIME_SLOTS + IXHEAACE_QMF_BUFFER_MOVE);
  ------------------
  |  |   69|    492|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
                ptr_flt += (IXHEAACE_QMF_TIME_SLOTS + IXHEAACE_QMF_BUFFER_MOVE);
  ------------------
  |  |   24|    492|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|    492|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
   42|       |
   43|    492|  pstr_hybrid->ptr_qmf_buf_real = (FLOAT32 **)ptr_flt;
   44|    492|  ptr_flt += IXHEAACE_NUM_QMF_BANDS_IN_HYBRID * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   26|    492|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  ------------------
   45|       |
   46|    492|  pstr_hybrid->ptr_qmf_buf_imag = (FLOAT32 **)ptr_flt;
   47|    492|  ptr_flt += IXHEAACE_NUM_QMF_BANDS_IN_HYBRID * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   26|    492|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  ------------------
   48|       |
   49|  1.96k|  for (i = 0; i < IXHEAACE_NUM_QMF_BANDS_IN_HYBRID; i++) {
  ------------------
  |  |   26|  1.96k|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  ------------------
  |  Branch (49:15): [True: 1.47k, False: 492]
  ------------------
   50|  1.47k|    pstr_hybrid->ptr_qmf_buf_real[i] = ptr_flt;
   51|  1.47k|    ptr_flt += IXHEAACE_QMF_BUFFER_MOVE;
  ------------------
  |  |   24|  1.47k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|  1.47k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
   52|       |
   53|  1.47k|    memset(pstr_hybrid->ptr_qmf_buf_real[i], 0,
   54|  1.47k|           IXHEAACE_QMF_BUFFER_MOVE * sizeof(pstr_hybrid->ptr_qmf_buf_real[0]));
  ------------------
  |  |   24|  1.47k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|  1.47k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
   55|       |
   56|  1.47k|    pstr_hybrid->ptr_qmf_buf_imag[i] = ptr_flt;
   57|  1.47k|    ptr_flt += IXHEAACE_QMF_BUFFER_MOVE;
  ------------------
  |  |   24|  1.47k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|  1.47k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
   58|       |
   59|  1.47k|    memset(pstr_hybrid->ptr_qmf_buf_imag[i], 0,
   60|  1.47k|           IXHEAACE_QMF_BUFFER_MOVE * sizeof(pstr_hybrid->ptr_qmf_buf_imag[0]));
  ------------------
  |  |   24|  1.47k|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  ------------------
  |  |  |  |   23|  1.47k|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  ------------------
  ------------------
   61|  1.47k|  }
   62|       |
   63|    492|  *pptr_flt = ptr_flt;
   64|    492|  return IA_NO_ERROR;
  ------------------
  |  |   23|    492|#define IA_NO_ERROR 0x00000000
  ------------------
   65|    492|}

ia_enhaacplus_enc_build_interface:
   43|   449k|    const WORD32 *ptr_group_len, ixheaace_psy_out_channel *pstr_psy_out_ch) {
   44|   449k|  WORD32 j;
   45|   449k|  WORD32 grp;
   46|   449k|  WORD32 mask;
   47|       |
   48|       |  /* Copy values to psy_out */
   49|   449k|  pstr_psy_out_ch->max_sfb_per_grp = max_sfb_per_grp;
   50|   449k|  pstr_psy_out_ch->sfb_count = grouped_sfb_cnt;
   51|   449k|  pstr_psy_out_ch->sfb_per_group = grouped_sfb_cnt / total_groups_cnt;
   52|   449k|  pstr_psy_out_ch->window_sequence = win_seq;
   53|   449k|  pstr_psy_out_ch->window_shape = win_shape;
   54|   449k|  pstr_psy_out_ch->ptr_spec_coeffs = ptr_grouped_mdct_spec;
   55|       |
   56|   449k|  pstr_psy_out_ch->ptr_sfb_energy = pstr_grouped_sfb_nrg->long_nrg;
   57|   449k|  pstr_psy_out_ch->ptr_sfb_thr = pstr_grouped_sfb_thres->long_nrg;
   58|   449k|  pstr_psy_out_ch->ptr_sfb_spread_energy = pstr_grouped_sfb_spreaded_nrg->long_nrg;
   59|       |
   60|   449k|  memcpy(&pstr_psy_out_ch->sfb_offsets[0], &ptr_grouped_sfb_offset[0],
   61|   449k|         sizeof(pstr_psy_out_ch->sfb_offsets[0]) * (grouped_sfb_cnt + 1));
   62|   449k|  memcpy(&pstr_psy_out_ch->sfb_min_snr[0], &ptr_grouped_sfb_min_snr[0],
   63|   449k|         sizeof(pstr_psy_out_ch->sfb_min_snr[0]) * (grouped_sfb_cnt));
   64|       |
   65|       |  /* Generate grouping mask */
   66|   449k|  mask = 0;
   67|       |
   68|  1.14M|  for (grp = 0; grp < total_groups_cnt; grp++) {
  ------------------
  |  Branch (68:17): [True: 699k, False: 449k]
  ------------------
   69|   699k|    mask <<= 1;
   70|       |
   71|  1.05M|    for (j = 1; j < ptr_group_len[grp]; j++) {
  ------------------
  |  Branch (71:17): [True: 358k, False: 699k]
  ------------------
   72|   358k|      mask <<= 1;
   73|   358k|      mask |= 1;
   74|   358k|    }
   75|   699k|  }
   76|       |  /* copy energy sums to psy_out for stereo preprocessing */
   77|   449k|  if (win_seq != SHORT_WINDOW) {
  ------------------
  |  |   33|   449k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (77:7): [True: 362k, False: 86.9k]
  ------------------
   78|   362k|    pstr_psy_out_ch->sfb_sum_lr_energy = sfb_nrg_sum_lr.long_nrg;
   79|   362k|    pstr_psy_out_ch->sfb_sum_ms_energy = sfb_nrg_sum_ms.long_nrg;
   80|   362k|  } else {
   81|  86.9k|    int i;
   82|       |
   83|  86.9k|    pstr_psy_out_ch->sfb_sum_ms_energy = 0;
   84|  86.9k|    pstr_psy_out_ch->sfb_sum_lr_energy = 0;
   85|       |
   86|   782k|    for (i = 0; i < TRANS_FAC; i++) {
  ------------------
  |  |   29|   782k|#define TRANS_FAC 8
  ------------------
  |  Branch (86:17): [True: 695k, False: 86.9k]
  ------------------
   87|   695k|      pstr_psy_out_ch->sfb_sum_lr_energy += sfb_nrg_sum_lr.short_nrg[i];
   88|   695k|      pstr_psy_out_ch->sfb_sum_ms_energy += sfb_nrg_sum_ms.short_nrg[i];
   89|   695k|    }
   90|  86.9k|  }
   91|       |
   92|   449k|  pstr_psy_out_ch->grouping_mask = mask;
   93|   449k|}

ixheaace_loudness_info_get_handle_size:
  135|  5.27k|WORD32 ixheaace_loudness_info_get_handle_size() {
  136|  5.27k|  return IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_loudness_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  5.27k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  137|  5.27k|}
ixheaace_loudness_init_params:
  140|  5.27k|                                           ixheaace_output_config *pstr_output_config) {
  141|  5.27k|  UWORD32 count = 0;
  142|  5.27k|  UWORD8 temp_count = 0;
  143|  5.27k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  5.27k|#define IA_NO_ERROR 0x00000000
  ------------------
  144|  5.27k|  ixheaace_loudness_struct *pstr_loudness_hdl = (ixheaace_loudness_struct *)loudness_handle;
  145|  5.27k|  memset(pstr_loudness_hdl, 0, sizeof(ixheaace_loudness_struct));
  146|  5.27k|  pstr_loudness_hdl->sample_rate =
  147|  5.27k|      ixheaace_map_sample_rate(pstr_input_config->i_samp_freq, pstr_loudness_hdl);
  148|       |
  149|  5.27k|  pstr_output_config->samp_freq = pstr_loudness_hdl->sample_rate;
  150|  5.27k|  pstr_loudness_hdl->length = pstr_input_config->aac_config.length;
  151|  5.27k|  pstr_loudness_hdl->pcm_sz = pstr_input_config->ui_pcm_wd_sz;
  152|  5.27k|  if (pstr_loudness_hdl->pcm_sz != 16) {
  ------------------
  |  Branch (152:7): [True: 922, False: 4.35k]
  ------------------
  153|    922|    return (IA_EXHEAACE_CONFIG_FATAL_PCM_WDSZ);
  154|    922|  }
  155|  4.35k|  pstr_loudness_hdl->n_channels = pstr_input_config->i_channels;
  156|  4.35k|  if (pstr_loudness_hdl->n_channels > 2 || pstr_loudness_hdl->n_channels < 1) {
  ------------------
  |  Branch (156:7): [True: 66, False: 4.29k]
  |  Branch (156:44): [True: 1, False: 4.29k]
  ------------------
  157|     67|    return (IA_EXHEAACE_CONFIG_FATAL_NUM_CHANNELS);
  158|     67|  }
  159|  4.29k|  pstr_loudness_hdl->num_samples_per_ch = (pstr_loudness_hdl->sample_rate / 10);
  160|  4.29k|  pstr_loudness_hdl->sum_square = 0;
  161|  4.29k|  pstr_loudness_hdl->mom_loudness_first_time_flag = 1;
  162|       |
  163|  4.29k|  pstr_loudness_hdl->count_fn_call_mmstl = 0;
  164|  4.29k|  pstr_loudness_hdl->sl_first_time_flag = 1;
  165|  4.29k|  pstr_loudness_hdl->local_sl_count = 0;
  166|  4.29k|  pstr_loudness_hdl->short_term_loudness_overlap = IXHEAACE_SL_OVERLAP;
  ------------------
  |  |   29|  4.29k|#define IXHEAACE_SL_OVERLAP (20)
  ------------------
  167|       |
  168|  4.29k|  pstr_loudness_hdl->no_of_mf = IXHEAACE_SEC_TO_100MS_FACTOR;
  ------------------
  |  |   34|  4.29k|#define IXHEAACE_SEC_TO_100MS_FACTOR (60 * 10)
  ------------------
  169|  4.29k|  pstr_loudness_hdl->no_of_mf -= IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP;
  ------------------
  |  |   28|  4.29k|#define IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP (3)
  ------------------
  170|  4.29k|  pstr_loudness_hdl->no_of_stf =
  171|  4.29k|      (((pstr_loudness_hdl->no_of_mf + IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP) - 30) /
  ------------------
  |  |   28|  4.29k|#define IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP (3)
  ------------------
  172|  4.29k|       (30 - pstr_loudness_hdl->short_term_loudness_overlap)) +
  173|  4.29k|      1;
  174|       |
  175|  4.29k|  pstr_loudness_hdl->tot_int_val_stf_passing_abs_gate = 0;
  176|  4.29k|  pstr_loudness_hdl->curr_stf_no = 0;
  177|  4.29k|  pstr_loudness_hdl->loop_curr_stf_no = 0;
  178|  4.29k|  pstr_loudness_hdl->no_of_stf_passing_abs_gate = 0;
  179|  4.29k|  pstr_loudness_hdl->max_lra_count = pstr_loudness_hdl->no_of_stf;
  180|  4.29k|  pstr_loudness_hdl->loop_ml_count_fn_call = 0;
  181|  4.29k|  pstr_loudness_hdl->ml_count_fn_call = 0;
  182|  4.29k|  pstr_loudness_hdl->max_il_buf_size = pstr_loudness_hdl->no_of_mf;
  183|  4.29k|  pstr_loudness_hdl->get_intergrated_loudness = 1;
  184|  4.29k|  pstr_loudness_hdl->max_sample_val = FLT_EPSILON;
  185|       |
  186|  11.5k|  for (count = 0; count < pstr_loudness_hdl->n_channels; count++) {
  ------------------
  |  Branch (186:19): [True: 7.25k, False: 4.29k]
  ------------------
  187|  29.0k|    for (temp_count = 0; temp_count < IXHEAACE_LOUDNESS_NUM_TAPS; temp_count++) {
  ------------------
  |  |   23|  29.0k|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (187:26): [True: 21.7k, False: 7.25k]
  ------------------
  188|  21.7k|      pstr_loudness_hdl->w[0][count][temp_count] = 0;
  189|  21.7k|      pstr_loudness_hdl->w[1][count][temp_count] = 0;
  190|  21.7k|    }
  191|  7.25k|  }
  192|       |
  193|  21.4k|  for (count = 0; count < 4; count++) {
  ------------------
  |  Branch (193:19): [True: 17.1k, False: 4.29k]
  ------------------
  194|  17.1k|    pstr_loudness_hdl->prev_four_sum_square[count] = 0;
  195|  17.1k|  }
  196|       |
  197|   132k|  for (count = 0; count < 30; count++) {
  ------------------
  |  Branch (197:19): [True: 128k, False: 4.29k]
  ------------------
  198|   128k|    pstr_loudness_hdl->prev_thirty_sum_square[count] = 0;
  199|   128k|  }
  200|       |
  201|  4.29k|  count = 0;
  202|   253k|  while (count < (pstr_loudness_hdl->no_of_stf)) {
  ------------------
  |  Branch (202:10): [True: 248k, False: 4.29k]
  ------------------
  203|   248k|    pstr_loudness_hdl->temp_stf_instances_loudness[count] = 0;
  204|   248k|    count++;
  205|   248k|  }
  206|       |
  207|  4.29k|  count = 0;
  208|   253k|  while (count < (pstr_loudness_hdl->no_of_stf)) {
  ------------------
  |  Branch (208:10): [True: 248k, False: 4.29k]
  ------------------
  209|   248k|    pstr_loudness_hdl->stf_instances[count].short_term_loudness =
  210|   248k|        IXHEAACE_DEFAULT_SHORT_TERM_LOUDENSS;
  ------------------
  |  |   32|   248k|#define IXHEAACE_DEFAULT_SHORT_TERM_LOUDENSS (-1000)
  ------------------
  211|   248k|    pstr_loudness_hdl->stf_instances[count].int_val = 0;
  212|   248k|    pstr_loudness_hdl->stf_instances[count].passes_abs_gate = FALSE;
  ------------------
  |  |   26|   248k|#define FALSE (0)
  ------------------
  213|   248k|    count++;
  214|   248k|  }
  215|       |
  216|  4.29k|  count = 0;
  217|  2.56M|  while (count < pstr_loudness_hdl->no_of_mf) {
  ------------------
  |  Branch (217:10): [True: 2.56M, False: 4.29k]
  ------------------
  218|  2.56M|    pstr_loudness_hdl->mf_instances[count].momentary_loudness =
  219|  2.56M|        IXHEAACE_DEFAULT_MOMENTARY_LOUDENSS;
  ------------------
  |  |   33|  2.56M|#define IXHEAACE_DEFAULT_MOMENTARY_LOUDENSS (-1000)
  ------------------
  220|  2.56M|    pstr_loudness_hdl->mf_instances[count].int_val = 0.0;
  221|  2.56M|    pstr_loudness_hdl->mf_instances[count].passes_abs_gate = FALSE;
  ------------------
  |  |   26|  2.56M|#define FALSE (0)
  ------------------
  222|  2.56M|    count++;
  223|  2.56M|  }
  224|  4.29k|  return err_code;
  225|  4.35k|}
ixheaace_measure_integrated_loudness:
  349|     20|FLOAT64 ixheaace_measure_integrated_loudness(pVOID loudness_handle) {
  350|     20|  UWORD32 count = 0;
  351|     20|  FLOAT64 avg = 0;
  352|     20|  FLOAT64 loudness = 0;
  353|     20|  ixheaace_loudness_struct *pstr_loudness_hdl = (ixheaace_loudness_struct *)loudness_handle;
  354|     20|  pstr_loudness_hdl->no_of_mf_passing_rel_gate = 0;
  355|     20|  pstr_loudness_hdl->tot_int_val_mf_passing_rel_gate = 0;
  356|       |
  357|     20|  if (pstr_loudness_hdl->no_of_mf_passing_abs_gate) {
  ------------------
  |  Branch (357:7): [True: 12, False: 8]
  ------------------
  358|     12|    avg = (pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate /
  359|     12|           pstr_loudness_hdl->no_of_mf_passing_abs_gate);
  360|     12|  } else {
  361|      8|    avg = IXHEAACE_SUM_SQUARE_EPS / pstr_loudness_hdl->num_samples_per_ch;
  ------------------
  |  |   35|      8|#define IXHEAACE_SUM_SQUARE_EPS (1/32768.0f * 1/32768.0f)
  ------------------
  362|      8|  }
  363|     20|  pstr_loudness_hdl->rel_gate = -0.691 + 10 * log10(avg) - 10;
  364|       |
  365|    736|  while (count < pstr_loudness_hdl->ml_count_fn_call) {
  ------------------
  |  Branch (365:10): [True: 716, False: 20]
  ------------------
  366|    716|    if (pstr_loudness_hdl->mf_instances[count].momentary_loudness >=
  ------------------
  |  Branch (366:9): [True: 293, False: 423]
  ------------------
  367|    716|        pstr_loudness_hdl->rel_gate) {
  368|    293|      pstr_loudness_hdl->no_of_mf_passing_rel_gate++;
  369|    293|      pstr_loudness_hdl->tot_int_val_mf_passing_rel_gate +=
  370|    293|          pstr_loudness_hdl->mf_instances[count].int_val;
  371|    293|    }
  372|    716|    count++;
  373|    716|  }
  374|       |
  375|     20|  if (pstr_loudness_hdl->no_of_mf_passing_rel_gate) {
  ------------------
  |  Branch (375:7): [True: 14, False: 6]
  ------------------
  376|     14|    loudness = -0.691 + 10 * log10((pstr_loudness_hdl->tot_int_val_mf_passing_rel_gate /
  377|     14|                                    (FLOAT64)pstr_loudness_hdl->no_of_mf_passing_rel_gate));
  378|     14|  } else {
  379|      6|    loudness =
  380|      6|        -0.691 + 10 * log10(IXHEAACE_SUM_SQUARE_EPS / pstr_loudness_hdl->num_samples_per_ch);
  ------------------
  |  |   35|      6|#define IXHEAACE_SUM_SQUARE_EPS (1/32768.0f * 1/32768.0f)
  ------------------
  381|      6|  }
  382|       |
  383|     20|  return loudness;
  384|     20|}
ixheaace_measure_loudness:
  386|  43.5k|FLOAT64 ixheaace_measure_loudness(pVOID loudness_handle, WORD16 **samples) {
  387|  43.5k|  FLOAT64 loudness_value;
  388|  43.5k|  ixheaace_loudness_struct *pstr_loudness_hdl = (ixheaace_loudness_struct *)loudness_handle;
  389|  43.5k|  ixheaace_measure_sum_square(samples, pstr_loudness_hdl);
  390|  43.5k|  loudness_value = ixheaace_measure_momentary_loudness(pstr_loudness_hdl);
  391|  43.5k|  pstr_loudness_hdl->count_fn_call_mmstl++;
  392|  43.5k|  return loudness_value;
  393|  43.5k|}
ixheaace_loudness_measurement.c:ixheaace_map_sample_rate:
   89|  5.27k|                                       ixheaace_loudness_struct *pstr_loudness_hdl) {
   90|  5.27k|  WORD32 mapped_sample_rate = sample_rate;
   91|       |
   92|  5.27k|  if ((mapped_sample_rate >= 0) && (mapped_sample_rate < 9391)) {
  ------------------
  |  Branch (92:7): [True: 5.17k, False: 100]
  |  Branch (92:36): [True: 413, False: 4.76k]
  ------------------
   93|    413|    mapped_sample_rate = 8000;
   94|    413|    pstr_loudness_hdl->sample_rate_idx = 11;
   95|  4.86k|  } else if ((mapped_sample_rate >= 9391) && (mapped_sample_rate < 11502)) {
  ------------------
  |  Branch (95:14): [True: 4.76k, False: 100]
  |  Branch (95:46): [True: 146, False: 4.62k]
  ------------------
   96|    146|    mapped_sample_rate = 11025;
   97|    146|    pstr_loudness_hdl->sample_rate_idx = 10;
   98|  4.72k|  } else if ((mapped_sample_rate >= 11502) && (mapped_sample_rate < 13856)) {
  ------------------
  |  Branch (98:14): [True: 4.62k, False: 100]
  |  Branch (98:47): [True: 183, False: 4.43k]
  ------------------
   99|    183|    mapped_sample_rate = 12000;
  100|    183|    pstr_loudness_hdl->sample_rate_idx = 9;
  101|  4.53k|  } else if ((mapped_sample_rate >= 13856) && (mapped_sample_rate < 18783)) {
  ------------------
  |  Branch (101:14): [True: 4.43k, False: 100]
  |  Branch (101:47): [True: 251, False: 4.18k]
  ------------------
  102|    251|    mapped_sample_rate = 16000;
  103|    251|    pstr_loudness_hdl->sample_rate_idx = 8;
  104|  4.28k|  } else if ((mapped_sample_rate >= 18783) && (mapped_sample_rate < 23004)) {
  ------------------
  |  Branch (104:14): [True: 4.18k, False: 100]
  |  Branch (104:47): [True: 134, False: 4.05k]
  ------------------
  105|    134|    mapped_sample_rate = 22050;
  106|    134|    pstr_loudness_hdl->sample_rate_idx = 7;
  107|  4.15k|  } else if ((mapped_sample_rate >= 23004) && (mapped_sample_rate < 27713)) {
  ------------------
  |  Branch (107:14): [True: 4.05k, False: 100]
  |  Branch (107:47): [True: 320, False: 3.73k]
  ------------------
  108|    320|    mapped_sample_rate = 24000;
  109|    320|    pstr_loudness_hdl->sample_rate_idx = 6;
  110|  3.83k|  } else if ((mapped_sample_rate >= 27713) && (mapped_sample_rate < 37566)) {
  ------------------
  |  Branch (110:14): [True: 3.73k, False: 100]
  |  Branch (110:47): [True: 794, False: 2.93k]
  ------------------
  111|    794|    mapped_sample_rate = 32000;
  112|    794|    pstr_loudness_hdl->sample_rate_idx = 5;
  113|  3.03k|  } else if ((mapped_sample_rate >= 37566) && (mapped_sample_rate < 46009)) {
  ------------------
  |  Branch (113:14): [True: 2.93k, False: 100]
  |  Branch (113:47): [True: 709, False: 2.22k]
  ------------------
  114|    709|    mapped_sample_rate = 44100;
  115|    709|    pstr_loudness_hdl->sample_rate_idx = 4;
  116|  2.32k|  } else if ((mapped_sample_rate >= 46009) && (mapped_sample_rate < 55426)) {
  ------------------
  |  Branch (116:14): [True: 2.22k, False: 100]
  |  Branch (116:47): [True: 1.05k, False: 1.17k]
  ------------------
  117|  1.05k|    mapped_sample_rate = 48000;
  118|  1.05k|    pstr_loudness_hdl->sample_rate_idx = 3;
  119|  1.27k|  } else if ((mapped_sample_rate >= 55426) && (mapped_sample_rate < 75132)) {
  ------------------
  |  Branch (119:14): [True: 1.17k, False: 100]
  |  Branch (119:47): [True: 547, False: 631]
  ------------------
  120|    547|    mapped_sample_rate = 64000;
  121|    547|    pstr_loudness_hdl->sample_rate_idx = 2;
  122|    731|  } else if ((mapped_sample_rate >= 75132) && (mapped_sample_rate < 92017)) {
  ------------------
  |  Branch (122:14): [True: 631, False: 100]
  |  Branch (122:47): [True: 385, False: 246]
  ------------------
  123|    385|    mapped_sample_rate = 88200;
  124|    385|    pstr_loudness_hdl->sample_rate_idx = 1;
  125|    385|  } else if (mapped_sample_rate >= 92017) {
  ------------------
  |  Branch (125:14): [True: 246, False: 100]
  ------------------
  126|    246|    mapped_sample_rate = 96000;
  127|    246|    pstr_loudness_hdl->sample_rate_idx = 0;
  128|    246|  } else {
  129|    100|    mapped_sample_rate = 48000;
  130|    100|    pstr_loudness_hdl->sample_rate_idx = 3;
  131|    100|  }
  132|  5.27k|  return mapped_sample_rate;
  133|  5.27k|}
ixheaace_loudness_measurement.c:ixheaace_measure_sum_square:
  265|  43.5k|                                        ixheaace_loudness_struct *pstr_loudness_hdl) {
  266|  43.5k|  FLOAT64 tot_one_channel = 0;
  267|  43.5k|  FLOAT64 sum_square = 0;
  268|  43.5k|  UWORD32 count = 0;
  269|  43.5k|  FLOAT64 temp = 0;
  270|  43.5k|  UWORD8 channel_no = 0;
  271|  43.5k|  FLOAT64 input_sample;
  272|   107k|  for (channel_no = 0; channel_no < pstr_loudness_hdl->n_channels; channel_no++) {
  ------------------
  |  Branch (272:24): [True: 64.2k, False: 43.5k]
  ------------------
  273|  64.2k|    tot_one_channel = 0;
  274|   191M|    for (count = 0; count < pstr_loudness_hdl->num_samples_per_ch; count++) {
  ------------------
  |  Branch (274:21): [True: 191M, False: 64.2k]
  ------------------
  275|   191M|      input_sample = (FLOAT64)input[channel_no][count] / 32768.0;
  276|   191M|      pstr_loudness_hdl->max_sample_val =
  277|   191M|          MAX(fabs(input_sample), pstr_loudness_hdl->max_sample_val);
  ------------------
  |  |   31|   191M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (31:20): [True: 5.53k, False: 191M]
  |  |  ------------------
  ------------------
  278|   191M|      temp = ixheaace_loudness_k_flt(input_sample, pstr_loudness_hdl, channel_no);
  279|   191M|      tot_one_channel = tot_one_channel + (temp * temp);
  280|   191M|    }
  281|  64.2k|    sum_square += tot_one_channel;
  282|  64.2k|  }
  283|  43.5k|  pstr_loudness_hdl->sum_square = sum_square;
  284|  43.5k|}
ixheaace_loudness_measurement.c:ixheaace_loudness_k_flt:
  249|   191M|                                       UWORD8 channel_no) {
  250|   191M|  FLOAT64 temp;
  251|   191M|  temp = ixheaace_loudness_gen_flt(a_coeff_pre_flt[pstr_loudness_hdl->sample_rate_idx],
  252|   191M|                                   b_coeff_pre_flt[pstr_loudness_hdl->sample_rate_idx],
  253|   191M|                                   pstr_loudness_hdl->w[IXHEAACE_LOUDNESS_PRE_FLT][channel_no],
  ------------------
  |  |   24|   191M|#define IXHEAACE_LOUDNESS_PRE_FLT (0)
  ------------------
  254|   191M|                                   input);
  255|       |
  256|   191M|  temp = ixheaace_loudness_gen_flt(a_coeff_RLB_flt[pstr_loudness_hdl->sample_rate_idx],
  257|   191M|                                   b_coeff_RLB_flt[pstr_loudness_hdl->sample_rate_idx],
  258|   191M|                                   pstr_loudness_hdl->w[IXHEAACE_LOUDNESS_RLB_FLT][channel_no],
  ------------------
  |  |   25|   191M|#define IXHEAACE_LOUDNESS_RLB_FLT (1)
  ------------------
  259|   191M|                                   temp);
  260|       |
  261|   191M|  return temp;
  262|   191M|}
ixheaace_loudness_measurement.c:ixheaace_loudness_gen_flt:
  227|   383M|static FLOAT64 ixheaace_loudness_gen_flt(FLOAT64 *a, FLOAT64 *b, FLOAT64 *w, FLOAT64 input) {
  228|   383M|  FLOAT64 output = 0;
  229|   383M|  UWORD8 count;
  230|       |
  231|  1.15G|  for (count = 0; count <= IXHEAACE_LOUDNESS_NUM_TAPS - 2; count++) {
  ------------------
  |  |   23|  1.15G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (231:19): [True: 767M, False: 383M]
  ------------------
  232|   767M|    w[count] = w[count + 1];
  233|   767M|  }
  234|   383M|  w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] = 0;
  ------------------
  |  |   23|   383M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  235|       |
  236|  1.15G|  for (count = 1; count <= IXHEAACE_LOUDNESS_NUM_TAPS - 1; count++) {
  ------------------
  |  |   23|  1.15G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (236:19): [True: 767M, False: 383M]
  ------------------
  237|   767M|    w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] += a[count] * w[IXHEAACE_LOUDNESS_NUM_TAPS - count - 1];
  ------------------
  |  |   23|   767M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
                  w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] += a[count] * w[IXHEAACE_LOUDNESS_NUM_TAPS - count - 1];
  ------------------
  |  |   23|   767M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  238|   767M|  }
  239|   383M|  w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] = input - w[IXHEAACE_LOUDNESS_NUM_TAPS - 1];
  ------------------
  |  |   23|   383M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
                w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] = input - w[IXHEAACE_LOUDNESS_NUM_TAPS - 1];
  ------------------
  |  |   23|   383M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  240|       |
  241|  1.53G|  for (count = 0; count <= IXHEAACE_LOUDNESS_NUM_TAPS - 1; count++) {
  ------------------
  |  |   23|  1.53G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (241:19): [True: 1.15G, False: 383M]
  ------------------
  242|  1.15G|    output += b[count] * w[IXHEAACE_LOUDNESS_NUM_TAPS - count - 1];
  ------------------
  |  |   23|  1.15G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  243|  1.15G|  }
  244|       |
  245|   383M|  return output;
  246|   383M|}
ixheaace_loudness_measurement.c:ixheaace_measure_momentary_loudness:
  286|  43.5k|static FLOAT64 ixheaace_measure_momentary_loudness(ixheaace_loudness_struct *pstr_loudness_hdl) {
  287|  43.5k|  FLOAT64 sum = 0;
  288|  43.5k|  FLOAT64 momentary_loudness;
  289|  43.5k|  UWORD32 count = 0;
  290|  43.5k|  FLOAT64 old_ml_val, db_old_ml_val;
  291|  43.5k|  {
  292|   174k|    for (count = 0; count <= 2; count++) {
  ------------------
  |  Branch (292:21): [True: 130k, False: 43.5k]
  ------------------
  293|   130k|      pstr_loudness_hdl->prev_four_sum_square[count] =
  294|   130k|          pstr_loudness_hdl->prev_four_sum_square[count + 1];
  295|   130k|      sum += pstr_loudness_hdl->prev_four_sum_square[count];
  296|   130k|    }
  297|       |
  298|  43.5k|    pstr_loudness_hdl->prev_four_sum_square[3] = pstr_loudness_hdl->sum_square;
  299|  43.5k|    sum += pstr_loudness_hdl->prev_four_sum_square[3];
  300|       |
  301|  43.5k|    if ((pstr_loudness_hdl->mom_loudness_first_time_flag == 1) &&
  ------------------
  |  Branch (301:9): [True: 7.46k, False: 36.1k]
  ------------------
  302|  7.46k|        (pstr_loudness_hdl->count_fn_call_mmstl <= 2)) {
  ------------------
  |  Branch (302:9): [True: 6.57k, False: 882]
  ------------------
  303|  6.57k|      momentary_loudness = IXHEAACE_LOUDNESS_DONT_PASS;
  ------------------
  |  |   26|  6.57k|#define IXHEAACE_LOUDNESS_DONT_PASS (-1)
  ------------------
  304|  37.0k|    } else {
  305|  37.0k|      pstr_loudness_hdl->mom_loudness_first_time_flag = 0;
  306|  37.0k|      momentary_loudness =
  307|  37.0k|          -0.691 + 10 * log10(sum / ((FLOAT64)(4 * pstr_loudness_hdl->num_samples_per_ch)));
  308|       |
  309|  37.0k|      if (pstr_loudness_hdl->get_intergrated_loudness == 1) {
  ------------------
  |  Branch (309:11): [True: 37.0k, False: 0]
  ------------------
  310|  37.0k|        old_ml_val =
  311|  37.0k|            pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call].int_val;
  312|  37.0k|        pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call].int_val =
  313|  37.0k|            sum / ((FLOAT64)(4 * pstr_loudness_hdl->num_samples_per_ch));
  314|  37.0k|        db_old_ml_val = pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call]
  315|  37.0k|                            .momentary_loudness;
  316|  37.0k|        pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call]
  317|  37.0k|            .momentary_loudness = momentary_loudness;
  318|  37.0k|        if (pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call]
  ------------------
  |  Branch (318:13): [True: 25.2k, False: 11.7k]
  ------------------
  319|  37.0k|                .momentary_loudness >= IXHEAACE_ABS_GATE) {
  ------------------
  |  |   27|  37.0k|#define IXHEAACE_ABS_GATE (-70)
  ------------------
  320|  25.2k|          if (db_old_ml_val < IXHEAACE_ABS_GATE) {
  ------------------
  |  |   27|  25.2k|#define IXHEAACE_ABS_GATE (-70)
  ------------------
  |  Branch (320:15): [True: 25.1k, False: 88]
  ------------------
  321|  25.1k|            pstr_loudness_hdl->no_of_mf_passing_abs_gate++;
  322|  25.1k|            old_ml_val = 0;
  323|  25.1k|          }
  324|       |
  325|  25.2k|          pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate =
  326|  25.2k|              pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate +
  327|  25.2k|              (pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call].int_val -
  328|  25.2k|               old_ml_val);
  329|  25.2k|        } else {
  330|  11.7k|          if (db_old_ml_val >= IXHEAACE_ABS_GATE) {
  ------------------
  |  |   27|  11.7k|#define IXHEAACE_ABS_GATE (-70)
  ------------------
  |  Branch (330:15): [True: 103, False: 11.6k]
  ------------------
  331|    103|            pstr_loudness_hdl->no_of_mf_passing_abs_gate--;
  332|    103|            pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate =
  333|    103|                pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate - old_ml_val;
  334|    103|          }
  335|  11.7k|        }
  336|       |
  337|  37.0k|        pstr_loudness_hdl->loop_ml_count_fn_call++;
  338|  37.0k|        if (pstr_loudness_hdl->ml_count_fn_call < pstr_loudness_hdl->max_il_buf_size)
  ------------------
  |  Branch (338:13): [True: 36.7k, False: 261]
  ------------------
  339|  36.7k|          pstr_loudness_hdl->ml_count_fn_call++;
  340|       |
  341|  37.0k|        pstr_loudness_hdl->loop_ml_count_fn_call =
  342|  37.0k|            pstr_loudness_hdl->loop_ml_count_fn_call % pstr_loudness_hdl->max_il_buf_size;
  343|  37.0k|      }
  344|  37.0k|    }
  345|  43.5k|  }
  346|  43.5k|  return (momentary_loudness);
  347|  43.5k|}

ia_aac_ld_enc_mdct_480:
  472|  67.6k|                            ixheaace_mdct_tables *pstr_mdct_tables) {
  473|  67.6k|  WORD32 k;
  474|  67.6k|  FLOAT32 const_mltfac = ((FLOAT32)FRAME_LEN_512) / FRAME_LEN_480;
  ------------------
  |  |   92|  67.6k|#define FRAME_LEN_512 512
  ------------------
                FLOAT32 const_mltfac = ((FLOAT32)FRAME_LEN_512) / FRAME_LEN_480;
  ------------------
  |  |   93|  67.6k|#define FRAME_LEN_480 480
  ------------------
  475|       |
  476|  67.6k|  ia_eaacp_enc_pre_twiddle_aac(ptr_scratch, ptr_inp, FRAME_LEN_480,
  ------------------
  |  |   93|  67.6k|#define FRAME_LEN_480 480
  ------------------
  477|  67.6k|                               pstr_mdct_tables->cosine_array_960);
  478|       |
  479|  67.6k|  ia_enhaacplus_enc_fft240(ptr_scratch);
  480|       |
  481|  67.6k|  ia_enhaacplus_enc_post_twiddle(ptr_inp, ptr_scratch, pstr_mdct_tables->cosine_array_960,
  482|  67.6k|                                 FRAME_LEN_480);
  ------------------
  |  |   93|  67.6k|#define FRAME_LEN_480 480
  ------------------
  483|       |
  484|  67.6k|  if (0 == mdct_flag) {
  ------------------
  |  Branch (484:7): [True: 0, False: 67.6k]
  ------------------
  485|      0|    for (k = 0; k < MDCT_LEN; k++) {
  ------------------
  |  |   44|      0|#define MDCT_LEN 480
  ------------------
  |  Branch (485:17): [True: 0, False: 0]
  ------------------
  486|      0|      ptr_inp[k] *= const_mltfac;
  487|      0|    }
  488|      0|  }
  489|  67.6k|}
ixheaace_mdct_480.c:ia_enhaacplus_enc_fft240:
  423|  67.6k|static VOID ia_enhaacplus_enc_fft240(FLOAT32 *ptr_in) {
  424|  67.6k|  const WORD32 n1 = 240;
  425|  67.6k|  const WORD32 n2 = 15;
  426|  67.6k|  const WORD32 n3 = 16;
  427|  67.6k|  const WORD32 *ptr_idx1 = ia_enhaacplus_enc_fft240_table1;
  428|  67.6k|  const WORD32 *ptr_idx2 = ia_enhaacplus_enc_fft240_table2;
  429|       |
  430|  67.6k|  WORD32 k, l;
  431|  67.6k|  FLOAT32 temp[32], out[480];
  432|       |
  433|  1.08M|  for (k = 0; k < n2; k++) {
  ------------------
  |  Branch (433:15): [True: 1.01M, False: 67.6k]
  ------------------
  434|  17.2M|    for (l = 0; l < n3; l++) {
  ------------------
  |  Branch (434:17): [True: 16.2M, False: 1.01M]
  ------------------
  435|  16.2M|      temp[2 * l] = ptr_in[2 * *ptr_idx1];
  436|  16.2M|      temp[2 * l + 1] = ptr_in[2 * *ptr_idx1 + 1];
  437|  16.2M|      ptr_idx1 += n2;
  438|  16.2M|    }
  439|       |
  440|  1.01M|    ia_enhaacplus_enc_fft16(temp); /* 16-point FFT */
  441|  1.01M|    ptr_idx1 -= n1;
  442|       |
  443|  17.2M|    for (l = 0; l < n3; l++) {
  ------------------
  |  Branch (443:17): [True: 16.2M, False: 1.01M]
  ------------------
  444|  16.2M|      ptr_in[2 * *ptr_idx1] = temp[2 * l];
  445|  16.2M|      ptr_in[2 * *ptr_idx1 + 1] = temp[2 * l + 1];
  446|  16.2M|      ptr_idx1 += n2;
  447|  16.2M|    }
  448|       |
  449|  1.01M|    ptr_idx1 -= n1 - 1;
  450|  1.01M|  }
  451|       |
  452|  67.6k|  ptr_idx1 -= n2;
  453|       |
  454|  1.15M|  for (k = 0; k < n3; k++) {
  ------------------
  |  Branch (454:15): [True: 1.08M, False: 67.6k]
  ------------------
  455|  17.3M|    for (l = 0; l < n2; l++) {
  ------------------
  |  Branch (455:17): [True: 16.2M, False: 1.08M]
  ------------------
  456|  16.2M|      temp[2 * l] = ptr_in[2 * *ptr_idx1];
  457|  16.2M|      temp[2 * l + 1] = ptr_in[2 * *ptr_idx1++ + 1];
  458|  16.2M|    }
  459|       |
  460|  1.08M|    ia_enhaacplus_enc_fft15(temp); /* 15-point FFT */
  461|       |
  462|  17.3M|    for (l = 0; l < n2; l++) {
  ------------------
  |  Branch (462:17): [True: 16.2M, False: 1.08M]
  ------------------
  463|  16.2M|      out[2 * *ptr_idx2] = temp[2 * l];
  464|  16.2M|      out[2 * *ptr_idx2++ + 1] = temp[2 * l + 1];
  465|  16.2M|    }
  466|  1.08M|  }
  467|       |
  468|  67.6k|  memcpy(ptr_in, out, (2 * n1) * sizeof(out[0]));
  469|  67.6k|}
ixheaace_mdct_480.c:ia_enhaacplus_enc_fft16:
  253|  1.01M|static VOID ia_enhaacplus_enc_fft16(FLOAT32 *ptr_vec) {
  254|  1.01M|  FLOAT32 var10, var11, var12, var13, var14, var15, var16, var17, var18, var19, var110, var111,
  255|  1.01M|      var112, var113, var114, var115, var20, var21, var22, var23, var24, var25, var26, var27,
  256|  1.01M|      var28, var29, var210, var211, var212, var213, var214, var215, arr0, arr1, arr2, arr3, arr4,
  257|  1.01M|      arr5, arr6, arr7, arr8, arr9, arr10, arr11, arr12, arr13, arr14, arr15;
  258|       |
  259|       |  /* Pre-additions */
  260|  1.01M|  arr0 = ptr_vec[0] + ptr_vec[16];
  261|  1.01M|  arr8 = ptr_vec[8] + ptr_vec[24];
  262|  1.01M|  var10 = arr0 + arr8;
  263|  1.01M|  var12 = arr0 - arr8;
  264|  1.01M|  arr1 = ptr_vec[1] + ptr_vec[17];
  265|  1.01M|  arr9 = ptr_vec[9] + ptr_vec[25];
  266|  1.01M|  var11 = arr1 + arr9;
  267|  1.01M|  var13 = arr1 - arr9;
  268|  1.01M|  arr2 = ptr_vec[2] + ptr_vec[18];
  269|  1.01M|  arr10 = ptr_vec[10] + ptr_vec[26];
  270|  1.01M|  var14 = arr2 + arr10;
  271|  1.01M|  var16 = arr2 - arr10;
  272|  1.01M|  arr3 = ptr_vec[3] + ptr_vec[19];
  273|  1.01M|  arr11 = ptr_vec[11] + ptr_vec[27];
  274|  1.01M|  var15 = arr3 + arr11;
  275|  1.01M|  var17 = arr3 - arr11;
  276|  1.01M|  arr4 = ptr_vec[4] + ptr_vec[20];
  277|  1.01M|  arr12 = ptr_vec[12] + ptr_vec[28];
  278|  1.01M|  var18 = arr4 + arr12;
  279|  1.01M|  var110 = arr4 - arr12;
  280|  1.01M|  arr5 = ptr_vec[5] + ptr_vec[21];
  281|  1.01M|  arr13 = ptr_vec[13] + ptr_vec[29];
  282|  1.01M|  var19 = arr5 + arr13;
  283|  1.01M|  var111 = arr5 - arr13;
  284|  1.01M|  arr6 = ptr_vec[6] + ptr_vec[22];
  285|  1.01M|  arr14 = ptr_vec[14] + ptr_vec[30];
  286|  1.01M|  var112 = arr6 + arr14;
  287|  1.01M|  var114 = arr6 - arr14;
  288|  1.01M|  arr7 = ptr_vec[7] + ptr_vec[23];
  289|  1.01M|  arr15 = ptr_vec[15] + ptr_vec[31];
  290|  1.01M|  var113 = arr7 + arr15;
  291|  1.01M|  var115 = arr7 - arr15;
  292|       |
  293|       |  /* Pre-additions and core multiplications */
  294|  1.01M|  var20 = var10 + var18;
  295|  1.01M|  var24 = var10 - var18;
  296|  1.01M|  var21 = var11 + var19;
  297|  1.01M|  var25 = var11 - var19;
  298|  1.01M|  var28 = var12 - var111;
  299|  1.01M|  var210 = var12 + var111;
  300|  1.01M|  var29 = var13 + var110;
  301|  1.01M|  var211 = var13 - var110;
  302|  1.01M|  var22 = var14 + var112;
  303|  1.01M|  var27 = var14 - var112;
  304|  1.01M|  var23 = var15 + var113;
  305|  1.01M|  var26 = var113 - var15;
  306|       |
  307|  1.01M|  var11 = var16 + var114;
  308|  1.01M|  var12 = var16 - var114;
  309|  1.01M|  var10 = var17 + var115;
  310|  1.01M|  var13 = var17 - var115;
  311|  1.01M|  var212 = (var10 + var12) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  312|  1.01M|  var214 = (var10 - var12) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  313|  1.01M|  var213 = (var13 - var11) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  314|  1.01M|  var215 = (var11 + var13) * -IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  315|       |
  316|       |  /* odd */
  317|  1.01M|  arr0 = ptr_vec[0] - ptr_vec[16];
  318|  1.01M|  arr1 = ptr_vec[1] - ptr_vec[17];
  319|  1.01M|  arr2 = ptr_vec[2] - ptr_vec[18];
  320|  1.01M|  arr3 = ptr_vec[3] - ptr_vec[19];
  321|  1.01M|  arr4 = ptr_vec[4] - ptr_vec[20];
  322|  1.01M|  arr5 = ptr_vec[5] - ptr_vec[21];
  323|  1.01M|  arr6 = ptr_vec[6] - ptr_vec[22];
  324|  1.01M|  arr7 = ptr_vec[7] - ptr_vec[23];
  325|  1.01M|  arr8 = ptr_vec[8] - ptr_vec[24];
  326|  1.01M|  arr9 = ptr_vec[9] - ptr_vec[25];
  327|  1.01M|  arr10 = ptr_vec[10] - ptr_vec[26];
  328|  1.01M|  arr11 = ptr_vec[11] - ptr_vec[27];
  329|  1.01M|  arr12 = ptr_vec[12] - ptr_vec[28];
  330|  1.01M|  arr13 = ptr_vec[13] - ptr_vec[29];
  331|  1.01M|  arr14 = ptr_vec[14] - ptr_vec[30];
  332|  1.01M|  arr15 = ptr_vec[15] - ptr_vec[31];
  333|       |
  334|       |  /* Pre-additions and core multiplications */
  335|  1.01M|  var19 = (arr2 + arr14) * -IXHEAACE_COS_3PI_DIV8;
  ------------------
  |  |   32|  1.01M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  336|  1.01M|  var110 = (arr2 - arr14) * IXHEAACE_COS_PI_DIV8;
  ------------------
  |  |   31|  1.01M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
  337|  1.01M|  var18 = (arr3 + arr15) * IXHEAACE_COS_3PI_DIV8;
  ------------------
  |  |   32|  1.01M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  338|  1.01M|  var111 = (arr3 - arr15) * IXHEAACE_COS_PI_DIV8;
  ------------------
  |  |   31|  1.01M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
  339|  1.01M|  var15 = (arr4 + arr12) * -IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  340|  1.01M|  var16 = (arr4 - arr12) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  341|  1.01M|  var14 = (arr5 + arr13) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  342|  1.01M|  var17 = (arr5 - arr13) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.01M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  343|  1.01M|  var113 = (arr6 + arr10) * -IXHEAACE_COS_PI_DIV8;
  ------------------
  |  |   31|  1.01M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
  344|  1.01M|  var114 = (arr6 - arr10) * IXHEAACE_COS_3PI_DIV8;
  ------------------
  |  |   32|  1.01M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  345|  1.01M|  var112 = (arr7 + arr11) * IXHEAACE_COS_PI_DIV8;
  ------------------
  |  |   31|  1.01M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
  346|  1.01M|  var115 = (arr7 - arr11) * IXHEAACE_COS_3PI_DIV8;
  ------------------
  |  |   32|  1.01M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  347|       |
  348|       |  /* Core multiplications */
  349|  1.01M|  arr2 = var18 * IXHEAACE_SQRT2PLUS1 - var112 * IXHEAACE_SQRT2MINUS1;
  ------------------
  |  |   33|  1.01M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                arr2 = var18 * IXHEAACE_SQRT2PLUS1 - var112 * IXHEAACE_SQRT2MINUS1;
  ------------------
  |  |   34|  1.01M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
  350|  1.01M|  arr3 = var19 * IXHEAACE_SQRT2PLUS1 - var113 * IXHEAACE_SQRT2MINUS1;
  ------------------
  |  |   33|  1.01M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                arr3 = var19 * IXHEAACE_SQRT2PLUS1 - var113 * IXHEAACE_SQRT2MINUS1;
  ------------------
  |  |   34|  1.01M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
  351|  1.01M|  arr4 = var110 * IXHEAACE_SQRT2MINUS1 - var114 * IXHEAACE_SQRT2PLUS1;
  ------------------
  |  |   34|  1.01M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                arr4 = var110 * IXHEAACE_SQRT2MINUS1 - var114 * IXHEAACE_SQRT2PLUS1;
  ------------------
  |  |   33|  1.01M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
  352|  1.01M|  arr5 = var111 * IXHEAACE_SQRT2MINUS1 - var115 * IXHEAACE_SQRT2PLUS1;
  ------------------
  |  |   34|  1.01M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                arr5 = var111 * IXHEAACE_SQRT2MINUS1 - var115 * IXHEAACE_SQRT2PLUS1;
  ------------------
  |  |   33|  1.01M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
  353|       |
  354|       |  /* Post-additions */
  355|  1.01M|  var18 = var18 + var112;
  356|  1.01M|  var19 = var19 + var113;
  357|  1.01M|  var110 = var110 + var114;
  358|  1.01M|  var111 = var111 + var115;
  359|  1.01M|  arr6 = arr0 + var14;
  360|  1.01M|  arr10 = arr0 - var14;
  361|  1.01M|  arr7 = arr1 + var15;
  362|  1.01M|  arr11 = arr1 - var15;
  363|       |
  364|  1.01M|  arr12 = var16 - arr9;
  365|  1.01M|  arr14 = var16 + arr9;
  366|  1.01M|  arr13 = arr8 + var17;
  367|  1.01M|  arr15 = arr8 - var17;
  368|       |
  369|  1.01M|  var10 = arr6 - arr14;
  370|  1.01M|  var12 = arr6 + arr14;
  371|  1.01M|  var11 = arr7 + arr15;
  372|  1.01M|  var13 = arr7 - arr15;
  373|  1.01M|  var14 = arr10 + arr12;
  374|  1.01M|  var16 = arr10 - arr12;
  375|  1.01M|  var15 = arr11 + arr13;
  376|  1.01M|  var17 = arr11 - arr13;
  377|       |
  378|  1.01M|  arr10 = var18 + var110;
  379|  1.01M|  var110 = var18 - var110;
  380|  1.01M|  arr11 = var19 + var111;
  381|  1.01M|  var111 = var19 - var111;
  382|       |
  383|  1.01M|  var112 = arr2 + arr4;
  384|  1.01M|  var114 = arr2 - arr4;
  385|  1.01M|  var113 = arr3 + arr5;
  386|  1.01M|  var115 = arr3 - arr5;
  387|       |
  388|       |  /* Post-additions */
  389|  1.01M|  ptr_vec[0] = var20 + var22;
  390|  1.01M|  ptr_vec[1] = var21 + var23;
  391|  1.01M|  ptr_vec[2] = var12 + arr10;
  392|  1.01M|  ptr_vec[3] = var13 + arr11;
  393|  1.01M|  ptr_vec[4] = var210 + var212;
  394|  1.01M|  ptr_vec[5] = var211 + var213;
  395|  1.01M|  ptr_vec[6] = var10 + var112;
  396|  1.01M|  ptr_vec[7] = var11 + var113;
  397|  1.01M|  ptr_vec[8] = var24 - var26;
  398|  1.01M|  ptr_vec[9] = var25 - var27;
  399|  1.01M|  ptr_vec[10] = var16 + var114;
  400|  1.01M|  ptr_vec[11] = var17 + var115;
  401|  1.01M|  ptr_vec[12] = var28 + var214;
  402|  1.01M|  ptr_vec[13] = var29 + var215;
  403|  1.01M|  ptr_vec[14] = var14 + var110;
  404|  1.01M|  ptr_vec[15] = var15 + var111;
  405|  1.01M|  ptr_vec[16] = var20 - var22;
  406|  1.01M|  ptr_vec[17] = var21 - var23;
  407|  1.01M|  ptr_vec[18] = var12 - arr10;
  408|  1.01M|  ptr_vec[19] = var13 - arr11;
  409|  1.01M|  ptr_vec[20] = var210 - var212;
  410|  1.01M|  ptr_vec[21] = var211 - var213;
  411|  1.01M|  ptr_vec[22] = var10 - var112;
  412|  1.01M|  ptr_vec[23] = var11 - var113;
  413|  1.01M|  ptr_vec[24] = var24 + var26;
  414|  1.01M|  ptr_vec[25] = var25 + var27;
  415|  1.01M|  ptr_vec[26] = var16 - var114;
  416|  1.01M|  ptr_vec[27] = var17 - var115;
  417|  1.01M|  ptr_vec[28] = var28 - var214;
  418|  1.01M|  ptr_vec[29] = var29 - var215;
  419|  1.01M|  ptr_vec[30] = var14 - var110;
  420|  1.01M|  ptr_vec[31] = var15 - var111;
  421|  1.01M|}
ixheaace_mdct_480.c:ia_enhaacplus_enc_fft15:
   46|  1.08M|static VOID ia_enhaacplus_enc_fft15(FLOAT32 *ptr_vec) {
   47|  1.08M|  FLOAT32 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, i0, i1,
   48|  1.08M|      i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, tmp0, tmp1, tmp2,
   49|  1.08M|      tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16,
   50|  1.08M|      tmp17, tmp18, tmp19, tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27, tmp28, tmp29;
   51|       |
   52|       |  /* Pre-additions real part */
   53|  1.08M|  r1 = ptr_vec[2] + ptr_vec[8];
   54|  1.08M|  r2 = ptr_vec[2] - ptr_vec[8];
   55|  1.08M|  r3 = ptr_vec[4] + ptr_vec[16];
   56|  1.08M|  r4 = ptr_vec[4] - ptr_vec[16];
   57|  1.08M|  r5 = ptr_vec[6] + ptr_vec[24];
   58|  1.08M|  r6 = ptr_vec[6] - ptr_vec[24];
   59|  1.08M|  r7 = ptr_vec[10] + ptr_vec[20];
   60|  1.08M|  r8 = ptr_vec[10] - ptr_vec[20];
   61|  1.08M|  r9 = ptr_vec[12] + ptr_vec[18];
   62|  1.08M|  r10 = ptr_vec[12] - ptr_vec[18];
   63|  1.08M|  r11 = ptr_vec[14] + ptr_vec[26];
   64|  1.08M|  r12 = ptr_vec[14] - ptr_vec[26];
   65|  1.08M|  r13 = ptr_vec[22] + ptr_vec[28];
   66|  1.08M|  r14 = ptr_vec[22] - ptr_vec[28];
   67|       |
   68|  1.08M|  tmp2 = r1 + r3;
   69|  1.08M|  tmp4 = r1 - r3;
   70|  1.08M|  tmp6 = r2 + r14;
   71|  1.08M|  tmp8 = r2 - r14;
   72|  1.08M|  tmp10 = r4 + r12;
   73|  1.08M|  tmp12 = r4 - r12;
   74|  1.08M|  tmp14 = r5 + r9;
   75|  1.08M|  tmp16 = r5 - r9;
   76|  1.08M|  tmp18 = r11 + r13;
   77|  1.08M|  tmp20 = r11 - r13;
   78|       |
   79|       |  /* Pre-additions imaginary part */
   80|  1.08M|  i1 = ptr_vec[3] + ptr_vec[9];
   81|  1.08M|  i2 = ptr_vec[3] - ptr_vec[9];
   82|  1.08M|  i3 = ptr_vec[5] + ptr_vec[17];
   83|  1.08M|  i4 = ptr_vec[5] - ptr_vec[17];
   84|  1.08M|  i5 = ptr_vec[7] + ptr_vec[25];
   85|  1.08M|  i6 = ptr_vec[7] - ptr_vec[25];
   86|  1.08M|  i7 = ptr_vec[11] + ptr_vec[21];
   87|  1.08M|  i8 = ptr_vec[11] - ptr_vec[21];
   88|  1.08M|  i9 = ptr_vec[13] + ptr_vec[19];
   89|  1.08M|  i10 = ptr_vec[13] - ptr_vec[19];
   90|  1.08M|  i11 = ptr_vec[15] + ptr_vec[27];
   91|  1.08M|  i12 = ptr_vec[15] - ptr_vec[27];
   92|  1.08M|  i13 = ptr_vec[23] + ptr_vec[29];
   93|  1.08M|  i14 = ptr_vec[23] - ptr_vec[29];
   94|       |
   95|  1.08M|  tmp3 = i1 + i3;
   96|  1.08M|  tmp5 = i1 - i3;
   97|  1.08M|  tmp7 = i2 + i14;
   98|  1.08M|  tmp9 = i2 - i14;
   99|  1.08M|  tmp11 = i4 + i12;
  100|  1.08M|  tmp13 = i4 - i12;
  101|  1.08M|  tmp15 = i5 + i9;
  102|  1.08M|  tmp17 = i5 - i9;
  103|  1.08M|  tmp19 = i11 + i13;
  104|  1.08M|  tmp21 = i11 - i13;
  105|       |
  106|       |  /* Pre-additions and core multiplications */
  107|  1.08M|  tmp28 = tmp4 + tmp20;
  108|  1.08M|  tmp29 = tmp5 + tmp21;
  109|  1.08M|  r4 = tmp2 + tmp18;
  110|  1.08M|  i4 = tmp3 + tmp19;
  111|  1.08M|  r3 = (FLOAT32)((r4 + tmp14) * -1.25);
  112|  1.08M|  i3 = (FLOAT32)((i4 + tmp15) * -1.25);
  113|  1.08M|  r2 = (FLOAT32)((tmp29 - i8) * -8.660254037844387e-1);
  114|  1.08M|  i2 = (FLOAT32)((tmp28 - r8) * 8.660254037844387e-1);
  115|  1.08M|  r1 = r4 + r7;
  116|  1.08M|  i1 = i4 + i7;
  117|  1.08M|  r0 = r1 + ptr_vec[0] + tmp14;
  118|  1.08M|  i0 = i1 + ptr_vec[1] + tmp15;
  119|  1.08M|  r7 = tmp4 - tmp20;
  120|  1.08M|  i7 = tmp5 - tmp21;
  121|  1.08M|  r8 = (FLOAT32)((tmp3 - tmp19) * -4.841229182759272e-1);
  122|  1.08M|  i8 = (FLOAT32)((tmp2 - tmp18) * 4.841229182759272e-1);
  123|  1.08M|  tmp0 = tmp6 + r10;
  124|  1.08M|  tmp1 = tmp7 + i10;
  125|  1.08M|  tmp2 = r6 - tmp10;
  126|  1.08M|  tmp3 = i6 - tmp11;
  127|  1.08M|  r10 = (FLOAT32)(tmp7 * -2.308262652881440);
  128|  1.08M|  i10 = (FLOAT32)(tmp6 * 2.308262652881440);
  129|  1.08M|  r11 = (FLOAT32)(tmp8 * 1.332676064001459);
  130|  1.08M|  i11 = (FLOAT32)(tmp9 * 1.332676064001459);
  131|  1.08M|  r6 = (FLOAT32)((r7 - tmp16) * 5.590169943749475e-1);
  132|  1.08M|  i6 = (FLOAT32)((i7 - tmp17) * 5.590169943749475e-1);
  133|  1.08M|  r12 = (FLOAT32)((tmp1 + tmp3) * 5.877852522924733e-1);
  134|  1.08M|  i12 = (FLOAT32)((tmp0 + tmp2) * -5.877852522924733e-1);
  135|  1.08M|  r13 = (FLOAT32)((tmp7 - tmp11) * -8.816778784387098e-1);
  136|  1.08M|  i13 = (FLOAT32)((tmp6 - tmp10) * 8.816778784387098e-1);
  137|  1.08M|  r14 = (FLOAT32)((tmp8 + tmp12) * 5.090369604551274e-1);
  138|  1.08M|  i14 = (FLOAT32)((tmp9 + tmp13) * 5.090369604551274e-1);
  139|  1.08M|  r16 = (FLOAT32)(tmp11 * 5.449068960040204e-1);
  140|  1.08M|  i16 = (FLOAT32)(tmp10 * -5.449068960040204e-1);
  141|  1.08M|  r17 = (FLOAT32)(tmp12 * 3.146021430912046e-1);
  142|  1.08M|  i17 = (FLOAT32)(tmp13 * 3.146021430912046e-1);
  143|       |
  144|  1.08M|  r4 *= 1.875;
  145|  1.08M|  i4 *= 1.875;
  146|  1.08M|  r1 *= -1.5;
  147|  1.08M|  i1 *= -1.5;
  148|  1.08M|  r7 *= (FLOAT32)(-8.385254915624212e-1);
  149|  1.08M|  i7 *= (FLOAT32)(-8.385254915624212e-1);
  150|  1.08M|  r5 = (FLOAT32)(tmp29 * 1.082531754730548);
  151|  1.08M|  i5 = (FLOAT32)(tmp28 * -1.082531754730548);
  152|  1.08M|  r9 = (FLOAT32)(tmp1 * 1.5388417685876270);
  153|  1.08M|  i9 = (FLOAT32)(tmp0 * -1.538841768587627);
  154|  1.08M|  r15 = (FLOAT32)(tmp3 * 3.632712640026803e-1);
  155|  1.08M|  i15 = (FLOAT32)(tmp2 * -3.632712640026803e-1);
  156|       |
  157|       |  /* Post-additions real part */
  158|  1.08M|  tmp2 = r0 + r1;
  159|  1.08M|  tmp4 = r3 + r6;
  160|  1.08M|  tmp6 = r3 - r6;
  161|  1.08M|  tmp8 = r4 + r5;
  162|  1.08M|  tmp10 = r4 - r5;
  163|  1.08M|  tmp12 = r7 + r8;
  164|  1.08M|  tmp14 = r7 - r8;
  165|  1.08M|  tmp16 = r13 + r16;
  166|  1.08M|  tmp18 = r14 + r17;
  167|  1.08M|  tmp20 = r10 - r13;
  168|  1.08M|  tmp22 = r11 - r14;
  169|  1.08M|  tmp24 = r12 + r15;
  170|  1.08M|  tmp26 = r12 - r9;
  171|       |
  172|  1.08M|  r1 = tmp2 + r2;
  173|  1.08M|  r2 = tmp2 - r2;
  174|  1.08M|  r3 = tmp4 + tmp26;
  175|  1.08M|  r4 = tmp4 - tmp26;
  176|  1.08M|  r5 = tmp6 + tmp24;
  177|  1.08M|  r6 = tmp6 - tmp24;
  178|  1.08M|  r7 = tmp16 + tmp18;
  179|  1.08M|  r8 = tmp16 - tmp18;
  180|  1.08M|  r9 = tmp20 - tmp22;
  181|  1.08M|  r10 = tmp20 + tmp22;
  182|  1.08M|  r11 = r1 + tmp8;
  183|  1.08M|  r12 = r2 + tmp10;
  184|  1.08M|  r13 = r11 - tmp12;
  185|  1.08M|  r14 = r12 - tmp14;
  186|  1.08M|  r15 = r12 + tmp14;
  187|  1.08M|  r16 = r11 + tmp12;
  188|       |
  189|       |  /* Post-additions imaginary part */
  190|  1.08M|  tmp3 = i0 + i1;
  191|  1.08M|  tmp5 = i3 + i6;
  192|  1.08M|  tmp7 = i3 - i6;
  193|  1.08M|  tmp9 = i4 + i5;
  194|  1.08M|  tmp11 = i4 - i5;
  195|  1.08M|  tmp13 = i7 + i8;
  196|  1.08M|  tmp15 = i7 - i8;
  197|  1.08M|  tmp17 = i13 + i16;
  198|  1.08M|  tmp19 = i14 + i17;
  199|  1.08M|  tmp21 = i10 - i13;
  200|  1.08M|  tmp23 = i11 - i14;
  201|  1.08M|  tmp25 = i12 + i15;
  202|  1.08M|  tmp27 = i12 - i9;
  203|       |
  204|  1.08M|  i1 = tmp3 + i2;
  205|  1.08M|  i2 = tmp3 - i2;
  206|  1.08M|  i3 = tmp5 + tmp27;
  207|  1.08M|  i4 = tmp5 - tmp27;
  208|  1.08M|  i5 = tmp7 + tmp25;
  209|  1.08M|  i6 = tmp7 - tmp25;
  210|  1.08M|  i7 = tmp17 + tmp19;
  211|  1.08M|  i8 = tmp17 - tmp19;
  212|  1.08M|  i9 = tmp21 - tmp23;
  213|  1.08M|  i10 = tmp21 + tmp23;
  214|  1.08M|  i11 = i1 + tmp9;
  215|  1.08M|  i12 = i2 + tmp11;
  216|  1.08M|  i13 = i11 - tmp13;
  217|  1.08M|  i14 = i12 - tmp15;
  218|  1.08M|  i15 = i12 + tmp15;
  219|  1.08M|  i16 = i11 + tmp13;
  220|       |
  221|  1.08M|  *ptr_vec++ = r0;
  222|  1.08M|  *ptr_vec++ = i0;
  223|  1.08M|  *ptr_vec++ = r13 + r5 + r7;
  224|  1.08M|  *ptr_vec++ = i13 + i5 + i7;
  225|  1.08M|  *ptr_vec++ = r15 + r3 - r9;
  226|  1.08M|  *ptr_vec++ = i15 + i3 - i9;
  227|  1.08M|  *ptr_vec++ = r0 + r4;
  228|  1.08M|  *ptr_vec++ = i0 + i4;
  229|  1.08M|  *ptr_vec++ = r13 + r6 - r7;
  230|  1.08M|  *ptr_vec++ = i13 + i6 - i7;
  231|  1.08M|  *ptr_vec++ = r2;
  232|  1.08M|  *ptr_vec++ = i2;
  233|  1.08M|  *ptr_vec++ = r0 + r5;
  234|  1.08M|  *ptr_vec++ = i0 + i5;
  235|  1.08M|  *ptr_vec++ = r16 + r3 - r10;
  236|  1.08M|  *ptr_vec++ = i16 + i3 - i10;
  237|  1.08M|  *ptr_vec++ = r15 + r4 + r9;
  238|  1.08M|  *ptr_vec++ = i15 + i4 + i9;
  239|  1.08M|  *ptr_vec++ = r0 + r6;
  240|  1.08M|  *ptr_vec++ = i0 + i6;
  241|  1.08M|  *ptr_vec++ = r1;
  242|  1.08M|  *ptr_vec++ = i1;
  243|  1.08M|  *ptr_vec++ = r14 + r5 + r8;
  244|  1.08M|  *ptr_vec++ = i14 + i5 + i8;
  245|  1.08M|  *ptr_vec++ = r0 + r3;
  246|  1.08M|  *ptr_vec++ = i0 + i3;
  247|  1.08M|  *ptr_vec++ = r16 + r4 + r10;
  248|  1.08M|  *ptr_vec++ = i16 + i4 + i10;
  249|  1.08M|  *ptr_vec++ = r14 + r6 - r8;
  250|  1.08M|  *ptr_vec++ = i14 + i6 - i8;
  251|  1.08M|}

ixheaace_mps_515_icc_quant:
  422|  1.63M|WORD32 ixheaace_mps_515_icc_quant(FLOAT32 val) {
  423|  1.63M|  FLOAT32 p_qsteps[7] = {0.9685f, 0.88909f, 0.72105f, 0.48428f, 0.18382f, -0.2945f, -0.7895f};
  424|  1.63M|  WORD32 i;
  425|       |
  426|  1.63M|  if (val >= p_qsteps[0]) {
  ------------------
  |  Branch (426:7): [True: 823k, False: 810k]
  ------------------
  427|   823k|    return 0;
  428|   823k|  }
  429|  3.77M|  for (i = 1; i < 6; i++) {
  ------------------
  |  Branch (429:15): [True: 3.68M, False: 88.2k]
  ------------------
  430|  3.68M|    if ((val >= p_qsteps[i]) && (val <= p_qsteps[i - 1])) {
  ------------------
  |  Branch (430:9): [True: 722k, False: 2.96M]
  |  Branch (430:33): [True: 722k, False: 0]
  ------------------
  431|   722k|      return i;
  432|   722k|    }
  433|  3.68M|  }
  434|  88.2k|  return 7;
  435|   810k|}
ixheaace_mps_515_cld_quant:
  437|  2.19M|WORD32 ixheaace_mps_515_cld_quant(FLOAT32 val) {
  438|  2.19M|  FLOAT32 p_qsteps[30] = {-47.5, -42.5, -37.5, -32.5, -27.5, -23.5, -20.5, -17.5, -14.5, -11.5,
  439|  2.19M|                          -9.0,  -7.0,  -5.0,  -3.0,  -1.0,  1.0,   3.0,   5.0,   7.0,   9.0,
  440|  2.19M|                          11.5,  14.5,  17.5,  20.5,  23.5,  27.5,  32.5,  37.5,  42.5,  47.5};
  441|       |
  442|  2.19M|  WORD32 i;
  443|       |
  444|  2.19M|  if (val < p_qsteps[0]) {
  ------------------
  |  Branch (444:7): [True: 667k, False: 1.53M]
  ------------------
  445|   667k|    return 0 - 15;
  446|   667k|  }
  447|  26.6M|  for (i = 1; i < 30; i++) {
  ------------------
  |  Branch (447:15): [True: 26.5M, False: 18.5k]
  ------------------
  448|  26.5M|    if ((val <= p_qsteps[i]) && (val >= p_qsteps[i - 1])) {
  ------------------
  |  Branch (448:9): [True: 1.51M, False: 25.0M]
  |  Branch (448:33): [True: 1.51M, False: 0]
  ------------------
  449|  1.51M|      return i - 15;
  450|  1.51M|    }
  451|  26.5M|  }
  452|  18.5k|  return 30 - 15;
  453|  1.53M|}
ixheaace_mps_515_ttt_box:
  457|  14.1k|                              FLOAT32 *ptr_imag3, WORD32 *ptr_qclds1, WORD32 *ptr_qclds2) {
  458|  14.1k|  WORD32 i, j;
  459|       |
  460|  14.1k|  FLOAT32 cld_s1[PARAMETER_BANDS] = {0};
  461|  14.1k|  FLOAT32 cld_s2[PARAMETER_BANDS] = {0};
  462|  14.1k|  FLOAT32 p_pow1[MAX_HYBRID_BANDS] = {0};
  463|  14.1k|  FLOAT32 p_pow2[MAX_HYBRID_BANDS] = {0};
  464|  14.1k|  FLOAT32 p_pow3[MAX_HYBRID_BANDS] = {0};
  465|       |
  466|  14.1k|  FLOAT32 p_pow_par_band1[PARAMETER_BANDS] = {0};
  467|  14.1k|  FLOAT32 p_pow_par_band2[PARAMETER_BANDS] = {0};
  468|  14.1k|  FLOAT32 p_pow_par_band3[PARAMETER_BANDS] = {0};
  469|       |
  470|   233k|  for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (470:15): [True: 219k, False: 14.1k]
  ------------------
  471|  15.8M|    for (j = 0; j < MAX_HYBRID_BANDS; j++) {
  ------------------
  |  |   23|  15.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (471:17): [True: 15.5M, False: 219k]
  ------------------
  472|  15.5M|      p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  473|  15.5M|                   ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  474|  15.5M|      p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  475|  15.5M|                   ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  476|  15.5M|      p_pow3[j] += ptr_real3[i * MAX_HYBRID_BANDS + j] * ptr_real3[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow3[j] += ptr_real3[i * MAX_HYBRID_BANDS + j] * ptr_real3[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  477|  15.5M|                   ptr_imag3[i * MAX_HYBRID_BANDS + j] * ptr_imag3[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag3[i * MAX_HYBRID_BANDS + j] * ptr_imag3[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  478|       |
  479|  15.5M|      ptr_real1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  480|  15.5M|          (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  481|  15.5M|      ptr_imag1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  482|  15.5M|          (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  483|       |
  484|  15.5M|      ptr_real2[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  485|  15.5M|          (ptr_real2[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_real2[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  486|  15.5M|      ptr_imag2[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  487|  15.5M|          (ptr_imag2[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_imag2[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  15.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  488|  15.5M|    }
  489|   219k|  }
  490|  1.01M|  for (i = 0; i < MAX_HYBRID_BANDS; i++) {
  ------------------
  |  |   23|  1.01M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (490:15): [True: 1.00M, False: 14.1k]
  ------------------
  491|  1.00M|    p_pow_par_band1[kernels_20[i]] += p_pow1[i];
  492|  1.00M|    p_pow_par_band2[kernels_20[i]] += p_pow2[i];
  493|  1.00M|    p_pow_par_band3[kernels_20[i]] += p_pow3[i];
  494|  1.00M|  }
  495|   296k|  for (i = 0; i < PARAMETER_BANDS; i++) {
  ------------------
  |  |   27|   296k|#define PARAMETER_BANDS (20)
  ------------------
  |  Branch (495:15): [True: 282k, False: 14.1k]
  ------------------
  496|   282k|    if (p_pow_par_band3[i]) {
  ------------------
  |  Branch (496:9): [True: 200k, False: 82.2k]
  ------------------
  497|   200k|      cld_s1[i] = ((p_pow_par_band1[i] + p_pow_par_band2[i]) / (p_pow_par_band3[i]));
  498|   200k|      cld_s1[i] = (FLOAT32)(10.0 * log(cld_s1[i] + 1e-10) / log(10.0));
  499|   200k|    } else if ((p_pow_par_band1[i] + p_pow_par_band2[i]))
  ------------------
  |  Branch (499:16): [True: 2.55k, False: 79.7k]
  ------------------
  500|  2.55k|      cld_s1[i] = 50.0;
  501|  79.7k|    else
  502|  79.7k|      cld_s1[i] = -50;
  503|   282k|    ptr_qclds1[i] = ixheaace_mps_515_cld_quant(cld_s1[i]);
  504|       |
  505|   282k|    if (p_pow_par_band2[i]) {
  ------------------
  |  Branch (505:9): [True: 200k, False: 82.0k]
  ------------------
  506|   200k|      cld_s2[i] = (p_pow_par_band1[i] / (p_pow_par_band2[i]));
  507|   200k|      cld_s2[i] = (FLOAT32)(10 * log(cld_s2[i] + 1e-10f) / log(10.0));
  508|   200k|    } else if (p_pow_par_band1[i])
  ------------------
  |  Branch (508:16): [True: 1.69k, False: 80.3k]
  ------------------
  509|  1.69k|      cld_s2[i] = 50.0;
  510|  80.3k|    else
  511|  80.3k|      cld_s2[i] = -50;
  512|   282k|    ptr_qclds2[i] = ixheaace_mps_515_cld_quant(cld_s2[i]);
  513|   282k|  }
  514|  14.1k|}
ixheaace_mps_515_ott_box:
  518|  81.7k|                              WORD32 *ptr_qiccs) {
  519|  81.7k|  WORD32 i, j;
  520|       |
  521|  81.7k|  FLOAT32 clds[PARAMETER_BANDS] = {0};
  522|  81.7k|  FLOAT32 iccs[PARAMETER_BANDS] = {0};
  523|  81.7k|  FLOAT32 p_pow1[MAX_HYBRID_BANDS] = {0};
  524|  81.7k|  FLOAT32 p_pow2[MAX_HYBRID_BANDS] = {0};
  525|  81.7k|  FLOAT32 p_xcor_real[MAX_HYBRID_BANDS] = {0};
  526|       |
  527|  81.7k|  FLOAT32 p_pow_par_band1[PARAMETER_BANDS] = {0};
  528|  81.7k|  FLOAT32 p_pow_par_band2[PARAMETER_BANDS] = {0};
  529|  81.7k|  FLOAT32 p_xcor_par_band[PARAMETER_BANDS] = {0};
  530|       |
  531|  1.34M|  for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (531:15): [True: 1.26M, False: 81.7k]
  ------------------
  532|  91.1M|    for (j = 0; j < MAX_HYBRID_BANDS; j++) {
  ------------------
  |  |   23|  91.1M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (532:17): [True: 89.8M, False: 1.26M]
  ------------------
  533|  89.8M|      p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  534|  89.8M|                   ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  535|  89.8M|      p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  536|  89.8M|                   ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  537|  89.8M|      p_xcor_real[j] +=
  538|  89.8M|          ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  539|  89.8M|          ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  540|       |
  541|  89.8M|      ptr_real1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  542|  89.8M|          (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  543|  89.8M|      ptr_imag1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  544|  89.8M|          (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  89.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  545|  89.8M|    }
  546|  1.26M|  }
  547|  5.88M|  for (i = 0; i < MAX_HYBRID_BANDS; i++) {
  ------------------
  |  |   23|  5.88M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (547:15): [True: 5.80M, False: 81.7k]
  ------------------
  548|  5.80M|    p_pow_par_band1[kernels_20[i]] += p_pow1[i];
  549|  5.80M|    p_pow_par_band2[kernels_20[i]] += p_pow2[i];
  550|  5.80M|    p_xcor_par_band[kernels_20[i]] += p_xcor_real[i];
  551|  5.80M|  }
  552|  1.71M|  for (i = 0; i < PARAMETER_BANDS; i++) {
  ------------------
  |  |   27|  1.71M|#define PARAMETER_BANDS (20)
  ------------------
  |  Branch (552:15): [True: 1.63M, False: 81.7k]
  ------------------
  553|  1.63M|    if (p_pow_par_band2[i]) {
  ------------------
  |  Branch (553:9): [True: 1.13M, False: 501k]
  ------------------
  554|  1.13M|      clds[i] = (p_pow_par_band1[i] / (p_pow_par_band2[i]));
  555|  1.13M|      clds[i] = (FLOAT32)(10 * log(clds[i] + 1e-10) / log(10.0));
  556|  1.13M|    } else if (p_pow_par_band1[i])
  ------------------
  |  Branch (556:16): [True: 7.25k, False: 494k]
  ------------------
  557|  7.25k|      clds[i] = 50.0;
  558|   494k|    else
  559|   494k|      clds[i] = -50;  // 0.0;
  560|  1.63M|    iccs[i] =
  561|  1.63M|        p_xcor_par_band[i] / (FLOAT32)sqrt((p_pow_par_band1[i] * p_pow_par_band2[i] + 1e-10));
  562|       |
  563|  1.63M|    ptr_p_qclds[i] = ixheaace_mps_515_cld_quant(clds[i]);
  564|  1.63M|    ptr_qiccs[i] = ixheaace_mps_515_icc_quant(iccs[i]);
  565|  1.63M|  }
  566|  81.7k|}
ixheaace_mps_212_write_spatial_specific_config:
  571|  1.28k|    WORD32 *const ptr_output_bits, WORD32 aot) {
  572|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  573|  1.28k|  WORD32 bs_sampling_frequency_index = 0;
  574|  1.28k|  WORD32 bs_freq_res = 0;
  575|  1.28k|  ixheaace_bit_buf bit_buf;
  576|  1.28k|  ixheaace_bit_buf_handle pstr_bit_buf =
  577|  1.28k|      ia_enhaacplus_enc_create_bitbuffer(&bit_buf, ptr_output_buffer, output_buffer_size);
  578|       |
  579|  1.28k|  error = ixheaace_mps_212_get_bs_freq_res_index(pstr_spatial_specific_config->num_bands,
  580|  1.28k|                                                 &bs_freq_res, aot);
  581|  1.28k|  if (error) {
  ------------------
  |  Branch (581:7): [True: 0, False: 1.28k]
  ------------------
  582|      0|    return error;
  583|      0|  }
  584|       |
  585|  1.28k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (585:7): [True: 151, False: 1.12k]
  ------------------
  586|    151|    ixheaace_mps_212_get_sampling_frequency_index(
  587|    151|        pstr_spatial_specific_config->bs_sampling_frequency, &bs_sampling_frequency_index);
  588|    151|    ixheaace_write_bits(pstr_bit_buf, bs_sampling_frequency_index, 4);
  589|       |
  590|    151|    if (bs_sampling_frequency_index == 15) {
  ------------------
  |  Branch (590:9): [True: 0, False: 151]
  ------------------
  591|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_sampling_frequency, 24);
  592|      0|    }
  593|       |
  594|    151|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_frame_length, 5);
  595|       |
  596|    151|    ixheaace_write_bits(pstr_bit_buf, bs_freq_res, 3);
  597|    151|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_tree_config, 4);
  598|    151|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_quant_mode, 2);
  599|       |
  600|    151|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  601|       |
  602|    151|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_fixed_gain_dmx, 3);
  603|       |
  604|    151|    ixheaace_write_bits(pstr_bit_buf, 0, 2);
  605|    151|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_decorr_config, 2);
  606|       |
  607|    151|    ixheaace_byte_align_buffer(pstr_bit_buf);
  608|       |
  609|    151|    if ((*ptr_output_bits = ia_enhaacplus_enc_get_bits_available(pstr_bit_buf)) >
  ------------------
  |  Branch (609:9): [True: 0, False: 151]
  ------------------
  610|    151|        (output_buffer_size * 8)) {
  611|      0|      return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  612|      0|    }
  613|       |
  614|    151|    ixheaace_byte_align_buffer(pstr_bit_buf);
  615|  1.12k|  } else {
  616|  1.12k|    ixheaace_mps_212_get_sampling_frequency_index(
  617|  1.12k|        pstr_spatial_specific_config->bs_sampling_frequency, &bs_sampling_frequency_index);
  618|  1.12k|    ixheaace_write_bits(pstr_bit_buf, bs_freq_res, 3);
  619|       |
  620|  1.12k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_fixed_gain_dmx, 3);
  621|       |
  622|  1.12k|    ixheaace_write_bits(pstr_bit_buf, 0, 2);
  623|  1.12k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_decorr_config, 2);
  624|       |
  625|  1.12k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  626|  1.12k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  627|  1.12k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  628|       |
  629|  1.12k|    ixheaace_write_bits(pstr_bit_buf, 0, 5);
  630|  1.12k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  631|       |
  632|  1.12k|    *ptr_output_bits = ia_enhaacplus_enc_get_bits_available(pstr_bit_buf);
  633|  1.12k|  }
  634|  1.28k|  return error;
  635|  1.28k|}
ixheaace_mps_212_write_spatial_frame:
  639|  91.2k|    WORD32 *const ptr_output_bits, ixheaace_mps_pstr_bsf_instance pstr_bsf_instance, WORD32 aot) {
  640|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  641|  91.2k|  WORD32 i, j, num_param_sets, num_ott_boxes;
  642|  91.2k|  ixheaace_mps_spatial_frame *pstr_spatial_frame = NULL;
  643|  91.2k|  ixheaace_mps_spatial_specific_config *pstr_specific_config = NULL;
  644|  91.2k|  ixheaace_bit_buf bit_buf;
  645|  91.2k|  ixheaace_bit_buf_handle pstr_bit_buf =
  646|  91.2k|      ia_enhaacplus_enc_create_bitbuffer(&bit_buf, ptr_output_buffer, output_buffer_size);
  647|  91.2k|  pstr_spatial_frame = &pstr_bsf_instance->frame;
  648|  91.2k|  pstr_specific_config = &pstr_bsf_instance->spatial_specific_config;
  649|  91.2k|  num_ott_boxes = pstr_bsf_instance->spatial_specific_config.tree_description.num_ott_boxes;
  650|  91.2k|  num_param_sets = pstr_spatial_frame->framing_info.num_param_sets;
  651|       |
  652|  91.2k|  if (pstr_spatial_frame->b_use_bb_cues) {
  ------------------
  |  Branch (652:7): [True: 0, False: 91.2k]
  ------------------
  653|      0|    for (i = 0; i < IXHEAACE_MPS_MAX_NUM_BOXES; i++) {
  ------------------
  |  |   50|      0|#define IXHEAACE_MPS_MAX_NUM_BOXES (1)
  ------------------
  |  Branch (653:17): [True: 0, False: 0]
  ------------------
  654|      0|      if (num_param_sets == 1) {
  ------------------
  |  Branch (654:11): [True: 0, False: 0]
  ------------------
  655|      0|        pstr_spatial_frame->cld_lossless_data.bs_freq_res_stride_xxx[i][0] = 3;
  656|      0|        pstr_spatial_frame->icc_lossless_data.bs_freq_res_stride_xxx[i][0] = 3;
  657|      0|      } else {
  658|      0|        for (j = 1; j < MAX_NUM_PARAMS; j++) {
  ------------------
  |  |   42|      0|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (658:21): [True: 0, False: 0]
  ------------------
  659|      0|          pstr_spatial_frame->cld_lossless_data.bs_freq_res_stride_xxx[i][j] = 3;
  660|      0|          pstr_spatial_frame->icc_lossless_data.bs_freq_res_stride_xxx[i][j] = 3;
  661|      0|        }
  662|      0|      }
  663|      0|    }
  664|      0|  }
  665|       |
  666|  91.2k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  91.2k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (666:7): [True: 12.2k, False: 78.9k]
  ------------------
  667|  12.2k|    ixheaace_mps_212_write_framing_info(
  668|  12.2k|        pstr_bit_buf, &(pstr_spatial_frame->framing_info),
  669|  12.2k|        pstr_bsf_instance->spatial_specific_config.bs_frame_length);
  670|  12.2k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->bs_independency_flag, 1);
  671|  78.9k|  } else if (aot == AOT_USAC) {
  ------------------
  |  |   38|  78.9k|#define AOT_USAC (42)
  ------------------
  |  Branch (671:14): [True: 78.9k, False: 0]
  ------------------
  672|  78.9k|    if (!pstr_spatial_frame->bs_independency_flag) {
  ------------------
  |  Branch (672:9): [True: 72.9k, False: 6.02k]
  ------------------
  673|  72.9k|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->bs_independency_flag, 1);
  674|  72.9k|    }
  675|  78.9k|  }
  676|  91.2k|  error = ixheaace_mps_212_write_ott_data(
  677|  91.2k|      pstr_bit_buf, &pstr_bsf_instance->prev_frame_data.prev_ott_data,
  678|  91.2k|      &pstr_spatial_frame->ott_data, pstr_specific_config->ott_config,
  679|  91.2k|      &pstr_spatial_frame->cld_lossless_data, &pstr_spatial_frame->icc_lossless_data,
  680|  91.2k|      num_ott_boxes, pstr_specific_config->num_bands, num_param_sets,
  681|  91.2k|      pstr_spatial_frame->bs_independency_flag);
  682|  91.2k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (682:7): [True: 0, False: 91.2k]
  ------------------
  683|      0|    return error;
  684|      0|  }
  685|  91.2k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  91.2k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (685:7): [True: 12.2k, False: 78.9k]
  ------------------
  686|  12.2k|    ixheaace_mps_212_write_smg_data(pstr_bit_buf, &pstr_spatial_frame->smg_data, num_param_sets,
  687|  12.2k|                                    pstr_specific_config->num_bands);
  688|  12.2k|  }
  689|       |
  690|  91.2k|  *ptr_output_bits = ia_enhaacplus_enc_get_bits_available(pstr_bit_buf);
  691|  91.2k|  if ((*ptr_output_bits) > (output_buffer_size * 8)) {
  ------------------
  |  Branch (691:7): [True: 0, False: 91.2k]
  ------------------
  692|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  693|      0|  }
  694|  91.2k|  return error;
  695|  91.2k|}
ixheaace_mps_515_write_spatial_specific_config:
  699|    402|                                               ixheaace_mps_sac_bsf_instance *pstr_bsf_instance) {
  700|    402|  WORD32 idx, box, bin;
  701|    402|  WORD32 bs_sampling_frequency_index;
  702|    402|  ixheaace_mps_sac_spatial_frame *pstr_spatial_frame = &(pstr_bsf_instance->current_frame);
  703|    402|  ixheaace_mps_sac_specific_config *pstr_specific_config =
  704|    402|      &(pstr_bsf_instance->spatial_specific_config);
  705|    402|  ixheaace_mps_sac_tree_description *pstr_tree_description =
  706|    402|      &(pstr_specific_config->tree_description);
  707|       |
  708|    402|  pstr_tree_description->num_ott_boxes =
  709|    402|      tree_config_table[pstr_specific_config->bs_tree_config].num_ott_boxes;
  710|    402|  pstr_tree_description->num_ttt_boxes =
  711|    402|      tree_config_table[pstr_specific_config->bs_tree_config].num_ttt_boxes;
  712|    402|  pstr_tree_description->num_in_chan =
  713|    402|      tree_config_table[pstr_specific_config->bs_tree_config].num_in_chan;
  714|    402|  pstr_tree_description->num_out_chan =
  715|    402|      tree_config_table[pstr_specific_config->bs_tree_config].num_out_chan;
  716|       |
  717|    402|  if (pstr_specific_config->bs_temp_shape_config == 2) {
  ------------------
  |  Branch (717:7): [True: 0, False: 402]
  ------------------
  718|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_GUIDED_ENV_SHAPE;
  719|      0|  }
  720|       |
  721|    402|  if (pstr_specific_config->bs_3d_audio_mode > 0) {
  ------------------
  |  Branch (721:7): [True: 0, False: 402]
  ------------------
  722|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_3D_STEREO_MODE_NOT_SUPPORTED;
  723|      0|  }
  724|       |
  725|    402|  if (pstr_specific_config->bs_residual_coding == 1) {
  ------------------
  |  Branch (725:7): [True: 0, False: 402]
  ------------------
  726|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_RESIDUAL_CODING;
  727|      0|  }
  728|    402|  if (pstr_specific_config->bs_arbitrary_downmix == 2) {
  ------------------
  |  Branch (728:7): [True: 0, False: 402]
  ------------------
  729|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_ARBITARY_DOWNMIX_CODING;
  730|      0|  }
  731|    402|  if (pstr_specific_config->tree_description.arbitrary_tree) {
  ------------------
  |  Branch (731:7): [True: 0, False: 402]
  ------------------
  732|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_ARBITARY_TREE_NOT_SUPPORTED;
  733|      0|  }
  734|       |
  735|  2.41k|  for (box = 0; box < MAX_NUM_BOXES; box++) {
  ------------------
  |  |  118|  2.41k|#define MAX_NUM_BOXES (5)
  ------------------
  |  Branch (735:17): [True: 2.01k, False: 402]
  ------------------
  736|  2.01k|    pstr_tree_description->ott_mode_lfe[box] =
  737|  2.01k|        tree_config_table[pstr_specific_config->bs_tree_config].ott_mode_lfe[box];
  738|  2.01k|  }
  739|    402|  pstr_bsf_instance->num_bins = freq_res_bin_table[pstr_specific_config->bs_freq_res];
  740|       |
  741|    402|  bs_sampling_frequency_index = 15;
  742|  1.80k|  for (idx = 0; idx < 15; idx++) {
  ------------------
  |  Branch (742:17): [True: 1.80k, False: 0]
  ------------------
  743|  1.80k|    if (pstr_specific_config->bs_sampling_frequency == ia_sampl_freq_table[idx]) {
  ------------------
  |  Branch (743:9): [True: 402, False: 1.40k]
  ------------------
  744|    402|      bs_sampling_frequency_index = idx;
  745|    402|      break;
  746|    402|    }
  747|  1.80k|  }
  748|       |
  749|    402|  ixheaace_write_bits(pstr_bit_buf, bs_sampling_frequency_index, 4);
  750|    402|  if (bs_sampling_frequency_index == 15) {
  ------------------
  |  Branch (750:7): [True: 0, False: 402]
  ------------------
  751|      0|    ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_sampling_frequency, 24);
  752|      0|  }
  753|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_frame_length, 5);
  754|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_freq_res, 3);
  755|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_tree_config, 4);
  756|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_quant_mode, 2);
  757|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_one_icc, 1);
  758|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_arbitrary_downmix, 1);
  759|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_fixed_gain_sur, 3);
  760|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_fixed_gain_lfe, 3);
  761|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_fixed_gain_dmx, 3);
  762|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_matrix_mode, 1);
  763|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_temp_shape_config, 2);
  764|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_decorr_config, 2);
  765|    402|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_3d_audio_mode, 1);
  766|       |
  767|  1.94k|  for (box = 0; box < pstr_tree_description->num_ott_boxes; box++) {
  ------------------
  |  Branch (767:17): [True: 1.54k, False: 402]
  ------------------
  768|  1.54k|    if (pstr_tree_description->ott_mode_lfe[box]) {
  ------------------
  |  Branch (768:9): [True: 402, False: 1.14k]
  ------------------
  769|    402|      ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ott_config[box].bs_ott_bands, 5);
  770|    402|    }
  771|  1.54k|  }
  772|    634|  for (box = 0; box < pstr_tree_description->num_ttt_boxes; box++) {
  ------------------
  |  Branch (772:17): [True: 232, False: 402]
  ------------------
  773|    232|    ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ttt_config[box].bs_ttt_dual_mode, 1);
  774|    232|    ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ttt_config[box].bs_ttt_mode_low, 3);
  775|    232|    if (pstr_specific_config->ttt_config[box].bs_ttt_dual_mode == 1) {
  ------------------
  |  Branch (775:9): [True: 0, False: 232]
  ------------------
  776|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ttt_config[box].bs_ttt_mode_high,
  777|      0|                          3);
  778|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ttt_config[box].bs_ttt_bands_low,
  779|      0|                          5);
  780|      0|    }
  781|    232|  }
  782|    402|  ixheaace_byte_align_buffer(pstr_bit_buf);
  783|       |
  784|  2.41k|  for (box = 0; box < MAX_NUM_BOXES; box++) {
  ------------------
  |  |  118|  2.41k|#define MAX_NUM_BOXES (5)
  ------------------
  |  Branch (784:17): [True: 2.01k, False: 402]
  ------------------
  785|  2.01k|    pstr_specific_config->ttt_config[box].bs_ttt_bands_low = pstr_bsf_instance->num_bins;
  786|   114k|    for (bin = 0; bin < MAX_NUM_BINS; bin++) {
  ------------------
  |  |   41|   114k|#define MAX_NUM_BINS (56)
  ------------------
  |  Branch (786:19): [True: 112k, False: 2.01k]
  ------------------
  787|   112k|      pstr_spatial_frame->ott_data.cld_old[box][bin] = 0;
  788|   112k|      pstr_spatial_frame->ott_data.icc_old[box][bin] = 0;
  789|   112k|      pstr_spatial_frame->ttt_data.cpc_cld1_old[box][bin] = 0;
  790|   112k|      pstr_spatial_frame->ttt_data.cpc_cld2_old[box][bin] = 0;
  791|   112k|      pstr_spatial_frame->ttt_data.icc_old[box][bin] = 0;
  792|   112k|    }
  793|  2.01k|  }
  794|       |
  795|  1.94k|  for (box = 0; box < pstr_tree_description->num_ott_boxes; box++) {
  ------------------
  |  Branch (795:17): [True: 1.54k, False: 402]
  ------------------
  796|  1.54k|    if (!pstr_tree_description->ott_mode_lfe[box]) {
  ------------------
  |  Branch (796:9): [True: 1.14k, False: 402]
  ------------------
  797|  1.14k|      pstr_specific_config->ott_config[box].bs_ott_bands = pstr_bsf_instance->num_bins;
  798|  1.14k|    }
  799|  1.54k|    if (!pstr_specific_config->ttt_config[box].bs_ttt_dual_mode) {
  ------------------
  |  Branch (799:9): [True: 1.54k, False: 0]
  ------------------
  800|  1.54k|      pstr_specific_config->ttt_config[box].bs_ttt_bands_low = pstr_bsf_instance->num_bins;
  801|  1.54k|    }
  802|  1.54k|  }
  803|       |
  804|    402|  return IA_NO_ERROR;
  ------------------
  |  |   23|    402|#define IA_NO_ERROR 0x00000000
  ------------------
  805|    402|}
ixheaace_mps_515_write_spatial_frame:
  809|  21.9k|                                     ixheaace_mps_sac_bsf_instance *pstr_bsf_instance) {
  810|  21.9k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  21.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  811|  21.9k|  UWORD8 bits_param_slot;
  812|  21.9k|  WORD32 param, box, ch, bin;
  813|  21.9k|  WORD32 prev_bs_param_slot, num_temp_shape_chan;
  814|  21.9k|  ixheaace_mps_sac_spatial_frame *pstr_spatial_frame = &(pstr_bsf_instance->current_frame);
  815|  21.9k|  ixheaace_mps_sac_specific_config *pstr_specific_config =
  816|  21.9k|      &(pstr_bsf_instance->spatial_specific_config);
  817|  21.9k|  WORD32 bs_independency_flag = pstr_spatial_frame->bs_independency_flag;
  818|  21.9k|  WORD32 num_param_sets = pstr_spatial_frame->framing_info.bs_num_param_sets;
  819|  21.9k|  WORD32 num_ott_boxes =
  820|  21.9k|      pstr_bsf_instance->spatial_specific_config.tree_description.num_ott_boxes;
  821|  21.9k|  WORD32 num_ttt_boxes =
  822|  21.9k|      pstr_bsf_instance->spatial_specific_config.tree_description.num_ttt_boxes;
  823|  21.9k|  WORD32 *ptr_ott_mode_lfe =
  824|  21.9k|      pstr_bsf_instance->spatial_specific_config.tree_description.ott_mode_lfe;
  825|       |
  826|  21.9k|  if (pstr_specific_config->bs_arbitrary_downmix) {
  ------------------
  |  Branch (826:7): [True: 0, False: 21.9k]
  ------------------
  827|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_ARBITARY_DOWNMIX_CODING;
  828|      0|  }
  829|  21.9k|  if (pstr_specific_config->bs_residual_coding == 1) {
  ------------------
  |  Branch (829:7): [True: 0, False: 21.9k]
  ------------------
  830|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_RESIDUAL_CODING;
  831|      0|  }
  832|  21.9k|  if (pstr_specific_config->bs_arbitrary_downmix == 2) {
  ------------------
  |  Branch (832:7): [True: 0, False: 21.9k]
  ------------------
  833|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_ARBITARY_DOWNMIX_CODING;
  834|      0|  }
  835|  21.9k|  if (pstr_specific_config->tree_description.arbitrary_tree) {
  ------------------
  |  Branch (835:7): [True: 0, False: 21.9k]
  ------------------
  836|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_ARBITARY_TREE_NOT_SUPPORTED;
  837|      0|  }
  838|  21.9k|  ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->framing_info.bs_framing_type, 1);
  839|  21.9k|  ixheaace_write_bits(pstr_bit_buf, num_param_sets - 1, 1);
  840|       |
  841|  21.9k|  if (pstr_spatial_frame->framing_info.bs_framing_type) {
  ------------------
  |  Branch (841:7): [True: 21.9k, False: 0]
  ------------------
  842|  21.9k|    prev_bs_param_slot = -1;
  843|       |
  844|  43.9k|    for (param = 0; param < num_param_sets; param++) {
  ------------------
  |  Branch (844:21): [True: 21.9k, False: 21.9k]
  ------------------
  845|  21.9k|      bits_param_slot = 0;
  846|   109k|      while ((1 << bits_param_slot) < (pstr_specific_config->bs_frame_length + 1 -
  ------------------
  |  Branch (846:14): [True: 87.9k, False: 21.9k]
  ------------------
  847|   109k|                                       num_param_sets + param - prev_bs_param_slot)) {
  848|  87.9k|        bits_param_slot++;
  849|  87.9k|      }
  850|       |
  851|  21.9k|      if (bits_param_slot > 0) {
  ------------------
  |  Branch (851:11): [True: 21.9k, False: 0]
  ------------------
  852|  21.9k|        ixheaace_write_bits(
  853|  21.9k|            pstr_bit_buf,
  854|  21.9k|            pstr_spatial_frame->framing_info.bs_param_slots[param] - prev_bs_param_slot - 1,
  855|  21.9k|            bits_param_slot);
  856|  21.9k|      }
  857|  21.9k|      prev_bs_param_slot = pstr_spatial_frame->framing_info.bs_param_slots[param];
  858|  21.9k|    }
  859|  21.9k|  }
  860|       |
  861|  21.9k|  ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->bs_independency_flag, 1);
  862|       |
  863|   103k|  for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (863:17): [True: 81.7k, False: 21.9k]
  ------------------
  864|  81.7k|    error = ixheaace_mps_515_ec_data(
  865|  81.7k|        pstr_bit_buf, pstr_spatial_frame->ott_data.cld[box],
  866|  81.7k|        pstr_spatial_frame->ott_data.cld_old[box], &(pstr_spatial_frame->cld_lossless_data),
  867|  81.7k|        IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets, bs_independency_flag, 0,
  ------------------
  |  |   22|  81.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  868|  81.7k|        pstr_specific_config->ott_config[box].bs_ott_bands);
  869|  81.7k|    if (error) {
  ------------------
  |  Branch (869:9): [True: 0, False: 81.7k]
  ------------------
  870|      0|      return error;
  871|      0|    }
  872|  81.7k|  }
  873|  21.9k|  if (!pstr_bsf_instance->spatial_specific_config.bs_one_icc) {
  ------------------
  |  Branch (873:7): [True: 21.9k, False: 0]
  ------------------
  874|   103k|    for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (874:19): [True: 81.7k, False: 21.9k]
  ------------------
  875|  81.7k|      if (!ptr_ott_mode_lfe[box]) {
  ------------------
  |  Branch (875:11): [True: 59.7k, False: 21.9k]
  ------------------
  876|  59.7k|        error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ott_data.icc[box],
  877|  59.7k|                                         pstr_spatial_frame->ott_data.icc_old[box],
  878|  59.7k|                                         &(pstr_spatial_frame->cld_lossless_data),
  879|  59.7k|                                         IXHEAACE_MPS_SAC_DATA_TYPE_ICC, box, num_param_sets,
  ------------------
  |  |   23|  59.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  880|  59.7k|                                         bs_independency_flag, 0, pstr_bsf_instance->num_bins);
  881|  59.7k|        if (error) {
  ------------------
  |  Branch (881:13): [True: 0, False: 59.7k]
  ------------------
  882|      0|          return error;
  883|      0|        }
  884|  59.7k|      }
  885|  81.7k|    }
  886|  21.9k|  } else {
  887|      0|    error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ott_data.icc[0],
  888|      0|                                     pstr_spatial_frame->ott_data.icc_old[0],
  889|      0|                                     &(pstr_spatial_frame->cld_lossless_data),
  890|      0|                                     IXHEAACE_MPS_SAC_DATA_TYPE_ICC, 0, num_param_sets,
  ------------------
  |  |   23|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  891|      0|                                     bs_independency_flag, 0, pstr_bsf_instance->num_bins);
  892|      0|    if (error) {
  ------------------
  |  Branch (892:9): [True: 0, False: 0]
  ------------------
  893|      0|      return error;
  894|      0|    }
  895|      0|  }
  896|  36.1k|  for (box = 0; box < num_ttt_boxes; box++) {
  ------------------
  |  Branch (896:17): [True: 14.1k, False: 21.9k]
  ------------------
  897|  14.1k|    if (pstr_specific_config->ttt_config[box].bs_ttt_mode_low >= 2) {
  ------------------
  |  Branch (897:9): [True: 14.1k, False: 0]
  ------------------
  898|  14.1k|      error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld1[box],
  899|  14.1k|                                       pstr_spatial_frame->ttt_data.cpc_cld1_old[box],
  900|  14.1k|                                       &(pstr_spatial_frame->cld_lossless_data),
  901|  14.1k|                                       IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets,
  ------------------
  |  |   22|  14.1k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  902|  14.1k|                                       bs_independency_flag, 0,
  903|  14.1k|                                       pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  904|  14.1k|      if (error) {
  ------------------
  |  Branch (904:11): [True: 0, False: 14.1k]
  ------------------
  905|      0|        return error;
  906|      0|      }
  907|  14.1k|      error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld2[box],
  908|  14.1k|                                       pstr_spatial_frame->ttt_data.cpc_cld2_old[box],
  909|  14.1k|                                       &(pstr_spatial_frame->cld_lossless_data),
  910|  14.1k|                                       IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets,
  ------------------
  |  |   22|  14.1k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  911|  14.1k|                                       bs_independency_flag, 0,
  912|  14.1k|                                       pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  913|  14.1k|      if (error) {
  ------------------
  |  Branch (913:11): [True: 0, False: 14.1k]
  ------------------
  914|      0|        return error;
  915|      0|      }
  916|  14.1k|    } else {
  917|      0|      error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld1[box],
  918|      0|                                       pstr_spatial_frame->ttt_data.cpc_cld1_old[box],
  919|      0|                                       &(pstr_spatial_frame->cpc_lossless_data),
  920|      0|                                       IXHEAACE_MPS_SAC_DATA_TYPE_CPC, box, num_param_sets,
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  921|      0|                                       bs_independency_flag, 0,
  922|      0|                                       pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  923|      0|      if (error) {
  ------------------
  |  Branch (923:11): [True: 0, False: 0]
  ------------------
  924|      0|        return error;
  925|      0|      }
  926|      0|      error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld2[box],
  927|      0|                                       pstr_spatial_frame->ttt_data.cpc_cld2_old[box],
  928|      0|                                       &(pstr_spatial_frame->cpc_lossless_data),
  929|      0|                                       IXHEAACE_MPS_SAC_DATA_TYPE_CPC, box, num_param_sets,
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  930|      0|                                       bs_independency_flag, 0,
  931|      0|                                       pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  932|      0|      if (error) {
  ------------------
  |  Branch (932:11): [True: 0, False: 0]
  ------------------
  933|      0|        return error;
  934|      0|      }
  935|      0|      error = ixheaace_mps_515_ec_data(
  936|      0|          pstr_bit_buf, pstr_spatial_frame->ttt_data.icc[box],
  937|      0|          pstr_spatial_frame->ttt_data.icc_old[box], &(pstr_spatial_frame->icc_lossless_data),
  938|      0|          IXHEAACE_MPS_SAC_DATA_TYPE_ICC, box, num_param_sets, bs_independency_flag, 0,
  ------------------
  |  |   23|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  939|      0|          pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  940|      0|      if (error) {
  ------------------
  |  Branch (940:11): [True: 0, False: 0]
  ------------------
  941|      0|        return error;
  942|      0|      }
  943|      0|    }
  944|       |
  945|  14.1k|    if (pstr_specific_config->ttt_config[box].bs_ttt_dual_mode) {
  ------------------
  |  Branch (945:9): [True: 0, False: 14.1k]
  ------------------
  946|      0|      if (pstr_specific_config->ttt_config[box].bs_ttt_mode_high >= 2) {
  ------------------
  |  Branch (946:11): [True: 0, False: 0]
  ------------------
  947|      0|        error = ixheaace_mps_515_ec_data(
  948|      0|            pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld1[box],
  949|      0|            pstr_spatial_frame->ttt_data.cpc_cld1_old[box],
  950|      0|            &(pstr_spatial_frame->cld_lossless_data), IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box,
  ------------------
  |  |   22|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  951|      0|            num_param_sets, bs_independency_flag,
  952|      0|            pstr_specific_config->ttt_config[box].bs_ttt_bands_low, pstr_bsf_instance->num_bins);
  953|      0|        if (error) {
  ------------------
  |  Branch (953:13): [True: 0, False: 0]
  ------------------
  954|      0|          return error;
  955|      0|        }
  956|      0|        error = ixheaace_mps_515_ec_data(
  957|      0|            pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld2[box],
  958|      0|            pstr_spatial_frame->ttt_data.cpc_cld2_old[box],
  959|      0|            &(pstr_spatial_frame->cld_lossless_data), IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box,
  ------------------
  |  |   22|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  960|      0|            num_param_sets, bs_independency_flag,
  961|      0|            pstr_specific_config->ttt_config[box].bs_ttt_bands_low, pstr_bsf_instance->num_bins);
  962|      0|        if (error) {
  ------------------
  |  Branch (962:13): [True: 0, False: 0]
  ------------------
  963|      0|          return error;
  964|      0|        }
  965|      0|      } else {
  966|      0|        error = ixheaace_mps_515_ec_data(
  967|      0|            pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld1[box],
  968|      0|            pstr_spatial_frame->ttt_data.cpc_cld1_old[box],
  969|      0|            &(pstr_spatial_frame->cpc_lossless_data), IXHEAACE_MPS_SAC_DATA_TYPE_CPC, box,
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  970|      0|            num_param_sets, bs_independency_flag,
  971|      0|            pstr_specific_config->ttt_config[box].bs_ttt_bands_low, pstr_bsf_instance->num_bins);
  972|      0|        if (error) {
  ------------------
  |  Branch (972:13): [True: 0, False: 0]
  ------------------
  973|      0|          return error;
  974|      0|        }
  975|      0|        error = ixheaace_mps_515_ec_data(
  976|      0|            pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld2[box],
  977|      0|            pstr_spatial_frame->ttt_data.cpc_cld2_old[box],
  978|      0|            &(pstr_spatial_frame->cpc_lossless_data), IXHEAACE_MPS_SAC_DATA_TYPE_CPC, box,
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  979|      0|            num_param_sets, bs_independency_flag,
  980|      0|            pstr_specific_config->ttt_config[box].bs_ttt_bands_low, pstr_bsf_instance->num_bins);
  981|      0|        if (error) {
  ------------------
  |  Branch (981:13): [True: 0, False: 0]
  ------------------
  982|      0|          return error;
  983|      0|        }
  984|      0|        error = ixheaace_mps_515_ec_data(
  985|      0|            pstr_bit_buf, pstr_spatial_frame->ttt_data.icc[box],
  986|      0|            pstr_spatial_frame->ttt_data.icc_old[box], &(pstr_spatial_frame->icc_lossless_data),
  987|      0|            IXHEAACE_MPS_SAC_DATA_TYPE_ICC, box, num_param_sets, bs_independency_flag,
  ------------------
  |  |   23|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  988|      0|            pstr_specific_config->ttt_config[box].bs_ttt_bands_low, pstr_bsf_instance->num_bins);
  989|      0|        if (error) {
  ------------------
  |  Branch (989:13): [True: 0, False: 0]
  ------------------
  990|      0|          return error;
  991|      0|        }
  992|      0|      }
  993|      0|    }
  994|  14.1k|  }
  995|  43.9k|  for (param = 0; param < num_param_sets; param++) {
  ------------------
  |  Branch (995:19): [True: 21.9k, False: 21.9k]
  ------------------
  996|  21.9k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->smg_data.bs_smooth_mode[param], 2);
  997|       |
  998|  21.9k|    if (pstr_spatial_frame->smg_data.bs_smooth_mode[param] >= 2) {
  ------------------
  |  Branch (998:9): [True: 0, False: 21.9k]
  ------------------
  999|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->smg_data.bs_smooth_time[param], 2);
 1000|      0|    }
 1001|  21.9k|    if (pstr_spatial_frame->smg_data.bs_smooth_mode[param] == 3) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 21.9k]
  ------------------
 1002|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->smg_data.bs_freq_res_stride[param],
 1003|      0|                          2);
 1004|      0|      for (bin = 0; bin < pstr_bsf_instance->num_bins;
  ------------------
  |  Branch (1004:21): [True: 0, False: 0]
  ------------------
 1005|      0|           bin += pstr_spatial_frame->smg_data.bs_freq_res_stride[param]) {
 1006|      0|        ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->smg_data.bs_smg_data[param][bin],
 1007|      0|                            1);
 1008|      0|      }
 1009|      0|    }
 1010|  21.9k|  }
 1011|  21.9k|  if (pstr_specific_config->bs_temp_shape_config != 0) {
  ------------------
  |  Branch (1011:7): [True: 0, False: 21.9k]
  ------------------
 1012|      0|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->temp_shape_data.bs_temp_shape_enable,
 1013|      0|                        1);
 1014|      0|    if (pstr_spatial_frame->temp_shape_data.bs_temp_shape_enable) {
  ------------------
  |  Branch (1014:9): [True: 0, False: 0]
  ------------------
 1015|      0|      num_temp_shape_chan = temp_shape_chan_table[pstr_specific_config->bs_temp_shape_config - 1]
 1016|      0|                                                 [pstr_specific_config->bs_tree_config];
 1017|      0|      for (ch = 0; ch < num_temp_shape_chan; ch++) {
  ------------------
  |  Branch (1017:20): [True: 0, False: 0]
  ------------------
 1018|      0|        ixheaace_write_bits(pstr_bit_buf,
 1019|      0|                            pstr_spatial_frame->temp_shape_data.bs_temp_shape_enable_channel[ch],
 1020|      0|                            1);
 1021|      0|      }
 1022|      0|      if (pstr_specific_config->bs_temp_shape_config == 2) {
  ------------------
  |  Branch (1022:11): [True: 0, False: 0]
  ------------------
 1023|      0|        return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_GUIDED_ENV_SHAPE;
 1024|      0|      }
 1025|      0|    }
 1026|      0|  }
 1027|       |
 1028|  21.9k|  ixheaace_byte_align_buffer(pstr_bit_buf);
 1029|       |
 1030|  21.9k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  21.9k|#define IA_NO_ERROR 0x00000000
  ------------------
 1031|  21.9k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_get_bs_freq_res_index:
   66|  1.28k|                                                           WORD32 aot) {
   67|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
   68|  1.28k|  WORD32 idx;
   69|  1.28k|  const UWORD8 *p_freq_res_bin_table;
   70|  1.28k|  *ptr_bs_freq_res_index = -1;
   71|       |
   72|  1.28k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (72:7): [True: 151, False: 1.12k]
  ------------------
   73|    151|    p_freq_res_bin_table = freq_res_bin_table_ld;
   74|  1.12k|  } else {
   75|  1.12k|    p_freq_res_bin_table = freq_res_bin_table_usac;
   76|  1.12k|  }
   77|  2.71k|  for (idx = 0; idx < MAX_FREQ_RES_INDEX; idx++) {
  ------------------
  |  |   78|  2.71k|#define MAX_FREQ_RES_INDEX (8)
  ------------------
  |  Branch (77:17): [True: 2.71k, False: 0]
  ------------------
   78|  2.71k|    if (num_bands == p_freq_res_bin_table[idx]) {
  ------------------
  |  Branch (78:9): [True: 1.28k, False: 1.43k]
  ------------------
   79|  1.28k|      *ptr_bs_freq_res_index = idx;
   80|  1.28k|      break;
   81|  1.28k|    }
   82|  2.71k|  }
   83|  1.28k|  if (*ptr_bs_freq_res_index < 0 || *ptr_bs_freq_res_index >= MAX_FREQ_RES_INDEX) {
  ------------------
  |  |   78|  1.28k|#define MAX_FREQ_RES_INDEX (8)
  ------------------
  |  Branch (83:7): [True: 0, False: 1.28k]
  |  Branch (83:37): [True: 0, False: 1.28k]
  ------------------
   84|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   85|      0|  }
   86|  1.28k|  return error;
   87|  1.28k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_get_sampling_frequency_index:
   90|  1.28k|    const UWORD32 bs_sampling_frequency, WORD32 *const ptr_bs_sampling_frequency_index) {
   91|  1.28k|  WORD32 idx;
   92|  1.28k|  *ptr_bs_sampling_frequency_index = SAMPLING_FREQUENCY_INDEX_ESCAPE;
  ------------------
  |  |   80|  1.28k|#define SAMPLING_FREQUENCY_INDEX_ESCAPE (15)
  ------------------
   93|       |
   94|  6.18k|  for (idx = 0; idx < MAX_SAMPLING_FREQUENCY_INDEX; idx++) {
  ------------------
  |  |   79|  6.18k|#define MAX_SAMPLING_FREQUENCY_INDEX (13)
  ------------------
  |  Branch (94:17): [True: 6.18k, False: 0]
  ------------------
   95|  6.18k|    if (bs_sampling_frequency == ia_sampl_freq_table[idx]) {
  ------------------
  |  Branch (95:9): [True: 1.28k, False: 4.90k]
  ------------------
   96|  1.28k|      *ptr_bs_sampling_frequency_index = idx;
   97|  1.28k|      break;
   98|  1.28k|    }
   99|  6.18k|  }
  100|  1.28k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_write_framing_info:
  335|  12.2k|    const ixheaace_mps_framing_info *const pstr_framing_info, const WORD32 frame_length) {
  336|  12.2k|  ixheaace_write_bits(pstr_bit_buf, pstr_framing_info->bs_framing_type, 1);
  337|  12.2k|  ixheaace_write_bits(pstr_bit_buf, pstr_framing_info->num_param_sets - 1, 1);
  338|       |
  339|  12.2k|  if (pstr_framing_info->bs_framing_type) {
  ------------------
  |  Branch (339:7): [True: 0, False: 12.2k]
  ------------------
  340|      0|    WORD32 ps = 0;
  341|      0|    UWORD8 bits_param_slot = 0;
  342|      0|    WORD32 num_param_sets = pstr_framing_info->num_param_sets;
  343|      0|    while ((1 << bits_param_slot) < (frame_length + 1)) {
  ------------------
  |  Branch (343:12): [True: 0, False: 0]
  ------------------
  344|      0|      bits_param_slot++;
  345|      0|    }
  346|      0|    if (bits_param_slot > 0) {
  ------------------
  |  Branch (346:9): [True: 0, False: 0]
  ------------------
  347|      0|      for (ps = 0; ps < num_param_sets; ps++) {
  ------------------
  |  Branch (347:20): [True: 0, False: 0]
  ------------------
  348|      0|        ixheaace_write_bits(pstr_bit_buf, pstr_framing_info->bs_param_slots[ps], bits_param_slot);
  349|      0|      }
  350|      0|    }
  351|      0|  }
  352|  12.2k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_write_ott_data:
  306|  91.2k|    const WORD32 num_bands, const WORD32 num_param_sets, const WORD32 bs_independency_flag) {
  307|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  308|  91.2k|  WORD32 box;
  309|   182k|  for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (309:17): [True: 91.2k, False: 91.2k]
  ------------------
  310|  91.2k|    error = ixheaace_mps_212_ec_data(
  311|  91.2k|        pstr_bit_buf, pstr_ott_data->cld[box], pstr_prev_ott_data->cld_old[box],
  312|  91.2k|        pstr_prev_ott_data->quant_coarse_cld_prev[box], pstr_cld_lossless_data,
  313|  91.2k|        IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets, bs_independency_flag, 0,
  ------------------
  |  |   22|  91.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  314|  91.2k|        ott_config[box].bs_ott_bands, 15);
  315|  91.2k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (315:9): [True: 0, False: 91.2k]
  ------------------
  316|      0|      return error;
  317|      0|    }
  318|  91.2k|  }
  319|   182k|  for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (319:17): [True: 91.2k, False: 91.2k]
  ------------------
  320|  91.2k|    error = ixheaace_mps_212_ec_data(pstr_bit_buf, pstr_ott_data->icc[box],
  321|  91.2k|                                     pstr_prev_ott_data->icc_old[box],
  322|  91.2k|                                     pstr_prev_ott_data->quant_coarse_icc_prev[box],
  323|  91.2k|                                     pstr_icc_lossless_data, IXHEAACE_MPS_SAC_DATA_TYPE_ICC, box,
  ------------------
  |  |   23|  91.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  324|  91.2k|                                     num_param_sets, bs_independency_flag, 0, num_bands, 0);
  325|  91.2k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (325:9): [True: 0, False: 91.2k]
  ------------------
  326|      0|      return error;
  327|      0|    }
  328|  91.2k|  }
  329|       |
  330|  91.2k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  331|  91.2k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_ec_data:
  107|   182k|    const WORD32 start_band, const WORD32 stop_band, const WORD32 default_value) {
  108|   182k|  IA_ERRORCODE error;
  109|   182k|  WORD32 ps, pb, str_offset, pb_stride, i;
  110|   182k|  WORD16 data_bands;
  111|   182k|  WORD32 a_strides[MAX_NUM_BINS + 1] = {0};
  112|   182k|  WORD16 cmp_idx_data[2][MAX_NUM_BINS] = {{0}};
  113|   182k|  WORD16 cmp_old_data[MAX_NUM_BINS] = {0};
  114|       |
  115|   182k|  if (num_param_sets > MAX_NUM_PARAMS) {
  ------------------
  |  |   42|   182k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (115:7): [True: 0, False: 182k]
  ------------------
  116|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_NUM_PARAM_SETS;
  117|      0|  }
  118|       |
  119|   182k|  if (independency_flag || (pstr_lossless_data->bs_quant_coarse_xxx[param_idx][0] !=
  ------------------
  |  Branch (119:7): [True: 13.4k, False: 168k]
  |  Branch (119:28): [True: 0, False: 168k]
  ------------------
  120|   168k|                            quant_coarse_xxx_prev[param_idx])) {
  121|  13.4k|    pstr_lossless_data->bs_xxx_data_mode[param_idx][0] = IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|  13.4k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  122|   168k|  } else {
  123|   168k|    pstr_lossless_data->bs_xxx_data_mode[param_idx][0] = IXHEAACE_MPS_DATA_MODE_KEEP;
  ------------------
  |  |  114|   168k|#define IXHEAACE_MPS_DATA_MODE_KEEP (1)
  ------------------
  124|  3.78M|    for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (124:26): [True: 3.64M, False: 136k]
  ------------------
  125|  3.64M|      if (data[0][i] != old_data[i]) {
  ------------------
  |  Branch (125:11): [True: 32.4k, False: 3.61M]
  ------------------
  126|  32.4k|        pstr_lossless_data->bs_xxx_data_mode[param_idx][0] = IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|  32.4k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  127|  32.4k|        break;
  128|  32.4k|      }
  129|  3.64M|    }
  130|   168k|  }
  131|       |
  132|   182k|  ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_xxx_data_mode[param_idx][0], 2);
  133|       |
  134|   182k|  for (ps = 1; ps < num_param_sets; ps++) {
  ------------------
  |  Branch (134:16): [True: 0, False: 182k]
  ------------------
  135|      0|    if (pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps] !=
  ------------------
  |  Branch (135:9): [True: 0, False: 0]
  ------------------
  136|      0|        pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps - 1]) {
  137|      0|      pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] = IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|      0|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  138|      0|    } else {
  139|      0|      pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] = IXHEAACE_MPS_DATA_MODE_KEEP;
  ------------------
  |  |  114|      0|#define IXHEAACE_MPS_DATA_MODE_KEEP (1)
  ------------------
  140|      0|      for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (140:28): [True: 0, False: 0]
  ------------------
  141|      0|        if (data[ps][i] != data[ps - 1][i]) {
  ------------------
  |  Branch (141:13): [True: 0, False: 0]
  ------------------
  142|      0|          pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] = IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|      0|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  143|      0|          break;
  144|      0|        }
  145|      0|      }
  146|      0|    }
  147|       |
  148|      0|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_xxx_data_mode[param_idx][ps], 2);
  149|      0|  }
  150|       |
  151|   182k|  for (ps = 0; ps < (num_param_sets - 1); ps++) {
  ------------------
  |  Branch (151:16): [True: 0, False: 182k]
  ------------------
  152|      0|    if (pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] ==
  ------------------
  |  Branch (152:9): [True: 0, False: 0]
  ------------------
  153|      0|        IXHEAACE_MPS_DATA_MODE_FINECOARSE) {
  ------------------
  |  |  116|      0|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  154|      0|      if (pstr_lossless_data->bs_xxx_data_mode[param_idx][ps + 1] ==
  ------------------
  |  Branch (154:11): [True: 0, False: 0]
  ------------------
  155|      0|          IXHEAACE_MPS_DATA_MODE_FINECOARSE) {
  ------------------
  |  |  116|      0|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  156|      0|        if ((pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps + 1] ==
  ------------------
  |  Branch (156:13): [True: 0, False: 0]
  ------------------
  157|      0|             pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps]) &&
  158|      0|            (pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][ps + 1] ==
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|             pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][ps])) {
  160|      0|          pstr_lossless_data->bs_data_pair[param_idx][ps] = 1;
  161|      0|          pstr_lossless_data->bs_data_pair[param_idx][ps + 1] = 1;
  162|      0|          ps++;
  163|      0|          continue;
  164|      0|        }
  165|      0|      }
  166|       |
  167|      0|      pstr_lossless_data->bs_data_pair[param_idx][ps] = 0;
  168|       |
  169|      0|      pstr_lossless_data->bs_data_pair[param_idx][ps + 1] = 0;
  170|      0|    } else {
  171|      0|      pstr_lossless_data->bs_data_pair[param_idx][ps] = 0;
  172|      0|      pstr_lossless_data->bs_data_pair[param_idx][ps + 1] = 0;
  173|      0|    }
  174|      0|  }
  175|       |
  176|   364k|  for (ps = 0; ps < num_param_sets; ps++) {
  ------------------
  |  Branch (176:16): [True: 182k, False: 182k]
  ------------------
  177|   182k|    if (pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] == IXHEAACE_MPS_DATA_MODE_DEFAULT) {
  ------------------
  |  |  113|   182k|#define IXHEAACE_MPS_DATA_MODE_DEFAULT (0)
  ------------------
  |  Branch (177:9): [True: 0, False: 182k]
  ------------------
  178|      0|      for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (178:28): [True: 0, False: 0]
  ------------------
  179|      0|        old_data[i] = (WORD8)default_value;
  180|      0|      }
  181|      0|      quant_coarse_xxx_prev[param_idx] = 0;
  182|      0|    }
  183|       |
  184|   182k|    if (pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] ==
  ------------------
  |  Branch (184:9): [True: 45.8k, False: 136k]
  ------------------
  185|   182k|        IXHEAACE_MPS_DATA_MODE_FINECOARSE) {
  ------------------
  |  |  116|   182k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  186|  45.8k|      ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_data_pair[param_idx][ps], 1);
  187|  45.8k|      ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps],
  188|  45.8k|                          1);
  189|  45.8k|      ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][ps],
  190|  45.8k|                          2);
  191|       |
  192|  45.8k|      if (pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps] !=
  ------------------
  |  Branch (192:11): [True: 0, False: 45.8k]
  ------------------
  193|  45.8k|          quant_coarse_xxx_prev[param_idx]) {
  194|      0|        if (quant_coarse_xxx_prev[param_idx]) {
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      0|          for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (195:32): [True: 0, False: 0]
  ------------------
  196|      0|            old_data[i] *= 2;
  197|      0|          }
  198|       |
  199|      0|          if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (199:15): [True: 0, False: 0]
  ------------------
  200|      0|            for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (200:34): [True: 0, False: 0]
  ------------------
  201|      0|              if (old_data[i] == -14) {
  ------------------
  |  Branch (201:19): [True: 0, False: 0]
  ------------------
  202|      0|                old_data[i] = -15;
  203|      0|              } else if (old_data[i] == 14) {
  ------------------
  |  Branch (203:26): [True: 0, False: 0]
  ------------------
  204|      0|                old_data[i] = 15;
  205|      0|              }
  206|      0|            }
  207|      0|          }
  208|      0|        } else {
  209|      0|          for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (209:32): [True: 0, False: 0]
  ------------------
  210|      0|            old_data[i] /= 2;
  211|      0|          }
  212|      0|        }
  213|      0|      }
  214|       |
  215|  45.8k|      pb_stride = ixheaace_mps_212_get_bs_freq_res_stride(
  216|  45.8k|          pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][ps]);
  217|  45.8k|      data_bands = (WORD16)((stop_band - start_band - 1) / pb_stride + 1);
  218|       |
  219|  45.8k|      a_strides[0] = start_band;
  220|  1.27M|      for (pb = 1; pb <= data_bands; pb++) {
  ------------------
  |  Branch (220:20): [True: 1.23M, False: 45.8k]
  ------------------
  221|  1.23M|        a_strides[pb] = a_strides[pb - 1] + pb_stride;
  222|  1.23M|      }
  223|       |
  224|  45.8k|      str_offset = 0;
  225|  45.8k|      while (a_strides[data_bands] > stop_band) {
  ------------------
  |  Branch (225:14): [True: 0, False: 45.8k]
  ------------------
  226|      0|        if (str_offset < data_bands) {
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|          str_offset++;
  228|      0|        }
  229|      0|        for (i = str_offset; i <= data_bands; i++) {
  ------------------
  |  Branch (229:30): [True: 0, False: 0]
  ------------------
  230|      0|          a_strides[i]--;
  231|      0|        }
  232|      0|      }
  233|       |
  234|  1.27M|      for (pb = 0; pb < data_bands; pb++) {
  ------------------
  |  Branch (234:20): [True: 1.23M, False: 45.8k]
  ------------------
  235|  1.23M|        cmp_old_data[start_band + pb] = old_data[a_strides[pb]];
  236|  1.23M|        cmp_idx_data[0][start_band + pb] = data[ps][a_strides[pb]];
  237|       |
  238|  1.23M|        if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (238:13): [True: 0, False: 1.23M]
  ------------------
  239|      0|          cmp_idx_data[1][start_band + pb] = data[ps + 1][a_strides[pb]];
  240|      0|        }
  241|  1.23M|      }
  242|       |
  243|  45.8k|      if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (243:11): [True: 0, False: 45.8k]
  ------------------
  244|      0|        error = ixheaace_mps_212_ec_data_pair_enc(
  245|      0|            pstr_bit_buf, cmp_idx_data, cmp_old_data, data_type, 0, start_band, data_bands,
  246|      0|            pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps],
  247|      0|            independency_flag && (ps == 0));
  ------------------
  |  Branch (247:13): [True: 0, False: 0]
  |  Branch (247:34): [True: 0, False: 0]
  ------------------
  248|      0|        if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|      0|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|          return error;
  250|      0|        }
  251|  45.8k|      } else {
  252|  45.8k|        error = ixheaace_mps_212_ec_data_single_enc(
  253|  45.8k|            pstr_bit_buf, cmp_idx_data, cmp_old_data, data_type, 0, start_band, data_bands,
  254|  45.8k|            pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps],
  255|  45.8k|            independency_flag && (ps == 0));
  ------------------
  |  Branch (255:13): [True: 13.4k, False: 32.4k]
  |  Branch (255:34): [True: 13.4k, False: 0]
  ------------------
  256|  45.8k|        if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  45.8k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (256:13): [True: 0, False: 45.8k]
  ------------------
  257|      0|          return error;
  258|      0|        }
  259|  45.8k|      }
  260|  1.27M|      for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (260:28): [True: 1.23M, False: 45.8k]
  ------------------
  261|  1.23M|        if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (261:13): [True: 0, False: 1.23M]
  ------------------
  262|      0|          old_data[i] = data[ps + 1][i];
  263|  1.23M|        } else {
  264|  1.23M|          old_data[i] = data[ps][i];
  265|  1.23M|        }
  266|  1.23M|      }
  267|       |
  268|  45.8k|      quant_coarse_xxx_prev[param_idx] = pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps];
  269|       |
  270|  45.8k|      if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (270:11): [True: 0, False: 45.8k]
  ------------------
  271|      0|        ps++;
  272|      0|      }
  273|  45.8k|    }
  274|   182k|  }
  275|   182k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   182k|#define IA_NO_ERROR 0x00000000
  ------------------
  276|   182k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_get_bs_freq_res_stride:
   51|  45.8k|static UWORD8 ixheaace_mps_212_get_bs_freq_res_stride(const WORD32 index) {
   52|  45.8k|  WORD32 freq_res_stride_table_size = 0;
   53|  45.8k|  const UWORD8 *ptr_freq_res_stride_table = NULL;
   54|       |
   55|  45.8k|  ptr_freq_res_stride_table = freq_res_stride_table_212;
   56|  45.8k|  freq_res_stride_table_size =
   57|  45.8k|      sizeof(freq_res_stride_table_212) / sizeof(*freq_res_stride_table_212);
   58|       |
   59|  45.8k|  return (((index >= 0) && (index < freq_res_stride_table_size))
  ------------------
  |  Branch (59:12): [True: 45.8k, False: 0]
  |  Branch (59:28): [True: 45.8k, False: 0]
  ------------------
   60|  45.8k|              ? ptr_freq_res_stride_table[index]
   61|  45.8k|              : 1);
   62|  45.8k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_write_smg_data:
  281|  12.2k|                                            const WORD32 data_bands) {
  282|  12.2k|  WORD32 param, band;
  283|       |
  284|  24.4k|  for (param = 0; param < num_param_sets; param++) {
  ------------------
  |  Branch (284:19): [True: 12.2k, False: 12.2k]
  ------------------
  285|  12.2k|    ixheaace_write_bits(pstr_bit_buf, pstr_smg_data->bs_smooth_mode[param], 2);
  286|  12.2k|    if (pstr_smg_data->bs_smooth_mode[param] >= 2) {
  ------------------
  |  Branch (286:9): [True: 0, False: 12.2k]
  ------------------
  287|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_smg_data->bs_smooth_time[param], 2);
  288|      0|    }
  289|  12.2k|    if (pstr_smg_data->bs_smooth_mode[param] == 3) {
  ------------------
  |  Branch (289:9): [True: 0, False: 12.2k]
  ------------------
  290|      0|      WORD32 stride =
  291|      0|          ixheaace_mps_212_get_bs_freq_res_stride(pstr_smg_data->bs_freq_res_stride[param]);
  292|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_smg_data->bs_freq_res_stride[param], 2);
  293|      0|      for (band = 0; band < data_bands; band += stride) {
  ------------------
  |  Branch (293:22): [True: 0, False: 0]
  ------------------
  294|      0|        ixheaace_write_bits(pstr_bit_buf, pstr_smg_data->bs_smg_data[param][band], 1);
  295|      0|      }
  296|      0|    }
  297|  12.2k|  }
  298|  12.2k|}
ixheaace_mps_bitstream.c:ixheaace_mps_515_ec_data:
  360|   169k|                                             WORD32 start_band, WORD32 stop_band) {
  361|   169k|  WORD32 param_set, set_idx, pb_stride, data_bands, bin, data_sets;
  362|   169k|  WORD32 param_set_index[MAX_NUM_PARAMS] = {0};
  363|       |
  364|   339k|  for (param_set = 0; param_set < num_param_sets; param_set++) {
  ------------------
  |  Branch (364:23): [True: 169k, False: 169k]
  ------------------
  365|   169k|    pstr_lossless_data->bs_xxx_data_mode[param_idx][param_set] =
  366|   169k|        IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|   169k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  367|   169k|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_xxx_data_mode[param_idx][param_set],
  368|   169k|                        2);
  369|   169k|  }
  370|       |
  371|   339k|  for (param_set = 0, set_idx = 0; param_set < num_param_sets; param_set++) {
  ------------------
  |  Branch (371:36): [True: 169k, False: 169k]
  ------------------
  372|   169k|    param_set_index[set_idx] = param_set;
  373|   169k|    if (param_set != num_param_sets - 1) {
  ------------------
  |  Branch (373:9): [True: 0, False: 169k]
  ------------------
  374|      0|      pstr_lossless_data->bs_data_pair[param_idx][set_idx] = 1;
  375|      0|      pstr_lossless_data->bs_data_pair[param_idx][set_idx + 1] = 1;
  376|      0|      param_set++;
  377|      0|      set_idx += 2;
  378|   169k|    } else {
  379|   169k|      pstr_lossless_data->bs_data_pair[param_idx][set_idx] = 0;
  380|   169k|      set_idx++;
  381|   169k|    }
  382|   169k|  }
  383|   169k|  data_sets = set_idx;
  384|       |
  385|   339k|  for (set_idx = 0; set_idx < data_sets;) {
  ------------------
  |  Branch (385:21): [True: 169k, False: 169k]
  ------------------
  386|   169k|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_data_pair[param_idx][set_idx], 1);
  387|   169k|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_quant_coarse_xxx[param_idx][set_idx],
  388|   169k|                        1);
  389|   169k|    ixheaace_write_bits(pstr_bit_buf,
  390|   169k|                        pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][set_idx], 2);
  391|       |
  392|   169k|    pb_stride =
  393|   169k|        freq_res_stride_table[pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][set_idx]];
  394|   169k|    data_bands = (stop_band - start_band - 1) / pb_stride + 1;
  395|       |
  396|   169k|    ixheaace_mps_515_ec_data_pair_enc(
  397|   169k|        pstr_bit_buf, data, old_data, data_type, param_set_index[set_idx], start_band, data_bands,
  398|   169k|        pstr_lossless_data->bs_data_pair[param_idx][set_idx],
  399|   169k|        pstr_lossless_data->bs_quant_coarse_xxx[param_idx][set_idx], independency_flag);
  400|       |
  401|   169k|    if (pstr_lossless_data->bs_data_pair[param_idx][set_idx]) {
  ------------------
  |  Branch (401:9): [True: 0, False: 169k]
  ------------------
  402|      0|      if (pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][set_idx + 1] !=
  ------------------
  |  Branch (402:11): [True: 0, False: 0]
  ------------------
  403|      0|          pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][set_idx]) {
  404|      0|        return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_RES_STRIDE;
  405|      0|      }
  406|      0|      if (pstr_lossless_data->bs_quant_coarse_xxx[param_idx][set_idx + 1] !=
  ------------------
  |  Branch (406:11): [True: 0, False: 0]
  ------------------
  407|      0|          pstr_lossless_data->bs_quant_coarse_xxx[param_idx][set_idx]) {
  408|      0|        return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_QUANT_COARSE;
  409|      0|      }
  410|      0|    }
  411|       |
  412|  9.67M|    for (bin = 0; bin < MAX_NUM_BINS; bin++) {
  ------------------
  |  |   41|  9.67M|#define MAX_NUM_BINS (56)
  ------------------
  |  Branch (412:19): [True: 9.50M, False: 169k]
  ------------------
  413|  9.50M|      old_data[bin] = data[param_set_index[set_idx] +
  414|  9.50M|                           pstr_lossless_data->bs_data_pair[param_idx][set_idx]][bin];
  415|  9.50M|    }
  416|       |
  417|   169k|    set_idx += pstr_lossless_data->bs_data_pair[param_idx][set_idx] + 1;
  418|   169k|  }
  419|   169k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   169k|#define IA_NO_ERROR 0x00000000
  ------------------
  420|   169k|}

ixheaace_mps_212_dct_iv:
   50|  6.19M|IA_ERRORCODE ixheaace_mps_212_dct_iv(FLOAT32 *ptr_data, WORD32 length, WORD8 *ptr_scratch) {
   51|  6.19M|  WORD32 sin_step = 0;
   52|  6.19M|  WORD32 length_by_2 = length >> 1;
   53|  6.19M|  WORD32 step, idx;
   54|  6.19M|  FLOAT32 accu_1, accu_2, accu_3, accu_4;
   55|  6.19M|  FLOAT32 *ptr_data_0;
   56|  6.19M|  FLOAT32 *ptr_data_1;
   57|  6.19M|  const ixheaace_cmplx_str *ptr_cmplx_twiddle;
   58|  6.19M|  const ixheaace_cmplx_str *ptr_cmplx_sin_twiddle;
   59|  6.19M|  ixheaace_scratch_mem *pstr_scratch = (ixheaace_scratch_mem *)ptr_scratch;
   60|       |
   61|  6.19M|  if (length == 64) {
  ------------------
  |  Branch (61:7): [True: 6.19M, False: 0]
  ------------------
   62|  6.19M|    ptr_cmplx_twiddle = sine_window_64;
   63|  6.19M|    ptr_cmplx_sin_twiddle = sine_table_1024;
   64|  6.19M|    sin_step = 32;
   65|  6.19M|  } else {
   66|      0|    ptr_cmplx_twiddle = sine_window_32;
   67|      0|    ptr_cmplx_sin_twiddle = sine_table_1024;
   68|      0|    sin_step = 64;
   69|      0|  }
   70|       |
   71|  6.19M|  ptr_data_0 = &ptr_data[0];
   72|  6.19M|  ptr_data_1 = &ptr_data[length - 2];
   73|   105M|  for (idx = 0; idx < length_by_2 - 1; idx += 2, ptr_data_0 += 2, ptr_data_1 -= 2) {
  ------------------
  |  Branch (73:17): [True: 99.1M, False: 6.19M]
  ------------------
   74|  99.1M|    accu_1 =
   75|  99.1M|        (ptr_data_1[1] * ptr_cmplx_twiddle[idx].re) - (ptr_data_0[0] * ptr_cmplx_twiddle[idx].im);
   76|  99.1M|    accu_2 =
   77|  99.1M|        (ptr_data_1[1] * ptr_cmplx_twiddle[idx].im) + (ptr_data_0[0] * ptr_cmplx_twiddle[idx].re);
   78|  99.1M|    accu_3 = (ptr_data_1[0] * ptr_cmplx_twiddle[idx + 1].re) -
   79|  99.1M|             (ptr_data_0[1] * ptr_cmplx_twiddle[idx + 1].im);
   80|  99.1M|    accu_4 = (ptr_data_1[0] * ptr_cmplx_twiddle[idx + 1].im) +
   81|  99.1M|             (ptr_data_0[1] * ptr_cmplx_twiddle[idx + 1].re);
   82|       |
   83|  99.1M|    ptr_data_0[0] = accu_2 / 4;
   84|  99.1M|    ptr_data_0[1] = accu_1 / 4;
   85|  99.1M|    ptr_data_1[0] = accu_4 / 4;
   86|  99.1M|    ptr_data_1[1] = -(accu_3 / 4);
   87|  99.1M|  }
   88|  6.19M|  ia_enhaacplus_enc_complex_fft(ptr_data, length_by_2, pstr_scratch);
   89|  6.19M|  if (length_by_2 == 32) {
  ------------------
  |  Branch (89:7): [True: 6.19M, False: 0]
  ------------------
   90|   402M|    for (idx = 0; idx < length; idx++) {
  ------------------
  |  Branch (90:19): [True: 396M, False: 6.19M]
  ------------------
   91|   396M|      ptr_data[idx] = (ptr_data[idx] / (1 << (4)));
   92|   396M|    }
   93|  6.19M|  } else {
   94|      0|    for (idx = 0; idx < length; idx++) {
  ------------------
  |  Branch (94:19): [True: 0, False: 0]
  ------------------
   95|      0|      ptr_data[idx] = (ptr_data[idx] / (1 << (3)));
   96|      0|    }
   97|      0|  }
   98|       |
   99|  6.19M|  ptr_data_0 = &ptr_data[0];
  100|  6.19M|  ptr_data_1 = &ptr_data[length - 2];
  101|  6.19M|  accu_1 = ptr_data_1[0];
  102|  6.19M|  accu_2 = ptr_data_1[1];
  103|  6.19M|  ptr_data_1[1] = -ptr_data_0[1];
  104|       |
  105|  99.1M|  for (step = sin_step, idx = 1; idx<(length_by_2 + 1)>> 1; idx++, step += sin_step) {
  ------------------
  |  Branch (105:34): [True: 92.9M, False: 6.19M]
  ------------------
  106|  92.9M|    ixheaace_cmplx_str twd = ptr_cmplx_sin_twiddle[step];
  107|  92.9M|    accu_3 = (accu_1 * twd.re) - (accu_2 * twd.im);
  108|  92.9M|    accu_4 = (accu_1 * twd.im) + (accu_2 * twd.re);
  109|  92.9M|    ptr_data_0[1] = accu_3;
  110|  92.9M|    ptr_data_1[0] = accu_4;
  111|       |
  112|  92.9M|    ptr_data_0 += 2;
  113|  92.9M|    ptr_data_1 -= 2;
  114|       |
  115|  92.9M|    accu_3 = (ptr_data_0[1] * twd.re) - (ptr_data_0[0] * twd.im);
  116|  92.9M|    accu_4 = (ptr_data_0[1] * twd.im) + (ptr_data_0[0] * twd.re);
  117|  92.9M|    accu_1 = ptr_data_1[0];
  118|  92.9M|    accu_2 = ptr_data_1[1];
  119|       |
  120|  92.9M|    ptr_data_1[1] = -accu_3;
  121|  92.9M|    ptr_data_0[0] = accu_4;
  122|  92.9M|  }
  123|  6.19M|  accu_1 = (accu_1 * SQUARE_ROOT_TWO);
  ------------------
  |  |  157|  6.19M|#define SQUARE_ROOT_TWO (1.41421356237f)
  ------------------
  124|  6.19M|  accu_2 = (accu_2 * SQUARE_ROOT_TWO);
  ------------------
  |  |  157|  6.19M|#define SQUARE_ROOT_TWO (1.41421356237f)
  ------------------
  125|       |
  126|  6.19M|  ptr_data_1[0] = (accu_1 + accu_2) / 2;
  127|  6.19M|  ptr_data_0[1] = (accu_1 - accu_2) / 2;
  128|       |
  129|  6.19M|  return IA_NO_ERROR;
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  130|  6.19M|}
ixheaace_mps_212_dst_iv:
  132|  6.19M|IA_ERRORCODE ixheaace_mps_212_dst_iv(FLOAT32 *ptr_data, WORD32 length, WORD8 *ptr_scratch) {
  133|  6.19M|  WORD32 sin_step = 0;
  134|  6.19M|  WORD32 step, idx;
  135|  6.19M|  WORD32 length_by_2 = length >> 1;
  136|  6.19M|  FLOAT32 accu_1, accu_2, accu_3, accu_4;
  137|  6.19M|  FLOAT32 *ptr_data_0;
  138|  6.19M|  FLOAT32 *ptr_data_1;
  139|  6.19M|  const ixheaace_cmplx_str *ptr_cmplx_twiddle;
  140|  6.19M|  const ixheaace_cmplx_str *ptr_cmplx_sin_twiddle;
  141|  6.19M|  ixheaace_scratch_mem *pstr_scratch = (ixheaace_scratch_mem *)ptr_scratch;
  142|  6.19M|  if (length == 64) {
  ------------------
  |  Branch (142:7): [True: 6.19M, False: 0]
  ------------------
  143|  6.19M|    ptr_cmplx_twiddle = sine_window_64;
  144|  6.19M|    ptr_cmplx_sin_twiddle = sine_table_1024;
  145|  6.19M|    sin_step = 32;
  146|  6.19M|  } else {
  147|      0|    ptr_cmplx_twiddle = sine_window_32;
  148|      0|    ptr_cmplx_sin_twiddle = sine_table_1024;
  149|      0|    sin_step = 64;
  150|      0|  }
  151|       |
  152|  6.19M|  ptr_data_0 = &ptr_data[0];
  153|  6.19M|  ptr_data_1 = &ptr_data[length - 2];
  154|   105M|  for (idx = 0; idx < length_by_2 - 1; idx += 2, ptr_data_0 += 2, ptr_data_1 -= 2) {
  ------------------
  |  Branch (154:17): [True: 99.1M, False: 6.19M]
  ------------------
  155|  99.1M|    accu_1 = (ptr_data_1[1] * ptr_cmplx_twiddle[idx].re) -
  156|  99.1M|             ((-ptr_data_0[0]) * ptr_cmplx_twiddle[idx].im);
  157|  99.1M|    accu_2 = (ptr_data_1[1] * ptr_cmplx_twiddle[idx].im) +
  158|  99.1M|             ((-ptr_data_0[0]) * ptr_cmplx_twiddle[idx].re);
  159|  99.1M|    accu_3 = ((-ptr_data_1[0]) * ptr_cmplx_twiddle[idx + 1].re) -
  160|  99.1M|             (ptr_data_0[1] * ptr_cmplx_twiddle[idx + 1].im);
  161|  99.1M|    accu_4 = ((-ptr_data_1[0]) * ptr_cmplx_twiddle[idx + 1].im) +
  162|  99.1M|             (ptr_data_0[1] * ptr_cmplx_twiddle[idx + 1].re);
  163|  99.1M|    ptr_data_0[0] = accu_2 / 4;
  164|  99.1M|    ptr_data_0[1] = accu_1 / 4;
  165|  99.1M|    ptr_data_1[0] = accu_4 / 4;
  166|  99.1M|    ptr_data_1[1] = -(accu_3) / 4;
  167|  99.1M|  }
  168|  6.19M|  ia_enhaacplus_enc_complex_fft(ptr_data, length_by_2, pstr_scratch);
  169|  6.19M|  if (length_by_2 == 32) {
  ------------------
  |  Branch (169:7): [True: 6.19M, False: 0]
  ------------------
  170|   402M|    for (idx = 0; idx < length; idx++) {
  ------------------
  |  Branch (170:19): [True: 396M, False: 6.19M]
  ------------------
  171|   396M|      ptr_data[idx] = (ptr_data[idx] / (1 << (4)));
  172|   396M|    }
  173|  6.19M|  } else {
  174|      0|    for (idx = 0; idx < length; idx++) {
  ------------------
  |  Branch (174:19): [True: 0, False: 0]
  ------------------
  175|      0|      ptr_data[idx] = (ptr_data[idx] / (1 << (3)));
  176|      0|    }
  177|      0|  }
  178|  6.19M|  ptr_data_0 = &ptr_data[0];
  179|  6.19M|  ptr_data_1 = &ptr_data[length - 2];
  180|  6.19M|  accu_1 = ptr_data_1[0];
  181|  6.19M|  accu_2 = ptr_data_1[1];
  182|  6.19M|  ptr_data_1[1] = -ptr_data_0[0];
  183|  6.19M|  ptr_data_0[0] = ptr_data_0[1];
  184|       |
  185|  99.1M|  for (step = sin_step, idx = 1; idx<(length_by_2 + 1)>> 1; idx++, step += sin_step) {
  ------------------
  |  Branch (185:34): [True: 92.9M, False: 6.19M]
  ------------------
  186|  92.9M|    ixheaace_cmplx_str twd = ptr_cmplx_sin_twiddle[step];
  187|       |
  188|  92.9M|    accu_3 = (accu_1 * twd.re) - (accu_2 * twd.im);
  189|  92.9M|    accu_4 = (accu_1 * twd.im) + (accu_2 * twd.re);
  190|  92.9M|    ptr_data_1[0] = -accu_3;
  191|  92.9M|    ptr_data_0[1] = -accu_4;
  192|       |
  193|  92.9M|    ptr_data_0 += 2;
  194|  92.9M|    ptr_data_1 -= 2;
  195|       |
  196|  92.9M|    accu_3 = (ptr_data_0[1] * twd.re) - (ptr_data_0[0] * twd.im);
  197|  92.9M|    accu_4 = (ptr_data_0[1] * twd.im) + (ptr_data_0[0] * twd.re);
  198|  92.9M|    accu_1 = ptr_data_1[0];
  199|  92.9M|    accu_2 = ptr_data_1[1];
  200|       |
  201|  92.9M|    ptr_data_0[0] = accu_3;
  202|  92.9M|    ptr_data_1[1] = -accu_4;
  203|  92.9M|  }
  204|       |
  205|  6.19M|  accu_1 = (accu_1 * SQUARE_ROOT_TWO);
  ------------------
  |  |  157|  6.19M|#define SQUARE_ROOT_TWO (1.41421356237f)
  ------------------
  206|  6.19M|  accu_2 = (accu_2 * SQUARE_ROOT_TWO);
  ------------------
  |  |  157|  6.19M|#define SQUARE_ROOT_TWO (1.41421356237f)
  ------------------
  207|  6.19M|  ptr_data_1[0] = (accu_1 + accu_2) / 2;
  208|  6.19M|  ptr_data_0[1] = (accu_1 - accu_2) / 2;
  209|       |
  210|  6.19M|  return IA_NO_ERROR;
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  211|  6.19M|}

ixheaace_mps_212_delay_sub_calculate_buffer_delays:
   34|  1.28k|VOID ixheaace_mps_212_delay_sub_calculate_buffer_delays(ixheaace_mps_pstr_delay pstr_delay) {
   35|  1.28k|  WORD32 num_encoder_an_delay, num_encoder_win_delay, num_decoder_an_delay, num_decoder_syn_delay,
   36|  1.28k|      num_residual_coder_frame_delay, num_arb_dmx_residual_coder_frame_delay;
   37|  1.28k|  WORD32 temp_delay_1, temp_delay_2, temp_delay_12, temp_delay_3;
   38|       |
   39|  1.28k|  if (pstr_delay->delay_config.b_sac_time_alignment_dynamic_out > 0) {
  ------------------
  |  Branch (39:7): [True: 0, False: 1.28k]
  ------------------
   40|      0|    pstr_delay->delay_config.n_sac_time_alignment = 0;
   41|      0|  }
   42|       |
   43|  1.28k|  num_encoder_an_delay =
   44|  1.28k|      2 * pstr_delay->delay_config.num_qmf_len + pstr_delay->delay_config.num_qmf_len / 2;
   45|  1.28k|  num_decoder_an_delay =
   46|  1.28k|      2 * pstr_delay->delay_config.num_qmf_len + pstr_delay->delay_config.num_qmf_len / 2;
   47|  1.28k|  num_decoder_syn_delay =
   48|  1.28k|      1 * pstr_delay->delay_config.num_qmf_len + pstr_delay->delay_config.num_qmf_len / 2;
   49|  1.28k|  num_encoder_win_delay = pstr_delay->delay_config.num_frame_len / 2;
   50|  1.28k|  num_residual_coder_frame_delay = 0;
   51|  1.28k|  num_arb_dmx_residual_coder_frame_delay = 0;
   52|       |
   53|  1.28k|  temp_delay_1 =
   54|  1.28k|      pstr_delay->delay_config.n_arb_dmx_delay - pstr_delay->delay_config.n_surround_delay;
   55|  1.28k|  if (temp_delay_1 >= 0) {
  ------------------
  |  Branch (55:7): [True: 1.28k, False: 0]
  ------------------
   56|  1.28k|    pstr_delay->num_surround_analysis_buffer = temp_delay_1;
   57|  1.28k|    pstr_delay->num_arb_dmx_analysis_buffer = 0;
   58|  1.28k|  } else {
   59|      0|    pstr_delay->num_surround_analysis_buffer = 0;
   60|      0|    pstr_delay->num_arb_dmx_analysis_buffer = -temp_delay_1;
   61|      0|  }
   62|       |
   63|  1.28k|  temp_delay_1 = num_encoder_win_delay + pstr_delay->delay_config.n_surround_delay +
   64|  1.28k|                 pstr_delay->num_surround_analysis_buffer + num_encoder_an_delay;
   65|  1.28k|  temp_delay_2 = num_encoder_win_delay + pstr_delay->delay_config.n_arb_dmx_delay +
   66|  1.28k|                 pstr_delay->num_arb_dmx_analysis_buffer + num_encoder_an_delay;
   67|  1.28k|  temp_delay_3 = pstr_delay->delay_config.n_arb_dmx_delay +
   68|  1.28k|                 pstr_delay->delay_config.n_limiter_delay +
   69|  1.28k|                 pstr_delay->delay_config.num_core_coder_delay +
   70|  1.28k|                 pstr_delay->delay_config.n_sac_time_alignment + num_decoder_an_delay;
   71|       |
   72|  1.28k|  temp_delay_12 = MAX(num_residual_coder_frame_delay, num_arb_dmx_residual_coder_frame_delay) *
  ------------------
  |  |   24|  1.28k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 1.28k]
  |  |  ------------------
  ------------------
   73|  1.28k|                  pstr_delay->delay_config.num_frame_len;
   74|  1.28k|  temp_delay_12 += pstr_delay->delay_config.num_sac_stream_mux_delay;
   75|       |
   76|  1.28k|  if (temp_delay_1 > temp_delay_2) {
  ------------------
  |  Branch (76:7): [True: 0, False: 1.28k]
  ------------------
   77|      0|    temp_delay_12 += temp_delay_1;
   78|  1.28k|  } else {
   79|  1.28k|    temp_delay_12 += temp_delay_2;
   80|  1.28k|  }
   81|       |
   82|  1.28k|  if (temp_delay_3 > temp_delay_12) {
  ------------------
  |  Branch (82:7): [True: 1.28k, False: 0]
  ------------------
   83|  1.28k|    if (pstr_delay->delay_config.b_minimize_delay > 0) {
  ------------------
  |  Branch (83:9): [True: 1.28k, False: 0]
  ------------------
   84|  1.28k|      pstr_delay->num_bitstream_frame_buffer =
   85|  1.28k|          (temp_delay_3 - temp_delay_12) / pstr_delay->delay_config.num_frame_len;
   86|  1.28k|      pstr_delay->num_output_audio_buffer = 0;
   87|  1.28k|      pstr_delay->num_surround_analysis_buffer +=
   88|  1.28k|          (temp_delay_3 - temp_delay_12 -
   89|  1.28k|           (pstr_delay->num_bitstream_frame_buffer * pstr_delay->delay_config.num_frame_len));
   90|  1.28k|      pstr_delay->num_arb_dmx_analysis_buffer +=
   91|  1.28k|          (temp_delay_3 - temp_delay_12 -
   92|  1.28k|           (pstr_delay->num_bitstream_frame_buffer * pstr_delay->delay_config.num_frame_len));
   93|  1.28k|    } else {
   94|      0|      pstr_delay->num_bitstream_frame_buffer =
   95|      0|          ((temp_delay_3 - temp_delay_12) + pstr_delay->delay_config.num_frame_len - 1) /
   96|      0|          pstr_delay->delay_config.num_frame_len;
   97|      0|      pstr_delay->num_output_audio_buffer =
   98|      0|          pstr_delay->num_bitstream_frame_buffer * pstr_delay->delay_config.num_frame_len +
   99|      0|          temp_delay_12 - temp_delay_3;
  100|      0|    }
  101|  1.28k|  } else {
  102|      0|    pstr_delay->num_bitstream_frame_buffer = 0;
  103|      0|    pstr_delay->num_output_audio_buffer = temp_delay_12 - temp_delay_3;
  104|      0|  }
  105|       |
  106|  1.28k|  if (pstr_delay->delay_config.b_dmx_align > 0) {
  ------------------
  |  Branch (106:7): [True: 0, False: 1.28k]
  ------------------
  107|      0|    WORD32 temp_delay =
  108|      0|        pstr_delay->delay_config.n_arb_dmx_delay + pstr_delay->num_output_audio_buffer +
  109|      0|        pstr_delay->delay_config.n_limiter_delay + pstr_delay->delay_config.num_core_coder_delay;
  110|      0|    pstr_delay->num_discard_out_frames =
  111|      0|        (temp_delay + pstr_delay->delay_config.num_frame_len - 1) /
  112|      0|        pstr_delay->delay_config.num_frame_len;
  113|      0|    pstr_delay->num_dmx_align_buffer =
  114|      0|        pstr_delay->num_discard_out_frames * pstr_delay->delay_config.num_frame_len - temp_delay;
  115|  1.28k|  } else {
  116|  1.28k|    pstr_delay->num_discard_out_frames = 0;
  117|  1.28k|    pstr_delay->num_dmx_align_buffer = 0;
  118|  1.28k|  }
  119|       |
  120|  1.28k|  pstr_delay->num_info_dmx_delay = pstr_delay->delay_config.n_arb_dmx_delay +
  121|  1.28k|                                   pstr_delay->num_output_audio_buffer +
  122|  1.28k|                                   pstr_delay->delay_config.n_limiter_delay;
  123|  1.28k|  pstr_delay->num_info_codec_delay = pstr_delay->num_info_dmx_delay +
  124|  1.28k|                                     pstr_delay->delay_config.num_core_coder_delay +
  125|  1.28k|                                     pstr_delay->delay_config.n_sac_time_alignment +
  126|  1.28k|                                     num_decoder_an_delay + num_decoder_syn_delay;
  127|  1.28k|  pstr_delay->num_info_decoder_delay = num_decoder_an_delay + num_decoder_syn_delay;
  128|  1.28k|  pstr_delay->num_bitstream_frame_buffer_size = pstr_delay->num_bitstream_frame_buffer + 1;
  129|  1.28k|}

ixheaace_mps_212_init_enhanced_time_domain_dmx:
   94|  1.28k|    const WORD32 frame_length) {
   95|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
   96|  1.28k|  WORD32 sample_idx;
   97|  1.28k|  FLOAT32 delta;
   98|  1.28k|  if (frame_length > pstr_enhanced_time_domain_dmx->max_frame_length) {
  ------------------
  |  Branch (98:7): [True: 0, False: 1.28k]
  ------------------
   99|      0|    return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  100|      0|  }
  101|  1.28k|  pstr_enhanced_time_domain_dmx->frame_length = frame_length;
  102|  1.28k|  delta = (FLOAT32)(PI_FLT / (2.0 * pstr_enhanced_time_domain_dmx->frame_length));
  ------------------
  |  |   55|  1.28k|#define PI_FLT (3.1415926535897931f)
  ------------------
  103|  2.72M|  for (sample_idx = 0; sample_idx < pstr_enhanced_time_domain_dmx->frame_length + 1;
  ------------------
  |  Branch (103:24): [True: 2.72M, False: 1.28k]
  ------------------
  104|  2.72M|       sample_idx++) {
  105|  2.72M|    FLOAT32 sin_val = (FLOAT32)sin(sample_idx * delta);
  106|  2.72M|    pstr_enhanced_time_domain_dmx->sinus_window[sample_idx] = ALPHA * sin_val * sin_val;
  ------------------
  |  |   56|  2.72M|#define ALPHA (0.0001f)
  ------------------
  107|  2.72M|  }
  108|       |
  109|  1.28k|  pstr_enhanced_time_domain_dmx->prev_left_energy =
  110|  1.28k|      pstr_enhanced_time_domain_dmx->prev_right_energy =
  111|  1.28k|          pstr_enhanced_time_domain_dmx->prev_x_energy = 0.0f;
  112|  1.28k|  pstr_enhanced_time_domain_dmx->cld_weight =
  113|  1.28k|      (ptr_input_gain_m_flt[LEFT_CH]) / (ptr_input_gain_m_flt[RIGHT_CH]);
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
                    (ptr_input_gain_m_flt[LEFT_CH]) / (ptr_input_gain_m_flt[RIGHT_CH]);
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  114|  1.28k|  pstr_enhanced_time_domain_dmx->gain_weight[LEFT_CH] =
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
  115|  1.28k|      (ptr_input_gain_m_flt[LEFT_CH] * output_gain_m_flt);
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
  116|  1.28k|  pstr_enhanced_time_domain_dmx->gain_weight[RIGHT_CH] =
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  117|  1.28k|      (ptr_input_gain_m_flt[RIGHT_CH] * output_gain_m_flt);
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  118|  1.28k|  pstr_enhanced_time_domain_dmx->prev_gain[LEFT_CH] =
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
  119|  1.28k|      pstr_enhanced_time_domain_dmx->gain_weight[LEFT_CH];
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
  120|  1.28k|  pstr_enhanced_time_domain_dmx->prev_gain[RIGHT_CH] =
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  121|  1.28k|      pstr_enhanced_time_domain_dmx->gain_weight[RIGHT_CH];
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  122|  1.28k|  pstr_enhanced_time_domain_dmx->prev_h1[LEFT_CH] =
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
  123|  1.28k|      pstr_enhanced_time_domain_dmx->gain_weight[LEFT_CH];
  ------------------
  |  |   71|  1.28k|#define LEFT_CH (0)
  ------------------
  124|  1.28k|  pstr_enhanced_time_domain_dmx->prev_h1[RIGHT_CH] =
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  125|  1.28k|      pstr_enhanced_time_domain_dmx->gain_weight[RIGHT_CH];
  ------------------
  |  |   72|  1.28k|#define RIGHT_CH (1)
  ------------------
  126|  1.28k|  return error;
  127|  1.28k|}
ixheaace_mps_212_apply_enhanced_time_domain_dmx:
  132|  91.2k|    FLOAT32 *const ptr_output_time_dmx, const WORD32 input_delay) {
  133|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  134|       |
  135|  91.2k|  WORD32 sample_idx;
  136|  91.2k|  FLOAT32 lin_bb_cld, lin_cld, corr, sqrt_lin_cld, g[2], h1[2], gain_left, gain_right;
  137|  91.2k|  FLOAT32 prev_energy_left, prev_energy_right, prev_energy, energy_left, energy_right, energy_out;
  138|  91.2k|  WORD32 granule_length = MIN(128, pstr_enhanced_time_domain_dmx->frame_length);
  ------------------
  |  |   23|  91.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 91.2k, False: 0]
  |  |  ------------------
  ------------------
  139|       |
  140|  91.2k|  sample_idx = 0;
  141|  91.2k|  prev_energy_left = prev_energy_right = prev_energy = .5f;
  142|       |
  143|  1.55M|  do {
  144|  1.55M|    WORD32 offset = sample_idx;
  145|  1.55M|    FLOAT32 partial_left, partial_right, partial_out;
  146|  1.55M|    partial_left = partial_right = partial_out = 0.0;
  147|       |
  148|  1.55M|    WORD32 value = MIN(offset + granule_length, pstr_enhanced_time_domain_dmx->frame_length);
  ------------------
  |  |   23|  1.55M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 1.46M, False: 91.2k]
  |  |  ------------------
  ------------------
  149|   199M|    for (sample_idx = offset; sample_idx < value; sample_idx++) {
  ------------------
  |  Branch (149:31): [True: 198M, False: 1.55M]
  ------------------
  150|   198M|      FLOAT32 input_left = input_time[LEFT_CH][sample_idx];
  ------------------
  |  |   71|   198M|#define LEFT_CH (0)
  ------------------
  151|   198M|      FLOAT32 input_right = input_time[RIGHT_CH][sample_idx];
  ------------------
  |  |   72|   198M|#define RIGHT_CH (1)
  ------------------
  152|       |
  153|   198M|      partial_left += (FLOAT32)pow(input_left, 2);
  154|   198M|      partial_right += (FLOAT32)pow(input_right, 2);
  155|   198M|      partial_out += input_left * input_right;
  156|   198M|    }
  157|       |
  158|  1.55M|    prev_energy_left = prev_energy_left + partial_left;
  159|  1.55M|    prev_energy_right = prev_energy_right + partial_right;
  160|  1.55M|    prev_energy = prev_energy + partial_out;
  161|       |
  162|  1.55M|  } while (sample_idx < pstr_enhanced_time_domain_dmx->frame_length);
  ------------------
  |  Branch (162:12): [True: 1.46M, False: 91.2k]
  ------------------
  163|       |
  164|  91.2k|  energy_left = pstr_enhanced_time_domain_dmx->prev_left_energy + prev_energy_left;
  165|  91.2k|  energy_right = pstr_enhanced_time_domain_dmx->prev_right_energy + prev_energy_right;
  166|  91.2k|  energy_out = pstr_enhanced_time_domain_dmx->prev_x_energy + prev_energy;
  167|       |
  168|  91.2k|  lin_bb_cld = pstr_enhanced_time_domain_dmx->cld_weight * (energy_left / energy_right);
  169|  91.2k|  corr = energy_out * (1 / (FLOAT32)sqrt(energy_left * energy_right));
  170|       |
  171|  91.2k|  pstr_enhanced_time_domain_dmx->prev_left_energy = prev_energy_left;
  172|  91.2k|  pstr_enhanced_time_domain_dmx->prev_right_energy = prev_energy_right;
  173|  91.2k|  pstr_enhanced_time_domain_dmx->prev_x_energy = prev_energy;
  174|       |
  175|  91.2k|  lin_cld = (FLOAT32)sqrt(lin_bb_cld);
  176|  91.2k|  sqrt_lin_cld = (FLOAT32)sqrt(lin_cld);
  177|       |
  178|  91.2k|  ixheaace_mps_212_calculate_ratio(sqrt_lin_cld, lin_cld, corr, g);
  179|       |
  180|  91.2k|  ixheaace_mps_212_calculate_dmx_gains(lin_cld, lin_bb_cld, corr, g, h1);
  181|       |
  182|  91.2k|  h1[LEFT_CH] = h1[LEFT_CH] * pstr_enhanced_time_domain_dmx->gain_weight[LEFT_CH];
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
                h1[LEFT_CH] = h1[LEFT_CH] * pstr_enhanced_time_domain_dmx->gain_weight[LEFT_CH];
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
                h1[LEFT_CH] = h1[LEFT_CH] * pstr_enhanced_time_domain_dmx->gain_weight[LEFT_CH];
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
  183|  91.2k|  h1[RIGHT_CH] = h1[RIGHT_CH] * pstr_enhanced_time_domain_dmx->gain_weight[RIGHT_CH];
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
                h1[RIGHT_CH] = h1[RIGHT_CH] * pstr_enhanced_time_domain_dmx->gain_weight[RIGHT_CH];
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
                h1[RIGHT_CH] = h1[RIGHT_CH] * pstr_enhanced_time_domain_dmx->gain_weight[RIGHT_CH];
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
  184|       |
  185|  91.2k|  gain_left = pstr_enhanced_time_domain_dmx->prev_gain[LEFT_CH];
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
  186|  91.2k|  gain_right = pstr_enhanced_time_domain_dmx->prev_gain[RIGHT_CH];
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
  187|       |
  188|   198M|  for (sample_idx = 0; sample_idx < pstr_enhanced_time_domain_dmx->frame_length; sample_idx++) {
  ------------------
  |  Branch (188:24): [True: 198M, False: 91.2k]
  ------------------
  189|   198M|    WORD32 frame_length = pstr_enhanced_time_domain_dmx->frame_length;
  190|   198M|    FLOAT32 intermediate_gain_left, intermediate_gain_right, temp;
  191|       |
  192|   198M|    intermediate_gain_left =
  193|   198M|        ((pstr_enhanced_time_domain_dmx->sinus_window[sample_idx] * h1[LEFT_CH]) +
  ------------------
  |  |   71|   198M|#define LEFT_CH (0)
  ------------------
  194|   198M|         (pstr_enhanced_time_domain_dmx->sinus_window[frame_length - sample_idx] *
  195|   198M|          pstr_enhanced_time_domain_dmx->prev_h1[LEFT_CH]));
  ------------------
  |  |   71|   198M|#define LEFT_CH (0)
  ------------------
  196|       |
  197|   198M|    intermediate_gain_right =
  198|   198M|        ((pstr_enhanced_time_domain_dmx->sinus_window[sample_idx] * h1[RIGHT_CH]) +
  ------------------
  |  |   72|   198M|#define RIGHT_CH (1)
  ------------------
  199|   198M|         (pstr_enhanced_time_domain_dmx->sinus_window[frame_length - sample_idx] *
  200|   198M|          pstr_enhanced_time_domain_dmx->prev_h1[RIGHT_CH]));
  ------------------
  |  |   72|   198M|#define RIGHT_CH (1)
  ------------------
  201|       |
  202|   198M|    gain_left = intermediate_gain_left + ((1.f - ALPHA) * gain_left);
  ------------------
  |  |   56|   198M|#define ALPHA (0.0001f)
  ------------------
  203|   198M|    gain_right = intermediate_gain_right + ((1.f - ALPHA) * gain_right);
  ------------------
  |  |   56|   198M|#define ALPHA (0.0001f)
  ------------------
  204|   198M|    temp = (gain_left * (FLOAT32)input_time[LEFT_CH][sample_idx + input_delay]) +
  ------------------
  |  |   71|   198M|#define LEFT_CH (0)
  ------------------
  205|   198M|           (gain_right * (FLOAT32)input_time[RIGHT_CH][sample_idx + input_delay]);
  ------------------
  |  |   72|   198M|#define RIGHT_CH (1)
  ------------------
  206|   198M|    ptr_output_time_dmx[sample_idx] = (FLOAT32)temp;
  207|   198M|  }
  208|       |
  209|  91.2k|  pstr_enhanced_time_domain_dmx->prev_gain[LEFT_CH] = gain_left;
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
  210|  91.2k|  pstr_enhanced_time_domain_dmx->prev_gain[RIGHT_CH] = gain_right;
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
  211|  91.2k|  pstr_enhanced_time_domain_dmx->prev_h1[LEFT_CH] = h1[LEFT_CH];
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
                pstr_enhanced_time_domain_dmx->prev_h1[LEFT_CH] = h1[LEFT_CH];
  ------------------
  |  |   71|  91.2k|#define LEFT_CH (0)
  ------------------
  212|  91.2k|  pstr_enhanced_time_domain_dmx->prev_h1[RIGHT_CH] = h1[RIGHT_CH];
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
                pstr_enhanced_time_domain_dmx->prev_h1[RIGHT_CH] = h1[RIGHT_CH];
  ------------------
  |  |   72|  91.2k|#define RIGHT_CH (1)
  ------------------
  213|       |
  214|  91.2k|  return error;
  215|  91.2k|}
ixheaace_mps_dmx_tdom_enh.c:ixheaace_mps_212_calculate_ratio:
   38|  91.2k|                                             FLOAT32 g_m[2]) {
   39|  91.2k|  if (icc_m >= 0.f) {
  ------------------
  |  Branch (39:7): [True: 88.7k, False: 2.48k]
  ------------------
   40|  88.7k|    g_m[0] = g_m[1] = 1.0f;
   41|  88.7k|  } else {
   42|  2.48k|    FLOAT32 max_gain_factor = 2.0f;
   43|  2.48k|    FLOAT32 numerator, denominator;
   44|  2.48k|    FLOAT32 q = 0.0f;
   45|  2.48k|    numerator = (lin_cld_m + 0.5f) + (icc_m * sqrt_lin_cld_m);
   46|  2.48k|    denominator = (lin_cld_m + 0.5f) - (icc_m * sqrt_lin_cld_m);
   47|       |
   48|  2.48k|    if ((numerator > (0.f)) && (denominator > (0.f))) {
  ------------------
  |  Branch (48:9): [True: 2.48k, False: 0]
  |  Branch (48:32): [True: 2.48k, False: 0]
  ------------------
   49|  2.48k|      FLOAT32 intermediate;
   50|  2.48k|      intermediate = numerator / denominator;
   51|  2.48k|      intermediate = (FLOAT32)sqrt(intermediate);
   52|  2.48k|      intermediate = (FLOAT32)sqrt(intermediate);
   53|  2.48k|      q = (intermediate >= max_gain_factor) ? max_gain_factor : intermediate;
  ------------------
  |  Branch (53:11): [True: 0, False: 2.48k]
  ------------------
   54|  2.48k|    }
   55|       |
   56|  2.48k|    g_m[0] = max_gain_factor - q;
   57|  2.48k|    g_m[1] = q;
   58|  2.48k|  }
   59|  91.2k|}
ixheaace_mps_dmx_tdom_enh.c:ixheaace_mps_212_calculate_dmx_gains:
   63|  91.2k|                                                 const FLOAT32 g_m[2], FLOAT32 h_1_m[2]) {
   64|  91.2k|  const FLOAT32 max_gain_factor = 2.0f;
   65|  91.2k|  FLOAT32 energy_right, energy_left, cross_energy, inverse_weight_num, inverse_weight_den,
   66|  91.2k|      inverse_weight, inverse_weight_limited;
   67|  91.2k|  energy_right = lin_cld_2_m - 0.5f;
   68|  91.2k|  energy_right = (FLOAT32)sqrt(energy_right);
   69|  91.2k|  energy_left = lin_cld_m * energy_right;
   70|  91.2k|  cross_energy = (FLOAT32)sqrt(energy_left * energy_right);
   71|  91.2k|  inverse_weight_num = energy_right + energy_left;
   72|  91.2k|  inverse_weight_den = ((g_m[0] * g_m[0]) * energy_left) + ((g_m[1] * g_m[1]) * energy_right);
   73|       |
   74|  91.2k|  inverse_weight_den = ((((g_m[0] * g_m[1]) * cross_energy) * icc_m) * 2) + inverse_weight_den;
   75|       |
   76|  91.2k|  if (inverse_weight_den > (0.f)) {
  ------------------
  |  Branch (76:7): [True: 88.0k, False: 3.21k]
  ------------------
   77|  88.0k|    inverse_weight = inverse_weight_num / inverse_weight_den;
   78|       |
   79|  88.0k|    inverse_weight = (FLOAT32)sqrt(inverse_weight);
   80|       |
   81|  88.0k|    inverse_weight_limited =
   82|  88.0k|        (inverse_weight >= max_gain_factor) ? max_gain_factor : inverse_weight;
  ------------------
  |  Branch (82:9): [True: 9, False: 87.9k]
  ------------------
   83|  88.0k|  } else {
   84|  3.21k|    inverse_weight_limited = max_gain_factor;
   85|  3.21k|  }
   86|       |
   87|  91.2k|  h_1_m[1] = g_m[1] * inverse_weight_limited;
   88|  91.2k|  h_1_m[0] = g_m[0] * inverse_weight_limited;
   89|  91.2k|}

ixheaace_mps_212_open:
  882|  1.30k|                           ixheaace_mps_212_memory_struct *pstr_mps_memory) {
  883|       |  ixheaace_mps_pstr_struct pstr_mps_enc = NULL;
  884|  1.30k|  pstr_mps_enc = &pstr_mps_memory->mps_encoder_instance;
  885|  1.30k|  memset(pstr_mps_enc, 0, sizeof(ixheaace_mps_struct));
  886|  1.30k|  ixheaace_mps_open(&pstr_mps_enc->ptr_sac_encoder, pstr_mps_memory);
  887|  1.30k|  *pstr_handle_mps = pstr_mps_enc;
  888|  1.30k|}
ixheaace_mps_212_initialise:
  901|  1.30k|                                         const UWORD32 core_coder_delay, WORD8 *ptr_scratch) {
  902|  1.30k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.30k|#define IA_NO_ERROR 0x00000000
  ------------------
  903|  1.30k|  const UWORD32 fs_low = 27713;
  904|  1.30k|  const UWORD32 fs_high = 55426;
  905|  1.30k|  const UWORD32 no_inter_frame_coding = 0;
  906|  1.30k|  UWORD32 num_time_slots = 0, num_qmf_bands_ld = 0;
  907|  1.30k|  ixheaace_mps_pstr_struct pstr_mps_enc = (ixheaace_mps_pstr_struct)pstr_handle_mps;
  908|  1.30k|  switch (sbr_ratio) {
  909|      0|    case 1:
  ------------------
  |  Branch (909:5): [True: 0, False: 1.30k]
  ------------------
  910|      0|      if (!(sampling_rate < fs_low)) {
  ------------------
  |  Branch (910:11): [True: 0, False: 0]
  ------------------
  911|      0|        return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  912|      0|      }
  913|      0|      break;
  914|  1.18k|    case 2:
  ------------------
  |  Branch (914:5): [True: 1.18k, False: 127]
  ------------------
  915|  1.30k|    case 4:
  ------------------
  |  Branch (915:5): [True: 127, False: 1.18k]
  ------------------
  916|  1.30k|      if (!((sampling_rate >= fs_low) && (sampling_rate < fs_high))) {
  ------------------
  |  Branch (916:13): [True: 1.28k, False: 28]
  |  Branch (916:42): [True: 1.28k, False: 0]
  ------------------
  917|     28|        return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  918|     28|      }
  919|  1.28k|      break;
  920|  1.28k|    case 0:
  ------------------
  |  Branch (920:5): [True: 0, False: 1.30k]
  ------------------
  921|      0|    default:;
  ------------------
  |  Branch (921:5): [True: 0, False: 1.30k]
  ------------------
  922|  1.30k|  }
  923|       |
  924|  1.28k|  num_qmf_bands_ld = (sampling_rate < fs_low) ? 5 : ((sampling_rate > fs_high) ? 7 : 6);
  ------------------
  |  Branch (924:22): [True: 0, False: 1.28k]
  |  Branch (924:54): [True: 0, False: 1.28k]
  ------------------
  925|  1.28k|  num_time_slots = frame_length >> num_qmf_bands_ld;
  926|  1.28k|  *ptr_bitrate = ixheaace_mps_212_get_closest_bit_rate(audio_object_type, sampling_rate,
  927|  1.28k|                                                       sbr_ratio, *ptr_bitrate);
  928|       |
  929|  1.28k|  pstr_mps_enc->ptr_sac_encoder->user.b_ld_mode = ((no_inter_frame_coding == 1) ? 1 : 2);
  ------------------
  |  Branch (929:52): [Folded, False: 1.28k]
  ------------------
  930|  1.28k|  pstr_mps_enc->ptr_sac_encoder->user.sample_rate = sampling_rate;
  931|  1.28k|  pstr_mps_enc->ptr_sac_encoder->user.frame_time_slots = num_time_slots;
  932|  1.28k|  if (audio_object_type == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (932:7): [True: 151, False: 1.12k]
  ------------------
  933|    151|    pstr_mps_enc->ptr_sac_encoder->user.num_param_bands = IXHEAACE_MPS_SAC_BANDS_ld;
  ------------------
  |  |  133|    151|#define IXHEAACE_MPS_SAC_BANDS_ld (15)
  ------------------
  934|    151|    pstr_mps_enc->ptr_sac_encoder->user.independency_factor = 20;
  935|  1.12k|  } else {
  936|  1.12k|    pstr_mps_enc->ptr_sac_encoder->user.num_param_bands = IXHEAACE_MPS_SAC_BANDS_usac;
  ------------------
  |  |  134|  1.12k|#define IXHEAACE_MPS_SAC_BANDS_usac (28)
  ------------------
  937|  1.12k|    pstr_mps_enc->ptr_sac_encoder->user.independency_factor = 25;
  938|  1.12k|  }
  939|       |
  940|  1.28k|  pstr_mps_enc->ptr_sac_encoder->user.b_use_coarse_quant = 0;
  941|  1.28k|  pstr_mps_enc->ptr_sac_encoder->user.quant_mode = IXHEAACE_MPS_QUANTMODE_FINE;
  ------------------
  |  |  137|  1.28k|#define IXHEAACE_MPS_QUANTMODE_FINE (0)
  ------------------
  942|  1.28k|  pstr_mps_enc->ptr_sac_encoder->user.time_alignment = 0;
  943|  1.28k|  pstr_mps_enc->audio_object_type = audio_object_type;
  944|  1.28k|  error =
  945|  1.28k|      ixheaace_mps_212_init(pstr_mps_enc->ptr_sac_encoder, core_coder_delay, audio_object_type);
  946|  1.28k|  if (error) {
  ------------------
  |  Branch (946:7): [True: 0, False: 1.28k]
  ------------------
  947|      0|    return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  948|      0|  }
  949|       |
  950|  1.28k|  pstr_mps_enc->in_buf_desc.pp_base = (VOID **)&pstr_mps_enc->p_in_buffer;
  951|  1.28k|  pstr_mps_enc->in_buf_desc.p_buf_size = pstr_mps_enc->p_in_buffer_size;
  952|  1.28k|  pstr_mps_enc->in_buf_desc.p_ele_size = pstr_mps_enc->p_in_buffer_el_size;
  953|  1.28k|  pstr_mps_enc->in_buf_desc.p_buf_type = pstr_mps_enc->p_in_buffer_type;
  954|  1.28k|  pstr_mps_enc->in_buf_desc.num_bufs = 1;
  955|       |
  956|  1.28k|  pstr_mps_enc->out_buf_desc.pp_base = (VOID **)&pstr_mps_enc->p_out_buffer;
  957|  1.28k|  pstr_mps_enc->out_buf_desc.p_buf_size = pstr_mps_enc->p_out_buffer_size;
  958|  1.28k|  pstr_mps_enc->out_buf_desc.p_ele_size = pstr_mps_enc->p_out_buffer_el_size;
  959|  1.28k|  pstr_mps_enc->out_buf_desc.p_buf_type = pstr_mps_enc->p_out_buffer_type;
  960|  1.28k|  pstr_mps_enc->out_buf_desc.num_bufs = 2;
  961|       |
  962|  1.28k|  pstr_mps_enc->p_in_buffer[0] = NULL;
  963|  1.28k|  pstr_mps_enc->p_in_buffer_size[0] = 0;
  964|  1.28k|  pstr_mps_enc->p_in_buffer_el_size[0] = sizeof(FLOAT32);
  965|  1.28k|  pstr_mps_enc->p_in_buffer_type[0] = IXHEAACE_MPS_INPUT_BUFFER_IDX;
  ------------------
  |  |  142|  1.28k|#define IXHEAACE_MPS_INPUT_BUFFER_IDX (0)
  ------------------
  966|       |
  967|  1.28k|  pstr_mps_enc->p_out_buffer[0] = NULL;
  968|  1.28k|  pstr_mps_enc->p_out_buffer_size[0] = 0;
  969|  1.28k|  pstr_mps_enc->p_out_buffer_el_size[0] = sizeof(FLOAT32);
  970|  1.28k|  pstr_mps_enc->p_out_buffer_type[0] = IXHEAACE_MPS_OUTUT_BUFFER_IDX;
  ------------------
  |  |  143|  1.28k|#define IXHEAACE_MPS_OUTUT_BUFFER_IDX (0)
  ------------------
  971|       |
  972|  1.28k|  pstr_mps_enc->p_out_buffer[1] = NULL;
  973|  1.28k|  pstr_mps_enc->p_out_buffer_size[1] = 0;
  974|  1.28k|  pstr_mps_enc->p_out_buffer_el_size[1] = sizeof(UWORD8);
  975|  1.28k|  pstr_mps_enc->p_out_buffer_type[1] = IXHEAACE_MPS_BITSTREAM_BUFFER_IDX;
  ------------------
  |  |  144|  1.28k|#define IXHEAACE_MPS_BITSTREAM_BUFFER_IDX (1)
  ------------------
  976|       |
  977|  1.28k|  pstr_mps_enc->in_args.is_input_inter_leaved = 0;
  978|  1.28k|  pstr_mps_enc->in_args.input_buffer_size_per_channel = input_buffer_size_per_channel;
  979|       |
  980|  1.28k|  pstr_mps_enc->ptr_scratch = ptr_scratch;
  981|       |
  982|  1.28k|  return error;
  983|  1.28k|}
ixheaace_mps_212_process:
  987|  91.2k|                                      ixheaace_mps_enc_ext_payload *pstr_mps_ext_payload) {
  988|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  989|  91.2k|  ixheaace_mps_pstr_struct pstr_mps_enc = (ixheaace_mps_pstr_struct)pstr_handle_mps;
  990|  91.2k|  WORD32 aot = pstr_mps_enc->audio_object_type;
  991|  91.2k|  WORD32 sac_header_flag = 0;
  992|  91.2k|  WORD32 sac_out_buffer_offset = 0;
  993|       |
  994|  91.2k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  91.2k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (994:7): [True: 12.2k, False: 78.9k]
  ------------------
  995|  12.2k|    pstr_mps_enc->sac_out_buffer[0] = (sac_header_flag == 0) ? 0x3 : 0x7;
  ------------------
  |  Branch (995:39): [True: 12.2k, False: 0]
  ------------------
  996|  12.2k|    sac_out_buffer_offset += 1;
  997|  12.2k|  }
  998|       |
  999|  91.2k|  pstr_mps_enc->p_in_buffer[0] = (VOID *)ptr_audio_samples;
 1000|  91.2k|  pstr_mps_enc->in_args.num_input_samples = num_audio_samples;
 1001|       |
 1002|  91.2k|  pstr_mps_enc->p_out_buffer[0] = (VOID *)ptr_audio_samples;
 1003|  91.2k|  pstr_mps_enc->p_out_buffer_size[0] = sizeof(FLOAT32) * ((WORD32)num_audio_samples) / 2;
 1004|       |
 1005|  91.2k|  pstr_mps_enc->p_out_buffer[1] = (VOID *)&pstr_mps_enc->sac_out_buffer[sac_out_buffer_offset];
 1006|  91.2k|  pstr_mps_enc->p_out_buffer_size[1] =
 1007|  91.2k|      sizeof(pstr_mps_enc->sac_out_buffer) - sac_out_buffer_offset;
 1008|       |
 1009|  91.2k|  error = ixheaace_mps_212_encode(pstr_mps_enc->ptr_sac_encoder, &pstr_mps_enc->in_buf_desc,
 1010|  91.2k|                                  &pstr_mps_enc->out_buf_desc, &pstr_mps_enc->in_args,
 1011|  91.2k|                                  &pstr_mps_enc->out_args, aot, pstr_mps_enc->ptr_scratch);
 1012|  91.2k|  if (error) {
  ------------------
  |  Branch (1012:7): [True: 0, False: 91.2k]
  ------------------
 1013|      0|    return error;
 1014|      0|  }
 1015|       |
 1016|  91.2k|  pstr_mps_ext_payload->p_data = (UWORD8 *)pstr_mps_enc->sac_out_buffer;
 1017|  91.2k|  pstr_mps_ext_payload->data_size = pstr_mps_enc->out_args.num_output_bits;
 1018|  91.2k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  91.2k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1018:7): [True: 12.2k, False: 78.9k]
  ------------------
 1019|  12.2k|    pstr_mps_ext_payload->data_size += 8 * (sac_out_buffer_offset - 1);
 1020|  12.2k|  }
 1021|  91.2k|  pstr_mps_ext_payload->data_type = IXHEAACE_MPS_EXT_LDSAC_DATA;
  ------------------
  |  |  174|  91.2k|#define IXHEAACE_MPS_EXT_LDSAC_DATA (0x09)
  ------------------
 1022|  91.2k|  pstr_mps_ext_payload->associated_ch_element = -1;
 1023|       |
 1024|  91.2k|  return error;
 1025|  91.2k|}
ixheaace_mps_212_get_spatial_specific_config:
 1028|  1.28k|                                                    WORD32 buf_size, WORD32 aot) {
 1029|  1.28k|  ixheaace_bit_buf bit_buf;
 1030|  1.28k|  ixheaace_bit_buf_handle pstr_bit_buf =
 1031|  1.28k|      ia_enhaacplus_enc_create_bitbuffer(&bit_buf, (UWORD8 *)ptr_out_buffer, buf_size);
 1032|  1.28k|  ixheaace_mps_212_write_spatial_specific_config_data(pstr_handle_mps, pstr_bit_buf);
 1033|  1.28k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1033:7): [True: 151, False: 1.12k]
  ------------------
 1034|    151|    ixheaace_byte_align_buffer(pstr_bit_buf);
 1035|    151|  }
 1036|  1.28k|  return ia_enhaacplus_enc_get_bits_available(pstr_bit_buf);
 1037|  1.28k|}
ixheaace_mps_515_scratch_size:
 1039|    414|WORD32 ixheaace_mps_515_scratch_size(VOID) {
 1040|    414|  WORD32 size = 0;
 1041|    414|  size += ((MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) * sizeof(FLOAT32));
  ------------------
  |  |   25|    414|#define MAX_INPUT_CHANNELS (6)
  ------------------
                size += ((MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) * sizeof(FLOAT32));
  ------------------
  |  |   36|    414|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1042|    414|  size += ((MAX_OUTPUT_CHANNELS * MAX_BUFFER_SIZE) * sizeof(FLOAT32));
  ------------------
  |  |   26|    414|#define MAX_OUTPUT_CHANNELS (2)
  ------------------
                size += ((MAX_OUTPUT_CHANNELS * MAX_BUFFER_SIZE) * sizeof(FLOAT32));
  ------------------
  |  |   36|    414|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1043|    414|  size +=
 1044|    414|      (((MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE)) *
  ------------------
  |  |   25|    414|#define MAX_INPUT_CHANNELS (6)
  ------------------
                    (((MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE)) *
  ------------------
  |  |   36|    414|#define MAX_BUFFER_SIZE (2048)
  ------------------
                    (((MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE)) *
  ------------------
  |  |   36|    414|#define MAX_BUFFER_SIZE (2048)
  ------------------
                    (((MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE) + (2 * MAX_BUFFER_SIZE)) *
  ------------------
  |  |   36|    414|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1045|    414|       sizeof(FLOAT32));
 1046|    414|  size += (((6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   44|    414|#define MAX_TIME_SLOTS (64)
  ------------------
                size += (((6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   43|    414|#define NUM_QMF_BANDS (64)
  ------------------
                size += (((6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   44|    414|#define MAX_TIME_SLOTS (64)
  ------------------
                size += (((6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   43|    414|#define NUM_QMF_BANDS (64)
  ------------------
 1047|    414|            (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   44|    414|#define MAX_TIME_SLOTS (64)
  ------------------
                          (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   43|    414|#define NUM_QMF_BANDS (64)
  ------------------
                          (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   44|    414|#define MAX_TIME_SLOTS (64)
  ------------------
                          (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (6 * MAX_TIME_SLOTS * NUM_QMF_BANDS) +
  ------------------
  |  |   43|    414|#define NUM_QMF_BANDS (64)
  ------------------
 1048|    414|            (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS) + (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS)) *
  ------------------
  |  |   44|    414|#define MAX_TIME_SLOTS (64)
  ------------------
                          (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS) + (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS)) *
  ------------------
  |  |   23|    414|#define MAX_HYBRID_BANDS (71)
  ------------------
                          (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS) + (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS)) *
  ------------------
  |  |   44|    414|#define MAX_TIME_SLOTS (64)
  ------------------
                          (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS) + (6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS)) *
  ------------------
  |  |   23|    414|#define MAX_HYBRID_BANDS (71)
  ------------------
 1049|    414|           sizeof(FLOAT32));
 1050|    414|  size += (INPUT_LEN_DOWNSAMPLE * IXHEAACE_MAX_CH_IN_BS_ELE * UPSAMPLE_FAC * sizeof(FLOAT32));
  ------------------
  |  |   24|    414|#define INPUT_LEN_DOWNSAMPLE (2048)
  ------------------
                size += (INPUT_LEN_DOWNSAMPLE * IXHEAACE_MAX_CH_IN_BS_ELE * UPSAMPLE_FAC * sizeof(FLOAT32));
  ------------------
  |  |   22|    414|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                size += (INPUT_LEN_DOWNSAMPLE * IXHEAACE_MAX_CH_IN_BS_ELE * UPSAMPLE_FAC * sizeof(FLOAT32));
  ------------------
  |  |   25|    414|#define UPSAMPLE_FAC (3)
  ------------------
 1051|    414|  size += (INPUT_LEN_DOWNSAMPLE * IXHEAACE_MAX_CH_IN_BS_ELE * UPSAMPLE_FAC * sizeof(FLOAT32));
  ------------------
  |  |   24|    414|#define INPUT_LEN_DOWNSAMPLE (2048)
  ------------------
                size += (INPUT_LEN_DOWNSAMPLE * IXHEAACE_MAX_CH_IN_BS_ELE * UPSAMPLE_FAC * sizeof(FLOAT32));
  ------------------
  |  |   22|    414|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                size += (INPUT_LEN_DOWNSAMPLE * IXHEAACE_MAX_CH_IN_BS_ELE * UPSAMPLE_FAC * sizeof(FLOAT32));
  ------------------
  |  |   25|    414|#define UPSAMPLE_FAC (3)
  ------------------
 1052|    414|  size = IXHEAAC_GET_SIZE_ALIGNED(size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    414|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1053|    414|  return size;
 1054|    414|}
ixheaace_mps_515_open:
 1060|    402|                                   WORD32 flag_480) {
 1061|    402|  WORD32 i;
 1062|    402|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|    402|#define IA_NO_ERROR 0x00000000
  ------------------
 1063|    402|  ixheaace_mps_sac_specific_config *pstr_mps_specific_config;
 1064|    402|  ixheaace_mps_sac_pstr_enc pstr_mps_enc = &pstr_mps_memory->spatial_enc_instance;
 1065|       |
 1066|    402|  ixheaace_mps_sac_pstr_qmf_ana_filter_bank pstr_qmf_ana_bank = &pstr_mps_enc->qmf_fltbank;
 1067|    402|  ixheaace_mps_sac_pstr_qmf_synth_filter_bank pstr_qmf_synth_bank =
 1068|    402|      &pstr_mps_enc->qmf_synth_fltbank;
 1069|       |
 1070|    402|  memset(pstr_mps_enc, 0, sizeof(ixheaace_mps_sac_enc));
 1071|    402|  pstr_mps_enc->tree_config = tree_config;
 1072|    402|  switch (tree_config) {
  ------------------
  |  Branch (1072:11): [True: 402, False: 0]
  ------------------
 1073|    130|    case 5151:
  ------------------
  |  Branch (1073:5): [True: 130, False: 272]
  ------------------
 1074|    170|    case 5152:
  ------------------
  |  Branch (1074:5): [True: 40, False: 362]
  ------------------
 1075|    170|      pstr_mps_enc->output_channels = 1;
 1076|    170|      break;
 1077|    232|    case 525:
  ------------------
  |  Branch (1077:5): [True: 232, False: 170]
  ------------------
 1078|    232|      pstr_mps_enc->output_channels = 2;
 1079|    402|  }
 1080|    402|  if (flag_480) {
  ------------------
  |  Branch (1080:7): [True: 198, False: 204]
  ------------------
 1081|    198|    pstr_mps_enc->time_slots = 15;
 1082|    204|  } else {
 1083|    204|    pstr_mps_enc->time_slots = 16;
 1084|    204|  }
 1085|       |
 1086|    402|  pstr_mps_enc->frame_size = NUM_QMF_BANDS * pstr_mps_enc->time_slots;
  ------------------
  |  |   43|    402|#define NUM_QMF_BANDS (64)
  ------------------
 1087|       |
 1088|    402|  pstr_qmf_ana_bank->p_filter = ia_mps_enc_qmf_64_640;
 1089|       |
 1090|    402|  pstr_qmf_synth_bank->p_filter = ia_mps_enc_qmf_64_640;
 1091|    402|  pstr_qmf_synth_bank->alt_sin_twiddle = sbr_alt_sin_twiddle;
 1092|    402|  pstr_qmf_synth_bank->cos_twiddle = sbr_cos_twiddle;
 1093|    402|  pstr_qmf_synth_bank->sin_twiddle = sbr_sin_twiddle;
 1094|       |
 1095|  2.81k|  for (i = 0; i < 6; i++) {
  ------------------
  |  Branch (1095:15): [True: 2.41k, False: 402]
  ------------------
 1096|  2.41k|    memset(&pstr_mps_enc->filterbank[i], 0, sizeof(ixheaace_mps_sac_sbr_encoder_ana_filter_bank));
 1097|       |
 1098|  2.41k|    memset(&pstr_mps_enc->hyb_state[i], 0, sizeof(ixheaace_mps_hyb_filter_state));
 1099|  2.41k|  }
 1100|       |
 1101|    402|  pstr_mps_enc->bitstream_formatter = &pstr_mps_memory->bsf_memory_instance;
 1102|    402|  pstr_mps_specific_config = &pstr_mps_enc->bitstream_formatter->spatial_specific_config;
 1103|       |
 1104|    402|  memset(pstr_mps_specific_config, 0, sizeof(ixheaace_mps_sac_specific_config));
 1105|       |
 1106|    402|  pstr_mps_enc->bitstream_formatter->current_frame.bs_independency_flag_count = 0;
 1107|    402|  pstr_mps_specific_config->bs_sampling_frequency = sample_freq;
 1108|       |
 1109|    402|  switch (tree_config) {
  ------------------
  |  Branch (1109:11): [True: 402, False: 0]
  ------------------
 1110|    130|    case 5151:
  ------------------
  |  Branch (1110:5): [True: 130, False: 272]
  ------------------
 1111|    130|      pstr_mps_specific_config->bs_tree_config = IXHEAACE_MPS_TREE_5151;
  ------------------
  |  |  101|    130|#define IXHEAACE_MPS_TREE_5151 (0)
  ------------------
 1112|    130|      pstr_mps_specific_config->ott_config[4].bs_ott_bands = 2;
 1113|    130|      break;
 1114|       |
 1115|     40|    case 5152:
  ------------------
  |  Branch (1115:5): [True: 40, False: 362]
  ------------------
 1116|     40|      pstr_mps_specific_config->bs_tree_config = IXHEAACE_MPS_TREE_5152;
  ------------------
  |  |  102|     40|#define IXHEAACE_MPS_TREE_5152 (1)
  ------------------
 1117|     40|      pstr_mps_specific_config->ott_config[2].bs_ott_bands = 2;
 1118|     40|      break;
 1119|       |
 1120|    232|    case 525:
  ------------------
  |  Branch (1120:5): [True: 232, False: 170]
  ------------------
 1121|    232|      pstr_mps_specific_config->bs_tree_config = IXHEAACE_MPS_TREE_525;
  ------------------
  |  |  103|    232|#define IXHEAACE_MPS_TREE_525 (2)
  ------------------
 1122|    232|      pstr_mps_specific_config->ott_config[0].bs_ott_bands = 2;
 1123|    232|      pstr_mps_specific_config->ttt_config->bs_ttt_bands_low = PARAMETER_BANDS;
  ------------------
  |  |   27|    232|#define PARAMETER_BANDS (20)
  ------------------
 1124|    232|      pstr_mps_specific_config->ttt_config->bs_ttt_mode_low = 5;
 1125|    402|  }
 1126|       |
 1127|    402|  pstr_mps_specific_config->bs_frame_length = pstr_mps_enc->time_slots - 1;
 1128|    402|  pstr_mps_specific_config->bs_freq_res = 2;
 1129|       |
 1130|    402|  pstr_mps_specific_config->bs_fixed_gain_sur = 2;
 1131|    402|  pstr_mps_specific_config->bs_fixed_gain_lfe = 1;
 1132|    402|  pstr_mps_specific_config->bs_fixed_gain_dmx = 0;
 1133|       |
 1134|    402|  error = ixheaace_mps_515_write_spatial_specific_config(pstr_bitstream,
 1135|    402|                                                         pstr_mps_enc->bitstream_formatter);
 1136|       |
 1137|    402|  *ptr_bits_written = ia_enhaacplus_enc_get_bits_available(pstr_bitstream);
 1138|    402|  *pstr_handle_mps = pstr_mps_enc;
 1139|    402|  return error;
 1140|    402|}
ixheaace_mps_515_apply:
 1144|  21.9k|                                    ixheaace_bit_buf_handle pstr_bitstream, VOID *ptr_scratch) {
 1145|  21.9k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  21.9k|#define IA_NO_ERROR 0x00000000
  ------------------
 1146|  21.9k|  FLOAT32 *pstr_scratch = (FLOAT32 *)ptr_scratch;
 1147|       |
 1148|  21.9k|  FLOAT32 *in = (FLOAT32 *)pstr_scratch;
 1149|  21.9k|  memset(in, 0, sizeof(*in) * MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE);
  ------------------
  |  |   25|  21.9k|#define MAX_INPUT_CHANNELS (6)
  ------------------
                memset(in, 0, sizeof(*in) * MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE);
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1150|  21.9k|  pstr_scratch += MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE;
  ------------------
  |  |   25|  21.9k|#define MAX_INPUT_CHANNELS (6)
  ------------------
                pstr_scratch += MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE;
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1151|       |
 1152|  21.9k|  FLOAT32 *out = (FLOAT32 *)pstr_scratch;
 1153|  21.9k|  memset(out, 0, sizeof(*out) * 2 * MAX_BUFFER_SIZE);
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1154|  21.9k|  pstr_scratch += 2 * MAX_BUFFER_SIZE;
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1155|       |
 1156|  21.9k|  FLOAT32 *out1 = (FLOAT32 *)pstr_scratch;
 1157|  21.9k|  memset(out1, 0, sizeof(*out1) * 2 * MAX_BUFFER_SIZE);
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1158|  21.9k|  pstr_scratch += 2 * MAX_BUFFER_SIZE;
  ------------------
  |  |   36|  21.9k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1159|       |
 1160|  21.9k|  FLOAT32 *m_qmf_real = (FLOAT32 *)pstr_scratch;
 1161|  21.9k|  memset(m_qmf_real, 0, sizeof(*m_qmf_real) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                memset(m_qmf_real, 0, sizeof(*m_qmf_real) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1162|  21.9k|  pstr_scratch += 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS;
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                pstr_scratch += 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS;
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1163|       |
 1164|  21.9k|  FLOAT32 *m_qmf_imag = (FLOAT32 *)pstr_scratch;
 1165|  21.9k|  memset(m_qmf_imag, 0, sizeof(*m_qmf_imag) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                memset(m_qmf_imag, 0, sizeof(*m_qmf_imag) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1166|  21.9k|  pstr_scratch += 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS;
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                pstr_scratch += 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS;
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1167|       |
 1168|  21.9k|  FLOAT32 *m_hybrid_real = (FLOAT32 *)pstr_scratch;
 1169|  21.9k|  memset(m_hybrid_real, 0, sizeof(*m_hybrid_real) * 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                memset(m_hybrid_real, 0, sizeof(*m_hybrid_real) * 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   23|  21.9k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1170|  21.9k|  pstr_scratch += 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS;
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                pstr_scratch += 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS;
  ------------------
  |  |   23|  21.9k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1171|       |
 1172|  21.9k|  FLOAT32 *m_hybrid_imag = (FLOAT32 *)pstr_scratch;
 1173|  21.9k|  memset(m_hybrid_imag, 0, sizeof(*m_hybrid_imag) * 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                memset(m_hybrid_imag, 0, sizeof(*m_hybrid_imag) * 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   23|  21.9k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1174|  21.9k|  pstr_scratch += 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS;
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                pstr_scratch += 6 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS;
  ------------------
  |  |   23|  21.9k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1175|       |
 1176|  21.9k|  FLOAT32 *m_qmf_real_out = (FLOAT32 *)pstr_scratch;
 1177|  21.9k|  memset(m_qmf_real_out, 0, sizeof(*m_qmf_real_out) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                memset(m_qmf_real_out, 0, sizeof(*m_qmf_real_out) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1178|  21.9k|  pstr_scratch += 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS;
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                pstr_scratch += 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS;
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1179|       |
 1180|  21.9k|  FLOAT32 *m_qmf_imag_out = (FLOAT32 *)pstr_scratch;
 1181|  21.9k|  memset(m_qmf_imag_out, 0, sizeof(*m_qmf_imag_out) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   44|  21.9k|#define MAX_TIME_SLOTS (64)
  ------------------
                memset(m_qmf_imag_out, 0, sizeof(*m_qmf_imag_out) * 6 * MAX_TIME_SLOTS * NUM_QMF_BANDS);
  ------------------
  |  |   43|  21.9k|#define NUM_QMF_BANDS (64)
  ------------------
 1182|       |
 1183|  21.9k|  ixheaace_mps_sac_spatial_frame *pstr_frame_data;
 1184|  21.9k|  ixheaace_mps_sac_pstr_qmf_ana_filter_bank pstr_qmf_ana_bank = &pstr_mps_enc->qmf_fltbank;
 1185|  21.9k|  ixheaace_mps_sac_pstr_qmf_synth_filter_bank pstr_qmf_synth_bank =
 1186|  21.9k|      &pstr_mps_enc->qmf_synth_fltbank;
 1187|       |
 1188|  21.9k|  WORD32 i, j, k, l;
 1189|       |
 1190|  21.9k|  FLOAT32 p_pre_scale[6] = {1.f, 1.f, 1.f, 0.3162f, 0.7071f, 0.7071f};
 1191|  7.76M|  for (i = 0; i < DELAY_COMPENSATION; i++) {
  ------------------
  |  |  125|  7.76M|#define DELAY_COMPENSATION (352)
  ------------------
  |  Branch (1191:15): [True: 7.74M, False: 21.9k]
  ------------------
 1192|  54.1M|    for (j = 0; j < 6; j++) {
  ------------------
  |  Branch (1192:17): [True: 46.4M, False: 7.74M]
  ------------------
 1193|  46.4M|      pstr_mps_enc->in1[j][i] = pstr_mps_enc->in1[j][i + pstr_mps_enc->frame_size];
 1194|  46.4M|    }
 1195|  7.74M|  }
 1196|       |
 1197|  21.8M|  for (i = 0; i < pstr_mps_enc->frame_size; i++) {
  ------------------
  |  Branch (1197:15): [True: 21.8M, False: 21.9k]
  ------------------
 1198|   152M|    for (j = 0; j < 6; j++) {
  ------------------
  |  Branch (1198:17): [True: 130M, False: 21.8M]
  ------------------
 1199|   130M|      pstr_mps_enc->in1[j][i + DELAY_COMPENSATION] = ptr_audio_input[i * 6 + j] * p_pre_scale[j];
  ------------------
  |  |  125|   130M|#define DELAY_COMPENSATION (352)
  ------------------
 1200|   130M|    }
 1201|  21.8M|  }
 1202|       |
 1203|  21.8M|  for (i = 0; i < pstr_mps_enc->frame_size; i++) {
  ------------------
  |  Branch (1203:15): [True: 21.8M, False: 21.9k]
  ------------------
 1204|   152M|    for (j = 0; j < 6; j++) {
  ------------------
  |  Branch (1204:17): [True: 130M, False: 21.8M]
  ------------------
 1205|   130M|      in[j * MAX_BUFFER_SIZE + i] = ptr_audio_input[i * 6 + j] * p_pre_scale[j];
  ------------------
  |  |   36|   130M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1206|   130M|    }
 1207|  21.8M|  }
 1208|       |
 1209|  21.8M|  for (i = 0; i < pstr_mps_enc->frame_size; i++) {
  ------------------
  |  Branch (1209:15): [True: 21.8M, False: 21.9k]
  ------------------
 1210|  21.8M|    if (pstr_mps_enc->output_channels == 1)
  ------------------
  |  Branch (1210:9): [True: 7.77M, False: 14.0M]
  ------------------
 1211|  7.77M|      out1[i] = in[i] + in[MAX_BUFFER_SIZE + i] + in[2 * MAX_BUFFER_SIZE + i] +
  ------------------
  |  |   36|  7.77M|#define MAX_BUFFER_SIZE (2048)
  ------------------
                    out1[i] = in[i] + in[MAX_BUFFER_SIZE + i] + in[2 * MAX_BUFFER_SIZE + i] +
  ------------------
  |  |   36|  7.77M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1212|  7.77M|                in[3 * MAX_BUFFER_SIZE + i] + in[4 * MAX_BUFFER_SIZE + i] +
  ------------------
  |  |   36|  7.77M|#define MAX_BUFFER_SIZE (2048)
  ------------------
                              in[3 * MAX_BUFFER_SIZE + i] + in[4 * MAX_BUFFER_SIZE + i] +
  ------------------
  |  |   36|  7.77M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1213|  7.77M|                in[5 * MAX_BUFFER_SIZE + i];
  ------------------
  |  |   36|  7.77M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1214|  14.0M|    else {
 1215|  14.0M|      out1[i] = in[i] + 0.7071f * (in[2 * MAX_BUFFER_SIZE + i] + in[3 * MAX_BUFFER_SIZE + i]) +
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
                    out1[i] = in[i] + 0.7071f * (in[2 * MAX_BUFFER_SIZE + i] + in[3 * MAX_BUFFER_SIZE + i]) +
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1216|  14.0M|                in[4 * MAX_BUFFER_SIZE + i];
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1217|  14.0M|      out1[MAX_BUFFER_SIZE + i] =
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1218|  14.0M|          in[MAX_BUFFER_SIZE + i] +
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1219|  14.0M|          0.7071f * (in[2 * MAX_BUFFER_SIZE + i] + in[3 * MAX_BUFFER_SIZE + i]) +
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
                        0.7071f * (in[2 * MAX_BUFFER_SIZE + i] + in[3 * MAX_BUFFER_SIZE + i]) +
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1220|  14.0M|          in[5 * MAX_BUFFER_SIZE + i];
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1221|  14.0M|    }
 1222|  21.8M|  }
 1223|       |
 1224|  21.8M|  for (i = 0; i < pstr_mps_enc->frame_size; i++) {
  ------------------
  |  Branch (1224:15): [True: 21.8M, False: 21.9k]
  ------------------
 1225|   152M|    for (j = 0; j < 6; j++) {
  ------------------
  |  Branch (1225:17): [True: 130M, False: 21.8M]
  ------------------
 1226|   130M|      in[j * MAX_BUFFER_SIZE + i] = pstr_mps_enc->in1[j][i];
  ------------------
  |  |   36|   130M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1227|   130M|    }
 1228|  21.8M|  }
 1229|       |
 1230|   362k|  for (l = 0; l < pstr_mps_enc->time_slots; l++) {
  ------------------
  |  Branch (1230:15): [True: 340k, False: 21.9k]
  ------------------
 1231|  2.38M|    for (j = 0; j < 6; j++) {
  ------------------
  |  Branch (1231:17): [True: 2.04M, False: 340k]
  ------------------
 1232|  2.04M|      ixheaace_mps_515_calculate_ana_filterbank(
 1233|  2.04M|          &pstr_mps_enc->filterbank[j], in + (j * MAX_BUFFER_SIZE) + (l * 64),
  ------------------
  |  |   36|  2.04M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1234|  2.04M|          m_qmf_real + (j * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (l * NUM_QMF_BANDS),
  ------------------
  |  |   44|  2.04M|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_qmf_real + (j * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (l * NUM_QMF_BANDS),
  ------------------
  |  |   43|  2.04M|#define NUM_QMF_BANDS (64)
  ------------------
                        m_qmf_real + (j * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (l * NUM_QMF_BANDS),
  ------------------
  |  |   43|  2.04M|#define NUM_QMF_BANDS (64)
  ------------------
 1235|  2.04M|          m_qmf_imag + (j * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (l * NUM_QMF_BANDS),
  ------------------
  |  |   44|  2.04M|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_qmf_imag + (j * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (l * NUM_QMF_BANDS),
  ------------------
  |  |   43|  2.04M|#define NUM_QMF_BANDS (64)
  ------------------
                        m_qmf_imag + (j * MAX_TIME_SLOTS * NUM_QMF_BANDS) + (l * NUM_QMF_BANDS),
  ------------------
  |  |   43|  2.04M|#define NUM_QMF_BANDS (64)
  ------------------
 1236|  2.04M|          pstr_qmf_ana_bank);
 1237|  2.04M|    }
 1238|   340k|  }
 1239|       |
 1240|   153k|  for (k = 0; k < 6; k++) {
  ------------------
  |  Branch (1240:15): [True: 131k, False: 21.9k]
  ------------------
 1241|   131k|    ixheaace_mps_515_apply_ana_hyb_filterbank(
 1242|   131k|        &pstr_mps_enc->hyb_state[k], m_qmf_real + (k * MAX_TIME_SLOTS * NUM_QMF_BANDS),
  ------------------
  |  |   44|   131k|#define MAX_TIME_SLOTS (64)
  ------------------
                      &pstr_mps_enc->hyb_state[k], m_qmf_real + (k * MAX_TIME_SLOTS * NUM_QMF_BANDS),
  ------------------
  |  |   43|   131k|#define NUM_QMF_BANDS (64)
  ------------------
 1243|   131k|        m_qmf_imag + (k * MAX_TIME_SLOTS * NUM_QMF_BANDS), pstr_mps_enc->time_slots,
  ------------------
  |  |   44|   131k|#define MAX_TIME_SLOTS (64)
  ------------------
                      m_qmf_imag + (k * MAX_TIME_SLOTS * NUM_QMF_BANDS), pstr_mps_enc->time_slots,
  ------------------
  |  |   43|   131k|#define NUM_QMF_BANDS (64)
  ------------------
 1244|   131k|        m_hybrid_real + (k * MAX_TIME_SLOTS * MAX_HYBRID_BANDS),
  ------------------
  |  |   44|   131k|#define MAX_TIME_SLOTS (64)
  ------------------
                      m_hybrid_real + (k * MAX_TIME_SLOTS * MAX_HYBRID_BANDS),
  ------------------
  |  |   23|   131k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1245|   131k|        m_hybrid_imag + k * MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   44|   131k|#define MAX_TIME_SLOTS (64)
  ------------------
                      m_hybrid_imag + k * MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   23|   131k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1246|   131k|  }
 1247|       |
 1248|  21.9k|  pstr_frame_data = &pstr_mps_enc->bitstream_formatter->current_frame;
 1249|  21.9k|  switch (pstr_mps_enc->tree_config) {
  ------------------
  |  Branch (1249:11): [True: 21.9k, False: 0]
  ------------------
 1250|  5.69k|    case 5151:
  ------------------
  |  Branch (1250:5): [True: 5.69k, False: 16.2k]
  ------------------
 1251|  5.69k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1252|  5.69k|                               m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1253|  5.69k|                               m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1254|  5.69k|                               pstr_frame_data->ott_data.cld[3][0],
 1255|  5.69k|                               pstr_frame_data->ott_data.icc[3][0]);
 1256|  5.69k|      ixheaace_mps_515_ott_box(
 1257|  5.69k|          pstr_mps_enc->time_slots, m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        pstr_mps_enc->time_slots, m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1258|  5.69k|          m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1259|  5.69k|          m_hybrid_real + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_real + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1260|  5.69k|          m_hybrid_imag + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1261|  5.69k|          pstr_frame_data->ott_data.cld[2][0], pstr_frame_data->ott_data.icc[2][0]);
 1262|  5.69k|      ixheaace_mps_515_ott_box(
 1263|  5.69k|          pstr_mps_enc->time_slots, m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        pstr_mps_enc->time_slots, m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1264|  5.69k|          m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1265|  5.69k|          m_hybrid_real + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_real + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1266|  5.69k|          m_hybrid_imag + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1267|  5.69k|          pstr_frame_data->ott_data.cld[4][0], pstr_frame_data->ott_data.icc[4][0]);
 1268|  5.69k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1269|  5.69k|                               m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1270|  5.69k|                               m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1271|  5.69k|                               pstr_frame_data->ott_data.cld[1][0],
 1272|  5.69k|                               pstr_frame_data->ott_data.icc[1][0]);
 1273|  5.69k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1274|  5.69k|                               m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1275|  5.69k|                               m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  5.69k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  5.69k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1276|  5.69k|                               pstr_frame_data->ott_data.cld[0][0],
 1277|  5.69k|                               pstr_frame_data->ott_data.icc[0][0]);
 1278|       |
 1279|  5.69k|      break;
 1280|  2.17k|    case 5152:
  ------------------
  |  Branch (1280:5): [True: 2.17k, False: 19.8k]
  ------------------
 1281|  2.17k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1282|  2.17k|                               m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1283|  2.17k|                               m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1284|  2.17k|                               pstr_frame_data->ott_data.cld[3][0],
 1285|  2.17k|                               pstr_frame_data->ott_data.icc[3][0]);
 1286|  2.17k|      ixheaace_mps_515_ott_box(
 1287|  2.17k|          pstr_mps_enc->time_slots, m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        pstr_mps_enc->time_slots, m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1288|  2.17k|          m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1289|  2.17k|          m_hybrid_real + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_real + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1290|  2.17k|          m_hybrid_imag + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1291|  2.17k|          pstr_frame_data->ott_data.cld[4][0], pstr_frame_data->ott_data.icc[4][0]);
 1292|  2.17k|      ixheaace_mps_515_ott_box(
 1293|  2.17k|          pstr_mps_enc->time_slots, m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        pstr_mps_enc->time_slots, m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1294|  2.17k|          m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1295|  2.17k|          m_hybrid_real + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_real + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1296|  2.17k|          m_hybrid_imag + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1297|  2.17k|          pstr_frame_data->ott_data.cld[2][0], pstr_frame_data->ott_data.icc[2][0]);
 1298|  2.17k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1299|  2.17k|                               m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1300|  2.17k|                               m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1301|  2.17k|                               pstr_frame_data->ott_data.cld[1][0],
 1302|  2.17k|                               pstr_frame_data->ott_data.icc[1][0]);
 1303|  2.17k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1304|  2.17k|                               m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1305|  2.17k|                               m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  2.17k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  2.17k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1306|  2.17k|                               pstr_frame_data->ott_data.cld[0][0],
 1307|  2.17k|                               pstr_frame_data->ott_data.icc[0][0]);
 1308|  2.17k|      break;
 1309|  14.1k|    case 525:
  ------------------
  |  Branch (1309:5): [True: 14.1k, False: 7.87k]
  ------------------
 1310|  14.1k|      ixheaace_mps_515_ott_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1311|  14.1k|                               m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1312|  14.1k|                               m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + 4 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1313|  14.1k|                               pstr_frame_data->ott_data.cld[1][0],
 1314|  14.1k|                               pstr_frame_data->ott_data.icc[1][0]);
 1315|  14.1k|      ixheaace_mps_515_ott_box(
 1316|  14.1k|          pstr_mps_enc->time_slots, m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        pstr_mps_enc->time_slots, m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1317|  14.1k|          m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1318|  14.1k|          m_hybrid_real + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_real + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1319|  14.1k|          m_hybrid_imag + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 5 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1320|  14.1k|          pstr_frame_data->ott_data.cld[2][0], pstr_frame_data->ott_data.icc[2][0]);
 1321|  14.1k|      ixheaace_mps_515_ott_box(
 1322|  14.1k|          pstr_mps_enc->time_slots, m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        pstr_mps_enc->time_slots, m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1323|  14.1k|          m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1324|  14.1k|          m_hybrid_real + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_real + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1325|  14.1k|          m_hybrid_imag + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                        m_hybrid_imag + 3 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1326|  14.1k|          pstr_frame_data->ott_data.cld[0][0], pstr_frame_data->ott_data.icc[0][0]);
 1327|  14.1k|      ixheaace_mps_515_ttt_box(pstr_mps_enc->time_slots, m_hybrid_real, m_hybrid_imag,
 1328|  14.1k|                               m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1329|  14.1k|                               m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1330|  14.1k|                               m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_real + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1331|  14.1k|                               m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                             m_hybrid_imag + 2 * MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1332|  14.1k|                               pstr_frame_data->ttt_data.cpc_cld1[0][0],
 1333|  14.1k|                               pstr_frame_data->ttt_data.cpc_cld2[0][0]);
 1334|  21.9k|  }
 1335|       |
 1336|  21.9k|  pstr_frame_data->framing_info.bs_framing_type = 1;
 1337|  21.9k|  pstr_frame_data->framing_info.bs_num_param_sets = 1;
 1338|       |
 1339|  21.9k|  pstr_frame_data->framing_info.bs_param_slots[0] = 31;
 1340|  21.9k|  if (pstr_frame_data->bs_independency_flag_count == 0) {
  ------------------
  |  Branch (1340:7): [True: 2.44k, False: 19.5k]
  ------------------
 1341|  2.44k|    pstr_frame_data->bs_independency_flag = 1;
 1342|  2.44k|  }
 1343|  21.9k|  pstr_frame_data->bs_independency_flag_count =
 1344|  21.9k|      (pstr_frame_data->bs_independency_flag_count + 1) % 10;
 1345|       |
 1346|  21.9k|  error = ixheaace_mps_515_write_spatial_frame(pstr_bitstream, pstr_mps_enc->bitstream_formatter);
 1347|  21.9k|  if (error) {
  ------------------
  |  Branch (1347:7): [True: 0, False: 21.9k]
  ------------------
 1348|      0|    return error;
 1349|      0|  }
 1350|       |
 1351|  21.9k|  if (pstr_mps_enc->output_channels == 1) {
  ------------------
  |  Branch (1351:7): [True: 7.87k, False: 14.1k]
  ------------------
 1352|  7.87k|    ixheaace_mps_515_apply_syn_hyb_filterbank(
 1353|  7.87k|        m_hybrid_real, m_hybrid_imag, pstr_mps_enc->time_slots, m_qmf_real_out, m_qmf_imag_out);
 1354|       |
 1355|  7.87k|    ixheaace_mps_515_calculate_sbr_syn_filterbank(m_qmf_real_out, m_qmf_imag_out, out, 0,
 1356|  7.87k|                                                  pstr_qmf_synth_bank, pstr_mps_enc->time_slots,
 1357|  7.87k|                                                  pstr_mps_enc->sbr_qmf_states_synthesis);
 1358|       |
 1359|  7.78M|    for (j = 0; j < pstr_mps_enc->frame_size; j++) {
  ------------------
  |  Branch (1359:17): [True: 7.77M, False: 7.87k]
  ------------------
 1360|  7.77M|      ptr_audio_output[j] = out1[j];
 1361|  7.77M|    }
 1362|  14.1k|  } else {
 1363|  14.1k|    ixheaace_mps_515_apply_syn_hyb_filterbank(
 1364|  14.1k|        m_hybrid_real, m_hybrid_imag, pstr_mps_enc->time_slots, m_qmf_real_out, m_qmf_imag_out);
 1365|  14.1k|    ixheaace_mps_515_apply_syn_hyb_filterbank(m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                  ixheaace_mps_515_apply_syn_hyb_filterbank(m_hybrid_real + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1366|  14.1k|                                              m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                                            m_hybrid_imag + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1367|  14.1k|                                              pstr_mps_enc->time_slots,
 1368|  14.1k|                                              m_qmf_real_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                                            m_qmf_real_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1369|  14.1k|                                              m_qmf_imag_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                                                            m_qmf_imag_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS);
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1370|       |
 1371|  14.1k|    ixheaace_mps_515_calculate_sbr_syn_filterbank(m_qmf_real_out, m_qmf_imag_out, out, 0,
 1372|  14.1k|                                                  pstr_qmf_synth_bank, pstr_mps_enc->time_slots,
 1373|  14.1k|                                                  pstr_mps_enc->sbr_qmf_states_synthesis);
 1374|  14.1k|    ixheaace_mps_515_calculate_sbr_syn_filterbank(
 1375|  14.1k|        m_qmf_real_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                      m_qmf_real_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
 1376|  14.1k|        m_qmf_imag_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS, out + MAX_BUFFER_SIZE, 1,
  ------------------
  |  |   44|  14.1k|#define MAX_TIME_SLOTS (64)
  ------------------
                      m_qmf_imag_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS, out + MAX_BUFFER_SIZE, 1,
  ------------------
  |  |   23|  14.1k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      m_qmf_imag_out + MAX_TIME_SLOTS * MAX_HYBRID_BANDS, out + MAX_BUFFER_SIZE, 1,
  ------------------
  |  |   36|  14.1k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1377|  14.1k|        pstr_qmf_synth_bank, pstr_mps_enc->time_slots, pstr_mps_enc->sbr_qmf_states_synthesis);
 1378|       |
 1379|  14.0M|    for (j = 0; j < pstr_mps_enc->frame_size; j++) {
  ------------------
  |  Branch (1379:17): [True: 14.0M, False: 14.1k]
  ------------------
 1380|  14.0M|      ptr_audio_output[2 * j] = out1[j];
 1381|  14.0M|      ptr_audio_output[2 * j + 1] = out1[MAX_BUFFER_SIZE + j];
  ------------------
  |  |   36|  14.0M|#define MAX_BUFFER_SIZE (2048)
  ------------------
 1382|  14.0M|    }
 1383|  14.1k|  }
 1384|  21.9k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  21.9k|#define IA_NO_ERROR 0x00000000
  ------------------
 1385|  21.9k|}
ixheaace_mps_enc.c:ixheaace_mps_open:
  776|  1.30k|                              ixheaace_mps_212_memory_struct *pstr_mps_memory) {
  777|  1.30k|  WORD32 ch;
  778|  1.30k|  WORD32 param;
  779|  1.30k|  ixheaace_mps_pstr_space_structure pstr_space_enc = NULL;
  780|  1.30k|  pstr_space_enc = &pstr_mps_memory->mp4_space_encoder_instance;
  781|  1.30k|  if (NULL != pstr_space_enc) {
  ------------------
  |  Branch (781:7): [True: 1.30k, False: 0]
  ------------------
  782|  1.30k|    memset(pstr_space_enc, 0, sizeof(struct ixheaace_mps_space_structure));
  783|  1.30k|  }
  784|  1.30k|  pstr_space_enc->setup = &pstr_mps_memory->setup;
  785|  1.30k|  pstr_space_enc->setup->max_sampling_rate = MAX_SAMPLING_RATE;
  ------------------
  |  |   42|  1.30k|#define MAX_SAMPLING_RATE (48000)
  ------------------
  786|  1.30k|  pstr_space_enc->setup->max_frame_time_slots = MAX_FRAME_TIME_SLOT;
  ------------------
  |  |   48|  1.30k|#define MAX_FRAME_TIME_SLOT (128)
  ------------------
  787|  1.30k|  pstr_space_enc->setup->max_analysis_length_time_slots =
  788|  1.30k|      3 * pstr_space_enc->setup->max_frame_time_slots;
  789|  1.30k|  pstr_space_enc->setup->max_qmf_bands =
  790|  1.30k|      ixheaace_mps_212_space_get_num_qmf_bands(pstr_space_enc->setup->max_sampling_rate);
  791|  1.30k|  pstr_space_enc->setup->max_hybrid_bands = pstr_space_enc->setup->max_qmf_bands;
  792|  1.30k|  pstr_space_enc->setup->max_frame_length =
  793|  1.30k|      pstr_space_enc->setup->max_qmf_bands * pstr_space_enc->setup->max_frame_time_slots;
  794|  1.30k|  pstr_space_enc->setup->max_ch_in = 2;
  795|  1.30k|  pstr_space_enc->setup->max_ch_out = 1;
  796|  1.30k|  pstr_space_enc->setup->max_ch_tot_out = pstr_space_enc->setup->max_ch_out;
  797|  1.30k|  pstr_space_enc->setup->b_enc_mode_212 = 1;
  798|  1.30k|  pstr_space_enc->setup->max_hybrid_in_static_slots = 24;
  799|       |
  800|  1.30k|  pstr_space_enc->pstr_static_gain_config = &pstr_mps_memory->static_gain_config;
  801|  1.30k|  pstr_space_enc->pstr_enhanced_time_dmx = &pstr_mps_memory->enhanced_time_dmx;
  802|  1.30k|  pstr_space_enc->pstr_enhanced_time_dmx->sinus_window = pstr_mps_memory->sinus_window_flt;
  803|  1.30k|  pstr_space_enc->ptr_parameter_band_2_hybrid_band_offset =
  804|  1.30k|      pstr_mps_memory->parameter_band_2_hybrid_band_offset;
  805|  1.30k|  ixheaace_mps_212_space_tree_open(&pstr_space_enc->pstr_space_tree, pstr_mps_memory);
  806|  1.30k|  pstr_space_enc->pstr_qmf_filter_in = pstr_mps_memory->pstr_qmf_filter_bank;
  807|  3.92k|  for (ch = 0; ch < pstr_space_enc->setup->max_ch_in; ch++) {
  ------------------
  |  Branch (807:16): [True: 2.61k, False: 1.30k]
  ------------------
  808|  2.61k|    pstr_space_enc->pstr_qmf_filter_in[ch] = &pstr_mps_memory->qmf_filter_bank[ch];
  809|  2.61k|    pstr_space_enc->pstr_qmf_filter_in[ch]->ptr_filter_states =
  810|  2.61k|        &pstr_mps_memory->ptr_filter_states[ch];
  811|  2.61k|    pstr_space_enc->pstr_dc_filter[ch] = &pstr_mps_memory->dc_filter[ch];
  812|  2.61k|    pstr_space_enc->pstr_onset_detect[ch] = &pstr_mps_memory->onset_detect[ch];
  813|  2.61k|    pstr_space_enc->pstr_onset_detect[ch]->p_energy_hist =
  814|  2.61k|        &pstr_mps_memory->energy_hist_float[ch][0];
  815|  2.61k|  }
  816|  1.30k|  pstr_space_enc->h_frame_window = &pstr_mps_memory->frame_window;
  817|  1.30k|  pstr_space_enc->pstr_static_gain = &pstr_mps_memory->static_gain;
  818|  1.30k|  pstr_space_enc->pstr_bitstream_formatter = &pstr_mps_memory->bitstream;
  819|  1.30k|  pstr_space_enc->ssc_buf.ptr_ssc = pstr_mps_memory->ssc;
  820|  1.30k|  pstr_space_enc->pstr_delay = &pstr_mps_memory->delay;
  821|  1.30k|  pstr_space_enc->pn_output_bits = pstr_mps_memory->n_output_bits;
  822|  10.4k|  for (param = 0; param < MAX_NUM_PARAMS; param++) {
  ------------------
  |  |   42|  10.4k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (822:19): [True: 9.15k, False: 1.30k]
  ------------------
  823|  9.15k|    pstr_space_enc->ptr_frame_window_ana[param] =
  824|  9.15k|        &pstr_mps_memory->frame_window_ana_flt[param][0];
  825|  9.15k|  }
  826|  1.30k|  pstr_space_enc->pstr_enhanced_time_dmx->max_frame_length =
  827|  1.30k|      pstr_space_enc->setup->max_frame_length;
  828|  3.92k|  for (ch = 0; ch < pstr_space_enc->setup->max_ch_in; ch++) {
  ------------------
  |  Branch (828:16): [True: 2.61k, False: 1.30k]
  ------------------
  829|  2.61k|    pstr_space_enc->pstr_onset_detect[ch]->max_time_slots =
  830|  2.61k|        pstr_space_enc->setup->max_frame_time_slots;
  831|  2.61k|    pstr_space_enc->pstr_onset_detect[ch]->min_trans_dist = 8;
  832|  2.61k|    pstr_space_enc->pstr_onset_detect[ch]->avg_energy_dist = 16;
  833|  2.61k|    pstr_space_enc->pstr_onset_detect[ch]->avg_energy_dist_scale = 4;
  834|  2.61k|  }
  835|  1.30k|  pstr_space_enc->pstr_static_gain_config->fixed_gain_dmx = IXHEAACE_MPS_DMX_GAIN_DEFAULT;
  ------------------
  |  |  131|  1.30k|#define IXHEAACE_MPS_DMX_GAIN_DEFAULT (2)
  ------------------
  836|  1.30k|  pstr_space_enc->pstr_static_gain_config->pre_gain_factor_db = 0;
  837|       |
  838|  1.30k|  if (NULL != pstr_space_enc_structure) {
  ------------------
  |  Branch (838:7): [True: 1.30k, False: 0]
  ------------------
  839|  1.30k|    *pstr_space_enc_structure = pstr_space_enc;
  840|  1.30k|  }
  841|  1.30k|}
ixheaace_mps_enc.c:ixheaace_mps_212_space_get_num_qmf_bands:
   65|  2.58k|static UWORD8 ixheaace_mps_212_space_get_num_qmf_bands(const UWORD32 num_sample_rate) {
   66|  2.58k|  UWORD8 num_qmf_bands = 0;
   67|  2.58k|  if (num_sample_rate < 27713)
  ------------------
  |  Branch (67:7): [True: 0, False: 2.58k]
  ------------------
   68|      0|    num_qmf_bands = 32;
   69|  2.58k|  else if (num_sample_rate < 55426)
  ------------------
  |  Branch (69:12): [True: 2.58k, False: 0]
  ------------------
   70|  2.58k|    num_qmf_bands = 64;
   71|       |
   72|  2.58k|  return num_qmf_bands;
   73|  2.58k|}
ixheaace_mps_enc.c:ixheaace_mps_212_space_tree_open:
   76|  1.30k|                                             ixheaace_mps_212_memory_struct *pstr_mps_memory) {
   77|  1.30k|  ixheaace_mps_pstr_space_tree pstr_space_tree = NULL;
   78|  1.30k|  WORD32 box;
   79|       |
   80|  1.30k|  pstr_space_tree = &pstr_mps_memory->spacce_tree;
   81|       |
   82|  2.61k|  for (box = 0; box < IXHEAACE_MPS_MAX_NUM_BOXES; box++) {
  ------------------
  |  |   50|  2.61k|#define IXHEAACE_MPS_MAX_NUM_BOXES (1)
  ------------------
  |  Branch (82:17): [True: 1.30k, False: 1.30k]
  ------------------
   83|  1.30k|    ixheaace_mps_pstr_tto_box pstr_tto_box = NULL;
   84|  1.30k|    pstr_tto_box = &pstr_mps_memory->tto_box;
   85|       |
   86|  1.30k|    if (NULL != pstr_space_tree) {
  ------------------
  |  Branch (86:9): [True: 1.30k, False: 0]
  ------------------
   87|  1.30k|      pstr_space_tree->pstr_tto_box[box] = pstr_tto_box;
   88|  1.30k|    }
   89|  1.30k|  }
   90|  1.30k|  *pstr_ph_space_tree = pstr_space_tree;
   91|  1.30k|}
ixheaace_mps_enc.c:ixheaace_mps_212_get_closest_bit_rate:
  845|  1.28k|                                                    const UWORD32 sbr_ratio, UWORD32 bitrate) {
  846|  1.28k|  UWORD32 idx;
  847|  1.28k|  WORD32 target_bitrate = -1;
  848|       |
  849|  28.1k|  for (idx = 0; idx < sizeof(mps_config_tab) / sizeof(ixheaace_mps_config_table); idx++) {
  ------------------
  |  Branch (849:17): [True: 26.8k, False: 1.28k]
  ------------------
  850|  26.8k|    if ((mps_config_tab[idx].sampling_rate == sampling_rate) &&
  ------------------
  |  Branch (850:9): [True: 6.40k, False: 20.4k]
  ------------------
  851|  6.40k|        (mps_config_tab[idx].audio_object_type == audio_object_type) &&
  ------------------
  |  Branch (851:9): [True: 2.71k, False: 3.68k]
  ------------------
  852|  2.71k|        (mps_config_tab[idx].sbr_ratio == sbr_ratio)) {
  ------------------
  |  Branch (852:9): [True: 1.28k, False: 1.43k]
  ------------------
  853|  1.28k|      target_bitrate =
  854|  1.28k|          MIN(MAX(bitrate, mps_config_tab[idx].bitrate_min), mps_config_tab[idx].bitrate_max);
  ------------------
  |  |   23|  2.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 112, False: 1.16k]
  |  |  |  Branch (23:21): [True: 1.17k, False: 108]
  |  |  |  Branch (23:33): [True: 4, False: 108]
  |  |  ------------------
  ------------------
  855|  1.28k|    }
  856|  26.8k|  }
  857|       |
  858|  1.28k|  return target_bitrate;
  859|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_init:
  648|  1.28k|                                          const WORD32 dmx_delay, WORD32 aot) {
  649|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  650|  1.28k|  WORD32 ch;
  651|  1.28k|  WORD32 num_ch_in_arb_dmx;
  652|  1.28k|  ixheaace_mps_space_tree_description space_tree_description;
  653|  1.28k|  ixheaace_mps_onset_detect_config onset_detect_config;
  654|  1.28k|  ixheaace_mps_frame_win_config frame_window_config;
  655|       |
  656|  1.28k|  error = ixheaace_mps_212_configure(pstr_space_enc, &pstr_space_enc->user);
  657|  1.28k|  if (error) {
  ------------------
  |  Branch (657:7): [True: 0, False: 1.28k]
  ------------------
  658|      0|    return error;
  659|      0|  }
  660|  1.28k|  pstr_space_enc->b_enc_mode_212_only = pstr_space_enc->setup->b_enc_mode_212;
  661|       |
  662|  1.28k|  if (pstr_space_enc->num_frame_time_slots < 1) {
  ------------------
  |  Branch (662:7): [True: 0, False: 1.28k]
  ------------------
  663|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  664|      0|  }
  665|  1.28k|  pstr_space_enc->n_frame_length =
  666|  1.28k|      pstr_space_enc->num_qmf_bands * pstr_space_enc->num_frame_time_slots;
  667|       |
  668|  1.28k|  if (pstr_space_enc->use_frame_keep == 1) {
  ------------------
  |  Branch (668:7): [True: 1.28k, False: 0]
  ------------------
  669|  1.28k|    pstr_space_enc->num_analysis_length_time_slots = 3 * pstr_space_enc->num_frame_time_slots;
  670|  1.28k|    pstr_space_enc->n_update_hybrid_position_time_slots = pstr_space_enc->num_frame_time_slots;
  671|  1.28k|  } else {
  672|      0|    pstr_space_enc->num_analysis_length_time_slots = 2 * pstr_space_enc->num_frame_time_slots;
  673|      0|    pstr_space_enc->n_update_hybrid_position_time_slots = 0;
  674|      0|  }
  675|       |
  676|  1.28k|  pstr_space_enc->n_analysis_lookahead_time_slots =
  677|  1.28k|      pstr_space_enc->num_analysis_length_time_slots -
  678|  1.28k|      3 * pstr_space_enc->num_frame_time_slots / 2;
  679|       |
  680|  1.28k|  ixheaace_mps_212_calc_parameter_band_to_hybrid_band_offset(
  681|  1.28k|      pstr_space_enc->num_hybrid_bands, pstr_space_enc->ptr_parameter_band_2_hybrid_band_offset,
  682|  1.28k|      aot);
  683|       |
  684|  1.28k|  error =
  685|  1.28k|      ixheaace_mps_212_fill_space_tree_setup(pstr_space_enc, &pstr_space_enc->space_tree_setup);
  686|  1.28k|  if (error) {
  ------------------
  |  Branch (686:7): [True: 0, False: 1.28k]
  ------------------
  687|      0|    return error;
  688|      0|  }
  689|  1.28k|  error = ixheaace_mps_212_space_tree_init(
  690|  1.28k|      pstr_space_enc->pstr_space_tree, &pstr_space_enc->space_tree_setup,
  691|  1.28k|      pstr_space_enc->ptr_parameter_band_2_hybrid_band_offset, pstr_space_enc->use_frame_keep,
  692|  1.28k|      aot);
  693|  1.28k|  if (error) {
  ------------------
  |  Branch (693:7): [True: 0, False: 1.28k]
  ------------------
  694|      0|    return error;
  695|      0|  }
  696|       |
  697|  1.28k|  space_tree_description = pstr_space_enc->pstr_space_tree->descr;
  698|  1.28k|  pstr_space_enc->n_input_channels = space_tree_description.num_out_channels;
  699|  1.28k|  pstr_space_enc->n_output_channels = space_tree_description.num_in_channels;
  700|  1.28k|  frame_window_config.num_time_slots_max = pstr_space_enc->num_frame_time_slots;
  701|  1.28k|  frame_window_config.frame_keep_flag = pstr_space_enc->use_frame_keep;
  702|  1.28k|  onset_detect_config.max_time_slots = pstr_space_enc->num_frame_time_slots;
  703|  1.28k|  onset_detect_config.lower_bound_onset_detection =
  704|  1.28k|      ((2 * 1725 * pstr_space_enc->num_qmf_bands) / pstr_space_enc->num_sample_rate);
  705|  1.28k|  onset_detect_config.upper_bound_onset_detection = pstr_space_enc->num_hybrid_bands;
  706|  1.28k|  num_ch_in_arb_dmx = 0;
  707|       |
  708|  3.84k|  for (ch = 0; ch < pstr_space_enc->n_input_channels; ch++) {
  ------------------
  |  Branch (708:16): [True: 2.56k, False: 1.28k]
  ------------------
  709|  2.56k|    ixheaace_mps_212_qmf_init_filter_bank(
  710|  2.56k|        pstr_space_enc->pstr_qmf_filter_in[ch],
  711|  2.56k|        pstr_space_enc->pstr_qmf_filter_in[ch]->ptr_filter_states, 1,
  712|  2.56k|        pstr_space_enc->num_qmf_bands, pstr_space_enc->num_qmf_bands,
  713|  2.56k|        pstr_space_enc->num_qmf_bands);
  714|  2.56k|    if (error) {
  ------------------
  |  Branch (714:9): [True: 0, False: 2.56k]
  ------------------
  715|      0|      return error;
  716|      0|    }
  717|  2.56k|    ixheaace_mps_212_init_dc_filter(pstr_space_enc->pstr_dc_filter[ch],
  718|  2.56k|                                    pstr_space_enc->num_sample_rate);
  719|  2.56k|    error = ixheaace_mps_212_onset_detect_init(pstr_space_enc->pstr_onset_detect[ch],
  720|  2.56k|                                               &onset_detect_config, 1);
  721|  2.56k|    if (error) {
  ------------------
  |  Branch (721:9): [True: 0, False: 2.56k]
  ------------------
  722|      0|      return error;
  723|      0|    }
  724|  2.56k|  }
  725|       |
  726|  1.28k|  error =
  727|  1.28k|      ixheaace_mps_212_frame_window_init(pstr_space_enc->h_frame_window, &frame_window_config);
  728|  1.28k|  if (error) {
  ------------------
  |  Branch (728:7): [True: 0, False: 1.28k]
  ------------------
  729|      0|    return error;
  730|      0|  }
  731|       |
  732|  1.28k|  error = ixheaace_mps_212_static_gain_init(pstr_space_enc->pstr_static_gain,
  733|  1.28k|                                            pstr_space_enc->pstr_static_gain_config);
  734|  1.28k|  if (error) {
  ------------------
  |  Branch (734:7): [True: 0, False: 1.28k]
  ------------------
  735|      0|    return error;
  736|      0|  }
  737|       |
  738|  1.28k|  error = ixheaace_mps_212_init_enhanced_time_domain_dmx(
  739|  1.28k|      pstr_space_enc->pstr_enhanced_time_dmx, pstr_space_enc->pstr_static_gain->pre_gain,
  740|  1.28k|      pstr_space_enc->pstr_static_gain->post_gain, pstr_space_enc->n_frame_length);
  741|  1.28k|  if (error) {
  ------------------
  |  Branch (741:7): [True: 0, False: 1.28k]
  ------------------
  742|      0|    return error;
  743|      0|  }
  744|       |
  745|  1.28k|  memset(pstr_space_enc->pstr_bitstream_formatter, 0, sizeof(ixheaace_mps_spatial_frame));
  746|  1.28k|  pstr_space_enc->pstr_bitstream_formatter->frame.bs_independency_flag = 1;
  747|  1.28k|  pstr_space_enc->pstr_bitstream_formatter->frame.framing_info.num_param_sets = 1;
  748|       |
  749|  1.28k|  error = ixheaace_mps_212_fill_spatial_specific_config(
  750|  1.28k|      pstr_space_enc, &pstr_space_enc->pstr_bitstream_formatter->spatial_specific_config);
  751|  1.28k|  if (error) {
  ------------------
  |  Branch (751:7): [True: 0, False: 1.28k]
  ------------------
  752|      0|    return error;
  753|      0|  }
  754|       |
  755|  1.28k|  error = ixheaace_mps_212_write_spatial_specific_config(
  756|  1.28k|      &pstr_space_enc->pstr_bitstream_formatter->spatial_specific_config,
  757|  1.28k|      pstr_space_enc->ssc_buf.ptr_ssc, MAX_SSC_BYTES, &pstr_space_enc->ssc_buf.num_ssc_size_bits,
  ------------------
  |  |  154|  1.28k|#define MAX_SSC_BYTES (1 << 6)
  ------------------
  758|  1.28k|      aot);
  759|  1.28k|  if (error) {
  ------------------
  |  Branch (759:7): [True: 0, False: 1.28k]
  ------------------
  760|      0|    return error;
  761|      0|  }
  762|       |
  763|  1.28k|  error = ixheaace_mps_212_init_delay_compensation(pstr_space_enc, dmx_delay, aot);
  764|  1.28k|  if (error) {
  ------------------
  |  Branch (764:7): [True: 0, False: 1.28k]
  ------------------
  765|      0|    return error;
  766|      0|  }
  767|       |
  768|  1.28k|  pstr_space_enc->n_samples_next =
  769|  1.28k|      pstr_space_enc->n_frame_length * (pstr_space_enc->n_input_channels + num_ch_in_arb_dmx);
  770|  1.28k|  pstr_space_enc->n_samples_valid = 0;
  771|       |
  772|  1.28k|  return error;
  773|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_configure:
  109|  1.28k|    const ixheaace_mps_pstr_spece_enc_setup pstr_h_set_up) {
  110|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  111|       |
  112|  1.28k|  pstr_space_enc->num_sample_rate = pstr_h_set_up->sample_rate;
  113|  1.28k|  pstr_space_enc->num_qmf_bands =
  114|  1.28k|      ixheaace_mps_212_space_get_num_qmf_bands(pstr_space_enc->num_sample_rate);
  115|  1.28k|  pstr_space_enc->time_alignment = pstr_h_set_up->time_alignment;
  116|  1.28k|  pstr_space_enc->quant_mode = pstr_h_set_up->quant_mode;
  117|       |
  118|  1.28k|  pstr_space_enc->use_coarse_quant_cld = pstr_h_set_up->b_use_coarse_quant;
  119|  1.28k|  pstr_space_enc->use_coarse_quant_cpc = pstr_h_set_up->b_use_coarse_quant;
  120|  1.28k|  pstr_space_enc->use_frame_keep = (pstr_h_set_up->b_ld_mode == 2);
  121|  1.28k|  pstr_space_enc->use_coarse_quant_icc = 0;
  122|  1.28k|  pstr_space_enc->use_coarse_quant_arb_dmx = 0;
  123|  1.28k|  pstr_space_enc->independency_factor = pstr_h_set_up->independency_factor;
  124|  1.28k|  pstr_space_enc->independency_count = 0;
  125|  1.28k|  pstr_space_enc->independency_flag = 1;
  126|       |
  127|  1.28k|  pstr_space_enc->num_hybrid_bands = pstr_space_enc->num_qmf_bands;
  128|  1.28k|  pstr_space_enc->num_frame_time_slots = pstr_h_set_up->frame_time_slots;
  129|  1.28k|  ixheaace_mps_212_init_num_param_bands(pstr_space_enc, pstr_h_set_up->num_param_bands);
  130|       |
  131|  1.28k|  return error;
  132|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_init_num_param_bands:
   94|  1.28k|    ixheaace_mps_pstr_space_structure pstr_space_enc, const WORD32 num_param_bands) {
   95|  1.28k|  WORD32 k = 0;
   96|  1.28k|  const WORD32 n = sizeof(valid_bands_ld) / sizeof(UWORD8);
   97|  1.28k|  const UWORD8 *p_bands = valid_bands_ld;
   98|       |
   99|  11.0k|  while (k < n && p_bands[k] != (UWORD8)num_param_bands) ++k;
  ------------------
  |  Branch (99:10): [True: 11.0k, False: 0]
  |  Branch (99:19): [True: 9.78k, False: 1.28k]
  ------------------
  100|  1.28k|  if (k == n) {
  ------------------
  |  Branch (100:7): [True: 0, False: 1.28k]
  ------------------
  101|      0|    pstr_space_enc->num_param_bands = IXHEAACE_MPS_SAC_BANDS_INVALID;
  ------------------
  |  |  132|      0|#define IXHEAACE_MPS_SAC_BANDS_INVALID (0)
  ------------------
  102|  1.28k|  } else {
  103|  1.28k|    pstr_space_enc->num_param_bands = num_param_bands;
  104|  1.28k|  }
  105|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_fill_space_tree_setup:
  323|  1.28k|    ixheaace_mps_space_tree_setup *const ptr_space_tree_setup) {
  324|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  325|       |
  326|  1.28k|  ptr_space_tree_setup->num_param_bands = pstr_space_enc->num_param_bands;
  327|  1.28k|  ptr_space_tree_setup->use_coarse_quant_tto_cld_flag = pstr_space_enc->use_coarse_quant_cld;
  328|  1.28k|  ptr_space_tree_setup->use_coarse_quant_tto_icc_flag = pstr_space_enc->use_coarse_quant_icc;
  329|  1.28k|  ptr_space_tree_setup->quant_mode = pstr_space_enc->quant_mode;
  330|  1.28k|  ptr_space_tree_setup->num_hybrid_bands_max = pstr_space_enc->num_hybrid_bands;
  331|  1.28k|  ptr_space_tree_setup->num_channels_in_max = 2;
  332|  1.28k|  return error;
  333|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_fill_spatial_specific_config:
  291|  1.28k|    ixheaace_mps_spatial_specific_config *const pstr_h_ssc) {
  292|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  293|       |
  294|  1.28k|  ixheaace_mps_space_tree_description space_tree_description;
  295|  1.28k|  WORD32 i;
  296|  1.28k|  space_tree_description = pstr_space_enc->pstr_space_tree->descr;
  297|  1.28k|  memset(pstr_h_ssc, 0, sizeof(ixheaace_mps_spatial_specific_config));
  298|       |
  299|  1.28k|  pstr_h_ssc->num_bands = pstr_space_enc->space_tree_setup.num_param_bands;
  300|  1.28k|  pstr_h_ssc->tree_description.num_ott_boxes = space_tree_description.num_ott_boxes;
  301|  1.28k|  pstr_h_ssc->tree_description.num_in_chan = space_tree_description.num_in_channels;
  302|  1.28k|  pstr_h_ssc->tree_description.num_out_chan = space_tree_description.num_out_channels;
  303|       |
  304|  2.56k|  for (i = 0; i < IXHEAACE_MPS_MAX_NUM_BOXES; i++) {
  ------------------
  |  |   50|  2.56k|#define IXHEAACE_MPS_MAX_NUM_BOXES (1)
  ------------------
  |  Branch (304:15): [True: 1.28k, False: 1.28k]
  ------------------
  305|  1.28k|    pstr_h_ssc->ott_config[i].bs_ott_bands = pstr_h_ssc->num_bands;
  306|  1.28k|  }
  307|  1.28k|  pstr_h_ssc->bs_tree_config = IXHEAACE_MPS_TREE_212;
  ------------------
  |  |  104|  1.28k|#define IXHEAACE_MPS_TREE_212 (7)
  ------------------
  308|  1.28k|  pstr_h_ssc->bs_sampling_frequency = pstr_space_enc->num_sample_rate;
  309|  1.28k|  pstr_h_ssc->bs_frame_length = pstr_space_enc->num_frame_time_slots - 1;
  310|  1.28k|  pstr_h_ssc->bs_decorr_config = IXHEAACE_MPS_DECORR_QMFSPLIT0;
  ------------------
  |  |  109|  1.28k|#define IXHEAACE_MPS_DECORR_QMFSPLIT0 (0)
  ------------------
  311|  1.28k|  pstr_h_ssc->bs_quant_mode = pstr_space_enc->quant_mode;
  312|  1.28k|  if (pstr_space_enc->pstr_static_gain->fixed_gain_dmx > IXHEAACE_MPS_MAX_FIXED_GAIN_DMX) {
  ------------------
  |  |  106|  1.28k|#define IXHEAACE_MPS_MAX_FIXED_GAIN_DMX (7)
  ------------------
  |  Branch (312:7): [True: 0, False: 1.28k]
  ------------------
  313|      0|    pstr_h_ssc->bs_fixed_gain_dmx = IXHEAACE_MPS_FIXED_GAIN_DMX_INVALID;
  ------------------
  |  |  105|      0|#define IXHEAACE_MPS_FIXED_GAIN_DMX_INVALID (-1)
  ------------------
  314|  1.28k|  } else {
  315|  1.28k|    pstr_h_ssc->bs_fixed_gain_dmx = pstr_space_enc->pstr_static_gain->fixed_gain_dmx;
  316|  1.28k|  }
  317|  1.28k|  pstr_h_ssc->bs_env_quant_mode = 0;
  318|  1.28k|  return error;
  319|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_init_delay_compensation:
  237|  1.28k|    ixheaace_mps_pstr_space_structure pstr_space_enc, const WORD32 core_coder_delay, WORD32 aot) {
  238|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  239|  1.28k|  WORD32 i;
  240|  1.28k|  memset(&pstr_space_enc->pstr_delay->delay_config, 0,
  241|  1.28k|         sizeof(pstr_space_enc->pstr_delay->delay_config));
  242|  1.28k|  pstr_space_enc->core_coder_delay = core_coder_delay;
  243|  1.28k|  pstr_space_enc->pstr_delay->delay_config.num_qmf_len = pstr_space_enc->num_qmf_bands;
  244|  1.28k|  pstr_space_enc->pstr_delay->delay_config.num_frame_len = pstr_space_enc->n_frame_length;
  245|  1.28k|  pstr_space_enc->pstr_delay->delay_config.num_core_coder_delay = core_coder_delay;
  246|  1.28k|  pstr_space_enc->pstr_delay->delay_config.num_sac_stream_mux_delay =
  247|  1.28k|      pstr_space_enc->time_alignment;
  248|  1.28k|  pstr_space_enc->pstr_delay->delay_config.b_dmx_align = 0;
  249|  1.28k|  pstr_space_enc->pstr_delay->delay_config.b_minimize_delay = 1;
  250|       |
  251|  1.28k|  ixheaace_mps_212_delay_sub_calculate_buffer_delays(pstr_space_enc->pstr_delay);
  252|       |
  253|  1.28k|  pstr_space_enc->n_bitstream_delay_buffer =
  254|  1.28k|      pstr_space_enc->pstr_delay->num_bitstream_frame_buffer_size;
  255|  1.28k|  pstr_space_enc->n_output_buffer_delay = pstr_space_enc->pstr_delay->num_output_audio_buffer;
  256|  1.28k|  pstr_space_enc->n_surround_analysis_buffer_delay =
  257|  1.28k|      pstr_space_enc->pstr_delay->num_surround_analysis_buffer;
  258|  1.28k|  pstr_space_enc->n_bitstream_buffer_read = 0;
  259|  1.28k|  pstr_space_enc->n_bitstream_buffer_write = pstr_space_enc->n_bitstream_delay_buffer - 1;
  260|  1.28k|  pstr_space_enc->num_discard_out_frames = pstr_space_enc->pstr_delay->num_discard_out_frames;
  261|  1.28k|  pstr_space_enc->n_input_delay = pstr_space_enc->pstr_delay->num_dmx_align_buffer;
  262|  1.28k|  pstr_space_enc->independency_count = 0;
  263|  1.28k|  pstr_space_enc->independency_flag = 1;
  264|       |
  265|  1.28k|  for (i = 0; i < pstr_space_enc->n_bitstream_delay_buffer - 1; i++) {
  ------------------
  |  Branch (265:15): [True: 0, False: 1.28k]
  ------------------
  266|      0|    ixheaace_mps_spatial_frame *pstr_frame_data = NULL;
  267|      0|    pstr_frame_data = &pstr_space_enc->pstr_bitstream_formatter->frame;
  268|      0|    pstr_frame_data->bs_independency_flag = 1;
  269|      0|    pstr_frame_data->framing_info.num_param_sets = 1;
  270|      0|    pstr_frame_data->framing_info.bs_framing_type = 0;
  271|       |
  272|      0|    error = ixheaace_mps_212_write_spatial_frame(
  273|      0|        pstr_space_enc->bit_stream_delay_buffer[i], MAX_MPEGS_BYTES,
  ------------------
  |  |  153|      0|#define MAX_MPEGS_BYTES (1 << 14)
  ------------------
  274|      0|        &pstr_space_enc->pn_output_bits[i], pstr_space_enc->pstr_bitstream_formatter, aot);
  275|      0|    if (error) {
  ------------------
  |  Branch (275:9): [True: 0, False: 0]
  ------------------
  276|      0|      return error;
  277|      0|    }
  278|      0|  }
  279|       |
  280|  1.28k|  if ((pstr_space_enc->n_input_delay > MAX_DELAY_INPUT) ||
  ------------------
  |  |   58|  1.28k|#define MAX_DELAY_INPUT (1024)
  ------------------
  |  Branch (280:7): [True: 0, False: 1.28k]
  ------------------
  281|  1.28k|      (pstr_space_enc->n_output_buffer_delay > MAX_DELAY_OUTPUT) ||
  ------------------
  |  |   59|  1.28k|#define MAX_DELAY_OUTPUT (4096)
  ------------------
  |  Branch (281:7): [True: 0, False: 1.28k]
  ------------------
  282|  1.28k|      (pstr_space_enc->n_surround_analysis_buffer_delay > MAX_DELAY_SURROUND_ANALYSIS) ||
  ------------------
  |  |   60|  1.28k|#define MAX_DELAY_SURROUND_ANALYSIS (20)
  ------------------
  |  Branch (282:7): [True: 0, False: 1.28k]
  ------------------
  283|  1.28k|      (pstr_space_enc->n_bitstream_delay_buffer > MAX_BITSTREAM_DELAY)) {
  ------------------
  |  |   61|  1.28k|#define MAX_BITSTREAM_DELAY (4)
  ------------------
  |  Branch (283:7): [True: 0, False: 1.28k]
  ------------------
  284|      0|    return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  285|      0|  }
  286|  1.28k|  return error;
  287|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_encode:
  384|  91.2k|    WORD8 *ptr_scratch) {
  385|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  386|  91.2k|  WORD32 num_output_samples;
  387|  91.2k|  WORD32 i, ch, ps, win_cnt, ts, slot;
  388|  91.2k|  WORD32 curr_trans_pos = -1;
  389|  91.2k|  WORD32 num_ch_in;
  390|  91.2k|  WORD32 num_ch_in_with_dmx;
  391|  91.2k|  WORD32 num_ch_out;
  392|  91.2k|  WORD32 num_samples_per_channel;
  393|  91.2k|  WORD32 num_output_samples_max;
  394|  91.2k|  WORD32 num_frame_time_slots;
  395|  91.2k|  WORD32 num_frame_time_slots_reduction;
  396|  91.2k|  ixheaace_mps_spatial_frame *pstr_frame_data = NULL;
  397|  91.2k|  UWORD8 *ptr_bitstream_delay_buffer;
  398|  91.2k|  const FLOAT32 *ptr_input_samples =
  399|  91.2k|      (const FLOAT32 *)ptr_in_buf_desc->pp_base[IXHEAACE_MPS_INPUT_BUFFER_IDX];
  ------------------
  |  |  142|  91.2k|#define IXHEAACE_MPS_INPUT_BUFFER_IDX (0)
  ------------------
  400|       |
  401|  91.2k|  FLOAT32 *const ptr_output_samples =
  402|  91.2k|      (FLOAT32 *)ptr_out_buf_desc->pp_base[IXHEAACE_MPS_OUTUT_BUFFER_IDX];
  ------------------
  |  |  143|  91.2k|#define IXHEAACE_MPS_OUTUT_BUFFER_IDX (0)
  ------------------
  403|       |
  404|  91.2k|  const WORD32 num_output_samples_buffer_size =
  405|  91.2k|      ptr_out_buf_desc->p_buf_size[IXHEAACE_MPS_OUTUT_BUFFER_IDX] /
  ------------------
  |  |  143|  91.2k|#define IXHEAACE_MPS_OUTUT_BUFFER_IDX (0)
  ------------------
  406|  91.2k|      ptr_out_buf_desc->p_ele_size[IXHEAACE_MPS_OUTUT_BUFFER_IDX];
  ------------------
  |  |  143|  91.2k|#define IXHEAACE_MPS_OUTUT_BUFFER_IDX (0)
  ------------------
  407|  91.2k|  num_ch_in = pstr_space_enc->n_input_channels;
  408|  91.2k|  num_ch_in_with_dmx = num_ch_in;
  409|  91.2k|  num_ch_out = pstr_space_enc->n_output_channels;
  410|  91.2k|  num_samples_per_channel = pstr_in_args->num_input_samples / num_ch_in_with_dmx;
  411|  91.2k|  num_output_samples_max = num_samples_per_channel * num_ch_out;
  412|  91.2k|  num_frame_time_slots = pstr_space_enc->num_frame_time_slots;
  413|  91.2k|  num_frame_time_slots_reduction = pstr_space_enc->num_frame_time_slots >> 1;
  414|  91.2k|  if ((0 != pstr_in_args->num_input_samples % num_ch_in_with_dmx)) {
  ------------------
  |  Branch (414:7): [True: 0, False: 91.2k]
  ------------------
  415|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  416|      0|  }
  417|  91.2k|  pstr_frame_data = &pstr_space_enc->pstr_bitstream_formatter->frame;
  418|       |
  419|  91.2k|  if (aot != AOT_USAC) {
  ------------------
  |  |   38|  91.2k|#define AOT_USAC (42)
  ------------------
  |  Branch (419:7): [True: 12.2k, False: 78.9k]
  ------------------
  420|  12.2k|    if (pstr_space_enc->num_discard_out_frames > 0) {
  ------------------
  |  Branch (420:9): [True: 0, False: 12.2k]
  ------------------
  421|      0|      pstr_space_enc->independency_count = 0;
  422|      0|      pstr_space_enc->independency_flag = 1;
  423|  12.2k|    } else {
  424|  12.2k|      pstr_space_enc->independency_flag = (pstr_space_enc->independency_count == 0) ? 1 : 0;
  ------------------
  |  Branch (424:43): [True: 712, False: 11.5k]
  ------------------
  425|  12.2k|      if (pstr_space_enc->independency_factor > 0) {
  ------------------
  |  Branch (425:11): [True: 12.2k, False: 0]
  ------------------
  426|  12.2k|        pstr_space_enc->independency_count++;
  427|  12.2k|        pstr_space_enc->independency_count =
  428|  12.2k|            pstr_space_enc->independency_count % ((WORD32)pstr_space_enc->independency_factor);
  429|  12.2k|      } else {
  430|      0|        pstr_space_enc->independency_count = -1;
  431|      0|      }
  432|  12.2k|    }
  433|  12.2k|  }
  434|       |
  435|  91.2k|  error = ixheaace_mps_212_feed_de_inter_pre_scale(
  436|  91.2k|      pstr_space_enc, ptr_input_samples, ptr_output_samples, pstr_in_args->num_input_samples,
  437|  91.2k|      pstr_in_args->is_input_inter_leaved, pstr_in_args->input_buffer_size_per_channel,
  438|  91.2k|      &pstr_out_args->num_samples_consumed);
  439|  91.2k|  if (error) {
  ------------------
  |  Branch (439:7): [True: 0, False: 91.2k]
  ------------------
  440|      0|    return error;
  441|      0|  }
  442|       |
  443|  91.2k|  if (pstr_space_enc->n_samples_next != pstr_space_enc->n_samples_valid) {
  ------------------
  |  Branch (443:7): [True: 0, False: 91.2k]
  ------------------
  444|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  445|      0|  }
  446|       |
  447|   273k|  for (ch = 0; ch < num_ch_in; ch++) {
  ------------------
  |  Branch (447:16): [True: 182k, False: 91.2k]
  ------------------
  448|  6.37M|    for (slot = 0; slot < num_frame_time_slots; slot++) {
  ------------------
  |  Branch (448:20): [True: 6.19M, False: 182k]
  ------------------
  449|  6.19M|      ixheaace_cmplx_str *pstr_cmplx_data;
  450|       |
  451|  6.19M|      pstr_cmplx_data =
  452|  6.19M|          pstr_space_enc
  453|  6.19M|              ->cmplx_hybrid_in[ch][pstr_space_enc->n_update_hybrid_position_time_slots +
  454|  6.19M|                                    num_frame_time_slots - num_frame_time_slots_reduction + slot];
  455|  6.19M|      memset(pstr_cmplx_data, 0, 2 * pstr_space_enc->num_hybrid_bands * sizeof(WORD32));
  456|  6.19M|    }
  457|   182k|  }
  458|       |
  459|   273k|  for (ch = 0; ch < num_ch_in; ch++) {
  ------------------
  |  Branch (459:16): [True: 182k, False: 91.2k]
  ------------------
  460|   182k|    FLOAT32 qmf_in_real[MAX_QMF_BANDS];
  461|   182k|    FLOAT32 qmf_in_imag[MAX_QMF_BANDS];
  462|   182k|    FLOAT32 p_work_buffer[MAX_QMF_BANDS << 1];
  463|   182k|    FLOAT32 *ptr_pre_gain = pstr_space_enc->pstr_static_gain->pre_gain;
  464|  6.37M|    for (ts = 0; ts < num_frame_time_slots; ts++) {
  ------------------
  |  Branch (464:18): [True: 6.19M, False: 182k]
  ------------------
  465|  6.19M|      FLOAT32 *ptr_spec_real;
  466|  6.19M|      FLOAT32 *ptr_spec_imag;
  467|       |
  468|  6.19M|      FLOAT32 *ptr_time_in =
  469|  6.19M|          &pstr_space_enc->time_signal_in[ch][(ts * pstr_space_enc->num_qmf_bands)];
  470|       |
  471|  6.19M|      ixheaace_mps_212_apply_dc_filter(pstr_space_enc->pstr_dc_filter[ch], ptr_time_in,
  472|  6.19M|                                       ptr_time_in, pstr_space_enc->num_qmf_bands);
  473|       |
  474|  6.19M|      error = ixheaace_mps_212_qmf_analysis_filtering_slot(pstr_space_enc->pstr_qmf_filter_in[ch],
  475|  6.19M|                                                           qmf_in_real, qmf_in_imag, ptr_time_in,
  476|  6.19M|                                                           1, p_work_buffer, ptr_scratch);
  477|  6.19M|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (477:11): [True: 0, False: 6.19M]
  ------------------
  478|      0|        return error;
  479|      0|      }
  480|       |
  481|  6.19M|      ptr_spec_real = qmf_in_real;
  482|  6.19M|      ptr_spec_imag = qmf_in_imag;
  483|  6.19M|      if (1.0f != ptr_pre_gain[ch]) {
  ------------------
  |  Branch (483:11): [True: 0, False: 6.19M]
  ------------------
  484|      0|        for (i = 0; i < pstr_space_enc->num_hybrid_bands; i++) {
  ------------------
  |  Branch (484:21): [True: 0, False: 0]
  ------------------
  485|      0|          pstr_space_enc
  486|      0|              ->cmplx_hybrid_in[ch][pstr_space_enc->n_analysis_lookahead_time_slots + ts][i]
  487|      0|              .re = ptr_spec_real[i] * ptr_pre_gain[ch];
  488|      0|          pstr_space_enc
  489|      0|              ->cmplx_hybrid_in[ch][pstr_space_enc->n_analysis_lookahead_time_slots + ts][i]
  490|      0|              .im = ptr_spec_imag[i] * ptr_pre_gain[ch];
  491|      0|        }
  492|  6.19M|      } else {
  493|   402M|        for (i = 0; i < pstr_space_enc->num_hybrid_bands; i++) {
  ------------------
  |  Branch (493:21): [True: 396M, False: 6.19M]
  ------------------
  494|   396M|          pstr_space_enc
  495|   396M|              ->cmplx_hybrid_in[ch][pstr_space_enc->n_analysis_lookahead_time_slots + ts][i]
  496|   396M|              .re = ptr_spec_real[i];
  497|   396M|          pstr_space_enc
  498|   396M|              ->cmplx_hybrid_in[ch][pstr_space_enc->n_analysis_lookahead_time_slots + ts][i]
  499|   396M|              .im = ptr_spec_imag[i];
  500|   396M|        }
  501|  6.19M|      }
  502|  6.19M|    }
  503|   182k|  }
  504|       |
  505|   273k|  for (ch = 0; ch < num_ch_in; ch++) {
  ------------------
  |  Branch (505:16): [True: 182k, False: 91.2k]
  ------------------
  506|  9.48M|    for (slot = 0; slot < (WORD32)(pstr_space_enc->n_update_hybrid_position_time_slots +
  ------------------
  |  Branch (506:20): [True: 9.30M, False: 182k]
  ------------------
  507|  9.48M|                                   num_frame_time_slots - num_frame_time_slots_reduction);
  508|  9.30M|         slot++) {
  509|  9.30M|      memmove(pstr_space_enc->cmplx_hybrid_in[ch][slot],
  510|  9.30M|              pstr_space_enc->cmplx_hybrid_in_static[ch][slot],
  511|  9.30M|              sizeof(ixheaace_cmplx_str) * pstr_space_enc->num_hybrid_bands);
  512|  9.30M|    }
  513|       |
  514|  9.48M|    for (slot = 0; slot < (WORD32)(pstr_space_enc->n_update_hybrid_position_time_slots +
  ------------------
  |  Branch (514:20): [True: 9.30M, False: 182k]
  ------------------
  515|  9.48M|                                   num_frame_time_slots - num_frame_time_slots_reduction);
  516|  9.30M|         slot++) {
  517|  9.30M|      memmove(pstr_space_enc->cmplx_hybrid_in_static[ch][slot],
  518|  9.30M|              pstr_space_enc->cmplx_hybrid_in[ch][num_frame_time_slots + slot],
  519|  9.30M|              sizeof(ixheaace_cmplx_str) * pstr_space_enc->num_hybrid_bands);
  520|  9.30M|    }
  521|       |
  522|   182k|    error = ixheaace_mps_212_onset_detect_apply(
  523|   182k|        pstr_space_enc->pstr_onset_detect[ch], num_frame_time_slots,
  524|   182k|        &pstr_space_enc->cmplx_hybrid_in[ch][pstr_space_enc->n_analysis_lookahead_time_slots],
  525|   182k|        pstr_space_enc->tr_prev_pos[1], pstr_space_enc->pp_tr_curr_pos[ch]);
  526|   182k|    if (error) {
  ------------------
  |  Branch (526:9): [True: 0, False: 182k]
  ------------------
  527|      0|      return error;
  528|      0|    }
  529|       |
  530|   182k|    if (pstr_space_enc->use_frame_keep == 0) {
  ------------------
  |  Branch (530:9): [True: 0, False: 182k]
  ------------------
  531|      0|      pstr_space_enc->pp_tr_curr_pos[ch][0] = -1;
  532|      0|    }
  533|       |
  534|   182k|    if ((pstr_space_enc->pp_tr_curr_pos[ch][0] >= 0) &&
  ------------------
  |  Branch (534:9): [True: 50.3k, False: 132k]
  ------------------
  535|  50.3k|        ((curr_trans_pos < 0) || (pstr_space_enc->pp_tr_curr_pos[ch][0] < curr_trans_pos))) {
  ------------------
  |  Branch (535:10): [True: 26.6k, False: 23.6k]
  |  Branch (535:34): [True: 818, False: 22.8k]
  ------------------
  536|  27.5k|      curr_trans_pos = pstr_space_enc->pp_tr_curr_pos[ch][0];
  537|  27.5k|    }
  538|   182k|  }
  539|  91.2k|  if (pstr_space_enc->use_frame_keep == 1) {
  ------------------
  |  Branch (539:7): [True: 91.2k, False: 0]
  ------------------
  540|  91.2k|    if ((curr_trans_pos != -1) || (pstr_space_enc->independency_flag == 1)) {
  ------------------
  |  Branch (540:9): [True: 26.6k, False: 64.5k]
  |  Branch (540:35): [True: 5.21k, False: 59.3k]
  ------------------
  541|  31.9k|      pstr_space_enc->avoid_keep = NUM_KEEP_WINDOWS;
  ------------------
  |  |   66|  31.9k|#define NUM_KEEP_WINDOWS (3)
  ------------------
  542|  31.9k|      curr_trans_pos = -1;
  543|  31.9k|    }
  544|  91.2k|  }
  545|       |
  546|  91.2k|  pstr_space_enc->tr_prev_pos[0] = MAX(-1, pstr_space_enc->tr_prev_pos[1] - num_frame_time_slots);
  ------------------
  |  |   24|  91.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 91.2k, False: 0]
  |  |  ------------------
  ------------------
  547|  91.2k|  pstr_space_enc->tr_prev_pos[1] = curr_trans_pos;
  548|       |
  549|   273k|  for (ch = 0; ch < num_ch_in; ch++) {
  ------------------
  |  Branch (549:16): [True: 182k, False: 91.2k]
  ------------------
  550|   182k|    error = ixheaace_mps_212_onset_detect_update(pstr_space_enc->pstr_onset_detect[ch],
  551|   182k|                                                 num_frame_time_slots);
  552|   182k|    if (error) {
  ------------------
  |  Branch (552:9): [True: 0, False: 182k]
  ------------------
  553|      0|      return error;
  554|      0|    }
  555|   182k|  }
  556|       |
  557|  91.2k|  ixheaace_mps_212_frame_window_get_window(
  558|  91.2k|      pstr_space_enc->h_frame_window, pstr_space_enc->tr_prev_pos, num_frame_time_slots,
  559|  91.2k|      &pstr_frame_data->framing_info, pstr_space_enc->ptr_frame_window_ana,
  560|  91.2k|      &pstr_space_enc->frame_win_list, pstr_space_enc->avoid_keep);
  561|       |
  562|   182k|  for (ps = 0, win_cnt = 0; ps < pstr_space_enc->frame_win_list.win_list_cnt; ++ps) {
  ------------------
  |  Branch (562:29): [True: 91.2k, False: 91.2k]
  ------------------
  563|  91.2k|    if (pstr_space_enc->frame_win_list.dat[ps].hold == IXHEAACE_MPS_FRAME_WINDOWING_HOLD) {
  ------------------
  |  |   85|  91.2k|#define IXHEAACE_MPS_FRAME_WINDOWING_HOLD (1)
  ------------------
  |  Branch (563:9): [True: 0, False: 91.2k]
  ------------------
  564|      0|      ixheaace_mps_212_duplicate_parameter_set(&pstr_space_enc->save_frame, 0, pstr_frame_data,
  565|      0|                                               ps);
  566|  91.2k|    } else {
  567|  91.2k|      WORD32 num_analysis_length_time_slots, analysis_start_time_slot;
  568|  91.2k|      FLOAT32 *ptr_frame_window_ana;
  569|  91.2k|      num_analysis_length_time_slots = ixheaace_mps_212_get_analysis_length_time_slots(
  570|  91.2k|          pstr_space_enc->ptr_frame_window_ana[win_cnt],
  571|  91.2k|          pstr_space_enc->num_analysis_length_time_slots);
  572|       |
  573|  91.2k|      analysis_start_time_slot = ixheaace_mps_212_get_analysis_start_time_slot(
  574|  91.2k|          pstr_space_enc->ptr_frame_window_ana[win_cnt],
  575|  91.2k|          pstr_space_enc->num_analysis_length_time_slots);
  576|       |
  577|  91.2k|      ptr_frame_window_ana = pstr_space_enc->ptr_frame_window_ana[win_cnt];
  578|       |
  579|  91.2k|      error = ixheaace_mps_212_space_tree_apply(
  580|  91.2k|          pstr_space_enc->pstr_space_tree, ps, num_ch_in, num_analysis_length_time_slots,
  581|  91.2k|          analysis_start_time_slot, pstr_space_enc->num_hybrid_bands, ptr_frame_window_ana,
  582|  91.2k|          pstr_space_enc->cmplx_hybrid_in, pstr_space_enc->cmplx_hybrid_in, pstr_frame_data,
  583|  91.2k|          pstr_space_enc->avoid_keep);
  584|  91.2k|      if (error) {
  ------------------
  |  Branch (584:11): [True: 0, False: 91.2k]
  ------------------
  585|      0|        return error;
  586|      0|      }
  587|       |
  588|  91.2k|      ixheaace_mps_212_duplicate_parameter_set(pstr_frame_data, ps, &pstr_space_enc->save_frame,
  589|  91.2k|                                               0);
  590|  91.2k|      ++win_cnt;
  591|  91.2k|    }
  592|  91.2k|    if (pstr_space_enc->avoid_keep > 0) {
  ------------------
  |  Branch (592:9): [True: 51.6k, False: 39.5k]
  ------------------
  593|  51.6k|      pstr_space_enc->avoid_keep--;
  594|  51.6k|    }
  595|  91.2k|  }
  596|       |
  597|  91.2k|  memset(&pstr_frame_data->smg_data, 0, sizeof(pstr_frame_data->smg_data));
  598|       |
  599|  91.2k|  ptr_bitstream_delay_buffer =
  600|  91.2k|      (UWORD8 *)ptr_out_buf_desc->pp_base[IXHEAACE_MPS_BITSTREAM_BUFFER_IDX];
  ------------------
  |  |  144|  91.2k|#define IXHEAACE_MPS_BITSTREAM_BUFFER_IDX (1)
  ------------------
  601|  91.2k|  pstr_frame_data->bs_independency_flag = pstr_space_enc->independency_flag;
  602|       |
  603|  91.2k|  error = ixheaace_mps_212_write_spatial_frame(
  604|  91.2k|      ptr_bitstream_delay_buffer, MAX_MPEGS_BYTES,
  ------------------
  |  |  153|  91.2k|#define MAX_MPEGS_BYTES (1 << 14)
  ------------------
  605|  91.2k|      &pstr_space_enc->pn_output_bits[pstr_space_enc->n_bitstream_buffer_write],
  606|  91.2k|      pstr_space_enc->pstr_bitstream_formatter, aot);
  607|  91.2k|  if (error) {
  ------------------
  |  Branch (607:7): [True: 0, False: 91.2k]
  ------------------
  608|      0|    return error;
  609|      0|  }
  610|       |
  611|  91.2k|  if ((pstr_space_enc->num_discard_out_frames == 0) &&
  ------------------
  |  Branch (611:7): [True: 91.2k, False: 0]
  ------------------
  612|  91.2k|      (IXHEAACE_MPS_BITSTREAM_BUFFER_IDX != -1)) {
  ------------------
  |  |  144|  91.2k|#define IXHEAACE_MPS_BITSTREAM_BUFFER_IDX (1)
  ------------------
  |  Branch (612:7): [True: 0, Folded]
  ------------------
  613|  91.2k|    const WORD32 idx = IXHEAACE_MPS_BITSTREAM_BUFFER_IDX;
  ------------------
  |  |  144|  91.2k|#define IXHEAACE_MPS_BITSTREAM_BUFFER_IDX (1)
  ------------------
  614|  91.2k|    const WORD32 out_bits =
  615|  91.2k|        pstr_space_enc->pn_output_bits[pstr_space_enc->n_bitstream_buffer_read];
  616|       |
  617|  91.2k|    if (((out_bits + 7) / 8) >
  ------------------
  |  Branch (617:9): [True: 0, False: 91.2k]
  ------------------
  618|  91.2k|        (WORD32)(ptr_out_buf_desc->p_buf_size[idx] / ptr_out_buf_desc->p_ele_size[idx])) {
  619|      0|      pstr_out_args->num_output_bits = 0;
  620|      0|      return IA_EXHEAACE_EXE_NONFATAL_MPS_ENCODE_ERROR;
  621|      0|    }
  622|  91.2k|    pstr_out_args->num_output_bits = out_bits;
  623|  91.2k|  } else {
  624|      0|    pstr_out_args->num_output_bits = 0;
  625|      0|  }
  626|       |
  627|  91.2k|  pstr_space_enc->n_bitstream_buffer_read =
  628|  91.2k|      (pstr_space_enc->n_bitstream_buffer_read + 1) % pstr_space_enc->n_bitstream_delay_buffer;
  629|  91.2k|  pstr_space_enc->n_bitstream_buffer_write =
  630|  91.2k|      (pstr_space_enc->n_bitstream_buffer_write + 1) % pstr_space_enc->n_bitstream_delay_buffer;
  631|       |
  632|  91.2k|  num_output_samples =
  633|  91.2k|      (pstr_space_enc->num_discard_out_frames == 0) ? (num_output_samples_max) : 0;
  ------------------
  |  Branch (633:7): [True: 91.2k, False: 0]
  ------------------
  634|  91.2k|  if (num_output_samples > num_output_samples_buffer_size) {
  ------------------
  |  Branch (634:7): [True: 0, False: 91.2k]
  ------------------
  635|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  636|      0|  }
  637|  91.2k|  pstr_out_args->num_output_samples = num_output_samples;
  638|       |
  639|  91.2k|  if (pstr_space_enc->num_discard_out_frames > 0) {
  ------------------
  |  Branch (639:7): [True: 0, False: 91.2k]
  ------------------
  640|      0|    pstr_space_enc->num_discard_out_frames--;
  641|      0|  }
  642|  91.2k|  pstr_space_enc->n_samples_valid = 0;
  643|       |
  644|  91.2k|  return error;
  645|  91.2k|}
ixheaace_mps_enc.c:ixheaace_mps_212_feed_de_inter_pre_scale:
  173|  91.2k|    UWORD32 *const ptr_n_samples_fed) {
  174|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  175|  91.2k|  WORD32 ch;
  176|  91.2k|  const WORD32 num_ch_in = pstr_space_enc->n_input_channels;
  177|  91.2k|  const WORD32 num_ch_in_with_dmx = num_ch_in;
  178|  91.2k|  const WORD32 samples_to_feed =
  179|  91.2k|      MIN(num_samples, pstr_space_enc->n_samples_next - pstr_space_enc->n_samples_valid);
  ------------------
  |  |   23|  91.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 91.2k]
  |  |  ------------------
  ------------------
  180|  91.2k|  const WORD32 num_samples_per_channel = samples_to_feed / num_ch_in_with_dmx;
  181|       |
  182|  91.2k|  if ((samples_to_feed < 0) || (samples_to_feed % num_ch_in_with_dmx != 0) ||
  ------------------
  |  Branch (182:7): [True: 0, False: 91.2k]
  |  Branch (182:32): [True: 0, False: 91.2k]
  ------------------
  183|  91.2k|      (samples_to_feed > num_ch_in_with_dmx * (WORD32)pstr_space_enc->n_frame_length)) {
  ------------------
  |  Branch (183:7): [True: 0, False: 91.2k]
  ------------------
  184|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  185|      0|  }
  186|  91.2k|  const FLOAT32 *p_input_mps;
  187|  91.2k|  const FLOAT32 *p_input_2_mps;
  188|  91.2k|  {
  189|  91.2k|    p_input_mps = ptr_samples;
  190|  91.2k|    p_input_2_mps = ptr_samples + (pstr_space_enc->n_input_delay * num_ch_in_with_dmx);
  191|  91.2k|  }
  192|   273k|  for (ch = 0; ch < num_ch_in; ch++) {
  ------------------
  |  Branch (192:16): [True: 182k, False: 91.2k]
  ------------------
  193|   182k|    memcpy(&(pstr_space_enc->time_signal_in[ch][0]),
  194|   182k|           &(pstr_space_enc->time_signal_delay_in[ch][0]),
  195|   182k|           pstr_space_enc->n_surround_analysis_buffer_delay * sizeof(FLOAT32));
  196|       |
  197|   182k|    if (is_input_inter_leaved) {
  ------------------
  |  Branch (197:9): [True: 0, False: 182k]
  ------------------
  198|      0|      ixheaace_mps_212_memcpy_flex_pcm(
  199|      0|          &(pstr_space_enc->time_signal_in[ch][pstr_space_enc->n_surround_analysis_buffer_delay]),
  200|      0|          1, p_input_mps + ch, num_ch_in_with_dmx, pstr_space_enc->n_input_delay);
  201|      0|      ixheaace_mps_212_memcpy_flex_pcm(
  202|      0|          &(pstr_space_enc->time_signal_in[ch][pstr_space_enc->n_surround_analysis_buffer_delay +
  203|      0|                                               pstr_space_enc->n_input_delay]),
  204|      0|          1, p_input_2_mps + ch, num_ch_in_with_dmx,
  205|      0|          num_samples_per_channel - pstr_space_enc->n_input_delay);
  206|   182k|    } else {
  207|   182k|      memcpy(
  208|   182k|          &(pstr_space_enc->time_signal_in[ch][pstr_space_enc->n_surround_analysis_buffer_delay]),
  209|   182k|          p_input_mps + ch * input_buffer_size_per_channel,
  210|   182k|          pstr_space_enc->n_input_delay * sizeof(FLOAT32));
  211|   182k|      memcpy(
  212|   182k|          &(pstr_space_enc->time_signal_in[ch][pstr_space_enc->n_surround_analysis_buffer_delay +
  213|   182k|                                               pstr_space_enc->n_input_delay]),
  214|   182k|          p_input_2_mps + ch * input_buffer_size_per_channel,
  215|   182k|          (num_samples_per_channel - pstr_space_enc->n_input_delay) * sizeof(FLOAT32));
  216|   182k|    }
  217|       |
  218|   182k|    memcpy(&(pstr_space_enc->time_signal_delay_in[ch][0]),
  219|   182k|           &(pstr_space_enc->time_signal_in[ch][pstr_space_enc->n_frame_length]),
  220|   182k|           pstr_space_enc->n_surround_analysis_buffer_delay * sizeof(FLOAT32));
  221|   182k|  }
  222|       |
  223|  91.2k|  error = ixheaace_mps_212_apply_enhanced_time_domain_dmx(
  224|  91.2k|      pstr_space_enc->pstr_enhanced_time_dmx, pstr_space_enc->time_signal_in, ptr_output_samples,
  225|  91.2k|      pstr_space_enc->n_surround_analysis_buffer_delay);
  226|  91.2k|  if (error) {
  ------------------
  |  Branch (226:7): [True: 0, False: 91.2k]
  ------------------
  227|      0|    return error;
  228|      0|  }
  229|       |
  230|  91.2k|  pstr_space_enc->n_samples_valid += samples_to_feed;
  231|       |
  232|  91.2k|  *ptr_n_samples_fed = samples_to_feed;
  233|  91.2k|  return error;
  234|  91.2k|}
ixheaace_mps_enc.c:ixheaace_mps_212_duplicate_parameter_set:
  351|  91.2k|    ixheaace_mps_spatial_frame *const pstr_spatial_frame_to, const WORD32 set_to) {
  352|  91.2k|  WORD32 box;
  353|   182k|  for (box = 0; box < IXHEAACE_MPS_MAX_NUM_BOXES; box++) {
  ------------------
  |  |   50|   182k|#define IXHEAACE_MPS_MAX_NUM_BOXES (1)
  ------------------
  |  Branch (353:17): [True: 91.2k, False: 91.2k]
  ------------------
  354|  91.2k|    memcpy(pstr_spatial_frame_to->ott_data.cld[box][set_to],
  355|  91.2k|           pstr_spatial_frame_from->ott_data.cld[box][set_from],
  356|  91.2k|           sizeof(pstr_spatial_frame_from->ott_data.cld[0][0]));
  357|  91.2k|    pstr_spatial_frame_to->cld_lossless_data.bs_xxx_data_mode[box][set_to] =
  358|  91.2k|        pstr_spatial_frame_from->cld_lossless_data.bs_xxx_data_mode[box][set_from];
  359|  91.2k|    pstr_spatial_frame_to->cld_lossless_data.bs_data_pair[box][set_to] =
  360|  91.2k|        pstr_spatial_frame_from->cld_lossless_data.bs_data_pair[box][set_from];
  361|  91.2k|    pstr_spatial_frame_to->cld_lossless_data.bs_quant_coarse_xxx[box][set_to] =
  362|  91.2k|        pstr_spatial_frame_from->cld_lossless_data.bs_quant_coarse_xxx[box][set_from];
  363|  91.2k|    pstr_spatial_frame_to->cld_lossless_data.bs_freq_res_stride_xxx[box][set_to] =
  364|  91.2k|        pstr_spatial_frame_from->cld_lossless_data.bs_freq_res_stride_xxx[box][set_from];
  365|       |
  366|  91.2k|    memcpy(pstr_spatial_frame_to->ott_data.icc[box][set_to],
  367|  91.2k|           pstr_spatial_frame_from->ott_data.icc[box][set_from],
  368|  91.2k|           sizeof(pstr_spatial_frame_from->ott_data.icc[0][0]));
  369|  91.2k|    pstr_spatial_frame_to->icc_lossless_data.bs_xxx_data_mode[box][set_to] =
  370|  91.2k|        pstr_spatial_frame_from->icc_lossless_data.bs_xxx_data_mode[box][set_from];
  371|  91.2k|    pstr_spatial_frame_to->icc_lossless_data.bs_data_pair[box][set_to] =
  372|  91.2k|        pstr_spatial_frame_from->icc_lossless_data.bs_data_pair[box][set_from];
  373|  91.2k|    pstr_spatial_frame_to->icc_lossless_data.bs_quant_coarse_xxx[box][set_to] =
  374|  91.2k|        pstr_spatial_frame_from->icc_lossless_data.bs_quant_coarse_xxx[box][set_from];
  375|  91.2k|    pstr_spatial_frame_to->icc_lossless_data.bs_freq_res_stride_xxx[box][set_to] =
  376|  91.2k|        pstr_spatial_frame_from->icc_lossless_data.bs_freq_res_stride_xxx[box][set_from];
  377|  91.2k|  }
  378|  91.2k|}
ixheaace_mps_enc.c:ixheaace_mps_212_get_analysis_length_time_slots:
  135|  91.2k|                                                              WORD32 num_time_slots) {
  136|  91.2k|  WORD32 i;
  137|  1.64M|  for (i = num_time_slots - 1; i >= 0; i--) {
  ------------------
  |  Branch (137:32): [True: 1.64M, False: 0]
  ------------------
  138|  1.64M|    if (ptr_frame_window_ana[i] != 0) {
  ------------------
  |  Branch (138:9): [True: 91.2k, False: 1.55M]
  ------------------
  139|  91.2k|      break;
  140|  91.2k|    }
  141|  1.64M|  }
  142|  91.2k|  num_time_slots = i + 1;
  143|  91.2k|  return num_time_slots;
  144|  91.2k|}
ixheaace_mps_enc.c:ixheaace_mps_212_get_analysis_start_time_slot:
  147|  91.2k|                                                            WORD32 num_time_slots) {
  148|  91.2k|  WORD32 start_time_slot = 0;
  149|  91.2k|  WORD32 i;
  150|  1.82M|  for (i = 0; i < num_time_slots; i++) {
  ------------------
  |  Branch (150:15): [True: 1.82M, False: 0]
  ------------------
  151|  1.82M|    if (ptr_frame_window_ana[i] != 0) {
  ------------------
  |  Branch (151:9): [True: 91.2k, False: 1.73M]
  ------------------
  152|  91.2k|      break;
  153|  91.2k|    }
  154|  1.82M|  }
  155|  91.2k|  start_time_slot = i;
  156|  91.2k|  return start_time_slot;
  157|  91.2k|}
ixheaace_mps_enc.c:ixheaace_mps_212_write_spatial_specific_config_data:
  862|  1.28k|    ixheaace_mps_pstr_struct pstr_mps_enc, ixheaace_bit_buf_handle pstr_bit_buf) {
  863|  1.28k|  WORD32 idx;
  864|  1.28k|  WORD32 ssc_bits = 0;
  865|  1.28k|  WORD32 written_bits = 0;
  866|  1.28k|  ixheaace_mps_space_info pstr_space_encoder_info;
  867|  1.28k|  ixheaace_mps_212_get_info(pstr_mps_enc->ptr_sac_encoder, &pstr_space_encoder_info);
  868|       |
  869|  4.14k|  for (idx = 0; idx<pstr_space_encoder_info.p_ssc_buf->num_ssc_size_bits>> 3; idx++) {
  ------------------
  |  Branch (869:17): [True: 2.86k, False: 1.28k]
  ------------------
  870|  2.86k|    ixheaace_write_bits(pstr_bit_buf, pstr_space_encoder_info.p_ssc_buf->ptr_ssc[idx], 8);
  871|  2.86k|    written_bits += 8;
  872|  2.86k|  }
  873|  1.28k|  ixheaace_write_bits(
  874|  1.28k|      pstr_bit_buf, pstr_space_encoder_info.p_ssc_buf->ptr_ssc[idx],
  875|  1.28k|      (UWORD8)(pstr_space_encoder_info.p_ssc_buf->num_ssc_size_bits - written_bits));
  876|       |
  877|  1.28k|  ssc_bits = pstr_space_encoder_info.p_ssc_buf->num_ssc_size_bits;
  878|  1.28k|  return ssc_bits;
  879|  1.28k|}
ixheaace_mps_enc.c:ixheaace_mps_212_get_info:
  336|  1.28k|                                      ixheaace_mps_space_info *const pstr_space_info) {
  337|  1.28k|  pstr_space_info->num_sample_rate = pstr_space_enc->num_sample_rate;
  338|  1.28k|  pstr_space_info->num_samples_frame = pstr_space_enc->n_frame_length;
  339|  1.28k|  pstr_space_info->num_total_input_channels = pstr_space_enc->n_input_channels;
  340|  1.28k|  pstr_space_info->dmx_delay = pstr_space_enc->pstr_delay->num_info_dmx_delay;
  341|  1.28k|  pstr_space_info->codec_delay = pstr_space_enc->pstr_delay->num_info_codec_delay;
  342|  1.28k|  pstr_space_info->decoder_delay = pstr_space_enc->pstr_delay->num_info_decoder_delay;
  343|  1.28k|  pstr_space_info->pay_load_delay =
  344|  1.28k|      pstr_space_enc->pstr_delay->num_bitstream_frame_buffer_size - 1;
  345|  1.28k|  pstr_space_info->num_discard_out_frames = pstr_space_enc->num_discard_out_frames;
  346|  1.28k|  pstr_space_info->p_ssc_buf = &pstr_space_enc->ssc_buf;
  347|  1.28k|}

ixheaace_mps_212_init_dc_filter:
   31|  2.56k|                                     const UWORD32 sample_rate) {
   32|  2.56k|  FLOAT32 exp;
   33|       |
   34|  2.56k|  exp = (-ONE_BY_LN_TWO * 10 / (FLOAT32)sample_rate);
  ------------------
  |  |  159|  2.56k|#define ONE_BY_LN_TWO (1.44269504089f)
  ------------------
   35|  2.56k|  exp = (FLOAT32)pow(2, exp);
   36|  2.56k|  pstr_dc_filter->exp_c = exp;
   37|  2.56k|  pstr_dc_filter->state = 0.0f;
   38|  2.56k|}
ixheaace_mps_212_apply_dc_filter:
   42|  6.19M|                                      const WORD32 signal_length) {
   43|  6.19M|  WORD32 idx;
   44|  6.19M|  FLOAT32 inp_1, inp_2, out;
   45|  6.19M|  FLOAT32 exp_const = pstr_dc_filter->exp_c;
   46|  6.19M|  FLOAT32 *const y = ptr_output;
   47|  6.19M|  FLOAT32 *const state = &pstr_dc_filter->state;
   48|       |
   49|  6.19M|  inp_2 = inp_1 = (ptr_input[0] / 2);
   50|  6.19M|  out = inp_1 + (*state);
   51|       |
   52|   396M|  for (idx = 1; idx < signal_length; idx++) {
  ------------------
  |  Branch (52:17): [True: 390M, False: 6.19M]
  ------------------
   53|   390M|    inp_1 = ptr_input[idx] / 2;
   54|   390M|    y[idx - 1] = out;
   55|   390M|    out = inp_1 - inp_2 + (exp_const * out);
   56|   390M|    inp_2 = inp_1;
   57|   390M|  }
   58|       |
   59|  6.19M|  *state = (exp_const * out) - inp_2;
   60|  6.19M|  y[idx - 1] = out;
   61|  6.19M|}

ixheaace_mps_212_frame_window_init:
   79|  1.28k|    const ixheaace_mps_pstr_frame_win_config pstr_frame_win_config) {
   80|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
   81|  1.28k|  WORD32 slot;
   82|  1.28k|  WORD32 time_slots = pstr_frame_win_config->num_time_slots_max;
   83|  1.28k|  pstr_frame_win->frame_keep_flag = pstr_frame_win_config->frame_keep_flag;
   84|  1.28k|  pstr_frame_win->num_time_slots_max = pstr_frame_win_config->num_time_slots_max;
   85|  1.28k|  pstr_frame_win->start_slope = 0;
   86|  1.28k|  pstr_frame_win->start_rect = time_slots >> 1;
   87|  1.28k|  pstr_frame_win->stop_slope = ((3 * time_slots) >> 1) - 1;
   88|  1.28k|  pstr_frame_win->stop_rect = time_slots;
   89|  22.5k|  for (slot = 0; slot<time_slots>> 1; slot++) {
  ------------------
  |  Branch (89:18): [True: 21.2k, False: 1.28k]
  ------------------
   90|  21.2k|    pstr_frame_win->p_tapper_sync_flt[slot] = (FLOAT32)slot / time_slots;
   91|  21.2k|  }
   92|  1.28k|  pstr_frame_win->p_tapper_sync_flt[time_slots >> 1] = 1.0f;
   93|  1.28k|  pstr_frame_win->taper_syn_len = time_slots >> 1;
   94|  1.28k|  pstr_frame_win->taper_ana_len = pstr_frame_win->start_rect - pstr_frame_win->start_slope;
   95|  22.5k|  for (slot = 0; slot < pstr_frame_win->taper_ana_len; slot++) {
  ------------------
  |  Branch (95:18): [True: 21.2k, False: 1.28k]
  ------------------
   96|  21.2k|    pstr_frame_win->p_taper_ana_flt[slot] = 1.0f;
   97|  21.2k|  }
   98|       |
   99|  1.28k|  return error;
  100|  1.28k|}
ixheaace_mps_212_frame_window_get_window:
  106|  91.2k|    ixheaace_mps_pstr_frame_win_list const pstr_frame_win_list, const WORD32 avoid_keep) {
  107|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  108|  91.2k|  WORD32 win_cnt = 0;
  109|  91.2k|  WORD32 w, ps;
  110|  91.2k|  WORD32 idx;
  111|  91.2k|  WORD32 param;
  112|  91.2k|  WORD32 start_slope = pstr_frame_win->start_slope;
  113|  91.2k|  WORD32 start_rect = pstr_frame_win->start_rect;
  114|  91.2k|  WORD32 stop_slope = pstr_frame_win->stop_slope;
  115|  91.2k|  WORD32 stop_rect = pstr_frame_win->stop_rect;
  116|  91.2k|  WORD32 taper_ana_len = pstr_frame_win->taper_ana_len;
  117|  91.2k|  FLOAT32 apply_right_window_gain[MAX_NUM_PARAMS];
  118|  91.2k|  FLOAT32 *p_taper_ana = pstr_frame_win->p_taper_ana_flt;
  119|       |
  120|  91.2k|  if ((time_slots > pstr_frame_win->num_time_slots_max) || (time_slots < 0)) {
  ------------------
  |  Branch (120:7): [True: 0, False: 91.2k]
  |  Branch (120:60): [True: 0, False: 91.2k]
  ------------------
  121|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  122|      0|  }
  123|       |
  124|  91.2k|  pstr_frame_win_list->win_list_cnt = 0;
  125|   729k|  for (param = 0; param < MAX_NUM_PARAMS; param++) {
  ------------------
  |  |   42|   729k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (125:19): [True: 638k, False: 91.2k]
  ------------------
  126|   638k|    pstr_frame_win_list->dat[param].slot = -1;
  127|   638k|    pstr_frame_win_list->dat[param].hold = IXHEAACE_MPS_FRAME_WINDOWING_INTP;
  ------------------
  |  |   84|   638k|#define IXHEAACE_MPS_FRAME_WINDOWING_INTP (0)
  ------------------
  128|   638k|  }
  129|  91.2k|  memset(apply_right_window_gain, 0, sizeof(apply_right_window_gain));
  130|  91.2k|  if (tr_pos[0] <= 0) {
  ------------------
  |  Branch (130:7): [True: 91.2k, False: 0]
  ------------------
  131|  91.2k|    win_cnt = 0;
  132|  91.2k|    error = ixheaace_mps_212_frame_window_list_add(pstr_frame_win_list, time_slots - 1,
  133|  91.2k|                                                   IXHEAACE_MPS_FRAME_WINDOWING_INTP);
  ------------------
  |  |   84|  91.2k|#define IXHEAACE_MPS_FRAME_WINDOWING_INTP (0)
  ------------------
  134|  91.2k|    if (error) {
  ------------------
  |  Branch (134:9): [True: 0, False: 91.2k]
  ------------------
  135|      0|      return error;
  136|      0|    }
  137|  91.2k|    for (idx = 0; idx < start_slope; idx++) {
  ------------------
  |  Branch (137:19): [True: 0, False: 91.2k]
  ------------------
  138|      0|      ptr_window_ana[win_cnt][idx] = 0.0f;
  139|      0|    }
  140|  1.63M|    for (idx = 0; idx < taper_ana_len; idx++) {
  ------------------
  |  Branch (140:19): [True: 1.54M, False: 91.2k]
  ------------------
  141|  1.54M|      ptr_window_ana[win_cnt][start_slope + idx] = p_taper_ana[idx];
  142|  1.54M|    }
  143|       |
  144|  1.64M|    for (idx = 0; idx < time_slots - start_rect; idx++) {
  ------------------
  |  Branch (144:19): [True: 1.55M, False: 91.2k]
  ------------------
  145|  1.55M|      ptr_window_ana[win_cnt][start_rect + idx] = 1.0f;
  146|  1.55M|    }
  147|       |
  148|  91.2k|    apply_right_window_gain[win_cnt] = 1.0f;
  149|  91.2k|    win_cnt++;
  150|  91.2k|  } else {
  151|      0|    WORD32 p_l = tr_pos[0];
  152|      0|    win_cnt = 0;
  153|      0|    error = ixheaace_mps_212_frame_window_list_add(pstr_frame_win_list, p_l - 1,
  154|      0|                                                   IXHEAACE_MPS_FRAME_WINDOWING_HOLD);
  ------------------
  |  |   85|      0|#define IXHEAACE_MPS_FRAME_WINDOWING_HOLD (1)
  ------------------
  155|      0|    if (error) {
  ------------------
  |  Branch (155:9): [True: 0, False: 0]
  ------------------
  156|      0|      return error;
  157|      0|    }
  158|      0|    error = ixheaace_mps_212_frame_window_list_add(pstr_frame_win_list, p_l,
  159|      0|                                                   IXHEAACE_MPS_FRAME_WINDOWING_INTP);
  ------------------
  |  |   84|      0|#define IXHEAACE_MPS_FRAME_WINDOWING_INTP (0)
  ------------------
  160|      0|    if (error) {
  ------------------
  |  Branch (160:9): [True: 0, False: 0]
  ------------------
  161|      0|      return error;
  162|      0|    }
  163|       |
  164|      0|    error = ixheaace_mps_212_frame_window_list_limit(pstr_frame_win_list, 0, time_slots - 1);
  165|      0|    if (error) {
  ------------------
  |  Branch (165:9): [True: 0, False: 0]
  ------------------
  166|      0|      return error;
  167|      0|    }
  168|       |
  169|      0|    error = ixheaace_mps_212_frame_window_list_add(pstr_frame_win_list, time_slots - 1,
  170|      0|                                                   IXHEAACE_MPS_FRAME_WINDOWING_HOLD);
  ------------------
  |  |   85|      0|#define IXHEAACE_MPS_FRAME_WINDOWING_HOLD (1)
  ------------------
  171|      0|    if (error) {
  ------------------
  |  Branch (171:9): [True: 0, False: 0]
  ------------------
  172|      0|      return error;
  173|      0|    }
  174|       |
  175|      0|    if (pstr_frame_win_list->win_list_cnt > MAX_NUM_PARAMS) {
  ------------------
  |  |   42|      0|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (175:9): [True: 0, False: 0]
  ------------------
  176|      0|      return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  177|      0|    }
  178|      0|    for (ps = 0; ps < pstr_frame_win_list->win_list_cnt - 1; ps++) {
  ------------------
  |  Branch (178:18): [True: 0, False: 0]
  ------------------
  179|      0|      if (IXHEAACE_MPS_FRAME_WINDOWING_HOLD != pstr_frame_win_list->dat[ps].hold) {
  ------------------
  |  |   85|      0|#define IXHEAACE_MPS_FRAME_WINDOWING_HOLD (1)
  ------------------
  |  Branch (179:11): [True: 0, False: 0]
  ------------------
  180|      0|        WORD32 start = pstr_frame_win_list->dat[ps].slot;
  181|      0|        WORD32 stop = pstr_frame_win_list->dat[ps + 1].slot;
  182|       |
  183|      0|        for (idx = 0; idx < start; idx++) {
  ------------------
  |  Branch (183:23): [True: 0, False: 0]
  ------------------
  184|      0|          ptr_window_ana[win_cnt][idx] = 0.0f;
  185|      0|        }
  186|      0|        for (idx = 0; idx < stop - start + 1; idx++) {
  ------------------
  |  Branch (186:23): [True: 0, False: 0]
  ------------------
  187|      0|          ptr_window_ana[win_cnt][start + idx] = 1.0f;
  188|      0|        }
  189|      0|        for (idx = 0; idx < time_slots - stop - 1; idx++) {
  ------------------
  |  Branch (189:23): [True: 0, False: 0]
  ------------------
  190|      0|          ptr_window_ana[win_cnt][stop + 1 + idx] = 0.0f;
  191|      0|        }
  192|       |
  193|      0|        apply_right_window_gain[win_cnt] = ptr_window_ana[win_cnt][time_slots - 1];
  194|      0|        win_cnt++;
  195|      0|      }
  196|      0|    }
  197|       |
  198|      0|    if (pstr_frame_win_list->win_list_cnt - 1 < 0 ||
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|        pstr_frame_win_list->win_list_cnt - 1 >= MAX_NUM_PARAMS) {
  ------------------
  |  |   42|      0|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (199:9): [True: 0, False: 0]
  ------------------
  200|      0|      return IA_EXHEAACE_CONFIG_NONFATAL_MPS_PARAM_ERROR;
  201|      0|    } else if (pstr_frame_win_list->win_list_cnt > 0) {
  ------------------
  |  Branch (201:16): [True: 0, False: 0]
  ------------------
  202|      0|      if (pstr_frame_win_list->win_list_cnt - 1 == MAX_NUM_PARAMS - 1) {
  ------------------
  |  |   42|      0|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (202:11): [True: 0, False: 0]
  ------------------
  203|      0|        pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt - 1].slot = -1;
  204|      0|        pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt - 1].hold =
  205|      0|            IXHEAACE_MPS_FRAME_WINDOWING_INTP;
  ------------------
  |  |   84|      0|#define IXHEAACE_MPS_FRAME_WINDOWING_INTP (0)
  ------------------
  206|      0|      } else {
  207|      0|        for (param = pstr_frame_win_list->win_list_cnt - 1; param < MAX_NUM_PARAMS - 1; param++) {
  ------------------
  |  |   42|      0|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (207:61): [True: 0, False: 0]
  ------------------
  208|      0|          pstr_frame_win_list->dat[param] = pstr_frame_win_list->dat[param + 1];
  209|      0|        }
  210|      0|      }
  211|      0|      pstr_frame_win_list->win_list_cnt--;
  212|      0|    }
  213|      0|    if (error) {
  ------------------
  |  Branch (213:9): [True: 0, False: 0]
  ------------------
  214|      0|      return error;
  215|      0|    }
  216|      0|  }
  217|       |
  218|   182k|  for (w = 0; w < win_cnt; w++) {
  ------------------
  |  Branch (218:15): [True: 91.2k, False: 91.2k]
  ------------------
  219|  91.2k|    if (apply_right_window_gain[w] <= 0) {
  ------------------
  |  Branch (219:9): [True: 0, False: 91.2k]
  ------------------
  220|      0|      for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (220:21): [True: 0, False: 0]
  ------------------
  221|      0|        ptr_window_ana[w][time_slots + idx] = 0.0f;
  222|      0|      }
  223|  91.2k|    } else {
  224|  91.2k|      if (tr_pos[1] < 0) {
  ------------------
  |  Branch (224:11): [True: 91.2k, False: 0]
  ------------------
  225|   182k|        for (idx = 0; idx < stop_rect - time_slots + 1; idx++) {
  ------------------
  |  Branch (225:23): [True: 91.2k, False: 91.2k]
  ------------------
  226|  91.2k|          ptr_window_ana[w][time_slots + idx] = 1.0f;
  227|  91.2k|        }
  228|  1.63M|        for (idx = 0; idx < taper_ana_len; idx++) {
  ------------------
  |  Branch (228:23): [True: 1.54M, False: 91.2k]
  ------------------
  229|  1.54M|          ptr_window_ana[w][stop_rect + idx] = p_taper_ana[taper_ana_len - 1 - idx];
  230|  1.54M|        }
  231|  1.64M|        for (idx = 0; idx < 2 * time_slots - stop_slope - 1; idx++) {
  ------------------
  |  Branch (231:23): [True: 1.55M, False: 91.2k]
  ------------------
  232|  1.55M|          ptr_window_ana[w][stop_slope + 1 + idx] = 0.0f;
  233|  1.55M|        }
  234|  91.2k|      } else {
  235|      0|        WORD32 p_r = tr_pos[1];
  236|      0|        for (idx = 0; idx < p_r - time_slots; idx++) {
  ------------------
  |  Branch (236:23): [True: 0, False: 0]
  ------------------
  237|      0|          ptr_window_ana[w][time_slots + idx] = 1.0f;
  238|      0|        }
  239|      0|        for (idx = 0; idx < 2 * time_slots - p_r; idx++) {
  ------------------
  |  Branch (239:23): [True: 0, False: 0]
  ------------------
  240|      0|          ptr_window_ana[w][p_r + idx] = 0.0f;
  241|      0|        }
  242|      0|      }
  243|  91.2k|      if (apply_right_window_gain[w] < 1.0f) {
  ------------------
  |  Branch (243:11): [True: 0, False: 91.2k]
  ------------------
  244|      0|        WORD32 slot;
  245|      0|        for (slot = 0; slot < time_slots; slot++) {
  ------------------
  |  Branch (245:24): [True: 0, False: 0]
  ------------------
  246|      0|          ptr_window_ana[w][time_slots + slot] =
  247|      0|              ptr_window_ana[w][time_slots + slot] * apply_right_window_gain[w];
  248|      0|        }
  249|      0|      }
  250|  91.2k|    }
  251|  91.2k|  }
  252|  91.2k|  if (pstr_frame_win->frame_keep_flag == 1) {
  ------------------
  |  Branch (252:7): [True: 91.2k, False: 0]
  ------------------
  253|  3.18M|    for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (253:19): [True: 3.09M, False: 91.2k]
  ------------------
  254|  3.09M|      ptr_window_ana[0][2 * time_slots + idx] = ptr_window_ana[0][time_slots + idx];
  255|  3.09M|      ptr_window_ana[0][time_slots + idx] = ptr_window_ana[0][idx];
  256|  3.09M|    }
  257|  91.2k|    if (avoid_keep == 0) {
  ------------------
  |  Branch (257:9): [True: 39.5k, False: 51.6k]
  ------------------
  258|  1.40M|      for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (258:21): [True: 1.36M, False: 39.5k]
  ------------------
  259|  1.36M|        ptr_window_ana[0][idx] = 1.0f;
  260|  1.36M|      }
  261|  51.6k|    } else {
  262|  1.78M|      for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (262:21): [True: 1.73M, False: 51.6k]
  ------------------
  263|  1.73M|        ptr_window_ana[0][idx] = 0.0f;
  264|  1.73M|      }
  265|  51.6k|    }
  266|  91.2k|  }
  267|  91.2k|  pstr_framing_info->num_param_sets = pstr_frame_win_list->win_list_cnt;
  268|  91.2k|  pstr_framing_info->bs_framing_type = 1;
  269|   182k|  for (ps = 0; ps < pstr_framing_info->num_param_sets; ps++) {
  ------------------
  |  Branch (269:16): [True: 91.2k, False: 91.2k]
  ------------------
  270|  91.2k|    pstr_framing_info->bs_param_slots[ps] = pstr_frame_win_list->dat[ps].slot;
  271|  91.2k|  }
  272|  91.2k|  if ((pstr_framing_info->num_param_sets == 1) &&
  ------------------
  |  Branch (272:7): [True: 91.2k, False: 0]
  ------------------
  273|  91.2k|      (pstr_framing_info->bs_param_slots[0] == time_slots - 1)) {
  ------------------
  |  Branch (273:7): [True: 91.2k, False: 0]
  ------------------
  274|  91.2k|    pstr_framing_info->bs_framing_type = 0;
  275|  91.2k|  }
  276|  91.2k|  return error;
  277|  91.2k|}
ixheaace_mps_212_analysis_windowing:
  283|   182k|    const WORD32 num_hybrid_bands) {
  284|   182k|  WORD32 band, slot;
  285|   182k|  FLOAT32 win;
  286|       |
  287|  12.1M|  for (slot = start_time_slot; slot < num_time_slots; slot++) {
  ------------------
  |  Branch (287:32): [True: 12.0M, False: 182k]
  ------------------
  288|  12.0M|    win = ptr_window_ana[slot];
  289|  12.0M|    if (win != 1.0f) {
  ------------------
  |  Branch (289:9): [True: 0, False: 12.0M]
  ------------------
  290|      0|      for (band = 0; band < num_hybrid_bands; band++) {
  ------------------
  |  Branch (290:22): [True: 0, False: 0]
  ------------------
  291|      0|        pp_cmplx_data_out[slot][band].re = win * pp_cmplx_data_in[slot][band].re;
  292|      0|        pp_cmplx_data_out[slot][band].im = win * pp_cmplx_data_in[slot][band].im;
  293|      0|      }
  294|  12.0M|    } else {
  295|   780M|      for (band = 0; band < num_hybrid_bands; band++) {
  ------------------
  |  Branch (295:22): [True: 768M, False: 12.0M]
  ------------------
  296|   768M|        pp_cmplx_data_out[slot][band].re = pp_cmplx_data_in[slot][band].re;
  297|   768M|        pp_cmplx_data_out[slot][band].im = pp_cmplx_data_in[slot][band].im;
  298|   768M|      }
  299|  12.0M|    }
  300|  12.0M|  }
  301|   182k|}
ixheaace_mps_frame_windowing.c:ixheaace_mps_212_frame_window_list_add:
   60|  91.2k|    const WORD32 hold) {
   61|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
   62|       |
   63|  91.2k|  if (pstr_frame_win_list->win_list_cnt >= MAX_NUM_PARAMS) {
  ------------------
  |  |   42|  91.2k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (63:7): [True: 0, False: 91.2k]
  ------------------
   64|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_PARAM_ERROR;
   65|  91.2k|  } else if (pstr_frame_win_list->win_list_cnt > 0 &&
  ------------------
  |  Branch (65:14): [True: 0, False: 91.2k]
  ------------------
   66|      0|             pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt - 1].slot - slot > 0) {
  ------------------
  |  Branch (66:14): [True: 0, False: 0]
  ------------------
   67|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_PARAM_ERROR;
   68|  91.2k|  } else {
   69|  91.2k|    pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt].hold = hold;
   70|  91.2k|    pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt].slot = slot;
   71|  91.2k|    pstr_frame_win_list->win_list_cnt++;
   72|  91.2k|  }
   73|  91.2k|  return error;
   74|  91.2k|}

ixheaace_mps_515_apply_ana_hyb_filterbank:
  859|   131k|    FLOAT32 *ptr_hybrid_imag) {
  860|   131k|  WORD32 nr_samples_shift_lf;
  861|   131k|  WORD32 nr_qmf_bands_lf;
  862|   131k|  WORD32 k, n;
  863|   131k|  WORD32 time_slot, ch_offset;
  864|       |
  865|   131k|  FLOAT32 m_temp_output_real[MAX_HYBRID_ONLY_BANDS_PER_QMF] = {0};
  866|   131k|  FLOAT32 m_temp_output_imag[MAX_HYBRID_ONLY_BANDS_PER_QMF] = {0};
  867|       |
  868|   131k|  nr_samples_shift_lf = BUFFER_LEN_LF - nr_samples;
  ------------------
  |  |   32|   131k|#define BUFFER_LEN_LF (PROTO_LEN - 1 + MAX_TIME_SLOTS)
  |  |  ------------------
  |  |  |  |   31|   131k|#define PROTO_LEN (13)
  |  |  ------------------
  |  |               #define BUFFER_LEN_LF (PROTO_LEN - 1 + MAX_TIME_SLOTS)
  |  |  ------------------
  |  |  |  |   44|   131k|#define MAX_TIME_SLOTS (64)
  |  |  ------------------
  ------------------
  869|       |
  870|   131k|  nr_qmf_bands_lf = NUM_QMF_BANDS_TO_LF;
  ------------------
  |  |   39|   131k|#define NUM_QMF_BANDS_TO_LF (3)
  ------------------
  871|   527k|  for (k = 0; k < nr_qmf_bands_lf; k++) {
  ------------------
  |  Branch (871:15): [True: 395k, False: 131k]
  ------------------
  872|  24.3M|    for (n = 0; n < nr_samples_shift_lf; n++) {
  ------------------
  |  Branch (872:17): [True: 23.9M, False: 395k]
  ------------------
  873|  23.9M|      pstr_hyb_filter_state->buffer_lf_real[k][n] =
  874|  23.9M|          pstr_hyb_filter_state->buffer_lf_real[k][n + nr_samples];
  875|  23.9M|      pstr_hyb_filter_state->buffer_lf_imag[k][n] =
  876|  23.9M|          pstr_hyb_filter_state->buffer_lf_imag[k][n + nr_samples];
  877|  23.9M|    }
  878|   395k|  }
  879|       |
  880|   527k|  for (k = 0; k < nr_qmf_bands_lf; k++) {
  ------------------
  |  Branch (880:15): [True: 395k, False: 131k]
  ------------------
  881|  6.53M|    for (n = 0; n < nr_samples; n++) {
  ------------------
  |  Branch (881:17): [True: 6.13M, False: 395k]
  ------------------
  882|  6.13M|      pstr_hyb_filter_state->buffer_lf_real[k][n + nr_samples_shift_lf] =
  883|  6.13M|          ptr_qmf_real[n * NUM_QMF_BANDS + k];
  ------------------
  |  |   43|  6.13M|#define NUM_QMF_BANDS (64)
  ------------------
  884|  6.13M|      pstr_hyb_filter_state->buffer_lf_imag[k][n + nr_samples_shift_lf] =
  885|  6.13M|          ptr_qmf_imag[n * NUM_QMF_BANDS + k];
  ------------------
  |  |   43|  6.13M|#define NUM_QMF_BANDS (64)
  ------------------
  886|  6.13M|    }
  887|   395k|  }
  888|  8.18M|  for (k = 0; k < NUM_QMF_BANDS - nr_qmf_bands_lf; k++) {
  ------------------
  |  |   43|  8.18M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (888:15): [True: 8.05M, False: 131k]
  ------------------
  889|  56.3M|    for (n = 0; n < BUFFER_LEN_HF; n++) {
  ------------------
  |  |   34|  56.3M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  56.3M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
  |  Branch (889:17): [True: 48.3M, False: 8.05M]
  ------------------
  890|  48.3M|      ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  48.3M|#define MAX_HYBRID_BANDS (71)
  ------------------
  891|  48.3M|          pstr_hyb_filter_state->buffer_hf_real[k][n];
  892|  48.3M|      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  48.3M|#define MAX_HYBRID_BANDS (71)
  ------------------
  893|  48.3M|          pstr_hyb_filter_state->buffer_hf_imag[k][n];
  894|       |
  895|  48.3M|      pstr_hyb_filter_state->buffer_hf_real[k][n] =
  896|  48.3M|          ptr_qmf_real[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  48.3M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  48.3M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_real[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  48.3M|#define NUM_QMF_BANDS (64)
  ------------------
  897|  48.3M|      pstr_hyb_filter_state->buffer_hf_imag[k][n] =
  898|  48.3M|          ptr_qmf_imag[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  48.3M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  48.3M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_imag[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  48.3M|#define NUM_QMF_BANDS (64)
  ------------------
  899|  48.3M|    }
  900|  8.05M|  }
  901|       |
  902|  8.18M|  for (k = 0; k < NUM_QMF_BANDS - nr_qmf_bands_lf; k++) {
  ------------------
  |  |   43|  8.18M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (902:15): [True: 8.05M, False: 131k]
  ------------------
  903|  84.5M|    for (n = BUFFER_LEN_HF; n < nr_samples; n++) {
  ------------------
  |  |   34|  8.05M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  8.05M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
  |  Branch (903:29): [True: 76.4M, False: 8.05M]
  ------------------
  904|  76.4M|      ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  76.4M|#define MAX_HYBRID_BANDS (71)
  ------------------
  905|  76.4M|          ptr_qmf_real[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  76.4M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  76.4M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_real[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  76.4M|#define NUM_QMF_BANDS (64)
  ------------------
  906|  76.4M|      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  76.4M|#define MAX_HYBRID_BANDS (71)
  ------------------
  907|  76.4M|          ptr_qmf_imag[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  76.4M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  76.4M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_imag[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  76.4M|#define NUM_QMF_BANDS (64)
  ------------------
  908|  76.4M|    }
  909|  8.05M|  }
  910|       |
  911|  2.17M|  for (time_slot = 0; time_slot < nr_samples; time_slot++) {
  ------------------
  |  Branch (911:23): [True: 2.04M, False: 131k]
  ------------------
  912|  2.04M|    ch_offset = 0;
  913|       |
  914|  2.04M|    ixheaace_mps_eight_channel_filtering(
  915|  2.04M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_real[0][nr_samples_shift_lf + 1 -
  916|  2.04M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  2.04M|#define PROTO_LEN (13)
  ------------------
  917|  2.04M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_imag[0][nr_samples_shift_lf + 1 -
  918|  2.04M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  2.04M|#define PROTO_LEN (13)
  ------------------
  919|  2.04M|        m_temp_output_real, m_temp_output_imag);
  920|       |
  921|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 0] = m_temp_output_real[6];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  922|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 0] = m_temp_output_imag[6];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  923|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_real[7];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  924|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_imag[7];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  925|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 2] = m_temp_output_real[0];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  926|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 2] = m_temp_output_imag[0];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  927|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 3] = m_temp_output_real[1];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  928|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 3] = m_temp_output_imag[1];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  929|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 4] =
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  930|  2.04M|        m_temp_output_real[2] + m_temp_output_real[5];
  931|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 4] =
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  932|  2.04M|        m_temp_output_imag[2] + m_temp_output_imag[5];
  933|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 5] =
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  934|  2.04M|        m_temp_output_real[3] + m_temp_output_real[4];
  935|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 5] =
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  936|  2.04M|        m_temp_output_imag[3] + m_temp_output_imag[4];
  937|       |
  938|  2.04M|    ch_offset += 6;
  939|       |
  940|  2.04M|    ixheaace_mps_two_channel_filtering(
  941|  2.04M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_real[1][nr_samples_shift_lf + 1 -
  942|  2.04M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  2.04M|#define PROTO_LEN (13)
  ------------------
  943|  2.04M|        m_temp_output_real);
  944|  2.04M|    ixheaace_mps_two_channel_filtering(
  945|  2.04M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_imag[1][nr_samples_shift_lf + 1 -
  946|  2.04M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  2.04M|#define PROTO_LEN (13)
  ------------------
  947|  2.04M|        m_temp_output_imag);
  948|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_real[1];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  949|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_imag[1];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  950|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_real[0];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  951|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_imag[0];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  952|       |
  953|  2.04M|    ch_offset += 2;
  954|       |
  955|  2.04M|    ixheaace_mps_two_channel_filtering(
  956|  2.04M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_real[2][nr_samples_shift_lf + 1 -
  957|  2.04M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  2.04M|#define PROTO_LEN (13)
  ------------------
  958|  2.04M|        m_temp_output_real);
  959|  2.04M|    ixheaace_mps_two_channel_filtering(
  960|  2.04M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_imag[2][nr_samples_shift_lf + 1 -
  961|  2.04M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  2.04M|#define PROTO_LEN (13)
  ------------------
  962|  2.04M|        m_temp_output_imag);
  963|       |
  964|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_real[0];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  965|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_imag[0];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  966|  2.04M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_real[1];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  967|  2.04M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_imag[1];
  ------------------
  |  |   23|  2.04M|#define MAX_HYBRID_BANDS (71)
  ------------------
  968|  2.04M|  }
  969|   131k|}
ixheaace_mps_515_apply_syn_hyb_filterbank:
  973|  36.1k|                                               FLOAT32 *ptr_qmf_imag) {
  974|  36.1k|  WORD32 k, n;
  975|       |
  976|   596k|  for (n = 0; n < nr_samples; n++) {
  ------------------
  |  Branch (976:15): [True: 560k, False: 36.1k]
  ------------------
  977|   560k|    ptr_qmf_real[n * NUM_QMF_BANDS] = ptr_hybrid_real[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
                  ptr_qmf_real[n * NUM_QMF_BANDS] = ptr_hybrid_real[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
  978|   560k|    ptr_qmf_imag[n * NUM_QMF_BANDS] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
                  ptr_qmf_imag[n * NUM_QMF_BANDS] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
  979|       |
  980|  3.36M|    for (k = 1; k < 6; k++) {
  ------------------
  |  Branch (980:17): [True: 2.80M, False: 560k]
  ------------------
  981|  2.80M|      ptr_qmf_real[n * NUM_QMF_BANDS] += ptr_hybrid_real[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_real[n * NUM_QMF_BANDS] += ptr_hybrid_real[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   23|  2.80M|#define MAX_HYBRID_BANDS (71)
  ------------------
  982|  2.80M|      ptr_qmf_imag[n * NUM_QMF_BANDS] += ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_imag[n * NUM_QMF_BANDS] += ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   23|  2.80M|#define MAX_HYBRID_BANDS (71)
  ------------------
  983|  2.80M|    }
  984|       |
  985|   560k|    ptr_qmf_real[n * NUM_QMF_BANDS + 1] =
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  986|   560k|        ptr_hybrid_real[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_real[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
  987|   560k|    ptr_qmf_imag[n * NUM_QMF_BANDS + 1] =
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  988|   560k|        ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
  989|       |
  990|   560k|    ptr_qmf_real[n * NUM_QMF_BANDS + 2] =
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  991|   560k|        ptr_hybrid_real[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_real[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
  992|   560k|    ptr_qmf_imag[n * NUM_QMF_BANDS + 2] =
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  993|   560k|        ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   560k|#define MAX_HYBRID_BANDS (71)
  ------------------
  994|       |
  995|  34.7M|    for (k = 0; k < 61; k++) {
  ------------------
  |  Branch (995:17): [True: 34.1M, False: 560k]
  ------------------
  996|  34.1M|      ptr_qmf_real[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   43|  34.1M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_real[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   23|  34.1M|#define MAX_HYBRID_BANDS (71)
  ------------------
  997|  34.1M|      ptr_qmf_imag[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   43|  34.1M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_imag[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   23|  34.1M|#define MAX_HYBRID_BANDS (71)
  ------------------
  998|  34.1M|    }
  999|   560k|  }
 1000|  36.1k|}
ixheaace_mps_hybrid_filter.c:ixheaace_mps_eight_channel_filtering:
  788|  2.04M|                                                         FLOAT32 *ptr_hybrid_imag) {
  789|  2.04M|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.04M|#define IA_NO_ERROR 0x00000000
  ------------------
  790|  2.04M|  WORD32 idx;
  791|  2.04M|  FLOAT32 ptr_real, ptr_imag;
  792|  2.04M|  FLOAT32 cum[16];
  793|       |
  794|  2.04M|  cum[0] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_real[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  2.04M|#define HYBRID_FILTER_DELAY (6)
  ------------------
                cum[0] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_real[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  2.04M|#define HYBRID_FILTER_DELAY (6)
  ------------------
  795|  2.04M|  cum[1] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_imag[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  2.04M|#define HYBRID_FILTER_DELAY (6)
  ------------------
                cum[1] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_imag[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  2.04M|#define HYBRID_FILTER_DELAY (6)
  ------------------
  796|       |
  797|  2.04M|  ptr_real = p8_13[5] * ptr_qmf_real[5];
  798|  2.04M|  ptr_imag = p8_13[5] * ptr_qmf_imag[5];
  799|  2.04M|  cum[2] = ptr_real * COS_22_5 - ptr_imag * SIN_22_5;
  ------------------
  |  |  173|  2.04M|#define COS_22_5 (0.92387953251129f)
  ------------------
                cum[2] = ptr_real * COS_22_5 - ptr_imag * SIN_22_5;
  ------------------
  |  |  176|  2.04M|#define SIN_22_5 (0.38268343236509f)
  ------------------
  800|  2.04M|  cum[3] = ptr_real * COS_67_5 + ptr_imag * SIN_67_5;
  ------------------
  |  |  174|  2.04M|#define COS_67_5 (0.38268343236509f)
  ------------------
                cum[3] = ptr_real * COS_67_5 + ptr_imag * SIN_67_5;
  ------------------
  |  |  175|  2.04M|#define SIN_67_5 (0.92387953251129f)
  ------------------
  801|       |
  802|  2.04M|  ptr_real = p8_13[4] * ptr_qmf_real[4] + p8_13[12] * ptr_qmf_real[12];
  803|  2.04M|  ptr_imag = p8_13[4] * ptr_qmf_imag[4] + p8_13[12] * ptr_qmf_imag[12];
  804|  2.04M|  cum[4] = (ptr_imag - ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  2.04M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  805|  2.04M|  cum[5] = -(ptr_imag + ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  2.04M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  806|       |
  807|  2.04M|  ptr_real = p8_13[3] * ptr_qmf_real[3] + p8_13[11] * ptr_qmf_real[11];
  808|  2.04M|  ptr_imag = p8_13[3] * ptr_qmf_imag[3] + p8_13[11] * ptr_qmf_imag[11];
  809|  2.04M|  cum[6] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  175|  2.04M|#define SIN_67_5 (0.92387953251129f)
  ------------------
                cum[6] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  174|  2.04M|#define COS_67_5 (0.38268343236509f)
  ------------------
  810|  2.04M|  cum[7] = -(ptr_imag * SIN_22_5 + ptr_real * COS_22_5);
  ------------------
  |  |  176|  2.04M|#define SIN_22_5 (0.38268343236509f)
  ------------------
                cum[7] = -(ptr_imag * SIN_22_5 + ptr_real * COS_22_5);
  ------------------
  |  |  173|  2.04M|#define COS_22_5 (0.92387953251129f)
  ------------------
  811|  2.04M|  cum[9] = -(p8_13[2] * ptr_qmf_real[2] + p8_13[10] * ptr_qmf_real[10]);
  812|  2.04M|  cum[8] = p8_13[2] * ptr_qmf_imag[2] + p8_13[10] * ptr_qmf_imag[10];
  813|       |
  814|  2.04M|  ptr_real = p8_13[1] * ptr_qmf_real[1] + p8_13[9] * ptr_qmf_real[9];
  815|  2.04M|  ptr_imag = p8_13[1] * ptr_qmf_imag[1] + p8_13[9] * ptr_qmf_imag[9];
  816|  2.04M|  cum[10] = ptr_imag * SIN_67_5 + ptr_real * COS_67_5;
  ------------------
  |  |  175|  2.04M|#define SIN_67_5 (0.92387953251129f)
  ------------------
                cum[10] = ptr_imag * SIN_67_5 + ptr_real * COS_67_5;
  ------------------
  |  |  174|  2.04M|#define COS_67_5 (0.38268343236509f)
  ------------------
  817|  2.04M|  cum[11] = ptr_imag * SIN_22_5 - ptr_real * COS_22_5;
  ------------------
  |  |  176|  2.04M|#define SIN_22_5 (0.38268343236509f)
  ------------------
                cum[11] = ptr_imag * SIN_22_5 - ptr_real * COS_22_5;
  ------------------
  |  |  173|  2.04M|#define COS_22_5 (0.92387953251129f)
  ------------------
  818|       |
  819|  2.04M|  ptr_real = p8_13[0] * ptr_qmf_real[0] + p8_13[8] * ptr_qmf_real[8];
  820|  2.04M|  ptr_imag = p8_13[0] * ptr_qmf_imag[0] + p8_13[8] * ptr_qmf_imag[8];
  821|  2.04M|  cum[12] = (ptr_imag + ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  2.04M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  822|  2.04M|  cum[13] = (ptr_imag - ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  2.04M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  823|       |
  824|  2.04M|  ptr_real = p8_13[7] * ptr_qmf_real[7];
  825|  2.04M|  ptr_imag = p8_13[7] * ptr_qmf_imag[7];
  826|  2.04M|  cum[14] = ptr_imag * SIN_22_5 + ptr_real * COS_22_5;
  ------------------
  |  |  176|  2.04M|#define SIN_22_5 (0.38268343236509f)
  ------------------
                cum[14] = ptr_imag * SIN_22_5 + ptr_real * COS_22_5;
  ------------------
  |  |  173|  2.04M|#define COS_22_5 (0.92387953251129f)
  ------------------
  827|  2.04M|  cum[15] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  175|  2.04M|#define SIN_67_5 (0.92387953251129f)
  ------------------
                cum[15] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  174|  2.04M|#define COS_67_5 (0.38268343236509f)
  ------------------
  828|       |
  829|  2.04M|  error = ixheaace_mps_cfftn_process(&cum[0], &cum[1], 8, 8, 8, 2);
  830|  2.04M|  if (error) {
  ------------------
  |  Branch (830:7): [True: 0, False: 2.04M]
  ------------------
  831|      0|    return error;
  832|      0|  }
  833|  18.4M|  for (idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (833:17): [True: 16.3M, False: 2.04M]
  ------------------
  834|  16.3M|    ptr_hybrid_real[idx] = cum[2 * idx];
  835|  16.3M|    ptr_hybrid_imag[idx] = cum[2 * idx + 1];
  836|  16.3M|  }
  837|  2.04M|  return error;
  838|  2.04M|}
ixheaace_mps_hybrid_filter.c:ixheaace_mps_cfftn_process:
   42|  2.04M|                                               WORD32 i_sign) {
   43|  2.04M|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.04M|#define IA_NO_ERROR 0x00000000
  ------------------
   44|  2.04M|  WORD32 repeat = 0;
   45|  2.04M|  FLOAT64 sine_60 = SIN_60;
  ------------------
  |  |  170|  2.04M|#define SIN_60 0.86602540378443865
  ------------------
   46|  2.04M|  FLOAT64 cos_72 = COS_72;
  ------------------
  |  |  171|  2.04M|#define COS_72 0.30901699437494742
  ------------------
   47|  2.04M|  FLOAT64 sin_72 = SIN_72;
  ------------------
  |  |  172|  2.04M|#define SIN_72 0.95105651629515357
  ------------------
   48|  2.04M|  FLOAT64 pi2 = M_PI;
   49|  2.04M|  WORD32 ii, mfactor, kspan, ispan, inc;
   50|  2.04M|  WORD32 j, jc, jf, jj, k, k1, k2, k3 = 0, k4, kk, kt, nn, ns, nt;
   51|       |
   52|  2.04M|  FLOAT64 radf;
   53|  2.04M|  FLOAT64 c1, c2 = 0.0, c3 = 0.0, cd;
   54|  2.04M|  FLOAT64 s1, s2 = 0.0, s3 = 0.0, sd;
   55|  2.04M|  FLOAT32 temp_real, temp_imag, temp_real_1, temp_imag_1, temp_real_2, temp_imag_2, temp_real_3,
   56|  2.04M|      temp_imag_3, temp_real_4, temp_imag_4, aj, bj, aa, bb;
   57|       |
   58|  2.04M|  FLOAT32 temp_real_array[MAX_FACTORS] = {0};
   59|  2.04M|  FLOAT32 temp_imag_array[MAX_FACTORS] = {0};
   60|  2.04M|  FLOAT64 cos_array[MAX_FACTORS] = {0};
   61|  2.04M|  FLOAT64 sin_array[MAX_FACTORS] = {0};
   62|       |
   63|  2.04M|  WORD32 perm[MAX_PERM] = {0};
   64|  2.04M|  WORD32 factor[NFACTOR] = {0};
   65|  2.04M|  if (n_pass < 2) {
  ------------------
  |  Branch (65:7): [True: 0, False: 2.04M]
  ------------------
   66|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_CFFT_PROCESS;
   67|      0|  }
   68|       |
   69|  2.04M|  ptr_real--;
   70|  2.04M|  ptr_imag--;
   71|  2.04M|  inc = i_sign;
   72|  2.04M|  if (i_sign < 0) {
  ------------------
  |  Branch (72:7): [True: 0, False: 2.04M]
  ------------------
   73|      0|    sin_72 = -sin_72;
   74|      0|    sine_60 = -sine_60;
   75|      0|    pi2 = -pi2;
   76|      0|    inc = -inc;
   77|      0|  }
   78|  2.04M|  ii = 0;
   79|  2.04M|  jf = 0;
   80|  2.04M|  mfactor = 0;
   81|  2.04M|  j = 3;
   82|       |
   83|  2.04M|  nt = inc * n_total;
   84|  2.04M|  ns = inc * n_span;
   85|  2.04M|  kspan = ns;
   86|  2.04M|  nn = nt - inc;
   87|  2.04M|  jc = ns / n_pass;
   88|  2.04M|  radf = pi2 * (FLOAT64)jc;
   89|  2.04M|  pi2 *= 2.0;
   90|  2.04M|  k = n_pass;
   91|       |
   92|  2.04M|  while (k % 16 == 0) {
  ------------------
  |  Branch (92:10): [True: 0, False: 2.04M]
  ------------------
   93|      0|    mfactor++;
   94|      0|    factor[mfactor - 1] = 4;
   95|      0|    k /= 16;
   96|      0|  }
   97|       |
   98|  2.04M|  jj = 9;
   99|  2.04M|  do {
  100|  2.04M|    while (k % jj == 0) {
  ------------------
  |  Branch (100:12): [True: 0, False: 2.04M]
  ------------------
  101|      0|      mfactor++;
  102|      0|      factor[mfactor - 1] = j;
  103|      0|      k /= jj;
  104|      0|    }
  105|  2.04M|    j += 2;
  106|  2.04M|    jj = j * j;
  107|  2.04M|  } while (jj <= k);
  ------------------
  |  Branch (107:12): [True: 0, False: 2.04M]
  ------------------
  108|       |
  109|  2.04M|  if (k > 4) {
  ------------------
  |  Branch (109:7): [True: 2.04M, False: 0]
  ------------------
  110|  2.04M|    if (k - (k / 4 << 2) == 0) {
  ------------------
  |  Branch (110:9): [True: 2.04M, False: 0]
  ------------------
  111|  2.04M|      mfactor++;
  112|  2.04M|      factor[mfactor - 1] = 2;
  113|  2.04M|      k /= 4;
  114|  2.04M|    }
  115|       |
  116|  2.04M|    kt = mfactor;
  117|  2.04M|    j = 2;
  118|       |
  119|  2.04M|    do {
  120|  2.04M|      if (k % j == 0) {
  ------------------
  |  Branch (120:11): [True: 2.04M, False: 0]
  ------------------
  121|  2.04M|        mfactor++;
  122|  2.04M|        factor[mfactor - 1] = j;
  123|  2.04M|        k /= j;
  124|  2.04M|      }
  125|  2.04M|      j = ((j + 1) / 2 << 1) + 1;
  126|  2.04M|    } while (j <= k);
  ------------------
  |  Branch (126:14): [True: 0, False: 2.04M]
  ------------------
  127|  2.04M|  } else {
  128|      0|    kt = mfactor;
  129|      0|    factor[mfactor] = k;
  130|      0|    if (k != 1) {
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|      mfactor++;
  132|      0|    }
  133|      0|  }
  134|       |
  135|  2.04M|  if (kt) {
  ------------------
  |  Branch (135:7): [True: 2.04M, False: 0]
  ------------------
  136|  2.04M|    j = kt;
  137|  2.04M|    do {
  138|  2.04M|      mfactor++;
  139|  2.04M|      factor[mfactor - 1] = factor[j - 1];
  140|  2.04M|      j--;
  141|  2.04M|    } while (j);
  ------------------
  |  Branch (141:14): [True: 0, False: 2.04M]
  ------------------
  142|  2.04M|  }
  143|       |
  144|  2.04M|  if (mfactor > NFACTOR) {
  ------------------
  |  |  166|  2.04M|#define NFACTOR 11
  ------------------
  |  Branch (144:7): [True: 0, False: 2.04M]
  ------------------
  145|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_CFFT_PROCESS;
  146|      0|  }
  147|       |
  148|  6.13M|  do {
  149|  6.13M|    sd = radf / (FLOAT64)kspan;
  150|  6.13M|    cd = sin(sd);
  151|  6.13M|    cd = 2.0 * cd * cd;
  152|  6.13M|    sd = sin(sd + sd);
  153|  6.13M|    kk = 1;
  154|  6.13M|    ii++;
  155|  6.13M|    switch (factor[ii - 1]) {
  156|      0|      case 4:
  ------------------
  |  Branch (156:7): [True: 0, False: 6.13M]
  ------------------
  157|      0|        ispan = kspan;
  158|      0|        (VOID) ispan;
  159|      0|        kspan /= 4;
  160|       |
  161|      0|        do {
  162|      0|          c1 = 1.0;
  163|      0|          s1 = 0.0;
  164|      0|          do {
  165|      0|            do {
  166|      0|              k1 = kk + kspan;
  167|      0|              k2 = k1 + kspan;
  168|      0|              k3 = k2 + kspan;
  169|       |
  170|      0|              temp_real_1 = ptr_real[kk] + ptr_real[k2];
  171|      0|              temp_real_4 = ptr_real[kk] - ptr_real[k2];
  172|      0|              temp_real_2 = ptr_real[k1] + ptr_real[k3];
  173|      0|              temp_real_3 = ptr_real[k1] - ptr_real[k3];
  174|      0|              temp_imag_1 = ptr_imag[kk] + ptr_imag[k2];
  175|      0|              temp_imag_4 = ptr_imag[kk] - ptr_imag[k2];
  176|      0|              temp_imag_2 = ptr_imag[k1] + ptr_imag[k3];
  177|      0|              temp_imag_3 = ptr_imag[k1] - ptr_imag[k3];
  178|       |
  179|      0|              ptr_real[kk] = temp_real_1 + temp_real_2;
  180|      0|              ptr_imag[kk] = temp_imag_1 + temp_imag_2;
  181|       |
  182|      0|              temp_real_2 = temp_real_1 - temp_real_2;
  183|      0|              temp_imag_2 = temp_imag_1 - temp_imag_2;
  184|       |
  185|      0|              if (i_sign >= 0) {
  ------------------
  |  Branch (185:19): [True: 0, False: 0]
  ------------------
  186|      0|                temp_real_1 = temp_real_4 - temp_imag_3;
  187|      0|                temp_imag_1 = temp_imag_4 + temp_real_3;
  188|      0|                temp_real_4 += temp_imag_3;
  189|      0|                temp_imag_4 -= temp_real_3;
  190|      0|              } else {
  191|      0|                temp_real_1 = temp_real_4 + temp_imag_3;
  192|      0|                temp_imag_1 = temp_imag_4 - temp_real_3;
  193|      0|                temp_real_4 -= temp_imag_3;
  194|      0|                temp_imag_4 += temp_real_3;
  195|      0|              }
  196|       |
  197|      0|              if (s1 == 0.0) {
  ------------------
  |  Branch (197:19): [True: 0, False: 0]
  ------------------
  198|      0|                ptr_real[k1] = temp_real_1;
  199|      0|                ptr_real[k2] = temp_real_2;
  200|      0|                ptr_real[k3] = temp_real_4;
  201|      0|                ptr_imag[k1] = temp_imag_1;
  202|      0|                ptr_imag[k2] = temp_imag_2;
  203|      0|                ptr_imag[k3] = temp_imag_4;
  204|      0|              } else {
  205|      0|                ptr_real[k1] = (FLOAT32)(temp_real_1 * c1 - temp_imag_1 * s1);
  206|      0|                ptr_real[k2] = (FLOAT32)(temp_real_2 * c2 - temp_imag_2 * s2);
  207|      0|                ptr_real[k3] = (FLOAT32)(temp_real_4 * c3 - temp_imag_4 * s3);
  208|       |
  209|      0|                ptr_imag[k1] = (FLOAT32)(temp_real_1 * s1 + temp_imag_1 * c1);
  210|      0|                ptr_imag[k2] = (FLOAT32)(temp_real_2 * s2 + temp_imag_2 * c2);
  211|      0|                ptr_imag[k3] = (FLOAT32)(temp_real_4 * s3 + temp_imag_4 * c3);
  212|      0|              }
  213|       |
  214|      0|              kk = k3 + kspan;
  215|      0|            } while (kk <= nt);
  ------------------
  |  Branch (215:22): [True: 0, False: 0]
  ------------------
  216|       |
  217|      0|            c2 = c1 - (cd * c1 + sd * s1);
  218|      0|            s1 = sd * c1 - cd * s1 + s1;
  219|       |
  220|      0|            c1 = 2.0 - (c2 * c2 + s1 * s1);
  221|      0|            s1 *= c1;
  222|      0|            c1 *= c2;
  223|       |
  224|      0|            c2 = c1 * c1 - s1 * s1;
  225|      0|            s2 = 2.0 * c1 * s1;
  226|       |
  227|      0|            c3 = c2 * c1 - s2 * s1;
  228|      0|            s3 = c2 * s1 + s2 * c1;
  229|       |
  230|      0|            kk = kk - nt + jc;
  231|      0|          } while (kk <= kspan);
  ------------------
  |  Branch (231:20): [True: 0, False: 0]
  ------------------
  232|      0|          kk = kk - kspan + inc;
  233|       |
  234|      0|        } while (kk <= jc);
  ------------------
  |  Branch (234:18): [True: 0, False: 0]
  ------------------
  235|      0|        if (kspan == jc) {
  ------------------
  |  Branch (235:13): [True: 0, False: 0]
  ------------------
  236|      0|          repeat = 1;
  237|      0|          break;
  238|      0|        }
  239|      0|        break;
  240|  6.13M|      case 2:
  ------------------
  |  Branch (240:7): [True: 6.13M, False: 0]
  ------------------
  241|  6.13M|        kspan /= 2;
  242|  6.13M|        k1 = kspan + 2;
  243|  6.13M|        do {
  244|  14.3M|          do {
  245|  14.3M|            k2 = kk + kspan;
  246|  14.3M|            temp_real = ptr_real[k2];
  247|  14.3M|            temp_imag = ptr_imag[k2];
  248|  14.3M|            ptr_real[k2] = ptr_real[kk] - temp_real;
  249|  14.3M|            ptr_imag[k2] = ptr_imag[kk] - temp_imag;
  250|  14.3M|            ptr_real[kk] += temp_real;
  251|  14.3M|            ptr_imag[kk] += temp_imag;
  252|  14.3M|            kk = k2 + kspan;
  253|  14.3M|          } while (kk <= nn);
  ------------------
  |  Branch (253:20): [True: 8.18M, False: 6.13M]
  ------------------
  254|       |
  255|  6.13M|          kk -= nn;
  256|  6.13M|        } while (kk <= jc);
  ------------------
  |  Branch (256:18): [True: 0, False: 6.13M]
  ------------------
  257|       |
  258|  6.13M|        if (kk > kspan) {
  ------------------
  |  Branch (258:13): [True: 2.04M, False: 4.09M]
  ------------------
  259|  2.04M|          repeat = 1;
  260|  2.04M|          break;
  261|  2.04M|        }
  262|       |
  263|  4.09M|        do {
  264|  4.09M|          c1 = 1.0 - cd;
  265|  4.09M|          s1 = sd;
  266|  6.13M|          do {
  267|  8.18M|            do {
  268|  10.2M|              do {
  269|  10.2M|                k2 = kk + kspan;
  270|  10.2M|                temp_real = ptr_real[kk] - ptr_real[k2];
  271|  10.2M|                temp_imag = ptr_imag[kk] - ptr_imag[k2];
  272|       |
  273|  10.2M|                ptr_real[kk] += ptr_real[k2];
  274|  10.2M|                ptr_imag[kk] += ptr_imag[k2];
  275|       |
  276|  10.2M|                ptr_real[k2] = (FLOAT32)(c1 * temp_real - s1 * temp_imag);
  277|  10.2M|                ptr_imag[k2] = (FLOAT32)(s1 * temp_real + c1 * temp_imag);
  278|       |
  279|  10.2M|                kk = k2 + kspan;
  280|  10.2M|              } while (kk < nt);
  ------------------
  |  Branch (280:24): [True: 2.04M, False: 8.18M]
  ------------------
  281|       |
  282|  8.18M|              k2 = kk - nt;
  283|  8.18M|              c1 = -c1;
  284|  8.18M|              kk = k1 - k2;
  285|  8.18M|            } while (kk > k2);
  ------------------
  |  Branch (285:22): [True: 2.04M, False: 6.13M]
  ------------------
  286|       |
  287|  6.13M|            temp_real = (FLOAT32)(c1 - (cd * c1 + sd * s1));
  288|  6.13M|            s1 = sd * c1 - cd * s1 + s1;
  289|  6.13M|            c1 = 2.0 - (temp_real * temp_real + s1 * s1);
  290|       |
  291|  6.13M|            s1 *= c1;
  292|  6.13M|            c1 *= temp_real;
  293|  6.13M|            kk += jc;
  294|  6.13M|          } while (kk < k2);
  ------------------
  |  Branch (294:20): [True: 2.04M, False: 4.09M]
  ------------------
  295|       |
  296|  4.09M|          k1 += inc + inc;
  297|  4.09M|          kk = (k1 - kspan) / 2 + jc;
  298|  4.09M|        } while (kk <= jc + jc);
  ------------------
  |  Branch (298:18): [True: 0, False: 4.09M]
  ------------------
  299|  4.09M|        break;
  300|      0|      default:
  ------------------
  |  Branch (300:7): [True: 0, False: 6.13M]
  ------------------
  301|      0|        k = factor[ii - 1];
  302|      0|        ispan = kspan;
  303|      0|        if (k != 0) kspan /= k;
  ------------------
  |  Branch (303:13): [True: 0, False: 0]
  ------------------
  304|       |
  305|      0|        switch (k) {
  306|      0|          case 5:
  ------------------
  |  Branch (306:11): [True: 0, False: 0]
  ------------------
  307|      0|            c2 = cos_72 * cos_72 - sin_72 * sin_72;
  308|      0|            s2 = 2.0 * cos_72 * sin_72;
  309|      0|            do {
  310|      0|              do {
  311|      0|                k1 = kk + kspan;
  312|      0|                k2 = k1 + kspan;
  313|      0|                k3 = k2 + kspan;
  314|      0|                k4 = k3 + kspan;
  315|       |
  316|      0|                temp_real_1 = ptr_real[k1] + ptr_real[k4];
  317|      0|                temp_real_4 = ptr_real[k1] - ptr_real[k4];
  318|      0|                temp_imag_1 = ptr_imag[k1] + ptr_imag[k4];
  319|      0|                temp_imag_4 = ptr_imag[k1] - ptr_imag[k4];
  320|      0|                temp_real_2 = ptr_real[k2] + ptr_real[k3];
  321|      0|                temp_real_3 = ptr_real[k2] - ptr_real[k3];
  322|      0|                temp_imag_2 = ptr_imag[k2] + ptr_imag[k3];
  323|      0|                temp_imag_3 = ptr_imag[k2] - ptr_imag[k3];
  324|       |
  325|      0|                aa = ptr_real[kk];
  326|      0|                bb = ptr_imag[kk];
  327|      0|                ptr_real[kk] = aa + temp_real_1 + temp_real_2;
  328|      0|                ptr_imag[kk] = bb + temp_imag_1 + temp_imag_2;
  329|       |
  330|      0|                temp_real = (FLOAT32)(temp_real_1 * cos_72 + temp_real_2 * c2 + aa);
  331|      0|                temp_imag = (FLOAT32)(temp_imag_1 * cos_72 + temp_imag_2 * c2 + bb);
  332|       |
  333|      0|                aj = (FLOAT32)(temp_real_4 * sin_72 + temp_real_3 * s2);
  334|      0|                bj = (FLOAT32)(temp_imag_4 * sin_72 + temp_imag_3 * s2);
  335|       |
  336|      0|                ptr_real[k1] = temp_real - bj;
  337|      0|                ptr_real[k4] = temp_real + bj;
  338|      0|                ptr_imag[k1] = temp_imag + aj;
  339|      0|                ptr_imag[k4] = temp_imag - aj;
  340|       |
  341|      0|                temp_real = (FLOAT32)(temp_real_1 * c2 + temp_real_2 * cos_72 + aa);
  342|      0|                temp_imag = (FLOAT32)(temp_imag_1 * c2 + temp_imag_2 * cos_72 + bb);
  343|       |
  344|      0|                aj = (FLOAT32)(temp_real_4 * s2 - temp_real_3 * sin_72);
  345|      0|                bj = (FLOAT32)(temp_imag_4 * s2 - temp_imag_3 * sin_72);
  346|       |
  347|      0|                ptr_real[k2] = temp_real - bj;
  348|      0|                ptr_real[k3] = temp_real + bj;
  349|      0|                ptr_imag[k2] = temp_imag + aj;
  350|      0|                ptr_imag[k3] = temp_imag - aj;
  351|       |
  352|      0|                kk = k4 + kspan;
  353|      0|              } while (kk < nn);
  ------------------
  |  Branch (353:24): [True: 0, False: 0]
  ------------------
  354|      0|              kk -= nn;
  355|      0|            } while (kk <= kspan);
  ------------------
  |  Branch (355:22): [True: 0, False: 0]
  ------------------
  356|      0|            break;
  357|      0|          case 3:
  ------------------
  |  Branch (357:11): [True: 0, False: 0]
  ------------------
  358|      0|            do {
  359|      0|              do {
  360|      0|                k1 = kk + kspan;
  361|      0|                k2 = k1 + kspan;
  362|       |
  363|      0|                temp_real = ptr_real[kk];
  364|      0|                temp_imag = ptr_imag[kk];
  365|       |
  366|      0|                aj = ptr_real[k1] + ptr_real[k2];
  367|      0|                bj = ptr_imag[k1] + ptr_imag[k2];
  368|       |
  369|      0|                ptr_real[kk] = temp_real + aj;
  370|      0|                ptr_imag[kk] = temp_imag + bj;
  371|       |
  372|      0|                temp_real -= 0.5f * aj;
  373|      0|                temp_imag -= 0.5f * bj;
  374|       |
  375|      0|                aj = (FLOAT32)((ptr_real[k1] - ptr_real[k2]) * sine_60);
  376|      0|                bj = (FLOAT32)((ptr_imag[k1] - ptr_imag[k2]) * sine_60);
  377|       |
  378|      0|                ptr_real[k1] = temp_real - bj;
  379|      0|                ptr_real[k2] = temp_real + bj;
  380|      0|                ptr_imag[k1] = temp_imag + aj;
  381|      0|                ptr_imag[k2] = temp_imag - aj;
  382|       |
  383|      0|                kk = k2 + kspan;
  384|      0|              } while (kk < nn);
  ------------------
  |  Branch (384:24): [True: 0, False: 0]
  ------------------
  385|      0|              kk -= nn;
  386|      0|            } while (kk <= kspan);
  ------------------
  |  Branch (386:22): [True: 0, False: 0]
  ------------------
  387|      0|            break;
  388|       |
  389|      0|          default:
  ------------------
  |  Branch (389:11): [True: 0, False: 0]
  ------------------
  390|      0|            if (k != jf) {
  ------------------
  |  Branch (390:17): [True: 0, False: 0]
  ------------------
  391|      0|              jf = k;
  392|      0|              s1 = pi2 / (FLOAT64)k;
  393|       |
  394|      0|              c1 = cos(s1);
  395|      0|              s1 = sin(s1);
  396|       |
  397|      0|              if (jf > MAX_FACTORS) {
  ------------------
  |  |  164|      0|#define MAX_FACTORS 23
  ------------------
  |  Branch (397:19): [True: 0, False: 0]
  ------------------
  398|      0|                return IA_EXHEAACE_EXE_FATAL_MPS_CFFT_PROCESS;
  399|      0|              }
  400|       |
  401|      0|              cos_array[jf - 1] = 1.0;
  402|      0|              sin_array[jf - 1] = 0.0;
  403|      0|              j = 1;
  404|      0|              do {
  405|      0|                cos_array[j - 1] = cos_array[k - 1] * c1 + sin_array[k - 1] * s1;
  406|      0|                sin_array[j - 1] = cos_array[k - 1] * s1 - sin_array[k - 1] * c1;
  407|       |
  408|      0|                k--;
  409|      0|                cos_array[k - 1] = cos_array[j - 1];
  410|      0|                sin_array[k - 1] = -sin_array[j - 1];
  411|       |
  412|      0|                j++;
  413|      0|              } while (j < k);
  ------------------
  |  Branch (413:24): [True: 0, False: 0]
  ------------------
  414|      0|            }
  415|      0|            do {
  416|      0|              do {
  417|      0|                k1 = kk;
  418|      0|                k2 = kk + ispan;
  419|       |
  420|      0|                temp_real = aa = ptr_real[kk];
  421|      0|                temp_imag = bb = ptr_imag[kk];
  422|       |
  423|      0|                j = 1;
  424|      0|                k1 += kspan;
  425|      0|                do {
  426|      0|                  k2 -= kspan;
  427|      0|                  j++;
  428|       |
  429|      0|                  temp_real_array[j - 1] = ptr_real[k1] + ptr_real[k2];
  430|      0|                  temp_real += temp_real_array[j - 1];
  431|      0|                  temp_imag_array[j - 1] = ptr_imag[k1] + ptr_imag[k2];
  432|      0|                  temp_imag += temp_imag_array[j - 1];
  433|      0|                  j++;
  434|       |
  435|      0|                  temp_real_array[j - 1] = ptr_real[k1] - ptr_real[k2];
  436|      0|                  temp_imag_array[j - 1] = ptr_imag[k1] - ptr_imag[k2];
  437|      0|                  k1 += kspan;
  438|       |
  439|      0|                } while (k1 < k2);
  ------------------
  |  Branch (439:26): [True: 0, False: 0]
  ------------------
  440|       |
  441|      0|                ptr_real[kk] = temp_real;
  442|      0|                ptr_imag[kk] = temp_imag;
  443|      0|                k1 = kk;
  444|      0|                k2 = kk + ispan;
  445|      0|                j = 1;
  446|       |
  447|      0|                do {
  448|      0|                  k1 += kspan;
  449|      0|                  k2 -= kspan;
  450|       |
  451|      0|                  jj = j;
  452|      0|                  temp_real = aa;
  453|      0|                  temp_imag = bb;
  454|      0|                  aj = 0.0;
  455|      0|                  bj = 0.0;
  456|      0|                  k = 1;
  457|       |
  458|      0|                  do {
  459|      0|                    k++;
  460|      0|                    temp_real += (FLOAT32)(temp_real_array[k - 1] * cos_array[jj - 1]);
  461|      0|                    temp_imag += (FLOAT32)(temp_imag_array[k - 1] * cos_array[jj - 1]);
  462|       |
  463|      0|                    k++;
  464|      0|                    aj += (FLOAT32)(temp_real_array[k - 1] * sin_array[jj - 1]);
  465|      0|                    bj += (FLOAT32)(temp_imag_array[k - 1] * sin_array[jj - 1]);
  466|       |
  467|      0|                    jj += j;
  468|      0|                    if (jj > jf) {
  ------------------
  |  Branch (468:25): [True: 0, False: 0]
  ------------------
  469|      0|                      jj -= jf;
  470|      0|                    }
  471|      0|                  } while (k < jf);
  ------------------
  |  Branch (471:28): [True: 0, False: 0]
  ------------------
  472|       |
  473|      0|                  k = jf - j;
  474|      0|                  ptr_real[k1] = temp_real - bj;
  475|      0|                  ptr_imag[k1] = temp_imag + aj;
  476|      0|                  ptr_real[k2] = temp_real + bj;
  477|      0|                  ptr_imag[k2] = temp_imag - aj;
  478|       |
  479|      0|                  j++;
  480|      0|                } while (j < k);
  ------------------
  |  Branch (480:26): [True: 0, False: 0]
  ------------------
  481|      0|                kk += ispan;
  482|       |
  483|      0|              } while (kk <= nn);
  ------------------
  |  Branch (483:24): [True: 0, False: 0]
  ------------------
  484|      0|              kk -= nn;
  485|       |
  486|      0|            } while (kk <= kspan);
  ------------------
  |  Branch (486:22): [True: 0, False: 0]
  ------------------
  487|      0|            break;
  488|      0|        }
  489|       |
  490|      0|        if (ii == mfactor) {
  ------------------
  |  Branch (490:13): [True: 0, False: 0]
  ------------------
  491|      0|          repeat = 1;
  492|      0|          break;
  493|      0|        }
  494|       |
  495|      0|        kk = jc + 1;
  496|       |
  497|      0|        do {
  498|      0|          c2 = 1.0 - cd;
  499|      0|          s1 = sd;
  500|       |
  501|      0|          do {
  502|      0|            c1 = c2;
  503|      0|            s2 = s1;
  504|      0|            kk += kspan;
  505|      0|            do {
  506|      0|              do {
  507|      0|                temp_real = ptr_real[kk];
  508|      0|                ptr_real[kk] = (FLOAT32)(c2 * temp_real - s2 * ptr_imag[kk]);
  509|      0|                ptr_imag[kk] = (FLOAT32)(s2 * temp_real + c2 * ptr_imag[kk]);
  510|      0|                kk += ispan;
  511|       |
  512|      0|              } while (kk <= nt);
  ------------------
  |  Branch (512:24): [True: 0, False: 0]
  ------------------
  513|       |
  514|      0|              temp_real = (FLOAT32)(s1 * s2);
  515|      0|              s2 = s1 * c2 + c1 * s2;
  516|      0|              c2 = c1 * c2 - temp_real;
  517|      0|              kk = kk - nt + kspan;
  518|       |
  519|      0|            } while (kk <= ispan);
  ------------------
  |  Branch (519:22): [True: 0, False: 0]
  ------------------
  520|       |
  521|      0|            c2 = c1 - (cd * c1 + sd * s1);
  522|      0|            s1 += sd * c1 - cd * s1;
  523|      0|            c1 = 2.0 - (c2 * c2 + s1 * s1);
  524|       |
  525|      0|            s1 *= c1;
  526|      0|            c2 *= c1;
  527|       |
  528|      0|            kk = kk - ispan + jc;
  529|      0|          } while (kk <= kspan);
  ------------------
  |  Branch (529:20): [True: 0, False: 0]
  ------------------
  530|       |
  531|      0|          kk = kk - kspan + jc + inc;
  532|       |
  533|      0|        } while (kk <= jc + jc);
  ------------------
  |  Branch (533:18): [True: 0, False: 0]
  ------------------
  534|      0|        break;
  535|  6.13M|    }
  536|  6.13M|  } while (repeat == 0);
  ------------------
  |  Branch (536:12): [True: 4.09M, False: 2.04M]
  ------------------
  537|       |
  538|  2.04M|  perm[0] = ns;
  539|       |
  540|  2.04M|  if (kt) {
  ------------------
  |  Branch (540:7): [True: 2.04M, False: 0]
  ------------------
  541|  2.04M|    k = kt + kt + 1;
  542|  2.04M|    if (mfactor < k) {
  ------------------
  |  Branch (542:9): [True: 0, False: 2.04M]
  ------------------
  543|      0|      k--;
  544|      0|    }
  545|       |
  546|  2.04M|    j = 1;
  547|  2.04M|    perm[k] = jc;
  548|       |
  549|  2.04M|    do {
  550|  2.04M|      perm[j] = perm[j - 1] / factor[j - 1];
  551|  2.04M|      perm[k - 1] = perm[k] * factor[j - 1];
  552|       |
  553|  2.04M|      j++;
  554|  2.04M|      k--;
  555|  2.04M|    } while (j < k);
  ------------------
  |  Branch (555:14): [True: 0, False: 2.04M]
  ------------------
  556|       |
  557|  2.04M|    k3 = perm[k];
  558|  2.04M|    kspan = perm[1];
  559|  2.04M|    kk = jc + 1;
  560|  2.04M|    k2 = kspan + 1;
  561|       |
  562|  2.04M|    j = 1;
  563|       |
  564|  2.04M|    if (n_pass == n_total) {
  ------------------
  |  Branch (564:9): [True: 2.04M, False: 0]
  ------------------
  565|  4.09M|      do {
  566|  4.09M|        do {
  567|  4.09M|          temp_real = ptr_real[kk];
  568|  4.09M|          ptr_real[kk] = ptr_real[k2];
  569|  4.09M|          ptr_real[k2] = temp_real;
  570|  4.09M|          temp_imag = ptr_imag[kk];
  571|  4.09M|          ptr_imag[kk] = ptr_imag[k2];
  572|  4.09M|          ptr_imag[k2] = temp_imag;
  573|       |
  574|  4.09M|          kk += inc;
  575|  4.09M|          k2 += kspan;
  576|       |
  577|  4.09M|        } while (k2 < ns);
  ------------------
  |  Branch (577:18): [True: 0, False: 4.09M]
  ------------------
  578|  6.13M|        do {
  579|  8.18M|          do {
  580|  8.18M|            k2 -= perm[j - 1];
  581|  8.18M|            j++;
  582|  8.18M|            k2 = perm[j] + k2;
  583|       |
  584|  8.18M|          } while (k2 > perm[j - 1]);
  ------------------
  |  Branch (584:20): [True: 2.04M, False: 6.13M]
  ------------------
  585|       |
  586|  6.13M|          j = 1;
  587|  12.2M|          do {
  588|  12.2M|            if (kk < k2) {
  ------------------
  |  Branch (588:17): [True: 2.04M, False: 10.2M]
  ------------------
  589|  2.04M|              repeat = 1;
  590|  2.04M|              break;
  591|  10.2M|            } else {
  592|  10.2M|              repeat = 0;
  593|  10.2M|            }
  594|       |
  595|  10.2M|            kk += inc;
  596|  10.2M|            k2 += kspan;
  597|       |
  598|  10.2M|          } while (k2 < ns);
  ------------------
  |  Branch (598:20): [True: 6.13M, False: 4.09M]
  ------------------
  599|  6.13M|          if (repeat) {
  ------------------
  |  Branch (599:15): [True: 2.04M, False: 4.09M]
  ------------------
  600|  2.04M|            break;
  601|  2.04M|          }
  602|  6.13M|        } while (kk < ns);
  ------------------
  |  Branch (602:18): [True: 2.04M, False: 2.04M]
  ------------------
  603|  4.09M|      } while (repeat);
  ------------------
  |  Branch (603:16): [True: 2.04M, False: 2.04M]
  ------------------
  604|  2.04M|    } else {
  605|      0|      do {
  606|      0|        do {
  607|      0|          do {
  608|      0|            k = kk + jc;
  609|      0|            do {
  610|      0|              temp_real = ptr_real[kk];
  611|      0|              ptr_real[kk] = ptr_real[k2];
  612|      0|              ptr_real[k2] = temp_real;
  613|      0|              temp_imag = ptr_imag[kk];
  614|      0|              ptr_imag[kk] = ptr_imag[k2];
  615|      0|              ptr_imag[k2] = temp_imag;
  616|       |
  617|      0|              kk += inc;
  618|      0|              k2 += inc;
  619|       |
  620|      0|            } while (kk < k);
  ------------------
  |  Branch (620:22): [True: 0, False: 0]
  ------------------
  621|      0|            kk += ns - jc;
  622|      0|            k2 += ns - jc;
  623|       |
  624|      0|          } while (kk < nt);
  ------------------
  |  Branch (624:20): [True: 0, False: 0]
  ------------------
  625|       |
  626|      0|          k2 = k2 - nt + kspan;
  627|      0|          kk = kk - nt + jc;
  628|       |
  629|      0|        } while (k2 < ns);
  ------------------
  |  Branch (629:18): [True: 0, False: 0]
  ------------------
  630|       |
  631|      0|        do {
  632|      0|          do {
  633|      0|            k2 -= perm[j - 1];
  634|      0|            j++;
  635|      0|            k2 = perm[j] + k2;
  636|      0|          } while (k2 > perm[j - 1]);
  ------------------
  |  Branch (636:20): [True: 0, False: 0]
  ------------------
  637|       |
  638|      0|          j = 1;
  639|      0|          do {
  640|      0|            if (kk >= k2) {
  ------------------
  |  Branch (640:17): [True: 0, False: 0]
  ------------------
  641|      0|              repeat = 0;
  642|      0|            } else {
  643|      0|              repeat = 1;
  644|      0|              break;
  645|      0|            }
  646|       |
  647|      0|            kk += jc;
  648|      0|            k2 += kspan;
  649|       |
  650|      0|          } while (k2 < ns);
  ------------------
  |  Branch (650:20): [True: 0, False: 0]
  ------------------
  651|      0|          if (repeat) {
  ------------------
  |  Branch (651:15): [True: 0, False: 0]
  ------------------
  652|      0|            break;
  653|      0|          }
  654|      0|        } while (kk < ns);
  ------------------
  |  Branch (654:18): [True: 0, False: 0]
  ------------------
  655|      0|      } while (repeat);
  ------------------
  |  Branch (655:16): [True: 0, False: 0]
  ------------------
  656|      0|    }
  657|  2.04M|    jc = k3;
  658|  2.04M|  }
  659|       |
  660|  2.04M|  if ((kt << 1) + 1 >= mfactor) {
  ------------------
  |  Branch (660:7): [True: 2.04M, False: 0]
  ------------------
  661|  2.04M|    return IA_NO_ERROR;
  ------------------
  |  |   23|  2.04M|#define IA_NO_ERROR 0x00000000
  ------------------
  662|  2.04M|  }
  663|       |
  664|      0|  ispan = perm[kt];
  665|      0|  j = mfactor - kt;
  666|      0|  factor[j] = 1;
  667|       |
  668|      0|  do {
  669|      0|    factor[j - 1] *= factor[j];
  670|      0|    j--;
  671|      0|  } while (j != kt);
  ------------------
  |  Branch (671:12): [True: 0, False: 0]
  ------------------
  672|       |
  673|      0|  kt++;
  674|      0|  nn = factor[kt - 1] - 1;
  675|       |
  676|      0|  if (nn > MAX_PERM) {
  ------------------
  |  |  165|      0|#define MAX_PERM 209
  ------------------
  |  Branch (676:7): [True: 0, False: 0]
  ------------------
  677|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_CFFT_PROCESS;
  678|      0|  }
  679|       |
  680|      0|  for (j = jj = 0; j <= nn; j++) {
  ------------------
  |  Branch (680:20): [True: 0, False: 0]
  ------------------
  681|      0|    k = kt + 1;
  682|      0|    k2 = factor[kt - 1];
  683|      0|    kk = factor[k - 1];
  684|       |
  685|      0|    for (jj += kk; jj >= k2;) {
  ------------------
  |  Branch (685:20): [True: 0, False: 0]
  ------------------
  686|      0|      jj -= k2;
  687|      0|      k2 = kk;
  688|      0|      k++;
  689|      0|      kk = factor[k - 1];
  690|      0|      jj += kk;
  691|      0|    }
  692|       |
  693|      0|    perm[j - 1] = jj;
  694|      0|  }
  695|       |
  696|      0|  for (j = 0;;) {
  697|      0|    do {
  698|      0|      j++;
  699|      0|      kk = perm[j - 1];
  700|       |
  701|      0|    } while (kk < 0);
  ------------------
  |  Branch (701:14): [True: 0, False: 0]
  ------------------
  702|       |
  703|      0|    if (kk == j) {
  ------------------
  |  Branch (703:9): [True: 0, False: 0]
  ------------------
  704|      0|      perm[j - 1] = -j;
  705|      0|      if (j == nn) {
  ------------------
  |  Branch (705:11): [True: 0, False: 0]
  ------------------
  706|      0|        break;
  707|      0|      }
  708|      0|    } else {
  709|      0|      do {
  710|      0|        k = kk;
  711|      0|        kk = perm[k - 1];
  712|      0|        perm[k - 1] = -kk;
  713|      0|      } while (kk != j);
  ------------------
  |  Branch (713:16): [True: 0, False: 0]
  ------------------
  714|       |
  715|      0|      k3 = kk;
  716|      0|    }
  717|      0|  }
  718|      0|  for (;;) {
  719|      0|    j = k3 + 1;
  720|      0|    nt -= ispan;
  721|      0|    ii = nt - inc + 1;
  722|      0|    if (nt < 0) {
  ------------------
  |  Branch (722:9): [True: 0, False: 0]
  ------------------
  723|      0|      break;
  724|      0|    }
  725|      0|    do {
  726|      0|      do {
  727|      0|        j--;
  728|      0|      } while (perm[j - 1] < 0);
  ------------------
  |  Branch (728:16): [True: 0, False: 0]
  ------------------
  729|       |
  730|      0|      jj = jc;
  731|       |
  732|      0|      do {
  733|      0|        kspan = jj;
  734|      0|        if (jj > MAX_FACTORS * inc) {
  ------------------
  |  |  164|      0|#define MAX_FACTORS 23
  ------------------
  |  Branch (734:13): [True: 0, False: 0]
  ------------------
  735|      0|          kspan = MAX_FACTORS * inc;
  ------------------
  |  |  164|      0|#define MAX_FACTORS 23
  ------------------
  736|      0|        }
  737|       |
  738|      0|        jj -= kspan;
  739|      0|        k = perm[j - 1];
  740|      0|        kk = jc * k + ii + jj;
  741|      0|        k1 = kk + kspan;
  742|      0|        k2 = 0;
  743|       |
  744|      0|        do {
  745|      0|          k2++;
  746|      0|          temp_real_array[k2 - 1] = ptr_real[k1];
  747|      0|          temp_imag_array[k2 - 1] = ptr_imag[k1];
  748|      0|          k1 -= inc;
  749|      0|        } while (k1 != kk);
  ------------------
  |  Branch (749:18): [True: 0, False: 0]
  ------------------
  750|       |
  751|      0|        do {
  752|      0|          k1 = kk + kspan;
  753|      0|          k2 = k1 - jc * (k + perm[k - 1]);
  754|      0|          k = -perm[k - 1];
  755|       |
  756|      0|          do {
  757|      0|            ptr_real[k1] = ptr_real[k2];
  758|      0|            ptr_imag[k1] = ptr_imag[k2];
  759|       |
  760|      0|            k1 -= inc;
  761|      0|            k2 -= inc;
  762|       |
  763|      0|          } while (k1 != kk);
  ------------------
  |  Branch (763:20): [True: 0, False: 0]
  ------------------
  764|      0|          kk = k2;
  765|       |
  766|      0|        } while (k != j);
  ------------------
  |  Branch (766:18): [True: 0, False: 0]
  ------------------
  767|       |
  768|      0|        k1 = kk + kspan;
  769|      0|        k2 = 0;
  770|       |
  771|      0|        do {
  772|      0|          k2++;
  773|      0|          ptr_real[k1] = temp_real_array[k2 - 1];
  774|      0|          ptr_imag[k1] = temp_imag_array[k2 - 1];
  775|      0|          k1 -= inc;
  776|       |
  777|      0|        } while (k1 != kk);
  ------------------
  |  Branch (777:18): [True: 0, False: 0]
  ------------------
  778|      0|      } while (jj);
  ------------------
  |  Branch (778:16): [True: 0, False: 0]
  ------------------
  779|      0|    } while (j != 1);
  ------------------
  |  Branch (779:14): [True: 0, False: 0]
  ------------------
  780|      0|  }
  781|      0|  (VOID) ispan;
  782|      0|  return error;
  783|      0|}
ixheaace_mps_hybrid_filter.c:ixheaace_mps_two_channel_filtering:
  840|  8.18M|static VOID ixheaace_mps_two_channel_filtering(const FLOAT32 *p_qmf, FLOAT32 *ptr_hybrid) {
  841|  8.18M|  WORD32 n;
  842|  8.18M|  FLOAT32 cum0, cum1;
  843|       |
  844|  8.18M|  cum0 = 0.5f * p_qmf[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  8.18M|#define HYBRID_FILTER_DELAY (6)
  ------------------
  845|       |
  846|  8.18M|  cum1 = 0;
  847|       |
  848|  57.2M|  for (n = 0; n < 6; n++) {
  ------------------
  |  Branch (848:15): [True: 49.0M, False: 8.18M]
  ------------------
  849|  49.0M|    cum1 += p2_6[n] * p_qmf[2 * n + 1];
  850|  49.0M|  }
  851|       |
  852|  8.18M|  ptr_hybrid[0] = cum0 + cum1;
  853|  8.18M|  ptr_hybrid[1] = cum0 - cum1;
  854|  8.18M|}

ixheaace_mps_212_ec_data_single_enc:
 1435|  45.8k|    const WORD32 coarse_flag, const WORD32 independency_flag) {
 1436|  45.8k|  IA_ERRORCODE error;
 1437|  45.8k|  WORD16 band = 0;
 1438|  45.8k|  WORD16 quant_levels = 0, quant_offset = 0, num_pcm_val = 0;
 1439|  45.8k|  WORD16 pcm_coding_flag = 0;
 1440|  45.8k|  WORD16 min_bits_all = 0;
 1441|  45.8k|  WORD16 min_found = 0;
 1442|  45.8k|  WORD16 huff_dim_df = 0;
 1443|  45.8k|  WORD16 huff_pair_type_df = 0;
 1444|  45.8k|  WORD16 huff_dim_dt = 0;
 1445|  45.8k|  WORD16 huff_pair_type_dt = 0;
 1446|  45.8k|  WORD16 allow_diff_time_back_flag = !independency_flag || (set_idx > 0);
  ------------------
  |  Branch (1446:38): [True: 32.4k, False: 13.4k]
  |  Branch (1446:60): [True: 0, False: 13.4k]
  ------------------
 1447|  45.8k|  WORD16 num_pcm_bits = -1;
 1448|  45.8k|  WORD16 min_bits_df = -1;
 1449|  45.8k|  WORD16 min_bits_dt = -1;
 1450|       |
 1451|  45.8k|  WORD16 quant_data_msb[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {0};
 1452|  45.8k|  WORD16 quant_data_hist_msb[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {0};
 1453|  45.8k|  WORD16 data_diff_freq[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {0};
 1454|  45.8k|  WORD16 data_diff_time[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS + 2] = {0};
 1455|  45.8k|  WORD16 *p_quant_data_msb;
 1456|  45.8k|  WORD16 *p_quant_data_hist_msb = NULL;
 1457|  45.8k|  WORD16 lav_df[2] = {-1, -1};
 1458|  45.8k|  WORD16 lav_dt[2] = {-1, -1};
 1459|       |
 1460|  45.8k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  45.8k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1460:7): [True: 22.6k, False: 23.2k]
  ------------------
 1461|  22.6k|    if (coarse_flag) {
  ------------------
  |  Branch (1461:9): [True: 0, False: 22.6k]
  ------------------
 1462|      0|      quant_levels = 4;
 1463|      0|      quant_offset = 0;
 1464|  22.6k|    } else {
 1465|  22.6k|      quant_levels = 8;
 1466|  22.6k|      quant_offset = 0;
 1467|  22.6k|    }
 1468|  23.2k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  23.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1468:14): [True: 23.2k, False: 0]
  ------------------
 1469|  23.2k|    if (coarse_flag) {
  ------------------
  |  Branch (1469:9): [True: 0, False: 23.2k]
  ------------------
 1470|      0|      quant_levels = 15;
 1471|      0|      quant_offset = 7;
 1472|  23.2k|    } else {
 1473|  23.2k|      quant_levels = 31;
 1474|  23.2k|      quant_offset = 15;
 1475|  23.2k|    }
 1476|  23.2k|  } else {
 1477|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
 1478|      0|  }
 1479|  45.8k|  if (quant_offset != 0) {
  ------------------
  |  Branch (1479:7): [True: 23.2k, False: 22.6k]
  ------------------
 1480|   646k|    for (band = 0; band < data_bands; band++) {
  ------------------
  |  Branch (1480:20): [True: 623k, False: 23.2k]
  ------------------
 1481|   623k|      quant_data_msb[band] = pp_in_data[set_idx][start_band + band] + quant_offset;
 1482|   623k|    }
 1483|  23.2k|    p_quant_data_msb = quant_data_msb;
 1484|  23.2k|  } else {
 1485|  22.6k|    p_quant_data_msb = pp_in_data[set_idx] + start_band;
 1486|  22.6k|  }
 1487|       |
 1488|  45.8k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1488:7): [True: 32.4k, False: 13.4k]
  ------------------
 1489|  32.4k|    if (quant_offset != 0) {
  ------------------
  |  Branch (1489:9): [True: 16.4k, False: 15.9k]
  ------------------
 1490|   460k|      for (band = 0; band < data_bands; band++) {
  ------------------
  |  Branch (1490:22): [True: 443k, False: 16.4k]
  ------------------
 1491|   443k|        quant_data_hist_msb[band] = p_in_data[start_band + band] + quant_offset;
 1492|   443k|      }
 1493|  16.4k|      p_quant_data_hist_msb = quant_data_hist_msb;
 1494|  16.4k|    } else {
 1495|  15.9k|      p_quant_data_hist_msb = p_in_data + start_band;
 1496|  15.9k|    }
 1497|  32.4k|  }
 1498|       |
 1499|  45.8k|  data_diff_freq[0] = p_quant_data_msb[0];
 1500|       |
 1501|  1.23M|  for (band = 1; band < data_bands; band++) {
  ------------------
  |  Branch (1501:18): [True: 1.18M, False: 45.8k]
  ------------------
 1502|  1.18M|    data_diff_freq[band] = p_quant_data_msb[band] - p_quant_data_msb[band - 1];
 1503|  1.18M|  }
 1504|       |
 1505|  45.8k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1505:7): [True: 32.4k, False: 13.4k]
  ------------------
 1506|  32.4k|    data_diff_time[0] = p_quant_data_msb[0];
 1507|  32.4k|    data_diff_time[1] = p_quant_data_hist_msb[0];
 1508|       |
 1509|   904k|    for (band = 0; band < data_bands; band++) {
  ------------------
  |  Branch (1509:20): [True: 872k, False: 32.4k]
  ------------------
 1510|   872k|      data_diff_time[band + 2] = p_quant_data_msb[band] - p_quant_data_hist_msb[band];
 1511|   872k|    }
 1512|  32.4k|  }
 1513|       |
 1514|  45.8k|  num_pcm_bits = ixheaace_mps_212_calc_pcm_bits(data_bands, quant_levels);
 1515|  45.8k|  num_pcm_val = data_bands;
 1516|  45.8k|  min_bits_all = num_pcm_bits;
 1517|       |
 1518|  45.8k|  error = ixheaace_mps_212_calc_huff_bits(
 1519|  45.8k|      data_diff_freq, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_FREQ, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|  45.8k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
                    data_diff_freq, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_FREQ, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|  45.8k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1520|  45.8k|      data_bands, lav_df, &min_bits_df, &huff_dim_df, &huff_pair_type_df);
 1521|  45.8k|  if (error) {
  ------------------
  |  Branch (1521:7): [True: 0, False: 45.8k]
  ------------------
 1522|      0|    return error;
 1523|      0|  }
 1524|       |
 1525|  45.8k|  if (allow_diff_time_back_flag) min_bits_df += 1;
  ------------------
  |  Branch (1525:7): [True: 32.4k, False: 13.4k]
  ------------------
 1526|       |
 1527|  45.8k|  if (min_bits_df < min_bits_all) {
  ------------------
  |  Branch (1527:7): [True: 39.6k, False: 6.21k]
  ------------------
 1528|  39.6k|    min_bits_all = min_bits_df;
 1529|  39.6k|  }
 1530|  45.8k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1530:7): [True: 32.4k, False: 13.4k]
  ------------------
 1531|  32.4k|    error = ixheaace_mps_212_calc_huff_bits(
 1532|  32.4k|        data_diff_time, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|  32.4k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
                      data_diff_time, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|  32.4k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1533|  32.4k|        data_bands, lav_dt, &min_bits_dt, &huff_dim_dt, &huff_pair_type_dt);
 1534|  32.4k|    if (error) {
  ------------------
  |  Branch (1534:9): [True: 0, False: 32.4k]
  ------------------
 1535|      0|      return error;
 1536|      0|    }
 1537|       |
 1538|  32.4k|    min_bits_dt += 1;
 1539|       |
 1540|  32.4k|    if (min_bits_dt < min_bits_all) {
  ------------------
  |  Branch (1540:9): [True: 11.7k, False: 20.6k]
  ------------------
 1541|  11.7k|      min_bits_all = min_bits_dt;
 1542|  11.7k|    }
 1543|  32.4k|  }
 1544|  45.8k|  pcm_coding_flag = (min_bits_all == num_pcm_bits);
 1545|       |
 1546|  45.8k|  ixheaace_write_bits(pstr_bit_buf, pcm_coding_flag, 1);
 1547|       |
 1548|  45.8k|  if (pcm_coding_flag) {
  ------------------
  |  Branch (1548:7): [True: 3.47k, False: 42.4k]
  ------------------
 1549|  3.47k|    ixheaace_mps_212_apply_pcm_coding(pstr_bit_buf, pp_in_data[set_idx] + start_band, NULL,
 1550|  3.47k|                                      quant_offset, num_pcm_val, quant_levels);
 1551|  42.4k|  } else {
 1552|  42.4k|    min_found = 0;
 1553|  42.4k|    if (min_bits_all == min_bits_df) {
  ------------------
  |  Branch (1553:9): [True: 30.6k, False: 11.7k]
  ------------------
 1554|  30.6k|      if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1554:11): [True: 18.8k, False: 11.8k]
  ------------------
 1555|  18.8k|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|  18.8k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1556|  18.8k|      }
 1557|       |
 1558|  30.6k|      error = ixheaace_mps_212_apply_huff_coding(
 1559|  30.6k|          pstr_bit_buf, data_diff_freq, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|  30.6k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1560|  30.6k|          IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands, lav_df, huff_dim_df, huff_pair_type_df);
  ------------------
  |  |   29|  30.6k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1561|  30.6k|      if (error) {
  ------------------
  |  Branch (1561:11): [True: 0, False: 30.6k]
  ------------------
 1562|      0|        return error;
 1563|      0|      }
 1564|  30.6k|      min_found = 1;
 1565|  30.6k|    }
 1566|       |
 1567|  42.4k|    if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1567:9): [True: 30.5k, False: 11.8k]
  ------------------
 1568|  30.5k|      if (!min_found && (min_bits_all == min_bits_dt)) {
  ------------------
  |  Branch (1568:11): [True: 11.7k, False: 18.8k]
  |  Branch (1568:25): [True: 11.7k, False: 0]
  ------------------
 1569|  11.7k|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|  11.7k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1570|       |
 1571|  11.7k|        error = ixheaace_mps_212_apply_huff_coding(
 1572|  11.7k|            pstr_bit_buf, data_diff_time, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|  11.7k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1573|  11.7k|            IXHEAACE_MPS_SAC_DIFF_TIME, data_bands, lav_dt, huff_dim_dt, huff_pair_type_dt);
  ------------------
  |  |   30|  11.7k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1574|  11.7k|        if (error) {
  ------------------
  |  Branch (1574:13): [True: 0, False: 11.7k]
  ------------------
 1575|      0|          return error;
 1576|      0|        }
 1577|  11.7k|      }
 1578|  30.5k|    }
 1579|  42.4k|  }
 1580|       |
 1581|  45.8k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  45.8k|#define IA_NO_ERROR 0x00000000
  ------------------
 1582|  45.8k|}
ixheaace_mps_515_ec_data_pair_enc:
 1589|   169k|                                         WORD32 independency_flag) {
 1590|   169k|  WORD32 dummy = 0;
 1591|   169k|  WORD32 quant_levels = 0, quant_offset = 0, num_pcm_val = 0;
 1592|       |
 1593|   169k|  WORD32 split_lsb_flag = 0;
 1594|   169k|  WORD32 pcm_coding_flag = 0;
 1595|       |
 1596|   169k|  WORD32 min_bits_df_df = -1;
 1597|   169k|  WORD32 min_bits_df_dt = -1;
 1598|   169k|  WORD32 min_bits_dtbw_df = -1;
 1599|   169k|  WORD32 min_bits_dtfw_df = -1;
 1600|       |
 1601|   169k|  WORD32 min_bits_dt_dt = -1;
 1602|   169k|  WORD32 allow_diff_time_back_flag = !independency_flag || (set_idx > 0);
  ------------------
  |  Branch (1602:38): [True: 0, False: 169k]
  |  Branch (1602:60): [True: 0, False: 169k]
  ------------------
 1603|       |
 1604|   169k|  WORD32 num_lsb_bits[2] = {0, 0};
 1605|   169k|  WORD32 num_pcm_bits = 0;
 1606|       |
 1607|   169k|  WORD32 a_data_hist[MAXBANDS] = {0};
 1608|   169k|  WORD32 aa_data_pair[2][MAXBANDS] = {{0}};
 1609|       |
 1610|   169k|  WORD32 quant_data_lsb[2][MAXBANDS] = {{0}};
 1611|   169k|  WORD32 quant_data_msb[2][MAXBANDS] = {{0}};
 1612|       |
 1613|   169k|  WORD32 quant_data_hist_lsb[MAXBANDS] = {0};
 1614|   169k|  WORD32 quant_data_hist_msb[MAXBANDS] = {0};
 1615|       |
 1616|   169k|  WORD32 data_diff_freq[2][MAXBANDS] = {{0}};
 1617|   169k|  WORD32 data_diff_time_bw[2][MAXBANDS + 1] = {{0}};
 1618|   169k|  WORD32 data_diff_time_fw[MAXBANDS + 1] = {0};
 1619|       |
 1620|   169k|  WORD32 *p_data_pcm[2] = {NULL};
 1621|   169k|  WORD32 *p_data_diff_freq[2] = {NULL};
 1622|   169k|  WORD32 *p_data_diff_time_bw[2] = {NULL};
 1623|   169k|  WORD32 *p_data_diff_time_fw = NULL;
 1624|       |
 1625|   169k|  WORD32 min_bits_all = 0;
 1626|   169k|  WORD32 min_found = 0;
 1627|       |
 1628|   169k|  switch (data_type) {
 1629|   109k|    case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|   109k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1629:5): [True: 109k, False: 59.7k]
  ------------------
 1630|   109k|      if (coarse_flag) {
  ------------------
  |  Branch (1630:11): [True: 0, False: 109k]
  ------------------
 1631|      0|        split_lsb_flag = 0;
 1632|      0|        quant_levels = 15;
 1633|      0|        quant_offset = 7;
 1634|   109k|      } else {
 1635|   109k|        split_lsb_flag = 0;
 1636|   109k|        quant_levels = 31;
 1637|   109k|        quant_offset = 15;
 1638|   109k|      }
 1639|       |
 1640|   109k|      break;
 1641|       |
 1642|  59.7k|    case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|  59.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1642:5): [True: 59.7k, False: 109k]
  ------------------
 1643|  59.7k|      if (coarse_flag) {
  ------------------
  |  Branch (1643:11): [True: 0, False: 59.7k]
  ------------------
 1644|      0|        split_lsb_flag = 0;
 1645|      0|        quant_levels = 4;
 1646|      0|        quant_offset = 0;
 1647|  59.7k|      } else {
 1648|  59.7k|        split_lsb_flag = 0;
 1649|  59.7k|        quant_levels = 8;
 1650|  59.7k|        quant_offset = 0;
 1651|  59.7k|      }
 1652|       |
 1653|  59.7k|      break;
 1654|       |
 1655|      0|    case IXHEAACE_MPS_SAC_DATA_TYPE_CPC:
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  |  Branch (1655:5): [True: 0, False: 169k]
  ------------------
 1656|      0|      if (coarse_flag) {
  ------------------
  |  Branch (1656:11): [True: 0, False: 0]
  ------------------
 1657|      0|        split_lsb_flag = 0;
 1658|      0|        quant_levels = 26;
 1659|      0|        quant_offset = 0;
 1660|      0|      } else {
 1661|      0|        split_lsb_flag = 1;
 1662|      0|        quant_levels = 51;
 1663|      0|        quant_offset = 0;
 1664|      0|      }
 1665|       |
 1666|      0|      break;
 1667|       |
 1668|      0|    default:
  ------------------
  |  Branch (1668:5): [True: 0, False: 169k]
  ------------------
 1669|      0|      return;
 1670|   169k|  }
 1671|       |
 1672|   169k|  memcpy(a_data_hist, p_in_data + start_band, sizeof(WORD32) * data_bands);
 1673|       |
 1674|   169k|  memcpy(aa_data_pair[0], pp_in_data[set_idx] + start_band, sizeof(int) * data_bands);
 1675|   169k|  p_data_pcm[0] = aa_data_pair[0];
 1676|   169k|  if (pair_flag) {
  ------------------
  |  Branch (1676:7): [True: 0, False: 169k]
  ------------------
 1677|      0|    memcpy(aa_data_pair[1], pp_in_data[set_idx + 1] + start_band, sizeof(int) * data_bands);
 1678|      0|    p_data_pcm[1] = aa_data_pair[1];
 1679|      0|  }
 1680|       |
 1681|   169k|  num_lsb_bits[0] =
 1682|   169k|      ixheaace_mps_515_split_lsb(aa_data_pair[0], quant_offset, split_lsb_flag ? 1 : 0,
  ------------------
  |  Branch (1682:65): [True: 0, False: 169k]
  ------------------
 1683|   169k|                                 data_bands, quant_data_lsb[0], quant_data_msb[0]);
 1684|       |
 1685|   169k|  if (pair_flag) {
  ------------------
  |  Branch (1685:7): [True: 0, False: 169k]
  ------------------
 1686|      0|    num_lsb_bits[1] =
 1687|      0|        ixheaace_mps_515_split_lsb(aa_data_pair[1], quant_offset, split_lsb_flag ? 1 : 0,
  ------------------
  |  Branch (1687:67): [True: 0, False: 0]
  ------------------
 1688|      0|                                   data_bands, quant_data_lsb[1], quant_data_msb[1]);
 1689|      0|  }
 1690|   169k|  (VOID) num_lsb_bits;
 1691|   169k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1691:7): [True: 0, False: 169k]
  ------------------
 1692|      0|    dummy = ixheaace_mps_515_split_lsb(a_data_hist, quant_offset, split_lsb_flag ? 1 : 0,
  ------------------
  |  Branch (1692:67): [True: 0, False: 0]
  ------------------
 1693|      0|                                       data_bands, quant_data_hist_lsb, quant_data_hist_msb);
 1694|      0|    (VOID) dummy;
 1695|      0|  }
 1696|       |
 1697|   169k|  ixheaace_mps_515_calc_diff_freq(quant_data_msb[0], data_diff_freq[0], data_bands);
 1698|   169k|  p_data_diff_freq[0] = data_diff_freq[0];
 1699|       |
 1700|   169k|  if (pair_flag) {
  ------------------
  |  Branch (1700:7): [True: 0, False: 169k]
  ------------------
 1701|      0|    ixheaace_mps_515_calc_diff_freq(quant_data_msb[1], data_diff_freq[1], data_bands);
 1702|      0|    p_data_diff_freq[1] = data_diff_freq[1];
 1703|      0|  }
 1704|       |
 1705|   169k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1705:7): [True: 0, False: 169k]
  ------------------
 1706|      0|    ixheaace_mps_515_calc_diff_time(quant_data_msb[0], quant_data_hist_msb,
 1707|      0|                                    data_diff_time_bw[0] + 1,
 1708|      0|                                    IXHEAACE_MPS_SAC_DIRECTION_BACKWARDS, data_bands);
  ------------------
  |  |   26|      0|#define IXHEAACE_MPS_SAC_DIRECTION_BACKWARDS (0x0)
  ------------------
 1709|      0|    p_data_diff_time_bw[0] = data_diff_time_bw[0];
 1710|      0|  }
 1711|       |
 1712|   169k|  if (pair_flag) {
  ------------------
  |  Branch (1712:7): [True: 0, False: 169k]
  ------------------
 1713|      0|    ixheaace_mps_515_calc_diff_time(quant_data_msb[1], quant_data_msb[0],
 1714|      0|                                    data_diff_time_bw[1] + 1,
 1715|      0|                                    IXHEAACE_MPS_SAC_DIRECTION_BACKWARDS, data_bands);
  ------------------
  |  |   26|      0|#define IXHEAACE_MPS_SAC_DIRECTION_BACKWARDS (0x0)
  ------------------
 1716|      0|    p_data_diff_time_bw[1] = data_diff_time_bw[1];
 1717|       |
 1718|      0|    ixheaace_mps_515_calc_diff_time(quant_data_msb[1], quant_data_msb[0], data_diff_time_fw + 1,
 1719|      0|                                    IXHEAACE_MPS_SAC_DIRECTION_FORWARDS, data_bands);
  ------------------
  |  |   27|      0|#define IXHEAACE_MPS_SAC_DIRECTION_FORWARDS (0x1)
  ------------------
 1720|      0|    p_data_diff_time_fw = data_diff_time_fw;
 1721|      0|  }
 1722|       |
 1723|   169k|  if (pair_flag) {
  ------------------
  |  Branch (1723:7): [True: 0, False: 169k]
  ------------------
 1724|      0|    num_pcm_bits = ixheaace_mps_515_calc_pcm_bits(2 * data_bands, quant_levels);
 1725|      0|    num_pcm_val = 2 * data_bands;
 1726|   169k|  } else {
 1727|   169k|    num_pcm_bits = ixheaace_mps_515_calc_pcm_bits(data_bands, quant_levels);
 1728|   169k|    num_pcm_val = data_bands;
 1729|   169k|  }
 1730|       |
 1731|   169k|  min_bits_all = num_pcm_bits;
 1732|       |
 1733|   169k|  if ((p_data_diff_freq[0] != NULL) || (p_data_diff_freq[1] != NULL)) {
  ------------------
  |  Branch (1733:7): [True: 169k, False: 0]
  |  Branch (1733:40): [True: 0, False: 0]
  ------------------
 1734|   169k|    min_bits_df_df = ixheaace_mps_515_calc_huff_bits(p_data_diff_freq[0], p_data_diff_freq[1],
 1735|   169k|                                                     data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|   169k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1736|   169k|                                                     IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|   169k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1737|       |
 1738|   169k|    if (pair_flag || allow_diff_time_back_flag) min_bits_df_df += 1;
  ------------------
  |  Branch (1738:9): [True: 0, False: 169k]
  |  Branch (1738:22): [True: 0, False: 169k]
  ------------------
 1739|   169k|    if (pair_flag) min_bits_df_df += 1;
  ------------------
  |  Branch (1739:9): [True: 0, False: 169k]
  ------------------
 1740|       |
 1741|   169k|    if (min_bits_df_df < min_bits_all) {
  ------------------
  |  Branch (1741:9): [True: 157k, False: 11.8k]
  ------------------
 1742|   157k|      min_bits_all = min_bits_df_df;
 1743|   157k|    }
 1744|   169k|  }
 1745|       |
 1746|   169k|  if ((p_data_diff_freq[0] != NULL) || (p_data_diff_time_bw[1] != NULL)) {
  ------------------
  |  Branch (1746:7): [True: 169k, False: 0]
  |  Branch (1746:40): [True: 0, False: 0]
  ------------------
 1747|   169k|    min_bits_df_dt = ixheaace_mps_515_calc_huff_bits(p_data_diff_freq[0], p_data_diff_time_bw[1],
 1748|   169k|                                                     data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|   169k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1749|   169k|                                                     IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   30|   169k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1750|       |
 1751|   169k|    if (pair_flag || allow_diff_time_back_flag) min_bits_df_dt += 1;
  ------------------
  |  Branch (1751:9): [True: 0, False: 169k]
  |  Branch (1751:22): [True: 0, False: 169k]
  ------------------
 1752|   169k|    if (pair_flag) min_bits_df_dt += 1;
  ------------------
  |  Branch (1752:9): [True: 0, False: 169k]
  ------------------
 1753|       |
 1754|   169k|    if (min_bits_df_dt < min_bits_all) {
  ------------------
  |  Branch (1754:9): [True: 0, False: 169k]
  ------------------
 1755|      0|      min_bits_all = min_bits_df_dt;
 1756|      0|    }
 1757|   169k|  }
 1758|       |
 1759|   169k|  if ((p_data_diff_time_fw != NULL) || (p_data_diff_freq[1] != NULL)) {
  ------------------
  |  Branch (1759:7): [True: 0, False: 169k]
  |  Branch (1759:40): [True: 0, False: 169k]
  ------------------
 1760|      0|    min_bits_dtfw_df = ixheaace_mps_515_calc_huff_bits(p_data_diff_time_fw, p_data_diff_freq[1],
 1761|      0|                                                       data_type, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1762|      0|                                                       IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1763|       |
 1764|      0|    if (pair_flag || allow_diff_time_back_flag) min_bits_dtfw_df += 1;
  ------------------
  |  Branch (1764:9): [True: 0, False: 0]
  |  Branch (1764:22): [True: 0, False: 0]
  ------------------
 1765|      0|    if (pair_flag && allow_diff_time_back_flag) min_bits_dtfw_df += 1;
  ------------------
  |  Branch (1765:9): [True: 0, False: 0]
  |  Branch (1765:22): [True: 0, False: 0]
  ------------------
 1766|       |
 1767|      0|    if (pair_flag && allow_diff_time_back_flag) {
  ------------------
  |  Branch (1767:9): [True: 0, False: 0]
  |  Branch (1767:22): [True: 0, False: 0]
  ------------------
 1768|      0|      min_bits_dtfw_df += 1;
 1769|      0|    }
 1770|       |
 1771|      0|    if (min_bits_dtfw_df < min_bits_all) {
  ------------------
  |  Branch (1771:9): [True: 0, False: 0]
  ------------------
 1772|      0|      min_bits_all = min_bits_dtfw_df;
 1773|      0|    }
 1774|      0|  }
 1775|       |
 1776|   169k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1776:7): [True: 0, False: 169k]
  ------------------
 1777|      0|    if ((p_data_diff_time_bw[0] != NULL) || (p_data_diff_freq[1] != NULL)) {
  ------------------
  |  Branch (1777:9): [True: 0, False: 0]
  |  Branch (1777:45): [True: 0, False: 0]
  ------------------
 1778|      0|      min_bits_dtbw_df = ixheaace_mps_515_calc_huff_bits(
 1779|      0|          p_data_diff_time_bw[0], p_data_diff_freq[1], data_type, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1780|      0|          IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1781|       |
 1782|      0|      min_bits_dtbw_df += 1;
 1783|      0|      if (pair_flag) {
  ------------------
  |  Branch (1783:11): [True: 0, False: 0]
  ------------------
 1784|      0|        min_bits_dtbw_df += 2;
 1785|      0|      }
 1786|       |
 1787|      0|      if (min_bits_dtbw_df < min_bits_all) {
  ------------------
  |  Branch (1787:11): [True: 0, False: 0]
  ------------------
 1788|      0|        min_bits_all = min_bits_dtbw_df;
 1789|      0|      }
 1790|      0|    }
 1791|       |
 1792|      0|    if ((p_data_diff_time_bw[0] != NULL) || (p_data_diff_time_bw[1] != NULL)) {
  ------------------
  |  Branch (1792:9): [True: 0, False: 0]
  |  Branch (1792:45): [True: 0, False: 0]
  ------------------
 1793|      0|      min_bits_dt_dt = ixheaace_mps_515_calc_huff_bits(
 1794|      0|          p_data_diff_time_bw[0], p_data_diff_time_bw[1], data_type, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1795|      0|          IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1796|       |
 1797|      0|      min_bits_dt_dt += 1;
 1798|      0|      if (pair_flag) min_bits_dt_dt += 1;
  ------------------
  |  Branch (1798:11): [True: 0, False: 0]
  ------------------
 1799|       |
 1800|      0|      if (min_bits_dt_dt < min_bits_all) {
  ------------------
  |  Branch (1800:11): [True: 0, False: 0]
  ------------------
 1801|      0|        min_bits_all = min_bits_dt_dt;
 1802|      0|      }
 1803|      0|    }
 1804|      0|  }
 1805|       |
 1806|   169k|  pcm_coding_flag = (min_bits_all == num_pcm_bits);
 1807|       |
 1808|   169k|  ixheaace_write_bits(pstr_bit_buf, pcm_coding_flag, 1);
 1809|       |
 1810|   169k|  if (pcm_coding_flag) {
  ------------------
  |  Branch (1810:7): [True: 11.8k, False: 157k]
  ------------------
 1811|  11.8k|    if (data_bands >= PBC_MIN_BANDS) {
  ------------------
  |  |  161|  11.8k|#define PBC_MIN_BANDS 5
  ------------------
  |  Branch (1811:9): [True: 4.21k, False: 7.62k]
  ------------------
 1812|  4.21k|      ixheaace_write_bits(pstr_bit_buf, 0, 1);
 1813|  4.21k|    }
 1814|       |
 1815|  11.8k|    ixheaace_mps_515_apply_pcm_coding(pstr_bit_buf, p_data_pcm[0], p_data_pcm[1], quant_offset,
 1816|  11.8k|                                      num_pcm_val, quant_levels);
 1817|   157k|  } else {
 1818|   157k|    min_found = 0;
 1819|       |
 1820|   157k|    if (min_bits_all == min_bits_df_df) {
  ------------------
  |  Branch (1820:9): [True: 157k, False: 0]
  ------------------
 1821|   157k|      if (pair_flag || allow_diff_time_back_flag) {
  ------------------
  |  Branch (1821:11): [True: 0, False: 157k]
  |  Branch (1821:24): [True: 0, False: 157k]
  ------------------
 1822|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1823|      0|      }
 1824|       |
 1825|   157k|      if (pair_flag) {
  ------------------
  |  Branch (1825:11): [True: 0, False: 157k]
  ------------------
 1826|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1827|      0|      }
 1828|       |
 1829|   157k|      ixheaace_mps_515_apply_huff_coding(pstr_bit_buf, p_data_diff_freq[0], p_data_diff_freq[1],
 1830|   157k|                                         data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|   157k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1831|   157k|                                         IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|   157k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1832|       |
 1833|   157k|      min_found = 1;
 1834|   157k|    }
 1835|       |
 1836|   157k|    if (!min_found && (min_bits_all == min_bits_df_dt)) {
  ------------------
  |  Branch (1836:9): [True: 0, False: 157k]
  |  Branch (1836:23): [True: 0, False: 0]
  ------------------
 1837|      0|      if (pair_flag || allow_diff_time_back_flag) {
  ------------------
  |  Branch (1837:11): [True: 0, False: 0]
  |  Branch (1837:24): [True: 0, False: 0]
  ------------------
 1838|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1839|      0|      }
 1840|       |
 1841|      0|      if (pair_flag) {
  ------------------
  |  Branch (1841:11): [True: 0, False: 0]
  ------------------
 1842|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1843|      0|      }
 1844|       |
 1845|      0|      ixheaace_mps_515_apply_huff_coding(
 1846|      0|          pstr_bit_buf, p_data_diff_freq[0], p_data_diff_time_bw[1], data_type,
 1847|      0|          IXHEAACE_MPS_SAC_DIFF_FREQ, IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
                        IXHEAACE_MPS_SAC_DIFF_FREQ, IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1848|       |
 1849|      0|      min_found = 1;
 1850|      0|    }
 1851|       |
 1852|   157k|    if (!min_found && (min_bits_all == min_bits_dtfw_df)) {
  ------------------
  |  Branch (1852:9): [True: 0, False: 157k]
  |  Branch (1852:23): [True: 0, False: 0]
  ------------------
 1853|      0|      if (pair_flag || allow_diff_time_back_flag) {
  ------------------
  |  Branch (1853:11): [True: 0, False: 0]
  |  Branch (1853:24): [True: 0, False: 0]
  ------------------
 1854|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1855|      0|      }
 1856|       |
 1857|      0|      if (pair_flag && allow_diff_time_back_flag) {
  ------------------
  |  Branch (1857:11): [True: 0, False: 0]
  |  Branch (1857:24): [True: 0, False: 0]
  ------------------
 1858|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1859|      0|      }
 1860|       |
 1861|      0|      ixheaace_mps_515_apply_huff_coding(pstr_bit_buf, p_data_diff_time_fw, p_data_diff_freq[1],
 1862|      0|                                         data_type, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1863|      0|                                         IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1864|       |
 1865|      0|      if (pair_flag && allow_diff_time_back_flag) {
  ------------------
  |  Branch (1865:11): [True: 0, False: 0]
  |  Branch (1865:24): [True: 0, False: 0]
  ------------------
 1866|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIRECTION_FORWARDS, 1);
  ------------------
  |  |   27|      0|#define IXHEAACE_MPS_SAC_DIRECTION_FORWARDS (0x1)
  ------------------
 1867|      0|      }
 1868|       |
 1869|      0|      min_found = 1;
 1870|      0|    }
 1871|       |
 1872|   157k|    if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1872:9): [True: 0, False: 157k]
  ------------------
 1873|      0|      if (!min_found && (min_bits_all == min_bits_dtbw_df)) {
  ------------------
  |  Branch (1873:11): [True: 0, False: 0]
  |  Branch (1873:25): [True: 0, False: 0]
  ------------------
 1874|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1875|       |
 1876|      0|        if (pair_flag) {
  ------------------
  |  Branch (1876:13): [True: 0, False: 0]
  ------------------
 1877|      0|          ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1878|      0|        }
 1879|       |
 1880|      0|        ixheaace_mps_515_apply_huff_coding(
 1881|      0|            pstr_bit_buf, p_data_diff_time_bw[0], p_data_diff_freq[1], data_type,
 1882|      0|            IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
                          IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1883|       |
 1884|      0|        if (pair_flag) {
  ------------------
  |  Branch (1884:13): [True: 0, False: 0]
  ------------------
 1885|      0|          ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIRECTION_BACKWARDS, 1);
  ------------------
  |  |   26|      0|#define IXHEAACE_MPS_SAC_DIRECTION_BACKWARDS (0x0)
  ------------------
 1886|      0|        }
 1887|       |
 1888|      0|        min_found = 1;
 1889|      0|      }
 1890|       |
 1891|      0|      if (!min_found && (min_bits_all == min_bits_dt_dt)) {
  ------------------
  |  Branch (1891:11): [True: 0, False: 0]
  |  Branch (1891:25): [True: 0, False: 0]
  ------------------
 1892|      0|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1893|       |
 1894|      0|        if (pair_flag) {
  ------------------
  |  Branch (1894:13): [True: 0, False: 0]
  ------------------
 1895|      0|          ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1896|      0|        }
 1897|       |
 1898|      0|        ixheaace_mps_515_apply_huff_coding(
 1899|      0|            pstr_bit_buf, p_data_diff_time_bw[0], p_data_diff_time_bw[1], data_type,
 1900|      0|            IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
                          IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1901|      0|      }
 1902|      0|    }
 1903|       |
 1904|   157k|    if (split_lsb_flag) {
  ------------------
  |  Branch (1904:9): [True: 0, False: 157k]
  ------------------
 1905|      0|      ixheaace_mps_515_apply_lsb_coding(pstr_bit_buf, quant_data_lsb[0], 1, data_bands);
 1906|       |
 1907|      0|      if (pair_flag) {
  ------------------
  |  Branch (1907:11): [True: 0, False: 0]
  ------------------
 1908|      0|        ixheaace_mps_515_apply_lsb_coding(pstr_bit_buf, quant_data_lsb[1], 1, data_bands);
 1909|      0|      }
 1910|      0|    }
 1911|   157k|  }
 1912|       |
 1913|   169k|  return;
 1914|   169k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_calc_pcm_bits:
   87|  46.9k|static WORD16 ixheaace_mps_212_calc_pcm_bits(const WORD16 num_val, const WORD16 n_levels) {
   88|  46.9k|  WORD16 num_complete_chunks = 0, rest_chunk_size = 0;
   89|  46.9k|  WORD16 max_grp_len = 0, bits_pcm = 0;
   90|  46.9k|  WORD32 chunk_levels, lvl;
   91|       |
   92|  46.9k|  switch (n_levels) {
   93|      0|    case 7:
  ------------------
  |  Branch (93:5): [True: 0, False: 46.9k]
  ------------------
   94|      0|      max_grp_len = 6;
   95|      0|      break;
   96|      0|    case 3:
  ------------------
  |  Branch (96:5): [True: 0, False: 46.9k]
  ------------------
   97|      0|    case 6:
  ------------------
  |  Branch (97:5): [True: 0, False: 46.9k]
  ------------------
   98|      0|      max_grp_len = 5;
   99|      0|      break;
  100|      0|    case 13:
  ------------------
  |  Branch (100:5): [True: 0, False: 46.9k]
  ------------------
  101|      4|    case 19:
  ------------------
  |  Branch (101:5): [True: 4, False: 46.9k]
  ------------------
  102|      4|    case 51:
  ------------------
  |  Branch (102:5): [True: 0, False: 46.9k]
  ------------------
  103|      4|      max_grp_len = 4;
  104|      4|      break;
  105|      0|    case 25:
  ------------------
  |  Branch (105:5): [True: 0, False: 46.9k]
  ------------------
  106|      0|      max_grp_len = 3;
  107|      0|      break;
  108|     12|    case 11:
  ------------------
  |  Branch (108:5): [True: 12, False: 46.9k]
  ------------------
  109|     12|      max_grp_len = 2;
  110|     12|      break;
  111|  46.9k|    default:
  ------------------
  |  Branch (111:5): [True: 46.9k, False: 16]
  ------------------
  112|  46.9k|      max_grp_len = 1;
  113|  46.9k|  }
  114|       |
  115|  46.9k|  num_complete_chunks = num_val / max_grp_len;
  116|  46.9k|  rest_chunk_size = num_val % max_grp_len;
  117|       |
  118|  46.9k|  chunk_levels = 1;
  119|  94.0k|  for (lvl = 1; lvl <= max_grp_len; lvl++) {
  ------------------
  |  Branch (119:17): [True: 47.0k, False: 46.9k]
  ------------------
  120|  47.0k|    chunk_levels *= n_levels;
  121|  47.0k|  }
  122|  46.9k|  bits_pcm = (WORD16)(round(log(chunk_levels) / log(2)) * num_complete_chunks);
  123|  46.9k|  bits_pcm += (WORD16)(round(log(chunk_levels) / log(2)) * rest_chunk_size);
  124|       |
  125|  46.9k|  return bits_pcm;
  126|  46.9k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_calc_huff_bits:
  370|  78.3k|    WORD16 *const huff_dim, WORD16 *const huff_pair_type) {
  371|  78.3k|  IA_ERRORCODE error;
  372|  78.3k|  WORD16 band = 0;
  373|  78.3k|  WORD16 bit_count_1_d = 0;
  374|  78.3k|  WORD16 bit_count_2_d_freq = 0;
  375|  78.3k|  WORD16 bit_count_min = 0;
  376|  78.3k|  WORD16 num_band_short_data_1 = 0;
  377|  78.3k|  WORD16 num_band_short_data_2 = 0;
  378|  78.3k|  UWORD16 huff_bits;
  379|  78.3k|  WORD16 tab_idx_2_d[2][2] = {{0}};
  380|  78.3k|  WORD16 tab_idx_1_d[2] = {0};
  381|  78.3k|  WORD16 df_rest_flag[2] = {0};
  382|  78.3k|  WORD16 part_0_flag[2] = {0};
  383|  78.3k|  WORD16 lav_fp[2] = {0};
  384|  78.3k|  WORD16 pair_vec[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS][2] = {{0}};
  385|  78.3k|  WORD16 *part_0_data_1[2] = {NULL};
  386|  78.3k|  WORD16 *part_0_data_2[2] = {NULL};
  387|  78.3k|  WORD16 *in_short_data_1 = NULL;
  388|  78.3k|  WORD16 *in_short_data_2 = NULL;
  389|       |
  390|  78.3k|  bit_count_1_d = 1;
  391|  78.3k|  bit_count_2_d_freq = 1;
  392|  78.3k|  num_band_short_data_1 = num_bands;
  393|  78.3k|  num_band_short_data_2 = num_bands;
  394|       |
  395|  78.3k|  tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (395:20): [True: 45.8k, False: 32.4k]
  ------------------
  396|  78.3k|  tab_idx_1_d[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (396:20): [True: 45.8k, False: 32.4k]
  ------------------
  397|       |
  398|  78.3k|  part_0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  399|  78.3k|  part_0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  400|       |
  401|  78.3k|  if (in_data_1 != NULL) {
  ------------------
  |  Branch (401:7): [True: 78.3k, False: 0]
  ------------------
  402|  78.3k|    in_short_data_1 = in_data_1 + (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (402:36): [True: 32.4k, False: 45.8k]
  ------------------
  403|  78.3k|    error = ixheaace_mps_212_huff_enc_1_d(NULL, data_type, tab_idx_1_d[0], in_short_data_1,
  404|  78.3k|                                          num_band_short_data_1, part_0_flag[0], &huff_bits);
  405|  78.3k|    if (error) {
  ------------------
  |  Branch (405:9): [True: 0, False: 78.3k]
  ------------------
  406|      0|      return error;
  407|      0|    }
  408|  78.3k|    bit_count_1_d += huff_bits;
  409|  78.3k|  }
  410|  78.3k|  if (in_data_2 != NULL) {
  ------------------
  |  Branch (410:7): [True: 0, False: 78.3k]
  ------------------
  411|      0|    in_short_data_2 = in_data_2 + (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (411:36): [True: 0, False: 0]
  ------------------
  412|      0|    error = ixheaace_mps_212_huff_enc_1_d(NULL, data_type, tab_idx_1_d[1], in_short_data_2,
  413|      0|                                          num_band_short_data_2, part_0_flag[1], &huff_bits);
  414|      0|    if (error) {
  ------------------
  |  Branch (414:9): [True: 0, False: 0]
  ------------------
  415|      0|      return error;
  416|      0|    }
  417|      0|    bit_count_1_d += huff_bits;
  418|      0|  }
  419|       |
  420|  78.3k|  bit_count_min = bit_count_1_d;
  421|  78.3k|  *huff_dim = IXHEAACE_MPS_SAC_HUFF_1D;
  ------------------
  |  |   34|  78.3k|#define IXHEAACE_MPS_SAC_HUFF_1D (0x0)
  ------------------
  422|  78.3k|  lav_idx[0] = lav_idx[1] = -1;
  423|       |
  424|  78.3k|  if (in_data_1 != NULL) {
  ------------------
  |  Branch (424:7): [True: 78.3k, False: 0]
  ------------------
  425|  78.3k|    if (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) {
  ------------------
  |  |   29|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (425:9): [True: 45.8k, False: 32.4k]
  ------------------
  426|  45.8k|      part_0_data_1[0] = &in_data_1[0];
  427|  45.8k|      part_0_data_1[1] = NULL;
  428|       |
  429|  45.8k|      num_band_short_data_1 -= 1;
  430|  45.8k|      in_short_data_1 += 1;
  431|  45.8k|    }
  432|       |
  433|  78.3k|    df_rest_flag[0] = num_band_short_data_1 % 2;
  434|       |
  435|  78.3k|    if (df_rest_flag[0]) {
  ------------------
  |  Branch (435:9): [True: 44.4k, False: 33.8k]
  ------------------
  436|  44.4k|      num_band_short_data_1 -= 1;
  437|  44.4k|    }
  438|       |
  439|  1.08M|    for (band = 0; band < num_band_short_data_1 - 1; band += 2) {
  ------------------
  |  Branch (439:20): [True: 1.00M, False: 78.3k]
  ------------------
  440|  1.00M|      pair_vec[band][0] = in_short_data_1[band];
  441|  1.00M|      pair_vec[band][1] = in_short_data_1[band + 1];
  442|       |
  443|  1.00M|      lav_fp[0] = (WORD16)MAX(lav_fp[0], abs(pair_vec[band][0]));
  ------------------
  |  |   24|  1.00M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 536k, False: 469k]
  |  |  ------------------
  ------------------
  444|  1.00M|      lav_fp[0] = (WORD16)MAX(lav_fp[0], abs(pair_vec[band][1]));
  ------------------
  |  |   24|  1.00M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 573k, False: 432k]
  |  |  ------------------
  ------------------
  445|  1.00M|    }
  446|       |
  447|  78.3k|    tab_idx_2_d[0][0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (447:25): [True: 32.4k, False: 45.8k]
  ------------------
  448|  78.3k|    tab_idx_2_d[0][1] = 0;
  449|       |
  450|  78.3k|    tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  78.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (450:22): [True: 45.8k, False: 32.4k]
  ------------------
  451|       |
  452|  78.3k|    lav_fp[0] = ixheaace_mps_212_get_next_lav_step(lav_fp[0], data_type);
  453|       |
  454|  78.3k|    if (lav_fp[0] != -1) {
  ------------------
  |  Branch (454:9): [True: 76.6k, False: 1.67k]
  ------------------
  455|  76.6k|      bit_count_2_d_freq += lav_huff_len[lav_fp[0]];
  456|  76.6k|    }
  457|  78.3k|  }
  458|       |
  459|  78.3k|  if (in_data_2 != NULL) {
  ------------------
  |  Branch (459:7): [True: 0, False: 78.3k]
  ------------------
  460|      0|    if (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) {
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (460:9): [True: 0, False: 0]
  ------------------
  461|      0|      part_0_data_2[0] = NULL;
  462|      0|      part_0_data_2[1] = &in_data_2[0];
  463|       |
  464|      0|      num_band_short_data_2 -= 1;
  465|      0|      in_short_data_2 += 1;
  466|      0|    }
  467|       |
  468|      0|    df_rest_flag[1] = num_band_short_data_2 % 2;
  469|       |
  470|      0|    if (df_rest_flag[1]) {
  ------------------
  |  Branch (470:9): [True: 0, False: 0]
  ------------------
  471|      0|      num_band_short_data_2 -= 1;
  472|      0|    }
  473|       |
  474|      0|    for (band = 0; band < num_band_short_data_2 - 1; band += 2) {
  ------------------
  |  Branch (474:20): [True: 0, False: 0]
  ------------------
  475|      0|      pair_vec[band + 1][0] = in_short_data_2[band];
  476|      0|      pair_vec[band + 1][1] = in_short_data_2[band + 1];
  477|       |
  478|      0|      lav_fp[1] = (WORD16)MAX(lav_fp[1], abs(pair_vec[band + 1][0]));
  ------------------
  |  |   24|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  479|      0|      lav_fp[1] = (WORD16)MAX(lav_fp[1], abs(pair_vec[band + 1][1]));
  ------------------
  |  |   24|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  480|      0|    }
  481|       |
  482|      0|    tab_idx_2_d[1][0] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (482:25): [True: 0, False: 0]
  ------------------
  483|      0|    tab_idx_2_d[1][1] = 0;
  484|       |
  485|      0|    tab_idx_1_d[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (485:22): [True: 0, False: 0]
  ------------------
  486|       |
  487|      0|    lav_fp[1] = ixheaace_mps_212_get_next_lav_step(lav_fp[1], data_type);
  488|       |
  489|      0|    if (lav_fp[1] != -1) bit_count_2_d_freq += lav_huff_len[lav_fp[1]];
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  ------------------
  490|      0|  }
  491|       |
  492|  78.3k|  if ((lav_fp[0] != -1) && (lav_fp[1] != -1)) {
  ------------------
  |  Branch (492:7): [True: 76.6k, False: 1.67k]
  |  Branch (492:28): [True: 76.6k, False: 0]
  ------------------
  493|  76.6k|    if (in_data_1 != NULL) {
  ------------------
  |  Branch (493:9): [True: 76.6k, False: 0]
  ------------------
  494|  76.6k|      error = ixheaace_mps_212_huff_enc_2_d(NULL, data_type, tab_idx_2_d[0], lav_fp[0], pair_vec,
  495|  76.6k|                                            num_band_short_data_1, 2, part_0_data_1, &huff_bits);
  496|  76.6k|      if (error) {
  ------------------
  |  Branch (496:11): [True: 0, False: 76.6k]
  ------------------
  497|      0|        return error;
  498|      0|      }
  499|       |
  500|  76.6k|      bit_count_2_d_freq += huff_bits;
  501|  76.6k|    }
  502|  76.6k|    if (in_data_2 != NULL) {
  ------------------
  |  Branch (502:9): [True: 0, False: 76.6k]
  ------------------
  503|      0|      error =
  504|      0|          ixheaace_mps_212_huff_enc_2_d(NULL, data_type, tab_idx_2_d[1], lav_fp[1], pair_vec + 1,
  505|      0|                                        num_band_short_data_2, 2, part_0_data_2, &huff_bits);
  506|      0|      if (error) {
  ------------------
  |  Branch (506:11): [True: 0, False: 0]
  ------------------
  507|      0|        return error;
  508|      0|      }
  509|      0|      bit_count_2_d_freq += huff_bits;
  510|      0|    }
  511|  76.6k|    if (in_data_1 != NULL) {
  ------------------
  |  Branch (511:9): [True: 76.6k, False: 0]
  ------------------
  512|  76.6k|      if (df_rest_flag[0]) {
  ------------------
  |  Branch (512:11): [True: 44.1k, False: 32.5k]
  ------------------
  513|  44.1k|        error = ixheaace_mps_212_huff_enc_1_d(NULL, data_type, tab_idx_1_d[0],
  514|  44.1k|                                              in_short_data_1 + num_band_short_data_1, 1, 0,
  515|  44.1k|                                              &huff_bits);
  516|  44.1k|        if (error) {
  ------------------
  |  Branch (516:13): [True: 0, False: 44.1k]
  ------------------
  517|      0|          return error;
  518|      0|        }
  519|  44.1k|        bit_count_2_d_freq += huff_bits;
  520|  44.1k|      }
  521|  76.6k|    }
  522|  76.6k|    if (in_data_2 != NULL) {
  ------------------
  |  Branch (522:9): [True: 0, False: 76.6k]
  ------------------
  523|      0|      if (df_rest_flag[1]) {
  ------------------
  |  Branch (523:11): [True: 0, False: 0]
  ------------------
  524|      0|        error = ixheaace_mps_212_huff_enc_1_d(NULL, data_type, tab_idx_1_d[1],
  525|      0|                                              in_short_data_2 + num_band_short_data_2, 1, 0,
  526|      0|                                              &huff_bits);
  527|      0|        if (error) {
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|          return error;
  529|      0|        }
  530|      0|        bit_count_2_d_freq += huff_bits;
  531|      0|      }
  532|      0|    }
  533|       |
  534|  76.6k|    if (bit_count_2_d_freq < bit_count_min) {
  ------------------
  |  Branch (534:9): [True: 41.3k, False: 35.3k]
  ------------------
  535|  41.3k|      bit_count_min = bit_count_2_d_freq;
  536|  41.3k|      *huff_dim = IXHEAACE_MPS_SAC_HUFF_2D;
  ------------------
  |  |   35|  41.3k|#define IXHEAACE_MPS_SAC_HUFF_2D (0x1)
  ------------------
  537|  41.3k|      *huff_pair_type = IXHEAACE_MPS_SAC_FREQ_PAIR;
  ------------------
  |  |   32|  41.3k|#define IXHEAACE_MPS_SAC_FREQ_PAIR (0x0)
  ------------------
  538|  41.3k|      lav_idx[0] = lav_fp[0];
  539|  41.3k|      lav_idx[1] = lav_fp[1];
  540|  41.3k|    }
  541|  76.6k|  }
  542|       |
  543|  78.3k|  *bit_count = bit_count_min;
  544|  78.3k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  78.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  545|  78.3k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_huff_enc_1_d:
  188|   154k|                                                  UWORD16 *huff_code_bits) {
  189|   154k|  WORD32 band, offset = 0;
  190|   154k|  UWORD16 huff_bits = 0;
  191|   154k|  ixheaace_mps_huff_entry part0;
  192|   154k|  const ixheaace_mps_huff_entry *p_huff_tab = NULL;
  193|       |
  194|   154k|  *huff_code_bits = 0;
  195|   154k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|   154k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (195:7): [True: 75.2k, False: 79.2k]
  ------------------
  196|  75.2k|    p_huff_tab = ixheaace_mps_212_huff_icc_tab.h1_d[dim_1];
  197|  79.2k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  79.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (197:14): [True: 79.2k, False: 0]
  ------------------
  198|  79.2k|    p_huff_tab = ixheaace_mps_212_huff_cld_tab.h1_d[dim_1];
  199|  79.2k|  } else {
  200|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
  201|      0|  }
  202|       |
  203|   154k|  if (part_0_flag) {
  ------------------
  |  Branch (203:7): [True: 61.7k, False: 92.7k]
  ------------------
  204|  61.7k|    if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  61.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (204:9): [True: 26.2k, False: 35.4k]
  ------------------
  205|  26.2k|      part0 = ixheaace_mps_212_huff_part_0_tab.icc[in_data[0]];
  206|  35.4k|    } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  35.4k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (206:16): [True: 35.4k, False: 0]
  ------------------
  207|  35.4k|      part0 = ixheaace_mps_212_huff_part_0_tab.cld[in_data[0]];
  208|  35.4k|    } else {
  209|      0|      return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
  210|      0|    }
  211|  61.7k|    huff_bits += ixheaace_write_bits(pstr_bit_buf, part0.value, part0.length);
  212|  61.7k|    offset = 1;
  213|  61.7k|  }
  214|       |
  215|  2.72M|  for (band = offset; band < num_bands; band++) {
  ------------------
  |  Branch (215:23): [True: 2.56M, False: 154k]
  ------------------
  216|  2.56M|    WORD32 id_sign = 0;
  217|  2.56M|    WORD32 id = in_data[band];
  218|       |
  219|  2.56M|    if (id != 0) {
  ------------------
  |  Branch (219:9): [True: 989k, False: 1.58M]
  ------------------
  220|   989k|      id_sign = 0;
  221|   989k|      if (id < 0) {
  ------------------
  |  Branch (221:11): [True: 487k, False: 501k]
  ------------------
  222|   487k|        id = -id;
  223|   487k|        id_sign = 1;
  224|   487k|      }
  225|   989k|    }
  226|       |
  227|  2.56M|    huff_bits += ixheaace_write_bits(pstr_bit_buf, p_huff_tab[id].value, p_huff_tab[id].length);
  228|       |
  229|  2.56M|    if (id != 0) {
  ------------------
  |  Branch (229:9): [True: 989k, False: 1.58M]
  ------------------
  230|   989k|      huff_bits += ixheaace_write_bits(pstr_bit_buf, id_sign, 1);
  231|   989k|    }
  232|  2.56M|  }
  233|       |
  234|   154k|  *huff_code_bits = huff_bits;
  235|   154k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   154k|#define IA_NO_ERROR 0x00000000
  ------------------
  236|   154k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_get_next_lav_step:
  354|  78.3k|static WORD8 ixheaace_mps_212_get_next_lav_step(const WORD32 lav, const WORD32 data_type) {
  355|  78.3k|  WORD8 lav_step = 0;
  356|  78.3k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  78.3k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (356:7): [True: 38.6k, False: 39.7k]
  ------------------
  357|  38.6k|    lav_step = (lav > 7) ? -1 : lav_step_icc[lav];
  ------------------
  |  Branch (357:16): [True: 0, False: 38.6k]
  ------------------
  358|  39.7k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  39.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (358:14): [True: 39.7k, False: 0]
  ------------------
  359|  39.7k|    lav_step = (lav > 9) ? -1 : lav_step_cld[lav];
  ------------------
  |  Branch (359:16): [True: 1.67k, False: 38.0k]
  ------------------
  360|  39.7k|  } else {
  361|      0|    lav_step = 0;
  362|      0|  }
  363|       |
  364|  78.3k|  return lav_step;
  365|  78.3k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_huff_enc_2_d:
  300|   101k|                                                  WORD16 *p_0_data[2], UWORD16 *huff_bits) {
  301|   101k|  WORD16 band = 0, lav = 0, sym_bits = 0, esc_idx = 0;
  302|   101k|  UWORD8 num_sbits = 0;
  303|   101k|  WORD16 esc_data[2][IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {{0}};
  304|       |
  305|   101k|  *huff_bits = 0;
  306|   101k|  const ixheaace_mps_huff_entry *pstr_huff_entry = NULL;
  307|   101k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|   101k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (307:7): [True: 52.9k, False: 48.3k]
  ------------------
  308|  52.9k|    lav = 2 * lav_idx + 1;
  309|  52.9k|    pstr_huff_entry = ixheaace_mps_212_huff_part_0_tab.icc;
  310|  52.9k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  48.3k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (310:14): [True: 48.3k, False: 0]
  ------------------
  311|  48.3k|    lav = 2 * lav_idx + 3;
  312|  48.3k|    pstr_huff_entry = ixheaace_mps_212_huff_part_0_tab.cld;
  313|  48.3k|  } else {
  314|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
  315|      0|  }
  316|       |
  317|   101k|  if (p_0_data[0] != NULL) {
  ------------------
  |  Branch (317:7): [True: 60.4k, False: 40.9k]
  ------------------
  318|  60.4k|    ixheaace_mps_huff_entry entry = pstr_huff_entry[*p_0_data[0]];
  319|  60.4k|    *huff_bits += ixheaace_write_bits(pstr_bit_buf, entry.value, entry.length);
  320|  60.4k|  }
  321|   101k|  if (p_0_data[1] != NULL) {
  ------------------
  |  Branch (321:7): [True: 0, False: 101k]
  ------------------
  322|      0|    ixheaace_mps_huff_entry entry = pstr_huff_entry[*p_0_data[1]];
  323|      0|    *huff_bits += ixheaace_write_bits(pstr_bit_buf, entry.value, entry.length);
  324|      0|  }
  325|       |
  326|  1.40M|  for (band = 0; band < num_bands; band += stride) {
  ------------------
  |  Branch (326:18): [True: 1.30M, False: 101k]
  ------------------
  327|  1.30M|    ixheaace_mps_huff_entry entry = {0};
  328|  1.30M|    ixheaace_mps_huff_entry escape = {0};
  329|       |
  330|  1.30M|    esc_data[0][esc_idx] = in_data[band][0] + lav;
  331|  1.30M|    esc_data[1][esc_idx] = in_data[band][1] + lav;
  332|       |
  333|  1.30M|    num_sbits = ixheaace_mps_212_sym_check(in_data[band], lav, &sym_bits);
  334|       |
  335|  1.30M|    ixheaace_mps_212_get_huff_entry(lav, data_type, band, tab_idx_2_d, in_data, &entry, &escape);
  336|       |
  337|  1.30M|    *huff_bits += ixheaace_write_bits(pstr_bit_buf, entry.value, entry.length);
  338|       |
  339|  1.30M|    if ((entry.value == escape.value) && (entry.length == escape.length)) {
  ------------------
  |  Branch (339:9): [True: 417k, False: 885k]
  |  Branch (339:42): [True: 1.49k, False: 415k]
  ------------------
  340|  1.49k|      esc_idx++;
  341|  1.30M|    } else {
  342|  1.30M|      *huff_bits += ixheaace_write_bits(pstr_bit_buf, sym_bits, num_sbits);
  343|  1.30M|    }
  344|  1.30M|  }
  345|   101k|  if (esc_idx > 0) {
  ------------------
  |  Branch (345:7): [True: 1.10k, False: 100k]
  ------------------
  346|  1.10k|    *huff_bits += ixheaace_mps_212_calc_pcm_bits(2 * esc_idx, (2 * lav + 1));
  347|  1.10k|    ixheaace_mps_212_apply_pcm_coding(pstr_bit_buf, esc_data[0], esc_data[1], 0, 2 * esc_idx,
  348|  1.10k|                                      (2 * lav + 1));
  349|  1.10k|  }
  350|       |
  351|   101k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   101k|#define IA_NO_ERROR 0x00000000
  ------------------
  352|   101k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_sym_check:
   50|  1.30M|                                         WORD16 *const p_sym_bits) {
   51|  1.30M|  UWORD8 sym_bits = 0;
   52|  1.30M|  UWORD8 num_sbits = 0;
   53|  1.30M|  WORD16 sum_val = data[0] + data[1];
   54|  1.30M|  WORD16 diff_val = data[0] - data[1];
   55|       |
   56|  1.30M|  if (sum_val != 0) {
  ------------------
  |  Branch (56:7): [True: 586k, False: 716k]
  ------------------
   57|   586k|    WORD8 sum_neg = (sum_val < 0) ? 1 : 0;
  ------------------
  |  Branch (57:21): [True: 286k, False: 299k]
  ------------------
   58|   586k|    if (sum_neg) {
  ------------------
  |  Branch (58:9): [True: 286k, False: 299k]
  ------------------
   59|   286k|      sum_val = -sum_val;
   60|   286k|      diff_val = -diff_val;
   61|   286k|    }
   62|   586k|    sym_bits = (sym_bits << 1) | sum_neg;
   63|   586k|    num_sbits++;
   64|   586k|  }
   65|       |
   66|  1.30M|  if (diff_val != 0) {
  ------------------
  |  Branch (66:7): [True: 495k, False: 806k]
  ------------------
   67|   495k|    WORD8 diff_neg = (diff_val < 0) ? 1 : 0;
  ------------------
  |  Branch (67:22): [True: 243k, False: 252k]
  ------------------
   68|   495k|    if (diff_neg) {
  ------------------
  |  Branch (68:9): [True: 243k, False: 252k]
  ------------------
   69|   243k|      diff_val = -diff_val;
   70|   243k|    }
   71|   495k|    sym_bits = (sym_bits << 1) | diff_neg;
   72|   495k|    num_sbits++;
   73|   495k|  }
   74|  1.30M|  *p_sym_bits = sym_bits;
   75|       |
   76|  1.30M|  if (!(sum_val % 2)) {
  ------------------
  |  Branch (76:7): [True: 949k, False: 353k]
  ------------------
   77|   949k|    data[0] = (sum_val / 2);
   78|   949k|    data[1] = (diff_val / 2);
   79|   949k|  } else {
   80|   353k|    data[0] = (lav - sum_val / 2);
   81|   353k|    data[1] = (lav - diff_val / 2);
   82|   353k|  }
   83|       |
   84|  1.30M|  return num_sbits;
   85|  1.30M|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_get_huff_entry:
  242|  1.30M|                                            ixheaace_mps_huff_entry *const pstr_huff_escape) {
  243|  1.30M|  const ixheaace_mps_huff_cld_tab_2d *pstr_huff_cld_tab_2d =
  244|  1.30M|      &ixheaace_mps_212_huff_cld_tab.h2_d[tab_idx_2_d[0]][tab_idx_2_d[1]];
  245|  1.30M|  const ixheaace_mps_huff_icc_tab_2d *pstr_huff_icc_tab_2d =
  246|  1.30M|      &ixheaace_mps_212_huff_icc_tab.h2_d[tab_idx_2_d[0]][tab_idx_2_d[1]];
  247|       |
  248|  1.30M|  switch (lav) {
  ------------------
  |  Branch (248:11): [True: 1.30M, False: 0]
  ------------------
  249|  14.0k|    case 9: {
  ------------------
  |  Branch (249:5): [True: 14.0k, False: 1.28M]
  ------------------
  250|  14.0k|      *pstr_huff_entry = pstr_huff_cld_tab_2d->lav9.entry[in_data[band][0]][in_data[band][1]];
  251|  14.0k|      *pstr_huff_escape = pstr_huff_cld_tab_2d->lav9.escape;
  252|  14.0k|    } break;
  253|   105k|    case 7: {
  ------------------
  |  Branch (253:5): [True: 105k, False: 1.19M]
  ------------------
  254|   105k|      switch (data_type) {
  ------------------
  |  Branch (254:15): [True: 105k, False: 0]
  ------------------
  255|  30.0k|        case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|  30.0k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (255:9): [True: 30.0k, False: 75.3k]
  ------------------
  256|  30.0k|          *pstr_huff_entry = pstr_huff_cld_tab_2d->lav7.entry[in_data[band][0]][in_data[band][1]];
  257|  30.0k|          *pstr_huff_escape = pstr_huff_cld_tab_2d->lav7.escape;
  258|  30.0k|          break;
  259|  75.3k|        case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|  75.3k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (259:9): [True: 75.3k, False: 30.0k]
  ------------------
  260|  75.3k|          *pstr_huff_entry = pstr_huff_icc_tab_2d->lav7.entry[in_data[band][0]][in_data[band][1]];
  261|  75.3k|          *pstr_huff_escape = pstr_huff_icc_tab_2d->lav7.escape;
  262|  75.3k|          break;
  263|   105k|      }
  264|   105k|    } break;
  265|   199k|    case 5: {
  ------------------
  |  Branch (265:5): [True: 199k, False: 1.10M]
  ------------------
  266|   199k|      switch (data_type) {
  ------------------
  |  Branch (266:15): [True: 199k, False: 0]
  ------------------
  267|  65.8k|        case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|  65.8k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (267:9): [True: 65.8k, False: 133k]
  ------------------
  268|  65.8k|          *pstr_huff_entry = pstr_huff_cld_tab_2d->lav5.entry[in_data[band][0]][in_data[band][1]];
  269|  65.8k|          *pstr_huff_escape = pstr_huff_cld_tab_2d->lav5.escape;
  270|  65.8k|          break;
  271|   133k|        case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|   133k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (271:9): [True: 133k, False: 65.8k]
  ------------------
  272|   133k|          *pstr_huff_entry = pstr_huff_icc_tab_2d->lav5.entry[in_data[band][0]][in_data[band][1]];
  273|   133k|          *pstr_huff_escape = pstr_huff_icc_tab_2d->lav5.escape;
  274|   133k|          break;
  275|   199k|      }
  276|   199k|    } break;
  277|   691k|    case 3: {
  ------------------
  |  Branch (277:5): [True: 691k, False: 611k]
  ------------------
  278|   691k|      switch (data_type) {
  ------------------
  |  Branch (278:15): [True: 691k, False: 0]
  ------------------
  279|   514k|        case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|   514k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (279:9): [True: 514k, False: 176k]
  ------------------
  280|   514k|          *pstr_huff_entry = pstr_huff_cld_tab_2d->lav3.entry[in_data[band][0]][in_data[band][1]];
  281|   514k|          *pstr_huff_escape = pstr_huff_cld_tab_2d->lav3.escape;
  282|   514k|          break;
  283|   176k|        case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|   176k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (283:9): [True: 176k, False: 514k]
  ------------------
  284|   176k|          *pstr_huff_entry = pstr_huff_icc_tab_2d->lav3.entry[in_data[band][0]][in_data[band][1]];
  285|   176k|          *pstr_huff_escape = pstr_huff_icc_tab_2d->lav3.escape;
  286|   176k|          break;
  287|   691k|      }
  288|   691k|    } break;
  289|   691k|    case 1: {
  ------------------
  |  Branch (289:5): [True: 292k, False: 1.01M]
  ------------------
  290|   292k|      *pstr_huff_entry = pstr_huff_icc_tab_2d->lav1.entry[in_data[band][0]][in_data[band][1]];
  291|   292k|      *pstr_huff_escape = pstr_huff_icc_tab_2d->lav1.escape;
  292|   292k|    } break;
  293|  1.30M|  }
  294|  1.30M|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_apply_pcm_coding:
  131|  4.57k|                                              const WORD16 num_val, const WORD16 n_levels) {
  132|  4.57k|  WORD16 val = 0, lvl = 0, idx = 0;
  133|  4.57k|  WORD16 max_grp_len = 0, grp_len = 0, next_val = 0;
  134|  4.57k|  WORD32 grp_val = 0, chunk_levels = 0;
  135|  4.57k|  UWORD8 pcm_block_size[7] = {0};
  136|       |
  137|  4.57k|  switch (n_levels) {
  138|      0|    case 7:
  ------------------
  |  Branch (138:5): [True: 0, False: 4.57k]
  ------------------
  139|      0|      max_grp_len = 6;
  140|      0|      break;
  141|      0|    case 3:
  ------------------
  |  Branch (141:5): [True: 0, False: 4.57k]
  ------------------
  142|      0|    case 6:
  ------------------
  |  Branch (142:5): [True: 0, False: 4.57k]
  ------------------
  143|      0|    case 9:
  ------------------
  |  Branch (143:5): [True: 0, False: 4.57k]
  ------------------
  144|      0|      max_grp_len = 5;
  145|      0|      break;
  146|      0|    case 13:
  ------------------
  |  Branch (146:5): [True: 0, False: 4.57k]
  ------------------
  147|      4|    case 19:
  ------------------
  |  Branch (147:5): [True: 4, False: 4.56k]
  ------------------
  148|      4|    case 51:
  ------------------
  |  Branch (148:5): [True: 0, False: 4.57k]
  ------------------
  149|      4|      max_grp_len = 4;
  150|      4|      break;
  151|      0|    case 5:
  ------------------
  |  Branch (151:5): [True: 0, False: 4.57k]
  ------------------
  152|      0|    case 25:
  ------------------
  |  Branch (152:5): [True: 0, False: 4.57k]
  ------------------
  153|      0|      max_grp_len = 3;
  154|      0|      break;
  155|     12|    case 11:
  ------------------
  |  Branch (155:5): [True: 12, False: 4.56k]
  ------------------
  156|     12|      max_grp_len = 2;
  157|     12|      break;
  158|  4.55k|    default:
  ------------------
  |  Branch (158:5): [True: 4.55k, False: 16]
  ------------------
  159|  4.55k|      max_grp_len = 1;
  160|  4.57k|  }
  161|       |
  162|  4.57k|  chunk_levels = 1;
  163|  9.17k|  for (lvl = 1; lvl <= max_grp_len; lvl++) {
  ------------------
  |  Branch (163:17): [True: 4.59k, False: 4.57k]
  ------------------
  164|  4.59k|    chunk_levels *= n_levels;
  165|  4.59k|    pcm_block_size[lvl] = (UWORD8)round(log(chunk_levels) / log(2));
  166|  4.59k|  }
  167|       |
  168|   100k|  for (val = 0; val < num_val; val += max_grp_len) {
  ------------------
  |  Branch (168:17): [True: 96.0k, False: 4.57k]
  ------------------
  169|  96.0k|    grp_len = MIN(max_grp_len, num_val - val);
  ------------------
  |  |   23|  96.0k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 91.4k, False: 4.57k]
  |  |  ------------------
  ------------------
  170|  96.0k|    grp_val = 0;
  171|   192k|    for (lvl = 0; lvl < grp_len; lvl++) {
  ------------------
  |  Branch (171:19): [True: 96.0k, False: 96.0k]
  ------------------
  172|  96.0k|      idx = val + lvl;
  173|  96.0k|      next_val = (in_data_2 == NULL)
  ------------------
  |  Branch (173:18): [True: 93.0k, False: 2.99k]
  ------------------
  174|  96.0k|                     ? in_data_1[idx]
  175|  96.0k|                     : (in_data_1 == NULL)
  ------------------
  |  Branch (175:24): [True: 0, False: 2.99k]
  ------------------
  176|  2.99k|                           ? in_data_2[idx]
  177|  2.99k|                           : ((idx & 01) ? in_data_2[idx >> 1] : in_data_1[idx >> 1]);
  ------------------
  |  Branch (177:31): [True: 1.49k, False: 1.49k]
  ------------------
  178|  96.0k|      grp_val = grp_val * n_levels + next_val + offset;
  179|  96.0k|    }
  180|  96.0k|    ixheaace_write_bits(pstr_bit_buf, grp_val, pcm_block_size[grp_len]);
  181|  96.0k|  }
  182|  4.57k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_apply_huff_coding:
  550|  42.4k|    const WORD16 bands, const WORD16 *const lav_idx, WORD16 huff_dim, WORD16 huff_pair_type) {
  551|  42.4k|  IA_ERRORCODE error;
  552|  42.4k|  WORD16 band = 0;
  553|  42.4k|  WORD16 num_band_short_data_1 = bands;
  554|  42.4k|  WORD16 num_band_short_data_2 = bands;
  555|  42.4k|  UWORD16 huff_bits;
  556|       |
  557|  42.4k|  WORD16 df_rest_flag[2] = {0};
  558|  42.4k|  WORD16 part_0_flag[2] = {0};
  559|  42.4k|  WORD16 tab_idx_1_d[2] = {0};
  560|  42.4k|  WORD16 tab_idx_2_d[2][2] = {{0}};
  561|  42.4k|  WORD16 pair_vec[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS][2] = {{0}};
  562|       |
  563|  42.4k|  WORD16 *part_0_data_1[2] = {NULL};
  564|  42.4k|  WORD16 *part_0_data_2[2] = {NULL};
  565|  42.4k|  WORD16 *in_short_data_1 = NULL;
  566|  42.4k|  WORD16 *in_short_data_2 = NULL;
  567|       |
  568|  42.4k|  ixheaace_write_bits(pstr_bit_buf, huff_dim, 1);
  569|  42.4k|  if (huff_dim == IXHEAACE_MPS_SAC_HUFF_1D) {
  ------------------
  |  |   34|  42.4k|#define IXHEAACE_MPS_SAC_HUFF_1D (0x0)
  ------------------
  |  Branch (569:7): [True: 17.6k, False: 24.7k]
  ------------------
  570|  17.6k|    part_0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  17.6k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  571|  17.6k|    part_0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  17.6k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  572|       |
  573|  17.6k|    tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  17.6k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (573:22): [True: 15.8k, False: 1.82k]
  ------------------
  574|  17.6k|    tab_idx_1_d[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  17.6k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (574:22): [True: 15.8k, False: 1.82k]
  ------------------
  575|       |
  576|  17.6k|    if (in_data_1 != NULL) {
  ------------------
  |  Branch (576:9): [True: 17.6k, False: 0]
  ------------------
  577|  17.6k|      in_short_data_1 = in_data_1 + (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|  17.6k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (577:38): [True: 1.82k, False: 15.8k]
  ------------------
  578|  17.6k|      error =
  579|  17.6k|          ixheaace_mps_212_huff_enc_1_d(pstr_bit_buf, data_type, tab_idx_1_d[0], in_short_data_1,
  580|  17.6k|                                        num_band_short_data_1, part_0_flag[0], &huff_bits);
  581|  17.6k|      if (error) {
  ------------------
  |  Branch (581:11): [True: 0, False: 17.6k]
  ------------------
  582|      0|        return error;
  583|      0|      }
  584|  17.6k|    }
  585|  17.6k|    if (in_data_2 != NULL) {
  ------------------
  |  Branch (585:9): [True: 0, False: 17.6k]
  ------------------
  586|      0|      in_short_data_2 = in_data_2 + (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (586:38): [True: 0, False: 0]
  ------------------
  587|      0|      error =
  588|      0|          ixheaace_mps_212_huff_enc_1_d(pstr_bit_buf, data_type, tab_idx_1_d[1], in_short_data_2,
  589|      0|                                        num_band_short_data_2, part_0_flag[1], &huff_bits);
  590|      0|      if (error) {
  ------------------
  |  Branch (590:11): [True: 0, False: 0]
  ------------------
  591|      0|        return error;
  592|      0|      }
  593|      0|    }
  594|  24.7k|  } else {
  595|  24.7k|    if (huff_pair_type == IXHEAACE_MPS_SAC_FREQ_PAIR) {
  ------------------
  |  |   32|  24.7k|#define IXHEAACE_MPS_SAC_FREQ_PAIR (0x0)
  ------------------
  |  Branch (595:9): [True: 24.7k, False: 0]
  ------------------
  596|  24.7k|      if (in_data_1 != NULL) {
  ------------------
  |  Branch (596:11): [True: 24.7k, False: 0]
  ------------------
  597|  24.7k|        in_short_data_1 = in_data_1 + (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|  24.7k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (597:40): [True: 9.94k, False: 14.8k]
  ------------------
  598|  24.7k|        if (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) {
  ------------------
  |  |   29|  24.7k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (598:13): [True: 14.8k, False: 9.94k]
  ------------------
  599|  14.8k|          part_0_data_1[0] = &in_data_1[0];
  600|  14.8k|          part_0_data_1[1] = NULL;
  601|       |
  602|  14.8k|          num_band_short_data_1 -= 1;
  603|  14.8k|          in_short_data_1 += 1;
  604|  14.8k|        }
  605|       |
  606|  24.7k|        df_rest_flag[0] = num_band_short_data_1 % 2;
  607|       |
  608|  24.7k|        if (df_rest_flag[0]) num_band_short_data_1 -= 1;
  ------------------
  |  Branch (608:13): [True: 14.3k, False: 10.3k]
  ------------------
  609|       |
  610|   343k|        for (band = 0; band < num_band_short_data_1 - 1; band += 2) {
  ------------------
  |  Branch (610:24): [True: 319k, False: 24.7k]
  ------------------
  611|   319k|          pair_vec[band][0] = in_short_data_1[band];
  612|   319k|          pair_vec[band][1] = in_short_data_1[band + 1];
  613|   319k|        }
  614|       |
  615|  24.7k|        tab_idx_2_d[0][0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|  24.7k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (615:29): [True: 9.94k, False: 14.8k]
  ------------------
  616|  24.7k|        tab_idx_2_d[0][1] = 0;
  617|       |
  618|  24.7k|        tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  24.7k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (618:26): [True: 14.8k, False: 9.94k]
  ------------------
  619|  24.7k|      }
  620|  24.7k|      if (in_data_2 != NULL) {
  ------------------
  |  Branch (620:11): [True: 0, False: 24.7k]
  ------------------
  621|      0|        in_short_data_2 = in_data_2 + (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (621:40): [True: 0, False: 0]
  ------------------
  622|      0|        if (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) {
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (622:13): [True: 0, False: 0]
  ------------------
  623|      0|          part_0_data_2[0] = NULL;
  624|      0|          part_0_data_2[1] = &in_data_2[0];
  625|       |
  626|      0|          num_band_short_data_2 -= 1;
  627|      0|          in_short_data_2 += 1;
  628|      0|        }
  629|       |
  630|      0|        df_rest_flag[1] = num_band_short_data_2 % 2;
  631|       |
  632|      0|        if (df_rest_flag[1]) num_band_short_data_2 -= 1;
  ------------------
  |  Branch (632:13): [True: 0, False: 0]
  ------------------
  633|       |
  634|      0|        for (band = 0; band < num_band_short_data_2 - 1; band += 2) {
  ------------------
  |  Branch (634:24): [True: 0, False: 0]
  ------------------
  635|      0|          pair_vec[band + 1][0] = in_short_data_2[band];
  636|      0|          pair_vec[band + 1][1] = in_short_data_2[band + 1];
  637|      0|        }
  638|       |
  639|      0|        tab_idx_2_d[1][0] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (639:29): [True: 0, False: 0]
  ------------------
  640|      0|        tab_idx_2_d[1][1] = 0;
  641|       |
  642|      0|        tab_idx_1_d[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (642:26): [True: 0, False: 0]
  ------------------
  643|      0|      }
  644|  24.7k|      if (in_data_1 != NULL) {
  ------------------
  |  Branch (644:11): [True: 24.7k, False: 0]
  ------------------
  645|  24.7k|        ixheaace_write_bits(pstr_bit_buf, lav_huff_val[lav_idx[0]], lav_huff_len[lav_idx[0]]);
  646|  24.7k|        error = ixheaace_mps_212_huff_enc_2_d(pstr_bit_buf, data_type, tab_idx_2_d[0], lav_idx[0],
  647|  24.7k|                                              pair_vec, num_band_short_data_1, 2, part_0_data_1,
  648|  24.7k|                                              &huff_bits);
  649|  24.7k|        if (error) {
  ------------------
  |  Branch (649:13): [True: 0, False: 24.7k]
  ------------------
  650|      0|          return error;
  651|      0|        }
  652|  24.7k|        if (df_rest_flag[0]) {
  ------------------
  |  Branch (652:13): [True: 14.3k, False: 10.3k]
  ------------------
  653|  14.3k|          error = ixheaace_mps_212_huff_enc_1_d(pstr_bit_buf, data_type, tab_idx_1_d[0],
  654|  14.3k|                                                in_short_data_1 + num_band_short_data_1, 1, 0,
  655|  14.3k|                                                &huff_bits);
  656|  14.3k|          if (error) {
  ------------------
  |  Branch (656:15): [True: 0, False: 14.3k]
  ------------------
  657|      0|            return error;
  658|      0|          }
  659|  14.3k|        }
  660|  24.7k|      }
  661|  24.7k|      if (in_data_2 != NULL) {
  ------------------
  |  Branch (661:11): [True: 0, False: 24.7k]
  ------------------
  662|      0|        ixheaace_write_bits(pstr_bit_buf, lav_huff_val[lav_idx[1]], lav_huff_len[lav_idx[1]]);
  663|      0|        error = ixheaace_mps_212_huff_enc_2_d(pstr_bit_buf, data_type, tab_idx_2_d[1], lav_idx[1],
  664|      0|                                              pair_vec + 1, num_band_short_data_2, 2,
  665|      0|                                              part_0_data_2, &huff_bits);
  666|      0|        if (error) {
  ------------------
  |  Branch (666:13): [True: 0, False: 0]
  ------------------
  667|      0|          return error;
  668|      0|        }
  669|      0|        if (df_rest_flag[1]) {
  ------------------
  |  Branch (669:13): [True: 0, False: 0]
  ------------------
  670|      0|          error = ixheaace_mps_212_huff_enc_1_d(pstr_bit_buf, data_type, tab_idx_1_d[1],
  671|      0|                                                in_short_data_2 + num_band_short_data_2, 1, 0,
  672|      0|                                                &huff_bits);
  673|      0|          if (error) {
  ------------------
  |  Branch (673:15): [True: 0, False: 0]
  ------------------
  674|      0|            return error;
  675|      0|          }
  676|      0|        }
  677|      0|      }
  678|  24.7k|    } else {
  679|      0|      if (in_data_1 == NULL || in_data_2 == NULL || in_short_data_1 == NULL ||
  ------------------
  |  Branch (679:11): [True: 0, False: 0]
  |  Branch (679:32): [True: 0, False: 0]
  |  Branch (679:53): [True: 0, False: 0]
  ------------------
  680|      0|          in_short_data_2 == NULL) {
  ------------------
  |  Branch (680:11): [True: 0, False: 0]
  ------------------
  681|      0|        return IA_EXHEAACE_EXE_FATAL_MPS_NULL_DATA_HANDLE;
  682|      0|      }
  683|       |
  684|      0|      if ((diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ||
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (684:11): [True: 0, False: 0]
  ------------------
  685|      0|          (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ)) {
  ------------------
  |  |   29|      0|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (685:11): [True: 0, False: 0]
  ------------------
  686|      0|        part_0_data_1[0] = &in_data_1[0];
  687|      0|        part_0_data_1[1] = &in_data_2[0];
  688|       |
  689|      0|        in_short_data_1 += 1;
  690|      0|        in_short_data_2 += 1;
  691|       |
  692|      0|        num_band_short_data_1 -= 1;
  693|      0|      }
  694|       |
  695|      0|      for (band = 0; band < num_band_short_data_1; band++) {
  ------------------
  |  Branch (695:22): [True: 0, False: 0]
  ------------------
  696|      0|        pair_vec[band][0] = in_short_data_1[band];
  697|      0|        pair_vec[band][1] = in_short_data_2[band];
  698|      0|      }
  699|      0|      tab_idx_2_d[0][0] = ((diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ||
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (699:28): [True: 0, False: 0]
  ------------------
  700|      0|                           (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME))
  ------------------
  |  |   30|      0|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (700:28): [True: 0, False: 0]
  ------------------
  701|      0|                              ? 1
  702|      0|                              : 0;
  703|      0|      tab_idx_2_d[0][1] = 1;
  704|      0|      ixheaace_write_bits(pstr_bit_buf, lav_huff_val[lav_idx[0]], lav_huff_len[lav_idx[0]]);
  705|      0|      error = ixheaace_mps_212_huff_enc_2_d(pstr_bit_buf, data_type, tab_idx_2_d[0], lav_idx[0],
  706|      0|                                            pair_vec, num_band_short_data_1, 1, part_0_data_1,
  707|      0|                                            &huff_bits);
  708|      0|      if (error) {
  ------------------
  |  Branch (708:11): [True: 0, False: 0]
  ------------------
  709|      0|        return error;
  710|      0|      }
  711|      0|    }
  712|  24.7k|  }
  713|  42.4k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  42.4k|#define IA_NO_ERROR 0x00000000
  ------------------
  714|  42.4k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_split_lsb:
  718|   169k|                                         WORD32 *out_data_msb) {
  719|   169k|  WORD32 i = 0, val = 0, lsb = 0, msb = 0;
  720|       |
  721|   169k|  UWORD32 mask = (1 << num_lsb) - 1;
  722|   169k|  WORD32 no_lsb_bits = 0;
  723|       |
  724|  3.16M|  for (i = 0; i < num_val; i++) {
  ------------------
  |  Branch (724:15): [True: 2.99M, False: 169k]
  ------------------
  725|  2.99M|    val = in_data[i] + offset;
  726|       |
  727|  2.99M|    lsb = val & mask;
  728|  2.99M|    msb = val >> num_lsb;
  729|       |
  730|  2.99M|    if (out_data_lsb != NULL) out_data_lsb[i] = lsb;
  ------------------
  |  Branch (730:9): [True: 2.99M, False: 0]
  ------------------
  731|  2.99M|    if (out_data_msb != NULL) out_data_msb[i] = msb;
  ------------------
  |  Branch (731:9): [True: 2.99M, False: 0]
  ------------------
  732|       |
  733|  2.99M|    no_lsb_bits += num_lsb;
  734|  2.99M|  }
  735|       |
  736|   169k|  return no_lsb_bits;
  737|   169k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_calc_diff_freq:
  749|   169k|static VOID ixheaace_mps_515_calc_diff_freq(WORD32 *in_data, WORD32 *out_data, WORD32 num_val) {
  750|   169k|  WORD32 i = 0;
  751|       |
  752|   169k|  out_data[0] = in_data[0];
  753|       |
  754|  2.99M|  for (i = 1; i < num_val; i++) {
  ------------------
  |  Branch (754:15): [True: 2.82M, False: 169k]
  ------------------
  755|  2.82M|    out_data[i] = in_data[i] - in_data[i - 1];
  756|  2.82M|  }
  757|   169k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_calc_pcm_bits:
  770|   169k|static WORD32 ixheaace_mps_515_calc_pcm_bits(WORD32 num_val, WORD32 n_levels) {
  771|   169k|  WORD32 num_complete_chunks = 0, rest_chunk_size = 0;
  772|   169k|  WORD32 max_grp_len = 0, bits_pcm = 0;
  773|       |
  774|   169k|  FLOAT32 num_ld_levels = 0.f;
  775|       |
  776|   169k|  switch (n_levels) {
  777|      0|    case 3:
  ------------------
  |  Branch (777:5): [True: 0, False: 169k]
  ------------------
  778|      0|      max_grp_len = 5;
  779|      0|      break;
  780|      0|    case 7:
  ------------------
  |  Branch (780:5): [True: 0, False: 169k]
  ------------------
  781|      0|      max_grp_len = 6;
  782|      0|      break;
  783|      0|    case 11:
  ------------------
  |  Branch (783:5): [True: 0, False: 169k]
  ------------------
  784|      0|      max_grp_len = 2;
  785|      0|      break;
  786|      0|    case 13:
  ------------------
  |  Branch (786:5): [True: 0, False: 169k]
  ------------------
  787|      0|      max_grp_len = 4;
  788|      0|      break;
  789|      0|    case 19:
  ------------------
  |  Branch (789:5): [True: 0, False: 169k]
  ------------------
  790|      0|      max_grp_len = 4;
  791|      0|      break;
  792|      0|    case 25:
  ------------------
  |  Branch (792:5): [True: 0, False: 169k]
  ------------------
  793|      0|      max_grp_len = 3;
  794|      0|      break;
  795|      0|    case 51:
  ------------------
  |  Branch (795:5): [True: 0, False: 169k]
  ------------------
  796|      0|      max_grp_len = 4;
  797|      0|      break;
  798|       |
  799|      0|    case 4:
  ------------------
  |  Branch (799:5): [True: 0, False: 169k]
  ------------------
  800|  59.7k|    case 8:
  ------------------
  |  Branch (800:5): [True: 59.7k, False: 109k]
  ------------------
  801|  59.7k|    case 15:
  ------------------
  |  Branch (801:5): [True: 0, False: 169k]
  ------------------
  802|  59.7k|    case 26:
  ------------------
  |  Branch (802:5): [True: 0, False: 169k]
  ------------------
  803|   169k|    case 31:
  ------------------
  |  Branch (803:5): [True: 109k, False: 59.7k]
  ------------------
  804|   169k|      max_grp_len = 1;
  805|   169k|      break;
  806|      0|    default:
  ------------------
  |  Branch (806:5): [True: 0, False: 169k]
  ------------------
  807|      0|      return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_LEVELS;
  808|   169k|  }
  809|       |
  810|   169k|  num_ld_levels = (FLOAT32)(log((FLOAT32)n_levels) / log(2.f));
  811|       |
  812|   169k|  num_complete_chunks = num_val / max_grp_len;
  813|   169k|  rest_chunk_size = num_val % max_grp_len;
  814|       |
  815|   169k|  bits_pcm = ((WORD32)ceil((FLOAT32)(max_grp_len)*num_ld_levels)) * num_complete_chunks;
  816|   169k|  bits_pcm += (WORD32)ceil((FLOAT32)(rest_chunk_size)*num_ld_levels);
  817|       |
  818|   169k|  return bits_pcm;
  819|   169k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_calc_huff_bits:
 1063|   339k|                                              WORD32 diff_type_2, WORD32 num_val) {
 1064|   339k|  WORD32 p0_flag[2];
 1065|       |
 1066|   339k|  WORD32 offset_1 = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|   339k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1066:21): [True: 0, False: 339k]
  ------------------
 1067|   339k|  WORD32 offset_2 = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|   339k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1067:21): [True: 169k, False: 169k]
  ------------------
 1068|       |
 1069|   339k|  WORD32 bit_count_huff = 0;
 1070|       |
 1071|   339k|  WORD32 num_val_1_int = 0;
 1072|   339k|  WORD32 num_val_2_int = 0;
 1073|       |
 1074|   339k|  WORD32 *in_data_1_int = in_data_1 + offset_1;
 1075|   339k|  WORD32 *in_data_2_int = in_data_2 + offset_2;
 1076|       |
 1077|   339k|  bit_count_huff = 1;
 1078|       |
 1079|   339k|  num_val_1_int = num_val;
 1080|   339k|  num_val_2_int = num_val;
 1081|       |
 1082|   339k|  p0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   339k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1083|   339k|  p0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   339k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1084|       |
 1085|   339k|  switch (data_type) {
 1086|   219k|    case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|   219k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1086:5): [True: 219k, False: 119k]
  ------------------
 1087|   219k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1087:11): [True: 219k, False: 0]
  ------------------
 1088|   219k|        bit_count_huff +=
 1089|   219k|            ixheaace_mps_515_count_huff_cld(&ixheaace_mps_515_huff_cld_tab.huff_pt0,
 1090|   219k|                                            &ixheaace_mps_515_huff_cld_tab.huff_diff[diff_type_1],
 1091|   219k|                                            in_data_1_int, num_val_1_int, p0_flag[0]);
 1092|   219k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1092:11): [True: 0, False: 219k]
  ------------------
 1093|      0|        bit_count_huff +=
 1094|      0|            ixheaace_mps_515_count_huff_cld(&ixheaace_mps_515_huff_cld_tab.huff_pt0,
 1095|      0|                                            &ixheaace_mps_515_huff_cld_tab.huff_diff[diff_type_2],
 1096|      0|                                            in_data_2_int, num_val_2_int, p0_flag[1]);
 1097|   219k|      break;
 1098|       |
 1099|   119k|    case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|   119k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1099:5): [True: 119k, False: 219k]
  ------------------
 1100|   119k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1100:11): [True: 119k, False: 0]
  ------------------
 1101|   119k|        bit_count_huff +=
 1102|   119k|            ixheaace_mps_515_count_huff_icc(&ixheaace_mps_515_huff_icc_tab.huff_pt0,
 1103|   119k|                                            &ixheaace_mps_515_huff_icc_tab.huff_diff[diff_type_1],
 1104|   119k|                                            in_data_1_int, num_val_1_int, p0_flag[0]);
 1105|   119k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1105:11): [True: 0, False: 119k]
  ------------------
 1106|      0|        bit_count_huff +=
 1107|      0|            ixheaace_mps_515_count_huff_icc(&ixheaace_mps_515_huff_icc_tab.huff_pt0,
 1108|      0|                                            &ixheaace_mps_515_huff_icc_tab.huff_diff[diff_type_2],
 1109|      0|                                            in_data_2_int, num_val_2_int, p0_flag[1]);
 1110|   119k|      break;
 1111|       |
 1112|      0|    case IXHEAACE_MPS_SAC_DATA_TYPE_CPC:
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  |  Branch (1112:5): [True: 0, False: 339k]
  ------------------
 1113|      0|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1113:11): [True: 0, False: 0]
  ------------------
 1114|      0|        bit_count_huff +=
 1115|      0|            ixheaace_mps_515_count_huff_cpc(&ixheaace_mps_515_huff_cpc_tab.huff_pt0,
 1116|      0|                                            &ixheaace_mps_515_huff_cpc_tab.huff_diff[diff_type_1],
 1117|      0|                                            in_data_1_int, num_val_1_int, p0_flag[0]);
 1118|      0|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1118:11): [True: 0, False: 0]
  ------------------
 1119|      0|        bit_count_huff +=
 1120|      0|            ixheaace_mps_515_count_huff_cpc(&ixheaace_mps_515_huff_cpc_tab.huff_pt0,
 1121|      0|                                            &ixheaace_mps_515_huff_cpc_tab.huff_diff[diff_type_2],
 1122|      0|                                            in_data_2_int, num_val_2_int, p0_flag[1]);
 1123|      0|      break;
 1124|       |
 1125|      0|    default:
  ------------------
  |  Branch (1125:5): [True: 0, False: 339k]
  ------------------
 1126|      0|      break;
 1127|   339k|  }
 1128|       |
 1129|   339k|  return bit_count_huff;
 1130|   339k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_count_huff_cld:
  876|   219k|    WORD32 p0_flag) {
  877|   219k|  WORD32 i = 0, id = 0;
  878|   219k|  WORD32 huff_bits = 0;
  879|   219k|  WORD32 offset = 0;
  880|   219k|  if (p0_flag) {
  ------------------
  |  Branch (880:7): [True: 219k, False: 0]
  ------------------
  881|   219k|    huff_bits += pstr_huff_cld_tab_pt0->length[in_data[0]];
  882|   219k|    offset = 1;
  883|   219k|  }
  884|       |
  885|  3.60M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (885:20): [True: 3.38M, False: 219k]
  ------------------
  886|  3.38M|    id = in_data[i];
  887|       |
  888|  3.38M|    if (id != 0) {
  ------------------
  |  Branch (888:9): [True: 412k, False: 2.97M]
  ------------------
  889|   412k|      if (id < 0) {
  ------------------
  |  Branch (889:11): [True: 207k, False: 204k]
  ------------------
  890|   207k|        id = -id;
  891|   207k|      }
  892|   412k|      huff_bits += 1;
  893|   412k|    }
  894|       |
  895|  3.38M|    huff_bits += pstr_huff_cld_tab_diff->length[id];
  896|  3.38M|  }
  897|       |
  898|   219k|  return huff_bits;
  899|   219k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_count_huff_icc:
  904|   119k|    WORD32 p0_flag) {
  905|   119k|  WORD32 i = 0, id = 0;
  906|   119k|  WORD32 huff_bits = 0;
  907|   119k|  WORD32 offset = 0;
  908|       |
  909|   119k|  if (p0_flag) {
  ------------------
  |  Branch (909:7): [True: 119k, False: 0]
  ------------------
  910|   119k|    huff_bits += pstr_huff_icc_tab_pt0->length[in_data[0]];
  911|   119k|    offset = 1;
  912|   119k|  }
  913|       |
  914|  2.38M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (914:20): [True: 2.26M, False: 119k]
  ------------------
  915|  2.26M|    id = in_data[i];
  916|       |
  917|  2.26M|    if (id != 0) {
  ------------------
  |  Branch (917:9): [True: 245k, False: 2.02M]
  ------------------
  918|   245k|      if (id < 0) {
  ------------------
  |  Branch (918:11): [True: 91.9k, False: 153k]
  ------------------
  919|  91.9k|        id = -id;
  920|  91.9k|      }
  921|   245k|      huff_bits += 1;
  922|   245k|    }
  923|       |
  924|  2.26M|    huff_bits += pstr_huff_icc_tab_diff->length[id];
  925|  2.26M|  }
  926|       |
  927|   119k|  return huff_bits;
  928|   119k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_apply_pcm_coding:
  823|  11.8k|                                              WORD32 num_val, WORD32 n_levels) {
  824|  11.8k|  WORD32 i = 0, j = 0, idx = 0;
  825|  11.8k|  WORD32 max_grp_len = 1, grp_len = 0, next_val = 0, grp_val = 0;
  826|       |
  827|  11.8k|  FLOAT32 num_ld_levels = 0.f;
  828|       |
  829|  11.8k|  UWORD8 pcm_block_size[7] = {0};
  830|  11.8k|  switch (n_levels) {
  ------------------
  |  Branch (830:11): [True: 11.8k, False: 0]
  ------------------
  831|      0|    case 4:
  ------------------
  |  Branch (831:5): [True: 0, False: 11.8k]
  ------------------
  832|      0|      num_ld_levels = 2.00000000f;
  833|      0|      break;
  834|  4.14k|    case 8:
  ------------------
  |  Branch (834:5): [True: 4.14k, False: 7.68k]
  ------------------
  835|  4.14k|      num_ld_levels = 3.00000000f;
  836|  4.14k|      break;
  837|      0|    case 15:
  ------------------
  |  Branch (837:5): [True: 0, False: 11.8k]
  ------------------
  838|      0|      num_ld_levels = 3.90689060f;
  839|      0|      break;
  840|      0|    case 26:
  ------------------
  |  Branch (840:5): [True: 0, False: 11.8k]
  ------------------
  841|      0|      num_ld_levels = 4.70043972f;
  842|      0|      break;
  843|  7.68k|    case 31:
  ------------------
  |  Branch (843:5): [True: 7.68k, False: 4.14k]
  ------------------
  844|  7.68k|      num_ld_levels = 4.95419645f;
  845|  7.68k|      break;
  846|      0|    case 51:
  ------------------
  |  Branch (846:5): [True: 0, False: 11.8k]
  ------------------
  847|      0|      max_grp_len = 4;
  848|      0|      num_ld_levels = 5.67242534f;
  849|      0|      break;
  850|  11.8k|  }
  851|       |
  852|  23.6k|  for (i = 1; i <= max_grp_len; i++) {
  ------------------
  |  Branch (852:15): [True: 11.8k, False: 11.8k]
  ------------------
  853|  11.8k|    pcm_block_size[i] = (UWORD8)ceil((FLOAT32)(i)*num_ld_levels);
  854|  11.8k|  }
  855|       |
  856|   111k|  for (i = 0; i < num_val; i += max_grp_len) {
  ------------------
  |  Branch (856:15): [True: 99.5k, False: 11.8k]
  ------------------
  857|  99.5k|    grp_len = MIN(max_grp_len, num_val - i);
  ------------------
  |  |   23|  99.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 87.7k, False: 11.8k]
  |  |  ------------------
  ------------------
  858|  99.5k|    grp_val = 0;
  859|   199k|    for (j = 0; j < grp_len; j++) {
  ------------------
  |  Branch (859:17): [True: 99.5k, False: 99.5k]
  ------------------
  860|  99.5k|      idx = i + j;
  861|  99.5k|      next_val = (in_data_2 == NULL)
  ------------------
  |  Branch (861:18): [True: 99.5k, False: 0]
  ------------------
  862|  99.5k|                     ? in_data_1[idx]
  863|  99.5k|                     : (in_data_1 == NULL)
  ------------------
  |  Branch (863:24): [True: 0, False: 0]
  ------------------
  864|      0|                           ? in_data_2[idx]
  865|      0|                           : ((idx & 01) ? in_data_2[idx >> 1] : in_data_1[idx >> 1]);
  ------------------
  |  Branch (865:31): [True: 0, False: 0]
  ------------------
  866|  99.5k|      grp_val = grp_val * n_levels + next_val + offset;
  867|  99.5k|    }
  868|       |
  869|  99.5k|    ixheaace_write_bits(pstr_bit_buf, grp_val, pcm_block_size[grp_len]);
  870|  99.5k|  }
  871|  11.8k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_apply_huff_coding:
 1135|   157k|                                               WORD32 diff_type_2, WORD32 num_val) {
 1136|   157k|  WORD32 p0_flag[2];
 1137|       |
 1138|   157k|  WORD32 num_val_1_int = num_val;
 1139|   157k|  WORD32 num_val_2_int = num_val;
 1140|       |
 1141|   157k|  WORD32 *in_data_1_int = in_data_1;
 1142|   157k|  WORD32 *in_data_2_int = in_data_2;
 1143|       |
 1144|   157k|  if (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) in_data_1_int += 1;
  ------------------
  |  |   30|   157k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1144:7): [True: 0, False: 157k]
  ------------------
 1145|   157k|  if (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME) in_data_2_int += 1;
  ------------------
  |  |   30|   157k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1145:7): [True: 0, False: 157k]
  ------------------
 1146|       |
 1147|   157k|  ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_HUFF_1D, 1);
  ------------------
  |  |   34|   157k|#define IXHEAACE_MPS_SAC_HUFF_1D (0x0)
  ------------------
 1148|       |
 1149|   157k|  p0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   157k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1150|   157k|  p0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   157k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1151|       |
 1152|   157k|  switch (data_type) {
 1153|   102k|    case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|   102k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1153:5): [True: 102k, False: 55.5k]
  ------------------
 1154|   102k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1154:11): [True: 102k, False: 0]
  ------------------
 1155|   102k|        ixheaace_mps_515_huff_enc_cld(pstr_bit_buf, &ixheaace_mps_515_huff_cld_tab.huff_pt0,
 1156|   102k|                                      &ixheaace_mps_515_huff_cld_tab.huff_diff[diff_type_1],
 1157|   102k|                                      in_data_1_int, num_val_1_int, p0_flag[0]);
 1158|   102k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1158:11): [True: 0, False: 102k]
  ------------------
 1159|      0|        ixheaace_mps_515_huff_enc_cld(pstr_bit_buf, &ixheaace_mps_515_huff_cld_tab.huff_pt0,
 1160|      0|                                      &ixheaace_mps_515_huff_cld_tab.huff_diff[diff_type_2],
 1161|      0|                                      in_data_2_int, num_val_2_int, p0_flag[1]);
 1162|   102k|      break;
 1163|       |
 1164|  55.5k|    case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|  55.5k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1164:5): [True: 55.5k, False: 102k]
  ------------------
 1165|  55.5k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1165:11): [True: 55.5k, False: 0]
  ------------------
 1166|  55.5k|        ixheaace_mps_515_huff_enc_icc(pstr_bit_buf, &ixheaace_mps_515_huff_icc_tab.huff_pt0,
 1167|  55.5k|                                      &ixheaace_mps_515_huff_icc_tab.huff_diff[diff_type_1],
 1168|  55.5k|                                      in_data_1_int, num_val_1_int, p0_flag[0]);
 1169|  55.5k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1169:11): [True: 0, False: 55.5k]
  ------------------
 1170|      0|        ixheaace_mps_515_huff_enc_icc(pstr_bit_buf, &ixheaace_mps_515_huff_icc_tab.huff_pt0,
 1171|      0|                                      &ixheaace_mps_515_huff_icc_tab.huff_diff[diff_type_2],
 1172|      0|                                      in_data_2_int, num_val_2_int, p0_flag[1]);
 1173|  55.5k|      break;
 1174|       |
 1175|      0|    case IXHEAACE_MPS_SAC_DATA_TYPE_CPC:
  ------------------
  |  |   24|      0|#define IXHEAACE_MPS_SAC_DATA_TYPE_CPC (0x2)
  ------------------
  |  Branch (1175:5): [True: 0, False: 157k]
  ------------------
 1176|      0|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1176:11): [True: 0, False: 0]
  ------------------
 1177|      0|        ixheaace_mps_515_huff_enc_cpc(pstr_bit_buf, &ixheaace_mps_515_huff_cpc_tab.huff_pt0,
 1178|      0|                                      &ixheaace_mps_515_huff_cpc_tab.huff_diff[diff_type_1],
 1179|      0|                                      in_data_1_int, num_val_1_int, p0_flag[0]);
 1180|      0|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1180:11): [True: 0, False: 0]
  ------------------
 1181|      0|        ixheaace_mps_515_huff_enc_cpc(pstr_bit_buf, &ixheaace_mps_515_huff_cpc_tab.huff_pt0,
 1182|      0|                                      &ixheaace_mps_515_huff_cpc_tab.huff_diff[diff_type_2],
 1183|      0|                                      in_data_2_int, num_val_2_int, p0_flag[1]);
 1184|      0|      break;
 1185|       |
 1186|      0|    default:
  ------------------
  |  Branch (1186:5): [True: 0, False: 157k]
  ------------------
 1187|      0|      break;
 1188|   157k|  }
 1189|   157k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_huff_enc_cld:
  963|   102k|    WORD32 p0_flag) {
  964|   102k|  WORD32 i = 0, id = 0, id_sign = 0;
  965|   102k|  WORD32 offset = 0;
  966|       |
  967|   102k|  if (p0_flag) {
  ------------------
  |  Branch (967:7): [True: 102k, False: 0]
  ------------------
  968|   102k|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_cld_tab_pt0->value[in_data[0]],
  969|   102k|                        pstr_huff_cld_tab_pt0->length[in_data[0]]);
  970|   102k|    offset = 1;
  971|   102k|  }
  972|       |
  973|  1.78M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (973:20): [True: 1.68M, False: 102k]
  ------------------
  974|  1.68M|    id = in_data[i];
  975|       |
  976|  1.68M|    if (id != 0) {
  ------------------
  |  Branch (976:9): [True: 204k, False: 1.48M]
  ------------------
  977|   204k|      id_sign = 0;
  978|   204k|      if (id < 0) {
  ------------------
  |  Branch (978:11): [True: 103k, False: 101k]
  ------------------
  979|   103k|        id = -id;
  980|   103k|        id_sign = 1;
  981|   103k|      }
  982|   204k|    }
  983|       |
  984|  1.68M|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_cld_tab_diff->value[id],
  985|  1.68M|                        pstr_huff_cld_tab_diff->length[id]);
  986|       |
  987|  1.68M|    if (id != 0) {
  ------------------
  |  Branch (987:9): [True: 204k, False: 1.48M]
  ------------------
  988|   204k|      ixheaace_write_bits(pstr_bit_buf, id_sign, 1);
  989|   204k|    }
  990|  1.68M|  }
  991|   102k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_huff_enc_icc:
  997|  55.5k|    WORD32 p0_flag) {
  998|  55.5k|  WORD32 i = 0, id = 0, id_sign = 0;
  999|  55.5k|  WORD32 offset = 0;
 1000|       |
 1001|  55.5k|  if (p0_flag) {
  ------------------
  |  Branch (1001:7): [True: 55.5k, False: 0]
  ------------------
 1002|  55.5k|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_icc_tab_pt0->value[in_data[0]],
 1003|  55.5k|                        pstr_huff_icc_tab_pt0->length[in_data[0]]);
 1004|  55.5k|    offset = 1;
 1005|  55.5k|  }
 1006|       |
 1007|  1.11M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (1007:20): [True: 1.05M, False: 55.5k]
  ------------------
 1008|  1.05M|    id = in_data[i];
 1009|       |
 1010|  1.05M|    if (id != 0) {
  ------------------
  |  Branch (1010:9): [True: 70.2k, False: 985k]
  ------------------
 1011|  70.2k|      id_sign = 0;
 1012|  70.2k|      if (id < 0) {
  ------------------
  |  Branch (1012:11): [True: 24.5k, False: 45.6k]
  ------------------
 1013|  24.5k|        id = -id;
 1014|  24.5k|        id_sign = 1;
 1015|  24.5k|      }
 1016|  70.2k|    }
 1017|       |
 1018|  1.05M|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_icc_tab_diff->value[id],
 1019|  1.05M|                        pstr_huff_icc_tab_diff->length[id]);
 1020|       |
 1021|  1.05M|    if (id != 0) {
  ------------------
  |  Branch (1021:9): [True: 70.2k, False: 985k]
  ------------------
 1022|  70.2k|      ixheaace_write_bits(pstr_bit_buf, id_sign, 1);
 1023|  70.2k|    }
 1024|  1.05M|  }
 1025|  55.5k|}

ixheaace_mps_212_onset_detect_init:
   40|  2.56k|    const UWORD32 init_flag) {
   41|  2.56k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.56k|#define IA_NO_ERROR 0x00000000
  ------------------
   42|  2.56k|  WORD32 slot;
   43|  2.56k|  if ((pstr_onset_detect_config->max_time_slots > pstr_onset_detect->max_time_slots) ||
  ------------------
  |  Branch (43:7): [True: 0, False: 2.56k]
  ------------------
   44|  2.56k|      (pstr_onset_detect_config->upper_bound_onset_detection <
  ------------------
  |  Branch (44:7): [True: 0, False: 2.56k]
  ------------------
   45|  2.56k|       pstr_onset_detect->lower_bound_onset_detection)) {
   46|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   47|      0|  }
   48|  2.56k|  pstr_onset_detect->avg_energy_dist_scale = 4;
   49|  2.56k|  pstr_onset_detect->min_trans_dist = 8;
   50|  2.56k|  pstr_onset_detect->avg_energy_dist = 16;
   51|  2.56k|  pstr_onset_detect->lower_bound_onset_detection =
   52|  2.56k|      pstr_onset_detect_config->lower_bound_onset_detection;
   53|  2.56k|  pstr_onset_detect->upper_bound_onset_detection =
   54|  2.56k|      pstr_onset_detect_config->upper_bound_onset_detection;
   55|  2.56k|  pstr_onset_detect->max_time_slots = pstr_onset_detect_config->max_time_slots;
   56|  2.56k|  if (init_flag) {
  ------------------
  |  Branch (56:7): [True: 2.56k, False: 0]
  ------------------
   57|   128k|    for (slot = 0; slot < pstr_onset_detect->avg_energy_dist + pstr_onset_detect->max_time_slots;
  ------------------
  |  Branch (57:20): [True: 126k, False: 2.56k]
  ------------------
   58|   126k|         slot++) {
   59|   126k|      pstr_onset_detect->p_energy_hist[slot] = EPSILON;
  ------------------
  |  |   54|   126k|#define EPSILON (1e-9f)
  ------------------
   60|   126k|    }
   61|  2.56k|  }
   62|  2.56k|  return error;
   63|  2.56k|}
ixheaace_mps_212_onset_detect_update:
   67|   182k|                                     const WORD32 time_slots) {
   68|   182k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   182k|#define IA_NO_ERROR 0x00000000
  ------------------
   69|   182k|  WORD32 slot;
   70|   182k|  if (time_slots > pstr_onset_detect->max_time_slots) {
  ------------------
  |  Branch (70:7): [True: 0, False: 182k]
  ------------------
   71|      0|    error = IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   72|   182k|  } else {
   73|  3.10M|    for (slot = 0; slot < pstr_onset_detect->avg_energy_dist; slot++) {
  ------------------
  |  Branch (73:20): [True: 2.91M, False: 182k]
  ------------------
   74|  2.91M|      pstr_onset_detect->p_energy_hist[slot] =
   75|  2.91M|          pstr_onset_detect->p_energy_hist[slot + time_slots];
   76|  2.91M|    }
   77|       |
   78|  6.37M|    for (slot = 0; slot < time_slots; slot++) {
  ------------------
  |  Branch (78:20): [True: 6.19M, False: 182k]
  ------------------
   79|  6.19M|      pstr_onset_detect->p_energy_hist[pstr_onset_detect->avg_energy_dist + slot] = EPSILON;
  ------------------
  |  |   54|  6.19M|#define EPSILON (1e-9f)
  ------------------
   80|  6.19M|    }
   81|   182k|  }
   82|   182k|  return error;
   83|   182k|}
ixheaace_mps_212_onset_detect_apply:
   88|   182k|    WORD32 p_transient_pos[MAX_NUM_TRANS]) {
   89|   182k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   182k|#define IA_NO_ERROR 0x00000000
  ------------------
   90|   182k|  WORD32 slot, tran_cnt, curr_pos;
   91|   182k|  WORD32 trans;
   92|   182k|  WORD32 lower_bound_onset_detection = pstr_onset_detect->lower_bound_onset_detection;
   93|   182k|  WORD32 upper_bound_onset_detection = pstr_onset_detect->upper_bound_onset_detection;
   94|   182k|  WORD32 avg_energy = pstr_onset_detect->avg_energy_dist;
   95|   182k|  WORD32 curr_pos_prev;
   96|   182k|  FLOAT32 p1, p2;
   97|   182k|  FLOAT32 threshold_square = (FLOAT32)SPACE_ONSET_THRESHOLD_SQUARE_FLT;
  ------------------
  |  |   75|   182k|#define SPACE_ONSET_THRESHOLD_SQUARE_FLT ((1.0 / (SPACE_ONSET_THRESHOLD * SPACE_ONSET_THRESHOLD)))
  |  |  ------------------
  |  |  |  |   74|   182k|#define SPACE_ONSET_THRESHOLD (3.0)
  |  |  ------------------
  |  |               #define SPACE_ONSET_THRESHOLD_SQUARE_FLT ((1.0 / (SPACE_ONSET_THRESHOLD * SPACE_ONSET_THRESHOLD)))
  |  |  ------------------
  |  |  |  |   74|   182k|#define SPACE_ONSET_THRESHOLD (3.0)
  |  |  ------------------
  ------------------
   98|   182k|  FLOAT32 *ptr_energy = pstr_onset_detect->p_energy_hist;
   99|   182k|  FLOAT32 energy[16 + MAX_TIME_SLOTS];
  100|   182k|  memset(energy, 0, (16 + MAX_TIME_SLOTS) * sizeof(FLOAT32));
  ------------------
  |  |   44|   182k|#define MAX_TIME_SLOTS (64)
  ------------------
  101|   182k|  tran_cnt = 0;
  102|   182k|  p2 = 0.0f;
  103|   729k|  for (trans = 0; trans < MAX_NUM_TRANS; trans++) {
  ------------------
  |  |   76|   729k|#define MAX_NUM_TRANS (MAX_NUM_PARAMS / 2)
  |  |  ------------------
  |  |  |  |   42|   729k|#define MAX_NUM_PARAMS (7)
  |  |  ------------------
  ------------------
  |  Branch (103:19): [True: 547k, False: 182k]
  ------------------
  104|   547k|    p_transient_pos[trans] = -1;
  105|   547k|  }
  106|       |
  107|   182k|  if (prev_pos <= 0) {
  ------------------
  |  Branch (107:7): [True: 182k, False: 0]
  ------------------
  108|   182k|    curr_pos = num_time_slots;
  109|   182k|  } else {
  110|      0|    curr_pos = MAX(num_time_slots, prev_pos - num_time_slots + pstr_onset_detect->min_trans_dist);
  ------------------
  |  |   24|      0|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  111|      0|  }
  112|       |
  113|  6.37M|  for (slot = 0; slot < num_time_slots; slot++) {
  ------------------
  |  Branch (113:18): [True: 6.19M, False: 182k]
  ------------------
  114|  6.19M|    ptr_energy[avg_energy + slot] = ixheaace_mps_212_sum_up_cplx_pow_2(
  115|  6.19M|        &pp_hybrid_data[slot][lower_bound_onset_detection + 1],
  116|  6.19M|        upper_bound_onset_detection - lower_bound_onset_detection - 1);
  117|  6.19M|  }
  118|       |
  119|  9.29M|  for (slot = 0; slot < (num_time_slots + avg_energy); slot++) {
  ------------------
  |  Branch (119:18): [True: 9.11M, False: 182k]
  ------------------
  120|  9.11M|    energy[slot] = ptr_energy[slot];
  121|  9.11M|  }
  122|       |
  123|   182k|  curr_pos_prev = curr_pos;
  124|  5.96M|  for (; (curr_pos < (num_time_slots << 1)) && (tran_cnt < MAX_NUM_TRANS); curr_pos++) {
  ------------------
  |  |   76|  5.78M|#define MAX_NUM_TRANS (MAX_NUM_PARAMS / 2)
  |  |  ------------------
  |  |  |  |   42|  5.78M|#define MAX_NUM_PARAMS (7)
  |  |  ------------------
  ------------------
  |  Branch (124:10): [True: 5.78M, False: 182k]
  |  Branch (124:48): [True: 5.78M, False: 29]
  ------------------
  125|  5.78M|    p1 = energy[curr_pos - num_time_slots + avg_energy] * threshold_square;
  126|       |
  127|  5.78M|    if (curr_pos_prev != (curr_pos - 1)) {
  ------------------
  |  Branch (127:9): [True: 230k, False: 5.55M]
  ------------------
  128|   230k|      p2 = 0.0f;
  129|  3.91M|      for (slot = 0; slot < avg_energy; slot++) {
  ------------------
  |  Branch (129:22): [True: 3.68M, False: 230k]
  ------------------
  130|  3.68M|        p2 += energy[curr_pos - num_time_slots + slot];
  131|  3.68M|      }
  132|  5.55M|    } else {
  133|  5.55M|      p2 += energy[curr_pos - num_time_slots + avg_energy - 1];
  134|       |#ifdef _WIN32
  135|       |#pragma warning(suppress : 6385)
  136|       |#endif
  137|  5.55M|      p2 -= energy[curr_pos_prev - num_time_slots];
  138|  5.55M|    }
  139|  5.78M|    curr_pos_prev = curr_pos;
  140|       |
  141|  5.78M|    if (p1 > p2) {
  ------------------
  |  Branch (141:9): [True: 52.8k, False: 5.73M]
  ------------------
  142|  52.8k|      p_transient_pos[tran_cnt++] = curr_pos;
  143|  52.8k|      curr_pos += pstr_onset_detect->min_trans_dist;
  144|  52.8k|    }
  145|  5.78M|  }
  146|       |
  147|   182k|  return error;
  148|   182k|}

ixheaace_mps_212_calc_parameter_band_to_hybrid_band_offset:
  162|  1.28k|    const WORD32 num_hybrid_bands, UWORD8 *ptr_parameter_band_2_hybrid_band_offset, WORD32 aot) {
  163|  1.28k|  ixheaace_mps_box_subband_setup pstr_box_subband_setup;
  164|  1.28k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (164:7): [True: 151, False: 1.12k]
  ------------------
  165|    151|    pstr_box_subband_setup.p_subband_2_parameter_index_ld = (UWORD8 *)subband_2_parameter_ld;
  166|    151|    pstr_box_subband_setup.icc_correlation_coherence_border = 5;
  167|  1.12k|  } else {
  168|  1.12k|    pstr_box_subband_setup.p_subband_2_parameter_index_ld = (UWORD8 *)subband_2_parameter_usac;
  169|  1.12k|    pstr_box_subband_setup.icc_correlation_coherence_border = 8;
  170|  1.12k|  }
  171|       |
  172|  1.28k|  const UWORD8 *p_subband_2_parameter_index;
  173|       |
  174|  1.28k|  UWORD8 idx;
  175|  1.28k|  WORD32 band;
  176|       |
  177|  1.28k|  p_subband_2_parameter_index = pstr_box_subband_setup.p_subband_2_parameter_index_ld;
  178|       |
  179|  81.9k|  for (band = 0, idx = NUM_QMF_BANDS - 1; idx > NUM_QMF_BANDS - num_hybrid_bands; idx--) {
  ------------------
  |  |   43|  1.28k|#define NUM_QMF_BANDS (64)
  ------------------
                for (band = 0, idx = NUM_QMF_BANDS - 1; idx > NUM_QMF_BANDS - num_hybrid_bands; idx--) {
  ------------------
  |  |   43|  81.9k|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (179:43): [True: 80.6k, False: 1.28k]
  ------------------
  180|  80.6k|    if (p_subband_2_parameter_index[idx - 1] - p_subband_2_parameter_index[idx]) {
  ------------------
  |  Branch (180:9): [True: 33.7k, False: 46.9k]
  ------------------
  181|  33.7k|      ptr_parameter_band_2_hybrid_band_offset[band++] = (NUM_QMF_BANDS - idx);
  ------------------
  |  |   43|  33.7k|#define NUM_QMF_BANDS (64)
  ------------------
  182|  33.7k|    }
  183|  80.6k|  }
  184|  1.28k|  ptr_parameter_band_2_hybrid_band_offset[band++] = (NUM_QMF_BANDS - idx);
  ------------------
  |  |   43|  1.28k|#define NUM_QMF_BANDS (64)
  ------------------
  185|  1.28k|}
ixheaace_mps_212_init_tto_box:
  190|  1.28k|                              UWORD8 *ptr_parameter_band_2_hybrid_band_offset, WORD32 aot) {
  191|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
  192|       |
  193|  1.28k|  {
  194|  1.28k|    memset(pstr_tto_box, 0, sizeof(ixheaace_mps_tto_box));
  195|  1.28k|    pstr_tto_box->use_coarse_quant_cld_flag = pstr_tto_box_config->use_coarse_quant_cld_flag;
  196|  1.28k|    pstr_tto_box->use_coarse_quant_icc_flag = pstr_tto_box_config->use_coarse_quant_icc_flag;
  197|  1.28k|    pstr_tto_box->box_quant_mode = pstr_tto_box_config->box_quant_mode;
  198|  1.28k|    pstr_tto_box->icc_correlation_coherence_border =
  199|  1.28k|        ixheaace_mps_212_get_icc_correlation_coherence_border(
  200|  1.28k|            aot, pstr_tto_box_config->b_use_coherence_icc_only);
  201|  1.28k|    pstr_tto_box->num_hybrid_bands_max = pstr_tto_box_config->num_hybrid_bands_max;
  202|  1.28k|    if (aot == 39) {
  ------------------
  |  Branch (202:9): [True: 151, False: 1.12k]
  ------------------
  203|    151|      pstr_tto_box->num_parameter_bands = IXHEAACE_MPS_SAC_BANDS_ld;
  ------------------
  |  |  133|    151|#define IXHEAACE_MPS_SAC_BANDS_ld (15)
  ------------------
  204|  1.12k|    } else {
  205|  1.12k|      pstr_tto_box->num_parameter_bands = IXHEAACE_MPS_SAC_BANDS_usac;
  ------------------
  |  |  134|  1.12k|#define IXHEAACE_MPS_SAC_BANDS_usac (28)
  ------------------
  206|  1.12k|    }
  207|  1.28k|    pstr_tto_box->ptr_parameter_band_2_hybrid_band_offset =
  208|  1.28k|        ptr_parameter_band_2_hybrid_band_offset;
  209|  1.28k|    pstr_tto_box->frame_keep_flag = pstr_tto_box_config->frame_keep_flag;
  210|  1.28k|    pstr_tto_box->n_cld_quant_steps = pstr_tto_box->use_coarse_quant_cld_flag
  ------------------
  |  Branch (210:39): [True: 0, False: 1.28k]
  ------------------
  211|  1.28k|                                          ? IXHEAACE_MPS_MAX_CLD_QUANT_COARSE
  ------------------
  |  |   90|      0|#define IXHEAACE_MPS_MAX_CLD_QUANT_COARSE (15)
  ------------------
  212|  1.28k|                                          : IXHEAACE_MPS_MAX_CLD_QUANT_FINE;
  ------------------
  |  |   89|  2.56k|#define IXHEAACE_MPS_MAX_CLD_QUANT_FINE (31)
  ------------------
  213|  1.28k|    pstr_tto_box->n_cld_quant_offset = pstr_tto_box->use_coarse_quant_cld_flag
  ------------------
  |  Branch (213:40): [True: 0, False: 1.28k]
  ------------------
  214|  1.28k|                                           ? IXHEAACE_MPS_OFFSET_CLD_QUANT_COARSE
  ------------------
  |  |   91|      0|#define IXHEAACE_MPS_OFFSET_CLD_QUANT_COARSE (7)
  ------------------
  215|  1.28k|                                           : IXHEAACE_MPS_OFFSET_CLD_QUANT_FINE;
  ------------------
  |  |   92|  2.56k|#define IXHEAACE_MPS_OFFSET_CLD_QUANT_FINE (15)
  ------------------
  216|  1.28k|    pstr_tto_box->n_icc_quant_steps = pstr_tto_box->use_coarse_quant_icc_flag
  ------------------
  |  Branch (216:39): [True: 0, False: 1.28k]
  ------------------
  217|  1.28k|                                          ? IXHEAACE_MPS_MAX_ICC_QUANT_COARSE
  ------------------
  |  |   94|      0|#define IXHEAACE_MPS_MAX_ICC_QUANT_COARSE (4)
  ------------------
  218|  1.28k|                                          : IXHEAACE_MPS_MAX_ICC_QUANT_FINE;
  ------------------
  |  |   95|  2.56k|#define IXHEAACE_MPS_MAX_ICC_QUANT_FINE (8)
  ------------------
  219|  1.28k|    pstr_tto_box->n_icc_quant_offset = pstr_tto_box->use_coarse_quant_icc_flag
  ------------------
  |  Branch (219:40): [True: 0, False: 1.28k]
  ------------------
  220|  1.28k|                                           ? IXHEAACE_MPS_OFFSET_ICC_QUANT_COARSE
  ------------------
  |  |   96|      0|#define IXHEAACE_MPS_OFFSET_ICC_QUANT_COARSE (0)
  ------------------
  221|  1.28k|                                           : IXHEAACE_MPS_OFFSET_ICC_QUANT_FINE;
  ------------------
  |  |   97|  2.56k|#define IXHEAACE_MPS_OFFSET_ICC_QUANT_FINE (0)
  ------------------
  222|  1.28k|    pstr_tto_box->p_icc_quant_table =
  223|  1.28k|        pstr_tto_box->use_coarse_quant_icc_flag ? icc_quant_table_coarse : icc_quant_table_fine;
  ------------------
  |  Branch (223:9): [True: 0, False: 1.28k]
  ------------------
  224|  1.28k|    pstr_tto_box->p_cld_quant_table_enc = pstr_tto_box->use_coarse_quant_cld_flag
  ------------------
  |  Branch (224:43): [True: 0, False: 1.28k]
  ------------------
  225|  1.28k|                                              ? cld_quant_table_coarse_enc
  226|  1.28k|                                              : cld_quant_table_fine_enc;
  227|       |
  228|  1.28k|    if ((pstr_tto_box->box_quant_mode != IXHEAACE_MPS_QUANTMODE_FINE) &&
  ------------------
  |  |  137|  1.28k|#define IXHEAACE_MPS_QUANTMODE_FINE (0)
  ------------------
  |  Branch (228:9): [True: 0, False: 1.28k]
  ------------------
  229|      0|        (pstr_tto_box->box_quant_mode != IXHEAACE_MPS_QUANTMODE_EBQ1) &&
  ------------------
  |  |  138|      0|#define IXHEAACE_MPS_QUANTMODE_EBQ1 (1)
  ------------------
  |  Branch (229:9): [True: 0, False: 0]
  ------------------
  230|      0|        (pstr_tto_box->box_quant_mode != IXHEAACE_MPS_QUANTMODE_EBQ2)) {
  ------------------
  |  |  139|      0|#define IXHEAACE_MPS_QUANTMODE_EBQ2 (2)
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|      return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  232|      0|    }
  233|  1.28k|  }
  234|  1.28k|  return error;
  235|  1.28k|}
ixheaace_mps_212_apply_tto_box:
  243|  91.2k|    const WORD32 b_use_bb_cues) {
  244|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  245|       |
  246|  91.2k|  WORD32 j, band;
  247|  91.2k|  FLOAT32 power_hybrid_data_1[MAX_NUM_PARAM_BANDS] = {0};
  248|  91.2k|  FLOAT32 power_hybrid_data_2[MAX_NUM_PARAM_BANDS] = {0};
  249|  91.2k|  FLOAT32 prod_hybrid_data_real[MAX_NUM_PARAM_BANDS] = {0};
  250|  91.2k|  FLOAT32 prod_hybrid_data_imag[MAX_NUM_PARAM_BANDS] = {0};
  251|  91.2k|  const WORD32 num_param_bands = pstr_tto_box->num_parameter_bands;
  252|  91.2k|  const WORD32 use_box_quant_mode =
  253|  91.2k|      (pstr_tto_box->box_quant_mode == IXHEAACE_MPS_QUANTMODE_EBQ1) ||
  ------------------
  |  |  138|  91.2k|#define IXHEAACE_MPS_QUANTMODE_EBQ1 (1)
  ------------------
  |  Branch (253:7): [True: 0, False: 91.2k]
  ------------------
  254|  91.2k|      (pstr_tto_box->box_quant_mode == IXHEAACE_MPS_QUANTMODE_EBQ2);
  ------------------
  |  |  139|  91.2k|#define IXHEAACE_MPS_QUANTMODE_EBQ2 (2)
  ------------------
  |  Branch (254:7): [True: 0, False: 91.2k]
  ------------------
  255|       |
  256|  91.2k|  if ((num_hybrid_bands < 0) || (num_hybrid_bands > pstr_tto_box->num_hybrid_bands_max)) {
  ------------------
  |  Branch (256:7): [True: 0, False: 91.2k]
  |  Branch (256:33): [True: 0, False: 91.2k]
  ------------------
  257|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  258|      0|  }
  259|       |
  260|  2.48M|  for (j = 0, band = 0; band < num_param_bands; band++) {
  ------------------
  |  Branch (260:25): [True: 2.39M, False: 91.2k]
  ------------------
  261|  2.39M|    FLOAT32 data_1, data_2;
  262|  2.39M|    data_1 = 0;
  263|  2.39M|    data_2 = 0;
  264|  7.52M|    for (; j < pstr_tto_box->ptr_parameter_band_2_hybrid_band_offset[band]; j++) {
  ------------------
  |  Branch (264:12): [True: 5.12M, False: 2.39M]
  ------------------
  265|  5.12M|      data_1 += ixheaace_mps_212_sum_up_cplx_pow_2_dim_2(pp_hybrid_data_1, start_time_slot,
  266|  5.12M|                                                         num_time_slots, j, j + 1);
  267|  5.12M|      data_2 += ixheaace_mps_212_sum_up_cplx_pow_2_dim_2(pp_hybrid_data_2, start_time_slot,
  268|  5.12M|                                                         num_time_slots, j, j + 1);
  269|  5.12M|    }
  270|       |
  271|  2.39M|    power_hybrid_data_1[band] = data_1;
  272|  2.39M|    power_hybrid_data_2[band] = data_2;
  273|  2.39M|  }
  274|  2.48M|  for (j = 0, band = 0; band < num_param_bands; band++) {
  ------------------
  |  Branch (274:25): [True: 2.39M, False: 91.2k]
  ------------------
  275|  2.39M|    FLOAT32 data_real, data_imag;
  276|  2.39M|    data_real = data_imag = 0;
  277|  7.52M|    for (; j < pstr_tto_box->ptr_parameter_band_2_hybrid_band_offset[band]; j++) {
  ------------------
  |  Branch (277:12): [True: 5.12M, False: 2.39M]
  ------------------
  278|  5.12M|      ixheaace_cmplx_str scalar_prod;
  279|  5.12M|      ixheaace_mps_212_cplx_scalar_product(&scalar_prod, pp_hybrid_data_1, pp_hybrid_data_2,
  280|  5.12M|                                           start_time_slot, num_time_slots, j, j + 1);
  281|  5.12M|      data_real += scalar_prod.re;
  282|  5.12M|      data_imag += scalar_prod.im;
  283|  5.12M|    }
  284|  2.39M|    prod_hybrid_data_real[band] = data_real;
  285|  2.39M|    prod_hybrid_data_imag[band] = data_imag;
  286|  2.39M|  }
  287|       |
  288|  91.2k|  ixheaace_mps_212_calc_correlation_vec(pstr_tto_box->icc, prod_hybrid_data_real,
  289|  91.2k|                                        power_hybrid_data_1, power_hybrid_data_2,
  290|  91.2k|                                        pstr_tto_box->icc_correlation_coherence_border);
  291|       |
  292|  91.2k|  ixheaace_mps_212_calc_coherence_vec(
  293|  91.2k|      &pstr_tto_box->icc[pstr_tto_box->icc_correlation_coherence_border],
  294|  91.2k|      &prod_hybrid_data_real[pstr_tto_box->icc_correlation_coherence_border],
  295|  91.2k|      &prod_hybrid_data_imag[pstr_tto_box->icc_correlation_coherence_border],
  296|  91.2k|      &power_hybrid_data_1[pstr_tto_box->icc_correlation_coherence_border],
  297|  91.2k|      &power_hybrid_data_2[pstr_tto_box->icc_correlation_coherence_border],
  298|  91.2k|      num_param_bands - pstr_tto_box->icc_correlation_coherence_border);
  299|  91.2k|  if (error) {
  ------------------
  |  Branch (299:7): [True: 0, False: 91.2k]
  ------------------
  300|      0|    return error;
  301|      0|  }
  302|  91.2k|  if (!use_box_quant_mode) {
  ------------------
  |  Branch (302:7): [True: 91.2k, False: 0]
  ------------------
  303|  91.2k|    FLOAT32 power_1, power_2, cld;
  304|  91.2k|    FLOAT32 max_pow = 30.0f;
  305|       |
  306|  2.48M|    for (band = 0; band < num_param_bands; band++) {
  ------------------
  |  Branch (306:20): [True: 2.39M, False: 91.2k]
  ------------------
  307|  2.39M|      power_1 = (FLOAT32)log(power_hybrid_data_1[band] / 2.0f);
  308|  2.39M|      power_2 = (FLOAT32)log(power_hybrid_data_2[band] / 2.0f);
  309|  2.39M|      power_1 = MAX(MIN(power_1, max_pow), -max_pow);
  ------------------
  |  |   24|  4.79M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.27M, False: 118k]
  |  |  |  Branch (24:21): [True: 2.39M, False: 0]
  |  |  |  Branch (24:33): [True: 2.27M, False: 0]
  |  |  ------------------
  ------------------
  310|  2.39M|      power_2 = MAX(MIN(power_2, max_pow), -max_pow);
  ------------------
  |  |   24|  4.79M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.27M, False: 118k]
  |  |  |  Branch (24:21): [True: 2.39M, False: 0]
  |  |  |  Branch (24:33): [True: 2.27M, False: 0]
  |  |  ------------------
  ------------------
  311|  2.39M|      cld = (INV_LN_10_10 * (power_1 - power_2));
  ------------------
  |  |  128|  2.39M|#define INV_LN_10_10 (4.3429448190325182765112891891661f)
  ------------------
  312|  2.39M|      pstr_tto_box->cld[band] = cld;
  313|  2.39M|    }
  314|  91.2k|  }
  315|       |
  316|  91.2k|  if (b_use_bb_cues) {
  ------------------
  |  Branch (316:7): [True: 0, False: 91.2k]
  ------------------
  317|      0|    FLOAT32 temp;
  318|      0|    temp = 0;
  319|      0|    for (band = 0; band < num_param_bands; band++) {
  ------------------
  |  Branch (319:20): [True: 0, False: 0]
  ------------------
  320|      0|      temp += pstr_tto_box->cld[band];
  321|      0|    }
  322|      0|    temp /= num_param_bands;
  323|      0|    for (band = 0; band < num_param_bands; band++) {
  ------------------
  |  Branch (323:20): [True: 0, False: 0]
  ------------------
  324|      0|      pstr_tto_box->cld[band] = temp;
  325|      0|    }
  326|      0|  }
  327|       |
  328|  91.2k|  ixheaace_mps_212_quantize_coef(
  329|  91.2k|      pstr_tto_box->icc, num_param_bands, pstr_tto_box->p_icc_quant_table,
  330|  91.2k|      pstr_tto_box->n_icc_quant_offset, pstr_tto_box->n_icc_quant_steps, ptr_icc);
  331|       |
  332|  91.2k|  *pb_icc_quant_coarse = pstr_tto_box->use_coarse_quant_icc_flag;
  333|       |
  334|  91.2k|  if (!use_box_quant_mode) {
  ------------------
  |  Branch (334:7): [True: 91.2k, False: 0]
  ------------------
  335|  91.2k|    ixheaace_mps_212_quantize_coef(
  336|  91.2k|        pstr_tto_box->cld, num_param_bands, pstr_tto_box->p_cld_quant_table_enc,
  337|  91.2k|        pstr_tto_box->n_cld_quant_offset, pstr_tto_box->n_cld_quant_steps, ptr_cld);
  338|  91.2k|  } else {
  339|      0|    memset(ptr_cld, 0, num_param_bands * sizeof(WORD8));
  340|      0|  }
  341|  91.2k|  *pb_cld_quant_coarse = pstr_tto_box->use_coarse_quant_cld_flag;
  342|       |
  343|  91.2k|  return error;
  344|  91.2k|}
ixheaace_mps_param_extract.c:ixheaace_mps_212_get_icc_correlation_coherence_border:
   54|  1.28k|    const WORD32 aot, const WORD32 use_coherence_only) {
   55|  1.28k|  ixheaace_mps_box_subband_setup pstr_box_subband_setup;
   56|       |
   57|  1.28k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.28k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (57:7): [True: 151, False: 1.12k]
  ------------------
   58|    151|    pstr_box_subband_setup.p_subband_2_parameter_index_ld = (UWORD8 *)subband_2_parameter_ld;
   59|    151|    pstr_box_subband_setup.icc_correlation_coherence_border = 5;
   60|  1.12k|  } else {
   61|  1.12k|    pstr_box_subband_setup.p_subband_2_parameter_index_ld = (UWORD8 *)subband_2_parameter_usac;
   62|  1.12k|    pstr_box_subband_setup.icc_correlation_coherence_border = 8;
   63|  1.12k|  }
   64|       |
   65|  1.28k|  return ((use_coherence_only) ? 0 : pstr_box_subband_setup.icc_correlation_coherence_border);
  ------------------
  |  Branch (65:11): [True: 0, False: 1.28k]
  ------------------
   66|  1.28k|}
ixheaace_mps_param_extract.c:ixheaace_mps_212_calc_correlation_vec:
   72|  91.2k|                                                  const WORD32 icc_correlation_coherence_border) {
   73|  91.2k|  WORD32 idx;
   74|  91.2k|  FLOAT32 p_12;
   75|       |
   76|   784k|  for (idx = 0; idx < icc_correlation_coherence_border; idx++) {
  ------------------
  |  Branch (76:17): [True: 693k, False: 91.2k]
  ------------------
   77|   693k|    p_12 = power_data_1[idx] * power_data_2[idx];
   78|   693k|    if (p_12 > 0.0f) {
  ------------------
  |  Branch (78:9): [True: 658k, False: 34.3k]
  ------------------
   79|   658k|      p_12 = 1.0f / ((FLOAT32)sqrt(p_12));
   80|   658k|      data[idx] = data_real[idx] * p_12;
   81|   658k|    } else {
   82|  34.3k|      data[idx] = 0.9995f;
   83|  34.3k|    }
   84|   693k|  }
   85|  91.2k|}
ixheaace_mps_param_extract.c:ixheaace_mps_212_calc_coherence_vec:
   92|  91.2k|                                                const WORD32 icc_correlation_coherence_border) {
   93|  91.2k|  WORD32 idx;
   94|  91.2k|  FLOAT32 coh, p_12, p_12_ri;
   95|       |
   96|  1.79M|  for (idx = 0; idx < icc_correlation_coherence_border; idx++) {
  ------------------
  |  Branch (96:17): [True: 1.70M, False: 91.2k]
  ------------------
   97|  1.70M|    p_12_ri = (FLOAT32)(sqrt(data_real[idx] * data_real[idx] + data_imag[idx] * data_imag[idx]));
   98|  1.70M|    p_12 = power_data_1[idx] * power_data_2[idx];
   99|       |
  100|  1.70M|    if (p_12 > 0.0f) {
  ------------------
  |  Branch (100:9): [True: 1.62M, False: 75.1k]
  ------------------
  101|  1.62M|      p_12 = 1.0f / ((FLOAT32)sqrt(p_12));
  102|  1.62M|      coh = p_12_ri * p_12;
  103|  1.62M|      data[idx] = coh;
  104|  1.62M|    } else {
  105|  75.1k|      data[idx] = 0.9995f;
  106|  75.1k|    }
  107|  1.70M|  }
  108|  91.2k|}
ixheaace_mps_param_extract.c:ixheaace_mps_212_quantize_coef:
  113|   182k|                                           WORD8 *const quant_out) {
  114|   182k|  WORD32 band;
  115|   182k|  WORD32 forward = (quant_table[1] >= quant_table[0]);
  116|       |
  117|  4.97M|  for (band = 0; band < num_bands; band++) {
  ------------------
  |  Branch (117:18): [True: 4.79M, False: 182k]
  ------------------
  118|  4.79M|    FLOAT32 q_val;
  119|  4.79M|    FLOAT32 cur_val = input[band];
  120|  4.79M|    WORD32 upper = num_quant_steps - 1;
  121|  4.79M|    WORD32 lower = 0;
  122|  4.79M|    if (forward) {
  ------------------
  |  Branch (122:9): [True: 2.39M, False: 2.39M]
  ------------------
  123|  13.9M|      while (upper - lower > 1) {
  ------------------
  |  Branch (123:14): [True: 11.5M, False: 2.39M]
  ------------------
  124|  11.5M|        WORD32 idx = (lower + upper) >> 1;
  125|  11.5M|        q_val = quant_table[idx];
  126|  11.5M|        if (cur_val <= q_val) {
  ------------------
  |  Branch (126:13): [True: 3.48M, False: 8.10M]
  ------------------
  127|  3.48M|          upper = idx;
  128|  8.10M|        } else {
  129|  8.10M|          lower = idx;
  130|  8.10M|        }
  131|  11.5M|      }
  132|       |
  133|  2.39M|      if ((cur_val - quant_table[lower]) > (quant_table[upper] - cur_val)) {
  ------------------
  |  Branch (133:11): [True: 1.89M, False: 504k]
  ------------------
  134|  1.89M|        quant_out[band] = (WORD8)(upper - idx_offset);
  135|  1.89M|      } else {
  136|   504k|        quant_out[band] = (WORD8)(lower - idx_offset);
  137|   504k|      }
  138|  2.39M|    } else {
  139|  7.50M|      while (upper - lower > 1) {
  ------------------
  |  Branch (139:14): [True: 5.10M, False: 2.39M]
  ------------------
  140|  5.10M|        WORD32 idx = (lower + upper) >> 1;
  141|  5.10M|        q_val = quant_table[idx];
  142|  5.10M|        if (cur_val >= q_val) {
  ------------------
  |  Branch (142:13): [True: 4.55M, False: 553k]
  ------------------
  143|  4.55M|          upper = idx;
  144|  4.55M|        } else {
  145|   553k|          lower = idx;
  146|   553k|        }
  147|  5.10M|      }
  148|       |
  149|  2.39M|      if ((cur_val - quant_table[lower]) < (quant_table[upper] - cur_val)) {
  ------------------
  |  Branch (149:11): [True: 177k, False: 2.21M]
  ------------------
  150|   177k|        quant_out[band] = (WORD8)(upper - idx_offset);
  151|  2.21M|      } else {
  152|  2.21M|        quant_out[band] = (WORD8)(lower - idx_offset);
  153|  2.21M|      }
  154|  2.39M|    }
  155|  4.79M|    if (quant_out[band] != 0) {
  ------------------
  |  Branch (155:9): [True: 669k, False: 4.12M]
  ------------------
  156|   669k|      quant_out[band] = quant_out[band];
  157|   669k|    }
  158|  4.79M|  }
  159|   182k|}

ixheaace_mps_515_calculate_sbr_syn_filterbank:
  912|  36.1k|    FLOAT32 *sbr_qmf_states_synthesis_per) {
  913|  36.1k|  WORD32 idx, subband, slot;
  914|  36.1k|  const FLOAT32 *ptr_filter;
  915|  36.1k|  FLOAT32 accumlate;
  916|  36.1k|  FLOAT32 *synth_buf;
  917|       |
  918|  36.1k|  synth_buf = &(sbr_qmf_states_synthesis_per[channel * QMF_FILTER_STATE_SYN_SIZE]);
  ------------------
  |  |   38|  36.1k|#define QMF_FILTER_STATE_SYN_SIZE (640)
  ------------------
  919|       |
  920|   596k|  for (slot = 0; slot < slots; slot++) {
  ------------------
  |  Branch (920:18): [True: 560k, False: 36.1k]
  ------------------
  921|   560k|    ptr_filter = pstr_qmf_synth_filter_bank->p_filter;
  922|   560k|    ixheaace_mps_inverse_modulation(real_subband + NUM_QMF_BANDS * slot,
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  923|   560k|                                    imag_subband + NUM_QMF_BANDS * slot,
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  924|   560k|                                    pstr_qmf_synth_filter_bank);
  925|       |
  926|  36.4M|    for (subband = 0; subband < NUM_QMF_BANDS; subband++) {
  ------------------
  |  |   43|  36.4M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (926:23): [True: 35.8M, False: 560k]
  ------------------
  927|  35.8M|      real_subband[NUM_QMF_BANDS * slot + subband] =
  ------------------
  |  |   43|  35.8M|#define NUM_QMF_BANDS (64)
  ------------------
  928|  35.8M|          real_subband[NUM_QMF_BANDS * slot + subband] * (-0.015625f);
  ------------------
  |  |   43|  35.8M|#define NUM_QMF_BANDS (64)
  ------------------
  929|  35.8M|      imag_subband[NUM_QMF_BANDS * slot + subband] =
  ------------------
  |  |   43|  35.8M|#define NUM_QMF_BANDS (64)
  ------------------
  930|  35.8M|          imag_subband[NUM_QMF_BANDS * slot + subband] * (-0.015625f);
  ------------------
  |  |   43|  35.8M|#define NUM_QMF_BANDS (64)
  ------------------
  931|  35.8M|    }
  932|       |
  933|  36.4M|    for (subband = 0; subband < NUM_QMF_BANDS; subband++) {
  ------------------
  |  |   43|  36.4M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (933:23): [True: 35.8M, False: 560k]
  ------------------
  934|  35.8M|      FLOAT32 new_sample;
  935|  35.8M|      new_sample = imag_subband[NUM_QMF_BANDS * slot + 63 - subband];
  ------------------
  |  |   43|  35.8M|#define NUM_QMF_BANDS (64)
  ------------------
  936|       |
  937|   215M|      for (idx = 0; idx < 5; idx++) {
  ------------------
  |  Branch (937:21): [True: 179M, False: 35.8M]
  ------------------
  938|   179M|        accumlate = synth_buf[2 * idx * NUM_QMF_BANDS + subband] + (*ptr_filter++) * new_sample;
  ------------------
  |  |   43|   179M|#define NUM_QMF_BANDS (64)
  ------------------
  939|   179M|        synth_buf[2 * idx * NUM_QMF_BANDS + subband] = accumlate;
  ------------------
  |  |   43|   179M|#define NUM_QMF_BANDS (64)
  ------------------
  940|   179M|      }
  941|  35.8M|    }
  942|       |
  943|  3.36M|    for (idx = 0; idx < 5; idx++) {
  ------------------
  |  Branch (943:19): [True: 2.80M, False: 560k]
  ------------------
  944|  2.80M|      accumlate = synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + (NUM_QMF_BANDS - 1)] +
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
                    accumlate = synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + (NUM_QMF_BANDS - 1)] +
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
                    accumlate = synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + (NUM_QMF_BANDS - 1)] +
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
  945|  2.80M|                  (*ptr_filter++) * real_subband[NUM_QMF_BANDS * slot];
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
  946|  2.80M|      synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + (NUM_QMF_BANDS - 1)] = accumlate;
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
                    synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + (NUM_QMF_BANDS - 1)] = accumlate;
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
                    synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + (NUM_QMF_BANDS - 1)] = accumlate;
  ------------------
  |  |   43|  2.80M|#define NUM_QMF_BANDS (64)
  ------------------
  947|  2.80M|    }
  948|   560k|    time_sig[0] = accumlate;
  949|       |
  950|   560k|    ptr_filter -= 10;
  951|       |
  952|  35.8M|    for (subband = 0; subband < 63; subband++) {
  ------------------
  |  Branch (952:23): [True: 35.3M, False: 560k]
  ------------------
  953|  35.3M|      FLOAT32 new_sample;
  954|       |
  955|  35.3M|      new_sample = real_subband[NUM_QMF_BANDS * slot + 63 - subband];
  ------------------
  |  |   43|  35.3M|#define NUM_QMF_BANDS (64)
  ------------------
  956|       |
  957|   211M|      for (idx = 0; idx < 5; idx++) {
  ------------------
  |  Branch (957:21): [True: 176M, False: 35.3M]
  ------------------
  958|   176M|        accumlate = synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + subband] +
  ------------------
  |  |   43|   176M|#define NUM_QMF_BANDS (64)
  ------------------
                      accumlate = synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + subband] +
  ------------------
  |  |   43|   176M|#define NUM_QMF_BANDS (64)
  ------------------
  959|   176M|                    (*--ptr_filter) * new_sample;
  960|   176M|        synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + subband] = accumlate;
  ------------------
  |  |   43|   176M|#define NUM_QMF_BANDS (64)
  ------------------
                      synth_buf[2 * idx * NUM_QMF_BANDS + NUM_QMF_BANDS + subband] = accumlate;
  ------------------
  |  |   43|   176M|#define NUM_QMF_BANDS (64)
  ------------------
  961|   176M|      }
  962|       |
  963|  35.3M|      time_sig[NUM_QMF_BANDS - 1 - subband] = accumlate;
  ------------------
  |  |   43|  35.3M|#define NUM_QMF_BANDS (64)
  ------------------
  964|  35.3M|    }
  965|       |
  966|   560k|    time_sig += NUM_QMF_BANDS;
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  967|       |
  968|   560k|    memmove((synth_buf + NUM_QMF_BANDS), synth_buf, (640 - NUM_QMF_BANDS) * sizeof(FLOAT32));
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
                  memmove((synth_buf + NUM_QMF_BANDS), synth_buf, (640 - NUM_QMF_BANDS) * sizeof(FLOAT32));
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  969|       |
  970|   560k|    memset((synth_buf), 0, NUM_QMF_BANDS * sizeof(FLOAT32));
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  971|   560k|  }
  972|  36.1k|}
ixheaace_mps_515_calculate_ana_filterbank:
  977|  2.04M|    ixheaace_mps_sac_pstr_qmf_ana_filter_bank pstr_qmf_synth_filter_bank) {
  978|  2.04M|  WORD32 idx;
  979|  2.04M|  FLOAT32 temp_array[128];
  980|  2.04M|  const FLOAT32 *ptr_filter = pstr_qmf_synth_filter_bank->p_filter;
  981|  2.04M|  FLOAT32 accumlate;
  982|       |
  983|  1.18G|  for (idx = 0; idx < 576; idx++) {
  ------------------
  |  Branch (983:17): [True: 1.17G, False: 2.04M]
  ------------------
  984|  1.17G|    pstr_sbr_enc_ana_filter_bank->x[idx] = pstr_sbr_enc_ana_filter_bank->x[idx + NUM_QMF_BANDS];
  ------------------
  |  |   43|  1.17G|#define NUM_QMF_BANDS (64)
  ------------------
  985|  1.17G|  }
  986|   132M|  for (idx = 0; idx < NUM_QMF_BANDS; idx++) {
  ------------------
  |  |   43|   132M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (986:17): [True: 130M, False: 2.04M]
  ------------------
  987|   130M|    pstr_sbr_enc_ana_filter_bank->x[idx + 576] = time_sig[idx];
  988|   130M|  }
  989|       |
  990|   132M|  for (idx = 0; idx < NUM_QMF_BANDS; idx++) {
  ------------------
  |  |   43|   132M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (990:17): [True: 130M, False: 2.04M]
  ------------------
  991|   130M|    accumlate = 0.0f;
  992|   130M|    accumlate += (*ptr_filter++ * pstr_sbr_enc_ana_filter_bank->x[idx]);
  993|   130M|    accumlate += (*ptr_filter++ * pstr_sbr_enc_ana_filter_bank->x[idx + (NUM_QMF_BANDS * 2)]);
  ------------------
  |  |   43|   130M|#define NUM_QMF_BANDS (64)
  ------------------
  994|   130M|    accumlate += (*ptr_filter++ * pstr_sbr_enc_ana_filter_bank->x[idx + (NUM_QMF_BANDS * 4)]);
  ------------------
  |  |   43|   130M|#define NUM_QMF_BANDS (64)
  ------------------
  995|   130M|    accumlate += (*ptr_filter++ * pstr_sbr_enc_ana_filter_bank->x[idx + (NUM_QMF_BANDS * 6)]);
  ------------------
  |  |   43|   130M|#define NUM_QMF_BANDS (64)
  ------------------
  996|   130M|    accumlate += (*ptr_filter++ * pstr_sbr_enc_ana_filter_bank->x[idx + (NUM_QMF_BANDS * 8)]);
  ------------------
  |  |   43|   130M|#define NUM_QMF_BANDS (64)
  ------------------
  997|   130M|    temp_array[127 - idx] = accumlate;
  998|   130M|  }
  999|       |
 1000|  2.04M|  accumlate = 0.0f;
 1001|  12.2M|  for (idx = 0; idx < 5; idx++) {
  ------------------
  |  Branch (1001:17): [True: 10.2M, False: 2.04M]
  ------------------
 1002|  10.2M|    accumlate +=
 1003|  10.2M|        (*ptr_filter++ * pstr_sbr_enc_ana_filter_bank->x[127 + idx * (NUM_QMF_BANDS * 2)]);
  ------------------
  |  |   43|  10.2M|#define NUM_QMF_BANDS (64)
  ------------------
 1004|  10.2M|  }
 1005|  2.04M|  temp_array[0] = accumlate;
 1006|       |
 1007|  2.04M|  ptr_filter -= 10;
 1008|   130M|  for (idx = 0; idx < 63; idx++) {
  ------------------
  |  Branch (1008:17): [True: 128M, False: 2.04M]
  ------------------
 1009|   128M|    accumlate = 0.0f;
 1010|   128M|    accumlate += (*--ptr_filter * pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
 1011|   128M|    accumlate += (*--ptr_filter *
 1012|   128M|                  pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 2)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
                                pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 2)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
 1013|   128M|    accumlate += (*--ptr_filter *
 1014|   128M|                  pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 4)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
                                pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 4)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
 1015|   128M|    accumlate += (*--ptr_filter *
 1016|   128M|                  pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 6)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
                                pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 6)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
 1017|   128M|    accumlate += (*--ptr_filter *
 1018|   128M|                  pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 8)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
                                pstr_sbr_enc_ana_filter_bank->x[NUM_QMF_BANDS + idx + (NUM_QMF_BANDS * 8)]);
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
 1019|   128M|    temp_array[63 - idx] = accumlate;
 1020|   128M|  }
 1021|       |
 1022|  2.04M|  ixheaace_mps_forward_modulation(temp_array, real_subband, imag_subband);
 1023|  2.04M|}
ixheaace_mps_polyphase.c:ixheaace_mps_inverse_modulation:
  630|   560k|    ixheaace_mps_sac_pstr_qmf_synth_filter_bank pstr_qmf_synth_filter_bank) {
  631|   560k|  WORD32 idx, no_synthesis_channels, length;
  632|       |
  633|   560k|  FLOAT32 r1, i1, r2, i2;
  634|       |
  635|   560k|  no_synthesis_channels = NUM_QMF_BANDS;
  ------------------
  |  |   43|   560k|#define NUM_QMF_BANDS (64)
  ------------------
  636|       |
  637|   560k|  length = no_synthesis_channels / 2;
  638|       |
  639|   560k|  ixheaace_mps_cos_mod(qmf_real, pstr_qmf_synth_filter_bank);
  640|   560k|  ixheaace_mps_sin_mod(qmf_imag, pstr_qmf_synth_filter_bank);
  641|       |
  642|  18.4M|  for (idx = 0; idx < length; idx++) {
  ------------------
  |  Branch (642:17): [True: 17.9M, False: 560k]
  ------------------
  643|  17.9M|    r1 = qmf_real[idx];
  644|  17.9M|    i2 = qmf_imag[no_synthesis_channels - 1 - idx];
  645|  17.9M|    r2 = qmf_real[no_synthesis_channels - idx - 1];
  646|  17.9M|    i1 = qmf_imag[idx];
  647|       |
  648|  17.9M|    qmf_real[idx] = (r1 - i1);
  649|  17.9M|    qmf_imag[no_synthesis_channels - 1 - idx] = -(r1 + i1);
  650|  17.9M|    qmf_real[no_synthesis_channels - idx - 1] = (r2 - i2);
  651|  17.9M|    qmf_imag[idx] = -(r2 + i2);
  652|  17.9M|  }
  653|   560k|}
ixheaace_mps_polyphase.c:ixheaace_mps_cos_mod:
  504|   560k|    FLOAT32 *subband, ixheaace_mps_sac_pstr_qmf_synth_filter_bank pstr_qmf_synth_filter_bank) {
  505|   560k|  WORD32 idx, length;
  506|   560k|  FLOAT32 weight_imag, weight_real;
  507|   560k|  FLOAT32 real_1, real_2;
  508|   560k|  FLOAT32 imag_1, imag_2;
  509|   560k|  FLOAT32 accu1, accu2;
  510|       |
  511|   560k|  length = 32;
  512|       |
  513|  9.52M|  for (idx = 0; idx < (length / 2); idx++) {
  ------------------
  |  Branch (513:17): [True: 8.96M, False: 560k]
  ------------------
  514|  8.96M|    real_1 = subband[2 * idx];
  515|  8.96M|    imag_2 = subband[2 * idx + 1];
  516|  8.96M|    real_2 = subband[2 * length - 2 - 2 * idx];
  517|  8.96M|    imag_1 = subband[2 * length - 1 - 2 * idx];
  518|       |
  519|  8.96M|    weight_imag = pstr_qmf_synth_filter_bank->sin_twiddle[idx];
  520|  8.96M|    weight_real = pstr_qmf_synth_filter_bank->cos_twiddle[idx];
  521|       |
  522|  8.96M|    accu1 = imag_1 * weight_imag + real_1 * weight_real;
  523|  8.96M|    accu2 = imag_1 * weight_real - real_1 * weight_imag;
  524|       |
  525|  8.96M|    subband[2 * idx] = accu1;
  526|  8.96M|    subband[2 * idx + 1] = accu2;
  527|       |
  528|  8.96M|    weight_imag = pstr_qmf_synth_filter_bank->sin_twiddle[length - 1 - idx];
  529|  8.96M|    weight_real = pstr_qmf_synth_filter_bank->cos_twiddle[length - 1 - idx];
  530|       |
  531|  8.96M|    accu1 = imag_2 * weight_imag + real_2 * weight_real;
  532|  8.96M|    accu2 = imag_2 * weight_real - real_2 * weight_imag;
  533|       |
  534|  8.96M|    subband[2 * length - 2 - 2 * idx] = accu1;
  535|  8.96M|    subband[2 * length - 1 - 2 * idx] = accu2;
  536|  8.96M|  }
  537|       |
  538|   560k|  ixheaace_mps_fft32(subband);
  539|       |
  540|   560k|  weight_imag = pstr_qmf_synth_filter_bank->alt_sin_twiddle[0];
  541|   560k|  weight_real = pstr_qmf_synth_filter_bank->alt_sin_twiddle[length];
  542|       |
  543|  9.52M|  for (idx = 0; idx < length / 2; idx++) {
  ------------------
  |  Branch (543:17): [True: 8.96M, False: 560k]
  ------------------
  544|  8.96M|    real_1 = subband[2 * idx];
  545|  8.96M|    imag_1 = subband[2 * idx + 1];
  546|  8.96M|    real_2 = subband[2 * length - 2 - 2 * idx];
  547|  8.96M|    imag_2 = subband[2 * length - 1 - 2 * idx];
  548|       |
  549|  8.96M|    accu1 = real_1 * weight_real + imag_1 * weight_imag;
  550|  8.96M|    accu2 = real_1 * weight_imag - imag_1 * weight_real;
  551|       |
  552|  8.96M|    subband[2 * idx] = accu1;
  553|  8.96M|    subband[2 * length - 1 - 2 * idx] = accu2;
  554|       |
  555|  8.96M|    weight_imag = pstr_qmf_synth_filter_bank->alt_sin_twiddle[idx + 1];
  556|  8.96M|    weight_real = pstr_qmf_synth_filter_bank->alt_sin_twiddle[length - 1 - idx];
  557|       |
  558|  8.96M|    accu1 = real_2 * weight_imag + imag_2 * weight_real;
  559|  8.96M|    accu2 = real_2 * weight_real - imag_2 * weight_imag;
  560|       |
  561|  8.96M|    subband[2 * length - 2 - 2 * idx] = accu1;
  562|  8.96M|    subband[2 * idx + 1] = accu2;
  563|  8.96M|  }
  564|   560k|}
ixheaace_mps_polyphase.c:ixheaace_mps_fft32:
   59|  1.12M|static VOID ixheaace_mps_fft32(FLOAT32 *subband) {
   60|  1.12M|  FLOAT32 val_0, val_1, val_2, val_3, val_4, val_5, val_6, val_7, val_8, val_9, val_10, val_11,
   61|  1.12M|      val_12, val_13, val_14, val_15;
   62|  1.12M|  FLOAT32 val_1_0, val_1_1, val_1_2, val_1_3, val_1_4, val_1_5, val_1_6, val_1_7, val_1_8,
   63|  1.12M|      val_1_9, val_1_10, val_1_11, val_1_12, val_1_13, val_1_14, val_1_15;
   64|  1.12M|  FLOAT32 val_2_0, val_2_1, val_2_2, val_2_3, val_2_4, val_2_5, val_2_6, val_2_7, val_2_8,
   65|  1.12M|      val_2_9, val_2_10, val_2_11, val_2_12, val_2_13, val_2_14, val_2_15;
   66|  1.12M|  FLOAT32 val_3_0, val_3_1, val_3_2, val_3_3, val_3_4, val_3_5, val_3_6, val_3_7, val_3_8,
   67|  1.12M|      val_3_9, val_3_10, val_3_11, val_3_12, val_3_13, val_3_14, val_3_15;
   68|  1.12M|  FLOAT32 val_3_16, val_3_17, val_3_18, val_3_19, val_3_20, val_3_21, val_3_22, val_3_23,
   69|  1.12M|      val_3_24, val_3_25, val_3_26, val_3_27, val_3_28, val_3_29, val_3_30, val_3_31;
   70|  1.12M|  FLOAT32 val_4_0, val_4_1, val_4_2, val_4_3, val_4_4, val_4_5, val_4_6, val_4_7, val_4_8,
   71|  1.12M|      val_4_9, val_4_10, val_4_11, val_4_12, val_4_13, val_4_14, val_4_15;
   72|       |
   73|  1.12M|  val_2_0 = subband[2] - subband[34];
   74|  1.12M|  val_2_1 = subband[3] - subband[35];
   75|  1.12M|  val_3_0 = subband[0] + subband[32];
   76|  1.12M|  val_3_1 = subband[1] + subband[33];
   77|  1.12M|  val_3_2 = subband[2] + subband[34];
   78|  1.12M|  val_3_3 = subband[3] + subband[35];
   79|       |
   80|  1.12M|  val_2_2 = subband[6] - subband[38];
   81|  1.12M|  val_2_3 = subband[7] - subband[39];
   82|  1.12M|  val_3_4 = subband[4] + subband[36];
   83|  1.12M|  val_3_5 = subband[5] + subband[37];
   84|  1.12M|  val_3_6 = subband[6] + subband[38];
   85|  1.12M|  val_3_7 = subband[7] + subband[39];
   86|       |
   87|  1.12M|  val_2_4 = subband[10] - subband[42];
   88|  1.12M|  val_2_5 = subband[11] - subband[43];
   89|  1.12M|  val_3_8 = subband[8] + subband[40];
   90|  1.12M|  val_3_9 = subband[9] + subband[41];
   91|  1.12M|  val_3_10 = subband[10] + subband[42];
   92|  1.12M|  val_3_11 = subband[11] + subband[43];
   93|       |
   94|  1.12M|  val_2_6 = subband[14] - subband[46];
   95|  1.12M|  val_2_7 = subband[15] - subband[47];
   96|  1.12M|  val_3_12 = subband[12] + subband[44];
   97|  1.12M|  val_3_13 = subband[13] + subband[45];
   98|  1.12M|  val_3_14 = subband[14] + subband[46];
   99|  1.12M|  val_3_15 = subband[15] + subband[47];
  100|       |
  101|  1.12M|  val_2_8 = subband[18] - subband[50];
  102|  1.12M|  val_2_9 = subband[19] - subband[51];
  103|  1.12M|  val_3_16 = subband[16] + subband[48];
  104|  1.12M|  val_3_17 = subband[17] + subband[49];
  105|  1.12M|  val_3_18 = subband[18] + subband[50];
  106|  1.12M|  val_3_19 = subband[19] + subband[51];
  107|       |
  108|  1.12M|  val_2_10 = subband[22] - subband[54];
  109|  1.12M|  val_2_11 = subband[23] - subband[55];
  110|  1.12M|  val_3_20 = subband[20] + subband[52];
  111|  1.12M|  val_3_21 = subband[21] + subband[53];
  112|  1.12M|  val_3_22 = subband[22] + subband[54];
  113|  1.12M|  val_3_23 = subband[23] + subband[55];
  114|       |
  115|  1.12M|  val_2_12 = subband[26] - subband[58];
  116|  1.12M|  val_2_13 = subband[27] - subband[59];
  117|  1.12M|  val_3_24 = subband[24] + subband[56];
  118|  1.12M|  val_3_25 = subband[25] + subband[57];
  119|  1.12M|  val_3_26 = subband[26] + subband[58];
  120|  1.12M|  val_3_27 = subband[27] + subband[59];
  121|       |
  122|  1.12M|  val_2_14 = subband[30] - subband[62];
  123|  1.12M|  val_2_15 = subband[31] - subband[63];
  124|  1.12M|  val_3_28 = subband[28] + subband[60];
  125|  1.12M|  val_3_29 = subband[29] + subband[61];
  126|  1.12M|  val_3_30 = subband[30] + subband[62];
  127|  1.12M|  val_3_31 = subband[31] + subband[63];
  128|       |
  129|  1.12M|  val_4_1 = -(val_2_0 + val_2_14);
  130|  1.12M|  val_4_2 = val_2_0 - val_2_14;
  131|  1.12M|  val_4_0 = val_2_1 + val_2_15;
  132|  1.12M|  val_4_3 = val_2_1 - val_2_15;
  133|  1.12M|  val_4_5 = -(val_2_2 + val_2_12);
  134|  1.12M|  val_4_6 = val_2_2 - val_2_12;
  135|  1.12M|  val_4_4 = val_2_3 + val_2_13;
  136|  1.12M|  val_4_7 = val_2_3 - val_2_13;
  137|  1.12M|  val_4_9 = -(val_2_4 + val_2_10);
  138|  1.12M|  val_4_10 = val_2_4 - val_2_10;
  139|  1.12M|  val_4_8 = val_2_5 + val_2_11;
  140|  1.12M|  val_4_11 = val_2_5 - val_2_11;
  141|  1.12M|  val_4_13 = -(val_2_6 + val_2_8);
  142|  1.12M|  val_4_14 = val_2_6 - val_2_8;
  143|  1.12M|  val_4_12 = val_2_7 + val_2_9;
  144|  1.12M|  val_4_15 = val_2_7 - val_2_9;
  145|       |
  146|  1.12M|  val_2_0 = val_4_0 * fft_c[3] + val_4_4 * fft_c[2] + val_4_8 * fft_c[1] + val_4_12 * fft_c[0];
  147|       |
  148|  1.12M|  val_2_4 = val_4_0 * fft_c[2] + val_4_4 * fft_c[0] + val_4_8 * fft_c[3] - val_4_12 * fft_c[1];
  149|  1.12M|  val_2_8 = val_4_0 * fft_c[1] + val_4_4 * fft_c[3] - val_4_8 * fft_c[0] + val_4_12 * fft_c[2];
  150|       |
  151|  1.12M|  val_2_12 = val_4_0 * fft_c[0] - val_4_4 * fft_c[1] + val_4_8 * fft_c[2] - val_4_12 * fft_c[3];
  152|       |
  153|  1.12M|  val_2_1 = val_4_1 * fft_c[3] + val_4_5 * fft_c[2] + val_4_9 * fft_c[1] + val_4_13 * fft_c[0];
  154|       |
  155|  1.12M|  val_2_5 = val_4_1 * fft_c[2] + val_4_5 * fft_c[0] + val_4_9 * fft_c[3] - val_4_13 * fft_c[1];
  156|  1.12M|  val_2_9 = val_4_1 * fft_c[1] + val_4_5 * fft_c[3] - val_4_9 * fft_c[0] + val_4_13 * fft_c[2];
  157|       |
  158|  1.12M|  val_2_13 = val_4_1 * fft_c[0] - val_4_5 * fft_c[1] + val_4_9 * fft_c[2] - val_4_13 * fft_c[3];
  159|       |
  160|  1.12M|  val_2_2 = val_4_2 * fft_c[0] + val_4_6 * fft_c[1] + val_4_10 * fft_c[2] + val_4_14 * fft_c[3];
  161|       |
  162|  1.12M|  val_2_6 = val_4_2 * fft_c[1] - val_4_6 * fft_c[3] - val_4_10 * fft_c[0] - val_4_14 * fft_c[2];
  163|       |
  164|  1.12M|  val_2_10 = val_4_2 * fft_c[2] - val_4_6 * fft_c[0] + val_4_10 * fft_c[3] + val_4_14 * fft_c[1];
  165|       |
  166|  1.12M|  val_2_14 = val_4_2 * fft_c[3] - val_4_6 * fft_c[2] + val_4_10 * fft_c[1] - val_4_14 * fft_c[0];
  167|       |
  168|  1.12M|  val_2_3 = val_4_3 * fft_c[0] + val_4_7 * fft_c[1] + val_4_11 * fft_c[2] + val_4_15 * fft_c[3];
  169|       |
  170|  1.12M|  val_2_7 = val_4_3 * fft_c[1] - val_4_7 * fft_c[3] - val_4_11 * fft_c[0] - val_4_15 * fft_c[2];
  171|       |
  172|  1.12M|  val_2_11 = val_4_3 * fft_c[2] - val_4_7 * fft_c[0] + val_4_11 * fft_c[3] + val_4_15 * fft_c[1];
  173|       |
  174|  1.12M|  val_2_15 = val_4_3 * fft_c[3] - val_4_7 * fft_c[2] + val_4_11 * fft_c[1] - val_4_15 * fft_c[0];
  175|       |
  176|  1.12M|  val_4_0 = val_2_0 + val_2_2;
  177|  1.12M|  val_4_14 = val_2_0 - val_2_2;
  178|  1.12M|  val_4_1 = val_2_1 + val_2_3;
  179|  1.12M|  val_4_15 = val_2_1 - val_2_3;
  180|  1.12M|  val_4_2 = val_2_4 + val_2_6;
  181|  1.12M|  val_4_12 = val_2_4 - val_2_6;
  182|  1.12M|  val_4_3 = val_2_5 + val_2_7;
  183|  1.12M|  val_4_13 = val_2_5 - val_2_7;
  184|  1.12M|  val_4_4 = val_2_8 + val_2_10;
  185|  1.12M|  val_4_10 = val_2_8 - val_2_10;
  186|  1.12M|  val_4_5 = val_2_9 + val_2_11;
  187|  1.12M|  val_4_11 = val_2_9 - val_2_11;
  188|  1.12M|  val_4_6 = val_2_12 + val_2_14;
  189|  1.12M|  val_4_8 = val_2_12 - val_2_14;
  190|  1.12M|  val_4_7 = val_2_13 + val_2_15;
  191|  1.12M|  val_4_9 = val_2_13 - val_2_15;
  192|       |
  193|  1.12M|  val_1_0 = val_3_0 + val_3_16;
  194|  1.12M|  val_1_1 = val_3_1 + val_3_17;
  195|  1.12M|  val_1_2 = val_3_2 + val_3_18;
  196|  1.12M|  val_1_3 = val_3_3 + val_3_19;
  197|  1.12M|  val_1_4 = val_3_4 + val_3_20;
  198|  1.12M|  val_1_5 = val_3_5 + val_3_21;
  199|  1.12M|  val_1_6 = val_3_6 + val_3_22;
  200|  1.12M|  val_1_7 = val_3_7 + val_3_23;
  201|  1.12M|  val_1_8 = val_3_8 + val_3_24;
  202|  1.12M|  val_1_9 = val_3_9 + val_3_25;
  203|  1.12M|  val_1_10 = val_3_10 + val_3_26;
  204|  1.12M|  val_1_11 = val_3_11 + val_3_27;
  205|  1.12M|  val_1_12 = val_3_12 + val_3_28;
  206|  1.12M|  val_1_13 = val_3_13 + val_3_29;
  207|  1.12M|  val_1_14 = val_3_14 + val_3_30;
  208|  1.12M|  val_1_15 = val_3_15 + val_3_31;
  209|       |
  210|  1.12M|  val_0 = val_1_0 + val_1_8;
  211|  1.12M|  val_2 = val_1_0 - val_1_8;
  212|  1.12M|  val_1 = val_1_1 + val_1_9;
  213|  1.12M|  val_3 = val_1_1 - val_1_9;
  214|  1.12M|  val_4 = val_1_2 + val_1_10;
  215|  1.12M|  val_6 = val_1_2 - val_1_10;
  216|  1.12M|  val_5 = val_1_3 + val_1_11;
  217|  1.12M|  val_7 = val_1_3 - val_1_11;
  218|  1.12M|  val_8 = val_1_4 + val_1_12;
  219|  1.12M|  val_10 = val_1_4 - val_1_12;
  220|  1.12M|  val_9 = val_1_5 + val_1_13;
  221|  1.12M|  val_11 = val_1_5 - val_1_13;
  222|  1.12M|  val_12 = val_1_6 + val_1_14;
  223|  1.12M|  val_14 = val_1_6 - val_1_14;
  224|  1.12M|  val_13 = val_1_7 + val_1_15;
  225|  1.12M|  val_15 = val_1_7 - val_1_15;
  226|       |
  227|  1.12M|  val_2_0 = val_0 + val_8;
  228|  1.12M|  val_2_4 = val_0 - val_8;
  229|  1.12M|  val_2_1 = val_1 + val_9;
  230|  1.12M|  val_2_5 = val_1 - val_9;
  231|  1.12M|  val_2_8 = val_2 - val_11;
  232|  1.12M|  val_2_10 = val_2 + val_11;
  233|  1.12M|  val_2_9 = val_3 + val_10;
  234|  1.12M|  val_2_11 = val_3 - val_10;
  235|  1.12M|  val_2_2 = val_4 + val_12;
  236|  1.12M|  val_2_7 = val_4 - val_12;
  237|  1.12M|  val_2_3 = val_5 + val_13;
  238|  1.12M|  val_2_6 = val_13 - val_5;
  239|       |
  240|  1.12M|  val_1 = val_6 + val_14;
  241|  1.12M|  val_2 = val_6 - val_14;
  242|  1.12M|  val_0 = val_7 + val_15;
  243|  1.12M|  val_3 = val_7 - val_15;
  244|       |
  245|  1.12M|  val_2_12 = (val_0 + val_2) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  246|  1.12M|  val_2_14 = (val_0 - val_2) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  247|  1.12M|  val_2_13 = (val_3 - val_1) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  248|  1.12M|  val_2_15 = (val_1 + val_3) * -MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  249|       |
  250|  1.12M|  val_1_0 = val_3_0 - val_3_16;
  251|  1.12M|  val_1_1 = val_3_1 - val_3_17;
  252|  1.12M|  val_1_2 = val_3_2 - val_3_18;
  253|  1.12M|  val_1_3 = val_3_3 - val_3_19;
  254|  1.12M|  val_1_4 = val_3_4 - val_3_20;
  255|  1.12M|  val_1_5 = val_3_5 - val_3_21;
  256|  1.12M|  val_1_6 = val_3_6 - val_3_22;
  257|  1.12M|  val_1_7 = val_3_7 - val_3_23;
  258|  1.12M|  val_1_8 = val_3_8 - val_3_24;
  259|  1.12M|  val_1_9 = val_3_9 - val_3_25;
  260|  1.12M|  val_1_10 = val_3_10 - val_3_26;
  261|  1.12M|  val_1_11 = val_3_11 - val_3_27;
  262|  1.12M|  val_1_12 = val_3_12 - val_3_28;
  263|  1.12M|  val_1_13 = val_3_13 - val_3_29;
  264|  1.12M|  val_1_14 = val_3_14 - val_3_30;
  265|  1.12M|  val_1_15 = val_3_15 - val_3_31;
  266|       |
  267|  1.12M|  val_3_0 = val_2_0 + val_2_2;
  268|  1.12M|  val_3_16 = val_2_0 - val_2_2;
  269|  1.12M|  val_3_1 = val_2_1 + val_2_3;
  270|  1.12M|  val_3_17 = val_2_1 - val_2_3;
  271|  1.12M|  val_3_8 = val_2_4 - val_2_6;
  272|  1.12M|  val_3_24 = val_2_4 + val_2_6;
  273|  1.12M|  val_3_9 = val_2_5 - val_2_7;
  274|  1.12M|  val_3_25 = val_2_5 + val_2_7;
  275|  1.12M|  val_3_12 = val_2_8 + val_2_14;
  276|  1.12M|  val_3_28 = val_2_8 - val_2_14;
  277|  1.12M|  val_3_13 = val_2_9 + val_2_15;
  278|  1.12M|  val_3_29 = val_2_9 - val_2_15;
  279|  1.12M|  val_3_4 = val_2_10 + val_2_12;
  280|  1.12M|  val_3_20 = val_2_10 - val_2_12;
  281|  1.12M|  val_3_5 = val_2_11 + val_2_13;
  282|  1.12M|  val_3_21 = val_2_11 - val_2_13;
  283|       |
  284|  1.12M|  val_9 = (val_1_2 + val_1_14) * -MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  285|  1.12M|  val_10 = (val_1_2 - val_1_14) * MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  286|  1.12M|  val_8 = (val_1_3 + val_1_15) * MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  287|  1.12M|  val_11 = (val_1_3 - val_1_15) * MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  288|  1.12M|  val_5 = (val_1_4 + val_1_12) * -MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  289|  1.12M|  val_6 = (val_1_4 - val_1_12) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  290|  1.12M|  val_4 = (val_1_5 + val_1_13) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  291|  1.12M|  val_7 = (val_1_5 - val_1_13) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  292|  1.12M|  val_13 = (val_1_6 + val_1_10) * -MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  293|  1.12M|  val_14 = (val_1_6 - val_1_10) * MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  294|  1.12M|  val_12 = (val_1_7 + val_1_11) * MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  295|  1.12M|  val_15 = (val_1_7 - val_1_11) * MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  296|       |
  297|  1.12M|  val_1_2 = val_8 * MPS_SQRT2PLUS1 - val_12 * MPS_SQRT2MINUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                val_1_2 = val_8 * MPS_SQRT2PLUS1 - val_12 * MPS_SQRT2MINUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
  298|  1.12M|  val_1_3 = val_9 * MPS_SQRT2PLUS1 - val_13 * MPS_SQRT2MINUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                val_1_3 = val_9 * MPS_SQRT2PLUS1 - val_13 * MPS_SQRT2MINUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
  299|  1.12M|  val_1_4 = val_10 * MPS_SQRT2MINUS1 - val_14 * MPS_SQRT2PLUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                val_1_4 = val_10 * MPS_SQRT2MINUS1 - val_14 * MPS_SQRT2PLUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
  300|  1.12M|  val_1_5 = val_11 * MPS_SQRT2MINUS1 - val_15 * MPS_SQRT2PLUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                val_1_5 = val_11 * MPS_SQRT2MINUS1 - val_15 * MPS_SQRT2PLUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
  301|       |
  302|  1.12M|  val_8 += val_12;
  303|  1.12M|  val_9 += val_13;
  304|  1.12M|  val_10 += val_14;
  305|  1.12M|  val_11 += val_15;
  306|  1.12M|  val_1_6 = val_1_0 + val_4;
  307|  1.12M|  val_1_10 = val_1_0 - val_4;
  308|  1.12M|  val_1_7 = val_1_1 + val_5;
  309|  1.12M|  val_1_11 = val_1_1 - val_5;
  310|       |
  311|  1.12M|  val_1_12 = val_6 - val_1_9;
  312|  1.12M|  val_1_14 = val_6 + val_1_9;
  313|  1.12M|  val_1_13 = val_1_8 + val_7;
  314|  1.12M|  val_1_15 = val_1_8 - val_7;
  315|       |
  316|  1.12M|  val_0 = val_1_6 - val_1_14;
  317|  1.12M|  val_2 = val_1_6 + val_1_14;
  318|  1.12M|  val_1 = val_1_7 + val_1_15;
  319|  1.12M|  val_3 = val_1_7 - val_1_15;
  320|  1.12M|  val_4 = val_1_10 + val_1_12;
  321|  1.12M|  val_6 = val_1_10 - val_1_12;
  322|  1.12M|  val_5 = val_1_11 + val_1_13;
  323|  1.12M|  val_7 = val_1_11 - val_1_13;
  324|       |
  325|  1.12M|  val_1_10 = val_8 + val_10;
  326|  1.12M|  val_10 = val_8 - val_10;
  327|  1.12M|  val_1_11 = val_9 + val_11;
  328|  1.12M|  val_11 = val_9 - val_11;
  329|       |
  330|  1.12M|  val_12 = val_1_2 + val_1_4;
  331|  1.12M|  val_14 = val_1_2 - val_1_4;
  332|  1.12M|  val_13 = val_1_3 + val_1_5;
  333|  1.12M|  val_15 = val_1_3 - val_1_5;
  334|       |
  335|  1.12M|  val_3_2 = val_2 + val_1_10;
  336|  1.12M|  val_3_18 = val_2 - val_1_10;
  337|  1.12M|  val_3_3 = val_3 + val_1_11;
  338|  1.12M|  val_3_19 = val_3 - val_1_11;
  339|  1.12M|  val_3_6 = val_0 + val_12;
  340|  1.12M|  val_3_22 = val_0 - val_12;
  341|  1.12M|  val_3_7 = val_1 + val_13;
  342|  1.12M|  val_3_23 = val_1 - val_13;
  343|  1.12M|  val_3_14 = val_4 + val_10;
  344|  1.12M|  val_3_30 = val_4 - val_10;
  345|  1.12M|  val_3_15 = val_5 + val_11;
  346|  1.12M|  val_3_31 = val_5 - val_11;
  347|  1.12M|  val_3_10 = val_6 + val_14;
  348|  1.12M|  val_3_26 = val_6 - val_14;
  349|  1.12M|  val_3_11 = val_7 + val_15;
  350|  1.12M|  val_3_27 = val_7 - val_15;
  351|       |
  352|  1.12M|  val_1_0 = subband[0] - subband[32];
  353|  1.12M|  val_1_1 = subband[1] - subband[33];
  354|  1.12M|  val_1_2 = subband[4] - subband[36];
  355|  1.12M|  val_1_3 = subband[5] - subband[37];
  356|  1.12M|  val_1_4 = subband[8] - subband[40];
  357|  1.12M|  val_1_5 = subband[9] - subband[41];
  358|  1.12M|  val_1_6 = subband[12] - subband[44];
  359|  1.12M|  val_1_7 = subband[13] - subband[45];
  360|  1.12M|  val_1_8 = subband[16] - subband[48];
  361|  1.12M|  val_1_9 = subband[17] - subband[49];
  362|  1.12M|  val_1_10 = subband[20] - subband[52];
  363|  1.12M|  val_1_11 = subband[21] - subband[53];
  364|  1.12M|  val_1_12 = subband[24] - subband[56];
  365|  1.12M|  val_1_13 = subband[25] - subband[57];
  366|  1.12M|  val_1_14 = subband[28] - subband[60];
  367|  1.12M|  val_1_15 = subband[29] - subband[61];
  368|       |
  369|  1.12M|  val_9 = (val_1_2 + val_1_14) * -MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  370|  1.12M|  val_10 = (val_1_2 - val_1_14) * MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  371|  1.12M|  val_8 = (val_1_3 + val_1_15) * MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  372|  1.12M|  val_11 = (val_1_3 - val_1_15) * MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  373|  1.12M|  val_5 = (val_1_4 + val_1_12) * -MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  374|  1.12M|  val_6 = (val_1_4 - val_1_12) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  375|  1.12M|  val_4 = (val_1_5 + val_1_13) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  376|  1.12M|  val_7 = (val_1_5 - val_1_13) * MPS_INV_SQRT2;
  ------------------
  |  |  185|  1.12M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  377|  1.12M|  val_13 = (val_1_6 + val_1_10) * -MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  378|  1.12M|  val_14 = (val_1_6 - val_1_10) * MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  379|  1.12M|  val_12 = (val_1_7 + val_1_11) * MPS_COS_PI_DIV8;
  ------------------
  |  |  186|  1.12M|#define MPS_COS_PI_DIV8 (9.238795325112867e-1f)
  ------------------
  380|  1.12M|  val_15 = (val_1_7 - val_1_11) * MPS_COS_3PI_DIV8;
  ------------------
  |  |  187|  1.12M|#define MPS_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
  381|       |
  382|  1.12M|  val_1_2 = val_8 * MPS_SQRT2PLUS1 - val_12 * MPS_SQRT2MINUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                val_1_2 = val_8 * MPS_SQRT2PLUS1 - val_12 * MPS_SQRT2MINUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
  383|  1.12M|  val_1_3 = val_9 * MPS_SQRT2PLUS1 - val_13 * MPS_SQRT2MINUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                val_1_3 = val_9 * MPS_SQRT2PLUS1 - val_13 * MPS_SQRT2MINUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
  384|  1.12M|  val_1_4 = val_10 * MPS_SQRT2MINUS1 - val_14 * MPS_SQRT2PLUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                val_1_4 = val_10 * MPS_SQRT2MINUS1 - val_14 * MPS_SQRT2PLUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
  385|  1.12M|  val_1_5 = val_11 * MPS_SQRT2MINUS1 - val_15 * MPS_SQRT2PLUS1;
  ------------------
  |  |  189|  1.12M|#define MPS_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                val_1_5 = val_11 * MPS_SQRT2MINUS1 - val_15 * MPS_SQRT2PLUS1;
  ------------------
  |  |  188|  1.12M|#define MPS_SQRT2PLUS1 (2.414213562373095f)
  ------------------
  386|       |
  387|  1.12M|  val_8 += val_12;
  388|  1.12M|  val_9 += val_13;
  389|  1.12M|  val_10 += val_14;
  390|  1.12M|  val_11 += val_15;
  391|  1.12M|  val_1_6 = val_1_0 + val_4;
  392|  1.12M|  val_1_10 = val_1_0 - val_4;
  393|  1.12M|  val_1_7 = val_1_1 + val_5;
  394|  1.12M|  val_1_11 = val_1_1 - val_5;
  395|       |
  396|  1.12M|  val_1_12 = val_6 - val_1_9;
  397|  1.12M|  val_1_14 = val_6 + val_1_9;
  398|  1.12M|  val_1_13 = val_1_8 + val_7;
  399|  1.12M|  val_1_15 = val_1_8 - val_7;
  400|       |
  401|  1.12M|  val_0 = val_1_6 - val_1_14;
  402|  1.12M|  val_2 = val_1_6 + val_1_14;
  403|  1.12M|  val_1 = val_1_7 + val_1_15;
  404|  1.12M|  val_3 = val_1_7 - val_1_15;
  405|  1.12M|  val_4 = val_1_10 + val_1_12;
  406|  1.12M|  val_6 = val_1_10 - val_1_12;
  407|  1.12M|  val_5 = val_1_11 + val_1_13;
  408|  1.12M|  val_7 = val_1_11 - val_1_13;
  409|       |
  410|  1.12M|  val_1_10 = val_8 + val_10;
  411|  1.12M|  val_10 = val_8 - val_10;
  412|  1.12M|  val_1_11 = val_9 + val_11;
  413|  1.12M|  val_11 = val_9 - val_11;
  414|       |
  415|  1.12M|  val_12 = val_1_2 + val_1_4;
  416|  1.12M|  val_14 = val_1_2 - val_1_4;
  417|  1.12M|  val_13 = val_1_3 + val_1_5;
  418|  1.12M|  val_15 = val_1_3 - val_1_5;
  419|       |
  420|  1.12M|  val_1_0 = val_2 + val_1_10;
  421|  1.12M|  val_1_8 = val_2 - val_1_10;
  422|  1.12M|  val_1_1 = val_3 + val_1_11;
  423|  1.12M|  val_1_9 = val_3 - val_1_11;
  424|  1.12M|  val_1_2 = val_0 + val_12;
  425|  1.12M|  val_1_10 = val_0 - val_12;
  426|  1.12M|  val_1_3 = val_1 + val_13;
  427|  1.12M|  val_1_11 = val_1 - val_13;
  428|  1.12M|  val_1_6 = val_4 + val_10;
  429|  1.12M|  val_1_14 = val_4 - val_10;
  430|  1.12M|  val_1_7 = val_5 + val_11;
  431|  1.12M|  val_1_15 = val_5 - val_11;
  432|  1.12M|  val_1_4 = val_6 + val_14;
  433|  1.12M|  val_1_12 = val_6 - val_14;
  434|  1.12M|  val_1_5 = val_7 + val_15;
  435|  1.12M|  val_1_13 = val_7 - val_15;
  436|       |
  437|  1.12M|  *subband++ = val_3_0;
  438|  1.12M|  *subband++ = val_3_1;
  439|  1.12M|  *subband++ = val_1_0 + val_4_0;
  440|  1.12M|  *subband++ = val_1_1 + val_4_1;
  441|  1.12M|  *subband++ = val_3_2;
  442|  1.12M|  *subband++ = val_3_3;
  443|  1.12M|  *subband++ = val_1_2 + val_4_2;
  444|  1.12M|  *subband++ = val_1_3 + val_4_3;
  445|  1.12M|  *subband++ = val_3_4;
  446|  1.12M|  *subband++ = val_3_5;
  447|  1.12M|  *subband++ = val_1_4 + val_4_4;
  448|  1.12M|  *subband++ = val_1_5 + val_4_5;
  449|  1.12M|  *subband++ = val_3_6;
  450|  1.12M|  *subband++ = val_3_7;
  451|  1.12M|  *subband++ = val_1_6 + val_4_6;
  452|  1.12M|  *subband++ = val_1_7 + val_4_7;
  453|  1.12M|  *subband++ = val_3_8;
  454|  1.12M|  *subband++ = val_3_9;
  455|  1.12M|  *subband++ = val_1_8 + val_4_8;
  456|  1.12M|  *subband++ = val_1_9 + val_4_9;
  457|  1.12M|  *subband++ = val_3_10;
  458|  1.12M|  *subband++ = val_3_11;
  459|  1.12M|  *subband++ = val_1_10 + val_4_10;
  460|  1.12M|  *subband++ = val_1_11 + val_4_11;
  461|  1.12M|  *subband++ = val_3_12;
  462|  1.12M|  *subband++ = val_3_13;
  463|  1.12M|  *subband++ = val_1_12 + val_4_12;
  464|  1.12M|  *subband++ = val_1_13 + val_4_13;
  465|  1.12M|  *subband++ = val_3_14;
  466|  1.12M|  *subband++ = val_3_15;
  467|  1.12M|  *subband++ = val_1_14 + val_4_14;
  468|  1.12M|  *subband++ = val_1_15 + val_4_15;
  469|  1.12M|  *subband++ = val_3_16;
  470|  1.12M|  *subband++ = val_3_17;
  471|  1.12M|  *subband++ = val_1_0 - val_4_0;
  472|  1.12M|  *subband++ = val_1_1 - val_4_1;
  473|  1.12M|  *subband++ = val_3_18;
  474|  1.12M|  *subband++ = val_3_19;
  475|  1.12M|  *subband++ = val_1_2 - val_4_2;
  476|  1.12M|  *subband++ = val_1_3 - val_4_3;
  477|  1.12M|  *subband++ = val_3_20;
  478|  1.12M|  *subband++ = val_3_21;
  479|  1.12M|  *subband++ = val_1_4 - val_4_4;
  480|  1.12M|  *subband++ = val_1_5 - val_4_5;
  481|  1.12M|  *subband++ = val_3_22;
  482|  1.12M|  *subband++ = val_3_23;
  483|  1.12M|  *subband++ = val_1_6 - val_4_6;
  484|  1.12M|  *subband++ = val_1_7 - val_4_7;
  485|  1.12M|  *subband++ = val_3_24;
  486|  1.12M|  *subband++ = val_3_25;
  487|  1.12M|  *subband++ = val_1_8 - val_4_8;
  488|  1.12M|  *subband++ = val_1_9 - val_4_9;
  489|  1.12M|  *subband++ = val_3_26;
  490|  1.12M|  *subband++ = val_3_27;
  491|  1.12M|  *subband++ = val_1_10 - val_4_10;
  492|  1.12M|  *subband++ = val_1_11 - val_4_11;
  493|  1.12M|  *subband++ = val_3_28;
  494|  1.12M|  *subband++ = val_3_29;
  495|  1.12M|  *subband++ = val_1_12 - val_4_12;
  496|  1.12M|  *subband++ = val_1_13 - val_4_13;
  497|  1.12M|  *subband++ = val_3_30;
  498|  1.12M|  *subband++ = val_3_31;
  499|  1.12M|  *subband++ = val_1_14 - val_4_14;
  500|  1.12M|  *subband++ = val_1_15 - val_4_15;
  501|  1.12M|}
ixheaace_mps_polyphase.c:ixheaace_mps_sin_mod:
  567|   560k|    FLOAT32 *subband, ixheaace_mps_sac_pstr_qmf_synth_filter_bank pstr_qmf_synth_filter_bank) {
  568|   560k|  WORD32 idx, length;
  569|   560k|  FLOAT32 weight_real, weight_imag;
  570|   560k|  FLOAT32 real_1, imag_1, real_2, imag_2;
  571|   560k|  FLOAT32 accu1, accu2;
  572|       |
  573|   560k|  length = 32;
  574|       |
  575|  9.52M|  for (idx = 0; idx < length / 2; idx++) {
  ------------------
  |  Branch (575:17): [True: 8.96M, False: 560k]
  ------------------
  576|  8.96M|    real_1 = subband[2 * idx];
  577|  8.96M|    imag_2 = subband[2 * idx + 1];
  578|  8.96M|    real_2 = subband[2 * length - 2 - 2 * idx];
  579|  8.96M|    imag_1 = subband[2 * length - 1 - 2 * idx];
  580|       |
  581|  8.96M|    weight_real = pstr_qmf_synth_filter_bank->sin_twiddle[idx];
  582|  8.96M|    weight_imag = pstr_qmf_synth_filter_bank->cos_twiddle[idx];
  583|       |
  584|  8.96M|    accu1 = imag_1 * weight_imag + real_1 * weight_real;
  585|  8.96M|    accu2 = imag_1 * weight_real - real_1 * weight_imag;
  586|       |
  587|  8.96M|    subband[2 * idx + 1] = accu1;
  588|  8.96M|    subband[2 * idx] = accu2;
  589|       |
  590|  8.96M|    weight_real = pstr_qmf_synth_filter_bank->sin_twiddle[length - 1 - idx];
  591|  8.96M|    weight_imag = pstr_qmf_synth_filter_bank->cos_twiddle[length - 1 - idx];
  592|       |
  593|  8.96M|    accu1 = imag_2 * weight_imag + real_2 * weight_real;
  594|  8.96M|    accu2 = imag_2 * weight_real - real_2 * weight_imag;
  595|       |
  596|  8.96M|    subband[2 * length - 1 - 2 * idx] = accu1;
  597|  8.96M|    subband[2 * length - 2 - 2 * idx] = accu2;
  598|  8.96M|  }
  599|       |
  600|   560k|  ixheaace_mps_fft32(subband);
  601|       |
  602|   560k|  weight_imag = pstr_qmf_synth_filter_bank->alt_sin_twiddle[0];
  603|   560k|  weight_real = pstr_qmf_synth_filter_bank->alt_sin_twiddle[length];
  604|       |
  605|  9.52M|  for (idx = 0; idx < length / 2; idx++) {
  ------------------
  |  Branch (605:17): [True: 8.96M, False: 560k]
  ------------------
  606|  8.96M|    real_1 = subband[2 * idx];
  607|  8.96M|    imag_1 = subband[2 * idx + 1];
  608|  8.96M|    real_2 = subband[2 * length - 2 - 2 * idx];
  609|  8.96M|    imag_2 = subband[2 * length - 1 - 2 * idx];
  610|       |
  611|  8.96M|    accu1 = -(real_1 * weight_real + imag_1 * weight_imag);
  612|  8.96M|    accu2 = -(real_1 * weight_imag - imag_1 * weight_real);
  613|       |
  614|  8.96M|    subband[2 * length - 1 - 2 * idx] = accu1;
  615|  8.96M|    subband[2 * idx] = accu2;
  616|       |
  617|  8.96M|    weight_imag = pstr_qmf_synth_filter_bank->alt_sin_twiddle[idx + 1];
  618|  8.96M|    weight_real = pstr_qmf_synth_filter_bank->alt_sin_twiddle[length - 1 - idx];
  619|       |
  620|  8.96M|    accu1 = -(real_2 * weight_imag + imag_2 * weight_real);
  621|  8.96M|    accu2 = -(real_2 * weight_real - imag_2 * weight_imag);
  622|       |
  623|  8.96M|    subband[2 * idx + 1] = accu1;
  624|  8.96M|    subband[2 * length - 2 - 2 * idx] = accu2;
  625|  8.96M|  }
  626|   560k|}
ixheaace_mps_polyphase.c:ixheaace_mps_forward_modulation:
  893|  2.04M|                                            FLOAT32 *imag_subband) {
  894|  2.04M|  WORD32 idx;
  895|  2.04M|  real_subband[0] = time_in[0];
  896|       |
  897|   130M|  for (idx = 1; idx < NUM_QMF_BANDS; idx++) {
  ------------------
  |  |   43|   130M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (897:17): [True: 128M, False: 2.04M]
  ------------------
  898|   128M|    real_subband[idx] = time_in[idx] - time_in[(NUM_QMF_BANDS * 2) - idx];
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
  899|   128M|    imag_subband[idx - 1] = time_in[idx] + time_in[(NUM_QMF_BANDS * 2) - idx];
  ------------------
  |  |   43|   128M|#define NUM_QMF_BANDS (64)
  ------------------
  900|   128M|  }
  901|       |
  902|  2.04M|  imag_subband[63] = time_in[NUM_QMF_BANDS];
  ------------------
  |  |   43|  2.04M|#define NUM_QMF_BANDS (64)
  ------------------
  903|       |
  904|  2.04M|  ixheaace_mps_fct3_64(real_subband);
  905|       |
  906|  2.04M|  ixheaace_mps_fst3_64(imag_subband);
  907|  2.04M|}
ixheaace_mps_polyphase.c:ixheaace_mps_fct3_64:
  728|  4.09M|static VOID ixheaace_mps_fct3_64(FLOAT32 *subband) {
  729|  4.09M|  WORD32 idx;
  730|  4.09M|  const FLOAT32 *t_ptr;
  731|  4.09M|  FLOAT32 cos_val, sine_val;
  732|  4.09M|  FLOAT32 xp;
  733|       |
  734|  4.09M|  ixheaace_mps_bit_reversal(&subband[1], &subband[32]);
  735|  4.09M|  ixheaace_mps_bit_reversal(&subband[2], &subband[16]);
  736|  4.09M|  ixheaace_mps_bit_reversal(&subband[3], &subband[48]);
  737|  4.09M|  ixheaace_mps_bit_reversal(&subband[4], &subband[8]);
  738|  4.09M|  ixheaace_mps_bit_reversal(&subband[5], &subband[40]);
  739|  4.09M|  ixheaace_mps_bit_reversal(&subband[6], &subband[24]);
  740|  4.09M|  ixheaace_mps_bit_reversal(&subband[7], &subband[56]);
  741|  4.09M|  ixheaace_mps_bit_reversal(&subband[9], &subband[36]);
  742|  4.09M|  ixheaace_mps_bit_reversal(&subband[10], &subband[20]);
  743|  4.09M|  ixheaace_mps_bit_reversal(&subband[11], &subband[52]);
  744|  4.09M|  ixheaace_mps_bit_reversal(&subband[13], &subband[44]);
  745|  4.09M|  ixheaace_mps_bit_reversal(&subband[14], &subband[28]);
  746|  4.09M|  ixheaace_mps_bit_reversal(&subband[15], &subband[60]);
  747|  4.09M|  ixheaace_mps_bit_reversal(&subband[17], &subband[34]);
  748|  4.09M|  ixheaace_mps_bit_reversal(&subband[19], &subband[50]);
  749|  4.09M|  ixheaace_mps_bit_reversal(&subband[21], &subband[42]);
  750|  4.09M|  ixheaace_mps_bit_reversal(&subband[22], &subband[26]);
  751|  4.09M|  ixheaace_mps_bit_reversal(&subband[23], &subband[58]);
  752|  4.09M|  ixheaace_mps_bit_reversal(&subband[25], &subband[38]);
  753|  4.09M|  ixheaace_mps_bit_reversal(&subband[27], &subband[54]);
  754|  4.09M|  ixheaace_mps_bit_reversal(&subband[29], &subband[46]);
  755|  4.09M|  ixheaace_mps_bit_reversal(&subband[31], &subband[62]);
  756|  4.09M|  ixheaace_mps_bit_reversal(&subband[35], &subband[49]);
  757|  4.09M|  ixheaace_mps_bit_reversal(&subband[37], &subband[41]);
  758|  4.09M|  ixheaace_mps_bit_reversal(&subband[39], &subband[57]);
  759|  4.09M|  ixheaace_mps_bit_reversal(&subband[43], &subband[53]);
  760|  4.09M|  ixheaace_mps_bit_reversal(&subband[47], &subband[61]);
  761|  4.09M|  ixheaace_mps_bit_reversal(&subband[55], &subband[59]);
  762|       |
  763|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[33], &subband[62]);
  764|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[34], &subband[60]);
  765|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[35], &subband[61]);
  766|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[36], &subband[56]);
  767|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[37], &subband[57]);
  768|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[38], &subband[58]);
  769|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[39], &subband[59]);
  770|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[40], &subband[48]);
  771|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[41], &subband[49]);
  772|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[42], &subband[50]);
  773|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[43], &subband[51]);
  774|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[44], &subband[52]);
  775|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[45], &subband[53]);
  776|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[46], &subband[54]);
  777|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[47], &subband[55]);
  778|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[17], &subband[30]);
  779|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[18], &subband[28]);
  780|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[19], &subband[29]);
  781|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[20], &subband[24]);
  782|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[21], &subband[25]);
  783|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[22], &subband[26]);
  784|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[23], &subband[27]);
  785|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[9], &subband[14]);
  786|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[10], &subband[12]);
  787|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[11], &subband[13]);
  788|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[41], &subband[46]);
  789|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[42], &subband[44]);
  790|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[43], &subband[45]);
  791|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[54], &subband[49]);
  792|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[52], &subband[50]);
  793|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[53], &subband[51]);
  794|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[5], &subband[6]);
  795|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[21], &subband[22]);
  796|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[26], &subband[25]);
  797|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[37], &subband[38]);
  798|  4.09M|  ixheaace_mps_bit_add_sub1(&subband[58], &subband[57]);
  799|       |
  800|  4.09M|  ixheaace_mps_fct3_4(subband);
  801|  4.09M|  ixheaace_mps_fct4_4r(subband + 4);
  802|  4.09M|  ixheaace_mps_fct3_4(subband + 8);
  803|  4.09M|  ixheaace_mps_fst3_4r(subband + 12);
  804|  4.09M|  ixheaace_mps_fct3_4(subband + 16);
  805|  4.09M|  ixheaace_mps_fct4_4r(subband + 20);
  806|  4.09M|  ixheaace_mps_fst4_4(subband + 24);
  807|  4.09M|  ixheaace_mps_fst3_4r(subband + 28);
  808|  4.09M|  ixheaace_mps_fct3_4(subband + 32);
  809|  4.09M|  ixheaace_mps_fct4_4r(subband + 36);
  810|  4.09M|  ixheaace_mps_fct3_4(subband + 40);
  811|  4.09M|  ixheaace_mps_fst3_4r(subband + 44);
  812|  4.09M|  ixheaace_mps_fct3_4(subband + 48);
  813|  4.09M|  ixheaace_mps_fst3_4r(subband + 52);
  814|  4.09M|  ixheaace_mps_fst4_4(subband + 56);
  815|  4.09M|  ixheaace_mps_fst3_4r(subband + 60);
  816|       |
  817|  20.4M|  for (idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (817:17): [True: 16.3M, False: 4.09M]
  ------------------
  818|  16.3M|    ixheaace_mps_bit_add_sub2(&subband[idx], &subband[7 - idx]);
  819|  16.3M|    ixheaace_mps_bit_add_sub2(&subband[16 + idx], &subband[23 - idx]);
  820|  16.3M|    ixheaace_mps_bit_add_sub1(&subband[31 - idx], &subband[24 + idx]);
  821|  16.3M|    ixheaace_mps_bit_add_sub2(&subband[32 + idx], &subband[39 - idx]);
  822|  16.3M|    ixheaace_mps_bit_add_sub1(&subband[63 - idx], &subband[56 + idx]);
  823|  16.3M|  }
  824|  4.09M|  t_ptr = trig_data_fct4_8;
  825|       |
  826|  20.4M|  for (idx = 0; idx < 4; idx++) {
  ------------------
  |  Branch (826:17): [True: 16.3M, False: 4.09M]
  ------------------
  827|  16.3M|    cos_val = *t_ptr++;
  828|  16.3M|    sine_val = *t_ptr++;
  829|       |
  830|  16.3M|    xp = subband[8 + idx] * cos_val + subband[15 - idx] * sine_val;
  831|  16.3M|    subband[8 + idx] = subband[8 + idx] * sine_val - subband[15 - idx] * cos_val;
  832|  16.3M|    subband[15 - idx] = xp;
  833|  16.3M|    xp = subband[40 + idx] * cos_val + subband[47 - idx] * sine_val;
  834|  16.3M|    subband[40 + idx] = subband[40 + idx] * sine_val - subband[47 - idx] * cos_val;
  835|  16.3M|    subband[47 - idx] = xp;
  836|  16.3M|    xp = subband[48 + idx] * sine_val + subband[55 - idx] * cos_val;
  837|  16.3M|    subband[55 - idx] = subband[48 + idx] * cos_val - subband[55 - idx] * sine_val;
  838|  16.3M|    subband[48 + idx] = xp;
  839|  16.3M|  }
  840|       |
  841|  36.8M|  for (idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (841:17): [True: 32.7M, False: 4.09M]
  ------------------
  842|  32.7M|    ixheaace_mps_bit_add_sub2(&subband[idx], &subband[15 - idx]);
  843|  32.7M|    ixheaace_mps_bit_add_sub2(&subband[32 + idx], &subband[47 - idx]);
  844|  32.7M|    ixheaace_mps_bit_add_sub1(&subband[63 - idx], &subband[48 + idx]);
  845|  32.7M|  }
  846|       |
  847|  4.09M|  t_ptr = trig_data_fct4_16;
  848|       |
  849|  36.8M|  for (idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (849:17): [True: 32.7M, False: 4.09M]
  ------------------
  850|  32.7M|    cos_val = *t_ptr++;
  851|  32.7M|    sine_val = *t_ptr++;
  852|       |
  853|  32.7M|    xp = subband[16 + idx] * cos_val + subband[31 - idx] * sine_val;
  854|  32.7M|    subband[16 + idx] = subband[16 + idx] * sine_val - subband[31 - idx] * cos_val;
  855|  32.7M|    subband[31 - idx] = xp;
  856|  32.7M|  }
  857|       |
  858|  69.5M|  for (idx = 0; idx < 16; idx++) {
  ------------------
  |  Branch (858:17): [True: 65.4M, False: 4.09M]
  ------------------
  859|  65.4M|    ixheaace_mps_bit_add_sub2(&subband[idx], &subband[31 - idx]);
  860|  65.4M|  }
  861|       |
  862|  4.09M|  t_ptr = trig_data_fct4_32;
  863|       |
  864|  69.5M|  for (idx = 0; idx < 16; idx++) {
  ------------------
  |  Branch (864:17): [True: 65.4M, False: 4.09M]
  ------------------
  865|  65.4M|    cos_val = *t_ptr++;
  866|  65.4M|    sine_val = *t_ptr++;
  867|       |
  868|  65.4M|    xp = subband[32 + idx] * cos_val + subband[63 - idx] * sine_val;
  869|  65.4M|    subband[32 + idx] = subband[32 + idx] * sine_val - subband[63 - idx] * cos_val;
  870|  65.4M|    subband[63 - idx] = xp;
  871|  65.4M|  }
  872|       |
  873|   135M|  for (idx = 0; idx < 32; idx++) {
  ------------------
  |  Branch (873:17): [True: 130M, False: 4.09M]
  ------------------
  874|   130M|    ixheaace_mps_bit_add_sub2(&subband[idx], &subband[63 - idx]);
  875|   130M|  }
  876|  4.09M|}
ixheaace_mps_polyphase.c:ixheaace_mps_bit_reversal:
   38|   180M|static VOID ixheaace_mps_bit_reversal(FLOAT32 *a, FLOAT32 *b) {
   39|   180M|  FLOAT32 temp;
   40|   180M|  temp = *a;
   41|   180M|  *a = *b;
   42|   180M|  *b = temp;
   43|   180M|}
ixheaace_mps_polyphase.c:ixheaace_mps_bit_add_sub1:
   45|   212M|static VOID ixheaace_mps_bit_add_sub1(FLOAT32 *a, FLOAT32 *b) {
   46|   212M|  FLOAT32 temp;
   47|   212M|  temp = *a + *b;
   48|   212M|  *b = *b - *a;
   49|   212M|  *a = temp;
   50|   212M|}
ixheaace_mps_polyphase.c:ixheaace_mps_fct3_4:
  655|  24.5M|static VOID ixheaace_mps_fct3_4(FLOAT32 *subband) {
  656|  24.5M|  FLOAT32 val_00, val_01, val_10, val_11;
  657|       |
  658|  24.5M|  subband[1] *= MPS_INV_SQRT2;
  ------------------
  |  |  185|  24.5M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  659|       |
  660|  24.5M|  val_00 = subband[0] + subband[1];
  661|  24.5M|  val_01 = subband[0] - subband[1];
  662|       |
  663|  24.5M|  val_10 = subband[2] * MPS_COS_6_PI_BY_16 + subband[3] * MPS_SIN_6_PI_BY_16;
  ------------------
  |  |  183|  24.5M|#define MPS_COS_6_PI_BY_16 (0.923879532511287f)
  ------------------
                val_10 = subband[2] * MPS_COS_6_PI_BY_16 + subband[3] * MPS_SIN_6_PI_BY_16;
  ------------------
  |  |  184|  24.5M|#define MPS_SIN_6_PI_BY_16 (0.382683432365090f)
  ------------------
  664|  24.5M|  val_11 = subband[2] * MPS_SIN_6_PI_BY_16 - subband[3] * MPS_COS_6_PI_BY_16;
  ------------------
  |  |  184|  24.5M|#define MPS_SIN_6_PI_BY_16 (0.382683432365090f)
  ------------------
                val_11 = subband[2] * MPS_SIN_6_PI_BY_16 - subband[3] * MPS_COS_6_PI_BY_16;
  ------------------
  |  |  183|  24.5M|#define MPS_COS_6_PI_BY_16 (0.923879532511287f)
  ------------------
  665|       |
  666|  24.5M|  subband[0] = val_00 + val_10;
  667|  24.5M|  subband[3] = val_00 - val_10;
  668|  24.5M|  subband[1] = val_01 + val_11;
  669|  24.5M|  subband[2] = val_01 - val_11;
  670|  24.5M|}
ixheaace_mps_polyphase.c:ixheaace_mps_fct4_4r:
  689|  12.2M|static VOID ixheaace_mps_fct4_4r(FLOAT32 *subband) {
  690|  12.2M|  FLOAT32 val_00, val_01, val_10, val_11;
  691|  12.2M|  subband[1] *= MPS_INV_SQRT2;
  ------------------
  |  |  185|  12.2M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  692|       |
  693|  12.2M|  val_00 = subband[0] + subband[1];
  694|  12.2M|  val_01 = subband[0] - subband[1];
  695|       |
  696|  12.2M|  subband[2] *= MPS_INV_SQRT2;
  ------------------
  |  |  185|  12.2M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  697|       |
  698|  12.2M|  val_11 = subband[3] - subband[2];
  699|  12.2M|  val_10 = subband[3] + subband[2];
  700|       |
  701|  12.2M|  subband[3] = val_00 * MPS_COS_PI_BY_16 + val_10 * MPS_SIN_PI_BY_16;
  ------------------
  |  |  179|  12.2M|#define MPS_COS_PI_BY_16 (0.980785280403230f)
  ------------------
                subband[3] = val_00 * MPS_COS_PI_BY_16 + val_10 * MPS_SIN_PI_BY_16;
  ------------------
  |  |  180|  12.2M|#define MPS_SIN_PI_BY_16 (0.195090322016128f)
  ------------------
  702|  12.2M|  subband[0] = val_00 * MPS_SIN_PI_BY_16 - val_10 * MPS_COS_PI_BY_16;
  ------------------
  |  |  180|  12.2M|#define MPS_SIN_PI_BY_16 (0.195090322016128f)
  ------------------
                subband[0] = val_00 * MPS_SIN_PI_BY_16 - val_10 * MPS_COS_PI_BY_16;
  ------------------
  |  |  179|  12.2M|#define MPS_COS_PI_BY_16 (0.980785280403230f)
  ------------------
  703|       |
  704|  12.2M|  subband[2] = val_01 * MPS_COS_3_PI_BY_16 - val_11 * MPS_SIN_3_PI_BY_16;
  ------------------
  |  |  181|  12.2M|#define MPS_COS_3_PI_BY_16 (0.831469612302545f)
  ------------------
                subband[2] = val_01 * MPS_COS_3_PI_BY_16 - val_11 * MPS_SIN_3_PI_BY_16;
  ------------------
  |  |  182|  12.2M|#define MPS_SIN_3_PI_BY_16 (0.555570233019602f)
  ------------------
  705|  12.2M|  subband[1] = val_01 * MPS_SIN_3_PI_BY_16 + val_11 * MPS_COS_3_PI_BY_16;
  ------------------
  |  |  182|  12.2M|#define MPS_SIN_3_PI_BY_16 (0.555570233019602f)
  ------------------
                subband[1] = val_01 * MPS_SIN_3_PI_BY_16 + val_11 * MPS_COS_3_PI_BY_16;
  ------------------
  |  |  181|  12.2M|#define MPS_COS_3_PI_BY_16 (0.831469612302545f)
  ------------------
  706|  12.2M|}
ixheaace_mps_polyphase.c:ixheaace_mps_fst3_4r:
  672|  20.4M|static VOID ixheaace_mps_fst3_4r(FLOAT32 *subband) {
  673|  20.4M|  FLOAT32 val_00, val_01, val_10, val_11;
  674|       |
  675|  20.4M|  subband[2] *= MPS_INV_SQRT2;
  ------------------
  |  |  185|  20.4M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  676|       |
  677|  20.4M|  val_00 = subband[3] + subband[2];
  678|  20.4M|  val_01 = subband[3] - subband[2];
  679|       |
  680|  20.4M|  val_10 = subband[1] * MPS_COS_6_PI_BY_16 + subband[0] * MPS_SIN_6_PI_BY_16;
  ------------------
  |  |  183|  20.4M|#define MPS_COS_6_PI_BY_16 (0.923879532511287f)
  ------------------
                val_10 = subband[1] * MPS_COS_6_PI_BY_16 + subband[0] * MPS_SIN_6_PI_BY_16;
  ------------------
  |  |  184|  20.4M|#define MPS_SIN_6_PI_BY_16 (0.382683432365090f)
  ------------------
  681|  20.4M|  val_11 = subband[0] * MPS_COS_6_PI_BY_16 - subband[1] * MPS_SIN_6_PI_BY_16;
  ------------------
  |  |  183|  20.4M|#define MPS_COS_6_PI_BY_16 (0.923879532511287f)
  ------------------
                val_11 = subband[0] * MPS_COS_6_PI_BY_16 - subband[1] * MPS_SIN_6_PI_BY_16;
  ------------------
  |  |  184|  20.4M|#define MPS_SIN_6_PI_BY_16 (0.382683432365090f)
  ------------------
  682|       |
  683|  20.4M|  subband[3] = val_00 + val_10;
  684|  20.4M|  subband[0] = val_10 - val_00;
  685|  20.4M|  subband[2] = val_11 - val_01;
  686|  20.4M|  subband[1] = val_11 + val_01;
  687|  20.4M|}
ixheaace_mps_polyphase.c:ixheaace_mps_fst4_4:
  708|  8.18M|static VOID ixheaace_mps_fst4_4(FLOAT32 *subband) {
  709|  8.18M|  FLOAT32 val_00, val_01, val_10, val_11;
  710|       |
  711|  8.18M|  subband[1] *= MPS_INV_SQRT2;
  ------------------
  |  |  185|  8.18M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  712|       |
  713|  8.18M|  val_10 = subband[0] + subband[1];
  714|  8.18M|  val_11 = subband[0] - subband[1];
  715|       |
  716|  8.18M|  subband[2] *= MPS_INV_SQRT2;
  ------------------
  |  |  185|  8.18M|#define MPS_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
  717|       |
  718|  8.18M|  val_01 = subband[3] - subband[2];
  719|  8.18M|  val_00 = subband[3] + subband[2];
  720|       |
  721|  8.18M|  subband[0] = val_00 * MPS_COS_PI_BY_16 + val_10 * MPS_SIN_PI_BY_16;
  ------------------
  |  |  179|  8.18M|#define MPS_COS_PI_BY_16 (0.980785280403230f)
  ------------------
                subband[0] = val_00 * MPS_COS_PI_BY_16 + val_10 * MPS_SIN_PI_BY_16;
  ------------------
  |  |  180|  8.18M|#define MPS_SIN_PI_BY_16 (0.195090322016128f)
  ------------------
  722|  8.18M|  subband[3] = val_10 * MPS_COS_PI_BY_16 - val_00 * MPS_SIN_PI_BY_16;
  ------------------
  |  |  179|  8.18M|#define MPS_COS_PI_BY_16 (0.980785280403230f)
  ------------------
                subband[3] = val_10 * MPS_COS_PI_BY_16 - val_00 * MPS_SIN_PI_BY_16;
  ------------------
  |  |  180|  8.18M|#define MPS_SIN_PI_BY_16 (0.195090322016128f)
  ------------------
  723|       |
  724|  8.18M|  subband[1] = val_11 * MPS_SIN_3_PI_BY_16 - val_01 * MPS_COS_3_PI_BY_16;
  ------------------
  |  |  182|  8.18M|#define MPS_SIN_3_PI_BY_16 (0.555570233019602f)
  ------------------
                subband[1] = val_11 * MPS_SIN_3_PI_BY_16 - val_01 * MPS_COS_3_PI_BY_16;
  ------------------
  |  |  181|  8.18M|#define MPS_COS_3_PI_BY_16 (0.831469612302545f)
  ------------------
  725|  8.18M|  subband[2] = val_01 * MPS_SIN_3_PI_BY_16 + val_11 * MPS_COS_3_PI_BY_16;
  ------------------
  |  |  182|  8.18M|#define MPS_SIN_3_PI_BY_16 (0.555570233019602f)
  ------------------
                subband[2] = val_01 * MPS_SIN_3_PI_BY_16 + val_11 * MPS_COS_3_PI_BY_16;
  ------------------
  |  |  181|  8.18M|#define MPS_COS_3_PI_BY_16 (0.831469612302545f)
  ------------------
  726|  8.18M|}
ixheaace_mps_polyphase.c:ixheaace_mps_bit_add_sub2:
   52|   310M|static VOID ixheaace_mps_bit_add_sub2(FLOAT32 *a, FLOAT32 *b) {
   53|   310M|  FLOAT32 temp;
   54|   310M|  temp = *a + *b;
   55|   310M|  *b = *a - *b;
   56|   310M|  *a = temp;
   57|   310M|}
ixheaace_mps_polyphase.c:ixheaace_mps_fst3_64:
  878|  2.04M|static VOID ixheaace_mps_fst3_64(FLOAT32 *subband) {
  879|  2.04M|  WORD32 k;
  880|       |
  881|  67.5M|  for (k = 0; k < 32; k++) {
  ------------------
  |  Branch (881:15): [True: 65.4M, False: 2.04M]
  ------------------
  882|  65.4M|    ixheaace_mps_bit_reversal(&subband[k], &subband[63 - k]);
  883|  65.4M|  }
  884|       |
  885|  2.04M|  ixheaace_mps_fct3_64(subband);
  886|       |
  887|  67.5M|  for (k = 1; k < NUM_QMF_BANDS; k += 2) {
  ------------------
  |  |   43|  67.5M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (887:15): [True: 65.4M, False: 2.04M]
  ------------------
  888|  65.4M|    subband[k] = -subband[k];
  889|  65.4M|  }
  890|  2.04M|}

ixheaace_mps_212_qmf_analysis_filtering_slot:
  116|  6.19M|    WORD8 *ptr_scratch) {
  117|  6.19M|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  118|  6.19M|  WORD32 idx;
  119|  6.19M|  WORD32 offset = pstr_qmf_filter_bank->no_channels * (QMF_NO_POLY * 2 - 1);
  ------------------
  |  |  147|  6.19M|#define QMF_NO_POLY 5
  ------------------
  120|  6.19M|  FLOAT32 *pstr_filter_states_ana_tmp =
  121|  6.19M|      ((FLOAT32 *)pstr_qmf_filter_bank->ptr_filter_states) + offset;
  122|   402M|  for (idx = 0; idx < pstr_qmf_filter_bank->no_channels; idx++) {
  ------------------
  |  Branch (122:17): [True: 396M, False: 6.19M]
  ------------------
  123|   396M|    *pstr_filter_states_ana_tmp++ = (FLOAT32)*time_in;
  124|   396M|    time_in += stride;
  125|   396M|  }
  126|  6.19M|  ixheaace_mps_212_qmf_ana_prototype_fir_slot(
  127|  6.19M|      p_work_buffer, pstr_qmf_filter_bank->no_channels, pstr_qmf_filter_bank->pstr_filter,
  128|  6.19M|      pstr_qmf_filter_bank->p_stride, (FLOAT32 *)pstr_qmf_filter_bank->ptr_filter_states);
  129|       |
  130|  6.19M|  error = ixheaace_mps_212_qmf_forward_modulation_hq(pstr_qmf_filter_bank, p_work_buffer,
  131|  6.19M|                                                     real_subband, imag_subband, ptr_scratch);
  132|  6.19M|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (132:7): [True: 0, False: 6.19M]
  ------------------
  133|      0|    return error;
  134|      0|  }
  135|       |
  136|  6.19M|  memmove(pstr_qmf_filter_bank->ptr_filter_states,
  137|  6.19M|          (FLOAT32 *)pstr_qmf_filter_bank->ptr_filter_states + pstr_qmf_filter_bank->no_channels,
  138|  6.19M|          offset * sizeof(FLOAT32));
  139|  6.19M|  return error;
  140|  6.19M|}
ixheaace_mps_212_qmf_init_filter_bank:
  145|  2.56k|                                      WORD32 usb, WORD32 no_channels) {
  146|  2.56k|  memset(pstr_qmf_filter_bank, 0, sizeof(ixheaace_mps_qmf_filter_bank));
  147|  2.56k|  pstr_qmf_filter_bank->no_channels = no_channels;
  148|  2.56k|  pstr_qmf_filter_bank->no_col = num_cols;
  149|  2.56k|  pstr_qmf_filter_bank->lsb = MIN(lsb, pstr_qmf_filter_bank->no_channels);
  ------------------
  |  |   23|  2.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 2.56k]
  |  |  ------------------
  ------------------
  150|  2.56k|  pstr_qmf_filter_bank->usb = MIN(usb, pstr_qmf_filter_bank->no_channels);
  ------------------
  |  |   23|  2.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 2.56k]
  |  |  ------------------
  ------------------
  151|  2.56k|  pstr_qmf_filter_bank->ptr_filter_states = (VOID *)ptr_filter_states;
  152|  2.56k|  memset(pstr_qmf_filter_bank->ptr_filter_states, 0,
  153|  2.56k|         (2 * QMF_NO_POLY - 1) * pstr_qmf_filter_bank->no_channels * sizeof(FLOAT32));
  ------------------
  |  |  147|  2.56k|#define QMF_NO_POLY 5
  ------------------
  154|  2.56k|  pstr_qmf_filter_bank->p_stride = 1;
  155|  2.56k|  if (no_channels == 64) {
  ------------------
  |  Branch (155:7): [True: 2.56k, False: 0]
  ------------------
  156|  2.56k|    pstr_qmf_filter_bank->pstr_filter = qmf_mps_ld_fb_640;
  157|  2.56k|    pstr_qmf_filter_bank->filter_size = 640;
  158|  2.56k|  } else {
  159|      0|    pstr_qmf_filter_bank->pstr_filter = qmf_mps_ld_fb_320;
  160|      0|    pstr_qmf_filter_bank->filter_size = 320;
  161|      0|  }
  162|       |
  163|  2.56k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  2.56k|#define IA_NO_ERROR 0x00000000
  ------------------
  164|  2.56k|}
ixheaace_mps_qmf.c:ixheaace_mps_212_qmf_ana_prototype_fir_slot:
   97|  6.19M|                                                        FLOAT32 *ptr_filter_states) {
   98|  6.19M|  const FLOAT32 *p_flt = ptr_filter;
   99|  6.19M|  WORD32 poly, band;
  100|  6.19M|  FLOAT32 accumlate;
  101|       |
  102|   799M|  for (band = 0; band < 2 * qmf_bands; band++) {
  ------------------
  |  Branch (102:18): [True: 793M, False: 6.19M]
  ------------------
  103|   793M|    accumlate = 0;
  104|   793M|    p_flt += QMF_NO_POLY * (stride - 1);
  ------------------
  |  |  147|   793M|#define QMF_NO_POLY 5
  ------------------
  105|  4.75G|    for (poly = 0; poly < QMF_NO_POLY; poly++) {
  ------------------
  |  |  147|  4.75G|#define QMF_NO_POLY 5
  ------------------
  |  Branch (105:20): [True: 3.96G, False: 793M]
  ------------------
  106|  3.96G|      accumlate += (((*p_flt++) * ptr_filter_states[2 * qmf_bands * poly]));
  107|  3.96G|    }
  108|   793M|    ptr_analysis_buffer[2 * qmf_bands - 1 - band] = accumlate;
  109|   793M|    ptr_filter_states++;
  110|   793M|  }
  111|  6.19M|}
ixheaace_mps_qmf.c:ixheaace_mps_212_qmf_forward_modulation_hq:
   42|  6.19M|    FLOAT32 *real_subband, FLOAT32 *imag_subband, WORD8 *ptr_scratch) {
   43|  6.19M|  IA_ERRORCODE error;
   44|  6.19M|  WORD32 idx;
   45|  6.19M|  WORD32 qmf_bands = pstr_qmf_filter_bank->no_channels;
   46|  6.19M|  WORD32 qmf_bands_by_2 = qmf_bands << 1;
   47|  6.19M|  FLOAT32 intermediate_band;
   48|  6.19M|  FLOAT32 x0, x1, y0, y1;
   49|  6.19M|  if (qmf_bands == 64) {
  ------------------
  |  Branch (49:7): [True: 6.19M, False: 0]
  ------------------
   50|  6.19M|    x0 = time_in[1];
   51|  6.19M|    y0 = time_in[0];
   52|  6.19M|    real_subband[0] = (x0 + y0) / 2;
   53|  6.19M|    imag_subband[0] = (x0 - y0) / 2;
   54|   396M|    for (idx = 1; idx < qmf_bands; idx++) {
  ------------------
  |  Branch (54:19): [True: 390M, False: 6.19M]
  ------------------
   55|   390M|      x0 = time_in[idx + 1];
   56|   390M|      y0 = time_in[qmf_bands_by_2 - idx];
   57|   390M|      real_subband[idx] = (x0 - y0) / 2;
   58|   390M|      imag_subband[idx] = (x0 + y0) / 2;
   59|   390M|    }
   60|  6.19M|  } else {
   61|      0|    for (idx = 0; idx < qmf_bands; idx += 2) {
  ------------------
  |  Branch (61:19): [True: 0, False: 0]
  ------------------
   62|      0|      x0 = time_in[idx + 0];
   63|      0|      x1 = time_in[idx + 1];
   64|      0|      y0 = time_in[qmf_bands_by_2 - 1 - idx];
   65|      0|      y1 = time_in[qmf_bands_by_2 - 2 - idx];
   66|       |
   67|      0|      real_subband[idx + 0] = (x0 - y0) / 2;
   68|      0|      real_subband[idx + 1] = (x1 - y1) / 2;
   69|      0|      imag_subband[idx + 0] = (x0 + y0) / 2;
   70|      0|      imag_subband[idx + 1] = (x1 + y1) / 2;
   71|      0|    }
   72|      0|  }
   73|  6.19M|  error = ixheaace_mps_212_dct_iv(real_subband, qmf_bands, ptr_scratch);
   74|  6.19M|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (74:7): [True: 0, False: 6.19M]
  ------------------
   75|      0|    return error;
   76|      0|  }
   77|  6.19M|  error = ixheaace_mps_212_dst_iv(imag_subband, qmf_bands, ptr_scratch);
   78|  6.19M|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (78:7): [True: 0, False: 6.19M]
  ------------------
   79|      0|    return error;
   80|      0|  }
   81|       |
   82|   204M|  for (idx = 0; idx < MIN(pstr_qmf_filter_bank->lsb, qmf_bands); idx += 2) {
  ------------------
  |  |   23|   204M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 204M]
  |  |  ------------------
  ------------------
  |  Branch (82:17): [True: 198M, False: 6.19M]
  ------------------
   83|   198M|    intermediate_band = real_subband[idx];
   84|   198M|    real_subband[idx] = -imag_subband[idx];
   85|   198M|    imag_subband[idx] = intermediate_band;
   86|       |
   87|   198M|    intermediate_band = -real_subband[idx + 1];
   88|   198M|    real_subband[idx + 1] = imag_subband[idx + 1];
   89|   198M|    imag_subband[idx + 1] = intermediate_band;
   90|   198M|  }
   91|  6.19M|  return IA_NO_ERROR;
  ------------------
  |  |   23|  6.19M|#define IA_NO_ERROR 0x00000000
  ------------------
   92|  6.19M|}

ixheaace_mps_212_static_gain_init:
   45|  1.28k|    const ixheaace_mps_pstr_static_gain_config pstr_static_gain_config) {
   46|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
   47|  1.28k|  FLOAT32 pre_gain_factor;
   48|  1.28k|  pstr_static_gain->fixed_gain_dmx = pstr_static_gain_config->fixed_gain_dmx;
   49|  1.28k|  pstr_static_gain->pre_gain_factor_db = pstr_static_gain_config->pre_gain_factor_db;
   50|       |
   51|  1.28k|  if ((pstr_static_gain->pre_gain_factor_db < -20) ||
  ------------------
  |  Branch (51:7): [True: 0, False: 1.28k]
  ------------------
   52|  1.28k|      (pstr_static_gain->pre_gain_factor_db > 20)) {
  ------------------
  |  Branch (52:7): [True: 0, False: 1.28k]
  ------------------
   53|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   54|      0|  }
   55|       |
   56|  1.28k|  if (pstr_static_gain->pre_gain_factor_db) {
  ------------------
  |  Branch (56:7): [True: 0, False: 1.28k]
  ------------------
   57|      0|    pre_gain_factor = pre_gain_factor_table_flt_new[pstr_static_gain->pre_gain_factor_db + 20];
   58|  1.28k|  } else {
   59|  1.28k|    pre_gain_factor = 1.0f;
   60|  1.28k|  }
   61|       |
   62|  1.28k|  if (pstr_static_gain->fixed_gain_dmx) {
  ------------------
  |  Branch (62:7): [True: 1.28k, False: 0]
  ------------------
   63|  1.28k|    pstr_static_gain->post_gain = dmx_gain_table_flt[pstr_static_gain->fixed_gain_dmx - 1];
   64|  1.28k|  } else {
   65|      0|    pstr_static_gain->post_gain = 1.0f;
   66|      0|  }
   67|       |
   68|  1.28k|  memset(pstr_static_gain->pre_gain, 0, sizeof(pstr_static_gain->pre_gain));
   69|       |
   70|  1.28k|  pstr_static_gain->pre_gain[0] = pre_gain_factor;
   71|  1.28k|  pstr_static_gain->pre_gain[1] = pre_gain_factor;
   72|       |
   73|  1.28k|  return error;
   74|  1.28k|}

ixheaace_mps_212_space_tree_init:
   85|  1.28k|                                 const WORD32 frame_keep_flag, WORD32 aot) {
   86|  1.28k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.28k|#define IA_NO_ERROR 0x00000000
  ------------------
   87|  1.28k|  WORD32 box = 0;
   88|       |
   89|  1.28k|  pstr_space_tree->frame_count = 0;
   90|  1.28k|  pstr_space_tree->frame_keep_flag = frame_keep_flag;
   91|  1.28k|  pstr_space_tree->num_param_bands = pstr_space_tree_setup->num_param_bands;
   92|  1.28k|  pstr_space_tree->use_coarse_quant_tto_icc_flag =
   93|  1.28k|      pstr_space_tree_setup->use_coarse_quant_tto_icc_flag;
   94|  1.28k|  pstr_space_tree->use_coarse_quant_tto_cld_flag =
   95|  1.28k|      pstr_space_tree_setup->use_coarse_quant_tto_cld_flag;
   96|  1.28k|  pstr_space_tree->quant_mode = pstr_space_tree_setup->quant_mode;
   97|  1.28k|  pstr_space_tree->num_channels_in_max = pstr_space_tree_setup->num_channels_in_max;
   98|  1.28k|  pstr_space_tree->num_hybrid_bands_max = pstr_space_tree_setup->num_hybrid_bands_max;
   99|  1.28k|  pstr_space_tree->descr.num_ott_boxes = 1;
  100|  1.28k|  pstr_space_tree->descr.num_in_channels = 1;
  101|  1.28k|  pstr_space_tree->descr.num_out_channels = 2;
  102|       |
  103|  1.28k|  if (pstr_space_tree->descr.num_ott_boxes > IXHEAACE_MPS_MAX_NUM_BOXES) {
  ------------------
  |  |   50|  1.28k|#define IXHEAACE_MPS_MAX_NUM_BOXES (1)
  ------------------
  |  Branch (103:7): [True: 0, False: 1.28k]
  ------------------
  104|      0|    return IA_EXHEAACE_INIT_FATAL_MPS_INIT_FAILED;
  105|      0|  }
  106|       |
  107|  2.56k|  for (box = 0; box < pstr_space_tree->descr.num_ott_boxes; box++) {
  ------------------
  |  Branch (107:17): [True: 1.28k, False: 1.28k]
  ------------------
  108|  1.28k|    ixheaace_mps_tto_box_config box_config;
  109|  1.28k|    box_config.b_use_coherence_icc_only = 0;
  110|  1.28k|    box_config.subband_config = pstr_space_tree->num_param_bands;
  111|  1.28k|    box_config.use_coarse_quant_cld_flag = pstr_space_tree->use_coarse_quant_tto_cld_flag;
  112|  1.28k|    box_config.use_coarse_quant_icc_flag = pstr_space_tree->use_coarse_quant_tto_icc_flag;
  113|  1.28k|    box_config.box_quant_mode = pstr_space_tree->quant_mode;
  114|  1.28k|    box_config.num_hybrid_bands_max = pstr_space_tree->num_hybrid_bands_max;
  115|  1.28k|    box_config.frame_keep_flag = pstr_space_tree->frame_keep_flag;
  116|       |
  117|  1.28k|    error = ixheaace_mps_212_init_tto_box(pstr_space_tree->pstr_tto_box[box], &box_config,
  118|  1.28k|                                          ptr_parameter_band_2_hybrid_band_offset, aot);
  119|  1.28k|    if (error) {
  ------------------
  |  Branch (119:9): [True: 0, False: 1.28k]
  ------------------
  120|      0|      return error;
  121|      0|    }
  122|  1.28k|  }
  123|       |
  124|  1.28k|  return error;
  125|  1.28k|}
ixheaace_mps_212_space_tree_apply:
  135|  91.2k|    ixheaace_mps_spatial_frame *const pstr_spatial_frame, const WORD32 avoid_keep) {
  136|  91.2k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  91.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  137|  91.2k|  WORD32 box;
  138|  91.2k|  const ixheaace_mps_tree_setup *pstr_tree_setup = NULL;
  139|  91.2k|  pstr_tree_setup = &tree_setup_table;
  140|       |
  141|  91.2k|  if ((num_channels_in != pstr_tree_setup->num_channels_in) ||
  ------------------
  |  Branch (141:7): [True: 0, False: 91.2k]
  ------------------
  142|  91.2k|      (num_channels_in > pstr_space_tree->num_channels_in_max) ||
  ------------------
  |  Branch (142:7): [True: 0, False: 91.2k]
  ------------------
  143|  91.2k|      (num_hybrid_bands > pstr_space_tree->num_hybrid_bands_max)) {
  ------------------
  |  Branch (143:7): [True: 0, False: 91.2k]
  ------------------
  144|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  145|      0|  }
  146|       |
  147|   182k|  for (box = 0; box < pstr_tree_setup->n_tto_boxes; box++) {
  ------------------
  |  Branch (147:17): [True: 91.2k, False: 91.2k]
  ------------------
  148|  91.2k|    const ixheaace_mps_tto_descriptor *pstr_tto_descriptor =
  149|  91.2k|        &pstr_tree_setup->tto_descriptor[box];
  150|  91.2k|    WORD32 i;
  151|  91.2k|    WORD32 in_ch[2], out_ch[2], win[2];
  152|       |
  153|  91.2k|    in_ch[0] = pstr_tto_descriptor->in_ch1;
  154|  91.2k|    in_ch[1] = pstr_tto_descriptor->in_ch2;
  155|  91.2k|    out_ch[0] = pstr_tto_descriptor->in_ch3;
  156|  91.2k|    out_ch[1] = pstr_tto_descriptor->in_ch4;
  157|  91.2k|    win[0] = pstr_tto_descriptor->w_ch1;
  158|  91.2k|    win[1] = pstr_tto_descriptor->w_ch2;
  159|       |
  160|   273k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (160:17): [True: 182k, False: 91.2k]
  ------------------
  161|   182k|      if (win[i] == WIN_ACTIV) {
  ------------------
  |  |   68|   182k|#define WIN_ACTIV (1)
  ------------------
  |  Branch (161:11): [True: 182k, False: 0]
  ------------------
  162|   182k|        ixheaace_mps_212_analysis_windowing(num_time_slots, start_time_slot,
  163|   182k|                                            p_frame_window_ana_mps, ppp_cmplx_hybrid_1[in_ch[i]],
  164|   182k|                                            ppp_cmplx_hybrid_2[out_ch[i]], num_hybrid_bands);
  165|   182k|      }
  166|   182k|    }
  167|       |
  168|  91.2k|    error = ixheaace_mps_212_apply_tto_box(
  169|  91.2k|        pstr_space_tree->pstr_tto_box[pstr_tto_descriptor->box_id], num_time_slots,
  170|  91.2k|        start_time_slot, num_hybrid_bands, ppp_cmplx_hybrid_2[pstr_tto_descriptor->in_ch3],
  171|  91.2k|        ppp_cmplx_hybrid_2[pstr_tto_descriptor->in_ch4],
  172|  91.2k|        pstr_spatial_frame->ott_data.icc[pstr_tto_descriptor->box_id][param_set],
  173|  91.2k|        &(pstr_spatial_frame->icc_lossless_data
  174|  91.2k|              .bs_quant_coarse_xxx[pstr_tto_descriptor->box_id][param_set]),
  175|  91.2k|        pstr_spatial_frame->ott_data.cld[pstr_tto_descriptor->box_id][param_set],
  176|  91.2k|        &(pstr_spatial_frame->cld_lossless_data
  177|  91.2k|              .bs_quant_coarse_xxx[pstr_tto_descriptor->box_id][param_set]),
  178|  91.2k|        pstr_spatial_frame->b_use_bb_cues);
  179|  91.2k|    if (error) {
  ------------------
  |  Branch (179:9): [True: 0, False: 91.2k]
  ------------------
  180|      0|      return error;
  181|      0|    }
  182|  91.2k|  }
  183|       |
  184|  91.2k|  if (pstr_space_tree->frame_keep_flag == 1) {
  ------------------
  |  Branch (184:7): [True: 91.2k, False: 0]
  ------------------
  185|  91.2k|    ixheaace_mps_212_space_tree_frame_keep_212(pstr_space_tree, pstr_spatial_frame, avoid_keep);
  186|  91.2k|  }
  187|  91.2k|  return error;
  188|  91.2k|}
ixheaace_mps_tree.c:ixheaace_mps_212_space_tree_frame_keep_212:
   54|  91.2k|    ixheaace_mps_spatial_frame *const pstr_spatial_frame, const WORD32 avoid_keep) {
   55|  91.2k|  WORD32 band;
   56|       |
   57|  91.2k|  if (avoid_keep) {
  ------------------
  |  Branch (57:7): [True: 51.6k, False: 39.5k]
  ------------------
   58|  1.43M|    for (band = 0; band < pstr_space_tree->num_param_bands; band++) {
  ------------------
  |  Branch (58:20): [True: 1.38M, False: 51.6k]
  ------------------
   59|  1.38M|      pstr_space_tree->icc_prev[0][band] = pstr_spatial_frame->ott_data.icc[0][0][band];
   60|  1.38M|      pstr_space_tree->cld_prev[0][band] = pstr_spatial_frame->ott_data.cld[0][0][band];
   61|  1.38M|    }
   62|  51.6k|  } else {
   63|  39.5k|    if (pstr_space_tree->frame_count % 2) {
  ------------------
  |  Branch (63:9): [True: 20.0k, False: 19.5k]
  ------------------
   64|   528k|      for (band = 0; band < pstr_space_tree->num_param_bands; band++) {
  ------------------
  |  Branch (64:22): [True: 508k, False: 20.0k]
  ------------------
   65|   508k|        pstr_spatial_frame->ott_data.icc[0][0][band] = pstr_space_tree->icc_prev[0][band];
   66|   508k|        pstr_space_tree->cld_prev[0][band] = pstr_spatial_frame->ott_data.cld[0][0][band];
   67|   508k|      }
   68|  20.0k|    } else {
   69|   522k|      for (band = 0; band < pstr_space_tree->num_param_bands; band++) {
  ------------------
  |  Branch (69:22): [True: 502k, False: 19.5k]
  ------------------
   70|   502k|        pstr_space_tree->icc_prev[0][band] = pstr_spatial_frame->ott_data.icc[0][0][band];
   71|   502k|        pstr_spatial_frame->ott_data.cld[0][0][band] = pstr_space_tree->cld_prev[0][band];
   72|   502k|      }
   73|  19.5k|    }
   74|  39.5k|  }
   75|  91.2k|  pstr_space_tree->frame_count++;
   76|  91.2k|  if (pstr_space_tree->frame_count == MAX_KEEP_FRAMECOUNT) {
  ------------------
  |  |   69|  91.2k|#define MAX_KEEP_FRAMECOUNT (100)
  ------------------
  |  Branch (76:7): [True: 650, False: 90.5k]
  ------------------
   77|    650|    pstr_space_tree->frame_count = 0;
   78|    650|  }
   79|  91.2k|}

ixheaace_mps_212_sum_up_cplx_pow_2_dim_2:
   30|  10.2M|                                         const WORD32 start_dim_2, const WORD32 stop_dim_2) {
   31|  10.2M|  WORD32 idx_1, idx_2;
   32|       |
   33|  10.2M|  FLOAT32 sum;
   34|  10.2M|  sum = 0.0f;
   35|   678M|  for (idx_1 = start_dim_1; idx_1 < stop_dim_1; idx_1++) {
  ------------------
  |  Branch (35:29): [True: 667M, False: 10.2M]
  ------------------
   36|  1.33G|    for (idx_2 = start_dim_2; idx_2 < stop_dim_2; idx_2++) {
  ------------------
  |  Branch (36:31): [True: 667M, False: 667M]
  ------------------
   37|   667M|      sum += inp[idx_1][idx_2].re * inp[idx_1][idx_2].re;
   38|   667M|      sum += inp[idx_1][idx_2].im * inp[idx_1][idx_2].im;
   39|   667M|    }
   40|   667M|  }
   41|  10.2M|  return (sum / 2);
   42|  10.2M|}
ixheaace_mps_212_cplx_scalar_product:
   47|  5.12M|    const WORD32 stop_dim_1, const WORD32 start_dim_2, const WORD32 stop_dim_2) {
   48|  5.12M|  WORD32 idx_1, idx_2;
   49|  5.12M|  FLOAT32 re_x, re_y, im_x, im_y, re, im;
   50|  5.12M|  re = 0.0f;
   51|  5.12M|  im = 0.0f;
   52|       |
   53|   339M|  for (idx_1 = start_dim_1; idx_1 < stop_dim_1; idx_1++) {
  ------------------
  |  Branch (53:29): [True: 333M, False: 5.12M]
  ------------------
   54|   667M|    for (idx_2 = start_dim_2; idx_2 < stop_dim_2; idx_2++) {
  ------------------
  |  Branch (54:31): [True: 333M, False: 333M]
  ------------------
   55|   333M|      re_x = inp_1[idx_1][idx_2].re;
   56|   333M|      im_x = inp_1[idx_1][idx_2].im;
   57|   333M|      re_y = inp_2[idx_1][idx_2].re;
   58|   333M|      im_y = inp_2[idx_1][idx_2].im;
   59|   333M|      re += (re_x * re_y) + (im_x * im_y);
   60|   333M|      im += (im_x * re_y) - (re_x * im_y);
   61|   333M|    }
   62|   333M|  }
   63|       |
   64|  5.12M|  out->re = re / 2;
   65|  5.12M|  out->im = im / 2;
   66|  5.12M|}
ixheaace_mps_212_sum_up_cplx_pow_2:
   69|  6.19M|                                           const WORD32 len) {
   70|  6.19M|  WORD32 idx;
   71|  6.19M|  FLOAT32 sum;
   72|  6.19M|  sum = 0.0f;
   73|       |
   74|   369M|  for (idx = 0; idx < len; idx++) {
  ------------------
  |  Branch (74:17): [True: 362M, False: 6.19M]
  ------------------
   75|   362M|    sum += inp[idx].re * inp[idx].re;
   76|   362M|    sum += inp[idx].im * inp[idx].im;
   77|   362M|  }
   78|       |
   79|  6.19M|  return (sum / 2);
   80|  6.19M|}

iaace_ms_apply:
   52|   140k|                    FLOAT32 *ptr_weight_ms_lr_pe_ratio) {
   53|   140k|  FLOAT32 *ptr_sfb_enegry_left = ptr_psy_data[0]->sfb_energy.long_nrg;
   54|   140k|  FLOAT32 *ptr_sfb_energy_right = ptr_psy_data[1]->sfb_energy.long_nrg;
   55|   140k|  const FLOAT32 *ptr_sfb_energy_mid = ptr_psy_data[0]->sfb_energy_ms.long_nrg;
   56|   140k|  const FLOAT32 *ptr_sfb_energy_side = ptr_psy_data[1]->sfb_energy_ms.long_nrg;
   57|   140k|  FLOAT32 *ptr_sfb_thr_left = ptr_psy_data[0]->sfb_threshold.long_nrg;
   58|   140k|  FLOAT32 *ptr_sfb_thr_right = ptr_psy_data[1]->sfb_threshold.long_nrg;
   59|   140k|  FLOAT32 *ptr_sfb_spread_energy_left = ptr_psy_data[0]->sfb_sreaded_energy.long_nrg;
   60|   140k|  FLOAT32 *ptr_sfb_spread_energy_right = ptr_psy_data[1]->sfb_sreaded_energy.long_nrg;
   61|   140k|  WORD32 sfb, sfb_offsets, j;
   62|   140k|  WORD32 grp = 0;
   63|   140k|  WORD32 ms_counter = 0;
   64|   140k|  WORD32 lr_counter = 0;
   65|   140k|  FLOAT32 sum_ss_sr_pe_ratio = 0;
   66|   140k|  WORD32 cnt = 0;
   67|   140k|  FLOAT32 atan_val;
   68|   140k|  *ptr_ms_select = 0;
   69|       |
   70|   384k|  for (sfb = 0; sfb < sfb_count; sfb += sfb_per_group, grp++) {
  ------------------
  |  Branch (70:17): [True: 243k, False: 140k]
  ------------------
   71|  4.28M|    for (sfb_offsets = 0; sfb_offsets < max_sfb_per_grp; sfb_offsets++) {
  ------------------
  |  Branch (71:27): [True: 4.04M, False: 243k]
  ------------------
   72|  4.04M|      FLOAT32 left_right, mid_side, min_thr;
   73|  4.04M|      WORD32 use_ms;
   74|  4.04M|      ptr_ms_used[sfb + sfb_offsets] = 0;
   75|       |
   76|  4.04M|      min_thr = MIN(ptr_sfb_thr_left[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]);
  ------------------
  |  |   23|  4.04M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 635k, False: 3.40M]
  |  |  ------------------
  ------------------
   77|       |
   78|  4.04M|      left_right =
   79|  4.04M|          (ptr_sfb_thr_left[sfb + sfb_offsets] /
   80|  4.04M|           MAX(ptr_sfb_enegry_left[sfb + sfb_offsets], ptr_sfb_thr_left[sfb + sfb_offsets])) *
  ------------------
  |  |   24|  4.04M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.99M, False: 1.04M]
  |  |  ------------------
  ------------------
   81|  4.04M|          (ptr_sfb_thr_right[sfb + sfb_offsets] /
   82|  4.04M|           MAX(ptr_sfb_energy_right[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]));
  ------------------
  |  |   24|  4.04M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 2.99M, False: 1.05M]
  |  |  ------------------
  ------------------
   83|       |
   84|  4.04M|      mid_side = (min_thr / MAX(ptr_sfb_energy_mid[sfb + sfb_offsets], min_thr)) *
  ------------------
  |  |   24|  4.04M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 3.00M, False: 1.04M]
  |  |  ------------------
  ------------------
   85|  4.04M|                 (min_thr / MAX(ptr_sfb_energy_side[sfb + sfb_offsets], min_thr));
  ------------------
  |  |   24|  4.04M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.23M, False: 2.80M]
  |  |  ------------------
  ------------------
   86|       |
   87|  4.04M|      sum_ss_sr_pe_ratio += (left_right + 1.0e-9f) / (mid_side + 1.0e-9f);
   88|  4.04M|      cnt++;
   89|  4.04M|      use_ms = (mid_side >= left_right);
   90|       |
   91|  4.04M|      if (use_ms) {
  ------------------
  |  Branch (91:11): [True: 3.78M, False: 256k]
  ------------------
   92|  3.78M|        ptr_ms_used[sfb + sfb_offsets] = 1;
   93|       |
   94|  57.6M|        for (j = ptr_sfb_offset[sfb + sfb_offsets]; j < ptr_sfb_offset[sfb + sfb_offsets + 1];
  ------------------
  |  Branch (94:53): [True: 53.8M, False: 3.78M]
  ------------------
   95|  53.8M|             j++) {
   96|  53.8M|          FLOAT32 tmp = ptr_spec_left[j];
   97|       |
   98|  53.8M|          ptr_spec_left[j] = 0.5f * (ptr_spec_left[j] + ptr_spec_right[j]);
   99|       |
  100|  53.8M|          ptr_spec_right[j] = 0.5f * (tmp - ptr_spec_right[j]);
  101|  53.8M|        }
  102|       |
  103|  3.78M|        ptr_sfb_thr_left[sfb + sfb_offsets] = ptr_sfb_thr_right[sfb + sfb_offsets] = min_thr;
  104|       |
  105|  3.78M|        ptr_sfb_enegry_left[sfb + sfb_offsets] = ptr_sfb_energy_mid[sfb + sfb_offsets];
  106|  3.78M|        ptr_sfb_energy_right[sfb + sfb_offsets] = ptr_sfb_energy_side[sfb + sfb_offsets];
  107|       |
  108|  3.78M|        ptr_sfb_spread_energy_left[sfb + sfb_offsets] =
  109|  3.78M|            ptr_sfb_spread_energy_right[sfb + sfb_offsets] =
  110|  3.78M|                MIN(ptr_sfb_spread_energy_left[sfb + sfb_offsets],
  ------------------
  |  |   23|  3.78M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 757k, False: 3.02M]
  |  |  ------------------
  ------------------
  111|  3.78M|                    ptr_sfb_spread_energy_right[sfb + sfb_offsets]) *
  112|  3.78M|                0.5f;
  113|       |
  114|  3.78M|        ms_counter++;
  115|  3.78M|      } else {
  116|   256k|        ptr_ms_used[sfb + sfb_offsets] = 0;
  117|   256k|        lr_counter++;
  118|   256k|      }
  119|  4.04M|    }
  120|   243k|  }
  121|       |
  122|   140k|  if (ms_counter == 0) {
  ------------------
  |  Branch (122:7): [True: 24.4k, False: 116k]
  ------------------
  123|  24.4k|    *ptr_ms_select = 0;
  124|   116k|  } else {
  125|   116k|    if (lr_counter != 0) {
  ------------------
  |  Branch (125:9): [True: 28.1k, False: 88.2k]
  ------------------
  126|  28.1k|      *ptr_ms_select = 1;
  127|  88.2k|    } else {
  128|  88.2k|      *ptr_ms_select = 2;
  129|  88.2k|    }
  130|   116k|  }
  131|       |
  132|   140k|  cnt = MAX(1, cnt);
  ------------------
  |  |   24|   140k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 22.7k, False: 118k]
  |  |  ------------------
  ------------------
  133|       |
  134|   140k|  atan_val = iaace_atan_approx((FLOAT32)(0.37f * (sum_ss_sr_pe_ratio / cnt - 6.5f)));
  135|       |
  136|   140k|  *ptr_weight_ms_lr_pe_ratio = (FLOAT32)((0.28f * atan_val) + 1.25f);
  137|   140k|}

iusace_noise_filling:
   86|   215k|                          WORD32 noise_filling_start_offset, FLOAT64 *ptr_scratch_buf) {
   87|   215k|  FLOAT64 energy;
   88|   215k|  FLOAT64 noise_level_temp;
   89|   215k|  FLOAT64 noise_offset_temp;
   90|       |
   91|   215k|  FLOAT64 sum_sfb_on, sum_sfb_off;
   92|   215k|  FLOAT64 e_sfb_on, e_sfb_off;
   93|       |
   94|   215k|  WORD32 n0;
   95|   215k|  WORD32 start_sfb, sfb, i;
   96|   215k|  WORD32 band_quantized_to_zero;
   97|       |
   98|   215k|  FLOAT64 alpha = 0.15; /* prudence factor */
   99|   215k|  WORD32 grp = 0;
  100|       |
  101|   215k|  e_sfb_on = 1e-6;
  102|   215k|  e_sfb_off = 1e-6;
  103|       |
  104|   215k|  sum_sfb_on = 1e-6;
  105|   215k|  sum_sfb_off = 1e-6;
  106|       |
  107|   215k|  *noise_offset = 0;
  108|   215k|  *noise_level = 0;
  109|       |
  110|  3.25M|  for (sfb = 0; sfb < max_sfb; sfb++) {
  ------------------
  |  Branch (110:17): [True: 3.23M, False: 13.4k]
  ------------------
  111|  3.23M|    if (ptr_sfb_offset[sfb + 1] > noise_filling_start_offset) break;
  ------------------
  |  Branch (111:9): [True: 202k, False: 3.03M]
  ------------------
  112|  3.23M|  }
  113|   215k|  start_sfb = sfb;
  114|   632k|  for (grp = 0; grp < num_window_groups; grp++) {
  ------------------
  |  Branch (114:17): [True: 416k, False: 215k]
  ------------------
  115|   416k|    WORD32 grp_win = 0;
  116|  6.40M|    for (sfb = start_sfb; sfb < max_sfb; sfb++) {
  ------------------
  |  Branch (116:27): [True: 5.98M, False: 416k]
  ------------------
  117|  5.98M|      band_quantized_to_zero = 1;
  118|  15.3M|      for (grp_win = 0; grp_win < ptr_window_group_length[grp]; grp_win++) {
  ------------------
  |  Branch (118:25): [True: 9.32M, False: 5.98M]
  ------------------
  119|  9.32M|        WORD32 offset = grp_win * window_size_samples;
  120|  9.32M|        energy = 0;
  121|  9.32M|        n0 = 0;
  122|   254M|        for (i = ptr_sfb_offset[sfb]; i < ptr_sfb_offset[sfb + 1]; i++) {
  ------------------
  |  Branch (122:39): [True: 244M, False: 9.32M]
  ------------------
  123|       |          /* calculate energy if the quantized value is non zero */
  124|   244M|          if (!pstr_quant_info->quant_degroup[offset + i]) {
  ------------------
  |  Branch (124:15): [True: 182M, False: 62.1M]
  ------------------
  125|   182M|            energy += ptr_quant_spec[offset + i] * ptr_quant_spec[offset + i];
  126|   182M|            n0++;
  127|   182M|          } else {
  128|       |            /* All quantized values are not zero */
  129|  62.1M|            band_quantized_to_zero = 0;
  130|  62.1M|          }
  131|   244M|        }
  132|       |
  133|       |        /* Remove highest (tonal) contributions */
  134|  9.32M|        iusace_noise_filling_limiter(&energy, &ptr_quant_spec[offset],
  135|  9.32M|                                     &pstr_quant_info->quant_degroup[offset], n0 / 4,
  136|  9.32M|                                     ptr_sfb_offset, sfb, n0, ptr_scratch_buf);
  137|       |
  138|  9.32M|        if (band_quantized_to_zero == 0) {
  ------------------
  |  Branch (138:13): [True: 3.61M, False: 5.71M]
  ------------------
  139|  3.61M|          e_sfb_on += energy;
  140|  3.61M|          sum_sfb_on += pow(2., 0.5 * pstr_quant_info->scale_factor[sfb] - 50) * n0;
  141|  3.61M|        } else
  142|       |        /* subband is completely zeroed  */
  143|  5.71M|        {
  144|  5.71M|          e_sfb_off += energy;
  145|  5.71M|          sum_sfb_off += pow(2., 0.5 * pstr_quant_info->scale_factor[sfb] - 58) *
  146|  5.71M|                         (ptr_sfb_offset[sfb + 1] - ptr_sfb_offset[sfb]);
  147|  5.71M|        }
  148|  9.32M|      }
  149|  5.98M|    }
  150|   416k|  }
  151|       |
  152|   215k|  if (num_window_groups > 1) alpha = alpha * 0.15;
  ------------------
  |  Branch (152:7): [True: 70.6k, False: 144k]
  ------------------
  153|       |
  154|   215k|  if (sum_sfb_on) {
  ------------------
  |  Branch (154:7): [True: 215k, False: 0]
  ------------------
  155|   215k|    noise_level_temp = 1.5 * (log(alpha * e_sfb_on) - log(sum_sfb_on)) / log(2.0) + 14.0;
  156|       |
  157|       |    /* quantize to nearest integer */
  158|   215k|    *noise_level = (WORD32)(noise_level_temp + 0.5);
  159|       |
  160|       |    /* noise level limited to quantization range [0,7] */
  161|   215k|    *noise_level = MAX(*noise_level, 0);
  ------------------
  |  |   24|   215k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 174k, False: 40.9k]
  |  |  ------------------
  ------------------
  162|   215k|    *noise_level = MIN(*noise_level, 7);
  ------------------
  |  |   23|   215k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 144k, False: 71.0k]
  |  |  ------------------
  ------------------
  163|       |
  164|   215k|    if (*noise_level != 0) {
  ------------------
  |  Branch (164:9): [True: 174k, False: 40.9k]
  ------------------
  165|   174k|      noise_offset_temp =
  166|   174k|          2. * log(alpha * e_sfb_off * sum_sfb_on / sum_sfb_off / e_sfb_on) / log(2.);
  167|       |
  168|       |      /* quantize to nearest integer */
  169|   174k|      *noise_offset = (WORD32)(noise_offset_temp + 0.5);
  170|       |
  171|       |      /* noise offset limited to quantization range [0,31] */
  172|   174k|      *noise_level = *noise_offset <= 0 ? 0 : *noise_level;
  ------------------
  |  Branch (172:22): [True: 142k, False: 31.8k]
  ------------------
  173|   174k|      *noise_offset = MIN(*noise_offset, 31);
  ------------------
  |  |   23|   174k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 174k, False: 26]
  |  |  ------------------
  ------------------
  174|   174k|      *noise_offset = MAX(*noise_offset, 0);
  ------------------
  |  |   24|   174k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 31.8k, False: 142k]
  |  |  ------------------
  ------------------
  175|   174k|    }
  176|   215k|  }
  177|   215k|  return;
  178|   215k|}
ixheaace_nf.c:iusace_noise_filling_limiter:
   38|  9.32M|                                         FLOAT64 *ptr_highest_tone) {
   39|  9.32M|  WORD32 n, i;
   40|  9.32M|  FLOAT64 tone_energy;
   41|  9.32M|  FLOAT64 tot_tone_energy = 0.0;
   42|       |
   43|  9.32M|  if (!n0_by_4) return;
  ------------------
  |  Branch (43:7): [True: 1.67M, False: 7.65M]
  ------------------
   44|  7.65M|  if (cntr <= n0_by_4) return;
  ------------------
  |  Branch (44:7): [True: 0, False: 7.65M]
  ------------------
   45|       |
   46|  7.65M|  memset(ptr_highest_tone, 0, n0_by_4 * sizeof(*ptr_highest_tone));
   47|       |
   48|       |  /* finds the n0_by_4 strongest bins */
   49|   214M|  for (i = ptr_sfb_offset[sb]; i < ptr_sfb_offset[sb + 1]; i++) {
  ------------------
  |  Branch (49:32): [True: 207M, False: 7.65M]
  ------------------
   50|   207M|    if (!ptr_quant_spec[i]) {
  ------------------
  |  Branch (50:9): [True: 181M, False: 25.4M]
  ------------------
   51|   181M|      tone_energy = ptr_spec[i] * ptr_spec[i];
   52|       |
   53|  1.64G|      for (n = 0; n < n0_by_4; n++) {
  ------------------
  |  Branch (53:19): [True: 1.47G, False: 166M]
  ------------------
   54|  1.47G|        if (tone_energy > ptr_highest_tone[n]) {
  ------------------
  |  Branch (54:13): [True: 15.5M, False: 1.46G]
  ------------------
   55|  15.5M|          memmove(ptr_highest_tone + 1 + n, ptr_highest_tone + n,
   56|  15.5M|                  (n0_by_4 - n - 1) * sizeof(*ptr_highest_tone));
   57|  15.5M|          ptr_highest_tone[n] = tone_energy;
   58|  15.5M|          break;
   59|  15.5M|        }
   60|  1.47G|      }
   61|   181M|    }
   62|   207M|  }
   63|       |  /* remove the contribution of the highest_tone components */
   64|  52.4M|  for (n = 0; n < n0_by_4; n++) tot_tone_energy += ptr_highest_tone[n];
  ------------------
  |  Branch (64:15): [True: 44.8M, False: 7.65M]
  ------------------
   65|       |
   66|  7.65M|  FLOAT64 diff = *energy - tot_tone_energy;
   67|       |  //If the difference is within 1% of total energy, no need to send any energy
   68|  7.65M|  if (diff < 0.01*(*energy))
  ------------------
  |  Branch (68:7): [True: 190k, False: 7.46M]
  ------------------
   69|   190k|  {
   70|   190k|    *energy = 0.0;
   71|   190k|  }
   72|  7.46M|  else
   73|  7.46M|  {
   74|  7.46M|    *energy = diff;
   75|  7.46M|  }
   76|       |
   77|       |  /* add the average component energy */
   78|  7.65M|  *energy += n0_by_4 * (*energy) / (cntr - n0_by_4);
   79|  7.65M|  return;
   80|  7.65M|}

ixheaace_enc_write_ps_data:
   66|  19.7k|                           ixheaace_str_ps_tab *ps_tables) {
   67|  19.7k|  WORD32 tmp_var, gr;
   68|  19.7k|  const WORD32 *aa_huff_book_iid_c;
   69|  19.7k|  const WORD16 *aa_huff_book_icc_c;
   70|  19.7k|  const WORD8 *aa_huff_book_iid_l;
   71|  19.7k|  const WORD8 *aa_huff_book_icc_l;
   72|  19.7k|  WORD32 *aa_delta_iid;
   73|  19.7k|  WORD32 *aa_delta_icc;
   74|       |
   75|  19.7k|  WORD8 index, last_index;
   76|  19.7k|  WORD32 no_bits_f = 0;
   77|  19.7k|  WORD32 no_bits_t = 0;
   78|       |
   79|  19.7k|  WORD32 aa_delta_iid_t[NUMBER_OF_IID_BINS] = {0};
   80|  19.7k|  WORD32 aa_delta_icc_t[NUMBER_OF_ICC_BINS] = {0};
   81|       |
   82|  19.7k|  WORD32 aa_delta_iid_f[NUMBER_OF_IID_BINS] = {0};
   83|  19.7k|  WORD32 aa_delta_icc_f[NUMBER_OF_ICC_BINS] = {0};
   84|       |
   85|  19.7k|  WORD32 ab_dt_flag_iid;
   86|  19.7k|  WORD32 ab_dt_flag_icc;
   87|       |
   88|  19.7k|  WORD32 b_send_header;
   89|       |
   90|  19.7k|  UWORD32 b_zero_iid = 1;
   91|  19.7k|  UWORD32 b_zero_icc = 1;
   92|  19.7k|  UWORD32 b_keep_params = 1;
   93|       |
   94|  19.7k|  ixheaace_bit_buf_handle bb = &pstr_ps_handle->ps_bit_buf;
   95|       |
   96|  19.7k|  tmp_var = ia_enhaacplus_enc_get_bits_available(bb);
   97|       |
   98|       |  /* bit buffer shall be empty */
   99|  19.7k|  if (tmp_var != 0) {
  ------------------
  |  Branch (99:7): [True: 0, False: 19.7k]
  ------------------
  100|      0|    return -1;
  101|      0|  }
  102|       |
  103|  19.7k|  if (b_header_active) {
  ------------------
  |  Branch (103:7): [True: 2.36k, False: 17.3k]
  ------------------
  104|  2.36k|    b_keep_params = 0;
  105|  2.36k|  }
  106|       |
  107|  19.7k|  last_index = 0;
  108|       |
  109|   359k|  for (gr = 0; gr < pstr_ps_handle->iid_icc_bins; gr++) {
  ------------------
  |  Branch (109:16): [True: 340k, False: 19.7k]
  ------------------
  110|   340k|    WORD IID_flag;
  111|   340k|    FLOAT32 pan_value = pstr_ps_handle->aaa_IID_data_buf[gr][SYSTEMLOOKAHEAD];
  ------------------
  |  |   37|   340k|#define SYSTEMLOOKAHEAD (1)
  ------------------
  112|   340k|    IID_flag = 0;
  113|   340k|    if ((pan_value >= -ps_tables->pan_class[0]) && (pan_value <= ps_tables->pan_class[0])) {
  ------------------
  |  Branch (113:9): [True: 330k, False: 9.96k]
  |  Branch (113:52): [True: 320k, False: 9.84k]
  ------------------
  114|   320k|      IID_flag = 1;
  115|   320k|    }
  116|       |
  117|   340k|    if (IID_flag) {
  ------------------
  |  Branch (117:9): [True: 320k, False: 19.8k]
  ------------------
  118|   320k|      index = 0;
  119|   320k|    } else {
  120|  19.8k|      if (pan_value < 0) {
  ------------------
  |  Branch (120:11): [True: 9.96k, False: 9.84k]
  ------------------
  121|  52.6k|        for (index = NO_IID_STEPS - 1; pan_value > -ps_tables->pan_class[index]; index--) {
  ------------------
  |  |   24|  9.96k|#define NO_IID_STEPS (7)
  ------------------
  |  Branch (121:40): [True: 42.6k, False: 9.96k]
  ------------------
  122|  42.6k|        }
  123|  9.96k|        index = -index - 1;
  124|  9.96k|      } else {
  125|  54.4k|        for (index = NO_IID_STEPS - 1; pan_value < ps_tables->pan_class[index]; index--) {
  ------------------
  |  |   24|  9.84k|#define NO_IID_STEPS (7)
  ------------------
  |  Branch (125:40): [True: 44.6k, False: 9.84k]
  ------------------
  126|  44.6k|        }
  127|  9.84k|        index++;
  128|  9.84k|      }
  129|       |
  130|  19.8k|      b_zero_iid = 0;
  131|  19.8k|    }
  132|       |
  133|   340k|    if (gr == 0) {
  ------------------
  |  Branch (133:9): [True: 19.7k, False: 320k]
  ------------------
  134|  19.7k|      aa_delta_iid_f[gr] = index;
  135|  19.7k|      no_bits_t = 0;
  136|       |
  137|  19.7k|      no_bits_f = ps_tables->a_book_ps_iid_freq_length[index + CODE_BCK_LAV_IID];
  ------------------
  |  |   22|  19.7k|#define CODE_BCK_LAV_IID 14
  ------------------
  138|   320k|    } else {
  139|   320k|      aa_delta_iid_f[gr] = index - last_index;
  140|       |
  141|   320k|      no_bits_f += ps_tables->a_book_ps_iid_freq_length[aa_delta_iid_f[gr] + CODE_BCK_LAV_IID];
  ------------------
  |  |   22|   320k|#define CODE_BCK_LAV_IID 14
  ------------------
  142|   320k|    }
  143|       |
  144|   340k|    last_index = index;
  145|       |
  146|   340k|    aa_delta_iid_t[gr] = index - pstr_ps_handle->a_last_iid_index[gr];
  147|       |
  148|   340k|    pstr_ps_handle->a_last_iid_index[gr] = index;
  149|       |
  150|   340k|    no_bits_t += ps_tables->a_book_ps_iid_time_length[aa_delta_iid_t[gr] + CODE_BCK_LAV_IID];
  ------------------
  |  |   22|   340k|#define CODE_BCK_LAV_IID 14
  ------------------
  151|       |
  152|   340k|    if (aa_delta_iid_t[gr] != 0) {
  ------------------
  |  Branch (152:9): [True: 28.8k, False: 311k]
  ------------------
  153|  28.8k|      b_keep_params = 0;
  154|  28.8k|    }
  155|   340k|  }
  156|       |
  157|  19.7k|  if (no_bits_t < no_bits_f && !b_header_active) {
  ------------------
  |  Branch (157:7): [True: 839, False: 18.8k]
  |  Branch (157:32): [True: 759, False: 80]
  ------------------
  158|    759|    ab_dt_flag_iid = 1;
  159|    759|    aa_delta_iid = aa_delta_iid_t;
  160|    759|    aa_huff_book_iid_c = ps_tables->a_book_ps_iid_time_code;
  161|    759|    aa_huff_book_iid_l = ps_tables->a_book_ps_iid_time_length;
  162|  18.9k|  } else {
  163|  18.9k|    ab_dt_flag_iid = 0;
  164|  18.9k|    aa_delta_iid = aa_delta_iid_f;
  165|  18.9k|    aa_huff_book_iid_c = ps_tables->a_book_ps_iid_freq_code;
  166|  18.9k|    aa_huff_book_iid_l = ps_tables->a_book_ps_iid_freq_length;
  167|  18.9k|  }
  168|       |
  169|  19.7k|  last_index = 0;
  170|       |
  171|   359k|  for (gr = 0; gr < pstr_ps_handle->iid_icc_bins; gr++) {
  ------------------
  |  Branch (171:16): [True: 340k, False: 19.7k]
  ------------------
  172|   340k|    WORD ICC_flag;
  173|   340k|    FLOAT32 sa_value = pstr_ps_handle->aaa_ICC_data_buf[gr][SYSTEMLOOKAHEAD];
  ------------------
  |  |   37|   340k|#define SYSTEMLOOKAHEAD (1)
  ------------------
  174|   340k|    ICC_flag = 0;
  175|   340k|    if (sa_value <= ps_tables->sa_class[0]) {
  ------------------
  |  Branch (175:9): [True: 307k, False: 32.5k]
  ------------------
  176|   307k|      ICC_flag = 1;
  177|   307k|    }
  178|   340k|    if (ICC_flag) {
  ------------------
  |  Branch (178:9): [True: 307k, False: 32.5k]
  ------------------
  179|   307k|      index = 0;
  180|   307k|    } else {
  181|   145k|      for (index = NO_ICC_STEPS - 2; sa_value < ps_tables->sa_class[index]; index--) {
  ------------------
  |  |   25|  32.5k|#define NO_ICC_STEPS (8)
  ------------------
  |  Branch (181:38): [True: 113k, False: 32.5k]
  ------------------
  182|   113k|      }
  183|  32.5k|      index++;
  184|       |
  185|  32.5k|      b_zero_icc = 0;
  186|  32.5k|    }
  187|       |
  188|   340k|    if (gr == 0) {
  ------------------
  |  Branch (188:9): [True: 19.7k, False: 320k]
  ------------------
  189|  19.7k|      aa_delta_icc_f[gr] = index;
  190|       |
  191|  19.7k|      no_bits_f = ps_tables->a_book_ps_icc_freq_length[index + CODE_BCK_LAV_ICC];
  ------------------
  |  |   23|  19.7k|#define CODE_BCK_LAV_ICC 7
  ------------------
  192|       |
  193|  19.7k|      no_bits_t = 0;
  194|   320k|    } else {
  195|   320k|      aa_delta_icc_f[gr] = index - last_index;
  196|       |
  197|   320k|      no_bits_f += ps_tables->a_book_ps_icc_freq_length[aa_delta_icc_f[gr] + CODE_BCK_LAV_ICC];
  ------------------
  |  |   23|   320k|#define CODE_BCK_LAV_ICC 7
  ------------------
  198|   320k|    }
  199|       |
  200|   340k|    last_index = index;
  201|       |
  202|   340k|    aa_delta_icc_t[gr] = index - pstr_ps_handle->a_last_icc_index[gr];
  203|       |
  204|   340k|    pstr_ps_handle->a_last_icc_index[gr] = index;
  205|       |
  206|   340k|    no_bits_t += ps_tables->a_book_ps_icc_time_length[aa_delta_icc_t[gr] + CODE_BCK_LAV_ICC];
  ------------------
  |  |   23|   340k|#define CODE_BCK_LAV_ICC 7
  ------------------
  207|       |
  208|   340k|    if (aa_delta_icc_t[gr] != 0) {
  ------------------
  |  Branch (208:9): [True: 38.6k, False: 301k]
  ------------------
  209|  38.6k|      b_keep_params = 0;
  210|  38.6k|    }
  211|   340k|  }
  212|       |
  213|  19.7k|  if (no_bits_t < no_bits_f && !b_header_active) {
  ------------------
  |  Branch (213:7): [True: 692, False: 19.0k]
  |  Branch (213:32): [True: 618, False: 74]
  ------------------
  214|    618|    ab_dt_flag_icc = 1;
  215|    618|    aa_delta_icc = aa_delta_icc_t;
  216|    618|    aa_huff_book_icc_c = ps_tables->a_book_ps_icc_time_code;
  217|    618|    aa_huff_book_icc_l = ps_tables->a_book_ps_icc_time_length;
  218|  19.0k|  } else {
  219|  19.0k|    ab_dt_flag_icc = 0;
  220|  19.0k|    aa_delta_icc = aa_delta_icc_f;
  221|  19.0k|    aa_huff_book_icc_c = ps_tables->a_book_ps_icc_freq_code;
  222|  19.0k|    aa_huff_book_icc_l = ps_tables->a_book_ps_icc_freq_length;
  223|  19.0k|  }
  224|       |
  225|  19.7k|  {
  226|  19.7k|    static WORD32 initheader = 0;
  227|       |
  228|  19.7k|    if (!initheader || b_header_active) {
  ------------------
  |  Branch (228:9): [True: 1, False: 19.7k]
  |  Branch (228:24): [True: 2.36k, False: 17.3k]
  ------------------
  229|  2.36k|      initheader = 1;
  230|  2.36k|      pstr_ps_handle->b_enable_header = 1;
  231|  17.3k|    } else {
  232|  17.3k|      pstr_ps_handle->b_enable_header = 0;
  233|  17.3k|    }
  234|  19.7k|  }
  235|       |
  236|  19.7k|  b_send_header = pstr_ps_handle->b_enable_header ||
  ------------------
  |  Branch (236:19): [True: 2.36k, False: 17.3k]
  ------------------
  237|  17.3k|                  pstr_ps_handle->b_prev_zero_iid != b_zero_iid ||
  ------------------
  |  Branch (237:19): [True: 1.63k, False: 15.7k]
  ------------------
  238|  15.7k|                  pstr_ps_handle->b_prev_zero_icc != b_zero_icc;
  ------------------
  |  Branch (238:19): [True: 213, False: 15.4k]
  ------------------
  239|       |
  240|  19.7k|  ixheaace_write_bits(bb, b_send_header, 1);
  241|       |
  242|  19.7k|  if (b_send_header) {
  ------------------
  |  Branch (242:7): [True: 4.21k, False: 15.4k]
  ------------------
  243|  4.21k|    ixheaace_write_bits(bb, !b_zero_iid, 1);
  244|       |
  245|  4.21k|    if (!b_zero_iid) {
  ------------------
  |  Branch (245:9): [True: 1.14k, False: 3.06k]
  ------------------
  246|  1.14k|      ixheaace_write_bits(bb, (pstr_ps_handle->b_hi_freq_res_iid_icc) ? 1 : 0, 3);
  ------------------
  |  Branch (246:31): [True: 780, False: 364]
  ------------------
  247|  1.14k|    }
  248|       |
  249|  4.21k|    ixheaace_write_bits(bb, !b_zero_icc, 1);
  250|       |
  251|  4.21k|    if (!b_zero_icc) {
  ------------------
  |  Branch (251:9): [True: 1.33k, False: 2.87k]
  ------------------
  252|  1.33k|      ixheaace_write_bits(bb, (pstr_ps_handle->b_hi_freq_res_iid_icc) ? 1 : 0, 3);
  ------------------
  |  Branch (252:31): [True: 904, False: 429]
  ------------------
  253|  1.33k|    }
  254|       |
  255|  4.21k|    ixheaace_write_bits(bb, 0, 1);
  256|  4.21k|  }
  257|       |
  258|  19.7k|  ixheaace_write_bits(bb, 0, 1);
  259|       |
  260|  19.7k|  ixheaace_write_bits(bb, 1 - b_keep_params, 2);
  261|       |
  262|  19.7k|  if (!b_keep_params) {
  ------------------
  |  Branch (262:7): [True: 5.82k, False: 13.8k]
  ------------------
  263|  5.82k|    if (!b_zero_iid) {
  ------------------
  |  Branch (263:9): [True: 2.68k, False: 3.14k]
  ------------------
  264|  2.68k|      ixheaace_write_bits(bb, ab_dt_flag_iid, 1);
  265|       |
  266|  47.8k|      for (gr = 0; gr < pstr_ps_handle->iid_icc_bins; gr++) {
  ------------------
  |  Branch (266:20): [True: 45.1k, False: 2.68k]
  ------------------
  267|  45.1k|        ixheaace_write_bits(bb, aa_huff_book_iid_c[aa_delta_iid[gr] + CODE_BCK_LAV_IID],
  ------------------
  |  |   22|  45.1k|#define CODE_BCK_LAV_IID 14
  ------------------
  268|  45.1k|                            aa_huff_book_iid_l[aa_delta_iid[gr] + CODE_BCK_LAV_IID]);
  ------------------
  |  |   22|  45.1k|#define CODE_BCK_LAV_IID 14
  ------------------
  269|  45.1k|      }
  270|  2.68k|    }
  271|  5.82k|  }
  272|       |
  273|  19.7k|  if (!b_keep_params) {
  ------------------
  |  Branch (273:7): [True: 5.82k, False: 13.8k]
  ------------------
  274|  5.82k|    if (!b_zero_icc) {
  ------------------
  |  Branch (274:9): [True: 2.95k, False: 2.87k]
  ------------------
  275|  2.95k|      ixheaace_write_bits(bb, ab_dt_flag_icc, 1);
  276|       |
  277|  52.6k|      for (gr = 0; gr < pstr_ps_handle->iid_icc_bins; gr++) {
  ------------------
  |  Branch (277:20): [True: 49.6k, False: 2.95k]
  ------------------
  278|  49.6k|        ixheaace_write_bits(bb, aa_huff_book_icc_c[aa_delta_icc[gr] + CODE_BCK_LAV_ICC],
  ------------------
  |  |   23|  49.6k|#define CODE_BCK_LAV_ICC 7
  ------------------
  279|  49.6k|                            aa_huff_book_icc_l[aa_delta_icc[gr] + CODE_BCK_LAV_ICC]);
  ------------------
  |  |   23|  49.6k|#define CODE_BCK_LAV_ICC 7
  ------------------
  280|  49.6k|      }
  281|  2.95k|    }
  282|  5.82k|  }
  283|       |
  284|  19.7k|  pstr_ps_handle->b_prev_zero_iid = b_zero_iid;
  285|  19.7k|  pstr_ps_handle->b_prev_zero_icc = b_zero_icc;
  286|       |
  287|  19.7k|  return ia_enhaacplus_enc_get_bits_available(bb);
  288|  19.7k|}
ixheaace_append_ps_bitstream:
  292|  39.4k|                             WORD32 *sbr_hdr_bits) {
  293|  39.4k|  if (!pstr_ps_handle) {
  ------------------
  |  Branch (293:7): [True: 0, False: 39.4k]
  ------------------
  294|      0|    return 0;
  295|      0|  }
  296|  39.4k|  if (!hdl_bs) {
  ------------------
  |  Branch (296:7): [True: 19.7k, False: 19.7k]
  ------------------
  297|  19.7k|    return ia_enhaacplus_enc_get_bits_available(&pstr_ps_handle->ps_bit_buf);
  298|  19.7k|  } else {
  299|  19.7k|    UWORD8 num_bits = (UWORD8)ia_enhaacplus_enc_get_bits_available(&pstr_ps_handle->ps_bit_buf);
  300|       |
  301|  19.7k|    ixheaace_write_bits(hdl_bs, EXTENSION_ID_PS_CODING, SI_SBR_EXTENSION_ID_BITS);
  ------------------
  |  |  172|  19.7k|#define EXTENSION_ID_PS_CODING (2)
  ------------------
                  ixheaace_write_bits(hdl_bs, EXTENSION_ID_PS_CODING, SI_SBR_EXTENSION_ID_BITS);
  ------------------
  |  |  168|  19.7k|#define SI_SBR_EXTENSION_ID_BITS (2)
  ------------------
  302|  19.7k|    iexheaax_append_bitstream(hdl_bs, &pstr_ps_handle->ps_bit_buf, num_bits);
  303|       |
  304|  19.7k|    pstr_ps_handle->bit_buf_read_offset = (WORD32)(pstr_ps_handle->ps_bit_buf.ptr_read_next -
  305|  19.7k|                                                   pstr_ps_handle->ps_bit_buf.ptr_bit_buf_base);
  306|  19.7k|    pstr_ps_handle->bit_buf_write_offset = (WORD32)(pstr_ps_handle->ps_bit_buf.ptr_write_next -
  307|  19.7k|                                                    pstr_ps_handle->ps_bit_buf.ptr_bit_buf_base);
  308|       |
  309|  19.7k|    return ia_enhaacplus_enc_get_bits_available(hdl_bs) - (*sbr_hdr_bits) -
  310|  19.7k|           SI_FILL_EXTENTION_BITS;
  ------------------
  |  |   40|  19.7k|#define SI_FILL_EXTENTION_BITS 4
  ------------------
  311|  19.7k|  }
  312|  39.4k|}
ixheaace_ps_bitenc.c:iexheaax_append_bitstream:
   38|  19.7k|                                        UWORD8 num_bits) {
   39|  19.7k|  WORD32 idx;
   40|  19.7k|  UWORD32 value;
   41|       |
   42|  19.7k|  if (num_bits > 16) {
  ------------------
  |  Branch (42:7): [True: 2.98k, False: 16.7k]
  ------------------
   43|  2.98k|    WORD32 cnt;
   44|  2.98k|    UWORD8 rem;
   45|  2.98k|    cnt = num_bits >> 4;
   46|  2.98k|    rem = num_bits % 16;
   47|       |
   48|  15.2k|    for (idx = 0; idx < cnt; idx++) {
  ------------------
  |  Branch (48:19): [True: 12.2k, False: 2.98k]
  ------------------
   49|  12.2k|      value = ixheaace_readbits(hdl_bitbuf_read, 16);
   50|  12.2k|      ixheaace_write_bits(hdl_bitbuf_write, value, 16);
   51|  12.2k|    }
   52|  2.98k|    if (rem) {
  ------------------
  |  Branch (52:9): [True: 2.78k, False: 204]
  ------------------
   53|  2.78k|      value = ixheaace_readbits(hdl_bitbuf_read, rem);
   54|  2.78k|      ixheaace_write_bits(hdl_bitbuf_write, value, rem);
   55|  2.78k|    }
   56|  16.7k|  } else {
   57|  16.7k|    value = ixheaace_readbits(hdl_bitbuf_read, num_bits);
   58|  16.7k|    ixheaace_write_bits(hdl_bitbuf_write, value, num_bits);
   59|  16.7k|  }
   60|       |
   61|  19.7k|  return num_bits;
   62|  19.7k|}

ixheaace_encode_ps_frame:
  235|  19.7k|                                      ixheaace_comm_tables *common_tab) {
  236|  19.7k|  IA_ERRORCODE err_code;
  237|  19.7k|  WORD32 i;
  238|  19.7k|  WORD32 bin;
  239|  19.7k|  WORD32 subband, max_subband;
  240|       |
  241|  19.7k|  FLOAT32 band_hist_power_left;
  242|  19.7k|  FLOAT32 band_hist_power_right;
  243|  19.7k|  FLOAT32 band_hist_power_corr_real;
  244|  19.7k|  FLOAT32 band_hist_power_corr_imag;
  245|       |
  246|  19.7k|  FLOAT32 band_power_left_env1;
  247|  19.7k|  FLOAT32 band_power_right_env1;
  248|  19.7k|  FLOAT32 band_power_corr_real_env1;
  249|  19.7k|  FLOAT32 band_power_corr_imag_env1;
  250|  19.7k|  FLOAT32 scratch_power_left_right_env2[2 * NUMBER_OF_BINS];
  251|  19.7k|  FLOAT32 scratch_power_corr_real_imag_env2[2 * NUMBER_OF_BINS];
  252|       |
  253|  19.7k|  FLOAT32 **hybrid_left_imag_env1;
  254|  19.7k|  FLOAT32 **hybrid_left_real_env1;
  255|  19.7k|  FLOAT32 **hybrid_right_imag_env1;
  256|  19.7k|  FLOAT32 **hybrid_right_real_env1;
  257|       |
  258|  19.7k|  FLOAT32 **hybrid_left_imag_env2;
  259|  19.7k|  FLOAT32 **hybrid_left_real_env2;
  260|  19.7k|  FLOAT32 **hybr_right_imag_env2;
  261|  19.7k|  FLOAT32 **hybr_right_real_env2;
  262|       |
  263|  19.7k|  FLOAT32 **hist_left_imag;
  264|  19.7k|  FLOAT32 **hist_left_real;
  265|  19.7k|  FLOAT32 **hist_right_imag;
  266|  19.7k|  FLOAT32 **hist_right_real;
  267|       |
  268|  19.7k|  FLOAT32 temp1;
  269|  19.7k|  FLOAT32 temp2;
  270|       |
  271|  19.7k|  FLOAT32 temp_hist_pow_left;
  272|  19.7k|  FLOAT32 temp_hist_pow_right;
  273|  19.7k|  FLOAT32 temp_hist_pow_corr_real;
  274|  19.7k|  FLOAT32 temp_hist_pow_corr_imag;
  275|       |
  276|  19.7k|  FLOAT32 temp_power_left_env1;
  277|  19.7k|  FLOAT32 temp_power_right_env1;
  278|  19.7k|  FLOAT32 temp_power_corr_real_env1;
  279|  19.7k|  FLOAT32 temp_power_corr_imag_env1;
  280|       |
  281|  19.7k|  FLOAT32 temp_power_left_env2;
  282|  19.7k|  FLOAT32 temp_power_right_env2;
  283|  19.7k|  FLOAT32 temp_power_corr_real_env2;
  284|  19.7k|  FLOAT32 temp_power_corr_imag_env2;
  285|       |
  286|  19.7k|  err_code = ixheaace_hybrid_analysis((const FLOAT32 **)(r_buffer_left),
  287|  19.7k|                                      (const FLOAT32 **)(i_buffer_left), pms->m_hybrid_real_left,
  288|  19.7k|                                      pms->m_hybrid_imag_left, pms->ptr_hybrid_left, ps_tables,
  289|  19.7k|                                      common_tab->pstr_common_tab);
  290|  19.7k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  19.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (290:7): [True: 0, False: 19.7k]
  ------------------
  291|      0|    return err_code;
  292|      0|  }
  293|       |
  294|  19.7k|  err_code = ixheaace_hybrid_analysis(
  295|  19.7k|      (const FLOAT32 **)(r_buffer_right), (const FLOAT32 **)(i_buffer_right),
  296|  19.7k|      pms->m_hybrid_real_right, pms->m_hybrid_imag_right, pms->ptr_hybrid_right, ps_tables,
  297|  19.7k|      common_tab->pstr_common_tab);
  298|  19.7k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  19.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (298:7): [True: 0, False: 19.7k]
  ------------------
  299|      0|    return err_code;
  300|      0|  }
  301|       |
  302|  19.7k|  {
  303|  19.7k|    hybrid_left_real_env1 = pms->m_hybrid_real_left;
  304|  19.7k|    hybrid_left_imag_env1 = pms->m_hybrid_imag_left;
  305|  19.7k|    hybrid_right_real_env1 = pms->m_hybrid_real_right;
  306|  19.7k|    hybrid_right_imag_env1 = pms->m_hybrid_imag_right;
  307|       |
  308|  19.7k|    hybrid_left_real_env2 = &(pms->m_hybrid_real_left[NUMBER_OF_SUBSAMPLES / 2]);
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  309|  19.7k|    hybrid_left_imag_env2 = &(pms->m_hybrid_imag_left[NUMBER_OF_SUBSAMPLES / 2]);
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  310|  19.7k|    hybr_right_real_env2 = &(pms->m_hybrid_real_right[NUMBER_OF_SUBSAMPLES / 2]);
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  311|  19.7k|    hybr_right_imag_env2 = &(pms->m_hybrid_imag_right[NUMBER_OF_SUBSAMPLES / 2]);
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  312|       |
  313|   177k|    for (bin = 0; bin < SUBQMF_BINS_ENERGY; bin++) {
  ------------------
  |  |   39|   177k|#define SUBQMF_BINS_ENERGY (8)
  ------------------
  |  Branch (313:19): [True: 157k, False: 19.7k]
  ------------------
  314|   157k|      band_power_left_env1 = 0;
  315|   157k|      band_power_right_env1 = 0;
  316|   157k|      band_power_corr_real_env1 = 0;
  317|   157k|      band_power_corr_imag_env1 = 0;
  318|       |
  319|   157k|      temp_power_left_env2 = 0;
  320|   157k|      temp_power_right_env2 = 0;
  321|   157k|      temp_power_corr_real_env2 = 0;
  322|   157k|      temp_power_corr_imag_env2 = 0;
  323|       |
  324|   157k|      max_subband = ps_tables->hi_res_band_borders[bin] + 1;
  325|   315k|      for (subband = ps_tables->hi_res_band_borders[bin]; subband < max_subband; subband++) {
  ------------------
  |  Branch (325:59): [True: 157k, False: 157k]
  ------------------
  326|   157k|        FLOAT32 t_left_real, t_left_imag, t_right_real, t_right_imag;
  327|       |
  328|  2.68M|        for (i = 0; i < NUMBER_OF_SUBSAMPLES / 2; i++) {
  ------------------
  |  |   35|  2.68M|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  |  Branch (328:21): [True: 2.52M, False: 157k]
  ------------------
  329|       |          // Envelope 1
  330|  2.52M|          t_left_real = hybrid_left_real_env1[i][subband];
  331|  2.52M|          t_right_real = hybrid_right_real_env1[i][subband];
  332|  2.52M|          t_left_imag = hybrid_left_imag_env1[i][subband];
  333|  2.52M|          t_right_imag = hybrid_right_imag_env1[i][subband];
  334|       |
  335|  2.52M|          temp1 = t_left_real * t_left_real;
  336|  2.52M|          temp2 = t_left_imag * t_left_imag;
  337|  2.52M|          band_power_left_env1 += (temp1 + temp2);
  338|       |
  339|  2.52M|          temp1 = t_right_real * t_right_real;
  340|  2.52M|          temp2 = t_right_imag * t_right_imag;
  341|  2.52M|          band_power_right_env1 += (temp1 + temp2);
  342|       |
  343|  2.52M|          temp1 = t_left_real * t_right_real;
  344|  2.52M|          temp2 = t_left_imag * t_right_imag;
  345|  2.52M|          band_power_corr_real_env1 += (temp1 + temp2);
  346|       |
  347|  2.52M|          temp1 = t_left_imag * t_right_real;
  348|  2.52M|          temp2 = t_left_real * t_right_imag;
  349|  2.52M|          band_power_corr_imag_env1 += (temp1 - temp2);
  350|       |
  351|       |          // Envelope 2
  352|  2.52M|          t_left_real = hybrid_left_real_env2[i][subband];
  353|  2.52M|          t_right_real = hybr_right_real_env2[i][subband];
  354|  2.52M|          t_left_imag = hybrid_left_imag_env2[i][subband];
  355|  2.52M|          t_right_imag = hybr_right_imag_env2[i][subband];
  356|       |
  357|  2.52M|          temp1 = t_left_real * t_left_real;
  358|  2.52M|          temp2 = t_left_imag * t_left_imag;
  359|  2.52M|          temp_power_left_env2 += (temp1 + temp2);
  360|       |
  361|  2.52M|          temp1 = t_right_real * t_right_real;
  362|  2.52M|          temp2 = t_right_imag * t_right_imag;
  363|  2.52M|          temp_power_right_env2 += (temp1 + temp2);
  364|       |
  365|  2.52M|          temp1 = t_left_real * t_right_real;
  366|  2.52M|          temp2 = t_left_imag * t_right_imag;
  367|  2.52M|          temp_power_corr_real_env2 += (temp1 + temp2);
  368|       |
  369|  2.52M|          temp1 = t_left_imag * t_right_real;
  370|  2.52M|          temp2 = t_left_real * t_right_imag;
  371|  2.52M|          temp_power_corr_imag_env2 += (temp1 - temp2);
  372|  2.52M|        }
  373|   157k|      }
  374|       |
  375|   157k|      scratch_power_left_right_env2[2 * bin] = temp_power_left_env2;
  376|   157k|      scratch_power_left_right_env2[2 * bin + 1] = temp_power_right_env2;
  377|   157k|      scratch_power_corr_real_imag_env2[2 * bin] = temp_power_corr_real_env2;
  378|   157k|      scratch_power_corr_real_imag_env2[2 * bin + 1] = temp_power_corr_imag_env2;
  379|       |
  380|   157k|      pms->pow_left_right[2 * bin] = pms->pow_left_right[2 * bin] + band_power_left_env1;
  381|   157k|      pms->pow_left_right[2 * bin + 1] = pms->pow_left_right[2 * bin + 1] + band_power_right_env1;
  382|   157k|      pms->pow_corr_real_imag[2 * bin] =
  383|   157k|          pms->pow_corr_real_imag[2 * bin] + band_power_corr_real_env1;
  384|   157k|      pms->pow_corr_real_imag[2 * bin + 1] =
  385|   157k|          pms->pow_corr_real_imag[2 * bin + 1] + band_power_corr_imag_env1;
  386|   157k|    }
  387|       |
  388|  19.7k|    hist_left_real = pms->hist_qmf_left_real;
  389|  19.7k|    hist_left_imag = pms->hist_qmf_left_imag;
  390|  19.7k|    hist_right_real = pms->hist_qmf_right_real;
  391|  19.7k|    hist_right_imag = pms->hist_qmf_right_imag;
  392|       |
  393|  19.7k|    hybrid_left_real_env1 = r_buffer_left;
  394|  19.7k|    hybrid_left_imag_env1 = i_buffer_left;
  395|  19.7k|    hybrid_right_real_env1 = r_buffer_right;
  396|  19.7k|    hybrid_right_imag_env1 = i_buffer_right;
  397|       |
  398|  19.7k|    hybrid_left_real_env2 =
  399|  19.7k|        &r_buffer_left[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                      &r_buffer_left[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   25|  19.7k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  400|  19.7k|    hybrid_left_imag_env2 =
  401|  19.7k|        &i_buffer_left[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                      &i_buffer_left[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   25|  19.7k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  402|  19.7k|    hybr_right_real_env2 =
  403|  19.7k|        &r_buffer_right[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                      &r_buffer_right[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   25|  19.7k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  404|  19.7k|    hybr_right_imag_env2 =
  405|  19.7k|        &i_buffer_right[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   35|  19.7k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                      &i_buffer_right[NUMBER_OF_SUBSAMPLES / 2 - IXHEAACE_HYBRID_FILTER_DELAY];
  ------------------
  |  |   25|  19.7k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  406|       |
  407|   256k|    for (bin = SUBQMF_BINS_ENERGY; bin < NUMBER_OF_BINS; bin++) {
  ------------------
  |  |   39|  19.7k|#define SUBQMF_BINS_ENERGY (8)
  ------------------
                  for (bin = SUBQMF_BINS_ENERGY; bin < NUMBER_OF_BINS; bin++) {
  ------------------
  |  |   22|   256k|#define NUMBER_OF_BINS (20)
  ------------------
  |  Branch (407:36): [True: 236k, False: 19.7k]
  ------------------
  408|   236k|      band_power_left_env1 = 0;
  409|   236k|      band_power_right_env1 = 0;
  410|   236k|      band_power_corr_real_env1 = 0;
  411|   236k|      band_power_corr_imag_env1 = 0;
  412|       |
  413|   236k|      scratch_power_left_right_env2[2 * bin] = 0;
  414|   236k|      scratch_power_left_right_env2[2 * bin + 1] = 0;
  415|   236k|      scratch_power_corr_real_imag_env2[2 * bin] = 0;
  416|   236k|      scratch_power_corr_real_imag_env2[2 * bin + 1] = 0;
  417|       |
  418|   236k|      band_hist_power_left = 0;
  419|   236k|      band_hist_power_right = 0;
  420|   236k|      band_hist_power_corr_real = 0;
  421|   236k|      band_hist_power_corr_imag = 0;
  422|       |
  423|   236k|      for (subband = ps_tables->hi_res_band_borders[bin];
  424|  1.43M|           subband < ps_tables->hi_res_band_borders[bin + 1]; subband++) {
  ------------------
  |  Branch (424:12): [True: 1.20M, False: 236k]
  ------------------
  425|  1.20M|        FLOAT32 t_left_real, t_left_imag, t_right_real, t_right_imag;
  426|  1.20M|        temp_hist_pow_left = 0;
  427|  1.20M|        temp_hist_pow_right = 0;
  428|  1.20M|        temp_hist_pow_corr_real = 0;
  429|  1.20M|        temp_hist_pow_corr_imag = 0;
  430|       |
  431|  1.20M|        temp_power_left_env1 = 0;
  432|  1.20M|        temp_power_right_env1 = 0;
  433|  1.20M|        temp_power_corr_real_env1 = 0;
  434|  1.20M|        temp_power_corr_imag_env1 = 0;
  435|       |
  436|  1.20M|        temp_power_left_env2 = 0;
  437|  1.20M|        temp_power_right_env2 = 0;
  438|  1.20M|        temp_power_corr_real_env2 = 0;
  439|  1.20M|        temp_power_corr_imag_env2 = 0;
  440|       |
  441|  8.41M|        for (i = 0; i < 6; i++) {
  ------------------
  |  Branch (441:21): [True: 7.21M, False: 1.20M]
  ------------------
  442|  7.21M|          t_left_real = hist_left_real[i][subband];
  443|  7.21M|          t_left_imag = hist_left_imag[i][subband];
  444|  7.21M|          t_right_real = hist_right_real[i][subband];
  445|  7.21M|          t_right_imag = hist_right_imag[i][subband];
  446|       |
  447|  7.21M|          temp1 = t_left_real * t_left_real;
  448|  7.21M|          temp2 = t_left_imag * t_left_imag;
  449|  7.21M|          temp_hist_pow_left += (temp1 + temp2);
  450|       |
  451|  7.21M|          temp1 = t_right_real * t_right_real;
  452|  7.21M|          temp2 = t_right_imag * t_right_imag;
  453|  7.21M|          temp_hist_pow_right += (temp1 + temp2);
  454|       |
  455|  7.21M|          temp1 = t_left_real * t_right_real;
  456|  7.21M|          temp2 = t_left_imag * t_right_imag;
  457|  7.21M|          temp_hist_pow_corr_real += (temp1 + temp2);
  458|       |
  459|  7.21M|          temp1 = t_left_imag * t_right_real;
  460|  7.21M|          temp2 = t_left_real * t_right_imag;
  461|  7.21M|          temp_hist_pow_corr_imag += (temp1 - temp2);
  462|       |
  463|  7.21M|          t_left_real = hybrid_left_real_env1[i][subband];
  464|  7.21M|          t_left_imag = hybrid_left_imag_env1[i][subband];
  465|  7.21M|          t_right_real = hybrid_right_real_env1[i][subband];
  466|  7.21M|          t_right_imag = hybrid_right_imag_env1[i][subband];
  467|       |
  468|  7.21M|          temp1 = t_left_real * t_left_real;
  469|  7.21M|          temp2 = t_left_imag * t_left_imag;
  470|  7.21M|          temp_power_left_env1 += (temp1 + temp2);
  471|       |
  472|  7.21M|          temp1 = t_right_real * t_right_real;
  473|  7.21M|          temp2 = t_right_imag * t_right_imag;
  474|  7.21M|          temp_power_right_env1 += (temp1 + temp2);
  475|       |
  476|  7.21M|          temp1 = t_left_real * t_right_real;
  477|  7.21M|          temp2 = t_left_imag * t_right_imag;
  478|  7.21M|          temp_power_corr_real_env1 += (temp1 + temp2);
  479|       |
  480|  7.21M|          temp1 = t_left_imag * t_right_real;
  481|  7.21M|          temp2 = t_left_real * t_right_imag;
  482|  7.21M|          temp_power_corr_imag_env1 += (temp1 - temp2);
  483|       |
  484|  7.21M|          t_left_real = hybrid_left_real_env2[i][subband];
  485|  7.21M|          t_left_imag = hybrid_left_imag_env2[i][subband];
  486|  7.21M|          t_right_real = hybr_right_real_env2[i][subband];
  487|  7.21M|          t_right_imag = hybr_right_imag_env2[i][subband];
  488|       |
  489|  7.21M|          temp1 = t_left_real * t_left_real;
  490|  7.21M|          temp2 = t_left_imag * t_left_imag;
  491|  7.21M|          temp_power_left_env2 += (temp1 + temp2);
  492|       |
  493|  7.21M|          temp1 = t_right_real * t_right_real;
  494|  7.21M|          temp2 = t_right_imag * t_right_imag;
  495|  7.21M|          temp_power_right_env2 += (temp1 + temp2);
  496|       |
  497|  7.21M|          temp1 = t_left_real * t_right_real;
  498|  7.21M|          temp2 = t_left_imag * t_right_imag;
  499|  7.21M|          temp_power_corr_real_env2 += (temp1 + temp2);
  500|       |
  501|  7.21M|          temp1 = t_left_imag * t_right_real;
  502|  7.21M|          temp2 = t_left_real * t_right_imag;
  503|  7.21M|          temp_power_corr_imag_env2 += (temp1 - temp2);
  504|  7.21M|        }
  505|       |
  506|  6.01M|        for (i = 6; i < 10; i++) {
  ------------------
  |  Branch (506:21): [True: 4.80M, False: 1.20M]
  ------------------
  507|  4.80M|          t_left_real = hybrid_left_real_env1[i][subband];
  508|  4.80M|          t_left_imag = hybrid_left_imag_env1[i][subband];
  509|  4.80M|          t_right_real = hybrid_right_real_env1[i][subband];
  510|  4.80M|          t_right_imag = hybrid_right_imag_env1[i][subband];
  511|       |
  512|  4.80M|          temp1 = t_left_real * t_left_real;
  513|  4.80M|          temp2 = t_left_imag * t_left_imag;
  514|  4.80M|          temp_power_left_env1 += (temp1 + temp2);
  515|       |
  516|  4.80M|          temp1 = t_right_real * t_right_real;
  517|  4.80M|          temp2 = t_right_imag * t_right_imag;
  518|  4.80M|          temp_power_right_env1 += (temp1 + temp2);
  519|       |
  520|  4.80M|          temp1 = t_left_real * t_right_real;
  521|  4.80M|          temp2 = t_left_imag * t_right_imag;
  522|  4.80M|          temp_power_corr_real_env1 += (temp1 + temp2);
  523|       |
  524|  4.80M|          temp1 = t_left_imag * t_right_real;
  525|  4.80M|          temp2 = t_left_real * t_right_imag;
  526|  4.80M|          temp_power_corr_imag_env1 += (temp1 - temp2);
  527|       |
  528|  4.80M|          t_left_real = hybrid_left_real_env2[i][subband];
  529|  4.80M|          t_left_imag = hybrid_left_imag_env2[i][subband];
  530|  4.80M|          t_right_real = hybr_right_real_env2[i][subband];
  531|  4.80M|          t_right_imag = hybr_right_imag_env2[i][subband];
  532|       |
  533|  4.80M|          temp1 = t_left_real * t_left_real;
  534|  4.80M|          temp2 = t_left_imag * t_left_imag;
  535|  4.80M|          temp_power_left_env2 += (temp1 + temp2);
  536|       |
  537|  4.80M|          temp1 = t_right_real * t_right_real;
  538|  4.80M|          temp2 = t_right_imag * t_right_imag;
  539|  4.80M|          temp_power_right_env2 += (temp1 + temp2);
  540|       |
  541|  4.80M|          temp1 = t_left_real * t_right_real;
  542|  4.80M|          temp2 = t_left_imag * t_right_imag;
  543|  4.80M|          temp_power_corr_real_env2 += (temp1 + temp2);
  544|       |
  545|  4.80M|          temp1 = t_left_imag * t_right_real;
  546|  4.80M|          temp2 = t_left_real * t_right_imag;
  547|  4.80M|          temp_power_corr_imag_env2 += (temp1 - temp2);
  548|  4.80M|        }
  549|       |
  550|  8.41M|        for (i = 10; i < 16; i++) {
  ------------------
  |  Branch (550:22): [True: 7.21M, False: 1.20M]
  ------------------
  551|  7.21M|          t_left_real = hybrid_left_real_env2[i][subband];
  552|  7.21M|          t_left_imag = hybrid_left_imag_env2[i][subband];
  553|  7.21M|          t_right_real = hybr_right_real_env2[i][subband];
  554|  7.21M|          t_right_imag = hybr_right_imag_env2[i][subband];
  555|       |
  556|  7.21M|          temp1 = t_left_real * t_left_real;
  557|  7.21M|          temp2 = t_left_imag * t_left_imag;
  558|  7.21M|          temp_power_left_env2 += (temp1 + temp2);
  559|       |
  560|  7.21M|          temp1 = t_right_real * t_right_real;
  561|  7.21M|          temp2 = t_right_imag * t_right_imag;
  562|  7.21M|          temp_power_right_env2 += (temp1 + temp2);
  563|       |
  564|  7.21M|          temp1 = t_left_real * t_right_real;
  565|  7.21M|          temp2 = t_left_imag * t_right_imag;
  566|  7.21M|          temp_power_corr_real_env2 += (temp1 + temp2);
  567|       |
  568|  7.21M|          temp1 = t_left_imag * t_right_real;
  569|  7.21M|          temp2 = t_left_real * t_right_imag;
  570|  7.21M|          temp_power_corr_imag_env2 += (temp1 - temp2);
  571|  7.21M|        }
  572|       |
  573|  1.20M|        scratch_power_left_right_env2[2 * bin] =
  574|  1.20M|            scratch_power_left_right_env2[2 * bin] + temp_power_left_env2;
  575|  1.20M|        scratch_power_left_right_env2[2 * bin + 1] =
  576|  1.20M|            scratch_power_left_right_env2[2 * bin + 1] + temp_power_right_env2;
  577|  1.20M|        scratch_power_corr_real_imag_env2[2 * bin] =
  578|  1.20M|            scratch_power_corr_real_imag_env2[2 * bin] + temp_power_corr_real_env2;
  579|  1.20M|        scratch_power_corr_real_imag_env2[2 * bin + 1] =
  580|  1.20M|            scratch_power_corr_real_imag_env2[2 * bin + 1] + temp_power_corr_imag_env2;
  581|       |
  582|  1.20M|        band_power_left_env1 = band_power_left_env1 + temp_power_left_env1;
  583|  1.20M|        band_power_right_env1 = band_power_right_env1 + temp_power_right_env1;
  584|  1.20M|        band_power_corr_real_env1 = band_power_corr_real_env1 + temp_power_corr_real_env1;
  585|  1.20M|        band_power_corr_imag_env1 = band_power_corr_imag_env1 + temp_power_corr_imag_env1;
  586|       |
  587|  1.20M|        band_hist_power_left = band_hist_power_left + temp_hist_pow_left;
  588|  1.20M|        band_hist_power_right = band_hist_power_right + temp_hist_pow_right;
  589|  1.20M|        band_hist_power_corr_real = band_hist_power_corr_real + temp_hist_pow_corr_real;
  590|  1.20M|        band_hist_power_corr_imag = band_hist_power_corr_imag + temp_hist_pow_corr_imag;
  591|  1.20M|      }
  592|       |
  593|   236k|      pms->pow_left_right[2 * bin] += (band_power_left_env1 + band_hist_power_left);
  594|   236k|      pms->pow_left_right[2 * bin + 1] += (band_power_right_env1 + band_hist_power_right);
  595|   236k|      pms->pow_corr_real_imag[2 * bin] += (band_power_corr_real_env1 + band_hist_power_corr_real);
  596|   236k|      pms->pow_corr_real_imag[2 * bin + 1] +=
  597|   236k|          (band_power_corr_imag_env1 + band_hist_power_corr_imag);
  598|   236k|    }
  599|  19.7k|  }
  600|       |
  601|  19.7k|  {
  602|  19.7k|    FLOAT32 temp_left;
  603|  19.7k|    FLOAT32 temp_right;
  604|  19.7k|    FLOAT32 temp_corr_re;
  605|  19.7k|    FLOAT32 temp_corr_im;
  606|       |
  607|   359k|    for (bin = 0; bin < pms->iid_icc_bins; bin++) {
  ------------------
  |  Branch (607:19): [True: 340k, False: 19.7k]
  ------------------
  608|   340k|      if (pms->b_hi_freq_res_iid_icc) {
  ------------------
  |  Branch (608:11): [True: 286k, False: 54.0k]
  ------------------
  609|   286k|        temp_left = pms->pow_left_right[2 * bin];
  610|   286k|        temp_right = pms->pow_left_right[2 * bin + 1];
  611|   286k|        temp_corr_re = pms->pow_corr_real_imag[2 * bin];
  612|   286k|        temp_corr_im = pms->pow_corr_real_imag[2 * bin + 1];
  613|   286k|      } else {
  614|  54.0k|        temp_left = pms->pow_left_right[2 * 2 * bin] + pms->pow_left_right[2 * 2 * bin + 2];
  615|  54.0k|        temp_right =
  616|  54.0k|            pms->pow_left_right[2 * 2 * bin + 1] + pms->pow_left_right[2 * (2 * bin + 1) + 1];
  617|  54.0k|        temp_corr_re =
  618|  54.0k|            pms->pow_corr_real_imag[2 * 2 * bin] + pms->pow_corr_real_imag[2 * 2 * bin + 2];
  619|  54.0k|        temp_corr_im = pms->pow_corr_real_imag[2 * 2 * bin + 1] +
  620|  54.0k|                       pms->pow_corr_real_imag[2 * (2 * bin + 1) + 1];
  621|  54.0k|      }
  622|       |
  623|   340k|      if (temp_left == 0) {
  ------------------
  |  Branch (623:11): [True: 82.2k, False: 257k]
  ------------------
  624|  82.2k|        temp_left = 0.0625f;
  625|  82.2k|      }
  626|   340k|      if (temp_right == 0) {
  ------------------
  |  Branch (626:11): [True: 82.2k, False: 257k]
  ------------------
  627|  82.2k|        temp_right = 0.0625f;
  628|  82.2k|      }
  629|   340k|      if (temp_corr_re == 0) {
  ------------------
  |  Branch (629:11): [True: 82.3k, False: 257k]
  ------------------
  630|  82.3k|        temp_corr_re = 0.0625f;
  631|  82.3k|      }
  632|   340k|      if (temp_corr_im == 0) {
  ------------------
  |  Branch (632:11): [True: 290k, False: 49.8k]
  ------------------
  633|   290k|        temp_corr_im = 0.0625f;
  634|   290k|      }
  635|       |
  636|   340k|      pms->aaa_ICC_data_buf[bin][1] = pms->aaa_ICC_data_buf[bin][0];
  637|   340k|      if (bin > NUMBER_OF_IPD_BINS) {
  ------------------
  |  |   27|   340k|#define NUMBER_OF_IPD_BINS (11)
  ------------------
  |  Branch (637:11): [True: 114k, False: 225k]
  ------------------
  638|   114k|        temp1 = temp_corr_re * temp_corr_re;
  639|   114k|        temp2 = temp_corr_im * temp_corr_im;
  640|   114k|        temp_corr_re = temp1 + temp2;
  641|       |
  642|   114k|        temp1 = temp_left * temp_right;
  643|   114k|        pms->aaa_ICC_data_buf[bin][0] = (FLOAT32)sqrt(temp_corr_re / temp1);
  644|   225k|      } else {
  645|   225k|        temp1 = temp_left * temp_right;
  646|   225k|        pms->aaa_ICC_data_buf[bin][0] = temp_corr_re / (FLOAT32)sqrt(temp1);
  647|   225k|      }
  648|   340k|      if (pms->aaa_ICC_data_buf[bin][0] > 1.0f) {
  ------------------
  |  Branch (648:11): [True: 30.0k, False: 310k]
  ------------------
  649|  30.0k|        pms->aaa_ICC_data_buf[bin][0] = 0;
  650|   310k|      } else {
  651|   310k|        pms->aaa_ICC_data_buf[bin][0] =
  652|   310k|            (FLOAT32)sqrt(0.5f - (pms->aaa_ICC_data_buf[bin][0] / 2.0f));
  653|   310k|      }
  654|   340k|      temp1 = temp_left / temp_right;
  655|   340k|      temp1 = (FLOAT32)sqrt(temp1);
  656|   340k|      pms->aaa_IID_data_buf[bin][1] = pms->aaa_IID_data_buf[bin][0];
  657|   340k|      pms->aaa_IID_data_buf[bin][0] = SBR_INV_LOG_2 * (FLOAT32)log(temp1);
  ------------------
  |  |   38|   340k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  658|   340k|    }
  659|  19.7k|  }
  660|  19.7k|  {
  661|  19.7k|    FLOAT32 *pow_left = &pms->pow_left_right[0];
  662|  19.7k|    FLOAT32 *corr_real = &pms->pow_corr_real_imag[0];
  663|       |
  664|  19.7k|    memcpy(pow_left, scratch_power_left_right_env2, 2 * NUMBER_OF_BINS * sizeof(FLOAT32));
  ------------------
  |  |   22|  19.7k|#define NUMBER_OF_BINS (20)
  ------------------
  665|  19.7k|    memcpy(corr_real, scratch_power_corr_real_imag_env2, 2 * NUMBER_OF_BINS * sizeof(FLOAT32));
  ------------------
  |  |   22|  19.7k|#define NUMBER_OF_BINS (20)
  ------------------
  666|  19.7k|  }
  667|       |
  668|  19.7k|  ia_enhaacplus_enc_downmix_to_mono(pms, r_buffer_left, i_buffer_left, r_buffer_right,
  669|  19.7k|                                    i_buffer_right, ps_tables);
  670|  19.7k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  19.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  671|  19.7k|}
ixheaace_ps_enc.c:ia_enhaacplus_enc_downmix_to_mono:
   43|  19.7k|                                              ixheaace_str_ps_tab *ps_tables) {
   44|  19.7k|  WORD32 i;
   45|  19.7k|  WORD32 group;
   46|  19.7k|  WORD32 subband;
   47|  19.7k|  WORD32 max_subband;
   48|  19.7k|  WORD32 subband_grp;
   49|       |
   50|  19.7k|  FLOAT32 temp_left_real;
   51|  19.7k|  FLOAT32 temp_left_imag;
   52|  19.7k|  FLOAT32 temp_right_real;
   53|  19.7k|  FLOAT32 temp_right_imag;
   54|  19.7k|  FLOAT32 temp, temp2;
   55|       |
   56|   137k|  for (i = 0; i < IXHEAACE_HYBRID_FILTER_DELAY; i++) {
  ------------------
  |  |   25|   137k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  |  Branch (56:15): [True: 118k, False: 19.7k]
  ------------------
   57|   118k|    ixheaace_memcpy(pms->temp_qmf_left_real[i],
   58|   118k|                    qmf_left_real[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   35|   118k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                                  qmf_left_real[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   25|   118k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
   59|   118k|                    NUMBER_OF_QMF_BANDS * sizeof(**qmf_left_real));
  ------------------
  |  |   36|   118k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
   60|   118k|    ixheaace_memcpy(pms->temp_qmf_left_imag[i],
   61|   118k|                    qmf_left_imag[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   35|   118k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                                  qmf_left_imag[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   25|   118k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
   62|   118k|                    NUMBER_OF_QMF_BANDS * sizeof(**qmf_left_imag));
  ------------------
  |  |   36|   118k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
   63|   118k|  }
   64|       |
   65|  19.7k|  {
   66|  19.7k|    FLOAT32 *hybrid_left_real_init, *hybrid_right_real_init;
   67|  19.7k|    hybrid_left_real_init = pms->m_hybrid_real_left[0];
   68|  19.7k|    hybrid_right_real_init = pms->m_hybrid_real_right[0];
   69|       |
   70|   335k|    for (group = 0; group < SUBQMF_GROUPS_MIX; group++) {
  ------------------
  |  |   40|   335k|#define SUBQMF_GROUPS_MIX (16)
  ------------------
  |  Branch (70:21): [True: 315k, False: 19.7k]
  ------------------
   71|   315k|      FLOAT32 *hybrid_left_real, *hybrid_right_real;
   72|       |
   73|   315k|      subband = ps_tables->grp_borders_mix[group];
   74|   315k|      hybrid_left_real = hybrid_left_real_init + subband;
   75|   315k|      hybrid_right_real = hybrid_right_real_init + subband;
   76|       |
   77|  10.4M|      for (i = NUMBER_OF_SUBSAMPLES; i != 0; i--) {
  ------------------
  |  |   35|   315k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  |  Branch (77:38): [True: 10.0M, False: 315k]
  ------------------
   78|  10.0M|        FLOAT32 temp_left_real_1, temp_left_imag_1;
   79|       |
   80|  10.0M|        temp_left_real = hybrid_left_real[0];
   81|  10.0M|        hybrid_left_real += 32;
   82|  10.0M|        temp_left_imag = hybrid_left_real[-16];
   83|  10.0M|        temp_right_real = hybrid_right_real[0];
   84|  10.0M|        hybrid_right_real += 32;
   85|  10.0M|        temp_right_imag = hybrid_right_real[-16];
   86|       |
   87|  10.0M|        temp_left_real_1 = temp_right_real + temp_left_real;
   88|  10.0M|        temp_left_imag_1 = temp_right_imag + temp_left_imag;
   89|       |
   90|  10.0M|        temp2 = temp_left_real_1 * temp_left_real_1;
   91|  10.0M|        temp2 += temp_left_imag_1 * temp_left_imag_1;
   92|  10.0M|        temp2 /= 2.0f;
   93|       |
   94|  10.0M|        temp = temp_left_real * temp_right_real;
   95|  10.0M|        temp += temp_left_imag * temp_right_imag;
   96|       |
   97|  10.0M|        temp = temp2 - temp;
   98|       |
   99|  10.0M|        if ((temp / 8.0f) >= temp2) {
  ------------------
  |  Branch (99:13): [True: 2.72M, False: 7.36M]
  ------------------
  100|  2.72M|          temp_left_real = temp_left_real_1 * 2.0f;
  101|  2.72M|          temp_left_imag = temp_left_imag_1 * 2.0f;
  102|  7.36M|        } else {
  103|  7.36M|          temp = (FLOAT32)sqrt(temp / (temp2 * 2.0f));
  104|  7.36M|          temp_left_real = temp_left_real_1 * temp;
  105|  7.36M|          temp_left_imag = temp_left_imag_1 * temp;
  106|  7.36M|        }
  107|       |
  108|  10.0M|        hybrid_left_real[-32] = temp_left_real;
  109|  10.0M|        hybrid_left_real[-16] = temp_left_imag;
  110|  10.0M|      }
  111|   315k|    }
  112|  19.7k|  }
  113|       |
  114|   256k|  for (; group < NUMBER_OF_IPD_GROUPS; group++) {
  ------------------
  |  |   32|   256k|#define NUMBER_OF_IPD_GROUPS (NUMBER_OF_IPD_BINS_EST + 6 + 2)
  |  |  ------------------
  |  |  |  |   28|   256k|#define NUMBER_OF_IPD_BINS_EST (NUMBER_OF_BINS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   256k|#define NUMBER_OF_BINS (20)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (114:10): [True: 236k, False: 19.7k]
  ------------------
  115|   236k|    FLOAT32 *hybrid_left_real;
  116|   236k|    FLOAT32 *qmf_lre = qmf_left_real[NUMBER_OF_SUBSAMPLES - 1];
  ------------------
  |  |   35|   236k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  117|       |
  118|   236k|    subband_grp = ps_tables->grp_borders_mix[group];
  119|   236k|    max_subband = ps_tables->grp_borders_mix[group + 1];
  120|       |
  121|   236k|    hybrid_left_real =
  122|   236k|        (qmf_left_real - IXHEAACE_HYBRID_FILTER_DELAY)[NUMBER_OF_SUBSAMPLES - 1] + 0X1000;
  ------------------
  |  |   25|   236k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
                      (qmf_left_real - IXHEAACE_HYBRID_FILTER_DELAY)[NUMBER_OF_SUBSAMPLES - 1] + 0X1000;
  ------------------
  |  |   35|   236k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  123|   236k|    hybrid_left_real += subband_grp;
  124|   236k|    qmf_lre += subband_grp;
  125|       |
  126|  6.38M|    for (i = NUMBER_OF_SUBSAMPLES - 1; i >= IXHEAACE_HYBRID_FILTER_DELAY; i--) {
  ------------------
  |  |   35|   236k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                  for (i = NUMBER_OF_SUBSAMPLES - 1; i >= IXHEAACE_HYBRID_FILTER_DELAY; i--) {
  ------------------
  |  |   25|  6.38M|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  |  Branch (126:40): [True: 6.14M, False: 236k]
  ------------------
  127|  37.4M|      for (subband = max_subband - subband_grp; subband != 0; subband--) {
  ------------------
  |  Branch (127:49): [True: 31.2M, False: 6.14M]
  ------------------
  128|  31.2M|        FLOAT32 temp_left_real_1, temp_left_imag_1;
  129|       |
  130|  31.2M|        temp_left_real = hybrid_left_real[-0X1000];
  131|  31.2M|        temp_left_imag = hybrid_left_real[0];
  132|  31.2M|        temp_right_real = hybrid_left_real[-0X800];
  133|  31.2M|        temp_right_imag = hybrid_left_real[0X800];
  134|       |
  135|  31.2M|        hybrid_left_real += 1;
  136|       |
  137|  31.2M|        temp_left_real_1 = temp_right_real + temp_left_real;
  138|  31.2M|        temp_left_imag_1 = temp_right_imag + temp_left_imag;
  139|       |
  140|  31.2M|        temp2 = temp_left_real_1 * temp_left_real_1;
  141|  31.2M|        temp2 += temp_left_imag_1 * temp_left_imag_1;
  142|  31.2M|        temp2 /= 2.0f;
  143|       |
  144|  31.2M|        temp = temp_left_real * temp_right_real;
  145|  31.2M|        temp += temp_left_imag * temp_right_imag;
  146|       |
  147|  31.2M|        temp = temp2 - temp;
  148|       |
  149|  31.2M|        if ((temp / 8.0f) >= temp2) {
  ------------------
  |  Branch (149:13): [True: 8.98M, False: 22.2M]
  ------------------
  150|  8.98M|          temp_left_real = temp_left_real_1 * 2.0f;
  151|  8.98M|          temp_left_imag = temp_left_imag_1 * 2.0f;
  152|  22.2M|        } else {
  153|  22.2M|          temp = (FLOAT32)sqrt(temp / (2.0f * temp2));
  154|  22.2M|          temp_left_real = temp_left_real_1 * temp;
  155|  22.2M|          temp_left_imag = temp_left_imag_1 * temp;
  156|  22.2M|        }
  157|       |
  158|  31.2M|        qmf_lre[0] = temp_left_real;
  159|  31.2M|        qmf_lre[0 + 0x1000] = temp_left_imag;
  160|  31.2M|        qmf_lre += 1;
  161|  31.2M|      }
  162|       |
  163|  6.14M|      hybrid_left_real -= max_subband - subband_grp;
  164|  6.14M|      qmf_lre -= max_subband - subband_grp;
  165|  6.14M|      qmf_lre -= 64;
  166|  6.14M|      hybrid_left_real -= 64;
  167|  6.14M|    }
  168|       |
  169|   236k|    hybrid_left_real = pms->hist_qmf_left_real[IXHEAACE_HYBRID_FILTER_DELAY - 1];
  ------------------
  |  |   25|   236k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  170|   236k|    hybrid_left_real += subband_grp;
  171|       |
  172|  1.65M|    for (i = IXHEAACE_HYBRID_FILTER_DELAY - 1; i >= 0; i--) {
  ------------------
  |  |   25|   236k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  |  Branch (172:48): [True: 1.41M, False: 236k]
  ------------------
  173|  8.63M|      for (subband = max_subband - subband_grp; subband != 0; subband--) {
  ------------------
  |  Branch (173:49): [True: 7.21M, False: 1.41M]
  ------------------
  174|  7.21M|        FLOAT32 temp_left_real_1, temp_left_imag_1;
  175|       |
  176|  7.21M|        temp_left_real = hybrid_left_real[0];
  177|  7.21M|        temp_left_imag = hybrid_left_real[0 + 0x40];
  178|  7.21M|        temp_right_real = hybrid_left_real[0 + 0x80];
  179|  7.21M|        temp_right_imag = hybrid_left_real[0 + 0xc0];
  180|       |
  181|  7.21M|        temp_left_real_1 = temp_right_real + temp_left_real;
  182|  7.21M|        temp_left_imag_1 = temp_right_imag + temp_left_imag;
  183|       |
  184|  7.21M|        temp2 = temp_left_real_1 * temp_left_real_1;
  185|  7.21M|        temp2 += temp_left_imag_1 * temp_left_imag_1;
  186|  7.21M|        temp2 /= 2.0f;
  187|       |
  188|  7.21M|        temp = temp_left_real * temp_right_real;
  189|  7.21M|        temp += temp_left_imag * temp_right_imag;
  190|       |
  191|  7.21M|        temp = temp2 - temp;
  192|       |
  193|  7.21M|        if ((temp / 8.0f) >= temp2) {
  ------------------
  |  Branch (193:13): [True: 3.07M, False: 4.13M]
  ------------------
  194|  3.07M|          temp_left_real = temp_left_real_1 * 2.0f;
  195|  3.07M|          temp_left_imag = temp_left_imag_1 * 2.0f;
  196|  4.13M|        } else {
  197|  4.13M|          temp = (FLOAT32)sqrt(temp / (2.0f * temp2));
  198|  4.13M|          temp_left_real = temp_left_real_1 * temp;
  199|  4.13M|          temp_left_imag = temp_left_imag_1 * temp;
  200|  4.13M|        }
  201|       |
  202|  7.21M|        qmf_lre[0] = temp_left_real;
  203|  7.21M|        qmf_lre[0x1000] = temp_left_imag;
  204|  7.21M|        qmf_lre += 1;
  205|  7.21M|        hybrid_left_real += 1;
  206|  7.21M|      }
  207|  1.41M|      qmf_lre -= max_subband - subband_grp;
  208|  1.41M|      hybrid_left_real -= max_subband - subband_grp;
  209|  1.41M|      qmf_lre -= 64;
  210|  1.41M|      hybrid_left_real -= 0x100;
  211|  1.41M|    }
  212|   236k|  }
  213|       |
  214|   137k|  for (i = 0; i < IXHEAACE_HYBRID_FILTER_DELAY; i++) {
  ------------------
  |  |   25|   137k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  |  Branch (214:15): [True: 118k, False: 19.7k]
  ------------------
  215|   118k|    ixheaace_memcpy(pms->hist_qmf_left_real[i], pms->temp_qmf_left_real[i],
  216|   118k|                    NUMBER_OF_QMF_BANDS * sizeof(**qmf_left_real));
  ------------------
  |  |   36|   118k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  217|   118k|    ixheaace_memcpy(pms->hist_qmf_left_imag[i], pms->temp_qmf_left_imag[i],
  218|   118k|                    NUMBER_OF_QMF_BANDS * sizeof(**qmf_left_imag));
  ------------------
  |  |   36|   118k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  219|   118k|    ixheaace_memcpy(pms->hist_qmf_right_real[i],
  220|   118k|                    qmf_right_real[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   35|   118k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                                  qmf_right_real[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   25|   118k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  221|   118k|                    NUMBER_OF_QMF_BANDS * sizeof(**qmf_right_real));
  ------------------
  |  |   36|   118k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  222|   118k|    ixheaace_memcpy(pms->hist_qmf_right_imag[i],
  223|   118k|                    qmf_right_imag[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   35|   118k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
                                  qmf_right_imag[NUMBER_OF_SUBSAMPLES - IXHEAACE_HYBRID_FILTER_DELAY + i],
  ------------------
  |  |   25|   118k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  224|   118k|                    NUMBER_OF_QMF_BANDS * sizeof(**qmf_right_imag));
  ------------------
  |  |   36|   118k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  225|   118k|  }
  226|       |
  227|  19.7k|  ixheaace_hybrid_synthesis((const FLOAT32 **)pms->m_hybrid_real_left,
  228|  19.7k|                            (const FLOAT32 **)pms->m_hybrid_imag_left, qmf_left_real,
  229|  19.7k|                            qmf_left_imag, ps_tables->a_hyb_res);
  230|  19.7k|}
ixheaace_ps_enc.c:ixheaace_memcpy:
   36|   709k|static VOID ixheaace_memcpy(void *dest, const void *src, WORD32 count) {
   37|   709k|  memcpy(dest, src, count);
   38|   709k|}

ixheaace_get_ps_mode:
   36|    246|WORD32 ixheaace_get_ps_mode(WORD32 bitrate) {
   37|    246|  WORD32 ps_mode = 0;
   38|       |
   39|    246|  if (bitrate < 21000) {
  ------------------
  |  Branch (39:7): [True: 87, False: 159]
  ------------------
   40|     87|    ps_mode = PS_MODE_LOW_FREQ_RES_IID_ICC;
  ------------------
  |  |   38|     87|#define PS_MODE_LOW_FREQ_RES_IID_ICC (0x00020000)
  ------------------
   41|     87|  }
   42|       |
   43|    246|  return ps_mode;
   44|    246|}
ixheaace_create_ps_enc:
   49|    246|                       FLOAT32 *ptr_ps_buf3) {
   50|    246|  WORD32 i;
   51|    246|  IA_ERRORCODE err = IA_NO_ERROR;
  ------------------
  |  |   23|    246|#define IA_NO_ERROR 0x00000000
  ------------------
   52|       |
   53|    246|  FLOAT32 *ptr1, *ptr2, *ptr3, *ptr4;
   54|       |
   55|    246|  if (pstr_ps_enc == NULL) {
  ------------------
  |  Branch (55:7): [True: 0, False: 246]
  ------------------
   56|      0|    return IA_EXHEAACE_INIT_FATAL_PS_INIT_FAILED;
   57|      0|  }
   58|    246|  ptr1 = &ptr_common_buffer2[IXHEAACE_QMF_TIME_SLOTS * IXHEAACE_QMF_CHANNELS];
  ------------------
  |  |   69|    246|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
                ptr1 = &ptr_common_buffer2[IXHEAACE_QMF_TIME_SLOTS * IXHEAACE_QMF_CHANNELS];
  ------------------
  |  |   66|    246|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   59|    246|  ptr2 = pstr_ps_enc->ps_buf2;
   60|    246|  ptr3 = ptr_ps_buf3;
   61|    246|  ptr4 = &ptr_common_buffer[5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS];
  ------------------
  |  |   71|    246|#define NO_OF_ESTIMATES (4)
  ------------------
                ptr4 = &ptr_common_buffer[5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS];
  ------------------
  |  |   83|    246|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|    246|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
   62|       |
   63|    246|  pstr_ps_enc->ps_mode = ps_mode;
   64|    246|  pstr_ps_enc->b_prev_zero_iid = 0;
   65|    246|  pstr_ps_enc->b_prev_zero_icc = 0;
   66|    246|  pstr_ps_enc->b_hi_freq_res_iid_icc = ((ps_mode & PS_MODE_LOW_FREQ_RES_IID_ICC) != 0) ? 0 : 1;
  ------------------
  |  |   38|    246|#define PS_MODE_LOW_FREQ_RES_IID_ICC (0x00020000)
  ------------------
  |  Branch (66:40): [True: 87, False: 159]
  ------------------
   67|    246|  pstr_ps_enc->iid_icc_bins =
   68|    246|      (pstr_ps_enc->b_hi_freq_res_iid_icc) ? NUMBER_OF_IID_BINS : NUMBER_OF_LOW_RES_IID_BINS;
  ------------------
  |  |   25|    159|#define NUMBER_OF_IID_BINS (NUMBER_OF_BINS)
  |  |  ------------------
  |  |  |  |   22|    159|#define NUMBER_OF_BINS (20)
  |  |  ------------------
  ------------------
                    (pstr_ps_enc->b_hi_freq_res_iid_icc) ? NUMBER_OF_IID_BINS : NUMBER_OF_LOW_RES_IID_BINS;
  ------------------
  |  |   30|    333|#define NUMBER_OF_LOW_RES_IID_BINS (NUMBER_OF_LOW_RES_BINS)
  |  |  ------------------
  |  |  |  |   23|     87|#define NUMBER_OF_LOW_RES_BINS (NUMBER_OF_IID_BINS / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   25|     87|#define NUMBER_OF_IID_BINS (NUMBER_OF_BINS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|     87|#define NUMBER_OF_BINS (20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (68:7): [True: 159, False: 87]
  ------------------
   69|       |
   70|    246|  pstr_ps_enc->aaa_ICC_data_buf = (FLOAT32 **)ptr1;
   71|    246|  ptr1 += NUMBER_OF_BINS * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   22|    246|#define NUMBER_OF_BINS (20)
  ------------------
   72|       |
   73|    246|  pstr_ps_enc->aaa_IID_data_buf = (FLOAT32 **)ptr1;
   74|    246|  ptr1 += NUMBER_OF_BINS * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   22|    246|#define NUMBER_OF_BINS (20)
  ------------------
   75|       |
   76|  5.16k|  for (i = 0; i < NUMBER_OF_BINS; i++) {
  ------------------
  |  |   22|  5.16k|#define NUMBER_OF_BINS (20)
  ------------------
  |  Branch (76:15): [True: 4.92k, False: 246]
  ------------------
   77|  4.92k|    pstr_ps_enc->aaa_ICC_data_buf[i] = ptr1;
   78|  4.92k|    ptr1 += SYSTEMLOOKAHEAD + 1;
  ------------------
  |  |   37|  4.92k|#define SYSTEMLOOKAHEAD (1)
  ------------------
   79|       |
   80|  4.92k|    memset(pstr_ps_enc->aaa_ICC_data_buf[i], 0,
   81|  4.92k|           (SYSTEMLOOKAHEAD + 1) * sizeof(pstr_ps_enc->aaa_ICC_data_buf[0]));
  ------------------
  |  |   37|  4.92k|#define SYSTEMLOOKAHEAD (1)
  ------------------
   82|       |
   83|  4.92k|    pstr_ps_enc->aaa_IID_data_buf[i] = ptr1;
   84|  4.92k|    ptr1 += SYSTEMLOOKAHEAD + 1;
  ------------------
  |  |   37|  4.92k|#define SYSTEMLOOKAHEAD (1)
  ------------------
   85|       |
   86|  4.92k|    memset(pstr_ps_enc->aaa_IID_data_buf[i], 0,
   87|  4.92k|           (SYSTEMLOOKAHEAD + 1) * sizeof(pstr_ps_enc->aaa_IID_data_buf[0]));
  ------------------
  |  |   37|  4.92k|#define SYSTEMLOOKAHEAD (1)
  ------------------
   88|  4.92k|  }
   89|       |
   90|    246|  pstr_ps_enc->ptr_hybrid_left = &pstr_ps_enc->hybrid_left;
   91|    246|  pstr_ps_enc->ptr_hybrid_right = &pstr_ps_enc->hybrid_right;
   92|       |
   93|    246|  err = ixheaace_create_hybrid_filter_bank(pstr_ps_enc->ptr_hybrid_left, &ptr4);
   94|       |
   95|    246|  if (err) {
  ------------------
  |  Branch (95:7): [True: 0, False: 246]
  ------------------
   96|      0|    return err;
   97|      0|  }
   98|       |
   99|    246|  err = ixheaace_create_hybrid_filter_bank(pstr_ps_enc->ptr_hybrid_right, &ptr4);
  100|       |
  101|    246|  if (err) {
  ------------------
  |  Branch (101:7): [True: 0, False: 246]
  ------------------
  102|      0|    return err;
  103|      0|  }
  104|       |
  105|  8.11k|  for (i = 0; i < NUMBER_OF_SUBSAMPLES; i++) {
  ------------------
  |  |   35|  8.11k|#define NUMBER_OF_SUBSAMPLES (32)
  ------------------
  |  Branch (105:15): [True: 7.87k, False: 246]
  ------------------
  106|  7.87k|    pstr_ps_enc->m_hybrid_real_left[i] = ptr3;
  107|  7.87k|    ptr3 += IXHEAACE_NUM_HYBRID_BANDS;
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  108|       |
  109|  7.87k|    memset(pstr_ps_enc->m_hybrid_real_left[i], 0,
  110|  7.87k|           IXHEAACE_NUM_HYBRID_BANDS * sizeof(pstr_ps_enc->m_hybrid_real_left[0]));
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  111|       |
  112|  7.87k|    pstr_ps_enc->m_hybrid_imag_left[i] = ptr3;
  113|  7.87k|    ptr3 += IXHEAACE_NUM_HYBRID_BANDS;
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  114|       |
  115|  7.87k|    memset(pstr_ps_enc->m_hybrid_imag_left[i], 0,
  116|  7.87k|           IXHEAACE_NUM_HYBRID_BANDS * sizeof(pstr_ps_enc->m_hybrid_imag_left[0]));
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  117|       |
  118|  7.87k|    pstr_ps_enc->m_hybrid_real_right[i] = ptr1;
  119|  7.87k|    ptr1 += IXHEAACE_NUM_HYBRID_BANDS;
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  120|       |
  121|  7.87k|    memset(pstr_ps_enc->m_hybrid_real_right[i], 0,
  122|  7.87k|           IXHEAACE_NUM_HYBRID_BANDS * sizeof(pstr_ps_enc->m_hybrid_real_right[0]));
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  123|       |
  124|  7.87k|    pstr_ps_enc->m_hybrid_imag_right[i] = ptr1;
  125|  7.87k|    ptr1 += IXHEAACE_NUM_HYBRID_BANDS;
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  126|       |
  127|  7.87k|    memset(pstr_ps_enc->m_hybrid_imag_right[i], 0,
  128|  7.87k|           IXHEAACE_NUM_HYBRID_BANDS * sizeof(pstr_ps_enc->m_hybrid_imag_right[0]));
  ------------------
  |  |   27|  7.87k|#define IXHEAACE_NUM_HYBRID_BANDS (16)
  ------------------
  129|  7.87k|  }
  130|       |
  131|    246|  pstr_ps_enc->temp_qmf_left_real = (FLOAT32 **)ptr1;
  132|    246|  ptr1 += IXHEAACE_HYBRID_FILTER_DELAY * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   25|    246|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  133|       |
  134|    246|  pstr_ps_enc->temp_qmf_left_imag = (FLOAT32 **)ptr1;
  135|    246|  ptr1 += IXHEAACE_HYBRID_FILTER_DELAY * sizeof(WORD32 *) / sizeof(WORD32);
  ------------------
  |  |   25|    246|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  136|       |
  137|    246|  pstr_ps_enc->hist_qmf_left_real = (FLOAT32 **)ptr2;
  138|    246|  ptr2 += IXHEAACE_HYBRID_FILTER_DELAY * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   25|    246|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  139|       |
  140|    246|  pstr_ps_enc->hist_qmf_left_imag = (FLOAT32 **)ptr2;
  141|    246|  ptr2 += IXHEAACE_HYBRID_FILTER_DELAY * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   25|    246|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  142|       |
  143|    246|  pstr_ps_enc->hist_qmf_right_real = (FLOAT32 **)ptr2;
  144|    246|  ptr2 += IXHEAACE_HYBRID_FILTER_DELAY * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   25|    246|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  145|       |
  146|    246|  pstr_ps_enc->hist_qmf_right_imag = (FLOAT32 **)ptr2;
  147|    246|  ptr2 += IXHEAACE_HYBRID_FILTER_DELAY * sizeof(FLOAT32 *) / sizeof(FLOAT32);
  ------------------
  |  |   25|    246|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  148|       |
  149|  1.72k|  for (i = 0; i < IXHEAACE_HYBRID_FILTER_DELAY; i++) {
  ------------------
  |  |   25|  1.72k|#define IXHEAACE_HYBRID_FILTER_DELAY (6)
  ------------------
  |  Branch (149:15): [True: 1.47k, False: 246]
  ------------------
  150|  1.47k|    pstr_ps_enc->temp_qmf_left_real[i] = ptr1;
  151|  1.47k|    ptr1 += NUMBER_OF_QMF_BANDS;
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  152|  1.47k|    memset(pstr_ps_enc->temp_qmf_left_real[i], 0,
  153|  1.47k|           NUMBER_OF_QMF_BANDS * sizeof(pstr_ps_enc->temp_qmf_left_real[0]));
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  154|       |
  155|  1.47k|    pstr_ps_enc->temp_qmf_left_imag[i] = ptr1;
  156|  1.47k|    ptr1 += NUMBER_OF_QMF_BANDS;
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  157|       |
  158|  1.47k|    memset(pstr_ps_enc->temp_qmf_left_imag[i], 0,
  159|  1.47k|           NUMBER_OF_QMF_BANDS * sizeof(pstr_ps_enc->temp_qmf_left_imag[0]));
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  160|       |
  161|  1.47k|    pstr_ps_enc->hist_qmf_left_real[i] = ptr2;
  162|  1.47k|    ptr2 += NUMBER_OF_QMF_BANDS;
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  163|       |
  164|  1.47k|    memset(pstr_ps_enc->hist_qmf_left_real[i], 0,
  165|  1.47k|           NUMBER_OF_QMF_BANDS * sizeof(pstr_ps_enc->hist_qmf_left_real[0]));
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  166|       |
  167|  1.47k|    pstr_ps_enc->hist_qmf_left_imag[i] = ptr2;
  168|  1.47k|    ptr2 += NUMBER_OF_QMF_BANDS;
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  169|       |
  170|  1.47k|    memset(pstr_ps_enc->hist_qmf_left_imag[i], 0,
  171|  1.47k|           NUMBER_OF_QMF_BANDS * sizeof(pstr_ps_enc->hist_qmf_left_imag[0]));
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  172|       |
  173|  1.47k|    pstr_ps_enc->hist_qmf_right_real[i] = ptr2;
  174|  1.47k|    ptr2 += NUMBER_OF_QMF_BANDS;
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  175|       |
  176|  1.47k|    memset(pstr_ps_enc->hist_qmf_right_real[i], 0,
  177|  1.47k|           NUMBER_OF_QMF_BANDS * sizeof(pstr_ps_enc->hist_qmf_right_real[0]));
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  178|       |
  179|  1.47k|    pstr_ps_enc->hist_qmf_right_imag[i] = ptr2;
  180|  1.47k|    ptr2 += NUMBER_OF_QMF_BANDS;
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  181|       |
  182|  1.47k|    memset(pstr_ps_enc->hist_qmf_right_imag[i], 0,
  183|  1.47k|           NUMBER_OF_QMF_BANDS * sizeof(pstr_ps_enc->hist_qmf_right_imag[0]));
  ------------------
  |  |   36|  1.47k|#define NUMBER_OF_QMF_BANDS (64)
  ------------------
  184|  1.47k|  }
  185|       |
  186|    246|  memset(pstr_ps_enc->pow_left_right, 0, sizeof(pstr_ps_enc->pow_left_right));
  187|    246|  memset(pstr_ps_enc->pow_corr_real_imag, 0, sizeof(pstr_ps_enc->pow_corr_real_imag));
  188|       |
  189|    246|  if ((pstr_ps_enc->hist_qmf_left_real == NULL) || (pstr_ps_enc->hist_qmf_left_imag == NULL) ||
  ------------------
  |  Branch (189:7): [True: 0, False: 246]
  |  Branch (189:52): [True: 0, False: 246]
  ------------------
  190|    246|      (pstr_ps_enc->hist_qmf_right_real == NULL) || (pstr_ps_enc->hist_qmf_right_imag == NULL)) {
  ------------------
  |  Branch (190:7): [True: 0, False: 246]
  |  Branch (190:53): [True: 0, False: 246]
  ------------------
  191|      0|    return IA_EXHEAACE_INIT_FATAL_PS_INIT_FAILED;
  192|      0|  }
  193|       |
  194|  4.29k|  for (i = 0; i < pstr_ps_enc->iid_icc_bins; i++) {
  ------------------
  |  Branch (194:15): [True: 4.05k, False: 246]
  ------------------
  195|  4.05k|    pstr_ps_enc->aaa_IID_data_buf[i][0] = 0;
  196|  4.05k|    pstr_ps_enc->aaa_ICC_data_buf[i][0] = -1.0f;
  197|  4.05k|  }
  198|       |
  199|    246|  pstr_ps_enc->bit_buf_read_offset = 0;
  200|    246|  pstr_ps_enc->bit_buf_write_offset = 0;
  201|       |
  202|    246|  ia_enhaacplus_enc_create_bitbuffer(&pstr_ps_enc->ps_bit_buf, (UWORD8 *)ptr1, 255 + 15);
  203|       |
  204|    246|  pstr_ps_enc->ps_bit_buf.ptr_read_next =
  205|    246|      pstr_ps_enc->ps_bit_buf.ptr_bit_buf_base + pstr_ps_enc->bit_buf_read_offset;
  206|    246|  pstr_ps_enc->ps_bit_buf.ptr_write_next =
  207|    246|      pstr_ps_enc->ps_bit_buf.ptr_bit_buf_base + pstr_ps_enc->bit_buf_write_offset;
  208|       |
  209|    246|  return err;
  210|    246|}

iaace_atan_approx:
  125|   601k|FLOAT32 iaace_atan_approx(FLOAT32 val) {
  126|   601k|  if (val < (FLOAT32)1.0f) {
  ------------------
  |  Branch (126:7): [True: 409k, False: 192k]
  ------------------
  127|   409k|    return (val / ((FLOAT32)1.0f + (FLOAT32)0.280872f * val * val));
  128|   409k|  } else {
  129|   192k|    return ((FLOAT32)1.57079633f - val / ((FLOAT32)0.280872f + val * val));
  130|   192k|  }
  131|   601k|}
ia_enhaacplus_enc_init_psy_configuration:
  269|  4.74k|    WORD32 long_frame_len) {
  270|  4.74k|  WORD32 sfb;
  271|  4.74k|  FLOAT32 sfb_bark_val[MAXIMUM_SCALE_FACTOR_BAND_LONG];
  272|  4.74k|  IA_ERRORCODE error;
  273|  4.74k|  error = ia_enhaacplus_enc_init_sfb_table(pstr_aac_tables->pstr_psycho_tab, sample_rate, aot,
  274|  4.74k|                                           LONG_WINDOW, pstr_psy_conf->sfb_offsets,
  ------------------
  |  |   31|  4.74k|#define LONG_WINDOW 0
  ------------------
  275|  4.74k|                                           &(pstr_psy_conf->sfb_cnt), long_frame_len);
  276|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (276:7): [True: 0, False: 4.74k]
  ------------------
  277|      0|    return error;
  278|      0|  }
  279|       |
  280|       |  /*   calculate bark values for each pb */
  281|  4.74k|  iaace_bark_values_init(pstr_psy_conf->sfb_cnt, pstr_psy_conf->sfb_offsets,
  282|  4.74k|                         pstr_psy_conf->sfb_offsets[pstr_psy_conf->sfb_cnt], sample_rate,
  283|  4.74k|                         sfb_bark_val, aot);
  284|       |
  285|       |  /*init thresholds in quiet  */
  286|       |
  287|  4.74k|  iaace_thr_quiet_init(pstr_psy_conf->sfb_cnt, pstr_psy_conf->sfb_offsets, sfb_bark_val,
  288|  4.74k|                       pstr_psy_conf->sfb_threshold_quiet,
  289|  4.74k|                       pstr_aac_tables->pstr_psycho_tab->ixheaace_bark_quiet_thr_val, aot);
  290|       |
  291|       |  /*  calculate spreading function */
  292|       |
  293|  4.74k|  iaace_spreading_init(pstr_psy_conf->sfb_cnt, sfb_bark_val, pstr_psy_conf->sfb_mask_low_factor,
  294|  4.74k|                       pstr_psy_conf->sfb_mask_high_factor,
  295|  4.74k|                       pstr_psy_conf->sfb_mask_low_factor_spread_nrg,
  296|  4.74k|                       pstr_psy_conf->sfb_mask_high_factor_spread_nrg, bit_rate, LONG_WINDOW);
  ------------------
  |  |   31|  4.74k|#define LONG_WINDOW 0
  ------------------
  297|       |
  298|       |  /*
  299|       |    init ratio
  300|       |  */
  301|       |
  302|  4.74k|  pstr_psy_conf->min_remaining_threshold_factor = MIN_THRESH_FAC;
  ------------------
  |  |  106|  4.74k|#define MIN_THRESH_FAC (0.01f)
  ------------------
  303|       |
  304|  4.74k|  pstr_psy_conf->clip_energy = CLIP_ENERGY_VALUE_LONG;
  ------------------
  |  |  104|  4.74k|#define CLIP_ENERGY_VALUE_LONG (1.0e9f)
  ------------------
  305|  4.74k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  9.48k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  8.48k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.04k|#define AOT_PS (29)
  ------------------
  |  Branch (305:7): [True: 1.00k, False: 3.74k]
  |  Branch (305:28): [True: 1.69k, False: 2.04k]
  |  Branch (305:46): [True: 246, False: 1.80k]
  ------------------
  306|  2.94k|    pstr_psy_conf->ratio_float = C_RATIO;
  ------------------
  |  |   26|  2.94k|#define C_RATIO 0.001258925f /* pow(10.0f, -(29.0f/10.0f)) */
  ------------------
  307|  2.94k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  3.60k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.27k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (307:14): [True: 529, False: 1.27k]
  |  Branch (307:35): [True: 1.27k, False: 0]
  ------------------
  308|  1.80k|    if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (308:9): [True: 1.27k, False: 529]
  ------------------
  309|  1.27k|      pstr_psy_conf->ratio_float = C_RATIO;
  ------------------
  |  |   26|  1.27k|#define C_RATIO 0.001258925f /* pow(10.0f, -(29.0f/10.0f)) */
  ------------------
  310|  1.27k|    } else {
  311|    529|      pstr_psy_conf->ratio_float = SNR_FLOAT;
  ------------------
  |  |   29|    529|#define SNR_FLOAT .0001f /* 0.0001 ie. pow(10.0f, -(40.0f/10.0f)) */
  ------------------
  312|    529|    }
  313|  1.80k|  }
  314|       |
  315|  4.74k|  pstr_psy_conf->lowpass_line = (WORD32)((2 * bandwidth * long_frame_len) / sample_rate);
  316|       |
  317|       |  /* pstr_psy_conf->pstr_sfb_offset[] */
  318|   152k|  for (sfb = 0; sfb < pstr_psy_conf->sfb_cnt; sfb++) {
  ------------------
  |  Branch (318:17): [True: 152k, False: 433]
  ------------------
  319|   152k|    if (pstr_psy_conf->sfb_offsets[sfb] >= pstr_psy_conf->lowpass_line) break;
  ------------------
  |  Branch (319:9): [True: 4.31k, False: 148k]
  ------------------
  320|   152k|  }
  321|  4.74k|  pstr_psy_conf->sfb_active = sfb;
  322|       |
  323|       |  /*
  324|       |    calculate minSnr
  325|       |  */
  326|  4.74k|  iaace_min_snr_init(bit_rate, sample_rate, pstr_psy_conf->sfb_offsets[pstr_psy_conf->sfb_cnt],
  327|  4.74k|                     pstr_psy_conf->sfb_offsets, sfb_bark_val, pstr_psy_conf->sfb_active,
  328|  4.74k|                     pstr_psy_conf->sfb_min_snr);
  329|       |
  330|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  331|  4.74k|}
ia_enhaacplus_enc_init_psy_configuration_short:
  336|  2.94k|    WORD32 long_frame_len) {
  337|  2.94k|  WORD32 sfb;
  338|  2.94k|  FLOAT32 sfb_bark_val[MAXIMUM_SCALE_FACTOR_BAND_SHORT] = {0};
  339|  2.94k|  IA_ERRORCODE error;
  340|       |  /*
  341|       |    init sfb table
  342|       |  */
  343|  2.94k|  error = ia_enhaacplus_enc_init_sfb_table(pstr_aac_tables->pstr_psycho_tab, sample_rate, aot,
  344|  2.94k|                                           SHORT_WINDOW, pstr_psy_conf->sfb_offsets,
  ------------------
  |  |   33|  2.94k|#define SHORT_WINDOW 2
  ------------------
  345|  2.94k|                                           &(pstr_psy_conf->sfb_cnt), long_frame_len);
  346|       |
  347|  2.94k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (347:7): [True: 0, False: 2.94k]
  ------------------
  348|      0|    return error;
  349|      0|  }
  350|       |
  351|  2.94k|  iaace_bark_values_init(pstr_psy_conf->sfb_cnt, pstr_psy_conf->sfb_offsets,
  352|  2.94k|                         pstr_psy_conf->sfb_offsets[pstr_psy_conf->sfb_cnt], sample_rate,
  353|  2.94k|                         sfb_bark_val, aot);
  354|       |
  355|  2.94k|  iaace_thr_quiet_init(pstr_psy_conf->sfb_cnt, pstr_psy_conf->sfb_offsets, sfb_bark_val,
  356|  2.94k|                       pstr_psy_conf->sfb_threshold_quiet,
  357|  2.94k|                       pstr_aac_tables->pstr_psycho_tab->ixheaace_bark_quiet_thr_val, aot);
  358|       |
  359|       |  /*
  360|       |    calculate spreading function
  361|       |  */
  362|  2.94k|  iaace_spreading_init(pstr_psy_conf->sfb_cnt, sfb_bark_val, pstr_psy_conf->sfb_mask_low_factor,
  363|  2.94k|                       pstr_psy_conf->sfb_mask_high_factor,
  364|  2.94k|                       pstr_psy_conf->sfb_mask_low_factor_spread_nrg,
  365|  2.94k|                       pstr_psy_conf->sfb_mask_high_factor_spread_nrg, bit_rate, SHORT_WINDOW);
  ------------------
  |  |   33|  2.94k|#define SHORT_WINDOW 2
  ------------------
  366|       |
  367|       |  /*
  368|       |    init ratio
  369|       |  */
  370|       |
  371|  2.94k|  pstr_psy_conf->min_remaining_threshold_factor = 0.01f;
  372|       |
  373|  2.94k|  pstr_psy_conf->clip_energy = CLIP_ENERGY_VALUE_LONG / (TRANS_FAC * TRANS_FAC);
  ------------------
  |  |  104|  2.94k|#define CLIP_ENERGY_VALUE_LONG (1.0e9f)
  ------------------
                pstr_psy_conf->clip_energy = CLIP_ENERGY_VALUE_LONG / (TRANS_FAC * TRANS_FAC);
  ------------------
  |  |   29|  2.94k|#define TRANS_FAC 8
  ------------------
                pstr_psy_conf->clip_energy = CLIP_ENERGY_VALUE_LONG / (TRANS_FAC * TRANS_FAC);
  ------------------
  |  |   29|  2.94k|#define TRANS_FAC 8
  ------------------
  374|  2.94k|  switch (aot) {
  ------------------
  |  Branch (374:11): [True: 2.94k, False: 0]
  ------------------
  375|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (375:5): [True: 1.00k, False: 1.94k]
  ------------------
  376|  2.69k|    case AOT_SBR:
  ------------------
  |  |   35|  2.69k|#define AOT_SBR (5)
  ------------------
  |  Branch (376:5): [True: 1.69k, False: 1.24k]
  ------------------
  377|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (377:5): [True: 246, False: 2.69k]
  ------------------
  378|  2.94k|      pstr_psy_conf->ratio_float = C_RATIO;
  ------------------
  |  |   26|  2.94k|#define C_RATIO 0.001258925f /* pow(10.0f, -(29.0f/10.0f)) */
  ------------------
  379|  2.94k|      break;
  380|       |
  381|      0|    case AOT_AAC_LD:
  ------------------
  |  |   36|      0|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (381:5): [True: 0, False: 2.94k]
  ------------------
  382|      0|    case AOT_AAC_ELD:
  ------------------
  |  |   37|      0|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (382:5): [True: 0, False: 2.94k]
  ------------------
  383|      0|      pstr_psy_conf->ratio_float = SNR_FLOAT;
  ------------------
  |  |   29|      0|#define SNR_FLOAT .0001f /* 0.0001 ie. pow(10.0f, -(40.0f/10.0f)) */
  ------------------
  384|      0|      break;
  385|  2.94k|  }
  386|       |
  387|  2.94k|  pstr_psy_conf->lowpass_line = (WORD32)((2 * bandwidth * long_frame_len) / sample_rate);
  388|  36.0k|  for (sfb = 0; sfb < pstr_psy_conf->sfb_cnt; sfb++) {
  ------------------
  |  Branch (388:17): [True: 35.6k, False: 411]
  ------------------
  389|  35.6k|    if (pstr_psy_conf->sfb_offsets[sfb] >= pstr_psy_conf->lowpass_line) break;
  ------------------
  |  Branch (389:9): [True: 2.53k, False: 33.1k]
  ------------------
  390|  35.6k|  }
  391|  2.94k|  pstr_psy_conf->sfb_active = sfb;
  392|       |
  393|  2.94k|  iaace_min_snr_init(bit_rate, sample_rate, pstr_psy_conf->sfb_offsets[pstr_psy_conf->sfb_cnt],
  394|  2.94k|                     pstr_psy_conf->sfb_offsets, sfb_bark_val, pstr_psy_conf->sfb_active,
  395|  2.94k|                     pstr_psy_conf->sfb_min_snr);
  396|       |
  397|  2.94k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  398|  2.94k|}
ixheaace_psy_configuration.c:ia_enhaacplus_enc_init_sfb_table:
   59|  7.68k|                                                     WORD32 *sfb_cnt, WORD32 long_frame_len) {
   60|  7.68k|  const UWORD8 *ptr_sfb_param = NULL;
   61|  7.68k|  UWORD32 i;
   62|  7.68k|  WORD32 spec_start_offset, spec_lines = 0;
   63|       |
   64|       |  /* sfb_info_tab[] */
   65|  42.7k|  for (i = 0; i < sizeof(pstr_psycho_tab->sfb_info_tab) / sizeof(ixheaace_sfb_info_tab); i++) {
  ------------------
  |  Branch (65:15): [True: 42.7k, False: 0]
  ------------------
   66|  42.7k|    if (pstr_psycho_tab->sfb_info_tab[i].sample_rate == sample_rate) {
  ------------------
  |  Branch (66:9): [True: 7.68k, False: 35.1k]
  ------------------
   67|  7.68k|      switch (block_type) {
  ------------------
  |  Branch (67:15): [True: 7.68k, False: 0]
  ------------------
   68|  4.74k|        case LONG_WINDOW:
  ------------------
  |  |   31|  4.74k|#define LONG_WINDOW 0
  ------------------
  |  Branch (68:9): [True: 4.74k, False: 2.94k]
  ------------------
   69|  4.74k|        case START_WINDOW:
  ------------------
  |  |   32|  4.74k|#define START_WINDOW 1
  ------------------
  |  Branch (69:9): [True: 0, False: 7.68k]
  ------------------
   70|  4.74k|        case STOP_WINDOW:
  ------------------
  |  |   34|  4.74k|#define STOP_WINDOW 3
  ------------------
  |  Branch (70:9): [True: 0, False: 7.68k]
  ------------------
   71|  4.74k|          if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  9.48k|#define AOT_AAC_LC (2)
  ------------------
                        if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  8.48k|#define AOT_SBR (5)
  ------------------
                        if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.04k|#define AOT_PS (29)
  ------------------
  |  Branch (71:15): [True: 1.00k, False: 3.74k]
  |  Branch (71:36): [True: 1.69k, False: 2.04k]
  |  Branch (71:54): [True: 246, False: 1.80k]
  ------------------
   72|  2.94k|            if (long_frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  2.94k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (72:17): [True: 1.01k, False: 1.92k]
  ------------------
   73|  1.01k|              ptr_sfb_param = pstr_psycho_tab->sfb_info_tab[i].param_long_960;
   74|  1.92k|            } else {
   75|  1.92k|              ptr_sfb_param = pstr_psycho_tab->sfb_info_tab[i].param_long;
   76|  1.92k|            }
   77|  2.94k|            spec_lines = long_frame_len;
   78|  2.94k|            break;
   79|  2.94k|          } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  3.60k|#define AOT_AAC_LD (23)
  ------------------
                        } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.27k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (79:22): [True: 529, False: 1.27k]
  |  Branch (79:43): [True: 1.27k, False: 0]
  ------------------
   80|  1.80k|            if (long_frame_len == FRAME_LEN_480)
  ------------------
  |  |   93|  1.80k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (80:17): [True: 825, False: 977]
  ------------------
   81|    825|              ptr_sfb_param = pstr_psycho_tab->sfb_info_tab[i].param_long_480_ld;
   82|    977|            else
   83|    977|              ptr_sfb_param = pstr_psycho_tab->sfb_info_tab[i].param_long_512_ld;
   84|  1.80k|            spec_lines = long_frame_len;
   85|  1.80k|            break;
   86|  1.80k|          }
   87|       |
   88|  2.94k|        case SHORT_WINDOW:
  ------------------
  |  |   33|  2.94k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (88:9): [True: 2.94k, False: 4.74k]
  ------------------
   89|  2.94k|          if (long_frame_len == FRAME_LEN_SHORT_120) {
  ------------------
  |  |   31|  2.94k|#define FRAME_LEN_SHORT_120 (120)
  ------------------
  |  Branch (89:15): [True: 1.01k, False: 1.92k]
  ------------------
   90|  1.01k|            ptr_sfb_param = pstr_psycho_tab->sfb_info_tab[i].param_short_120;
   91|  1.92k|          } else {
   92|  1.92k|            ptr_sfb_param = pstr_psycho_tab->sfb_info_tab[i].param_short;
   93|  1.92k|          }
   94|  2.94k|          spec_lines = long_frame_len;
   95|  2.94k|          break;
   96|  7.68k|      }
   97|  7.68k|      break;
   98|  7.68k|    }
   99|  42.7k|  }
  100|       |
  101|  7.68k|  if (ptr_sfb_param == NULL) {
  ------------------
  |  Branch (101:7): [True: 0, False: 7.68k]
  ------------------
  102|      0|    return IA_EXHEAACE_INIT_FATAL_SCALE_FACTOR_BAND_NOT_SUPPORTED;
  103|      0|  }
  104|       |
  105|  7.68k|  *sfb_cnt = 0;
  106|  7.68k|  spec_start_offset = 0;
  107|       |
  108|   230k|  do {
  109|   230k|    ptr_sfb_offset[*sfb_cnt] = spec_start_offset;
  110|       |
  111|   230k|    spec_start_offset += ptr_sfb_param[*sfb_cnt];
  112|       |
  113|   230k|    (*sfb_cnt)++;
  114|   230k|  } while (spec_start_offset < spec_lines);
  ------------------
  |  Branch (114:12): [True: 222k, False: 7.68k]
  ------------------
  115|       |
  116|  7.68k|  if (spec_start_offset != spec_lines) {
  ------------------
  |  Branch (116:7): [True: 0, False: 7.68k]
  ------------------
  117|      0|    return IA_EXHEAACE_INIT_FATAL_SFB_TABLE_INIT_FAILED;
  118|      0|  }
  119|       |
  120|  7.68k|  ptr_sfb_offset[*sfb_cnt] = spec_start_offset;
  121|       |
  122|  7.68k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  7.68k|#define IA_NO_ERROR 0x00000000
  ------------------
  123|  7.68k|}
ixheaace_psy_configuration.c:iaace_bark_values_init:
  216|  7.68k|                                   WORD32 sample_rate, FLOAT32 *ptr_b_value, WORD32 aot) {
  217|  7.68k|  WORD32 i;
  218|  7.68k|  FLOAT32 b_val0, b_val1;
  219|  7.68k|  b_val0 = 0.0f;
  220|       |
  221|   238k|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (221:15): [True: 230k, False: 7.68k]
  ------------------
  222|   230k|    b_val1 = iaace_calc_bark_line_value(num_lines, ptr_sfb_offset[i + 1], sample_rate);
  223|   230k|    ptr_b_value[i] = (b_val0 + b_val1) * (FLOAT32)0.5f;
  224|   230k|    if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   230k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (224:9): [True: 38.8k, False: 191k]
  ------------------
  225|  38.8k|      if (ptr_b_value[i] > MAX_BARK_VALUE) {
  ------------------
  |  |   31|  38.8k|#define MAX_BARK_VALUE (24.0f)
  ------------------
  |  Branch (225:11): [True: 0, False: 38.8k]
  ------------------
  226|      0|        ptr_b_value[i] = MAX_BARK_VALUE;
  ------------------
  |  |   31|      0|#define MAX_BARK_VALUE (24.0f)
  ------------------
  227|      0|      }
  228|  38.8k|    }
  229|       |
  230|   230k|    b_val0 = b_val1;
  231|   230k|  }
  232|  7.68k|}
ixheaace_psy_configuration.c:iaace_calc_bark_line_value:
  133|   230k|static FLOAT32 iaace_calc_bark_line_value(WORD32 num_lines, WORD32 fft_line, WORD32 sample_rate) {
  134|   230k|  FLOAT32 center_freq, temp, b_value;
  135|   230k|  center_freq = (FLOAT32)fft_line * ((FLOAT32)sample_rate * (FLOAT32)0.5f) / (FLOAT32)num_lines;
  136|   230k|  temp = (FLOAT32)iaace_atan_approx((FLOAT32)1.3333333e-4f * center_freq);
  137|   230k|  b_value = (FLOAT32)13.3f * iaace_atan_approx((FLOAT32)0.00076f * center_freq) +
  138|   230k|            (FLOAT32)3.5f * temp * temp;
  139|   230k|  return (b_value);
  140|   230k|}
ixheaace_psy_configuration.c:iaace_thr_quiet_init:
  144|  7.68k|                                 WORD32 aot) {
  145|  7.68k|  WORD32 i;
  146|  7.68k|  FLOAT32 bark_thr_quiet;
  147|       |
  148|   238k|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (148:15): [True: 230k, False: 7.68k]
  ------------------
  149|   230k|    if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   230k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (149:9): [True: 38.8k, False: 191k]
  ------------------
  150|  38.8k|      ptr_thr_quiet[i] = (FLOAT32)(ptr_sfb_offset[i + 1] - ptr_sfb_offset[i]) * 42;
  151|   191k|    } else {
  152|   191k|      WORD32 b_val1, b_val2;
  153|       |
  154|   191k|      if (i > 0) {
  ------------------
  |  Branch (154:11): [True: 185k, False: 6.41k]
  ------------------
  155|   185k|        b_val1 = (WORD32)(ptr_bark_val[i] + ptr_bark_val[i - 1]) >> 1;
  156|   185k|      } else {
  157|  6.41k|        b_val1 = (WORD32)(ptr_bark_val[i]) >> 1;
  158|  6.41k|      }
  159|       |
  160|   191k|      if (i < sfb_count - 1) {
  ------------------
  |  Branch (160:11): [True: 185k, False: 6.41k]
  ------------------
  161|   185k|        b_val2 = (WORD32)(ptr_bark_val[i] + ptr_bark_val[i + 1]) >> 1;
  162|   185k|      } else {
  163|  6.41k|        b_val2 = (WORD32)(ptr_bark_val[i]);
  164|  6.41k|      }
  165|   191k|      b_val1 = MIN(b_val1, (WORD32)MAX_BARK_VALUE);
  ------------------
  |  |   23|   191k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 183k, False: 8.19k]
  |  |  ------------------
  ------------------
  166|   191k|      b_val2 = MIN(b_val2, (WORD32)MAX_BARK_VALUE);
  ------------------
  |  |   23|   191k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 181k, False: 9.53k]
  |  |  ------------------
  ------------------
  167|   191k|      bark_thr_quiet = MIN(ptr_bark_quiet_thr_val[b_val1], ptr_bark_quiet_thr_val[b_val2]);
  ------------------
  |  |   23|   191k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 16.1k, False: 175k]
  |  |  ------------------
  ------------------
  168|       |
  169|   191k|      ptr_thr_quiet[i] = (FLOAT32)db_lin_scale(bark_thr_quiet - 20.0f) * 16887.8f *
  ------------------
  |  |   23|   191k|#define db_lin_scale(a) pow(10.0f, (a) * (FLOAT32)0.1f)
  ------------------
  170|   191k|                         (FLOAT32)(ptr_sfb_offset[i + 1] - ptr_sfb_offset[i]);
  171|   191k|    }
  172|   230k|  }
  173|  7.68k|}
ixheaace_psy_configuration.c:iaace_spreading_init:
  179|  7.68k|                                 WORD32 block_type) {
  180|  7.68k|  WORD32 i;
  181|  7.68k|  FLOAT32 mask_low_spr_energy, mask_high_spr_energy;
  182|       |
  183|  7.68k|  if (block_type != SHORT_WINDOW) {
  ------------------
  |  |   33|  7.68k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (183:7): [True: 4.74k, False: 2.94k]
  ------------------
  184|  4.74k|    mask_low_spr_energy = MASK_LOW_SP_ENERGY_L;
  ------------------
  |  |   34|  4.74k|#define MASK_LOW_SP_ENERGY_L (3.0f)
  ------------------
  185|  4.74k|    mask_high_spr_energy = (bit_rate > MASK_HIGH_SP_BITRATE_THRESH) ? MASK_HIGH_SP_ENERGY_L
  ------------------
  |  |   39|  4.74k|#define MASK_HIGH_SP_BITRATE_THRESH (22000)
  ------------------
                  mask_high_spr_energy = (bit_rate > MASK_HIGH_SP_BITRATE_THRESH) ? MASK_HIGH_SP_ENERGY_L
  ------------------
  |  |   35|  2.24k|#define MASK_HIGH_SP_ENERGY_L (2.0f)
  ------------------
  |  Branch (185:28): [True: 2.24k, False: 2.49k]
  ------------------
  186|  4.74k|                                                                    : MASK_HIGH_SP_ENERGY_L_LBR;
  ------------------
  |  |   36|  7.23k|#define MASK_HIGH_SP_ENERGY_L_LBR (1.5f)
  ------------------
  187|  4.74k|  } else {
  188|  2.94k|    mask_low_spr_energy = MASK_LOW_SP_ENERGY_S;
  ------------------
  |  |   37|  2.94k|#define MASK_LOW_SP_ENERGY_S (2.0f)
  ------------------
  189|  2.94k|    mask_high_spr_energy = MASK_HIGH_SP_ENERGY_S;
  ------------------
  |  |   38|  2.94k|#define MASK_HIGH_SP_ENERGY_S (1.5f)
  ------------------
  190|  2.94k|  }
  191|       |
  192|   238k|  for (i = 0; i < sfb_count; i++) {
  ------------------
  |  Branch (192:15): [True: 230k, False: 7.68k]
  ------------------
  193|   230k|    if (i > 0) {
  ------------------
  |  Branch (193:9): [True: 222k, False: 7.68k]
  ------------------
  194|   222k|      FLOAT32 db_val;
  195|   222k|      FLOAT32 diff_val = (ptr_bark_val[i] - ptr_bark_val[i - 1]);
  196|       |
  197|   222k|      db_val = MASK_HIGH_FAC * diff_val;
  ------------------
  |  |   33|   222k|#define MASK_HIGH_FAC (1.5f)
  ------------------
  198|   222k|      ptr_mask_high_fac[i] = (FLOAT32)pow(10.0f, -db_val);
  199|   222k|      db_val = MASK_LOW_FAC * diff_val;
  ------------------
  |  |   32|   222k|#define MASK_LOW_FAC (3.0f)
  ------------------
  200|   222k|      ptr_mask_low_fac[i - 1] = (FLOAT32)pow(10.0f, -db_val);
  201|   222k|      db_val = mask_high_spr_energy * diff_val;
  202|   222k|      ptr_mask_high_fac_spr_energy[i] = (FLOAT32)pow(10.0f, -db_val);
  203|   222k|      db_val = mask_low_spr_energy * diff_val;
  204|   222k|      ptr_mask_low_fac_spr_energy[i - 1] = (FLOAT32)pow(10.0f, -db_val);
  205|   222k|    } else {
  206|  7.68k|      ptr_mask_high_fac[i] = 0.0f;
  207|  7.68k|      ptr_mask_low_fac[sfb_count - 1] = 0.0f;
  208|  7.68k|      ptr_mask_high_fac_spr_energy[i] = 0.0f;
  209|  7.68k|      ptr_mask_low_fac_spr_energy[sfb_count - 1] = 0.0f;
  210|  7.68k|    }
  211|   230k|  }
  212|  7.68k|  return;
  213|  7.68k|}
ixheaace_psy_configuration.c:iaace_min_snr_init:
  238|  7.68k|                               FLOAT32 *ptr_sfb_min_snr) {
  239|  7.68k|  WORD32 sfb;
  240|  7.68k|  FLOAT32 bark_fac;
  241|  7.68k|  FLOAT32 bark_width;
  242|  7.68k|  FLOAT32 pe_per_window, pe_part;
  243|  7.68k|  FLOAT32 snr;
  244|  7.68k|  FLOAT32 b_val0, b_val1;
  245|       |
  246|  7.68k|  bark_fac = (FLOAT32)1.0 / MIN(ptr_bark_value[sfb_active - 1] / MAX_BARK_VALUE, (FLOAT32)1.0);
  ------------------
  |  |   23|  7.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.08k, False: 595]
  |  |  ------------------
  ------------------
  247|  7.68k|  pe_per_window = iaace_bits_to_pe((FLOAT32)bit_rate / (FLOAT32)sample_rate * (FLOAT32)num_lines);
  248|  7.68k|  b_val0 = (FLOAT32)0.0f;
  249|       |
  250|   188k|  for (sfb = 0; sfb < sfb_active; sfb++) {
  ------------------
  |  Branch (250:17): [True: 181k, False: 7.68k]
  ------------------
  251|   181k|    b_val1 = (FLOAT32)2.0 * ptr_bark_value[sfb] - b_val0;
  252|   181k|    bark_width = b_val1 - b_val0;
  253|   181k|    b_val0 = b_val1;
  254|       |
  255|   181k|    pe_part = pe_per_window * (FLOAT32)0.024f * bark_fac;
  256|   181k|    pe_part *= bark_width;
  257|   181k|    pe_part /= (FLOAT32)(ptr_sfb_offset[sfb + 1] - ptr_sfb_offset[sfb]);
  258|   181k|    snr = (FLOAT32)pow(2.0f, pe_part) - 1.5f;
  259|   181k|    snr = 1.0f / MAX(snr, 1.0f);
  ------------------
  |  |   24|   181k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 107k, False: 73.4k]
  |  |  ------------------
  ------------------
  260|   181k|    snr = MIN(snr, 0.8f);
  ------------------
  |  |   23|   181k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 99.1k, False: 81.9k]
  |  |  ------------------
  ------------------
  261|   181k|    snr = MAX(snr, 0.003f);
  ------------------
  |  |   24|   181k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 155k, False: 25.9k]
  |  |  ------------------
  ------------------
  262|   181k|    ptr_sfb_min_snr[sfb] = snr;
  263|   181k|  }
  264|  7.68k|}
ixheaace_psy_configuration.c:iaace_bits_to_pe:
  234|  7.68k|static FLOAT32 iaace_bits_to_pe(const FLOAT32 bits) { return (bits * 1.18f); }

ia_enhaacplus_enc_psy_new:
   81|  4.74k|{
   82|  4.74k|  WORD32 i;
   83|  11.6k|  for (i = 0; i < num_chan; i++) {
  ------------------
  |  Branch (83:15): [True: 6.95k, False: 4.74k]
  ------------------
   84|  6.95k|    pstr_h_psy->psy_data[i]->ptr_spec_coeffs =
   85|  6.95k|        (FLOAT32 *)(&ptr_shared_buffer_2[i * long_frame_len]);
   86|       |
   87|  6.95k|    memset(pstr_h_psy->psy_data[i]->ptr_spec_coeffs, 0,
   88|  6.95k|           long_frame_len * sizeof(*pstr_h_psy->psy_data[i]->ptr_spec_coeffs));
   89|  6.95k|  }
   90|       |
   91|  4.74k|  pstr_h_psy->p_scratch_tns_float = (FLOAT32 *)(&ptr_shared_buffer_2[2 * long_frame_len]);
   92|  4.74k|  if (long_frame_len == FRAME_LEN_960) {
  ------------------
  |  |   94|  4.74k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (92:7): [True: 1.01k, False: 3.72k]
  ------------------
   93|  1.01k|    pstr_h_psy->p_scratch_tns_float = pstr_h_psy->p_scratch_tns_float + 128;
   94|  1.01k|  }
   95|       |
   96|  4.74k|  memset(pstr_h_psy->p_scratch_tns_float, 0,
   97|  4.74k|         long_frame_len * sizeof(*pstr_h_psy->p_scratch_tns_float));
   98|       |
   99|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  100|  4.74k|}
ia_enhaacplus_enc_psy_main_init:
  108|  4.74k|{
  109|  4.74k|  WORD32 ch;
  110|  4.74k|  IA_ERRORCODE err;
  111|       |
  112|  4.74k|  err = ia_enhaacplus_enc_init_psy_configuration(bit_rate / channels, sample_rate, bandwidth, aot,
  113|  4.74k|                                                 &(pstr_h_psy->psy_conf_long), pstr_aac_tables,
  114|  4.74k|                                                 frame_len_long);
  115|  4.74k|  if (err != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (115:7): [True: 0, False: 4.74k]
  ------------------
  116|      0|    return err;
  117|      0|  }
  118|       |
  119|  4.74k|  if (!err) {
  ------------------
  |  Branch (119:7): [True: 4.74k, False: 0]
  ------------------
  120|  4.74k|    err = ia_enhaacplus_enc_init_tns_configuration(
  121|  4.74k|        bit_rate, sample_rate, channels, &pstr_h_psy->psy_conf_long.str_tns_conf,
  122|  4.74k|        &(pstr_h_psy->psy_conf_long), (WORD32)(tns_mask & 1), pstr_aac_tables->pstr_tns_tab,
  123|  4.74k|        frame_len_long, aot);
  124|       |
  125|  4.74k|    if (err != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (125:9): [True: 0, False: 4.74k]
  ------------------
  126|      0|      return err;
  127|      0|    }
  128|  4.74k|  }
  129|  4.74k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  9.48k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  8.48k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.04k|#define AOT_PS (29)
  ------------------
  |  Branch (129:7): [True: 1.00k, False: 3.74k]
  |  Branch (129:28): [True: 1.69k, False: 2.04k]
  |  Branch (129:46): [True: 246, False: 1.80k]
  ------------------
  130|  2.94k|    if (!err) {
  ------------------
  |  Branch (130:9): [True: 2.94k, False: 0]
  ------------------
  131|  2.94k|      err = ia_enhaacplus_enc_init_psy_configuration_short(
  132|  2.94k|          bit_rate / channels, sample_rate, bandwidth, aot, &pstr_h_psy->psy_conf_short,
  133|  2.94k|          pstr_aac_tables, frame_len_long / BLK_SWITCH_WIN);
  ------------------
  |  |   27|  2.94k|#define BLK_SWITCH_WIN 8
  ------------------
  134|  2.94k|      if (err != IA_NO_ERROR) {
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (134:11): [True: 0, False: 2.94k]
  ------------------
  135|      0|        return err;
  136|      0|      }
  137|  2.94k|    }
  138|       |
  139|  2.94k|    if (!err) {
  ------------------
  |  Branch (139:9): [True: 2.94k, False: 0]
  ------------------
  140|  2.94k|      err = ia_enhaacplus_enc_init_tns_configuration_short(
  141|  2.94k|          bit_rate, sample_rate, channels, &pstr_h_psy->psy_conf_short.str_tns_conf,
  142|  2.94k|          &(pstr_h_psy->psy_conf_short), (WORD32)(tns_mask & 1), pstr_aac_tables->pstr_tns_tab,
  143|  2.94k|          frame_len_long / BLK_SWITCH_WIN, aot);
  ------------------
  |  |   27|  2.94k|#define BLK_SWITCH_WIN 8
  ------------------
  144|  2.94k|      if (err != IA_NO_ERROR) {
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (144:11): [True: 0, False: 2.94k]
  ------------------
  145|      0|        return err;
  146|      0|      }
  147|  2.94k|    }
  148|  2.94k|  }
  149|       |
  150|  4.74k|  if (!err) {
  ------------------
  |  Branch (150:7): [True: 4.74k, False: 0]
  ------------------
  151|       |    /* pstr_h_psy->psy_data[] */
  152|  11.6k|    for (ch = 0; ch < channels; ch++) {
  ------------------
  |  Branch (152:18): [True: 6.95k, False: 4.74k]
  ------------------
  153|  6.95k|      switch (aot) {
  ------------------
  |  Branch (153:15): [True: 6.95k, False: 0]
  ------------------
  154|  1.50k|        case AOT_AAC_LC:
  ------------------
  |  |   34|  1.50k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (154:9): [True: 1.50k, False: 5.44k]
  ------------------
  155|  4.06k|        case AOT_SBR:
  ------------------
  |  |   35|  4.06k|#define AOT_SBR (5)
  ------------------
  |  Branch (155:9): [True: 2.55k, False: 4.39k]
  ------------------
  156|  4.31k|        case AOT_PS:
  ------------------
  |  |   39|  4.31k|#define AOT_PS (29)
  ------------------
  |  Branch (156:9): [True: 246, False: 6.70k]
  ------------------
  157|  4.31k|          iaace_init_block_switching(&pstr_h_psy->psy_data[ch]->blk_switch_cntrl, bit_rate,
  158|  4.31k|                                     channels);
  159|  4.31k|          break;
  160|       |
  161|    766|        case AOT_AAC_LD:
  ------------------
  |  |   36|    766|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (161:9): [True: 766, False: 6.18k]
  ------------------
  162|  2.63k|        case AOT_AAC_ELD:
  ------------------
  |  |   37|  2.63k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (162:9): [True: 1.87k, False: 5.07k]
  ------------------
  163|  2.63k|          pstr_h_psy->psy_data[ch]->blk_switch_cntrl.win_seq = LONG_WINDOW;
  ------------------
  |  |   31|  2.63k|#define LONG_WINDOW 0
  ------------------
  164|  2.63k|          pstr_h_psy->psy_data[ch]->blk_switch_cntrl.nxt_win_seq = LONG_WINDOW;
  ------------------
  |  |   31|  2.63k|#define LONG_WINDOW 0
  ------------------
  165|  2.63k|          break;
  166|  6.95k|      }
  167|  6.95k|      ia_enhaacplus_enc_init_pre_echo_control(pstr_h_psy->psy_data[ch]->sfb_threshold_nm1_float,
  168|  6.95k|                                              pstr_h_psy->psy_conf_long.sfb_cnt,
  169|  6.95k|                                              pstr_h_psy->psy_conf_long.sfb_threshold_quiet);
  170|  6.95k|    }
  171|  4.74k|  }
  172|       |
  173|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  174|  4.74k|}
ia_enhaacplus_enc_psy_main:
  473|   308k|{
  474|   308k|  IA_ERRORCODE error_code = IA_NO_ERROR;
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  475|   308k|  WORD32 grouped_sfb_offset[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_GROUPED_SCALE_FACTOR_BAND +
  476|   308k|                                                       1]; /* plus one for last dummy offset ! */
  477|   308k|  FLOAT32 grouped_sfb_min_snr[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  478|   308k|  WORD32 max_sfb_per_grp[IXHEAACE_MAX_CH_IN_BS_ELE] = {0};
  479|   308k|  WORD32 ch, sfb, line;
  480|   308k|  WORD32 num_channels = pstr_elem_info->n_channels_in_el;
  481|       |
  482|   308k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   616k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   557k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (482:7): [True: 59.0k, False: 249k]
  |  Branch (482:28): [True: 125k, False: 123k]
  |  Branch (482:46): [True: 19.7k, False: 104k]
  ------------------
  483|   204k|    if (pstr_elem_info->el_type != ID_LFE) {
  ------------------
  |  Branch (483:9): [True: 191k, False: 13.1k]
  ------------------
  484|   472k|      for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (484:20): [True: 281k, False: 191k]
  ------------------
  485|   281k|        iaace_block_switching(&psy_data[ch]->blk_switch_cntrl,
  486|   281k|                              ptr_time_signal + pstr_elem_info->channel_index[ch], frame_len_long,
  487|   281k|                              num_channels);
  488|   281k|      }
  489|   191k|    } else {
  490|  26.2k|      for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (490:20): [True: 13.1k, False: 13.1k]
  ------------------
  491|  13.1k|        psy_data[ch]->blk_switch_cntrl.win_seq = LONG_WINDOW;
  ------------------
  |  |   31|  13.1k|#define LONG_WINDOW 0
  ------------------
  492|  13.1k|      }
  493|  13.1k|    }
  494|       |
  495|       |    /* synch left and right block type */
  496|   204k|    if (num_channels == NUM_CHANS_MONO) {
  ------------------
  |  |  113|   204k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (496:9): [True: 114k, False: 90.0k]
  ------------------
  497|   114k|      iaace_sync_block_switching(&psy_data[0]->blk_switch_cntrl, NULL, num_channels);
  498|   114k|    }
  499|  90.0k|    else {
  500|  90.0k|      iaace_sync_block_switching(&psy_data[0]->blk_switch_cntrl, &psy_data[1]->blk_switch_cntrl,
  501|  90.0k|                                 num_channels);
  502|  90.0k|    }
  503|   204k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   208k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  78.6k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (503:14): [True: 25.4k, False: 78.6k]
  |  Branch (503:35): [True: 78.6k, False: 0]
  ------------------
  504|   258k|    for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (504:18): [True: 154k, False: 104k]
  ------------------
  505|   154k|      psy_data[ch]->blk_switch_cntrl.win_seq_ld = LONG_WINDOW;
  ------------------
  |  |   31|   154k|#define LONG_WINDOW 0
  ------------------
  506|   154k|      psy_data[ch]->blk_switch_cntrl.next_win_seq_ld = LONG_WINDOW;
  ------------------
  |  |   31|   154k|#define LONG_WINDOW 0
  ------------------
  507|   154k|      psy_data[ch]->blk_switch_cntrl.win_seq = LONG_WINDOW;
  ------------------
  |  |   31|   154k|#define LONG_WINDOW 0
  ------------------
  508|   154k|      psy_data[ch]->blk_switch_cntrl.nxt_win_seq = LONG_WINDOW;
  ------------------
  |  |   31|   154k|#define LONG_WINDOW 0
  ------------------
  509|   154k|      psy_data[ch]->blk_switch_cntrl.total_groups_cnt = 1;
  510|   154k|    }
  511|   104k|  }
  512|       |  /* transform */
  513|   757k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (513:16): [True: 449k, False: 308k]
  ------------------
  514|   449k|    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   898k|#define AOT_AAC_LC (2)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   809k|#define AOT_SBR (5)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   174k|#define AOT_PS (29)
  ------------------
  |  Branch (514:9): [True: 89.1k, False: 360k]
  |  Branch (514:30): [True: 185k, False: 174k]
  |  Branch (514:48): [True: 19.7k, False: 154k]
  ------------------
  515|   294k|      ixheaace_transform_real_lc_ld(
  516|   294k|          psy_data[ch]->ptr_mdct_delay_buf, ptr_time_signal + pstr_elem_info->channel_index[ch],
  517|   294k|          time_sn_stride, psy_data[ch]->ptr_spec_coeffs, psy_data[ch]->blk_switch_cntrl.win_seq,
  518|   294k|          frame_len_long, ptr_shared_buffer5);
  519|   294k|    } else if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|   154k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (519:16): [True: 38.3k, False: 116k]
  ------------------
  520|  38.3k|      if (frame_len_long == FRAME_LEN_480) {
  ------------------
  |  |   93|  38.3k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (520:11): [True: 15.3k, False: 22.9k]
  ------------------
  521|  15.3k|        ia_enhaacplus_enc_transform_real(
  522|  15.3k|            psy_data[ch]->ptr_mdct_delay_buf, ptr_time_signal + pstr_elem_info->channel_index[ch],
  523|  15.3k|            time_sn_stride, psy_data[ch]->ptr_spec_coeffs, pstr_aac_tables->pstr_mdct_tab,
  524|  15.3k|            ptr_scratch_tns, ptr_shared_buffer5, frame_len_long);
  525|  22.9k|      } else {
  526|  22.9k|        ixheaace_transform_real_lc_ld(
  527|  22.9k|            psy_data[ch]->ptr_mdct_delay_buf, ptr_time_signal + pstr_elem_info->channel_index[ch],
  528|  22.9k|            time_sn_stride, psy_data[ch]->ptr_spec_coeffs, psy_data[ch]->blk_switch_cntrl.win_seq,
  529|  22.9k|            frame_len_long, ptr_shared_buffer5);
  530|  22.9k|      }
  531|   116k|    } else if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   116k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (531:16): [True: 116k, False: 0]
  ------------------
  532|   116k|      if (frame_len_long == FRAME_LEN_480) {
  ------------------
  |  |   93|   116k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (532:11): [True: 52.3k, False: 64.1k]
  ------------------
  533|  52.3k|        ia_enhaacplus_enc_transform_real(
  534|  52.3k|            psy_data[ch]->ptr_mdct_delay_buf, ptr_time_signal + pstr_elem_info->channel_index[ch],
  535|  52.3k|            time_sn_stride, psy_data[ch]->ptr_spec_coeffs, pstr_aac_tables->pstr_mdct_tab,
  536|  52.3k|            ptr_scratch_tns, ptr_shared_buffer5, frame_len_long);
  537|  64.1k|      } else {
  538|  64.1k|        ia_enhaacplus_enc_transform_real_eld(
  539|  64.1k|            psy_data[ch]->ptr_mdct_delay_buf, ptr_time_signal + pstr_elem_info->channel_index[ch],
  540|  64.1k|            time_sn_stride, psy_data[ch]->ptr_spec_coeffs, ptr_shared_buffer5, frame_len_long);
  541|  64.1k|      }
  542|   116k|    }
  543|   449k|  }
  544|       |
  545|   757k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (545:16): [True: 449k, False: 308k]
  ------------------
  546|   449k|    if (psy_data[ch]->blk_switch_cntrl.win_seq != SHORT_WINDOW) {
  ------------------
  |  |   33|   449k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (546:9): [True: 362k, False: 86.9k]
  ------------------
  547|   362k|      error_code = ia_enhaacplus_enc_advance_psy_long(
  548|   362k|          psy_data[ch], tns_data[ch], pstr_psy_conf_long, psy_out_ch[ch], ptr_scratch_tns,
  549|   362k|          tns_data[1 - ch], ch, aot, ptr_shared_buffer1, pstr_aac_tables, frame_len_long);
  550|       |
  551|   362k|      if (error_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   362k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (551:11): [True: 0, False: 362k]
  ------------------
  552|      0|        return error_code;
  553|      0|      }
  554|       |
  555|  5.69M|      for (sfb = pstr_psy_conf_long->sfb_cnt - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (555:51): [True: 5.61M, False: 75.3k]
  ------------------
  556|  5.61M|        for (line = pstr_psy_conf_long->sfb_offsets[sfb + 1] - 1;
  557|   171M|             line >= pstr_psy_conf_long->sfb_offsets[sfb]; line--) {
  ------------------
  |  Branch (557:14): [True: 166M, False: 5.33M]
  ------------------
  558|   166M|          if (psy_data[ch]->ptr_spec_coeffs[line] != 0) {
  ------------------
  |  Branch (558:15): [True: 286k, False: 165M]
  ------------------
  559|   286k|            break;
  560|   286k|          }
  561|   166M|        }
  562|  5.61M|        if (line >= pstr_psy_conf_long->sfb_offsets[sfb]) {
  ------------------
  |  Branch (562:13): [True: 286k, False: 5.33M]
  ------------------
  563|   286k|          break;
  564|   286k|        }
  565|  5.61M|      }
  566|       |
  567|   362k|      max_sfb_per_grp[ch] = sfb + 1;
  568|       |
  569|       |      /* Calculate bandwise energies for mid and side channels - only if 2 channels exist */
  570|   362k|      if (ch == 1) {
  ------------------
  |  Branch (570:11): [True: 104k, False: 257k]
  ------------------
  571|   104k|        ia_enhaacplus_enc_advance_psy_long_ms(psy_data, pstr_psy_conf_long);
  572|   104k|      }
  573|   362k|    } else {
  574|  86.9k|      error_code = ia_enhaacplus_enc_advance_psy_short(
  575|  86.9k|          psy_data[ch], tns_data[ch], pstr_psy_conf_short, psy_out_ch[ch], ptr_scratch_tns,
  576|  86.9k|          tns_data[1 - ch], ch, aot, ptr_shared_buffer1, pstr_aac_tables, frame_len_long / 8);
  577|       |
  578|  86.9k|      if (error_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  86.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (578:11): [True: 0, False: 86.9k]
  ------------------
  579|      0|        return error_code;
  580|      0|      }
  581|       |
  582|       |      /* Calculate bandwise energies for mid and side channels - only if 2 channels exist */
  583|  86.9k|      if (ch == 1) {
  ------------------
  |  Branch (583:11): [True: 35.8k, False: 51.1k]
  ------------------
  584|  35.8k|        ia_enhaacplus_enc_advance_psy_short_ms(psy_data, pstr_psy_conf_short, frame_len_long);
  585|  35.8k|      }
  586|  86.9k|    }
  587|   449k|  }
  588|       |
  589|       |  /* Group short data (max_sfb for short blocks is determined here) */
  590|   308k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   616k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   557k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (590:7): [True: 59.0k, False: 249k]
  |  Branch (590:28): [True: 125k, False: 123k]
  |  Branch (590:46): [True: 19.7k, False: 104k]
  ------------------
  591|   498k|    for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (591:18): [True: 294k, False: 204k]
  ------------------
  592|   294k|      if (psy_data[ch]->blk_switch_cntrl.win_seq == SHORT_WINDOW) {
  ------------------
  |  |   33|   294k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (592:11): [True: 86.9k, False: 207k]
  ------------------
  593|  86.9k|        iaace_group_short_data(psy_data[ch]->ptr_spec_coeffs, ptr_scratch_tns,
  594|  86.9k|                               &psy_data[ch]->sfb_threshold, &psy_data[ch]->sfb_energy,
  595|  86.9k|                               &psy_data[ch]->sfb_energy_ms, &psy_data[ch]->sfb_sreaded_energy,
  596|  86.9k|                               pstr_psy_conf_short->sfb_cnt, pstr_psy_conf_short->sfb_offsets,
  597|  86.9k|                               pstr_psy_conf_short->sfb_min_snr, grouped_sfb_offset[ch],
  598|  86.9k|                               &max_sfb_per_grp[ch], grouped_sfb_min_snr[ch],
  599|  86.9k|                               psy_data[ch]->blk_switch_cntrl.total_groups_cnt,
  600|  86.9k|                               psy_data[ch]->blk_switch_cntrl.group_len, frame_len_long);
  601|  86.9k|      }
  602|   294k|    }
  603|   204k|  }
  604|       |
  605|   308k|#if (IXHEAACE_MAX_CH_IN_BS_ELE > 1)
  606|       |  /* Stereo Processing */
  607|   308k|  if (num_channels == 2) {
  ------------------
  |  Branch (607:7): [True: 140k, False: 167k]
  ------------------
  608|   140k|    pstr_psy_out_element->tools_info.ms_digest = MS_NONE;
  609|       |
  610|   140k|    max_sfb_per_grp[0] = max_sfb_per_grp[1] = MAX(max_sfb_per_grp[0], max_sfb_per_grp[1]);
  ------------------
  |  |   24|   140k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 159, False: 140k]
  |  |  ------------------
  ------------------
  611|       |
  612|   140k|    if (psy_data[0]->blk_switch_cntrl.win_seq != SHORT_WINDOW) {
  ------------------
  |  |   33|   140k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (612:9): [True: 104k, False: 35.8k]
  ------------------
  613|   104k|      iaace_ms_apply(
  614|   104k|          psy_data, psy_data[0]->ptr_spec_coeffs, psy_data[1]->ptr_spec_coeffs,
  615|   104k|          &pstr_psy_out_element->tools_info.ms_digest, pstr_psy_out_element->tools_info.ms_mask,
  616|   104k|          pstr_psy_conf_long->sfb_cnt, pstr_psy_conf_long->sfb_cnt, max_sfb_per_grp[0],
  617|   104k|          pstr_psy_conf_long->sfb_offsets, &pstr_psy_out_element->weight_ms_lr_pe_ratio);
  618|   104k|    } else {
  619|  35.8k|      iaace_ms_apply(psy_data, psy_data[0]->ptr_spec_coeffs, psy_data[1]->ptr_spec_coeffs,
  620|  35.8k|                     &pstr_psy_out_element->tools_info.ms_digest,
  621|  35.8k|                     pstr_psy_out_element->tools_info.ms_mask,
  622|  35.8k|                     psy_data[0]->blk_switch_cntrl.total_groups_cnt *
  623|  35.8k|                     pstr_psy_conf_short->sfb_cnt,
  624|  35.8k|                     pstr_psy_conf_short->sfb_cnt, max_sfb_per_grp[0], grouped_sfb_offset[0],
  625|  35.8k|                     &pstr_psy_out_element->weight_ms_lr_pe_ratio);
  626|  35.8k|    }
  627|   140k|  }
  628|   308k|#endif
  629|       |
  630|       |  /* Build output */
  631|   308k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   616k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   557k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (631:7): [True: 59.0k, False: 249k]
  |  Branch (631:28): [True: 125k, False: 123k]
  |  Branch (631:46): [True: 19.7k, False: 104k]
  ------------------
  632|   498k|    for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (632:18): [True: 294k, False: 204k]
  ------------------
  633|   294k|      if (psy_data[ch]->blk_switch_cntrl.win_seq != SHORT_WINDOW) {
  ------------------
  |  |   33|   294k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (633:11): [True: 207k, False: 86.9k]
  ------------------
  634|   207k|        ia_enhaacplus_enc_build_interface(
  635|   207k|            psy_data[ch]->ptr_spec_coeffs, &psy_data[ch]->sfb_threshold,
  636|   207k|            &psy_data[ch]->sfb_energy,
  637|   207k|            &psy_data[ch]->sfb_sreaded_energy, psy_data[ch]->sfb_energy_sum,
  638|   207k|            psy_data[ch]->sfb_energy_sum_ms, psy_data[ch]->blk_switch_cntrl.win_seq,
  639|   207k|            ia_enhaacplus_enc_block_type_to_window_shape_lc[psy_data[ch]
  640|   207k|                                                                ->blk_switch_cntrl.win_seq],
  641|   207k|            pstr_psy_conf_long->sfb_cnt, pstr_psy_conf_long->sfb_offsets, max_sfb_per_grp[ch],
  642|   207k|            pstr_psy_conf_long->sfb_min_snr, psy_data[ch]->blk_switch_cntrl.total_groups_cnt,
  643|   207k|            psy_data[ch]->blk_switch_cntrl.group_len, psy_out_ch[ch]);
  644|   207k|      } else {
  645|  86.9k|        ia_enhaacplus_enc_build_interface(
  646|  86.9k|            psy_data[ch]->ptr_spec_coeffs, &psy_data[ch]->sfb_threshold,
  647|  86.9k|            &psy_data[ch]->sfb_energy,
  648|  86.9k|            &psy_data[ch]->sfb_sreaded_energy, psy_data[ch]->sfb_energy_sum,
  649|  86.9k|            psy_data[ch]->sfb_energy_sum_ms, SHORT_WINDOW, SINE_WINDOW,
  ------------------
  |  |   33|  86.9k|#define SHORT_WINDOW 2
  ------------------
                          psy_data[ch]->sfb_energy_sum_ms, SHORT_WINDOW, SINE_WINDOW,
  ------------------
  |  |   37|  86.9k|#define SINE_WINDOW 0
  ------------------
  650|  86.9k|            psy_data[ch]->blk_switch_cntrl.total_groups_cnt * pstr_psy_conf_short->sfb_cnt,
  651|  86.9k|            grouped_sfb_offset[ch], max_sfb_per_grp[ch], grouped_sfb_min_snr[ch],
  652|  86.9k|            psy_data[ch]->blk_switch_cntrl.total_groups_cnt,
  653|  86.9k|            psy_data[ch]->blk_switch_cntrl.group_len, psy_out_ch[ch]);
  654|  86.9k|      }
  655|   294k|    }
  656|   204k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   208k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  78.6k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (656:14): [True: 25.4k, False: 78.6k]
  |  Branch (656:35): [True: 78.6k, False: 0]
  ------------------
  657|   258k|    for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (657:18): [True: 154k, False: 104k]
  ------------------
  658|   154k|      ia_enhaacplus_enc_build_interface(
  659|   154k|          psy_data[ch]->ptr_spec_coeffs, &psy_data[ch]->sfb_threshold, &psy_data[ch]->sfb_energy,
  660|   154k|          &psy_data[ch]->sfb_sreaded_energy, psy_data[ch]->sfb_energy_sum,
  661|   154k|          psy_data[ch]->sfb_energy_sum_ms, LONG_WINDOW,
  ------------------
  |  |   31|   154k|#define LONG_WINDOW 0
  ------------------
  662|   154k|          ia_enhaacplus_enc_block_type_to_window_shape_ld[psy_data[ch]
  663|   154k|                                                              ->blk_switch_cntrl.win_seq_ld],
  664|   154k|          ((aot == AOT_AAC_ELD) ? pstr_psy_conf_long->sfb_active : pstr_psy_conf_long->sfb_cnt),
  ------------------
  |  |   37|   154k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (664:12): [True: 116k, False: 38.3k]
  ------------------
  665|   154k|          pstr_psy_conf_long->sfb_offsets, max_sfb_per_grp[ch], pstr_psy_conf_long->sfb_min_snr,
  666|   154k|          psy_data[ch]->blk_switch_cntrl.total_groups_cnt,
  667|   154k|          psy_data[ch]->blk_switch_cntrl.group_len, psy_out_ch[ch]);
  668|   154k|    }
  669|   104k|  }
  670|   308k|  return error_code;
  671|   308k|}
ixheaace_psy_mod.c:ia_enhaacplus_enc_advance_psy_long:
  319|   362k|    FLOAT32 *ptr_shared_buffer1, ixheaace_aac_tables *pstr_aac_tables, WORD32 frame_len_long) {
  320|   362k|  WORD32 i;
  321|   362k|  IA_ERRORCODE error_code = IA_NO_ERROR;
  ------------------
  |  |   23|   362k|#define IA_NO_ERROR 0x00000000
  ------------------
  322|   362k|  FLOAT32 energy_shift = 0.25f;
  323|   362k|  FLOAT32 clip_energy = pstr_psy_conf_long->clip_energy / 4;
  324|   362k|  FLOAT32 *ptr_sfb_energy_long = pstr_psy_data->sfb_energy.long_nrg;
  325|   362k|  FLOAT32 *ptr_sfb_spreaded_energy = pstr_psy_data->sfb_sreaded_energy.long_nrg;
  326|       |
  327|       |  /* Low pass */
  328|   362k|  memset(&pstr_psy_data->ptr_spec_coeffs[pstr_psy_conf_long->lowpass_line], 0,
  329|   362k|         sizeof(*pstr_psy_data->ptr_spec_coeffs) *
  330|   362k|             (frame_len_long - pstr_psy_conf_long->lowpass_line));
  331|       |
  332|       |  /* Calculate scale_factor_band - bandwise MDCT-energies for left and right channels */
  333|   362k|  ia_enhaacplus_enc_calc_band_energy(
  334|   362k|      pstr_psy_data->ptr_spec_coeffs, pstr_psy_conf_long->sfb_offsets,
  335|   362k|      pstr_psy_conf_long->sfb_active, pstr_psy_data->sfb_energy.long_nrg,
  336|   362k|      pstr_psy_conf_long->sfb_cnt, &pstr_psy_data->sfb_energy_sum.long_nrg);
  337|       |
  338|       |  /* TNS Detect */
  339|   362k|  error_code = ia_enhaacplus_enc_tns_detect(
  340|   362k|      pstr_tns_data, pstr_psy_conf_long->str_tns_conf, ptr_scratch_tns,
  341|   362k|      pstr_psy_conf_long->sfb_offsets, pstr_psy_data->ptr_spec_coeffs, 0,
  342|   362k|      pstr_psy_data->blk_switch_cntrl.win_seq, aot, pstr_psy_data->sfb_energy.long_nrg,
  343|   362k|      ptr_shared_buffer1, frame_len_long);
  344|       |
  345|   362k|  if (error_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   362k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (345:7): [True: 0, False: 362k]
  ------------------
  346|      0|    return error_code;
  347|      0|  }
  348|       |
  349|       |  /* TNS Sync */
  350|   362k|  if (ch == 1) {
  ------------------
  |  Branch (350:7): [True: 104k, False: 257k]
  ------------------
  351|   104k|    ia_enhaacplus_enc_tns_sync(pstr_tns_data, pstr_tns_data2, pstr_psy_conf_long->str_tns_conf, 0,
  352|   104k|                               (WORD32)pstr_psy_data->blk_switch_cntrl.win_seq);
  353|   104k|  }
  354|       |
  355|       |  /* TNS Encode */
  356|   362k|  ia_enhaacplus_enc_tns_encode(&pstr_psy_out_ch->tns_info, pstr_tns_data,
  357|   362k|                               pstr_psy_conf_long->sfb_cnt, pstr_psy_conf_long->str_tns_conf,
  358|   362k|                               pstr_psy_conf_long->lowpass_line, pstr_psy_data->ptr_spec_coeffs,
  359|   362k|                               0, (WORD32)pstr_psy_data->blk_switch_cntrl.win_seq,
  360|   362k|                               pstr_aac_tables->pstr_tns_tab);
  361|       |
  362|   362k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   362k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (362:7): [True: 116k, False: 245k]
  ------------------
  363|  2.82M|    for (i = 0; i < pstr_psy_conf_long->sfb_active; i++) {
  ------------------
  |  Branch (363:17): [True: 2.71M, False: 116k]
  ------------------
  364|  2.71M|      pstr_psy_data->sfb_threshold.long_nrg[i] =
  365|  2.71M|          pstr_psy_data->sfb_energy.long_nrg[i] * pstr_psy_conf_long->ratio_float;
  366|       |
  367|  2.71M|      pstr_psy_data->sfb_threshold.long_nrg[i] =
  368|  2.71M|          MIN(pstr_psy_data->sfb_threshold.long_nrg[i], clip_energy);
  ------------------
  |  |   23|  2.71M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.46M, False: 245k]
  |  |  ------------------
  ------------------
  369|  2.71M|    }
  370|   245k|  } else {
  371|  10.6M|    for (i = 0; i < pstr_psy_conf_long->sfb_cnt; i++) {
  ------------------
  |  Branch (371:17): [True: 10.3M, False: 245k]
  ------------------
  372|  10.3M|      pstr_psy_data->sfb_threshold.long_nrg[i] =
  373|  10.3M|          pstr_psy_data->sfb_energy.long_nrg[i] * pstr_psy_conf_long->ratio_float;
  374|       |
  375|  10.3M|      pstr_psy_data->sfb_threshold.long_nrg[i] =
  376|  10.3M|          MIN(pstr_psy_data->sfb_threshold.long_nrg[i], clip_energy);
  ------------------
  |  |   23|  10.3M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 9.39M, False: 975k]
  |  |  ------------------
  ------------------
  377|  10.3M|    }
  378|   245k|  }
  379|       |
  380|       |  /* Calculate scale factor band - bandwise MDCT-energies for left and right channel again, if TNS
  381|       |   * has modified the spectrum */
  382|   362k|  if (pstr_psy_out_ch->tns_info.tns_active[0] == 1) {
  ------------------
  |  Branch (382:7): [True: 176k, False: 185k]
  ------------------
  383|   176k|    ia_enhaacplus_enc_calc_band_energy(
  384|   176k|        pstr_psy_data->ptr_spec_coeffs, pstr_psy_conf_long->sfb_offsets,
  385|   176k|        pstr_psy_conf_long->sfb_active, pstr_psy_data->sfb_energy.long_nrg,
  386|   176k|        pstr_psy_conf_long->sfb_cnt, &pstr_psy_data->sfb_energy_sum.long_nrg);
  387|   176k|  }
  388|       |
  389|       |  /* Spreading */
  390|   362k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   362k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (390:7): [True: 116k, False: 245k]
  ------------------
  391|   116k|    ia_enhaacplus_enc_spreading_max(
  392|   116k|        pstr_psy_conf_long->sfb_active, pstr_psy_conf_long->sfb_mask_low_factor,
  393|   116k|        pstr_psy_conf_long->sfb_mask_high_factor, pstr_psy_data->sfb_threshold.long_nrg);
  394|   245k|  } else {
  395|   245k|    ia_enhaacplus_enc_spreading_max(
  396|   245k|        pstr_psy_conf_long->sfb_cnt, pstr_psy_conf_long->sfb_mask_low_factor,
  397|   245k|        pstr_psy_conf_long->sfb_mask_high_factor, pstr_psy_data->sfb_threshold.long_nrg);
  398|   245k|  }
  399|       |
  400|       |  /* Threshold in quiet */
  401|   362k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   362k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (401:7): [True: 116k, False: 245k]
  ------------------
  402|  2.82M|    for (i = 0; i < pstr_psy_conf_long->sfb_active; i++) {
  ------------------
  |  Branch (402:17): [True: 2.71M, False: 116k]
  ------------------
  403|  2.71M|      pstr_psy_data->sfb_threshold.long_nrg[i] =
  404|  2.71M|          MAX(pstr_psy_data->sfb_threshold.long_nrg[i],
  ------------------
  |  |   24|  2.71M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.86M, False: 852k]
  |  |  ------------------
  ------------------
  405|  2.71M|              (pstr_psy_conf_long->sfb_threshold_quiet[i] * energy_shift));
  406|  2.71M|    }
  407|   245k|  } else {
  408|  10.6M|    for (i = 0; i < pstr_psy_conf_long->sfb_cnt; i++) {
  ------------------
  |  Branch (408:17): [True: 10.3M, False: 245k]
  ------------------
  409|  10.3M|      pstr_psy_data->sfb_threshold.long_nrg[i] =
  410|  10.3M|          MAX(pstr_psy_data->sfb_threshold.long_nrg[i],
  ------------------
  |  |   24|  10.3M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 4.31M, False: 6.05M]
  |  |  ------------------
  ------------------
  411|  10.3M|              (pstr_psy_conf_long->sfb_threshold_quiet[i] * energy_shift));
  412|  10.3M|    }
  413|   245k|  }
  414|       |
  415|       |  /* Pre-echo control */
  416|   362k|  if (pstr_psy_data->blk_switch_cntrl.win_seq == STOP_WINDOW) {
  ------------------
  |  |   34|   362k|#define STOP_WINDOW 3
  ------------------
  |  Branch (416:7): [True: 18.3k, False: 343k]
  ------------------
  417|       |    /* Prevent pre-echo control from comparing stop thresholds with short thresholds */
  418|   831k|    for (i = 0; i < pstr_psy_conf_long->sfb_cnt; i++) {
  ------------------
  |  Branch (418:17): [True: 812k, False: 18.3k]
  ------------------
  419|   812k|      pstr_psy_data->sfb_threshold_nm1_float[i] = 1.0e20f;
  420|   812k|    }
  421|  18.3k|  }
  422|       |
  423|   362k|  ia_enhaacplus_enc_pre_echo_control(
  424|   362k|      pstr_psy_data->sfb_threshold_nm1_float, pstr_psy_conf_long->sfb_cnt,
  425|   362k|      pstr_psy_conf_long->min_remaining_threshold_factor, pstr_psy_data->sfb_threshold.long_nrg);
  426|       |
  427|   362k|  if (pstr_psy_data->blk_switch_cntrl.win_seq == START_WINDOW) {
  ------------------
  |  |   32|   362k|#define START_WINDOW 1
  ------------------
  |  Branch (427:7): [True: 20.6k, False: 341k]
  ------------------
  428|       |    /* Prevent pre-echo control in next frame from comparing start thresholds with short
  429|       |     * thresholds */
  430|   934k|    for (i = 0; i < pstr_psy_conf_long->sfb_cnt; i++) {
  ------------------
  |  Branch (430:17): [True: 913k, False: 20.6k]
  ------------------
  431|   913k|      pstr_psy_data->sfb_threshold_nm1_float[i] = 1.0e20f;
  432|   913k|    }
  433|  20.6k|  }
  434|       |
  435|       |  /* Apply TNS mult table on CB thresholds */
  436|   362k|  if (pstr_psy_out_ch->tns_info.tns_active[0]) {
  ------------------
  |  Branch (436:7): [True: 176k, False: 185k]
  ------------------
  437|   176k|    ia_enhaacplus_enc_apply_tns_mult_table_to_ratios(
  438|   176k|        pstr_psy_conf_long->str_tns_conf.tns_ratio_patch_lowest_cb,
  439|   176k|        pstr_psy_conf_long->str_tns_conf.tns_start_band, pstr_psy_data->sfb_threshold.long_nrg);
  440|   176k|  }
  441|       |
  442|       |  /* Spreaded energy for avoid hole detection */
  443|       |
  444|   362k|  memcpy(&ptr_sfb_spreaded_energy[0], &ptr_sfb_energy_long[0],
  445|   362k|         sizeof(ptr_sfb_spreaded_energy[0]) * pstr_psy_conf_long->sfb_cnt);
  446|       |
  447|   362k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   362k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (447:7): [True: 116k, False: 245k]
  ------------------
  448|   116k|    ia_enhaacplus_enc_spreading_max(pstr_psy_conf_long->sfb_active,
  449|   116k|                                    pstr_psy_conf_long->sfb_mask_low_factor_spread_nrg,
  450|   116k|                                    pstr_psy_conf_long->sfb_mask_high_factor_spread_nrg,
  451|   116k|                                    pstr_psy_data->sfb_sreaded_energy.long_nrg);
  452|   245k|  } else {
  453|   245k|    ia_enhaacplus_enc_spreading_max(pstr_psy_conf_long->sfb_cnt,
  454|   245k|                                    pstr_psy_conf_long->sfb_mask_low_factor_spread_nrg,
  455|   245k|                                    pstr_psy_conf_long->sfb_mask_high_factor_spread_nrg,
  456|   245k|                                    pstr_psy_data->sfb_sreaded_energy.long_nrg);
  457|   245k|  }
  458|       |
  459|   362k|  return error_code;
  460|   362k|}
ixheaace_psy_mod.c:ia_enhaacplus_enc_advance_psy_long_ms:
  178|   104k|    ixheaace_psy_configuration_long *pstr_psy_conf_long) {
  179|   104k|  ia_enhaacplus_enc_calc_band_energy_ms(
  180|   104k|      psy_data[0]->ptr_spec_coeffs, psy_data[1]->ptr_spec_coeffs, pstr_psy_conf_long->sfb_offsets,
  181|   104k|      pstr_psy_conf_long->sfb_active, pstr_psy_conf_long->sfb_cnt,
  182|   104k|      psy_data[0]->sfb_energy_ms.long_nrg, &psy_data[0]->sfb_energy_sum_ms.long_nrg,
  183|   104k|      psy_data[1]->sfb_energy_ms.long_nrg, &psy_data[1]->sfb_energy_sum_ms.long_nrg);
  184|   104k|}
ixheaace_psy_mod.c:ia_enhaacplus_enc_advance_psy_short:
  212|  86.9k|    FLOAT32 *ptr_shared_buffer1, ixheaace_aac_tables *pstr_aac_tables, WORD32 frame_len_long) {
  213|  86.9k|  IA_ERRORCODE error_code = IA_NO_ERROR;
  ------------------
  |  |   23|  86.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  214|  86.9k|  WORD32 w;
  215|  86.9k|  FLOAT32 energy_shift = 0.25f;
  216|  86.9k|  FLOAT32 clip_energy = pstr_psy_conf_short->clip_energy * energy_shift;
  217|       |
  218|   782k|  for (w = 0; w < TRANS_FAC; w++) {
  ------------------
  |  |   29|   782k|#define TRANS_FAC 8
  ------------------
  |  Branch (218:15): [True: 695k, False: 86.9k]
  ------------------
  219|   695k|    WORD32 w_offset = w * frame_len_long;
  220|   695k|    WORD32 i, offset;
  221|   695k|    FLOAT32 *ptr_mdct =
  222|   695k|        &pstr_psy_data->ptr_spec_coeffs[pstr_psy_conf_short->lowpass_line + w_offset];
  223|       |
  224|       |    /* Low pass */
  225|   695k|    offset = frame_len_long - pstr_psy_conf_short->lowpass_line;
  226|   695k|    memset(ptr_mdct, 0, sizeof(FLOAT32) * offset);
  227|       |
  228|       |    /* Calc sfb-bandwise MDCT-energies for left and right channel */
  229|   695k|    ia_enhaacplus_enc_calc_band_energy(
  230|   695k|        pstr_psy_data->ptr_spec_coeffs + w_offset, pstr_psy_conf_short->sfb_offsets,
  231|   695k|        pstr_psy_conf_short->sfb_active, pstr_psy_data->sfb_energy.short_nrg[w],
  232|   695k|        pstr_psy_conf_short->sfb_cnt, &pstr_psy_data->sfb_energy_sum.short_nrg[w]);
  233|       |
  234|       |    /* TNS Detect*/
  235|   695k|    error_code = ia_enhaacplus_enc_tns_detect(
  236|   695k|        pstr_tns_data, pstr_psy_conf_short->str_tns_conf, ptr_tns_scratch,
  237|   695k|        pstr_psy_conf_short->sfb_offsets, pstr_psy_data->ptr_spec_coeffs + w_offset, w,
  238|   695k|        pstr_psy_data->blk_switch_cntrl.win_seq, aot, pstr_psy_data->sfb_energy.short_nrg[w],
  239|   695k|        ptr_shared_buffer1, frame_len_long);
  240|       |
  241|   695k|    if (error_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   695k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (241:9): [True: 0, False: 695k]
  ------------------
  242|      0|      return error_code;
  243|      0|    }
  244|       |
  245|       |    /*  TNS Sync */
  246|   695k|    if (ch == 1) {
  ------------------
  |  Branch (246:9): [True: 286k, False: 408k]
  ------------------
  247|   286k|      ia_enhaacplus_enc_tns_sync(pstr_tns_data, ptr_tns_data2, pstr_psy_conf_short->str_tns_conf,
  248|   286k|                                 w, (WORD32)pstr_psy_data->blk_switch_cntrl.win_seq);
  249|   286k|    }
  250|       |
  251|       |    /* TNS Encode */
  252|   695k|    ia_enhaacplus_enc_tns_encode(
  253|   695k|        &pstr_psy_out_ch->tns_info, pstr_tns_data, pstr_psy_conf_short->sfb_cnt,
  254|   695k|        pstr_psy_conf_short->str_tns_conf, pstr_psy_conf_short->lowpass_line,
  255|   695k|        pstr_psy_data->ptr_spec_coeffs + w_offset, w, pstr_psy_data->blk_switch_cntrl.win_seq,
  256|   695k|        pstr_aac_tables->pstr_tns_tab);
  257|       |
  258|  10.8M|    for (i = 0; i < pstr_psy_conf_short->sfb_cnt; i++) {
  ------------------
  |  Branch (258:17): [True: 10.1M, False: 695k]
  ------------------
  259|  10.1M|      pstr_psy_data->sfb_threshold.short_nrg[w][i] =
  260|  10.1M|          pstr_psy_data->sfb_energy.short_nrg[w][i] * pstr_psy_conf_short->ratio_float;
  261|       |
  262|  10.1M|      pstr_psy_data->sfb_threshold.short_nrg[w][i] =
  263|  10.1M|          MIN(pstr_psy_data->sfb_threshold.short_nrg[w][i], clip_energy);
  ------------------
  |  |   23|  10.1M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 8.33M, False: 1.80M]
  |  |  ------------------
  ------------------
  264|  10.1M|    }
  265|       |
  266|       |    /* Calc sfb-bandwise MDCT-energies for left and right channel again, if TNS has modified the
  267|       |     * spectrum */
  268|   695k|    if (pstr_psy_out_ch->tns_info.tns_active[w]) {
  ------------------
  |  Branch (268:9): [True: 169k, False: 525k]
  ------------------
  269|   169k|      ia_enhaacplus_enc_calc_band_energy(
  270|   169k|          pstr_psy_data->ptr_spec_coeffs + w_offset, pstr_psy_conf_short->sfb_offsets,
  271|   169k|          pstr_psy_conf_short->sfb_active, pstr_psy_data->sfb_energy.short_nrg[w],
  272|   169k|          pstr_psy_conf_short->sfb_cnt, &pstr_psy_data->sfb_energy_sum.short_nrg[w]);
  273|   169k|    }
  274|       |
  275|       |    /* Spreading */
  276|   695k|    ia_enhaacplus_enc_spreading_max(
  277|   695k|        pstr_psy_conf_short->sfb_cnt, pstr_psy_conf_short->sfb_mask_low_factor,
  278|   695k|        pstr_psy_conf_short->sfb_mask_high_factor, pstr_psy_data->sfb_threshold.short_nrg[w]);
  279|       |
  280|  10.8M|    for (i = 0; i < pstr_psy_conf_short->sfb_cnt; i++) {
  ------------------
  |  Branch (280:17): [True: 10.1M, False: 695k]
  ------------------
  281|  10.1M|      pstr_psy_data->sfb_threshold.short_nrg[w][i] =
  282|  10.1M|          MAX(pstr_psy_data->sfb_threshold.short_nrg[w][i],
  ------------------
  |  |   24|  10.1M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 4.34M, False: 5.79M]
  |  |  ------------------
  ------------------
  283|  10.1M|              (pstr_psy_conf_short->sfb_threshold_quiet[i] * energy_shift));
  284|  10.1M|    }
  285|       |
  286|       |    /* Pre-echo Control */
  287|   695k|    ia_enhaacplus_enc_pre_echo_control(pstr_psy_data->sfb_threshold_nm1_float,
  288|   695k|                                       pstr_psy_conf_short->sfb_cnt,
  289|   695k|                                       pstr_psy_conf_short->min_remaining_threshold_factor,
  290|   695k|                                       pstr_psy_data->sfb_threshold.short_nrg[w]);
  291|       |
  292|       |    /* Apply TNS mult table on CB thresholds */
  293|   695k|    if (pstr_psy_out_ch->tns_info.tns_active[w]) {
  ------------------
  |  Branch (293:9): [True: 169k, False: 525k]
  ------------------
  294|   169k|      ia_enhaacplus_enc_apply_tns_mult_table_to_ratios(
  295|   169k|          pstr_psy_conf_short->str_tns_conf.tns_ratio_patch_lowest_cb,
  296|   169k|          pstr_psy_conf_short->str_tns_conf.tns_start_band,
  297|   169k|          pstr_psy_data->sfb_threshold.short_nrg[w]);
  298|   169k|    }
  299|       |
  300|       |    /* Spreaded energy for avoid hole detection */
  301|  10.8M|    for (i = 0; i < pstr_psy_conf_short->sfb_cnt; i++) {
  ------------------
  |  Branch (301:17): [True: 10.1M, False: 695k]
  ------------------
  302|  10.1M|      pstr_psy_data->sfb_sreaded_energy.short_nrg[w][i] =
  303|  10.1M|          pstr_psy_data->sfb_energy.short_nrg[w][i];
  304|  10.1M|    }
  305|       |
  306|   695k|    ia_enhaacplus_enc_spreading_max(pstr_psy_conf_short->sfb_cnt,
  307|   695k|                                    pstr_psy_conf_short->sfb_mask_low_factor_spread_nrg,
  308|   695k|                                    pstr_psy_conf_short->sfb_mask_high_factor_spread_nrg,
  309|   695k|                                    pstr_psy_data->sfb_sreaded_energy.short_nrg[w]);
  310|   695k|  }
  311|  86.9k|  return error_code;
  312|  86.9k|}
ixheaace_psy_mod.c:ia_enhaacplus_enc_advance_psy_short_ms:
  188|  35.8k|    ixheaace_psy_configuration_short *pstr_psy_conf_short, WORD32 ccfl) {
  189|  35.8k|  WORD32 w;
  190|  35.8k|  WORD32 frame_len_short = FRAME_LEN_SHORT_128;
  ------------------
  |  |   30|  35.8k|#define FRAME_LEN_SHORT_128 (128)
  ------------------
  191|       |
  192|  35.8k|  if (ccfl == FRAME_LEN_960) {
  ------------------
  |  |   94|  35.8k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (192:7): [True: 15.9k, False: 19.8k]
  ------------------
  193|  15.9k|    frame_len_short = FRAME_LEN_SHORT_120;
  ------------------
  |  |   31|  15.9k|#define FRAME_LEN_SHORT_120 (120)
  ------------------
  194|  15.9k|  }
  195|   322k|  for (w = 0; w < TRANS_FAC; w++) {
  ------------------
  |  |   29|   322k|#define TRANS_FAC 8
  ------------------
  |  Branch (195:15): [True: 286k, False: 35.8k]
  ------------------
  196|   286k|    WORD32 w_offset = w * frame_len_short;
  197|       |
  198|   286k|    ia_enhaacplus_enc_calc_band_energy_ms(
  199|   286k|        psy_data[0]->ptr_spec_coeffs + w_offset, psy_data[1]->ptr_spec_coeffs + w_offset,
  200|   286k|        pstr_psy_conf_short->sfb_offsets, pstr_psy_conf_short->sfb_active,
  201|   286k|        pstr_psy_conf_short->sfb_cnt, psy_data[0]->sfb_energy_ms.short_nrg[w],
  202|   286k|        &psy_data[0]->sfb_energy_sum_ms.short_nrg[w], psy_data[1]->sfb_energy_ms.short_nrg[w],
  203|   286k|        &psy_data[1]->sfb_energy_sum_ms.short_nrg[w]);
  204|   286k|  }
  205|  35.8k|}

ia_enhaacplus_enc_init_pre_echo_control:
   32|  6.95k|                                             FLOAT32 *ptr_pb_threshold_quiet) {
   33|  6.95k|  memcpy(ptr_pb_threshold_nm1, ptr_pb_threshold_quiet, num_pb * sizeof(*ptr_pb_threshold_nm1));
   34|  6.95k|}
ia_enhaacplus_enc_pre_echo_control:
   37|  1.05M|                                        FLOAT32 min_rem_thr_factor, FLOAT32 *ptr_threshold) {
   38|  1.05M|  WORD32 i;
   39|  1.05M|  FLOAT32 tmp_threshold1, tmp_threshold2;
   40|  1.05M|  FLOAT32 *ptr_tmp_threshold = &ptr_threshold[0];
   41|  1.05M|  FLOAT32 *ptr_tmp_threshold_nm1 = &ptr_threshold_nm1[0];
   42|       |
   43|  25.1M|  for (i = num_sfb - 1; i >= 0; i--) {
  ------------------
  |  Branch (43:25): [True: 24.0M, False: 1.05M]
  ------------------
   44|  24.0M|    FLOAT32 tmp_var;
   45|       |
   46|  24.0M|    tmp_var = *ptr_tmp_threshold;
   47|       |
   48|  24.0M|    tmp_threshold1 = *ptr_tmp_threshold_nm1 * 2.0f;
   49|       |
   50|  24.0M|    tmp_threshold2 = (min_rem_thr_factor * tmp_var);
   51|       |
   52|       |    /* copy thresholds to internal memory */
   53|  24.0M|    *ptr_tmp_threshold_nm1++ = tmp_var;
   54|       |
   55|  24.0M|    tmp_var = MIN(tmp_var, tmp_threshold1);
  ------------------
  |  |   23|  24.0M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 20.8M, False: 3.24M]
  |  |  ------------------
  ------------------
   56|       |
   57|  24.0M|    tmp_var = MAX(tmp_var, tmp_threshold2);
  ------------------
  |  |   24|  24.0M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 22.2M, False: 1.79M]
  |  |  ------------------
  ------------------
   58|  24.0M|    *ptr_tmp_threshold++ = tmp_var;
   59|  24.0M|  }
   60|  1.05M|}

ia_enhaacplus_enc_spreading_max:
   29|  2.11M|                                     FLOAT32 *ptr_spreaded_energy) {
   30|  2.11M|  WORD32 i;
   31|  2.11M|  FLOAT32 temp;
   32|  2.11M|  const FLOAT32 *ptr_mask_low = &ptr_mask_low_factor[sfb_active - 2];
   33|  2.11M|  const FLOAT32 *ptr_mask_high = &ptr_mask_high_factor[1];
   34|  2.11M|  FLOAT32 temp_nrg = ptr_spreaded_energy[0];
   35|  2.11M|  FLOAT32 *ptr_spreaded_temp = ptr_spreaded_energy;
   36|       |
   37|  46.4M|  for (i = sfb_active - 2; i >= 0; i--) {
  ------------------
  |  Branch (37:28): [True: 44.3M, False: 2.11M]
  ------------------
   38|  44.3M|    FLOAT32 temp_mask = *ptr_mask_high++;
   39|  44.3M|    temp = (temp_mask * temp_nrg);
   40|  44.3M|    temp_nrg = *++ptr_spreaded_temp;
   41|  44.3M|    if (temp_nrg < temp) {
  ------------------
  |  Branch (41:9): [True: 10.5M, False: 33.8M]
  ------------------
   42|  10.5M|      *ptr_spreaded_temp = temp;
   43|  10.5M|      temp_nrg = temp;
   44|  10.5M|    }
   45|  44.3M|  }
   46|       |
   47|  2.11M|  temp_nrg = ptr_spreaded_energy[sfb_active - 1];
   48|       |
   49|  46.4M|  for (i = sfb_active - 2; i >= 0; i--) {
  ------------------
  |  Branch (49:28): [True: 44.3M, False: 2.11M]
  ------------------
   50|  44.3M|    FLOAT32 temp_mask = *ptr_mask_low--;
   51|  44.3M|    temp = (temp_mask * temp_nrg);
   52|  44.3M|    temp_nrg = ptr_spreaded_energy[i];
   53|  44.3M|    if (temp_nrg < temp) {
  ------------------
  |  Branch (53:9): [True: 119k, False: 44.2M]
  ------------------
   54|   119k|      ptr_spreaded_energy[i] = temp;
   55|   119k|      temp_nrg = temp;
   56|   119k|    }
   57|  44.3M|  }
   58|  2.11M|}

ia_enhaacplus_enc_qc_main:
   77|   308k|    WORD32 *is_quant_spec_zero, WORD32 *is_gain_limited) {
   78|   308k|  IA_ERRORCODE err_code;
   79|   308k|  WORD32 ch;
   80|   308k|  WORD32 i = 0;
   81|   308k|  WORD32 k = 0;
   82|   308k|  WORD32 j = 0;
   83|   308k|  WORD32 iterations = 0;
   84|   308k|  WORD32 constraints_fulfilled;
   85|   308k|  WORD32 ch_dyn_bits;
   86|   308k|  WORD32 max_ch_dyn_bits[IXHEAACE_MAX_CH_IN_BS_ELE];
   87|   308k|  FLOAT32 ch_bit_dist[IXHEAACE_MAX_CH_IN_BS_ELE];
   88|   308k|  ixheaace_qc_stack *ptr_stack = (ixheaace_qc_stack *)ptr_scratch;
   89|   308k|  ptr_scratch += sizeof(ixheaace_qc_stack);
   90|       |
   91|   308k|  ia_adj_thr_elem_struct *pstr_adj_thr_elem = &pstr_qc_state->str_adj_thr.str_adj_thr_ele;
   92|   308k|  WORD32 gain;
   93|       |
   94|   308k|  if (pstr_el_bits->bit_res_level < 0) {
  ------------------
  |  Branch (94:7): [True: 278, False: 308k]
  ------------------
   95|    278|    return IA_EXHEAACE_EXE_FATAL_INVALID_BIT_RES_LEVEL;
   96|    278|  }
   97|       |
   98|   308k|  if (pstr_el_bits->bit_res_level > pstr_el_bits->max_bit_res_bits) {
  ------------------
  |  Branch (98:7): [True: 0, False: 308k]
  ------------------
   99|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_BIT_RES_LEVEL;
  100|      0|  }
  101|   308k|  pstr_qc_out_element->static_bits_used =
  102|   308k|      ia_enhaacplus_enc_count_static_bitdemand(psy_out_ch, pstr_psy_out_element, num_channels,
  103|   308k|                                               aot, adts_flag, stat_bits_flag, flag_last_element);
  104|       |
  105|   308k|  if (ancillary_data_bytes) {
  ------------------
  |  Branch (105:7): [True: 210k, False: 97.1k]
  ------------------
  106|   210k|    pstr_qc_out_element->anc_bits_used =
  107|   210k|        7 + 8 * (ancillary_data_bytes + (ancillary_data_bytes >= 15));
  108|   210k|  } else {
  109|  97.1k|    pstr_qc_out_element->anc_bits_used = 0;
  110|  97.1k|  }
  111|       |
  112|   757k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (112:16): [True: 448k, False: 308k]
  ------------------
  113|   448k|    iaace_calc_form_fac_per_chan(ptr_stack->sfb_form_fac[ch],
  114|   448k|                                 ptr_stack->sfb_num_relevant_lines[ch], psy_out_ch[ch],
  115|   448k|                                 ptr_stack->sfb_ld_energy[ch]);
  116|   448k|  }
  117|       |
  118|   308k|  iaace_adjust_threshold(
  119|   308k|      &pstr_qc_state->str_adj_thr, pstr_adj_thr_elem, psy_out_ch, ch_bit_dist,
  120|   308k|      pstr_qc_out_element,
  121|   308k|      pstr_el_bits->average_bits - pstr_qc_out_element->static_bits_used -
  122|   308k|          pstr_qc_out_element->anc_bits_used,
  123|   308k|      pstr_el_bits->bit_res_level, pstr_el_bits->max_bit_res_bits,
  124|   308k|      pstr_qc_out_element->static_bits_used + pstr_qc_out_element->anc_bits_used,
  125|   308k|      &pstr_qc_state->max_bit_fac, ptr_stack->sfb_num_relevant_lines[0],
  126|   308k|      ptr_stack->sfb_ld_energy[0], num_channels, 0, aot, ptr_scratch);
  127|       |
  128|   308k|  iaace_estimate_scfs_chan(psy_out_ch, pstr_qc_out_ch, ptr_stack->sfb_form_fac,
  129|   308k|                           ptr_stack->sfb_num_relevant_lines, num_channels, 0, frame_len_long);
  130|       |
  131|   757k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (131:16): [True: 448k, False: 308k]
  ------------------
  132|   448k|    max_ch_dyn_bits[ch] =
  133|   448k|        (pstr_el_bits->average_bits + pstr_el_bits->bit_res_level - 7 -
  134|   448k|         pstr_qc_out_element->static_bits_used - pstr_qc_out_element->anc_bits_used);
  135|       |
  136|   448k|    max_ch_dyn_bits[ch] = (WORD32)floor(ch_bit_dist[ch] * (FLOAT32)(max_ch_dyn_bits[ch]));
  137|   448k|  }
  138|       |
  139|   308k|  pstr_qc_out_element->dyn_bits_used = 0;
  140|       |
  141|   757k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (141:16): [True: 448k, False: 308k]
  ------------------
  142|       |    /* now loop until bitstream constraints (ch_dyn_bits < maxChDynBits)
  143|       |       are fulfilled */
  144|   448k|    WORD32 spec_idx, sfb_offs, sfb;
  145|   448k|    iterations = 0;
  146|   448k|    gain = 0;
  147|   371M|    for (spec_idx = 0; spec_idx < frame_len_long; spec_idx++) {
  ------------------
  |  Branch (147:24): [True: 370M, False: 448k]
  ------------------
  148|   370M|      ptr_stack->exp_spec[spec_idx] = (FLOAT32)psy_out_ch[ch]->ptr_spec_coeffs[spec_idx];
  149|   370M|      ptr_stack->mdct_spec_float[spec_idx] = (FLOAT32)psy_out_ch[ch]->ptr_spec_coeffs[spec_idx];
  150|   370M|    }
  151|   475k|    do {
  152|   475k|      WORD32 max_val;
  153|   475k|      constraints_fulfilled = 1;
  154|   475k|      WORD32 quant_spec_is_zero = 1;
  155|   475k|      if (iterations > 0) {
  ------------------
  |  Branch (155:11): [True: 26.8k, False: 448k]
  ------------------
  156|  74.1k|        for (sfb_offs = 0; sfb_offs < psy_out_ch[ch]->sfb_count;
  ------------------
  |  Branch (156:28): [True: 47.3k, False: 26.8k]
  ------------------
  157|  47.3k|             sfb_offs += psy_out_ch[ch]->sfb_per_group) {
  158|   867k|          for (sfb = 0; sfb < psy_out_ch[ch]->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (158:25): [True: 820k, False: 47.3k]
  ------------------
  159|   820k|            WORD32 scalefactor = pstr_qc_out_ch[ch]->scalefactor[sfb + sfb_offs];
  160|   820k|            gain = MAX(gain, pstr_qc_out_ch[ch]->global_gain - scalefactor);
  ------------------
  |  |   24|   820k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 291k, False: 528k]
  |  |  ------------------
  ------------------
  161|   820k|            iaace_quantize_lines(
  162|   820k|                pstr_qc_out_ch[ch]->global_gain - scalefactor,
  163|   820k|                psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb + 1] -
  164|   820k|                    psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb],
  165|   820k|                ptr_stack->exp_spec + psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb],
  166|   820k|                pstr_qc_out_ch[ch]->quant_spec + psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb],
  167|   820k|                ptr_stack->mdct_spec_float + psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb]);
  168|   820k|          }
  169|  47.3k|        }
  170|  26.8k|      }
  171|       |
  172|   475k|      max_val = iaace_calc_max_val_in_sfb(
  173|   475k|          psy_out_ch[ch]->sfb_count, psy_out_ch[ch]->max_sfb_per_grp,
  174|   475k|          psy_out_ch[ch]->sfb_per_group,
  175|   475k|          psy_out_ch[ch]->sfb_offsets, pstr_qc_out_ch[ch]->quant_spec,
  176|   475k|          pstr_qc_out_ch[ch]->max_val_in_sfb);
  177|       |
  178|   475k|      if (max_val > MAXIMUM_QUANT) {
  ------------------
  |  |   22|   475k|#define MAXIMUM_QUANT (8191)
  ------------------
  |  Branch (178:11): [True: 5.64k, False: 470k]
  ------------------
  179|  5.64k|        constraints_fulfilled = 0;
  180|  5.64k|      }
  181|       |
  182|  1.01M|      for (k = 0; ((k < psy_out_ch[ch]->sfb_count) && (quant_spec_is_zero));
  ------------------
  |  Branch (182:20): [True: 609k, False: 402k]
  |  Branch (182:55): [True: 536k, False: 73.0k]
  ------------------
  183|   536k|           k += psy_out_ch[ch]->sfb_per_group) {
  184|  3.96M|        for (i = 0; ((i < psy_out_ch[ch]->max_sfb_per_grp) && (quant_spec_is_zero)); i++) {
  ------------------
  |  Branch (184:22): [True: 3.73M, False: 227k]
  |  Branch (184:63): [True: 3.42M, False: 308k]
  ------------------
  185|  46.2M|          for (j = psy_out_ch[ch]->sfb_offsets[i+k]; j < psy_out_ch[ch]->sfb_offsets[i+k+1]; j++)
  ------------------
  |  Branch (185:54): [True: 43.1M, False: 3.11M]
  ------------------
  186|  43.1M|          {
  187|  43.1M|            if (pstr_qc_out_ch[ch]->quant_spec[j] != 0) {
  ------------------
  |  Branch (187:17): [True: 310k, False: 42.8M]
  ------------------
  188|   310k|              quant_spec_is_zero = 0;
  189|   310k|              break;
  190|   310k|            }
  191|  43.1M|          }
  192|  3.42M|        }
  193|   536k|      }
  194|   475k|      err_code = ia_enhaacplus_enc_dyn_bitcount(
  195|   475k|          pstr_qc_out_ch[ch]->quant_spec, pstr_qc_out_ch[ch]->max_val_in_sfb,
  196|   475k|          pstr_qc_out_ch[ch]->scalefactor, psy_out_ch[ch]->window_sequence,
  197|   475k|          psy_out_ch[ch]->sfb_count, psy_out_ch[ch]->max_sfb_per_grp,
  198|   475k|          psy_out_ch[ch]->sfb_per_group,
  199|   475k|          psy_out_ch[ch]->sfb_offsets, &pstr_qc_out_ch[ch]->section_data,
  200|   475k|          pstr_qc_state->side_info_tab_long, pstr_qc_state->side_info_tab_short,
  201|   475k|          pstr_aac_tables->pstr_huff_tab, pstr_qc_state->qc_scr.shared_buffer_2, aot,
  202|   475k|          &ch_dyn_bits);
  203|       |
  204|   475k|      if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   475k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (204:11): [True: 0, False: 475k]
  ------------------
  205|      0|        return err_code;
  206|      0|      }
  207|       |
  208|   475k|      if (ch_dyn_bits >= max_ch_dyn_bits[ch]) {
  ------------------
  |  Branch (208:11): [True: 21.2k, False: 454k]
  ------------------
  209|  21.2k|        constraints_fulfilled = 0;
  210|  21.2k|      }
  211|       |
  212|   475k|      if (quant_spec_is_zero == 1) {
  ------------------
  |  Branch (212:11): [True: 165k, False: 310k]
  ------------------
  213|   165k|        constraints_fulfilled = 1;
  214|       |        /*Bit consuption is exceding bit reservoir, there is no scope left for bit consumption
  215|       |          reduction, as spectrum is zero. Hence breaking the quantization loop. */
  216|   165k|        if (iterations > 0) {
  ------------------
  |  Branch (216:13): [True: 454, False: 164k]
  ------------------
  217|    454|          *is_quant_spec_zero = 1;
  218|    454|          ch_dyn_bits = max_ch_dyn_bits[ch];
  219|    454|        }
  220|   165k|      }
  221|   475k|      if ((gain == MAX_GAIN_INDEX) && (constraints_fulfilled == 0)) {
  ------------------
  |  |  120|   475k|#define MAX_GAIN_INDEX (128)
  ------------------
  |  Branch (221:11): [True: 0, False: 475k]
  |  Branch (221:39): [True: 0, False: 0]
  ------------------
  222|       |        /* Bit consuption is exceding bit reservoir, there is no scope left for bit consumption
  223|       |           reduction, as gain has reached the maximum value. Hence breaking the quantization
  224|       |           loop. */
  225|      0|        constraints_fulfilled = 1;
  226|      0|        *is_gain_limited = 1;
  227|      0|        ch_dyn_bits = max_ch_dyn_bits[ch];
  228|      0|      }
  229|   475k|      if (!constraints_fulfilled) {
  ------------------
  |  Branch (229:11): [True: 26.8k, False: 448k]
  ------------------
  230|  26.8k|        pstr_qc_out_ch[ch]->global_gain++;
  231|  26.8k|      }
  232|   475k|      iterations++;
  233|       |
  234|   475k|    } while (!constraints_fulfilled);
  ------------------
  |  Branch (234:14): [True: 26.8k, False: 448k]
  ------------------
  235|       |
  236|   448k|    pstr_qc_out_element->dyn_bits_used += ch_dyn_bits;
  237|       |
  238|   448k|    pstr_qc_out_ch[ch]->grouping_mask = psy_out_ch[ch]->grouping_mask;
  239|   448k|    pstr_qc_out_ch[ch]->win_shape = psy_out_ch[ch]->window_shape;
  240|   448k|  }
  241|       |
  242|   308k|  pstr_adj_thr_elem->dyn_bits_last = pstr_qc_out_element->dyn_bits_used;
  243|   308k|  {
  244|   308k|    WORD32 bit_res_space = pstr_el_bits->max_bit_res_bits - pstr_el_bits->bit_res_level;
  245|   308k|    WORD32 delta_bit_res = pstr_el_bits->average_bits - (pstr_qc_out_element->static_bits_used +
  246|   308k|                                                         pstr_qc_out_element->dyn_bits_used +
  247|   308k|                                                         pstr_qc_out_element->anc_bits_used);
  248|       |
  249|   308k|    pstr_qc_out_element->fill_bits = MAX(0, (delta_bit_res - bit_res_space));
  ------------------
  |  |   24|   308k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 160k, False: 147k]
  |  |  ------------------
  ------------------
  250|   308k|  }
  251|       |
  252|   308k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  253|   308k|}
iaace_calc_max_val_in_sfb:
  257|   475k|                                 UWORD16 *ptr_max_value) {
  258|   475k|  WORD32 sfb;
  259|   475k|  WORD32 max = 0;
  260|   475k|  WORD32 sfb_offs;
  261|       |
  262|  1.22M|  for (sfb_offs = 0; sfb_offs < sfb_count; sfb_offs += ptr_sfb_per_grp) {
  ------------------
  |  Branch (262:22): [True: 746k, False: 475k]
  ------------------
  263|  14.1M|    for (sfb = 0; sfb < max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (263:19): [True: 13.4M, False: 746k]
  ------------------
  264|  13.4M|      WORD32 line;
  265|  13.4M|      WORD32 local_max = 0;
  266|   201M|      for (line = ptr_sfb_offset[sfb + sfb_offs]; line < ptr_sfb_offset[sfb + sfb_offs + 1];
  ------------------
  |  Branch (266:51): [True: 188M, False: 13.4M]
  ------------------
  267|   188M|           line++) {
  268|   188M|        if (abs(ptr_quant_spec[line]) > local_max) {
  ------------------
  |  Branch (268:13): [True: 11.3M, False: 176M]
  ------------------
  269|  11.3M|          local_max = abs(ptr_quant_spec[line]);
  270|  11.3M|        }
  271|   188M|      }
  272|  13.4M|      ptr_max_value[sfb_offs + sfb] = (UWORD16)local_max;
  273|  13.4M|      if (local_max > max) {
  ------------------
  |  Branch (273:11): [True: 446k, False: 12.9M]
  ------------------
  274|   446k|        max = local_max;
  275|   446k|      }
  276|  13.4M|    }
  277|   746k|  }
  278|       |
  279|   475k|  return max;
  280|   475k|}

ia_enhaacplus_enc_qc_out_new:
  118|  4.74k|{
  119|  4.74k|  WORD32 i;
  120|       |
  121|  11.6k|  for (i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (121:15): [True: 6.95k, False: 4.74k]
  ------------------
  122|  6.95k|    pstr_qc_out->qc_channel[i]->quant_spec = &((WORD16 *)ptr_shared_buffer1)[i * long_frame_len];
  123|       |
  124|  6.95k|    memset(pstr_qc_out->qc_channel[i]->quant_spec, 0,
  125|  6.95k|           sizeof(*pstr_qc_out->qc_channel[i]->quant_spec) * long_frame_len);
  126|       |
  127|  6.95k|    pstr_qc_out->qc_channel[i]->max_val_in_sfb =
  128|  6.95k|        &((UWORD16 *)&ptr_shared_buffer3[(long_frame_len + long_frame_len / 2) +
  129|  6.95k|                                         IXHEAACE_MAX_CH_IN_BS_ELE *
  ------------------
  |  |   86|  6.95k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  130|  6.95k|                                             MAXIMUM_GROUPED_SCALE_FACTOR_BAND /
  ------------------
  |  |   73|  6.95k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 6.95k, Folded]
  |  |  ------------------
  |  |   74|  6.95k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  6.95k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  131|  6.95k|                                             2])[i * MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  ------------------
  |  |   73|  6.95k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 6.95k, Folded]
  |  |  ------------------
  |  |   74|  6.95k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  6.95k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  132|  6.95k|    memset(
  133|  6.95k|        pstr_qc_out->qc_channel[i]->max_val_in_sfb, 0,
  134|  6.95k|        sizeof(*pstr_qc_out->qc_channel[i]->max_val_in_sfb) * MAXIMUM_GROUPED_SCALE_FACTOR_BAND);
  ------------------
  |  |   73|  6.95k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 6.95k, Folded]
  |  |  ------------------
  |  |   74|  6.95k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  6.95k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  135|       |
  136|  6.95k|    pstr_qc_out->qc_channel[i]->scalefactor = &((WORD16 *)&ptr_shared_buffer3[(
  137|  6.95k|        long_frame_len + long_frame_len / 2)])[i * MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  ------------------
  |  |   73|  6.95k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 6.95k, Folded]
  |  |  ------------------
  |  |   74|  6.95k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  6.95k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  138|       |
  139|  6.95k|    memset(pstr_qc_out->qc_channel[i]->scalefactor, 0,
  140|  6.95k|           sizeof(*pstr_qc_out->qc_channel[i]->scalefactor) * MAXIMUM_GROUPED_SCALE_FACTOR_BAND);
  ------------------
  |  |   73|  6.95k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 6.95k, Folded]
  |  |  ------------------
  |  |   74|  6.95k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  6.95k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  6.95k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  6.95k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  141|  6.95k|  }
  142|       |
  143|  4.74k|  if (pstr_qc_out == NULL) {
  ------------------
  |  Branch (143:7): [True: 0, False: 4.74k]
  ------------------
  144|      0|    return IA_EXHEAACE_INIT_FATAL_AAC_INIT_FAILED;
  145|      0|  }
  146|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  147|  4.74k|}
ia_enhaacplus_enc_qc_new:
  151|  4.74k|) {
  152|  4.74k|  memset(pstr_qc_state, 0, sizeof(ixheaace_qc_state));
  153|  4.74k|  pstr_qc_state->qc_scr.shared_buffer_2 =
  154|  4.74k|      (ptr_shared_buffer_2 + long_frame_len * IXHEAACE_MAX_CH_IN_BS_ELE + 16);
  ------------------
  |  |   86|  4.74k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  155|       |
  156|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  157|  4.74k|}
ia_enhaacplus_enc_qc_init:
  160|  4.74k|                                       ixheaace_qc_init *pstr_init, FLAG flag_framelength_small) {
  161|  4.74k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  162|  4.74k|  pstr_qc_state->num_channels = pstr_init->pstr_element_info->n_channels_in_el;
  163|  4.74k|  pstr_qc_state->max_bits_tot = pstr_init->max_bits;
  164|  4.74k|  switch (aot) {
  ------------------
  |  Branch (164:11): [True: 4.74k, False: 0]
  ------------------
  165|  1.00k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.00k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (165:5): [True: 1.00k, False: 3.74k]
  ------------------
  166|  2.69k|    case AOT_SBR:
  ------------------
  |  |   35|  2.69k|#define AOT_SBR (5)
  ------------------
  |  Branch (166:5): [True: 1.69k, False: 3.04k]
  ------------------
  167|  2.94k|    case AOT_PS:
  ------------------
  |  |   39|  2.94k|#define AOT_PS (29)
  ------------------
  |  Branch (167:5): [True: 246, False: 4.49k]
  ------------------
  168|  2.94k|      pstr_qc_state->bit_res_tot = pstr_init->bit_res - pstr_init->average_bits;
  169|  2.94k|      break;
  170|       |
  171|    529|    case AOT_AAC_LD:
  ------------------
  |  |   36|    529|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (171:5): [True: 529, False: 4.21k]
  ------------------
  172|  1.80k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (172:5): [True: 1.27k, False: 3.47k]
  ------------------
  173|  1.80k|      if (pstr_init->bit_res) {
  ------------------
  |  Branch (173:11): [True: 1.18k, False: 616]
  ------------------
  174|  1.18k|        pstr_qc_state->bit_res_tot = pstr_init->bit_res - pstr_init->average_bits;
  175|  1.18k|      } else {
  176|    616|        pstr_qc_state->bit_res_tot = 0;
  177|    616|      }
  178|  1.80k|      break;
  179|  4.74k|  }
  180|  4.74k|  pstr_qc_state->average_bits_tot = pstr_init->average_bits;
  181|  4.74k|  pstr_qc_state->max_bit_fac = pstr_init->max_bit_fac;
  182|  4.74k|  pstr_qc_state->padding.padding_rest = pstr_init->padding.padding_rest;
  183|       |
  184|  4.74k|  pstr_qc_state->quality_level = pstr_init->inv_quant;
  185|  4.74k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  9.48k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  8.48k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.04k|#define AOT_PS (29)
  ------------------
  |  Branch (185:7): [True: 1.00k, False: 3.74k]
  |  Branch (185:28): [True: 1.69k, False: 2.04k]
  |  Branch (185:46): [True: 246, False: 1.80k]
  ------------------
  186|  2.94k|    pstr_qc_state->glob_stat_bits = 3; /* for ID_END */
  187|  2.94k|  }
  188|  4.74k|  error = ia_enhaacplus_enc_init_element_bits(
  189|  4.74k|      &pstr_qc_state->element_bits, *pstr_init->pstr_element_info, pstr_init->bitrate,
  190|  4.74k|      pstr_init->average_bits, aot, pstr_qc_state->glob_stat_bits, pstr_init->bit_res,
  191|  4.74k|      flag_framelength_small);
  192|       |
  193|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (193:7): [True: 0, False: 4.74k]
  ------------------
  194|      0|    return error;
  195|      0|  }
  196|  4.74k|  iaace_adj_thr_init(&pstr_qc_state->str_adj_thr, pstr_init->mean_pe,
  197|  4.74k|                     pstr_qc_state->element_bits.ch_bitrate, aot);
  198|       |
  199|  4.74k|  ia_enhaacplus_enc_bitcount_init((WORD32 *)pstr_qc_state->side_info_tab_long,
  200|  4.74k|                                  (WORD32 *)pstr_qc_state->side_info_tab_short);
  201|       |
  202|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  203|  4.74k|}
ia_enhaacplus_enc_update_bit_reservoir:
  208|   308k|{
  209|   308k|  ixheaace_element_bits *pstr_el_bits;
  210|       |
  211|   308k|  pstr_qc_kernel->bit_res_tot = 0;
  212|       |
  213|   308k|  pstr_el_bits = &pstr_qc_kernel->element_bits;
  214|       |
  215|   308k|  if (pstr_el_bits->average_bits > 0) {
  ------------------
  |  Branch (215:7): [True: 308k, False: 0]
  ------------------
  216|       |    /* constant bitrate */
  217|   308k|    pstr_el_bits->bit_res_level +=
  218|   308k|        pstr_el_bits->average_bits -
  219|   308k|        (pstr_qc_out->qc_element.static_bits_used + pstr_qc_out->qc_element.dyn_bits_used +
  220|   308k|         pstr_qc_out->qc_element.anc_bits_used + pstr_qc_out->qc_element.fill_bits);
  221|       |
  222|   308k|    pstr_qc_kernel->bit_res_tot += pstr_el_bits->bit_res_level;
  223|   308k|  } else {
  224|       |    /* variable bitrate */
  225|      0|    pstr_el_bits->bit_res_level = pstr_el_bits->max_bits;
  226|      0|    pstr_qc_kernel->bit_res_tot = pstr_qc_kernel->max_bits_tot;
  227|      0|  }
  228|   308k|}
ia_enhaacplus_enc_finalize_bit_consumption:
  235|   308k|                                                        WORD32 num_bs_elements, WORD32 aot) {
  236|   308k|  WORD32 n_full_fill_elem, diff_bits;
  237|   308k|  WORD32 total_fill_bits = 0;
  238|       |
  239|   308k|  const WORD32 max_fill_elem_bits = 7 + 270 * 8;
  240|   308k|  WORD32 tfb_flag = 0;
  241|   308k|  WORD32 tfb_flag1 = 0;
  242|   308k|  WORD32 tfb_flag2 = 0;
  243|       |
  244|   308k|  pstr_qc_out->tot_static_bits_used = (flag_last_element ? pstr_qc_kernel->glob_stat_bits : 0);
  ------------------
  |  Branch (244:40): [True: 146k, False: 161k]
  ------------------
  245|       |
  246|   308k|  pstr_qc_out->tot_dyn_bits_used = 0;
  247|   308k|  pstr_qc_out->tot_anc_bits_used = 0;
  248|   308k|  pstr_qc_out->total_fill_bits = 0;
  249|   308k|  pstr_qc_out->tot_static_bits_used += pstr_qc_out->qc_element.static_bits_used;
  250|   308k|  pstr_qc_out->tot_dyn_bits_used += pstr_qc_out->qc_element.dyn_bits_used;
  251|   308k|  pstr_qc_out->tot_anc_bits_used += pstr_qc_out->qc_element.anc_bits_used;
  252|   308k|  pstr_qc_out->total_fill_bits += pstr_qc_out->qc_element.fill_bits;
  253|       |
  254|       |  /* Accumulate total fill bits */
  255|   308k|  *tot_fill_bits += pstr_qc_out->qc_element.fill_bits;
  256|   308k|  if (flag_last_element) {
  ------------------
  |  Branch (256:7): [True: 146k, False: 161k]
  ------------------
  257|   146k|    WORD32 i, j, temp_resv;
  258|   146k|    WORD32 bit_resv_spc[(MAXIMUM_BS_ELE << 1) + 1];
  259|   146k|    WORD32 bit_resv_spc_sort[(MAXIMUM_BS_ELE << 1) + 1] = {0, 1,  2,  3,  4,  5,  6,  7, 8,
  260|   146k|                                                           9, 10, 11, 12, 13, 14, 15, 16};
  261|       |
  262|   146k|    total_fill_bits = *tot_fill_bits;
  263|       |
  264|       |    /* Distribute fill bits among all channel elements for next frame */
  265|   146k|    if (total_fill_bits > 0) {
  ------------------
  |  Branch (265:9): [True: 72.7k, False: 74.1k]
  ------------------
  266|       |      /* Generate array of vacancies in bit reservoirs */
  267|   222k|      for (i = 0, temp_resv = 0; i < num_bs_elements; i++, temp_resv++) {
  ------------------
  |  Branch (267:34): [True: 149k, False: 72.7k]
  ------------------
  268|   149k|        bit_resv_spc[temp_resv] = (pstr_aac_enc[i]->qc_kernel.element_bits.max_bit_res_bits -
  269|   149k|                                   pstr_aac_enc[i]->qc_kernel.element_bits.bit_res_level);
  270|       |
  271|       |        /* CPE gets double the weight of SCE, so split CPE reservoir into two */
  272|   149k|        if (pstr_aac_enc[i]->qc_kernel.num_channels == 2) {
  ------------------
  |  Branch (272:13): [True: 68.1k, False: 81.5k]
  ------------------
  273|  68.1k|          bit_resv_spc[temp_resv + 1] = bit_resv_spc[temp_resv] >> 1;
  274|  68.1k|          bit_resv_spc[temp_resv] -= bit_resv_spc[temp_resv + 1];
  275|  68.1k|          temp_resv++;
  276|  68.1k|        }
  277|   149k|      }
  278|       |
  279|       |      /* Sort bit_resv_spc[] in descending order of levels and
  280|       |      store the order in bit_resv_spc_sort[] */
  281|   217k|      for (i = (temp_resv - 1); i > 0; i--) {
  ------------------
  |  Branch (281:33): [True: 145k, False: 72.7k]
  ------------------
  282|   498k|        for (j = 0; j < i; j++) {
  ------------------
  |  Branch (282:21): [True: 353k, False: 145k]
  ------------------
  283|   353k|          if (bit_resv_spc[bit_resv_spc_sort[j]] < bit_resv_spc[bit_resv_spc_sort[j + 1]]) {
  ------------------
  |  Branch (283:15): [True: 29.6k, False: 323k]
  ------------------
  284|  29.6k|            WORD32 tmp_var = bit_resv_spc_sort[j];
  285|  29.6k|            bit_resv_spc_sort[j] = bit_resv_spc_sort[j + 1];
  286|  29.6k|            bit_resv_spc_sort[j + 1] = tmp_var;
  287|  29.6k|          }
  288|   353k|        }
  289|   145k|      }
  290|       |
  291|       |      /* One dummy full reservoir at the end to help in bit distribution */
  292|  72.7k|      bit_resv_spc[temp_resv] = 0;
  293|  72.7k|      bit_resv_spc_sort[temp_resv] = temp_resv;
  294|       |
  295|       |      /* Distribute fill bits among reservoirs in the order of bit_resv_spc_sort[]:
  296|       |      - Bring up [0] to the level of [1]
  297|       |      - Next bring up [0] and [1] to the level of [2]...and so on */
  298|   276k|      for (i = 1; ((i < (temp_resv + 1)) && (total_fill_bits > 0)); i++) {
  ------------------
  |  Branch (298:20): [True: 208k, False: 68.0k]
  |  Branch (298:45): [True: 203k, False: 4.67k]
  ------------------
  299|   203k|        if (((bit_resv_spc[bit_resv_spc_sort[0]] - bit_resv_spc[bit_resv_spc_sort[i]]) * i) <=
  ------------------
  |  Branch (299:13): [True: 199k, False: 4.64k]
  ------------------
  300|   203k|            total_fill_bits) {
  301|   199k|          total_fill_bits -=
  302|   199k|              ((bit_resv_spc[bit_resv_spc_sort[0]] - bit_resv_spc[bit_resv_spc_sort[i]]) * i);
  303|   696k|          for (j = 0; j < i; j++) {
  ------------------
  |  Branch (303:23): [True: 497k, False: 199k]
  ------------------
  304|   497k|            bit_resv_spc[bit_resv_spc_sort[j]] = bit_resv_spc[bit_resv_spc_sort[i]];
  305|   497k|          }
  306|   199k|        } else {
  307|  4.64k|          WORD32 div_bs_ele;
  308|       |
  309|  4.64k|          div_bs_ele = (WORD32)(total_fill_bits / i);
  310|  4.64k|          total_fill_bits -= (div_bs_ele * i);
  311|       |
  312|  16.9k|          for (j = 0; j < i; j++) {
  ------------------
  |  Branch (312:23): [True: 12.3k, False: 4.64k]
  ------------------
  313|  12.3k|            bit_resv_spc[bit_resv_spc_sort[j]] -= div_bs_ele;
  314|  12.3k|          }
  315|       |
  316|  8.54k|          for (j = 0; ((j < i) && (total_fill_bits > 0)); j++) {
  ------------------
  |  Branch (316:24): [True: 8.54k, False: 0]
  |  Branch (316:35): [True: 3.90k, False: 4.64k]
  ------------------
  317|  3.90k|            bit_resv_spc[bit_resv_spc_sort[j]]--;
  318|  3.90k|            total_fill_bits--;
  319|  3.90k|          }
  320|  4.64k|        }
  321|   203k|      }
  322|       |
  323|       |      /* Supply additional bits added for coding next frame */
  324|   222k|      for (i = 0, temp_resv = 0; i < num_bs_elements; i++, temp_resv++) {
  ------------------
  |  Branch (324:34): [True: 149k, False: 72.7k]
  ------------------
  325|   149k|        WORD32 add_bits;
  326|       |
  327|   149k|        add_bits = (pstr_aac_enc[i]->qc_kernel.element_bits.max_bit_res_bits -
  328|   149k|                    pstr_aac_enc[i]->qc_kernel.element_bits.bit_res_level) -
  329|   149k|                   bit_resv_spc[temp_resv];
  330|       |
  331|       |        /* Because CPE reservoir has been split into two */
  332|   149k|        if (pstr_aac_enc[i]->qc_kernel.num_channels == 2) {
  ------------------
  |  Branch (332:13): [True: 68.1k, False: 81.5k]
  ------------------
  333|  68.1k|          temp_resv++;
  334|  68.1k|          add_bits -= bit_resv_spc[temp_resv];
  335|  68.1k|        }
  336|       |
  337|       |        /* These will be in addition to the avg. bitrate for the next frame */
  338|   149k|        pstr_aac_enc[i]->qc_kernel.element_bits.carry_bits = add_bits;
  339|   149k|      }
  340|       |
  341|       |      /* Update remaining fill bits */
  342|  72.7k|      *tot_fill_bits = total_fill_bits;
  343|  72.7k|    }
  344|       |
  345|   146k|    n_full_fill_elem = (total_fill_bits - 1) / max_fill_elem_bits;
  346|       |
  347|   146k|    if (n_full_fill_elem) {
  ------------------
  |  Branch (347:9): [True: 42.7k, False: 104k]
  ------------------
  348|  42.7k|      total_fill_bits -= n_full_fill_elem * max_fill_elem_bits;
  349|  42.7k|    }
  350|       |
  351|   146k|    if (total_fill_bits > 0) {
  ------------------
  |  Branch (351:9): [True: 68.0k, False: 78.8k]
  ------------------
  352|       |      /* minimum Fillelement contains 7 (TAG + byte cnt) bits */
  353|  68.0k|      total_fill_bits = MAX(7, total_fill_bits);
  ------------------
  |  |   24|  68.0k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.57k, False: 66.4k]
  |  |  ------------------
  ------------------
  354|       |
  355|       |      /* fill element size equals n*8 + 7 */
  356|  68.0k|      total_fill_bits += ((8 - (total_fill_bits - 7) % 8) % 8);
  357|       |
  358|  68.0k|      switch (total_fill_bits) {
  359|  1.59k|        case 7:
  ------------------
  |  Branch (359:9): [True: 1.59k, False: 66.4k]
  ------------------
  360|  1.59k|          tfb_flag2 = 1;
  361|  1.59k|          break;
  362|       |
  363|    796|        case 15:
  ------------------
  |  Branch (363:9): [True: 796, False: 67.2k]
  ------------------
  364|    796|          tfb_flag1 = 1;
  365|    796|          break;
  366|       |
  367|  65.6k|        default:
  ------------------
  |  Branch (367:9): [True: 65.6k, False: 2.38k]
  ------------------
  368|  65.6k|          tfb_flag = 1;
  369|  65.6k|          break;
  370|  68.0k|      }
  371|  68.0k|    }
  372|       |
  373|   146k|    total_fill_bits += n_full_fill_elem * max_fill_elem_bits;
  374|       |
  375|   146k|    pstr_qc_out->align_bits =
  376|   146k|        7 - (cnt_bits + pstr_qc_out->tot_dyn_bits_used + pstr_qc_out->tot_static_bits_used +
  377|   146k|             pstr_qc_out->tot_anc_bits_used + +total_fill_bits - 1) %
  378|   146k|                8;
  379|   146k|    if (((pstr_qc_out->align_bits + total_fill_bits - *tot_fill_bits) == 8) &&
  ------------------
  |  Branch (379:9): [True: 38.5k, False: 108k]
  ------------------
  380|  38.5k|        (total_fill_bits > 8)) {
  ------------------
  |  Branch (380:9): [True: 37.9k, False: 592]
  ------------------
  381|  37.9k|      total_fill_bits -= 8;
  382|  37.9k|    }
  383|       |
  384|   146k|    diff_bits = (pstr_qc_out->align_bits + total_fill_bits) - *tot_fill_bits;
  385|       |
  386|   146k|    if (diff_bits) {
  ------------------
  |  Branch (386:9): [True: 95.7k, False: 51.0k]
  ------------------
  387|  95.7k|      if (diff_bits < 0) {
  ------------------
  |  Branch (387:11): [True: 0, False: 95.7k]
  ------------------
  388|      0|        return IA_EXHEAACE_EXE_FATAL_INVALID_BIT_CONSUMPTION;
  389|  95.7k|      } else {
  390|  95.7k|        {
  391|  95.7k|          if (cnt_bits + pstr_qc_out->tot_static_bits_used + pstr_qc_out->tot_dyn_bits_used +
  ------------------
  |  Branch (391:15): [True: 16.8k, False: 78.9k]
  ------------------
  392|  95.7k|                  pstr_qc_out->tot_anc_bits_used + total_fill_bits >
  393|  95.7k|              12288) {
  394|  16.8k|            if ((diff_bits > 8) && (total_fill_bits > 8)) {
  ------------------
  |  Branch (394:17): [True: 6.64k, False: 10.1k]
  |  Branch (394:36): [True: 6.64k, False: 0]
  ------------------
  395|  6.64k|              if (tfb_flag || tfb_flag1) {
  ------------------
  |  Branch (395:19): [True: 6.52k, False: 123]
  |  Branch (395:31): [True: 110, False: 13]
  ------------------
  396|  6.63k|                total_fill_bits -= 8;
  397|  6.63k|              }
  398|  6.64k|              if (tfb_flag2) {
  ------------------
  |  Branch (398:19): [True: 13, False: 6.63k]
  ------------------
  399|     13|                total_fill_bits -= 7;
  400|     13|              }
  401|  6.64k|            }
  402|  78.9k|          } else {
  403|  78.9k|            if (pstr_qc_kernel->element_bits.bit_res_level - diff_bits > 0) {
  ------------------
  |  Branch (403:17): [True: 73.6k, False: 5.33k]
  ------------------
  404|  73.6k|              pstr_qc_kernel->element_bits.bit_res_level -= diff_bits;
  405|  73.6k|              pstr_qc_kernel->bit_res_tot = pstr_qc_kernel->element_bits.bit_res_level;
  406|  73.6k|            } else {
  407|  5.33k|              if ((diff_bits > 8) && (total_fill_bits > 8) && (tfb_flag)) {
  ------------------
  |  Branch (407:19): [True: 3.06k, False: 2.26k]
  |  Branch (407:38): [True: 3.06k, False: 0]
  |  Branch (407:63): [True: 2.56k, False: 495]
  ------------------
  408|  2.56k|                total_fill_bits -= 8;
  409|  2.76k|              } else if ((diff_bits > 8) && (total_fill_bits > 8) && (tfb_flag1)) {
  ------------------
  |  Branch (409:26): [True: 495, False: 2.26k]
  |  Branch (409:45): [True: 495, False: 0]
  |  Branch (409:70): [True: 286, False: 209]
  ------------------
  410|    286|                total_fill_bits -= 8;
  411|  2.47k|              } else if ((diff_bits > 8) && (total_fill_bits > 8) && (tfb_flag2)) {
  ------------------
  |  Branch (411:26): [True: 209, False: 2.26k]
  |  Branch (411:45): [True: 209, False: 0]
  |  Branch (411:70): [True: 209, False: 0]
  ------------------
  412|    209|                total_fill_bits -= 7;
  413|    209|              }
  414|  5.33k|            }
  415|  78.9k|          }
  416|  95.7k|        }
  417|  95.7k|      }
  418|  95.7k|    }
  419|   146k|    switch (aot) {
  ------------------
  |  Branch (419:13): [True: 146k, False: 0]
  ------------------
  420|  24.0k|      case AOT_AAC_LC:
  ------------------
  |  |   34|  24.0k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (420:7): [True: 24.0k, False: 122k]
  ------------------
  421|  64.4k|      case AOT_SBR:
  ------------------
  |  |   35|  64.4k|#define AOT_SBR (5)
  ------------------
  |  Branch (421:7): [True: 40.3k, False: 106k]
  ------------------
  422|  84.1k|      case AOT_PS:
  ------------------
  |  |   39|  84.1k|#define AOT_PS (29)
  ------------------
  |  Branch (422:7): [True: 19.7k, False: 127k]
  ------------------
  423|  84.1k|        *tot_fill_bits = total_fill_bits;
  424|  84.1k|        break;
  425|       |
  426|  10.6k|      case AOT_AAC_LD:
  ------------------
  |  |   36|  10.6k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (426:7): [True: 10.6k, False: 136k]
  ------------------
  427|  62.7k|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  62.7k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (427:7): [True: 52.1k, False: 94.7k]
  ------------------
  428|  62.7k|        pstr_qc_out->total_fill_bits = total_fill_bits;
  429|  62.7k|        *tot_fill_bits = 0;
  430|  62.7k|        break;
  431|   146k|    }
  432|   146k|  }  // if flag_last_element
  433|   161k|  else {
  434|   161k|    pstr_qc_out->align_bits = 0;
  435|   161k|  }
  436|       |
  437|   308k|  if ((pstr_qc_out->tot_dyn_bits_used + pstr_qc_out->tot_static_bits_used +
  ------------------
  |  Branch (437:7): [True: 28.9k, False: 279k]
  ------------------
  438|   308k|       pstr_qc_out->tot_anc_bits_used + pstr_qc_out->total_fill_bits + pstr_qc_out->align_bits) >
  439|   308k|      pstr_qc_kernel->max_bits_tot) {
  440|  28.9k|  }
  441|       |
  442|   308k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   308k|#define IA_NO_ERROR 0x00000000
  ------------------
  443|   308k|}
ia_enhaacplus_enc_adjust_bitrate:
  449|   308k|{
  450|   308k|  WORD32 padding_on;
  451|   308k|  WORD32 frame_len;
  452|   308k|  WORD32 code_bits;
  453|   308k|  WORD32 code_bits_last;
  454|       |
  455|   308k|  padding_on = ia_enhaacplus_enc_frame_padding(
  456|   308k|      bit_rate, sample_rate, &pstr_qc_state->padding.padding_rest, frame_len_long);
  457|       |
  458|   308k|  frame_len = padding_on + ia_enhaacplus_enc_calc_frame_len(bit_rate, sample_rate,
  459|   308k|                                                            FRAME_LEN_BYTES_INT, frame_len_long);
  460|       |
  461|   308k|  frame_len <<= 3;
  462|       |
  463|   308k|  if (flag_last_element) {
  ------------------
  |  Branch (463:7): [True: 147k, False: 161k]
  ------------------
  464|   147k|    code_bits_last = pstr_qc_state->average_bits_tot - pstr_qc_state->glob_stat_bits;
  465|       |
  466|   147k|    code_bits = frame_len - pstr_qc_state->glob_stat_bits;
  467|   161k|  } else {
  468|   161k|    code_bits_last = pstr_qc_state->average_bits_tot;
  469|       |
  470|   161k|    code_bits = frame_len;
  471|   161k|  }
  472|       |
  473|       |  /* calculate bits for every channel element */
  474|   308k|  if (code_bits != code_bits_last) {
  ------------------
  |  Branch (474:7): [True: 89.7k, False: 218k]
  ------------------
  475|  89.7k|    WORD32 total_bits = 0;
  476|       |
  477|  89.7k|    pstr_qc_state->element_bits.average_bits =
  478|  89.7k|        (WORD32)(pstr_qc_state->element_bits.relative_bits * code_bits);
  479|       |
  480|  89.7k|    total_bits += pstr_qc_state->element_bits.average_bits;
  481|       |
  482|  89.7k|    pstr_qc_state->element_bits.average_bits += code_bits - total_bits;
  483|  89.7k|  }
  484|       |
  485|   308k|  pstr_qc_state->average_bits_tot = frame_len;
  486|       |
  487|       |  /* Bits carried over from previous frame due to distribution of fill bits */
  488|   308k|  pstr_qc_state->element_bits.average_bits += pstr_qc_state->element_bits.carry_bits;
  489|   308k|  pstr_qc_state->average_bits_tot += pstr_qc_state->element_bits.carry_bits;
  490|       |
  491|       |  /* Flush for current frame */
  492|   308k|  pstr_qc_state->element_bits.carry_bits = 0;
  493|   308k|}
ia_enhaacplus_aac_limitbitrate:
  496|  4.76k|                                      WORD32 num_channels, WORD32 bit_rate) {
  497|  4.76k|  WORD32 prev_bit_rate, shift = 0, iter = 0;
  498|  4.76k|  WORD32 max_ch_bits = MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |   94|  4.76k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  499|       |
  500|  26.8k|  while ((frame_length & ~((1 << (shift + 1)) - 1)) == frame_length &&
  ------------------
  |  Branch (500:10): [True: 25.6k, False: 1.18k]
  ------------------
  501|  25.6k|         (core_sampling_rate & ~((1 << (shift + 1)) - 1)) == core_sampling_rate) {
  ------------------
  |  Branch (501:10): [True: 22.0k, False: 3.57k]
  ------------------
  502|  22.0k|    shift++;
  503|  22.0k|  }
  504|       |
  505|  4.76k|  max_ch_bits = MAXIMUM_CHANNEL_BITS_1024 * frame_length / MAX_FRAME_LEN;
  ------------------
  |  |   94|  4.76k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
                max_ch_bits = MAXIMUM_CHANNEL_BITS_1024 * frame_length / MAX_FRAME_LEN;
  ------------------
  |  |  101|  4.76k|#define MAX_FRAME_LEN (1024)
  ------------------
  506|       |
  507|  6.41k|  do {
  508|  6.41k|    prev_bit_rate = bit_rate;
  509|       |
  510|  6.41k|    bit_rate = MAX(bit_rate, ((((40 * num_channels) + TRANSPORT_BITS) * (core_sampling_rate)) /
  ------------------
  |  |   24|  6.41k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 5.01k, False: 1.39k]
  |  |  ------------------
  ------------------
  511|  6.41k|                              frame_length));
  512|  6.41k|    bit_rate = MIN(bit_rate, ((num_channels * max_ch_bits) * (core_sampling_rate >> shift)) /
  ------------------
  |  |   23|  6.41k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 4.46k, False: 1.95k]
  |  |  ------------------
  ------------------
  513|  6.41k|                                 (frame_length >> shift));
  514|       |
  515|  6.41k|  } while (prev_bit_rate != bit_rate && iter++ < 3);
  ------------------
  |  Branch (515:12): [True: 1.65k, False: 4.76k]
  |  Branch (515:41): [True: 1.65k, False: 0]
  ------------------
  516|       |
  517|  4.76k|  return bit_rate;
  518|  4.76k|}
ixheaace_qc_util.c:ia_enhaacplus_enc_frame_padding:
   94|   308k|                                              WORD32 *ptr_padding_rest, WORD32 frame_len_long) {
   95|   308k|  WORD32 padding_on;
   96|   308k|  WORD32 difference;
   97|       |
   98|   308k|  padding_on = 0;
   99|       |
  100|   308k|  difference = ia_enhaacplus_enc_calc_frame_len(bit_rate, sample_rate, FRAME_LEN_BYTES_MODULO,
  101|   308k|                                                frame_len_long);
  102|       |
  103|   308k|  *ptr_padding_rest -= difference;
  104|       |
  105|   308k|  if (*ptr_padding_rest <= 0) {
  ------------------
  |  Branch (105:7): [True: 86.0k, False: 222k]
  ------------------
  106|  86.0k|    padding_on = 1;
  107|       |
  108|  86.0k|    *ptr_padding_rest += sample_rate;
  109|  86.0k|  }
  110|       |
  111|   308k|  return padding_on;
  112|   308k|}
ixheaace_qc_util.c:ia_enhaacplus_enc_calc_frame_len:
   74|   616k|                                               WORD32 long_frame_len) {
   75|   616k|  WORD32 result;
   76|       |
   77|   616k|  result = ((long_frame_len) >> 3) * (bit_rate);
   78|       |
   79|   616k|  switch (mode) {
   80|   308k|    case FRAME_LEN_BYTES_MODULO:
  ------------------
  |  Branch (80:5): [True: 308k, False: 308k]
  ------------------
   81|   308k|      result %= sample_rate;
   82|   308k|      break;
   83|   308k|    case FRAME_LEN_BYTES_INT:
  ------------------
  |  Branch (83:5): [True: 308k, False: 308k]
  ------------------
   84|   308k|      result /= sample_rate;
   85|   308k|      break;
   86|      0|    default:
  ------------------
  |  Branch (86:5): [True: 0, False: 616k]
  ------------------
   87|      0|      break;
   88|   616k|  }
   89|       |
   90|   616k|  return result;
   91|   616k|}

iaace_quantize_lines:
   35|   820k|                          WORD16 *ptr_quant_spec, FLOAT32 *ptr_mdct_spec) {
   36|   820k|  FLOAT32 quantizer;
   37|   820k|  FLOAT32 k = -0.0946f + 0.5f;
   38|   820k|  WORD32 line;
   39|       |
   40|   820k|  quantizer = ixheaace_fd_quant_table[gain + 128];
   41|       |
   42|  10.6M|  for (line = 0; line < num_lines; line++) {
  ------------------
  |  Branch (42:18): [True: 9.84M, False: 820k]
  ------------------
   43|  9.84M|    FLOAT32 tmp = ptr_mdct_spec[line];
   44|  9.84M|    if (tmp < 0.0f) {
  ------------------
  |  Branch (44:9): [True: 2.01M, False: 7.83M]
  ------------------
   45|  2.01M|      ptr_exp_spec[line] = (FLOAT32)sqrt(-tmp);
   46|  2.01M|      ptr_exp_spec[line] *= (FLOAT32)sqrt(ptr_exp_spec[line]);
   47|  2.01M|      ptr_quant_spec[line] = -(WORD16)(k + quantizer * ptr_exp_spec[line]);
   48|  7.83M|    } else {
   49|  7.83M|      ptr_exp_spec[line] = (FLOAT32)sqrt(tmp);
   50|  7.83M|      ptr_exp_spec[line] *= (FLOAT32)sqrt(ptr_exp_spec[line]);
   51|  7.83M|      ptr_quant_spec[line] = (WORD16)(k + quantizer * ptr_exp_spec[line]);
   52|  7.83M|    }
   53|  9.84M|  }
   54|   820k|}

ia_enhaacplus_enc_fft:
  162|  3.78M|VOID ia_enhaacplus_enc_fft(complex *out, WORD32 N, ixheaace_common_tables *pstr_common_tab) {
  163|  3.78M|  WORD32 nob;
  164|  3.78M|  WORD32 len;
  165|       |
  166|       |  /* time domain samples obtained with bit reversal*/
  167|  3.78M|  len = N;
  168|       |
  169|  3.78M|  if (len == 8) {
  ------------------
  |  Branch (169:7): [True: 1.26M, False: 2.52M]
  ------------------
  170|  1.26M|    nob = 3;
  171|  2.52M|  } else {
  172|  2.52M|    nob = 2;
  173|  2.52M|  }
  174|  3.78M|  ia_enhaacplus_enc_ps_fft(out, N, nob, pstr_common_tab);
  175|  3.78M|}
ixheaace_radix2_fft.c:ia_enhaacplus_enc_ps_fft:
   33|  3.78M|                                     ixheaace_common_tables *comm_tab_ptr) {
   34|  3.78M|  LOOPINDEX block_per_stage, stage_num, inner;
   35|       |
   36|  3.78M|  WORD32 index_1, index_2, tab_modifier;
   37|  3.78M|  WORD32 len, increment, i;
   38|       |
   39|  3.78M|  FLOAT32 cos_val;
   40|  3.78M|  FLOAT32 sin_val;
   41|       |
   42|  3.78M|  WORD16 index1;
   43|  3.78M|  FLOAT32 re_temp, re_temp2;
   44|  3.78M|  FLOAT32 im_temp, im_temp2;
   45|  3.78M|  FLOAT32 *out1_w32, *out2_w32;
   46|       |
   47|  3.78M|  len = N >> 1;
   48|  3.78M|  index_1 = 0;
   49|       |
   50|  3.78M|  out1_w32 = (FLOAT32 *)&out[index_1];
   51|  3.78M|  out2_w32 = (FLOAT32 *)&out[index_1 + 1];
   52|       |
   53|  13.8M|  for (block_per_stage = len - 1; block_per_stage >= 0; block_per_stage--) {
  ------------------
  |  Branch (53:35): [True: 10.0M, False: 3.78M]
  ------------------
   54|  10.0M|    re_temp = out1_w32[0];
   55|  10.0M|    im_temp = out1_w32[1];
   56|       |
   57|  10.0M|    re_temp2 = out2_w32[0];
   58|  10.0M|    im_temp2 = out2_w32[1];
   59|       |
   60|  10.0M|    out1_w32[0] = re_temp + re_temp2;
   61|  10.0M|    out1_w32[1] = im_temp + im_temp2;
   62|       |
   63|  10.0M|    out2_w32[0] = re_temp - re_temp2;
   64|  10.0M|    out2_w32[1] = im_temp - im_temp2;
   65|       |
   66|  10.0M|    out1_w32 += 4;
   67|  10.0M|    out2_w32 += 4;
   68|  10.0M|  }
   69|       |
   70|  3.78M|  if (nob == 3) {
  ------------------
  |  Branch (70:7): [True: 1.26M, False: 2.52M]
  ------------------
   71|  1.26M|    i = 2; /* used for dist calculation*/
   72|  1.26M|    increment = 1;
   73|  1.26M|    tab_modifier = 2;
   74|  3.78M|    for (stage_num = 1; stage_num >= 0; stage_num--) {
  ------------------
  |  Branch (74:25): [True: 2.52M, False: 1.26M]
  ------------------
   75|  2.52M|      len = len >> 1;
   76|  2.52M|      index_1 = 0;
   77|  2.52M|      increment += 1;
   78|       |
   79|  2.52M|      tab_modifier--;
   80|       |
   81|  6.30M|      for (block_per_stage = len - 1; block_per_stage >= 0; block_per_stage--) {
  ------------------
  |  Branch (81:39): [True: 3.78M, False: 2.52M]
  ------------------
   82|  3.78M|        index_2 = index_1 + i;
   83|       |
   84|  3.78M|        out1_w32 = (FLOAT32 *)&out[index_1];
   85|  3.78M|        out2_w32 = (FLOAT32 *)&out[index_2];
   86|       |
   87|  3.78M|        re_temp = out1_w32[0];
   88|  3.78M|        im_temp = out1_w32[1];
   89|       |
   90|  3.78M|        re_temp2 = out2_w32[0];
   91|  3.78M|        im_temp2 = out2_w32[1];
   92|       |
   93|  3.78M|        out1_w32[0] = re_temp + re_temp2;
   94|  3.78M|        out1_w32[1] = im_temp + im_temp2;
   95|       |
   96|  3.78M|        out2_w32[0] = re_temp - re_temp2;
   97|  3.78M|        out2_w32[1] = im_temp - im_temp2;
   98|       |
   99|  3.78M|        index1 = (WORD16)tab_modifier;
  100|       |
  101|  3.78M|        out1_w32 += 2;
  102|  3.78M|        out2_w32 += 2;
  103|       |
  104|  10.0M|        for (inner = 0; inner < (2 * i - 2); inner += 2) {
  ------------------
  |  Branch (104:25): [True: 6.30M, False: 3.78M]
  ------------------
  105|  6.30M|          cos_val = comm_tab_ptr->cos_arr[index1];
  106|  6.30M|          sin_val = comm_tab_ptr->sin_arr[index1];
  107|       |
  108|  6.30M|          index1++;
  109|       |
  110|  6.30M|          re_temp = (out2_w32[inner] * cos_val) + (out2_w32[inner + 1] * sin_val);
  111|  6.30M|          im_temp = (out2_w32[inner + 1] * cos_val) - (out2_w32[inner] * sin_val);
  112|       |
  113|  6.30M|          re_temp2 = out1_w32[inner];
  114|  6.30M|          im_temp2 = out1_w32[inner + 1];
  115|       |
  116|  6.30M|          out1_w32[inner] = re_temp2 + re_temp;
  117|  6.30M|          out1_w32[inner + 1] = im_temp2 + im_temp;
  118|       |
  119|  6.30M|          out2_w32[inner] = re_temp2 - re_temp;
  120|  6.30M|          out2_w32[inner + 1] = im_temp2 - im_temp;
  121|  6.30M|        }
  122|       |
  123|  3.78M|        index_1 += (WORD32)pow(2, increment);
  124|  3.78M|      }
  125|  2.52M|      i <<= 1;
  126|  2.52M|    }
  127|  2.52M|  } else {
  128|  2.52M|    out1_w32 = (FLOAT32 *)&out[0];
  129|  2.52M|    out2_w32 = (FLOAT32 *)&out[2];
  130|       |
  131|  2.52M|    re_temp = out1_w32[0];
  132|  2.52M|    im_temp = out1_w32[1];
  133|       |
  134|  2.52M|    re_temp2 = out2_w32[0];
  135|  2.52M|    im_temp2 = out2_w32[1];
  136|       |
  137|  2.52M|    out1_w32[0] = re_temp + re_temp2;
  138|  2.52M|    out1_w32[1] = im_temp + im_temp2;
  139|       |
  140|  2.52M|    out2_w32[0] = re_temp - re_temp2;
  141|  2.52M|    out2_w32[1] = im_temp - im_temp2;
  142|       |
  143|  2.52M|    out1_w32 += 2;
  144|  2.52M|    out2_w32 += 2;
  145|       |
  146|  2.52M|    sin_val = comm_tab_ptr->sin_arr[1];
  147|       |
  148|  2.52M|    re_temp = out2_w32[1] * sin_val;
  149|  2.52M|    im_temp = out2_w32[0] * sin_val;
  150|       |
  151|  2.52M|    re_temp2 = out1_w32[0];
  152|  2.52M|    im_temp2 = out1_w32[1];
  153|       |
  154|  2.52M|    out1_w32[0] = re_temp2 + re_temp;
  155|  2.52M|    out1_w32[1] = im_temp2 - im_temp;
  156|       |
  157|  2.52M|    out2_w32[0] = re_temp2 - re_temp;
  158|  2.52M|    out2_w32[1] = im_temp2 + im_temp;
  159|  2.52M|  }
  160|  3.78M|}

ixheaace_get_input_scratch_buf:
  133|   319k|VOID ixheaace_get_input_scratch_buf(VOID *ptr_scr, FLOAT32 **ptr_scratch_buf_inp) {
  134|   319k|  ixheaace_resampler_scratch *pstr_resampler_scr = (ixheaace_resampler_scratch *)ptr_scr;
  135|       |
  136|   319k|  *ptr_scratch_buf_inp = pstr_resampler_scr->downsampler_in_buffer;
  137|   319k|}
ixheaace_resampler_scr_size:
  139|  5.28k|WORD32 ixheaace_resampler_scr_size(VOID) {
  140|  5.28k|  return IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_resampler_scratch), BYTE_ALIGN_8);
  ------------------
  |  |   87|  5.28k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  141|  5.28k|}
ia_enhaacplus_enc_iir_downsampler:
  183|   830k|                                       ixheaace_resampler_scratch *pstr_resampler_scratch) {
  184|   830k|  ixheaace_iir_filter *pstr_iir_filter = &(pstr_down_sampler->iir_filter);
  185|   830k|  WORD32 k;
  186|   830k|  FLOAT32 *ptr_iir_ring1, *ptr_iir_ring2, *ptr_out_temp;
  187|       |
  188|   830k|  ptr_iir_ring2 = pstr_iir_filter->ring_buf_2;
  189|   830k|  ptr_iir_ring1 = pstr_iir_filter->ring_buf_1;
  190|   830k|  ptr_out_temp = pstr_resampler_scratch->downsampler_out_buffer;
  191|       |
  192|   830k|  ia_enhaacplus_enc_copy_ring_buffers(ptr_iir_ring1, ptr_iir_ring2, ptr_ring_buf1, ptr_ring_buf2);
  193|       |
  194|   830k|  ia_enhaacplus_enc_downsample_iir_filter(
  195|   830k|      pstr_down_sampler, ptr_in_samples, ptr_out_temp, in_stride, num_in_samples, num_out_samples,
  196|   830k|      out_stride, &ptr_ring_buf1[LEN_RING_BUF - 1], &ptr_ring_buf2[LEN_RING_BUF - 1]);
  ------------------
  |  |   22|   830k|#define LEN_RING_BUF (12)
  ------------------
                    out_stride, &ptr_ring_buf1[LEN_RING_BUF - 1], &ptr_ring_buf2[LEN_RING_BUF - 1]);
  ------------------
  |  |   22|   830k|#define LEN_RING_BUF (12)
  ------------------
  197|       |
  198|   785M|  for (k = 0; k < *num_out_samples; k++) {
  ------------------
  |  Branch (198:15): [True: 784M, False: 830k]
  ------------------
  199|   784M|    ptr_out_samples[k * in_stride] = ptr_out_temp[k * out_stride];
  200|   784M|  }
  201|       |
  202|   830k|  ia_enhaacplus_enc_copy_ring_buffers(&ptr_ring_buf1[num_in_samples],
  203|   830k|                                      &ptr_ring_buf2[num_in_samples], ptr_iir_ring1,
  204|   830k|                                      ptr_iir_ring2);
  205|   830k|}
ia_enhaacplus_enc_iir_sos_downsampler:
  212|  41.5k|                                           ixheaace_resampler_scratch *pstr_resampler_scratch) {
  213|  41.5k|  ixheaace_iir_sos_filter *pstr_iir_filter = &(pstr_down_sampler->iir_filter);
  214|  41.5k|  FLOAT32 *ptr_iir_ring1, *ptr_iir_ring2;
  215|  41.5k|  FLOAT32 *ptr_out_stage1, *ptr_out_stage2, *ptr_out_stage3, *ptr_out_stage4, *ptr_out_stage5,
  216|  41.5k|      *ptr_out_final;
  217|  41.5k|  WORD32 p = 0, idx = 0, offset1 = 0, offset2 = 0;
  218|  41.5k|  FLOAT32 *ptr_temp_buf1, *ptr_temp_buf2, *ptr_temp_ring_buf;
  219|  41.5k|  WORD32 upper_lim = num_in_samples * in_stride;
  220|       |
  221|  41.5k|  ptr_iir_ring1 = pstr_iir_filter->ring_buf_sos_1;
  222|  41.5k|  ptr_iir_ring2 = pstr_iir_filter->ring_buf_sos_2;
  223|       |
  224|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_iir_ring1, ptr_iir_ring2, ptr_ring_buf1,
  225|  41.5k|                                          ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   24|  41.5k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
  226|       |
  227|  41.5k|  ptr_temp_buf1 = pstr_resampler_scratch->scratch_buf1_temp;
  228|  41.5k|  ptr_temp_buf2 = pstr_resampler_scratch->scratch_buf2_temp;
  229|  41.5k|  ptr_temp_ring_buf = pstr_resampler_scratch->ring_buf_temp;
  230|       |
  231|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf1, ptr_ring_buf2, ptr_temp_buf1,
  232|  41.5k|                                          ptr_temp_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_temp_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  233|       |
  234|  41.5k|  ptr_out_stage1 = pstr_resampler_scratch->downsampler_out_buffer;
  235|       |
  236|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_in_samples, upper_lim,
  237|  41.5k|                                           in_stride, idx);
  238|       |
  239|       |  // Stage 1
  240|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_down_sampler, ptr_in_samples, in_stride, ptr_out_stage1,
  241|  41.5k|                                   num_in_samples, ptr_temp_buf1, ptr_temp_buf2, idx);
  242|       |
  243|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  244|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  245|       |
  246|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  247|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  248|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  249|       |
  250|  41.5k|  idx++;
  251|       |
  252|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage1, upper_lim,
  253|  41.5k|                                           in_stride, idx);
  254|       |
  255|  41.5k|  ptr_out_stage2 = pstr_resampler_scratch->downsampler_in_buffer;
  256|       |
  257|       |  // Stage 2
  258|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_down_sampler, ptr_out_stage1, in_stride, ptr_out_stage2,
  259|  41.5k|                                   num_in_samples, ptr_temp_buf1, ptr_temp_buf2, idx);
  260|       |
  261|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  262|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  263|       |
  264|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  265|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  266|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  267|       |
  268|  41.5k|  idx++;
  269|       |
  270|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage2, upper_lim,
  271|  41.5k|                                           in_stride, idx);
  272|       |
  273|  41.5k|  ptr_out_stage3 = pstr_resampler_scratch->downsampler_out_buffer;
  274|       |
  275|       |  // Stage 3
  276|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_down_sampler, ptr_out_stage2, in_stride, ptr_out_stage3,
  277|  41.5k|                                   num_in_samples, ptr_temp_buf1, ptr_temp_buf2, idx);
  278|       |
  279|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  280|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  281|       |
  282|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  283|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  284|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  285|       |
  286|  41.5k|  idx++;
  287|       |
  288|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage3, upper_lim,
  289|  41.5k|                                           in_stride, idx);
  290|       |
  291|  41.5k|  ptr_out_stage4 = pstr_resampler_scratch->downsampler_in_buffer;
  292|       |
  293|       |  // Stage 4
  294|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_down_sampler, ptr_out_stage3, in_stride, ptr_out_stage4,
  295|  41.5k|                                   num_in_samples, ptr_temp_buf1, ptr_temp_buf2, idx);
  296|       |
  297|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  298|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  299|       |
  300|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  301|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  302|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  303|       |
  304|  41.5k|  idx++;
  305|       |
  306|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage4, upper_lim,
  307|  41.5k|                                           in_stride, idx);
  308|       |
  309|  41.5k|  ptr_out_stage5 = pstr_resampler_scratch->downsampler_out_buffer;
  310|       |
  311|       |  // Stage 5
  312|       |
  313|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_down_sampler, ptr_out_stage4, in_stride, ptr_out_stage5,
  314|  41.5k|                                   num_in_samples, ptr_temp_buf1, ptr_temp_buf2, idx);
  315|       |
  316|  41.5k|  idx++;
  317|       |
  318|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage5, upper_lim,
  319|  41.5k|                                           in_stride, idx);
  320|       |
  321|  41.5k|  ptr_out_final = pstr_resampler_scratch->downsampler_in_buffer;
  322|       |
  323|       |  // Multiply by gain and perform downsamplng
  324|  41.5k|  *num_out_samples = 0;
  325|   255M|  for (p = 0; p < num_in_samples * in_stride; p += in_stride) {
  ------------------
  |  Branch (325:15): [True: 255M, False: 41.5k]
  ------------------
  326|   255M|    ptr_out_final[p] = ptr_out_stage5[p] * pstr_down_sampler->iir_filter.gain_sos;
  327|       |
  328|   255M|    pstr_down_sampler->pending++;
  329|       |
  330|   255M|    if (pstr_down_sampler->pending == pstr_down_sampler->ratio) {
  ------------------
  |  Branch (330:9): [True: 31.9M, False: 223M]
  ------------------
  331|  31.9M|      ptr_out_samples[(*num_out_samples) * in_stride] = ptr_out_final[p];
  332|       |
  333|  31.9M|      (*num_out_samples)++;
  334|       |
  335|  31.9M|      pstr_down_sampler->pending = 0;
  336|  31.9M|    }
  337|   255M|  }
  338|       |
  339|       |  // Update ring buffers
  340|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_temp_ring_buf,
  341|  41.5k|                                          ptr_temp_ring_buf + LEN_RING_BUF_SOS_1, ptr_ring_buf1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  342|  41.5k|                                          ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   24|  41.5k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
  343|       |
  344|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf1, ptr_ring_buf2, ptr_iir_ring1,
  345|  41.5k|                                          ptr_iir_ring2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_iir_ring2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   24|  41.5k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
  346|  41.5k|}
ia_enhaacplus_enc_iir_sos_upsampler:
  353|  41.5k|                                         ixheaace_resampler_scratch *pstr_resampler_scratch) {
  354|  41.5k|  ixheaace_iir_sos_filter *pstr_iir_filter = &(pstr_up_sampler->iir_filter);
  355|  41.5k|  FLOAT32 *ptr_iir_ring1, *ptr_iir_ring2;
  356|  41.5k|  FLOAT32 *ptr_out_stage1, *ptr_out_stage2, *ptr_out_stage3, *ptr_out_stage4, *ptr_out_stage5;
  357|  41.5k|  FLOAT32 out_val;
  358|  41.5k|  FLOAT32 *ptr_temp_buf1, *ptr_temp_buf2, *ptr_temp_ring_buf;
  359|  41.5k|  WORD32 p = 0, idx = 0, offset1 = 0, offset2 = 0;
  360|  41.5k|  WORD32 upsample_fac = pstr_up_sampler->ratio;
  361|  41.5k|  WORD32 upper_lim = num_in_samples * in_stride * upsample_fac;
  362|       |
  363|  41.5k|  ptr_iir_ring2 = pstr_iir_filter->ring_buf_sos_2;
  364|  41.5k|  ptr_iir_ring1 = pstr_iir_filter->ring_buf_sos_1;
  365|       |
  366|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_iir_ring1, ptr_iir_ring2, ptr_ring_buf1,
  367|  41.5k|                                          ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   24|  41.5k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
  368|       |
  369|  41.5k|  ptr_temp_buf1 = pstr_resampler_scratch->scratch_buf1_temp;
  370|  41.5k|  ptr_temp_buf2 = pstr_resampler_scratch->scratch_buf2_temp;
  371|  41.5k|  ptr_temp_ring_buf = pstr_resampler_scratch->ring_buf_temp;
  372|       |
  373|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf1, ptr_ring_buf2, ptr_temp_buf1,
  374|  41.5k|                                          ptr_temp_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_temp_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  375|       |
  376|  41.5k|  ptr_out_stage1 = pstr_resampler_scratch->downsampler_out_buffer;
  377|       |
  378|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_in_samples, upper_lim,
  379|  41.5k|                                           in_stride, idx);
  380|       |
  381|       |  // Stage 1
  382|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_up_sampler, ptr_in_samples, in_stride, ptr_out_stage1,
  383|  41.5k|                                   num_in_samples * upsample_fac, ptr_temp_buf1, ptr_temp_buf2,
  384|  41.5k|                                   idx);
  385|       |
  386|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  387|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  388|       |
  389|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  390|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  391|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  392|       |
  393|  41.5k|  idx++;
  394|       |
  395|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage1, upper_lim,
  396|  41.5k|                                           in_stride, idx);
  397|       |
  398|  41.5k|  ptr_out_stage2 = pstr_resampler_scratch->downsampler_in_buffer;
  399|       |
  400|       |  // Stage 2
  401|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_up_sampler, ptr_out_stage1, in_stride, ptr_out_stage2,
  402|  41.5k|                                   num_in_samples * upsample_fac, ptr_temp_buf1, ptr_temp_buf2,
  403|  41.5k|                                   idx);
  404|       |
  405|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  406|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  407|       |
  408|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  409|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  410|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  411|       |
  412|  41.5k|  idx++;
  413|       |
  414|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage2, upper_lim,
  415|  41.5k|                                           in_stride, idx);
  416|       |
  417|  41.5k|  ptr_out_stage3 = pstr_resampler_scratch->downsampler_out_buffer;
  418|       |
  419|       |  // Stage 3
  420|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_up_sampler, ptr_out_stage2, in_stride, ptr_out_stage3,
  421|  41.5k|                                   num_in_samples * upsample_fac, ptr_temp_buf1, ptr_temp_buf2,
  422|  41.5k|                                   idx);
  423|       |
  424|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  425|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  426|       |
  427|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  428|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  429|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  430|       |
  431|  41.5k|  idx++;
  432|       |
  433|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage3, upper_lim,
  434|  41.5k|                                           in_stride, idx);
  435|       |
  436|  41.5k|  ptr_out_stage4 = pstr_resampler_scratch->downsampler_in_buffer;
  437|       |
  438|       |  // Stage 4
  439|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_up_sampler, ptr_out_stage3, in_stride, ptr_out_stage4,
  440|  41.5k|                                   num_in_samples * upsample_fac, ptr_temp_buf1, ptr_temp_buf2,
  441|  41.5k|                                   idx);
  442|       |
  443|  41.5k|  offset1 = LEN_RING_BUF_SOS_1 * idx;
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  444|  41.5k|  offset2 = LEN_RING_BUF_SOS_1 * (idx + 1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  445|       |
  446|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf2 + offset1, ptr_ring_buf2 + offset2,
  447|  41.5k|                                          ptr_temp_buf1, ptr_temp_buf2, LEN_RING_BUF_SOS_1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  448|  41.5k|                                          LEN_RING_BUF_SOS_1);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  449|       |
  450|  41.5k|  idx++;
  451|       |
  452|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage4, upper_lim,
  453|  41.5k|                                           in_stride, idx);
  454|       |
  455|  41.5k|  ptr_out_stage5 = pstr_resampler_scratch->downsampler_out_buffer;
  456|       |
  457|       |  // Stage 5
  458|  41.5k|  ia_enhaacplus_enc_iir_sos_filter(pstr_up_sampler, ptr_out_stage4, in_stride, ptr_out_stage5,
  459|  41.5k|                                   num_in_samples * upsample_fac, ptr_temp_buf1, ptr_temp_buf2,
  460|  41.5k|                                   idx);
  461|       |
  462|  41.5k|  idx++;
  463|       |
  464|  41.5k|  ia_enhaacplus_enc_update_ring_buffer_sos(ptr_temp_ring_buf, ptr_out_stage5, upper_lim,
  465|  41.5k|                                           in_stride, idx);
  466|       |
  467|       |  // Multiply by gain and perform downsamplng
  468|  41.5k|  *num_out_samples = 0;
  469|   255M|  for (p = 0; p < num_in_samples * in_stride * upsample_fac; p += in_stride) {
  ------------------
  |  Branch (469:15): [True: 255M, False: 41.5k]
  ------------------
  470|   255M|    out_val = ptr_out_stage5[p] * pstr_up_sampler->iir_filter.gain_sos;
  471|   255M|    ptr_out_samples[p] = out_val;
  472|   255M|    (*num_out_samples)++;
  473|   255M|  }
  474|       |
  475|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_temp_ring_buf,
  476|  41.5k|                                          ptr_temp_ring_buf + LEN_RING_BUF_SOS_1, ptr_ring_buf1,
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
  477|  41.5k|                                          ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_ring_buf2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   24|  41.5k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
  478|       |
  479|  41.5k|  ia_enhaacplus_enc_copy_ring_buffers_sos(ptr_ring_buf1, ptr_ring_buf2, ptr_iir_ring1,
  480|  41.5k|                                          ptr_iir_ring2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   23|  41.5k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
                                                        ptr_iir_ring2, LEN_RING_BUF_SOS_1, LEN_RING_BUF_SOS_2);
  ------------------
  |  |   24|  41.5k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
  481|  41.5k|}
ia_enhaacplus_enc_compute_resampling_ratio:
  483|   211k|WORD32 ia_enhaacplus_enc_compute_resampling_ratio(WORD32 ccfl_idx) {
  484|   211k|  WORD32 resamp_ratio;
  485|       |
  486|   211k|  if (ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|   211k|#define SBR_4_1 (4)
  ------------------
  |  Branch (486:7): [True: 51.3k, False: 160k]
  ------------------
  487|  51.3k|    resamp_ratio = 2;
  488|   160k|  } else if (ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   160k|#define SBR_8_3 (2)
  ------------------
  |  Branch (488:14): [True: 30.9k, False: 129k]
  ------------------
  489|  30.9k|    resamp_ratio = 4;
  490|   129k|  } else {
  491|   129k|    resamp_ratio = 1;
  492|   129k|  }
  493|       |
  494|   211k|  return resamp_ratio;
  495|   211k|}
ixheaace_upsampling_inp_buf_generation:
  499|  30.9k|                                            WORD32 offset) {
  500|  30.9k|  WORD32 idx, m = 0;
  501|  30.9k|  FLOAT32 *ptr_in_samples;
  502|       |
  503|  30.9k|  memset(ptr_temp_buf, 0,
  504|  30.9k|         (num_samples * IXHEAACE_MAX_CH_IN_BS_ELE * upsamp_fac * sizeof(*ptr_temp_buf)));
  ------------------
  |  |   22|  30.9k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  505|       |
  506|  30.9k|  ptr_in_samples = ptr_inp_buf + offset;
  507|       |
  508|       |  // Perform actual upsampling (repeat samples)
  509|  63.4M|  for (idx = 0; idx < num_samples; idx++) {
  ------------------
  |  Branch (509:17): [True: 63.3M, False: 30.9k]
  ------------------
  510|  63.3M|    ptr_temp_buf[m++] = ptr_in_samples[idx * IXHEAACE_MAX_CH_IN_BS_ELE];
  ------------------
  |  |   22|  63.3M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  511|  63.3M|    ptr_temp_buf[m++] = ptr_in_samples[idx * IXHEAACE_MAX_CH_IN_BS_ELE + 1];
  ------------------
  |  |   22|  63.3M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  512|  63.3M|    ptr_temp_buf[m++] =
  513|  63.3M|        ptr_in_samples[idx *
  514|  63.3M|                       IXHEAACE_MAX_CH_IN_BS_ELE];  // 1st channel sample repeated for upsampling
  ------------------
  |  |   22|  63.3M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  515|  63.3M|    ptr_temp_buf[m++] = ptr_in_samples[idx * IXHEAACE_MAX_CH_IN_BS_ELE +
  ------------------
  |  |   22|  63.3M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  516|  63.3M|                                       1];  // 2nd channel sample repeated for upsampling
  517|  63.3M|    ptr_temp_buf[m++] =
  518|  63.3M|        ptr_in_samples[idx *
  519|  63.3M|                       IXHEAACE_MAX_CH_IN_BS_ELE];  // 1st channel sample repeated for upsampling
  ------------------
  |  |   22|  63.3M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  520|  63.3M|    ptr_temp_buf[m++] = ptr_in_samples[idx * IXHEAACE_MAX_CH_IN_BS_ELE +
  ------------------
  |  |   22|  63.3M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  521|  63.3M|                                       1];  // 2nd channel sample repeated for upsampling
  522|  63.3M|  }
  523|  30.9k|}
ixheaace_resampler.c:ia_enhaacplus_enc_copy_ring_buffers:
  101|  1.66M|                                                FLOAT32 *ptr_ring_buf1, FLOAT32 *ptr_ring_buf2) {
  102|  1.66M|  WORD32 i;
  103|  1.66M|  FLOAT32 temp1, temp2, temp3;
  104|  11.6M|  for (i = (LEN_RING_BUF / 2) - 1; i >= 0; i--) {
  ------------------
  |  |   22|  1.66M|#define LEN_RING_BUF (12)
  ------------------
  |  Branch (104:36): [True: 9.96M, False: 1.66M]
  ------------------
  105|  9.96M|    temp1 = *ptr_iir_ring1++;
  106|  9.96M|    temp2 = *ptr_iir_ring2++;
  107|  9.96M|    temp3 = *ptr_iir_ring1++;
  108|       |
  109|  9.96M|    *ptr_ring_buf1++ = temp1;
  110|  9.96M|    temp1 = *ptr_iir_ring2++;
  111|  9.96M|    *ptr_ring_buf2++ = temp2;
  112|  9.96M|    *ptr_ring_buf1++ = temp3;
  113|  9.96M|    *ptr_ring_buf2++ = temp1;
  114|  9.96M|  }
  115|  1.66M|}
ixheaace_resampler.c:ia_enhaacplus_enc_downsample_iir_filter:
   31|   830k|    WORD32 out_stride, FLOAT32 *ptr_ring_buf1, FLOAT32 *ptr_ring_buf2) {
   32|   830k|  WORD32 i;
   33|   830k|  ixheaace_iir_filter *pstr_iir_filter = &(pstr_down_sampler->iir_filter);
   34|   830k|  FLOAT32 *ptr_iir_ring1, *ptr_iir_ring2;
   35|   830k|  FLOAT32 coeff_temp_a, coeff_temp_b;
   36|   830k|  const FLOAT32 *ptr_coeff_filt = (FLOAT32 *)pstr_iir_filter->ptr_coeff_iir_num;
   37|   830k|  FLOAT32 iir_out = 0;
   38|   830k|  FLOAT32 temp1 = 0.f, temp2 = 0.f;
   39|       |
   40|   830k|  *num_out_samples = 0;
   41|   830k|  ptr_iir_ring1 = ptr_ring_buf1;
   42|   830k|  ptr_iir_ring2 = ptr_ring_buf2;
   43|       |
   44|  1.85G|  for (i = 0; i < num_in_samples; i++) {
  ------------------
  |  Branch (44:15): [True: 1.85G, False: 830k]
  ------------------
   45|  1.85G|    temp1 = ptr_in_samples[i * in_stride] / 2;
   46|  1.85G|    ptr_iir_ring1[i] = temp1;
   47|  1.85G|    coeff_temp_b = *ptr_coeff_filt;
   48|  1.85G|    temp1 = coeff_temp_b * (temp1 + ptr_iir_ring1[i - 10]);
   49|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 16);
   50|  1.85G|    iir_out = (ptr_iir_ring2[i - 10] * coeff_temp_a);
   51|       |
   52|  1.85G|    coeff_temp_b = *(ptr_coeff_filt + 1);
   53|  1.85G|    temp1 = (coeff_temp_b * (ptr_iir_ring1[i - 1] + ptr_iir_ring1[i - 9])) + temp1;
   54|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 7);
   55|  1.85G|    temp2 = (ptr_iir_ring2[i - 1] * coeff_temp_a) + iir_out;
   56|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 15);
   57|  1.85G|    iir_out = (ptr_iir_ring2[i - 9] * coeff_temp_a) + temp2;
   58|       |
   59|  1.85G|    coeff_temp_b = *(ptr_coeff_filt + 2);
   60|  1.85G|    temp1 = (coeff_temp_b * (ptr_iir_ring1[i - 2] + ptr_iir_ring1[i - 8])) + temp1;
   61|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 8);
   62|  1.85G|    temp2 = (ptr_iir_ring2[i - 2] * coeff_temp_a) + iir_out;
   63|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 14);
   64|  1.85G|    iir_out = (ptr_iir_ring2[i - 8] * coeff_temp_a) + temp2;
   65|       |
   66|  1.85G|    coeff_temp_b = *(ptr_coeff_filt + 3);
   67|  1.85G|    temp1 = (coeff_temp_b * (ptr_iir_ring1[i - 3] + ptr_iir_ring1[i - 7])) + temp1;
   68|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 9);
   69|  1.85G|    temp2 = (ptr_iir_ring2[i - 3] * coeff_temp_a) + iir_out;
   70|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 13);
   71|  1.85G|    iir_out = (ptr_iir_ring2[i - 7] * coeff_temp_a) + temp2;
   72|       |
   73|  1.85G|    coeff_temp_b = *(ptr_coeff_filt + 4);
   74|  1.85G|    temp1 = (coeff_temp_b * (ptr_iir_ring1[i - 4] + ptr_iir_ring1[i - 6])) + temp1;
   75|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 10);
   76|  1.85G|    temp2 = (ptr_iir_ring2[i - 4] * coeff_temp_a) + iir_out;
   77|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 12);
   78|  1.85G|    iir_out = (ptr_iir_ring2[i - 6] * coeff_temp_a) + temp2;
   79|       |
   80|  1.85G|    coeff_temp_b = *(ptr_coeff_filt + 5);
   81|  1.85G|    temp1 = (coeff_temp_b * ptr_iir_ring1[i - 5]) + temp1;
   82|  1.85G|    coeff_temp_a = *(ptr_coeff_filt + 11);
   83|  1.85G|    iir_out = (ptr_iir_ring2[i - 5] * coeff_temp_a) + iir_out;
   84|  1.85G|    iir_out = temp1 - iir_out;
   85|       |
   86|  1.85G|    ptr_iir_ring2[i] = iir_out;
   87|  1.85G|    iir_out = (iir_out * (4681.0f / 32767.0f) * pstr_iir_filter->max);
   88|       |
   89|  1.85G|    pstr_down_sampler->pending++;
   90|       |
   91|  1.85G|    if (pstr_down_sampler->pending == pstr_down_sampler->ratio) {
  ------------------
  |  Branch (91:9): [True: 784M, False: 1.06G]
  ------------------
   92|   784M|      ptr_out_samples[(*num_out_samples) * out_stride] = iir_out;
   93|   784M|      (*num_out_samples)++;
   94|       |
   95|   784M|      pstr_down_sampler->pending = 0;
   96|   784M|    }
   97|  1.85G|  }
   98|   830k|}
ixheaace_resampler.c:ia_enhaacplus_enc_copy_ring_buffers_sos:
  121|   665k|                                                    WORD32 len2) {
  122|   665k|  memcpy(ptr_ring_buf1, ptr_iir_ring1, len1 * sizeof(*ptr_ring_buf1));
  123|   665k|  memcpy(ptr_ring_buf2, ptr_iir_ring2, len2 * sizeof(*ptr_ring_buf2));
  124|   665k|}
ixheaace_resampler.c:ia_enhaacplus_enc_update_ring_buffer_sos:
  128|   498k|                                                     WORD32 coeff_idx) {
  129|   498k|  ptr_ring_buf[2 * coeff_idx] = ptr_samples[len - 2 * in_stride];
  130|   498k|  ptr_ring_buf[2 * coeff_idx + 1] = ptr_samples[len - in_stride];
  131|   498k|}
ixheaace_resampler.c:ia_enhaacplus_enc_iir_sos_filter:
  147|   415k|                                             WORD32 coeff_idx) {
  148|   415k|  WORD32 i;
  149|   415k|  ixheaace_iir_sos_filter *pstr_iir_filter = &(pstr_down_sampler->iir_filter);
  150|   415k|  const FLOAT32 *ptr_coeff_den =
  151|   415k|      (pstr_iir_filter->ptr_coeff_iir_den + (coeff_idx * IIR_SOS_COEFFS));
  ------------------
  |  |   28|   415k|#define IIR_SOS_COEFFS (3)
  ------------------
  152|   415k|  const FLOAT32 *ptr_coeff_num =
  153|   415k|      (pstr_iir_filter->ptr_coeff_iir_num + (coeff_idx * IIR_SOS_COEFFS));
  ------------------
  |  |   28|   415k|#define IIR_SOS_COEFFS (3)
  ------------------
  154|   415k|  FLOAT32 iir_out = 0.f;
  155|   415k|  FLOAT32 temp1 = 0.f, temp2 = 0.f;
  156|       |
  157|  2.55G|  for (i = 0; i < num_in_samples; i++) {
  ------------------
  |  Branch (157:15): [True: 2.55G, False: 415k]
  ------------------
  158|  2.55G|    ptr_ring_buf1[2] = ptr_in_samples[i * in_stride];
  159|       |
  160|  2.55G|    temp1 = ptr_coeff_num[0] * ptr_in_samples[i * in_stride] +
  161|  2.55G|            ptr_coeff_num[1] * ptr_ring_buf1[1] + ptr_coeff_num[2] * ptr_ring_buf1[0];
  162|  2.55G|    temp2 = ptr_coeff_den[1] * ptr_ring_buf2[1] + ptr_coeff_den[2] * ptr_ring_buf2[0];
  163|       |
  164|  2.55G|    iir_out = temp1 - temp2;
  165|  2.55G|    ptr_ring_buf2[2] = iir_out;
  166|       |
  167|  2.55G|    ptr_out_samples[i * in_stride] = iir_out;
  168|       |
  169|       |    // Shift ring buffers
  170|  2.55G|    ptr_ring_buf1[0] = ptr_ring_buf1[1];
  171|  2.55G|    ptr_ring_buf1[1] = ptr_ring_buf1[2];
  172|       |
  173|  2.55G|    ptr_ring_buf2[0] = ptr_ring_buf2[1];
  174|  2.55G|    ptr_ring_buf2[1] = ptr_ring_buf2[2];
  175|  2.55G|  }
  176|   415k|}

ia_enhaacplus_enc_init_iir_resampler:
   34|  12.1k|{
   35|  12.1k|  struct ixheaace_iir_params const *current_set = NULL;
   36|  12.1k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  12.1k|#define IA_NO_ERROR 0x00000000
  ------------------
   37|       |
   38|  12.1k|  if (pstr_resampler == NULL) {
  ------------------
  |  Branch (38:7): [True: 0, False: 12.1k]
  ------------------
   39|      0|    return IA_EXHEAACE_INIT_FATAL_RESAMPLER_INIT_FAILED;
   40|      0|  }
   41|       |
   42|  12.1k|  memset(pstr_resampler->iir_filter.ring_buf_1, 0,
   43|  12.1k|         (LEN_RING_BUF * sizeof(pstr_resampler->iir_filter.ring_buf_1[0])));
  ------------------
  |  |   22|  12.1k|#define LEN_RING_BUF (12)
  ------------------
   44|  12.1k|  memset(pstr_resampler->iir_filter.ring_buf_2, 0,
   45|  12.1k|         (LEN_RING_BUF * sizeof(pstr_resampler->iir_filter.ring_buf_2[0])));
  ------------------
  |  |   22|  12.1k|#define LEN_RING_BUF (12)
  ------------------
   46|       |
   47|  12.1k|  current_set = &(pstr_resampler_table->iir_param_set);
   48|       |
   49|  12.1k|  pstr_resampler->iir_filter.ptr_coeff_iir_den = current_set->coeff_iir_den;
   50|  12.1k|  pstr_resampler->iir_filter.ptr_coeff_iir_num = current_set->coeff_iir_num;
   51|  12.1k|  pstr_resampler->iir_filter.max = current_set->max;
   52|  12.1k|  pstr_resampler->delay = current_set->delay;
   53|  12.1k|  pstr_resampler->ratio = ratio;
   54|  12.1k|  pstr_resampler->pending = ratio - 1;
   55|       |
   56|  12.1k|  return error;
   57|  12.1k|}
ia_enhaacplus_enc_init_iir_sos_resampler:
   62|  1.07k|{
   63|  1.07k|  struct ixheaace_iir_params_sos const *current_set = NULL;
   64|  1.07k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.07k|#define IA_NO_ERROR 0x00000000
  ------------------
   65|       |
   66|  1.07k|  if (pstr_resampler == NULL) {
  ------------------
  |  Branch (66:7): [True: 0, False: 1.07k]
  ------------------
   67|      0|    error = IA_EXHEAACE_INIT_FATAL_USAC_RESAMPLER_INIT_FAILED;
   68|      0|    return error;
   69|      0|  }
   70|       |
   71|  1.07k|  memset(pstr_resampler->iir_filter.ring_buf_sos_1, 0,
   72|  1.07k|         (LEN_RING_BUF_SOS_1 * sizeof(pstr_resampler->iir_filter.ring_buf_sos_1[0])));
  ------------------
  |  |   23|  1.07k|#define LEN_RING_BUF_SOS_1 (2)
  ------------------
   73|  1.07k|  memset(pstr_resampler->iir_filter.ring_buf_sos_2, 0,
   74|  1.07k|         (LEN_RING_BUF_SOS_2 * sizeof(pstr_resampler->iir_filter.ring_buf_sos_2[0])));
  ------------------
  |  |   24|  1.07k|#define LEN_RING_BUF_SOS_2 (10)
  ------------------
   75|       |
   76|  1.07k|  current_set = &(pstr_resampler_table->iir_param_set_sos);
   77|       |
   78|  1.07k|  pstr_resampler->iir_filter.ptr_coeff_iir_den = &current_set->coeff_iir_sos_den[0][0];
   79|  1.07k|  pstr_resampler->iir_filter.ptr_coeff_iir_num = &current_set->coeff_iir_sos_num[0][0];
   80|  1.07k|  pstr_resampler->ratio = ratio;
   81|  1.07k|  pstr_resampler->pending = ratio - 1;
   82|  1.07k|  pstr_resampler->iir_filter.gain_sos = current_set->gain_sos;
   83|  1.07k|  pstr_resampler->delay = current_set->delay;
   84|       |
   85|  1.07k|  return error;
   86|  1.07k|}

ixheaace_init_sbr_huffman_tabs:
   59|  64.8k|                               ixheaace_str_sbr_huff_tabs *pstr_sbr_huff_tabs) {
   60|  64.8k|  pstr_sbr_env->init_sbr_amp_res = amp_res;
   61|       |
   62|  64.8k|  switch (amp_res) {
   63|  35.2k|    case IXHEAACE_SBR_AMP_RES_3_0:
  ------------------
  |  Branch (63:5): [True: 35.2k, False: 29.6k]
  ------------------
   64|       |
   65|  35.2k|      pstr_sbr_env->ptr_huff_tab_lvl_time_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c11t;
   66|  35.2k|      pstr_sbr_env->ptr_huff_tab_lvl_time_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l11t;
   67|  35.2k|      pstr_sbr_env->ptr_huff_tab_bal_time_c = pstr_sbr_huff_tabs->book_sbr_env_bal_c11t;
   68|  35.2k|      pstr_sbr_env->ptr_huff_tab_bal_time_l = pstr_sbr_huff_tabs->book_sbr_env_bal_l11t;
   69|       |
   70|  35.2k|      pstr_sbr_env->ptr_huff_tab_lvl_freq_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c11f;
   71|  35.2k|      pstr_sbr_env->ptr_huff_tab_lvl_freq_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l11f;
   72|  35.2k|      pstr_sbr_env->ptr_huff_tab_bal_freq_c = pstr_sbr_huff_tabs->book_sbr_env_bal_c11f;
   73|  35.2k|      pstr_sbr_env->ptr_huff_tab_bal_freq_l = pstr_sbr_huff_tabs->book_sbr_env_bal_l11f;
   74|       |
   75|  35.2k|      pstr_sbr_env->ptr_huff_tab_time_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c11t;
   76|  35.2k|      pstr_sbr_env->ptr_huff_tab_time_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l11t;
   77|  35.2k|      pstr_sbr_env->ptr_huff_tab_freq_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c11f;
   78|  35.2k|      pstr_sbr_env->ptr_huff_tab_freq_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l11f;
   79|       |
   80|  35.2k|      pstr_sbr_env->code_book_scf_lav_balance = CODE_BCK_SCF_LAV_BALANCE11;
  ------------------
  |  |  182|  35.2k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
   81|  35.2k|      pstr_sbr_env->code_book_scf_lav = CODE_BCK_SCF_LAV11;
  ------------------
  |  |  181|  35.2k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
   82|       |
   83|  35.2k|      pstr_sbr_env->si_sbr_start_env_bits = SI_SBR_START_ENV_BITS_AMP_RES_3_0;
  ------------------
  |  |  157|  35.2k|#define SI_SBR_START_ENV_BITS_AMP_RES_3_0 (6)
  ------------------
   84|  35.2k|      pstr_sbr_env->si_sbr_start_env_bits_balance = SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_3_0;
  ------------------
  |  |  158|  35.2k|#define SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_3_0 (5)
  ------------------
   85|  35.2k|      break;
   86|       |
   87|  29.6k|    case IXHEAACE_SBR_AMP_RES_1_5:
  ------------------
  |  Branch (87:5): [True: 29.6k, False: 35.2k]
  ------------------
   88|       |
   89|  29.6k|      pstr_sbr_env->ptr_huff_tab_lvl_time_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c10t;
   90|  29.6k|      pstr_sbr_env->ptr_huff_tab_lvl_time_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l10t;
   91|  29.6k|      pstr_sbr_env->ptr_huff_tab_bal_time_c = pstr_sbr_huff_tabs->book_sbr_env_bal_c10t;
   92|  29.6k|      pstr_sbr_env->ptr_huff_tab_bal_time_l = pstr_sbr_huff_tabs->book_sbr_env_bal_l10t;
   93|       |
   94|  29.6k|      pstr_sbr_env->ptr_huff_tab_lvl_freq_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c10f;
   95|  29.6k|      pstr_sbr_env->ptr_huff_tab_lvl_freq_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l10f;
   96|  29.6k|      pstr_sbr_env->ptr_huff_tab_bal_freq_c = pstr_sbr_huff_tabs->book_sbr_env_bal_c10f;
   97|  29.6k|      pstr_sbr_env->ptr_huff_tab_bal_freq_l = pstr_sbr_huff_tabs->book_sbr_env_bal_l10f;
   98|       |
   99|  29.6k|      pstr_sbr_env->ptr_huff_tab_time_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c10t;
  100|  29.6k|      pstr_sbr_env->ptr_huff_tab_time_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l10t;
  101|  29.6k|      pstr_sbr_env->ptr_huff_tab_freq_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c10f;
  102|  29.6k|      pstr_sbr_env->ptr_huff_tab_freq_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l10f;
  103|       |
  104|  29.6k|      pstr_sbr_env->code_book_scf_lav_balance = CODE_BCK_SCF_LAV_BALANCE10;
  ------------------
  |  |  183|  29.6k|#define CODE_BCK_SCF_LAV_BALANCE10 (24)
  ------------------
  105|  29.6k|      pstr_sbr_env->code_book_scf_lav = CODE_BCK_SCF_LAV10;
  ------------------
  |  |  180|  29.6k|#define CODE_BCK_SCF_LAV10 (60)
  ------------------
  106|       |
  107|  29.6k|      pstr_sbr_env->si_sbr_start_env_bits = SI_SBR_START_ENV_BITS_AMP_RES_1_5;
  ------------------
  |  |  162|  29.6k|#define SI_SBR_START_ENV_BITS_AMP_RES_1_5 (7)
  ------------------
  108|  29.6k|      pstr_sbr_env->si_sbr_start_env_bits_balance = SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_1_5;
  ------------------
  |  |  163|  29.6k|#define SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_1_5 (6)
  ------------------
  109|  29.6k|      break;
  110|       |
  111|      0|    default:
  ------------------
  |  Branch (111:5): [True: 0, False: 64.8k]
  ------------------
  112|      0|      return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_AMP_RES;
  113|      0|      break;
  114|  64.8k|  }
  115|       |
  116|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_lvl_time_c = pstr_sbr_huff_tabs->v_huff_noise_lvl_c11t;
  117|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_lvl_time_l = pstr_sbr_huff_tabs->v_huff_noise_lvl_l11t;
  118|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_bal_time_c = pstr_sbr_huff_tabs->book_sbr_noise_bal_c11t;
  119|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_bal_time_l = pstr_sbr_huff_tabs->book_sbr_noise_bal_l11t;
  120|       |
  121|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_lvl_freq_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c11f;
  122|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_lvl_freq_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l11f;
  123|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_bal_freq_c = pstr_sbr_huff_tabs->book_sbr_env_bal_c11f;
  124|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_bal_freq_l = pstr_sbr_huff_tabs->book_sbr_env_bal_l11f;
  125|       |
  126|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_time_c = pstr_sbr_huff_tabs->v_huff_noise_lvl_c11t;
  127|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_time_l = pstr_sbr_huff_tabs->v_huff_noise_lvl_l11t;
  128|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_freq_c = pstr_sbr_huff_tabs->v_huff_env_lvl_c11f;
  129|  64.8k|  pstr_sbr_env->ptr_huff_tab_noise_freq_l = pstr_sbr_huff_tabs->v_huff_env_lvl_l11f;
  130|       |
  131|  64.8k|  pstr_sbr_env->si_sbr_start_noise_bits = SI_SBR_START_NOISE_BITS_AMP_RES_3_0;
  ------------------
  |  |  159|  64.8k|#define SI_SBR_START_NOISE_BITS_AMP_RES_3_0 (5)
  ------------------
  132|  64.8k|  pstr_sbr_env->si_sbr_start_noise_bits_balance = SI_SBR_START_NOISE_BITS_BALANCE_AMP_RES_3_0;
  ------------------
  |  |  160|  64.8k|#define SI_SBR_START_NOISE_BITS_BALANCE_AMP_RES_3_0 (5)
  ------------------
  133|       |
  134|  64.8k|  pstr_code_env->code_book_scf_lav_bal_time = pstr_sbr_env->code_book_scf_lav_balance;
  135|  64.8k|  pstr_code_env->code_book_scf_lav_bal_freq = pstr_sbr_env->code_book_scf_lav_balance;
  136|  64.8k|  pstr_code_env->code_book_scf_lav_lvl_time = pstr_sbr_env->code_book_scf_lav;
  137|  64.8k|  pstr_code_env->code_book_scf_lav_lvl_freq = pstr_sbr_env->code_book_scf_lav;
  138|  64.8k|  pstr_code_env->code_book_scf_lav_time = pstr_sbr_env->code_book_scf_lav;
  139|  64.8k|  pstr_code_env->code_book_scf_lav_freq = pstr_sbr_env->code_book_scf_lav;
  140|       |
  141|  64.8k|  pstr_code_env->ptr_huff_tab_lvl_time_l = pstr_sbr_env->ptr_huff_tab_lvl_time_l;
  142|  64.8k|  pstr_code_env->ptr_huff_tab_bal_time_l = pstr_sbr_env->ptr_huff_tab_bal_time_l;
  143|  64.8k|  pstr_code_env->ptr_huff_tab_time_l = pstr_sbr_env->ptr_huff_tab_time_l;
  144|  64.8k|  pstr_code_env->ptr_huff_tab_lvl_freq_l = pstr_sbr_env->ptr_huff_tab_lvl_freq_l;
  145|  64.8k|  pstr_code_env->ptr_huff_tab_bal_freq_l = pstr_sbr_env->ptr_huff_tab_bal_freq_l;
  146|  64.8k|  pstr_code_env->ptr_huff_tab_freq_l = pstr_sbr_env->ptr_huff_tab_freq_l;
  147|       |
  148|  64.8k|  pstr_code_env->code_book_scf_lav_freq = pstr_sbr_env->code_book_scf_lav;
  149|  64.8k|  pstr_code_env->code_book_scf_lav_time = pstr_sbr_env->code_book_scf_lav;
  150|       |
  151|  64.8k|  pstr_code_env->start_bits = pstr_sbr_env->si_sbr_start_env_bits;
  152|  64.8k|  pstr_code_env->start_bits_balance = pstr_sbr_env->si_sbr_start_env_bits_balance;
  153|       |
  154|  64.8k|  pstr_noise->code_book_scf_lav_bal_time = CODE_BCK_SCF_LAV_BALANCE11;
  ------------------
  |  |  182|  64.8k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
  155|  64.8k|  pstr_noise->code_book_scf_lav_bal_freq = CODE_BCK_SCF_LAV_BALANCE11;
  ------------------
  |  |  182|  64.8k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
  156|  64.8k|  pstr_noise->code_book_scf_lav_lvl_time = CODE_BCK_SCF_LAV11;
  ------------------
  |  |  181|  64.8k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  157|  64.8k|  pstr_noise->code_book_scf_lav_lvl_freq = CODE_BCK_SCF_LAV11;
  ------------------
  |  |  181|  64.8k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  158|  64.8k|  pstr_noise->code_book_scf_lav_time = CODE_BCK_SCF_LAV11;
  ------------------
  |  |  181|  64.8k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  159|  64.8k|  pstr_noise->code_book_scf_lav_freq = CODE_BCK_SCF_LAV11;
  ------------------
  |  |  181|  64.8k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  160|       |
  161|  64.8k|  pstr_noise->ptr_huff_tab_lvl_time_l = pstr_sbr_env->ptr_huff_tab_noise_lvl_time_l;
  162|  64.8k|  pstr_noise->ptr_huff_tab_bal_time_l = pstr_sbr_env->ptr_huff_tab_noise_bal_time_l;
  163|  64.8k|  pstr_noise->ptr_huff_tab_time_l = pstr_sbr_env->ptr_huff_tab_noise_time_l;
  164|  64.8k|  pstr_noise->ptr_huff_tab_lvl_freq_l = pstr_sbr_env->ptr_huff_tab_noise_lvl_freq_l;
  165|  64.8k|  pstr_noise->ptr_huff_tab_bal_freq_l = pstr_sbr_env->ptr_huff_tab_noise_bal_freq_l;
  166|  64.8k|  pstr_noise->ptr_huff_tab_freq_l = pstr_sbr_env->ptr_huff_tab_noise_freq_l;
  167|       |
  168|  64.8k|  pstr_noise->start_bits = pstr_sbr_env->si_sbr_start_noise_bits;
  169|  64.8k|  pstr_noise->start_bits_balance = pstr_sbr_env->si_sbr_start_noise_bits_balance;
  170|       |
  171|  64.8k|  pstr_code_env->update = 0;
  172|  64.8k|  pstr_noise->update = 0;
  173|       |
  174|  64.8k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  64.8k|#define IA_NO_ERROR 0x00000000
  ------------------
  175|  64.8k|}
ixheaace_create_sbr_code_envelope:
  179|  17.2k|                                       FLOAT32 df_edge_first_env, FLOAT32 df_edge_incr) {
  180|  17.2k|  memset(pstr_code_env, 0, sizeof(ixheaace_str_sbr_code_envelope));
  181|       |
  182|  17.2k|  pstr_code_env->delta_t_across_frames = delta_t_across_frames;
  183|  17.2k|  pstr_code_env->df_edge_1st_env = df_edge_first_env;
  184|  17.2k|  pstr_code_env->df_edge_incr = df_edge_incr;
  185|  17.2k|  pstr_code_env->df_edge_incr_fac = 0;
  186|  17.2k|  pstr_code_env->update = 0;
  187|  17.2k|  pstr_code_env->num_scf[FREQ_RES_LOW] = num_sfb[FREQ_RES_LOW];
  188|  17.2k|  pstr_code_env->num_scf[FREQ_RES_HIGH] = num_sfb[FREQ_RES_HIGH];
  189|       |
  190|  17.2k|  pstr_code_env->offset =
  191|  17.2k|      2 * pstr_code_env->num_scf[FREQ_RES_LOW] - pstr_code_env->num_scf[FREQ_RES_HIGH];
  192|  17.2k|}

ixheaace_code_envelope:
   72|  1.52M|                                    WORD32 is_ld_sbr) {
   73|  1.52M|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.52M|#define IA_NO_ERROR 0x00000000
  ------------------
   74|  1.52M|  WORD32 i, no_of_bands, band, last_nrg, current_energy;
   75|  1.52M|  WORD32 *ptr_energy;
   76|       |
   77|  1.52M|  WORD32 code_book_scf_lav_lvl_time;
   78|  1.52M|  WORD32 code_book_scf_lav_lvl_freq;
   79|  1.52M|  WORD32 code_book_scf_lav_bal_time;
   80|  1.52M|  WORD32 code_book_scf_lav_bal_freq;
   81|  1.52M|  const UWORD8 *ptr_huff_tab_lvl_time_l;
   82|  1.52M|  const UWORD8 *ptr_huff_tab_bal_time_l;
   83|  1.52M|  const UWORD8 *ptr_huff_tab_lvl_freq_l;
   84|  1.52M|  const UWORD8 *ptr_huff_tab_bal_freq_l;
   85|       |
   86|  1.52M|  WORD32 offset = pstr_code_env->offset;
   87|  1.52M|  WORD32 env_data_tab_comp_factor;
   88|       |
   89|  1.52M|  WORD32 delta_f_bits = 0, delta_t_bits = 0;
   90|       |
   91|  1.52M|  WORD32 use_dt;
   92|       |
   93|  1.52M|  WORD32 delta_f[MAXIMUM_FREQ_COEFFS];
   94|  1.52M|  WORD32 delta_t[MAXIMUM_FREQ_COEFFS];
   95|       |
   96|  1.52M|  FLOAT32 df_edge_first_ennv;
   97|       |
   98|  1.52M|  df_edge_first_ennv = pstr_code_env->df_edge_1st_env +
   99|  1.52M|                       pstr_code_env->df_edge_incr * pstr_code_env->df_edge_incr_fac;
  100|       |
  101|  1.52M|  switch (coupling) {
  102|   365k|    case COUPLING_1:
  ------------------
  |  |   22|   365k|#define COUPLING_1 (1)
  ------------------
  |  Branch (102:5): [True: 365k, False: 1.15M]
  ------------------
  103|   365k|      code_book_scf_lav_lvl_time = pstr_code_env->code_book_scf_lav_lvl_time;
  104|   365k|      code_book_scf_lav_lvl_freq = pstr_code_env->code_book_scf_lav_lvl_freq;
  105|   365k|      code_book_scf_lav_bal_time = pstr_code_env->code_book_scf_lav_bal_time;
  106|   365k|      code_book_scf_lav_bal_freq = pstr_code_env->code_book_scf_lav_bal_freq;
  107|   365k|      ptr_huff_tab_lvl_time_l = pstr_code_env->ptr_huff_tab_lvl_time_l;
  108|   365k|      ptr_huff_tab_bal_time_l = pstr_code_env->ptr_huff_tab_bal_time_l;
  109|   365k|      ptr_huff_tab_lvl_freq_l = pstr_code_env->ptr_huff_tab_lvl_freq_l;
  110|   365k|      ptr_huff_tab_bal_freq_l = pstr_code_env->ptr_huff_tab_bal_freq_l;
  111|   365k|      break;
  112|  1.15M|    default:
  ------------------
  |  Branch (112:5): [True: 1.15M, False: 365k]
  ------------------
  113|  1.15M|      code_book_scf_lav_lvl_time = pstr_code_env->code_book_scf_lav_time;
  114|  1.15M|      code_book_scf_lav_lvl_freq = pstr_code_env->code_book_scf_lav_freq;
  115|  1.15M|      code_book_scf_lav_bal_time = pstr_code_env->code_book_scf_lav_time;
  116|  1.15M|      code_book_scf_lav_bal_freq = pstr_code_env->code_book_scf_lav_freq;
  117|  1.15M|      ptr_huff_tab_lvl_time_l = pstr_code_env->ptr_huff_tab_time_l;
  118|  1.15M|      ptr_huff_tab_bal_time_l = pstr_code_env->ptr_huff_tab_time_l;
  119|  1.15M|      ptr_huff_tab_lvl_freq_l = pstr_code_env->ptr_huff_tab_freq_l;
  120|  1.15M|      ptr_huff_tab_bal_freq_l = pstr_code_env->ptr_huff_tab_freq_l;
  121|  1.52M|  }
  122|       |
  123|  1.52M|  if (coupling == 1 && channel == 1) {
  ------------------
  |  Branch (123:7): [True: 365k, False: 1.15M]
  |  Branch (123:24): [True: 182k, False: 183k]
  ------------------
  124|   182k|    env_data_tab_comp_factor = 1;
  125|  1.34M|  } else {
  126|  1.34M|    env_data_tab_comp_factor = 0;
  127|  1.34M|  }
  128|       |
  129|  1.52M|  if (pstr_code_env->delta_t_across_frames == 0 || header_active) {
  ------------------
  |  Branch (129:7): [True: 0, False: 1.52M]
  |  Branch (129:52): [True: 182k, False: 1.34M]
  ------------------
  130|   182k|    pstr_code_env->update = 0;
  131|   182k|  }
  132|       |
  133|  3.87M|  for (i = 0; i < num_envelopes; i++) {
  ------------------
  |  Branch (133:15): [True: 2.35M, False: 1.52M]
  ------------------
  134|  2.35M|    if (freq_res[i] == FREQ_RES_HIGH)
  ------------------
  |  Branch (134:9): [True: 1.85M, False: 493k]
  ------------------
  135|  1.85M|      no_of_bands = pstr_code_env->num_scf[FREQ_RES_HIGH];
  136|   493k|    else
  137|   493k|      no_of_bands = pstr_code_env->num_scf[FREQ_RES_LOW];
  138|       |
  139|  2.35M|    ptr_energy = ptr_sfb_energy;
  140|  2.35M|    current_energy = *ptr_energy;
  141|  2.35M|    delta_f[0] = ixheaac_shr32(current_energy, env_data_tab_comp_factor);
  142|  2.35M|    if (coupling && channel == 1)
  ------------------
  |  Branch (142:9): [True: 575k, False: 1.77M]
  |  Branch (142:21): [True: 287k, False: 288k]
  ------------------
  143|   287k|      delta_f_bits = pstr_code_env->start_bits_balance;
  144|  2.06M|    else
  145|  2.06M|      delta_f_bits = pstr_code_env->start_bits;
  146|       |
  147|  2.35M|    if (pstr_code_env->update != 0) {
  ------------------
  |  Branch (147:9): [True: 1.75M, False: 593k]
  ------------------
  148|  1.75M|      delta_t[0] = ixheaac_shr32((current_energy - pstr_code_env->sfb_nrg_prev[0]),
  149|  1.75M|                                 env_data_tab_comp_factor);
  150|       |
  151|  1.75M|      err_code = ixheaace_compute_bits(delta_t[0], code_book_scf_lav_lvl_time,
  152|  1.75M|                                       code_book_scf_lav_bal_time, ptr_huff_tab_lvl_time_l,
  153|  1.75M|                                       ptr_huff_tab_bal_time_l, coupling, channel, &delta_t_bits);
  154|  1.75M|      if (err_code) {
  ------------------
  |  Branch (154:11): [True: 998, False: 1.75M]
  ------------------
  155|    998|        return err_code;
  156|    998|      }
  157|  1.75M|    }
  158|       |
  159|  2.35M|    ixheaace_map_low_res_energy_value(current_energy, pstr_code_env->sfb_nrg_prev, offset, 0,
  160|  2.35M|                                      freq_res[i]);
  161|       |
  162|  2.35M|    band = no_of_bands - 1;
  163|  16.2M|    while (band > 0) {
  ------------------
  |  Branch (163:12): [True: 13.8M, False: 2.35M]
  ------------------
  164|  13.8M|      if (ptr_energy[band] - ptr_energy[band - 1] > code_book_scf_lav_lvl_freq) {
  ------------------
  |  Branch (164:11): [True: 469, False: 13.8M]
  ------------------
  165|    469|        ptr_energy[band - 1] = ptr_energy[band] - code_book_scf_lav_lvl_freq;
  166|    469|      }
  167|  13.8M|      band--;
  168|  13.8M|    }
  169|       |
  170|  2.35M|    band = 1;
  171|  16.2M|    while (band < no_of_bands) {
  ------------------
  |  Branch (171:12): [True: 13.8M, False: 2.35M]
  ------------------
  172|  13.8M|      WORD32 index;
  173|  13.8M|      WORD32 delta_lcl_bits = 0;
  174|       |
  175|  13.8M|      if (ixheaac_sub32_sat(ptr_energy[band - 1], ptr_energy[band]) >
  ------------------
  |  Branch (175:11): [True: 1.44M, False: 12.4M]
  ------------------
  176|  13.8M|          code_book_scf_lav_lvl_freq) {
  177|  1.44M|        ptr_energy[band] = ptr_energy[band - 1] - code_book_scf_lav_lvl_freq;
  178|  1.44M|      }
  179|       |
  180|  13.8M|      last_nrg = *ptr_energy++;
  181|  13.8M|      current_energy = *ptr_energy;
  182|  13.8M|      delta_f[band] = ixheaac_shr32((current_energy - last_nrg), env_data_tab_comp_factor);
  183|       |
  184|  13.8M|      err_code = ixheaace_compute_bits(
  185|  13.8M|          delta_f[band], code_book_scf_lav_lvl_freq, code_book_scf_lav_bal_freq,
  186|  13.8M|          ptr_huff_tab_lvl_freq_l, ptr_huff_tab_bal_freq_l, coupling, channel, &delta_lcl_bits);
  187|  13.8M|      if (err_code) {
  ------------------
  |  Branch (187:11): [True: 11, False: 13.8M]
  ------------------
  188|     11|        return err_code;
  189|     11|      }
  190|  13.8M|      delta_f_bits += delta_lcl_bits;
  191|       |
  192|  13.8M|      if (pstr_code_env->update != 0) {
  ------------------
  |  Branch (192:11): [True: 10.5M, False: 3.33M]
  ------------------
  193|  10.5M|        delta_lcl_bits = 0;
  194|  10.5M|        index = ixheaace_index_low2_high(offset, band, freq_res[i]);
  195|  10.5M|        delta_t[band] = current_energy - pstr_code_env->sfb_nrg_prev[index];
  196|  10.5M|        delta_t[band] = ixheaac_shr32(delta_t[band], env_data_tab_comp_factor);
  197|       |
  198|  10.5M|        ixheaace_map_low_res_energy_value(current_energy, pstr_code_env->sfb_nrg_prev, offset,
  199|  10.5M|                                          band, freq_res[i]);
  200|  10.5M|        if ((delta_t[band] > 31) || (delta_t[band] < -31)) {
  ------------------
  |  Branch (200:13): [True: 2.15k, False: 10.5M]
  |  Branch (200:37): [True: 1.09k, False: 10.5M]
  ------------------
  201|  3.24k|          delta_t[band] = 31;
  202|  3.24k|        }
  203|       |
  204|  10.5M|        err_code = ixheaace_compute_bits(
  205|  10.5M|            delta_t[band], code_book_scf_lav_lvl_time, code_book_scf_lav_bal_time,
  206|  10.5M|            ptr_huff_tab_lvl_time_l, ptr_huff_tab_bal_time_l, coupling, channel, &delta_lcl_bits);
  207|  10.5M|        if (err_code) {
  ------------------
  |  Branch (207:13): [True: 60, False: 10.5M]
  ------------------
  208|     60|          return err_code;
  209|     60|        }
  210|  10.5M|        delta_t_bits += delta_lcl_bits;
  211|  10.5M|      } else {
  212|  3.33M|        ixheaace_map_low_res_energy_value(current_energy, pstr_code_env->sfb_nrg_prev, offset,
  213|  3.33M|                                          band, freq_res[i]);
  214|  3.33M|      }
  215|  13.8M|      band++;
  216|  13.8M|    }
  217|       |
  218|  2.35M|    if (i == 0) {
  ------------------
  |  Branch (218:9): [True: 1.52M, False: 827k]
  ------------------
  219|  1.52M|      use_dt = (pstr_code_env->update != 0 &&
  ------------------
  |  Branch (219:17): [True: 931k, False: 593k]
  ------------------
  220|   931k|                (delta_f_bits > delta_t_bits * (1 + df_edge_first_ennv)));
  ------------------
  |  Branch (220:17): [True: 494k, False: 436k]
  ------------------
  221|  1.52M|    } else if (is_ld_sbr) {
  ------------------
  |  Branch (221:16): [True: 169k, False: 658k]
  ------------------
  222|   169k|      use_dt = ((pstr_code_env->update != 0) && (delta_f_bits > delta_t_bits));
  ------------------
  |  Branch (222:17): [True: 169k, False: 0]
  |  Branch (222:49): [True: 42.5k, False: 126k]
  ------------------
  223|   658k|    } else {
  224|   658k|      use_dt = (delta_f_bits > delta_t_bits);
  225|   658k|    }
  226|       |
  227|  2.35M|    if (use_dt) {
  ------------------
  |  Branch (227:9): [True: 849k, False: 1.50M]
  ------------------
  228|   849k|      ptr_dir_vec[i] = TIME;
  ------------------
  |  |  177|   849k|#define TIME (1)
  ------------------
  229|   849k|      memcpy(ptr_sfb_energy, delta_t, no_of_bands * sizeof(ptr_sfb_energy[0]));
  230|  1.50M|    } else {
  231|  1.50M|      ptr_dir_vec[i] = FREQ;
  ------------------
  |  |  176|  1.50M|#define FREQ (0)
  ------------------
  232|  1.50M|      memcpy(ptr_sfb_energy, delta_f, no_of_bands * sizeof(ptr_sfb_energy[0]));
  233|  1.50M|    }
  234|  2.35M|    if (0 == i && 1 == usac_indep_flag) {
  ------------------
  |  Branch (234:9): [True: 1.52M, False: 827k]
  |  Branch (234:19): [True: 37.9k, False: 1.48M]
  ------------------
  235|  37.9k|      ptr_dir_vec[i] = FREQ;
  ------------------
  |  |  176|  37.9k|#define FREQ (0)
  ------------------
  236|  37.9k|      memcpy(ptr_sfb_energy, delta_f, no_of_bands * sizeof(ptr_sfb_energy[0]));
  237|  37.9k|    }
  238|       |
  239|  2.35M|    ptr_sfb_energy += no_of_bands;
  240|  2.35M|    pstr_code_env->update = 1;
  241|  2.35M|  }
  242|  1.52M|  return err_code;
  243|  1.52M|}
ixheaace_sbr_code_envelope_lp.c:ixheaace_index_low2_high:
   54|  10.5M|static WORD32 ixheaace_index_low2_high(WORD32 offset, WORD32 index, ixheaace_freq_res res) {
   55|  10.5M|  switch (res) {
   56|  2.23M|    case FREQ_RES_LOW:
  ------------------
  |  Branch (56:5): [True: 2.23M, False: 8.29M]
  ------------------
   57|  2.23M|      if (offset >= 0) {
  ------------------
  |  Branch (57:11): [True: 2.23M, False: 0]
  ------------------
   58|  2.23M|        return (index < offset) ? (index) : (2 * index - offset);
  ------------------
  |  Branch (58:16): [True: 0, False: 2.23M]
  ------------------
   59|  2.23M|      } else {
   60|      0|        offset = -offset;
   61|      0|        return (index < offset) ? (3 * index) : (2 * index + offset);
  ------------------
  |  Branch (61:16): [True: 0, False: 0]
  ------------------
   62|      0|      }
   63|  8.29M|    default:
  ------------------
  |  Branch (63:5): [True: 8.29M, False: 2.23M]
  ------------------
   64|  8.29M|      return (index);
   65|  10.5M|  }
   66|  10.5M|}

ixheaace_init_sbr_bitstream:
   56|   424k|                                 ixheaace_sbr_codec_type sbr_codec) {
   57|   424k|  ixheaace_reset_bitbuf(&pstr_cmon_data->str_sbr_bit_buf, ptr_memory_base, memory_size);
   58|       |
   59|   424k|  pstr_cmon_data->str_tmp_write_bit_buf = pstr_cmon_data->str_sbr_bit_buf;
   60|   424k|  if (HEAAC_SBR == sbr_codec) {
  ------------------
  |  Branch (60:7): [True: 138k, False: 286k]
  ------------------
   61|   138k|    ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0, SI_FILL_EXTENTION_BITS);
  ------------------
  |  |   37|   138k|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
   62|       |
   63|   138k|    if (crc_active) {
  ------------------
  |  Branch (63:9): [True: 0, False: 138k]
  ------------------
   64|      0|      ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0, SI_CRC_BITS_SBR);
  ------------------
  |  |   32|      0|#define SI_CRC_BITS_SBR (10)
  ------------------
   65|      0|    }
   66|   138k|  }
   67|   424k|}
ixheaace_assemble_sbr_bitstream:
   70|   413k|                                     ixheaace_sbr_codec_type sbr_codec) {
   71|   413k|  UWORD16 crc_reg = CRCINIT_SBR;
  ------------------
  |  |   26|   413k|#define CRCINIT_SBR (0x0)
  ------------------
   72|   413k|  WORD32 num_crc_bits, i;
   73|   413k|  WORD32 sbr_load = 0;
   74|       |
   75|   413k|  sbr_load = pstr_cmon_data->sbr_hdr_bits + pstr_cmon_data->sbr_data_bits;
   76|       |
   77|   413k|  if (HEAAC_SBR == sbr_codec) {
  ------------------
  |  Branch (77:7): [True: 138k, False: 275k]
  ------------------
   78|   138k|    sbr_load += SI_FILL_EXTENTION_BITS;
  ------------------
  |  |   37|   138k|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
   79|   138k|  }
   80|       |
   81|   413k|  if (pstr_cmon_data->sbr_crc_len) {
  ------------------
  |  Branch (81:7): [True: 0, False: 413k]
  ------------------
   82|      0|    sbr_load += SI_CRC_BITS_SBR;
  ------------------
  |  |   32|      0|#define SI_CRC_BITS_SBR (10)
  ------------------
   83|      0|  }
   84|       |
   85|   413k|  if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (85:7): [True: 211k, False: 201k]
  ------------------
   86|   211k|    pstr_cmon_data->sbr_fill_bits = (8 - (sbr_load) % 8) % 8;
   87|       |
   88|   211k|    ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0,
   89|   211k|                        (UWORD8)pstr_cmon_data->sbr_fill_bits);
   90|   211k|  }
   91|   413k|  if (pstr_cmon_data->sbr_crc_len) {
  ------------------
  |  Branch (91:7): [True: 0, False: 413k]
  ------------------
   92|      0|    ixheaace_bit_buf tmp_crc_buf = pstr_cmon_data->str_sbr_bit_buf;
   93|       |
   94|      0|    ixheaace_readbits(&tmp_crc_buf, SI_FILL_EXTENTION_BITS);
  ------------------
  |  |   37|      0|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
   95|       |
   96|      0|    ixheaace_readbits(&tmp_crc_buf, SI_CRC_BITS_SBR);
  ------------------
  |  |   32|      0|#define SI_CRC_BITS_SBR (10)
  ------------------
   97|       |
   98|      0|    num_crc_bits = pstr_cmon_data->sbr_hdr_bits + pstr_cmon_data->sbr_data_bits +
   99|      0|                   pstr_cmon_data->sbr_fill_bits;
  100|       |
  101|      0|    i = 0;
  102|      0|    while (i < num_crc_bits) {
  ------------------
  |  Branch (102:12): [True: 0, False: 0]
  ------------------
  103|      0|      UWORD32 bit;
  104|       |
  105|      0|      bit = ixheaace_readbits(&tmp_crc_buf, 1);
  106|       |
  107|      0|      ixheaace_crc_advance(CRC_POLYNOMIAL_SBR, CRC_MASK_SBR, &crc_reg, bit, 1);
  ------------------
  |  |   22|      0|#define CRC_POLYNOMIAL_SBR (0x0233)
  ------------------
                    ixheaace_crc_advance(CRC_POLYNOMIAL_SBR, CRC_MASK_SBR, &crc_reg, bit, 1);
  ------------------
  |  |   23|      0|#define CRC_MASK_SBR (0x0200)
  ------------------
  108|       |
  109|      0|      i++;
  110|      0|    }
  111|       |
  112|      0|    crc_reg &= (CRC_RANGE_SBR);
  ------------------
  |  |   24|      0|#define CRC_RANGE_SBR (0x03FF)
  ------------------
  113|      0|  }
  114|       |
  115|   413k|  if (pstr_cmon_data->sbr_crc_len) {
  ------------------
  |  Branch (115:7): [True: 0, False: 413k]
  ------------------
  116|      0|    ixheaace_write_bits(&pstr_cmon_data->str_tmp_write_bit_buf, SI_FIL_CRC_SBR,
  ------------------
  |  |   29|      0|#define SI_FIL_CRC_SBR (14)
  ------------------
  117|      0|                        SI_FILL_EXTENTION_BITS);
  ------------------
  |  |   37|      0|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
  118|       |
  119|      0|    ixheaace_write_bits(&pstr_cmon_data->str_tmp_write_bit_buf, crc_reg, SI_CRC_BITS_SBR);
  ------------------
  |  |   32|      0|#define SI_CRC_BITS_SBR (10)
  ------------------
  120|   413k|  } else {
  121|   413k|    if (HEAAC_SBR == sbr_codec) {
  ------------------
  |  Branch (121:9): [True: 138k, False: 275k]
  ------------------
  122|   138k|      ixheaace_write_bits(&pstr_cmon_data->str_tmp_write_bit_buf, SI_FIL_SBR,
  ------------------
  |  |   28|   138k|#define SI_FIL_SBR (13)
  ------------------
  123|   138k|                          SI_FILL_EXTENTION_BITS);
  ------------------
  |  |   37|   138k|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
  124|   138k|    }
  125|   413k|  }
  126|   413k|}

ixheaace_esbr_qmf_init:
  852|  2.06k|                            WORD32 sbr_ratio_idx, WORD32 output_frame_size) {
  853|  2.06k|  pstr_codec_qmf_bank->pstr_qmf_dec_tabs =
  854|  2.06k|      (ixheaace_str_qmf_dec_tabs_struct *)&ixheaace_str_aac_qmf_tabs;
  855|  2.06k|  memset(
  856|  2.06k|      pstr_codec_qmf_bank->anal_filter_states_32, 0,
  857|  2.06k|      sizeof(pstr_codec_qmf_bank->anal_filter_states_32[0]) * IXHEAACE_QMF_FILTER_STATE_ANA_SIZE);
  ------------------
  |  |   76|  2.06k|#define IXHEAACE_QMF_FILTER_STATE_ANA_SIZE 320
  ------------------
  858|  2.06k|  pstr_codec_qmf_bank->num_time_slots = (WORD16)(output_frame_size / 64);
  859|  2.06k|  pstr_codec_qmf_bank->ptr_filter_pos_32 = ixheaace_str_aac_qmf_tabs.esbr_qmf_c;
  860|  2.06k|  pstr_codec_qmf_bank->ptr_state_new_samples_pos_low_32 =
  861|  2.06k|      pstr_codec_qmf_bank->anal_filter_states_32;
  862|  2.06k|  pstr_codec_qmf_bank->ptr_ana_win_coeff_32 = ixheaace_str_aac_qmf_tabs.esbr_qmf_c;
  863|       |
  864|  2.06k|  switch (sbr_ratio_idx) {
  865|  1.46k|    case USAC_SBR_RATIO_INDEX_2_1:
  ------------------
  |  |  186|  1.46k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  |  Branch (865:5): [True: 1.46k, False: 597]
  ------------------
  866|  1.46k|      pstr_codec_qmf_bank->no_channels = 32;
  867|  1.46k|      pstr_codec_qmf_bank->ptr_esbr_cos_twiddle =
  868|  1.46k|          ixheaace_str_aac_qmf_tabs.esbr_sin_cos_twiddle_l32;
  869|  1.46k|      pstr_codec_qmf_bank->ptr_esbr_alt_sin_twiddle =
  870|  1.46k|          ixheaace_str_aac_qmf_tabs.esbr_alt_sin_twiddle_l32;
  871|  1.46k|      pstr_codec_qmf_bank->ptr_esbr_t_cos = ixheaace_str_aac_qmf_tabs.esbr_t_cos_sin_l32;
  872|  1.46k|      break;
  873|      0|    case USAC_SBR_RATIO_INDEX_8_3:
  ------------------
  |  |  187|      0|#define USAC_SBR_RATIO_INDEX_8_3 (2)
  ------------------
  |  Branch (873:5): [True: 0, False: 2.06k]
  ------------------
  874|      0|      pstr_codec_qmf_bank->no_channels = 24;
  875|      0|      pstr_codec_qmf_bank->ptr_filter_pos_32 = ixheaace_str_aac_qmf_tabs.esbr_qmf_c_24;
  876|      0|      pstr_codec_qmf_bank->ptr_ana_win_coeff_32 = ixheaace_str_aac_qmf_tabs.esbr_qmf_c_24;
  877|      0|      pstr_codec_qmf_bank->ptr_esbr_cos_twiddle =
  878|      0|          ixheaace_str_aac_qmf_tabs.esbr_sin_cos_twiddle_l24;
  879|      0|      pstr_codec_qmf_bank->ptr_esbr_alt_sin_twiddle =
  880|      0|          ixheaace_str_aac_qmf_tabs.esbr_alt_sin_twiddle_l24;
  881|      0|      pstr_codec_qmf_bank->ptr_esbr_t_cos = ixheaace_str_aac_qmf_tabs.esbr_t_cos_sin_l24;
  882|      0|      break;
  883|    597|    case USAC_SBR_RATIO_INDEX_4_1:
  ------------------
  |  |  188|    597|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (883:5): [True: 597, False: 1.46k]
  ------------------
  884|    597|      pstr_codec_qmf_bank->no_channels = 16;
  885|    597|      pstr_codec_qmf_bank->ptr_esbr_cos_twiddle =
  886|    597|          ixheaace_str_aac_qmf_tabs.esbr_sin_cos_twiddle_l16;
  887|    597|      pstr_codec_qmf_bank->ptr_esbr_alt_sin_twiddle =
  888|    597|          ixheaace_str_aac_qmf_tabs.esbr_alt_sin_twiddle_l16;
  889|    597|      pstr_codec_qmf_bank->ptr_esbr_t_cos = ixheaace_str_aac_qmf_tabs.esbr_t_cos_sin_l16;
  890|    597|      break;
  891|      0|    default:
  ------------------
  |  Branch (891:5): [True: 0, False: 2.06k]
  ------------------
  892|      0|      pstr_codec_qmf_bank->no_channels = 32;
  893|      0|      pstr_codec_qmf_bank->ptr_esbr_cos_twiddle =
  894|      0|          ixheaace_str_aac_qmf_tabs.esbr_sin_cos_twiddle_l32;
  895|      0|      pstr_codec_qmf_bank->ptr_esbr_alt_sin_twiddle =
  896|      0|          ixheaace_str_aac_qmf_tabs.esbr_alt_sin_twiddle_l32;
  897|      0|      pstr_codec_qmf_bank->ptr_esbr_t_cos = ixheaace_str_aac_qmf_tabs.esbr_t_cos_sin_l32;
  898|      0|      break;
  899|  2.06k|  }
  900|  2.06k|}
ixheaace_esbr_qmfanal32_winadd:
  903|  5.50M|                                    WORD32 num_band_anal_qmf) {
  904|  5.50M|  WORD32 n;
  905|  5.50M|  FLOAT32 accu;
  906|       |
  907|  5.50M|  switch (num_band_anal_qmf) {
  908|  2.59M|    case 32: {
  ------------------
  |  Branch (908:5): [True: 2.59M, False: 2.91M]
  ------------------
  909|  2.59M|      n = 0;
  910|  44.1M|      while (n < num_band_anal_qmf) {
  ------------------
  |  Branch (910:14): [True: 41.5M, False: 2.59M]
  ------------------
  911|  41.5M|        accu = (ptr_inp1[n + 0] * ptr_qmf1[2 * (n + 0)]);
  912|  41.5M|        accu += (ptr_inp1[n + 2 * num_band_anal_qmf] * ptr_qmf1[2 * (n + 2 * num_band_anal_qmf)]);
  913|  41.5M|        accu += (ptr_inp1[n + 4 * num_band_anal_qmf] * ptr_qmf1[2 * (n + 4 * num_band_anal_qmf)]);
  914|  41.5M|        accu += (ptr_inp1[n + 6 * num_band_anal_qmf] * ptr_qmf1[2 * (n + 6 * num_band_anal_qmf)]);
  915|  41.5M|        accu += (ptr_inp1[n + 8 * num_band_anal_qmf] * ptr_qmf1[2 * (n + 8 * num_band_anal_qmf)]);
  916|  41.5M|        ptr_out[n] = 2 * accu;
  917|       |
  918|  41.5M|        accu = (ptr_inp1[n + 1 + 0] * ptr_qmf1[2 * (n + 1 + 0)]);
  919|  41.5M|        accu += (ptr_inp1[n + 1 + 2 * num_band_anal_qmf] *
  920|  41.5M|                 ptr_qmf1[2 * (n + 1 + 2 * num_band_anal_qmf)]);
  921|  41.5M|        accu += (ptr_inp1[n + 1 + 4 * num_band_anal_qmf] *
  922|  41.5M|                 ptr_qmf1[2 * (n + 1 + 4 * num_band_anal_qmf)]);
  923|  41.5M|        accu += (ptr_inp1[n + 1 + 6 * num_band_anal_qmf] *
  924|  41.5M|                 ptr_qmf1[2 * (n + 1 + 6 * num_band_anal_qmf)]);
  925|  41.5M|        accu += (ptr_inp1[n + 1 + 8 * num_band_anal_qmf] *
  926|  41.5M|                 ptr_qmf1[2 * (n + 1 + 8 * num_band_anal_qmf)]);
  927|  41.5M|        ptr_out[n + 1] = 2 * accu;
  928|       |
  929|  41.5M|        accu = (ptr_inp2[n + 0] * ptr_qmf2[2 * (n + 0)]);
  930|  41.5M|        accu += (ptr_inp2[n + 2 * num_band_anal_qmf] * ptr_qmf2[2 * (n + 2 * num_band_anal_qmf)]);
  931|  41.5M|        accu += (ptr_inp2[n + 4 * num_band_anal_qmf] * ptr_qmf2[2 * (n + 4 * num_band_anal_qmf)]);
  932|  41.5M|        accu += (ptr_inp2[n + 6 * num_band_anal_qmf] * ptr_qmf2[2 * (n + 6 * num_band_anal_qmf)]);
  933|  41.5M|        accu += (ptr_inp2[n + 8 * num_band_anal_qmf] * ptr_qmf2[2 * (n + 8 * num_band_anal_qmf)]);
  934|  41.5M|        ptr_out[n + num_band_anal_qmf] = 2 * accu;
  935|       |
  936|  41.5M|        accu = (ptr_inp2[n + 1 + 0] * ptr_qmf2[2 * (n + 1 + 0)]);
  937|  41.5M|        accu += (ptr_inp2[n + 1 + 2 * num_band_anal_qmf] *
  938|  41.5M|                 ptr_qmf2[2 * (n + 1 + 2 * num_band_anal_qmf)]);
  939|  41.5M|        accu += (ptr_inp2[n + 1 + 4 * num_band_anal_qmf] *
  940|  41.5M|                 ptr_qmf2[2 * (n + 1 + 4 * num_band_anal_qmf)]);
  941|  41.5M|        accu += (ptr_inp2[n + 1 + 6 * num_band_anal_qmf] *
  942|  41.5M|                 ptr_qmf2[2 * (n + 1 + 6 * num_band_anal_qmf)]);
  943|  41.5M|        accu += (ptr_inp2[n + 1 + 8 * num_band_anal_qmf] *
  944|  41.5M|                 ptr_qmf2[2 * (n + 1 + 8 * num_band_anal_qmf)]);
  945|  41.5M|        ptr_out[n + 1 + num_band_anal_qmf] = 2 * accu;
  946|       |
  947|  41.5M|        n += 2;
  948|  41.5M|      }
  949|  2.59M|      break;
  950|      0|    }
  951|      0|    case 24: {
  ------------------
  |  Branch (951:5): [True: 0, False: 5.50M]
  ------------------
  952|      0|      n = 0;
  953|      0|      while (n < num_band_anal_qmf) {
  ------------------
  |  Branch (953:14): [True: 0, False: 0]
  ------------------
  954|      0|        accu = (ptr_inp1[n + 0] * ptr_qmf1[(n + 0)]);
  955|      0|        accu += (ptr_inp1[n + 2 * num_band_anal_qmf] * ptr_qmf1[(n + 2 * num_band_anal_qmf)]);
  956|      0|        accu += (ptr_inp1[n + 4 * num_band_anal_qmf] * ptr_qmf1[(n + 4 * num_band_anal_qmf)]);
  957|      0|        accu += (ptr_inp1[n + 6 * num_band_anal_qmf] * ptr_qmf1[(n + 6 * num_band_anal_qmf)]);
  958|      0|        accu += (ptr_inp1[n + 8 * num_band_anal_qmf] * ptr_qmf1[(n + 8 * num_band_anal_qmf)]);
  959|      0|        ptr_out[n] = 2 * accu;
  960|       |
  961|      0|        accu = (ptr_inp1[n + 1 + 0] * ptr_qmf1[(n + 1 + 0)]);
  962|      0|        accu +=
  963|      0|            (ptr_inp1[n + 1 + 2 * num_band_anal_qmf] * ptr_qmf1[(n + 1 + 2 * num_band_anal_qmf)]);
  964|      0|        accu +=
  965|      0|            (ptr_inp1[n + 1 + 4 * num_band_anal_qmf] * ptr_qmf1[(n + 1 + 4 * num_band_anal_qmf)]);
  966|      0|        accu +=
  967|      0|            (ptr_inp1[n + 1 + 6 * num_band_anal_qmf] * ptr_qmf1[(n + 1 + 6 * num_band_anal_qmf)]);
  968|      0|        accu +=
  969|      0|            (ptr_inp1[n + 1 + 8 * num_band_anal_qmf] * ptr_qmf1[(n + 1 + 8 * num_band_anal_qmf)]);
  970|      0|        ptr_out[n + 1] = 2 * accu;
  971|       |
  972|      0|        accu = (ptr_inp2[n + 0] * ptr_qmf2[(n + 0)]);
  973|      0|        accu += (ptr_inp2[n + 2 * num_band_anal_qmf] * ptr_qmf2[(n + 2 * num_band_anal_qmf)]);
  974|      0|        accu += (ptr_inp2[n + 4 * num_band_anal_qmf] * ptr_qmf2[(n + 4 * num_band_anal_qmf)]);
  975|      0|        accu += (ptr_inp2[n + 6 * num_band_anal_qmf] * ptr_qmf2[(n + 6 * num_band_anal_qmf)]);
  976|      0|        accu += (ptr_inp2[n + 8 * num_band_anal_qmf] * ptr_qmf2[(n + 8 * num_band_anal_qmf)]);
  977|      0|        ptr_out[n + num_band_anal_qmf] = 2 * accu;
  978|       |
  979|      0|        accu = (ptr_inp2[n + 1 + 0] * ptr_qmf2[(n + 1 + 0)]);
  980|      0|        accu +=
  981|      0|            (ptr_inp2[n + 1 + 2 * num_band_anal_qmf] * ptr_qmf2[(n + 1 + 2 * num_band_anal_qmf)]);
  982|      0|        accu +=
  983|      0|            (ptr_inp2[n + 1 + 4 * num_band_anal_qmf] * ptr_qmf2[(n + 1 + 4 * num_band_anal_qmf)]);
  984|      0|        accu +=
  985|      0|            (ptr_inp2[n + 1 + 6 * num_band_anal_qmf] * ptr_qmf2[(n + 1 + 6 * num_band_anal_qmf)]);
  986|      0|        accu +=
  987|      0|            (ptr_inp2[n + 1 + 8 * num_band_anal_qmf] * ptr_qmf2[(n + 1 + 8 * num_band_anal_qmf)]);
  988|      0|        ptr_out[n + 1 + num_band_anal_qmf] = 2 * accu;
  989|      0|        n += 2;
  990|      0|      }
  991|      0|      break;
  992|      0|    }
  993|  2.91M|    default: {
  ------------------
  |  Branch (993:5): [True: 2.91M, False: 2.59M]
  ------------------
  994|  2.91M|      n = 0;
  995|  26.2M|      while (n < num_band_anal_qmf) {
  ------------------
  |  Branch (995:14): [True: 23.3M, False: 2.91M]
  ------------------
  996|  23.3M|        accu = (ptr_inp1[n + 0] * ptr_qmf1[4 * (n + 0)]);
  997|  23.3M|        accu += (ptr_inp1[n + 2 * num_band_anal_qmf] * ptr_qmf1[4 * (n + 2 * num_band_anal_qmf)]);
  998|  23.3M|        accu += (ptr_inp1[n + 4 * num_band_anal_qmf] * ptr_qmf1[4 * (n + 4 * num_band_anal_qmf)]);
  999|  23.3M|        accu += (ptr_inp1[n + 6 * num_band_anal_qmf] * ptr_qmf1[4 * (n + 6 * num_band_anal_qmf)]);
 1000|  23.3M|        accu += (ptr_inp1[n + 8 * num_band_anal_qmf] * ptr_qmf1[4 * (n + 8 * num_band_anal_qmf)]);
 1001|  23.3M|        ptr_out[n] = 2 * accu;
 1002|       |
 1003|  23.3M|        accu = (ptr_inp1[n + 1 + 0] * ptr_qmf1[4 * (n + 1 + 0)]);
 1004|  23.3M|        accu += (ptr_inp1[n + 1 + 2 * num_band_anal_qmf] *
 1005|  23.3M|                 ptr_qmf1[4 * (n + 1 + 2 * num_band_anal_qmf)]);
 1006|  23.3M|        accu += (ptr_inp1[n + 1 + 4 * num_band_anal_qmf] *
 1007|  23.3M|                 ptr_qmf1[4 * (n + 1 + 4 * num_band_anal_qmf)]);
 1008|  23.3M|        accu += (ptr_inp1[n + 1 + 6 * num_band_anal_qmf] *
 1009|  23.3M|                 ptr_qmf1[4 * (n + 1 + 6 * num_band_anal_qmf)]);
 1010|  23.3M|        accu += (ptr_inp1[n + 1 + 8 * num_band_anal_qmf] *
 1011|  23.3M|                 ptr_qmf1[4 * (n + 1 + 8 * num_band_anal_qmf)]);
 1012|  23.3M|        ptr_out[n + 1] = 2 * accu;
 1013|       |
 1014|  23.3M|        accu = (ptr_inp2[n + 0] * ptr_qmf2[4 * (n + 0)]);
 1015|  23.3M|        accu += (ptr_inp2[n + 2 * num_band_anal_qmf] * ptr_qmf2[4 * (n + 2 * num_band_anal_qmf)]);
 1016|  23.3M|        accu += (ptr_inp2[n + 4 * num_band_anal_qmf] * ptr_qmf2[4 * (n + 4 * num_band_anal_qmf)]);
 1017|  23.3M|        accu += (ptr_inp2[n + 6 * num_band_anal_qmf] * ptr_qmf2[4 * (n + 6 * num_band_anal_qmf)]);
 1018|  23.3M|        accu += (ptr_inp2[n + 8 * num_band_anal_qmf] * ptr_qmf2[4 * (n + 8 * num_band_anal_qmf)]);
 1019|  23.3M|        ptr_out[n + num_band_anal_qmf] = 2 * accu;
 1020|       |
 1021|  23.3M|        accu = (ptr_inp2[n + 1 + 0] * ptr_qmf2[4 * (n + 1 + 0)]);
 1022|  23.3M|        accu += (ptr_inp2[n + 1 + 2 * num_band_anal_qmf] *
 1023|  23.3M|                 ptr_qmf2[4 * (n + 1 + 2 * num_band_anal_qmf)]);
 1024|  23.3M|        accu += (ptr_inp2[n + 1 + 4 * num_band_anal_qmf] *
 1025|  23.3M|                 ptr_qmf2[4 * (n + 1 + 4 * num_band_anal_qmf)]);
 1026|  23.3M|        accu += (ptr_inp2[n + 1 + 6 * num_band_anal_qmf] *
 1027|  23.3M|                 ptr_qmf2[4 * (n + 1 + 6 * num_band_anal_qmf)]);
 1028|  23.3M|        accu += (ptr_inp2[n + 1 + 8 * num_band_anal_qmf] *
 1029|  23.3M|                 ptr_qmf2[4 * (n + 1 + 8 * num_band_anal_qmf)]);
 1030|  23.3M|        ptr_out[n + 1 + num_band_anal_qmf] = 2 * accu;
 1031|  23.3M|        n += 2;
 1032|  23.3M|      }
 1033|  2.91M|      break;
 1034|      0|    }
 1035|  5.50M|  }
 1036|  5.50M|}
ixheaace_esbr_radix4bfly:
 1039|  5.19M|                              WORD32 index) {
 1040|  5.19M|  int i;
 1041|  5.19M|  WORD32 l1, l2, h2, fft_jmp;
 1042|  5.19M|  FLOAT32 xt0_0, yt0_0, xt1_0, yt1_0, xt2_0, yt2_0;
 1043|  5.19M|  FLOAT32 xh0_0, xh1_0, xh20_0, xh21_0, xl0_0, xl1_0, xl20_0, xl21_0;
 1044|  5.19M|  FLOAT32 x_0, x_1, x_l1_0, x_l1_1, x_l2_0, x_l2_1;
 1045|  5.19M|  FLOAT32 x_h2_0, x_h2_1;
 1046|  5.19M|  FLOAT32 si10, si20, si30, co10, co20, co30;
 1047|       |
 1048|  5.19M|  FLOAT32 mul_1, mul_2, mul_3, mul_4, mul_5, mul_6;
 1049|  5.19M|  FLOAT32 mul_7, mul_8, mul_9, mul_10, mul_11, mul_12;
 1050|       |
 1051|  5.19M|  const FLOAT32 *ptr_w = ptr_w_in;
 1052|  5.19M|  WORD32 i1;
 1053|       |
 1054|  5.19M|  h2 = index << 1;
 1055|  5.19M|  l1 = index << 2;
 1056|  5.19M|  l2 = (index << 2) + (index << 1);
 1057|       |
 1058|  5.19M|  fft_jmp = 6 * (index);
 1059|       |
 1060|  5.19M|  i1 = 0;
 1061|  10.3M|  while (i1 < index1) {
  ------------------
  |  Branch (1061:10): [True: 5.19M, False: 5.19M]
  ------------------
 1062|  25.9M|    for (i = 0; i < index; i++) {
  ------------------
  |  Branch (1062:17): [True: 20.7M, False: 5.19M]
  ------------------
 1063|  20.7M|      si10 = (*ptr_w++);
 1064|  20.7M|      co10 = (*ptr_w++);
 1065|  20.7M|      si20 = (*ptr_w++);
 1066|  20.7M|      co20 = (*ptr_w++);
 1067|  20.7M|      si30 = (*ptr_w++);
 1068|  20.7M|      co30 = (*ptr_w++);
 1069|       |
 1070|  20.7M|      x_0 = ptr_x[0];
 1071|  20.7M|      x_h2_0 = ptr_x[h2];
 1072|  20.7M|      x_l1_0 = ptr_x[l1];
 1073|  20.7M|      x_l2_0 = ptr_x[l2];
 1074|       |
 1075|  20.7M|      xh0_0 = (x_0 + x_l1_0);
 1076|  20.7M|      xl0_0 = (x_0 - x_l1_0);
 1077|       |
 1078|  20.7M|      xh20_0 = (x_h2_0 + x_l2_0);
 1079|  20.7M|      xl20_0 = (x_h2_0 - x_l2_0);
 1080|       |
 1081|  20.7M|      ptr_x[0] = (xh0_0 + xh20_0);
 1082|  20.7M|      xt0_0 = (xh0_0 - xh20_0);
 1083|       |
 1084|  20.7M|      x_1 = ptr_x[1];
 1085|  20.7M|      x_h2_1 = ptr_x[h2 + 1];
 1086|  20.7M|      x_l1_1 = ptr_x[l1 + 1];
 1087|  20.7M|      x_l2_1 = ptr_x[l2 + 1];
 1088|       |
 1089|  20.7M|      xh1_0 = (x_1 + x_l1_1);
 1090|  20.7M|      xl1_0 = (x_1 - x_l1_1);
 1091|       |
 1092|  20.7M|      xh21_0 = (x_h2_1 + x_l2_1);
 1093|  20.7M|      xl21_0 = (x_h2_1 - x_l2_1);
 1094|       |
 1095|  20.7M|      ptr_x[1] = (xh1_0 + xh21_0);
 1096|  20.7M|      yt0_0 = (xh1_0 - xh21_0);
 1097|       |
 1098|  20.7M|      xt1_0 = (xl0_0 + xl21_0);
 1099|  20.7M|      xt2_0 = (xl0_0 - xl21_0);
 1100|       |
 1101|  20.7M|      yt2_0 = (xl1_0 + xl20_0);
 1102|  20.7M|      yt1_0 = (xl1_0 - xl20_0);
 1103|       |
 1104|  20.7M|      mul_11 = (xt2_0 * co30);
 1105|  20.7M|      mul_3 = (yt2_0 * si30);
 1106|  20.7M|      ptr_x[l2] = 2 * (mul_3 + mul_11);
 1107|       |
 1108|  20.7M|      mul_5 = (xt2_0 * si30);
 1109|  20.7M|      mul_9 = (yt2_0 * co30);
 1110|  20.7M|      ptr_x[l2 + 1] = 2 * (mul_9 - mul_5);
 1111|       |
 1112|  20.7M|      mul_12 = (xt0_0 * co20);
 1113|  20.7M|      mul_2 = (yt0_0 * si20);
 1114|  20.7M|      ptr_x[l1] = 2 * (mul_2 + mul_12);
 1115|       |
 1116|  20.7M|      mul_6 = (xt0_0 * si20);
 1117|  20.7M|      mul_8 = (yt0_0 * co20);
 1118|  20.7M|      ptr_x[l1 + 1] = 2 * (mul_8 - mul_6);
 1119|       |
 1120|  20.7M|      mul_4 = (xt1_0 * co10);
 1121|  20.7M|      mul_1 = (yt1_0 * si10);
 1122|  20.7M|      ptr_x[h2] = 2 * (mul_1 + mul_4);
 1123|       |
 1124|  20.7M|      mul_10 = (xt1_0 * si10);
 1125|  20.7M|      mul_7 = (yt1_0 * co10);
 1126|  20.7M|      ptr_x[h2 + 1] = 2 * (mul_7 - mul_10);
 1127|       |
 1128|  20.7M|      ptr_x += 2;
 1129|  20.7M|    }
 1130|  5.19M|    ptr_x += fft_jmp;
 1131|  5.19M|    ptr_w = ptr_w - fft_jmp;
 1132|  5.19M|    i1++;
 1133|  5.19M|  }
 1134|  5.19M|}
ixheaace_esbr_postradixcompute4:
 1227|  5.19M|                                     const FLOAT32 *ptr_dig_rev_tbl, WORD32 npoints) {
 1228|  5.19M|  WORD32 i, k;
 1229|  5.19M|  WORD32 h2;
 1230|  5.19M|  FLOAT32 xh0_0, xh1_0, xl0_0, xl1_0;
 1231|  5.19M|  FLOAT32 xh0_1, xh1_1, xl0_1, xl1_1;
 1232|  5.19M|  FLOAT32 x_0, x_1, x_2, x_3;
 1233|  5.19M|  FLOAT32 xh0_2, xh1_2, xl0_2, xl1_2, xh0_3, xh1_3, xl0_3, xl1_3;
 1234|  5.19M|  FLOAT32 x_4, x_5, x_6, x_7;
 1235|  5.19M|  FLOAT32 x_8, x_9, x_a, x_b, x_c, x_d, x_e, x_f;
 1236|  5.19M|  FLOAT32 n00, n10, n20, n30, n01, n11, n21, n31;
 1237|  5.19M|  FLOAT32 n02, n12, n22, n32, n03, n13, n23, n33;
 1238|       |
 1239|  5.19M|  FLOAT32 *ptr_x2, *ptr_x0;
 1240|  5.19M|  FLOAT32 *ptr_y0, *ptr_y1, *ptr_y2, *ptr_y3;
 1241|       |
 1242|  5.19M|  ptr_y0 = ptr_y;
 1243|  5.19M|  ptr_y2 = ptr_y + npoints;
 1244|  5.19M|  ptr_x0 = ptr_x;
 1245|  5.19M|  ptr_x2 = ptr_x + (WORD32)(npoints >> 1);
 1246|       |
 1247|  5.19M|  ptr_y1 = ptr_y0 + (WORD32)(npoints >> 1);
 1248|  5.19M|  ptr_y3 = ptr_y2 + (WORD32)(npoints >> 1);
 1249|       |
 1250|  15.5M|  for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (1250:15): [True: 10.3M, False: 5.19M]
  ------------------
 1251|  20.7M|    for (i = 0; i<npoints>> 1; i += 8) {
  ------------------
  |  Branch (1251:17): [True: 10.3M, False: 10.3M]
  ------------------
 1252|  10.3M|      h2 = (WORD32)*ptr_dig_rev_tbl++ / 4;
 1253|  10.3M|      x_0 = *ptr_x0++;
 1254|  10.3M|      x_1 = *ptr_x0++;
 1255|  10.3M|      x_2 = *ptr_x0++;
 1256|  10.3M|      x_3 = *ptr_x0++;
 1257|  10.3M|      x_4 = *ptr_x0++;
 1258|  10.3M|      x_5 = *ptr_x0++;
 1259|  10.3M|      x_6 = *ptr_x0++;
 1260|  10.3M|      x_7 = *ptr_x0++;
 1261|       |
 1262|  10.3M|      xh0_0 = (x_0 + x_4);
 1263|  10.3M|      xh1_0 = (x_1 + x_5);
 1264|       |
 1265|  10.3M|      xl0_0 = (x_0 - x_4);
 1266|  10.3M|      xl1_0 = (x_1 - x_5);
 1267|       |
 1268|  10.3M|      xh0_1 = (x_2 + x_6);
 1269|  10.3M|      xh1_1 = (x_3 + x_7);
 1270|       |
 1271|  10.3M|      xl0_1 = (x_2 - x_6);
 1272|  10.3M|      xl1_1 = (x_3 - x_7);
 1273|       |
 1274|  10.3M|      n00 = (xh0_0 + xh0_1);
 1275|  10.3M|      n01 = (xh1_0 + xh1_1);
 1276|  10.3M|      n10 = (xl0_0 + xl1_1);
 1277|       |
 1278|  10.3M|      n11 = (xl1_0 - xl0_1);
 1279|  10.3M|      n20 = (xh0_0 - xh0_1);
 1280|  10.3M|      n21 = (xh1_0 - xh1_1);
 1281|  10.3M|      n30 = (xl0_0 - xl1_1);
 1282|       |
 1283|  10.3M|      n31 = (xl1_0 + xl0_1);
 1284|       |
 1285|  10.3M|      ptr_y0[h2] = n00;
 1286|  10.3M|      ptr_y0[h2 + 1] = n01;
 1287|  10.3M|      ptr_y1[h2] = n10;
 1288|  10.3M|      ptr_y1[h2 + 1] = n11;
 1289|  10.3M|      ptr_y2[h2] = n20;
 1290|  10.3M|      ptr_y2[h2 + 1] = n21;
 1291|  10.3M|      ptr_y3[h2] = n30;
 1292|  10.3M|      ptr_y3[h2 + 1] = n31;
 1293|       |
 1294|  10.3M|      x_8 = *ptr_x2++;
 1295|  10.3M|      x_9 = *ptr_x2++;
 1296|  10.3M|      x_a = *ptr_x2++;
 1297|  10.3M|      x_b = *ptr_x2++;
 1298|  10.3M|      x_c = *ptr_x2++;
 1299|  10.3M|      x_d = *ptr_x2++;
 1300|  10.3M|      x_e = *ptr_x2++;
 1301|  10.3M|      x_f = *ptr_x2++;
 1302|       |
 1303|  10.3M|      xh0_2 = (x_8 + x_c);
 1304|  10.3M|      xh1_2 = (x_9 + x_d);
 1305|       |
 1306|  10.3M|      xl0_2 = (x_8 - x_c);
 1307|  10.3M|      xl1_2 = (x_9 - x_d);
 1308|       |
 1309|  10.3M|      xh0_3 = (x_a + x_e);
 1310|  10.3M|      xh1_3 = (x_b + x_f);
 1311|       |
 1312|  10.3M|      xl0_3 = (x_a - x_e);
 1313|  10.3M|      xl1_3 = (x_b - x_f);
 1314|       |
 1315|  10.3M|      n02 = (xh0_2 + xh0_3);
 1316|  10.3M|      n03 = (xh1_2 + xh1_3);
 1317|  10.3M|      n12 = (xl0_2 + xl1_3);
 1318|       |
 1319|  10.3M|      n13 = (xl1_2 - xl0_3);
 1320|  10.3M|      n22 = (xh0_2 - xh0_3);
 1321|  10.3M|      n23 = (xh1_2 - xh1_3);
 1322|  10.3M|      n32 = (xl0_2 - xl1_3);
 1323|       |
 1324|  10.3M|      n33 = (xl1_2 + xl0_3);
 1325|       |
 1326|  10.3M|      ptr_y0[h2 + 2] = n02;
 1327|  10.3M|      ptr_y0[h2 + 3] = n03;
 1328|  10.3M|      ptr_y1[h2 + 2] = n12;
 1329|  10.3M|      ptr_y1[h2 + 3] = n13;
 1330|  10.3M|      ptr_y2[h2 + 2] = n22;
 1331|  10.3M|      ptr_y2[h2 + 3] = n23;
 1332|  10.3M|      ptr_y3[h2 + 2] = n32;
 1333|  10.3M|      ptr_y3[h2 + 3] = n33;
 1334|  10.3M|    }
 1335|  10.3M|    ptr_x0 += (WORD32)npoints >> 1;
 1336|  10.3M|    ptr_x2 += (WORD32)npoints >> 1;
 1337|  10.3M|  }
 1338|  5.19M|}
ixheaace_esbr_cos_sin_mod:
 1341|  5.50M|                               FLOAT32 *ptr_twiddle, FLOAT32 *ptr_dig_rev_tbl) {
 1342|  5.50M|  WORD32 z;
 1343|  5.50M|  FLOAT32 temp[128] = {0};
 1344|       |
 1345|  5.50M|  FLOAT32 re2, re3;
 1346|  5.50M|  FLOAT32 wim, wre;
 1347|       |
 1348|  5.50M|  WORD32 i, M_2;
 1349|  5.50M|  WORD32 M = pstr_qmf_bank->no_channels / 2;
 1350|       |
 1351|  5.50M|  const FLOAT32 *ptr_sin;
 1352|  5.50M|  const FLOAT32 *ptr_sin_cos;
 1353|       |
 1354|  5.50M|  FLOAT32 subband_tmp[128] = {0};
 1355|  5.50M|  FLOAT32 re;
 1356|  5.50M|  FLOAT32 im;
 1357|  5.50M|  FLOAT32 *ptr_subband, *ptr_subband1;
 1358|  5.50M|  FLOAT32 *ptr_subband_t, *ptr_subband1_t;
 1359|  5.50M|  FLOAT32 *ptr_subband2, *ptr_subband12;
 1360|  5.50M|  FLOAT32 *ptr_subband_t2, *ptr_subband1_t2;
 1361|       |
 1362|  5.50M|  M_2 = M / 2;
 1363|       |
 1364|  5.50M|  ptr_sin_cos = pstr_qmf_bank->ptr_esbr_cos_twiddle;
 1365|       |
 1366|  5.50M|  ptr_subband = &subband[0];
 1367|  5.50M|  ptr_subband1 = &subband[2 * M - 1];
 1368|  5.50M|  ptr_subband_t = subband_tmp;
 1369|  5.50M|  ptr_subband1_t = &subband_tmp[2 * M - 1];
 1370|       |
 1371|  5.50M|  ptr_subband2 = &subband[64];
 1372|  5.50M|  ptr_subband12 = &subband[2 * M - 1 + 64];
 1373|  5.50M|  ptr_subband_t2 = &subband_tmp[64];
 1374|  5.50M|  ptr_subband1_t2 = &subband_tmp[2 * M - 1 + 64];
 1375|       |
 1376|  5.50M|  i = (M_2 >> 1) - 1;
 1377|  21.7M|  while (i >= 0) {
  ------------------
  |  Branch (1377:10): [True: 16.2M, False: 5.50M]
  ------------------
 1378|  16.2M|    re = *ptr_subband++;
 1379|  16.2M|    im = *ptr_subband1--;
 1380|       |
 1381|  16.2M|    wim = *ptr_sin_cos++;
 1382|  16.2M|    wre = *ptr_sin_cos++;
 1383|       |
 1384|  16.2M|    *ptr_subband_t++ = (re * wre) + (im * wim);
 1385|  16.2M|    *ptr_subband_t++ = (im * wre) - (re * wim);
 1386|       |
 1387|  16.2M|    re = *ptr_subband2++;
 1388|  16.2M|    im = *ptr_subband12--;
 1389|       |
 1390|  16.2M|    *ptr_subband_t2++ = (im * wim) - (re * wre);
 1391|  16.2M|    *ptr_subband_t2++ = (re * wim) + (im * wre);
 1392|       |
 1393|  16.2M|    re = *ptr_subband1--;
 1394|  16.2M|    im = *ptr_subband++;
 1395|       |
 1396|  16.2M|    wim = *ptr_sin_cos++;
 1397|  16.2M|    wre = *ptr_sin_cos++;
 1398|       |
 1399|  16.2M|    *ptr_subband1_t-- = (im * wre) - (re * wim);
 1400|  16.2M|    *ptr_subband1_t-- = (re * wre) + (im * wim);
 1401|       |
 1402|  16.2M|    re = *ptr_subband12--;
 1403|  16.2M|    im = *ptr_subband2++;
 1404|       |
 1405|  16.2M|    *ptr_subband1_t2-- = (re * wim) + (im * wre);
 1406|  16.2M|    *ptr_subband1_t2-- = (im * wim) - (re * wre);
 1407|       |
 1408|  16.2M|    re = *ptr_subband++;
 1409|  16.2M|    im = *ptr_subband1--;
 1410|       |
 1411|  16.2M|    wim = *ptr_sin_cos++;
 1412|  16.2M|    wre = *ptr_sin_cos++;
 1413|       |
 1414|  16.2M|    *ptr_subband_t++ = (re * wre) + (im * wim);
 1415|  16.2M|    *ptr_subband_t++ = (im * wre) - (re * wim);
 1416|       |
 1417|  16.2M|    re = *ptr_subband2++;
 1418|  16.2M|    im = *ptr_subband12--;
 1419|       |
 1420|  16.2M|    *ptr_subband_t2++ = (im * wim) - (re * wre);
 1421|  16.2M|    *ptr_subband_t2++ = (re * wim) + (im * wre);
 1422|       |
 1423|  16.2M|    re = *ptr_subband1--;
 1424|  16.2M|    im = *ptr_subband++;
 1425|       |
 1426|  16.2M|    wim = *ptr_sin_cos++;
 1427|  16.2M|    wre = *ptr_sin_cos++;
 1428|       |
 1429|  16.2M|    *ptr_subband1_t-- = (im * wre) - (re * wim);
 1430|  16.2M|    *ptr_subband1_t-- = (re * wre) + (im * wim);
 1431|       |
 1432|  16.2M|    re = *ptr_subband12--;
 1433|  16.2M|    im = *ptr_subband2++;
 1434|       |
 1435|  16.2M|    *ptr_subband1_t2-- = (re * wim) + (im * wre);
 1436|  16.2M|    *ptr_subband1_t2-- = (im * wim) - (re * wre);
 1437|       |
 1438|  16.2M|    i--;
 1439|  16.2M|  }
 1440|       |
 1441|  5.50M|  switch (M) {
 1442|      0|    case M_32:
  ------------------
  |  |   23|      0|#define M_32 (32)
  ------------------
  |  Branch (1442:5): [True: 0, False: 5.50M]
  ------------------
 1443|      0|      ixheaace_esbr_radix4bfly(ptr_twiddle, subband_tmp, 1, 8);
 1444|      0|      ixheaace_esbr_radix4bfly(ptr_twiddle + 48, subband_tmp, 4, 2);
 1445|      0|      ixheaace_esbr_postradixcompute2(subband, subband_tmp, ptr_dig_rev_tbl, 32);
 1446|       |
 1447|      0|      ixheaace_esbr_radix4bfly(ptr_twiddle, &subband_tmp[64], 1, 8);
 1448|      0|      ixheaace_esbr_radix4bfly(ptr_twiddle + 48, &subband_tmp[64], 4, 2);
 1449|      0|      ixheaace_esbr_postradixcompute2(&subband[64], &subband_tmp[64], ptr_dig_rev_tbl, 32);
 1450|      0|      break;
 1451|       |
 1452|  2.59M|    case M_16:
  ------------------
  |  |   24|  2.59M|#define M_16 (16)
  ------------------
  |  Branch (1452:5): [True: 2.59M, False: 2.91M]
  ------------------
 1453|  2.59M|      ixheaace_esbr_radix4bfly(ptr_twiddle, subband_tmp, 1, 4);
 1454|  2.59M|      ixheaace_esbr_postradixcompute4(subband, subband_tmp, ptr_dig_rev_tbl, 16);
 1455|       |
 1456|  2.59M|      ixheaace_esbr_radix4bfly(ptr_twiddle, &subband_tmp[64], 1, 4);
 1457|  2.59M|      ixheaace_esbr_postradixcompute4(&subband[64], &subband_tmp[64], ptr_dig_rev_tbl, 16);
 1458|  2.59M|      break;
 1459|       |
 1460|      0|    case M_12:
  ------------------
  |  |   25|      0|#define M_12 (12)
  ------------------
  |  Branch (1460:5): [True: 0, False: 5.50M]
  ------------------
 1461|       |
 1462|      0|      for (z = 0; z < (pstr_qmf_bank->no_channels >> 1); z++) {
  ------------------
  |  Branch (1462:19): [True: 0, False: 0]
  ------------------
 1463|      0|        temp[z] = subband_tmp[2 * z];
 1464|      0|        temp[12 + z] = subband_tmp[2 * z + 1];
 1465|      0|      }
 1466|       |
 1467|       |      // convert re and im data to interleave
 1468|      0|      FLOAT32 intermediate[24];
 1469|      0|      WORD32 cnt = 0;
 1470|      0|      while (cnt < M_12) {
  ------------------
  |  |   25|      0|#define M_12 (12)
  ------------------
  |  Branch (1470:14): [True: 0, False: 0]
  ------------------
 1471|      0|        intermediate[2 * cnt] = temp[cnt];
 1472|      0|        intermediate[2 * cnt + 1] = temp[12 + cnt];
 1473|      0|        cnt++;
 1474|      0|      }
 1475|       |
 1476|      0|      iusace_complex_fft_p3_no_scratch(intermediate, 12);
 1477|       |      // de-interleave
 1478|      0|      for (cnt = 0; cnt < 12; cnt++) {
  ------------------
  |  Branch (1478:21): [True: 0, False: 0]
  ------------------
 1479|      0|        temp[cnt] = intermediate[2 * cnt];
 1480|      0|        temp[12 + cnt] = intermediate[2 * cnt + 1];
 1481|      0|      }
 1482|       |
 1483|      0|      z = 0;
 1484|      0|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1484:14): [True: 0, False: 0]
  ------------------
 1485|      0|        subband[2 * z] = temp[z];
 1486|      0|        subband[2 * z + 1] = temp[z + 12];
 1487|      0|        z++;
 1488|      0|      }
 1489|       |
 1490|      0|      z = 0;
 1491|      0|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1491:14): [True: 0, False: 0]
  ------------------
 1492|      0|        temp[z] = subband_tmp[64 + 2 * z];
 1493|      0|        temp[12 + z] = subband_tmp[64 + 2 * z + 1];
 1494|      0|        z++;
 1495|      0|      }
 1496|       |
 1497|       |      // convert re and im data to interleave
 1498|      0|      cnt = 0;
 1499|      0|      while (cnt < 12) {
  ------------------
  |  Branch (1499:14): [True: 0, False: 0]
  ------------------
 1500|      0|        intermediate[2 * cnt] = temp[cnt];
 1501|      0|        intermediate[2 * cnt + 1] = temp[12 + cnt];
 1502|      0|        cnt++;
 1503|      0|      }
 1504|      0|      iusace_complex_fft_p3_no_scratch(intermediate, 12);
 1505|       |      // de-interleave
 1506|       |
 1507|      0|      cnt = 0;
 1508|      0|      while (cnt < 12) {
  ------------------
  |  Branch (1508:14): [True: 0, False: 0]
  ------------------
 1509|      0|        temp[cnt] = intermediate[2 * cnt];
 1510|      0|        temp[12 + cnt] = intermediate[2 * cnt + 1];
 1511|      0|        cnt++;
 1512|      0|      }
 1513|       |
 1514|      0|      z = 0;
 1515|      0|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1515:14): [True: 0, False: 0]
  ------------------
 1516|      0|        subband[64 + 2 * z] = temp[z];
 1517|      0|        subband[64 + 2 * z + 1] = temp[z + 12];
 1518|      0|        z++;
 1519|      0|      }
 1520|      0|      break;
 1521|       |
 1522|  2.91M|    default:
  ------------------
  |  Branch (1522:5): [True: 2.91M, False: 2.59M]
  ------------------
 1523|  2.91M|      z = 0;
 1524|  26.2M|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1524:14): [True: 23.3M, False: 2.91M]
  ------------------
 1525|  23.3M|        temp[z] = subband_tmp[2 * z];
 1526|  23.3M|        temp[8 + z] = subband_tmp[2 * z + 1];
 1527|  23.3M|        z++;
 1528|  23.3M|      }
 1529|       |
 1530|  2.91M|      FLOAT32 scratch[1024];
 1531|  2.91M|      cnt = 0;
 1532|  26.2M|      while (cnt < 8) {
  ------------------
  |  Branch (1532:14): [True: 23.3M, False: 2.91M]
  ------------------
 1533|  23.3M|        intermediate[2 * cnt] = temp[cnt];
 1534|  23.3M|        intermediate[2 * cnt + 1] = temp[8 + cnt];
 1535|  23.3M|        cnt++;
 1536|  23.3M|      }
 1537|       |
 1538|  2.91M|      iusace_complex_fft_p2(intermediate, 8, scratch);
 1539|       |      // de-interleave
 1540|  2.91M|      cnt = 0;
 1541|  26.2M|      while (cnt < 8) {
  ------------------
  |  Branch (1541:14): [True: 23.3M, False: 2.91M]
  ------------------
 1542|  23.3M|        temp[cnt] = intermediate[2 * cnt];
 1543|  23.3M|        temp[8 + cnt] = intermediate[2 * cnt + 1];
 1544|  23.3M|        cnt++;
 1545|  23.3M|      }
 1546|       |
 1547|  2.91M|      z = 0;
 1548|  26.2M|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1548:14): [True: 23.3M, False: 2.91M]
  ------------------
 1549|  23.3M|        subband[2 * z] = temp[z];
 1550|  23.3M|        subband[2 * z + 1] = temp[z + 8];
 1551|  23.3M|        z++;
 1552|  23.3M|      }
 1553|  2.91M|      z = 0;
 1554|  26.2M|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1554:14): [True: 23.3M, False: 2.91M]
  ------------------
 1555|  23.3M|        temp[z] = subband_tmp[64 + 2 * z];
 1556|  23.3M|        temp[8 + z] = subband_tmp[64 + 2 * z + 1];
 1557|  23.3M|        z++;
 1558|  23.3M|      }
 1559|       |
 1560|       |      // convert re and im data to interleave
 1561|  2.91M|      cnt = 0;
 1562|  26.2M|      while (cnt < 8) {
  ------------------
  |  Branch (1562:14): [True: 23.3M, False: 2.91M]
  ------------------
 1563|  23.3M|        intermediate[2 * cnt] = temp[cnt];
 1564|  23.3M|        intermediate[2 * cnt + 1] = temp[8 + cnt];
 1565|  23.3M|        cnt++;
 1566|  23.3M|      }
 1567|       |
 1568|  2.91M|      iusace_complex_fft_p2(intermediate, 8, scratch);
 1569|       |
 1570|       |      // de-interleave
 1571|  2.91M|      cnt = 0;
 1572|  26.2M|      while (cnt < 8) {
  ------------------
  |  Branch (1572:14): [True: 23.3M, False: 2.91M]
  ------------------
 1573|  23.3M|        temp[cnt] = intermediate[2 * cnt];
 1574|  23.3M|        temp[8 + cnt] = intermediate[2 * cnt + 1];
 1575|  23.3M|        cnt++;
 1576|  23.3M|      }
 1577|       |
 1578|  2.91M|      z = 0;
 1579|  26.2M|      while (z < (pstr_qmf_bank->no_channels >> 1)) {
  ------------------
  |  Branch (1579:14): [True: 23.3M, False: 2.91M]
  ------------------
 1580|  23.3M|        subband[64 + 2 * z] = temp[z];
 1581|  23.3M|        subband[64 + 2 * z + 1] = temp[8 + z];
 1582|  23.3M|        z++;
 1583|  23.3M|      }
 1584|  2.91M|      break;
 1585|  5.50M|  }
 1586|       |
 1587|  5.50M|  ptr_subband = &subband[0];
 1588|  5.50M|  ptr_subband1 = &subband[2 * M - 1];
 1589|       |
 1590|  5.50M|  re = *ptr_subband1;
 1591|       |
 1592|  5.50M|  *ptr_subband = *ptr_subband / 2;
 1593|  5.50M|  ptr_subband++;
 1594|  5.50M|  *ptr_subband1 = -(*ptr_subband / 2);
 1595|  5.50M|  ptr_subband1--;
 1596|       |
 1597|  5.50M|  ptr_sin = pstr_qmf_bank->ptr_esbr_alt_sin_twiddle;
 1598|       |
 1599|  5.50M|  wim = *ptr_sin++;
 1600|  5.50M|  wre = *ptr_sin++;
 1601|       |
 1602|  5.50M|  im = *ptr_subband1;
 1603|       |
 1604|  5.50M|  *ptr_subband1-- = (re * wre) + (im * wim);
 1605|  5.50M|  *ptr_subband++ = (im * wre) - (re * wim);
 1606|       |
 1607|  5.50M|  ptr_subband2 = &subband[64];
 1608|  5.50M|  ptr_subband12 = &subband[2 * M - 1 + 64];
 1609|       |
 1610|  5.50M|  re = *ptr_subband12;
 1611|       |
 1612|  5.50M|  *ptr_subband12-- = -(*ptr_subband2 / 2);
 1613|       |
 1614|  5.50M|  *ptr_subband2 = ptr_subband2[1] / 2;
 1615|       |
 1616|  5.50M|  ptr_subband2++;
 1617|       |
 1618|  5.50M|  im = *ptr_subband12;
 1619|       |
 1620|  5.50M|  *ptr_subband2++ = -((re * wre) + (im * wim));
 1621|  5.50M|  *ptr_subband12-- = (re * wim) - (im * wre);
 1622|       |
 1623|  5.50M|  i = (M_2 - 2);
 1624|  32.4M|  while (i >= 0) {
  ------------------
  |  Branch (1624:10): [True: 26.9M, False: 5.50M]
  ------------------
 1625|  26.9M|    im = ptr_subband[0];
 1626|       |
 1627|  26.9M|    re = ptr_subband[1];
 1628|       |
 1629|  26.9M|    re2 = *ptr_subband1;
 1630|       |
 1631|  26.9M|    *ptr_subband++ = (re * wim) + (im * wre);
 1632|  26.9M|    *ptr_subband1-- = (im * wim) - (re * wre);
 1633|       |
 1634|  26.9M|    im = ptr_subband2[0];
 1635|       |
 1636|  26.9M|    re = ptr_subband2[1];
 1637|       |
 1638|  26.9M|    re3 = *ptr_subband12;
 1639|       |
 1640|  26.9M|    *ptr_subband12-- = -((re * wim) + (im * wre));
 1641|  26.9M|    *ptr_subband2++ = (re * wre) - (im * wim);
 1642|       |
 1643|  26.9M|    wim = *ptr_sin++;
 1644|  26.9M|    wre = *ptr_sin++;
 1645|  26.9M|    im = ptr_subband1[0];
 1646|       |
 1647|  26.9M|    *ptr_subband1-- = (re2 * wre) + (im * wim);
 1648|  26.9M|    *ptr_subband++ = (im * wre) - (re2 * wim);
 1649|       |
 1650|  26.9M|    im = ptr_subband12[0];
 1651|       |
 1652|  26.9M|    *ptr_subband2++ = -((re3 * wre) + (im * wim));
 1653|  26.9M|    *ptr_subband12-- = (re3 * wim) - (im * wre);
 1654|  26.9M|    i--;
 1655|  26.9M|  }
 1656|  5.50M|}
ixheaace_esbr_analysis_filt_block:
 1702|   126k|    WORD32 op_delay) {
 1703|   126k|  FLOAT32 *ptr_filt_states;
 1704|   126k|  FLOAT32 *ptr_filt_states_1;
 1705|   126k|  FLOAT32 *ptr_filt_states_2;
 1706|   126k|  FLOAT32 *ptr_temp;
 1707|   126k|  FLOAT32 *ptr_win_coeffs_1;
 1708|   126k|  FLOAT32 *ptr_win_coeffs_2;
 1709|   126k|  FLOAT32 *ptr_win_coeffs;
 1710|   126k|  FLOAT32 *ptr_loc_qmf_buf_real;
 1711|   126k|  FLOAT32 *ptr_loc_qmf_buf_imag;
 1712|   126k|  FLOAT32 local_qmf_buffer[128] = {0};
 1713|   126k|  FLOAT32 anal_buf[2 * 32] = {0};
 1714|   126k|  WORD32 idx, z;
 1715|   126k|  WORD32 core_syn_ch_index;
 1716|   126k|  FLOAT32 gain;
 1717|   126k|  WORD32 filt_offset;
 1718|   126k|  WORD32 num_columns;
 1719|       |
 1720|   126k|  ia_sbr_qmf_filter_bank_struct *pstr_qmf_anal_bank = pstr_codec_qmf_bank;
 1721|   126k|  ptr_filt_states = pstr_qmf_anal_bank->ptr_state_new_samples_pos_low_32;
 1722|   126k|  ptr_win_coeffs_1 = (FLOAT32 *)pstr_qmf_anal_bank->ptr_filter_pos_32;
 1723|   126k|  num_columns = pstr_qmf_anal_bank->no_channels;
 1724|       |
 1725|   126k|  switch (num_columns) {
 1726|  45.5k|    case 16:
  ------------------
  |  Branch (1726:5): [True: 45.5k, False: 81.1k]
  ------------------
 1727|  45.5k|      ptr_win_coeffs_2 = ptr_win_coeffs_1 + 64;
 1728|  45.5k|      gain = 128.0f;
 1729|  45.5k|      filt_offset = 64;
 1730|  45.5k|      break;
 1731|      0|    case 24:
  ------------------
  |  Branch (1731:5): [True: 0, False: 126k]
  ------------------
 1732|      0|      ptr_win_coeffs_2 = ptr_win_coeffs_1 + 24;
 1733|      0|      gain = 12.0f;
 1734|      0|      filt_offset = 24;
 1735|      0|      break;
 1736|  81.1k|    case 32:
  ------------------
  |  Branch (1736:5): [True: 81.1k, False: 45.5k]
  ------------------
 1737|  81.1k|      ptr_win_coeffs_2 = ptr_win_coeffs_1 + 64;
 1738|  81.1k|      gain = 256.0f;
 1739|  81.1k|      filt_offset = 64;
 1740|  81.1k|      break;
 1741|      0|    default:
  ------------------
  |  Branch (1741:5): [True: 0, False: 126k]
  ------------------
 1742|      0|      ptr_win_coeffs_2 = ptr_win_coeffs_1 + 64;
 1743|      0|      gain = 256.0f;
 1744|      0|      filt_offset = 64;
 1745|      0|      break;
 1746|   126k|  }
 1747|   126k|  gain = 1.0f / gain;
 1748|       |
 1749|   126k|  pstr_qmf_anal_bank->usb = (WORD16)num_columns;
 1750|       |
 1751|   126k|  ptr_loc_qmf_buf_real = &local_qmf_buffer[0];
 1752|   126k|  ptr_loc_qmf_buf_imag = &local_qmf_buffer[64];
 1753|       |
 1754|   126k|  ptr_filt_states_1 = pstr_qmf_anal_bank->anal_filter_states_32;
 1755|   126k|  ptr_filt_states_2 = pstr_qmf_anal_bank->anal_filter_states_32 + num_columns;
 1756|       |
 1757|   126k|  idx = 0;
 1758|  5.63M|  while (idx < pstr_codec_qmf_bank->num_time_slots) {
  ------------------
  |  Branch (1758:10): [True: 5.50M, False: 126k]
  ------------------
 1759|   135M|    for (z = 0; z < num_columns; z++) {
  ------------------
  |  Branch (1759:17): [True: 129M, False: 5.50M]
  ------------------
 1760|   129M|      ptr_filt_states[num_columns - 1 - z] = ptr_core_coder_samples[z];
 1761|   129M|    }
 1762|       |
 1763|  5.50M|    ixheaace_esbr_qmfanal32_winadd(ptr_filt_states_1, ptr_filt_states_2, ptr_win_coeffs_1,
 1764|  5.50M|                                   ptr_win_coeffs_2, anal_buf, num_columns);
 1765|       |
 1766|  5.50M|    ptr_core_coder_samples += num_columns;
 1767|       |
 1768|  5.50M|    ptr_filt_states -= num_columns;
 1769|  5.50M|    if (ptr_filt_states < pstr_qmf_anal_bank->anal_filter_states_32) {
  ------------------
  |  Branch (1769:9): [True: 551k, False: 4.95M]
  ------------------
 1770|   551k|      ptr_filt_states =
 1771|   551k|          pstr_qmf_anal_bank->anal_filter_states_32 + 10 * num_columns - num_columns;
 1772|   551k|    }
 1773|       |
 1774|  5.50M|    ptr_temp = ptr_filt_states_1;
 1775|  5.50M|    ptr_filt_states_1 = ptr_filt_states_2;
 1776|  5.50M|    ptr_filt_states_2 = ptr_temp;
 1777|       |
 1778|  5.50M|    ptr_win_coeffs_1 += filt_offset;
 1779|  5.50M|    ptr_win_coeffs_2 += filt_offset;
 1780|       |
 1781|  5.50M|    ptr_win_coeffs = ptr_win_coeffs_1;
 1782|  5.50M|    ptr_win_coeffs_1 = ptr_win_coeffs_2;
 1783|  5.50M|    ptr_win_coeffs_2 = ptr_win_coeffs;
 1784|       |
 1785|  5.50M|    if (ptr_win_coeffs_2 > (pstr_qmf_anal_bank->ptr_ana_win_coeff_32 + filt_offset * 10)) {
  ------------------
  |  Branch (1785:9): [True: 550k, False: 4.95M]
  ------------------
 1786|   550k|      ptr_win_coeffs_1 = (FLOAT32 *)pstr_qmf_anal_bank->ptr_ana_win_coeff_32;
 1787|   550k|      ptr_win_coeffs_2 = (FLOAT32 *)pstr_qmf_anal_bank->ptr_ana_win_coeff_32 + filt_offset;
 1788|   550k|    }
 1789|       |
 1790|  5.50M|    ixheaace_esbr_fwd_modulation(anal_buf, &ptr_loc_qmf_buf_real[0], &ptr_loc_qmf_buf_imag[0],
 1791|  5.50M|                                 pstr_qmf_anal_bank, pstr_qmf_dec_tabs);
 1792|       |
 1793|  5.50M|    core_syn_ch_index = num_columns;
 1794|       |
 1795|   135M|    for (z = 0; z < core_syn_ch_index; z++) {
  ------------------
  |  Branch (1795:17): [True: 129M, False: 5.50M]
  ------------------
 1796|   129M|      qmf_buf_real[op_delay + idx][z] = ((FLOAT32)ptr_loc_qmf_buf_real[z] * gain);
 1797|   129M|      qmf_buf_imag[op_delay + idx][z] = ((FLOAT32)ptr_loc_qmf_buf_imag[z] * gain);
 1798|   129M|    }
 1799|       |
 1800|  5.50M|    idx++;
 1801|  5.50M|  }
 1802|       |
 1803|   126k|  pstr_qmf_anal_bank->ptr_filter_pos_32 = ptr_win_coeffs_1;
 1804|   126k|  pstr_qmf_anal_bank->ptr_state_new_samples_pos_low_32 = ptr_filt_states;
 1805|   126k|}
ixheaace_extract_sbr_envelope:
 1811|   424k|                                           WORD32 flag_framelength_small) {
 1812|   424k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   424k|#define IA_NO_ERROR 0x00000000
  ------------------
 1813|   424k|  WORD32 ch, i, j, c;
 1814|   424k|  WORD32 n_envelopes[IXHEAACE_MAX_CH_IN_BS_ELE];
 1815|   424k|  WORD32 transient_info[IXHEAACE_MAX_CH_IN_BS_ELE][3];
 1816|   424k|  const ixheaace_str_frame_info_sbr *pstr_const_frame_info[IXHEAACE_MAX_CH_IN_BS_ELE];
 1817|   424k|  ixheaace_str_frame_info_sbr *pstr_frame_info = NULL;
 1818|       |
 1819|   424k|  ixheaace_pstr_sbr_config_data pstr_sbr_cfg = &pstr_env_enc->str_sbr_cfg;
 1820|   424k|  ixheaace_pstr_sbr_hdr_data pstr_sbr_hdr = &pstr_env_enc->str_sbr_hdr;
 1821|   424k|  ixheaace_pstr_sbr_bitstream_data pstr_sbr_bs = &pstr_env_enc->str_sbr_bs;
 1822|   424k|  struct ixheaace_ps_enc *pstr_ps_enc = pstr_env_enc->pstr_ps_enc;
 1823|   424k|  ixheaace_pstr_sbr_qmf_filter_bank pstr_synthesis_qmf_bank =
 1824|   424k|      pstr_env_enc->pstr_synthesis_qmf_bank;
 1825|   424k|  ixheaace_pstr_common_data pstr_com_data = &pstr_env_enc->str_cmon_data;
 1826|   424k|  WORD8 *ptr_sbr_scratch = pstr_env_enc->ptr_sbr_enc_scr->sbr_scratch;
 1827|   424k|  ixheaace_pstr_enc_channel pstr_env_ch[IXHEAACE_MAX_CH_IN_BS_ELE];
 1828|   424k|  pstr_env_ch[0] = pstr_env_enc->pstr_env_channel[0];
 1829|   424k|  pstr_env_ch[1] = pstr_env_enc->pstr_env_channel[1];
 1830|       |
 1831|   424k|  WORD32 num_channels = pstr_sbr_cfg->num_ch;
 1832|   424k|  WORD32 n_in_channels = (pstr_ps_enc) ? 2 : num_channels;
  ------------------
  |  Branch (1832:26): [True: 19.7k, False: 404k]
  ------------------
 1833|       |
 1834|   424k|  ixheaace_sbr_stereo_mode stereo_mode = pstr_sbr_cfg->stereo_mode;
 1835|   424k|  struct ixheaace_str_sbr_env_data *pstr_env_0 = &(pstr_env_ch[0]->enc_env_data);
 1836|   424k|  struct ixheaace_str_sbr_env_data *pstr_env_1 = NULL;
 1837|       |
 1838|   424k|  if (num_channels > 1) {
  ------------------
  |  Branch (1838:7): [True: 169k, False: 254k]
  ------------------
 1839|   169k|    pstr_env_1 = &(pstr_env_ch[1]->enc_env_data);
 1840|   169k|  }
 1841|   424k|  ixheaace_freq_res res[MAXIMUM_NUM_NOISE_VALUES];
 1842|   424k|  WORD32 *ptr_v_tuning;
 1843|   424k|  WORD32 v_tuning_lc_sbr[6] = {0, 2, 4, 0, 0, 0};
 1844|   424k|  WORD32 v_tuning_ld_sbr[6] = {0, 2, 3, 0, 0, 0};
 1845|   424k|  if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (1845:7): [True: 74.7k, False: 349k]
  ------------------
 1846|  74.7k|    ptr_v_tuning = v_tuning_ld_sbr;
 1847|   349k|  } else {
 1848|   349k|    ptr_v_tuning = v_tuning_lc_sbr;
 1849|   349k|  }
 1850|   424k|  FLOAT32 *ptr_noise_floor[IXHEAACE_MAX_CH_IN_BS_ELE] = {NULL};
 1851|   424k|  WORD32 *ptr_scale_factor_band_nrg[IXHEAACE_MAX_CH_IN_BS_ELE] = {NULL};
 1852|   424k|  WORD32 *ptr_noise_level[IXHEAACE_MAX_CH_IN_BS_ELE] = {NULL};
 1853|       |
 1854|   424k|  WORD32 *ptr_sfb_nrg_coupling[IXHEAACE_MAX_CH_IN_BS_ELE];
 1855|   424k|  WORD32 *ptr_noise_lvl_coupling[IXHEAACE_MAX_CH_IN_BS_ELE];
 1856|   424k|  WORD32 *ptr_frame_splitter_scratch =
 1857|   424k|      (WORD32 *)pstr_env_ch[0]->str_sbr_extract_env.ptr_r_buffer[0];
 1858|       |
 1859|   424k|  WORD32 max_quant_error;
 1860|   424k|  ixheaace_str_esbr_bs_data str_esbr = {0};
 1861|   424k|  WORD32 samp_ratio_fac = DOWNSAMPLE_FAC_2_1;
  ------------------
  |  |   26|   424k|#define DOWNSAMPLE_FAC_2_1 (2)
  ------------------
 1862|   424k|  if ((pstr_env_enc->str_sbr_cfg.sbr_codec == USAC_SBR) &&
  ------------------
  |  Branch (1862:7): [True: 211k, False: 212k]
  ------------------
 1863|   211k|      (pstr_env_enc->str_sbr_cfg.sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1)) {
  ------------------
  |  |  188|   211k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (1863:7): [True: 51.3k, False: 160k]
  ------------------
 1864|  51.3k|    samp_ratio_fac = DOWNSAMPLE_FAC_4_1;
  ------------------
  |  |   27|  51.3k|#define DOWNSAMPLE_FAC_4_1 (4)
  ------------------
 1865|  51.3k|  }
 1866|   424k|  if ((n_in_channels > IXHEAACE_MAX_CH_IN_BS_ELE) || (n_in_channels < num_channels) ||
  ------------------
  |  |   22|   424k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (1866:7): [True: 0, False: 424k]
  |  Branch (1866:54): [True: 0, False: 424k]
  ------------------
 1867|   424k|      (n_in_channels <= 0) || (num_channels <= 0)) {
  ------------------
  |  Branch (1867:7): [True: 0, False: 424k]
  |  Branch (1867:31): [True: 0, False: 424k]
  ------------------
 1868|      0|    return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_IN_CHANNELS;
 1869|      0|  }
 1870|   424k|  ch = 0;
 1871|  1.03M|  while (ch < n_in_channels) {
  ------------------
  |  Branch (1871:10): [True: 613k, False: 424k]
  ------------------
 1872|   613k|    ptr_sfb_nrg_coupling[ch] = (WORD32 *)pstr_env_ch[ch]->str_sbr_extract_env.ptr_r_buffer[0];
 1873|   613k|    ptr_noise_lvl_coupling[ch] = (WORD32 *)pstr_env_ch[ch]->str_sbr_extract_env.ptr_i_buffer[0];
 1874|   613k|    ptr_scale_factor_band_nrg[ch] =
 1875|   613k|        (WORD32 *)pstr_env_ch[ch]->str_sbr_extract_env.ptr_r_buffer[0] +
 1876|   613k|        IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES;
  ------------------
  |  |   22|   613k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                      IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES;
  ------------------
  |  |   94|   613k|#define MAXIMUM_NUM_ENVELOPE_VALUES (MAXIMUM_NUM_ENV_VALUES_USAC)
  |  |  ------------------
  |  |  |  |   78|   613k|#define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   613k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  |  |  ------------------
  |  |  |  |               #define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|   613k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1877|   613k|    ptr_noise_level[ch] = (WORD32 *)pstr_env_ch[ch]->str_sbr_extract_env.ptr_i_buffer[0] +
 1878|   613k|                          IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES;
  ------------------
  |  |   22|   613k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                                        IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES;
  ------------------
  |  |   94|   613k|#define MAXIMUM_NUM_ENVELOPE_VALUES (MAXIMUM_NUM_ENV_VALUES_USAC)
  |  |  ------------------
  |  |  |  |   78|   613k|#define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   613k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  |  |  ------------------
  |  |  |  |               #define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|   613k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1879|   613k|    ptr_noise_floor[ch] = pstr_env_ch[ch]->str_sbr_extract_env.ptr_i_buffer[0] +
 1880|   613k|                          IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES * 2;
  ------------------
  |  |   22|   613k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                                        IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES * 2;
  ------------------
  |  |   94|   613k|#define MAXIMUM_NUM_ENVELOPE_VALUES (MAXIMUM_NUM_ENV_VALUES_USAC)
  |  |  ------------------
  |  |  |  |   78|   613k|#define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   613k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  |  |  ------------------
  |  |  |  |               #define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|   613k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1881|   613k|    ch++;
 1882|   613k|  }
 1883|   424k|  if ((pstr_sbr_cfg->sbr_codec == USAC_SBR) && (pstr_sbr_hdr->sbr_harmonic)) {
  ------------------
  |  Branch (1883:7): [True: 211k, False: 212k]
  |  Branch (1883:48): [True: 117k, False: 94.3k]
  ------------------
 1884|   117k|    WORD32 num_sbr_samples = 2048;
 1885|   117k|    if (pstr_sbr_cfg->sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|   117k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (1885:9): [True: 33.1k, False: 83.9k]
  ------------------
 1886|  33.1k|      num_sbr_samples = IXHEAACE_MAX_NUM_SAMPLES;
  ------------------
  |  |   43|  33.1k|#define IXHEAACE_MAX_NUM_SAMPLES (4096)
  ------------------
 1887|  33.1k|    }
 1888|   117k|    err_code = ixheaace_hbe_get_pitch_bins(
 1889|   117k|        ptr_in_time, pstr_sbr_cfg, pstr_env_ch[0]->str_sbr_extract_env.ptr_r_buffer[0],
 1890|   117k|        ptr_sbr_tab, time_sn_stride, num_sbr_samples, &pstr_env_0->sbr_pitchin_bins,
 1891|   117k|        n_in_channels == 1 ? NULL : &pstr_env_1->sbr_pitchin_bins);
  ------------------
  |  Branch (1891:9): [True: 74.4k, False: 42.6k]
  ------------------
 1892|   117k|    if (err_code) return err_code;
  ------------------
  |  Branch (1892:9): [True: 2.50k, False: 114k]
  ------------------
 1893|       |
 1894|   114k|    WORD32 op_delay, codec_x_delay, num_time_slots;
 1895|   114k|    op_delay = IXHEAACE_OP_DELAY_OFFSET;
  ------------------
  |  |   26|   114k|#define IXHEAACE_OP_DELAY_OFFSET (6)
  ------------------
 1896|   114k|    codec_x_delay = IXHEAACE_ESBR_HBE_DELAY_OFFSET;
  ------------------
  |  |   35|   114k|#define IXHEAACE_ESBR_HBE_DELAY_OFFSET (32)
  ------------------
 1897|   114k|    if (pstr_sbr_cfg->sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|   114k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (1897:9): [True: 33.1k, False: 81.4k]
  ------------------
 1898|  33.1k|      op_delay = 2 * op_delay;
 1899|  33.1k|      codec_x_delay = 2 * codec_x_delay;
 1900|  33.1k|    }
 1901|       |
 1902|   114k|    WORD32 eff_offset = op_delay + IXHEAACE_SBR_HF_ADJ_OFFSET;
  ------------------
  |  |   36|   114k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
 1903|   114k|    WORD32 memmove_sz1 = (eff_offset + codec_x_delay) *
 1904|   114k|                         sizeof(pstr_env_ch[0]->pstr_hbe_enc->qmf_buf_real[0][0]) *
 1905|   114k|                         MAX_QMF_TIME_SLOTS;
  ------------------
  |  |   75|   114k|#define MAX_QMF_TIME_SLOTS (64)
  ------------------
 1906|   114k|    WORD32 memmove_sz2 = eff_offset *
 1907|   114k|                         sizeof(pstr_env_ch[0]->pstr_hbe_enc->ph_vocod_qmf_real[0][0]) *
 1908|   114k|                         MAX_QMF_TIME_SLOTS;
  ------------------
  |  |   75|   114k|#define MAX_QMF_TIME_SLOTS (64)
  ------------------
 1909|       |
 1910|   269k|    for (ch = 0; ch < n_in_channels; ch++) {
  ------------------
  |  Branch (1910:18): [True: 154k, False: 114k]
  ------------------
 1911|   154k|      ixheaace_str_hbe_enc *pstr_hbe_enc = pstr_env_ch[ch]->pstr_hbe_enc;
 1912|   154k|      num_time_slots =
 1913|   154k|          pstr_env_ch[ch]->str_sbr_qmf.num_time_slots * pstr_env_ch[ch]->str_sbr_qmf.rate;
 1914|       |
 1915|   154k|      memmove(pstr_hbe_enc->qmf_buf_real[0], pstr_hbe_enc->qmf_buf_real[num_time_slots],
 1916|   154k|              memmove_sz1);
 1917|   154k|      memmove(pstr_hbe_enc->qmf_buf_imag[0], pstr_hbe_enc->qmf_buf_imag[num_time_slots],
 1918|   154k|              memmove_sz1);
 1919|   154k|      memmove(pstr_hbe_enc->ph_vocod_qmf_real[0], pstr_hbe_enc->ph_vocod_qmf_real[num_time_slots],
 1920|   154k|              memmove_sz2);
 1921|   154k|      memmove(pstr_hbe_enc->ph_vocod_qmf_imag, pstr_hbe_enc->ph_vocod_qmf_imag + num_time_slots,
 1922|   154k|              memmove_sz2);
 1923|   154k|    }
 1924|   114k|  }
 1925|   421k|  i = 0;
 1926|  4.63M|  while (i < MAXIMUM_NUM_NOISE_VALUES) {
  ------------------
  |  |   58|  4.63M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  4.63M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  4.63M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (1926:10): [True: 4.21M, False: 421k]
  ------------------
 1927|  4.21M|    res[i] = FREQ_RES_HIGH;
 1928|  4.21M|    i++;
 1929|  4.21M|  }
 1930|       |
 1931|   421k|  memset(transient_info, 0, sizeof(transient_info));
 1932|       |
 1933|   421k|  ch = 0;
 1934|  1.03M|  while (ch < n_in_channels) {
  ------------------
  |  Branch (1934:10): [True: 608k, False: 421k]
  ------------------
 1935|   608k|    ixheaace_str_sbr_extr_env *pstr_sbr_extract_env = &(pstr_env_ch[ch]->str_sbr_extract_env);
 1936|       |
 1937|   608k|    ixheaace_sbr_analysis_filtering(
 1938|   608k|        ptr_in_time ? ptr_in_time + ch : NULL, time_sn_stride,
  ------------------
  |  Branch (1938:9): [True: 608k, False: 0]
  ------------------
 1939|   608k|        pstr_sbr_extract_env->ptr_r_buffer, pstr_sbr_extract_env->ptr_i_buffer,
 1940|   608k|        &pstr_env_ch[ch]->str_sbr_qmf, ptr_sbr_tab->ptr_qmf_tab,
 1941|   608k|        pstr_env_ch[ch]->str_sbr_qmf.num_time_slots * pstr_env_ch[ch]->str_sbr_qmf.rate,
 1942|   608k|        pstr_sbr_cfg->is_ld_sbr, (FLOAT32 *)ptr_sbr_scratch,
 1943|   608k|        (pstr_ps_enc != NULL && flag_framelength_small));
  ------------------
  |  Branch (1943:10): [True: 39.4k, False: 569k]
  |  Branch (1943:33): [True: 17.9k, False: 21.4k]
  ------------------
 1944|       |
 1945|   608k|    if ((1 == n_in_channels) && (USAC_SBR == pstr_sbr_cfg->sbr_codec) &&
  ------------------
  |  Branch (1945:9): [True: 234k, False: 373k]
  |  Branch (1945:33): [True: 140k, False: 93.8k]
  ------------------
 1946|   140k|        (pstr_sbr_hdr->sbr_pvc_active)) {
  ------------------
  |  Branch (1946:9): [True: 49.8k, False: 91.0k]
  ------------------
 1947|  49.8k|      ixheaace_pvc_scratch *pstr_pvc_scr = (ixheaace_pvc_scratch *)ptr_sbr_scratch;
 1948|  49.8k|      WORD32 ts, bd;
 1949|  49.8k|      FLOAT32 nrg_0, nrg_1;
 1950|  49.8k|      FLOAT32 *ptr_r_0, *ptr_r_1, *ptr_i_0, *ptr_i_1;
 1951|  49.8k|      FLOAT32 *ptr_r_2, *ptr_r_3, *ptr_i_2, *ptr_i_3, nrg_2, nrg_3;
 1952|  49.8k|      WORD32 pvc_rate = pstr_env_enc->pstr_pvc_enc->pvc_param.pvc_rate;
 1953|       |
 1954|       |      // update header_active to send SBR header when previous PVC mode is different from
 1955|       |      // current frame's
 1956|  49.8k|      if (pstr_env_enc->str_sbr_hdr.sbr_pvc_mode !=
  ------------------
  |  Branch (1956:11): [True: 890, False: 49.0k]
  ------------------
 1957|  49.8k|          pstr_env_enc->pstr_pvc_enc->pvc_param.pvc_mode) {
 1958|    890|        pstr_sbr_bs->header_active = 1;
 1959|    890|      }
 1960|       |
 1961|  49.8k|      switch (pvc_rate) {
  ------------------
  |  Branch (1961:15): [True: 49.8k, False: 0]
  ------------------
 1962|  35.2k|        case 2: {
  ------------------
  |  Branch (1962:9): [True: 35.2k, False: 14.6k]
  ------------------
 1963|   599k|          for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS; ts++) {
  ------------------
  |  |   26|   599k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (1963:24): [True: 564k, False: 35.2k]
  ------------------
 1964|   564k|            ptr_r_0 = pstr_sbr_extract_env->ptr_r_buffer[pvc_rate * ts];
 1965|   564k|            ptr_r_1 = pstr_sbr_extract_env->ptr_r_buffer[pvc_rate * ts + 1];
 1966|   564k|            ptr_i_0 = pstr_sbr_extract_env->ptr_i_buffer[pvc_rate * ts];
 1967|   564k|            ptr_i_1 = pstr_sbr_extract_env->ptr_i_buffer[pvc_rate * ts + 1];
 1968|       |
 1969|  36.6M|            for (bd = 0; bd < MAX_QMF_TIME_SLOTS; bd++) {
  ------------------
  |  |   75|  36.6M|#define MAX_QMF_TIME_SLOTS (64)
  ------------------
  |  Branch (1969:26): [True: 36.1M, False: 564k]
  ------------------
 1970|  36.1M|              nrg_0 = ptr_r_0[bd] * ptr_r_0[bd] + ptr_i_0[bd] * ptr_i_0[bd];
 1971|  36.1M|              nrg_1 = ptr_r_1[bd] * ptr_r_1[bd] + ptr_i_1[bd] * ptr_i_1[bd];
 1972|  36.1M|              pstr_pvc_scr->pvc_qmf_high[ts * IXHEAACE_ESBR_PVC_NUM_QMF_BANDS + bd] =
  ------------------
  |  |   27|  36.1M|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
 1973|  36.1M|                  (nrg_0 + nrg_1) / 2.0f;
 1974|  36.1M|            }
 1975|   564k|            WORD32 num_low_bands = MAX_QMF_TIME_SLOTS >> 1;
  ------------------
  |  |   75|   564k|#define MAX_QMF_TIME_SLOTS (64)
  ------------------
 1976|  18.6M|            for (bd = 0; bd < num_low_bands; bd++) {
  ------------------
  |  Branch (1976:26): [True: 18.0M, False: 564k]
  ------------------
 1977|  18.0M|              pstr_pvc_scr->pvc_qmf_low[ts * num_low_bands + bd] =
 1978|  18.0M|                  pstr_pvc_scr->pvc_qmf_high[ts * IXHEAACE_ESBR_PVC_NUM_QMF_BANDS + bd];
  ------------------
  |  |   27|  18.0M|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
 1979|  18.0M|            }
 1980|   564k|          }
 1981|  35.2k|          break;
 1982|      0|        }
 1983|  14.6k|        case 4: {
  ------------------
  |  Branch (1983:9): [True: 14.6k, False: 35.2k]
  ------------------
 1984|   248k|          for (ts = 0; ts < IXHEAACE_ESBR_PVC_NUM_TS; ts++) {
  ------------------
  |  |   26|   248k|#define IXHEAACE_ESBR_PVC_NUM_TS (16)
  ------------------
  |  Branch (1984:24): [True: 233k, False: 14.6k]
  ------------------
 1985|   233k|            ptr_r_0 = pstr_sbr_extract_env->ptr_r_buffer[pvc_rate * ts];
 1986|   233k|            ptr_r_1 = pstr_sbr_extract_env->ptr_r_buffer[pvc_rate * ts + 1];
 1987|   233k|            ptr_r_2 = pstr_sbr_extract_env->ptr_r_buffer[pvc_rate * ts + 2];
 1988|   233k|            ptr_r_3 = pstr_sbr_extract_env->ptr_r_buffer[pvc_rate * ts + 3];
 1989|   233k|            ptr_i_0 = pstr_sbr_extract_env->ptr_i_buffer[pvc_rate * ts];
 1990|   233k|            ptr_i_1 = pstr_sbr_extract_env->ptr_i_buffer[pvc_rate * ts + 1];
 1991|   233k|            ptr_i_2 = pstr_sbr_extract_env->ptr_i_buffer[pvc_rate * ts + 2];
 1992|   233k|            ptr_i_3 = pstr_sbr_extract_env->ptr_i_buffer[pvc_rate * ts + 3];
 1993|       |
 1994|  15.1M|            for (bd = 0; bd < MAX_QMF_TIME_SLOTS; bd++) {
  ------------------
  |  |   75|  15.1M|#define MAX_QMF_TIME_SLOTS (64)
  ------------------
  |  Branch (1994:26): [True: 14.9M, False: 233k]
  ------------------
 1995|  14.9M|              nrg_0 = ptr_r_0[bd] * ptr_r_0[bd] + ptr_i_0[bd] * ptr_i_0[bd];
 1996|  14.9M|              nrg_1 = ptr_r_1[bd] * ptr_r_1[bd] + ptr_i_1[bd] * ptr_i_1[bd];
 1997|  14.9M|              nrg_2 = ptr_r_2[bd] * ptr_r_2[bd] + ptr_i_2[bd] * ptr_i_2[bd];
 1998|  14.9M|              nrg_3 = ptr_r_3[bd] * ptr_r_3[bd] + ptr_i_3[bd] * ptr_i_3[bd];
 1999|  14.9M|              pstr_pvc_scr->pvc_qmf_high[ts * IXHEAACE_ESBR_PVC_NUM_QMF_BANDS + bd] =
  ------------------
  |  |   27|  14.9M|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
 2000|  14.9M|                  (nrg_0 + nrg_1 + nrg_2 + nrg_3) / 4.0f;
 2001|  14.9M|            }
 2002|   233k|            WORD32 num_low_bands = (MAX_QMF_TIME_SLOTS >> 2);
  ------------------
  |  |   75|   233k|#define MAX_QMF_TIME_SLOTS (64)
  ------------------
 2003|  3.97M|            for (bd = 0; bd < num_low_bands; bd++) {
  ------------------
  |  Branch (2003:26): [True: 3.74M, False: 233k]
  ------------------
 2004|  3.74M|              pstr_pvc_scr->pvc_qmf_low[ts * num_low_bands + bd] =
 2005|  3.74M|                  pstr_pvc_scr->pvc_qmf_high[ts * IXHEAACE_ESBR_PVC_NUM_QMF_BANDS + bd];
  ------------------
  |  |   27|  3.74M|#define IXHEAACE_ESBR_PVC_NUM_QMF_BANDS (64)
  ------------------
 2006|  3.74M|            }
 2007|   233k|          }
 2008|  14.6k|          break;
 2009|      0|        }
 2010|  49.8k|      }
 2011|  49.8k|      pstr_env_enc->pstr_pvc_enc->pvc_param.usac_indep_flag = pstr_sbr_bs->usac_indep_flag;
 2012|  49.8k|      err_code = ixheaace_pvc_encode_frame(
 2013|  49.8k|          pstr_env_enc->pstr_pvc_enc, (UWORD8)pstr_env_enc->str_sbr_hdr.sbr_pvc_mode,
 2014|  49.8k|          pstr_pvc_scr->pvc_qmf_low, pstr_pvc_scr->pvc_qmf_high,
 2015|  49.8k|          pstr_sbr_cfg->ptr_v_k_master[0],
 2016|  49.8k|          pstr_sbr_cfg->ptr_v_k_master[pstr_sbr_cfg->num_master] - 1);
 2017|  49.8k|      if (err_code) {
  ------------------
  |  Branch (2017:11): [True: 0, False: 49.8k]
  ------------------
 2018|      0|        return err_code;
 2019|      0|      }
 2020|       |
 2021|  49.8k|      memcpy(&pstr_env_ch[ch]->enc_env_data.pvc_info, &pstr_env_enc->pstr_pvc_enc->pvc_bs_info,
 2022|  49.8k|             sizeof(ixheaace_pvc_bs_info));
 2023|  49.8k|    }
 2024|       |
 2025|       |    // COPY generated spectrum for inter-TES encoder
 2026|   608k|    if ((USAC_SBR == pstr_sbr_cfg->sbr_codec) && (1 == pstr_sbr_hdr->sbr_inter_tes_active)) {
  ------------------
  |  Branch (2026:9): [True: 276k, False: 331k]
  |  Branch (2026:50): [True: 93.5k, False: 183k]
  ------------------
 2027|  93.5k|      WORD32 ts, num_ts, delay;
 2028|  93.5k|      num_ts = pstr_env_ch[ch]->str_sbr_qmf.num_time_slots;
 2029|       |
 2030|  93.5k|      ixheaace_str_inter_tes_params *pstr_tes_enc = &pstr_env_ch[ch]->str_inter_tes_enc;
 2031|  93.5k|      delay = pstr_tes_enc->op_delay + pstr_tes_enc->codec_delay + IXHEAACE_SBR_HF_ADJ_OFFSET;
  ------------------
  |  |   36|  93.5k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
 2032|  93.5k|      ts = 0;
 2033|  1.58M|      while (ts < num_ts) {
  ------------------
  |  Branch (2033:14): [True: 1.49M, False: 93.5k]
  ------------------
 2034|  1.49M|        memcpy(pstr_tes_enc->qmf_buf_real[delay + ts], pstr_sbr_extract_env->ptr_r_buffer[ts],
 2035|  1.49M|               IXHEAACE_QMF_CHANNELS * sizeof(pstr_tes_enc->qmf_buf_real[0][0]));
  ------------------
  |  |   66|  1.49M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
 2036|  1.49M|        memcpy(pstr_tes_enc->qmf_buf_imag[delay + ts], pstr_sbr_extract_env->ptr_i_buffer[ts],
 2037|  1.49M|               IXHEAACE_QMF_CHANNELS * sizeof(pstr_tes_enc->qmf_buf_imag[0][0]));
  ------------------
  |  |   66|  1.49M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
 2038|  1.49M|        ts++;
 2039|  1.49M|      }
 2040|  93.5k|    }
 2041|       |
 2042|   608k|    ch++;
 2043|   608k|  }
 2044|   421k|  if ((pstr_sbr_cfg->sbr_codec == USAC_SBR) && (pstr_sbr_hdr->sbr_harmonic)) {
  ------------------
  |  Branch (2044:7): [True: 208k, False: 212k]
  |  Branch (2044:48): [True: 114k, False: 94.3k]
  ------------------
 2045|   114k|    WORD32 dft_hbe_flag = 0;
 2046|   114k|    WORD32 op_delay, codec_x_delay, num_time_slots;
 2047|   114k|    WORD32 esbr_hbe_delay_offsets = IXHEAACE_ESBR_HBE_DELAY_OFFSET;
  ------------------
  |  |   35|   114k|#define IXHEAACE_ESBR_HBE_DELAY_OFFSET (32)
  ------------------
 2048|   114k|    WORD32 oversampling_flag = 0;
 2049|   114k|    op_delay = IXHEAACE_OP_DELAY_OFFSET;
  ------------------
  |  |   26|   114k|#define IXHEAACE_OP_DELAY_OFFSET (6)
  ------------------
 2050|   114k|    codec_x_delay = IXHEAACE_ESBR_HBE_DELAY_OFFSET;
  ------------------
  |  |   35|   114k|#define IXHEAACE_ESBR_HBE_DELAY_OFFSET (32)
  ------------------
 2051|   114k|    if (pstr_sbr_cfg->sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|   114k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (2051:9): [True: 33.1k, False: 81.4k]
  ------------------
 2052|  33.1k|      op_delay = 2 * IXHEAACE_OP_DELAY_OFFSET;
  ------------------
  |  |   26|  33.1k|#define IXHEAACE_OP_DELAY_OFFSET (6)
  ------------------
 2053|  33.1k|      codec_x_delay = 2 * codec_x_delay;
 2054|  33.1k|      oversampling_flag = 1;
 2055|  33.1k|    }
 2056|   114k|    WORD32 eff_offset = op_delay + IXHEAACE_SBR_HF_ADJ_OFFSET;
  ------------------
  |  |   36|   114k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
 2057|   114k|    dft_hbe_flag = pstr_sbr_hdr->hq_esbr;
 2058|   114k|    ch = 0;
 2059|   260k|    while (ch < n_in_channels) {
  ------------------
  |  Branch (2059:12): [True: 152k, False: 107k]
  ------------------
 2060|   152k|      ixheaace_str_hbe_enc *pstr_hbe_enc = pstr_env_ch[ch]->pstr_hbe_enc;
 2061|   152k|      pstr_hbe_enc->pstr_hbe_txposer->oversampling_flag = oversampling_flag;
 2062|   152k|      num_time_slots =
 2063|   152k|          pstr_env_ch[ch]->str_sbr_qmf.num_time_slots * pstr_env_ch[ch]->str_sbr_qmf.rate;
 2064|       |
 2065|   152k|      if (dft_hbe_flag == 1) {
  ------------------
  |  Branch (2065:11): [True: 26.1k, False: 126k]
  ------------------
 2066|  26.1k|        err_code = ixheaace_dft_hbe_apply(
 2067|  26.1k|            pstr_hbe_enc->pstr_hbe_txposer,
 2068|  26.1k|            pstr_hbe_enc->qmf_buf_real + eff_offset + esbr_hbe_delay_offsets,
 2069|  26.1k|            pstr_hbe_enc->qmf_buf_imag + eff_offset + esbr_hbe_delay_offsets, num_time_slots,
 2070|  26.1k|            pstr_hbe_enc->ph_vocod_qmf_real + eff_offset,
 2071|  26.1k|            pstr_hbe_enc->ph_vocod_qmf_imag + eff_offset,
 2072|  26.1k|            pstr_env_ch[ch]->enc_env_data.sbr_pitchin_bins, (FLOAT32 *)ptr_sbr_scratch);
 2073|  26.1k|        if (err_code) {
  ------------------
  |  Branch (2073:13): [True: 7.02k, False: 19.0k]
  ------------------
 2074|  7.02k|          return err_code;
 2075|  7.02k|        }
 2076|   126k|      } else {
 2077|       |        // size 4096 samples
 2078|   126k|        FLOAT32 *ptr_time_data = (FLOAT32 *)ptr_sbr_scratch;
 2079|   126k|        int cnt = 0;
 2080|   126k|        if (0 == ch) {
  ------------------
  |  Branch (2080:13): [True: 96.9k, False: 29.6k]
  ------------------
 2081|   397M|          while (cnt < IXHEAACE_MAX_NUM_SAMPLES) {
  ------------------
  |  |   43|   397M|#define IXHEAACE_MAX_NUM_SAMPLES (4096)
  ------------------
  |  Branch (2081:18): [True: 397M, False: 96.9k]
  ------------------
 2082|   397M|            ptr_time_data[cnt] = pstr_env_enc->ptr_hbe_resample_buf[2 * cnt];
 2083|   397M|            cnt++;
 2084|   397M|          }
 2085|  96.9k|        } else {
 2086|   121M|          while (cnt < IXHEAACE_MAX_NUM_SAMPLES) {
  ------------------
  |  |   43|   121M|#define IXHEAACE_MAX_NUM_SAMPLES (4096)
  ------------------
  |  Branch (2086:18): [True: 121M, False: 29.6k]
  ------------------
 2087|   121M|            ptr_time_data[cnt] = pstr_env_enc->ptr_hbe_resample_buf[2 * cnt + 1];
 2088|   121M|            cnt++;
 2089|   121M|          }
 2090|  29.6k|        }
 2091|       |
 2092|   126k|        ixheaace_esbr_analysis_filt_block(&(pstr_hbe_enc->str_codec_qmf_bank),
 2093|   126k|                                          pstr_hbe_enc->str_codec_qmf_bank.pstr_qmf_dec_tabs,
 2094|   126k|                                          ptr_time_data, pstr_hbe_enc->qmf_buf_real,
 2095|   126k|                                          pstr_hbe_enc->qmf_buf_imag,
 2096|   126k|                                          op_delay + codec_x_delay + IXHEAACE_SBR_HF_ADJ_OFFSET);
  ------------------
  |  |   36|   126k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
 2097|       |
 2098|   126k|        err_code = ixheaace_qmf_hbe_apply(
 2099|   126k|            pstr_hbe_enc->pstr_hbe_txposer,
 2100|   126k|            pstr_hbe_enc->qmf_buf_real + eff_offset + esbr_hbe_delay_offsets,
 2101|   126k|            pstr_hbe_enc->qmf_buf_imag + eff_offset + esbr_hbe_delay_offsets, num_time_slots,
 2102|   126k|            pstr_hbe_enc->ph_vocod_qmf_real + eff_offset,
 2103|   126k|            pstr_hbe_enc->ph_vocod_qmf_imag + eff_offset,
 2104|   126k|            pstr_env_ch[ch]->enc_env_data.sbr_pitchin_bins);
 2105|   126k|        if (err_code) {
  ------------------
  |  Branch (2105:13): [True: 0, False: 126k]
  ------------------
 2106|      0|          return err_code;
 2107|      0|        }
 2108|       |
 2109|   126k|        if (pstr_sbr_cfg->sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|   126k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (2109:13): [True: 45.5k, False: 81.1k]
  ------------------
 2110|  45.5k|          ixheaace_hbe_repl_spec(&pstr_hbe_enc->pstr_hbe_txposer->x_over_qmf[0],
 2111|  45.5k|                                 pstr_hbe_enc->ph_vocod_qmf_real + eff_offset,
 2112|  45.5k|                                 pstr_hbe_enc->ph_vocod_qmf_imag + eff_offset, num_time_slots,
 2113|  45.5k|                                 pstr_hbe_enc->pstr_hbe_txposer->max_stretch);
 2114|  45.5k|        }
 2115|   126k|      }
 2116|   145k|      ch++;
 2117|   145k|    }
 2118|   114k|  }
 2119|   414k|  if (pstr_ps_enc && pstr_synthesis_qmf_bank) {
  ------------------
  |  Branch (2119:7): [True: 19.7k, False: 395k]
  |  Branch (2119:22): [True: 19.7k, False: 0]
  ------------------
 2120|  19.7k|    err_code = ixheaace_encode_ps_frame(
 2121|  19.7k|        pstr_ps_enc, pstr_env_ch[0]->str_sbr_extract_env.ptr_i_buffer,
 2122|  19.7k|        pstr_env_ch[0]->str_sbr_extract_env.ptr_r_buffer,
 2123|  19.7k|        pstr_env_ch[1]->str_sbr_extract_env.ptr_i_buffer,
 2124|  19.7k|        pstr_env_ch[1]->str_sbr_extract_env.ptr_r_buffer, ptr_sbr_tab->ptr_ps_tab, pstr_com_tab);
 2125|  19.7k|    if (err_code) {
  ------------------
  |  Branch (2125:9): [True: 0, False: 19.7k]
  ------------------
 2126|      0|      return err_code;
 2127|      0|    }
 2128|  19.7k|    ixheaace_enc_synthesis_qmf_filtering(
 2129|  19.7k|        pstr_env_ch[0]->str_sbr_extract_env.ptr_r_buffer,
 2130|  19.7k|        pstr_env_ch[0]->str_sbr_extract_env.ptr_i_buffer, ptr_core_buf,
 2131|  19.7k|        (ixheaace_pstr_sbr_qmf_filter_bank)pstr_synthesis_qmf_bank);
 2132|  19.7k|  }
 2133|       |
 2134|   414k|  ch = 0;
 2135|   994k|  while (ch < num_channels) {
  ------------------
  |  Branch (2135:10): [True: 579k, False: 414k]
  ------------------
 2136|   579k|    ixheaace_str_hbe_enc *pstr_hbe_enc = pstr_env_ch[ch]->pstr_hbe_enc;
 2137|   579k|    ixheaace_str_sbr_extr_env *pstr_sbr_extract_env = &(pstr_env_ch[ch]->str_sbr_extract_env);
 2138|       |
 2139|   579k|    ixheaace_get_energy_from_cplx_qmf(
 2140|   579k|        pstr_sbr_extract_env->ptr_y_buffer + pstr_sbr_extract_env->y_buffer_write_offset,
 2141|   579k|        pstr_sbr_extract_env->ptr_r_buffer, pstr_sbr_extract_env->ptr_i_buffer,
 2142|   579k|        pstr_sbr_cfg->is_ld_sbr, pstr_env_ch[ch]->str_sbr_qmf.num_time_slots, samp_ratio_fac,
 2143|   579k|        pstr_hbe_enc,
 2144|   579k|        (IXHEAACE_OP_DELAY_OFFSET + IXHEAACE_ESBR_HBE_DELAY_OFFSET + IXHEAACE_SBR_HF_ADJ_OFFSET),
  ------------------
  |  |   26|   579k|#define IXHEAACE_OP_DELAY_OFFSET (6)
  ------------------
                      (IXHEAACE_OP_DELAY_OFFSET + IXHEAACE_ESBR_HBE_DELAY_OFFSET + IXHEAACE_SBR_HF_ADJ_OFFSET),
  ------------------
  |  |   35|   579k|#define IXHEAACE_ESBR_HBE_DELAY_OFFSET (32)
  ------------------
                      (IXHEAACE_OP_DELAY_OFFSET + IXHEAACE_ESBR_HBE_DELAY_OFFSET + IXHEAACE_SBR_HF_ADJ_OFFSET),
  ------------------
  |  |   36|   579k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
 2145|   579k|        pstr_sbr_hdr->sbr_harmonic);
 2146|       |
 2147|   579k|    ixheaace_calculate_tonality_quotas(
 2148|   579k|        &pstr_env_ch[ch]->str_ton_corr, pstr_sbr_extract_env->ptr_r_buffer,
 2149|   579k|        pstr_sbr_extract_env->ptr_i_buffer,
 2150|   579k|        pstr_sbr_cfg->ptr_freq_band_tab[HI][pstr_sbr_cfg->num_scf[HI]],
  ------------------
  |  |  101|   579k|#define HI (1)
  ------------------
                      pstr_sbr_cfg->ptr_freq_band_tab[HI][pstr_sbr_cfg->num_scf[HI]],
  ------------------
  |  |  101|   579k|#define HI (1)
  ------------------
 2151|   579k|        pstr_env_ch[ch]->str_sbr_qmf.num_time_slots, pstr_sbr_extract_env->time_step);
 2152|   579k|    if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (2152:9): [True: 113k, False: 466k]
  ------------------
 2153|   113k|      ixheaace_detect_transient_eld(pstr_sbr_extract_env->ptr_y_buffer,
 2154|   113k|                                    &pstr_env_ch[ch]->str_sbr_trans_detector, transient_info[ch]);
 2155|   466k|    } else if (pstr_sbr_extract_env->time_step == 4) {
  ------------------
  |  Branch (2155:16): [True: 64.9k, False: 401k]
  ------------------
 2156|  64.9k|      ixheaace_detect_transient_4_1(pstr_sbr_extract_env->ptr_y_buffer,
 2157|  64.9k|                                    &pstr_env_ch[ch]->str_sbr_trans_detector, transient_info[ch],
 2158|  64.9k|                                    pstr_sbr_extract_env->time_step);
 2159|   401k|    } else {
 2160|   401k|      ixheaace_detect_transient(pstr_sbr_extract_env->ptr_y_buffer,
 2161|   401k|                                &pstr_env_ch[ch]->str_sbr_trans_detector, transient_info[ch],
 2162|   401k|                                pstr_sbr_extract_env->time_step, pstr_sbr_cfg->sbr_codec);
 2163|   401k|    }
 2164|   579k|    if (transient_info[ch][1] == 0) {
  ------------------
  |  Branch (2164:9): [True: 432k, False: 147k]
  ------------------
 2165|   432k|      if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (2165:11): [True: 76.4k, False: 355k]
  ------------------
 2166|  76.4k|        err_code = ixheaace_frame_splitter(
 2167|  76.4k|            pstr_sbr_extract_env->ptr_y_buffer, &pstr_env_ch[ch]->str_sbr_trans_detector,
 2168|  76.4k|            pstr_sbr_cfg->ptr_freq_band_tab[1], pstr_sbr_cfg->num_scf[1],
 2169|  76.4k|            pstr_sbr_extract_env->time_step, pstr_sbr_extract_env->time_slots, transient_info[ch],
 2170|  76.4k|            (FLOAT32 *)ptr_frame_splitter_scratch, pstr_sbr_cfg->is_ld_sbr);
 2171|   355k|      } else {
 2172|   355k|        err_code = ixheaace_frame_splitter(
 2173|   355k|            pstr_sbr_extract_env->ptr_y_buffer, &pstr_env_ch[ch]->str_sbr_trans_detector,
 2174|   355k|            pstr_sbr_cfg->ptr_freq_band_tab[1], pstr_sbr_cfg->num_scf[1],
 2175|   355k|            pstr_sbr_extract_env->time_step, pstr_sbr_extract_env->no_cols, transient_info[ch],
 2176|   355k|            (FLOAT32 *)ptr_frame_splitter_scratch, pstr_sbr_cfg->is_ld_sbr);
 2177|   355k|      }
 2178|   432k|      if (err_code) {
  ------------------
  |  Branch (2178:11): [True: 0, False: 432k]
  ------------------
 2179|      0|        return err_code;
 2180|      0|      }
 2181|   432k|    }
 2182|   579k|    ch++;
 2183|   579k|  }
 2184|       |
 2185|   414k|  if (stereo_mode == SBR_COUPLING) {
  ------------------
  |  Branch (2185:7): [True: 0, False: 414k]
  ------------------
 2186|      0|    if (transient_info[0][1] && transient_info[1][1]) {
  ------------------
  |  Branch (2186:9): [True: 0, False: 0]
  |  Branch (2186:33): [True: 0, False: 0]
  ------------------
 2187|      0|      transient_info[0][0] = ixheaac_min32(transient_info[1][0], transient_info[0][0]);
 2188|       |
 2189|      0|      transient_info[1][0] = transient_info[0][0];
 2190|      0|    } else if (transient_info[0][1] && !transient_info[1][1]) {
  ------------------
  |  Branch (2190:16): [True: 0, False: 0]
  |  Branch (2190:40): [True: 0, False: 0]
  ------------------
 2191|      0|      transient_info[1][0] = transient_info[0][0];
 2192|      0|    } else if (!transient_info[0][1] && transient_info[1][1]) {
  ------------------
  |  Branch (2192:16): [True: 0, False: 0]
  |  Branch (2192:41): [True: 0, False: 0]
  ------------------
 2193|      0|      transient_info[0][0] = transient_info[1][0];
 2194|      0|    } else {
 2195|      0|      transient_info[0][0] = ixheaac_max32(transient_info[1][0], transient_info[0][0]);
 2196|       |
 2197|      0|      transient_info[1][0] = transient_info[0][0];
 2198|      0|    }
 2199|      0|  }
 2200|       |
 2201|   414k|  err_code = ixheaace_frame_info_generator(
 2202|   414k|      &pstr_env_ch[0]->str_sbr_env_frame, pstr_env_ch[0]->str_sbr_extract_env.pre_transient_info,
 2203|   414k|      transient_info[0], ptr_v_tuning, ptr_sbr_tab->ptr_qmf_tab,
 2204|   414k|      pstr_env_ch[0]->str_sbr_qmf.num_time_slots, pstr_sbr_cfg->is_ld_sbr, &pstr_frame_info,
 2205|   414k|      flag_framelength_small);
 2206|   414k|  if (pstr_sbr_cfg->is_ld_sbr && transient_info[0][2]) {
  ------------------
  |  Branch (2206:7): [True: 74.7k, False: 339k]
  |  Branch (2206:34): [True: 1.40k, False: 73.3k]
  ------------------
 2207|  1.40k|    pstr_frame_info->short_env = pstr_frame_info->n_envelopes;
 2208|  1.40k|  }
 2209|   414k|  pstr_const_frame_info[0] = pstr_frame_info;
 2210|   414k|  if (err_code) {
  ------------------
  |  Branch (2210:7): [True: 0, False: 414k]
  ------------------
 2211|      0|    return err_code;
 2212|      0|  }
 2213|       |
 2214|   414k|  pstr_env_0->pstr_sbr_bs_grid = &pstr_env_ch[0]->str_sbr_env_frame.sbr_grid;
 2215|       |
 2216|   994k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (2216:16): [True: 579k, False: 414k]
  ------------------
 2217|   579k|    memset(
 2218|   579k|        ptr_noise_floor[ch], 0,
 2219|   579k|        IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES * sizeof(ptr_noise_floor[0][0]));
  ------------------
  |  |   22|   579k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
                      IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_NUM_ENVELOPE_VALUES * sizeof(ptr_noise_floor[0][0]));
  ------------------
  |  |   94|   579k|#define MAXIMUM_NUM_ENVELOPE_VALUES (MAXIMUM_NUM_ENV_VALUES_USAC)
  |  |  ------------------
  |  |  |  |   78|   579k|#define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   579k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  |  |  ------------------
  |  |  |  |               #define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|   579k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2220|   579k|  }
 2221|       |
 2222|   414k|  switch (stereo_mode) {
  ------------------
  |  Branch (2222:11): [True: 414k, False: 0]
  ------------------
 2223|  68.1k|    case IXHEAACE_SBR_MODE_LEFT_RIGHT:
  ------------------
  |  Branch (2223:5): [True: 68.1k, False: 346k]
  ------------------
 2224|   165k|    case IXHEAACE_SBR_MODE_SWITCH_LRC:
  ------------------
  |  Branch (2224:5): [True: 97.0k, False: 317k]
  ------------------
 2225|       |
 2226|   165k|      err_code = ixheaace_frame_info_generator(
 2227|   165k|          &pstr_env_ch[1]->str_sbr_env_frame,
 2228|   165k|          pstr_env_ch[1]->str_sbr_extract_env.pre_transient_info, transient_info[1], ptr_v_tuning,
 2229|   165k|          ptr_sbr_tab->ptr_qmf_tab, pstr_env_ch[1]->str_sbr_qmf.num_time_slots,
 2230|   165k|          pstr_sbr_cfg->is_ld_sbr, &pstr_frame_info, flag_framelength_small);
 2231|       |
 2232|   165k|      if (pstr_sbr_cfg->is_ld_sbr && transient_info[1][2]) {
  ------------------
  |  Branch (2232:11): [True: 39.1k, False: 126k]
  |  Branch (2232:38): [True: 891, False: 38.2k]
  ------------------
 2233|    891|        pstr_frame_info->short_env = pstr_frame_info->n_envelopes;
 2234|    891|      }
 2235|   165k|      pstr_const_frame_info[1] = pstr_frame_info;
 2236|   165k|      if (err_code) {
  ------------------
  |  Branch (2236:11): [True: 0, False: 165k]
  ------------------
 2237|      0|        return err_code;
 2238|      0|      }
 2239|       |
 2240|   165k|      pstr_env_1->pstr_sbr_bs_grid = &pstr_env_ch[1]->str_sbr_env_frame.sbr_grid;
 2241|       |
 2242|   165k|      if (pstr_const_frame_info[0]->n_envelopes != pstr_const_frame_info[1]->n_envelopes) {
  ------------------
  |  Branch (2242:11): [True: 6.40k, False: 158k]
  ------------------
 2243|  6.40k|        stereo_mode = IXHEAACE_SBR_MODE_LEFT_RIGHT;
 2244|   158k|      } else {
 2245|   575k|        for (i = 0; i < pstr_const_frame_info[0]->n_envelopes + 1; i++) {
  ------------------
  |  Branch (2245:21): [True: 420k, False: 155k]
  ------------------
 2246|   420k|          if (pstr_const_frame_info[0]->borders[i] != pstr_const_frame_info[1]->borders[i]) {
  ------------------
  |  Branch (2246:15): [True: 3.54k, False: 416k]
  ------------------
 2247|  3.54k|            stereo_mode = IXHEAACE_SBR_MODE_LEFT_RIGHT;
 2248|  3.54k|            break;
 2249|  3.54k|          }
 2250|   420k|        }
 2251|       |
 2252|   426k|        for (i = 0; i < pstr_const_frame_info[0]->n_envelopes; i++) {
  ------------------
  |  Branch (2252:21): [True: 268k, False: 157k]
  ------------------
 2253|   268k|          if (pstr_const_frame_info[0]->freq_res[i] != pstr_const_frame_info[1]->freq_res[i]) {
  ------------------
  |  Branch (2253:15): [True: 1.03k, False: 267k]
  ------------------
 2254|  1.03k|            stereo_mode = IXHEAACE_SBR_MODE_LEFT_RIGHT;
 2255|  1.03k|            break;
 2256|  1.03k|          }
 2257|   268k|        }
 2258|       |
 2259|   158k|        if (pstr_const_frame_info[0]->short_env != pstr_const_frame_info[1]->short_env) {
  ------------------
  |  Branch (2259:13): [True: 1.14k, False: 157k]
  ------------------
 2260|  1.14k|          stereo_mode = IXHEAACE_SBR_MODE_LEFT_RIGHT;
 2261|  1.14k|        }
 2262|   158k|      }
 2263|   165k|      break;
 2264|      0|    case SBR_COUPLING:
  ------------------
  |  Branch (2264:5): [True: 0, False: 414k]
  ------------------
 2265|       |
 2266|      0|      pstr_const_frame_info[1] = pstr_const_frame_info[0];
 2267|       |
 2268|      0|      pstr_env_1->pstr_sbr_bs_grid = &pstr_env_ch[0]->str_sbr_env_frame.sbr_grid;
 2269|      0|      break;
 2270|   249k|    case IXHEAACE_SBR_MODE_MONO:
  ------------------
  |  Branch (2270:5): [True: 249k, False: 165k]
  ------------------
 2271|   249k|      break;
 2272|   414k|  }
 2273|       |
 2274|   994k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (2274:16): [True: 579k, False: 414k]
  ------------------
 2275|   579k|    ixheaace_str_sbr_extr_env *pstr_sbr_extract_env = &(pstr_env_ch[ch]->str_sbr_extract_env);
 2276|       |
 2277|   579k|    pstr_sbr_extract_env->pre_transient_info[0] = transient_info[ch][0];
 2278|   579k|    pstr_sbr_extract_env->pre_transient_info[1] = transient_info[ch][1];
 2279|   579k|    pstr_env_ch[ch]->enc_env_data.no_of_envelopes = n_envelopes[ch] =
 2280|   579k|        pstr_const_frame_info[ch]->n_envelopes;
 2281|       |
 2282|  1.56M|    for (i = 0; i < n_envelopes[ch]; i++) {
  ------------------
  |  Branch (2282:17): [True: 984k, False: 579k]
  ------------------
 2283|   984k|      pstr_env_ch[ch]->enc_env_data.no_scf_bands[i] =
 2284|   984k|          (pstr_const_frame_info[ch]->freq_res[i] == FREQ_RES_HIGH
  ------------------
  |  Branch (2284:12): [True: 633k, False: 350k]
  ------------------
 2285|   984k|               ? pstr_sbr_cfg->num_scf[FREQ_RES_HIGH]
 2286|   984k|               : pstr_sbr_cfg->num_scf[FREQ_RES_LOW]);
 2287|   984k|    }
 2288|       |
 2289|   579k|    if ((pstr_env_ch[ch]->enc_env_data.pstr_sbr_bs_grid->frame_type == IXHEAACE_FIXFIX) &&
  ------------------
  |  Branch (2289:9): [True: 393k, False: 186k]
  ------------------
 2290|   393k|        (n_envelopes[ch] == 1)) {
  ------------------
  |  Branch (2290:9): [True: 366k, False: 26.3k]
  ------------------
 2291|   366k|      if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (2291:11): [True: 72.6k, False: 294k]
  ------------------
 2292|  72.6k|        pstr_env_ch[ch]->enc_env_data.curr_sbr_amp_res = IXHEAACE_SBR_AMP_RES_3_0;
 2293|   294k|      } else {
 2294|   294k|        pstr_env_ch[ch]->enc_env_data.curr_sbr_amp_res = IXHEAACE_SBR_AMP_RES_1_5;
 2295|   294k|      }
 2296|   366k|      if (pstr_env_ch[ch]->enc_env_data.init_sbr_amp_res !=
  ------------------
  |  Branch (2296:11): [True: 29.6k, False: 337k]
  ------------------
 2297|   366k|          pstr_env_ch[ch]->enc_env_data.curr_sbr_amp_res) {
 2298|  29.6k|        err_code = ixheaace_init_sbr_huffman_tabs(
 2299|  29.6k|            &pstr_env_ch[ch]->enc_env_data, &pstr_env_ch[ch]->str_sbr_code_env,
 2300|  29.6k|            &pstr_env_ch[ch]->str_sbr_code_noise_floor, IXHEAACE_SBR_AMP_RES_1_5,
 2301|  29.6k|            ptr_sbr_tab->ptr_sbr_huff_tab);
 2302|  29.6k|        if (err_code) {
  ------------------
  |  Branch (2302:13): [True: 0, False: 29.6k]
  ------------------
 2303|      0|          return err_code;
 2304|      0|        }
 2305|  29.6k|        pstr_env_ch[ch]->sbr_amp_res_init = IXHEAACE_SBR_AMP_RES_1_5;
 2306|  29.6k|      }
 2307|   366k|    } else {
 2308|   213k|      if (pstr_sbr_hdr->sbr_amp_res != pstr_env_ch[ch]->enc_env_data.init_sbr_amp_res) {
  ------------------
  |  Branch (2308:11): [True: 26.5k, False: 186k]
  ------------------
 2309|  26.5k|        err_code = ixheaace_init_sbr_huffman_tabs(
 2310|  26.5k|            &pstr_env_ch[ch]->enc_env_data, &pstr_env_ch[ch]->str_sbr_code_env,
 2311|  26.5k|            &pstr_env_ch[ch]->str_sbr_code_noise_floor, pstr_sbr_hdr->sbr_amp_res,
 2312|  26.5k|            ptr_sbr_tab->ptr_sbr_huff_tab);
 2313|  26.5k|        if (err_code) {
  ------------------
  |  Branch (2313:13): [True: 0, False: 26.5k]
  ------------------
 2314|      0|          return err_code;
 2315|      0|        }
 2316|  26.5k|        pstr_env_ch[ch]->sbr_amp_res_init = pstr_sbr_hdr->sbr_amp_res;
 2317|  26.5k|      }
 2318|   213k|    }
 2319|       |
 2320|   579k|    ixheaace_ton_corr_param_extr(
 2321|   579k|        &pstr_env_ch[ch]->str_ton_corr, pstr_env_ch[ch]->enc_env_data.sbr_invf_mode_vec,
 2322|   579k|        ptr_noise_floor[ch], &pstr_env_ch[ch]->enc_env_data.add_harmonic_flag,
 2323|   579k|        pstr_env_ch[ch]->enc_env_data.add_harmonic, pstr_sbr_extract_env->envelope_compensation,
 2324|   579k|        pstr_const_frame_info[ch], transient_info[ch], pstr_sbr_cfg->ptr_freq_band_tab[HI],
  ------------------
  |  |  101|   579k|#define HI (1)
  ------------------
 2325|   579k|        pstr_sbr_cfg->num_scf[HI], pstr_env_ch[ch]->enc_env_data.sbr_xpos_mode, ptr_sbr_scratch,
  ------------------
  |  |  101|   579k|#define HI (1)
  ------------------
 2326|   579k|        pstr_sbr_cfg->is_ld_sbr);
 2327|       |
 2328|   579k|    pstr_env_ch[ch]->enc_env_data.sbr_invf_mode =
 2329|   579k|        pstr_env_ch[ch]->enc_env_data.sbr_invf_mode_vec[0];
 2330|   579k|    pstr_env_ch[ch]->enc_env_data.noise_band_count =
 2331|   579k|        pstr_env_ch[ch]->str_ton_corr.sbr_noise_floor_est.num_of_noise_bands;
 2332|   579k|  }
 2333|       |
 2334|   414k|  switch (stereo_mode) {
  ------------------
  |  Branch (2334:11): [True: 414k, False: 0]
  ------------------
 2335|   249k|    case IXHEAACE_SBR_MODE_MONO:
  ------------------
  |  Branch (2335:5): [True: 249k, False: 165k]
  ------------------
 2336|   249k|      err_code = ixheaace_calculate_sbr_envelope(pstr_env_ch[0]->str_sbr_extract_env.ptr_y_buffer,
 2337|   249k|                                                 NULL, pstr_const_frame_info[0],
 2338|   249k|                                                 ptr_scale_factor_band_nrg[0], NULL, pstr_sbr_cfg,
 2339|   249k|                                                 pstr_env_ch[0], IXHEAACE_SBR_MODE_MONO, NULL);
 2340|       |
 2341|   249k|      if (err_code) {
  ------------------
  |  Branch (2341:11): [True: 0, False: 249k]
  ------------------
 2342|      0|        return err_code;
 2343|      0|      }
 2344|   249k|      break;
 2345|       |
 2346|   249k|    case IXHEAACE_SBR_MODE_LEFT_RIGHT:
  ------------------
  |  Branch (2346:5): [True: 72.7k, False: 341k]
  ------------------
 2347|       |
 2348|  72.7k|      err_code = ixheaace_calculate_sbr_envelope(pstr_env_ch[0]->str_sbr_extract_env.ptr_y_buffer,
 2349|  72.7k|                                                 NULL, pstr_const_frame_info[0],
 2350|  72.7k|                                                 ptr_scale_factor_band_nrg[0], NULL, pstr_sbr_cfg,
 2351|  72.7k|                                                 pstr_env_ch[0], IXHEAACE_SBR_MODE_MONO, NULL);
 2352|  72.7k|      if (err_code) {
  ------------------
  |  Branch (2352:11): [True: 0, False: 72.7k]
  ------------------
 2353|      0|        return err_code;
 2354|      0|      }
 2355|       |
 2356|  72.7k|      err_code = ixheaace_calculate_sbr_envelope(pstr_env_ch[1]->str_sbr_extract_env.ptr_y_buffer,
 2357|  72.7k|                                                 NULL, pstr_const_frame_info[1],
 2358|  72.7k|                                                 ptr_scale_factor_band_nrg[1], NULL, pstr_sbr_cfg,
 2359|  72.7k|                                                 pstr_env_ch[1], IXHEAACE_SBR_MODE_MONO, NULL);
 2360|       |
 2361|  72.7k|      if (err_code) {
  ------------------
  |  Branch (2361:11): [True: 0, False: 72.7k]
  ------------------
 2362|      0|        return err_code;
 2363|      0|      }
 2364|       |
 2365|  72.7k|      break;
 2366|       |
 2367|  72.7k|    case SBR_COUPLING:
  ------------------
  |  Branch (2367:5): [True: 0, False: 414k]
  ------------------
 2368|       |
 2369|      0|      err_code = ixheaace_calculate_sbr_envelope(
 2370|      0|          pstr_env_ch[0]->str_sbr_extract_env.ptr_y_buffer,
 2371|      0|          pstr_env_ch[1]->str_sbr_extract_env.ptr_y_buffer, pstr_const_frame_info[0],
 2372|      0|          ptr_scale_factor_band_nrg[0], ptr_scale_factor_band_nrg[1], pstr_sbr_cfg,
 2373|      0|          pstr_env_ch[0], SBR_COUPLING, &max_quant_error);
 2374|      0|      if (err_code) {
  ------------------
  |  Branch (2374:11): [True: 0, False: 0]
  ------------------
 2375|      0|        return err_code;
 2376|      0|      }
 2377|      0|      break;
 2378|       |
 2379|  92.4k|    case IXHEAACE_SBR_MODE_SWITCH_LRC:
  ------------------
  |  Branch (2379:5): [True: 92.4k, False: 322k]
  ------------------
 2380|  92.4k|      err_code = ixheaace_calculate_sbr_envelope(pstr_env_ch[0]->str_sbr_extract_env.ptr_y_buffer,
 2381|  92.4k|                                                 NULL, pstr_const_frame_info[0],
 2382|  92.4k|                                                 ptr_scale_factor_band_nrg[0], NULL, pstr_sbr_cfg,
 2383|  92.4k|                                                 pstr_env_ch[0], IXHEAACE_SBR_MODE_MONO, NULL);
 2384|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2384:11): [True: 0, False: 92.4k]
  ------------------
 2385|      0|        return err_code;
 2386|      0|      }
 2387|       |
 2388|  92.4k|      err_code = ixheaace_calculate_sbr_envelope(pstr_env_ch[1]->str_sbr_extract_env.ptr_y_buffer,
 2389|  92.4k|                                                 NULL, pstr_const_frame_info[1],
 2390|  92.4k|                                                 ptr_scale_factor_band_nrg[1], NULL, pstr_sbr_cfg,
 2391|  92.4k|                                                 pstr_env_ch[1], IXHEAACE_SBR_MODE_MONO, NULL);
 2392|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2392:11): [True: 0, False: 92.4k]
  ------------------
 2393|      0|        return err_code;
 2394|      0|      }
 2395|       |
 2396|  92.4k|      err_code = ixheaace_calculate_sbr_envelope(
 2397|  92.4k|          pstr_env_ch[0]->str_sbr_extract_env.ptr_y_buffer,
 2398|  92.4k|          pstr_env_ch[1]->str_sbr_extract_env.ptr_y_buffer, pstr_const_frame_info[0],
 2399|  92.4k|          ptr_sfb_nrg_coupling[0], ptr_sfb_nrg_coupling[1], pstr_sbr_cfg, pstr_env_ch[0],
 2400|  92.4k|          SBR_COUPLING, &max_quant_error);
 2401|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2401:11): [True: 0, False: 92.4k]
  ------------------
 2402|      0|        return err_code;
 2403|      0|      }
 2404|  92.4k|      break;
 2405|   414k|  }
 2406|       |
 2407|   414k|  switch (stereo_mode) {
  ------------------
  |  Branch (2407:11): [True: 414k, False: 0]
  ------------------
 2408|   249k|    case IXHEAACE_SBR_MODE_MONO:
  ------------------
  |  Branch (2408:5): [True: 249k, False: 165k]
  ------------------
 2409|       |
 2410|   249k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[0], ptr_noise_floor[0], 0);
 2411|       |
 2412|   249k|      err_code = ixheaace_code_envelope(
 2413|   249k|          ptr_noise_level[0], res, &pstr_env_ch[0]->str_sbr_code_noise_floor,
 2414|   249k|          pstr_env_0->domain_vec_noise, 0, (pstr_const_frame_info[0]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2414:45): [True: 86.6k, False: 162k]
  ------------------
 2415|   249k|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2416|   249k|      if (err_code) {
  ------------------
  |  Branch (2416:11): [True: 0, False: 249k]
  ------------------
 2417|      0|        return err_code;
 2418|      0|      }
 2419|       |
 2420|   249k|      break;
 2421|       |
 2422|   249k|    case IXHEAACE_SBR_MODE_LEFT_RIGHT:
  ------------------
  |  Branch (2422:5): [True: 72.7k, False: 341k]
  ------------------
 2423|       |      // We have a error checks for Number of channels to ensure memory is assigned to
 2424|       |      // ptr_noise_floor[]. However, MSVS static analysis is marking this as a potential error.
 2425|       |      // So, suppressed this in source
 2426|  72.7k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[0], ptr_noise_floor[0], 0);
 2427|       |
 2428|  72.7k|      err_code = ixheaace_code_envelope(
 2429|  72.7k|          ptr_noise_level[0], res, &pstr_env_ch[0]->str_sbr_code_noise_floor,
 2430|  72.7k|          pstr_env_0->domain_vec_noise, 0, (pstr_const_frame_info[0]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2430:45): [True: 26.8k, False: 45.9k]
  ------------------
 2431|  72.7k|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2432|  72.7k|      if (err_code) {
  ------------------
  |  Branch (2432:11): [True: 0, False: 72.7k]
  ------------------
 2433|      0|        return err_code;
 2434|      0|      }
 2435|       |
 2436|  72.7k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[1], ptr_noise_floor[1], 0);
 2437|       |
 2438|  72.7k|      err_code = ixheaace_code_envelope(
 2439|  72.7k|          ptr_noise_level[1], res, &pstr_env_ch[1]->str_sbr_code_noise_floor,
 2440|  72.7k|          pstr_env_1->domain_vec_noise, 0, (pstr_const_frame_info[1]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2440:45): [True: 26.7k, False: 45.9k]
  ------------------
 2441|  72.7k|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2442|  72.7k|      if (err_code) {
  ------------------
  |  Branch (2442:11): [True: 0, False: 72.7k]
  ------------------
 2443|      0|        return err_code;
 2444|      0|      }
 2445|       |
 2446|  72.7k|      break;
 2447|       |
 2448|  72.7k|    case SBR_COUPLING:
  ------------------
  |  Branch (2448:5): [True: 0, False: 414k]
  ------------------
 2449|      0|      ixheaace_couple_noise_floor(ptr_noise_floor[0], ptr_noise_floor[1]);
 2450|       |
 2451|      0|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[0], ptr_noise_floor[0], 0);
 2452|       |
 2453|      0|      err_code = ixheaace_code_envelope(
 2454|      0|          ptr_noise_level[0], res, &pstr_env_ch[0]->str_sbr_code_noise_floor,
 2455|      0|          pstr_env_0->domain_vec_noise, 1, (pstr_const_frame_info[0]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2455:45): [True: 0, False: 0]
  ------------------
 2456|      0|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2457|      0|      if (err_code) {
  ------------------
  |  Branch (2457:11): [True: 0, False: 0]
  ------------------
 2458|      0|        return err_code;
 2459|      0|      }
 2460|       |
 2461|      0|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[1], ptr_noise_floor[1], 1);
 2462|       |
 2463|      0|      err_code = ixheaace_code_envelope(
 2464|      0|          ptr_noise_level[1], res, &pstr_env_ch[1]->str_sbr_code_noise_floor,
 2465|      0|          pstr_env_1->domain_vec_noise, 1, (pstr_const_frame_info[1]->n_envelopes > 1 ? 2 : 1), 1,
  ------------------
  |  Branch (2465:45): [True: 0, False: 0]
  ------------------
 2466|      0|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2467|      0|      if (err_code) {
  ------------------
  |  Branch (2467:11): [True: 0, False: 0]
  ------------------
 2468|      0|        return err_code;
 2469|      0|      }
 2470|       |
 2471|      0|      break;
 2472|       |
 2473|  92.4k|    case IXHEAACE_SBR_MODE_SWITCH_LRC:
  ------------------
  |  Branch (2473:5): [True: 92.4k, False: 322k]
  ------------------
 2474|       |
 2475|  92.4k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[0], ptr_noise_floor[0], 0);
 2476|       |
 2477|  92.4k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_level[1], ptr_noise_floor[1], 0);
 2478|       |
 2479|  92.4k|      ixheaace_couple_noise_floor(ptr_noise_floor[0], ptr_noise_floor[1]);
 2480|       |
 2481|  92.4k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_lvl_coupling[0], ptr_noise_floor[0],
 2482|  92.4k|                                                   0);
 2483|       |
 2484|  92.4k|      ixheaace_sbr_noise_floor_levels_quantisation(ptr_noise_lvl_coupling[1], ptr_noise_floor[1],
 2485|  92.4k|                                                   1);
 2486|  92.4k|      break;
 2487|   414k|  }
 2488|       |
 2489|   414k|  switch (stereo_mode) {
  ------------------
  |  Branch (2489:11): [True: 414k, False: 0]
  ------------------
 2490|   249k|    case IXHEAACE_SBR_MODE_MONO:
  ------------------
  |  Branch (2490:5): [True: 249k, False: 165k]
  ------------------
 2491|       |
 2492|   249k|      pstr_sbr_hdr->coupling = 0;
 2493|   249k|      pstr_env_0->balance = 0;
 2494|       |
 2495|   249k|      err_code = ixheaace_code_envelope(
 2496|   249k|          ptr_scale_factor_band_nrg[0], pstr_const_frame_info[0]->freq_res,
 2497|   249k|          &pstr_env_ch[0]->str_sbr_code_env, pstr_env_0->domain_vec, pstr_sbr_hdr->coupling,
 2498|   249k|          pstr_const_frame_info[0]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2499|   249k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2500|   249k|      if (err_code) {
  ------------------
  |  Branch (2500:11): [True: 0, False: 249k]
  ------------------
 2501|      0|        return err_code;
 2502|      0|      }
 2503|   249k|      break;
 2504|       |
 2505|   249k|    case IXHEAACE_SBR_MODE_LEFT_RIGHT:
  ------------------
  |  Branch (2505:5): [True: 72.7k, False: 341k]
  ------------------
 2506|       |
 2507|  72.7k|      pstr_sbr_hdr->coupling = 0;
 2508|       |
 2509|  72.7k|      pstr_env_0->balance = 0;
 2510|  72.7k|      pstr_env_1->balance = 0;
 2511|       |
 2512|  72.7k|      err_code = ixheaace_code_envelope(
 2513|  72.7k|          ptr_scale_factor_band_nrg[0], pstr_const_frame_info[0]->freq_res,
 2514|  72.7k|          &pstr_env_ch[0]->str_sbr_code_env, pstr_env_0->domain_vec, pstr_sbr_hdr->coupling,
 2515|  72.7k|          pstr_const_frame_info[0]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2516|  72.7k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2517|  72.7k|      if (err_code) {
  ------------------
  |  Branch (2517:11): [True: 0, False: 72.7k]
  ------------------
 2518|      0|        return err_code;
 2519|      0|      }
 2520|       |
 2521|  72.7k|      err_code = ixheaace_code_envelope(
 2522|  72.7k|          ptr_scale_factor_band_nrg[1], pstr_const_frame_info[1]->freq_res,
 2523|  72.7k|          &pstr_env_ch[1]->str_sbr_code_env, pstr_env_1->domain_vec, pstr_sbr_hdr->coupling,
 2524|  72.7k|          pstr_const_frame_info[1]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2525|  72.7k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2526|  72.7k|      if (err_code) {
  ------------------
  |  Branch (2526:11): [True: 0, False: 72.7k]
  ------------------
 2527|      0|        return err_code;
 2528|      0|      }
 2529|  72.7k|      break;
 2530|       |
 2531|  72.7k|    case SBR_COUPLING:
  ------------------
  |  Branch (2531:5): [True: 0, False: 414k]
  ------------------
 2532|       |
 2533|      0|      pstr_sbr_hdr->coupling = 1;
 2534|      0|      pstr_env_0->balance = 0;
 2535|      0|      pstr_env_1->balance = 1;
 2536|       |
 2537|      0|      err_code = ixheaace_code_envelope(
 2538|      0|          ptr_scale_factor_band_nrg[0], pstr_const_frame_info[0]->freq_res,
 2539|      0|          &pstr_env_ch[0]->str_sbr_code_env, pstr_env_0->domain_vec, pstr_sbr_hdr->coupling,
 2540|      0|          pstr_const_frame_info[0]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2541|      0|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2542|      0|      if (err_code) {
  ------------------
  |  Branch (2542:11): [True: 0, False: 0]
  ------------------
 2543|      0|        return err_code;
 2544|      0|      }
 2545|       |
 2546|      0|      err_code = ixheaace_code_envelope(
 2547|      0|          ptr_scale_factor_band_nrg[1], pstr_const_frame_info[1]->freq_res,
 2548|      0|          &pstr_env_ch[1]->str_sbr_code_env, pstr_env_1->domain_vec, pstr_sbr_hdr->coupling,
 2549|      0|          pstr_const_frame_info[1]->n_envelopes, 1, pstr_sbr_bs->header_active,
 2550|      0|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2551|      0|      if (err_code) {
  ------------------
  |  Branch (2551:11): [True: 0, False: 0]
  ------------------
 2552|      0|        return err_code;
 2553|      0|      }
 2554|      0|      break;
 2555|       |
 2556|  92.4k|    case IXHEAACE_SBR_MODE_SWITCH_LRC: {
  ------------------
  |  Branch (2556:5): [True: 92.4k, False: 322k]
  ------------------
 2557|  92.4k|      WORD32 payloadbits_lr;
 2558|  92.4k|      WORD32 payloadbits_coupling;
 2559|       |
 2560|  92.4k|      WORD32 scale_factor_band_nrg_prev_temp[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_FREQ_COEFFS];
 2561|  92.4k|      WORD32 noise_prev_temp[IXHEAACE_MAX_CH_IN_BS_ELE][MAXIMUM_NUM_NOISE_COEFFS];
 2562|  92.4k|      WORD32 up_date_nrg_temp[IXHEAACE_MAX_CH_IN_BS_ELE];
 2563|  92.4k|      WORD32 up_date_noise_temp[IXHEAACE_MAX_CH_IN_BS_ELE];
 2564|  92.4k|      WORD32 domain_vec_temp[IXHEAACE_MAX_CH_IN_BS_ELE][IXHEAACE_MAX_ENV];
 2565|  92.4k|      WORD32 domain_vec_noise_temp[IXHEAACE_MAX_CH_IN_BS_ELE][IXHEAACE_MAX_ENV];
 2566|       |
 2567|  92.4k|      WORD32 temp_flag_right = 0;
 2568|  92.4k|      WORD32 temp_flag_left = 0;
 2569|       |
 2570|  92.4k|      ch = 0;
 2571|   277k|      while (ch < num_channels) {
  ------------------
  |  Branch (2571:14): [True: 184k, False: 92.4k]
  ------------------
 2572|   184k|        memcpy(scale_factor_band_nrg_prev_temp[ch],
 2573|   184k|               pstr_env_ch[ch]->str_sbr_code_env.sfb_nrg_prev,
 2574|   184k|               MAXIMUM_FREQ_COEFFS * sizeof(scale_factor_band_nrg_prev_temp[0][0]));
  ------------------
  |  |   83|   184k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|   184k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
 2575|       |
 2576|   184k|        memcpy(noise_prev_temp[ch], pstr_env_ch[ch]->str_sbr_code_noise_floor.sfb_nrg_prev,
 2577|   184k|               MAXIMUM_NUM_NOISE_COEFFS * sizeof(noise_prev_temp[0][0]));
  ------------------
  |  |   57|   184k|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  ------------------
 2578|       |
 2579|   184k|        up_date_nrg_temp[ch] = pstr_env_ch[ch]->str_sbr_code_env.update;
 2580|   184k|        up_date_noise_temp[ch] = pstr_env_ch[ch]->str_sbr_code_noise_floor.update;
 2581|       |
 2582|   184k|        if (pstr_sbr_hdr->prev_coupling) {
  ------------------
  |  Branch (2582:13): [True: 177k, False: 7.38k]
  ------------------
 2583|   177k|          pstr_env_ch[ch]->str_sbr_code_env.update = 0;
 2584|   177k|          pstr_env_ch[ch]->str_sbr_code_noise_floor.update = 0;
 2585|   177k|        }
 2586|   184k|        ch++;
 2587|   184k|      }
 2588|       |
 2589|  92.4k|      err_code = ixheaace_code_envelope(
 2590|  92.4k|          ptr_scale_factor_band_nrg[0], pstr_const_frame_info[0]->freq_res,
 2591|  92.4k|          &pstr_env_ch[0]->str_sbr_code_env, pstr_env_0->domain_vec, 0,
 2592|  92.4k|          pstr_const_frame_info[0]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2593|  92.4k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2594|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2594:11): [True: 0, False: 92.4k]
  ------------------
 2595|      0|        return err_code;
 2596|      0|      }
 2597|       |
 2598|  92.4k|      err_code = ixheaace_code_envelope(
 2599|  92.4k|          ptr_scale_factor_band_nrg[1], pstr_const_frame_info[1]->freq_res,
 2600|  92.4k|          &pstr_env_ch[1]->str_sbr_code_env, pstr_env_1->domain_vec, 0,
 2601|  92.4k|          pstr_const_frame_info[1]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2602|  92.4k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2603|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2603:11): [True: 0, False: 92.4k]
  ------------------
 2604|      0|        return err_code;
 2605|      0|      }
 2606|       |
 2607|  92.4k|      c = 0;
 2608|  92.4k|      i = 0;
 2609|   256k|      while (i < n_envelopes[0]) {
  ------------------
  |  Branch (2609:14): [True: 164k, False: 92.4k]
  ------------------
 2610|  1.69M|        for (j = 0; j < pstr_env_0->no_scf_bands[i]; j++) {
  ------------------
  |  Branch (2610:21): [True: 1.52M, False: 164k]
  ------------------
 2611|  1.52M|          pstr_env_0->ienvelope[i][j] = ptr_scale_factor_band_nrg[0][c];
 2612|  1.52M|          pstr_env_1->ienvelope[i][j] = ptr_scale_factor_band_nrg[1][c];
 2613|       |
 2614|  1.52M|          c++;
 2615|  1.52M|        }
 2616|   164k|        i++;
 2617|   164k|      }
 2618|       |
 2619|  92.4k|      err_code = ixheaace_code_envelope(
 2620|  92.4k|          ptr_noise_level[0], res, &pstr_env_ch[0]->str_sbr_code_noise_floor,
 2621|  92.4k|          pstr_env_0->domain_vec_noise, 0, (pstr_const_frame_info[0]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2621:45): [True: 36.4k, False: 55.9k]
  ------------------
 2622|  92.4k|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2623|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2623:11): [True: 0, False: 92.4k]
  ------------------
 2624|      0|        return err_code;
 2625|      0|      }
 2626|       |
 2627|  92.4k|      i = 0;
 2628|  1.01M|      while (i < MAXIMUM_NUM_NOISE_VALUES) {
  ------------------
  |  |   58|  1.01M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  1.01M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  1.01M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (2628:14): [True: 924k, False: 92.4k]
  ------------------
 2629|   924k|        pstr_env_0->noise_level[i] = ptr_noise_level[0][i];
 2630|   924k|        i++;
 2631|   924k|      }
 2632|       |
 2633|  92.4k|      err_code = ixheaace_code_envelope(
 2634|  92.4k|          ptr_noise_level[1], res, &pstr_env_ch[1]->str_sbr_code_noise_floor,
 2635|  92.4k|          pstr_env_1->domain_vec_noise, 0, (pstr_const_frame_info[1]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2635:45): [True: 36.4k, False: 55.9k]
  ------------------
 2636|  92.4k|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2637|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2637:11): [True: 0, False: 92.4k]
  ------------------
 2638|      0|        return err_code;
 2639|      0|      }
 2640|       |
 2641|  92.4k|      i = 0;
 2642|  1.01M|      while (i < MAXIMUM_NUM_NOISE_VALUES) {
  ------------------
  |  |   58|  1.01M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  1.01M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  1.01M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (2642:14): [True: 924k, False: 92.4k]
  ------------------
 2643|   924k|        pstr_env_1->noise_level[i] = ptr_noise_level[1][i];
 2644|   924k|        i++;
 2645|   924k|      }
 2646|       |
 2647|  92.4k|      pstr_sbr_hdr->coupling = 0;
 2648|  92.4k|      pstr_env_0->balance = 0;
 2649|  92.4k|      pstr_env_1->balance = 0;
 2650|       |
 2651|  92.4k|      err_code = ixheaace_count_sbr_channel_pair_element(
 2652|  92.4k|          pstr_sbr_hdr, pstr_sbr_bs, &pstr_env_ch[0]->enc_env_data, &pstr_env_ch[1]->enc_env_data,
 2653|  92.4k|          pstr_com_data, ptr_sbr_tab, pstr_sbr_cfg->sbr_codec, pstr_sbr_cfg->is_esbr, &str_esbr,
 2654|  92.4k|          &payloadbits_lr);
 2655|  92.4k|      if (err_code) {
  ------------------
  |  Branch (2655:11): [True: 295, False: 92.1k]
  ------------------
 2656|    295|        return err_code;
 2657|    295|      }
 2658|       |
 2659|   276k|      for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (2659:20): [True: 184k, False: 92.1k]
  ------------------
 2660|   184k|        WORD32 itmp;
 2661|       |
 2662|  10.5M|        for (i = 0; i < MAXIMUM_FREQ_COEFFS; i++) {
  ------------------
  |  |   83|  10.5M|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  10.5M|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  |  Branch (2662:21): [True: 10.3M, False: 184k]
  ------------------
 2663|  10.3M|          itmp = pstr_env_ch[ch]->str_sbr_code_env.sfb_nrg_prev[i];
 2664|  10.3M|          pstr_env_ch[ch]->str_sbr_code_env.sfb_nrg_prev[i] =
 2665|  10.3M|              scale_factor_band_nrg_prev_temp[ch][i];
 2666|  10.3M|          scale_factor_band_nrg_prev_temp[ch][i] = itmp;
 2667|  10.3M|        }
 2668|       |
 2669|  1.10M|        for (i = 0; i < MAXIMUM_NUM_NOISE_COEFFS; i++) {
  ------------------
  |  |   57|  1.10M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  ------------------
  |  Branch (2669:21): [True: 921k, False: 184k]
  ------------------
 2670|   921k|          itmp = pstr_env_ch[ch]->str_sbr_code_noise_floor.sfb_nrg_prev[i];
 2671|   921k|          pstr_env_ch[ch]->str_sbr_code_noise_floor.sfb_nrg_prev[i] = noise_prev_temp[ch][i];
 2672|   921k|          noise_prev_temp[ch][i] = itmp;
 2673|   921k|        }
 2674|       |
 2675|   184k|        itmp = pstr_env_ch[ch]->str_sbr_code_env.update;
 2676|   184k|        pstr_env_ch[ch]->str_sbr_code_env.update = up_date_nrg_temp[ch];
 2677|   184k|        up_date_nrg_temp[ch] = itmp;
 2678|       |
 2679|   184k|        itmp = pstr_env_ch[ch]->str_sbr_code_noise_floor.update;
 2680|   184k|        pstr_env_ch[ch]->str_sbr_code_noise_floor.update = up_date_noise_temp[ch];
 2681|   184k|        up_date_noise_temp[ch] = itmp;
 2682|       |
 2683|   184k|        memcpy(domain_vec_temp[ch], pstr_env_ch[ch]->enc_env_data.domain_vec,
 2684|   184k|               sizeof(domain_vec_temp[0][0]) * IXHEAACE_MAX_ENV);
  ------------------
  |  |   88|   184k|#define IXHEAACE_MAX_ENV (MAXIMUM_ENVELOPES_USAC)
  |  |  ------------------
  |  |  |  |   77|   184k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  ------------------
  ------------------
 2685|       |
 2686|   184k|        memcpy(domain_vec_noise_temp[ch], pstr_env_ch[ch]->enc_env_data.domain_vec_noise,
 2687|   184k|               sizeof(domain_vec_noise_temp[0][0]) * IXHEAACE_MAX_ENV);
  ------------------
  |  |   88|   184k|#define IXHEAACE_MAX_ENV (MAXIMUM_ENVELOPES_USAC)
  |  |  ------------------
  |  |  |  |   77|   184k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  ------------------
  ------------------
 2688|       |
 2689|   184k|        if (!pstr_sbr_hdr->prev_coupling) {
  ------------------
  |  Branch (2689:13): [True: 7.37k, False: 176k]
  ------------------
 2690|  7.37k|          pstr_env_ch[ch]->str_sbr_code_env.update = 0;
 2691|  7.37k|          pstr_env_ch[ch]->str_sbr_code_noise_floor.update = 0;
 2692|  7.37k|        }
 2693|   184k|      }
 2694|       |
 2695|  92.1k|      err_code = ixheaace_code_envelope(
 2696|  92.1k|          ptr_sfb_nrg_coupling[0], pstr_const_frame_info[0]->freq_res,
 2697|  92.1k|          &pstr_env_ch[0]->str_sbr_code_env, pstr_env_0->domain_vec, 1,
 2698|  92.1k|          pstr_const_frame_info[0]->n_envelopes, 0, pstr_sbr_bs->header_active,
 2699|  92.1k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2700|  92.1k|      if (err_code) {
  ------------------
  |  Branch (2700:11): [True: 573, False: 91.5k]
  ------------------
 2701|    573|        return err_code;
 2702|    573|      }
 2703|       |
 2704|  91.5k|      err_code = ixheaace_code_envelope(
 2705|  91.5k|          ptr_sfb_nrg_coupling[1], pstr_const_frame_info[1]->freq_res,
 2706|  91.5k|          &pstr_env_ch[1]->str_sbr_code_env, pstr_env_1->domain_vec, 1,
 2707|  91.5k|          pstr_const_frame_info[1]->n_envelopes, 1, pstr_sbr_bs->header_active,
 2708|  91.5k|          pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2709|  91.5k|      if (err_code) {
  ------------------
  |  Branch (2709:11): [True: 496, False: 91.0k]
  ------------------
 2710|    496|        return err_code;
 2711|    496|      }
 2712|       |
 2713|  91.0k|      c = 0;
 2714|  91.0k|      i = 0;
 2715|   251k|      while (i < n_envelopes[0]) {
  ------------------
  |  Branch (2715:14): [True: 160k, False: 91.0k]
  ------------------
 2716|  1.65M|        for (j = 0; j < pstr_env_0->no_scf_bands[i]; j++) {
  ------------------
  |  Branch (2716:21): [True: 1.49M, False: 160k]
  ------------------
 2717|  1.49M|          pstr_env_0->ienvelope[i][j] = ptr_sfb_nrg_coupling[0][c];
 2718|  1.49M|          pstr_env_1->ienvelope[i][j] = ptr_sfb_nrg_coupling[1][c];
 2719|  1.49M|          c++;
 2720|  1.49M|        }
 2721|   160k|        i++;
 2722|   160k|      }
 2723|       |
 2724|  91.0k|      err_code = ixheaace_code_envelope(
 2725|  91.0k|          ptr_noise_lvl_coupling[0], res, &pstr_env_ch[0]->str_sbr_code_noise_floor,
 2726|  91.0k|          pstr_env_0->domain_vec_noise, 1, (pstr_const_frame_info[0]->n_envelopes > 1 ? 2 : 1), 0,
  ------------------
  |  Branch (2726:45): [True: 35.1k, False: 55.9k]
  ------------------
 2727|  91.0k|          pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2728|  91.0k|      if (err_code) {
  ------------------
  |  Branch (2728:11): [True: 0, False: 91.0k]
  ------------------
 2729|      0|        return err_code;
 2730|      0|      }
 2731|       |
 2732|  1.00M|      for (i = 0; i < MAXIMUM_NUM_NOISE_VALUES; i++) {
  ------------------
  |  |   58|  1.00M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  1.00M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  1.00M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (2732:19): [True: 910k, False: 91.0k]
  ------------------
 2733|   910k|        pstr_env_0->noise_level[i] = ptr_noise_lvl_coupling[0][i];
 2734|   910k|      }
 2735|       |
 2736|  91.0k|      err_code = ixheaace_code_envelope(
 2737|  91.0k|          ptr_noise_lvl_coupling[1], res, &pstr_env_ch[1]->str_sbr_code_noise_floor,
 2738|  91.0k|          pstr_env_1->domain_vec_noise, 1, ((pstr_const_frame_info[1]->n_envelopes > 1) ? 2 : 1),
  ------------------
  |  Branch (2738:45): [True: 35.1k, False: 55.9k]
  ------------------
 2739|  91.0k|          1, pstr_sbr_bs->header_active, pstr_sbr_bs->usac_indep_flag, pstr_sbr_cfg->is_ld_sbr);
 2740|  91.0k|      if (err_code) {
  ------------------
  |  Branch (2740:11): [True: 0, False: 91.0k]
  ------------------
 2741|      0|        return err_code;
 2742|      0|      }
 2743|       |
 2744|  1.00M|      for (i = 0; i < MAXIMUM_NUM_NOISE_VALUES; i++) {
  ------------------
  |  |   58|  1.00M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  1.00M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  1.00M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (2744:19): [True: 910k, False: 91.0k]
  ------------------
 2745|   910k|        pstr_env_1->noise_level[i] = ptr_noise_lvl_coupling[1][i];
 2746|   910k|      }
 2747|       |
 2748|  91.0k|      pstr_sbr_hdr->coupling = 1;
 2749|       |
 2750|  91.0k|      pstr_env_0->balance = 0;
 2751|  91.0k|      pstr_env_1->balance = 1;
 2752|       |
 2753|  91.0k|      temp_flag_left = pstr_env_0->add_harmonic_flag;
 2754|  91.0k|      temp_flag_right = pstr_env_1->add_harmonic_flag;
 2755|       |
 2756|  91.0k|      err_code = ixheaace_count_sbr_channel_pair_element(
 2757|  91.0k|          pstr_sbr_hdr, pstr_sbr_bs, &pstr_env_ch[0]->enc_env_data, &pstr_env_ch[1]->enc_env_data,
 2758|  91.0k|          pstr_com_data, ptr_sbr_tab, pstr_sbr_cfg->sbr_codec, pstr_sbr_cfg->is_esbr, &str_esbr,
 2759|  91.0k|          &payloadbits_coupling);
 2760|  91.0k|      if (err_code) {
  ------------------
  |  Branch (2760:11): [True: 0, False: 91.0k]
  ------------------
 2761|      0|        return err_code;
 2762|      0|      }
 2763|       |
 2764|  91.0k|      pstr_env_0->add_harmonic_flag = temp_flag_left;
 2765|  91.0k|      pstr_env_1->add_harmonic_flag = temp_flag_right;
 2766|       |
 2767|  91.0k|      if (payloadbits_coupling < payloadbits_lr) {
  ------------------
  |  Branch (2767:11): [True: 90.5k, False: 564]
  ------------------
 2768|  90.5k|        ch = 0;
 2769|   271k|        while (ch < num_channels) {
  ------------------
  |  Branch (2769:16): [True: 181k, False: 90.5k]
  ------------------
 2770|   181k|          memcpy(ptr_scale_factor_band_nrg[ch], ptr_sfb_nrg_coupling[ch],
 2771|   181k|                 MAXIMUM_NUM_ENVELOPE_VALUES * sizeof(ptr_scale_factor_band_nrg[0][0]));
  ------------------
  |  |   94|   181k|#define MAXIMUM_NUM_ENVELOPE_VALUES (MAXIMUM_NUM_ENV_VALUES_USAC)
  |  |  ------------------
  |  |  |  |   78|   181k|#define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   181k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  |  |  ------------------
  |  |  |  |               #define MAXIMUM_NUM_ENV_VALUES_USAC (MAXIMUM_FREQ_COEFFS_USAC * MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|   181k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|       |
 2773|   181k|          memcpy(ptr_noise_level[ch], ptr_noise_lvl_coupling[ch],
 2774|   181k|                 MAXIMUM_NUM_NOISE_VALUES * sizeof(ptr_noise_level[0][0]));
  ------------------
  |  |   58|   181k|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|   181k|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|   181k|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
 2775|   181k|          ch++;
 2776|   181k|        }
 2777|       |
 2778|  90.5k|        pstr_sbr_hdr->coupling = 1;
 2779|  90.5k|        pstr_env_0->balance = 0;
 2780|  90.5k|        pstr_env_1->balance = 1;
 2781|  90.5k|      } else {
 2782|    564|        ch = 0;
 2783|  1.69k|        while (ch < num_channels) {
  ------------------
  |  Branch (2783:16): [True: 1.12k, False: 564]
  ------------------
 2784|  1.12k|          memcpy(pstr_env_ch[ch]->str_sbr_code_env.sfb_nrg_prev,
 2785|  1.12k|                 scale_factor_band_nrg_prev_temp[ch],
 2786|  1.12k|                 MAXIMUM_FREQ_COEFFS * sizeof(scale_factor_band_nrg_prev_temp[0][0]));
  ------------------
  |  |   83|  1.12k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  1.12k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
 2787|       |
 2788|  1.12k|          pstr_env_ch[ch]->str_sbr_code_env.update = up_date_nrg_temp[ch];
 2789|       |
 2790|  1.12k|          memcpy(pstr_env_ch[ch]->str_sbr_code_noise_floor.sfb_nrg_prev, noise_prev_temp[ch],
 2791|  1.12k|                 MAXIMUM_NUM_NOISE_COEFFS * sizeof(noise_prev_temp[0][0]));
  ------------------
  |  |   57|  1.12k|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  ------------------
 2792|       |
 2793|  1.12k|          memcpy(pstr_env_ch[ch]->enc_env_data.domain_vec, domain_vec_temp[ch],
 2794|  1.12k|                 sizeof(domain_vec_temp[0][0]) * IXHEAACE_MAX_ENV);
  ------------------
  |  |   88|  1.12k|#define IXHEAACE_MAX_ENV (MAXIMUM_ENVELOPES_USAC)
  |  |  ------------------
  |  |  |  |   77|  1.12k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  ------------------
  ------------------
 2795|       |
 2796|  1.12k|          memcpy(pstr_env_ch[ch]->enc_env_data.domain_vec_noise, domain_vec_noise_temp[ch],
 2797|  1.12k|                 sizeof(domain_vec_noise_temp[0][0]) * IXHEAACE_MAX_ENV);
  ------------------
  |  |   88|  1.12k|#define IXHEAACE_MAX_ENV (MAXIMUM_ENVELOPES_USAC)
  |  |  ------------------
  |  |  |  |   77|  1.12k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  ------------------
  ------------------
 2798|       |
 2799|  1.12k|          pstr_env_ch[ch]->str_sbr_code_noise_floor.update = up_date_noise_temp[ch];
 2800|  1.12k|          ch++;
 2801|  1.12k|        }
 2802|       |
 2803|    564|        pstr_sbr_hdr->coupling = 0;
 2804|    564|        pstr_env_0->balance = 0;
 2805|    564|        pstr_env_1->balance = 0;
 2806|    564|      }
 2807|  91.0k|    } break;
 2808|   414k|  }
 2809|       |
 2810|   413k|  if (num_channels == 1) {
  ------------------
  |  Branch (2810:7): [True: 249k, False: 163k]
  ------------------
 2811|   249k|    if (pstr_env_0->domain_vec[0] == TIME) {
  ------------------
  |  |  177|   249k|#define TIME (1)
  ------------------
  |  Branch (2811:9): [True: 41.2k, False: 208k]
  ------------------
 2812|  41.2k|      pstr_env_ch[0]->str_sbr_code_env.df_edge_incr_fac++;
 2813|   208k|    } else {
 2814|   208k|      pstr_env_ch[0]->str_sbr_code_env.df_edge_incr_fac = 0;
 2815|   208k|    }
 2816|   249k|  } else {
 2817|   163k|    if (pstr_env_0->domain_vec[0] == TIME || pstr_env_1->domain_vec[0] == TIME) {
  ------------------
  |  |  177|   327k|#define TIME (1)
  ------------------
                  if (pstr_env_0->domain_vec[0] == TIME || pstr_env_1->domain_vec[0] == TIME) {
  ------------------
  |  |  177|   135k|#define TIME (1)
  ------------------
  |  Branch (2817:9): [True: 28.6k, False: 135k]
  |  Branch (2817:46): [True: 20.5k, False: 114k]
  ------------------
 2818|  49.2k|      pstr_env_ch[0]->str_sbr_code_env.df_edge_incr_fac++;
 2819|  49.2k|      pstr_env_ch[1]->str_sbr_code_env.df_edge_incr_fac++;
 2820|   114k|    } else {
 2821|   114k|      pstr_env_ch[0]->str_sbr_code_env.df_edge_incr_fac = 0;
 2822|   114k|      pstr_env_ch[1]->str_sbr_code_env.df_edge_incr_fac = 0;
 2823|   114k|    }
 2824|   163k|  }
 2825|       |
 2826|   990k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (2826:16): [True: 577k, False: 413k]
  ------------------
 2827|   577k|    c = 0;
 2828|   577k|    i = 0;
 2829|       |
 2830|  1.55M|    while (i < n_envelopes[ch]) {
  ------------------
  |  Branch (2830:12): [True: 976k, False: 577k]
  ------------------
 2831|  11.3M|      for (j = 0; j < pstr_env_ch[ch]->enc_env_data.no_scf_bands[i]; j++) {
  ------------------
  |  Branch (2831:19): [True: 10.3M, False: 976k]
  ------------------
 2832|  10.3M|        pstr_env_ch[ch]->enc_env_data.ienvelope[i][j] = ptr_scale_factor_band_nrg[ch][c];
 2833|  10.3M|        c++;
 2834|  10.3M|      }
 2835|   976k|      i++;
 2836|   976k|    }
 2837|       |
 2838|   577k|    i = 0;
 2839|  6.34M|    while (i < MAXIMUM_NUM_NOISE_VALUES) {
  ------------------
  |  |   58|  6.34M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  6.34M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  6.34M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (2839:12): [True: 5.77M, False: 577k]
  ------------------
 2840|  5.77M|      pstr_env_ch[ch]->enc_env_data.noise_level[i] = ptr_noise_level[ch][i];
 2841|  5.77M|      i++;
 2842|  5.77M|    }
 2843|   577k|  }
 2844|   413k|  if ((USAC_SBR == pstr_sbr_cfg->sbr_codec) && (1 == pstr_sbr_hdr->sbr_inter_tes_active)) {
  ------------------
  |  Branch (2844:7): [True: 201k, False: 211k]
  |  Branch (2844:48): [True: 63.8k, False: 138k]
  ------------------
 2845|       |    // inter-TES encoder
 2846|  63.8k|    WORD32 idx;
 2847|   154k|    for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (2847:18): [True: 91.0k, False: 63.8k]
  ------------------
 2848|  91.0k|      ixheaace_str_inter_tes_params *pstr_tes_enc = &pstr_env_ch[ch]->str_inter_tes_enc;
 2849|       |
 2850|  91.0k|      pstr_tes_enc->num_if_bands = pstr_env_ch[ch]->enc_env_data.noise_band_count;
 2851|  91.0k|      pstr_tes_enc->sub_band_start = pstr_sbr_cfg->ptr_freq_band_tab[LO][0];
  ------------------
  |  |  100|  91.0k|#define LO (0)
  ------------------
 2852|  91.0k|      pstr_tes_enc->sub_band_end = pstr_sbr_cfg->ptr_freq_band_tab[LO][pstr_sbr_cfg->num_scf[LO]];
  ------------------
  |  |  100|  91.0k|#define LO (0)
  ------------------
                    pstr_tes_enc->sub_band_end = pstr_sbr_cfg->ptr_freq_band_tab[LO][pstr_sbr_cfg->num_scf[LO]];
  ------------------
  |  |  100|  91.0k|#define LO (0)
  ------------------
 2853|  91.0k|      pstr_tes_enc->num_mf_bands = pstr_sbr_cfg->num_master;
 2854|  91.0k|      pstr_tes_enc->out_fs = pstr_sbr_cfg->sample_freq;
 2855|  91.0k|      pstr_tes_enc->num_env = pstr_env_ch[ch]->str_sbr_env_frame.sbr_grid.bs_num_env;
 2856|       |
 2857|   910k|      for (idx = 0; idx < (IXHEAACE_MAX_ENV + 1); idx++) {
  ------------------
  |  |   88|   910k|#define IXHEAACE_MAX_ENV (MAXIMUM_ENVELOPES_USAC)
  |  |  ------------------
  |  |  |  |   77|   910k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  ------------------
  ------------------
  |  Branch (2857:21): [True: 819k, False: 91.0k]
  ------------------
 2858|   819k|        pstr_tes_enc->border_vec[idx] = (WORD16)pstr_const_frame_info[ch]->borders[idx];
 2859|   819k|      }
 2860|       |
 2861|  5.27M|      for (idx = 0; idx < (MAXIMUM_FREQ_COEFFS + 1); idx++) {
  ------------------
  |  |   83|  5.27M|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  5.27M|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  |  Branch (2861:21): [True: 5.18M, False: 91.0k]
  ------------------
 2862|  5.18M|        pstr_tes_enc->f_master_tbl[idx] = (WORD16)((UWORD16)pstr_sbr_cfg->ptr_v_k_master[idx]);
 2863|  5.18M|      }
 2864|       |
 2865|  1.00M|      for (idx = 0; idx < MAXIMUM_NUM_NOISE_VALUES; idx++) {
  ------------------
  |  |   58|  1.00M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  1.00M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  1.00M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (2865:21): [True: 910k, False: 91.0k]
  ------------------
 2866|   910k|        pstr_tes_enc->inv_filt_mode[idx] =
 2867|   910k|            (WORD32)pstr_env_ch[ch]->enc_env_data.sbr_invf_mode_vec[idx];
 2868|   910k|        pstr_tes_enc->invf_band_tbl[idx] =
 2869|   910k|            (WORD16)pstr_env_ch[ch]->str_ton_corr.sbr_noise_floor_est.s_freq_qmf_band_tbl[idx];
 2870|   910k|      }
 2871|  91.0k|      pstr_tes_enc->invf_band_tbl[MAXIMUM_NUM_NOISE_VALUES] =
  ------------------
  |  |   58|  91.0k|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  91.0k|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  91.0k|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
 2872|  91.0k|          (WORD16)pstr_env_ch[ch]
 2873|  91.0k|              ->str_ton_corr.sbr_noise_floor_est.s_freq_qmf_band_tbl[MAXIMUM_NUM_NOISE_VALUES];
  ------------------
  |  |   58|  91.0k|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  91.0k|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  91.0k|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
 2874|       |
 2875|  91.0k|      err_code = ixheaace_process_inter_tes(pstr_tes_enc, ptr_sbr_scratch);
 2876|  91.0k|      if (err_code) {
  ------------------
  |  Branch (2876:11): [True: 0, False: 91.0k]
  ------------------
 2877|      0|        return err_code;
 2878|      0|      }
 2879|       |
 2880|  91.0k|      WORD32 ts, num_ts, delay;
 2881|  91.0k|      num_ts = pstr_env_ch[ch]->str_sbr_qmf.num_time_slots;
 2882|       |
 2883|  91.0k|      delay = pstr_tes_enc->op_delay + pstr_tes_enc->codec_delay + IXHEAACE_SBR_HF_ADJ_OFFSET;
  ------------------
  |  |   36|  91.0k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
 2884|       |
 2885|  3.32M|      for (ts = 0; ts < delay; ts++) {
  ------------------
  |  Branch (2885:20): [True: 3.23M, False: 91.0k]
  ------------------
 2886|  3.23M|        memcpy(pstr_tes_enc->qmf_buf_real[ts], pstr_tes_enc->qmf_buf_real[num_ts + ts],
 2887|  3.23M|               IXHEAACE_QMF_CHANNELS * sizeof(pstr_tes_enc->qmf_buf_real[0][0]));
  ------------------
  |  |   66|  3.23M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
 2888|  3.23M|        memcpy(pstr_tes_enc->qmf_buf_imag[ts], pstr_tes_enc->qmf_buf_imag[num_ts + ts],
 2889|  3.23M|               IXHEAACE_QMF_CHANNELS * sizeof(pstr_tes_enc->qmf_buf_imag[0][0]));
  ------------------
  |  |   66|  3.23M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
 2890|  3.23M|      }
 2891|  91.0k|    }
 2892|  63.8k|  }
 2893|       |  // Pitch detection, pre-processing detection and oversampling decision making
 2894|   413k|  if ((1 == pstr_sbr_cfg->is_esbr) && (pstr_sbr_cfg->sbr_codec == HEAAC_SBR)) {
  ------------------
  |  Branch (2894:7): [True: 58.9k, False: 354k]
  |  Branch (2894:39): [True: 58.9k, False: 0]
  ------------------
 2895|  58.9k|    err_code = ixheaace_update_esbr_ext_data(
 2896|  58.9k|        ptr_in_time, pstr_sbr_cfg, pstr_env_ch[0]->str_sbr_extract_env.ptr_r_buffer[0], &str_esbr,
 2897|  58.9k|        transient_info, ptr_sbr_tab, pstr_sbr_hdr->coupling, time_sn_stride, 2048);
 2898|  58.9k|    if (err_code) return err_code;
  ------------------
  |  Branch (2898:9): [True: 0, False: 58.9k]
  ------------------
 2899|  58.9k|  }
 2900|       |
 2901|   413k|  if ((pstr_sbr_cfg->sbr_codec == USAC_SBR) && (pstr_sbr_hdr->sbr_harmonic)) {
  ------------------
  |  Branch (2901:7): [True: 201k, False: 211k]
  |  Branch (2901:48): [True: 107k, False: 94.3k]
  ------------------
 2902|   107k|    ixheaace_update_harmonic_sbr_data(transient_info, pstr_sbr_hdr->coupling,
 2903|   107k|                                      &pstr_env_ch[0], num_channels);
 2904|   107k|  }
 2905|   413k|  if (num_channels == 2) {
  ------------------
  |  Branch (2905:7): [True: 163k, False: 249k]
  ------------------
 2906|   163k|    WORD32 num_bits;
 2907|   163k|    pstr_env_0->usac_indep_flag = pstr_sbr_bs->usac_indep_flag;
 2908|   163k|    pstr_env_1->usac_indep_flag = pstr_sbr_bs->usac_indep_flag;
 2909|   163k|    err_code = ixheaace_write_env_channel_pair_element(
 2910|   163k|        pstr_sbr_hdr, pstr_sbr_bs, &pstr_env_ch[0]->enc_env_data, &pstr_env_ch[1]->enc_env_data,
 2911|   163k|        pstr_com_data, ptr_sbr_tab, pstr_sbr_cfg->sbr_codec, pstr_sbr_cfg->is_esbr, &str_esbr,
 2912|   163k|        &num_bits);
 2913|   163k|    if (err_code) {
  ------------------
  |  Branch (2913:9): [True: 87, False: 163k]
  ------------------
 2914|     87|      return err_code;
 2915|     87|    }
 2916|   249k|  } else {
 2917|   249k|    WORD32 num_bits;
 2918|   249k|    pstr_env_0->sbr_pvc_mode = pstr_sbr_hdr->sbr_pvc_mode;
 2919|   249k|    pstr_env_0->sbr_sinusoidal_pos_flag = 0;
 2920|   249k|    pstr_env_0->usac_indep_flag = pstr_sbr_bs->usac_indep_flag;
 2921|       |
 2922|   249k|    err_code = ixheaace_write_env_single_channel_element(
 2923|   249k|        pstr_sbr_hdr, pstr_sbr_bs, &pstr_env_ch[0]->enc_env_data, pstr_ps_enc, pstr_com_data,
 2924|   249k|        ptr_sbr_tab, pstr_sbr_cfg->sbr_codec, pstr_sbr_cfg->is_esbr, &str_esbr, &num_bits);
 2925|   249k|    if (err_code) {
  ------------------
  |  Branch (2925:9): [True: 78, False: 249k]
  ------------------
 2926|     78|      return err_code;
 2927|     78|    }
 2928|   249k|  }
 2929|       |
 2930|   413k|  ch = 0;
 2931|   990k|  while (ch < num_channels) {
  ------------------
  |  Branch (2931:10): [True: 576k, False: 413k]
  ------------------
 2932|   576k|    ixheaace_str_sbr_extr_env *pstr_sbr_extract_env = &(pstr_env_ch[ch]->str_sbr_extract_env);
 2933|  8.87M|    for (i = 0; i < pstr_sbr_extract_env->y_buffer_write_offset; i++) {
  ------------------
  |  Branch (2933:17): [True: 8.29M, False: 576k]
  ------------------
 2934|  8.29M|      FLOAT32 *ptr_tmp;
 2935|  8.29M|      ptr_tmp = pstr_sbr_extract_env->ptr_y_buffer[i];
 2936|  8.29M|      pstr_sbr_extract_env->ptr_y_buffer[i] =
 2937|  8.29M|          pstr_sbr_extract_env->ptr_y_buffer[i + pstr_sbr_extract_env->time_slots];
 2938|  8.29M|      pstr_sbr_extract_env->ptr_y_buffer[i + pstr_sbr_extract_env->time_slots] = ptr_tmp;
 2939|  8.29M|    }
 2940|       |
 2941|   576k|    pstr_sbr_extract_env->buffer_flag ^= 1;
 2942|   576k|    ch++;
 2943|   576k|  }
 2944|       |
 2945|   413k|  pstr_sbr_hdr->prev_coupling = pstr_sbr_hdr->coupling;
 2946|       |
 2947|   413k|  return err_code;
 2948|   413k|}
ixheaace_sbr_env_est.c:ixheaace_esbr_fwd_modulation:
 1662|  5.50M|                                         ixheaace_str_qmf_dec_tabs_struct *pstr_qmf_dec_tabs) {
 1663|  5.50M|  WORD32 i;
 1664|  5.50M|  const FLOAT32 *ptr_time_sample_buf1 = &ptr_time_sample_buf[2 * pstr_qmf_bank->no_channels - 1];
 1665|  5.50M|  FLOAT32 temp1, temp2;
 1666|  5.50M|  FLOAT32 *ptr_real_subband = ptr_in_real_subband;
 1667|  5.50M|  FLOAT32 *ptr_imag_subband = ptr_in_imag_subband;
 1668|  5.50M|  const FLOAT32 *ptr_cos;
 1669|       |
 1670|   135M|  for (i = pstr_qmf_bank->no_channels - 1; i >= 0; i--) {
  ------------------
  |  Branch (1670:44): [True: 129M, False: 5.50M]
  ------------------
 1671|   129M|    temp1 = *ptr_time_sample_buf++ / 16.0f;
 1672|   129M|    temp2 = *ptr_time_sample_buf1-- / 16.0f;
 1673|   129M|    *ptr_real_subband++ = (temp1 - temp2);
 1674|   129M|    *ptr_imag_subband++ = (temp1 + temp2);
 1675|   129M|  }
 1676|       |
 1677|  5.50M|  ixheaace_esbr_cos_sin_mod(ptr_in_real_subband, pstr_qmf_bank, pstr_qmf_dec_tabs->esbr_w_16,
 1678|  5.50M|                            pstr_qmf_dec_tabs->dig_rev_tab_4_16);
 1679|       |
 1680|  5.50M|  ptr_cos = pstr_qmf_bank->ptr_esbr_t_cos;
 1681|       |
 1682|  5.50M|  i = (pstr_qmf_bank->usb - pstr_qmf_bank->lsb - 1);
 1683|   135M|  while (i >= 0) {
  ------------------
  |  Branch (1683:10): [True: 129M, False: 5.50M]
  ------------------
 1684|   129M|    FLOAT32 cosh, sinh;
 1685|   129M|    FLOAT32 re, im;
 1686|       |
 1687|   129M|    re = *ptr_in_real_subband;
 1688|   129M|    im = *ptr_in_imag_subband;
 1689|   129M|    cosh = *ptr_cos++;
 1690|   129M|    sinh = *ptr_cos++;
 1691|   129M|    *ptr_in_real_subband++ = 2 * ((re * cosh) + (im * sinh));
 1692|   129M|    *ptr_in_imag_subband++ = 2 * ((im * cosh) - (re * sinh));
 1693|   129M|    i--;
 1694|   129M|  }
 1695|  5.50M|}
ixheaace_sbr_env_est.c:ixheaace_hbe_get_pitch_bins:
  484|   117k|                                                WORD32 *bin1, WORD32 *bin2) {
  485|   117k|  const WORD32 *ptr_sbr_table = NULL;
  486|   117k|  FLOAT32 *ptr_esbr_inp = ptr_esbr_scr;
  487|   117k|  ptr_esbr_scr += num_samples * 2;
  488|   117k|  FLOAT32 *ptr_esbr_inp_i = ptr_esbr_inp + num_samples;
  489|   117k|  FLOAT32 *ptr_scratch_fft = ptr_esbr_scr;
  490|   117k|  WORD32 idx, sf, is_4_1 = 0;
  491|       |
  492|   117k|  sf = pstr_sbr_cfg->sample_freq;
  493|   117k|  if (IXHEAACE_MAX_NUM_SAMPLES == num_samples) {
  ------------------
  |  |   43|   117k|#define IXHEAACE_MAX_NUM_SAMPLES (4096)
  ------------------
  |  Branch (493:7): [True: 33.1k, False: 83.9k]
  ------------------
  494|  33.1k|    sf = sf >> 1;
  495|  33.1k|    is_4_1 = 1;
  496|  33.1k|  }
  497|       |
  498|   117k|  switch (sf) {
  499|  9.48k|    case 16000:
  ------------------
  |  Branch (499:5): [True: 9.48k, False: 107k]
  ------------------
  500|  9.48k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_8k;
  501|  9.48k|      break;
  502|  6.40k|    case 22050:
  ------------------
  |  Branch (502:5): [True: 6.40k, False: 110k]
  ------------------
  503|  6.40k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_11k;
  504|  6.40k|      break;
  505|  24.5k|    case 24000:
  ------------------
  |  Branch (505:5): [True: 24.5k, False: 92.5k]
  ------------------
  506|  24.5k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_12k;
  507|  24.5k|      break;
  508|  18.4k|    case 32000:
  ------------------
  |  Branch (508:5): [True: 18.4k, False: 98.6k]
  ------------------
  509|  18.4k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_16k;
  510|  18.4k|      break;
  511|  10.2k|    case 44100:
  ------------------
  |  Branch (511:5): [True: 10.2k, False: 106k]
  ------------------
  512|  10.2k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_22k;
  513|  10.2k|      break;
  514|  45.4k|    case 48000:
  ------------------
  |  Branch (514:5): [True: 45.4k, False: 71.6k]
  ------------------
  515|  45.4k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_24k;
  516|  45.4k|      break;
  517|  2.50k|    default:
  ------------------
  |  Branch (517:5): [True: 2.50k, False: 114k]
  ------------------
  518|  2.50k|      return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_SAMP_FREQ;
  519|   117k|  }
  520|   114k|  if (1 == pstr_sbr_cfg->num_ch) {
  ------------------
  |  Branch (520:7): [True: 74.4k, False: 40.1k]
  ------------------
  521|  74.4k|    if (num_samples == 2048) {
  ------------------
  |  Branch (521:9): [True: 57.6k, False: 16.7k]
  ------------------
  522|  59.1M|      for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (522:21): [True: 59.0M, False: 57.6k]
  ------------------
  523|  59.0M|        ptr_esbr_inp[idx] = ptr_time_in[time_sn_stride * idx];
  524|  59.0M|        ptr_esbr_inp[idx + 1] = 0;
  525|  59.0M|        ptr_esbr_inp[num_samples + idx] = ptr_time_in[time_sn_stride * (idx + 1)];
  526|  59.0M|        ptr_esbr_inp[num_samples + idx + 1] = 0;
  527|  59.0M|      }
  528|  57.6k|      iusace_complex_fft_2048(ptr_esbr_inp, ptr_scratch_fft);
  529|  57.6k|      *bin1 = ixheaace_get_pitch_bin(ptr_esbr_inp, ptr_sbr_table, is_4_1);
  530|  57.6k|    } else if (num_samples == IXHEAACE_MAX_NUM_SAMPLES) {
  ------------------
  |  |   43|  16.7k|#define IXHEAACE_MAX_NUM_SAMPLES (4096)
  ------------------
  |  Branch (530:16): [True: 16.7k, False: 0]
  ------------------
  531|  16.7k|      memset(ptr_esbr_inp_i, 0, num_samples * sizeof(ptr_esbr_inp_i[0]));
  532|  34.4M|      for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (532:21): [True: 34.3M, False: 16.7k]
  ------------------
  533|  34.3M|        ptr_esbr_inp[idx / 2] = ptr_time_in[time_sn_stride * idx];
  534|  34.3M|        ptr_esbr_inp[(num_samples + idx) / 2] = ptr_time_in[time_sn_stride * (idx + 1)];
  535|  34.3M|      }
  536|  16.7k|      iusace_complex_fft_4096(ptr_esbr_inp, ptr_esbr_inp_i, ptr_scratch_fft);
  537|  16.7k|      *bin1 = ixheaace_get_pitch_bin_deint(ptr_esbr_inp, ptr_esbr_inp_i, ptr_sbr_table, is_4_1);
  538|  16.7k|    }
  539|  74.4k|  } else {
  540|  40.1k|    if (num_samples == 2048) {
  ------------------
  |  Branch (540:9): [True: 23.7k, False: 16.3k]
  ------------------
  541|  24.3M|      for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (541:21): [True: 24.3M, False: 23.7k]
  ------------------
  542|  24.3M|        ptr_esbr_inp[idx] = ptr_time_in[2 * idx];
  543|  24.3M|        ptr_esbr_inp[idx + 1] = 0;
  544|  24.3M|        ptr_esbr_inp[num_samples + idx] = ptr_time_in[2 * idx + 2];
  545|  24.3M|        ptr_esbr_inp[num_samples + idx + 1] = 0;
  546|  24.3M|      }
  547|  23.7k|      iusace_complex_fft_2048(ptr_esbr_inp, ptr_scratch_fft);
  548|  23.7k|      *bin1 = ixheaace_get_pitch_bin(ptr_esbr_inp, ptr_sbr_table, is_4_1);
  549|       |
  550|  24.3M|      for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (550:21): [True: 24.3M, False: 23.7k]
  ------------------
  551|  24.3M|        ptr_esbr_inp[idx] = ptr_time_in[2 * idx + 1];
  552|  24.3M|        ptr_esbr_inp[idx + 1] = 0;
  553|  24.3M|        ptr_esbr_inp[num_samples + idx] = ptr_time_in[2 * idx + 3];
  554|  24.3M|        ptr_esbr_inp[num_samples + idx + 1] = 0;
  555|  24.3M|      }
  556|  23.7k|      iusace_complex_fft_2048(ptr_esbr_inp, ptr_scratch_fft);
  557|  23.7k|      *bin2 = ixheaace_get_pitch_bin(ptr_esbr_inp, ptr_sbr_table, is_4_1);
  558|  23.7k|    } else if (num_samples == IXHEAACE_MAX_NUM_SAMPLES) {
  ------------------
  |  |   43|  16.3k|#define IXHEAACE_MAX_NUM_SAMPLES (4096)
  ------------------
  |  Branch (558:16): [True: 16.3k, False: 0]
  ------------------
  559|  16.3k|      memset(ptr_esbr_inp_i, 0, num_samples * sizeof(ptr_esbr_inp_i[0]));
  560|  33.5M|      for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (560:21): [True: 33.5M, False: 16.3k]
  ------------------
  561|  33.5M|        ptr_esbr_inp[idx / 2] = ptr_time_in[2 * idx];
  562|  33.5M|        ptr_esbr_inp[(num_samples + idx) / 2] = ptr_time_in[2 * idx + 2];
  563|  33.5M|      }
  564|  16.3k|      iusace_complex_fft_4096(ptr_esbr_inp, ptr_esbr_inp_i, ptr_scratch_fft);
  565|  16.3k|      *bin1 = ixheaace_get_pitch_bin_deint(ptr_esbr_inp, ptr_esbr_inp_i, ptr_sbr_table, is_4_1);
  566|       |
  567|  16.3k|      memset(ptr_esbr_inp_i, 0, num_samples * sizeof(ptr_esbr_inp_i[0]));
  568|  33.5M|      for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (568:21): [True: 33.5M, False: 16.3k]
  ------------------
  569|  33.5M|        ptr_esbr_inp[idx / 2] = ptr_time_in[2 * idx + 1];
  570|  33.5M|        ptr_esbr_inp[(num_samples + idx) / 2] = ptr_time_in[2 * idx + 3];
  571|  33.5M|      }
  572|  16.3k|      iusace_complex_fft_4096(ptr_esbr_inp, ptr_esbr_inp_i, ptr_scratch_fft);
  573|  16.3k|      *bin2 = ixheaace_get_pitch_bin_deint(ptr_esbr_inp, ptr_esbr_inp_i, ptr_sbr_table, is_4_1);
  574|  16.3k|    }
  575|  40.1k|  }
  576|   114k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   114k|#define IA_NO_ERROR 0x00000000
  ------------------
  577|   117k|}
ixheaace_sbr_env_est.c:ixheaace_get_pitch_bin:
  444|   188k|                                     WORD32 is_4_1) {
  445|   188k|  WORD32 i, j = 0, k = 0;
  446|   188k|  WORD32 bin = -1;
  447|   188k|  FLOAT32 tmp, prev_val = 0;
  448|       |
  449|  1.49M|  while (ptr_sfb_tab[j] != -1) {
  ------------------
  |  Branch (449:10): [True: 1.44M, False: 49.3k]
  ------------------
  450|  1.44M|    WORD32 size = ptr_sfb_tab[j];
  451|  1.44M|    tmp = 0;
  452|       |
  453|  55.8M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (453:17): [True: 54.3M, False: 1.44M]
  ------------------
  454|  54.3M|      tmp += fft_data[k] * fft_data[k];
  455|  54.3M|      tmp += fft_data[k + 1] * fft_data[k + 1];
  456|  54.3M|      k += 2;
  457|  54.3M|    }
  458|       |
  459|  1.44M|    tmp = (FLOAT32)log(MAX(MIN_FLT_VAL, (tmp / (FLOAT32)size)));
  ------------------
  |  |   24|  1.44M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 982k, False: 467k]
  |  |  ------------------
  ------------------
  460|  1.44M|    if (j != 0) {
  ------------------
  |  Branch (460:9): [True: 1.26M, False: 188k]
  ------------------
  461|  1.26M|      if (fabs(tmp - prev_val) >= 3.0f) {
  ------------------
  |  Branch (461:11): [True: 139k, False: 1.12M]
  ------------------
  462|   139k|        if (1 == is_4_1) {
  ------------------
  |  Branch (462:13): [True: 0, False: 139k]
  ------------------
  463|      0|          bin = ((k - (ptr_sfb_tab[j] * 2)) * 3) / 8;
  464|   139k|        } else {
  465|   139k|          bin = ((k - (ptr_sfb_tab[j] * 2)) * 3) / 4;
  466|   139k|        }
  467|   139k|        if (bin > 127) {
  ------------------
  |  Branch (467:13): [True: 1.74k, False: 137k]
  ------------------
  468|  1.74k|          bin = -1;
  469|  1.74k|        }
  470|   139k|        break;
  471|   139k|      }
  472|  1.26M|    }
  473|  1.31M|    prev_val = tmp;
  474|  1.31M|    j++;
  475|  1.31M|  }
  476|       |
  477|   188k|  return bin;
  478|   188k|}
ixheaace_sbr_env_est.c:ixheaace_get_pitch_bin_deint:
  408|  49.5k|                                           const WORD32 *ptr_sfb_tab, WORD32 is_4_1) {
  409|  49.5k|  WORD32 i, j = 0, k = 0;
  410|  49.5k|  WORD32 bin = -1;
  411|  49.5k|  FLOAT32 tmp, prev_val = 0.0f;
  412|       |
  413|   198k|  while (ptr_sfb_tab[j] != -1) {
  ------------------
  |  Branch (413:10): [True: 193k, False: 4.52k]
  ------------------
  414|   193k|    WORD32 size = ptr_sfb_tab[j];
  415|   193k|    tmp = 0;
  416|       |
  417|  6.42M|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (417:17): [True: 6.23M, False: 193k]
  ------------------
  418|  6.23M|      tmp += ptr_fft_data_real[k / 2] * ptr_fft_data_real[k / 2];
  419|  6.23M|      tmp += ptr_fft_data_im[k / 2] * ptr_fft_data_im[k / 2];
  420|  6.23M|      k += 2;
  421|  6.23M|    }
  422|       |
  423|   193k|    tmp = (FLOAT32)log(max(MIN_FLT_VAL, (tmp / (FLOAT32)size)));
  ------------------
  |  |   74|   193k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 117k, False: 76.1k]
  |  |  ------------------
  ------------------
  424|   193k|    if (j != 0) {
  ------------------
  |  Branch (424:9): [True: 144k, False: 49.5k]
  ------------------
  425|   144k|      if (fabs(tmp - prev_val) >= 3.0f) {
  ------------------
  |  Branch (425:11): [True: 45.0k, False: 99.1k]
  ------------------
  426|  45.0k|        if (1 == is_4_1) {
  ------------------
  |  Branch (426:13): [True: 45.0k, False: 0]
  ------------------
  427|  45.0k|          bin = ((k - (ptr_sfb_tab[j] * 2)) * 3) / 8;
  428|  45.0k|        } else {
  429|      0|          bin = ((k - (ptr_sfb_tab[j] * 2)) * 3) / 4;
  430|      0|        }
  431|  45.0k|        if (bin > 127) {
  ------------------
  |  Branch (431:13): [True: 278, False: 44.7k]
  ------------------
  432|    278|          bin = -1;
  433|    278|        }
  434|  45.0k|        break;
  435|  45.0k|      }
  436|   144k|    }
  437|   148k|    prev_val = tmp;
  438|   148k|    j++;
  439|   148k|  }
  440|       |
  441|  49.5k|  return bin;
  442|  49.5k|}
ixheaace_sbr_env_est.c:ixheaace_calculate_sbr_envelope:
  183|   672k|    WORD32 *ptr_max_quant_err) {
  184|   672k|  WORD32 i, j, k, l, count, m = 0;
  185|   672k|  WORD32 num_bands, start_pos, stop_pos, li, ui;
  186|   672k|  ixheaace_freq_res freq_res;
  187|       |
  188|   672k|  WORD32 ca = 2 - pstr_sbr->enc_env_data.init_sbr_amp_res;
  189|   672k|  WORD32 n_envelopes = pstr_const_frame_info->n_envelopes;
  190|   672k|  WORD32 short_env = pstr_const_frame_info->short_env - 1;
  191|   672k|  WORD32 time_step = pstr_sbr->str_sbr_extract_env.time_step;
  192|   672k|  WORD32 missing_harmonic = 0;
  193|       |
  194|   672k|  if ((ca != 1) && (ca != 2)) {
  ------------------
  |  Branch (194:7): [True: 336k, False: 335k]
  |  Branch (194:20): [True: 0, False: 336k]
  ------------------
  195|      0|    return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_AMP_RES;
  196|      0|  }
  197|       |
  198|   672k|  if (stereo_mode == SBR_COUPLING) {
  ------------------
  |  Branch (198:7): [True: 92.4k, False: 579k]
  ------------------
  199|  92.4k|    *ptr_max_quant_err = 0;
  200|  92.4k|  }
  201|       |
  202|   672k|  i = 0;
  203|  1.82M|  while (i < n_envelopes) {
  ------------------
  |  Branch (203:10): [True: 1.14M, False: 672k]
  ------------------
  204|  1.14M|    start_pos = pstr_const_frame_info->borders[i];
  205|  1.14M|    stop_pos = pstr_const_frame_info->borders[i + 1];
  206|  1.14M|    freq_res = pstr_const_frame_info->freq_res[i];
  207|  1.14M|    num_bands = pstr_sbr_cfg->num_scf[freq_res];
  208|       |
  209|  1.14M|    if (i == short_env) {
  ------------------
  |  Branch (209:9): [True: 174k, False: 974k]
  ------------------
  210|   174k|      if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (210:11): [True: 46.2k, False: 128k]
  ------------------
  211|  46.2k|        WORD32 temp = 2;
  212|  46.2k|        if (temp < time_step) {
  ------------------
  |  Branch (212:13): [True: 0, False: 46.2k]
  ------------------
  213|      0|          temp = time_step;
  214|      0|        }
  215|  46.2k|        if (stop_pos - start_pos > temp) {
  ------------------
  |  Branch (215:13): [True: 44.6k, False: 1.52k]
  ------------------
  216|  44.6k|          stop_pos = stop_pos - temp;
  217|  44.6k|        }
  218|   128k|      } else {
  219|   128k|        stop_pos = stop_pos - 1;
  220|   128k|      }
  221|   174k|    }
  222|  13.1M|    for (j = 0; j < num_bands; j++) {
  ------------------
  |  Branch (222:17): [True: 11.9M, False: 1.14M]
  ------------------
  223|  11.9M|      FLOAT32 energy_left = 0, energy_right = 0, tmp_ene_l = 0, tmp_ene_r = 0;
  224|  11.9M|      li = pstr_sbr_cfg->ptr_freq_band_tab[freq_res][j];
  225|  11.9M|      ui = pstr_sbr_cfg->ptr_freq_band_tab[freq_res][j + 1];
  226|       |
  227|  11.9M|      if ((freq_res == FREQ_RES_HIGH) && (j == 0 && ui - li > 1)) {
  ------------------
  |  Branch (227:11): [True: 9.32M, False: 2.63M]
  |  Branch (227:43): [True: 724k, False: 8.59M]
  |  Branch (227:53): [True: 200k, False: 523k]
  ------------------
  228|   200k|        li++;
  229|  11.7M|      } else {
  230|  11.7M|        if (j == 0 && ui - li > 2) {
  ------------------
  |  Branch (230:13): [True: 947k, False: 10.8M]
  |  Branch (230:23): [True: 169k, False: 778k]
  ------------------
  231|   169k|          li++;
  232|   169k|        }
  233|  11.7M|      }
  234|       |
  235|  11.9M|      missing_harmonic = 0;
  236|       |
  237|  11.9M|      if (pstr_sbr->enc_env_data.add_harmonic_flag) {
  ------------------
  |  Branch (237:11): [True: 4.10M, False: 7.85M]
  ------------------
  238|  4.10M|        if (freq_res == FREQ_RES_HIGH) {
  ------------------
  |  Branch (238:13): [True: 2.86M, False: 1.24M]
  ------------------
  239|  2.86M|          if (pstr_sbr->enc_env_data.add_harmonic[j]) {
  ------------------
  |  Branch (239:15): [True: 781k, False: 2.08M]
  ------------------
  240|   781k|            missing_harmonic = 1;
  241|   781k|          }
  242|  2.86M|        } else {
  243|  1.24M|          WORD32 band;
  244|  1.24M|          WORD32 start_band_high = 0;
  245|  1.24M|          WORD32 stop_band_high = 0;
  246|       |
  247|  7.94M|          while (pstr_sbr_cfg->ptr_freq_band_tab[FREQ_RES_HIGH][start_band_high] <
  ------------------
  |  Branch (247:18): [True: 6.70M, False: 1.24M]
  ------------------
  248|  7.94M|                 pstr_sbr_cfg->ptr_freq_band_tab[FREQ_RES_LOW][j]) {
  249|  6.70M|            start_band_high++;
  250|  6.70M|          }
  251|       |
  252|  10.4M|          while (pstr_sbr_cfg->ptr_freq_band_tab[FREQ_RES_HIGH][stop_band_high] <
  ------------------
  |  Branch (252:18): [True: 9.18M, False: 1.24M]
  ------------------
  253|  10.4M|                 pstr_sbr_cfg->ptr_freq_band_tab[FREQ_RES_LOW][j + 1]) {
  254|  9.18M|            stop_band_high++;
  255|  9.18M|          }
  256|       |
  257|  3.72M|          for (band = start_band_high; band < stop_band_high; band++) {
  ------------------
  |  Branch (257:40): [True: 2.48M, False: 1.24M]
  ------------------
  258|  2.48M|            if (pstr_sbr->enc_env_data.add_harmonic[band]) {
  ------------------
  |  Branch (258:17): [True: 595k, False: 1.88M]
  ------------------
  259|   595k|              missing_harmonic = 1;
  260|   595k|            }
  261|  2.48M|          }
  262|  1.24M|        }
  263|  4.10M|      }
  264|       |
  265|  11.9M|      if (missing_harmonic) {
  ------------------
  |  Branch (265:11): [True: 1.32M, False: 10.6M]
  ------------------
  266|  1.32M|        count = stop_pos - start_pos;
  267|  12.6M|        for (l = start_pos; l < stop_pos; l++) {
  ------------------
  |  Branch (267:29): [True: 11.2M, False: 1.32M]
  ------------------
  268|  11.2M|          if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (268:15): [True: 1.44M, False: 9.85M]
  ------------------
  269|  1.44M|            energy_left += ptr_y_buf_left[l >> 1][li];
  270|  9.85M|          } else {
  271|  9.85M|            energy_left += ptr_y_buf_left[l][li];
  272|  9.85M|          }
  273|  11.2M|        }
  274|       |
  275|  1.32M|        k = li + 1;
  276|  3.71M|        while (k < ui) {
  ------------------
  |  Branch (276:16): [True: 2.38M, False: 1.32M]
  ------------------
  277|  2.38M|          tmp_ene_l = 0.0f;
  278|  18.7M|          for (l = start_pos; l < stop_pos; l++) {
  ------------------
  |  Branch (278:31): [True: 16.3M, False: 2.38M]
  ------------------
  279|  16.3M|            if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (279:17): [True: 3.20M, False: 13.1M]
  ------------------
  280|  3.20M|              tmp_ene_l += ptr_y_buf_left[l >> 1][k];
  281|  13.1M|            } else {
  282|  13.1M|              tmp_ene_l += ptr_y_buf_left[l][k];
  283|  13.1M|            }
  284|  16.3M|          }
  285|       |
  286|  2.38M|          if (tmp_ene_l > energy_left) {
  ------------------
  |  Branch (286:15): [True: 511k, False: 1.87M]
  ------------------
  287|   511k|            energy_left = tmp_ene_l;
  288|   511k|          }
  289|  2.38M|          k++;
  290|  2.38M|        }
  291|       |
  292|  1.32M|        if (ui - li > 2) {
  ------------------
  |  Branch (292:13): [True: 544k, False: 781k]
  ------------------
  293|   544k|          energy_left = energy_left * 0.398107267f;
  294|   781k|        } else {
  295|   781k|          if (ui - li > 1) {
  ------------------
  |  Branch (295:15): [True: 590k, False: 190k]
  ------------------
  296|   590k|            energy_left = energy_left * 0.5f;
  297|   590k|          }
  298|   781k|        }
  299|       |
  300|  1.32M|        if (stereo_mode == SBR_COUPLING) {
  ------------------
  |  Branch (300:13): [True: 192k, False: 1.13M]
  ------------------
  301|  1.79M|          for (l = start_pos; l < stop_pos; l++) {
  ------------------
  |  Branch (301:31): [True: 1.60M, False: 192k]
  ------------------
  302|  1.60M|            if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (302:17): [True: 320k, False: 1.28M]
  ------------------
  303|   320k|              energy_right += ptr_y_buf_right[l >> 1][li];
  304|  1.28M|            } else {
  305|  1.28M|              energy_right += ptr_y_buf_right[l][li];
  306|  1.28M|            }
  307|  1.60M|          }
  308|       |
  309|   192k|          k = li + 1;
  310|   538k|          while (k < ui) {
  ------------------
  |  Branch (310:18): [True: 346k, False: 192k]
  ------------------
  311|   346k|            tmp_ene_r = 0.0f;
  312|  2.73M|            for (l = start_pos; l < stop_pos; l++) {
  ------------------
  |  Branch (312:33): [True: 2.39M, False: 346k]
  ------------------
  313|  2.39M|              if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (313:19): [True: 731k, False: 1.66M]
  ------------------
  314|   731k|                tmp_ene_r += ptr_y_buf_right[l >> 1][k];
  315|  1.66M|              } else {
  316|  1.66M|                tmp_ene_r += ptr_y_buf_right[l][k];
  317|  1.66M|              }
  318|  2.39M|            }
  319|       |
  320|   346k|            if (tmp_ene_r > energy_right) {
  ------------------
  |  Branch (320:17): [True: 63.2k, False: 282k]
  ------------------
  321|  63.2k|              energy_right = tmp_ene_r;
  322|  63.2k|            }
  323|   346k|            k++;
  324|   346k|          }
  325|       |
  326|   192k|          if (ui - li > 2) {
  ------------------
  |  Branch (326:15): [True: 77.8k, False: 114k]
  ------------------
  327|  77.8k|            energy_right = energy_right * 0.398107267f;
  328|   114k|          } else {
  329|   114k|            if (ui - li > 1) {
  ------------------
  |  Branch (329:17): [True: 88.0k, False: 26.2k]
  ------------------
  330|  88.0k|              energy_right = energy_right * 0.5f;
  331|  88.0k|            }
  332|   114k|          }
  333|   192k|          tmp_ene_l = energy_left;
  334|   192k|          energy_left = (energy_left + energy_right) * 0.5f;
  335|   192k|          energy_right = ((tmp_ene_l * time_step) + 1) / ((energy_right * time_step) + 1);
  336|   192k|        }
  337|  10.6M|      } else {
  338|  10.6M|        count = (stop_pos - start_pos) * (ui - li);
  339|       |
  340|  10.6M|        k = li;
  341|  40.3M|        while (k < ui) {
  ------------------
  |  Branch (341:16): [True: 29.7M, False: 10.6M]
  ------------------
  342|   306M|          for (l = start_pos; l < stop_pos; l++) {
  ------------------
  |  Branch (342:31): [True: 276M, False: 29.7M]
  ------------------
  343|   276M|            energy_left += ptr_y_buf_left[l][k];
  344|   276M|          }
  345|  29.7M|          k++;
  346|  29.7M|        }
  347|       |
  348|  10.6M|        if (stereo_mode == SBR_COUPLING) {
  ------------------
  |  Branch (348:13): [True: 1.33M, False: 9.29M]
  ------------------
  349|  1.33M|          k = li;
  350|  5.16M|          while (k < ui) {
  ------------------
  |  Branch (350:18): [True: 3.83M, False: 1.33M]
  ------------------
  351|  37.3M|            for (l = start_pos; l < stop_pos; l++) {
  ------------------
  |  Branch (351:33): [True: 33.5M, False: 3.83M]
  ------------------
  352|  33.5M|              if (pstr_sbr_cfg->is_ld_sbr) {
  ------------------
  |  Branch (352:19): [True: 8.68M, False: 24.8M]
  ------------------
  353|  8.68M|                energy_right += ptr_y_buf_right[l >> 1][k];
  354|  24.8M|              } else {
  355|  24.8M|                energy_right += ptr_y_buf_right[l][k];
  356|  24.8M|              }
  357|  33.5M|            }
  358|  3.83M|            k++;
  359|  3.83M|          }
  360|  1.33M|          tmp_ene_l = energy_left;
  361|  1.33M|          energy_left = (energy_left + energy_right) * 0.5f;
  362|  1.33M|          energy_right = ((tmp_ene_l * time_step) + 1) / ((energy_right * time_step) + 1);
  363|  1.33M|        }
  364|  10.6M|      }
  365|       |
  366|  11.9M|      energy_left = (FLOAT32)(log((energy_left / (count * 64)) + EPS) * SBR_INV_LOG_2);
  ------------------
  |  |   33|  11.9M|#define EPS (1e-18)
  ------------------
                    energy_left = (FLOAT32)(log((energy_left / (count * 64)) + EPS) * SBR_INV_LOG_2);
  ------------------
  |  |   38|  11.9M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  367|       |
  368|  11.9M|      if (energy_left < 0.0f) {
  ------------------
  |  Branch (368:11): [True: 4.34M, False: 7.61M]
  ------------------
  369|  4.34M|        energy_left = 0.0f;
  370|  4.34M|      }
  371|       |
  372|  11.9M|      ptr_sfb_ene_l[m] = (WORD32)(ca * energy_left + 0.5);
  373|       |
  374|  11.9M|      if (stereo_mode == SBR_COUPLING) {
  ------------------
  |  Branch (374:11): [True: 1.52M, False: 10.4M]
  ------------------
  375|  1.52M|        WORD32 quant_err;
  376|  1.52M|        energy_right = (FLOAT32)(log(energy_right) * SBR_INV_LOG_2);
  ------------------
  |  |   38|  1.52M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  377|  1.52M|        ptr_sfb_ene_r[m] =
  378|  1.52M|            ixheaace_map_panorama((WORD32)((FLOAT32)ca * energy_right),
  379|  1.52M|                                  pstr_sbr->enc_env_data.init_sbr_amp_res, &quant_err);
  380|  1.52M|        if (quant_err > *ptr_max_quant_err) {
  ------------------
  |  Branch (380:13): [True: 30.0k, False: 1.49M]
  ------------------
  381|  30.0k|          *ptr_max_quant_err = quant_err;
  382|  30.0k|        }
  383|  1.52M|      }
  384|  11.9M|      m++;
  385|  11.9M|    }
  386|       |
  387|  1.14M|    if (pstr_sbr_cfg->use_parametric_coding) {
  ------------------
  |  Branch (387:9): [True: 974k, False: 173k]
  ------------------
  388|   974k|      m -= num_bands;
  389|       |
  390|  11.7M|      for (j = 0; j < num_bands; j++) {
  ------------------
  |  Branch (390:19): [True: 10.7M, False: 974k]
  ------------------
  391|  10.7M|        if (freq_res == FREQ_RES_HIGH && pstr_sbr->str_sbr_extract_env.envelope_compensation[j]) {
  ------------------
  |  Branch (391:13): [True: 8.63M, False: 2.16M]
  |  Branch (391:42): [True: 315k, False: 8.31M]
  ------------------
  392|   315k|          ptr_sfb_ene_l[m] -=
  393|   315k|              (WORD32)(ca *
  394|   315k|                       ixheaac_abs32(pstr_sbr->str_sbr_extract_env.envelope_compensation[j]));
  395|   315k|        }
  396|       |
  397|  10.7M|        if (ptr_sfb_ene_l[m] < 0) {
  ------------------
  |  Branch (397:13): [True: 138k, False: 10.6M]
  ------------------
  398|   138k|          ptr_sfb_ene_l[m] = 0;
  399|   138k|        }
  400|  10.7M|        m++;
  401|  10.7M|      }
  402|   974k|    }
  403|  1.14M|    i++;
  404|  1.14M|  }
  405|   672k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   672k|#define IA_NO_ERROR 0x00000000
  ------------------
  406|   672k|}
ixheaace_sbr_env_est.c:ixheaace_map_panorama:
  109|  2.45M|static WORD32 ixheaace_map_panorama(WORD32 nrg_val, WORD32 amp_res, WORD32 *ptr_quant_error) {
  110|  2.45M|  WORD32 i = 0;
  111|  2.45M|  ;
  112|  2.45M|  WORD32 min_val, val;
  113|  2.45M|  WORD32 pan_tab[2][10] = {{0, 2, 4, 6, 8, 12, 16, 20, 24}, {0, 2, 4, 8, 12}};
  114|  2.45M|  WORD32 max_index[2] = {9, 5};
  115|       |
  116|  2.45M|  WORD32 pan_index;
  117|  2.45M|  WORD32 sign;
  118|       |
  119|  2.45M|  sign = nrg_val > 0 ? 1 : -1;
  ------------------
  |  Branch (119:10): [True: 143k, False: 2.30M]
  ------------------
  120|       |
  121|  2.45M|  nrg_val = sign * nrg_val;
  122|       |
  123|  2.45M|  min_val = INT_MAX;
  124|  2.45M|  pan_index = 0;
  125|       |
  126|  16.4M|  while (i < max_index[amp_res]) {
  ------------------
  |  Branch (126:10): [True: 14.0M, False: 2.45M]
  ------------------
  127|  14.0M|    val = ixheaac_abs32(nrg_val - pan_tab[amp_res][i]);
  128|  14.0M|    if (val < min_val) {
  ------------------
  |  Branch (128:9): [True: 2.82M, False: 11.2M]
  ------------------
  129|  2.82M|      min_val = val;
  130|  2.82M|      pan_index = i;
  131|  2.82M|    }
  132|  14.0M|    i++;
  133|  14.0M|  }
  134|       |
  135|  2.45M|  *ptr_quant_error = min_val;
  136|       |
  137|  2.45M|  return pan_tab[amp_res][max_index[amp_res] - 1] + sign * pan_tab[amp_res][pan_index];
  138|  2.45M|}
ixheaace_sbr_env_est.c:ixheaace_sbr_noise_floor_levels_quantisation:
  142|   764k|                                                         WORD32 coupling) {
  143|   764k|  WORD32 i = 0;
  144|   764k|  WORD32 dummy;
  145|       |
  146|  8.41M|  while (i < MAXIMUM_NUM_NOISE_VALUES) {
  ------------------
  |  |   58|  8.41M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  8.41M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  8.41M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (146:10): [True: 7.64M, False: 764k]
  ------------------
  147|  7.64M|    WORD32 tmp;
  148|       |
  149|  7.64M|    tmp = ptr_flt_noise_levels[i] > 30.0f ? 30 : (WORD32)(ptr_flt_noise_levels[i] + 0.5f);
  ------------------
  |  Branch (149:11): [True: 97.4k, False: 7.55M]
  ------------------
  150|       |
  151|  7.64M|    if (coupling) {
  ------------------
  |  Branch (151:9): [True: 924k, False: 6.72M]
  ------------------
  152|   924k|      tmp = tmp < -30 ? -30 : tmp;
  ------------------
  |  Branch (152:13): [True: 0, False: 924k]
  ------------------
  153|   924k|      tmp = ixheaace_map_panorama(tmp, 1, &dummy);
  154|   924k|    }
  155|  7.64M|    ptr_noise_levels[i] = tmp;
  156|       |
  157|  7.64M|    i++;
  158|  7.64M|  }
  159|   764k|}
ixheaace_sbr_env_est.c:ixheaace_couple_noise_floor:
  162|  92.4k|                                        FLOAT32 *ptr_noise_lvl_right) {
  163|  92.4k|  WORD32 i = 0;
  164|       |
  165|  1.01M|  while (i < MAXIMUM_NUM_NOISE_VALUES) {
  ------------------
  |  |   58|  1.01M|#define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   56|  1.01M|#define MAXIMUM_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define MAXIMUM_NUM_NOISE_VALUES (MAXIMUM_NOISE_ENVELOPES * MAXIMUM_NUM_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   57|  1.01M|#define MAXIMUM_NUM_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
  |  Branch (165:10): [True: 924k, False: 92.4k]
  ------------------
  166|   924k|    FLOAT32 pow_left, pow_right;
  167|       |
  168|   924k|    pow_left = (FLOAT32)pow(2.0f, (SBR_NOISE_FLOOR_OFFSET - ptr_noise_lvl_left[i]));
  ------------------
  |  |   37|   924k|#define SBR_NOISE_FLOOR_OFFSET (6)
  ------------------
  169|   924k|    pow_right = (FLOAT32)pow(2.0f, (SBR_NOISE_FLOOR_OFFSET - ptr_noise_lvl_right[i]));
  ------------------
  |  |   37|   924k|#define SBR_NOISE_FLOOR_OFFSET (6)
  ------------------
  170|       |
  171|   924k|    ptr_noise_lvl_right[i] -= ptr_noise_lvl_left[i];
  172|   924k|    ptr_noise_lvl_left[i] =
  173|   924k|        (FLOAT32)(SBR_NOISE_FLOOR_OFFSET - log((pow_left * pow_right) / 2) * SBR_INV_LOG_2);
  ------------------
  |  |   37|   924k|#define SBR_NOISE_FLOOR_OFFSET (6)
  ------------------
                      (FLOAT32)(SBR_NOISE_FLOOR_OFFSET - log((pow_left * pow_right) / 2) * SBR_INV_LOG_2);
  ------------------
  |  |   38|   924k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  174|   924k|    i++;
  175|   924k|  }
  176|  92.4k|}
ixheaace_sbr_env_est.c:ixheaace_update_esbr_ext_data:
  582|  58.9k|    WORD32 num_samples) {
  583|  58.9k|  WORD32 bin, bin1;
  584|  58.9k|  const WORD32 *ptr_sbr_table = NULL;
  585|  58.9k|  FLOAT32 *ptr_esbr_inp = ptr_esbr_scr;
  586|  58.9k|  ptr_esbr_scr += num_samples * 2;
  587|  58.9k|  FLOAT32 *ptr_scratch_fft = ptr_esbr_scr;
  588|  58.9k|  WORD32 idx;
  589|  58.9k|  switch (pstr_sbr_cfg->sample_freq) {
  590|      0|    case 16000:
  ------------------
  |  Branch (590:5): [True: 0, False: 58.9k]
  ------------------
  591|      0|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_8k;
  592|      0|      break;
  593|      0|    case 22050:
  ------------------
  |  Branch (593:5): [True: 0, False: 58.9k]
  ------------------
  594|      0|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_11k;
  595|      0|      break;
  596|      0|    case 24000:
  ------------------
  |  Branch (596:5): [True: 0, False: 58.9k]
  ------------------
  597|      0|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_12k;
  598|      0|      break;
  599|  23.2k|    case 32000:
  ------------------
  |  Branch (599:5): [True: 23.2k, False: 35.6k]
  ------------------
  600|  23.2k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_16k;
  601|  23.2k|      break;
  602|  23.5k|    case 44100:
  ------------------
  |  Branch (602:5): [True: 23.5k, False: 35.3k]
  ------------------
  603|  23.5k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_22k;
  604|  23.5k|      break;
  605|  12.0k|    case 48000:
  ------------------
  |  Branch (605:5): [True: 12.0k, False: 46.8k]
  ------------------
  606|  12.0k|      ptr_sbr_table = ptr_sbr_tab->ptr_esbr_sfb_tab->sfb_bins_24k;
  607|  12.0k|      break;
  608|      0|    default:
  ------------------
  |  Branch (608:5): [True: 0, False: 58.9k]
  ------------------
  609|      0|      return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_SAMP_FREQ;
  610|  58.9k|  }
  611|  58.9k|  if (1 == pstr_sbr_cfg->num_ch) {
  ------------------
  |  Branch (611:7): [True: 34.4k, False: 24.5k]
  ------------------
  612|  35.2M|    for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (612:19): [True: 35.2M, False: 34.4k]
  ------------------
  613|  35.2M|      ptr_esbr_inp[idx] = ptr_time_in[time_sn_stride * idx];
  614|  35.2M|      ptr_esbr_inp[idx + 1] = 0;
  615|  35.2M|      ptr_esbr_inp[num_samples + idx] = ptr_time_in[time_sn_stride * (idx + 1)];
  616|  35.2M|      ptr_esbr_inp[num_samples + idx + 1] = 0;
  617|  35.2M|    }
  618|  34.4k|    iusace_complex_fft_2048(ptr_esbr_inp, ptr_scratch_fft);
  619|  34.4k|    bin = ixheaace_get_pitch_bin(ptr_esbr_inp, ptr_sbr_table, 0);
  620|  34.4k|    pstr_esbr->sbr_num_chan = 1;
  621|  34.4k|    if (transient_info[0][1] != 0) {
  ------------------
  |  Branch (621:9): [True: 11.0k, False: 23.3k]
  ------------------
  622|  11.0k|      pstr_esbr->sbr_preprocessing = 1;
  623|  23.3k|    } else {
  624|  23.3k|      pstr_esbr->sbr_preprocessing = 0;
  625|  23.3k|    }
  626|       |
  627|  34.4k|    if (transient_info[0][1] != 0 && bin != -1) {
  ------------------
  |  Branch (627:9): [True: 11.0k, False: 23.3k]
  |  Branch (627:38): [True: 7.31k, False: 3.75k]
  ------------------
  628|  7.31k|      pstr_esbr->sbr_oversampling_flag[0] = 1;
  629|  7.31k|      pstr_esbr->sbr_patching_mode[0] = 0;
  630|  7.31k|      pstr_esbr->sbr_pitchin_flags[0] = 1;
  631|  7.31k|      pstr_esbr->sbr_pitchin_bins[0] = (UWORD8)MIN(bin, 127);
  ------------------
  |  |   23|  7.31k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.31k, False: 0]
  |  |  ------------------
  ------------------
  632|  27.0k|    } else if (bin != -1) {
  ------------------
  |  Branch (632:16): [True: 13.9k, False: 13.1k]
  ------------------
  633|  13.9k|      pstr_esbr->sbr_oversampling_flag[0] = 0;
  634|  13.9k|      pstr_esbr->sbr_patching_mode[0] = 0;
  635|  13.9k|      pstr_esbr->sbr_pitchin_flags[0] = 1;
  636|  13.9k|      pstr_esbr->sbr_pitchin_bins[0] = (UWORD8)MIN(bin, 127);
  ------------------
  |  |   23|  13.9k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 13.9k, False: 0]
  |  |  ------------------
  ------------------
  637|  13.9k|    } else if (transient_info[0][1] != 0) {
  ------------------
  |  Branch (637:16): [True: 3.75k, False: 9.39k]
  ------------------
  638|  3.75k|      pstr_esbr->sbr_oversampling_flag[0] = 1;
  639|  3.75k|      pstr_esbr->sbr_patching_mode[0] = 0;
  640|  3.75k|      pstr_esbr->sbr_pitchin_flags[0] = 0;
  641|  9.39k|    } else {
  642|  9.39k|      pstr_esbr->sbr_patching_mode[0] = 1;
  643|  9.39k|    }
  644|  34.4k|  } else {
  645|  24.5k|    pstr_esbr->sbr_num_chan = 2;
  646|  24.5k|    pstr_esbr->sbr_coupling = coupling;
  647|  25.1M|    for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (647:19): [True: 25.0M, False: 24.5k]
  ------------------
  648|  25.0M|      ptr_esbr_inp[idx] = ptr_time_in[2 * idx];
  649|  25.0M|      ptr_esbr_inp[idx + 1] = 0;
  650|  25.0M|      ptr_esbr_inp[num_samples + idx] = ptr_time_in[2 * idx + 2];
  651|  25.0M|      ptr_esbr_inp[num_samples + idx + 1] = 0;
  652|  25.0M|    }
  653|  24.5k|    iusace_complex_fft_2048(ptr_esbr_inp, ptr_scratch_fft);
  654|  24.5k|    bin = ixheaace_get_pitch_bin(ptr_esbr_inp, ptr_sbr_table, 0);
  655|  25.1M|    for (idx = 0; idx < num_samples; idx += 2) {
  ------------------
  |  Branch (655:19): [True: 25.0M, False: 24.5k]
  ------------------
  656|  25.0M|      ptr_esbr_inp[idx] = ptr_time_in[2 * idx + 1];
  657|  25.0M|      ptr_esbr_inp[idx + 1] = 0;
  658|  25.0M|      ptr_esbr_inp[num_samples + idx] = ptr_time_in[2 * idx + 3];
  659|  25.0M|      ptr_esbr_inp[num_samples + idx + 1] = 0;
  660|  25.0M|    }
  661|  24.5k|    iusace_complex_fft_2048(ptr_esbr_inp, ptr_scratch_fft);
  662|  24.5k|    bin1 = ixheaace_get_pitch_bin(ptr_esbr_inp, ptr_sbr_table, 0);
  663|       |
  664|  24.5k|    if (coupling) {
  ------------------
  |  Branch (664:9): [True: 12.9k, False: 11.5k]
  ------------------
  665|  12.9k|      if ((transient_info[0][1] != 0 || transient_info[1][1] != 0)) {
  ------------------
  |  Branch (665:12): [True: 2.97k, False: 10.0k]
  |  Branch (665:41): [True: 0, False: 10.0k]
  ------------------
  666|  2.97k|        pstr_esbr->sbr_preprocessing = 1;
  667|  10.0k|      } else {
  668|  10.0k|        pstr_esbr->sbr_preprocessing = 0;
  669|  10.0k|      }
  670|  12.9k|      if ((transient_info[0][1] != 0 || transient_info[1][1] != 0) && bin != -1) {
  ------------------
  |  Branch (670:12): [True: 2.97k, False: 10.0k]
  |  Branch (670:41): [True: 0, False: 10.0k]
  |  Branch (670:71): [True: 2.68k, False: 290]
  ------------------
  671|  2.68k|        pstr_esbr->sbr_oversampling_flag[0] = 1;
  672|  2.68k|        pstr_esbr->sbr_patching_mode[0] = 0;
  673|  2.68k|        pstr_esbr->sbr_pitchin_flags[0] = 1;
  674|  2.68k|        bin = MIN(bin, bin1);
  ------------------
  |  |   23|  2.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3, False: 2.68k]
  |  |  ------------------
  ------------------
  675|  2.68k|        pstr_esbr->sbr_pitchin_bins[0] = (UWORD8)MIN(bin, 127);
  ------------------
  |  |   23|  2.68k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.68k, False: 0]
  |  |  ------------------
  ------------------
  676|  10.3k|      } else if (bin != -1) {
  ------------------
  |  Branch (676:18): [True: 6.26k, False: 4.03k]
  ------------------
  677|  6.26k|        pstr_esbr->sbr_oversampling_flag[0] = 0;
  678|  6.26k|        pstr_esbr->sbr_patching_mode[0] = 0;
  679|  6.26k|        pstr_esbr->sbr_pitchin_flags[0] = 1;
  680|  6.26k|        bin = MIN(bin, bin1);
  ------------------
  |  |   23|  6.26k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7, False: 6.25k]
  |  |  ------------------
  ------------------
  681|  6.26k|        pstr_esbr->sbr_pitchin_bins[0] = (UWORD8)MIN(bin, 127);
  ------------------
  |  |   23|  6.26k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 6.26k, False: 0]
  |  |  ------------------
  ------------------
  682|  6.26k|      } else if ((transient_info[0][1] != 0 || transient_info[1][1] != 0)) {
  ------------------
  |  Branch (682:19): [True: 290, False: 3.74k]
  |  Branch (682:48): [True: 0, False: 3.74k]
  ------------------
  683|    290|        pstr_esbr->sbr_oversampling_flag[0] = 1;
  684|    290|        pstr_esbr->sbr_patching_mode[0] = 0;
  685|    290|        pstr_esbr->sbr_pitchin_flags[0] = 0;
  686|  3.74k|      } else {
  687|  3.74k|        pstr_esbr->sbr_patching_mode[0] = 1;
  688|  3.74k|      }
  689|  12.9k|    } else {
  690|  11.5k|      pstr_esbr->sbr_preprocessing = 0;
  691|  11.5k|      if ((transient_info[0][1] != 0 || transient_info[1][1] != 0)) {
  ------------------
  |  Branch (691:12): [True: 2.89k, False: 8.61k]
  |  Branch (691:41): [True: 755, False: 7.85k]
  ------------------
  692|  3.65k|        pstr_esbr->sbr_preprocessing = 1;
  693|  3.65k|      }
  694|       |
  695|  11.5k|      if (transient_info[0][1] != 0 && bin != -1) {
  ------------------
  |  Branch (695:11): [True: 2.89k, False: 8.61k]
  |  Branch (695:40): [True: 2.23k, False: 665]
  ------------------
  696|  2.23k|        pstr_esbr->sbr_oversampling_flag[0] = 1;
  697|  2.23k|        pstr_esbr->sbr_patching_mode[0] = 0;
  698|  2.23k|        pstr_esbr->sbr_pitchin_flags[0] = 1;
  699|  2.23k|        bin = MIN(bin, bin1);
  ------------------
  |  |   23|  2.23k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 5, False: 2.22k]
  |  |  ------------------
  ------------------
  700|  2.23k|        pstr_esbr->sbr_pitchin_bins[0] = (UWORD8)MIN(bin, 127);
  ------------------
  |  |   23|  2.23k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.23k, False: 0]
  |  |  ------------------
  ------------------
  701|  9.27k|      } else if (bin != -1) {
  ------------------
  |  Branch (701:18): [True: 2.89k, False: 6.38k]
  ------------------
  702|  2.89k|        pstr_esbr->sbr_oversampling_flag[0] = 0;
  703|  2.89k|        pstr_esbr->sbr_patching_mode[0] = 0;
  704|  2.89k|        pstr_esbr->sbr_pitchin_flags[0] = 1;
  705|  2.89k|        pstr_esbr->sbr_pitchin_bins[0] = (UWORD8)MIN(bin, 127);
  ------------------
  |  |   23|  2.89k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.89k, False: 0]
  |  |  ------------------
  ------------------
  706|  6.38k|      } else if (transient_info[0][1] != 0) {
  ------------------
  |  Branch (706:18): [True: 665, False: 5.72k]
  ------------------
  707|    665|        pstr_esbr->sbr_oversampling_flag[0] = 1;
  708|    665|        pstr_esbr->sbr_patching_mode[0] = 0;
  709|    665|        pstr_esbr->sbr_pitchin_flags[0] = 0;
  710|  5.72k|      } else {
  711|  5.72k|        pstr_esbr->sbr_patching_mode[0] = 1;
  712|  5.72k|      }
  713|       |
  714|  11.5k|      if (transient_info[1][1] != 0 && bin1 != -1) {
  ------------------
  |  Branch (714:11): [True: 3.40k, False: 8.10k]
  |  Branch (714:40): [True: 2.24k, False: 1.16k]
  ------------------
  715|  2.24k|        pstr_esbr->sbr_oversampling_flag[1] = 1;
  716|  2.24k|        pstr_esbr->sbr_patching_mode[1] = 0;
  717|  2.24k|        pstr_esbr->sbr_pitchin_flags[1] = 1;
  718|  2.24k|        pstr_esbr->sbr_pitchin_bins[1] = (UWORD8)MIN(bin1, 127);
  ------------------
  |  |   23|  2.24k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.24k, False: 0]
  |  |  ------------------
  ------------------
  719|  9.27k|      } else if (bin1 != -1) {
  ------------------
  |  Branch (719:18): [True: 2.86k, False: 6.40k]
  ------------------
  720|  2.86k|        pstr_esbr->sbr_oversampling_flag[1] = 0;
  721|  2.86k|        pstr_esbr->sbr_patching_mode[1] = 0;
  722|  2.86k|        pstr_esbr->sbr_pitchin_flags[1] = 1;
  723|  2.86k|        pstr_esbr->sbr_pitchin_bins[1] = (UWORD8)MIN(bin1, 127);
  ------------------
  |  |   23|  2.86k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.86k, False: 0]
  |  |  ------------------
  ------------------
  724|  6.40k|      } else if (transient_info[1][1] != 0) {
  ------------------
  |  Branch (724:18): [True: 1.16k, False: 5.23k]
  ------------------
  725|  1.16k|        pstr_esbr->sbr_oversampling_flag[1] = 1;
  726|  1.16k|        pstr_esbr->sbr_patching_mode[1] = 0;
  727|  1.16k|        pstr_esbr->sbr_pitchin_flags[1] = 0;
  728|  5.23k|      } else {
  729|  5.23k|        pstr_esbr->sbr_patching_mode[1] = 1;
  730|  5.23k|      }
  731|  11.5k|    }
  732|  24.5k|  }
  733|  58.9k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  58.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  734|  58.9k|}
ixheaace_sbr_env_est.c:ixheaace_update_harmonic_sbr_data:
  738|   107k|    ixheaace_pstr_enc_channel *pstr_enc_ch, WORD32 num_channels) {
  739|   107k|  WORD32 bin, bin1;
  740|   107k|  struct ixheaace_str_sbr_env_data *pstr_sbr_env_left = NULL;
  741|   107k|  struct ixheaace_str_sbr_env_data *pstr_sbr_env_right = NULL;
  742|   107k|  if (1 == num_channels) {
  ------------------
  |  Branch (742:7): [True: 69.4k, False: 38.1k]
  ------------------
  743|  69.4k|    pstr_sbr_env_left = &pstr_enc_ch[0]->enc_env_data;
  744|  69.4k|    bin = pstr_sbr_env_left->sbr_pitchin_bins;
  745|  69.4k|    if (transient_info[0][1] != 0) {
  ------------------
  |  Branch (745:9): [True: 0, False: 69.4k]
  ------------------
  746|      0|      pstr_sbr_env_left->sbr_preprocessing = 1;
  747|  69.4k|    } else {
  748|  69.4k|      pstr_sbr_env_left->sbr_preprocessing = 0;
  749|  69.4k|    }
  750|       |
  751|  69.4k|    if (transient_info[0][1] != 0 && bin != -1) {
  ------------------
  |  Branch (751:9): [True: 0, False: 69.4k]
  |  Branch (751:38): [True: 0, False: 0]
  ------------------
  752|      0|      pstr_sbr_env_left->sbr_oversampling_flag = 1;
  753|      0|      pstr_sbr_env_left->sbr_patching_mode = 0;
  754|      0|      pstr_sbr_env_left->sbr_pitchin_bins_flag = 1;
  755|      0|      pstr_sbr_env_left->sbr_pitchin_bins = min(bin, 127);
  ------------------
  |  |   75|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  756|  69.4k|    } else if (bin != -1) {
  ------------------
  |  Branch (756:16): [True: 58.9k, False: 10.5k]
  ------------------
  757|  58.9k|      pstr_sbr_env_left->sbr_oversampling_flag = 0;
  758|  58.9k|      pstr_sbr_env_left->sbr_patching_mode = 0;
  759|  58.9k|      pstr_sbr_env_left->sbr_pitchin_bins_flag = 1;
  760|  58.9k|      pstr_sbr_env_left->sbr_pitchin_bins = min(bin, 127);
  ------------------
  |  |   75|  58.9k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 58.9k, False: 0]
  |  |  ------------------
  ------------------
  761|  58.9k|    } else if (transient_info[0][1] != 0) {
  ------------------
  |  Branch (761:16): [True: 0, False: 10.5k]
  ------------------
  762|      0|      pstr_sbr_env_left->sbr_oversampling_flag = 1;
  763|      0|      pstr_sbr_env_left->sbr_patching_mode = 0;
  764|      0|      pstr_sbr_env_left->sbr_pitchin_bins = 0;
  765|  10.5k|    } else {
  766|  10.5k|      pstr_sbr_env_left->sbr_patching_mode = 1;
  767|  10.5k|    }
  768|  69.4k|  } else {
  769|  38.1k|    pstr_sbr_env_left = &pstr_enc_ch[0]->enc_env_data;
  770|  38.1k|    pstr_sbr_env_right = &pstr_enc_ch[1]->enc_env_data;
  771|  38.1k|    pstr_sbr_env_left->sbr_coupling = coupling;
  772|  38.1k|    pstr_sbr_env_right->sbr_coupling = coupling;
  773|  38.1k|    bin = pstr_sbr_env_left->sbr_pitchin_bins;
  774|       |
  775|  38.1k|    bin1 = pstr_sbr_env_right->sbr_pitchin_bins;
  776|       |
  777|  38.1k|    if (coupling) {
  ------------------
  |  Branch (777:9): [True: 20.0k, False: 18.1k]
  ------------------
  778|  20.0k|      pstr_sbr_env_right->sbr_preprocessing = 1;
  779|  20.0k|      if ((transient_info[0][1] != 0 || transient_info[1][1] != 0)) {
  ------------------
  |  Branch (779:12): [True: 0, False: 20.0k]
  |  Branch (779:41): [True: 0, False: 20.0k]
  ------------------
  780|      0|        pstr_sbr_env_left->sbr_preprocessing = 1;
  781|  20.0k|      } else {
  782|  20.0k|        pstr_sbr_env_left->sbr_preprocessing = 0;
  783|  20.0k|      }
  784|  20.0k|      if ((transient_info[0][1] != 0 || transient_info[1][1] != 0) && bin != -1) {
  ------------------
  |  Branch (784:12): [True: 0, False: 20.0k]
  |  Branch (784:41): [True: 0, False: 20.0k]
  |  Branch (784:71): [True: 0, False: 0]
  ------------------
  785|      0|        pstr_sbr_env_left->sbr_oversampling_flag = 1;
  786|      0|        pstr_sbr_env_left->sbr_patching_mode = 0;
  787|      0|        pstr_sbr_env_left->sbr_pitchin_bins_flag = 1;
  788|      0|        bin = min(bin, bin1);
  ------------------
  |  |   75|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  789|      0|        pstr_sbr_env_left->sbr_pitchin_bins = min(bin, 127);
  ------------------
  |  |   75|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  790|  20.0k|      } else if (bin != -1) {
  ------------------
  |  Branch (790:18): [True: 17.7k, False: 2.27k]
  ------------------
  791|  17.7k|        pstr_sbr_env_left->sbr_oversampling_flag = 0;
  792|  17.7k|        pstr_sbr_env_left->sbr_patching_mode = 0;
  793|  17.7k|        pstr_sbr_env_left->sbr_pitchin_bins_flag = 1;
  794|  17.7k|        bin = min(bin, bin1);
  ------------------
  |  |   75|  17.7k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 12, False: 17.7k]
  |  |  ------------------
  ------------------
  795|  17.7k|        pstr_sbr_env_left->sbr_pitchin_bins = min(bin, 127);
  ------------------
  |  |   75|  17.7k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 17.7k, False: 0]
  |  |  ------------------
  ------------------
  796|  17.7k|      } else if ((transient_info[0][1] != 0 || transient_info[1][1] != 0)) {
  ------------------
  |  Branch (796:19): [True: 0, False: 2.27k]
  |  Branch (796:48): [True: 0, False: 2.27k]
  ------------------
  797|      0|        pstr_sbr_env_left->sbr_oversampling_flag = 1;
  798|      0|        pstr_sbr_env_left->sbr_patching_mode = 0;
  799|      0|        pstr_sbr_env_left->sbr_pitchin_bins_flag = 0;
  800|  2.27k|      } else {
  801|  2.27k|        pstr_sbr_env_left->sbr_patching_mode = 1;
  802|  2.27k|      }
  803|  20.0k|    } else {
  804|  18.1k|      pstr_sbr_env_left->sbr_preprocessing = 0;
  805|  18.1k|      pstr_sbr_env_right->sbr_preprocessing = 0;
  806|  18.1k|      if ((transient_info[0][1] != 0 || transient_info[1][1] != 0)) {
  ------------------
  |  Branch (806:12): [True: 0, False: 18.1k]
  |  Branch (806:41): [True: 0, False: 18.1k]
  ------------------
  807|      0|        pstr_sbr_env_left->sbr_preprocessing = 1;
  808|      0|        pstr_sbr_env_right->sbr_preprocessing = 1;
  809|      0|      }
  810|       |
  811|  18.1k|      if (transient_info[0][1] != 0 && bin != -1) {
  ------------------
  |  Branch (811:11): [True: 0, False: 18.1k]
  |  Branch (811:40): [True: 0, False: 0]
  ------------------
  812|      0|        pstr_sbr_env_left->sbr_oversampling_flag = 1;
  813|      0|        pstr_sbr_env_left->sbr_patching_mode = 0;
  814|      0|        pstr_sbr_env_left->sbr_pitchin_bins_flag = 1;
  815|      0|        bin = min(bin, bin1);
  ------------------
  |  |   75|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  816|      0|        pstr_sbr_env_left->sbr_pitchin_bins = min(bin, 127);
  ------------------
  |  |   75|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  817|  18.1k|      } else if (bin != -1) {
  ------------------
  |  Branch (817:18): [True: 16.2k, False: 1.88k]
  ------------------
  818|  16.2k|        pstr_sbr_env_left->sbr_oversampling_flag = 0;
  819|  16.2k|        pstr_sbr_env_left->sbr_patching_mode = 0;
  820|  16.2k|        pstr_sbr_env_left->sbr_pitchin_bins_flag = 1;
  821|  16.2k|        pstr_sbr_env_left->sbr_pitchin_bins = min(bin, 127);
  ------------------
  |  |   75|  16.2k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 16.2k, False: 0]
  |  |  ------------------
  ------------------
  822|  16.2k|      } else if (transient_info[0][1] != 0) {
  ------------------
  |  Branch (822:18): [True: 0, False: 1.88k]
  ------------------
  823|      0|        pstr_sbr_env_left->sbr_oversampling_flag = 1;
  824|      0|        pstr_sbr_env_left->sbr_patching_mode = 0;
  825|      0|        pstr_sbr_env_left->sbr_pitchin_bins_flag = 0;
  826|  1.88k|      } else {
  827|  1.88k|        pstr_sbr_env_left->sbr_patching_mode = 1;
  828|  1.88k|      }
  829|       |
  830|  18.1k|      if (transient_info[1][1] != 0 && bin1 != -1) {
  ------------------
  |  Branch (830:11): [True: 0, False: 18.1k]
  |  Branch (830:40): [True: 0, False: 0]
  ------------------
  831|      0|        pstr_sbr_env_right->sbr_oversampling_flag = 1;
  832|      0|        pstr_sbr_env_right->sbr_patching_mode = 0;
  833|      0|        pstr_sbr_env_right->sbr_pitchin_bins_flag = 1;
  834|      0|        pstr_sbr_env_right->sbr_pitchin_bins = bin1 < 127 ? bin1 : 127;
  ------------------
  |  Branch (834:48): [True: 0, False: 0]
  ------------------
  835|  18.1k|      } else if (bin1 != -1) {
  ------------------
  |  Branch (835:18): [True: 16.1k, False: 1.90k]
  ------------------
  836|  16.1k|        pstr_sbr_env_right->sbr_oversampling_flag = 0;
  837|  16.1k|        pstr_sbr_env_right->sbr_patching_mode = 0;
  838|  16.1k|        pstr_sbr_env_right->sbr_pitchin_bins_flag = 1;
  839|  16.1k|        pstr_sbr_env_right->sbr_pitchin_bins = bin1 < 127 ? bin1 : 127;
  ------------------
  |  Branch (839:48): [True: 16.1k, False: 0]
  ------------------
  840|  16.1k|      } else if (transient_info[1][1] != 0) {
  ------------------
  |  Branch (840:18): [True: 0, False: 1.90k]
  ------------------
  841|      0|        pstr_sbr_env_right->sbr_oversampling_flag = 1;
  842|      0|        pstr_sbr_env_right->sbr_patching_mode = 0;
  843|      0|        pstr_sbr_env_right->sbr_pitchin_bins_flag = 0;
  844|  1.90k|      } else {
  845|  1.90k|        pstr_sbr_env_right->sbr_patching_mode = 1;
  846|  1.90k|      }
  847|  18.1k|    }
  848|  38.1k|  }
  849|   107k|}

ixheaace_create_extract_sbr_envelope:
   65|  8.64k|                                     WORD32 frame_flag_480, ixheaace_sbr_codec_type sbr_codec) {
   66|  8.64k|  WORD32 i;
   67|  8.64k|  WORD32 y_buffer_length, r_buffer_length;
   68|  8.64k|  WORD32 offset = 0;
   69|  8.64k|  WORD32 y_buffer_write_offset = 32;
   70|  8.64k|  WORD32 no_cols = 32;
   71|  8.64k|  WORD32 time_slots = 16;
   72|  8.64k|  WORD32 sbr_ratio_idx = pstr_sbr_ext_env->sbr_ratio_idx;
   73|  8.64k|  WORD32 qmf_time_slots = IXHEAACE_QMF_TIME_SLOTS;
  ------------------
  |  |   69|  8.64k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
   74|  8.64k|  FLOAT32 *ptr_buffer = NULL;
   75|  8.64k|  FLOAT32 *ptr_i_buffer = NULL;
   76|  8.64k|  memset(pstr_sbr_ext_env, 0, sizeof(ixheaace_str_sbr_extr_env));
   77|       |
   78|  8.64k|  pstr_sbr_ext_env->pre_transient_info[0] = 0;
   79|  8.64k|  pstr_sbr_ext_env->pre_transient_info[1] = 0;
   80|       |
   81|  8.64k|  if (sbr_codec == ELD_SBR) {
  ------------------
  |  Branch (81:7): [True: 1.77k, False: 6.87k]
  ------------------
   82|  1.77k|    if (frame_flag_480) {
  ------------------
  |  Branch (82:9): [True: 806, False: 965]
  ------------------
   83|    806|      no_cols = 30;
   84|    806|      time_slots = 15;
   85|    806|    }
   86|       |
   87|  1.77k|    y_buffer_write_offset = time_slots / 2;
   88|  1.77k|    pstr_sbr_ext_env->y_buffer_write_offset = y_buffer_write_offset;
   89|  1.77k|    pstr_sbr_ext_env->no_cols = no_cols;
   90|  1.77k|    pstr_sbr_ext_env->no_rows = 64;
   91|  1.77k|    pstr_sbr_ext_env->start_index = start_index;
   92|  1.77k|    pstr_sbr_ext_env->time_slots = time_slots;
   93|  1.77k|    pstr_sbr_ext_env->time_step = 1;
   94|       |
   95|  1.77k|    y_buffer_length = y_buffer_write_offset + time_slots;
   96|  1.77k|    r_buffer_length = time_slots;
   97|  6.87k|  } else {
   98|  6.87k|    if ((sbr_codec == USAC_SBR) && (USAC_SBR_RATIO_INDEX_4_1 == sbr_ratio_idx)) {
  ------------------
  |  |  188|  3.97k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (98:9): [True: 3.97k, False: 2.89k]
  |  Branch (98:36): [True: 826, False: 3.14k]
  ------------------
   99|    826|      qmf_time_slots = QMF_TIME_SLOTS_USAC_4_1;
  ------------------
  |  |   74|    826|#define QMF_TIME_SLOTS_USAC_4_1 (64)
  ------------------
  100|    826|      y_buffer_write_offset = QMF_TIME_SLOTS_USAC_4_1;
  ------------------
  |  |   74|    826|#define QMF_TIME_SLOTS_USAC_4_1 (64)
  ------------------
  101|    826|      no_cols = qmf_time_slots;
  102|    826|    }
  103|       |
  104|  6.87k|    pstr_sbr_ext_env->y_buffer_write_offset = y_buffer_write_offset;
  105|       |
  106|  6.87k|    y_buffer_length = pstr_sbr_ext_env->y_buffer_write_offset + y_buffer_write_offset;
  107|       |
  108|  6.87k|    r_buffer_length = y_buffer_write_offset;
  109|       |
  110|  6.87k|    pstr_sbr_ext_env->pre_transient_info[0] = 0;
  111|  6.87k|    pstr_sbr_ext_env->pre_transient_info[1] = 0;
  112|       |
  113|  6.87k|    pstr_sbr_ext_env->no_cols = no_cols;
  114|  6.87k|    pstr_sbr_ext_env->no_rows = 64;
  115|  6.87k|    pstr_sbr_ext_env->start_index = start_index;
  116|       |
  117|  6.87k|    pstr_sbr_ext_env->time_slots = time_slots;
  118|  6.87k|    pstr_sbr_ext_env->time_step = no_cols / time_slots;
  119|       |
  120|  6.87k|    if ((r_buffer_length != qmf_time_slots) || (y_buffer_length != 2 * qmf_time_slots)) {
  ------------------
  |  Branch (120:9): [True: 0, False: 6.87k]
  |  Branch (120:48): [True: 0, False: 6.87k]
  ------------------
  121|      0|      return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_BUFFER_LENGTH;
  122|      0|    }
  123|       |
  124|  6.87k|    y_buffer_length /= 2;
  125|       |
  126|  6.87k|    if ((sbr_codec == USAC_SBR) && (USAC_SBR_RATIO_INDEX_4_1 == sbr_ratio_idx)) {
  ------------------
  |  |  188|  3.97k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (126:9): [True: 3.97k, False: 2.89k]
  |  Branch (126:36): [True: 826, False: 3.14k]
  ------------------
  127|    826|      pstr_sbr_ext_env->y_buffer_write_offset /= 4;
  128|  6.04k|    } else {
  129|  6.04k|      pstr_sbr_ext_env->y_buffer_write_offset /= 2;
  130|  6.04k|    }
  131|  6.87k|  }
  132|       |
  133|  8.64k|  pstr_sbr_ext_env->buffer_flag = 0;
  134|       |
  135|  8.64k|  ptr_buffer =
  136|  8.64k|      (FLOAT32 *)&ptr_common_buffer2[ch * y_buffer_length * 64 + offset * IXHEAACE_QMF_CHANNELS];
  ------------------
  |  |   66|  8.64k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  137|       |
  138|  8.64k|  i = 0;
  139|   131k|  while (i < pstr_sbr_ext_env->y_buffer_write_offset) {
  ------------------
  |  Branch (139:10): [True: 123k, False: 8.64k]
  ------------------
  140|   123k|    pstr_sbr_ext_env->ptr_y_buffer[i] = ptr_buffer + i * IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|   123k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  141|   123k|    memset(pstr_sbr_ext_env->ptr_y_buffer[i], 0,
  142|   123k|           IXHEAACE_QMF_CHANNELS * sizeof(pstr_sbr_ext_env->ptr_y_buffer[0]));
  ------------------
  |  |   66|   123k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  143|   123k|    i++;
  144|   123k|  }
  145|       |
  146|  8.64k|  ptr_buffer =
  147|  8.64k|      (FLOAT32 *)&ptr_common_buffer2[ch * y_buffer_length * 64 - offset * IXHEAACE_QMF_CHANNELS];
  ------------------
  |  |   66|  8.64k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  148|   172k|  for (i = pstr_sbr_ext_env->y_buffer_write_offset; i < y_buffer_length; i++) {
  ------------------
  |  Branch (148:53): [True: 163k, False: 8.64k]
  ------------------
  149|   163k|    pstr_sbr_ext_env->ptr_y_buffer[i] = ptr_buffer + i * IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|   163k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  150|   163k|    memset(pstr_sbr_ext_env->ptr_y_buffer[i], 0,
  151|   163k|           IXHEAACE_QMF_CHANNELS * sizeof(pstr_sbr_ext_env->ptr_y_buffer[0]));
  ------------------
  |  |   66|   163k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  152|   163k|  }
  153|       |
  154|  8.64k|  ptr_buffer = &ptr_sbr_env_r_buf[ch * qmf_time_slots * IXHEAACE_QMF_CHANNELS];
  ------------------
  |  |   66|  8.64k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  155|  8.64k|  ptr_i_buffer = &ptr_sbr_env_i_buf[ch * qmf_time_slots * IXHEAACE_QMF_CHANNELS];
  ------------------
  |  |   66|  8.64k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  156|   282k|  for (i = 0; i < r_buffer_length; i++) {
  ------------------
  |  Branch (156:15): [True: 273k, False: 8.64k]
  ------------------
  157|   273k|    pstr_sbr_ext_env->ptr_r_buffer[i] = ptr_buffer + i * IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|   273k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  158|   273k|    memset(pstr_sbr_ext_env->ptr_r_buffer[i], 0,
  159|   273k|           IXHEAACE_QMF_CHANNELS * sizeof(pstr_sbr_ext_env->ptr_r_buffer[0]));
  ------------------
  |  |   66|   273k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  160|   273k|    pstr_sbr_ext_env->ptr_i_buffer[i] = ptr_i_buffer + i * IXHEAACE_QMF_CHANNELS;
  ------------------
  |  |   66|   273k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  161|   273k|    memset(pstr_sbr_ext_env->ptr_i_buffer[i], 0,
  162|   273k|           IXHEAACE_QMF_CHANNELS * sizeof(pstr_sbr_ext_env->ptr_i_buffer[0]));
  ------------------
  |  |   66|   273k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  163|   273k|  }
  164|       |
  165|  8.64k|  memset(pstr_sbr_ext_env->envelope_compensation, 0,
  166|  8.64k|         sizeof(pstr_sbr_ext_env->envelope_compensation[0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  8.64k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.64k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  167|       |
  168|  8.64k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  8.64k|#define IA_NO_ERROR 0x00000000
  ------------------
  169|  8.64k|}

ixheaace_frame_info_generator:
  914|   579k|                              WORD32 flag_framelength_small) {
  915|   579k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   579k|#define IA_NO_ERROR 0x00000000
  ------------------
  916|   579k|  WORD32 num_env, tran = 0, bmin = 0, bmax = 0;
  917|   579k|  WORD32 ptr_parts, ptr_d, i_cmon = 0, i_tran = IXHEAACE_EMPTY, ptr_n_l;
  ------------------
  |  |   28|   579k|#define IXHEAACE_EMPTY (-99)
  ------------------
  918|   579k|  WORD32 fmax = 0;
  919|       |
  920|   579k|  WORD32 *ptr_v_bord = pstr_sbr_env_frame->v_bord;
  921|   579k|  ixheaace_freq_res *ptr_v_freq = pstr_sbr_env_frame->v_freq;
  922|   579k|  WORD32 *ptr_v_bord_follow = pstr_sbr_env_frame->v_bord_follow;
  923|   579k|  ixheaace_freq_res *ptr_v_freq_follow = pstr_sbr_env_frame->v_freq_follow;
  924|       |
  925|   579k|  WORD32 *ptr_length_v_bord_follow = &pstr_sbr_env_frame->length_v_bord_follow;
  926|   579k|  WORD32 *ptr_length_v_freq_follow = &pstr_sbr_env_frame->length_v_freq_follow;
  927|   579k|  WORD32 *ptr_length_v_bord = &pstr_sbr_env_frame->length_v_bord;
  928|   579k|  WORD32 *ptr_length_v_freq = &pstr_sbr_env_frame->length_v_freq;
  929|   579k|  WORD32 *ptr_spread_flag = &pstr_sbr_env_frame->spread_flag;
  930|   579k|  WORD32 *ptr_tran_follow = &pstr_sbr_env_frame->i_tran_follow;
  931|   579k|  WORD32 *ptr_fill_follow = &pstr_sbr_env_frame->i_fill_follow;
  932|   579k|  ixheaace_frame_class *ptr_frame_type_old = &pstr_sbr_env_frame->frame_type_old;
  933|   579k|  ixheaace_frame_class frame_type = IXHEAACE_FIXFIX;
  934|       |
  935|   579k|  WORD32 allow_spread = pstr_sbr_env_frame->allow_spread;
  936|   579k|  WORD32 num_env_static = pstr_sbr_env_frame->num_env_static;
  937|   579k|  WORD32 static_framing = pstr_sbr_env_frame->static_framing;
  938|   579k|  WORD32 dmin = pstr_sbr_env_frame->dmin;
  939|   579k|  WORD32 dmax = pstr_sbr_env_frame->dmax;
  940|       |
  941|   579k|  WORD32 tran_pos = ptr_v_transient_info[0];
  942|   579k|  WORD32 tran_flag = ptr_v_transient_info[1];
  943|       |
  944|   579k|  WORD32 *ptr_ptr_v_tuning_segm = ptr_v_tuning;
  945|   579k|  ixheaace_freq_res *ptr_tuning_freq = (ixheaace_freq_res *)(ptr_v_tuning + 3);
  946|       |
  947|   579k|  ixheaace_freq_res freq_res_fix = pstr_sbr_env_frame->freq_res_fix;
  948|       |
  949|   579k|  if (is_ld_sbr) {
  ------------------
  |  Branch (949:7): [True: 113k, False: 466k]
  ------------------
  950|   113k|    if ((!tran_flag && ptr_v_pre_transient_info[1]) &&
  ------------------
  |  Branch (950:10): [True: 76.4k, False: 37.4k]
  |  Branch (950:24): [True: 12.5k, False: 63.9k]
  ------------------
  951|  12.5k|        (num_time_slots - ptr_v_pre_transient_info[0] < 4)) {
  ------------------
  |  Branch (951:9): [True: 204, False: 12.3k]
  ------------------
  952|    204|      tran_flag = 1;
  953|    204|      tran_pos = 0;
  954|    204|    }
  955|   113k|  }
  956|   579k|  if (static_framing) {
  ------------------
  |  Branch (956:7): [True: 0, False: 579k]
  ------------------
  957|      0|    frame_type = IXHEAACE_FIXFIX;
  958|      0|    num_env = num_env_static;
  959|      0|    *ptr_frame_type_old = IXHEAACE_FIXFIX;
  960|      0|    pstr_sbr_env_frame->sbr_grid.bs_num_env = num_env;
  961|      0|    pstr_sbr_env_frame->sbr_grid.frame_type = frame_type;
  962|   579k|  } else {
  963|   579k|    ixheaace_calc_frame_class(&frame_type, ptr_frame_type_old, tran_flag, ptr_spread_flag,
  964|   579k|                              is_ld_sbr);
  965|   579k|    if (is_ld_sbr && tran_flag) {
  ------------------
  |  Branch (965:9): [True: 113k, False: 466k]
  |  Branch (965:22): [True: 37.6k, False: 76.2k]
  ------------------
  966|  37.6k|      frame_type = IXHEAACE_LD_TRAN;
  ------------------
  |  |   26|  37.6k|#define IXHEAACE_LD_TRAN (1)
  ------------------
  967|  37.6k|      *ptr_frame_type_old = IXHEAACE_FIXFIX;
  968|  37.6k|    }
  969|   579k|    if (tran_flag) {
  ------------------
  |  Branch (969:9): [True: 147k, False: 431k]
  ------------------
  970|   147k|      if (tran_pos < 4) {
  ------------------
  |  Branch (970:11): [True: 20.5k, False: 127k]
  ------------------
  971|  20.5k|        fmax = 6;
  972|   127k|      } else if (tran_pos == 4 || tran_pos == 5) {
  ------------------
  |  Branch (972:18): [True: 4.12k, False: 123k]
  |  Branch (972:35): [True: 24.5k, False: 98.7k]
  ------------------
  973|  28.6k|        fmax = 4;
  974|  28.6k|      } else
  975|  98.7k|        fmax = 8;
  976|       |
  977|   147k|      tran = tran_pos + 4;
  978|       |
  979|   147k|      ixheaace_fill_frame_tran(ptr_v_bord, ptr_length_v_bord, ptr_v_freq, ptr_length_v_freq,
  980|   147k|                               &bmin, &bmax, tran, ptr_ptr_v_tuning_segm, ptr_tuning_freq);
  981|   147k|    }
  982|   579k|    if (0 == is_ld_sbr) {
  ------------------
  |  Branch (982:9): [True: 466k, False: 113k]
  ------------------
  983|   466k|      switch (frame_type) {
  984|  40.4k|        case IXHEAACE_FIXVAR:
  ------------------
  |  Branch (984:9): [True: 40.4k, False: 425k]
  ------------------
  985|       |
  986|  40.4k|          ixheaace_fill_frame_pre(dmax, ptr_v_bord, ptr_length_v_bord, ptr_v_freq,
  987|  40.4k|                                  ptr_length_v_freq, bmin, bmin);
  988|       |
  989|  40.4k|          ixheaace_fill_Frame_Post(&ptr_parts, &ptr_d, dmax, ptr_v_bord, ptr_length_v_bord,
  990|  40.4k|                                   ptr_v_freq, ptr_length_v_freq, bmax, fmax);
  991|       |
  992|  40.4k|          if (ptr_parts == 1 && ptr_d < dmin) {
  ------------------
  |  Branch (992:15): [True: 26.5k, False: 13.9k]
  |  Branch (992:33): [True: 0, False: 26.5k]
  ------------------
  993|      0|            ixheaace_special_case(ptr_spread_flag, allow_spread, ptr_v_bord, ptr_length_v_bord,
  994|      0|                                  ptr_v_freq, ptr_length_v_freq, &ptr_parts, ptr_d);
  995|      0|          }
  996|       |
  997|  40.4k|          ixheaace_calc_cmon_border(&i_cmon, &i_tran, ptr_v_bord, ptr_length_v_bord, tran);
  998|  40.4k|          ixheaace_keep_for_follow_up(ptr_v_bord_follow, ptr_length_v_bord_follow,
  999|  40.4k|                                      ptr_v_freq_follow, ptr_length_v_freq_follow,
 1000|  40.4k|                                      ptr_tran_follow, ptr_fill_follow, ptr_v_bord,
 1001|  40.4k|                                      ptr_length_v_bord, ptr_v_freq, i_cmon, i_tran, ptr_parts);
 1002|       |
 1003|  40.4k|          ixheaace_calc_ctrl_signal(&pstr_sbr_env_frame->sbr_grid, frame_type, ptr_v_bord,
 1004|  40.4k|                                    *ptr_length_v_bord, ptr_v_freq, *ptr_length_v_freq, i_cmon,
 1005|  40.4k|                                    i_tran, *ptr_spread_flag, IXHEAACE_DC);
  ------------------
  |  |   27|  40.4k|#define IXHEAACE_DC (4711)
  ------------------
 1006|  40.4k|          break;
 1007|  38.8k|        case IXHEAACE_VARFIX:
  ------------------
  |  Branch (1007:9): [True: 38.8k, False: 427k]
  ------------------
 1008|  38.8k|          ixheaace_calc_ctrl_signal(&pstr_sbr_env_frame->sbr_grid, frame_type, ptr_v_bord_follow,
 1009|  38.8k|                                    *ptr_length_v_bord_follow, ptr_v_freq_follow,
 1010|  38.8k|                                    *ptr_length_v_freq_follow, IXHEAACE_DC, *ptr_tran_follow,
  ------------------
  |  |   27|  38.8k|#define IXHEAACE_DC (4711)
  ------------------
 1011|  38.8k|                                    *ptr_spread_flag, IXHEAACE_DC);
  ------------------
  |  |   27|  38.8k|#define IXHEAACE_DC (4711)
  ------------------
 1012|  38.8k|          break;
 1013|  69.8k|        case IXHEAACE_VARVAR:
  ------------------
  |  Branch (1013:9): [True: 69.8k, False: 396k]
  ------------------
 1014|       |
 1015|  69.8k|          if (*ptr_spread_flag) {
  ------------------
  |  Branch (1015:15): [True: 0, False: 69.8k]
  ------------------
 1016|      0|            ixheaace_calc_ctrl_signal(&pstr_sbr_env_frame->sbr_grid, frame_type,
 1017|      0|                                      ptr_v_bord_follow, *ptr_length_v_bord_follow,
 1018|      0|                                      ptr_v_freq_follow, *ptr_length_v_freq_follow, IXHEAACE_DC,
  ------------------
  |  |   27|      0|#define IXHEAACE_DC (4711)
  ------------------
 1019|      0|                                      *ptr_tran_follow, *ptr_spread_flag, IXHEAACE_DC);
  ------------------
  |  |   27|      0|#define IXHEAACE_DC (4711)
  ------------------
 1020|       |
 1021|      0|            *ptr_spread_flag = 0;
 1022|       |
 1023|      0|            ptr_v_bord_follow[0] = pstr_sbr_env_frame->sbr_grid.bs_abs_bord_1 - 16;
 1024|       |
 1025|      0|            ptr_v_freq_follow[0] = FREQ_RES_HIGH;
 1026|      0|            *ptr_length_v_bord_follow = 1;
 1027|      0|            *ptr_length_v_freq_follow = 1;
 1028|       |
 1029|      0|            *ptr_tran_follow = -IXHEAACE_DC;
  ------------------
  |  |   27|      0|#define IXHEAACE_DC (4711)
  ------------------
 1030|      0|            *ptr_fill_follow = -IXHEAACE_DC;
  ------------------
  |  |   27|      0|#define IXHEAACE_DC (4711)
  ------------------
 1031|  69.8k|          } else {
 1032|  69.8k|            ixheaace_fill_frame_inter(
 1033|  69.8k|                &ptr_n_l, ptr_ptr_v_tuning_segm, ptr_v_bord, ptr_length_v_bord, bmin, ptr_v_freq,
 1034|  69.8k|                ptr_length_v_freq, ptr_v_bord_follow, ptr_length_v_bord_follow, ptr_v_freq_follow,
 1035|  69.8k|                ptr_length_v_freq_follow, *ptr_fill_follow, dmin, dmax);
 1036|       |
 1037|  69.8k|            ixheaace_fill_Frame_Post(&ptr_parts, &ptr_d, dmax, ptr_v_bord, ptr_length_v_bord,
 1038|  69.8k|                                     ptr_v_freq, ptr_length_v_freq, bmax, fmax);
 1039|       |
 1040|  69.8k|            if (ptr_parts == 1 && ptr_d < dmin) {
  ------------------
  |  Branch (1040:17): [True: 20.3k, False: 49.5k]
  |  Branch (1040:35): [True: 0, False: 20.3k]
  ------------------
 1041|      0|              ixheaace_special_case(ptr_spread_flag, allow_spread, ptr_v_bord, ptr_length_v_bord,
 1042|      0|                                    ptr_v_freq, ptr_length_v_freq, &ptr_parts, ptr_d);
 1043|      0|            }
 1044|       |
 1045|  69.8k|            ixheaace_calc_cmon_border(&i_cmon, &i_tran, ptr_v_bord, ptr_length_v_bord, tran);
 1046|       |
 1047|  69.8k|            ixheaace_keep_for_follow_up(ptr_v_bord_follow, ptr_length_v_bord_follow,
 1048|  69.8k|                                        ptr_v_freq_follow, ptr_length_v_freq_follow,
 1049|  69.8k|                                        ptr_tran_follow, ptr_fill_follow, ptr_v_bord,
 1050|  69.8k|                                        ptr_length_v_bord, ptr_v_freq, i_cmon, i_tran, ptr_parts);
 1051|       |
 1052|  69.8k|            ixheaace_calc_ctrl_signal(&pstr_sbr_env_frame->sbr_grid, frame_type, ptr_v_bord,
 1053|  69.8k|                                      *ptr_length_v_bord, ptr_v_freq, *ptr_length_v_freq, i_cmon,
 1054|  69.8k|                                      i_tran, 0, ptr_n_l);
 1055|  69.8k|          }
 1056|  69.8k|          break;
 1057|   316k|        case IXHEAACE_FIXFIX:
  ------------------
  |  Branch (1057:9): [True: 316k, False: 149k]
  ------------------
 1058|       |
 1059|   316k|          num_env = (tran_pos == 0 ? 1 : 2);
  ------------------
  |  Branch (1059:22): [True: 294k, False: 22.8k]
  ------------------
 1060|       |
 1061|   316k|          pstr_sbr_env_frame->sbr_grid.bs_num_env = num_env;
 1062|   316k|          pstr_sbr_env_frame->sbr_grid.frame_type = frame_type;
 1063|       |
 1064|   316k|          break;
 1065|      0|        default:
  ------------------
  |  Branch (1065:9): [True: 0, False: 466k]
  ------------------
 1066|      0|          break;
 1067|   466k|      }
 1068|   466k|      err_code = ixheaace_ctrl_signal2_frame_info(
 1069|   466k|          &pstr_sbr_env_frame->sbr_grid, &pstr_sbr_env_frame->sbr_frame_info, freq_res_fix,
 1070|   466k|          ptr_qmf_tab, flag_framelength_small);
 1071|   466k|      if (err_code) {
  ------------------
  |  Branch (1071:11): [True: 0, False: 466k]
  ------------------
 1072|      0|        return err_code;
 1073|      0|      }
 1074|   466k|    } else {
 1075|   113k|      WORD32 i;
 1076|       |
 1077|   113k|      switch (frame_type) {
 1078|  76.2k|        case IXHEAACE_FIXFIX: {
  ------------------
  |  Branch (1078:9): [True: 76.2k, False: 37.6k]
  ------------------
 1079|  76.2k|          pstr_sbr_env_frame->sbr_grid.frame_type = frame_type;
 1080|  76.2k|          pstr_sbr_env_frame->sbr_grid.bs_transient_position = tran_pos;
 1081|  76.2k|          pstr_sbr_env_frame->sbr_frame_info.n_envelopes = 1;
 1082|  76.2k|          pstr_sbr_env_frame->sbr_grid.bs_num_env = 1;
 1083|  76.2k|          if (tran_pos == 1) {
  ------------------
  |  Branch (1083:15): [True: 3.55k, False: 72.6k]
  ------------------
 1084|  3.55k|            pstr_sbr_env_frame->sbr_grid.bs_num_env = 2;
 1085|  3.55k|          }
 1086|  76.2k|          pstr_sbr_env_frame->sbr_frame_info.short_env = 0;
 1087|  76.2k|          if (flag_framelength_small) {
  ------------------
  |  Branch (1087:15): [True: 33.9k, False: 42.2k]
  ------------------
 1088|  33.9k|            ixheaace_create_def_frame_480_info(&pstr_sbr_env_frame->sbr_frame_info,
 1089|  33.9k|                                               pstr_sbr_env_frame->sbr_grid.bs_num_env,
 1090|  33.9k|                                               ptr_qmf_tab);
 1091|  42.2k|          } else {
 1092|  42.2k|            ixheaace_create_def_frame_info(&pstr_sbr_env_frame->sbr_frame_info,
 1093|  42.2k|                                           pstr_sbr_env_frame->sbr_grid.bs_num_env, ptr_qmf_tab);
 1094|  42.2k|          }
 1095|       |
 1096|  76.2k|          if (pstr_sbr_env_frame->sbr_frame_info.n_envelopes > 1) {
  ------------------
  |  Branch (1096:15): [True: 3.55k, False: 72.6k]
  ------------------
 1097|  10.6k|            for (i = 0; i < pstr_sbr_env_frame->sbr_frame_info.n_envelopes; i++) {
  ------------------
  |  Branch (1097:25): [True: 7.11k, False: 3.55k]
  ------------------
 1098|  7.11k|              pstr_sbr_env_frame->sbr_frame_info.freq_res[i] = FREQ_RES_LOW;
 1099|  7.11k|              pstr_sbr_env_frame->sbr_grid.v_f[i] = FREQ_RES_LOW;
 1100|  7.11k|            }
 1101|  72.6k|          } else {
 1102|   145k|            for (i = 0; i < pstr_sbr_env_frame->sbr_frame_info.n_envelopes; i++) {
  ------------------
  |  Branch (1102:25): [True: 72.6k, False: 72.6k]
  ------------------
 1103|  72.6k|              pstr_sbr_env_frame->sbr_frame_info.freq_res[i] = FREQ_RES_HIGH;
 1104|  72.6k|              pstr_sbr_env_frame->sbr_grid.v_f[i] = FREQ_RES_HIGH;
 1105|  72.6k|            }
 1106|  72.6k|          }
 1107|  76.2k|        } break;
 1108|       |
 1109|  37.6k|        case IXHEAACE_LD_TRAN: {
  ------------------
  |  |   26|  37.6k|#define IXHEAACE_LD_TRAN (1)
  ------------------
  |  Branch (1109:9): [True: 37.6k, False: 76.2k]
  ------------------
 1110|  37.6k|          ixheaace_create_ld_transient_frame_info(&pstr_sbr_env_frame->sbr_frame_info,
 1111|  37.6k|                                                  &pstr_sbr_env_frame->sbr_grid, tran_pos,
 1112|  37.6k|                                                  num_time_slots,
 1113|  37.6k|                                                  pstr_sbr_env_frame->use_low_freq_res);
 1114|  37.6k|        } break;
 1115|      0|        default:
  ------------------
  |  Branch (1115:9): [True: 0, False: 113k]
  ------------------
 1116|      0|          break;
 1117|   113k|      }
 1118|   113k|    }
 1119|   579k|  }
 1120|       |
 1121|   579k|  *ptr_frame_info = &pstr_sbr_env_frame->sbr_frame_info;
 1122|   579k|  return err_code;
 1123|   579k|}
ixheaace_create_frame_info_generator:
 1128|  8.64k|                                          WORD32 use_low_freq_res) {
 1129|  8.64k|  memset(pstr_sbr_env_frame, 0, sizeof(ixheaace_str_sbr_env_frame));
 1130|       |
 1131|  8.64k|  pstr_sbr_env_frame->frame_type_old = IXHEAACE_FIXFIX;
 1132|  8.64k|  pstr_sbr_env_frame->spread_flag = 0;
 1133|       |
 1134|  8.64k|  pstr_sbr_env_frame->allow_spread = allow_spread;
 1135|  8.64k|  pstr_sbr_env_frame->num_env_static = num_env_static;
 1136|  8.64k|  pstr_sbr_env_frame->static_framing = static_framing;
 1137|  8.64k|  pstr_sbr_env_frame->freq_res_fix = freq_res_fix;
 1138|  8.64k|  pstr_sbr_env_frame->use_low_freq_res = use_low_freq_res;
 1139|       |
 1140|  8.64k|  pstr_sbr_env_frame->length_v_bord = 0;
 1141|  8.64k|  pstr_sbr_env_frame->length_v_bord_follow = 0;
 1142|       |
 1143|  8.64k|  pstr_sbr_env_frame->length_v_freq = 0;
 1144|  8.64k|  pstr_sbr_env_frame->length_v_freq_follow = 0;
 1145|       |
 1146|  8.64k|  pstr_sbr_env_frame->i_tran_follow = 0;
 1147|  8.64k|  pstr_sbr_env_frame->i_fill_follow = 0;
 1148|       |
 1149|  8.64k|  pstr_sbr_env_frame->dmin = 4;
 1150|  8.64k|  pstr_sbr_env_frame->dmax = 12;
 1151|  8.64k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_calc_frame_class:
  283|   579k|                                      WORD32 *ptr_spread_flag, WORD32 is_ld_sbr) {
  284|   579k|  if (0 == is_ld_sbr) {
  ------------------
  |  Branch (284:7): [True: 466k, False: 113k]
  ------------------
  285|   466k|    switch (*ptr_frame_type_old) {
  286|   319k|      case IXHEAACE_FIXFIX:
  ------------------
  |  Branch (286:7): [True: 319k, False: 146k]
  ------------------
  287|       |
  288|   319k|        *ptr_frame_type = (tran_flag ? IXHEAACE_FIXVAR : IXHEAACE_FIXFIX);
  ------------------
  |  Branch (288:28): [True: 27.1k, False: 291k]
  ------------------
  289|   319k|        break;
  290|       |
  291|  39.6k|      case IXHEAACE_FIXVAR:
  ------------------
  |  Branch (291:7): [True: 39.6k, False: 426k]
  ------------------
  292|       |
  293|  39.6k|        if (tran_flag) {
  ------------------
  |  Branch (293:13): [True: 15.7k, False: 23.8k]
  ------------------
  294|  15.7k|          *ptr_frame_type = IXHEAACE_VARVAR;
  295|  15.7k|          *ptr_spread_flag = 0;
  296|  23.8k|        } else {
  297|  23.8k|          *ptr_frame_type = (*ptr_spread_flag ? IXHEAACE_VARVAR : IXHEAACE_VARFIX);
  ------------------
  |  Branch (297:30): [True: 0, False: 23.8k]
  ------------------
  298|  23.8k|        }
  299|  39.6k|        break;
  300|       |
  301|  38.2k|      case IXHEAACE_VARFIX:
  ------------------
  |  Branch (301:7): [True: 38.2k, False: 427k]
  ------------------
  302|       |
  303|  38.2k|        *ptr_frame_type = (tran_flag ? IXHEAACE_FIXVAR : IXHEAACE_FIXFIX);
  ------------------
  |  Branch (303:28): [True: 13.2k, False: 24.9k]
  ------------------
  304|  38.2k|        break;
  305|       |
  306|  69.0k|      case IXHEAACE_VARVAR:
  ------------------
  |  Branch (306:7): [True: 69.0k, False: 396k]
  ------------------
  307|       |
  308|  69.0k|        if (tran_flag) {
  ------------------
  |  Branch (308:13): [True: 54.0k, False: 15.0k]
  ------------------
  309|  54.0k|          *ptr_frame_type = IXHEAACE_VARVAR;
  310|  54.0k|          *ptr_spread_flag = 0;
  311|  54.0k|        } else {
  312|  15.0k|          *ptr_frame_type = (*ptr_spread_flag ? IXHEAACE_VARVAR : IXHEAACE_VARFIX);
  ------------------
  |  Branch (312:30): [True: 0, False: 15.0k]
  ------------------
  313|  15.0k|        }
  314|  69.0k|        break;
  315|      0|      default:
  ------------------
  |  Branch (315:7): [True: 0, False: 466k]
  ------------------
  316|      0|        break;
  317|   466k|    }
  318|   466k|  } else {
  319|   113k|    *ptr_frame_type = (tran_flag ? IXHEAACE_LD_TRAN : IXHEAACE_FIXFIX);
  ------------------
  |  |   26|  37.6k|#define IXHEAACE_LD_TRAN (1)
  ------------------
  |  Branch (319:24): [True: 37.6k, False: 76.2k]
  ------------------
  320|   113k|  }
  321|   579k|  *ptr_frame_type_old = *ptr_frame_type;
  322|   579k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_fill_frame_tran:
   71|   147k|                                     ixheaace_freq_res *ptr_tuning_freq) {
   72|   147k|  WORD32 bord, i;
   73|       |
   74|   147k|  *ptr_length_v_bord = 0;
   75|   147k|  *ptr_length_v_freq = 0;
   76|       |
   77|   147k|  if (ptr_ptr_v_tuning_segm[0]) {
  ------------------
  |  Branch (77:7): [True: 0, False: 147k]
  ------------------
   78|      0|    ixheaace_add_right(ptr_v_bord, ptr_length_v_bord, (tran - ptr_ptr_v_tuning_segm[0]));
   79|       |
   80|      0|    ixheaace_add_freq_right(ptr_v_freq, ptr_length_v_freq, ptr_tuning_freq[0]);
   81|      0|  }
   82|       |
   83|   147k|  bord = tran;
   84|       |
   85|   147k|  ixheaace_add_right(ptr_v_bord, ptr_length_v_bord, tran);
   86|       |
   87|   147k|  if (ptr_ptr_v_tuning_segm[1]) {
  ------------------
  |  Branch (87:7): [True: 147k, False: 0]
  ------------------
   88|   147k|    bord += ptr_ptr_v_tuning_segm[1];
   89|       |
   90|   147k|    ixheaace_add_right(ptr_v_bord, ptr_length_v_bord, bord);
   91|       |
   92|   147k|    ixheaace_add_freq_right(ptr_v_freq, ptr_length_v_freq, ptr_tuning_freq[1]);
   93|   147k|  }
   94|       |
   95|   147k|  if (ptr_ptr_v_tuning_segm[2] != 0) {
  ------------------
  |  Branch (95:7): [True: 147k, False: 0]
  ------------------
   96|   147k|    bord += ptr_ptr_v_tuning_segm[2];
   97|       |
   98|   147k|    ixheaace_add_right(ptr_v_bord, ptr_length_v_bord, bord);
   99|       |
  100|   147k|    ixheaace_add_freq_right(ptr_v_freq, ptr_length_v_freq, ptr_tuning_freq[2]);
  101|   147k|  }
  102|       |
  103|   147k|  ixheaace_add_freq_right(ptr_v_freq, ptr_length_v_freq, FREQ_RES_HIGH);
  104|       |
  105|   147k|  *ptr_bmin = ptr_v_bord[0];
  106|   147k|  *ptr_bmax = ptr_v_bord[0];
  107|       |
  108|   591k|  for (i = 0; i < *ptr_length_v_bord; i++) {
  ------------------
  |  Branch (108:15): [True: 443k, False: 147k]
  ------------------
  109|   443k|    if (ptr_v_bord[i] < *ptr_bmin) {
  ------------------
  |  Branch (109:9): [True: 0, False: 443k]
  ------------------
  110|      0|      *ptr_bmin = ptr_v_bord[i];
  111|      0|    }
  112|   443k|    if (ptr_v_bord[i] > *ptr_bmax) {
  ------------------
  |  Branch (112:9): [True: 295k, False: 147k]
  ------------------
  113|   295k|      *ptr_bmax = ptr_v_bord[i];
  114|   295k|    }
  115|   443k|  }
  116|   147k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_add_freq_right:
   61|   551k|                                    ixheaace_freq_res value) {
   62|   551k|  ptr_vector[*ptr_length_vector] = value;
   63|       |
   64|   551k|  (*ptr_length_vector)++;
   65|   551k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_fill_frame_pre:
  120|  42.7k|                                    WORD32 bmin, WORD32 rest) {
  121|  42.7k|  WORD32 ptr_parts, ptr_d, j, S, s = 0, segm, bord;
  122|       |
  123|  42.7k|  ptr_parts = 1;
  124|  42.7k|  ptr_d = rest;
  125|       |
  126|  74.6k|  while (ptr_d > dmax) {
  ------------------
  |  Branch (126:10): [True: 31.8k, False: 42.7k]
  ------------------
  127|  31.8k|    ptr_parts++;
  128|       |
  129|  31.8k|    segm = rest / ptr_parts;
  130|       |
  131|  31.8k|    S = ixheaac_shr32((segm - 2), 1);
  132|       |
  133|  31.8k|    s = ixheaac_min32(8, 2 * S + 2);
  134|       |
  135|  31.8k|    ptr_d = rest - (ptr_parts - 1) * s;
  136|  31.8k|  }
  137|       |
  138|  42.7k|  bord = bmin;
  139|  42.7k|  j = 0;
  140|  74.6k|  while (j <= ptr_parts - 2) {
  ------------------
  |  Branch (140:10): [True: 31.8k, False: 42.7k]
  ------------------
  141|  31.8k|    bord = bord - s;
  142|       |
  143|  31.8k|    ixheaace_add_left(ptr_v_bord, ptr_length_v_bord, bord);
  144|       |
  145|  31.8k|    ixheaace_add_freq_left(ptr_v_freq, ptr_length_v_freq, FREQ_RES_HIGH);
  146|  31.8k|    j++;
  147|  31.8k|  }
  148|  42.7k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_add_freq_left:
   44|   131k|                                   ixheaace_freq_res value) {
   45|   131k|  memmove(ptr_vector + 1, ptr_vector, *ptr_length_vector * sizeof(ptr_vector[0]));
   46|   131k|  ptr_vector[0] = value;
   47|   131k|  (*ptr_length_vector)++;
   48|   131k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_fill_Frame_Post:
  153|   110k|                                     WORD32 bmax, WORD32 fmax) {
  154|   110k|  WORD32 j, rest, segm, S, s = 0, bord;
  155|       |
  156|   110k|  rest = 32 - bmax;
  157|       |
  158|   110k|  *ptr_d = rest;
  159|       |
  160|   110k|  if (*ptr_d > 0) {
  ------------------
  |  Branch (160:7): [True: 110k, False: 0]
  ------------------
  161|   110k|    *ptr_parts = 1; /* start with one envelope */
  162|       |
  163|   217k|    while (*ptr_d > dmax) {
  ------------------
  |  Branch (163:12): [True: 107k, False: 110k]
  ------------------
  164|   107k|      *ptr_parts = *ptr_parts + 1;
  165|       |
  166|   107k|      segm = rest / (*ptr_parts);
  167|       |
  168|   107k|      S = ixheaac_shr32((segm - 2), 1);
  169|       |
  170|   107k|      s = ixheaac_min32(fmax, 2 * S + 2);
  171|       |
  172|   107k|      *ptr_d = rest - (*ptr_parts - 1) * s;
  173|   107k|    }
  174|       |
  175|   110k|    bord = bmax;
  176|       |
  177|   217k|    for (j = 0; j <= *ptr_parts - 2; j++) {
  ------------------
  |  Branch (177:17): [True: 107k, False: 110k]
  ------------------
  178|   107k|      bord += s;
  179|       |
  180|   107k|      ixheaace_add_right(ptr_v_bord, ptr_length_v_bord, bord);
  181|       |
  182|   107k|      ixheaace_add_freq_right(ptr_v_freq, ptr_length_v_freq, FREQ_RES_HIGH);
  183|   107k|    }
  184|   110k|  } else {
  185|      0|    *ptr_parts = 1;
  186|       |
  187|      0|    *ptr_length_v_bord = *ptr_length_v_bord - 1;
  188|      0|    *ptr_length_v_freq = *ptr_length_v_freq - 1;
  189|      0|  }
  190|   110k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_calc_cmon_border:
  358|   110k|) {
  359|   110k|  WORD32 i;
  360|       |
  361|   444k|  for (i = 0; i < *ptr_border_vec_len; i++) {
  ------------------
  |  Branch (361:15): [True: 444k, False: 0]
  ------------------
  362|   444k|    if (ptr_a_borders[i] >= 16) {
  ------------------
  |  Branch (362:9): [True: 110k, False: 334k]
  ------------------
  363|   110k|      *ptr_cmon_border_idx = i;
  364|   110k|      break;
  365|   110k|    }
  366|   444k|  }
  367|   110k|  i = 0;
  368|   241k|  while (i < *ptr_border_vec_len) {
  ------------------
  |  Branch (368:10): [True: 241k, False: 0]
  ------------------
  369|   241k|    if (ptr_a_borders[i] >= tran) {
  ------------------
  |  Branch (369:9): [True: 110k, False: 131k]
  ------------------
  370|   110k|      *ptr_tran_idx = i;
  371|   110k|      break;
  372|   131k|    } else {
  373|   131k|      *ptr_tran_idx = IXHEAACE_EMPTY;
  ------------------
  |  |   28|   131k|#define IXHEAACE_EMPTY (-99)
  ------------------
  374|   131k|    }
  375|   131k|    i++;
  376|   131k|  }
  377|   110k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_keep_for_follow_up:
  388|   110k|) {
  389|   110k|  WORD32 L, i, j;
  390|       |
  391|   110k|  L = *ptr_border_vec_len;
  392|       |
  393|   110k|  (*ptr_border_vec_len_follow) = 0;
  394|   110k|  (*ptr_freq_res_vec_len_follow) = 0;
  395|       |
  396|   110k|  j = 0, i = cmon_border_idx;
  397|       |
  398|   344k|  while (i < L) {
  ------------------
  |  Branch (398:10): [True: 234k, False: 110k]
  ------------------
  399|   234k|    ptr_a_borders_follow[j] = ptr_a_borders[i] - 16;
  400|       |
  401|   234k|    ptr_a_freq_res_follow[j] = ptr_freq_res[i];
  402|       |
  403|   234k|    (*ptr_border_vec_len_follow)++;
  404|   234k|    (*ptr_freq_res_vec_len_follow)++;
  405|   234k|    i++, j++;
  406|   234k|  }
  407|       |
  408|   110k|  *ptr_tran_idx_follow =
  409|   110k|      (tran_idx != IXHEAACE_EMPTY ? tran_idx - cmon_border_idx : IXHEAACE_EMPTY);
  ------------------
  |  |   28|   110k|#define IXHEAACE_EMPTY (-99)
  ------------------
                    (tran_idx != IXHEAACE_EMPTY ? tran_idx - cmon_border_idx : IXHEAACE_EMPTY);
  ------------------
  |  |   28|      0|#define IXHEAACE_EMPTY (-99)
  ------------------
  |  Branch (409:8): [True: 110k, False: 0]
  ------------------
  410|       |
  411|   110k|  *ptr_fill_idx_follow = L - (num_parts - 1) - cmon_border_idx;
  412|   110k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_calc_ctrl_signal:
  418|   149k|                                      WORD32 spread_flag, WORD32 ptr_n_l) {
  419|   149k|  WORD32 i, r, a, n, p, b, a_l, a_r, ntot, nmax, n_r;
  420|       |
  421|   149k|  ixheaace_freq_res *ptr_v_f = pstr_sbr_grid->v_f;
  422|   149k|  ixheaace_freq_res *ptr_v_f_lr = pstr_sbr_grid->v_f_lr;
  423|   149k|  WORD32 *ptr_v_r = pstr_sbr_grid->bs_rel_bord;
  424|   149k|  WORD32 *ptr_v_rl = pstr_sbr_grid->bs_rel_bord_0;
  425|   149k|  WORD32 *ptr_v_rr = pstr_sbr_grid->bs_rel_bord_1;
  426|       |
  427|   149k|  WORD32 length_v_r = 0;
  428|   149k|  WORD32 length_v_rr = 0;
  429|   149k|  WORD32 length_v_rl = 0;
  430|       |
  431|   149k|  switch (frame_type) {
  432|  40.4k|    case IXHEAACE_FIXVAR:
  ------------------
  |  Branch (432:5): [True: 40.4k, False: 108k]
  ------------------
  433|       |
  434|  40.4k|      a = ptr_v_bord[i_cmon];
  435|       |
  436|  40.4k|      length_v_r = 0;
  437|  40.4k|      i = i_cmon;
  438|       |
  439|   127k|      while (i >= 1) {
  ------------------
  |  Branch (439:14): [True: 87.3k, False: 40.4k]
  ------------------
  440|  87.3k|        r = ptr_v_bord[i] - ptr_v_bord[i - 1];
  441|       |
  442|  87.3k|        ixheaace_add_right(ptr_v_r, &length_v_r, r);
  443|       |
  444|  87.3k|        i--;
  445|  87.3k|      }
  446|       |
  447|  40.4k|      n = length_v_r;
  448|       |
  449|   127k|      for (i = 0; i < i_cmon; i++) {
  ------------------
  |  Branch (449:19): [True: 87.3k, False: 40.4k]
  ------------------
  450|  87.3k|        ptr_v_f[i] = ptr_v_freq[i_cmon - 1 - i];
  451|  87.3k|      }
  452|       |
  453|  40.4k|      ptr_v_f[i_cmon] = FREQ_RES_HIGH;
  454|       |
  455|  40.4k|      if ((i_cmon >= i_tran) && (i_tran != IXHEAACE_EMPTY)) {
  ------------------
  |  |   28|  40.4k|#define IXHEAACE_EMPTY (-99)
  ------------------
  |  Branch (455:11): [True: 40.4k, False: 0]
  |  Branch (455:33): [True: 40.4k, False: 0]
  ------------------
  456|  40.4k|        p = i_cmon - i_tran + 1;
  457|  40.4k|      } else {
  458|      0|        p = 0;
  459|      0|      }
  460|       |
  461|  40.4k|      pstr_sbr_grid->frame_type = frame_type;
  462|  40.4k|      pstr_sbr_grid->bs_abs_bord = a;
  463|  40.4k|      pstr_sbr_grid->n = n;
  464|  40.4k|      pstr_sbr_grid->p = p;
  465|       |
  466|  40.4k|      break;
  467|  38.8k|    case IXHEAACE_VARFIX:
  ------------------
  |  Branch (467:5): [True: 38.8k, False: 110k]
  ------------------
  468|       |
  469|  38.8k|      a = ptr_v_bord[0];
  470|       |
  471|  38.8k|      length_v_r = 0;
  472|       |
  473|  38.8k|      i = 1;
  474|  80.6k|      while (i < length_v_bord) {
  ------------------
  |  Branch (474:14): [True: 41.8k, False: 38.8k]
  ------------------
  475|  41.8k|        r = ptr_v_bord[i] - ptr_v_bord[i - 1];
  476|       |
  477|  41.8k|        ixheaace_add_right(ptr_v_r, &length_v_r, r);
  478|       |
  479|  41.8k|        i++;
  480|  41.8k|      }
  481|       |
  482|  38.8k|      n = length_v_r;
  483|       |
  484|  38.8k|      memcpy(ptr_v_f, ptr_v_freq, length_v_freq * sizeof(ixheaace_freq_res));
  485|       |
  486|  38.8k|      if ((i_tran >= 0) && (i_tran != IXHEAACE_EMPTY)) {
  ------------------
  |  |   28|  2.98k|#define IXHEAACE_EMPTY (-99)
  ------------------
  |  Branch (486:11): [True: 2.98k, False: 35.8k]
  |  Branch (486:28): [True: 2.98k, False: 0]
  ------------------
  487|  2.98k|        p = i_tran + 1;
  488|  35.8k|      } else {
  489|  35.8k|        p = 0;
  490|  35.8k|      }
  491|       |
  492|  38.8k|      pstr_sbr_grid->frame_type = frame_type;
  493|  38.8k|      pstr_sbr_grid->bs_abs_bord = a;
  494|  38.8k|      pstr_sbr_grid->n = n;
  495|  38.8k|      pstr_sbr_grid->p = p;
  496|       |
  497|  38.8k|      break;
  498|  69.8k|    case IXHEAACE_VARVAR:
  ------------------
  |  Branch (498:5): [True: 69.8k, False: 79.2k]
  ------------------
  499|       |
  500|  69.8k|      if (spread_flag) {
  ------------------
  |  Branch (500:11): [True: 0, False: 69.8k]
  ------------------
  501|      0|        b = length_v_bord;
  502|       |
  503|      0|        a_l = ptr_v_bord[0];
  504|       |
  505|      0|        a_r = ptr_v_bord[b - 1];
  506|       |
  507|      0|        ntot = b - 2;
  508|       |
  509|      0|        nmax = 2;
  510|       |
  511|      0|        if (ntot > nmax) {
  ------------------
  |  Branch (511:13): [True: 0, False: 0]
  ------------------
  512|      0|          ptr_n_l = nmax;
  513|      0|          n_r = ntot - nmax;
  514|      0|        } else {
  515|      0|          ptr_n_l = ntot;
  516|      0|          n_r = 0;
  517|      0|        }
  518|       |
  519|      0|        length_v_rl = 0;
  520|       |
  521|      0|        i = 1;
  522|      0|        while (i <= ptr_n_l) {
  ------------------
  |  Branch (522:16): [True: 0, False: 0]
  ------------------
  523|      0|          r = ptr_v_bord[i] - ptr_v_bord[i - 1];
  524|       |
  525|      0|          ixheaace_add_right(ptr_v_rl, &length_v_rl, r);
  526|       |
  527|      0|          i++;
  528|      0|        }
  529|       |
  530|      0|        length_v_rr = 0;
  531|       |
  532|      0|        i = b - 1;
  533|       |
  534|      0|        while (i >= b - n_r) {
  ------------------
  |  Branch (534:16): [True: 0, False: 0]
  ------------------
  535|      0|          r = ptr_v_bord[i] - ptr_v_bord[i - 1];
  536|       |
  537|      0|          ixheaace_add_right(ptr_v_rr, &length_v_rr, r);
  538|       |
  539|      0|          i--;
  540|      0|        }
  541|       |
  542|      0|        if ((i_tran > 0) && (i_tran != IXHEAACE_EMPTY)) {
  ------------------
  |  |   28|      0|#define IXHEAACE_EMPTY (-99)
  ------------------
  |  Branch (542:13): [True: 0, False: 0]
  |  Branch (542:29): [True: 0, False: 0]
  ------------------
  543|      0|          p = b - i_tran;
  544|      0|        } else {
  545|      0|          p = 0;
  546|      0|        }
  547|       |
  548|      0|        for (i = 0; i < b - 1; i++) {
  ------------------
  |  Branch (548:21): [True: 0, False: 0]
  ------------------
  549|      0|          ptr_v_f_lr[i] = ptr_v_freq[i];
  550|      0|        }
  551|  69.8k|      } else {
  552|  69.8k|        length_v_bord = i_cmon + 1;
  553|       |
  554|  69.8k|        b = length_v_bord;
  555|       |
  556|  69.8k|        a_l = ptr_v_bord[0];
  557|       |
  558|  69.8k|        a_r = ptr_v_bord[b - 1];
  559|       |
  560|  69.8k|        ntot = b - 2;
  561|  69.8k|        n_r = ntot - ptr_n_l;
  562|       |
  563|  69.8k|        length_v_rl = 0;
  564|       |
  565|  69.8k|        i = 1;
  566|  99.7k|        while (i <= ptr_n_l) {
  ------------------
  |  Branch (566:16): [True: 29.8k, False: 69.8k]
  ------------------
  567|  29.8k|          r = ptr_v_bord[i] - ptr_v_bord[i - 1];
  568|       |
  569|  29.8k|          ixheaace_add_right(ptr_v_rl, &length_v_rl, r);
  570|       |
  571|  29.8k|          i++;
  572|  29.8k|        }
  573|       |
  574|  69.8k|        length_v_rr = 0;
  575|       |
  576|  69.8k|        i = b - 1;
  577|       |
  578|   216k|        while (i >= b - n_r) {
  ------------------
  |  Branch (578:16): [True: 146k, False: 69.8k]
  ------------------
  579|   146k|          r = ptr_v_bord[i] - ptr_v_bord[i - 1];
  580|       |
  581|   146k|          ixheaace_add_right(ptr_v_rr, &length_v_rr, r);
  582|       |
  583|   146k|          i--;
  584|   146k|        }
  585|       |
  586|  69.8k|        if ((i_cmon >= i_tran) && (i_tran != IXHEAACE_EMPTY)) {
  ------------------
  |  |   28|  69.8k|#define IXHEAACE_EMPTY (-99)
  ------------------
  |  Branch (586:13): [True: 69.8k, False: 0]
  |  Branch (586:35): [True: 69.8k, False: 0]
  ------------------
  587|  69.8k|          p = i_cmon - i_tran + 1;
  588|  69.8k|        } else {
  589|      0|          p = 0;
  590|      0|        }
  591|       |
  592|   316k|        for (i = 0; i < b - 1; i++) {
  ------------------
  |  Branch (592:21): [True: 246k, False: 69.8k]
  ------------------
  593|   246k|          ptr_v_f_lr[i] = ptr_v_freq[i];
  594|   246k|        }
  595|  69.8k|      }
  596|       |
  597|  69.8k|      pstr_sbr_grid->frame_type = frame_type;
  598|  69.8k|      pstr_sbr_grid->bs_abs_bord_0 = a_l;
  599|  69.8k|      pstr_sbr_grid->bs_abs_bord_1 = a_r;
  600|  69.8k|      pstr_sbr_grid->bs_num_rel_0 = ptr_n_l;
  601|  69.8k|      pstr_sbr_grid->bs_num_rel_1 = n_r;
  602|  69.8k|      pstr_sbr_grid->p = p;
  603|       |
  604|  69.8k|      break;
  605|       |
  606|      0|    default:
  ------------------
  |  Branch (606:5): [True: 0, False: 149k]
  ------------------
  607|      0|      break;
  608|   149k|  }
  609|   149k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_fill_frame_inter:
  198|  69.8k|                                      WORD32 dmin, WORD32 dmax) {
  199|  69.8k|  WORD32 middle, b_new, num_bord_follow, bord_max_follow;
  200|       |
  201|  69.8k|  if (fill_follow >= 1) {
  ------------------
  |  Branch (201:7): [True: 35.2k, False: 34.5k]
  ------------------
  202|  35.2k|    *ptr_length_v_bord_follow = fill_follow;
  203|  35.2k|    *ptr_length_v_freq_follow = fill_follow;
  204|  35.2k|  }
  205|       |
  206|  69.8k|  num_bord_follow = *ptr_length_v_bord_follow;
  207|       |
  208|  69.8k|  bord_max_follow = ptr_v_bord_follow[num_bord_follow - 1];
  209|       |
  210|  69.8k|  middle = bmin - bord_max_follow;
  211|       |
  212|  82.0k|  while (middle < 0) {
  ------------------
  |  Branch (212:10): [True: 12.2k, False: 69.8k]
  ------------------
  213|  12.2k|    num_bord_follow--;
  214|       |
  215|  12.2k|    bord_max_follow = ptr_v_bord_follow[num_bord_follow - 1];
  216|       |
  217|  12.2k|    middle = bmin - bord_max_follow;
  218|  12.2k|  }
  219|       |
  220|  69.8k|  *ptr_length_v_bord_follow = num_bord_follow;
  221|  69.8k|  *ptr_length_v_freq_follow = num_bord_follow;
  222|       |
  223|  69.8k|  *ptr_n_l = num_bord_follow - 1;
  224|       |
  225|  69.8k|  b_new = *ptr_length_v_bord;
  226|       |
  227|  69.8k|  if ((middle <= dmax) && (middle >= dmin)) {
  ------------------
  |  Branch (227:7): [True: 67.4k, False: 2.35k]
  |  Branch (227:27): [True: 40.1k, False: 27.2k]
  ------------------
  228|  40.1k|    ixheaace_add_vec_left(ptr_v_bord, ptr_length_v_bord, ptr_v_bord_follow,
  229|  40.1k|                          *ptr_length_v_bord_follow);
  230|       |
  231|  40.1k|    ixheaace_add_freq_vec_left(ptr_v_freq, ptr_length_v_freq, ptr_v_freq_follow,
  232|  40.1k|                               *ptr_length_v_freq_follow);
  233|  40.1k|  }
  234|       |
  235|  29.6k|  else if ((middle <= dmax) && (middle < dmin)) {
  ------------------
  |  Branch (235:12): [True: 27.2k, False: 2.35k]
  |  Branch (235:32): [True: 27.2k, False: 0]
  ------------------
  236|  27.2k|    if (ptr_ptr_v_tuning_segm[0] != 0) {
  ------------------
  |  Branch (236:9): [True: 0, False: 27.2k]
  ------------------
  237|      0|      *ptr_length_v_bord = b_new - 1;
  238|       |
  239|      0|      ixheaace_add_vec_left(ptr_v_bord, ptr_length_v_bord, ptr_v_bord_follow,
  240|      0|                            *ptr_length_v_bord_follow);
  241|       |
  242|      0|      *ptr_length_v_freq = b_new - 1;
  243|       |
  244|      0|      ixheaace_add_freq_vec_left(ptr_v_freq + 1, ptr_length_v_freq, ptr_v_freq_follow,
  245|      0|                                 *ptr_length_v_freq_follow);
  246|  27.2k|    } else {
  247|  27.2k|      if (*ptr_length_v_bord_follow > 1) {
  ------------------
  |  Branch (247:11): [True: 25.6k, False: 1.66k]
  ------------------
  248|  25.6k|        ixheaace_add_vec_left(ptr_v_bord, ptr_length_v_bord, ptr_v_bord_follow,
  249|  25.6k|                              *ptr_length_v_bord_follow - 1);
  250|       |
  251|  25.6k|        ixheaace_add_freq_vec_left(ptr_v_freq, ptr_length_v_freq, ptr_v_freq_follow,
  252|  25.6k|                                   *ptr_length_v_bord_follow - 1);
  253|       |
  254|  25.6k|        *ptr_n_l = *ptr_n_l - 1;
  255|  25.6k|      } else {
  256|  1.66k|        memmove(ptr_v_bord, ptr_v_bord + 1, (*ptr_length_v_bord - 1) * sizeof(*ptr_v_bord));
  257|       |
  258|  1.66k|        memmove(ptr_v_freq, ptr_v_freq + 1, (*ptr_length_v_freq - 1) * sizeof(*ptr_v_freq));
  259|  1.66k|        *ptr_length_v_bord = b_new - 1;
  260|  1.66k|        *ptr_length_v_freq = b_new - 1;
  261|       |
  262|  1.66k|        ixheaace_add_vec_left(ptr_v_bord, ptr_length_v_bord, ptr_v_bord_follow,
  263|  1.66k|                              *ptr_length_v_bord_follow);
  264|       |
  265|  1.66k|        ixheaace_add_freq_vec_left(ptr_v_freq, ptr_length_v_freq, ptr_v_freq_follow,
  266|  1.66k|                                   *ptr_length_v_freq_follow);
  267|  1.66k|      }
  268|  27.2k|    }
  269|  27.2k|  } else {
  270|  2.35k|    ixheaace_fill_frame_pre(dmax, ptr_v_bord, ptr_length_v_bord, ptr_v_freq, ptr_length_v_freq,
  271|  2.35k|                            bmin, middle);
  272|       |
  273|  2.35k|    ixheaace_add_vec_left(ptr_v_bord, ptr_length_v_bord, ptr_v_bord_follow,
  274|  2.35k|                          *ptr_length_v_bord_follow);
  275|       |
  276|  2.35k|    ixheaace_add_freq_vec_left(ptr_v_freq, ptr_length_v_freq, ptr_v_freq_follow,
  277|  2.35k|                               *ptr_length_v_freq_follow);
  278|  2.35k|  }
  279|  69.8k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_add_freq_vec_left:
   51|  69.8k|                                       ixheaace_freq_res *ptr_src, WORD32 length_src) {
   52|  69.8k|  WORD32 i;
   53|  69.8k|  i = length_src - 1;
   54|   169k|  while (i >= 0) {
  ------------------
  |  Branch (54:10): [True: 99.7k, False: 69.8k]
  ------------------
   55|  99.7k|    ixheaace_add_freq_left(ptr_dst, length_dst, ptr_src[i]);
   56|  99.7k|    i--;
   57|  99.7k|  }
   58|  69.8k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_ctrl_signal2_frame_info:
  716|   466k|    ixheaace_freq_res freq_res_fix, ixheaace_str_qmf_tabs *ptr_qmf_tab, WORD32 frame_length_480) {
  717|   466k|  WORD32 n_env = 0, border = 0, i, k, p;
  718|   466k|  WORD32 *ptr_v_r = pstr_sbr_grid->bs_rel_bord;
  719|   466k|  ixheaace_freq_res *ptr_v_f = pstr_sbr_grid->v_f;
  720|       |
  721|   466k|  ixheaace_frame_class frame_type = pstr_sbr_grid->frame_type;
  722|       |
  723|   466k|  switch (frame_type) {
  724|   316k|    case IXHEAACE_FIXFIX:
  ------------------
  |  Branch (724:5): [True: 316k, False: 149k]
  ------------------
  725|   316k|      if (frame_length_480) {
  ------------------
  |  Branch (725:11): [True: 29.0k, False: 287k]
  ------------------
  726|  29.0k|        ixheaace_create_def_frame_480_info(pstr_sbr_frame_info, pstr_sbr_grid->bs_num_env,
  727|  29.0k|                                           ptr_qmf_tab);
  728|   287k|      } else {
  729|   287k|        ixheaace_create_def_frame_info(pstr_sbr_frame_info, pstr_sbr_grid->bs_num_env,
  730|   287k|                                       ptr_qmf_tab);
  731|   287k|      }
  732|       |
  733|   316k|      if (freq_res_fix == FREQ_RES_LOW) {
  ------------------
  |  Branch (733:11): [True: 31.8k, False: 285k]
  ------------------
  734|  65.0k|        for (i = 0; i < pstr_sbr_frame_info->n_envelopes; i++) {
  ------------------
  |  Branch (734:21): [True: 33.2k, False: 31.8k]
  ------------------
  735|  33.2k|          pstr_sbr_frame_info->freq_res[i] = FREQ_RES_LOW;
  736|  33.2k|        }
  737|  31.8k|      }
  738|   316k|      break;
  739|       |
  740|  40.4k|    case IXHEAACE_FIXVAR:
  ------------------
  |  Branch (740:5): [True: 40.4k, False: 425k]
  ------------------
  741|  79.2k|    case IXHEAACE_VARFIX:
  ------------------
  |  Branch (741:5): [True: 38.8k, False: 427k]
  ------------------
  742|       |
  743|  79.2k|      n_env = pstr_sbr_grid->n + 1;
  744|       |
  745|  79.2k|      if ((n_env <= 0) || (n_env > IXHEAACE_MAX_ENV_FIXVAR_VARFIX)) {
  ------------------
  |  |   24|  79.2k|#define IXHEAACE_MAX_ENV_FIXVAR_VARFIX (4)
  ------------------
  |  Branch (745:11): [True: 0, False: 79.2k]
  |  Branch (745:27): [True: 0, False: 79.2k]
  ------------------
  746|      0|        return IA_EXHEAACE_EXE_FATAL_INVALID_SBR_NUM_ENVELOPES;
  747|      0|      }
  748|       |
  749|  79.2k|      pstr_sbr_frame_info->n_envelopes = n_env;
  750|       |
  751|  79.2k|      border = pstr_sbr_grid->bs_abs_bord;
  752|       |
  753|  79.2k|      pstr_sbr_frame_info->n_noise_envelopes = (n_env == 1 ? 1 : 2);
  ------------------
  |  Branch (753:49): [True: 0, False: 79.2k]
  ------------------
  754|       |
  755|  79.2k|      break;
  756|       |
  757|  69.8k|    case IXHEAACE_VARVAR:
  ------------------
  |  Branch (757:5): [True: 69.8k, False: 396k]
  ------------------
  758|  69.8k|      break;
  759|      0|    default:
  ------------------
  |  Branch (759:5): [True: 0, False: 466k]
  ------------------
  760|      0|      return IA_EXHEAACE_EXE_FATAL_INVALID_SBR_FRAME_TYPE;
  761|      0|      break;
  762|   466k|  }
  763|       |
  764|   466k|  switch (frame_type) {
  765|  40.4k|    case IXHEAACE_FIXVAR:
  ------------------
  |  Branch (765:5): [True: 40.4k, False: 425k]
  ------------------
  766|       |
  767|  40.4k|      pstr_sbr_frame_info->borders[0] = 0;
  768|       |
  769|  40.4k|      pstr_sbr_frame_info->borders[n_env] = border;
  770|       |
  771|  40.4k|      k = 0;
  772|  40.4k|      i = n_env - 1;
  773|   127k|      while (k < n_env - 1) {
  ------------------
  |  Branch (773:14): [True: 87.3k, False: 40.4k]
  ------------------
  774|  87.3k|        border -= ptr_v_r[k];
  775|       |
  776|  87.3k|        pstr_sbr_frame_info->borders[i] = border;
  777|  87.3k|        k++;
  778|  87.3k|        i--;
  779|  87.3k|      }
  780|       |
  781|  40.4k|      p = pstr_sbr_grid->p;
  782|       |
  783|  40.4k|      if (p == 0) {
  ------------------
  |  Branch (783:11): [True: 0, False: 40.4k]
  ------------------
  784|      0|        pstr_sbr_frame_info->short_env = 0;
  785|  40.4k|      } else {
  786|  40.4k|        pstr_sbr_frame_info->short_env = n_env + 1 - p;
  787|  40.4k|      }
  788|       |
  789|   168k|      for (k = 0, i = n_env - 1; k < n_env; k++, i--) {
  ------------------
  |  Branch (789:34): [True: 127k, False: 40.4k]
  ------------------
  790|   127k|        pstr_sbr_frame_info->freq_res[i] = ptr_v_f[k];
  791|   127k|      }
  792|       |
  793|  40.4k|      if (p == 0 || p == 1) {
  ------------------
  |  Branch (793:11): [True: 0, False: 40.4k]
  |  Branch (793:21): [True: 3.17k, False: 37.2k]
  ------------------
  794|  3.17k|        pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_frame_info->borders[n_env - 1];
  795|  37.2k|      } else {
  796|  37.2k|        pstr_sbr_frame_info->borders_noise[1] =
  797|  37.2k|            pstr_sbr_frame_info->borders[pstr_sbr_frame_info->short_env];
  798|  37.2k|      }
  799|       |
  800|  40.4k|      break;
  801|       |
  802|  38.8k|    case IXHEAACE_VARFIX:
  ------------------
  |  Branch (802:5): [True: 38.8k, False: 427k]
  ------------------
  803|  38.8k|      pstr_sbr_frame_info->borders[0] = border;
  804|       |
  805|  80.6k|      for (k = 0; k < n_env - 1; k++) {
  ------------------
  |  Branch (805:19): [True: 41.8k, False: 38.8k]
  ------------------
  806|  41.8k|        border += ptr_v_r[k];
  807|       |
  808|  41.8k|        pstr_sbr_frame_info->borders[k + 1] = border;
  809|  41.8k|      }
  810|       |
  811|  38.8k|      pstr_sbr_frame_info->borders[n_env] = 16;
  812|       |
  813|  38.8k|      p = pstr_sbr_grid->p;
  814|       |
  815|  38.8k|      if (p == 0 || p == 1) {
  ------------------
  |  Branch (815:11): [True: 35.8k, False: 2.98k]
  |  Branch (815:21): [True: 2.98k, False: 0]
  ------------------
  816|  38.8k|        pstr_sbr_frame_info->short_env = 0;
  817|  38.8k|      } else {
  818|      0|        pstr_sbr_frame_info->short_env = p - 1;
  819|      0|      }
  820|       |
  821|   119k|      for (k = 0; k < n_env; k++) {
  ------------------
  |  Branch (821:19): [True: 80.6k, False: 38.8k]
  ------------------
  822|  80.6k|        pstr_sbr_frame_info->freq_res[k] = ptr_v_f[k];
  823|  80.6k|      }
  824|       |
  825|  38.8k|      switch (p) {
  826|  35.8k|        case 0:
  ------------------
  |  Branch (826:9): [True: 35.8k, False: 2.98k]
  ------------------
  827|  35.8k|          pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_frame_info->borders[1];
  828|  35.8k|          break;
  829|  2.98k|        case 1:
  ------------------
  |  Branch (829:9): [True: 2.98k, False: 35.8k]
  ------------------
  830|  2.98k|          pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_frame_info->borders[n_env - 1];
  831|  2.98k|          break;
  832|      0|        default:
  ------------------
  |  Branch (832:9): [True: 0, False: 38.8k]
  ------------------
  833|      0|          pstr_sbr_frame_info->borders_noise[1] =
  834|      0|              pstr_sbr_frame_info->borders[pstr_sbr_frame_info->short_env];
  835|      0|          break;
  836|  38.8k|      }
  837|  38.8k|      break;
  838|       |
  839|  69.8k|    case IXHEAACE_VARVAR:
  ------------------
  |  Branch (839:5): [True: 69.8k, False: 396k]
  ------------------
  840|  69.8k|      n_env = pstr_sbr_grid->bs_num_rel_0 + pstr_sbr_grid->bs_num_rel_1 + 1;
  841|       |
  842|  69.8k|      if ((n_env < 1) || (n_env > IXHEAACE_MAX_ENV_VARVAR)) {
  ------------------
  |  |   23|  69.8k|#define IXHEAACE_MAX_ENV_VARVAR (IXHEAACE_MAX_ENV)
  |  |  ------------------
  |  |  |  |   88|  69.8k|#define IXHEAACE_MAX_ENV (MAXIMUM_ENVELOPES_USAC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  69.8k|#define MAXIMUM_ENVELOPES_USAC (8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (842:11): [True: 0, False: 69.8k]
  |  Branch (842:26): [True: 0, False: 69.8k]
  ------------------
  843|      0|        return IA_EXHEAACE_EXE_FATAL_INVALID_SBR_NUM_ENVELOPES;
  844|      0|      }
  845|  69.8k|      pstr_sbr_frame_info->n_envelopes = n_env;
  846|       |
  847|  69.8k|      pstr_sbr_frame_info->borders[0] = border = pstr_sbr_grid->bs_abs_bord_0;
  848|       |
  849|  99.7k|      for (k = 0, i = 1; k < pstr_sbr_grid->bs_num_rel_0; k++, i++) {
  ------------------
  |  Branch (849:26): [True: 29.8k, False: 69.8k]
  ------------------
  850|  29.8k|        border += pstr_sbr_grid->bs_rel_bord_0[k];
  851|       |
  852|  29.8k|        pstr_sbr_frame_info->borders[i] = border;
  853|  29.8k|      }
  854|       |
  855|  69.8k|      border = pstr_sbr_grid->bs_abs_bord_1;
  856|       |
  857|  69.8k|      pstr_sbr_frame_info->borders[n_env] = border;
  858|       |
  859|   216k|      for (k = 0, i = n_env - 1; k < pstr_sbr_grid->bs_num_rel_1; k++, i--) {
  ------------------
  |  Branch (859:34): [True: 146k, False: 69.8k]
  ------------------
  860|   146k|        border -= pstr_sbr_grid->bs_rel_bord_1[k];
  861|       |
  862|   146k|        pstr_sbr_frame_info->borders[i] = border;
  863|   146k|      }
  864|       |
  865|  69.8k|      p = pstr_sbr_grid->p;
  866|       |
  867|  69.8k|      pstr_sbr_frame_info->short_env = (p == 0 ? 0 : n_env + 1 - p);
  ------------------
  |  Branch (867:41): [True: 0, False: 69.8k]
  ------------------
  868|       |
  869|   316k|      for (k = 0; k < n_env; k++) {
  ------------------
  |  Branch (869:19): [True: 246k, False: 69.8k]
  ------------------
  870|   246k|        pstr_sbr_frame_info->freq_res[k] = pstr_sbr_grid->v_f_lr[k];
  871|   246k|      }
  872|       |
  873|  69.8k|      if (n_env == 1) {
  ------------------
  |  Branch (873:11): [True: 0, False: 69.8k]
  ------------------
  874|      0|        pstr_sbr_frame_info->n_noise_envelopes = 1;
  875|      0|        pstr_sbr_frame_info->borders_noise[0] = pstr_sbr_grid->bs_abs_bord_0;
  876|      0|        pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_grid->bs_abs_bord_1;
  877|  69.8k|      } else {
  878|  69.8k|        pstr_sbr_frame_info->n_noise_envelopes = 2;
  879|  69.8k|        pstr_sbr_frame_info->borders_noise[0] = pstr_sbr_grid->bs_abs_bord_0;
  880|       |
  881|  69.8k|        if (p == 0 || p == 1) {
  ------------------
  |  Branch (881:13): [True: 0, False: 69.8k]
  |  Branch (881:23): [True: 10.2k, False: 59.5k]
  ------------------
  882|  10.2k|          pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_frame_info->borders[n_env - 1];
  883|  59.5k|        } else {
  884|  59.5k|          pstr_sbr_frame_info->borders_noise[1] =
  885|  59.5k|              pstr_sbr_frame_info->borders[pstr_sbr_frame_info->short_env];
  886|  59.5k|        }
  887|       |
  888|  69.8k|        pstr_sbr_frame_info->borders_noise[2] = pstr_sbr_grid->bs_abs_bord_1;
  889|  69.8k|      }
  890|  69.8k|      break;
  891|       |
  892|   316k|    default:
  ------------------
  |  Branch (892:5): [True: 316k, False: 149k]
  ------------------
  893|   316k|      break;
  894|   466k|  }
  895|       |
  896|   466k|  if (frame_type == IXHEAACE_VARFIX || frame_type == IXHEAACE_FIXVAR) {
  ------------------
  |  Branch (896:7): [True: 38.8k, False: 427k]
  |  Branch (896:40): [True: 40.4k, False: 386k]
  ------------------
  897|  79.2k|    pstr_sbr_frame_info->borders_noise[0] = pstr_sbr_frame_info->borders[0];
  898|       |
  899|  79.2k|    if (n_env == 1) {
  ------------------
  |  Branch (899:9): [True: 0, False: 79.2k]
  ------------------
  900|      0|      pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_frame_info->borders[n_env];
  901|  79.2k|    } else {
  902|  79.2k|      pstr_sbr_frame_info->borders_noise[2] = pstr_sbr_frame_info->borders[n_env];
  903|  79.2k|    }
  904|  79.2k|  }
  905|   466k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   466k|#define IA_NO_ERROR 0x00000000
  ------------------
  906|   466k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_create_def_frame_480_info:
  689|  63.0k|                                               WORD32 n_env, ixheaace_str_qmf_tabs *ptr_qmf_tab) {
  690|  63.0k|  switch (n_env) {
  ------------------
  |  Branch (690:11): [True: 63.0k, False: 0]
  ------------------
  691|  59.8k|    case NUM_ENVELOPE_1:
  ------------------
  |  |   30|  59.8k|#define NUM_ENVELOPE_1 (1)
  ------------------
  |  Branch (691:5): [True: 59.8k, False: 3.19k]
  ------------------
  692|       |
  693|  59.8k|      memcpy(pstr_sbr_frame_info, &(ptr_qmf_tab->frame_480_info1_2048),
  694|  59.8k|             sizeof(ixheaace_str_frame_info_sbr));
  695|       |
  696|  59.8k|      break;
  697|       |
  698|  3.19k|    case NUM_ENVELOPE_2:
  ------------------
  |  |   31|  3.19k|#define NUM_ENVELOPE_2 (2)
  ------------------
  |  Branch (698:5): [True: 3.19k, False: 59.8k]
  ------------------
  699|       |
  700|  3.19k|      memcpy(pstr_sbr_frame_info, &(ptr_qmf_tab->frame_480_info2_2048),
  701|  3.19k|             sizeof(ixheaace_str_frame_info_sbr));
  702|       |
  703|  3.19k|      break;
  704|       |
  705|      0|    case NUM_ENVELOPE_4:
  ------------------
  |  |   32|      0|#define NUM_ENVELOPE_4 (4)
  ------------------
  |  Branch (705:5): [True: 0, False: 63.0k]
  ------------------
  706|       |
  707|      0|      memcpy(pstr_sbr_frame_info, &(ptr_qmf_tab->frame_480_info4_2048),
  708|      0|             sizeof(ixheaace_str_frame_info_sbr));
  709|       |
  710|      0|      break;
  711|  63.0k|  }
  712|  63.0k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_create_def_frame_info:
  612|   330k|                                           WORD32 n_env, ixheaace_str_qmf_tabs *ptr_qmf_tab) {
  613|   330k|  switch (n_env) {
  ------------------
  |  Branch (613:11): [True: 330k, False: 0]
  ------------------
  614|   306k|    case NUM_ENVELOPE_1:
  ------------------
  |  |   30|   306k|#define NUM_ENVELOPE_1 (1)
  ------------------
  |  Branch (614:5): [True: 306k, False: 23.1k]
  ------------------
  615|       |
  616|   306k|      memcpy(pstr_sbr_frame_info, &(ptr_qmf_tab->frame_info1_2048),
  617|   306k|             sizeof(ixheaace_str_frame_info_sbr));
  618|       |
  619|   306k|      break;
  620|       |
  621|  23.1k|    case NUM_ENVELOPE_2:
  ------------------
  |  |   31|  23.1k|#define NUM_ENVELOPE_2 (2)
  ------------------
  |  Branch (621:5): [True: 23.1k, False: 306k]
  ------------------
  622|       |
  623|  23.1k|      memcpy(pstr_sbr_frame_info, &(ptr_qmf_tab->frame_info2_2048),
  624|  23.1k|             sizeof(ixheaace_str_frame_info_sbr));
  625|       |
  626|  23.1k|      break;
  627|       |
  628|      0|    case NUM_ENVELOPE_4:
  ------------------
  |  |   32|      0|#define NUM_ENVELOPE_4 (4)
  ------------------
  |  Branch (628:5): [True: 0, False: 330k]
  ------------------
  629|       |
  630|      0|      memcpy(pstr_sbr_frame_info, &(ptr_qmf_tab->frame_info4_2048),
  631|      0|             sizeof(ixheaace_str_frame_info_sbr));
  632|       |
  633|      0|      break;
  634|   330k|  }
  635|   330k|}
ixheaace_sbr_frame_info_gen.c:ixheaace_create_ld_transient_frame_info:
  638|  37.6k|    WORD32 tran_pos, WORD32 num_time_slots, WORD32 low_tran_flag) {
  639|  37.6k|  WORD32 num_env, i, diff;
  640|  37.6k|  const WORD32 *env_tab = NULL;
  641|       |
  642|  37.6k|  switch (num_time_slots)
  643|       |
  644|  37.6k|  {
  645|  15.2k|    case TIME_SLOTS_15:
  ------------------
  |  |   29|  15.2k|#define TIME_SLOTS_15 (15)
  ------------------
  |  Branch (645:5): [True: 15.2k, False: 22.3k]
  ------------------
  646|  15.2k|      env_tab = ixheaace_ld_env_tab_480[tran_pos];
  647|  15.2k|      break;
  648|       |
  649|  22.3k|    default:
  ------------------
  |  Branch (649:5): [True: 22.3k, False: 15.2k]
  ------------------
  650|  22.3k|      env_tab = ixheaace_ld_env_tab_512[tran_pos];
  651|  22.3k|      break;
  652|  37.6k|  }
  653|       |
  654|  37.6k|  num_env = env_tab[0];
  655|       |
  656|   109k|  for (i = 1; i < num_env; i++) {
  ------------------
  |  Branch (656:15): [True: 71.9k, False: 37.6k]
  ------------------
  657|  71.9k|    pstr_sbr_frame_info->borders[i] = env_tab[i];
  658|  71.9k|  }
  659|       |
  660|  37.6k|  pstr_sbr_frame_info->borders[0] = 0;
  661|  37.6k|  pstr_sbr_frame_info->borders[num_env] = num_time_slots;
  662|       |
  663|  37.6k|  i = 0;
  664|   147k|  while (i < num_env) {
  ------------------
  |  Branch (664:10): [True: 109k, False: 37.6k]
  ------------------
  665|   109k|    diff = pstr_sbr_frame_info->borders[i + 1] - pstr_sbr_frame_info->borders[i];
  666|       |
  667|   109k|    if (low_tran_flag) {
  ------------------
  |  Branch (667:9): [True: 67.6k, False: 41.9k]
  ------------------
  668|  67.6k|      pstr_sbr_frame_info->freq_res[i] = FREQ_RES_LOW;
  669|  67.6k|    } else {
  670|  41.9k|      pstr_sbr_frame_info->freq_res[i] = (diff <= 5) ? FREQ_RES_LOW : FREQ_RES_HIGH;
  ------------------
  |  Branch (670:42): [True: 27.4k, False: 14.4k]
  ------------------
  671|  41.9k|    }
  672|       |
  673|   109k|    pstr_sbr_grid->v_f[i] = pstr_sbr_frame_info->freq_res[i];
  674|       |
  675|   109k|    i++;
  676|   109k|  }
  677|       |
  678|  37.6k|  pstr_sbr_frame_info->n_envelopes = num_env;
  679|  37.6k|  pstr_sbr_frame_info->short_env = env_tab[IXHEAACE_SBR_ENVT_TRANIDX];
  ------------------
  |  |   29|  37.6k|#define IXHEAACE_SBR_ENVT_TRANIDX (3)
  ------------------
  680|  37.6k|  pstr_sbr_frame_info->borders_noise[0] = pstr_sbr_frame_info->borders[0];
  681|  37.6k|  pstr_sbr_frame_info->borders_noise[1] = pstr_sbr_frame_info->borders[1];
  682|  37.6k|  pstr_sbr_frame_info->borders_noise[2] = num_time_slots;
  683|  37.6k|  pstr_sbr_frame_info->n_noise_envelopes = 2;
  684|  37.6k|  pstr_sbr_grid->frame_type = IXHEAACE_LD_TRAN;
  ------------------
  |  |   26|  37.6k|#define IXHEAACE_LD_TRAN (1)
  ------------------
  685|  37.6k|  pstr_sbr_grid->bs_transient_position = tran_pos;
  686|  37.6k|  pstr_sbr_grid->bs_num_env = num_env;
  687|  37.6k|}

ixheaace_get_sbr_start_freq_raw:
  342|  8.64k|ixheaace_get_sbr_start_freq_raw(WORD32 start_freq, WORD32 qmf_bands, WORD32 fs) {
  343|  8.64k|  WORD32 result;
  344|       |
  345|  8.64k|  if (start_freq < 0 || start_freq > 15) {
  ------------------
  |  Branch (345:7): [True: 0, False: 8.64k]
  |  Branch (345:25): [True: 0, False: 8.64k]
  ------------------
  346|      0|    return -1;
  347|      0|  }
  348|       |
  349|  8.64k|  result = ixheaace_get_start_freq(fs, start_freq);
  350|       |
  351|  8.64k|  result = (result * fs / qmf_bands + 1) >> 1;
  352|       |
  353|  8.64k|  return result;
  354|  8.64k|}
ixheaace_find_start_and_stop_band:
  406|  5.89k|                                  ixheaace_sbr_codec_type sbr_codec) {
  407|  5.89k|  switch (sbr_codec) {
  408|  2.94k|    case USAC_SBR: {
  ------------------
  |  Branch (408:5): [True: 2.94k, False: 2.95k]
  ------------------
  409|  2.94k|      if (sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|  2.94k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (409:11): [True: 578, False: 2.36k]
  ------------------
  410|    578|        *ptr_k0 = ixheaace_get_start_freq_4_1(sampling_freq, start_freq);
  411|  2.36k|      } else {
  412|  2.36k|        *ptr_k0 = ixheaace_get_start_freq(sampling_freq, start_freq);
  413|  2.36k|      }
  414|  2.94k|      break;
  415|      0|    }
  416|  2.95k|    default: {
  ------------------
  |  Branch (416:5): [True: 2.95k, False: 2.94k]
  ------------------
  417|  2.95k|      *ptr_k0 = ixheaace_get_start_freq(sampling_freq, start_freq);
  418|  2.95k|      break;
  419|      0|    }
  420|  5.89k|  }
  421|  5.89k|  if ((sample_rate_mode == 1) && (sampling_freq * num_channels < 2 * *ptr_k0 * sampling_freq)) {
  ------------------
  |  Branch (421:7): [True: 4.85k, False: 1.04k]
  |  Branch (421:34): [True: 0, False: 4.85k]
  ------------------
  422|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_SAMPLERATE_MODE;
  423|      0|  }
  424|       |
  425|  5.89k|  if (stop_freq < 14) {
  ------------------
  |  Branch (425:7): [True: 5.89k, False: 0]
  ------------------
  426|  5.89k|    switch (sbr_codec) {
  427|  2.94k|      case USAC_SBR: {
  ------------------
  |  Branch (427:7): [True: 2.94k, False: 2.95k]
  ------------------
  428|  2.94k|        if (USAC_SBR_RATIO_INDEX_4_1 == sbr_ratio_idx) {
  ------------------
  |  |  188|  2.94k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (428:13): [True: 578, False: 2.36k]
  ------------------
  429|    578|          *ptr_k2 = ixheaace_get_stop_freq_4_1(sampling_freq, stop_freq);
  430|  2.36k|        } else {
  431|  2.36k|          *ptr_k2 = ixheaace_get_usac_stop_freq(sampling_freq, stop_freq);
  432|  2.36k|        }
  433|  2.94k|        break;
  434|      0|      }
  435|  2.95k|      default: {
  ------------------
  |  Branch (435:7): [True: 2.95k, False: 2.94k]
  ------------------
  436|  2.95k|        *ptr_k2 = ixheaace_get_stop_freq(sampling_freq, stop_freq);
  437|  2.95k|        break;
  438|      0|      }
  439|  5.89k|    }
  440|  5.89k|  }
  441|       |
  442|      0|  else {
  443|      0|    *ptr_k2 = (stop_freq == 14 ? 2 * *ptr_k0 : 3 * *ptr_k0);
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|  }
  445|       |
  446|  5.89k|  if (*ptr_k2 > num_channels) {
  ------------------
  |  Branch (446:7): [True: 0, False: 5.89k]
  ------------------
  447|      0|    *ptr_k2 = num_channels;
  448|      0|  }
  449|  5.89k|  if (sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (449:7): [True: 2.94k, False: 2.95k]
  ------------------
  450|  2.94k|    if (sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|  2.94k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (450:9): [True: 578, False: 2.36k]
  ------------------
  451|    578|      if (((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_USAC) || (*ptr_k2 <= *ptr_k0)) {
  ------------------
  |  |   76|    578|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  ------------------
  |  Branch (451:11): [True: 0, False: 578]
  |  Branch (451:63): [True: 0, False: 578]
  ------------------
  452|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  453|      0|      }
  454|    578|      if ((2 * sampling_freq == 44100) && ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_USAC)) {
  ------------------
  |  |   76|     56|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  ------------------
  |  Branch (454:11): [True: 56, False: 522]
  |  Branch (454:43): [True: 0, False: 56]
  ------------------
  455|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  456|      0|      }
  457|    578|      if ((2 * sampling_freq >= 48000) && ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_USAC)) {
  ------------------
  |  |   76|    430|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  ------------------
  |  Branch (457:11): [True: 430, False: 148]
  |  Branch (457:43): [True: 0, False: 430]
  ------------------
  458|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  459|      0|      }
  460|  2.36k|    } else {
  461|  2.36k|      if (sampling_freq <= 32000) {
  ------------------
  |  Branch (461:11): [True: 1.14k, False: 1.22k]
  ------------------
  462|  1.14k|        if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_LE32KHZ) {
  ------------------
  |  |   61|  1.14k|#define MAXIMUM_FREQ_COEFFS_LE32KHZ (48)
  ------------------
  |  Branch (462:13): [True: 0, False: 1.14k]
  ------------------
  463|      0|          return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  464|      0|        }
  465|  1.22k|      } else if (sampling_freq == 44100) {
  ------------------
  |  Branch (465:18): [True: 498, False: 724]
  ------------------
  466|    498|        if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_EQ44KHZ) {
  ------------------
  |  |   62|    498|#define MAXIMUM_FREQ_COEFFS_EQ44KHZ (35)
  ------------------
  |  Branch (466:13): [True: 0, False: 498]
  ------------------
  467|      0|          return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  468|      0|        }
  469|    724|      } else if (sampling_freq >= 48000) {
  ------------------
  |  Branch (469:18): [True: 723, False: 1]
  ------------------
  470|    723|        if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_GE48KHZ) {
  ------------------
  |  |   63|    723|#define MAXIMUM_FREQ_COEFFS_GE48KHZ (32)
  ------------------
  |  Branch (470:13): [True: 6, False: 717]
  ------------------
  471|      6|          return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  472|      6|        }
  473|    723|      } else {
  474|      1|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  475|      1|      }
  476|  2.36k|    }
  477|  2.95k|  } else {
  478|  2.95k|    if (sampling_freq <= 32000) {
  ------------------
  |  Branch (478:9): [True: 1.07k, False: 1.88k]
  ------------------
  479|  1.07k|      if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_LE32KHZ) {
  ------------------
  |  |   61|  1.07k|#define MAXIMUM_FREQ_COEFFS_LE32KHZ (48)
  ------------------
  |  Branch (479:11): [True: 0, False: 1.07k]
  ------------------
  480|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  481|      0|      }
  482|  1.88k|    } else if (sampling_freq == 44100) {
  ------------------
  |  Branch (482:16): [True: 938, False: 948]
  ------------------
  483|    938|      if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_EQ44KHZ) {
  ------------------
  |  |   62|    938|#define MAXIMUM_FREQ_COEFFS_EQ44KHZ (35)
  ------------------
  |  Branch (483:11): [True: 0, False: 938]
  ------------------
  484|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  485|      0|      }
  486|    948|    } else if (sampling_freq >= 48000) {
  ------------------
  |  Branch (486:16): [True: 948, False: 0]
  ------------------
  487|    948|      if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_GE48KHZ) {
  ------------------
  |  |   63|    948|#define MAXIMUM_FREQ_COEFFS_GE48KHZ (32)
  ------------------
  |  Branch (487:11): [True: 0, False: 948]
  ------------------
  488|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  489|      0|      }
  490|    948|    } else {
  491|      0|      return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  492|      0|    }
  493|  2.95k|  }
  494|       |
  495|  5.89k|  if ((*ptr_k2 - *ptr_k0) < 0) {
  ------------------
  |  Branch (495:7): [True: 0, False: 5.89k]
  ------------------
  496|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  497|      0|  }
  498|       |
  499|  5.89k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  5.89k|#define IA_NO_ERROR 0x00000000
  ------------------
  500|  5.89k|}
ixheaace_update_freq_scale:
  507|  5.89k|{
  508|  5.89k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  5.89k|#define IA_NO_ERROR 0x00000000
  ------------------
  509|  5.89k|  WORD32 b_p_o = 0;
  510|  5.89k|  WORD32 dk = 0;
  511|       |
  512|  5.89k|  FLOAT32 warp;
  513|  5.89k|  WORD32 k1 = 0, i;
  514|  5.89k|  WORD32 num_bands0;
  515|  5.89k|  WORD32 num_bands1;
  516|  5.89k|  WORD32 diff_tot[IXHEAACE_MAXIMUM_OCTAVE + IXHEAACE_MAXIMUM_SECOND_REGION] = {0};
  517|  5.89k|  WORD32 *diff0 = diff_tot;
  518|  5.89k|  WORD32 *diff1 = diff_tot + IXHEAACE_MAXIMUM_OCTAVE;
  ------------------
  |  |   23|  5.89k|#define IXHEAACE_MAXIMUM_OCTAVE (29)
  ------------------
  519|  5.89k|  WORD32 k2_achived;
  520|  5.89k|  WORD32 k2_diff;
  521|  5.89k|  WORD32 incr = 0;
  522|       |
  523|  5.89k|  switch (freq_scale) {
  ------------------
  |  Branch (523:11): [True: 5.89k, False: 0]
  ------------------
  524|  3.12k|    case 1:
  ------------------
  |  Branch (524:5): [True: 3.12k, False: 2.76k]
  ------------------
  525|  3.12k|      b_p_o = 12;
  526|  3.12k|      break;
  527|  1.24k|    case 2:
  ------------------
  |  Branch (527:5): [True: 1.24k, False: 4.65k]
  ------------------
  528|  1.24k|      b_p_o = 10;
  529|  1.24k|      break;
  530|  1.52k|    case 3:
  ------------------
  |  Branch (530:5): [True: 1.52k, False: 4.36k]
  ------------------
  531|  1.52k|      b_p_o = 8;
  532|  1.52k|      break;
  533|  5.89k|  }
  534|       |
  535|  5.89k|  if (freq_scale > 0) {
  ------------------
  |  Branch (535:7): [True: 5.89k, False: 0]
  ------------------
  536|  5.89k|    if (alter_scale == 0) {
  ------------------
  |  Branch (536:9): [True: 0, False: 5.89k]
  ------------------
  537|      0|      warp = 1.0f;
  538|  5.89k|    } else {
  539|  5.89k|      warp = 1.3f;
  540|  5.89k|    }
  541|       |
  542|  5.89k|    if (IXHEAACE_QUAD_RATE == sbr_rate) {
  ------------------
  |  Branch (542:9): [True: 578, False: 5.31k]
  ------------------
  543|    578|      if (k0 < b_p_o) {
  ------------------
  |  Branch (543:11): [True: 0, False: 578]
  ------------------
  544|      0|        b_p_o = (k0 >> 1) * 2;
  545|      0|      }
  546|    578|    }
  547|       |
  548|  5.89k|    if (4 * k2 >= 9 * k0) {
  ------------------
  |  Branch (548:9): [True: 4.13k, False: 1.75k]
  ------------------
  549|  4.13k|      k1 = 2 * k0;
  550|  4.13k|      num_bands0 = ixheaace_number_of_bands(b_p_o, k0, k1, 1.0f);
  551|  4.13k|      num_bands1 = ixheaace_number_of_bands(b_p_o, k1, k2, warp);
  552|       |
  553|  4.13k|      ixheaace_calc_bands(diff0, k0, k1, num_bands0);
  554|  4.13k|      ixheaace_shellsort_int(diff0, num_bands0);
  555|       |
  556|  4.13k|      if (diff0[0] == 0) {
  ------------------
  |  Branch (556:11): [True: 3, False: 4.13k]
  ------------------
  557|      3|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  558|      3|      }
  559|       |
  560|  4.13k|      ixheaace_cum_sum(k0, diff0, num_bands0, ptr_k_master);
  561|       |
  562|  4.13k|      ixheaace_calc_bands(diff1, k1, k2, num_bands1);
  563|  4.13k|      ixheaace_shellsort_int(diff1, num_bands1);
  564|       |
  565|  4.13k|      if (diff0[num_bands0 - 1] > diff1[0]) {
  ------------------
  |  Branch (565:11): [True: 243, False: 3.89k]
  ------------------
  566|    243|        ixheaace_modify_bands(diff0[num_bands0 - 1], diff1, num_bands1);
  567|    243|      }
  568|       |
  569|  4.13k|      ixheaace_cum_sum(k1, diff1, num_bands1, &ptr_k_master[num_bands0]);
  570|  4.13k|      *ptr_num_bands = num_bands0 + num_bands1;
  571|  4.13k|    } else {
  572|  1.75k|      k1 = k2;
  573|  1.75k|      num_bands0 = ixheaace_number_of_bands(b_p_o, k0, k1, 1.0f);
  574|       |
  575|  1.75k|      ixheaace_calc_bands(diff0, k0, k1, num_bands0);
  576|  1.75k|      ixheaace_shellsort_int(diff0, num_bands0);
  577|       |
  578|  1.75k|      if (diff0[0] == 0) {
  ------------------
  |  Branch (578:11): [True: 0, False: 1.75k]
  ------------------
  579|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  580|      0|      }
  581|       |
  582|  1.75k|      ixheaace_cum_sum(k0, diff0, num_bands0, ptr_k_master);
  583|       |
  584|  1.75k|      *ptr_num_bands = num_bands0;
  585|  1.75k|    }
  586|  5.89k|  } else {
  587|      0|    if (alter_scale == 0) {
  ------------------
  |  Branch (587:9): [True: 0, False: 0]
  ------------------
  588|      0|      dk = 1;
  589|      0|      num_bands0 = 2 * ((k2 - k0) / 2);
  590|      0|    } else {
  591|      0|      dk = 2;
  592|      0|      num_bands0 = 2 * (((k2 - k0) / dk + 1) / 2);
  593|      0|    }
  594|       |
  595|      0|    k2_achived = k0 + num_bands0 * dk;
  596|      0|    k2_diff = k2 - k2_achived;
  597|       |
  598|      0|    for (i = 0; i < num_bands0; i++) {
  ------------------
  |  Branch (598:17): [True: 0, False: 0]
  ------------------
  599|      0|      diff_tot[i] = dk;
  600|      0|    }
  601|       |
  602|      0|    if (k2_diff < 0) {
  ------------------
  |  Branch (602:9): [True: 0, False: 0]
  ------------------
  603|      0|      incr = 1;
  604|      0|      i = 0;
  605|      0|    }
  606|       |
  607|      0|    if (k2_diff > 0) {
  ------------------
  |  Branch (607:9): [True: 0, False: 0]
  ------------------
  608|      0|      incr = -1;
  609|       |
  610|      0|      i = num_bands0 - 1;
  611|      0|    }
  612|       |
  613|      0|    while (k2_diff != 0) {
  ------------------
  |  Branch (613:12): [True: 0, False: 0]
  ------------------
  614|      0|      if (i < 0) break;
  ------------------
  |  Branch (614:11): [True: 0, False: 0]
  ------------------
  615|      0|      diff_tot[i] = diff_tot[i] - incr;
  616|       |
  617|      0|      i = i + incr;
  618|       |
  619|      0|      k2_diff = k2_diff + incr;
  620|      0|    }
  621|       |
  622|      0|    ixheaace_cum_sum(k0, diff_tot, num_bands0, ptr_k_master);
  623|       |
  624|      0|    *ptr_num_bands = num_bands0;
  625|      0|  }
  626|       |
  627|  5.88k|  if (*ptr_num_bands < 1) {
  ------------------
  |  Branch (627:7): [True: 0, False: 5.88k]
  ------------------
  628|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  629|      0|  }
  630|       |
  631|  5.88k|  if (sbr_rate == IXHEAACE_QUAD_RATE) {
  ------------------
  |  Branch (631:7): [True: 575, False: 5.31k]
  ------------------
  632|  9.30k|    for (i = 1; i < *ptr_num_bands; i++) {
  ------------------
  |  Branch (632:17): [True: 8.72k, False: 575]
  ------------------
  633|  8.72k|      if (!(ptr_k_master[i] - ptr_k_master[i - 1] <= k0 - 2)) {
  ------------------
  |  Branch (633:11): [True: 0, False: 8.72k]
  ------------------
  634|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  635|      0|      }
  636|  8.72k|    }
  637|    575|  }
  638|       |
  639|  5.88k|  return err_code;
  640|  5.88k|}
ixheaace_update_high_res:
  644|  5.88k|                              ixheaace_sr_mode dr_or_sr, WORD32 num_qmf_ch) {
  645|  5.88k|  WORD32 i;
  646|  5.88k|  WORD32 divider;
  647|  5.88k|  WORD32 max1, max2;
  648|       |
  649|  5.88k|  divider = (dr_or_sr == IXHEAACE_DUAL_RATE) ? 2 : 1;
  ------------------
  |  Branch (649:13): [True: 4.85k, False: 1.03k]
  ------------------
  650|  5.88k|  if (dr_or_sr == IXHEAACE_QUAD_RATE) {
  ------------------
  |  Branch (650:7): [True: 575, False: 5.31k]
  ------------------
  651|    575|    divider = 4;
  652|    575|  }
  653|       |
  654|  5.88k|  if ((ptr_k_master[*ptr_xover_band] > (num_qmf_ch / divider)) ||
  ------------------
  |  Branch (654:7): [True: 3, False: 5.88k]
  ------------------
  655|  5.88k|      (*ptr_xover_band > num_master)) {
  ------------------
  |  Branch (655:7): [True: 0, False: 5.88k]
  ------------------
  656|      3|    max1 = 0;
  657|      3|    max2 = num_master;
  658|       |
  659|      3|    while ((ptr_k_master[max1 + 1] < (num_qmf_ch / divider)) && ((max1 + 1) < max2)) {
  ------------------
  |  Branch (659:12): [True: 0, False: 3]
  |  Branch (659:65): [True: 0, False: 0]
  ------------------
  660|      0|      max1++;
  661|      0|    }
  662|       |
  663|      3|    *ptr_xover_band = max1;
  664|      3|  }
  665|       |
  666|  5.88k|  *ptr_num_hires = num_master - *ptr_xover_band;
  667|       |
  668|  87.1k|  for (i = *ptr_xover_band; i <= num_master; i++) {
  ------------------
  |  Branch (668:29): [True: 81.2k, False: 5.88k]
  ------------------
  669|  81.2k|    ptr_hires[i - *ptr_xover_band] = ptr_k_master[i];
  670|  81.2k|  }
  671|  5.88k|}
ixheaace_update_low_res:
  674|  5.88k|                             WORD32 ptr_num_hires) {
  675|  5.88k|  WORD32 i;
  676|       |
  677|  5.88k|  if (ptr_num_hires % 2 == 0) {
  ------------------
  |  Branch (677:7): [True: 5.88k, False: 0]
  ------------------
  678|  5.88k|    *ptr_num_lores = ptr_num_hires / 2;
  679|       |
  680|  49.4k|    for (i = 0; i <= *ptr_num_lores; i++) {
  ------------------
  |  Branch (680:17): [True: 43.5k, False: 5.88k]
  ------------------
  681|  43.5k|      ptr_lores[i] = ptr_hires[i * 2];
  682|  43.5k|    }
  683|  5.88k|  } else {
  684|      0|    *ptr_num_lores = (ptr_num_hires + 1) / 2;
  685|       |
  686|      0|    ptr_lores[0] = ptr_hires[0];
  687|       |
  688|      0|    for (i = 1; i <= *ptr_num_lores; i++) {
  ------------------
  |  Branch (688:17): [True: 0, False: 0]
  ------------------
  689|      0|      ptr_lores[i] = ptr_hires[i * 2 - 1];
  690|      0|    }
  691|      0|  }
  692|  5.88k|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_start_freq:
  157|  13.9k|static WORD32 ixheaace_get_start_freq(WORD32 fs, WORD32 start_freq) {
  158|  13.9k|  WORD32 minimum_k0;
  159|       |
  160|  13.9k|  switch (fs) {
  161|    237|    case 16000:
  ------------------
  |  Branch (161:5): [True: 237, False: 13.7k]
  ------------------
  162|    237|      minimum_k0 = 24;
  163|    237|      break;
  164|     95|    case 22050:
  ------------------
  |  Branch (164:5): [True: 95, False: 13.8k]
  ------------------
  165|     95|      minimum_k0 = 17;
  166|     95|      break;
  167|    362|    case 24000:
  ------------------
  |  Branch (167:5): [True: 362, False: 13.6k]
  ------------------
  168|    362|      minimum_k0 = 16;
  169|    362|      break;
  170|  4.61k|    case 32000:
  ------------------
  |  Branch (170:5): [True: 4.61k, False: 9.35k]
  ------------------
  171|  4.61k|      minimum_k0 = 16;
  172|  4.61k|      break;
  173|  3.69k|    case 44100:
  ------------------
  |  Branch (173:5): [True: 3.69k, False: 10.2k]
  ------------------
  174|  3.69k|      minimum_k0 = 12;
  175|  3.69k|      break;
  176|  4.41k|    case 48000:
  ------------------
  |  Branch (176:5): [True: 4.41k, False: 9.55k]
  ------------------
  177|  4.41k|      minimum_k0 = 11;
  178|  4.41k|      break;
  179|    294|    case 64000:
  ------------------
  |  Branch (179:5): [True: 294, False: 13.6k]
  ------------------
  180|    294|      minimum_k0 = 10;
  181|    294|      break;
  182|      0|    case 88200:
  ------------------
  |  Branch (182:5): [True: 0, False: 13.9k]
  ------------------
  183|      0|      minimum_k0 = 7;
  184|      0|      break;
  185|      0|    case 96000:
  ------------------
  |  Branch (185:5): [True: 0, False: 13.9k]
  ------------------
  186|      0|      minimum_k0 = 7;
  187|      0|      break;
  188|    256|    default:
  ------------------
  |  Branch (188:5): [True: 256, False: 13.7k]
  ------------------
  189|    256|      minimum_k0 = 11; /* illegal fs */
  190|  13.9k|  }
  191|       |
  192|  13.9k|  switch (fs) {
  193|    237|    case 16000: {
  ------------------
  |  Branch (193:5): [True: 237, False: 13.7k]
  ------------------
  194|    237|      return (minimum_k0 + vector_offset_16k[start_freq]);
  195|      0|    } break;
  196|       |
  197|     95|    case 22050: {
  ------------------
  |  Branch (197:5): [True: 95, False: 13.8k]
  ------------------
  198|     95|      return (minimum_k0 + vector_offset_22k[start_freq]);
  199|      0|    } break;
  200|       |
  201|    362|    case 24000: {
  ------------------
  |  Branch (201:5): [True: 362, False: 13.6k]
  ------------------
  202|    362|      return (minimum_k0 + vector_offset_24k[start_freq]);
  203|      0|    } break;
  204|       |
  205|  4.61k|    case 32000: {
  ------------------
  |  Branch (205:5): [True: 4.61k, False: 9.35k]
  ------------------
  206|  4.61k|      return (minimum_k0 + vector_offset_32k[start_freq]);
  207|      0|    } break;
  208|       |
  209|  3.69k|    case 44100:
  ------------------
  |  Branch (209:5): [True: 3.69k, False: 10.2k]
  ------------------
  210|  8.10k|    case 48000:
  ------------------
  |  Branch (210:5): [True: 4.41k, False: 9.55k]
  ------------------
  211|  8.40k|    case 64000: {
  ------------------
  |  Branch (211:5): [True: 294, False: 13.6k]
  ------------------
  212|  8.40k|      return (minimum_k0 + vector_offset_44_48_64[start_freq]);
  213|  8.10k|    } break;
  214|       |
  215|      0|    case 88200:
  ------------------
  |  Branch (215:5): [True: 0, False: 13.9k]
  ------------------
  216|      0|    case 96000: {
  ------------------
  |  Branch (216:5): [True: 0, False: 13.9k]
  ------------------
  217|      0|      return (minimum_k0 + vector_offset_88_96[start_freq]);
  218|      0|    } break;
  219|       |
  220|    256|    default: {
  ------------------
  |  Branch (220:5): [True: 256, False: 13.7k]
  ------------------
  221|    256|      return (minimum_k0 + vector_offset_def[start_freq]);
  222|      0|    }
  223|  13.9k|  }
  224|  13.9k|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_start_freq_4_1:
   40|    578|static WORD32 ixheaace_get_start_freq_4_1(WORD32 fs, WORD32 start_freq) {
   41|    578|  WORD32 minimum_k0;
   42|    578|  const WORD32 *ptr_start_offset;
   43|       |
   44|    578|  switch (fs) {
   45|     89|    case 16000:
  ------------------
  |  Branch (45:5): [True: 89, False: 489]
  ------------------
   46|     89|      minimum_k0 = 12;
   47|     89|      break;
   48|     56|    case 22050:
  ------------------
  |  Branch (48:5): [True: 56, False: 522]
  ------------------
   49|     56|      minimum_k0 = 9;
   50|     56|      break;
   51|    264|    case 24000:
  ------------------
  |  Branch (51:5): [True: 264, False: 314]
  ------------------
   52|    264|      minimum_k0 = 8;
   53|    264|      break;
   54|    163|    case 32000:
  ------------------
  |  Branch (54:5): [True: 163, False: 415]
  ------------------
   55|    163|      minimum_k0 = 8;
   56|    163|      break;
   57|      2|    case 44100:
  ------------------
  |  Branch (57:5): [True: 2, False: 576]
  ------------------
   58|      2|      minimum_k0 = 6;
   59|      2|      break;
   60|      1|    case 48000:
  ------------------
  |  Branch (60:5): [True: 1, False: 577]
  ------------------
   61|      1|      minimum_k0 = 5;
   62|      1|      break;
   63|      3|    default:
  ------------------
  |  Branch (63:5): [True: 3, False: 575]
  ------------------
   64|      3|      minimum_k0 = 5; /* illegal fs */
   65|    578|  }
   66|       |
   67|    578|  switch (fs) {
   68|     89|    case 16000: {
  ------------------
  |  Branch (68:5): [True: 89, False: 489]
  ------------------
   69|     89|      ptr_start_offset = &ixheaace_start_freq_16k_4_1[0];
   70|     89|    } break;
   71|       |
   72|     56|    case 22050: {
  ------------------
  |  Branch (72:5): [True: 56, False: 522]
  ------------------
   73|     56|      ptr_start_offset = &ixheaace_start_freq_22k_4_1[0];
   74|     56|    } break;
   75|       |
   76|    264|    case 24000: {
  ------------------
  |  Branch (76:5): [True: 264, False: 314]
  ------------------
   77|    264|      ptr_start_offset = &ixheaace_start_freq_24k_4_1[0];
   78|    264|    } break;
   79|       |
   80|    163|    case 32000: {
  ------------------
  |  Branch (80:5): [True: 163, False: 415]
  ------------------
   81|    163|      ptr_start_offset = &ixheaace_start_freq_32k_4_1[0];
   82|    163|    } break;
   83|       |
   84|      2|    case 44100:
  ------------------
  |  Branch (84:5): [True: 2, False: 576]
  ------------------
   85|      3|    case 48000:
  ------------------
  |  Branch (85:5): [True: 1, False: 577]
  ------------------
   86|      3|    case 64000: {
  ------------------
  |  Branch (86:5): [True: 0, False: 578]
  ------------------
   87|      3|      ptr_start_offset = &ixheaace_start_freq_48k_4_1[0];
   88|      3|    } break;
   89|       |
   90|      0|    case 88200:
  ------------------
  |  Branch (90:5): [True: 0, False: 578]
  ------------------
   91|      0|    case 96000: {
  ------------------
  |  Branch (91:5): [True: 0, False: 578]
  ------------------
   92|      0|      ptr_start_offset = &ixheaace_start_freq_96k_4_1[0];
   93|      0|    } break;
   94|       |
   95|      3|    default: {
  ------------------
  |  Branch (95:5): [True: 3, False: 575]
  ------------------
   96|      3|      ptr_start_offset = &ixheaace_start_freq_dflt_4_1[0];
   97|      3|    }
   98|    578|  }
   99|    578|  return (minimum_k0 + ptr_start_offset[start_freq]);
  100|    578|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_stop_freq_4_1:
  102|    578|static WORD32 ixheaace_get_stop_freq_4_1(WORD32 fs, WORD32 stop_freq) {
  103|    578|  WORD32 result, i;
  104|    578|  WORD32 *v_stop_freq = 0;
  105|    578|  WORD32 k1_min;
  106|    578|  WORD32 v_dstop[13];
  107|       |
  108|       |  /* counting previous operations */
  109|    578|  switch (fs) {
  110|     89|    case 16000:
  ------------------
  |  Branch (110:5): [True: 89, False: 489]
  ------------------
  111|     89|      k1_min = 24;
  112|     89|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_16k_4_1[0];
  113|     89|      break;
  114|     56|    case 22050:
  ------------------
  |  Branch (114:5): [True: 56, False: 522]
  ------------------
  115|     56|      k1_min = 17;
  116|     56|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_22k_4_1[0];
  117|     56|      break;
  118|    264|    case 24000:
  ------------------
  |  Branch (118:5): [True: 264, False: 314]
  ------------------
  119|    264|      k1_min = 16;
  120|    264|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_24k_4_1[0];
  121|    264|      break;
  122|    163|    case 32000:
  ------------------
  |  Branch (122:5): [True: 163, False: 415]
  ------------------
  123|    163|      k1_min = 16;
  124|    163|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_32k_4_1[0];
  125|    163|      break;
  126|       |
  127|      2|    case 44100:
  ------------------
  |  Branch (127:5): [True: 2, False: 576]
  ------------------
  128|      2|      k1_min = 12;
  129|      2|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_44k_4_1[0];
  130|      2|      break;
  131|       |
  132|      1|    case 48000:
  ------------------
  |  Branch (132:5): [True: 1, False: 577]
  ------------------
  133|      1|      k1_min = 11;
  134|      1|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_48k_4_1[0];
  135|      1|      break;
  136|       |
  137|      3|    default:
  ------------------
  |  Branch (137:5): [True: 3, False: 575]
  ------------------
  138|      3|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_32k_4_1[0];
  139|      3|      k1_min = 11; /* illegal fs  */
  140|    578|  }
  141|       |
  142|  8.09k|  for (i = 0; i <= 12; i++) {
  ------------------
  |  Branch (142:15): [True: 7.51k, False: 578]
  ------------------
  143|  7.51k|    v_dstop[i] = v_stop_freq[i + 1] - v_stop_freq[i];
  144|  7.51k|  }
  145|       |
  146|    578|  ixheaace_shellsort_int(v_dstop, 13);
  147|       |
  148|    578|  result = k1_min;
  149|       |
  150|  6.93k|  for (i = 0; i < stop_freq; i++) {
  ------------------
  |  Branch (150:15): [True: 6.35k, False: 578]
  ------------------
  151|  6.35k|    result = result + v_dstop[i];
  152|  6.35k|  }
  153|       |
  154|    578|  return result;
  155|    578|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_usac_stop_freq:
  284|  2.36k|{
  285|  2.36k|  WORD32 result, i;
  286|  2.36k|  WORD32 *v_stop_freq = 0;
  287|  2.36k|  WORD32 k1_min;
  288|  2.36k|  WORD32 v_dstop[13];
  289|       |
  290|  2.36k|  switch (fs)
  291|  2.36k|  {
  292|     92|  case 16000:
  ------------------
  |  Branch (292:3): [True: 92, False: 2.27k]
  ------------------
  293|     92|    k1_min = ixheaace_usac_stop_freq_16k[0];
  294|     92|    v_stop_freq = (WORD32 *)&ixheaace_usac_stop_freq_16k[0];
  295|     92|    break;
  296|     36|  case 22050:
  ------------------
  |  Branch (296:3): [True: 36, False: 2.32k]
  ------------------
  297|     36|    k1_min = ixheaace_usac_stop_freq_22k[0];
  298|     36|    v_stop_freq = (WORD32 *)&ixheaace_usac_stop_freq_22k[0];
  299|     36|    break;
  300|    147|  case 24000:
  ------------------
  |  Branch (300:3): [True: 147, False: 2.21k]
  ------------------
  301|    147|    k1_min = ixheaace_usac_stop_freq_24k[0];
  302|    147|    v_stop_freq = (WORD32 *)&ixheaace_usac_stop_freq_24k[0];
  303|    147|    break;
  304|    766|  case 32000:
  ------------------
  |  Branch (304:3): [True: 766, False: 1.59k]
  ------------------
  305|    766|    k1_min = 32;
  306|    766|    v_stop_freq = (WORD32 *)vector_stop_freq_32;
  307|    766|    break;
  308|       |
  309|    498|  case 44100:
  ------------------
  |  Branch (309:3): [True: 498, False: 1.86k]
  ------------------
  310|    498|    k1_min = 23;
  311|    498|    v_stop_freq = (WORD32 *)vector_stop_freq_44;
  312|    498|    break;
  313|       |
  314|    723|  case 48000:
  ------------------
  |  Branch (314:3): [True: 723, False: 1.63k]
  ------------------
  315|    723|    k1_min = 21;
  316|    723|    v_stop_freq = (WORD32 *)vector_stop_freq_48;
  317|    723|    break;
  318|       |
  319|    100|  default:
  ------------------
  |  Branch (319:3): [True: 100, False: 2.26k]
  ------------------
  320|    100|    v_stop_freq = (WORD32 *)vector_stop_freq_32;
  321|    100|    k1_min = 21; /* illegal fs  */
  322|  2.36k|  }
  323|       |
  324|  33.0k|  for (i = 0; i <= 12; i++)
  ------------------
  |  Branch (324:15): [True: 30.7k, False: 2.36k]
  ------------------
  325|  30.7k|  {
  326|  30.7k|    v_dstop[i] = v_stop_freq[i + 1] - v_stop_freq[i];
  327|  30.7k|  }
  328|       |
  329|  2.36k|  ixheaace_shellsort_int(v_dstop, 13);
  330|       |
  331|  2.36k|  result = k1_min;
  332|       |
  333|  28.0k|  for (i = 0; i < stop_freq; i++)
  ------------------
  |  Branch (333:15): [True: 25.6k, False: 2.36k]
  ------------------
  334|  25.6k|  {
  335|  25.6k|    result = result + v_dstop[i];
  336|  25.6k|  }
  337|       |
  338|  2.36k|  return result;
  339|  2.36k|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_stop_freq:
  226|  2.95k|static WORD32 ixheaace_get_stop_freq(WORD32 fs, WORD32 stop_freq) {
  227|  2.95k|  WORD32 result, i;
  228|  2.95k|  WORD32 *v_stop_freq = 0;
  229|  2.95k|  WORD32 k1_min;
  230|  2.95k|  WORD32 v_dstop[13];
  231|       |
  232|  2.95k|  switch (fs) {
  233|      0|    case 16000:
  ------------------
  |  Branch (233:5): [True: 0, False: 2.95k]
  ------------------
  234|      0|      k1_min = ixheaace_stop_freq_16k[0];
  235|      0|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_16k[0];
  236|      0|      break;
  237|      0|    case 22050:
  ------------------
  |  Branch (237:5): [True: 0, False: 2.95k]
  ------------------
  238|      0|      k1_min = ixheaace_stop_freq_22k[0];
  239|      0|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_22k[0];
  240|      0|      break;
  241|      0|    case 24000:
  ------------------
  |  Branch (241:5): [True: 0, False: 2.95k]
  ------------------
  242|      0|      k1_min = ixheaace_stop_freq_24k[0];
  243|      0|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_24k[0];
  244|      0|      break;
  245|  1.07k|    case 32000:
  ------------------
  |  Branch (245:5): [True: 1.07k, False: 1.88k]
  ------------------
  246|  1.07k|      k1_min = 32;
  247|       |
  248|  1.07k|      v_stop_freq = (WORD32 *)vector_stop_freq_32;
  249|  1.07k|      break;
  250|       |
  251|    938|    case 44100:
  ------------------
  |  Branch (251:5): [True: 938, False: 2.02k]
  ------------------
  252|    938|      k1_min = 23;
  253|       |
  254|    938|      v_stop_freq = (WORD32 *)vector_stop_freq_44;
  255|    938|      break;
  256|       |
  257|    948|    case 48000:
  ------------------
  |  Branch (257:5): [True: 948, False: 2.01k]
  ------------------
  258|    948|      k1_min = 21;
  259|       |
  260|    948|      v_stop_freq = (WORD32 *)vector_stop_freq_48;
  261|    948|      break;
  262|       |
  263|      0|    default:
  ------------------
  |  Branch (263:5): [True: 0, False: 2.95k]
  ------------------
  264|      0|      v_stop_freq = (WORD32 *)vector_stop_freq_32;
  265|      0|      k1_min = 21; /* illegal fs  */
  266|  2.95k|  }
  267|       |
  268|  41.4k|  for (i = 0; i <= 12; i++) {
  ------------------
  |  Branch (268:15): [True: 38.4k, False: 2.95k]
  ------------------
  269|  38.4k|    v_dstop[i] = v_stop_freq[i + 1] - v_stop_freq[i];
  270|  38.4k|  }
  271|       |
  272|  2.95k|  ixheaace_shellsort_int(v_dstop, 13);
  273|       |
  274|  2.95k|  result = k1_min;
  275|       |
  276|  25.5k|  for (i = 0; i < stop_freq; i++) {
  ------------------
  |  Branch (276:15): [True: 22.6k, False: 2.95k]
  ------------------
  277|  22.6k|    result = result + v_dstop[i];
  278|  22.6k|  }
  279|       |
  280|  2.95k|  return result;
  281|  2.95k|}
ixheaace_sbr_freq_scaling.c:ixheaace_number_of_bands:
  357|  10.0k|                                       FLOAT32 warp_fac) {
  358|  10.0k|  WORD32 result = 0;
  359|  10.0k|  result = (WORD32)(b_p_o * log((FLOAT32)(stop) / start) / (2.0 * log(2.0) * warp_fac) + 0.5);
  360|  10.0k|  result <<= 1;
  361|  10.0k|  return result;
  362|  10.0k|}
ixheaace_sbr_freq_scaling.c:ixheaace_calc_bands:
  364|  10.0k|static VOID ixheaace_calc_bands(WORD32 *ptr_diff, WORD32 start, WORD32 stop, WORD32 num_bands) {
  365|  10.0k|  WORD32 i;
  366|  10.0k|  WORD32 previous;
  367|  10.0k|  WORD32 current;
  368|  10.0k|  previous = start;
  369|  85.4k|  for (i = 1; i <= num_bands; i++) {
  ------------------
  |  Branch (369:15): [True: 75.3k, False: 10.0k]
  ------------------
  370|  75.3k|    current = (WORD32)((start * pow((FLOAT32)stop / start, (FLOAT32)i / num_bands)) + 0.5f);
  371|  75.3k|    ptr_diff[i - 1] = current - previous;
  372|  75.3k|    previous = current;
  373|  75.3k|  }
  374|  10.0k|}
ixheaace_sbr_freq_scaling.c:ixheaace_cum_sum:
  391|  10.0k|                             UWORD8 *ptr_start_adress) {
  392|  10.0k|  WORD32 i;
  393|       |
  394|  10.0k|  ptr_start_adress[0] = (UWORD8)start_value;
  395|       |
  396|  85.3k|  for (i = 1; i <= length; i++) {
  ------------------
  |  Branch (396:15): [True: 75.3k, False: 10.0k]
  ------------------
  397|  75.3k|    ptr_start_adress[i] = ptr_start_adress[i - 1] + (UWORD8)ptr_diff[i - 1];
  398|  75.3k|  }
  399|  10.0k|}
ixheaace_sbr_freq_scaling.c:ixheaace_modify_bands:
  376|    243|static VOID ixheaace_modify_bands(WORD32 max_band_previous, WORD32 *ptr_diff, WORD32 length) {
  377|    243|  WORD32 change = max_band_previous - ptr_diff[0];
  378|       |
  379|    243|  if (change > (ptr_diff[length - 1] - ptr_diff[0]) / 2) {
  ------------------
  |  Branch (379:7): [True: 243, False: 0]
  ------------------
  380|    243|    change = (ptr_diff[length - 1] - ptr_diff[0]) / 2;
  381|    243|  }
  382|       |
  383|    243|  ptr_diff[0] += change;
  384|       |
  385|    243|  ptr_diff[length - 1] -= change;
  386|       |
  387|    243|  ixheaace_shellsort_int(ptr_diff, length);
  388|    243|}

ixheaace_esbr_hbe_data_init:
  254|  2.06k|                                 WORD32 *ptr_total_persistant) {
  255|  2.06k|  WORD32 used_persistent = 0;
  256|       |
  257|  2.06k|  if (pstr_esbr_hbe_txposer) {
  ------------------
  |  Branch (257:7): [True: 2.06k, False: 0]
  ------------------
  258|  2.06k|    memset(pstr_esbr_hbe_txposer, 0, sizeof(ixheaace_str_esbr_hbe_txposer));
  259|       |
  260|  2.06k|    pstr_esbr_hbe_txposer->core_frame_length = num_aac_samples;
  261|       |
  262|  2.06k|    pstr_esbr_hbe_txposer->no_bins = num_out_samples / IXHEAACE_NUM_QMF_SYNTH_CHANNELS;
  ------------------
  |  |   33|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  ------------------
  263|       |
  264|  2.06k|    pstr_esbr_hbe_txposer->hbe_qmf_in_len = pstr_esbr_hbe_txposer->no_bins;
  265|       |
  266|  2.06k|    pstr_esbr_hbe_txposer->hbe_qmf_out_len = 2 * pstr_esbr_hbe_txposer->hbe_qmf_in_len;
  267|       |
  268|  2.06k|    pstr_esbr_hbe_txposer->ptr_input_buf = (FLOAT32 *)ptr_persistent_hbe_mem;
  269|  2.06k|    used_persistent += (num_aac_samples + IXHEAACE_NUM_QMF_SYNTH_CHANNELS) *
  ------------------
  |  |   33|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  ------------------
  270|  2.06k|                       sizeof(pstr_esbr_hbe_txposer->ptr_input_buf[0]);
  271|       |
  272|  2.06k|    pstr_esbr_hbe_txposer->upsamp_4_flag = samp_fac_4_flag;
  273|       |
  274|  2.06k|    if (pstr_esbr_hbe_txposer) {
  ------------------
  |  Branch (274:9): [True: 2.06k, False: 0]
  ------------------
  275|  2.06k|      pstr_esbr_hbe_txposer->fft_size[0] = num_aac_samples;
  276|  2.06k|      pstr_esbr_hbe_txposer->fft_size[1] = (int)(IXHEAACE_FD_OVERSAMPLING_FAC * num_aac_samples);
  ------------------
  |  |   39|  2.06k|#define IXHEAACE_FD_OVERSAMPLING_FAC (1.5f)
  ------------------
  277|       |
  278|       |      /*
  279|       |        Worst Case Memory requirements for DFT based HBE.
  280|       |        analysis ptr_win = num_aac_samples * sizeof(float)          = 1024 * sizeof(FLOAT32)
  281|       |        synthesis ptr_win = num_aac_samples * sizeof(float)         = 1024 * sizeof(FLOAT32)
  282|       |        ptr_spectrum = num_aac_samples * sizeof(float) * 1.5        = 1536 * sizeof(FLOAT32)
  283|       |        spectrumTransposed = num_aac_samples * sizeof(float)    = 1536 * sizeof(FLOAT32)
  284|       |        ptr_mag                                                     = 1536 * sizeof(FLOAT32)
  285|       |        ptr_phase                                                   = 1536 * sizeof(FLOAT32)
  286|       |        pstr_esbr_hbe_txposer->inBuf                            = 2048 * sizeof(FLOAT32)
  287|       |        pstr_esbr_hbe_txposer->outBuf                           = 4096 * sizeof(FLOAT32)
  288|       |        fd_win_buf                                                   = 2560 * 3 * sizeof(FLOAT32)
  289|       |        Total ~ (1024 * 2 + 1536 * 4 + 2048 * 1 + 4096 * 1 + 2560 * 3) * sizeof(FLOAT32)
  290|       |        = 22016 * sizeof(FLOAT32)
  291|       |       */
  292|       |
  293|  2.06k|      pstr_esbr_hbe_txposer->ptr_spectrum = &pstr_esbr_hbe_txposer->spectrum_buf[0];
  294|  2.06k|      pstr_esbr_hbe_txposer->ptr_spectrum_tx = &pstr_esbr_hbe_txposer->spectrum_transposed_buf[0];
  295|  2.06k|      pstr_esbr_hbe_txposer->ptr_mag = &pstr_esbr_hbe_txposer->mag_buf[0];
  296|  2.06k|      pstr_esbr_hbe_txposer->ptr_phase = &pstr_esbr_hbe_txposer->phase_buf[0];
  297|  2.06k|      pstr_esbr_hbe_txposer->ptr_output_buf = &pstr_esbr_hbe_txposer->output_buf[0];
  298|  2.06k|    }
  299|  2.06k|  }
  300|  2.06k|  *ptr_total_persistant = used_persistent;
  301|  2.06k|}
ixheaace_dft_hbe_data_reinit:
  303|  2.06k|IA_ERRORCODE ixheaace_dft_hbe_data_reinit(ixheaace_str_esbr_hbe_txposer *pstr_hbe_txposer) {
  304|  2.06k|  WORD32 sfb;
  305|  2.06k|  WORD32 patch;
  306|  2.06k|  WORD32 i;
  307|  2.06k|  WORD32 temp_start;
  308|  2.06k|  FLOAT32 fb_ratio;
  309|  2.06k|  WORD32 stop_patch;
  310|  2.06k|  WORD32 in_hop_size_divisor = 8;
  311|  2.06k|  static const WORD32 trans_samp[2] = {12, 18}; /* FD transition samples */
  312|  2.06k|  WORD32 err = IA_NO_ERROR;
  ------------------
  |  |   23|  2.06k|#define IA_NO_ERROR 0x00000000
  ------------------
  313|       |
  314|  2.06k|  pstr_hbe_txposer->start_band = pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][0];
  ------------------
  |  |   69|  2.06k|#define IXHEAACE_LOW (0)
  ------------------
  315|  2.06k|  pstr_hbe_txposer->end_band =
  316|  2.06k|      pstr_hbe_txposer
  317|  2.06k|          ->ptr_freq_band_tab[IXHEAACE_LOW][pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]];
  ------------------
  |  |   69|  2.06k|#define IXHEAACE_LOW (0)
  ------------------
                        ->ptr_freq_band_tab[IXHEAACE_LOW][pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]];
  ------------------
  |  |   69|  2.06k|#define IXHEAACE_LOW (0)
  ------------------
  318|  2.06k|  pstr_hbe_txposer->esbr_hq = 1;
  319|       |
  320|  2.06k|  pstr_hbe_txposer->synth_size = 4 * ((pstr_hbe_txposer->start_band + 4) / 8 + 1);
  321|  2.06k|  pstr_hbe_txposer->k_start = ixheaac_start_subband2kL_tbl[pstr_hbe_txposer->start_band];
  322|       |
  323|  2.06k|  fb_ratio = pstr_hbe_txposer->synth_size / 32.0f;
  324|       |
  325|  2.06k|  pstr_hbe_txposer->ana_fft_size[0] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[0]);
  326|  2.06k|  pstr_hbe_txposer->ana_fft_size[1] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[1]);
  327|       |
  328|  2.06k|  pstr_hbe_txposer->in_hop_size = pstr_hbe_txposer->ana_fft_size[0] / in_hop_size_divisor;
  329|       |
  330|  2.06k|  pstr_hbe_txposer->ptr_syn_win = (FLOAT32 *)&pstr_hbe_txposer->synthesis_window_buf[0];
  331|  2.06k|  pstr_hbe_txposer->ptr_ana_win = (FLOAT32 *)&pstr_hbe_txposer->analysis_window_buf[0];
  332|       |
  333|  2.06k|  err = ixheaace_calc_anal_synth_window(pstr_hbe_txposer->ana_fft_size[0],
  334|  2.06k|                                        pstr_hbe_txposer->ptr_ana_win);
  335|  2.06k|  if (err) {
  ------------------
  |  Branch (335:7): [True: 0, False: 2.06k]
  ------------------
  336|      0|    return err;
  337|      0|  }
  338|       |
  339|  2.06k|  memset(pstr_hbe_txposer->synth_buf, 0, sizeof(pstr_hbe_txposer->synth_buf));
  340|       |
  341|  2.06k|  pstr_hbe_txposer->ptr_syn_win_coeff = ixheaace_map_prot_filter(pstr_hbe_txposer->synth_size);
  342|       |
  343|  2.06k|  temp_start = 2 * ((pstr_hbe_txposer->start_band - 1) / 2); /* Largest start band */
  344|  2.06k|  pstr_hbe_txposer->analy_size =
  345|  2.06k|      4 * ((min(64, pstr_hbe_txposer->end_band + 1) - temp_start - 1) / 4 +
  ------------------
  |  |   75|  2.06k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 125, False: 1.93k]
  |  |  ------------------
  ------------------
  346|  2.06k|           1); /* Quantize in steps of 4 */
  347|  2.06k|  pstr_hbe_txposer->a_start = temp_start - max(0, temp_start + pstr_hbe_txposer->analy_size - 64);
  ------------------
  |  |   74|  2.06k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 1.93k, False: 125]
  |  |  ------------------
  ------------------
  348|       |
  349|  2.06k|  fb_ratio = pstr_hbe_txposer->analy_size / 64.0f;
  350|       |
  351|  2.06k|  pstr_hbe_txposer->syn_fft_size[0] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[0]);
  352|  2.06k|  pstr_hbe_txposer->syn_fft_size[1] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[1]);
  353|       |
  354|  2.06k|  pstr_hbe_txposer->out_hop_size = 2 * pstr_hbe_txposer->syn_fft_size[0] / in_hop_size_divisor;
  355|       |
  356|  2.06k|  err = ixheaace_calc_anal_synth_window(pstr_hbe_txposer->syn_fft_size[0],
  357|  2.06k|                                        pstr_hbe_txposer->ptr_syn_win);
  358|  2.06k|  if (err) {
  ------------------
  |  Branch (358:7): [True: 0, False: 2.06k]
  ------------------
  359|      0|    return err;
  360|      0|  }
  361|       |
  362|  2.06k|  pstr_hbe_txposer->ptr_ana_win_coeff = ixheaace_map_prot_filter(pstr_hbe_txposer->analy_size);
  363|       |
  364|       |  /* calculation of x_over_bin array and x_over_qmf array */
  365|       |
  366|  2.06k|  memset(&pstr_hbe_txposer->x_over_qmf[0], 0, sizeof(pstr_hbe_txposer->x_over_qmf));
  367|       |
  368|  10.3k|  for (i = 0; i < IXHEAACE_MAX_STRETCH; i++) {
  ------------------
  |  |   27|  10.3k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (368:15): [True: 8.25k, False: 2.06k]
  ------------------
  369|  8.25k|    memset(&pstr_hbe_txposer->x_over_bin[i][0], 0,
  370|  8.25k|           2 * sizeof(pstr_hbe_txposer->x_over_bin[i][0]));
  371|  8.25k|  }
  372|  2.06k|  sfb = 0;
  373|  2.06k|  stop_patch = IXHEAACE_MAX_STRETCH;
  ------------------
  |  |   27|  2.06k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  374|       |
  375|  2.06k|  switch (pstr_hbe_txposer->synth_size) {
  376|      0|    case 4:
  ------------------
  |  Branch (376:5): [True: 0, False: 2.06k]
  ------------------
  377|      0|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_4;
  378|      0|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  379|      0|      break;
  380|      0|    case 8:
  ------------------
  |  Branch (380:5): [True: 0, False: 2.06k]
  ------------------
  381|      0|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_8;
  382|      0|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  383|      0|      break;
  384|    858|    case 12:
  ------------------
  |  Branch (384:5): [True: 858, False: 1.20k]
  ------------------
  385|    858|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_12;
  386|    858|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p3;
  387|    858|      break;
  388|    858|    case 16:
  ------------------
  |  Branch (388:5): [True: 858, False: 1.20k]
  ------------------
  389|    858|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_16;
  390|    858|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  391|    858|      break;
  392|    347|    case 20:
  ------------------
  |  Branch (392:5): [True: 347, False: 1.71k]
  ------------------
  393|    347|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_20;
  394|    347|      break;
  395|      0|    case 28:
  ------------------
  |  Branch (395:5): [True: 0, False: 2.06k]
  ------------------
  396|      0|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_20;
  397|      0|      break;
  398|      0|    default:
  ------------------
  |  Branch (398:5): [True: 0, False: 2.06k]
  ------------------
  399|      0|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_4;
  400|      0|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  401|  2.06k|  }
  402|       |
  403|  2.06k|  {
  404|  2.06k|    WORD32 l, k, L = pstr_hbe_txposer->analy_size;
  405|  76.7k|    for (k = 0; k < L; k++) {
  ------------------
  |  Branch (405:17): [True: 74.7k, False: 2.06k]
  ------------------
  406|  5.66M|      for (l = 0; l < 2 * L; l++) {
  ------------------
  |  Branch (406:19): [True: 5.59M, False: 74.7k]
  ------------------
  407|  5.59M|        pstr_hbe_txposer->str_dft_hbe_anal_coeff.real[k][l] =
  408|  5.59M|            (FLOAT32)cos(PI / (2 * L) *
  ------------------
  |  |   33|  5.59M|#define PI 3.14159265358979323846
  ------------------
  409|  5.59M|                         ((k + 0.5) * (2 * l - L / 64.0) - L / 64.0 * pstr_hbe_txposer->a_start));
  410|  5.59M|        pstr_hbe_txposer->str_dft_hbe_anal_coeff.imag[k][l] =
  411|  5.59M|            (FLOAT32)sin(PI / (2 * L) *
  ------------------
  |  |   33|  5.59M|#define PI 3.14159265358979323846
  ------------------
  412|  5.59M|                         ((k + 0.5) * (2 * l - L / 64.0) - L / 64.0 * pstr_hbe_txposer->a_start));
  413|  5.59M|      }
  414|  74.7k|    }
  415|  2.06k|  }
  416|       |
  417|  6.60k|  for (patch = 1; patch <= stop_patch; patch++) {
  ------------------
  |  Branch (417:19): [True: 6.60k, False: 0]
  ------------------
  418|  23.1k|    while (sfb <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW] &&
  ------------------
  |  |   69|  23.1k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (418:12): [True: 21.1k, False: 2.06k]
  ------------------
  419|  21.1k|           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb] <=
  ------------------
  |  |   69|  21.1k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (419:12): [True: 16.5k, False: 4.53k]
  ------------------
  420|  21.1k|               patch * pstr_hbe_txposer->start_band)
  421|  16.5k|      sfb++;
  422|  6.60k|    if (sfb <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]) {
  ------------------
  |  |   69|  6.60k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (422:9): [True: 4.53k, False: 2.06k]
  ------------------
  423|       |      /* If the distance is larger than three QMF bands - try aligning to high resolution
  424|       |       * frequency bands instead. */
  425|  4.53k|      if ((patch * pstr_hbe_txposer->start_band -
  ------------------
  |  Branch (425:11): [True: 3.99k, False: 547]
  ------------------
  426|  4.53k|           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1]) <= 3) {
  ------------------
  |  |   69|  4.53k|#define IXHEAACE_LOW (0)
  ------------------
  427|  3.99k|        pstr_hbe_txposer->x_over_qmf[patch - 1] =
  428|  3.99k|            pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1];
  ------------------
  |  |   69|  3.99k|#define IXHEAACE_LOW (0)
  ------------------
  429|  3.99k|        if (patch <= IXHEAACE_MAX_STRETCH) {
  ------------------
  |  |   27|  3.99k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (429:13): [True: 3.99k, False: 0]
  ------------------
  430|  3.99k|          pstr_hbe_txposer->x_over_bin[patch - 1][0] =
  431|  3.99k|              (WORD32)(pstr_hbe_txposer->fft_size[0] *
  432|  3.99k|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1] / 128 +
  ------------------
  |  |   69|  3.99k|#define IXHEAACE_LOW (0)
  ------------------
  433|  3.99k|                       0.5);
  434|  3.99k|          pstr_hbe_txposer->x_over_bin[patch - 1][1] =
  435|  3.99k|              (WORD32)(pstr_hbe_txposer->fft_size[1] *
  436|  3.99k|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1] / 128 +
  ------------------
  |  |   69|  3.99k|#define IXHEAACE_LOW (0)
  ------------------
  437|  3.99k|                       0.5);
  438|  3.99k|        }
  439|  3.99k|      } else {
  440|    547|        WORD32 sfb_idx = 0;
  441|  8.18k|        while (sfb_idx <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_HIGH] &&
  ------------------
  |  |   70|  8.18k|#define IXHEAACE_HIGH (1)
  ------------------
  |  Branch (441:16): [True: 8.18k, False: 0]
  ------------------
  442|  8.18k|               pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx] <=
  ------------------
  |  |   70|  8.18k|#define IXHEAACE_HIGH (1)
  ------------------
  |  Branch (442:16): [True: 7.64k, False: 547]
  ------------------
  443|  8.18k|                   patch * pstr_hbe_txposer->start_band)
  444|  7.64k|          sfb_idx++;
  445|    547|        pstr_hbe_txposer->x_over_qmf[patch - 1] =
  446|    547|            pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1];
  ------------------
  |  |   70|    547|#define IXHEAACE_HIGH (1)
  ------------------
  447|    547|        if (patch <= IXHEAACE_MAX_STRETCH) {
  ------------------
  |  |   27|    547|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (447:13): [True: 547, False: 0]
  ------------------
  448|    547|          pstr_hbe_txposer->x_over_bin[patch - 1][0] =
  449|    547|              (WORD32)(pstr_hbe_txposer->fft_size[0] *
  450|    547|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1] / 128 +
  ------------------
  |  |   70|    547|#define IXHEAACE_HIGH (1)
  ------------------
  451|    547|                       0.5);
  452|    547|          pstr_hbe_txposer->x_over_bin[patch - 1][1] =
  453|    547|              (WORD32)(pstr_hbe_txposer->fft_size[1] *
  454|    547|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1] / 128 +
  ------------------
  |  |   70|    547|#define IXHEAACE_HIGH (1)
  ------------------
  455|    547|                       0.5);
  456|    547|        }
  457|    547|      }
  458|  4.53k|    } else {
  459|  2.06k|      pstr_hbe_txposer->x_over_qmf[patch - 1] = pstr_hbe_txposer->end_band;
  460|  2.06k|      if (patch <= IXHEAACE_MAX_STRETCH) {
  ------------------
  |  |   27|  2.06k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (460:11): [True: 2.06k, False: 0]
  ------------------
  461|  2.06k|        pstr_hbe_txposer->x_over_bin[patch - 1][0] =
  462|  2.06k|            (WORD32)(pstr_hbe_txposer->fft_size[0] * pstr_hbe_txposer->end_band / 128 + 0.5);
  463|  2.06k|        pstr_hbe_txposer->x_over_bin[patch - 1][1] =
  464|  2.06k|            (WORD32)(pstr_hbe_txposer->fft_size[1] * pstr_hbe_txposer->end_band / 128 + 0.5);
  465|  2.06k|      }
  466|  2.06k|      pstr_hbe_txposer->max_stretch = min(patch, IXHEAACE_MAX_STRETCH);
  ------------------
  |  |   75|  2.06k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 1.47k, False: 593]
  |  |  ------------------
  ------------------
  467|  2.06k|      break;
  468|  2.06k|    }
  469|  6.60k|  }
  470|       |
  471|       |  /* calculation of frequency domain windows */
  472|  6.60k|  for (patch = 0; patch < pstr_hbe_txposer->max_stretch - 1; patch++) {
  ------------------
  |  Branch (472:19): [True: 4.53k, False: 2.06k]
  ------------------
  473|  13.6k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (473:17): [True: 9.07k, False: 4.53k]
  ------------------
  474|  9.07k|      ixheaace_create_dft_hbe_window(pstr_hbe_txposer->fd_win_buf[patch][i],
  475|  9.07k|                                     pstr_hbe_txposer->x_over_bin[patch][i],
  476|  9.07k|                                     pstr_hbe_txposer->x_over_bin[patch + 1][i], trans_samp[i],
  477|  9.07k|                                     pstr_hbe_txposer->fft_size[i]);
  478|  9.07k|    }
  479|  4.53k|  }
  480|  2.06k|  return err;
  481|  2.06k|}
ixheaace_dft_hbe_fft_memmove:
  491|   305k|VOID ixheaace_dft_hbe_fft_memmove(FLOAT32 *ptr_spectrum, WORD32 size) {
  492|   305k|  WORD32 n = 0;
  493|       |
  494|  73.5M|  while (n < size / 2) {
  ------------------
  |  Branch (494:10): [True: 73.2M, False: 305k]
  ------------------
  495|  73.2M|    FLOAT32 tmp = ptr_spectrum[n];
  496|  73.2M|    ptr_spectrum[n] = ptr_spectrum[n + size / 2];
  497|  73.2M|    ptr_spectrum[n + size / 2] = tmp;
  498|  73.2M|    n++;
  499|  73.2M|  }
  500|   305k|}
ixheaace_karth2polar:
  502|   152k|                          WORD32 fft_size) {
  503|   152k|  WORD32 n;
  504|       |
  505|  34.9M|  for (n = 1; n < fft_size / 2; n++) {
  ------------------
  |  Branch (505:15): [True: 34.8M, False: 152k]
  ------------------
  506|  34.8M|    ptr_phase[n] = (FLOAT32)atan2(ptr_spectrum[2 * n + 1], ptr_spectrum[2 * n]);
  507|  34.8M|    ptr_mag[n] = (FLOAT32)sqrt(ptr_spectrum[2 * n] * ptr_spectrum[2 * n] +
  508|  34.8M|                               ptr_spectrum[2 * n + 1] * ptr_spectrum[2 * n + 1]);
  509|  34.8M|  }
  510|       |
  511|   152k|  if (ptr_spectrum[0] < 0) {
  ------------------
  |  Branch (511:7): [True: 0, False: 152k]
  ------------------
  512|      0|    ptr_phase[0] = (FLOAT32)acos(-1);
  513|      0|    ptr_mag[0] = -ptr_spectrum[0];
  514|   152k|  } else {
  515|   152k|    ptr_phase[0] = 0;
  516|   152k|    ptr_mag[0] = ptr_spectrum[0];
  517|   152k|  }
  518|       |
  519|   152k|  if (ptr_spectrum[1] < 0) {
  ------------------
  |  Branch (519:7): [True: 0, False: 152k]
  ------------------
  520|      0|    ptr_phase[fft_size / 2] = (FLOAT32)acos(-1);
  521|      0|    ptr_mag[fft_size / 2] = -ptr_spectrum[1];
  522|   152k|  } else {
  523|   152k|    ptr_phase[fft_size / 2] = 0;
  524|   152k|    ptr_mag[fft_size / 2] = ptr_spectrum[1];
  525|   152k|  }
  526|   152k|}
ixheaace_hbe_fft_map:
  567|  26.1k|IA_ERRORCODE ixheaace_hbe_fft_map(ixheaace_str_esbr_hbe_txposer *pstr_hbe_txposer) {
  568|  26.1k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  569|  26.1k|  WORD32 ana_fft_size = pstr_hbe_txposer->ana_fft_size[oversampling_flag];
  570|  26.1k|  WORD32 syn_fft_size = pstr_hbe_txposer->syn_fft_size[oversampling_flag];
  571|       |
  572|  26.1k|  switch (ana_fft_size) {
  573|  3.00k|    case 576:
  ------------------
  |  Branch (573:5): [True: 3.00k, False: 23.1k]
  ------------------
  574|  3.00k|      pstr_hbe_txposer->ptr_ana_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_576;
  575|  3.00k|      pstr_hbe_txposer->ixheaace_hbe_anal_fft = &ixheaace_hbe_apply_fft_288;
  576|  3.00k|      break;
  577|  8.03k|    case 384:
  ------------------
  |  Branch (577:5): [True: 8.03k, False: 18.0k]
  ------------------
  578|  8.03k|      pstr_hbe_txposer->ptr_ana_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_384;
  579|  8.03k|      pstr_hbe_txposer->ixheaace_hbe_anal_fft = &ixheaace_hbe_apply_cfftn_gen;
  580|  8.03k|      break;
  581|  11.5k|    case 512:
  ------------------
  |  Branch (581:5): [True: 11.5k, False: 14.5k]
  ------------------
  582|  11.5k|      pstr_hbe_txposer->ptr_ana_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_512;
  583|  11.5k|      pstr_hbe_txposer->ixheaace_hbe_anal_fft = &ixheaace_hbe_apply_cfftn;
  584|  11.5k|      break;
  585|      0|    case 768:
  ------------------
  |  Branch (585:5): [True: 0, False: 26.1k]
  ------------------
  586|      0|      pstr_hbe_txposer->ptr_ana_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_768;
  587|      0|      pstr_hbe_txposer->ixheaace_hbe_anal_fft = &ixheaace_hbe_apply_cfftn_gen;
  588|      0|      break;
  589|  3.51k|    default:
  ------------------
  |  Branch (589:5): [True: 3.51k, False: 22.6k]
  ------------------
  590|  3.51k|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_MAPPING;
  591|      0|      break;
  592|  26.1k|  }
  593|       |
  594|  22.6k|  switch (syn_fft_size) {
  595|  6.76k|    case 448:
  ------------------
  |  Branch (595:5): [True: 6.76k, False: 15.8k]
  ------------------
  596|  6.76k|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_448;
  597|  6.76k|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_ifft_224;
  598|  6.76k|      break;
  599|  8.96k|    case 512:
  ------------------
  |  Branch (599:5): [True: 8.96k, False: 13.6k]
  ------------------
  600|  8.96k|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_512;
  601|  8.96k|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_cfftn;
  602|  8.96k|      break;
  603|  3.36k|    case 576:
  ------------------
  |  Branch (603:5): [True: 3.36k, False: 19.2k]
  ------------------
  604|  3.36k|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_576;
  605|  3.36k|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_fft_288;
  606|  3.36k|      break;
  607|      0|    case 768:
  ------------------
  |  Branch (607:5): [True: 0, False: 22.6k]
  ------------------
  608|      0|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_768;
  609|      0|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_cfftn_gen;
  610|      0|      break;
  611|      0|    case 672:
  ------------------
  |  Branch (611:5): [True: 0, False: 22.6k]
  ------------------
  612|      0|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_672;
  613|      0|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_ifft_336;
  614|      0|      break;
  615|  3.51k|    default:
  ------------------
  |  Branch (615:5): [True: 3.51k, False: 19.0k]
  ------------------
  616|  3.51k|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_MAPPING;
  617|      0|      break;
  618|  22.6k|  }
  619|       |
  620|  19.0k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  19.0k|#define IA_NO_ERROR 0x00000000
  ------------------
  621|  22.6k|}
ia_dft_hbe_apply_polar_t2:
  624|   152k|                               WORD32 pitch_in_bins, WORD out_transform_size) {
  625|   152k|  WORD32 tr;
  626|   152k|  WORD32 ti;
  627|   152k|  WORD32 m_tr = 0;
  628|   152k|  WORD32 p, i;
  629|   152k|  FLOAT32 mag_t;
  630|   152k|  FLOAT32 phase_t;
  631|   152k|  FLOAT32 m_val;
  632|   152k|  FLOAT32(*fd_win_buf)[3][3][1536] = &pstr_hbe_txposer->fd_win_buf;
  633|   152k|  FLOAT32 *ptr_phase = pstr_hbe_txposer->ptr_phase;
  634|   152k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  635|   152k|  WORD32 fft_size = pstr_hbe_txposer->fft_size[oversampling_flag];
  636|   152k|  FLOAT32 *ptr_spectrum_tx = pstr_hbe_txposer->ptr_spectrum_tx;
  637|   152k|  FLOAT32 *ptr_mag = pstr_hbe_txposer->ptr_mag;
  638|       |  /* pitch_in_bins is given with the resolution of a 1536 point FFT */
  639|   152k|  FLOAT32 p_flt = fft_size * pitch_in_bins / 1536.0f;
  640|   152k|  p = (WORD32)p_flt;
  641|   152k|  FLOAT32 q_thr = 4.0f;
  642|       |
  643|   152k|  if (T < 2) {
  ------------------
  |  Branch (643:7): [True: 0, False: 152k]
  ------------------
  644|       |    // To avoid invalid access by fd_win_buf
  645|      0|    T = 2;
  646|      0|  }
  647|   152k|  i = 0;
  648|  78.5M|  while (i <= out_transform_size) {
  ------------------
  |  Branch (648:10): [True: 78.3M, False: 152k]
  ------------------
  649|  78.3M|    WORD32 utk = i;
  650|       |
  651|  78.3M|    mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] * ptr_mag[utk];
  652|       |
  653|  78.3M|    phase_t = T * ptr_phase[utk];
  654|       |
  655|  78.3M|    if (phase_t == 0.0) {
  ------------------
  |  Branch (655:9): [True: 78.3M, False: 0]
  ------------------
  656|  78.3M|      ptr_spectrum_tx[2 * i] += mag_t;
  657|  78.3M|    } else {
  658|      0|      ptr_spectrum_tx[2 * i] += mag_t * (FLOAT32)cos(phase_t);
  659|      0|      ptr_spectrum_tx[2 * i + 1] += mag_t * (FLOAT32)sin(phase_t);
  660|      0|    }
  661|  78.3M|    if (p > 0) {
  ------------------
  |  Branch (661:9): [True: 65.5M, False: 12.8M]
  ------------------
  662|  65.5M|      m_val = 0;
  663|   131M|      for (tr = 1; tr < T; tr++) {
  ------------------
  |  Branch (663:20): [True: 65.5M, False: 65.5M]
  ------------------
  664|  65.5M|        FLOAT32 temp;
  665|  65.5M|        ti = (WORD32)((2.0f * i - tr * p_flt) / T + 0.5f);
  666|  65.5M|        if ((ti < 0) || (ti + p > fft_size / 2)) continue;
  ------------------
  |  Branch (666:13): [True: 646k, False: 64.8M]
  |  Branch (666:25): [True: 773k, False: 64.1M]
  ------------------
  667|  64.1M|        temp = min(ptr_mag[ti], ptr_mag[ti + p]);
  ------------------
  |  |   75|  64.1M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 64.1M]
  |  |  ------------------
  ------------------
  668|  64.1M|        if (temp > m_val) {
  ------------------
  |  Branch (668:13): [True: 0, False: 64.1M]
  ------------------
  669|      0|          m_val = temp;
  670|      0|          m_tr = tr;
  671|      0|          utk = ti;
  672|      0|        }
  673|  64.1M|      } /* for tr */
  674|       |
  675|  65.5M|      if (m_val > q_thr * ptr_mag[2 * i / T]) {
  ------------------
  |  Branch (675:11): [True: 0, False: 65.5M]
  ------------------
  676|      0|        mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] * ((FLOAT32)sqrt(ptr_mag[utk])) *
  677|      0|                ((FLOAT32)sqrt(ptr_mag[utk + p]));
  678|      0|        phase_t = ((FLOAT32)(T - m_tr)) * ptr_phase[utk] + ((FLOAT32)m_tr) * ptr_phase[utk + p];
  679|      0|        ptr_spectrum_tx[2 * i] += mag_t * ((FLOAT32)cos(phase_t));
  680|      0|        ptr_spectrum_tx[2 * i + 1] += mag_t * ((FLOAT32)sin(phase_t));
  681|      0|      }
  682|  65.5M|    }
  683|  78.3M|    i++;
  684|  78.3M|  }
  685|   152k|}
ia_dft_hbe_apply_polar_t_3:
  688|   152k|                                WORD32 pitch_in_bins, WORD out_transform_size) {
  689|   152k|  WORD32 tr;
  690|   152k|  WORD32 ti;
  691|   152k|  WORD32 m_tr = 0;
  692|   152k|  WORD32 p, i;
  693|   152k|  FLOAT32 mag_t = 0.0f;
  694|   152k|  FLOAT32 phase_t;
  695|   152k|  FLOAT32 m_val;
  696|   152k|  FLOAT32(*fd_win_buf)[3][3][1536] = &pstr_hbe_txposer->fd_win_buf;
  697|   152k|  FLOAT32 *ptr_phase = pstr_hbe_txposer->ptr_phase;
  698|   152k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  699|   152k|  WORD32 fft_size = pstr_hbe_txposer->fft_size[oversampling_flag];
  700|   152k|  FLOAT32 *ptr_spectrum_tx = pstr_hbe_txposer->ptr_spectrum_tx;
  701|   152k|  FLOAT32 *ptr_mag = pstr_hbe_txposer->ptr_mag;
  702|       |  /* pitch_in_bins is given with the resolution of a 1536 point FFT */
  703|   152k|  FLOAT32 p_flt = fft_size * pitch_in_bins / 1536.0f;
  704|   152k|  p = (WORD32)p_flt;
  705|   152k|  FLOAT32 q_thr = 4.0f;
  706|       |
  707|   152k|  if (T < 3) {
  ------------------
  |  Branch (707:7): [True: 0, False: 152k]
  ------------------
  708|       |    // To avoid invalid access by fd_win_buf
  709|      0|    T = 3;
  710|      0|  }
  711|       |
  712|   152k|  i = 0;
  713|  78.5M|  while (i <= out_transform_size) {
  ------------------
  |  Branch (713:10): [True: 78.3M, False: 152k]
  ------------------
  714|  78.3M|    WORD32 utk = 2 * i / T;
  715|  78.3M|    FLOAT32 ptk = (2.0f * i / T) - utk;
  716|  78.3M|    FLOAT32 k;
  717|       |
  718|  78.3M|    if (i % 3 == 0) {
  ------------------
  |  Branch (718:9): [True: 26.1M, False: 52.2M]
  ------------------
  719|  26.1M|      mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] * ptr_mag[utk];
  720|  52.2M|    } else if (i % 3 == 1) {
  ------------------
  |  Branch (720:16): [True: 26.1M, False: 26.1M]
  ------------------
  721|  26.1M|      k = (FLOAT32)cbrt(ptr_mag[utk]);
  722|  26.1M|      mag_t =
  723|  26.1M|          (*fd_win_buf)[T - 2][oversampling_flag][i] * k * (FLOAT32)pow(ptr_mag[utk + 1], ptk);
  724|  26.1M|    } else if (i % 3 == 2) {
  ------------------
  |  Branch (724:16): [True: 26.1M, False: 0]
  ------------------
  725|  26.1M|      k = (FLOAT32)cbrt(ptr_mag[utk + 1]);
  726|  26.1M|      mag_t =
  727|  26.1M|          (*fd_win_buf)[T - 2][oversampling_flag][i] * (FLOAT32)pow(ptr_mag[utk], 1.0 - ptk) * k;
  728|  26.1M|    }
  729|       |
  730|  78.3M|    phase_t = T * ((1 - ptk) * ptr_phase[utk] + ptk * ptr_phase[utk + 1]);
  731|       |
  732|  78.3M|    ptr_spectrum_tx[2 * i] += mag_t * (FLOAT32)cos(phase_t);
  733|  78.3M|    ptr_spectrum_tx[2 * i + 1] += mag_t * (FLOAT32)sin(phase_t);
  734|       |
  735|  78.3M|    if (p > 0) {
  ------------------
  |  Branch (735:9): [True: 65.5M, False: 12.8M]
  ------------------
  736|  65.5M|      m_val = 0;
  737|   196M|      for (tr = 1; tr < T; tr++) {
  ------------------
  |  Branch (737:20): [True: 131M, False: 65.5M]
  ------------------
  738|   131M|        FLOAT32 temp;
  739|   131M|        ti = (WORD32)((2.0f * i - tr * p_flt) / T + 0.5f);
  740|   131M|        if ((ti < 0) || (ti + p > fft_size / 2)) continue;
  ------------------
  |  Branch (740:13): [True: 1.81M, False: 129M]
  |  Branch (740:25): [True: 0, False: 129M]
  ------------------
  741|   129M|        temp = min(ptr_mag[ti], ptr_mag[ti + p]);
  ------------------
  |  |   75|   129M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 129M]
  |  |  ------------------
  ------------------
  742|   129M|        if (temp > m_val) {
  ------------------
  |  Branch (742:13): [True: 0, False: 129M]
  ------------------
  743|      0|          m_val = temp;
  744|      0|          m_tr = tr;
  745|      0|          utk = ti;
  746|      0|        }
  747|   129M|      } /* for tr */
  748|       |
  749|  65.5M|      if (m_val > q_thr * ptr_mag[2 * i / T]) {
  ------------------
  |  Branch (749:11): [True: 0, False: 65.5M]
  ------------------
  750|      0|        FLOAT32 r = (FLOAT32)m_tr / T;
  751|      0|        switch (m_tr) {
  ------------------
  |  Branch (751:17): [True: 0, False: 0]
  ------------------
  752|      0|          case 1:
  ------------------
  |  Branch (752:11): [True: 0, False: 0]
  ------------------
  753|      0|            k = (FLOAT32)(cbrt((FLOAT32)ptr_mag[utk + p]));
  754|      0|            mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] *
  755|      0|                    (FLOAT32)pow(ptr_mag[utk], 1.0 - r) * k;
  756|      0|            phase_t = (T - m_tr) * ptr_phase[utk] + ptr_phase[utk + p];
  757|      0|            break;
  758|       |
  759|      0|          case 2:
  ------------------
  |  Branch (759:11): [True: 0, False: 0]
  ------------------
  760|      0|            k = (FLOAT32)(cbrt((FLOAT32)ptr_mag[utk]));
  761|      0|            mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] * k *
  762|      0|                    (FLOAT32)pow(ptr_mag[utk + p], r);
  763|      0|            phase_t = ptr_phase[utk] + m_tr * ptr_phase[utk + p];
  764|      0|            break;
  765|      0|        }
  766|       |
  767|      0|        ptr_spectrum_tx[2 * i] += mag_t * (FLOAT32)cos(phase_t);
  768|      0|        ptr_spectrum_tx[2 * i + 1] += mag_t * (FLOAT32)sin(phase_t);
  769|      0|      }
  770|  65.5M|    }
  771|  78.3M|    i++;
  772|  78.3M|  }
  773|   152k|}
ixheaace_dft_hbe_apply:
  841|  26.1k|                                    FLOAT32 *ptr_dft_hbe_scratch_buf) {
  842|  26.1k|  WORD32 in_offset = 0;
  843|  26.1k|  WORD32 out_offset = 0;
  844|  26.1k|  WORD32 in_hop_size = pstr_hbe_txposer->in_hop_size;
  845|  26.1k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  846|  26.1k|  WORD32 fft_size = pstr_hbe_txposer->fft_size[oversampling_flag];
  847|       |
  848|  26.1k|  WORD32 out_hop_size = pstr_hbe_txposer->out_hop_size;
  849|  26.1k|  WORD32 num_in_samples = num_columns * pstr_hbe_txposer->synth_size;
  850|  26.1k|  WORD32 ana_fft_size = pstr_hbe_txposer->ana_fft_size[oversampling_flag];
  851|  26.1k|  WORD32 syn_fft_size = pstr_hbe_txposer->syn_fft_size[oversampling_flag];
  852|       |
  853|  26.1k|  WORD32 ana_pad_size = (ana_fft_size - pstr_hbe_txposer->ana_fft_size[0]) / 2;
  854|  26.1k|  WORD32 syn_pad_size = (syn_fft_size - pstr_hbe_txposer->syn_fft_size[0]) / 2;
  855|       |
  856|  26.1k|  FLOAT32 *ptr_input_buf = pstr_hbe_txposer->ptr_input_buf;
  857|  26.1k|  FLOAT32 *ptr_output_buf = pstr_hbe_txposer->ptr_output_buf;
  858|  26.1k|  FLOAT32 *ptr_spectrum = pstr_hbe_txposer->ptr_spectrum;
  859|  26.1k|  FLOAT32 *ptr_spectrum_tx = pstr_hbe_txposer->ptr_spectrum_tx;
  860|  26.1k|  FLOAT32 *ptr_mag = pstr_hbe_txposer->ptr_mag;
  861|  26.1k|  FLOAT32 *ptr_phase = pstr_hbe_txposer->ptr_phase;
  862|  26.1k|  WORD32 i, T;
  863|  26.1k|  FLOAT32 *ptr_cos_fft;
  864|  26.1k|  FLOAT32 *ptr_cos_ifft;
  865|       |
  866|  26.1k|  WORD32 ana_fft_offset = pstr_hbe_txposer->k_start * fft_size / 32;
  867|  26.1k|  WORD32 syn_fft_offset = pstr_hbe_txposer->a_start * fft_size / 64;
  868|       |  /* pitch_in_bins is given with the resolution of a 1536 point FFT */
  869|  26.1k|  WORD32 err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  26.1k|#define IA_NO_ERROR 0x00000000
  ------------------
  870|       |
  871|  26.1k|  memcpy(pstr_hbe_txposer->ptr_input_buf,
  872|  26.1k|         pstr_hbe_txposer->ptr_input_buf + pstr_hbe_txposer->ana_fft_size[0],
  873|  26.1k|         pstr_hbe_txposer->ana_fft_size[0] * sizeof(pstr_hbe_txposer->ptr_input_buf[0]));
  874|       |
  875|  26.1k|  err_code = ixheaace_real_synth_filt(pstr_hbe_txposer, num_columns, qmf_buf_real, qmf_buf_imag);
  876|  26.1k|  if (err_code) {
  ------------------
  |  Branch (876:7): [True: 0, False: 26.1k]
  ------------------
  877|      0|    return err_code;
  878|      0|  }
  879|       |
  880|  26.1k|  memcpy(ptr_output_buf, ptr_output_buf + 2 * pstr_hbe_txposer->syn_fft_size[0],
  881|  26.1k|         2 * pstr_hbe_txposer->syn_fft_size[0] * sizeof(ptr_output_buf[0]));
  882|       |
  883|  26.1k|  memset(ptr_output_buf + 2 * pstr_hbe_txposer->syn_fft_size[0], 0,
  884|  26.1k|         2 * pstr_hbe_txposer->syn_fft_size[0] * sizeof(ptr_output_buf[0]));
  885|       |
  886|  26.1k|  err_code = ixheaace_hbe_fft_map(pstr_hbe_txposer);
  887|  26.1k|  if (err_code) {
  ------------------
  |  Branch (887:7): [True: 7.02k, False: 19.0k]
  ------------------
  888|  7.02k|    return err_code;
  889|  7.02k|  }
  890|       |
  891|   171k|  while (in_offset < num_in_samples) {
  ------------------
  |  Branch (891:10): [True: 152k, False: 19.0k]
  ------------------
  892|   152k|    memset(ptr_spectrum, 0, fft_size * sizeof(ptr_spectrum[0]));
  893|   152k|    memset(ptr_spectrum_tx, 0, ((fft_size + 2) * sizeof(ptr_spectrum_tx[0])));
  894|       |
  895|   152k|    memset(ptr_mag, 0, (fft_size / 2 + 2) * sizeof(ptr_mag[0]));
  896|   152k|    memset(ptr_phase, 0, (fft_size / 2 + 2) * sizeof(ptr_phase[0]));
  897|   152k|    ixheaace_dft_hbe_apply_win(ptr_input_buf + in_offset, pstr_hbe_txposer->ptr_ana_win,
  898|   152k|                               ptr_spectrum + ana_pad_size + ana_fft_offset,
  899|   152k|                               pstr_hbe_txposer->ana_fft_size[0]);
  900|   152k|    ixheaace_dft_hbe_fft_memmove(ptr_spectrum + ana_fft_offset, ana_fft_size);
  901|   152k|    {
  902|   152k|      WORD32 len = ana_fft_size;
  903|   152k|      ptr_cos_fft = pstr_hbe_txposer->ptr_ana_cos_sin_tab;
  904|   152k|      FLOAT32 *ptr_fft_data = ptr_spectrum + ana_fft_offset;
  905|   152k|      FLOAT32 tmp1, tmp2, tmp3, tmp4;
  906|   152k|      (*(pstr_hbe_txposer->ixheaace_hbe_anal_fft))(ptr_fft_data, ptr_dft_hbe_scratch_buf, len / 2,
  907|   152k|                                                   -1);
  908|   152k|      tmp1 = ptr_fft_data[0] + ptr_fft_data[1];
  909|   152k|      ptr_fft_data[1] = ptr_fft_data[0] - ptr_fft_data[1];
  910|   152k|      ptr_fft_data[0] = tmp1;
  911|       |
  912|   152k|      i = 1;
  913|  17.6M|      while (i <= (len / 4 + (len % 4) / 2)) {
  ------------------
  |  Branch (913:14): [True: 17.4M, False: 152k]
  ------------------
  914|  17.4M|        tmp1 = ptr_fft_data[2 * i] - ptr_fft_data[len - 2 * i];
  915|  17.4M|        tmp2 = ptr_fft_data[2 * i + 1] + ptr_fft_data[len - 2 * i + 1];
  916|       |
  917|  17.4M|        tmp3 = (*(ptr_cos_fft)) * tmp1 - (*(ptr_cos_fft + 1)) * tmp2;
  918|  17.4M|        tmp4 = (*(ptr_cos_fft + 1)) * tmp1 + (*(ptr_cos_fft)) * tmp2;
  919|       |
  920|  17.4M|        ptr_cos_fft = ptr_cos_fft + 2;
  921|       |
  922|  17.4M|        tmp1 = ptr_fft_data[2 * i] + ptr_fft_data[len - 2 * i];
  923|  17.4M|        tmp2 = ptr_fft_data[2 * i + 1] - ptr_fft_data[len - 2 * i + 1];
  924|       |
  925|  17.4M|        ptr_fft_data[2 * i + 0] = 0.5f * (tmp1 - tmp3);
  926|  17.4M|        ptr_fft_data[2 * i + 1] = 0.5f * (tmp2 - tmp4);
  927|  17.4M|        ptr_fft_data[len - 2 * i + 0] = 0.5f * (tmp1 + tmp3);
  928|  17.4M|        ptr_fft_data[len - 2 * i + 1] = -0.5f * (tmp2 + tmp4);
  929|  17.4M|        ++i;
  930|  17.4M|      }
  931|   152k|    }
  932|   152k|    ixheaace_karth2polar(ptr_spectrum + ana_fft_offset, ptr_mag + ana_fft_offset / 2,
  933|   152k|                         ptr_phase + ana_fft_offset / 2, ana_fft_size);
  934|       |
  935|   458k|    for (T = 2; T <= pstr_hbe_txposer->max_stretch; T++) {
  ------------------
  |  Branch (935:17): [True: 305k, False: 152k]
  ------------------
  936|       |      /* max_stretch cannot be greater than 4. So, T can be 2 to 4*/
  937|       |
  938|   305k|      WORD32 out_transform_size;
  939|       |
  940|       |      /* 0<i<fft_size/2 */
  941|   305k|      out_transform_size = (fft_size / 2);
  942|   305k|      switch (T) {
  943|   152k|        case 2:
  ------------------
  |  Branch (943:9): [True: 152k, False: 152k]
  ------------------
  944|   152k|          ia_dft_hbe_apply_polar_t2(T, pstr_hbe_txposer, pitch_in_bins, out_transform_size);
  945|   152k|          break;
  946|   152k|        case 3:
  ------------------
  |  Branch (946:9): [True: 152k, False: 152k]
  ------------------
  947|   152k|          ia_dft_hbe_apply_polar_t_3(T, pstr_hbe_txposer, pitch_in_bins, out_transform_size);
  948|   152k|          break;
  949|      0|        default:
  ------------------
  |  Branch (949:9): [True: 0, False: 305k]
  ------------------
  950|      0|          ia_dft_hbe_apply_polar_t(T, pstr_hbe_txposer, pitch_in_bins, out_transform_size);
  951|   305k|      }
  952|   305k|    } /* for T */
  953|       |
  954|   152k|    ptr_spectrum_tx[syn_fft_offset + 1] =
  955|   152k|        ptr_spectrum_tx[syn_fft_offset + syn_fft_size]; /* Move Nyquist bin to bin 1 for RFFTN */
  956|       |
  957|   152k|    {
  958|   152k|      WORD32 len = syn_fft_size;
  959|   152k|      ptr_cos_ifft = pstr_hbe_txposer->ptr_syn_cos_sin_tab;
  960|   152k|      FLOAT32 *ptr_fft_data = ptr_spectrum_tx + syn_fft_offset;
  961|   152k|      FLOAT32 tmp1, tmp2, tmp3, tmp4;
  962|       |
  963|   152k|      FLOAT32 scale = 1.0f / len;
  964|   152k|      tmp1 = ptr_fft_data[0] + ptr_fft_data[1];
  965|   152k|      ptr_fft_data[1] = scale * (ptr_fft_data[0] - ptr_fft_data[1]);
  966|   152k|      ptr_fft_data[0] = scale * tmp1;
  967|       |
  968|  19.2M|      for (i = 1; i <= (len / 4 + (len % 4) / 2); ++i) {
  ------------------
  |  Branch (968:19): [True: 19.1M, False: 152k]
  ------------------
  969|  19.1M|        tmp1 = ptr_fft_data[2 * i] - ptr_fft_data[len - 2 * i];
  970|  19.1M|        tmp2 = ptr_fft_data[2 * i + 1] + ptr_fft_data[len - 2 * i + 1];
  971|       |
  972|  19.1M|        tmp3 = (*(ptr_cos_ifft)) * tmp1 + (*(ptr_cos_ifft + 1)) * tmp2;
  973|  19.1M|        tmp4 = -(*(ptr_cos_ifft + 1)) * tmp1 + (*(ptr_cos_ifft)) * tmp2;
  974|       |
  975|  19.1M|        ptr_cos_ifft = ptr_cos_ifft + 2;
  976|       |
  977|  19.1M|        tmp1 = ptr_fft_data[2 * i] + ptr_fft_data[len - 2 * i];
  978|  19.1M|        tmp2 = ptr_fft_data[2 * i + 1] - ptr_fft_data[len - 2 * i + 1];
  979|       |
  980|  19.1M|        ptr_fft_data[2 * i] = scale * (tmp1 - tmp3);
  981|  19.1M|        ptr_fft_data[2 * i + 1] = scale * (tmp2 - tmp4);
  982|  19.1M|        ptr_fft_data[len - 2 * i] = scale * (tmp1 + tmp3);
  983|  19.1M|        ptr_fft_data[len - 2 * i + 1] = -scale * (tmp2 + tmp4);
  984|  19.1M|      }
  985|       |
  986|   152k|      (*(pstr_hbe_txposer->ixheaace_hbe_synth_ifft))(ptr_fft_data, ptr_dft_hbe_scratch_buf,
  987|   152k|                                                     len / 2, 1);
  988|   152k|    }
  989|       |
  990|   152k|    ixheaace_dft_hbe_fft_memmove(ptr_spectrum_tx + syn_fft_offset, syn_fft_size);
  991|   152k|    ixheaace_dft_hbe_apply_win(
  992|   152k|        ptr_spectrum_tx + syn_pad_size + syn_fft_offset, pstr_hbe_txposer->ptr_syn_win,
  993|   152k|        ptr_spectrum_tx + syn_pad_size + syn_fft_offset, pstr_hbe_txposer->syn_fft_size[0]);
  994|       |
  995|  76.6M|    for (i = 0; i < pstr_hbe_txposer->syn_fft_size[0]; i++) {
  ------------------
  |  Branch (995:17): [True: 76.4M, False: 152k]
  ------------------
  996|  76.4M|      ptr_output_buf[out_offset + i] += ptr_spectrum_tx[syn_pad_size + syn_fft_offset + i];
  997|  76.4M|    }
  998|       |
  999|   152k|    in_offset += in_hop_size;
 1000|   152k|    out_offset += out_hop_size;
 1001|       |
 1002|   152k|  } /* while(in_offset<num_in_samples) */
 1003|       |
 1004|  19.0k|  ixheaace_dft_hbe_cplx_anal_filt(pstr_hbe_txposer, pv_qmf_buf_real, pv_qmf_buf_imag);
 1005|       |
 1006|  19.0k|  return err_code;
 1007|  19.0k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_calc_anal_synth_window:
  112|  4.12k|static IA_ERRORCODE ixheaace_calc_anal_synth_window(WORD32 fft_size, FLOAT32 *ptr_window) {
  113|  4.12k|  FLOAT32 sin_pi_2_n = 0.0f;
  114|  4.12k|  FLOAT32 cos_pi_2_n = 0.0f;
  115|  4.12k|  FLOAT32 *ptr_sin_pi_n_by_n = NULL;
  116|  4.12k|  WORD32 hop_stride = 1;
  117|  4.12k|  WORD32 i, j;
  118|  4.12k|  WORD32 l_fft_stride = 512;
  119|  4.12k|  switch (fft_size) {
  120|      0|    case 64:
  ------------------
  |  Branch (120:5): [True: 0, False: 4.12k]
  ------------------
  121|      0|      hop_stride = 16;
  122|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_1024[0];
  123|      0|      sin_pi_2_n = ptr_sin_pi_n_by_n[hop_stride >> 1];
  124|      0|      cos_pi_2_n = ptr_sin_pi_n_by_n[512 + (hop_stride >> 1)];
  125|      0|      l_fft_stride = 512;
  126|      0|      break;
  127|      0|    case 128:
  ------------------
  |  Branch (127:5): [True: 0, False: 4.12k]
  ------------------
  128|      0|      hop_stride = 8;
  129|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_1024[0];
  130|      0|      sin_pi_2_n = ptr_sin_pi_n_by_n[hop_stride >> 1];
  131|      0|      cos_pi_2_n = ptr_sin_pi_n_by_n[512 + (hop_stride >> 1)];
  132|      0|      l_fft_stride = 512;
  133|      0|      break;
  134|      0|    case 256:
  ------------------
  |  Branch (134:5): [True: 0, False: 4.12k]
  ------------------
  135|      0|      hop_stride = 4;
  136|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_1024[0];
  137|      0|      sin_pi_2_n = ptr_sin_pi_n_by_n[hop_stride >> 1];
  138|      0|      cos_pi_2_n = ptr_sin_pi_n_by_n[512 + (hop_stride >> 1)];
  139|      0|      l_fft_stride = 512;
  140|      0|      break;
  141|  1.25k|    case 512:
  ------------------
  |  Branch (141:5): [True: 1.25k, False: 2.87k]
  ------------------
  142|  1.25k|      hop_stride = 2;
  143|  1.25k|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_1024[0];
  144|  1.25k|      sin_pi_2_n = ptr_sin_pi_n_by_n[1];
  145|  1.25k|      cos_pi_2_n = ptr_sin_pi_n_by_n[512 + 1];
  146|  1.25k|      l_fft_stride = 512;
  147|  1.25k|      break;
  148|      0|    case 1024:
  ------------------
  |  Branch (148:5): [True: 0, False: 4.12k]
  ------------------
  149|      0|      hop_stride = 1;
  150|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_1024[0];
  151|      0|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[0];
  152|      0|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[1];
  153|      0|      l_fft_stride = 512;
  154|      0|      break;
  155|     58|    case 192:
  ------------------
  |  Branch (155:5): [True: 58, False: 4.06k]
  ------------------
  156|     58|      hop_stride = 4;
  157|     58|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_768[0];
  158|     58|      sin_pi_2_n = ptr_sin_pi_n_by_n[hop_stride >> 1];
  159|     58|      cos_pi_2_n = ptr_sin_pi_n_by_n[384 + (hop_stride >> 1)];
  160|     58|      l_fft_stride = 384;
  161|     58|      break;
  162|    864|    case 384:
  ------------------
  |  Branch (162:5): [True: 864, False: 3.26k]
  ------------------
  163|    864|      hop_stride = 2;
  164|    864|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_768[0];
  165|    864|      sin_pi_2_n = ptr_sin_pi_n_by_n[1];
  166|    864|      cos_pi_2_n = ptr_sin_pi_n_by_n[384 + 1];
  167|    864|      l_fft_stride = 384;
  168|    864|      break;
  169|      0|    case 768:
  ------------------
  |  Branch (169:5): [True: 0, False: 4.12k]
  ------------------
  170|      0|      hop_stride = 1;
  171|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_768[0];
  172|      0|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[8];
  173|      0|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[9];
  174|      0|      l_fft_stride = 384;
  175|      0|      break;
  176|      0|    case 320:
  ------------------
  |  Branch (176:5): [True: 0, False: 4.12k]
  ------------------
  177|      0|      hop_stride = 3;
  178|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_960[0];
  179|      0|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[16];
  180|      0|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[17];
  181|      0|      l_fft_stride = 480;
  182|      0|      break;
  183|      0|    case 960:
  ------------------
  |  Branch (183:5): [True: 0, False: 4.12k]
  ------------------
  184|      0|      hop_stride = 1;
  185|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_960[0];
  186|      0|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[2];
  187|      0|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[3];
  188|      0|      l_fft_stride = 480;
  189|      0|      break;
  190|    167|    case 448:
  ------------------
  |  Branch (190:5): [True: 167, False: 3.95k]
  ------------------
  191|    167|      hop_stride = 2;
  192|    167|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_896[0];
  193|    167|      sin_pi_2_n = ptr_sin_pi_n_by_n[1];
  194|    167|      cos_pi_2_n = ptr_sin_pi_n_by_n[448 + 1];
  195|    167|      l_fft_stride = 448;
  196|    167|      break;
  197|      0|    case 896:
  ------------------
  |  Branch (197:5): [True: 0, False: 4.12k]
  ------------------
  198|      0|      hop_stride = 1;
  199|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_896[0];
  200|      0|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[4];
  201|      0|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[5];
  202|      0|      l_fft_stride = 448;
  203|      0|      break;
  204|    829|    case 576:
  ------------------
  |  Branch (204:5): [True: 829, False: 3.29k]
  ------------------
  205|    829|      hop_stride = 1;
  206|    829|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_576[0];
  207|    829|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[14];
  208|    829|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[15];
  209|    829|      l_fft_stride = 288;
  210|    829|      break;
  211|    352|    case 640:
  ------------------
  |  Branch (211:5): [True: 352, False: 3.77k]
  ------------------
  212|    352|      hop_stride = 1;
  213|    352|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_640[0];
  214|    352|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[12];
  215|    352|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[13];
  216|    352|      l_fft_stride = 320;
  217|    352|      break;
  218|    601|    case 704:
  ------------------
  |  Branch (218:5): [True: 601, False: 3.52k]
  ------------------
  219|    601|      hop_stride = 1;
  220|    601|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_704[0];
  221|    601|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[10];
  222|    601|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[11];
  223|    601|      l_fft_stride = 352;
  224|    601|      break;
  225|      0|    case 832:
  ------------------
  |  Branch (225:5): [True: 0, False: 4.12k]
  ------------------
  226|      0|      hop_stride = 1;
  227|      0|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_832[0];
  228|      0|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[6];
  229|      0|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[7];
  230|      0|      l_fft_stride = 416;
  231|      0|      break;
  232|      0|    default:
  ------------------
  |  Branch (232:5): [True: 0, False: 4.12k]
  ------------------
  233|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_MAPPING;
  234|  4.12k|  }
  235|       |
  236|       |  /*calculate Window*/
  237|  1.09M|  for (i = 0, j = 0; j < (fft_size >> 1); i += hop_stride, j++) {
  ------------------
  |  Branch (237:22): [True: 1.09M, False: 4.12k]
  ------------------
  238|  1.09M|    FLOAT32 cos_val = ptr_sin_pi_n_by_n[i + l_fft_stride];
  239|  1.09M|    FLOAT32 sin_val = ptr_sin_pi_n_by_n[i];
  240|  1.09M|    ptr_window[j] = cos_val * sin_pi_2_n + sin_val * cos_pi_2_n;
  241|  1.09M|  }
  242|       |
  243|  1.09M|  for (; j < fft_size; j++, i += hop_stride) {
  ------------------
  |  Branch (243:10): [True: 1.09M, False: 4.12k]
  ------------------
  244|  1.09M|    FLOAT32 cos_val = ptr_sin_pi_n_by_n[i - l_fft_stride];
  245|  1.09M|    FLOAT32 sin_val = ptr_sin_pi_n_by_n[i];
  246|  1.09M|    ptr_window[j] = sin_val * cos_pi_2_n - cos_val * sin_pi_2_n;
  247|  1.09M|  }
  248|  4.12k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.12k|#define IA_NO_ERROR 0x00000000
  ------------------
  249|  4.12k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_map_prot_filter:
   39|  4.12k|static FLOAT32 *ixheaace_map_prot_filter(WORD32 filt_length) {
   40|  4.12k|  switch (filt_length) {
   41|      0|    case 4:
  ------------------
  |  Branch (41:5): [True: 0, False: 4.12k]
  ------------------
   42|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[0];
   43|      0|      break;
   44|      0|    case 8:
  ------------------
  |  Branch (44:5): [True: 0, False: 4.12k]
  ------------------
   45|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[40];
   46|      0|      break;
   47|    916|    case 12:
  ------------------
  |  Branch (47:5): [True: 916, False: 3.21k]
  ------------------
   48|    916|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[120];
   49|      0|      break;
   50|    858|    case 16:
  ------------------
  |  Branch (50:5): [True: 858, False: 3.26k]
  ------------------
   51|    858|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[240];
   52|      0|      break;
   53|    347|    case 20:
  ------------------
  |  Branch (53:5): [True: 347, False: 3.77k]
  ------------------
   54|    347|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[400];
   55|      0|      break;
   56|      6|    case 24:
  ------------------
  |  Branch (56:5): [True: 6, False: 4.12k]
  ------------------
   57|      6|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[600];
   58|      0|      break;
   59|    167|    case 28:
  ------------------
  |  Branch (59:5): [True: 167, False: 3.95k]
  ------------------
   60|    167|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff_28_36[0];
   61|      0|      break;
   62|    397|    case 32:
  ------------------
  |  Branch (62:5): [True: 397, False: 3.72k]
  ------------------
   63|    397|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[840];
   64|      0|      break;
   65|    829|    case 36:
  ------------------
  |  Branch (65:5): [True: 829, False: 3.29k]
  ------------------
   66|    829|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff_28_36[280];
   67|      0|      break;
   68|      5|    case 40:
  ------------------
  |  Branch (68:5): [True: 5, False: 4.12k]
  ------------------
   69|      5|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[1160];
   70|      0|      break;
   71|    601|    case 44:
  ------------------
  |  Branch (71:5): [True: 601, False: 3.52k]
  ------------------
   72|    601|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[1560];
   73|      0|      break;
   74|      0|    default:
  ------------------
  |  Branch (74:5): [True: 0, False: 4.12k]
  ------------------
   75|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[0];
   76|  4.12k|  }
   77|  4.12k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_create_dft_hbe_window:
   83|  9.07k|                                           WORD32 x_over_bin2, WORD32 ts, WORD32 size) {
   84|  9.07k|  const FLOAT32 *ptr_freq_domain_win = NULL;
   85|  9.07k|  WORD32 n;
   86|  9.07k|  if (ts == 12) {
  ------------------
  |  Branch (86:7): [True: 4.53k, False: 4.53k]
  ------------------
   87|  4.53k|    ptr_freq_domain_win = &ixheaac_dft_hbe_window_ts_12[0];
   88|  4.53k|  } else {
   89|  4.53k|    ptr_freq_domain_win = &ixheaac_dft_hbe_window_ts_18[0];
   90|  4.53k|  }
   91|  2.82M|  for (n = 0; n < (x_over_bin1 - ts / 2); n++) {
  ------------------
  |  Branch (91:15): [True: 2.81M, False: 9.07k]
  ------------------
   92|  2.81M|    ptr_win[n] = 0;
   93|  2.81M|  }
   94|       |
   95|   154k|  for (n = (x_over_bin1 - ts / 2); n <= (x_over_bin1 + ts / 2); n++) {
  ------------------
  |  Branch (95:36): [True: 145k, False: 9.07k]
  ------------------
   96|   145k|    ptr_win[n] = (FLOAT32)ptr_freq_domain_win[n - (x_over_bin1 - ts / 2)];
   97|   145k|  }
   98|       |
   99|  1.16M|  for (n = (x_over_bin1 + ts / 2 + 1); n < (x_over_bin2 - ts / 2); n++) {
  ------------------
  |  Branch (99:40): [True: 1.15M, False: 9.07k]
  ------------------
  100|  1.15M|    ptr_win[n] = (FLOAT32)1.0f;
  101|  1.15M|  }
  102|       |
  103|   154k|  for (n = (x_over_bin2 - ts / 2); n <= (x_over_bin2 + ts / 2); n++) {
  ------------------
  |  Branch (103:36): [True: 145k, False: 9.07k]
  ------------------
  104|   145k|    ptr_win[n] = (FLOAT32)1.0f - ptr_freq_domain_win[n - (x_over_bin2 - ts / 2)];
  105|   145k|  }
  106|       |
  107|  7.36M|  for (n = (x_over_bin2 + ts / 2 + 1); n < size; n++) {
  ------------------
  |  Branch (107:40): [True: 7.36M, False: 9.07k]
  ------------------
  108|  7.36M|    ptr_win[n] = 0.0f;
  109|  7.36M|  }
  110|  9.07k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_dft_hbe_apply_win:
  484|   305k|                                       WORD32 n) {
  485|   305k|  WORD32 i;
  486|   146M|  for (i = 0; i < n; i++) {
  ------------------
  |  Branch (486:15): [True: 146M, False: 305k]
  ------------------
  487|   146M|    ptr_z[i] = ptr_x[i] * ptr_y[i];
  488|   146M|  }
  489|   305k|}

ixheaace_hbe_apply_ifft_7:
   53|  1.73M|VOID ixheaace_hbe_apply_ifft_7(FLOAT32 *ptr_inp, FLOAT32 *ptr_op) {
   54|  1.73M|  FLOAT32 x0r, x1r, x2r, x3r, x4r, x5r, x6r, x7r, x8r;
   55|  1.73M|  FLOAT32 x0i, x1i, x2i, x3i, x4i, x5i, x6i, x7i, x8i;
   56|  1.73M|  FLOAT32 y0r, y1r, y2r, y3r, y4r, y5r, y6r, y7r, y8r;
   57|  1.73M|  FLOAT32 y0i, y1i, y2i, y3i, y4i, y5i, y6i, y7i, y8i;
   58|       |
   59|       |  /*
   60|       |   * Node 1 of Winograd FFT for 7 point
   61|       |   *
   62|       |   * 1   0   0   0   0   0   0
   63|       |   * 0   1   0   0   0   0   1
   64|       |   * 0   1   0   0   0   0  -1
   65|       |   * 0   0   1   0   0   1   0
   66|       |   * 0   0   1   0   0  -1   0
   67|       |   * 0   0   0   1   1   0   0
   68|       |   * 0   0   0  -1   1   0   0
   69|       |   *
   70|       |   */
   71|       |
   72|  1.73M|  x0r = ptr_inp[0];
   73|  1.73M|  x0i = ptr_inp[1];
   74|  1.73M|  x1r = ptr_inp[2] + ptr_inp[12];
   75|  1.73M|  x1i = ptr_inp[3] + ptr_inp[13];
   76|  1.73M|  x2r = ptr_inp[2] - ptr_inp[12];
   77|  1.73M|  x2i = ptr_inp[3] - ptr_inp[13];
   78|  1.73M|  x3r = ptr_inp[4] + ptr_inp[10];
   79|  1.73M|  x3i = ptr_inp[5] + ptr_inp[11];
   80|  1.73M|  x4r = ptr_inp[4] - ptr_inp[10];
   81|  1.73M|  x4i = ptr_inp[5] - ptr_inp[11];
   82|  1.73M|  x5r = ptr_inp[8] + ptr_inp[6];
   83|  1.73M|  x5i = ptr_inp[9] + ptr_inp[7];
   84|  1.73M|  x6r = ptr_inp[8] - ptr_inp[6];
   85|  1.73M|  x6i = ptr_inp[9] - ptr_inp[7];
   86|       |
   87|       |  /*
   88|       |   * Node 2 of Winograd FFT for 7 point
   89|       |   *
   90|       |   * 1   0   0   0   0   0   0
   91|       |   * 0   1   0   1   0   1   0
   92|       |   * 0   1   0  -1   0   0   0
   93|       |   * 0  -1   0   0   0   1   0
   94|       |   * 0   0   0   1   0  -1   0
   95|       |   * 0   0   1   0   1   0   1
   96|       |   * 0   0   1   0  -1   0   0
   97|       |   * 0   0  -1   0   0   0   1
   98|       |   * 0   0   0   0   1   0  -1
   99|       |   *
  100|       |   */
  101|       |
  102|  1.73M|  y0r = x0r;
  103|  1.73M|  y0i = x0i;
  104|  1.73M|  y1r = x1r + x3r + x5r;
  105|  1.73M|  y1i = x1i + x3i + x5i;
  106|  1.73M|  y2r = x1r - x3r;
  107|  1.73M|  y2i = x1i - x3i;
  108|  1.73M|  y3r = x5r - x1r;
  109|  1.73M|  y3i = x5i - x1i;
  110|  1.73M|  y4r = x3r - x5r;
  111|  1.73M|  y4i = x3i - x5i;
  112|  1.73M|  y5r = x2r + x4r + x6r;
  113|  1.73M|  y5i = x2i + x4i + x6i;
  114|  1.73M|  y6r = x2r - x4r;
  115|  1.73M|  y6i = x2i - x4i;
  116|  1.73M|  y7r = x6r - x2r;
  117|  1.73M|  y7i = x6i - x2i;
  118|  1.73M|  y8r = x4r - x6r;
  119|  1.73M|  y8i = x4i - x6i;
  120|       |
  121|       |  /*
  122|       |   * Node 3 of Winograd FFT for 7 point
  123|       |   *
  124|       |   * 1    1    0    0    0     0     0     0     0
  125|       |   * 1  c70    0    0    0     0     0     0     0
  126|       |   * 0    0  c71    0    0     0     0     0     0
  127|       |   * 0    0    0  c72    0     0     0     0     0
  128|       |   * 0    0    0    0  c73     0     0     0     0
  129|       |   * 0    0    0    0    0  jc74     0     0     0
  130|       |   * 0    0    0    0    0     0  jc75     0     0
  131|       |   * 0    0    0    0    0     0     0  jc76     0
  132|       |   * 0    0    0    0    0     0     0     0  jc77
  133|       |   *
  134|       |   */
  135|  1.73M|  x0r = y0r + y1r;
  136|  1.73M|  x0i = y0i + y1i;
  137|  1.73M|  x1r = y0r + C70 * y1r;
  ------------------
  |  |   32|  1.73M|#define C70 (-0.1666667014f)  //(cos(u) + cos(2 * u) + cos(3 * u)) / 3;
  ------------------
  138|  1.73M|  x1i = y0i + C70 * y1i;
  ------------------
  |  |   32|  1.73M|#define C70 (-0.1666667014f)  //(cos(u) + cos(2 * u) + cos(3 * u)) / 3;
  ------------------
  139|  1.73M|  x2r = C71 * y2r;
  ------------------
  |  |   33|  1.73M|#define C71 (0.7901564837f)   //(2 * cos(u) - cos(2 * u) - cos(3 * u)) / 3;
  ------------------
  140|  1.73M|  x2i = C71 * y2i;
  ------------------
  |  |   33|  1.73M|#define C71 (0.7901564837f)   //(2 * cos(u) - cos(2 * u) - cos(3 * u)) / 3;
  ------------------
  141|  1.73M|  x3r = C72 * y3r;
  ------------------
  |  |   34|  1.73M|#define C72 (0.0558542535f)   //(cos(u) - 2 * cos(2 * u) + cos(3 * u)) / 3;
  ------------------
  142|  1.73M|  x3i = C72 * y3i;
  ------------------
  |  |   34|  1.73M|#define C72 (0.0558542535f)   //(cos(u) - 2 * cos(2 * u) + cos(3 * u)) / 3;
  ------------------
  143|  1.73M|  x4r = C73 * y4r;
  ------------------
  |  |   35|  1.73M|#define C73 (0.7343022227f)   //(cos(u) + cos(2 * u) - 2 * cos(3 * u)) / 3;
  ------------------
  144|  1.73M|  x4i = C73 * y4i;
  ------------------
  |  |   35|  1.73M|#define C73 (0.7343022227f)   //(cos(u) + cos(2 * u) - 2 * cos(3 * u)) / 3;
  ------------------
  145|  1.73M|  x5r = C74 * y5i;
  ------------------
  |  |   36|  1.73M|#define C74 (-0.4409585893f)  //(sin(u) + sin(2 * u) - sin(3 * u)) / 3;
  ------------------
  146|  1.73M|  x5i = -C74 * y5r;
  ------------------
  |  |   36|  1.73M|#define C74 (-0.4409585893f)  //(sin(u) + sin(2 * u) - sin(3 * u)) / 3;
  ------------------
  147|  1.73M|  x6r = C75 * y6i;
  ------------------
  |  |   37|  1.73M|#define C75 (-0.3408728838f)  //(2 * sin(u) - sin(2 * u) + sin(3 * u)) / 3;
  ------------------
  148|  1.73M|  x6i = -C75 * y6r;
  ------------------
  |  |   37|  1.73M|#define C75 (-0.3408728838f)  //(2 * sin(u) - sin(2 * u) + sin(3 * u)) / 3;
  ------------------
  149|  1.73M|  x7r = C76 * y7i;
  ------------------
  |  |   38|  1.73M|#define C76 (0.5339693427f)   //(sin(u) - 2 * sin(2 * u) - sin(3 * u)) / 3;
  ------------------
  150|  1.73M|  x7i = -C76 * y7r;
  ------------------
  |  |   38|  1.73M|#define C76 (0.5339693427f)   //(sin(u) - 2 * sin(2 * u) - sin(3 * u)) / 3;
  ------------------
  151|  1.73M|  x8r = C77 * y8i;
  ------------------
  |  |   39|  1.73M|#define C77 (-0.8748422265f)  //(sin(u) + sin(2 * u) + 2 * sin(3 * u)) / 3;
  ------------------
  152|  1.73M|  x8i = -C77 * y8r;
  ------------------
  |  |   39|  1.73M|#define C77 (-0.8748422265f)  //(sin(u) + sin(2 * u) + 2 * sin(3 * u)) / 3;
  ------------------
  153|       |
  154|       |  /*
  155|       |   * Node 4 of Winograd FFT for 7 point
  156|       |   *
  157|       |   * 1   0   0   0   0   0   0   0   0
  158|       |   * 0   1   1   0   1   0   0   0   0
  159|       |   * 0   1  -1  -1   0   0   0   0   0
  160|       |   * 0   1   0   1  -1   0   0   0   0
  161|       |   * 0   0   0   0   0   1   1   0   1
  162|       |   * 0   0   0   0   0   1  -1  -1   0
  163|       |   * 0   0   0   0   0   1   0   1  -1
  164|       |   *
  165|       |   */
  166|       |
  167|  1.73M|  y0r = x0r;
  168|  1.73M|  y0i = x0i;
  169|  1.73M|  y1r = x1r + x2r + x4r;
  170|  1.73M|  y1i = x1i + x2i + x4i;
  171|  1.73M|  y2r = x1r - x2r - x3r;
  172|  1.73M|  y2i = x1i - x2i - x3i;
  173|  1.73M|  y3r = x1r + x3r - x4r;
  174|  1.73M|  y3i = x1i + x3i - x4i;
  175|  1.73M|  y4r = x5r + x6r + x8r;
  176|  1.73M|  y4i = x5i + x6i + x8i;
  177|  1.73M|  y5r = x5r - x6r - x7r;
  178|  1.73M|  y5i = x5i - x6i - x7i;
  179|  1.73M|  y6r = x5r + x7r - x8r;
  180|  1.73M|  y6i = x5i + x7i - x8i;
  181|       |
  182|       |  /*
  183|       |   * Node 5 of Winograd FFT for 7 point
  184|       |   *
  185|       |   * 1   0   0   0   0   0   0
  186|       |   * 0   1   0   0   1   0   0
  187|       |   * 0   0   0   1   0   0   1
  188|       |   * 0   0   1   0   0  -1   0
  189|       |   * 0   0   1   0   0   1   0
  190|       |   * 0   0   0   1   0   0  -1
  191|       |   * 0   1   0   0  -1   0   0
  192|       |   *
  193|       |   */
  194|  1.73M|  x0r = y0r;
  195|  1.73M|  x0i = y0i;
  196|  1.73M|  x1r = y1r + y4r;
  197|  1.73M|  x1i = y1i + y4i;
  198|  1.73M|  x2r = y3r + y6r;
  199|  1.73M|  x2i = y3i + y6i;
  200|  1.73M|  x3r = y2r - y5r;
  201|  1.73M|  x3i = y2i - y5i;
  202|  1.73M|  x4r = y2r + y5r;
  203|  1.73M|  x4i = y2i + y5i;
  204|  1.73M|  x5r = y3r - y6r;
  205|  1.73M|  x5i = y3i - y6i;
  206|  1.73M|  x6r = y1r - y4r;
  207|  1.73M|  x6i = y1i - y4i;
  208|       |
  209|  1.73M|  ptr_op[0] = x0r;
  210|  1.73M|  ptr_op[1] = x0i;
  211|  1.73M|  ptr_op[2] = x1r;
  212|  1.73M|  ptr_op[3] = x1i;
  213|  1.73M|  ptr_op[4] = x2r;
  214|  1.73M|  ptr_op[5] = x2i;
  215|  1.73M|  ptr_op[6] = x3r;
  216|  1.73M|  ptr_op[7] = x3i;
  217|  1.73M|  ptr_op[8] = x4r;
  218|  1.73M|  ptr_op[9] = x4i;
  219|  1.73M|  ptr_op[10] = x5r;
  220|  1.73M|  ptr_op[11] = x5i;
  221|  1.73M|  ptr_op[12] = x6r;
  222|  1.73M|  ptr_op[13] = x6i;
  223|  1.73M|}
ixheaace_hbe_apply_fft_3:
  225|  9.29M|VOID ixheaace_hbe_apply_fft_3(FLOAT32 *ptr_inp, FLOAT32 *ptr_op, WORD32 i_sign) {
  226|  9.29M|  FLOAT32 add_r, sub_r;
  227|  9.29M|  FLOAT32 add_i, sub_i;
  228|  9.29M|  FLOAT32 x_01_r, x_01_i, temp;
  229|       |
  230|  9.29M|  FLOAT32 p1, p2, p3, p4;
  231|       |
  232|       |  /* mu = PI / 3; The cos and sin values are in Q31
  233|       |     cosmu is 0.5 so used >> 1 instead of multiplication */
  234|       |
  235|  9.29M|  FLOAT64 sinmu;
  236|  9.29M|  sinmu = -0.866025403784439 * (FLOAT64)i_sign;
  237|       |
  238|  9.29M|  x_01_r = ptr_inp[0] + ptr_inp[2];
  239|  9.29M|  x_01_i = ptr_inp[1] + ptr_inp[3];
  240|       |
  241|  9.29M|  add_r = ptr_inp[2] + ptr_inp[4];
  242|  9.29M|  add_i = ptr_inp[3] + ptr_inp[5];
  243|       |
  244|  9.29M|  sub_r = ptr_inp[2] - ptr_inp[4];
  245|  9.29M|  sub_i = ptr_inp[3] - ptr_inp[5];
  246|       |
  247|  9.29M|  p1 = add_r / (FLOAT32)2.0;
  248|  9.29M|  p4 = add_i / (FLOAT32)2.0;
  249|  9.29M|  p2 = (FLOAT32)((FLOAT64)sub_i * sinmu);
  250|  9.29M|  p3 = (FLOAT32)((FLOAT64)sub_r * sinmu);
  251|       |
  252|  9.29M|  temp = ptr_inp[0] - p1;
  253|       |
  254|  9.29M|  ptr_op[0] = x_01_r + ptr_inp[4];
  255|  9.29M|  ptr_op[1] = x_01_i + ptr_inp[5];
  256|  9.29M|  ptr_op[2] = temp + p2;
  257|  9.29M|  ptr_op[3] = (ptr_inp[1] - p3) - p4;
  258|  9.29M|  ptr_op[4] = temp - p2;
  259|  9.29M|  ptr_op[5] = (ptr_inp[1] + p3) - p4;
  260|  9.29M|}
ixheaace_hbe_apply_tw_mult_ifft:
  263|  54.1k|                                     const FLOAT32 *ptr_tw) {
  264|  54.1k|  FLOAT32 accu1, accu2;
  265|  54.1k|  WORD32 i, j;
  266|  54.1k|  WORD32 step_val = (dim2 - 1) << 1;
  267|   433k|  for (i = 0; i < (dim2); i++) {
  ------------------
  |  Branch (267:15): [True: 379k, False: 54.1k]
  ------------------
  268|   379k|    ptr_op[0] = ptr_inp[0];
  269|   379k|    ptr_op[1] = ptr_inp[1];
  270|   379k|    ptr_op += 2;
  271|   379k|    ptr_inp += 2;
  272|   379k|  }
  273|       |
  274|  1.73M|  for (j = 0; j < (dim1 - 1); j++) {
  ------------------
  |  Branch (274:15): [True: 1.67M, False: 54.1k]
  ------------------
  275|  1.67M|    ptr_op[0] = ptr_inp[0];
  276|  1.67M|    ptr_op[1] = ptr_inp[1];
  277|  1.67M|    ptr_inp += 2;
  278|  1.67M|    ptr_op += 2;
  279|  11.7M|    for (i = 0; i < (dim2 - 1); i++) {
  ------------------
  |  Branch (279:17): [True: 10.0M, False: 1.67M]
  ------------------
  280|  10.0M|      CPLX_MPY_IFFT(accu1, accu2, ptr_inp[2 * i + 0], ptr_inp[2 * i + 1], ptr_tw[2 * i + 1],
  ------------------
  |  |   48|  10.0M|  do {                                    \
  |  |   49|  10.0M|    re = ((a * c) + (b * d));             \
  |  |   50|  10.0M|    im = (-(a * d) + (b * c));            \
  |  |   51|  10.0M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (51:12): [Folded, False: 10.0M]
  |  |  ------------------
  ------------------
  281|  10.0M|                    ptr_tw[2 * i]);
  282|  10.0M|      ptr_op[2 * i + 0] = accu1;
  283|  10.0M|      ptr_op[2 * i + 1] = accu2;
  284|  10.0M|    }
  285|  1.67M|    ptr_inp += step_val;
  286|  1.67M|    ptr_op += step_val;
  287|  1.67M|    ptr_tw += (dim2 - 1) * 2;
  288|  1.67M|  }
  289|  54.1k|}
ixheaace_hbe_apply_tw_mult_fft:
  292|  26.9k|                                    const FLOAT32 *ptr_tw) {
  293|  26.9k|  FLOAT32 accu1, accu2;
  294|  26.9k|  WORD32 i, j;
  295|  26.9k|  WORD32 step_val = (dim2 - 1) << 1;
  296|   107k|  for (i = 0; i < (dim2); i++) {
  ------------------
  |  Branch (296:15): [True: 80.8k, False: 26.9k]
  ------------------
  297|  80.8k|    ptr_op[0] = ptr_inp[0];
  298|  80.8k|    ptr_op[1] = ptr_inp[1];
  299|  80.8k|    ptr_op += 2;
  300|  80.8k|    ptr_inp += 2;
  301|  80.8k|  }
  302|       |
  303|  2.58M|  for (j = 0; j < (dim1 - 1); j++) {
  ------------------
  |  Branch (303:15): [True: 2.56M, False: 26.9k]
  ------------------
  304|  2.56M|    ptr_op[0] = ptr_inp[0];
  305|  2.56M|    ptr_op[1] = ptr_inp[1];
  306|  2.56M|    ptr_inp += 2;
  307|  2.56M|    ptr_op += 2;
  308|  7.68M|    for (i = 0; i < (dim2 - 1); i++) {
  ------------------
  |  Branch (308:17): [True: 5.12M, False: 2.56M]
  ------------------
  309|  5.12M|      CPLX_MPY_FFT(accu1, accu2, ptr_inp[2 * i + 0], ptr_inp[2 * i + 1], ptr_tw[2 * i + 1],
  ------------------
  |  |   42|  5.12M|  do {                                   \
  |  |   43|  5.12M|    re = ((a * c) - (b * d));            \
  |  |   44|  5.12M|    im = ((a * d) + (b * c));            \
  |  |   45|  5.12M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (45:12): [Folded, False: 5.12M]
  |  |  ------------------
  ------------------
  310|  5.12M|                   ptr_tw[2 * i]);
  311|  5.12M|      ptr_op[2 * i + 0] = accu1;
  312|  5.12M|      ptr_op[2 * i + 1] = accu2;
  313|  5.12M|    }
  314|  2.56M|    ptr_inp += step_val;
  315|  2.56M|    ptr_op += step_val;
  316|  2.56M|    ptr_tw += (dim2 - 1) * 2;
  317|  2.56M|  }
  318|  26.9k|}
ixheaace_hbe_apply_cfftn:
  320|   974k|VOID ixheaace_hbe_apply_cfftn(FLOAT32 re[], FLOAT32 *ptr_scratch, WORD32 n_pass, WORD32 i_sign) {
  321|   974k|  WORD32 i, j, k, n_stages, h2;
  322|   974k|  FLOAT32 x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  323|   974k|  WORD32 del, nodespacing, in_loop_cnt;
  324|   974k|  WORD32 not_power_4;
  325|   974k|  WORD32 dig_rev_shift;
  326|   974k|  WORD32 mpass = n_pass;
  327|   974k|  WORD32 npoints = n_pass;
  328|   974k|  const FLOAT64 *ptr_w;
  329|   974k|  FLOAT32 *ptr_x = ptr_scratch;
  330|   974k|  FLOAT32 *y = ptr_scratch + (2 * n_pass);
  331|   974k|  FLOAT32 *ptr_y = y;
  332|       |
  333|   974k|  dig_rev_shift = ixheaac_norm32(mpass) + 1 - 16;
  334|   974k|  n_stages = 30 - ixheaac_norm32(mpass); /* log2(npoints), if npoints=2^m */
  335|   974k|  not_power_4 = n_stages & 1;
  336|       |
  337|   974k|  n_stages = n_stages >> 1;
  338|       |
  339|   974k|  ptr_w = ixheaac_twid_tbl_fft_double;
  340|   974k|  ptr_x = re;
  341|       |
  342|   974k|  dig_rev_shift = MAX(dig_rev_shift, 0);
  ------------------
  |  |   24|   974k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 974k, False: 0]
  |  |  ------------------
  ------------------
  343|       |
  344|   974k|  if (i_sign == -1) {
  ------------------
  |  Branch (344:7): [True: 281k, False: 693k]
  ------------------
  345|  9.03M|    for (i = 0; i < npoints; i += 4) {
  ------------------
  |  Branch (345:17): [True: 8.74M, False: 281k]
  ------------------
  346|  8.74M|      FLOAT32 *ptr_inp = ptr_x;
  347|  8.74M|      FLOAT32 tmk;
  348|       |
  349|  8.74M|      DIG_REV(i, dig_rev_shift, h2);
  ------------------
  |  |   33|  8.74M|  do {                                                      \
  |  |   34|  8.74M|    unsigned _ = (i);                                       \
  |  |   35|  8.74M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   36|  8.74M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   37|  8.74M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   38|  8.74M|    (j) = _ >> (m);                                         \
  |  |   39|  8.74M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (39:12): [Folded, False: 8.74M]
  |  |  ------------------
  ------------------
  350|  8.74M|      if (not_power_4) {
  ------------------
  |  Branch (350:11): [True: 0, False: 8.74M]
  ------------------
  351|      0|        h2 += 1;
  352|      0|        h2 &= ~1;
  353|      0|      }
  354|  8.74M|      ptr_inp += (h2);
  355|       |
  356|  8.74M|      x0r = *ptr_inp;
  357|  8.74M|      x0i = *(ptr_inp + 1);
  358|  8.74M|      ptr_inp += (npoints >> 1);
  359|       |
  360|  8.74M|      x1r = *ptr_inp;
  361|  8.74M|      x1i = *(ptr_inp + 1);
  362|  8.74M|      ptr_inp += (npoints >> 1);
  363|       |
  364|  8.74M|      x2r = *ptr_inp;
  365|  8.74M|      x2i = *(ptr_inp + 1);
  366|  8.74M|      ptr_inp += (npoints >> 1);
  367|       |
  368|  8.74M|      x3r = *ptr_inp;
  369|  8.74M|      x3i = *(ptr_inp + 1);
  370|       |
  371|  8.74M|      x0r = x0r + x2r;
  372|  8.74M|      x0i = x0i + x2i;
  373|       |
  374|  8.74M|      tmk = x0r - x2r;
  375|  8.74M|      x2r = tmk - x2r;
  376|  8.74M|      tmk = x0i - x2i;
  377|  8.74M|      x2i = tmk - x2i;
  378|       |
  379|  8.74M|      x1r = x1r + x3r;
  380|  8.74M|      x1i = x1i + x3i;
  381|       |
  382|  8.74M|      tmk = x1r - x3r;
  383|  8.74M|      x3r = tmk - x3r;
  384|  8.74M|      tmk = x1i - x3i;
  385|  8.74M|      x3i = tmk - x3i;
  386|       |
  387|  8.74M|      x0r = x0r + x1r;
  388|  8.74M|      x0i = x0i + x1i;
  389|       |
  390|  8.74M|      tmk = x0r - x1r;
  391|  8.74M|      x1r = tmk - x1r;
  392|  8.74M|      tmk = x0i - x1i;
  393|  8.74M|      x1i = tmk - x1i;
  394|       |
  395|  8.74M|      x2r = x2r + x3i;
  396|  8.74M|      x2i = x2i - x3r;
  397|       |
  398|  8.74M|      tmk = x2r - x3i;
  399|  8.74M|      x3i = tmk - x3i;
  400|  8.74M|      tmk = x2i + x3r;
  401|  8.74M|      x3r = tmk + x3r;
  402|       |
  403|  8.74M|      *ptr_y++ = x0r;
  404|  8.74M|      *ptr_y++ = x0i;
  405|  8.74M|      *ptr_y++ = x2r;
  406|  8.74M|      *ptr_y++ = x2i;
  407|  8.74M|      *ptr_y++ = x1r;
  408|  8.74M|      *ptr_y++ = x1i;
  409|  8.74M|      *ptr_y++ = x3i;
  410|  8.74M|      *ptr_y++ = x3r;
  411|  8.74M|    }
  412|   281k|    ptr_y -= 2 * npoints;
  413|   281k|    del = 4;
  414|   281k|    nodespacing = 64;
  415|   281k|    in_loop_cnt = npoints >> 4;
  416|   932k|    for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (416:28): [True: 651k, False: 281k]
  ------------------
  417|   651k|      const FLOAT64 *ptr_twiddle = ptr_w;
  418|   651k|      FLOAT32 *data = ptr_y;
  419|   651k|      FLOAT64 w_1, w_2, w_3, w_4, w_5, w_6;
  420|   651k|      WORD32 sec_loop_cnt;
  421|       |
  422|  3.47M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (422:29): [True: 2.82M, False: 651k]
  ------------------
  423|  2.82M|        x0r = (*data);
  424|  2.82M|        x0i = (*(data + 1));
  425|  2.82M|        data += ((SIZE_T)del << 1);
  426|       |
  427|  2.82M|        x1r = (*data);
  428|  2.82M|        x1i = (*(data + 1));
  429|  2.82M|        data += ((SIZE_T)del << 1);
  430|       |
  431|  2.82M|        x2r = (*data);
  432|  2.82M|        x2i = (*(data + 1));
  433|  2.82M|        data += ((SIZE_T)del << 1);
  434|       |
  435|  2.82M|        x3r = (*data);
  436|  2.82M|        x3i = (*(data + 1));
  437|  2.82M|        data -= 3 * (del << 1);
  438|       |
  439|  2.82M|        x0r = x0r + x2r;
  440|  2.82M|        x0i = x0i + x2i;
  441|  2.82M|        x2r = x0r - (x2r * 2);
  442|  2.82M|        x2i = x0i - (x2i * 2);
  443|  2.82M|        x1r = x1r + x3r;
  444|  2.82M|        x1i = x1i + x3i;
  445|  2.82M|        x3r = x1r - (x3r * 2);
  446|  2.82M|        x3i = x1i - (x3i * 2);
  447|       |
  448|  2.82M|        x0r = x0r + x1r;
  449|  2.82M|        x0i = x0i + x1i;
  450|  2.82M|        x1r = x0r - (x1r * 2);
  451|  2.82M|        x1i = x0i - (x1i * 2);
  452|  2.82M|        x2r = x2r + x3i;
  453|  2.82M|        x2i = x2i - x3r;
  454|  2.82M|        x3i = x2r - (x3i * 2);
  455|  2.82M|        x3r = x2i + (x3r * 2);
  456|       |
  457|  2.82M|        *data = x0r;
  458|  2.82M|        *(data + 1) = x0i;
  459|  2.82M|        data += ((SIZE_T)del << 1);
  460|       |
  461|  2.82M|        *data = x2r;
  462|  2.82M|        *(data + 1) = x2i;
  463|  2.82M|        data += ((SIZE_T)del << 1);
  464|       |
  465|  2.82M|        *data = x1r;
  466|  2.82M|        *(data + 1) = x1i;
  467|  2.82M|        data += ((SIZE_T)del << 1);
  468|       |
  469|  2.82M|        *data = x3i;
  470|  2.82M|        *(data + 1) = x3r;
  471|  2.82M|        data += ((SIZE_T)del << 1);
  472|  2.82M|      }
  473|   651k|      data = ptr_y + 2;
  474|       |
  475|   651k|      sec_loop_cnt = (nodespacing * del);
  476|   651k|      sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
  477|   651k|                     (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
  478|   651k|                     (sec_loop_cnt / 256);
  479|       |
  480|  4.19M|      for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (480:29): [True: 3.54M, False: 651k]
  ------------------
  481|  3.54M|        w_1 = *(ptr_twiddle + j);
  482|  3.54M|        w_4 = *(ptr_twiddle + j + 257);
  483|  3.54M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1));
  484|  3.54M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 257);
  485|  3.54M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1));
  486|  3.54M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) + 257);
  487|       |
  488|  10.3M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (488:31): [True: 6.77M, False: 3.54M]
  ------------------
  489|  6.77M|          FLOAT32 tmp;
  490|  6.77M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
  491|       |          /*x0 is loaded later to avoid register crunch*/
  492|       |
  493|  6.77M|          data += ((SIZE_T)del << 1);
  494|       |
  495|  6.77M|          x1r1 = *data;
  496|  6.77M|          x1i1 = *(data + 1);
  497|  6.77M|          data += ((SIZE_T)del << 1);
  498|       |
  499|  6.77M|          x2r1 = *data;
  500|  6.77M|          x2i1 = *(data + 1);
  501|  6.77M|          data += ((SIZE_T)del << 1);
  502|       |
  503|  6.77M|          x3r1 = *data;
  504|  6.77M|          x3i1 = *(data + 1);
  505|  6.77M|          data -= 3 * (del << 1);
  506|       |
  507|  6.77M|          tmp =
  508|  6.77M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x1r1, w_1) - ixheaace_dmult((FLOAT64)x1i1, w_4));
  509|  6.77M|          x1i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r1, w_4), (FLOAT64)x1i1, w_1);
  510|  6.77M|          x1r1 = tmp;
  511|       |
  512|  6.77M|          tmp =
  513|  6.77M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x2r1, w_2) - ixheaace_dmult((FLOAT64)x2i1, w_5));
  514|  6.77M|          x2i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x2r1, w_5), (FLOAT64)x2i1, w_2);
  515|  6.77M|          x2r1 = tmp;
  516|       |
  517|  6.77M|          tmp =
  518|  6.77M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x3r1, w_3) - ixheaace_dmult((FLOAT64)x3i1, w_6));
  519|  6.77M|          x3i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x3r1, w_6), (FLOAT64)x3i1, w_3);
  520|  6.77M|          x3r1 = tmp;
  521|       |
  522|  6.77M|          x0r1 = (*data);
  523|  6.77M|          x0i1 = (*(data + 1));
  524|       |
  525|  6.77M|          x0r1 = x0r1 + (x2r1);
  526|  6.77M|          x0i1 = x0i1 + (x2i1);
  527|  6.77M|          x2r1 = x0r1 - (x2r1 * 2);
  528|  6.77M|          x2i1 = x0i1 - (x2i1 * 2);
  529|  6.77M|          x1r1 = x1r1 + x3r1;
  530|  6.77M|          x1i1 = x1i1 + x3i1;
  531|  6.77M|          x3r1 = x1r1 - (x3r1 * 2);
  532|  6.77M|          x3i1 = x1i1 - (x3i1 * 2);
  533|       |
  534|  6.77M|          x0r1 = x0r1 + (x1r1);
  535|  6.77M|          x0i1 = x0i1 + (x1i1);
  536|  6.77M|          x1r1 = x0r1 - (x1r1 * 2);
  537|  6.77M|          x1i1 = x0i1 - (x1i1 * 2);
  538|  6.77M|          x2r1 = x2r1 + (x3i1);
  539|  6.77M|          x2i1 = x2i1 - (x3r1);
  540|  6.77M|          x3i1 = x2r1 - (x3i1 * 2);
  541|  6.77M|          x3r1 = x2i1 + (x3r1 * 2);
  542|       |
  543|  6.77M|          *data = x0r1;
  544|  6.77M|          *(data + 1) = x0i1;
  545|  6.77M|          data += ((SIZE_T)del << 1);
  546|       |
  547|  6.77M|          *data = x2r1;
  548|  6.77M|          *(data + 1) = x2i1;
  549|  6.77M|          data += ((SIZE_T)del << 1);
  550|       |
  551|  6.77M|          *data = x1r1;
  552|  6.77M|          *(data + 1) = x1i1;
  553|  6.77M|          data += ((SIZE_T)del << 1);
  554|       |
  555|  6.77M|          *data = x3i1;
  556|  6.77M|          *(data + 1) = x3r1;
  557|  6.77M|          data += ((SIZE_T)del << 1);
  558|  6.77M|        }
  559|  3.54M|        data -= 2 * npoints;
  560|  3.54M|        data += 2;
  561|  3.54M|      }
  562|  2.75M|      for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (562:14): [True: 2.09M, False: 651k]
  ------------------
  563|  2.09M|        w_1 = *(ptr_twiddle + j);
  564|  2.09M|        w_4 = *(ptr_twiddle + j + 257);
  565|  2.09M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1));
  566|  2.09M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 257);
  567|  2.09M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 256);
  568|  2.09M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) + 1);
  569|       |
  570|  6.89M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (570:31): [True: 4.80M, False: 2.09M]
  ------------------
  571|  4.80M|          FLOAT32 tmp;
  572|  4.80M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
  573|       |          /*x0 is loaded later to avoid register crunch*/
  574|       |
  575|  4.80M|          data += ((SIZE_T)del << 1);
  576|       |
  577|  4.80M|          x1r1 = *data;
  578|  4.80M|          x1i1 = *(data + 1);
  579|  4.80M|          data += ((SIZE_T)del << 1);
  580|       |
  581|  4.80M|          x2r1 = *data;
  582|  4.80M|          x2i1 = *(data + 1);
  583|  4.80M|          data += ((SIZE_T)del << 1);
  584|       |
  585|  4.80M|          x3r1 = *data;
  586|  4.80M|          x3i1 = *(data + 1);
  587|  4.80M|          data -= 3 * (del << 1);
  588|       |
  589|  4.80M|          tmp =
  590|  4.80M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x1r1, w_1) - ixheaace_dmult((FLOAT64)x1i1, w_4));
  591|  4.80M|          x1i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r1, w_4), (FLOAT64)x1i1, w_1);
  592|  4.80M|          x1r1 = tmp;
  593|       |
  594|  4.80M|          tmp =
  595|  4.80M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x2r1, w_2) - ixheaace_dmult((FLOAT64)x2i1, w_5));
  596|  4.80M|          x2i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x2r1, w_5), (FLOAT64)x2i1, w_2);
  597|  4.80M|          x2r1 = tmp;
  598|       |
  599|  4.80M|          tmp =
  600|  4.80M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x3r1, w_6) + ixheaace_dmult((FLOAT64)x3i1, w_3));
  601|  4.80M|          x3i1 =
  602|  4.80M|              (FLOAT32)(-ixheaace_dmult((FLOAT64)x3r1, w_3) + ixheaace_dmult((FLOAT64)x3i1, w_6));
  603|  4.80M|          x3r1 = tmp;
  604|       |
  605|  4.80M|          x0r1 = (*data);
  606|  4.80M|          x0i1 = (*(data + 1));
  607|       |
  608|  4.80M|          x0r1 = x0r1 + (x2r1);
  609|  4.80M|          x0i1 = x0i1 + (x2i1);
  610|  4.80M|          x2r1 = x0r1 - (x2r1 * 2);
  611|  4.80M|          x2i1 = x0i1 - (x2i1 * 2);
  612|  4.80M|          x1r1 = x1r1 + x3r1;
  613|  4.80M|          x1i1 = x1i1 + x3i1;
  614|  4.80M|          x3r1 = x1r1 - (x3r1 * 2);
  615|  4.80M|          x3i1 = x1i1 - (x3i1 * 2);
  616|       |
  617|  4.80M|          x0r1 = x0r1 + (x1r1);
  618|  4.80M|          x0i1 = x0i1 + (x1i1);
  619|  4.80M|          x1r1 = x0r1 - (x1r1 * 2);
  620|  4.80M|          x1i1 = x0i1 - (x1i1 * 2);
  621|  4.80M|          x2r1 = x2r1 + (x3i1);
  622|  4.80M|          x2i1 = x2i1 - (x3r1);
  623|  4.80M|          x3i1 = x2r1 - (x3i1 * 2);
  624|  4.80M|          x3r1 = x2i1 + (x3r1 * 2);
  625|       |
  626|  4.80M|          *data = x0r1;
  627|  4.80M|          *(data + 1) = x0i1;
  628|  4.80M|          data += ((SIZE_T)del << 1);
  629|       |
  630|  4.80M|          *data = x2r1;
  631|  4.80M|          *(data + 1) = x2i1;
  632|  4.80M|          data += ((SIZE_T)del << 1);
  633|       |
  634|  4.80M|          *data = x1r1;
  635|  4.80M|          *(data + 1) = x1i1;
  636|  4.80M|          data += ((SIZE_T)del << 1);
  637|       |
  638|  4.80M|          *data = x3i1;
  639|  4.80M|          *(data + 1) = x3r1;
  640|  4.80M|          data += ((SIZE_T)del << 1);
  641|  4.80M|        }
  642|  2.09M|        data -= 2 * npoints;
  643|  2.09M|        data += 2;
  644|  2.09M|      }
  645|  2.09M|      for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (645:14): [True: 1.44M, False: 651k]
  ------------------
  646|  1.44M|        w_1 = *(ptr_twiddle + j);
  647|  1.44M|        w_4 = *(ptr_twiddle + j + 257);
  648|  1.44M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1) - 256);
  649|  1.44M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 1);
  650|  1.44M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 256);
  651|  1.44M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) + 1);
  652|       |
  653|  3.42M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (653:31): [True: 1.97M, False: 1.44M]
  ------------------
  654|  1.97M|          FLOAT32 tmp;
  655|  1.97M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
  656|       |          /*x0 is loaded later to avoid register crunch*/
  657|       |
  658|  1.97M|          data += ((SIZE_T)del << 1);
  659|       |
  660|  1.97M|          x1r1 = *data;
  661|  1.97M|          x1i1 = *(data + 1);
  662|  1.97M|          data += ((SIZE_T)del << 1);
  663|       |
  664|  1.97M|          x2r1 = *data;
  665|  1.97M|          x2i1 = *(data + 1);
  666|  1.97M|          data += ((SIZE_T)del << 1);
  667|       |
  668|  1.97M|          x3r1 = *data;
  669|  1.97M|          x3i1 = *(data + 1);
  670|  1.97M|          data -= 3 * (del << 1);
  671|       |
  672|  1.97M|          tmp =
  673|  1.97M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x1r1, w_1) - ixheaace_dmult((FLOAT64)x1i1, w_4));
  674|  1.97M|          x1i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult(x1r1, w_4), x1i1, w_1);
  675|  1.97M|          x1r1 = tmp;
  676|       |
  677|  1.97M|          tmp =
  678|  1.97M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x2r1, w_5) + ixheaace_dmult((FLOAT64)x2i1, w_2));
  679|  1.97M|          x2i1 = (FLOAT32)(-ixheaace_dmult(x2r1, w_2) + ixheaace_dmult(x2i1, w_5));
  680|  1.97M|          x2r1 = tmp;
  681|       |
  682|  1.97M|          tmp =
  683|  1.97M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x3r1, w_6) + ixheaace_dmult((FLOAT64)x3i1, w_3));
  684|  1.97M|          x3i1 =
  685|  1.97M|              (FLOAT32)(-ixheaace_dmult((FLOAT64)x3r1, w_3) + ixheaace_dmult((FLOAT64)x3i1, w_6));
  686|  1.97M|          x3r1 = tmp;
  687|       |
  688|  1.97M|          x0r1 = (*data);
  689|  1.97M|          x0i1 = (*(data + 1));
  690|       |
  691|  1.97M|          x0r1 = x0r1 + (x2r1);
  692|  1.97M|          x0i1 = x0i1 + (x2i1);
  693|  1.97M|          x2r1 = x0r1 - (x2r1 * 2);
  694|  1.97M|          x2i1 = x0i1 - (x2i1 * 2);
  695|  1.97M|          x1r1 = x1r1 + x3r1;
  696|  1.97M|          x1i1 = x1i1 + x3i1;
  697|  1.97M|          x3r1 = x1r1 - (x3r1 * 2);
  698|  1.97M|          x3i1 = x1i1 - (x3i1 * 2);
  699|       |
  700|  1.97M|          x0r1 = x0r1 + (x1r1);
  701|  1.97M|          x0i1 = x0i1 + (x1i1);
  702|  1.97M|          x1r1 = x0r1 - (x1r1 * 2);
  703|  1.97M|          x1i1 = x0i1 - (x1i1 * 2);
  704|  1.97M|          x2r1 = x2r1 + (x3i1);
  705|  1.97M|          x2i1 = x2i1 - (x3r1);
  706|  1.97M|          x3i1 = x2r1 - (x3i1 * 2);
  707|  1.97M|          x3r1 = x2i1 + (x3r1 * 2);
  708|       |
  709|  1.97M|          *data = x0r1;
  710|  1.97M|          *(data + 1) = x0i1;
  711|  1.97M|          data += ((SIZE_T)del << 1);
  712|       |
  713|  1.97M|          *data = x2r1;
  714|  1.97M|          *(data + 1) = x2i1;
  715|  1.97M|          data += ((SIZE_T)del << 1);
  716|       |
  717|  1.97M|          *data = x1r1;
  718|  1.97M|          *(data + 1) = x1i1;
  719|  1.97M|          data += ((SIZE_T)del << 1);
  720|       |
  721|  1.97M|          *data = x3i1;
  722|  1.97M|          *(data + 1) = x3r1;
  723|  1.97M|          data += ((SIZE_T)del << 1);
  724|  1.97M|        }
  725|  1.44M|        data -= 2 * npoints;
  726|  1.44M|        data += 2;
  727|  1.44M|      }
  728|  4.19M|      for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (728:14): [True: 3.54M, False: 651k]
  ------------------
  729|  3.54M|        w_1 = *(ptr_twiddle + j);
  730|  3.54M|        w_4 = *(ptr_twiddle + j + 257);
  731|  3.54M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1) - 256);
  732|  3.54M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 1);
  733|  3.54M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 512);
  734|  3.54M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 512 + 257);
  735|       |
  736|  10.3M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (736:31): [True: 6.77M, False: 3.54M]
  ------------------
  737|  6.77M|          FLOAT32 tmp;
  738|  6.77M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
  739|       |          /*x0 is loaded later to avoid register crunch*/
  740|       |
  741|  6.77M|          data += ((SIZE_T)del << 1);
  742|       |
  743|  6.77M|          x1r1 = *data;
  744|  6.77M|          x1i1 = *(data + 1);
  745|  6.77M|          data += ((SIZE_T)del << 1);
  746|       |
  747|  6.77M|          x2r1 = *data;
  748|  6.77M|          x2i1 = *(data + 1);
  749|  6.77M|          data += ((SIZE_T)del << 1);
  750|       |
  751|  6.77M|          x3r1 = *data;
  752|  6.77M|          x3i1 = *(data + 1);
  753|  6.77M|          data -= 3 * (del << 1);
  754|       |
  755|  6.77M|          tmp =
  756|  6.77M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x1r1, w_1) - ixheaace_dmult((FLOAT64)x1i1, w_4));
  757|  6.77M|          x1i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r1, w_4), (FLOAT64)x1i1, w_1);
  758|  6.77M|          x1r1 = tmp;
  759|       |
  760|  6.77M|          tmp =
  761|  6.77M|              (FLOAT32)(ixheaace_dmult((FLOAT64)x2r1, w_5) + ixheaace_dmult((FLOAT64)x2i1, w_2));
  762|  6.77M|          x2i1 =
  763|  6.77M|              (FLOAT32)(-ixheaace_dmult((FLOAT64)x2r1, w_2) + ixheaace_dmult((FLOAT64)x2i1, w_5));
  764|  6.77M|          x2r1 = tmp;
  765|       |
  766|  6.77M|          tmp =
  767|  6.77M|              (FLOAT32)(-ixheaace_dmult((FLOAT64)x3r1, w_3) + ixheaace_dmult((FLOAT64)x3i1, w_6));
  768|  6.77M|          x3i1 = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x3r1, w_6), (FLOAT64)x3i1, w_3);
  769|  6.77M|          x3r1 = tmp;
  770|       |
  771|  6.77M|          x0r1 = (*data);
  772|  6.77M|          x0i1 = (*(data + 1));
  773|       |
  774|  6.77M|          x0r1 = x0r1 + (x2r1);
  775|  6.77M|          x0i1 = x0i1 + (x2i1);
  776|  6.77M|          x2r1 = x0r1 - (x2r1 * 2);
  777|  6.77M|          x2i1 = x0i1 - (x2i1 * 2);
  778|  6.77M|          x1r1 = x1r1 + x3r1;
  779|  6.77M|          x1i1 = x1i1 - x3i1;
  780|  6.77M|          x3r1 = x1r1 - (x3r1 * 2);
  781|  6.77M|          x3i1 = x1i1 + (x3i1 * 2);
  782|       |
  783|  6.77M|          x0r1 = x0r1 + (x1r1);
  784|  6.77M|          x0i1 = x0i1 + (x1i1);
  785|  6.77M|          x1r1 = x0r1 - (x1r1 * 2);
  786|  6.77M|          x1i1 = x0i1 - (x1i1 * 2);
  787|  6.77M|          x2r1 = x2r1 + (x3i1);
  788|  6.77M|          x2i1 = x2i1 - (x3r1);
  789|  6.77M|          x3i1 = x2r1 - (x3i1 * 2);
  790|  6.77M|          x3r1 = x2i1 + (x3r1 * 2);
  791|       |
  792|  6.77M|          *data = x0r1;
  793|  6.77M|          *(data + 1) = x0i1;
  794|  6.77M|          data += ((SIZE_T)del << 1);
  795|       |
  796|  6.77M|          *data = x2r1;
  797|  6.77M|          *(data + 1) = x2i1;
  798|  6.77M|          data += ((SIZE_T)del << 1);
  799|       |
  800|  6.77M|          *data = x1r1;
  801|  6.77M|          *(data + 1) = x1i1;
  802|  6.77M|          data += ((SIZE_T)del << 1);
  803|       |
  804|  6.77M|          *data = x3i1;
  805|  6.77M|          *(data + 1) = x3r1;
  806|  6.77M|          data += ((SIZE_T)del << 1);
  807|  6.77M|        }
  808|  3.54M|        data -= 2 * npoints;
  809|  3.54M|        data += 2;
  810|  3.54M|      }
  811|   651k|      nodespacing >>= 2;
  812|   651k|      del <<= 2;
  813|   651k|      in_loop_cnt >>= 2;
  814|   651k|    }
  815|   281k|    if (not_power_4) {
  ------------------
  |  Branch (815:9): [True: 0, False: 281k]
  ------------------
  816|      0|      const double *ptr_twiddle = ptr_w;
  817|      0|      nodespacing <<= 1;
  818|       |
  819|      0|      for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (819:25): [True: 0, False: 0]
  ------------------
  820|      0|        FLOAT64 w_1 = *ptr_twiddle;
  821|      0|        FLOAT64 w_4 = *(ptr_twiddle + 257);
  822|      0|        FLOAT32 tmp;
  823|      0|        ptr_twiddle += nodespacing;
  824|       |
  825|      0|        x0r = *ptr_y;
  826|      0|        x0i = *(ptr_y + 1);
  827|      0|        ptr_y += ((SIZE_T)del << 1);
  828|       |
  829|      0|        x1r = *ptr_y;
  830|      0|        x1i = *(ptr_y + 1);
  831|       |
  832|      0|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_1) - ixheaace_dmult((FLOAT64)x1i, w_4));
  833|      0|        x1i = (FLOAT32)ixheaace_dmac(ixheaace_dmult((FLOAT64)x1r, w_4), (FLOAT64)x1i, w_1);
  834|      0|        x1r = tmp;
  835|       |
  836|      0|        *ptr_y = (x0r) - (x1r);
  837|      0|        *(ptr_y + 1) = (x0i) - (x1i);
  838|      0|        ptr_y -= ((SIZE_T)del << 1);
  839|       |
  840|      0|        *ptr_y = (x0r) + (x1r);
  841|      0|        *(ptr_y + 1) = (x0i) + (x1i);
  842|      0|        ptr_y += 2;
  843|      0|      }
  844|      0|      ptr_twiddle = ptr_w;
  845|      0|      for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (845:25): [True: 0, False: 0]
  ------------------
  846|      0|        FLOAT64 w_1 = *ptr_twiddle;
  847|      0|        FLOAT64 w_4 = *(ptr_twiddle + 257);
  848|      0|        FLOAT32 tmp;
  849|      0|        ptr_twiddle += nodespacing;
  850|       |
  851|      0|        x0r = *ptr_y;
  852|      0|        x0i = *(ptr_y + 1);
  853|      0|        ptr_y += ((SIZE_T)del << 1);
  854|       |
  855|      0|        x1r = *ptr_y;
  856|      0|        x1i = *(ptr_y + 1);
  857|       |
  858|      0|        tmp = (FLOAT32)(ixheaace_dmult((FLOAT64)x1r, w_4) + ixheaace_dmult((FLOAT64)x1i, w_1));
  859|      0|        x1i = (FLOAT32)(-ixheaace_dmult((FLOAT64)x1r, w_1) + ixheaace_dmult((FLOAT64)x1i, w_4));
  860|      0|        x1r = tmp;
  861|       |
  862|      0|        *ptr_y = (x0r) - (x1r);
  863|      0|        *(ptr_y + 1) = (x0i) - (x1i);
  864|      0|        ptr_y -= ((SIZE_T)del << 1);
  865|       |
  866|      0|        *ptr_y = (x0r) + (x1r);
  867|      0|        *(ptr_y + 1) = (x0i) + (x1i);
  868|      0|        ptr_y += 2;
  869|      0|      }
  870|      0|    }
  871|   281k|  }
  872|       |
  873|       |  /**********************IFFT******************************************/
  874|       |
  875|   693k|  else {
  876|  10.2M|    for (i = 0; i < npoints; i += 4) {
  ------------------
  |  Branch (876:17): [True: 9.56M, False: 693k]
  ------------------
  877|  9.56M|      FLOAT32 *ptr_inp = ptr_x;
  878|       |
  879|  9.56M|      DIG_REV(i, dig_rev_shift, h2);
  ------------------
  |  |   33|  9.56M|  do {                                                      \
  |  |   34|  9.56M|    unsigned _ = (i);                                       \
  |  |   35|  9.56M|    _ = ((_ & 0x33333333) << 2) | ((_ & ~0x33333333) >> 2); \
  |  |   36|  9.56M|    _ = ((_ & 0x0F0F0F0F) << 4) | ((_ & ~0x0F0F0F0F) >> 4); \
  |  |   37|  9.56M|    _ = ((_ & 0x00FF00FF) << 8) | ((_ & ~0x00FF00FF) >> 8); \
  |  |   38|  9.56M|    (j) = _ >> (m);                                         \
  |  |   39|  9.56M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (39:12): [Folded, False: 9.56M]
  |  |  ------------------
  ------------------
  880|  9.56M|      if (not_power_4) {
  ------------------
  |  Branch (880:11): [True: 4.97M, False: 4.58M]
  ------------------
  881|  4.97M|        h2 += 1;
  882|  4.97M|        h2 &= ~1;
  883|  4.97M|      }
  884|  9.56M|      ptr_inp += (h2);
  885|       |
  886|  9.56M|      x0r = *ptr_inp;
  887|  9.56M|      x0i = *(ptr_inp + 1);
  888|  9.56M|      ptr_inp += (npoints >> 1);
  889|       |
  890|  9.56M|      x1r = *ptr_inp;
  891|  9.56M|      x1i = *(ptr_inp + 1);
  892|  9.56M|      ptr_inp += (npoints >> 1);
  893|       |
  894|  9.56M|      x2r = *ptr_inp;
  895|  9.56M|      x2i = *(ptr_inp + 1);
  896|  9.56M|      ptr_inp += (npoints >> 1);
  897|       |
  898|  9.56M|      x3r = *ptr_inp;
  899|  9.56M|      x3i = *(ptr_inp + 1);
  900|       |
  901|  9.56M|      x0r = x0r + x2r;
  902|  9.56M|      x0i = x0i + x2i;
  903|  9.56M|      x2r = x0r - (x2r * 2);
  904|  9.56M|      x2i = x0i - (x2i * 2);
  905|  9.56M|      x1r = x1r + x3r;
  906|  9.56M|      x1i = x1i + x3i;
  907|  9.56M|      x3r = x1r - (x3r * 2);
  908|  9.56M|      x3i = x1i - (x3i * 2);
  909|       |
  910|  9.56M|      x0r = x0r + x1r;
  911|  9.56M|      x0i = x0i + x1i;
  912|  9.56M|      x1r = x0r - (x1r * 2);
  913|  9.56M|      x1i = x0i - (x1i * 2);
  914|  9.56M|      x2r = x2r - x3i;
  915|  9.56M|      x2i = x2i + x3r;
  916|  9.56M|      x3i = x2r + (x3i * 2);
  917|  9.56M|      x3r = x2i - (x3r * 2);
  918|       |
  919|  9.56M|      *ptr_y++ = x0r;
  920|  9.56M|      *ptr_y++ = x0i;
  921|  9.56M|      *ptr_y++ = x2r;
  922|  9.56M|      *ptr_y++ = x2i;
  923|  9.56M|      *ptr_y++ = x1r;
  924|  9.56M|      *ptr_y++ = x1i;
  925|  9.56M|      *ptr_y++ = x3i;
  926|  9.56M|      *ptr_y++ = x3r;
  927|  9.56M|    }
  928|   693k|    ptr_y -= 2 * npoints;
  929|   693k|    del = 4;
  930|   693k|    nodespacing = 64;
  931|   693k|    in_loop_cnt = npoints >> 4;
  932|  1.52M|    for (i = n_stages - 1; i > 0; i--) {
  ------------------
  |  Branch (932:28): [True: 836k, False: 693k]
  ------------------
  933|   836k|      const double *ptr_twiddle = ptr_w;
  934|   836k|      float *data = ptr_y;
  935|   836k|      double w_1, w_2, w_3, w_4, w_5, w_6;
  936|   836k|      int sec_loop_cnt;
  937|       |
  938|  3.58M|      for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (938:29): [True: 2.74M, False: 836k]
  ------------------
  939|  2.74M|        x0r = (*data);
  940|  2.74M|        x0i = (*(data + 1));
  941|  2.74M|        data += ((SIZE_T)del << 1);
  942|       |
  943|  2.74M|        x1r = (*data);
  944|  2.74M|        x1i = (*(data + 1));
  945|  2.74M|        data += ((SIZE_T)del << 1);
  946|       |
  947|  2.74M|        x2r = (*data);
  948|  2.74M|        x2i = (*(data + 1));
  949|  2.74M|        data += ((SIZE_T)del << 1);
  950|       |
  951|  2.74M|        x3r = (*data);
  952|  2.74M|        x3i = (*(data + 1));
  953|  2.74M|        data -= 3 * (del << 1);
  954|       |
  955|  2.74M|        x0r = x0r + x2r;
  956|  2.74M|        x0i = x0i + x2i;
  957|  2.74M|        x2r = x0r - (x2r * 2);
  958|  2.74M|        x2i = x0i - (x2i * 2);
  959|  2.74M|        x1r = x1r + x3r;
  960|  2.74M|        x1i = x1i + x3i;
  961|  2.74M|        x3r = x1r - (x3r * 2);
  962|  2.74M|        x3i = x1i - (x3i * 2);
  963|       |
  964|  2.74M|        x0r = x0r + x1r;
  965|  2.74M|        x0i = x0i + x1i;
  966|  2.74M|        x1r = x0r - (x1r * 2);
  967|  2.74M|        x1i = x0i - (x1i * 2);
  968|  2.74M|        x2r = x2r - x3i;
  969|  2.74M|        x2i = x2i + x3r;
  970|  2.74M|        x3i = x2r + (x3i * 2);
  971|  2.74M|        x3r = x2i - (x3r * 2);
  972|       |
  973|  2.74M|        *data = x0r;
  974|  2.74M|        *(data + 1) = x0i;
  975|  2.74M|        data += ((SIZE_T)del << 1);
  976|       |
  977|  2.74M|        *data = x2r;
  978|  2.74M|        *(data + 1) = x2i;
  979|  2.74M|        data += ((SIZE_T)del << 1);
  980|       |
  981|  2.74M|        *data = x1r;
  982|  2.74M|        *(data + 1) = x1i;
  983|  2.74M|        data += ((SIZE_T)del << 1);
  984|       |
  985|  2.74M|        *data = x3i;
  986|  2.74M|        *(data + 1) = x3r;
  987|  2.74M|        data += ((SIZE_T)del << 1);
  988|  2.74M|      }
  989|   836k|      data = ptr_y + 2;
  990|       |
  991|   836k|      sec_loop_cnt = (nodespacing * del);
  992|   836k|      sec_loop_cnt = (sec_loop_cnt / 4) + (sec_loop_cnt / 8) - (sec_loop_cnt / 16) +
  993|   836k|                     (sec_loop_cnt / 32) - (sec_loop_cnt / 64) + (sec_loop_cnt / 128) -
  994|   836k|                     (sec_loop_cnt / 256);
  995|       |
  996|  3.39M|      for (j = nodespacing; j <= sec_loop_cnt; j += nodespacing) {
  ------------------
  |  Branch (996:29): [True: 2.55M, False: 836k]
  ------------------
  997|  2.55M|        w_1 = *(ptr_twiddle + j);
  998|  2.55M|        w_4 = *(ptr_twiddle + j + 257);
  999|  2.55M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1));
 1000|  2.55M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 257);
 1001|  2.55M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1));
 1002|  2.55M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) + 257);
 1003|       |
 1004|  7.88M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1004:31): [True: 5.32M, False: 2.55M]
  ------------------
 1005|  5.32M|          FLOAT32 tmp;
 1006|  5.32M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
 1007|       |          /*x0 is loaded later to avoid register crunch*/
 1008|       |
 1009|  5.32M|          data += ((SIZE_T)del << 1);
 1010|       |
 1011|  5.32M|          x1r1 = *data;
 1012|  5.32M|          x1i1 = *(data + 1);
 1013|  5.32M|          data += ((SIZE_T)del << 1);
 1014|       |
 1015|  5.32M|          x2r1 = *data;
 1016|  5.32M|          x2i1 = *(data + 1);
 1017|  5.32M|          data += ((SIZE_T)del << 1);
 1018|       |
 1019|  5.32M|          x3r1 = *data;
 1020|  5.32M|          x3i1 = *(data + 1);
 1021|  5.32M|          data -= 3 * (del << 1);
 1022|       |
 1023|  5.32M|          tmp = (FLOAT32)(((FLOAT64)x1r1 * w_1) + ((FLOAT64)x1i1 * w_4));
 1024|  5.32M|          x1i1 = (FLOAT32)(-((FLOAT64)x1r1 * w_4) + (FLOAT64)x1i1 * w_1);
 1025|  5.32M|          x1r1 = tmp;
 1026|       |
 1027|  5.32M|          tmp = (FLOAT32)(((FLOAT64)x2r1 * w_2) + ((FLOAT64)x2i1 * w_5));
 1028|  5.32M|          x2i1 = (FLOAT32)(-((FLOAT64)x2r1 * w_5) + (FLOAT64)x2i1 * w_2);
 1029|  5.32M|          x2r1 = tmp;
 1030|       |
 1031|  5.32M|          tmp = (FLOAT32)(((FLOAT64)x3r1 * w_3) + ((FLOAT64)x3i1 * w_6));
 1032|  5.32M|          x3i1 = (FLOAT32)(-((FLOAT64)x3r1 * w_6) + (FLOAT64)x3i1 * w_3);
 1033|  5.32M|          x3r1 = tmp;
 1034|       |
 1035|  5.32M|          x0r1 = (*data);
 1036|  5.32M|          x0i1 = (*(data + 1));
 1037|       |
 1038|  5.32M|          x0r1 = x0r1 + (x2r1);
 1039|  5.32M|          x0i1 = x0i1 + (x2i1);
 1040|  5.32M|          x2r1 = x0r1 - (x2r1 * 2);
 1041|  5.32M|          x2i1 = x0i1 - (x2i1 * 2);
 1042|  5.32M|          x1r1 = x1r1 + x3r1;
 1043|  5.32M|          x1i1 = x1i1 + x3i1;
 1044|  5.32M|          x3r1 = x1r1 - (x3r1 * 2);
 1045|  5.32M|          x3i1 = x1i1 - (x3i1 * 2);
 1046|       |
 1047|  5.32M|          x0r1 = x0r1 + (x1r1);
 1048|  5.32M|          x0i1 = x0i1 + (x1i1);
 1049|  5.32M|          x1r1 = x0r1 - (x1r1 * 2);
 1050|  5.32M|          x1i1 = x0i1 - (x1i1 * 2);
 1051|  5.32M|          x2r1 = x2r1 - (x3i1);
 1052|  5.32M|          x2i1 = x2i1 + (x3r1);
 1053|  5.32M|          x3i1 = x2r1 + (x3i1 * 2);
 1054|  5.32M|          x3r1 = x2i1 - (x3r1 * 2);
 1055|       |
 1056|  5.32M|          *data = x0r1;
 1057|  5.32M|          *(data + 1) = x0i1;
 1058|  5.32M|          data += ((SIZE_T)del << 1);
 1059|       |
 1060|  5.32M|          *data = x2r1;
 1061|  5.32M|          *(data + 1) = x2i1;
 1062|  5.32M|          data += ((SIZE_T)del << 1);
 1063|       |
 1064|  5.32M|          *data = x1r1;
 1065|  5.32M|          *(data + 1) = x1i1;
 1066|  5.32M|          data += ((SIZE_T)del << 1);
 1067|       |
 1068|  5.32M|          *data = x3i1;
 1069|  5.32M|          *(data + 1) = x3r1;
 1070|  5.32M|          data += ((SIZE_T)del << 1);
 1071|  5.32M|        }
 1072|  2.55M|        data -= 2 * npoints;
 1073|  2.55M|        data += 2;
 1074|  2.55M|      }
 1075|  2.53M|      for (; j <= (nodespacing * del) >> 1; j += nodespacing) {
  ------------------
  |  Branch (1075:14): [True: 1.69M, False: 836k]
  ------------------
 1076|  1.69M|        w_1 = *(ptr_twiddle + j);
 1077|  1.69M|        w_4 = *(ptr_twiddle + j + 257);
 1078|  1.69M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1));
 1079|  1.69M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 257);
 1080|  1.69M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 256);
 1081|  1.69M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) + 1);
 1082|       |
 1083|  5.73M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1083:31): [True: 4.03M, False: 1.69M]
  ------------------
 1084|  4.03M|          FLOAT32 tmp;
 1085|  4.03M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
 1086|       |          /*x0 is loaded later to avoid register crunch*/
 1087|       |
 1088|  4.03M|          data += ((SIZE_T)del << 1);
 1089|       |
 1090|  4.03M|          x1r1 = *data;
 1091|  4.03M|          x1i1 = *(data + 1);
 1092|  4.03M|          data += ((SIZE_T)del << 1);
 1093|       |
 1094|  4.03M|          x2r1 = *data;
 1095|  4.03M|          x2i1 = *(data + 1);
 1096|  4.03M|          data += ((SIZE_T)del << 1);
 1097|       |
 1098|  4.03M|          x3r1 = *data;
 1099|  4.03M|          x3i1 = *(data + 1);
 1100|  4.03M|          data -= 3 * (del << 1);
 1101|       |
 1102|  4.03M|          tmp = (FLOAT32)(((FLOAT64)x1r1 * w_1) + ((FLOAT64)x1i1 * w_4));
 1103|  4.03M|          x1i1 = (FLOAT32)(-((FLOAT64)x1r1 * w_4) + (FLOAT64)x1i1 * w_1);
 1104|  4.03M|          x1r1 = tmp;
 1105|       |
 1106|  4.03M|          tmp = (FLOAT32)(((FLOAT64)x2r1 * w_2) + ((FLOAT64)x2i1 * w_5));
 1107|  4.03M|          x2i1 = (FLOAT32)(-((FLOAT64)x2r1 * w_5) + (FLOAT64)x2i1 * w_2);
 1108|  4.03M|          x2r1 = tmp;
 1109|       |
 1110|  4.03M|          tmp = (FLOAT32)(((FLOAT64)x3r1 * w_6) - ((FLOAT64)x3i1 * w_3));
 1111|  4.03M|          x3i1 = (FLOAT32)(((FLOAT64)x3r1 * w_3) + ((FLOAT64)x3i1 * w_6));
 1112|  4.03M|          x3r1 = tmp;
 1113|       |
 1114|  4.03M|          x0r1 = (*data);
 1115|  4.03M|          x0i1 = (*(data + 1));
 1116|       |
 1117|  4.03M|          x0r1 = x0r1 + (x2r1);
 1118|  4.03M|          x0i1 = x0i1 + (x2i1);
 1119|  4.03M|          x2r1 = x0r1 - (x2r1 * 2);
 1120|  4.03M|          x2i1 = x0i1 - (x2i1 * 2);
 1121|  4.03M|          x1r1 = x1r1 + x3r1;
 1122|  4.03M|          x1i1 = x1i1 + x3i1;
 1123|  4.03M|          x3r1 = x1r1 - (x3r1 * 2);
 1124|  4.03M|          x3i1 = x1i1 - (x3i1 * 2);
 1125|       |
 1126|  4.03M|          x0r1 = x0r1 + (x1r1);
 1127|  4.03M|          x0i1 = x0i1 + (x1i1);
 1128|  4.03M|          x1r1 = x0r1 - (x1r1 * 2);
 1129|  4.03M|          x1i1 = x0i1 - (x1i1 * 2);
 1130|  4.03M|          x2r1 = x2r1 - (x3i1);
 1131|  4.03M|          x2i1 = x2i1 + (x3r1);
 1132|  4.03M|          x3i1 = x2r1 + (x3i1 * 2);
 1133|  4.03M|          x3r1 = x2i1 - (x3r1 * 2);
 1134|       |
 1135|  4.03M|          *data = x0r1;
 1136|  4.03M|          *(data + 1) = x0i1;
 1137|  4.03M|          data += ((SIZE_T)del << 1);
 1138|       |
 1139|  4.03M|          *data = x2r1;
 1140|  4.03M|          *(data + 1) = x2i1;
 1141|  4.03M|          data += ((SIZE_T)del << 1);
 1142|       |
 1143|  4.03M|          *data = x1r1;
 1144|  4.03M|          *(data + 1) = x1i1;
 1145|  4.03M|          data += ((SIZE_T)del << 1);
 1146|       |
 1147|  4.03M|          *data = x3i1;
 1148|  4.03M|          *(data + 1) = x3r1;
 1149|  4.03M|          data += ((SIZE_T)del << 1);
 1150|  4.03M|        }
 1151|  1.69M|        data -= 2 * npoints;
 1152|  1.69M|        data += 2;
 1153|  1.69M|      }
 1154|  1.69M|      for (; j <= sec_loop_cnt * 2; j += nodespacing) {
  ------------------
  |  Branch (1154:14): [True: 860k, False: 836k]
  ------------------
 1155|   860k|        w_1 = *(ptr_twiddle + j);
 1156|   860k|        w_4 = *(ptr_twiddle + j + 257);
 1157|   860k|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1) - 256);
 1158|   860k|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 1);
 1159|   860k|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 256);
 1160|   860k|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) + 1);
 1161|       |
 1162|  2.15M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1162:31): [True: 1.29M, False: 860k]
  ------------------
 1163|  1.29M|          FLOAT32 tmp;
 1164|  1.29M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
 1165|       |          /*x0 is loaded later to avoid register crunch*/
 1166|       |
 1167|  1.29M|          data += ((SIZE_T)del << 1);
 1168|       |
 1169|  1.29M|          x1r1 = *data;
 1170|  1.29M|          x1i1 = *(data + 1);
 1171|  1.29M|          data += ((SIZE_T)del << 1);
 1172|       |
 1173|  1.29M|          x2r1 = *data;
 1174|  1.29M|          x2i1 = *(data + 1);
 1175|  1.29M|          data += ((SIZE_T)del << 1);
 1176|       |
 1177|  1.29M|          x3r1 = *data;
 1178|  1.29M|          x3i1 = *(data + 1);
 1179|  1.29M|          data -= 3 * (del << 1);
 1180|       |
 1181|  1.29M|          tmp = (FLOAT32)(((FLOAT64)x1r1 * w_1) + ((FLOAT64)x1i1 * w_4));
 1182|  1.29M|          x1i1 = (FLOAT32)(-((FLOAT64)x1r1 * w_4) + (FLOAT64)x1i1 * w_1);
 1183|  1.29M|          x1r1 = tmp;
 1184|       |
 1185|  1.29M|          tmp = (FLOAT32)(((FLOAT64)x2r1 * w_5) - ((FLOAT64)x2i1 * w_2));
 1186|  1.29M|          x2i1 = (FLOAT32)(((FLOAT64)x2r1 * w_2) + ((FLOAT64)x2i1 * w_5));
 1187|  1.29M|          x2r1 = tmp;
 1188|       |
 1189|  1.29M|          tmp = (FLOAT32)(((FLOAT64)x3r1 * w_6) - ((FLOAT64)x3i1 * w_3));
 1190|  1.29M|          x3i1 = (FLOAT32)(((FLOAT64)x3r1 * w_3) + ((FLOAT64)x3i1 * w_6));
 1191|  1.29M|          x3r1 = tmp;
 1192|       |
 1193|  1.29M|          x0r1 = (*data);
 1194|  1.29M|          x0i1 = (*(data + 1));
 1195|       |
 1196|  1.29M|          x0r1 = x0r1 + (x2r1);
 1197|  1.29M|          x0i1 = x0i1 + (x2i1);
 1198|  1.29M|          x2r1 = x0r1 - (x2r1 * 2);
 1199|  1.29M|          x2i1 = x0i1 - (x2i1 * 2);
 1200|  1.29M|          x1r1 = x1r1 + x3r1;
 1201|  1.29M|          x1i1 = x1i1 + x3i1;
 1202|  1.29M|          x3r1 = x1r1 - (x3r1 * 2);
 1203|  1.29M|          x3i1 = x1i1 - (x3i1 * 2);
 1204|       |
 1205|  1.29M|          x0r1 = x0r1 + (x1r1);
 1206|  1.29M|          x0i1 = x0i1 + (x1i1);
 1207|  1.29M|          x1r1 = x0r1 - (x1r1 * 2);
 1208|  1.29M|          x1i1 = x0i1 - (x1i1 * 2);
 1209|  1.29M|          x2r1 = x2r1 - (x3i1);
 1210|  1.29M|          x2i1 = x2i1 + (x3r1);
 1211|  1.29M|          x3i1 = x2r1 + (x3i1 * 2);
 1212|  1.29M|          x3r1 = x2i1 - (x3r1 * 2);
 1213|       |
 1214|  1.29M|          *data = x0r1;
 1215|  1.29M|          *(data + 1) = x0i1;
 1216|  1.29M|          data += ((SIZE_T)del << 1);
 1217|       |
 1218|  1.29M|          *data = x2r1;
 1219|  1.29M|          *(data + 1) = x2i1;
 1220|  1.29M|          data += ((SIZE_T)del << 1);
 1221|       |
 1222|  1.29M|          *data = x1r1;
 1223|  1.29M|          *(data + 1) = x1i1;
 1224|  1.29M|          data += ((SIZE_T)del << 1);
 1225|       |
 1226|  1.29M|          *data = x3i1;
 1227|  1.29M|          *(data + 1) = x3r1;
 1228|  1.29M|          data += ((SIZE_T)del << 1);
 1229|  1.29M|        }
 1230|   860k|        data -= 2 * npoints;
 1231|   860k|        data += 2;
 1232|   860k|      }
 1233|  3.39M|      for (; j < nodespacing * del; j += nodespacing) {
  ------------------
  |  Branch (1233:14): [True: 2.55M, False: 836k]
  ------------------
 1234|  2.55M|        w_1 = *(ptr_twiddle + j);
 1235|  2.55M|        w_4 = *(ptr_twiddle + j + 257);
 1236|  2.55M|        w_2 = *(ptr_twiddle + ((SIZE_T)j << 1) - 256);
 1237|  2.55M|        w_5 = *(ptr_twiddle + ((SIZE_T)j << 1) + 1);
 1238|  2.55M|        w_3 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 512);
 1239|  2.55M|        w_6 = *(ptr_twiddle + j + ((SIZE_T)j << 1) - 512 + 257);
 1240|       |
 1241|  7.88M|        for (k = in_loop_cnt; k != 0; k--) {
  ------------------
  |  Branch (1241:31): [True: 5.32M, False: 2.55M]
  ------------------
 1242|  5.32M|          FLOAT32 tmp;
 1243|  5.32M|          FLOAT32 x0r1, x0i1, x1r1, x1i1, x2r1, x2i1, x3r1, x3i1;
 1244|       |          /*x0 is loaded later to avoid register crunch*/
 1245|       |
 1246|  5.32M|          data += ((SIZE_T)del << 1);
 1247|       |
 1248|  5.32M|          x1r1 = *data;
 1249|  5.32M|          x1i1 = *(data + 1);
 1250|  5.32M|          data += ((SIZE_T)del << 1);
 1251|       |
 1252|  5.32M|          x2r1 = *data;
 1253|  5.32M|          x2i1 = *(data + 1);
 1254|  5.32M|          data += ((SIZE_T)del << 1);
 1255|       |
 1256|  5.32M|          x3r1 = *data;
 1257|  5.32M|          x3i1 = *(data + 1);
 1258|  5.32M|          data -= 3 * (del << 1);
 1259|       |
 1260|  5.32M|          tmp = (FLOAT32)(((FLOAT64)x1r1 * w_1) + ((FLOAT64)x1i1 * w_4));
 1261|  5.32M|          x1i1 = (FLOAT32)(-((FLOAT64)x1r1 * w_4) + (FLOAT64)x1i1 * w_1);
 1262|  5.32M|          x1r1 = tmp;
 1263|       |
 1264|  5.32M|          tmp = (FLOAT32)(((FLOAT64)x2r1 * w_5) - ((FLOAT64)x2i1 * w_2));
 1265|  5.32M|          x2i1 = (FLOAT32)(((FLOAT64)x2r1 * w_2) + ((FLOAT64)x2i1 * w_5));
 1266|  5.32M|          x2r1 = tmp;
 1267|       |
 1268|  5.32M|          tmp = (FLOAT32)(-((FLOAT64)x3r1 * w_3) - ((FLOAT64)x3i1 * w_6));
 1269|  5.32M|          x3i1 = (FLOAT32)(-((FLOAT64)x3r1 * w_6) + (FLOAT64)x3i1 * w_3);
 1270|  5.32M|          x3r1 = tmp;
 1271|       |
 1272|  5.32M|          x0r1 = (*data);
 1273|  5.32M|          x0i1 = (*(data + 1));
 1274|       |
 1275|  5.32M|          x0r1 = x0r1 + (x2r1);
 1276|  5.32M|          x0i1 = x0i1 + (x2i1);
 1277|  5.32M|          x2r1 = x0r1 - (x2r1 * 2);
 1278|  5.32M|          x2i1 = x0i1 - (x2i1 * 2);
 1279|  5.32M|          x1r1 = x1r1 + x3r1;
 1280|  5.32M|          x1i1 = x1i1 - x3i1;
 1281|  5.32M|          x3r1 = x1r1 - (x3r1 * 2);
 1282|  5.32M|          x3i1 = x1i1 + (x3i1 * 2);
 1283|       |
 1284|  5.32M|          x0r1 = x0r1 + (x1r1);
 1285|  5.32M|          x0i1 = x0i1 + (x1i1);
 1286|  5.32M|          x1r1 = x0r1 - (x1r1 * 2);
 1287|  5.32M|          x1i1 = x0i1 - (x1i1 * 2);
 1288|  5.32M|          x2r1 = x2r1 - (x3i1);
 1289|  5.32M|          x2i1 = x2i1 + (x3r1);
 1290|  5.32M|          x3i1 = x2r1 + (x3i1 * 2);
 1291|  5.32M|          x3r1 = x2i1 - (x3r1 * 2);
 1292|       |
 1293|  5.32M|          *data = x0r1;
 1294|  5.32M|          *(data + 1) = x0i1;
 1295|  5.32M|          data += ((SIZE_T)del << 1);
 1296|       |
 1297|  5.32M|          *data = x2r1;
 1298|  5.32M|          *(data + 1) = x2i1;
 1299|  5.32M|          data += ((SIZE_T)del << 1);
 1300|       |
 1301|  5.32M|          *data = x1r1;
 1302|  5.32M|          *(data + 1) = x1i1;
 1303|  5.32M|          data += ((SIZE_T)del << 1);
 1304|       |
 1305|  5.32M|          *data = x3i1;
 1306|  5.32M|          *(data + 1) = x3r1;
 1307|  5.32M|          data += ((SIZE_T)del << 1);
 1308|  5.32M|        }
 1309|  2.55M|        data -= 2 * npoints;
 1310|  2.55M|        data += 2;
 1311|  2.55M|      }
 1312|   836k|      nodespacing >>= 2;
 1313|   836k|      del <<= 2;
 1314|   836k|      in_loop_cnt >>= 2;
 1315|   836k|    }
 1316|       |
 1317|   693k|    if (not_power_4) {
  ------------------
  |  Branch (1317:9): [True: 621k, False: 71.6k]
  ------------------
 1318|   621k|      const FLOAT64 *ptr_twiddle = ptr_w;
 1319|   621k|      nodespacing <<= 1;
 1320|       |
 1321|  5.59M|      for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (1321:25): [True: 4.97M, False: 621k]
  ------------------
 1322|  4.97M|        FLOAT64 w_1 = *ptr_twiddle;
 1323|  4.97M|        FLOAT64 w_4 = *(ptr_twiddle + 257);
 1324|  4.97M|        FLOAT32 tmp;
 1325|  4.97M|        ptr_twiddle += nodespacing;
 1326|       |
 1327|  4.97M|        x0r = *ptr_y;
 1328|  4.97M|        x0i = *(ptr_y + 1);
 1329|  4.97M|        ptr_y += ((SIZE_T)del << 1);
 1330|       |
 1331|  4.97M|        x1r = *ptr_y;
 1332|  4.97M|        x1i = *(ptr_y + 1);
 1333|       |
 1334|  4.97M|        tmp = (FLOAT32)(((FLOAT64)x1r * w_1) + ((FLOAT64)x1i * w_4));
 1335|  4.97M|        x1i = (FLOAT32)(-((FLOAT64)x1r * w_4) + (FLOAT64)x1i * w_1);
 1336|  4.97M|        x1r = tmp;
 1337|       |
 1338|  4.97M|        *ptr_y = (x0r) - (x1r);
 1339|  4.97M|        *(ptr_y + 1) = (x0i) - (x1i);
 1340|  4.97M|        ptr_y -= ((SIZE_T)del << 1);
 1341|       |
 1342|  4.97M|        *ptr_y = (x0r) + (x1r);
 1343|  4.97M|        *(ptr_y + 1) = (x0i) + (x1i);
 1344|  4.97M|        ptr_y += 2;
 1345|  4.97M|      }
 1346|   621k|      ptr_twiddle = ptr_w;
 1347|  5.59M|      for (j = del / 2; j != 0; j--) {
  ------------------
  |  Branch (1347:25): [True: 4.97M, False: 621k]
  ------------------
 1348|  4.97M|        FLOAT64 w_1 = *ptr_twiddle;
 1349|  4.97M|        FLOAT64 w_4 = *(ptr_twiddle + 257);
 1350|  4.97M|        FLOAT32 tmp;
 1351|  4.97M|        ptr_twiddle += nodespacing;
 1352|       |
 1353|  4.97M|        x0r = *ptr_y;
 1354|  4.97M|        x0i = *(ptr_y + 1);
 1355|  4.97M|        ptr_y += ((SIZE_T)del << 1);
 1356|       |
 1357|  4.97M|        x1r = *ptr_y;
 1358|  4.97M|        x1i = *(ptr_y + 1);
 1359|       |
 1360|  4.97M|        tmp = (FLOAT32)(((FLOAT64)x1r * w_4) - ((FLOAT64)x1i * w_1));
 1361|  4.97M|        x1i = (FLOAT32)(((FLOAT64)x1r * w_1) + ((FLOAT64)x1i * w_4));
 1362|  4.97M|        x1r = tmp;
 1363|       |
 1364|  4.97M|        *ptr_y = (x0r) - (x1r);
 1365|  4.97M|        *(ptr_y + 1) = (x0i) - (x1i);
 1366|  4.97M|        ptr_y -= ((SIZE_T)del << 1);
 1367|       |
 1368|  4.97M|        *ptr_y = (x0r) + (x1r);
 1369|  4.97M|        *(ptr_y + 1) = (x0i) + (x1i);
 1370|  4.97M|        ptr_y += 2;
 1371|  4.97M|      }
 1372|   621k|    }
 1373|   693k|  }
 1374|       |
 1375|  74.2M|  for (i = 0; i < n_pass; i++) {
  ------------------
  |  Branch (1375:15): [True: 73.2M, False: 974k]
  ------------------
 1376|  73.2M|    re[2 * i + 0] = y[2 * i + 0];
 1377|  73.2M|    re[2 * i + 1] = y[2 * i + 1];
 1378|  73.2M|  }
 1379|   974k|}
ixheaace_hbe_apply_cfftn_gen:
 1382|   145k|                                  WORD32 i_sign) {
 1383|   145k|  WORD32 i, j;
 1384|   145k|  WORD32 m_points = n_pass;
 1385|   145k|  FLOAT32 *y, *re_3;
 1386|   145k|  FLOAT32 *ptr_x, *ptr_y;
 1387|   145k|  ptr_x = ptr_scratch;
 1388|   145k|  ptr_scratch += 2 * m_points;
 1389|   145k|  ptr_y = y = ptr_scratch;
 1390|   145k|  ptr_scratch += 4 * m_points;
 1391|   145k|  re_3 = ptr_scratch;
 1392|   145k|  ptr_scratch += 2 * m_points;
 1393|   145k|  WORD32 cnfac;
 1394|   145k|  WORD32 mpass = n_pass;
 1395|       |
 1396|   145k|  cnfac = 0;
 1397|   290k|  while (mpass % 3 == 0) {
  ------------------
  |  Branch (1397:10): [True: 145k, False: 145k]
  ------------------
 1398|   145k|    mpass /= 3;
 1399|   145k|    cnfac++;
 1400|   145k|  }
 1401|       |
 1402|   580k|  for (i = 0; i < 3 * cnfac; i++) {
  ------------------
  |  Branch (1402:15): [True: 435k, False: 145k]
  ------------------
 1403|  20.5M|    for (j = 0; j < mpass; j++) {
  ------------------
  |  Branch (1403:17): [True: 20.1M, False: 435k]
  ------------------
 1404|  20.1M|      re_3[2 * j + 0] = in[6 * j + 2 * i + 0];
 1405|  20.1M|      re_3[2 * j + 1] = in[6 * j + 2 * i + 1];
 1406|  20.1M|    }
 1407|       |
 1408|   435k|    ixheaace_hbe_apply_cfftn(re_3, ptr_scratch, mpass, i_sign);
 1409|       |
 1410|  20.5M|    for (j = 0; j < mpass; j++) {
  ------------------
  |  Branch (1410:17): [True: 20.1M, False: 435k]
  ------------------
 1411|  20.1M|      in[6 * j + 2 * i + 0] = re_3[2 * j + 0];
 1412|  20.1M|      in[6 * j + 2 * i + 1] = re_3[2 * j + 1];
 1413|  20.1M|    }
 1414|   435k|  }
 1415|       |
 1416|   145k|  {
 1417|   145k|    FLOAT64 *ptr_w1r, *ptr_w1i;
 1418|   145k|    FLOAT32 tmp;
 1419|   145k|    ptr_w1r = (FLOAT64 *)ixheaac_twid_tbl_fft_ntwt3r;
 1420|   145k|    ptr_w1i = (FLOAT64 *)ixheaac_twid_tbl_fft_ntwt3i;
 1421|       |
 1422|   145k|    if (i_sign < 0) {
  ------------------
  |  Branch (1422:9): [True: 64.3k, False: 80.8k]
  ------------------
 1423|  64.3k|      i = 0;
 1424|  4.17M|      while (i < n_pass) {
  ------------------
  |  Branch (1424:14): [True: 4.11M, False: 64.3k]
  ------------------
 1425|  4.11M|        tmp =
 1426|  4.11M|            (FLOAT32)((FLOAT64)in[2 * i + 0] * (*ptr_w1r) - (FLOAT64)in[2 * i + 1] * (*ptr_w1i));
 1427|  4.11M|        in[2 * i + 1] =
 1428|  4.11M|            (FLOAT32)((FLOAT64)in[2 * i + 0] * (*ptr_w1i) + (FLOAT64)in[2 * i + 1] * (*ptr_w1r));
 1429|  4.11M|        in[2 * i + 0] = tmp;
 1430|       |
 1431|  4.11M|        ptr_w1r++;
 1432|  4.11M|        ptr_w1i++;
 1433|       |
 1434|  4.11M|        tmp =
 1435|  4.11M|            (FLOAT32)((FLOAT64)in[2 * i + 2] * (*ptr_w1r) - (FLOAT64)in[2 * i + 3] * (*ptr_w1i));
 1436|  4.11M|        in[2 * i + 3] =
 1437|  4.11M|            (FLOAT32)((FLOAT64)in[2 * i + 2] * (*ptr_w1i) + (FLOAT64)in[2 * i + 3] * (*ptr_w1r));
 1438|  4.11M|        in[2 * i + 2] = tmp;
 1439|       |
 1440|  4.11M|        ptr_w1r++;
 1441|  4.11M|        ptr_w1i++;
 1442|       |
 1443|  4.11M|        tmp =
 1444|  4.11M|            (FLOAT32)((FLOAT64)in[2 * i + 4] * (*ptr_w1r) - (FLOAT64)in[2 * i + 5] * (*ptr_w1i));
 1445|  4.11M|        in[2 * i + 5] =
 1446|  4.11M|            (FLOAT32)((FLOAT64)in[2 * i + 4] * (*ptr_w1i) + (FLOAT64)in[2 * i + 5] * (*ptr_w1r));
 1447|  4.11M|        in[2 * i + 4] = tmp;
 1448|       |
 1449|  4.11M|        ptr_w1r += 3 * (128 / mpass - 1) + 1;
 1450|  4.11M|        ptr_w1i += 3 * (128 / mpass - 1) + 1;
 1451|  4.11M|        i += 3;
 1452|  4.11M|      }
 1453|  64.3k|    }
 1454|       |
 1455|  80.8k|    else {
 1456|  80.8k|      i = 0;
 1457|  2.66M|      while (i < n_pass) {
  ------------------
  |  Branch (1457:14): [True: 2.58M, False: 80.8k]
  ------------------
 1458|  2.58M|        tmp =
 1459|  2.58M|            (FLOAT32)((FLOAT64)in[2 * i + 0] * (*ptr_w1r) + (FLOAT64)in[2 * i + 1] * (*ptr_w1i));
 1460|  2.58M|        in[2 * i + 1] =
 1461|  2.58M|            (FLOAT32)(-(FLOAT64)in[2 * i + 0] * (*ptr_w1i) + (FLOAT64)in[2 * i + 1] * (*ptr_w1r));
 1462|  2.58M|        in[2 * i + 0] = tmp;
 1463|       |
 1464|  2.58M|        ptr_w1r++;
 1465|  2.58M|        ptr_w1i++;
 1466|       |
 1467|  2.58M|        tmp =
 1468|  2.58M|            (FLOAT32)((FLOAT64)in[2 * i + 2] * (*ptr_w1r) + (FLOAT64)in[2 * i + 3] * (*ptr_w1i));
 1469|  2.58M|        in[2 * i + 3] =
 1470|  2.58M|            (FLOAT32)(-(FLOAT64)in[2 * i + 2] * (*ptr_w1i) + (FLOAT64)in[2 * i + 3] * (*ptr_w1r));
 1471|  2.58M|        in[2 * i + 2] = tmp;
 1472|       |
 1473|  2.58M|        ptr_w1r++;
 1474|  2.58M|        ptr_w1i++;
 1475|       |
 1476|  2.58M|        tmp =
 1477|  2.58M|            (FLOAT32)((FLOAT64)in[2 * i + 4] * (*ptr_w1r) + (FLOAT64)in[2 * i + 5] * (*ptr_w1i));
 1478|  2.58M|        in[2 * i + 5] =
 1479|  2.58M|            (FLOAT32)(-(FLOAT64)in[2 * i + 4] * (*ptr_w1i) + (FLOAT64)in[2 * i + 5] * (*ptr_w1r));
 1480|  2.58M|        in[2 * i + 4] = tmp;
 1481|       |
 1482|  2.58M|        ptr_w1r += 3 * (128 / mpass - 1) + 1;
 1483|  2.58M|        ptr_w1i += 3 * (128 / mpass - 1) + 1;
 1484|  2.58M|        i += 3;
 1485|  2.58M|      }
 1486|  80.8k|    }
 1487|   145k|  }
 1488|       |
 1489|  20.2M|  for (i = 0; i < n_pass; i++) {
  ------------------
  |  Branch (1489:15): [True: 20.1M, False: 145k]
  ------------------
 1490|  20.1M|    ptr_x[2 * i + 0] = in[2 * i + 0];
 1491|  20.1M|    ptr_x[2 * i + 1] = in[2 * i + 1];
 1492|  20.1M|  }
 1493|  6.84M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (1493:15): [True: 6.70M, False: 145k]
  ------------------
 1494|  6.70M|    ixheaace_hbe_apply_fft_3(ptr_x, ptr_y, i_sign);
 1495|       |
 1496|  6.70M|    ptr_x = ptr_x + 6;
 1497|  6.70M|    ptr_y = ptr_y + 6;
 1498|  6.70M|  }
 1499|       |
 1500|  6.84M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (1500:15): [True: 6.70M, False: 145k]
  ------------------
 1501|  6.70M|    in[2 * i + 0] = y[6 * i + 0];
 1502|  6.70M|    in[2 * i + 1] = y[6 * i + 1];
 1503|  6.70M|  }
 1504|       |
 1505|  6.84M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (1505:15): [True: 6.70M, False: 145k]
  ------------------
 1506|  6.70M|    in[2 * mpass + 2 * i + 0] = y[6 * i + 2];
 1507|  6.70M|    in[2 * mpass + 2 * i + 1] = y[6 * i + 3];
 1508|  6.70M|  }
 1509|       |
 1510|  6.84M|  for (i = 0; i < mpass; i++) {
  ------------------
  |  Branch (1510:15): [True: 6.70M, False: 145k]
  ------------------
 1511|  6.70M|    in[4 * mpass + 2 * i + 0] = y[6 * i + 4];
 1512|  6.70M|    in[4 * mpass + 2 * i + 1] = y[6 * i + 5];
 1513|  6.70M|  }
 1514|   145k|}
ixheaace_hbe_apply_fft_288:
 1517|  26.9k|                                WORD32 i_sign) {
 1518|       |  /* Dividing the 288-point FFT into 96x3 i.e nx3*/
 1519|  26.9k|  FLOAT32 *ptr_op = ptr_scratch;
 1520|  26.9k|  WORD32 mpoints = len / 96;
 1521|  26.9k|  WORD32 fpoints = len / 3;
 1522|  26.9k|  WORD32 ii, jj;
 1523|  26.9k|  ptr_scratch += 2 * len;
 1524|       |
 1525|   107k|  for (ii = 0; ii < mpoints; ii++) {
  ------------------
  |  Branch (1525:16): [True: 80.8k, False: 26.9k]
  ------------------
 1526|  7.84M|    for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1526:18): [True: 7.76M, False: 80.8k]
  ------------------
 1527|  7.76M|      ptr_op[2 * jj + 0] = ptr_inp[2 * mpoints * jj + 2 * ii];
 1528|  7.76M|      ptr_op[2 * jj + 1] = ptr_inp[2 * mpoints * jj + 2 * ii + 1];
 1529|  7.76M|    }
 1530|       |
 1531|       |    /* 96-point (32x3-point) of FFT */
 1532|  80.8k|    if (fpoints & (fpoints - 1))
  ------------------
  |  Branch (1532:9): [True: 80.8k, False: 0]
  ------------------
 1533|  80.8k|      ixheaace_hbe_apply_cfftn_gen(ptr_op, ptr_scratch, fpoints, i_sign);
 1534|      0|    else
 1535|      0|      ixheaace_hbe_apply_cfftn(ptr_op, ptr_scratch, fpoints, i_sign);
 1536|       |
 1537|  7.84M|    for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1537:18): [True: 7.76M, False: 80.8k]
  ------------------
 1538|  7.76M|      ptr_inp[mpoints * 2 * jj + 2 * ii + 0] = ptr_op[2 * jj + 0];
 1539|  7.76M|      ptr_inp[mpoints * 2 * jj + 2 * ii + 1] = ptr_op[2 * jj + 1];
 1540|  7.76M|    }
 1541|  80.8k|  }
 1542|       |
 1543|       |  /* Multiplication FFT with twiddle table */
 1544|  26.9k|  ixheaace_hbe_apply_tw_mult_fft(ptr_inp, ptr_op, fpoints, mpoints, ixheaac_twid_tbl_fft_288);
 1545|       |
 1546|  2.61M|  for (ii = 0; ii < fpoints; ii++) {
  ------------------
  |  Branch (1546:16): [True: 2.58M, False: 26.9k]
  ------------------
 1547|       |    /* 3-point of FFT */
 1548|  2.58M|    ixheaace_hbe_apply_fft_3(ptr_op, ptr_scratch, i_sign);
 1549|  2.58M|    ptr_op = ptr_op + (mpoints * 2);
 1550|  2.58M|    ptr_scratch = ptr_scratch + (mpoints * 2);
 1551|  2.58M|  }
 1552|       |
 1553|  26.9k|  ptr_scratch -= fpoints * mpoints * 2;
 1554|       |
 1555|  2.61M|  for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1555:16): [True: 2.58M, False: 26.9k]
  ------------------
 1556|  2.58M|    ptr_inp[2 * jj + 0] = ptr_scratch[6 * jj];
 1557|  2.58M|    ptr_inp[2 * jj + 1] = ptr_scratch[6 * jj + 1];
 1558|  2.58M|  }
 1559|  2.61M|  for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1559:16): [True: 2.58M, False: 26.9k]
  ------------------
 1560|  2.58M|    ptr_inp[2 * fpoints + 2 * jj + 0] = ptr_scratch[6 * jj + 2];
 1561|  2.58M|    ptr_inp[2 * fpoints + 2 * jj + 1] = ptr_scratch[6 * jj + 3];
 1562|  2.58M|  }
 1563|  2.61M|  for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1563:16): [True: 2.58M, False: 26.9k]
  ------------------
 1564|  2.58M|    ptr_inp[4 * fpoints + 2 * jj + 0] = ptr_scratch[6 * jj + 4];
 1565|  2.58M|    ptr_inp[4 * fpoints + 2 * jj + 1] = ptr_scratch[6 * jj + 5];
 1566|  2.58M|  }
 1567|  26.9k|}
ixheaace_hbe_apply_ifft_224:
 1570|  54.1k|                                 WORD32 i_sign) {
 1571|       |  /* Dividing 224-point IFFT into 32x7 */
 1572|  54.1k|  WORD32 mpoints = len / 32;
 1573|  54.1k|  WORD32 fpoints = len / 7;
 1574|  54.1k|  WORD32 ii, jj;
 1575|  54.1k|  FLOAT32 *ptr_op = ptr_scratch;
 1576|  54.1k|  ptr_scratch += 2 * len;
 1577|       |
 1578|   433k|  for (ii = 0; ii < mpoints; ii++) {
  ------------------
  |  Branch (1578:16): [True: 379k, False: 54.1k]
  ------------------
 1579|  12.5M|    for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1579:18): [True: 12.1M, False: 379k]
  ------------------
 1580|  12.1M|      ptr_op[2 * jj + 0] = ptr_inp[2 * mpoints * jj + 2 * ii];
 1581|  12.1M|      ptr_op[2 * jj + 1] = ptr_inp[2 * mpoints * jj + 2 * ii + 1];
 1582|  12.1M|    }
 1583|       |
 1584|       |    /* 32-point of IFFT*/
 1585|   379k|    if (fpoints & (fpoints - 1))
  ------------------
  |  Branch (1585:9): [True: 0, False: 379k]
  ------------------
 1586|      0|      ixheaace_hbe_apply_cfftn_gen(ptr_op, ptr_scratch, fpoints, i_sign);
 1587|   379k|    else
 1588|   379k|      ixheaace_hbe_apply_cfftn(ptr_op, ptr_scratch, fpoints, i_sign);
 1589|       |
 1590|  12.5M|    for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1590:18): [True: 12.1M, False: 379k]
  ------------------
 1591|  12.1M|      ptr_inp[mpoints * 2 * jj + 2 * ii + 0] = ptr_op[2 * jj + 0];
 1592|  12.1M|      ptr_inp[mpoints * 2 * jj + 2 * ii + 1] = ptr_op[2 * jj + 1];
 1593|  12.1M|    }
 1594|   379k|  }
 1595|       |
 1596|       |  /* Multiplication IFFT with twiddle table */
 1597|  54.1k|  ixheaace_hbe_apply_tw_mult_ifft(ptr_inp, ptr_op, fpoints, mpoints, ixheaac_twid_tbl_fft_224);
 1598|       |
 1599|  1.78M|  for (ii = 0; ii < fpoints; ii++) {
  ------------------
  |  Branch (1599:16): [True: 1.73M, False: 54.1k]
  ------------------
 1600|       |    /* 7-point of IFFT */
 1601|  1.73M|    ixheaace_hbe_apply_ifft_7(ptr_op, ptr_scratch);
 1602|  1.73M|    ptr_scratch += (mpoints * 2);
 1603|  1.73M|    ptr_op += (mpoints * 2);
 1604|  1.73M|  }
 1605|       |
 1606|  54.1k|  ptr_scratch -= fpoints * mpoints * 2;
 1607|       |
 1608|  1.78M|  for (jj = 0; jj < fpoints; jj++) {
  ------------------
  |  Branch (1608:16): [True: 1.73M, False: 54.1k]
  ------------------
 1609|  13.8M|    for (ii = 0; ii < mpoints; ii++) {
  ------------------
  |  Branch (1609:18): [True: 12.1M, False: 1.73M]
  ------------------
 1610|  12.1M|      ptr_inp[fpoints * ii * 2 + 2 * jj + 0] = ptr_scratch[mpoints * jj * 2 + 2 * ii + 0];
 1611|  12.1M|      ptr_inp[fpoints * ii * 2 + 2 * jj + 1] = ptr_scratch[mpoints * jj * 2 + 2 * ii + 1];
 1612|  12.1M|    }
 1613|  1.73M|  }
 1614|  54.1k|}

ixheaace_complex_anal_filt:
   34|   126k|IA_ERRORCODE ixheaace_complex_anal_filt(ixheaace_str_esbr_hbe_txposer *ptr_hbe_txposer) {
   35|   126k|  WORD32 idx;
   36|   126k|  WORD32 anal_size = 2 * ptr_hbe_txposer->synth_size;
   37|   126k|  WORD32 N = (10 * anal_size);
   38|       |
   39|   126k|  WORD32 no_bins = ptr_hbe_txposer->no_bins >> 1;
   40|       |
   41|   126k|  if (ptr_hbe_txposer->esbr_hq != 0) {
  ------------------
  |  Branch (41:7): [True: 0, False: 126k]
  ------------------
   42|      0|    anal_size = 2 * ptr_hbe_txposer->analy_size;
   43|      0|    no_bins = ptr_hbe_txposer->no_bins;
   44|      0|  }
   45|       |
   46|   126k|  idx = 0;
   47|  2.88M|  while (idx < no_bins) {
  ------------------
  |  Branch (47:10): [True: 2.75M, False: 126k]
  ------------------
   48|  2.75M|    WORD32 i, j, k, l;
   49|  2.75M|    FLOAT32 window_output[640] = {0};
   50|  2.75M|    FLOAT32 u[128] = {0}, u_in[256] = {0}, u_out[256] = {0};
   51|  2.75M|    FLOAT32 accu_r, accu_i;
   52|  2.75M|    const FLOAT32 *ptr_inp_signal;
   53|  2.75M|    FLOAT32 *ptr_anal_buf;
   54|       |
   55|  2.75M|    FLOAT32 *ptr_analy_cos_sin_tab = ptr_hbe_txposer->ptr_analy_cos_sin_tab;
   56|  2.75M|    const FLOAT32 *ptr_interp_window_coeff = ptr_hbe_txposer->ptr_ana_win_coeff;
   57|  2.75M|    FLOAT32 *ptr_x = ptr_hbe_txposer->analy_buf;
   58|       |
   59|  2.75M|    if (ptr_hbe_txposer->esbr_hq != 0) {
  ------------------
  |  Branch (59:9): [True: 0, False: 2.75M]
  ------------------
   60|      0|      memset(ptr_hbe_txposer->qmf_in_buf[idx], 0, sizeof(ptr_hbe_txposer->qmf_in_buf[idx]));
   61|      0|      ptr_inp_signal = ptr_hbe_txposer->ptr_output_buf + idx * ptr_hbe_txposer->analy_size + 1;
   62|      0|      ptr_anal_buf = &ptr_hbe_txposer->qmf_in_buf[idx][4 * ptr_hbe_txposer->a_start];
   63|  2.75M|    } else {
   64|  2.75M|      memset(ptr_hbe_txposer->qmf_in_buf[idx + IXHEAACE_HBE_OPER_WIN_LEN - 1], 0,
  ------------------
  |  |   32|  2.75M|#define IXHEAACE_HBE_OPER_WIN_LEN (13)
  ------------------
   65|  2.75M|             sizeof(ptr_hbe_txposer->qmf_in_buf[idx + IXHEAACE_HBE_OPER_WIN_LEN - 1]));
  ------------------
  |  |   32|  2.75M|#define IXHEAACE_HBE_OPER_WIN_LEN (13)
  ------------------
   66|       |
   67|  2.75M|      ptr_inp_signal = ptr_hbe_txposer->ptr_input_buf + idx * 2 * ptr_hbe_txposer->synth_size + 1;
   68|  2.75M|      ptr_anal_buf =
   69|  2.75M|          &ptr_hbe_txposer
   70|  2.75M|               ->qmf_in_buf[idx + IXHEAACE_HBE_OPER_WIN_LEN - 1][4 * ptr_hbe_txposer->k_start];
  ------------------
  |  |   32|  2.75M|#define IXHEAACE_HBE_OPER_WIN_LEN (13)
  ------------------
   71|  2.75M|    }
   72|       |
   73|   707M|    for (i = N - 1; i >= anal_size; i--) {
  ------------------
  |  Branch (73:21): [True: 704M, False: 2.75M]
  ------------------
   74|   704M|      ptr_x[i] = ptr_x[i - anal_size];
   75|   704M|    }
   76|       |
   77|  81.0M|    for (i = anal_size - 1; i >= 0; i--) {
  ------------------
  |  Branch (77:29): [True: 78.3M, False: 2.75M]
  ------------------
   78|  78.3M|      ptr_x[i] = ptr_inp_signal[anal_size - 1 - i];
   79|  78.3M|    }
   80|       |
   81|   786M|    for (i = 0; i < N; i++) {
  ------------------
  |  Branch (81:17): [True: 783M, False: 2.75M]
  ------------------
   82|   783M|      window_output[i] = ptr_x[i] * ptr_interp_window_coeff[i];
   83|   783M|    }
   84|       |
   85|   159M|    for (i = 0; i < 2 * anal_size; i++) {
  ------------------
  |  Branch (85:17): [True: 156M, False: 2.75M]
  ------------------
   86|   156M|      accu_r = 0.0;
   87|   939M|      for (j = 0; j < 5; j++) {
  ------------------
  |  Branch (87:19): [True: 783M, False: 156M]
  ------------------
   88|   783M|        accu_r = accu_r + window_output[i + j * 2 * anal_size];
   89|   783M|      }
   90|   156M|      u[i] = accu_r;
   91|   156M|    }
   92|  2.75M|    if (anal_size == 40 || anal_size == 56) {
  ------------------
  |  Branch (92:9): [True: 292k, False: 2.46M]
  |  Branch (92:28): [True: 0, False: 2.46M]
  ------------------
   93|  11.7M|      for (i = 1; i < anal_size; i++) {
  ------------------
  |  Branch (93:19): [True: 11.4M, False: 292k]
  ------------------
   94|  11.4M|        FLOAT32 temp1 = u[i] + u[2 * anal_size - i];
   95|  11.4M|        FLOAT32 temp2 = u[i] - u[2 * anal_size - i];
   96|  11.4M|        u[i] = temp1;
   97|  11.4M|        u[2 * anal_size - i] = temp2;
   98|  11.4M|      }
   99|       |
  100|   292k|      k = 0;
  101|  12.0M|      while (k < anal_size) {
  ------------------
  |  Branch (101:14): [True: 11.7M, False: 292k]
  ------------------
  102|  11.7M|        accu_r = u[anal_size];
  103|  11.7M|        if (k & 1)
  ------------------
  |  Branch (103:13): [True: 5.85M, False: 5.85M]
  ------------------
  104|  5.85M|          accu_i = u[0];
  105|  5.85M|        else
  106|  5.85M|          accu_i = -u[0];
  107|   468M|        for (l = 1; l < anal_size; l++) {
  ------------------
  |  Branch (107:21): [True: 456M, False: 11.7M]
  ------------------
  108|   456M|          accu_r = accu_r + u[0 + l] * ptr_analy_cos_sin_tab[2 * l + 0];
  109|   456M|          accu_i = accu_i + u[2 * anal_size - l] * ptr_analy_cos_sin_tab[2 * l + 1];
  110|   456M|        }
  111|  11.7M|        ptr_analy_cos_sin_tab += (2 * anal_size);
  112|  11.7M|        *ptr_anal_buf++ = (FLOAT32)accu_r;
  113|  11.7M|        *ptr_anal_buf++ = (FLOAT32)accu_i;
  114|  11.7M|        k++;
  115|  11.7M|      }
  116|  2.46M|    } else {
  117|  2.46M|      FLOAT32 *ptr_u = u_in;
  118|  2.46M|      FLOAT32 *ptr_v = u_out;
  119|   135M|      for (k = 0; k < anal_size * 2; k++) {
  ------------------
  |  Branch (119:19): [True: 133M, False: 2.46M]
  ------------------
  120|   133M|        *ptr_u++ = ((*ptr_analy_cos_sin_tab++) * u[k]);
  121|   133M|        *ptr_u++ = ((*ptr_analy_cos_sin_tab++) * u[k]);
  122|   133M|      }
  123|  2.46M|      if (ptr_hbe_txposer->ixheaace_cmplx_anal_fft != NULL) {
  ------------------
  |  Branch (123:11): [True: 2.46M, False: 0]
  ------------------
  124|  2.46M|        (*(ptr_hbe_txposer->ixheaace_cmplx_anal_fft))(u_in, u_out, anal_size * 2);
  125|  2.46M|      } else {
  126|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_FFT;
  127|      0|      }
  128|       |
  129|  35.7M|      for (k = 0; k < anal_size / 2; k++) {
  ------------------
  |  Branch (129:19): [True: 33.3M, False: 2.46M]
  ------------------
  130|  33.3M|        *(ptr_anal_buf + 1) = -*ptr_v++;
  131|  33.3M|        *ptr_anal_buf = *ptr_v++;
  132|       |
  133|  33.3M|        ptr_anal_buf += 2;
  134|       |
  135|  33.3M|        *(ptr_anal_buf + 1) = *ptr_v++;
  136|  33.3M|        *ptr_anal_buf = -*ptr_v++;
  137|       |
  138|  33.3M|        ptr_anal_buf += 2;
  139|  33.3M|      }
  140|  2.46M|    }
  141|  2.75M|    idx++;
  142|  2.75M|  }
  143|   126k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   126k|#define IA_NO_ERROR 0x00000000
  ------------------
  144|   126k|}
ixheaace_real_synth_filt:
  148|   152k|                                      FLOAT32 qmf_buf_imag[][64]) {
  149|   152k|  WORD32 i, j, k, l, idx;
  150|   152k|  FLOAT32 g[640];
  151|   152k|  FLOAT32 w[640];
  152|   152k|  FLOAT32 synth_out[128];
  153|   152k|  FLOAT32 accu_r;
  154|   152k|  WORD32 synth_size = ptr_hbe_txposer->synth_size;
  155|   152k|  FLOAT32 *ptr_cos_tab_trans_qmf =
  156|   152k|      (FLOAT32 *)&ixheaac_cos_table_trans_qmf[0][0] + ptr_hbe_txposer->k_start * 32;
  157|   152k|  FLOAT32 *ptr_buffer = ptr_hbe_txposer->synth_buf;
  158|   152k|  FLOAT32 *ptr_inp_buf = ptr_hbe_txposer->ptr_input_buf + ptr_hbe_txposer->ana_fft_size[0];
  159|       |
  160|  6.59M|  for (idx = 0; idx < num_columns; idx++) {
  ------------------
  |  Branch (160:17): [True: 6.44M, False: 152k]
  ------------------
  161|  6.44M|    FLOAT32 loc_qmf_buf[64];
  162|  6.44M|    FLOAT32 *ptr_synth_buf_r = loc_qmf_buf;
  163|  6.44M|    FLOAT32 *ptr_out_buf;
  164|  6.44M|    if (ptr_hbe_txposer->esbr_hq == 1) {
  ------------------
  |  Branch (164:9): [True: 0, False: 6.44M]
  ------------------
  165|      0|      ptr_out_buf = ptr_inp_buf + (idx - 1) * ptr_hbe_txposer->synth_size;
  166|  6.44M|    } else {
  167|  6.44M|      ptr_out_buf = ptr_hbe_txposer->ptr_input_buf + (idx + 1) * ptr_hbe_txposer->synth_size;
  168|  6.44M|    }
  169|       |
  170|  6.44M|    FLOAT32 *ptr_synth_cos_tab = ptr_hbe_txposer->ptr_syn_cos_tab;
  171|  6.44M|    const FLOAT32 *ptr_interp_window_coeff = ptr_hbe_txposer->ptr_syn_win_coeff;
  172|  6.44M|    if (ptr_hbe_txposer->k_start < 0) {
  ------------------
  |  Branch (172:9): [True: 0, False: 6.44M]
  ------------------
  173|      0|      return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_START_BAND;
  174|      0|    }
  175|       |
  176|  6.44M|    k = 0;
  177|  98.3M|    while (k < synth_size) {
  ------------------
  |  Branch (177:12): [True: 91.8M, False: 6.44M]
  ------------------
  178|  91.8M|      WORD32 ki = ptr_hbe_txposer->k_start + k;
  179|  91.8M|      ptr_synth_buf_r[k] = (FLOAT32)(ptr_cos_tab_trans_qmf[(k << 1) + 0] * qmf_buf_real[idx][ki] +
  180|  91.8M|                                     ptr_cos_tab_trans_qmf[(k << 1) + 1] * qmf_buf_imag[idx][ki]);
  181|       |
  182|  91.8M|      ptr_synth_buf_r[k + ptr_hbe_txposer->synth_size] = 0;
  183|  91.8M|      k++;
  184|  91.8M|    }
  185|       |
  186|  1.66G|    for (l = (20 * synth_size - 1); l >= 2 * synth_size; l--) {
  ------------------
  |  Branch (186:37): [True: 1.65G, False: 6.44M]
  ------------------
  187|  1.65G|      ptr_buffer[l] = ptr_buffer[l - 2 * synth_size];
  188|  1.65G|    }
  189|       |
  190|  6.44M|    if (synth_size == 20) {
  ------------------
  |  Branch (190:9): [True: 697k, False: 5.74M]
  ------------------
  191|   697k|      FLOAT32 *ptr_psynth_cos_tab = ptr_synth_cos_tab;
  192|       |
  193|  15.3M|      for (l = 0; l < (synth_size + 1); l++) {
  ------------------
  |  Branch (193:19): [True: 14.6M, False: 697k]
  ------------------
  194|  14.6M|        accu_r = 0.0;
  195|   307M|        for (k = 0; k < synth_size; k++) {
  ------------------
  |  Branch (195:21): [True: 293M, False: 14.6M]
  ------------------
  196|   293M|          accu_r += ptr_synth_buf_r[k] * ptr_psynth_cos_tab[k];
  197|   293M|        }
  198|  14.6M|        ptr_buffer[0 + l] = accu_r;
  199|  14.6M|        ptr_buffer[synth_size - l] = accu_r;
  200|  14.6M|        ptr_psynth_cos_tab = ptr_psynth_cos_tab + synth_size;
  201|  14.6M|      }
  202|  6.97M|      for (l = (synth_size + 1); l < (2 * synth_size - synth_size / 2); l++) {
  ------------------
  |  Branch (202:34): [True: 6.28M, False: 697k]
  ------------------
  203|  6.28M|        accu_r = 0.0;
  204|   131M|        for (k = 0; k < synth_size; k++) {
  ------------------
  |  Branch (204:21): [True: 125M, False: 6.28M]
  ------------------
  205|   125M|          accu_r += ptr_synth_buf_r[k] * ptr_psynth_cos_tab[k];
  206|   125M|        }
  207|  6.28M|        ptr_buffer[0 + l] = accu_r;
  208|  6.28M|        ptr_buffer[3 * synth_size - l] = -accu_r;
  209|  6.28M|        ptr_psynth_cos_tab = ptr_psynth_cos_tab + synth_size;
  210|  6.28M|      }
  211|   697k|      accu_r = 0.0;
  212|  14.6M|      for (k = 0; k < synth_size; k++) {
  ------------------
  |  Branch (212:19): [True: 13.9M, False: 697k]
  ------------------
  213|  13.9M|        accu_r += ptr_synth_buf_r[k] * ptr_psynth_cos_tab[k];
  214|  13.9M|      }
  215|   697k|      ptr_buffer[3 * synth_size >> 1] = accu_r;
  216|  5.74M|    } else {
  217|  5.74M|      FLOAT32 tmp;
  218|  5.74M|      FLOAT32 *ptr_u = synth_out;
  219|  5.74M|      WORD32 kmax = (synth_size >> 1);
  220|  5.74M|      FLOAT32 *ptr_syn_buf = &ptr_buffer[kmax];
  221|  5.74M|      kmax += synth_size;
  222|       |
  223|  5.74M|      if (ptr_hbe_txposer->ixheaace_real_synth_fft != NULL) {
  ------------------
  |  Branch (223:11): [True: 5.74M, False: 0]
  ------------------
  224|  5.74M|        (*(ptr_hbe_txposer->ixheaace_real_synth_fft))(ptr_synth_buf_r, synth_out, synth_size * 2);
  225|  5.74M|      } else {
  226|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_FFT;
  227|      0|      }
  228|       |
  229|   122M|      for (k = 0; k < kmax; k++) {
  ------------------
  |  Branch (229:19): [True: 116M, False: 5.74M]
  ------------------
  230|   116M|        tmp = ((*ptr_u++) * (*ptr_synth_cos_tab++));
  231|   116M|        tmp -= ((*ptr_u++) * (*ptr_synth_cos_tab++));
  232|   116M|        *ptr_syn_buf++ = tmp;
  233|   116M|      }
  234|       |
  235|  5.74M|      ptr_syn_buf = &ptr_buffer[0];
  236|  5.74M|      kmax -= synth_size;
  237|       |
  238|  44.7M|      for (k = 0; k < kmax; k++) {
  ------------------
  |  Branch (238:19): [True: 38.9M, False: 5.74M]
  ------------------
  239|  38.9M|        tmp = ((*ptr_u++) * (*ptr_synth_cos_tab++));
  240|  38.9M|        tmp -= ((*ptr_u++) * (*ptr_synth_cos_tab++));
  241|  38.9M|        *ptr_syn_buf++ = tmp;
  242|  38.9M|      }
  243|  5.74M|    }
  244|       |
  245|  38.6M|    for (i = 0; i < 5; i++) {
  ------------------
  |  Branch (245:17): [True: 32.2M, False: 6.44M]
  ------------------
  246|  32.2M|      memcpy(&g[(2 * i + 0) * synth_size], &ptr_buffer[(4 * i + 0) * synth_size],
  247|  32.2M|             sizeof(g[0]) * synth_size);
  248|  32.2M|      memcpy(&g[(2 * i + 1) * synth_size], &ptr_buffer[(4 * i + 3) * synth_size],
  249|  32.2M|             sizeof(g[0]) * synth_size);
  250|  32.2M|    }
  251|       |
  252|   925M|    for (k = 0; k < 10 * synth_size; k++) {
  ------------------
  |  Branch (252:17): [True: 918M, False: 6.44M]
  ------------------
  253|   918M|      w[k] = g[k] * ptr_interp_window_coeff[k];
  254|   918M|    }
  255|       |
  256|  98.3M|    for (i = 0; i < synth_size; i++) {
  ------------------
  |  Branch (256:17): [True: 91.8M, False: 6.44M]
  ------------------
  257|  91.8M|      accu_r = 0.0;
  258|  1.01G|      for (j = 0; j < 10; j++) {
  ------------------
  |  Branch (258:19): [True: 918M, False: 91.8M]
  ------------------
  259|   918M|        accu_r = accu_r + w[synth_size * j + i];
  260|   918M|      }
  261|  91.8M|      ptr_out_buf[i] = (FLOAT32)accu_r;
  262|  91.8M|    }
  263|  6.44M|  }
  264|   152k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   152k|#define IA_NO_ERROR 0x00000000
  ------------------
  265|   152k|}
ixheaace_dft_hbe_cplx_anal_filt:
  268|  19.0k|                                     FLOAT32 qmf_buf_real[][64], FLOAT32 qmf_buf_imag[][64]) {
  269|  19.0k|  WORD32 idx;
  270|       |
  271|  19.0k|  WORD32 anal_size = ptr_hbe_txposer->analy_size;
  272|       |
  273|  19.0k|  WORD32 N = (10 * ptr_hbe_txposer->analy_size);
  274|       |
  275|  19.0k|  idx = 0;
  276|   630k|  while (idx < ptr_hbe_txposer->no_bins) {
  ------------------
  |  Branch (276:10): [True: 611k, False: 19.0k]
  ------------------
  277|   611k|    WORD32 i, j, k, l;
  278|   611k|    FLOAT32 window_output[640] = {0};
  279|   611k|    FLOAT32 u[128] = {0};
  280|   611k|    FLOAT32 accu_r, accu_i;
  281|   611k|    const FLOAT32 *ptr_inp_signal;
  282|   611k|    FLOAT32 *ptr_qmf_buf_r = &qmf_buf_real[idx][ptr_hbe_txposer->a_start];
  283|   611k|    FLOAT32 *ptr_qmf_buf_i = &qmf_buf_imag[idx][ptr_hbe_txposer->a_start];
  284|       |
  285|   611k|    const FLOAT32 *ptr_interp_window_coeff = ptr_hbe_txposer->ptr_ana_win_coeff;
  286|   611k|    FLOAT32 *ptr_x = ptr_hbe_txposer->analy_buf;
  287|       |
  288|   611k|    memset(&qmf_buf_real[idx][ptr_hbe_txposer->a_start], 0,
  289|   611k|           (IXHEAACE_NUM_QMF_SYNTH_CHANNELS - ptr_hbe_txposer->a_start) *
  ------------------
  |  |   33|   611k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  ------------------
  290|   611k|               sizeof(qmf_buf_real[idx][ptr_hbe_txposer->a_start]));
  291|   611k|    memset(&qmf_buf_imag[idx][ptr_hbe_txposer->a_start], 0,
  292|   611k|           IXHEAACE_TWICE_QMF_SYNTH_CH_NUM * sizeof(qmf_buf_imag[idx][ptr_hbe_txposer->a_start]));
  ------------------
  |  |   34|   611k|#define IXHEAACE_TWICE_QMF_SYNTH_CH_NUM (128)
  ------------------
  293|       |
  294|   611k|    ptr_inp_signal = ptr_hbe_txposer->ptr_output_buf + idx * ptr_hbe_txposer->analy_size + 1;
  295|       |
  296|   172M|    for (i = N - 1; i >= anal_size; i--) {
  ------------------
  |  Branch (296:21): [True: 172M, False: 611k]
  ------------------
  297|   172M|      ptr_x[i] = ptr_x[i - anal_size];
  298|   172M|    }
  299|       |
  300|  19.7M|    for (i = anal_size - 1; i >= 0; i--) {
  ------------------
  |  Branch (300:29): [True: 19.1M, False: 611k]
  ------------------
  301|  19.1M|      ptr_x[i] = ptr_inp_signal[anal_size - 1 - i];
  302|  19.1M|    }
  303|       |
  304|   191M|    for (i = 0; i < N; i++) {
  ------------------
  |  Branch (304:17): [True: 191M, False: 611k]
  ------------------
  305|   191M|      window_output[i] = ptr_x[i] * ptr_interp_window_coeff[i];
  306|   191M|    }
  307|       |
  308|  38.8M|    for (i = 0; i < 2 * anal_size; i++) {
  ------------------
  |  Branch (308:17): [True: 38.2M, False: 611k]
  ------------------
  309|  38.2M|      accu_r = 0.0;
  310|   229M|      for (j = 0; j < 5; j++) {
  ------------------
  |  Branch (310:19): [True: 191M, False: 38.2M]
  ------------------
  311|   191M|        accu_r = accu_r + window_output[i + j * 2 * anal_size];
  312|   191M|      }
  313|  38.2M|      u[i] = accu_r;
  314|  38.2M|    }
  315|       |
  316|  19.7M|    for (k = 0; k < anal_size; k++) {
  ------------------
  |  Branch (316:17): [True: 19.1M, False: 611k]
  ------------------
  317|  19.1M|      accu_r = 0;
  318|  19.1M|      accu_i = 0;
  319|  1.22G|      for (l = 0; l < 2 * anal_size; l++) {
  ------------------
  |  Branch (319:19): [True: 1.20G, False: 19.1M]
  ------------------
  320|  1.20G|        accu_r = accu_r + u[l] * ptr_hbe_txposer->str_dft_hbe_anal_coeff.real[k][l];
  321|  1.20G|        accu_i = accu_i + u[l] * ptr_hbe_txposer->str_dft_hbe_anal_coeff.imag[k][l];
  322|  1.20G|      }
  323|  19.1M|      ptr_qmf_buf_r[k] = (FLOAT32)accu_r;
  324|  19.1M|      ptr_qmf_buf_i[k] = (FLOAT32)accu_i;
  325|  19.1M|    }
  326|       |
  327|   611k|    idx++;
  328|   611k|  }
  329|  19.0k|}

ixheaace_qmf_hbe_data_reinit:
   69|  20.3k|IA_ERRORCODE ixheaace_qmf_hbe_data_reinit(ixheaace_str_esbr_hbe_txposer *pstr_hbe_txposer) {
   70|  20.3k|  WORD32 synth_size, sfb, patch, stop_patch;
   71|  20.3k|  WORD32 upsamp_4_flag = 0;
   72|       |
   73|  20.3k|  if (pstr_hbe_txposer != NULL) {
  ------------------
  |  Branch (73:7): [True: 20.3k, False: 0]
  ------------------
   74|  20.3k|    pstr_hbe_txposer->start_band = pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][0];
  ------------------
  |  |   69|  20.3k|#define IXHEAACE_LOW (0)
  ------------------
   75|  20.3k|    pstr_hbe_txposer->end_band =
   76|  20.3k|        pstr_hbe_txposer
   77|  20.3k|            ->ptr_freq_band_tab[IXHEAACE_LOW][pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]];
  ------------------
  |  |   69|  20.3k|#define IXHEAACE_LOW (0)
  ------------------
                          ->ptr_freq_band_tab[IXHEAACE_LOW][pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]];
  ------------------
  |  |   69|  20.3k|#define IXHEAACE_LOW (0)
  ------------------
   78|       |
   79|  20.3k|    pstr_hbe_txposer->synth_size = 4 * ((pstr_hbe_txposer->start_band + 4) / 8 + 1);
   80|  20.3k|    pstr_hbe_txposer->k_start = ixheaac_start_subband2kL_tbl[pstr_hbe_txposer->start_band];
   81|       |
   82|  20.3k|    upsamp_4_flag = pstr_hbe_txposer->upsamp_4_flag;
   83|  20.3k|    pstr_hbe_txposer->esbr_hq = 0;
   84|       |
   85|  20.3k|    if (upsamp_4_flag) {
  ------------------
  |  Branch (85:9): [True: 597, False: 19.7k]
  ------------------
   86|    597|      if (pstr_hbe_txposer->k_start + pstr_hbe_txposer->synth_size > 16)
  ------------------
  |  Branch (86:11): [True: 4, False: 593]
  ------------------
   87|      4|        pstr_hbe_txposer->k_start = 16 - pstr_hbe_txposer->synth_size;
   88|  19.7k|    } else if (pstr_hbe_txposer->core_frame_length == 768) {
  ------------------
  |  Branch (88:16): [True: 0, False: 19.7k]
  ------------------
   89|      0|      if (pstr_hbe_txposer->k_start + pstr_hbe_txposer->synth_size > 24)
  ------------------
  |  Branch (89:11): [True: 0, False: 0]
  ------------------
   90|      0|        pstr_hbe_txposer->k_start = 24 - pstr_hbe_txposer->synth_size;
   91|      0|    }
   92|  20.3k|    memset(pstr_hbe_txposer->synth_buf, 0, sizeof(pstr_hbe_txposer->synth_buf));
   93|  20.3k|    synth_size = pstr_hbe_txposer->synth_size;
   94|  20.3k|    pstr_hbe_txposer->synth_buf_offset = 18 * synth_size;
   95|  20.3k|    switch (synth_size) {
   96|      0|      case 4:
  ------------------
  |  Branch (96:7): [True: 0, False: 20.3k]
  ------------------
   97|      0|        pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_4;
   98|      0|        pstr_hbe_txposer->ptr_analy_cos_sin_tab = (FLOAT32 *)ixheaac_analy_cos_sin_table_kl_8;
   99|      0|        pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  100|      0|        pstr_hbe_txposer->ixheaace_cmplx_anal_fft = &ixheaac_cmplx_anal_fft_p2;
  101|      0|        break;
  102|      0|      case 8:
  ------------------
  |  Branch (102:7): [True: 0, False: 20.3k]
  ------------------
  103|      0|        pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_8;
  104|      0|        pstr_hbe_txposer->ptr_analy_cos_sin_tab = (FLOAT32 *)ixheaac_analy_cos_sin_table_kl_16;
  105|      0|        pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  106|      0|        pstr_hbe_txposer->ixheaace_cmplx_anal_fft = &ixheaac_cmplx_anal_fft_p2;
  107|      0|        break;
  108|    858|      case 12:
  ------------------
  |  Branch (108:7): [True: 858, False: 19.5k]
  ------------------
  109|    858|        pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_12;
  110|    858|        pstr_hbe_txposer->ptr_analy_cos_sin_tab = (FLOAT32 *)ixheaac_analy_cos_sin_table_kl_24;
  111|    858|        pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p3;
  112|    858|        pstr_hbe_txposer->ixheaace_cmplx_anal_fft = &ixheaac_cmplx_anal_fft_p3;
  113|    858|        break;
  114|    858|      case 16:
  ------------------
  |  Branch (114:7): [True: 858, False: 19.5k]
  ------------------
  115|    858|        pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_16;
  116|    858|        pstr_hbe_txposer->ptr_analy_cos_sin_tab = (FLOAT32 *)ixheaac_analy_cos_sin_table_kl_32;
  117|    858|        pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  118|    858|        pstr_hbe_txposer->ixheaace_cmplx_anal_fft = &ixheaac_cmplx_anal_fft_p2;
  119|    858|        break;
  120|  18.6k|      case 20:
  ------------------
  |  Branch (120:7): [True: 18.6k, False: 1.71k]
  ------------------
  121|  18.6k|        pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_20;
  122|  18.6k|        pstr_hbe_txposer->ptr_analy_cos_sin_tab = (FLOAT32 *)ixheaac_analy_cos_sin_table_kl_40;
  123|  18.6k|        break;
  124|      0|      default:
  ------------------
  |  Branch (124:7): [True: 0, False: 20.3k]
  ------------------
  125|      0|        pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_4;
  126|      0|        pstr_hbe_txposer->ptr_analy_cos_sin_tab = (FLOAT32 *)ixheaac_analy_cos_sin_table_kl_8;
  127|      0|        pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  128|      0|        pstr_hbe_txposer->ixheaace_cmplx_anal_fft = &ixheaac_cmplx_anal_fft_p2;
  129|  20.3k|    }
  130|       |
  131|  20.3k|    pstr_hbe_txposer->ptr_syn_win_coeff = ixheaace_map_prot_filter(synth_size);
  132|       |
  133|  20.3k|    memset(pstr_hbe_txposer->analy_buf, 0, sizeof(pstr_hbe_txposer->analy_buf));
  134|  20.3k|    synth_size = 2 * pstr_hbe_txposer->synth_size;
  135|  20.3k|    pstr_hbe_txposer->ptr_ana_win_coeff = ixheaace_map_prot_filter(synth_size);
  136|       |
  137|  20.3k|    memset(pstr_hbe_txposer->x_over_qmf, 0, sizeof(pstr_hbe_txposer->x_over_qmf));
  138|  20.3k|    sfb = 0;
  139|  20.3k|    if (upsamp_4_flag) {
  ------------------
  |  Branch (139:9): [True: 597, False: 19.7k]
  ------------------
  140|    597|      stop_patch = IXHEAACE_MAX_NUM_PATCHES;
  ------------------
  |  |   26|    597|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  141|    597|      pstr_hbe_txposer->max_stretch = IXHEAACE_MAX_STRETCH;
  ------------------
  |  |   27|    597|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  142|  19.7k|    } else {
  143|  19.7k|      stop_patch = IXHEAACE_MAX_STRETCH;
  ------------------
  |  |   27|  19.7k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  144|  19.7k|    }
  145|       |
  146|  57.5k|    for (patch = 1; patch <= stop_patch; patch++) {
  ------------------
  |  Branch (146:21): [True: 57.5k, False: 0]
  ------------------
  147|   186k|      while (sfb <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW] &&
  ------------------
  |  |   69|   186k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (147:14): [True: 165k, False: 20.3k]
  ------------------
  148|   165k|             pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb] <=
  ------------------
  |  |   69|   165k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (148:14): [True: 128k, False: 37.1k]
  ------------------
  149|   165k|                 patch * pstr_hbe_txposer->start_band)
  150|   128k|        sfb++;
  151|  57.5k|      if (sfb <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]) {
  ------------------
  |  |   69|  57.5k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (151:11): [True: 37.1k, False: 20.3k]
  ------------------
  152|  37.1k|        if ((patch * pstr_hbe_txposer->start_band -
  ------------------
  |  Branch (152:13): [True: 22.2k, False: 14.8k]
  ------------------
  153|  37.1k|             pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1]) <= 3) {
  ------------------
  |  |   69|  37.1k|#define IXHEAACE_LOW (0)
  ------------------
  154|  22.2k|          pstr_hbe_txposer->x_over_qmf[patch - 1] =
  155|  22.2k|              pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1];
  ------------------
  |  |   69|  22.2k|#define IXHEAACE_LOW (0)
  ------------------
  156|  22.2k|        } else {
  157|  14.8k|          WORD32 sfb_idx = 0;
  158|   162k|          while (sfb_idx <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_HIGH] &&
  ------------------
  |  |   70|   162k|#define IXHEAACE_HIGH (1)
  ------------------
  |  Branch (158:18): [True: 162k, False: 0]
  ------------------
  159|   162k|                 pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx] <=
  ------------------
  |  |   70|   162k|#define IXHEAACE_HIGH (1)
  ------------------
  |  Branch (159:18): [True: 147k, False: 14.8k]
  ------------------
  160|   162k|                     patch * pstr_hbe_txposer->start_band)
  161|   147k|            sfb_idx++;
  162|  14.8k|          pstr_hbe_txposer->x_over_qmf[patch - 1] =
  163|  14.8k|              pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1];
  ------------------
  |  |   70|  14.8k|#define IXHEAACE_HIGH (1)
  ------------------
  164|  14.8k|        }
  165|  37.1k|      } else {
  166|  20.3k|        pstr_hbe_txposer->x_over_qmf[patch - 1] = pstr_hbe_txposer->end_band;
  167|  20.3k|        pstr_hbe_txposer->max_stretch = min(patch, IXHEAACE_MAX_STRETCH);
  ------------------
  |  |   75|  20.3k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 19.7k, False: 593]
  |  |  ------------------
  ------------------
  168|  20.3k|        break;
  169|  20.3k|      }
  170|  57.5k|    }
  171|  20.3k|    if (pstr_hbe_txposer->k_start < 0) {
  ------------------
  |  Branch (171:9): [True: 0, False: 20.3k]
  ------------------
  172|      0|      return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_START_BAND;
  173|      0|    }
  174|  20.3k|  }
  175|  20.3k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  20.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  176|  20.3k|}
ixheaace_qmf_hbe_apply:
  181|   126k|                                    FLOAT32 pv_qmf_buf_imag[][64], WORD32 pitch_in_bins) {
  182|   126k|  WORD32 i, qmf_band_idx;
  183|   126k|  WORD32 qmf_voc_columns = pstr_hbe_txposer->no_bins / 2;
  184|   126k|  WORD32 err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   126k|#define IA_NO_ERROR 0x00000000
  ------------------
  185|       |
  186|   126k|  memcpy(
  187|   126k|      pstr_hbe_txposer->ptr_input_buf,
  188|   126k|      pstr_hbe_txposer->ptr_input_buf + pstr_hbe_txposer->no_bins * pstr_hbe_txposer->synth_size,
  189|   126k|      pstr_hbe_txposer->synth_size * sizeof(pstr_hbe_txposer->ptr_input_buf[0]));
  190|       |
  191|   126k|  if (pstr_hbe_txposer->ixheaace_cmplx_anal_fft == NULL) {
  ------------------
  |  Branch (191:7): [True: 18.2k, False: 108k]
  ------------------
  192|  18.2k|    err_code = ixheaace_qmf_hbe_data_reinit(pstr_hbe_txposer);
  193|  18.2k|    if (err_code) {
  ------------------
  |  Branch (193:9): [True: 0, False: 18.2k]
  ------------------
  194|      0|      return err_code;
  195|      0|    }
  196|  18.2k|  }
  197|       |
  198|   126k|  err_code = ixheaace_real_synth_filt(pstr_hbe_txposer, num_columns, qmf_buf_real, qmf_buf_imag);
  199|   126k|  if (err_code) {
  ------------------
  |  Branch (199:7): [True: 0, False: 126k]
  ------------------
  200|      0|    return err_code;
  201|      0|  }
  202|       |
  203|  1.64M|  for (i = 0; i < IXHEAACE_HBE_OPER_WIN_LEN - 1; i++) {
  ------------------
  |  |   32|  1.64M|#define IXHEAACE_HBE_OPER_WIN_LEN (13)
  ------------------
  |  Branch (203:15): [True: 1.51M, False: 126k]
  ------------------
  204|  1.51M|    memcpy(pstr_hbe_txposer->qmf_in_buf[i], pstr_hbe_txposer->qmf_in_buf[i + qmf_voc_columns],
  205|  1.51M|           sizeof(pstr_hbe_txposer->qmf_in_buf[i]));
  206|  1.51M|  }
  207|       |
  208|   126k|  err_code = ixheaace_complex_anal_filt(pstr_hbe_txposer);
  209|   126k|  if (err_code) {
  ------------------
  |  Branch (209:7): [True: 0, False: 126k]
  ------------------
  210|      0|    return err_code;
  211|      0|  }
  212|       |
  213|  5.63M|  for (i = 0; i < (pstr_hbe_txposer->hbe_qmf_out_len - pstr_hbe_txposer->no_bins); i++) {
  ------------------
  |  Branch (213:15): [True: 5.50M, False: 126k]
  ------------------
  214|  5.50M|    memcpy(pstr_hbe_txposer->qmf_out_buf[i],
  215|  5.50M|           pstr_hbe_txposer->qmf_out_buf[i + pstr_hbe_txposer->no_bins],
  216|  5.50M|           sizeof(pstr_hbe_txposer->qmf_out_buf[i]));
  217|  5.50M|  }
  218|       |
  219|  5.63M|  for (; i < pstr_hbe_txposer->hbe_qmf_out_len; i++) {
  ------------------
  |  Branch (219:10): [True: 5.50M, False: 126k]
  ------------------
  220|  5.50M|    memset(pstr_hbe_txposer->qmf_out_buf[i], 0, sizeof(pstr_hbe_txposer->qmf_out_buf[i]));
  221|  5.50M|  }
  222|       |
  223|   126k|  err_code = ixheaace_hbe_post_anal_process(pstr_hbe_txposer, pitch_in_bins,
  224|   126k|                                            pstr_hbe_txposer->upsamp_4_flag);
  225|   126k|  if (err_code) {
  ------------------
  |  Branch (225:7): [True: 0, False: 126k]
  ------------------
  226|      0|    return err_code;
  227|      0|  }
  228|   126k|  i = 0;
  229|  5.63M|  while (i < pstr_hbe_txposer->no_bins) {
  ------------------
  |  Branch (229:10): [True: 5.50M, False: 126k]
  ------------------
  230|   194M|    for (qmf_band_idx = pstr_hbe_txposer->start_band; qmf_band_idx < pstr_hbe_txposer->end_band;
  ------------------
  |  Branch (230:55): [True: 188M, False: 5.50M]
  ------------------
  231|   188M|         qmf_band_idx++) {
  232|   188M|      pv_qmf_buf_real[i][qmf_band_idx] =
  233|   188M|          (FLOAT32)(pstr_hbe_txposer->qmf_out_buf[i][2 * qmf_band_idx] *
  234|   188M|                        ixheaac_phase_vocoder_cos_table[qmf_band_idx] -
  235|   188M|                    pstr_hbe_txposer->qmf_out_buf[i][2 * qmf_band_idx + 1] *
  236|   188M|                        ixheaac_phase_vocoder_sin_table[qmf_band_idx]);
  237|       |
  238|   188M|      pv_qmf_buf_imag[i][qmf_band_idx] =
  239|   188M|          (FLOAT32)(pstr_hbe_txposer->qmf_out_buf[i][2 * qmf_band_idx] *
  240|   188M|                        ixheaac_phase_vocoder_sin_table[qmf_band_idx] +
  241|   188M|                    pstr_hbe_txposer->qmf_out_buf[i][2 * qmf_band_idx + 1] *
  242|   188M|                        ixheaac_phase_vocoder_cos_table[qmf_band_idx]);
  243|   188M|    }
  244|  5.50M|    i++;
  245|  5.50M|  }
  246|   126k|  return err_code;
  247|   126k|}
ixheaace_norm_qmf_in_buf_4:
  250|  45.5k|                                WORD32 qmf_band_idx) {
  251|  45.5k|  WORD32 i;
  252|  45.5k|  FLOAT32 *ptr_in_buf = &pstr_hbe_txposer->qmf_in_buf[0][2 * qmf_band_idx];
  253|  45.5k|  FLOAT32 *ptr_norm_buf = &pstr_hbe_txposer->norm_qmf_in_buf[0][2 * qmf_band_idx];
  254|       |
  255|  1.57M|  for (; qmf_band_idx <= pstr_hbe_txposer->x_over_qmf[3]; qmf_band_idx++) {
  ------------------
  |  Branch (255:10): [True: 1.52M, False: 45.5k]
  ------------------
  256|  99.1M|    for (i = 0; i < pstr_hbe_txposer->hbe_qmf_in_len; i++) {
  ------------------
  |  Branch (256:17): [True: 97.6M, False: 1.52M]
  ------------------
  257|  97.6M|      FLOAT32 mag_scaling_fac = 0.0f;
  258|  97.6M|      FLOAT32 x_r, x_i, temp;
  259|  97.6M|      FLOAT64 base = 1e-17;
  260|  97.6M|      x_r = ptr_in_buf[0];
  261|  97.6M|      x_i = ptr_in_buf[1];
  262|       |
  263|  97.6M|      temp = x_r * x_r;
  264|  97.6M|      base = base + temp;
  265|  97.6M|      temp = x_i * x_i;
  266|  97.6M|      base = base + temp;
  267|       |
  268|  97.6M|      temp = (FLOAT32)sqrt(sqrt(base));
  269|  97.6M|      mag_scaling_fac = temp * (FLOAT32)(sqrt(temp));
  270|       |
  271|  97.6M|      mag_scaling_fac = 1 / mag_scaling_fac;
  272|       |
  273|  97.6M|      x_r *= mag_scaling_fac;
  274|  97.6M|      x_i *= mag_scaling_fac;
  275|       |
  276|  97.6M|      ptr_norm_buf[0] = x_r;
  277|  97.6M|      ptr_norm_buf[1] = x_i;
  278|       |
  279|  97.6M|      ptr_in_buf += 128;
  280|  97.6M|      ptr_norm_buf += 128;
  281|  97.6M|    }
  282|       |
  283|  1.52M|    ptr_in_buf -= (128 * (pstr_hbe_txposer->hbe_qmf_in_len) - 2);
  284|  1.52M|    ptr_norm_buf -= (128 * (pstr_hbe_txposer->hbe_qmf_in_len) - 2);
  285|  1.52M|  }
  286|  45.5k|}
ixheaace_norm_qmf_in_buf_2:
  289|   126k|                                WORD32 qmf_band_idx) {
  290|   126k|  WORD32 i;
  291|   126k|  FLOAT32 *ptr_in_buf = &pstr_hbe_txposer->qmf_in_buf[0][2 * qmf_band_idx];
  292|   126k|  FLOAT32 *ptr_norm_buf = &pstr_hbe_txposer->norm_qmf_in_buf[0][2 * qmf_band_idx];
  293|       |
  294|  2.83M|  for (; qmf_band_idx <= pstr_hbe_txposer->x_over_qmf[1]; qmf_band_idx++) {
  ------------------
  |  Branch (294:10): [True: 2.71M, False: 126k]
  ------------------
  295|   111M|    for (i = 0; i < pstr_hbe_txposer->hbe_qmf_in_len; i++) {
  ------------------
  |  Branch (295:17): [True: 108M, False: 2.71M]
  ------------------
  296|   108M|      FLOAT32 mag_scaling_fac = 0.0f;
  297|   108M|      FLOAT32 x_r, x_i, temp;
  298|   108M|      FLOAT64 base = 1e-17;
  299|   108M|      x_r = ptr_in_buf[0];
  300|   108M|      x_i = ptr_in_buf[1];
  301|       |
  302|   108M|      temp = x_r * x_r;
  303|   108M|      base = base + temp;
  304|   108M|      base = base + x_i * x_i;
  305|       |
  306|   108M|      mag_scaling_fac = (FLOAT32)(1.0f / base);
  307|   108M|      mag_scaling_fac = (FLOAT32)sqrt(sqrt(mag_scaling_fac));
  308|       |
  309|   108M|      x_r *= mag_scaling_fac;
  310|   108M|      x_i *= mag_scaling_fac;
  311|       |
  312|   108M|      ptr_norm_buf[0] = x_r;
  313|   108M|      ptr_norm_buf[1] = x_i;
  314|       |
  315|   108M|      ptr_in_buf += 128;
  316|   108M|      ptr_norm_buf += 128;
  317|   108M|    }
  318|       |
  319|  2.71M|    ptr_in_buf -= (128 * (pstr_hbe_txposer->hbe_qmf_in_len) - 2);
  320|  2.71M|    ptr_norm_buf -= (128 * (pstr_hbe_txposer->hbe_qmf_in_len) - 2);
  321|  2.71M|  }
  322|   126k|}
ixheaace_hbe_xprod_proc_3:
  326|  6.61M|                               WORD32 pitch_in_bins_idx) {
  327|  6.61M|  WORD32 tr, n1, n2, max_trans_fac, max_n1, max_n2;
  328|  6.61M|  WORD32 k, addrshift;
  329|  6.61M|  WORD32 inp_band_idx = 2 * qmf_band_idx / 3;
  330|       |
  331|  6.61M|  FLOAT64 temp_fac;
  332|  6.61M|  FLOAT32 max_mag_value;
  333|  6.61M|  FLOAT32 mag_zero_band, mag_n1_band, mag_n2_band, temp;
  334|  6.61M|  FLOAT32 temp_r, temp_i;
  335|  6.61M|  FLOAT32 mag_cmplx_gain = 1.8856f;
  336|       |
  337|  6.61M|  FLOAT32 *ptr_qmf_in_buf_ri =
  338|  6.61M|      pstr_hbe_txposer->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX];
  ------------------
  |  |   35|  6.61M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  339|       |
  340|  6.61M|  mag_zero_band =
  341|  6.61M|      ptr_qmf_in_buf_ri[2 * inp_band_idx] * ptr_qmf_in_buf_ri[2 * inp_band_idx] +
  342|  6.61M|      ptr_qmf_in_buf_ri[2 * inp_band_idx + 1] * ptr_qmf_in_buf_ri[2 * inp_band_idx + 1];
  343|  6.61M|  max_mag_value = 0;
  344|  6.61M|  max_n1 = max_n2 = max_trans_fac = 0;
  345|       |
  346|  19.8M|  for (tr = 1; tr < 3; tr++) {
  ------------------
  |  Branch (346:16): [True: 13.2M, False: 6.61M]
  ------------------
  347|  13.2M|    temp_fac = (2.0f * qmf_band_idx + 1 - tr * p) * 0.3333334;
  348|       |
  349|  13.2M|    n1 = (WORD32)(temp_fac);
  350|  13.2M|    n2 = (WORD32)(temp_fac + p);
  351|       |
  352|  13.2M|    mag_n1_band = ptr_qmf_in_buf_ri[2 * n1] * ptr_qmf_in_buf_ri[2 * n1] +
  353|  13.2M|                  ptr_qmf_in_buf_ri[2 * n1 + 1] * ptr_qmf_in_buf_ri[2 * n1 + 1];
  354|  13.2M|    mag_n2_band = ptr_qmf_in_buf_ri[2 * n2] * ptr_qmf_in_buf_ri[2 * n2] +
  355|  13.2M|                  ptr_qmf_in_buf_ri[2 * n2 + 1] * ptr_qmf_in_buf_ri[2 * n2 + 1];
  356|  13.2M|    temp = min(mag_n1_band, mag_n2_band);
  ------------------
  |  |   75|  13.2M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 5.40M, False: 7.82M]
  |  |  ------------------
  ------------------
  357|       |
  358|  13.2M|    if (temp > max_mag_value) {
  ------------------
  |  Branch (358:9): [True: 7.90M, False: 5.33M]
  ------------------
  359|  7.90M|      max_mag_value = temp;
  360|  7.90M|      max_trans_fac = tr;
  361|  7.90M|      max_n1 = n1;
  362|  7.90M|      max_n2 = n2;
  363|  7.90M|    }
  364|  13.2M|  }
  365|       |
  366|  6.61M|  if ((max_mag_value > mag_zero_band && max_n1 >= 0) &&
  ------------------
  |  Branch (366:8): [True: 584k, False: 6.03M]
  |  Branch (366:41): [True: 584k, False: 0]
  ------------------
  367|   584k|      (max_n2 < IXHEAACE_NUM_QMF_SYNTH_CHANNELS)) {
  ------------------
  |  |   33|   584k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  ------------------
  |  Branch (367:7): [True: 584k, False: 0]
  ------------------
  368|   584k|    FLOAT32 vec_y_r[2], vec_y_i[2], vec_o_r[2], vec_o_i[2];
  369|   584k|    FLOAT32 coeff_real[2], coeff_imag[2];
  370|   584k|    FLOAT32 d1, d2;
  371|   584k|    WORD32 mid_trans_fac, idx;
  372|   584k|    FLOAT64 base = 1e-17;
  373|   584k|    FLOAT32 mag_scaling_fac = 0;
  374|   584k|    FLOAT32 x_zero_band_r;
  375|   584k|    FLOAT32 x_zero_band_i;
  376|       |
  377|   584k|    mid_trans_fac = 3 - max_trans_fac;
  378|   584k|    if (max_trans_fac == 1) {
  ------------------
  |  Branch (378:9): [True: 278k, False: 306k]
  ------------------
  379|   278k|      d1 = 0;
  380|   278k|      d2 = 1.5;
  381|   278k|      x_zero_band_r = ptr_qmf_in_buf_ri[2 * max_n1];
  382|   278k|      x_zero_band_i = ptr_qmf_in_buf_ri[2 * max_n1 + 1];
  383|       |
  384|   278k|      idx = max_n2 & 3;
  385|   278k|      idx = (idx + 1) & 3;
  386|   278k|      coeff_real[0] = ixheaac_hbe_post_anal_proc_interp_coeff[idx][0];
  387|   278k|      coeff_imag[0] = ixheaac_hbe_post_anal_proc_interp_coeff[idx][1];
  388|       |
  389|   278k|      coeff_real[1] = coeff_real[0];
  390|   278k|      coeff_imag[1] = -coeff_imag[0];
  391|       |
  392|   278k|      vec_y_r[1] = ptr_qmf_in_buf_ri[2 * max_n2];
  393|   278k|      vec_y_i[1] = ptr_qmf_in_buf_ri[2 * max_n2 + 1];
  394|       |
  395|   278k|      addrshift = -2;
  396|   278k|      temp_r = pstr_hbe_txposer
  397|   278k|                   ->qmf_in_buf[qmf_col_idx + addrshift + IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n2];
  ------------------
  |  |   35|   278k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  398|   278k|      temp_i =
  399|   278k|          pstr_hbe_txposer
  400|   278k|              ->qmf_in_buf[qmf_col_idx + addrshift + IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n2 + 1];
  ------------------
  |  |   35|   278k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  401|       |
  402|   278k|      vec_y_r[0] = coeff_real[1] * temp_r - coeff_imag[1] * temp_i;
  403|   278k|      vec_y_i[0] = coeff_imag[1] * temp_r + coeff_real[1] * temp_i;
  404|       |
  405|   278k|      temp_r =
  406|   278k|          pstr_hbe_txposer
  407|   278k|              ->qmf_in_buf[qmf_col_idx + addrshift + 1 + IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n2];
  ------------------
  |  |   35|   278k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  408|   278k|      temp_i = pstr_hbe_txposer->qmf_in_buf[qmf_col_idx + addrshift + 1 +
  409|   278k|                                            IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n2 + 1];
  ------------------
  |  |   35|   278k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  410|       |
  411|   278k|      vec_y_r[0] += coeff_real[0] * temp_r - coeff_imag[0] * temp_i;
  412|   278k|      vec_y_i[0] += coeff_imag[0] * temp_r + coeff_real[0] * temp_i;
  413|   306k|    } else {
  414|   306k|      d1 = 1.5;
  415|   306k|      d2 = 0;
  416|   306k|      mid_trans_fac = max_trans_fac;
  417|   306k|      max_trans_fac = 3 - max_trans_fac;
  418|       |
  419|   306k|      x_zero_band_r = ptr_qmf_in_buf_ri[2 * max_n2];
  420|   306k|      x_zero_band_i = ptr_qmf_in_buf_ri[2 * max_n2 + 1];
  421|       |
  422|   306k|      idx = (max_n1 & 3);
  423|   306k|      idx = (idx + 1) & 3;
  424|   306k|      coeff_real[0] = ixheaac_hbe_post_anal_proc_interp_coeff[idx][0];
  425|   306k|      coeff_imag[0] = ixheaac_hbe_post_anal_proc_interp_coeff[idx][1];
  426|       |
  427|   306k|      coeff_real[1] = coeff_real[0];
  428|   306k|      coeff_imag[1] = -coeff_imag[0];
  429|       |
  430|   306k|      vec_y_r[1] = ptr_qmf_in_buf_ri[2 * max_n1];
  431|   306k|      vec_y_i[1] = ptr_qmf_in_buf_ri[2 * max_n1 + 1];
  432|       |
  433|   306k|      addrshift = -2;
  434|       |
  435|   306k|      temp_r = pstr_hbe_txposer
  436|   306k|                   ->qmf_in_buf[qmf_col_idx + addrshift + IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n1];
  ------------------
  |  |   35|   306k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  437|   306k|      temp_i =
  438|   306k|          pstr_hbe_txposer
  439|   306k|              ->qmf_in_buf[qmf_col_idx + addrshift + IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n1 + 1];
  ------------------
  |  |   35|   306k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  440|       |
  441|   306k|      vec_y_r[0] = coeff_real[1] * temp_r - coeff_imag[1] * temp_i;
  442|   306k|      vec_y_i[0] = coeff_imag[1] * temp_r + coeff_real[1] * temp_i;
  443|       |
  444|   306k|      temp_r =
  445|   306k|          pstr_hbe_txposer
  446|   306k|              ->qmf_in_buf[qmf_col_idx + addrshift + 1 + IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n1];
  ------------------
  |  |   35|   306k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  447|   306k|      temp_i = pstr_hbe_txposer->qmf_in_buf[qmf_col_idx + addrshift + 1 +
  448|   306k|                                            IXHEAACE_HBE_ZERO_BAND_IDX][2 * max_n1 + 1];
  ------------------
  |  |   35|   306k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  449|       |
  450|   306k|      vec_y_r[0] += coeff_real[0] * temp_r - coeff_imag[0] * temp_i;
  451|   306k|      vec_y_i[0] += coeff_imag[0] * temp_r + coeff_real[0] * temp_i;
  452|   306k|    }
  453|       |
  454|   584k|    base = 1e-17;
  455|   584k|    base = base + x_zero_band_r * x_zero_band_r;
  456|   584k|    base = base + x_zero_band_i * x_zero_band_i;
  457|   584k|    mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base));
  ------------------
  |  |   74|   584k|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  458|   584k|    x_zero_band_r *= mag_scaling_fac;
  459|   584k|    x_zero_band_i *= mag_scaling_fac;
  460|  1.75M|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (460:17): [True: 1.16M, False: 584k]
  ------------------
  461|  1.16M|      base = 1e-17;
  462|  1.16M|      base = base + vec_y_r[k] * vec_y_r[k];
  463|  1.16M|      base = base + vec_y_i[k] * vec_y_i[k];
  464|  1.16M|      mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base));
  ------------------
  |  |   74|  1.16M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  465|  1.16M|      vec_y_r[k] *= mag_scaling_fac;
  466|  1.16M|      vec_y_i[k] *= mag_scaling_fac;
  467|  1.16M|    }
  468|       |
  469|   584k|    temp_r = x_zero_band_r;
  470|   584k|    temp_i = x_zero_band_i;
  471|  1.16M|    for (idx = 0; idx < mid_trans_fac - 1; idx++) {
  ------------------
  |  Branch (471:19): [True: 584k, False: 584k]
  ------------------
  472|   584k|      FLOAT32 tmp = x_zero_band_r;
  473|   584k|      x_zero_band_r = x_zero_band_r * temp_r - x_zero_band_i * temp_i;
  474|   584k|      x_zero_band_i = tmp * temp_i + x_zero_band_i * temp_r;
  475|   584k|    }
  476|       |
  477|  1.75M|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (477:17): [True: 1.16M, False: 584k]
  ------------------
  478|  1.16M|      temp_r = vec_y_r[k];
  479|  1.16M|      temp_i = vec_y_i[k];
  480|  1.16M|      for (idx = 0; idx < max_trans_fac - 1; idx++) {
  ------------------
  |  Branch (480:21): [True: 0, False: 1.16M]
  ------------------
  481|      0|        FLOAT32 tmp = vec_y_r[k];
  482|      0|        vec_y_r[k] = vec_y_r[k] * temp_r - vec_y_i[k] * temp_i;
  483|      0|        vec_y_i[k] = tmp * temp_i + vec_y_i[k] * temp_r;
  484|      0|      }
  485|  1.16M|    }
  486|       |
  487|  1.75M|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (487:17): [True: 1.16M, False: 584k]
  ------------------
  488|  1.16M|      vec_o_r[k] = vec_y_r[k] * x_zero_band_r - vec_y_i[k] * x_zero_band_i;
  489|  1.16M|      vec_o_i[k] = vec_y_r[k] * x_zero_band_i + vec_y_i[k] * x_zero_band_r;
  490|  1.16M|    }
  491|       |
  492|   584k|    {
  493|   584k|      FLOAT32 cos_theta = ixheaac_hbe_x_prod_cos_table_trans_3[(pitch_in_bins_idx << 1) + 0];
  494|   584k|      FLOAT32 sin_theta = ixheaac_hbe_x_prod_cos_table_trans_3[(pitch_in_bins_idx << 1) + 1];
  495|   584k|      if (d2 < d1) {
  ------------------
  |  Branch (495:11): [True: 306k, False: 278k]
  ------------------
  496|   306k|        sin_theta = -sin_theta;
  497|   306k|      }
  498|   584k|      temp_r = vec_o_r[0];
  499|   584k|      temp_i = vec_o_i[0];
  500|   584k|      vec_o_r[0] = (FLOAT32)(cos_theta * temp_r - sin_theta * temp_i);
  501|   584k|      vec_o_i[0] = (FLOAT32)(cos_theta * temp_i + sin_theta * temp_r);
  502|   584k|    }
  503|       |
  504|  1.75M|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (504:17): [True: 1.16M, False: 584k]
  ------------------
  505|  1.16M|      pstr_hbe_txposer->qmf_out_buf[qmf_col_idx * 2 + (k + IXHEAACE_HBE_ZERO_BAND_IDX - 1)]
  ------------------
  |  |   35|  1.16M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  506|  1.16M|                                   [2 * qmf_band_idx] += (FLOAT32)(mag_cmplx_gain * vec_o_r[k]);
  507|  1.16M|      pstr_hbe_txposer->qmf_out_buf[qmf_col_idx * 2 + (k + IXHEAACE_HBE_ZERO_BAND_IDX - 1)]
  ------------------
  |  |   35|  1.16M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  508|  1.16M|                                   [2 * qmf_band_idx + 1] +=
  509|  1.16M|          (FLOAT32)(mag_cmplx_gain * vec_o_i[k]);
  510|  1.16M|    }
  511|   584k|  }
  512|  6.61M|}
ixheaace_hbe_xprod_proc_4:
  516|   115k|                               WORD32 pitch_in_bins_idx) {
  517|   115k|  WORD32 k;
  518|   115k|  WORD32 inp_band_idx = qmf_band_idx >> 1;
  519|   115k|  WORD32 tr, n1, n2, max_trans_fac, max_n1, max_n2;
  520|       |
  521|   115k|  FLOAT64 temp_fac;
  522|   115k|  FLOAT32 max_mag_value, mag_zero_band, mag_n1_band, mag_n2_band, temp;
  523|   115k|  FLOAT32 temp_r, temp_i;
  524|   115k|  FLOAT32 mag_cmplx_gain = 2.0f;
  525|       |
  526|   115k|  FLOAT32 *ptr_qmf_in_buf_ri =
  527|   115k|      pstr_hbe_txposer->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX];
  ------------------
  |  |   35|   115k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  528|       |
  529|   115k|  mag_zero_band =
  530|   115k|      ptr_qmf_in_buf_ri[2 * inp_band_idx] * ptr_qmf_in_buf_ri[2 * inp_band_idx] +
  531|   115k|      ptr_qmf_in_buf_ri[2 * inp_band_idx + 1] * ptr_qmf_in_buf_ri[2 * inp_band_idx + 1];
  532|       |
  533|   115k|  max_mag_value = 0;
  534|   115k|  max_n1 = max_n2 = max_trans_fac = 0;
  535|       |
  536|   115k|  tr = 1;
  537|   461k|  while (tr < 4) {
  ------------------
  |  Branch (537:10): [True: 345k, False: 115k]
  ------------------
  538|   345k|    temp_fac = (2.0 * qmf_band_idx + 1 - tr * p) * 0.25;
  539|   345k|    n1 = ((WORD32)(temp_fac)) << 1;
  540|   345k|    n2 = ((WORD32)(temp_fac + p)) << 1;
  541|       |
  542|   345k|    mag_n1_band = ptr_qmf_in_buf_ri[n1] * ptr_qmf_in_buf_ri[n1] +
  543|   345k|                  ptr_qmf_in_buf_ri[n1 + 1] * ptr_qmf_in_buf_ri[n1 + 1];
  544|   345k|    mag_n2_band = ptr_qmf_in_buf_ri[n2] * ptr_qmf_in_buf_ri[n2] +
  545|   345k|                  ptr_qmf_in_buf_ri[n2 + 1] * ptr_qmf_in_buf_ri[n2 + 1];
  546|       |
  547|   345k|    temp = min(mag_n1_band, mag_n2_band);
  ------------------
  |  |   75|   345k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 88.5k, False: 257k]
  |  |  ------------------
  ------------------
  548|       |
  549|   345k|    if (temp > max_mag_value) {
  ------------------
  |  Branch (549:9): [True: 184k, False: 161k]
  ------------------
  550|   184k|      max_mag_value = temp;
  551|   184k|      max_trans_fac = tr;
  552|   184k|      max_n1 = n1;
  553|   184k|      max_n2 = n2;
  554|   184k|    }
  555|   345k|    tr++;
  556|   345k|  }
  557|   115k|  if (max_mag_value > mag_zero_band && max_n1 >= 0 && max_n2 < IXHEAACE_TWICE_QMF_SYNTH_CH_NUM) {
  ------------------
  |  |   34|  33.2k|#define IXHEAACE_TWICE_QMF_SYNTH_CH_NUM (128)
  ------------------
  |  Branch (557:7): [True: 33.2k, False: 82.0k]
  |  Branch (557:40): [True: 33.2k, False: 0]
  |  Branch (557:55): [True: 33.2k, False: 0]
  ------------------
  558|  33.2k|    FLOAT32 vec_y_r[2], vec_y_i[2], vec_o_r[2], vec_o_i[2];
  559|  33.2k|    FLOAT32 d1, d2;
  560|  33.2k|    WORD32 mid_trans_fac, idx;
  561|  33.2k|    FLOAT32 x_zero_band_r;
  562|  33.2k|    FLOAT32 x_zero_band_i;
  563|  33.2k|    FLOAT64 base = 1e-17;
  564|  33.2k|    FLOAT32 mag_scaling_fac = 0.0f;
  565|       |
  566|  33.2k|    mid_trans_fac = 4 - max_trans_fac;
  567|       |
  568|  33.2k|    if (max_trans_fac == 1) {
  ------------------
  |  Branch (568:9): [True: 11.3k, False: 21.8k]
  ------------------
  569|  11.3k|      d1 = 0;
  570|  11.3k|      d2 = 2;
  571|  11.3k|      x_zero_band_r = ptr_qmf_in_buf_ri[max_n1];
  572|  11.3k|      x_zero_band_i = ptr_qmf_in_buf_ri[max_n1 + 1];
  573|  34.0k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (573:19): [True: 22.6k, False: 11.3k]
  ------------------
  574|  22.6k|        vec_y_r[k] =
  575|  22.6k|            pstr_hbe_txposer
  576|  22.6k|                ->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX + 2 * (k - 1)][max_n2];
  ------------------
  |  |   35|  22.6k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  577|  22.6k|        vec_y_i[k] =
  578|  22.6k|            pstr_hbe_txposer
  579|  22.6k|                ->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX + 2 * (k - 1)][max_n2 + 1];
  ------------------
  |  |   35|  22.6k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  580|  22.6k|      }
  581|  21.8k|    } else if (max_trans_fac == 2) {
  ------------------
  |  Branch (581:16): [True: 10.2k, False: 11.6k]
  ------------------
  582|  10.2k|      d1 = 0;
  583|  10.2k|      d2 = 1;
  584|  10.2k|      x_zero_band_r = ptr_qmf_in_buf_ri[max_n1];
  585|  10.2k|      x_zero_band_i = ptr_qmf_in_buf_ri[max_n1 + 1];
  586|  30.6k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (586:19): [True: 20.4k, False: 10.2k]
  ------------------
  587|  20.4k|        vec_y_r[k] = pstr_hbe_txposer
  588|  20.4k|                         ->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX + (k - 1)][max_n2];
  ------------------
  |  |   35|  20.4k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  589|  20.4k|        vec_y_i[k] =
  590|  20.4k|            pstr_hbe_txposer
  591|  20.4k|                ->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX + (k - 1)][max_n2 + 1];
  ------------------
  |  |   35|  20.4k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  592|  20.4k|      }
  593|  11.6k|    } else {
  594|  11.6k|      d1 = 2;
  595|  11.6k|      d2 = 0;
  596|  11.6k|      mid_trans_fac = max_trans_fac;
  597|  11.6k|      max_trans_fac = 4 - max_trans_fac;
  598|  11.6k|      x_zero_band_r = ptr_qmf_in_buf_ri[max_n2];
  599|  11.6k|      x_zero_band_i = ptr_qmf_in_buf_ri[max_n2 + 1];
  600|  34.9k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (600:19): [True: 23.3k, False: 11.6k]
  ------------------
  601|  23.3k|        vec_y_r[k] =
  602|  23.3k|            pstr_hbe_txposer
  603|  23.3k|                ->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX + 2 * (k - 1)][max_n1];
  ------------------
  |  |   35|  23.3k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  604|  23.3k|        vec_y_i[k] =
  605|  23.3k|            pstr_hbe_txposer
  606|  23.3k|                ->qmf_in_buf[qmf_col_idx + IXHEAACE_HBE_ZERO_BAND_IDX + 2 * (k - 1)][max_n1 + 1];
  ------------------
  |  |   35|  23.3k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  607|  23.3k|      }
  608|  11.6k|    }
  609|       |
  610|  33.2k|    base = 1e-17;
  611|  33.2k|    base = base + x_zero_band_r * x_zero_band_r;
  612|  33.2k|    base = base + x_zero_band_i * x_zero_band_i;
  613|  33.2k|    {
  614|  33.2k|      temp = (FLOAT32)sqrt(sqrt(base));
  615|  33.2k|      mag_scaling_fac = temp * (FLOAT32)(sqrt(temp));
  616|  33.2k|      mag_scaling_fac = 1 / mag_scaling_fac;
  617|  33.2k|    }
  618|       |
  619|  33.2k|    x_zero_band_r *= mag_scaling_fac;
  620|  33.2k|    x_zero_band_i *= mag_scaling_fac;
  621|  99.6k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (621:17): [True: 66.4k, False: 33.2k]
  ------------------
  622|  66.4k|      base = 1e-17;
  623|  66.4k|      base = base + vec_y_r[k] * vec_y_r[k];
  624|  66.4k|      base = base + vec_y_i[k] * vec_y_i[k];
  625|  66.4k|      {
  626|  66.4k|        temp = (FLOAT32)sqrt(sqrt(base));
  627|  66.4k|        mag_scaling_fac = temp * (FLOAT32)(sqrt(temp));
  628|       |
  629|  66.4k|        mag_scaling_fac = 1 / mag_scaling_fac;
  630|  66.4k|      }
  631|  66.4k|      vec_y_r[k] *= mag_scaling_fac;
  632|  66.4k|      vec_y_i[k] *= mag_scaling_fac;
  633|  66.4k|    }
  634|       |
  635|  33.2k|    temp_r = x_zero_band_r;
  636|  33.2k|    temp_i = x_zero_band_i;
  637|  89.4k|    for (idx = 0; idx < mid_trans_fac - 1; idx++) {
  ------------------
  |  Branch (637:19): [True: 56.2k, False: 33.2k]
  ------------------
  638|  56.2k|      FLOAT32 tmp = x_zero_band_r;
  639|  56.2k|      x_zero_band_r = x_zero_band_r * temp_r - x_zero_band_i * temp_i;
  640|  56.2k|      x_zero_band_i = tmp * temp_i + x_zero_band_i * temp_r;
  641|  56.2k|    }
  642|       |
  643|  99.6k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (643:17): [True: 66.4k, False: 33.2k]
  ------------------
  644|  66.4k|      temp_r = vec_y_r[k];
  645|  66.4k|      temp_i = vec_y_i[k];
  646|  86.8k|      for (idx = 0; idx < max_trans_fac - 1; idx++) {
  ------------------
  |  Branch (646:21): [True: 20.4k, False: 66.4k]
  ------------------
  647|  20.4k|        FLOAT32 tmp = vec_y_r[k];
  648|  20.4k|        vec_y_r[k] = vec_y_r[k] * temp_r - vec_y_i[k] * temp_i;
  649|  20.4k|        vec_y_i[k] = tmp * temp_i + vec_y_i[k] * temp_r;
  650|  20.4k|      }
  651|  66.4k|    }
  652|       |
  653|  99.6k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (653:17): [True: 66.4k, False: 33.2k]
  ------------------
  654|  66.4k|      vec_o_r[k] = vec_y_r[k] * x_zero_band_r - vec_y_i[k] * x_zero_band_i;
  655|  66.4k|      vec_o_i[k] = vec_y_r[k] * x_zero_band_i + vec_y_i[k] * x_zero_band_r;
  656|  66.4k|    }
  657|       |
  658|  33.2k|    {
  659|  33.2k|      FLOAT32 cos_theta;
  660|  33.2k|      FLOAT32 sin_theta;
  661|       |
  662|  33.2k|      if (d2 == 1) {
  ------------------
  |  Branch (662:11): [True: 10.2k, False: 23.0k]
  ------------------
  663|  10.2k|        cos_theta = ixheaac_hbe_x_prod_cos_table_trans_4_1[(pitch_in_bins_idx << 1) + 0];
  664|  10.2k|        sin_theta = ixheaac_hbe_x_prod_cos_table_trans_4_1[(pitch_in_bins_idx << 1) + 1];
  665|  23.0k|      } else {
  666|  23.0k|        cos_theta = ixheaac_hbe_x_prod_cos_table_trans_4[(pitch_in_bins_idx << 1) + 0];
  667|  23.0k|        sin_theta = ixheaac_hbe_x_prod_cos_table_trans_4[(pitch_in_bins_idx << 1) + 1];
  668|  23.0k|        if (d2 < d1) {
  ------------------
  |  Branch (668:13): [True: 11.6k, False: 11.3k]
  ------------------
  669|  11.6k|          sin_theta = -sin_theta;
  670|  11.6k|        }
  671|  23.0k|      }
  672|  33.2k|      temp_r = vec_o_r[0];
  673|  33.2k|      temp_i = vec_o_i[0];
  674|  33.2k|      vec_o_r[0] = (FLOAT32)(cos_theta * temp_r - sin_theta * temp_i);
  675|  33.2k|      vec_o_i[0] = (FLOAT32)(cos_theta * temp_i + sin_theta * temp_r);
  676|  33.2k|    }
  677|       |
  678|  99.6k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (678:17): [True: 66.4k, False: 33.2k]
  ------------------
  679|  66.4k|      pstr_hbe_txposer->qmf_out_buf[qmf_col_idx * 2 + (k + IXHEAACE_HBE_ZERO_BAND_IDX - 1)]
  ------------------
  |  |   35|  66.4k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  680|  66.4k|                                   [2 * qmf_band_idx] += (FLOAT32)(mag_cmplx_gain * vec_o_r[k]);
  681|  66.4k|      pstr_hbe_txposer->qmf_out_buf[qmf_col_idx * 2 + (k + IXHEAACE_HBE_ZERO_BAND_IDX - 1)]
  ------------------
  |  |   35|  66.4k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  682|  66.4k|                                   [2 * qmf_band_idx + 1] +=
  683|  66.4k|          (FLOAT32)(mag_cmplx_gain * vec_o_i[k]);
  684|  66.4k|    }
  685|  33.2k|  }
  686|   115k|}
ixheaace_hbe_post_anal_prod2:
  689|  57.6k|                                  WORD32 qmf_voc_columns, WORD32 qmf_band_idx) {
  690|  57.6k|  WORD32 i;
  691|  57.6k|  FLOAT32 *ptr_norm = &pstr_hbe_txposer->norm_qmf_in_buf[1][2 * qmf_band_idx];
  692|  57.6k|  FLOAT32 *ptr_out = &pstr_hbe_txposer->qmf_out_buf[1][2 * qmf_band_idx];
  693|  57.6k|  FLOAT32 *ptr_x_norm =
  694|  57.6k|      &pstr_hbe_txposer->norm_qmf_in_buf[IXHEAACE_HBE_ZERO_BAND_IDX][2 * qmf_band_idx];
  ------------------
  |  |   35|  57.6k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  695|       |
  696|  57.6k|  ixheaace_norm_qmf_in_buf_2(pstr_hbe_txposer, qmf_band_idx);
  697|       |
  698|   988k|  for (; qmf_band_idx < pstr_hbe_txposer->x_over_qmf[1]; qmf_band_idx++) {
  ------------------
  |  Branch (698:10): [True: 931k, False: 57.6k]
  ------------------
  699|  25.9M|    for (i = 0; i < qmf_voc_columns; i++) {
  ------------------
  |  Branch (699:17): [True: 25.0M, False: 931k]
  ------------------
  700|  25.0M|      WORD32 k;
  701|  25.0M|      FLOAT32 x_zero_band_r, x_zero_band_i;
  702|       |
  703|  25.0M|      x_zero_band_r = *ptr_x_norm++;
  704|  25.0M|      x_zero_band_i = *ptr_x_norm++;
  705|       |
  706|   275M|      for (k = 0; k < IXHEAACE_HBE_OPER_BLK_LEN_2; k++) {
  ------------------
  |  |   36|   275M|#define IXHEAACE_HBE_OPER_BLK_LEN_2 (10)
  ------------------
  |  Branch (706:19): [True: 250M, False: 25.0M]
  ------------------
  707|   250M|        register FLOAT32 tmp_r, tmp_i;
  708|   250M|        tmp_r = *ptr_norm++;
  709|   250M|        tmp_i = *ptr_norm++;
  710|       |
  711|   250M|        *ptr_out++ += ((tmp_r * x_zero_band_r - tmp_i * x_zero_band_i) * 0.3333333f);
  712|       |
  713|   250M|        *ptr_out++ += ((tmp_r * x_zero_band_i + tmp_i * x_zero_band_r) * 0.3333333f);
  714|       |
  715|   250M|        ptr_norm += 126;
  716|   250M|        ptr_out += 126;
  717|   250M|      }
  718|       |
  719|  25.0M|      ptr_norm -= 128 * 9;
  720|  25.0M|      ptr_out -= 128 * 8;
  721|  25.0M|      ptr_x_norm += 126;
  722|  25.0M|    }
  723|   931k|    ptr_out -= (128 * 2 * qmf_voc_columns) - 2;
  724|   931k|    ptr_norm -= (128 * qmf_voc_columns) - 2;
  725|   931k|    ptr_x_norm -= (128 * qmf_voc_columns) - 2;
  726|   931k|  }
  727|  57.6k|}
ixheaace_hbe_post_anal_prod3:
  730|  56.8k|                                  WORD32 qmf_voc_columns, WORD32 qmf_band_idx) {
  731|  56.8k|  WORD32 i, inp_band_idx, rem;
  732|       |
  733|  56.8k|  FLOAT32 *ptr_out_buf = &pstr_hbe_txposer->qmf_out_buf[2][2 * qmf_band_idx];
  734|       |
  735|   746k|  for (; qmf_band_idx < pstr_hbe_txposer->x_over_qmf[2]; qmf_band_idx++) {
  ------------------
  |  Branch (735:10): [True: 690k, False: 56.8k]
  ------------------
  736|   690k|    FLOAT32 temp_r, temp_i;
  737|   690k|    FLOAT32 temp_r1, temp_i1;
  738|   690k|    const FLOAT32 *ptr_sel, *ptr_sel1;
  739|       |
  740|   690k|    inp_band_idx = (2 * qmf_band_idx) / 3;
  741|   690k|    ptr_sel = &ixheaac_sel_case[(inp_band_idx + 1) & 3][0];
  742|   690k|    ptr_sel1 = &ixheaac_sel_case[((inp_band_idx + 1) & 3) + 1][0];
  743|   690k|    rem = 2 * qmf_band_idx - 3 * inp_band_idx;
  744|       |
  745|   690k|    if (rem == 0 || rem == 1) {
  ------------------
  |  Branch (745:9): [True: 204k, False: 485k]
  |  Branch (745:21): [True: 236k, False: 249k]
  ------------------
  746|   440k|      FLOAT32 *ptr_in_buf = &pstr_hbe_txposer->qmf_in_buf[0][2 * inp_band_idx];
  747|       |
  748|  13.7M|      for (i = 0; i < qmf_voc_columns; i += 1) {
  ------------------
  |  Branch (748:19): [True: 13.2M, False: 440k]
  ------------------
  749|  13.2M|        WORD32 k;
  750|  13.2M|        FLOAT32 vec_x[2 * IXHEAACE_HBE_OPER_WIN_LEN];
  751|  13.2M|        FLOAT32 *ptr_vec_x = &vec_x[0];
  752|  13.2M|        FLOAT32 x_zero_band_r, x_zero_band_i;
  753|       |
  754|  13.2M|        FLOAT32 mag_scaling_fac;
  755|       |
  756|  66.4M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k += 2) {
  ------------------
  |  |   37|  66.4M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (756:21): [True: 53.1M, False: 13.2M]
  ------------------
  757|  53.1M|          FLOAT64 base1;
  758|  53.1M|          FLOAT64 base = 1e-17;
  759|       |
  760|  53.1M|          temp_r = ptr_in_buf[0];
  761|  53.1M|          temp_i = ptr_in_buf[1];
  762|       |
  763|  53.1M|          ptr_in_buf += 256;
  764|       |
  765|  53.1M|          base1 = base + temp_r * temp_r;
  766|  53.1M|          base1 = base1 + temp_i * temp_i;
  767|       |
  768|  53.1M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  53.1M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  769|       |
  770|  53.1M|          ptr_vec_x[0] = temp_r * mag_scaling_fac;
  771|  53.1M|          ptr_vec_x[1] = temp_i * mag_scaling_fac;
  772|       |
  773|  53.1M|          temp_r = ptr_in_buf[0];
  774|  53.1M|          temp_i = ptr_in_buf[1];
  775|       |
  776|  53.1M|          ptr_in_buf -= 128;
  777|       |
  778|  53.1M|          temp_r1 = ptr_sel[0] * temp_r + ptr_sel[1] * temp_i;
  779|  53.1M|          temp_i1 = ptr_sel[2] * temp_r + ptr_sel[3] * temp_i;
  780|       |
  781|  53.1M|          temp_r = ptr_in_buf[0];
  782|  53.1M|          temp_i = ptr_in_buf[1];
  783|       |
  784|  53.1M|          temp_r1 += ptr_sel[4] * temp_r + ptr_sel[5] * temp_i;
  785|  53.1M|          temp_i1 += ptr_sel[6] * temp_r + ptr_sel[7] * temp_i;
  786|       |
  787|  53.1M|          temp_r1 *= 0.3984033437f;
  788|  53.1M|          temp_i1 *= 0.3984033437f;
  789|       |
  790|  53.1M|          base1 = base + temp_r1 * temp_r1;
  791|  53.1M|          base1 = base1 + temp_i1 * temp_i1;
  792|  53.1M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  53.1M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  793|       |
  794|  53.1M|          ptr_vec_x[2] = temp_r1 * mag_scaling_fac;
  795|  53.1M|          ptr_vec_x[3] = temp_i1 * mag_scaling_fac;
  796|       |
  797|  53.1M|          ptr_vec_x += 4;
  798|  53.1M|          ptr_in_buf += 256;
  799|  53.1M|        }
  800|  13.2M|        ptr_vec_x = &vec_x[0];
  801|  13.2M|        temp_r = vec_x[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)];
  ------------------
  |  |   35|  13.2M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  802|  13.2M|        temp_i = vec_x[(2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)) + 1];
  ------------------
  |  |   35|  13.2M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  803|       |
  804|  13.2M|        x_zero_band_r = temp_r * temp_r - temp_i * temp_i;
  805|  13.2M|        x_zero_band_i = temp_r * temp_i + temp_i * temp_r;
  806|       |
  807|   119M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k++) {
  ------------------
  |  |   37|   119M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (807:21): [True: 106M, False: 13.2M]
  ------------------
  808|   106M|          temp_r = ptr_vec_x[0] * x_zero_band_r - ptr_vec_x[1] * x_zero_band_i;
  809|   106M|          temp_i = ptr_vec_x[0] * x_zero_band_i + ptr_vec_x[1] * x_zero_band_r;
  810|       |
  811|   106M|          ptr_out_buf[0] += (temp_r * 0.4714045f);
  812|   106M|          ptr_out_buf[1] += (temp_i * 0.4714045f);
  813|       |
  814|   106M|          ptr_vec_x += 2;
  815|   106M|          ptr_out_buf += 128;
  816|   106M|        }
  817|       |
  818|  13.2M|        ptr_in_buf -= 128 * 11;
  819|  13.2M|        ptr_out_buf -= 128 * 6;
  820|  13.2M|      }
  821|   440k|    } else {
  822|   249k|      FLOAT32 *ptr_in_buf = &pstr_hbe_txposer->qmf_in_buf[0][2 * inp_band_idx];
  823|   249k|      FLOAT32 *ptr_in_buf1 = &pstr_hbe_txposer->qmf_in_buf[0][2 * (inp_band_idx + 1)];
  824|       |
  825|  7.82M|      for (i = 0; i < qmf_voc_columns; i++) {
  ------------------
  |  Branch (825:19): [True: 7.57M, False: 249k]
  ------------------
  826|  7.57M|        WORD32 k;
  827|  7.57M|        FLOAT32 vec_x[2 * IXHEAACE_HBE_OPER_WIN_LEN];
  828|  7.57M|        FLOAT32 vec_x_cap[2 * IXHEAACE_HBE_OPER_WIN_LEN];
  829|       |
  830|  7.57M|        FLOAT32 x_zero_band_r, x_zero_band_i;
  831|  7.57M|        FLOAT32 *ptr_vec_x = &vec_x[0];
  832|  7.57M|        FLOAT32 *ptr_vec_x_cap = &vec_x_cap[0];
  833|       |
  834|  7.57M|        FLOAT32 mag_scaling_fac;
  835|       |
  836|  37.8M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k += 2) {
  ------------------
  |  |   37|  37.8M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (836:21): [True: 30.2M, False: 7.57M]
  ------------------
  837|  30.2M|          FLOAT32 tmp_vr, tmp_vi;
  838|  30.2M|          FLOAT32 tmp_cr, tmp_ci;
  839|  30.2M|          FLOAT64 base1;
  840|  30.2M|          FLOAT64 base = 1e-17;
  841|       |
  842|  30.2M|          temp_r1 = ptr_in_buf[0];
  843|  30.2M|          temp_i1 = ptr_in_buf[1];
  844|  30.2M|          temp_r = ptr_in_buf1[0];
  845|  30.2M|          temp_i = ptr_in_buf1[1];
  846|       |
  847|  30.2M|          base1 = base + temp_r * temp_r;
  848|  30.2M|          base1 = base1 + temp_i * temp_i;
  849|       |
  850|  30.2M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  30.2M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  851|       |
  852|  30.2M|          ptr_vec_x[0] = temp_r * mag_scaling_fac;
  853|  30.2M|          ptr_vec_x[1] = temp_i * mag_scaling_fac;
  854|       |
  855|  30.2M|          base1 = base + temp_r1 * temp_r1;
  856|  30.2M|          base1 = base1 + temp_i1 * temp_i1;
  857|       |
  858|  30.2M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  30.2M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  859|       |
  860|  30.2M|          ptr_vec_x_cap[0] = temp_r1 * mag_scaling_fac;
  861|  30.2M|          ptr_vec_x_cap[1] = temp_i1 * mag_scaling_fac;
  862|       |
  863|  30.2M|          ptr_in_buf += 256;
  864|       |
  865|  30.2M|          temp_r = ptr_in_buf[0];
  866|  30.2M|          temp_i = ptr_in_buf[1];
  867|       |
  868|  30.2M|          temp_r1 = ptr_sel[0] * temp_r + ptr_sel[1] * temp_i;
  869|  30.2M|          temp_i1 = ptr_sel[2] * temp_r + ptr_sel[3] * temp_i;
  870|       |
  871|  30.2M|          ptr_in_buf -= 128;
  872|       |
  873|  30.2M|          temp_r = ptr_in_buf[0];
  874|  30.2M|          temp_i = ptr_in_buf[1];
  875|       |
  876|  30.2M|          tmp_cr = temp_r1 + ptr_sel[4] * temp_r + ptr_sel[5] * temp_i;
  877|  30.2M|          tmp_ci = temp_i1 + ptr_sel[6] * temp_r + ptr_sel[7] * temp_i;
  878|       |
  879|  30.2M|          ptr_in_buf1 += 256;
  880|       |
  881|  30.2M|          temp_r = ptr_in_buf1[0];
  882|  30.2M|          temp_i = ptr_in_buf1[1];
  883|       |
  884|  30.2M|          temp_r1 = ptr_sel1[0] * temp_r + ptr_sel1[1] * temp_i;
  885|  30.2M|          temp_i1 = ptr_sel1[2] * temp_r + ptr_sel1[3] * temp_i;
  886|       |
  887|  30.2M|          ptr_in_buf1 -= 128;
  888|       |
  889|  30.2M|          temp_r = ptr_in_buf1[0];
  890|  30.2M|          temp_i = ptr_in_buf1[1];
  891|       |
  892|  30.2M|          tmp_vr = temp_r1 + ptr_sel1[4] * temp_r + ptr_sel1[5] * temp_i;
  893|  30.2M|          tmp_vi = temp_i1 + ptr_sel1[6] * temp_r + ptr_sel1[7] * temp_i;
  894|       |
  895|  30.2M|          tmp_cr *= 0.3984033437f;
  896|  30.2M|          tmp_ci *= 0.3984033437f;
  897|       |
  898|  30.2M|          tmp_vr *= 0.3984033437f;
  899|  30.2M|          tmp_vi *= 0.3984033437f;
  900|       |
  901|  30.2M|          base1 = base + tmp_vr * tmp_vr;
  902|  30.2M|          base1 = base1 + tmp_vi * tmp_vi;
  903|       |
  904|  30.2M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  30.2M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  905|       |
  906|  30.2M|          ptr_vec_x[2] = tmp_vr * mag_scaling_fac;
  907|  30.2M|          ptr_vec_x[3] = tmp_vi * mag_scaling_fac;
  908|       |
  909|  30.2M|          base1 = base + tmp_cr * tmp_cr;
  910|  30.2M|          base1 = base1 + tmp_ci * tmp_ci;
  911|       |
  912|  30.2M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  30.2M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
  913|       |
  914|  30.2M|          ptr_vec_x_cap[2] = tmp_cr * mag_scaling_fac;
  915|  30.2M|          ptr_vec_x_cap[3] = tmp_ci * mag_scaling_fac;
  916|       |
  917|  30.2M|          ptr_in_buf += 256;
  918|  30.2M|          ptr_in_buf1 += 256;
  919|  30.2M|          ptr_vec_x += 4;
  920|  30.2M|          ptr_vec_x_cap += 4;
  921|  30.2M|        }
  922|  7.57M|        ptr_vec_x = &vec_x[0];
  923|  7.57M|        ptr_vec_x_cap = &vec_x_cap[0];
  924|       |
  925|  7.57M|        temp_r = vec_x_cap[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)];
  ------------------
  |  |   35|  7.57M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  926|  7.57M|        temp_i = vec_x_cap[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2) + 1];
  ------------------
  |  |   35|  7.57M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  927|  7.57M|        temp_r1 = vec_x[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)];
  ------------------
  |  |   35|  7.57M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  928|  7.57M|        temp_i1 = vec_x[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2) + 1];
  ------------------
  |  |   35|  7.57M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  929|       |
  930|  7.57M|        x_zero_band_r = temp_r * temp_r - temp_i * temp_i;
  931|  7.57M|        x_zero_band_i = temp_r * temp_i + temp_i * temp_r;
  932|       |
  933|  7.57M|        temp_r = temp_r1 * temp_r1 - temp_i1 * temp_i1;
  934|  7.57M|        temp_i = temp_r1 * temp_i1 + temp_i1 * temp_r1;
  935|       |
  936|  7.57M|        k = 0;
  937|  68.1M|        while (k < (IXHEAACE_HBE_OPER_BLK_LEN_3)) {
  ------------------
  |  |   37|  68.1M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (937:16): [True: 60.5M, False: 7.57M]
  ------------------
  938|  60.5M|          temp_r1 = ptr_vec_x[0] * x_zero_band_r - ptr_vec_x[1] * x_zero_band_i;
  939|  60.5M|          temp_i1 = ptr_vec_x[0] * x_zero_band_i + ptr_vec_x[1] * x_zero_band_r;
  940|       |
  941|  60.5M|          temp_r1 += ptr_vec_x_cap[0] * temp_r - ptr_vec_x_cap[1] * temp_i;
  942|  60.5M|          temp_i1 += ptr_vec_x_cap[0] * temp_i + ptr_vec_x_cap[1] * temp_r;
  943|       |
  944|  60.5M|          ptr_out_buf[0] += (temp_r1 * 0.23570225f);
  945|  60.5M|          ptr_out_buf[1] += (temp_i1 * 0.23570225f);
  946|       |
  947|  60.5M|          ptr_out_buf += 128;
  948|  60.5M|          ptr_vec_x += 2;
  949|  60.5M|          ptr_vec_x_cap += 2;
  950|       |
  951|  60.5M|          k++;
  952|  60.5M|        }
  953|       |
  954|  7.57M|        ptr_in_buf -= 128 * 11;
  955|  7.57M|        ptr_in_buf1 -= 128 * 11;
  956|  7.57M|        ptr_out_buf -= 128 * 6;
  957|  7.57M|      }
  958|   249k|    }
  959|       |
  960|   690k|    ptr_out_buf -= (256 * qmf_voc_columns) - 2;
  961|   690k|  }
  962|  56.8k|}
ixheaace_hbe_post_anal_prod4:
  965|  45.2k|                                  WORD32 qmf_voc_columns, WORD32 qmf_band_idx) {
  966|  45.2k|  WORD32 i, inp_band_idx;
  967|  45.2k|  FLOAT32 *ptr_out = &pstr_hbe_txposer->qmf_out_buf[3][2 * qmf_band_idx];
  968|       |
  969|  45.2k|  ixheaace_norm_qmf_in_buf_4(pstr_hbe_txposer, ((qmf_band_idx >> 1) - 1));
  970|       |
  971|   522k|  for (; qmf_band_idx < pstr_hbe_txposer->x_over_qmf[3]; qmf_band_idx++) {
  ------------------
  |  Branch (971:10): [True: 476k, False: 45.2k]
  ------------------
  972|   476k|    WORD32 ip_idx;
  973|   476k|    FLOAT32 temp, temp_r, temp_i;
  974|   476k|    FLOAT32 *ptr_norm, *ptr_x_norm;
  975|   476k|    inp_band_idx = qmf_band_idx >> 1;
  976|   476k|    ip_idx = (qmf_band_idx & 1) ? (inp_band_idx + 1) : (inp_band_idx - 1);
  ------------------
  |  Branch (976:14): [True: 245k, False: 231k]
  ------------------
  977|       |
  978|   476k|    ptr_norm = &pstr_hbe_txposer->norm_qmf_in_buf[0][2 * ip_idx];
  979|   476k|    ptr_x_norm = &pstr_hbe_txposer->norm_qmf_in_buf[IXHEAACE_HBE_ZERO_BAND_IDX][2 * inp_band_idx];
  ------------------
  |  |   35|   476k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
  980|       |
  981|   476k|    i = 0;
  982|  15.7M|    while (i < qmf_voc_columns) {
  ------------------
  |  Branch (982:12): [True: 15.2M, False: 476k]
  ------------------
  983|  15.2M|      WORD32 k;
  984|  15.2M|      FLOAT32 x_zero_band_r, x_zero_band_i;
  985|       |
  986|  15.2M|      temp_r = x_zero_band_r = *ptr_x_norm++;
  987|  15.2M|      temp_i = x_zero_band_i = *ptr_x_norm++;
  988|       |
  989|  15.2M|      temp = x_zero_band_r * x_zero_band_r - x_zero_band_i * x_zero_band_i;
  990|  15.2M|      x_zero_band_i = x_zero_band_r * x_zero_band_i + x_zero_band_i * x_zero_band_r;
  991|       |
  992|  15.2M|      x_zero_band_r = temp_r * temp - temp_i * x_zero_band_i;
  993|  15.2M|      x_zero_band_i = temp_r * x_zero_band_i + temp_i * temp;
  994|       |
  995|   106M|      for (k = 0; k < IXHEAACE_HBE_OPER_BLK_LEN_4; k++) {
  ------------------
  |  |   38|   106M|#define IXHEAACE_HBE_OPER_BLK_LEN_4 (6)
  ------------------
  |  Branch (995:19): [True: 91.5M, False: 15.2M]
  ------------------
  996|  91.5M|        temp = *ptr_norm++;
  997|  91.5M|        temp_i = *ptr_norm++;
  998|       |
  999|  91.5M|        temp_r = temp * x_zero_band_r - temp_i * x_zero_band_i;
 1000|  91.5M|        temp_i = temp * x_zero_band_i + temp_i * x_zero_band_r;
 1001|       |
 1002|  91.5M|        *ptr_out++ += (temp_r * 0.6666667f);
 1003|  91.5M|        *ptr_out++ += (temp_i * 0.6666667f);
 1004|       |
 1005|  91.5M|        ptr_norm += 254;
 1006|  91.5M|        ptr_out += 126;
 1007|  91.5M|      }
 1008|       |
 1009|  15.2M|      ptr_norm -= 128 * 11;
 1010|  15.2M|      ptr_out -= 128 * 4;
 1011|  15.2M|      ptr_x_norm += 126;
 1012|  15.2M|      i++;
 1013|  15.2M|    }
 1014|       |
 1015|   476k|    ptr_out -= (128 * 2 * qmf_voc_columns) - 2;
 1016|   476k|  }
 1017|  45.2k|}
ixheaace_hbe_post_anal_xprod2:
 1021|  69.0k|                                   FLOAT32 *ptr_cos_sin_theta) {
 1022|  69.0k|  WORD32 i;
 1023|  69.0k|  FLOAT32 *ptr_norm = &pstr_hbe_txposer->norm_qmf_in_buf[1][2 * qmf_band_idx];
 1024|  69.0k|  FLOAT32 *ptr_out = &pstr_hbe_txposer->qmf_out_buf[1][2 * qmf_band_idx];
 1025|  69.0k|  FLOAT32 *ptr_x_norm =
 1026|  69.0k|      &pstr_hbe_txposer->norm_qmf_in_buf[IXHEAACE_HBE_ZERO_BAND_IDX][2 * qmf_band_idx];
  ------------------
  |  |   35|  69.0k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1027|       |
 1028|  69.0k|  ixheaace_norm_qmf_in_buf_2(pstr_hbe_txposer, qmf_band_idx);
 1029|       |
 1030|  1.72M|  while (qmf_band_idx < pstr_hbe_txposer->x_over_qmf[1]) {
  ------------------
  |  Branch (1030:10): [True: 1.65M, False: 69.0k]
  ------------------
 1031|  1.65M|    WORD32 n1, n2;
 1032|  1.65M|    FLOAT64 temp_fac;
 1033|  1.65M|    FLOAT32 mag_cmplx_gain = 1.666666667f;
 1034|  1.65M|    temp_fac = (2.0 * qmf_band_idx + 1 - p) * 0.5;
 1035|  1.65M|    n1 = ((WORD32)(temp_fac)) << 1;
 1036|  1.65M|    n2 = ((WORD32)(temp_fac + p)) << 1;
 1037|       |
 1038|  28.2M|    for (i = 0; i < qmf_voc_columns; i++) {
  ------------------
  |  Branch (1038:17): [True: 26.5M, False: 1.65M]
  ------------------
 1039|  26.5M|      WORD32 k;
 1040|  26.5M|      FLOAT32 x_zero_band_r, x_zero_band_i;
 1041|       |
 1042|  26.5M|      x_zero_band_r = *ptr_x_norm++;
 1043|  26.5M|      x_zero_band_i = *ptr_x_norm++;
 1044|       |
 1045|   292M|      for (k = 1; k < (IXHEAACE_HBE_OPER_BLK_LEN_2 + 1); k++) {
  ------------------
  |  |   36|   292M|#define IXHEAACE_HBE_OPER_BLK_LEN_2 (10)
  ------------------
  |  Branch (1045:19): [True: 265M, False: 26.5M]
  ------------------
 1046|   265M|        register FLOAT32 tmp_r, tmp_i;
 1047|   265M|        tmp_r = *ptr_norm++;
 1048|   265M|        tmp_i = *ptr_norm++;
 1049|       |
 1050|   265M|        *ptr_out++ += ((tmp_r * x_zero_band_r - tmp_i * x_zero_band_i) * 0.3333333f);
 1051|       |
 1052|   265M|        *ptr_out++ += ((tmp_r * x_zero_band_i + tmp_i * x_zero_band_r) * 0.3333333f);
 1053|       |
 1054|   265M|        ptr_norm += 126;
 1055|   265M|        ptr_out += 126;
 1056|   265M|      }
 1057|  26.5M|      ptr_norm -= 128 * 9;
 1058|  26.5M|      ptr_out -= 128 * 8;
 1059|  26.5M|      ptr_x_norm += 126;
 1060|       |
 1061|  26.5M|      {
 1062|  26.5M|        WORD32 max_trans_fac, max_n1, max_n2;
 1063|  26.5M|        FLOAT32 max_mag_value;
 1064|  26.5M|        FLOAT32 mag_zero_band, mag_n1_band, mag_n2_band, temp;
 1065|       |
 1066|  26.5M|        FLOAT32 *ptr_qmf_in_buf_ri = pstr_hbe_txposer->qmf_in_buf[i + IXHEAACE_HBE_ZERO_BAND_IDX];
  ------------------
  |  |   35|  26.5M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1067|       |
 1068|  26.5M|        mag_zero_band =
 1069|  26.5M|            ptr_qmf_in_buf_ri[2 * qmf_band_idx] * ptr_qmf_in_buf_ri[2 * qmf_band_idx] +
 1070|  26.5M|            ptr_qmf_in_buf_ri[2 * qmf_band_idx + 1] * ptr_qmf_in_buf_ri[2 * qmf_band_idx + 1];
 1071|       |
 1072|  26.5M|        mag_n1_band = ptr_qmf_in_buf_ri[n1] * ptr_qmf_in_buf_ri[n1] +
 1073|  26.5M|                      ptr_qmf_in_buf_ri[n1 + 1] * ptr_qmf_in_buf_ri[n1 + 1];
 1074|  26.5M|        mag_n2_band = ptr_qmf_in_buf_ri[n2] * ptr_qmf_in_buf_ri[n2] +
 1075|  26.5M|                      ptr_qmf_in_buf_ri[n2 + 1] * ptr_qmf_in_buf_ri[n2 + 1];
 1076|       |
 1077|  26.5M|        temp = min(mag_n1_band, mag_n2_band);
  ------------------
  |  |   75|  26.5M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 11.3M, False: 15.2M]
  |  |  ------------------
  ------------------
 1078|       |
 1079|  26.5M|        max_mag_value = 0;
 1080|  26.5M|        max_trans_fac = 0;
 1081|  26.5M|        max_n1 = 0;
 1082|  26.5M|        max_n2 = 0;
 1083|       |
 1084|  26.5M|        if (temp > 0) {
  ------------------
  |  Branch (1084:13): [True: 25.6M, False: 943k]
  ------------------
 1085|  25.6M|          max_mag_value = temp;
 1086|  25.6M|          max_trans_fac = 1;
 1087|  25.6M|          max_n1 = n1;
 1088|  25.6M|          max_n2 = n2;
 1089|  25.6M|        }
 1090|       |
 1091|  26.5M|        if (max_mag_value > mag_zero_band && max_n1 >= 0 &&
  ------------------
  |  Branch (1091:13): [True: 3.14M, False: 23.4M]
  |  Branch (1091:46): [True: 3.14M, False: 0]
  ------------------
 1092|  3.14M|            max_n2 < IXHEAACE_TWICE_QMF_SYNTH_CH_NUM - 1) {
  ------------------
  |  |   34|  3.14M|#define IXHEAACE_TWICE_QMF_SYNTH_CH_NUM (128)
  ------------------
  |  Branch (1092:13): [True: 3.14M, False: 0]
  ------------------
 1093|  3.14M|          FLOAT32 vec_y_r[2], vec_y_i[2];
 1094|  3.14M|          FLOAT32 temp_r, temp_i, tmp_r1;
 1095|  3.14M|          WORD32 mid_trans_fac, idx;
 1096|  3.14M|          FLOAT64 base;
 1097|  3.14M|          FLOAT32 mag_scaling_fac = 0.0f;
 1098|       |
 1099|  3.14M|          mid_trans_fac = 2 - max_trans_fac;
 1100|       |
 1101|  3.14M|          x_zero_band_r = ptr_qmf_in_buf_ri[max_n1];
 1102|  3.14M|          x_zero_band_i = ptr_qmf_in_buf_ri[max_n1 + 1];
 1103|  3.14M|          base = 1e-17;
 1104|  3.14M|          base = base + x_zero_band_r * x_zero_band_r;
 1105|  3.14M|          base = base + x_zero_band_i * x_zero_band_i;
 1106|       |
 1107|  3.14M|          mag_scaling_fac = (FLOAT32)(1.0f / base);
 1108|  3.14M|          mag_scaling_fac = (FLOAT32)sqrt(sqrt(mag_scaling_fac));
 1109|       |
 1110|  3.14M|          x_zero_band_r *= mag_scaling_fac;
 1111|  3.14M|          x_zero_band_i *= mag_scaling_fac;
 1112|       |
 1113|  3.14M|          temp_r = x_zero_band_r;
 1114|  3.14M|          temp_i = x_zero_band_i;
 1115|  3.14M|          for (idx = 0; idx < mid_trans_fac - 1; idx++) {
  ------------------
  |  Branch (1115:25): [True: 0, False: 3.14M]
  ------------------
 1116|      0|            FLOAT32 tmp = x_zero_band_r;
 1117|      0|            x_zero_band_r = x_zero_band_r * temp_r - x_zero_band_i * temp_i;
 1118|      0|            x_zero_band_i = tmp * temp_i + x_zero_band_i * temp_r;
 1119|      0|          }
 1120|       |
 1121|  9.43M|          for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (1121:23): [True: 6.28M, False: 3.14M]
  ------------------
 1122|  6.28M|            temp_r = pstr_hbe_txposer->qmf_in_buf[i + IXHEAACE_HBE_ZERO_BAND_IDX - 1 + k][max_n2];
  ------------------
  |  |   35|  6.28M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1123|       |
 1124|  6.28M|            temp_i =
 1125|  6.28M|                pstr_hbe_txposer->qmf_in_buf[i + IXHEAACE_HBE_ZERO_BAND_IDX - 1 + k][max_n2 + 1];
  ------------------
  |  |   35|  6.28M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1126|       |
 1127|  6.28M|            base = 1e-17;
 1128|  6.28M|            base = base + temp_r * temp_r;
 1129|  6.28M|            base = base + temp_i * temp_i;
 1130|       |
 1131|  6.28M|            mag_scaling_fac = (FLOAT32)(1.0f / base);
 1132|  6.28M|            mag_scaling_fac = (FLOAT32)sqrt(sqrt(mag_scaling_fac));
 1133|       |
 1134|  6.28M|            temp_r *= mag_scaling_fac;
 1135|  6.28M|            temp_i *= mag_scaling_fac;
 1136|       |
 1137|  6.28M|            vec_y_r[k] = temp_r;
 1138|  6.28M|            vec_y_i[k] = temp_i;
 1139|  6.28M|          }
 1140|       |
 1141|  3.14M|          temp_r = vec_y_r[0] * x_zero_band_r - vec_y_i[0] * x_zero_band_i;
 1142|  3.14M|          temp_i = vec_y_r[0] * x_zero_band_i + vec_y_i[0] * x_zero_band_r;
 1143|       |
 1144|  3.14M|          tmp_r1 = (FLOAT32)(ptr_cos_sin_theta[0] * temp_r - ptr_cos_sin_theta[1] * temp_i);
 1145|  3.14M|          temp_i = (FLOAT32)(ptr_cos_sin_theta[0] * temp_i + ptr_cos_sin_theta[1] * temp_r);
 1146|       |
 1147|  3.14M|          pstr_hbe_txposer
 1148|  3.14M|              ->qmf_out_buf[i * 2 + (IXHEAACE_HBE_ZERO_BAND_IDX - 1)][2 * qmf_band_idx] +=
  ------------------
  |  |   35|  3.14M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1149|  3.14M|              (FLOAT32)(mag_cmplx_gain * tmp_r1);
 1150|       |
 1151|  3.14M|          pstr_hbe_txposer
 1152|  3.14M|              ->qmf_out_buf[i * 2 + (IXHEAACE_HBE_ZERO_BAND_IDX - 1)][2 * qmf_band_idx + 1] +=
  ------------------
  |  |   35|  3.14M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1153|  3.14M|              (FLOAT32)(mag_cmplx_gain * temp_i);
 1154|       |
 1155|  3.14M|          temp_r = vec_y_r[1] * x_zero_band_r - vec_y_i[1] * x_zero_band_i;
 1156|  3.14M|          temp_i = vec_y_r[1] * x_zero_band_i + vec_y_i[1] * x_zero_band_r;
 1157|       |
 1158|  3.14M|          pstr_hbe_txposer
 1159|  3.14M|              ->qmf_out_buf[i * 2 + (1 + IXHEAACE_HBE_ZERO_BAND_IDX - 1)][2 * qmf_band_idx] +=
  ------------------
  |  |   35|  3.14M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1160|  3.14M|              (FLOAT32)(mag_cmplx_gain * temp_r);
 1161|       |
 1162|  3.14M|          pstr_hbe_txposer
 1163|  3.14M|              ->qmf_out_buf[i * 2 + (1 + IXHEAACE_HBE_ZERO_BAND_IDX - 1)][2 * qmf_band_idx + 1] +=
  ------------------
  |  |   35|  3.14M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1164|  3.14M|              (FLOAT32)(mag_cmplx_gain * temp_i);
 1165|  3.14M|        }
 1166|  26.5M|      }
 1167|  26.5M|    }
 1168|       |
 1169|  1.65M|    ptr_out -= (128 * 2 * qmf_voc_columns) - 2;
 1170|  1.65M|    ptr_norm -= (128 * qmf_voc_columns) - 2;
 1171|  1.65M|    ptr_x_norm -= (128 * qmf_voc_columns) - 2;
 1172|  1.65M|    qmf_band_idx++;
 1173|  1.65M|  }
 1174|  69.0k|}
ixheaace_hbe_post_anal_xprod3:
 1178|  65.8k|                                   WORD32 pitch_in_bins_idx) {
 1179|  65.8k|  WORD32 i, inp_band_idx, rem;
 1180|       |
 1181|  65.8k|  FLOAT32 *ptr_out_buf = &pstr_hbe_txposer->qmf_out_buf[2][2 * qmf_band_idx];
 1182|       |
 1183|   475k|  while (qmf_band_idx < pstr_hbe_txposer->x_over_qmf[2]) {
  ------------------
  |  Branch (1183:10): [True: 409k, False: 65.8k]
  ------------------
 1184|   409k|    FLOAT32 temp_r, temp_i;
 1185|   409k|    FLOAT32 temp_r1, temp_i1;
 1186|   409k|    const FLOAT32 *ptr_sel, *ptr_sel1;
 1187|       |
 1188|   409k|    inp_band_idx = (2 * qmf_band_idx) / 3;
 1189|   409k|    ptr_sel = &ixheaac_sel_case[(inp_band_idx + 1) & 3][0];
 1190|   409k|    ptr_sel1 = &ixheaac_sel_case[((inp_band_idx + 1) & 3) + 1][0];
 1191|   409k|    rem = 2 * qmf_band_idx - 3 * inp_band_idx;
 1192|       |
 1193|   409k|    if (rem == 0 || rem == 1) {
  ------------------
  |  Branch (1193:9): [True: 140k, False: 268k]
  |  Branch (1193:21): [True: 139k, False: 129k]
  ------------------
 1194|   279k|      FLOAT32 *ptr_in_buf = &pstr_hbe_txposer->qmf_in_buf[0][2 * inp_band_idx];
 1195|       |
 1196|  4.79M|      for (i = 0; i < qmf_voc_columns; i += 1) {
  ------------------
  |  Branch (1196:19): [True: 4.51M, False: 279k]
  ------------------
 1197|  4.51M|        WORD32 k;
 1198|  4.51M|        FLOAT32 vec_x[2 * IXHEAACE_HBE_OPER_WIN_LEN];
 1199|  4.51M|        FLOAT32 *ptr_vec_x = &vec_x[0];
 1200|  4.51M|        FLOAT32 x_zero_band_r, x_zero_band_i;
 1201|       |
 1202|  4.51M|        FLOAT32 mag_scaling_fac;
 1203|       |
 1204|  22.5M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k += 2) {
  ------------------
  |  |   37|  22.5M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (1204:21): [True: 18.0M, False: 4.51M]
  ------------------
 1205|  18.0M|          FLOAT64 base1;
 1206|  18.0M|          FLOAT64 base = 1e-17;
 1207|       |
 1208|  18.0M|          temp_r = ptr_in_buf[0];
 1209|  18.0M|          temp_i = ptr_in_buf[1];
 1210|       |
 1211|  18.0M|          ptr_in_buf += 256;
 1212|       |
 1213|  18.0M|          base1 = base + temp_r * temp_r;
 1214|  18.0M|          base1 = base1 + temp_i * temp_i;
 1215|       |
 1216|  18.0M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  18.0M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
 1217|       |
 1218|  18.0M|          ptr_vec_x[0] = temp_r * mag_scaling_fac;
 1219|  18.0M|          ptr_vec_x[1] = temp_i * mag_scaling_fac;
 1220|       |
 1221|  18.0M|          temp_r = ptr_in_buf[0];
 1222|  18.0M|          temp_i = ptr_in_buf[1];
 1223|       |
 1224|  18.0M|          ptr_in_buf -= 128;
 1225|       |
 1226|  18.0M|          temp_r1 = ptr_sel[0] * temp_r + ptr_sel[1] * temp_i;
 1227|  18.0M|          temp_i1 = ptr_sel[2] * temp_r + ptr_sel[3] * temp_i;
 1228|       |
 1229|  18.0M|          temp_r = ptr_in_buf[0];
 1230|  18.0M|          temp_i = ptr_in_buf[1];
 1231|       |
 1232|  18.0M|          temp_r1 += ptr_sel[4] * temp_r + ptr_sel[5] * temp_i;
 1233|  18.0M|          temp_i1 += ptr_sel[6] * temp_r + ptr_sel[7] * temp_i;
 1234|       |
 1235|  18.0M|          temp_r1 *= 0.3984033437f;
 1236|  18.0M|          temp_i1 *= 0.3984033437f;
 1237|       |
 1238|  18.0M|          base1 = base + temp_r1 * temp_r1;
 1239|  18.0M|          base1 = base1 + temp_i1 * temp_i1;
 1240|  18.0M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  18.0M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
 1241|       |
 1242|  18.0M|          ptr_vec_x[2] = temp_r1 * mag_scaling_fac;
 1243|  18.0M|          ptr_vec_x[3] = temp_i1 * mag_scaling_fac;
 1244|       |
 1245|  18.0M|          ptr_vec_x += 4;
 1246|  18.0M|          ptr_in_buf += 256;
 1247|  18.0M|        }
 1248|  4.51M|        ptr_vec_x = &vec_x[0];
 1249|  4.51M|        temp_r = vec_x[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)];
  ------------------
  |  |   35|  4.51M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1250|  4.51M|        temp_i = vec_x[(2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)) + 1];
  ------------------
  |  |   35|  4.51M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1251|       |
 1252|  4.51M|        x_zero_band_r = temp_r * temp_r - temp_i * temp_i;
 1253|  4.51M|        x_zero_band_i = temp_r * temp_i + temp_i * temp_r;
 1254|       |
 1255|  40.6M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k++) {
  ------------------
  |  |   37|  40.6M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (1255:21): [True: 36.1M, False: 4.51M]
  ------------------
 1256|  36.1M|          temp_r = ptr_vec_x[0] * x_zero_band_r - ptr_vec_x[1] * x_zero_band_i;
 1257|  36.1M|          temp_i = ptr_vec_x[0] * x_zero_band_i + ptr_vec_x[1] * x_zero_band_r;
 1258|       |
 1259|  36.1M|          ptr_out_buf[0] += (temp_r * 0.4714045f);
 1260|  36.1M|          ptr_out_buf[1] += (temp_i * 0.4714045f);
 1261|       |
 1262|  36.1M|          ptr_vec_x += 2;
 1263|  36.1M|          ptr_out_buf += 128;
 1264|  36.1M|        }
 1265|       |
 1266|  4.51M|        ixheaace_hbe_xprod_proc_3(pstr_hbe_txposer, qmf_band_idx, i, p, pitch_in_bins_idx);
 1267|       |
 1268|  4.51M|        ptr_in_buf -= 128 * 11;
 1269|  4.51M|        ptr_out_buf -= 128 * 6;
 1270|  4.51M|      }
 1271|   279k|    } else {
 1272|   129k|      FLOAT32 *ptr_in_buf = &pstr_hbe_txposer->qmf_in_buf[0][2 * inp_band_idx];
 1273|   129k|      FLOAT32 *ptr_in_buf1 = &pstr_hbe_txposer->qmf_in_buf[0][2 * (inp_band_idx + 1)];
 1274|       |
 1275|  2.23M|      for (i = 0; i < qmf_voc_columns; i++) {
  ------------------
  |  Branch (1275:19): [True: 2.10M, False: 129k]
  ------------------
 1276|  2.10M|        WORD32 k;
 1277|  2.10M|        FLOAT32 vec_x[2 * IXHEAACE_HBE_OPER_WIN_LEN];
 1278|  2.10M|        FLOAT32 vec_x_cap[2 * IXHEAACE_HBE_OPER_WIN_LEN];
 1279|       |
 1280|  2.10M|        FLOAT32 x_zero_band_r, x_zero_band_i;
 1281|  2.10M|        FLOAT32 *ptr_vec_x = &vec_x[0];
 1282|  2.10M|        FLOAT32 *ptr_vec_x_cap = &vec_x_cap[0];
 1283|       |
 1284|  2.10M|        FLOAT32 mag_scaling_fac;
 1285|       |
 1286|  10.5M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k += 2) {
  ------------------
  |  |   37|  10.5M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (1286:21): [True: 8.40M, False: 2.10M]
  ------------------
 1287|  8.40M|          FLOAT32 tmp_vr, tmp_vi;
 1288|  8.40M|          FLOAT32 tmp_cr, tmp_ci;
 1289|  8.40M|          FLOAT64 base1;
 1290|  8.40M|          FLOAT64 base = 1e-17;
 1291|       |
 1292|  8.40M|          temp_r1 = ptr_in_buf[0];
 1293|  8.40M|          temp_i1 = ptr_in_buf[1];
 1294|  8.40M|          temp_r = ptr_in_buf1[0];
 1295|  8.40M|          temp_i = ptr_in_buf1[1];
 1296|       |
 1297|  8.40M|          base1 = base + temp_r * temp_r;
 1298|  8.40M|          base1 = base1 + temp_i * temp_i;
 1299|       |
 1300|  8.40M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  8.40M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
 1301|       |
 1302|  8.40M|          ptr_vec_x[0] = temp_r * mag_scaling_fac;
 1303|  8.40M|          ptr_vec_x[1] = temp_i * mag_scaling_fac;
 1304|       |
 1305|  8.40M|          base1 = base + temp_r1 * temp_r1;
 1306|  8.40M|          base1 = base1 + temp_i1 * temp_i1;
 1307|       |
 1308|  8.40M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  8.40M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
 1309|       |
 1310|  8.40M|          ptr_vec_x_cap[0] = temp_r1 * mag_scaling_fac;
 1311|  8.40M|          ptr_vec_x_cap[1] = temp_i1 * mag_scaling_fac;
 1312|       |
 1313|  8.40M|          ptr_in_buf += 256;
 1314|       |
 1315|  8.40M|          temp_r = ptr_in_buf[0];
 1316|  8.40M|          temp_i = ptr_in_buf[1];
 1317|       |
 1318|  8.40M|          temp_r1 = ptr_sel[0] * temp_r + ptr_sel[1] * temp_i;
 1319|  8.40M|          temp_i1 = ptr_sel[2] * temp_r + ptr_sel[3] * temp_i;
 1320|       |
 1321|  8.40M|          ptr_in_buf -= 128;
 1322|       |
 1323|  8.40M|          temp_r = ptr_in_buf[0];
 1324|  8.40M|          temp_i = ptr_in_buf[1];
 1325|       |
 1326|  8.40M|          tmp_cr = temp_r1 + ptr_sel[4] * temp_r + ptr_sel[5] * temp_i;
 1327|  8.40M|          tmp_ci = temp_i1 + ptr_sel[6] * temp_r + ptr_sel[7] * temp_i;
 1328|       |
 1329|  8.40M|          ptr_in_buf1 += 256;
 1330|       |
 1331|  8.40M|          temp_r = ptr_in_buf1[0];
 1332|  8.40M|          temp_i = ptr_in_buf1[1];
 1333|       |
 1334|  8.40M|          temp_r1 = ptr_sel1[0] * temp_r + ptr_sel1[1] * temp_i;
 1335|  8.40M|          temp_i1 = ptr_sel1[2] * temp_r + ptr_sel1[3] * temp_i;
 1336|       |
 1337|  8.40M|          ptr_in_buf1 -= 128;
 1338|       |
 1339|  8.40M|          temp_r = ptr_in_buf1[0];
 1340|  8.40M|          temp_i = ptr_in_buf1[1];
 1341|       |
 1342|  8.40M|          tmp_vr = temp_r1 + ptr_sel1[4] * temp_r + ptr_sel1[5] * temp_i;
 1343|  8.40M|          tmp_vi = temp_i1 + ptr_sel1[6] * temp_r + ptr_sel1[7] * temp_i;
 1344|       |
 1345|  8.40M|          tmp_cr *= 0.3984033437f;
 1346|  8.40M|          tmp_ci *= 0.3984033437f;
 1347|       |
 1348|  8.40M|          tmp_vr *= 0.3984033437f;
 1349|  8.40M|          tmp_vi *= 0.3984033437f;
 1350|       |
 1351|  8.40M|          base1 = base + tmp_vr * tmp_vr;
 1352|  8.40M|          base1 = base1 + tmp_vi * tmp_vi;
 1353|       |
 1354|  8.40M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  8.40M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
 1355|       |
 1356|  8.40M|          ptr_vec_x[2] = tmp_vr * mag_scaling_fac;
 1357|  8.40M|          ptr_vec_x[3] = tmp_vi * mag_scaling_fac;
 1358|       |
 1359|  8.40M|          base1 = base + tmp_cr * tmp_cr;
 1360|  8.40M|          base1 = base1 + tmp_ci * tmp_ci;
 1361|       |
 1362|  8.40M|          mag_scaling_fac = (FLOAT32)(ixheaace_cbrt_calc((FLOAT32)base1));
  ------------------
  |  |   74|  8.40M|#define ixheaace_cbrt_calc(a) (pow(a, -0.333333f))
  ------------------
 1363|       |
 1364|  8.40M|          ptr_vec_x_cap[2] = tmp_cr * mag_scaling_fac;
 1365|  8.40M|          ptr_vec_x_cap[3] = tmp_ci * mag_scaling_fac;
 1366|       |
 1367|  8.40M|          ptr_in_buf += 256;
 1368|  8.40M|          ptr_in_buf1 += 256;
 1369|  8.40M|          ptr_vec_x += 4;
 1370|  8.40M|          ptr_vec_x_cap += 4;
 1371|  8.40M|        }
 1372|  2.10M|        ptr_vec_x = &vec_x[0];
 1373|  2.10M|        ptr_vec_x_cap = &vec_x_cap[0];
 1374|       |
 1375|  2.10M|        temp_r = vec_x_cap[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)];
  ------------------
  |  |   35|  2.10M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1376|  2.10M|        temp_i = vec_x_cap[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2) + 1];
  ------------------
  |  |   35|  2.10M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1377|  2.10M|        temp_r1 = vec_x[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2)];
  ------------------
  |  |   35|  2.10M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1378|  2.10M|        temp_i1 = vec_x[2 * (IXHEAACE_HBE_ZERO_BAND_IDX - 2) + 1];
  ------------------
  |  |   35|  2.10M|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1379|       |
 1380|  2.10M|        x_zero_band_r = temp_r * temp_r - temp_i * temp_i;
 1381|  2.10M|        x_zero_band_i = temp_r * temp_i + temp_i * temp_r;
 1382|       |
 1383|  2.10M|        temp_r = temp_r1 * temp_r1 - temp_i1 * temp_i1;
 1384|  2.10M|        temp_i = temp_r1 * temp_i1 + temp_i1 * temp_r1;
 1385|       |
 1386|  18.9M|        for (k = 0; k < (IXHEAACE_HBE_OPER_BLK_LEN_3); k++) {
  ------------------
  |  |   37|  18.9M|#define IXHEAACE_HBE_OPER_BLK_LEN_3 (8)
  ------------------
  |  Branch (1386:21): [True: 16.8M, False: 2.10M]
  ------------------
 1387|  16.8M|          temp_r1 = ptr_vec_x[0] * x_zero_band_r - ptr_vec_x[1] * x_zero_band_i;
 1388|  16.8M|          temp_i1 = ptr_vec_x[0] * x_zero_band_i + ptr_vec_x[1] * x_zero_band_r;
 1389|       |
 1390|  16.8M|          temp_r1 += ptr_vec_x_cap[0] * temp_r - ptr_vec_x_cap[1] * temp_i;
 1391|  16.8M|          temp_i1 += ptr_vec_x_cap[0] * temp_i + ptr_vec_x_cap[1] * temp_r;
 1392|       |
 1393|  16.8M|          ptr_out_buf[0] += (temp_r1 * 0.23570225f);
 1394|  16.8M|          ptr_out_buf[1] += (temp_i1 * 0.23570225f);
 1395|       |
 1396|  16.8M|          ptr_out_buf += 128;
 1397|  16.8M|          ptr_vec_x += 2;
 1398|  16.8M|          ptr_vec_x_cap += 2;
 1399|  16.8M|        }
 1400|       |
 1401|  2.10M|        ixheaace_hbe_xprod_proc_3(pstr_hbe_txposer, qmf_band_idx, i, p, pitch_in_bins_idx);
 1402|       |
 1403|  2.10M|        ptr_in_buf -= 128 * 11;
 1404|  2.10M|        ptr_in_buf1 -= 128 * 11;
 1405|  2.10M|        ptr_out_buf -= 128 * 6;
 1406|  2.10M|      }
 1407|   129k|    }
 1408|       |
 1409|   409k|    ptr_out_buf -= (256 * qmf_voc_columns) - 2;
 1410|   409k|    qmf_band_idx++;
 1411|   409k|  }
 1412|  65.8k|}
ixheaace_hbe_post_anal_xprod4:
 1416|    321|                                   WORD32 pitch_in_bins_idx) {
 1417|    321|  WORD32 i, inp_band_idx;
 1418|    321|  FLOAT32 *ptr_out = &pstr_hbe_txposer->qmf_out_buf[3][2 * qmf_band_idx];
 1419|       |
 1420|    321|  ixheaace_norm_qmf_in_buf_4(pstr_hbe_txposer, ((qmf_band_idx >> 1) - 1));
 1421|       |
 1422|  3.92k|  while (qmf_band_idx < pstr_hbe_txposer->x_over_qmf[3]) {
  ------------------
  |  Branch (1422:10): [True: 3.60k, False: 321]
  ------------------
 1423|  3.60k|    WORD32 ip_idx;
 1424|  3.60k|    FLOAT32 temp, temp_r, temp_i;
 1425|  3.60k|    FLOAT32 *ptr_norm, *ptr_x_norm;
 1426|  3.60k|    inp_band_idx = qmf_band_idx >> 1;
 1427|  3.60k|    ip_idx = (qmf_band_idx & 1) ? (inp_band_idx + 1) : (inp_band_idx - 1);
  ------------------
  |  Branch (1427:14): [True: 1.88k, False: 1.71k]
  ------------------
 1428|       |
 1429|  3.60k|    ptr_norm = &pstr_hbe_txposer->norm_qmf_in_buf[0][2 * ip_idx];
 1430|  3.60k|    ptr_x_norm = &pstr_hbe_txposer->norm_qmf_in_buf[IXHEAACE_HBE_ZERO_BAND_IDX][2 * inp_band_idx];
  ------------------
  |  |   35|  3.60k|#define IXHEAACE_HBE_ZERO_BAND_IDX (6)
  ------------------
 1431|       |
 1432|   118k|    for (i = 0; i < qmf_voc_columns; i++) {
  ------------------
  |  Branch (1432:17): [True: 115k, False: 3.60k]
  ------------------
 1433|   115k|      WORD32 k;
 1434|   115k|      FLOAT32 x_zero_band_r, x_zero_band_i;
 1435|       |
 1436|   115k|      temp_r = x_zero_band_r = *ptr_x_norm++;
 1437|   115k|      temp_i = x_zero_band_i = *ptr_x_norm++;
 1438|       |
 1439|   115k|      temp = x_zero_band_r * x_zero_band_r - x_zero_band_i * x_zero_band_i;
 1440|   115k|      x_zero_band_i = x_zero_band_r * x_zero_band_i + x_zero_band_i * x_zero_band_r;
 1441|       |
 1442|   115k|      x_zero_band_r = temp_r * temp - temp_i * x_zero_band_i;
 1443|   115k|      x_zero_band_i = temp_r * x_zero_band_i + temp_i * temp;
 1444|       |
 1445|   807k|      for (k = 0; k < IXHEAACE_HBE_OPER_BLK_LEN_4; k++) {
  ------------------
  |  |   38|   807k|#define IXHEAACE_HBE_OPER_BLK_LEN_4 (6)
  ------------------
  |  Branch (1445:19): [True: 691k, False: 115k]
  ------------------
 1446|   691k|        temp = *ptr_norm++;
 1447|   691k|        temp_i = *ptr_norm++;
 1448|       |
 1449|   691k|        temp_r = temp * x_zero_band_r - temp_i * x_zero_band_i;
 1450|   691k|        temp_i = temp * x_zero_band_i + temp_i * x_zero_band_r;
 1451|       |
 1452|   691k|        *ptr_out++ += (temp_r * 0.6666667f);
 1453|   691k|        *ptr_out++ += (temp_i * 0.6666667f);
 1454|       |
 1455|   691k|        ptr_norm += 254;
 1456|   691k|        ptr_out += 126;
 1457|   691k|      }
 1458|       |
 1459|   115k|      ptr_norm -= 128 * 11;
 1460|   115k|      ptr_out -= 128 * 4;
 1461|   115k|      ptr_x_norm += 126;
 1462|       |
 1463|   115k|      ixheaace_hbe_xprod_proc_4(pstr_hbe_txposer, qmf_band_idx, i, p, pitch_in_bins_idx);
 1464|   115k|    }
 1465|       |
 1466|  3.60k|    ptr_out -= (128 * 2 * qmf_voc_columns) - 2;
 1467|  3.60k|    qmf_band_idx++;
 1468|  3.60k|  }
 1469|    321|}
ixheaace_hbe_post_anal_process:
 1472|   126k|                                            WORD32 pitch_in_bins, WORD32 sbr_upsamp_4_flg) {
 1473|   126k|  FLOAT32 p;
 1474|   126k|  WORD32 trans_fac;
 1475|   126k|  WORD32 qmf_voc_columns = pstr_hbe_txposer->no_bins / 2;
 1476|   126k|  FLOAT32 ptr_cos_sin_theta[2];
 1477|       |
 1478|   126k|  p = (sbr_upsamp_4_flg) ? (FLOAT32)(pitch_in_bins * 0.04166666666666)
  ------------------
  |  Branch (1478:7): [True: 45.5k, False: 81.1k]
  ------------------
 1479|   126k|                         : (FLOAT32)(pitch_in_bins * 0.08333333333333);
 1480|       |
 1481|   126k|  if (p < IXHEAACE_SBR_CONST_PMIN) {
  ------------------
  |  |   72|   126k|#define IXHEAACE_SBR_CONST_PMIN 1.0f
  ------------------
  |  Branch (1481:7): [True: 57.6k, False: 69.0k]
  ------------------
 1482|  57.6k|    trans_fac = 2;
 1483|  57.6k|    if (trans_fac <= pstr_hbe_txposer->max_stretch) {
  ------------------
  |  Branch (1483:9): [True: 57.6k, False: 0]
  ------------------
 1484|  57.6k|      ixheaace_hbe_post_anal_prod2(pstr_hbe_txposer, qmf_voc_columns,
 1485|  57.6k|                                   pstr_hbe_txposer->x_over_qmf[0]);
 1486|  57.6k|    }
 1487|       |
 1488|  57.6k|    trans_fac = 3;
 1489|  57.6k|    if (trans_fac <= pstr_hbe_txposer->max_stretch) {
  ------------------
  |  Branch (1489:9): [True: 56.8k, False: 760]
  ------------------
 1490|  56.8k|      ixheaace_hbe_post_anal_prod3(pstr_hbe_txposer, qmf_voc_columns,
 1491|  56.8k|                                   pstr_hbe_txposer->x_over_qmf[1]);
 1492|  56.8k|    }
 1493|       |
 1494|  57.6k|    trans_fac = 4;
 1495|  57.6k|    if (trans_fac <= pstr_hbe_txposer->max_stretch) {
  ------------------
  |  Branch (1495:9): [True: 45.2k, False: 12.4k]
  ------------------
 1496|  45.2k|      if (pstr_hbe_txposer->x_over_qmf[2] <= 1) {
  ------------------
  |  Branch (1496:11): [True: 0, False: 45.2k]
  ------------------
 1497|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_VALUE;
 1498|      0|      }
 1499|  45.2k|      ixheaace_hbe_post_anal_prod4(pstr_hbe_txposer, qmf_voc_columns,
 1500|  45.2k|                                   pstr_hbe_txposer->x_over_qmf[2]);
 1501|  45.2k|    }
 1502|  69.0k|  } else {
 1503|  69.0k|    trans_fac = 2;
 1504|  69.0k|    if (trans_fac <= pstr_hbe_txposer->max_stretch) {
  ------------------
  |  Branch (1504:9): [True: 69.0k, False: 0]
  ------------------
 1505|  69.0k|      ptr_cos_sin_theta[0] =
 1506|  69.0k|          ixheaac_hbe_x_prod_cos_table_trans_2[((pitch_in_bins + sbr_upsamp_4_flg * 128) << 1) +
 1507|  69.0k|                                               0];
 1508|  69.0k|      ptr_cos_sin_theta[1] =
 1509|  69.0k|          ixheaac_hbe_x_prod_cos_table_trans_2[((pitch_in_bins + sbr_upsamp_4_flg * 128) << 1) +
 1510|  69.0k|                                               1];
 1511|       |
 1512|  69.0k|      ixheaace_hbe_post_anal_xprod2(pstr_hbe_txposer, qmf_voc_columns,
 1513|  69.0k|                                    pstr_hbe_txposer->x_over_qmf[0], p, ptr_cos_sin_theta);
 1514|  69.0k|    }
 1515|       |
 1516|  69.0k|    trans_fac = 3;
 1517|  69.0k|    if (trans_fac <= pstr_hbe_txposer->max_stretch) {
  ------------------
  |  Branch (1517:9): [True: 65.8k, False: 3.19k]
  ------------------
 1518|  65.8k|      ixheaace_hbe_post_anal_xprod3(pstr_hbe_txposer, qmf_voc_columns,
 1519|  65.8k|                                    pstr_hbe_txposer->x_over_qmf[1], p,
 1520|  65.8k|                                    (pitch_in_bins + sbr_upsamp_4_flg * 128));
 1521|  65.8k|    }
 1522|       |
 1523|  69.0k|    trans_fac = 4;
 1524|  69.0k|    if (trans_fac <= pstr_hbe_txposer->max_stretch) {
  ------------------
  |  Branch (1524:9): [True: 321, False: 68.6k]
  ------------------
 1525|    321|      if (pstr_hbe_txposer->x_over_qmf[2] <= 1) {
  ------------------
  |  Branch (1525:11): [True: 0, False: 321]
  ------------------
 1526|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_VALUE;
 1527|      0|      }
 1528|    321|      ixheaace_hbe_post_anal_xprod4(pstr_hbe_txposer, qmf_voc_columns,
 1529|    321|                                    pstr_hbe_txposer->x_over_qmf[2], p,
 1530|    321|                                    (pitch_in_bins + sbr_upsamp_4_flg * 128));
 1531|    321|    }
 1532|  69.0k|  }
 1533|   126k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   126k|#define IA_NO_ERROR 0x00000000
  ------------------
 1534|   126k|}
ixheaace_hbe_repl_spec:
 1537|  45.5k|                            WORD32 no_bins, WORD32 max_stretch) {
 1538|  45.5k|  WORD32 patch_bands;
 1539|  45.5k|  WORD32 patch, band, col, target, source_bands, i;
 1540|  45.5k|  WORD32 num_patches = 0;
 1541|       |
 1542|   273k|  for (i = 1; i < IXHEAACE_MAX_NUM_PATCHES; i++) {
  ------------------
  |  |   26|   273k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (1542:15): [True: 227k, False: 45.5k]
  ------------------
 1543|   227k|    if (x_over_qmf[i] != 0) {
  ------------------
  |  Branch (1543:9): [True: 136k, False: 91.0k]
  ------------------
 1544|   136k|      num_patches++;
 1545|   136k|    }
 1546|   227k|  }
 1547|       |
 1548|  45.5k|  for (patch = (max_stretch - 1); patch < num_patches; patch++) {
  ------------------
  |  Branch (1548:35): [True: 0, False: 45.5k]
  ------------------
 1549|      0|    patch_bands = x_over_qmf[patch + 1] - x_over_qmf[patch];
 1550|      0|    target = x_over_qmf[patch];
 1551|      0|    source_bands = x_over_qmf[max_stretch - 1] - x_over_qmf[max_stretch - 2];
 1552|       |
 1553|      0|    while (patch_bands > 0) {
  ------------------
  |  Branch (1553:12): [True: 0, False: 0]
  ------------------
 1554|      0|      WORD32 ixheaace_num_bands = source_bands;
 1555|      0|      WORD32 start_band = x_over_qmf[max_stretch - 1] - 1;
 1556|      0|      if (target + ixheaace_num_bands >= x_over_qmf[patch + 1]) {
  ------------------
  |  Branch (1556:11): [True: 0, False: 0]
  ------------------
 1557|      0|        ixheaace_num_bands = x_over_qmf[patch + 1] - target;
 1558|      0|      }
 1559|      0|      if ((((target + ixheaace_num_bands - 1) & 1) + ((x_over_qmf[max_stretch - 1] - 1) & 1)) &
  ------------------
  |  Branch (1559:11): [True: 0, False: 0]
  ------------------
 1560|      0|          1) {
 1561|      0|        if (ixheaace_num_bands == source_bands) {
  ------------------
  |  Branch (1561:13): [True: 0, False: 0]
  ------------------
 1562|      0|          ixheaace_num_bands--;
 1563|      0|        } else {
 1564|      0|          start_band--;
 1565|      0|        }
 1566|      0|      }
 1567|       |
 1568|      0|      if (!ixheaace_num_bands) {
  ------------------
  |  Branch (1568:11): [True: 0, False: 0]
  ------------------
 1569|      0|        break;
 1570|      0|      }
 1571|       |
 1572|      0|      for (col = 0; col < no_bins; col++) {
  ------------------
  |  Branch (1572:21): [True: 0, False: 0]
  ------------------
 1573|      0|        band = target + ixheaace_num_bands - 1;
 1574|      0|        if (64 <= band) {
  ------------------
  |  Branch (1574:13): [True: 0, False: 0]
  ------------------
 1575|      0|          band = 63;
 1576|      0|        }
 1577|      0|        if (x_over_qmf[patch + 1] <= band) {
  ------------------
  |  Branch (1577:13): [True: 0, False: 0]
  ------------------
 1578|      0|          band = x_over_qmf[patch + 1] - 1;
 1579|      0|        }
 1580|      0|        for (i = 0; i < ixheaace_num_bands; i++, band--) {
  ------------------
  |  Branch (1580:21): [True: 0, False: 0]
  ------------------
 1581|      0|          qmf_buf_real[col][band] = qmf_buf_real[col][start_band - i];
 1582|      0|          qmf_buf_imag[col][band] = qmf_buf_imag[col][start_band - i];
 1583|      0|        }
 1584|      0|      }
 1585|      0|      target += ixheaace_num_bands;
 1586|      0|      patch_bands -= ixheaace_num_bands;
 1587|      0|    }
 1588|      0|  }
 1589|  45.5k|}
ixheaace_sbr_hbe_trans.c:ixheaace_map_prot_filter:
   38|  40.7k|static FLOAT32 *ixheaace_map_prot_filter(WORD32 filt_length) {
   39|  40.7k|  switch (filt_length) {
   40|      0|    case 4:
  ------------------
  |  Branch (40:5): [True: 0, False: 40.7k]
  ------------------
   41|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[0];
   42|      0|      break;
   43|      0|    case 8:
  ------------------
  |  Branch (43:5): [True: 0, False: 40.7k]
  ------------------
   44|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[40];
   45|      0|      break;
   46|    858|    case 12:
  ------------------
  |  Branch (46:5): [True: 858, False: 39.8k]
  ------------------
   47|    858|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[120];
   48|      0|      break;
   49|    858|    case 16:
  ------------------
  |  Branch (49:5): [True: 858, False: 39.8k]
  ------------------
   50|    858|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[240];
   51|      0|      break;
   52|  18.6k|    case 20:
  ------------------
  |  Branch (52:5): [True: 18.6k, False: 22.0k]
  ------------------
   53|  18.6k|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[400];
   54|      0|      break;
   55|    858|    case 24:
  ------------------
  |  Branch (55:5): [True: 858, False: 39.8k]
  ------------------
   56|    858|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[600];
   57|      0|      break;
   58|    858|    case 32:
  ------------------
  |  Branch (58:5): [True: 858, False: 39.8k]
  ------------------
   59|    858|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[840];
   60|      0|      break;
   61|  18.6k|    case 40:
  ------------------
  |  Branch (61:5): [True: 18.6k, False: 22.0k]
  ------------------
   62|  18.6k|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[1160];
   63|      0|      break;
   64|      0|    default:
  ------------------
  |  Branch (64:5): [True: 0, False: 40.7k]
  ------------------
   65|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[0];
   66|  40.7k|  }
   67|  40.7k|}

ixheaace_qmf_inverse_filtering_detector:
  196|   579k|                                             ixheaace_invf_mode *ptr_inf_vec, WORD32 is_ld_sbr) {
  197|   579k|  WORD32 band;
  198|       |
  199|  2.13M|  for (band = 0; band < pstr_inv_filt->no_detector_bands; band++) {
  ------------------
  |  Branch (199:18): [True: 1.55M, False: 579k]
  ------------------
  200|  1.55M|    WORD32 start_channel = pstr_inv_filt->freq_band_tab_inv_filt[band];
  201|  1.55M|    WORD32 stop_channel = pstr_inv_filt->freq_band_tab_inv_filt[band + 1];
  202|       |
  203|  1.55M|    ixheaace_calculate_detector_values(ptr_quota_mtx, ptr_idx_vx, ptr_energy_vec,
  204|  1.55M|                                       &pstr_inv_filt->detector_values[band], start_channel,
  205|  1.55M|                                       stop_channel, start_index, stop_index);
  206|       |
  207|  1.55M|    ptr_inf_vec[band] = ixheaace_decision_algorithm(
  208|  1.55M|        pstr_inv_filt->ptr_detector_params, pstr_inv_filt->detector_values[band], transient_flag,
  209|  1.55M|        &pstr_inv_filt->prev_region_sbr[band], &pstr_inv_filt->prev_region_orig[band], is_ld_sbr);
  210|  1.55M|  }
  211|   579k|}
ixheaace_create_inv_filt_detector:
  225|  8.64k|                                       ixheaace_str_qmf_tabs *ptr_qmf_tab) {
  226|  8.64k|  WORD32 i;
  227|       |
  228|  8.64k|  memset(pstr_inv_filt, 0, sizeof(ixheaace_str_sbr_inv_filt_est));
  229|       |
  230|  8.64k|  if (use_speech_config) {
  ------------------
  |  Branch (230:7): [True: 1.53k, False: 7.10k]
  ------------------
  231|  1.53k|    pstr_inv_filt->ptr_detector_params = &(ptr_qmf_tab->detector_params_aac_speech);
  232|  7.10k|  } else {
  233|  7.10k|    pstr_inv_filt->ptr_detector_params = &(ptr_qmf_tab->detector_params_aac);
  234|  7.10k|  }
  235|       |
  236|  8.64k|  pstr_inv_filt->no_detector_bands_max = num_det_bands;
  237|       |
  238|  31.3k|  for (i = 0; i < pstr_inv_filt->no_detector_bands_max; i++) {
  ------------------
  |  Branch (238:15): [True: 22.6k, False: 8.64k]
  ------------------
  239|  22.6k|    memset(&pstr_inv_filt->detector_values[i], 0, sizeof(ixheaace_str_detector_values));
  240|       |
  241|  22.6k|    pstr_inv_filt->prev_invf_mode[i] = IXHEAACE_INVF_OFF;
  242|  22.6k|    pstr_inv_filt->prev_region_orig[i] = 0;
  243|  22.6k|    pstr_inv_filt->prev_region_sbr[i] = 0;
  244|  22.6k|  }
  245|       |
  246|  8.64k|  ixheaace_reset_inv_filt_detector(pstr_inv_filt, ptr_freq_band_tab_detector,
  247|  8.64k|                                   pstr_inv_filt->no_detector_bands_max);
  248|  8.64k|}
ixheaace_sbr_inv_filtering_estimation.c:ixheaace_calculate_detector_values:
   47|  1.55M|                                               WORD32 start_index, WORD32 stop_index) {
   48|  1.55M|  WORD32 i, j;
   49|       |
   50|  1.55M|  FLOAT32 quota_vec_org[IXHEAACE_QMF_CHANNELS] = {0};
   51|  1.55M|  FLOAT32 quota_vec_sbr[IXHEAACE_QMF_CHANNELS] = {0};
   52|  1.55M|  FLOAT32 org_quota = 0.0f, sbr_quota = 0.0f;
   53|       |
   54|  1.55M|  ptr_detector_values->avg_energy = 0.0f;
   55|  4.65M|  for (j = start_index; j < stop_index; j++) {
  ------------------
  |  Branch (55:25): [True: 3.10M, False: 1.55M]
  ------------------
   56|  37.6M|    for (i = start_channel; i < stop_channel; i++) {
  ------------------
  |  Branch (56:29): [True: 34.5M, False: 3.10M]
  ------------------
   57|  34.5M|      quota_vec_org[i] += ptr_quota_mtx_org[j][i];
   58|  34.5M|      if (ptr_idx_vx[i] != -1) {
  ------------------
  |  Branch (58:11): [True: 34.5M, False: 0]
  ------------------
   59|  34.5M|        quota_vec_sbr[i] += ptr_quota_mtx_org[j][ptr_idx_vx[i]];
   60|  34.5M|      }
   61|  34.5M|    }
   62|  3.10M|    ptr_detector_values->avg_energy += ptr_energy_vec[j];
   63|  3.10M|  }
   64|  1.55M|  ptr_detector_values->avg_energy /= (stop_index - start_index);
   65|  1.55M|  org_quota = 0.0f;
   66|  1.55M|  sbr_quota = 0.0f;
   67|       |
   68|  18.8M|  for (i = start_channel; i < stop_channel; i++) {
  ------------------
  |  Branch (68:27): [True: 17.2M, False: 1.55M]
  ------------------
   69|  17.2M|    quota_vec_org[i] /= (stop_index - start_index);
   70|  17.2M|    quota_vec_sbr[i] /= (stop_index - start_index);
   71|  17.2M|    org_quota += quota_vec_org[i];
   72|  17.2M|    sbr_quota += quota_vec_sbr[i];
   73|  17.2M|  }
   74|       |
   75|  1.55M|  org_quota /= (stop_channel - start_channel);
   76|  1.55M|  sbr_quota /= (stop_channel - start_channel);
   77|       |
   78|  1.55M|  memmove(ptr_detector_values->org_quota_mean, ptr_detector_values->org_quota_mean + 1,
   79|  1.55M|          IXHEAACE_INVF_SMOOTHING_LENGTH * sizeof(ptr_detector_values->org_quota_mean[0]));
  ------------------
  |  |   24|  1.55M|#define IXHEAACE_INVF_SMOOTHING_LENGTH (2)
  ------------------
   80|  1.55M|  memmove(ptr_detector_values->sbr_quota_mean, ptr_detector_values->sbr_quota_mean + 1,
   81|  1.55M|          IXHEAACE_INVF_SMOOTHING_LENGTH * sizeof(ptr_detector_values->org_quota_mean[0]));
  ------------------
  |  |   24|  1.55M|#define IXHEAACE_INVF_SMOOTHING_LENGTH (2)
  ------------------
   82|       |
   83|  1.55M|  ptr_detector_values->org_quota_mean[IXHEAACE_INVF_SMOOTHING_LENGTH] = org_quota;
  ------------------
  |  |   24|  1.55M|#define IXHEAACE_INVF_SMOOTHING_LENGTH (2)
  ------------------
   84|  1.55M|  ptr_detector_values->sbr_quota_mean[IXHEAACE_INVF_SMOOTHING_LENGTH] = sbr_quota;
  ------------------
  |  |   24|  1.55M|#define IXHEAACE_INVF_SMOOTHING_LENGTH (2)
  ------------------
   85|       |
   86|  1.55M|  ptr_detector_values->org_quota_mean_filt = 0.0f;
   87|  1.55M|  ptr_detector_values->sbr_quota_mean_filt = 0.0f;
   88|       |
   89|  6.20M|  for (i = 0; i < IXHEAACE_INVF_SMOOTHING_LENGTH + 1; i++) {
  ------------------
  |  |   24|  6.20M|#define IXHEAACE_INVF_SMOOTHING_LENGTH (2)
  ------------------
  |  Branch (89:15): [True: 4.65M, False: 1.55M]
  ------------------
   90|  4.65M|    ptr_detector_values->org_quota_mean_filt +=
   91|  4.65M|        ptr_detector_values->org_quota_mean[i] * filter[i];
   92|  4.65M|    ptr_detector_values->sbr_quota_mean_filt +=
   93|  4.65M|        ptr_detector_values->sbr_quota_mean[i] * filter[i];
   94|  4.65M|  }
   95|  1.55M|}
ixheaace_sbr_inv_filtering_estimation.c:ixheaace_decision_algorithm:
  121|  1.55M|    WORD32 *ptr_prev_region_sbr, WORD32 *ptr_prev_region_orig, WORD32 is_ld_sbr) {
  122|  1.55M|  WORD32 inv_filt_level, region_sbr, region_orig, region_nrg;
  123|       |
  124|  1.55M|  const WORD32 hysteresis = 1;
  125|  1.55M|  const WORD32 num_regions_sbr = ptr_detector_params->num_regions_sbr;
  126|  1.55M|  const WORD32 num_regions_orig = ptr_detector_params->num_regions_orig;
  127|  1.55M|  const WORD32 num_regions_nrg = ptr_detector_params->num_regions_nrg;
  128|       |
  129|  1.55M|  FLOAT32 quant_steps_sbr_tmp[IXHEAACE_MAX_NUM_REGIONS];
  130|  1.55M|  FLOAT32 quant_steps_org_tmp[IXHEAACE_MAX_NUM_REGIONS];
  131|       |
  132|  1.55M|  FLOAT32 org_quota_mean_filt, sbr_quota_mean_filt, energy;
  133|  1.55M|  if (is_ld_sbr) {
  ------------------
  |  Branch (133:7): [True: 392k, False: 1.15M]
  ------------------
  134|   392k|    org_quota_mean_filt =
  135|   392k|        (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.org_quota_mean_filt + EPS));
  ------------------
  |  |   38|   392k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                      (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.org_quota_mean_filt + EPS));
  ------------------
  |  |   33|   392k|#define EPS (1e-18)
  ------------------
  136|       |
  137|   392k|    sbr_quota_mean_filt =
  138|   392k|        (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.sbr_quota_mean_filt + EPS));
  ------------------
  |  |   38|   392k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                      (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.sbr_quota_mean_filt + EPS));
  ------------------
  |  |   33|   392k|#define EPS (1e-18)
  ------------------
  139|       |
  140|   392k|    energy = (FLOAT32)(SBR_INV_LOG_2 * 1.5f * log(ptr_detector_values.avg_energy + EPS));
  ------------------
  |  |   38|   392k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                  energy = (FLOAT32)(SBR_INV_LOG_2 * 1.5f * log(ptr_detector_values.avg_energy + EPS));
  ------------------
  |  |   33|   392k|#define EPS (1e-18)
  ------------------
  141|  1.15M|  } else {
  142|  1.15M|    org_quota_mean_filt =
  143|  1.15M|        (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.org_quota_mean_filt * EPS));
  ------------------
  |  |   38|  1.15M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                      (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.org_quota_mean_filt * EPS));
  ------------------
  |  |   33|  1.15M|#define EPS (1e-18)
  ------------------
  144|  1.15M|    sbr_quota_mean_filt =
  145|  1.15M|        (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.sbr_quota_mean_filt * EPS));
  ------------------
  |  |   38|  1.15M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                      (FLOAT32)(SBR_INV_LOG_2 * 3.0f * log(ptr_detector_values.sbr_quota_mean_filt * EPS));
  ------------------
  |  |   33|  1.15M|#define EPS (1e-18)
  ------------------
  146|  1.15M|    energy = (FLOAT32)(SBR_INV_LOG_2 * 1.5f * log(ptr_detector_values.avg_energy * EPS));
  ------------------
  |  |   38|  1.15M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                  energy = (FLOAT32)(SBR_INV_LOG_2 * 1.5f * log(ptr_detector_values.avg_energy * EPS));
  ------------------
  |  |   33|  1.15M|#define EPS (1e-18)
  ------------------
  147|  1.15M|  }
  148|  1.55M|  memcpy(quant_steps_org_tmp, ptr_detector_params->quant_steps_org,
  149|  1.55M|         num_regions_orig * sizeof(quant_steps_org_tmp[0]));
  150|  1.55M|  memcpy(quant_steps_sbr_tmp, ptr_detector_params->quant_steps_sbr,
  151|  1.55M|         num_regions_sbr * sizeof(quant_steps_org_tmp[0]));
  152|       |
  153|  1.55M|  if (*ptr_prev_region_sbr < num_regions_sbr) {
  ------------------
  |  Branch (153:7): [True: 1.47M, False: 78.2k]
  ------------------
  154|  1.47M|    quant_steps_sbr_tmp[*ptr_prev_region_sbr] =
  155|  1.47M|        ptr_detector_params->quant_steps_sbr[*ptr_prev_region_sbr] + (FLOAT32)hysteresis;
  156|  1.47M|  }
  157|       |
  158|  1.55M|  if (*ptr_prev_region_sbr > 0) {
  ------------------
  |  Branch (158:7): [True: 125k, False: 1.42M]
  ------------------
  159|   125k|    quant_steps_sbr_tmp[*ptr_prev_region_sbr - 1] =
  160|   125k|        ptr_detector_params->quant_steps_sbr[*ptr_prev_region_sbr - 1] - (FLOAT32)hysteresis;
  161|   125k|  }
  162|       |
  163|  1.55M|  if (*ptr_prev_region_orig < num_regions_orig) {
  ------------------
  |  Branch (163:7): [True: 1.42M, False: 125k]
  ------------------
  164|  1.42M|    quant_steps_org_tmp[*ptr_prev_region_orig] =
  165|  1.42M|        ptr_detector_params->quant_steps_org[*ptr_prev_region_orig] + (FLOAT32)hysteresis;
  166|  1.42M|  }
  167|       |
  168|  1.55M|  if (*ptr_prev_region_orig > 0) {
  ------------------
  |  Branch (168:7): [True: 176k, False: 1.37M]
  ------------------
  169|   176k|    quant_steps_org_tmp[*ptr_prev_region_orig - 1] =
  170|   176k|        ptr_detector_params->quant_steps_org[*ptr_prev_region_orig - 1] - (FLOAT32)hysteresis;
  171|   176k|  }
  172|       |
  173|  1.55M|  region_sbr = ixheaace_find_region(sbr_quota_mean_filt, quant_steps_sbr_tmp, num_regions_sbr);
  174|       |
  175|  1.55M|  region_orig = ixheaace_find_region(org_quota_mean_filt, quant_steps_org_tmp, num_regions_orig);
  176|       |
  177|  1.55M|  region_nrg = ixheaace_find_region(energy, ptr_detector_params->energy_brdrs, num_regions_nrg);
  178|       |
  179|  1.55M|  *ptr_prev_region_sbr = region_sbr;
  180|  1.55M|  *ptr_prev_region_orig = region_orig;
  181|       |
  182|  1.55M|  inv_filt_level = (transient_flag == 1)
  ------------------
  |  Branch (182:20): [True: 158k, False: 1.39M]
  ------------------
  183|  1.55M|                       ? ptr_detector_params->region_space_transient[region_sbr][region_orig]
  184|  1.55M|                       : ptr_detector_params->region_space[region_sbr][region_orig];
  185|       |
  186|  1.55M|  inv_filt_level =
  187|  1.55M|      ixheaac_max32(inv_filt_level + ptr_detector_params->energy_comp_factor[region_nrg], 0);
  188|       |
  189|  1.55M|  return (ixheaace_invf_mode)(inv_filt_level);
  190|  1.55M|}
ixheaace_sbr_inv_filtering_estimation.c:ixheaace_find_region:
   98|  4.65M|                                   const WORD32 num_borders) {
   99|  4.65M|  WORD32 i;
  100|       |
  101|  4.65M|  if (curr_val < ptr_borders[0]) {
  ------------------
  |  Branch (101:7): [True: 3.55M, False: 1.10M]
  ------------------
  102|  3.55M|    return 0;
  103|  3.55M|  }
  104|       |
  105|  4.16M|  for (i = 1; i < num_borders; i++) {
  ------------------
  |  Branch (105:15): [True: 3.16M, False: 998k]
  ------------------
  106|  3.16M|    if (curr_val >= ptr_borders[i - 1] && curr_val < ptr_borders[i]) {
  ------------------
  |  Branch (106:9): [True: 1.64M, False: 1.51M]
  |  Branch (106:43): [True: 104k, False: 1.53M]
  ------------------
  107|   104k|      return i;
  108|   104k|    }
  109|  3.16M|  }
  110|       |
  111|   998k|  if (curr_val > ptr_borders[num_borders - 1]) {
  ------------------
  |  Branch (111:7): [True: 492k, False: 506k]
  ------------------
  112|   492k|    return num_borders;
  113|   492k|  }
  114|       |
  115|   506k|  return 0;
  116|   998k|}
ixheaace_sbr_inv_filtering_estimation.c:ixheaace_reset_inv_filt_detector:
  215|  8.64k|                                             WORD32 num_det_bands) {
  216|  8.64k|  memcpy(pstr_inv_filt->freq_band_tab_inv_filt, ptr_freq_band_tab_detector,
  217|  8.64k|         (num_det_bands + 1) * sizeof(pstr_inv_filt->freq_band_tab_inv_filt[0]));
  218|       |
  219|  8.64k|  pstr_inv_filt->no_detector_bands = num_det_bands;
  220|  8.64k|}

ixheaace_set_usac_sbr_params:
   79|   211k|                                  WORD32 sbr_patching_mode) {
   80|   211k|  WORD32 ch;
   81|   211k|  pstr_env_enc->str_sbr_bs.usac_indep_flag = usac_indep_flag;
   82|   211k|  pstr_env_enc->str_sbr_hdr.sbr_pre_proc = sbr_pre_proc;
   83|   211k|  pstr_env_enc->str_sbr_hdr.sbr_pvc_active = sbr_pvc_active;
   84|   211k|  if (pstr_env_enc->str_sbr_cfg.num_ch == 2) {
  ------------------
  |  Branch (84:7): [True: 70.5k, False: 140k]
  ------------------
   85|  70.5k|    pstr_env_enc->str_sbr_hdr.sbr_pvc_mode = 0;
   86|   140k|  } else {
   87|   140k|    pstr_env_enc->str_sbr_hdr.sbr_pvc_mode = sbr_pvc_mode;
   88|   140k|  }
   89|   211k|  pstr_env_enc->str_sbr_hdr.sbr_inter_tes_active = inter_tes_active;
   90|   211k|  pstr_env_enc->str_sbr_hdr.sbr_harmonic = sbr_harmonic;
   91|   493k|  for (ch = 0; ch < pstr_env_enc->str_sbr_cfg.num_ch; ch++) {
  ------------------
  |  Branch (91:16): [True: 281k, False: 211k]
  ------------------
   92|   281k|    pstr_env_enc->pstr_env_channel[ch]->enc_env_data.sbr_inter_tes = inter_tes_active;
   93|   281k|    pstr_env_enc->pstr_env_channel[ch]->enc_env_data.sbr_patching_mode = sbr_patching_mode;
   94|   281k|  }
   95|   211k|}
ixheaace_get_hbe_resample_buffer:
   96|   117k|FLOAT32 *ixheaace_get_hbe_resample_buffer(ixheaace_pstr_sbr_enc pstr_env_enc) {
   97|   117k|  return pstr_env_enc->ptr_hbe_resample_buf;
   98|   117k|}
ixheaace_is_sbr_setting_available:
  383|  3.23k|                                  ixheaace_str_qmf_tabs *pstr_qmf_tab, WORD32 aot) {
  384|  3.23k|  FLAG table_found = IXHEAACE_TABLE_IDX_NOT_FOUND;
  ------------------
  |  |   23|  3.23k|#define IXHEAACE_TABLE_IDX_NOT_FOUND (-1)
  ------------------
  385|  3.23k|  WORD32 idx_sr;
  386|  3.23k|  WORD32 idx_ch;
  387|  3.23k|  WORD32 idx_entry;
  388|       |
  389|  3.23k|  switch (num_output_channels) {
  ------------------
  |  Branch (389:11): [True: 3.23k, False: 0]
  ------------------
  390|  1.75k|    case MONO:
  ------------------
  |  Branch (390:5): [True: 1.75k, False: 1.48k]
  ------------------
  391|  1.75k|      if (sample_rate_input < 16000 || sample_rate_input > 48000) {
  ------------------
  |  Branch (391:11): [True: 0, False: 1.75k]
  |  Branch (391:40): [True: 14, False: 1.73k]
  ------------------
  392|     14|        return 0;
  393|     14|      }
  394|  3.21k|    case STEREO:
  ------------------
  |  Branch (394:5): [True: 1.48k, False: 1.75k]
  ------------------
  395|  3.21k|      if (sample_rate_input < 32000 || sample_rate_input > 48000) {
  ------------------
  |  Branch (395:11): [True: 0, False: 3.21k]
  |  Branch (395:40): [True: 4, False: 3.21k]
  ------------------
  396|      4|        return 0;
  397|      4|      }
  398|  3.23k|  }
  399|       |
  400|  3.21k|  *ptr_core_sr = sample_rate_input / 2;
  401|       |
  402|  3.21k|  table_found = ia_enhaacplus_enc_get_sbr_tuning_table_idx(
  403|  3.21k|      bitrate, num_output_channels, *ptr_core_sr, pstr_qmf_tab, NULL, &idx_sr, &idx_ch,
  404|  3.21k|      &idx_entry,
  405|  3.21k|      ((AOT_AAC_ELD == aot) ? pstr_qmf_tab->sbr_tuning_table_ld
  ------------------
  |  |   37|  3.21k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (405:8): [True: 1.27k, False: 1.94k]
  ------------------
  406|  3.21k|                            : pstr_qmf_tab->sbr_tuning_table_lc));
  407|       |
  408|  3.21k|  return (table_found == IXHEAACE_TABLE_IDX_NOT_FOUND) ? 0 : 1;
  ------------------
  |  |   23|  3.21k|#define IXHEAACE_TABLE_IDX_NOT_FOUND (-1)
  ------------------
  |  Branch (408:10): [True: 0, False: 3.21k]
  ------------------
  409|  3.23k|}
ixheaace_sbr_limit_bitrate:
  412|  8.15k|                                   ixheaace_str_qmf_tabs *pstr_qmf_tab, WORD32 aot) {
  413|  8.15k|  UWORD32 new_bit_rate;
  414|  8.15k|  WORD32 index;
  415|  8.15k|  WORD32 idx_sr;
  416|  8.15k|  WORD32 idx_ch;
  417|  8.15k|  WORD32 idx_entry;
  418|       |
  419|  8.15k|  index = ia_enhaacplus_enc_get_sbr_tuning_table_idx(
  420|  8.15k|      bit_rate, num_ch, core_sample_rate, pstr_qmf_tab, &new_bit_rate, &idx_sr, &idx_ch,
  421|  8.15k|      &idx_entry,
  422|  8.15k|      ((AOT_AAC_ELD == aot) ? pstr_qmf_tab->sbr_tuning_table_ld
  ------------------
  |  |   37|  8.15k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (422:8): [True: 2.52k, False: 5.63k]
  ------------------
  423|  8.15k|                            : pstr_qmf_tab->sbr_tuning_table_lc));
  424|  8.15k|  if (index != IXHEAACE_TABLE_IDX_NOT_FOUND) {
  ------------------
  |  |   23|  8.15k|#define IXHEAACE_TABLE_IDX_NOT_FOUND (-1)
  ------------------
  |  Branch (424:7): [True: 7.24k, False: 916]
  ------------------
  425|  7.24k|    new_bit_rate = bit_rate;
  426|  7.24k|  }
  427|       |
  428|  8.15k|  return new_bit_rate;
  429|  8.15k|}
ixheaace_adjust_sbr_settings:
  434|  6.15k|                                  WORD32 aot, WORD32 is_esbr_4_1) {
  435|  6.15k|  FLAG table_found = IXHEAACE_TABLE_IDX_NOT_FOUND;
  ------------------
  |  |   23|  6.15k|#define IXHEAACE_TABLE_IDX_NOT_FOUND (-1)
  ------------------
  436|  6.15k|  WORD32 idx_sr = 0;
  437|  6.15k|  WORD32 idx_ch = 0;
  438|  6.15k|  WORD32 idx_entry = 0;
  439|       |  /* set the codec settings */
  440|  6.15k|  pstr_config->codec_settings.bit_rate = bit_rate;
  441|  6.15k|  pstr_config->codec_settings.num_channels = num_ch;
  442|  6.15k|  pstr_config->codec_settings.sample_freq = fs_core;
  443|  6.15k|  pstr_config->codec_settings.trans_fac = trans_fac;
  444|  6.15k|  pstr_config->codec_settings.standard_bitrate = std_br;
  445|       |
  446|  6.15k|  if (bit_rate <= 20000) {
  ------------------
  |  Branch (446:7): [True: 1.25k, False: 4.90k]
  ------------------
  447|  1.25k|    pstr_config->parametric_coding = 0;
  448|  1.25k|    pstr_config->use_speech_config = 1;
  449|  1.25k|  }
  450|       |
  451|  6.15k|  table_found = ia_enhaacplus_enc_get_sbr_tuning_table_idx(
  452|  6.15k|      bit_rate, num_ch, fs_core, pstr_qmf_tab, NULL, &idx_sr, &idx_ch, &idx_entry,
  453|  6.15k|      ((AOT_AAC_ELD == aot) ? pstr_qmf_tab->sbr_tuning_table_ld
  ------------------
  |  |   37|  6.15k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (453:8): [True: 1.27k, False: 4.88k]
  ------------------
  454|  6.15k|                            : pstr_qmf_tab->sbr_tuning_table_lc));
  455|       |
  456|  6.15k|  if (table_found == IXHEAACE_TABLE_IDX_NOT_FOUND) {
  ------------------
  |  |   23|  6.15k|#define IXHEAACE_TABLE_IDX_NOT_FOUND (-1)
  ------------------
  |  Branch (456:7): [True: 366, False: 5.78k]
  ------------------
  457|    366|    if (aot == AOT_USAC) {
  ------------------
  |  |   38|    366|#define AOT_USAC (42)
  ------------------
  |  Branch (457:9): [True: 366, False: 0]
  ------------------
  458|    366|      if (num_ch == 1) {
  ------------------
  |  Branch (458:11): [True: 49, False: 317]
  ------------------
  459|     49|        if (bit_rate >= 30000) {
  ------------------
  |  Branch (459:13): [True: 10, False: 39]
  ------------------
  460|     10|          pstr_config->start_freq = 7;
  461|     10|          pstr_config->stop_freq = 9;
  462|     39|        } else {
  463|     39|          pstr_config->start_freq = 5;
  464|     39|          pstr_config->stop_freq = 7;
  465|     39|        }
  466|    317|      } else {
  467|    317|        pstr_config->start_freq = 12;
  468|    317|        pstr_config->stop_freq = 9;
  469|    317|      }
  470|    366|    }
  471|  5.78k|  } else {
  472|  5.78k|    switch (aot) {
  473|  1.27k|      case AOT_AAC_ELD: {
  ------------------
  |  |   37|  1.27k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (473:7): [True: 1.27k, False: 4.51k]
  ------------------
  474|  1.27k|        pstr_config->start_freq =
  475|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].freq_band.start_freq;
  476|  1.27k|        pstr_config->stop_freq =
  477|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].freq_band.stop_freq;
  478|       |
  479|  1.27k|        pstr_config->sbr_noise_bands =
  480|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].noise.num_noise_bands;
  481|       |
  482|  1.27k|        pstr_config->noise_floor_offset =
  483|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].noise.noise_floor_offset;
  484|       |
  485|  1.27k|        pstr_config->ana_max_level =
  486|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].noise.noise_max_level;
  487|  1.27k|        pstr_config->stereo_mode =
  488|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].stereo_mode;
  489|  1.27k|        pstr_config->freq_scale =
  490|  1.27k|            pstr_qmf_tab->sbr_tuning_table_ld[idx_sr][idx_ch][idx_entry].freq_scale;
  491|  1.27k|        break;
  492|      0|      }
  493|  4.51k|      default: {
  ------------------
  |  Branch (493:7): [True: 4.51k, False: 1.27k]
  ------------------
  494|  4.51k|        pstr_config->start_freq =
  495|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].freq_band.start_freq;
  496|  4.51k|        pstr_config->stop_freq =
  497|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].freq_band.stop_freq;
  498|       |
  499|  4.51k|        pstr_config->sbr_noise_bands =
  500|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].noise.num_noise_bands;
  501|       |
  502|  4.51k|        pstr_config->noise_floor_offset =
  503|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].noise.noise_floor_offset;
  504|       |
  505|  4.51k|        pstr_config->ana_max_level =
  506|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].noise.noise_max_level;
  507|  4.51k|        pstr_config->stereo_mode =
  508|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].stereo_mode;
  509|  4.51k|        pstr_config->freq_scale =
  510|  4.51k|            pstr_qmf_tab->sbr_tuning_table_lc[idx_sr][idx_ch][idx_entry].freq_scale;
  511|  4.51k|        break;
  512|      0|      }
  513|  5.78k|    }
  514|       |
  515|  5.78k|    if (pstr_config->sbr_codec == ELD_SBR) {
  ------------------
  |  Branch (515:9): [True: 1.27k, False: 4.51k]
  ------------------
  516|  1.27k|      pstr_config->send_header_data_time = -1;
  517|  1.27k|      if ((num_ch == NUM_CHANS_MONO) && (bit_rate <= 22000)) {
  ------------------
  |  |  113|  1.27k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (517:11): [True: 673, False: 600]
  |  Branch (517:41): [True: 324, False: 349]
  ------------------
  518|    324|        pstr_config->use_low_freq_res = 1;
  519|    324|      }
  520|  1.27k|      if ((num_ch == NUM_CHANS_STEREO) && (bit_rate <= 48000)) {
  ------------------
  |  |  114|  1.27k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (520:11): [True: 600, False: 673]
  |  Branch (520:43): [True: 328, False: 272]
  ------------------
  521|    328|        pstr_config->use_low_freq_res = 1;
  522|    328|      }
  523|  1.27k|    }
  524|  4.51k|    else {
  525|  4.51k|      if ((num_ch == NUM_CHANS_MONO) && (bit_rate <= 18000)) {
  ------------------
  |  |  113|  4.51k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (525:11): [True: 2.92k, False: 1.59k]
  |  Branch (525:41): [True: 585, False: 2.33k]
  ------------------
  526|    585|        pstr_config->use_low_freq_res = 1;
  527|    585|      }
  528|  4.51k|      if ((num_ch == NUM_CHANS_STEREO) && (bit_rate <= 28000)) {
  ------------------
  |  |  114|  4.51k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (528:11): [True: 1.59k, False: 2.92k]
  |  Branch (528:43): [True: 483, False: 1.11k]
  ------------------
  529|    483|        pstr_config->use_low_freq_res = 1;
  530|    483|      }
  531|  4.51k|    }
  532|  5.78k|    if (bit_rate <= 20000) {
  ------------------
  |  Branch (532:9): [True: 1.23k, False: 4.55k]
  ------------------
  533|  1.23k|      pstr_config->parametric_coding = 0;
  534|  1.23k|      pstr_config->use_speech_config = 1;
  535|  1.23k|    }
  536|       |
  537|  5.78k|    if (pstr_config->use_ps) {
  ------------------
  |  Branch (537:9): [True: 246, False: 5.54k]
  ------------------
  538|    246|      pstr_config->ps_mode = ixheaace_get_ps_mode(bit_rate);
  539|    246|    }
  540|  5.78k|  }
  541|       |
  542|  6.15k|  if (is_esbr_4_1) {
  ------------------
  |  Branch (542:7): [True: 578, False: 5.57k]
  ------------------
  543|    578|    pstr_config->start_freq = 10;
  544|    578|    pstr_config->stop_freq = 11;
  545|    578|  }
  546|  6.15k|}
ixheaace_initialize_sbr_defaults:
  548|  6.18k|VOID ixheaace_initialize_sbr_defaults(ixheaace_pstr_sbr_cfg pstr_config) {
  549|  6.18k|  pstr_config->send_header_data_time = 500;
  550|  6.18k|  pstr_config->crc_sbr = 0;
  551|  6.18k|  pstr_config->tran_thr = 13000;
  552|  6.18k|  pstr_config->detect_missing_harmonics = 1;
  553|  6.18k|  pstr_config->parametric_coding = 1;
  554|  6.18k|  pstr_config->use_speech_config = 0;
  555|       |
  556|  6.18k|  pstr_config->sbr_data_extra = 0;
  557|  6.18k|  pstr_config->amp_res = IXHEAACE_SBR_AMP_RES_3_0;
  558|  6.18k|  pstr_config->tran_fc = 0;
  559|  6.18k|  pstr_config->tran_det_mode = 1;
  560|  6.18k|  pstr_config->spread = 1;
  561|  6.18k|  pstr_config->stat = 0;
  562|  6.18k|  pstr_config->e = 1;
  563|  6.18k|  pstr_config->delta_t_across_frames = 1;
  564|  6.18k|  pstr_config->df_edge_1st_env = 0.3f;
  565|  6.18k|  pstr_config->df_edge_incr = 0.3f;
  566|       |
  567|  6.18k|  pstr_config->sbr_invf_mode = IXHEAACE_INVF_SWITCHED;
  568|  6.18k|  pstr_config->sbr_xpos_mode = IXHEAACE_XPOS_LC;
  569|  6.18k|  pstr_config->sbr_xpos_ctrl = SBR_XPOS_CTRL_DEFAULT;
  ------------------
  |  |  105|  6.18k|#define SBR_XPOS_CTRL_DEFAULT (2)
  ------------------
  570|  6.18k|  pstr_config->sbr_xpos_lvl = 0;
  571|       |
  572|  6.18k|  pstr_config->use_ps = 0;
  573|  6.18k|  pstr_config->ps_mode = -1;
  574|       |
  575|  6.18k|  pstr_config->stereo_mode = IXHEAACE_SBR_MODE_SWITCH_LRC;
  576|  6.18k|  pstr_config->ana_max_level = 6;
  577|  6.18k|  pstr_config->noise_floor_offset = 0;
  578|  6.18k|  pstr_config->start_freq = 5;
  579|  6.18k|  pstr_config->stop_freq = 9;
  580|       |
  581|  6.18k|  pstr_config->freq_scale = SBR_FREQ_SCALE_DEFAULT;
  ------------------
  |  |  107|  6.18k|#define SBR_FREQ_SCALE_DEFAULT (2)
  ------------------
  582|  6.18k|  pstr_config->alter_scale = SBR_ALTER_SCALE_DEFAULT;
  ------------------
  |  |  108|  6.18k|#define SBR_ALTER_SCALE_DEFAULT (1)
  ------------------
  583|  6.18k|  pstr_config->sbr_noise_bands = SBR_NOISE_BANDS_DEFAULT;
  ------------------
  |  |  109|  6.18k|#define SBR_NOISE_BANDS_DEFAULT (2)
  ------------------
  584|       |
  585|  6.18k|  pstr_config->sbr_limiter_bands = SBR_LIMITER_BANDS_DEFAULT;
  ------------------
  |  |  111|  6.18k|#define SBR_LIMITER_BANDS_DEFAULT (2)
  ------------------
  586|  6.18k|  pstr_config->sbr_limiter_gains = SBR_LIMITER_GAINS_DEFAULT;
  ------------------
  |  |  112|  6.18k|#define SBR_LIMITER_GAINS_DEFAULT (2)
  ------------------
  587|  6.18k|  pstr_config->sbr_interpol_freq = SBR_INTERPOL_FREQ_DEFAULT;
  ------------------
  |  |  113|  6.18k|#define SBR_INTERPOL_FREQ_DEFAULT (1)
  ------------------
  588|  6.18k|  pstr_config->sbr_smoothing_length = SBR_SMOOTHING_LENGTH_DEFAULT;
  ------------------
  |  |  114|  6.18k|#define SBR_SMOOTHING_LENGTH_DEFAULT (0)
  ------------------
  589|  6.18k|  pstr_config->is_ld_sbr = 0;
  590|  6.18k|  pstr_config->is_esbr = 0;
  591|  6.18k|  pstr_config->frame_flag_960 = 0;
  592|  6.18k|  pstr_config->frame_flag_480 = 0;
  593|  6.18k|  pstr_config->hq_esbr = 0;
  594|  6.18k|  pstr_config->sbr_pvc_active = 0;
  595|  6.18k|  pstr_config->sbr_harmonic = 0;
  596|  6.18k|  pstr_config->sbr_ratio_idx = 0;  // NO_SBR
  597|  6.18k|  pstr_config->use_low_freq_res = 0;
  598|  6.18k|}
ia_enhaacplus_enc_init_sbr_tabs:
  643|  6.82k|VOID ia_enhaacplus_enc_init_sbr_tabs(ixheaace_str_sbr_tabs *pstr_sbr_tabs) {
  644|  6.82k|  pstr_sbr_tabs->ptr_ps_tab = (ixheaace_str_ps_tab *)&ia_enhaacplus_enc_ps_tab;
  645|  6.82k|  pstr_sbr_tabs->ptr_qmf_tab = (ixheaace_str_qmf_tabs *)&ixheaace_qmf_tab;
  646|  6.82k|  pstr_sbr_tabs->ptr_sbr_huff_tab = (ixheaace_str_sbr_huff_tabs *)&ixheaace_sbr_huff_tab;
  647|  6.82k|  pstr_sbr_tabs->ptr_resamp_tab =
  648|  6.82k|      (ixheaace_resampler_table *)&ixheaace_resamp_2_to_1_iir_filt_params;
  649|  6.82k|  pstr_sbr_tabs->ptr_esbr_sfb_tab = (ixheaace_str_esbr_sfb_bin_tabs *)&ia_esbr_sfb_bin_tabs;
  650|  6.82k|}
ixheaace_env_encode_frame:
  658|   424k|                          WORD32 mps_bits, WORD32 flag_fl_small, WORD32 *usac_stat_bits) {
  659|   424k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   424k|#define IA_NO_ERROR 0x00000000
  ------------------
  660|       |
  661|   424k|  if (pstr_env_encoder != NULL) {
  ------------------
  |  Branch (661:7): [True: 424k, False: 0]
  ------------------
  662|   424k|    ixheaace_pstr_sbr_bitstream_data pstr_sbr_bs = &pstr_env_encoder->str_sbr_bs;
  663|       |
  664|   424k|    pstr_sbr_bs->header_active = 0;
  665|   424k|    if ((pstr_env_encoder->str_sbr_cfg.is_ld_sbr) &&
  ------------------
  |  Branch (665:9): [True: 74.7k, False: 349k]
  ------------------
  666|  74.7k|        (pstr_sbr_bs->count_send_header_data == pstr_sbr_bs->nr_send_header_data - 1)) {
  ------------------
  |  Branch (666:9): [True: 1.14k, False: 73.5k]
  ------------------
  667|  1.14k|      pstr_sbr_bs->header_active = 1;
  668|  1.14k|    }
  669|       |
  670|   424k|    if (pstr_sbr_bs->count_send_header_data == 0) {
  ------------------
  |  Branch (670:9): [True: 49.3k, False: 374k]
  ------------------
  671|  49.3k|      pstr_sbr_bs->header_active = 1;
  672|  49.3k|    }
  673|       |
  674|   424k|    if (pstr_sbr_bs->nr_send_header_data == 0) {
  ------------------
  |  Branch (674:9): [True: 74.7k, False: 349k]
  ------------------
  675|  74.7k|      pstr_sbr_bs->count_send_header_data = 1;
  676|   349k|    } else {
  677|   349k|      if (pstr_env_encoder->str_sbr_cfg.is_ld_sbr) {
  ------------------
  |  Branch (677:11): [True: 0, False: 349k]
  ------------------
  678|      0|        if (pstr_sbr_bs->count_send_header_data >= 0) {
  ------------------
  |  Branch (678:13): [True: 0, False: 0]
  ------------------
  679|      0|          pstr_sbr_bs->count_send_header_data++;
  680|       |
  681|      0|          pstr_sbr_bs->count_send_header_data %= pstr_sbr_bs->nr_send_header_data;
  682|      0|        }
  683|   349k|      } else {
  684|   349k|        pstr_sbr_bs->count_send_header_data++;
  685|       |
  686|   349k|        pstr_sbr_bs->count_send_header_data %= pstr_sbr_bs->nr_send_header_data;
  687|   349k|      }
  688|   349k|    }
  689|       |
  690|   424k|    ixheaace_init_sbr_bitstream(
  691|   424k|        &pstr_env_encoder->str_cmon_data, (UWORD8 *)pstr_env_encoder->sbr_payload,
  692|   424k|        sizeof(pstr_env_encoder->sbr_payload), pstr_env_encoder->str_sbr_bs.crc_active,
  693|   424k|        pstr_env_encoder->str_sbr_cfg.sbr_codec);
  694|       |
  695|   424k|    err_code = ixheaace_extract_sbr_envelope(ptr_samples, ptr_core_buffer, time_sn_stride,
  696|   424k|                                             pstr_env_encoder, pstr_sbr_tab, pstr_common_tab,
  697|   424k|                                             flag_fl_small);
  698|   424k|    if (err_code) {
  ------------------
  |  Branch (698:9): [True: 11.0k, False: 413k]
  ------------------
  699|  11.0k|      return err_code;
  700|  11.0k|    }
  701|       |
  702|   413k|    if (mps_bits) {
  ------------------
  |  Branch (702:9): [True: 109k, False: 303k]
  ------------------
  703|   109k|      WORD32 num_bytes;
  704|   109k|      if (pstr_env_encoder->str_sbr_cfg.sbr_codec == ELD_SBR) {
  ------------------
  |  Branch (704:11): [True: 33.5k, False: 75.9k]
  ------------------
  705|  33.5k|        ixheaace_write_bits(&pstr_env_encoder->str_cmon_data.str_sbr_bit_buf,
  706|  33.5k|                            IXHEAACE_MPS_EXT_LDSAC_DATA, 4);
  ------------------
  |  |  174|  33.5k|#define IXHEAACE_MPS_EXT_LDSAC_DATA (0x09)
  ------------------
  707|  33.5k|        ixheaace_write_bits(&pstr_env_encoder->str_cmon_data.str_sbr_bit_buf, *ptr_mps_data++, 4);
  708|  33.5k|      }
  709|   109k|      num_bytes = mps_bits >> 3;
  710|  1.10M|      for (WORD32 k = 0; k < num_bytes; k++) {
  ------------------
  |  Branch (710:26): [True: 992k, False: 109k]
  ------------------
  711|   992k|        ixheaace_write_bits(&pstr_env_encoder->str_cmon_data.str_sbr_bit_buf, *ptr_mps_data++, 8);
  712|   992k|      }
  713|   109k|      if (mps_bits & 0x7) {
  ------------------
  |  Branch (713:11): [True: 86.3k, False: 23.2k]
  ------------------
  714|  86.3k|        ixheaace_write_bits(&pstr_env_encoder->str_cmon_data.str_sbr_bit_buf,
  715|  86.3k|                            (*ptr_mps_data++) >> (8 - (mps_bits & 0x7)), mps_bits & 0x7);
  716|  86.3k|      }
  717|   109k|    }
  718|       |
  719|   413k|    ixheaace_assemble_sbr_bitstream(&pstr_env_encoder->str_cmon_data,
  720|   413k|                                    pstr_env_encoder->str_sbr_cfg.sbr_codec);
  721|       |
  722|   413k|    pstr_env_encoder->sbr_payload_size =
  723|   413k|        ((ia_enhaacplus_enc_get_bits_available(&pstr_env_encoder->str_cmon_data.str_sbr_bit_buf) +
  724|   413k|          7) /
  725|   413k|         8);
  726|       |
  727|   413k|    if (pstr_env_encoder->sbr_payload_size > IXHEAACE_MAX_PAYLOAD_SIZE) {
  ------------------
  |  |   23|   413k|#define IXHEAACE_MAX_PAYLOAD_SIZE (256)
  ------------------
  |  Branch (727:9): [True: 0, False: 413k]
  ------------------
  728|      0|      pstr_env_encoder->sbr_payload_size = 0;
  729|      0|    }
  730|       |
  731|   413k|    if (ptr_anc_data) {
  ------------------
  |  Branch (731:9): [True: 413k, False: 0]
  ------------------
  732|   413k|      *ptr_num_anc_bytes = (UWORD8)pstr_env_encoder->sbr_payload_size;
  733|   413k|      memcpy(ptr_anc_data, pstr_env_encoder->sbr_payload, pstr_env_encoder->sbr_payload_size);
  734|   413k|    }
  735|   413k|    if (usac_stat_bits) {
  ------------------
  |  Branch (735:9): [True: 201k, False: 211k]
  ------------------
  736|   201k|      *usac_stat_bits = pstr_env_encoder->str_cmon_data.sbr_hdr_bits +
  737|   201k|                        pstr_env_encoder->str_cmon_data.sbr_data_bits;
  738|   201k|    }
  739|   413k|  }
  740|   413k|  return err_code;
  741|   424k|}
ixheaace_sbr_enc_scr_size:
  743|  17.7k|WORD32 ixheaace_sbr_enc_scr_size(VOID) {
  744|  17.7k|  return IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_str_sbr_enc_scratch), BYTE_ALIGN_8);
  ------------------
  |  |   87|  17.7k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  745|  17.7k|}
ia_enhaacplus_enc_get_scratch_bufs:
  748|   871k|                                        FLOAT32 **ptr_shared_buf2) {
  749|   871k|  ixheaace_str_sbr_enc_scratch *ptr_sbr_enc_scr = (ixheaace_str_sbr_enc_scratch *)ptr_scr;
  750|       |
  751|   871k|  *ptr_shared_buf1 = ptr_sbr_enc_scr->sbr_env_r_buf;
  752|   871k|  *ptr_shared_buf2 = ptr_sbr_enc_scr->sbr_env_i_buf;
  753|   871k|}
ia_enhaacplus_enc_get_shared_bufs:
  757|  4.74k|                                       WORD8 **ptr_shared_buf4, WORD32 aacenc_blocksize) {
  758|  4.74k|  ixheaace_str_sbr_enc_scratch *ptr_sbr_enc_scr = (ixheaace_str_sbr_enc_scratch *)ptr_scr;
  759|       |
  760|  4.74k|  *ptr_shared_buf1 = (WORD32 *)ptr_sbr_enc_scr->ps_buf3;
  761|  4.74k|  *ptr_shared_buf2 = (WORD32 *)ptr_sbr_enc_scr->sbr_env_r_buf;
  762|  4.74k|  *ptr_shared_buf3 = (WORD32 *)ptr_sbr_enc_scr->sbr_env_i_buf;
  763|  4.74k|  *ptr_shared_buf4 =
  764|  4.74k|      (WORD8 *)&ptr_sbr_enc_scr
  765|  4.74k|          ->sbr_env_i_buf[IXHEAACE_QMF_TIME_SLOTS * IXHEAACE_QMF_CHANNELS + aacenc_blocksize];
  ------------------
  |  |   69|  4.74k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
                        ->sbr_env_i_buf[IXHEAACE_QMF_TIME_SLOTS * IXHEAACE_QMF_CHANNELS + aacenc_blocksize];
  ------------------
  |  |   66|  4.74k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  766|  4.74k|}
ixheaace_sbr_set_scratch_ptr:
  768|   218k|VOID ixheaace_sbr_set_scratch_ptr(ixheaace_pstr_sbr_enc pstr_env_enc, VOID *ptr_scr) {
  769|   218k|  pstr_env_enc->ptr_sbr_enc_scr = ptr_scr;
  770|   218k|}
ixheaace_sbr_enc_pers_size:
  772|  13.3k|WORD32 ixheaace_sbr_enc_pers_size(WORD32 num_ch, WORD32 use_ps, WORD32 harmonic_sbr) {
  773|  13.3k|  WORD32 num_bytes;
  774|  13.3k|  num_bytes = IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_str_sbr_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  775|  13.3k|  num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_str_enc_channel), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  776|  13.3k|                num_ch);
  777|  13.3k|  num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_pvc_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  778|  13.3k|  num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(2 * sizeof(FLOAT32) * QMF_FILTER_LENGTH, BYTE_ALIGN_8) *
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  779|  13.3k|               num_ch);
  780|  13.3k|  if (1 == harmonic_sbr) {
  ------------------
  |  Branch (780:7): [True: 2.96k, False: 10.3k]
  ------------------
  781|  2.96k|    num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_str_hbe_enc), BYTE_ALIGN_8) * num_ch);
  ------------------
  |  |   87|  2.96k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  782|  2.96k|    num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_str_esbr_hbe_txposer), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  2.96k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  783|  2.96k|                  num_ch);
  784|  2.96k|    num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(IXHEAACE_MAX_HBE_PERSISTENT_SIZE, BYTE_ALIGN_8) *
  ------------------
  |  |   87|  2.96k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  785|  2.96k|                  num_ch);
  786|  2.96k|    num_bytes += IXHEAAC_GET_SIZE_ALIGNED(ESBR_RESAMP_SAMPLES * sizeof(FLOAT32), BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.96k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  787|  2.96k|  }
  788|  13.3k|  num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(FLOAT32) * 5 * NO_OF_ESTIMATES *
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  789|  13.3k|                MAXIMUM_FREQ_COEFFS, BYTE_ALIGN_8) * num_ch);
  790|       |
  791|  13.3k|  num_bytes += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(FLOAT32) * MAX_QMF_TIME_SLOTS *
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  792|  13.3k|                IXHEAACE_QMF_CHANNELS, BYTE_ALIGN_8) * num_ch);
  793|       |
  794|  13.3k|  if (use_ps) {
  ------------------
  |  Branch (794:7): [True: 492, False: 12.8k]
  ------------------
  795|    492|    num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_str_enc_channel), BYTE_ALIGN_8);
  ------------------
  |  |   87|    492|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  796|    492|    num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_ps_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|    492|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  797|    492|    num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(FLOAT32) * QMF_FILTER_LENGTH, BYTE_ALIGN_8);
  ------------------
  |  |   87|    492|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  798|       |
  799|    492|    num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(WORD32) * 5 * NO_OF_ESTIMATES *
  ------------------
  |  |   87|    492|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  800|    492|                 MAXIMUM_FREQ_COEFFS, BYTE_ALIGN_8);
  801|       |
  802|       |    /*shared between spectral_band_replication_envYBuffer_fix and IIC IDD PS data buffers*/
  803|    492|    num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(WORD32) * IXHEAACE_QMF_TIME_SLOTS *
  ------------------
  |  |   87|    492|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  804|    492|                 IXHEAACE_QMF_CHANNELS, BYTE_ALIGN_8);
  805|    492|  }
  806|  13.3k|  num_bytes += IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_str_sbr_qmf_filter_bank), BYTE_ALIGN_8);
  ------------------
  |  |   87|  13.3k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  807|  13.3k|  return num_bytes;
  808|  13.3k|}
ia_enhaacplus_enc_sbr_set_persist_buf:
  811|  5.89k|                                           WORD32 harmonic_sbr) {
  812|  5.89k|  struct ixheaace_str_sbr_enc *pstr_env_enc;
  813|  5.89k|  WORD8 *ptr_curr_mem = ptr_base +
  814|  5.89k|    IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_str_sbr_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|  5.89k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  815|  5.89k|  WORD32 i;
  816|       |
  817|  5.89k|  pstr_env_enc = (struct ixheaace_str_sbr_enc *)ptr_base;
  818|       |
  819|  14.3k|  for (i = 0; i < num_ch; i++) {
  ------------------
  |  Branch (819:15): [True: 8.41k, False: 5.89k]
  ------------------
  820|  8.41k|    pstr_env_enc->pstr_env_channel[i] = (struct ixheaace_str_enc_channel *)(ptr_curr_mem);
  821|  8.41k|    ptr_curr_mem = ptr_curr_mem +
  822|  8.41k|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_str_enc_channel), BYTE_ALIGN_8);
  ------------------
  |  |   87|  8.41k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  823|  8.41k|  }
  824|       |
  825|  14.3k|  for (i = 0; i < num_ch; i++) {
  ------------------
  |  Branch (825:15): [True: 8.41k, False: 5.89k]
  ------------------
  826|  8.41k|    pstr_env_enc->pstr_env_channel[i]->str_sbr_qmf.ptr_sbr_qmf_states_ana =
  827|  8.41k|        (FLOAT32 *)ptr_curr_mem;
  828|  8.41k|    ptr_curr_mem += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  8.41k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  829|  8.41k|        sizeof(pstr_env_enc->pstr_env_channel[i]->str_sbr_qmf.ptr_sbr_qmf_states_ana[0]) *
  830|  8.41k|        QMF_FILTER_LENGTH, BYTE_ALIGN_8);
  831|  8.41k|  }
  832|  5.89k|  if (!use_ps) {
  ------------------
  |  Branch (832:7): [True: 5.65k, False: 246]
  ------------------
  833|  5.65k|    pstr_env_enc->ptr_common_buffer1 = (WORD32 *)ptr_curr_mem;
  834|  5.65k|    ptr_curr_mem += IXHEAAC_GET_SIZE_ALIGNED(sizeof(pstr_env_enc->ptr_common_buffer1[0]) *
  ------------------
  |  |   87|  5.65k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  835|  5.65k|                    num_ch * 5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS, BYTE_ALIGN_8);
  836|       |
  837|  5.65k|    pstr_env_enc->ptr_common_buffer2 = (WORD32 *)ptr_curr_mem;
  838|  5.65k|    ptr_curr_mem += IXHEAAC_GET_SIZE_ALIGNED(sizeof(pstr_env_enc->ptr_common_buffer2[0]) *
  ------------------
  |  |   87|  5.65k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  839|  5.65k|                    num_ch * MAX_QMF_TIME_SLOTS * IXHEAACE_QMF_CHANNELS, BYTE_ALIGN_8);
  840|  5.65k|  } else {
  841|    246|    pstr_env_enc->ptr_common_buffer1 = (WORD32 *)ptr_curr_mem;
  842|    246|    ptr_curr_mem += IXHEAAC_GET_SIZE_ALIGNED(2 * sizeof(pstr_env_enc->ptr_common_buffer1[0]) *
  ------------------
  |  |   87|    246|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  843|    246|                    5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS, BYTE_ALIGN_8);
  844|       |
  845|    246|    pstr_env_enc->ptr_common_buffer2 = (WORD32 *)ptr_curr_mem;
  846|    246|    ptr_curr_mem += IXHEAAC_GET_SIZE_ALIGNED(2 * sizeof(pstr_env_enc->ptr_common_buffer2[0]) *
  ------------------
  |  |   87|    246|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  847|    246|                    IXHEAACE_QMF_TIME_SLOTS * IXHEAACE_QMF_CHANNELS, BYTE_ALIGN_8);
  848|    246|  }
  849|       |  // PVC encoder
  850|  5.89k|  pstr_env_enc->pstr_pvc_enc = (ixheaace_pvc_enc *)ptr_curr_mem;
  851|  5.89k|  ptr_curr_mem = ptr_curr_mem + IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_pvc_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|  5.89k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  852|       |  // Harmonic SBR
  853|  5.89k|  if (1 == harmonic_sbr) {
  ------------------
  |  Branch (853:7): [True: 1.47k, False: 4.42k]
  ------------------
  854|  3.54k|    for (i = 0; i < num_ch; i++) {
  ------------------
  |  Branch (854:17): [True: 2.06k, False: 1.47k]
  ------------------
  855|  2.06k|      pstr_env_enc->pstr_env_channel[i]->pstr_hbe_enc = (ixheaace_str_hbe_enc *)ptr_curr_mem;
  856|  2.06k|      ptr_curr_mem = ptr_curr_mem +
  857|  2.06k|        IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_str_hbe_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.06k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  858|  2.06k|      pstr_env_enc->pstr_env_channel[i]->pstr_hbe_enc->pstr_hbe_txposer =
  859|  2.06k|          (ixheaace_str_esbr_hbe_txposer *)ptr_curr_mem;
  860|  2.06k|      ptr_curr_mem = ptr_curr_mem +
  861|  2.06k|        IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_str_esbr_hbe_txposer), BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.06k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  862|  2.06k|      pstr_env_enc->pstr_env_channel[i]->pstr_hbe_enc->ptr_hbe_txposer_buffers =
  863|  2.06k|          (VOID *)ptr_curr_mem;
  864|  2.06k|      ptr_curr_mem = ptr_curr_mem + IXHEAACE_MAX_HBE_PERSISTENT_SIZE;
  ------------------
  |  |   61|  2.06k|  (IXHEAACE_MAX_QMF_X_INBUF_SIZE * sizeof(FLOAT32 *) +                                           \
  |  |  ------------------
  |  |  |  |   44|  2.06k|#define IXHEAACE_MAX_QMF_X_INBUF_SIZE (IXHEAACE_MAX_NO_COLS_VALUE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.06k|#define IXHEAACE_MAX_NO_COLS_VALUE (64)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  2.06k|   IXHEAACE_MAX_QMF_X_OUTBUF_SIZE * sizeof(FLOAT32 *) +                                          \
  |  |  ------------------
  |  |  |  |   45|  2.06k|#define IXHEAACE_MAX_QMF_X_OUTBUF_SIZE (2 * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  2.06k|#define IXHEAACE_MAX_QMF_X_INBUF_SIZE (IXHEAACE_MAX_NO_COLS_VALUE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  2.06k|#define IXHEAACE_MAX_NO_COLS_VALUE (64)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   63|  2.06k|   IXHEAACE_MAX_QMF_X_IN_REAL_BUF * sizeof(FLOAT32) +                                            \
  |  |  ------------------
  |  |  |  |   48|  2.06k|  (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  |  |  |  |  ------------------
  |  |  |  |                 (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  2.06k|#define IXHEAACE_MAX_QMF_X_INBUF_SIZE (IXHEAACE_MAX_NO_COLS_VALUE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  2.06k|#define IXHEAACE_MAX_NO_COLS_VALUE (64)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   64|  2.06k|   IXHEAACE_MAX_QMF_X_IN_IMAG_BUF * sizeof(FLOAT32) +                                            \
  |  |  ------------------
  |  |  |  |   50|  2.06k|  (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  |  |  |  |  ------------------
  |  |  |  |                 (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  2.06k|#define IXHEAACE_MAX_QMF_X_INBUF_SIZE (IXHEAACE_MAX_NO_COLS_VALUE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  2.06k|#define IXHEAACE_MAX_NO_COLS_VALUE (64)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   65|  2.06k|   IXHEAACE_MAX_QMF_X_OUT_REAL_BUF * sizeof(FLOAT32) +                                           \
  |  |  ------------------
  |  |  |  |   53|  2.06k|  (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_OUTBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  |  |  |  |  ------------------
  |  |  |  |                 (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_OUTBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.06k|#define IXHEAACE_MAX_QMF_X_OUTBUF_SIZE (2 * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|  2.06k|#define IXHEAACE_MAX_QMF_X_INBUF_SIZE (IXHEAACE_MAX_NO_COLS_VALUE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  2.06k|#define IXHEAACE_MAX_NO_COLS_VALUE (64)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   66|  2.06k|   IXHEAACE_MAX_QMF_X_OUT_IMAG_BUF * sizeof(FLOAT32) + IXHEAACE_X_INBUF_SIZE * sizeof(FLOAT32) + \
  |  |  ------------------
  |  |  |  |   55|  2.06k|  (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_OUTBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  |  |  |  |  ------------------
  |  |  |  |                 (IXHEAACE_NUM_QMF_SYNTH_CHANNELS * IXHEAACE_MAX_QMF_X_OUTBUF_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.06k|#define IXHEAACE_MAX_QMF_X_OUTBUF_SIZE (2 * IXHEAACE_MAX_QMF_X_INBUF_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|  2.06k|#define IXHEAACE_MAX_QMF_X_INBUF_SIZE (IXHEAACE_MAX_NO_COLS_VALUE)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  2.06k|#define IXHEAACE_MAX_NO_COLS_VALUE (64)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                  IXHEAACE_MAX_QMF_X_OUT_IMAG_BUF * sizeof(FLOAT32) + IXHEAACE_X_INBUF_SIZE * sizeof(FLOAT32) + \
  |  |  ------------------
  |  |  |  |   57|  2.06k|#define IXHEAACE_X_INBUF_SIZE (IXHEAACE_MAX_FRAME_SIZE + IXHEAACE_NUM_QMF_SYNTH_CHANNELS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.06k|#define IXHEAACE_MAX_FRAME_SIZE (1024)
  |  |  |  |  ------------------
  |  |  |  |               #define IXHEAACE_X_INBUF_SIZE (IXHEAACE_MAX_FRAME_SIZE + IXHEAACE_NUM_QMF_SYNTH_CHANNELS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   67|  2.06k|   IXHEAACE_X_OUTBUF_SIZE * sizeof(FLOAT32))
  |  |  ------------------
  |  |  |  |   58|  2.06k|#define IXHEAACE_X_OUTBUF_SIZE (IXHEAACE_X_INBUF_SIZE * 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  2.06k|#define IXHEAACE_X_INBUF_SIZE (IXHEAACE_MAX_FRAME_SIZE + IXHEAACE_NUM_QMF_SYNTH_CHANNELS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  2.06k|#define IXHEAACE_MAX_FRAME_SIZE (1024)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IXHEAACE_X_INBUF_SIZE (IXHEAACE_MAX_FRAME_SIZE + IXHEAACE_NUM_QMF_SYNTH_CHANNELS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   23|  2.06k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  865|  2.06k|    }
  866|  1.47k|    pstr_env_enc->ptr_hbe_resample_buf = (FLOAT32 *)ptr_curr_mem;
  867|  1.47k|    ptr_curr_mem = ptr_curr_mem + IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  1.47k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  868|  1.47k|      (ESBR_RESAMP_SAMPLES * sizeof(pstr_env_enc->ptr_hbe_resample_buf[0])), BYTE_ALIGN_8);
  869|  1.47k|  }
  870|  5.89k|  if (use_ps) {
  ------------------
  |  Branch (870:7): [True: 246, False: 5.65k]
  ------------------
  871|    246|    pstr_env_enc->pstr_env_channel[1] = (struct ixheaace_str_enc_channel *)(ptr_curr_mem);
  872|    246|    ptr_curr_mem = ptr_curr_mem +
  873|    246|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_str_enc_channel), BYTE_ALIGN_8);
  ------------------
  |  |   87|    246|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  874|    246|    memset(pstr_env_enc->pstr_env_channel[1], 0, sizeof(struct ixheaace_str_enc_channel));
  875|       |
  876|    246|    pstr_env_enc->pstr_env_channel[1]->str_sbr_qmf.ptr_sbr_qmf_states_ana =
  877|    246|        (FLOAT32 *)ptr_curr_mem;
  878|    246|    ptr_curr_mem += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|    246|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  879|    246|      sizeof(pstr_env_enc->pstr_env_channel[1]->str_sbr_qmf.ptr_sbr_qmf_states_ana[0]) *
  880|    246|        QMF_FILTER_LENGTH, BYTE_ALIGN_8);
  881|    246|    memset(pstr_env_enc->pstr_env_channel[1]->str_sbr_qmf.ptr_sbr_qmf_states_ana, 0,
  882|    246|           sizeof(pstr_env_enc->pstr_env_channel[1]->str_sbr_qmf.ptr_sbr_qmf_states_ana[0]) *
  883|    246|               QMF_FILTER_LENGTH);
  ------------------
  |  |   67|    246|#define QMF_FILTER_LENGTH (640)
  ------------------
  884|       |
  885|    246|    pstr_env_enc->pstr_ps_enc = (struct ixheaace_ps_enc *)(ptr_curr_mem);
  886|    246|    ptr_curr_mem = ptr_curr_mem +
  887|    246|      IXHEAAC_GET_SIZE_ALIGNED(sizeof(struct ixheaace_ps_enc), BYTE_ALIGN_8);
  ------------------
  |  |   87|    246|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  888|    246|    memset(pstr_env_enc->pstr_ps_enc, 0, sizeof(struct ixheaace_ps_enc));
  889|    246|  }
  890|  5.89k|  pstr_env_enc->pstr_synthesis_qmf_bank = (ixheaace_str_sbr_qmf_filter_bank *)(ptr_curr_mem);
  891|  5.89k|  memset(pstr_env_enc->pstr_synthesis_qmf_bank, 0, sizeof(ixheaace_str_sbr_qmf_filter_bank));
  892|       |
  893|       |  pstr_env_enc->pstr_synthesis_qmf_bank->ptr_sbr_qmf_states_ana = NULL;
  894|  5.89k|}
ixheaace_env_open:
  900|  5.89k|                  ixheaace_pstr_sbr_hdr_data *pstr_sbr_config) {
  901|  5.89k|  ixheaace_pstr_sbr_enc pstr_env_enc;
  902|  5.89k|  WORD32 ch;
  903|  5.89k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  5.89k|#define IA_NO_ERROR 0x00000000
  ------------------
  904|       |
  905|  5.89k|  pstr_env_enc = *pstr_env_encoder;
  906|       |
  907|  5.89k|  memset(pstr_env_enc, 0, sizeof(struct ixheaace_str_sbr_enc));
  908|       |
  909|  5.89k|  *pstr_sbr_config = &pstr_env_enc->str_sbr_hdr;
  910|       |
  911|  5.89k|  ixheaace_sbr_set_scratch_ptr(pstr_env_enc, ptr_sbr_scratch);
  912|       |
  913|  5.89k|  ia_enhaacplus_enc_sbr_set_persist_buf((WORD8 *)pstr_env_enc,
  914|  5.89k|                                        params->codec_settings.num_channels, params->use_ps,
  915|  5.89k|                                        params->sbr_harmonic);
  916|       |
  917|  5.89k|  if ((params->codec_settings.num_channels < 1) ||
  ------------------
  |  Branch (917:7): [True: 0, False: 5.89k]
  ------------------
  918|  5.89k|      (params->codec_settings.num_channels > IXHEAACE_MAX_CH_IN_BS_ELE)) {
  ------------------
  |  |   22|  5.89k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (918:7): [True: 0, False: 5.89k]
  ------------------
  919|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_CHANNELS;
  920|      0|  }
  921|       |
  922|  5.89k|  pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[LO] =
  ------------------
  |  |  100|  5.89k|#define LO (0)
  ------------------
  923|  5.89k|      pstr_env_enc->str_sbr_cfg.sbr_freq_band_tab_lo;
  924|       |
  925|  5.89k|  memset(
  926|  5.89k|      pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[LO], 0,
  ------------------
  |  |  100|  5.89k|#define LO (0)
  ------------------
  927|  5.89k|      sizeof(pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[LO][0]) * (MAXIMUM_FREQ_COEFFS / 2 + 1));
  ------------------
  |  |  100|  5.89k|#define LO (0)
  ------------------
                    sizeof(pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[LO][0]) * (MAXIMUM_FREQ_COEFFS / 2 + 1));
  ------------------
  |  |   83|  5.89k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  5.89k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  928|       |
  929|  5.89k|  pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[HI] =
  ------------------
  |  |  101|  5.89k|#define HI (1)
  ------------------
  930|  5.89k|      pstr_env_enc->str_sbr_cfg.sbr_freq_band_tab_hi;
  931|       |
  932|  5.89k|  memset(pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[HI], 0,
  ------------------
  |  |  101|  5.89k|#define HI (1)
  ------------------
  933|  5.89k|         sizeof(pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[HI][0]) * (MAXIMUM_FREQ_COEFFS + 1));
  ------------------
  |  |  101|  5.89k|#define HI (1)
  ------------------
                       sizeof(pstr_env_enc->str_sbr_cfg.ptr_freq_band_tab[HI][0]) * (MAXIMUM_FREQ_COEFFS + 1));
  ------------------
  |  |   83|  5.89k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  5.89k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  934|       |
  935|  5.89k|  pstr_env_enc->str_sbr_cfg.ptr_v_k_master = pstr_env_enc->str_sbr_cfg.sbr_v_k_master;
  936|       |
  937|  5.89k|  memset(pstr_env_enc->str_sbr_cfg.ptr_v_k_master, 0,
  938|  5.89k|         sizeof(pstr_env_enc->str_sbr_cfg.ptr_v_k_master[0]) * (MAXIMUM_FREQ_COEFFS + 1));
  ------------------
  |  |   83|  5.89k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  5.89k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  939|       |
  940|  5.89k|  ia_enhaacplus_enc_create_bitbuffer(&pstr_env_enc->str_cmon_data.str_sbr_bit_buf,
  941|  5.89k|                                     (UWORD8 *)pstr_env_enc->sbr_payload,
  942|  5.89k|                                     sizeof(pstr_env_enc->sbr_payload));
  943|       |
  944|  5.89k|  pstr_env_enc->str_cmon_data.prev_bit_buf_read_offset = 0;
  945|  5.89k|  pstr_env_enc->str_cmon_data.prev_bit_buf_write_offset = 0;
  946|       |
  947|  5.89k|  ia_enhaacplus_enc_create_bitbuffer(&pstr_env_enc->str_cmon_data.str_sbr_bit_buf_prev,
  948|  5.89k|                                     (UWORD8 *)pstr_env_enc->sbr_payload_prev,
  949|  5.89k|                                     sizeof(pstr_env_enc->sbr_payload));
  950|       |
  951|  5.89k|  pstr_env_enc->str_cmon_data.str_sbr_bit_buf_prev.ptr_read_next =
  952|  5.89k|      pstr_env_enc->str_cmon_data.str_sbr_bit_buf_prev.ptr_bit_buf_base +
  953|  5.89k|      pstr_env_enc->str_cmon_data.prev_bit_buf_read_offset;
  954|  5.89k|  pstr_env_enc->str_cmon_data.str_sbr_bit_buf_prev.ptr_write_next =
  955|  5.89k|      pstr_env_enc->str_cmon_data.str_sbr_bit_buf_prev.ptr_bit_buf_base +
  956|  5.89k|      pstr_env_enc->str_cmon_data.prev_bit_buf_write_offset;
  957|       |
  958|  5.89k|  pstr_env_enc->str_sbr_cfg.num_ch = params->codec_settings.num_channels;
  959|  5.89k|  pstr_env_enc->str_sbr_cfg.is_ld_sbr = params->is_ld_sbr;
  960|  5.89k|  pstr_env_enc->str_sbr_cfg.sbr_codec = params->sbr_codec;
  961|  5.89k|  pstr_env_enc->str_sbr_cfg.is_esbr = params->is_esbr;
  962|  5.89k|  if (pstr_env_enc->str_sbr_cfg.sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (962:7): [True: 2.94k, False: 2.95k]
  ------------------
  963|  2.94k|    pstr_env_enc->str_sbr_cfg.sbr_ratio_idx = params->sbr_ratio_idx;
  964|  2.94k|  }
  965|  5.89k|  pstr_env_enc->str_sbr_cfg.stereo_mode =
  966|  5.89k|      (params->codec_settings.num_channels == 2) ? params->stereo_mode : IXHEAACE_SBR_MODE_MONO;
  ------------------
  |  Branch (966:7): [True: 2.51k, False: 3.38k]
  ------------------
  967|       |
  968|  5.89k|  if (params->codec_settings.sample_freq <= 24000) {
  ------------------
  |  Branch (968:7): [True: 5.42k, False: 470]
  ------------------
  969|  5.42k|    pstr_env_enc->str_sbr_hdr.sample_rate_mode = IXHEAACE_DUAL_RATE;
  970|  5.42k|    if (params->sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (970:9): [True: 2.47k, False: 2.95k]
  ------------------
  971|  2.47k|      pstr_env_enc->str_sbr_cfg.sample_freq = 2 * params->codec_settings.sample_freq;
  972|  2.47k|      if (USAC_SBR_RATIO_INDEX_4_1 == params->sbr_ratio_idx) {
  ------------------
  |  |  188|  2.47k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (972:11): [True: 578, False: 1.89k]
  ------------------
  973|    578|        pstr_env_enc->str_sbr_cfg.sample_freq = 4 * params->codec_settings.sample_freq;
  974|    578|        pstr_env_enc->str_sbr_hdr.sample_rate_mode = IXHEAACE_QUAD_RATE;
  975|    578|      }
  976|  2.95k|    } else {
  977|  2.95k|      pstr_env_enc->str_sbr_cfg.sample_freq = 2 * params->codec_settings.sample_freq;
  978|  2.95k|    }
  979|  5.42k|  } else {
  980|    470|    pstr_env_enc->str_sbr_hdr.sample_rate_mode = IXHEAACE_SINGLE_RATE;
  981|    470|    pstr_env_enc->str_sbr_cfg.sample_freq = params->codec_settings.sample_freq;
  982|    470|  }
  983|  5.89k|  if (params->is_ld_sbr) {
  ------------------
  |  Branch (983:7): [True: 1.17k, False: 4.72k]
  ------------------
  984|  1.17k|    pstr_env_enc->str_sbr_bs.count_send_header_data = -1;
  985|  4.72k|  } else {
  986|  4.72k|    pstr_env_enc->str_sbr_bs.count_send_header_data = 0;
  987|  4.72k|  }
  988|  5.89k|  if (params->send_header_data_time > 0) {
  ------------------
  |  Branch (988:7): [True: 4.72k, False: 1.17k]
  ------------------
  989|  4.72k|    pstr_env_enc->str_sbr_bs.nr_send_header_data = (WORD32)(
  990|  4.72k|        params->send_header_data_time * 0.001 * pstr_env_enc->str_sbr_cfg.sample_freq / 2048);
  991|       |
  992|  4.72k|    pstr_env_enc->str_sbr_bs.nr_send_header_data =
  993|  4.72k|        ixheaac_max32(pstr_env_enc->str_sbr_bs.nr_send_header_data, 1);
  994|  4.72k|  } else {
  995|  1.17k|    pstr_env_enc->str_sbr_bs.nr_send_header_data = 0;
  996|  1.17k|  }
  997|       |
  998|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_data_extra = params->sbr_data_extra;
  999|  5.89k|  pstr_env_enc->str_sbr_bs.crc_active = params->crc_sbr;
 1000|  5.89k|  pstr_env_enc->str_sbr_bs.header_active = 0;
 1001|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_start_freq = params->start_freq;
 1002|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_stop_freq = params->stop_freq;
 1003|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_xover_band = 0;
 1004|       |
 1005|  5.89k|  if (params->sbr_xpos_ctrl != SBR_XPOS_CTRL_DEFAULT) {
  ------------------
  |  |  105|  5.89k|#define SBR_XPOS_CTRL_DEFAULT (2)
  ------------------
  |  Branch (1005:7): [True: 0, False: 5.89k]
  ------------------
 1006|      0|    pstr_env_enc->str_sbr_hdr.sbr_data_extra = 1;
 1007|      0|  }
 1008|       |
 1009|  5.89k|  pstr_env_enc->str_sbr_hdr.protocol_version = SI_SBR_PROTOCOL_VERSION_ID;
  ------------------
  |  |  103|  5.89k|#define SI_SBR_PROTOCOL_VERSION_ID (0)
  ------------------
 1010|       |
 1011|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_amp_res = (ixheaace_amp_res)params->amp_res;
 1012|       |
 1013|  5.89k|  pstr_env_enc->str_sbr_hdr.freq_scale = params->freq_scale;
 1014|  5.89k|  pstr_env_enc->str_sbr_hdr.alter_scale = params->alter_scale;
 1015|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_noise_bands = params->sbr_noise_bands;
 1016|  5.89k|  pstr_env_enc->str_sbr_hdr.header_extra_1 = 0;
 1017|       |
 1018|  5.89k|  if ((params->freq_scale != SBR_FREQ_SCALE_DEFAULT) ||
  ------------------
  |  |  107|  5.89k|#define SBR_FREQ_SCALE_DEFAULT (2)
  ------------------
  |  Branch (1018:7): [True: 4.65k, False: 1.24k]
  ------------------
 1019|  1.24k|      (params->alter_scale != SBR_ALTER_SCALE_DEFAULT) ||
  ------------------
  |  |  108|  1.24k|#define SBR_ALTER_SCALE_DEFAULT (1)
  ------------------
  |  Branch (1019:7): [True: 0, False: 1.24k]
  ------------------
 1020|  5.00k|      (params->sbr_noise_bands != SBR_NOISE_BANDS_DEFAULT)) {
  ------------------
  |  |  109|  1.24k|#define SBR_NOISE_BANDS_DEFAULT (2)
  ------------------
  |  Branch (1020:7): [True: 351, False: 891]
  ------------------
 1021|  5.00k|    pstr_env_enc->str_sbr_hdr.header_extra_1 = 1;
 1022|  5.00k|  }
 1023|       |
 1024|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_limiter_bands = params->sbr_limiter_bands;
 1025|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_limiter_gains = params->sbr_limiter_gains;
 1026|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_interpol_freq = params->sbr_interpol_freq;
 1027|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_smoothing_length = params->sbr_smoothing_length;
 1028|  5.89k|  pstr_env_enc->str_sbr_hdr.header_extra_2 = 0;
 1029|       |
 1030|  5.89k|  if ((params->sbr_limiter_bands != SBR_LIMITER_BANDS_DEFAULT) ||
  ------------------
  |  |  111|  5.89k|#define SBR_LIMITER_BANDS_DEFAULT (2)
  ------------------
  |  Branch (1030:7): [True: 0, False: 5.89k]
  ------------------
 1031|  5.89k|      (params->sbr_limiter_gains != SBR_LIMITER_GAINS_DEFAULT) ||
  ------------------
  |  |  112|  5.89k|#define SBR_LIMITER_GAINS_DEFAULT (2)
  ------------------
  |  Branch (1031:7): [True: 0, False: 5.89k]
  ------------------
 1032|  5.89k|      (params->sbr_interpol_freq != SBR_INTERPOL_FREQ_DEFAULT) ||
  ------------------
  |  |  113|  5.89k|#define SBR_INTERPOL_FREQ_DEFAULT (1)
  ------------------
  |  Branch (1032:7): [True: 0, False: 5.89k]
  ------------------
 1033|  5.89k|      (params->sbr_smoothing_length != SBR_SMOOTHING_LENGTH_DEFAULT)) {
  ------------------
  |  |  114|  5.89k|#define SBR_SMOOTHING_LENGTH_DEFAULT (0)
  ------------------
  |  Branch (1033:7): [True: 0, False: 5.89k]
  ------------------
 1034|      0|    pstr_env_enc->str_sbr_hdr.header_extra_2 = 1;
 1035|      0|  }
 1036|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_harmonic = params->sbr_harmonic;
 1037|  5.89k|  pstr_env_enc->str_sbr_hdr.sbr_pvc_active = params->sbr_pvc_active;
 1038|  5.89k|  pstr_env_enc->str_sbr_hdr.hq_esbr = params->hq_esbr;
 1039|       |
 1040|  5.89k|  pstr_env_enc->str_sbr_cfg.detect_missing_harmonics = params->detect_missing_harmonics;
 1041|  5.89k|  pstr_env_enc->str_sbr_cfg.use_parametric_coding = params->parametric_coding;
 1042|       |
 1043|  5.89k|  err_code = ia_enhaacplus_enc_update_freq_band_tab(
 1044|  5.89k|      &pstr_env_enc->str_sbr_cfg, &pstr_env_enc->str_sbr_hdr, IXHEAACE_QMF_CHANNELS);
  ------------------
  |  |   66|  5.89k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
 1045|  5.89k|  if (err_code) {
  ------------------
  |  Branch (1045:7): [True: 10, False: 5.88k]
  ------------------
 1046|     10|    return err_code;
 1047|     10|  }
 1048|  5.88k|  ch = 0;
 1049|  14.2k|  while (ch < pstr_env_enc->str_sbr_cfg.num_ch) {
  ------------------
  |  Branch (1049:10): [True: 8.39k, False: 5.88k]
  ------------------
 1050|  8.39k|    FLOAT32 *ptr_sbr_env_r_buf = &pstr_env_enc->ptr_sbr_enc_scr->sbr_env_r_buf[0];
 1051|  8.39k|    FLOAT32 *ptr_sbr_env_i_buf = &pstr_env_enc->ptr_sbr_enc_scr->sbr_env_i_buf[0];
 1052|  8.39k|    if (!params->use_ps) {
  ------------------
  |  Branch (1052:9): [True: 8.15k, False: 246]
  ------------------
 1053|  8.15k|      ptr_sbr_env_r_buf = &pstr_env_enc->ptr_sbr_enc_scr->sbr_env_r_buffer[0];
 1054|  8.15k|      ptr_sbr_env_i_buf = &pstr_env_enc->ptr_sbr_enc_scr->sbr_env_i_buffer[0];
 1055|  8.15k|    }
 1056|       |
 1057|  8.39k|    err_code = ixheaace_create_env_channel(
 1058|  8.39k|        ch, &pstr_env_enc->str_sbr_cfg, &pstr_env_enc->str_sbr_hdr,
 1059|  8.39k|        pstr_env_enc->pstr_env_channel[ch], params, pstr_env_enc->ptr_common_buffer1,
 1060|  8.39k|        pstr_env_enc->ptr_common_buffer2, ptr_sbr_env_r_buf, ptr_sbr_env_i_buf, pstr_sbr_tab);
 1061|  8.39k|    if (err_code) {
  ------------------
  |  Branch (1061:9): [True: 0, False: 8.39k]
  ------------------
 1062|      0|      return err_code;
 1063|      0|    }
 1064|  8.39k|    ch++;
 1065|  8.39k|  }
 1066|       |
 1067|  5.88k|  if (params->use_ps) {
  ------------------
  |  Branch (1067:7): [True: 246, False: 5.64k]
  ------------------
 1068|    246|    err_code = ixheaace_create_env_channel(
 1069|    246|        1, &pstr_env_enc->str_sbr_cfg, &pstr_env_enc->str_sbr_hdr,
 1070|    246|        pstr_env_enc->pstr_env_channel[1], params, pstr_env_enc->ptr_common_buffer1,
 1071|    246|        pstr_env_enc->ptr_common_buffer2, pstr_env_enc->ptr_sbr_enc_scr->sbr_env_r_buf,
 1072|    246|        pstr_env_enc->ptr_sbr_enc_scr->sbr_env_i_buf, pstr_sbr_tab);
 1073|    246|    if (err_code) {
  ------------------
  |  Branch (1073:9): [True: 0, False: 246]
  ------------------
 1074|      0|      return err_code;
 1075|      0|    }
 1076|       |
 1077|    246|    ixheaace_create_synthesis_qmf_bank(pstr_env_enc->pstr_synthesis_qmf_bank,
 1078|    246|                                       pstr_env_enc->ptr_common_buffer1, pstr_sbr_tab);
 1079|       |
 1080|    246|    err_code = ixheaace_create_ps_enc(pstr_env_enc->pstr_ps_enc, params->ps_mode,
 1081|    246|                                      (FLOAT32 *)pstr_env_enc->ptr_common_buffer1,
 1082|    246|                                      (FLOAT32 *)pstr_env_enc->ptr_common_buffer2,
 1083|    246|                                      (FLOAT32 *)pstr_env_enc->ptr_sbr_enc_scr->ps_buf3);
 1084|    246|    if (err_code) {
  ------------------
  |  Branch (1084:9): [True: 0, False: 246]
  ------------------
 1085|      0|      return err_code;
 1086|      0|    }
 1087|    246|  }
 1088|       |
 1089|  5.88k|  pstr_env_enc->str_cmon_data.sbr_num_channels = pstr_env_enc->str_sbr_cfg.num_ch;
 1090|  5.88k|  if (USAC_SBR == params->sbr_codec) {
  ------------------
  |  Branch (1090:7): [True: 2.93k, False: 2.95k]
  ------------------
 1091|  2.93k|    ixheaace_pvc_enc_init(pstr_env_enc->pstr_pvc_enc, params->sbr_pvc_rate);
 1092|  2.93k|  }
 1093|  5.88k|  *pstr_env_encoder = pstr_env_enc;
 1094|  5.88k|  *ptr_core_bw = pstr_env_enc->str_sbr_cfg.xover_freq;
 1095|       |
 1096|  5.88k|  return err_code;
 1097|  5.88k|}
ixheaace_sbr_main.c:ia_enhaacplus_enc_get_sbr_tuning_table_idx:
  103|  17.5k|    ixheaace_sbr_tuning_tables sbr_tune_table[10][2][10]) {
  104|  17.5k|  WORD32 found = 0;
  105|  17.5k|  WORD32 i_sr, br_closest_lower_idx_sr = -1, br_closest_upper_idx_sr = -1;
  106|  17.5k|  WORD32 br_closest_lower_idx_ch = -1, br_closest_upper_idx_sch = -1;
  107|  17.5k|  UWORD32 i_ch;
  108|  17.5k|  WORD32 i_entry, br_closest_lower_idx_entry = -1, br_closest_upper_idx_entry = -1;
  109|  17.5k|  UWORD32 br_closest_upper = 0, br_closest_lower = IXHEAACE_DISTANCE_CEIL_VALUE;
  ------------------
  |  |  193|  17.5k|#define IXHEAACE_DISTANCE_CEIL_VALUE (5000000)
  ------------------
  110|  17.5k|  const UWORD32 *ptr_sample_rate_supported = pstr_qmf_tab->supported_sample_rate;
  111|  17.5k|  WORD32 check_size = sizeof(sbr_tune_table[i_sr][i_ch]) / sizeof(sbr_tune_table[i_sr][i_ch][0]);
  112|  99.3k|  for (i_sr = 0; i_sr < 9; i_sr++) {
  ------------------
  |  Branch (112:18): [True: 96.8k, False: 2.56k]
  ------------------
  113|   267k|    for (i_ch = 0; i_ch < 2; i_ch++) {
  ------------------
  |  Branch (113:20): [True: 185k, False: 81.8k]
  ------------------
  114|   185k|      found = 1;
  115|   185k|      if ((num_ch - 1) == (i_ch) && (sample_rate == ptr_sample_rate_supported[i_sr])) {
  ------------------
  |  Branch (115:11): [True: 96.8k, False: 88.7k]
  |  Branch (115:37): [True: 17.4k, False: 79.3k]
  ------------------
  116|  73.9k|        for (i_entry = 0; i_entry < check_size - 1; i_entry++) {
  ------------------
  |  Branch (116:27): [True: 73.9k, False: 0]
  ------------------
  117|  73.9k|          if ((bitrate >= sbr_tune_table[i_sr][i_ch][i_entry].bitrate_from) &&
  ------------------
  |  Branch (117:15): [True: 68.4k, False: 5.53k]
  ------------------
  118|  68.4k|              (bitrate < sbr_tune_table[i_sr][i_ch][i_entry].bitrate_to)) {
  ------------------
  |  Branch (118:15): [True: 14.9k, False: 53.4k]
  ------------------
  119|  14.9k|            *ptr_idx_sr = i_sr;
  120|  14.9k|            *ptr_idx_ch = i_ch;
  121|  14.9k|            *ptr_idx_entry = i_entry;
  122|  14.9k|            return IXHEAACE_TABLE_IDX_FOUND;
  ------------------
  |  |   24|  14.9k|#define IXHEAACE_TABLE_IDX_FOUND (0)
  ------------------
  123|  58.9k|          } else {
  124|  58.9k|            if ((sbr_tune_table[i_sr][i_ch][i_entry].bitrate_from > bitrate) &&
  ------------------
  |  Branch (124:17): [True: 5.53k, False: 53.4k]
  ------------------
  125|  5.53k|                (sbr_tune_table[i_sr][i_ch][i_entry].bitrate_from < br_closest_lower)) {
  ------------------
  |  Branch (125:17): [True: 916, False: 4.61k]
  ------------------
  126|    916|              br_closest_lower = sbr_tune_table[i_sr][i_ch][i_entry].bitrate_from;
  127|    916|              br_closest_lower_idx_sr = i_sr;
  128|    916|              br_closest_lower_idx_ch = i_ch;
  129|    916|              br_closest_lower_idx_entry = i_entry;
  130|    916|            }
  131|  58.9k|            if ((sbr_tune_table[i_sr][i_ch][i_entry].bitrate_to <= bitrate) &&
  ------------------
  |  Branch (131:17): [True: 53.4k, False: 5.53k]
  ------------------
  132|  53.4k|                (sbr_tune_table[i_sr][i_ch][i_entry].bitrate_to > br_closest_upper)) {
  ------------------
  |  Branch (132:17): [True: 53.1k, False: 263]
  ------------------
  133|  53.1k|              br_closest_upper = sbr_tune_table[i_sr][i_ch][i_entry].bitrate_to - 1;
  134|  53.1k|              br_closest_upper_idx_sr = i_sr;
  135|  53.1k|              br_closest_upper_idx_sch = i_ch;
  136|  53.1k|              br_closest_upper_idx_entry = i_entry;
  137|  53.1k|            }
  138|  58.9k|          }
  139|       |
  140|  58.9k|          if (sbr_tune_table[i_sr][i_ch][i_entry + 1].bitrate_from == 0) {
  ------------------
  |  Branch (140:15): [True: 2.45k, False: 56.5k]
  ------------------
  141|  2.45k|            *ptr_idx_sr = i_sr;
  142|  2.45k|            *ptr_idx_ch = i_ch;
  143|  2.45k|            *ptr_idx_entry = i_entry;
  144|  2.45k|            break;
  145|  2.45k|          }
  146|  58.9k|        }
  147|  17.4k|      }
  148|   185k|    }
  149|  96.8k|  }
  150|       |
  151|  2.56k|  if (br_closest_upper_idx_entry >= 0) {
  ------------------
  |  Branch (151:7): [True: 1.27k, False: 1.28k]
  ------------------
  152|  1.27k|    return IXHEAACE_TABLE_IDX_FOUND;
  ------------------
  |  |   24|  1.27k|#define IXHEAACE_TABLE_IDX_FOUND (0)
  ------------------
  153|  1.27k|  }
  154|       |
  155|  1.28k|  if (ptr_closest_br != NULL) {
  ------------------
  |  Branch (155:7): [True: 916, False: 366]
  ------------------
  156|    916|    if (found) {
  ------------------
  |  Branch (156:9): [True: 916, False: 0]
  ------------------
  157|    916|      WORD32 distance_upper = IXHEAACE_DISTANCE_CEIL_VALUE,
  ------------------
  |  |  193|    916|#define IXHEAACE_DISTANCE_CEIL_VALUE (5000000)
  ------------------
  158|    916|             distance_lower = IXHEAACE_DISTANCE_CEIL_VALUE;
  ------------------
  |  |  193|    916|#define IXHEAACE_DISTANCE_CEIL_VALUE (5000000)
  ------------------
  159|    916|      if (br_closest_lower_idx_entry >= 0) {
  ------------------
  |  Branch (159:11): [True: 916, False: 0]
  ------------------
  160|    916|        distance_lower = sbr_tune_table[br_closest_lower_idx_sr][br_closest_lower_idx_ch]
  161|    916|                                       [br_closest_lower_idx_entry]
  162|    916|                                           .bitrate_from -
  163|    916|                         bitrate;
  164|    916|      }
  165|    916|      if (br_closest_upper_idx_entry >= 0) {
  ------------------
  |  Branch (165:11): [True: 0, False: 916]
  ------------------
  166|      0|        distance_upper =
  167|      0|            bitrate - sbr_tune_table[br_closest_upper_idx_sr][br_closest_upper_idx_sch]
  168|      0|                                    [br_closest_lower_idx_entry]
  169|      0|                                        .bitrate_to;
  170|      0|      }
  171|       |
  172|    916|      *ptr_closest_br = (distance_upper < distance_lower) ? br_closest_upper : br_closest_lower;
  ------------------
  |  Branch (172:25): [True: 0, False: 916]
  ------------------
  173|    916|    } else {
  174|      0|      *ptr_closest_br = 0;
  175|      0|    }
  176|    916|  }
  177|       |
  178|  1.28k|  return IXHEAACE_TABLE_IDX_NOT_FOUND;
  ------------------
  |  |   23|  1.28k|#define IXHEAACE_TABLE_IDX_NOT_FOUND (-1)
  ------------------
  179|  2.56k|}
ixheaace_sbr_main.c:ia_enhaacplus_enc_update_freq_band_tab:
  602|  5.89k|    WORD32 num_qmf_ch) {
  603|  5.89k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  5.89k|#define IA_NO_ERROR 0x00000000
  ------------------
  604|  5.89k|  WORD32 k0, k2;
  605|  5.89k|  WORD32 samp_freq = pstr_sbr_cfg->sample_freq;
  606|  5.89k|  if ((pstr_sbr_cfg->sbr_codec == USAC_SBR) &&
  ------------------
  |  Branch (606:7): [True: 2.94k, False: 2.95k]
  ------------------
  607|  2.94k|      (pstr_sbr_cfg->sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1)) {
  ------------------
  |  |  188|  2.94k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (607:7): [True: 578, False: 2.36k]
  ------------------
  608|    578|    samp_freq = samp_freq / 2;
  609|    578|  }
  610|  5.89k|  err_code = ixheaace_find_start_and_stop_band(
  611|  5.89k|      samp_freq, num_qmf_ch, pstr_sbr_hdr->sbr_start_freq, pstr_sbr_hdr->sbr_stop_freq,
  612|  5.89k|      pstr_sbr_hdr->sample_rate_mode, &k0, &k2, pstr_sbr_cfg->sbr_ratio_idx,
  613|  5.89k|      pstr_sbr_cfg->sbr_codec);
  614|  5.89k|  if (err_code) {
  ------------------
  |  Branch (614:7): [True: 7, False: 5.89k]
  ------------------
  615|      7|    return err_code;
  616|      7|  }
  617|       |
  618|  5.89k|  err_code = ixheaace_update_freq_scale(
  619|  5.89k|      pstr_sbr_cfg->ptr_v_k_master, &pstr_sbr_cfg->num_master, k0, k2, pstr_sbr_hdr->freq_scale,
  620|  5.89k|      pstr_sbr_hdr->alter_scale, pstr_sbr_hdr->sample_rate_mode);
  621|  5.89k|  if (err_code) {
  ------------------
  |  Branch (621:7): [True: 3, False: 5.88k]
  ------------------
  622|      3|    return err_code;
  623|      3|  }
  624|       |
  625|  5.88k|  pstr_sbr_hdr->sbr_xover_band = 0;
  626|       |
  627|  5.88k|  ixheaace_update_high_res(pstr_sbr_cfg->ptr_freq_band_tab[HI], &pstr_sbr_cfg->num_scf[HI],
  ------------------
  |  |  101|  5.88k|#define HI (1)
  ------------------
                ixheaace_update_high_res(pstr_sbr_cfg->ptr_freq_band_tab[HI], &pstr_sbr_cfg->num_scf[HI],
  ------------------
  |  |  101|  5.88k|#define HI (1)
  ------------------
  628|  5.88k|                           pstr_sbr_cfg->ptr_v_k_master, pstr_sbr_cfg->num_master,
  629|  5.88k|                           &pstr_sbr_hdr->sbr_xover_band, pstr_sbr_hdr->sample_rate_mode,
  630|  5.88k|                           num_qmf_ch);
  631|       |
  632|  5.88k|  ixheaace_update_low_res(pstr_sbr_cfg->ptr_freq_band_tab[LO], &pstr_sbr_cfg->num_scf[LO],
  ------------------
  |  |  100|  5.88k|#define LO (0)
  ------------------
                ixheaace_update_low_res(pstr_sbr_cfg->ptr_freq_band_tab[LO], &pstr_sbr_cfg->num_scf[LO],
  ------------------
  |  |  100|  5.88k|#define LO (0)
  ------------------
  633|  5.88k|                          pstr_sbr_cfg->ptr_freq_band_tab[HI], pstr_sbr_cfg->num_scf[HI]);
  ------------------
  |  |  101|  5.88k|#define HI (1)
  ------------------
                                        pstr_sbr_cfg->ptr_freq_band_tab[HI], pstr_sbr_cfg->num_scf[HI]);
  ------------------
  |  |  101|  5.88k|#define HI (1)
  ------------------
  634|       |
  635|  5.88k|  pstr_sbr_cfg->xover_freq =
  636|  5.88k|      (pstr_sbr_cfg->ptr_freq_band_tab[LOW_RES][0] * pstr_sbr_cfg->sample_freq / num_qmf_ch +
  ------------------
  |  |   97|  5.88k|#define LOW_RES (0)
  ------------------
  637|  5.88k|       1) >>
  638|  5.88k|      1;
  639|       |
  640|  5.88k|  return err_code;
  641|  5.89k|}
ixheaace_sbr_main.c:ixheaace_create_env_channel:
  185|  8.64k|    FLOAT32 *ptr_sbr_env_r_buf, FLOAT32 *ptr_sbr_env_i_buf, ixheaace_str_sbr_tabs *pstr_sbr_tab) {
  186|  8.64k|  WORD32 e = 1;
  187|  8.64k|  WORD32 tran_fc = 0;
  188|  8.64k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  8.64k|#define IA_NO_ERROR 0x00000000
  ------------------
  189|       |
  190|  8.64k|  WORD32 start_index;
  191|  8.64k|  WORD32 noise_groups[2] = {3, 3};
  192|       |
  193|  8.64k|  e = ixheaac_shl32(1, params->e);
  194|       |
  195|  8.64k|  if (params->use_low_freq_res == 1) {
  ------------------
  |  Branch (195:7): [True: 2.31k, False: 6.33k]
  ------------------
  196|  2.31k|    pstr_env->enc_env_data.freq_res_fix = FREQ_RES_LOW;
  197|  6.33k|  } else {
  198|  6.33k|    pstr_env->enc_env_data.freq_res_fix = FREQ_RES_HIGH;
  199|  6.33k|  }
  200|       |
  201|  8.64k|  pstr_env->enc_env_data.sbr_xpos_mode = (ixheaace_sbr_xpos_mode)params->sbr_xpos_mode;
  202|  8.64k|  pstr_env->enc_env_data.sbr_xpos_ctrl = params->sbr_xpos_ctrl;
  203|       |
  204|  8.64k|  if (params->is_ld_sbr) {
  ------------------
  |  Branch (204:7): [True: 1.77k, False: 6.87k]
  ------------------
  205|  1.77k|    pstr_env->str_sbr_qmf.num_time_slots = 16;
  206|  1.77k|    pstr_env->str_sbr_qmf.rate = 1;
  207|  1.77k|    if (params->frame_flag_480 == 1) {
  ------------------
  |  Branch (207:9): [True: 806, False: 965]
  ------------------
  208|    806|      pstr_env->str_sbr_qmf.num_time_slots = 15;
  209|    806|    }
  210|  6.87k|  } else {
  211|  6.87k|    pstr_env->str_sbr_qmf.num_time_slots = 16;
  212|  6.87k|    pstr_env->str_sbr_qmf.rate = 2;
  213|  6.87k|    if (params->frame_flag_960 == 1) {
  ------------------
  |  Branch (213:9): [True: 947, False: 5.92k]
  ------------------
  214|    947|      pstr_env->str_sbr_qmf.num_time_slots = 15;
  215|    947|    }
  216|  6.87k|    if (pstr_sbr_cfg->sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (216:9): [True: 3.97k, False: 2.89k]
  ------------------
  217|  3.97k|      if (USAC_SBR_RATIO_INDEX_4_1 == pstr_sbr_cfg->sbr_ratio_idx) {
  ------------------
  |  |  188|  3.97k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (217:11): [True: 826, False: 3.14k]
  ------------------
  218|    826|        pstr_env->str_sbr_qmf.rate = 4;
  219|    826|      }
  220|  3.97k|    }
  221|  6.87k|  }
  222|       |
  223|  8.64k|  ixheaace_create_qmf_bank(&pstr_env->str_sbr_qmf, pstr_sbr_tab, params->is_ld_sbr);
  224|       |
  225|  8.64k|  start_index = 576;
  226|       |
  227|  8.64k|  err_code = ixheaace_create_ton_corr_param_extr(
  228|  8.64k|      ch, &pstr_env->str_ton_corr, pstr_sbr_cfg->sample_freq, 64, params->sbr_xpos_ctrl,
  229|  8.64k|      pstr_sbr_cfg->ptr_freq_band_tab[LOW_RES][0], pstr_sbr_cfg->ptr_v_k_master,
  ------------------
  |  |   97|  8.64k|#define LOW_RES (0)
  ------------------
  230|  8.64k|      pstr_sbr_cfg->num_master, params->ana_max_level, pstr_sbr_cfg->ptr_freq_band_tab,
  231|  8.64k|      pstr_sbr_cfg->num_scf, pstr_sbr_hdr->sbr_noise_bands, params->use_speech_config,
  232|  8.64k|      ptr_common_buf, pstr_sbr_tab->ptr_qmf_tab, params->is_ld_sbr);
  233|  8.64k|  if (err_code) {
  ------------------
  |  Branch (233:7): [True: 0, False: 8.64k]
  ------------------
  234|      0|    return err_code;
  235|      0|  }
  236|       |
  237|  8.64k|  pstr_env->enc_env_data.noise_band_count =
  238|  8.64k|      pstr_env->str_ton_corr.sbr_noise_floor_est.num_of_noise_bands;
  239|       |
  240|  8.64k|  noise_groups[0] = pstr_env->enc_env_data.noise_band_count;
  241|  8.64k|  noise_groups[1] = pstr_env->enc_env_data.noise_band_count;
  242|       |
  243|  8.64k|  pstr_env->enc_env_data.sbr_invf_mode = (ixheaace_invf_mode)params->sbr_invf_mode;
  244|       |
  245|  8.64k|  if (pstr_env->enc_env_data.sbr_invf_mode == IXHEAACE_INVF_SWITCHED) {
  ------------------
  |  Branch (245:7): [True: 8.64k, False: 0]
  ------------------
  246|  8.64k|    pstr_env->enc_env_data.sbr_invf_mode = IXHEAACE_INVF_MID_LEVEL;
  247|  8.64k|    pstr_env->str_ton_corr.switch_inverse_filt = TRUE;
  ------------------
  |  |   23|  8.64k|#define TRUE (1)
  ------------------
  248|  8.64k|  } else {
  249|      0|    pstr_env->str_ton_corr.switch_inverse_filt = FALSE;
  ------------------
  |  |   26|      0|#define FALSE (0)
  ------------------
  250|      0|  }
  251|       |
  252|  8.64k|  tran_fc = params->tran_fc;
  253|       |
  254|  8.64k|  if (tran_fc == 0) {
  ------------------
  |  Branch (254:7): [True: 8.64k, False: 0]
  ------------------
  255|  8.64k|    tran_fc = ixheaac_min32(5000, ixheaace_get_sbr_start_freq_raw(pstr_sbr_hdr->sbr_start_freq,
  256|  8.64k|                                                                  64, pstr_sbr_cfg->sample_freq));
  257|  8.64k|  }
  258|       |
  259|  8.64k|  tran_fc = (tran_fc * 4 * 64 / pstr_sbr_cfg->sample_freq + 1) >> 1;
  260|  8.64k|  if (params->sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (260:7): [True: 3.97k, False: 4.66k]
  ------------------
  261|  3.97k|    pstr_env->str_sbr_extract_env.sbr_ratio_idx = params->sbr_ratio_idx;
  262|  3.97k|  }
  263|  8.64k|  err_code = ixheaace_create_extract_sbr_envelope(
  264|  8.64k|      ch, &pstr_env->str_sbr_extract_env, start_index, ptr_common_buffer2, ptr_sbr_env_r_buf,
  265|  8.64k|      ptr_sbr_env_i_buf, params->frame_flag_480, params->sbr_codec);
  266|  8.64k|  if (err_code) {
  ------------------
  |  Branch (266:7): [True: 0, False: 8.64k]
  ------------------
  267|      0|    return err_code;
  268|      0|  }
  269|       |
  270|  8.64k|  ixheaace_create_sbr_code_envelope(&pstr_env->str_sbr_code_env, pstr_sbr_cfg->num_scf,
  271|  8.64k|                                    params->delta_t_across_frames, params->df_edge_1st_env,
  272|  8.64k|                                    params->df_edge_incr);
  273|       |
  274|  8.64k|  ixheaace_create_sbr_code_envelope(&pstr_env->str_sbr_code_noise_floor, noise_groups,
  275|  8.64k|                                    params->delta_t_across_frames, 0, 0);
  276|       |
  277|  8.64k|  pstr_env->sbr_amp_res_init = pstr_sbr_hdr->sbr_amp_res;
  278|       |
  279|  8.64k|  err_code = ixheaace_init_sbr_huffman_tabs(
  280|  8.64k|      &pstr_env->enc_env_data, &pstr_env->str_sbr_code_env, &pstr_env->str_sbr_code_noise_floor,
  281|  8.64k|      pstr_env->sbr_amp_res_init, pstr_sbr_tab->ptr_sbr_huff_tab);
  282|  8.64k|  if (err_code) {
  ------------------
  |  Branch (282:7): [True: 0, False: 8.64k]
  ------------------
  283|      0|    return err_code;
  284|      0|  }
  285|       |
  286|  8.64k|  ixheaace_create_frame_info_generator(&pstr_env->str_sbr_env_frame, params->spread, e,
  287|  8.64k|                                       params->stat, pstr_env->enc_env_data.freq_res_fix,
  288|  8.64k|                                       params->use_low_freq_res);
  289|       |
  290|  8.64k|  ixheaace_create_sbr_transient_detector(
  291|  8.64k|      &pstr_env->str_sbr_trans_detector, pstr_sbr_cfg->sample_freq,
  292|  8.64k|      params->codec_settings.standard_bitrate * params->codec_settings.num_channels,
  293|  8.64k|      params->codec_settings.bit_rate, params->tran_thr, params->tran_det_mode, tran_fc,
  294|  8.64k|      params->frame_flag_480, params->is_ld_sbr, params->sbr_ratio_idx, params->sbr_codec,
  295|  8.64k|      pstr_sbr_cfg->ptr_freq_band_tab[0][0]);
  296|       |
  297|  8.64k|  pstr_sbr_cfg->xpos_control_switch = params->sbr_xpos_ctrl;
  298|  8.64k|  pstr_env->enc_env_data.no_harmonics = pstr_sbr_cfg->num_scf[HI];
  ------------------
  |  |  101|  8.64k|#define HI (1)
  ------------------
  299|  8.64k|  pstr_env->enc_env_data.synthetic_coding = pstr_sbr_cfg->detect_missing_harmonics;
  300|  8.64k|  pstr_env->enc_env_data.add_harmonic_flag = 0;
  301|  8.64k|  ixheaace_init_esbr_inter_tes(&pstr_env->str_inter_tes_enc, params->sbr_ratio_idx);
  302|  8.64k|  pstr_env->enc_env_data.ptr_sbr_inter_tes_shape = pstr_env->str_inter_tes_enc.bs_tes_shape;
  303|  8.64k|  pstr_env->enc_env_data.ptr_sbr_inter_tes_shape_mode =
  304|  8.64k|      pstr_env->str_inter_tes_enc.bs_tes_shape_mode;
  305|       |
  306|  8.64k|  if (params->sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (306:7): [True: 3.97k, False: 4.66k]
  ------------------
  307|  3.97k|    pstr_env->enc_env_data.harmonic_sbr = pstr_sbr_hdr->sbr_harmonic;
  308|  3.97k|    if (1 == pstr_env->enc_env_data.harmonic_sbr) {
  ------------------
  |  Branch (308:9): [True: 2.06k, False: 1.91k]
  ------------------
  309|  2.06k|      WORD32 persist_mem_used = 0, bd;
  310|  2.06k|      WORD32 upsamp_4_flag, num_aac_samples, num_out_samples;
  311|  2.06k|      switch (pstr_sbr_cfg->sbr_ratio_idx) {
  312|  1.46k|        case USAC_SBR_RATIO_INDEX_2_1:
  ------------------
  |  |  186|  1.46k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  |  Branch (312:9): [True: 1.46k, False: 597]
  ------------------
  313|  1.46k|          upsamp_4_flag = 0;
  314|  1.46k|          num_aac_samples = 1024;
  315|  1.46k|          num_out_samples = 2048;
  316|  1.46k|          break;
  317|    597|        case USAC_SBR_RATIO_INDEX_4_1:
  ------------------
  |  |  188|    597|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (317:9): [True: 597, False: 1.46k]
  ------------------
  318|    597|          upsamp_4_flag = 1;
  319|    597|          num_aac_samples = 1024;
  320|    597|          num_out_samples = 4096;
  321|    597|          break;
  322|      0|        case USAC_SBR_RATIO_INDEX_8_3:
  ------------------
  |  |  187|      0|#define USAC_SBR_RATIO_INDEX_8_3 (2)
  ------------------
  |  Branch (322:9): [True: 0, False: 2.06k]
  ------------------
  323|      0|          upsamp_4_flag = 0;
  324|      0|          num_aac_samples = 768;
  325|      0|          num_out_samples = 2048;
  326|      0|          break;
  327|      0|        default:
  ------------------
  |  Branch (327:9): [True: 0, False: 2.06k]
  ------------------
  328|      0|          upsamp_4_flag = 0;
  329|      0|          num_aac_samples = 1024;
  330|      0|          num_out_samples = 2048;
  331|      0|          break;
  332|  2.06k|      }
  333|       |
  334|  2.06k|      ixheaace_esbr_hbe_data_init(
  335|  2.06k|          pstr_env->pstr_hbe_enc->pstr_hbe_txposer, num_aac_samples, upsamp_4_flag,
  336|  2.06k|          num_out_samples, pstr_env->pstr_hbe_enc->ptr_hbe_txposer_buffers, &persist_mem_used);
  337|       |
  338|  2.06k|      ixheaace_esbr_qmf_init(&(pstr_env->pstr_hbe_enc->str_codec_qmf_bank),
  339|  2.06k|                             pstr_sbr_cfg->sbr_ratio_idx, num_out_samples);
  340|       |
  341|  61.8k|      for (bd = 0; bd < (IXHEAACE_MAX_FREQ_COEFFS / 2 + 1); bd++) {
  ------------------
  |  |   29|  61.8k|#define IXHEAACE_MAX_FREQ_COEFFS (56)
  ------------------
  |  Branch (341:20): [True: 59.8k, False: 2.06k]
  ------------------
  342|  59.8k|        pstr_env->pstr_hbe_enc->pstr_hbe_txposer->freq_band_tbl_lo[bd] =
  343|  59.8k|            pstr_sbr_cfg->sbr_freq_band_tab_lo[bd];
  344|  59.8k|        pstr_env->pstr_hbe_enc->pstr_hbe_txposer->freq_band_tbl_hi[bd] =
  345|  59.8k|            pstr_sbr_cfg->sbr_freq_band_tab_hi[bd];
  346|  59.8k|      }
  347|       |
  348|  59.8k|      for (; bd < (IXHEAACE_MAX_FREQ_COEFFS + 1); bd++) {
  ------------------
  |  |   29|  59.8k|#define IXHEAACE_MAX_FREQ_COEFFS (56)
  ------------------
  |  Branch (348:14): [True: 57.7k, False: 2.06k]
  ------------------
  349|  57.7k|        pstr_env->pstr_hbe_enc->pstr_hbe_txposer->freq_band_tbl_hi[bd] =
  350|  57.7k|            pstr_sbr_cfg->sbr_freq_band_tab_hi[bd];
  351|  57.7k|      }
  352|       |
  353|  2.06k|      pstr_env->pstr_hbe_enc->pstr_hbe_txposer->ptr_freq_band_tab[LO] =
  ------------------
  |  |  100|  2.06k|#define LO (0)
  ------------------
  354|  2.06k|          pstr_env->pstr_hbe_enc->pstr_hbe_txposer->freq_band_tbl_lo;
  355|  2.06k|      pstr_env->pstr_hbe_enc->pstr_hbe_txposer->ptr_freq_band_tab[HI] =
  ------------------
  |  |  101|  2.06k|#define HI (1)
  ------------------
  356|  2.06k|          pstr_env->pstr_hbe_enc->pstr_hbe_txposer->freq_band_tbl_hi;
  357|  2.06k|      pstr_env->pstr_hbe_enc->pstr_hbe_txposer->num_sf_bands[0] =
  358|  2.06k|          (WORD16)pstr_sbr_cfg->num_scf[0];
  359|  2.06k|      pstr_env->pstr_hbe_enc->pstr_hbe_txposer->num_sf_bands[1] =
  360|  2.06k|          (WORD16)pstr_sbr_cfg->num_scf[1];
  361|  2.06k|      pstr_env->pstr_hbe_enc->pstr_hbe_txposer->upsamp_4_flag = upsamp_4_flag;
  362|  2.06k|      err_code = ixheaace_dft_hbe_data_reinit(pstr_env->pstr_hbe_enc->pstr_hbe_txposer);
  363|  2.06k|      if (err_code) {
  ------------------
  |  Branch (363:11): [True: 0, False: 2.06k]
  ------------------
  364|      0|        return err_code;
  365|      0|      }
  366|  2.06k|      err_code = ixheaace_qmf_hbe_data_reinit(pstr_env->pstr_hbe_enc->pstr_hbe_txposer);
  367|  2.06k|      if (err_code) {
  ------------------
  |  Branch (367:11): [True: 0, False: 2.06k]
  ------------------
  368|      0|        return err_code;
  369|      0|      }
  370|  2.06k|    }
  371|  3.97k|  } else
  372|       |
  373|  4.66k|  {
  374|  4.66k|    pstr_env->enc_env_data.harmonic_sbr = 0;
  375|  4.66k|  }
  376|       |
  377|  8.64k|  return err_code;
  378|  8.64k|}

ixheaace_shellsort_int:
   24|  16.1k|VOID ixheaace_shellsort_int(WORD32 *ptr_in, WORD32 n) {
   25|  16.1k|  WORD32 i, j, v;
   26|  16.1k|  WORD32 inc = 1;
   27|       |
   28|  35.5k|  do {
   29|  35.5k|    inc = 3 * inc + 1;
   30|  35.5k|  } while (inc <= n);
  ------------------
  |  Branch (30:12): [True: 19.3k, False: 16.1k]
  ------------------
   31|       |
   32|  35.5k|  do {
   33|  35.5k|    inc = inc / 3;
   34|       |
   35|   265k|    for (i = inc + 1; i <= n; i++) {
  ------------------
  |  Branch (35:23): [True: 230k, False: 35.5k]
  ------------------
   36|   230k|      v = ptr_in[i - 1];
   37|   230k|      j = i;
   38|       |
   39|   251k|      while (ptr_in[j - inc - 1] > v) {
  ------------------
  |  Branch (39:14): [True: 21.7k, False: 229k]
  ------------------
   40|  21.7k|        ptr_in[j - 1] = ptr_in[j - inc - 1];
   41|  21.7k|        j -= inc;
   42|       |
   43|  21.7k|        if (j <= inc) {
  ------------------
  |  Branch (43:13): [True: 807, False: 20.9k]
  ------------------
   44|    807|          break;
   45|    807|        }
   46|  21.7k|      }
   47|       |
   48|   230k|      ptr_in[j - 1] = v;
   49|   230k|    }
   50|  35.5k|  } while (inc > 1);
  ------------------
  |  Branch (50:12): [True: 19.3k, False: 16.1k]
  ------------------
   51|  16.1k|}
ixheaace_add_vec_left:
   54|  69.8k|                           WORD32 length_src) {
   55|  69.8k|  WORD32 i;
   56|       |
   57|   169k|  for (i = length_src - 1; i >= 0; i--) {
  ------------------
  |  Branch (57:28): [True: 99.7k, False: 69.8k]
  ------------------
   58|  99.7k|    ixheaace_add_left(ptr_dst, ptr_length_dst, ptr_src[i]);
   59|  99.7k|  }
   60|  69.8k|}
ixheaace_add_left:
   62|   131k|VOID ixheaace_add_left(WORD32 *ptr_vector, WORD32 *ptr_length_vector, WORD32 value) {
   63|   131k|  WORD32 i;
   64|       |
   65|   563k|  for (i = *ptr_length_vector; i > 0; i--) {
  ------------------
  |  Branch (65:32): [True: 432k, False: 131k]
  ------------------
   66|   432k|    ptr_vector[i] = ptr_vector[i - 1];
   67|   432k|  }
   68|       |
   69|   131k|  ptr_vector[0] = value;
   70|       |
   71|   131k|  (*ptr_length_vector)++;
   72|   131k|}
ixheaace_add_right:
   74|   857k|VOID ixheaace_add_right(WORD32 *ptr_vector, WORD32 *ptr_length_vector, WORD32 value) {
   75|   857k|  ptr_vector[*ptr_length_vector] = value;
   76|       |
   77|   857k|  (*ptr_length_vector)++;
   78|   857k|}

ixheaace_sbr_missing_harmonics_detector_qmf:
  574|   579k|    const UWORD8 *ptr_freq_band_tab, WORD32 num_sfb, WORD8 *ptr_env_compensation) {
  575|   579k|  WORD32 i;
  576|   579k|  WORD32 transient_flag = ptr_tran_info[1];
  577|   579k|  WORD32 transient_pos = ptr_tran_info[0];
  578|   579k|  WORD32 new_detection_allowed;
  579|       |
  580|   579k|  UWORD8 **ptr_detection_vectors = pstr_sbr_mhd_et->ptr_detection_vectors;
  581|   579k|  WORD32 move = pstr_sbr_mhd_et->move;
  582|   579k|  WORD32 no_est_per_frame = pstr_sbr_mhd_et->no_est_per_frame;
  583|   579k|  WORD32 tot_no_est = pstr_sbr_mhd_et->tot_no_est;
  584|   579k|  WORD32 prev_trans_flag = pstr_sbr_mhd_et->prev_trans_flag;
  585|   579k|  WORD32 prev_transient_frame = pstr_sbr_mhd_et->prev_trans_frame;
  586|   579k|  WORD32 trans_pos_offset = pstr_sbr_mhd_et->trans_pos_offset;
  587|   579k|  WORD32 prev_transient_pos = pstr_sbr_mhd_et->prev_trans_pos;
  588|   579k|  ixheaace_str_guide_vectors *ptr_guide_vectors = pstr_sbr_mhd_et->guide_vectors;
  589|       |
  590|   579k|  FLOAT32 **ptr_sfm_sbr = pstr_sbr_mhd_et->ptr_sfm_sbr;
  591|   579k|  FLOAT32 **ptr_sfm_orig = pstr_sbr_mhd_et->ptr_sfm_orig;
  592|   579k|  FLOAT32 **ptr_tonal_diff = pstr_sbr_mhd_et->ptr_tonal_diff;
  593|       |
  594|   579k|  WORD32 no_qmf_bands = ptr_freq_band_tab[num_sfb] - ptr_freq_band_tab[0];
  595|       |
  596|   579k|  new_detection_allowed = ia_enhaacplus_enc_isDetectionOfNewToneAllowed(
  597|   579k|      ptr_frame_info, prev_transient_frame, prev_transient_pos, prev_trans_flag, trans_pos_offset,
  598|   579k|      transient_flag, transient_pos, pstr_sbr_mhd_et);
  599|       |
  600|   579k|  ia_enhaacplus_enc_calculate_detector_input(ptr_quota_buf, ptr_idx_vx, ptr_tonal_diff,
  601|   579k|                                             ptr_sfm_orig, ptr_sfm_sbr, ptr_freq_band_tab,
  602|   579k|                                             num_sfb, no_est_per_frame, move, no_qmf_bands);
  603|       |
  604|   579k|  ia_enhaacplus_enc_detection_with_prediction(
  605|   579k|      ptr_quota_buf, ptr_tonal_diff, num_sfb, ptr_freq_band_tab, ptr_sfm_orig, ptr_sfm_sbr,
  606|   579k|      ptr_detection_vectors, pstr_sbr_mhd_et->ptr_guide_scfb, ptr_guide_vectors, no_est_per_frame,
  607|   579k|      tot_no_est, new_detection_allowed, ptr_add_harmonics_sfbs);
  608|       |
  609|   579k|  ia_enhaacplus_enc_calculate_comp_vector(
  610|   579k|      ptr_add_harmonics_sfbs, ptr_quota_buf, ptr_env_compensation, num_sfb, ptr_freq_band_tab,
  611|   579k|      ptr_tonal_diff, tot_no_est, pstr_sbr_mhd_et->sbr_prev_env_compensation,
  612|   579k|      new_detection_allowed);
  613|       |
  614|   579k|  *ptr_add_harmonics_flag = 0;
  615|       |
  616|  6.06M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (616:15): [True: 5.68M, False: 387k]
  ------------------
  617|  5.68M|    if (ptr_add_harmonics_sfbs[i]) {
  ------------------
  |  Branch (617:9): [True: 192k, False: 5.48M]
  ------------------
  618|   192k|      *ptr_add_harmonics_flag = 1;
  619|   192k|      break;
  620|   192k|    }
  621|  5.68M|  }
  622|       |
  623|   579k|  memcpy(pstr_sbr_mhd_et->sbr_prev_env_compensation, ptr_env_compensation,
  624|   579k|         num_sfb * sizeof(pstr_sbr_mhd_et->sbr_prev_env_compensation[0]));
  625|       |
  626|   579k|  memcpy(pstr_sbr_mhd_et->ptr_guide_scfb, ptr_add_harmonics_sfbs,
  627|   579k|         num_sfb * sizeof(pstr_sbr_mhd_et->ptr_guide_scfb[0]));
  628|       |
  629|   579k|  memcpy(ptr_guide_vectors[0].ptr_guide_vector_detected, ptr_add_harmonics_sfbs,
  630|   579k|         num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vector_detected[0]));
  631|       |
  632|   579k|  if (tot_no_est > no_est_per_frame) {
  ------------------
  |  Branch (632:7): [True: 579k, False: 0]
  ------------------
  633|   579k|    memcpy(ptr_guide_vectors[0].ptr_guide_vec_diff,
  634|   579k|           ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_diff,
  635|   579k|           num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vec_diff[0]));
  636|   579k|    memcpy(ptr_guide_vectors[0].ptr_guide_vec_orig,
  637|   579k|           ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_orig,
  638|   579k|           num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vec_orig[0]));
  639|   579k|  } else {
  640|      0|    memcpy(ptr_guide_vectors[0].ptr_guide_vec_diff,
  641|      0|           ptr_guide_vectors[no_est_per_frame - 1].ptr_guide_vec_diff,
  642|      0|           num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vec_diff[0]));
  643|       |
  644|      0|    memcpy(ptr_guide_vectors[0].ptr_guide_vec_orig,
  645|      0|           ptr_guide_vectors[no_est_per_frame - 1].ptr_guide_vec_orig,
  646|      0|           num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vec_orig[0]));
  647|      0|  }
  648|       |
  649|  8.07M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (649:15): [True: 7.49M, False: 579k]
  ------------------
  650|       |#ifdef _WIN32
  651|       |#pragma warning(suppress : 6385)
  652|       |#endif
  653|  7.49M|    if ((ptr_guide_vectors[0].ptr_guide_vec_diff[i] ||
  ------------------
  |  Branch (653:10): [True: 635k, False: 6.85M]
  ------------------
  654|  6.85M|         ptr_guide_vectors[0].ptr_guide_vec_orig[i]) &&
  ------------------
  |  Branch (654:10): [True: 407k, False: 6.45M]
  ------------------
  655|  1.04M|        !ptr_add_harmonics_sfbs[i]) {
  ------------------
  |  Branch (655:9): [True: 620k, False: 422k]
  ------------------
  656|   620k|      ptr_guide_vectors[0].ptr_guide_vec_diff[i] = 0;
  657|   620k|      ptr_guide_vectors[0].ptr_guide_vec_orig[i] = 0;
  658|   620k|    }
  659|  7.49M|  }
  660|   579k|}
ixheaace_create_sbr_missing_harmonics_detector:
  665|  8.64k|    WORD32 *ptr_common_buffer) {
  666|  8.64k|  WORD32 i;
  667|  8.64k|  WORD32 *ptr_fix;
  668|  8.64k|  FLOAT32 *ptr_mem;
  669|  8.64k|  ixheaace_pstr_sbr_missing_harmonics_detector pstr_sbr_detector_handle = pstr_sbr_mhdet;
  670|       |
  671|  8.64k|  memset(pstr_sbr_detector_handle, 0, sizeof(ixheaace_str_sbr_missing_har_detector));
  672|       |
  673|  8.64k|  pstr_sbr_detector_handle->trans_pos_offset = 4;
  674|  8.64k|  pstr_sbr_detector_handle->time_slots = 16;
  675|       |
  676|  8.64k|  pstr_sbr_detector_handle->qmf_num_ch = qmf_num_ch;
  677|  8.64k|  pstr_sbr_detector_handle->sample_freq = sample_freq;
  678|  8.64k|  pstr_sbr_detector_handle->num_scf = num_sfb;
  679|       |
  680|  8.64k|  pstr_sbr_detector_handle->tot_no_est = tot_no_est;
  681|  8.64k|  pstr_sbr_detector_handle->move = move;
  682|  8.64k|  pstr_sbr_detector_handle->no_est_per_frame = no_est_per_frame;
  683|       |
  684|  8.64k|  ptr_fix = &ptr_common_buffer[ch * 5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS];
  ------------------
  |  |   71|  8.64k|#define NO_OF_ESTIMATES (4)
  ------------------
                ptr_fix = &ptr_common_buffer[ch * 5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS];
  ------------------
  |  |   83|  8.64k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.64k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  685|  8.64k|  ptr_mem = (FLOAT32 *)ptr_fix;
  686|  41.4k|  for (i = 0; i < tot_no_est; i++) {
  ------------------
  |  Branch (686:15): [True: 32.8k, False: 8.64k]
  ------------------
  687|  32.8k|    pstr_sbr_detector_handle->ptr_tonal_diff[i] = ptr_mem;
  688|  32.8k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  689|       |
  690|  32.8k|    memset(pstr_sbr_detector_handle->ptr_tonal_diff[i], 0,
  691|  32.8k|           sizeof(pstr_sbr_detector_handle->ptr_tonal_diff[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  692|       |
  693|  32.8k|    pstr_sbr_detector_handle->ptr_sfm_orig[i] = ptr_mem;
  694|  32.8k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  695|       |
  696|  32.8k|    memset(pstr_sbr_detector_handle->ptr_sfm_orig[i], 0,
  697|  32.8k|           sizeof(pstr_sbr_detector_handle->ptr_sfm_orig[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  698|       |
  699|  32.8k|    pstr_sbr_detector_handle->ptr_sfm_sbr[i] = ptr_mem;
  700|  32.8k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  701|       |
  702|  32.8k|    memset(pstr_sbr_detector_handle->ptr_sfm_sbr[i], 0,
  703|  32.8k|           sizeof(pstr_sbr_detector_handle->ptr_sfm_sbr[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  704|       |
  705|  32.8k|    pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_diff = ptr_mem;
  706|  32.8k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  707|       |
  708|  32.8k|    memset(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_diff, 0,
  709|  32.8k|           sizeof(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_diff[0]) *
  710|  32.8k|               MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  711|       |
  712|  32.8k|    pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_orig = ptr_mem;
  713|  32.8k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  714|       |
  715|  32.8k|    memset(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_orig, 0,
  716|  32.8k|           sizeof(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_orig[0]) *
  717|  32.8k|               MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  718|       |
  719|  32.8k|    pstr_sbr_detector_handle->ptr_detection_vectors[i] =
  720|  32.8k|        &(pstr_sbr_detector_handle->sbr_detection_vectors[i * MAXIMUM_FREQ_COEFFS]);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  721|       |
  722|  32.8k|    memset(pstr_sbr_detector_handle->ptr_detection_vectors[i], 0,
  723|  32.8k|           sizeof(pstr_sbr_detector_handle->ptr_detection_vectors[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  724|       |
  725|  32.8k|    pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vector_detected =
  726|  32.8k|        &(pstr_sbr_detector_handle->sbr_guide_vector_detected[i * MAXIMUM_FREQ_COEFFS]);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  727|       |
  728|  32.8k|    memset(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vector_detected, 0,
  729|  32.8k|           sizeof(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vector_detected[0]) *
  730|  32.8k|               MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.8k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.8k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  731|  32.8k|  }
  732|       |
  733|  8.64k|  pstr_sbr_detector_handle->ptr_prev_env_compensation =
  734|  8.64k|      &(pstr_sbr_detector_handle->sbr_prev_env_compensation[0]);
  735|       |
  736|  8.64k|  memset(pstr_sbr_detector_handle->ptr_prev_env_compensation, 0,
  737|  8.64k|         sizeof(pstr_sbr_detector_handle->ptr_prev_env_compensation[0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  8.64k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.64k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  738|       |
  739|  8.64k|  pstr_sbr_detector_handle->ptr_guide_scfb = &(pstr_sbr_detector_handle->sbr_guide_scfb[0]);
  740|       |
  741|  8.64k|  memset(pstr_sbr_detector_handle->ptr_guide_scfb, 0,
  742|  8.64k|         sizeof(pstr_sbr_detector_handle->ptr_guide_scfb[0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  8.64k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.64k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  743|       |
  744|  8.64k|  pstr_sbr_detector_handle->prev_trans_flag = 0;
  745|  8.64k|  pstr_sbr_detector_handle->prev_trans_frame = 0;
  746|  8.64k|  pstr_sbr_detector_handle->prev_trans_pos = 0;
  747|  8.64k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_isDetectionOfNewToneAllowed:
  159|   579k|    ixheaace_pstr_sbr_missing_harmonics_detector pstr_sbr_missing_harmonics_detector) {
  160|   579k|  WORD32 transient_frame, new_detection_allowed;
  161|       |
  162|   579k|  transient_frame = 0;
  163|       |
  164|   579k|  if (transient_flag) {
  ------------------
  |  Branch (164:7): [True: 147k, False: 432k]
  ------------------
  165|   147k|    if (transient_pos + trans_pos_offset < ptr_frame_info->borders[ptr_frame_info->n_envelopes]) {
  ------------------
  |  Branch (165:9): [True: 132k, False: 15.1k]
  ------------------
  166|   132k|      transient_frame = 1;
  167|   132k|    }
  168|   432k|  } else {
  169|   432k|    if (prev_trans_flag && !prev_transient_frame) {
  ------------------
  |  Branch (169:9): [True: 51.3k, False: 380k]
  |  Branch (169:28): [True: 3.25k, False: 48.0k]
  ------------------
  170|  3.25k|      transient_frame = 1;
  171|  3.25k|    }
  172|   432k|  }
  173|       |
  174|   579k|  new_detection_allowed = 0;
  175|       |
  176|   579k|  if (transient_frame) {
  ------------------
  |  Branch (176:7): [True: 135k, False: 444k]
  ------------------
  177|   135k|    new_detection_allowed = 1;
  178|   444k|  } else {
  179|   444k|    if (prev_transient_frame &&
  ------------------
  |  Branch (179:9): [True: 56.3k, False: 387k]
  ------------------
  180|  56.3k|        ixheaac_abs32(ptr_frame_info->borders[0] -
  ------------------
  |  Branch (180:9): [True: 41.8k, False: 14.4k]
  ------------------
  181|  56.3k|                      (prev_transient_pos + trans_pos_offset -
  182|  56.3k|                       pstr_sbr_missing_harmonics_detector->time_slots)) < DELTA_TIME) {
  ------------------
  |  |   23|  56.3k|#define DELTA_TIME 9
  ------------------
  183|  41.8k|      new_detection_allowed = 1;
  184|  41.8k|    }
  185|   444k|  }
  186|       |
  187|   579k|  pstr_sbr_missing_harmonics_detector->prev_trans_flag = transient_flag;
  188|   579k|  pstr_sbr_missing_harmonics_detector->prev_trans_frame = transient_frame;
  189|   579k|  pstr_sbr_missing_harmonics_detector->prev_trans_pos = transient_pos;
  190|       |
  191|   579k|  return (new_detection_allowed);
  192|   579k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_calculate_detector_input:
  131|   579k|    WORD32 no_est_per_frame, WORD32 move, WORD32 no_qmf_bands) {
  132|   579k|  WORD32 est;
  133|       |
  134|  1.62M|  for (est = 0; est < move; est++) {
  ------------------
  |  Branch (134:17): [True: 1.04M, False: 579k]
  ------------------
  135|  1.04M|    memcpy(ptr_tonal_diff[est], ptr_tonal_diff[est + no_est_per_frame],
  136|  1.04M|           no_qmf_bands * sizeof(ptr_tonal_diff[est][0]));
  137|       |
  138|  1.04M|    memcpy(ptr_sfm_orig[est], ptr_sfm_orig[est + no_est_per_frame],
  139|  1.04M|           no_qmf_bands * sizeof(ptr_sfm_orig[est][0]));
  140|       |
  141|  1.04M|    memcpy(ptr_sfm_sbr[est], ptr_sfm_sbr[est + no_est_per_frame],
  142|  1.04M|           no_qmf_bands * sizeof(ptr_sfm_sbr[est][0]));
  143|  1.04M|  }
  144|       |
  145|  1.73M|  for (est = 0; est < no_est_per_frame; est++) {
  ------------------
  |  Branch (145:17): [True: 1.15M, False: 579k]
  ------------------
  146|  1.15M|    ia_enhaacplus_enc_diff(ptr_quota_buf[est + move], ptr_tonal_diff[est + move],
  147|  1.15M|                           ptr_freq_band_tab, num_sfb, ptr_idx_vx);
  148|       |
  149|  1.15M|    ia_enhaacplus_enc_calculate_flatness_measure(
  150|  1.15M|        ptr_quota_buf[est + move], ptr_idx_vx, ptr_sfm_orig[est + move], ptr_sfm_sbr[est + move],
  151|  1.15M|        ptr_freq_band_tab, num_sfb);
  152|  1.15M|  }
  153|   579k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_diff:
   57|  1.15M|                                   WORD8 *ptr_idx_vx) {
   58|  1.15M|  WORD32 i, ll, lu, k;
   59|  1.15M|  FLOAT32 max_val_orig, max_val_sbr;
   60|  16.1M|  for (i = 0; i < n_scfb; i++) {
  ------------------
  |  Branch (60:15): [True: 14.9M, False: 1.15M]
  ------------------
   61|  14.9M|    ll = ptr_freq_band_tab[i];
   62|  14.9M|    lu = ptr_freq_band_tab[i + 1];
   63|  14.9M|    max_val_orig = max_val_sbr = 0;
   64|       |
   65|  49.5M|    for (k = ll; k < lu; k++) {
  ------------------
  |  Branch (65:18): [True: 34.5M, False: 14.9M]
  ------------------
   66|  34.5M|      if (ptr_tonal_orig[k] > max_val_orig) {
  ------------------
  |  Branch (66:11): [True: 17.8M, False: 16.7M]
  ------------------
   67|  17.8M|        max_val_orig = ptr_tonal_orig[k];
   68|  17.8M|      }
   69|  34.5M|      if (ptr_tonal_orig[ptr_idx_vx[k]] > max_val_sbr) {
  ------------------
  |  Branch (69:11): [True: 16.7M, False: 17.8M]
  ------------------
   70|  16.7M|        max_val_sbr = ptr_tonal_orig[ptr_idx_vx[k]];
   71|  16.7M|      }
   72|  34.5M|    }
   73|       |
   74|  14.9M|    ptr_diff_map_2_scfb[i] = (max_val_sbr > 1) ? max_val_orig / max_val_sbr : max_val_orig;
  ------------------
  |  Branch (74:30): [True: 7.53M, False: 7.45M]
  ------------------
   75|  14.9M|  }
   76|  1.15M|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_calculate_flatness_measure:
   82|  1.15M|                                                         WORD32 num_sfb) {
   83|  1.15M|  WORD32 i, j;
   84|       |
   85|  1.15M|  FLOAT32 am_org, am_transp, gm_org, gm_transp, sfm_org, sfm_transp;
   86|       |
   87|  1.15M|  i = 0;
   88|  16.1M|  while (i < num_sfb) {
  ------------------
  |  Branch (88:10): [True: 14.9M, False: 1.15M]
  ------------------
   89|  14.9M|    WORD32 band_low = ptr_freq_band_tab[i];
   90|  14.9M|    WORD32 band_high = ptr_freq_band_tab[i + 1];
   91|       |
   92|  14.9M|    ptr_sfm_orig[i] = 1.0f;
   93|  14.9M|    ptr_sfm_sbr[i] = 1.0f;
   94|       |
   95|  14.9M|    if (band_high - band_low > 1) {
  ------------------
  |  Branch (95:9): [True: 11.7M, False: 3.22M]
  ------------------
   96|  11.7M|      am_org = 0;
   97|  11.7M|      am_transp = 0;
   98|  11.7M|      gm_org = 1.0f;
   99|  11.7M|      gm_transp = 1.0f;
  100|       |
  101|  43.1M|      for (j = band_low; j < band_high; j++) {
  ------------------
  |  Branch (101:26): [True: 31.3M, False: 11.7M]
  ------------------
  102|  31.3M|        sfm_org = ptr_quota_buf[j];
  103|  31.3M|        sfm_transp = ptr_quota_buf[ptr_idx_vx[j]];
  104|       |
  105|  31.3M|        am_org += sfm_org;
  106|  31.3M|        gm_org += sfm_org;
  107|  31.3M|        am_transp += sfm_transp;
  108|  31.3M|        gm_transp += sfm_transp;
  109|  31.3M|      }
  110|       |
  111|  11.7M|      am_org /= band_high - band_low;
  112|  11.7M|      am_transp /= band_high - band_low;
  113|  11.7M|      gm_org = (FLOAT32)pow(gm_org, 1.0f / (band_high - band_low));
  114|  11.7M|      gm_transp = (FLOAT32)pow(gm_transp, 1.0f / (band_high - band_low));
  115|       |
  116|  11.7M|      if (am_org) {
  ------------------
  |  Branch (116:11): [True: 9.79M, False: 1.97M]
  ------------------
  117|  9.79M|        ptr_sfm_orig[i] = gm_org / am_org;
  118|  9.79M|      }
  119|       |
  120|  11.7M|      if (am_transp) {
  ------------------
  |  Branch (120:11): [True: 9.79M, False: 1.97M]
  ------------------
  121|  9.79M|        ptr_sfm_sbr[i] = gm_transp / am_transp;
  122|  9.79M|      }
  123|  11.7M|    }
  124|  14.9M|    i++;
  125|  14.9M|  }
  126|  1.15M|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_detection_with_prediction:
  380|   579k|    WORD32 new_detection_allowed, UWORD8 *ptr_add_harmonics_sfbs) {
  381|   579k|  WORD32 est = 0, i;
  382|   579k|  WORD32 start;
  383|       |
  384|   579k|  memset(ptr_add_harmonics_sfbs, 0, num_sfb * sizeof(ptr_add_harmonics_sfbs[0]));
  385|       |
  386|   579k|  if (new_detection_allowed) {
  ------------------
  |  Branch (386:7): [True: 177k, False: 402k]
  ------------------
  387|   177k|    if (tot_no_est > 1) {
  ------------------
  |  Branch (387:9): [True: 177k, False: 0]
  ------------------
  388|   177k|      start = no_est_per_frame;
  389|   177k|      memcpy(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_diff,
  390|   177k|             ptr_guide_vectors[0].ptr_guide_vec_diff,
  391|   177k|             num_sfb * sizeof(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_diff[0]));
  392|       |
  393|   177k|      memcpy(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_orig,
  394|   177k|             ptr_guide_vectors[0].ptr_guide_vec_orig,
  395|   177k|             num_sfb * sizeof(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_orig[0]));
  396|       |
  397|   177k|      memset(
  398|   177k|          ptr_guide_vectors[no_est_per_frame - 1].ptr_guide_vector_detected, 0,
  399|   177k|          num_sfb * sizeof(ptr_guide_vectors[no_est_per_frame - 1].ptr_guide_vector_detected[0]));
  400|   177k|    } else {
  401|      0|      start = 0;
  402|      0|    }
  403|   402k|  } else {
  404|   402k|    start = 0;
  405|   402k|  }
  406|       |
  407|  2.43M|  for (est = start; est < tot_no_est; est++) {
  ------------------
  |  Branch (407:21): [True: 1.85M, False: 579k]
  ------------------
  408|  1.85M|    if (est > 0) {
  ------------------
  |  Branch (408:9): [True: 1.44M, False: 402k]
  ------------------
  409|  1.44M|      memcpy(ptr_guide_vectors[est].ptr_guide_vector_detected, ptr_detection_vectors[est - 1],
  410|  1.44M|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vector_detected[0]));
  411|  1.44M|    }
  412|       |
  413|  1.85M|    memset(ptr_detection_vectors[est], 0, num_sfb * sizeof(ptr_detection_vectors[est][0]));
  414|       |
  415|  1.85M|    if (est < tot_no_est - 1) {
  ------------------
  |  Branch (415:9): [True: 1.27M, False: 579k]
  ------------------
  416|  1.27M|      memset(ptr_guide_vectors[est + 1].ptr_guide_vec_diff, 0,
  417|  1.27M|             num_sfb * sizeof(ptr_guide_vectors[est + 1].ptr_guide_vec_diff[0]));
  418|       |
  419|  1.27M|      memset(ptr_guide_vectors[est + 1].ptr_guide_vec_orig, 0,
  420|  1.27M|             num_sfb * sizeof(ptr_guide_vectors[est + 1].ptr_guide_vec_orig[0]));
  421|       |
  422|  1.27M|      memset(ptr_guide_vectors[est + 1].ptr_guide_vector_detected, 0,
  423|  1.27M|             num_sfb * sizeof(ptr_guide_vectors[est + 1].ptr_guide_vector_detected[0]));
  424|       |
  425|  1.27M|      ia_enhaacplus_enc_detection(ptr_quota_buf[est], ptr_diff_vec_sfb[est], num_sfb,
  426|  1.27M|                                  ptr_detection_vectors[est], ptr_freq_band_tab,
  427|  1.27M|                                  ptr_sfm_orig[est], ptr_sfm_sbr[est], &(ptr_guide_vectors[est]),
  428|  1.27M|                                  &(ptr_guide_vectors[est + 1]));
  429|  1.27M|    } else {
  430|   579k|      memset(ptr_guide_vectors[est].ptr_guide_vec_diff, 0,
  431|   579k|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vec_diff[0]));
  432|       |
  433|   579k|      memset(ptr_guide_vectors[est].ptr_guide_vec_orig, 0,
  434|   579k|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vec_orig[0]));
  435|       |
  436|   579k|      memset(ptr_guide_vectors[est].ptr_guide_vector_detected, 0,
  437|   579k|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vector_detected[0]));
  438|       |
  439|   579k|      ia_enhaacplus_enc_detection(ptr_quota_buf[est], ptr_diff_vec_sfb[est], num_sfb,
  440|   579k|                                  ptr_detection_vectors[est], ptr_freq_band_tab,
  441|   579k|                                  ptr_sfm_orig[est], ptr_sfm_sbr[est], &(ptr_guide_vectors[est]),
  442|   579k|                                  &(ptr_guide_vectors[est]));
  443|   579k|    }
  444|  1.85M|  }
  445|       |
  446|   579k|  if (new_detection_allowed) {
  ------------------
  |  Branch (446:7): [True: 177k, False: 402k]
  ------------------
  447|   177k|    if (tot_no_est > 1) {
  ------------------
  |  Branch (447:9): [True: 177k, False: 0]
  ------------------
  448|   177k|      ia_enhaacplus_enc_transient_cleanup(ptr_quota_buf, num_sfb, ptr_detection_vectors,
  449|   177k|                                          ptr_freq_band_tab, ptr_guide_vectors[no_est_per_frame],
  450|   177k|                                          start, tot_no_est);
  451|   177k|    } else {
  452|      0|      ia_enhaacplus_enc_transient_cleanup(ptr_quota_buf, num_sfb, ptr_detection_vectors,
  453|      0|                                          ptr_freq_band_tab, ptr_guide_vectors[0], start,
  454|      0|                                          tot_no_est);
  455|      0|    }
  456|   177k|  }
  457|       |
  458|  8.07M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (458:15): [True: 7.49M, False: 579k]
  ------------------
  459|  31.4M|    for (est = start; est < tot_no_est; est++) {
  ------------------
  |  Branch (459:23): [True: 23.9M, False: 7.49M]
  ------------------
  460|  23.9M|      ptr_add_harmonics_sfbs[i] = ptr_add_harmonics_sfbs[i] || ptr_detection_vectors[est][i];
  ------------------
  |  Branch (460:35): [True: 3.44M, False: 20.4M]
  |  Branch (460:64): [True: 1.76M, False: 18.7M]
  ------------------
  461|  23.9M|    }
  462|  7.49M|  }
  463|       |
  464|   579k|  if (!new_detection_allowed) {
  ------------------
  |  Branch (464:7): [True: 402k, False: 177k]
  ------------------
  465|  5.65M|    for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (465:17): [True: 5.25M, False: 402k]
  ------------------
  466|  5.25M|      if (ptr_add_harmonics_sfbs[i] - ptr_prev_frame_sfb_harm[i] > 0) {
  ------------------
  |  Branch (466:11): [True: 1.12M, False: 4.13M]
  ------------------
  467|  1.12M|        ptr_add_harmonics_sfbs[i] = 0;
  468|  1.12M|      }
  469|  5.25M|    }
  470|   402k|  }
  471|   579k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_detection:
  287|  1.85M|                                        ixheaace_str_guide_vectors *ptr_new_guide_vectors) {
  288|  1.85M|  WORD32 i, j;
  289|  1.85M|  WORD32 lower_band, upper_band;
  290|  1.85M|  FLOAT32 thr, thr_org;
  291|       |
  292|  25.7M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (292:15): [True: 23.9M, False: 1.85M]
  ------------------
  293|  23.9M|    if (ptr_guide_vectors->ptr_guide_vec_diff[i]) {
  ------------------
  |  Branch (293:9): [True: 1.35M, False: 22.5M]
  ------------------
  294|  1.35M|      if (SBR_DECAY_GUIDE_DIFF * ptr_guide_vectors->ptr_guide_vec_diff[i] > SBR_THR_DIFF_GUIDE) {
  ------------------
  |  |   41|  1.35M|#define SBR_DECAY_GUIDE_DIFF (0.5f)
  ------------------
                    if (SBR_DECAY_GUIDE_DIFF * ptr_guide_vectors->ptr_guide_vec_diff[i] > SBR_THR_DIFF_GUIDE) {
  ------------------
  |  |   42|  1.35M|#define SBR_THR_DIFF_GUIDE (1.26f)
  ------------------
  |  Branch (294:11): [True: 1.35M, False: 0]
  ------------------
  295|  1.35M|        thr = SBR_DECAY_GUIDE_DIFF * ptr_guide_vectors->ptr_guide_vec_diff[i];
  ------------------
  |  |   41|  1.35M|#define SBR_DECAY_GUIDE_DIFF (0.5f)
  ------------------
  296|  1.35M|      } else {
  297|      0|        thr = SBR_THR_DIFF_GUIDE;
  ------------------
  |  |   42|      0|#define SBR_THR_DIFF_GUIDE (1.26f)
  ------------------
  298|      0|      }
  299|  1.35M|      if (thr > SBR_THR_DIFF) {
  ------------------
  |  |   43|  1.35M|#define SBR_THR_DIFF (25.0f)
  ------------------
  |  Branch (299:11): [True: 1.34M, False: 11.6k]
  ------------------
  300|  1.34M|        thr = SBR_THR_DIFF;
  ------------------
  |  |   43|  1.34M|#define SBR_THR_DIFF (25.0f)
  ------------------
  301|  1.34M|      }
  302|  22.5M|    } else {
  303|  22.5M|      thr = SBR_THR_DIFF;
  ------------------
  |  |   43|  22.5M|#define SBR_THR_DIFF (25.0f)
  ------------------
  304|  22.5M|    }
  305|       |
  306|  23.9M|    if (ptr_diff_vec_scfb[i] > thr) {
  ------------------
  |  Branch (306:9): [True: 2.56M, False: 21.3M]
  ------------------
  307|  2.56M|      ptr_harm_vec[i] = 1;
  308|  2.56M|      ptr_new_guide_vectors->ptr_guide_vec_diff[i] = ptr_diff_vec_scfb[i];
  309|  21.3M|    } else {
  310|  21.3M|      if (ptr_guide_vectors->ptr_guide_vec_diff[i]) {
  ------------------
  |  Branch (310:11): [True: 837k, False: 20.5M]
  ------------------
  311|   837k|        ptr_guide_vectors->ptr_guide_vec_orig[i] = SBR_THR_TONE_GUIDE;
  ------------------
  |  |   46|   837k|#define SBR_THR_TONE_GUIDE (1.26f)
  ------------------
  312|   837k|      }
  313|  21.3M|    }
  314|  23.9M|  }
  315|       |
  316|  25.7M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (316:15): [True: 23.9M, False: 1.85M]
  ------------------
  317|  23.9M|    lower_band = ptr_freq_band_tab[i];
  318|  23.9M|    upper_band = ptr_freq_band_tab[i + 1];
  319|       |
  320|  23.9M|    if (ptr_guide_vectors->ptr_guide_vec_orig[i] * SBR_DECAY_GUIDE_ORIG > SBR_THR_TONE_GUIDE) {
  ------------------
  |  |   47|  23.9M|#define SBR_DECAY_GUIDE_ORIG (0.3f)
  ------------------
                  if (ptr_guide_vectors->ptr_guide_vec_orig[i] * SBR_DECAY_GUIDE_ORIG > SBR_THR_TONE_GUIDE) {
  ------------------
  |  |   46|  23.9M|#define SBR_THR_TONE_GUIDE (1.26f)
  ------------------
  |  Branch (320:9): [True: 885k, False: 23.0M]
  ------------------
  321|   885k|      thr_org = ptr_guide_vectors->ptr_guide_vec_orig[i] * SBR_DECAY_GUIDE_ORIG;
  ------------------
  |  |   47|   885k|#define SBR_DECAY_GUIDE_ORIG (0.3f)
  ------------------
  322|  23.0M|    } else {
  323|  23.0M|      thr_org = SBR_THR_TONE_GUIDE;
  ------------------
  |  |   46|  23.0M|#define SBR_THR_TONE_GUIDE (1.26f)
  ------------------
  324|  23.0M|    }
  325|  23.9M|    if (thr_org > SBR_THR_TONE) {
  ------------------
  |  |   44|  23.9M|#define SBR_THR_TONE (15.0f)
  ------------------
  |  Branch (325:9): [True: 843k, False: 23.0M]
  ------------------
  326|   843k|      thr_org = SBR_THR_TONE;
  ------------------
  |  |   44|   843k|#define SBR_THR_TONE (15.0f)
  ------------------
  327|   843k|    }
  328|  23.9M|    if (ptr_guide_vectors->ptr_guide_vec_orig[i]) {
  ------------------
  |  Branch (328:9): [True: 1.74M, False: 22.1M]
  ------------------
  329|  5.28M|      for (j = lower_band; j < upper_band; j++) {
  ------------------
  |  Branch (329:28): [True: 3.53M, False: 1.74M]
  ------------------
  330|  3.53M|        if (ptr_quota_buf[j] > thr_org) {
  ------------------
  |  Branch (330:13): [True: 2.59M, False: 947k]
  ------------------
  331|  2.59M|          ptr_harm_vec[i] = 1;
  332|  2.59M|          ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[j];
  333|  2.59M|        }
  334|  3.53M|      }
  335|  1.74M|    }
  336|  23.9M|  }
  337|       |
  338|  1.85M|  thr_org = SBR_THR_TONE;
  ------------------
  |  |   44|  1.85M|#define SBR_THR_TONE (15.0f)
  ------------------
  339|       |
  340|  25.7M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (340:15): [True: 23.9M, False: 1.85M]
  ------------------
  341|  23.9M|    lower_band = ptr_freq_band_tab[i];
  342|  23.9M|    upper_band = ptr_freq_band_tab[i + 1];
  343|       |
  344|  23.9M|    if (upper_band - lower_band > 1) {
  ------------------
  |  Branch (344:9): [True: 18.9M, False: 4.96M]
  ------------------
  345|  69.4M|      for (j = lower_band; j < upper_band; j++) {
  ------------------
  |  Branch (345:28): [True: 50.5M, False: 18.9M]
  ------------------
  346|  50.5M|        if (ptr_quota_buf[j] > thr_org && ptr_sfm_sbr[i] > SBR_THR_SFM_SBR &&
  ------------------
  |  |   48|  71.6M|#define SBR_THR_SFM_SBR (0.3f)
  ------------------
  |  Branch (346:13): [True: 21.0M, False: 29.4M]
  |  Branch (346:43): [True: 680k, False: 20.4M]
  ------------------
  347|   680k|            ptr_sfm_orig[i] > SBR_THR_SFM_ORG) {
  ------------------
  |  |   49|   680k|#define SBR_THR_SFM_ORG (0.1f)
  ------------------
  |  Branch (347:13): [True: 125k, False: 555k]
  ------------------
  348|   125k|          ptr_harm_vec[i] = 1;
  349|   125k|          ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[j];
  350|   125k|        }
  351|  50.5M|      }
  352|  18.9M|    } else {
  353|  4.96M|      if (1 < (num_sfb - 1)) {
  ------------------
  |  Branch (353:11): [True: 4.96M, False: 0]
  ------------------
  354|  4.96M|        lower_band = ptr_freq_band_tab[i];
  355|       |
  356|  4.96M|        if (i > 0) {
  ------------------
  |  Branch (356:13): [True: 3.61M, False: 1.35M]
  ------------------
  357|  3.61M|          if (ptr_quota_buf[lower_band] > SBR_THR_TONE &&
  ------------------
  |  |   44|  7.23M|#define SBR_THR_TONE (15.0f)
  ------------------
  |  Branch (357:15): [True: 1.14M, False: 2.47M]
  ------------------
  358|  1.14M|              (ptr_diff_vec_scfb[i - 1] < SBR_INV_THR_TONE ||
  ------------------
  |  |   45|  2.28M|#define SBR_INV_THR_TONE (1.0f / 15.0f)
  ------------------
  |  Branch (358:16): [True: 381k, False: 762k]
  ------------------
  359|   762k|               ptr_diff_vec_scfb[i + 1] < SBR_INV_THR_TONE)) {
  ------------------
  |  |   45|   762k|#define SBR_INV_THR_TONE (1.0f / 15.0f)
  ------------------
  |  Branch (359:16): [True: 172k, False: 589k]
  ------------------
  360|   554k|            ptr_harm_vec[i] = 1;
  361|   554k|            ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[lower_band];
  362|   554k|          }
  363|  3.61M|        } else {
  364|  1.35M|          if (ptr_quota_buf[lower_band] > SBR_THR_TONE &&
  ------------------
  |  |   44|  2.70M|#define SBR_THR_TONE (15.0f)
  ------------------
  |  Branch (364:15): [True: 400k, False: 951k]
  ------------------
  365|   400k|              ptr_diff_vec_scfb[i + 1] < SBR_INV_THR_TONE) {
  ------------------
  |  |   45|   400k|#define SBR_INV_THR_TONE (1.0f / 15.0f)
  ------------------
  |  Branch (365:15): [True: 99.8k, False: 300k]
  ------------------
  366|  99.8k|            ptr_harm_vec[i] = 1;
  367|  99.8k|            ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[lower_band];
  368|  99.8k|          }
  369|  1.35M|        }
  370|  4.96M|      }
  371|  4.96M|    }
  372|  23.9M|  }
  373|  1.85M|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_transient_cleanup:
  198|   177k|                                                WORD32 start, WORD32 stop) {
  199|   177k|  WORD32 sfb, band, low_band, up_band, est;
  200|       |
  201|   177k|  UWORD8 ptr_harm_vec[MAXIMUM_FREQ_COEFFS];
  202|       |
  203|   177k|  memset(ptr_harm_vec, 0, sizeof(ptr_harm_vec));
  204|       |
  205|   484k|  for (est = start; est < stop; est++) {
  ------------------
  |  Branch (205:21): [True: 307k, False: 177k]
  ------------------
  206|  3.80M|    for (sfb = 0; sfb < num_sfb - 1; sfb++) {
  ------------------
  |  Branch (206:19): [True: 3.49M, False: 307k]
  ------------------
  207|  3.49M|      ptr_harm_vec[sfb] = ptr_harm_vec[sfb] || ptr_detection_vectors[est][sfb];
  ------------------
  |  Branch (207:27): [True: 164k, False: 3.33M]
  |  Branch (207:48): [True: 323k, False: 3.01M]
  ------------------
  208|  3.49M|    }
  209|   307k|  }
  210|       |
  211|  2.23M|  for (sfb = 0; sfb < num_sfb - 1; sfb++) {
  ------------------
  |  Branch (211:17): [True: 2.06M, False: 177k]
  ------------------
  212|  2.06M|    if (ptr_harm_vec[sfb] && ptr_harm_vec[sfb + 1]) {
  ------------------
  |  Branch (212:9): [True: 323k, False: 1.73M]
  |  Branch (212:30): [True: 127k, False: 196k]
  ------------------
  213|   127k|      FLOAT32 max_val_1, max_val_2;
  214|   127k|      WORD32 maxPos1, maxPos2;
  215|       |
  216|   127k|      low_band = ptr_freq_band_tab[sfb];
  217|   127k|      up_band = ptr_freq_band_tab[sfb + 1];
  218|   127k|      maxPos1 = low_band;
  219|       |
  220|   127k|      max_val_1 = ptr_quota_buf[start][low_band];
  221|   324k|      for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (221:29): [True: 197k, False: 127k]
  ------------------
  222|   197k|        if (ptr_quota_buf[start][band] > max_val_1) {
  ------------------
  |  Branch (222:13): [True: 33.8k, False: 163k]
  ------------------
  223|  33.8k|          max_val_1 = ptr_quota_buf[start][band];
  224|  33.8k|          maxPos1 = band;
  225|  33.8k|        }
  226|   197k|      }
  227|       |
  228|   214k|      for (est = start + 1; est < stop; est++) {
  ------------------
  |  Branch (228:29): [True: 87.1k, False: 127k]
  ------------------
  229|   230k|        for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (229:31): [True: 143k, False: 87.1k]
  ------------------
  230|   143k|          if (ptr_quota_buf[est][band] > max_val_1) {
  ------------------
  |  Branch (230:15): [True: 43.0k, False: 100k]
  ------------------
  231|  43.0k|            max_val_1 = ptr_quota_buf[est][band];
  232|  43.0k|            maxPos1 = band;
  233|  43.0k|          }
  234|   143k|        }
  235|  87.1k|      }
  236|       |
  237|   127k|      low_band = ptr_freq_band_tab[sfb + 1];
  238|   127k|      up_band = ptr_freq_band_tab[sfb + 2];
  239|       |
  240|   127k|      maxPos2 = low_band;
  241|   127k|      max_val_2 = ptr_quota_buf[start][low_band];
  242|       |
  243|   345k|      for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (243:29): [True: 218k, False: 127k]
  ------------------
  244|   218k|        if (ptr_quota_buf[start][band] > max_val_2) {
  ------------------
  |  Branch (244:13): [True: 38.6k, False: 179k]
  ------------------
  245|  38.6k|          max_val_2 = ptr_quota_buf[start][band];
  246|  38.6k|          maxPos2 = band;
  247|  38.6k|        }
  248|   218k|      }
  249|       |
  250|   214k|      for (est = start + 1; est < stop; est++) {
  ------------------
  |  Branch (250:29): [True: 87.1k, False: 127k]
  ------------------
  251|   248k|        for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (251:31): [True: 160k, False: 87.1k]
  ------------------
  252|   160k|          if (ptr_quota_buf[est][band] > max_val_2) {
  ------------------
  |  Branch (252:15): [True: 43.5k, False: 117k]
  ------------------
  253|  43.5k|            max_val_2 = ptr_quota_buf[est][band];
  254|  43.5k|            maxPos2 = band;
  255|  43.5k|          }
  256|   160k|        }
  257|  87.1k|      }
  258|       |
  259|   127k|      if (maxPos2 - maxPos1 < 2) {
  ------------------
  |  Branch (259:11): [True: 79.9k, False: 47.1k]
  ------------------
  260|  79.9k|        if (max_val_1 > max_val_2) {
  ------------------
  |  Branch (260:13): [True: 39.6k, False: 40.3k]
  ------------------
  261|  39.6k|          ptr_guide_vectors.ptr_guide_vector_detected[sfb + 1] = 0;
  262|  39.6k|          ptr_guide_vectors.ptr_guide_vec_orig[sfb + 1] = 0;
  263|  39.6k|          ptr_guide_vectors.ptr_guide_vec_diff[sfb + 1] = 0;
  264|       |
  265|   104k|          for (est = start; est < stop; est++) {
  ------------------
  |  Branch (265:29): [True: 64.9k, False: 39.6k]
  ------------------
  266|  64.9k|            ptr_detection_vectors[est][sfb + 1] = 0;
  267|  64.9k|          }
  268|  40.3k|        } else {
  269|  40.3k|          ptr_guide_vectors.ptr_guide_vector_detected[sfb] = 0;
  270|  40.3k|          ptr_guide_vectors.ptr_guide_vec_diff[sfb] = 0;
  271|  40.3k|          ptr_guide_vectors.ptr_guide_vec_orig[sfb] = 0;
  272|       |
  273|   103k|          for (est = start; est < stop; est++) {
  ------------------
  |  Branch (273:29): [True: 62.9k, False: 40.3k]
  ------------------
  274|  62.9k|            ptr_detection_vectors[est][sfb] = 0;
  275|  62.9k|          }
  276|  40.3k|        }
  277|  79.9k|      }
  278|   127k|    }
  279|  2.06M|  }
  280|   177k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_calculate_comp_vector:
  476|   579k|    WORD8 *ptr_prev_env_compensation, WORD32 new_detection_allowed) {
  477|   579k|  WORD32 i, j, l;
  478|       |
  479|   579k|  memset(ptr_env_compensation, 0, num_sfb * sizeof(ptr_env_compensation[0]));
  480|       |
  481|   579k|  FLOAT32 max_val;
  482|   579k|  WORD32 lower_band, upper_band;
  483|   579k|  WORD32 max_pos_band, max_pos_est;
  484|   579k|  WORD8 comp_val;
  485|       |
  486|  8.07M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (486:15): [True: 7.49M, False: 579k]
  ------------------
  487|  7.49M|    if (ptr_add_harmonics_sfbs[i]) {
  ------------------
  |  Branch (487:9): [True: 638k, False: 6.85M]
  ------------------
  488|   638k|      lower_band = ptr_freq_band_tab[i];
  489|   638k|      upper_band = ptr_freq_band_tab[i + 1];
  490|       |
  491|   638k|      max_pos_band = 0;
  492|   638k|      max_pos_est = 0;
  493|   638k|      max_val = 0;
  494|       |
  495|  3.10M|      for (j = 0; j < tot_no_est; j++) {
  ------------------
  |  Branch (495:19): [True: 2.46M, False: 638k]
  ------------------
  496|  7.62M|        for (l = lower_band; l < upper_band; l++) {
  ------------------
  |  Branch (496:30): [True: 5.15M, False: 2.46M]
  ------------------
  497|  5.15M|          if (ptr_tonality[j][l] > max_val) {
  ------------------
  |  Branch (497:15): [True: 1.52M, False: 3.63M]
  ------------------
  498|  1.52M|            max_val = ptr_tonality[j][l];
  499|  1.52M|            max_pos_band = l;
  500|  1.52M|            max_pos_est = j;
  501|  1.52M|          }
  502|  5.15M|        }
  503|  2.46M|      }
  504|       |
  505|   638k|      if (max_pos_band == lower_band && i) {
  ------------------
  |  Branch (505:11): [True: 408k, False: 229k]
  |  Branch (505:41): [True: 354k, False: 53.6k]
  ------------------
  506|   354k|        comp_val =
  507|   354k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i - 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   354k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                          (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i - 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   39|   354k|#define SBR_EPS (1e-18)
  ------------------
  508|   354k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   354k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (508:13): [True: 183k, False: 171k]
  ------------------
  509|   183k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   183k|#define SBR_MAX_COMP (2)
  ------------------
  510|   183k|        }
  511|       |
  512|   354k|        if (!ptr_add_harmonics_sfbs[i - 1]) {
  ------------------
  |  Branch (512:13): [True: 291k, False: 63.1k]
  ------------------
  513|   291k|          if (ptr_tonality[max_pos_est][max_pos_band - 1] >
  ------------------
  |  Branch (513:15): [True: 162k, False: 129k]
  ------------------
  514|   291k|              SBR_TONALITY_QUOTA * ptr_tonality[max_pos_est][max_pos_band]) {
  ------------------
  |  |   51|   291k|#define SBR_TONALITY_QUOTA (0.1f)
  ------------------
  515|   162k|            ptr_env_compensation[i - 1] = -1 * comp_val;
  516|   162k|          }
  517|   291k|        }
  518|   354k|      }
  519|       |
  520|   638k|      if (max_pos_band == (upper_band - 1) && (i + 1) < num_sfb) {
  ------------------
  |  Branch (520:11): [True: 337k, False: 300k]
  |  Branch (520:47): [True: 330k, False: 7.25k]
  ------------------
  521|   330k|        comp_val =
  522|   330k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i + 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   330k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                          (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i + 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   39|   330k|#define SBR_EPS (1e-18)
  ------------------
  523|   330k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   330k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (523:13): [True: 176k, False: 154k]
  ------------------
  524|   176k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   176k|#define SBR_MAX_COMP (2)
  ------------------
  525|   176k|        }
  526|       |
  527|   330k|        if (!ptr_add_harmonics_sfbs[i + 1]) {
  ------------------
  |  Branch (527:13): [True: 284k, False: 45.5k]
  ------------------
  528|   284k|          if (ptr_tonality[max_pos_est][max_pos_band + 1] >
  ------------------
  |  Branch (528:15): [True: 140k, False: 144k]
  ------------------
  529|   284k|              SBR_TONALITY_QUOTA * ptr_tonality[max_pos_est][max_pos_band]) {
  ------------------
  |  |   51|   284k|#define SBR_TONALITY_QUOTA (0.1f)
  ------------------
  530|   140k|            ptr_env_compensation[i + 1] = comp_val;
  531|   140k|          }
  532|   284k|        }
  533|   330k|      }
  534|       |
  535|   638k|      if (i && i < (num_sfb - 1)) {
  ------------------
  |  Branch (535:11): [True: 574k, False: 63.8k]
  |  Branch (535:16): [True: 545k, False: 28.8k]
  ------------------
  536|   545k|        comp_val =
  537|   545k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i - 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   545k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                          (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i - 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   39|   545k|#define SBR_EPS (1e-18)
  ------------------
  538|   545k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   545k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (538:13): [True: 258k, False: 287k]
  ------------------
  539|   258k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   258k|#define SBR_MAX_COMP (2)
  ------------------
  540|   258k|        }
  541|       |
  542|   545k|        if (ixheaace_div32((FLOAT32)1.0f, ptr_diff[max_pos_est][i - 1]) >
  ------------------
  |  Branch (542:13): [True: 158k, False: 387k]
  ------------------
  543|   545k|            (SBR_DIFF_QUOTA * ptr_diff[max_pos_est][i])) {
  ------------------
  |  |   52|   545k|#define SBR_DIFF_QUOTA (0.75f)
  ------------------
  544|   158k|          ptr_env_compensation[i - 1] = -1 * comp_val;
  545|   158k|        }
  546|       |
  547|   545k|        comp_val =
  548|   545k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i + 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   545k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
                          (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i + 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   39|   545k|#define SBR_EPS (1e-18)
  ------------------
  549|   545k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   545k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (549:13): [True: 240k, False: 304k]
  ------------------
  550|   240k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   240k|#define SBR_MAX_COMP (2)
  ------------------
  551|   240k|        }
  552|       |
  553|   545k|        if (ixheaace_div32((FLOAT32)1.0f, ptr_diff[max_pos_est][i + 1]) >
  ------------------
  |  Branch (553:13): [True: 174k, False: 371k]
  ------------------
  554|   545k|            (SBR_DIFF_QUOTA * ptr_diff[max_pos_est][i])) {
  ------------------
  |  |   52|   545k|#define SBR_DIFF_QUOTA (0.75f)
  ------------------
  555|   174k|          ptr_env_compensation[i + 1] = comp_val;
  556|   174k|        }
  557|   545k|      }
  558|   638k|    }
  559|  7.49M|  }
  560|       |
  561|   579k|  if (!new_detection_allowed) {
  ------------------
  |  Branch (561:7): [True: 402k, False: 177k]
  ------------------
  562|  5.65M|    for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (562:17): [True: 5.25M, False: 402k]
  ------------------
  563|  5.25M|      if (ptr_env_compensation[i] != 0 && ptr_prev_env_compensation[i] == 0) {
  ------------------
  |  Branch (563:11): [True: 252k, False: 5.00M]
  |  Branch (563:43): [True: 113k, False: 138k]
  ------------------
  564|   113k|        ptr_env_compensation[i] = 0;
  565|   113k|      }
  566|  5.25M|    }
  567|   402k|  }
  568|   579k|}

ixheaace_sbr_noise_floor_estimate_qmf:
  187|   579k|    WORD32 is_ld_sbr) {
  188|   579k|  WORD32 n_noise_envelopes, start_pos[2], stop_pos[2], env, band;
  189|   579k|  WORD32 num_of_noise_bands = pstr_noise_floor_est_sbr->num_of_noise_bands;
  190|   579k|  WORD32 *ptr_freq_band_tab = pstr_noise_floor_est_sbr->s_freq_qmf_band_tbl;
  191|       |
  192|   579k|  n_noise_envelopes = ptr_frame_info->n_noise_envelopes;
  193|       |
  194|   579k|  if (n_noise_envelopes == 1) {
  ------------------
  |  Branch (194:7): [True: 366k, False: 213k]
  ------------------
  195|   366k|    start_pos[0] = start_index;
  196|   366k|    stop_pos[0] = start_index + 2;
  197|   366k|  } else {
  198|   213k|    start_pos[0] = start_index;
  199|   213k|    stop_pos[0] = start_index + 1;
  200|   213k|    start_pos[1] = start_index + 1;
  201|   213k|    stop_pos[1] = start_index + 2;
  202|   213k|  }
  203|       |
  204|  1.37M|  for (env = 0; env < n_noise_envelopes; env++) {
  ------------------
  |  Branch (204:17): [True: 793k, False: 579k]
  ------------------
  205|  2.89M|    for (band = 0; band < num_of_noise_bands; band++) {
  ------------------
  |  Branch (205:20): [True: 2.09M, False: 793k]
  ------------------
  206|  2.09M|      ia_enhaacplus_enc_qmf_based_noise_floor_detection(
  207|  2.09M|          &ptr_noise_lvls[band + env * num_of_noise_bands], ptr_quota_orig,
  208|  2.09M|          pstr_noise_floor_est_sbr->weight_fac, pstr_noise_floor_est_sbr->max_level, 1.0f,
  209|  2.09M|          ptr_idx_vx, start_pos[env], stop_pos[env], ptr_freq_band_tab[band],
  210|  2.09M|          ptr_freq_band_tab[band + 1], missing_harmonics_flag,
  211|  2.09M|          pstr_noise_floor_est_sbr->thr_offset, ptr_inv_filt_levels[band]);
  212|  2.09M|    }
  213|   793k|  }
  214|       |
  215|   579k|  ia_enhaacplus_enc_smoothing_noise_levels(
  216|   579k|      ptr_noise_lvls, n_noise_envelopes, pstr_noise_floor_est_sbr->num_of_noise_bands,
  217|   579k|      pstr_noise_floor_est_sbr->prev_noise_lvls, pstr_noise_floor_est_sbr->ptr_smooth_filter,
  218|   579k|      transient_flag, is_ld_sbr);
  219|       |
  220|  1.37M|  for (env = 0; env < n_noise_envelopes; env++) {
  ------------------
  |  Branch (220:17): [True: 793k, False: 579k]
  ------------------
  221|  2.89M|    for (band = 0; band < num_of_noise_bands; band++) {
  ------------------
  |  Branch (221:20): [True: 2.09M, False: 793k]
  ------------------
  222|  2.09M|      ptr_noise_lvls[band + env * num_of_noise_bands] =
  223|  2.09M|          (FLOAT32)SBR_NOISE_FLOOR_OFFSET -
  ------------------
  |  |   37|  2.09M|#define SBR_NOISE_FLOOR_OFFSET (6)
  ------------------
  224|  2.09M|          (FLOAT32)(SBR_INV_LOG_2 * log(ptr_noise_lvls[band + env * num_of_noise_bands]));
  ------------------
  |  |   38|  2.09M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  225|  2.09M|    }
  226|   793k|  }
  227|   579k|}
ixheaace_create_sbr_noise_floor_estimate:
  272|  8.64k|                                         ixheaace_str_qmf_tabs *ptr_qmf_tab) {
  273|  8.64k|  memset(pstr_noise_floor_est_sbr, 0, sizeof(ixheaace_str_noise_flr_est_sbr));
  274|       |
  275|  8.64k|  pstr_noise_floor_est_sbr->ptr_smooth_filter = ptr_qmf_tab->ptr_smooth_filter;
  276|       |
  277|  8.64k|  if (use_speech_config) {
  ------------------
  |  Branch (277:7): [True: 1.53k, False: 7.10k]
  ------------------
  278|  1.53k|    pstr_noise_floor_est_sbr->weight_fac = 1.0f;
  279|  1.53k|    pstr_noise_floor_est_sbr->thr_offset = IXHEAACE_INVF_LOW_LEVEL;
  280|  7.10k|  } else {
  281|  7.10k|    pstr_noise_floor_est_sbr->weight_fac = 0.25f;
  282|  7.10k|    pstr_noise_floor_est_sbr->thr_offset = IXHEAACE_INVF_MID_LEVEL;
  283|  7.10k|  }
  284|       |
  285|  8.64k|  if (ana_max_level == -3) {
  ------------------
  |  Branch (285:7): [True: 4.38k, False: 4.26k]
  ------------------
  286|  4.38k|    pstr_noise_floor_est_sbr->max_level = 0.5f;
  287|  4.38k|  } else if (ana_max_level == 3) {
  ------------------
  |  Branch (287:14): [True: 2.29k, False: 1.96k]
  ------------------
  288|  2.29k|    pstr_noise_floor_est_sbr->max_level = 2.0f;
  289|  2.29k|  } else if (ana_max_level == 6) {
  ------------------
  |  Branch (289:14): [True: 1.89k, False: 71]
  ------------------
  290|  1.89k|    pstr_noise_floor_est_sbr->max_level = 4.0f;
  291|  1.89k|  } else {
  292|     71|  }
  293|       |
  294|  8.64k|  pstr_noise_floor_est_sbr->noise_groups = noise_groups;
  295|       |
  296|  8.64k|  return ixheaace_reset_sbr_noise_floor_estimate(pstr_noise_floor_est_sbr, ptr_freq_band_tab,
  297|  8.64k|                                                 num_scf);
  298|  8.64k|}
ixheaace_reset_sbr_noise_floor_estimate:
  302|  8.64k|                                        const UWORD8 *ptr_freq_band_tab, WORD32 num_scf) {
  303|  8.64k|  WORD32 k2, kx;
  304|       |
  305|  8.64k|  k2 = ptr_freq_band_tab[num_scf];
  306|  8.64k|  kx = ptr_freq_band_tab[0];
  307|       |
  308|       |  /* ISO_IEC spec 14496-3 section 4.6.18.3.2.2 Derived frequency band tables */
  309|  8.64k|  pstr_noise_floor_est_sbr->num_of_noise_bands =
  310|  8.64k|      (WORD32)((pstr_noise_floor_est_sbr->noise_groups * log((FLOAT32)k2 / kx) * SBR_INV_LOG_2) +
  ------------------
  |  |   38|  8.64k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  311|  8.64k|               0.5f);
  312|       |
  313|  8.64k|  pstr_noise_floor_est_sbr->num_of_noise_bands =
  314|  8.64k|      MAX(1, pstr_noise_floor_est_sbr->num_of_noise_bands);
  ------------------
  |  |   24|  8.64k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 8.64k]
  |  |  ------------------
  ------------------
  315|       |
  316|       |  /* ISO_IEC spec 14496-3 section 4.6.18.3.6  Requirements */
  317|  8.64k|  pstr_noise_floor_est_sbr->num_of_noise_bands =
  318|  8.64k|      MIN(pstr_noise_floor_est_sbr->num_of_noise_bands, MAXIMUM_NUM_NOISE_COEFFS);
  ------------------
  |  |   23|  8.64k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.99k, False: 652]
  |  |  ------------------
  ------------------
  319|       |
  320|  8.64k|  return ia_enhaacplus_enc_down_sample_lo_res(pstr_noise_floor_est_sbr->s_freq_qmf_band_tbl,
  321|  8.64k|                                              pstr_noise_floor_est_sbr->num_of_noise_bands,
  322|  8.64k|                                              ptr_freq_band_tab, num_scf);
  323|  8.64k|}
ixheaace_sbr_noise_floor_est.c:ia_enhaacplus_enc_qmf_based_noise_floor_detection:
  100|  2.09M|    ixheaace_invf_mode thr_offset, ixheaace_invf_mode inv_filtering_lvl) {
  101|  2.09M|  WORD32 ch, idx;
  102|  2.09M|  FLOAT32 ton_org, ton_sbr, mean_org = 0, mean_sbr = 0, diff;
  103|       |
  104|  2.09M|  if (1 == missing_harmonic_flag) {
  ------------------
  |  Branch (104:7): [True: 732k, False: 1.36M]
  ------------------
  105|  8.87M|    for (ch = start_channel; ch < stop_channel; ch++) {
  ------------------
  |  Branch (105:30): [True: 8.14M, False: 732k]
  ------------------
  106|  8.14M|      ton_org = 0;
  107|  8.14M|      ton_sbr = 0;
  108|  18.8M|      for (idx = start_index; idx < stop_index; idx++) {
  ------------------
  |  Branch (108:31): [True: 10.7M, False: 8.14M]
  ------------------
  109|  10.7M|        ton_org += ptr_quota_orig[idx][ch];
  110|  10.7M|        ton_sbr += ptr_quota_orig[idx][ptr_idx_vx[ch]];
  111|  10.7M|      }
  112|       |
  113|  8.14M|      ton_org /= (stop_index - start_index);
  114|  8.14M|      ton_sbr /= (stop_index - start_index);
  115|       |
  116|  8.14M|      if (ton_org > mean_org) {
  ------------------
  |  Branch (116:11): [True: 1.75M, False: 6.38M]
  ------------------
  117|  1.75M|        mean_org = ton_org;
  118|  1.75M|      }
  119|       |
  120|  8.14M|      if (ton_sbr > mean_sbr) {
  ------------------
  |  Branch (120:11): [True: 1.64M, False: 6.49M]
  ------------------
  121|  1.64M|        mean_sbr = ton_sbr;
  122|  1.64M|      }
  123|  8.14M|    }
  124|  1.36M|  } else {
  125|  16.7M|    for (ch = start_channel; ch < stop_channel; ch++) {
  ------------------
  |  Branch (125:30): [True: 15.3M, False: 1.36M]
  ------------------
  126|  15.3M|      ton_org = 0;
  127|  15.3M|      ton_sbr = 0;
  128|  39.2M|      for (idx = start_index; idx < stop_index; idx++) {
  ------------------
  |  Branch (128:31): [True: 23.8M, False: 15.3M]
  ------------------
  129|  23.8M|        ton_org += ptr_quota_orig[idx][ch];
  130|  23.8M|        ton_sbr += ptr_quota_orig[idx][ptr_idx_vx[ch]];
  131|  23.8M|      }
  132|       |
  133|  15.3M|      ton_org /= (stop_index - start_index);
  134|  15.3M|      ton_sbr /= (stop_index - start_index);
  135|       |
  136|  15.3M|      mean_org += ton_org;
  137|  15.3M|      mean_sbr += ton_sbr;
  138|  15.3M|    }
  139|  1.36M|    mean_org /= (stop_channel - start_channel);
  140|  1.36M|    mean_sbr /= (stop_channel - start_channel);
  141|  1.36M|  }
  142|       |
  143|  2.09M|  if (mean_org < SBR_TON_MEAN_P0009 && mean_sbr < SBR_TON_MEAN_P0009) {
  ------------------
  |  |   53|  4.19M|#define SBR_TON_MEAN_P0009 (0.000976562f)
  ------------------
                if (mean_org < SBR_TON_MEAN_P0009 && mean_sbr < SBR_TON_MEAN_P0009) {
  ------------------
  |  |   53|   377k|#define SBR_TON_MEAN_P0009 (0.000976562f)
  ------------------
  |  Branch (143:7): [True: 377k, False: 1.72M]
  |  Branch (143:40): [True: 328k, False: 48.9k]
  ------------------
  144|   328k|    mean_org = mean_sbr = SBR_TON_MEAN_101P59;
  ------------------
  |  |   54|   328k|#define SBR_TON_MEAN_101P59 (101.5936673f)
  ------------------
  145|   328k|  }
  146|       |
  147|  2.09M|  if (mean_org < 1.0f) {
  ------------------
  |  Branch (147:7): [True: 350k, False: 1.74M]
  ------------------
  148|   350k|    mean_org = 1.0f;
  149|   350k|  }
  150|       |
  151|  2.09M|  if (mean_sbr < 1.0f) {
  ------------------
  |  Branch (151:7): [True: 445k, False: 1.65M]
  ------------------
  152|   445k|    mean_sbr = 1.0f;
  153|   445k|  }
  154|       |
  155|  2.09M|  if (1 == missing_harmonic_flag) {
  ------------------
  |  Branch (155:7): [True: 732k, False: 1.36M]
  ------------------
  156|   732k|    diff = 1.0f;
  157|  1.36M|  } else {
  158|  1.36M|    if (1.0f > (weight_fac * mean_sbr / mean_org)) {
  ------------------
  |  Branch (158:9): [True: 1.22M, False: 138k]
  ------------------
  159|  1.22M|      diff = 1.0f;
  160|  1.22M|    } else {
  161|   138k|      diff = weight_fac * mean_sbr / mean_org;
  162|   138k|    }
  163|  1.36M|  }
  164|       |
  165|  2.09M|  if (inv_filtering_lvl == IXHEAACE_INVF_MID_LEVEL ||
  ------------------
  |  Branch (165:7): [True: 82.0k, False: 2.01M]
  ------------------
  166|  2.06M|      inv_filtering_lvl == IXHEAACE_INVF_LOW_LEVEL || inv_filtering_lvl == IXHEAACE_INVF_OFF) {
  ------------------
  |  Branch (166:7): [True: 104k, False: 1.91M]
  |  Branch (166:55): [True: 1.87M, False: 35.6k]
  ------------------
  167|  2.06M|    diff = 1.0f;
  168|  2.06M|  }
  169|       |
  170|  2.09M|  if (inv_filtering_lvl <= thr_offset) {
  ------------------
  |  Branch (170:7): [True: 2.06M, False: 38.5k]
  ------------------
  171|  2.06M|    diff = 1.0f;
  172|  2.06M|  }
  173|       |
  174|  2.09M|  *ptr_noise_lvl = diff / mean_org;
  175|  2.09M|  *ptr_noise_lvl *= noise_floor_offset;
  176|       |
  177|  2.09M|  if (*ptr_noise_lvl > max_lvl) {
  ------------------
  |  Branch (177:7): [True: 464k, False: 1.63M]
  ------------------
  178|   464k|    *ptr_noise_lvl = max_lvl;
  179|   464k|  }
  180|  2.09M|}
ixheaace_sbr_noise_floor_est.c:ia_enhaacplus_enc_smoothing_noise_levels:
   59|   579k|    const FLOAT32 *ptr_smooth_filter, WORD32 transient_flag, WORD32 is_ld_sbr) {
   60|   579k|  WORD32 i, band, env;
   61|       |
   62|  1.37M|  for (env = 0; env < num_env; env++) {
  ------------------
  |  Branch (62:17): [True: 793k, False: 579k]
  ------------------
   63|   793k|    if (is_ld_sbr) {
  ------------------
  |  Branch (63:9): [True: 155k, False: 637k]
  ------------------
   64|   155k|      if (transient_flag) {
  ------------------
  |  Branch (64:11): [True: 72.5k, False: 82.6k]
  ------------------
   65|   362k|        for (i = 0; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|   362k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (65:21): [True: 290k, False: 72.5k]
  ------------------
   66|   290k|          memcpy(prev_noise_lvls[i], ptr_noise_lvls + env * num_noise_bands,
   67|   290k|                 num_noise_bands * sizeof(prev_noise_lvls[i][0]));
   68|   290k|        }
   69|  82.6k|      } else {
   70|   330k|        for (i = 1; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|   330k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (70:21): [True: 247k, False: 82.6k]
  ------------------
   71|   247k|          memcpy(prev_noise_lvls[i - 1], prev_noise_lvls[i],
   72|   247k|                 num_noise_bands * sizeof(prev_noise_lvls[i - 1][0]));
   73|   247k|        }
   74|  82.6k|      }
   75|   637k|    } else {
   76|  2.55M|      for (i = 1; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|  2.55M|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (76:19): [True: 1.91M, False: 637k]
  ------------------
   77|  1.91M|        memcpy(prev_noise_lvls[i - 1], prev_noise_lvls[i],
   78|  1.91M|               num_noise_bands * sizeof(prev_noise_lvls[i - 1][0]));
   79|  1.91M|      }
   80|   637k|    }
   81|   793k|    memcpy(prev_noise_lvls[IXHEAACE_NF_SMOOTHING_LENGTH - 1],
  ------------------
  |  |   23|   793k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
   82|   793k|           ptr_noise_lvls + env * num_noise_bands,
   83|   793k|           num_noise_bands * sizeof(prev_noise_lvls[IXHEAACE_NF_SMOOTHING_LENGTH - 1][0]));
  ------------------
  |  |   23|   793k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
   84|       |
   85|  2.89M|    for (band = 0; band < num_noise_bands; band++) {
  ------------------
  |  Branch (85:20): [True: 2.09M, False: 793k]
  ------------------
   86|  2.09M|      ptr_noise_lvls[band + env * num_noise_bands] = 0;
   87|       |
   88|  10.4M|      for (i = 0; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|  10.4M|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (88:19): [True: 8.39M, False: 2.09M]
  ------------------
   89|  8.39M|        ptr_noise_lvls[band + env * num_noise_bands] +=
   90|  8.39M|            ptr_smooth_filter[i] * prev_noise_lvls[i][band];
   91|  8.39M|      }
   92|  2.09M|    }
   93|   793k|  }
   94|   579k|}
ixheaace_sbr_noise_floor_est.c:ia_enhaacplus_enc_down_sample_lo_res:
  231|  8.64k|                                                         WORD32 num_ref) {
  232|  8.64k|  WORD32 step;
  233|  8.64k|  WORD32 i, j;
  234|  8.64k|  WORD32 org_length, result_length;
  235|  8.64k|  WORD32 v_index[MAXIMUM_FREQ_COEFFS / 2];
  236|       |
  237|  8.64k|  org_length = num_ref;
  238|  8.64k|  result_length = num_result;
  239|       |
  240|  8.64k|  v_index[0] = 0;
  241|       |
  242|  8.64k|  i = 0;
  243|       |
  244|  31.3k|  while (org_length > 0) {
  ------------------
  |  Branch (244:10): [True: 22.6k, False: 8.64k]
  ------------------
  245|  22.6k|    i++;
  246|       |
  247|  22.6k|    step = org_length / result_length;
  248|       |
  249|  22.6k|    org_length = org_length - step;
  250|       |
  251|  22.6k|    result_length--;
  252|       |
  253|  22.6k|    v_index[i] = v_index[i - 1] + step;
  254|  22.6k|  }
  255|       |
  256|  8.64k|  if (i != num_result) {
  ------------------
  |  Branch (256:7): [True: 0, False: 8.64k]
  ------------------
  257|      0|    return IA_EXEHAACE_INIT_FATAL_SBR_NOISE_BAND_NOT_SUPPORTED;
  258|      0|  }
  259|       |
  260|  39.9k|  for (j = 0; j <= i; j++) {
  ------------------
  |  Branch (260:15): [True: 31.3k, False: 8.64k]
  ------------------
  261|  31.3k|    ptr_result[j] = ptr_freq_band_tab_ref[v_index[j]];
  262|  31.3k|  }
  263|       |
  264|  8.64k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  8.64k|#define IA_NO_ERROR 0x00000000
  ------------------
  265|  8.64k|}

ixheaace_sbr_analysis_filtering:
  805|   608k|                                     WORD32 is_ps_960) {
  806|   608k|  WORD32 i, k;
  807|   608k|  const FLOAT32 *ptr_pf_l, *ptr_pf_r;
  808|   608k|  FLOAT32 *ptr_fp1, *ptr_fp2, *ptr_tmp;
  809|   608k|  FLOAT32 syn_buffer[2 * IXHEAACE_QMF_CHANNELS] = {0};
  810|   608k|  const FLOAT32 *ptr_start_coeff_l;
  811|   608k|  const FLOAT32 *ptr_start_coeff_r;
  812|   608k|  FLOAT32 *ptr_qmf_states_curr_pos;
  813|   608k|  WORD32 start_coeff_cnt = 0;
  814|   608k|  WORD16 flag = 0;
  815|   608k|  WORD32 offset;
  816|   608k|  if (is_ld_sbr) {
  ------------------
  |  Branch (816:7): [True: 113k, False: 494k]
  ------------------
  817|   113k|    offset = 576;
  818|   113k|    i = 0;
  819|  1.88M|    while (i < num_qmf_subsamp) {
  ------------------
  |  Branch (819:12): [True: 1.77M, False: 113k]
  ------------------
  820|  1.77M|      ptr_qmf_states_curr_pos = pstr_qmf_bank->ptr_qmf_states_curr_pos;
  821|       |
  822|  1.77M|      if (ptr_time_in) {
  ------------------
  |  Branch (822:11): [True: 1.77M, False: 0]
  ------------------
  823|  1.77M|        FLOAT32 *ptr_qmf_states = pstr_qmf_bank->ptr_qmf_states_curr_pos + offset;
  824|       |
  825|  1.77M|        const FLOAT32 *ptr_inp = &ptr_time_in[(i * 64 * time_sn_stride)];
  826|  1.77M|        FLOAT32 tmp1, tmp2, tmp3, tmp4;
  827|  30.1M|        for (k = 15; k >= 0; k--) {
  ------------------
  |  Branch (827:22): [True: 28.3M, False: 1.77M]
  ------------------
  828|  28.3M|          tmp1 = *ptr_inp;
  829|  28.3M|          ptr_inp += time_sn_stride;
  830|       |
  831|  28.3M|          tmp2 = *ptr_inp;
  832|  28.3M|          ptr_inp += time_sn_stride;
  833|       |
  834|  28.3M|          tmp3 = *ptr_inp;
  835|  28.3M|          ptr_inp += time_sn_stride;
  836|       |
  837|  28.3M|          *ptr_qmf_states++ = tmp1;
  838|  28.3M|          tmp4 = *ptr_inp;
  839|  28.3M|          ptr_inp += time_sn_stride;
  840|       |
  841|  28.3M|          *ptr_qmf_states++ = tmp2;
  842|  28.3M|          *ptr_qmf_states++ = tmp3;
  843|  28.3M|          *ptr_qmf_states++ = tmp4;
  844|  28.3M|        }
  845|  1.77M|      } else {
  846|      0|        memset(&ptr_qmf_states_curr_pos[0], 0,
  847|      0|               sizeof(ptr_qmf_states_curr_pos[0]) * IXHEAACE_QMF_CHANNELS);
  ------------------
  |  |   66|      0|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  848|      0|      }
  849|       |
  850|  1.77M|      ia_enhaacplus_enc_sbr_cld_analysis_win_add(&ptr_qmf_states_curr_pos[0],
  851|  1.77M|                                                 pstr_qmf_bank->ptr_filter, syn_buffer,
  852|  1.77M|                                                 IXHEAACE_QMF_CHANNELS, time_sn_stride);
  ------------------
  |  |   66|  1.77M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  853|       |
  854|  1.77M|      ia_enhaacplus_enc_forward_modulation(syn_buffer, &(ptr_ana_r[i][0]), &(ptr_ana_i[i][0]),
  855|  1.77M|                                           pstr_qmf_tab, is_ld_sbr, ptr_sbr_scratch);
  856|       |
  857|  1.02G|      for (k = 0; k < offset; k++) {
  ------------------
  |  Branch (857:19): [True: 1.02G, False: 1.77M]
  ------------------
  858|  1.02G|        pstr_qmf_bank->ptr_qmf_states_curr_pos[k] =
  859|  1.02G|            pstr_qmf_bank->ptr_qmf_states_curr_pos[64 + k];
  860|  1.02G|      }
  861|       |
  862|  1.77M|      i++;
  863|  1.77M|    }
  864|   494k|  } else {
  865|   494k|    flag = pstr_qmf_bank->flag;
  866|   494k|    ptr_fp1 = pstr_qmf_bank->ptr_qmf_states_buf;
  867|   494k|    ptr_fp2 = pstr_qmf_bank->ptr_qmf_states_buf + 64;
  868|   494k|    pstr_qmf_bank->ptr_qmf_states_curr_pos =
  869|   494k|        ((FLOAT32 *)(pstr_qmf_bank->ptr_qmf_states_buf) + (pstr_qmf_bank->offset * 64));
  870|       |
  871|   494k|    if (pstr_qmf_bank->offset == 8) {
  ------------------
  |  Branch (871:9): [True: 96.7k, False: 398k]
  ------------------
  872|  96.7k|      pstr_qmf_bank->offset = 0;
  873|   398k|    } else {
  874|   398k|      pstr_qmf_bank->offset += 2;
  875|   398k|    }
  876|       |
  877|   494k|    ptr_start_coeff_l = pstr_qmf_bank->ptr_ref_coeff_l + pstr_qmf_bank->offset_l;
  878|   494k|    ptr_start_coeff_r = pstr_qmf_bank->ptr_ref_coeff_r - pstr_qmf_bank->offset_r;
  879|       |
  880|  18.3M|    for (i = 0; i < num_qmf_subsamp; i++) {
  ------------------
  |  Branch (880:17): [True: 17.8M, False: 494k]
  ------------------
  881|  17.8M|      ptr_qmf_states_curr_pos = pstr_qmf_bank->ptr_qmf_states_curr_pos;
  882|  17.8M|      ptr_tmp = ptr_fp1;
  883|  17.8M|      ptr_fp1 = ptr_fp2;
  884|  17.8M|      ptr_fp2 = ptr_tmp;
  885|  17.8M|      if (((1 == is_ld_sbr) && start_coeff_cnt) || ((0 == is_ld_sbr) && (i % 2))) {
  ------------------
  |  Branch (885:12): [True: 0, False: 17.8M]
  |  Branch (885:32): [True: 0, False: 0]
  |  Branch (885:53): [True: 17.8M, False: 0]
  |  Branch (885:73): [True: 8.93M, False: 8.93M]
  ------------------
  886|  8.93M|        ptr_start_coeff_l--;
  887|  8.93M|        if (ptr_start_coeff_l == pstr_qmf_bank->ptr_ref_coeff_l) {
  ------------------
  |  Branch (887:13): [True: 1.78M, False: 7.15M]
  ------------------
  888|  1.78M|          ptr_start_coeff_l += 5;
  889|  1.78M|        }
  890|  8.93M|      } else {
  891|  8.93M|        ptr_start_coeff_r++;
  892|  8.93M|        if (ptr_start_coeff_r == pstr_qmf_bank->ptr_ref_coeff_r) {
  ------------------
  |  Branch (892:13): [True: 1.78M, False: 7.15M]
  ------------------
  893|  1.78M|          ptr_start_coeff_r -= 5;
  894|  1.78M|        }
  895|  8.93M|      }
  896|       |
  897|  17.8M|      if (ptr_time_in) {
  ------------------
  |  Branch (897:11): [True: 17.8M, False: 0]
  ------------------
  898|  17.8M|        FLOAT32 *ptr_qmf_states = &ptr_qmf_states_curr_pos[0];
  899|  17.8M|        const FLOAT32 *ptr_inp = &ptr_time_in[(i * 64 * time_sn_stride)];
  900|  17.8M|        FLOAT32 tmp1, tmp2, tmp3, tmp4;
  901|   303M|        for (k = 15; k >= 0; k--) {
  ------------------
  |  Branch (901:22): [True: 286M, False: 17.8M]
  ------------------
  902|   286M|          tmp1 = *ptr_inp;
  903|   286M|          ptr_inp += time_sn_stride;
  904|       |
  905|   286M|          tmp2 = *ptr_inp;
  906|   286M|          ptr_inp += time_sn_stride;
  907|       |
  908|   286M|          tmp3 = *ptr_inp;
  909|   286M|          ptr_inp += time_sn_stride;
  910|       |
  911|   286M|          *ptr_qmf_states++ = tmp1;
  912|   286M|          tmp4 = *ptr_inp;
  913|   286M|          ptr_inp += time_sn_stride;
  914|       |
  915|   286M|          *ptr_qmf_states++ = tmp2;
  916|   286M|          *ptr_qmf_states++ = tmp3;
  917|   286M|          *ptr_qmf_states++ = tmp4;
  918|   286M|        }
  919|  17.8M|      } else {
  920|      0|        memset(&ptr_qmf_states_curr_pos[0], 0,
  921|      0|               sizeof(ptr_qmf_states_curr_pos[0]) * IXHEAACE_QMF_CHANNELS);
  ------------------
  |  |   66|      0|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  922|      0|      }
  923|       |
  924|  17.8M|      ptr_pf_l = ptr_start_coeff_l;
  925|  17.8M|      ptr_pf_r = ptr_start_coeff_r;
  926|       |
  927|  17.8M|      ia_enhaacplus_enc_sbr_qmf_analysis_win_add(ptr_pf_l, ptr_pf_r, ptr_fp1, ptr_fp2,
  928|  17.8M|                                                 syn_buffer);
  929|       |
  930|  17.8M|      ia_enhaacplus_enc_forward_modulation(syn_buffer, &(ptr_ana_r[i][0]), &(ptr_ana_i[i][0]),
  931|  17.8M|                                           pstr_qmf_tab, is_ld_sbr, ptr_sbr_scratch);
  932|       |
  933|  17.8M|      pstr_qmf_bank->ptr_qmf_states_curr_pos = pstr_qmf_bank->ptr_qmf_states_curr_pos + 64;
  934|  17.8M|      if (pstr_qmf_bank->ptr_qmf_states_curr_pos == pstr_qmf_bank->ptr_qmf_states_buf + 640) {
  ------------------
  |  Branch (934:11): [True: 1.78M, False: 16.0M]
  ------------------
  935|  1.78M|        pstr_qmf_bank->ptr_qmf_states_curr_pos = pstr_qmf_bank->ptr_qmf_states_buf;
  936|  1.78M|      }
  937|  17.8M|    }
  938|       |
  939|   494k|    pstr_qmf_bank->offset_l = ptr_start_coeff_l - pstr_qmf_bank->ptr_ref_coeff_l;
  940|   494k|    pstr_qmf_bank->offset_r = pstr_qmf_bank->ptr_ref_coeff_r - ptr_start_coeff_r;
  941|   494k|    pstr_qmf_bank->flag = flag;
  942|   494k|  }
  943|   608k|  if (is_ps_960 == 1) {
  ------------------
  |  Branch (943:7): [True: 17.9k, False: 590k]
  ------------------
  944|  17.9k|    memset(&ptr_ana_r[num_qmf_subsamp][0], 0, sizeof(ptr_ana_r[num_qmf_subsamp][0]) *
  945|  17.9k|           IXHEAACE_QMF_CHANNELS * (IXHEAACE_QMF_TIME_SLOTS - num_qmf_subsamp));
  ------------------
  |  |   66|  17.9k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                         IXHEAACE_QMF_CHANNELS * (IXHEAACE_QMF_TIME_SLOTS - num_qmf_subsamp));
  ------------------
  |  |   69|  17.9k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  946|  17.9k|    memset(&ptr_ana_i[num_qmf_subsamp][0], 0, sizeof(ptr_ana_i[num_qmf_subsamp][0]) *
  947|  17.9k|           IXHEAACE_QMF_CHANNELS * (IXHEAACE_QMF_TIME_SLOTS - num_qmf_subsamp));
  ------------------
  |  |   66|  17.9k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                         IXHEAACE_QMF_CHANNELS * (IXHEAACE_QMF_TIME_SLOTS - num_qmf_subsamp));
  ------------------
  |  |   69|  17.9k|#define IXHEAACE_QMF_TIME_SLOTS (32)
  ------------------
  948|  17.9k|  }
  949|   608k|}
ixheaace_get_energy_from_cplx_qmf:
  956|   579k|{
  957|   579k|  WORD32 j, k;
  958|   579k|  FLOAT32 avg_fac = 0.5f;
  959|   579k|  if (samp_ratio_fac == 4) {
  ------------------
  |  Branch (959:7): [True: 64.9k, False: 514k]
  ------------------
  960|  64.9k|    avg_fac = 0.25f;
  961|  64.9k|  }
  962|   579k|  if (0 == is_ld_sbr) {
  ------------------
  |  Branch (962:7): [True: 466k, False: 113k]
  ------------------
  963|   466k|    FLOAT32 *ptr_energy_val = &ptr_energy_vals[0][0];
  964|   466k|    FLOAT32 *ptr_hbe_real = NULL;
  965|   466k|    FLOAT32 *ptr_hbe_imag = NULL;
  966|   466k|    if (harmonic_sbr == 1) {
  ------------------
  |  Branch (966:9): [True: 145k, False: 320k]
  ------------------
  967|   145k|      ptr_hbe_real = &pstr_hbe_enc->qmf_buf_real[op_delay][0];
  968|   145k|      ptr_hbe_imag = &pstr_hbe_enc->qmf_buf_imag[op_delay][0];
  969|   145k|    }
  970|  7.85M|    for (k = 0; k < num_time_slots; k++) {
  ------------------
  |  Branch (970:17): [True: 7.38M, False: 466k]
  ------------------
  971|   480M|      for (j = 0; j < IXHEAACE_QMF_CHANNELS; j++) {
  ------------------
  |  |   66|   480M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  |  Branch (971:19): [True: 472M, False: 7.38M]
  ------------------
  972|   472M|        FLOAT32 tmp = 0.0f;
  973|   472M|        if (harmonic_sbr == 1) {
  ------------------
  |  Branch (973:13): [True: 149M, False: 323M]
  ------------------
  974|   149M|          FLOAT32 real_hbe, imag_hbe;
  975|   149M|          real_hbe = *(ptr_hbe_real);
  976|   149M|          imag_hbe = *(ptr_hbe_imag);
  977|   149M|          tmp += (real_hbe * real_hbe) + (imag_hbe * imag_hbe);
  978|   149M|          *ptr_energy_val = tmp;
  979|   149M|          ptr_hbe_real++;
  980|   149M|          ptr_hbe_imag++;
  981|   149M|          ptr_energy_val++;
  982|   323M|        } else {
  983|   323M|          FLOAT32 real, imag;
  984|   323M|          WORD32 i, subband;
  985|   323M|          subband = samp_ratio_fac * k;
  986|  1.01G|          for (i = 0; i < samp_ratio_fac; i++) {
  ------------------
  |  Branch (986:23): [True: 686M, False: 323M]
  ------------------
  987|   686M|            real = ptr_real_values[subband + i][j];
  988|   686M|            imag = ptr_imag_values[subband + i][j];
  989|   686M|            tmp += (real * real) + (imag * imag);
  990|   686M|          }
  991|   323M|          ptr_energy_vals[k][j] = tmp * avg_fac;
  992|   323M|        }
  993|   472M|      }
  994|  7.38M|      if (harmonic_sbr == 1) {
  ------------------
  |  Branch (994:11): [True: 2.33M, False: 5.05M]
  ------------------
  995|  2.33M|        ptr_hbe_real += 64;
  996|  2.33M|        ptr_hbe_imag += 64;
  997|  2.33M|      }
  998|  7.38M|    }
  999|   466k|  } else {
 1000|   113k|    FLOAT32 *ptr_real = &ptr_real_values[0][0];
 1001|   113k|    FLOAT32 *ptr_imag = &ptr_imag_values[0][0];
 1002|  1.88M|    for (k = 0; k < num_time_slots; k++) {
  ------------------
  |  Branch (1002:17): [True: 1.77M, False: 113k]
  ------------------
 1003|  1.77M|      FLOAT32 *ptr_energy_val = &ptr_energy_vals[k][0];
 1004|   115M|      for (j = 0; j < 64; j++) {
  ------------------
  |  Branch (1004:19): [True: 113M, False: 1.77M]
  ------------------
 1005|   113M|        FLOAT32 real, imag, tmp;
 1006|   113M|        real = *ptr_real;
 1007|   113M|        ptr_real++;
 1008|   113M|        imag = *ptr_imag;
 1009|   113M|        ptr_imag++;
 1010|       |
 1011|   113M|        tmp = (real * real) + (imag * imag);
 1012|   113M|        *ptr_energy_val = tmp;
 1013|   113M|        ptr_energy_val++;
 1014|   113M|      }
 1015|  1.77M|    }
 1016|   113k|  }
 1017|   579k|}
ixheaace_fft16:
 1019|  1.26M|VOID ixheaace_fft16(FLOAT32 *vector) {
 1020|  1.26M|  FLOAT32 var10, var11, var12, var13, var14, var15, var16, var17, var18, var19, var110, var111,
 1021|  1.26M|      var112, var113, var114, var115;
 1022|  1.26M|  FLOAT32 var20, var21, var22, var23, var24, var25, var26, var27, var28, var29, var210, var211,
 1023|  1.26M|      var212, var213, var214, var215;
 1024|  1.26M|  FLOAT32 arr0, arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8, arr9, arr10, arr11, arr12, arr13,
 1025|  1.26M|      arr14, arr15;
 1026|       |
 1027|  1.26M|  arr0 = vector[0] + vector[16];
 1028|  1.26M|  arr8 = vector[8] + vector[24];
 1029|  1.26M|  var10 = arr0 + arr8;
 1030|  1.26M|  var12 = arr0 - arr8;
 1031|  1.26M|  arr1 = vector[1] + vector[17];
 1032|  1.26M|  arr9 = vector[9] + vector[25];
 1033|  1.26M|  var11 = arr1 + arr9;
 1034|  1.26M|  var13 = arr1 - arr9;
 1035|  1.26M|  arr2 = vector[2] + vector[18];
 1036|  1.26M|  arr10 = vector[10] + vector[26];
 1037|  1.26M|  var14 = arr2 + arr10;
 1038|  1.26M|  var16 = arr2 - arr10;
 1039|  1.26M|  arr3 = vector[3] + vector[19];
 1040|  1.26M|  arr11 = vector[11] + vector[27];
 1041|  1.26M|  var15 = arr3 + arr11;
 1042|  1.26M|  var17 = arr3 - arr11;
 1043|  1.26M|  arr4 = vector[4] + vector[20];
 1044|  1.26M|  arr12 = vector[12] + vector[28];
 1045|  1.26M|  var18 = arr4 + arr12;
 1046|  1.26M|  var110 = arr4 - arr12;
 1047|  1.26M|  arr5 = vector[5] + vector[21];
 1048|  1.26M|  arr13 = vector[13] + vector[29];
 1049|  1.26M|  var19 = arr5 + arr13;
 1050|  1.26M|  var111 = arr5 - arr13;
 1051|  1.26M|  arr6 = vector[6] + vector[22];
 1052|  1.26M|  arr14 = vector[14] + vector[30];
 1053|  1.26M|  var112 = arr6 + arr14;
 1054|  1.26M|  var114 = arr6 - arr14;
 1055|  1.26M|  arr7 = vector[7] + vector[23];
 1056|  1.26M|  arr15 = vector[15] + vector[31];
 1057|  1.26M|  var113 = arr7 + arr15;
 1058|  1.26M|  var115 = arr7 - arr15;
 1059|       |
 1060|  1.26M|  var20 = var10 + var18;
 1061|  1.26M|  var24 = var10 - var18;
 1062|  1.26M|  var21 = var11 + var19;
 1063|  1.26M|  var25 = var11 - var19;
 1064|  1.26M|  var28 = var12 - var111;
 1065|  1.26M|  var210 = var12 + var111;
 1066|  1.26M|  var29 = var13 + var110;
 1067|  1.26M|  var211 = var13 - var110;
 1068|  1.26M|  var22 = var14 + var112;
 1069|  1.26M|  var27 = var14 - var112;
 1070|  1.26M|  var23 = var15 + var113;
 1071|  1.26M|  var26 = var113 - var15;
 1072|       |
 1073|  1.26M|  var11 = var16 + var114;
 1074|  1.26M|  var12 = var16 - var114;
 1075|  1.26M|  var10 = var17 + var115;
 1076|  1.26M|  var13 = var17 - var115;
 1077|       |
 1078|  1.26M|  var212 = (var10 + var12) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1079|  1.26M|  var214 = (var10 - var12) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1080|  1.26M|  var213 = (var13 - var11) * IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1081|  1.26M|  var215 = (var11 + var13) * -IXHEAACE_INV_SQRT2;
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1082|       |
 1083|  1.26M|  arr0 = vector[0] - vector[16];
 1084|  1.26M|  arr1 = vector[1] - vector[17];
 1085|  1.26M|  arr2 = vector[2] - vector[18];
 1086|  1.26M|  arr3 = vector[3] - vector[19];
 1087|  1.26M|  arr4 = vector[4] - vector[20];
 1088|  1.26M|  arr5 = vector[5] - vector[21];
 1089|  1.26M|  arr6 = vector[6] - vector[22];
 1090|  1.26M|  arr7 = vector[7] - vector[23];
 1091|  1.26M|  arr8 = vector[8] - vector[24];
 1092|  1.26M|  arr9 = vector[9] - vector[25];
 1093|  1.26M|  arr10 = vector[10] - vector[26];
 1094|  1.26M|  arr11 = vector[11] - vector[27];
 1095|  1.26M|  arr12 = vector[12] - vector[28];
 1096|  1.26M|  arr13 = vector[13] - vector[29];
 1097|  1.26M|  arr14 = vector[14] - vector[30];
 1098|  1.26M|  arr15 = vector[15] - vector[31];
 1099|       |
 1100|  1.26M|  var19 = ((arr2 + arr14) * -IXHEAACE_COS_3PI_DIV8);
  ------------------
  |  |   32|  1.26M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
 1101|  1.26M|  var110 = ((arr2 - arr14) * IXHEAACE_COS_PI_DIV8);
  ------------------
  |  |   31|  1.26M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
 1102|  1.26M|  var18 = ((arr3 + arr15) * IXHEAACE_COS_3PI_DIV8);
  ------------------
  |  |   32|  1.26M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
 1103|  1.26M|  var111 = ((arr3 - arr15) * IXHEAACE_COS_PI_DIV8);
  ------------------
  |  |   31|  1.26M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
 1104|  1.26M|  var15 = ((arr4 + arr12) * -IXHEAACE_INV_SQRT2);
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1105|  1.26M|  var16 = ((arr4 - arr12) * IXHEAACE_INV_SQRT2);
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1106|  1.26M|  var14 = ((arr5 + arr13) * IXHEAACE_INV_SQRT2);
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1107|  1.26M|  var17 = ((arr5 - arr13) * IXHEAACE_INV_SQRT2);
  ------------------
  |  |   30|  1.26M|#define IXHEAACE_INV_SQRT2 (7.071067811865475e-1f)
  ------------------
 1108|  1.26M|  var113 = ((arr6 + arr10) * -IXHEAACE_COS_PI_DIV8);
  ------------------
  |  |   31|  1.26M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
 1109|  1.26M|  var114 = ((arr6 - arr10) * IXHEAACE_COS_3PI_DIV8);
  ------------------
  |  |   32|  1.26M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
 1110|  1.26M|  var112 = ((arr7 + arr11) * IXHEAACE_COS_PI_DIV8);
  ------------------
  |  |   31|  1.26M|#define IXHEAACE_COS_PI_DIV8 (0.923879532511287f)
  ------------------
 1111|  1.26M|  var115 = ((arr7 - arr11) * IXHEAACE_COS_3PI_DIV8);
  ------------------
  |  |   32|  1.26M|#define IXHEAACE_COS_3PI_DIV8 (3.826834323650898e-1f)
  ------------------
 1112|       |
 1113|  1.26M|  arr2 = (var18 * IXHEAACE_SQRT2PLUS1) - (var112 * IXHEAACE_SQRT2MINUS1);
  ------------------
  |  |   33|  1.26M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                arr2 = (var18 * IXHEAACE_SQRT2PLUS1) - (var112 * IXHEAACE_SQRT2MINUS1);
  ------------------
  |  |   34|  1.26M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
 1114|  1.26M|  arr3 = (var19 * IXHEAACE_SQRT2PLUS1) - (var113 * IXHEAACE_SQRT2MINUS1);
  ------------------
  |  |   33|  1.26M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
                arr3 = (var19 * IXHEAACE_SQRT2PLUS1) - (var113 * IXHEAACE_SQRT2MINUS1);
  ------------------
  |  |   34|  1.26M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
 1115|  1.26M|  arr4 = (var110 * IXHEAACE_SQRT2MINUS1) - (var114 * IXHEAACE_SQRT2PLUS1);
  ------------------
  |  |   34|  1.26M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                arr4 = (var110 * IXHEAACE_SQRT2MINUS1) - (var114 * IXHEAACE_SQRT2PLUS1);
  ------------------
  |  |   33|  1.26M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
 1116|  1.26M|  arr5 = (var111 * IXHEAACE_SQRT2MINUS1) - (var115 * IXHEAACE_SQRT2PLUS1);
  ------------------
  |  |   34|  1.26M|#define IXHEAACE_SQRT2MINUS1 (4.142135623730952e-1f)
  ------------------
                arr5 = (var111 * IXHEAACE_SQRT2MINUS1) - (var115 * IXHEAACE_SQRT2PLUS1);
  ------------------
  |  |   33|  1.26M|#define IXHEAACE_SQRT2PLUS1 (2.414213562373095f)
  ------------------
 1117|       |
 1118|  1.26M|  var18 = var18 + var112;
 1119|  1.26M|  var19 = var19 + var113;
 1120|  1.26M|  var110 = var110 + var114;
 1121|  1.26M|  var111 = var111 + var115;
 1122|       |
 1123|  1.26M|  arr6 = arr0 + var14;
 1124|  1.26M|  arr10 = arr0 - var14;
 1125|  1.26M|  arr7 = arr1 + var15;
 1126|  1.26M|  arr11 = arr1 - var15;
 1127|       |
 1128|  1.26M|  arr12 = var16 - arr9;
 1129|  1.26M|  arr14 = var16 + arr9;
 1130|  1.26M|  arr13 = arr8 + var17;
 1131|  1.26M|  arr15 = arr8 - var17;
 1132|       |
 1133|  1.26M|  var10 = arr6 - arr14;
 1134|  1.26M|  var12 = arr6 + arr14;
 1135|  1.26M|  var11 = arr7 + arr15;
 1136|  1.26M|  var13 = arr7 - arr15;
 1137|  1.26M|  var14 = arr10 + arr12;
 1138|  1.26M|  var16 = arr10 - arr12;
 1139|  1.26M|  var15 = arr11 + arr13;
 1140|  1.26M|  var17 = arr11 - arr13;
 1141|       |
 1142|  1.26M|  arr10 = var18 + var110;
 1143|  1.26M|  var110 = var18 - var110;
 1144|  1.26M|  arr11 = var19 + var111;
 1145|  1.26M|  var111 = var19 - var111;
 1146|       |
 1147|  1.26M|  var112 = (arr2 + arr4);
 1148|  1.26M|  var114 = (arr2 - arr4);
 1149|  1.26M|  var113 = (arr3 + arr5);
 1150|  1.26M|  var115 = (arr3 - arr5);
 1151|       |
 1152|  1.26M|  vector[0] = var20 + var22;
 1153|  1.26M|  vector[1] = var21 + var23;
 1154|  1.26M|  vector[2] = var12 + arr10;
 1155|  1.26M|  vector[3] = var13 + arr11;
 1156|  1.26M|  vector[4] = var210 + var212;
 1157|  1.26M|  vector[5] = var211 + var213;
 1158|  1.26M|  vector[6] = var10 + var112;
 1159|  1.26M|  vector[7] = var11 + var113;
 1160|  1.26M|  vector[8] = var24 - var26;
 1161|  1.26M|  vector[9] = var25 - var27;
 1162|  1.26M|  vector[10] = var16 + var114;
 1163|  1.26M|  vector[11] = var17 + var115;
 1164|  1.26M|  vector[12] = var28 + var214;
 1165|  1.26M|  vector[13] = var29 + var215;
 1166|  1.26M|  vector[14] = var14 + var110;
 1167|  1.26M|  vector[15] = var15 + var111;
 1168|  1.26M|  vector[16] = var20 - var22;
 1169|  1.26M|  vector[17] = var21 - var23;
 1170|  1.26M|  vector[18] = var12 - arr10;
 1171|  1.26M|  vector[19] = var13 - arr11;
 1172|  1.26M|  vector[20] = var210 - var212;
 1173|  1.26M|  vector[21] = var211 - var213;
 1174|  1.26M|  vector[22] = var10 - var112;
 1175|  1.26M|  vector[23] = var11 - var113;
 1176|  1.26M|  vector[24] = var24 + var26;
 1177|  1.26M|  vector[25] = var25 + var27;
 1178|  1.26M|  vector[26] = var16 - var114;
 1179|  1.26M|  vector[27] = var17 - var115;
 1180|  1.26M|  vector[28] = var28 - var214;
 1181|  1.26M|  vector[29] = var29 - var215;
 1182|  1.26M|  vector[30] = var14 - var110;
 1183|  1.26M|  vector[31] = var15 - var111;
 1184|  1.26M|}
ixheaace_enc_synthesis_qmf_filtering:
 1329|  19.7k|                                          ixheaace_pstr_sbr_qmf_filter_bank pstr_qmf_bank) {
 1330|  19.7k|  WORD32 k, j;
 1331|  19.7k|  FLOAT32 *timeBuf_flt;
 1332|  19.7k|  const FLOAT32 *ptr_filter = pstr_qmf_bank->ptr_flt_filter;
 1333|   650k|  for (k = 0; k < 32; k++) {
  ------------------
  |  Branch (1333:15): [True: 630k, False: 19.7k]
  ------------------
 1334|   630k|    ixheaace_inverse_modulation(*(ptr_sbr_re + k), *(ptr_sbr_im + k),
 1335|   630k|                                pstr_qmf_bank->ptr_flt_work_buf, pstr_qmf_bank);
 1336|   630k|    ixheaace_win_add(pstr_qmf_bank->ptr_flt_time_buf, pstr_qmf_bank->ptr_flt_work_buf,
 1337|   630k|                     ptr_filter);
 1338|   630k|    timeBuf_flt = &pstr_qmf_bank->ptr_flt_time_buf[288];
 1339|   630k|    {
 1340|   630k|      FLOAT32 temp1_flt, temp2_flt;
 1341|   630k|      FLOAT32 *ptr_time_out_flt = &time_float[31], temp_out_flt;
 1342|  10.7M|      for (j = 15; j >= 0; j--) {
  ------------------
  |  Branch (1342:20): [True: 10.0M, False: 630k]
  ------------------
 1343|  10.0M|        temp1_flt = *timeBuf_flt++;
 1344|  10.0M|        temp2_flt = *timeBuf_flt++;
 1345|  10.0M|        temp_out_flt = temp1_flt;
 1346|  10.0M|        *ptr_time_out_flt-- = temp_out_flt * -1;
 1347|  10.0M|        temp_out_flt = temp2_flt;
 1348|  10.0M|        *ptr_time_out_flt-- = temp_out_flt * -1;
 1349|  10.0M|      }
 1350|   630k|    }
 1351|   630k|    time_float += 32;
 1352|   630k|    memmove(pstr_qmf_bank->ptr_flt_time_buf + 32, pstr_qmf_bank->ptr_flt_time_buf,
 1353|   630k|            288 * sizeof(pstr_qmf_bank->ptr_flt_time_buf[0]));
 1354|   630k|    memset(pstr_qmf_bank->ptr_flt_time_buf, 0, 32 * sizeof(pstr_qmf_bank->ptr_flt_time_buf[0]));
 1355|   630k|  }
 1356|  19.7k|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_sbr_cld_analysis_win_add:
  789|  1.77M|                                                       WORD32 num_qmf_ch, WORD32 time_sn_stride) {
  790|  1.77M|  WORD32 i;
  791|  1.77M|  WORD32 len = num_qmf_ch * time_sn_stride;
  792|  1.77M|  FLOAT32 *ptr_fil_states = &ptr_filter_states[CLD_FILTER_LENGTH - 1];
  ------------------
  |  |   68|  1.77M|#define CLD_FILTER_LENGTH (640)
  ------------------
  793|       |
  794|  1.77M|  memset(ptr_sync_buffer, 0, len * sizeof(*ptr_sync_buffer));
  795|       |
  796|  1.13G|  for (i = 0; i < CLD_FILTER_LENGTH; i++) {
  ------------------
  |  |   68|  1.13G|#define CLD_FILTER_LENGTH (640)
  ------------------
  |  Branch (796:15): [True: 1.13G, False: 1.77M]
  ------------------
  797|  1.13G|    ptr_sync_buffer[i % len] += (*ptr_fil_states-- * ptr_coeffs[i]);
  798|  1.13G|  }
  799|  1.77M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_forward_modulation:
  686|  19.6M|                                                 WORD32 is_ld_sbr, FLOAT32 *ptr_sbr_scratch) {
  687|  19.6M|  WORD32 i;
  688|  19.6M|  FLOAT32 tmp1, tmp2, tmp3, tmp4;
  689|  19.6M|  const FLOAT32 *ptr_inp1, *ptr_inp2;
  690|  19.6M|  FLOAT32 *ptr_re, *ptr_im;
  691|  19.6M|  FLOAT32 real, imag;
  692|  19.6M|  const FLOAT32 *ptr_window = &sbr_sin_cos_window[0];
  693|  19.6M|  if (is_ld_sbr) {
  ------------------
  |  Branch (693:7): [True: 1.77M, False: 17.8M]
  ------------------
  694|  1.77M|    ptr_re = &ptr_r_subband[0];
  695|  1.77M|    ptr_im = &ptr_i_subband[0];
  696|  1.77M|    ptr_inp1 = &ptr_time_in[0];
  697|  17.8M|  } else {
  698|  17.8M|    ptr_r_subband[0] = ptr_time_in[0];
  699|  17.8M|    ptr_re = &ptr_r_subband[1];
  700|  17.8M|    ptr_im = &ptr_i_subband[0];
  701|  17.8M|    ptr_inp1 = &ptr_time_in[1];
  702|  17.8M|  }
  703|  19.6M|  ptr_inp2 = &ptr_time_in[127];
  704|  19.6M|  if (is_ld_sbr) {
  ------------------
  |  Branch (704:7): [True: 1.77M, False: 17.8M]
  ------------------
  705|  1.77M|    i = IXHEAACE_QMF_CHANNELS / 2 - 1;
  ------------------
  |  |   66|  1.77M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  706|  58.5M|    while (i >= 0) {
  ------------------
  |  Branch (706:12): [True: 56.7M, False: 1.77M]
  ------------------
  707|  56.7M|      tmp1 = *ptr_inp1++;
  708|  56.7M|      tmp2 = *ptr_inp2--;
  709|  56.7M|      tmp3 = *ptr_inp1++;
  710|  56.7M|      tmp4 = *ptr_inp2--;
  711|  56.7M|      *ptr_re++ = (tmp1 - tmp2);
  712|  56.7M|      *ptr_im++ = (tmp1 + tmp2);
  713|  56.7M|      *ptr_re++ = (tmp3 - tmp4);
  714|  56.7M|      *ptr_im++ = (tmp3 + tmp4);
  715|  56.7M|      i--;
  716|  56.7M|    }
  717|       |
  718|  1.77M|    ixheaace_sbr_mdct(ptr_r_subband, 64, ptr_sbr_scratch);
  719|  1.77M|    ixheaace_sbr_mdst(ptr_i_subband, 64, ptr_sbr_scratch);
  720|       |
  721|  1.77M|    i = 0;
  722|   115M|    while (i < IXHEAACE_QMF_CHANNELS) {
  ------------------
  |  |   66|   115M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  |  Branch (722:12): [True: 113M, False: 1.77M]
  ------------------
  723|   113M|      real = ptr_r_subband[i];
  724|   113M|      imag = ptr_i_subband[i];
  725|   113M|      ptr_r_subband[i] =
  726|   113M|          imag * ptr_window[i] + real * ptr_window[2 * IXHEAACE_QMF_CHANNELS - 1 - i];
  ------------------
  |  |   66|   113M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  727|   113M|      ptr_i_subband[i] =
  728|   113M|          imag * ptr_window[2 * IXHEAACE_QMF_CHANNELS - 1 - i] - real * ptr_window[i];
  ------------------
  |  |   66|   113M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  729|   113M|      i++;
  730|   113M|    }
  731|  17.8M|  } else {
  732|   572M|    for (i = 30; i >= 0; i--) {
  ------------------
  |  Branch (732:18): [True: 554M, False: 17.8M]
  ------------------
  733|   554M|      tmp1 = *ptr_inp1++;
  734|   554M|      tmp2 = *ptr_inp2--;
  735|   554M|      tmp3 = *ptr_inp1++;
  736|       |
  737|   554M|      *ptr_re++ = tmp1 - tmp2;
  738|   554M|      tmp4 = *ptr_inp2--;
  739|   554M|      *ptr_im++ = tmp1 + tmp2;
  740|   554M|      *ptr_re++ = tmp3 - tmp4;
  741|   554M|      *ptr_im++ = tmp3 + tmp4;
  742|   554M|    }
  743|  17.8M|    tmp1 = *ptr_inp1;
  744|  17.8M|    tmp2 = *ptr_inp2;
  745|  17.8M|    *ptr_re = tmp1 - tmp2;
  746|  17.8M|    *ptr_im = tmp1 + tmp2;
  747|       |
  748|  17.8M|    ptr_i_subband[63] = ptr_time_in[64];
  749|       |
  750|  17.8M|    ia_enhaacplus_enc_fct3_64(ptr_r_subband, pstr_qmf_tab);
  751|       |
  752|  17.8M|    ia_enhaacplus_enc_fst3_64(ptr_i_subband, pstr_qmf_tab);
  753|  17.8M|  }
  754|  19.6M|}
ixheaace_sbr_qmf_enc.c:ixheaace_sbr_mdct:
  668|  1.77M|static VOID ixheaace_sbr_mdct(FLOAT32 *ptr_dct_data, WORD32 n, FLOAT32 *ptr_sbr_scratch) {
  669|  1.77M|  ixheaace_sbr_pre_mdct(ptr_dct_data, n, &long_window_sine_ld_64[0]);
  670|       |
  671|  1.77M|  ia_enhaacplus_enc_complex_fft_p2(ptr_dct_data, n / 2, ptr_sbr_scratch);
  672|       |
  673|  1.77M|  ixheaace_sbr_post_mdct(ptr_dct_data, n, &fft_twiddle_tab_32[0]);
  674|  1.77M|}
ixheaace_sbr_qmf_enc.c:ixheaace_sbr_pre_mdct:
  553|  1.77M|static VOID ixheaace_sbr_pre_mdct(FLOAT32 *ptr_x, WORD32 len, const FLOAT32 *ptr_sine_window) {
  554|  1.77M|  WORD32 i;
  555|  1.77M|  FLOAT32 wre, wim, re1, re2, im1, im2;
  556|       |
  557|  30.1M|  for (i = 0; i < len / 4; i++) {
  ------------------
  |  Branch (557:15): [True: 28.3M, False: 1.77M]
  ------------------
  558|  28.3M|    re1 = ptr_x[2 * i];
  559|  28.3M|    re2 = ptr_x[2 * i + 1];
  560|  28.3M|    im2 = ptr_x[len - 2 - 2 * i];
  561|  28.3M|    im1 = ptr_x[len - 1 - 2 * i];
  562|       |
  563|  28.3M|    wim = ptr_sine_window[2 * i];
  564|  28.3M|    wre = ptr_sine_window[len - 1 - 2 * i];
  565|       |
  566|  28.3M|    ptr_x[2 * i] = im1 * wim + re1 * wre;
  567|       |
  568|  28.3M|    ptr_x[2 * i + 1] = im1 * wre - re1 * wim;
  569|       |
  570|  28.3M|    wre = ptr_sine_window[len - 2 - 2 * i];
  571|  28.3M|    wim = ptr_sine_window[2 * i + 1];
  572|       |
  573|  28.3M|    ptr_x[len - 2 - 2 * i] = im2 * wim + re2 * wre;
  574|       |
  575|  28.3M|    ptr_x[len - 1 - 2 * i] = -(im2 * wre - re2 * wim);
  576|  28.3M|  }
  577|  1.77M|}
ixheaace_sbr_qmf_enc.c:ixheaace_sbr_post_mdct:
  603|  1.77M|static VOID ixheaace_sbr_post_mdct(FLOAT32 *ptr_x, WORD32 len, const FLOAT32 *ptr_trig_data) {
  604|  1.77M|  WORD32 i;
  605|  1.77M|  FLOAT32 wre, wim, re1, re2, im1, im2;
  606|       |
  607|  1.77M|  FLOAT32 temp1 = -ptr_x[1];
  608|  1.77M|  FLOAT32 temp2 = ptr_x[len / 2];
  609|  1.77M|  FLOAT32 temp3 = ptr_x[len / 2 + 1];
  610|  1.77M|  FLOAT32 val = 0.70709228515625f;
  611|       |
  612|  1.77M|  re2 = ptr_x[len - 2];
  613|  1.77M|  im2 = ptr_x[len - 1];
  614|  28.3M|  for (i = 1; i < len / 4; i++) {
  ------------------
  |  Branch (614:15): [True: 26.6M, False: 1.77M]
  ------------------
  615|  26.6M|    wim = ptr_trig_data[i];
  616|  26.6M|    wre = ptr_trig_data[len / 2 - 1 - i];
  617|       |
  618|  26.6M|    ptr_x[2 * i - 1] = (re2 * wre - im2 * wim);
  619|  26.6M|    ptr_x[len - 2 * i] = (re2 * wim + im2 * wre);
  620|       |
  621|  26.6M|    re1 = ptr_x[2 * i];
  622|  26.6M|    im1 = ptr_x[2 * i + 1];
  623|  26.6M|    re2 = ptr_x[len - 2 - 2 * i];
  624|  26.6M|    im2 = ptr_x[len - 1 - 2 * i];
  625|       |
  626|  26.6M|    ptr_x[2 * i] = (re1 * wre + im1 * wim);
  627|  26.6M|    ptr_x[len - 1 - 2 * i] = (re1 * wim - im1 * wre);
  628|  26.6M|  }
  629|       |
  630|  1.77M|  ptr_x[len / 2 - 1] = (temp2 - temp3) * val;
  631|  1.77M|  ptr_x[len / 2] = (temp2 + temp3) * val;
  632|  1.77M|  ptr_x[len - 1] = temp1;
  633|  1.77M|}
ixheaace_sbr_qmf_enc.c:ixheaace_sbr_mdst:
  676|  1.77M|static VOID ixheaace_sbr_mdst(FLOAT32 *ptr_dct_data, WORD32 n, FLOAT32 *ptr_sbr_scratch) {
  677|  1.77M|  ixheaace_sbr_pre_mdst(ptr_dct_data, n, &long_window_sine_ld_64[0]);
  678|       |
  679|  1.77M|  ia_enhaacplus_enc_complex_fft_p2(ptr_dct_data, n / 2, ptr_sbr_scratch);
  680|       |
  681|  1.77M|  ixheaace_sbr_post_mdst(ptr_dct_data, n, &fft_twiddle_tab_32[0]);
  682|  1.77M|}
ixheaace_sbr_qmf_enc.c:ixheaace_sbr_pre_mdst:
  578|  1.77M|static VOID ixheaace_sbr_pre_mdst(FLOAT32 *ptr_x, WORD32 len, const FLOAT32 *ptr_sine_window) {
  579|  1.77M|  WORD32 i;
  580|  1.77M|  FLOAT32 wre, wim, re1, re2, im1, im2;
  581|       |
  582|  30.1M|  for (i = 0; i < len / 4; i++) {
  ------------------
  |  Branch (582:15): [True: 28.3M, False: 1.77M]
  ------------------
  583|  28.3M|    re1 = -ptr_x[2 * i];
  584|  28.3M|    re2 = ptr_x[2 * i + 1];
  585|  28.3M|    im2 = -ptr_x[len - 2 - 2 * i];
  586|  28.3M|    im1 = ptr_x[len - 1 - 2 * i];
  587|       |
  588|  28.3M|    wim = ptr_sine_window[2 * i];
  589|  28.3M|    wre = ptr_sine_window[len - 1 - 2 * i];
  590|       |
  591|  28.3M|    ptr_x[2 * i] = im1 * wim + re1 * wre;
  592|       |
  593|  28.3M|    ptr_x[2 * i + 1] = im1 * wre - re1 * wim;
  594|       |
  595|  28.3M|    wim = ptr_sine_window[2 * i + 1];
  596|  28.3M|    wre = ptr_sine_window[len - 2 - 2 * i];
  597|       |
  598|  28.3M|    ptr_x[len - 2 - 2 * i] = im2 * wim + re2 * wre;
  599|       |
  600|  28.3M|    ptr_x[len - 1 - 2 * i] = -(im2 * wre - re2 * wim);
  601|  28.3M|  }
  602|  1.77M|}
ixheaace_sbr_qmf_enc.c:ixheaace_sbr_post_mdst:
  634|  1.77M|static VOID ixheaace_sbr_post_mdst(FLOAT32 *ptr_x, WORD32 len, const FLOAT32 *ptr_trig_data) {
  635|  1.77M|  WORD32 i;
  636|  1.77M|  FLOAT32 wre, wim, re1, re2, im1, im2;
  637|  1.77M|  FLOAT32 temp0 = -ptr_x[0];
  638|  1.77M|  FLOAT32 temp1 = ptr_x[1];
  639|  1.77M|  FLOAT32 temp2 = ptr_x[len / 2];
  640|  1.77M|  FLOAT32 temp3 = ptr_x[len / 2 + 1];
  641|  1.77M|  FLOAT32 val = 0.70709228515625f;
  642|       |
  643|  1.77M|  re2 = ptr_x[len - 2];
  644|  1.77M|  im2 = ptr_x[len - 1];
  645|       |
  646|  28.3M|  for (i = 1; i < len / 4; i++) {
  ------------------
  |  Branch (646:15): [True: 26.6M, False: 1.77M]
  ------------------
  647|  26.6M|    wim = ptr_trig_data[i];
  648|  26.6M|    wre = ptr_trig_data[len / 2 - 1 - i];
  649|       |
  650|  26.6M|    ptr_x[2 * i - 1] = -(re2 * wim + im2 * wre);
  651|  26.6M|    ptr_x[len - 2 * i] = -(re2 * wre - im2 * wim);
  652|       |
  653|  26.6M|    re1 = ptr_x[2 * i];
  654|  26.6M|    im1 = ptr_x[2 * i + 1];
  655|  26.6M|    re2 = ptr_x[len - 2 - 2 * i];
  656|  26.6M|    im2 = ptr_x[len - 1 - 2 * i];
  657|       |
  658|  26.6M|    ptr_x[len - 1 - 2 * i] = -(re1 * wre + im1 * wim);
  659|  26.6M|    ptr_x[2 * i] = -(re1 * wim - im1 * wre);
  660|  26.6M|  }
  661|       |
  662|  1.77M|  ptr_x[len / 2] = (temp3 - temp2) * val;
  663|  1.77M|  ptr_x[len / 2 - 1] = -(temp3 + temp2) * val;
  664|       |
  665|  1.77M|  ptr_x[0] = temp1;
  666|  1.77M|  ptr_x[len - 1] = temp0;
  667|  1.77M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_fct3_64:
  143|  35.7M|static VOID ia_enhaacplus_enc_fct3_64(FLOAT32 *ptr_a, ixheaace_str_qmf_tabs *pstr_qmf_tab) {
  144|  35.7M|  WORD32 k;
  145|       |
  146|  35.7M|  const FLOAT32 *ptr_t1;
  147|  35.7M|  FLOAT32 xp, xp2, xp3, xp4, wc, ws;
  148|       |
  149|  35.7M|  FLOAT32 *ptr1, *ptr2;
  150|  35.7M|  FLOAT32 *ptr_ap, *ptr_an;
  151|       |
  152|       |  /* bit reversal */
  153|  35.7M|  xp = ptr_a[1];
  154|  35.7M|  ptr_a[1] = ptr_a[32];
  155|  35.7M|  ptr_a[32] = xp;
  156|  35.7M|  xp = ptr_a[2];
  157|  35.7M|  ptr_a[2] = ptr_a[16];
  158|  35.7M|  ptr_a[16] = xp;
  159|  35.7M|  xp = ptr_a[3];
  160|  35.7M|  ptr_a[3] = ptr_a[48];
  161|  35.7M|  ptr_a[48] = xp;
  162|  35.7M|  xp = ptr_a[4];
  163|  35.7M|  ptr_a[4] = ptr_a[8];
  164|  35.7M|  ptr_a[8] = xp;
  165|  35.7M|  xp = ptr_a[5];
  166|  35.7M|  ptr_a[5] = ptr_a[40];
  167|  35.7M|  ptr_a[40] = xp;
  168|  35.7M|  xp = ptr_a[6];
  169|  35.7M|  ptr_a[6] = ptr_a[24];
  170|  35.7M|  ptr_a[24] = xp;
  171|  35.7M|  xp = ptr_a[7];
  172|  35.7M|  ptr_a[7] = ptr_a[56];
  173|  35.7M|  ptr_a[56] = xp;
  174|  35.7M|  xp = ptr_a[9];
  175|  35.7M|  ptr_a[9] = ptr_a[36];
  176|  35.7M|  ptr_a[36] = xp;
  177|  35.7M|  xp = ptr_a[10];
  178|  35.7M|  ptr_a[10] = ptr_a[20];
  179|  35.7M|  ptr_a[20] = xp;
  180|  35.7M|  xp = ptr_a[11];
  181|  35.7M|  ptr_a[11] = ptr_a[52];
  182|  35.7M|  ptr_a[52] = xp;
  183|  35.7M|  xp = ptr_a[13];
  184|  35.7M|  ptr_a[13] = ptr_a[44];
  185|  35.7M|  ptr_a[44] = xp;
  186|  35.7M|  xp = ptr_a[14];
  187|  35.7M|  ptr_a[14] = ptr_a[28];
  188|  35.7M|  ptr_a[28] = xp;
  189|  35.7M|  xp = ptr_a[15];
  190|  35.7M|  ptr_a[15] = ptr_a[60];
  191|  35.7M|  ptr_a[60] = xp;
  192|  35.7M|  xp = ptr_a[17];
  193|  35.7M|  ptr_a[17] = ptr_a[34];
  194|  35.7M|  ptr_a[34] = xp;
  195|  35.7M|  xp = ptr_a[19];
  196|  35.7M|  ptr_a[19] = ptr_a[50];
  197|  35.7M|  ptr_a[50] = xp;
  198|  35.7M|  xp = ptr_a[21];
  199|  35.7M|  ptr_a[21] = ptr_a[42];
  200|  35.7M|  ptr_a[42] = xp;
  201|  35.7M|  xp = ptr_a[22];
  202|  35.7M|  ptr_a[22] = ptr_a[26];
  203|  35.7M|  ptr_a[26] = xp;
  204|  35.7M|  xp = ptr_a[23];
  205|  35.7M|  ptr_a[23] = ptr_a[58];
  206|  35.7M|  ptr_a[58] = xp;
  207|  35.7M|  xp = ptr_a[25];
  208|  35.7M|  ptr_a[25] = ptr_a[38];
  209|  35.7M|  ptr_a[38] = xp;
  210|  35.7M|  xp = ptr_a[27];
  211|  35.7M|  ptr_a[27] = ptr_a[54];
  212|  35.7M|  ptr_a[54] = xp;
  213|  35.7M|  xp = ptr_a[29];
  214|  35.7M|  ptr_a[29] = ptr_a[46];
  215|  35.7M|  ptr_a[46] = xp;
  216|  35.7M|  xp = ptr_a[31];
  217|  35.7M|  ptr_a[31] = ptr_a[62];
  218|  35.7M|  ptr_a[62] = xp;
  219|  35.7M|  xp = ptr_a[35];
  220|  35.7M|  ptr_a[35] = ptr_a[49];
  221|  35.7M|  ptr_a[49] = xp;
  222|  35.7M|  xp = ptr_a[37];
  223|  35.7M|  ptr_a[37] = ptr_a[41];
  224|  35.7M|  ptr_a[41] = xp;
  225|  35.7M|  xp = ptr_a[39];
  226|  35.7M|  ptr_a[39] = ptr_a[57];
  227|  35.7M|  ptr_a[57] = xp;
  228|  35.7M|  xp = ptr_a[43];
  229|  35.7M|  ptr_a[43] = ptr_a[53];
  230|  35.7M|  ptr_a[53] = xp;
  231|  35.7M|  xp = ptr_a[47];
  232|  35.7M|  ptr_a[47] = ptr_a[61];
  233|  35.7M|  ptr_a[61] = xp;
  234|  35.7M|  xp = ptr_a[55];
  235|  35.7M|  ptr_a[55] = ptr_a[59];
  236|  35.7M|  ptr_a[59] = xp;
  237|       |
  238|  35.7M|  xp = ptr_a[33];
  239|  35.7M|  xp2 = ptr_a[62];
  240|  35.7M|  ptr_a[62] = xp2 - xp;
  241|  35.7M|  ptr_a[33] = xp2 + xp;
  242|  35.7M|  xp = ptr_a[34];
  243|  35.7M|  xp2 = ptr_a[60];
  244|  35.7M|  ptr_a[60] = xp2 - xp;
  245|  35.7M|  ptr_a[34] = xp2 + xp;
  246|  35.7M|  xp = ptr_a[35];
  247|  35.7M|  xp2 = ptr_a[61];
  248|  35.7M|  ptr_a[61] = xp2 - xp;
  249|  35.7M|  ptr_a[35] = xp2 + xp;
  250|  35.7M|  xp = ptr_a[36];
  251|  35.7M|  xp2 = ptr_a[56];
  252|  35.7M|  ptr_a[56] = xp2 - xp;
  253|  35.7M|  ptr_a[36] = xp2 + xp;
  254|  35.7M|  xp = ptr_a[37];
  255|  35.7M|  xp2 = ptr_a[57];
  256|  35.7M|  ptr_a[57] = xp2 - xp;
  257|  35.7M|  ptr_a[37] = xp2 + xp;
  258|  35.7M|  xp = ptr_a[38];
  259|  35.7M|  xp2 = ptr_a[58];
  260|  35.7M|  ptr_a[58] = xp2 - xp;
  261|  35.7M|  ptr_a[38] = xp2 + xp;
  262|  35.7M|  xp = ptr_a[39];
  263|  35.7M|  xp2 = ptr_a[59];
  264|  35.7M|  ptr_a[59] = xp2 - xp;
  265|  35.7M|  ptr_a[39] = xp2 + xp;
  266|  35.7M|  xp = ptr_a[40];
  267|  35.7M|  xp2 = ptr_a[48];
  268|  35.7M|  ptr_a[48] = xp2 - xp;
  269|  35.7M|  ptr_a[40] = xp2 + xp;
  270|  35.7M|  xp = ptr_a[41];
  271|  35.7M|  xp2 = ptr_a[49];
  272|  35.7M|  ptr_a[49] = xp2 - xp;
  273|  35.7M|  ptr_a[41] = xp2 + xp;
  274|  35.7M|  xp = ptr_a[42];
  275|  35.7M|  xp2 = ptr_a[50];
  276|  35.7M|  ptr_a[50] = xp2 - xp;
  277|  35.7M|  ptr_a[42] = xp2 + xp;
  278|  35.7M|  xp = ptr_a[43];
  279|  35.7M|  xp2 = ptr_a[51];
  280|  35.7M|  ptr_a[51] = xp2 - xp;
  281|  35.7M|  ptr_a[43] = xp2 + xp;
  282|  35.7M|  xp = ptr_a[44];
  283|  35.7M|  xp2 = ptr_a[52];
  284|  35.7M|  ptr_a[52] = xp2 - xp;
  285|  35.7M|  ptr_a[44] = xp2 + xp;
  286|  35.7M|  xp = ptr_a[45];
  287|  35.7M|  xp2 = ptr_a[53];
  288|  35.7M|  ptr_a[53] = xp2 - xp;
  289|  35.7M|  ptr_a[45] = xp2 + xp;
  290|  35.7M|  xp = ptr_a[46];
  291|  35.7M|  xp2 = ptr_a[54];
  292|  35.7M|  ptr_a[54] = xp2 - xp;
  293|  35.7M|  ptr_a[46] = xp2 + xp;
  294|  35.7M|  xp = ptr_a[47];
  295|  35.7M|  xp2 = ptr_a[55];
  296|  35.7M|  ptr_a[55] = xp2 - xp;
  297|  35.7M|  ptr_a[47] = xp2 + xp;
  298|  35.7M|  xp = ptr_a[17];
  299|  35.7M|  xp2 = ptr_a[30];
  300|  35.7M|  ptr_a[30] = xp2 - xp;
  301|  35.7M|  ptr_a[17] = xp2 + xp;
  302|  35.7M|  xp = ptr_a[18];
  303|  35.7M|  xp2 = ptr_a[28];
  304|  35.7M|  ptr_a[28] = xp2 - xp;
  305|  35.7M|  ptr_a[18] = xp2 + xp;
  306|  35.7M|  xp = ptr_a[19];
  307|  35.7M|  xp2 = ptr_a[29];
  308|  35.7M|  ptr_a[29] = xp2 - xp;
  309|  35.7M|  ptr_a[19] = xp2 + xp;
  310|  35.7M|  xp = ptr_a[20];
  311|  35.7M|  xp2 = ptr_a[24];
  312|  35.7M|  ptr_a[24] = xp2 - xp;
  313|  35.7M|  ptr_a[20] = xp2 + xp;
  314|  35.7M|  xp = ptr_a[21];
  315|  35.7M|  xp2 = ptr_a[25];
  316|  35.7M|  ptr_a[25] = xp2 - xp;
  317|  35.7M|  ptr_a[21] = xp2 + xp;
  318|  35.7M|  xp = ptr_a[22];
  319|  35.7M|  xp2 = ptr_a[26];
  320|  35.7M|  ptr_a[26] = xp2 - xp;
  321|  35.7M|  ptr_a[22] = xp2 + xp;
  322|  35.7M|  xp = ptr_a[23];
  323|  35.7M|  xp2 = ptr_a[27];
  324|  35.7M|  ptr_a[27] = xp2 - xp;
  325|  35.7M|  ptr_a[23] = xp2 + xp;
  326|  35.7M|  xp = ptr_a[9];
  327|  35.7M|  xp2 = ptr_a[14];
  328|  35.7M|  ptr_a[14] = xp2 - xp;
  329|  35.7M|  ptr_a[9] = xp2 + xp;
  330|  35.7M|  xp = ptr_a[10];
  331|  35.7M|  xp2 = ptr_a[12];
  332|  35.7M|  ptr_a[12] = xp2 - xp;
  333|  35.7M|  ptr_a[10] = xp2 + xp;
  334|  35.7M|  xp = ptr_a[11];
  335|  35.7M|  xp2 = ptr_a[13];
  336|  35.7M|  ptr_a[13] = xp2 - xp;
  337|  35.7M|  ptr_a[11] = xp2 + xp;
  338|  35.7M|  xp = ptr_a[41];
  339|  35.7M|  xp2 = ptr_a[46];
  340|  35.7M|  ptr_a[46] = xp2 - xp;
  341|  35.7M|  ptr_a[41] = xp2 + xp;
  342|  35.7M|  xp = ptr_a[42];
  343|  35.7M|  xp2 = ptr_a[44];
  344|  35.7M|  ptr_a[44] = xp2 - xp;
  345|  35.7M|  ptr_a[42] = xp2 + xp;
  346|  35.7M|  xp = ptr_a[43];
  347|  35.7M|  xp2 = ptr_a[45];
  348|  35.7M|  ptr_a[45] = xp2 - xp;
  349|  35.7M|  ptr_a[43] = xp2 + xp;
  350|  35.7M|  xp = ptr_a[49];
  351|  35.7M|  xp2 = ptr_a[54];
  352|  35.7M|  ptr_a[49] = xp - xp2;
  353|  35.7M|  ptr_a[54] = xp2 + xp;
  354|  35.7M|  xp = ptr_a[50];
  355|  35.7M|  xp2 = ptr_a[52];
  356|  35.7M|  ptr_a[50] = xp - xp2;
  357|  35.7M|  ptr_a[52] = xp2 + xp;
  358|  35.7M|  xp = ptr_a[51];
  359|  35.7M|  xp2 = ptr_a[53];
  360|  35.7M|  ptr_a[51] = xp - xp2;
  361|  35.7M|  ptr_a[53] = xp2 + xp;
  362|  35.7M|  xp = ptr_a[5];
  363|  35.7M|  xp2 = ptr_a[6];
  364|  35.7M|  ptr_a[6] = xp2 - xp;
  365|  35.7M|  ptr_a[5] = xp2 + xp;
  366|  35.7M|  xp = ptr_a[21];
  367|  35.7M|  xp2 = ptr_a[22];
  368|  35.7M|  ptr_a[22] = xp2 - xp;
  369|  35.7M|  ptr_a[21] = xp2 + xp;
  370|  35.7M|  xp = ptr_a[25];
  371|  35.7M|  xp2 = ptr_a[26];
  372|  35.7M|  ptr_a[25] = xp - xp2;
  373|  35.7M|  ptr_a[26] = xp2 + xp;
  374|  35.7M|  xp = ptr_a[37];
  375|  35.7M|  xp2 = ptr_a[38];
  376|  35.7M|  ptr_a[38] = xp2 - xp;
  377|  35.7M|  ptr_a[37] = xp2 + xp;
  378|  35.7M|  xp = ptr_a[57];
  379|  35.7M|  xp2 = ptr_a[58];
  380|  35.7M|  ptr_a[57] = xp - xp2;
  381|  35.7M|  ptr_a[58] = xp2 + xp;
  382|       |
  383|  35.7M|  ia_enhaacplus_enc_fct3_4(ptr_a);
  384|  35.7M|  ia_enhaacplus_enc_fct4_4r(ptr_a + 4);
  385|  35.7M|  ia_enhaacplus_enc_fct3_4(ptr_a + 8);
  386|  35.7M|  ia_enhaacplus_enc_fst3_4r(ptr_a + 12);
  387|       |
  388|  35.7M|  ia_enhaacplus_enc_fct3_4(ptr_a + 16);
  389|  35.7M|  ia_enhaacplus_enc_fct4_4r(ptr_a + 20);
  390|  35.7M|  ia_enhaacplus_enc_fst4_4(ptr_a + 24);
  391|  35.7M|  ia_enhaacplus_enc_fst3_4r(ptr_a + 28);
  392|       |
  393|  35.7M|  ia_enhaacplus_enc_fct3_4(ptr_a + 32);
  394|  35.7M|  ia_enhaacplus_enc_fct4_4r(ptr_a + 36);
  395|  35.7M|  ia_enhaacplus_enc_fct3_4(ptr_a + 40);
  396|  35.7M|  ia_enhaacplus_enc_fst3_4r(ptr_a + 44);
  397|       |
  398|  35.7M|  ia_enhaacplus_enc_fct3_4(ptr_a + 48);
  399|  35.7M|  ia_enhaacplus_enc_fst3_4r(ptr_a + 52);
  400|  35.7M|  ia_enhaacplus_enc_fst4_4(ptr_a + 56);
  401|  35.7M|  ia_enhaacplus_enc_fst3_4r(ptr_a + 60);
  402|       |
  403|  35.7M|  ptr_ap = ptr_a;
  404|  35.7M|  ptr_an = ptr_a + 7;
  405|   178M|  for (k = 4; k != 0; k--) {
  ------------------
  |  Branch (405:15): [True: 143M, False: 35.7M]
  ------------------
  406|   143M|    xp = *ptr_ap++;
  407|   143M|    xp2 = *ptr_an--;
  408|   143M|    xp3 = *(ptr_ap + 15);
  409|   143M|    xp4 = *(ptr_an + 17);
  410|   143M|    *(ptr_an + 1) = xp - xp2;
  411|   143M|    *(ptr_ap - 1) = xp + xp2;
  412|       |
  413|   143M|    xp = *(ptr_ap + 23);
  414|   143M|    xp2 = *(ptr_an + 25);
  415|   143M|    *(ptr_an + 17) = xp3 - xp4;
  416|   143M|    *(ptr_ap + 15) = xp3 + xp4;
  417|       |
  418|   143M|    xp3 = *(ptr_ap + 31);
  419|   143M|    xp4 = *(ptr_an + 33);
  420|   143M|    *(ptr_ap + 23) = xp - xp2;
  421|   143M|    *(ptr_an + 25) = xp + xp2;
  422|       |
  423|   143M|    xp = *(ptr_ap + 55);
  424|   143M|    xp2 = *(ptr_an + 57);
  425|   143M|    *(ptr_an + 33) = xp3 - xp4;
  426|   143M|    *(ptr_ap + 31) = xp3 + xp4;
  427|       |
  428|   143M|    *(ptr_ap + 55) = xp - xp2;
  429|   143M|    *(ptr_an + 57) = xp + xp2;
  430|   143M|  }
  431|       |
  432|  35.7M|  ptr_t1 = pstr_qmf_tab->cos_sin_fct4_8;
  433|       |
  434|  35.7M|  ptr_ap = ptr_a + 8;
  435|  35.7M|  ptr_an = ptr_a + 15;
  436|   178M|  for (k = 4; k != 0; k--) {
  ------------------
  |  Branch (436:15): [True: 143M, False: 35.7M]
  ------------------
  437|   143M|    wc = *ptr_t1++;
  438|   143M|    ws = *ptr_t1++;
  439|       |
  440|   143M|    xp = *ptr_ap * wc + *ptr_an * ws;
  441|   143M|    *ptr_ap = *ptr_ap * ws - *ptr_an * wc;
  442|   143M|    ptr_ap++;
  443|   143M|    *ptr_an-- = xp;
  444|       |
  445|   143M|    xp = *(ptr_ap + 31) * wc + *(ptr_an + 33) * ws;
  446|   143M|    *(ptr_ap + 31) = *(ptr_ap + 31) * ws - *(ptr_an + 33) * wc;
  447|   143M|    *(ptr_an + 33) = xp;
  448|       |
  449|   143M|    xp = *(ptr_ap + 39) * ws + *(ptr_an + 41) * wc;
  450|   143M|    *(ptr_an + 41) = *(ptr_ap + 39) * wc - *(ptr_an + 41) * ws;
  451|   143M|    *(ptr_ap + 39) = xp;
  452|   143M|  }
  453|       |
  454|  35.7M|  ptr_ap = ptr_a;
  455|  35.7M|  ptr_an = ptr_a + 15;
  456|   321M|  for (k = 8; k != 0; k--) {
  ------------------
  |  Branch (456:15): [True: 286M, False: 35.7M]
  ------------------
  457|   286M|    xp = *ptr_ap++;
  458|   286M|    xp2 = *ptr_an--;
  459|   286M|    xp3 = *(ptr_ap + 31);
  460|   286M|    xp4 = *(ptr_an + 33);
  461|       |
  462|   286M|    *(ptr_an + 1) = xp - xp2;
  463|   286M|    *(ptr_ap - 1) = xp + xp2;
  464|       |
  465|   286M|    xp = *(ptr_ap + 47);
  466|   286M|    xp2 = *(ptr_an + 49);
  467|   286M|    *(ptr_an + 33) = xp3 - xp4;
  468|   286M|    *(ptr_ap + 31) = xp3 + xp4;
  469|   286M|    *(ptr_ap + 47) = xp - xp2;
  470|   286M|    *(ptr_an + 49) = xp + xp2;
  471|   286M|  }
  472|       |
  473|  35.7M|  ptr_t1 = pstr_qmf_tab->cos_sin_fct4_16;
  474|       |
  475|  35.7M|  ptr1 = &ptr_a[16];
  476|  35.7M|  ptr2 = &ptr_a[31];
  477|   321M|  for (k = 7; k >= 0; k--) {
  ------------------
  |  Branch (477:15): [True: 286M, False: 35.7M]
  ------------------
  478|   286M|    wc = *ptr_t1++;
  479|   286M|    ws = *ptr_t1++;
  480|       |
  481|   286M|    xp = *ptr1;
  482|   286M|    xp2 = *ptr2;
  483|       |
  484|   286M|    *ptr2-- = xp * wc + xp2 * ws;
  485|   286M|    *ptr1++ = xp * ws - xp2 * wc;
  486|   286M|  }
  487|       |
  488|  35.7M|  ptr1 = &ptr_a[0];
  489|  35.7M|  ptr2 = &ptr_a[31];
  490|   607M|  for (k = 15; k >= 0; k--) {
  ------------------
  |  Branch (490:16): [True: 572M, False: 35.7M]
  ------------------
  491|   572M|    xp = *ptr1;
  492|   572M|    xp2 = *ptr2;
  493|       |
  494|   572M|    *ptr1++ = xp + xp2;
  495|   572M|    *ptr2-- = xp - xp2;
  496|   572M|  }
  497|       |
  498|  35.7M|  ptr_t1 = pstr_qmf_tab->cos_sin_fct4_32;
  499|  35.7M|  ptr1 = &ptr_a[32];
  500|  35.7M|  ptr2 = &ptr_a[63];
  501|       |
  502|   607M|  for (k = 15; k >= 0; k--) {
  ------------------
  |  Branch (502:16): [True: 572M, False: 35.7M]
  ------------------
  503|   572M|    wc = *ptr_t1++;
  504|   572M|    ws = *ptr_t1++;
  505|       |
  506|   572M|    xp = *ptr1;
  507|   572M|    xp2 = *ptr2;
  508|       |
  509|   572M|    *ptr2-- = xp * wc + xp2 * ws;
  510|   572M|    *ptr1++ = xp * ws - xp2 * wc;
  511|   572M|  }
  512|       |
  513|  35.7M|  ptr1 = &ptr_a[0];
  514|  35.7M|  ptr2 = &ptr_a[63];
  515|  1.18G|  for (k = 31; k >= 0; k--) {
  ------------------
  |  Branch (515:16): [True: 1.14G, False: 35.7M]
  ------------------
  516|  1.14G|    xp = *ptr1;
  517|  1.14G|    xp2 = *ptr2;
  518|       |
  519|  1.14G|    *ptr1++ = xp + xp2;
  520|  1.14G|    *ptr2-- = xp - xp2;
  521|  1.14G|  }
  522|  35.7M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_fct3_4:
   46|   214M|static VOID ia_enhaacplus_enc_fct3_4(FLOAT32 *ptr_x) {
   47|   214M|  FLOAT32 tmp00, tmp01, tmp10, tmp11, xp, xp2;
   48|       |
   49|   214M|  xp2 = ptr_x[1];
   50|   214M|  xp = ptr_x[0];
   51|       |
   52|   214M|  xp2 = xp2 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|   214M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
   53|       |
   54|   214M|  tmp00 = xp + xp2;
   55|   214M|  tmp01 = xp - xp2;
   56|       |
   57|   214M|  xp = ptr_x[2];
   58|   214M|  xp2 = ptr_x[3];
   59|       |
   60|   214M|  tmp10 = (xp * IXHEAACE_COS_PI_BY_8) + (xp2 * IXHEAACE_SIN_PI_BY_8);
  ------------------
  |  |   24|   214M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
                tmp10 = (xp * IXHEAACE_COS_PI_BY_8) + (xp2 * IXHEAACE_SIN_PI_BY_8);
  ------------------
  |  |   25|   214M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
   61|       |
   62|   214M|  ptr_x[0] = tmp00 + tmp10;
   63|   214M|  ptr_x[3] = tmp00 - tmp10;
   64|       |
   65|   214M|  tmp11 = (xp * IXHEAACE_SIN_PI_BY_8) - (xp2 * IXHEAACE_COS_PI_BY_8);
  ------------------
  |  |   25|   214M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
                tmp11 = (xp * IXHEAACE_SIN_PI_BY_8) - (xp2 * IXHEAACE_COS_PI_BY_8);
  ------------------
  |  |   24|   214M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
   66|       |
   67|   214M|  ptr_x[1] = tmp01 + tmp11;
   68|   214M|  ptr_x[2] = tmp01 - tmp11;
   69|   214M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_fct4_4r:
   96|   107M|static VOID ia_enhaacplus_enc_fct4_4r(FLOAT32 *ptr_x) {
   97|   107M|  FLOAT32 tmp00, tmp01, tmp10, tmp11, xp, xp2;
   98|       |
   99|   107M|  xp = ptr_x[1];
  100|   107M|  xp2 = ptr_x[0];
  101|       |
  102|   107M|  xp = xp * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|   107M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  103|   107M|  tmp00 = xp2 + xp;
  104|   107M|  tmp01 = xp2 - xp;
  105|       |
  106|   107M|  xp = ptr_x[2];
  107|   107M|  xp2 = ptr_x[3];
  108|       |
  109|   107M|  xp = xp * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|   107M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  110|   107M|  tmp11 = xp2 - xp;
  111|   107M|  tmp10 = xp2 + xp;
  112|       |
  113|   107M|  ptr_x[3] = tmp00 * IXHEAACE_COS_PI_BY_16 + tmp10 * IXHEAACE_SIN_PI_BY_16;
  ------------------
  |  |   26|   107M|#define IXHEAACE_COS_PI_BY_16 (0.98077392578125f)     // 0.980785280403230f
  ------------------
                ptr_x[3] = tmp00 * IXHEAACE_COS_PI_BY_16 + tmp10 * IXHEAACE_SIN_PI_BY_16;
  ------------------
  |  |   27|   107M|#define IXHEAACE_SIN_PI_BY_16 (0.195098876953125f)    // 0.195090322016128f
  ------------------
  114|   107M|  ptr_x[0] = tmp00 * IXHEAACE_SIN_PI_BY_16 - tmp10 * IXHEAACE_COS_PI_BY_16;
  ------------------
  |  |   27|   107M|#define IXHEAACE_SIN_PI_BY_16 (0.195098876953125f)    // 0.195090322016128f
  ------------------
                ptr_x[0] = tmp00 * IXHEAACE_SIN_PI_BY_16 - tmp10 * IXHEAACE_COS_PI_BY_16;
  ------------------
  |  |   26|   107M|#define IXHEAACE_COS_PI_BY_16 (0.98077392578125f)     // 0.980785280403230f
  ------------------
  115|       |
  116|   107M|  ptr_x[2] = tmp01 * IXHEAACE_COS_3_PI_BY_16 - tmp11 * IXHEAACE_SIN_3_PI_BY_16;
  ------------------
  |  |   28|   107M|#define IXHEAACE_COS_3_PI_BY_16 (0.83148193359375f)   // 0.831469612302545f
  ------------------
                ptr_x[2] = tmp01 * IXHEAACE_COS_3_PI_BY_16 - tmp11 * IXHEAACE_SIN_3_PI_BY_16;
  ------------------
  |  |   29|   107M|#define IXHEAACE_SIN_3_PI_BY_16 (0.555572509765625f)  // 0.555570233019602f
  ------------------
  117|   107M|  ptr_x[1] = tmp01 * IXHEAACE_SIN_3_PI_BY_16 + tmp11 * IXHEAACE_COS_3_PI_BY_16;
  ------------------
  |  |   29|   107M|#define IXHEAACE_SIN_3_PI_BY_16 (0.555572509765625f)  // 0.555570233019602f
  ------------------
                ptr_x[1] = tmp01 * IXHEAACE_SIN_3_PI_BY_16 + tmp11 * IXHEAACE_COS_3_PI_BY_16;
  ------------------
  |  |   28|   107M|#define IXHEAACE_COS_3_PI_BY_16 (0.83148193359375f)   // 0.831469612302545f
  ------------------
  118|   107M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_fst3_4r:
   71|   178M|static VOID ia_enhaacplus_enc_fst3_4r(FLOAT32 *ptr_x) {
   72|   178M|  FLOAT32 tmp00, tmp01, tmp10, tmp11, xp, xp2;
   73|       |
   74|   178M|  xp2 = ptr_x[2];
   75|   178M|  xp = ptr_x[3];
   76|       |
   77|   178M|  xp2 = xp2 * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|   178M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
   78|       |
   79|   178M|  tmp00 = xp + xp2;
   80|   178M|  tmp01 = xp - xp2;
   81|       |
   82|   178M|  xp = ptr_x[1];
   83|   178M|  xp2 = ptr_x[0];
   84|       |
   85|   178M|  tmp10 = (xp * IXHEAACE_COS_PI_BY_8) + (xp2 * IXHEAACE_SIN_PI_BY_8);
  ------------------
  |  |   24|   178M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
                tmp10 = (xp * IXHEAACE_COS_PI_BY_8) + (xp2 * IXHEAACE_SIN_PI_BY_8);
  ------------------
  |  |   25|   178M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
   86|       |
   87|   178M|  ptr_x[3] = tmp00 + tmp10;
   88|   178M|  ptr_x[0] = tmp10 - tmp00;
   89|       |
   90|   178M|  tmp11 = (xp2 * IXHEAACE_COS_PI_BY_8) - (xp * IXHEAACE_SIN_PI_BY_8);
  ------------------
  |  |   24|   178M|#define IXHEAACE_COS_PI_BY_8 (0.92388916015625f)      // 0.923879532511287f
  ------------------
                tmp11 = (xp2 * IXHEAACE_COS_PI_BY_8) - (xp * IXHEAACE_SIN_PI_BY_8);
  ------------------
  |  |   25|   178M|#define IXHEAACE_SIN_PI_BY_8 (0.3826904296875f)       // 0.382683432365090f
  ------------------
   91|       |
   92|   178M|  ptr_x[2] = tmp11 - tmp01;
   93|   178M|  ptr_x[1] = tmp11 + tmp01;
   94|   178M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_fst4_4:
  120|  71.5M|static VOID ia_enhaacplus_enc_fst4_4(FLOAT32 *ptr_x) {
  121|  71.5M|  FLOAT32 tmp00, tmp01, tmp10, tmp11, xp, xp2;
  122|       |
  123|  71.5M|  xp = ptr_x[1];
  124|  71.5M|  xp2 = ptr_x[0];
  125|       |
  126|  71.5M|  xp = xp * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  71.5M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  127|  71.5M|  tmp10 = xp2 + xp;
  128|  71.5M|  tmp11 = xp2 - xp;
  129|       |
  130|  71.5M|  xp = ptr_x[2];
  131|  71.5M|  xp2 = ptr_x[3];
  132|       |
  133|  71.5M|  xp = xp * IXHEAACE_COS_PI_BY_4;
  ------------------
  |  |   23|  71.5M|#define IXHEAACE_COS_PI_BY_4 (0.70709228515625f)      // 0.7071067812f
  ------------------
  134|  71.5M|  tmp01 = xp2 - xp;
  135|  71.5M|  tmp00 = xp2 + xp;
  136|       |
  137|  71.5M|  ptr_x[0] = tmp00 * IXHEAACE_COS_PI_BY_16 + tmp10 * IXHEAACE_SIN_PI_BY_16;
  ------------------
  |  |   26|  71.5M|#define IXHEAACE_COS_PI_BY_16 (0.98077392578125f)     // 0.980785280403230f
  ------------------
                ptr_x[0] = tmp00 * IXHEAACE_COS_PI_BY_16 + tmp10 * IXHEAACE_SIN_PI_BY_16;
  ------------------
  |  |   27|  71.5M|#define IXHEAACE_SIN_PI_BY_16 (0.195098876953125f)    // 0.195090322016128f
  ------------------
  138|  71.5M|  ptr_x[3] = tmp10 * IXHEAACE_COS_PI_BY_16 - tmp00 * IXHEAACE_SIN_PI_BY_16;
  ------------------
  |  |   26|  71.5M|#define IXHEAACE_COS_PI_BY_16 (0.98077392578125f)     // 0.980785280403230f
  ------------------
                ptr_x[3] = tmp10 * IXHEAACE_COS_PI_BY_16 - tmp00 * IXHEAACE_SIN_PI_BY_16;
  ------------------
  |  |   27|  71.5M|#define IXHEAACE_SIN_PI_BY_16 (0.195098876953125f)    // 0.195090322016128f
  ------------------
  139|  71.5M|  ptr_x[1] = tmp11 * IXHEAACE_SIN_3_PI_BY_16 - tmp01 * IXHEAACE_COS_3_PI_BY_16;
  ------------------
  |  |   29|  71.5M|#define IXHEAACE_SIN_3_PI_BY_16 (0.555572509765625f)  // 0.555570233019602f
  ------------------
                ptr_x[1] = tmp11 * IXHEAACE_SIN_3_PI_BY_16 - tmp01 * IXHEAACE_COS_3_PI_BY_16;
  ------------------
  |  |   28|  71.5M|#define IXHEAACE_COS_3_PI_BY_16 (0.83148193359375f)   // 0.831469612302545f
  ------------------
  140|  71.5M|  ptr_x[2] = tmp01 * IXHEAACE_SIN_3_PI_BY_16 + tmp11 * IXHEAACE_COS_3_PI_BY_16;
  ------------------
  |  |   29|  71.5M|#define IXHEAACE_SIN_3_PI_BY_16 (0.555572509765625f)  // 0.555570233019602f
  ------------------
                ptr_x[2] = tmp01 * IXHEAACE_SIN_3_PI_BY_16 + tmp11 * IXHEAACE_COS_3_PI_BY_16;
  ------------------
  |  |   28|  71.5M|#define IXHEAACE_COS_3_PI_BY_16 (0.83148193359375f)   // 0.831469612302545f
  ------------------
  141|  71.5M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_fst3_64:
  524|  17.8M|static VOID ia_enhaacplus_enc_fst3_64(FLOAT32 *ptr_a, ixheaace_str_qmf_tabs *pstr_qmf_tab) {
  525|  17.8M|  WORD32 k;
  526|  17.8M|  FLOAT32 xp, xp2;
  527|  17.8M|  FLOAT32 *ptr1, *ptr2;
  528|       |
  529|  17.8M|  ptr1 = &ptr_a[0];
  530|  17.8M|  ptr2 = &ptr_a[63];
  531|       |
  532|   590M|  for (k = 31; k >= 0; k--) {
  ------------------
  |  Branch (532:16): [True: 572M, False: 17.8M]
  ------------------
  533|   572M|    xp = *ptr1;
  534|   572M|    xp2 = *ptr2;
  535|   572M|    *ptr2-- = xp;
  536|   572M|    *ptr1++ = xp2;
  537|   572M|  }
  538|       |
  539|  17.8M|  ia_enhaacplus_enc_fct3_64(ptr_a, pstr_qmf_tab);
  540|       |
  541|  17.8M|  ptr1 = &ptr_a[1];
  542|       |
  543|   303M|  for (k = 15; k >= 0; k--) {
  ------------------
  |  Branch (543:16): [True: 286M, False: 17.8M]
  ------------------
  544|   286M|    xp = *ptr1;
  545|   286M|    xp2 = *(ptr1 + 2);
  546|   286M|    *ptr1++ = -xp;
  547|   286M|    ptr1++;
  548|   286M|    *ptr1++ = -xp2;
  549|   286M|    ptr1++;
  550|   286M|  }
  551|  17.8M|}
ixheaace_sbr_qmf_enc.c:ia_enhaacplus_enc_sbr_qmf_analysis_win_add:
  759|  17.8M|                                                       FLOAT32 *ptr_syn_buffer) {
  760|  17.8M|  FLOAT32 accu_l = 0, accu_r = 0;
  761|  17.8M|  WORD k;
  762|  1.16G|  for (k = 0; k < 64; k++) {
  ------------------
  |  Branch (762:15): [True: 1.14G, False: 17.8M]
  ------------------
  763|  1.14G|    accu_l = 0;
  764|  1.14G|    accu_r = 0;
  765|       |
  766|  1.14G|    {
  767|  1.14G|      accu_l += *ptr_pf_l++ * ptr_fp1[k];
  768|  1.14G|      accu_l += *ptr_pf_l++ * ptr_fp1[128 + k];
  769|  1.14G|      accu_l += *ptr_pf_l++ * ptr_fp1[256 + k];
  770|  1.14G|      accu_l += *ptr_pf_l++ * ptr_fp1[384 + k];
  771|  1.14G|      accu_l += *ptr_pf_l++ * ptr_fp1[512 + k];
  772|       |
  773|  1.14G|      accu_r += *--ptr_pf_r * ptr_fp2[k];
  774|  1.14G|      accu_r += *--ptr_pf_r * ptr_fp2[128 + k];
  775|  1.14G|      accu_r += *--ptr_pf_r * ptr_fp2[256 + k];
  776|  1.14G|      accu_r += *--ptr_pf_r * ptr_fp2[384 + k];
  777|  1.14G|      accu_r += *--ptr_pf_r * ptr_fp2[512 + k];
  778|  1.14G|    }
  779|  1.14G|    ptr_syn_buffer[127 - k] = accu_l;
  780|  1.14G|    ptr_syn_buffer[63 - k] = accu_r;
  781|  1.14G|    ptr_pf_l += 5;
  782|  1.14G|    ptr_pf_r -= 5;
  783|  1.14G|  }
  784|  17.8M|}
ixheaace_sbr_qmf_enc.c:ixheaace_inverse_modulation:
 1249|   630k|                                        ixheaace_pstr_sbr_qmf_filter_bank pstr_qmf_bank) {
 1250|   630k|  WORD32 i;
 1251|   630k|  FLOAT32 gain = 0.015625f;
 1252|   630k|  FLOAT32 r1, i1, r2, i2;
 1253|   630k|  FLOAT32 *ptr_time1, *ptr_time2;
 1254|   630k|  FLOAT32 *ptr_time3, *ptr_time4;
 1255|   630k|  const FLOAT32 *ptr_re;
 1256|   630k|  const FLOAT32 *ptr_im;
 1257|       |
 1258|   630k|  ptr_time1 = &ptr_time_out[0];
 1259|   630k|  ptr_time2 = &ptr_time_out[32];
 1260|   630k|  ptr_re = &ptr_sbr_real[0];
 1261|   630k|  ptr_im = &ptr_sbr_imag[0];
 1262|       |
 1263|  20.8M|  for (i = 31; i >= 0; i--) {
  ------------------
  |  Branch (1263:16): [True: 20.1M, False: 630k]
  ------------------
 1264|  20.1M|    r1 = *ptr_re++;
 1265|  20.1M|    i1 = *ptr_im++;
 1266|       |
 1267|  20.1M|    *ptr_time1++ = r1 * gain;
 1268|  20.1M|    *ptr_time2++ = i1 * gain;
 1269|  20.1M|  }
 1270|       |
 1271|   630k|  ixheaace_cos_sim_mod(ptr_time_out, pstr_qmf_bank);
 1272|       |
 1273|   630k|  ptr_time1 = &ptr_time_out[63];
 1274|   630k|  ptr_time2 = &ptr_time_out[31];
 1275|   630k|  ptr_time3 = &ptr_time_out[0];
 1276|   630k|  ptr_time4 = &ptr_time_out[32];
 1277|  10.7M|  for (i = 15; i >= 0; i--) {
  ------------------
  |  Branch (1277:16): [True: 10.0M, False: 630k]
  ------------------
 1278|  10.0M|    r1 = *ptr_time3;
 1279|  10.0M|    i2 = *ptr_time1;
 1280|  10.0M|    r2 = *ptr_time2;
 1281|  10.0M|    i1 = *ptr_time4;
 1282|       |
 1283|  10.0M|    *ptr_time3++ = r1 - i1;
 1284|       |
 1285|  10.0M|    *ptr_time1-- = -(r1 + i1);
 1286|       |
 1287|  10.0M|    *ptr_time2-- = r2 - i2;
 1288|       |
 1289|  10.0M|    *ptr_time4++ = -(r2 + i2);
 1290|  10.0M|  }
 1291|   630k|}
ixheaace_sbr_qmf_enc.c:ixheaace_cos_sim_mod:
 1187|   630k|                                 ixheaace_pstr_sbr_qmf_filter_bank pstr_qmf_bank) {
 1188|   630k|  WORD32 i;
 1189|   630k|  FLOAT32 re1, im1, re2, im2, re3, im3;
 1190|   630k|  const FLOAT32 *ptr_cos_sin_tab = pstr_qmf_bank->ptr_flt_cos_twiddle;
 1191|   630k|  const FLOAT32 *ptr_cos_sin_tab2 = &pstr_qmf_bank->ptr_flt_cos_twiddle[31];
 1192|   630k|  const FLOAT32 *ptr_alt_sin_tab;
 1193|   630k|  FLOAT32 wim, wre;
 1194|   630k|  FLOAT32 *ptr_subband2 = ptr_subband + 32;
 1195|       |
 1196|  5.67M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (1196:15): [True: 5.04M, False: 630k]
  ------------------
 1197|  5.04M|    wre = *ptr_cos_sin_tab++;
 1198|  5.04M|    wim = *ptr_cos_sin_tab++;
 1199|  5.04M|    re1 = ptr_subband[2 * i];
 1200|  5.04M|    im1 = ptr_subband[31 - 2 * i];
 1201|  5.04M|    re3 = ptr_subband[30 - 2 * i];
 1202|  5.04M|    im3 = ptr_subband[2 * i + 1];
 1203|  5.04M|    ptr_subband[2 * i] = (im1 * wim) + (re1 * wre);
 1204|  5.04M|    ptr_subband[2 * i + 1] = (im1 * wre) - (re1 * wim);
 1205|  5.04M|    re1 = ptr_subband2[2 * i];
 1206|  5.04M|    im1 = ptr_subband2[31 - 2 * i];
 1207|  5.04M|    re2 = ptr_subband2[30 - 2 * i];
 1208|  5.04M|    im2 = ptr_subband2[2 * i + 1];
 1209|  5.04M|    ptr_subband2[2 * i + 1] = (im1 * wre) + (re1 * wim);
 1210|  5.04M|    ptr_subband2[2 * i] = (im1 * wim) - (re1 * wre);
 1211|  5.04M|    wim = *ptr_cos_sin_tab2--;
 1212|  5.04M|    wre = *ptr_cos_sin_tab2--;
 1213|  5.04M|    ptr_subband[30 - 2 * i] = (im3 * wim) + (re3 * wre);
 1214|  5.04M|    ptr_subband[31 - 2 * i] = (im3 * wre) - (re3 * wim);
 1215|  5.04M|    ptr_subband2[31 - 2 * i] = (im2 * wre) + (re2 * wim);
 1216|  5.04M|    ptr_subband2[30 - 2 * i] = (im2 * wim) - (re2 * wre);
 1217|  5.04M|  }
 1218|       |
 1219|   630k|  ixheaace_fft16(ptr_subband);
 1220|   630k|  ixheaace_fft16(ptr_subband2);
 1221|       |
 1222|   630k|  ptr_alt_sin_tab = &pstr_qmf_bank->ptr_flt_alt_sin_twiddle[0];
 1223|   630k|  wim = *ptr_alt_sin_tab++;
 1224|   630k|  wre = *ptr_alt_sin_tab++;
 1225|  5.67M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (1225:15): [True: 5.04M, False: 630k]
  ------------------
 1226|  5.04M|    re1 = ptr_subband[2 * i];
 1227|  5.04M|    im1 = ptr_subband[2 * i + 1];
 1228|  5.04M|    re3 = ptr_subband[30 - 2 * i];
 1229|  5.04M|    im3 = ptr_subband[31 - 2 * i];
 1230|  5.04M|    ptr_subband[2 * i] = (re1 * wre) + (im1 * wim);
 1231|  5.04M|    ptr_subband[31 - 2 * i] = (re1 * wim) - (im1 * wre);
 1232|  5.04M|    re1 = ptr_subband2[2 * i];
 1233|  5.04M|    im1 = ptr_subband2[2 * i + 1];
 1234|  5.04M|    re2 = ptr_subband2[30 - 2 * i];
 1235|  5.04M|    im2 = ptr_subband2[31 - 2 * i];
 1236|  5.04M|    ptr_subband2[31 - 2 * i] = -((re1 * wre) + (im1 * wim));
 1237|  5.04M|    ptr_subband2[2 * i] = -((re1 * wim) - (im1 * wre));
 1238|  5.04M|    wim = *ptr_alt_sin_tab++;
 1239|  5.04M|    wre = *ptr_alt_sin_tab++;
 1240|  5.04M|    ptr_subband[30 - 2 * i] = (re3 * wim) + (im3 * wre);
 1241|  5.04M|    ptr_subband[2 * i + 1] = (re3 * wre) - (im3 * wim);
 1242|  5.04M|    ptr_subband2[2 * i + 1] = -((re2 * wim) + (im2 * wre));
 1243|  5.04M|    ptr_subband2[30 - 2 * i] = -(re2 * wre) + (im2 * wim);
 1244|  5.04M|  }
 1245|   630k|}
ixheaace_sbr_qmf_enc.c:ixheaace_win_add:
 1294|   630k|                             const FLOAT32 *ptr_filter) {
 1295|   630k|  WORD32 j, k;
 1296|   630k|  FLOAT32 *ptr_work_buf = &ptr_work_buffer[63];
 1297|  20.8M|  for (j = 0, k = 0; j < 64; j += 2, k++) {
  ------------------
  |  Branch (1297:22): [True: 20.1M, False: 630k]
  ------------------
 1298|  20.1M|    FLOAT32 tmp_var = *ptr_work_buf--;
 1299|  20.1M|    FLOAT32 temp_a = ptr_filter[2 * k];
 1300|  20.1M|    FLOAT32 temp_b = ptr_filter[2 * k + 1];
 1301|  20.1M|    FLOAT32 temp1 = *ptr_work_buf--;
 1302|  20.1M|    ptr_time_buf[j] += tmp_var * temp_a;
 1303|  20.1M|    ptr_time_buf[j + 1] += temp1 * temp_b;
 1304|       |
 1305|  20.1M|    temp_a = ptr_filter[64 + 2 * k];
 1306|  20.1M|    temp_b = ptr_filter[64 + 2 * k + 1];
 1307|  20.1M|    ptr_time_buf[64 + j] += tmp_var * temp_a;
 1308|  20.1M|    ptr_time_buf[64 + j + 1] += temp1 * temp_b;
 1309|       |
 1310|  20.1M|    temp_a = ptr_filter[128 + 2 * k];
 1311|  20.1M|    temp_b = ptr_filter[128 + 2 * k + 1];
 1312|  20.1M|    ptr_time_buf[128 + j] += tmp_var * temp_a;
 1313|  20.1M|    ptr_time_buf[128 + j + 1] += temp1 * temp_b;
 1314|       |
 1315|  20.1M|    temp_a = ptr_filter[192 + 2 * k];
 1316|  20.1M|    temp_b = ptr_filter[192 + 2 * k + 1];
 1317|  20.1M|    ptr_time_buf[192 + j] += tmp_var * temp_a;
 1318|  20.1M|    ptr_time_buf[192 + j + 1] += temp1 * temp_b;
 1319|       |
 1320|  20.1M|    temp_a = ptr_filter[256 + 2 * k];
 1321|  20.1M|    temp_b = ptr_filter[256 + 2 * k + 1];
 1322|  20.1M|    ptr_time_buf[256 + j] += tmp_var * temp_a;
 1323|  20.1M|    ptr_time_buf[256 + j + 1] += temp1 * temp_b;
 1324|  20.1M|  }
 1325|   630k|}

ixheaace_create_synthesis_qmf_bank:
   42|    246|    ixheaace_str_sbr_tabs *pstr_sbr_tab) {
   43|    246|  WORD32 *ptr_temp;
   44|    246|  ptr_temp =
   45|    246|      &ptr_common_buffer[5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS + IXHEAACE_PS_BUF4_SIZE];
  ------------------
  |  |   71|    246|#define NO_OF_ESTIMATES (4)
  ------------------
                    &ptr_common_buffer[5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS + IXHEAACE_PS_BUF4_SIZE];
  ------------------
  |  |   83|    246|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|    246|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
                    &ptr_common_buffer[5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS + IXHEAACE_PS_BUF4_SIZE];
  ------------------
  |  |   27|    246|  (sizeof(WORD32) * (IXHEAACE_QMF_TIME_SLOTS + IXHEAACE_QMF_BUFFER_MOVE) + \
  |  |  ------------------
  |  |  |  |   69|    246|#define IXHEAACE_QMF_TIME_SLOTS (32)
  |  |  ------------------
  |  |                 (sizeof(WORD32) * (IXHEAACE_QMF_TIME_SLOTS + IXHEAACE_QMF_BUFFER_MOVE) + \
  |  |  ------------------
  |  |  |  |   24|    246|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|    246|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   28|    246|   sizeof(WORD32 *) * (IXHEAACE_NUM_QMF_BANDS_IN_HYBRID +                  \
  |  |  ------------------
  |  |  |  |   26|    246|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  |  |  ------------------
  |  |   29|    246|                       IXHEAACE_NUM_QMF_BANDS_IN_HYBRID * IXHEAACE_QMF_BUFFER_MOVE))
  |  |  ------------------
  |  |  |  |   26|    246|#define IXHEAACE_NUM_QMF_BANDS_IN_HYBRID (3)
  |  |  ------------------
  |  |                                      IXHEAACE_NUM_QMF_BANDS_IN_HYBRID * IXHEAACE_QMF_BUFFER_MOVE))
  |  |  ------------------
  |  |  |  |   24|    246|#define IXHEAACE_QMF_BUFFER_MOVE (IXHEAACE_HYBRID_FILTER_LENGTH - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|    246|#define IXHEAACE_HYBRID_FILTER_LENGTH (13)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|    246|  memset(pstr_sbr_qmf_filter_bank, 0, sizeof(ixheaace_str_sbr_qmf_filter_bank));
   47|       |
   48|    246|  pstr_sbr_qmf_filter_bank->ptr_flt_filter = pstr_sbr_tab->ptr_qmf_tab->sbr_p_64_640_qmf;
   49|    246|  pstr_sbr_qmf_filter_bank->ptr_flt_alt_sin_twiddle =
   50|    246|      pstr_sbr_tab->ptr_qmf_tab->sbr_alt_sin_twiddle;
   51|    246|  pstr_sbr_qmf_filter_bank->ptr_flt_cos_twiddle = pstr_sbr_tab->ptr_qmf_tab->sbr_cos_sin_twiddle;
   52|       |
   53|    246|  pstr_sbr_qmf_filter_bank->ptr_flt_work_buf = (FLOAT32 *)ptr_temp;
   54|    246|  ptr_temp += 64;
   55|    246|  pstr_sbr_qmf_filter_bank->ptr_flt_time_buf = (FLOAT32 *)ptr_temp;
   56|    246|}
ixheaace_create_qmf_bank:
   59|  8.64k|                              ixheaace_str_sbr_tabs *pstr_sbr_tab, WORD32 is_ld_sbr) {
   60|  8.64k|  pstr_sbr_qmf_filter_bank->offset = 0;
   61|  8.64k|  pstr_sbr_qmf_filter_bank->flag = 0;
   62|       |
   63|  8.64k|  pstr_sbr_qmf_filter_bank->ptr_filter =
   64|  8.64k|      (is_ld_sbr) ? &cld_fb_64_640[0] : pstr_sbr_tab->ptr_qmf_tab->sbr_qmf_64_640;
  ------------------
  |  Branch (64:7): [True: 1.77k, False: 6.87k]
  ------------------
   65|       |
   66|  8.64k|  pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf =
   67|  8.64k|      (FLOAT32 *)pstr_sbr_qmf_filter_bank->ptr_sbr_qmf_states_ana;
   68|       |
   69|  8.64k|  if (is_ld_sbr) {
  ------------------
  |  Branch (69:7): [True: 1.77k, False: 6.87k]
  ------------------
   70|  1.77k|    pstr_sbr_qmf_filter_bank->ptr_qmf_states_curr_pos =
   71|  1.77k|        (FLOAT32 *)pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf;
   72|  1.77k|    pstr_sbr_qmf_filter_bank->ptr_fp1 = pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf;
   73|  1.77k|    pstr_sbr_qmf_filter_bank->ptr_fp2 = pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf + 64;
   74|       |
   75|  1.77k|    pstr_sbr_qmf_filter_bank->start_coeff_cnt = 0;
   76|  1.77k|  }
   77|       |
   78|  8.64k|  pstr_sbr_qmf_filter_bank->ptr_ref_coeff_l = pstr_sbr_tab->ptr_qmf_tab->sbr_qmf_64_640 + 10;
   79|  8.64k|  pstr_sbr_qmf_filter_bank->ptr_ref_coeff_r = pstr_sbr_tab->ptr_qmf_tab->sbr_qmf_64_640 + 640;
   80|  8.64k|  pstr_sbr_qmf_filter_bank->ptr_cld_filt = pstr_sbr_tab->ptr_qmf_tab->sbr_cld_fb;
   81|       |
   82|  8.64k|  pstr_sbr_qmf_filter_bank->offset_l = 5;
   83|  8.64k|  pstr_sbr_qmf_filter_bank->offset_r = 5;
   84|       |
   85|  8.64k|  memset(pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf, 0,
   86|  8.64k|         QMF_FILTER_LENGTH * sizeof(pstr_sbr_qmf_filter_bank->ptr_qmf_states_buf[0]));
  ------------------
  |  |   67|  8.64k|#define QMF_FILTER_LENGTH (640)
  ------------------
   87|  8.64k|}

ixheaace_ton_corr_param_extr:
   61|   579k|                                  WORD8 *ptr_sbr_scratch, WORD32 is_ld_sbr) {
   62|   579k|  (VOID) ptr_sbr_scratch;
   63|   579k|  WORD32 transient_flag = ptr_trans_info[1];
   64|   579k|  WORD32 transient_pos = ptr_trans_info[0];
   65|   579k|  WORD32 transient_frame_invf_est;
   66|   579k|  ixheaace_invf_mode *pstr_inf_vec_lcl;
   67|   579k|  WORD32 transient_frame = 0;
   68|       |
   69|   579k|  if (pstr_ton_corr->trans_nxt_frame) {
  ------------------
  |  Branch (69:7): [True: 14.9k, False: 564k]
  ------------------
   70|  14.9k|    transient_frame = 1;
   71|  14.9k|    pstr_ton_corr->trans_nxt_frame = 0;
   72|       |
   73|  14.9k|    if ((transient_flag) && (transient_pos + pstr_ton_corr->trans_pos_offset >=
  ------------------
  |  Branch (73:9): [True: 11.7k, False: 3.25k]
  |  Branch (73:29): [True: 5.12k, False: 6.59k]
  ------------------
   74|  11.7k|                             pstr_frame_info->borders[pstr_frame_info->n_envelopes])) {
   75|  5.12k|      pstr_ton_corr->trans_nxt_frame = 1;
   76|  5.12k|    }
   77|   564k|  } else {
   78|   564k|    if (transient_flag) {
  ------------------
  |  Branch (78:9): [True: 136k, False: 428k]
  ------------------
   79|   136k|      if (transient_pos + pstr_ton_corr->trans_pos_offset <
  ------------------
  |  Branch (79:11): [True: 125k, False: 10.0k]
  ------------------
   80|   136k|          pstr_frame_info->borders[pstr_frame_info->n_envelopes]) {
   81|   125k|        transient_frame = 1;
   82|   125k|        pstr_ton_corr->trans_nxt_frame = 0;
   83|   125k|      } else {
   84|  10.0k|        pstr_ton_corr->trans_nxt_frame = 1;
   85|  10.0k|      }
   86|   136k|    }
   87|   564k|  }
   88|   579k|  transient_frame_invf_est = is_ld_sbr ? transient_frame : pstr_ton_corr->trans_nxt_frame;
  ------------------
  |  Branch (88:30): [True: 113k, False: 466k]
  ------------------
   89|   579k|  if (pstr_ton_corr->switch_inverse_filt) {
  ------------------
  |  Branch (89:7): [True: 579k, False: 0]
  ------------------
   90|   579k|    ixheaace_qmf_inverse_filtering_detector(
   91|   579k|        &pstr_ton_corr->sbr_noise_inv_filt, pstr_ton_corr->ptr_quota_mtx,
   92|   579k|        pstr_ton_corr->energy_vec, pstr_ton_corr->idx_vx,
   93|   579k|        pstr_ton_corr->frame_start_index_invf_est,
   94|   579k|        pstr_ton_corr->est_cnt_per_frame + pstr_ton_corr->frame_start_index_invf_est,
   95|   579k|        transient_frame_invf_est, pstr_inf_vec, is_ld_sbr);
   96|   579k|  }
   97|       |
   98|   579k|  if (xpos_type == IXHEAACE_XPOS_LC) {
  ------------------
  |  Branch (98:7): [True: 579k, False: 0]
  ------------------
   99|   579k|    ixheaace_sbr_missing_harmonics_detector_qmf(
  100|   579k|        &pstr_ton_corr->sbr_missing_har_detector, pstr_ton_corr->ptr_quota_mtx,
  101|   579k|        pstr_ton_corr->idx_vx, pstr_frame_info, ptr_trans_info, ptr_missing_harmonic_flag,
  102|   579k|        ptr_missing_harmonic_index, ptr_freq_band_tab, ptr_num_scf, ptr_env_compensation);
  103|   579k|  } else {
  104|      0|    *ptr_missing_harmonic_flag = 0;
  105|      0|    memset(ptr_missing_harmonic_index, 0, ptr_num_scf * sizeof(ptr_missing_harmonic_index[0]));
  106|      0|  }
  107|       |
  108|   579k|  pstr_inf_vec_lcl = pstr_ton_corr->sbr_noise_inv_filt.prev_invf_mode;
  109|       |
  110|   579k|  ixheaace_sbr_noise_floor_estimate_qmf(
  111|   579k|      &pstr_ton_corr->sbr_noise_floor_est, pstr_frame_info, ptr_noise_lvls,
  112|   579k|      pstr_ton_corr->ptr_quota_mtx, pstr_ton_corr->idx_vx, *ptr_missing_harmonic_flag,
  113|   579k|      pstr_ton_corr->frame_start_index, transient_frame, pstr_inf_vec_lcl, is_ld_sbr);
  114|       |
  115|   579k|  memcpy(pstr_ton_corr->sbr_noise_inv_filt.prev_invf_mode, pstr_inf_vec,
  116|   579k|         pstr_ton_corr->sbr_noise_inv_filt.no_detector_bands * sizeof(pstr_inf_vec[0]));
  117|   579k|}
ixheaace_create_ton_corr_param_extr:
  271|  8.64k|                                    ixheaace_str_qmf_tabs *pstr_qmf_tab, WORD32 is_ld_sbr) {
  272|  8.64k|  WORD32 i, loop_cnt;
  273|  8.64k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  8.64k|#define IA_NO_ERROR 0x00000000
  ------------------
  274|       |
  275|  8.64k|  memset(pstr_ton_corr, 0, sizeof(ixheaace_str_sbr_ton_corr_est));
  276|       |
  277|  8.64k|  pstr_ton_corr->est_cnt_per_frame = 2;
  278|       |  /* The code is modified to handle 480 frame size  */
  279|  8.64k|  if (0 == is_ld_sbr) {
  ------------------
  |  Branch (279:7): [True: 6.87k, False: 1.77k]
  ------------------
  280|  6.87k|    pstr_ton_corr->est_cnt = NO_OF_ESTIMATES;
  ------------------
  |  |   71|  6.87k|#define NO_OF_ESTIMATES (4)
  ------------------
  281|  6.87k|    pstr_ton_corr->move = 2;
  282|  6.87k|    pstr_ton_corr->start_index_matrix = 2;
  283|  6.87k|  } else {
  284|  1.77k|    pstr_ton_corr->est_cnt = NO_OF_ESTIMATES_ELD;
  ------------------
  |  |   72|  1.77k|#define NO_OF_ESTIMATES_ELD (3)
  ------------------
  285|  1.77k|    pstr_ton_corr->move = 1;
  286|  1.77k|    pstr_ton_corr->start_index_matrix = 1;
  287|  1.77k|  }
  288|       |
  289|  8.64k|  pstr_ton_corr->frame_start_index_invf_est = 0;
  290|  8.64k|  pstr_ton_corr->trans_pos_offset = 4;
  291|  8.64k|  pstr_ton_corr->frame_start_index = 0;
  292|  8.64k|  pstr_ton_corr->prev_trans_flag = 0;
  293|  8.64k|  pstr_ton_corr->trans_nxt_frame = 0;
  294|  8.64k|  pstr_ton_corr->num_qmf_ch = num_qmf_ch;
  295|  8.64k|  pstr_ton_corr->guard = 0;
  296|  8.64k|  pstr_ton_corr->shift_start_sb = 1;
  297|       |
  298|  8.64k|  loop_cnt = is_ld_sbr ? NO_OF_ESTIMATES : pstr_ton_corr->est_cnt;
  ------------------
  |  |   71|  1.77k|#define NO_OF_ESTIMATES (4)
  ------------------
  |  Branch (298:14): [True: 1.77k, False: 6.87k]
  ------------------
  299|       |
  300|  43.2k|  for (i = 0; i < loop_cnt; i++) {
  ------------------
  |  Branch (300:15): [True: 34.5k, False: 8.64k]
  ------------------
  301|  34.5k|    pstr_ton_corr->ptr_quota_mtx[i] = &(pstr_ton_corr->sbr_quota_mtx[i * num_qmf_ch]);
  302|  34.5k|    memset(pstr_ton_corr->ptr_quota_mtx[i], 0,
  303|  34.5k|           sizeof(pstr_ton_corr->ptr_quota_mtx[0][0]) * num_qmf_ch);
  304|  34.5k|  }
  305|       |
  306|  8.64k|  err_code = ia_enhaacplus_enc_reset_patch(pstr_ton_corr, xpos_ctrl, high_band_start_sb,
  307|  8.64k|                                           ptr_vk_master, num_master, fs, num_qmf_ch);
  308|  8.64k|  if (err_code) {
  ------------------
  |  Branch (308:7): [True: 0, False: 8.64k]
  ------------------
  309|      0|    return err_code;
  310|      0|  }
  311|       |
  312|  8.64k|  err_code = ixheaace_create_sbr_noise_floor_estimate(
  313|  8.64k|      &pstr_ton_corr->sbr_noise_floor_est, ana_max_level, ptr_freq_band_tab[LO], ptr_num_scf[LO],
  ------------------
  |  |  100|  8.64k|#define LO (0)
  ------------------
                    &pstr_ton_corr->sbr_noise_floor_est, ana_max_level, ptr_freq_band_tab[LO], ptr_num_scf[LO],
  ------------------
  |  |  100|  8.64k|#define LO (0)
  ------------------
  314|  8.64k|      noise_groups, use_speech_config, pstr_qmf_tab);
  315|  8.64k|  if (err_code) {
  ------------------
  |  Branch (315:7): [True: 0, False: 8.64k]
  ------------------
  316|      0|    return err_code;
  317|      0|  }
  318|       |
  319|  8.64k|  ixheaace_create_inv_filt_detector(
  320|  8.64k|      &pstr_ton_corr->sbr_noise_inv_filt, pstr_ton_corr->sbr_noise_floor_est.s_freq_qmf_band_tbl,
  321|  8.64k|      pstr_ton_corr->sbr_noise_floor_est.num_of_noise_bands, use_speech_config, pstr_qmf_tab);
  322|       |
  323|  8.64k|  ixheaace_create_sbr_missing_harmonics_detector(
  324|  8.64k|      ch, &pstr_ton_corr->sbr_missing_har_detector, fs, ptr_num_scf[HI], num_qmf_ch,
  ------------------
  |  |  101|  8.64k|#define HI (1)
  ------------------
  325|  8.64k|      pstr_ton_corr->est_cnt, pstr_ton_corr->move, pstr_ton_corr->est_cnt_per_frame,
  326|  8.64k|      ptr_common_buffer);
  327|       |
  328|  8.64k|  return err_code;
  329|  8.64k|}
ixheaace_sbr_ton_corr.c:ia_enhaacplus_enc_reset_patch:
  150|  8.64k|                                                  WORD32 fs, WORD32 num_channels) {
  151|  8.64k|  WORD32 patch, k, i;
  152|  8.64k|  WORD32 target_stop_band;
  153|       |
  154|  8.64k|  ixheaace_patch_param *ptr_patch_param = pstr_ton_corr->str_patch_param;
  155|       |
  156|  8.64k|  WORD32 sb_guard = pstr_ton_corr->guard;
  157|  8.64k|  WORD32 source_start_band;
  158|  8.64k|  WORD32 patch_distance;
  159|  8.64k|  WORD32 num_bands_in_patch;
  160|       |
  161|  8.64k|  WORD32 lsb = ptr_vk_master[0];
  162|  8.64k|  WORD32 usb = ptr_vk_master[num_master];
  163|  8.64k|  WORD32 xover_offset = high_band_start_sb - ptr_vk_master[0];
  164|       |
  165|  8.64k|  WORD32 goal_sb;
  166|       |
  167|  8.64k|  if (xpos_ctrl == 1) {
  ------------------
  |  Branch (167:7): [True: 0, False: 8.64k]
  ------------------
  168|      0|    lsb += xover_offset;
  169|      0|    xover_offset = 0;
  170|      0|  }
  171|       |
  172|  8.64k|  goal_sb = (WORD32)(2 * num_channels * 16000.0f / fs + 0.5f);
  173|  8.64k|  goal_sb = ia_enhaacplus_enc_find_closest_entry(goal_sb, ptr_vk_master, num_master, 1);
  174|       |
  175|  8.64k|  source_start_band = pstr_ton_corr->shift_start_sb + xover_offset;
  176|       |
  177|  8.64k|  target_stop_band = lsb + xover_offset;
  178|       |
  179|  8.64k|  patch = 0;
  180|       |
  181|  28.8k|  while (target_stop_band < usb) {
  ------------------
  |  Branch (181:10): [True: 20.2k, False: 8.64k]
  ------------------
  182|  20.2k|    if (patch >= IXHEAACE_MAXIMUM_NUM_PATCHES) {
  ------------------
  |  |   23|  20.2k|#define IXHEAACE_MAXIMUM_NUM_PATCHES (6)
  ------------------
  |  Branch (182:9): [True: 0, False: 20.2k]
  ------------------
  183|      0|      return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_NUM_PATCH;
  184|      0|    }
  185|       |
  186|  20.2k|    ptr_patch_param[patch].guard_start_band = target_stop_band;
  187|       |
  188|  20.2k|    target_stop_band += sb_guard;
  189|       |
  190|  20.2k|    ptr_patch_param[patch].target_start_band = target_stop_band;
  191|       |
  192|  20.2k|    num_bands_in_patch = goal_sb - target_stop_band;
  193|       |
  194|  20.2k|    if (num_bands_in_patch >= lsb - source_start_band) {
  ------------------
  |  Branch (194:9): [True: 8.37k, False: 11.8k]
  ------------------
  195|  8.37k|      patch_distance = target_stop_band - source_start_band;
  196|       |
  197|  8.37k|      patch_distance = patch_distance & ~1;
  198|       |
  199|  8.37k|      num_bands_in_patch = lsb - (target_stop_band - patch_distance);
  200|       |
  201|  8.37k|      num_bands_in_patch =
  202|  8.37k|          ia_enhaacplus_enc_find_closest_entry(target_stop_band + num_bands_in_patch,
  203|  8.37k|                                               ptr_vk_master, num_master, 0) -
  204|  8.37k|          target_stop_band;
  205|  8.37k|    }
  206|       |
  207|  20.2k|    patch_distance = num_bands_in_patch + target_stop_band - lsb;
  208|       |
  209|  20.2k|    patch_distance = (patch_distance + 1) & ~1;
  210|       |
  211|  20.2k|    if (num_bands_in_patch <= 0) {
  ------------------
  |  Branch (211:9): [True: 0, False: 20.2k]
  ------------------
  212|      0|      patch--;
  213|  20.2k|    } else {
  214|  20.2k|      ptr_patch_param[patch].source_start_band = target_stop_band - patch_distance;
  215|       |
  216|  20.2k|      ptr_patch_param[patch].target_band_offs = patch_distance;
  217|  20.2k|      ptr_patch_param[patch].num_bands_in_patch = num_bands_in_patch;
  218|       |
  219|  20.2k|      ptr_patch_param[patch].source_stop_band =
  220|  20.2k|          ptr_patch_param[patch].source_start_band + num_bands_in_patch;
  221|       |
  222|  20.2k|      target_stop_band += ptr_patch_param[patch].num_bands_in_patch;
  223|  20.2k|    }
  224|       |
  225|  20.2k|    source_start_band = pstr_ton_corr->shift_start_sb;
  226|       |
  227|  20.2k|    if (ixheaac_abs32(target_stop_band - goal_sb) < 3) {
  ------------------
  |  Branch (227:9): [True: 11.8k, False: 8.36k]
  ------------------
  228|  11.8k|      goal_sb = usb;
  229|  11.8k|    }
  230|  20.2k|    patch++;
  231|  20.2k|  }
  232|       |
  233|  8.64k|  patch--;
  234|       |
  235|  8.64k|  if (ptr_patch_param[patch].num_bands_in_patch < 3 && patch > 0) {
  ------------------
  |  Branch (235:7): [True: 0, False: 8.64k]
  |  Branch (235:56): [True: 0, False: 0]
  ------------------
  236|      0|    patch--;
  237|      0|  }
  238|       |
  239|  8.64k|  pstr_ton_corr->no_of_patches = patch + 1;
  240|       |
  241|   188k|  for (k = 0; k < pstr_ton_corr->str_patch_param[0].guard_start_band; k++) {
  ------------------
  |  Branch (241:15): [True: 179k, False: 8.64k]
  ------------------
  242|   179k|    pstr_ton_corr->idx_vx[k] = (WORD8)k;
  243|   179k|  }
  244|       |
  245|  28.8k|  for (i = 0; i < pstr_ton_corr->no_of_patches; i++) {
  ------------------
  |  Branch (245:15): [True: 20.2k, False: 8.64k]
  ------------------
  246|  20.2k|    WORD32 source_start = pstr_ton_corr->str_patch_param[i].source_start_band;
  247|  20.2k|    WORD32 target_start = pstr_ton_corr->str_patch_param[i].target_start_band;
  248|  20.2k|    WORD32 number_of_bands = pstr_ton_corr->str_patch_param[i].num_bands_in_patch;
  249|  20.2k|    WORD32 start_guard_band = pstr_ton_corr->str_patch_param[i].guard_start_band;
  250|       |
  251|  20.2k|    for (k = 0; k < (target_start - start_guard_band); k++) {
  ------------------
  |  Branch (251:17): [True: 0, False: 20.2k]
  ------------------
  252|      0|      pstr_ton_corr->idx_vx[start_guard_band + k] = -1;
  253|      0|    }
  254|       |
  255|   268k|    for (k = 0; k < number_of_bands; k++) {
  ------------------
  |  Branch (255:17): [True: 247k, False: 20.2k]
  ------------------
  256|   247k|      pstr_ton_corr->idx_vx[target_start + k] = (WORD8)(source_start + k);
  257|   247k|    }
  258|  20.2k|  }
  259|       |
  260|  8.64k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  8.64k|#define IA_NO_ERROR 0x00000000
  ------------------
  261|  8.64k|}
ixheaace_sbr_ton_corr.c:ia_enhaacplus_enc_find_closest_entry:
  120|  17.0k|                                                   WORD32 num_master, WORD32 direction) {
  121|  17.0k|  WORD32 index;
  122|       |
  123|  17.0k|  if (goal_sb <= ptr_vk_master[0]) {
  ------------------
  |  Branch (123:7): [True: 0, False: 17.0k]
  ------------------
  124|      0|    return ptr_vk_master[0];
  125|      0|  }
  126|       |
  127|  17.0k|  if (goal_sb >= ptr_vk_master[num_master]) {
  ------------------
  |  Branch (127:7): [True: 5.16k, False: 11.8k]
  ------------------
  128|  5.16k|    return ptr_vk_master[num_master];
  129|  5.16k|  }
  130|       |
  131|  11.8k|  if (direction) {
  ------------------
  |  Branch (131:7): [True: 3.49k, False: 8.36k]
  ------------------
  132|  3.49k|    index = 0;
  133|       |
  134|  43.2k|    while (ptr_vk_master[index] < goal_sb) {
  ------------------
  |  Branch (134:12): [True: 39.7k, False: 3.49k]
  ------------------
  135|  39.7k|      index++;
  136|  39.7k|    }
  137|  8.36k|  } else {
  138|  8.36k|    index = num_master;
  139|  35.9k|    while (ptr_vk_master[index] > goal_sb) {
  ------------------
  |  Branch (139:12): [True: 27.5k, False: 8.36k]
  ------------------
  140|  27.5k|      index--;
  141|  27.5k|    }
  142|  8.36k|  }
  143|       |
  144|  11.8k|  return ptr_vk_master[index];
  145|  17.0k|}

ixheaace_calculate_tonality_quotas:
  120|   579k|                                        WORD32 num_time_slots, WORD32 time_step) {
  121|   579k|  WORD32 i, k, r, time_index;
  122|   579k|  FLOAT32 alphar[2], alphai[2], r01r, r02r, r11r, r12r, r01i, r02i, r12i, det, r00r;
  123|   579k|  ixheaace_acorr_coeffs ac;
  124|   579k|  FLOAT32 *ptr_energy_vec = pstr_ton_corr->energy_vec;
  125|   579k|  FLOAT32 **ptr_quota_mtx = pstr_ton_corr->ptr_quota_mtx;
  126|       |
  127|   579k|  WORD32 start_index_matrix = pstr_ton_corr->start_index_matrix;
  128|   579k|  WORD32 tot_no_est = pstr_ton_corr->est_cnt;
  129|   579k|  WORD32 no_est_per_frame = pstr_ton_corr->est_cnt_per_frame;
  130|   579k|  WORD32 move = pstr_ton_corr->move;
  131|   579k|  WORD32 num_qmf_ch = pstr_ton_corr->num_qmf_ch;
  132|   579k|  WORD32 len;
  133|   579k|  WORD32 qm_len;
  134|  1.62M|  for (i = 0; i < move; i++) {
  ------------------
  |  Branch (134:15): [True: 1.04M, False: 579k]
  ------------------
  135|  1.04M|    memcpy(ptr_quota_mtx[i], ptr_quota_mtx[i + no_est_per_frame],
  136|  1.04M|           num_qmf_ch * sizeof(ptr_quota_mtx[i][0]));
  137|  1.04M|  }
  138|       |
  139|   579k|  memmove(ptr_energy_vec, ptr_energy_vec + no_est_per_frame, move * sizeof(ptr_energy_vec[0]));
  140|   579k|  memset(ptr_energy_vec + start_index_matrix, 0,
  141|   579k|         (tot_no_est - start_index_matrix) * sizeof(ptr_energy_vec[0]));
  142|       |
  143|   579k|  len = (num_time_slots * time_step) / 2;
  144|   579k|  qm_len = 2 + len;
  145|       |
  146|  30.1M|  for (r = 0; r < usb; r++) {
  ------------------
  |  Branch (146:15): [True: 29.5M, False: 579k]
  ------------------
  147|  29.5M|    k = 2;
  148|  29.5M|    time_index = start_index_matrix;
  149|       |
  150|  88.5M|    while (k <= qm_len) {
  ------------------
  |  Branch (150:12): [True: 59.0M, False: 29.5M]
  ------------------
  151|  59.0M|      ixheaace_calc_auto_corr_second_order(&ac, &ptr_real[k], &ptr_imag[k], r, len);
  152|       |
  153|  59.0M|      r00r = ac.r00r;
  154|  59.0M|      r11r = ac.r11r;
  155|  59.0M|      r12r = ac.r12r;
  156|  59.0M|      r12i = ac.r12i;
  157|  59.0M|      r01r = ac.r01r;
  158|  59.0M|      r01i = ac.r01i;
  159|  59.0M|      r02r = ac.r02r;
  160|  59.0M|      r02i = ac.r02i;
  161|  59.0M|      det = ac.det;
  162|       |
  163|  59.0M|      if (det == 0) {
  ------------------
  |  Branch (163:11): [True: 9.40M, False: 49.6M]
  ------------------
  164|  9.40M|        alphar[1] = alphai[1] = 0;
  165|  49.6M|      } else {
  166|  49.6M|        alphar[1] = (r01r * r12r - r01i * r12i - r02r * r11r) / det;
  167|  49.6M|        alphai[1] = (r01i * r12r + r01r * r12i - r02i * r11r) / det;
  168|  49.6M|      }
  169|       |
  170|  59.0M|      if (r11r == 0) {
  ------------------
  |  Branch (170:11): [True: 9.38M, False: 49.6M]
  ------------------
  171|  9.38M|        alphar[0] = alphai[0] = 0;
  172|  49.6M|      } else {
  173|  49.6M|        alphar[0] = -(r01r + alphar[1] * r12r + alphai[1] * r12i) / r11r;
  174|  49.6M|        alphai[0] = -(r01i + alphai[1] * r12r - alphar[1] * r12i) / r11r;
  175|  49.6M|      }
  176|  59.0M|      if (r00r) {
  ------------------
  |  Branch (176:11): [True: 49.2M, False: 9.82M]
  ------------------
  177|  49.2M|        FLOAT32 tmp =
  178|  49.2M|            -(alphar[0] * r01r + alphai[0] * r01i + alphar[1] * r02r + alphai[1] * r02i) / (r00r);
  179|  49.2M|        ptr_quota_mtx[time_index][r] = (FLOAT32)ixheaace_div32(tmp, 1.0f - tmp);
  180|  49.2M|      } else {
  181|  9.82M|        ptr_quota_mtx[time_index][r] = 0;
  182|  9.82M|      }
  183|  59.0M|      ptr_energy_vec[time_index] += r00r;
  184|       |
  185|  59.0M|      k += len;
  186|       |
  187|  59.0M|      time_index++;
  188|  59.0M|    }
  189|  29.5M|  }
  190|   579k|}
ixheaace_sbr_ton_corr_hp.c:ixheaace_calc_auto_corr_second_order:
   57|  59.0M|                                                 WORD32 bd, WORD32 len) {
   58|  59.0M|  WORD32 j, jminus1, jminus2;
   59|  59.0M|  float rel = 1.0f / (1.0f + RELAXATION);
  ------------------
  |  |   35|  59.0M|#define RELAXATION (1e-6f)
  ------------------
   60|       |
   61|  59.0M|  memset(pstr_ac, 0, sizeof(ixheaace_acorr_coeffs));
   62|       |
   63|   835M|  for (j = 0; j < (len - 2 - 1); j++) {
  ------------------
  |  Branch (63:15): [True: 776M, False: 59.0M]
  ------------------
   64|   776M|    jminus1 = j - 1;
   65|   776M|    jminus2 = jminus1 - 1;
   66|       |
   67|   776M|    pstr_ac->r00r += ptr_real[j][bd] * ptr_real[j][bd] + ptr_imag[j][bd] * ptr_imag[j][bd];
   68|       |
   69|   776M|    pstr_ac->r11r += ptr_real[jminus1][bd] * ptr_real[jminus1][bd] +
   70|   776M|                     ptr_imag[jminus1][bd] * ptr_imag[jminus1][bd];
   71|       |
   72|   776M|    pstr_ac->r01r +=
   73|   776M|        ptr_real[j][bd] * ptr_real[jminus1][bd] + ptr_imag[j][bd] * ptr_imag[jminus1][bd];
   74|       |
   75|   776M|    pstr_ac->r01i +=
   76|   776M|        ptr_imag[j][bd] * ptr_real[jminus1][bd] - ptr_real[j][bd] * ptr_imag[jminus1][bd];
   77|       |
   78|   776M|    pstr_ac->r02r +=
   79|   776M|        ptr_real[j][bd] * ptr_real[jminus2][bd] + ptr_imag[j][bd] * ptr_imag[jminus2][bd];
   80|       |
   81|   776M|    pstr_ac->r02i +=
   82|   776M|        ptr_imag[j][bd] * ptr_real[jminus2][bd] - ptr_real[j][bd] * ptr_imag[jminus2][bd];
   83|   776M|  }
   84|       |
   85|  59.0M|  pstr_ac->r22r =
   86|  59.0M|      pstr_ac->r11r + ptr_real[-2][bd] * ptr_real[-2][bd] + ptr_imag[-2][bd] * ptr_imag[-2][bd];
   87|       |
   88|  59.0M|  pstr_ac->r12r =
   89|  59.0M|      pstr_ac->r01r + ptr_real[-1][bd] * ptr_real[-2][bd] + ptr_imag[-1][bd] * ptr_imag[-2][bd];
   90|       |
   91|  59.0M|  pstr_ac->r12i =
   92|  59.0M|      pstr_ac->r01i + ptr_imag[-1][bd] * ptr_real[-2][bd] - ptr_real[-1][bd] * ptr_imag[-2][bd];
   93|       |
   94|  59.0M|  jminus1 = j - 1;
   95|  59.0M|  jminus2 = jminus1 - 1;
   96|       |
   97|  59.0M|  pstr_ac->r00r += ptr_real[j][bd] * ptr_real[j][bd] + ptr_imag[j][bd] * ptr_imag[j][bd];
   98|       |
   99|  59.0M|  pstr_ac->r11r += ptr_real[jminus1][bd] * ptr_real[jminus1][bd] +
  100|  59.0M|                   ptr_imag[jminus1][bd] * ptr_imag[jminus1][bd];
  101|       |
  102|  59.0M|  pstr_ac->r01r +=
  103|  59.0M|      ptr_real[j][bd] * ptr_real[jminus1][bd] + ptr_imag[j][bd] * ptr_imag[jminus1][bd];
  104|       |
  105|  59.0M|  pstr_ac->r01i +=
  106|  59.0M|      ptr_imag[j][bd] * ptr_real[jminus1][bd] - ptr_real[j][bd] * ptr_imag[jminus1][bd];
  107|       |
  108|  59.0M|  pstr_ac->r02r +=
  109|  59.0M|      ptr_real[j][bd] * ptr_real[jminus2][bd] + ptr_imag[j][bd] * ptr_imag[jminus2][bd];
  110|       |
  111|  59.0M|  pstr_ac->r02i +=
  112|  59.0M|      ptr_imag[j][bd] * ptr_real[jminus2][bd] - ptr_real[j][bd] * ptr_imag[jminus2][bd];
  113|       |
  114|  59.0M|  pstr_ac->det = pstr_ac->r11r * pstr_ac->r22r -
  115|  59.0M|                 rel * (pstr_ac->r12r * pstr_ac->r12r + pstr_ac->r12i * pstr_ac->r12i);
  116|  59.0M|}

ixheaace_add_lowband_energies:
   90|   432k|                                      WORD32 time_slots, WORD32 is_ld_sbr, WORD32 time_step) {
   91|   432k|  WORD32 band, ts;
   92|   432k|  FLOAT32 energy = 1.0f;
   93|   432k|  WORD32 tran_offset = 0;
   94|   432k|  if (is_ld_sbr) {
  ------------------
  |  Branch (94:7): [True: 76.4k, False: 355k]
  ------------------
   95|  76.4k|    tran_offset = 7;
   96|  76.4k|    energy = 0.0f;
   97|   355k|  } else {
   98|   355k|    tran_offset = time_slots / 2;
   99|   355k|  }
  100|       |
  101|  7.31M|  for (ts = tran_offset; ts < time_slots + tran_offset; ts++) {
  ------------------
  |  Branch (101:26): [True: 6.88M, False: 432k]
  ------------------
  102|   152M|    for (band = 0; band < ptr_freq_band_tab[0]; band++) {
  ------------------
  |  Branch (102:20): [True: 146M, False: 6.88M]
  ------------------
  103|   146M|      energy += ptr_energies[ts][band];
  104|   146M|    }
  105|  6.88M|  }
  106|       |
  107|   432k|  energy *= time_step;
  108|       |
  109|   432k|  return energy;
  110|   432k|}
ixheaace_frame_splitter:
  147|   432k|                        FLOAT32 *ptr_frame_splitter_scratch, WORD32 is_ld_sbr) {
  148|   432k|  WORD32 border, i;
  149|   432k|  WORD32 num_sbr_slots = no_cols / time_step;
  150|   432k|  FLOAT32 *ptr_energies_m[16] = {0};
  151|   432k|  FLOAT32 low_band_energy, high_band_energy, total_energy;
  152|   432k|  FLOAT32 delta = 0.0f;
  153|   432k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   432k|#define IA_NO_ERROR 0x00000000
  ------------------
  154|       |
  155|   432k|  if ((num_sbr_slots <= 0) || (num_sbr_slots * time_step != no_cols)) {
  ------------------
  |  Branch (155:7): [True: 0, False: 432k]
  |  Branch (155:31): [True: 0, False: 432k]
  ------------------
  156|      0|    return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_TIME_SLOTS;
  157|      0|  }
  158|       |
  159|   432k|  memset(ptr_frame_splitter_scratch, 0,
  160|   432k|         sizeof(ptr_energies_m[0][0]) * MAXIMUM_FREQ_COEFFS * num_sbr_slots);
  ------------------
  |  |   83|   432k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|   432k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  161|       |
  162|  7.31M|  for (i = 0; i < num_sbr_slots; i++) {
  ------------------
  |  Branch (162:15): [True: 6.88M, False: 432k]
  ------------------
  163|  6.88M|    ptr_energies_m[i] = ptr_frame_splitter_scratch;
  164|  6.88M|    ptr_frame_splitter_scratch += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  6.88M|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  6.88M|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  165|  6.88M|  }
  166|       |
  167|   432k|  low_band_energy = ixheaace_add_lowband_energies(ptr_energies, ptr_freq_band_tab, num_sbr_slots,
  168|   432k|                                                  is_ld_sbr, time_step);
  169|       |
  170|   432k|  high_band_energy =
  171|   432k|      ixheaace_add_highband_energies(ptr_energies, ptr_energies_m, ptr_freq_band_tab, num_scf,
  172|   432k|                                     num_sbr_slots, time_step, is_ld_sbr);
  173|   432k|  border = (num_sbr_slots + 1) >> 1;
  174|       |
  175|   432k|  total_energy = 0.5f * (low_band_energy + pstr_sbr_trans_detector->prev_low_band_energy);
  176|   432k|  total_energy += high_band_energy;
  177|   432k|  if ((total_energy > IXHEAACE_SBR_ENERGY_THRESHOLD) || (!is_ld_sbr)) {
  ------------------
  |  |   25|   432k|#define IXHEAACE_SBR_ENERGY_THRESHOLD (65536 * 31)
  ------------------
  |  Branch (177:7): [True: 216k, False: 216k]
  |  Branch (177:57): [True: 188k, False: 27.4k]
  ------------------
  178|   404k|    err_code = ixheaace_spectral_change(ptr_energies_m, total_energy, num_scf, 0, border,
  179|   404k|                                        num_sbr_slots, is_ld_sbr, &delta);
  180|   404k|    if (err_code) {
  ------------------
  |  Branch (180:9): [True: 0, False: 404k]
  ------------------
  181|      0|      return err_code;
  182|      0|    }
  183|   404k|  } else if (is_ld_sbr) {
  ------------------
  |  Branch (183:14): [True: 27.4k, False: 0]
  ------------------
  184|  27.4k|    delta = 0;
  185|  27.4k|  }
  186|       |
  187|   432k|  if (delta > pstr_sbr_trans_detector->split_thr) {
  ------------------
  |  Branch (187:7): [True: 44.3k, False: 387k]
  ------------------
  188|  44.3k|    ptr_tran_vector[0] = 1;
  189|   387k|  } else {
  190|   387k|    ptr_tran_vector[0] = 0;
  191|   387k|  }
  192|   432k|  pstr_sbr_trans_detector->prev_low_band_energy = low_band_energy;
  193|   432k|  return err_code;
  194|   432k|}
ixheaace_create_sbr_transient_detector:
  200|  8.64k|    ixheaace_sbr_codec_type sbr_codec, WORD32 start_band) {
  201|  8.64k|  WORD32 no_cols = 32, buffer_length = 96;
  202|  8.64k|  FLOAT32 br_fac;
  203|  8.64k|  FLOAT32 frm_dur = 2048.0f / (FLOAT32)sample_freq;
  204|  8.64k|  FLOAT32 split_thr_fac = frm_dur - 0.01f;
  205|  8.64k|  if ((sbr_codec == USAC_SBR) && (sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1)) {
  ------------------
  |  |  188|  3.97k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (205:7): [True: 3.97k, False: 4.66k]
  |  Branch (205:34): [True: 826, False: 3.14k]
  ------------------
  206|    826|    frm_dur = frm_dur * 2;
  207|    826|    split_thr_fac = frm_dur - 0.01f;
  208|    826|    no_cols = 64;
  209|    826|  }
  210|  8.64k|  if ((1 == is_ld_sbr) && (1 == frame_flag_480)) {
  ------------------
  |  Branch (210:7): [True: 1.77k, False: 6.87k]
  |  Branch (210:27): [True: 806, False: 965]
  ------------------
  211|    806|    no_cols = 30;
  212|    806|    buffer_length = 90;
  213|    806|  }
  214|       |
  215|  8.64k|  memset(pstr_sbr_trans_detector, 0, sizeof(ixheaace_str_sbr_trans_detector));
  216|       |
  217|  8.64k|  br_fac = codec_bitrate ? (FLOAT32)total_bitrate / (FLOAT32)codec_bitrate : 1.0f;
  ------------------
  |  Branch (217:12): [True: 8.64k, False: 0]
  ------------------
  218|       |
  219|  8.64k|  split_thr_fac = MAX(split_thr_fac, 0.0001f);
  ------------------
  |  |   24|  8.64k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 8.64k, False: 0]
  |  |  ------------------
  ------------------
  220|  8.64k|  split_thr_fac = 0.000075f / (split_thr_fac * split_thr_fac);
  221|       |
  222|  8.64k|  pstr_sbr_trans_detector->split_thr = split_thr_fac * br_fac;
  223|       |
  224|  8.64k|  if (is_ld_sbr) {
  ------------------
  |  Branch (224:7): [True: 1.77k, False: 6.87k]
  ------------------
  225|  1.77k|    WORD32 i;
  226|  1.77k|    FLOAT32 ratio = ((sample_freq / 2) / IXHEAACE_QMF_CHANNELS) * 0.00075275f;
  ------------------
  |  |   66|  1.77k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  227|       |
  228|  1.77k|    FLOAT32 tmp = 1024.0f / sample_freq;
  229|  1.77k|    tmp -= 0.01f;
  230|  1.77k|    tmp = MAX(tmp, 0.001f);
  ------------------
  |  |   24|  1.77k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.77k, False: 0]
  |  |  ------------------
  ------------------
  231|       |
  232|  1.77k|    if (1 == frame_flag_480) {
  ------------------
  |  Branch (232:9): [True: 806, False: 965]
  ------------------
  233|    806|      no_cols = 30;
  234|    806|      buffer_length = 90;
  235|    806|    }
  236|  1.77k|    pstr_sbr_trans_detector->split_thr = (br_fac * 0.000075f) / (tmp * tmp) / 2.0f;
  237|  1.77k|    pstr_sbr_trans_detector->look_ahead = 2;
  238|  1.77k|    pstr_sbr_trans_detector->time_slots = no_cols / 2;
  239|  1.77k|    pstr_sbr_trans_detector->buffer_size =
  240|  1.77k|        pstr_sbr_trans_detector->look_ahead + pstr_sbr_trans_detector->time_slots;
  241|  1.77k|    pstr_sbr_trans_detector->stop_band =
  242|  1.77k|        (WORD32)fmin(13500 / ((sample_freq >> 1) / IXHEAACE_QMF_CHANNELS), IXHEAACE_QMF_CHANNELS);
  ------------------
  |  |   66|  1.77k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                      (WORD32)fmin(13500 / ((sample_freq >> 1) / IXHEAACE_QMF_CHANNELS), IXHEAACE_QMF_CHANNELS);
  ------------------
  |  |   66|  1.77k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  243|  1.77k|    pstr_sbr_trans_detector->start_band =
  244|  1.77k|        (WORD32)fmin(start_band, pstr_sbr_trans_detector->stop_band - 4);
  245|       |
  246|  1.77k|    memset(pstr_sbr_trans_detector->energy, 0,
  247|  1.77k|           pstr_sbr_trans_detector->buffer_size * sizeof(pstr_sbr_trans_detector->energy[0]));
  248|  1.77k|    memset(pstr_sbr_trans_detector->sbr_transients, 0,
  249|  1.77k|           pstr_sbr_trans_detector->buffer_size *
  250|  1.77k|               sizeof(pstr_sbr_trans_detector->sbr_transients[0]));
  251|  1.77k|    memset(
  252|  1.77k|        pstr_sbr_trans_detector->delta_energy, 0,
  253|  1.77k|        pstr_sbr_trans_detector->buffer_size * sizeof(pstr_sbr_trans_detector->delta_energy[0]));
  254|       |
  255|   115k|    for (i = 0; i < 64; i++) {
  ------------------
  |  Branch (255:17): [True: 113k, False: 1.77k]
  ------------------
  256|   113k|      pstr_sbr_trans_detector->coeff[i] = (FLOAT32)pow(2.0, ratio * (i + 1));
  257|   113k|    }
  258|  1.77k|  }
  259|  8.64k|  pstr_sbr_trans_detector->no_cols = no_cols;
  260|  8.64k|  pstr_sbr_trans_detector->tran_fc = tran_fc;
  261|       |
  262|  8.64k|  pstr_sbr_trans_detector->buffer_length = buffer_length;
  263|       |
  264|  8.64k|  pstr_sbr_trans_detector->no_rows = 64;
  265|  8.64k|  pstr_sbr_trans_detector->mode = mode;
  266|       |
  267|  8.64k|  pstr_sbr_trans_detector->prev_low_band_energy = 0;
  268|  8.64k|  pstr_sbr_trans_detector->tran_thr = (FLOAT32)tran_thr;
  269|       |
  270|  8.64k|  pstr_sbr_trans_detector->ptr_thresholds = &(pstr_sbr_trans_detector->sbr_thresholds[0]);
  271|       |
  272|  8.64k|  memset(pstr_sbr_trans_detector->ptr_thresholds, 0,
  273|  8.64k|         sizeof(pstr_sbr_trans_detector->ptr_thresholds[0]) * IXHEAACE_QMF_CHANNELS);
  ------------------
  |  |   66|  8.64k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  274|       |
  275|  8.64k|  pstr_sbr_trans_detector->ptr_transients = &(pstr_sbr_trans_detector->sbr_transients[0]);
  276|  8.64k|  memset(pstr_sbr_trans_detector->ptr_transients, 0,
  277|  8.64k|         sizeof(pstr_sbr_trans_detector->ptr_transients[0]) *
  278|  8.64k|             pstr_sbr_trans_detector->buffer_length);
  279|  8.64k|}
ixheaace_sbr_tran_det.c:ixheaace_add_highband_energies:
  115|   432k|                                              WORD32 is_ld_sbr) {
  116|   432k|  WORD32 band, ts, sfb, low_band, high_band;
  117|   432k|  FLOAT32 energy = 1.0f, tmp;
  118|   432k|  if (is_ld_sbr) {
  ------------------
  |  Branch (118:7): [True: 76.4k, False: 355k]
  ------------------
  119|  76.4k|    energy = 0.0f;
  120|  76.4k|  }
  121|  7.31M|  for (ts = 0; ts < time_slots; ts++) {
  ------------------
  |  Branch (121:16): [True: 6.88M, False: 432k]
  ------------------
  122|  96.2M|    for (sfb = 0; sfb < num_sfb; sfb++) {
  ------------------
  |  Branch (122:19): [True: 89.4M, False: 6.88M]
  ------------------
  123|  89.4M|      tmp = 0;
  124|  89.4M|      low_band = ptr_freq_band_tab[sfb];
  125|  89.4M|      high_band = ptr_freq_band_tab[sfb + 1];
  126|  89.4M|      band = low_band;
  127|   295M|      while (band < high_band) {
  ------------------
  |  Branch (127:14): [True: 205M, False: 89.4M]
  ------------------
  128|   205M|        tmp += (ptr_energies[ts][band] * time_step);
  129|   205M|        band++;
  130|   205M|      }
  131|  89.4M|      ptr_energies_m[ts][sfb] = tmp;
  132|  89.4M|      if (is_ld_sbr || time_step == 4) {
  ------------------
  |  Branch (132:11): [True: 16.5M, False: 72.8M]
  |  Branch (132:24): [True: 15.5M, False: 57.3M]
  ------------------
  133|  32.1M|        energy += tmp;
  134|  57.3M|      } else {
  135|  57.3M|        energy += ptr_energies[ts][sfb];
  136|  57.3M|      }
  137|  89.4M|    }
  138|  6.88M|  }
  139|   432k|  return energy;
  140|   432k|}
ixheaace_sbr_tran_det.c:ixheaace_spectral_change:
   44|   404k|                                             WORD32 stop, WORD32 is_ld_sbr, FLOAT32 *ptr_delta) {
   45|   404k|  WORD32 i, j;
   46|   404k|  WORD32 len1 = border - start;
   47|   404k|  WORD32 len2 = stop - border;
   48|   404k|  FLOAT32 energy_1[MAXIMUM_FREQ_COEFFS] = {0};
   49|   404k|  FLOAT32 energy_2[MAXIMUM_FREQ_COEFFS] = {0};
   50|   404k|  FLOAT32 len_ratio = (FLOAT32)len1 / (FLOAT32)(len2);
   51|   404k|  FLOAT32 delta, delta_sum = 0.0f;
   52|   404k|  FLOAT32 pos_wt = (0.5f - (FLOAT32)len1 / (FLOAT32)(len1 + len2));
   53|   404k|  pos_wt = 1.0f - 4.0f * pos_wt * pos_wt;
   54|       |
   55|   404k|  if (total_energy < SBR_EPS) {
  ------------------
  |  |   39|   404k|#define SBR_EPS (1e-18)
  ------------------
  |  Branch (55:7): [True: 0, False: 404k]
  ------------------
   56|      0|    *ptr_delta = 0.0f;
   57|      0|    return IA_NO_ERROR;
  ------------------
  |  |   23|      0|#define IA_NO_ERROR 0x00000000
  ------------------
   58|      0|  }
   59|       |
   60|   404k|  if (!is_ld_sbr) {
  ------------------
  |  Branch (60:7): [True: 355k, False: 48.9k]
  ------------------
   61|  4.91M|    for (j = 0; j < num_sfb; j++) {
  ------------------
  |  Branch (61:17): [True: 4.55M, False: 355k]
  ------------------
   62|  4.55M|      energy_1[j] = 1.0e6f * len1;
   63|  4.55M|      energy_2[j] = 1.0e6f * len2;
   64|  4.55M|    }
   65|   355k|  }
   66|       |
   67|  5.64M|  for (j = 0; j < num_sfb; j++) {
  ------------------
  |  Branch (67:15): [True: 5.23M, False: 404k]
  ------------------
   68|  47.1M|    for (i = start; i < border; i++) {
  ------------------
  |  Branch (68:21): [True: 41.9M, False: 5.23M]
  ------------------
   69|  41.9M|      energy_1[j] += ptr_energies[i][j];
   70|  41.9M|    }
   71|       |
   72|  46.8M|    for (i = border; i < stop; i++) {
  ------------------
  |  Branch (72:22): [True: 41.6M, False: 5.23M]
  ------------------
   73|  41.6M|      energy_2[j] += ptr_energies[i][j];
   74|  41.6M|    }
   75|  5.23M|    if (energy_1[j] <= EPS) {
  ------------------
  |  |   33|  5.23M|#define EPS (1e-18)
  ------------------
  |  Branch (75:9): [True: 3.93k, False: 5.23M]
  ------------------
   76|  3.93k|      energy_1[j] = (FLOAT32)len1;
   77|  3.93k|    }
   78|  5.23M|    if (energy_2[j] <= EPS) {
  ------------------
  |  |   33|  5.23M|#define EPS (1e-18)
  ------------------
  |  Branch (78:9): [True: 38.1k, False: 5.20M]
  ------------------
   79|  38.1k|      energy_2[j] = (FLOAT32)len2;
   80|  38.1k|    }
   81|  5.23M|    delta = (FLOAT32)fabs(log((energy_2[j] / energy_1[j]) * len_ratio));
   82|  5.23M|    delta_sum += (FLOAT32)(sqrt((energy_1[j] + energy_2[j]) / total_energy) * delta);
   83|  5.23M|  }
   84|       |
   85|   404k|  *ptr_delta = delta_sum * pos_wt;
   86|   404k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   404k|#define IA_NO_ERROR 0x00000000
  ------------------
   87|   404k|}

ixheaace_detect_transient:
  137|   401k|                               ixheaace_sbr_codec_type sbr_codec) {
  138|   401k|  WORD32 i;
  139|   401k|  WORD32 no_cols = pstr_sbr_trans_det->no_cols;
  140|   401k|  WORD32 qmf_start_sample = no_cols + time_step * 4;
  141|   401k|  FLOAT32 int_thr = (FLOAT32)pstr_sbr_trans_det->tran_thr / (FLOAT32)pstr_sbr_trans_det->no_rows;
  142|   401k|  FLOAT32 *ptr_trans = &(pstr_sbr_trans_det->ptr_transients[qmf_start_sample]);
  143|       |
  144|   401k|  ptr_tran_vector[0] = 0;
  145|   401k|  ptr_tran_vector[1] = 0;
  146|       |
  147|   401k|  ixheaace_calc_thresholds(ptr_energies, pstr_sbr_trans_det->no_cols, pstr_sbr_trans_det->no_rows,
  148|   401k|                           pstr_sbr_trans_det->ptr_thresholds, sbr_codec);
  149|       |
  150|   401k|  ixheaace_extract_transient_candidates(
  151|   401k|      ptr_energies, pstr_sbr_trans_det->ptr_thresholds, pstr_sbr_trans_det->ptr_transients,
  152|   401k|      pstr_sbr_trans_det->no_cols, 0, pstr_sbr_trans_det->no_rows,
  153|   401k|      pstr_sbr_trans_det->buffer_length);
  154|       |
  155|  11.4M|  for (i = 0; i < no_cols; i++) {
  ------------------
  |  Branch (155:15): [True: 11.1M, False: 295k]
  ------------------
  156|  11.1M|    if ((ptr_trans[i] < 0.9f * ptr_trans[i - 1]) && (ptr_trans[i - 1] > int_thr)) {
  ------------------
  |  Branch (156:9): [True: 331k, False: 10.8M]
  |  Branch (156:53): [True: 105k, False: 225k]
  ------------------
  157|   105k|      ptr_tran_vector[0] = (WORD32)floor(i / time_step);
  158|   105k|      ptr_tran_vector[1] = 1;
  159|   105k|      break;
  160|   105k|    }
  161|  11.1M|  }
  162|   401k|}
ixheaace_detect_transient_4_1:
  235|  64.9k|                                   WORD32 *ptr_tran_vector, WORD32 time_step) {
  236|  64.9k|  WORD32 i;
  237|  64.9k|  WORD32 no_cols = pstr_sbr_trans_det->no_cols;
  238|  64.9k|  WORD32 qmf_start_sample = time_step * 4;
  239|  64.9k|  FLOAT32 int_thr = (FLOAT32)pstr_sbr_trans_det->tran_thr / (FLOAT32)pstr_sbr_trans_det->no_rows;
  240|  64.9k|  FLOAT32 *ptr_trans = &(pstr_sbr_trans_det->ptr_transients[qmf_start_sample]);
  241|       |
  242|  64.9k|  ptr_tran_vector[0] = 0;
  243|  64.9k|  ptr_tran_vector[1] = 0;
  244|       |
  245|  64.9k|  ixheaace_calc_thresholds_4_1(ptr_energies, pstr_sbr_trans_det->no_cols,
  246|  64.9k|                               pstr_sbr_trans_det->no_rows, pstr_sbr_trans_det->ptr_thresholds,
  247|  64.9k|                               time_step);
  248|       |
  249|  64.9k|  ixheaace_extract_transient_candidates_4_1(
  250|  64.9k|      ptr_energies, pstr_sbr_trans_det->ptr_thresholds, pstr_sbr_trans_det->ptr_transients,
  251|  64.9k|      pstr_sbr_trans_det->no_cols, 0, pstr_sbr_trans_det->no_rows, time_step);
  252|       |
  253|  4.08M|  for (i = 0; i < no_cols; i++) {
  ------------------
  |  Branch (253:15): [True: 4.02M, False: 60.0k]
  ------------------
  254|  4.02M|    if ((ptr_trans[i] < 0.9f * ptr_trans[i - 1]) && (ptr_trans[i - 1] > int_thr)) {
  ------------------
  |  Branch (254:9): [True: 13.9k, False: 4.00M]
  |  Branch (254:53): [True: 4.89k, False: 9.05k]
  ------------------
  255|  4.89k|      ptr_tran_vector[0] = (WORD32)floor(i / time_step);
  256|  4.89k|      ptr_tran_vector[1] = 1;
  257|  4.89k|      break;
  258|  4.89k|    }
  259|  4.02M|  }
  260|  64.9k|}
ixheaace_detect_transient_eld:
  264|   113k|                                   WORD32 *ptr_tran_vector) {
  265|   113k|  WORD32 i, band;
  266|   113k|  WORD32 max_idx = 0, is_transient = 0;
  267|   113k|  FLOAT32 delta_max = 0, tmp, min_energy;
  268|   113k|  WORD32 num_slots = pstr_sbr_trans_det->time_slots;
  269|   113k|  WORD32 look_ahead = pstr_sbr_trans_det->look_ahead;
  270|   113k|  WORD32 start_band = pstr_sbr_trans_det->start_band;
  271|   113k|  WORD32 stop_band = pstr_sbr_trans_det->stop_band;
  272|   113k|  FLOAT32 *ptr_energy = pstr_sbr_trans_det->energy;
  273|   113k|  FLOAT32 *ptr_delta_energy = pstr_sbr_trans_det->delta_energy;
  274|   113k|  FLOAT32 *ptr_transients = pstr_sbr_trans_det->ptr_transients;
  275|   113k|  WORD32 ts = look_ahead;
  276|   113k|  FLOAT32 weighted_energy;
  277|       |
  278|   113k|  ptr_tran_vector[0] = ptr_tran_vector[1] = 0;
  279|   113k|  ptr_tran_vector[2] = 0;
  280|       |
  281|   113k|  memset(ptr_transients + look_ahead, 0, num_slots * sizeof(ptr_transients[0]));
  282|       |
  283|  1.88M|  while (ts < num_slots + look_ahead) {
  ------------------
  |  Branch (283:10): [True: 1.77M, False: 113k]
  ------------------
  284|  1.77M|    tmp = 0.0f;
  285|  1.77M|    max_idx = 0;
  286|  1.77M|    delta_max = 0;
  287|  1.77M|    is_transient = 0;
  288|  1.77M|    i = 0;
  289|  1.77M|    band = start_band;
  290|       |
  291|  39.8M|    while (band < stop_band) {
  ------------------
  |  Branch (291:12): [True: 38.1M, False: 1.77M]
  ------------------
  292|  38.1M|      tmp += (ptr_energies[ts][band] * pstr_sbr_trans_det->coeff[i]);
  293|  38.1M|      band++;
  294|  38.1M|      i++;
  295|  38.1M|    }
  296|       |
  297|  1.77M|    ptr_energy[ts] = tmp;
  298|  1.77M|    min_energy = (ptr_energy[ts - 1]) + IXHEAACE_SMALL_ENERGY;
  ------------------
  |  |   28|  1.77M|#define IXHEAACE_SMALL_ENERGY (1e-2f)
  ------------------
  299|  1.77M|    ptr_delta_energy[ts] = ptr_energy[ts] / min_energy;
  300|       |
  301|  1.77M|    weighted_energy = ptr_energy[ts] * (1.0f / 1.4f);
  302|       |
  303|  1.77M|    if ((ptr_delta_energy[ts] >= IXHEAACE_TRANSIENT_THRESHOLD) &&
  ------------------
  |  |   27|  1.77M|#define IXHEAACE_TRANSIENT_THRESHOLD (5.0f)
  ------------------
  |  Branch (303:9): [True: 52.4k, False: 1.72M]
  ------------------
  304|  52.4k|        (((ptr_transients[ts - 2] == 0) && (ptr_transients[ts - 1] == 0)) ||
  ------------------
  |  Branch (304:11): [True: 50.9k, False: 1.42k]
  |  Branch (304:44): [True: 43.3k, False: 7.68k]
  ------------------
  305|  52.4k|         (weighted_energy >= ptr_energy[ts - 1]) || (weighted_energy >= ptr_energy[ts - 2]))) {
  ------------------
  |  Branch (305:10): [True: 9.10k, False: 0]
  |  Branch (305:53): [True: 0, False: 0]
  ------------------
  306|  52.4k|      ptr_transients[ts] = 1;
  307|  52.4k|    }
  308|       |
  309|  1.77M|    ts++;
  310|  1.77M|  }
  311|       |
  312|  1.88M|  for (ts = 0; ts < num_slots; ts++) {
  ------------------
  |  Branch (312:16): [True: 1.77M, False: 113k]
  ------------------
  313|  1.77M|    if (ptr_transients[ts] && (ptr_delta_energy[ts] > delta_max)) {
  ------------------
  |  Branch (313:9): [True: 52.3k, False: 1.72M]
  |  Branch (313:31): [True: 40.4k, False: 11.8k]
  ------------------
  314|  40.4k|      delta_max = ptr_delta_energy[ts];
  315|  40.4k|      max_idx = ts;
  316|  40.4k|      is_transient = 1;
  317|  40.4k|    }
  318|  1.77M|  }
  319|       |
  320|   113k|  if (is_transient) {
  ------------------
  |  Branch (320:7): [True: 37.4k, False: 76.4k]
  ------------------
  321|  37.4k|    ptr_tran_vector[0] = max_idx;
  322|  37.4k|    ptr_tran_vector[1] = 1;
  323|  37.4k|  }
  324|       |
  325|   341k|  for (ts = 0; ts < look_ahead; ts++) {
  ------------------
  |  Branch (325:16): [True: 227k, False: 113k]
  ------------------
  326|   227k|    if (ptr_transients[ts + num_slots]) {
  ------------------
  |  Branch (326:9): [True: 2.69k, False: 225k]
  ------------------
  327|  2.69k|      ptr_tran_vector[2] = 1;
  328|  2.69k|    }
  329|   227k|    ptr_energy[ts] = ptr_energy[num_slots + ts];
  330|   227k|    ptr_transients[ts] = ptr_transients[num_slots + ts];
  331|   227k|    ptr_delta_energy[ts] = ptr_delta_energy[num_slots + ts];
  332|   227k|  }
  333|   113k|}
ixheaace_sbr_tran_det_hp.c:ixheaace_calc_thresholds:
   41|   401k|                                     FLOAT32 *ptr_thresholds, ixheaace_sbr_codec_type sbr_codec) {
   42|   401k|  FLOAT32 mean_val, std_val, thr;
   43|   401k|  FLOAT32 *ptr_energy;
   44|   401k|  FLOAT32 inv_num_cols = 1.0f / (FLOAT32)(num_cols + num_cols / 2);
   45|   401k|  FLOAT32 inv_num_cols_1 = 1.0f / (FLOAT32)(num_cols + num_cols / 2 - 1);
   46|       |
   47|   401k|  WORD32 i = 0;
   48|   401k|  WORD32 j;
   49|       |
   50|  26.0M|  while (i < num_rows) {
  ------------------
  |  Branch (50:10): [True: 25.6M, False: 401k]
  ------------------
   51|  25.6M|    mean_val = std_val = 0;
   52|       |
   53|  25.6M|    j = num_cols >> 2;
   54|   333M|    while (j < num_cols) {
  ------------------
  |  Branch (54:12): [True: 308M, False: 25.6M]
  ------------------
   55|   308M|      ptr_energy = &ptr_energies[j][i];
   56|   308M|      mean_val += (*ptr_energy);
   57|   308M|      ptr_energy += 64;
   58|   308M|      mean_val += (*ptr_energy);
   59|   308M|      j += 2;
   60|   308M|    }
   61|       |
   62|  25.6M|    mean_val *= inv_num_cols * 2.0f;
   63|       |
   64|  25.6M|    j = num_cols >> 2;
   65|   641M|    while (j < num_cols) {
  ------------------
  |  Branch (65:12): [True: 616M, False: 25.6M]
  ------------------
   66|   616M|      FLOAT32 tmp_var;
   67|   616M|      tmp_var = (sbr_codec == HEAAC_SBR) ? mean_val - ptr_energies[j][i] : ptr_energies[j][i];
  ------------------
  |  Branch (67:17): [True: 304M, False: 311M]
  ------------------
   68|   616M|      std_val += tmp_var * tmp_var;
   69|   616M|      j++;
   70|   616M|    }
   71|       |
   72|  25.6M|    std_val = (FLOAT32)((sbr_codec == HEAAC_SBR)
  ------------------
  |  Branch (72:25): [True: 12.6M, False: 12.9M]
  ------------------
   73|  25.6M|                            ? sqrt(std_val * inv_num_cols_1)
   74|  25.6M|                            : sqrt(fabs((mean_val * mean_val) - std_val * inv_num_cols * 2.0f)));
   75|       |
   76|  25.6M|    thr = 0.66f * ptr_thresholds[i] + 0.34f * IXHEAACE_SBR_TRAN_STD_FAC * std_val;
  ------------------
  |  |   24|  25.6M|#define IXHEAACE_SBR_TRAN_STD_FAC (1.0f)
  ------------------
   77|  25.6M|    ptr_thresholds[i] = MAX(thr, IXHEAACE_SBR_TRAN_ABS_THR);
  ------------------
  |  |   24|  25.6M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 14.7M, False: 10.9M]
  |  |  ------------------
  ------------------
   78|       |
   79|  25.6M|    i++;
   80|  25.6M|  }
   81|   401k|}
ixheaace_sbr_tran_det_hp.c:ixheaace_extract_transient_candidates:
   88|   401k|{
   89|   401k|  WORD32 idx;
   90|   401k|  WORD32 buf_move = buf_len >> 1;
   91|   401k|  FLOAT32 dt_1, dt_2, dt_3, inv_thr;
   92|   401k|  WORD32 len = num_cols + (num_cols >> 1) - 3;
   93|   401k|  WORD32 band = start_band;
   94|       |
   95|   401k|  memmove(ptr_transients, ptr_transients + num_cols, buf_move * sizeof(ptr_transients[0]));
   96|   401k|  memset(ptr_transients + buf_move, 0, (buf_len - buf_move) * sizeof(ptr_transients[0]));
   97|       |
   98|  26.0M|  while (band < stop_band) {
  ------------------
  |  Branch (98:10): [True: 25.6M, False: 401k]
  ------------------
   99|  25.6M|    inv_thr = (FLOAT32)1.0f / ptr_thresholds[band];
  100|  25.6M|    FLOAT32 temp_energy_1 = ptr_energies[((num_cols >> 1) - 2) / 2][band];
  101|  25.6M|    FLOAT32 temp_energy_2 = ptr_energies[((num_cols >> 1)) / 2][band];
  102|  25.6M|    FLOAT32 temp_energy_3 = ptr_energies[((num_cols >> 1) + 2) / 2][band];
  103|  1.18G|    for (idx = 0; idx < len; idx++) {
  ------------------
  |  Branch (103:19): [True: 1.15G, False: 25.6M]
  ------------------
  104|  1.15G|      if (!idx) {
  ------------------
  |  Branch (104:11): [True: 25.6M, False: 1.12G]
  ------------------
  105|  25.6M|        dt_1 = temp_energy_2 - temp_energy_1;
  106|  25.6M|        dt_2 = temp_energy_3 - temp_energy_1;
  107|  25.6M|        dt_3 = temp_energy_3 - ptr_energies[((num_cols >> 1) - 4) / 2][band];
  108|  1.12G|      } else {
  109|  1.12G|        FLOAT32 temp_energy_4 = ptr_energies[(idx + (num_cols >> 1) + 3) / 2][band];
  110|  1.12G|        dt_1 = temp_energy_3 - temp_energy_2;
  111|  1.12G|        dt_2 = temp_energy_3 - temp_energy_1 + dt_1;
  112|  1.12G|        dt_3 = temp_energy_4 - temp_energy_1 + dt_2;
  113|  1.12G|        temp_energy_1 = temp_energy_2;
  114|  1.12G|        temp_energy_2 = temp_energy_3;
  115|  1.12G|        temp_energy_3 = temp_energy_4;
  116|  1.12G|      }
  117|  1.15G|      if (dt_1 > ptr_thresholds[band]) {
  ------------------
  |  Branch (117:11): [True: 26.1M, False: 1.12G]
  ------------------
  118|  26.1M|        ptr_transients[idx + buf_move] += dt_1 * inv_thr - 1.0f;
  119|  26.1M|      }
  120|  1.15G|      if (dt_2 > ptr_thresholds[band]) {
  ------------------
  |  Branch (120:11): [True: 59.8M, False: 1.09G]
  ------------------
  121|  59.8M|        ptr_transients[idx + buf_move] += dt_2 * inv_thr - 1.0f;
  122|  59.8M|      }
  123|  1.15G|      if (dt_3 > ptr_thresholds[band]) {
  ------------------
  |  Branch (123:11): [True: 83.0M, False: 1.07G]
  ------------------
  124|  83.0M|        ptr_transients[idx + buf_move] += dt_3 * inv_thr - 1.0f;
  125|  83.0M|      }
  126|  1.15G|    }
  127|   590M|    for (idx = 1; idx < len; idx += 2) {
  ------------------
  |  Branch (127:19): [True: 564M, False: 25.6M]
  ------------------
  128|   564M|      ptr_transients[idx + buf_move + 1] = ptr_transients[idx + buf_move];
  129|   564M|    }
  130|  25.6M|    band++;
  131|  25.6M|  }
  132|   401k|}
ixheaace_sbr_tran_det_hp.c:ixheaace_calc_thresholds_4_1:
  165|  64.9k|                                         FLOAT32 *ptr_thresholds, WORD32 time_step) {
  166|  64.9k|  FLOAT32 mean_val, std_val, thr;
  167|  64.9k|  FLOAT32 *ptr_energy;
  168|  64.9k|  FLOAT32 inv_num_cols = 1.0f / (FLOAT32)((num_cols + num_cols / 2) / time_step);
  169|  64.9k|  FLOAT32 inv_num_cols_1 = 1.0f / (FLOAT32)((num_cols + num_cols / 2 - 1) / time_step);
  170|       |
  171|  64.9k|  WORD32 i = 0;
  172|  64.9k|  WORD32 j;
  173|  64.9k|  WORD32 start_band = 8;
  174|  64.9k|  WORD32 end_band = 32;
  175|       |
  176|  4.22M|  while (i < num_rows) {
  ------------------
  |  Branch (176:10): [True: 4.15M, False: 64.9k]
  ------------------
  177|  4.15M|    mean_val = std_val = 0;
  178|       |
  179|  4.15M|    j = start_band;
  180|   103M|    while (j < end_band) {
  ------------------
  |  Branch (180:12): [True: 99.8M, False: 4.15M]
  ------------------
  181|  99.8M|      ptr_energy = &ptr_energies[j][i];
  182|  99.8M|      mean_val += (*ptr_energy);
  183|  99.8M|      j++;
  184|  99.8M|    }
  185|       |
  186|  4.15M|    mean_val *= inv_num_cols;
  187|       |
  188|  4.15M|    j = start_band;
  189|   103M|    while (j < end_band) {
  ------------------
  |  Branch (189:12): [True: 99.8M, False: 4.15M]
  ------------------
  190|  99.8M|      FLOAT32 tmp_var;
  191|  99.8M|      tmp_var = mean_val - ptr_energies[j][i];
  192|  99.8M|      std_val += tmp_var * tmp_var;
  193|  99.8M|      j++;
  194|  99.8M|    }
  195|       |
  196|  4.15M|    std_val = (FLOAT32)sqrt(std_val * inv_num_cols_1);
  197|       |
  198|  4.15M|    thr = 0.66f * ptr_thresholds[i] + 0.34f * IXHEAACE_SBR_TRAN_STD_FAC * std_val;
  ------------------
  |  |   24|  4.15M|#define IXHEAACE_SBR_TRAN_STD_FAC (1.0f)
  ------------------
  199|  4.15M|    ptr_thresholds[i] = MAX(thr, IXHEAACE_SBR_TRAN_ABS_THR);
  ------------------
  |  |   24|  4.15M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.10M, False: 3.05M]
  |  |  ------------------
  ------------------
  200|       |
  201|  4.15M|    i++;
  202|  4.15M|  }
  203|  64.9k|}
ixheaace_sbr_tran_det_hp.c:ixheaace_extract_transient_candidates_4_1:
  211|  64.9k|{
  212|  64.9k|  WORD32 idx;
  213|  64.9k|  WORD32 buf_move = num_cols / 2;
  214|  64.9k|  WORD32 band = start_band;
  215|       |
  216|  64.9k|  memmove(ptr_transients, ptr_transients + num_cols, buf_move * sizeof(ptr_transients[0]));
  217|  64.9k|  memset(ptr_transients + buf_move, 0, num_cols * sizeof(ptr_transients[0]));
  218|       |
  219|  4.22M|  while (band < stop_band) {
  ------------------
  |  Branch (219:10): [True: 4.15M, False: 64.9k]
  ------------------
  220|   270M|    for (idx = buf_move; idx < num_cols + buf_move; idx++) {
  ------------------
  |  Branch (220:26): [True: 266M, False: 4.15M]
  ------------------
  221|   266M|      float l = 0, r = 0;
  222|  1.06G|      for (int d = 1; d < 4; d++) {
  ------------------
  |  Branch (222:23): [True: 798M, False: 266M]
  ------------------
  223|   798M|        l = ptr_energies[(idx - d) / time_step][band];
  224|   798M|        r = ptr_energies[(idx + d) / time_step][band];
  225|   798M|        if (r - l > ptr_thresholds[band])
  ------------------
  |  Branch (225:13): [True: 4.56M, False: 793M]
  ------------------
  226|  4.56M|          ptr_transients[idx] += (r - l - ptr_thresholds[band]) / ptr_thresholds[band];
  227|   798M|      }
  228|   266M|    }
  229|  4.15M|    band++;
  230|  4.15M|  }
  231|  64.9k|}

ixheaace_write_env_single_channel_element:
 1239|   249k|    WORD32 *ptr_num_bits) {
 1240|   249k|  WORD32 payload_cnt_bits = 0;
 1241|   249k|  WORD32 num_sbr_data_bits = 0;
 1242|   249k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   249k|#define IA_NO_ERROR 0x00000000
  ------------------
 1243|       |
 1244|   249k|  pstr_cmon_data->sbr_hdr_bits = 0;
 1245|   249k|  pstr_cmon_data->sbr_data_bits = 0;
 1246|   249k|  pstr_cmon_data->sbr_crc_len = 0;
 1247|       |
 1248|   249k|  if (pstr_sbr_env_info != NULL_PTR) {
  ------------------
  |  |   23|   249k|#define NULL_PTR ((void *)0)
  ------------------
  |  Branch (1248:7): [True: 249k, False: 0]
  ------------------
 1249|   249k|    if (USAC_SBR == sbr_codec) {
  ------------------
  |  Branch (1249:9): [True: 135k, False: 113k]
  ------------------
 1250|   135k|      payload_cnt_bits +=
 1251|   135k|          ia_usac_enc_encode_sbr_header(pstr_sbr_hdr, pstr_sbr_bs, pstr_cmon_data);
 1252|   135k|    } else {
 1253|       |      /* write header */
 1254|   113k|      payload_cnt_bits +=
 1255|   113k|          ia_enhaacplus_enc_encode_sbr_header(pstr_sbr_hdr, pstr_sbr_bs, pstr_cmon_data);
 1256|   113k|    }
 1257|       |    /* write data */
 1258|   249k|    err_code =
 1259|   249k|        ixheaace_encode_sbr_data(pstr_sbr_env_info, NULL_PTR, pstr_cmon_data, IXHEAACE_SBR_ID_SCE,
  ------------------
  |  |   23|   249k|#define NULL_PTR ((void *)0)
  ------------------
 1260|   249k|                                 pstr_ps_handle, pstr_sbr_bs->header_active, 0, pstr_sbr_tab,
 1261|   249k|                                 sbr_codec, is_esbr, pstr_esbr_data, &num_sbr_data_bits);
 1262|   249k|    if (err_code) {
  ------------------
  |  Branch (1262:9): [True: 78, False: 249k]
  ------------------
 1263|     78|      return err_code;
 1264|     78|    }
 1265|   249k|    payload_cnt_bits += num_sbr_data_bits;
 1266|   249k|  }
 1267|       |
 1268|   249k|  *ptr_num_bits = payload_cnt_bits;
 1269|   249k|  return err_code;
 1270|   249k|}
ixheaace_write_env_channel_pair_element:
 1280|   347k|{
 1281|   347k|  WORD32 payload_cnt_bits = 0;
 1282|   347k|  WORD32 num_sbr_data_bits = 0;
 1283|   347k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   347k|#define IA_NO_ERROR 0x00000000
  ------------------
 1284|       |
 1285|   347k|  pstr_cmon_data->sbr_hdr_bits = 0;
 1286|   347k|  pstr_cmon_data->sbr_data_bits = 0;
 1287|   347k|  pstr_cmon_data->sbr_crc_len = 0;
 1288|       |
 1289|       |  /* write pure SBR data */
 1290|   347k|  if ((pstr_sbr_env_data_left != NULL_PTR) && (pstr_sbr_env_data_right != NULL_PTR)) {
  ------------------
  |  |   23|   347k|#define NULL_PTR ((void *)0)
  ------------------
                if ((pstr_sbr_env_data_left != NULL_PTR) && (pstr_sbr_env_data_right != NULL_PTR)) {
  ------------------
  |  |   23|   347k|#define NULL_PTR ((void *)0)
  ------------------
  |  Branch (1290:7): [True: 347k, False: 0]
  |  Branch (1290:47): [True: 347k, False: 0]
  ------------------
 1291|   347k|    if (USAC_SBR == sbr_codec) {
  ------------------
  |  Branch (1291:9): [True: 134k, False: 212k]
  ------------------
 1292|   134k|      payload_cnt_bits +=
 1293|   134k|          ia_usac_enc_encode_sbr_header(pstr_sbr_hdr, pstr_sbr_bs, pstr_cmon_data);
 1294|   212k|    } else {
 1295|       |      /* write header */
 1296|   212k|      payload_cnt_bits +=
 1297|   212k|          ia_enhaacplus_enc_encode_sbr_header(pstr_sbr_hdr, pstr_sbr_bs, pstr_cmon_data);
 1298|   212k|    }
 1299|       |
 1300|       |    /* write data */
 1301|   347k|    err_code = ixheaace_encode_sbr_data(pstr_sbr_env_data_left, pstr_sbr_env_data_right,
 1302|   347k|                                        pstr_cmon_data, IXHEAACE_SBR_ID_CPE, NULL_PTR, 0,
  ------------------
  |  |   23|   347k|#define NULL_PTR ((void *)0)
  ------------------
 1303|   347k|                                        pstr_sbr_hdr->coupling, pstr_sbr_tab, sbr_codec, is_esbr,
 1304|   347k|                                        pstr_esbr_data, &num_sbr_data_bits);
 1305|   347k|    if (err_code) {
  ------------------
  |  Branch (1305:9): [True: 382, False: 347k]
  ------------------
 1306|    382|      return err_code;
 1307|    382|    }
 1308|   347k|    payload_cnt_bits += num_sbr_data_bits;
 1309|   347k|  }
 1310|       |
 1311|   347k|  *ptr_num_bits = payload_cnt_bits;
 1312|   347k|  return err_code;
 1313|   347k|}
ixheaace_count_sbr_channel_pair_element:
 1323|   183k|{
 1324|   183k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   183k|#define IA_NO_ERROR 0x00000000
  ------------------
 1325|   183k|  ixheaace_bit_buf bit_buf_tmp = pstr_cmon_data->str_sbr_bit_buf;
 1326|       |
 1327|   183k|  err_code = ixheaace_write_env_channel_pair_element(
 1328|   183k|      pstr_sbr_hdr, pstr_sbr_bs, pstr_sbr_env_data_left, pstr_sbr_env_data_right, pstr_cmon_data,
 1329|   183k|      pstr_sbr_tab, sbr_codec, is_esbr, pstr_esbr_data, ptr_num_bits);
 1330|       |
 1331|   183k|  pstr_cmon_data->str_sbr_bit_buf = bit_buf_tmp;
 1332|       |
 1333|   183k|  return err_code;
 1334|   183k|}
ixheaace_map_low_res_energy_value:
 1337|  16.2M|                                       WORD32 index, ixheaace_freq_res res) {
 1338|  16.2M|  if (res == FREQ_RES_LOW) {
  ------------------
  |  Branch (1338:7): [True: 3.03M, False: 13.1M]
  ------------------
 1339|  3.03M|    if (offset >= 0) {
  ------------------
  |  Branch (1339:9): [True: 3.03M, False: 0]
  ------------------
 1340|  3.03M|      if (index < offset) {
  ------------------
  |  Branch (1340:11): [True: 0, False: 3.03M]
  ------------------
 1341|      0|        ptr_prev_data[index] = curr_val;
 1342|  3.03M|      } else {
 1343|  3.03M|        ptr_prev_data[2 * index - offset] = curr_val;
 1344|  3.03M|        ptr_prev_data[2 * index + 1 - offset] = curr_val;
 1345|  3.03M|      }
 1346|  3.03M|    } else {
 1347|      0|      offset = -offset;
 1348|       |
 1349|      0|      if (index < offset) {
  ------------------
  |  Branch (1349:11): [True: 0, False: 0]
  ------------------
 1350|      0|        ptr_prev_data[3 * index] = curr_val;
 1351|      0|        ptr_prev_data[3 * index + 1] = curr_val;
 1352|      0|        ptr_prev_data[3 * index + 2] = curr_val;
 1353|      0|      } else {
 1354|      0|        ptr_prev_data[2 * index + offset] = curr_val;
 1355|      0|        ptr_prev_data[2 * index + 1 + offset] = curr_val;
 1356|      0|      }
 1357|      0|    }
 1358|  13.1M|  } else {
 1359|  13.1M|    ptr_prev_data[index] = curr_val;
 1360|  13.1M|  }
 1361|  16.2M|}
ixheaace_compute_bits:
 1367|  26.1M|                      WORD32 *ptr_delta_bits) {
 1368|  26.1M|  WORD32 index;
 1369|  26.1M|  *ptr_delta_bits = 0;
 1370|       |
 1371|  26.1M|  if (coupling) {
  ------------------
  |  Branch (1371:7): [True: 6.29M, False: 19.8M]
  ------------------
 1372|  6.29M|    if (ch == 1) {
  ------------------
  |  Branch (1372:9): [True: 3.13M, False: 3.15M]
  ------------------
 1373|  3.13M|      index = (delta < 0) ? ixheaac_max32(delta, -code_book_scf_lav_balance)
  ------------------
  |  Branch (1373:15): [True: 101k, False: 3.03M]
  ------------------
 1374|  3.13M|                          : ixheaac_min32(delta, code_book_scf_lav_balance);
 1375|       |
 1376|  3.13M|      if (index != delta) {
  ------------------
  |  Branch (1376:11): [True: 496, False: 3.13M]
  ------------------
 1377|    496|        return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_BS;
 1378|    496|      }
 1379|       |
 1380|  3.13M|      *ptr_delta_bits = ptr_huff_tbl_bal[index + code_book_scf_lav_balance];
 1381|  3.15M|    } else {
 1382|  3.15M|      index = (delta < 0) ? ixheaac_max32(delta, -code_book_scf_lav_lvl)
  ------------------
  |  Branch (1382:15): [True: 841k, False: 2.31M]
  ------------------
 1383|  3.15M|                          : ixheaac_min32(delta, code_book_scf_lav_lvl);
 1384|       |
 1385|  3.15M|      if (index != delta) {
  ------------------
  |  Branch (1385:11): [True: 573, False: 3.15M]
  ------------------
 1386|    573|        return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_BS;
 1387|    573|      }
 1388|       |
 1389|  3.15M|      *ptr_delta_bits = ptr_huff_tbl_lvl[index + code_book_scf_lav_lvl];
 1390|  3.15M|    }
 1391|  19.8M|  } else {
 1392|  19.8M|    index = (delta < 0) ? ixheaac_max32(delta, -code_book_scf_lav_lvl)
  ------------------
  |  Branch (1392:13): [True: 4.62M, False: 15.2M]
  ------------------
 1393|  19.8M|                        : ixheaac_min32(delta, code_book_scf_lav_lvl);
 1394|       |
 1395|  19.8M|    *ptr_delta_bits = ptr_huff_tbl_lvl[index + code_book_scf_lav_lvl];
 1396|  19.8M|  }
 1397|       |
 1398|  26.1M|  return IA_NO_ERROR;
  ------------------
  |  |   23|  26.1M|#define IA_NO_ERROR 0x00000000
  ------------------
 1399|  26.1M|}
ixheaace_sbr_write_bitstream.c:ia_usac_enc_encode_sbr_header:
 1187|   270k|                                            ixheaace_pstr_common_data pstr_cmon_data) {
 1188|   270k|  WORD32 payload_cnt_bits = 0;
 1189|   270k|  WORD32 sbr_info_flag = 0;
 1190|   270k|  WORD32 sbr_hdr_flag = 0;
 1191|   270k|  if (pstr_sbr_bs->usac_indep_flag) {
  ------------------
  |  Branch (1191:7): [True: 14.7k, False: 256k]
  ------------------
 1192|  14.7k|    sbr_hdr_flag = 1;
 1193|  14.7k|    sbr_info_flag = 1;
 1194|   256k|  } else {
 1195|   256k|    if (pstr_sbr_bs->header_active) {
  ------------------
  |  Branch (1195:9): [True: 38.9k, False: 217k]
  ------------------
 1196|  38.9k|      sbr_info_flag = 1;
 1197|  38.9k|      payload_cnt_bits += ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 1, 1);
 1198|  38.9k|      sbr_hdr_flag = 1;
 1199|  38.9k|      payload_cnt_bits += ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 1, 1);
 1200|   217k|    } else {
 1201|   217k|      payload_cnt_bits += ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0, 1);
 1202|   217k|    }
 1203|   256k|  }
 1204|       |
 1205|   270k|  if (1 == sbr_info_flag) {
  ------------------
  |  Branch (1205:7): [True: 53.6k, False: 217k]
  ------------------
 1206|  53.6k|    payload_cnt_bits +=
 1207|  53.6k|        ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, pstr_sbr_hdr->sbr_amp_res, 1);
 1208|       |
 1209|  53.6k|    payload_cnt_bits +=
 1210|  53.6k|        ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, pstr_sbr_hdr->sbr_xover_band, 4);
 1211|       |
 1212|  53.6k|    payload_cnt_bits +=
 1213|  53.6k|        ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, pstr_sbr_hdr->sbr_pre_proc, 1);
 1214|  53.6k|    if (pstr_sbr_hdr->sbr_pvc_active) {
  ------------------
  |  Branch (1214:9): [True: 15.5k, False: 38.1k]
  ------------------
 1215|  15.5k|      payload_cnt_bits +=
 1216|  15.5k|          ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, pstr_sbr_hdr->sbr_pvc_mode, 2);
 1217|  15.5k|    }
 1218|  53.6k|  }
 1219|       |
 1220|   270k|  if (1 == sbr_hdr_flag) {
  ------------------
  |  Branch (1220:7): [True: 53.6k, False: 217k]
  ------------------
 1221|  53.6k|    WORD32 sbr_def_hdr = 0;
 1222|       |    // SBR default header
 1223|  53.6k|    payload_cnt_bits += ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, sbr_def_hdr, 1);
 1224|  53.6k|    if (0 == sbr_def_hdr) {
  ------------------
  |  Branch (1224:9): [True: 53.6k, False: 0]
  ------------------
 1225|  53.6k|      payload_cnt_bits +=
 1226|  53.6k|          iusace_encode_sbr_header_data(pstr_sbr_hdr, &pstr_cmon_data->str_sbr_bit_buf);
 1227|  53.6k|    }
 1228|  53.6k|  }
 1229|   270k|  pstr_cmon_data->sbr_hdr_bits = payload_cnt_bits;
 1230|       |
 1231|   270k|  return payload_cnt_bits;
 1232|   270k|}
ixheaace_sbr_write_bitstream.c:iusace_encode_sbr_header_data:
 1140|  53.6k|                                            ixheaace_bit_buf_handle pstr_bs_handle) {
 1141|  53.6k|  WORD32 payload_cnt_bits = 0;
 1142|       |
 1143|  53.6k|  if (pstr_sbr_hdr != NULL_PTR) {
  ------------------
  |  |   23|  53.6k|#define NULL_PTR ((void *)0)
  ------------------
  |  Branch (1143:7): [True: 53.6k, False: 0]
  ------------------
 1144|  53.6k|    payload_cnt_bits +=
 1145|  53.6k|        ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_start_freq, SI_SBR_START_FREQ_BITS);
  ------------------
  |  |  122|  53.6k|#define SI_SBR_START_FREQ_BITS (4)
  ------------------
 1146|       |
 1147|  53.6k|    payload_cnt_bits +=
 1148|  53.6k|        ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_stop_freq, SI_SBR_STOP_FREQ_BITS);
  ------------------
  |  |  123|  53.6k|#define SI_SBR_STOP_FREQ_BITS (4)
  ------------------
 1149|       |
 1150|  53.6k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->header_extra_1,
 1151|  53.6k|                                            SI_SBR_HEADER_EXTRA_1_BITS);
  ------------------
  |  |  126|  53.6k|#define SI_SBR_HEADER_EXTRA_1_BITS (1)
  ------------------
 1152|       |
 1153|  53.6k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->header_extra_2,
 1154|  53.6k|                                            SI_SBR_HEADER_EXTRA_2_BITS);
  ------------------
  |  |  127|  53.6k|#define SI_SBR_HEADER_EXTRA_2_BITS (1)
  ------------------
 1155|       |
 1156|  53.6k|    if (pstr_sbr_hdr->header_extra_1) {
  ------------------
  |  Branch (1156:9): [True: 29.5k, False: 24.0k]
  ------------------
 1157|  29.5k|      payload_cnt_bits +=
 1158|  29.5k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->freq_scale, SI_SBR_FREQ_SCALE_BITS);
  ------------------
  |  |  128|  29.5k|#define SI_SBR_FREQ_SCALE_BITS (2)
  ------------------
 1159|       |
 1160|  29.5k|      payload_cnt_bits +=
 1161|  29.5k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->alter_scale, SI_SBR_ALTER_SCALE_BITS);
  ------------------
  |  |  129|  29.5k|#define SI_SBR_ALTER_SCALE_BITS (1)
  ------------------
 1162|       |
 1163|  29.5k|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_noise_bands,
 1164|  29.5k|                                              SI_SBR_NOISE_BANDS_BITS);
  ------------------
  |  |  130|  29.5k|#define SI_SBR_NOISE_BANDS_BITS (2)
  ------------------
 1165|  29.5k|    }
 1166|       |
 1167|  53.6k|    if (pstr_sbr_hdr->header_extra_2) {
  ------------------
  |  Branch (1167:9): [True: 0, False: 53.6k]
  ------------------
 1168|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_limiter_bands,
 1169|      0|                                              SI_SBR_LIMITER_BANDS_BITS);
  ------------------
  |  |  135|      0|#define SI_SBR_LIMITER_BANDS_BITS (2)
  ------------------
 1170|       |
 1171|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_limiter_gains,
 1172|      0|                                              SI_SBR_LIMITER_GAINS_BITS);
  ------------------
  |  |  136|      0|#define SI_SBR_LIMITER_GAINS_BITS (2)
  ------------------
 1173|       |
 1174|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_interpol_freq,
 1175|      0|                                              SI_SBR_INTERPOL_FREQ_BITS);
  ------------------
  |  |  137|      0|#define SI_SBR_INTERPOL_FREQ_BITS (1)
  ------------------
 1176|       |
 1177|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_smoothing_length,
 1178|      0|                                              SI_SBR_SMOOTHING_LENGTH_BITS);
  ------------------
  |  |  138|      0|#define SI_SBR_SMOOTHING_LENGTH_BITS (1)
  ------------------
 1179|      0|    }
 1180|  53.6k|  }
 1181|       |
 1182|  53.6k|  return payload_cnt_bits;
 1183|  53.6k|}
ixheaace_sbr_write_bitstream.c:ia_enhaacplus_enc_encode_sbr_header:
 1117|   326k|                                                  ixheaace_pstr_common_data pstr_cmon_data) {
 1118|   326k|  WORD32 payload_cnt_bits = 0;
 1119|       |
 1120|   326k|  if (pstr_sbr_bs->crc_active) {
  ------------------
  |  Branch (1120:7): [True: 0, False: 326k]
  ------------------
 1121|      0|    pstr_cmon_data->sbr_crc_len = 1;
 1122|   326k|  } else {
 1123|   326k|    pstr_cmon_data->sbr_crc_len = 0;
 1124|   326k|  }
 1125|       |
 1126|   326k|  if (pstr_sbr_bs->header_active) {
  ------------------
  |  Branch (1126:7): [True: 28.5k, False: 297k]
  ------------------
 1127|  28.5k|    payload_cnt_bits += ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 1, 1);
 1128|       |
 1129|  28.5k|    payload_cnt_bits +=
 1130|  28.5k|        ixheaace_encode_sbr_header_data(pstr_sbr_hdr, &pstr_cmon_data->str_sbr_bit_buf);
 1131|   297k|  } else {
 1132|   297k|    payload_cnt_bits += ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0, 1);
 1133|   297k|  }
 1134|       |
 1135|   326k|  pstr_cmon_data->sbr_hdr_bits = payload_cnt_bits;
 1136|       |
 1137|   326k|  return payload_cnt_bits;
 1138|   326k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_sbr_header_data:
 1063|  28.5k|{
 1064|  28.5k|  WORD32 payload_cnt_bits = 0;
 1065|       |
 1066|  28.5k|  if (pstr_sbr_hdr != NULL_PTR) {
  ------------------
  |  |   23|  28.5k|#define NULL_PTR ((void *)0)
  ------------------
  |  Branch (1066:7): [True: 28.5k, False: 0]
  ------------------
 1067|  28.5k|    payload_cnt_bits +=
 1068|  28.5k|        ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_amp_res, SI_SBR_AMP_RES_BITS);
  ------------------
  |  |  120|  28.5k|#define SI_SBR_AMP_RES_BITS (1)
  ------------------
 1069|       |
 1070|  28.5k|    payload_cnt_bits +=
 1071|  28.5k|        ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_start_freq, SI_SBR_START_FREQ_BITS);
  ------------------
  |  |  122|  28.5k|#define SI_SBR_START_FREQ_BITS (4)
  ------------------
 1072|       |
 1073|  28.5k|    payload_cnt_bits +=
 1074|  28.5k|        ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_stop_freq, SI_SBR_STOP_FREQ_BITS);
  ------------------
  |  |  123|  28.5k|#define SI_SBR_STOP_FREQ_BITS (4)
  ------------------
 1075|       |
 1076|  28.5k|    payload_cnt_bits +=
 1077|  28.5k|        ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_xover_band, SI_SBR_XOVER_BAND_BITS);
  ------------------
  |  |  124|  28.5k|#define SI_SBR_XOVER_BAND_BITS (3)
  ------------------
 1078|       |
 1079|  28.5k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, SI_SBR_RESERVED_BITS);
  ------------------
  |  |  125|  28.5k|#define SI_SBR_RESERVED_BITS (2)
  ------------------
 1080|       |
 1081|  28.5k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->header_extra_1,
 1082|  28.5k|                                            SI_SBR_HEADER_EXTRA_1_BITS);
  ------------------
  |  |  126|  28.5k|#define SI_SBR_HEADER_EXTRA_1_BITS (1)
  ------------------
 1083|       |
 1084|  28.5k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->header_extra_2,
 1085|  28.5k|                                            SI_SBR_HEADER_EXTRA_2_BITS);
  ------------------
  |  |  127|  28.5k|#define SI_SBR_HEADER_EXTRA_2_BITS (1)
  ------------------
 1086|       |
 1087|  28.5k|    if (pstr_sbr_hdr->header_extra_1) {
  ------------------
  |  Branch (1087:9): [True: 19.8k, False: 8.71k]
  ------------------
 1088|  19.8k|      payload_cnt_bits +=
 1089|  19.8k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->freq_scale, SI_SBR_FREQ_SCALE_BITS);
  ------------------
  |  |  128|  19.8k|#define SI_SBR_FREQ_SCALE_BITS (2)
  ------------------
 1090|       |
 1091|  19.8k|      payload_cnt_bits +=
 1092|  19.8k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->alter_scale, SI_SBR_ALTER_SCALE_BITS);
  ------------------
  |  |  129|  19.8k|#define SI_SBR_ALTER_SCALE_BITS (1)
  ------------------
 1093|       |
 1094|  19.8k|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_noise_bands,
 1095|  19.8k|                                              SI_SBR_NOISE_BANDS_BITS);
  ------------------
  |  |  130|  19.8k|#define SI_SBR_NOISE_BANDS_BITS (2)
  ------------------
 1096|  19.8k|    }
 1097|       |
 1098|  28.5k|    if (pstr_sbr_hdr->header_extra_2) {
  ------------------
  |  Branch (1098:9): [True: 0, False: 28.5k]
  ------------------
 1099|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_limiter_bands,
 1100|      0|                                              SI_SBR_LIMITER_BANDS_BITS);
  ------------------
  |  |  135|      0|#define SI_SBR_LIMITER_BANDS_BITS (2)
  ------------------
 1101|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_limiter_gains,
 1102|      0|                                              SI_SBR_LIMITER_GAINS_BITS);
  ------------------
  |  |  136|      0|#define SI_SBR_LIMITER_GAINS_BITS (2)
  ------------------
 1103|       |
 1104|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_interpol_freq,
 1105|      0|                                              SI_SBR_INTERPOL_FREQ_BITS);
  ------------------
  |  |  137|      0|#define SI_SBR_INTERPOL_FREQ_BITS (1)
  ------------------
 1106|       |
 1107|      0|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_sbr_hdr->sbr_smoothing_length,
 1108|      0|                                              SI_SBR_SMOOTHING_LENGTH_BITS);
  ------------------
  |  |  138|      0|#define SI_SBR_SMOOTHING_LENGTH_BITS (1)
  ------------------
 1109|      0|    }
 1110|  28.5k|  }
 1111|       |
 1112|  28.5k|  return payload_cnt_bits;
 1113|  28.5k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_sbr_data:
 1013|   596k|    WORD32 *ptr_num_bits) {
 1014|   596k|  WORD32 payload_cnt_bits = 0;
 1015|   596k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   596k|#define IA_NO_ERROR 0x00000000
  ------------------
 1016|       |
 1017|   596k|  switch (sbr_ele_type) {
  ------------------
  |  Branch (1017:11): [True: 596k, False: 0]
  ------------------
 1018|   249k|    case IXHEAACE_SBR_ID_SCE:
  ------------------
  |  Branch (1018:5): [True: 249k, False: 347k]
  ------------------
 1019|       |
 1020|   249k|      err_code = ixheaace_encode_sbr_single_channel_element(
 1021|   249k|          pstr_sbr_env_data_left, &pstr_cmon_data->str_sbr_bit_buf, sbr_codec, &payload_cnt_bits);
 1022|   249k|      if (err_code) {
  ------------------
  |  Branch (1022:11): [True: 78, False: 249k]
  ------------------
 1023|     78|        return err_code;
 1024|     78|      }
 1025|   249k|      if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (1025:11): [True: 113k, False: 135k]
  ------------------
 1026|   113k|        ixheaace_encode_extended_data(
 1027|   113k|            pstr_ps_handle, is_hdr_active, &pstr_cmon_data->str_sbr_bit_buf_prev,
 1028|   113k|            &pstr_cmon_data->sbr_hdr_bits, &pstr_cmon_data->str_sbr_bit_buf, &payload_cnt_bits,
 1029|   113k|            pstr_sbr_tab, is_esbr, pstr_esbr_data);
 1030|   113k|      }
 1031|   249k|      break;
 1032|   347k|    case IXHEAACE_SBR_ID_CPE:
  ------------------
  |  Branch (1032:5): [True: 347k, False: 249k]
  ------------------
 1033|       |
 1034|   347k|      err_code = ixheaace_encode_sbr_channel_pair_element(
 1035|   347k|          pstr_sbr_env_data_left, pstr_sbr_env_data_right, &pstr_cmon_data->str_sbr_bit_buf,
 1036|   347k|          coupling, sbr_codec, &payload_cnt_bits);
 1037|   347k|      if (err_code) {
  ------------------
  |  Branch (1037:11): [True: 382, False: 347k]
  ------------------
 1038|    382|        return err_code;
 1039|    382|      }
 1040|   347k|      if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (1040:11): [True: 212k, False: 134k]
  ------------------
 1041|   212k|        ixheaace_encode_extended_data(NULL_PTR, 0, NULL_PTR, 0, &pstr_cmon_data->str_sbr_bit_buf,
  ------------------
  |  |   23|   212k|#define NULL_PTR ((void *)0)
  ------------------
                      ixheaace_encode_extended_data(NULL_PTR, 0, NULL_PTR, 0, &pstr_cmon_data->str_sbr_bit_buf,
  ------------------
  |  |   23|   212k|#define NULL_PTR ((void *)0)
  ------------------
 1042|   212k|                                      &payload_cnt_bits, pstr_sbr_tab, is_esbr, pstr_esbr_data);
 1043|   212k|      }
 1044|   347k|      break;
 1045|   596k|  }
 1046|       |
 1047|   596k|  pstr_cmon_data->sbr_data_bits = payload_cnt_bits;
 1048|   596k|  *ptr_num_bits = payload_cnt_bits;
 1049|       |
 1050|   596k|  pstr_cmon_data->prev_bit_buf_read_offset =
 1051|   596k|      (WORD32)(pstr_cmon_data->str_sbr_bit_buf_prev.ptr_read_next -
 1052|   596k|               pstr_cmon_data->str_sbr_bit_buf_prev.ptr_bit_buf_base);
 1053|   596k|  pstr_cmon_data->prev_bit_buf_write_offset =
 1054|   596k|      (WORD32)(pstr_cmon_data->str_sbr_bit_buf_prev.ptr_write_next -
 1055|   596k|               pstr_cmon_data->str_sbr_bit_buf_prev.ptr_bit_buf_base);
 1056|       |
 1057|   596k|  return err_code;
 1058|   596k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_sbr_single_channel_element:
  580|   249k|{
  581|   249k|  WORD32 payload_cnt_bits = 0;
  582|   249k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   249k|#define IA_NO_ERROR 0x00000000
  ------------------
  583|       |
  584|   249k|  if (sbr_codec != USAC_SBR) {
  ------------------
  |  Branch (584:7): [True: 113k, False: 135k]
  ------------------
  585|   113k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, 1);
  586|   135k|  } else {
  587|   135k|    if (pstr_sbr_env_info->harmonic_sbr) {
  ------------------
  |  Branch (587:9): [True: 69.4k, False: 66.4k]
  ------------------
  588|       |      // USAC Harmonic SBR data
  589|  69.4k|      payload_cnt_bits +=
  590|  69.4k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->sbr_patching_mode, 1);
  591|  69.4k|      if (0 == pstr_sbr_env_info->sbr_patching_mode) {
  ------------------
  |  Branch (591:11): [True: 58.9k, False: 10.5k]
  ------------------
  592|  58.9k|        payload_cnt_bits +=
  593|  58.9k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->sbr_oversampling_flag, 1);
  594|  58.9k|        payload_cnt_bits +=
  595|  58.9k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->sbr_pitchin_bins_flag, 1);
  596|  58.9k|        if (0 != pstr_sbr_env_info->sbr_pitchin_bins_flag) {
  ------------------
  |  Branch (596:13): [True: 58.9k, False: 0]
  ------------------
  597|  58.9k|          payload_cnt_bits +=
  598|  58.9k|              ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->sbr_pitchin_bins, 7);
  599|  58.9k|        }
  600|  58.9k|      }
  601|  69.4k|    }
  602|   135k|  }
  603|   249k|  payload_cnt_bits += ixheaace_encode_sbr_grid(pstr_sbr_env_info, pstr_bs_handle, sbr_codec);
  604|   249k|  if (sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (604:7): [True: 135k, False: 113k]
  ------------------
  605|   135k|    payload_cnt_bits += ixheaace_encode_sbr_dtdf(pstr_sbr_env_info, pstr_bs_handle, sbr_codec,
  606|   135k|                                                 pstr_sbr_env_info->usac_indep_flag,
  607|   135k|                                                 pstr_sbr_env_info->sbr_pvc_mode);
  608|   135k|  } else {
  609|   113k|    payload_cnt_bits +=
  610|   113k|        ixheaace_encode_sbr_dtdf(pstr_sbr_env_info, pstr_bs_handle, sbr_codec, 0, 0);
  611|   113k|  }
  612|       |
  613|   249k|  {
  614|   249k|    WORD32 i;
  615|   771k|    for (i = 0; i < pstr_sbr_env_info->noise_band_count; i++) {
  ------------------
  |  Branch (615:17): [True: 522k, False: 249k]
  ------------------
  616|   522k|      payload_cnt_bits += ixheaace_write_bits(
  617|   522k|          pstr_bs_handle, pstr_sbr_env_info->sbr_invf_mode_vec[i], SI_SBR_INVF_MODE_BITS);
  ------------------
  |  |  155|   522k|#define SI_SBR_INVF_MODE_BITS (2)
  ------------------
  618|   522k|    }
  619|   249k|  }
  620|   249k|  if (sbr_codec != USAC_SBR) {
  ------------------
  |  Branch (620:7): [True: 113k, False: 135k]
  ------------------
  621|   113k|    WORD32 env_data_len;
  622|   113k|    err_code =
  623|   113k|        ixheaace_write_env_data(pstr_sbr_env_info, pstr_bs_handle, 0, sbr_codec, &env_data_len);
  624|   113k|    if (err_code) {
  ------------------
  |  Branch (624:9): [True: 78, False: 113k]
  ------------------
  625|     78|      *ptr_num_bits = payload_cnt_bits;
  626|     78|      return err_code;
  627|     78|    }
  628|   113k|    payload_cnt_bits += env_data_len;
  629|   135k|  } else {
  630|   135k|    if (0 == pstr_sbr_env_info->sbr_pvc_mode) {
  ------------------
  |  Branch (630:9): [True: 111k, False: 24.0k]
  ------------------
  631|   111k|      WORD32 env_data_len;
  632|   111k|      err_code =
  633|   111k|          ixheaace_write_env_data(pstr_sbr_env_info, pstr_bs_handle, 0, sbr_codec, &env_data_len);
  634|   111k|      if (err_code) {
  ------------------
  |  Branch (634:11): [True: 0, False: 111k]
  ------------------
  635|      0|        *ptr_num_bits = payload_cnt_bits;
  636|      0|        return err_code;
  637|      0|      }
  638|   111k|      payload_cnt_bits += env_data_len;
  639|   111k|    } else {
  640|       |      // PVC envelope goes here
  641|  24.0k|      payload_cnt_bits += iusace_encode_pvc_envelope(pstr_bs_handle, &pstr_sbr_env_info->pvc_info,
  642|  24.0k|                                                     pstr_sbr_env_info->usac_indep_flag);
  643|  24.0k|    }
  644|   135k|  }
  645|   249k|  payload_cnt_bits += ixheaace_write_noise_lvl_data(pstr_sbr_env_info, pstr_bs_handle, 0);
  646|       |
  647|   249k|  if (USAC_SBR == sbr_codec) {
  ------------------
  |  Branch (647:7): [True: 135k, False: 113k]
  ------------------
  648|   135k|    payload_cnt_bits += ixheaace_write_synthetic_coding_data(
  649|   135k|        pstr_sbr_env_info, pstr_bs_handle, sbr_codec, pstr_sbr_env_info->sbr_pvc_mode);
  650|   135k|  } else {
  651|   113k|    payload_cnt_bits +=
  652|   113k|        ixheaace_write_synthetic_coding_data(pstr_sbr_env_info, pstr_bs_handle, sbr_codec, 0);
  653|   113k|  }
  654|       |
  655|   249k|  *ptr_num_bits = payload_cnt_bits;
  656|   249k|  return err_code;
  657|   249k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_sbr_grid:
  158|   762k|                                       ixheaace_sbr_codec_type sbr_codec) {
  159|   762k|  WORD32 payload_cnt_bits = 0;
  160|   762k|  WORD32 i, tmp_var;
  161|       |
  162|   762k|  if (ELD_SBR != sbr_codec) {
  ------------------
  |  Branch (162:7): [True: 603k, False: 159k]
  ------------------
  163|   603k|    if (HEAAC_SBR == sbr_codec ||
  ------------------
  |  Branch (163:9): [True: 266k, False: 336k]
  ------------------
  164|   579k|        (USAC_SBR == sbr_codec && pstr_sbr_env_info->sbr_pvc_mode == 0)) {
  ------------------
  |  Branch (164:10): [True: 336k, False: 0]
  |  Branch (164:35): [True: 312k, False: 24.0k]
  ------------------
  165|   579k|      payload_cnt_bits += ixheaace_write_bits(
  166|   579k|          pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->frame_type, SBR_CLA_BITS);
  ------------------
  |  |  141|   579k|#define SBR_CLA_BITS (2)
  ------------------
  167|       |
  168|   579k|      switch (pstr_sbr_env_info->pstr_sbr_bs_grid->frame_type) {
  169|   388k|        case IXHEAACE_FIXFIX:
  ------------------
  |  Branch (169:9): [True: 388k, False: 190k]
  ------------------
  170|       |
  171|   388k|          tmp_var = ia_enhaacplus_enc_ceil_ln2(pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_env);
  172|       |
  173|   388k|          payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_ENV_BITS);
  ------------------
  |  |  142|   388k|#define SBR_ENV_BITS (2)
  ------------------
  174|       |
  175|   388k|          payload_cnt_bits +=
  176|   388k|              ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->freq_res_fix, SBR_RES_BITS);
  ------------------
  |  |  149|   388k|#define SBR_RES_BITS (1)
  ------------------
  177|   388k|          break;
  178|       |
  179|  50.9k|        case IXHEAACE_FIXVAR:
  ------------------
  |  Branch (179:9): [True: 50.9k, False: 528k]
  ------------------
  180|  99.4k|        case IXHEAACE_VARFIX:
  ------------------
  |  Branch (180:9): [True: 48.4k, False: 531k]
  ------------------
  181|       |
  182|  99.4k|          if (pstr_sbr_env_info->pstr_sbr_bs_grid->frame_type == IXHEAACE_FIXVAR) {
  ------------------
  |  Branch (182:15): [True: 50.9k, False: 48.4k]
  ------------------
  183|  50.9k|            tmp_var = pstr_sbr_env_info->pstr_sbr_bs_grid->bs_abs_bord - 16;
  184|  50.9k|          } else {
  185|  48.4k|            tmp_var = pstr_sbr_env_info->pstr_sbr_bs_grid->bs_abs_bord;
  186|  48.4k|          }
  187|       |
  188|  99.4k|          payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_ABS_BITS);
  ------------------
  |  |  146|  99.4k|#define SBR_ABS_BITS (2)
  ------------------
  189|       |
  190|  99.4k|          payload_cnt_bits += ixheaace_write_bits(
  191|  99.4k|              pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->n, SBR_NUM_BITS);
  ------------------
  |  |  147|  99.4k|#define SBR_NUM_BITS (2)
  ------------------
  192|       |
  193|   260k|          for (i = 0; i < pstr_sbr_env_info->pstr_sbr_bs_grid->n; i++) {
  ------------------
  |  Branch (193:23): [True: 160k, False: 99.4k]
  ------------------
  194|   160k|            tmp_var = (pstr_sbr_env_info->pstr_sbr_bs_grid->bs_rel_bord[i] - 2) >> 1;
  195|       |
  196|   160k|            payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_REL_BITS);
  ------------------
  |  |  148|   160k|#define SBR_REL_BITS (2)
  ------------------
  197|   160k|          }
  198|       |
  199|  99.4k|          tmp_var = ia_enhaacplus_enc_ceil_ln2(pstr_sbr_env_info->pstr_sbr_bs_grid->n + 2);
  200|       |
  201|  99.4k|          payload_cnt_bits += ixheaace_write_bits(
  202|  99.4k|              pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->p, (UWORD8)tmp_var);
  203|       |
  204|   359k|          for (i = 0; i < pstr_sbr_env_info->pstr_sbr_bs_grid->n + 1; i++) {
  ------------------
  |  Branch (204:23): [True: 260k, False: 99.4k]
  ------------------
  205|   260k|            payload_cnt_bits += ixheaace_write_bits(
  206|   260k|                pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->v_f[i], SBR_RES_BITS);
  ------------------
  |  |  149|   260k|#define SBR_RES_BITS (1)
  ------------------
  207|   260k|          }
  208|  99.4k|          break;
  209|       |
  210|  91.2k|        case IXHEAACE_VARVAR:
  ------------------
  |  Branch (210:9): [True: 91.2k, False: 488k]
  ------------------
  211|       |
  212|  91.2k|          tmp_var = pstr_sbr_env_info->pstr_sbr_bs_grid->bs_abs_bord_0;
  213|       |
  214|  91.2k|          payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_ABS_BITS);
  ------------------
  |  |  146|  91.2k|#define SBR_ABS_BITS (2)
  ------------------
  215|  91.2k|          tmp_var = pstr_sbr_env_info->pstr_sbr_bs_grid->bs_abs_bord_1 - 16;
  216|       |
  217|  91.2k|          payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_ABS_BITS);
  ------------------
  |  |  146|  91.2k|#define SBR_ABS_BITS (2)
  ------------------
  218|       |
  219|  91.2k|          payload_cnt_bits += ixheaace_write_bits(
  220|  91.2k|              pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_0, SBR_NUM_BITS);
  ------------------
  |  |  147|  91.2k|#define SBR_NUM_BITS (2)
  ------------------
  221|       |
  222|  91.2k|          payload_cnt_bits += ixheaace_write_bits(
  223|  91.2k|              pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_1, SBR_NUM_BITS);
  ------------------
  |  |  147|  91.2k|#define SBR_NUM_BITS (2)
  ------------------
  224|       |
  225|   127k|          for (i = 0; i < pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_0; i++) {
  ------------------
  |  Branch (225:23): [True: 36.1k, False: 91.2k]
  ------------------
  226|  36.1k|            tmp_var = (pstr_sbr_env_info->pstr_sbr_bs_grid->bs_rel_bord_0[i] - 2) >> 1;
  227|       |
  228|  36.1k|            payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_REL_BITS);
  ------------------
  |  |  148|  36.1k|#define SBR_REL_BITS (2)
  ------------------
  229|  36.1k|          }
  230|       |
  231|   290k|          for (i = 0; i < pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_1; i++) {
  ------------------
  |  Branch (231:23): [True: 199k, False: 91.2k]
  ------------------
  232|   199k|            tmp_var = (pstr_sbr_env_info->pstr_sbr_bs_grid->bs_rel_bord_1[i] - 2) >> 1;
  233|       |
  234|   199k|            payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_REL_BITS);
  ------------------
  |  |  148|   199k|#define SBR_REL_BITS (2)
  ------------------
  235|   199k|          }
  236|       |
  237|  91.2k|          tmp_var =
  238|  91.2k|              ia_enhaacplus_enc_ceil_ln2(pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_0 +
  239|  91.2k|                                         pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_1 + 2);
  240|       |
  241|  91.2k|          payload_cnt_bits += ixheaace_write_bits(
  242|  91.2k|              pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->p, (UWORD8)tmp_var);
  243|       |
  244|  91.2k|          tmp_var = pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_0 +
  245|  91.2k|                    pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_rel_1 + 1;
  246|       |
  247|   417k|          for (i = 0; i < tmp_var; i++) {
  ------------------
  |  Branch (247:23): [True: 326k, False: 91.2k]
  ------------------
  248|   326k|            payload_cnt_bits += ixheaace_write_bits(
  249|   326k|                pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->v_f_lr[i], SBR_RES_BITS);
  ------------------
  |  |  149|   326k|#define SBR_RES_BITS (1)
  ------------------
  250|   326k|          }
  251|  91.2k|          break;
  252|      0|        default:
  ------------------
  |  Branch (252:9): [True: 0, False: 579k]
  ------------------
  253|      0|          break;
  254|   579k|      }
  255|   579k|    } else {
  256|       |      // If PVC mode is non-zero, bit stream parameters are updated here
  257|  24.0k|      if (pstr_sbr_env_info->no_of_envelopes > 1) {
  ------------------
  |  Branch (257:11): [True: 7.64k, False: 16.3k]
  ------------------
  258|  7.64k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 8, SBR_PVC_NOISE_POSITION_BITS);
  ------------------
  |  |  143|  7.64k|#define SBR_PVC_NOISE_POSITION_BITS (4)
  ------------------
  259|  16.3k|      } else {
  260|  16.3k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, SBR_PVC_NOISE_POSITION_BITS);
  ------------------
  |  |  143|  16.3k|#define SBR_PVC_NOISE_POSITION_BITS (4)
  ------------------
  261|  16.3k|      }
  262|  24.0k|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, SBR_PVC_VAR_LEN_HF_BITS);
  ------------------
  |  |  144|  24.0k|#define SBR_PVC_VAR_LEN_HF_BITS (1)
  ------------------
  263|  24.0k|    }
  264|   603k|  } else {
  265|   159k|    payload_cnt_bits += ixheaace_write_bits(
  266|   159k|        pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->frame_type, LDSBR_CLA_BITS);
  ------------------
  |  |  151|   159k|#define LDSBR_CLA_BITS (1)
  ------------------
  267|       |
  268|   159k|    switch (pstr_sbr_env_info->pstr_sbr_bs_grid->frame_type) {
  269|   104k|      case IXHEAACE_FIXFIX:
  ------------------
  |  Branch (269:7): [True: 104k, False: 54.3k]
  ------------------
  270|   104k|        tmp_var = ia_enhaacplus_enc_ceil_ln2(pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_env);
  271|   104k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, tmp_var, SBR_ENV_BITS);
  ------------------
  |  |  142|   104k|#define SBR_ENV_BITS (2)
  ------------------
  272|   104k|        if (pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_env == 1) {
  ------------------
  |  Branch (272:13): [True: 99.7k, False: 4.97k]
  ------------------
  273|  99.7k|          payload_cnt_bits += ixheaace_write_bits(
  274|  99.7k|              pstr_bs_handle, pstr_sbr_env_info->curr_sbr_amp_res, SI_SBR_AMP_RES_BITS);
  ------------------
  |  |  120|  99.7k|#define SI_SBR_AMP_RES_BITS (1)
  ------------------
  275|  99.7k|        }
  276|   104k|        payload_cnt_bits += ixheaace_write_bits(
  277|   104k|            pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->v_f[0], SBR_RES_BITS);
  ------------------
  |  |  149|   104k|#define SBR_RES_BITS (1)
  ------------------
  278|   104k|        break;
  279|       |
  280|  54.3k|      case IXHEAACE_LD_TRAN:
  ------------------
  |  |   26|  54.3k|#define IXHEAACE_LD_TRAN (1)
  ------------------
  |  Branch (280:7): [True: 54.3k, False: 104k]
  ------------------
  281|  54.3k|        payload_cnt_bits += ixheaace_write_bits(
  282|  54.3k|            pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->bs_transient_position,
  283|  54.3k|            IXHEAACE_SBR_TRAN_BITS);
  ------------------
  |  |   27|  54.3k|#define IXHEAACE_SBR_TRAN_BITS (4)
  ------------------
  284|   212k|        for (i = 0; i < pstr_sbr_env_info->pstr_sbr_bs_grid->bs_num_env; i++) {
  ------------------
  |  Branch (284:21): [True: 158k, False: 54.3k]
  ------------------
  285|   158k|          payload_cnt_bits += ixheaace_write_bits(
  286|   158k|              pstr_bs_handle, pstr_sbr_env_info->pstr_sbr_bs_grid->v_f[i], SBR_RES_BITS);
  ------------------
  |  |  149|   158k|#define SBR_RES_BITS (1)
  ------------------
  287|   158k|        }
  288|  54.3k|        break;
  289|      0|      default:
  ------------------
  |  Branch (289:7): [True: 0, False: 159k]
  ------------------
  290|      0|        break;
  291|   159k|    }
  292|   159k|  }
  293|       |
  294|   762k|  return payload_cnt_bits;
  295|   762k|}
ixheaace_sbr_write_bitstream.c:ia_enhaacplus_enc_ceil_ln2:
  147|   684k|static WORD32 ia_enhaacplus_enc_ceil_ln2(WORD32 x) {
  148|   684k|  WORD32 tmp = -1;
  149|       |
  150|  1.16M|  while (ixheaac_shl32(1, ++tmp) < x)
  ------------------
  |  Branch (150:10): [True: 478k, False: 684k]
  ------------------
  151|   478k|    ;
  152|       |
  153|   684k|  return (tmp);
  154|   684k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_sbr_dtdf:
  300|   944k|                                       WORD32 sbr_pvc_mode) {
  301|   944k|  WORD32 i, payload_cnt_bits = 0, num_of_noise_env;
  302|       |
  303|   944k|  num_of_noise_env = (pstr_sbr_env_info->no_of_envelopes > 1) ? 2 : 1;
  ------------------
  |  Branch (303:22): [True: 353k, False: 590k]
  ------------------
  304|       |
  305|   944k|  if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (305:7): [True: 538k, False: 405k]
  ------------------
  306|  1.64M|    for (i = 0; i < pstr_sbr_env_info->no_of_envelopes; ++i) {
  ------------------
  |  Branch (306:17): [True: 1.10M, False: 538k]
  ------------------
  307|  1.10M|      payload_cnt_bits +=
  308|  1.10M|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->domain_vec[i], SBR_DIR_BITS);
  ------------------
  |  |  150|  1.10M|#define SBR_DIR_BITS (1)
  ------------------
  309|  1.10M|    }
  310|   538k|  }
  311|       |
  312|   405k|  else {
  313|   405k|    if (sbr_pvc_mode == 0) {
  ------------------
  |  Branch (313:9): [True: 381k, False: 24.0k]
  ------------------
  314|   381k|      WORD32 start_env = 0;
  315|   381k|      if (1 == usac_indep_flag) {
  ------------------
  |  Branch (315:11): [True: 23.0k, False: 358k]
  ------------------
  316|  23.0k|        start_env = 1;
  317|  23.0k|      }
  318|   843k|      for (i = start_env; i < pstr_sbr_env_info->no_of_envelopes; ++i) {
  ------------------
  |  Branch (318:27): [True: 462k, False: 381k]
  ------------------
  319|   462k|        payload_cnt_bits +=
  320|   462k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->domain_vec[i], SBR_DIR_BITS);
  ------------------
  |  |  150|   462k|#define SBR_DIR_BITS (1)
  ------------------
  321|   462k|      }
  322|   381k|    } else {
  323|       |      /* Do nothing */
  324|  24.0k|    }
  325|   405k|  }
  326|   944k|  if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (326:7): [True: 538k, False: 405k]
  ------------------
  327|  1.35M|    for (i = 0; i < num_of_noise_env; ++i) {
  ------------------
  |  Branch (327:17): [True: 817k, False: 538k]
  ------------------
  328|   817k|      payload_cnt_bits += ixheaace_write_bits(
  329|   817k|          pstr_bs_handle, pstr_sbr_env_info->domain_vec_noise[i], SBR_DIR_BITS);
  ------------------
  |  |  150|   817k|#define SBR_DIR_BITS (1)
  ------------------
  330|   817k|    }
  331|   538k|  } else {
  332|   405k|    WORD32 start_env = 0;
  333|   405k|    if (1 == usac_indep_flag) {
  ------------------
  |  Branch (333:9): [True: 24.1k, False: 381k]
  ------------------
  334|  24.1k|      start_env = 1;
  335|  24.1k|    }
  336|       |
  337|   862k|    for (i = start_env; i < num_of_noise_env; ++i) {
  ------------------
  |  Branch (337:25): [True: 456k, False: 405k]
  ------------------
  338|   456k|      payload_cnt_bits += ixheaace_write_bits(
  339|   456k|          pstr_bs_handle, pstr_sbr_env_info->domain_vec_noise[i], SBR_DIR_BITS);
  ------------------
  |  |  150|   456k|#define SBR_DIR_BITS (1)
  ------------------
  340|   456k|    }
  341|   405k|  }
  342|   944k|  return payload_cnt_bits;
  343|   944k|}
ixheaace_sbr_write_bitstream.c:ixheaace_write_env_data:
  443|   919k|                                            WORD32 *ptr_payload_cnt_bits) {
  444|   919k|  WORD32 j, i, delta;
  445|       |
  446|   919k|  *ptr_payload_cnt_bits = 0;
  447|       |
  448|  2.50M|  for (j = 0; j < pstr_sbr_env_info->no_of_envelopes; j++) {
  ------------------
  |  Branch (448:15): [True: 1.58M, False: 919k]
  ------------------
  449|  1.58M|    if (pstr_sbr_env_info->domain_vec[j] == FREQ) {
  ------------------
  |  |  176|  1.58M|#define FREQ (0)
  ------------------
  |  Branch (449:9): [True: 1.21M, False: 372k]
  ------------------
  450|  1.21M|      if (coupling && pstr_sbr_env_info->balance) {
  ------------------
  |  Branch (450:11): [True: 416k, False: 798k]
  |  Branch (450:23): [True: 154k, False: 262k]
  ------------------
  451|   154k|        *ptr_payload_cnt_bits +=
  452|   154k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->ienvelope[j][0],
  453|   154k|                                (UWORD8)pstr_sbr_env_info->si_sbr_start_env_bits_balance);
  454|  1.06M|      } else {
  455|  1.06M|        *ptr_payload_cnt_bits +=
  456|  1.06M|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->ienvelope[j][0],
  457|  1.06M|                                (UWORD8)pstr_sbr_env_info->si_sbr_start_env_bits);
  458|  1.06M|      }
  459|  1.21M|    }
  460|       |
  461|  16.3M|    for (i = 1 - pstr_sbr_env_info->domain_vec[j]; i < pstr_sbr_env_info->no_scf_bands[j]; i++) {
  ------------------
  |  Branch (461:52): [True: 14.7M, False: 1.58M]
  ------------------
  462|  14.7M|      delta = pstr_sbr_env_info->ienvelope[j][i];
  463|       |
  464|  14.7M|      if (coupling && pstr_sbr_env_info->balance) {
  ------------------
  |  Branch (464:11): [True: 5.55M, False: 9.23M]
  |  Branch (464:23): [True: 2.83M, False: 2.72M]
  ------------------
  465|  2.83M|        if (abs(delta) > pstr_sbr_env_info->code_book_scf_lav_balance) {
  ------------------
  |  Branch (465:13): [True: 0, False: 2.83M]
  ------------------
  466|      0|          return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_CODEBOOK;
  467|      0|        }
  468|  11.9M|      } else {
  469|  11.9M|        if (abs(delta) > pstr_sbr_env_info->code_book_scf_lav) {
  ------------------
  |  Branch (469:13): [True: 460, False: 11.9M]
  ------------------
  470|    460|          return IA_EXHEAACE_EXE_FATAL_SBR_INVALID_CODEBOOK;
  471|    460|        }
  472|  11.9M|      }
  473|       |
  474|  14.7M|      if (coupling) {
  ------------------
  |  Branch (474:11): [True: 5.55M, False: 9.23M]
  ------------------
  475|  5.55M|        if (pstr_sbr_env_info->balance) {
  ------------------
  |  Branch (475:13): [True: 2.83M, False: 2.72M]
  ------------------
  476|  2.83M|          if (pstr_sbr_env_info->domain_vec[j]) {
  ------------------
  |  Branch (476:15): [True: 1.37M, False: 1.45M]
  ------------------
  477|  1.37M|            *ptr_payload_cnt_bits += ixheaace_write_bits(
  478|  1.37M|                pstr_bs_handle,
  479|  1.37M|                pstr_sbr_env_info
  480|  1.37M|                    ->ptr_huff_tab_bal_time_c[delta +
  481|  1.37M|                                              pstr_sbr_env_info->code_book_scf_lav_balance],
  482|  1.37M|                pstr_sbr_env_info
  483|  1.37M|                    ->ptr_huff_tab_bal_time_l[delta +
  484|  1.37M|                                              pstr_sbr_env_info->code_book_scf_lav_balance]);
  485|  1.45M|          } else {
  486|  1.45M|            *ptr_payload_cnt_bits += ixheaace_write_bits(
  487|  1.45M|                pstr_bs_handle,
  488|  1.45M|                pstr_sbr_env_info
  489|  1.45M|                    ->ptr_huff_tab_bal_freq_c[delta +
  490|  1.45M|                                              pstr_sbr_env_info->code_book_scf_lav_balance],
  491|  1.45M|                pstr_sbr_env_info
  492|  1.45M|                    ->ptr_huff_tab_bal_freq_l[delta +
  493|  1.45M|                                              pstr_sbr_env_info->code_book_scf_lav_balance]);
  494|  1.45M|          }
  495|  2.83M|        } else {
  496|  2.72M|          if (pstr_sbr_env_info->domain_vec[j]) {
  ------------------
  |  Branch (496:15): [True: 550k, False: 2.17M]
  ------------------
  497|   550k|            *ptr_payload_cnt_bits += ixheaace_write_bits(
  498|   550k|                pstr_bs_handle,
  499|   550k|                pstr_sbr_env_info
  500|   550k|                    ->ptr_huff_tab_lvl_time_c[delta + pstr_sbr_env_info->code_book_scf_lav],
  501|   550k|                pstr_sbr_env_info
  502|   550k|                    ->ptr_huff_tab_lvl_time_l[delta + pstr_sbr_env_info->code_book_scf_lav]);
  503|  2.17M|          } else {
  504|  2.17M|            *ptr_payload_cnt_bits += ixheaace_write_bits(
  505|  2.17M|                pstr_bs_handle,
  506|  2.17M|                pstr_sbr_env_info
  507|  2.17M|                    ->ptr_huff_tab_lvl_freq_c[delta + pstr_sbr_env_info->code_book_scf_lav],
  508|  2.17M|                pstr_sbr_env_info
  509|  2.17M|                    ->ptr_huff_tab_lvl_freq_l[delta + pstr_sbr_env_info->code_book_scf_lav]);
  510|  2.17M|          }
  511|  2.72M|        }
  512|  9.23M|      } else {
  513|  9.23M|        if (pstr_sbr_env_info->domain_vec[j]) {
  ------------------
  |  Branch (513:13): [True: 1.52M, False: 7.70M]
  ------------------
  514|  1.52M|          *ptr_payload_cnt_bits += ixheaace_write_bits(
  515|  1.52M|              pstr_bs_handle,
  516|  1.52M|              pstr_sbr_env_info
  517|  1.52M|                  ->ptr_huff_tab_time_c[delta + pstr_sbr_env_info->code_book_scf_lav],
  518|  1.52M|              pstr_sbr_env_info
  519|  1.52M|                  ->ptr_huff_tab_time_l[delta + pstr_sbr_env_info->code_book_scf_lav]);
  520|  7.70M|        } else {
  521|  7.70M|          *ptr_payload_cnt_bits += ixheaace_write_bits(
  522|  7.70M|              pstr_bs_handle,
  523|  7.70M|              pstr_sbr_env_info
  524|  7.70M|                  ->ptr_huff_tab_freq_c[delta + pstr_sbr_env_info->code_book_scf_lav],
  525|  7.70M|              pstr_sbr_env_info
  526|  7.70M|                  ->ptr_huff_tab_freq_l[delta + pstr_sbr_env_info->code_book_scf_lav]);
  527|  7.70M|        }
  528|  9.23M|      }
  529|  14.7M|    }
  530|  1.58M|    if (USAC_SBR == sbr_codec) {
  ------------------
  |  Branch (530:9): [True: 485k, False: 1.10M]
  ------------------
  531|   485k|      if (1 == pstr_sbr_env_info->sbr_inter_tes) {
  ------------------
  |  Branch (531:11): [True: 207k, False: 277k]
  ------------------
  532|   207k|        *ptr_payload_cnt_bits +=
  533|   207k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->ptr_sbr_inter_tes_shape[j],
  534|   207k|                                IXHEAACE_SBR_TES_SHAPE_BITS);
  ------------------
  |  |   37|   207k|#define IXHEAACE_SBR_TES_SHAPE_BITS (1)
  ------------------
  535|   207k|        if (1 == pstr_sbr_env_info->ptr_sbr_inter_tes_shape[j]) {
  ------------------
  |  Branch (535:13): [True: 0, False: 207k]
  ------------------
  536|      0|          *ptr_payload_cnt_bits += ixheaace_write_bits(
  537|      0|              pstr_bs_handle, pstr_sbr_env_info->ptr_sbr_inter_tes_shape_mode[j],
  538|      0|              IXHEAACE_SBR_TES_SHAPE_MODE_BITS);
  ------------------
  |  |   38|      0|#define IXHEAACE_SBR_TES_SHAPE_MODE_BITS (2)
  ------------------
  539|      0|        }
  540|   207k|      }
  541|   485k|    }
  542|  1.58M|  }
  543|       |
  544|   919k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   919k|#define IA_NO_ERROR 0x00000000
  ------------------
  545|   919k|}
ixheaace_sbr_write_bitstream.c:iusace_encode_pvc_envelope:
  107|  24.0k|                                         WORD32 usac_indep_flag) {
  108|  24.0k|  WORD32 payload_cnt_bits = 0;
  109|  24.0k|  payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_pvc_bs_data->div_mode,
  110|  24.0k|                                          IXHEAACE_ESBR_PVC_DIV_MODE_BITS);
  ------------------
  |  |   39|  24.0k|#define IXHEAACE_ESBR_PVC_DIV_MODE_BITS (3)
  ------------------
  111|  24.0k|  payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_pvc_bs_data->ns_mode,
  112|  24.0k|                                          IXHEAACE_ESBR_PVC_NS_MODE_BITS);
  ------------------
  |  |   40|  24.0k|#define IXHEAACE_ESBR_PVC_NS_MODE_BITS (1)
  ------------------
  113|       |
  114|  24.0k|  if (0 == pstr_pvc_bs_data->div_mode) {
  ------------------
  |  Branch (114:7): [True: 14.8k, False: 9.17k]
  ------------------
  115|  14.8k|    if (1 == usac_indep_flag) {
  ------------------
  |  Branch (115:9): [True: 755, False: 14.1k]
  ------------------
  116|    755|      payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_pvc_bs_data->pvc_id_bs[0],
  117|    755|                                              IXHEAACE_ESBR_PVC_ID_BITS);
  ------------------
  |  |   41|    755|#define IXHEAACE_ESBR_PVC_ID_BITS (7)
  ------------------
  118|  14.1k|    } else {
  119|  14.1k|      if (1 == pstr_pvc_bs_data->grid_info[0]) {
  ------------------
  |  Branch (119:11): [True: 2.16k, False: 11.9k]
  ------------------
  120|  2.16k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, IXHEAACE_ESBR_PVC_REUSE_BITS);
  ------------------
  |  |   43|  2.16k|#define IXHEAACE_ESBR_PVC_REUSE_BITS (1)
  ------------------
  121|  2.16k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_pvc_bs_data->pvc_id_bs[0],
  122|  2.16k|                                                IXHEAACE_ESBR_PVC_ID_BITS);
  ------------------
  |  |   41|  2.16k|#define IXHEAACE_ESBR_PVC_ID_BITS (7)
  ------------------
  123|  11.9k|      } else {
  124|  11.9k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 1, IXHEAACE_ESBR_PVC_REUSE_BITS);
  ------------------
  |  |   43|  11.9k|#define IXHEAACE_ESBR_PVC_REUSE_BITS (1)
  ------------------
  125|  11.9k|      }
  126|  14.1k|    }
  127|  14.8k|  } else if (pstr_pvc_bs_data->div_mode <= 3) {
  ------------------
  |  Branch (127:14): [True: 0, False: 9.17k]
  ------------------
  128|       |    /* Do nothing */
  129|  9.17k|  } else {
  130|  9.17k|    WORD32 gi, is_grid_info;
  131|  27.5k|    for (gi = 0; gi < pstr_pvc_bs_data->num_grid_info; gi++) {
  ------------------
  |  Branch (131:18): [True: 18.3k, False: 9.17k]
  ------------------
  132|  18.3k|      if (gi == 0 && 1 == usac_indep_flag) {
  ------------------
  |  Branch (132:11): [True: 9.17k, False: 9.17k]
  |  Branch (132:22): [True: 353, False: 8.81k]
  ------------------
  133|    353|        is_grid_info = 1;
  134|  17.9k|      } else {
  135|  17.9k|        is_grid_info = pstr_pvc_bs_data->grid_info[gi];
  136|  17.9k|        payload_cnt_bits +=
  137|  17.9k|            ixheaace_write_bits(pstr_bs_handle, is_grid_info, IXHEAACE_ESBR_PVC_GRID_INFO_BITS);
  ------------------
  |  |   42|  17.9k|#define IXHEAACE_ESBR_PVC_GRID_INFO_BITS (1)
  ------------------
  138|  17.9k|      }
  139|  18.3k|      if (is_grid_info) {
  ------------------
  |  Branch (139:11): [True: 15.4k, False: 2.87k]
  ------------------
  140|  15.4k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, pstr_pvc_bs_data->pvc_id_bs[gi],
  141|  15.4k|                                                IXHEAACE_ESBR_PVC_ID_BITS);
  ------------------
  |  |   41|  15.4k|#define IXHEAACE_ESBR_PVC_ID_BITS (7)
  ------------------
  142|  15.4k|      }
  143|  18.3k|    }
  144|  9.17k|  }
  145|  24.0k|  return payload_cnt_bits;
  146|  24.0k|}
ixheaace_sbr_write_bitstream.c:ixheaace_write_noise_lvl_data:
  347|   943k|                                            WORD32 coupling) {
  348|   943k|  WORD32 j, i, payload_cnt_bits = 0;
  349|   943k|  WORD32 n_noise_envelopes = ((pstr_sbr_env_info->no_of_envelopes > 1) ? 2 : 1);
  ------------------
  |  Branch (349:31): [True: 352k, False: 590k]
  ------------------
  350|       |
  351|  2.23M|  for (i = 0; i < n_noise_envelopes; i++) {
  ------------------
  |  Branch (351:15): [True: 1.29M, False: 943k]
  ------------------
  352|  1.29M|    switch (pstr_sbr_env_info->domain_vec_noise[i]) {
  ------------------
  |  Branch (352:13): [True: 1.29M, False: 0]
  ------------------
  353|   550k|      case FREQ:
  ------------------
  |  |  176|   550k|#define FREQ (0)
  ------------------
  |  Branch (353:7): [True: 550k, False: 746k]
  ------------------
  354|       |
  355|   550k|        if (coupling && pstr_sbr_env_info->balance) {
  ------------------
  |  Branch (355:13): [True: 165k, False: 384k]
  |  Branch (355:25): [True: 48.0k, False: 117k]
  ------------------
  356|  48.0k|          payload_cnt_bits += ixheaace_write_bits(
  357|  48.0k|              pstr_bs_handle,
  358|  48.0k|              pstr_sbr_env_info->noise_level[i * pstr_sbr_env_info->noise_band_count],
  359|  48.0k|              (UWORD8)pstr_sbr_env_info->si_sbr_start_noise_bits_balance);
  360|   502k|        } else {
  361|   502k|          payload_cnt_bits += ixheaace_write_bits(
  362|   502k|              pstr_bs_handle,
  363|   502k|              pstr_sbr_env_info->noise_level[i * pstr_sbr_env_info->noise_band_count],
  364|   502k|              (UWORD8)pstr_sbr_env_info->si_sbr_start_noise_bits);
  365|   502k|        }
  366|       |
  367|   550k|        for (j = 1 + i * pstr_sbr_env_info->noise_band_count;
  368|  1.45M|             j < (pstr_sbr_env_info->noise_band_count * (1 + i)); j++) {
  ------------------
  |  Branch (368:14): [True: 908k, False: 550k]
  ------------------
  369|   908k|          if (coupling) {
  ------------------
  |  Branch (369:15): [True: 255k, False: 653k]
  ------------------
  370|   255k|            if (pstr_sbr_env_info->balance) {
  ------------------
  |  Branch (370:17): [True: 64.1k, False: 191k]
  ------------------
  371|  64.1k|              payload_cnt_bits += ixheaace_write_bits(
  372|  64.1k|                  pstr_bs_handle,
  373|  64.1k|                  pstr_sbr_env_info
  374|  64.1k|                      ->ptr_huff_tab_noise_bal_freq_c[pstr_sbr_env_info->noise_level[j] +
  375|  64.1k|                                                      CODE_BCK_SCF_LAV_BALANCE11],
  ------------------
  |  |  182|  64.1k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
  376|  64.1k|                  pstr_sbr_env_info
  377|  64.1k|                      ->ptr_huff_tab_noise_bal_freq_l[pstr_sbr_env_info->noise_level[j] +
  378|  64.1k|                                                      CODE_BCK_SCF_LAV_BALANCE11]);
  ------------------
  |  |  182|  64.1k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
  379|   191k|            } else {
  380|   191k|              payload_cnt_bits += ixheaace_write_bits(
  381|   191k|                  pstr_bs_handle,
  382|   191k|                  pstr_sbr_env_info
  383|   191k|                      ->ptr_huff_tab_noise_lvl_freq_c[pstr_sbr_env_info->noise_level[j] +
  384|   191k|                                                      CODE_BCK_SCF_LAV11],
  ------------------
  |  |  181|   191k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  385|   191k|                  pstr_sbr_env_info
  386|   191k|                      ->ptr_huff_tab_noise_lvl_freq_l[pstr_sbr_env_info->noise_level[j] +
  387|   191k|                                                      CODE_BCK_SCF_LAV11]);
  ------------------
  |  |  181|   191k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  388|   191k|            }
  389|   653k|          } else {
  390|   653k|            payload_cnt_bits += ixheaace_write_bits(
  391|   653k|                pstr_bs_handle,
  392|   653k|                pstr_sbr_env_info->ptr_huff_tab_noise_freq_c[pstr_sbr_env_info->noise_level[j] +
  393|   653k|                                                             CODE_BCK_SCF_LAV11],
  ------------------
  |  |  181|   653k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  394|   653k|                pstr_sbr_env_info->ptr_huff_tab_noise_freq_l[pstr_sbr_env_info->noise_level[j] +
  395|   653k|                                                             CODE_BCK_SCF_LAV11]);
  ------------------
  |  |  181|   653k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  396|   653k|          }
  397|   908k|        }
  398|   550k|        break;
  399|       |
  400|   746k|      case TIME:
  ------------------
  |  |  177|   746k|#define TIME (1)
  ------------------
  |  Branch (400:7): [True: 746k, False: 550k]
  ------------------
  401|   746k|        for (j = i * pstr_sbr_env_info->noise_band_count;
  402|  2.71M|             j < (pstr_sbr_env_info->noise_band_count * (1 + i)); j++) {
  ------------------
  |  Branch (402:14): [True: 1.97M, False: 746k]
  ------------------
  403|  1.97M|          if (coupling) {
  ------------------
  |  Branch (403:15): [True: 912k, False: 1.06M]
  ------------------
  404|   912k|            if (pstr_sbr_env_info->balance) {
  ------------------
  |  Branch (404:17): [True: 554k, False: 357k]
  ------------------
  405|   554k|              payload_cnt_bits += ixheaace_write_bits(
  406|   554k|                  pstr_bs_handle,
  407|   554k|                  pstr_sbr_env_info
  408|   554k|                      ->ptr_huff_tab_noise_bal_time_c[pstr_sbr_env_info->noise_level[j] +
  409|   554k|                                                      CODE_BCK_SCF_LAV_BALANCE11],
  ------------------
  |  |  182|   554k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
  410|   554k|                  pstr_sbr_env_info
  411|   554k|                      ->ptr_huff_tab_noise_bal_time_l[pstr_sbr_env_info->noise_level[j] +
  412|   554k|                                                      CODE_BCK_SCF_LAV_BALANCE11]);
  ------------------
  |  |  182|   554k|#define CODE_BCK_SCF_LAV_BALANCE11 (12)
  ------------------
  413|   554k|            } else {
  414|   357k|              payload_cnt_bits += ixheaace_write_bits(
  415|   357k|                  pstr_bs_handle,
  416|   357k|                  pstr_sbr_env_info
  417|   357k|                      ->ptr_huff_tab_noise_lvl_time_c[pstr_sbr_env_info->noise_level[j] +
  418|   357k|                                                      CODE_BCK_SCF_LAV11],
  ------------------
  |  |  181|   357k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  419|   357k|                  pstr_sbr_env_info
  420|   357k|                      ->ptr_huff_tab_noise_lvl_time_l[pstr_sbr_env_info->noise_level[j] +
  421|   357k|                                                      CODE_BCK_SCF_LAV11]);
  ------------------
  |  |  181|   357k|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  422|   357k|            }
  423|  1.06M|          } else {
  424|  1.06M|            payload_cnt_bits += ixheaace_write_bits(
  425|  1.06M|                pstr_bs_handle,
  426|  1.06M|                pstr_sbr_env_info
  427|  1.06M|                    ->ptr_huff_tab_noise_lvl_time_c[pstr_sbr_env_info->noise_level[j] +
  428|  1.06M|                                                    CODE_BCK_SCF_LAV11],
  ------------------
  |  |  181|  1.06M|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  429|  1.06M|                pstr_sbr_env_info
  430|  1.06M|                    ->ptr_huff_tab_noise_lvl_time_l[pstr_sbr_env_info->noise_level[j] +
  431|  1.06M|                                                    CODE_BCK_SCF_LAV11]);
  ------------------
  |  |  181|  1.06M|#define CODE_BCK_SCF_LAV11 (31)
  ------------------
  432|  1.06M|          }
  433|  1.97M|        }
  434|   746k|        break;
  435|  1.29M|    }
  436|  1.29M|  }
  437|   943k|  return payload_cnt_bits;
  438|   943k|}
ixheaace_sbr_write_bitstream.c:ixheaace_write_synthetic_coding_data:
  552|   943k|{
  553|   943k|  WORD32 i;
  554|   943k|  WORD32 payload_cnt_bits = 0;
  555|       |
  556|   943k|  payload_cnt_bits +=
  557|   943k|      ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->add_harmonic_flag, 1);
  558|       |
  559|   943k|  if (pstr_sbr_env_info->add_harmonic_flag) {
  ------------------
  |  Branch (559:7): [True: 322k, False: 620k]
  ------------------
  560|  4.16M|    for (i = 0; i < pstr_sbr_env_info->no_harmonics; i++) {
  ------------------
  |  Branch (560:17): [True: 3.83M, False: 322k]
  ------------------
  561|  3.83M|      payload_cnt_bits +=
  562|  3.83M|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_info->add_harmonic[i], 1);
  563|  3.83M|    }
  564|   322k|    if (USAC_SBR == sbr_codec && 0 != sbr_pvc_mode) {
  ------------------
  |  Branch (564:9): [True: 131k, False: 190k]
  |  Branch (564:34): [True: 12.7k, False: 119k]
  ------------------
  565|  12.7k|      if (pstr_sbr_env_info->sbr_sinusoidal_pos_flag) {
  ------------------
  |  Branch (565:11): [True: 0, False: 12.7k]
  ------------------
  566|      0|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 1, 1);
  567|      0|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 31, 5);
  568|  12.7k|      } else {
  569|  12.7k|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, 1);
  570|  12.7k|      }
  571|  12.7k|    }
  572|   322k|  }
  573|   943k|  return payload_cnt_bits;
  574|   943k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_extended_data:
  909|   325k|                                          ixheaace_str_esbr_bs_data *pstr_esbr_data) {
  910|   325k|  WORD32 ext_data_size;
  911|   325k|  WORD32 payload_bits_in = *ptr_payload_bits;
  912|   325k|  WORD32 payload_cnt_bits = 0;
  913|       |
  914|   325k|  ext_data_size = ixheaace_get_sbr_extended_data_size(pstr_ps_handle, is_hdr_active, pstr_sbr_tab,
  915|   325k|                                                      is_esbr, pstr_esbr_data);
  916|       |
  917|   325k|  if (ext_data_size != 0) {
  ------------------
  |  Branch (917:7): [True: 68.0k, False: 257k]
  ------------------
  918|  68.0k|    if (pstr_ps_handle && ixheaace_append_ps_bitstream(pstr_ps_handle, NULL_PTR, 0)) {
  ------------------
  |  |   23|  19.7k|#define NULL_PTR ((void *)0)
  ------------------
  |  Branch (918:9): [True: 19.7k, False: 48.3k]
  |  Branch (918:27): [True: 19.7k, False: 0]
  ------------------
  919|  19.7k|      ixheaace_bit_buf bitbuf_tmp;
  920|  19.7k|      UWORD8 tmp[IXHEAACE_MAX_PAYLOAD_SIZE];
  921|  19.7k|      WORD32 max_ext_size = (1 << SI_SBR_EXTENSION_SIZE_BITS) - 1;
  ------------------
  |  |  166|  19.7k|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  922|  19.7k|      WORD32 num_bits;
  923|       |
  924|  19.7k|      num_bits = ia_enhaacplus_enc_get_bits_available(&pstr_ps_handle->ps_bit_buf);
  925|  19.7k|      num_bits += SI_SBR_EXTENSION_ID_BITS;
  ------------------
  |  |  168|  19.7k|#define SI_SBR_EXTENSION_ID_BITS (2)
  ------------------
  926|  19.7k|      if (is_esbr) {
  ------------------
  |  Branch (926:11): [True: 10.5k, False: 9.13k]
  ------------------
  927|  10.5k|        num_bits += ixheaace_get_esbr_ext_data_size(pstr_esbr_data);
  928|  10.5k|        num_bits += SI_SBR_EXTENSION_ID_BITS;
  ------------------
  |  |  168|  10.5k|#define SI_SBR_EXTENSION_ID_BITS (2)
  ------------------
  929|  10.5k|      }
  930|  19.7k|      ext_data_size = (num_bits + 7) >> 3;
  931|  19.7k|      if (ia_enhaacplus_enc_get_bits_available(pstr_bs_prev) == 0) {
  ------------------
  |  Branch (931:11): [True: 244, False: 19.4k]
  ------------------
  932|    244|        pstr_ps_handle->hdr_bits_prev_frame = *ptr_sbr_hdr_bits;
  933|    244|        ia_enhaacplus_enc_copy_bitbuf(pstr_bs_handle, pstr_bs_prev);
  934|  19.4k|      } else {
  935|  19.4k|        WORD32 tmp_bits;
  936|  19.4k|        ia_enhaacplus_enc_create_bitbuffer(&bitbuf_tmp, tmp, sizeof(tmp));
  937|  19.4k|        tmp_bits = *ptr_sbr_hdr_bits;
  938|  19.4k|        *ptr_sbr_hdr_bits = pstr_ps_handle->hdr_bits_prev_frame;
  939|  19.4k|        pstr_ps_handle->hdr_bits_prev_frame = tmp_bits;
  940|  19.4k|        ixheaace_copy_bitbuf_to_and_fro(pstr_bs_prev, pstr_bs_handle);
  941|  19.4k|      }
  942|  19.7k|      ixheaace_write_bits(pstr_bs_handle, 1, SI_SBR_EXTENDED_DATA_BITS);
  ------------------
  |  |  165|  19.7k|#define SI_SBR_EXTENDED_DATA_BITS (1)
  ------------------
  943|       |
  944|  19.7k|      if (ext_data_size < max_ext_size) {
  ------------------
  |  Branch (944:11): [True: 19.1k, False: 564]
  ------------------
  945|  19.1k|        ixheaace_write_bits(pstr_bs_handle, ext_data_size, SI_SBR_EXTENSION_SIZE_BITS);
  ------------------
  |  |  166|  19.1k|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  946|  19.1k|      } else {
  947|    564|        ixheaace_write_bits(pstr_bs_handle, max_ext_size, SI_SBR_EXTENSION_SIZE_BITS);
  ------------------
  |  |  166|    564|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  948|    564|        ixheaace_write_bits(pstr_bs_handle, ext_data_size - max_ext_size,
  949|    564|                            SI_SBR_EXTENSION_ESC_COUNT_BITS);
  ------------------
  |  |  167|    564|#define SI_SBR_EXTENSION_ESC_COUNT_BITS (8)
  ------------------
  950|    564|      }
  951|  19.7k|      WORD32 start_bits = pstr_bs_handle->cnt_bits;
  952|  19.7k|      *ptr_payload_bits =
  953|  19.7k|          ixheaace_append_ps_bitstream(pstr_ps_handle, pstr_bs_handle, ptr_sbr_hdr_bits);
  954|       |
  955|  19.7k|      if (is_esbr) {
  ------------------
  |  Branch (955:11): [True: 10.5k, False: 9.13k]
  ------------------
  956|  10.5k|        *ptr_payload_bits += iexhaace_esbr_write_bs(pstr_esbr_data, pstr_bs_handle);
  957|  10.5k|      }
  958|       |
  959|  19.7k|      WORD32 fill_bits = (ext_data_size << 3) - (pstr_bs_handle->cnt_bits - start_bits);
  960|  19.7k|      ixheaace_write_bits(pstr_bs_handle, 0, (UWORD8)fill_bits);
  961|  19.7k|      *ptr_payload_bits = *ptr_payload_bits + fill_bits;
  962|  48.3k|    } else {
  963|  48.3k|      if (is_esbr) {
  ------------------
  |  Branch (963:11): [True: 48.3k, False: 0]
  ------------------
  964|  48.3k|        WORD32 max_ext_size = (1 << SI_SBR_EXTENSION_SIZE_BITS) - 1;
  ------------------
  |  |  166|  48.3k|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  965|  48.3k|        WORD32 num_bits;
  966|  48.3k|        num_bits = ixheaace_get_esbr_ext_data_size(pstr_esbr_data);
  967|  48.3k|        ext_data_size = (num_bits + SI_SBR_EXTENSION_ID_BITS + 7) >> 3;
  ------------------
  |  |  168|  48.3k|#define SI_SBR_EXTENSION_ID_BITS (2)
  ------------------
  968|  48.3k|        ixheaace_write_bits(pstr_bs_handle, 1, SI_SBR_EXTENDED_DATA_BITS);
  ------------------
  |  |  165|  48.3k|#define SI_SBR_EXTENDED_DATA_BITS (1)
  ------------------
  969|  48.3k|        if (ext_data_size < max_ext_size) {
  ------------------
  |  Branch (969:13): [True: 48.3k, False: 0]
  ------------------
  970|  48.3k|          ixheaace_write_bits(pstr_bs_handle, ext_data_size, SI_SBR_EXTENSION_SIZE_BITS);
  ------------------
  |  |  166|  48.3k|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  971|  48.3k|        } else {
  972|      0|          ixheaace_write_bits(pstr_bs_handle, max_ext_size, SI_SBR_EXTENSION_SIZE_BITS);
  ------------------
  |  |  166|      0|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  973|      0|          ixheaace_write_bits(pstr_bs_handle, ext_data_size - max_ext_size,
  974|      0|                              SI_SBR_EXTENSION_ESC_COUNT_BITS);
  ------------------
  |  |  167|      0|#define SI_SBR_EXTENSION_ESC_COUNT_BITS (8)
  ------------------
  975|      0|        }
  976|  48.3k|        WORD32 start_bits = pstr_bs_handle->cnt_bits;
  977|  48.3k|        *ptr_payload_bits += iexhaace_esbr_write_bs(pstr_esbr_data, pstr_bs_handle);
  978|  48.3k|        UWORD8 fill_bits =
  979|  48.3k|            (UWORD8)((ext_data_size << 3) - (pstr_bs_handle->cnt_bits - start_bits));
  980|  48.3k|        ixheaace_write_bits(pstr_bs_handle, 0, fill_bits);
  981|  48.3k|        *ptr_payload_bits = *ptr_payload_bits + fill_bits;
  982|  48.3k|      } else {
  983|      0|        WORD32 max_ext_size = (1 << SI_SBR_EXTENSION_SIZE_BITS) - 1;
  ------------------
  |  |  166|      0|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  984|      0|        payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 1, SI_SBR_EXTENDED_DATA_BITS);
  ------------------
  |  |  165|      0|#define SI_SBR_EXTENDED_DATA_BITS (1)
  ------------------
  985|       |
  986|      0|        if (ext_data_size < max_ext_size) {
  ------------------
  |  Branch (986:13): [True: 0, False: 0]
  ------------------
  987|      0|          payload_cnt_bits +=
  988|      0|              ixheaace_write_bits(pstr_bs_handle, ext_data_size, SI_SBR_EXTENSION_SIZE_BITS);
  ------------------
  |  |  166|      0|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  989|      0|        } else {
  990|      0|          payload_cnt_bits +=
  991|      0|              ixheaace_write_bits(pstr_bs_handle, max_ext_size, SI_SBR_EXTENSION_SIZE_BITS);
  ------------------
  |  |  166|      0|#define SI_SBR_EXTENSION_SIZE_BITS (4)
  ------------------
  992|       |
  993|      0|          payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, ext_data_size - max_ext_size,
  994|      0|                                                  SI_SBR_EXTENSION_ESC_COUNT_BITS);
  ------------------
  |  |  167|      0|#define SI_SBR_EXTENSION_ESC_COUNT_BITS (8)
  ------------------
  995|      0|        }
  996|       |
  997|      0|        *ptr_payload_bits = payload_cnt_bits + payload_bits_in;
  998|      0|      }
  999|  48.3k|    }
 1000|   257k|  } else {
 1001|   257k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, SI_SBR_EXTENDED_DATA_BITS);
  ------------------
  |  |  165|   257k|#define SI_SBR_EXTENDED_DATA_BITS (1)
  ------------------
 1002|       |
 1003|   257k|    *ptr_payload_bits = payload_cnt_bits + payload_bits_in;
 1004|   257k|  }
 1005|   325k|}
ixheaace_sbr_write_bitstream.c:ixheaace_get_sbr_extended_data_size:
  884|   325k|                                                  ixheaace_str_esbr_bs_data *pstr_esbr_data) {
  885|   325k|  WORD32 ext_data_bits = 0;
  886|       |
  887|   325k|  if (pstr_ps_handle) {
  ------------------
  |  Branch (887:7): [True: 19.7k, False: 305k]
  ------------------
  888|  19.7k|    ext_data_bits +=
  889|  19.7k|        ixheaace_enc_write_ps_data(pstr_ps_handle, is_hdr_active, pstr_sbr_tab->ptr_ps_tab);
  890|  19.7k|  }
  891|   325k|  if (is_esbr) {
  ------------------
  |  Branch (891:7): [True: 84.9k, False: 240k]
  ------------------
  892|  84.9k|    ext_data_bits += ixheaace_get_esbr_ext_data_size(pstr_esbr_data);
  893|  84.9k|  }
  894|       |
  895|   325k|  if (ext_data_bits != 0) {
  ------------------
  |  Branch (895:7): [True: 68.0k, False: 257k]
  ------------------
  896|  68.0k|    ext_data_bits += SI_SBR_EXTENSION_ID_BITS;
  ------------------
  |  |  168|  68.0k|#define SI_SBR_EXTENSION_ID_BITS (2)
  ------------------
  897|  68.0k|  }
  898|       |
  899|   325k|  return (ext_data_bits + 7) >> 3;
  900|   325k|}
ixheaace_sbr_write_bitstream.c:ixheaace_get_esbr_ext_data_size:
   62|   143k|static WORD32 ixheaace_get_esbr_ext_data_size(ixheaace_str_esbr_bs_data *pstr_esbr_bs_data) {
   63|   143k|  WORD32 num_bits = 1;
   64|   143k|  if (1 == pstr_esbr_bs_data->sbr_num_chan) {
  ------------------
  |  Branch (64:7): [True: 68.8k, False: 75.0k]
  ------------------
   65|  68.8k|    num_bits += 1;
   66|  68.8k|    if (pstr_esbr_bs_data->sbr_patching_mode[0] == 0) {
  ------------------
  |  Branch (66:9): [True: 50.0k, False: 18.7k]
  ------------------
   67|  50.0k|      num_bits += 2;
   68|  50.0k|      if (pstr_esbr_bs_data->sbr_pitchin_flags[0] == 1) {
  ------------------
  |  Branch (68:11): [True: 42.5k, False: 7.50k]
  ------------------
   69|  42.5k|        num_bits += 7;
   70|  42.5k|      }
   71|  50.0k|    }
   72|  75.0k|  } else if (2 == pstr_esbr_bs_data->sbr_num_chan) {
  ------------------
  |  Branch (72:14): [True: 49.0k, False: 26.0k]
  ------------------
   73|  49.0k|    if (pstr_esbr_bs_data->sbr_coupling) {
  ------------------
  |  Branch (73:9): [True: 25.9k, False: 23.0k]
  ------------------
   74|  25.9k|      num_bits += 1;
   75|  25.9k|      if (pstr_esbr_bs_data->sbr_patching_mode[0] == 0) {
  ------------------
  |  Branch (75:11): [True: 18.4k, False: 7.49k]
  ------------------
   76|  18.4k|        num_bits += 2;
   77|  18.4k|        if (pstr_esbr_bs_data->sbr_pitchin_flags[0] == 1) {
  ------------------
  |  Branch (77:13): [True: 17.9k, False: 580]
  ------------------
   78|  17.9k|          num_bits += 7;
   79|  17.9k|        }
   80|  18.4k|      }
   81|  25.9k|    } else {
   82|  23.0k|      num_bits += 1;
   83|  23.0k|      if (pstr_esbr_bs_data->sbr_patching_mode[0] == 0) {
  ------------------
  |  Branch (83:11): [True: 11.5k, False: 11.4k]
  ------------------
   84|  11.5k|        num_bits += 2;
   85|  11.5k|        if (pstr_esbr_bs_data->sbr_pitchin_flags[0] == 1) {
  ------------------
  |  Branch (85:13): [True: 10.2k, False: 1.33k]
  ------------------
   86|  10.2k|          num_bits += 7;
   87|  10.2k|        }
   88|  11.5k|      }
   89|  23.0k|      num_bits += 1;
   90|  23.0k|      if (pstr_esbr_bs_data->sbr_patching_mode[1] == 0) {
  ------------------
  |  Branch (90:11): [True: 12.5k, False: 10.4k]
  ------------------
   91|  12.5k|        num_bits += 2;
   92|  12.5k|        if (pstr_esbr_bs_data->sbr_pitchin_flags[1] == 1) {
  ------------------
  |  Branch (92:13): [True: 10.2k, False: 2.33k]
  ------------------
   93|  10.2k|          num_bits += 7;
   94|  10.2k|        }
   95|  12.5k|      }
   96|  23.0k|    }
   97|  49.0k|  } else {
   98|  26.0k|    num_bits = 0;
   99|  26.0k|  }
  100|   143k|  if (num_bits != 0 && num_bits < 6) {
  ------------------
  |  Branch (100:7): [True: 117k, False: 26.0k]
  |  Branch (100:24): [True: 45.8k, False: 72.0k]
  ------------------
  101|  45.8k|    num_bits = 6;
  102|  45.8k|  }
  103|   143k|  return num_bits;
  104|   143k|}
ixheaace_sbr_write_bitstream.c:iexhaace_esbr_write_bs:
  817|  58.9k|                                     ixheaace_bit_buf_handle pstr_bs_handle) {
  818|  58.9k|  WORD32 num_bits = 0;
  819|  58.9k|  num_bits +=
  820|  58.9k|      ixheaace_write_bits(pstr_bs_handle, EXTENSION_ID_ESBR_CODING, SI_SBR_EXTENSION_ID_BITS);
  ------------------
  |  |  173|  58.9k|#define EXTENSION_ID_ESBR_CODING (3)
  ------------------
                    ixheaace_write_bits(pstr_bs_handle, EXTENSION_ID_ESBR_CODING, SI_SBR_EXTENSION_ID_BITS);
  ------------------
  |  |  168|  58.9k|#define SI_SBR_EXTENSION_ID_BITS (2)
  ------------------
  821|  58.9k|  num_bits += ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_preprocessing, 1);
  822|  58.9k|  if (1 == pstr_esbr_bs_data->sbr_num_chan) {
  ------------------
  |  Branch (822:7): [True: 34.4k, False: 24.5k]
  ------------------
  823|  34.4k|    num_bits += ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_patching_mode[0], 1);
  824|  34.4k|    if (pstr_esbr_bs_data->sbr_patching_mode[0] == 0) {
  ------------------
  |  Branch (824:9): [True: 25.0k, False: 9.39k]
  ------------------
  825|  25.0k|      num_bits +=
  826|  25.0k|          ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_oversampling_flag[0], 1);
  827|  25.0k|      num_bits += ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_flags[0], 1);
  828|  25.0k|      if (pstr_esbr_bs_data->sbr_pitchin_flags[0] == 1) {
  ------------------
  |  Branch (828:11): [True: 21.2k, False: 3.75k]
  ------------------
  829|  21.2k|        num_bits +=
  830|  21.2k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_bins[0], 7);
  831|  21.2k|      }
  832|  25.0k|    }
  833|  34.4k|  } else if (2 == pstr_esbr_bs_data->sbr_num_chan) {
  ------------------
  |  Branch (833:14): [True: 24.5k, False: 0]
  ------------------
  834|  24.5k|    if (pstr_esbr_bs_data->sbr_coupling) {
  ------------------
  |  Branch (834:9): [True: 12.9k, False: 11.5k]
  ------------------
  835|  12.9k|      num_bits += ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_patching_mode[0], 1);
  836|  12.9k|      if (pstr_esbr_bs_data->sbr_patching_mode[0] == 0) {
  ------------------
  |  Branch (836:11): [True: 9.24k, False: 3.74k]
  ------------------
  837|  9.24k|        num_bits +=
  838|  9.24k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_oversampling_flag[0], 1);
  839|  9.24k|        num_bits +=
  840|  9.24k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_flags[0], 1);
  841|  9.24k|        if (pstr_esbr_bs_data->sbr_pitchin_flags[0] == 1) {
  ------------------
  |  Branch (841:13): [True: 8.95k, False: 290]
  ------------------
  842|  8.95k|          num_bits +=
  843|  8.95k|              ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_bins[0], 7);
  844|  8.95k|        }
  845|  9.24k|      }
  846|  12.9k|    } else {
  847|  11.5k|      num_bits += ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_patching_mode[0], 1);
  848|  11.5k|      if (pstr_esbr_bs_data->sbr_patching_mode[0] == 0) {
  ------------------
  |  Branch (848:11): [True: 5.79k, False: 5.72k]
  ------------------
  849|  5.79k|        num_bits +=
  850|  5.79k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_oversampling_flag[0], 1);
  851|  5.79k|        num_bits +=
  852|  5.79k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_flags[0], 1);
  853|  5.79k|        if (pstr_esbr_bs_data->sbr_pitchin_flags[0] == 1) {
  ------------------
  |  Branch (853:13): [True: 5.12k, False: 665]
  ------------------
  854|  5.12k|          num_bits +=
  855|  5.12k|              ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_bins[0], 7);
  856|  5.12k|        } else {
  857|    665|          pstr_esbr_bs_data->sbr_patching_mode[0] = pstr_esbr_bs_data->sbr_patching_mode[0];
  858|    665|        }
  859|  5.79k|      }
  860|  11.5k|      num_bits += ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_patching_mode[1], 1);
  861|  11.5k|      if (pstr_esbr_bs_data->sbr_patching_mode[1] == 0) {
  ------------------
  |  Branch (861:11): [True: 6.27k, False: 5.23k]
  ------------------
  862|  6.27k|        num_bits +=
  863|  6.27k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_oversampling_flag[1], 1);
  864|  6.27k|        num_bits +=
  865|  6.27k|            ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_flags[1], 1);
  866|  6.27k|        if (pstr_esbr_bs_data->sbr_pitchin_flags[1] == 1) {
  ------------------
  |  Branch (866:13): [True: 5.10k, False: 1.16k]
  ------------------
  867|  5.10k|          num_bits +=
  868|  5.10k|              ixheaace_write_bits(pstr_bs_handle, pstr_esbr_bs_data->sbr_pitchin_bins[0], 7);
  869|  5.10k|        }
  870|  6.27k|      }
  871|  11.5k|    }
  872|  24.5k|  }
  873|  58.9k|  if (num_bits < 8) {
  ------------------
  |  Branch (873:7): [True: 22.9k, False: 36.0k]
  ------------------
  874|  22.9k|    num_bits += ixheaace_write_bits(pstr_bs_handle, 0, (UWORD8)(8 - num_bits));
  875|  22.9k|  }
  876|       |
  877|  58.9k|  return num_bits;
  878|  58.9k|}
ixheaace_sbr_write_bitstream.c:ixheaace_encode_sbr_channel_pair_element:
  662|   347k|    WORD32 coupling, ixheaace_sbr_codec_type sbr_codec, WORD32 *ptr_num_bits) {
  663|   347k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   347k|#define IA_NO_ERROR 0x00000000
  ------------------
  664|   347k|  WORD32 payload_cnt_bits = 0;
  665|   347k|  WORD32 env_data_len;
  666|   347k|  WORD32 i = 0;
  667|       |
  668|   347k|  if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (668:7): [True: 212k, False: 134k]
  ------------------
  669|   212k|    payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, 0, 1); /* no reserved bits */
  670|   212k|  }
  671|       |
  672|   347k|  payload_cnt_bits += ixheaace_write_bits(pstr_bs_handle, coupling, SI_SBR_COUPLING_BITS);
  ------------------
  |  |  121|   347k|#define SI_SBR_COUPLING_BITS (1)
  ------------------
  673|       |
  674|   347k|  if (coupling) {
  ------------------
  |  Branch (674:7): [True: 181k, False: 165k]
  ------------------
  675|   181k|    if (sbr_codec == USAC_SBR && pstr_sbr_env_data_left->harmonic_sbr) {
  ------------------
  |  Branch (675:9): [True: 68.8k, False: 112k]
  |  Branch (675:34): [True: 40.0k, False: 28.7k]
  ------------------
  676|       |      // USAC Harmonic SBR data
  677|  40.0k|      payload_cnt_bits +=
  678|  40.0k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_patching_mode, 1);
  679|  40.0k|      if (0 == pstr_sbr_env_data_left->sbr_patching_mode) {
  ------------------
  |  Branch (679:11): [True: 24.4k, False: 15.6k]
  ------------------
  680|  24.4k|        payload_cnt_bits +=
  681|  24.4k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_oversampling_flag, 1);
  682|  24.4k|        payload_cnt_bits +=
  683|  24.4k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_pitchin_bins_flag, 1);
  684|  24.4k|        if (0 != pstr_sbr_env_data_left->sbr_pitchin_bins_flag) {
  ------------------
  |  Branch (684:13): [True: 24.1k, False: 342]
  ------------------
  685|  24.1k|          payload_cnt_bits +=
  686|  24.1k|              ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_pitchin_bins, 7);
  687|  24.1k|        }
  688|  24.4k|      }
  689|  40.0k|    }
  690|   181k|    payload_cnt_bits +=
  691|   181k|        ixheaace_encode_sbr_grid(pstr_sbr_env_data_left, pstr_bs_handle, sbr_codec);
  692|       |
  693|   181k|    payload_cnt_bits +=
  694|   181k|        ixheaace_encode_sbr_dtdf(pstr_sbr_env_data_left, pstr_bs_handle, sbr_codec,
  695|   181k|                                 pstr_sbr_env_data_left->usac_indep_flag, 0);
  696|       |
  697|   181k|    payload_cnt_bits +=
  698|   181k|        ixheaace_encode_sbr_dtdf(pstr_sbr_env_data_right, pstr_bs_handle, sbr_codec,
  699|   181k|                                 pstr_sbr_env_data_left->usac_indep_flag, 0);
  700|       |
  701|   672k|    for (i = 0; i < pstr_sbr_env_data_left->noise_band_count; i++) {
  ------------------
  |  Branch (701:17): [True: 490k, False: 181k]
  ------------------
  702|   490k|      payload_cnt_bits += ixheaace_write_bits(
  703|   490k|          pstr_bs_handle, pstr_sbr_env_data_left->sbr_invf_mode_vec[i], SI_SBR_INVF_MODE_BITS);
  ------------------
  |  |  155|   490k|#define SI_SBR_INVF_MODE_BITS (2)
  ------------------
  704|   490k|    }
  705|       |
  706|   181k|    err_code = ixheaace_write_env_data(pstr_sbr_env_data_left, pstr_bs_handle, 1, sbr_codec,
  707|   181k|                                       &env_data_len);
  708|   181k|    if (err_code) {
  ------------------
  |  Branch (708:9): [True: 0, False: 181k]
  ------------------
  709|      0|      *ptr_num_bits = payload_cnt_bits;
  710|      0|      return err_code;
  711|      0|    }
  712|       |
  713|   181k|    payload_cnt_bits += env_data_len;
  714|       |
  715|   181k|    payload_cnt_bits += ixheaace_write_noise_lvl_data(pstr_sbr_env_data_left, pstr_bs_handle, 1);
  716|       |
  717|   181k|    err_code = ixheaace_write_env_data(pstr_sbr_env_data_right, pstr_bs_handle, 1, sbr_codec,
  718|   181k|                                       &env_data_len);
  719|   181k|    if (err_code) {
  ------------------
  |  Branch (719:9): [True: 0, False: 181k]
  ------------------
  720|      0|      *ptr_num_bits = payload_cnt_bits;
  721|      0|      return err_code;
  722|      0|    }
  723|   181k|    payload_cnt_bits += env_data_len;
  724|       |
  725|   181k|    payload_cnt_bits += ixheaace_write_noise_lvl_data(pstr_sbr_env_data_right, pstr_bs_handle, 1);
  726|       |
  727|   181k|    payload_cnt_bits += ixheaace_write_synthetic_coding_data(pstr_sbr_env_data_left,
  728|   181k|                                                             pstr_bs_handle, sbr_codec, 0);
  729|       |
  730|   181k|    payload_cnt_bits += ixheaace_write_synthetic_coding_data(pstr_sbr_env_data_right,
  731|   181k|                                                             pstr_bs_handle, sbr_codec, 0);
  732|   181k|  } else {
  733|   165k|    if (sbr_codec == USAC_SBR && pstr_sbr_env_data_left->harmonic_sbr) {
  ------------------
  |  Branch (733:9): [True: 66.0k, False: 99.7k]
  |  Branch (733:34): [True: 38.1k, False: 27.9k]
  ------------------
  734|       |      // USAC Harmonic SBR data
  735|  38.1k|      payload_cnt_bits +=
  736|  38.1k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_patching_mode, 1);
  737|  38.1k|      if (0 == pstr_sbr_env_data_left->sbr_patching_mode) {
  ------------------
  |  Branch (737:11): [True: 22.9k, False: 15.2k]
  ------------------
  738|  22.9k|        payload_cnt_bits +=
  739|  22.9k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_oversampling_flag, 1);
  740|  22.9k|        payload_cnt_bits +=
  741|  22.9k|            ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_pitchin_bins_flag, 1);
  742|  22.9k|        if (0 != pstr_sbr_env_data_left->sbr_pitchin_bins_flag) {
  ------------------
  |  Branch (742:13): [True: 22.5k, False: 342]
  ------------------
  743|  22.5k|          payload_cnt_bits +=
  744|  22.5k|              ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_left->sbr_pitchin_bins, 7);
  745|  22.5k|        }
  746|  22.9k|      }
  747|       |
  748|  38.1k|      payload_cnt_bits +=
  749|  38.1k|          ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_right->sbr_patching_mode, 1);
  750|  38.1k|      if (0 == pstr_sbr_env_data_right->sbr_patching_mode) {
  ------------------
  |  Branch (750:11): [True: 22.8k, False: 15.2k]
  ------------------
  751|  22.8k|        payload_cnt_bits += ixheaace_write_bits(
  752|  22.8k|            pstr_bs_handle, pstr_sbr_env_data_right->sbr_oversampling_flag, 1);
  753|  22.8k|        payload_cnt_bits += ixheaace_write_bits(
  754|  22.8k|            pstr_bs_handle, pstr_sbr_env_data_right->sbr_pitchin_bins_flag, 1);
  755|  22.8k|        if (0 != pstr_sbr_env_data_right->sbr_pitchin_bins_flag) {
  ------------------
  |  Branch (755:13): [True: 17.8k, False: 5.05k]
  ------------------
  756|  17.8k|          payload_cnt_bits +=
  757|  17.8k|              ixheaace_write_bits(pstr_bs_handle, pstr_sbr_env_data_right->sbr_pitchin_bins, 7);
  758|  17.8k|        }
  759|  22.8k|      }
  760|  38.1k|    }
  761|   165k|    payload_cnt_bits +=
  762|   165k|        ixheaace_encode_sbr_grid(pstr_sbr_env_data_left, pstr_bs_handle, sbr_codec);
  763|       |
  764|   165k|    payload_cnt_bits +=
  765|   165k|        ixheaace_encode_sbr_grid(pstr_sbr_env_data_right, pstr_bs_handle, sbr_codec);
  766|       |
  767|   165k|    payload_cnt_bits +=
  768|   165k|        ixheaace_encode_sbr_dtdf(pstr_sbr_env_data_left, pstr_bs_handle, sbr_codec,
  769|   165k|                                 pstr_sbr_env_data_left->usac_indep_flag, 0);
  770|       |
  771|   165k|    payload_cnt_bits +=
  772|   165k|        ixheaace_encode_sbr_dtdf(pstr_sbr_env_data_right, pstr_bs_handle, sbr_codec,
  773|   165k|                                 pstr_sbr_env_data_left->usac_indep_flag, 0);
  774|       |
  775|   681k|    for (i = 0; i < pstr_sbr_env_data_left->noise_band_count; i++) {
  ------------------
  |  Branch (775:17): [True: 516k, False: 165k]
  ------------------
  776|   516k|      payload_cnt_bits += ixheaace_write_bits(
  777|   516k|          pstr_bs_handle, pstr_sbr_env_data_left->sbr_invf_mode_vec[i], SI_SBR_INVF_MODE_BITS);
  ------------------
  |  |  155|   516k|#define SI_SBR_INVF_MODE_BITS (2)
  ------------------
  778|   516k|    }
  779|       |
  780|   681k|    for (i = 0; i < pstr_sbr_env_data_right->noise_band_count; i++) {
  ------------------
  |  Branch (780:17): [True: 516k, False: 165k]
  ------------------
  781|   516k|      payload_cnt_bits += ixheaace_write_bits(
  782|   516k|          pstr_bs_handle, pstr_sbr_env_data_right->sbr_invf_mode_vec[i], SI_SBR_INVF_MODE_BITS);
  ------------------
  |  |  155|   516k|#define SI_SBR_INVF_MODE_BITS (2)
  ------------------
  783|   516k|    }
  784|       |
  785|   165k|    err_code = ixheaace_write_env_data(pstr_sbr_env_data_left, pstr_bs_handle, 0, sbr_codec,
  786|   165k|                                       &env_data_len);
  787|   165k|    if (err_code) {
  ------------------
  |  Branch (787:9): [True: 316, False: 165k]
  ------------------
  788|    316|      *ptr_num_bits = payload_cnt_bits;
  789|    316|      return err_code;
  790|    316|    }
  791|   165k|    payload_cnt_bits += env_data_len;
  792|       |
  793|   165k|    err_code = ixheaace_write_env_data(pstr_sbr_env_data_right, pstr_bs_handle, 0, sbr_codec,
  794|   165k|                                       &env_data_len);
  795|   165k|    if (err_code) {
  ------------------
  |  Branch (795:9): [True: 66, False: 165k]
  ------------------
  796|     66|      *ptr_num_bits = payload_cnt_bits;
  797|     66|      return err_code;
  798|     66|    }
  799|   165k|    payload_cnt_bits += env_data_len;
  800|       |
  801|   165k|    payload_cnt_bits += ixheaace_write_noise_lvl_data(pstr_sbr_env_data_left, pstr_bs_handle, 0);
  802|       |
  803|   165k|    payload_cnt_bits += ixheaace_write_noise_lvl_data(pstr_sbr_env_data_right, pstr_bs_handle, 0);
  804|       |
  805|   165k|    payload_cnt_bits += ixheaace_write_synthetic_coding_data(pstr_sbr_env_data_left,
  806|   165k|                                                             pstr_bs_handle, sbr_codec, 0);
  807|       |
  808|   165k|    payload_cnt_bits += ixheaace_write_synthetic_coding_data(pstr_sbr_env_data_right,
  809|   165k|                                                             pstr_bs_handle, sbr_codec, 0);
  810|   165k|  }
  811|       |
  812|   347k|  *ptr_num_bits = payload_cnt_bits;
  813|   347k|  return err_code;
  814|   347k|}

iaace_calc_form_fac_per_chan:
   56|   448k|                                  FLOAT32 *ptr_sfb_ld_energy) {
   57|   448k|  WORD32 i, j, sfb_offs;
   58|   448k|  WORD32 sfb, sfb_width;
   59|       |
   60|   448k|  memset(ptr_sfb_num_relevant_lines, 0,
   61|   448k|         sizeof(*ptr_sfb_num_relevant_lines) * pstr_psy_out_chan->sfb_count);
   62|       |
   63|   448k|  memset(ptr_sfb_ld_energy, 0, sizeof(*ptr_sfb_ld_energy) * pstr_psy_out_chan->sfb_count);
   64|       |
   65|  1.14M|  for (sfb_offs = 0; sfb_offs < pstr_psy_out_chan->sfb_count;
  ------------------
  |  Branch (65:22): [True: 699k, False: 448k]
  ------------------
   66|   699k|       sfb_offs += pstr_psy_out_chan->sfb_per_group) {
   67|   699k|    i = sfb_offs;
   68|  13.2M|    for (sfb = 0; sfb < pstr_psy_out_chan->max_sfb_per_grp; sfb++, i++) {
  ------------------
  |  Branch (68:19): [True: 12.5M, False: 699k]
  ------------------
   69|  12.5M|      ptr_sfb_form_factor[i] = MIN_FLT_VAL;
  ------------------
  |  |   58|  12.5M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
   70|  12.5M|      if (pstr_psy_out_chan->ptr_sfb_energy[i] > pstr_psy_out_chan->ptr_sfb_thr[i]) {
  ------------------
  |  Branch (70:11): [True: 8.03M, False: 4.54M]
  ------------------
   71|  8.03M|        FLOAT32 avg_form_factor;
   72|       |
   73|   113M|        for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (73:53): [True: 105M, False: 8.03M]
  ------------------
   74|   105M|             j++) {
   75|   105M|          ptr_sfb_form_factor[i] += (FLOAT32)sqrt(fabs(pstr_psy_out_chan->ptr_spec_coeffs[j]));
   76|   105M|        }
   77|       |
   78|  8.03M|        sfb_width = pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i];
   79|  8.03M|        avg_form_factor =
   80|  8.03M|            (FLOAT32)pow(pstr_psy_out_chan->ptr_sfb_energy[i] / (FLOAT32)sfb_width, 0.25f);
   81|  8.03M|        ptr_sfb_num_relevant_lines[i] = ptr_sfb_form_factor[i] / avg_form_factor;
   82|  8.03M|        ptr_sfb_ld_energy[i] = (FLOAT32)(log(pstr_psy_out_chan->ptr_sfb_energy[i]) * LOG2_1);
  ------------------
  |  |   23|  8.03M|#define LOG2_1 1.442695041f /* 1/log(2) */
  ------------------
   83|  8.03M|      }
   84|  12.5M|    }
   85|   699k|  }
   86|   448k|}
iaace_estimate_scfs_chan:
  628|   308k|    WORD32 chn, WORD32 frame_len_long) {
  629|   308k|  WORD16 *ptr_scalefactor;
  630|   308k|  WORD32 *global_gain;
  631|   308k|  FLOAT32 *ptr_sfb_form_factor;
  632|   308k|  FLOAT32 *ptr_sfb_num_relevant_lines_ch;
  633|   308k|  WORD16 *ptr_quant_spec;
  634|   308k|  WORD32 i, ch, j;
  635|   308k|  FLOAT32 thresh, energy, energy_part, thr_part;
  636|   308k|  FLOAT32 scf_float;
  637|   308k|  WORD16 scf_int = 0, min_scf = 0, max_scf = 0;
  638|   308k|  FLOAT32 max_spec = 0.0f;
  639|   308k|  WORD16 min_sf_max_quant[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  640|   308k|  FLOAT32 sfb_dist[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  641|   308k|  WORD16 min_calc_scf[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  642|   308k|  WORD16 quant_spec_temp[FRAME_LEN_1024];
  643|   308k|  FLOAT32 ptr_exp_spec[FRAME_LEN_1024];
  644|   308k|  FLOAT32 ptr_mdct_spec[FRAME_LEN_1024];
  645|       |
  646|   308k|  memset(quant_spec_temp, 0, frame_len_long * sizeof(quant_spec_temp[0]));
  647|   308k|  memset(ptr_mdct_spec, 0, frame_len_long * sizeof(ptr_mdct_spec[0]));
  648|   308k|  memset(ptr_exp_spec, 0, frame_len_long * sizeof(ptr_exp_spec[0]));
  649|       |
  650|   757k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (650:18): [True: 448k, False: 308k]
  ------------------
  651|   448k|    ixheaace_psy_out_channel *pstr_psy_out_chan = pstr_psy_out[ch];
  652|   448k|    pstr_qc_out_chan[ch]->global_gain = 0;
  653|       |
  654|   448k|    memset(pstr_qc_out_chan[ch]->scalefactor, 0,
  655|   448k|           sizeof(*pstr_qc_out_chan[ch]->scalefactor) * pstr_psy_out[ch]->sfb_count);
  656|   448k|    memset(pstr_qc_out_chan[ch]->quant_spec, 0,
  657|   448k|           sizeof(*pstr_qc_out_chan[ch]->quant_spec) * frame_len_long);
  658|       |
  659|   448k|    ptr_scalefactor = pstr_qc_out_chan[ch]->scalefactor;
  660|   448k|    global_gain = &pstr_qc_out_chan[ch]->global_gain;
  661|   448k|    ptr_sfb_form_factor = &sfb_form_factor_ch[ch][0];
  662|   448k|    ptr_sfb_num_relevant_lines_ch = &sfb_num_relevant_lines_ch[ch][0];
  663|   448k|    ptr_quant_spec = pstr_qc_out_chan[ch]->quant_spec;
  664|       |
  665|  18.4M|    for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (665:17): [True: 17.9M, False: 448k]
  ------------------
  666|  17.9M|      thresh = pstr_psy_out_chan->ptr_sfb_thr[i];
  667|  17.9M|      energy = pstr_psy_out_chan->ptr_sfb_energy[i];
  668|  17.9M|      max_spec = 0.0f;
  669|       |
  670|   362M|      for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (670:51): [True: 344M, False: 17.9M]
  ------------------
  671|   344M|           j++) {
  672|   344M|        max_spec = (FLOAT32)MAX(max_spec, fabsf(pstr_psy_out_chan->ptr_spec_coeffs[j]));
  ------------------
  |  |   24|   344M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 117M, False: 226M]
  |  |  ------------------
  ------------------
  673|   344M|      }
  674|       |
  675|  17.9M|      ptr_scalefactor[i] = MIN_SHRT_VAL;
  ------------------
  |  |   59|  17.9M|#define MIN_SHRT_VAL (-32768)
  ------------------
  676|  17.9M|      min_sf_max_quant[i] = MIN_SHRT_VAL;
  ------------------
  |  |   59|  17.9M|#define MIN_SHRT_VAL (-32768)
  ------------------
  677|       |
  678|  17.9M|      if ((max_spec > 0.0) && (energy > thresh) && (ptr_sfb_form_factor[i] != MIN_FLT_VAL)) {
  ------------------
  |  |   58|  7.12M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (678:11): [True: 10.3M, False: 7.61M]
  |  Branch (678:31): [True: 7.12M, False: 3.25M]
  |  Branch (678:52): [True: 7.12M, False: 5.86k]
  ------------------
  679|  7.12M|        energy_part = (FLOAT32)log10(ptr_sfb_form_factor[i]);
  680|       |
  681|  7.12M|        thr_part = (FLOAT32)log10(6.75 * thresh + MIN_FLT_VAL);
  ------------------
  |  |   58|  7.12M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  682|  7.12M|        scf_float = 8.8585f * (thr_part - energy_part);
  683|  7.12M|        scf_int = (WORD16)floor(scf_float);
  684|  7.12M|        min_sf_max_quant[i] = (WORD16)floor(C1_SF + C2_SF * log(max_spec));
  ------------------
  |  |   77|  7.12M|#define C1_SF -69.33295f /* -16/3*log(MAX_QUANT+0.5-logCon)/log(2) */
  ------------------
                      min_sf_max_quant[i] = (WORD16)floor(C1_SF + C2_SF * log(max_spec));
  ------------------
  |  |   78|  7.12M|#define C2_SF 5.77078f   /* 4/log(2) */
  ------------------
  685|  7.12M|        scf_int = MAX(scf_int, min_sf_max_quant[i]);
  ------------------
  |  |   24|  7.12M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 7.12M, False: 338]
  |  |  ------------------
  ------------------
  686|  7.12M|        scf_int = MAX(scf_int, MIN_GAIN_INDEX_AAC);
  ------------------
  |  |   24|  7.12M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 7.12M, False: 0]
  |  |  ------------------
  ------------------
  687|  7.12M|        scf_int = MIN(scf_int, (MAX_GAIN_INDEX_AAC - SCF_COUNT_LIMIT_AAC - 1));
  ------------------
  |  |   23|  7.12M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.12M, False: 0]
  |  |  ------------------
  ------------------
  688|   100M|        for (j = 0; j < pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i];
  ------------------
  |  Branch (688:21): [True: 93.5M, False: 7.12M]
  ------------------
  689|  93.5M|             j++) {
  690|  93.5M|          ptr_exp_spec[pstr_psy_out_chan->sfb_offsets[i] + j] = (FLOAT32)(
  691|  93.5M|              pstr_psy_out_chan->ptr_spec_coeffs[pstr_psy_out_chan->sfb_offsets[i] + j]);
  692|  93.5M|          ptr_mdct_spec[pstr_psy_out_chan->sfb_offsets[i] + j] = (FLOAT32)(
  693|  93.5M|              pstr_psy_out_chan->ptr_spec_coeffs[pstr_psy_out_chan->sfb_offsets[i] + j]);
  694|  93.5M|        }
  695|       |
  696|  7.12M|        iaace_calculate_exp_spec(
  697|  7.12M|            pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i],
  698|  7.12M|            ptr_exp_spec + pstr_psy_out_chan->sfb_offsets[i],
  699|  7.12M|            ptr_mdct_spec + pstr_psy_out_chan->sfb_offsets[i]);
  700|       |
  701|  7.12M|        scf_int = iaace_improve_scf(
  702|  7.12M|            ptr_mdct_spec + pstr_psy_out_chan->sfb_offsets[i],
  703|  7.12M|            ptr_exp_spec + pstr_psy_out_chan->sfb_offsets[i],
  704|  7.12M|            ptr_quant_spec + pstr_psy_out_chan->sfb_offsets[i],
  705|  7.12M|            quant_spec_temp + pstr_psy_out_chan->sfb_offsets[i],
  706|  7.12M|            pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i], thresh,
  707|  7.12M|            scf_int, min_sf_max_quant[i], &sfb_dist[i], &min_calc_scf[i]);
  708|       |
  709|  7.12M|        ptr_scalefactor[i] = scf_int;
  710|  7.12M|      }
  711|  17.9M|    }
  712|       |
  713|   448k|    {
  714|   448k|      FLOAT32 sfb_const_pe_part[MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  715|       |
  716|  18.4M|      for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (716:19): [True: 17.9M, False: 448k]
  ------------------
  717|  17.9M|        sfb_const_pe_part[i] = MIN_FLT_VAL;
  ------------------
  |  |   58|  17.9M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  718|  17.9M|      }
  719|       |
  720|   448k|      iaace_assimilate_single_scf(pstr_psy_out_chan, ptr_exp_spec, ptr_quant_spec,
  721|   448k|                                  quant_spec_temp, ptr_scalefactor, min_sf_max_quant, sfb_dist,
  722|   448k|                                  sfb_const_pe_part, ptr_sfb_form_factor,
  723|   448k|                                  ptr_sfb_num_relevant_lines_ch, min_calc_scf, ptr_mdct_spec);
  724|       |
  725|   448k|      iaace_assimilate_multiple_scf(pstr_psy_out_chan, ptr_exp_spec, ptr_quant_spec,
  726|   448k|                                    quant_spec_temp, ptr_scalefactor, min_sf_max_quant, sfb_dist,
  727|   448k|                                    sfb_const_pe_part, ptr_sfb_form_factor,
  728|   448k|                                    ptr_sfb_num_relevant_lines_ch, ptr_mdct_spec);
  729|   448k|    }
  730|       |
  731|   448k|    max_scf = MIN_SHRT_VAL;
  ------------------
  |  |   59|   448k|#define MIN_SHRT_VAL (-32768)
  ------------------
  732|   448k|    min_scf = MAX_SHRT_VAL;
  ------------------
  |  |   60|   448k|#define MAX_SHRT_VAL (32767)
  ------------------
  733|  18.4M|    for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (733:17): [True: 17.9M, False: 448k]
  ------------------
  734|  17.9M|      if (max_scf < ptr_scalefactor[i]) {
  ------------------
  |  Branch (734:11): [True: 584k, False: 17.4M]
  ------------------
  735|   584k|        max_scf = ptr_scalefactor[i];
  736|   584k|      }
  737|  17.9M|      if ((ptr_scalefactor[i] != MIN_SHRT_VAL) && (min_scf > ptr_scalefactor[i])) {
  ------------------
  |  |   59|  17.9M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (737:11): [True: 7.12M, False: 10.8M]
  |  Branch (737:51): [True: 1.36M, False: 5.75M]
  ------------------
  738|  1.36M|        min_scf = ptr_scalefactor[i];
  739|  1.36M|      }
  740|  17.9M|    }
  741|       |
  742|  18.4M|    for (i = 0; i < pstr_psy_out[ch]->sfb_count; i++) {
  ------------------
  |  Branch (742:17): [True: 17.9M, False: 448k]
  ------------------
  743|  17.9M|      if ((ptr_scalefactor[i] != MIN_SHRT_VAL) &&
  ------------------
  |  |   59|  17.9M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (743:11): [True: 7.12M, False: 10.8M]
  ------------------
  744|  7.12M|          (min_scf + MAX_SCF_DELTA) < ptr_scalefactor[i]) {
  ------------------
  |  |   74|  7.12M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (744:11): [True: 8.27k, False: 7.11M]
  ------------------
  745|  8.27k|        ptr_scalefactor[i] = min_scf + MAX_SCF_DELTA;
  ------------------
  |  |   74|  8.27k|#define MAX_SCF_DELTA 60
  ------------------
  746|       |
  747|  8.27k|        iaace_calc_sfb_dist(
  748|  8.27k|            ptr_mdct_spec + pstr_psy_out_chan->sfb_offsets[i],
  749|  8.27k|            ptr_exp_spec + pstr_psy_out_chan->sfb_offsets[i],
  750|  8.27k|            ptr_quant_spec + pstr_psy_out_chan->sfb_offsets[i],
  751|  8.27k|            pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i],
  752|  8.27k|            ptr_scalefactor[i]);
  753|  8.27k|      }
  754|  17.9M|    }
  755|       |
  756|   448k|    max_scf = MIN((min_scf + MAX_SCF_DELTA), max_scf);
  ------------------
  |  |   23|   448k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 6.36k, False: 442k]
  |  |  ------------------
  ------------------
  757|       |
  758|   448k|    if (max_scf > MIN_SHRT_VAL) {
  ------------------
  |  |   59|   448k|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (758:9): [True: 284k, False: 164k]
  ------------------
  759|   284k|      *global_gain = max_scf;
  760|  11.9M|      for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (760:19): [True: 11.6M, False: 284k]
  ------------------
  761|  11.6M|        if (ptr_scalefactor[i] == MIN_SHRT_VAL) {
  ------------------
  |  |   59|  11.6M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (761:13): [True: 4.55M, False: 7.12M]
  ------------------
  762|  4.55M|          ptr_scalefactor[i] = 0;
  763|   132M|          for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (763:55): [True: 128M, False: 4.55M]
  ------------------
  764|   128M|               j++) {
  765|   128M|            pstr_psy_out_chan->ptr_spec_coeffs[j] = 0.0f;
  766|   128M|          }
  767|  7.12M|        } else {
  768|  7.12M|          ptr_scalefactor[i] = max_scf - ptr_scalefactor[i];
  769|  7.12M|        }
  770|  11.6M|      }
  771|   284k|    } else {
  772|   164k|      *global_gain = 0;
  773|  6.47M|      for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (773:19): [True: 6.31M, False: 164k]
  ------------------
  774|  6.31M|        ptr_scalefactor[i] = 0;
  775|   128M|        for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (775:53): [True: 122M, False: 6.31M]
  ------------------
  776|   122M|             j++) {
  777|   122M|          pstr_psy_out_chan->ptr_spec_coeffs[j] = 0.0f;
  778|   122M|        }
  779|  6.31M|      }
  780|   164k|    }
  781|   448k|  }
  782|   308k|}
ixheaace_sf_estimation.c:iaace_calculate_exp_spec:
   89|  7.12M|                                     FLOAT32 *ptr_ptr_mdct_spec) {
   90|  7.12M|  WORD32 line;
   91|       |
   92|   100M|  for (line = 0; line < num_lines; line++) {
  ------------------
  |  Branch (92:18): [True: 93.5M, False: 7.12M]
  ------------------
   93|  93.5M|    FLOAT32 tmp = ptr_ptr_mdct_spec[line];
   94|  93.5M|    ptr_exp_spec[line] = (FLOAT32)sqrt(fabs(tmp));
   95|  93.5M|    ptr_exp_spec[line] *= (FLOAT32)sqrt(ptr_exp_spec[line]);
   96|  93.5M|  }
   97|  7.12M|}
ixheaace_sf_estimation.c:iaace_improve_scf:
  253|  7.12M|                                WORD16 *ptr_min_calc_scf) {
  254|  7.12M|  FLOAT32 sfb_dist;
  255|  7.12M|  WORD16 best_scf = scf;
  256|  7.12M|  WORD32 j;
  257|       |
  258|  7.12M|  sfb_dist = iaace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec, sfb_width, scf);
  259|       |
  260|  7.12M|  *ptr_min_calc_scf = scf;
  261|       |
  262|  7.12M|  if (sfb_dist > (1.25 * threshold)) {
  ------------------
  |  Branch (262:7): [True: 1.25M, False: 5.86M]
  ------------------
  263|  1.25M|    FLOAT32 best_sfb_dist = sfb_dist;
  264|       |
  265|  1.25M|    if (scf > min_scf) {
  ------------------
  |  Branch (265:9): [True: 1.25M, False: 320]
  ------------------
  266|  1.25M|      scf--;
  267|       |
  268|  1.25M|      sfb_dist = iaace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
  269|       |
  270|  1.25M|      if (sfb_dist < best_sfb_dist) {
  ------------------
  |  Branch (270:11): [True: 1.13M, False: 115k]
  ------------------
  271|  1.13M|        best_scf = scf;
  272|  1.13M|        best_sfb_dist = sfb_dist;
  273|       |
  274|  13.0M|        for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (274:21): [True: 11.8M, False: 1.13M]
  ------------------
  275|  11.8M|          ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  276|  11.8M|        }
  277|  1.13M|      }
  278|       |
  279|  1.25M|      *ptr_min_calc_scf = scf;
  280|  1.25M|    }
  281|  1.25M|    *dist = best_sfb_dist;
  282|  5.86M|  } else {
  283|  5.86M|    FLOAT32 best_sfb_dist = sfb_dist;
  284|  5.86M|    FLOAT32 allowed_sfb_dist = MIN(sfb_dist * 1.25f, threshold);
  ------------------
  |  |   23|  5.86M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.34M, False: 3.51M]
  |  |  ------------------
  ------------------
  285|  5.86M|    WORD32 count;
  286|       |
  287|  17.6M|    for (count = SCF_COUNT_LIMIT_AAC; count >= 0; count--) {
  ------------------
  |  |   88|  5.86M|#define SCF_COUNT_LIMIT_AAC (1)
  ------------------
  |  Branch (287:39): [True: 11.7M, False: 5.86M]
  ------------------
  288|  11.7M|      scf++;
  289|       |
  290|  11.7M|      sfb_dist = iaace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
  291|       |
  292|  11.7M|      if (sfb_dist < allowed_sfb_dist) {
  ------------------
  |  Branch (292:11): [True: 1.67M, False: 10.0M]
  ------------------
  293|  1.67M|        *ptr_min_calc_scf = best_scf + 1;
  294|       |
  295|  1.67M|        best_scf = scf;
  296|  1.67M|        best_sfb_dist = sfb_dist;
  297|       |
  298|  22.8M|        for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (298:21): [True: 21.1M, False: 1.67M]
  ------------------
  299|  21.1M|          ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  300|  21.1M|        }
  301|  1.67M|      }
  302|  11.7M|    }
  303|  5.86M|    *dist = best_sfb_dist;
  304|  5.86M|  }
  305|       |
  306|   100M|  for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (306:15): [True: 93.5M, False: 7.12M]
  ------------------
  307|  93.5M|    if (ptr_spec[j] < 0) {
  ------------------
  |  Branch (307:9): [True: 45.3M, False: 48.2M]
  ------------------
  308|  45.3M|      ptr_quant_spec[j] = -ptr_quant_spec[j];
  309|  45.3M|    }
  310|  93.5M|  }
  311|       |
  312|  7.12M|  return best_scf;
  313|  7.12M|}
ixheaace_sf_estimation.c:iaace_assimilate_single_scf:
  321|   448k|                                        FLOAT32 *ptr_ptr_mdct_spec) {
  322|   448k|  WORD32 sfb_prev, sfb_act, sfb_next;
  323|   448k|  WORD16 scf_act = 0, *scf_prev, *scf_next, min_scf, max_scf;
  324|   448k|  WORD32 sfb_width, sfb_offs;
  325|   448k|  FLOAT32 energy;
  326|   448k|  FLOAT32 sfb_pe_prev, sfb_pe_new;
  327|   448k|  FLOAT32 sfb_dist_new;
  328|   448k|  WORD32 j;
  329|   448k|  WORD32 success = 0;
  330|   448k|  FLOAT32 delta_pe = 0.0f, delta_pe_new, delta_pe_temp;
  331|   448k|  WORD16 prev_scf_last[MAXIMUM_GROUPED_SCALE_FACTOR_BAND],
  332|   448k|      prev_scf_next[MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  333|   448k|  FLOAT32 delta_pe_last[MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  334|   448k|  WORD32 update_min_scf;
  335|       |
  336|  18.4M|  for (j = 0; j < pstr_psy_out->sfb_count; j++) {
  ------------------
  |  Branch (336:15): [True: 17.9M, False: 448k]
  ------------------
  337|  17.9M|    prev_scf_last[j] = SHRT_MAX;
  338|  17.9M|    prev_scf_next[j] = SHRT_MAX;
  339|  17.9M|    delta_pe_last[j] = MAX_FLT_VAL;
  ------------------
  |  |   57|  17.9M|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  340|  17.9M|  }
  341|       |
  342|   448k|  sfb_prev = -1;
  343|   448k|  sfb_act = -1;
  344|   448k|  sfb_next = -1;
  345|   448k|  scf_prev = 0;
  346|   448k|  scf_next = 0;
  347|   448k|  min_scf = SHRT_MAX;
  348|   448k|  max_scf = SHRT_MAX;
  349|       |
  350|  44.8M|  do {
  351|  44.8M|    sfb_next++;
  352|       |
  353|  63.9M|    while ((sfb_next < pstr_psy_out->sfb_count) && (ptr_scf[sfb_next] == SHRT_MIN)) {
  ------------------
  |  Branch (353:12): [True: 63.4M, False: 493k]
  |  Branch (353:52): [True: 19.0M, False: 44.3M]
  ------------------
  354|  19.0M|      sfb_next++;
  355|  19.0M|    }
  356|       |
  357|  44.8M|    if ((sfb_prev >= 0) && (sfb_act >= 0) && (sfb_next < pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (357:9): [True: 37.3M, False: 7.57M]
  |  Branch (357:28): [True: 37.3M, False: 0]
  |  Branch (357:46): [True: 36.9M, False: 321k]
  ------------------
  358|  36.9M|      scf_act = ptr_scf[sfb_act];
  359|       |
  360|  36.9M|      scf_prev = ptr_scf + sfb_prev;
  361|  36.9M|      scf_next = ptr_scf + sfb_next;
  362|       |
  363|  36.9M|      min_scf = MIN(*scf_prev, *scf_next);
  ------------------
  |  |   23|  36.9M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 9.74M, False: 27.2M]
  |  |  ------------------
  ------------------
  364|       |
  365|  36.9M|      max_scf = MAX(*scf_prev, *scf_next);
  ------------------
  |  |   24|  36.9M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 16.7M, False: 20.2M]
  |  |  ------------------
  ------------------
  366|  36.9M|    } else {
  367|  7.90M|      if ((sfb_prev == -1) && (sfb_act >= 0) && (sfb_next < pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (367:11): [True: 7.57M, False: 321k]
  |  Branch (367:31): [True: 3.70M, False: 3.87M]
  |  Branch (367:49): [True: 3.69M, False: 7.51k]
  ------------------
  368|  3.69M|        scf_act = ptr_scf[sfb_act];
  369|       |
  370|  3.69M|        scf_prev = &scf_act;
  371|       |
  372|  3.69M|        scf_next = ptr_scf + sfb_next;
  373|       |
  374|  3.69M|        min_scf = *scf_next;
  375|       |
  376|  3.69M|        max_scf = *scf_next;
  377|  4.20M|      } else {
  378|  4.20M|        if ((sfb_prev >= 0) && (sfb_act >= 0) && (sfb_next == pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (378:13): [True: 321k, False: 3.87M]
  |  Branch (378:32): [True: 321k, False: 0]
  |  Branch (378:50): [True: 321k, False: 0]
  ------------------
  379|   321k|          scf_act = ptr_scf[sfb_act];
  380|       |
  381|   321k|          scf_prev = ptr_scf + sfb_prev;
  382|       |
  383|   321k|          scf_next = &scf_act;
  384|       |
  385|   321k|          min_scf = *scf_prev;
  386|       |
  387|   321k|          max_scf = *scf_prev;
  388|   321k|        }
  389|  4.20M|      }
  390|  7.90M|    }
  391|       |
  392|  44.8M|    if (sfb_act >= 0) {
  ------------------
  |  Branch (392:9): [True: 41.0M, False: 3.87M]
  ------------------
  393|  41.0M|      min_scf = MAX(min_scf, ptr_min_scf[sfb_act]);
  ------------------
  |  |   24|  41.0M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 40.9M, False: 71.8k]
  |  |  ------------------
  ------------------
  394|  41.0M|    }
  395|       |
  396|  44.8M|    if ((sfb_act >= 0) && (sfb_prev >= 0 || sfb_next < pstr_psy_out->sfb_count) &&
  ------------------
  |  Branch (396:9): [True: 41.0M, False: 3.87M]
  |  Branch (396:28): [True: 37.3M, False: 3.70M]
  |  Branch (396:45): [True: 3.69M, False: 7.51k]
  ------------------
  397|  41.0M|        (scf_act > min_scf) && (scf_act <= min_scf + MAX_SCF_DELTA) &&
  ------------------
  |  |   74|  18.5M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (397:9): [True: 18.5M, False: 22.4M]
  |  Branch (397:32): [True: 18.4M, False: 54.3k]
  ------------------
  398|  18.4M|        (scf_act >= max_scf - MAX_SCF_DELTA) &&
  ------------------
  |  |   74|  18.4M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (398:9): [True: 18.4M, False: 47.8k]
  ------------------
  399|  18.4M|        (*scf_prev != prev_scf_last[sfb_act] || *scf_next != prev_scf_next[sfb_act] ||
  ------------------
  |  Branch (399:10): [True: 6.66M, False: 11.7M]
  |  Branch (399:49): [True: 1.20M, False: 10.5M]
  ------------------
  400|  10.5M|         delta_pe < delta_pe_last[sfb_act])) {
  ------------------
  |  Branch (400:10): [True: 2.28M, False: 8.28M]
  ------------------
  401|  10.1M|      success = 0;
  402|       |
  403|  10.1M|      sfb_width = pstr_psy_out->sfb_offsets[sfb_act + 1] - pstr_psy_out->sfb_offsets[sfb_act];
  404|       |
  405|  10.1M|      sfb_offs = pstr_psy_out->sfb_offsets[sfb_act];
  406|       |
  407|  10.1M|      energy = pstr_psy_out->ptr_sfb_energy[sfb_act];
  408|       |
  409|  10.1M|      if (ptr_sfb_const_pe_part[sfb_act] == MIN_FLT_VAL) {
  ------------------
  |  |   58|  10.1M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (409:11): [True: 4.73M, False: 5.41M]
  ------------------
  410|  4.73M|        ptr_sfb_const_pe_part[sfb_act] =
  411|  4.73M|            (FLOAT32)log(energy * (FLOAT32)6.75f / ptr_sfb_form_fac[sfb_act]) * LOG2_1;
  ------------------
  |  |   23|  4.73M|#define LOG2_1 1.442695041f /* 1/log(2) */
  ------------------
  412|  4.73M|      }
  413|       |
  414|  10.1M|      sfb_pe_prev = iaace_calc_single_spec_pe(scf_act, ptr_sfb_const_pe_part[sfb_act],
  415|  10.1M|                                              ptr_sfb_num_lines[sfb_act]) +
  416|  10.1M|                    (FLOAT32)iaace_count_single_scf_bits(scf_act, *scf_prev, *scf_next);
  417|       |
  418|  10.1M|      delta_pe_new = delta_pe;
  419|  10.1M|      update_min_scf = 1;
  420|       |
  421|  35.3M|      do {
  422|  35.3M|        scf_act--;
  423|       |
  424|  35.3M|        if (scf_act < ptr_min_calc_scf[sfb_act] && scf_act >= max_scf - MAX_SCF_DELTA) {
  ------------------
  |  |   74|  29.5M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (424:13): [True: 29.5M, False: 5.79M]
  |  Branch (424:52): [True: 29.5M, False: 18.1k]
  ------------------
  425|  29.5M|          sfb_pe_new = iaace_calc_single_spec_pe(scf_act, ptr_sfb_const_pe_part[sfb_act],
  426|  29.5M|                                                 ptr_sfb_num_lines[sfb_act]) +
  427|  29.5M|                       (FLOAT32)iaace_count_single_scf_bits(scf_act, *scf_prev, *scf_next);
  428|       |
  429|  29.5M|          delta_pe_temp = delta_pe + sfb_pe_new - sfb_pe_prev;
  430|       |
  431|  29.5M|          if (delta_pe_temp < (FLOAT32)10.0f) {
  ------------------
  |  Branch (431:15): [True: 10.8M, False: 18.6M]
  ------------------
  432|  10.8M|            sfb_dist_new =
  433|  10.8M|                iaace_calc_sfb_dist(ptr_ptr_mdct_spec + sfb_offs, ptr_exp_spec + sfb_offs,
  434|  10.8M|                                    ptr_quant_spec_temp + sfb_offs, sfb_width, scf_act);
  435|       |
  436|  10.8M|            if (sfb_dist_new < ptr_sfb_dist[sfb_act]) {
  ------------------
  |  Branch (436:17): [True: 6.09M, False: 4.75M]
  ------------------
  437|  6.09M|              ptr_scf[sfb_act] = scf_act;
  438|  6.09M|              ptr_sfb_dist[sfb_act] = sfb_dist_new;
  439|       |
  440|  47.5M|              for (j = sfb_offs; j < sfb_offs + sfb_width; j++) {
  ------------------
  |  Branch (440:34): [True: 41.4M, False: 6.09M]
  ------------------
  441|  41.4M|                ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  442|       |
  443|  41.4M|                if (ptr_ptr_mdct_spec[j] < 0.0f) {
  ------------------
  |  Branch (443:21): [True: 19.8M, False: 21.5M]
  ------------------
  444|  19.8M|                  ptr_quant_spec[j] = -ptr_quant_spec[j];
  445|  19.8M|                }
  446|  41.4M|              }
  447|  6.09M|              delta_pe_new = delta_pe_temp;
  448|  6.09M|              success = 1;
  449|  6.09M|            }
  450|       |
  451|  10.8M|            if (update_min_scf) {
  ------------------
  |  Branch (451:17): [True: 10.2M, False: 598k]
  ------------------
  452|  10.2M|              ptr_min_calc_scf[sfb_act] = scf_act;
  453|  10.2M|            }
  454|  18.6M|          } else {
  455|  18.6M|            update_min_scf = 0;
  456|  18.6M|          }
  457|  29.5M|        }
  458|  35.3M|      } while (scf_act > min_scf);
  ------------------
  |  Branch (458:16): [True: 25.1M, False: 10.1M]
  ------------------
  459|       |
  460|  10.1M|      delta_pe = delta_pe_new;
  461|       |
  462|  10.1M|      prev_scf_last[sfb_act] = *scf_prev;
  463|  10.1M|      prev_scf_next[sfb_act] = *scf_next;
  464|  10.1M|      delta_pe_last[sfb_act] = delta_pe;
  465|  10.1M|    }
  466|       |
  467|  44.8M|    if (success) {
  ------------------
  |  Branch (467:9): [True: 3.42M, False: 41.4M]
  ------------------
  468|  3.42M|      sfb_prev = -1;
  469|  3.42M|      sfb_act = -1;
  470|  3.42M|      sfb_next = -1;
  471|  3.42M|      scf_prev = 0;
  472|  3.42M|      scf_next = 0;
  473|  3.42M|      min_scf = SHRT_MAX;
  474|  3.42M|      max_scf = SHRT_MAX;
  475|  3.42M|      success = 0;
  476|  41.4M|    } else {
  477|  41.4M|      sfb_prev = sfb_act;
  478|  41.4M|      sfb_act = sfb_next;
  479|  41.4M|    }
  480|  44.8M|  } while (sfb_next < pstr_psy_out->sfb_count);
  ------------------
  |  Branch (480:12): [True: 44.4M, False: 448k]
  ------------------
  481|   448k|}
ixheaace_sf_estimation.c:iaace_calc_single_spec_pe:
  119|  39.6M|                                         FLOAT32 num_lines) {
  120|  39.6M|  FLOAT32 spec_pe;
  121|  39.6M|  FLOAT32 ld_ratio;
  122|       |
  123|  39.6M|  ld_ratio = sfb_const_pe_part - (FLOAT32)0.375f * (FLOAT32)scf;
  124|       |
  125|  39.6M|  if (ld_ratio >= PE_C1) {
  ------------------
  |  |   80|  39.6M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (125:7): [True: 27.1M, False: 12.4M]
  ------------------
  126|  27.1M|    spec_pe = (FLOAT32)0.7f * num_lines * ld_ratio;
  127|  27.1M|  } else {
  128|  12.4M|    spec_pe = (FLOAT32)0.7f * num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   81|  12.4M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                  spec_pe = (FLOAT32)0.7f * num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   82|  12.4M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  129|  12.4M|  }
  130|       |
  131|  39.6M|  return spec_pe;
  132|  39.6M|}
ixheaace_sf_estimation.c:iaace_count_single_scf_bits:
  109|  39.6M|static WORD32 iaace_count_single_scf_bits(WORD32 scf, WORD32 left_scf, WORD32 right_scf) {
  110|  39.6M|  WORD32 scf_bits;
  111|       |
  112|  39.6M|  scf_bits =
  113|  39.6M|      iaace_scf_delta_bit_count(left_scf - scf) + iaace_scf_delta_bit_count(scf - right_scf);
  114|       |
  115|  39.6M|  return scf_bits;
  116|  39.6M|}
ixheaace_sf_estimation.c:iaace_scf_delta_bit_count:
   99|   132M|static WORD32 iaace_scf_delta_bit_count(WORD32 delta) {
  100|   132M|  if (delta > 60) {
  ------------------
  |  Branch (100:7): [True: 757, False: 132M]
  ------------------
  101|    757|    return (ixheaace_huffman_code_table[120][0]);
  102|    757|  }
  103|   132M|  if (delta < -60) {
  ------------------
  |  Branch (103:7): [True: 4, False: 132M]
  ------------------
  104|      4|    return (ixheaace_huffman_code_table[0][0]);
  105|      4|  }
  106|   132M|  return (ixheaace_huffman_code_table[delta + 60][0]);
  107|   132M|}
ixheaace_sf_estimation.c:iaace_assimilate_multiple_scf:
  489|   448k|                                          FLOAT32 *ptr_ptr_mdct_spec) {
  490|   448k|  WORD32 sfb, start_sfb, stop_sfb;
  491|   448k|  WORD16 scf_temp[MAXIMUM_GROUPED_SCALE_FACTOR_BAND], min_scf, max_scf, scf_act;
  492|   448k|  WORD32 possible_region_found;
  493|   448k|  WORD32 sfb_width, sfb_offs, j;
  494|   448k|  FLOAT32 sfb_dist_new[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  495|   448k|  FLOAT32 prev_dist_sum, new_dist_sum;
  496|   448k|  WORD32 delta_scf_bits;
  497|   448k|  FLOAT32 delta_spec_pe;
  498|   448k|  FLOAT32 delta_pe = 0.0f, delta_pe_new;
  499|   448k|  WORD32 sfb_count = pstr_psy_out->sfb_count;
  500|       |
  501|   448k|  min_scf = SHRT_MAX;
  502|   448k|  max_scf = SHRT_MIN;
  503|       |
  504|  18.4M|  for (sfb = 0; sfb < sfb_count; sfb++) {
  ------------------
  |  Branch (504:17): [True: 17.9M, False: 448k]
  ------------------
  505|  17.9M|    if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (505:9): [True: 7.12M, False: 10.8M]
  ------------------
  506|  7.12M|      min_scf = MIN(min_scf, ptr_scf[sfb]);
  ------------------
  |  |   23|  7.12M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3.55M, False: 3.56M]
  |  |  ------------------
  ------------------
  507|       |
  508|  7.12M|      max_scf = MAX(max_scf, ptr_scf[sfb]);
  ------------------
  |  |   24|  7.12M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 5.90M, False: 1.21M]
  |  |  ------------------
  ------------------
  509|  7.12M|    }
  510|  17.9M|  }
  511|       |
  512|   448k|  if (max_scf != SHRT_MIN && max_scf <= min_scf + MAX_SCF_DELTA) {
  ------------------
  |  |   74|   284k|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (512:7): [True: 284k, False: 164k]
  |  Branch (512:30): [True: 278k, False: 6.36k]
  ------------------
  513|   278k|    scf_act = max_scf;
  514|  2.44M|    do {
  515|  2.44M|      scf_act = scf_act - 2;
  516|       |
  517|  2.44M|      memcpy(scf_temp, ptr_scf, MAXIMUM_GROUPED_SCALE_FACTOR_BAND * sizeof(*ptr_scf));
  ------------------
  |  |   73|  2.44M|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  2.44M|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  2.44M|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  2.44M|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 2.44M, Folded]
  |  |  ------------------
  |  |   74|  2.44M|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  2.44M|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  2.44M|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  2.44M|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  518|       |
  519|  2.44M|      stop_sfb = 0;
  520|       |
  521|  6.39M|      do {
  522|  6.39M|        sfb = stop_sfb;
  523|       |
  524|  63.8M|        while (sfb < sfb_count && (ptr_scf[sfb] == SHRT_MIN || ptr_scf[sfb] <= scf_act)) {
  ------------------
  |  Branch (524:16): [True: 61.4M, False: 2.44M]
  |  Branch (524:36): [True: 23.4M, False: 37.9M]
  |  Branch (524:64): [True: 34.0M, False: 3.95M]
  ------------------
  525|  57.4M|          sfb++;
  526|  57.4M|        }
  527|       |
  528|  6.39M|        start_sfb = sfb;
  529|       |
  530|  6.39M|        sfb++;
  531|       |
  532|  45.6M|        while (sfb < sfb_count && (ptr_scf[sfb] == SHRT_MIN || ptr_scf[sfb] > scf_act)) {
  ------------------
  |  Branch (532:16): [True: 42.4M, False: 3.15M]
  |  Branch (532:36): [True: 13.9M, False: 28.5M]
  |  Branch (532:64): [True: 25.2M, False: 3.24M]
  ------------------
  533|  39.2M|          sfb++;
  534|  39.2M|        }
  535|       |
  536|  6.39M|        stop_sfb = sfb;
  537|       |
  538|  6.39M|        possible_region_found = 0;
  539|       |
  540|  6.39M|        if (start_sfb < sfb_count) {
  ------------------
  |  Branch (540:13): [True: 3.95M, False: 2.44M]
  ------------------
  541|  3.95M|          possible_region_found = 1;
  542|       |
  543|  42.1M|          for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (543:33): [True: 38.5M, False: 3.59M]
  ------------------
  544|  38.5M|            if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (544:17): [True: 26.0M, False: 12.5M]
  ------------------
  545|  26.0M|              if (scf_act < ptr_min_scf[sfb]) {
  ------------------
  |  Branch (545:19): [True: 359k, False: 25.6M]
  ------------------
  546|   359k|                possible_region_found = 0;
  547|   359k|                break;
  548|   359k|              }
  549|  26.0M|            }
  550|  38.5M|          }
  551|  3.95M|        }
  552|       |
  553|  6.39M|        if (possible_region_found) {
  ------------------
  |  Branch (553:13): [True: 3.59M, False: 2.80M]
  ------------------
  554|  41.7M|          for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (554:33): [True: 38.1M, False: 3.59M]
  ------------------
  555|  38.1M|            if (scf_temp[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (555:17): [True: 25.5M, False: 12.5M]
  ------------------
  556|  25.5M|              scf_temp[sfb] = scf_act;
  557|  25.5M|            }
  558|  38.1M|          }
  559|       |
  560|  3.59M|          delta_scf_bits =
  561|  3.59M|              iaace_count_scf_bits_diff(ptr_scf, scf_temp, sfb_count, start_sfb, stop_sfb);
  562|       |
  563|  3.59M|          delta_spec_pe =
  564|  3.59M|              iaace_calc_spec_pe_diff(pstr_psy_out, ptr_scf, scf_temp, ptr_sfb_const_pe_part,
  565|  3.59M|                                      ptr_sfb_form_fac, ptr_sfb_num_lines, start_sfb, stop_sfb);
  566|       |
  567|  3.59M|          delta_pe_new = delta_pe + (FLOAT32)delta_scf_bits + delta_spec_pe;
  568|       |
  569|  3.59M|          if (delta_pe_new < (FLOAT32)10.0f) {
  ------------------
  |  Branch (569:15): [True: 1.35M, False: 2.24M]
  ------------------
  570|  1.35M|            prev_dist_sum = new_dist_sum = 0.0f;
  571|       |
  572|  6.96M|            for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (572:35): [True: 5.88M, False: 1.08M]
  ------------------
  573|  5.88M|              if (scf_temp[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (573:19): [True: 2.91M, False: 2.96M]
  ------------------
  574|  2.91M|                prev_dist_sum += ptr_sfb_dist[sfb];
  575|       |
  576|  2.91M|                sfb_width = pstr_psy_out->sfb_offsets[sfb + 1] - pstr_psy_out->sfb_offsets[sfb];
  577|       |
  578|  2.91M|                sfb_offs = pstr_psy_out->sfb_offsets[sfb];
  579|       |
  580|  2.91M|                sfb_dist_new[sfb] =
  581|  2.91M|                    iaace_calc_sfb_dist(ptr_ptr_mdct_spec + sfb_offs, ptr_exp_spec + sfb_offs,
  582|  2.91M|                                        ptr_quant_spec_temp + sfb_offs, sfb_width, scf_act);
  583|       |
  584|  2.91M|                if (sfb_dist_new[sfb] > pstr_psy_out->ptr_sfb_thr[sfb]) {
  ------------------
  |  Branch (584:21): [True: 272k, False: 2.63M]
  ------------------
  585|   272k|                  new_dist_sum = (FLOAT32)2.0f * prev_dist_sum;
  586|   272k|                  break;
  587|   272k|                }
  588|       |
  589|  2.63M|                new_dist_sum += sfb_dist_new[sfb];
  590|  2.63M|              }
  591|  5.88M|            }
  592|       |
  593|  1.35M|            if (new_dist_sum < prev_dist_sum) {
  ------------------
  |  Branch (593:17): [True: 466k, False: 886k]
  ------------------
  594|   466k|              delta_pe = delta_pe_new;
  595|       |
  596|  3.06M|              for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (596:37): [True: 2.59M, False: 466k]
  ------------------
  597|  2.59M|                if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (597:21): [True: 1.24M, False: 1.35M]
  ------------------
  598|  1.24M|                  sfb_width = pstr_psy_out->sfb_offsets[sfb + 1] - pstr_psy_out->sfb_offsets[sfb];
  599|       |
  600|  1.24M|                  sfb_offs = pstr_psy_out->sfb_offsets[sfb];
  601|  1.24M|                  ptr_scf[sfb] = scf_act;
  602|  1.24M|                  ptr_sfb_dist[sfb] = sfb_dist_new[sfb];
  603|       |
  604|  11.2M|                  for (j = sfb_offs; j < sfb_offs + sfb_width; j++) {
  ------------------
  |  Branch (604:38): [True: 9.99M, False: 1.24M]
  ------------------
  605|  9.99M|                    ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  606|       |
  607|  9.99M|                    if (ptr_ptr_mdct_spec[j] < 0.0f) {
  ------------------
  |  Branch (607:25): [True: 4.53M, False: 5.45M]
  ------------------
  608|  4.53M|                      ptr_quant_spec[j] = -ptr_quant_spec[j];
  609|  4.53M|                    }
  610|  9.99M|                  }
  611|  1.24M|                }
  612|  2.59M|              }
  613|   466k|            }
  614|  1.35M|          }
  615|  3.59M|        }
  616|       |
  617|  6.39M|      } while (stop_sfb <= sfb_count);
  ------------------
  |  Branch (617:16): [True: 3.95M, False: 2.44M]
  ------------------
  618|       |
  619|  2.44M|    } while (scf_act > min_scf);
  ------------------
  |  Branch (619:14): [True: 2.16M, False: 278k]
  ------------------
  620|   278k|  }
  621|   448k|}
ixheaace_sf_estimation.c:iaace_count_scf_bits_diff:
  135|  3.59M|                                        WORD32 sfb_count, WORD32 start_sfb, WORD32 stop_sfb) {
  136|  3.59M|  WORD32 scf_bits_diff = 0;
  137|  3.59M|  WORD32 sfb = 0, sfb_last;
  138|  3.59M|  WORD32 sfb_prev, sfb_next;
  139|       |
  140|  3.59M|  sfb_last = start_sfb;
  141|       |
  142|  3.59M|  while ((sfb_last < stop_sfb) && (ptr_sfb_prev[sfb_last] == SHRT_MIN)) {
  ------------------
  |  Branch (142:10): [True: 3.59M, False: 0]
  |  Branch (142:35): [True: 0, False: 3.59M]
  ------------------
  143|      0|    sfb_last++;
  144|      0|  }
  145|       |
  146|  3.59M|  sfb_prev = start_sfb - 1;
  147|       |
  148|  6.77M|  while ((sfb_prev >= 0) && (ptr_sfb_prev[sfb_prev] == SHRT_MIN)) {
  ------------------
  |  Branch (148:10): [True: 5.02M, False: 1.74M]
  |  Branch (148:29): [True: 3.17M, False: 1.84M]
  ------------------
  149|  3.17M|    sfb_prev--;
  150|  3.17M|  }
  151|       |
  152|  3.59M|  if (sfb_prev >= 0) {
  ------------------
  |  Branch (152:7): [True: 1.84M, False: 1.74M]
  ------------------
  153|  1.84M|    scf_bits_diff += iaace_scf_delta_bit_count(ptr_sfb_new[sfb_prev] - ptr_sfb_new[sfb_last]) -
  154|  1.84M|                     iaace_scf_delta_bit_count(ptr_sfb_prev[sfb_prev] - ptr_sfb_prev[sfb_last]);
  155|  1.84M|  }
  156|       |
  157|  38.1M|  for (sfb = sfb_last + 1; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (157:28): [True: 34.5M, False: 3.59M]
  ------------------
  158|  34.5M|    if (ptr_sfb_prev[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (158:9): [True: 21.9M, False: 12.5M]
  ------------------
  159|  21.9M|      scf_bits_diff += iaace_scf_delta_bit_count(ptr_sfb_new[sfb_last] - ptr_sfb_new[sfb]) -
  160|  21.9M|                       iaace_scf_delta_bit_count(ptr_sfb_prev[sfb_last] - ptr_sfb_prev[sfb]);
  161|       |
  162|  21.9M|      sfb_last = sfb;
  163|  21.9M|    }
  164|  34.5M|  }
  165|       |
  166|  3.59M|  sfb_next = stop_sfb;
  167|       |
  168|  3.59M|  while ((sfb_next < sfb_count) && (ptr_sfb_prev[sfb_next] == SHRT_MIN)) {
  ------------------
  |  Branch (168:10): [True: 2.93M, False: 662k]
  |  Branch (168:36): [True: 0, False: 2.93M]
  ------------------
  169|      0|    sfb_next++;
  170|      0|  }
  171|       |
  172|  3.59M|  if (sfb_next < sfb_count) {
  ------------------
  |  Branch (172:7): [True: 2.93M, False: 662k]
  ------------------
  173|  2.93M|    scf_bits_diff += iaace_scf_delta_bit_count(ptr_sfb_new[sfb_last] - ptr_sfb_new[sfb_next]) -
  174|  2.93M|                     iaace_scf_delta_bit_count(ptr_sfb_prev[sfb_last] - ptr_sfb_prev[sfb_next]);
  175|  2.93M|  }
  176|       |
  177|  3.59M|  return scf_bits_diff;
  178|  3.59M|}
ixheaace_sf_estimation.c:iaace_calc_spec_pe_diff:
  184|  3.59M|                                       WORD32 stop_sfb) {
  185|  3.59M|  FLOAT32 spec_pe_diff = 0.0f;
  186|  3.59M|  WORD32 sfb;
  187|       |
  188|  41.7M|  for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (188:25): [True: 38.1M, False: 3.59M]
  ------------------
  189|  38.1M|    if (ptr_scf_prev[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (189:9): [True: 25.5M, False: 12.5M]
  ------------------
  190|  25.5M|      FLOAT32 ld_ratio_prev, ld_ratio_new, pe_prev, pe_new;
  191|       |
  192|  25.5M|      if (ptr_sfb_const_pe_part[sfb] == MIN_FLT_VAL) {
  ------------------
  |  |   58|  25.5M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (192:11): [True: 1.88M, False: 23.7M]
  ------------------
  193|  1.88M|        ptr_sfb_const_pe_part[sfb] = (FLOAT32)log(pstr_psy_out->ptr_sfb_energy[sfb] *
  194|  1.88M|                                                  (FLOAT32)6.75f / ptr_sfb_form_fac[sfb]) *
  195|  1.88M|                                     LOG2_1;
  ------------------
  |  |   23|  1.88M|#define LOG2_1 1.442695041f /* 1/log(2) */
  ------------------
  196|  1.88M|      }
  197|       |
  198|  25.5M|      ld_ratio_prev = ptr_sfb_const_pe_part[sfb] - 0.375f * ptr_scf_prev[sfb];
  199|  25.5M|      ld_ratio_new = ptr_sfb_const_pe_part[sfb] - 0.375f * ptr_scf_new[sfb];
  200|       |
  201|  25.5M|      if (ld_ratio_prev >= PE_C1) {
  ------------------
  |  |   80|  25.5M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (201:11): [True: 15.8M, False: 9.75M]
  ------------------
  202|  15.8M|        pe_prev = ld_ratio_prev;
  203|  15.8M|      } else {
  204|  9.75M|        pe_prev = PE_C2 + PE_C3 * ld_ratio_prev;
  ------------------
  |  |   81|  9.75M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                      pe_prev = PE_C2 + PE_C3 * ld_ratio_prev;
  ------------------
  |  |   82|  9.75M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  205|  9.75M|      }
  206|       |
  207|  25.5M|      if (ld_ratio_new >= PE_C1) {
  ------------------
  |  |   80|  25.5M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (207:11): [True: 22.0M, False: 3.53M]
  ------------------
  208|  22.0M|        pe_new = ld_ratio_new;
  209|  22.0M|      } else {
  210|  3.53M|        pe_new = PE_C2 + PE_C3 * ld_ratio_new;
  ------------------
  |  |   81|  3.53M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                      pe_new = PE_C2 + PE_C3 * ld_ratio_new;
  ------------------
  |  |   82|  3.53M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  211|  3.53M|      }
  212|       |
  213|  25.5M|      spec_pe_diff += (FLOAT32)0.7f * ptr_sfb_num_rel_lines[sfb] * (pe_new - pe_prev);
  214|  25.5M|    }
  215|  38.1M|  }
  216|       |
  217|  3.59M|  return spec_pe_diff;
  218|  3.59M|}
ixheaace_sf_estimation.c:iaace_calc_sfb_dist:
  221|  33.8M|                                   WORD16 *ptr_quant_spec, WORD32 sfb_width, WORD32 gain) {
  222|  33.8M|  WORD32 i = 0;
  223|  33.8M|  FLOAT32 dist = 0;
  224|  33.8M|  FLOAT32 k = -0.0946f + 0.5f;
  225|  33.8M|  FLOAT32 quantizer = ixheaace_fd_quant_table[gain + 128];
  226|  33.8M|  FLOAT32 inv_quantizer = ixheaace_fd_inv_quant_table[gain + 128];
  227|       |
  228|   394M|  while (i < sfb_width) {
  ------------------
  |  Branch (228:10): [True: 360M, False: 33.8M]
  ------------------
  229|   360M|    FLOAT32 iq_val;
  230|   360M|    FLOAT32 diff;
  231|       |
  232|   360M|    ptr_quant_spec[i] = (WORD16)(k + quantizer * ptr_exp_spec[i]);
  233|       |
  234|   360M|    if (ptr_quant_spec[i] < 64) {
  ------------------
  |  Branch (234:9): [True: 350M, False: 9.24M]
  ------------------
  235|   350M|      iq_val = ixheaace_pow_4_3_table[ptr_quant_spec[i]] * inv_quantizer;
  236|   350M|    } else {
  237|  9.24M|      iq_val = (FLOAT32)((pow((FLOAT32)abs(ptr_quant_spec[i]), 4.0f / 3.0f)) * inv_quantizer);
  238|  9.24M|    }
  239|       |
  240|   360M|    diff = (FLOAT32)fabs(ptr_spec[i]) - iq_val;
  241|       |
  242|   360M|    dist += diff * diff;
  243|       |
  244|   360M|    i++;
  245|   360M|  }
  246|       |
  247|  33.8M|  return dist;
  248|  33.8M|}

iusace_classification:
  960|   115k|                           iusace_scratch_mem *pstr_scratch, WORD32 ccfl) {
  961|   115k|  WORD32 n_frames, n_class, avg_cls, nf;
  962|   115k|  WORD32 i;
  963|   115k|  FLOAT32 *ptr_time_signal = pstr_scratch->p_time_signal;
  964|   115k|  WORD32 mode_decision_result;
  965|       |
  966|   115k|  n_frames = pstr_sig_class->n_buffer_samples / ccfl;
  967|       |
  968|   231k|  for (nf = 0; nf < n_frames; nf++) {
  ------------------
  |  Branch (968:16): [True: 115k, False: 115k]
  ------------------
  969|   109M|    for (i = 0; i < ccfl; i++) {
  ------------------
  |  Branch (969:17): [True: 108M, False: 115k]
  ------------------
  970|   108M|      ptr_time_signal[i] = pstr_sig_class->input_samples[ccfl * nf + i];
  971|   108M|    }
  972|       |
  973|       |    /* classification of ccfl-frame */
  974|   115k|    mode_decision_result =
  975|   115k|        iusace_classification_ccfl(pstr_sig_class, ptr_time_signal, pstr_scratch, ccfl);
  976|       |
  977|       |    /* coding mode decision of 1024-frame */
  978|   115k|    if ((mode_decision_result == MUSIC) || (mode_decision_result == MUSIC_DEFINITE)) {
  ------------------
  |  |   44|   115k|#define MUSIC 4
  ------------------
                  if ((mode_decision_result == MUSIC) || (mode_decision_result == MUSIC_DEFINITE)) {
  ------------------
  |  |   43|   114k|#define MUSIC_DEFINITE 3
  ------------------
  |  Branch (978:9): [True: 1.30k, False: 114k]
  |  Branch (978:44): [True: 19.8k, False: 94.7k]
  ------------------
  979|  21.1k|      pstr_sig_class->coding_mode = FD_MODE;
  ------------------
  |  |   22|  21.1k|#define FD_MODE 2
  ------------------
  980|  94.7k|    } else if ((mode_decision_result == SPEECH) || (mode_decision_result == SPEECH_DEFINITE)) {
  ------------------
  |  |   42|  94.7k|#define SPEECH 2
  ------------------
                  } else if ((mode_decision_result == SPEECH) || (mode_decision_result == SPEECH_DEFINITE)) {
  ------------------
  |  |   41|  92.9k|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (980:16): [True: 1.84k, False: 92.9k]
  |  Branch (980:52): [True: 91.6k, False: 1.30k]
  ------------------
  981|  93.4k|      pstr_sig_class->coding_mode = TD_MODE;
  ------------------
  |  |   23|  93.4k|#define TD_MODE 0
  ------------------
  982|  93.4k|    }
  983|       |
  984|   115k|    pstr_sig_class->class_buf[pstr_sig_class->n_buf_class + nf] = pstr_sig_class->coding_mode;
  985|   115k|    pstr_sig_class->pre_mode = pstr_sig_class->coding_mode;
  986|   115k|  }
  987|       |
  988|       |  /* merge ccfl-frame results */
  989|   115k|  pstr_sig_class->n_buf_class += n_frames;
  990|   115k|  n_class = (pstr_sig_class->n_class_frames > pstr_sig_class->n_buf_class)
  ------------------
  |  Branch (990:13): [True: 115k, False: 0]
  ------------------
  991|   115k|                ? pstr_sig_class->n_buf_class
  992|   115k|                : pstr_sig_class->n_class_frames;
  993|   115k|  {
  994|   115k|    WORD32 min_cls, max_cls;
  995|       |
  996|   115k|    min_cls = max_cls = pstr_sig_class->class_buf[0];
  997|   115k|    for (i = 1; i < n_class; i++) {
  ------------------
  |  Branch (997:17): [True: 0, False: 115k]
  ------------------
  998|      0|      if (pstr_sig_class->class_buf[i] > max_cls) {
  ------------------
  |  Branch (998:11): [True: 0, False: 0]
  ------------------
  999|      0|        max_cls = pstr_sig_class->class_buf[i];
 1000|      0|      } else if (pstr_sig_class->class_buf[i] < min_cls) {
  ------------------
  |  Branch (1000:18): [True: 0, False: 0]
  ------------------
 1001|      0|        min_cls = pstr_sig_class->class_buf[i];
 1002|      0|      }
 1003|      0|    }
 1004|       |
 1005|   115k|    avg_cls = 0;
 1006|   231k|    for (i = 0; i < n_class; i++) {
  ------------------
  |  Branch (1006:17): [True: 115k, False: 115k]
  ------------------
 1007|   115k|      if (pstr_sig_class->class_buf[i] == max_cls) {
  ------------------
  |  Branch (1007:11): [True: 115k, False: 0]
  ------------------
 1008|   115k|        avg_cls += 1;
 1009|   115k|      }
 1010|   115k|      if (pstr_sig_class->class_buf[i] == min_cls) {
  ------------------
  |  Branch (1010:11): [True: 115k, False: 0]
  ------------------
 1011|   115k|        avg_cls += -1;
 1012|   115k|      }
 1013|   115k|    }
 1014|       |
 1015|   115k|    if (avg_cls > 0) {
  ------------------
  |  Branch (1015:9): [True: 0, False: 115k]
  ------------------
 1016|      0|      pstr_sig_class->coding_mode = max_cls;
 1017|   115k|    } else {
 1018|   115k|      pstr_sig_class->coding_mode = min_cls;
 1019|   115k|    }
 1020|   115k|  }
 1021|       |
 1022|       |  /* shift, save pre_mode and unused class */
 1023|   115k|  if (n_class > 0) {
  ------------------
  |  Branch (1023:7): [True: 115k, False: 0]
  ------------------
 1024|   115k|    pstr_sig_class->pre_mode = pstr_sig_class->class_buf[n_class - 1];
 1025|   115k|  }
 1026|   115k|  pstr_sig_class->n_buf_class -= n_class;
 1027|   115k|  pstr_sig_class->n_buffer_samples -= ccfl * n_frames;
 1028|       |
 1029|   115k|  WORD32 minimum = MIN(pstr_sig_class->n_buf_class, pstr_sig_class->n_buffer_samples);
  ------------------
  |  |   86|   115k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 115k]
  |  |  ------------------
  ------------------
 1030|   115k|  if (minimum == pstr_sig_class->n_buf_class) {
  ------------------
  |  Branch (1030:7): [True: 115k, False: 0]
  ------------------
 1031|   115k|    for (i = 0; i < minimum; i++) {
  ------------------
  |  Branch (1031:17): [True: 0, False: 115k]
  ------------------
 1032|      0|      pstr_sig_class->class_buf[i] = pstr_sig_class->class_buf[i + n_class];
 1033|      0|      pstr_sig_class->input_samples[i] = pstr_sig_class->input_samples[i + ccfl * n_frames];
 1034|      0|    }
 1035|       |
 1036|       |    /* shift, save unused samples */
 1037|   115k|    for (; i < pstr_sig_class->n_buffer_samples; i++) {
  ------------------
  |  Branch (1037:12): [True: 0, False: 115k]
  ------------------
 1038|      0|      pstr_sig_class->input_samples[i] = pstr_sig_class->input_samples[i + ccfl * n_frames];
 1039|      0|    }
 1040|   115k|  } else {
 1041|      0|    for (i = 0; i < minimum; i++) {
  ------------------
  |  Branch (1041:17): [True: 0, False: 0]
  ------------------
 1042|      0|      pstr_sig_class->class_buf[i] = pstr_sig_class->class_buf[i + n_class];
 1043|      0|      pstr_sig_class->input_samples[i] = pstr_sig_class->input_samples[i + ccfl * n_frames];
 1044|      0|    }
 1045|       |
 1046|       |    /* shift, save unused samples */
 1047|      0|    for (; i < pstr_sig_class->n_buf_class; i++) {
  ------------------
  |  Branch (1047:12): [True: 0, False: 0]
  ------------------
 1048|      0|      pstr_sig_class->class_buf[i] = pstr_sig_class->class_buf[i + n_class];
 1049|      0|    }
 1050|      0|  }
 1051|   115k|}
iusace_init_classification:
 1053|  1.33k|VOID iusace_init_classification(ia_classification_struct *pstr_sig_class) {
 1054|  1.33k|  pstr_sig_class->pre_mode = FD_MODE;
  ------------------
  |  |   22|  1.33k|#define FD_MODE 2
  ------------------
 1055|       |
 1056|  1.33k|  pstr_sig_class->n_buffer_samples = 0;
 1057|  1.33k|  memset(pstr_sig_class->input_samples, 0, 3840 * 2 * sizeof(FLOAT32));
 1058|  1.33k|  pstr_sig_class->n_class_frames = 2;
 1059|  1.33k|  pstr_sig_class->n_buf_class = 0;
 1060|       |
 1061|  1.33k|  pstr_sig_class->is_switch_mode = 1;
 1062|       |
 1063|  1.33k|  pstr_sig_class->framecnt = 0;
 1064|  1.33k|  pstr_sig_class->init_flag = 0;
 1065|  1.33k|  pstr_sig_class->framecnt_xm = 0;
 1066|       |
 1067|  1.33k|  memset(&pstr_sig_class->buffers, 0, sizeof(ia_classification_buf_struct));
 1068|  1.33k|  memset(pstr_sig_class->spec_tilt_buf, 0, sizeof(FLOAT32) * 100);
 1069|  1.33k|  memset(pstr_sig_class->n_tonal, 0, sizeof(WORD32) * 100);
 1070|  1.33k|  memset(pstr_sig_class->n_tonal_low_frequency, 0, sizeof(WORD32) * 100);
 1071|  1.33k|  memset(pstr_sig_class->msd_spec_tilt_buf, 0, sizeof(FLOAT32) * 5);
 1072|  1.33k|  memset(pstr_sig_class->msd_spec_tilt_short_buf, 0, sizeof(FLOAT32) * 5);
 1073|  1.33k|  memset(pstr_sig_class->ave_n_tonal_short_buf, 0, sizeof(FLOAT32) * 5);
 1074|  1.33k|  memset(pstr_sig_class->ave_n_tonal_buf, 0, sizeof(FLOAT32) * 5);
 1075|  1.33k|  return;
 1076|  1.33k|}
ixheaace_signal_classifier.c:iusace_classification_ccfl:
  826|   115k|                                         iusace_scratch_mem *pstr_scratch, WORD32 ccfl) {
  827|   115k|  WORD32 i;
  828|   115k|  ia_tonal_params_struct pstr_ton_params;
  829|   115k|  ia_smooth_params_struct smooth_param;
  830|   115k|  ia_mode_params_struct pstr_mode_params;
  831|   115k|  ia_spec_tilt_params_struct ptr_spec_params;
  832|       |
  833|   115k|  ia_classification_buf_struct *pstr_buffers = &(pstr_sig_class->buffers);
  834|   115k|  pFLOAT32 spec_tilt_buf = pstr_sig_class->spec_tilt_buf;
  835|   115k|  pWORD32 n_tonal = pstr_sig_class->n_tonal;
  836|   115k|  pWORD32 n_tonal_low_frequency = pstr_sig_class->n_tonal_low_frequency;
  837|   115k|  pWORD32 framecnt_xm = &(pstr_sig_class->framecnt_xm);
  838|   115k|  pWORD32 framecnt = &(pstr_sig_class->framecnt);
  839|   115k|  pFLOAT32 ave_n_tonal_short_buf = pstr_sig_class->ave_n_tonal_short_buf;
  840|   115k|  pFLOAT32 ave_n_tonal_buf = pstr_sig_class->ave_n_tonal_buf;
  841|   115k|  pFLOAT32 msd_spec_tilt_buf = pstr_sig_class->msd_spec_tilt_buf;
  842|   115k|  pFLOAT32 msd_spec_tilt_short_buf = pstr_sig_class->msd_spec_tilt_short_buf;
  843|       |
  844|   115k|  FLOAT32 n_tonal_low_frequency_ratio;    /* the ratio of distribution of the numbers */
  845|       |                                          /* of tonal in the low frequency domain     */
  846|   115k|  FLOAT32 ave_n_tonal, ave_n_tonal_short; /**< the number of tonal */
  847|   115k|  FLOAT32 msd_spec_tilt;                  /* the long-term MSD of spectral tilt */
  848|   115k|  FLOAT32 msd_spec_tilt_short;            /* the short-term MSD of spectral tilt */
  849|       |
  850|   115k|  WORD32 init_mode_decision_result; /* the initial mode decision */
  851|   115k|  WORD32 flag_border = NO_BORDER;   /* flag of current border */
  ------------------
  |  |   34|   115k|#define NO_BORDER 0
  ------------------
  852|       |
  853|   115k|  WORD32 mode_decision_result; /* final mode decision result */
  854|       |
  855|   115k|  if (pstr_sig_class->init_flag == 0) {
  ------------------
  |  Branch (855:7): [True: 1.30k, False: 114k]
  ------------------
  856|       |    /* initialize */
  857|  1.30k|    pstr_sig_class->init_flag = 1;
  858|       |
  859|  7.84k|    for (i = 0; i < 5; i++) {
  ------------------
  |  Branch (859:17): [True: 6.54k, False: 1.30k]
  ------------------
  860|  6.54k|      n_tonal[i] = 0;
  861|  6.54k|      n_tonal_low_frequency[i] = 0;
  862|  6.54k|      spec_tilt_buf[i] = 0;
  863|  6.54k|      pstr_buffers->init_result_behind[i] = TBD;
  ------------------
  |  |   40|  6.54k|#define TBD 0
  ------------------
  864|  6.54k|      pstr_buffers->smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|  6.54k|#define TBD 0
  ------------------
  865|       |
  866|  6.54k|      ave_n_tonal_short_buf[i] = 0;
  867|  6.54k|      ave_n_tonal_buf[i] = 0;
  868|  6.54k|      msd_spec_tilt_buf[i] = 0;
  869|  6.54k|      msd_spec_tilt_short_buf[i] = 0;
  870|       |
  871|  6.54k|      pstr_buffers->frame_energy_buf_behind[i] = 0;
  872|  6.54k|      pstr_buffers->flag_border_buf_behind[i] = NO_BORDER;
  ------------------
  |  |   34|  6.54k|#define NO_BORDER 0
  ------------------
  873|  6.54k|    }
  874|  7.84k|    for (; i < 10; i++) {
  ------------------
  |  Branch (874:12): [True: 6.54k, False: 1.30k]
  ------------------
  875|  6.54k|      n_tonal[i] = 0;
  876|  6.54k|      n_tonal_low_frequency[i] = 0;
  877|  6.54k|      spec_tilt_buf[i] = 0;
  878|  6.54k|      pstr_buffers->init_result_behind[i] = TBD;
  ------------------
  |  |   40|  6.54k|#define TBD 0
  ------------------
  879|  6.54k|      pstr_buffers->smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|  6.54k|#define TBD 0
  ------------------
  880|       |
  881|  6.54k|      pstr_buffers->frame_energy_buf_behind[i] = 0;
  882|  6.54k|      pstr_buffers->flag_border_buf_behind[i] = NO_BORDER;
  ------------------
  |  |   34|  6.54k|#define NO_BORDER 0
  ------------------
  883|  6.54k|    }
  884|       |
  885|   119k|    for (; i < 100; i++) {
  ------------------
  |  Branch (885:12): [True: 117k, False: 1.30k]
  ------------------
  886|   117k|      n_tonal[i] = 0;
  887|   117k|      n_tonal_low_frequency[i] = 0;
  888|   117k|      spec_tilt_buf[i] = 0;
  889|   117k|      pstr_buffers->init_result_behind[i] = TBD;
  ------------------
  |  |   40|   117k|#define TBD 0
  ------------------
  890|   117k|      pstr_buffers->smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|   117k|#define TBD 0
  ------------------
  891|   117k|    }
  892|  2.61k|    for (i = 0; i < NFRAMEAHEAD; i++) {
  ------------------
  |  |   27|  2.61k|#define NFRAMEAHEAD 1
  ------------------
  |  Branch (892:17): [True: 1.30k, False: 1.30k]
  ------------------
  893|  1.30k|      pstr_buffers->frame_energy_buf_ahead[i] = 0;
  894|  1.30k|      pstr_buffers->flag_border_buf_ahead[i] = NO_BORDER;
  ------------------
  |  |   34|  1.30k|#define NO_BORDER 0
  ------------------
  895|  1.30k|      pstr_buffers->init_result_ahead[i] = TBD;
  ------------------
  |  |   40|  1.30k|#define TBD 0
  ------------------
  896|  1.30k|    }
  897|  1.30k|  }
  898|       |
  899|   115k|  *framecnt += 1;
  900|   115k|  *framecnt_xm += 1;
  901|       |
  902|   115k|  pstr_ton_params.time_signal = (FLOAT32 *)ptr_time_signal;
  903|   115k|  pstr_ton_params.framecnt_xm = *framecnt_xm;
  904|   115k|  pstr_ton_params.n_tonal = n_tonal;
  905|   115k|  pstr_ton_params.n_tonal_low_frequency = n_tonal_low_frequency;
  906|   115k|  pstr_ton_params.n_tonal_low_frequency_ratio = &n_tonal_low_frequency_ratio;
  907|   115k|  pstr_ton_params.ave_n_tonal = &ave_n_tonal;
  908|   115k|  pstr_ton_params.ave_n_tonal_short = &ave_n_tonal_short;
  909|       |  /** analysis tonal
  910|       |   */
  911|   115k|  iusace_tonal_analysis(&pstr_ton_params, pstr_scratch, ccfl);
  912|       |
  913|   115k|  ptr_spec_params.time_signal = ptr_time_signal;
  914|   115k|  ptr_spec_params.framecnt_xm = *framecnt_xm;
  915|   115k|  ptr_spec_params.spec_tilt_buf = spec_tilt_buf;
  916|   115k|  ptr_spec_params.msd_spec_tilt = &msd_spec_tilt;
  917|   115k|  ptr_spec_params.msd_spec_tilt_short = &msd_spec_tilt_short;
  918|       |  /** analysis spectral tilt
  919|       |   */
  920|   115k|  iusace_spectral_tilt_analysis(&ptr_spec_params, ccfl);
  921|       |
  922|   115k|  pstr_mode_params.framecnt = *framecnt;
  923|   115k|  pstr_mode_params.framecnt_xm = framecnt_xm;
  924|   115k|  pstr_mode_params.flag_border = &flag_border;
  925|   115k|  pstr_mode_params.ave_n_tonal_short = ave_n_tonal_short;
  926|   115k|  pstr_mode_params.ave_n_tonal = ave_n_tonal;
  927|   115k|  pstr_mode_params.ave_n_tonal_short_buf = ave_n_tonal_short_buf;
  928|   115k|  pstr_mode_params.ave_n_tonal_buf = ave_n_tonal_buf;
  929|   115k|  pstr_mode_params.msd_spec_tilt = msd_spec_tilt;
  930|   115k|  pstr_mode_params.msd_spec_tilt_short = msd_spec_tilt_short;
  931|   115k|  pstr_mode_params.msd_spec_tilt_buf = msd_spec_tilt_buf;
  932|   115k|  pstr_mode_params.msd_spec_tilt_short_buf = msd_spec_tilt_short_buf;
  933|   115k|  pstr_mode_params.n_tonal_low_frequency_ratio = n_tonal_low_frequency_ratio;
  934|   115k|  pstr_mode_params.frame_energy = ptr_spec_params.frame_energy;
  935|       |  /** initial mode decision and boundary decisions
  936|       |   */
  937|   115k|  init_mode_decision_result = iusace_init_mode_decision(&pstr_mode_params);
  938|       |
  939|   115k|  smooth_param.flag_border_buf_behind = pstr_buffers->flag_border_buf_behind;
  940|   115k|  smooth_param.flag_border_buf_ahead = pstr_buffers->flag_border_buf_ahead;
  941|   115k|  smooth_param.frame_energy = ptr_spec_params.frame_energy;
  942|   115k|  smooth_param.frame_energy_buf_behind = pstr_buffers->frame_energy_buf_behind;
  943|   115k|  smooth_param.frame_energy_buf_ahead = pstr_buffers->frame_energy_buf_ahead;
  944|   115k|  smooth_param.smoothing_result_buf = pstr_buffers->smoothing_result_buf;
  945|   115k|  smooth_param.init_result_ahead = pstr_buffers->init_result_ahead;
  946|   115k|  smooth_param.flag_border = flag_border;
  947|   115k|  smooth_param.init_result_behind = pstr_buffers->init_result_behind;
  948|   115k|  smooth_param.init_mode_decision_result = init_mode_decision_result;
  949|   115k|  smooth_param.flag_speech_definite = 0;
  950|   115k|  smooth_param.count_small_energy = 0;
  951|   115k|  smooth_param.flag_music_definite = 0;
  952|   115k|  smooth_param.num_smoothing = 0;
  953|       |  /* smoothing */
  954|   115k|  mode_decision_result = iusace_smoothing_mode_decision(&smooth_param);
  955|       |
  956|   115k|  return mode_decision_result;
  957|   115k|}
ixheaace_signal_classifier.c:iusace_tonal_analysis:
  295|   115k|                                  iusace_scratch_mem *pstr_scratch, WORD32 ccfl) {
  296|   115k|  FLOAT32 *ptr_complex_fft = pstr_scratch->p_complex_fft;
  297|   115k|  WORD32 *ptr_tonal_flag = pstr_scratch->p_tonal_flag;
  298|   115k|  FLOAT32 *ptr_time_sig = pstr_ton_params->time_signal;
  299|   115k|  WORD32 framecnt_xm = pstr_ton_params->framecnt_xm;
  300|   115k|  WORD32 *ptr_n_tonal = pstr_ton_params->n_tonal;
  301|   115k|  WORD32 *ptr_n_tonal_low_frequency = pstr_ton_params->n_tonal_low_frequency;
  302|   115k|  FLOAT32 *ptr_n_tonal_low_frequency_ratio = pstr_ton_params->n_tonal_low_frequency_ratio;
  303|   115k|  FLOAT32 *ave_n_tonal = pstr_ton_params->ave_n_tonal;
  304|   115k|  FLOAT32 *ave_n_tonal_short = pstr_ton_params->ave_n_tonal_short;
  305|   115k|  WORD32 i;
  306|   115k|  WORD32 fft_size = ccfl;
  307|       |
  308|   115k|  WORD32 frame_length;
  309|   115k|  WORD32 n_tonal_total, n_tonal_low_frequency_total;
  310|       |
  311|   109M|  for (i = 0; i < ccfl; i++) {
  ------------------
  |  Branch (311:15): [True: 108M, False: 115k]
  ------------------
  312|   108M|    ptr_complex_fft[2 * i] = (FLOAT32)(
  313|   108M|        ptr_time_sig[i] * ((ccfl == 1024) ? iusace_classify_arrays.hanning_window_1024[i]
  ------------------
  |  Branch (313:28): [True: 79.8M, False: 29.1M]
  ------------------
  314|   108M|                                          : iusace_classify_arrays.hanning_window_768[i]));
  315|   108M|    ptr_complex_fft[2 * i + 1] = 0;
  316|   108M|  }
  317|       |
  318|   115k|  iusace_complex_fft(ptr_complex_fft, fft_size, pstr_scratch);
  319|       |
  320|       |  /* compute power density spectrum */
  321|       |  /* re_fft contains the resulting pds */
  322|   115k|  iusace_calc_pds(ptr_complex_fft, ccfl);
  323|       |
  324|       |  /* detect tonal */
  325|   115k|  iusace_find_tonal(ptr_complex_fft, ptr_tonal_flag, pstr_scratch->p_pow_spec, ccfl);
  326|       |
  327|       |  /* update n_tonal, n_tonal_low_frequency */
  328|  11.5M|  for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (328:15): [True: 11.4M, False: 115k]
  ------------------
  329|  11.4M|    ptr_n_tonal[i] = ptr_n_tonal[i + 1];
  330|  11.4M|    ptr_n_tonal_low_frequency[i] = ptr_n_tonal_low_frequency[i + 1];
  331|  11.4M|  }
  332|   115k|  ptr_n_tonal[99] = 0;
  333|  54.5M|  for (i = 0; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (333:15): [True: 54.4M, False: 115k]
  ------------------
  334|  54.4M|    ptr_n_tonal[99] += ptr_tonal_flag[i];
  335|  54.4M|  }
  336|   115k|  ptr_n_tonal_low_frequency[99] = 0;
  337|  18.6M|  for (i = 0; i < INDEXOFLOWFREQUENCY; i++) {
  ------------------
  |  |   25|  18.6M|#define INDEXOFLOWFREQUENCY 160
  ------------------
  |  Branch (337:15): [True: 18.5M, False: 115k]
  ------------------
  338|  18.5M|    ptr_n_tonal_low_frequency[99] += ptr_tonal_flag[i];
  339|  18.5M|  }
  340|       |
  341|       |  /* compute long-term AVE and the ratio of distribution in low-frequency domain */
  342|   115k|  if (framecnt_xm < AVE_TONAL_LENGTH) {
  ------------------
  |  |   28|   115k|#define AVE_TONAL_LENGTH 100
  ------------------
  |  Branch (342:7): [True: 64.6k, False: 51.2k]
  ------------------
  343|  64.6k|    frame_length = framecnt_xm;
  344|  64.6k|  } else {
  345|  51.2k|    frame_length = AVE_TONAL_LENGTH;
  ------------------
  |  |   28|  51.2k|#define AVE_TONAL_LENGTH 100
  ------------------
  346|  51.2k|  }
  347|       |
  348|   115k|  n_tonal_total = 0;
  349|   115k|  n_tonal_low_frequency_total = 0;
  350|  7.79M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (350:15): [True: 7.68M, False: 115k]
  ------------------
  351|  7.68M|    n_tonal_total += ptr_n_tonal[99 - i];
  352|  7.68M|    n_tonal_low_frequency_total += ptr_n_tonal_low_frequency[99 - i];
  353|  7.68M|  }
  354|       |
  355|   115k|  *ave_n_tonal = (FLOAT32)n_tonal_total / frame_length;
  356|       |
  357|   115k|  if (n_tonal_total == 0) {
  ------------------
  |  Branch (357:7): [True: 25.2k, False: 90.6k]
  ------------------
  358|  25.2k|    *ptr_n_tonal_low_frequency_ratio = 1;
  359|  90.6k|  } else {
  360|  90.6k|    *ptr_n_tonal_low_frequency_ratio = (FLOAT32)n_tonal_low_frequency_total / n_tonal_total;
  361|  90.6k|  }
  362|       |
  363|       |  /* compute the short-term AVE */
  364|   115k|  if (framecnt_xm < AVE_TONAL_LENGTH_SHORT) {
  ------------------
  |  |   29|   115k|#define AVE_TONAL_LENGTH_SHORT 10
  ------------------
  |  Branch (364:7): [True: 10.5k, False: 105k]
  ------------------
  365|  10.5k|    frame_length = framecnt_xm;
  366|   105k|  } else {
  367|   105k|    frame_length = AVE_TONAL_LENGTH_SHORT;
  ------------------
  |  |   29|   105k|#define AVE_TONAL_LENGTH_SHORT 10
  ------------------
  368|   105k|  }
  369|       |
  370|   115k|  n_tonal_total = 0;
  371|  1.21M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (371:15): [True: 1.10M, False: 115k]
  ------------------
  372|  1.10M|    n_tonal_total += ptr_n_tonal[99 - i];
  373|  1.10M|  }
  374|       |
  375|   115k|  *ave_n_tonal_short = (FLOAT32)n_tonal_total / frame_length;
  376|   115k|  return;
  377|   115k|}
ixheaace_signal_classifier.c:iusace_calc_pds:
   52|   115k|static VOID iusace_calc_pds(FLOAT32 *ptr_input, WORD32 ccfl) {
   53|   115k|  WORD32 i;
   54|   115k|  FLOAT64 max_pow, delta;
   55|   115k|  FLOAT64 log_ccfl_base_10 = (ccfl == 1024) ? LOG_1024_BASE_10 : LOG_768_BASE_10;
  ------------------
  |  |   45|  77.9k|#define LOG_1024_BASE_10 3.01029995664f
  ------------------
                FLOAT64 log_ccfl_base_10 = (ccfl == 1024) ? LOG_1024_BASE_10 : LOG_768_BASE_10;
  ------------------
  |  |   46|   153k|#define LOG_768_BASE_10 (2.88536122003f)
  ------------------
  |  Branch (55:30): [True: 77.9k, False: 37.9k]
  ------------------
   56|       |
   57|   115k|  max_pow = MAX(
  ------------------
  |  |   89|   115k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 110k, False: 4.94k]
  |  |  ------------------
  ------------------
   58|   115k|      10 * (log10(ptr_input[0] * ptr_input[0] + ptr_input[1] * ptr_input[1]) - log_ccfl_base_10) +
   59|   115k|          10e-15,
   60|   115k|      MIN_POW);
   61|       |
   62|  54.4M|  for (i = 1; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (62:15): [True: 54.3M, False: 115k]
  ------------------
   63|       |    /* removed the sqrt along with clubbing the for loops */
   64|  54.3M|    ptr_input[2 * i] = (FLOAT32)MAX(10 * (log10(ptr_input[2 * i] * ptr_input[2 * i] +
  ------------------
  |  |   89|  54.3M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 51.4M, False: 2.94M]
  |  |  ------------------
  ------------------
   65|  54.3M|                                                ptr_input[2 * i + 1] * ptr_input[2 * i + 1]) -
   66|  54.3M|                                          log_ccfl_base_10) +
   67|  54.3M|                                        10e-15,
   68|  54.3M|                                    MIN_POW);
   69|       |
   70|  54.3M|    max_pow = MAX(max_pow, ptr_input[2 * i]);
  ------------------
  |  |   89|  54.3M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 51.2M, False: 3.14M]
  |  |  ------------------
  ------------------
   71|  54.3M|  }
   72|       |
   73|       |  /* Normalized to reference sound pressure level 96 dB */
   74|   115k|  delta = 96 - max_pow;
   75|       |
   76|  54.5M|  for (i = 0; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (76:15): [True: 54.4M, False: 115k]
  ------------------
   77|  54.4M|    ptr_input[2 * i] = ptr_input[2 * i] + (FLOAT32)delta;
   78|  54.4M|  }
   79|   115k|  return;
   80|   115k|}
ixheaace_signal_classifier.c:iusace_find_tonal:
   83|   115k|                              WORD32 ccfl) {
   84|   115k|  WORD32 i, j;
   85|   115k|  WORD32 is_tonal;
   86|   115k|  FLOAT64 tonal_spl;
   87|   115k|  FLOAT64 absolute_threshold_xm;
   88|       |
   89|  54.5M|  for (i = 0; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (89:15): [True: 54.4M, False: 115k]
  ------------------
   90|  54.4M|    ptr_scratch[i] = ptr_input[2 * i];
   91|  54.4M|  }
   92|       |
   93|   115k|  if (ccfl == FRAME_LEN_LONG) {
  ------------------
  |  |   54|   115k|#define FRAME_LEN_LONG 1024
  ------------------
  |  Branch (93:7): [True: 77.9k, False: 37.9k]
  ------------------
   94|  39.9M|    for (i = 0; i <= 511; i++) {
  ------------------
  |  Branch (94:17): [True: 39.9M, False: 77.9k]
  ------------------
   95|  39.9M|      ptr_tonal_flag[i] = 0;
   96|  39.9M|    }
   97|       |
   98|  38.8M|    for (i = 2; i < 500; i++) {
  ------------------
  |  Branch (98:17): [True: 38.8M, False: 77.9k]
  ------------------
   99|  38.8M|      if (ptr_scratch[i] > ptr_scratch[i - 1] && ptr_scratch[i] >= ptr_scratch[i + 1]) {
  ------------------
  |  Branch (99:11): [True: 18.2M, False: 20.5M]
  |  Branch (99:50): [True: 10.1M, False: 8.11M]
  ------------------
  100|  10.1M|        is_tonal = 1;
  101|       |
  102|       |        /* Verify it meets the condition: ptr_scratch[i]-ptr_scratch[i+j]>=7 */
  103|       |
  104|  10.1M|        if (1 < i && i < 62) {
  ------------------
  |  Branch (104:13): [True: 10.1M, False: 0]
  |  Branch (104:22): [True: 1.18M, False: 8.94M]
  ------------------
  105|  1.54M|          for (j = -2; j <= -2; j++) {
  ------------------
  |  Branch (105:24): [True: 1.18M, False: 361k]
  ------------------
  106|  1.18M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (106:24): [True: 1.18M, False: 0]
  |  Branch (106:36): [True: 361k, False: 826k]
  ------------------
  107|  1.18M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (107:17): [True: 826k, False: 361k]
  ------------------
  108|  1.18M|          }
  109|  1.18M|          if (is_tonal == 1) {
  ------------------
  |  Branch (109:15): [True: 361k, False: 826k]
  ------------------
  110|   510k|            for (j = 2; j <= 2; j++) {
  ------------------
  |  Branch (110:25): [True: 361k, False: 149k]
  ------------------
  111|   361k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (111:26): [True: 361k, False: 0]
  |  Branch (111:38): [True: 149k, False: 211k]
  ------------------
  112|   361k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (112:19): [True: 211k, False: 149k]
  ------------------
  113|   361k|            }
  114|   361k|          }
  115|       |
  116|  1.18M|          if (is_tonal == 1) {
  ------------------
  |  Branch (116:15): [True: 149k, False: 1.03M]
  ------------------
  117|   149k|            ptr_tonal_flag[i] = 1;
  118|   149k|          }
  119|  1.18M|        }
  120|       |
  121|  8.94M|        else if (62 <= i && i < 126) {
  ------------------
  |  Branch (121:18): [True: 8.94M, False: 0]
  |  Branch (121:29): [True: 1.33M, False: 7.61M]
  ------------------
  122|  1.92M|          for (j = -3; j <= -2; j++) {
  ------------------
  |  Branch (122:24): [True: 1.72M, False: 194k]
  ------------------
  123|  1.72M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (123:24): [True: 1.72M, False: 0]
  |  Branch (123:36): [True: 591k, False: 1.13M]
  ------------------
  124|  1.72M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (124:17): [True: 1.13M, False: 591k]
  ------------------
  125|  1.72M|          }
  126|  1.33M|          if (is_tonal == 1) {
  ------------------
  |  Branch (126:15): [True: 194k, False: 1.13M]
  ------------------
  127|   357k|            for (j = 2; j <= 3; j++) {
  ------------------
  |  Branch (127:25): [True: 291k, False: 65.3k]
  ------------------
  128|   291k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (128:26): [True: 291k, False: 0]
  |  Branch (128:38): [True: 162k, False: 129k]
  ------------------
  129|   291k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (129:19): [True: 129k, False: 162k]
  ------------------
  130|   291k|            }
  131|   194k|          }
  132|       |
  133|  1.33M|          if (is_tonal == 1) {
  ------------------
  |  Branch (133:15): [True: 65.3k, False: 1.26M]
  ------------------
  134|  65.3k|            ptr_tonal_flag[i] = 1;
  135|  65.3k|          }
  136|  1.33M|        }
  137|       |
  138|  7.61M|        else if (126 <= i && i < 254) {
  ------------------
  |  Branch (138:18): [True: 7.61M, False: 0]
  |  Branch (138:30): [True: 2.63M, False: 4.98M]
  ------------------
  139|  4.25M|          for (j = -6; j <= -2; j++) {
  ------------------
  |  Branch (139:24): [True: 4.16M, False: 92.7k]
  ------------------
  140|  4.16M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (140:24): [True: 4.16M, False: 0]
  |  Branch (140:36): [True: 1.62M, False: 2.54M]
  ------------------
  141|  4.16M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (141:17): [True: 2.54M, False: 1.62M]
  ------------------
  142|  4.16M|          }
  143|  2.63M|          if (is_tonal == 1) {
  ------------------
  |  Branch (143:15): [True: 92.7k, False: 2.54M]
  ------------------
  144|   270k|            for (j = 2; j <= 6; j++) {
  ------------------
  |  Branch (144:25): [True: 249k, False: 21.5k]
  ------------------
  145|   249k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (145:26): [True: 249k, False: 0]
  |  Branch (145:38): [True: 177k, False: 71.1k]
  ------------------
  146|   249k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (146:19): [True: 71.1k, False: 177k]
  ------------------
  147|   249k|            }
  148|  92.7k|          }
  149|       |
  150|  2.63M|          if (is_tonal == 1) {
  ------------------
  |  Branch (150:15): [True: 21.5k, False: 2.61M]
  ------------------
  151|  21.5k|            ptr_tonal_flag[i] = 1;
  152|  21.5k|          }
  153|  2.63M|        }
  154|       |
  155|  4.98M|        else if (254 <= i && i < 500) {
  ------------------
  |  Branch (155:18): [True: 4.98M, False: 0]
  |  Branch (155:30): [True: 4.98M, False: 0]
  ------------------
  156|  9.91M|          for (j = -12; j <= -2; j++) {
  ------------------
  |  Branch (156:25): [True: 9.84M, False: 70.3k]
  ------------------
  157|  9.84M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (157:24): [True: 9.84M, False: 0]
  |  Branch (157:36): [True: 4.93M, False: 4.90M]
  ------------------
  158|  9.84M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (158:17): [True: 4.90M, False: 4.93M]
  ------------------
  159|  9.84M|          }
  160|  4.98M|          if (is_tonal == 1) {
  ------------------
  |  Branch (160:15): [True: 70.3k, False: 4.90M]
  ------------------
  161|   409k|            for (j = 2; j <= 12; j++) {
  ------------------
  |  Branch (161:25): [True: 386k, False: 23.1k]
  ------------------
  162|   386k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (162:26): [True: 386k, False: 0]
  |  Branch (162:38): [True: 338k, False: 47.1k]
  ------------------
  163|   386k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (163:19): [True: 47.1k, False: 338k]
  ------------------
  164|   386k|            }
  165|  70.3k|          }
  166|       |
  167|  4.98M|          if (is_tonal == 1) {
  ------------------
  |  Branch (167:15): [True: 23.1k, False: 4.95M]
  ------------------
  168|  23.1k|            ptr_tonal_flag[i] = 1;
  169|  23.1k|          }
  170|  4.98M|        }
  171|  10.1M|      }
  172|  38.8M|    }
  173|       |
  174|  39.9M|    for (i = 0; i <= 511; i++) {
  ------------------
  |  Branch (174:17): [True: 39.9M, False: 77.9k]
  ------------------
  175|  39.9M|      if (ptr_tonal_flag[i] == 1) {
  ------------------
  |  Branch (175:11): [True: 259k, False: 39.6M]
  ------------------
  176|       |        /* compute the SPL of tonal */
  177|   259k|        tonal_spl =
  178|   259k|            10 * log10(pow(10, (ptr_scratch[i - 1] / 10)) + pow(10, (ptr_scratch[i] / 10)) +
  179|   259k|                       pow(10, (ptr_scratch[i + 1] / 10)));
  180|       |
  181|   259k|        if (i >= 324) {
  ------------------
  |  Branch (181:13): [True: 14.0k, False: 245k]
  ------------------
  182|  14.0k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_1024[i] + 20;
  183|   245k|        } else {
  184|   245k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_1024[i];
  185|   245k|        }
  186|   259k|        if (tonal_spl < absolute_threshold_xm) {
  ------------------
  |  Branch (186:13): [True: 131k, False: 128k]
  ------------------
  187|   131k|          ptr_tonal_flag[i] = 0;
  188|   131k|        }
  189|   259k|      }
  190|  39.9M|    }
  191|  77.9k|  } else  // (ccfl == 768)
  192|  37.9k|  {
  193|  14.6M|    for (i = 0; i <= 383; i++) {
  ------------------
  |  Branch (193:17): [True: 14.5M, False: 37.9k]
  ------------------
  194|  14.5M|      ptr_tonal_flag[i] = 0;
  195|  14.5M|    }
  196|       |
  197|  14.1M|    for (i = 2; i < 375; i++) {
  ------------------
  |  Branch (197:17): [True: 14.1M, False: 37.9k]
  ------------------
  198|  14.1M|      if (ptr_scratch[i] > ptr_scratch[i - 1] && ptr_scratch[i] >= ptr_scratch[i + 1]) {
  ------------------
  |  Branch (198:11): [True: 6.89M, False: 7.26M]
  |  Branch (198:50): [True: 2.55M, False: 4.34M]
  ------------------
  199|  2.55M|        is_tonal = 1;
  200|       |
  201|       |        /* Verify it meets the condition: ptr_scratch[i]-ptr_scratch[i+j]>=7 */
  202|       |
  203|  2.55M|        if (1 < i && i < 47) {
  ------------------
  |  Branch (203:13): [True: 2.55M, False: 0]
  |  Branch (203:22): [True: 108k, False: 2.44M]
  ------------------
  204|   135k|          for (j = -2; j <= -2; j++) {
  ------------------
  |  Branch (204:24): [True: 108k, False: 27.2k]
  ------------------
  205|   108k|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (205:24): [True: 108k, False: 0]
  |  Branch (205:36): [True: 27.2k, False: 81.0k]
  ------------------
  206|   108k|            if (is_tonal == 0) break;
  ------------------
  |  Branch (206:17): [True: 81.0k, False: 27.2k]
  ------------------
  207|   108k|          }
  208|   108k|          if (is_tonal == 1) {
  ------------------
  |  Branch (208:15): [True: 27.2k, False: 81.0k]
  ------------------
  209|  44.6k|            for (j = 2; j <= 2; j++) {
  ------------------
  |  Branch (209:25): [True: 27.2k, False: 17.3k]
  ------------------
  210|  27.2k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (210:26): [True: 27.2k, False: 0]
  |  Branch (210:38): [True: 17.3k, False: 9.95k]
  ------------------
  211|  27.2k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (211:19): [True: 9.95k, False: 17.3k]
  ------------------
  212|  27.2k|            }
  213|  27.2k|          }
  214|       |
  215|   108k|          if (is_tonal == 1) {
  ------------------
  |  Branch (215:15): [True: 17.3k, False: 91.0k]
  ------------------
  216|  17.3k|            ptr_tonal_flag[i] = 1;
  217|  17.3k|          }
  218|   108k|        }
  219|       |
  220|  2.44M|        else if (47 <= i && i < 95) {
  ------------------
  |  Branch (220:18): [True: 2.44M, False: 0]
  |  Branch (220:29): [True: 385k, False: 2.05M]
  ------------------
  221|   480k|          for (j = -3; j <= -2; j++) {
  ------------------
  |  Branch (221:24): [True: 436k, False: 43.7k]
  ------------------
  222|   436k|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (222:24): [True: 436k, False: 0]
  |  Branch (222:36): [True: 95.5k, False: 341k]
  ------------------
  223|   436k|            if (is_tonal == 0) break;
  ------------------
  |  Branch (223:17): [True: 341k, False: 95.5k]
  ------------------
  224|   436k|          }
  225|   385k|          if (is_tonal == 1) {
  ------------------
  |  Branch (225:15): [True: 43.7k, False: 341k]
  ------------------
  226|   113k|            for (j = 2; j <= 3; j++) {
  ------------------
  |  Branch (226:25): [True: 79.6k, False: 33.9k]
  ------------------
  227|  79.6k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (227:26): [True: 79.6k, False: 0]
  |  Branch (227:38): [True: 69.7k, False: 9.87k]
  ------------------
  228|  79.6k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (228:19): [True: 9.87k, False: 69.7k]
  ------------------
  229|  79.6k|            }
  230|  43.7k|          }
  231|       |
  232|   385k|          if (is_tonal == 1) {
  ------------------
  |  Branch (232:15): [True: 33.9k, False: 351k]
  ------------------
  233|  33.9k|            ptr_tonal_flag[i] = 1;
  234|  33.9k|          }
  235|   385k|        }
  236|       |
  237|  2.05M|        else if (95 <= i && i < 194) {
  ------------------
  |  Branch (237:18): [True: 2.05M, False: 0]
  |  Branch (237:29): [True: 790k, False: 1.26M]
  ------------------
  238|  1.29M|          for (j = -5; j <= -2; j++) {
  ------------------
  |  Branch (238:24): [True: 1.19M, False: 107k]
  ------------------
  239|  1.19M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (239:24): [True: 1.19M, False: 0]
  |  Branch (239:36): [True: 508k, False: 683k]
  ------------------
  240|  1.19M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (240:17): [True: 683k, False: 508k]
  ------------------
  241|  1.19M|          }
  242|   790k|          if (is_tonal == 1) {
  ------------------
  |  Branch (242:15): [True: 107k, False: 683k]
  ------------------
  243|   479k|            for (j = 2; j <= 5; j++) {
  ------------------
  |  Branch (243:25): [True: 390k, False: 89.7k]
  ------------------
  244|   390k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (244:26): [True: 390k, False: 0]
  |  Branch (244:38): [True: 372k, False: 17.2k]
  ------------------
  245|   390k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (245:19): [True: 17.2k, False: 372k]
  ------------------
  246|   390k|            }
  247|   107k|          }
  248|       |
  249|   790k|          if (is_tonal == 1) {
  ------------------
  |  Branch (249:15): [True: 89.7k, False: 701k]
  ------------------
  250|  89.7k|            ptr_tonal_flag[i] = 1;
  251|  89.7k|          }
  252|   790k|        }
  253|       |
  254|  1.26M|        else if (191 <= i && i < 375) {
  ------------------
  |  Branch (254:18): [True: 1.26M, False: 0]
  |  Branch (254:30): [True: 1.26M, False: 0]
  ------------------
  255|  2.70M|          for (j = -9; j <= -2; j++) {
  ------------------
  |  Branch (255:24): [True: 2.57M, False: 129k]
  ------------------
  256|  2.57M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (256:24): [True: 2.57M, False: 0]
  |  Branch (256:36): [True: 1.43M, False: 1.13M]
  ------------------
  257|  2.57M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (257:17): [True: 1.13M, False: 1.43M]
  ------------------
  258|  2.57M|          }
  259|  1.26M|          if (is_tonal == 1) {
  ------------------
  |  Branch (259:15): [True: 129k, False: 1.13M]
  ------------------
  260|  1.00M|            for (j = 2; j <= 9; j++) {
  ------------------
  |  Branch (260:25): [True: 915k, False: 84.1k]
  ------------------
  261|   915k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (261:26): [True: 915k, False: 0]
  |  Branch (261:38): [True: 870k, False: 45.6k]
  ------------------
  262|   915k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (262:19): [True: 45.6k, False: 870k]
  ------------------
  263|   915k|            }
  264|   129k|          }
  265|       |
  266|  1.26M|          if (is_tonal == 1) {
  ------------------
  |  Branch (266:15): [True: 84.1k, False: 1.18M]
  ------------------
  267|  84.1k|            ptr_tonal_flag[i] = 1;
  268|  84.1k|          }
  269|  1.26M|        }
  270|  2.55M|      }
  271|  14.1M|    }
  272|       |
  273|  14.6M|    for (i = 0; i <= 383; i++) {
  ------------------
  |  Branch (273:17): [True: 14.5M, False: 37.9k]
  ------------------
  274|  14.5M|      if (ptr_tonal_flag[i] == 1) {
  ------------------
  |  Branch (274:11): [True: 225k, False: 14.3M]
  ------------------
  275|       |        /* compute the SPL of tonal */
  276|   225k|        tonal_spl =
  277|   225k|            10 * log10(pow(10, (ptr_scratch[i - 1] / 10)) + pow(10, (ptr_scratch[i] / 10)) +
  278|   225k|                       pow(10, (ptr_scratch[i + 1] / 10)));
  279|       |
  280|   225k|        if (i >= 243) {
  ------------------
  |  Branch (280:13): [True: 69.6k, False: 155k]
  ------------------
  281|  69.6k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_768[i] + 20;
  282|   155k|        } else {
  283|   155k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_768[i];
  284|   155k|        }
  285|   225k|        if (tonal_spl < absolute_threshold_xm) {
  ------------------
  |  Branch (285:13): [True: 51.2k, False: 173k]
  ------------------
  286|  51.2k|          ptr_tonal_flag[i] = 0;
  287|  51.2k|        }
  288|   225k|      }
  289|  14.5M|    }
  290|  37.9k|  }
  291|   115k|  return;
  292|   115k|}
ixheaace_signal_classifier.c:iusace_spectral_tilt_analysis:
  380|   115k|                                          WORD32 ccfl) {
  381|   115k|  FLOAT32 *ptr_time_signal = ptr_spec_params->time_signal;
  382|   115k|  WORD32 framecnt_xm = ptr_spec_params->framecnt_xm;
  383|   115k|  FLOAT32 *ptr_spec_tilt_buf = ptr_spec_params->spec_tilt_buf;
  384|   115k|  FLOAT32 *ptr_msd_spec_tilt = ptr_spec_params->msd_spec_tilt;
  385|   115k|  FLOAT32 *ptr_msd_spec_tilt_short = ptr_spec_params->msd_spec_tilt_short;
  386|   115k|  WORD32 i;
  387|   115k|  WORD32 frame_length;
  388|       |
  389|   115k|  FLOAT32 r0, r1;
  390|   115k|  FLOAT32 spec_tilt;
  391|   115k|  FLOAT32 ave_spec_tilt;
  392|       |
  393|       |  /* compute spectral tilt */
  394|   115k|  r0 = 0;
  395|   115k|  r1 = 0;
  396|   108M|  for (i = 0; i < ccfl - 1; i++) {
  ------------------
  |  Branch (396:15): [True: 108M, False: 115k]
  ------------------
  397|   108M|    r0 += ptr_time_signal[i] * ptr_time_signal[i];
  398|   108M|    r1 += ptr_time_signal[i] * ptr_time_signal[i + 1];
  399|   108M|  }
  400|   115k|  r0 += ptr_time_signal[i] * ptr_time_signal[i];
  401|       |
  402|   115k|  if (r0 == 0) {
  ------------------
  |  Branch (402:7): [True: 3.89k, False: 112k]
  ------------------
  403|  3.89k|    spec_tilt = 1.0f;
  404|   112k|  } else {
  405|   112k|    spec_tilt = r1 / r0;
  406|   112k|  }
  407|       |
  408|       |  /* update spec_tilt_buf */
  409|  11.5M|  for (i = 0; i < 100 - 1; i++) {
  ------------------
  |  Branch (409:15): [True: 11.4M, False: 115k]
  ------------------
  410|  11.4M|    ptr_spec_tilt_buf[i] = ptr_spec_tilt_buf[i + 1];
  411|  11.4M|  }
  412|   115k|  ptr_spec_tilt_buf[99] = spec_tilt;
  413|       |
  414|       |  /* compute the long-term mean square deviation of the spectral tilt */
  415|   115k|  if (framecnt_xm < SPECTRAL_TILT_LENGTH) {
  ------------------
  |  |   30|   115k|#define SPECTRAL_TILT_LENGTH 80
  ------------------
  |  Branch (415:7): [True: 57.0k, False: 58.8k]
  ------------------
  416|  57.0k|    frame_length = framecnt_xm;
  417|  58.8k|  } else {
  418|  58.8k|    frame_length = SPECTRAL_TILT_LENGTH;
  ------------------
  |  |   30|  58.8k|#define SPECTRAL_TILT_LENGTH 80
  ------------------
  419|  58.8k|  }
  420|       |
  421|   115k|  ave_spec_tilt = 0;
  422|  6.70M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (422:15): [True: 6.58M, False: 115k]
  ------------------
  423|  6.58M|    ave_spec_tilt += ptr_spec_tilt_buf[99 - i];
  424|  6.58M|  }
  425|   115k|  ave_spec_tilt /= frame_length;
  426|       |
  427|   115k|  *ptr_msd_spec_tilt = 0;
  428|  6.70M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (428:15): [True: 6.58M, False: 115k]
  ------------------
  429|  6.58M|    *ptr_msd_spec_tilt +=
  430|  6.58M|        (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt) * (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt);
  431|  6.58M|  }
  432|   115k|  *ptr_msd_spec_tilt /= frame_length;
  433|       |
  434|       |  /* compute the short-term mean square deviation of the spectral tilt */
  435|   115k|  if (framecnt_xm < SPECTRAL_TILT_LENGTH_SHORT) {
  ------------------
  |  |   31|   115k|#define SPECTRAL_TILT_LENGTH_SHORT 20
  ------------------
  |  Branch (435:7): [True: 20.3k, False: 95.5k]
  ------------------
  436|  20.3k|    frame_length = framecnt_xm;
  437|  95.5k|  } else {
  438|  95.5k|    frame_length = SPECTRAL_TILT_LENGTH_SHORT;
  ------------------
  |  |   31|  95.5k|#define SPECTRAL_TILT_LENGTH_SHORT 20
  ------------------
  439|  95.5k|  }
  440|       |
  441|   115k|  ave_spec_tilt = 0;
  442|  2.21M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (442:15): [True: 2.10M, False: 115k]
  ------------------
  443|  2.10M|    ave_spec_tilt += ptr_spec_tilt_buf[99 - i];
  444|  2.10M|  }
  445|   115k|  ave_spec_tilt /= frame_length;
  446|       |
  447|   115k|  *ptr_msd_spec_tilt_short = 0;
  448|  2.21M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (448:15): [True: 2.10M, False: 115k]
  ------------------
  449|  2.10M|    *ptr_msd_spec_tilt_short +=
  450|  2.10M|        (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt) * (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt);
  451|  2.10M|  }
  452|   115k|  *ptr_msd_spec_tilt_short /= frame_length;
  453|       |
  454|       |  /* compute the energy of current frame */
  455|   115k|  if (r0 <= 1) {
  ------------------
  |  Branch (455:7): [True: 4.95k, False: 110k]
  ------------------
  456|  4.95k|    ptr_spec_params->frame_energy = 0;
  457|   110k|  } else {
  458|   110k|    ptr_spec_params->frame_energy = (FLOAT32)(10 * log(r0) / log(10));
  459|   110k|  }
  460|   115k|  return;
  461|   115k|}
ixheaace_signal_classifier.c:iusace_init_mode_decision:
  463|   115k|static WORD32 iusace_init_mode_decision(ia_mode_params_struct *pstr_mode_params) {
  464|   115k|  WORD32 i;
  465|   115k|  WORD32 framecnt = pstr_mode_params->framecnt;
  466|   115k|  WORD32 *framecnt_xm = pstr_mode_params->framecnt_xm;
  467|   115k|  WORD32 *flag_border = pstr_mode_params->flag_border;
  468|   115k|  FLOAT32 ave_n_tonal_short = pstr_mode_params->ave_n_tonal_short;
  469|   115k|  FLOAT32 ave_n_tonal = pstr_mode_params->ave_n_tonal;
  470|   115k|  FLOAT32 *ave_n_tonal_short_buf = pstr_mode_params->ave_n_tonal_short_buf;
  471|   115k|  FLOAT32 *ave_n_tonal_buf = pstr_mode_params->ave_n_tonal_buf;
  472|   115k|  FLOAT32 msd_spec_tilt = pstr_mode_params->msd_spec_tilt;
  473|   115k|  FLOAT32 msd_spec_tilt_short = pstr_mode_params->msd_spec_tilt_short;
  474|   115k|  FLOAT32 *msd_spec_tilt_buf = pstr_mode_params->msd_spec_tilt_buf;
  475|   115k|  FLOAT32 *msd_spec_tilt_short_buf = pstr_mode_params->msd_spec_tilt_short_buf;
  476|   115k|  FLOAT32 n_tonal_low_frequency_ratio = pstr_mode_params->n_tonal_low_frequency_ratio;
  477|   115k|  FLOAT32 frame_energy = pstr_mode_params->frame_energy;
  478|   115k|  WORD32 init_mode_decision_result = TBD;
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  479|   115k|  WORD32 count_msd_st_monchhichi = 0;
  480|   115k|  WORD32 count_msd_st_speech_music = 0, count_msd_st_music_speech = 0;
  481|   115k|  WORD32 flag_ave_music_speech = 0;
  482|   115k|  WORD32 count_msd_st_music = 0;
  483|   115k|  WORD32 border_state = 0;
  484|   115k|  WORD32 count_quiet_mode = 0;
  485|       |
  486|   115k|  *flag_border = NO_BORDER;
  ------------------
  |  |   34|   115k|#define NO_BORDER 0
  ------------------
  487|       |
  488|       |  /* border decision according to spectral tilt */
  489|       |
  490|       |  /* update msd_spec_tilt_buf, msd_spec_tilt_short_buf */
  491|   579k|  for (i = 0; i < 5 - 1; i++) {
  ------------------
  |  Branch (491:15): [True: 463k, False: 115k]
  ------------------
  492|   463k|    msd_spec_tilt_buf[i] = msd_spec_tilt_buf[i + 1];
  493|   463k|    msd_spec_tilt_short_buf[i] = msd_spec_tilt_short_buf[i + 1];
  494|   463k|  }
  495|   115k|  msd_spec_tilt_buf[4] = msd_spec_tilt;
  496|   115k|  msd_spec_tilt_short_buf[4] = msd_spec_tilt_short;
  497|       |
  498|       |  /* speech->music find strict border of speech->music */
  499|   115k|  if ((msd_spec_tilt >= 0.014) && (msd_spec_tilt_short <= 0.000005)) {
  ------------------
  |  Branch (499:7): [True: 38.0k, False: 77.8k]
  |  Branch (499:35): [True: 2.90k, False: 35.1k]
  ------------------
  500|  2.90k|    count_msd_st_monchhichi++;
  501|   112k|  } else {
  502|   112k|    count_msd_st_monchhichi = 0;
  503|   112k|  }
  504|   115k|  if (((*flag_border != BORDER_SPEECH_MUSIC_DEFINITE) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (504:8): [True: 115k, False: 0]
  ------------------
  505|   115k|       (*flag_border != BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   115k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (505:8): [True: 115k, False: 0]
  ------------------
  506|   115k|      (border_state != BORDER_SPEECH_MUSIC_DEFINITE) && (count_msd_st_monchhichi >= 15) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (506:7): [True: 115k, False: 0]
  |  Branch (506:57): [True: 0, False: 115k]
  ------------------
  507|      0|      (*framecnt_xm >= 300)) {
  ------------------
  |  Branch (507:7): [True: 0, False: 0]
  ------------------
  508|      0|    *framecnt_xm = 10;
  509|      0|    *flag_border = BORDER_SPEECH_MUSIC;
  ------------------
  |  |   37|      0|#define BORDER_SPEECH_MUSIC 3
  ------------------
  510|      0|  }
  511|       |
  512|       |  /* find the relative loose border of speech->music */
  513|   115k|  if ((msd_spec_tilt >= 0.0025) && (msd_spec_tilt_short <= 0.000003)) {
  ------------------
  |  Branch (513:7): [True: 47.2k, False: 68.6k]
  |  Branch (513:36): [True: 5.14k, False: 42.1k]
  ------------------
  514|  5.14k|    count_msd_st_speech_music++;
  515|   110k|  } else {
  516|   110k|    count_msd_st_speech_music = 0;
  517|   110k|  }
  518|   115k|  if (((*flag_border != BORDER_SPEECH_MUSIC_DEFINITE) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (518:8): [True: 115k, False: 0]
  ------------------
  519|   115k|       (*flag_border != BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   115k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (519:8): [True: 115k, False: 0]
  ------------------
  520|   115k|      (border_state != BORDER_SPEECH_MUSIC_DEFINITE) && (count_msd_st_speech_music >= 15) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (520:7): [True: 115k, False: 0]
  |  Branch (520:57): [True: 0, False: 115k]
  ------------------
  521|      0|      (*framecnt_xm >= 300)) {
  ------------------
  |  Branch (521:7): [True: 0, False: 0]
  ------------------
  522|      0|    *framecnt_xm = 10;
  523|      0|    *flag_border = BORDER_SPEECH_MUSIC;
  ------------------
  |  |   37|      0|#define BORDER_SPEECH_MUSIC 3
  ------------------
  524|      0|  }
  525|       |
  526|       |  /* music->speech */
  527|   115k|  if ((msd_spec_tilt_buf[0] <= 0.0003) && (msd_spec_tilt_short_buf[0] <= 0.0002)) {
  ------------------
  |  Branch (527:7): [True: 63.9k, False: 51.9k]
  |  Branch (527:43): [True: 63.1k, False: 832]
  ------------------
  528|  63.1k|    count_msd_st_music_speech++;
  529|  63.1k|  }
  530|   115k|  if (((*flag_border != BORDER_SPEECH_MUSIC_DEFINITE) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (530:8): [True: 115k, False: 0]
  ------------------
  531|   115k|       (*flag_border != BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   115k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (531:8): [True: 115k, False: 0]
  ------------------
  532|   115k|      (border_state != BORDER_MUSIC_SPEECH_DEFINITE) && (count_msd_st_music_speech >= 100) &&
  ------------------
  |  |   36|   115k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (532:7): [True: 115k, False: 0]
  |  Branch (532:57): [True: 0, False: 115k]
  ------------------
  533|      0|      (msd_spec_tilt >= 0.0008) && (msd_spec_tilt_short >= 0.0025) && (*framecnt_xm >= 20)) {
  ------------------
  |  Branch (533:7): [True: 0, False: 0]
  |  Branch (533:36): [True: 0, False: 0]
  |  Branch (533:71): [True: 0, False: 0]
  ------------------
  534|      0|    *framecnt_xm = 10;
  535|      0|    *flag_border = BORDER_MUSIC_SPEECH;
  ------------------
  |  |   35|      0|#define BORDER_MUSIC_SPEECH 1
  ------------------
  536|      0|  }
  537|       |
  538|       |  /* border decision according to tonal
  539|       |   *  update ave_n_tonal_short_buf, ave_n_tonal_buf */
  540|   579k|  for (i = 0; i < 5 - 1; i++) {
  ------------------
  |  Branch (540:15): [True: 463k, False: 115k]
  ------------------
  541|   463k|    ave_n_tonal_short_buf[i] = ave_n_tonal_short_buf[i + 1];
  542|   463k|    ave_n_tonal_buf[i] = ave_n_tonal_buf[i + 1];
  543|   463k|  }
  544|   115k|  ave_n_tonal_short_buf[4] = ave_n_tonal_short;
  545|   115k|  ave_n_tonal_buf[4] = ave_n_tonal;
  546|       |
  547|       |  /* music->speech */
  548|   115k|  if ((ave_n_tonal_buf[0] >= 12) && (ave_n_tonal_buf[0] < 15) &&
  ------------------
  |  Branch (548:7): [True: 5.25k, False: 110k]
  |  Branch (548:37): [True: 4.40k, False: 844]
  ------------------
  549|  4.40k|      (ave_n_tonal_buf[0] - ave_n_tonal_short_buf[0] >= 5) && (*framecnt_xm >= 20) &&
  ------------------
  |  Branch (549:7): [True: 340, False: 4.06k]
  |  Branch (549:63): [True: 106, False: 234]
  ------------------
  550|    106|      (ave_n_tonal_short - ave_n_tonal_short_buf[0] < 5)) {
  ------------------
  |  Branch (550:7): [True: 102, False: 4]
  ------------------
  551|    102|    *framecnt_xm = 10;
  552|    102|    flag_ave_music_speech = 1;
  553|    102|    *flag_border = BORDER_MUSIC_SPEECH_DEFINITE;
  ------------------
  |  |   36|    102|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  554|    102|  }
  555|       |
  556|       |  /* update border decision according to energy */
  557|   115k|  if (frame_energy <= 60) {
  ------------------
  |  Branch (557:7): [True: 5.14k, False: 110k]
  ------------------
  558|  5.14k|    count_quiet_mode = 0;
  559|   110k|  } else {
  560|   110k|    count_quiet_mode++;
  561|   110k|  }
  562|       |
  563|   115k|  if ((*flag_border == BORDER_MUSIC_SPEECH) && (count_quiet_mode <= 5)) {
  ------------------
  |  |   35|   115k|#define BORDER_MUSIC_SPEECH 1
  ------------------
  |  Branch (563:7): [True: 0, False: 115k]
  |  Branch (563:48): [True: 0, False: 0]
  ------------------
  564|      0|    *flag_border = BORDER_MUSIC_SPEECH_DEFINITE;
  ------------------
  |  |   36|      0|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  565|      0|    *framecnt_xm = 10;
  566|      0|  }
  567|       |
  568|       |  /* MUSIC_DEFINITE and SPEECH_DEFINITE mode decision according to short-term characters */
  569|       |
  570|       |  /* ave_n_tonal_short */
  571|   115k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal_short >= 19)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (571:7): [True: 115k, False: 0]
  |  Branch (571:45): [True: 1.09k, False: 114k]
  ------------------
  572|  1.09k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  1.09k|#define MUSIC_DEFINITE 3
  ------------------
  573|  1.09k|  }
  574|   115k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal_short <= 1.5)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (574:7): [True: 114k, False: 1.09k]
  |  Branch (574:45): [True: 58.8k, False: 55.9k]
  ------------------
  575|  58.8k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  58.8k|#define SPEECH_DEFINITE 1
  ------------------
  576|  58.8k|  }
  577|       |
  578|       |  /* msd_spec_tilt_short */
  579|   115k|  if (msd_spec_tilt_short >= 0.02) {
  ------------------
  |  Branch (579:7): [True: 28.8k, False: 87.0k]
  ------------------
  580|  28.8k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  28.8k|#define SPEECH_DEFINITE 1
  ------------------
  581|  28.8k|  }
  582|   115k|  if ((init_mode_decision_result == TBD) && (msd_spec_tilt_short <= 0.00000025) &&
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (582:7): [True: 41.6k, False: 74.2k]
  |  Branch (582:45): [True: 15.2k, False: 26.4k]
  ------------------
  583|  15.2k|      (framecnt >= 10)) {
  ------------------
  |  Branch (583:7): [True: 13.0k, False: 2.15k]
  ------------------
  584|  13.0k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  13.0k|#define MUSIC_DEFINITE 3
  ------------------
  585|  13.0k|  }
  586|       |
  587|       |  /* SPEECH mode decision */
  588|       |
  589|       |  /* flag_ave_music_speech??ave_n_tonal_short */
  590|   115k|  if ((init_mode_decision_result == TBD) && (flag_ave_music_speech == 1)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (590:7): [True: 28.6k, False: 87.2k]
  |  Branch (590:45): [True: 52, False: 28.5k]
  ------------------
  591|     52|    if ((ave_n_tonal_short <= 12) && (*framecnt_xm <= 150)) {
  ------------------
  |  Branch (591:9): [True: 43, False: 9]
  |  Branch (591:38): [True: 43, False: 0]
  ------------------
  592|     43|      init_mode_decision_result = SPEECH;
  ------------------
  |  |   42|     43|#define SPEECH 2
  ------------------
  593|     43|    }
  594|     52|  }
  595|       |
  596|       |  /* MUSIC_DEFINITE and SPEECH_DEFINITE mode decision */
  597|       |
  598|       |  /* ave_n_tonal */
  599|   115k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal <= 3)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (599:7): [True: 28.5k, False: 87.3k]
  |  Branch (599:45): [True: 15.7k, False: 12.8k]
  ------------------
  600|  15.7k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  15.7k|#define SPEECH_DEFINITE 1
  ------------------
  601|  15.7k|  }
  602|   115k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal >= 15)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (602:7): [True: 12.8k, False: 103k]
  |  Branch (602:45): [True: 597, False: 12.2k]
  ------------------
  603|    597|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|    597|#define MUSIC_DEFINITE 3
  ------------------
  604|    597|  }
  605|       |
  606|       |  /** ave_n_tonal_short
  607|       |   */
  608|   115k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal_short >= 17)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (608:7): [True: 12.2k, False: 103k]
  |  Branch (608:45): [True: 933, False: 11.3k]
  ------------------
  609|    933|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|    933|#define MUSIC_DEFINITE 3
  ------------------
  610|    933|  }
  611|       |
  612|       |  /** msd_spec_tilt
  613|       |   */
  614|   115k|  if ((init_mode_decision_result == TBD) && (msd_spec_tilt >= 0.01)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (614:7): [True: 11.3k, False: 104k]
  |  Branch (614:45): [True: 3.85k, False: 7.49k]
  ------------------
  615|  3.85k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  3.85k|#define SPEECH_DEFINITE 1
  ------------------
  616|  3.85k|  }
  617|   115k|  if ((init_mode_decision_result == TBD) && (framecnt >= 10) && (msd_spec_tilt <= 0.00004)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (617:7): [True: 7.49k, False: 108k]
  |  Branch (617:45): [True: 5.64k, False: 1.85k]
  |  Branch (617:65): [True: 1.82k, False: 3.81k]
  ------------------
  618|  1.82k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  1.82k|#define MUSIC_DEFINITE 3
  ------------------
  619|  1.82k|  }
  620|       |
  621|       |  /** n_tonal_low_frequency_ratio
  622|       |   */
  623|   115k|  if ((init_mode_decision_result == TBD) && (n_tonal_low_frequency_ratio <= 0.91)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (623:7): [True: 5.67k, False: 110k]
  |  Branch (623:45): [True: 2.52k, False: 3.14k]
  ------------------
  624|  2.52k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  2.52k|#define MUSIC_DEFINITE 3
  ------------------
  625|  2.52k|  }
  626|       |
  627|       |  /** MUSIC and SPEECH mode decision
  628|       |   */
  629|       |
  630|       |  /** msd_spec_tilt
  631|       |   */
  632|   115k|  if ((init_mode_decision_result == TBD) && (msd_spec_tilt <= 0.0002) && (*framecnt_xm >= 15)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (632:7): [True: 3.14k, False: 112k]
  |  Branch (632:45): [True: 1.79k, False: 1.34k]
  |  Branch (632:74): [True: 469, False: 1.32k]
  ------------------
  633|    469|    init_mode_decision_result = MUSIC;
  ------------------
  |  |   44|    469|#define MUSIC 4
  ------------------
  634|    469|  }
  635|       |
  636|       |  /** n_tonal_low_frequency_ratio
  637|       |   */
  638|   115k|  if ((init_mode_decision_result == TBD) && (n_tonal_low_frequency_ratio >= 0.95)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (638:7): [True: 2.67k, False: 113k]
  |  Branch (638:45): [True: 1.27k, False: 1.40k]
  ------------------
  639|  1.27k|    init_mode_decision_result = SPEECH;
  ------------------
  |  |   42|  1.27k|#define SPEECH 2
  ------------------
  640|  1.27k|  }
  641|   115k|  if ((init_mode_decision_result == TBD) && (n_tonal_low_frequency_ratio <= 0.935)) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (641:7): [True: 1.40k, False: 114k]
  |  Branch (641:45): [True: 857, False: 545]
  ------------------
  642|    857|    init_mode_decision_result = MUSIC;
  ------------------
  |  |   44|    857|#define MUSIC 4
  ------------------
  643|    857|  }
  644|       |
  645|       |  /** the rest of the frame to SPEECH
  646|       |   */
  647|   115k|  if (init_mode_decision_result == TBD) {
  ------------------
  |  |   40|   115k|#define TBD 0
  ------------------
  |  Branch (647:7): [True: 545, False: 115k]
  ------------------
  648|    545|    init_mode_decision_result = SPEECH;
  ------------------
  |  |   42|    545|#define SPEECH 2
  ------------------
  649|    545|  }
  650|       |
  651|       |  /** MUSIC mode decision according to changes of the MSD of the spectral tilt
  652|       |   */
  653|       |
  654|       |  /** compute the changes of the MSD of the spectral tilt
  655|       |   */
  656|   115k|  if ((msd_spec_tilt <= 0.007) && (init_mode_decision_result != SPEECH_DEFINITE)) {
  ------------------
  |  |   41|  74.6k|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (656:7): [True: 74.6k, False: 41.2k]
  |  Branch (656:35): [True: 19.5k, False: 55.0k]
  ------------------
  657|  19.5k|    if (init_mode_decision_result != SPEECH) {
  ------------------
  |  |   42|  19.5k|#define SPEECH 2
  ------------------
  |  Branch (657:9): [True: 17.8k, False: 1.68k]
  ------------------
  658|  17.8k|      count_msd_st_music++;
  659|  17.8k|    }
  660|  96.3k|  } else {
  661|  96.3k|    count_msd_st_music = 0;
  662|  96.3k|  }
  663|       |
  664|   115k|  if ((init_mode_decision_result != SPEECH_DEFINITE) && (count_msd_st_music >= 400) &&
  ------------------
  |  |   41|   115k|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (664:7): [True: 23.0k, False: 92.8k]
  |  Branch (664:57): [True: 0, False: 23.0k]
  ------------------
  665|      0|      (border_state != BORDER_MUSIC_SPEECH_DEFINITE)) {
  ------------------
  |  |   36|      0|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (665:7): [True: 0, False: 0]
  ------------------
  666|      0|    init_mode_decision_result = MUSIC;
  ------------------
  |  |   44|      0|#define MUSIC 4
  ------------------
  667|      0|  }
  668|       |
  669|       |  /** update border flag
  670|       |   */
  671|       |
  672|   115k|  if (*flag_border != NO_BORDER) {
  ------------------
  |  |   34|   115k|#define NO_BORDER 0
  ------------------
  |  Branch (672:7): [True: 102, False: 115k]
  ------------------
  673|    102|    border_state = *flag_border;
  674|    102|  }
  675|       |
  676|       |  /** update BORDER_SPEECH_MUSIC_DEFINITE
  677|       |   */
  678|   115k|  if (((border_state == BORDER_MUSIC_SPEECH) || (border_state == BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   35|   115k|#define BORDER_MUSIC_SPEECH 1
  ------------------
                if (((border_state == BORDER_MUSIC_SPEECH) || (border_state == BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   115k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (678:8): [True: 0, False: 115k]
  |  Branch (678:49): [True: 102, False: 115k]
  ------------------
  679|    102|      (init_mode_decision_result == MUSIC_DEFINITE) && (*framecnt_xm >= 20)) {
  ------------------
  |  |   43|    102|#define MUSIC_DEFINITE 3
  ------------------
  |  Branch (679:7): [True: 9, False: 93]
  |  Branch (679:56): [True: 0, False: 9]
  ------------------
  680|      0|    *flag_border = BORDER_SPEECH_MUSIC_DEFINITE;
  ------------------
  |  |   38|      0|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  681|      0|    *framecnt_xm = 10;
  682|      0|    border_state = *flag_border;
  683|      0|  }
  684|       |
  685|       |  /** update BORDER_MUSIC_SPEECH_DEFINITE
  686|       |   */
  687|   115k|  if (((border_state == BORDER_SPEECH_MUSIC) || (border_state == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   37|   115k|#define BORDER_SPEECH_MUSIC 3
  ------------------
                if (((border_state == BORDER_SPEECH_MUSIC) || (border_state == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (687:8): [True: 0, False: 115k]
  |  Branch (687:49): [True: 0, False: 115k]
  ------------------
  688|      0|      (init_mode_decision_result == SPEECH_DEFINITE) && (*framecnt_xm >= 20)) {
  ------------------
  |  |   41|      0|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (688:7): [True: 0, False: 0]
  |  Branch (688:57): [True: 0, False: 0]
  ------------------
  689|      0|    *flag_border = BORDER_MUSIC_SPEECH_DEFINITE;
  ------------------
  |  |   36|      0|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  690|      0|    *framecnt_xm = 10;
  691|      0|  }
  692|       |
  693|   115k|  return init_mode_decision_result;
  694|   115k|}
ixheaace_signal_classifier.c:iusace_smoothing_mode_decision:
  696|   115k|static WORD32 iusace_smoothing_mode_decision(ia_smooth_params_struct *pstr_smooth_param) {
  697|   115k|  WORD32 *ptr_init_result_ahead = pstr_smooth_param->init_result_ahead;
  698|   115k|  WORD32 flag_border = pstr_smooth_param->flag_border;
  699|   115k|  WORD32 *ptr_flag_border_buf_behind = pstr_smooth_param->flag_border_buf_behind;
  700|   115k|  WORD32 *ptr_flag_border_buf_ahead = pstr_smooth_param->flag_border_buf_ahead;
  701|   115k|  FLOAT32 frame_energy = pstr_smooth_param->frame_energy;
  702|   115k|  FLOAT32 *ptr_frame_energy_buf_behind = pstr_smooth_param->frame_energy_buf_behind;
  703|   115k|  FLOAT32 *ptr_frame_energy_buf_ahead = pstr_smooth_param->frame_energy_buf_ahead;
  704|   115k|  WORD32 *ptr_smoothing_result_buf = pstr_smooth_param->smoothing_result_buf;
  705|   115k|  WORD32 *ptr_init_result_behind = pstr_smooth_param->init_result_behind;
  706|   115k|  WORD32 init_mode_decision_result = pstr_smooth_param->init_mode_decision_result;
  707|   115k|  WORD32 i;
  708|       |
  709|   115k|  WORD32 mode_decision_result;
  710|       |
  711|   115k|  WORD32 num_music, num_speech;
  712|       |
  713|       |  /** update data array
  714|       |   */
  715|       |
  716|       |  /** update init_result_behind, init_result_ahead
  717|       |   */
  718|  11.5M|  for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (718:15): [True: 11.4M, False: 115k]
  ------------------
  719|  11.4M|    ptr_init_result_behind[i] = ptr_init_result_behind[i + 1];
  720|  11.4M|  }
  721|   115k|  ptr_init_result_behind[99] = ptr_init_result_ahead[0];
  722|       |
  723|   115k|  ptr_init_result_ahead[NFRAMEAHEAD - 1] = init_mode_decision_result;
  ------------------
  |  |   27|   115k|#define NFRAMEAHEAD 1
  ------------------
  724|       |
  725|       |  /** update flag_border_buf_behind, flag_border_buf_ahead
  726|       |   * update frame_energy_buf_behind, frame_energy_buf_ahead
  727|       |   */
  728|       |
  729|  1.15M|  for (i = 0; i < 9; i++) {
  ------------------
  |  Branch (729:15): [True: 1.04M, False: 115k]
  ------------------
  730|  1.04M|    ptr_flag_border_buf_behind[i] = ptr_flag_border_buf_behind[i + 1];
  731|  1.04M|    ptr_frame_energy_buf_behind[i] = ptr_frame_energy_buf_behind[i + 1];
  732|  1.04M|  }
  733|   115k|  ptr_flag_border_buf_behind[9] = ptr_flag_border_buf_ahead[0];
  734|   115k|  ptr_frame_energy_buf_behind[9] = ptr_frame_energy_buf_ahead[0];
  735|       |
  736|   115k|  ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] = flag_border;
  ------------------
  |  |   27|   115k|#define NFRAMEAHEAD 1
  ------------------
  737|       |
  738|   115k|  ptr_frame_energy_buf_ahead[NFRAMEAHEAD - 1] = frame_energy;
  ------------------
  |  |   27|   115k|#define NFRAMEAHEAD 1
  ------------------
  739|       |
  740|       |  /** smoothing according to past results
  741|       |   */
  742|       |
  743|   115k|  mode_decision_result = ptr_init_result_behind[99];
  744|       |
  745|       |  /** update smoothing_result_buf
  746|       |   */
  747|   115k|  if (ptr_flag_border_buf_behind[9] == NO_BORDER) {
  ------------------
  |  |   34|   115k|#define NO_BORDER 0
  ------------------
  |  Branch (747:7): [True: 115k, False: 102]
  ------------------
  748|  11.5M|    for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (748:17): [True: 11.4M, False: 115k]
  ------------------
  749|  11.4M|      ptr_smoothing_result_buf[i] = ptr_smoothing_result_buf[i + 1];
  750|  11.4M|    }
  751|   115k|    pstr_smooth_param->num_smoothing++;
  752|   115k|  } else {
  753|  10.2k|    for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (753:17): [True: 10.0k, False: 102]
  ------------------
  754|  10.0k|      ptr_smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|  10.0k|#define TBD 0
  ------------------
  755|  10.0k|    }
  756|    102|    pstr_smooth_param->num_smoothing = 1;
  757|    102|  }
  758|   115k|  ptr_smoothing_result_buf[99] = ptr_init_result_behind[99];
  759|       |
  760|   115k|  if (pstr_smooth_param->num_smoothing >= SMOOTHING_LENGTH) {
  ------------------
  |  |   32|   115k|#define SMOOTHING_LENGTH 100
  ------------------
  |  Branch (760:7): [True: 0, False: 115k]
  ------------------
  761|      0|    num_music = 0;
  762|      0|    num_speech = 0;
  763|       |
  764|       |    /** smoothed result count
  765|       |     */
  766|      0|    for (i = 0; i < SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   32|      0|#define SMOOTHING_LENGTH 100
  ------------------
  |  Branch (766:17): [True: 0, False: 0]
  ------------------
  767|      0|      if ((ptr_smoothing_result_buf[100 - i] == SPEECH) ||
  ------------------
  |  |   42|      0|#define SPEECH 2
  ------------------
  |  Branch (767:11): [True: 0, False: 0]
  ------------------
  768|      0|          (ptr_smoothing_result_buf[100 - i] == SPEECH_DEFINITE)) {
  ------------------
  |  |   41|      0|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (768:11): [True: 0, False: 0]
  ------------------
  769|      0|        num_speech++;
  770|      0|      } else {
  771|      0|        num_music++;
  772|      0|      }
  773|      0|    }
  774|       |
  775|       |    /** smoothing
  776|       |     */
  777|      0|    if ((num_speech > num_music) && (init_mode_decision_result != MUSIC_DEFINITE)) {
  ------------------
  |  |   43|      0|#define MUSIC_DEFINITE 3
  ------------------
  |  Branch (777:9): [True: 0, False: 0]
  |  Branch (777:37): [True: 0, False: 0]
  ------------------
  778|      0|      mode_decision_result = SPEECH;
  ------------------
  |  |   42|      0|#define SPEECH 2
  ------------------
  779|      0|    }
  780|      0|    if ((num_music > num_speech) && (init_mode_decision_result != SPEECH_DEFINITE)) {
  ------------------
  |  |   41|      0|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (780:9): [True: 0, False: 0]
  |  Branch (780:37): [True: 0, False: 0]
  ------------------
  781|      0|      mode_decision_result = MUSIC;
  ------------------
  |  |   44|      0|#define MUSIC 4
  ------------------
  782|      0|    }
  783|      0|  }
  784|       |
  785|       |  /** correct according to energies and ahead mode decision results
  786|       |   */
  787|       |
  788|   115k|  if ((mode_decision_result == MUSIC) && (ptr_frame_energy_buf_behind[9] <= 60)) {
  ------------------
  |  |   44|   115k|#define MUSIC 4
  ------------------
  |  Branch (788:7): [True: 1.31k, False: 114k]
  |  Branch (788:42): [True: 7, False: 1.30k]
  ------------------
  789|     14|    for (i = 0; i < NFRAMEAHEAD; i++) {
  ------------------
  |  |   27|     14|#define NFRAMEAHEAD 1
  ------------------
  |  Branch (789:17): [True: 7, False: 7]
  ------------------
  790|      7|      if ((ptr_init_result_ahead[i] == SPEECH_DEFINITE) || (ptr_init_result_ahead[i] == SPEECH)) {
  ------------------
  |  |   41|      7|#define SPEECH_DEFINITE 1
  ------------------
                    if ((ptr_init_result_ahead[i] == SPEECH_DEFINITE) || (ptr_init_result_ahead[i] == SPEECH)) {
  ------------------
  |  |   42|      3|#define SPEECH 2
  ------------------
  |  Branch (790:11): [True: 4, False: 3]
  |  Branch (790:60): [True: 1, False: 2]
  ------------------
  791|      5|        pstr_smooth_param->flag_speech_definite = 1;
  792|      5|      }
  793|      7|    }
  794|      7|  }
  795|   115k|  if ((pstr_smooth_param->flag_speech_definite == 1) && (mode_decision_result == MUSIC)) {
  ------------------
  |  |   44|      5|#define MUSIC 4
  ------------------
  |  Branch (795:7): [True: 5, False: 115k]
  |  Branch (795:57): [True: 5, False: 0]
  ------------------
  796|      5|    mode_decision_result = SPEECH;
  ------------------
  |  |   42|      5|#define SPEECH 2
  ------------------
  797|   115k|  } else {
  798|   115k|    pstr_smooth_param->flag_speech_definite = 0;
  799|   115k|  }
  800|       |
  801|       |  /** correct MUSIC mode
  802|       |   */
  803|       |
  804|   115k|  if (ptr_frame_energy_buf_behind[9] <= 65) {
  ------------------
  |  Branch (804:7): [True: 6.46k, False: 109k]
  ------------------
  805|  6.46k|    pstr_smooth_param->count_small_energy = 0;
  806|   109k|  } else {
  807|   109k|    pstr_smooth_param->count_small_energy++;
  808|   109k|  }
  809|   115k|  if (((ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC) ||
  ------------------
  |  |   27|   115k|#define NFRAMEAHEAD 1
  ------------------
                if (((ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC) ||
  ------------------
  |  |   37|   115k|#define BORDER_SPEECH_MUSIC 3
  ------------------
  |  Branch (809:8): [True: 0, False: 115k]
  ------------------
  810|   115k|       (ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   27|   115k|#define NFRAMEAHEAD 1
  ------------------
                     (ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   38|   115k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (810:8): [True: 0, False: 115k]
  ------------------
  811|      0|      (pstr_smooth_param->count_small_energy <= 30)) {
  ------------------
  |  Branch (811:7): [True: 0, False: 0]
  ------------------
  812|      0|    pstr_smooth_param->flag_music_definite = 1;
  813|      0|  }
  814|   115k|  if ((pstr_smooth_param->flag_music_definite == 1) &&
  ------------------
  |  Branch (814:7): [True: 0, False: 115k]
  ------------------
  815|      0|      ((mode_decision_result == SPEECH) || (mode_decision_result == SPEECH_DEFINITE))) {
  ------------------
  |  |   42|      0|#define SPEECH 2
  ------------------
                    ((mode_decision_result == SPEECH) || (mode_decision_result == SPEECH_DEFINITE))) {
  ------------------
  |  |   41|      0|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (815:8): [True: 0, False: 0]
  |  Branch (815:44): [True: 0, False: 0]
  ------------------
  816|      0|    mode_decision_result = MUSIC;
  ------------------
  |  |   44|      0|#define MUSIC 4
  ------------------
  817|   115k|  } else {
  818|   115k|    pstr_smooth_param->flag_music_definite = 0;
  819|   115k|  }
  820|       |
  821|   115k|  return mode_decision_result;
  822|   115k|}

ia_enhaacplus_enc_count_static_bitdemand:
  137|   308k|    WORD32 stat_bits_flag, WORD32 flag_last_element) {
  138|   308k|  WORD32 static_bits = 0;
  139|   308k|  WORD32 ch;
  140|       |
  141|   308k|  switch (channels) {
  ------------------
  |  Branch (141:11): [True: 308k, False: 0]
  ------------------
  142|   167k|    case 1:
  ------------------
  |  Branch (142:5): [True: 167k, False: 140k]
  ------------------
  143|       |
  144|   167k|      static_bits += SI_ID_BITS + SI_SCE_BITS + SI_ICS_BITS;
  145|       |
  146|   167k|      static_bits += ia_enhaacplus_enc_count_tns_bits(&(psy_out_ch[0]->tns_info),
  147|   167k|                                                      psy_out_ch[0]->window_sequence);
  148|   167k|      switch (psy_out_ch[0]->window_sequence) {
  ------------------
  |  Branch (148:15): [True: 167k, False: 0]
  ------------------
  149|   140k|        case LONG_WINDOW:
  ------------------
  |  |   31|   140k|#define LONG_WINDOW 0
  ------------------
  |  Branch (149:9): [True: 140k, False: 26.3k]
  ------------------
  150|   146k|        case START_WINDOW:
  ------------------
  |  |   32|   146k|#define START_WINDOW 1
  ------------------
  |  Branch (150:9): [True: 5.77k, False: 161k]
  ------------------
  151|   152k|        case STOP_WINDOW:
  ------------------
  |  |   34|   152k|#define STOP_WINDOW 3
  ------------------
  |  Branch (151:9): [True: 5.35k, False: 162k]
  ------------------
  152|       |
  153|   152k|          static_bits += SI_ICS_INFO_BITS_LONG;
  154|   152k|          break;
  155|       |
  156|  15.2k|        case SHORT_WINDOW:
  ------------------
  |  |   33|  15.2k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (156:9): [True: 15.2k, False: 152k]
  ------------------
  157|       |
  158|  15.2k|          static_bits += SI_ICS_INFO_BITS_SHORT;
  159|  15.2k|          break;
  160|   167k|      }
  161|   167k|      break;
  162|       |
  163|   167k|    case 2:
  ------------------
  |  Branch (163:5): [True: 140k, False: 167k]
  ------------------
  164|   140k|      static_bits += SI_ID_BITS + SI_CPE_BITS + 2 * SI_ICS_BITS;
  165|       |
  166|   140k|      static_bits += SI_CPE_MS_MASK_BITS;
  167|       |
  168|   140k|      static_bits += ia_enhaacplus_enc_count_ms_mask_bits(
  169|   140k|          psy_out_ch[0]->sfb_count, psy_out_ch[0]->sfb_per_group, psy_out_ch[0]->max_sfb_per_grp,
  170|   140k|          &pstr_psy_out_element->tools_info);
  171|       |
  172|   140k|      switch (psy_out_ch[0]->window_sequence) {
  ------------------
  |  Branch (172:15): [True: 140k, False: 0]
  ------------------
  173|  91.0k|        case LONG_WINDOW:
  ------------------
  |  |   31|  91.0k|#define LONG_WINDOW 0
  ------------------
  |  Branch (173:9): [True: 91.0k, False: 49.7k]
  ------------------
  174|  98.4k|        case START_WINDOW:
  ------------------
  |  |   32|  98.4k|#define START_WINDOW 1
  ------------------
  |  Branch (174:9): [True: 7.42k, False: 133k]
  ------------------
  175|   104k|        case STOP_WINDOW:
  ------------------
  |  |   34|   104k|#define STOP_WINDOW 3
  ------------------
  |  Branch (175:9): [True: 6.50k, False: 134k]
  ------------------
  176|       |
  177|   104k|          static_bits += SI_ICS_INFO_BITS_LONG;
  178|   104k|          break;
  179|       |
  180|  35.8k|        case SHORT_WINDOW:
  ------------------
  |  |   33|  35.8k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (180:9): [True: 35.8k, False: 104k]
  ------------------
  181|       |
  182|  35.8k|          static_bits += SI_ICS_INFO_BITS_SHORT;
  183|  35.8k|          break;
  184|   140k|      }
  185|       |
  186|   422k|      for (ch = 0; ch < 2; ch++) {
  ------------------
  |  Branch (186:20): [True: 281k, False: 140k]
  ------------------
  187|   281k|        static_bits += ia_enhaacplus_enc_count_tns_bits(&(psy_out_ch[ch]->tns_info),
  188|   281k|                                                        psy_out_ch[ch]->window_sequence);
  189|   281k|      }
  190|       |
  191|   140k|      break;
  192|   308k|  }
  193|       |
  194|   308k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   616k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   557k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (194:7): [True: 59.0k, False: 249k]
  |  Branch (194:28): [True: 125k, False: 123k]
  |  Branch (194:46): [True: 19.7k, False: 104k]
  ------------------
  195|   204k|    if (!(adts_flag)) {
  ------------------
  |  Branch (195:9): [True: 125k, False: 78.7k]
  ------------------
  196|   125k|      return static_bits + stat_bits_flag * 8;
  197|   125k|    }
  198|       |
  199|  78.7k|    if (adts_flag && (stat_bits_flag) && (flag_last_element)) {
  ------------------
  |  Branch (199:9): [True: 78.7k, False: 0]
  |  Branch (199:22): [True: 27.1k, False: 51.6k]
  |  Branch (199:42): [True: 10.8k, False: 16.3k]
  ------------------
  200|  10.8k|      return static_bits + 56;
  201|  67.9k|    } else {
  202|  67.9k|      return static_bits;
  203|  67.9k|    }
  204|   104k|  } else {
  205|   104k|    return static_bits;  // Default Case
  206|   104k|  }
  207|   308k|}
ixheaace_static_bits.c:ia_enhaacplus_enc_count_tns_bits:
  130|   448k|    ixheaace_temporal_noise_shaping_params *pstr_tns_info, WORD32 block_type) {
  131|   448k|  return (ia_enhaacplus_enc_tns_count(pstr_tns_info, block_type));
  132|   448k|}
ixheaace_static_bits.c:ia_enhaacplus_enc_tns_count:
   69|   448k|                                          WORD32 block_type) {
   70|   448k|  WORD32 i, k;
   71|   448k|  WORD32 tns_present;
   72|   448k|  WORD32 num_windows;
   73|   448k|  WORD32 count;
   74|   448k|  WORD32 coef_bits;
   75|       |
   76|   448k|  count = 0;
   77|   448k|  num_windows = (block_type == 2 ? 8 : 1);
  ------------------
  |  Branch (77:18): [True: 86.9k, False: 362k]
  ------------------
   78|   448k|  tns_present = 0;
   79|       |
   80|  1.50M|  for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (80:15): [True: 1.05M, False: 448k]
  ------------------
   81|  1.05M|    if (pstr_tns_info->tns_active[i] == 1) {
  ------------------
  |  Branch (81:9): [True: 345k, False: 711k]
  ------------------
   82|   345k|      tns_present = 1;
   83|   345k|    }
   84|  1.05M|  }
   85|       |
   86|   448k|  if (tns_present == 1) {
  ------------------
  |  Branch (86:7): [True: 225k, False: 223k]
  ------------------
   87|   797k|    for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (87:17): [True: 571k, False: 225k]
  ------------------
   88|   571k|      count += (block_type == SHORT_WINDOW ? 1 : 2);
  ------------------
  |  |   33|   571k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (88:17): [True: 395k, False: 176k]
  ------------------
   89|       |
   90|   571k|      if (pstr_tns_info->tns_active[i]) {
  ------------------
  |  Branch (90:11): [True: 345k, False: 226k]
  ------------------
   91|   345k|        count += (block_type == SHORT_WINDOW ? 8 : 12);
  ------------------
  |  |   33|   345k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (91:19): [True: 169k, False: 176k]
  ------------------
   92|       |
   93|   345k|        if (pstr_tns_info->order[i]) {
  ------------------
  |  Branch (93:13): [True: 345k, False: 107]
  ------------------
   94|   345k|          count += 2; /*coef_compression */
   95|       |
   96|   345k|          if (pstr_tns_info->coef_res[i] == 4) {
  ------------------
  |  Branch (96:15): [True: 176k, False: 169k]
  ------------------
   97|   176k|            coef_bits = 3;
   98|       |
   99|   610k|            for (k = 0; k < pstr_tns_info->order[i]; k++) {
  ------------------
  |  Branch (99:25): [True: 581k, False: 29.1k]
  ------------------
  100|   581k|              if (pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 3 ||
  ------------------
  |  |   23|   581k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (100:19): [True: 110k, False: 471k]
  ------------------
  101|   471k|                  pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -4) {
  ------------------
  |  |   23|   471k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (101:19): [True: 36.8k, False: 434k]
  ------------------
  102|   146k|                coef_bits = 4;
  103|   146k|                break;
  104|   146k|              }
  105|   581k|            }
  106|   176k|          } else {
  107|   169k|            coef_bits = 2;
  108|       |
  109|   465k|            for (k = 0; k < pstr_tns_info->order[i]; k++) {
  ------------------
  |  Branch (109:25): [True: 352k, False: 112k]
  ------------------
  110|   352k|              if (pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 1 ||
  ------------------
  |  |   23|   352k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (110:19): [True: 53.4k, False: 299k]
  ------------------
  111|   299k|                  pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -2) {
  ------------------
  |  |   23|   299k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (111:19): [True: 3.68k, False: 295k]
  ------------------
  112|  57.0k|                coef_bits = 3;
  113|  57.0k|                break;
  114|  57.0k|              }
  115|   352k|            }
  116|   169k|          }
  117|       |
  118|  2.27M|          for (k = 0; k < pstr_tns_info->order[i]; k++) {
  ------------------
  |  Branch (118:23): [True: 1.93M, False: 345k]
  ------------------
  119|  1.93M|            count += coef_bits;
  120|  1.93M|          }
  121|   345k|        }
  122|   345k|      }
  123|   571k|    }
  124|   225k|  }
  125|       |
  126|   448k|  return count;
  127|   448k|}
ixheaace_static_bits.c:ia_enhaacplus_enc_count_ms_mask_bits:
   49|   140k|                                                   ixheaace_tools_info *pstr_tools_info) {
   50|   140k|  WORD32 ms_bits = 0, sfb_off;
   51|       |
   52|   140k|  switch (pstr_tools_info->ms_digest) {
  ------------------
  |  Branch (52:11): [True: 140k, False: 0]
  ------------------
   53|  24.4k|    case MS_NONE:
  ------------------
  |  Branch (53:5): [True: 24.4k, False: 116k]
  ------------------
   54|   112k|    case MS_ALL:
  ------------------
  |  Branch (54:5): [True: 88.2k, False: 52.5k]
  ------------------
   55|   112k|      break;
   56|       |
   57|  28.1k|    case MS_SOME:
  ------------------
  |  Branch (57:5): [True: 28.1k, False: 112k]
  ------------------
   58|       |
   59|  97.2k|      for (sfb_off = 0; sfb_off < sfb_cnt; sfb_off += sfb_per_group) {
  ------------------
  |  Branch (59:25): [True: 69.1k, False: 28.1k]
  ------------------
   60|  69.1k|        ms_bits += max_sfb_per_grp;
   61|  69.1k|      }
   62|  28.1k|      break;
   63|   140k|  }
   64|       |
   65|   140k|  return ms_bits;
   66|   140k|}

iaace_init_stereo_pre_processing:
   52|  1.22k|                                        FLOAT32 used_scf_ratio) {
   53|  1.22k|  FLOAT32 bpf = bit_rate * 1024.0f / sample_rate;
   54|  1.22k|  FLOAT32 tmp;
   55|       |
   56|  1.22k|  memset(pstr_stereo_pre_pro, 0, sizeof(ixheaace_stereo_pre_pro_struct));
   57|       |
   58|  1.22k|  if (no_channels == 2) {
  ------------------
  |  Branch (58:7): [True: 1.22k, False: 0]
  ------------------
   59|  1.22k|    (pstr_stereo_pre_pro)->stereo_attenuation_flag = 1;
   60|       |
   61|  1.22k|    (pstr_stereo_pre_pro)->norm_pe_fac = 230.0f * used_scf_ratio / bpf;
   62|  1.22k|    (pstr_stereo_pre_pro)->impact_factor =
   63|  1.22k|        MIN(1, 400000.0f / (FLOAT32)(bit_rate - sample_rate * sample_rate / 72000.0f));
  ------------------
  |  |   23|  1.22k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
   64|  1.22k|    (pstr_stereo_pre_pro)->inc_stereo_attenuation = 22050.0f / sample_rate * 400.0f / bpf;
   65|  1.22k|    (pstr_stereo_pre_pro)->dec_stereo_attenuation = 22050.0f / sample_rate * 200.0f / bpf;
   66|       |
   67|  1.22k|    (pstr_stereo_pre_pro)->const_attenuation = 0.0f;
   68|  1.22k|    (pstr_stereo_pre_pro)->stereo_attenuation_max = 12.0f;
   69|       |
   70|       |    /* energy ratio thresholds (dB) */
   71|  1.22k|    (pstr_stereo_pre_pro)->sm_min = 0.0f;
   72|  1.22k|    (pstr_stereo_pre_pro)->sm_max = 15.0f;
   73|  1.22k|    (pstr_stereo_pre_pro)->lr_min = 10.0f;
   74|  1.22k|    (pstr_stereo_pre_pro)->lr_max = 30.0f;
   75|       |
   76|       |    /* pe thresholds */
   77|  1.22k|    (pstr_stereo_pre_pro)->pe_crit = 1200.0f;
   78|  1.22k|    (pstr_stereo_pre_pro)->pe_min = 700.0f;
   79|  1.22k|    (pstr_stereo_pre_pro)->pe_impact_max = 100.0f;
   80|       |
   81|       |    /* init start values */
   82|  1.22k|    (pstr_stereo_pre_pro)->average_freq_energy_l = 0.0f;
   83|  1.22k|    (pstr_stereo_pre_pro)->average_freq_energy_r = 0.0f;
   84|  1.22k|    (pstr_stereo_pre_pro)->average_freq_energy_s = 0.0f;
   85|  1.22k|    (pstr_stereo_pre_pro)->average_freq_energy_m = 0.0f;
   86|  1.22k|    (pstr_stereo_pre_pro)->smoothed_pe_sum_sum = 7000.0f; /* typical start value */
   87|  1.22k|    (pstr_stereo_pre_pro)->avg_s_to_m = -10.0f;           /* typical start value */
   88|  1.22k|    (pstr_stereo_pre_pro)->last_l_to_r = 0.0f;
   89|  1.22k|    (pstr_stereo_pre_pro)->last_nrg_lr = 0.0f;
   90|       |
   91|  1.22k|    tmp = 1.0f - (bpf / 2600.0f);
   92|       |
   93|  1.22k|    tmp = MAX(tmp, 0.0f);
  ------------------
  |  |   24|  1.22k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 1.10k, False: 122]
  |  |  ------------------
  ------------------
   94|       |
   95|  1.22k|    (pstr_stereo_pre_pro)->stereo_attenuation =
   96|  1.22k|        tmp * (pstr_stereo_pre_pro)->stereo_attenuation_max;
   97|  1.22k|  }
   98|       |
   99|  1.22k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  1.22k|#define IA_NO_ERROR 0x00000000
  ------------------
  100|  1.22k|}
iaace_apply_stereo_preproc:
  104|   140k|                                FLOAT32 *ptr_time_data, WORD32 granule_len) {
  105|   140k|  FLOAT32 sm_ratio, s_to_m;
  106|   140k|  FLOAT32 lr_ratio, l_to_r, delta_l_to_r, delta_nrg;
  107|   140k|  FLOAT32 en_impact, pe_impact, pe_norm;
  108|   140k|  FLOAT32 att, att_aimed;
  109|   140k|  FLOAT32 max_inc, max_dec, swift_factor;
  110|   140k|  FLOAT32 delta = 0.1f;
  111|   140k|  FLOAT32 fac = pstr_stereo_pre_pro->stereo_attenuation_fac;
  112|   140k|  FLOAT32 m_part, upper, div;
  113|   140k|  FLOAT32 l_fac, r_fac;
  114|   140k|  FLOAT32 L, R;
  115|   140k|  WORD32 i;
  116|       |
  117|   140k|  if (!pstr_stereo_pre_pro->stereo_attenuation_flag) {
  ------------------
  |  Branch (117:7): [True: 67.2k, False: 73.5k]
  ------------------
  118|  67.2k|    return;
  119|  67.2k|  }
  120|       |
  121|  73.5k|  m_part = 2.0f * pstr_stereo_pre_pro->average_freq_energy_m * (1.0f - fac * fac);
  122|       |
  123|  73.5k|  upper = pstr_stereo_pre_pro->average_freq_energy_l * (1.0f + fac) +
  124|  73.5k|          pstr_stereo_pre_pro->average_freq_energy_r * (1.0f - fac) - m_part;
  125|  73.5k|  div = pstr_stereo_pre_pro->average_freq_energy_r * (1.0f + fac) +
  126|  73.5k|        pstr_stereo_pre_pro->average_freq_energy_l * (1.0f - fac) - m_part;
  127|       |
  128|  73.5k|  if ((div == 0.0f) || (upper == 0.0f)) {
  ------------------
  |  Branch (128:7): [True: 10.4k, False: 63.0k]
  |  Branch (128:24): [True: 23, False: 63.0k]
  ------------------
  129|  10.4k|    l_to_r = pstr_stereo_pre_pro->lr_max;
  130|  63.0k|  } else {
  131|  63.0k|    lr_ratio = (FLOAT32)fabs(upper / div);
  132|  63.0k|    l_to_r = (FLOAT32)fabs(10.0f * log10(lr_ratio));
  133|  63.0k|  }
  134|       |
  135|       |  /* Calculate delta energy to previous frame */
  136|  73.5k|  delta_nrg = (pstr_stereo_pre_pro->average_freq_energy_l +
  137|  73.5k|               pstr_stereo_pre_pro->average_freq_energy_r + 1.0f) /
  138|  73.5k|              (pstr_stereo_pre_pro->last_nrg_lr + 1.0f);
  139|       |
  140|  73.5k|  delta_nrg = (FLOAT32)(fabs(10.0f * log10(delta_nrg)));
  141|       |
  142|       |  /* Smooth S/M over time */
  143|  73.5k|  sm_ratio = (pstr_stereo_pre_pro->average_freq_energy_s + 1.0f) /
  144|  73.5k|             (pstr_stereo_pre_pro->average_freq_energy_m + 1.0f);
  145|       |
  146|  73.5k|  s_to_m = (FLOAT32)(10.0f * log10(sm_ratio));
  147|       |
  148|  73.5k|  pstr_stereo_pre_pro->avg_s_to_m =
  149|  73.5k|      delta * s_to_m + (1 - delta) * pstr_stereo_pre_pro->avg_s_to_m;
  150|       |
  151|  73.5k|  en_impact = 1.0f;
  152|       |
  153|  73.5k|  if (pstr_stereo_pre_pro->avg_s_to_m > pstr_stereo_pre_pro->sm_min) {
  ------------------
  |  Branch (153:7): [True: 1.57k, False: 71.9k]
  ------------------
  154|  1.57k|    if (pstr_stereo_pre_pro->avg_s_to_m > pstr_stereo_pre_pro->sm_max) {
  ------------------
  |  Branch (154:9): [True: 82, False: 1.49k]
  ------------------
  155|     82|      en_impact = 0.0f;
  156|  1.49k|    } else {
  157|  1.49k|      en_impact = (pstr_stereo_pre_pro->sm_max - pstr_stereo_pre_pro->avg_s_to_m) /
  158|  1.49k|                  (pstr_stereo_pre_pro->sm_max - pstr_stereo_pre_pro->sm_min);
  159|  1.49k|    }
  160|  1.57k|  }
  161|       |
  162|  73.5k|  if (l_to_r > pstr_stereo_pre_pro->lr_min) {
  ------------------
  |  Branch (162:7): [True: 13.5k, False: 59.9k]
  ------------------
  163|  13.5k|    if (l_to_r > pstr_stereo_pre_pro->lr_max) {
  ------------------
  |  Branch (163:9): [True: 1.41k, False: 12.1k]
  ------------------
  164|  1.41k|      en_impact = 0.0f;
  165|  12.1k|    } else {
  166|  12.1k|      en_impact *= (pstr_stereo_pre_pro->lr_max - l_to_r) /
  167|  12.1k|                   (pstr_stereo_pre_pro->lr_max - pstr_stereo_pre_pro->lr_min);
  168|  12.1k|    }
  169|  13.5k|  }
  170|       |
  171|  73.5k|  pe_impact = 0.0f;
  172|       |
  173|  73.5k|  pe_norm = pstr_stereo_pre_pro->smoothed_pe_sum_sum * pstr_stereo_pre_pro->norm_pe_fac;
  174|       |
  175|  73.5k|  if (pe_norm > pstr_stereo_pre_pro->pe_min) {
  ------------------
  |  Branch (175:7): [True: 11.6k, False: 61.8k]
  ------------------
  176|  11.6k|    pe_impact = ((pe_norm - pstr_stereo_pre_pro->pe_min) /
  177|  11.6k|                 (pstr_stereo_pre_pro->pe_crit - pstr_stereo_pre_pro->pe_min));
  178|  11.6k|  }
  179|       |
  180|  73.5k|  pe_impact = MIN(pe_impact, pstr_stereo_pre_pro->pe_impact_max);
  ------------------
  |  |   23|  73.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 73.5k, False: 0]
  |  |  ------------------
  ------------------
  181|       |
  182|  73.5k|  att_aimed = MIN((en_impact * pe_impact * pstr_stereo_pre_pro->impact_factor),
  ------------------
  |  |   23|  73.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 73.5k, False: 0]
  |  |  ------------------
  ------------------
  183|  73.5k|                  pstr_stereo_pre_pro->stereo_attenuation_max);
  184|       |
  185|       |  /* Only accept changes if they are large enough */
  186|  73.5k|  if ((fabs(att_aimed - pstr_stereo_pre_pro->stereo_attenuation) < 1.0f) && (att_aimed != 0.0f)) {
  ------------------
  |  Branch (186:7): [True: 63.7k, False: 9.76k]
  |  Branch (186:77): [True: 7.04k, False: 56.7k]
  ------------------
  187|  7.04k|    att_aimed = pstr_stereo_pre_pro->stereo_attenuation;
  188|  7.04k|  }
  189|       |
  190|  73.5k|  att = att_aimed;
  191|       |
  192|  73.5k|  swift_factor = (6.0f + pstr_stereo_pre_pro->stereo_attenuation) / (10.0f + l_to_r) *
  193|  73.5k|                 MAX(1.0f, 0.2f * delta_nrg);
  ------------------
  |  |   24|  73.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 54.9k, False: 18.6k]
  |  |  ------------------
  ------------------
  194|       |
  195|  73.5k|  delta_l_to_r = MAX(3.0f, l_to_r - pstr_stereo_pre_pro->last_l_to_r);
  ------------------
  |  |   24|  73.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 69.5k, False: 3.99k]
  |  |  ------------------
  ------------------
  196|       |
  197|  73.5k|  max_dec = MIN((delta_l_to_r * delta_l_to_r / 9.0f * swift_factor), 5.0f);
  ------------------
  |  |   23|  73.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 67.5k, False: 5.92k]
  |  |  ------------------
  ------------------
  198|       |
  199|  73.5k|  max_dec *= pstr_stereo_pre_pro->dec_stereo_attenuation;
  200|       |
  201|  73.5k|  max_dec = MIN(max_dec, pstr_stereo_pre_pro->stereo_attenuation * 0.8f);
  ------------------
  |  |   23|  73.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 13.6k, False: 59.8k]
  |  |  ------------------
  ------------------
  202|       |
  203|  73.5k|  delta_l_to_r = MAX(3.0f, pstr_stereo_pre_pro->last_l_to_r - l_to_r);
  ------------------
  |  |   24|  73.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 70.0k, False: 3.49k]
  |  |  ------------------
  ------------------
  204|       |
  205|  73.5k|  max_inc = MIN((delta_l_to_r * delta_l_to_r / 9.0f * swift_factor), 5.0f);
  ------------------
  |  |   23|  73.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 69.2k, False: 4.23k]
  |  |  ------------------
  ------------------
  206|       |
  207|  73.5k|  max_inc *= pstr_stereo_pre_pro->inc_stereo_attenuation;
  208|       |
  209|  73.5k|  att = MIN(att, pstr_stereo_pre_pro->stereo_attenuation + max_inc);
  ------------------
  |  |   23|  73.5k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 73.5k, False: 13]
  |  |  ------------------
  ------------------
  210|       |
  211|  73.5k|  att = MAX(att, pstr_stereo_pre_pro->stereo_attenuation - max_dec);
  ------------------
  |  |   24|  73.5k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 6.58k, False: 66.9k]
  |  |  ------------------
  ------------------
  212|       |
  213|  73.5k|  pstr_stereo_pre_pro->stereo_attenuation = (pstr_stereo_pre_pro->const_attenuation == 0)
  ------------------
  |  Branch (213:45): [True: 73.5k, False: 0]
  ------------------
  214|  73.5k|                                                ? att
  215|  73.5k|                                                : pstr_stereo_pre_pro->const_attenuation;
  216|       |
  217|       |  /* Perform attenuation of side channel */
  218|  73.5k|  pstr_stereo_pre_pro->stereo_attenuation_fac =
  219|  73.5k|      (FLOAT32)pow(10.0f, 0.05f * (-pstr_stereo_pre_pro->stereo_attenuation));
  220|       |
  221|  73.5k|  l_fac = 0.5f * (1.0f + pstr_stereo_pre_pro->stereo_attenuation_fac);
  222|  73.5k|  r_fac = 0.5f * (1.0f - pstr_stereo_pre_pro->stereo_attenuation_fac);
  223|       |
  224|  58.3M|  for (i = 0; i < granule_len; i++) {
  ------------------
  |  Branch (224:15): [True: 58.2M, False: 73.5k]
  ------------------
  225|  58.2M|    L = l_fac * ptr_time_data[num_channels * i + pstr_elem_info->channel_index[0]] +
  226|  58.2M|        r_fac * ptr_time_data[num_channels * i + pstr_elem_info->channel_index[1]];
  227|  58.2M|    R = r_fac * ptr_time_data[num_channels * i + pstr_elem_info->channel_index[0]] +
  228|  58.2M|        l_fac * ptr_time_data[num_channels * i + pstr_elem_info->channel_index[1]];
  229|       |
  230|  58.2M|    ptr_time_data[num_channels * i + pstr_elem_info->channel_index[0]] = L;
  231|  58.2M|    ptr_time_data[num_channels * i + pstr_elem_info->channel_index[1]] = R;
  232|  58.2M|  }
  233|       |
  234|  73.5k|  pstr_stereo_pre_pro->last_l_to_r = l_to_r;
  235|       |
  236|  73.5k|  pstr_stereo_pre_pro->last_nrg_lr =
  237|  73.5k|      pstr_stereo_pre_pro->average_freq_energy_l + pstr_stereo_pre_pro->average_freq_energy_r;
  238|  73.5k|}
iaace_update_stereo_pre_process:
  243|   140k|                                     FLOAT32 weight_pe_fac) {
  244|   140k|  if (pstr_stereo_pre_pro->stereo_attenuation_flag) {
  ------------------
  |  Branch (244:7): [True: 73.5k, False: 67.2k]
  ------------------
  245|  73.5k|    FLOAT32 delta = 0.1f;
  246|       |
  247|  73.5k|    pstr_stereo_pre_pro->average_freq_energy_l = pstr_psy_out[0]->sfb_sum_lr_energy;
  248|  73.5k|    pstr_stereo_pre_pro->average_freq_energy_r = pstr_psy_out[1]->sfb_sum_lr_energy;
  249|  73.5k|    pstr_stereo_pre_pro->average_freq_energy_m = pstr_psy_out[0]->sfb_sum_ms_energy;
  250|  73.5k|    pstr_stereo_pre_pro->average_freq_energy_s = pstr_psy_out[1]->sfb_sum_ms_energy;
  251|       |
  252|  73.5k|    pstr_stereo_pre_pro->smoothed_pe_sum_sum =
  253|  73.5k|        delta * pstr_qc_out->pe * weight_pe_fac +
  254|  73.5k|        (1 - delta) * pstr_stereo_pre_pro->smoothed_pe_sum_sum;
  255|  73.5k|  }
  256|   140k|}

ia_enhaacplus_enc_tns_detect:
  144|  1.05M|{
  145|  1.05M|  FLOAT32 prediction_gain = 0;
  146|  1.05M|  FLOAT32 *ptr_weighted_spec = ptr_scratch_tns + sub_blk_num * long_frame_len;
  147|  1.05M|  WORD i;
  148|  1.05M|  FLOAT32 *ptr_weighted_spec_new = ptr_weighted_spec;
  149|  1.05M|  IA_ERRORCODE error_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.05M|#define IA_NO_ERROR 0x00000000
  ------------------
  150|       |
  151|  1.05M|  if (tns_config.tns_active) {
  ------------------
  |  Branch (151:7): [True: 775k, False: 282k]
  ------------------
  152|   775k|    ia_enhaacplus_enc_calc_weighted_spectrum(ptr_spectrum, ptr_weighted_spec, ptr_sfb_energy,
  153|   775k|                                             ptr_sfb_offset, tns_config.lpc_start_line,
  154|   775k|                                             tns_config.lpc_stop_line, tns_config.lpc_start_band,
  155|   775k|                                             tns_config.lpc_stop_band, ptr_shared_buffer1, aot);
  156|       |
  157|  10.0M|    for (i = tns_config.lpc_stop_line; i < (tns_config.lpc_stop_line + 12); i++) {
  ------------------
  |  Branch (157:40): [True: 9.30M, False: 775k]
  ------------------
  158|  9.30M|      ptr_weighted_spec_new[i] = 0;
  159|  9.30M|    }
  160|       |
  161|   775k|    if (block_type != SHORT_WINDOW) {
  ------------------
  |  Branch (161:9): [True: 247k, False: 527k]
  ------------------
  162|   247k|      error_code = ia_enhaacplus_enc_calc_tns_filter(
  163|   247k|          &ptr_weighted_spec_new[tns_config.lpc_start_line], tns_config.acf_window_float,
  164|   247k|          tns_config.lpc_stop_line - tns_config.lpc_start_line, tns_config.max_order,
  165|   247k|          pstr_tns_data->data_raw.tns_data_long.sub_block_info.parcor, &prediction_gain);
  166|       |
  167|   247k|      if (error_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   247k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (167:11): [True: 0, False: 247k]
  ------------------
  168|      0|        return error_code;
  169|      0|      }
  170|   247k|      pstr_tns_data->data_raw.tns_data_long.sub_block_info.tns_active =
  171|   247k|          ((prediction_gain) > tns_config.threshold) ? 1 : 0;
  ------------------
  |  Branch (171:11): [True: 176k, False: 71.2k]
  ------------------
  172|       |
  173|   247k|      pstr_tns_data->data_raw.tns_data_long.sub_block_info.prediction_gain = prediction_gain;
  174|   527k|    } else {
  175|   527k|      error_code = ia_enhaacplus_enc_calc_tns_filter(
  176|   527k|          &ptr_weighted_spec_new[tns_config.lpc_start_line], tns_config.acf_window_float,
  177|   527k|          tns_config.lpc_stop_line - tns_config.lpc_start_line, tns_config.max_order,
  178|   527k|          pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].parcor,
  179|   527k|          &prediction_gain);
  180|       |
  181|   527k|      if (error_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   527k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (181:11): [True: 0, False: 527k]
  ------------------
  182|      0|        return error_code;
  183|      0|      }
  184|       |
  185|   527k|      pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].tns_active =
  186|   527k|          ((prediction_gain) > tns_config.threshold) ? 1 : 0;
  ------------------
  |  Branch (186:11): [True: 169k, False: 357k]
  ------------------
  187|       |
  188|   527k|      pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].prediction_gain =
  189|   527k|          prediction_gain;
  190|   527k|    }
  191|   775k|  } else {
  192|   282k|    if (block_type != SHORT_WINDOW) {
  ------------------
  |  Branch (192:9): [True: 114k, False: 167k]
  ------------------
  193|   114k|      pstr_tns_data->data_raw.tns_data_long.sub_block_info.tns_active = 0;
  194|   114k|      pstr_tns_data->data_raw.tns_data_long.sub_block_info.prediction_gain = 0.f;
  195|   167k|    } else {
  196|   167k|      pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].tns_active = 0;
  197|   167k|      pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].prediction_gain = 0.f;
  198|   167k|    }
  199|   282k|  }
  200|  1.05M|  return error_code;
  201|  1.05M|}
ia_enhaacplus_enc_tns_sync:
  206|   391k|                                const WORD32 sub_blk_num, const WORD32 block_type) {
  207|   391k|  if (block_type != SHORT_WINDOW) {
  ------------------
  |  Branch (207:7): [True: 104k, False: 286k]
  ------------------
  208|   104k|    ixheaace_temporal_noise_shaping_subblock_info_long *pstr_sfb_info_dst;
  209|   104k|    const ixheaace_temporal_noise_shaping_subblock_info_long *pstr_sfb_info_src;
  210|       |
  211|   104k|    pstr_sfb_info_dst = &pstr_tns_data_dst->data_raw.tns_data_long.sub_block_info;
  212|   104k|    pstr_sfb_info_src = &pstr_tns_data_src->data_raw.tns_data_long.sub_block_info;
  213|   104k|    FLOAT32 tmp_var = pstr_sfb_info_dst->prediction_gain;
  214|   104k|    if (fabs(tmp_var - pstr_sfb_info_src->prediction_gain) < (tmp_var * 0.03f)) {
  ------------------
  |  Branch (214:9): [True: 44.5k, False: 60.4k]
  ------------------
  215|  44.5k|      pstr_sfb_info_dst->tns_active = pstr_sfb_info_src->tns_active;
  216|       |
  217|  44.5k|      memcpy(pstr_sfb_info_dst->parcor, pstr_sfb_info_src->parcor,
  218|  44.5k|             tns_config.max_order * sizeof(pstr_sfb_info_dst->parcor[0]));
  219|  44.5k|    }
  220|   286k|  } else {
  221|   286k|    ixheaace_temporal_noise_shaping_subblock_info_short *pstr_sfb_info_dst;
  222|   286k|    const ixheaace_temporal_noise_shaping_subblock_info_short *pstr_sfb_info_src;
  223|   286k|    pstr_sfb_info_dst = &pstr_tns_data_dst->data_raw.tns_data_short.sub_block_info[sub_blk_num];
  224|   286k|    pstr_sfb_info_src = &pstr_tns_data_src->data_raw.tns_data_short.sub_block_info[sub_blk_num];
  225|       |
  226|   286k|    FLOAT32 tmp_var = pstr_sfb_info_dst->prediction_gain;
  227|   286k|    if (fabs(tmp_var - pstr_sfb_info_src->prediction_gain) < (tmp_var * 0.03f)) {
  ------------------
  |  Branch (227:9): [True: 143k, False: 143k]
  ------------------
  228|   143k|      pstr_sfb_info_dst->tns_active = pstr_sfb_info_src->tns_active;
  229|       |
  230|   143k|      memcpy(pstr_sfb_info_dst->parcor, pstr_sfb_info_src->parcor,
  231|   143k|             tns_config.max_order * sizeof(pstr_sfb_info_dst->parcor[0]));
  232|   143k|    }
  233|   286k|  }
  234|   391k|}
ia_enhaacplus_enc_tns_encode:
  300|  1.05M|                                    ixheaace_temporal_noise_shaping_tables *pstr_tns_tab) {
  301|  1.05M|  WORD32 i;
  302|  1.05M|  FLOAT32 *ptr_parcor;
  303|       |
  304|  1.05M|  if (block_type != SHORT_WINDOW) {
  ------------------
  |  Branch (304:7): [True: 362k, False: 695k]
  ------------------
  305|   362k|    if (pstr_tns_data->data_raw.tns_data_long.sub_block_info.tns_active == 0) {
  ------------------
  |  Branch (305:9): [True: 185k, False: 176k]
  ------------------
  306|   185k|      pstr_tns_info->tns_active[sub_blk_num] = 0;
  307|   185k|      return;
  308|   185k|    } else {
  309|   176k|      ia_enhaacplus_enc_parcor_to_index(
  310|   176k|          pstr_tns_data->data_raw.tns_data_long.sub_block_info.parcor, &pstr_tns_info->coef[0],
  311|   176k|          tns_config.max_order, tns_config.coef_res, pstr_tns_tab);
  312|       |
  313|   176k|      ia_enhaacplus_enc_index_to_parcor(
  314|   176k|          &pstr_tns_info->coef[0], pstr_tns_data->data_raw.tns_data_long.sub_block_info.parcor,
  315|   176k|          tns_config.max_order, tns_config.coef_res, pstr_tns_tab);
  316|       |
  317|   176k|      ptr_parcor =
  318|   176k|          &pstr_tns_data->data_raw.tns_data_long.sub_block_info.parcor[tns_config.max_order - 1];
  319|       |
  320|   805k|      for (i = tns_config.max_order - 1; i >= 0; i--) {
  ------------------
  |  Branch (320:42): [True: 805k, False: 0]
  ------------------
  321|   805k|        FLOAT32 tmp_var = *ptr_parcor--;
  322|       |
  323|   805k|        if (tmp_var > 0.1f || tmp_var < -0.1f) {
  ------------------
  |  Branch (323:13): [True: 76.8k, False: 728k]
  |  Branch (323:31): [True: 99.4k, False: 628k]
  ------------------
  324|   176k|          break;
  325|   176k|        }
  326|   805k|      }
  327|   176k|      pstr_tns_info->order[sub_blk_num] = i + 1;
  328|       |
  329|   176k|      pstr_tns_info->tns_active[sub_blk_num] = 1;
  330|       |
  331|  1.41M|      for (i = sub_blk_num + 1; i < TRANS_FAC; i++) {
  ------------------
  |  |   29|  1.41M|#define TRANS_FAC 8
  ------------------
  |  Branch (331:33): [True: 1.23M, False: 176k]
  ------------------
  332|  1.23M|        pstr_tns_info->tns_active[i] = 0;
  333|  1.23M|      }
  334|       |
  335|   176k|      pstr_tns_info->coef_res[sub_blk_num] = (WORD8)tns_config.coef_res;
  336|       |
  337|   176k|      pstr_tns_info->length[sub_blk_num] = num_sfb - tns_config.tns_start_band;
  338|       |
  339|   176k|      ia_enhaacplus_enc_analysis_filter_lattice(
  340|   176k|          &(ptr_spectrum[tns_config.tns_start_line]),
  341|   176k|          MIN(tns_config.tns_stop_line, lowpass_line) - tns_config.tns_start_line,
  ------------------
  |  |   23|   176k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 26.7k, False: 149k]
  |  |  ------------------
  ------------------
  342|   176k|          pstr_tns_data->data_raw.tns_data_long.sub_block_info.parcor,
  343|   176k|          pstr_tns_info->order[sub_blk_num], &(ptr_spectrum[tns_config.tns_start_line]));
  344|   176k|    }
  345|   362k|  } else /*short block*/
  346|   695k|  {
  347|   695k|    if (pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].tns_active == 0) {
  ------------------
  |  Branch (347:9): [True: 525k, False: 169k]
  ------------------
  348|   525k|      pstr_tns_info->tns_active[sub_blk_num] = 0;
  349|       |
  350|   525k|      return;
  351|   525k|    } else {
  352|   169k|      ia_enhaacplus_enc_parcor_to_index(
  353|   169k|          pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].parcor,
  354|   169k|          &pstr_tns_info->coef[sub_blk_num * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT],
  ------------------
  |  |   23|   169k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  355|   169k|          tns_config.max_order, tns_config.coef_res, pstr_tns_tab);
  356|       |
  357|   169k|      ia_enhaacplus_enc_index_to_parcor(
  358|   169k|          &pstr_tns_info->coef[sub_blk_num * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT],
  ------------------
  |  |   23|   169k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  359|   169k|          pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].parcor,
  360|   169k|          tns_config.max_order, tns_config.coef_res, pstr_tns_tab);
  361|       |
  362|   169k|      ptr_parcor = &pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num]
  363|   169k|                        .parcor[tns_config.max_order - 1];
  364|   569k|      for (i = tns_config.max_order - 1; i >= 0; i--) {
  ------------------
  |  Branch (364:42): [True: 569k, False: 107]
  ------------------
  365|   569k|        FLOAT32 tmp_var = *ptr_parcor--;
  366|   569k|        if (tmp_var > 0.1f || tmp_var < -0.1f) {
  ------------------
  |  Branch (366:13): [True: 112k, False: 456k]
  |  Branch (366:31): [True: 56.8k, False: 399k]
  ------------------
  367|   169k|          break;
  368|   169k|        }
  369|   569k|      }
  370|       |
  371|   169k|      pstr_tns_info->order[sub_blk_num] = i + 1;
  372|       |
  373|   169k|      pstr_tns_info->tns_active[sub_blk_num] = 1;
  374|       |
  375|   169k|      pstr_tns_info->coef_res[sub_blk_num] = (WORD8)tns_config.coef_res;
  376|       |
  377|   169k|      pstr_tns_info->length[sub_blk_num] = num_sfb - tns_config.tns_start_band;
  378|       |
  379|   169k|      ia_enhaacplus_enc_analysis_filter_lattice(
  380|   169k|          &(ptr_spectrum[tns_config.tns_start_line]),
  381|   169k|          tns_config.tns_stop_line - tns_config.tns_start_line,
  382|   169k|          pstr_tns_data->data_raw.tns_data_short.sub_block_info[sub_blk_num].parcor,
  383|   169k|          pstr_tns_info->order[sub_blk_num], &(ptr_spectrum[tns_config.tns_start_line]));
  384|   169k|    }
  385|   695k|  }
  386|       |
  387|   346k|  return;
  388|  1.05M|}
ia_enhaacplus_enc_apply_tns_mult_table_to_ratios:
  391|   346k|                                                      FLOAT32 *ptr_thresholds) {
  392|   346k|  WORD32 i;
  393|       |
  394|  3.08M|  for (i = start_cb; i < stop_cb; i++) {
  ------------------
  |  Branch (394:22): [True: 2.73M, False: 346k]
  ------------------
  395|  2.73M|    ptr_thresholds[i] = (FLOAT32)(ptr_thresholds[i] * 0.25f);
  396|  2.73M|  }
  397|   346k|}
ixheaace_tns.c:ia_enhaacplus_enc_calc_tns_filter:
  112|   775k|                                                      FLOAT32 *prediction_gain) {
  113|   775k|  FLOAT32 auto_corr_buf[TEMPORAL_NOISE_SHAPING_MAX_ORDER + 1];
  114|   775k|  FLOAT32 par_cor_buf[2 * TEMPORAL_NOISE_SHAPING_MAX_ORDER];
  115|   775k|  WORD32 i;
  116|       |
  117|   775k|  if (tns_order > TEMPORAL_NOISE_SHAPING_MAX_ORDER) {
  ------------------
  |  |   22|   775k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER (12)
  ------------------
  |  Branch (117:7): [True: 0, False: 775k]
  ------------------
  118|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_TNS_FILT_ORDER;
  119|      0|  }
  120|       |
  121|   775k|  memset(&auto_corr_buf[0], 0, (tns_order + 1) * sizeof(auto_corr_buf[0]));
  122|       |
  123|   775k|  ia_enhaacplus_enc_auto_correlation(ptr_signal, auto_corr_buf, num_lines, tns_order + 1);
  124|       |
  125|   775k|  if (ptr_window) {
  ------------------
  |  Branch (125:7): [True: 775k, False: 0]
  ------------------
  126|  7.15M|    for (i = 0; i < tns_order + 1; i++) {
  ------------------
  |  Branch (126:17): [True: 6.38M, False: 775k]
  ------------------
  127|  6.38M|      auto_corr_buf[i] = (auto_corr_buf[i] * ptr_window[i]);
  128|  6.38M|    }
  129|   775k|  }
  130|       |
  131|   775k|  ia_enhaacplus_enc_auto_to_parcor(auto_corr_buf, ptr_parcor, tns_order, par_cor_buf,
  132|   775k|                                   prediction_gain);
  133|       |
  134|   775k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   775k|#define IA_NO_ERROR 0x00000000
  ------------------
  135|   775k|}
ixheaace_tns.c:ia_enhaacplus_enc_auto_to_parcor:
   47|   775k|                                             FLOAT32 *prediction_gain) {
   48|   775k|  WORD32 i, j;
   49|   775k|  FLOAT32 *ptr_work_buf_tmp, tmp_var;
   50|       |
   51|   775k|  memset(ptr_refl_coeff, 0, num_coeff * sizeof(*ptr_refl_coeff));
   52|       |
   53|   775k|  if (ptr_input[0] == 0) {
  ------------------
  |  Branch (53:7): [True: 72.7k, False: 702k]
  ------------------
   54|  72.7k|    return;
   55|  72.7k|  }
   56|       |
   57|   702k|  ptr_work_buffer[0] = ptr_input[0];
   58|  4.91M|  for (i = 1; i < num_coeff; i++) {
  ------------------
  |  Branch (58:15): [True: 4.20M, False: 702k]
  ------------------
   59|  4.20M|    tmp_var = ptr_input[i];
   60|  4.20M|    ptr_work_buffer[i] = tmp_var;
   61|  4.20M|    ptr_work_buffer[i + num_coeff - 1] = tmp_var;
   62|  4.20M|  }
   63|   702k|  ptr_work_buffer[i + num_coeff - 1] = ptr_input[i];
   64|       |
   65|  5.61M|  for (i = 0; i < num_coeff; i++) {
  ------------------
  |  Branch (65:15): [True: 4.91M, False: 702k]
  ------------------
   66|  4.91M|    FLOAT32 refc, tmp;
   67|       |
   68|  4.91M|    tmp = ptr_work_buffer[num_coeff + i];
   69|       |
   70|  4.91M|    if (tmp < 0.f) {
  ------------------
  |  Branch (70:9): [True: 2.62M, False: 2.28M]
  ------------------
   71|  2.62M|      tmp = -tmp;
   72|  2.62M|    }
   73|       |
   74|  4.91M|    if ((ptr_work_buffer[0]) < tmp) {
  ------------------
  |  Branch (74:9): [True: 0, False: 4.91M]
  ------------------
   75|      0|      break;
   76|      0|    }
   77|       |
   78|  4.91M|    if (ptr_work_buffer[0] == 0.f) {
  ------------------
  |  Branch (78:9): [True: 0, False: 4.91M]
  ------------------
   79|      0|      refc = 0;
   80|  4.91M|    } else {
   81|  4.91M|      refc = (tmp / ptr_work_buffer[0]);
   82|  4.91M|    }
   83|       |
   84|  4.91M|    if (ptr_work_buffer[num_coeff + i] > 0.f) {
  ------------------
  |  Branch (84:9): [True: 2.21M, False: 2.69M]
  ------------------
   85|  2.21M|      refc = -refc;
   86|  2.21M|    }
   87|       |
   88|  4.91M|    ptr_refl_coeff[i] = refc;
   89|       |
   90|  4.91M|    ptr_work_buf_tmp = &(ptr_work_buffer[num_coeff]);
   91|       |
   92|  28.0M|    for (j = i; j < num_coeff; j++) {
  ------------------
  |  Branch (92:17): [True: 23.1M, False: 4.91M]
  ------------------
   93|  23.1M|      FLOAT32 accu1, accu2;
   94|       |
   95|  23.1M|      accu1 = (refc * ptr_work_buffer[j - i]);
   96|  23.1M|      accu1 = (accu1) + ptr_work_buf_tmp[j];
   97|       |
   98|  23.1M|      accu2 = (refc * ptr_work_buf_tmp[j]);
   99|  23.1M|      accu2 = accu2 + ptr_work_buffer[j - i];
  100|       |
  101|  23.1M|      ptr_work_buf_tmp[j] = accu1;
  102|  23.1M|      ptr_work_buffer[j - i] = accu2;
  103|  23.1M|    }
  104|  4.91M|  }
  105|       |
  106|   702k|  *prediction_gain = (ptr_input[0] / ptr_work_buffer[0]);
  107|   702k|}
ixheaace_tns.c:ia_enhaacplus_enc_parcor_to_index:
  264|   346k|    ixheaace_temporal_noise_shaping_tables *pstr_tns_tab) {
  265|   346k|  WORD32 i;
  266|       |
  267|   346k|  if (bits_per_coeff == 3) {
  ------------------
  |  Branch (267:7): [True: 169k, False: 176k]
  ------------------
  268|  1.01M|    for (i = order - 1; i >= 0; i--) {
  ------------------
  |  Branch (268:25): [True: 848k, False: 169k]
  ------------------
  269|   848k|      ptr_index[i] = ia_enhaacplus_enc_index_search3(ptr_parcor[i], pstr_tns_tab);
  270|   848k|    }
  271|   176k|  } else {
  272|  2.29M|    for (i = order - 1; i >= 0; i--) {
  ------------------
  |  Branch (272:25): [True: 2.11M, False: 176k]
  ------------------
  273|  2.11M|      ptr_index[i] = ia_enhaacplus_enc_index_search4(ptr_parcor[i], pstr_tns_tab);
  274|  2.11M|    }
  275|   176k|  }
  276|   346k|}
ixheaace_tns.c:ia_enhaacplus_enc_index_search3:
  237|   848k|    FLOAT32 parcor, ixheaace_temporal_noise_shaping_tables *pstr_tns_tab) {
  238|   848k|  WORD32 index = 0;
  239|   848k|  WORD32 i;
  240|       |
  241|  7.63M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (241:15): [True: 6.79M, False: 848k]
  ------------------
  242|  6.79M|    if (parcor > pstr_tns_tab->tns_coeff_3_borders[i]) {
  ------------------
  |  Branch (242:9): [True: 4.34M, False: 2.44M]
  ------------------
  243|  4.34M|      index = i;
  244|  4.34M|    }
  245|  6.79M|  }
  246|       |
  247|   848k|  return (index - 4);
  248|   848k|}
ixheaace_tns.c:ia_enhaacplus_enc_index_search4:
  250|  2.11M|    FLOAT32 parcor, ixheaace_temporal_noise_shaping_tables *pstr_tns_tab) {
  251|  2.11M|  WORD32 index = 0;
  252|  2.11M|  WORD32 i;
  253|  35.9M|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (253:15): [True: 33.8M, False: 2.11M]
  ------------------
  254|  33.8M|    if (parcor > pstr_tns_tab->tns_coeff_4_borders[i]) {
  ------------------
  |  Branch (254:9): [True: 19.8M, False: 13.9M]
  ------------------
  255|  19.8M|      index = i;
  256|  19.8M|    }
  257|  33.8M|  }
  258|       |
  259|  2.11M|  return (index - 8);
  260|  2.11M|}
ixheaace_tns.c:ia_enhaacplus_enc_index_to_parcor:
  280|   346k|    ixheaace_temporal_noise_shaping_tables *pstr_tns_tab) {
  281|   346k|  WORD32 i;
  282|       |
  283|   346k|  if (bits_per_coeff == 4) {
  ------------------
  |  Branch (283:7): [True: 176k, False: 169k]
  ------------------
  284|  2.29M|    for (i = order - 1; i >= 0; i--) {
  ------------------
  |  Branch (284:25): [True: 2.11M, False: 176k]
  ------------------
  285|  2.11M|      ptr_parcor[i] = pstr_tns_tab->tns_coeff_4[ptr_index[i] + 8];
  286|  2.11M|    }
  287|   176k|  } else {
  288|  1.01M|    for (i = order - 1; i >= 0; i--) {
  ------------------
  |  Branch (288:25): [True: 848k, False: 169k]
  ------------------
  289|   848k|      ptr_parcor[i] = pstr_tns_tab->tns_coeff_3[ptr_index[i] + 4];
  290|   848k|    }
  291|   169k|  }
  292|   346k|}

ia_enhaacplus_enc_calc_weighted_spectrum:
   49|   775k|                                              WORD32 aot) {
   50|   775k|  WORD32 i, sfb, tempcnt;
   51|   775k|  FLOAT32 tmp;
   52|   775k|  FLOAT32 *ptr_tns_sfb_mean = ptr_shared_buffer1;
   53|   775k|  FLOAT32 temp1, temp2;
   54|   775k|  FLOAT32 *ptr_spec;
   55|   775k|  FLOAT32 *ptr_ws1;
   56|   775k|  WORD sfb_width, j;
   57|       |
   58|  4.90M|  for (sfb = lpc_start_band; sfb < lpc_stop_band; sfb++) {
  ------------------
  |  Branch (58:30): [True: 4.12M, False: 775k]
  ------------------
   59|  4.12M|    FLOAT32 sfb_nrg_tmp = ptr_sfb_energy[sfb];
   60|  4.12M|    ptr_tns_sfb_mean[sfb] = 1 / ((FLOAT32)sqrt(sfb_nrg_tmp) + 1e-30f);
   61|  4.12M|  }
   62|       |
   63|   775k|  sfb = lpc_start_band;
   64|       |
   65|   775k|  tmp = ptr_tns_sfb_mean[sfb];
   66|       |
   67|  4.90M|  for (i = lpc_start_line; i < lpc_stop_line; i += sfb_width) {
  ------------------
  |  Branch (67:28): [True: 4.12M, False: 775k]
  ------------------
   68|  4.12M|    ptr_spec = &ptr_weighted_spec[i];
   69|  4.12M|    WORD start = i, stop = ptr_sfb_offset[sfb + 1];
   70|       |
   71|  4.12M|    stop = MIN(stop, lpc_stop_line);
  ------------------
  |  |   23|  4.12M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3.35M, False: 766k]
  |  |  ------------------
  ------------------
   72|  4.12M|    sfb_width = stop - start;
   73|       |
   74|  45.7M|    for (j = (sfb_width >> 1) - 1; j >= 0; j--) {
  ------------------
  |  Branch (74:36): [True: 41.6M, False: 4.12M]
  ------------------
   75|  41.6M|      *ptr_spec++ = tmp;
   76|  41.6M|      *ptr_spec++ = tmp;
   77|  41.6M|    }
   78|  4.12M|    sfb++;
   79|       |
   80|  4.12M|    if ((sfb + 1) < lpc_stop_band) {
  ------------------
  |  Branch (80:9): [True: 2.72M, False: 1.40M]
  ------------------
   81|  2.72M|      tmp = ptr_tns_sfb_mean[sfb];
   82|  2.72M|    }
   83|  4.12M|  }
   84|       |
   85|       |  /* Filter down */
   86|   775k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   34|  1.55M|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   35|  1.33M|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   39|   958k|#define AOT_PS (29)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   100k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (86:7): [True: 218k, False: 556k]
  |  Branch (86:28): [True: 372k, False: 183k]
  |  Branch (86:46): [True: 83.2k, False: 100k]
  |  Branch (86:63): [True: 76.3k, False: 24.2k]
  ------------------
   87|  82.0M|    for (i = lpc_stop_line - 2; i >= lpc_start_line; i--) {
  ------------------
  |  Branch (87:33): [True: 81.3M, False: 750k]
  ------------------
   88|  81.3M|      ptr_weighted_spec[i] = (ptr_weighted_spec[i] + ptr_weighted_spec[i + 1]) * 0.5f;
   89|  81.3M|    }
   90|  82.0M|    for (i = lpc_start_line + 1; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (90:34): [True: 81.3M, False: 750k]
  ------------------
   91|  81.3M|      ptr_weighted_spec[i] = (ptr_weighted_spec[i] + ptr_weighted_spec[i - 1]) * 0.5f;
   92|  81.3M|    }
   93|       |
   94|       |    /* Weight and normalize */
   95|  82.8M|    for (i = lpc_start_line; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (95:30): [True: 82.0M, False: 750k]
  ------------------
   96|  82.0M|      ptr_weighted_spec[i] = ptr_weighted_spec[i] * ptr_spectrum[i];
   97|  82.0M|    }
   98|   750k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  48.4k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|      0|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (98:14): [True: 24.2k, False: 0]
  |  Branch (98:35): [True: 0, False: 0]
  ------------------
   99|  24.2k|    WORD32 remaining;
  100|  24.2k|    FLOAT32 multout_temp;
  101|       |
  102|  24.2k|    ptr_ws1 = &ptr_weighted_spec[lpc_stop_line - 1];
  103|  24.2k|    tempcnt = (lpc_stop_line - lpc_start_line) >> 2;
  104|  24.2k|    remaining = lpc_stop_line - lpc_start_line - (tempcnt << 2);
  105|       |
  106|  24.2k|    temp1 = *ptr_ws1--;
  107|  24.2k|    temp2 = (*ptr_ws1 + temp1);
  108|   314k|    for (i = tempcnt - 1; i >= 0; i--) {
  ------------------
  |  Branch (108:27): [True: 290k, False: 24.2k]
  ------------------
  109|   290k|      *ptr_ws1-- = temp2;
  110|   290k|      temp1 = (*ptr_ws1 + temp2 * 0.5f);
  111|   290k|      *ptr_ws1-- = temp1;
  112|   290k|      temp2 = (*ptr_ws1 + temp1 * 0.5f);
  113|   290k|      *ptr_ws1-- = temp2;
  114|   290k|      temp1 = (*ptr_ws1 + temp2 * 0.5f);
  115|   290k|      *ptr_ws1-- = temp1;
  116|   290k|      temp2 = (*ptr_ws1 + temp1 * 0.5f);
  117|   290k|    }
  118|  24.2k|    ptr_ws1++;
  119|  24.2k|    if (remaining) {
  ------------------
  |  Branch (119:9): [True: 0, False: 24.2k]
  ------------------
  120|      0|      for (i = remaining - 1; i >= 0; i--) {
  ------------------
  |  Branch (120:31): [True: 0, False: 0]
  ------------------
  121|      0|        temp1 = *ptr_ws1--;
  122|      0|        *ptr_ws1 = (*ptr_ws1 + temp1 * 0.5f);
  123|      0|      }
  124|      0|    }
  125|       |
  126|  24.2k|    ptr_weighted_spec[lpc_start_line + 1] = (FLOAT32)(
  127|  24.2k|        ((ptr_weighted_spec[lpc_start_line + 1]) + (ptr_weighted_spec[lpc_start_line])) * 0.5f);
  128|  24.2k|    multout_temp = (ptr_weighted_spec[lpc_start_line] * ptr_spectrum[lpc_start_line]);
  129|  24.2k|    ptr_weighted_spec[lpc_start_line] = multout_temp;
  130|       |
  131|       |    /* Weight and normalize */
  132|  24.2k|    ptr_spec = &ptr_spectrum[lpc_start_line + 1];
  133|  24.2k|    ptr_ws1 = &ptr_weighted_spec[lpc_start_line + 1];
  134|       |
  135|  24.2k|    tempcnt = (lpc_stop_line - lpc_start_line - 2) >> 2;
  136|  24.2k|    remaining = (lpc_stop_line - lpc_start_line - 2) - (tempcnt << 2);
  137|  24.2k|    temp2 = *ptr_ws1;
  138|       |
  139|   291k|    for (i = tempcnt - 1; i >= 0; i--) {
  ------------------
  |  Branch (139:27): [True: 267k, False: 24.2k]
  ------------------
  140|   267k|      temp1 = *(ptr_ws1 + 1);
  141|   267k|      temp1 = (FLOAT32)((temp1 + temp2) * 0.5f);
  142|   267k|      multout_temp = (temp2 * *ptr_spec++);
  143|   267k|      *ptr_ws1++ = multout_temp;
  144|       |
  145|   267k|      temp2 = *(ptr_ws1 + 1);
  146|   267k|      temp2 = (FLOAT32)((temp2 + temp1) * 0.5f);
  147|   267k|      multout_temp = (temp1 * *ptr_spec++);
  148|   267k|      *ptr_ws1++ = multout_temp;
  149|       |
  150|   267k|      temp1 = *(ptr_ws1 + 1);
  151|   267k|      temp1 = (FLOAT32)((temp2 + temp1) * 0.5f);
  152|   267k|      multout_temp = (temp2 * *ptr_spec++);
  153|   267k|      *ptr_ws1++ = multout_temp;
  154|       |
  155|   267k|      temp2 = *(ptr_ws1 + 1);
  156|   267k|      temp2 = (FLOAT32)((temp2 + temp1) * 0.5f);
  157|   267k|      multout_temp = (temp1 * *ptr_spec++);
  158|   267k|      *ptr_ws1++ = multout_temp;
  159|   267k|    }
  160|       |
  161|  24.2k|    if (remaining) {
  ------------------
  |  Branch (161:9): [True: 24.2k, False: 0]
  ------------------
  162|  72.6k|      for (i = remaining - 1; i >= 0; i--) {
  ------------------
  |  Branch (162:31): [True: 48.4k, False: 24.2k]
  ------------------
  163|  48.4k|        temp1 = *(ptr_ws1 + 1);
  164|       |
  165|  48.4k|        multout_temp = (temp2 * *ptr_spec++);
  166|  48.4k|        *ptr_ws1++ = multout_temp;
  167|  48.4k|        temp2 = (FLOAT32)((temp1 + temp2) * 0.5f);
  168|  48.4k|      }
  169|  24.2k|    }
  170|       |
  171|  24.2k|    multout_temp = (temp2 + ptr_spectrum[lpc_stop_line - 1]);
  172|       |
  173|  24.2k|    ptr_weighted_spec[lpc_stop_line - 1] = multout_temp;
  174|  24.2k|  }
  175|   775k|}
ia_enhaacplus_enc_auto_correlation:
  178|   775k|                                        WORD32 samples, WORD32 corr_coeff) {
  179|   775k|  WORD32 i, j;
  180|   775k|  FLOAT32 tmp_var;
  181|   775k|  WORD32 remaining;
  182|   775k|  remaining = corr_coeff - ((corr_coeff >> 1) << 1);
  183|       |
  184|  42.3M|  for (i = 0; i < samples; i += 2) {
  ------------------
  |  Branch (184:15): [True: 41.6M, False: 775k]
  ------------------
  185|  41.6M|    const FLOAT32 *ptr_input1 = &ptr_input[i];
  186|  41.6M|    FLOAT32 temp1 = *ptr_input1;
  187|  41.6M|    FLOAT32 temp2 = *(ptr_input1 + 1);
  188|  41.6M|    FLOAT32 inp_tmp1 = *ptr_input1++;
  189|   264M|    for (j = 0; j < (corr_coeff >> 1) << 1; j++) {
  ------------------
  |  Branch (189:17): [True: 222M, False: 41.6M]
  ------------------
  190|   222M|      FLOAT32 inp_tmp2;
  191|   222M|      tmp_var = (temp1 * inp_tmp1);
  192|   222M|      inp_tmp2 = *ptr_input1++;
  193|   222M|      tmp_var += (temp2 * inp_tmp2);
  194|   222M|      ptr_corr[j] += tmp_var;
  195|   222M|      j++;
  196|   222M|      tmp_var = (temp1 * inp_tmp2);
  197|   222M|      inp_tmp1 = *ptr_input1++;
  198|   222M|      tmp_var += (temp2 * inp_tmp1);
  199|   222M|      ptr_corr[j] += (tmp_var);
  200|   222M|    }
  201|  41.6M|    if (remaining) {
  ------------------
  |  Branch (201:9): [True: 32.6M, False: 8.91M]
  ------------------
  202|  32.6M|      tmp_var = (temp1 * inp_tmp1);
  203|  32.6M|      tmp_var += (temp2 * *ptr_input1);
  204|  32.6M|      ptr_corr[j] += (tmp_var);
  205|  32.6M|    }
  206|  41.6M|  }
  207|   775k|}
ia_enhaacplus_enc_analysis_filter_lattice:
  211|   346k|                                               FLOAT32 *ptr_output) {
  212|   346k|  FLOAT32 state_par[TEMPORAL_NOISE_SHAPING_MAX_ORDER] = {0};
  213|   346k|  WORD32 j;
  214|       |
  215|   346k|  if (order <= 0) {
  ------------------
  |  Branch (215:7): [True: 107, False: 345k]
  ------------------
  216|    107|    return;
  217|    107|  }
  218|       |
  219|  68.1M|  for (j = 0; j < num_lines; j++) {
  ------------------
  |  Branch (219:15): [True: 67.8M, False: 345k]
  ------------------
  220|  67.8M|    WORD32 i;
  221|  67.8M|    FLOAT32 x = ptr_signal[j];
  222|  67.8M|    FLOAT32 accu, tmp, tmp_save;
  223|       |
  224|  67.8M|    tmp_save = x;
  225|  67.8M|    accu = x;
  226|       |
  227|   505M|    for (i = 0; i < order - 1; i++) {
  ------------------
  |  Branch (227:17): [True: 437M, False: 67.8M]
  ------------------
  228|   437M|      tmp = (accu * ptr_par_coeff[i]);
  229|       |
  230|   437M|      tmp += state_par[i];
  231|       |
  232|   437M|      accu += (state_par[i] * ptr_par_coeff[i]);
  233|       |
  234|   437M|      state_par[i] = tmp_save;
  235|   437M|      tmp_save = tmp;
  236|   437M|    }
  237|       |
  238|       |    /* last stage: only need half operations */
  239|  67.8M|    accu += (state_par[order - 1] * ptr_par_coeff[order - 1]);
  240|       |
  241|  67.8M|    state_par[order - 1] = tmp_save;
  242|       |
  243|  67.8M|    ptr_output[j] = accu;
  244|  67.8M|  }
  245|   345k|}

ia_enhaacplus_enc_init_tns_configuration:
   99|  4.74k|{
  100|  4.74k|  IA_ERRORCODE error;
  101|  4.74k|  pstr_tns_config->max_order = TEMPORAL_NOISE_SHAPING_MAX_ORDER;
  ------------------
  |  |   22|  4.74k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER (12)
  ------------------
  102|  4.74k|  pstr_tns_config->tns_start_freq = TEMPORAL_NOISE_SHAPING_START_FREQ;
  ------------------
  |  |   24|  4.74k|#define TEMPORAL_NOISE_SHAPING_START_FREQ (1275)
  ------------------
  103|  4.74k|  pstr_tns_config->coef_res = TEMPORAL_NOISE_SHAPING_COEF_RES;
  ------------------
  |  |   26|  4.74k|#define TEMPORAL_NOISE_SHAPING_COEF_RES (4)
  ------------------
  104|       |
  105|  4.74k|  error = ia_enhaacplus_enc_get_tns_param(&pstr_tns_config->conf_tab, bit_rate / channels,
  106|  4.74k|                                          channels, LONG_WINDOW, pstr_tns_tab->tns_info_tab,
  107|  4.74k|                                          sizeof(pstr_tns_tab->tns_info_tab));
  108|       |
  109|  4.74k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (109:7): [True: 0, False: 4.74k]
  ------------------
  110|      0|    return error;
  111|      0|  }
  112|       |
  113|  4.74k|  ia_enhaacplus_enc_calc_gauss_window(pstr_tns_config->acf_window_float,
  114|  4.74k|                                      (const WORD16)(pstr_tns_config->max_order + 1), sample_rate,
  115|  4.74k|                                      LONG_WINDOW, pstr_tns_config->conf_tab.tns_time_resolution
  116|       |
  117|  4.74k|  );
  118|       |
  119|  4.74k|  ia_enhaacplus_enc_get_tns_max_bands(
  120|  4.74k|      sample_rate, LONG_WINDOW, &pstr_tns_config->tns_max_sfb, pstr_tns_tab->tns_max_bands_table,
  121|  4.74k|      sizeof(pstr_tns_tab->tns_max_bands_table), aot, frame_length);
  122|       |
  123|  4.74k|  pstr_tns_config->tns_active = 1;
  124|       |
  125|  4.74k|  if (active == 0) {
  ------------------
  |  Branch (125:7): [True: 1.87k, False: 2.86k]
  ------------------
  126|  1.87k|    pstr_tns_config->tns_active = 0;
  127|  1.87k|  }
  128|       |
  129|       |  /*now calc band and line borders */
  130|  4.74k|  pstr_tns_config->tns_stop_band = MIN(pstr_psy_config->sfb_cnt, pstr_tns_config->tns_max_sfb);
  ------------------
  |  |   23|  4.74k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 13, False: 4.73k]
  |  |  ------------------
  ------------------
  131|       |
  132|  4.74k|  pstr_tns_config->tns_stop_line = pstr_psy_config->sfb_offsets[pstr_tns_config->tns_stop_band];
  133|       |
  134|  4.74k|  pstr_tns_config->tns_start_band = ia_enhaacplus_enc_freq_to_band_with_rounding(
  135|  4.74k|      pstr_tns_config->tns_start_freq, sample_rate, pstr_psy_config->sfb_cnt,
  136|  4.74k|      pstr_psy_config->sfb_offsets);
  137|       |
  138|  4.74k|  pstr_tns_config->tns_modify_begin_cb = ia_enhaacplus_enc_freq_to_band_with_rounding(
  139|  4.74k|      TEMPORAL_NOISE_SHAPING_MODIFY_BEGIN, sample_rate, pstr_psy_config->sfb_cnt,
  ------------------
  |  |   30|  4.74k|#define TEMPORAL_NOISE_SHAPING_MODIFY_BEGIN 2600 /* Hz */
  ------------------
  140|  4.74k|      pstr_psy_config->sfb_offsets);
  141|       |
  142|  4.74k|  pstr_tns_config->tns_ratio_patch_lowest_cb = ia_enhaacplus_enc_freq_to_band_with_rounding(
  143|  4.74k|      RATIO_PATCH_LOWER_BORDER, sample_rate, pstr_psy_config->sfb_cnt,
  ------------------
  |  |   31|  4.74k|#define RATIO_PATCH_LOWER_BORDER 380             /* Hz */
  ------------------
  144|  4.74k|      pstr_psy_config->sfb_offsets);
  145|       |
  146|  4.74k|  pstr_tns_config->tns_start_line = pstr_psy_config->sfb_offsets[pstr_tns_config->tns_start_band];
  147|       |
  148|  4.74k|  pstr_tns_config->lpc_stop_band = ia_enhaacplus_enc_freq_to_band_with_rounding(
  149|  4.74k|      pstr_tns_config->conf_tab.lpc_stop_freq, sample_rate, pstr_psy_config->sfb_cnt,
  150|  4.74k|      pstr_psy_config->sfb_offsets);
  151|       |
  152|  4.74k|  pstr_tns_config->lpc_stop_band =
  153|  4.74k|      MIN(pstr_tns_config->lpc_stop_band, pstr_psy_config->sfb_active);
  ------------------
  |  |   23|  4.74k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 348, False: 4.39k]
  |  |  ------------------
  ------------------
  154|       |
  155|  4.74k|  pstr_tns_config->lpc_stop_line = pstr_psy_config->sfb_offsets[pstr_tns_config->lpc_stop_band];
  156|  4.74k|  pstr_tns_config->lpc_start_band = ia_enhaacplus_enc_freq_to_band_with_rounding(
  157|  4.74k|      pstr_tns_config->conf_tab.lpc_start_freq, sample_rate, pstr_psy_config->sfb_cnt,
  158|  4.74k|      pstr_psy_config->sfb_offsets);
  159|       |
  160|  4.74k|  pstr_tns_config->lpc_start_line = pstr_psy_config->sfb_offsets[pstr_tns_config->lpc_start_band];
  161|  4.74k|  pstr_tns_config->threshold = pstr_tns_config->conf_tab.thresh_on;
  162|       |
  163|  4.74k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.74k|#define IA_NO_ERROR 0x00000000
  ------------------
  164|  4.74k|}
ia_enhaacplus_enc_init_tns_configuration_short:
  170|  2.94k|    ixheaace_temporal_noise_shaping_tables *pstr_tns_tab, WORD32 frame_length, WORD32 aot) {
  171|  2.94k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  172|  2.94k|  pstr_tns_config->max_order = TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT;
  ------------------
  |  |   23|  2.94k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  173|  2.94k|  pstr_tns_config->tns_start_freq = TEMPORAL_NOISE_SHAPING_START_FREQ_SHORT;
  ------------------
  |  |   25|  2.94k|#define TEMPORAL_NOISE_SHAPING_START_FREQ_SHORT (2750)
  ------------------
  174|  2.94k|  pstr_tns_config->coef_res = TEMPORAL_NOISE_SHAPING_COEF_RES_SHORT;
  ------------------
  |  |   27|  2.94k|#define TEMPORAL_NOISE_SHAPING_COEF_RES_SHORT (3)
  ------------------
  175|       |
  176|  2.94k|  error = ia_enhaacplus_enc_get_tns_param(&pstr_tns_config->conf_tab, bit_rate / channels,
  177|  2.94k|                                          channels, SHORT_WINDOW, pstr_tns_tab->tns_info_tab,
  178|  2.94k|                                          sizeof(pstr_tns_tab->tns_info_tab));
  179|  2.94k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (179:7): [True: 0, False: 2.94k]
  ------------------
  180|      0|    return error;
  181|      0|  }
  182|  2.94k|  ia_enhaacplus_enc_calc_gauss_window(
  183|  2.94k|      pstr_tns_config->acf_window_float, (const WORD16)(pstr_tns_config->max_order + 1),
  184|  2.94k|      sample_rate, SHORT_WINDOW, pstr_tns_config->conf_tab.tns_time_resolution);
  185|       |
  186|  2.94k|  ia_enhaacplus_enc_get_tns_max_bands(
  187|  2.94k|      sample_rate, SHORT_WINDOW, &pstr_tns_config->tns_max_sfb, pstr_tns_tab->tns_max_bands_table,
  188|  2.94k|      sizeof(pstr_tns_tab->tns_max_bands_table), aot, frame_length);
  189|       |
  190|  2.94k|  pstr_tns_config->tns_active = 1;
  191|       |
  192|  2.94k|  if (active == 0) {
  ------------------
  |  Branch (192:7): [True: 1.03k, False: 1.90k]
  ------------------
  193|  1.03k|    pstr_tns_config->tns_active = 0;
  194|  1.03k|  }
  195|       |
  196|       |  /*now calc band and line borders */
  197|       |
  198|  2.94k|  pstr_tns_config->tns_stop_band = MIN(pstr_psy_config->sfb_cnt, pstr_tns_config->tns_max_sfb);
  ------------------
  |  |   23|  2.94k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 2.94k]
  |  |  ------------------
  ------------------
  199|       |
  200|  2.94k|  pstr_tns_config->tns_stop_line = pstr_psy_config->sfb_offsets[pstr_tns_config->tns_stop_band];
  201|       |
  202|  2.94k|  pstr_tns_config->tns_start_band = ia_enhaacplus_enc_freq_to_band_with_rounding(
  203|  2.94k|      pstr_tns_config->tns_start_freq, sample_rate, pstr_psy_config->sfb_cnt,
  204|  2.94k|      pstr_psy_config->sfb_offsets);
  205|       |
  206|  2.94k|  pstr_tns_config->tns_modify_begin_cb = ia_enhaacplus_enc_freq_to_band_with_rounding(
  207|  2.94k|      TEMPORAL_NOISE_SHAPING_MODIFY_BEGIN, sample_rate, pstr_psy_config->sfb_cnt,
  ------------------
  |  |   30|  2.94k|#define TEMPORAL_NOISE_SHAPING_MODIFY_BEGIN 2600 /* Hz */
  ------------------
  208|  2.94k|      pstr_psy_config->sfb_offsets);
  209|       |
  210|  2.94k|  pstr_tns_config->tns_ratio_patch_lowest_cb = ia_enhaacplus_enc_freq_to_band_with_rounding(
  211|  2.94k|      RATIO_PATCH_LOWER_BORDER, sample_rate, pstr_psy_config->sfb_cnt,
  ------------------
  |  |   31|  2.94k|#define RATIO_PATCH_LOWER_BORDER 380             /* Hz */
  ------------------
  212|  2.94k|      pstr_psy_config->sfb_offsets);
  213|       |
  214|  2.94k|  pstr_tns_config->tns_start_line = pstr_psy_config->sfb_offsets[pstr_tns_config->tns_start_band];
  215|       |
  216|  2.94k|  pstr_tns_config->lpc_stop_band = ia_enhaacplus_enc_freq_to_band_with_rounding(
  217|  2.94k|      pstr_tns_config->conf_tab.lpc_stop_freq, sample_rate, pstr_psy_config->sfb_cnt,
  218|  2.94k|      pstr_psy_config->sfb_offsets);
  219|       |
  220|  2.94k|  pstr_tns_config->lpc_stop_band =
  221|  2.94k|      MIN(pstr_tns_config->lpc_stop_band, pstr_psy_config->sfb_active);
  ------------------
  |  |   23|  2.94k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 234, False: 2.70k]
  |  |  ------------------
  ------------------
  222|       |
  223|  2.94k|  pstr_tns_config->lpc_stop_line = pstr_psy_config->sfb_offsets[pstr_tns_config->lpc_stop_band];
  224|       |
  225|  2.94k|  pstr_tns_config->lpc_start_band = ia_enhaacplus_enc_freq_to_band_with_rounding(
  226|  2.94k|      pstr_tns_config->conf_tab.lpc_start_freq, sample_rate, pstr_psy_config->sfb_cnt,
  227|  2.94k|      pstr_psy_config->sfb_offsets);
  228|       |
  229|  2.94k|  pstr_tns_config->lpc_start_line = pstr_psy_config->sfb_offsets[pstr_tns_config->lpc_start_band];
  230|  2.94k|  pstr_tns_config->threshold = pstr_tns_config->conf_tab.thresh_on;
  231|       |
  232|  2.94k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  2.94k|#define IA_NO_ERROR 0x00000000
  ------------------
  233|  2.94k|}
ixheaace_tns_init.c:ia_enhaacplus_enc_calc_gauss_window:
   72|  7.68k|                                                const FLOAT32 time_resolution) {
   73|  7.68k|  WORD16 i;
   74|       |
   75|  7.68k|  FLOAT32 accu_gauss_exp;
   76|  7.68k|  accu_gauss_exp = (sampling_rate * time_resolution) * PI_BY_1000;
  ------------------
  |  |   29|  7.68k|#define PI_BY_1000 (0.00314159265358979323f)
  ------------------
   77|       |
   78|  7.68k|  if (block_type != SHORT_WINDOW) {
  ------------------
  |  Branch (78:7): [True: 4.74k, False: 2.94k]
  ------------------
   79|  4.74k|    accu_gauss_exp = (FLOAT32)(accu_gauss_exp / FRAME_LEN_1024);
  ------------------
  |  |   91|  4.74k|#define FRAME_LEN_1024 1024
  ------------------
   80|  4.74k|  } else {
   81|  2.94k|    accu_gauss_exp = (FLOAT32)(accu_gauss_exp / FRAME_LEN_SHORT_128);
  ------------------
  |  |   30|  2.94k|#define FRAME_LEN_SHORT_128 (128)
  ------------------
   82|  2.94k|  }
   83|       |
   84|  7.68k|  accu_gauss_exp = -(accu_gauss_exp * 0.5f * accu_gauss_exp);
   85|       |
   86|  86.9k|  for (i = 0; i < win_size; i++) {
  ------------------
  |  Branch (86:15): [True: 79.3k, False: 7.68k]
  ------------------
   87|  79.3k|    ptr_win[i] = (FLOAT32)exp(accu_gauss_exp * (i + 0.5) * (i + 0.5));
   88|  79.3k|  }
   89|  7.68k|}
ixheaace_tns_init.c:ia_enhaacplus_enc_freq_to_band_with_rounding:
   45|  38.4k|                                                           const WORD32 *ptr_band_start_offset) {
   46|  38.4k|  WORD32 line_num, band;
   47|       |
   48|  38.4k|  line_num = (freq * ptr_band_start_offset[num_bands] * 4 / fs + 1) / 2;
   49|       |
   50|       |  /* freq > fs/2 */
   51|  38.4k|  if (line_num >= ptr_band_start_offset[num_bands]) {
  ------------------
  |  Branch (51:7): [True: 6.45k, False: 31.9k]
  ------------------
   52|  6.45k|    return num_bands;
   53|  6.45k|  }
   54|       |
   55|       |  /* find band the line number lies in */
   56|       |  /* bandStartOffset[] */
   57|   426k|  for (band = 0; band < num_bands; band++) {
  ------------------
  |  Branch (57:18): [True: 426k, False: 0]
  ------------------
   58|   426k|    if (ptr_band_start_offset[band + 1] > line_num) break;
  ------------------
  |  Branch (58:9): [True: 31.9k, False: 394k]
  ------------------
   59|   426k|  }
   60|       |
   61|       |  /* round to nearest band border */
   62|  31.9k|  if (line_num - ptr_band_start_offset[band] > ptr_band_start_offset[band + 1] - line_num) {
  ------------------
  |  Branch (62:7): [True: 8.58k, False: 23.3k]
  ------------------
   63|  8.58k|    band++;
   64|  8.58k|  }
   65|       |
   66|  31.9k|  return band;
   67|  38.4k|}

ia_enhaacplus_enc_get_tns_param:
   43|  7.68k|    const ixheaace_temporal_noise_shaping_info_tab *pstr_tns_info_tab, WORD32 size) {
   44|  7.68k|  UWORD32 i;
   45|       |
   46|  7.68k|  if (pstr_tns_config_tab == NULL) {
  ------------------
  |  Branch (46:7): [True: 0, False: 7.68k]
  ------------------
   47|      0|    return IA_EXHEAACE_INIT_FATAL_TNS_CONFIG_INIT_FAILED;
   48|      0|  }
   49|       |
   50|  7.68k|  pstr_tns_config_tab->thresh_on = -1;
   51|       |
   52|  46.1k|  for (i = 0; i < size / sizeof(ixheaace_temporal_noise_shaping_info_tab); i++) {
  ------------------
  |  Branch (52:15): [True: 38.4k, False: 7.68k]
  ------------------
   53|  38.4k|    if ((bit_rate >= pstr_tns_info_tab[i].bit_rate_from) &&
  ------------------
  |  Branch (53:9): [True: 21.3k, False: 17.0k]
  ------------------
   54|  21.3k|        bit_rate <= pstr_tns_info_tab[i].bit_rate_to) {
  ------------------
  |  Branch (54:9): [True: 7.68k, False: 13.6k]
  ------------------
   55|  7.68k|      switch (block_type) {
  ------------------
  |  Branch (55:15): [True: 7.68k, False: 0]
  ------------------
   56|  4.74k|        case LONG_WINDOW:
  ------------------
  |  Branch (56:9): [True: 4.74k, False: 2.94k]
  ------------------
   57|  4.74k|          switch (channels) {
  ------------------
  |  Branch (57:19): [True: 4.74k, False: 0]
  ------------------
   58|  2.53k|            case NUM_CHANS_MONO:
  ------------------
  |  |  113|  2.53k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (58:13): [True: 2.53k, False: 2.20k]
  ------------------
   59|       |
   60|  2.53k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_mono_long.thresh_on;
   61|  2.53k|              pstr_tns_config_tab->lpc_start_freq =
   62|  2.53k|                  pstr_tns_info_tab[i].param_mono_long.lpc_start_freq;
   63|  2.53k|              pstr_tns_config_tab->lpc_stop_freq =
   64|  2.53k|                  pstr_tns_info_tab[i].param_mono_long.lpc_stop_freq;
   65|  2.53k|              pstr_tns_config_tab->tns_time_resolution =
   66|  2.53k|                  pstr_tns_info_tab[i].param_mono_long.tns_time_resolution;
   67|       |
   68|  2.53k|              break;
   69|  2.20k|            case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  2.20k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (69:13): [True: 2.20k, False: 2.53k]
  ------------------
   70|       |
   71|  2.20k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_stereo_long.thresh_on;
   72|  2.20k|              pstr_tns_config_tab->lpc_start_freq =
   73|  2.20k|                  pstr_tns_info_tab[i].param_stereo_long.lpc_start_freq;
   74|  2.20k|              pstr_tns_config_tab->lpc_stop_freq =
   75|  2.20k|                  pstr_tns_info_tab[i].param_stereo_long.lpc_stop_freq;
   76|  2.20k|              pstr_tns_config_tab->tns_time_resolution =
   77|  2.20k|                  pstr_tns_info_tab[i].param_stereo_long.tns_time_resolution;
   78|       |
   79|  2.20k|              break;
   80|  4.74k|          }
   81|  4.74k|          break;
   82|       |
   83|  4.74k|        case SHORT_WINDOW:
  ------------------
  |  Branch (83:9): [True: 2.94k, False: 4.74k]
  ------------------
   84|  2.94k|          switch (channels) {
  ------------------
  |  Branch (84:19): [True: 2.94k, False: 0]
  ------------------
   85|  1.56k|            case NUM_CHANS_MONO:
  ------------------
  |  |  113|  1.56k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (85:13): [True: 1.56k, False: 1.37k]
  ------------------
   86|       |
   87|  1.56k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_mono_short.thresh_on;
   88|  1.56k|              pstr_tns_config_tab->lpc_start_freq =
   89|  1.56k|                  pstr_tns_info_tab[i].param_mono_short.lpc_start_freq;
   90|  1.56k|              pstr_tns_config_tab->lpc_stop_freq =
   91|  1.56k|                  pstr_tns_info_tab[i].param_mono_short.lpc_stop_freq;
   92|  1.56k|              pstr_tns_config_tab->tns_time_resolution =
   93|  1.56k|                  pstr_tns_info_tab[i].param_mono_short.tns_time_resolution;
   94|  1.56k|              break;
   95|  1.37k|            case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  1.37k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (95:13): [True: 1.37k, False: 1.56k]
  ------------------
   96|       |
   97|  1.37k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_stereo_short.thresh_on;
   98|  1.37k|              pstr_tns_config_tab->lpc_start_freq =
   99|  1.37k|                  pstr_tns_info_tab[i].param_stereo_short.lpc_start_freq;
  100|  1.37k|              pstr_tns_config_tab->lpc_stop_freq =
  101|  1.37k|                  pstr_tns_info_tab[i].param_stereo_short.lpc_stop_freq;
  102|  1.37k|              pstr_tns_config_tab->tns_time_resolution =
  103|  1.37k|                  pstr_tns_info_tab[i].param_stereo_short.tns_time_resolution;
  104|  1.37k|              break;
  105|  2.94k|          }
  106|       |
  107|  2.94k|          break;
  108|  7.68k|      }
  109|  7.68k|    }
  110|  38.4k|  }
  111|       |
  112|       |  // This check is not being done now
  113|  7.68k|  if (pstr_tns_config_tab->thresh_on == -1) {
  ------------------
  |  Branch (113:7): [True: 0, False: 7.68k]
  ------------------
  114|      0|    return IA_EXHEAACE_INIT_FATAL_INVALID_TNS_PARAM;
  115|      0|  }
  116|       |
  117|  7.68k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  7.68k|#define IA_NO_ERROR 0x00000000
  ------------------
  118|  7.68k|}
ia_enhaacplus_enc_get_tns_max_bands:
  123|  7.68k|    WORD32 aot, WORD32 frame_length) {
  124|  7.68k|  UWORD32 i;
  125|       |
  126|  7.68k|  *tns_max_sfb = -1;
  127|       |
  128|  57.1k|  for (i = 0; i < size / sizeof(ixheaace_temporal_noise_shaping_max_table); i++) {
  ------------------
  |  Branch (128:15): [True: 57.1k, False: 0]
  ------------------
  129|  57.1k|    if (sampling_rate == pstr_tns_max_bands_tab[i].sampling_rate) {
  ------------------
  |  Branch (129:9): [True: 7.68k, False: 49.4k]
  ------------------
  130|  7.68k|      if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  15.3k|#define AOT_AAC_LC (2)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  13.3k|#define AOT_SBR (5)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.29k|#define AOT_PS (29)
  ------------------
  |  Branch (130:11): [True: 2.00k, False: 5.68k]
  |  Branch (130:32): [True: 3.39k, False: 2.29k]
  |  Branch (130:50): [True: 492, False: 1.80k]
  ------------------
  131|  5.88k|        if (block_type == SHORT_WINDOW) {
  ------------------
  |  Branch (131:13): [True: 2.94k, False: 2.94k]
  ------------------
  132|  2.94k|          *tns_max_sfb = (frame_length == (FRAME_LEN_SHORT_128))
  ------------------
  |  |   30|  2.94k|#define FRAME_LEN_SHORT_128 (128)
  ------------------
  |  Branch (132:26): [True: 1.92k, False: 1.01k]
  ------------------
  133|  2.94k|                             ? pstr_tns_max_bands_tab[i].max_band_1024_short_lc
  134|  2.94k|                             : pstr_tns_max_bands_tab[i].max_band_960_short_lc;
  135|  2.94k|        } else {
  136|  2.94k|          *tns_max_sfb = (frame_length == FRAME_LEN_1024)
  ------------------
  |  |   91|  2.94k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (136:26): [True: 1.92k, False: 1.01k]
  ------------------
  137|  2.94k|                             ? pstr_tns_max_bands_tab[i].max_band_1024_long_lc
  138|  2.94k|                             : pstr_tns_max_bands_tab[i].max_band_960_long_lc;
  139|  2.94k|        }
  140|  5.88k|      } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  3.60k|#define AOT_AAC_LD (23)
  ------------------
                    } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.27k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (140:18): [True: 529, False: 1.27k]
  |  Branch (140:39): [True: 1.27k, False: 0]
  ------------------
  141|  1.80k|        *tns_max_sfb = (frame_length == FRAME_LEN_512)
  ------------------
  |  |   92|  1.80k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (141:24): [True: 977, False: 825]
  ------------------
  142|  1.80k|                           ? pstr_tns_max_bands_tab[i].max_band_512_ld
  143|  1.80k|                           : pstr_tns_max_bands_tab[i].max_band_480_ld;
  144|  1.80k|      }
  145|  7.68k|      break;
  146|  7.68k|    }
  147|  57.1k|  }
  148|  7.68k|}

ia_enhaacplus_enc_write_ADTS_header:
  297|  74.2k|                                           WORD32 num_ch) {
  298|  74.2k|  WORD32 bits = 56;
  299|  74.2k|  UWORD32 object_type = 0;
  300|  74.2k|  ixheaace_bitstream_params bitstream_temp;
  301|  74.2k|  ixheaace_bitstream_params *pstr_bitstream = &bitstream_temp;
  302|  74.2k|  WORD32 write_flag = 1;
  303|  74.2k|  pstr_bitstream->data = buffer;
  304|  74.2k|  pstr_bitstream->num_bit = 8;
  305|       |
  306|  74.2k|  pstr_bitstream->current_bit = 0;
  307|  74.2k|  ;
  308|  74.2k|  object_type = 01;
  309|       |
  310|  74.2k|  if (write_flag) {
  ------------------
  |  Branch (310:7): [True: 74.2k, False: 0]
  ------------------
  311|       |    /* Fixed ADTS header */
  312|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0xFFFF, 12); /* 12 bit Syncword */
  313|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 1 /*aacStateStruct->aacConfigSturct.mpegVersion*/,
  314|  74.2k|                             1);                    /* ID == 0 for MPEG4 AAC, 1 for MPEG2 AAC */
  315|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 2); /* layer == 0 */
  316|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 1, 1); /* protection absent */
  317|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, object_type, 2); /* profile */
  318|  74.2k|    ia_enhaacplus_enc_putbit(
  319|  74.2k|        pstr_bitstream,
  320|  74.2k|        ia_enhaacplus_enc_get_sample_rate_index(samp_rate) /*aacStateStruct->sampleRateIdx*/,
  321|  74.2k|        4);                                         /* sampling rate */
  322|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* private bit */
  323|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, num_ch /*aacStateStruct->aacConfigSturct.ch*/,
  324|  74.2k|                             3);                    /* ch. aacConfigSturct (must be > 0) */
  325|       |                                                    /* simply using num_channels only works for
  326|       |                                                    6 channels or less, else a channel
  327|       |     configuration should be written */
  328|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* original/copy */
  329|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* home */
  330|       |
  331|       |    /* Variable ADTS header */
  332|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* copyr. id. bit */
  333|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* copyr. id. start */
  334|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, /*aacStateStruct->*/ bytes_used + 7, 13);
  335|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0x7FF, 11); /* buffer fullness (0x7FF for VBR) */
  336|       |
  337|  74.2k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 2); /* raw data blocks (0+1=1) */
  338|  74.2k|  }
  339|       |
  340|       |  /*
  341|       |   * MPEG2 says byte_aligment() here, but ADTS always is multiple of 8 bits
  342|       |   * MPEG4 has no byte_alignment() here
  343|       |   */
  344|  74.2k|  return bits / 8;
  345|  74.2k|}
ixheaace_write_adts_adif.c:ia_enhaacplus_enc_get_sample_rate_index:
  104|  74.2k|static WORD16 ia_enhaacplus_enc_get_sample_rate_index(WORD32 sample_rate) {
  105|  74.2k|  if (92017 <= sample_rate) {
  ------------------
  |  Branch (105:7): [True: 5.06k, False: 69.2k]
  ------------------
  106|  5.06k|    return 0;
  107|  5.06k|  }
  108|  69.2k|  if (75132 <= sample_rate) {
  ------------------
  |  Branch (108:7): [True: 17.8k, False: 51.3k]
  ------------------
  109|  17.8k|    return 1;
  110|  17.8k|  }
  111|  51.3k|  if (55426 <= sample_rate) {
  ------------------
  |  Branch (111:7): [True: 2.61k, False: 48.7k]
  ------------------
  112|  2.61k|    return 2;
  113|  2.61k|  }
  114|  48.7k|  if (46009 <= sample_rate) {
  ------------------
  |  Branch (114:7): [True: 3.22k, False: 45.5k]
  ------------------
  115|  3.22k|    return 3;
  116|  3.22k|  }
  117|  45.5k|  if (37566 <= sample_rate) {
  ------------------
  |  Branch (117:7): [True: 2.99k, False: 42.5k]
  ------------------
  118|  2.99k|    return 4;
  119|  2.99k|  }
  120|  42.5k|  if (27713 <= sample_rate) {
  ------------------
  |  Branch (120:7): [True: 744, False: 41.8k]
  ------------------
  121|    744|    return 5;
  122|    744|  }
  123|  41.8k|  if (23004 <= sample_rate) {
  ------------------
  |  Branch (123:7): [True: 5.05k, False: 36.7k]
  ------------------
  124|  5.05k|    return 6;
  125|  5.05k|  }
  126|  36.7k|  if (18783 <= sample_rate) {
  ------------------
  |  Branch (126:7): [True: 12.5k, False: 24.1k]
  ------------------
  127|  12.5k|    return 7;
  128|  12.5k|  }
  129|  24.1k|  if (13856 <= sample_rate) {
  ------------------
  |  Branch (129:7): [True: 17.8k, False: 6.32k]
  ------------------
  130|  17.8k|    return 8;
  131|  17.8k|  }
  132|  6.32k|  if (11502 <= sample_rate) {
  ------------------
  |  Branch (132:7): [True: 3.79k, False: 2.53k]
  ------------------
  133|  3.79k|    return 9;
  134|  3.79k|  }
  135|  2.53k|  if (9391 <= sample_rate) {
  ------------------
  |  Branch (135:7): [True: 629, False: 1.90k]
  ------------------
  136|    629|    return 10;
  137|    629|  }
  138|  1.90k|  return 11;
  139|  2.53k|}
ixheaace_write_adts_adif.c:ia_enhaacplus_enc_putbit:
   39|  1.11M|                                       WORD32 num_bit) {
   40|  1.11M|  WORD32 num, max_num, curr_num;
   41|  1.11M|  WORD32 num_used, idx;
   42|  1.11M|  unsigned long bits;
   43|  1.11M|  WORD32 current_bitstream_bit;
   44|  1.11M|  UWORD8 *bitstream_data;
   45|       |
   46|  1.11M|  if (num_bit == 0) return;
  ------------------
  |  Branch (46:7): [True: 0, False: 1.11M]
  ------------------
   47|       |
   48|  1.11M|  current_bitstream_bit = pstr_bitstream->current_bit;
   49|  1.11M|  bitstream_data = pstr_bitstream->data;
   50|       |
   51|       |  /*
   52|       |      Functionality of Writing bits to the bitstream is split into 3 stages.
   53|       |  */
   54|       |
   55|       |  /*
   56|       |      Stage #1: Write remainder bits to the partially filled byte
   57|       |  */
   58|       |
   59|  1.11M|  num = 0;
   60|  1.11M|  num_used = current_bitstream_bit & 7;
   61|  1.11M|  max_num = BYTE_NUMBIT - num_used;
  ------------------
  |  |   82|  1.11M|#define BYTE_NUMBIT 8
  ------------------
   62|  1.11M|  curr_num = MIN(num_bit, max_num);
  ------------------
  |  |   23|  1.11M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 668k, False: 445k]
  |  |  ------------------
  ------------------
   63|  1.11M|  bits = data >> (num_bit - curr_num);
   64|       |
   65|  1.11M|  idx = (current_bitstream_bit >> 3);
   66|       |
   67|  1.11M|  if (num_used == 0) bitstream_data[idx] = 0;
  ------------------
  |  Branch (67:7): [True: 148k, False: 965k]
  ------------------
   68|       |
   69|  1.11M|  bitstream_data[idx] |= (bits & ((1 << curr_num) - 1)) << (max_num - curr_num);
   70|  1.11M|  current_bitstream_bit += curr_num;
   71|  1.11M|  num += curr_num;
   72|       |
   73|       |  /*
   74|       |      Stage #2:
   75|       |      At this point, (num + num_used), will be a multiple of 8
   76|       |      Now the bytes can be written directly to bitstream_data[], as long
   77|       |      as (num + 8) < num_bit
   78|       |  */
   79|       |
   80|  1.18M|  while ((num + 8) < num_bit) {
  ------------------
  |  Branch (80:10): [True: 74.2k, False: 1.11M]
  ------------------
   81|  74.2k|    num += 8;
   82|  74.2k|    current_bitstream_bit += 8;
   83|  74.2k|    bits = data >> (num_bit - num);
   84|  74.2k|    bitstream_data[++idx] = (UWORD8)bits;
   85|  74.2k|  }
   86|       |
   87|       |  /*
   88|       |      Stage #3: Write remainder bits from the data
   89|       |  */
   90|  1.11M|  if (num < num_bit) {
  ------------------
  |  Branch (90:7): [True: 297k, False: 816k]
  ------------------
   91|   297k|    curr_num = num_bit - num;
   92|   297k|    num_used = current_bitstream_bit & 7;
   93|   297k|    max_num = BYTE_NUMBIT - num_used;
  ------------------
  |  |   82|   297k|#define BYTE_NUMBIT 8
  ------------------
   94|   297k|    idx = current_bitstream_bit >> 3;
   95|   297k|    if (num_used == 0) bitstream_data[idx] = 0;
  ------------------
  |  Branch (95:9): [True: 297k, False: 0]
  ------------------
   96|   297k|    bitstream_data[idx] |= (data & ((1 << curr_num) - 1)) << (max_num - curr_num);
   97|   297k|    current_bitstream_bit += curr_num;
   98|   297k|  }
   99|       |
  100|  1.11M|  pstr_bitstream->current_bit = current_bitstream_bit;
  101|  1.11M|  pstr_bitstream->num_bit = current_bitstream_bit;
  102|  1.11M|}

ia_enhaacplus_enc_write_bitstream:
  672|   308k|    WORD32 i_samp_freq, WORD32 ele_idx, WORD32 aot, WORD32 *total_fill_bits) {
  673|   308k|  IA_ERRORCODE err_code;
  674|   308k|  WORD32 bit_markup, element_used_bits, frame_bits;
  675|       |
  676|   308k|  bit_markup = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  677|       |
  678|   308k|  *glob_used_bits = 0;
  679|       |
  680|   308k|  {
  681|   308k|    WORD32 *ptr_sfb_offset[2];
  682|   308k|    ixheaace_temporal_noise_shaping_params tns_info[2];
  683|       |
  684|   308k|    element_used_bits = 0;
  685|       |
  686|   308k|    if ((*write_program_config_element == 1) && (ele_idx == 0)) {
  ------------------
  |  Branch (686:9): [True: 0, False: 308k]
  |  Branch (686:49): [True: 0, False: 0]
  ------------------
  687|      0|      WORD32 samp_rate = i_samp_freq, ch_mask = i_channels_mask, n_cc_ch = i_num_coup_channels;
  688|       |
  689|       |      /*Write Program Config Element*/
  690|      0|      ixheaace_write_bits(pstr_bit_stream_handle, ID_PCE, 3);
  691|      0|      ia_enhaacplus_enc_write_pce(samp_rate, ch_mask, n_cc_ch, pstr_bit_stream_handle);
  692|      0|      *write_program_config_element = 0;
  693|      0|    }
  694|       |
  695|   308k|    switch (pstr_element_info.el_type) {
  696|   146k|      case ID_SCE: /* single channel */
  ------------------
  |  Branch (696:7): [True: 146k, False: 162k]
  ------------------
  697|       |
  698|   146k|        ptr_sfb_offset[0] =
  699|   146k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->sfb_offsets;
  700|   146k|        tns_info[0] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->tns_info;
  701|       |
  702|   146k|        err_code = ia_enhaacplus_enc_write_single_chan_elem(
  703|   146k|            pstr_element_info.instance_tag, ptr_sfb_offset[0],
  704|   146k|            pstr_qc_out->qc_channel[pstr_element_info.channel_index[0]], pstr_bit_stream_handle,
  705|   146k|            aot, tns_info[0], pstr_aac_tables);
  706|       |
  707|   146k|        if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   146k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (707:13): [True: 193, False: 145k]
  ------------------
  708|    193|          return err_code;
  709|    193|        }
  710|   145k|        break;
  711|       |
  712|   145k|      case ID_CCE: /* single channel independent coupling element*/
  ------------------
  |  Branch (712:7): [True: 0, False: 308k]
  ------------------
  713|       |
  714|      0|        ptr_sfb_offset[0] =
  715|      0|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->sfb_offsets;
  716|      0|        tns_info[0] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->tns_info;
  717|       |
  718|      0|        err_code = ia_enhaacplus_enc_write_single_channel_ind_coupling_element(
  719|      0|            ptr_sfb_offset[0], pstr_qc_out->qc_channel[pstr_element_info.channel_index[0]],
  720|      0|            pstr_bit_stream_handle, aot, tns_info[0], pstr_aac_tables);
  721|       |
  722|      0|        if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|      0|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (722:13): [True: 0, False: 0]
  ------------------
  723|      0|          return err_code;
  724|      0|        }
  725|      0|        break;
  726|       |
  727|  21.3k|      case ID_LFE: /* single channel */
  ------------------
  |  Branch (727:7): [True: 21.3k, False: 286k]
  ------------------
  728|       |
  729|  21.3k|        ptr_sfb_offset[0] =
  730|  21.3k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->sfb_offsets;
  731|  21.3k|        tns_info[0] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->tns_info;
  732|       |
  733|  21.3k|        err_code = ia_enhaacplus_enc_write_single_channel_element_LFE(
  734|  21.3k|            pstr_element_info.instance_tag, ptr_sfb_offset[0],
  735|  21.3k|            pstr_qc_out->qc_channel[pstr_element_info.channel_index[0]], pstr_bit_stream_handle,
  736|  21.3k|            aot, tns_info[0], pstr_aac_tables);
  737|       |
  738|  21.3k|        if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  21.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (738:13): [True: 46, False: 21.2k]
  ------------------
  739|     46|          return err_code;
  740|     46|        }
  741|  21.2k|        break;
  742|       |
  743|   140k|      case ID_CPE: /* channel pair */
  ------------------
  |  Branch (743:7): [True: 140k, False: 167k]
  ------------------
  744|   140k|      {
  745|   140k|        WORD32 ms_digest = pstr_psy_out->psy_out_element.tools_info.ms_digest;
  746|   140k|        WORD32 *ms_flags = pstr_psy_out->psy_out_element.tools_info.ms_mask;
  747|       |
  748|   140k|        ptr_sfb_offset[0] =
  749|   140k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->sfb_offsets;
  750|   140k|        ptr_sfb_offset[1] =
  751|   140k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[1]]->sfb_offsets;
  752|       |
  753|   140k|        tns_info[0] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->tns_info;
  754|   140k|        tns_info[1] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[1]]->tns_info;
  755|       |
  756|   140k|        err_code = ia_enhaacplus_enc_write_channel_pair_element(
  757|   140k|            pstr_element_info.instance_tag, ms_digest, ms_flags, ptr_sfb_offset,
  758|   140k|            pstr_qc_out->qc_channel[pstr_element_info.channel_index[0]], pstr_bit_stream_handle,
  759|   140k|            aot, tns_info, pstr_aac_tables);
  760|   140k|        if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   140k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (760:13): [True: 412, False: 140k]
  ------------------
  761|    412|          return err_code;
  762|    412|        }
  763|   140k|      } break;
  764|       |
  765|   140k|      default:
  ------------------
  |  Branch (765:7): [True: 0, False: 308k]
  ------------------
  766|      0|        return IA_EXHEAACE_INIT_FATAL_INVALID_ELEMENT_TYPE;
  767|       |
  768|   308k|    } /* switch */
  769|       |
  770|   307k|    element_used_bits -= bit_markup;
  771|       |
  772|   307k|    bit_markup = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  773|       |
  774|   307k|    frame_bits = element_used_bits + bit_markup;
  775|   307k|  }
  776|       |
  777|   307k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   615k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   556k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (777:7): [True: 58.6k, False: 248k]
  |  Branch (777:28): [True: 125k, False: 123k]
  |  Branch (777:46): [True: 19.7k, False: 103k]
  ------------------
  778|   203k|    ia_enhaacplus_enc_write_fill_element_LC(ptr_anc_bytes, pstr_qc_out->tot_anc_bits_used,
  779|   203k|                                            pstr_bit_stream_handle);
  780|   203k|  }
  781|       |
  782|   307k|  if (flag_last_element) {
  ------------------
  |  Branch (782:7): [True: 146k, False: 160k]
  ------------------
  783|   146k|    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   293k|#define AOT_AAC_LC (2)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   269k|#define AOT_SBR (5)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  82.3k|#define AOT_PS (29)
  ------------------
  |  Branch (783:9): [True: 23.8k, False: 122k]
  |  Branch (783:30): [True: 40.2k, False: 82.3k]
  |  Branch (783:48): [True: 19.7k, False: 62.6k]
  ------------------
  784|  83.8k|      ia_enhaacplus_enc_write_fill_element_LC(NULL, *total_fill_bits, pstr_bit_stream_handle);
  785|       |
  786|  83.8k|      *total_fill_bits = 0;
  787|       |
  788|  83.8k|      ixheaace_write_bits(pstr_bit_stream_handle, ID_END, 3);
  789|  83.8k|    }
  790|       |
  791|   146k|    if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   293k|#define AOT_AAC_LD (23)
  ------------------
                  if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   135k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (791:9): [True: 10.5k, False: 135k]
  |  Branch (791:30): [True: 52.1k, False: 83.8k]
  ------------------
  792|  62.6k|      {
  793|  62.6k|        WORD32 i, cnt = 0;
  794|  62.6k|        ia_enhaacplus_enc_write_fill_element_LD(ptr_anc_bytes, pstr_qc_out->tot_anc_bits_used,
  795|  62.6k|                                                pstr_bit_stream_handle);
  796|       |
  797|  62.6k|        *total_fill_bits += pstr_qc_out->total_fill_bits;
  798|  62.6k|        *total_fill_bits += pstr_qc_out->align_bits;
  799|  62.6k|        cnt = *total_fill_bits >> 3;
  800|  11.8M|        for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (800:21): [True: 11.7M, False: 62.6k]
  ------------------
  801|  11.7M|          ixheaace_write_bits(pstr_bit_stream_handle, 0, 8);
  802|  11.7M|        }
  803|  62.6k|        cnt = *total_fill_bits - (cnt << 3);
  804|  62.6k|        ixheaace_write_bits(pstr_bit_stream_handle, 0, (UWORD8)cnt);
  805|  62.6k|        *total_fill_bits = 0;
  806|  62.6k|      }
  807|  62.6k|    }
  808|       |    /* byte alignement */
  809|       |
  810|   146k|    ixheaace_write_bits(pstr_bit_stream_handle, 0,
  811|   146k|                        (UWORD8)((8 - (pstr_bit_stream_handle->cnt_bits % 8)) % 8));
  812|   146k|  }
  813|       |
  814|   307k|  *glob_used_bits -= bit_markup;
  815|       |
  816|   307k|  bit_markup = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  817|       |
  818|   307k|  *glob_used_bits += bit_markup;
  819|       |
  820|   307k|  frame_bits += *glob_used_bits;
  821|       |
  822|   307k|  if (frame_bits != pstr_qc_out->tot_static_bits_used + pstr_qc_out->tot_dyn_bits_used +
  ------------------
  |  Branch (822:7): [True: 191k, False: 116k]
  ------------------
  823|   307k|                        pstr_qc_out->tot_anc_bits_used + +pstr_qc_out->total_fill_bits +
  824|   307k|                        pstr_qc_out->align_bits) {
  825|   191k|  }
  826|       |
  827|   307k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   307k|#define IA_NO_ERROR 0x00000000
  ------------------
  828|   308k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_single_chan_elem:
  426|   146k|    ixheaace_temporal_noise_shaping_params pstr_tns_info, ixheaace_aac_tables *pstr_aac_tables) {
  427|   146k|  IA_ERRORCODE err_code;
  428|       |
  429|   146k|  switch (aot) {
  ------------------
  |  Branch (429:11): [True: 110k, False: 35.4k]
  ------------------
  430|  23.1k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  23.1k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (430:5): [True: 23.1k, False: 122k]
  ------------------
  431|  81.2k|    case AOT_SBR:
  ------------------
  |  |   35|  81.2k|#define AOT_SBR (5)
  ------------------
  |  Branch (431:5): [True: 58.0k, False: 88.0k]
  ------------------
  432|   100k|    case AOT_PS:
  ------------------
  |  |   39|   100k|#define AOT_PS (29)
  ------------------
  |  Branch (432:5): [True: 19.7k, False: 126k]
  ------------------
  433|   100k|      ixheaace_write_bits(pstr_bit_stream_handle, ID_SCE, 3);
  434|   100k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  435|   100k|      break;
  436|  9.68k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  9.68k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (436:5): [True: 9.68k, False: 136k]
  ------------------
  437|  9.68k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  438|  9.68k|      break;
  439|   146k|  }
  440|       |
  441|   146k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  442|   146k|      0, pstr_qc_out_ch->win_shape, pstr_qc_out_ch->grouping_mask, pstr_sfb_offset,
  443|   146k|      pstr_qc_out_ch->scalefactor, pstr_qc_out_ch->max_val_in_sfb, pstr_qc_out_ch->global_gain,
  444|   146k|      pstr_qc_out_ch->quant_spec, &(pstr_qc_out_ch->section_data), pstr_bit_stream_handle, aot,
  445|   146k|      pstr_tns_info, pstr_aac_tables);
  446|       |
  447|   146k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   146k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (447:7): [True: 193, False: 145k]
  ------------------
  448|    193|    return err_code;
  449|    193|  }
  450|       |
  451|   145k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   145k|#define IA_NO_ERROR 0x00000000
  ------------------
  452|   146k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_ic_stream:
  384|   448k|    ixheaace_aac_tables *pstr_aac_tables) {
  385|   448k|  WORD32 log_norm = -1;
  386|       |
  387|   448k|  ia_enhaacplus_enc_encode_global_gain(
  388|   448k|      global_gain, log_norm, ptr_scf[pstr_section_data->first_scf], pstr_bit_stream_handle);
  389|   448k|  if (!common_window) {
  ------------------
  |  Branch (389:7): [True: 167k, False: 281k]
  ------------------
  390|   167k|    ia_enhaacplus_enc_encode_ics_info(pstr_section_data->block_type, win_shape, grouping_mask,
  391|   167k|                                      pstr_section_data, pstr_bit_stream_handle, aot);
  392|   167k|  }
  393|       |
  394|   448k|  if (ia_enhaacplus_enc_encode_section_data(pstr_section_data, pstr_bit_stream_handle) !=
  ------------------
  |  Branch (394:7): [True: 0, False: 448k]
  ------------------
  395|   448k|      pstr_section_data->side_info_bits) {
  396|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_SIDE_INFO_BITS;
  397|      0|  }
  398|       |
  399|   448k|  if (ia_enhaacplus_enc_encode_scalefactor_data(
  ------------------
  |  Branch (399:7): [True: 651, False: 447k]
  ------------------
  400|   448k|          ptr_max_val_in_sfb, pstr_section_data, ptr_scf, pstr_bit_stream_handle,
  401|   448k|          pstr_aac_tables->pstr_huff_tab) != pstr_section_data->scale_fac_bits) {
  402|    651|    return IA_EXHEAACE_EXE_FATAL_INVALID_SCALE_FACTOR_BITS;
  403|    651|  }
  404|       |
  405|   447k|  if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   895k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   36|   807k|#define AOT_AAC_LD (23)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   769k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   136k|#define AOT_PS (29)
  ------------------
  |  Branch (405:7): [True: 88.3k, False: 359k]
  |  Branch (405:28): [True: 38.2k, False: 321k]
  |  Branch (405:49): [True: 185k, False: 136k]
  |  Branch (405:67): [True: 19.7k, False: 116k]
  ------------------
  406|   331k|    ia_enhaacplus_enc_encode_pulse_data(pstr_bit_stream_handle);
  407|   331k|  }
  408|   447k|  ia_enhaacplus_enc_encode_tns_data(pstr_tns_info, pstr_section_data->block_type,
  409|   447k|                                    pstr_bit_stream_handle, aot);
  410|       |
  411|   447k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   895k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   807k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   174k|#define AOT_PS (29)
  ------------------
  |  Branch (411:7): [True: 88.3k, False: 359k]
  |  Branch (411:28): [True: 185k, False: 174k]
  |  Branch (411:46): [True: 19.7k, False: 154k]
  ------------------
  412|   293k|    ia_enhaacplus_enc_encode_gain_control_data(pstr_bit_stream_handle);
  413|   293k|  }
  414|       |
  415|   447k|  if (ia_enhaacplus_enc_encode_spectral_data(
  ------------------
  |  Branch (415:7): [True: 0, False: 447k]
  ------------------
  416|   447k|          pstr_sfb_offset, pstr_section_data, ptr_quant_spec, pstr_bit_stream_handle,
  417|   447k|          pstr_aac_tables->pstr_huff_tab) != pstr_section_data->huffman_bits) {
  418|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_HUFFMAN_BITS;
  419|      0|  }
  420|   447k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   447k|#define IA_NO_ERROR 0x00000000
  ------------------
  421|   447k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_global_gain:
   90|   448k|                                                 ixheaace_bit_buf_handle pstr_bit_stream_handle) {
   91|   448k|  ixheaace_write_bits(pstr_bit_stream_handle,
   92|   448k|                      global_gain - scalefac + GLOBAL_GAIN_OFFSET - 4 * log_norm, 8);
  ------------------
  |  |   23|   448k|#define GLOBAL_GAIN_OFFSET 100
  ------------------
   93|   448k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_ics_info:
   99|   308k|                                              WORD32 aot) {
  100|   308k|  WORD32 tmp;
  101|       |
  102|   308k|  switch (aot) {
  ------------------
  |  Branch (102:11): [True: 229k, False: 78.6k]
  ------------------
  103|  25.4k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  25.4k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (103:5): [True: 25.4k, False: 282k]
  ------------------
  104|  25.4k|      tmp = ((ICS_RESERVED_BIT << 3) | (block_type << 1) | win_shape);
  ------------------
  |  |   24|  25.4k|#define ICS_RESERVED_BIT 0
  ------------------
  105|  25.4k|      ixheaace_write_bits(pstr_bit_stream_handle, tmp, 4);
  106|  25.4k|      break;
  107|       |
  108|  59.0k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  59.0k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (108:5): [True: 59.0k, False: 249k]
  ------------------
  109|   184k|    case AOT_SBR:
  ------------------
  |  |   35|   184k|#define AOT_SBR (5)
  ------------------
  |  Branch (109:5): [True: 125k, False: 182k]
  ------------------
  110|   204k|    case AOT_PS:
  ------------------
  |  |   39|   204k|#define AOT_PS (29)
  ------------------
  |  Branch (110:5): [True: 19.7k, False: 288k]
  ------------------
  111|   204k|      tmp = ((ICS_RESERVED_BIT << 3) | (block_type << 1) | win_shape);
  ------------------
  |  |   24|   204k|#define ICS_RESERVED_BIT 0
  ------------------
  112|   204k|      ixheaace_write_bits(pstr_bit_stream_handle, tmp, 4);
  113|   204k|      break;
  114|   308k|  }
  115|   308k|  switch (block_type) {
  ------------------
  |  Branch (115:11): [True: 308k, False: 0]
  ------------------
  116|   232k|    case LONG_WINDOW:
  ------------------
  |  |   31|   232k|#define LONG_WINDOW 0
  ------------------
  |  Branch (116:5): [True: 232k, False: 76.1k]
  ------------------
  117|   245k|    case START_WINDOW:
  ------------------
  |  |   32|   245k|#define START_WINDOW 1
  ------------------
  |  Branch (117:5): [True: 13.2k, False: 294k]
  ------------------
  118|   257k|    case STOP_WINDOW:
  ------------------
  |  |   34|   257k|#define STOP_WINDOW 3
  ------------------
  |  Branch (118:5): [True: 11.8k, False: 296k]
  ------------------
  119|       |
  120|   257k|      switch (aot) {
  121|  46.2k|        case AOT_AAC_LC:
  ------------------
  |  |   34|  46.2k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (121:9): [True: 46.2k, False: 210k]
  ------------------
  122|   142k|        case AOT_SBR:
  ------------------
  |  |   35|   142k|#define AOT_SBR (5)
  ------------------
  |  Branch (122:9): [True: 96.2k, False: 160k]
  ------------------
  123|   153k|        case AOT_PS:
  ------------------
  |  |   39|   153k|#define AOT_PS (29)
  ------------------
  |  Branch (123:9): [True: 10.4k, False: 246k]
  ------------------
  124|   153k|          tmp = pstr_section_data->max_sfb_per_grp << 1;
  125|   153k|          ixheaace_write_bits(pstr_bit_stream_handle, tmp, 7);
  126|   153k|          break;
  127|       |
  128|  25.4k|        case AOT_AAC_LD:
  ------------------
  |  |   36|  25.4k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (128:9): [True: 25.4k, False: 231k]
  ------------------
  129|  25.4k|          tmp = pstr_section_data->max_sfb_per_grp << 1;
  130|  25.4k|          ixheaace_write_bits(pstr_bit_stream_handle, tmp, 7);
  131|  25.4k|          break;
  132|  78.6k|        default:
  ------------------
  |  Branch (132:9): [True: 78.6k, False: 178k]
  ------------------
  133|  78.6k|          ixheaace_write_bits(pstr_bit_stream_handle, pstr_section_data->max_sfb_per_grp, 6);
  134|   257k|      }
  135|   257k|      break;
  136|       |
  137|   257k|    case SHORT_WINDOW:
  ------------------
  |  |   33|  51.0k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (137:5): [True: 51.0k, False: 257k]
  ------------------
  138|       |
  139|       |      // Write grouping bits
  140|       |
  141|  51.0k|      tmp = pstr_section_data->max_sfb_per_grp << (TRANS_FAC - 1) | grouping_mask;
  ------------------
  |  |   29|  51.0k|#define TRANS_FAC 8
  ------------------
  142|  51.0k|      ixheaace_write_bits(pstr_bit_stream_handle, tmp, TRANS_FAC - 1 + 4);
  ------------------
  |  |   29|  51.0k|#define TRANS_FAC 8
  ------------------
  143|       |
  144|  51.0k|      break;
  145|   308k|  }
  146|   308k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_section_data:
  149|   448k|    ixheaace_section_data *pstr_section_data, ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  150|   448k|  WORD32 sect_escape_val = 0, sect_len_bits = 0;
  151|   448k|  WORD32 sect_len;
  152|   448k|  WORD32 i;
  153|   448k|  WORD32 dbg_val = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  154|       |
  155|   448k|  switch (pstr_section_data->block_type) {
  ------------------
  |  Branch (155:11): [True: 448k, False: 0]
  ------------------
  156|   322k|    case LONG_WINDOW:
  ------------------
  |  |   31|   322k|#define LONG_WINDOW 0
  ------------------
  |  Branch (156:5): [True: 322k, False: 125k]
  ------------------
  157|   343k|    case START_WINDOW:
  ------------------
  |  |   32|   343k|#define START_WINDOW 1
  ------------------
  |  Branch (157:5): [True: 20.6k, False: 427k]
  ------------------
  158|   361k|    case STOP_WINDOW:
  ------------------
  |  |   34|   361k|#define STOP_WINDOW 3
  ------------------
  |  Branch (158:5): [True: 18.3k, False: 430k]
  ------------------
  159|       |
  160|   361k|      sect_escape_val = SECT_ESC_VAL_LONG;
  ------------------
  |  |   23|   361k|#define SECT_ESC_VAL_LONG 31
  ------------------
  161|   361k|      sect_len_bits = SECT_BITS_LONG;
  ------------------
  |  |   26|   361k|#define SECT_BITS_LONG 5
  ------------------
  162|   361k|      break;
  163|       |
  164|  86.8k|    case SHORT_WINDOW:
  ------------------
  |  |   33|  86.8k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (164:5): [True: 86.8k, False: 361k]
  ------------------
  165|       |
  166|  86.8k|      sect_escape_val = SECT_ESC_VAL_SHORT;
  ------------------
  |  |   24|  86.8k|#define SECT_ESC_VAL_SHORT 7
  ------------------
  167|  86.8k|      sect_len_bits = SECT_BITS_SHORT;
  ------------------
  |  |   27|  86.8k|#define SECT_BITS_SHORT 3
  ------------------
  168|  86.8k|      break;
  169|   448k|  }
  170|       |
  171|  2.14M|  for (i = 0; i < pstr_section_data->num_of_sections; i++) {
  ------------------
  |  Branch (171:15): [True: 1.69M, False: 448k]
  ------------------
  172|  1.69M|    ixheaace_write_bits(pstr_bit_stream_handle, pstr_section_data->section[i].code_book, 4);
  173|       |
  174|  1.69M|    sect_len = pstr_section_data->section[i].sfb_cnt;
  175|       |
  176|  2.05M|    while (sect_len >= sect_escape_val) {
  ------------------
  |  Branch (176:12): [True: 359k, False: 1.69M]
  ------------------
  177|   359k|      ixheaace_write_bits(pstr_bit_stream_handle, sect_escape_val, (UWORD8)sect_len_bits);
  178|       |
  179|   359k|      sect_len -= sect_escape_val;
  180|   359k|    }
  181|       |
  182|  1.69M|    ixheaace_write_bits(pstr_bit_stream_handle, sect_len, (UWORD8)sect_len_bits);
  183|  1.69M|  }
  184|       |
  185|   448k|  return (ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle) - dbg_val);
  186|   448k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_scalefactor_data:
  201|   448k|    ixheaace_bit_buf_handle pstr_bit_stream_handle, ixheaace_huffman_tables *pstr_huffman_tbl) {
  202|   448k|  WORD32 i, j, last_val_scf, delta_scf;
  203|   448k|  WORD32 dbg_val = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  204|   448k|  const UWORD16 *ptr_pltabscf = &pstr_huffman_tbl->huff_ltabscf[CODE_BCK_SCF_LAV];
  205|   448k|  const UWORD32 *ptr_pctabscf = &pstr_huffman_tbl->huff_ctabscf[CODE_BCK_SCF_LAV];
  206|       |
  207|   448k|  last_val_scf = ptr_scalefac[pstr_section_data->first_scf];
  208|       |
  209|  2.14M|  for (i = 0; i < pstr_section_data->num_of_sections; i++) {
  ------------------
  |  Branch (209:15): [True: 1.69M, False: 448k]
  ------------------
  210|  1.69M|    if (pstr_section_data->section[i].code_book != CODE_BCK_ZERO_NO) {
  ------------------
  |  Branch (210:9): [True: 1.21M, False: 475k]
  ------------------
  211|  1.21M|      for (j = pstr_section_data->section[i].sfb_start;
  212|  8.32M|           j < pstr_section_data->section[i].sfb_start + pstr_section_data->section[i].sfb_cnt;
  ------------------
  |  Branch (212:12): [True: 7.10M, False: 1.21M]
  ------------------
  213|  7.10M|           j++) {
  214|  7.10M|        if (ptr_max_val_in_sfb[j] == 0) {
  ------------------
  |  Branch (214:13): [True: 393k, False: 6.70M]
  ------------------
  215|   393k|          delta_scf = 0;
  216|  6.70M|        } else {
  217|  6.70M|          delta_scf = -(ptr_scalefac[j] - last_val_scf);
  218|       |
  219|  6.70M|          last_val_scf = ptr_scalefac[j];
  220|  6.70M|        }
  221|  7.10M|        ia_enhaacplus_enc_code_scale_factor_delta_lav(delta_scf, pstr_bit_stream_handle,
  222|  7.10M|                                                          ptr_pltabscf, ptr_pctabscf);
  223|  7.10M|      }
  224|  1.21M|    }
  225|  1.69M|  }
  226|       |
  227|   448k|  return (ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle) - dbg_val);
  228|   448k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_code_scale_factor_delta_lav:
  191|  7.10M|                                                            const UWORD32 *ptr_pctabscf) {
  192|  7.10M|  WORD32 code_word, code_length;
  193|       |
  194|  7.10M|  code_word = ptr_pctabscf[delta];
  195|  7.10M|  code_length = ptr_pltabscf[delta];
  196|       |
  197|  7.10M|  ixheaace_write_bits(ptr_bitstream, code_word, (UWORD8)code_length);
  198|  7.10M|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_pulse_data:
  375|   331k|ia_enhaacplus_enc_encode_pulse_data(ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  376|   331k|  ixheaace_write_bits(pstr_bit_stream_handle, 0, 1);
  377|   331k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_tns_data:
  284|   447k|    ixheaace_bit_buf_handle pstr_bit_stream_handle, WORD32 aot) {
  285|   447k|  WORD32 i, k;
  286|   447k|  WORD32 tns_present;
  287|   447k|  WORD32 num_windows;
  288|   447k|  WORD32 coef_bits;
  289|       |
  290|   447k|  UWORD32 tmp;
  291|   447k|  UWORD8 val;
  292|       |
  293|   447k|  num_windows = (block_type == 2 ? TRANS_FAC : 1);
  ------------------
  |  |   29|  86.6k|#define TRANS_FAC 8
  ------------------
  |  Branch (293:18): [True: 86.6k, False: 361k]
  ------------------
  294|       |
  295|   447k|  tns_present = 0;
  296|       |
  297|  1.50M|  for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (297:15): [True: 1.05M, False: 447k]
  ------------------
  298|  1.05M|    if (pstr_tns_info.tns_active[i] == 1) {
  ------------------
  |  Branch (298:9): [True: 344k, False: 710k]
  ------------------
  299|   344k|      tns_present = 1;
  300|   344k|    }
  301|  1.05M|  }
  302|       |
  303|   447k|  if (tns_present == 0) {
  ------------------
  |  Branch (303:7): [True: 223k, False: 224k]
  ------------------
  304|   223k|    ixheaace_write_bits(pstr_bit_stream_handle, 0, 1);
  305|       |
  306|   223k|    if (AOT_AAC_LD == aot) {
  ------------------
  |  |   36|   223k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (306:9): [True: 30.3k, False: 192k]
  ------------------
  307|  30.3k|      ia_enhaacplus_enc_encode_gain_control_data(pstr_bit_stream_handle);
  308|  30.3k|    }
  309|   224k|  } else {
  310|       |    /* there is data to be written*/
  311|       |
  312|   224k|    ixheaace_write_bits(pstr_bit_stream_handle, 1, 1); /* data_present */
  313|       |
  314|   224k|    if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|   224k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (314:9): [True: 7.88k, False: 216k]
  ------------------
  315|  7.88k|      ia_enhaacplus_enc_encode_gain_control_data(pstr_bit_stream_handle);
  316|  7.88k|    }
  317|       |
  318|   794k|    for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (318:17): [True: 569k, False: 224k]
  ------------------
  319|   569k|      ixheaace_write_bits(pstr_bit_stream_handle, pstr_tns_info.tns_active[i],
  320|   569k|                          (UWORD8)(block_type == 2 ? 1 : 2));
  ------------------
  |  Branch (320:36): [True: 394k, False: 175k]
  ------------------
  321|       |
  322|   569k|      if (pstr_tns_info.tns_active[i]) {
  ------------------
  |  Branch (322:11): [True: 344k, False: 224k]
  ------------------
  323|   344k|        tmp = ((pstr_tns_info.coef_res[i] == 4 ? 1 : 0)
  ------------------
  |  Branch (323:17): [True: 175k, False: 169k]
  ------------------
  324|   344k|                   << ((block_type == 2 ? 4 : 6) + (block_type == 2 ? 3 : 5)) |
  ------------------
  |  Branch (324:25): [True: 169k, False: 175k]
  |  Branch (324:53): [True: 169k, False: 175k]
  ------------------
  325|   344k|               pstr_tns_info.length[i] << (block_type == 2 ? 3 : 5) | pstr_tns_info.order[i]);
  ------------------
  |  Branch (325:44): [True: 169k, False: 175k]
  ------------------
  326|       |
  327|   344k|        val = (UWORD8)(1 + (block_type == 2 ? 4 : 6) + (block_type == 2 ? 3 : 5));
  ------------------
  |  Branch (327:29): [True: 169k, False: 175k]
  |  Branch (327:57): [True: 169k, False: 175k]
  ------------------
  328|       |
  329|   344k|        ixheaace_write_bits(pstr_bit_stream_handle, tmp, val);
  330|       |
  331|   344k|        if (pstr_tns_info.order[i]) {
  ------------------
  |  Branch (331:13): [True: 344k, False: 107]
  ------------------
  332|   344k|          ixheaace_write_bits(pstr_bit_stream_handle, FILTER_DIRECTION, 1);
  ------------------
  |  |   28|   344k|#define FILTER_DIRECTION (0)
  ------------------
  333|       |
  334|   344k|          if (pstr_tns_info.coef_res[i] == 4) {
  ------------------
  |  Branch (334:15): [True: 175k, False: 169k]
  ------------------
  335|   175k|            coef_bits = 3;
  336|       |
  337|   608k|            for (k = 0; k < pstr_tns_info.order[i]; k++) {
  ------------------
  |  Branch (337:25): [True: 579k, False: 29.0k]
  ------------------
  338|   579k|              if (pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 3 ||
  ------------------
  |  |   23|   579k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (338:19): [True: 109k, False: 470k]
  ------------------
  339|   470k|                  pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -4) {
  ------------------
  |  |   23|   470k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (339:19): [True: 36.8k, False: 433k]
  ------------------
  340|   146k|                coef_bits = 4;
  341|   146k|                break;
  342|   146k|              }
  343|   579k|            }
  344|   175k|          } else {
  345|   169k|            coef_bits = 2;
  346|       |
  347|   464k|            for (k = 0; k < pstr_tns_info.order[i]; k++) {
  ------------------
  |  Branch (347:25): [True: 352k, False: 112k]
  ------------------
  348|   352k|              if (pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 1 ||
  ------------------
  |  |   23|   352k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (348:19): [True: 53.3k, False: 298k]
  ------------------
  349|   298k|                  pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -2) {
  ------------------
  |  |   23|   298k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (349:19): [True: 3.68k, False: 295k]
  ------------------
  350|  57.0k|                coef_bits = 3;
  351|  57.0k|                break;
  352|  57.0k|              }
  353|   352k|            }
  354|   169k|          }
  355|       |
  356|   344k|          ixheaace_write_bits(pstr_bit_stream_handle, -(coef_bits - pstr_tns_info.coef_res[i]),
  357|   344k|                              1); /*coef_compres*/
  358|       |
  359|  2.27M|          for (k = 0; k < pstr_tns_info.order[i]; k++) {
  ------------------
  |  Branch (359:23): [True: 1.92M, False: 344k]
  ------------------
  360|  1.92M|            static const WORD32 rmask[] = {0, 1, 3, 7, 15};
  361|       |
  362|  1.92M|            ixheaace_write_bits(
  363|  1.92M|                pstr_bit_stream_handle,
  364|  1.92M|                pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] &
  ------------------
  |  |   23|  1.92M|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  365|  1.92M|                    rmask[coef_bits],
  366|  1.92M|                (UWORD8)coef_bits);
  367|  1.92M|          }
  368|   344k|        }
  369|   344k|      }
  370|   569k|    }
  371|   224k|  }
  372|   447k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_gain_control_data:
   63|   331k|{
   64|   331k|  ixheaace_write_bits(pstr_bit_stream_handle, 0, 1);
   65|   331k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_spectral_data:
   68|   447k|    ixheaace_bit_buf_handle pstr_bit_stream_handle, ixheaace_huffman_tables *ptr_huffman_tbl) {
   69|   447k|  WORD32 i, sfb;
   70|   447k|  WORD32 dbg_val;
   71|       |
   72|   447k|  dbg_val = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
   73|       |
   74|  2.13M|  for (i = 0; i < pstr_section_data->num_of_sections; i++) {
  ------------------
  |  Branch (74:15): [True: 1.68M, False: 447k]
  ------------------
   75|  1.68M|    for (sfb = pstr_section_data->section[i].sfb_start;
   76|  14.2M|         sfb < pstr_section_data->section[i].sfb_start + pstr_section_data->section[i].sfb_cnt;
  ------------------
  |  Branch (76:10): [True: 12.5M, False: 1.68M]
  ------------------
   77|  12.5M|         sfb++) {
   78|  12.5M|      ia_enhaacplus_enc_code_values(ptr_quant_spectrum + pstr_sfb_offset[sfb],
   79|  12.5M|                                    pstr_sfb_offset[sfb + 1] - pstr_sfb_offset[sfb],
   80|  12.5M|                                    pstr_section_data->section[i].code_book,
   81|  12.5M|                                    pstr_bit_stream_handle, ptr_huffman_tbl);
   82|  12.5M|    }
   83|  1.68M|  }
   84|       |
   85|   447k|  return (ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle) - dbg_val);
   86|   447k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_single_channel_element_LFE:
  595|  21.3k|    ixheaace_temporal_noise_shaping_params pstr_tns_info, ixheaace_aac_tables *pstr_aac_tables) {
  596|  21.3k|  IA_ERRORCODE err_code;
  597|  21.3k|  switch (aot) {
  ------------------
  |  Branch (597:11): [True: 15.9k, False: 5.41k]
  ------------------
  598|  5.79k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  5.79k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (598:5): [True: 5.79k, False: 15.5k]
  ------------------
  599|  13.1k|    case AOT_SBR:
  ------------------
  |  |   35|  13.1k|#define AOT_SBR (5)
  ------------------
  |  Branch (599:5): [True: 7.32k, False: 13.9k]
  ------------------
  600|  13.1k|    case AOT_PS:
  ------------------
  |  |   39|  13.1k|#define AOT_PS (29)
  ------------------
  |  Branch (600:5): [True: 0, False: 21.3k]
  ------------------
  601|  13.1k|      ixheaace_write_bits(pstr_bit_stream_handle, ID_LFE, 3);
  602|  13.1k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  603|  13.1k|      break;
  604|       |
  605|  2.79k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  2.79k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (605:5): [True: 2.79k, False: 18.5k]
  ------------------
  606|  2.79k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  607|  2.79k|      break;
  608|  21.3k|  }
  609|       |
  610|  21.3k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  611|  21.3k|      0, pstr_qc_out_ch->win_shape, pstr_qc_out_ch->grouping_mask, ptr_sfb_offset,
  612|  21.3k|      pstr_qc_out_ch->scalefactor, pstr_qc_out_ch->max_val_in_sfb, pstr_qc_out_ch->global_gain,
  613|  21.3k|      pstr_qc_out_ch->quant_spec, &(pstr_qc_out_ch->section_data), pstr_bit_stream_handle, aot,
  614|  21.3k|      pstr_tns_info, pstr_aac_tables);
  615|       |
  616|  21.3k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|  21.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (616:7): [True: 46, False: 21.2k]
  ------------------
  617|     46|    return err_code;
  618|     46|  }
  619|  21.2k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  21.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  620|  21.3k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_channel_pair_element:
  459|   140k|    ixheaace_aac_tables *pstr_aac_tables) {
  460|   140k|  IA_ERRORCODE err_code;
  461|       |
  462|   140k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   281k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   251k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  50.6k|#define AOT_PS (29)
  ------------------
  |  Branch (462:7): [True: 30.0k, False: 110k]
  |  Branch (462:28): [True: 60.0k, False: 50.6k]
  |  Branch (462:46): [True: 0, False: 50.6k]
  ------------------
  463|  90.0k|    ixheaace_write_bits(pstr_bit_stream_handle, ID_CPE, 3);
  464|  90.0k|  }
  465|       |
  466|   140k|  switch (aot) {
  ------------------
  |  Branch (466:11): [True: 103k, False: 37.7k]
  ------------------
  467|  12.9k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  12.9k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (467:5): [True: 12.9k, False: 127k]
  ------------------
  468|  12.9k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  469|  12.9k|      ixheaace_write_bits(pstr_bit_stream_handle, 1, 1); /* common window */
  470|  12.9k|      break;
  471|       |
  472|  30.0k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  30.0k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (472:5): [True: 30.0k, False: 110k]
  ------------------
  473|  90.0k|    case AOT_SBR:
  ------------------
  |  |   35|  90.0k|#define AOT_SBR (5)
  ------------------
  |  Branch (473:5): [True: 60.0k, False: 80.7k]
  ------------------
  474|  90.0k|    case AOT_PS:
  ------------------
  |  |   39|  90.0k|#define AOT_PS (29)
  ------------------
  |  Branch (474:5): [True: 0, False: 140k]
  ------------------
  475|  90.0k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  476|  90.0k|      ixheaace_write_bits(pstr_bit_stream_handle, 1, 1);
  477|  90.0k|      break;
  478|   140k|  }
  479|       |
  480|   140k|  ia_enhaacplus_enc_encode_ics_info(pstr_qc_out_ch[0].section_data.block_type,
  481|   140k|                                    pstr_qc_out_ch[0].win_shape, pstr_qc_out_ch[0].grouping_mask,
  482|   140k|                                    &(pstr_qc_out_ch[0].section_data), pstr_bit_stream_handle,
  483|   140k|                                    aot);
  484|       |
  485|   140k|  ia_enhaacplus_enc_encode_ms_info(pstr_qc_out_ch[0].section_data.sfb_cnt,
  486|   140k|                                   pstr_qc_out_ch[0].section_data.sfb_per_group,
  487|   140k|                                   pstr_qc_out_ch[0].section_data.max_sfb_per_grp, ms_digest,
  488|   140k|                                   ms_flags, pstr_bit_stream_handle);
  489|   140k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  490|   140k|      1, pstr_qc_out_ch[0].win_shape, pstr_qc_out_ch[0].grouping_mask, pstr_sfb_offset[0],
  491|   140k|      pstr_qc_out_ch[0].scalefactor, pstr_qc_out_ch[0].max_val_in_sfb,
  492|   140k|      pstr_qc_out_ch[0].global_gain, pstr_qc_out_ch[0].quant_spec,
  493|   140k|      &(pstr_qc_out_ch[0].section_data), pstr_bit_stream_handle, aot, pstr_tns_info[0],
  494|   140k|      pstr_aac_tables);
  495|       |
  496|   140k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   140k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (496:7): [True: 337, False: 140k]
  ------------------
  497|    337|    return err_code;
  498|    337|  }
  499|       |
  500|   140k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  501|   140k|      1, pstr_qc_out_ch[1].win_shape, pstr_qc_out_ch[1].grouping_mask, pstr_sfb_offset[1],
  502|   140k|      pstr_qc_out_ch[1].scalefactor, pstr_qc_out_ch[1].max_val_in_sfb,
  503|   140k|      pstr_qc_out_ch[1].global_gain, pstr_qc_out_ch[1].quant_spec,
  504|   140k|      &(pstr_qc_out_ch[1].section_data), pstr_bit_stream_handle, aot, pstr_tns_info[1],
  505|   140k|      pstr_aac_tables);
  506|       |
  507|   140k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   140k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (507:7): [True: 75, False: 140k]
  ------------------
  508|     75|    return err_code;
  509|     75|  }
  510|       |
  511|   140k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   140k|#define IA_NO_ERROR 0x00000000
  ------------------
  512|   140k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_ms_info:
  232|   140k|                                             ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  233|   140k|  WORD32 sfb, sfb_offset;
  234|   140k|  UWORD32 tmp_var = 0;
  235|   140k|  WORD32 *jsflag;
  236|   140k|  UWORD8 num_of_bits, remaining = 0;
  237|       |
  238|   140k|  switch (ms_digest) {
  ------------------
  |  Branch (238:11): [True: 140k, False: 0]
  ------------------
  239|  24.4k|    case MS_NONE:
  ------------------
  |  Branch (239:5): [True: 24.4k, False: 116k]
  ------------------
  240|  24.4k|      ixheaace_write_bits(pstr_bit_stream_handle, SI_MS_MASK_NONE, 2);
  241|  24.4k|      break;
  242|       |
  243|  88.2k|    case MS_ALL:
  ------------------
  |  Branch (243:5): [True: 88.2k, False: 52.5k]
  ------------------
  244|  88.2k|      ixheaace_write_bits(pstr_bit_stream_handle, SI_MS_MASK_ALL, 2);
  245|  88.2k|      break;
  246|       |
  247|  28.1k|    case MS_SOME:
  ------------------
  |  Branch (247:5): [True: 28.1k, False: 112k]
  ------------------
  248|  28.1k|      ixheaace_write_bits(pstr_bit_stream_handle, SI_MS_MASK_SOME, 2);
  249|       |
  250|  28.1k|      if (max_sfb > 32) {
  ------------------
  |  Branch (250:11): [True: 5.29k, False: 22.8k]
  ------------------
  251|  5.29k|        num_of_bits = 32;
  252|  5.29k|        remaining = (UWORD8)(max_sfb - 32);
  253|  5.29k|      } else
  254|  22.8k|        num_of_bits = (UWORD8)max_sfb;
  255|       |
  256|  97.2k|      for (sfb_offset = 0; sfb_offset < sfb_cnt; sfb_offset += sfb_grp) {
  ------------------
  |  Branch (256:28): [True: 69.1k, False: 28.1k]
  ------------------
  257|  69.1k|        WORD8 flag;
  258|  69.1k|        jsflag = &js_flags[sfb_offset];
  259|  69.1k|        tmp_var = 0;
  260|       |
  261|  1.12M|        for (sfb = num_of_bits - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (261:37): [True: 1.06M, False: 69.1k]
  ------------------
  262|  1.06M|          flag = (WORD8)(*jsflag++);
  263|  1.06M|          tmp_var = ((tmp_var << 1) | flag);
  264|  1.06M|        }
  265|       |
  266|  69.1k|        ixheaace_write_bits(pstr_bit_stream_handle, tmp_var, num_of_bits);
  267|       |
  268|  69.1k|        if (remaining) {
  ------------------
  |  Branch (268:13): [True: 5.29k, False: 63.8k]
  ------------------
  269|  36.8k|          for (sfb = remaining - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (269:37): [True: 31.5k, False: 5.29k]
  ------------------
  270|  31.5k|            flag = (WORD8)(*jsflag++);
  271|  31.5k|            tmp_var = ((tmp_var << 1) | flag);
  272|  31.5k|          }
  273|       |
  274|  5.29k|          ixheaace_write_bits(pstr_bit_stream_handle, tmp_var, remaining);
  275|  5.29k|        }
  276|  69.1k|      }
  277|       |
  278|  28.1k|      break;
  279|   140k|  }
  280|   140k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_fill_element_LC:
  559|   287k|                                                    ixheaace_bit_buf_handle pstr_h_bit_stream) {
  560|   287k|  WORD32 i, cnt, esc_count;
  561|       |
  562|   615k|  while (total_fill_bits >= (3 + 4)) {
  ------------------
  |  Branch (562:10): [True: 328k, False: 287k]
  ------------------
  563|   328k|    cnt = MIN((total_fill_bits - (3 + 4)) / 8, ((1 << 4) - 1));
  ------------------
  |  |   23|   328k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 67.0k, False: 261k]
  |  |  ------------------
  ------------------
  564|       |
  565|   328k|    ixheaace_write_bits(pstr_h_bit_stream, ID_FIL, 3);
  566|       |
  567|   328k|    ixheaace_write_bits(pstr_h_bit_stream, cnt, 4);
  568|       |
  569|   328k|    total_fill_bits -= (3 + 4);
  570|       |
  571|   328k|    if (cnt == (1 << 4) - 1) {
  ------------------
  |  Branch (571:9): [True: 261k, False: 67.0k]
  ------------------
  572|   261k|      esc_count = MIN((total_fill_bits / 8) - ((1 << 4) - 1), (1 << 8) - 1);
  ------------------
  |  |   23|   261k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 108k, False: 152k]
  |  |  ------------------
  ------------------
  573|       |
  574|   261k|      ixheaace_write_bits(pstr_h_bit_stream, esc_count, 8);
  575|       |
  576|   261k|      total_fill_bits -= 8;
  577|       |
  578|   261k|      cnt += esc_count - 1;
  579|   261k|    }
  580|       |
  581|  48.4M|    for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (581:17): [True: 48.0M, False: 328k]
  ------------------
  582|  48.0M|      if (ptr_anc_bytes)
  ------------------
  |  Branch (582:11): [True: 2.27M, False: 45.8M]
  ------------------
  583|  2.27M|        ixheaace_write_bits(pstr_h_bit_stream, *ptr_anc_bytes++, 8);
  584|  45.8M|      else
  585|  45.8M|        ixheaace_write_bits(pstr_h_bit_stream, 0, 8);
  586|       |
  587|  48.0M|      total_fill_bits -= 8;
  588|  48.0M|    }
  589|   328k|  }
  590|   287k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_fill_element_LD:
  516|  62.6k|    ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  517|  62.6k|  WORD32 i, cnt, cnt1, remaining = 0;
  518|       |
  519|       |  /*
  520|       |    Write fill Element(s):
  521|       |    amount of a fill element can be 7+X*8 Bits, X element of [0..270]
  522|       |  */
  523|       |  // ID_FIL and the FILL element payload size, ( 3+ 4 bits) are not sent.
  524|       |  // but they are accounted in the earlier code, so subtracting it here
  525|       |
  526|  62.6k|  total_fill_bits -= 7;
  527|   178k|  while (total_fill_bits > 0) {
  ------------------
  |  Branch (527:10): [True: 116k, False: 62.6k]
  ------------------
  528|   116k|    cnt = MIN((total_fill_bits >> 3), ((1 << 4) - 1));
  ------------------
  |  |   23|   116k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 45.6k, False: 70.4k]
  |  |  ------------------
  ------------------
  529|       |
  530|   116k|    if (ptr_anc_bytes) {
  ------------------
  |  Branch (530:9): [True: 116k, False: 0]
  ------------------
  531|  1.56M|      for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (531:19): [True: 1.44M, False: 116k]
  ------------------
  532|  1.44M|        ixheaace_write_bits(pstr_bit_stream_handle, *ptr_anc_bytes++, 8);
  533|  1.44M|        total_fill_bits -= 8;
  534|  1.44M|      }
  535|   116k|      if (total_fill_bits < 8) {
  ------------------
  |  Branch (535:11): [True: 46.7k, False: 69.4k]
  ------------------
  536|  46.7k|        ixheaace_write_bits(pstr_bit_stream_handle, *ptr_anc_bytes++, (UWORD8)total_fill_bits);
  537|  46.7k|        ixheaace_write_bits(pstr_bit_stream_handle, 0, (UWORD8)(8 - total_fill_bits));
  538|  46.7k|        total_fill_bits = 0;
  539|  46.7k|      }
  540|   116k|    } else {
  541|      0|      cnt1 = cnt >> 2;
  542|      0|      remaining = cnt - (cnt1 << 2);
  543|       |
  544|      0|      for (i = 0; i < cnt1; i++) {
  ------------------
  |  Branch (544:19): [True: 0, False: 0]
  ------------------
  545|      0|        ixheaace_write_bits(pstr_bit_stream_handle, 0, 32);
  546|      0|        total_fill_bits -= 32;
  547|      0|      }
  548|      0|      if (remaining)
  ------------------
  |  Branch (548:11): [True: 0, False: 0]
  ------------------
  549|      0|        for (i = 0; i < remaining; i++) {
  ------------------
  |  Branch (549:21): [True: 0, False: 0]
  ------------------
  550|      0|          ixheaace_write_bits(pstr_bit_stream_handle, 0, 8);
  551|      0|          total_fill_bits -= 8;
  552|      0|        }
  553|      0|    }
  554|   116k|  }
  555|  62.6k|}

_Z13malloc_globaljj:
   42|  64.4k|pVOID malloc_global(UWORD32 size, UWORD32 alignment) {
   43|  64.4k|  pVOID ptr = NULL;
   44|  64.4k|  if (posix_memalign((VOID **)&ptr, alignment, size)) {
  ------------------
  |  Branch (44:7): [True: 0, False: 64.4k]
  ------------------
   45|       |    ptr = NULL;
   46|      0|  }
   47|  64.4k|  return ptr;
   48|  64.4k|}
_Z11free_globalPv:
   50|  56.2k|VOID free_global(pVOID ptr) { free(ptr); }
_Z31ia_enhaacplus_enc_pcm_data_readNSt3__16vectorIaNS_9allocatorIaEEEEjiPPs:
  686|  43.5k|                                             WORD32 num_channels, WORD16 **data) {
  687|  43.5k|  UWORD32 count = 0;
  688|  43.5k|  UWORD8 channel_no;
  689|  43.5k|  UWORD32 sample_no = 0;
  690|  43.5k|  UWORD32 i = 0;
  691|   191M|  while (count < num_samples) {
  ------------------
  |  Branch (691:10): [True: 191M, False: 43.5k]
  ------------------
  692|   191M|    sample_no = (count / num_channels);
  693|   191M|    channel_no = (UWORD8)(count % num_channels);
  694|   191M|    data[channel_no][sample_no] = *input_vec.data();
  695|   191M|    i++;
  696|   191M|    count++;
  697|   191M|  }
  698|  43.5k|  return 0;
  699|  43.5k|}
LLVMFuzzerTestOneInput:
  771|  8.18k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  772|  8.18k|  FuzzedDataProvider fuzzed_data(data, size);
  773|  8.18k|  FuzzedDataProvider fuzzed_data_loudness(data, size);
  774|       |
  775|       |  /* Error code */
  776|  8.18k|  IA_ERRORCODE err_code = 0;
  777|       |
  778|       |  /* API obj */
  779|  8.18k|  pVOID pv_ia_process_api_obj;
  780|       |
  781|  8.18k|  pWORD8 pb_inp_buf = NULL;
  782|  8.18k|  WORD32 input_size = 0;
  783|  8.18k|  WORD32 read_inp_data = 1;
  784|  8.18k|  WORD32 num_proc_iterations = 0;
  785|       |
  786|       |  /* ******************************************************************/
  787|       |  /* The API config structure                                         */
  788|       |  /* ******************************************************************/
  789|       |
  790|  8.18k|  ixheaace_user_config_struct str_enc_api{};
  791|       |
  792|  8.18k|  ixheaace_input_config *pstr_in_cfg = &str_enc_api.input_config;
  793|  8.18k|  ixheaace_output_config *pstr_out_cfg = &str_enc_api.output_config;
  794|  8.18k|  pstr_in_cfg->pv_drc_cfg = malloc_global(sizeof(ia_drc_input_config), DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  8.18k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
  795|  8.18k|  ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)pstr_in_cfg->pv_drc_cfg;
  796|  8.18k|  memset(pstr_drc_cfg, 0, sizeof(ia_drc_input_config));
  797|       |
  798|  8.18k|  pstr_out_cfg->malloc_xheaace = &malloc_global;
  799|  8.18k|  pstr_out_cfg->free_xheaace = &free_global;
  800|       |
  801|       |  /* ******************************************************************/
  802|       |  /* Parse input configuration parameters                             */
  803|       |  /* ******************************************************************/
  804|  8.18k|  ixheaace_fuzzer_flag(pstr_in_cfg, pstr_drc_cfg, &fuzzed_data, pstr_in_cfg->i_channels);
  805|       |
  806|       |  /*1st pass -> Loudness Measurement */
  807|  8.18k|  if (pstr_in_cfg->aot == AOT_USAC || pstr_in_cfg->usac_en) {
  ------------------
  |  |   38|  16.3k|#define AOT_USAC (42)
  ------------------
  |  Branch (807:7): [True: 142, False: 8.04k]
  |  Branch (807:39): [True: 5.13k, False: 2.90k]
  ------------------
  808|  5.27k|    err_code =
  809|  5.27k|        ixheaace_calculate_loudness_measure(pstr_in_cfg, pstr_out_cfg, &fuzzed_data_loudness);
  810|  5.27k|    if (err_code) {
  ------------------
  |  Branch (810:9): [True: 989, False: 4.29k]
  ------------------
  811|    989|      if (pstr_drc_cfg) {
  ------------------
  |  Branch (811:11): [True: 989, False: 0]
  ------------------
  812|    989|        free(pstr_drc_cfg);
  813|    989|        pstr_drc_cfg = NULL;
  814|    989|      }
  815|       |      /* Fatal error code */
  816|    989|      if (err_code & 0x80000000) {
  ------------------
  |  Branch (816:11): [True: 989, False: 0]
  ------------------
  817|    989|        ixheaace_delete((pVOID)pstr_out_cfg);
  818|    989|        return 0;
  819|    989|      }
  820|      0|      return -1;
  821|    989|    }
  822|  5.27k|  }
  823|       |
  824|  7.19k|  err_code = ixheaace_create((pVOID)pstr_in_cfg, (pVOID)pstr_out_cfg);
  825|  7.19k|  if (err_code) {
  ------------------
  |  Branch (825:7): [True: 1.71k, False: 5.48k]
  ------------------
  826|  1.71k|    if (pstr_drc_cfg) {
  ------------------
  |  Branch (826:9): [True: 1.71k, False: 0]
  ------------------
  827|  1.71k|      free(pstr_drc_cfg);
  828|  1.71k|      pstr_drc_cfg = NULL;
  829|  1.71k|    }
  830|       |    /* Fatal error code */
  831|  1.71k|    if (err_code & 0x80000000) {
  ------------------
  |  Branch (831:9): [True: 1.53k, False: 180]
  ------------------
  832|  1.53k|      ixheaace_delete((pVOID)pstr_out_cfg);
  833|  1.53k|      return 0;
  834|  1.53k|    }
  835|  1.71k|  }
  836|       |
  837|  5.66k|  pv_ia_process_api_obj = pstr_out_cfg->pv_ia_process_api_obj;
  838|  5.66k|  pb_inp_buf = (pWORD8)pstr_out_cfg->mem_info_table[IA_MEMTYPE_INPUT].mem_ptr;
  ------------------
  |  |   24|  5.66k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
  839|       |
  840|       |  /* End first part */
  841|       |
  842|       |  /* Second part        */
  843|       |  /* Initialize process */
  844|       |  /* Get config params  */
  845|       |
  846|  5.66k|  input_size = pstr_out_cfg->input_size;
  847|  5.66k|  memset(pb_inp_buf, 0, input_size);
  848|       |
  849|   513k|  while (fuzzed_data.remaining_bytes()) {
  ------------------
  |  Branch (849:10): [True: 508k, False: 5.36k]
  ------------------
  850|   508k|    if (read_inp_data) {
  ------------------
  |  Branch (850:9): [True: 452k, False: 56.0k]
  ------------------
  851|   452k|      if (fuzzed_data.ConsumeBool()) {
  ------------------
  |  Branch (851:11): [True: 99.3k, False: 352k]
  ------------------
  852|  99.3k|        std::vector<WORD8> input_vec = fuzzed_data.ConsumeBytes<WORD8>(input_size);
  853|  99.3k|        if (input_vec.size()) {
  ------------------
  |  Branch (853:13): [True: 89.7k, False: 9.57k]
  ------------------
  854|  89.7k|          memcpy(pb_inp_buf, input_vec.data(), input_vec.size());
  855|  89.7k|        }
  856|   352k|      } else {
  857|   352k|        memset(pb_inp_buf, fuzzed_data.ConsumeIntegral<WORD8>(), input_size);
  858|   352k|      }
  859|   452k|    }
  860|   508k|    ixheaace_process(pv_ia_process_api_obj, (pVOID)pstr_in_cfg, (pVOID)pstr_out_cfg);
  861|   508k|    num_proc_iterations++;
  862|   508k|    if (pstr_out_cfg->i_out_bytes == 0) {
  ------------------
  |  Branch (862:9): [True: 56.3k, False: 452k]
  ------------------
  863|  56.3k|      read_inp_data = 0;
  864|   452k|    } else {
  865|   452k|      read_inp_data = 1;
  866|   452k|    }
  867|       |    /* Stop processing after 500 frames */
  868|   508k|    if (num_proc_iterations > 500) break;
  ------------------
  |  Branch (868:9): [True: 295, False: 508k]
  ------------------
  869|   508k|  }
  870|       |
  871|  5.66k|  ixheaace_delete((pVOID)pstr_out_cfg);
  872|       |
  873|  5.66k|  if (pstr_drc_cfg) {
  ------------------
  |  Branch (873:7): [True: 5.48k, False: 180]
  ------------------
  874|  5.48k|    free(pstr_drc_cfg);
  875|  5.48k|  }
  876|  5.66k|  return 0;
  877|  7.19k|}
xaac_enc_fuzzer.cpp:_ZL20ixheaace_fuzzer_flagP21ixheaace_input_configP19ia_drc_input_configP18FuzzedDataProvideri:
  634|  8.18k|                                 FuzzedDataProvider *fuzzed_data, WORD32 in_ch) {
  635|       |  // Set Default value for AAC config structure
  636|       |
  637|  8.18k|  pstr_in_cfg->i_bitrate = fuzzed_data->ConsumeIntegral<WORD32>();
  638|  8.18k|  pstr_in_cfg->i_use_mps = fuzzed_data->ConsumeBool();
  639|  8.18k|  pstr_in_cfg->i_use_adts = fuzzed_data->ConsumeBool();
  640|  8.18k|  pstr_in_cfg->i_use_es = fuzzed_data->ConsumeBool();
  641|  8.18k|  pstr_in_cfg->aac_config.use_tns = fuzzed_data->ConsumeBool();
  642|  8.18k|  pstr_in_cfg->aac_config.noise_filling = fuzzed_data->ConsumeBool();
  643|  8.18k|  pstr_in_cfg->ui_pcm_wd_sz = fuzzed_data->ConsumeIntegral<WORD8>();
  644|  8.18k|  pstr_in_cfg->i_channels = fuzzed_data->ConsumeIntegral<WORD8>();
  645|  8.18k|  if (fuzzed_data->ConsumeBool()) {
  ------------------
  |  Branch (645:7): [True: 7.54k, False: 642]
  ------------------
  646|  7.54k|    pstr_in_cfg->i_samp_freq = fuzzed_data->PickValueInArray(k_sample_rates);
  647|  7.54k|  } else {
  648|    642|    pstr_in_cfg->i_samp_freq = fuzzed_data->ConsumeIntegral<UWORD32>();
  649|    642|  }
  650|  8.18k|  if (fuzzed_data->ConsumeBool()) {
  ------------------
  |  Branch (650:7): [True: 6.98k, False: 1.19k]
  ------------------
  651|  6.98k|    pstr_in_cfg->frame_length = fuzzed_data->PickValueInArray(k_frame_length);
  652|  6.98k|  } else {
  653|  1.19k|    pstr_in_cfg->frame_length = fuzzed_data->ConsumeIntegral<WORD16>();
  654|  1.19k|  }
  655|  8.18k|  pstr_in_cfg->aot = fuzzed_data->ConsumeIntegral<WORD8>();
  656|  8.18k|  pstr_in_cfg->esbr_flag = fuzzed_data->ConsumeBool();
  657|  8.18k|  pstr_in_cfg->aac_config.full_bandwidth = fuzzed_data->ConsumeBool();
  658|  8.18k|  pstr_in_cfg->aac_config.bitreservoir_size = fuzzed_data->ConsumeIntegral<WORD16>();
  659|  8.18k|  pstr_in_cfg->i_mps_tree_config = fuzzed_data->ConsumeIntegral<WORD8>();
  660|  8.18k|  pstr_in_cfg->i_channels_mask = fuzzed_data->ConsumeIntegral<WORD8>();
  661|  8.18k|  pstr_in_cfg->cplx_pred = fuzzed_data->ConsumeBool();
  662|  8.18k|  pstr_in_cfg->usac_en = fuzzed_data->ConsumeBool();
  663|  8.18k|  pstr_in_cfg->ccfl_idx = fuzzed_data->ConsumeIntegral<WORD8>();
  664|  8.18k|  pstr_in_cfg->pvc_active = fuzzed_data->ConsumeBool();
  665|  8.18k|  pstr_in_cfg->harmonic_sbr = fuzzed_data->ConsumeBool();
  666|  8.18k|  pstr_in_cfg->hq_esbr = fuzzed_data->ConsumeBool();
  667|  8.18k|  pstr_in_cfg->use_drc_element = fuzzed_data->ConsumeBool();
  668|  8.18k|  pstr_in_cfg->inter_tes_active = fuzzed_data->ConsumeBool();
  669|  8.18k|  pstr_in_cfg->codec_mode = fuzzed_data->ConsumeIntegral<WORD8>();
  670|  8.18k|  pstr_in_cfg->random_access_interval = fuzzed_data->ConsumeIntegral<WORD32>();
  671|  8.18k|  pstr_in_cfg->method_def = fuzzed_data->ConsumeIntegral<WORD32>();
  672|  8.18k|  pstr_in_cfg->measurement_system = fuzzed_data->ConsumeIntegral<WORD32>();
  673|  8.18k|  pstr_in_cfg->measured_loudness = fuzzed_data->ConsumeIntegral<WORD32>();
  674|  8.18k|  pstr_in_cfg->stream_id = fuzzed_data->ConsumeIntegral<UWORD16>();
  675|  8.18k|  pstr_in_cfg->use_delay_adjustment = fuzzed_data->ConsumeIntegral<WORD32>();
  676|       |  /* DRC */
  677|  8.18k|  if (pstr_in_cfg->use_drc_element == 1) {
  ------------------
  |  Branch (677:7): [True: 3.47k, False: 4.71k]
  ------------------
  678|  3.47k|    ixheaace_read_drc_config_params(&pstr_drc_cfg->str_enc_params,
  679|  3.47k|                                    &pstr_drc_cfg->str_uni_drc_config,
  680|  3.47k|                                    &pstr_drc_cfg->str_enc_loudness_info_set,
  681|  3.47k|                                    &pstr_drc_cfg->str_enc_gain_extension, fuzzed_data, in_ch);
  682|  3.47k|  }
  683|  8.18k|}
xaac_enc_fuzzer.cpp:_ZL31ixheaace_read_drc_config_paramsP24ia_drc_enc_params_structP28ia_drc_uni_drc_config_structP31ia_drc_loudness_info_set_structP30ia_drc_uni_drc_gain_ext_structP18FuzzedDataProvideri:
   56|  3.47k|    WORD32 in_ch) {
   57|  3.47k|  WORD32 n, g, s, m, ch, p;
   58|  3.47k|  WORD32 gain_set_channels;
   59|  3.47k|#ifdef LOUDNESS_LEVELING_SUPPORT
   60|  3.47k|  UWORD32 loudness_leveling_extension_present = 0;
   61|  3.47k|  UWORD32 config_extension_count = 0;
   62|  3.47k|#endif
   63|  3.47k|  pstr_enc_params->gain_sequence_present = fuzzed_data->ConsumeBool();
   64|  3.47k|  pstr_enc_params->delay_mode = fuzzed_data->ConsumeBool();
   65|  3.47k|  pstr_uni_drc_config->sample_rate_present = fuzzed_data->ConsumeBool();
   66|  3.47k|  pstr_uni_drc_config->str_drc_coefficients_uni_drc->drc_frame_size_present =
   67|  3.47k|      fuzzed_data->ConsumeBool();
   68|  3.47k|  pstr_uni_drc_config->loudness_info_set_present = fuzzed_data->ConsumeBool();
   69|       |
   70|  3.47k|  pstr_uni_drc_config->drc_instructions_uni_drc_count =
   71|  3.47k|      fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_DRC_INSTRUCTIONS_COUNT);
  ------------------
  |  |   31|  3.47k|#define MAX_DRC_INSTRUCTIONS_COUNT (MAX_DOWNMIX_INSTRUCTION_COUNT + 16)
  |  |  ------------------
  |  |  |  |   29|  3.47k|#define MAX_DOWNMIX_INSTRUCTION_COUNT (16)
  |  |  ------------------
  ------------------
   72|  21.7k|  for (n = 0; n < pstr_uni_drc_config->drc_instructions_uni_drc_count; n++) {
  ------------------
  |  Branch (72:15): [True: 18.2k, False: 3.47k]
  ------------------
   73|  18.2k|    ia_drc_instructions_uni_drc *pstr_drc_instructions_uni_drc =
   74|  18.2k|        &pstr_uni_drc_config->str_drc_instructions_uni_drc[n];
   75|  18.2k|    pstr_drc_instructions_uni_drc->drc_set_id = fuzzed_data->ConsumeIntegral<WORD8>();
   76|  18.2k|    pstr_drc_instructions_uni_drc->downmix_id = fuzzed_data->ConsumeIntegral<WORD8>();
   77|  18.2k|    pstr_drc_instructions_uni_drc->additional_downmix_id_present = fuzzed_data->ConsumeBool();
   78|  18.2k|    pstr_drc_instructions_uni_drc->additional_downmix_id_count =
   79|  18.2k|        fuzzed_data->ConsumeIntegral<WORD8>();
   80|  18.2k|    pstr_drc_instructions_uni_drc->drc_location = fuzzed_data->ConsumeIntegral<WORD8>();
   81|  18.2k|    pstr_drc_instructions_uni_drc->depends_on_drc_set_present = fuzzed_data->ConsumeBool();
   82|  18.2k|    pstr_drc_instructions_uni_drc->depends_on_drc_set = fuzzed_data->ConsumeIntegral<WORD8>();
   83|  18.2k|    pstr_drc_instructions_uni_drc->no_independent_use = fuzzed_data->ConsumeBool();
   84|  18.2k|    pstr_drc_instructions_uni_drc->drc_set_effect = fuzzed_data->ConsumeIntegral<WORD16>();
   85|  18.2k|    pstr_drc_instructions_uni_drc->drc_set_target_loudness_present = fuzzed_data->ConsumeBool();
   86|  18.2k|    pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_upper =
   87|  18.2k|        fuzzed_data->ConsumeIntegral<WORD8>();
   88|  18.2k|    pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower_present =
   89|  18.2k|        fuzzed_data->ConsumeBool();
   90|  18.2k|    pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower =
   91|  18.2k|        fuzzed_data->ConsumeIntegral<WORD8>();
   92|       |
   93|  18.2k|    gain_set_channels = fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_CHANNEL_COUNT);
  ------------------
  |  |   25|  18.2k|#define MAX_CHANNEL_COUNT (8)
  ------------------
   94|  70.7k|    for (ch = 0; ch < gain_set_channels; ch++) {
  ------------------
  |  Branch (94:18): [True: 52.4k, False: 18.2k]
  ------------------
   95|  52.4k|      pstr_drc_instructions_uni_drc->gain_set_index[ch] = fuzzed_data->ConsumeIntegral<WORD8>();
   96|  52.4k|    }
   97|   111k|    for (; ch < MAX_CHANNEL_COUNT; ch++) {
  ------------------
  |  |   25|   111k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (97:12): [True: 93.6k, False: 18.2k]
  ------------------
   98|  93.6k|      if (gain_set_channels > 0) {
  ------------------
  |  Branch (98:11): [True: 57.8k, False: 35.8k]
  ------------------
   99|  57.8k|        pstr_drc_instructions_uni_drc->gain_set_index[ch] =
  100|  57.8k|            pstr_drc_instructions_uni_drc->gain_set_index[gain_set_channels - 1];
  101|  57.8k|      } else {
  102|  35.8k|        pstr_drc_instructions_uni_drc->gain_set_index[ch] = 0;
  103|  35.8k|      }
  104|  93.6k|    }
  105|       |
  106|  18.2k|    pstr_drc_instructions_uni_drc->num_drc_channel_groups =
  107|  18.2k|        fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_CHANNEL_GROUP_COUNT);
  ------------------
  |  |   36|  18.2k|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|  18.2k|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
  108|  71.7k|    for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (108:17): [True: 53.4k, False: 18.2k]
  ------------------
  109|  53.4k|      pstr_drc_instructions_uni_drc->str_gain_modifiers[g].gain_scaling_present[0] =
  110|  53.4k|          fuzzed_data->ConsumeBool();
  111|  53.4k|      pstr_drc_instructions_uni_drc->str_gain_modifiers[g].attenuation_scaling[0] =
  112|  53.4k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  113|  53.4k|      pstr_drc_instructions_uni_drc->str_gain_modifiers[g].amplification_scaling[0] =
  114|  53.4k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  115|  53.4k|      pstr_drc_instructions_uni_drc->str_gain_modifiers[g].gain_offset_present[0] =
  116|  53.4k|          fuzzed_data->ConsumeBool();
  117|  53.4k|      pstr_drc_instructions_uni_drc->str_gain_modifiers[g].gain_offset[0] =
  118|  53.4k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  119|  53.4k|    }
  120|       |
  121|  18.2k|    pstr_drc_instructions_uni_drc->limiter_peak_target_present = fuzzed_data->ConsumeBool();
  122|  18.2k|    pstr_drc_instructions_uni_drc->limiter_peak_target =
  123|  18.2k|        fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  124|  18.2k|    pstr_drc_instructions_uni_drc->drc_instructions_type = fuzzed_data->ConsumeIntegral<WORD8>();
  125|  18.2k|    pstr_drc_instructions_uni_drc->mae_group_id = fuzzed_data->ConsumeIntegral<WORD8>();
  126|  18.2k|    pstr_drc_instructions_uni_drc->mae_group_preset_id = fuzzed_data->ConsumeIntegral<WORD8>();
  127|  18.2k|#ifdef LOUDNESS_LEVELING_SUPPORT
  128|  18.2k|    if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  18.2k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (128:9): [True: 8.64k, False: 9.62k]
  ------------------
  129|  8.64k|      pstr_drc_instructions_uni_drc->leveling_present = fuzzed_data->ConsumeBool();
  130|  8.64k|      pstr_drc_instructions_uni_drc->ducking_only_set_present = fuzzed_data->ConsumeBool();
  131|  8.64k|      loudness_leveling_extension_present = 1;
  132|  8.64k|    }
  133|  18.2k|#endif
  134|  18.2k|  }
  135|       |
  136|  3.47k|  pstr_uni_drc_config->drc_coefficients_uni_drc_count =
  137|  3.47k|      fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_DRC_COEFF_COUNT);
  ------------------
  |  |   30|  3.47k|#define MAX_DRC_COEFF_COUNT (7)
  ------------------
  138|  9.59k|  for (n = 0; n < pstr_uni_drc_config->drc_coefficients_uni_drc_count; n++) {
  ------------------
  |  Branch (138:15): [True: 6.11k, False: 3.47k]
  ------------------
  139|  6.11k|    ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc =
  140|  6.11k|        &pstr_uni_drc_config->str_drc_coefficients_uni_drc[n];
  141|  6.11k|    pstr_drc_coefficients_uni_drc->drc_location = fuzzed_data->ConsumeIntegral<WORD8>();
  142|  6.11k|    pstr_drc_coefficients_uni_drc->gain_set_count =
  143|  6.11k|        fuzzed_data->ConsumeIntegralInRange<WORD8>(0, GAIN_SET_COUNT_MAX);
  ------------------
  |  |   49|  6.11k|#define GAIN_SET_COUNT_MAX 8                         /* reduced size */
  ------------------
  144|  18.0k|    for (s = 0; s < pstr_drc_coefficients_uni_drc->gain_set_count; s++) {
  ------------------
  |  Branch (144:17): [True: 11.9k, False: 6.11k]
  ------------------
  145|  11.9k|      pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_coding_profile =
  146|  11.9k|          fuzzed_data->ConsumeIntegral<WORD8>();
  147|  11.9k|      pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_interpolation_type =
  148|  11.9k|          fuzzed_data->ConsumeBool();
  149|  11.9k|      pstr_drc_coefficients_uni_drc->str_gain_set_params[s].full_frame =
  150|  11.9k|          fuzzed_data->ConsumeBool();
  151|  11.9k|      pstr_drc_coefficients_uni_drc->str_gain_set_params[s].time_alignment =
  152|  11.9k|          fuzzed_data->ConsumeBool();
  153|  11.9k|      pstr_drc_coefficients_uni_drc->str_gain_set_params[s].time_delta_min_present =
  154|  11.9k|          fuzzed_data->ConsumeBool();
  155|  11.9k|      pstr_drc_coefficients_uni_drc->str_gain_set_params[s].band_count =
  156|  11.9k|          fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_BAND_COUNT);
  ------------------
  |  |   26|  11.9k|#define MAX_BAND_COUNT (8)
  ------------------
  157|  11.9k|      if (pstr_drc_coefficients_uni_drc->str_gain_set_params[s].band_count == 1) {
  ------------------
  |  Branch (157:11): [True: 2.74k, False: 9.21k]
  ------------------
  158|  2.74k|        pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].nb_points =
  159|  2.74k|            fuzzed_data->ConsumeIntegralInRange<WORD16>(0, MAX_GAIN_POINTS);
  ------------------
  |  |   44|  2.74k|#define MAX_GAIN_POINTS (256)
  ------------------
  160|  2.74k|        for (p = 0;
  161|  83.0k|             p < pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].nb_points;
  ------------------
  |  Branch (161:14): [True: 80.3k, False: 2.74k]
  ------------------
  162|  80.3k|             p++) {
  163|  80.3k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].gain_points[p].x =
  164|  80.3k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  165|  80.3k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].gain_points[p].y =
  166|  80.3k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  167|  80.3k|        }
  168|  2.74k|        pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].width =
  169|  2.74k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  170|  2.74k|        pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].attack =
  171|  2.74k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  172|  2.74k|        pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].decay =
  173|  2.74k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  174|  2.74k|        pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[0].drc_characteristic =
  175|  2.74k|            fuzzed_data->ConsumeIntegral<WORD8>();
  176|  2.74k|        pstr_drc_coefficients_uni_drc->str_gain_set_params[s]
  177|  2.74k|            .gain_params[0]
  178|  2.74k|            .crossover_freq_index = fuzzed_data->ConsumeIntegral<WORD8>();
  179|  9.21k|      } else {
  180|  39.3k|        for (m = 0; m < pstr_drc_coefficients_uni_drc->str_gain_set_params[s].band_count; m++) {
  ------------------
  |  Branch (180:21): [True: 30.0k, False: 9.21k]
  ------------------
  181|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[m].nb_points =
  182|  30.0k|              fuzzed_data->ConsumeIntegralInRange<WORD16>(0, MAX_GAIN_POINTS);
  ------------------
  |  |   44|  30.0k|#define MAX_GAIN_POINTS (256)
  ------------------
  183|  30.0k|          for (p = 0;
  184|   973k|               p < pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[m].nb_points;
  ------------------
  |  Branch (184:16): [True: 942k, False: 30.0k]
  ------------------
  185|   942k|               p++) {
  186|   942k|            pstr_drc_coefficients_uni_drc->str_gain_set_params[s]
  187|   942k|                .gain_params[m]
  188|   942k|                .gain_points[p]
  189|   942k|                .x = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  190|   942k|            pstr_drc_coefficients_uni_drc->str_gain_set_params[s]
  191|   942k|                .gain_params[m]
  192|   942k|                .gain_points[p]
  193|   942k|                .y = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  194|   942k|          }
  195|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[m].width =
  196|  30.0k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  197|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[m].attack =
  198|  30.0k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  199|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].gain_params[m].decay =
  200|  30.0k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  201|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s].drc_band_type =
  202|  30.0k|              fuzzed_data->ConsumeBool();
  203|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s]
  204|  30.0k|              .gain_params[m]
  205|  30.0k|              .start_sub_band_index = fuzzed_data->ConsumeIntegral<WORD16>();
  206|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s]
  207|  30.0k|              .gain_params[m]
  208|  30.0k|              .drc_characteristic = fuzzed_data->ConsumeIntegral<WORD8>();
  209|  30.0k|          pstr_drc_coefficients_uni_drc->str_gain_set_params[s]
  210|  30.0k|              .gain_params[m]
  211|  30.0k|              .crossover_freq_index = fuzzed_data->ConsumeIntegral<WORD8>();
  212|  30.0k|        }
  213|  9.21k|      }
  214|  11.9k|    }
  215|  6.11k|  }
  216|       |
  217|  3.47k|  pstr_enc_loudness_info_set->loudness_info_count =
  218|  3.47k|      fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_LOUDNESS_INFO_COUNT);
  ------------------
  |  |   32|  3.47k|#define MAX_LOUDNESS_INFO_COUNT (MAX_DOWNMIX_INSTRUCTION_COUNT + 16)
  |  |  ------------------
  |  |  |  |   29|  3.47k|#define MAX_DOWNMIX_INSTRUCTION_COUNT (16)
  |  |  ------------------
  ------------------
  219|  19.8k|  for (n = 0; n < pstr_enc_loudness_info_set->loudness_info_count; n++) {
  ------------------
  |  Branch (219:15): [True: 16.4k, False: 3.47k]
  ------------------
  220|  16.4k|    pstr_enc_loudness_info_set->str_loudness_info[n].drc_set_id =
  221|  16.4k|        fuzzed_data->ConsumeIntegral<WORD8>();
  222|  16.4k|    pstr_enc_loudness_info_set->str_loudness_info[n].downmix_id =
  223|  16.4k|        fuzzed_data->ConsumeIntegral<WORD8>();
  224|  16.4k|    pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level_present =
  225|  16.4k|        fuzzed_data->ConsumeBool();
  226|  16.4k|    if (1 == pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level_present) {
  ------------------
  |  Branch (226:9): [True: 8.62k, False: 7.79k]
  ------------------
  227|  8.62k|      pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level =
  228|  8.62k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  229|  8.62k|    }
  230|  16.4k|    pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level_present =
  231|  16.4k|        fuzzed_data->ConsumeBool();
  232|  16.4k|    if (1 == pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level_present) {
  ------------------
  |  Branch (232:9): [True: 8.95k, False: 7.46k]
  ------------------
  233|  8.95k|      pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level =
  234|  8.95k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  235|  8.95k|      pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level_measurement_system =
  236|  8.95k|          fuzzed_data->ConsumeIntegral<WORD8>();
  237|  8.95k|      pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level_reliability =
  238|  8.95k|          fuzzed_data->ConsumeIntegral<WORD8>();
  239|  8.95k|    }
  240|       |
  241|  16.4k|    pstr_enc_loudness_info_set->str_loudness_info[n].measurement_count =
  242|  16.4k|        fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_MEASUREMENT_COUNT);
  ------------------
  |  |   28|  16.4k|#define MAX_MEASUREMENT_COUNT (15)
  ------------------
  243|   137k|    for (m = 0; m < pstr_enc_loudness_info_set->str_loudness_info[n].measurement_count; m++) {
  ------------------
  |  Branch (243:17): [True: 120k, False: 16.4k]
  ------------------
  244|   120k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].method_definition =
  245|   120k|          fuzzed_data->ConsumeIntegral<WORD8>();
  246|   120k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].method_value =
  247|   120k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  248|   120k|      pstr_enc_loudness_info_set->str_loudness_info[n]
  249|   120k|          .str_loudness_measure[m]
  250|   120k|          .measurement_system = fuzzed_data->ConsumeIntegral<WORD8>();
  251|   120k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].reliability =
  252|   120k|          fuzzed_data->ConsumeIntegral<WORD8>();
  253|   120k|    }
  254|  16.4k|  }
  255|       |
  256|  3.47k|  pstr_enc_loudness_info_set->loudness_info_album_count =
  257|  3.47k|      fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_LOUDNESS_INFO_COUNT);
  ------------------
  |  |   32|  3.47k|#define MAX_LOUDNESS_INFO_COUNT (MAX_DOWNMIX_INSTRUCTION_COUNT + 16)
  |  |  ------------------
  |  |  |  |   29|  3.47k|#define MAX_DOWNMIX_INSTRUCTION_COUNT (16)
  |  |  ------------------
  ------------------
  258|  22.4k|  for (n = 0; n < pstr_enc_loudness_info_set->loudness_info_album_count; n++) {
  ------------------
  |  Branch (258:15): [True: 18.9k, False: 3.47k]
  ------------------
  259|  18.9k|    pstr_enc_loudness_info_set->str_loudness_info_album[n].drc_set_id =
  260|  18.9k|        fuzzed_data->ConsumeIntegral<WORD8>();
  261|  18.9k|    pstr_enc_loudness_info_set->str_loudness_info_album[n].downmix_id =
  262|  18.9k|        fuzzed_data->ConsumeIntegral<WORD8>();
  263|  18.9k|    pstr_enc_loudness_info_set->str_loudness_info_album[n].sample_peak_level_present =
  264|  18.9k|        fuzzed_data->ConsumeBool();
  265|  18.9k|    if (1 == pstr_enc_loudness_info_set->str_loudness_info_album[n].sample_peak_level_present) {
  ------------------
  |  Branch (265:9): [True: 9.19k, False: 9.73k]
  ------------------
  266|  9.19k|      pstr_enc_loudness_info_set->str_loudness_info_album[n].sample_peak_level =
  267|  9.19k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  268|  9.19k|    }
  269|  18.9k|    pstr_enc_loudness_info_set->str_loudness_info_album[n].true_peak_level_present =
  270|  18.9k|        fuzzed_data->ConsumeBool();
  271|  18.9k|    if (1 == pstr_enc_loudness_info_set->str_loudness_info_album[n].true_peak_level_present) {
  ------------------
  |  Branch (271:9): [True: 10.6k, False: 8.23k]
  ------------------
  272|  10.6k|      pstr_enc_loudness_info_set->str_loudness_info_album[n].true_peak_level =
  273|  10.6k|          fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  274|  10.6k|      pstr_enc_loudness_info_set->str_loudness_info_album[n].true_peak_level_measurement_system =
  275|  10.6k|          fuzzed_data->ConsumeIntegral<WORD8>();
  276|  10.6k|      pstr_enc_loudness_info_set->str_loudness_info_album[n].true_peak_level_reliability =
  277|  10.6k|          fuzzed_data->ConsumeIntegral<WORD8>();
  278|  10.6k|    }
  279|       |
  280|  18.9k|    pstr_enc_loudness_info_set->str_loudness_info_album[n].measurement_count =
  281|  18.9k|        fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_MEASUREMENT_COUNT);
  ------------------
  |  |   28|  18.9k|#define MAX_MEASUREMENT_COUNT (15)
  ------------------
  282|   147k|    for (m = 0; m < pstr_enc_loudness_info_set->str_loudness_info_album[n].measurement_count;
  ------------------
  |  Branch (282:17): [True: 128k, False: 18.9k]
  ------------------
  283|   128k|         m++) {
  284|   128k|      pstr_enc_loudness_info_set->str_loudness_info_album[n]
  285|   128k|          .str_loudness_measure[m]
  286|   128k|          .method_definition = fuzzed_data->ConsumeIntegral<WORD8>();
  287|   128k|      pstr_enc_loudness_info_set->str_loudness_info_album[n]
  288|   128k|          .str_loudness_measure[m]
  289|   128k|          .method_value = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  290|   128k|      pstr_enc_loudness_info_set->str_loudness_info_album[n]
  291|   128k|          .str_loudness_measure[m]
  292|   128k|          .measurement_system = fuzzed_data->ConsumeIntegral<WORD8>();
  293|   128k|      pstr_enc_loudness_info_set->str_loudness_info_album[n].str_loudness_measure[m].reliability =
  294|   128k|          fuzzed_data->ConsumeIntegral<WORD8>();
  295|   128k|    }
  296|  18.9k|  }
  297|       |
  298|  3.47k|  pstr_uni_drc_config->str_channel_layout.layout_signaling_present = fuzzed_data->ConsumeBool();
  299|  3.47k|  pstr_uni_drc_config->str_channel_layout.defined_layout = fuzzed_data->ConsumeIntegral<WORD8>();
  300|  3.47k|  pstr_uni_drc_config->str_channel_layout.speaker_position[0] =
  301|  3.47k|      fuzzed_data->ConsumeIntegral<WORD8>();
  302|       |
  303|  3.47k|  pstr_uni_drc_config->downmix_instructions_count =
  304|  3.47k|      fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_DOWNMIX_INSTRUCTION_COUNT);
  ------------------
  |  |   29|  3.47k|#define MAX_DOWNMIX_INSTRUCTION_COUNT (16)
  ------------------
  305|  13.1k|  for (n = 0; n < pstr_uni_drc_config->downmix_instructions_count; n++) {
  ------------------
  |  Branch (305:15): [True: 9.69k, False: 3.47k]
  ------------------
  306|  9.69k|    pstr_uni_drc_config->str_downmix_instructions[n].target_layout =
  307|  9.69k|        fuzzed_data->ConsumeIntegral<WORD8>();
  308|  9.69k|    pstr_uni_drc_config->str_downmix_instructions[n].downmix_coefficients_present =
  309|  9.69k|        fuzzed_data->ConsumeBool();
  310|  9.69k|  }
  311|       |
  312|  3.47k|  pstr_uni_drc_config->drc_description_basic_present = fuzzed_data->ConsumeBool();
  313|  3.47k|  pstr_uni_drc_config->uni_drc_config_ext_present = fuzzed_data->ConsumeBool();
  314|  3.47k|  pstr_enc_loudness_info_set->loudness_info_set_ext_present = fuzzed_data->ConsumeBool();
  315|  3.47k|  pstr_enc_gain_extension->uni_drc_gain_ext_present = fuzzed_data->ConsumeBool();
  316|       |
  317|  3.47k|  if (pstr_uni_drc_config->uni_drc_config_ext_present == 1) {
  ------------------
  |  Branch (317:7): [True: 1.66k, False: 1.81k]
  ------------------
  318|  1.66k|#ifdef LOUDNESS_LEVELING_SUPPORT
  319|  1.66k|    pstr_uni_drc_config->str_uni_drc_config_ext.uni_drc_config_ext_type[config_extension_count] =
  320|  1.66k|        UNIDRC_CONF_EXT_V1;
  ------------------
  |  |   51|  1.66k|#define UNIDRC_CONF_EXT_V1 (0x2)
  ------------------
  321|  1.66k|    config_extension_count++;
  322|       |#else
  323|       |    pstr_uni_drc_config->str_uni_drc_config_ext.uni_drc_config_ext_type[0] = UNIDRC_CONF_EXT_V1;
  324|       |#endif
  325|  1.66k|    pstr_uni_drc_config->str_uni_drc_config_ext.downmix_instructions_v1_present =
  326|  1.66k|        fuzzed_data->ConsumeBool();
  327|  1.66k|    if (pstr_uni_drc_config->str_uni_drc_config_ext.downmix_instructions_v1_present == 1) {
  ------------------
  |  Branch (327:9): [True: 847, False: 817]
  ------------------
  328|       |      /***********  str_downmix_instructions_v1  *************/
  329|       |
  330|    847|      pstr_uni_drc_config->str_uni_drc_config_ext.downmix_instructions_v1_count =
  331|    847|          fuzzed_data->ConsumeIntegralInRange<WORD8>(0, DOWNMIX_INSTRUCTIONS_COUNT_MAX);
  ------------------
  |  |   70|    847|#define DOWNMIX_INSTRUCTIONS_COUNT_MAX 8       /* reduced size */
  ------------------
  332|  3.75k|      for (n = 0; n < pstr_uni_drc_config->str_uni_drc_config_ext.downmix_instructions_v1_count;
  ------------------
  |  Branch (332:19): [True: 2.90k, False: 847]
  ------------------
  333|  2.90k|           n++) {
  334|  2.90k|        ia_drc_downmix_instructions_struct *pstr_downmix_instructions_v1 =
  335|  2.90k|            &pstr_uni_drc_config->str_uni_drc_config_ext.str_downmix_instructions_v1[n];
  336|  2.90k|        pstr_downmix_instructions_v1->downmix_id = fuzzed_data->ConsumeIntegral<WORD8>();
  337|  2.90k|        ;
  338|  2.90k|        pstr_downmix_instructions_v1->target_ch_count = fuzzed_data->ConsumeIntegral<WORD8>();
  339|  2.90k|        pstr_downmix_instructions_v1->target_layout = fuzzed_data->ConsumeIntegral<WORD8>();
  340|  2.90k|        pstr_downmix_instructions_v1->downmix_coefficients_present = fuzzed_data->ConsumeBool();
  341|  2.90k|        if (pstr_downmix_instructions_v1->downmix_coefficients_present) {
  ------------------
  |  Branch (341:13): [True: 2.35k, False: 553]
  ------------------
  342|  2.35k|          FLOAT32 dwn_mix_coeff = 0.0f;
  343|  67.3k|          for (s = 0; s < pstr_downmix_instructions_v1->target_layout; s++) {
  ------------------
  |  Branch (343:23): [True: 65.0k, False: 2.35k]
  ------------------
  344|  65.0k|            dwn_mix_coeff = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  345|  65.0k|            for (ch = 0; ch < in_ch; ch++) {
  ------------------
  |  Branch (345:26): [True: 0, False: 65.0k]
  ------------------
  346|      0|              pstr_downmix_instructions_v1->downmix_coeff[in_ch * s + ch] = dwn_mix_coeff;
  347|      0|            }
  348|  65.0k|          }
  349|  2.35k|        }
  350|  2.90k|      }
  351|    847|    }
  352|       |
  353|  1.66k|    pstr_uni_drc_config->str_uni_drc_config_ext.drc_coeffs_and_instructions_uni_drc_v1_present =
  354|  1.66k|        fuzzed_data->ConsumeBool();
  355|  1.66k|    if (pstr_uni_drc_config->str_uni_drc_config_ext
  ------------------
  |  Branch (355:9): [True: 1.51k, False: 146]
  ------------------
  356|  1.66k|            .drc_coeffs_and_instructions_uni_drc_v1_present == 1) {
  357|       |      /***********  str_drc_coefficients_uni_drc_v1  *************/
  358|       |
  359|  1.51k|      pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count =
  360|  1.51k|          fuzzed_data->ConsumeIntegralInRange<WORD8>(0, DRC_COEFFICIENTS_UNIDRC_V1_COUNT_MAX);
  ------------------
  |  |   71|  1.51k|#define DRC_COEFFICIENTS_UNIDRC_V1_COUNT_MAX 2 /* reduced size */
  ------------------
  361|  1.51k|      for (n = 0;
  362|  3.57k|           n < pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count;
  ------------------
  |  Branch (362:12): [True: 2.06k, False: 1.51k]
  ------------------
  363|  2.06k|           n++) {
  364|  2.06k|        ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc_v1 =
  365|  2.06k|            &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[n];
  366|  2.06k|        pstr_drc_coefficients_uni_drc_v1->drc_location = fuzzed_data->ConsumeIntegral<WORD8>();
  367|  2.06k|        pstr_drc_coefficients_uni_drc_v1->gain_set_count =
  368|  2.06k|            fuzzed_data->ConsumeIntegralInRange<WORD8>(0, GAIN_SET_COUNT_MAX);
  ------------------
  |  |   49|  2.06k|#define GAIN_SET_COUNT_MAX 8                         /* reduced size */
  ------------------
  369|  7.95k|        for (s = 0; s < pstr_drc_coefficients_uni_drc_v1->gain_set_count; s++) {
  ------------------
  |  Branch (369:21): [True: 5.89k, False: 2.06k]
  ------------------
  370|  5.89k|          pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_coding_profile =
  371|  5.89k|              fuzzed_data->ConsumeIntegral<WORD8>();
  372|  5.89k|          pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_interpolation_type =
  373|  5.89k|              fuzzed_data->ConsumeBool();
  374|  5.89k|          pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].full_frame =
  375|  5.89k|              fuzzed_data->ConsumeBool();
  376|  5.89k|          pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].time_alignment =
  377|  5.89k|              fuzzed_data->ConsumeBool();
  378|  5.89k|          pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].time_delta_min_present =
  379|  5.89k|              fuzzed_data->ConsumeBool();
  380|  5.89k|          pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].band_count =
  381|  5.89k|              fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_BAND_COUNT);
  ------------------
  |  |   26|  5.89k|#define MAX_BAND_COUNT (8)
  ------------------
  382|  5.89k|          if (pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].band_count == 1) {
  ------------------
  |  Branch (382:15): [True: 1.68k, False: 4.20k]
  ------------------
  383|  1.68k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[0].nb_points =
  384|  1.68k|                fuzzed_data->ConsumeIntegralInRange<WORD16>(0, MAX_GAIN_POINTS);
  ------------------
  |  |   44|  1.68k|#define MAX_GAIN_POINTS (256)
  ------------------
  385|  44.4k|            for (p = 0; p < pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  ------------------
  |  Branch (385:25): [True: 42.7k, False: 1.68k]
  ------------------
  386|  44.4k|                                .gain_params[0]
  387|  44.4k|                                .nb_points;
  388|  42.7k|                 p++) {
  389|  42.7k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  390|  42.7k|                  .gain_params[0]
  391|  42.7k|                  .gain_points[p]
  392|  42.7k|                  .x = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  393|  42.7k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  394|  42.7k|                  .gain_params[0]
  395|  42.7k|                  .gain_points[p]
  396|  42.7k|                  .y = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  397|  42.7k|            }
  398|  1.68k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[0].width =
  399|  1.68k|                fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  400|  1.68k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[0].attack =
  401|  1.68k|                fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  402|  1.68k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[0].decay =
  403|  1.68k|                fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  404|  1.68k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  405|  1.68k|                .gain_params[0]
  406|  1.68k|                .drc_characteristic = fuzzed_data->ConsumeIntegral<WORD8>();
  407|  1.68k|            ;
  408|  1.68k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  409|  1.68k|                .gain_params[0]
  410|  1.68k|                .crossover_freq_index = fuzzed_data->ConsumeIntegral<WORD8>();
  411|  4.20k|          } else {
  412|  17.8k|            for (m = 0; m < pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].band_count;
  ------------------
  |  Branch (412:25): [True: 13.6k, False: 4.20k]
  ------------------
  413|  13.6k|                 m++) {
  414|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[m].nb_points =
  415|  13.6k|                  fuzzed_data->ConsumeIntegralInRange<WORD16>(0, MAX_GAIN_POINTS);
  ------------------
  |  |   44|  13.6k|#define MAX_GAIN_POINTS (256)
  ------------------
  416|   396k|              for (p = 0; p < pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  ------------------
  |  Branch (416:27): [True: 382k, False: 13.6k]
  ------------------
  417|   396k|                                  .gain_params[m]
  418|   396k|                                  .nb_points;
  419|   382k|                   p++) {
  420|   382k|                pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  421|   382k|                    .gain_params[m]
  422|   382k|                    .gain_points[p]
  423|   382k|                    .x = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  424|   382k|                pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  425|   382k|                    .gain_params[m]
  426|   382k|                    .gain_points[p]
  427|   382k|                    .y = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  428|   382k|              }
  429|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[m].width =
  430|  13.6k|                  fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  431|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[m].attack =
  432|  13.6k|                  fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  433|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].gain_params[m].decay =
  434|  13.6k|                  fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  435|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s].drc_band_type = 0;
  436|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  437|  13.6k|                  .gain_params[m]
  438|  13.6k|                  .start_sub_band_index = fuzzed_data->ConsumeIntegral<WORD16>();
  439|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  440|  13.6k|                  .gain_params[m]
  441|  13.6k|                  .drc_characteristic = fuzzed_data->ConsumeIntegral<WORD8>();
  442|  13.6k|              ;
  443|  13.6k|              pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[s]
  444|  13.6k|                  .gain_params[m]
  445|  13.6k|                  .crossover_freq_index = fuzzed_data->ConsumeIntegral<WORD8>();
  446|  13.6k|            }
  447|  4.20k|          }
  448|  5.89k|        }
  449|  2.06k|      }
  450|       |
  451|       |      /***********  str_drc_instructions_uni_drc_v1  *************/
  452|  1.51k|      pstr_uni_drc_config->str_uni_drc_config_ext.drc_instructions_uni_drc_v1_count =
  453|  1.51k|          fuzzed_data->ConsumeIntegralInRange<WORD8>(0, DRC_INSTRUCTIONS_UNIDRC_V1_COUNT_MAX);
  ------------------
  |  |   72|  1.51k|#define DRC_INSTRUCTIONS_UNIDRC_V1_COUNT_MAX 8 /* reduced size */
  ------------------
  454|  1.51k|      for (n = 0;
  455|  5.36k|           n < pstr_uni_drc_config->str_uni_drc_config_ext.drc_instructions_uni_drc_v1_count;
  ------------------
  |  Branch (455:12): [True: 3.84k, False: 1.51k]
  ------------------
  456|  3.84k|           n++) {
  457|  3.84k|        ia_drc_instructions_uni_drc *pstr_drc_instructions_uni_drc =
  458|  3.84k|            &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[n];
  459|  3.84k|        pstr_drc_instructions_uni_drc->drc_set_id = fuzzed_data->ConsumeIntegral<WORD8>();
  460|  3.84k|        pstr_drc_instructions_uni_drc->downmix_id = fuzzed_data->ConsumeIntegral<WORD8>();
  461|  3.84k|        pstr_drc_instructions_uni_drc->additional_downmix_id_present = fuzzed_data->ConsumeBool();
  462|  3.84k|        pstr_drc_instructions_uni_drc->additional_downmix_id_count =
  463|  3.84k|            fuzzed_data->ConsumeIntegral<WORD8>();
  464|  3.84k|        pstr_drc_instructions_uni_drc->drc_location = fuzzed_data->ConsumeIntegral<WORD8>();
  465|  3.84k|        pstr_drc_instructions_uni_drc->depends_on_drc_set_present = fuzzed_data->ConsumeBool();
  466|  3.84k|        pstr_drc_instructions_uni_drc->depends_on_drc_set = fuzzed_data->ConsumeIntegral<WORD8>();
  467|  3.84k|        pstr_drc_instructions_uni_drc->no_independent_use = fuzzed_data->ConsumeBool();
  468|  3.84k|        pstr_drc_instructions_uni_drc->drc_set_effect = fuzzed_data->ConsumeIntegral<WORD16>();
  469|  3.84k|        pstr_drc_instructions_uni_drc->drc_set_target_loudness_present =
  470|  3.84k|            fuzzed_data->ConsumeBool();
  471|  3.84k|        pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_upper =
  472|  3.84k|            fuzzed_data->ConsumeIntegral<WORD8>();
  473|  3.84k|        pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower_present =
  474|  3.84k|            fuzzed_data->ConsumeBool();
  475|  3.84k|        pstr_drc_instructions_uni_drc->drc_set_target_loudness_value_lower =
  476|  3.84k|            fuzzed_data->ConsumeIntegral<WORD8>();
  477|       |
  478|  3.84k|        gain_set_channels = fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_CHANNEL_COUNT);
  ------------------
  |  |   25|  3.84k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  479|  15.4k|        for (ch = 0; ch < gain_set_channels; ch++) {
  ------------------
  |  Branch (479:22): [True: 11.5k, False: 3.84k]
  ------------------
  480|  11.5k|          pstr_drc_instructions_uni_drc->gain_set_index[ch] =
  481|  11.5k|              fuzzed_data->ConsumeIntegral<WORD8>();
  482|  11.5k|        }
  483|  23.0k|        for (; ch < MAX_CHANNEL_COUNT; ch++) {
  ------------------
  |  |   25|  23.0k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (483:16): [True: 19.2k, False: 3.84k]
  ------------------
  484|  19.2k|          if (gain_set_channels > 0) {
  ------------------
  |  Branch (484:15): [True: 11.5k, False: 7.65k]
  ------------------
  485|  11.5k|            pstr_drc_instructions_uni_drc->gain_set_index[ch] =
  486|  11.5k|                pstr_drc_instructions_uni_drc->gain_set_index[gain_set_channels - 1];
  487|  11.5k|          } else {
  488|  7.65k|            pstr_drc_instructions_uni_drc->gain_set_index[ch] = 0;
  489|  7.65k|          }
  490|  19.2k|        }
  491|       |
  492|  3.84k|        pstr_drc_instructions_uni_drc->num_drc_channel_groups =
  493|  3.84k|            fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_CHANNEL_GROUP_COUNT);
  ------------------
  |  |   36|  3.84k|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|  3.84k|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
  494|  15.1k|        for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (494:21): [True: 11.2k, False: 3.84k]
  ------------------
  495|  11.2k|          pstr_drc_instructions_uni_drc->str_gain_modifiers[g].gain_scaling_present[0] =
  496|  11.2k|              fuzzed_data->ConsumeBool();
  497|  11.2k|          pstr_drc_instructions_uni_drc->str_gain_modifiers[g].attenuation_scaling[0] =
  498|  11.2k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  499|  11.2k|          pstr_drc_instructions_uni_drc->str_gain_modifiers[g].amplification_scaling[0] =
  500|  11.2k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  501|  11.2k|          pstr_drc_instructions_uni_drc->str_gain_modifiers[g].gain_offset_present[0] =
  502|  11.2k|              fuzzed_data->ConsumeBool();
  503|  11.2k|          pstr_drc_instructions_uni_drc->str_gain_modifiers[g].gain_offset[0] =
  504|  11.2k|              fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  505|  11.2k|        }
  506|       |
  507|  3.84k|        pstr_drc_instructions_uni_drc->limiter_peak_target_present = fuzzed_data->ConsumeBool();
  508|  3.84k|        pstr_drc_instructions_uni_drc->limiter_peak_target =
  509|  3.84k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  510|  3.84k|        pstr_drc_instructions_uni_drc->drc_instructions_type =
  511|  3.84k|            fuzzed_data->ConsumeIntegral<WORD8>();
  512|  3.84k|        pstr_drc_instructions_uni_drc->mae_group_id = fuzzed_data->ConsumeIntegral<WORD8>();
  513|  3.84k|        pstr_drc_instructions_uni_drc->mae_group_preset_id =
  514|  3.84k|            fuzzed_data->ConsumeIntegral<WORD8>();
  515|  3.84k|#ifdef LOUDNESS_LEVELING_SUPPORT
  516|       |
  517|  3.84k|        if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  3.84k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (517:13): [True: 1.61k, False: 2.23k]
  ------------------
  518|  1.61k|          pstr_drc_instructions_uni_drc->leveling_present = fuzzed_data->ConsumeBool();
  519|  1.61k|          pstr_drc_instructions_uni_drc->ducking_only_set_present = fuzzed_data->ConsumeBool();
  520|  1.61k|          loudness_leveling_extension_present = 1;
  521|  1.61k|        }
  522|  3.84k|#endif
  523|  3.84k|      }
  524|  1.51k|    }
  525|  1.66k|#ifdef LOUDNESS_LEVELING_SUPPORT
  526|  1.66k|    if (loudness_leveling_extension_present) {
  ------------------
  |  Branch (526:9): [True: 780, False: 884]
  ------------------
  527|    780|      pstr_uni_drc_config->str_uni_drc_config_ext
  528|    780|          .uni_drc_config_ext_type[config_extension_count] = UNIDRCCONFEXT_LEVELING;
  ------------------
  |  |   54|    780|#define UNIDRCCONFEXT_LEVELING (0x4)
  ------------------
  529|    780|      config_extension_count++;
  530|    780|    }
  531|  1.66k|#endif
  532|  1.66k|  }
  533|       |
  534|  3.47k|  if (pstr_enc_loudness_info_set->loudness_info_set_ext_present == 1) {
  ------------------
  |  Branch (534:7): [True: 1.49k, False: 1.98k]
  ------------------
  535|  1.49k|    ia_drc_loudness_info_set_ext_eq_struct *pstr_loudness_info_set_ext_eq =
  536|  1.49k|        &pstr_enc_loudness_info_set->str_loudness_info_set_extension.str_loudness_info_set_ext_eq;
  537|       |
  538|  1.49k|    pstr_enc_loudness_info_set->str_loudness_info_set_extension.loudness_info_set_ext_type[0] =
  539|  1.49k|        UNIDRC_LOUD_EXT_EQ;
  ------------------
  |  |   52|  1.49k|#define UNIDRC_LOUD_EXT_EQ (0x1)
  ------------------
  540|       |
  541|       |    /*********************   loudness_info_v1_album   *********************/
  542|  1.49k|    pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count =
  543|  1.49k|        fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_LOUDNESS_INFO_COUNT);
  ------------------
  |  |   32|  1.49k|#define MAX_LOUDNESS_INFO_COUNT (MAX_DOWNMIX_INSTRUCTION_COUNT + 16)
  |  |  ------------------
  |  |  |  |   29|  1.49k|#define MAX_DOWNMIX_INSTRUCTION_COUNT (16)
  |  |  ------------------
  ------------------
  544|  18.8k|    for (n = 0; n < pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count; n++) {
  ------------------
  |  Branch (544:17): [True: 17.3k, False: 1.49k]
  ------------------
  545|  17.3k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].drc_set_id =
  546|  17.3k|          fuzzed_data->ConsumeIntegral<WORD8>();
  547|  17.3k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].downmix_id =
  548|  17.3k|          fuzzed_data->ConsumeIntegral<WORD8>();
  549|  17.3k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].sample_peak_level_present =
  550|  17.3k|          fuzzed_data->ConsumeBool();
  551|  17.3k|      if (pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n]
  ------------------
  |  Branch (551:11): [True: 10.7k, False: 6.56k]
  ------------------
  552|  17.3k|              .sample_peak_level_present == 1) {
  553|  10.7k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].sample_peak_level =
  554|  10.7k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  555|  10.7k|      }
  556|  17.3k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].true_peak_level_present =
  557|  17.3k|          fuzzed_data->ConsumeBool();
  558|  17.3k|      if (pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].true_peak_level_present ==
  ------------------
  |  Branch (558:11): [True: 11.5k, False: 5.84k]
  ------------------
  559|  17.3k|          1) {
  560|  11.5k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].true_peak_level =
  561|  11.5k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  562|  11.5k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n]
  563|  11.5k|            .true_peak_level_measurement_system = fuzzed_data->ConsumeIntegral<WORD8>();
  564|  11.5k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].true_peak_level_reliability =
  565|  11.5k|            fuzzed_data->ConsumeIntegral<WORD8>();
  566|  11.5k|      }
  567|  17.3k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].measurement_count =
  568|  17.3k|          fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_MEASUREMENT_COUNT);
  ------------------
  |  |   28|  17.3k|#define MAX_MEASUREMENT_COUNT (15)
  ------------------
  569|  17.3k|      for (m = 0;
  570|   152k|           m < pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n].measurement_count;
  ------------------
  |  Branch (570:12): [True: 135k, False: 17.3k]
  ------------------
  571|   135k|           m++) {
  572|   135k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n]
  573|   135k|            .str_loudness_measure[m]
  574|   135k|            .method_definition = fuzzed_data->ConsumeIntegral<WORD8>();
  575|   135k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n]
  576|   135k|            .str_loudness_measure[m]
  577|   135k|            .method_value = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  578|   135k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n]
  579|   135k|            .str_loudness_measure[m]
  580|   135k|            .measurement_system = fuzzed_data->ConsumeIntegral<WORD8>();
  581|   135k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[n]
  582|   135k|            .str_loudness_measure[m]
  583|   135k|            .reliability = fuzzed_data->ConsumeIntegral<WORD8>();
  584|   135k|      }
  585|  17.3k|    }
  586|       |
  587|       |    /*********************   loudness_info_v1   *********************/
  588|  1.49k|    pstr_loudness_info_set_ext_eq->loudness_info_v1_count =
  589|  1.49k|        fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_LOUDNESS_INFO_COUNT);
  ------------------
  |  |   32|  1.49k|#define MAX_LOUDNESS_INFO_COUNT (MAX_DOWNMIX_INSTRUCTION_COUNT + 16)
  |  |  ------------------
  |  |  |  |   29|  1.49k|#define MAX_DOWNMIX_INSTRUCTION_COUNT (16)
  |  |  ------------------
  ------------------
  590|  16.0k|    for (n = 0; n < pstr_loudness_info_set_ext_eq->loudness_info_v1_count; n++) {
  ------------------
  |  Branch (590:17): [True: 14.5k, False: 1.49k]
  ------------------
  591|  14.5k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].drc_set_id =
  592|  14.5k|          fuzzed_data->ConsumeIntegral<WORD8>();
  593|  14.5k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].downmix_id =
  594|  14.5k|          fuzzed_data->ConsumeIntegral<WORD8>();
  595|  14.5k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].sample_peak_level_present =
  596|  14.5k|          fuzzed_data->ConsumeBool();
  597|  14.5k|      if (pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].sample_peak_level_present == 1) {
  ------------------
  |  Branch (597:11): [True: 9.31k, False: 5.24k]
  ------------------
  598|  9.31k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].sample_peak_level =
  599|  9.31k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  600|  9.31k|      }
  601|  14.5k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].true_peak_level_present =
  602|  14.5k|          fuzzed_data->ConsumeBool();
  603|  14.5k|      if (pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].true_peak_level_present == 1) {
  ------------------
  |  Branch (603:11): [True: 10.1k, False: 4.41k]
  ------------------
  604|  10.1k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].true_peak_level =
  605|  10.1k|            fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  606|  10.1k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n]
  607|  10.1k|            .true_peak_level_measurement_system = fuzzed_data->ConsumeIntegral<WORD8>();
  608|  10.1k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].true_peak_level_reliability =
  609|  10.1k|            fuzzed_data->ConsumeIntegral<WORD8>();
  610|  10.1k|      }
  611|  14.5k|      pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].measurement_count =
  612|  14.5k|          fuzzed_data->ConsumeIntegralInRange<WORD8>(0, MAX_MEASUREMENT_COUNT);
  ------------------
  |  |   28|  14.5k|#define MAX_MEASUREMENT_COUNT (15)
  ------------------
  613|   132k|      for (m = 0; m < pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n].measurement_count;
  ------------------
  |  Branch (613:19): [True: 118k, False: 14.5k]
  ------------------
  614|   118k|           m++) {
  615|   118k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n]
  616|   118k|            .str_loudness_measure[m]
  617|   118k|            .method_definition = fuzzed_data->ConsumeIntegral<WORD8>();
  618|   118k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n]
  619|   118k|            .str_loudness_measure[m]
  620|   118k|            .method_value = fuzzed_data->ConsumeFloatingPoint<FLOAT32>();
  621|   118k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n]
  622|   118k|            .str_loudness_measure[m]
  623|   118k|            .measurement_system = fuzzed_data->ConsumeIntegral<WORD8>();
  624|   118k|        pstr_loudness_info_set_ext_eq->str_loudness_info_v1[n]
  625|   118k|            .str_loudness_measure[m]
  626|   118k|            .reliability = fuzzed_data->ConsumeIntegral<WORD8>();
  627|   118k|      }
  628|  14.5k|    }
  629|  1.49k|  }
  630|  3.47k|}
xaac_enc_fuzzer.cpp:_ZL35ixheaace_calculate_loudness_measureP21ixheaace_input_configP22ixheaace_output_configP18FuzzedDataProvider:
  703|  5.27k|                                                        FuzzedDataProvider *fuzzed_data) {
  704|  5.27k|  WORD32 input_size;
  705|  5.27k|  WORD32 count = 0;
  706|  5.27k|  IA_ERRORCODE err_code = 0;
  707|  5.27k|  VOID *loudness_handle =
  708|  5.27k|      malloc_global(ixheaace_loudness_info_get_handle_size(), DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  5.27k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
  709|  5.27k|  if (loudness_handle == NULL) {
  ------------------
  |  Branch (709:7): [True: 0, False: 5.27k]
  ------------------
  710|      0|    printf("fatal error: libxaac encoder: Memory allocation failed");
  711|      0|    return -1;
  712|      0|  }
  713|       |
  714|  5.27k|  err_code = ixheaace_loudness_init_params(loudness_handle, pstr_in_cfg, pstr_out_cfg);
  715|       |
  716|  5.27k|  if (err_code) {
  ------------------
  |  Branch (716:7): [True: 989, False: 4.29k]
  ------------------
  717|    989|    free_global(loudness_handle);
  718|    989|    return -1;
  719|    989|  }
  720|  4.29k|  input_size = (pstr_out_cfg->samp_freq / 10) * (pstr_in_cfg->i_channels);
  721|  4.29k|  WORD16 **samples = 0;
  722|  4.29k|  samples =
  723|  4.29k|      (WORD16 **)malloc_global(pstr_in_cfg->i_channels * sizeof(*samples), DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  4.29k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
  724|  4.29k|  if (samples == NULL) {
  ------------------
  |  Branch (724:7): [True: 0, False: 4.29k]
  ------------------
  725|      0|    printf("fatal error: libxaac encoder: Memory allocation failed");
  726|      0|    free_global(loudness_handle);
  727|      0|    return -1;
  728|      0|  }
  729|  11.5k|  for (count = 0; count < pstr_in_cfg->i_channels; count++) {
  ------------------
  |  Branch (729:19): [True: 7.25k, False: 4.29k]
  ------------------
  730|  7.25k|    samples[count] = (WORD16 *)malloc_global(
  731|  7.25k|        (pstr_out_cfg->samp_freq / 10) * sizeof(*samples[count]), DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  7.25k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
  732|  7.25k|    if (samples[count] == NULL) {
  ------------------
  |  Branch (732:9): [True: 0, False: 7.25k]
  ------------------
  733|      0|      printf("fatal error: libxaac encoder: Memory allocation failed");
  734|      0|      while (count) {
  ------------------
  |  Branch (734:14): [True: 0, False: 0]
  ------------------
  735|      0|        count--;
  736|      0|        free_global(samples[count]);
  737|      0|      }
  738|      0|      free_global(samples);
  739|      0|      free_global(loudness_handle);
  740|      0|      return -1;
  741|      0|    }
  742|  7.25k|    memset(samples[count], 0, (pstr_out_cfg->samp_freq / 10) * sizeof(*samples[count]));
  743|  7.25k|  }
  744|  4.29k|  count = 0;
  745|  47.8k|  while (count <= fuzzed_data->remaining_bytes()) {
  ------------------
  |  Branch (745:10): [True: 43.5k, False: 4.29k]
  ------------------
  746|  43.5k|    std::vector<WORD8> input_vec = fuzzed_data->ConsumeBytes<WORD8>(input_size);
  747|  43.5k|    err_code =
  748|  43.5k|        ia_enhaacplus_enc_pcm_data_read(input_vec, input_size, pstr_in_cfg->i_channels, samples);
  749|  43.5k|    if (err_code) {
  ------------------
  |  Branch (749:9): [True: 0, False: 43.5k]
  ------------------
  750|      0|      for (count = 0; count < pstr_in_cfg->i_channels; count++) {
  ------------------
  |  Branch (750:23): [True: 0, False: 0]
  ------------------
  751|      0|        free_global(samples[count]);
  752|      0|      }
  753|      0|      free_global(samples);
  754|      0|      free_global(loudness_handle);
  755|      0|      return -1;
  756|      0|    }
  757|  43.5k|    pstr_in_cfg->measured_loudness = ixheaace_measure_loudness(loudness_handle, samples);
  758|  43.5k|    count += input_size;
  759|  43.5k|  }
  760|  4.29k|  if (pstr_in_cfg->method_def == METHOD_DEFINITION_PROGRAM_LOUDNESS) {
  ------------------
  |  |   24|  4.29k|#define METHOD_DEFINITION_PROGRAM_LOUDNESS 1
  ------------------
  |  Branch (760:7): [True: 20, False: 4.27k]
  ------------------
  761|     20|    pstr_in_cfg->measured_loudness = ixheaace_measure_integrated_loudness(loudness_handle);
  762|     20|  }
  763|  11.5k|  for (count = 0; count < pstr_in_cfg->i_channels; count++) {
  ------------------
  |  Branch (763:19): [True: 7.25k, False: 4.29k]
  ------------------
  764|  7.25k|    free_global(samples[count]);
  765|  7.25k|  }
  766|  4.29k|  free_global(samples);
  767|  4.29k|  free_global(loudness_handle);
  768|  4.29k|  return err_code;
  769|  4.29k|}

