ixheaace_api.c:ixheaac_min32:
   23|  4.87k|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|  4.87k|  WORD32 min_val;
   25|       |
   26|  4.87k|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 408, False: 4.46k]
  ------------------
   27|       |
   28|  4.87k|  return min_val;
   29|  4.87k|}
ixheaace_api.c:ixheaac_max32:
   31|  5.81k|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  5.81k|  WORD32 max_val;
   33|       |
   34|  5.81k|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 978, False: 4.83k]
  ------------------
   35|       |
   36|  5.81k|  return max_val;
   37|  5.81k|}
ixheaace_api.c:ixheaac_div32:
  328|    940|static PLATFORM_INLINE WORD32 ixheaac_div32(WORD32 a, WORD32 b, WORD *q_format) {
  329|    940|  WORD32 quotient;
  330|    940|  UWORD32 mantissa_nr, mantissa_dr;
  331|    940|  WORD16 sign = 0;
  332|       |
  333|    940|  LOOPINDEX i;
  334|    940|  WORD q_nr, q_dr;
  335|       |
  336|    940|  if ((a < 0) && (0 != b)) {
  ------------------
  |  Branch (336:7): [True: 0, False: 940]
  |  Branch (336:18): [True: 0, False: 0]
  ------------------
  337|      0|    a = -a;
  338|      0|    sign = (WORD16)(sign ^ -1);
  339|      0|  }
  340|       |
  341|    940|  if (b < 0) {
  ------------------
  |  Branch (341:7): [True: 0, False: 940]
  ------------------
  342|      0|    b = -b;
  343|      0|    sign = (WORD16)(sign ^ -1);
  344|      0|  }
  345|       |
  346|    940|  if (0 == b) {
  ------------------
  |  Branch (346:7): [True: 0, False: 940]
  ------------------
  347|      0|    *q_format = 0;
  348|      0|    return (a);
  349|      0|  }
  350|       |
  351|    940|  quotient = 0;
  352|       |
  353|    940|  q_nr = ixheaac_norm32(a);
  354|    940|  mantissa_nr = (UWORD32)a << (q_nr);
  355|    940|  q_dr = ixheaac_norm32(b);
  356|    940|  mantissa_dr = (UWORD32)b << (q_dr);
  357|    940|  *q_format = (WORD)(30 + q_nr - q_dr);
  358|       |
  359|  30.0k|  for (i = 0; i < 31; i++) {
  ------------------
  |  Branch (359:15): [True: 29.1k, False: 940]
  ------------------
  360|  29.1k|    quotient = quotient << 1;
  361|       |
  362|  29.1k|    if (mantissa_nr >= mantissa_dr) {
  ------------------
  |  Branch (362:9): [True: 6.10k, False: 23.0k]
  ------------------
  363|  6.10k|      mantissa_nr = mantissa_nr - mantissa_dr;
  364|  6.10k|      quotient += 1;
  365|  6.10k|    }
  366|       |
  367|  29.1k|    mantissa_nr = (UWORD32)mantissa_nr << 1;
  368|  29.1k|  }
  369|       |
  370|    940|  if (sign < 0) {
  ------------------
  |  Branch (370:7): [True: 0, False: 940]
  ------------------
  371|      0|    quotient = -quotient;
  372|      0|  }
  373|       |
  374|    940|  return quotient;
  375|    940|}
ixheaace_api.c:ixheaac_norm32:
  236|  1.88k|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|  1.88k|  WORD norm_val;
  238|       |
  239|  1.88k|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 1.88k]
  ------------------
  240|      0|    norm_val = 31;
  241|  1.88k|  } else {
  242|  1.88k|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 1.88k]
  ------------------
  243|      0|      norm_val = 31;
  244|  1.88k|    } else {
  245|  1.88k|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 1.88k]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|  17.0k|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 15.1k, False: 1.88k]
  ------------------
  249|  15.1k|        a <<= 1;
  250|  15.1k|      }
  251|  1.88k|    }
  252|  1.88k|  }
  253|       |
  254|  1.88k|  return norm_val;
  255|  1.88k|}
ixheaace_sbr_main.c:ixheaac_max32:
   31|  4.69k|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  4.69k|  WORD32 max_val;
   33|       |
   34|  4.69k|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 4.65k, False: 40]
  ------------------
   35|       |
   36|  4.69k|  return max_val;
   37|  4.69k|}
ixheaace_sbr_main.c:ixheaac_shl32:
   39|  8.56k|static PLATFORM_INLINE WORD32 ixheaac_shl32(WORD32 a, WORD b) {
   40|  8.56k|  WORD32 out_val;
   41|       |
   42|  8.56k|  b = ((UWORD32)(b << 24) >> 24);
   43|  8.56k|  if (b > 31)
  ------------------
  |  Branch (43:7): [True: 0, False: 8.56k]
  ------------------
   44|      0|    out_val = 0;
   45|  8.56k|  else
   46|  8.56k|    out_val = (WORD32)a << b;
   47|       |
   48|  8.56k|  return out_val;
   49|  8.56k|}
ixheaace_sbr_main.c:ixheaac_min32:
   23|  8.56k|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|  8.56k|  WORD32 min_val;
   25|       |
   26|  8.56k|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 5.52k, False: 3.03k]
  ------------------
   27|       |
   28|  8.56k|  return min_val;
   29|  8.56k|}
ixheaace_sbr_ton_corr.c:ixheaac_abs32:
  271|  19.9k|static PLATFORM_INLINE WORD32 ixheaac_abs32(WORD32 a) {
  272|  19.9k|  WORD32 abs_val;
  273|       |
  274|  19.9k|  abs_val = a;
  275|       |
  276|  19.9k|  if (a < 0) {
  ------------------
  |  Branch (276:7): [True: 8.26k, False: 11.7k]
  ------------------
  277|  8.26k|    abs_val = -a;
  278|  8.26k|  }
  279|       |
  280|  19.9k|  return abs_val;
  281|  19.9k|}
iusace_fft.c:ixheaac_norm32:
  236|   384k|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|   384k|  WORD norm_val;
  238|       |
  239|   384k|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 384k]
  ------------------
  240|      0|    norm_val = 31;
  241|   384k|  } else {
  242|   384k|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 384k]
  ------------------
  243|      0|      norm_val = 31;
  244|   384k|    } else {
  245|   384k|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 384k]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|  8.07M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 7.69M, False: 384k]
  ------------------
  249|  7.69M|        a <<= 1;
  250|  7.69M|      }
  251|   384k|    }
  252|   384k|  }
  253|       |
  254|   384k|  return norm_val;
  255|   384k|}
ixheaace_sbr_env_est.c:ixheaac_abs32:
  271|  13.4M|static PLATFORM_INLINE WORD32 ixheaac_abs32(WORD32 a) {
  272|  13.4M|  WORD32 abs_val;
  273|       |
  274|  13.4M|  abs_val = a;
  275|       |
  276|  13.4M|  if (a < 0) {
  ------------------
  |  Branch (276:7): [True: 10.7M, False: 2.77M]
  ------------------
  277|  10.7M|    abs_val = -a;
  278|  10.7M|  }
  279|       |
  280|  13.4M|  return abs_val;
  281|  13.4M|}
ixheaace_sbr_frame_info_gen.c:ixheaac_shr32:
   51|   119k|static PLATFORM_INLINE WORD32 ixheaac_shr32(WORD32 a, WORD b) {
   52|   119k|  WORD32 out_val;
   53|       |
   54|   119k|  b = ((UWORD32)(b << 24) >> 24);
   55|   119k|  if (b >= 31) {
  ------------------
  |  Branch (55:7): [True: 0, False: 119k]
  ------------------
   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|   119k|  } else {
   61|   119k|    out_val = (WORD32)a >> b;
   62|   119k|  }
   63|       |
   64|   119k|  return out_val;
   65|   119k|}
ixheaace_sbr_frame_info_gen.c:ixheaac_min32:
   23|   119k|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|   119k|  WORD32 min_val;
   25|       |
   26|   119k|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 35.8k, False: 83.5k]
  ------------------
   27|       |
   28|   119k|  return min_val;
   29|   119k|}
ixheaace_sbr_hbe_fft_ifft_32x32.c:ixheaac_norm32:
  236|  2.04M|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|  2.04M|  WORD norm_val;
  238|       |
  239|  2.04M|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 2.04M]
  ------------------
  240|      0|    norm_val = 31;
  241|  2.04M|  } else {
  242|  2.04M|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 2.04M]
  ------------------
  243|      0|      norm_val = 31;
  244|  2.04M|    } else {
  245|  2.04M|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 2.04M]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|  51.8M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 49.8M, False: 2.04M]
  ------------------
  249|  49.8M|        a <<= 1;
  250|  49.8M|      }
  251|  2.04M|    }
  252|  2.04M|  }
  253|       |
  254|  2.04M|  return norm_val;
  255|  2.04M|}
ixheaace_sbr_inv_filtering_estimation.c:ixheaac_max32:
   31|  1.48M|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  1.48M|  WORD32 max_val;
   33|       |
   34|  1.48M|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 165k, False: 1.31M]
  ------------------
   35|       |
   36|  1.48M|  return max_val;
   37|  1.48M|}
ixheaace_sbr_missing_harmonics_det.c:ixheaac_abs32:
  271|  53.5k|static PLATFORM_INLINE WORD32 ixheaac_abs32(WORD32 a) {
  272|  53.5k|  WORD32 abs_val;
  273|       |
  274|  53.5k|  abs_val = a;
  275|       |
  276|  53.5k|  if (a < 0) {
  ------------------
  |  Branch (276:7): [True: 0, False: 53.5k]
  ------------------
  277|      0|    abs_val = -a;
  278|      0|  }
  279|       |
  280|  53.5k|  return abs_val;
  281|  53.5k|}
ixheaace_sbr_write_bitstream.c:ixheaac_shl32:
   39|  1.08M|static PLATFORM_INLINE WORD32 ixheaac_shl32(WORD32 a, WORD b) {
   40|  1.08M|  WORD32 out_val;
   41|       |
   42|  1.08M|  b = ((UWORD32)(b << 24) >> 24);
   43|  1.08M|  if (b > 31)
  ------------------
  |  Branch (43:7): [True: 0, False: 1.08M]
  ------------------
   44|      0|    out_val = 0;
   45|  1.08M|  else
   46|  1.08M|    out_val = (WORD32)a << b;
   47|       |
   48|  1.08M|  return out_val;
   49|  1.08M|}
ixheaace_sbr_write_bitstream.c:ixheaac_max32:
   31|  5.03M|static PLATFORM_INLINE WORD32 ixheaac_max32(WORD32 a, WORD32 b) {
   32|  5.03M|  WORD32 max_val;
   33|       |
   34|  5.03M|  max_val = (a > b) ? a : b;
  ------------------
  |  Branch (34:13): [True: 5.02M, False: 5.61k]
  ------------------
   35|       |
   36|  5.03M|  return max_val;
   37|  5.03M|}
ixheaace_sbr_write_bitstream.c:ixheaac_min32:
   23|  19.1M|static PLATFORM_INLINE WORD32 ixheaac_min32(WORD32 a, WORD32 b) {
   24|  19.1M|  WORD32 min_val;
   25|       |
   26|  19.1M|  min_val = (a < b) ? a : b;
  ------------------
  |  Branch (26:13): [True: 19.1M, False: 7.00k]
  ------------------
   27|       |
   28|  19.1M|  return min_val;
   29|  19.1M|}
ixheaac_esbr_fft.c:ixheaac_norm32:
  236|  35.4M|static PLATFORM_INLINE WORD ixheaac_norm32(WORD32 a) {
  237|  35.4M|  WORD norm_val;
  238|       |
  239|  35.4M|  if (a == 0) {
  ------------------
  |  Branch (239:7): [True: 0, False: 35.4M]
  ------------------
  240|      0|    norm_val = 31;
  241|  35.4M|  } else {
  242|  35.4M|    if (a == (WORD32)0xffffffffL) {
  ------------------
  |  Branch (242:9): [True: 0, False: 35.4M]
  ------------------
  243|      0|      norm_val = 31;
  244|  35.4M|    } else {
  245|  35.4M|      if (a < 0) {
  ------------------
  |  Branch (245:11): [True: 0, False: 35.4M]
  ------------------
  246|      0|        a = ~a;
  247|      0|      }
  248|   969M|      for (norm_val = 0; a < (WORD32)0x40000000L; norm_val++) {
  ------------------
  |  Branch (248:26): [True: 933M, False: 35.4M]
  ------------------
  249|   933M|        a <<= 1;
  250|   933M|      }
  251|  35.4M|    }
  252|  35.4M|  }
  253|       |
  254|  35.4M|  return norm_val;
  255|  35.4M|}
ixheaace_sbr_code_envelope_lp.c:ixheaac_shr32:
   51|  26.3M|static PLATFORM_INLINE WORD32 ixheaac_shr32(WORD32 a, WORD b) {
   52|  26.3M|  WORD32 out_val;
   53|       |
   54|  26.3M|  b = ((UWORD32)(b << 24) >> 24);
   55|  26.3M|  if (b >= 31) {
  ------------------
  |  Branch (55:7): [True: 0, False: 26.3M]
  ------------------
   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|  26.3M|  } else {
   61|  26.3M|    out_val = (WORD32)a >> b;
   62|  26.3M|  }
   63|       |
   64|  26.3M|  return out_val;
   65|  26.3M|}
ixheaace_sbr_code_envelope_lp.c:ixheaac_sub32_sat:
  225|  12.8M|static PLATFORM_INLINE WORD32 ixheaac_sub32_sat(WORD32 a, WORD32 b) {
  226|  12.8M|  WORD64 diff;
  227|       |
  228|  12.8M|  diff = (WORD64)a - (WORD64)b;
  229|       |
  230|  12.8M|  if (diff >= MAX_32) return MAX_32;
  ------------------
  |  |   60|  12.8M|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
                if (diff >= MAX_32) return MAX_32;
  ------------------
  |  |   60|   457k|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
  |  Branch (230:7): [True: 457k, False: 12.3M]
  ------------------
  231|  12.3M|  if (diff <= MIN_32) return MIN_32;
  ------------------
  |  |   61|  12.3M|#define MIN_32 (WORD32)0x80000000L
  ------------------
                if (diff <= MIN_32) return MIN_32;
  ------------------
  |  |   61|   343k|#define MIN_32 (WORD32)0x80000000L
  ------------------
  |  Branch (231:7): [True: 343k, False: 12.0M]
  ------------------
  232|       |
  233|  12.0M|  return (WORD32)diff;
  234|  12.3M|}

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

impd_drc_validate_config_params:
   44|  2.17k|IA_ERRORCODE impd_drc_validate_config_params(ia_drc_input_config *pstr_inp_config) {
   45|  2.17k|  LOOPIDX i, j, k;
   46|  2.17k|  WORD32 curr_start_subband_idx, next_start_subband_idx;
   47|  2.17k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config = &pstr_inp_config->str_uni_drc_config;
   48|  2.17k|  ia_drc_loudness_info_set_struct *pstr_enc_loudness_info_set =
   49|  2.17k|      &pstr_inp_config->str_enc_loudness_info_set;
   50|       |
   51|  2.17k|  IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->drc_instructions_uni_drc_count, 0,
  ------------------
  |  |   39|  2.17k|  {                                                         \
  |  |   40|  2.17k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.17k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.13k, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.17k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.17k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 550, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.17k|  }
  ------------------
   52|  2.17k|                       MAX_DRC_INSTRUCTIONS_COUNT);
   53|  13.0k|  for (i = 0; i < pstr_uni_drc_config->drc_instructions_uni_drc_count; i++) {
  ------------------
  |  Branch (53:15): [True: 10.8k, False: 2.17k]
  ------------------
   54|  10.8k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_id, 0,
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 8.68k, False: 2.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.99k, False: 6.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   55|  10.8k|                         MAX_DRC_SET_ID);
   56|  10.8k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 8.51k, False: 2.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.25k, False: 7.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   57|  10.8k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].additional_downmix_id_count, 0,
   58|  10.8k|        ADDITIONAL_DOWNMIX_ID_COUNT_MAX);
   59|  10.8k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_location, 0,
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.57k, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.08k, False: 6.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   60|  10.8k|                         MAX_DRC_LOCATION);
   61|  10.8k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.21k, False: 3.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.50k, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   62|  10.8k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_target_loudness_value_upper,
   63|  10.8k|        MIN_DRC_TARGET_LOUDNESS, 0);
   64|  10.8k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.70k, False: 5.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.38k, False: 3.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   65|  10.8k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_target_loudness_value_lower,
   66|  10.8k|        MIN_DRC_TARGET_LOUDNESS, 0);
   67|  97.9k|    for (j = 0; j < MAX_CHANNEL_COUNT; j++) {
  ------------------
  |  |   25|  97.9k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (67:17): [True: 87.0k, False: 10.8k]
  ------------------
   68|  87.0k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].gain_set_index[j],
  ------------------
  |  |   39|  87.0k|  {                                                         \
  |  |   40|  87.0k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  87.0k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 65.3k, False: 21.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  87.0k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  87.0k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 28.6k, False: 58.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  87.0k|  }
  ------------------
   69|  87.0k|                           0, GAIN_SET_COUNT_MAX - 1);
   70|  87.0k|    }
   71|  10.8k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.2k, False: 604]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.83k, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   72|  10.8k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].num_drc_channel_groups, 0,
   73|  10.8k|        MAX_CHANNEL_GROUP_COUNT);
   74|  43.0k|    for (j = 0; j < pstr_uni_drc_config->str_drc_instructions_uni_drc[i].num_drc_channel_groups;
  ------------------
  |  Branch (74:17): [True: 32.2k, False: 10.8k]
  ------------------
   75|  32.2k|         j++) {
   76|  32.2k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i]
  ------------------
  |  |   39|  32.2k|  {                                                         \
  |  |   40|  32.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  32.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.5k, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  32.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  32.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 21.6k, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  32.2k|  }
  ------------------
   77|  32.2k|                               .str_gain_modifiers[j]
   78|  32.2k|                               .attenuation_scaling[0],
   79|  32.2k|                           0, MAX_ATTENUATION_SCALING);
   80|  32.2k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i]
  ------------------
  |  |   39|  32.2k|  {                                                         \
  |  |   40|  32.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  32.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.3k, False: 21.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  32.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  32.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 21.8k, False: 10.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  32.2k|  }
  ------------------
   81|  32.2k|                               .str_gain_modifiers[j]
   82|  32.2k|                               .amplification_scaling[0],
   83|  32.2k|                           0, MAX_AMPLIFICATION_SCALING);
   84|  32.2k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i]
  ------------------
  |  |   39|  32.2k|  {                                                         \
  |  |   40|  32.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  32.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.3k, False: 21.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  32.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  32.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 21.9k, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  32.2k|  }
  ------------------
   85|  32.2k|                               .str_gain_modifiers[j]
   86|  32.2k|                               .gain_offset[0],
   87|  32.2k|                           MIN_DRC_GAIN_OFFSET, MAX_DRC_GAIN_OFFSET);
   88|  32.2k|    }
   89|  10.8k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_instructions_uni_drc[i].limiter_peak_target,
  ------------------
  |  |   39|  10.8k|  {                                                         \
  |  |   40|  10.8k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  10.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.14k, False: 5.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  10.8k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  10.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 5.73k, False: 5.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  10.8k|  }
  ------------------
   90|  10.8k|                         MIN_LIMITER_PEAK_TARGET, 0.0f);
   91|  10.8k|#ifdef LOUDNESS_LEVELING_SUPPORT
   92|  10.8k|    if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_effect &
  ------------------
  |  Branch (92:9): [True: 4.83k, False: 6.04k]
  ------------------
   93|  10.8k|        EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  10.8k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
   94|  4.83k|      if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present != 0 &&
  ------------------
  |  Branch (94:11): [True: 3.29k, False: 1.53k]
  ------------------
   95|  3.29k|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present != 1) {
  ------------------
  |  Branch (95:11): [True: 0, False: 3.29k]
  ------------------
   96|      0|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present = 0;
   97|      0|      }
   98|  4.83k|      if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present != 0 &&
  ------------------
  |  Branch (98:11): [True: 3.42k, False: 1.41k]
  ------------------
   99|  3.42k|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present != 1) {
  ------------------
  |  Branch (99:11): [True: 0, False: 3.42k]
  ------------------
  100|      0|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present = 0;
  101|      0|      }
  102|  4.83k|    }
  103|  10.8k|#endif
  104|  10.8k|  }
  105|       |
  106|  2.17k|  IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->drc_coefficients_uni_drc_count, 0,
  ------------------
  |  |   39|  2.17k|  {                                                         \
  |  |   40|  2.17k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.17k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.97k, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.17k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.17k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.11k, False: 1.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.17k|  }
  ------------------
  107|  2.17k|                       MAX_DRC_COEFF_COUNT);
  108|  4.34k|  for (i = 0; i < pstr_uni_drc_config->drc_coefficients_uni_drc_count; i++) {
  ------------------
  |  Branch (108:15): [True: 2.55k, False: 1.79k]
  ------------------
  109|  2.55k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].drc_location, 0,
  ------------------
  |  |   39|  2.55k|  {                                                         \
  |  |   40|  2.55k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.55k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.00k, False: 549]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.55k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.55k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.09k, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.55k|  }
  ------------------
  110|  2.55k|                         MAX_DRC_LOCATION);
  111|  2.55k|    IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].gain_set_count, 0,
  ------------------
  |  |   39|  2.55k|  {                                                         \
  |  |   40|  2.55k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.55k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.48k, False: 70]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.55k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.55k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.26k, False: 1.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.55k|  }
  ------------------
  112|  2.55k|                         MAX_CHANNEL_GROUP_COUNT);
  113|  5.75k|    for (j = 0; j < pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].gain_set_count; j++) {
  ------------------
  |  Branch (113:17): [True: 3.58k, False: 2.17k]
  ------------------
  114|  3.58k|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.58k|  {                                                         \
  |  |   40|  3.58k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.58k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.97k, False: 608]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.58k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.58k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.10k, False: 2.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.58k|  }
  ------------------
  115|  3.58k|                               .str_gain_set_params[j]
  116|  3.58k|                               .gain_coding_profile,
  117|  3.58k|                           0, MAX_GAIN_CODING_PROFILE);
  118|  3.58k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.58k|  {                                                         \
  |  |   40|  3.58k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.58k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.54k, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.58k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.58k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.95k, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.58k|  }
  ------------------
  119|  3.58k|          pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count,
  120|  3.58k|          0, MAX_BAND_COUNT);
  121|  3.58k|      for (k = 0;
  122|  7.17k|           k <
  ------------------
  |  Branch (122:12): [True: 3.59k, False: 3.58k]
  ------------------
  123|  7.17k|           pstr_uni_drc_config->str_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count;
  124|  3.59k|           k++) {
  125|  3.59k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.59k|  {                                                         \
  |  |   40|  3.59k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.59k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.51k, False: 79]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.59k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.59k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.82k, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.59k|  }
  ------------------
  126|  3.59k|                                 .str_gain_set_params[j]
  127|  3.59k|                                 .gain_params[k]
  128|  3.59k|                                 .nb_points,
  129|  3.59k|                             0, MAX_GAIN_POINTS);
  130|  3.59k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.59k|  {                                                         \
  |  |   40|  3.59k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.59k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.96k, False: 633]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.59k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.59k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.06k, False: 2.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.59k|  }
  ------------------
  131|  3.59k|                                 .str_gain_set_params[j]
  132|  3.59k|                                 .gain_params[k]
  133|  3.59k|                                 .drc_characteristic,
  134|  3.59k|                             0, MAX_DRC_CHARACTERISTIC_VALUE);
  135|  3.59k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.59k|  {                                                         \
  |  |   40|  3.59k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.59k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.63k, False: 958]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.59k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.59k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.10k, False: 2.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.59k|  }
  ------------------
  136|  3.59k|                                 .str_gain_set_params[j]
  137|  3.59k|                                 .gain_params[k]
  138|  3.59k|                                 .crossover_freq_index,
  139|  3.59k|                             0, MAX_CROSSOVER_FREQ_INDEX);
  140|  3.59k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.59k|  {                                                         \
  |  |   40|  3.59k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.59k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.75k, False: 838]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.59k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.59k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.11k, False: 2.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.59k|  }
  ------------------
  141|  3.59k|                                 .str_gain_set_params[j]
  142|  3.59k|                                 .gain_params[k]
  143|  3.59k|                                 .start_sub_band_index,
  144|  3.59k|                             0, STFT256_HOP_SIZE - 1);
  145|  3.59k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|  3.59k|  {                                                         \
  |  |   40|  3.59k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.59k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.38k, False: 1.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.59k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.59k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.22k, False: 2.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.59k|  }
  ------------------
  146|  3.59k|                                 .str_gain_set_params[j]
  147|  3.59k|                                 .gain_params[k]
  148|  3.59k|                                 .width,
  149|  3.59k|                             -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  150|   138k|        for (WORD32 m = 0; m < pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  Branch (150:28): [True: 134k, False: 3.59k]
  ------------------
  151|   138k|                                   .str_gain_set_params[j]
  152|   138k|                                   .gain_params[k]
  153|   138k|                                   .nb_points;
  154|   134k|             m++) {
  155|   134k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|   134k|  {                                                         \
  |  |   40|   134k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   134k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 71.8k, False: 62.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   134k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   134k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 63.3k, False: 71.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   134k|  }
  ------------------
  156|   134k|                                   .str_gain_set_params[j]
  157|   134k|                                   .gain_params[k]
  158|   134k|                                   .gain_points[m]
  159|   134k|                                   .x,
  160|   134k|                               -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  161|   134k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  |   39|   134k|  {                                                         \
  |  |   40|   134k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   134k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 71.5k, False: 63.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   134k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   134k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 63.4k, False: 71.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   134k|  }
  ------------------
  162|   134k|                                   .str_gain_set_params[j]
  163|   134k|                                   .gain_params[k]
  164|   134k|                                   .gain_points[m]
  165|   134k|                                   .y,
  166|   134k|                               -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  167|   134k|        }
  168|  3.59k|      }
  169|  3.98k|      for (k = 0; k < pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  ------------------
  |  Branch (169:19): [True: 781, False: 3.20k]
  ------------------
  170|  3.98k|                              .str_gain_set_params[j]
  171|  3.98k|                              .band_count -
  172|  3.98k|                          1;
  173|  3.58k|           k++) {
  174|    781|        curr_start_subband_idx = pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  175|    781|                                     .str_gain_set_params[j]
  176|    781|                                     .gain_params[k]
  177|    781|                                     .start_sub_band_index;
  178|    781|        next_start_subband_idx = pstr_uni_drc_config->str_drc_coefficients_uni_drc[i]
  179|    781|                                     .str_gain_set_params[j]
  180|    781|                                     .gain_params[k + 1]
  181|    781|                                     .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|    781|        if (next_start_subband_idx <= curr_start_subband_idx) {
  ------------------
  |  Branch (184:13): [True: 379, False: 402]
  ------------------
  185|    379|          return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_SUBBAND_INDEX;
  186|    379|        }
  187|    781|      }
  188|  3.58k|    }
  189|  2.55k|  }
  190|  1.79k|  IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config->downmix_instructions_count, 0,
  ------------------
  |  |   39|  1.79k|  {                                                         \
  |  |   40|  1.79k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.79k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.71k, False: 83]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.79k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.79k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 850, False: 947]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.79k|  }
  ------------------
  191|  1.79k|                       MAX_DOWNMIX_INSTRUCTION_COUNT);
  192|       |
  193|  1.79k|  IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->loudness_info_count, 0,
  ------------------
  |  |   39|  1.79k|  {                                                         \
  |  |   40|  1.79k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.79k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.79k, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.79k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.79k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 231, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.79k|  }
  ------------------
  194|  1.79k|                       MAX_LOUDNESS_INFO_COUNT);
  195|  5.36k|  for (i = 0; i < pstr_enc_loudness_info_set->loudness_info_count; i++) {
  ------------------
  |  Branch (195:15): [True: 3.56k, False: 1.79k]
  ------------------
  196|  3.56k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i].sample_peak_level,
  ------------------
  |  |   39|  3.56k|  {                                                         \
  |  |   40|  3.56k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.60k, False: 962]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.56k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.35k, False: 207]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.56k|  }
  ------------------
  197|  3.56k|                         MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  198|  3.56k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i].true_peak_level,
  ------------------
  |  |   39|  3.56k|  {                                                         \
  |  |   40|  3.56k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.65k, False: 916]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.56k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.29k, False: 267]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.56k|  }
  ------------------
  199|  3.56k|                         MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  200|  3.56k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.56k|  {                                                         \
  |  |   40|  3.56k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.10k, False: 457]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.56k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 686, False: 2.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.56k|  }
  ------------------
  201|  3.56k|        pstr_enc_loudness_info_set->str_loudness_info[i].true_peak_level_measurement_system, 0,
  202|  3.56k|        MAX_MEASUREMENT_SYSTEM_TYPE);
  203|  3.56k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.56k|  {                                                         \
  |  |   40|  3.56k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.01k, False: 555]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.56k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 679, False: 2.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.56k|  }
  ------------------
  204|  3.56k|        pstr_enc_loudness_info_set->str_loudness_info[i].true_peak_level_reliability, 0,
  205|  3.56k|        MAX_RELIABILITY_TYPE);
  206|  3.56k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i].measurement_count, 0,
  ------------------
  |  |   39|  3.56k|  {                                                         \
  |  |   40|  3.56k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.11k, False: 455]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.56k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.90k, False: 1.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.56k|  }
  ------------------
  207|  3.56k|                         MAX_MEASUREMENT_COUNT);
  208|  19.7k|    for (j = 0; j < pstr_enc_loudness_info_set->str_loudness_info[i].measurement_count; j++) {
  ------------------
  |  Branch (208:17): [True: 16.1k, False: 3.56k]
  ------------------
  209|  16.1k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i]
  ------------------
  |  |   39|  16.1k|  {                                                         \
  |  |   40|  16.1k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.1k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.6k, False: 5.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.1k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.1k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 6.93k, False: 9.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.1k|  }
  ------------------
  210|  16.1k|                               .str_loudness_measure[j]
  211|  16.1k|                               .method_definition,
  212|  16.1k|                           0, MAX_METHOD_DEFINITION_TYPE);
  213|  16.1k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  16.1k|  {                                                         \
  |  |   40|  16.1k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.1k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 7.64k, False: 8.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.1k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.1k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 8.55k, False: 7.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.1k|  }
  ------------------
  214|  16.1k|          pstr_enc_loudness_info_set->str_loudness_info[i].str_loudness_measure[j].method_value,
  215|  16.1k|          MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  216|  16.1k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info[i]
  ------------------
  |  |   39|  16.1k|  {                                                         \
  |  |   40|  16.1k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.1k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 10.4k, False: 5.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.1k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.1k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 7.04k, False: 9.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.1k|  }
  ------------------
  217|  16.1k|                               .str_loudness_measure[j]
  218|  16.1k|                               .measurement_system,
  219|  16.1k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  220|  16.1k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  16.1k|  {                                                         \
  |  |   40|  16.1k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  16.1k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.87k, False: 6.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  16.1k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  16.1k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 6.84k, False: 9.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  16.1k|  }
  ------------------
  221|  16.1k|          pstr_enc_loudness_info_set->str_loudness_info[i].str_loudness_measure[j].reliability, 0,
  222|  16.1k|          MAX_RELIABILITY_TYPE);
  223|  16.1k|    }
  224|  3.56k|  }
  225|  1.79k|  IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->loudness_info_album_count, 0,
  ------------------
  |  |   39|  1.79k|  {                                                         \
  |  |   40|  1.79k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.79k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.79k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.79k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.79k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 317, False: 1.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.79k|  }
  ------------------
  226|  1.79k|                       MAX_LOUDNESS_INFO_COUNT);
  227|  7.47k|  for (i = 0; i < pstr_enc_loudness_info_set->loudness_info_album_count; i++) {
  ------------------
  |  Branch (227:15): [True: 5.67k, False: 1.79k]
  ------------------
  228|  5.67k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i].sample_peak_level,
  ------------------
  |  |   39|  5.67k|  {                                                         \
  |  |   40|  5.67k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.67k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.57k, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.67k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.67k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 5.32k, False: 347]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.67k|  }
  ------------------
  229|  5.67k|                         MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  230|  5.67k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i].true_peak_level,
  ------------------
  |  |   39|  5.67k|  {                                                         \
  |  |   40|  5.67k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.67k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.57k, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.67k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.67k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.43k, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.67k|  }
  ------------------
  231|  5.67k|                         MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  232|  5.67k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.67k|  {                                                         \
  |  |   40|  5.67k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.67k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 5.08k, False: 592]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.67k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.67k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 820, False: 4.85k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.67k|  }
  ------------------
  233|  5.67k|        pstr_enc_loudness_info_set->str_loudness_info_album[i].true_peak_level_measurement_system,
  234|  5.67k|        0, MAX_MEASUREMENT_SYSTEM_TYPE);
  235|  5.67k|    IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.67k|  {                                                         \
  |  |   40|  5.67k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.67k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.94k, False: 727]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.67k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.67k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 830, False: 4.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.67k|  }
  ------------------
  236|  5.67k|        pstr_enc_loudness_info_set->str_loudness_info_album[i].true_peak_level_reliability, 0,
  237|  5.67k|        MAX_RELIABILITY_TYPE);
  238|  5.67k|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i].measurement_count,
  ------------------
  |  |   39|  5.67k|  {                                                         \
  |  |   40|  5.67k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.67k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.93k, False: 743]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.67k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.67k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.29k, False: 2.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.67k|  }
  ------------------
  239|  5.67k|                         0, MAX_MEASUREMENT_COUNT);
  240|  30.1k|    for (j = 0; j < pstr_enc_loudness_info_set->str_loudness_info_album[i].measurement_count;
  ------------------
  |  Branch (240:17): [True: 24.4k, False: 5.67k]
  ------------------
  241|  24.4k|         j++) {
  242|  24.4k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  24.4k|  {                                                         \
  |  |   40|  24.4k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  24.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 17.1k, False: 7.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  24.4k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  24.4k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 8.73k, False: 15.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  24.4k|  }
  ------------------
  243|  24.4k|                               .str_loudness_measure[j]
  244|  24.4k|                               .method_definition,
  245|  24.4k|                           0, MAX_METHOD_DEFINITION_TYPE);
  246|  24.4k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  24.4k|  {                                                         \
  |  |   40|  24.4k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  24.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 11.9k, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  24.4k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  24.4k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.5k, False: 11.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  24.4k|  }
  ------------------
  247|  24.4k|                               .str_loudness_measure[j]
  248|  24.4k|                               .method_value,
  249|  24.4k|                           MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  250|  24.4k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  24.4k|  {                                                         \
  |  |   40|  24.4k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  24.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 15.9k, False: 8.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  24.4k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  24.4k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 10.1k, False: 14.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  24.4k|  }
  ------------------
  251|  24.4k|                               .str_loudness_measure[j]
  252|  24.4k|                               .measurement_system,
  253|  24.4k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  254|  24.4k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set->str_loudness_info_album[i]
  ------------------
  |  |   39|  24.4k|  {                                                         \
  |  |   40|  24.4k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  24.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 15.8k, False: 8.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  24.4k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  24.4k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 9.01k, False: 15.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  24.4k|  }
  ------------------
  255|  24.4k|                               .str_loudness_measure[j]
  256|  24.4k|                               .reliability,
  257|  24.4k|                           0, MAX_RELIABILITY_TYPE);
  258|  24.4k|    }
  259|  5.67k|  }
  260|       |
  261|  1.79k|  if (pstr_uni_drc_config->uni_drc_config_ext_present != 0 &&
  ------------------
  |  Branch (261:7): [True: 929, False: 868]
  ------------------
  262|    929|      pstr_uni_drc_config->uni_drc_config_ext_present != 1) {
  ------------------
  |  Branch (262:7): [True: 0, False: 929]
  ------------------
  263|      0|    pstr_uni_drc_config->uni_drc_config_ext_present = 0;
  264|      0|  }
  265|       |
  266|  1.79k|  if (pstr_uni_drc_config->uni_drc_config_ext_present &&
  ------------------
  |  Branch (266:7): [True: 929, False: 868]
  ------------------
  267|    929|      (pstr_uni_drc_config->drc_instructions_uni_drc_count > 0 ||
  ------------------
  |  Branch (267:8): [True: 69, False: 860]
  ------------------
  268|    860|       pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0)) {
  ------------------
  |  Branch (268:8): [True: 111, False: 749]
  ------------------
  269|    180|    memset(pstr_uni_drc_config->str_drc_instructions_uni_drc, 0,
  270|    180|           sizeof(pstr_uni_drc_config->str_drc_instructions_uni_drc[0]) *
  271|    180|               pstr_uni_drc_config->drc_instructions_uni_drc_count);
  272|    180|    memset(pstr_uni_drc_config->str_drc_coefficients_uni_drc, 0,
  273|    180|           sizeof(pstr_uni_drc_config->str_drc_coefficients_uni_drc[0]) *
  274|    180|               pstr_uni_drc_config->drc_coefficients_uni_drc_count);
  275|    180|    pstr_uni_drc_config->drc_instructions_uni_drc_count = 0;
  276|    180|    pstr_uni_drc_config->drc_coefficients_uni_drc_count = 0;
  277|    180|  }
  278|  1.79k|  if (pstr_uni_drc_config->uni_drc_config_ext_present) {
  ------------------
  |  Branch (278:7): [True: 929, False: 868]
  ------------------
  279|    929|    ia_drc_uni_drc_config_ext_struct *pstr_uni_drc_config_ext =
  280|    929|        &pstr_uni_drc_config->str_uni_drc_config_ext;
  281|    929|    if (pstr_uni_drc_config_ext->downmix_instructions_v1_present != 0 &&
  ------------------
  |  Branch (281:9): [True: 408, False: 521]
  ------------------
  282|    408|        pstr_uni_drc_config_ext->downmix_instructions_v1_present != 1) {
  ------------------
  |  Branch (282:9): [True: 0, False: 408]
  ------------------
  283|      0|      pstr_uni_drc_config_ext->downmix_instructions_v1_present = 0;
  284|      0|    }
  285|    929|    if (pstr_uni_drc_config_ext->downmix_instructions_v1_present) {
  ------------------
  |  Branch (285:9): [True: 408, False: 521]
  ------------------
  286|    408|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->downmix_instructions_v1_count, 0,
  ------------------
  |  |   39|    408|  {                                                         \
  |  |   40|    408|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    408|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 393, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    408|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    408|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 364, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    408|  }
  ------------------
  287|    408|                           DOWNMIX_INSTRUCTIONS_COUNT_MAX);
  288|  1.82k|      for (i = 0; i < pstr_uni_drc_config_ext->downmix_instructions_v1_count; i++) {
  ------------------
  |  Branch (288:19): [True: 1.41k, False: 408]
  ------------------
  289|  1.41k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.41k|  {                                                         \
  |  |   40|  1.41k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.41k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.34k, False: 70]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.41k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.41k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 430, False: 986]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.41k|  }
  ------------------
  290|  1.41k|            pstr_uni_drc_config_ext->str_downmix_instructions_v1[i].target_layout, 0,
  291|  1.41k|            MAX_TARGET_LAYOUT_COUNT);
  292|  1.41k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.41k|  {                                                         \
  |  |   40|  1.41k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.41k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.02k, False: 388]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.41k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.41k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 456, False: 960]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.41k|  }
  ------------------
  293|  1.41k|            pstr_uni_drc_config_ext->str_downmix_instructions_v1[i].target_ch_count, 0,
  294|  1.41k|            MAX_CHANNEL_COUNT);
  295|  1.41k|      }
  296|    408|    }
  297|       |
  298|    929|    if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present != 0 &&
  ------------------
  |  Branch (298:9): [True: 860, False: 69]
  ------------------
  299|    860|        pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present != 1) {
  ------------------
  |  Branch (299:9): [True: 0, False: 860]
  ------------------
  300|      0|      pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present = 0;
  301|      0|    }
  302|    929|    if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present) {
  ------------------
  |  Branch (302:9): [True: 860, False: 69]
  ------------------
  303|    860|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count, 0,
  ------------------
  |  |   39|    860|  {                                                         \
  |  |   40|    860|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    860|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 307, False: 553]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    860|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    860|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 791, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    860|  }
  ------------------
  304|    860|                           DRC_COEFFICIENTS_UNIDRC_V1_COUNT_MAX);
  305|  1.66k|      for (i = 0; i < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (305:19): [True: 1.15k, False: 510]
  ------------------
  306|  1.15k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.15k|  {                                                         \
  |  |   40|  1.15k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.15k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.05k, False: 98]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.15k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.15k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.09k, False: 66]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.15k|  }
  ------------------
  307|  1.15k|            pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i].gain_set_count, 0,
  308|  1.15k|            GAIN_SET_COUNT_MAX);
  309|  1.15k|        for (j = 0;
  310|  3.31k|             j < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i].gain_set_count;
  ------------------
  |  Branch (310:14): [True: 2.50k, False: 807]
  ------------------
  311|  2.50k|             j++) {
  312|  2.50k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  2.50k|  {                                                         \
  |  |   40|  2.50k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.50k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.56k, False: 942]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.50k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.50k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 993, False: 1.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.50k|  }
  ------------------
  313|  2.50k|                                   .str_gain_set_params[j]
  314|  2.50k|                                   .gain_coding_profile,
  315|  2.50k|                               0, MAX_GAIN_CODING_PROFILE);
  316|  2.50k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  2.50k|  {                                                         \
  |  |   40|  2.50k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.50k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.47k, False: 30]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.50k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.50k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.86k, False: 649]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.50k|  }
  ------------------
  317|  2.50k|                                   .str_gain_set_params[j]
  318|  2.50k|                                   .band_count,
  319|  2.50k|                               0, MAX_BAND_COUNT);
  320|  6.35k|          for (k = 0; k < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  Branch (320:23): [True: 3.84k, False: 2.50k]
  ------------------
  321|  6.35k|                              .str_gain_set_params[j]
  322|  6.35k|                              .band_count;
  323|  3.84k|               k++) {
  324|  3.84k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  3.84k|  {                                                         \
  |  |   40|  3.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.77k, False: 68]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.34k, False: 2.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.84k|  }
  ------------------
  325|  3.84k|                                     .str_gain_set_params[j]
  326|  3.84k|                                     .gain_params[k]
  327|  3.84k|                                     .nb_points,
  328|  3.84k|                                 0, MAX_GAIN_POINTS);
  329|  3.84k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  3.84k|  {                                                         \
  |  |   40|  3.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.85k, False: 989]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.13k, False: 2.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.84k|  }
  ------------------
  330|  3.84k|                                     .str_gain_set_params[j]
  331|  3.84k|                                     .gain_params[k]
  332|  3.84k|                                     .drc_characteristic,
  333|  3.84k|                                 0, MAX_DRC_CHARACTERISTIC_VALUE);
  334|  3.84k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  3.84k|  {                                                         \
  |  |   40|  3.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.62k, False: 1.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.29k, False: 2.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.84k|  }
  ------------------
  335|  3.84k|                                     .str_gain_set_params[j]
  336|  3.84k|                                     .gain_params[k]
  337|  3.84k|                                     .crossover_freq_index,
  338|  3.84k|                                 0, MAX_CROSSOVER_FREQ_INDEX);
  339|  3.84k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  3.84k|  {                                                         \
  |  |   40|  3.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.88k, False: 954]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.12k, False: 2.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.84k|  }
  ------------------
  340|  3.84k|                                     .str_gain_set_params[j]
  341|  3.84k|                                     .gain_params[k]
  342|  3.84k|                                     .start_sub_band_index,
  343|  3.84k|                                 0, STFT256_HOP_SIZE - 1);
  344|  3.84k|            IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|  3.84k|  {                                                         \
  |  |   40|  3.84k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.84k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.68k, False: 1.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.84k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.84k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.17k, False: 2.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.84k|  }
  ------------------
  345|  3.84k|                                     .str_gain_set_params[j]
  346|  3.84k|                                     .gain_params[k]
  347|  3.84k|                                     .width,
  348|  3.84k|                                 -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  349|   146k|            for (WORD32 m = 0; m < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  Branch (349:32): [True: 142k, False: 3.84k]
  ------------------
  350|   146k|                                       .str_gain_set_params[j]
  351|   146k|                                       .gain_params[k]
  352|   146k|                                       .nb_points;
  353|   142k|                 m++) {
  354|   142k|              IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|   142k|  {                                                         \
  |  |   40|   142k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   142k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 67.8k, False: 74.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   142k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   142k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 76.5k, False: 66.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   142k|  }
  ------------------
  355|   142k|                                       .str_gain_set_params[j]
  356|   142k|                                       .gain_params[k]
  357|   142k|                                       .gain_points[m]
  358|   142k|                                       .x,
  359|   142k|                                   -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  360|   142k|              IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  |   39|   142k|  {                                                         \
  |  |   40|   142k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|   142k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 73.6k, False: 68.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|   142k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|   142k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 69.7k, False: 72.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|   142k|  }
  ------------------
  361|   142k|                                       .str_gain_set_params[j]
  362|   142k|                                       .gain_params[k]
  363|   142k|                                       .gain_points[m]
  364|   142k|                                       .y,
  365|   142k|                                   -MAX_FLT_VAL_DB, MAX_FLT_VAL_DB);
  366|   142k|            }
  367|  3.84k|          }
  368|  3.07k|          for (k = 0; k < pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  ------------------
  |  Branch (368:23): [True: 913, False: 2.15k]
  ------------------
  369|  3.07k|                                  .str_gain_set_params[j]
  370|  3.07k|                                  .band_count -
  371|  3.07k|                              1;
  372|  2.50k|               k++) {
  373|    913|            curr_start_subband_idx = pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  374|    913|                                         .str_gain_set_params[j]
  375|    913|                                         .gain_params[k]
  376|    913|                                         .start_sub_band_index;
  377|    913|            next_start_subband_idx = pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i]
  378|    913|                                         .str_gain_set_params[j]
  379|    913|                                         .gain_params[k + 1]
  380|    913|                                         .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|    913|            if (next_start_subband_idx <= curr_start_subband_idx) {
  ------------------
  |  Branch (383:17): [True: 350, False: 563]
  ------------------
  384|    350|              return IA_EXHEAACE_EXE_NONFATAL_USAC_INVALID_SUBBAND_INDEX;
  385|    350|            }
  386|    913|          }
  387|  2.50k|        }
  388|  1.15k|      }
  389|       |
  390|    510|      IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count, 0,
  ------------------
  |  |   39|    510|  {                                                         \
  |  |   40|    510|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    510|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 421, False: 89]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    510|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    510|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 318, False: 192]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    510|  }
  ------------------
  391|    510|                           DRC_INSTRUCTIONS_UNIDRC_V1_COUNT_MAX);
  392|  1.96k|      for (i = 0; i < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (392:19): [True: 1.45k, False: 510]
  ------------------
  393|  1.45k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.20k, False: 246]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 391, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  394|  1.45k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_set_id, 0,
  395|  1.45k|            MAX_DRC_SET_ID);
  396|  1.45k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.10k, False: 342]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 377, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  397|  1.45k|                                 .additional_downmix_id_count,
  398|  1.45k|                             0, MAX_ADDITIONAL_DOWNMIX_ID);
  399|  1.45k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.10k, False: 348]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 374, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  400|  1.45k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_location, 0,
  401|  1.45k|            MAX_DRC_LOCATION);
  402|  1.45k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 994, False: 457]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 691, False: 760]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  403|  1.45k|                                 .drc_set_target_loudness_value_upper,
  404|  1.45k|                             MIN_DRC_TARGET_LOUDNESS, 0);
  405|  1.45k|        IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.01k, False: 439]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 638, False: 813]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  406|  1.45k|                                 .drc_set_target_loudness_value_lower,
  407|  1.45k|                             MIN_DRC_TARGET_LOUDNESS, 0);
  408|  13.0k|        for (j = 0; j < MAX_CHANNEL_COUNT; j++) {
  ------------------
  |  |   25|  13.0k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (408:21): [True: 11.6k, False: 1.45k]
  ------------------
  409|  11.6k|          IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  11.6k|  {                                                         \
  |  |   40|  11.6k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  11.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.08k, False: 2.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  11.6k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  11.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.78k, False: 8.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  11.6k|  }
  ------------------
  410|  11.6k|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].gain_set_index[j], 0,
  411|  11.6k|              GAIN_SET_COUNT_MAX - 1);
  412|  11.6k|        }
  413|  1.45k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.38k, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.04k, False: 403]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  414|  1.45k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].num_drc_channel_groups, 0,
  415|  1.45k|            MAX_CHANNEL_GROUP_COUNT);
  416|  1.45k|        for (j = 0;
  417|  4.08k|             j <
  ------------------
  |  Branch (417:14): [True: 2.63k, False: 1.45k]
  ------------------
  418|  4.08k|             pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].num_drc_channel_groups;
  419|  2.63k|             j++) {
  420|  2.63k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  2.63k|  {                                                         \
  |  |   40|  2.63k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.63k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.22k, False: 1.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.63k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.63k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.40k, False: 1.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.63k|  }
  ------------------
  421|  2.63k|                                   .str_gain_modifiers[j]
  422|  2.63k|                                   .attenuation_scaling[0],
  423|  2.63k|                               0, MAX_ATTENUATION_SCALING);
  424|  2.63k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  2.63k|  {                                                         \
  |  |   40|  2.63k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.63k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.24k, False: 1.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.63k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.63k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.38k, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.63k|  }
  ------------------
  425|  2.63k|                                   .str_gain_modifiers[j]
  426|  2.63k|                                   .amplification_scaling[0],
  427|  2.63k|                               0, MAX_AMPLIFICATION_SCALING);
  428|  2.63k|          IMPD_DRC_BOUND_CHECK(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  |   39|  2.63k|  {                                                         \
  |  |   40|  2.63k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  2.63k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 1.26k, False: 1.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  2.63k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  2.63k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.38k, False: 1.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  2.63k|  }
  ------------------
  429|  2.63k|                                   .str_gain_modifiers[j]
  430|  2.63k|                                   .gain_offset[0],
  431|  2.63k|                               MIN_DRC_GAIN_OFFSET, MAX_DRC_GAIN_OFFSET);
  432|  2.63k|        }
  433|  1.45k|        IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  1.45k|  {                                                         \
  |  |   40|  1.45k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  1.45k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 978, False: 473]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  1.45k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  1.45k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 473, False: 978]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  1.45k|  }
  ------------------
  434|  1.45k|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].limiter_peak_target,
  435|  1.45k|            MIN_LIMITER_PEAK_TARGET, 0.0f);
  436|  1.45k|#ifdef LOUDNESS_LEVELING_SUPPORT
  437|  1.45k|        if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_set_effect &
  ------------------
  |  Branch (437:13): [True: 613, False: 838]
  ------------------
  438|  1.45k|            EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.45k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  439|    613|          if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present != 0 &&
  ------------------
  |  Branch (439:15): [True: 289, False: 324]
  ------------------
  440|    289|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present != 1) {
  ------------------
  |  Branch (440:15): [True: 0, False: 289]
  ------------------
  441|      0|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].leveling_present = 0;
  442|      0|          }
  443|    613|          if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (443:15): [True: 259, False: 354]
  ------------------
  444|    613|                      .ducking_only_set_present != 0 &&
  445|    259|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (445:15): [True: 0, False: 259]
  ------------------
  446|    259|                      .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|    613|        }
  451|  1.45k|#endif
  452|  1.45k|      }
  453|    510|    }
  454|    929|  }
  455|       |
  456|  1.44k|  if (pstr_enc_loudness_info_set->loudness_info_set_ext_present != 0 &&
  ------------------
  |  Branch (456:7): [True: 487, False: 960]
  ------------------
  457|    487|      pstr_enc_loudness_info_set->loudness_info_set_ext_present != 1) {
  ------------------
  |  Branch (457:7): [True: 0, False: 487]
  ------------------
  458|      0|    pstr_enc_loudness_info_set->loudness_info_set_ext_present = 0;
  459|      0|  }
  460|  1.44k|  if (pstr_enc_loudness_info_set->loudness_info_set_ext_present) {
  ------------------
  |  Branch (460:7): [True: 487, False: 960]
  ------------------
  461|    487|    ia_drc_loudness_info_set_ext_eq_struct *pstr_enc_loudness_info_set_ext =
  462|    487|        &pstr_enc_loudness_info_set->str_loudness_info_set_extension.str_loudness_info_set_ext_eq;
  463|    487|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->loudness_info_v1_count, 0,
  ------------------
  |  |   39|    487|  {                                                         \
  |  |   40|    487|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    487|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 471, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    487|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    487|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 165, False: 322]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    487|  }
  ------------------
  464|    487|                         MAX_LOUDNESS_INFO_COUNT);
  465|  3.86k|    for (i = 0; i < pstr_enc_loudness_info_set_ext->loudness_info_v1_count; i++) {
  ------------------
  |  Branch (465:17): [True: 3.37k, False: 487]
  ------------------
  466|  3.37k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.37k|  {                                                         \
  |  |   40|  3.37k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.37k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.23k, False: 1.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.37k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.37k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 3.18k, False: 193]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.37k|  }
  ------------------
  467|  3.37k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].sample_peak_level,
  468|  3.37k|          MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  469|  3.37k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.37k|  {                                                         \
  |  |   40|  3.37k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.37k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.25k, False: 1.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.37k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.37k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.96k, False: 413]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.37k|  }
  ------------------
  470|  3.37k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].true_peak_level,
  471|  3.37k|          MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  472|  3.37k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i]
  ------------------
  |  |   39|  3.37k|  {                                                         \
  |  |   40|  3.37k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.37k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.77k, False: 602]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.37k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.37k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 759, False: 2.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.37k|  }
  ------------------
  473|  3.37k|                               .true_peak_level_measurement_system,
  474|  3.37k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  475|  3.37k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.37k|  {                                                         \
  |  |   40|  3.37k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.37k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.66k, False: 706]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.37k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.37k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 760, False: 2.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.37k|  }
  ------------------
  476|  3.37k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].true_peak_level_reliability, 0,
  477|  3.37k|          MAX_RELIABILITY_TYPE);
  478|  3.37k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  3.37k|  {                                                         \
  |  |   40|  3.37k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  3.37k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 2.70k, False: 672]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  3.37k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  3.37k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.20k, False: 1.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  3.37k|  }
  ------------------
  479|  3.37k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1[i].measurement_count, 0,
  480|  3.37k|          MAX_MEASUREMENT_COUNT);
  481|  22.5k|      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.37k]
  ------------------
  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.3k, False: 8.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 10.3k, False: 8.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   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.42k, False: 11.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 11.8k, False: 7.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   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.1k, False: 9.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  19.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  19.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 10.5k, False: 8.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   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.30k, False: 9.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   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.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   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.37k|    }
  501|       |
  502|    487|    IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->loudness_info_v1_album_count, 0,
  ------------------
  |  |   39|    487|  {                                                         \
  |  |   40|    487|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|    487|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 454, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|    487|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|    487|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 246, False: 241]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|    487|  }
  ------------------
  503|    487|                         MAX_LOUDNESS_INFO_COUNT);
  504|  5.51k|    for (i = 0; i < pstr_enc_loudness_info_set_ext->loudness_info_v1_album_count; i++) {
  ------------------
  |  Branch (504:17): [True: 5.02k, False: 487]
  ------------------
  505|  5.02k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.02k|  {                                                         \
  |  |   40|  5.02k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.02k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.53k, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.02k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.02k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.70k, False: 324]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.02k|  }
  ------------------
  506|  5.02k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].sample_peak_level,
  507|  5.02k|          MIN_SAMPLE_PEAK_LEVEL, MAX_SAMPLE_PEAK_LEVEL);
  508|  5.02k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.02k|  {                                                         \
  |  |   40|  5.02k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.02k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.50k, False: 1.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.02k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.02k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 4.42k, False: 597]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.02k|  }
  ------------------
  509|  5.02k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].true_peak_level,
  510|  5.02k|          MIN_TRUE_PEAK_LEVEL, MAX_TRUE_PEAK_LEVEL);
  511|  5.02k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  5.02k|  {                                                         \
  |  |   40|  5.02k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.02k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.15k, False: 869]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.02k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.02k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.12k, False: 3.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.02k|  }
  ------------------
  512|  5.02k|                               .true_peak_level_measurement_system,
  513|  5.02k|                           0, MAX_MEASUREMENT_SYSTEM_TYPE);
  514|  5.02k|      IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  5.02k|  {                                                         \
  |  |   40|  5.02k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.02k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 3.94k, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.02k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.02k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 1.18k, False: 3.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.02k|  }
  ------------------
  515|  5.02k|                               .true_peak_level_reliability,
  516|  5.02k|                           0, MAX_RELIABILITY_TYPE);
  517|  5.02k|      IMPD_DRC_BOUND_CHECK(
  ------------------
  |  |   39|  5.02k|  {                                                         \
  |  |   40|  5.02k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  5.02k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 4.31k, False: 712]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  5.02k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  5.02k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 2.89k, False: 2.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  5.02k|  }
  ------------------
  518|  5.02k|          pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].measurement_count, 0,
  519|  5.02k|          MAX_MEASUREMENT_COUNT);
  520|  5.02k|      for (j = 0;
  521|  28.2k|           j < pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i].measurement_count;
  ------------------
  |  Branch (521:12): [True: 23.2k, False: 5.02k]
  ------------------
  522|  23.2k|           j++) {
  523|  23.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.2k|  {                                                         \
  |  |   40|  23.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 12.6k, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.1k, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.2k|  }
  ------------------
  524|  23.2k|                                 .str_loudness_measure[j]
  525|  23.2k|                                 .method_definition,
  526|  23.2k|                             0, MAX_METHOD_DEFINITION_TYPE);
  527|  23.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.2k|  {                                                         \
  |  |   40|  23.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 9.25k, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 14.1k, False: 9.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.2k|  }
  ------------------
  528|  23.2k|                                 .str_loudness_measure[j]
  529|  23.2k|                                 .method_value,
  530|  23.2k|                             MIN_METHOD_VALUE, MAX_METHOD_VALUE);
  531|  23.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.2k|  {                                                         \
  |  |   40|  23.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 12.2k, False: 10.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.4k, False: 10.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.2k|  }
  ------------------
  532|  23.2k|                                 .str_loudness_measure[j]
  533|  23.2k|                                 .measurement_system,
  534|  23.2k|                             0, MAX_MEASUREMENT_SYSTEM_TYPE);
  535|  23.2k|        IMPD_DRC_BOUND_CHECK(pstr_enc_loudness_info_set_ext->str_loudness_info_v1_album[i]
  ------------------
  |  |   39|  23.2k|  {                                                         \
  |  |   40|  23.2k|    var = MIN(var, upper_bound);                            \
  |  |  ------------------
  |  |  |  |   86|  23.2k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (86:20): [True: 11.1k, False: 12.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   41|  23.2k|    var = MAX(var, lower_bound);                            \
  |  |  ------------------
  |  |  |  |   89|  23.2k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (89:20): [True: 12.4k, False: 10.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   42|  23.2k|  }
  ------------------
  536|  23.2k|                                 .str_loudness_measure[j]
  537|  23.2k|                                 .reliability,
  538|  23.2k|                             0, MAX_RELIABILITY_TYPE);
  539|  23.2k|      }
  540|  5.02k|    }
  541|    487|  }
  542|       |
  543|  1.44k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  1.44k|#define IA_NO_ERROR 0x00000000
  ------------------
  544|  1.79k|}
impd_drc_enc_init:
  649|  1.41k|                               ia_drc_input_config *pstr_inp_config) {
  650|  1.41k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.41k|#define IA_NO_ERROR 0x00000000
  ------------------
  651|  1.41k|  WORD32 bit_count = 0;
  652|  1.41k|  ia_drc_enc_state *pstr_drc_state_local = pstr_drc_state;
  653|       |
  654|  1.41k|  pstr_drc_state_local->drc_scratch_mem = ptr_drc_scratch;
  655|  1.41k|  pstr_drc_state_local->drc_scratch_used = 0;
  656|       |
  657|  1.41k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg,
  658|  1.41k|                           pstr_drc_state_local->bit_buf_base_cfg,
  659|  1.41k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg), 1);
  660|       |
  661|  1.41k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_ext,
  662|  1.41k|                           pstr_drc_state_local->bit_buf_base_cfg_ext,
  663|  1.41k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg_ext), 1);
  664|       |
  665|  1.41k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_tmp,
  666|  1.41k|                           pstr_drc_state_local->bit_buf_base_cfg_tmp,
  667|  1.41k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg_tmp), 1);
  668|       |
  669|  1.41k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_out,
  670|  1.41k|                           pstr_drc_state_local->bit_buf_base_out,
  671|  1.41k|                           sizeof(pstr_drc_state_local->bit_buf_base_out), 1);
  672|       |
  673|  1.41k|  err_code = impd_drc_gain_enc_init(
  674|  1.41k|      &pstr_drc_state_local->str_gain_enc, &pstr_inp_config->str_uni_drc_config,
  675|  1.41k|      &pstr_inp_config->str_enc_loudness_info_set, pstr_inp_config->str_enc_params.frame_size,
  676|  1.41k|      pstr_inp_config->str_enc_params.sample_rate, pstr_inp_config->str_enc_params.delay_mode,
  677|  1.41k|      pstr_inp_config->str_enc_params.domain);
  678|  1.41k|  if (err_code) {
  ------------------
  |  Branch (678:7): [True: 80, False: 1.33k]
  ------------------
  679|     80|    return err_code;
  680|     80|  }
  681|       |
  682|  1.33k|  err_code = impd_drc_validate_drc_instructions(&pstr_inp_config->str_uni_drc_config);
  683|       |
  684|  1.33k|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.33k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (684:7): [True: 592, False: 744]
  ------------------
  685|    592|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  686|    592|  }
  687|       |
  688|    744|  pstr_drc_state_local->str_enc_params = pstr_inp_config->str_enc_params;
  689|    744|  pstr_drc_state_local->str_uni_drc_config = pstr_inp_config->str_uni_drc_config;
  690|    744|  pstr_drc_state_local->str_enc_gain_extension = pstr_inp_config->str_enc_gain_extension;
  691|    744|  pstr_drc_state_local->str_gain_enc.str_uni_drc_config = pstr_inp_config->str_uni_drc_config;
  692|       |
  693|    744|  pstr_drc_state_local->str_enc_params.gain_sequence_present = FALSE;
  ------------------
  |  |   26|    744|#define FALSE (0)
  ------------------
  694|    916|  for (WORD16 k = 0; k < pstr_drc_state_local->str_uni_drc_config.drc_coefficients_uni_drc_count;
  ------------------
  |  Branch (694:22): [True: 595, False: 321]
  ------------------
  695|    744|       k++) {
  696|    595|    if ((pstr_drc_state_local->str_uni_drc_config.str_drc_coefficients_uni_drc[k].drc_location ==
  ------------------
  |  Branch (696:9): [True: 478, False: 117]
  ------------------
  697|    595|         1) &&
  698|    478|        (pstr_drc_state_local->str_uni_drc_config.str_drc_coefficients_uni_drc[k].gain_set_count >
  ------------------
  |  Branch (698:9): [True: 423, False: 55]
  ------------------
  699|    478|         0)) {
  700|    423|      pstr_drc_state_local->str_enc_params.gain_sequence_present = TRUE;
  ------------------
  |  |   23|    423|#define TRUE (1)
  ------------------
  701|    423|      break;
  702|    423|    }
  703|    595|  }
  704|       |
  705|    744|  if (pstr_drc_state_local->str_enc_params.gain_sequence_present == FALSE) {
  ------------------
  |  |   26|    744|#define FALSE (0)
  ------------------
  |  Branch (705:7): [True: 321, False: 423]
  ------------------
  706|    566|    for (WORD16 k = 0; k < pstr_drc_state_local->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (706:24): [True: 502, False: 64]
  ------------------
  707|    566|                               .drc_coefficients_uni_drc_v1_count;
  708|    502|         k++) {
  709|    502|      if ((pstr_drc_state_local->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (709:11): [True: 282, False: 220]
  ------------------
  710|    502|               .str_drc_coefficients_uni_drc_v1[k]
  711|    502|               .drc_location == 1) &&
  712|    282|          (pstr_drc_state_local->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (712:11): [True: 257, False: 25]
  ------------------
  713|    282|               .str_drc_coefficients_uni_drc_v1[k]
  714|    282|               .gain_set_count > 0)) {
  715|    257|        pstr_drc_state_local->str_enc_params.gain_sequence_present = TRUE;
  ------------------
  |  |   23|    257|#define TRUE (1)
  ------------------
  716|    257|        break;
  717|    257|      }
  718|    502|    }
  719|    321|  }
  720|       |
  721|    744|  err_code = impd_drc_write_uni_drc_config(pstr_drc_state_local, &bit_count, 1);
  722|    744|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    744|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (722:7): [True: 118, False: 626]
  ------------------
  723|    118|    return err_code;
  724|    118|  }
  725|    626|  pstr_drc_state_local->drc_config_data_size_bit = bit_count;
  726|       |
  727|       |  // Loudness info set
  728|    626|  if (pstr_drc_state_local->str_gain_enc.str_uni_drc_config.loudness_info_set_present == 1) {
  ------------------
  |  Branch (728:7): [True: 482, False: 144]
  ------------------
  729|    482|    bit_count = 0;
  730|    482|    iusace_reset_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_ext);
  731|    482|    memset(pstr_drc_state_local->bit_buf_base_cfg_ext, 0,
  732|    482|           sizeof(MAX_DRC_PAYLOAD_BYTES * sizeof(pstr_drc_state_local->bit_buf_base_cfg_ext[0])));
  ------------------
  |  |   22|    482|#define MAX_DRC_PAYLOAD_BYTES (2048)
  ------------------
  733|    482|    err_code = impd_drc_write_loudness_info_set(
  734|    482|        pstr_drc_state, &pstr_drc_state_local->str_bit_buf_cfg_ext, &bit_count, 1);
  735|    482|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    482|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (735:9): [True: 6, False: 476]
  ------------------
  736|      6|      return (err_code);
  737|      6|    }
  738|    476|    pstr_drc_state_local->drc_config_ext_data_size_bit = bit_count;
  739|    476|  }
  740|       |
  741|    620|  return err_code;
  742|    626|}
impd_loudness_info_init:
  744|  2.65k|IA_ERRORCODE impd_loudness_info_init(VOID *pstr_drc_state, ia_drc_input_config *pstr_inp_config) {
  745|  2.65k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.65k|#define IA_NO_ERROR 0x00000000
  ------------------
  746|  2.65k|  ia_drc_enc_state *pstr_drc_state_local = pstr_drc_state;
  747|       |
  748|  2.65k|  iusace_create_bit_buffer(&pstr_drc_state_local->str_bit_buf_cfg_ext,
  749|  2.65k|                           pstr_drc_state_local->bit_buf_base_cfg_ext,
  750|  2.65k|                           sizeof(pstr_drc_state_local->bit_buf_base_cfg_ext), 1);
  751|       |
  752|  2.65k|  memcpy(&pstr_drc_state_local->str_gain_enc.str_loudness_info_set,
  753|  2.65k|         &pstr_inp_config->str_enc_loudness_info_set, sizeof(ia_drc_loudness_info_set_struct));
  754|       |
  755|  2.65k|  err_code = impd_drc_write_measured_loudness_info(pstr_drc_state_local);
  756|  2.65k|  return err_code;
  757|  2.65k|}
impd_drc_enc:
  760|  71.6k|                          WORD32 *ptr_bits_written, VOID *pstr_scratch) {
  761|  71.6k|  LOOPIDX i, j, k;
  762|  71.6k|  WORD32 band_count = 0;
  763|  71.6k|  WORD32 stop_sub_band_index;
  764|  71.6k|  WORD32 num_bits_payload = 0;
  765|  71.6k|  UWORD8 is_fft_ready[MAX_NUM_CHANNELS] = {0};
  766|  71.6k|  ia_drc_enc_state *pstr_drc_state_local = pstr_drc_state;
  767|  71.6k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state_local->str_gain_enc;
  768|  71.6k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config = &pstr_drc_state_local->str_uni_drc_config;
  769|  71.6k|  ia_drc_compand_struct *pstr_drc_compand;
  770|  71.6k|  ia_drc_stft_gain_calc_struct *pstr_drc_stft_gain_calc;
  771|  71.6k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  71.6k|#define IA_NO_ERROR 0x00000000
  ------------------
  772|  71.6k|  ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc;
  773|       |
  774|  71.6k|  if (pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count > 0) {
  ------------------
  |  Branch (774:7): [True: 18.4k, False: 53.2k]
  ------------------
  775|  18.4k|    pstr_drc_coefficients_uni_drc =
  776|  18.4k|        &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0];
  777|  53.2k|  } else {
  778|  53.2k|    pstr_drc_coefficients_uni_drc = &pstr_uni_drc_config->str_drc_coefficients_uni_drc[0];
  779|  53.2k|  }
  780|       |
  781|  71.6k|  if (pstr_drc_state_local->str_enc_params.gain_sequence_present) {
  ------------------
  |  Branch (781:7): [True: 70.1k, False: 1.50k]
  ------------------
  782|   561k|    for (i = 0; i < MAX_DRC_COEFF_COUNT; i++) {
  ------------------
  |  |   30|   561k|#define MAX_DRC_COEFF_COUNT (7)
  ------------------
  |  Branch (782:17): [True: 490k, False: 70.1k]
  ------------------
  783|   634k|      for (j = 0; j < GAIN_SET_COUNT_MAX; j++) {
  ------------------
  |  |   49|   634k|#define GAIN_SET_COUNT_MAX 8                         /* reduced size */
  ------------------
  |  Branch (783:19): [True: 633k, False: 1.73k]
  ------------------
  784|   633k|        pstr_drc_stft_gain_calc = &pstr_gain_enc->str_drc_stft_gain_handle[i][j][0];
  785|   633k|        pstr_drc_compand = &pstr_gain_enc->str_drc_compand[i][j];
  786|   633k|        if ((pstr_drc_compand->is_valid == 0) && (pstr_drc_stft_gain_calc->is_valid == 0)) {
  ------------------
  |  Branch (786:13): [True: 510k, False: 122k]
  |  Branch (786:50): [True: 489k, False: 21.0k]
  ------------------
  787|   489k|          break;
  788|   489k|        }
  789|       |
  790|   143k|        if (pstr_drc_compand->is_valid == 0) {
  ------------------
  |  Branch (790:13): [True: 21.0k, False: 122k]
  ------------------
  791|  21.0k|          if (is_fft_ready[pstr_drc_stft_gain_calc->ch_idx] == 0) {
  ------------------
  |  Branch (791:15): [True: 19.0k, False: 2.02k]
  ------------------
  792|  19.0k|            impd_drc_stft_drc_convert_to_fd(
  793|  19.0k|                pstr_gain_enc, &pptr_input[pstr_drc_stft_gain_calc->ch_idx][inp_offset],
  794|  19.0k|                pstr_drc_stft_gain_calc->ch_idx, pstr_drc_state_local->str_enc_params.frame_size,
  795|  19.0k|                pstr_gain_enc->complex_fft_ptr[pstr_drc_stft_gain_calc->ch_idx], pstr_scratch);
  796|  19.0k|            is_fft_ready[pstr_drc_stft_gain_calc->ch_idx] = 1;
  797|  19.0k|          }
  798|       |
  799|  63.6k|          for (k = 0; k < pstr_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count;
  ------------------
  |  Branch (799:23): [True: 42.6k, False: 21.0k]
  ------------------
  800|  42.6k|               k++) {
  801|  42.6k|            if (k == pstr_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count - 1) {
  ------------------
  |  Branch (801:17): [True: 21.0k, False: 21.5k]
  ------------------
  802|  21.0k|              stop_sub_band_index = STFT256_HOP_SIZE - 1;
  ------------------
  |  |   39|  21.0k|#define STFT256_HOP_SIZE (256)
  ------------------
  803|  21.5k|            } else {
  804|  21.5k|              stop_sub_band_index = pstr_drc_coefficients_uni_drc[i]
  805|  21.5k|                                        .str_gain_set_params[j]
  806|  21.5k|                                        .gain_params[k + 1]
  807|  21.5k|                                        .start_sub_band_index -
  808|  21.5k|                                    1;
  809|  21.5k|            }
  810|       |
  811|  42.6k|            impd_drc_stft_drc_gain_calc_process(
  812|  42.6k|                pstr_gain_enc, i, j, k,
  813|  42.6k|                pstr_drc_coefficients_uni_drc[i]
  814|  42.6k|                    .str_gain_set_params[j]
  815|  42.6k|                    .gain_params[k]
  816|  42.6k|                    .start_sub_band_index,
  817|  42.6k|                stop_sub_band_index, pstr_drc_state_local->str_enc_params.frame_size,
  818|  42.6k|                pstr_gain_enc->complex_fft_ptr[pstr_drc_stft_gain_calc->ch_idx],
  819|  42.6k|                pstr_drc_state_local->gain_buffer[band_count + k]);
  820|  42.6k|          }
  821|   122k|        } else {
  822|   122k|          impd_drc_td_drc_gain_calc_process(pstr_gain_enc, i, j,
  823|   122k|                                            pstr_drc_state_local->str_enc_params.frame_size,
  824|   122k|                                            &pptr_input[pstr_drc_compand->ch_idx][inp_offset],
  825|   122k|                                            pstr_drc_state_local->gain_buffer[band_count]);
  826|   122k|        }
  827|       |
  828|   143k|        band_count += pstr_drc_coefficients_uni_drc[i].str_gain_set_params[j].band_count;
  829|   143k|      }
  830|   490k|    }
  831|  70.1k|  }
  832|  71.6k|  err_code = impd_drc_encode_uni_drc_gain(pstr_gain_enc, pstr_drc_state_local->gain_buffer[0],
  833|  71.6k|                                          pstr_scratch);
  834|  71.6k|  if (err_code) {
  ------------------
  |  Branch (834:7): [True: 0, False: 71.6k]
  ------------------
  835|      0|    return err_code;
  836|      0|  }
  837|       |
  838|  71.6k|  if (pstr_drc_state_local->is_first_drc_process_complete == 1) {
  ------------------
  |  Branch (838:7): [True: 71.0k, False: 566]
  ------------------
  839|  71.0k|    impd_drc_write_uni_drc_gain(pstr_drc_state_local, &num_bits_payload);
  840|  71.0k|  }
  841|       |
  842|  71.6k|  *ptr_bits_written = num_bits_payload;
  843|  71.6k|  return err_code;
  844|  71.6k|}
impd_drc_api.c:impd_drc_validate_drc_instructions:
  547|  1.33k|    ia_drc_uni_drc_config_struct *pstr_uni_drc_config) {
  548|  1.33k|  LOOPIDX i, j;
  549|  1.33k|  WORD32 profile_found = FALSE;
  ------------------
  |  |   26|  1.33k|#define FALSE (0)
  ------------------
  550|       |
  551|  1.79k|  for (j = 0; j < pstr_uni_drc_config->drc_coefficients_uni_drc_count; j++) {
  ------------------
  |  Branch (551:15): [True: 920, False: 873]
  ------------------
  552|    920|    if (pstr_uni_drc_config->str_drc_coefficients_uni_drc[j].drc_location == 1) {
  ------------------
  |  Branch (552:9): [True: 463, False: 457]
  ------------------
  553|    463|      profile_found = TRUE;
  ------------------
  |  |   23|    463|#define TRUE (1)
  ------------------
  554|    463|      break;
  555|    463|    }
  556|    920|  }
  557|  1.33k|  if (pstr_uni_drc_config->uni_drc_config_ext_present &&
  ------------------
  |  Branch (557:7): [True: 531, False: 805]
  ------------------
  558|    531|      pstr_uni_drc_config->str_uni_drc_config_ext.parametric_drc_present &&
  ------------------
  |  Branch (558:7): [True: 0, False: 531]
  ------------------
  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.33k|  if ((pstr_uni_drc_config->uni_drc_config_ext_present == 0) && profile_found == FALSE) {
  ------------------
  |  |   26|    805|#define FALSE (0)
  ------------------
  |  Branch (563:7): [True: 805, False: 531]
  |  Branch (563:65): [True: 342, False: 463]
  ------------------
  564|    342|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  565|    342|  }
  566|    994|#ifdef LOUDNESS_LEVELING_SUPPORT
  567|  1.52k|  for (i = 0; i < pstr_uni_drc_config->drc_instructions_uni_drc_count; i++) {
  ------------------
  |  Branch (567:15): [True: 528, False: 994]
  ------------------
  568|    528|    if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].drc_set_effect &
  ------------------
  |  Branch (568:9): [True: 303, False: 225]
  ------------------
  569|    528|        EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|    528|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  570|    303|      if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present &&
  ------------------
  |  Branch (570:11): [True: 120, False: 183]
  ------------------
  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: 92, False: 5]
  ------------------
  573|     92|          if (pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].drc_set_effect !=
  ------------------
  |  Branch (573:15): [True: 92, False: 0]
  ------------------
  574|     92|                  EFFECT_BIT_DUCK_SELF &&
  ------------------
  |  |   38|    184|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  575|     92|              pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].drc_set_effect !=
  ------------------
  |  Branch (575:15): [True: 92, False: 0]
  ------------------
  576|     92|                  EFFECT_BIT_DUCK_OTHER) {
  ------------------
  |  |   37|     92|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
  577|     92|            pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].drc_set_effect =
  578|     92|                EFFECT_BIT_DUCK_SELF;
  ------------------
  |  |   38|     92|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  579|     92|          }
  580|     92|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].leveling_present = 0;
  581|     92|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i + 1].ducking_only_set_present = 0;
  582|     92|        } else {
  583|      5|          pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present = 0;
  584|      5|        }
  585|    206|      } else if (!pstr_uni_drc_config->str_drc_instructions_uni_drc[i].leveling_present &&
  ------------------
  |  Branch (585:18): [True: 183, False: 23]
  ------------------
  586|    183|                 pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present) {
  ------------------
  |  Branch (586:18): [True: 28, False: 155]
  ------------------
  587|     28|        pstr_uni_drc_config->str_drc_instructions_uni_drc[i].ducking_only_set_present = 0;
  588|     28|      }
  589|    303|    }
  590|    528|  }
  591|    994|#endif
  592|       |
  593|    994|  if (pstr_uni_drc_config->uni_drc_config_ext_present) {
  ------------------
  |  Branch (593:7): [True: 531, False: 463]
  ------------------
  594|    531|    ia_drc_uni_drc_config_ext_struct *pstr_uni_drc_config_ext =
  595|    531|        &pstr_uni_drc_config->str_uni_drc_config_ext;
  596|    531|    profile_found = FALSE;
  ------------------
  |  |   26|    531|#define FALSE (0)
  ------------------
  597|    900|    for (j = 0; j < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; j++) {
  ------------------
  |  Branch (597:17): [True: 650, False: 250]
  ------------------
  598|    650|      if (pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[j].drc_location == 1) {
  ------------------
  |  Branch (598:11): [True: 281, False: 369]
  ------------------
  599|    281|        profile_found = TRUE;
  ------------------
  |  |   23|    281|#define TRUE (1)
  ------------------
  600|    281|        break;
  601|    281|      }
  602|    650|    }
  603|    531|    if (pstr_uni_drc_config->str_uni_drc_config_ext.parametric_drc_present &&
  ------------------
  |  Branch (603:9): [True: 0, False: 531]
  ------------------
  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|    531|    if (profile_found == FALSE) {
  ------------------
  |  |   26|    531|#define FALSE (0)
  ------------------
  |  Branch (608:9): [True: 250, False: 281]
  ------------------
  609|    250|      return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  610|    250|    }
  611|    281|#ifdef LOUDNESS_LEVELING_SUPPORT
  612|  1.04k|    for (i = 0; i < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (612:17): [True: 762, False: 281]
  ------------------
  613|    762|      if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].drc_set_effect &
  ------------------
  |  Branch (613:11): [True: 464, False: 298]
  ------------------
  614|    762|          EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|    762|#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: 169, False: 295]
  ------------------
  616|    169|            pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (616:13): [True: 111, False: 58]
  ------------------
  617|    169|                .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: 295, False: 58]
  ------------------
  634|    353|                        .leveling_present &&
  635|    295|                   pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i]
  ------------------
  |  Branch (635:20): [True: 35, False: 260]
  ------------------
  636|    295|                       .ducking_only_set_present) {
  637|     35|          pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[i].ducking_only_set_present =
  638|     35|              0;
  639|     35|        }
  640|    464|      }
  641|    762|    }
  642|    281|#endif
  643|    281|  }
  644|       |
  645|    744|  return IA_NO_ERROR;
  ------------------
  |  |   23|    744|#define IA_NO_ERROR 0x00000000
  ------------------
  646|    994|}

impd_drc_gain_enc_init:
   85|  1.41k|                                    const WORD32 delay_mode, const WORD32 domain) {
   86|  1.41k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.41k|#define IA_NO_ERROR 0x00000000
  ------------------
   87|  1.41k|  LOOPIDX i, j, k, l, m, ch;
   88|  1.41k|  WORD32 num_gain_values_max;
   89|  1.41k|  UWORD8 found_ch_idx;
   90|  1.41k|  UWORD32 ch_idx;
   91|       |
   92|  1.41k|  ia_drc_uni_drc_config_ext_struct *pstr_uni_drc_config_ext =
   93|  1.41k|      &pstr_uni_drc_config->str_uni_drc_config_ext;
   94|  1.41k|  ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc =
   95|  1.41k|      &pstr_uni_drc_config->str_drc_coefficients_uni_drc[0];
   96|  1.41k|  ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc_v1 =
   97|  1.41k|      &pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[0];
   98|       |
   99|  1.41k|  if (pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count <= 0) {
  ------------------
  |  Branch (99:7): [True: 978, False: 438]
  ------------------
  100|    978|    WORD32 all_band_gain_count = 0;
  101|    978|    WORD32 gain_set_count = pstr_drc_coefficients_uni_drc->gain_set_count;
  102|  3.15k|    for (i = 0; i < gain_set_count; i++) {
  ------------------
  |  Branch (102:17): [True: 2.17k, False: 978]
  ------------------
  103|  2.17k|      all_band_gain_count += pstr_drc_coefficients_uni_drc->str_gain_set_params[i].band_count;
  104|  2.17k|    }
  105|    978|    pstr_gain_enc->n_sequences = all_band_gain_count;
  106|    978|  } else {
  107|  1.17k|    for (i = 0; i < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (107:17): [True: 737, False: 438]
  ------------------
  108|    737|      WORD32 all_band_gain_count = 0;
  109|  2.44k|      for (j = 0; j < pstr_drc_coefficients_uni_drc_v1[i].gain_set_count; j++) {
  ------------------
  |  Branch (109:19): [True: 1.70k, False: 737]
  ------------------
  110|  1.70k|        all_band_gain_count +=
  111|  1.70k|            pstr_drc_coefficients_uni_drc_v1[i].str_gain_set_params[j].band_count;
  112|  1.70k|      }
  113|    737|      pstr_drc_coefficients_uni_drc_v1[i].gain_sequence_count = all_band_gain_count;
  114|    737|      pstr_gain_enc->n_sequences += all_band_gain_count;
  115|    737|    }
  116|    438|  }
  117|       |
  118|  1.41k|  if (pstr_gain_enc->n_sequences > IMPD_DRCMAX_NSEQ) {
  ------------------
  |  |   42|  1.41k|#define IMPD_DRCMAX_NSEQ (40)
  ------------------
  |  Branch (118:7): [True: 0, False: 1.41k]
  ------------------
  119|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  120|      0|  }
  121|       |
  122|  1.41k|  if ((pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count > 0) &&
  ------------------
  |  Branch (122:7): [True: 438, False: 978]
  ------------------
  123|    438|      (pstr_drc_coefficients_uni_drc_v1->drc_frame_size_present)) {
  ------------------
  |  Branch (123:7): [True: 0, False: 438]
  ------------------
  124|      0|    pstr_gain_enc->drc_frame_size = pstr_drc_coefficients_uni_drc_v1->drc_frame_size;
  125|  1.41k|  } else if ((pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) &&
  ------------------
  |  Branch (125:14): [True: 585, False: 831]
  ------------------
  126|    585|             (pstr_drc_coefficients_uni_drc->drc_frame_size_present)) {
  ------------------
  |  Branch (126:14): [True: 103, False: 482]
  ------------------
  127|    103|    pstr_gain_enc->drc_frame_size = pstr_drc_coefficients_uni_drc->drc_frame_size;
  128|  1.31k|  } else {
  129|  1.31k|    pstr_gain_enc->drc_frame_size = frame_size;
  130|  1.31k|  }
  131|       |
  132|  1.41k|  if (pstr_gain_enc->drc_frame_size > IMPD_DRCMAX_FRAMESIZE) {
  ------------------
  |  |   43|  1.41k|#define IMPD_DRCMAX_FRAMESIZE (4096)
  ------------------
  |  Branch (132:7): [True: 0, False: 1.41k]
  ------------------
  133|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  134|      0|  }
  135|  1.41k|  if (pstr_gain_enc->drc_frame_size < 1) {
  ------------------
  |  Branch (135:7): [True: 0, False: 1.41k]
  ------------------
  136|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  137|      0|  }
  138|       |
  139|  1.41k|  if (!pstr_uni_drc_config->sample_rate_present) {
  ------------------
  |  Branch (139:7): [True: 311, False: 1.10k]
  ------------------
  140|    311|    pstr_gain_enc->sample_rate = sample_rate;
  141|  1.10k|  } else {
  142|  1.10k|    pstr_gain_enc->sample_rate = pstr_uni_drc_config->sample_rate;
  143|  1.10k|  }
  144|       |
  145|  1.41k|  pstr_gain_enc->domain = domain;
  146|  1.41k|  pstr_gain_enc->delay_mode = delay_mode;
  147|  1.41k|  pstr_gain_enc->delta_tmin_default = impd_drc_get_delta_t_min(pstr_gain_enc->sample_rate);
  148|       |
  149|  1.41k|  if ((pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count > 0) &&
  ------------------
  |  Branch (149:7): [True: 438, False: 978]
  ------------------
  150|    438|      (pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[0].time_delta_min_present == 1)) {
  ------------------
  |  Branch (150:7): [True: 310, False: 128]
  ------------------
  151|    310|    pstr_gain_enc->delta_tmin =
  152|    310|        pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[0].delta_tmin;
  153|  1.10k|  } else if ((pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) &&
  ------------------
  |  Branch (153:14): [True: 585, False: 521]
  ------------------
  154|    585|             (pstr_drc_coefficients_uni_drc->str_gain_set_params[0].time_delta_min_present ==
  ------------------
  |  Branch (154:14): [True: 428, False: 157]
  ------------------
  155|    585|              1)) {
  156|    428|    pstr_gain_enc->delta_tmin = pstr_drc_coefficients_uni_drc->str_gain_set_params[0].delta_tmin;
  157|    678|  } else {
  158|    678|    pstr_gain_enc->delta_tmin = impd_drc_get_delta_t_min(pstr_gain_enc->sample_rate);
  159|    678|  }
  160|       |
  161|  1.41k|  num_gain_values_max = pstr_gain_enc->drc_frame_size / pstr_gain_enc->delta_tmin;
  162|  1.41k|  pstr_gain_enc->base_ch_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
  163|       |
  164|  1.41k|  memcpy(&pstr_gain_enc->str_uni_drc_config, pstr_uni_drc_config,
  165|  1.41k|         sizeof(ia_drc_uni_drc_config_struct));
  166|  1.41k|  memcpy(&pstr_gain_enc->str_loudness_info_set, pstr_loudness_info_set,
  167|  1.41k|         sizeof(ia_drc_loudness_info_set_struct));
  168|       |
  169|  1.41k|  k = 0;
  170|  1.41k|  if (pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) {
  ------------------
  |  Branch (170:7): [True: 585, False: 831]
  ------------------
  171|  2.65k|    for (j = 0; j < pstr_drc_coefficients_uni_drc->gain_set_count; j++) {
  ------------------
  |  Branch (171:17): [True: 2.10k, False: 545]
  ------------------
  172|  2.10k|      ch_idx = 0;
  173|  2.10k|      found_ch_idx = 0;
  174|  2.10k|      ia_drc_gain_set_params_struct *pstr_gain_set_params =
  175|  2.10k|          &pstr_drc_coefficients_uni_drc->str_gain_set_params[j];
  176|       |
  177|  3.76k|      for (m = 0; m < pstr_uni_drc_config->drc_instructions_uni_drc_count; m++) {
  ------------------
  |  Branch (177:19): [True: 1.70k, False: 2.05k]
  ------------------
  178|  1.70k|        if (pstr_uni_drc_config->str_drc_instructions_uni_drc[m].drc_location ==
  ------------------
  |  Branch (178:13): [True: 635, False: 1.07k]
  ------------------
  179|  1.70k|            pstr_drc_coefficients_uni_drc->drc_location) {
  180|  5.34k|          for (ch = 0; ch < MAX_CHANNEL_COUNT; ch++) {
  ------------------
  |  |   25|  5.34k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (180:24): [True: 4.76k, False: 584]
  ------------------
  181|  4.76k|            if (pstr_uni_drc_config->str_drc_instructions_uni_drc[m].gain_set_index[ch] == j) {
  ------------------
  |  Branch (181:17): [True: 51, False: 4.71k]
  ------------------
  182|     51|              ch_idx = ch;
  183|     51|              found_ch_idx = 1;
  184|     51|              break;
  185|     51|            }
  186|  4.76k|          }
  187|    635|        }
  188|  1.70k|        if (found_ch_idx) {
  ------------------
  |  Branch (188:13): [True: 51, False: 1.65k]
  ------------------
  189|     51|          break;
  190|     51|        }
  191|  1.70k|      }
  192|  2.10k|      if (ch_idx >= (UWORD32)pstr_gain_enc->base_ch_count) {
  ------------------
  |  Branch (192:11): [True: 9, False: 2.09k]
  ------------------
  193|      9|        return IA_EXHEAACE_INIT_FATAL_DRC_INVALID_CHANNEL_INDEX;
  194|      9|      }
  195|  2.09k|      if (pstr_gain_set_params->band_count > 1) {
  ------------------
  |  Branch (195:11): [True: 128, False: 1.96k]
  ------------------
  196|    128|        impd_drc_util_stft_read_gain_config(pstr_gain_enc->str_drc_stft_gain_handle[0][j],
  197|    128|                                            pstr_gain_set_params->band_count,
  198|    128|                                            pstr_gain_set_params);
  199|       |
  200|    398|        for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (200:21): [True: 285, False: 113]
  ------------------
  201|    285|          err_code = impd_drc_stft_drc_gain_calc_init(pstr_gain_enc, 0, j, l);
  202|    285|          if (err_code) {
  ------------------
  |  Branch (202:15): [True: 15, False: 270]
  ------------------
  203|     15|            return err_code;
  204|     15|          }
  205|    270|          pstr_gain_enc->str_drc_stft_gain_handle[0][j][l].ch_idx = ch_idx;
  206|    270|          pstr_gain_enc->str_drc_stft_gain_handle[0][j][l].is_valid = 1;
  207|    270|        }
  208|  1.96k|      } else if (pstr_gain_set_params->band_count == 1) {
  ------------------
  |  Branch (208:18): [True: 892, False: 1.07k]
  ------------------
  209|    892|        impd_drc_util_td_read_gain_config(&pstr_gain_enc->str_drc_compand[0][j],
  210|    892|                                          pstr_gain_set_params);
  211|       |
  212|    892|        pstr_gain_enc->str_drc_compand[0][j].initial_volume = 0.0f;
  213|       |
  214|    892|        err_code = impd_drc_td_drc_gain_calc_init(pstr_gain_enc, 0, j);
  215|    892|        if (err_code) {
  ------------------
  |  Branch (215:13): [True: 16, False: 876]
  ------------------
  216|     16|          return err_code;
  217|     16|        }
  218|    876|        pstr_gain_enc->str_drc_compand[0][j].ch_idx = ch_idx;
  219|    876|        pstr_gain_enc->str_drc_compand[0][j].is_valid = 1;
  220|    876|      }
  221|       |
  222|  3.20k|      for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (222:19): [True: 1.13k, False: 2.06k]
  ------------------
  223|  1.13k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_drc_group.n_gain_values = 1;
  224|  1.13k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_gain_set_params =
  225|  1.13k|            pstr_drc_coefficients_uni_drc->str_gain_set_params[j];
  226|  1.13k|        k++;
  227|  1.13k|      }
  228|  2.06k|    }
  229|    585|  }
  230|  1.37k|  k = 0;
  231|  2.05k|  for (i = 0; i < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; i++) {
  ------------------
  |  Branch (231:15): [True: 723, False: 1.33k]
  ------------------
  232|    723|    pstr_drc_coefficients_uni_drc_v1 =
  233|    723|        &pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[i];
  234|  2.31k|    for (j = 0; j < pstr_drc_coefficients_uni_drc_v1->gain_set_count; j++) {
  ------------------
  |  Branch (234:17): [True: 1.62k, False: 683]
  ------------------
  235|  1.62k|      ch_idx = 0;
  236|  1.62k|      found_ch_idx = 0;
  237|  1.62k|      ia_drc_gain_set_params_struct *pstr_gain_set_params =
  238|  1.62k|          &pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[j];
  239|       |
  240|  5.30k|      for (m = 0; m < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; m++) {
  ------------------
  |  Branch (240:19): [True: 3.71k, False: 1.59k]
  ------------------
  241|  3.71k|        if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[m].drc_location ==
  ------------------
  |  Branch (241:13): [True: 156, False: 3.56k]
  ------------------
  242|  3.71k|            pstr_drc_coefficients_uni_drc_v1->drc_location) {
  243|  1.16k|          for (ch = 0; ch < MAX_CHANNEL_COUNT; ch++) {
  ------------------
  |  |   25|  1.16k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (243:24): [True: 1.04k, False: 119]
  ------------------
  244|  1.04k|            if (pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[m].gain_set_index[ch] ==
  ------------------
  |  Branch (244:17): [True: 37, False: 1.00k]
  ------------------
  245|  1.04k|                j) {
  246|     37|              ch_idx = ch;
  247|     37|              found_ch_idx = 1;
  248|     37|              break;
  249|     37|            }
  250|  1.04k|          }
  251|    156|        }
  252|  3.71k|        if (found_ch_idx) {
  ------------------
  |  Branch (252:13): [True: 37, False: 3.67k]
  ------------------
  253|     37|          break;
  254|     37|        }
  255|  3.71k|      }
  256|       |
  257|  1.62k|      if (ch_idx >= (UWORD32)pstr_gain_enc->base_ch_count) {
  ------------------
  |  Branch (257:11): [True: 13, False: 1.61k]
  ------------------
  258|     13|        return IA_EXHEAACE_INIT_FATAL_DRC_INVALID_CHANNEL_INDEX;
  259|     13|      }
  260|       |
  261|  1.61k|      if (pstr_gain_set_params->band_count > 1) {
  ------------------
  |  Branch (261:11): [True: 324, False: 1.29k]
  ------------------
  262|    324|        impd_drc_util_stft_read_gain_config(pstr_gain_enc->str_drc_stft_gain_handle[i][j],
  263|    324|                                            pstr_gain_set_params->band_count,
  264|    324|                                            pstr_gain_set_params);
  265|       |
  266|    989|        for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (266:21): [True: 674, False: 315]
  ------------------
  267|    674|          err_code = impd_drc_stft_drc_gain_calc_init(pstr_gain_enc, i, j, l);
  268|    674|          if (err_code) {
  ------------------
  |  Branch (268:15): [True: 9, False: 665]
  ------------------
  269|      9|            return err_code;
  270|      9|          }
  271|    665|          pstr_gain_enc->str_drc_stft_gain_handle[i][j][l].ch_idx = ch_idx;
  272|    665|          pstr_gain_enc->str_drc_stft_gain_handle[i][j][l].is_valid = 1;
  273|    665|        }
  274|  1.29k|      } else if (pstr_gain_set_params->band_count == 1) {
  ------------------
  |  Branch (274:18): [True: 834, False: 458]
  ------------------
  275|    834|        impd_drc_util_td_read_gain_config(&pstr_gain_enc->str_drc_compand[i][j],
  276|    834|                                          pstr_gain_set_params);
  277|       |
  278|    834|        pstr_gain_enc->str_drc_compand[i][j].initial_volume = 0.0f;
  279|       |
  280|    834|        err_code = impd_drc_td_drc_gain_calc_init(pstr_gain_enc, i, j);
  281|    834|        if (err_code) {
  ------------------
  |  Branch (281:13): [True: 18, False: 816]
  ------------------
  282|     18|          return err_code;
  283|     18|        }
  284|    816|        pstr_gain_enc->str_drc_compand[i][j].ch_idx = ch_idx;
  285|    816|        pstr_gain_enc->str_drc_compand[i][j].is_valid = 1;
  286|    816|      }
  287|       |
  288|  3.06k|      for (l = 0; l < pstr_gain_set_params->band_count; l++) {
  ------------------
  |  Branch (288:19): [True: 1.47k, False: 1.58k]
  ------------------
  289|  1.47k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_drc_group.n_gain_values = 1;
  290|  1.47k|        pstr_gain_enc->str_drc_gain_seq_buf[k].str_gain_set_params =
  291|  1.47k|            pstr_drc_coefficients_uni_drc_v1->str_gain_set_params[j];
  292|  1.47k|        k++;
  293|  1.47k|      }
  294|  1.58k|    }
  295|    723|  }
  296|       |
  297|  1.33k|  impd_drc_generate_delta_time_code_table(num_gain_values_max,
  298|  1.33k|                                          pstr_gain_enc->str_delta_time_code_table);
  299|       |
  300|  95.4k|  for (i = num_gain_values_max - 1; i >= 0; i--) {
  ------------------
  |  Branch (300:37): [True: 94.1k, False: 1.33k]
  ------------------
  301|  94.1k|    pstr_gain_enc->delta_time_quant_table[i] = pstr_gain_enc->delta_tmin * (i + 1);
  302|  94.1k|  }
  303|       |
  304|  1.33k|  return err_code;
  305|  1.37k|}
impd_drc_encode_uni_drc_gain:
  308|  71.6k|                                          FLOAT32 *ptr_gain_buffer, VOID *pstr_scratch) {
  309|  71.6k|  LOOPIDX idx;
  310|  71.6k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  71.6k|#define IA_NO_ERROR 0x00000000
  ------------------
  311|   241k|  for (idx = 0; idx < pstr_gain_enc->n_sequences; idx++) {
  ------------------
  |  Branch (311:17): [True: 170k, False: 71.6k]
  ------------------
  312|   170k|    err_code = impd_drc_quantize_and_encode_drc_gain(
  313|   170k|        pstr_gain_enc, &ptr_gain_buffer[idx * MAX_DRC_FRAME_SIZE],
  ------------------
  |  |   23|   170k|#define MAX_DRC_FRAME_SIZE (4096)
  ------------------
  314|   170k|        &(pstr_gain_enc->drc_gain_per_sample_with_prev_frame[idx][0]),
  315|   170k|        pstr_gain_enc->str_delta_time_code_table, &(pstr_gain_enc->str_drc_gain_seq_buf[idx]),
  316|   170k|        pstr_scratch);
  317|       |
  318|   170k|    if (err_code) {
  ------------------
  |  Branch (318:9): [True: 0, False: 170k]
  ------------------
  319|      0|      return err_code;
  320|      0|    }
  321|   170k|  }
  322|  71.6k|  return err_code;
  323|  71.6k|}
impd_drc_get_delta_t_min:
  325|  6.50k|WORD32 impd_drc_get_delta_t_min(const WORD32 sample_rate) {
  326|  6.50k|  WORD32 lower_bound;
  327|  6.50k|  WORD32 result = 1;
  328|  6.50k|  WORD32 sample_rate_local = sample_rate;
  329|       |
  330|  6.50k|  if (sample_rate_local < 1000) {
  ------------------
  |  Branch (330:7): [True: 0, False: 6.50k]
  ------------------
  331|      0|    sample_rate_local = 1000;
  332|      0|  }
  333|  6.50k|  lower_bound = (WORD32)((0.0005f * sample_rate_local) + 0.5f);
  334|       |
  335|  37.3k|  while (result <= lower_bound) {
  ------------------
  |  Branch (335:10): [True: 30.8k, False: 6.50k]
  ------------------
  336|  30.8k|    result = result << 1;
  337|  30.8k|  }
  338|  6.50k|  return result;
  339|  6.50k|}
impd_drc_enc.c:impd_drc_util_stft_read_gain_config:
   39|    452|    ia_drc_gain_set_params_struct *str_gain_set_params) {
   40|    452|  LOOPIDX i, j;
   41|    452|  WORD32 num_points;
   42|       |
   43|  1.42k|  for (i = 0; i < band_count; i++) {
  ------------------
  |  Branch (43:15): [True: 973, False: 452]
  ------------------
   44|    973|    num_points = str_gain_set_params->gain_params[i].nb_points;
   45|    973|    pstr_stft_drc_gain_handle[i].nb_points = num_points;
   46|  5.51k|    for (j = 0; j < num_points; j++) {
  ------------------
  |  Branch (46:17): [True: 4.54k, False: 973]
  ------------------
   47|  4.54k|      pstr_stft_drc_gain_handle[i].str_segment[2 * (j + 1)].x =
   48|  4.54k|          str_gain_set_params->gain_params[i].gain_points[j].x;
   49|  4.54k|      pstr_stft_drc_gain_handle[i].str_segment[2 * (j + 1)].y =
   50|  4.54k|          str_gain_set_params->gain_params[i].gain_points[j].y;
   51|  4.54k|    }
   52|       |
   53|    973|    pstr_stft_drc_gain_handle[i].width_db = str_gain_set_params->gain_params[i].width;
   54|    973|    pstr_stft_drc_gain_handle[i].attack_ms = str_gain_set_params->gain_params[i].attack;
   55|    973|    pstr_stft_drc_gain_handle[i].release_ms = str_gain_set_params->gain_params[i].decay;
   56|    973|  }
   57|    452|}
impd_drc_enc.c:impd_drc_util_td_read_gain_config:
   60|  1.72k|    ia_drc_compand_struct *pstr_drc_compand, ia_drc_gain_set_params_struct *str_gain_set_params) {
   61|  1.72k|  LOOPIDX idx;
   62|  1.72k|  WORD32 num_points;
   63|       |
   64|  1.72k|  num_points = str_gain_set_params->gain_params[0].nb_points;
   65|  1.72k|  pstr_drc_compand->nb_points = num_points;
   66|  10.1k|  for (idx = 0; idx < num_points; idx++) {
  ------------------
  |  Branch (66:17): [True: 8.38k, False: 1.72k]
  ------------------
   67|  8.38k|    pstr_drc_compand->str_segment[2 * (idx + 1)].x =
   68|  8.38k|        str_gain_set_params->gain_params[0].gain_points[idx].x;
   69|  8.38k|    pstr_drc_compand->str_segment[2 * (idx + 1)].y =
   70|  8.38k|        str_gain_set_params->gain_params[0].gain_points[idx].y;
   71|  8.38k|  }
   72|       |
   73|  1.72k|  pstr_drc_compand->width_db = str_gain_set_params->gain_params[0].width;
   74|  1.72k|  pstr_drc_compand->str_channel_param.attack = str_gain_set_params->gain_params[0].attack;
   75|  1.72k|  pstr_drc_compand->str_channel_param.decay = str_gain_set_params->gain_params[0].decay;
   76|       |
   77|  1.72k|  pstr_drc_compand->str_channel_param.attack /= 1000.0;
   78|  1.72k|  pstr_drc_compand->str_channel_param.decay /= 1000.0;
   79|  1.72k|}

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

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

impd_drc_write_loudness_info_set_extension:
 2907|    612|    WORD32 *ptr_bit_cnt, FLAG write_bs) {
 2908|    612|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    612|#define IA_NO_ERROR 0x00000000
  ------------------
 2909|    612|  LOOPIDX idx;
 2910|    612|  WORD32 counter = 0, version = 1;
 2911|    612|  WORD32 ext_size_bits = 0, bit_size_len = 0, bit_size = 0;
 2912|    612|  WORD32 bit_cnt_local = 0;
 2913|    612|  WORD32 bit_cnt_local_tmp = 0;
 2914|    612|  ia_drc_loudness_info_set_ext_eq_struct *pstr_loudness_info_set_ext_eq =
 2915|    612|      &pstr_loudness_info_set_extension->str_loudness_info_set_ext_eq;
 2916|    612|  ia_bit_buf_struct *ptr_bit_buf_tmp = NULL;
 2917|       |
 2918|    612|  if (write_bs) {
  ------------------
  |  Branch (2918:7): [True: 126, False: 486]
  ------------------
 2919|    126|    ptr_bit_buf_tmp = &pstr_drc_state->str_bit_buf_cfg_tmp;
 2920|       |
 2921|    126|    iusace_reset_bit_buffer(ptr_bit_buf_tmp);
 2922|    126|  }
 2923|       |
 2924|    612|  bit_cnt_local += iusace_write_bits_buf(
 2925|    612|      it_bit_buf, pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter], 4);
 2926|  1.20k|  while ((counter < 2) &&
  ------------------
  |  Branch (2926:10): [True: 1.20k, False: 0]
  ------------------
 2927|  1.20k|         (pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter] !=
  ------------------
  |  Branch (2927:10): [True: 612, False: 595]
  ------------------
 2928|  1.20k|          UNIDRC_LOUD_EXT_TERM)) {
  ------------------
  |  |   48|  1.20k|#define UNIDRC_LOUD_EXT_TERM (0x0)
  ------------------
 2929|    612|    switch (pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter]) {
 2930|    612|      case UNIDRC_LOUD_EXT_EQ: {
  ------------------
  |  |   52|    612|#define UNIDRC_LOUD_EXT_EQ (0x1)
  ------------------
  |  Branch (2930:7): [True: 612, False: 0]
  ------------------
 2931|    612|        bit_cnt_local_tmp += iusace_write_bits_buf(
 2932|    612|            ptr_bit_buf_tmp, pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count, 6);
 2933|       |
 2934|    612|        bit_cnt_local_tmp += iusace_write_bits_buf(
 2935|    612|            ptr_bit_buf_tmp, pstr_loudness_info_set_ext_eq->loudness_info_v1_count, 6);
 2936|  6.85k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count; idx++) {
  ------------------
  |  Branch (2936:23): [True: 6.25k, False: 604]
  ------------------
 2937|  6.25k|          err_code = impd_drc_write_loudness_info(
 2938|  6.25k|              ptr_bit_buf_tmp, version,
 2939|  6.25k|              &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[idx]),
 2940|  6.25k|              &bit_cnt_local_tmp);
 2941|  6.25k|          if (err_code) {
  ------------------
  |  Branch (2941:15): [True: 8, False: 6.24k]
  ------------------
 2942|      8|            return err_code;
 2943|      8|          }
 2944|  6.25k|        }
 2945|  4.68k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_count; idx++) {
  ------------------
  |  Branch (2945:23): [True: 4.08k, False: 595]
  ------------------
 2946|  4.08k|          err_code = impd_drc_write_loudness_info(
 2947|  4.08k|              ptr_bit_buf_tmp, version,
 2948|  4.08k|              &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1[idx]), &bit_cnt_local_tmp);
 2949|  4.08k|          if (err_code) {
  ------------------
  |  Branch (2949:15): [True: 9, False: 4.07k]
  ------------------
 2950|      9|            return (err_code);
 2951|      9|          }
 2952|  4.08k|        }
 2953|    604|      } break;
 2954|    595|      default:
  ------------------
  |  Branch (2954:7): [True: 0, False: 612]
  ------------------
 2955|      0|        break;
 2956|    612|    }
 2957|    595|    pstr_loudness_info_set_extension->ext_bit_size[counter] = bit_cnt_local_tmp;
 2958|    595|    bit_size = pstr_loudness_info_set_extension->ext_bit_size[counter] - 1;
 2959|    595|    ext_size_bits = (WORD32)(log((FLOAT32)bit_size) / log(2.f)) + 1;
 2960|    595|    bit_size_len = ext_size_bits - 4;
 2961|    595|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size_len, 4);
 2962|    595|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size, (UWORD8)ext_size_bits);
 2963|       |
 2964|    595|    switch (pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter]) {
 2965|    595|      case UNIDRC_LOUD_EXT_EQ: {
  ------------------
  |  |   52|    595|#define UNIDRC_LOUD_EXT_EQ (0x1)
  ------------------
  |  Branch (2965:7): [True: 595, False: 0]
  ------------------
 2966|    595|        bit_cnt_local += iusace_write_bits_buf(
 2967|    595|            it_bit_buf, pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count, 6);
 2968|       |
 2969|    595|        bit_cnt_local += iusace_write_bits_buf(
 2970|    595|            it_bit_buf, pstr_loudness_info_set_ext_eq->loudness_info_v1_count, 6);
 2971|  6.62k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_album_count; idx++) {
  ------------------
  |  Branch (2971:23): [True: 6.02k, False: 595]
  ------------------
 2972|  6.02k|          err_code = impd_drc_write_loudness_info(
 2973|  6.02k|              it_bit_buf, version,
 2974|  6.02k|              &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1_album[idx]), &bit_cnt_local);
 2975|  6.02k|          if (err_code) {
  ------------------
  |  Branch (2975:15): [True: 0, False: 6.02k]
  ------------------
 2976|      0|            return err_code;
 2977|      0|          }
 2978|  6.02k|        }
 2979|  4.58k|        for (idx = 0; idx < pstr_loudness_info_set_ext_eq->loudness_info_v1_count; idx++) {
  ------------------
  |  Branch (2979:23): [True: 3.98k, False: 595]
  ------------------
 2980|  3.98k|          err_code = impd_drc_write_loudness_info(
 2981|  3.98k|              it_bit_buf, version, &(pstr_loudness_info_set_ext_eq->str_loudness_info_v1[idx]),
 2982|  3.98k|              &bit_cnt_local);
 2983|  3.98k|          if (err_code) {
  ------------------
  |  Branch (2983:15): [True: 0, False: 3.98k]
  ------------------
 2984|      0|            return (err_code);
 2985|      0|          }
 2986|  3.98k|        }
 2987|    595|      } break;
 2988|    595|      default:
  ------------------
  |  Branch (2988:7): [True: 0, False: 595]
  ------------------
 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|    595|    }
 2994|    595|    counter++;
 2995|       |
 2996|    595|    bit_cnt_local += iusace_write_bits_buf(
 2997|    595|        it_bit_buf, pstr_loudness_info_set_extension->loudness_info_set_ext_type[counter], 4);
 2998|    595|  }
 2999|       |
 3000|    595|  *ptr_bit_cnt += bit_cnt_local;
 3001|       |
 3002|    595|  return IA_NO_ERROR;
  ------------------
  |  |   23|    595|#define IA_NO_ERROR 0x00000000
  ------------------
 3003|    612|}
impd_drc_write_loudness_info_set:
 3007|  4.58k|                                              FLAG write_bs) {
 3008|  4.58k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  4.58k|#define IA_NO_ERROR 0x00000000
  ------------------
 3009|  4.58k|  LOOPIDX idx;
 3010|  4.58k|  WORD32 version = 0;
 3011|  4.58k|  WORD32 bit_cnt_local = 0;
 3012|  4.58k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state->str_gain_enc;
 3013|  4.58k|  ia_drc_loudness_info_set_struct *pstr_loudness_info_set =
 3014|  4.58k|      &(pstr_gain_enc->str_loudness_info_set);
 3015|       |
 3016|  4.58k|  bit_cnt_local +=
 3017|  4.58k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info_set->loudness_info_album_count, 6);
 3018|       |
 3019|  4.58k|  bit_cnt_local +=
 3020|  4.58k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info_set->loudness_info_count, 6);
 3021|       |
 3022|  8.68k|  for (idx = 0; idx < pstr_loudness_info_set->loudness_info_album_count; idx++) {
  ------------------
  |  Branch (3022:17): [True: 4.09k, False: 4.58k]
  ------------------
 3023|  4.09k|    err_code = impd_drc_write_loudness_info(it_bit_buf, version,
 3024|  4.09k|                                            &pstr_loudness_info_set->str_loudness_info_album[idx],
 3025|  4.09k|                                            &bit_cnt_local);
 3026|  4.09k|    if (err_code) {
  ------------------
  |  Branch (3026:9): [True: 5, False: 4.09k]
  ------------------
 3027|      5|      return err_code;
 3028|      5|    }
 3029|  4.09k|  }
 3030|       |
 3031|  11.9k|  for (idx = 0; idx < pstr_loudness_info_set->loudness_info_count; idx++) {
  ------------------
  |  Branch (3031:17): [True: 7.40k, False: 4.57k]
  ------------------
 3032|  7.40k|    err_code = impd_drc_write_loudness_info(
 3033|  7.40k|        it_bit_buf, version, &pstr_loudness_info_set->str_loudness_info[idx], &bit_cnt_local);
 3034|  7.40k|    if (err_code) {
  ------------------
  |  Branch (3034:9): [True: 5, False: 7.39k]
  ------------------
 3035|      5|      return err_code;
 3036|      5|    }
 3037|  7.40k|  }
 3038|       |
 3039|  4.57k|  bit_cnt_local +=
 3040|  4.57k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info_set->loudness_info_set_ext_present, 1);
 3041|  4.57k|  if (pstr_loudness_info_set->loudness_info_set_ext_present) {
  ------------------
  |  Branch (3041:7): [True: 612, False: 3.96k]
  ------------------
 3042|    612|    err_code = impd_drc_write_loudness_info_set_extension(
 3043|    612|        pstr_drc_state, it_bit_buf, &pstr_loudness_info_set->str_loudness_info_set_extension,
 3044|    612|        &bit_cnt_local, write_bs);
 3045|    612|    if (err_code) {
  ------------------
  |  Branch (3045:9): [True: 17, False: 595]
  ------------------
 3046|     17|      return err_code;
 3047|     17|    }
 3048|    612|  }
 3049|       |
 3050|  4.56k|  *ptr_bit_cnt += bit_cnt_local;
 3051|       |
 3052|  4.56k|  return err_code;
 3053|  4.57k|}
impd_drc_write_uni_drc_config:
 3056|  2.19k|                                           FLAG write_bs) {
 3057|  2.19k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.19k|#define IA_NO_ERROR 0x00000000
  ------------------
 3058|  2.19k|  LOOPIDX idx;
 3059|  2.19k|  WORD32 version = 0;
 3060|  2.19k|  WORD32 bit_cnt_local = 0;
 3061|  2.19k|  VOID *ptr_scratch = pstr_drc_state->drc_scratch_mem;
 3062|  2.19k|  ia_bit_buf_struct *it_bit_buf = NULL;
 3063|  2.19k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state->str_gain_enc;
 3064|  2.19k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config = &(pstr_gain_enc->str_uni_drc_config);
 3065|       |
 3066|  2.19k|  if (write_bs) {
  ------------------
  |  Branch (3066:7): [True: 744, False: 1.44k]
  ------------------
 3067|    744|    it_bit_buf = &pstr_drc_state->str_bit_buf_cfg;
 3068|    744|  }
 3069|       |
 3070|  2.19k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->sample_rate_present, 1);
 3071|       |
 3072|  2.19k|  if (1 == pstr_uni_drc_config->sample_rate_present) {
  ------------------
  |  Branch (3072:7): [True: 1.69k, False: 499]
  ------------------
 3073|  1.69k|    bit_cnt_local +=
 3074|  1.69k|        iusace_write_bits_buf(it_bit_buf, (pstr_uni_drc_config->sample_rate - 1000), 18);
 3075|  1.69k|  }
 3076|       |
 3077|  2.19k|  bit_cnt_local +=
 3078|  2.19k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->downmix_instructions_count, 7);
 3079|       |
 3080|  2.19k|  bit_cnt_local +=
 3081|  2.19k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_description_basic_present, 1);
 3082|       |
 3083|  2.19k|  if (1 == pstr_uni_drc_config->drc_description_basic_present) {
  ------------------
  |  Branch (3083:7): [True: 718, False: 1.47k]
  ------------------
 3084|    718|    bit_cnt_local +=
 3085|    718|        iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_coefficients_basic_count, 3);
 3086|    718|    bit_cnt_local +=
 3087|    718|        iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_instructions_basic_count, 4);
 3088|    718|  }
 3089|       |
 3090|  2.19k|  bit_cnt_local +=
 3091|  2.19k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->drc_coefficients_uni_drc_count, 3);
 3092|       |
 3093|  2.19k|#ifdef LOUDNESS_LEVELING_SUPPORT
 3094|  2.19k|  UWORD32 num_ducking_only_drc_sets =
 3095|  2.19k|      get_num_ducking_only_drc_sets(pstr_uni_drc_config->str_drc_instructions_uni_drc,
 3096|  2.19k|                                    pstr_uni_drc_config->drc_instructions_uni_drc_count);
 3097|  2.19k|  bit_cnt_local += iusace_write_bits_buf(
 3098|  2.19k|      it_bit_buf, pstr_uni_drc_config->drc_instructions_uni_drc_count - num_ducking_only_drc_sets,
 3099|  2.19k|      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.19k|  bit_cnt_local +=
 3105|  2.19k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->str_channel_layout.base_ch_count, 7);
 3106|  2.19k|  bit_cnt_local += iusace_write_bits_buf(
 3107|  2.19k|      it_bit_buf, pstr_uni_drc_config->str_channel_layout.layout_signaling_present, 1);
 3108|  2.19k|  if (1 == pstr_uni_drc_config->str_channel_layout.layout_signaling_present) {
  ------------------
  |  Branch (3108:7): [True: 195, False: 1.99k]
  ------------------
 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: 13, False: 182]
  ------------------
 3112|     37|      for (idx = 0; idx < pstr_uni_drc_config->str_channel_layout.base_ch_count; idx++) {
  ------------------
  |  Branch (3112:21): [True: 24, False: 13]
  ------------------
 3113|     24|        bit_cnt_local += iusace_write_bits_buf(
 3114|     24|            it_bit_buf, pstr_uni_drc_config->str_channel_layout.speaker_position[idx], 7);
 3115|     24|      }
 3116|     13|    }
 3117|    195|  }
 3118|       |
 3119|  8.21k|  for (idx = 0; idx < pstr_uni_drc_config->downmix_instructions_count; idx++) {
  ------------------
  |  Branch (3119:17): [True: 6.02k, False: 2.19k]
  ------------------
 3120|       |    // downmixInstructions();
 3121|  6.02k|  }
 3122|       |
 3123|  2.19k|  for (idx = 0; idx < pstr_uni_drc_config->drc_coefficients_basic_count; idx++) {
  ------------------
  |  Branch (3123:17): [True: 0, False: 2.19k]
  ------------------
 3124|       |    // drcCoefficientsBasic();
 3125|      0|  }
 3126|       |
 3127|  2.19k|  for (idx = 0; idx < pstr_uni_drc_config->drc_instructions_basic_count; idx++) {
  ------------------
  |  Branch (3127:17): [True: 0, False: 2.19k]
  ------------------
 3128|       |    // drcInstructionsBasics();
 3129|      0|  }
 3130|       |
 3131|  4.80k|  for (idx = 0; idx < pstr_uni_drc_config->drc_coefficients_uni_drc_count; idx++) {
  ------------------
  |  Branch (3131:17): [True: 2.61k, False: 2.19k]
  ------------------
 3132|  2.61k|    impd_drc_write_drc_coeff_uni_drc(it_bit_buf, version,
 3133|  2.61k|                                     &(pstr_uni_drc_config->str_drc_coefficients_uni_drc[idx]),
 3134|  2.61k|                                     &bit_cnt_local);
 3135|  2.61k|  }
 3136|       |
 3137|  3.67k|  for (idx = 0; idx < pstr_uni_drc_config->drc_instructions_uni_drc_count; idx++) {
  ------------------
  |  Branch (3137:17): [True: 1.68k, False: 1.99k]
  ------------------
 3138|  1.68k|#ifdef LOUDNESS_LEVELING_SUPPORT
 3139|  1.68k|    if (idx > 0 &&
  ------------------
  |  Branch (3139:9): [True: 1.43k, False: 249]
  ------------------
 3140|  1.43k|        pstr_uni_drc_config->str_drc_instructions_uni_drc[idx - 1].ducking_only_set_present) {
  ------------------
  |  Branch (3140:9): [True: 324, False: 1.10k]
  ------------------
 3141|    324|      continue;
 3142|    324|    }
 3143|  1.35k|#endif
 3144|  1.35k|    err_code = impd_drc_write_drc_instruct_uni_drc(
 3145|  1.35k|        it_bit_buf, version, pstr_uni_drc_config, pstr_gain_enc,
 3146|  1.35k|        &(pstr_uni_drc_config->str_drc_instructions_uni_drc[idx]), ptr_scratch, &bit_cnt_local);
 3147|  1.35k|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.35k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3147:9): [True: 193, False: 1.16k]
  ------------------
 3148|    193|      return err_code;
 3149|    193|    }
 3150|  1.35k|  }
 3151|       |
 3152|  1.99k|  bit_cnt_local +=
 3153|  1.99k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config->uni_drc_config_ext_present, 1);
 3154|  1.99k|  if (pstr_uni_drc_config->uni_drc_config_ext_present) {
  ------------------
  |  Branch (3154:7): [True: 860, False: 1.13k]
  ------------------
 3155|    860|    err_code = impd_drc_write_uni_drc_config_extn(
 3156|    860|        pstr_drc_state, pstr_gain_enc, pstr_uni_drc_config,
 3157|    860|        &(pstr_uni_drc_config->str_uni_drc_config_ext), &bit_cnt_local, write_bs);
 3158|    860|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    860|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3158:9): [True: 311, False: 549]
  ------------------
 3159|    311|      return (err_code);
 3160|    311|    }
 3161|    860|  }
 3162|       |
 3163|  1.68k|  *ptr_bit_cnt += bit_cnt_local;
 3164|       |
 3165|  1.68k|  return err_code;
 3166|  1.99k|}
impd_drc_write_measured_loudness_info:
 3168|  2.65k|IA_ERRORCODE impd_drc_write_measured_loudness_info(ia_drc_enc_state *pstr_drc_state) {
 3169|       |
 3170|  2.65k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  2.65k|#define IA_NO_ERROR 0x00000000
  ------------------
 3171|  2.65k|  ia_bit_buf_struct *it_bit_buf_lis = &pstr_drc_state->str_bit_buf_cfg_ext;
 3172|  2.65k|  WORD32 bit_cnt_lis = 0;
 3173|  2.65k|  err_code = impd_drc_write_loudness_info_set(pstr_drc_state, it_bit_buf_lis, &bit_cnt_lis, 1);
 3174|  2.65k|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  2.65k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3174:7): [True: 0, False: 2.65k]
  ------------------
 3175|      0|    return (err_code);
 3176|      0|  }
 3177|  2.65k|  pstr_drc_state->drc_config_ext_data_size_bit = bit_cnt_lis;
 3178|       |
 3179|  2.65k|  return err_code;
 3180|  2.65k|}
impd_drc_enc_initial_gain:
 3184|   340k|                                       WORD32 *code) {
 3185|   340k|  WORD32 sign, magnitude, bits, size;
 3186|       |
 3187|   340k|  switch (gain_coding_profile) {
 3188|   100k|    case GAIN_CODING_PROFILE_CONSTANT: {
  ------------------
  |  |   43|   100k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (3188:5): [True: 100k, False: 240k]
  ------------------
 3189|   100k|      bits = 0;
 3190|   100k|      size = 0;
 3191|   100k|    } break;
 3192|  49.3k|    case GAIN_CODING_PROFILE_CLIPPING: {
  ------------------
  |  |   42|  49.3k|#define GAIN_CODING_PROFILE_CLIPPING 2
  ------------------
  |  Branch (3192:5): [True: 49.3k, False: 291k]
  ------------------
 3193|  49.3k|      if (gain_initial > -0.0625f) {
  ------------------
  |  Branch (3193:11): [True: 25.4k, False: 23.8k]
  ------------------
 3194|  25.4k|        sign = 0;
 3195|  25.4k|        *gain_initial_quant = 0.0f;
 3196|  25.4k|        bits = sign;
 3197|  25.4k|        size = 1;
 3198|  25.4k|      } else {
 3199|  23.8k|        sign = 1;
 3200|  23.8k|        gain_initial = MAX(-1000.0f, gain_initial);
  ------------------
  |  |   89|  23.8k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 23.8k]
  |  |  ------------------
  ------------------
 3201|  23.8k|        magnitude = (WORD32)(-1.0f + 0.5f - 8.0f * gain_initial);
 3202|  23.8k|        magnitude = MIN(0xFF, magnitude);
  ------------------
  |  |   86|  23.8k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 23.8k]
  |  |  ------------------
  ------------------
 3203|  23.8k|        *gain_initial_quant = -(magnitude + 1) * 0.125f;
 3204|  23.8k|        bits = (sign << 8) + magnitude;
 3205|  23.8k|        size = 9;
 3206|  23.8k|      }
 3207|  49.3k|    } break;
 3208|  17.6k|    case GAIN_CODING_PROFILE_FADING: {
  ------------------
  |  |   41|  17.6k|#define GAIN_CODING_PROFILE_FADING 1
  ------------------
  |  Branch (3208:5): [True: 17.6k, False: 322k]
  ------------------
 3209|  17.6k|      if (gain_initial > -0.0625f) {
  ------------------
  |  Branch (3209:11): [True: 6.32k, False: 11.3k]
  ------------------
 3210|  6.32k|        sign = 0;
 3211|  6.32k|        *gain_initial_quant = 0.0f;
 3212|  6.32k|        bits = sign;
 3213|  6.32k|        size = 1;
 3214|  11.3k|      } else {
 3215|  11.3k|        sign = 1;
 3216|  11.3k|        gain_initial = MAX(-1000.0f, gain_initial);
  ------------------
  |  |   89|  11.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
 3217|  11.3k|        magnitude = (WORD32)(-1.0f + 0.5f - 8.0f * gain_initial);
 3218|  11.3k|        magnitude = MIN(0x3FF, magnitude);
  ------------------
  |  |   86|  11.3k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 11.3k]
  |  |  ------------------
  ------------------
 3219|  11.3k|        *gain_initial_quant = -(magnitude + 1) * 0.125f;
 3220|  11.3k|        bits = (sign << 10) + magnitude;
 3221|  11.3k|        size = 11;
 3222|  11.3k|      }
 3223|  17.6k|    } break;
 3224|   173k|    case GAIN_CODING_PROFILE_REGULAR: {
  ------------------
  |  |   40|   173k|#define GAIN_CODING_PROFILE_REGULAR 0
  ------------------
  |  Branch (3224:5): [True: 173k, False: 167k]
  ------------------
 3225|   173k|      if (gain_initial < 0.0f) {
  ------------------
  |  Branch (3225:11): [True: 9.98k, False: 163k]
  ------------------
 3226|  9.98k|        sign = 1;
 3227|  9.98k|        gain_initial = MAX(-1000.0f, gain_initial);
  ------------------
  |  |   89|  9.98k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 9.98k]
  |  |  ------------------
  ------------------
 3228|  9.98k|        magnitude = (WORD32)(0.5f - 8.0f * gain_initial);
 3229|  9.98k|        magnitude = MIN(0xFF, magnitude);
  ------------------
  |  |   86|  9.98k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 9.98k]
  |  |  ------------------
  ------------------
 3230|  9.98k|        *gain_initial_quant = -magnitude * 0.125f;
 3231|   163k|      } else {
 3232|   163k|        sign = 0;
 3233|   163k|        gain_initial = MIN(1000.0f, gain_initial);
  ------------------
  |  |   86|   163k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 163k]
  |  |  ------------------
  ------------------
 3234|   163k|        magnitude = (WORD32)(0.5f + 8.0f * gain_initial);
 3235|   163k|        magnitude = MIN(0xFF, magnitude);
  ------------------
  |  |   86|   163k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 163k]
  |  |  ------------------
  ------------------
 3236|   163k|        *gain_initial_quant = magnitude * 0.125f;
 3237|   163k|      }
 3238|   173k|      bits = (sign << 8) + magnitude;
 3239|   173k|      size = 9;
 3240|   173k|    } break;
 3241|      0|    default:
  ------------------
  |  Branch (3241:5): [True: 0, False: 340k]
  ------------------
 3242|      0|      return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
 3243|   340k|  }
 3244|       |
 3245|   340k|  *code = bits;
 3246|   340k|  *code_size = size;
 3247|       |
 3248|   340k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   340k|#define IA_NO_ERROR 0x00000000
  ------------------
 3249|   340k|}
impd_drc_write_uni_drc_gain:
 3339|  71.0k|VOID impd_drc_write_uni_drc_gain(ia_drc_enc_state *pstr_drc_state, WORD32 *ptr_bit_cnt) {
 3340|  71.0k|  LOOPIDX idx;
 3341|  71.0k|  WORD32 bit_cnt_local = 0;
 3342|  71.0k|  ia_bit_buf_struct *it_bit_buf = &pstr_drc_state->str_bit_buf_out;
 3343|  71.0k|  ia_drc_gain_enc_struct *pstr_gain_enc = &pstr_drc_state->str_gain_enc;
 3344|  71.0k|  ia_drc_group_for_output_struct *pstr_drc_group_for_output;
 3345|  71.0k|  ia_drc_gain_set_params_struct *pstr_gain_set_params;
 3346|  71.0k|  ia_drc_uni_drc_gain_ext_struct str_uni_drc_gain_extension =
 3347|  71.0k|      pstr_drc_state->str_enc_gain_extension;
 3348|       |
 3349|   239k|  for (idx = 0; idx < pstr_gain_enc->n_sequences; idx++) {
  ------------------
  |  Branch (3349:17): [True: 168k, False: 71.0k]
  ------------------
 3350|   168k|    pstr_drc_group_for_output =
 3351|   168k|        &(pstr_gain_enc->str_drc_gain_seq_buf[idx].str_drc_group_for_output);
 3352|   168k|    pstr_gain_set_params = &(pstr_gain_enc->str_drc_gain_seq_buf[idx].str_gain_set_params);
 3353|       |
 3354|   168k|    if (pstr_gain_set_params->gain_coding_profile < GAIN_CODING_PROFILE_CONSTANT) {
  ------------------
  |  |   43|   168k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (3354:9): [True: 119k, False: 49.6k]
  ------------------
 3355|   119k|      impd_drc_write_spline_nodes(it_bit_buf, pstr_gain_enc, pstr_gain_set_params,
 3356|   119k|                                  pstr_drc_group_for_output, &bit_cnt_local);
 3357|   119k|    }
 3358|   168k|  }
 3359|       |
 3360|  71.0k|  bit_cnt_local +=
 3361|  71.0k|      iusace_write_bits_buf(it_bit_buf, str_uni_drc_gain_extension.uni_drc_gain_ext_present, 1);
 3362|  71.0k|  if (str_uni_drc_gain_extension.uni_drc_gain_ext_present) {
  ------------------
  |  Branch (3362:7): [True: 3.57k, False: 67.5k]
  ------------------
 3363|  3.57k|    impd_drc_write_uni_drc_gain_extension(it_bit_buf, &str_uni_drc_gain_extension,
 3364|  3.57k|                                          &bit_cnt_local);
 3365|  3.57k|  }
 3366|       |
 3367|  71.0k|  if (bit_cnt_local & 0x07) {
  ------------------
  |  Branch (3367:7): [True: 67.0k, False: 4.01k]
  ------------------
 3368|  67.0k|    pstr_drc_state->bit_buf_base_out[bit_cnt_local >> 3] |= 0xFF >> (bit_cnt_local & 0x07);
 3369|       |
 3370|  67.0k|    bit_cnt_local += 8 - (bit_cnt_local & 0x07);
 3371|  67.0k|  }
 3372|       |
 3373|  71.0k|  *ptr_bit_cnt += bit_cnt_local;
 3374|  71.0k|}
impd_drc_mux.c:impd_drc_write_loudness_info:
  733|  31.8k|                                                 WORD32 *ptr_bit_cnt) {
  734|  31.8k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  31.8k|#define IA_NO_ERROR 0x00000000
  ------------------
  735|  31.8k|  LOOPIDX idx;
  736|  31.8k|  WORD32 code, code_size;
  737|  31.8k|  WORD32 bit_cnt_local = 0;
  738|       |
  739|  31.8k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->drc_set_id, 6);
  740|  31.8k|  if (version >= 1) {
  ------------------
  |  Branch (740:7): [True: 20.3k, False: 11.5k]
  ------------------
  741|  20.3k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->eq_set_id, 6);
  742|  20.3k|  }
  743|  31.8k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->downmix_id, 7);
  744|       |
  745|  31.8k|  bit_cnt_local +=
  746|  31.8k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->sample_peak_level_present, 1);
  747|  31.8k|  if (pstr_loudness_info->sample_peak_level_present) {
  ------------------
  |  Branch (747:7): [True: 13.8k, False: 18.0k]
  ------------------
  748|  13.8k|    impd_drc_enc_peak(pstr_loudness_info->sample_peak_level, &code, &code_size);
  749|       |
  750|  13.8k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
  751|  13.8k|  }
  752|       |
  753|  31.8k|  bit_cnt_local +=
  754|  31.8k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->true_peak_level_present, 1);
  755|  31.8k|  if (pstr_loudness_info->true_peak_level_present) {
  ------------------
  |  Branch (755:7): [True: 11.8k, False: 19.9k]
  ------------------
  756|  11.8k|    impd_drc_enc_peak(pstr_loudness_info->true_peak_level, &code, &code_size);
  757|       |
  758|  11.8k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
  759|       |
  760|  11.8k|    bit_cnt_local += iusace_write_bits_buf(
  761|  11.8k|        it_bit_buf, pstr_loudness_info->true_peak_level_measurement_system, 4);
  762|       |
  763|  11.8k|    bit_cnt_local +=
  764|  11.8k|        iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->true_peak_level_reliability, 2);
  765|  11.8k|  }
  766|       |
  767|  31.8k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_info->measurement_count, 4);
  768|       |
  769|   175k|  for (idx = 0; idx < pstr_loudness_info->measurement_count; idx++) {
  ------------------
  |  Branch (769:17): [True: 143k, False: 31.8k]
  ------------------
  770|   143k|    err_code = impd_drc_write_loudness_measure(
  771|   143k|        it_bit_buf, &(pstr_loudness_info->str_loudness_measure[idx]), &bit_cnt_local);
  772|       |
  773|   143k|    if (err_code) return (err_code);
  ------------------
  |  Branch (773:9): [True: 27, False: 143k]
  ------------------
  774|   143k|  }
  775|       |
  776|  31.8k|  *ptr_bit_cnt += bit_cnt_local;
  777|       |
  778|  31.8k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  31.8k|#define IA_NO_ERROR 0x00000000
  ------------------
  779|  31.8k|}
impd_drc_mux.c:impd_drc_enc_peak:
  454|  25.6k|static VOID impd_drc_enc_peak(const FLOAT32 peak_level, WORD32 *code, WORD32 *code_size) {
  455|  25.6k|  WORD32 bits;
  456|       |
  457|  25.6k|  bits = ((WORD32)(0.5f + 32.0f * (20.0f - peak_level) + 10000.0f)) - 10000;
  458|  25.6k|  bits = MIN(0x0FFF, bits);
  ------------------
  |  |   86|  25.6k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 25.6k]
  |  |  ------------------
  ------------------
  459|  25.6k|  bits = MAX(0x1, bits);
  ------------------
  |  |   89|  25.6k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 16.3k, False: 9.26k]
  |  |  ------------------
  ------------------
  460|       |
  461|  25.6k|  *code = bits;
  462|  25.6k|  *code_size = 12;
  463|  25.6k|}
impd_drc_mux.c:impd_drc_write_loudness_measure:
  709|   143k|    WORD32 *ptr_bit_cnt) {
  710|   143k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   143k|#define IA_NO_ERROR 0x00000000
  ------------------
  711|   143k|  WORD32 code, code_size;
  712|   143k|  WORD32 bit_cnt_local = 0;
  713|       |
  714|   143k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_measure->method_definition, 4);
  715|       |
  716|   143k|  err_code = impd_drc_enc_method_value(pstr_loudness_measure->method_definition,
  717|   143k|                                       pstr_loudness_measure->method_value, &code_size, &code);
  718|   143k|  if (err_code) return (err_code);
  ------------------
  |  Branch (718:7): [True: 27, False: 143k]
  ------------------
  719|       |
  720|   143k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, (UWORD8)code_size);
  721|   143k|  bit_cnt_local +=
  722|   143k|      iusace_write_bits_buf(it_bit_buf, pstr_loudness_measure->measurement_system, 4);
  723|   143k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_loudness_measure->reliability, 2);
  724|       |
  725|   143k|  *ptr_bit_cnt += bit_cnt_local;
  726|       |
  727|   143k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   143k|#define IA_NO_ERROR 0x00000000
  ------------------
  728|   143k|}
impd_drc_mux.c:impd_drc_enc_method_value:
  467|   143k|                                              WORD32 *code) {
  468|   143k|  WORD32 bits;
  469|   143k|  switch (method_definition) {
  470|  72.7k|    case METHOD_DEFINITION_UNKNOWN_OTHER:
  ------------------
  |  |   23|  72.7k|#define METHOD_DEFINITION_UNKNOWN_OTHER 0
  ------------------
  |  Branch (470:5): [True: 72.7k, False: 70.8k]
  ------------------
  471|  77.1k|    case METHOD_DEFINITION_PROGRAM_LOUDNESS:
  ------------------
  |  |   24|  77.1k|#define METHOD_DEFINITION_PROGRAM_LOUDNESS 1
  ------------------
  |  Branch (471:5): [True: 4.32k, False: 139k]
  ------------------
  472|  78.1k|    case METHOD_DEFINITION_ANCHOR_LOUDNESS:
  ------------------
  |  |   25|  78.1k|#define METHOD_DEFINITION_ANCHOR_LOUDNESS 2
  ------------------
  |  Branch (472:5): [True: 1.07k, False: 142k]
  ------------------
  473|  80.0k|    case METHOD_DEFINITION_MAX_OF_LOUDNESS_RANGE:
  ------------------
  |  |   26|  80.0k|#define METHOD_DEFINITION_MAX_OF_LOUDNESS_RANGE 3
  ------------------
  |  Branch (473:5): [True: 1.84k, False: 141k]
  ------------------
  474|  80.4k|    case METHOD_DEFINITION_MOMENTARY_LOUDNESS_MAX:
  ------------------
  |  |   27|  80.4k|#define METHOD_DEFINITION_MOMENTARY_LOUDNESS_MAX 4
  ------------------
  |  Branch (474:5): [True: 416, False: 143k]
  ------------------
  475|  81.7k|    case METHOD_DEFINITION_SHORT_TERM_LOUDNESS_MAX:
  ------------------
  |  |   28|  81.7k|#define METHOD_DEFINITION_SHORT_TERM_LOUDNESS_MAX 5
  ------------------
  |  Branch (475:5): [True: 1.28k, False: 142k]
  ------------------
  476|  81.7k|      bits = ((WORD32)(0.5f + 4.0f * (method_value + 57.75f) + 10000.0f)) - 10000;
  477|  81.7k|      bits = MIN(0x0FF, bits);
  ------------------
  |  |   86|  81.7k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 39.4k, False: 42.2k]
  |  |  ------------------
  ------------------
  478|  81.7k|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|  81.7k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 38.4k, False: 43.2k]
  |  |  ------------------
  ------------------
  479|  81.7k|      *code_size = 8;
  480|  81.7k|      break;
  481|    857|    case METHOD_DEFINITION_LOUDNESS_RANGE:
  ------------------
  |  |   29|    857|#define METHOD_DEFINITION_LOUDNESS_RANGE 6
  ------------------
  |  Branch (481:5): [True: 857, False: 142k]
  ------------------
  482|    857|      if (method_value >= 121.0f) {
  ------------------
  |  Branch (482:11): [True: 207, False: 650]
  ------------------
  483|    207|        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|    857|      *code_size = 8;
  494|    857|      break;
  495|  1.17k|    case METHOD_DEFINITION_MIXING_LEVEL:
  ------------------
  |  |   30|  1.17k|#define METHOD_DEFINITION_MIXING_LEVEL 7
  ------------------
  |  Branch (495:5): [True: 1.17k, False: 142k]
  ------------------
  496|  1.17k|      bits = (WORD32)(0.5f + method_value - 80.0f);
  497|  1.17k|      bits = MIN(0x1F, bits);
  ------------------
  |  |   86|  1.17k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 1.10k, False: 70]
  |  |  ------------------
  ------------------
  498|  1.17k|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|  1.17k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 70, False: 1.10k]
  |  |  ------------------
  ------------------
  499|  1.17k|      *code_size = 5;
  500|  1.17k|      break;
  501|    591|    case METHOD_DEFINITION_ROOM_TYPE:
  ------------------
  |  |   31|    591|#define METHOD_DEFINITION_ROOM_TYPE 8
  ------------------
  |  Branch (501:5): [True: 591, False: 143k]
  ------------------
  502|    591|      bits = (WORD32)(0.5f + method_value);
  503|    591|      if (bits > 0x2) {
  ------------------
  |  Branch (503:11): [True: 27, False: 564]
  ------------------
  504|     27|        return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  505|     27|      }
  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.3k|    case METHOD_DEFINITION_SHORT_TERM_LOUDNESS:
  ------------------
  |  |   32|  59.3k|#define METHOD_DEFINITION_SHORT_TERM_LOUDNESS 9
  ------------------
  |  Branch (510:5): [True: 59.3k, False: 84.3k]
  ------------------
  511|  59.3k|      bits = ((WORD32)(0.5f + 2.0f * (method_value + 116.f) + 10000.0f)) - 10000;
  512|  59.3k|      bits = MIN(0x0FF, bits);
  ------------------
  |  |   86|  59.3k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 42.8k, False: 16.5k]
  |  |  ------------------
  ------------------
  513|  59.3k|      bits = MAX(0x0, bits);
  ------------------
  |  |   89|  59.3k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 59.3k]
  |  |  ------------------
  ------------------
  514|  59.3k|      *code_size = 8;
  515|  59.3k|      break;
  516|      0|    default: {
  ------------------
  |  Branch (516:5): [True: 0, False: 143k]
  ------------------
  517|      0|      return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
  518|    591|    }
  519|   143k|  }
  520|   143k|  *code = bits;
  521|       |
  522|   143k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   143k|#define IA_NO_ERROR 0x00000000
  ------------------
  523|   143k|}
impd_drc_mux.c:get_num_ducking_only_drc_sets:
 1105|  3.51k|    UWORD32 drc_intructions_uni_drc_count) {
 1106|  3.51k|  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.40k, False: 3.51k]
  ------------------
 1108|  7.40k|    if (pstr_drc_instructions_uni_drc[i].ducking_only_set_present) {
  ------------------
  |  Branch (1108:9): [True: 1.13k, False: 6.27k]
  ------------------
 1109|  1.13k|      num_ducking_only_drc_sets++;
 1110|  1.13k|    }
 1111|  7.40k|  }
 1112|       |
 1113|  3.51k|  return num_ducking_only_drc_sets;
 1114|  3.51k|}
impd_drc_mux.c:impd_drc_write_drc_coeff_uni_drc:
 1391|  4.76k|    ia_drc_coefficients_uni_drc_struct *pstr_drc_coefficients_uni_drc, WORD32 *ptr_bit_cnt) {
 1392|  4.76k|  LOOPIDX idx;
 1393|  4.76k|  WORD32 bit_cnt_local = 0;
 1394|       |
 1395|  4.76k|  bit_cnt_local +=
 1396|  4.76k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->drc_location, 4);
 1397|       |
 1398|  4.76k|  bit_cnt_local +=
 1399|  4.76k|      iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->drc_frame_size_present, 1);
 1400|       |
 1401|  4.76k|  if (pstr_drc_coefficients_uni_drc->drc_frame_size_present) {
  ------------------
  |  Branch (1401:7): [True: 140, False: 4.62k]
  ------------------
 1402|    140|    bit_cnt_local += iusace_write_bits_buf(
 1403|    140|        it_bit_buf, (pstr_drc_coefficients_uni_drc->drc_frame_size - 1), 15);
 1404|    140|  }
 1405|       |
 1406|  4.76k|  if (version != 1) {
  ------------------
  |  Branch (1406:7): [True: 2.61k, False: 2.15k]
  ------------------
 1407|  2.61k|    bit_cnt_local +=
 1408|  2.61k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->gain_set_count, 6);
 1409|       |
 1410|  7.33k|    for (idx = 0; idx < pstr_drc_coefficients_uni_drc->gain_set_count; idx++) {
  ------------------
  |  Branch (1410:19): [True: 4.72k, False: 2.61k]
  ------------------
 1411|  4.72k|      impd_drc_write_gain_set_params(it_bit_buf, version,
 1412|  4.72k|                                     &(pstr_drc_coefficients_uni_drc->str_gain_set_params[idx]),
 1413|  4.72k|                                     &bit_cnt_local);
 1414|  4.72k|    }
 1415|  2.61k|  } else {
 1416|  2.15k|    bit_cnt_local += iusace_write_bits_buf(
 1417|  2.15k|        it_bit_buf, pstr_drc_coefficients_uni_drc->drc_characteristic_left_present, 1);
 1418|  2.15k|    if (pstr_drc_coefficients_uni_drc->drc_characteristic_left_present) {
  ------------------
  |  Branch (1418:9): [True: 0, False: 2.15k]
  ------------------
 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.15k|    bit_cnt_local += iusace_write_bits_buf(
 1430|  2.15k|        it_bit_buf, pstr_drc_coefficients_uni_drc->drc_characteristic_right_present, 1);
 1431|  2.15k|    if (pstr_drc_coefficients_uni_drc->drc_characteristic_right_present) {
  ------------------
  |  Branch (1431:9): [True: 0, False: 2.15k]
  ------------------
 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.15k|    bit_cnt_local += iusace_write_bits_buf(
 1442|  2.15k|        it_bit_buf, pstr_drc_coefficients_uni_drc->shape_filters_present, 1);
 1443|  2.15k|    if (pstr_drc_coefficients_uni_drc->shape_filters_present) {
  ------------------
  |  Branch (1443:9): [True: 0, False: 2.15k]
  ------------------
 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.15k|    bit_cnt_local +=
 1454|  2.15k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->gain_sequence_count, 6);
 1455|       |
 1456|  2.15k|    bit_cnt_local +=
 1457|  2.15k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_coefficients_uni_drc->gain_set_count, 6);
 1458|       |
 1459|  7.05k|    for (idx = 0; idx < pstr_drc_coefficients_uni_drc->gain_set_count; idx++) {
  ------------------
  |  Branch (1459:19): [True: 4.89k, False: 2.15k]
  ------------------
 1460|  4.89k|      impd_drc_write_gain_set_params(it_bit_buf, version,
 1461|  4.89k|                                     &(pstr_drc_coefficients_uni_drc->str_gain_set_params[idx]),
 1462|  4.89k|                                     &bit_cnt_local);
 1463|  4.89k|    }
 1464|  2.15k|  }
 1465|       |
 1466|  4.76k|  *ptr_bit_cnt += bit_cnt_local;
 1467|  4.76k|}
impd_drc_mux.c:impd_drc_write_gain_set_params:
 1245|  9.61k|                                           WORD32 *ptr_bit_cnt) {
 1246|  9.61k|  WORD32 bit_cnt_local = 0;
 1247|       |
 1248|  9.61k|  bit_cnt_local +=
 1249|  9.61k|      iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->gain_coding_profile, 2);
 1250|       |
 1251|  9.61k|  bit_cnt_local +=
 1252|  9.61k|      iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->gain_interpolation_type, 1);
 1253|       |
 1254|  9.61k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->full_frame, 1);
 1255|       |
 1256|  9.61k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->time_alignment, 1);
 1257|       |
 1258|  9.61k|  bit_cnt_local +=
 1259|  9.61k|      iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->time_delta_min_present, 1);
 1260|       |
 1261|  9.61k|  if (pstr_gain_set_params->time_delta_min_present) {
  ------------------
  |  Branch (1261:7): [True: 3.90k, False: 5.71k]
  ------------------
 1262|  3.90k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->delta_tmin - 1, 11);
 1263|  3.90k|  }
 1264|  9.61k|  if (pstr_gain_set_params->gain_coding_profile != GAIN_CODING_PROFILE_CONSTANT) {
  ------------------
  |  |   43|  9.61k|#define GAIN_CODING_PROFILE_CONSTANT 3
  ------------------
  |  Branch (1264:7): [True: 7.15k, False: 2.46k]
  ------------------
 1265|  7.15k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->band_count, 4);
 1266|  7.15k|    if (pstr_gain_set_params->band_count > 1) {
  ------------------
  |  Branch (1266:9): [True: 1.19k, False: 5.95k]
  ------------------
 1267|  1.19k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_gain_set_params->drc_band_type, 1);
 1268|  1.19k|    }
 1269|       |
 1270|  7.15k|    impd_drc_write_gain_params(it_bit_buf, version, pstr_gain_set_params->band_count,
 1271|  7.15k|                               pstr_gain_set_params->drc_band_type,
 1272|  7.15k|                               pstr_gain_set_params->gain_params, &bit_cnt_local);
 1273|  7.15k|  }
 1274|       |
 1275|  9.61k|  *ptr_bit_cnt += bit_cnt_local;
 1276|  9.61k|}
impd_drc_mux.c:impd_drc_write_gain_params:
 1185|  7.15k|                                       WORD32 *ptr_bit_cnt) {
 1186|  7.15k|  LOOPIDX idx;
 1187|  7.15k|  WORD32 bit_cnt_local = 0;
 1188|       |
 1189|  7.15k|  if (version != 1) {
  ------------------
  |  Branch (1189:7): [True: 4.09k, False: 3.05k]
  ------------------
 1190|  6.34k|    for (idx = 0; idx < band_count; idx++) {
  ------------------
  |  Branch (1190:19): [True: 2.24k, False: 4.09k]
  ------------------
 1191|  2.24k|      bit_cnt_local +=
 1192|  2.24k|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].drc_characteristic, 7);
 1193|  2.24k|    }
 1194|  4.09k|  } else {
 1195|  3.05k|    WORD32 index_present;
 1196|  3.05k|    WORD32 gain_sequence_index_last = -1;
 1197|  5.95k|    for (idx = 0; idx < band_count; idx++) {
  ------------------
  |  Branch (1197:19): [True: 2.90k, False: 3.05k]
  ------------------
 1198|  2.90k|      if (pstr_gain_params[idx].gain_sequence_index == gain_sequence_index_last + 1) {
  ------------------
  |  Branch (1198:11): [True: 2.90k, False: 0]
  ------------------
 1199|  2.90k|        index_present = 0;
 1200|  2.90k|      } else {
 1201|      0|        index_present = 1;
 1202|      0|      }
 1203|  2.90k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, index_present, 1);
 1204|       |
 1205|  2.90k|      if (index_present == 1) {
  ------------------
  |  Branch (1205:11): [True: 0, False: 2.90k]
  ------------------
 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|  2.90k|      bit_cnt_local +=
 1212|  2.90k|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].drc_characteristic_present, 1);
 1213|  2.90k|      if (pstr_gain_params[idx].drc_characteristic_present) {
  ------------------
  |  Branch (1213:11): [True: 0, False: 2.90k]
  ------------------
 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|  2.90k|    }
 1228|  3.05k|  }
 1229|       |
 1230|  8.46k|  for (idx = 1; idx < band_count; idx++) {
  ------------------
  |  Branch (1230:17): [True: 1.30k, False: 7.15k]
  ------------------
 1231|  1.30k|    if (drc_band_type) {
  ------------------
  |  Branch (1231:9): [True: 166, False: 1.14k]
  ------------------
 1232|    166|      bit_cnt_local +=
 1233|    166|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].crossover_freq_index, 4);
 1234|  1.14k|    } else {
 1235|  1.14k|      bit_cnt_local +=
 1236|  1.14k|          iusace_write_bits_buf(it_bit_buf, pstr_gain_params[idx].start_sub_band_index, 10);
 1237|  1.14k|    }
 1238|  1.30k|  }
 1239|       |
 1240|  7.15k|  *ptr_bit_cnt += bit_cnt_local;
 1241|  7.15k|}
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.90k, False: 1.35k]
  ------------------
  802|  1.90k|    err_code = impd_drc_get_drc_complexity_level(pstr_uni_drc_config, pstr_gain_enc,
  803|  1.90k|                                                 pstr_drc_instructions_uni_drc, ptr_scratch);
  804|  1.90k|    if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.90k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (804:9): [True: 308, False: 1.59k]
  ------------------
  805|    308|      return (err_code);
  806|    308|    }
  807|       |
  808|  1.59k|    bit_cnt_local += iusace_write_bits_buf(
  809|  1.59k|        it_bit_buf, pstr_drc_instructions_uni_drc->drc_set_complexity_level, 4);
  810|  1.59k|  }
  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.35k, False: 1.59k]
  ------------------
  819|  1.35k|    pstr_drc_instructions_uni_drc->downmix_id_present = 1;
  820|  1.59k|  } else {
  821|  1.59k|    bit_cnt_local +=
  822|  1.59k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->downmix_id_present, 1);
  823|  1.59k|  }
  824|       |
  825|  2.95k|  if (pstr_drc_instructions_uni_drc->downmix_id_present != 1) {
  ------------------
  |  Branch (825:7): [True: 1.59k, False: 1.35k]
  ------------------
  826|  1.59k|    pstr_drc_instructions_uni_drc->downmix_id = 0;
  827|  1.59k|  } else {
  828|  1.35k|    bit_cnt_local +=
  829|  1.35k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->downmix_id, 7);
  830|  1.35k|    if (version == 1) {
  ------------------
  |  Branch (830:9): [True: 0, False: 1.35k]
  ------------------
  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.35k|    bit_cnt_local += iusace_write_bits_buf(
  835|  1.35k|        it_bit_buf, pstr_drc_instructions_uni_drc->additional_downmix_id_present, 1);
  836|       |
  837|  1.35k|    if (pstr_drc_instructions_uni_drc->additional_downmix_id_present) {
  ------------------
  |  Branch (837:9): [True: 812, False: 544]
  ------------------
  838|    812|      bit_cnt_local += iusace_write_bits_buf(
  839|    812|          it_bit_buf, pstr_drc_instructions_uni_drc->additional_downmix_id_count, 3);
  840|  4.53k|      for (i = 0; i < pstr_drc_instructions_uni_drc->additional_downmix_id_count; i++) {
  ------------------
  |  Branch (840:19): [True: 3.71k, False: 812]
  ------------------
  841|  3.71k|        bit_cnt_local += iusace_write_bits_buf(
  842|  3.71k|            it_bit_buf, pstr_drc_instructions_uni_drc->additional_downmix_id[i], 7);
  843|  3.71k|      }
  844|    812|    } else {
  845|    544|      pstr_drc_instructions_uni_drc->additional_downmix_id_count = 0;
  846|    544|    }
  847|  1.35k|  }
  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.19k, False: 1.76k]
  ------------------
  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.19k|    bit_cnt_local += iusace_write_bits_buf(
  855|  1.19k|        it_bit_buf, pstr_drc_instructions_uni_drc->limiter_peak_target_present, 1);
  856|  1.19k|    if (pstr_drc_instructions_uni_drc->limiter_peak_target_present) {
  ------------------
  |  Branch (856:9): [True: 664, False: 528]
  ------------------
  857|    664|      tmp = (WORD32)(0.5f - 8.0f * pstr_drc_instructions_uni_drc->limiter_peak_target);
  858|    664|      tmp = MAX(0, tmp);
  ------------------
  |  |   89|    664|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 664]
  |  |  ------------------
  ------------------
  859|    664|      tmp = MIN(0xFF, tmp);
  ------------------
  |  |   86|    664|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 664]
  |  |  ------------------
  ------------------
  860|    664|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 8);
  861|    664|    }
  862|  1.19k|  }
  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.52k]
  ------------------
  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: 227]
  ------------------
  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.59k, False: 1.35k]
  ------------------
  892|  1.59k|    bit_cnt_local +=
  893|  1.59k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_instructions_uni_drc->requires_eq, 1);
  894|  1.59k|  }
  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.76k, False: 1.19k]
  ------------------
  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.76k|    i = 0;
  900|  5.09k|    while (i < channel_count) {
  ------------------
  |  Branch (900:12): [True: 3.33k, False: 1.76k]
  ------------------
  901|  3.33k|      pstr_ducking_modifiers = pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel;
  902|  3.33k|      bs_sequence_index = pstr_drc_instructions_uni_drc->gain_set_index[i] + 1;
  903|       |
  904|  3.33k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bs_sequence_index, 6);
  905|       |
  906|  3.33k|      impd_drc_enc_ducking_modifiers(it_bit_buf, &(pstr_ducking_modifiers[i]), &bit_cnt_local);
  907|       |
  908|  3.33k|      sequence_index_prev = pstr_drc_instructions_uni_drc->gain_set_index[i];
  909|  3.33k|      ducking_scaling_quantized_prev = pstr_ducking_modifiers[i].ducking_scaling_quantized;
  910|  3.33k|      i++;
  911|       |
  912|  3.33k|      if (i < channel_count) {
  ------------------
  |  Branch (912:11): [True: 1.57k, False: 1.76k]
  ------------------
  913|  1.57k|        impd_drc_quantize_ducking_scaling(&(pstr_ducking_modifiers[i]));
  914|  1.57k|      }
  915|       |
  916|  3.33k|      repeat_parameters_count = 0;
  917|  3.33k|      while ((i < channel_count) && (repeat_parameters_count <= 32) &&
  ------------------
  |  Branch (917:14): [True: 1.57k, False: 1.76k]
  |  Branch (917:37): [True: 1.57k, False: 0]
  ------------------
  918|  1.57k|             (sequence_index_prev == pstr_drc_instructions_uni_drc->gain_set_index[i]) &&
  ------------------
  |  Branch (918:14): [True: 1.47k, False: 93]
  ------------------
  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.33k|      if (repeat_parameters_count <= 0) {
  ------------------
  |  Branch (927:11): [True: 3.33k, False: 0]
  ------------------
  928|  3.33k|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
  929|  3.33k|      } 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.33k|    }
  934|  15.8k|    for (j = 0; j < MAX_CHANNEL_COUNT; j++) {
  ------------------
  |  |   25|  15.8k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (934:17): [True: 14.0k, False: 1.76k]
  ------------------
  935|  14.0k|      unique_index[j] = -10;
  936|  14.0k|      unique_scaling[j] = -10.0f;
  937|  14.0k|    }
  938|       |
  939|  1.76k|    ducking_sequence = -1;
  940|  1.76k|    g = 0;
  941|       |
  942|  1.76k|    if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.76k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (942:9): [True: 1.48k, False: 280]
  ------------------
  943|  4.32k|      for (j = 0; j < channel_count; j++) {
  ------------------
  |  Branch (943:19): [True: 2.84k, False: 1.48k]
  ------------------
  944|  2.84k|        match = FALSE;
  ------------------
  |  |   26|  2.84k|#define FALSE (0)
  ------------------
  945|  2.84k|        index = pstr_drc_instructions_uni_drc->gain_set_index[j];
  946|  2.84k|        factor =
  947|  2.84k|            pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel[j].ducking_scaling;
  948|  2.92k|        for (n = 0; n < g; n++) {
  ------------------
  |  Branch (948:21): [True: 1.36k, False: 1.55k]
  ------------------
  949|  1.36k|          if ((index >= 0) && (unique_index[n] == index) && (unique_scaling[n] == factor)) {
  ------------------
  |  Branch (949:15): [True: 1.36k, False: 0]
  |  Branch (949:31): [True: 1.28k, False: 77]
  |  Branch (949:61): [True: 1.28k, False: 0]
  ------------------
  950|  1.28k|            match = TRUE;
  ------------------
  |  |   23|  1.28k|#define TRUE (1)
  ------------------
  951|  1.28k|            break;
  952|  1.28k|          }
  953|  1.36k|        }
  954|  2.84k|        if (match == FALSE) {
  ------------------
  |  |   26|  2.84k|#define FALSE (0)
  ------------------
  |  Branch (954:13): [True: 1.55k, False: 1.28k]
  ------------------
  955|  1.55k|          if (index >= 0) {
  ------------------
  |  Branch (955:15): [True: 1.55k, False: 0]
  ------------------
  956|  1.55k|            unique_index[g] = index;
  957|  1.55k|            unique_scaling[g] = factor;
  958|  1.55k|            g++;
  959|  1.55k|          }
  960|  1.55k|        }
  961|  2.84k|      }
  962|  1.48k|      pstr_drc_instructions_uni_drc->num_drc_channel_groups = g;
  963|  1.48k|    } else if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_OTHER) {
  ------------------
  |  |   37|    280|#define EFFECT_BIT_DUCK_OTHER 0x0400
  ------------------
  |  Branch (963:16): [True: 280, False: 0]
  ------------------
  964|    754|      for (j = 0; j < channel_count; j++) {
  ------------------
  |  Branch (964:19): [True: 487, False: 267]
  ------------------
  965|    487|        match = FALSE;
  ------------------
  |  |   26|    487|#define FALSE (0)
  ------------------
  966|    487|        index = pstr_drc_instructions_uni_drc->gain_set_index[j];
  967|    487|        factor =
  968|    487|            pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel[j].ducking_scaling;
  969|    487|        for (n = 0; n < g; n++) {
  ------------------
  |  Branch (969:21): [True: 0, False: 487]
  ------------------
  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|    487|        if (match == FALSE) {
  ------------------
  |  |   26|    487|#define FALSE (0)
  ------------------
  |  Branch (976:13): [True: 487, False: 0]
  ------------------
  977|    487|          if (index < 0) {
  ------------------
  |  Branch (977:15): [True: 0, False: 487]
  ------------------
  978|      0|            unique_index[g] = index;
  979|      0|            unique_scaling[g] = factor;
  980|      0|            g++;
  981|    487|          } else {
  982|    487|            if ((ducking_sequence > 0) && (ducking_sequence != index)) {
  ------------------
  |  Branch (982:17): [True: 90, False: 397]
  |  Branch (982:43): [True: 13, False: 77]
  ------------------
  983|     13|              return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  984|     13|            }
  985|    474|            ducking_sequence = index;
  986|    474|          }
  987|    487|        }
  988|    487|      }
  989|    267|      pstr_drc_instructions_uni_drc->num_drc_channel_groups = g;
  990|    267|      if (ducking_sequence < 0) {
  ------------------
  |  Branch (990:11): [True: 0, False: 267]
  ------------------
  991|      0|        return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  992|      0|      }
  993|    267|    }
  994|       |
  995|  3.30k|    for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (995:17): [True: 1.55k, False: 1.74k]
  ------------------
  996|  1.55k|      if (pstr_drc_instructions_uni_drc->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.55k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (996:11): [True: 1.55k, False: 0]
  ------------------
  997|  1.55k|        pstr_drc_instructions_uni_drc->gain_set_index_for_channel_group[g] = unique_index[g];
  998|  1.55k|      } 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.55k|      pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel_group[g].ducking_scaling =
 1003|  1.55k|          unique_scaling[g];
 1004|  1.55k|      if (unique_scaling[g] == 1.0f) {
  ------------------
  |  Branch (1004:11): [True: 0, False: 1.55k]
  ------------------
 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.55k|      } else {
 1008|  1.55k|        pstr_drc_instructions_uni_drc->str_ducking_modifiers_for_channel_group[g]
 1009|  1.55k|            .ducking_scaling_present = TRUE;
  ------------------
  |  |   23|  1.55k|#define TRUE (1)
  ------------------
 1010|  1.55k|      }
 1011|  1.55k|    }
 1012|  1.74k|  } else {
 1013|  1.19k|    if ((version == 0 || pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0) &&
  ------------------
  |  Branch (1013:10): [True: 666, False: 526]
  |  Branch (1013:26): [True: 0, False: 526]
  ------------------
 1014|    666|        ((pstr_drc_instructions_uni_drc->downmix_id == 0x7F) ||
  ------------------
  |  Branch (1014:10): [True: 50, False: 616]
  ------------------
 1015|    616|         (pstr_drc_instructions_uni_drc->additional_downmix_id_count != 0))) {
  ------------------
  |  Branch (1015:10): [True: 360, False: 256]
  ------------------
 1016|    410|      channel_count = 1;
 1017|    782|    } else if ((version == 0 || pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0) &&
  ------------------
  |  Branch (1017:17): [True: 256, False: 526]
  |  Branch (1017:33): [True: 0, False: 526]
  ------------------
 1018|    256|               (pstr_drc_instructions_uni_drc->downmix_id != 0) &&
  ------------------
  |  Branch (1018:16): [True: 183, False: 73]
  ------------------
 1019|    183|               (pstr_drc_instructions_uni_drc->downmix_id != 0x7F) &&
  ------------------
  |  Branch (1019:16): [True: 183, False: 0]
  ------------------
 1020|    183|               (pstr_drc_instructions_uni_drc->additional_downmix_id_count == 0)) {
  ------------------
  |  Branch (1020:16): [True: 183, False: 0]
  ------------------
 1021|    390|      for (i = 0; i < pstr_uni_drc_config->downmix_instructions_count; i++) {
  ------------------
  |  Branch (1021:19): [True: 207, False: 183]
  ------------------
 1022|    207|        if (pstr_drc_instructions_uni_drc->downmix_id ==
  ------------------
  |  Branch (1022:13): [True: 0, False: 207]
  ------------------
 1023|    207|            pstr_uni_drc_config->str_downmix_instructions[i].downmix_id) {
 1024|      0|          break;
 1025|      0|        }
 1026|    207|      }
 1027|    183|      if (i == pstr_uni_drc_config->downmix_instructions_count) {
  ------------------
  |  Branch (1027:11): [True: 183, False: 0]
  ------------------
 1028|    183|        return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
 1029|    183|      }
 1030|      0|      channel_count = pstr_uni_drc_config->str_downmix_instructions[i].target_ch_count;
 1031|      0|    }
 1032|       |
 1033|  1.00k|    i = 0;
 1034|  2.11k|    while (i < channel_count) {
  ------------------
  |  Branch (1034:12): [True: 1.10k, False: 1.00k]
  ------------------
 1035|  1.10k|      bs_sequence_index = pstr_drc_instructions_uni_drc->gain_set_index[i] + 1;
 1036|  1.10k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bs_sequence_index, 6);
 1037|  1.10k|      sequence_index_prev = pstr_drc_instructions_uni_drc->gain_set_index[i];
 1038|  1.10k|      i++;
 1039|       |
 1040|  1.10k|      repeat_sequence_count = 0;
 1041|  1.55k|      while ((i < channel_count) &&
  ------------------
  |  Branch (1041:14): [True: 547, False: 1.00k]
  ------------------
 1042|    547|             (sequence_index_prev == pstr_drc_instructions_uni_drc->gain_set_index[i]) &&
  ------------------
  |  Branch (1042:14): [True: 452, False: 95]
  ------------------
 1043|    452|             (repeat_sequence_count <= 32)) {
  ------------------
  |  Branch (1043:14): [True: 452, False: 0]
  ------------------
 1044|    452|        repeat_sequence_count++;
 1045|    452|        i++;
 1046|    452|      }
 1047|  1.10k|      if (repeat_sequence_count <= 0) {
  ------------------
  |  Branch (1047:11): [True: 652, False: 452]
  ------------------
 1048|    652|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 1049|    652|      } else {
 1050|    452|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 1, 1);
 1051|    452|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, repeat_sequence_count - 1, 5);
 1052|    452|      }
 1053|  1.10k|    }
 1054|  9.08k|    for (i = 0; i < MAX_CHANNEL_COUNT; i++) {
  ------------------
  |  |   25|  9.08k|#define MAX_CHANNEL_COUNT (8)
  ------------------
  |  Branch (1054:17): [True: 8.07k, False: 1.00k]
  ------------------
 1055|  8.07k|      unique_index[i] = -1;
 1056|  8.07k|    }
 1057|       |
 1058|  1.00k|    k = 0;
 1059|  2.56k|    for (i = 0; i < channel_count; i++) {
  ------------------
  |  Branch (1059:17): [True: 1.55k, False: 1.00k]
  ------------------
 1060|  1.55k|      tmp_2 = pstr_drc_instructions_uni_drc->gain_set_index[i];
 1061|  1.55k|      if (tmp_2 >= 0) {
  ------------------
  |  Branch (1061:11): [True: 1.55k, False: 0]
  ------------------
 1062|  1.55k|        match = FALSE;
  ------------------
  |  |   26|  1.55k|#define FALSE (0)
  ------------------
 1063|  2.10k|        for (n = 0; n < k; n++) {
  ------------------
  |  Branch (1063:21): [True: 547, False: 1.55k]
  ------------------
 1064|    547|          if (unique_index[n] == tmp_2) {
  ------------------
  |  Branch (1064:15): [True: 452, False: 95]
  ------------------
 1065|    452|            match = TRUE;
  ------------------
  |  |   23|    452|#define TRUE (1)
  ------------------
 1066|    452|          }
 1067|    547|        }
 1068|  1.55k|        if (match == FALSE) {
  ------------------
  |  |   26|  1.55k|#define FALSE (0)
  ------------------
  |  Branch (1068:13): [True: 1.10k, False: 452]
  ------------------
 1069|  1.10k|          unique_index[k] = tmp_2;
 1070|  1.10k|          k++;
 1071|  1.10k|        }
 1072|  1.55k|      }
 1073|  1.55k|    }
 1074|  1.00k|    pstr_drc_instructions_uni_drc->num_drc_channel_groups = k;
 1075|  2.11k|    for (i = 0; i < pstr_drc_instructions_uni_drc->num_drc_channel_groups; i++) {
  ------------------
  |  Branch (1075:17): [True: 1.10k, False: 1.00k]
  ------------------
 1076|  1.10k|      band_count = 0;
 1077|  1.10k|      pstr_drc_instructions_uni_drc->gain_set_index_for_channel_group[i] = unique_index[i];
 1078|       |
 1079|  1.10k|      if (pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count > 0) {
  ------------------
  |  Branch (1079:11): [True: 547, False: 557]
  ------------------
 1080|    547|        band_count =
 1081|    547|            pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
 1082|    547|                .str_gain_set_params[pstr_drc_instructions_uni_drc
 1083|    547|                                         ->gain_set_index_for_channel_group[i]]
 1084|    547|                .band_count;
 1085|    557|      } else if (pstr_uni_drc_config->drc_coefficients_uni_drc_count > 0) {
  ------------------
  |  Branch (1085:18): [True: 260, False: 297]
  ------------------
 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.10k|      impd_drc_enc_gain_modifiers(it_bit_buf, version, band_count,
 1093|  1.10k|                                  &(pstr_drc_instructions_uni_drc->str_gain_modifiers[i]),
 1094|  1.10k|                                  &bit_cnt_local);
 1095|  1.10k|    }
 1096|  1.00k|  }
 1097|       |
 1098|  2.75k|  *ptr_bit_cnt += bit_cnt_local;
 1099|  2.75k|  return err_code;
 1100|  2.95k|}
impd_drc_mux.c:impd_drc_get_drc_complexity_level:
   42|  1.90k|    ia_drc_instructions_uni_drc *pstr_drc_instructions_uni_drc, VOID *ptr_scratch) {
   43|  1.90k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.90k|#define IA_NO_ERROR 0x00000000
  ------------------
   44|  1.90k|  LOOPIDX c, g, k, i, group;
   45|  1.90k|  WORD32 band_count;
   46|  1.90k|  WORD32 gain_set_index;
   47|  1.90k|  WORD32 skip_set;
   48|  1.90k|  WORD32 gain_set_index_offset;
   49|  1.90k|  WORD32 parametric_drc_type = 0;
   50|  1.90k|  WORD32 channel_count_side_chain;
   51|  1.90k|  WORD32 channel_count_drom_downmix_id;
   52|  1.90k|  WORD32 channel_count_temp;
   53|  1.90k|  WORD32 weighting_filter_order;
   54|  1.90k|  WORD32 channel_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
   55|  1.90k|  FLOAT32 w_mod, cplx, cplx_tmp, ratio;
   56|  1.90k|  ia_drc_gain_modifiers_struct *pstr_gain_modifiers = NULL;
   57|  1.90k|  ia_drc_shape_filter_block_params_struct *pstr_shape_filter_block_params = NULL;
   58|  1.90k|  ia_drc_gain_set_params_struct *pstr_gain_set_params = NULL;
   59|  1.90k|  ia_drc_parametric_drc_instructions_struct *pstr_parametric_drc_instructions = NULL;
   60|  1.90k|  ia_drc_parametric_drc_gain_set_params_struct *pstr_parametric_drc_gain_set_params = NULL;
   61|       |
   62|  1.90k|  if (pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0 &&
  ------------------
  |  Branch (62:7): [True: 0, False: 1.90k]
  ------------------
   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.90k|  } else if ((pstr_drc_instructions_uni_drc->drc_apply_to_downmix != 0) &&
  ------------------
  |  Branch (66:14): [True: 0, False: 1.90k]
  ------------------
   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.90k|  pstr_drc_instructions_uni_drc->drc_channel_count = channel_count;
   83|  1.90k|  group = 0;
   84|  5.56k|  for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (84:15): [True: 3.65k, False: 1.90k]
  ------------------
   85|  3.65k|    gain_set_index = pstr_drc_instructions_uni_drc->gain_set_index[c];
   86|  3.65k|    skip_set = FALSE;
  ------------------
  |  |   26|  3.65k|#define FALSE (0)
  ------------------
   87|  3.65k|    if (gain_set_index < 0) {
  ------------------
  |  Branch (87:9): [True: 0, False: 3.65k]
  ------------------
   88|      0|      pstr_drc_instructions_uni_drc->channel_group_for_channel[c] = -1;
   89|  3.65k|    } else {
   90|  5.40k|      for (k = c - 1; k >= 0; k--) {
  ------------------
  |  Branch (90:23): [True: 1.75k, False: 3.65k]
  ------------------
   91|  1.75k|        if (pstr_drc_instructions_uni_drc->gain_set_index[k] == gain_set_index) {
  ------------------
  |  Branch (91:13): [True: 1.61k, False: 140]
  ------------------
   92|  1.61k|          pstr_drc_instructions_uni_drc->channel_group_for_channel[c] =
   93|  1.61k|              pstr_drc_instructions_uni_drc->channel_group_for_channel[k];
   94|  1.61k|          skip_set = TRUE;
  ------------------
  |  |   23|  1.61k|#define TRUE (1)
  ------------------
   95|  1.61k|        }
   96|  1.75k|      }
   97|  3.65k|      if (skip_set == FALSE) {
  ------------------
  |  |   26|  3.65k|#define FALSE (0)
  ------------------
  |  Branch (97:11): [True: 2.04k, False: 1.61k]
  ------------------
   98|  2.04k|        pstr_drc_instructions_uni_drc->channel_group_for_channel[c] = group;
   99|  2.04k|        group++;
  100|  2.04k|      }
  101|  3.65k|    }
  102|  3.65k|  }
  103|  1.90k|  if (group != pstr_drc_instructions_uni_drc->num_drc_channel_groups) {
  ------------------
  |  Branch (103:7): [True: 291, False: 1.61k]
  ------------------
  104|    291|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  105|    291|  }
  106|       |
  107|  3.34k|  for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (107:15): [True: 1.72k, False: 1.61k]
  ------------------
  108|  1.72k|    pstr_drc_instructions_uni_drc->num_channels_per_channel_group[g] = 0;
  109|  5.10k|    for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (109:17): [True: 3.38k, False: 1.72k]
  ------------------
  110|  3.38k|      if (pstr_drc_instructions_uni_drc->channel_group_for_channel[c] == g) {
  ------------------
  |  Branch (110:11): [True: 3.15k, False: 230]
  ------------------
  111|  3.15k|        pstr_drc_instructions_uni_drc->num_channels_per_channel_group[g]++;
  112|  3.15k|      }
  113|  3.38k|    }
  114|  1.72k|  }
  115|       |
  116|  1.61k|  cplx = 0.0f;
  117|       |
  118|  1.61k|  if (pstr_drc_gain_enc->domain == TIME_DOMAIN) {
  ------------------
  |  |   79|  1.61k|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (118:7): [True: 711, False: 902]
  ------------------
  119|    711|    w_mod = COMPLEXITY_W_MOD_TIME;
  ------------------
  |  |  103|    711|#define COMPLEXITY_W_MOD_TIME 1.0f
  ------------------
  120|    902|  } else {
  121|    902|    w_mod = COMPLEXITY_W_MOD_SUBBAND;
  ------------------
  |  |  104|    902|#define COMPLEXITY_W_MOD_SUBBAND 2.0f
  ------------------
  122|    902|  }
  123|  4.76k|  for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (123:15): [True: 3.15k, False: 1.61k]
  ------------------
  124|  3.15k|    if (pstr_drc_instructions_uni_drc->gain_set_index[c] >= 0) {
  ------------------
  |  Branch (124:9): [True: 3.15k, False: 0]
  ------------------
  125|  3.15k|      cplx += w_mod;
  126|  3.15k|    }
  127|  3.15k|  }
  128|       |
  129|  1.61k|  if (pstr_drc_gain_enc->domain != TIME_DOMAIN) {
  ------------------
  |  |   79|  1.61k|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (129:7): [True: 902, False: 711]
  ------------------
  130|    902|    pstr_gain_set_params =
  131|    902|        pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  132|    902|            .str_gain_set_params;
  133|  2.65k|    for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (133:17): [True: 1.75k, False: 902]
  ------------------
  134|  1.75k|      gain_set_index = pstr_drc_instructions_uni_drc->gain_set_index[c];
  135|  1.75k|      if (gain_set_index >= 0) {
  ------------------
  |  Branch (135:11): [True: 1.75k, False: 0]
  ------------------
  136|  1.75k|        if (pstr_gain_set_params[gain_set_index].drc_band_type == 1) {
  ------------------
  |  Branch (136:13): [True: 0, False: 1.75k]
  ------------------
  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.75k|      }
  143|  1.75k|    }
  144|    902|  } else {
  145|    711|    err_code = impd_drc_init_all_filter_banks(
  146|    711|        &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0],
  147|    711|        pstr_drc_instructions_uni_drc, &pstr_drc_gain_enc->str_filter_banks, ptr_scratch);
  148|       |
  149|    711|    if (err_code) return err_code;
  ------------------
  |  Branch (149:9): [True: 17, False: 694]
  ------------------
  150|       |
  151|    694|    cplx += COMPLEXITY_W_IIR * pstr_drc_gain_enc->str_filter_banks.complexity;
  ------------------
  |  |  102|    694|#define COMPLEXITY_W_IIR 5.0f
  ------------------
  152|       |
  153|  1.42k|    for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (153:17): [True: 729, False: 694]
  ------------------
  154|    729|      pstr_gain_modifiers = &pstr_drc_instructions_uni_drc->str_gain_modifiers[g];
  155|    729|      if (pstr_gain_modifiers->shape_filter_present == 1) {
  ------------------
  |  Branch (155:11): [True: 0, False: 729]
  ------------------
  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|    729|    }
  175|    694|  }
  176|       |
  177|  3.29k|  for (g = 0; g < pstr_drc_instructions_uni_drc->num_drc_channel_groups; g++) {
  ------------------
  |  Branch (177:15): [True: 1.70k, False: 1.59k]
  ------------------
  178|  1.70k|    gain_set_index_offset = 0;
  179|  1.70k|    gain_set_index = -1;
  180|  1.80k|    for (c = 0; c < pstr_drc_instructions_uni_drc->drc_channel_count; c++) {
  ------------------
  |  Branch (180:17): [True: 1.80k, False: 0]
  ------------------
  181|  1.80k|      if (pstr_drc_instructions_uni_drc->channel_group_for_channel[c] == g) {
  ------------------
  |  Branch (181:11): [True: 1.70k, False: 106]
  ------------------
  182|  1.70k|        gain_set_index = pstr_drc_instructions_uni_drc->gain_set_index[c];
  183|  1.70k|        break;
  184|  1.70k|      }
  185|  1.80k|    }
  186|  1.70k|    if (pstr_uni_drc_config->str_uni_drc_config_ext.drc_coefficients_uni_drc_v1_count > 0) {
  ------------------
  |  Branch (186:9): [True: 1.60k, False: 94]
  ------------------
  187|  1.60k|      gain_set_index_offset =
  188|  1.60k|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  189|  1.60k|              .gain_set_count;
  190|  1.60k|      pstr_gain_set_params =
  191|  1.60k|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_coefficients_uni_drc_v1[0]
  192|  1.60k|              .str_gain_set_params;
  193|  1.60k|    }
  194|  1.70k|    if (gain_set_index >= gain_set_index_offset) {
  ------------------
  |  Branch (194:9): [True: 305, False: 1.39k]
  ------------------
  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.39k|    } else {
  291|  1.39k|      if (pstr_drc_gain_enc->domain == TIME_DOMAIN && pstr_gain_set_params != NULL) {
  ------------------
  |  |   79|  2.79k|#define TIME_DOMAIN (1)
  ------------------
  |  Branch (291:11): [True: 663, False: 734]
  |  Branch (291:55): [True: 663, False: 0]
  ------------------
  292|    663|        if (pstr_gain_set_params[gain_set_index].gain_interpolation_type ==
  ------------------
  |  Branch (292:13): [True: 309, False: 354]
  ------------------
  293|    663|            GAIN_INTERPOLATION_TYPE_SPLINE) {
  ------------------
  |  |   45|    663|#define GAIN_INTERPOLATION_TYPE_SPLINE 0
  ------------------
  294|    309|          cplx += COMPLEXITY_W_SPLINE;
  ------------------
  |  |  107|    309|#define COMPLEXITY_W_SPLINE 5.0f
  ------------------
  295|    309|        }
  296|    663|        if (pstr_gain_set_params[gain_set_index].gain_interpolation_type ==
  ------------------
  |  Branch (296:13): [True: 354, False: 309]
  ------------------
  297|    663|            GAIN_INTERPOLATION_TYPE_LINEAR) {
  ------------------
  |  |   46|    663|#define GAIN_INTERPOLATION_TYPE_LINEAR 1
  ------------------
  298|    354|          cplx += COMPLEXITY_W_LINEAR;
  ------------------
  |  |  108|    354|#define COMPLEXITY_W_LINEAR 2.5f
  ------------------
  299|    354|        }
  300|    663|      }
  301|  1.39k|    }
  302|  1.70k|  }
  303|       |
  304|  1.59k|  if (pstr_drc_instructions_uni_drc->downmix_id == 0x7F) {
  ------------------
  |  Branch (304:7): [True: 33, False: 1.56k]
  ------------------
  305|     33|    channel_count = pstr_uni_drc_config->str_channel_layout.base_ch_count;
  306|     33|  }
  307|       |
  308|  1.59k|  cplx = (FLOAT32)(log10(cplx / channel_count) / log10(2.0f));
  309|  1.59k|  pstr_drc_instructions_uni_drc->drc_set_complexity_level = (WORD32)MAX(0, ceil(cplx));
  ------------------
  |  |   89|  1.59k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 0, False: 1.59k]
  |  |  ------------------
  ------------------
  310|       |
  311|  1.59k|  if (pstr_drc_instructions_uni_drc->drc_set_complexity_level > DRC_COMPLEXITY_LEVEL_MAX) {
  ------------------
  |  |   98|  1.59k|#define DRC_COMPLEXITY_LEVEL_MAX 15
  ------------------
  |  Branch (311:7): [True: 0, False: 1.59k]
  ------------------
  312|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
  313|      0|  }
  314|       |
  315|  1.59k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  1.59k|#define IA_NO_ERROR 0x00000000
  ------------------
  316|  1.59k|}
impd_drc_mux.c:impd_drc_enc_ducking_modifiers:
  593|  3.33k|    WORD32 *ptr_bit_cnt) {
  594|  3.33k|  WORD32 bits;
  595|  3.33k|  WORD32 remove_scaling_value;
  596|  3.33k|  WORD32 bit_cnt_local = 0;
  597|       |
  598|  3.33k|  if (pstr_ducking_modifiers->ducking_scaling_present == FALSE) {
  ------------------
  |  |   26|  3.33k|#define FALSE (0)
  ------------------
  |  Branch (598:7): [True: 3.33k, False: 0]
  ------------------
  599|  3.33k|    bit_cnt_local +=
  600|  3.33k|        iusace_write_bits_buf(it_bit_buf, pstr_ducking_modifiers->ducking_scaling_present, 1);
  601|  3.33k|  } 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.33k|  *ptr_bit_cnt += bit_cnt_local;
  619|  3.33k|}
impd_drc_mux.c:impd_drc_quantize_ducking_scaling:
  526|  1.57k|    ia_drc_ducking_modifiers_struct *pstr_ducking_modifiers) {
  527|  1.57k|  WORD32 mu;
  528|  1.57k|  FLOAT32 delta;
  529|       |
  530|  1.57k|  if (pstr_ducking_modifiers->ducking_scaling_present) {
  ------------------
  |  Branch (530:7): [True: 0, False: 1.57k]
  ------------------
  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.57k|  } else {
  555|  1.57k|    pstr_ducking_modifiers->ducking_scaling_quantized = 1.0f;
  556|  1.57k|  }
  557|  1.57k|}
impd_drc_mux.c:impd_drc_enc_gain_modifiers:
  624|  1.10k|                                        WORD32 *ptr_bit_cnt) {
  625|  1.10k|  LOOPIDX idx;
  626|  1.10k|  WORD32 tmp, sign;
  627|  1.10k|  WORD32 bit_cnt_local = 0;
  628|       |
  629|  1.10k|  if (version == 1) {
  ------------------
  |  Branch (629:7): [True: 603, False: 501]
  ------------------
  630|  1.20k|    for (idx = 0; idx < band_count; idx++) {
  ------------------
  |  Branch (630:19): [True: 600, False: 603]
  ------------------
  631|    600|      bit_cnt_local += iusace_write_bits_buf(
  632|    600|          it_bit_buf, pstr_gain_modifiers->target_characteristic_left_present[idx], 1);
  633|    600|      if (pstr_gain_modifiers->target_characteristic_left_present[idx]) {
  ------------------
  |  Branch (633:11): [True: 0, False: 600]
  ------------------
  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|    600|      bit_cnt_local += iusace_write_bits_buf(
  639|    600|          it_bit_buf, pstr_gain_modifiers->target_characteristic_right_present[idx], 1);
  640|    600|      if (pstr_gain_modifiers->target_characteristic_right_present[idx]) {
  ------------------
  |  Branch (640:11): [True: 0, False: 600]
  ------------------
  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|    600|      bit_cnt_local +=
  646|    600|          iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_scaling_present[idx], 1);
  647|    600|      if (pstr_gain_modifiers->gain_scaling_present[idx]) {
  ------------------
  |  Branch (647:11): [True: 298, False: 302]
  ------------------
  648|    298|        tmp = (WORD32)(0.5f + 8.0f * pstr_gain_modifiers->attenuation_scaling[idx]);
  649|    298|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 4);
  650|       |
  651|    298|        tmp = (WORD32)(0.5f + 8.0f * pstr_gain_modifiers->amplification_scaling[idx]);
  652|    298|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 4);
  653|    298|      }
  654|       |
  655|    600|      bit_cnt_local +=
  656|    600|          iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_offset_present[idx], 1);
  657|    600|      if (pstr_gain_modifiers->gain_offset_present[idx]) {
  ------------------
  |  Branch (657:11): [True: 274, False: 326]
  ------------------
  658|    274|        if (pstr_gain_modifiers->gain_offset[idx] >= 0.0f) {
  ------------------
  |  Branch (658:13): [True: 260, False: 14]
  ------------------
  659|    260|          tmp = (WORD32)(0.5f + MAX(0.0f, 4.0f * pstr_gain_modifiers->gain_offset[idx] - 1.0f));
  ------------------
  |  |   89|    260|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 7, False: 253]
  |  |  ------------------
  ------------------
  660|    260|          sign = 0;
  661|    260|        } 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|    274|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, sign, 1);
  666|    274|        bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 5);
  667|    274|      }
  668|    600|    }
  669|    603|    if (band_count == 1) {
  ------------------
  |  Branch (669:9): [True: 250, False: 353]
  ------------------
  670|    250|      bit_cnt_local +=
  671|    250|          iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->shape_filter_present, 1);
  672|    250|      if (pstr_gain_modifiers->shape_filter_present) {
  ------------------
  |  Branch (672:11): [True: 0, False: 250]
  ------------------
  673|      0|        bit_cnt_local +=
  674|      0|            iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->shape_filter_index, 4);
  675|      0|      }
  676|    250|    }
  677|    603|  } else if (version == 0) {
  ------------------
  |  Branch (677:14): [True: 501, False: 0]
  ------------------
  678|    501|    bit_cnt_local +=
  679|    501|        iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_scaling_present[0], 1);
  680|       |
  681|    501|    if (pstr_gain_modifiers->gain_scaling_present[0]) {
  ------------------
  |  Branch (681:9): [True: 271, False: 230]
  ------------------
  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|    501|    bit_cnt_local +=
  690|    501|        iusace_write_bits_buf(it_bit_buf, pstr_gain_modifiers->gain_offset_present[0], 1);
  691|    501|    if (pstr_gain_modifiers->gain_offset_present[0]) {
  ------------------
  |  Branch (691:9): [True: 257, False: 244]
  ------------------
  692|    257|      if (pstr_gain_modifiers->gain_offset[0] >= 0.0f) {
  ------------------
  |  Branch (692:11): [True: 228, False: 29]
  ------------------
  693|    228|        tmp = (WORD32)(0.5f + MAX(0.0f, 4.0f * pstr_gain_modifiers->gain_offset[0] - 1.0f));
  ------------------
  |  |   89|    228|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 3, False: 225]
  |  |  ------------------
  ------------------
  694|    228|        sign = 0;
  695|    228|      } 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|    257|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, sign, 1);
  700|    257|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, tmp, 5);
  701|    257|    }
  702|    501|  }
  703|       |
  704|  1.10k|  *ptr_bit_cnt += bit_cnt_local;
  705|  1.10k|}
impd_drc_mux.c:impd_drc_write_uni_drc_config_extn:
 2594|    860|    FLAG write_bs) {
 2595|    860|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    860|#define IA_NO_ERROR 0x00000000
  ------------------
 2596|    860|  LOOPIDX idx;
 2597|    860|  WORD32 version;
 2598|    860|  WORD32 counter = 0;
 2599|    860|  WORD32 ext_size_bits = 0, bit_size_len = 0, bit_size = 0;
 2600|    860|  WORD32 bit_cnt_local = 0, bit_cnt_local_ext = 0;
 2601|    860|  WORD32 *scratch_used = &pstr_drc_state->drc_scratch_used;
 2602|    860|  VOID *ptr_scratch = &pstr_drc_state->drc_scratch_mem;
 2603|    860|  ia_bit_buf_struct *it_bit_buf = NULL;
 2604|    860|  ia_bit_buf_struct *ptr_bit_buf_ext = NULL;
 2605|       |
 2606|    860|  if (write_bs) {
  ------------------
  |  Branch (2606:7): [True: 281, False: 579]
  ------------------
 2607|    281|    it_bit_buf = &pstr_drc_state->str_bit_buf_cfg;
 2608|    281|    ptr_bit_buf_ext = &pstr_drc_state->str_bit_buf_cfg_ext;
 2609|       |
 2610|    281|    iusace_reset_bit_buffer(ptr_bit_buf_ext);
 2611|    281|  }
 2612|       |
 2613|    860|  bit_cnt_local += iusace_write_bits_buf(
 2614|    860|      it_bit_buf, pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter], 4);
 2615|  1.62k|  while (counter < 2 &&
  ------------------
  |  Branch (2615:10): [True: 1.43k, False: 187]
  ------------------
 2616|  1.43k|         pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter] != UNIDRC_CONF_EXT_TERM) {
  ------------------
  |  |   49|  1.43k|#define UNIDRC_CONF_EXT_TERM (0x0)
  ------------------
  |  Branch (2616:10): [True: 1.07k, False: 362]
  ------------------
 2617|  1.07k|    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.07k]
  ------------------
 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|    860|      case UNIDRC_CONF_EXT_V1: {
  ------------------
  |  |   51|    860|#define UNIDRC_CONF_EXT_V1 (0x2)
  ------------------
  |  Branch (2643:7): [True: 860, False: 212]
  ------------------
 2644|    860|        version = 1;
 2645|    860|#ifdef LOUDNESS_LEVELING_SUPPORT
 2646|    860|        bit_cnt_local_ext = 0;
 2647|    860|#endif  // LOUDNESS_LEVELING_SUPPORT
 2648|    860|        bit_cnt_local_ext += iusace_write_bits_buf(
 2649|    860|            ptr_bit_buf_ext, pstr_uni_drc_config_ext->downmix_instructions_v1_present, 1);
 2650|    860|        if (pstr_uni_drc_config_ext->downmix_instructions_v1_present == 1) {
  ------------------
  |  Branch (2650:13): [True: 230, False: 630]
  ------------------
 2651|    230|          bit_cnt_local_ext += iusace_write_bits_buf(
 2652|    230|              ptr_bit_buf_ext, pstr_uni_drc_config_ext->downmix_instructions_v1_count, 7);
 2653|    881|          for (idx = 0; idx < pstr_uni_drc_config_ext->downmix_instructions_v1_count; idx++) {
  ------------------
  |  Branch (2653:25): [True: 651, False: 230]
  ------------------
 2654|    651|            impd_drc_write_downmix_instructions(
 2655|    651|                ptr_bit_buf_ext, version, pstr_gain_enc,
 2656|    651|                &(pstr_uni_drc_config_ext->str_downmix_instructions_v1[idx]), &bit_cnt_local_ext);
 2657|    651|          }
 2658|    230|        }
 2659|       |
 2660|    860|        bit_cnt_local_ext += iusace_write_bits_buf(
 2661|    860|            ptr_bit_buf_ext,
 2662|    860|            pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present, 1);
 2663|    860|        if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present == 1) {
  ------------------
  |  Branch (2663:13): [True: 791, False: 69]
  ------------------
 2664|    791|          bit_cnt_local_ext += iusace_write_bits_buf(
 2665|    791|              ptr_bit_buf_ext, pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count, 3);
 2666|  2.03k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2666:25): [True: 1.24k, False: 791]
  ------------------
 2667|  1.24k|            impd_drc_write_drc_coeff_uni_drc(
 2668|  1.24k|                ptr_bit_buf_ext, version,
 2669|  1.24k|                &(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[idx]),
 2670|  1.24k|                &bit_cnt_local_ext);
 2671|  1.24k|          }
 2672|    791|#ifdef LOUDNESS_LEVELING_SUPPORT
 2673|    791|          UWORD32 num_ducking_only_drc_sets = get_num_ducking_only_drc_sets(
 2674|    791|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1,
 2675|    791|              pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count);
 2676|       |
 2677|    791|          bit_cnt_local_ext +=
 2678|    791|              iusace_write_bits_buf(ptr_bit_buf_ext,
 2679|    791|                                    pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count -
 2680|    791|                                        num_ducking_only_drc_sets,
 2681|    791|                                    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.87k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2686:25): [True: 1.34k, False: 531]
  ------------------
 2687|  1.34k|#ifdef LOUDNESS_LEVELING_SUPPORT
 2688|  1.34k|            if (idx > 0 && pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx - 1]
  ------------------
  |  Branch (2688:17): [True: 876, False: 472]
  |  Branch (2688:28): [True: 222, False: 654]
  ------------------
 2689|    876|                               .ducking_only_set_present) {
 2690|    222|              continue;
 2691|    222|            }
 2692|  1.12k|#endif
 2693|  1.12k|            err_code = impd_drc_write_drc_instruct_uni_drc(
 2694|  1.12k|                ptr_bit_buf_ext, version, pstr_uni_drc_config, pstr_gain_enc,
 2695|  1.12k|                &(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx]), ptr_scratch,
 2696|  1.12k|                &bit_cnt_local_ext);
 2697|  1.12k|            if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  1.12k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2697:17): [True: 260, False: 866]
  ------------------
 2698|    260|              return (err_code);
 2699|    260|            }
 2700|  1.12k|          }
 2701|    791|        }
 2702|       |
 2703|    600|        bit_cnt_local_ext += iusace_write_bits_buf(
 2704|    600|            ptr_bit_buf_ext, pstr_uni_drc_config_ext->loud_eq_instructions_present, 1);
 2705|    600|        if (pstr_uni_drc_config_ext->loud_eq_instructions_present == 1) {
  ------------------
  |  Branch (2705:13): [True: 0, False: 600]
  ------------------
 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|    600|        bit_cnt_local_ext +=
 2716|    600|            iusace_write_bits_buf(ptr_bit_buf_ext, pstr_uni_drc_config_ext->eq_present, 1);
 2717|    600|        if (pstr_uni_drc_config_ext->eq_present == 1) {
  ------------------
  |  Branch (2717:13): [True: 0, False: 600]
  ------------------
 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|    600|      } break;
 2738|       |
 2739|    600|#ifdef LOUDNESS_LEVELING_SUPPORT
 2740|    600|      case UNIDRCCONFEXT_LEVELING: {
  ------------------
  |  |   54|    212|#define UNIDRCCONFEXT_LEVELING (0x4)
  ------------------
  |  Branch (2740:7): [True: 212, False: 860]
  ------------------
 2741|    212|        bit_cnt_local_ext = 0;
 2742|    212|        err_code = write_loudness_leveling_extension(
 2743|    212|            ptr_bit_buf_ext, pstr_uni_drc_config, pstr_gain_enc, ptr_scratch, &bit_cnt_local_ext);
 2744|    212|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    212|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2744:13): [True: 24, False: 188]
  ------------------
 2745|     24|          return (err_code);
 2746|     24|        }
 2747|    212|      } break;
 2748|    188|#endif
 2749|    188|      default:
  ------------------
  |  Branch (2749:7): [True: 0, False: 1.07k]
  ------------------
 2750|      0|        break;
 2751|  1.07k|    }
 2752|       |
 2753|    788|    pstr_uni_drc_config_ext->ext_bit_size[counter] = bit_cnt_local_ext;
 2754|    788|    bit_size = pstr_uni_drc_config_ext->ext_bit_size[counter] - 1;
 2755|    788|    ext_size_bits = (WORD32)(log((FLOAT32)bit_size) / log(2.f)) + 1;
 2756|    788|#ifdef LOUDNESS_LEVELING_SUPPORT
 2757|    788|    ext_size_bits = (ext_size_bits < 4) ? 4 : ext_size_bits;
  ------------------
  |  Branch (2757:21): [True: 148, False: 640]
  ------------------
 2758|    788|#endif  // LOUDNESS_LEVELING_SUPPORT
 2759|    788|    bit_size_len = ext_size_bits - 4;
 2760|       |
 2761|    788|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size_len, 4);
 2762|       |
 2763|    788|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bit_size, (UWORD8)ext_size_bits);
 2764|       |
 2765|    788|    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: 788]
  ------------------
 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|    600|      case UNIDRC_CONF_EXT_V1: {
  ------------------
  |  |   51|    600|#define UNIDRC_CONF_EXT_V1 (0x2)
  ------------------
  |  Branch (2787:7): [True: 600, False: 188]
  ------------------
 2788|    600|        version = 1;
 2789|    600|        bit_cnt_local += iusace_write_bits_buf(
 2790|    600|            it_bit_buf, pstr_uni_drc_config_ext->downmix_instructions_v1_present, 1);
 2791|    600|        if (pstr_uni_drc_config_ext->downmix_instructions_v1_present == 1) {
  ------------------
  |  Branch (2791:13): [True: 155, False: 445]
  ------------------
 2792|    155|          bit_cnt_local += iusace_write_bits_buf(
 2793|    155|              it_bit_buf, pstr_uni_drc_config_ext->downmix_instructions_v1_count, 7);
 2794|    639|          for (idx = 0; idx < pstr_uni_drc_config_ext->downmix_instructions_v1_count; idx++) {
  ------------------
  |  Branch (2794:25): [True: 484, False: 155]
  ------------------
 2795|    484|            impd_drc_write_downmix_instructions(
 2796|    484|                it_bit_buf, version, pstr_gain_enc,
 2797|    484|                &(pstr_uni_drc_config_ext->str_downmix_instructions_v1[idx]), &bit_cnt_local);
 2798|    484|          }
 2799|    155|        }
 2800|       |
 2801|    600|        bit_cnt_local += iusace_write_bits_buf(
 2802|    600|            it_bit_buf, pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present,
 2803|    600|            1);
 2804|    600|        if (pstr_uni_drc_config_ext->drc_coeffs_and_instructions_uni_drc_v1_present == 1) {
  ------------------
  |  Branch (2804:13): [True: 531, False: 69]
  ------------------
 2805|    531|          version = 1;
 2806|    531|          bit_cnt_local += iusace_write_bits_buf(
 2807|    531|              it_bit_buf, pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count, 3);
 2808|  1.44k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_coefficients_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2808:25): [True: 913, False: 531]
  ------------------
 2809|    913|            impd_drc_write_drc_coeff_uni_drc(
 2810|    913|                it_bit_buf, version,
 2811|    913|                &(pstr_uni_drc_config_ext->str_drc_coefficients_uni_drc_v1[idx]), &bit_cnt_local);
 2812|    913|          }
 2813|    531|#ifdef LOUDNESS_LEVELING_SUPPORT
 2814|    531|          UWORD32 num_ducking_only_drc_sets = get_num_ducking_only_drc_sets(
 2815|    531|              pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1,
 2816|    531|              pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count);
 2817|    531|          bit_cnt_local +=
 2818|    531|              iusace_write_bits_buf(it_bit_buf,
 2819|    531|                                    pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count -
 2820|    531|                                        num_ducking_only_drc_sets,
 2821|    531|                                    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.28k|          for (idx = 0; idx < pstr_uni_drc_config_ext->drc_instructions_uni_drc_v1_count; idx++) {
  ------------------
  |  Branch (2826:25): [True: 781, False: 505]
  ------------------
 2827|    781|#ifdef LOUDNESS_LEVELING_SUPPORT
 2828|    781|            if (idx > 0 && pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx - 1]
  ------------------
  |  Branch (2828:17): [True: 569, False: 212]
  |  Branch (2828:28): [True: 174, False: 395]
  ------------------
 2829|    569|                               .ducking_only_set_present) {
 2830|    174|              continue;
 2831|    174|            }
 2832|    607|#endif
 2833|    607|            err_code = impd_drc_write_drc_instruct_uni_drc(
 2834|    607|                it_bit_buf, version, pstr_uni_drc_config, pstr_gain_enc,
 2835|    607|                &(pstr_uni_drc_config_ext->str_drc_instructions_uni_drc_v1[idx]), ptr_scratch,
 2836|    607|                &bit_cnt_local);
 2837|    607|            if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    607|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2837:17): [True: 26, False: 581]
  ------------------
 2838|     26|              return (err_code);
 2839|     26|            }
 2840|    607|          }
 2841|    531|        }
 2842|       |
 2843|    574|        bit_cnt_local += iusace_write_bits_buf(
 2844|    574|            it_bit_buf, pstr_uni_drc_config_ext->loud_eq_instructions_present, 1);
 2845|    574|        if (pstr_uni_drc_config_ext->loud_eq_instructions_present == 1) {
  ------------------
  |  Branch (2845:13): [True: 0, False: 574]
  ------------------
 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|    574|        bit_cnt_local +=
 2856|    574|            iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_config_ext->eq_present, 1);
 2857|    574|        if (pstr_uni_drc_config_ext->eq_present == 1) {
  ------------------
  |  Branch (2857:13): [True: 0, False: 574]
  ------------------
 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|    574|      } break;
 2877|    574|#ifdef LOUDNESS_LEVELING_SUPPORT
 2878|    574|      case UNIDRCCONFEXT_LEVELING: {
  ------------------
  |  |   54|    188|#define UNIDRCCONFEXT_LEVELING (0x4)
  ------------------
  |  Branch (2878:7): [True: 188, False: 600]
  ------------------
 2879|    188|        err_code = write_loudness_leveling_extension(it_bit_buf, pstr_uni_drc_config,
 2880|    188|                                                     pstr_gain_enc, ptr_scratch, &bit_cnt_local);
 2881|    188|        if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|    188|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2881:13): [True: 1, False: 187]
  ------------------
 2882|      1|          return (err_code);
 2883|      1|        }
 2884|    188|      } break;
 2885|    187|#endif
 2886|    187|      default:
  ------------------
  |  Branch (2886:7): [True: 0, False: 788]
  ------------------
 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|    788|    }
 2892|       |
 2893|    761|    counter++;
 2894|       |
 2895|    761|    bit_cnt_local += iusace_write_bits_buf(
 2896|    761|        it_bit_buf, pstr_uni_drc_config_ext->uni_drc_config_ext_type[counter], 4);
 2897|    761|  }
 2898|       |
 2899|    549|  *ptr_bit_cnt += bit_cnt_local;
 2900|       |
 2901|    549|  return err_code;
 2902|    860|}
impd_drc_mux.c:impd_drc_write_downmix_instructions:
 1471|  1.13k|    ia_drc_downmix_instructions_struct *pstr_downmix_instructions, WORD32 *ptr_bit_cnt) {
 1472|  1.13k|  LOOPIDX idx;
 1473|  1.13k|  WORD32 code, code_size;
 1474|  1.13k|  WORD32 bit_cnt_local = 0;
 1475|       |
 1476|  1.13k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_downmix_instructions->downmix_id, 7);
 1477|       |
 1478|  1.13k|  bit_cnt_local +=
 1479|  1.13k|      iusace_write_bits_buf(it_bit_buf, pstr_downmix_instructions->target_ch_count, 7);
 1480|       |
 1481|  1.13k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_downmix_instructions->target_layout, 8);
 1482|       |
 1483|  1.13k|  bit_cnt_local += iusace_write_bits_buf(
 1484|  1.13k|      it_bit_buf, pstr_downmix_instructions->downmix_coefficients_present, 1);
 1485|       |
 1486|  1.13k|  if (pstr_downmix_instructions->downmix_coefficients_present) {
  ------------------
  |  Branch (1486:7): [True: 756, False: 379]
  ------------------
 1487|    756|    if (version != 1) {
  ------------------
  |  Branch (1487:9): [True: 0, False: 756]
  ------------------
 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|    756|    } else {
 1497|    756|      impd_drc_dec_write_downmix_coeff_v1(
 1498|    756|          it_bit_buf, pstr_downmix_instructions->downmix_coeff, pstr_gain_enc->base_ch_count,
 1499|    756|          pstr_downmix_instructions->target_ch_count, &bit_cnt_local);
 1500|    756|    }
 1501|    756|  }
 1502|       |
 1503|  1.13k|  *ptr_bit_cnt += bit_cnt_local;
 1504|  1.13k|}
impd_drc_mux.c:impd_drc_dec_write_downmix_coeff_v1:
  384|    756|                                                WORD32 *ptr_bit_cnt) {
  385|    756|  LOOPIDX i, j;
  386|    756|  WORD32 bs_downmix_offset = 0, code;
  387|    756|  WORD32 bit_cnt_local = 0;
  388|    756|  FLOAT32 downmix_offset[3];
  389|    756|  FLOAT32 tmp;
  390|    756|  FLOAT32 quant_err, quant_err_min;
  391|    756|  const FLOAT32 *coeff_table;
  392|       |
  393|    756|  coeff_table = impd_drc_downmix_coeff_v1;
  394|    756|  tmp = (FLOAT32)log10((FLOAT32)target_ch_count / (FLOAT32)base_ch_count);
  395|    756|  downmix_offset[0] = 0.0f;
  396|    756|  downmix_offset[1] = (FLOAT32)(0.5f * floor(0.5f + 20.0f * tmp));
  397|    756|  downmix_offset[2] = (FLOAT32)(0.5f * floor(0.5f + 40.0f * tmp));
  398|       |
  399|    756|  quant_err_min = 1000.0f;
  400|  3.02k|  for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (400:15): [True: 2.26k, False: 756]
  ------------------
  401|  2.26k|    quant_err = 0.0f;
  402|  11.3k|    for (j = 0; j < (target_ch_count * base_ch_count); j++) {
  ------------------
  |  Branch (402:17): [True: 9.12k, False: 2.26k]
  ------------------
  403|  9.12k|      code = impd_drc_encode_downmix_coefficient(downmix_coeff[j], downmix_offset[i]);
  404|  9.12k|      quant_err += (FLOAT32)fabs(20.0f * log10(downmix_coeff[j]) -
  405|  9.12k|                                 (coeff_table[code] + downmix_offset[i]));
  406|  9.12k|    }
  407|  2.26k|    if (quant_err_min > quant_err) {
  ------------------
  |  Branch (407:9): [True: 495, False: 1.77k]
  ------------------
  408|    495|      quant_err_min = quant_err;
  409|    495|      bs_downmix_offset = i;
  410|    495|    }
  411|  2.26k|  }
  412|       |
  413|    756|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, bs_downmix_offset, 4);
  414|       |
  415|  3.79k|  for (j = 0; j < target_ch_count * base_ch_count; j++) {
  ------------------
  |  Branch (415:15): [True: 3.04k, False: 756]
  ------------------
  416|  3.04k|    code =
  417|  3.04k|        impd_drc_encode_downmix_coefficient(downmix_coeff[j], downmix_offset[bs_downmix_offset]);
  418|  3.04k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, code, 5);
  419|  3.04k|  }
  420|       |
  421|    756|  *ptr_bit_cnt += bit_cnt_local;
  422|    756|}
impd_drc_mux.c:impd_drc_encode_downmix_coefficient:
  356|  12.1k|static WORD32 impd_drc_encode_downmix_coefficient(FLOAT32 downmix_coeff, FLOAT32 downmix_offset) {
  357|  12.1k|  WORD32 idx, code;
  358|  12.1k|  FLOAT32 coeff_db;
  359|  12.1k|  const FLOAT32 *coeff_table;
  360|       |
  361|  12.1k|  coeff_table = impd_drc_downmix_coeff_v1;
  362|  12.1k|  coeff_db = 20.0f * (FLOAT32)log10(downmix_coeff) - downmix_offset;
  363|       |
  364|  12.1k|  if (coeff_db >= coeff_table[30]) {
  ------------------
  |  Branch (364:7): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|  } else {
  374|  12.1k|    code = 31;
  375|  12.1k|  }
  376|       |
  377|  12.1k|  return code;
  378|  12.1k|}
impd_drc_mux.c:write_loudness_leveling_extension:
 1119|    400|                                                VOID *ptr_scratch, WORD32 *bit_cnt) {
 1120|    400|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    400|#define IA_NO_ERROR 0x00000000
  ------------------
 1121|    400|  WORD32 bit_cnt_local = 0;
 1122|    400|  WORD32 drc_instructions_uni_drc_count_v1 =
 1123|    400|      pstr_uni_drc_config->str_uni_drc_config_ext.drc_instructions_uni_drc_v1_count;
 1124|    400|  WORD32 drc_instructions_uni_drc_count = pstr_uni_drc_config->drc_instructions_uni_drc_count;
 1125|    400|  WORD32 version = 0;
 1126|       |  // V0 instructions
 1127|    400|  for (WORD16 i = 0; i < drc_instructions_uni_drc_count; i++) {
  ------------------
  |  Branch (1127:22): [True: 0, False: 400]
  ------------------
 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|    400|  version = 1;
 1152|  1.52k|  for (WORD16 i = 0; i < drc_instructions_uni_drc_count_v1; i++) {
  ------------------
  |  Branch (1152:22): [True: 1.14k, False: 375]
  ------------------
 1153|  1.14k|    ia_drc_instructions_uni_drc *pstr_drc_instruction =
 1154|  1.14k|        &pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[i];
 1155|  1.14k|    if (pstr_drc_instruction->drc_set_effect & EFFECT_BIT_DUCK_SELF) {
  ------------------
  |  |   38|  1.14k|#define EFFECT_BIT_DUCK_SELF 0x0800
  ------------------
  |  Branch (1155:9): [True: 835, False: 310]
  ------------------
 1156|    835|      if (i > 0 &&
  ------------------
  |  Branch (1156:11): [True: 572, False: 263]
  ------------------
 1157|    572|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[i - 1]
  ------------------
  |  Branch (1157:11): [True: 259, False: 313]
  ------------------
 1158|    572|              .leveling_present &&
 1159|    259|          pstr_uni_drc_config->str_uni_drc_config_ext.str_drc_instructions_uni_drc_v1[i - 1]
  ------------------
  |  Branch (1159:11): [True: 171, False: 88]
  ------------------
 1160|    259|              .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|    664|      } else {
 1168|    664|        bit_cnt_local +=
 1169|    664|            iusace_write_bits_buf(it_bit_buf, pstr_drc_instruction->leveling_present, 1);
 1170|    664|        if (pstr_drc_instruction->leveling_present) {
  ------------------
  |  Branch (1170:13): [True: 354, False: 310]
  ------------------
 1171|    354|          bit_cnt_local += iusace_write_bits_buf(
 1172|    354|              it_bit_buf, pstr_drc_instruction->ducking_only_set_present, 1);
 1173|    354|        }
 1174|    664|      }
 1175|    835|    }
 1176|  1.14k|  }
 1177|    375|  *bit_cnt += bit_cnt_local;
 1178|    375|  return IA_NO_ERROR;
  ------------------
  |  |   23|    375|#define IA_NO_ERROR 0x00000000
  ------------------
 1179|    400|}
impd_drc_mux.c:impd_drc_write_spline_nodes:
 3255|   119k|                                        WORD32 *ptr_bit_cnt) {
 3256|   119k|  LOOPIDX idx;
 3257|   119k|  WORD32 frame_end_flag;
 3258|   119k|  WORD32 bit_cnt_local = 0;
 3259|       |
 3260|   119k|  bit_cnt_local += iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->coding_mode, 1);
 3261|   119k|  if (pstr_drc_group_for_output->coding_mode != 0) {
  ------------------
  |  Branch (3261:7): [True: 47.8k, False: 71.2k]
  ------------------
 3262|   478k|    for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values - 1; idx++) {
  ------------------
  |  Branch (3262:19): [True: 430k, False: 47.8k]
  ------------------
 3263|   430k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 0, 1);
 3264|   430k|    }
 3265|  47.8k|    bit_cnt_local += iusace_write_bits_buf(it_bit_buf, 1, 1);
 3266|       |
 3267|  47.8k|    if (pstr_gain_set_params->gain_interpolation_type == GAIN_INTERPOLATION_TYPE_SPLINE) {
  ------------------
  |  |   45|  47.8k|#define GAIN_INTERPOLATION_TYPE_SPLINE 0
  ------------------
  |  Branch (3267:9): [True: 31.3k, False: 16.5k]
  ------------------
 3268|   478k|      for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values; idx++) {
  ------------------
  |  Branch (3268:21): [True: 447k, False: 31.3k]
  ------------------
 3269|   447k|        bit_cnt_local +=
 3270|   447k|            iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->slope_code[idx],
 3271|   447k|                                  (UWORD8)pstr_drc_group_for_output->slope_code_size[idx]);
 3272|   447k|      }
 3273|  31.3k|    }
 3274|       |
 3275|  47.8k|    if (pstr_gain_set_params->full_frame == 0 && pstr_drc_group_for_output->n_gain_values > 0) {
  ------------------
  |  Branch (3275:9): [True: 25.8k, False: 21.9k]
  |  Branch (3275:50): [True: 25.8k, False: 0]
  ------------------
 3276|  25.8k|      if (pstr_drc_group_for_output->ts_gain_quant[pstr_drc_group_for_output->n_gain_values -
  ------------------
  |  Branch (3276:11): [True: 22.4k, False: 3.42k]
  ------------------
 3277|  25.8k|                                                   1] == (pstr_gain_enc->drc_frame_size - 1)) {
 3278|  22.4k|        frame_end_flag = 1;
 3279|  22.4k|      } else {
 3280|  3.42k|        frame_end_flag = 0;
 3281|  3.42k|      }
 3282|  25.8k|      bit_cnt_local += iusace_write_bits_buf(it_bit_buf, frame_end_flag, 1);
 3283|  25.8k|    } else {
 3284|  21.9k|      frame_end_flag = 1;
 3285|  21.9k|    }
 3286|       |
 3287|   526k|    for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values; idx++) {
  ------------------
  |  Branch (3287:19): [True: 478k, False: 47.8k]
  ------------------
 3288|   478k|      if (idx < (pstr_drc_group_for_output->n_gain_values - 1) || !frame_end_flag) {
  ------------------
  |  Branch (3288:11): [True: 430k, False: 47.8k]
  |  Branch (3288:67): [True: 3.42k, False: 44.4k]
  ------------------
 3289|   434k|        bit_cnt_local +=
 3290|   434k|            iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->time_delta_code[idx],
 3291|   434k|                                  (UWORD8)pstr_drc_group_for_output->time_delta_code_size[idx]);
 3292|   434k|      }
 3293|   478k|    }
 3294|   526k|    for (idx = 0; idx < pstr_drc_group_for_output->n_gain_values; idx++) {
  ------------------
  |  Branch (3294:19): [True: 478k, False: 47.8k]
  ------------------
 3295|   478k|      bit_cnt_local +=
 3296|   478k|          iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->gain_code[idx],
 3297|   478k|                                (UWORD8)pstr_drc_group_for_output->gain_code_length[idx]);
 3298|   478k|    }
 3299|  71.2k|  } else {
 3300|  71.2k|    bit_cnt_local +=
 3301|  71.2k|        iusace_write_bits_buf(it_bit_buf, pstr_drc_group_for_output->gain_code[0],
 3302|  71.2k|                              (UWORD8)pstr_drc_group_for_output->gain_code_length[0]);
 3303|  71.2k|  }
 3304|       |
 3305|   119k|  *ptr_bit_cnt += bit_cnt_local;
 3306|   119k|}
impd_drc_mux.c:impd_drc_write_uni_drc_gain_extension:
 3310|  3.57k|    WORD32 *ptr_bit_cnt) {
 3311|  3.57k|  LOOPIDX idx;
 3312|  3.57k|  WORD32 counter = 0;
 3313|  3.57k|  WORD32 ext_size_bits, bit_size_len, bit_size;
 3314|  3.57k|  WORD32 bit_cnt_local = 0;
 3315|       |
 3316|  3.57k|  bit_cnt_local +=
 3317|  3.57k|      iusace_write_bits_buf(it_bit_buf, pstr_uni_drc_gain_ext->uni_drc_gain_ext_type[counter], 4);
 3318|  3.57k|  while (pstr_uni_drc_gain_ext->uni_drc_gain_ext_type[counter] != UNIDRC_GAIN_EXT_TERM) {
  ------------------
  |  |   47|  3.57k|#define UNIDRC_GAIN_EXT_TERM (0x0)
  ------------------
  |  Branch (3318:10): [True: 0, False: 3.57k]
  ------------------
 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.57k|  *ptr_bit_cnt += bit_cnt_local;
 3337|  3.57k|}

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

impd_drc_init_all_filter_banks:
   58|    711|    ia_drc_filter_banks_struct *pstr_filter_banks, VOID *ptr_scratch) {
   59|    711|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    711|#define IA_NO_ERROR 0x00000000
  ------------------
   60|    711|  LOOPIDX band_idx, group_idx, i, j, k;
   61|    711|  WORD32 crossover_freq_index, num_ch_in_groups, num_phase_alignment_ch_groups;
   62|    711|  WORD32 index_found = FALSE;
  ------------------
  |  |   26|    711|#define FALSE (0)
  ------------------
   63|    711|  WORD32 group_count[MAX_CHANNEL_GROUP_COUNT + 1] = {0};
   64|    711|  WORD32 *ptr_cascade_crossover_indices[MAX_CHANNEL_GROUP_COUNT + 1];
   65|       |
   66|  7.11k|  for (i = 0; i < MAX_CHANNEL_GROUP_COUNT + 1; i++) {
  ------------------
  |  |   36|  7.11k|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|  7.11k|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
  |  Branch (66:15): [True: 6.39k, False: 711]
  ------------------
   67|  6.39k|    ptr_cascade_crossover_indices[i] = (WORD32 *)(ptr_scratch);
   68|  6.39k|    ptr_scratch = (UWORD8 *)ptr_scratch +
   69|  6.39k|                  (MAX_CHANNEL_GROUP_COUNT * 3) * sizeof(ptr_cascade_crossover_indices[i][0]);
  ------------------
  |  |   36|  6.39k|#define MAX_CHANNEL_GROUP_COUNT (MAX_SEQUENCE_COUNT)
  |  |  ------------------
  |  |  |  |   27|  6.39k|#define MAX_SEQUENCE_COUNT (8)
  |  |  ------------------
  ------------------
   70|  6.39k|  }
   71|       |
   72|    711|  num_ch_in_groups = 0;
   73|  1.46k|  for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (73:23): [True: 755, False: 711]
  ------------------
   74|    755|       group_idx++) {
   75|    755|    num_ch_in_groups += pstr_drc_instructions_uni_drc->num_channels_per_channel_group[group_idx];
   76|    755|  }
   77|    711|  num_phase_alignment_ch_groups = pstr_drc_instructions_uni_drc->num_drc_channel_groups;
   78|    711|  if (num_ch_in_groups < pstr_drc_instructions_uni_drc->drc_channel_count) {
  ------------------
  |  Branch (78:7): [True: 0, False: 711]
  ------------------
   79|      0|    num_phase_alignment_ch_groups++;
   80|      0|  }
   81|    711|  if (num_phase_alignment_ch_groups > IMPD_DRCMAX_PHASE_ALIGN_CH_GROUP) {
  ------------------
  |  |   22|    711|#define IMPD_DRCMAX_PHASE_ALIGN_CH_GROUP (32)
  ------------------
  |  Branch (81:7): [True: 0, False: 711]
  ------------------
   82|      0|    return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
   83|      0|  }
   84|       |
   85|    711|  memset(pstr_filter_banks->str_drc_filter_bank, 0,
   86|    711|         sizeof(pstr_filter_banks->str_drc_filter_bank));
   87|    711|  pstr_filter_banks->num_phase_alignment_ch_groups = num_phase_alignment_ch_groups;
   88|    711|  pstr_filter_banks->num_filter_banks = pstr_drc_instructions_uni_drc->num_drc_channel_groups;
   89|    711|  if (pstr_drc_coefficients_uni_drc != NULL) {
  ------------------
  |  Branch (89:7): [True: 711, False: 0]
  ------------------
   90|  1.44k|    for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (90:25): [True: 750, False: 694]
  ------------------
   91|    750|         group_idx++) {
   92|    750|      err_code = impd_drc_filter_bank_complexity(
   93|    750|          pstr_drc_coefficients_uni_drc
   94|    750|              ->str_gain_set_params[pstr_drc_instructions_uni_drc
   95|    750|                                        ->gain_set_index_for_channel_group[group_idx]]
   96|    750|              .band_count,
   97|    750|          &(pstr_filter_banks->str_drc_filter_bank[group_idx]));
   98|    750|      if (err_code) {
  ------------------
  |  Branch (98:11): [True: 17, False: 733]
  ------------------
   99|     17|        return err_code;
  100|     17|      }
  101|    750|    }
  102|    711|  } else {
  103|      0|    pstr_filter_banks->str_drc_filter_bank->num_bands = 1;
  104|      0|  }
  105|       |
  106|    694|  if (pstr_drc_coefficients_uni_drc != NULL) {
  ------------------
  |  Branch (106:7): [True: 694, False: 0]
  ------------------
  107|  1.42k|    for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (107:25): [True: 729, False: 694]
  ------------------
  108|    729|         group_idx++) {
  109|    729|      for (band_idx = 1;
  110|  1.00k|           band_idx < pstr_drc_coefficients_uni_drc
  ------------------
  |  Branch (110:12): [True: 276, False: 729]
  ------------------
  111|  1.00k|                          ->str_gain_set_params[pstr_drc_instructions_uni_drc
  112|  1.00k|                                                    ->gain_set_index_for_channel_group[group_idx]]
  113|  1.00k|                          .band_count;
  114|    729|           band_idx++) {
  115|    276|        crossover_freq_index =
  116|    276|            pstr_drc_coefficients_uni_drc
  117|    276|                ->str_gain_set_params[pstr_drc_instructions_uni_drc
  118|    276|                                          ->gain_set_index_for_channel_group[group_idx]]
  119|    276|                .gain_params[band_idx]
  120|    276|                .crossover_freq_index;
  121|       |
  122|    589|        for (j = 0; j < num_phase_alignment_ch_groups; j++) {
  ------------------
  |  Branch (122:21): [True: 313, False: 276]
  ------------------
  123|    313|          if (j != group_idx) {
  ------------------
  |  Branch (123:15): [True: 37, False: 276]
  ------------------
  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|    313|        }
  131|    276|      }
  132|    729|    }
  133|    694|  }
  134|       |
  135|    694|  i = 0;
  136|    712|  while (i < group_count[0]) {
  ------------------
  |  Branch (136:10): [True: 18, False: 694]
  ------------------
  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.42k|  for (group_idx = 0; group_idx < num_phase_alignment_ch_groups; group_idx++) {
  ------------------
  |  Branch (169:23): [True: 729, False: 694]
  ------------------
  170|    729|    if (group_count[group_idx] > 0) {
  ------------------
  |  Branch (170:9): [True: 3, False: 726]
  ------------------
  171|      3|      pstr_filter_banks->str_drc_filter_bank[group_idx].complexity +=
  172|      3|          (group_count[group_idx] << 1);
  173|      3|    }
  174|    729|  }
  175|    694|  pstr_filter_banks->complexity = 0;
  176|  1.42k|  for (group_idx = 0; group_idx < pstr_drc_instructions_uni_drc->num_drc_channel_groups;
  ------------------
  |  Branch (176:23): [True: 729, False: 694]
  ------------------
  177|    729|       group_idx++) {
  178|    729|    pstr_filter_banks->complexity +=
  179|    729|        pstr_drc_instructions_uni_drc->num_channels_per_channel_group[group_idx] *
  180|    729|        pstr_filter_banks->str_drc_filter_bank[group_idx].complexity;
  181|    729|  }
  182|       |
  183|    694|  return err_code;
  184|    694|}
impd_drc_uni_drc_filter_bank.c:impd_drc_filter_bank_complexity:
   32|    750|    const WORD32 num_bands, ia_drc_filter_bank_struct *pstr_drc_filter_bank) {
   33|    750|  pstr_drc_filter_bank->complexity = 0;
   34|    750|  pstr_drc_filter_bank->num_bands = num_bands;
   35|    750|  switch (num_bands) {
   36|    455|    case 1:
  ------------------
  |  Branch (36:5): [True: 455, False: 295]
  ------------------
   37|    455|      break;
   38|    278|    case 2:
  ------------------
  |  Branch (38:5): [True: 278, False: 472]
  ------------------
   39|    278|      pstr_drc_filter_bank->complexity = 8;
   40|    278|      break;
   41|      0|    case 3:
  ------------------
  |  Branch (41:5): [True: 0, False: 750]
  ------------------
   42|      0|      pstr_drc_filter_bank->complexity = 18;
   43|      0|      break;
   44|      0|    case 4:
  ------------------
  |  Branch (44:5): [True: 0, False: 750]
  ------------------
   45|      0|      pstr_drc_filter_bank->complexity = 28;
   46|      0|      break;
   47|     17|    default:
  ------------------
  |  Branch (47:5): [True: 17, False: 733]
  ------------------
   48|     17|      return IA_EXHEAACE_CONFIG_FATAL_DRC_PARAM_OUT_OF_RANGE;
   49|      0|      break;
   50|    750|  }
   51|       |
   52|    733|  return IA_NO_ERROR;
  ------------------
  |  |   23|    733|#define IA_NO_ERROR 0x00000000
  ------------------
   53|    750|}

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

iusace_acelp_tgt_ir_corr:
  386|  2.00M|VOID iusace_acelp_tgt_ir_corr(FLOAT32 *x, FLOAT32 *ir_wsyn, FLOAT32 *corr_out) {
  387|  2.00M|  WORD16 i, j;
  388|  2.00M|  FLOAT32 sum;
  389|   130M|  for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   130M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (389:15): [True: 128M, False: 2.00M]
  ------------------
  390|   128M|    sum = 0.0F;
  391|  4.29G|    for (j = i; j < LEN_SUBFR; j++) {
  ------------------
  |  |   77|  4.29G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (391:17): [True: 4.17G, False: 128M]
  ------------------
  392|  4.17G|      sum += x[j] * ir_wsyn[j - i];
  393|  4.17G|    }
  394|   128M|    corr_out[i] = sum;
  395|   128M|  }
  396|  2.00M|}
iusace_acelp_tgt_cb_corr2:
  398|  4.01M|FLOAT32 iusace_acelp_tgt_cb_corr2(FLOAT32 *xn, FLOAT32 *y1, FLOAT32 *corr_out) {
  399|  4.01M|  FLOAT32 gain;
  400|  4.01M|  FLOAT32 t0, t1;
  401|  4.01M|  WORD16 i;
  402|  4.01M|  t0 = xn[0] * y1[0];
  403|  4.01M|  t1 = y1[0] * y1[0];
  404|  40.1M|  for (i = 1; i < LEN_SUBFR; i += 7) {
  ------------------
  |  |   77|  40.1M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (404:15): [True: 36.0M, False: 4.01M]
  ------------------
  405|  36.0M|    t0 += xn[i] * y1[i];
  406|  36.0M|    t1 += y1[i] * y1[i];
  407|  36.0M|    t0 += xn[i + 1] * y1[i + 1];
  408|  36.0M|    t1 += y1[i + 1] * y1[i + 1];
  409|  36.0M|    t0 += xn[i + 2] * y1[i + 2];
  410|  36.0M|    t1 += y1[i + 2] * y1[i + 2];
  411|  36.0M|    t0 += xn[i + 3] * y1[i + 3];
  412|  36.0M|    t1 += y1[i + 3] * y1[i + 3];
  413|  36.0M|    t0 += xn[i + 4] * y1[i + 4];
  414|  36.0M|    t1 += y1[i + 4] * y1[i + 4];
  415|  36.0M|    t0 += xn[i + 5] * y1[i + 5];
  416|  36.0M|    t1 += y1[i + 5] * y1[i + 5];
  417|  36.0M|    t0 += xn[i + 6] * y1[i + 6];
  418|  36.0M|    t1 += y1[i + 6] * y1[i + 6];
  419|  36.0M|  }
  420|  4.01M|  corr_out[0] = t1;
  421|  4.01M|  corr_out[1] = -2.0F * t0 + 0.01F;
  422|       |
  423|  4.01M|  if (t1) {
  ------------------
  |  Branch (423:7): [True: 3.94M, False: 61.6k]
  ------------------
  424|  3.94M|    gain = t0 / t1;
  425|  3.94M|  } else {
  426|  61.6k|    gain = 1.0F;
  427|  61.6k|  }
  428|  4.01M|  if (gain < 0.0) {
  ------------------
  |  Branch (428:7): [True: 766k, False: 3.24M]
  ------------------
  429|   766k|    gain = 0.0;
  430|  3.24M|  } else if (gain > 1.2F) {
  ------------------
  |  Branch (430:14): [True: 419k, False: 2.82M]
  ------------------
  431|   419k|    gain = 1.2F;
  432|   419k|  }
  433|  4.01M|  return gain;
  434|  4.01M|}
iusace_acelp_tgt_cb_corr1:
  436|  2.00M|VOID iusace_acelp_tgt_cb_corr1(FLOAT32 *xn, FLOAT32 *y1, FLOAT32 *y2, FLOAT32 *corr_out) {
  437|  2.00M|  WORD32 i;
  438|  2.00M|  FLOAT32 temp1, temp2, temp3;
  439|  2.00M|  temp1 = 0.01F + y2[0] * y2[0];
  440|  2.00M|  temp2 = 0.01F + xn[0] * y2[0];
  441|  2.00M|  temp3 = 0.01F + y1[0] * y2[0];
  442|  2.00M|  temp1 += y2[1] * y2[1];
  443|  2.00M|  temp2 += xn[1] * y2[1];
  444|  2.00M|  temp3 += y1[1] * y2[1];
  445|  2.00M|  temp1 += y2[2] * y2[2];
  446|  2.00M|  temp2 += xn[2] * y2[2];
  447|  2.00M|  temp3 += y1[2] * y2[2];
  448|  2.00M|  temp1 += y2[3] * y2[3];
  449|  2.00M|  temp2 += xn[3] * y2[3];
  450|  2.00M|  temp3 += y1[3] * y2[3];
  451|  22.0M|  for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  22.0M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (451:15): [True: 20.0M, False: 2.00M]
  ------------------
  452|  20.0M|    temp1 += y2[i] * y2[i];
  453|  20.0M|    temp2 += xn[i] * y2[i];
  454|  20.0M|    temp3 += y1[i] * y2[i];
  455|  20.0M|    temp1 += y2[i + 1] * y2[i + 1];
  456|  20.0M|    temp2 += xn[i + 1] * y2[i + 1];
  457|  20.0M|    temp3 += y1[i + 1] * y2[i + 1];
  458|  20.0M|    temp1 += y2[i + 2] * y2[i + 2];
  459|  20.0M|    temp2 += xn[i + 2] * y2[i + 2];
  460|  20.0M|    temp3 += y1[i + 2] * y2[i + 2];
  461|  20.0M|    temp1 += y2[i + 3] * y2[i + 3];
  462|  20.0M|    temp2 += xn[i + 3] * y2[i + 3];
  463|  20.0M|    temp3 += y1[i + 3] * y2[i + 3];
  464|  20.0M|    temp1 += y2[i + 4] * y2[i + 4];
  465|  20.0M|    temp2 += xn[i + 4] * y2[i + 4];
  466|  20.0M|    temp3 += y1[i + 4] * y2[i + 4];
  467|  20.0M|    temp1 += y2[i + 5] * y2[i + 5];
  468|  20.0M|    temp2 += xn[i + 5] * y2[i + 5];
  469|  20.0M|    temp3 += y1[i + 5] * y2[i + 5];
  470|  20.0M|  }
  471|  2.00M|  corr_out[2] = temp1;
  472|  2.00M|  corr_out[3] = -2.0F * temp2;
  473|  2.00M|  corr_out[4] = 2.0F * temp3;
  474|  2.00M|}
iusace_acelp_cb_target_update:
  476|  8.02M|VOID iusace_acelp_cb_target_update(FLOAT32 *x, FLOAT32 *new_x, FLOAT32 *cb_vec, FLOAT32 gain) {
  477|  8.02M|  WORD16 i;
  478|   521M|  for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   521M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (478:15): [True: 513M, False: 8.02M]
  ------------------
  479|   513M|    new_x[i] = x[i] - gain * cb_vec[i];
  480|   513M|  }
  481|  8.02M|}
iusace_acelp_cb_exc:
  485|  2.00M|                         WORD32 *acelp_param_out, FLOAT32 *scratch_acelp_ir_buf) {
  486|  2.00M|  FLOAT32 sign[LEN_SUBFR], vec[LEN_SUBFR];
  487|  2.00M|  FLOAT32 corr_x[16], corr_y[16];
  488|  2.00M|  FLOAT32 *ir_buf = scratch_acelp_ir_buf;
  489|  2.00M|  FLOAT32 corr_ir[4][16];
  490|  2.00M|  FLOAT32 corr_p1p2[4][256];
  491|  2.00M|  FLOAT32 dn2[LEN_SUBFR];
  492|  2.00M|  WORD32 pulse_pos[NPMAXPT * 4] = {0};
  493|  2.00M|  WORD32 codvec[MAX_NUM_PULSES] = {0};
  494|  2.00M|  WORD32 num_pulse_position[10] = {0};
  495|  2.00M|  WORD32 pos_max[4];
  496|  2.00M|  WORD32 dn2_pos[8 * 4];
  497|  2.00M|  UWORD8 ipos[MAX_NUM_PULSES] = {0};
  498|  2.00M|  WORD32 i, j, k, st, pos = 0, index, track, num_pulses = 0, num_iter = 4;
  499|  2.00M|  WORD32 l_index;
  500|  2.00M|  FLOAT32 psk, ps, alpk, alp = 0.0F;
  501|  2.00M|  FLOAT32 val;
  502|  2.00M|  FLOAT32 s, cor;
  503|  2.00M|  FLOAT32 *p0, *p1, *p2, *p3, *psign;
  504|  2.00M|  FLOAT32 *p1_ir_buf, *p2_ir_buf, *p3_ir_buf, *p4_ir_buf, *ir_sign_inv;
  505|  2.00M|  switch (num_bits_cb) {
  ------------------
  |  Branch (505:11): [True: 2.00M, False: 0]
  ------------------
  506|      0|    case ACELP_NUM_BITS_20:
  ------------------
  |  |  130|      0|#define ACELP_NUM_BITS_20 (20)
  ------------------
  |  Branch (506:5): [True: 0, False: 2.00M]
  ------------------
  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.00M]
  ------------------
  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|   216k|    case ACELP_NUM_BITS_36:
  ------------------
  |  |  132|   216k|#define ACELP_NUM_BITS_36 (36)
  ------------------
  |  Branch (522:5): [True: 216k, False: 1.78M]
  ------------------
  523|   216k|      num_iter = 4;
  524|   216k|      alp = 1.0;
  525|   216k|      num_pulses = 8;
  526|   216k|      num_pulse_position[0] = 4;
  527|   216k|      num_pulse_position[1] = 8;
  528|   216k|      num_pulse_position[2] = 8;
  529|   216k|      break;
  530|      0|    case ACELP_NUM_BITS_44:
  ------------------
  |  |  133|      0|#define ACELP_NUM_BITS_44 (44)
  ------------------
  |  Branch (530:5): [True: 0, False: 2.00M]
  ------------------
  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|  13.8k|    case ACELP_NUM_BITS_52:
  ------------------
  |  |  134|  13.8k|#define ACELP_NUM_BITS_52 (52)
  ------------------
  |  Branch (539:5): [True: 13.8k, False: 1.99M]
  ------------------
  540|  13.8k|      num_iter = 4;
  541|  13.8k|      alp = 1.0;
  542|  13.8k|      num_pulses = 12;
  543|  13.8k|      num_pulse_position[0] = 4;
  544|  13.8k|      num_pulse_position[1] = 6;
  545|  13.8k|      num_pulse_position[2] = 8;
  546|  13.8k|      num_pulse_position[3] = 8;
  547|  13.8k|      break;
  548|  1.77M|    case ACELP_NUM_BITS_64:
  ------------------
  |  |  135|  1.77M|#define ACELP_NUM_BITS_64 (64)
  ------------------
  |  Branch (548:5): [True: 1.77M, False: 230k]
  ------------------
  549|  1.77M|      num_iter = 3;
  550|  1.77M|      alp = 0.8F;
  551|  1.77M|      num_pulses = 16;
  552|  1.77M|      num_pulse_position[0] = 4;
  553|  1.77M|      num_pulse_position[1] = 4;
  554|  1.77M|      num_pulse_position[2] = 6;
  555|  1.77M|      num_pulse_position[3] = 6;
  556|  1.77M|      num_pulse_position[4] = 8;
  557|  1.77M|      num_pulse_position[5] = 8;
  558|  1.77M|      break;
  559|  2.00M|  }
  560|       |
  561|  2.00M|  val = (lp_residual[0] * lp_residual[0]) + 1.0F;
  562|  2.00M|  cor = (corr_input[0] * corr_input[0]) + 1.0F;
  563|  20.0M|  for (i = 1; i < LEN_SUBFR; i += 7) {
  ------------------
  |  |   77|  20.0M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (563:15): [True: 18.0M, False: 2.00M]
  ------------------
  564|  18.0M|    val += (lp_residual[i] * lp_residual[i]);
  565|  18.0M|    cor += (corr_input[i] * corr_input[i]);
  566|  18.0M|    val += (lp_residual[i + 1] * lp_residual[i + 1]);
  567|  18.0M|    cor += (corr_input[i + 1] * corr_input[i + 1]);
  568|  18.0M|    val += (lp_residual[i + 2] * lp_residual[i + 2]);
  569|  18.0M|    cor += (corr_input[i + 2] * corr_input[i + 2]);
  570|  18.0M|    val += (lp_residual[i + 3] * lp_residual[i + 3]);
  571|  18.0M|    cor += (corr_input[i + 3] * corr_input[i + 3]);
  572|  18.0M|    val += (lp_residual[i + 4] * lp_residual[i + 4]);
  573|  18.0M|    cor += (corr_input[i + 4] * corr_input[i + 4]);
  574|  18.0M|    val += (lp_residual[i + 5] * lp_residual[i + 5]);
  575|  18.0M|    cor += (corr_input[i + 5] * corr_input[i + 5]);
  576|  18.0M|    val += (lp_residual[i + 6] * lp_residual[i + 6]);
  577|  18.0M|    cor += (corr_input[i + 6] * corr_input[i + 6]);
  578|  18.0M|  }
  579|  2.00M|  s = (FLOAT32)sqrt(cor / val);
  580|   130M|  for (j = 0; j < LEN_SUBFR; j++) {
  ------------------
  |  |   77|   130M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (580:15): [True: 128M, False: 2.00M]
  ------------------
  581|   128M|    cor = (s * lp_residual[j]) + (alp * corr_input[j]);
  582|   128M|    if (cor >= 0.0F) {
  ------------------
  |  Branch (582:9): [True: 64.0M, False: 64.2M]
  ------------------
  583|  64.0M|      sign[j] = 1.0F;
  584|  64.0M|      vec[j] = -1.0F;
  585|  64.0M|      dn2[j] = cor;
  586|  64.2M|    } else {
  587|  64.2M|      sign[j] = -1.0F;
  588|  64.2M|      vec[j] = 1.0F;
  589|  64.2M|      corr_input[j] = -corr_input[j];
  590|  64.2M|      dn2[j] = -cor;
  591|  64.2M|    }
  592|   128M|  }
  593|  10.0M|  for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (593:15): [True: 8.02M, False: 2.00M]
  ------------------
  594|  72.1M|    for (k = 0; k < 8; k++) {
  ------------------
  |  Branch (594:17): [True: 64.1M, False: 8.02M]
  ------------------
  595|  64.1M|      ps = -1;
  596|  1.09G|      for (j = i; j < LEN_SUBFR; j += 4) {
  ------------------
  |  |   77|  1.09G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (596:19): [True: 1.02G, False: 64.1M]
  ------------------
  597|  1.02G|        if (dn2[j] > ps) {
  ------------------
  |  Branch (597:13): [True: 166M, False: 860M]
  ------------------
  598|   166M|          ps = dn2[j];
  599|   166M|          pos = j;
  600|   166M|        }
  601|  1.02G|      }
  602|  64.1M|      dn2[pos] = (FLOAT32)k - 8;
  603|  64.1M|      dn2_pos[i * 8 + k] = pos;
  604|  64.1M|    }
  605|  8.02M|    pos_max[i] = dn2_pos[i * 8];
  606|  8.02M|  }
  607|       |
  608|  2.00M|  memset(ir_buf, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  609|  2.00M|  memset(ir_buf + (2 * LEN_SUBFR), 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
                memset(ir_buf + (2 * LEN_SUBFR), 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  610|  2.00M|  p1_ir_buf = ir_buf + LEN_SUBFR;
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  611|  2.00M|  ir_sign_inv = ir_buf + (3 * LEN_SUBFR);
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  612|  2.00M|  memcpy(p1_ir_buf, ir_wsyn, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  613|  2.00M|  ir_sign_inv[0] = -p1_ir_buf[0];
  614|  2.00M|  ir_sign_inv[1] = -p1_ir_buf[1];
  615|  2.00M|  ir_sign_inv[2] = -p1_ir_buf[2];
  616|  2.00M|  ir_sign_inv[3] = -p1_ir_buf[3];
  617|  22.0M|  for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  22.0M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (617:15): [True: 20.0M, False: 2.00M]
  ------------------
  618|  20.0M|    ir_sign_inv[i] = -p1_ir_buf[i];
  619|  20.0M|    ir_sign_inv[i + 1] = -p1_ir_buf[i + 1];
  620|  20.0M|    ir_sign_inv[i + 2] = -p1_ir_buf[i + 2];
  621|  20.0M|    ir_sign_inv[i + 3] = -p1_ir_buf[i + 3];
  622|  20.0M|    ir_sign_inv[i + 4] = -p1_ir_buf[i + 4];
  623|  20.0M|    ir_sign_inv[i + 5] = -p1_ir_buf[i + 5];
  624|  20.0M|  }
  625|       |
  626|  2.00M|  p0 = &corr_ir[0][16 - 1];
  627|  2.00M|  p1 = &corr_ir[1][16 - 1];
  628|  2.00M|  p2 = &corr_ir[2][16 - 1];
  629|  2.00M|  p3 = &corr_ir[3][16 - 1];
  630|  2.00M|  p2_ir_buf = p1_ir_buf;
  631|  2.00M|  cor = 0.0F;
  632|  34.0M|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (632:15): [True: 32.0M, False: 2.00M]
  ------------------
  633|  32.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  634|  32.0M|    p2_ir_buf++;
  635|  32.0M|    *p3-- = cor * 0.5F;
  636|  32.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  637|  32.0M|    p2_ir_buf++;
  638|  32.0M|    *p2-- = cor * 0.5F;
  639|  32.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  640|  32.0M|    p2_ir_buf++;
  641|  32.0M|    *p1-- = cor * 0.5F;
  642|  32.0M|    cor += (*p2_ir_buf) * (*p2_ir_buf);
  643|  32.0M|    p2_ir_buf++;
  644|  32.0M|    *p0-- = cor * 0.5F;
  645|  32.0M|  }
  646|  2.00M|  pos = 256 - 1;
  647|  2.00M|  p4_ir_buf = p1_ir_buf + 1;
  648|  34.0M|  for (k = 0; k < 16; k++) {
  ------------------
  |  Branch (648:15): [True: 32.0M, False: 2.00M]
  ------------------
  649|  32.0M|    p3 = &corr_p1p2[2][pos];
  650|  32.0M|    p2 = &corr_p1p2[1][pos];
  651|  32.0M|    p1 = &corr_p1p2[0][pos];
  652|  32.0M|    if (k == 15) {
  ------------------
  |  Branch (652:9): [True: 2.00M, False: 30.0M]
  ------------------
  653|  2.00M|      p0 = &corr_p1p2[3][pos - 15];
  654|  30.0M|    } else {
  655|  30.0M|      p0 = &corr_p1p2[3][pos - 16];
  656|  30.0M|    }
  657|  32.0M|    cor = 0.0F;
  658|  32.0M|    p2_ir_buf = p1_ir_buf;
  659|  32.0M|    p3_ir_buf = p4_ir_buf;
  660|   272M|    for (i = k + 1; i < 16; i++) {
  ------------------
  |  Branch (660:21): [True: 240M, False: 32.0M]
  ------------------
  661|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  662|   240M|      p2_ir_buf++;
  663|   240M|      p3_ir_buf++;
  664|   240M|      *p3 = cor;
  665|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  666|   240M|      p2_ir_buf++;
  667|   240M|      p3_ir_buf++;
  668|   240M|      *p2 = cor;
  669|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  670|   240M|      p2_ir_buf++;
  671|   240M|      p3_ir_buf++;
  672|   240M|      *p1 = cor;
  673|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  674|   240M|      p2_ir_buf++;
  675|   240M|      p3_ir_buf++;
  676|   240M|      *p0 = cor;
  677|   240M|      p3 -= (16 + 1);
  678|   240M|      p2 -= (16 + 1);
  679|   240M|      p1 -= (16 + 1);
  680|   240M|      p0 -= (16 + 1);
  681|   240M|    }
  682|  32.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  683|  32.0M|    p2_ir_buf++;
  684|  32.0M|    p3_ir_buf++;
  685|  32.0M|    *p3 = cor;
  686|  32.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  687|  32.0M|    p2_ir_buf++;
  688|  32.0M|    p3_ir_buf++;
  689|  32.0M|    *p2 = cor;
  690|  32.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  691|  32.0M|    p2_ir_buf++;
  692|  32.0M|    p3_ir_buf++;
  693|  32.0M|    *p1 = cor;
  694|  32.0M|    pos -= 16;
  695|  32.0M|    p4_ir_buf += 4;
  696|  32.0M|  }
  697|  2.00M|  pos = 256 - 1;
  698|  2.00M|  p4_ir_buf = p1_ir_buf + 3;
  699|  34.0M|  for (k = 0; k < 16; k++) {
  ------------------
  |  Branch (699:15): [True: 32.0M, False: 2.00M]
  ------------------
  700|  32.0M|    p3 = &corr_p1p2[3][pos];
  701|  32.0M|    p2 = &corr_p1p2[2][pos - 1];
  702|  32.0M|    p1 = &corr_p1p2[1][pos - 1];
  703|  32.0M|    p0 = &corr_p1p2[0][pos - 1];
  704|  32.0M|    cor = 0.0F;
  705|  32.0M|    p2_ir_buf = p1_ir_buf;
  706|  32.0M|    p3_ir_buf = p4_ir_buf;
  707|   272M|    for (i = k + 1; i < 16; i++) {
  ------------------
  |  Branch (707:21): [True: 240M, False: 32.0M]
  ------------------
  708|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  709|   240M|      p2_ir_buf++;
  710|   240M|      p3_ir_buf++;
  711|   240M|      *p3 = cor;
  712|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  713|   240M|      p2_ir_buf++;
  714|   240M|      p3_ir_buf++;
  715|   240M|      *p2 = cor;
  716|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  717|   240M|      p2_ir_buf++;
  718|   240M|      p3_ir_buf++;
  719|   240M|      *p1 = cor;
  720|   240M|      cor += (*p2_ir_buf) * (*p3_ir_buf);
  721|   240M|      p2_ir_buf++;
  722|   240M|      p3_ir_buf++;
  723|   240M|      *p0 = cor;
  724|   240M|      p3 -= (16 + 1);
  725|   240M|      p2 -= (16 + 1);
  726|   240M|      p1 -= (16 + 1);
  727|   240M|      p0 -= (16 + 1);
  728|   240M|    }
  729|  32.0M|    cor += (*p2_ir_buf) * (*p3_ir_buf);
  730|  32.0M|    p2_ir_buf++;
  731|  32.0M|    p3_ir_buf++;
  732|  32.0M|    *p3 = cor;
  733|  32.0M|    pos--;
  734|  32.0M|    p4_ir_buf += 4;
  735|  32.0M|  }
  736|       |
  737|  2.00M|  p0 = &corr_p1p2[0][0];
  738|  10.0M|  for (k = 0; k < 4; k++) {
  ------------------
  |  Branch (738:15): [True: 8.02M, False: 2.00M]
  ------------------
  739|   136M|    for (i = k; i < LEN_SUBFR; i += 4) {
  ------------------
  |  |   77|   136M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (739:17): [True: 128M, False: 8.02M]
  ------------------
  740|   128M|      psign = sign;
  741|   128M|      if (psign[i] < 0.0F) {
  ------------------
  |  Branch (741:11): [True: 64.2M, False: 64.0M]
  ------------------
  742|  64.2M|        psign = vec;
  743|  64.2M|      }
  744|   128M|      j = (k + 1) % 4;
  745|   128M|      p0[0] = p0[0] * psign[j];
  746|   128M|      p0[1] = p0[1] * psign[j + 4];
  747|   128M|      p0[2] = p0[2] * psign[j + 8];
  748|   128M|      p0[3] = p0[3] * psign[j + 12];
  749|   128M|      p0[4] = p0[4] * psign[j + 16];
  750|   128M|      p0[5] = p0[5] * psign[j + 20];
  751|   128M|      p0[6] = p0[6] * psign[j + 24];
  752|   128M|      p0[7] = p0[7] * psign[j + 28];
  753|   128M|      p0[8] = p0[8] * psign[j + 32];
  754|   128M|      p0[9] = p0[9] * psign[j + 36];
  755|   128M|      p0[10] = p0[10] * psign[j + 40];
  756|   128M|      p0[11] = p0[11] * psign[j + 44];
  757|   128M|      p0[12] = p0[12] * psign[j + 48];
  758|   128M|      p0[13] = p0[13] * psign[j + 52];
  759|   128M|      p0[14] = p0[14] * psign[j + 56];
  760|   128M|      p0[15] = p0[15] * psign[j + 60];
  761|   128M|      p0 += 16;
  762|   128M|    }
  763|  8.02M|  }
  764|  2.00M|  psk = -1.0;
  765|  2.00M|  alpk = 1.0;
  766|  8.25M|  for (k = 0; k < num_iter; k++) {
  ------------------
  |  Branch (766:15): [True: 6.24M, False: 2.00M]
  ------------------
  767|  34.8M|    for (i = 0; i < num_pulses - (num_pulses % 3); i += 3) {
  ------------------
  |  Branch (767:17): [True: 28.5M, False: 6.24M]
  ------------------
  768|  28.5M|      ipos[i] = iusace_acelp_ipos[(k * 4) + i];
  769|  28.5M|      ipos[i + 1] = iusace_acelp_ipos[(k * 4) + i + 1];
  770|  28.5M|      ipos[i + 2] = iusace_acelp_ipos[(k * 4) + i + 2];
  771|  28.5M|    }
  772|  13.3M|    for (; i < num_pulses; i++) {
  ------------------
  |  Branch (772:12): [True: 7.05M, False: 6.24M]
  ------------------
  773|  7.05M|      ipos[i] = iusace_acelp_ipos[(k * 4) + i];
  774|  7.05M|    }
  775|       |
  776|  6.24M|    if ((num_bits_cb == 20) | (num_bits_cb == 28) | (num_bits_cb == 12) | (num_bits_cb == 16)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 6.24M]
  ------------------
  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.24M|    } else if ((num_bits_cb == 36) | (num_bits_cb == 44)) {
  ------------------
  |  Branch (792:16): [True: 865k, False: 5.38M]
  ------------------
  793|   865k|      pos = 2;
  794|   865k|      pulse_pos[0] = pos_max[ipos[0]];
  795|   865k|      pulse_pos[1] = pos_max[ipos[1]];
  796|   865k|      ps = corr_input[pulse_pos[0]] + corr_input[pulse_pos[1]];
  797|   865k|      alp = corr_ir[ipos[0]][pulse_pos[0] >> 2] + corr_ir[ipos[1]][pulse_pos[1] >> 2] +
  798|   865k|            corr_p1p2[ipos[0]][((pulse_pos[0] >> 2) << 4) + (pulse_pos[1] >> 2)];
  799|   865k|      if (sign[pulse_pos[0]] < 0.0) {
  ------------------
  |  Branch (799:11): [True: 467k, False: 397k]
  ------------------
  800|   467k|        p0 = ir_sign_inv - pulse_pos[0];
  801|   467k|      } else {
  802|   397k|        p0 = p1_ir_buf - pulse_pos[0];
  803|   397k|      }
  804|   865k|      if (sign[pulse_pos[1]] < 0.0) {
  ------------------
  |  Branch (804:11): [True: 467k, False: 397k]
  ------------------
  805|   467k|        p1 = ir_sign_inv - pulse_pos[1];
  806|   467k|      } else {
  807|   397k|        p1 = p1_ir_buf - pulse_pos[1];
  808|   397k|      }
  809|   865k|      vec[0] = p0[0] + p1[0];
  810|   865k|      vec[1] = p0[1] + p1[1];
  811|   865k|      vec[2] = p0[2] + p1[2];
  812|   865k|      vec[3] = p0[3] + p1[3];
  813|  9.52M|      for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  9.52M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (813:19): [True: 8.65M, False: 865k]
  ------------------
  814|  8.65M|        vec[i] = p0[i] + p1[i];
  815|  8.65M|        vec[i + 1] = p0[i + 1] + p1[i + 1];
  816|  8.65M|        vec[i + 2] = p0[i + 2] + p1[i + 2];
  817|  8.65M|        vec[i + 3] = p0[i + 3] + p1[i + 3];
  818|  8.65M|        vec[i + 4] = p0[i + 4] + p1[i + 4];
  819|  8.65M|        vec[i + 5] = p0[i + 5] + p1[i + 5];
  820|  8.65M|      }
  821|   865k|      if (num_bits_cb == 44) {
  ------------------
  |  Branch (821:11): [True: 0, False: 865k]
  ------------------
  822|      0|        ipos[8] = 0;
  823|      0|        ipos[9] = 1;
  824|      0|      }
  825|  5.38M|    } else {
  826|  5.38M|      pos = 4;
  827|  5.38M|      pulse_pos[0] = pos_max[ipos[0]];
  828|  5.38M|      pulse_pos[1] = pos_max[ipos[1]];
  829|  5.38M|      pulse_pos[2] = pos_max[ipos[2]];
  830|  5.38M|      pulse_pos[3] = pos_max[ipos[3]];
  831|  5.38M|      ps = corr_input[pulse_pos[0]] + corr_input[pulse_pos[1]] + corr_input[pulse_pos[2]] +
  832|  5.38M|           corr_input[pulse_pos[3]];
  833|  5.38M|      p0 = p1_ir_buf - pulse_pos[0];
  834|  5.38M|      if (sign[pulse_pos[0]] < 0.0) {
  ------------------
  |  Branch (834:11): [True: 2.66M, False: 2.71M]
  ------------------
  835|  2.66M|        p0 = ir_sign_inv - pulse_pos[0];
  836|  2.66M|      }
  837|  5.38M|      p1 = p1_ir_buf - pulse_pos[1];
  838|  5.38M|      if (sign[pulse_pos[1]] < 0.0) {
  ------------------
  |  Branch (838:11): [True: 2.66M, False: 2.71M]
  ------------------
  839|  2.66M|        p1 = ir_sign_inv - pulse_pos[1];
  840|  2.66M|      }
  841|  5.38M|      p2 = p1_ir_buf - pulse_pos[2];
  842|  5.38M|      if (sign[pulse_pos[2]] < 0.0) {
  ------------------
  |  Branch (842:11): [True: 2.67M, False: 2.70M]
  ------------------
  843|  2.67M|        p2 = ir_sign_inv - pulse_pos[2];
  844|  2.67M|      }
  845|  5.38M|      p3 = p1_ir_buf - pulse_pos[3];
  846|  5.38M|      if (sign[pulse_pos[3]] < 0.0) {
  ------------------
  |  Branch (846:11): [True: 2.67M, False: 2.70M]
  ------------------
  847|  2.67M|        p3 = ir_sign_inv - pulse_pos[3];
  848|  2.67M|      }
  849|  5.38M|      vec[0] = p0[0] + p1[0] + p2[0] + p3[0];
  850|   118M|      for (i = 1; i < LEN_SUBFR; i += 3) {
  ------------------
  |  |   77|   118M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (850:19): [True: 112M, False: 5.38M]
  ------------------
  851|   112M|        vec[i] = p0[i] + p1[i] + p2[i] + p3[i];
  852|   112M|        vec[i + 1] = p0[i + 1] + p1[i + 1] + p2[i + 1] + p3[i + 1];
  853|   112M|        vec[i + 2] = p0[i + 2] + p1[i + 2] + p2[i + 2] + p3[i + 2];
  854|   112M|      }
  855|  5.38M|      alp = 0.0F;
  856|  5.38M|      alp += vec[0] * vec[0] + vec[1] * vec[1];
  857|  5.38M|      alp += vec[2] * vec[2] + vec[3] * vec[3];
  858|  59.1M|      for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|  59.1M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (858:19): [True: 53.8M, False: 5.38M]
  ------------------
  859|  53.8M|        alp += vec[i] * vec[i];
  860|  53.8M|        alp += vec[i + 1] * vec[i + 1];
  861|  53.8M|        alp += vec[i + 2] * vec[i + 2];
  862|  53.8M|        alp += vec[i + 3] * vec[i + 3];
  863|  53.8M|        alp += vec[i + 4] * vec[i + 4];
  864|  53.8M|        alp += vec[i + 5] * vec[i + 5];
  865|  53.8M|      }
  866|  5.38M|      alp *= 0.5F;
  867|  5.38M|      if (num_bits_cb == 72) {
  ------------------
  |  Branch (867:11): [True: 0, False: 5.38M]
  ------------------
  868|      0|        ipos[16] = 0;
  869|      0|        ipos[17] = 1;
  870|      0|      }
  871|  5.38M|    }
  872|       |
  873|  41.0M|    for (j = pos, st = 0; j < num_pulses; j += 2, st++) {
  ------------------
  |  Branch (873:27): [True: 34.7M, False: 6.24M]
  ------------------
  874|  34.7M|      if ((num_pulses - j) >= 2) {
  ------------------
  |  Branch (874:11): [True: 34.7M, False: 0]
  ------------------
  875|  34.7M|        iusace_acelp_ir_vec_corr1(p1_ir_buf, vec, ipos[j], sign, corr_ir, corr_x, dn2_pos,
  876|  34.7M|                                  num_pulse_position[st]);
  877|  34.7M|        iusace_acelp_ir_vec_corr2(p1_ir_buf, vec, ipos[j + 1], sign, corr_ir, corr_y);
  878|       |
  879|  34.7M|        iusace_acelp_get_2p_pos(num_pulse_position[st], ipos[j], ipos[j + 1], &ps, &alp,
  880|  34.7M|                                &pulse_pos[j], &pulse_pos[j + 1], corr_input, dn2_pos, corr_x,
  881|  34.7M|                                corr_y, corr_p1p2);
  882|  34.7M|      } 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|  34.7M|      if (j < (num_pulses - 2)) {
  ------------------
  |  Branch (888:11): [True: 28.5M, False: 6.24M]
  ------------------
  889|  28.5M|        p0 = p1_ir_buf - pulse_pos[j];
  890|  28.5M|        if (sign[pulse_pos[j]] < 0.0) {
  ------------------
  |  Branch (890:13): [True: 14.2M, False: 14.3M]
  ------------------
  891|  14.2M|          p0 = ir_sign_inv - pulse_pos[j];
  892|  14.2M|        }
  893|  28.5M|        p1 = p1_ir_buf - pulse_pos[j + 1];
  894|  28.5M|        if (sign[pulse_pos[j + 1]] < 0.0) {
  ------------------
  |  Branch (894:13): [True: 14.2M, False: 14.2M]
  ------------------
  895|  14.2M|          p1 = ir_sign_inv - pulse_pos[j + 1];
  896|  14.2M|        }
  897|  28.5M|        vec[0] += p0[0] + p1[0];
  898|  28.5M|        vec[1] += p0[1] + p1[1];
  899|  28.5M|        vec[2] += p0[2] + p1[2];
  900|  28.5M|        vec[3] += p0[3] + p1[3];
  901|   313M|        for (i = 4; i < LEN_SUBFR; i += 6) {
  ------------------
  |  |   77|   313M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (901:21): [True: 285M, False: 28.5M]
  ------------------
  902|   285M|          vec[i] += p0[i] + p1[i];
  903|   285M|          vec[i + 1] += p0[i + 1] + p1[i + 1];
  904|   285M|          vec[i + 2] += p0[i + 2] + p1[i + 2];
  905|   285M|          vec[i + 3] += p0[i + 3] + p1[i + 3];
  906|   285M|          vec[i + 4] += p0[i + 4] + p1[i + 4];
  907|   285M|          vec[i + 5] += p0[i + 5] + p1[i + 5];
  908|   285M|        }
  909|  28.5M|      }
  910|  34.7M|    }
  911|  6.24M|    ps = ps * ps;
  912|  6.24M|    s = (alpk * ps) - (psk * alp);
  913|  6.24M|    if (s > 0.0F) {
  ------------------
  |  Branch (913:9): [True: 3.64M, False: 2.60M]
  ------------------
  914|  3.64M|      psk = ps;
  915|  3.64M|      alpk = alp;
  916|  3.64M|      memcpy(codvec, pulse_pos, num_pulses * sizeof(WORD32));
  917|  3.64M|    }
  918|  6.24M|  }
  919|       |
  920|  2.00M|  memset(alg_cb_exc_out, 0, LEN_SUBFR * sizeof(WORD16));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  921|  2.00M|  memset(filt_cb_exc, 0, LEN_SUBFR * sizeof(FLOAT32));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
  922|  2.00M|  memset(pulse_pos, 0xffffffff, NPMAXPT * 4 * sizeof(WORD32));
  ------------------
  |  |  176|  2.00M|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  2.00M|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  923|  32.3M|  for (k = 0; k < num_pulses; k++) {
  ------------------
  |  Branch (923:15): [True: 30.2M, False: 2.00M]
  ------------------
  924|  30.2M|    i = codvec[k];
  925|  30.2M|    val = sign[i];
  926|  30.2M|    index = i / 4;
  927|  30.2M|    track = i % 4;
  928|  30.2M|    if (val > 0) {
  ------------------
  |  Branch (928:9): [True: 15.1M, False: 15.1M]
  ------------------
  929|  15.1M|      alg_cb_exc_out[i] += 512;
  930|  15.1M|      codvec[k] += (2 * LEN_SUBFR);
  ------------------
  |  |   77|  15.1M|#define LEN_SUBFR (64)
  ------------------
  931|  15.1M|    } else {
  932|  15.1M|      alg_cb_exc_out[i] -= 512;
  933|  15.1M|      index += 16;
  934|  15.1M|    }
  935|  30.2M|    i = track * NPMAXPT;
  ------------------
  |  |  176|  30.2M|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  30.2M|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  936|  73.9M|    while (pulse_pos[i] >= 0) {
  ------------------
  |  Branch (936:12): [True: 43.6M, False: 30.2M]
  ------------------
  937|  43.6M|      i++;
  938|  43.6M|    }
  939|  30.2M|    pulse_pos[i] = index;
  940|  30.2M|    p0 = ir_sign_inv - codvec[k];
  941|  30.2M|    filt_cb_exc[0] += p0[0];
  942|   666M|    for (i = 1; i < LEN_SUBFR; i += 3) {
  ------------------
  |  |   77|   666M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (942:17): [True: 636M, False: 30.2M]
  ------------------
  943|   636M|      filt_cb_exc[i] += p0[i];
  944|   636M|      filt_cb_exc[i + 1] += p0[i + 1];
  945|   636M|      filt_cb_exc[i + 2] += p0[i + 2];
  946|   636M|    }
  947|  30.2M|  }
  948|       |
  949|  2.00M|  if (num_bits_cb == ACELP_NUM_BITS_20) {
  ------------------
  |  |  130|  2.00M|#define ACELP_NUM_BITS_20 (20)
  ------------------
  |  Branch (949:7): [True: 0, False: 2.00M]
  ------------------
  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.00M|  } else if (num_bits_cb == ACELP_NUM_BITS_28) {
  ------------------
  |  |  131|  2.00M|#define ACELP_NUM_BITS_28 (28)
  ------------------
  |  Branch (954:14): [True: 0, False: 2.00M]
  ------------------
  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.00M|  } else if (num_bits_cb == ACELP_NUM_BITS_36) {
  ------------------
  |  |  132|  2.00M|#define ACELP_NUM_BITS_36 (36)
  ------------------
  |  Branch (963:14): [True: 216k, False: 1.78M]
  ------------------
  964|  1.08M|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (964:21): [True: 865k, False: 216k]
  ------------------
  965|   865k|      k = track * NPMAXPT;
  ------------------
  |  |  176|   865k|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|   865k|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  966|   865k|      acelp_param_out[track] = iusace_acelp_quant_2p_2n1bits(pulse_pos[k], pulse_pos[k + 1], 4);
  967|   865k|    }
  968|  1.78M|  } else if (num_bits_cb == ACELP_NUM_BITS_44) {
  ------------------
  |  |  133|  1.78M|#define ACELP_NUM_BITS_44 (44)
  ------------------
  |  Branch (968:14): [True: 0, False: 1.78M]
  ------------------
  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.78M|  } else if (num_bits_cb == ACELP_NUM_BITS_52) {
  ------------------
  |  |  134|  1.78M|#define ACELP_NUM_BITS_52 (52)
  ------------------
  |  Branch (978:14): [True: 13.8k, False: 1.77M]
  ------------------
  979|  69.0k|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (979:21): [True: 55.2k, False: 13.8k]
  ------------------
  980|  55.2k|      k = track * NPMAXPT;
  ------------------
  |  |  176|  55.2k|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  55.2k|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  981|  55.2k|      acelp_param_out[track] =
  982|  55.2k|          iusace_acelp_quant_3p_3n1bits(pulse_pos[k], pulse_pos[k + 1], pulse_pos[k + 2], 4);
  983|  55.2k|    }
  984|  1.77M|  } else if (num_bits_cb == ACELP_NUM_BITS_64) {
  ------------------
  |  |  135|  1.77M|#define ACELP_NUM_BITS_64 (64)
  ------------------
  |  Branch (984:14): [True: 1.77M, False: 0]
  ------------------
  985|  8.87M|    for (track = 0; track < 4; track++) {
  ------------------
  |  Branch (985:21): [True: 7.10M, False: 1.77M]
  ------------------
  986|  7.10M|      k = track * NPMAXPT;
  ------------------
  |  |  176|  7.10M|#define NPMAXPT ((MAX_NUM_PULSES + 4 - 1) / 4)
  |  |  ------------------
  |  |  |  |  175|  7.10M|#define MAX_NUM_PULSES (24)
  |  |  ------------------
  ------------------
  987|  7.10M|      l_index = iusace_acelp_quant_4p_4nbits(&pulse_pos[k], 4);
  988|  7.10M|      acelp_param_out[track] = ((l_index >> 14) & 3);
  989|  7.10M|      acelp_param_out[track + 4] = (l_index & 0x3FFF);
  990|  7.10M|    }
  991|  1.77M|  } 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.00M|  return;
 1013|  2.00M|}
iusace_acelp_ltpred_cb_exc:
 1015|  2.00M|VOID iusace_acelp_ltpred_cb_exc(FLOAT32 *exc, WORD32 t0, WORD32 t0_frac, WORD32 len_subfrm) {
 1016|  2.00M|  WORD32 i, j;
 1017|  2.00M|  FLOAT32 s, *x0, *x1, *x2;
 1018|  2.00M|  const FLOAT32 *c1, *c2;
 1019|       |
 1020|  2.00M|  x0 = &exc[-t0];
 1021|  2.00M|  t0_frac = -t0_frac;
 1022|  2.00M|  if (t0_frac < 0) {
  ------------------
  |  Branch (1022:7): [True: 1.03M, False: 973k]
  ------------------
 1023|  1.03M|    t0_frac += T_UP_SAMP;
  ------------------
  |  |  104|  1.03M|#define T_UP_SAMP (4)
  ------------------
 1024|  1.03M|    x0--;
 1025|  1.03M|  }
 1026|   132M|  for (j = 0; j < len_subfrm; j++) {
  ------------------
  |  Branch (1026:15): [True: 130M, False: 2.00M]
  ------------------
 1027|   130M|    x1 = x0++;
 1028|   130M|    x2 = x1 + 1;
 1029|   130M|    c1 = &iusace_res_interp_filter1_4[t0_frac];
 1030|   130M|    c2 = &iusace_res_interp_filter1_4[T_UP_SAMP - t0_frac];
  ------------------
  |  |  104|   130M|#define T_UP_SAMP (4)
  ------------------
 1031|   130M|    s = 0.0;
 1032|  2.21G|    for (i = 0; i < INTER_LP_FIL_ORDER; i++, c1 += T_UP_SAMP, c2 += T_UP_SAMP) {
  ------------------
  |  |  105|  2.21G|#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.08G|#define T_UP_SAMP (4)
  ------------------
                  for (i = 0; i < INTER_LP_FIL_ORDER; i++, c1 += T_UP_SAMP, c2 += T_UP_SAMP) {
  ------------------
  |  |  104|  2.08G|#define T_UP_SAMP (4)
  ------------------
  |  Branch (1032:17): [True: 2.08G, False: 130M]
  ------------------
 1033|  2.08G|      s += (*x1--) * (*c1) + (*x2++) * (*c2);
 1034|  2.08G|    }
 1035|   130M|    exc[j] = s;
 1036|   130M|  }
 1037|  2.00M|}
iusace_acelp_quant_gain:
 1040|  2.00M|                             FLOAT32 *tgt_cb_corr_data, FLOAT32 mean_energy, WORD32 *qunt_idx) {
 1041|  2.00M|  WORD32 i, indice = 0, min_pitch_idx;
 1042|  2.00M|  FLOAT32 ener_code, pred_code_gain;
 1043|  2.00M|  FLOAT32 dist, dist_min, g_pitch, g_code;
 1044|  2.00M|  const FLOAT32 *p1_qua_gain_table, *p2_qua_gain_table;
 1045|       |
 1046|  2.00M|  p1_qua_gain_table = iusace_acelp_quant_gain_table;
 1047|  2.00M|  p2_qua_gain_table = (const FLOAT32 *)(iusace_acelp_quant_gain_table + ACELP_GAIN_TBL_OFFSET);
  ------------------
  |  |  177|  2.00M|#define ACELP_GAIN_TBL_OFFSET (64)
  ------------------
 1048|  2.00M|  min_pitch_idx = 0;
 1049|  2.00M|  g_pitch = *pitch_gain;
 1050|   130M|  for (i = 0; i < ACELP_RANGE_GAIN_PT_IDX_SEARCH; i++, p2_qua_gain_table += 2) {
  ------------------
  |  |  178|   130M|#define ACELP_RANGE_GAIN_PT_IDX_SEARCH (NUM_QUANTIZATION_LEVEL - ACELP_GAIN_TBL_OFFSET)
  |  |  ------------------
  |  |  |  |  163|   130M|#define NUM_QUANTIZATION_LEVEL (128)
  |  |  ------------------
  |  |               #define ACELP_RANGE_GAIN_PT_IDX_SEARCH (NUM_QUANTIZATION_LEVEL - ACELP_GAIN_TBL_OFFSET)
  |  |  ------------------
  |  |  |  |  177|   130M|#define ACELP_GAIN_TBL_OFFSET (64)
  |  |  ------------------
  ------------------
  |  Branch (1050:15): [True: 128M, False: 2.00M]
  ------------------
 1051|   128M|    if (g_pitch > *p2_qua_gain_table) {
  ------------------
  |  Branch (1051:9): [True: 36.3M, False: 92.0M]
  ------------------
 1052|  36.3M|      continue;
 1053|  36.3M|    }
 1054|   128M|  }
 1055|  2.00M|  ener_code = 0.01F;
 1056|       |
 1057|   130M|  for (i = 0; i < LEN_SUBFR; i++) {
  ------------------
  |  |   77|   130M|#define LEN_SUBFR (64)
  ------------------
  |  Branch (1057:15): [True: 128M, False: 2.00M]
  ------------------
 1058|   128M|    ener_code += code[i] * code[i];
 1059|   128M|  }
 1060|       |
 1061|  2.00M|  ener_code = (FLOAT32)(10.0 * log10(ener_code / (FLOAT32)LEN_SUBFR));
  ------------------
  |  |   77|  2.00M|#define LEN_SUBFR (64)
  ------------------
 1062|  2.00M|  pred_code_gain = mean_energy - ener_code;
 1063|  2.00M|  pred_code_gain = (FLOAT32)pow(10.0, pred_code_gain / 20.0);
 1064|       |
 1065|  2.00M|  dist_min = MAX_FLT_VAL;
  ------------------
  |  |  181|  2.00M|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
 1066|  2.00M|  p2_qua_gain_table = (const FLOAT32 *)(p1_qua_gain_table + min_pitch_idx * 2);
 1067|   258M|  for (i = 0; i < ACELP_SEARCH_RANGE_QUANTIZER_IDX; i++) {
  ------------------
  |  |  179|   258M|#define ACELP_SEARCH_RANGE_QUANTIZER_IDX (128)
  ------------------
  |  Branch (1067:15): [True: 256M, False: 2.00M]
  ------------------
 1068|   256M|    g_pitch = *p2_qua_gain_table++;
 1069|   256M|    g_code = pred_code_gain * *p2_qua_gain_table++;
 1070|   256M|    dist = g_pitch * g_pitch * tgt_cb_corr_data[0] + g_pitch * tgt_cb_corr_data[1] +
 1071|   256M|           g_code * g_code * tgt_cb_corr_data[2] + g_code * tgt_cb_corr_data[3] +
 1072|   256M|           g_pitch * g_code * tgt_cb_corr_data[4];
 1073|   256M|    if (dist < dist_min) {
  ------------------
  |  Branch (1073:9): [True: 13.8M, False: 242M]
  ------------------
 1074|  13.8M|      dist_min = dist;
 1075|  13.8M|      indice = i;
 1076|  13.8M|    }
 1077|   256M|  }
 1078|  2.00M|  indice += min_pitch_idx;
 1079|  2.00M|  *pitch_gain = p1_qua_gain_table[indice * 2];
 1080|  2.00M|  *code_gain = p1_qua_gain_table[indice * 2 + 1] * pred_code_gain;
 1081|  2.00M|  *qunt_idx = indice;
 1082|  2.00M|}
iusace_acelp_tools.c:iusace_acelp_ir_vec_corr1:
   29|  34.7M|                                      WORD32 num_pluse_pos) {
   30|  34.7M|  WORD16 i, j;
   31|  34.7M|  WORD32 dn;
   32|  34.7M|  WORD32 *dn2;
   33|  34.7M|  FLOAT32 *p0;
   34|  34.7M|  FLOAT32 s;
   35|  34.7M|  dn2 = &dn2_pos[track * 8];
   36|  34.7M|  p0 = corr_ir[track];
   37|   245M|  for (i = 0; i < num_pluse_pos; i++) {
  ------------------
  |  Branch (37:15): [True: 210M, False: 34.7M]
  ------------------
   38|   210M|    dn = dn2[i];
   39|   210M|    s = 0.0F;
   40|  8.56G|    for (j = 0; j < (LEN_SUBFR - dn); j++) {
  ------------------
  |  |   77|  8.56G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (40:17): [True: 8.35G, False: 210M]
  ------------------
   41|  8.35G|      s += ir[j] * vec[dn + j];
   42|  8.35G|    }
   43|   210M|    corr_out[dn >> 2] = sign[dn] * s + p0[dn >> 2];
   44|   210M|  }
   45|  34.7M|}
iusace_acelp_tools.c:iusace_acelp_ir_vec_corr2:
   48|  34.7M|                                      FLOAT32 (*corr_ir)[16], FLOAT32 *corr_out) {
   49|  34.7M|  WORD32 i, j;
   50|  34.7M|  FLOAT32 *p0;
   51|  34.7M|  FLOAT32 s;
   52|  34.7M|  p0 = corr_ir[track];
   53|   591M|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (53:15): [True: 556M, False: 34.7M]
  ------------------
   54|   556M|    s = 0.0F;
   55|  18.6G|    for (j = 0; j < LEN_SUBFR - track; j++) {
  ------------------
  |  |   77|  18.6G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (55:17): [True: 18.1G, False: 556M]
  ------------------
   56|  18.1G|      s += ir[j] * vec[track + j];
   57|  18.1G|    }
   58|   556M|    corr_out[i] = s * sign[track] + p0[i];
   59|   556M|    track += 4;
   60|   556M|  }
   61|  34.7M|}
iusace_acelp_tools.c:iusace_acelp_get_2p_pos:
   66|  34.7M|                                    FLOAT32 *corr_p2, FLOAT32 (*corr_p1p2)[256]) {
   67|  34.7M|  WORD32 x, x2, y, x_save = 0, y_save = 0, i, *pos_x;
   68|  34.7M|  FLOAT32 ps0, alp0;
   69|  34.7M|  FLOAT32 ps1, ps2, sq, sqk;
   70|  34.7M|  FLOAT32 alp1, alp2, alpk;
   71|  34.7M|  FLOAT32 *p1, *p2;
   72|  34.7M|  FLOAT32 s;
   73|  34.7M|  pos_x = &dn2[track_p1 << 3];
   74|  34.7M|  ps0 = *corr_pulses;
   75|  34.7M|  alp0 = *ener_pulses;
   76|  34.7M|  sqk = -1.0F;
   77|  34.7M|  alpk = 1.0F;
   78|       |
   79|   245M|  for (i = 0; i < nb_pos_ix; i++) {
  ------------------
  |  Branch (79:15): [True: 210M, False: 34.7M]
  ------------------
   80|   210M|    x = pos_x[i];
   81|   210M|    x2 = x >> 2;
   82|       |
   83|   210M|    ps1 = ps0 + dn[x];
   84|   210M|    alp1 = alp0 + corr_p1[x2];
   85|   210M|    p1 = corr_p2;
   86|   210M|    p2 = &corr_p1p2[track_p1][x2 << 4];
   87|  3.57G|    for (y = track_p2; y < LEN_SUBFR; y += 4) {
  ------------------
  |  |   77|  3.57G|#define LEN_SUBFR (64)
  ------------------
  |  Branch (87:24): [True: 3.36G, False: 210M]
  ------------------
   88|  3.36G|      ps2 = ps1 + dn[y];
   89|  3.36G|      alp2 = alp1 + (*p1++) + (*p2++);
   90|  3.36G|      sq = ps2 * ps2;
   91|  3.36G|      s = (alpk * sq) - (sqk * alp2);
   92|  3.36G|      if (s > 0.0F) {
  ------------------
  |  Branch (92:11): [True: 202M, False: 3.16G]
  ------------------
   93|   202M|        sqk = sq;
   94|   202M|        alpk = alp2;
   95|   202M|        y_save = y;
   96|   202M|        x_save = x;
   97|   202M|      }
   98|  3.36G|    }
   99|   210M|  }
  100|  34.7M|  *corr_pulses = ps0 + dn[x_save] + dn[y_save];
  101|  34.7M|  *ener_pulses = alpk;
  102|  34.7M|  *pos_p1 = x_save;
  103|  34.7M|  *pos_p2 = y_save;
  104|  34.7M|}
iusace_acelp_tools.c:iusace_acelp_quant_1p_n1bits:
  151|  6.16M|static WORD32 iusace_acelp_quant_1p_n1bits(WORD32 pos_pulse, WORD32 num_bits_pos) {
  152|  6.16M|  WORD32 mask;
  153|  6.16M|  WORD32 index;
  154|  6.16M|  mask = ((1 << num_bits_pos) - 1);
  155|       |
  156|  6.16M|  index = (pos_pulse & mask);
  157|  6.16M|  if ((pos_pulse & 16) != 0) {
  ------------------
  |  Branch (157:7): [True: 3.09M, False: 3.07M]
  ------------------
  158|  3.09M|    index += 1 << num_bits_pos;
  159|  3.09M|  }
  160|  6.16M|  return (index);
  161|  6.16M|}
iusace_acelp_tools.c:iusace_acelp_quant_2p_2n1bits:
  163|  12.0M|static WORD32 iusace_acelp_quant_2p_2n1bits(WORD32 pos_p1, WORD32 pos_p2, WORD32 num_bits_pos) {
  164|  12.0M|  WORD32 mask;
  165|  12.0M|  WORD32 index;
  166|  12.0M|  mask = ((1 << num_bits_pos) - 1);
  167|       |
  168|  12.0M|  if (((pos_p2 ^ pos_p1) & 16) == 0) {
  ------------------
  |  Branch (168:7): [True: 8.31M, False: 3.74M]
  ------------------
  169|  8.31M|    if ((pos_p1 - pos_p2) <= 0) {
  ------------------
  |  Branch (169:9): [True: 6.01M, False: 2.30M]
  ------------------
  170|  6.01M|      index = ((pos_p1 & mask) << num_bits_pos) + (pos_p2 & mask);
  171|  6.01M|    } else {
  172|  2.30M|      index = ((pos_p2 & mask) << num_bits_pos) + (pos_p1 & mask);
  173|  2.30M|    }
  174|  8.31M|    if ((pos_p1 & 16) != 0) {
  ------------------
  |  Branch (174:9): [True: 4.13M, False: 4.18M]
  ------------------
  175|  4.13M|      index += 1 << (2 * num_bits_pos);
  176|  4.13M|    }
  177|  8.31M|  } else {
  178|  3.74M|    if (((pos_p1 & mask) - (pos_p2 & mask)) <= 0) {
  ------------------
  |  Branch (178:9): [True: 2.11M, False: 1.63M]
  ------------------
  179|  2.11M|      index = ((pos_p2 & mask) << num_bits_pos) + (pos_p1 & mask);
  180|  2.11M|      if ((pos_p2 & 16) != 0) {
  ------------------
  |  Branch (180:11): [True: 1.06M, False: 1.04M]
  ------------------
  181|  1.06M|        index += 1 << (2 * num_bits_pos);
  182|  1.06M|      }
  183|  2.11M|    } else {
  184|  1.63M|      index = ((pos_p1 & mask) << num_bits_pos) + (pos_p2 & mask);
  185|  1.63M|      if ((pos_p1 & 16) != 0) {
  ------------------
  |  Branch (185:11): [True: 820k, False: 813k]
  ------------------
  186|   820k|        index += 1 << (2 * num_bits_pos);
  187|   820k|      }
  188|  1.63M|    }
  189|  3.74M|  }
  190|  12.0M|  return (index);
  191|  12.0M|}
iusace_acelp_tools.c:iusace_acelp_quant_3p_3n1bits:
  194|  3.11M|                                            WORD32 num_bits_pos) {
  195|  3.11M|  WORD32 nb_pos;
  196|  3.11M|  WORD32 index;
  197|  3.11M|  nb_pos = (1 << (num_bits_pos - 1));
  198|       |
  199|  3.11M|  if (((pos_p1 ^ pos_p2) & nb_pos) == 0) {
  ------------------
  |  Branch (199:7): [True: 1.68M, False: 1.42M]
  ------------------
  200|  1.68M|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p2, (num_bits_pos - 1));
  201|  1.68M|    index += (pos_p1 & nb_pos) << num_bits_pos;
  202|  1.68M|    index += iusace_acelp_quant_1p_n1bits(pos_p3, num_bits_pos) << (2 * num_bits_pos);
  203|  1.68M|  } else if (((pos_p1 ^ pos_p3) & nb_pos) == 0) {
  ------------------
  |  Branch (203:14): [True: 784k, False: 641k]
  ------------------
  204|   784k|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p3, (num_bits_pos - 1));
  205|   784k|    index += (pos_p1 & nb_pos) << num_bits_pos;
  206|   784k|    index += iusace_acelp_quant_1p_n1bits(pos_p2, num_bits_pos) << (2 * num_bits_pos);
  207|   784k|  } else {
  208|   641k|    index = iusace_acelp_quant_2p_2n1bits(pos_p2, pos_p3, (num_bits_pos - 1));
  209|   641k|    index += (pos_p2 & nb_pos) << num_bits_pos;
  210|   641k|    index += iusace_acelp_quant_1p_n1bits(pos_p1, num_bits_pos) << (2 * num_bits_pos);
  211|   641k|  }
  212|  3.11M|  return (index);
  213|  3.11M|}
iusace_acelp_tools.c:iusace_acelp_quant_4p_4nbits:
  237|  7.10M|static WORD32 iusace_acelp_quant_4p_4nbits(WORD32 *pos_pulses, WORD32 num_bits_pos) {
  238|  7.10M|  WORD32 i, j, k, nb_pos, n_1;
  239|  7.10M|  WORD32 pos_a[4], pos_b[4];
  240|  7.10M|  WORD32 index = 0;
  241|  7.10M|  n_1 = num_bits_pos - 1;
  242|  7.10M|  nb_pos = (1 << n_1);
  243|  7.10M|  i = 0;
  244|  7.10M|  j = 0;
  245|  35.5M|  for (k = 0; k < 4; k++) {
  ------------------
  |  Branch (245:15): [True: 28.4M, False: 7.10M]
  ------------------
  246|  28.4M|    if ((pos_pulses[k] & nb_pos) == 0) {
  ------------------
  |  Branch (246:9): [True: 18.4M, False: 9.90M]
  ------------------
  247|  18.4M|      pos_a[i++] = pos_pulses[k];
  248|  18.4M|    } else {
  249|  9.90M|      pos_b[j++] = pos_pulses[k];
  250|  9.90M|    }
  251|  28.4M|  }
  252|  7.10M|  switch (i) {
  ------------------
  |  Branch (252:11): [True: 7.10M, False: 0]
  ------------------
  253|   190k|    case 0:
  ------------------
  |  Branch (253:5): [True: 190k, False: 6.91M]
  ------------------
  254|   190k|      index = 1 << ((4 * num_bits_pos) - 3);
  255|   190k|      index += iusace_acelp_quant_4p_4n1bits(pos_b[0], pos_b[1], pos_b[2], pos_b[3], n_1);
  256|   190k|      break;
  257|   951k|    case 1:
  ------------------
  |  Branch (257:5): [True: 951k, False: 6.14M]
  ------------------
  258|   951k|      index = iusace_acelp_quant_1p_n1bits(pos_a[0], n_1) << ((3 * n_1) + 1);
  259|   951k|      index += iusace_acelp_quant_3p_3n1bits(pos_b[0], pos_b[1], pos_b[2], n_1);
  260|   951k|      break;
  261|  2.09M|    case 2:
  ------------------
  |  Branch (261:5): [True: 2.09M, False: 5.00M]
  ------------------
  262|  2.09M|      index = iusace_acelp_quant_2p_2n1bits(pos_a[0], pos_a[1], n_1) << ((2 * n_1) + 1);
  263|  2.09M|      index += iusace_acelp_quant_2p_2n1bits(pos_b[0], pos_b[1], n_1);
  264|  2.09M|      break;
  265|  2.10M|    case 3:
  ------------------
  |  Branch (265:5): [True: 2.10M, False: 4.99M]
  ------------------
  266|  2.10M|      index = iusace_acelp_quant_3p_3n1bits(pos_a[0], pos_a[1], pos_a[2], n_1) << num_bits_pos;
  267|  2.10M|      index += iusace_acelp_quant_1p_n1bits(pos_b[0], n_1);
  268|  2.10M|      break;
  269|  1.76M|    case 4:
  ------------------
  |  Branch (269:5): [True: 1.76M, False: 5.33M]
  ------------------
  270|  1.76M|      index = iusace_acelp_quant_4p_4n1bits(pos_a[0], pos_a[1], pos_a[2], pos_a[3], n_1);
  271|  1.76M|      break;
  272|  7.10M|  }
  273|  7.10M|  index += (i & 3) << ((4 * num_bits_pos) - 2);
  274|  7.10M|  return (index);
  275|  7.10M|}
iusace_acelp_tools.c:iusace_acelp_quant_4p_4n1bits:
  216|  1.95M|                                            WORD32 pos_p4, WORD32 num_bits_pos) {
  217|  1.95M|  WORD32 nb_pos;
  218|  1.95M|  WORD32 index;
  219|  1.95M|  nb_pos = (1 << (num_bits_pos - 1));
  220|       |
  221|  1.95M|  if (((pos_p1 ^ pos_p2) & nb_pos) == 0) {
  ------------------
  |  Branch (221:7): [True: 1.32M, False: 628k]
  ------------------
  222|  1.32M|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p2, (num_bits_pos - 1));
  223|  1.32M|    index += (pos_p1 & nb_pos) << num_bits_pos;
  224|  1.32M|    index += iusace_acelp_quant_2p_2n1bits(pos_p3, pos_p4, num_bits_pos) << (2 * num_bits_pos);
  225|  1.32M|  } else if (((pos_p1 ^ pos_p3) & nb_pos) == 0) {
  ------------------
  |  Branch (225:14): [True: 402k, False: 226k]
  ------------------
  226|   402k|    index = iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p3, (num_bits_pos - 1));
  227|   402k|    index += (pos_p1 & nb_pos) << num_bits_pos;
  228|   402k|    index += iusace_acelp_quant_2p_2n1bits(pos_p2, pos_p4, num_bits_pos) << (2 * num_bits_pos);
  229|   402k|  } else {
  230|   226k|    index = iusace_acelp_quant_2p_2n1bits(pos_p2, pos_p3, (num_bits_pos - 1));
  231|   226k|    index += (pos_p2 & nb_pos) << num_bits_pos;
  232|   226k|    index += iusace_acelp_quant_2p_2n1bits(pos_p1, pos_p4, num_bits_pos) << (2 * num_bits_pos);
  233|   226k|  }
  234|  1.95M|  return (index);
  235|  1.95M|}

iusace_arith_enc_spec:
  294|   927k|                             WORD32 arith_reset_flag, WORD32 ccfl) {
  295|   927k|  LOOPIDX i;
  296|   927k|  WORD32 write_flag = (it_bit_buf != NULL);
  297|   927k|  WORD32 size;
  298|   927k|  WORD32 num_wins = (window_sequence == EIGHT_SHORT_SEQUENCE) ? MAX_SHORT_WINDOWS : 1;
  ------------------
  |  |   40|   927k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
                WORD32 num_wins = (window_sequence == EIGHT_SHORT_SEQUENCE) ? MAX_SHORT_WINDOWS : 1;
  ------------------
  |  |   52|   348k|#define MAX_SHORT_WINDOWS (8)
  ------------------
  |  Branch (298:21): [True: 348k, False: 578k]
  ------------------
  299|   927k|  WORD32 bits_data_written = 0;
  300|       |
  301|   927k|  switch (window_sequence) {
  302|   405k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   45|   405k|#define ONLY_LONG_SEQUENCE (0)
  ------------------
  |  Branch (302:5): [True: 405k, False: 521k]
  ------------------
  303|   496k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   46|   496k|#define LONG_START_SEQUENCE (1)
  ------------------
  |  Branch (303:5): [True: 91.2k, False: 835k]
  ------------------
  304|   496k|    case STOP_START_SEQUENCE:
  ------------------
  |  |   49|   496k|#define STOP_START_SEQUENCE (4)
  ------------------
  |  Branch (304:5): [True: 392, False: 926k]
  ------------------
  305|   578k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   48|   578k|#define LONG_STOP_SEQUENCE (3)
  ------------------
  |  Branch (305:5): [True: 81.9k, False: 845k]
  ------------------
  306|   578k|      size = ccfl;
  307|   578k|      break;
  308|   348k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   40|   348k|#define EIGHT_SHORT_SEQUENCE (2)
  ------------------
  |  Branch (308:5): [True: 348k, False: 578k]
  ------------------
  309|   348k|      size = ccfl >> 3;
  310|   348k|      break;
  311|      0|    default:
  ------------------
  |  Branch (311:5): [True: 0, False: 927k]
  ------------------
  312|      0|      size = ccfl >> 3;
  313|      0|      break;
  314|   927k|  }
  315|       |
  316|   927k|  iusace_arith_map_context(size, *ptr_size_prev, ptr_c_pres, ptr_c_prev, arith_reset_flag);
  317|       |
  318|   927k|  if (max_spec_coefficients > 0) {
  ------------------
  |  Branch (318:7): [True: 893k, False: 34.0k]
  ------------------
  319|  4.22M|    for (i = 0; i < num_wins; i++) {
  ------------------
  |  Branch (319:17): [True: 3.32M, False: 893k]
  ------------------
  320|  3.32M|      bits_data_written = iusace_arith_encode_level2(
  321|  3.32M|          it_bit_buf, bits_data_written, ptr_c_pres + 2, ptr_c_prev + 2, &ptr_x_ac_enc[i * size],
  322|  3.32M|          max_spec_coefficients / 2, size / 2, 2);
  323|  3.32M|    }
  324|   893k|  }
  325|       |
  326|   927k|  if (write_flag) {
  ------------------
  |  Branch (326:7): [True: 405k, False: 521k]
  ------------------
  327|   405k|    *ptr_size_prev = size;
  328|   405k|  }
  329|       |
  330|   927k|  return bits_data_written;
  331|   927k|}
iusace_tcx_coding:
  334|   186k|                         WORD32 max_tcx_size, WORD32 *ptr_quant, WORD32 *c_pres, WORD32 *c_prev) {
  335|   186k|  WORD32 bits_written = 0;
  336|       |
  337|   186k|  iusace_arith_map_context(tcx_size, max_tcx_size, c_pres, c_prev, 0);
  338|       |
  339|   186k|  bits_written =
  340|   186k|      iusace_arith_encode_level2(pstr_it_bit_buff, bits_written, c_pres + 2, c_prev + 2,
  341|   186k|                                 &ptr_quant[0], tcx_size / 2, tcx_size / 2, 2);
  342|       |
  343|   186k|  iusace_arith_map_context(max_tcx_size, tcx_size, c_pres, c_prev, 0);
  344|       |
  345|   186k|  return bits_written;
  346|   186k|}
iusace_arith_done:
  348|  9.70M|WORD32 iusace_arith_done(ia_bit_buf_struct *pstr_it_bit_buff, WORD32 bp, iusace_state_arith *s) {
  349|  9.70M|  WORD32 low, high;
  350|  9.70M|  WORD32 bits_to_follow;
  351|       |
  352|  9.70M|  low = s->low;
  353|  9.70M|  high = s->high;
  354|  9.70M|  bits_to_follow = s->value + 1;
  355|       |
  356|  9.70M|  if (low < 16384) {
  ------------------
  |  Branch (356:7): [True: 6.39M, False: 3.30M]
  ------------------
  357|  6.39M|    iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  358|  6.39M|    bp++;
  359|  16.8M|    while (bits_to_follow) {
  ------------------
  |  Branch (359:12): [True: 10.4M, False: 6.39M]
  ------------------
  360|  10.4M|      iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  361|  10.4M|      bp++;
  362|  10.4M|      bits_to_follow--;
  363|  10.4M|    }
  364|  6.39M|  } else {
  365|  3.30M|    iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  366|  3.30M|    bp++;
  367|  8.74M|    while (bits_to_follow) {
  ------------------
  |  Branch (367:12): [True: 5.43M, False: 3.30M]
  ------------------
  368|  5.43M|      iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  369|  5.43M|      bp++;
  370|  5.43M|      bits_to_follow--;
  371|  5.43M|    }
  372|  3.30M|  }
  373|       |
  374|  9.70M|  s->low = low;
  375|  9.70M|  s->high = high;
  376|  9.70M|  s->value = bits_to_follow;
  377|       |
  378|  9.70M|  return bp;
  379|  9.70M|}
iusace_arith_encode:
  382|  1.04G|                           WORD32 symbol, UWORD16 const *cum_freq) {
  383|  1.04G|  WORD32 low, high, range;
  384|  1.04G|  WORD32 bits_to_follow;
  385|       |
  386|  1.04G|  high = s->high;
  387|  1.04G|  low = s->low;
  388|  1.04G|  range = high - low + 1;
  389|       |
  390|  1.04G|  if (symbol > 0) {
  ------------------
  |  Branch (390:7): [True: 634M, False: 414M]
  ------------------
  391|   634M|    high = low + ((range * cum_freq[symbol - 1]) >> 14) - 1;
  392|   634M|  }
  393|       |
  394|  1.04G|  low = low + ((range * cum_freq[symbol]) >> 14);
  395|       |
  396|  1.04G|  bits_to_follow = s->value;
  397|       |
  398|  2.96G|  for (;;) {
  399|  2.96G|    if (high < 32768) {
  ------------------
  |  Branch (399:9): [True: 736M, False: 2.23G]
  ------------------
  400|   736M|      iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  401|   736M|      bp++;
  402|  1.03G|      while (bits_to_follow) {
  ------------------
  |  Branch (402:14): [True: 300M, False: 736M]
  ------------------
  403|   300M|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  404|   300M|        bp++;
  405|   300M|        bits_to_follow--;
  406|   300M|      }
  407|  2.23G|    } else if (low >= 32768) {
  ------------------
  |  Branch (407:16): [True: 669M, False: 1.56G]
  ------------------
  408|   669M|      iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  409|   669M|      bp++;
  410|   879M|      while (bits_to_follow) {
  ------------------
  |  Branch (410:14): [True: 209M, False: 669M]
  ------------------
  411|   209M|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  412|   209M|        bp++;
  413|   209M|        bits_to_follow--;
  414|   209M|      }
  415|   669M|      low -= 32768;
  416|   669M|      high -= 32768;
  417|  1.56G|    } else if (low >= 16384 && high < 49152) {
  ------------------
  |  Branch (417:16): [True: 949M, False: 613M]
  |  Branch (417:32): [True: 514M, False: 434M]
  ------------------
  418|   514M|      bits_to_follow += 1;
  419|   514M|      low -= 16384;
  420|   514M|      high -= 16384;
  421|   514M|    } else
  422|  1.04G|      break;
  423|       |
  424|  1.92G|    low += low;
  425|  1.92G|    high += high + 1;
  426|  1.92G|  }
  427|       |
  428|  1.04G|  s->low = low;
  429|  1.04G|  s->high = high;
  430|  1.04G|  s->value = bits_to_follow;
  431|       |
  432|  1.04G|  return bp;
  433|  1.04G|}
iusace_arith_enc.c:iusace_arith_map_context:
   50|  1.30M|                                     WORD32 *ptr_c_pres, WORD32 arith_reset_flag) {
   51|  1.30M|  WORD32 i, k;
   52|  1.30M|  FLOAT32 ratio;
   53|  1.30M|  WORD32 c_prev[516];
   54|  1.30M|  WORD32 c_pres[516];
   55|       |
   56|  1.30M|  if (arith_reset_flag) {
  ------------------
  |  Branch (56:7): [True: 927k, False: 373k]
  ------------------
   57|   927k|    memset(ptr_c_pres, 0, 516 * sizeof(WORD32));
   58|   927k|    memset(ptr_c_prev, 0, 516 * sizeof(WORD32));
   59|   927k|  } else {
   60|   373k|    memcpy(&c_prev[2], &ptr_c_prev[2], (prev_n / 2 + 2) * sizeof(WORD32));
   61|   373k|    memcpy(&c_pres[2], &ptr_c_pres[2], (prev_n / 2 + 2) * sizeof(WORD32));
   62|       |
   63|   373k|    ratio = (FLOAT32)(prev_n) / (FLOAT32)(pres_n);
   64|   126M|    for (i = 0; i < (pres_n / 2); i++) {
  ------------------
  |  Branch (64:17): [True: 125M, False: 373k]
  ------------------
   65|   125M|      k = (WORD32)((FLOAT32)(i)*ratio);
   66|   125M|      ptr_c_pres[2 + i] = c_pres[2 + k];
   67|   125M|      ptr_c_prev[2 + i] = c_prev[2 + k];
   68|   125M|    }
   69|       |
   70|   373k|    ptr_c_pres[(pres_n / 2) + 2] = c_pres[(prev_n / 2) + 2];
   71|   373k|    ptr_c_pres[(pres_n / 2) + 3] = c_pres[(prev_n / 2) + 3];
   72|   373k|    ptr_c_prev[(pres_n / 2) + 2] = c_prev[(prev_n / 2) + 2];
   73|   373k|    ptr_c_prev[(pres_n / 2) + 3] = c_prev[(prev_n / 2) + 3];
   74|   373k|  }
   75|  1.30M|  return;
   76|  1.30M|}
iusace_arith_enc.c:iusace_arith_encode_level2:
  128|  7.03M|                                         WORD32 n, WORD32 nt, WORD32 use_stop) {
  129|  7.03M|  WORD32 qs[32];
  130|  7.03M|  iusace_state_arith as, as_stop;
  131|       |
  132|  7.03M|  WORD32 a, b, a1, b1, m;
  133|  7.03M|  WORD32 s, t, i, l, lev, esc_nb;
  134|  7.03M|  UWORD16 pki;
  135|  7.03M|  WORD32 bp_start = bp;
  136|  7.03M|  WORD32 bp_stop = bp;
  137|  7.03M|  WORD32 stop = 0;
  138|  7.03M|  WORD32 sopt;
  139|  7.03M|  WORD32 a2, b2;
  140|  7.03M|  ia_bit_buf_struct it_bit_buff_temp;
  141|  7.03M|  memset(&it_bit_buff_temp, 0, sizeof(it_bit_buff_temp));
  142|  7.03M|  iusace_copy_bit_buf(&it_bit_buff_temp, pstr_it_bit_buff);
  143|       |
  144|  7.03M|  as.low = 0;
  145|  7.03M|  as.high = 65535;
  146|  7.03M|  as.value = 0;
  147|       |
  148|  7.03M|  sopt = ptr_c_prev[0] << 12;
  149|       |
  150|   617M|  for (i = 0; i < n; i++) {
  ------------------
  |  Branch (150:15): [True: 612M, False: 5.18M]
  ------------------
  151|   612M|    if ((use_stop == 1 || use_stop == 2) && (stop == 0)) {
  ------------------
  |  Branch (151:10): [True: 24.7M, False: 587M]
  |  Branch (151:27): [True: 383M, False: 204M]
  |  Branch (151:45): [True: 243M, False: 164M]
  ------------------
  152|   243M|      WORD32 j;
  153|       |
  154|   243M|      stop = 1;
  155|  7.87G|      for (j = i; j < n; j++) {
  ------------------
  |  Branch (155:19): [True: 7.87G, False: 4.51M]
  ------------------
  156|  7.87G|        if (quant[2 * j] != 0 || quant[2 * j + 1] != 0) {
  ------------------
  |  Branch (156:13): [True: 179M, False: 7.69G]
  |  Branch (156:34): [True: 59.0M, False: 7.63G]
  ------------------
  157|   238M|          stop = 0;
  158|   238M|          break;
  159|   238M|        }
  160|  7.87G|      }
  161|       |
  162|   243M|      if (stop) {
  ------------------
  |  Branch (162:11): [True: 4.51M, False: 238M]
  ------------------
  163|  4.51M|        s = iusace_arith_get_state(ptr_c_pres, ptr_c_prev, &sopt, i);
  164|  4.51M|        t = s & 0xFFFFF;
  165|       |
  166|  4.51M|        pki = iusace_arith_get_pk(t);
  167|       |
  168|  4.51M|        if (use_stop == 1) {
  ------------------
  |  Branch (168:13): [True: 1.84M, False: 2.66M]
  ------------------
  169|  1.84M|          bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, ARITH_ESCAPE, iusace_ari_cf_m[pki]);
  ------------------
  |  |   47|  1.84M|#define ARITH_ESCAPE (16)
  ------------------
  170|  1.84M|          pki = iusace_arith_get_pk(t + (1 << 17));
  171|  1.84M|          bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, 0, iusace_ari_cf_m[pki]);
  172|       |
  173|  1.84M|          break;
  174|  2.66M|        } else {
  175|  2.66M|          bp_stop = bp;
  176|  2.66M|          as_stop.low = as.low;
  177|  2.66M|          as_stop.high = as.high;
  178|  2.66M|          as_stop.value = as.value;
  179|       |
  180|  2.66M|          bp_stop =
  181|  2.66M|              iusace_arith_encode(NULL, bp_stop, &as_stop, ARITH_ESCAPE, iusace_ari_cf_m[pki]);
  ------------------
  |  |   47|  2.66M|#define ARITH_ESCAPE (16)
  ------------------
  182|       |
  183|  2.66M|          pki = iusace_arith_get_pk(t + (1 << 17));
  184|  2.66M|          bp_stop = iusace_arith_encode(NULL, bp_stop, &as_stop, (0), iusace_ari_cf_m[pki]);
  185|  2.66M|        }
  186|  4.51M|      }
  187|   243M|    }
  188|   610M|    s = iusace_arith_get_state(ptr_c_pres, ptr_c_prev, &sopt, i);
  189|   610M|    t = s & 0xFFFFF;
  190|       |
  191|   610M|    a = quant[2 * i];
  192|   610M|    b = quant[2 * i + 1];
  193|   610M|    a1 = abs(a);
  194|   610M|    b1 = abs(b);
  195|       |
  196|   610M|    ptr_c_pres[i] = a1 + b1 + 1;
  197|   610M|    if (ptr_c_pres[i] > 0xF) {
  ------------------
  |  Branch (197:9): [True: 44.2M, False: 566M]
  ------------------
  198|  44.2M|      ptr_c_pres[i] = 0xF;
  199|  44.2M|    }
  200|       |
  201|   610M|    lev = 0;
  202|   610M|    esc_nb = 0;
  203|       |
  204|   825M|    while ((a1) > 3 || (b1) > 3) {
  ------------------
  |  Branch (204:12): [True: 180M, False: 644M]
  |  Branch (204:24): [True: 33.5M, False: 610M]
  ------------------
  205|   214M|      pki = iusace_arith_get_pk(t + (esc_nb << 17));
  206|       |
  207|   214M|      bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, ARITH_ESCAPE, iusace_ari_cf_m[pki]);
  ------------------
  |  |   47|   214M|#define ARITH_ESCAPE (16)
  ------------------
  208|       |
  209|   214M|      qs[lev++] = (a1 & 1) | ((b1 & 1) << 1);
  210|   214M|      a1 >>= 1;
  211|   214M|      b1 >>= 1;
  212|   214M|      esc_nb++;
  213|       |
  214|   214M|      if (esc_nb > 7) {
  ------------------
  |  Branch (214:11): [True: 4.73M, False: 209M]
  ------------------
  215|  4.73M|        esc_nb = 7;
  216|  4.73M|      }
  217|   214M|    }
  218|   610M|    m = a1 + (b1 << 2);
  219|   610M|    pki = iusace_arith_get_pk(t + (esc_nb << 17));
  220|   610M|    bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, m, iusace_ari_cf_m[pki]);
  221|       |
  222|   610M|    a2 = a1;
  223|   610M|    b2 = b1;
  224|       |
  225|   825M|    for (l = lev - 1; l >= 0; l--) {
  ------------------
  |  Branch (225:23): [True: 214M, False: 610M]
  ------------------
  226|   214M|      WORD32 lsbidx = (a2 == 0) ? 1 : ((b2 == 0) ? 0 : 2);
  ------------------
  |  Branch (226:23): [True: 13.6M, False: 200M]
  |  Branch (226:40): [True: 30.9M, False: 169M]
  ------------------
  227|   214M|      bp = iusace_arith_encode(pstr_it_bit_buff, bp, &as, qs[l], iusace_ari_cf_r[lsbidx]);
  228|       |
  229|   214M|      a2 = (a2 << 1) | (qs[l] & 1);
  230|   214M|      b2 = (b2 << 1) | ((qs[l] >> 1) & 1);
  231|   214M|    }
  232|   610M|  }
  233|       |
  234|  7.03M|  if (use_stop == 2) {
  ------------------
  |  Branch (234:7): [True: 3.51M, False: 3.51M]
  ------------------
  235|  3.51M|    bp = iusace_arith_done(pstr_it_bit_buff, bp, &as);
  236|  3.51M|    if (stop) {
  ------------------
  |  Branch (236:9): [True: 2.66M, False: 849k]
  ------------------
  237|  2.66M|      bp_stop = iusace_arith_done(NULL, bp_stop, &as_stop);
  238|       |
  239|  2.66M|      if (bp_stop < bp) {
  ------------------
  |  Branch (239:11): [True: 1.84M, False: 819k]
  ------------------
  240|  1.84M|        iusace_copy_bit_buf(pstr_it_bit_buff, &it_bit_buff_temp);
  241|  1.84M|        bp = iusace_arith_encode_level2(pstr_it_bit_buff, bp_start, ptr_c_pres, ptr_c_prev, quant,
  242|  1.84M|                                        n, nt, 1);
  243|  1.84M|      } else {
  244|   819k|        iusace_copy_bit_buf(pstr_it_bit_buff, &it_bit_buff_temp);
  245|   819k|        bp = iusace_arith_encode_level2(pstr_it_bit_buff, bp_start, ptr_c_pres, ptr_c_prev, quant,
  246|   819k|                                        n, nt, 0);
  247|   819k|      }
  248|  2.66M|    } else {
  249|   849k|      iusace_copy_bit_buf(pstr_it_bit_buff, &it_bit_buff_temp);
  250|   849k|      bp = iusace_arith_encode_level2(pstr_it_bit_buff, bp_start, ptr_c_pres, ptr_c_prev, quant,
  251|   849k|                                      n, nt, 0);
  252|   849k|    }
  253|  3.51M|  } else {
  254|  3.51M|    bp = iusace_arith_done(pstr_it_bit_buff, bp, &as);
  255|       |
  256|   233M|    for (; i < nt; i++) {
  ------------------
  |  Branch (256:12): [True: 230M, False: 3.51M]
  ------------------
  257|   230M|      ptr_c_pres[i] = 1;
  258|   230M|    }
  259|       |
  260|   387M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (260:17): [True: 383M, False: 3.51M]
  ------------------
  261|   383M|      if (quant[2 * i] != 0) {
  ------------------
  |  Branch (261:11): [True: 119M, False: 264M]
  ------------------
  262|   119M|        if (quant[2 * i] > 0) {
  ------------------
  |  Branch (262:13): [True: 59.9M, False: 59.4M]
  ------------------
  263|  59.9M|          iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  264|  59.9M|          bp++;
  265|  59.9M|        } else {
  266|  59.4M|          iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  267|  59.4M|          bp++;
  268|  59.4M|        }
  269|   119M|      }
  270|       |
  271|   383M|      if (quant[2 * i + 1] != 0) {
  ------------------
  |  Branch (271:11): [True: 118M, False: 265M]
  ------------------
  272|   118M|        if (quant[2 * i + 1] > 0) {
  ------------------
  |  Branch (272:13): [True: 59.3M, False: 59.2M]
  ------------------
  273|  59.3M|          iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  274|  59.3M|          bp++;
  275|  59.3M|        } else {
  276|  59.2M|          iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  277|  59.2M|          bp++;
  278|  59.2M|        }
  279|   118M|      }
  280|   383M|    }
  281|       |
  282|   460M|    for (i = 0; i < nt; i++) {
  ------------------
  |  Branch (282:17): [True: 457M, False: 3.51M]
  ------------------
  283|   457M|      ptr_c_prev[i] = ptr_c_pres[i];
  284|   457M|      ptr_c_pres[i] = 1;
  285|   457M|    }
  286|  3.51M|  }
  287|       |
  288|  7.03M|  return bp;
  289|  7.03M|}
iusace_arith_enc.c:iusace_copy_bit_buf:
  117|  10.5M|                                ia_bit_buf_struct *it_bit_buff_src) {
  118|  10.5M|  if (it_bit_buff_src != NULL && it_bit_buff_dest != NULL) {
  ------------------
  |  Branch (118:7): [True: 6.50M, False: 4.04M]
  |  Branch (118:34): [True: 4.48M, False: 2.02M]
  ------------------
  119|  4.48M|    it_bit_buff_dest->cnt_bits = it_bit_buff_src->cnt_bits;
  120|  4.48M|    it_bit_buff_dest->ptr_write_next = it_bit_buff_src->ptr_write_next;
  121|  4.48M|    it_bit_buff_dest->write_position = it_bit_buff_src->write_position;
  122|  4.48M|  }
  123|  10.5M|  return;
  124|  10.5M|}
iusace_arith_enc.c:iusace_arith_get_state:
   78|   615M|static WORD32 iusace_arith_get_state(WORD32 *c_pres, WORD32 *c_prev, WORD32 *s, WORD32 idx) {
   79|   615M|  WORD32 s_tmp = *s;
   80|       |
   81|   615M|  s_tmp = s_tmp >> 4;
   82|   615M|  s_tmp = s_tmp + (c_prev[idx + 1] << 12);
   83|   615M|  s_tmp = (s_tmp & 0xFFF0) + c_pres[idx - 1];
   84|       |
   85|   615M|  *s = s_tmp;
   86|       |
   87|   615M|  if (idx > 3) {
  ------------------
  |  Branch (87:7): [True: 589M, False: 25.9M]
  ------------------
   88|   589M|    if ((c_pres[idx - 1] + c_pres[idx - 2] + c_pres[idx - 3]) < 5) {
  ------------------
  |  Branch (88:9): [True: 322M, False: 266M]
  ------------------
   89|   322M|      return (s_tmp + 0x10000);
   90|   322M|    }
   91|   589M|  }
   92|       |
   93|   292M|  return (s_tmp);
   94|   615M|}
iusace_arith_enc.c:iusace_arith_get_pk:
   96|   834M|static UWORD16 iusace_arith_get_pk(WORD32 c) {
   97|   834M|  WORD32 j;
   98|   834M|  WORD32 i, i_min, i_max;
   99|       |
  100|   834M|  i_min = -1;
  101|   834M|  i_max = (sizeof(iusace_ari_lookup_m) / sizeof(iusace_ari_lookup_m[0])) - 1;
  102|  8.26G|  while ((i_max - i_min) > 1) {
  ------------------
  |  Branch (102:10): [True: 7.76G, False: 506M]
  ------------------
  103|  7.76G|    i = i_min + ((i_max - i_min) / 2);
  104|  7.76G|    j = iusace_ari_hash_m[i];
  105|  7.76G|    if (c < j)
  ------------------
  |  Branch (105:9): [True: 3.39G, False: 4.36G]
  ------------------
  106|  3.39G|      i_max = i;
  107|  4.36G|    else if (c > j)
  ------------------
  |  Branch (107:14): [True: 4.03G, False: 327M]
  ------------------
  108|  4.03G|      i_min = i;
  109|   327M|    else
  110|   327M|      return (iusace_ari_hash_m_lsb[i]);
  111|  7.76G|  }
  112|       |
  113|   506M|  return (iusace_ari_lookup_m[i_max]);
  114|   834M|}

iusace_find_nearest_neighbor:
  177|  29.7M|VOID iusace_find_nearest_neighbor(FLOAT32 *bk, WORD32 *ck) {
  178|  29.7M|  WORD32 i, y1[8], y2[8];
  179|  29.7M|  FLOAT32 e1k, e2k, x1[8], tmp;
  180|       |
  181|  29.7M|  iusace_nearest_neighbor_2d(bk, y1);
  182|       |
  183|   268M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (183:15): [True: 238M, False: 29.7M]
  ------------------
  184|   238M|    x1[i] = bk[i] - 1.0f;
  185|   238M|  }
  186|  29.7M|  iusace_nearest_neighbor_2d(x1, y2);
  187|   268M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (187:15): [True: 238M, False: 29.7M]
  ------------------
  188|   238M|    y2[i] += 1;
  189|   238M|  }
  190|       |  /* Compute e1k = (Bk - y1k)^2 and e2k = (Bk – y2k)^2 */
  191|  29.7M|  e1k = e2k = 0.0;
  192|   268M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (192:15): [True: 238M, False: 29.7M]
  ------------------
  193|   238M|    tmp = bk[i] - y1[i];
  194|   238M|    e1k += tmp * tmp;
  195|   238M|    tmp = bk[i] - y2[i];
  196|   238M|    e2k += tmp * tmp;
  197|   238M|  }
  198|       |
  199|       |  /* Select best lattice point */
  200|  29.7M|  if (e1k < e2k) {
  ------------------
  |  Branch (200:7): [True: 21.5M, False: 8.24M]
  ------------------
  201|   193M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (201:17): [True: 172M, False: 21.5M]
  ------------------
  202|   172M|      ck[i] = y1[i];
  203|   172M|    }
  204|  21.5M|  } else {
  205|  74.2M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (205:17): [True: 65.9M, False: 8.24M]
  ------------------
  206|  65.9M|      ck[i] = y2[i];
  207|  65.9M|    }
  208|  8.24M|  }
  209|  29.7M|  return;
  210|  29.7M|}
iusace_apply_voronoi_ext:
  248|  3.43M|VOID iusace_apply_voronoi_ext(WORD32 *x, WORD32 *n, WORD32 *idx, WORD32 *k) {
  249|  3.43M|  WORD32 ka, c[8];
  250|  3.43M|  WORD32 i, r, m, v[8], c_tmp[8], k_mod[8], k_tmp[8], iter, ka_tmp, n_tmp, mask;
  251|  3.43M|  FLOAT32 sphere;
  252|  3.43M|  ka = iusace_find_absolute_leader(x);
  253|  3.43M|  *n = iusace_da_nq[ka];
  254|  3.43M|  if (*n <= 4) {
  ------------------
  |  Branch (254:7): [True: 2.34M, False: 1.09M]
  ------------------
  255|  21.1M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (255:17): [True: 18.7M, False: 2.34M]
  ------------------
  256|  18.7M|      c[i] = x[i];
  257|  18.7M|    }
  258|  2.34M|  } else {
  259|  1.09M|    sphere = 0.0;
  260|  9.83M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (260:17): [True: 8.73M, False: 1.09M]
  ------------------
  261|  8.73M|      sphere += (FLOAT32)x[i] * (FLOAT32)x[i];
  262|  8.73M|    }
  263|  1.09M|    sphere *= 0.125;
  264|  1.09M|    r = 1;
  265|  1.09M|    sphere *= 0.25;
  266|  1.42M|    while (sphere > 11.0) {
  ------------------
  |  Branch (266:12): [True: 331k, False: 1.09M]
  ------------------
  267|   331k|      r++;
  268|   331k|      sphere *= 0.25;
  269|   331k|    }
  270|  1.09M|    iusace_compute_coord(x, k_mod);
  271|  1.09M|    m = 1 << r;
  272|  1.09M|    mask = m - 1;
  273|  3.27M|    for (iter = 0; iter < 2; iter++) {
  ------------------
  |  Branch (273:20): [True: 2.18M, False: 1.09M]
  ------------------
  274|  19.6M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (274:19): [True: 17.4M, False: 2.18M]
  ------------------
  275|  17.4M|        k_tmp[i] = k_mod[i] & mask;
  276|  17.4M|      }
  277|  2.18M|      iusace_vononoi_idx(k_tmp, m, v);
  278|  19.6M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (278:19): [True: 17.4M, False: 2.18M]
  ------------------
  279|  17.4M|        c_tmp[i] = (x[i] - v[i]) / m;
  280|  17.4M|      }
  281|  2.18M|      ka_tmp = iusace_find_absolute_leader(c_tmp);
  282|  2.18M|      n_tmp = iusace_da_nq[ka_tmp];
  283|  2.18M|      if (n_tmp > 4) {
  ------------------
  |  Branch (283:11): [True: 1.08M, False: 1.09M]
  ------------------
  284|  1.08M|        r++;
  285|  1.08M|        m = m << 1;
  286|  1.08M|        mask = ((mask << 1) + 1);
  287|  1.09M|      } else {
  288|  1.09M|        if (n_tmp < 3) {
  ------------------
  |  Branch (288:13): [True: 84.7k, False: 1.01M]
  ------------------
  289|  84.7k|          n_tmp = 3;
  290|  84.7k|        }
  291|  1.09M|        ka = ka_tmp;
  292|  1.09M|        *n = n_tmp + 2 * r;
  293|  9.87M|        for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (293:21): [True: 8.77M, False: 1.09M]
  ------------------
  294|  8.77M|          k[i] = k_tmp[i];
  295|  8.77M|        }
  296|  9.87M|        for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (296:21): [True: 8.77M, False: 1.09M]
  ------------------
  297|  8.77M|          c[i] = c_tmp[i];
  298|  8.77M|        }
  299|  1.09M|        r--;
  300|  1.09M|        m = m >> 1;
  301|  1.09M|        mask = mask >> 1;
  302|  1.09M|      }
  303|  2.18M|    }
  304|  1.09M|  }
  305|       |
  306|  3.43M|  if (*n > 0) {
  ------------------
  |  Branch (306:7): [True: 2.58M, False: 853k]
  ------------------
  307|  2.58M|    iusace_gosset_compute_base_idx(c, ka, idx);
  308|  2.58M|  }
  309|  3.43M|  return;
  310|  3.43M|}
iusace_alg_vec_quant:
  312|   994k|VOID iusace_alg_vec_quant(FLOAT32 *ptr_input, WORD32 *ptr_out, WORD32 *ptr_lpc_idx) {
  313|   994k|  WORD32 i, l, nq, pos, c[8], kv[8];
  314|   994k|  FLOAT32 x1[8];
  315|   994k|  WORD32 lpc_index;
  316|       |
  317|   994k|  pos = 2;
  318|  2.98M|  for (l = 0; l < 2; l++) {
  ------------------
  |  Branch (318:15): [True: 1.98M, False: 994k]
  ------------------
  319|  17.9M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (319:17): [True: 15.9M, False: 1.98M]
  ------------------
  320|  15.9M|      x1[i] = ptr_input[l * 8 + i];
  321|  15.9M|      kv[i] = 0;
  322|  15.9M|    }
  323|       |
  324|  1.98M|    iusace_find_nearest_neighbor(x1, c);
  325|       |
  326|  1.98M|    iusace_apply_voronoi_ext(c, &nq, &lpc_index, kv);
  327|       |
  328|  17.9M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (328:17): [True: 15.9M, False: 1.98M]
  ------------------
  329|  15.9M|      ptr_out[l * 8 + i] = c[i];
  330|  15.9M|    }
  331|       |
  332|  1.98M|    ptr_lpc_idx[l] = nq;
  333|       |
  334|  1.98M|    if (nq > 0) {
  ------------------
  |  Branch (334:9): [True: 1.81M, False: 178k]
  ------------------
  335|  1.81M|      ptr_lpc_idx[pos++] = lpc_index;
  336|  16.2M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (336:19): [True: 14.4M, False: 1.81M]
  ------------------
  337|  14.4M|        ptr_lpc_idx[pos++] = kv[i];
  338|  14.4M|      }
  339|  1.81M|    }
  340|  1.98M|  }
  341|       |
  342|   994k|  return;
  343|   994k|}
iusace_avq_enc.c:iusace_nearest_neighbor_2d:
  143|  59.5M|static VOID iusace_nearest_neighbor_2d(FLOAT32 *x, WORD32 *y) {
  144|  59.5M|  WORD32 i, j;
  145|  59.5M|  WORD64 sum;
  146|  59.5M|  FLOAT32 diff[8], em;
  147|  59.5M|  sum = 0;
  148|   536M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (148:15): [True: 476M, False: 59.5M]
  ------------------
  149|   476M|    if (x[i] < 0) {
  ------------------
  |  Branch (149:9): [True: 313M, False: 162M]
  ------------------
  150|   313M|      y[i] = -2 * (((WORD32)(1.0 - x[i])) >> 1);
  151|   313M|    } else {
  152|   162M|      y[i] = 2 * (((WORD32)(1.0 + x[i])) >> 1);
  153|   162M|    }
  154|   476M|    sum += y[i];
  155|   476M|  }
  156|  59.5M|  if (sum % 4) {
  ------------------
  |  Branch (156:7): [True: 20.1M, False: 39.3M]
  ------------------
  157|  20.1M|    FLOAT32 s;
  158|  20.1M|    em = 0;
  159|  20.1M|    j = 0;
  160|   181M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (160:17): [True: 161M, False: 20.1M]
  ------------------
  161|   161M|      diff[i] = x[i] - y[i];
  162|   161M|      s = (FLOAT32)fabs(diff[i]);
  163|   161M|      if (em < s) {
  ------------------
  |  Branch (163:11): [True: 50.3M, False: 111M]
  ------------------
  164|  50.3M|        em = s;
  165|  50.3M|        j = i;
  166|  50.3M|      }
  167|   161M|    }
  168|  20.1M|    if (diff[j] < 0) {
  ------------------
  |  Branch (168:9): [True: 9.56M, False: 10.6M]
  ------------------
  169|  9.56M|      y[j] -= 2;
  170|  10.6M|    } else {
  171|  10.6M|      y[j] += 2;
  172|  10.6M|    }
  173|  20.1M|  }
  174|  59.5M|  return;
  175|  59.5M|}
iusace_avq_enc.c:iusace_find_absolute_leader:
  108|  5.62M|static WORD32 iusace_find_absolute_leader(WORD32 *y) {
  109|  5.62M|  WORD32 i, nb, pos, ka;
  110|  5.62M|  WORD64 s, C[8], id;
  111|  50.5M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (111:15): [True: 44.9M, False: 5.62M]
  ------------------
  112|  44.9M|    C[i] = (WORD64)y[i] * y[i];
  113|  44.9M|  }
  114|  5.62M|  s = 0;
  115|  50.5M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (115:15): [True: 44.9M, False: 5.62M]
  ------------------
  116|  44.9M|    s += C[i];
  117|  44.9M|  }
  118|  5.62M|  s >>= 3;
  119|  5.62M|  ka = LEN_ABS_LEADER + 1;
  ------------------
  |  |   23|  5.62M|#define LEN_ABS_LEADER 37
  ------------------
  120|  5.62M|  if (s == 0) {
  ------------------
  |  Branch (120:7): [True: 853k, False: 4.76M]
  ------------------
  121|   853k|    ka = LEN_ABS_LEADER;
  ------------------
  |  |   23|   853k|#define LEN_ABS_LEADER 37
  ------------------
  122|  4.76M|  } else {
  123|  4.76M|    if (s <= NB_SPHERE) {
  ------------------
  |  |   22|  4.76M|#define NB_SPHERE 32
  ------------------
  |  Branch (123:9): [True: 4.48M, False: 282k]
  ------------------
  124|  4.48M|      id = 0;
  125|  40.3M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (125:19): [True: 35.8M, False: 4.48M]
  ------------------
  126|  35.8M|        id += C[i] * C[i];
  127|  35.8M|      }
  128|  4.48M|      id = id >> 3;
  129|  4.48M|      nb = iusace_da_num_bits[s - 1];
  130|  4.48M|      pos = iusace_da_pos[s - 1];
  131|  8.46M|      for (i = 0; i < nb; i++) {
  ------------------
  |  Branch (131:19): [True: 6.57M, False: 1.89M]
  ------------------
  132|  6.57M|        if (id == (long)iusace_da_id[pos]) {
  ------------------
  |  Branch (132:13): [True: 2.58M, False: 3.98M]
  ------------------
  133|  2.58M|          ka = pos;
  134|  2.58M|          break;
  135|  2.58M|        }
  136|  3.98M|        pos++;
  137|  3.98M|      }
  138|  4.48M|    }
  139|  4.76M|  }
  140|  5.62M|  return (ka);
  141|  5.62M|}
iusace_avq_enc.c:iusace_compute_coord:
  236|  1.09M|static VOID iusace_compute_coord(WORD32 *y, WORD32 *k) {
  237|  1.09M|  WORD32 i, tmp, sum;
  238|  1.09M|  k[7] = y[7];
  239|  1.09M|  tmp = y[7];
  240|  1.09M|  sum = 5 * y[7];
  241|  7.64M|  for (i = 6; i >= 1; i--) {
  ------------------
  |  Branch (241:15): [True: 6.55M, False: 1.09M]
  ------------------
  242|  6.55M|    k[i] = (y[i] - tmp) >> 1;
  243|  6.55M|    sum -= y[i];
  244|  6.55M|  }
  245|  1.09M|  k[0] = (y[0] + sum) >> 2;
  246|  1.09M|}
iusace_avq_enc.c:iusace_vononoi_idx:
  212|  2.18M|static VOID iusace_vononoi_idx(WORD32 *kv, WORD32 m, WORD32 *y) {
  213|  2.18M|  WORD32 i, v[8], tmp, sum, *ptr1, *ptr2;
  214|  2.18M|  FLOAT32 z[8];
  215|  19.6M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (215:15): [True: 17.4M, False: 2.18M]
  ------------------
  216|  17.4M|    y[i] = kv[7];
  217|  17.4M|  }
  218|  2.18M|  z[7] = (FLOAT32)y[7] / m;
  219|  2.18M|  sum = 0;
  220|  15.2M|  for (i = 6; i >= 1; i--) {
  ------------------
  |  Branch (220:15): [True: 13.1M, False: 2.18M]
  ------------------
  221|  13.1M|    tmp = kv[i] << 1;
  222|  13.1M|    sum += tmp;
  223|  13.1M|    y[i] += tmp;
  224|  13.1M|    z[i] = (FLOAT32)y[i] / m;
  225|  13.1M|  }
  226|  2.18M|  y[0] += (4 * kv[0] + sum);
  227|  2.18M|  z[0] = (FLOAT32)(y[0] - 2) / m;
  228|  2.18M|  iusace_find_nearest_neighbor(z, v);
  229|  2.18M|  ptr1 = y;
  230|  2.18M|  ptr2 = v;
  231|  19.6M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (231:15): [True: 17.4M, False: 2.18M]
  ------------------
  232|  17.4M|    *ptr1++ -= m * *ptr2++;
  233|  17.4M|  }
  234|  2.18M|}
iusace_avq_enc.c:iusace_gosset_compute_base_idx:
   90|  2.58M|static VOID iusace_gosset_compute_base_idx(WORD32 *x, WORD32 ka, WORD32 *idx) {
   91|  2.58M|  WORD32 rank, offset, code, i, ks;
   92|  2.58M|  iusace_gosset_compute_rank_and_sign(x, &rank, &code);
   93|  2.58M|  ks = -1;
   94|  10.0M|  for (i = iusace_iso_code_index_table[ka]; i < LEN_SIGN_LEADER; i++) {
  ------------------
  |  |   24|  10.0M|#define LEN_SIGN_LEADER 226
  ------------------
  |  Branch (94:45): [True: 10.0M, False: 0]
  ------------------
   95|  10.0M|    if (code == iusace_iso_code_data_table[i]) {
  ------------------
  |  Branch (95:9): [True: 2.58M, False: 7.45M]
  ------------------
   96|  2.58M|      ks = i;
   97|  2.58M|      break;
   98|  2.58M|    }
   99|  10.0M|  }
  100|  2.58M|  if (ks == -1) {
  ------------------
  |  Branch (100:7): [True: 0, False: 2.58M]
  ------------------
  101|      0|    ks = 0;
  102|      0|  }
  103|  2.58M|  offset = iusace_signed_leader_is[ks];
  104|  2.58M|  *idx = offset + rank;
  105|  2.58M|  return;
  106|  2.58M|}
iusace_avq_enc.c:iusace_gosset_compute_rank_and_sign:
   26|  2.58M|static VOID iusace_gosset_compute_rank_and_sign(WORD32 *x, WORD32 *rank, WORD32 *sign_code) {
   27|  2.58M|  WORD32 xs[8], a[8], q, d[8], w[8], A, B, idx, tmp, abs_i, abs_j;
   28|  2.58M|  WORD32 i, j, k;
   29|  23.2M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (29:15): [True: 20.6M, False: 2.58M]
  ------------------
   30|  20.6M|    xs[i] = x[i];
   31|  20.6M|  }
   32|  20.6M|  for (k = 0; k < 7; k++) {
  ------------------
  |  Branch (32:15): [True: 18.0M, False: 2.58M]
  ------------------
   33|  18.0M|    j = k;
   34|  90.4M|    for (i = k + 1; i < 8; i++) {
  ------------------
  |  Branch (34:21): [True: 72.3M, False: 18.0M]
  ------------------
   35|  72.3M|      abs_j = abs(xs[j]);
   36|  72.3M|      abs_i = abs(xs[i]);
   37|  72.3M|      if (abs_i >= abs_j) {
  ------------------
  |  Branch (37:11): [True: 54.9M, False: 17.4M]
  ------------------
   38|  54.9M|        if (abs_i > xs[j]) {
  ------------------
  |  Branch (38:13): [True: 19.6M, False: 35.2M]
  ------------------
   39|  19.6M|          j = i;
   40|  19.6M|        }
   41|  54.9M|      }
   42|  72.3M|    }
   43|  18.0M|    if (j > k) {
  ------------------
  |  Branch (43:9): [True: 10.1M, False: 7.89M]
  ------------------
   44|  10.1M|      tmp = xs[k];
   45|  10.1M|      xs[k] = xs[j];
   46|  10.1M|      xs[j] = tmp;
   47|  10.1M|    }
   48|  18.0M|  }
   49|  2.58M|  *sign_code = 0;
   50|  23.2M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (50:15): [True: 20.6M, False: 2.58M]
  ------------------
   51|  20.6M|    if (xs[i] < 0) {
  ------------------
  |  Branch (51:9): [True: 6.73M, False: 13.9M]
  ------------------
   52|  6.73M|      *sign_code += iusace_pow2_table[i];
   53|  6.73M|    }
   54|  20.6M|  }
   55|  2.58M|  a[0] = xs[0];
   56|  2.58M|  q = 1;
   57|  20.6M|  for (i = 1; i < 8; i++) {
  ------------------
  |  Branch (57:15): [True: 18.0M, False: 2.58M]
  ------------------
   58|  18.0M|    if (xs[i] != xs[i - 1]) {
  ------------------
  |  Branch (58:9): [True: 4.24M, False: 13.8M]
  ------------------
   59|  4.24M|      a[q] = xs[i];
   60|  4.24M|      q++;
   61|  4.24M|    }
   62|  18.0M|  }
   63|  23.2M|  for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (63:15): [True: 20.6M, False: 2.58M]
  ------------------
   64|  41.5M|    for (j = 0; j < q; j++) {
  ------------------
  |  Branch (64:17): [True: 41.5M, False: 0]
  ------------------
   65|  41.5M|      if (x[i] == a[j]) {
  ------------------
  |  Branch (65:11): [True: 20.6M, False: 20.9M]
  ------------------
   66|  20.6M|        d[i] = j;
   67|  20.6M|        break;
   68|  20.6M|      }
   69|  41.5M|    }
   70|  20.6M|  }
   71|  2.58M|  *rank = 0;
   72|  9.41M|  for (j = 0; j < q; j++) {
  ------------------
  |  Branch (72:15): [True: 6.83M, False: 2.58M]
  ------------------
   73|  6.83M|    w[j] = 0;
   74|  6.83M|  }
   75|  2.58M|  B = 1;
   76|  23.2M|  for (i = 7; i >= 0; i--) {
  ------------------
  |  Branch (76:15): [True: 20.6M, False: 2.58M]
  ------------------
   77|  20.6M|    idx = d[i];
   78|  20.6M|    w[idx]++;
   79|  20.6M|    B *= w[idx];
   80|  20.6M|    A = 0;
   81|  41.5M|    for (j = 0; j < idx; j++) {
  ------------------
  |  Branch (81:17): [True: 20.9M, False: 20.6M]
  ------------------
   82|  20.9M|      A += w[j];
   83|  20.9M|    }
   84|  20.6M|    if (A > 0) {
  ------------------
  |  Branch (84:9): [True: 7.99M, False: 12.6M]
  ------------------
   85|  7.99M|      *rank += A * iusace_factorial_table[i] / B;
   86|  7.99M|    }
   87|  20.6M|  }
   88|  2.58M|}

iusace_fft.c:ixheaace_dmult:
   23|  11.4G|static FLOAT64 ixheaace_dmult(FLOAT64 a, FLOAT64 b) { return (a * b); }
iusace_fft.c:ixheaace_dmac:
   25|  2.49G|static FLOAT64 ixheaace_dmac(FLOAT64 a, FLOAT64 b, FLOAT64 c) { return (a + b * c); }
ixheaace_fft.c:ixheaace_dmult:
   23|  2.51G|static FLOAT64 ixheaace_dmult(FLOAT64 a, FLOAT64 b) { return (a * b); }
ixheaace_fft.c:ixheaace_dmac:
   25|   502M|static FLOAT64 ixheaace_dmac(FLOAT64 a, FLOAT64 b, FLOAT64 c) { return (a + b * c); }
ixheaace_sbr_hbe_fft_ifft_32x32.c:ixheaace_dmult:
   23|   202M|static FLOAT64 ixheaace_dmult(FLOAT64 a, FLOAT64 b) { return (a * b); }
ixheaace_sbr_hbe_fft_ifft_32x32.c:ixheaace_dmac:
   25|  46.3M|static FLOAT64 ixheaace_dmac(FLOAT64 a, FLOAT64 b, FLOAT64 c) { return (a + b * c); }

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

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

iusace_encode_fac_params:
  300|   135k|                              ia_bit_buf_struct *pstr_it_bit_buff, WORD32 ch_idx) {
  301|   135k|  WORD32 *total_nbbits = &usac_data->total_nbbits[ch_idx];
  302|   135k|  ia_usac_td_encoder_struct *pstr_td = usac_data->td_encoder[ch_idx];
  303|   135k|  WORD32 codec_mode = pstr_td->acelp_core_mode;
  304|   135k|  WORD16 *bit_buf = usac_data->td_serial_out[ch_idx];
  305|   135k|  WORD32 is_bass_post_filter = 1;
  306|   135k|  WORD32 first_lpd_flag = (usac_data->core_mode_prev[ch_idx] == CORE_MODE_FD);
  ------------------
  |  |   33|   135k|#define CORE_MODE_FD (0)
  ------------------
  307|   135k|  WORD32 *param_lpc = usac_data->param_buf + (NUM_FRAMES * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |   75|   135k|#define NUM_FRAMES (4)
  ------------------
                WORD32 *param_lpc = usac_data->param_buf + (NUM_FRAMES * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   135k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   135k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   135k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   135k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|   135k|  WORD32 *param = usac_data->param_buf;
  309|   135k|  WORD32 j, k, n, sfr, lpd_mode, num_bits, sq_bits, *prm;
  310|   135k|  WORD16 first_tcx_flag = 1;
  311|   135k|  WORD32 nbits_fac, nb_bits_lpc;
  312|   135k|  WORD32 core_mode_last = (first_lpd_flag) ? 0 : 1;
  ------------------
  |  Branch (312:27): [True: 3.97k, False: 131k]
  ------------------
  313|   135k|  WORD32 fac_data_present;
  314|   135k|  WORD32 num_frames = NUM_FRAMES;
  ------------------
  |  |   75|   135k|#define NUM_FRAMES (4)
  ------------------
  315|   135k|  WORD16 *ptr_bit_buf = bit_buf;
  316|       |
  317|   135k|  pstr_td->num_bits_per_supfrm = 0;
  318|   135k|  *total_nbbits = 0;
  319|       |
  320|   135k|  iusace_write_bits_buf(pstr_it_bit_buff, pstr_td->acelp_core_mode, 3);
  321|       |
  322|   135k|  if (mod[0] == 3) {
  ------------------
  |  Branch (322:7): [True: 32.8k, False: 102k]
  ------------------
  323|  32.8k|    lpd_mode = 25;
  324|   102k|  } else if ((mod[0] == 2) && (mod[2] == 2)) {
  ------------------
  |  Branch (324:14): [True: 15.0k, False: 87.2k]
  |  Branch (324:31): [True: 9.24k, False: 5.82k]
  ------------------
  325|  9.24k|    lpd_mode = 24;
  326|  93.0k|  } else {
  327|  93.0k|    if (mod[0] == 2) {
  ------------------
  |  Branch (327:9): [True: 5.82k, False: 87.2k]
  ------------------
  328|  5.82k|      lpd_mode = 16 + mod[2] + 2 * mod[3];
  329|  87.2k|    } else if (mod[2] == 2) {
  ------------------
  |  Branch (329:16): [True: 6.41k, False: 80.7k]
  ------------------
  330|  6.41k|      lpd_mode = 20 + mod[0] + 2 * mod[1];
  331|  80.7k|    } else {
  332|  80.7k|      lpd_mode = mod[0] + 2 * mod[1] + 4 * mod[2] + 8 * mod[3];
  333|  80.7k|    }
  334|  93.0k|  }
  335|   135k|  iusace_write_bits_buf(pstr_it_bit_buff, lpd_mode, 5);
  336|   135k|  pstr_td->num_bits_per_supfrm = 5;
  337|   135k|  *total_nbbits += 5;
  338|       |
  339|   135k|  iusace_write_bits_buf(pstr_it_bit_buff, is_bass_post_filter, 1);
  340|   135k|  *total_nbbits += 1;
  341|       |
  342|   135k|  iusace_write_bits_buf(pstr_it_bit_buff, core_mode_last, 1);
  343|   135k|  *total_nbbits += 1;
  344|       |
  345|   135k|  if (((mod[0] == 0) && (mod[-1] != 0)) || ((mod[0] > 0) && (mod[-1] == 0))) {
  ------------------
  |  Branch (345:8): [True: 51.3k, False: 83.7k]
  |  Branch (345:25): [True: 12.0k, False: 39.2k]
  |  Branch (345:45): [True: 83.7k, False: 39.2k]
  |  Branch (345:61): [True: 9.73k, False: 74.0k]
  ------------------
  346|  21.8k|    fac_data_present = 1;
  347|   113k|  } else {
  348|   113k|    fac_data_present = 0;
  349|   113k|  }
  350|       |
  351|   135k|  iusace_write_bits_buf(pstr_it_bit_buff, fac_data_present, 1);
  352|   135k|  *total_nbbits += 1;
  353|       |
  354|   135k|  num_bits = (iusace_acelp_core_numbits_1024[codec_mode] / 4) - 2;
  355|       |
  356|   135k|  k = 0;
  357|   546k|  while (k < num_frames) {
  ------------------
  |  Branch (357:10): [True: 411k, False: 135k]
  ------------------
  358|   411k|    lpd_mode = mod[k];
  359|   411k|    prm = param + (k * MAX_NUM_TCX_PRM_PER_DIV);
  ------------------
  |  |  152|   411k|#define MAX_NUM_TCX_PRM_PER_DIV (NUM_TCX20_PRM)
  |  |  ------------------
  |  |  |  |  149|   411k|#define NUM_TCX20_PRM (FAC_LENGTH + 2 + (320 + 320 / 8))
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|   411k|#define FAC_LENGTH (LEN_FRAME / 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|   411k|#define LEN_FRAME (256)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|   411k|    j = 0;
  361|       |
  362|   411k|    if (((mod[k - 1] == 0) && (mod[k] > 0)) || ((mod[k - 1] > 0) && (mod[k] == 0))) {
  ------------------
  |  Branch (362:10): [True: 221k, False: 189k]
  |  Branch (362:31): [True: 45.7k, False: 176k]
  |  Branch (362:49): [True: 185k, False: 180k]
  |  Branch (362:69): [True: 44.9k, False: 140k]
  ------------------
  363|  90.6k|      nbits_fac = iusace_fd_encode_fac(&prm[j], ptr_bit_buf, (pstr_td->len_subfrm) / 2);
  364|  90.6k|      j += (pstr_td->len_subfrm) / 2;
  365|  90.6k|      *total_nbbits += nbits_fac;
  366|  15.2M|      for (WORD32 i = 0; i < nbits_fac; i++) {
  ------------------
  |  Branch (366:26): [True: 15.1M, False: 90.6k]
  ------------------
  367|  15.1M|        iusace_write_bits_buf(pstr_it_bit_buff, ptr_bit_buf[i], 1);
  368|  15.1M|      }
  369|  90.6k|    }
  370|       |
  371|   411k|    if (lpd_mode == 0) {
  ------------------
  |  Branch (371:9): [True: 224k, False: 186k]
  ------------------
  372|   224k|      iusace_write_bits_buf(pstr_it_bit_buff, prm[j++], 2);
  373|       |
  374|  1.05M|      for (sfr = 0; sfr < (pstr_td->num_subfrm); sfr++) {
  ------------------
  |  Branch (374:21): [True: 835k, False: 224k]
  ------------------
  375|   835k|        n = 6;
  376|   835k|        if ((sfr == 0) || (((pstr_td->len_subfrm) == 256) && (sfr == 2))) n = 9;
  ------------------
  |  Branch (376:13): [True: 224k, False: 611k]
  |  Branch (376:28): [True: 488k, False: 122k]
  |  Branch (376:62): [True: 162k, False: 325k]
  ------------------
  377|   835k|        iusace_write_bits_buf(pstr_it_bit_buff, prm[j], (UWORD8)n);
  378|   835k|        j++;
  379|   835k|        iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 1);
  380|   835k|        j++;
  381|   835k|        if (codec_mode == ACELP_CORE_MODE_9k6) {
  ------------------
  |  |  123|   835k|#define ACELP_CORE_MODE_9k6 (0)
  ------------------
  |  Branch (381:13): [True: 0, False: 835k]
  ------------------
  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|   835k|        } else if (codec_mode == ACELP_CORE_MODE_11k2) {
  ------------------
  |  |  124|   835k|#define ACELP_CORE_MODE_11k2 (1)
  ------------------
  |  Branch (390:20): [True: 0, False: 835k]
  ------------------
  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|   835k|        } else if (codec_mode == ACELP_CORE_MODE_12k8) {
  ------------------
  |  |  125|   835k|#define ACELP_CORE_MODE_12k8 (2)
  ------------------
  |  Branch (399:20): [True: 48.1k, False: 787k]
  ------------------
  400|  48.1k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  401|  48.1k|          j++;
  402|  48.1k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  403|  48.1k|          j++;
  404|  48.1k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  405|  48.1k|          j++;
  406|  48.1k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 9);
  407|  48.1k|          j++;
  408|   787k|        } else if (codec_mode == ACELP_CORE_MODE_14k4) {
  ------------------
  |  |  126|   787k|#define ACELP_CORE_MODE_14k4 (3)
  ------------------
  |  Branch (408:20): [True: 0, False: 787k]
  ------------------
  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|   787k|        } else if (codec_mode == ACELP_CORE_MODE_16k) {
  ------------------
  |  |  127|   787k|#define ACELP_CORE_MODE_16k (4)
  ------------------
  |  Branch (417:20): [True: 4.58k, False: 782k]
  ------------------
  418|  4.58k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  419|  4.58k|          j++;
  420|  4.58k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  421|  4.58k|          j++;
  422|  4.58k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  423|  4.58k|          j++;
  424|  4.58k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 13);
  425|  4.58k|          j++;
  426|   782k|        } else if (codec_mode == ACELP_CORE_MODE_18k4) {
  ------------------
  |  |  128|   782k|#define ACELP_CORE_MODE_18k4 (5)
  ------------------
  |  Branch (426:20): [True: 782k, False: 0]
  ------------------
  427|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  428|   782k|          j++;
  429|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  430|   782k|          j++;
  431|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  432|   782k|          j++;
  433|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 2);
  434|   782k|          j++;
  435|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  436|   782k|          j++;
  437|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  438|   782k|          j++;
  439|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  440|   782k|          j++;
  441|   782k|          iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 14);
  442|   782k|          j++;
  443|   782k|        }
  444|   835k|        iusace_write_bits_buf(pstr_it_bit_buff, prm[j], 7);
  445|   835k|        j++;
  446|   835k|      }
  447|   224k|      *total_nbbits += (num_bits - NBITS_LPC);
  ------------------
  |  |  143|   224k|#define NBITS_LPC (46)
  ------------------
  448|   224k|      pstr_td->num_bits_per_supfrm += (num_bits - NBITS_LPC);
  ------------------
  |  |  143|   224k|#define NBITS_LPC (46)
  ------------------
  449|   224k|      k++;
  450|   224k|    } else {
  451|   186k|      iusace_write_bits_buf(pstr_it_bit_buff, prm[j++], 3);
  452|   186k|      *total_nbbits += 3;
  453|   186k|      pstr_td->num_bits_per_supfrm += 3;
  454|   186k|      iusace_write_bits_buf(pstr_it_bit_buff, prm[j++], 7);
  455|   186k|      *total_nbbits += 7;
  456|   186k|      pstr_td->num_bits_per_supfrm += 7;
  457|       |
  458|   186k|      if (first_tcx_flag) {
  ------------------
  |  Branch (458:11): [True: 105k, False: 81.4k]
  ------------------
  459|   105k|        first_tcx_flag = 0;
  460|   105k|        if (usac_independency_flag) {
  ------------------
  |  Branch (460:13): [True: 4.09k, False: 101k]
  ------------------
  461|  4.09k|          pstr_td->arith_reset_flag = 1;
  462|  4.09k|          memset(pstr_td->c_pres, 0, 516 * sizeof(WORD32));
  463|  4.09k|          memset(pstr_td->c_prev, 0, 516 * sizeof(WORD32));
  464|   101k|        } else {
  465|   101k|          if (pstr_td->arith_reset_flag) {
  ------------------
  |  Branch (465:15): [True: 101k, False: 0]
  ------------------
  466|   101k|            memset(pstr_td->c_pres, 0, 516 * sizeof(WORD32));
  467|   101k|            memset(pstr_td->c_prev, 0, 516 * sizeof(WORD32));
  468|   101k|          }
  469|   101k|          iusace_write_bits_buf(pstr_it_bit_buff, pstr_td->arith_reset_flag, 1);
  470|   101k|          *total_nbbits += 1;
  471|   101k|          pstr_td->num_bits_per_supfrm += 1;
  472|   101k|        }
  473|   105k|      }
  474|       |
  475|   186k|      sq_bits = iusace_tcx_coding(pstr_it_bit_buff, n_param_tcx[k], pstr_td->len_frame, prm + j,
  476|   186k|                                  pstr_td->c_pres, pstr_td->c_prev);
  477|       |
  478|   186k|      *total_nbbits += sq_bits;
  479|   186k|      pstr_td->num_bits_per_supfrm += sq_bits;
  480|       |
  481|   186k|      k += (1 << (lpd_mode - 1));
  482|   186k|    }
  483|   411k|  }
  484|       |
  485|   135k|  nb_bits_lpc = pstr_it_bit_buff->cnt_bits;
  486|       |
  487|   135k|  iusace_write_lpc_data(pstr_it_bit_buff, param_lpc, first_lpd_flag, mod, num_frames);
  488|       |
  489|   135k|  nb_bits_lpc = pstr_it_bit_buff->cnt_bits - nb_bits_lpc;
  490|   135k|  *total_nbbits += nb_bits_lpc;
  491|   135k|  pstr_td->num_bits_per_supfrm += nb_bits_lpc;
  492|       |
  493|   135k|  if ((core_mode_last == 0) && (fac_data_present == 1)) {
  ------------------
  |  Branch (493:7): [True: 3.97k, False: 131k]
  |  Branch (493:32): [True: 3.26k, False: 715]
  ------------------
  494|  3.26k|    WORD32 short_fac_flag = (mod[-1] == -2) ? 1 : 0;
  ------------------
  |  Branch (494:29): [True: 0, False: 3.26k]
  ------------------
  495|  3.26k|    iusace_write_bits_buf(pstr_it_bit_buff, short_fac_flag, 1);
  496|  3.26k|    *total_nbbits += 1;
  497|  3.26k|  }
  498|       |
  499|   135k|  return;
  500|   135k|}
iusace_fd_encode_fac:
  502|  96.3k|WORD32 iusace_fd_encode_fac(WORD32 *prm, WORD16 *ptr_bit_buf, WORD32 fac_length) {
  503|  96.3k|  WORD32 i, j, n, nb, qn, kv[8], nk, fac_bits;
  504|  96.3k|  WORD32 I;
  505|       |
  506|  96.3k|  fac_bits = 0;
  507|       |
  508|  1.54M|  for (i = 0; i < fac_length; i += 8) {
  ------------------
  |  Branch (508:15): [True: 1.44M, False: 96.3k]
  ------------------
  509|  1.44M|    iusace_apply_voronoi_ext(&prm[i], &qn, &I, kv);
  510|       |
  511|  1.44M|    nb = iusace_unary_code(qn, ptr_bit_buf);
  512|  1.44M|    ptr_bit_buf += nb;
  513|       |
  514|  1.44M|    fac_bits += nb;
  515|       |
  516|  1.44M|    nk = 0;
  517|  1.44M|    n = qn;
  518|  1.44M|    if (qn > 4) {
  ------------------
  |  Branch (518:9): [True: 183k, False: 1.26M]
  ------------------
  519|   183k|      nk = (qn - 3) >> 1;
  520|   183k|      n = qn - nk * 2;
  521|   183k|    }
  522|       |
  523|  1.44M|    if (qn != 0) {
  ------------------
  |  Branch (523:9): [True: 773k, False: 674k]
  ------------------
  524|   773k|      iusace_write_bits2buf(I, 4 * n, ptr_bit_buf);
  525|   773k|      ptr_bit_buf += 4 * n;
  526|   773k|    }
  527|  1.44M|    if (qn > 4) {
  ------------------
  |  Branch (527:9): [True: 183k, False: 1.26M]
  ------------------
  528|  1.65M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (528:19): [True: 1.46M, False: 183k]
  ------------------
  529|  1.46M|        iusace_write_bits2buf(kv[j], nk, ptr_bit_buf);
  530|  1.46M|        ptr_bit_buf += nk;
  531|  1.46M|      }
  532|   183k|    }
  533|  1.44M|    fac_bits += 4 * qn;
  534|  1.44M|  }
  535|       |
  536|  96.3k|  return fac_bits;
  537|  96.3k|}
iusace_enc_fac.c:iusace_write_lpc_data:
  212|   135k|                                  WORD32 first_lpd_flag, WORD32 *mod, WORD32 num_frames) {
  213|   135k|  WORD32 nk_mode = 0;
  214|   135k|  WORD32 j = 0, k;
  215|   135k|  WORD32 mode_lpc = 0;
  216|   135k|  WORD32 qn[2] = {0};
  217|       |
  218|   135k|  iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 4);
  219|       |
  220|   135k|  iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  221|       |
  222|   405k|  for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (222:15): [True: 270k, False: 135k]
  ------------------
  223|   270k|    qn[k] = param_lpc[j++];
  224|   270k|  }
  225|       |
  226|   135k|  iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  227|       |
  228|   135k|  if (first_lpd_flag) {
  ------------------
  |  Branch (228:7): [True: 3.97k, False: 131k]
  ------------------
  229|  3.97k|    mode_lpc = param_lpc[j++];
  230|  3.97k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 0);
  231|       |
  232|  3.97k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (232:9): [True: 224, False: 3.75k]
  ------------------
  233|    224|      iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  234|    224|    }
  235|       |
  236|  11.9k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (236:17): [True: 7.95k, False: 3.97k]
  ------------------
  237|  7.95k|      qn[k] = param_lpc[j++];
  238|  7.95k|    }
  239|       |
  240|  3.97k|    iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  241|  3.97k|  }
  242|       |
  243|   135k|  mode_lpc = param_lpc[j++];
  244|       |
  245|   135k|  if (num_frames == 4 && mod[0] < 3) {
  ------------------
  |  Branch (245:7): [True: 135k, False: 0]
  |  Branch (245:26): [True: 102k, False: 32.8k]
  ------------------
  246|   102k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 2);
  247|       |
  248|   102k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (248:9): [True: 33.4k, False: 68.8k]
  ------------------
  249|  33.4k|      iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  250|  33.4k|    }
  251|       |
  252|   306k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (252:17): [True: 204k, False: 102k]
  ------------------
  253|   204k|      qn[k] = param_lpc[j++];
  254|   204k|    }
  255|       |
  256|   102k|    iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  257|   102k|  }
  258|   135k|  mode_lpc = param_lpc[j++];
  259|   135k|  if (mod[0] < 2) {
  ------------------
  |  Branch (259:7): [True: 87.2k, False: 47.9k]
  ------------------
  260|  87.2k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 1);
  261|       |
  262|  87.2k|    if (mode_lpc != 1) {
  ------------------
  |  Branch (262:9): [True: 59.7k, False: 27.4k]
  ------------------
  263|  59.7k|      if (mode_lpc == 0) {
  ------------------
  |  Branch (263:11): [True: 18.5k, False: 41.2k]
  ------------------
  264|  18.5k|        iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  265|  18.5k|      }
  266|       |
  267|   179k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (267:19): [True: 119k, False: 59.7k]
  ------------------
  268|   119k|        qn[k] = param_lpc[j++];
  269|   119k|      }
  270|       |
  271|  59.7k|      iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  272|  59.7k|    }
  273|  87.2k|  } else if (mode_lpc != 1) {
  ------------------
  |  Branch (273:14): [True: 37.6k, False: 10.2k]
  ------------------
  274|  37.6k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (274:9): [True: 20.4k, False: 17.2k]
  ------------------
  275|  20.4k|      j++;
  276|  20.4k|    }
  277|   113k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (277:17): [True: 75.3k, False: 37.6k]
  ------------------
  278|  75.3k|      qn[k] = param_lpc[j++];
  279|  75.3k|    }
  280|  37.6k|    j += ((qn[0] > 0) ? 9 : 0) + ((qn[1] > 0) ? 9 : 0);
  ------------------
  |  Branch (280:11): [True: 36.4k, False: 1.27k]
  |  Branch (280:35): [True: 34.4k, False: 3.22k]
  ------------------
  281|  37.6k|  }
  282|       |
  283|   135k|  mode_lpc = param_lpc[j++];
  284|   135k|  if (num_frames != 2 && mod[2] < 2) {
  ------------------
  |  Branch (284:7): [True: 135k, False: 0]
  |  Branch (284:26): [True: 86.6k, False: 48.5k]
  ------------------
  285|  86.6k|    iusace_get_nk_mode(mode_lpc, pstr_it_bit_buff, &nk_mode, 3);
  286|  86.6k|    if (mode_lpc == 0) {
  ------------------
  |  Branch (286:9): [True: 1.26k, False: 85.3k]
  ------------------
  287|  1.26k|      iusace_write_bits_buf(pstr_it_bit_buff, param_lpc[j++], 8);
  288|  1.26k|    }
  289|       |
  290|   259k|    for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (290:17): [True: 173k, False: 86.6k]
  ------------------
  291|   173k|      qn[k] = param_lpc[j++];
  292|   173k|    }
  293|  86.6k|    iusace_write_cb_indices(qn, param_lpc, &j, pstr_it_bit_buff, nk_mode, num_frames);
  294|  86.6k|  }
  295|   135k|  return;
  296|   135k|}
iusace_enc_fac.c:iusace_get_nk_mode:
   73|   415k|                               WORD32 *nk_mode, WORD32 lpc_set) {
   74|   415k|  switch (lpc_set) {
  ------------------
  |  Branch (74:11): [True: 415k, False: 0]
  ------------------
   75|   135k|    case 4:
  ------------------
  |  Branch (75:5): [True: 135k, False: 280k]
  ------------------
   76|   135k|      break;
   77|  3.97k|    case 0:
  ------------------
  |  Branch (77:5): [True: 3.97k, False: 411k]
  ------------------
   78|   106k|    case 2:
  ------------------
  |  Branch (78:5): [True: 102k, False: 312k]
  ------------------
   79|   106k|      *nk_mode = 3;
   80|   106k|      iusace_write_bits_buf(pstr_it_bit_buff, mode_lpc, 1);
   81|   106k|      break;
   82|  87.2k|    case 1:
  ------------------
  |  Branch (82:5): [True: 87.2k, False: 328k]
  ------------------
   83|  87.2k|      *nk_mode = mode_lpc;
   84|  87.2k|      if (mode_lpc == 2) {
  ------------------
  |  Branch (84:11): [True: 41.2k, False: 45.9k]
  ------------------
   85|  41.2k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
   86|  45.9k|      } else if (mode_lpc == 1) {
  ------------------
  |  Branch (86:18): [True: 27.4k, False: 18.5k]
  ------------------
   87|  27.4k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   88|  27.4k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   89|  27.4k|      } else if (mode_lpc == 0) {
  ------------------
  |  Branch (89:18): [True: 18.5k, False: 0]
  ------------------
   90|  18.5k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   91|  18.5k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
   92|  18.5k|      }
   93|  87.2k|      break;
   94|  86.6k|    case 3:
  ------------------
  |  Branch (94:5): [True: 86.6k, False: 328k]
  ------------------
   95|  86.6k|      if (mode_lpc == 0) {
  ------------------
  |  Branch (95:11): [True: 1.26k, False: 85.3k]
  ------------------
   96|  1.26k|        *nk_mode = 0;
   97|  1.26k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
   98|  1.26k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
   99|  85.3k|      } else if (mode_lpc == 1) {
  ------------------
  |  Branch (99:18): [True: 51.1k, False: 34.1k]
  ------------------
  100|  51.1k|        *nk_mode = 1;
  101|  51.1k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  102|  51.1k|      } else if (mode_lpc == 2) {
  ------------------
  |  Branch (102:18): [True: 3.25k, False: 30.9k]
  ------------------
  103|  3.25k|        *nk_mode = 2;
  104|  3.25k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  105|  3.25k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  106|  3.25k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  107|  30.9k|      } else {
  108|  30.9k|        *nk_mode = 2;
  109|  30.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  110|  30.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  111|  30.9k|        iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  112|  30.9k|      }
  113|  86.6k|      break;
  114|   415k|  }
  115|   415k|  return;
  116|   415k|}
iusace_enc_fac.c:iusace_write_cb_indices:
  181|   387k|                                    WORD32 num_frames) {
  182|   387k|  WORD32 k;
  183|   387k|  WORD32 j = *idx;
  184|       |
  185|   387k|  iusace_write_qn_data(qn, pstr_it_bit_buff, nk_mode, num_frames);
  186|       |
  187|  1.16M|  for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (187:15): [True: 775k, False: 387k]
  ------------------
  188|   775k|    if (qn[k] > 0) {
  ------------------
  |  Branch (188:9): [True: 568k, False: 206k]
  ------------------
  189|   568k|      WORD32 n, nk, i;
  190|   568k|      if (qn[k] > 4) {
  ------------------
  |  Branch (190:11): [True: 237k, False: 331k]
  ------------------
  191|   237k|        nk = (qn[k] - 3) >> 1;
  192|   237k|        n = qn[k] - nk * 2;
  193|   331k|      } else {
  194|   331k|        nk = 0;
  195|   331k|        n = qn[k];
  196|   331k|      }
  197|       |
  198|   568k|      iusace_write_bits_buf(pstr_it_bit_buff, ptr_params[j++], (UWORD8)(4 * n));
  199|       |
  200|  5.11M|      for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (200:19): [True: 4.55M, False: 568k]
  ------------------
  201|  4.55M|        iusace_write_bits_buf(pstr_it_bit_buff, ptr_params[j++], (UWORD8)nk);
  202|  4.55M|      }
  203|   568k|    }
  204|   775k|  }
  205|       |
  206|   387k|  *idx = j;
  207|       |
  208|   387k|  return;
  209|   387k|}
iusace_enc_fac.c:iusace_write_qn_data:
  119|   387k|                                 WORD32 num_frames) {
  120|   387k|  WORD32 k, i;
  121|   387k|  switch (nk_mode) {
  ------------------
  |  Branch (121:11): [True: 387k, False: 0]
  ------------------
  122|  51.1k|    case 1:
  ------------------
  |  Branch (122:5): [True: 51.1k, False: 336k]
  ------------------
  123|   153k|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (123:19): [True: 102k, False: 51.1k]
  ------------------
  124|   170k|        for (i = 0; i < qn[k] - 1; i++) {
  ------------------
  |  Branch (124:21): [True: 68.0k, False: 102k]
  ------------------
  125|  68.0k|          iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  126|  68.0k|        }
  127|   102k|        iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  128|   102k|      }
  129|  51.1k|      break;
  130|   154k|    case 0:
  ------------------
  |  Branch (130:5): [True: 154k, False: 232k]
  ------------------
  131|   230k|    case 2:
  ------------------
  |  Branch (131:5): [True: 75.4k, False: 312k]
  ------------------
  132|   336k|    case 3:
  ------------------
  |  Branch (132:5): [True: 106k, False: 281k]
  ------------------
  133|  1.00M|      for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (133:19): [True: 673k, False: 336k]
  ------------------
  134|   673k|        WORD32 qn1 = qn[k] - 2;
  135|   673k|        if (qn1 < 0 || qn1 > 3) {
  ------------------
  |  Branch (135:13): [True: 145k, False: 527k]
  |  Branch (135:24): [True: 182k, False: 345k]
  ------------------
  136|   327k|          qn1 = 3;
  137|   327k|        }
  138|   673k|        iusace_write_bits_buf(pstr_it_bit_buff, qn1, 2);
  139|   673k|      }
  140|   336k|      if ((nk_mode == 2) && num_frames != 2) {
  ------------------
  |  Branch (140:11): [True: 75.4k, False: 261k]
  |  Branch (140:29): [True: 75.4k, False: 0]
  ------------------
  141|   226k|        for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (141:21): [True: 150k, False: 75.4k]
  ------------------
  142|   150k|          if (qn[k] > 4) {
  ------------------
  |  Branch (142:15): [True: 30.2k, False: 120k]
  ------------------
  143|  88.1k|            for (i = 0; i < qn[k] - 4; i++) {
  ------------------
  |  Branch (143:25): [True: 57.8k, False: 30.2k]
  ------------------
  144|  57.8k|              iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  145|  57.8k|            }
  146|  30.2k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  147|  30.2k|          }
  148|   150k|          if (qn[k] == 0) {
  ------------------
  |  Branch (148:15): [True: 23.1k, False: 127k]
  ------------------
  149|  23.1k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  150|  23.1k|          }
  151|   150k|        }
  152|   261k|      } else {
  153|   783k|        for (k = 0; k < 2; k++) {
  ------------------
  |  Branch (153:21): [True: 522k, False: 261k]
  ------------------
  154|   522k|          if (qn[k] == 5) {
  ------------------
  |  Branch (154:15): [True: 41.0k, False: 481k]
  ------------------
  155|  41.0k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  156|   481k|          } else if (qn[k] == 6) {
  ------------------
  |  Branch (156:22): [True: 118k, False: 362k]
  ------------------
  157|   118k|            iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  158|   118k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  159|   362k|          } else if (qn[k] == 0) {
  ------------------
  |  Branch (159:22): [True: 122k, False: 240k]
  ------------------
  160|   122k|            iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  161|   122k|            iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  162|   122k|            iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  163|   240k|          } else {
  164|   240k|            WORD32 qn_ext = qn[k] - 4;
  165|   240k|            if (qn_ext > 0) {
  ------------------
  |  Branch (165:17): [True: 45.4k, False: 194k]
  ------------------
  166|   207k|              for (i = 0; i < qn_ext; i++) {
  ------------------
  |  Branch (166:27): [True: 162k, False: 45.4k]
  ------------------
  167|   162k|                iusace_write_bits_buf(pstr_it_bit_buff, 1, 1);
  168|   162k|              }
  169|  45.4k|              iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  170|  45.4k|            }
  171|   240k|          }
  172|   522k|        }
  173|   261k|      }
  174|   336k|      break;
  175|   387k|  }
  176|   387k|  return;
  177|   387k|}
iusace_enc_fac.c:iusace_unary_code:
   56|  1.44M|static WORD32 iusace_unary_code(WORD32 idx, WORD16 *ptr_bit_buf) {
   57|  1.44M|  WORD32 num_bits;
   58|       |
   59|  1.44M|  num_bits = 1;
   60|       |
   61|  1.44M|  idx -= 1;
   62|  3.67M|  while (idx-- > 0) {
  ------------------
  |  Branch (62:10): [True: 2.22M, False: 1.44M]
  ------------------
   63|  2.22M|    *ptr_bit_buf++ = 1;
   64|  2.22M|    num_bits++;
   65|  2.22M|  }
   66|       |
   67|  1.44M|  *ptr_bit_buf = 0;
   68|       |
   69|  1.44M|  return (num_bits);
   70|  1.44M|}

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

ixheaace_init_esbr_inter_tes:
   39|  8.56k|                                  WORD32 sbr_ratio_index) {
   40|  8.56k|  WORD32 ts;
   41|  8.56k|  WORD32 memset_sz = IXHEAACE_QMF_CHANNELS * sizeof(pstr_tes_enc->qmf_buf_real[0][0]);
  ------------------
  |  |   66|  8.56k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   42|       |
   43|  8.56k|  switch (sbr_ratio_index) {
  ------------------
  |  Branch (43:11): [True: 3.34k, False: 5.21k]
  ------------------
   44|  2.54k|    case USAC_SBR_RATIO_INDEX_2_1:
  ------------------
  |  |  186|  2.54k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  |  Branch (44:5): [True: 2.54k, False: 6.01k]
  ------------------
   45|  2.54k|      pstr_tes_enc->op_delay = 6;
   46|  2.54k|      pstr_tes_enc->codec_delay = 32;
   47|  2.54k|      pstr_tes_enc->sbr_ratio_index = sbr_ratio_index;
   48|  2.54k|      break;
   49|    799|    case USAC_SBR_RATIO_INDEX_4_1:
  ------------------
  |  |  188|    799|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (49:5): [True: 799, False: 7.76k]
  ------------------
   50|    799|      pstr_tes_enc->op_delay = 6 * 2;
   51|    799|      pstr_tes_enc->codec_delay = 64;
   52|    799|      pstr_tes_enc->sbr_ratio_index = sbr_ratio_index;
   53|    799|      break;
   54|  8.56k|  }
   55|       |
   56|  8.56k|  memset(&pstr_tes_enc->bw_array_prev[0], 0,
   57|  8.56k|         IXHEAACE_MAX_NUM_PATCHES * sizeof(pstr_tes_enc->bw_array_prev[0]));
  ------------------
  |  |   30|  8.56k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
   58|  8.56k|  memset(&pstr_tes_enc->inv_filt_mode_prev[0], 0,
   59|  8.56k|         IXHEAACE_MAX_NUM_NOISE_VALUES * sizeof(pstr_tes_enc->inv_filt_mode_prev[0]));
  ------------------
  |  |   28|  8.56k|#define IXHEAACE_MAX_NUM_NOISE_VALUES (IXHEAACE_MAX_NOISE_ENVELOPES * IXHEAACE_MAX_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   26|  8.56k|#define IXHEAACE_MAX_NOISE_ENVELOPES (2)
  |  |  ------------------
  |  |               #define IXHEAACE_MAX_NUM_NOISE_VALUES (IXHEAACE_MAX_NOISE_ENVELOPES * IXHEAACE_MAX_NOISE_COEFFS)
  |  |  ------------------
  |  |  |  |   27|  8.56k|#define IXHEAACE_MAX_NOISE_COEFFS (5)
  |  |  ------------------
  ------------------
   60|       |
   61|  8.56k|  for (ts = 0;
   62|   183k|       ts < pstr_tes_enc->op_delay + pstr_tes_enc->codec_delay + IXHEAACE_SBR_HF_ADJ_OFFSET;
  ------------------
  |  |   36|   183k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  |  Branch (62:8): [True: 174k, False: 8.56k]
  ------------------
   63|   174k|       ts++) {
   64|   174k|    memset(pstr_tes_enc->qmf_buf_real[ts], 0, memset_sz);
   65|   174k|    memset(pstr_tes_enc->qmf_buf_imag[ts], 0, memset_sz);
   66|   174k|  }
   67|  8.56k|  return;
   68|  8.56k|}
ixheaace_process_inter_tes:
  706|  90.9k|                                        WORD8 *ptr_scr) {
  707|  90.9k|  WORD32 gi = 0, env, tes_enable = 0, ts, bd, start_ts, stop_ts;
  708|  90.9k|  WORD32 is_sound_activity[IXHEAACE_MAX_ENVELOPES] = {0},
  709|  90.9k|         is_transient[IXHEAACE_MAX_ENVELOPES] = {0};
  710|  90.9k|  WORD32 tes_shape_mode = 0;
  711|  90.9k|  WORD32 num_samples, num_bands;
  712|  90.9k|  WORD32 len;
  713|  90.9k|  IA_ERRORCODE status = IA_NO_ERROR;
  ------------------
  |  |   23|  90.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  714|  90.9k|  FLOAT32 energy_high[64] = {0};
  715|  90.9k|  FLOAT32 energy[64] = {0};
  716|  90.9k|  FLOAT32 gamma[IXHEAACE_ESBR_NUM_GAMMA_IDXS] = {0};
  717|  90.9k|  FLOAT32 gamma_min = MAX_FLT_VAL;
  ------------------
  |  |   30|  90.9k|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  718|  90.9k|  ixheaace_str_inter_tes_scr *tes_scr = (ixheaace_str_inter_tes_scr *)ptr_scr;
  719|  90.9k|  num_bands = pstr_tes_enc->sub_band_end - pstr_tes_enc->sub_band_start;
  720|       |
  721|   199k|  for (env = 0; env < pstr_tes_enc->num_env; env++) {
  ------------------
  |  Branch (721:17): [True: 108k, False: 90.9k]
  ------------------
  722|   108k|    tes_shape_mode = 0;
  723|   108k|    len = 2 * (pstr_tes_enc->border_vec[env + 1] - pstr_tes_enc->border_vec[env]);
  724|   108k|    is_sound_activity[env] = ixheaace_inter_tes_sound_activity(
  725|   108k|        &pstr_tes_enc
  726|   108k|             ->qmf_buf_real[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]],
  ------------------
  |  |   36|   108k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  727|   108k|        &pstr_tes_enc
  728|   108k|             ->qmf_buf_imag[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]],
  ------------------
  |  |   36|   108k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  729|   108k|        &energy_high[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]], len,
  ------------------
  |  |   36|   108k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  730|   108k|        pstr_tes_enc->sub_band_start, pstr_tes_enc->sub_band_end, &is_transient[env]);
  731|   108k|    if (1 == is_transient[env] && 1 == is_sound_activity[env]) {
  ------------------
  |  Branch (731:9): [True: 45.9k, False: 62.6k]
  |  Branch (731:35): [True: 16.0k, False: 29.8k]
  ------------------
  732|  16.0k|      tes_enable = 1;
  733|  16.0k|    }
  734|   108k|  }
  735|       |
  736|  90.9k|  if (1 == tes_enable) {
  ------------------
  |  Branch (736:7): [True: 13.8k, False: 77.1k]
  ------------------
  737|  13.8k|    status = ixheaace_generate_hf(&pstr_tes_enc->qmf_buf_real[IXHEAACE_SBR_HF_ADJ_OFFSET],
  ------------------
  |  |   36|  13.8k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  738|  13.8k|                                  &pstr_tes_enc->qmf_buf_imag[IXHEAACE_SBR_HF_ADJ_OFFSET], NULL,
  ------------------
  |  |   36|  13.8k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  739|  13.8k|                                  NULL, &tes_scr->dst_qmf_r[IXHEAACE_SBR_HF_ADJ_OFFSET],
  ------------------
  |  |   36|  13.8k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  740|  13.8k|                                  &tes_scr->dst_qmf_i[IXHEAACE_SBR_HF_ADJ_OFFSET], pstr_tes_enc);
  ------------------
  |  |   36|  13.8k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  741|       |
  742|  13.8k|    if (status) {
  ------------------
  |  Branch (742:9): [True: 0, False: 13.8k]
  ------------------
  743|      0|      return status;
  744|      0|    }
  745|  34.2k|    for (env = 0; env < pstr_tes_enc->num_env; env++) {
  ------------------
  |  Branch (745:19): [True: 20.3k, False: 13.8k]
  ------------------
  746|  20.3k|      if ((1 == is_sound_activity[env]) && (1 == is_transient[env])) {
  ------------------
  |  Branch (746:11): [True: 17.1k, False: 3.22k]
  |  Branch (746:44): [True: 16.0k, False: 1.06k]
  ------------------
  747|  16.0k|        num_samples = (pstr_tes_enc->border_vec[env + 1] - pstr_tes_enc->border_vec[env]) * 2;
  748|  16.0k|        start_ts = IXHEAACE_SBR_HF_ADJ_OFFSET + pstr_tes_enc->border_vec[env] * 2;
  ------------------
  |  |   36|  16.0k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  749|  16.0k|        stop_ts = start_ts + num_samples;
  750|       |
  751|  80.1k|        for (gi = 0; gi < IXHEAACE_ESBR_NUM_GAMMA_IDXS; gi++) {
  ------------------
  |  |   34|  80.1k|#define IXHEAACE_ESBR_NUM_GAMMA_IDXS (4)
  ------------------
  |  Branch (751:22): [True: 64.1k, False: 16.0k]
  ------------------
  752|  64.1k|          ixheaace_apply_inter_tes(
  753|  64.1k|              &tes_scr
  754|  64.1k|                   ->dst_qmf_r[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]][0],
  ------------------
  |  |   36|  64.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  755|  64.1k|              &tes_scr
  756|  64.1k|                   ->dst_qmf_i[IXHEAACE_SBR_HF_ADJ_OFFSET + 2 * pstr_tes_enc->border_vec[env]][0],
  ------------------
  |  |   36|  64.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  757|  64.1k|              &pstr_tes_enc->qmf_buf_real[IXHEAACE_SBR_HF_ADJ_OFFSET +
  ------------------
  |  |   36|  64.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  758|  64.1k|                                          2 * pstr_tes_enc->border_vec[env]][0],
  759|  64.1k|              &pstr_tes_enc->qmf_buf_imag[IXHEAACE_SBR_HF_ADJ_OFFSET +
  ------------------
  |  |   36|  64.1k|#define IXHEAACE_SBR_HF_ADJ_OFFSET (2)
  ------------------
  760|  64.1k|                                          2 * pstr_tes_enc->border_vec[env]][0],
  761|  64.1k|              num_samples, pstr_tes_enc->sub_band_start, num_bands, gi);
  762|  1.36M|          for (ts = start_ts; ts < stop_ts; ts++) {
  ------------------
  |  Branch (762:31): [True: 1.29M, False: 64.1k]
  ------------------
  763|  1.29M|            energy[ts] = 0.0f;
  764|  39.6M|            for (bd = pstr_tes_enc->sub_band_start; bd < pstr_tes_enc->sub_band_end; bd++) {
  ------------------
  |  Branch (764:53): [True: 38.4M, False: 1.29M]
  ------------------
  765|  38.4M|              energy[ts] += tes_scr->dst_qmf_r[ts][bd] * tes_scr->dst_qmf_r[ts][bd];
  766|  38.4M|              energy[ts] += tes_scr->dst_qmf_i[ts][bd] * tes_scr->dst_qmf_i[ts][bd];
  767|  38.4M|            }
  768|  1.29M|            gamma[gi] += (FLOAT32)fabs(energy[ts] - energy_high[ts]) /
  769|  1.29M|                         (FLOAT32)(pow((energy_high[ts] + 1e-6f), 0.9f));
  770|  1.29M|          }
  771|  64.1k|          if (gamma[gi] < gamma_min) {
  ------------------
  |  Branch (771:15): [True: 13.8k, False: 50.2k]
  ------------------
  772|  13.8k|            gamma_min = gamma[gi];
  773|  13.8k|            tes_shape_mode = gi;
  774|  13.8k|          }
  775|  64.1k|        }
  776|  16.0k|      }
  777|       |
  778|  20.3k|      if (tes_shape_mode > 0) {
  ------------------
  |  Branch (778:11): [True: 0, False: 20.3k]
  ------------------
  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.3k|      } else {
  782|  20.3k|        pstr_tes_enc->bs_tes_shape[env] = 0;
  783|  20.3k|        pstr_tes_enc->bs_tes_shape_mode[env] = 0;
  784|  20.3k|      }
  785|  20.3k|    }
  786|  77.1k|  } else {
  787|   165k|    for (env = 0; env < pstr_tes_enc->num_env; env++) {
  ------------------
  |  Branch (787:19): [True: 88.2k, False: 77.1k]
  ------------------
  788|  88.2k|      pstr_tes_enc->bs_tes_shape[env] = 0;
  789|  88.2k|      pstr_tes_enc->bs_tes_shape_mode[env] = 0;
  790|  88.2k|    }
  791|  77.1k|  }
  792|  90.9k|  return status;
  793|  90.9k|}
iusace_esbr_inter_tes.c:ixheaace_inter_tes_sound_activity:
  146|   108k|                                                WORD32 stop, WORD32 *is_transient) {
  147|   108k|  WORD32 snd_act = 0, ts, idx;
  148|   108k|  FLOAT32 ene_min = MAX_FLT_VAL, ene_max = 0.0f;
  ------------------
  |  |   30|   108k|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  149|       |
  150|  2.68M|  for (ts = 0; ts < len; ts++) {
  ------------------
  |  Branch (150:16): [True: 2.57M, False: 108k]
  ------------------
  151|  2.57M|    idx = start;
  152|  78.2M|    while (idx < stop) {
  ------------------
  |  Branch (152:12): [True: 75.6M, False: 2.57M]
  ------------------
  153|  75.6M|      energy[ts] += (qmf_real[ts][idx] * qmf_real[ts][idx]);
  154|  75.6M|      energy[ts] += (qmf_imag[ts][idx] * qmf_imag[ts][idx]);
  155|  75.6M|      idx++;
  156|  75.6M|    }
  157|       |
  158|  2.57M|    if (energy[ts] > ene_max) {
  ------------------
  |  Branch (158:9): [True: 325k, False: 2.25M]
  ------------------
  159|   325k|      ene_max = energy[ts];
  160|   325k|    }
  161|  2.57M|    if (energy[ts] < ene_min) {
  ------------------
  |  Branch (161:9): [True: 407k, False: 2.17M]
  ------------------
  162|   407k|      ene_min = energy[ts];
  163|   407k|    }
  164|  2.57M|  }
  165|       |
  166|   108k|  snd_act = (ene_max > IXHEAACE_ESBR_TES_ENERGY_MAX_THR) ? 1 : 0;
  ------------------
  |  |   23|   108k|#define IXHEAACE_ESBR_TES_ENERGY_MAX_THR (1.0e6f)
  ------------------
  |  Branch (166:13): [True: 19.9k, False: 88.5k]
  ------------------
  167|       |
  168|   108k|  if ((ene_max / (ene_min + 1.0e-6f)) > 20) {
  ------------------
  |  Branch (168:7): [True: 45.9k, False: 62.6k]
  ------------------
  169|  45.9k|    *is_transient = 1;
  170|  62.6k|  } else {
  171|  62.6k|    *is_transient = 0;
  172|  62.6k|  }
  173|   108k|  return snd_act;
  174|   108k|}
iusace_esbr_inter_tes.c:ixheaace_generate_hf:
  389|  13.8k|                                         ixheaace_str_inter_tes_params *pstr_tes_enc) {
  390|  13.8k|  WORD32 bw_index, i, k, k2, patch = 0;
  391|  13.8k|  WORD32 co_var_len;
  392|  13.8k|  WORD32 start_sample, end_sample, goal_sb;
  393|  13.8k|  WORD32 sb, source_start_band, patch_stride, num_bands_in_patch;
  394|  13.8k|  WORD32 hbe_flag = 0;
  395|  13.8k|  FLOAT32 a0r, a0i, a1r, a1i;
  396|  13.8k|  FLOAT32 ptr_bw_array[IXHEAACE_MAX_NUM_PATCHES] = {0};
  397|       |
  398|  13.8k|  ixheaace_str_auto_corr_ele str_auto_corr;
  399|       |
  400|  13.8k|  WORD16 *ptr_invf_band_tbl = &pstr_tes_enc->invf_band_tbl[1];
  401|  13.8k|  WORD32 num_if_bands = pstr_tes_enc->num_if_bands;
  402|  13.8k|  WORD32 sub_band_start = pstr_tes_enc->sub_band_start;
  403|  13.8k|  WORD16 *ptr_master_tab = pstr_tes_enc->f_master_tbl;
  404|  13.8k|  WORD32 num_mf_bands = pstr_tes_enc->num_mf_bands;
  405|  13.8k|  WORD32 *ptr_inv_filt_mode = pstr_tes_enc->inv_filt_mode;
  406|  13.8k|  WORD32 *ptr_inv_filt_mode_prev = pstr_tes_enc->inv_filt_mode_prev;
  407|  13.8k|  WORD32 sbr_patching_mode = 1;
  408|  13.8k|  WORD32 pre_proc_flag = 0;
  409|  13.8k|  WORD32 fs = pstr_tes_enc->out_fs;
  410|  13.8k|  WORD32 cov_count;
  411|  13.8k|  WORD32 lsb = ptr_master_tab[0];
  412|  13.8k|  WORD32 usb = ptr_master_tab[num_mf_bands];
  413|  13.8k|  WORD32 memset_sz = (IXHEAACE_QMF_CHANNELS - usb) * sizeof(FLOAT32);
  ------------------
  |  |   66|  13.8k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  414|  13.8k|  WORD32 xover_offset = sub_band_start - ptr_master_tab[0];
  415|  13.8k|  FLOAT32 bw = 0.0f;
  416|  13.8k|  FLOAT32 fac = 0.0f;
  417|  13.8k|  FLOAT32 gain;
  418|  13.8k|  FLOAT32 ptr_gain_vector[64];
  419|  13.8k|  WORD32 slope_length = 0;
  420|  13.8k|  WORD32 first_slot_offset = pstr_tes_enc->border_vec[0];
  421|  13.8k|  WORD32 end_slot_offs = 0;
  422|  13.8k|  FLOAT32 *ptr_bw_array_prev = pstr_tes_enc->bw_array_prev;
  423|       |
  424|  13.8k|  end_slot_offs = pstr_tes_enc->border_vec[pstr_tes_enc->num_env] - 16;
  425|       |
  426|  13.8k|  switch (pstr_tes_enc->sbr_ratio_index) {
  427|  9.81k|    case USAC_SBR_RATIO_INDEX_2_1:
  ------------------
  |  |  186|  9.81k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  |  Branch (427:5): [True: 9.81k, False: 4.07k]
  ------------------
  428|  9.81k|      start_sample = first_slot_offset * 2;
  429|  9.81k|      end_sample = 32 + end_slot_offs * 2;
  430|  9.81k|      co_var_len = 38;
  431|  9.81k|      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: 12.9k]
  ------------------
  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.16k|    default:
  ------------------
  |  Branch (437:5): [True: 3.16k, False: 10.7k]
  ------------------
  438|  3.16k|      start_sample = first_slot_offset * 2;
  439|  3.16k|      end_sample = 32 + end_slot_offs * 2;
  440|  3.16k|      co_var_len = 38;
  441|  3.16k|      break;
  442|  13.8k|  }
  443|       |
  444|  13.8k|  if (pre_proc_flag) {
  ------------------
  |  Branch (444:7): [True: 0, False: 13.8k]
  ------------------
  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|  13.8k|  ixheaace_esbr_chirp_fac_calc(ptr_inv_filt_mode, ptr_inv_filt_mode_prev, num_if_bands,
  450|  13.8k|                               ptr_bw_array, ptr_bw_array_prev);
  451|       |
  452|   423k|  for (i = start_sample; i < end_sample; i++) {
  ------------------
  |  Branch (452:26): [True: 409k, False: 13.8k]
  ------------------
  453|   409k|    memset(ptr_dst_buf_real[i] + usb, 0, memset_sz);
  454|   409k|    memset(ptr_dst_buf_imag[i] + usb, 0, memset_sz);
  455|   409k|  }
  456|       |
  457|  13.8k|  if (sbr_patching_mode || !hbe_flag) {
  ------------------
  |  Branch (457:7): [True: 13.8k, False: 0]
  |  Branch (457:28): [True: 0, False: 0]
  ------------------
  458|  13.8k|    FLOAT32 alpha_real[IXHEAACE_QMF_CHANNELS][2] = {{0}},
  459|  13.8k|            alpha_imag[IXHEAACE_QMF_CHANNELS][2] = {{0}};
  460|  13.8k|    cov_count = ptr_master_tab[0];
  461|       |
  462|   335k|    for (k = 1; k < cov_count; k++) {
  ------------------
  |  Branch (462:17): [True: 321k, False: 13.8k]
  ------------------
  463|   321k|      ixheaace_esbr_calc_co_variance(&str_auto_corr, &ptr_src_buf_real[0], &ptr_src_buf_imag[0],
  464|   321k|                                     k, co_var_len);
  465|   321k|      if (str_auto_corr.det == 0.0f) {
  ------------------
  |  Branch (465:11): [True: 7.85k, False: 313k]
  ------------------
  466|  7.85k|        alpha_real[k][1] = alpha_imag[k][1] = 0;
  467|   313k|      } else {
  468|   313k|        fac = 1.0f / str_auto_corr.det;
  469|   313k|        alpha_real[k][1] = (str_auto_corr.phi_0_1_real * str_auto_corr.phi_1_2_real -
  470|   313k|                            str_auto_corr.phi_0_1_imag * str_auto_corr.phi_1_2_imag -
  471|   313k|                            str_auto_corr.phi_0_2_real * str_auto_corr.phi_1_1) *
  472|   313k|                           fac;
  473|   313k|        alpha_imag[k][1] = (str_auto_corr.phi_0_1_imag * str_auto_corr.phi_1_2_real +
  474|   313k|                            str_auto_corr.phi_0_1_real * str_auto_corr.phi_1_2_imag -
  475|   313k|                            str_auto_corr.phi_0_2_imag * str_auto_corr.phi_1_1) *
  476|   313k|                           fac;
  477|   313k|      }
  478|       |
  479|   321k|      if (str_auto_corr.phi_1_1 == 0) {
  ------------------
  |  Branch (479:11): [True: 7.83k, False: 313k]
  ------------------
  480|  7.83k|        alpha_real[k][0] = alpha_imag[k][0] = 0;
  481|   313k|      } else {
  482|   313k|        fac = 1.0f / str_auto_corr.phi_1_1;
  483|   313k|        alpha_real[k][0] =
  484|   313k|            -(str_auto_corr.phi_0_1_real + alpha_real[k][1] * str_auto_corr.phi_1_2_real +
  485|   313k|              alpha_imag[k][1] * str_auto_corr.phi_1_2_imag) *
  486|   313k|            fac;
  487|   313k|        alpha_imag[k][0] =
  488|   313k|            -(str_auto_corr.phi_0_1_imag + alpha_imag[k][1] * str_auto_corr.phi_1_2_real -
  489|   313k|              alpha_real[k][1] * str_auto_corr.phi_1_2_imag) *
  490|   313k|            fac;
  491|   313k|      }
  492|       |
  493|   321k|      if ((alpha_real[k][0] * alpha_real[k][0] + alpha_imag[k][0] * alpha_imag[k][0] >= 16.0f) ||
  ------------------
  |  Branch (493:11): [True: 284, False: 321k]
  ------------------
  494|   321k|          (alpha_real[k][1] * alpha_real[k][1] + alpha_imag[k][1] * alpha_imag[k][1] >= 16.0f)) {
  ------------------
  |  Branch (494:11): [True: 739, False: 320k]
  ------------------
  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|   321k|    }
  501|       |
  502|  13.8k|    goal_sb = (WORD32)(2.048e6f / fs + 0.5f);
  503|  13.8k|    {
  504|  13.8k|      WORD32 index;
  505|  13.8k|      if (goal_sb < ptr_master_tab[num_mf_bands]) {
  ------------------
  |  Branch (505:11): [True: 5.62k, False: 8.26k]
  ------------------
  506|  11.2k|        for (index = 0; (ptr_master_tab[index] < goal_sb); index++)
  ------------------
  |  Branch (506:25): [True: 5.62k, False: 5.62k]
  ------------------
  507|  5.62k|          goal_sb = ptr_master_tab[index];
  508|  8.26k|      } else {
  509|  8.26k|        goal_sb = ptr_master_tab[num_mf_bands];
  510|  8.26k|      }
  511|  13.8k|    }
  512|       |
  513|  13.8k|    source_start_band = xover_offset + 1;
  514|       |
  515|  13.8k|    sb = lsb + xover_offset;
  516|       |
  517|  13.8k|    patch = 0;
  518|  47.8k|    while (sb < usb) {
  ------------------
  |  Branch (518:12): [True: 33.9k, False: 13.8k]
  ------------------
  519|  33.9k|      if (IXHEAACE_MAX_NUM_PATCHES <= patch) {
  ------------------
  |  |   30|  33.9k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (519:11): [True: 0, False: 33.9k]
  ------------------
  520|      0|        return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_NUM_PATCH;
  521|      0|      }
  522|       |
  523|  33.9k|      num_bands_in_patch = goal_sb - sb;
  524|       |
  525|  33.9k|      if (num_bands_in_patch + source_start_band >= lsb) {
  ------------------
  |  Branch (525:11): [True: 14.4k, False: 19.5k]
  ------------------
  526|  14.4k|        patch_stride = sb - source_start_band;
  527|  14.4k|        patch_stride = patch_stride & ~1;
  528|  14.4k|        num_bands_in_patch = lsb - (sb - patch_stride);
  529|  14.4k|        num_bands_in_patch = ixheaace_find_closest_entry(sb + num_bands_in_patch, ptr_master_tab,
  530|  14.4k|                                                         (WORD16)(num_mf_bands), 0) -
  531|  14.4k|                             (WORD32)(sb);
  532|  14.4k|      }
  533|       |
  534|  33.9k|      patch_stride = num_bands_in_patch + sb - lsb;
  535|  33.9k|      patch_stride = (patch_stride + 1) & ~1;
  536|       |
  537|  33.9k|      source_start_band = 1;
  538|       |
  539|  33.9k|      if (goal_sb - (sb + num_bands_in_patch) < 3) {
  ------------------
  |  Branch (539:11): [True: 19.5k, False: 14.4k]
  ------------------
  540|  19.5k|        goal_sb = usb;
  541|  19.5k|      }
  542|       |
  543|  33.9k|      if ((num_bands_in_patch < 3) && (patch > 0) && (sb + num_bands_in_patch == usb)) {
  ------------------
  |  Branch (543:11): [True: 5.62k, False: 28.3k]
  |  Branch (543:39): [True: 0, False: 5.62k]
  |  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|  33.9k|      if (num_bands_in_patch <= 0) {
  ------------------
  |  Branch (556:11): [True: 5.62k, False: 28.3k]
  ------------------
  557|  5.62k|        continue;
  558|  5.62k|      }
  559|       |
  560|   433k|      for (k2 = sb; k2 < sb + num_bands_in_patch; k2++) {
  ------------------
  |  Branch (560:21): [True: 405k, False: 28.3k]
  ------------------
  561|   405k|        k = k2 - patch_stride;
  562|   405k|        bw_index = 0;
  563|   884k|        while (k2 >= ptr_invf_band_tbl[bw_index]) {
  ------------------
  |  Branch (563:16): [True: 478k, False: 405k]
  ------------------
  564|   478k|          bw_index++;
  565|   478k|          if (bw_index >= IXHEAACE_MAX_NOISE_COEFFS) {
  ------------------
  |  |   27|   478k|#define IXHEAACE_MAX_NOISE_COEFFS (5)
  ------------------
  |  Branch (565:15): [True: 0, False: 478k]
  ------------------
  566|      0|            return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_BANDWIDTH_INDEX;
  567|      0|          }
  568|   478k|        }
  569|       |
  570|   405k|        if (bw_index >= IXHEAACE_MAX_NUM_PATCHES) {
  ------------------
  |  |   30|   405k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (570:13): [True: 0, False: 405k]
  ------------------
  571|      0|          return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_BANDWIDTH_INDEX;
  572|      0|        }
  573|   405k|        bw = ptr_bw_array[bw_index];
  574|       |
  575|   405k|        a0r = bw * alpha_real[k][0];
  576|   405k|        a0i = bw * alpha_imag[k][0];
  577|   405k|        bw *= bw;
  578|   405k|        a1r = bw * alpha_real[k][1];
  579|   405k|        a1i = bw * alpha_imag[k][1];
  580|       |
  581|   405k|        if (pre_proc_flag) {
  ------------------
  |  Branch (581:13): [True: 0, False: 405k]
  ------------------
  582|      0|          gain = ptr_gain_vector[k];
  583|   405k|        } else {
  584|   405k|          gain = 1.0f;
  585|   405k|        }
  586|       |
  587|  12.6M|        for (i = start_sample + slope_length; i < end_sample + slope_length; i++) {
  ------------------
  |  Branch (587:47): [True: 12.2M, False: 405k]
  ------------------
  588|  12.2M|          ptr_dst_buf_real[i][k2] = ptr_src_buf_real[i][k] * gain;
  589|       |
  590|  12.2M|          ptr_dst_buf_imag[i][k2] = ptr_src_buf_imag[i][k] * gain;
  591|       |
  592|  12.2M|          if (bw > 0.0f) {
  ------------------
  |  Branch (592:15): [True: 0, False: 12.2M]
  ------------------
  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.2M|        }
  603|   405k|      }
  604|  28.3k|      sb += num_bands_in_patch;
  605|  28.3k|      patch++;
  606|  28.3k|    }
  607|  13.8k|  }
  608|       |
  609|  13.8k|  if (hbe_flag && !sbr_patching_mode) {
  ------------------
  |  Branch (609:7): [True: 0, False: 13.8k]
  |  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|  13.8k|  if (patch >= (IXHEAACE_MAX_NUM_PATCHES + 1)) {
  ------------------
  |  |   30|  13.8k|#define IXHEAACE_MAX_NUM_PATCHES (6)
  ------------------
  |  Branch (696:7): [True: 0, False: 13.8k]
  ------------------
  697|      0|    return IA_EXHEAACE_EXE_NONFATAL_ESBR_INVALID_NUM_PATCH;
  698|      0|  }
  699|  51.8k|  for (i = 0; i < num_if_bands; i++) {
  ------------------
  |  Branch (699:15): [True: 38.0k, False: 13.8k]
  ------------------
  700|  38.0k|    ptr_bw_array_prev[i] = ptr_bw_array[i];
  701|  38.0k|  }
  702|  13.8k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  13.8k|#define IA_NO_ERROR 0x00000000
  ------------------
  703|  13.8k|}
iusace_esbr_inter_tes.c:ixheaace_esbr_chirp_fac_calc:
  324|  13.8k|                                         FLOAT32 *ptr_bw_array, FLOAT32 *ptr_bw_array_prev) {
  325|  13.8k|  WORD32 i;
  326|       |
  327|  51.8k|  for (i = 0; i < num_if_bands; i++) {
  ------------------
  |  Branch (327:15): [True: 38.0k, False: 13.8k]
  ------------------
  328|  38.0k|    ptr_bw_array[i] = ixheaace_new_bw_tab[ptr_inv_filt_mode_prev[i]][ptr_inv_filt_mode[i]];
  329|       |
  330|  38.0k|    if (ptr_bw_array[i] < ptr_bw_array_prev[i]) {
  ------------------
  |  Branch (330:9): [True: 0, False: 38.0k]
  ------------------
  331|      0|      ptr_bw_array[i] = 0.75000f * ptr_bw_array[i] + 0.25000f * ptr_bw_array_prev[i];
  332|  38.0k|    } else {
  333|  38.0k|      ptr_bw_array[i] = 0.90625f * ptr_bw_array[i] + 0.09375f * ptr_bw_array_prev[i];
  334|  38.0k|    }
  335|       |
  336|  38.0k|    if (ptr_bw_array[i] < 0.015625) {
  ------------------
  |  Branch (336:9): [True: 38.0k, False: 0]
  ------------------
  337|  38.0k|      ptr_bw_array[i] = 0;
  338|  38.0k|    }
  339|  38.0k|  }
  340|  13.8k|}
iusace_esbr_inter_tes.c:ixheaace_esbr_calc_co_variance:
  202|   321k|                                           WORD32 bd, WORD32 len) {
  203|   321k|  WORD32 j = 0;
  204|       |
  205|   321k|  FLOAT32 xr_j;
  206|   321k|  FLOAT32 xr_j_minus_1 = ptr_vec_x_real[j - 1][bd];
  207|   321k|  FLOAT32 xr_j_minus_2 = ptr_vec_x_real[j - 2][bd];
  208|       |
  209|   321k|  FLOAT32 xi_j;
  210|   321k|  FLOAT32 xi_j_minus_1 = ptr_vec_x_imag[j - 1][bd];
  211|   321k|  FLOAT32 xi_j_minus_2 = ptr_vec_x_imag[j - 2][bd];
  212|       |
  213|   321k|  memset(pstr_auto_corr, 0, sizeof(ixheaace_str_auto_corr_ele));
  214|       |
  215|  12.9M|  for (j = 0; j < len; j++) {
  ------------------
  |  Branch (215:15): [True: 12.6M, False: 321k]
  ------------------
  216|  12.6M|    xr_j = ptr_vec_x_real[j][bd];
  217|  12.6M|    xi_j = ptr_vec_x_imag[j][bd];
  218|       |
  219|  12.6M|    pstr_auto_corr->phi_0_1_real += xr_j * xr_j_minus_1 + xi_j * xi_j_minus_1;
  220|       |
  221|  12.6M|    pstr_auto_corr->phi_0_1_imag += xi_j * xr_j_minus_1 - xr_j * xi_j_minus_1;
  222|       |
  223|  12.6M|    pstr_auto_corr->phi_0_2_real += xr_j * xr_j_minus_2 + xi_j * xi_j_minus_2;
  224|       |
  225|  12.6M|    pstr_auto_corr->phi_0_2_imag += xi_j * xr_j_minus_2 - xr_j * xi_j_minus_2;
  226|       |
  227|  12.6M|    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.6M|    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.6M|    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.6M|    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.6M|    xr_j_minus_2 = xr_j_minus_1;
  236|  12.6M|    xr_j_minus_1 = xr_j;
  237|       |
  238|  12.6M|    xi_j_minus_2 = xi_j_minus_1;
  239|  12.6M|    xi_j_minus_1 = xi_j;
  240|  12.6M|  }
  241|       |
  242|   321k|  pstr_auto_corr->det = pstr_auto_corr->phi_1_1 * pstr_auto_corr->phi_2_2 -
  243|   321k|                        (pstr_auto_corr->phi_1_2_real * pstr_auto_corr->phi_1_2_real +
  244|   321k|                         pstr_auto_corr->phi_1_2_imag * pstr_auto_corr->phi_1_2_imag) *
  245|   321k|                            IXHEAACE_SBR_HF_RELAXATION_PARAM;
  ------------------
  |  |   33|   321k|#define IXHEAACE_SBR_HF_RELAXATION_PARAM (0.999999f)
  ------------------
  246|   321k|}
iusace_esbr_inter_tes.c:ixheaace_find_closest_entry:
  177|  14.4k|                                          WORD16 num_mf_bands, WORD16 direction) {
  178|  14.4k|  WORD32 index;
  179|       |
  180|  14.4k|  if (goal_sb <= ptr_master_tab[0]) return ptr_master_tab[0];
  ------------------
  |  Branch (180:7): [True: 0, False: 14.4k]
  ------------------
  181|       |
  182|  14.4k|  if (goal_sb >= ptr_master_tab[num_mf_bands]) return ptr_master_tab[num_mf_bands];
  ------------------
  |  Branch (182:7): [True: 0, False: 14.4k]
  ------------------
  183|       |
  184|  14.4k|  if (direction) {
  ------------------
  |  Branch (184:7): [True: 0, False: 14.4k]
  ------------------
  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.4k|  } else {
  190|  14.4k|    index = num_mf_bands;
  191|  53.9k|    while (ptr_master_tab[index] > goal_sb) {
  ------------------
  |  Branch (191:12): [True: 39.4k, False: 14.4k]
  ------------------
  192|  39.4k|      index--;
  193|  39.4k|    }
  194|  14.4k|  }
  195|       |
  196|  14.4k|  return ptr_master_tab[index];
  197|  14.4k|}
iusace_esbr_inter_tes.c:ixheaace_apply_inter_tes:
   72|  64.1k|                                     WORD32 num_subband, WORD32 gamma_idx) {
   73|  64.1k|  WORD32 sub_band_end = sub_band_start + num_subband;
   74|  64.1k|  FLOAT32 subsample_power_high[IXHEAACE_TIMESLOT_BUFFER_SIZE],
   75|  64.1k|      subsample_power_low[IXHEAACE_TIMESLOT_BUFFER_SIZE];
   76|  64.1k|  FLOAT32 total_power_high = 0.0f;
   77|  64.1k|  FLOAT32 total_power_low = 0.0f, total_power_high_after = 1.0e-6f;
   78|  64.1k|  FLOAT32 gain[IXHEAACE_TIMESLOT_BUFFER_SIZE];
   79|  64.1k|  FLOAT32 gain_adj, gain_adj_2;
   80|  64.1k|  FLOAT32 gamma = ixheaace_gamma_tab[gamma_idx];
   81|  64.1k|  WORD32 i, j;
   82|  64.1k|  WORD32 memcpy_sz = sub_band_start * sizeof(FLOAT32);
   83|       |
   84|  64.1k|  if (gamma > 0) {
  ------------------
  |  Branch (84:7): [True: 48.1k, False: 16.0k]
  ------------------
   85|  1.02M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (85:17): [True: 973k, False: 48.1k]
  ------------------
   86|   973k|      memcpy(&qmf_real[IXHEAACE_QMF_CHANNELS * i], &qmf_real1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   973k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                    memcpy(&qmf_real[IXHEAACE_QMF_CHANNELS * i], &qmf_real1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   973k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   87|   973k|             memcpy_sz);
   88|   973k|      memcpy(&qmf_imag[IXHEAACE_QMF_CHANNELS * i], &qmf_imag1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   973k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                    memcpy(&qmf_imag[IXHEAACE_QMF_CHANNELS * i], &qmf_imag1[IXHEAACE_QMF_CHANNELS * i],
  ------------------
  |  |   66|   973k|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   89|   973k|             memcpy_sz);
   90|   973k|    }
   91|       |
   92|  1.02M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (92:17): [True: 973k, False: 48.1k]
  ------------------
   93|   973k|      j = 0;
   94|   973k|      subsample_power_low[i] = 0.0f;
   95|  24.4M|      while (j < sub_band_start) {
  ------------------
  |  Branch (95:14): [True: 23.4M, False: 973k]
  ------------------
   96|  23.4M|        subsample_power_low[i] +=
   97|  23.4M|            qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
   98|  23.4M|        subsample_power_low[i] +=
   99|  23.4M|            qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  23.4M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  100|  23.4M|        j++;
  101|  23.4M|      }
  102|   973k|      subsample_power_high[i] = 0.0f;
  103|  29.7M|      while (j < sub_band_end) {
  ------------------
  |  Branch (103:14): [True: 28.8M, False: 973k]
  ------------------
  104|  28.8M|        subsample_power_high[i] +=
  105|  28.8M|            qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  28.8M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_real[IXHEAACE_QMF_CHANNELS * i + j] * qmf_real[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  28.8M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  106|  28.8M|        subsample_power_high[i] +=
  107|  28.8M|            qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  28.8M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
                          qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] * qmf_imag[IXHEAACE_QMF_CHANNELS * i + j];
  ------------------
  |  |   66|  28.8M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  108|  28.8M|        j++;
  109|  28.8M|      }
  110|   973k|      total_power_low += subsample_power_low[i];
  111|   973k|      total_power_high += subsample_power_high[i];
  112|   973k|    }
  113|       |
  114|  1.02M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (114:17): [True: 973k, False: 48.1k]
  ------------------
  115|   973k|      gain[i] =
  116|   973k|          (FLOAT32)(sqrt(subsample_power_low[i] * num_sample / (total_power_low + 1.0e-6f)));
  117|   973k|      gain[i] = (FLOAT32)(1.0f + gamma * (gain[i] - 1.0f));
  118|       |
  119|   973k|      if (gain[i] < 0.2f) {
  ------------------
  |  Branch (119:11): [True: 767k, False: 205k]
  ------------------
  120|   767k|        gain[i] = 0.2f;
  121|   767k|      }
  122|       |
  123|   973k|      subsample_power_high[i] *= gain[i] * gain[i];
  124|   973k|      total_power_high_after += subsample_power_high[i];
  125|   973k|    }
  126|       |
  127|  48.1k|    gain_adj_2 = total_power_high / total_power_high_after;
  128|  48.1k|    gain_adj = (FLOAT32)(sqrt(gain_adj_2));
  129|       |
  130|  1.02M|    for (i = 0; i < num_sample; i++) {
  ------------------
  |  Branch (130:17): [True: 973k, False: 48.1k]
  ------------------
  131|   973k|      gain[i] *= gain_adj;
  132|       |
  133|   973k|      j = sub_band_start;
  134|  29.7M|      while (j < sub_band_end) {
  ------------------
  |  Branch (134:14): [True: 28.8M, False: 973k]
  ------------------
  135|  28.8M|        qmf_real[IXHEAACE_QMF_CHANNELS * i + j] *= gain[i];
  ------------------
  |  |   66|  28.8M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  136|  28.8M|        qmf_imag[IXHEAACE_QMF_CHANNELS * i + j] *= gain[i];
  ------------------
  |  |   66|  28.8M|#define IXHEAACE_QMF_CHANNELS (64)
  ------------------
  137|  28.8M|        j++;
  138|  28.8M|      }
  139|   973k|    }
  140|  48.1k|  }
  141|  64.1k|}

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

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

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

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

iusace_quantize_lpc_avq:
  206|   135k|                             WORD32 *ptr_lpc_idx, WORD32 *nb_indices, WORD32 *nbbits) {
  207|   135k|  WORD32 i;
  208|   135k|  FLOAT32 lsfq[ORDER];
  209|   135k|  WORD32 *ptr_index, indxt[100], num_bits, nbt, nit;
  210|       |
  211|   135k|  ptr_index = &ptr_lpc_idx[0];
  212|   135k|  *nb_indices = 0;
  213|   135k|  *nbbits = 0;
  214|       |
  215|   135k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER]);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER]);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  216|       |
  217|   135k|  nbt = iusace_avq_first_approx_rel(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                nbt = iusace_avq_first_approx_rel(&ptr_lsf[3 * ORDER], &ptr_lsfq[3 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  218|   135k|  nit = 1 + iusace_get_num_params(&ptr_lpc_idx[1]);
  219|       |
  220|   135k|  ptr_index += nit;
  221|   135k|  *nb_indices += nit;
  222|   135k|  *nbbits += 8 + nbt;
  223|       |
  224|   135k|  if (lpc0) {
  ------------------
  |  Branch (224:7): [True: 3.97k, False: 131k]
  ------------------
  225|  3.97k|    *ptr_index = 0;
  226|  3.97k|    ptr_index++;
  227|  3.97k|    *nb_indices += 1;
  228|  3.97k|    *nbbits += 1;
  229|       |
  230|  3.97k|    ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER]);
  ------------------
  |  |   71|  3.97k|#define ORDER (16)
  ------------------
                  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER]);
  ------------------
  |  |   71|  3.97k|#define ORDER (16)
  ------------------
  231|       |
  232|  3.97k|    num_bits = iusace_avq_first_approx_rel(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|  3.97k|#define ORDER (16)
  ------------------
                  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[-ORDER], &ptr_lsfq[-ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|  3.97k|#define ORDER (16)
  ------------------
  233|  3.97k|    nbt = 8 + num_bits;
  234|  3.97k|    nit = 1 + iusace_get_num_params(&ptr_index[1]);
  235|       |
  236|  67.5k|    for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  67.5k|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  63.6k|#define ORDER (16)
  ------------------
  |  Branch (236:17): [True: 63.6k, False: 3.97k]
  ------------------
  237|       |
  238|  3.97k|    num_bits = iusace_avq_first_approx_rel(&ptr_lsf[-ORDER], &lsfq[0], indxt, 3);
  ------------------
  |  |   71|  3.97k|#define ORDER (16)
  ------------------
  239|       |
  240|  3.97k|    if (num_bits < nbt) {
  ------------------
  |  Branch (240:9): [True: 3.75k, False: 224]
  ------------------
  241|  3.75k|      nbt = num_bits;
  242|  3.75k|      nit = iusace_get_num_params(&indxt[0]);
  243|  3.75k|      ptr_index[-1] = 1;
  244|  63.7k|      for (i = 0; i < ORDER; i++) ptr_lsfq[-ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  63.7k|#define ORDER (16)
  ------------------
                    for (i = 0; i < ORDER; i++) ptr_lsfq[-ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  60.0k|#define ORDER (16)
  ------------------
  |  Branch (244:19): [True: 60.0k, False: 3.75k]
  ------------------
  245|  52.4k|      for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (245:19): [True: 48.7k, False: 3.75k]
  ------------------
  246|  3.75k|    }
  247|       |
  248|  3.97k|    ptr_index += nit;
  249|  3.97k|    *nb_indices += nit;
  250|  3.97k|    *nbbits += nbt;
  251|  3.97k|  }
  252|       |
  253|   135k|  *ptr_index = 0;
  254|   135k|  ptr_index++;
  255|   135k|  *nb_indices += 1;
  256|   135k|  *nbbits += 1;
  257|       |
  258|   135k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[ORDER], &ptr_lsfq[ORDER]);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[ORDER], &ptr_lsfq[ORDER]);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  259|       |
  260|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[ORDER], &ptr_lsfq[ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                num_bits = iusace_avq_first_approx_rel(&ptr_lsf[ORDER], &ptr_lsfq[ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  261|   135k|  nbt = 8 + num_bits;
  262|   135k|  nit = 1 + iusace_get_num_params(&ptr_index[1]);
  263|       |
  264|  2.29M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.29M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
  |  Branch (264:15): [True: 2.16M, False: 135k]
  ------------------
  265|       |
  266|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[ORDER], &lsfq[0], indxt, 3);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  267|       |
  268|   135k|  if (num_bits < nbt) {
  ------------------
  |  Branch (268:7): [True: 100k, False: 34.6k]
  ------------------
  269|   100k|    nbt = num_bits;
  270|   100k|    nit = iusace_get_num_params(&indxt[0]);
  271|   100k|    ptr_index[-1] = 1;
  272|  1.70M|    for (i = 0; i < ORDER; i++) ptr_lsfq[ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  1.70M|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  1.60M|#define ORDER (16)
  ------------------
  |  Branch (272:17): [True: 1.60M, False: 100k]
  ------------------
  273|  1.23M|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (273:17): [True: 1.13M, False: 100k]
  ------------------
  274|   100k|  }
  275|       |
  276|   135k|  ptr_index += nit;
  277|   135k|  *nb_indices += nit;
  278|   135k|  *nbbits += nbt;
  279|       |
  280|   135k|  *ptr_index = 0;
  281|   135k|  ptr_index++;
  282|   135k|  *nb_indices += 1;
  283|       |
  284|   135k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[0], &ptr_lsfq[0]);
  285|       |
  286|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[0], &ptr_lsfq[0], &ptr_index[1], 0);
  287|   135k|  nbt = 2 + 8 + num_bits;
  288|   135k|  nit = 1 + iusace_get_num_params(&ptr_index[1]);
  289|       |
  290|  2.29M|  for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[-ORDER + i] + ptr_lsfq[ORDER + i]);
  ------------------
  |  |   71|  2.29M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[-ORDER + i] + ptr_lsfq[ORDER + i]);
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[-ORDER + i] + ptr_lsfq[ORDER + i]);
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
  |  Branch (290:15): [True: 2.16M, False: 135k]
  ------------------
  291|       |
  292|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[0], lsfq, indxt, 1);
  293|       |
  294|   135k|  if (num_bits < 10) {
  ------------------
  |  Branch (294:7): [True: 63.4k, False: 71.6k]
  ------------------
  295|  63.4k|    nbt = 2;
  296|  63.4k|    nit = 0;
  297|  63.4k|    ptr_index[-1] = 1;
  298|  1.07M|    for (i = 0; i < ORDER; i++) ptr_lsfq[i] = lsfq[i];
  ------------------
  |  |   71|  1.07M|#define ORDER (16)
  ------------------
  |  Branch (298:17): [True: 1.01M, False: 63.4k]
  ------------------
  299|  63.4k|  }
  300|       |
  301|  2.29M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.29M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
  |  Branch (301:15): [True: 2.16M, False: 135k]
  ------------------
  302|       |
  303|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[0], lsfq, indxt, 2);
  304|   135k|  num_bits += 1;
  305|       |
  306|   135k|  if (num_bits < nbt) {
  ------------------
  |  Branch (306:7): [True: 52.4k, False: 82.6k]
  ------------------
  307|  52.4k|    nbt = num_bits;
  308|  52.4k|    nit = iusace_get_num_params(&indxt[0]);
  309|  52.4k|    ptr_index[-1] = 2;
  310|   892k|    for (i = 0; i < ORDER; i++) ptr_lsfq[i] = lsfq[i];
  ------------------
  |  |   71|   892k|#define ORDER (16)
  ------------------
  |  Branch (310:17): [True: 839k, False: 52.4k]
  ------------------
  311|   990k|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (311:17): [True: 938k, False: 52.4k]
  ------------------
  312|  52.4k|  }
  313|       |
  314|   135k|  ptr_index += nit;
  315|   135k|  *nb_indices += nit;
  316|   135k|  *nbbits += nbt;
  317|       |
  318|   135k|  *ptr_index = 0;
  319|   135k|  ptr_index++;
  320|   135k|  *nb_indices += 1;
  321|       |
  322|   135k|  ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER]);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                ptr_index[0] = iusace_avq_first_approx_abs(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER]);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  323|       |
  324|   135k|  num_bits =
  325|   135k|      iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
                    iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], &ptr_lsfq[2 * ORDER], &ptr_index[1], 0);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  326|   135k|  nbt = 2 + 8 + num_bits;
  327|   135k|  nit = 1 + iusace_get_num_params(&ptr_index[1]);
  328|       |
  329|  2.29M|  for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[ORDER + i] + ptr_lsfq[3 * ORDER + i]);
  ------------------
  |  |   71|  2.29M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[ORDER + i] + ptr_lsfq[3 * ORDER + i]);
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = 0.5f * (ptr_lsfq[ORDER + i] + ptr_lsfq[3 * ORDER + i]);
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
  |  Branch (329:15): [True: 2.16M, False: 135k]
  ------------------
  330|       |
  331|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], lsfq, indxt, 1);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  332|   135k|  num_bits += 1;
  333|       |
  334|   135k|  if (num_bits < nbt) {
  ------------------
  |  Branch (334:7): [True: 129k, False: 5.70k]
  ------------------
  335|   129k|    nbt = num_bits;
  336|   129k|    nit = iusace_get_num_params(&indxt[0]);
  337|   129k|    ptr_index[-1] = 1;
  338|  2.20M|    for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  2.20M|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|  2.07M|#define ORDER (16)
  ------------------
  |  Branch (338:17): [True: 2.07M, False: 129k]
  ------------------
  339|  1.45M|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (339:17): [True: 1.32M, False: 129k]
  ------------------
  340|   129k|  }
  341|       |
  342|  2.29M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.29M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[ORDER + i];
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
  |  Branch (342:15): [True: 2.16M, False: 135k]
  ------------------
  343|       |
  344|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], lsfq, indxt, 2);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  345|   135k|  num_bits += 3;
  346|       |
  347|   135k|  if (num_bits < nbt) {
  ------------------
  |  Branch (347:7): [True: 6.29k, False: 128k]
  ------------------
  348|  6.29k|    nbt = num_bits;
  349|  6.29k|    nit = iusace_get_num_params(&indxt[0]);
  350|  6.29k|    ptr_index[-1] = 2;
  351|   106k|    for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   106k|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   100k|#define ORDER (16)
  ------------------
  |  Branch (351:17): [True: 100k, False: 6.29k]
  ------------------
  352|  86.5k|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (352:17): [True: 80.2k, False: 6.29k]
  ------------------
  353|  6.29k|  }
  354|       |
  355|  2.29M|  for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.29M|#define ORDER (16)
  ------------------
                for (i = 0; i < ORDER; i++) lsfq[i] = ptr_lsfq[3 * ORDER + i];
  ------------------
  |  |   71|  2.16M|#define ORDER (16)
  ------------------
  |  Branch (355:15): [True: 2.16M, False: 135k]
  ------------------
  356|       |
  357|   135k|  num_bits = iusace_avq_first_approx_rel(&ptr_lsf[2 * ORDER], lsfq, indxt, 2);
  ------------------
  |  |   71|   135k|#define ORDER (16)
  ------------------
  358|   135k|  num_bits += 3;
  359|       |
  360|   135k|  if (num_bits < nbt) {
  ------------------
  |  Branch (360:7): [True: 32.9k, False: 102k]
  ------------------
  361|  32.9k|    nbt = num_bits;
  362|  32.9k|    nit = iusace_get_num_params(&indxt[0]);
  363|  32.9k|    ptr_index[-1] = 3;
  364|   560k|    for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   560k|#define ORDER (16)
  ------------------
                  for (i = 0; i < ORDER; i++) ptr_lsfq[2 * ORDER + i] = lsfq[i];
  ------------------
  |  |   71|   527k|#define ORDER (16)
  ------------------
  |  Branch (364:17): [True: 527k, False: 32.9k]
  ------------------
  365|   567k|    for (i = 0; i < nit; i++) ptr_index[i] = indxt[i];
  ------------------
  |  Branch (365:17): [True: 534k, False: 32.9k]
  ------------------
  366|  32.9k|  }
  367|       |
  368|   135k|  *nb_indices += nit;
  369|   135k|  *nbbits += nbt;
  370|       |
  371|   135k|  return;
  372|   135k|}
iusace_lpc_avq.c:iusace_avq_first_approx_abs:
   86|   544k|static WORD32 iusace_avq_first_approx_abs(FLOAT32 *lsf, FLOAT32 *lsfq) {
   87|   544k|  WORD32 i, j, index;
   88|   544k|  FLOAT32 w[ORDER];
   89|   544k|  FLOAT32 dist_min, dist, temp;
   90|   544k|  const FLOAT32 *p_dico;
   91|       |
   92|   544k|  iusace_lsf_weight(lsf, w);
   93|       |
   94|   544k|  dist_min = 1.0e30f;
   95|   544k|  p_dico = iusace_dico_lsf_abs_8b_flt;
   96|   544k|  index = 0;
   97|       |
   98|   139M|  for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (98:15): [True: 139M, False: 544k]
  ------------------
   99|   139M|    dist = 0.0;
  100|  2.36G|    for (j = 0; j < ORDER; j++) {
  ------------------
  |  |   71|  2.36G|#define ORDER (16)
  ------------------
  |  Branch (100:17): [True: 2.23G, False: 139M]
  ------------------
  101|  2.23G|      temp = lsf[j] - *p_dico++;
  102|  2.23G|      dist += w[j] * temp * temp;
  103|  2.23G|    }
  104|   139M|    if (dist < dist_min) {
  ------------------
  |  Branch (104:9): [True: 3.79M, False: 135M]
  ------------------
  105|  3.79M|      dist_min = dist;
  106|  3.79M|      index = i;
  107|  3.79M|    }
  108|   139M|  }
  109|       |
  110|  9.25M|  for (j = 0; j < ORDER; j++) {
  ------------------
  |  |   71|  9.25M|#define ORDER (16)
  ------------------
  |  Branch (110:15): [True: 8.71M, False: 544k]
  ------------------
  111|  8.71M|    lsfq[j] = iusace_dico_lsf_abs_8b_flt[index * ORDER + j];
  ------------------
  |  |   71|  8.71M|#define ORDER (16)
  ------------------
  112|  8.71M|  }
  113|       |
  114|   544k|  return index;
  115|   544k|}
iusace_lpc_avq.c:iusace_lsf_weight:
   69|   544k|static VOID iusace_lsf_weight(FLOAT32 *lsf, FLOAT32 *ptr_w) {
   70|   544k|  WORD32 i;
   71|   544k|  FLOAT32 d[ORDER + 1];
   72|       |
   73|   544k|  d[0] = lsf[0];
   74|   544k|  d[ORDER] = FREQ_MAX - lsf[ORDER - 1];
  ------------------
  |  |   71|   544k|#define ORDER (16)
  ------------------
                d[ORDER] = FREQ_MAX - lsf[ORDER - 1];
  ------------------
  |  |  169|   544k|#define FREQ_MAX (6400.0f)
  ------------------
                d[ORDER] = FREQ_MAX - lsf[ORDER - 1];
  ------------------
  |  |   71|   544k|#define ORDER (16)
  ------------------
   75|  8.71M|  for (i = 1; i < ORDER; i++) {
  ------------------
  |  |   71|  8.71M|#define ORDER (16)
  ------------------
  |  Branch (75:15): [True: 8.16M, False: 544k]
  ------------------
   76|  8.16M|    d[i] = lsf[i] - lsf[i - 1];
   77|  8.16M|  }
   78|       |
   79|  9.25M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  9.25M|#define ORDER (16)
  ------------------
  |  Branch (79:15): [True: 8.71M, False: 544k]
  ------------------
   80|  8.71M|    ptr_w[i] = (1.0f / d[i]) + (1.0f / d[i + 1]);
   81|  8.71M|  }
   82|       |
   83|   544k|  return;
   84|   544k|}
iusace_lpc_avq.c:iusace_avq_first_approx_rel:
  118|  1.35M|                                          WORD32 mode) {
  119|  1.35M|  WORD32 i, num_bits;
  120|  1.35M|  FLOAT32 w[ORDER], x[ORDER], temp;
  121|  1.35M|  WORD32 nq, avq[ORDER];
  122|  1.35M|  FLOAT32 lsf_min;
  123|       |
  124|  1.35M|  iusace_lsf_weight_2st_flt(ptr_lsf, w, 1);
  125|       |
  126|  1.35M|  temp = 0.0f;
  127|  23.1M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  23.1M|#define ORDER (16)
  ------------------
  |  Branch (127:15): [True: 21.7M, False: 1.35M]
  ------------------
  128|  21.7M|    x[i] = (ptr_lsf[i] - ptr_lsfq[i]) / w[i];
  129|  21.7M|    temp += x[i] * x[i];
  130|  21.7M|  }
  131|       |
  132|  1.35M|  if (temp < 8.0f) {
  ------------------
  |  Branch (132:7): [True: 364k, False: 994k]
  ------------------
  133|   364k|    idx[0] = 0;
  134|   364k|    idx[1] = 0;
  135|   364k|    if ((mode == 0) || (mode == 3)) {
  ------------------
  |  Branch (135:9): [True: 30.9k, False: 333k]
  |  Branch (135:24): [True: 46.2k, False: 287k]
  ------------------
  136|  77.1k|      return (10);
  137|   287k|    } else if (mode == 1) {
  ------------------
  |  Branch (137:16): [True: 127k, False: 159k]
  ------------------
  138|   127k|      return (2);
  139|   159k|    } else {
  140|   159k|      return (6);
  141|   159k|    }
  142|   364k|  }
  143|       |
  144|   994k|  iusace_lsf_weight_2st_flt(ptr_lsfq, w, mode);
  145|       |
  146|  16.9M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  16.9M|#define ORDER (16)
  ------------------
  |  Branch (146:15): [True: 15.9M, False: 994k]
  ------------------
  147|  15.9M|    x[i] = (ptr_lsf[i] - ptr_lsfq[i]) / w[i];
  148|  15.9M|  }
  149|       |
  150|   994k|  iusace_alg_vec_quant(x, avq, idx);
  151|       |
  152|  16.9M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  16.9M|#define ORDER (16)
  ------------------
  |  Branch (152:15): [True: 15.9M, False: 994k]
  ------------------
  153|  15.9M|    ptr_lsfq[i] += (w[i] * (FLOAT32)avq[i]);
  154|  15.9M|  }
  155|       |
  156|   994k|  num_bits = 0;
  157|  2.98M|  for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (157:15): [True: 1.98M, False: 994k]
  ------------------
  158|  1.98M|    nq = idx[i];
  159|       |
  160|  1.98M|    if ((mode == 0) || (mode == 3)) {
  ------------------
  |  Branch (160:9): [True: 1.02M, False: 962k]
  |  Branch (160:24): [True: 185k, False: 776k]
  ------------------
  161|  1.21M|      num_bits += (2 + (nq * 4));
  162|  1.21M|      if (nq > 6) {
  ------------------
  |  Branch (162:11): [True: 202k, False: 1.01M]
  ------------------
  163|   202k|        num_bits += nq - 3;
  164|  1.01M|      } else if (nq > 4) {
  ------------------
  |  Branch (164:18): [True: 492k, False: 518k]
  ------------------
  165|   492k|        num_bits += nq - 4;
  166|   518k|      } else if (nq == 0) {
  ------------------
  |  Branch (166:18): [True: 120k, False: 398k]
  ------------------
  167|   120k|        num_bits += 3;
  168|   120k|      }
  169|  1.21M|    } else if (mode == 1) {
  ------------------
  |  Branch (169:16): [True: 284k, False: 492k]
  ------------------
  170|   284k|      num_bits += nq * 5;
  171|   284k|      if (nq == 0) {
  ------------------
  |  Branch (171:11): [True: 31.4k, False: 253k]
  ------------------
  172|  31.4k|        num_bits += 1;
  173|  31.4k|      }
  174|   492k|    } else {
  175|   492k|      num_bits += (2 + (nq * 4));
  176|   492k|      if (nq == 0) {
  ------------------
  |  Branch (176:11): [True: 27.2k, False: 465k]
  ------------------
  177|  27.2k|        num_bits += 1;
  178|   465k|      } else if (nq > 4) {
  ------------------
  |  Branch (178:18): [True: 138k, False: 326k]
  ------------------
  179|   138k|        num_bits += nq - 3;
  180|   138k|      }
  181|   492k|    }
  182|  1.98M|  }
  183|       |
  184|   994k|  lsf_min = LSF_GAP;
  ------------------
  |  |  173|   994k|#define LSF_GAP (50.0f)
  ------------------
  185|  16.9M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  16.9M|#define ORDER (16)
  ------------------
  |  Branch (185:15): [True: 15.9M, False: 994k]
  ------------------
  186|  15.9M|    if (ptr_lsfq[i] < lsf_min) {
  ------------------
  |  Branch (186:9): [True: 502k, False: 15.4M]
  ------------------
  187|   502k|      ptr_lsfq[i] = lsf_min;
  188|   502k|    }
  189|       |
  190|  15.9M|    lsf_min = ptr_lsfq[i] + LSF_GAP;
  ------------------
  |  |  173|  15.9M|#define LSF_GAP (50.0f)
  ------------------
  191|  15.9M|  }
  192|       |
  193|   994k|  lsf_min = FREQ_MAX - LSF_GAP;
  ------------------
  |  |  169|   994k|#define FREQ_MAX (6400.0f)
  ------------------
                lsf_min = FREQ_MAX - LSF_GAP;
  ------------------
  |  |  173|   994k|#define LSF_GAP (50.0f)
  ------------------
  194|  16.9M|  for (i = ORDER - 1; i >= 0; i--) {
  ------------------
  |  |   71|   994k|#define ORDER (16)
  ------------------
  |  Branch (194:23): [True: 15.9M, False: 994k]
  ------------------
  195|  15.9M|    if (ptr_lsfq[i] > lsf_min) {
  ------------------
  |  Branch (195:9): [True: 40.6k, False: 15.8M]
  ------------------
  196|  40.6k|      ptr_lsfq[i] = lsf_min;
  197|  40.6k|    }
  198|       |
  199|  15.9M|    lsf_min = ptr_lsfq[i] - LSF_GAP;
  ------------------
  |  |  173|  15.9M|#define LSF_GAP (50.0f)
  ------------------
  200|  15.9M|  }
  201|       |
  202|   994k|  return (num_bits);
  203|  1.35M|}
iusace_lpc_avq.c:iusace_lsf_weight_2st_flt:
   54|  2.35M|static VOID iusace_lsf_weight_2st_flt(FLOAT32 *lsfq, FLOAT32 *w, WORD32 mode) {
   55|  2.35M|  WORD32 i;
   56|  2.35M|  FLOAT32 d[ORDER + 1];
   57|       |
   58|  2.35M|  d[0] = lsfq[0];
   59|  2.35M|  d[ORDER] = FREQ_MAX - lsfq[ORDER - 1];
  ------------------
  |  |   71|  2.35M|#define ORDER (16)
  ------------------
                d[ORDER] = FREQ_MAX - lsfq[ORDER - 1];
  ------------------
  |  |  169|  2.35M|#define FREQ_MAX (6400.0f)
  ------------------
                d[ORDER] = FREQ_MAX - lsfq[ORDER - 1];
  ------------------
  |  |   71|  2.35M|#define ORDER (16)
  ------------------
   60|  37.6M|  for (i = 1; i < ORDER; i++) {
  ------------------
  |  |   71|  37.6M|#define ORDER (16)
  ------------------
  |  Branch (60:15): [True: 35.3M, False: 2.35M]
  ------------------
   61|  35.3M|    d[i] = lsfq[i] - lsfq[i - 1];
   62|  35.3M|  }
   63|       |
   64|  40.0M|  for (i = 0; i < ORDER; i++) {
  ------------------
  |  |   71|  40.0M|#define ORDER (16)
  ------------------
  |  Branch (64:15): [True: 37.6M, False: 2.35M]
  ------------------
   65|  37.6M|    w[i] = (FLOAT32)(iusace_wlsf_factor_table[mode] / (FREQ_DIV / sqrt(d[i] * d[i + 1])));
  ------------------
  |  |  170|  37.6M|#define FREQ_DIV (400.0f)
  ------------------
   66|  37.6M|  }
   67|  2.35M|}

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

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

iusace_ms_apply:
   35|   151k|                     const WORD32 *ptr_sfb_offsets, WORD32 chn, FLOAT64 *ptr_ms_spec) {
   36|   151k|  FLOAT32 *ptr_sfb_enegry_left = pstr_psy_data[chn].ptr_sfb_energy_long;
   37|   151k|  FLOAT32 *ptr_sfb_energy_right = pstr_psy_data[chn + 1].ptr_sfb_energy_long;
   38|   151k|  const FLOAT32 *ptr_sfb_energy_mid = pstr_psy_data[chn].ptr_sfb_energy_long_ms;
   39|   151k|  const FLOAT32 *ptr_sfb_energy_side = pstr_psy_data[chn + 1].ptr_sfb_energy_long_ms;
   40|   151k|  FLOAT32 *ptr_sfb_thr_left = pstr_psy_data[chn].ptr_sfb_thr_long;
   41|   151k|  FLOAT32 *ptr_sfb_thr_right = pstr_psy_data[chn + 1].ptr_sfb_thr_long;
   42|   151k|  FLOAT32 *ptr_sfb_spread_energy_left = pstr_psy_data[chn].ptr_sfb_spreaded_energy_long;
   43|   151k|  FLOAT32 *ptr_sfb_spread_energy_right = pstr_psy_data[chn + 1].ptr_sfb_spreaded_energy_long;
   44|   151k|  WORD32 sfb, sfb_offsets, j;
   45|   151k|  WORD32 grp = 0;
   46|   151k|  WORD32 ms_counter = 0;
   47|   151k|  WORD32 lr_counter = 0;
   48|       |
   49|   151k|  *ms_select = 0;
   50|       |
   51|   432k|  for (sfb = 0; sfb < sfb_count; sfb += sfb_per_group, grp++) {
  ------------------
  |  Branch (51:17): [True: 280k, False: 151k]
  ------------------
   52|  6.77M|    for (sfb_offsets = 0; sfb_offsets < max_sfb_per_grp; sfb_offsets++) {
  ------------------
  |  Branch (52:27): [True: 6.49M, False: 280k]
  ------------------
   53|  6.49M|      FLOAT32 left_right, mid_side, min_thr;
   54|  6.49M|      WORD32 use_ms;
   55|  6.49M|      ms_used[grp][sfb_offsets] = 0;
   56|       |
   57|  6.49M|      min_thr = MIN(ptr_sfb_thr_left[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]);
  ------------------
  |  |   23|  6.49M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 378k, False: 6.11M]
  |  |  ------------------
  ------------------
   58|       |
   59|  6.49M|      left_right =
   60|  6.49M|          (ptr_sfb_thr_left[sfb + sfb_offsets] /
   61|  6.49M|           MAX(ptr_sfb_enegry_left[sfb + sfb_offsets], ptr_sfb_thr_left[sfb + sfb_offsets])) *
  ------------------
  |  |   24|  6.49M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 4.46M, False: 2.03M]
  |  |  ------------------
  ------------------
   62|  6.49M|          (ptr_sfb_thr_right[sfb + sfb_offsets] /
   63|  6.49M|           max(ptr_sfb_energy_right[sfb + sfb_offsets], ptr_sfb_thr_right[sfb + sfb_offsets]));
  ------------------
  |  |   74|  6.49M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 4.44M, False: 2.04M]
  |  |  ------------------
  ------------------
   64|       |
   65|  6.49M|      mid_side = (min_thr / max(ptr_sfb_energy_mid[sfb + sfb_offsets], min_thr)) *
  ------------------
  |  |   74|  6.49M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 4.47M, False: 2.01M]
  |  |  ------------------
  ------------------
   66|  6.49M|                 (min_thr / max(ptr_sfb_energy_side[sfb + sfb_offsets], min_thr));
  ------------------
  |  |   74|  6.49M|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 1.62M, False: 4.87M]
  |  |  ------------------
  ------------------
   67|       |
   68|  6.49M|      use_ms = (mid_side >= left_right);
   69|       |
   70|  6.49M|      if (use_ms) {
  ------------------
  |  Branch (70:11): [True: 6.30M, False: 193k]
  ------------------
   71|  6.30M|        ms_used[grp][sfb_offsets] = 1;
   72|       |
   73|   129M|        for (j = ptr_sfb_offsets[sfb + sfb_offsets]; j < ptr_sfb_offsets[sfb + sfb_offsets + 1];
  ------------------
  |  Branch (73:54): [True: 123M, False: 6.30M]
  ------------------
   74|   123M|             j++) {
   75|   123M|          if (ptr_ms_spec != NULL) {
  ------------------
  |  Branch (75:15): [True: 64.5M, False: 59.0M]
  ------------------
   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|  59.0M|            FLOAT64 tmp = ptr_spec_left[j];
   80|       |
   81|  59.0M|            ptr_spec_left[j] = 0.5f * (ptr_spec_left[j] + ptr_spec_right[j]);
   82|       |
   83|  59.0M|            ptr_spec_right[j] = 0.5f * (tmp - ptr_spec_right[j]);
   84|  59.0M|          }
   85|   123M|        }
   86|       |
   87|  6.30M|        ptr_sfb_thr_left[sfb + sfb_offsets] = ptr_sfb_thr_right[sfb + sfb_offsets] = min_thr;
   88|       |
   89|  6.30M|        ptr_sfb_enegry_left[sfb + sfb_offsets] = ptr_sfb_energy_mid[sfb + sfb_offsets];
   90|  6.30M|        ptr_sfb_energy_right[sfb + sfb_offsets] = ptr_sfb_energy_side[sfb + sfb_offsets];
   91|       |
   92|  6.30M|        ptr_sfb_spread_energy_left[sfb + sfb_offsets] =
   93|  6.30M|            ptr_sfb_spread_energy_right[sfb + sfb_offsets] =
   94|  6.30M|                min(ptr_sfb_spread_energy_left[sfb + sfb_offsets],
  ------------------
  |  |   75|  6.30M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 1.22M, False: 5.07M]
  |  |  ------------------
  ------------------
   95|  6.30M|                    ptr_sfb_spread_energy_right[sfb + sfb_offsets]) *
   96|  6.30M|                0.5f;
   97|       |
   98|  6.30M|        ms_counter++;
   99|  6.30M|      } else {
  100|   193k|        ms_used[grp][sfb_offsets] = 0;
  101|   193k|        lr_counter++;
  102|   193k|      }
  103|  6.49M|    }
  104|   280k|  }
  105|       |
  106|   151k|  if (ms_counter == 0) {
  ------------------
  |  Branch (106:7): [True: 7.54k, False: 144k]
  ------------------
  107|  7.54k|    *ms_select = 0;
  108|   144k|  } else {
  109|   144k|    if (lr_counter != 0) {
  ------------------
  |  Branch (109:9): [True: 24.7k, False: 119k]
  ------------------
  110|  24.7k|      *ms_select = 1;
  111|   119k|    } else {
  112|   119k|      *ms_select = 2;
  113|   119k|    }
  114|   144k|  }
  115|   151k|  return;
  116|   151k|}
iusace_calc_ms_band_energy:
  120|   662k|                                FLOAT32 *ptr_band_energy_mid, FLOAT32 *ptr_band_energy_side) {
  121|   662k|  WORD32 i, j;
  122|       |
  123|   662k|  j = 0;
  124|  13.7M|  for (i = 0; i < num_bands; i++) {
  ------------------
  |  Branch (124:15): [True: 13.1M, False: 662k]
  ------------------
  125|  13.1M|    ptr_band_energy_mid[i] = 0.0f;
  126|  13.1M|    ptr_band_energy_side[i] = 0.0f;
  127|       |
  128|   205M|    while (j < ptr_band_offset[i + 1]) {
  ------------------
  |  Branch (128:12): [True: 192M, False: 13.1M]
  ------------------
  129|   192M|      FLOAT32 specm, specs;
  130|       |
  131|   192M|      specm = (FLOAT32)(0.5f * (ptr_spec_left[j] + ptr_spec_right[j]));
  132|   192M|      specs = (FLOAT32)(0.5f * (ptr_spec_left[j] - ptr_spec_right[j]));
  133|       |
  134|   192M|      ptr_band_energy_mid[i] += specm * specm;
  135|   192M|      ptr_band_energy_side[i] += specs * specs;
  136|       |
  137|   192M|      j++;
  138|   192M|    }
  139|  13.1M|  }
  140|       |
  141|   662k|  return;
  142|   662k|}

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

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

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

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

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

iusace_calc_window:
   29|   640k|IA_ERRORCODE iusace_calc_window(FLOAT64 **win, WORD32 win_sz, WORD32 win_sel) {
   30|   640k|  switch (win_sel) {
   31|   369k|    case WIN_SEL_0:
  ------------------
  |  |   63|   369k|#define WIN_SEL_0 0
  ------------------
  |  Branch (31:5): [True: 369k, False: 271k]
  ------------------
   32|   369k|      switch (win_sz) {
   33|   116k|        case WIN_LEN_96:
  ------------------
  |  |   36|   116k|#define WIN_LEN_96 96
  ------------------
  |  Branch (33:9): [True: 116k, False: 252k]
  ------------------
   34|   116k|          *win = (FLOAT64 *)iexheaac_sine_win_96;
   35|   116k|          break;
   36|    406|        case WIN_LEN_192:
  ------------------
  |  |   35|    406|#define WIN_LEN_192 192
  ------------------
  |  Branch (36:9): [True: 406, False: 368k]
  ------------------
   37|    406|          *win = (FLOAT64 *)iexheaac_sine_win_192;
   38|    406|          break;
   39|   241k|        case WIN_LEN_128:
  ------------------
  |  |   33|   241k|#define WIN_LEN_128 128
  ------------------
  |  Branch (39:9): [True: 241k, False: 127k]
  ------------------
   40|   241k|          *win = (FLOAT64 *)iusace_sine_win_128;
   41|   241k|          break;
   42|  1.73k|        case WIN_LEN_256:
  ------------------
  |  |   34|  1.73k|#define WIN_LEN_256 256
  ------------------
  |  Branch (42:9): [True: 1.73k, False: 367k]
  ------------------
   43|  1.73k|          *win = (FLOAT64 *)iusace_sine_win_256;
   44|  1.73k|          break;
   45|  4.62k|        case WIN_LEN_768:
  ------------------
  |  |   32|  4.62k|#define WIN_LEN_768 768
  ------------------
  |  Branch (45:9): [True: 4.62k, False: 364k]
  ------------------
   46|  4.62k|          *win = (FLOAT64 *)iexheaac_sine_win_768;
   47|  4.62k|          break;
   48|  4.42k|        case WIN_LEN_1024:
  ------------------
  |  |   31|  4.42k|#define WIN_LEN_1024 1024
  ------------------
  |  Branch (48:9): [True: 4.42k, False: 364k]
  ------------------
   49|  4.42k|          *win = (FLOAT64 *)iusace_sine_win_1024;
   50|  4.42k|          break;
   51|      0|        default:
  ------------------
  |  Branch (51:9): [True: 0, False: 369k]
  ------------------
   52|      0|          return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_LENGTH;
   53|      0|          break;
   54|   369k|      }
   55|   369k|      break;
   56|   369k|    case WIN_SEL_1:
  ------------------
  |  |   64|   271k|#define WIN_SEL_1 1
  ------------------
  |  Branch (56:5): [True: 271k, False: 369k]
  ------------------
   57|   271k|      switch (win_sz) {
   58|  1.29k|        case WIN_LEN_96:
  ------------------
  |  |   36|  1.29k|#define WIN_LEN_96 96
  ------------------
  |  Branch (58:9): [True: 1.29k, False: 269k]
  ------------------
   59|  1.29k|          *win = (FLOAT64 *)iexheaac_kbd_win_96;
   60|  1.29k|          break;
   61|      0|        case WIN_LEN_128:
  ------------------
  |  |   33|      0|#define WIN_LEN_128 128
  ------------------
  |  Branch (61:9): [True: 0, False: 271k]
  ------------------
   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: 271k]
  ------------------
   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: 271k]
  ------------------
   68|      0|          *win = (FLOAT64 *)iusace_kbd_win256;
   69|      0|          break;
   70|  54.1k|        case WIN_LEN_768:
  ------------------
  |  |   32|  54.1k|#define WIN_LEN_768 768
  ------------------
  |  Branch (70:9): [True: 54.1k, False: 217k]
  ------------------
   71|  54.1k|          *win = (FLOAT64 *)iexheaac_kbd_win_768;
   72|  54.1k|          break;
   73|   215k|        case WIN_LEN_1024:
  ------------------
  |  |   31|   215k|#define WIN_LEN_1024 1024
  ------------------
  |  Branch (73:9): [True: 215k, False: 55.4k]
  ------------------
   74|   215k|          *win = (FLOAT64 *)iusace_kbd_win1024;
   75|   215k|          break;
   76|      0|        default:
  ------------------
  |  Branch (76:9): [True: 0, False: 271k]
  ------------------
   77|      0|          return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_LENGTH;
   78|      0|          break;
   79|   271k|      }
   80|   271k|      break;
   81|       |
   82|   271k|    default:
  ------------------
  |  Branch (82:5): [True: 0, False: 640k]
  ------------------
   83|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_WINDOW_SHAPE;
   84|      0|      break;
   85|   640k|  }
   86|   640k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   640k|#define IA_NO_ERROR 0x00000000
  ------------------
   87|   640k|}
iusace_windowing_long:
   90|   193k|                           FLOAT64 *ptr_in_data, WORD32 n_long) {
   91|   193k|  WORD32 i;
   92|   193k|  FLOAT64 *ptr_win = ptr_win_long + n_long - 1;
   93|   193k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|   193k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|   193k|#define LEN_SUPERFRAME (1024)
  ------------------
   94|       |
   95|   189M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (95:15): [True: 189M, False: 193k]
  ------------------
   96|   189M|    ptr_win_buf[i] = ptr_overlap[i] * ptr_win_long[i];
   97|   189M|  }
   98|       |
   99|   193k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(ptr_overlap[0]));
  100|   193k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(ptr_overlap[0]));
  101|       |
  102|   189M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (102:15): [True: 189M, False: 193k]
  ------------------
  103|   189M|    ptr_win_buf[i + n_long] = ptr_overlap[i] * (*ptr_win--);
  104|   189M|  }
  105|       |
  106|   193k|  return;
  107|   193k|}
iusace_windowing_long_start:
  111|  44.6k|                                 WORD32 nflat_ls, FLOAT64 *ptr_win_med, WORD32 win_sz) {
  112|  44.6k|  WORD32 i;
  113|  44.6k|  FLOAT64 *ptr_win = ptr_win_buf + 2 * n_long - 1;
  114|  44.6k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|  44.6k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|  44.6k|#define LEN_SUPERFRAME (1024)
  ------------------
  115|       |
  116|  42.7M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (116:15): [True: 42.6M, False: 44.6k]
  ------------------
  117|  42.6M|    ptr_win_buf[i] = ptr_overlap[i] * ptr_win_long[i];
  118|  42.6M|  }
  119|       |
  120|  44.6k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(ptr_overlap[0]));
  121|  44.6k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(ptr_overlap[0]));
  122|  44.6k|  memcpy(ptr_win_buf + n_long, ptr_overlap, nflat_ls * sizeof(ptr_win_buf[0]));
  123|       |
  124|  44.6k|  ptr_win_med = ptr_win_med + win_sz - 1;
  125|  44.6k|  win_sz = n_long - 2 * nflat_ls;
  126|       |
  127|  5.60M|  for (i = 0; i < win_sz; i++) {
  ------------------
  |  Branch (127:15): [True: 5.56M, False: 44.6k]
  ------------------
  128|  5.56M|    ptr_win_buf[i + n_long + nflat_ls] = ptr_overlap[i + nflat_ls] * (*ptr_win_med--);
  129|  5.56M|  }
  130|       |
  131|  18.5M|  for (i = 0; i < nflat_ls; i++) {
  ------------------
  |  Branch (131:15): [True: 18.5M, False: 44.6k]
  ------------------
  132|  18.5M|    *ptr_win-- = 0;
  133|  18.5M|  }
  134|       |
  135|  44.6k|  return;
  136|  44.6k|}
iusace_windowing_long_stop:
  140|  40.6k|                                FLOAT64 *ptr_win_med, WORD32 win_sz) {
  141|  40.6k|  WORD32 i;
  142|  40.6k|  FLOAT64 *ptr_win = ptr_win_long + n_long - 1;
  143|  40.6k|  WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   69|  40.6k|#define OVERLAP_WIN_SIZE_576 (576)
  ------------------
                WORD32 data_size = (OVERLAP_WIN_SIZE_576 * n_long) / LEN_SUPERFRAME;
  ------------------
  |  |   66|  40.6k|#define LEN_SUPERFRAME (1024)
  ------------------
  144|       |
  145|  40.6k|  memset(ptr_win_buf, 0, nflat_ls * sizeof(FLOAT64));
  146|  4.92M|  for (i = 0; i < win_sz; i++) {
  ------------------
  |  Branch (146:15): [True: 4.88M, False: 40.6k]
  ------------------
  147|  4.88M|    ptr_win_buf[i + nflat_ls] = ptr_overlap[i + nflat_ls] * ptr_win_med[i];
  148|  4.88M|  }
  149|       |
  150|  40.6k|  memcpy(ptr_win_buf + nflat_ls + win_sz, ptr_overlap + nflat_ls + win_sz,
  151|  40.6k|         nflat_ls * sizeof(ptr_win_buf[0]));
  152|  40.6k|  memcpy(ptr_overlap, ptr_overlap + n_long, data_size * sizeof(ptr_overlap[0]));
  153|  40.6k|  memcpy(ptr_overlap + data_size, ptr_in_data, n_long * sizeof(ptr_overlap[0]));
  154|       |
  155|  38.8M|  for (i = 0; i < n_long; i++) {
  ------------------
  |  Branch (155:15): [True: 38.7M, False: 40.6k]
  ------------------
  156|  38.7M|    ptr_win_buf[i + n_long] = ptr_overlap[i] * (*ptr_win--);
  157|  38.7M|  }
  158|  40.6k|  return;
  159|  40.6k|}

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

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

ixheaace_allocate:
 3552|  7.22k|IA_ERRORCODE ixheaace_allocate(pVOID pv_input, pVOID pv_output) {
 3553|  7.22k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  7.22k|#define IA_NO_ERROR 0x00000000
  ------------------
 3554|  7.22k|  WORD32 ui_api_size;
 3555|  7.22k|  pVOID pv_value;
 3556|  7.22k|  ixheaace_input_config *pstr_input_config = (ixheaace_input_config *)pv_input;
 3557|  7.22k|  ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;
 3558|  7.22k|  ixheaace_api_struct *pstr_api_struct;
 3559|  7.22k|  if (1 == pstr_input_config->usac_en) {
  ------------------
  |  Branch (3559:7): [True: 4.17k, False: 3.05k]
  ------------------
 3560|  4.17k|    pstr_input_config->aot = AOT_USAC;
  ------------------
  |  |  142|  4.17k|#define AOT_USAC (42)
  ------------------
 3561|  4.17k|  }
 3562|  7.22k|  if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   37|  14.4k|#define AOT_AAC_ELD (39)
  ------------------
                if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  13.5k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3562:7): [True: 6.28k, False: 947]
  |  Branch (3562:48): [True: 5.96k, False: 320]
  ------------------
 3563|  5.96k|      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.75k, False: 210]
  |  Branch (3563:47): [True: 5.12k, False: 628]
  ------------------
 3564|  5.12k|      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.57k|#define AOT_USAC (42)
  ------------------
  |  Branch (3564:7): [True: 4.57k, False: 546]
  |  Branch (3564:43): [True: 375, False: 4.20k]
  ------------------
 3565|    375|    return IA_EXHEAACE_API_FATAL_UNSUPPORTED_AOT;
 3566|    375|  }
 3567|  6.85k|  ui_api_size = sizeof(ixheaace_api_struct);
 3568|  6.85k|  pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] =
 3569|  6.85k|      pstr_output_config->malloc_xheaace(ui_api_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   83|  6.85k|#define EIGHT_BYTE_SIZE (8)
  ------------------
                    pstr_output_config->malloc_xheaace(ui_api_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  6.85k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
 3570|  6.85k|  if (NULL == pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count]) {
  ------------------
  |  Branch (3570:7): [True: 0, False: 6.85k]
  ------------------
 3571|      0|    return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 3572|      0|  }
 3573|  6.85k|  memset(pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count], 0, ui_api_size);
 3574|       |
 3575|  6.85k|  pstr_output_config->ui_rem =
 3576|  6.85k|      (SIZE_T)((SIZE_T)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] %
 3577|  6.85k|               BYTE_ALIGN_8);
  ------------------
  |  |   30|  6.85k|#define BYTE_ALIGN_8 (8)
  ------------------
 3578|       |
 3579|  6.85k|  pstr_output_config->pv_ia_process_api_obj =
 3580|  6.85k|      (pVOID)((WORD8 *)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] +
 3581|  6.85k|              BYTE_ALIGN_8 - pstr_output_config->ui_rem);
  ------------------
  |  |   30|  6.85k|#define BYTE_ALIGN_8 (8)
  ------------------
 3582|  6.85k|  pstr_output_config->malloc_count++;
 3583|       |
 3584|  6.85k|  pstr_api_struct = (ixheaace_api_struct *)pstr_output_config->pv_ia_process_api_obj;
 3585|  6.85k|  memset(pstr_api_struct, 0, sizeof(*pstr_api_struct));
 3586|       |
 3587|  6.85k|  ixheaace_set_default_config(pstr_api_struct, pstr_input_config);
 3588|       |
 3589|  6.85k|  err_code = ixheaace_set_config_params(pstr_api_struct, pstr_input_config);
 3590|  6.85k|  if (err_code) {
  ------------------
  |  Branch (3590:7): [True: 382, False: 6.47k]
  ------------------
 3591|    382|    return err_code;
 3592|    382|  }
 3593|       |
 3594|  6.47k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.47k|#define AOT_USAC (42)
  ------------------
  |  Branch (3594:7): [True: 4.11k, False: 2.35k]
  ------------------
 3595|  4.11k|    if (pstr_api_struct->config[0].usac_config.is_loudness_configured == 0) {
  ------------------
  |  Branch (3595:9): [True: 3.56k, False: 549]
  ------------------
 3596|  3.56k|      ixheaace_get_measured_loudness_info(pstr_api_struct, pstr_input_config);
 3597|  3.56k|      memcpy(pstr_input_config->pv_drc_cfg, &pstr_api_struct->config[0].usac_config.str_drc_cfg,
 3598|  3.56k|             sizeof(ia_drc_input_config));
 3599|  3.56k|    }
 3600|  4.11k|  }
 3601|       |
 3602|  6.47k|  pstr_output_config->ui_proc_mem_tabs_size =
 3603|  6.47k|      (sizeof(ixheaace_mem_info_struct) + sizeof(pVOID *)) * 4;
 3604|  6.47k|  pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] =
 3605|  6.47k|      pstr_output_config->malloc_xheaace(
 3606|  6.47k|          pstr_output_config->ui_proc_mem_tabs_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   83|  6.47k|#define EIGHT_BYTE_SIZE (8)
  ------------------
                        pstr_output_config->ui_proc_mem_tabs_size + EIGHT_BYTE_SIZE, DEFAULT_MEM_ALIGN_8);
  ------------------
  |  |   28|  6.47k|#define DEFAULT_MEM_ALIGN_8 (8)
  ------------------
 3607|  6.47k|  if (NULL == pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count]) {
  ------------------
  |  Branch (3607:7): [True: 0, False: 6.47k]
  ------------------
 3608|      0|    return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 3609|      0|  }
 3610|  6.47k|  memset(pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count], 0,
 3611|  6.47k|         pstr_output_config->ui_proc_mem_tabs_size);
 3612|       |
 3613|  6.47k|  pstr_output_config->ui_rem =
 3614|  6.47k|      (SIZE_T)((SIZE_T)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] %
 3615|  6.47k|               BYTE_ALIGN_8);
  ------------------
  |  |   30|  6.47k|#define BYTE_ALIGN_8 (8)
  ------------------
 3616|       |
 3617|  6.47k|  pv_value =
 3618|  6.47k|      (pVOID)((WORD8 *)pstr_output_config->arr_alloc_memory[pstr_output_config->malloc_count] +
 3619|  6.47k|              BYTE_ALIGN_8 - pstr_output_config->ui_rem);
  ------------------
  |  |   30|  6.47k|#define BYTE_ALIGN_8 (8)
  ------------------
 3620|  6.47k|  if (pv_value == NULL) {
  ------------------
  |  Branch (3620:7): [True: 0, False: 6.47k]
  ------------------
 3621|      0|    return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 3622|      0|  }
 3623|  6.47k|  memset(pv_value, 0, (sizeof(ixheaace_mem_info_struct) + sizeof(pVOID *)) * 4);
 3624|       |
 3625|  6.47k|  pstr_api_struct->pstr_mem_info = (ixheaace_mem_info_struct *)pv_value;
 3626|  6.47k|  pstr_api_struct->pp_mem = (pVOID *)((WORD8 *)pv_value + sizeof(ixheaace_mem_info_struct) * 4);
 3627|       |
 3628|  6.47k|  pstr_output_config->malloc_count++;
 3629|       |
 3630|  6.47k|  ixheaace_fill_mem_tabs(pstr_api_struct, pstr_input_config->aot);
 3631|       |
 3632|  6.47k|  err_code =
 3633|  6.47k|      ixheaace_alloc_and_assign_mem(pstr_api_struct, pstr_output_config, pstr_input_config);
 3634|  6.47k|  if (err_code) {
  ------------------
  |  Branch (3634:7): [True: 0, False: 6.47k]
  ------------------
 3635|      0|    return err_code;
 3636|      0|  }
 3637|       |
 3638|  6.47k|  pstr_output_config->is_loudness_configured =
 3639|  6.47k|      pstr_api_struct->config[0].usac_config.is_loudness_configured;
 3640|       |
 3641|  6.47k|  return err_code;
 3642|  6.47k|}
ixheaace_init:
 3644|  6.47k|IA_ERRORCODE ixheaace_init(pVOID pstr_obj_ixheaace, pVOID pv_input, pVOID pv_output) {
 3645|  6.47k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  6.47k|#define IA_NO_ERROR 0x00000000
  ------------------
 3646|  6.47k|  WORD32 frame_length;
 3647|  6.47k|  WORD32 channels, ele_idx;
 3648|  6.47k|  ixheaace_api_struct *pstr_api_struct = (ixheaace_api_struct *)pstr_obj_ixheaace;
 3649|  6.47k|  ixheaace_input_config *pstr_input_config = (ixheaace_input_config *)pv_input;
 3650|  6.47k|  ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;
 3651|  6.47k|  WORD32 total_bitrate_used = 0;
 3652|  6.47k|  frame_length = pstr_input_config->frame_length;
 3653|  6.47k|  channels = 0;
 3654|  15.4k|  for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (3654:21): [True: 9.00k, False: 6.47k]
  ------------------
 3655|  9.00k|    channels += pstr_api_struct->config[ele_idx].i_channels;
 3656|  9.00k|  }
 3657|  6.47k|  pstr_api_struct->pstr_state->aot = pstr_input_config->aot;
 3658|       |
 3659|  6.47k|  if ((pstr_api_struct->config[0].use_mps == 1) &&
  ------------------
  |  Branch (3659:7): [True: 1.75k, False: 4.71k]
  ------------------
 3660|  1.75k|      (0 == pstr_api_struct->config->aac_classic ||
  ------------------
  |  Branch (3660:8): [True: 540, False: 1.21k]
  ------------------
 3661|  1.73k|       pstr_api_struct->pstr_state->aot == AOT_USAC)) {
  ------------------
  |  |  142|  1.21k|#define AOT_USAC (42)
  ------------------
  |  Branch (3661:8): [True: 1.19k, False: 16]
  ------------------
 3662|  1.73k|    pstr_api_struct->pstr_state->mps_enable = pstr_api_struct->config[0].use_mps;
 3663|  1.73k|    pstr_api_struct->pstr_state->mps_tree_config = pstr_api_struct->config[0].mps_tree_config;
 3664|  1.73k|  }
 3665|  6.47k|  if (pstr_api_struct->config[0].num_bs_elements == 1) {
  ------------------
  |  Branch (3665:7): [True: 5.35k, False: 1.12k]
  ------------------
 3666|  5.35k|    pstr_api_struct->config[ele_idx].write_program_config_element = 0;
 3667|  5.35k|  }
 3668|       |
 3669|  6.47k|  if (pstr_api_struct->pstr_state->aot != AOT_USAC) {
  ------------------
  |  |  142|  6.47k|#define AOT_USAC (42)
  ------------------
  |  Branch (3669:7): [True: 2.35k, False: 4.11k]
  ------------------
 3670|  7.20k|    for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (3670:23): [True: 4.87k, False: 2.33k]
  ------------------
 3671|       |      /* Set config pointer in api obj */
 3672|  4.87k|      pstr_api_struct->pstr_state->pstr_config[ele_idx] = &pstr_api_struct->config[ele_idx];
 3673|       |
 3674|  4.87k|      error = ia_enhaacplus_enc_init(pstr_api_struct, ele_idx);
 3675|  4.87k|      if (error) {
  ------------------
  |  Branch (3675:11): [True: 27, False: 4.84k]
  ------------------
 3676|     27|        return error;
 3677|     27|      }
 3678|       |
 3679|  4.84k|      pstr_api_struct->pstr_state->ui_init_done = 1;
 3680|  4.84k|      total_bitrate_used += pstr_api_struct->config[ele_idx].aac_config.bit_rate;
 3681|  4.84k|    }
 3682|  2.33k|    if (pstr_input_config->i_bitrate != total_bitrate_used) {
  ------------------
  |  Branch (3682:9): [True: 1.65k, False: 673]
  ------------------
 3683|  1.65k|      pstr_input_config->i_bitrate = total_bitrate_used;
 3684|  1.65k|    }
 3685|  2.33k|    if (pstr_api_struct->config[0].aac_config.bitreservoir_size != -1) {
  ------------------
  |  Branch (3685:9): [True: 2.19k, False: 136]
  ------------------
 3686|  2.19k|      WORD32 avg_bytes_per_frame_per_ch = pstr_api_struct->config[0].aac_config.bitreservoir_size;
 3687|  2.19k|      if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (3687:11): [True: 859, False: 1.33k]
  ------------------
 3688|    859|        if (pstr_api_struct->config[0].aot == AOT_AAC_LC ||
  ------------------
  |  |   34|  1.71k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3688:13): [True: 136, False: 723]
  ------------------
 3689|    723|            pstr_api_struct->config[0].aot == AOT_PS ||
  ------------------
  |  |   39|  1.58k|#define AOT_PS (29)
  ------------------
  |  Branch (3689:13): [True: 99, False: 624]
  ------------------
 3690|    624|            pstr_api_struct->config[0].aot == AOT_SBR) {
  ------------------
  |  |  141|    624|#define AOT_SBR (5)
  ------------------
  |  Branch (3690:13): [True: 184, False: 440]
  ------------------
 3691|    419|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3692|    419|                                       FRAME_LEN_960 /
  ------------------
  |  |   94|    419|#define FRAME_LEN_960 960
  ------------------
 3693|    419|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3694|    419|                                        pstr_api_struct->config[0].i_channels * 8);
 3695|    419|        }
 3696|    859|        if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  1.71k|#define AOT_AAC_LD (23)
  ------------------
                      if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|    782|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (3696:13): [True: 77, False: 782]
  |  Branch (3696:53): [True: 363, False: 419]
  ------------------
 3697|    440|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3698|    440|                                       FRAME_LEN_480 /
  ------------------
  |  |   93|    440|#define FRAME_LEN_480 480
  ------------------
 3699|    440|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3700|    440|                                        pstr_api_struct->config[0].i_channels * 8);
 3701|    440|        }
 3702|  1.33k|      } else {
 3703|  1.33k|        if (pstr_api_struct->config[0].aot == AOT_AAC_LC ||
  ------------------
  |  |   34|  2.67k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3703:13): [True: 157, False: 1.17k]
  ------------------
 3704|  1.17k|            pstr_api_struct->config[0].aot == AOT_PS ||
  ------------------
  |  |   39|  2.51k|#define AOT_PS (29)
  ------------------
  |  Branch (3704:13): [True: 144, False: 1.03k]
  ------------------
 3705|  1.03k|            pstr_api_struct->config[0].aot == AOT_SBR) {
  ------------------
  |  |  141|  1.03k|#define AOT_SBR (5)
  ------------------
  |  Branch (3705:13): [True: 490, False: 544]
  ------------------
 3706|    791|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3707|    791|                                       FRAME_LEN_1024 /
  ------------------
  |  |   91|    791|#define FRAME_LEN_1024 1024
  ------------------
 3708|    791|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3709|    791|                                        pstr_api_struct->config[0].i_channels * 8);
 3710|    791|        }
 3711|  1.33k|        if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  2.67k|#define AOT_AAC_LD (23)
  ------------------
                      if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.20k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (3711:13): [True: 127, False: 1.20k]
  |  Branch (3711:53): [True: 417, False: 791]
  ------------------
 3712|    544|          avg_bytes_per_frame_per_ch = (pstr_api_struct->config[0].aac_config.bit_rate) *
 3713|    544|                                       FRAME_LEN_512 /
  ------------------
  |  |   92|    544|#define FRAME_LEN_512 512
  ------------------
 3714|    544|                                       (pstr_api_struct->config[0].aac_config.core_sample_rate *
 3715|    544|                                        pstr_api_struct->config[0].i_channels * 8);
 3716|    544|        }
 3717|  1.33k|      }
 3718|       |
 3719|  2.19k|      if (pstr_api_struct->config[0].aac_config.bitreservoir_size < avg_bytes_per_frame_per_ch) {
  ------------------
  |  Branch (3719:11): [True: 174, False: 2.02k]
  ------------------
 3720|    174|        return IA_EXHEAACE_CONFIG_NONFATAL_BITRES_SIZE_TOO_SMALL;
 3721|    174|      }
 3722|  2.19k|    }
 3723|  2.15k|    if (pstr_input_config->i_use_es) {
  ------------------
  |  Branch (3723:9): [True: 1.69k, False: 465]
  ------------------
 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.15k|    if (pstr_api_struct->config->aac_classic) {
  ------------------
  |  Branch (3737:9): [True: 639, False: 1.51k]
  ------------------
 3738|    639|      pstr_output_config->input_size =
 3739|    639|          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.15k|    pstr_output_config->samp_freq = pstr_api_struct->config[0].native_sample_rate;
 3745|  2.15k|    pstr_output_config->header_samp_freq = pstr_api_struct->config[0].aac_config.core_sample_rate;
 3746|  2.15k|    pstr_output_config->down_sampling_ratio =
 3747|  2.15k|        pstr_api_struct->config->aac_classic == 0 ? 2.0f : 1.0f;
  ------------------
  |  Branch (3747:9): [True: 1.51k, False: 639]
  ------------------
 3748|  2.15k|    switch (pstr_api_struct->config->aot) {
 3749|    283|      case AOT_AAC_LC:
  ------------------
  |  |   34|    283|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (3749:7): [True: 283, False: 1.87k]
  ------------------
 3750|    283|        pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_LC_L5;
  ------------------
  |  |   43|    283|#define AUDIO_PROFILE_AAC_LC_L5 (0x2B)
  ------------------
 3751|    283|        break;
 3752|    723|      case AOT_SBR:
  ------------------
  |  |  141|    723|#define AOT_SBR (5)
  ------------------
  |  Branch (3752:7): [True: 723, False: 1.43k]
  ------------------
 3753|    723|        pstr_output_config->audio_profile = AUDIO_PROFILE_HEAAC_L5;
  ------------------
  |  |   44|    723|#define AUDIO_PROFILE_HEAAC_L5 (0x2F)
  ------------------
 3754|    723|        break;
 3755|    209|      case AOT_PS:
  ------------------
  |  |   39|    209|#define AOT_PS (29)
  ------------------
  |  Branch (3755:7): [True: 209, False: 1.94k]
  ------------------
 3756|    209|        pstr_output_config->audio_profile = AUDIO_PROFILE_HEAAC_V2_L5;
  ------------------
  |  |   45|    209|#define AUDIO_PROFILE_HEAAC_V2_L5 (0x33)
  ------------------
 3757|    209|        break;
 3758|    155|      case AOT_AAC_LD:
  ------------------
  |  |   36|    155|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (3758:7): [True: 155, False: 2.00k]
  ------------------
 3759|    155|        pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_LD_L4;
  ------------------
  |  |   46|    155|#define AUDIO_PROFILE_AAC_LD_L4 (0x19)
  ------------------
 3760|    155|        break;
 3761|    786|      case AOT_AAC_ELD:
  ------------------
  |  |   37|    786|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (3761:7): [True: 786, False: 1.37k]
  ------------------
 3762|    786|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (3762:13): [True: 463, False: 323]
  ------------------
 3763|    463|          if (pstr_api_struct->config[0].mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    463|#define TREE_212 (0)
  ------------------
  |  Branch (3763:15): [True: 124, False: 339]
  ------------------
 3764|    124|            pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_ELD_L2;
  ------------------
  |  |   48|    124|#define AUDIO_PROFILE_AAC_ELD_L2 (0x4D)
  ------------------
 3765|    339|          } else {
 3766|    339|            pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_ELD_L4;
  ------------------
  |  |   49|    339|#define AUDIO_PROFILE_AAC_ELD_L4 (0x4F)
  ------------------
 3767|    339|          }
 3768|    463|        } else {
 3769|    323|          pstr_output_config->audio_profile = AUDIO_PROFILE_AAC_ELD_L1;
  ------------------
  |  |   47|    323|#define AUDIO_PROFILE_AAC_ELD_L1 (0x4C)
  ------------------
 3770|    323|        }
 3771|    786|        break;
 3772|      0|      default:
  ------------------
  |  Branch (3772:7): [True: 0, False: 2.15k]
  ------------------
 3773|      0|        pstr_output_config->audio_profile = AUDIO_PROFILE_NOT_SPECIFIED;
  ------------------
  |  |   51|      0|#define AUDIO_PROFILE_NOT_SPECIFIED (0xFE)
  ------------------
 3774|      0|        break;
 3775|  2.15k|    }
 3776|  2.15k|  }
 3777|       |
 3778|  4.11k|  else {
 3779|  4.11k|    pstr_api_struct->pstr_state->pstr_config[0] = &pstr_api_struct->config[0];
 3780|  4.11k|    error = ia_usac_enc_init(pstr_api_struct, pstr_input_config->ccfl_idx);
 3781|  4.11k|    if (error) {
  ------------------
  |  Branch (3781:9): [True: 857, False: 3.25k]
  ------------------
 3782|    857|      return error;
 3783|    857|    }
 3784|       |
 3785|  3.25k|    pstr_output_config->input_size =
 3786|  3.25k|        frame_length * channels * (pstr_api_struct->config[0].usac_config.ui_pcm_wd_sz >> 3);
 3787|       |
 3788|  3.25k|    if (pstr_api_struct->config[0].usac_config.use_drc_element) {
  ------------------
  |  Branch (3788:9): [True: 620, False: 2.63k]
  ------------------
 3789|    620|      ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)(pstr_input_config->pv_drc_cfg);
 3790|    620|      memcpy(pstr_drc_cfg, &pstr_api_struct->config[0].usac_config.str_drc_cfg,
 3791|    620|             sizeof(ia_drc_input_config));
 3792|    620|    }
 3793|       |
 3794|  3.25k|    pstr_output_config->down_sampling_ratio = 1;
 3795|  3.25k|    if (pstr_api_struct->config[0].usac_config.sbr_enable == 1) {
  ------------------
  |  Branch (3795:9): [True: 2.31k, False: 947]
  ------------------
 3796|  2.31k|      switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (3796:15): [True: 2.31k, False: 0]
  ------------------
 3797|    329|        case SBR_8_3:
  ------------------
  |  |  197|    329|#define SBR_8_3 (2)
  ------------------
  |  Branch (3797:9): [True: 329, False: 1.98k]
  ------------------
 3798|    329|          pstr_output_config->input_size *= 8;
 3799|    329|          pstr_output_config->input_size /= 3;
 3800|    329|          pstr_output_config->down_sampling_ratio = 8.0f / 3.0f;
 3801|    329|          break;
 3802|       |
 3803|  1.44k|        case SBR_2_1:
  ------------------
  |  |  198|  1.44k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3803:9): [True: 1.44k, False: 865]
  ------------------
 3804|  1.44k|          pstr_output_config->input_size *= 2;
 3805|  1.44k|          pstr_output_config->down_sampling_ratio = 2;
 3806|  1.44k|          break;
 3807|       |
 3808|    536|        case SBR_4_1:
  ------------------
  |  |  199|    536|#define SBR_4_1 (4)
  ------------------
  |  Branch (3808:9): [True: 536, False: 1.77k]
  ------------------
 3809|    536|          pstr_output_config->input_size *= 4;
 3810|    536|          pstr_output_config->down_sampling_ratio = 4;
 3811|    536|          break;
 3812|  2.31k|      }
 3813|  2.31k|    }
 3814|  3.25k|    pstr_output_config->samp_freq = pstr_api_struct->config[0].usac_config.native_sample_rate;
 3815|  3.25k|    pstr_output_config->header_samp_freq =
 3816|  3.25k|        pstr_api_struct->config[0].usac_config.native_sample_rate;
 3817|  3.25k|    pstr_output_config->audio_profile = AUDIO_PROFILE_USAC_L2;
  ------------------
  |  |   50|  3.25k|#define AUDIO_PROFILE_USAC_L2 (0x45)
  ------------------
 3818|  3.25k|    if (pstr_input_config->use_drc_element !=
  ------------------
  |  Branch (3818:9): [True: 5, False: 3.25k]
  ------------------
 3819|  3.25k|        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.25k|    pstr_input_config->use_drc_element = pstr_api_struct->config[0].usac_config.use_drc_element;
 3823|  3.25k|  }
 3824|       |
 3825|  5.41k|  pstr_api_struct->pstr_state->ui_init_done = 1;
 3826|  5.41k|  pstr_output_config->i_out_bytes = pstr_api_struct->pstr_state->i_out_bytes;
 3827|  5.41k|  if (pstr_output_config->input_size) {
  ------------------
  |  Branch (3827:7): [True: 5.41k, False: 0]
  ------------------
 3828|  5.41k|    pstr_output_config->expected_frame_count =
 3829|  5.41k|        (pstr_input_config->aac_config.length + (pstr_output_config->input_size - 1)) /
 3830|  5.41k|        pstr_output_config->input_size;
 3831|  5.41k|    if (pstr_api_struct->config[0].usac_config.use_delay_adjustment == 1) {
  ------------------
  |  Branch (3831:9): [True: 3.11k, False: 2.30k]
  ------------------
 3832|  3.11k|      pstr_output_config->expected_frame_count -=
 3833|  3.11k|          pstr_api_struct->config[0].usac_config.num_preroll_frames;
 3834|  3.11k|    }
 3835|  5.41k|  }
 3836|       |
 3837|  5.41k|  return error;
 3838|  6.47k|}
ixheaace_create:
 3840|  7.22k|IA_ERRORCODE ixheaace_create(pVOID pv_input, pVOID pv_output) {
 3841|  7.22k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  7.22k|#define IA_NO_ERROR 0x00000000
  ------------------
 3842|  7.22k|  ixheaace_output_config *pstr_out_cfg = (ixheaace_output_config *)pv_output;
 3843|  7.22k|  err_code = ixheaace_allocate(pv_input, pv_output);
 3844|  7.22k|  if (!err_code) {
  ------------------
  |  Branch (3844:7): [True: 6.47k, False: 757]
  ------------------
 3845|  6.47k|    err_code = ixheaace_init(pstr_out_cfg->pv_ia_process_api_obj, pv_input, pv_output);
 3846|  6.47k|  }
 3847|  7.22k|  if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  7.22k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3847:7): [True: 1.64k, False: 5.58k]
  ------------------
 3848|  1.64k|    IXHEAACE_MEM_FREE(pv_output);
  ------------------
  |  |   24|  1.64k|  {                                                                                    \
  |  |   25|  1.64k|    WORD32 idx;                                                                        \
  |  |   26|  1.64k|    ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;  \
  |  |   27|  1.64k|    if (pstr_output_config->malloc_count > 0) {                                        \
  |  |  ------------------
  |  |  |  Branch (27:9): [True: 1.26k, False: 375]
  |  |  ------------------
  |  |   28|  6.95k|      for (idx = pstr_output_config->malloc_count - 1; idx >= 0; idx--) {              \
  |  |  ------------------
  |  |  |  Branch (28:56): [True: 5.68k, False: 1.26k]
  |  |  ------------------
  |  |   29|  5.68k|        if (pstr_output_config->arr_alloc_memory[idx]) {                               \
  |  |  ------------------
  |  |  |  Branch (29:13): [True: 5.68k, False: 0]
  |  |  ------------------
  |  |   30|  5.68k|          pstr_output_config->free_xheaace(pstr_output_config->arr_alloc_memory[idx]); \
  |  |   31|  5.68k|        }                                                                              \
  |  |   32|  5.68k|      }                                                                                \
  |  |   33|  1.26k|      pstr_output_config->malloc_count = 0;                                            \
  |  |   34|  1.26k|    }                                                                                  \
  |  |   35|  1.64k|  }
  ------------------
 3849|  1.64k|  }
 3850|  7.22k|  return err_code;
 3851|  7.22k|}
ixheaace_process:
 3853|   492k|IA_ERRORCODE ixheaace_process(pVOID pstr_obj_ixheaace, pVOID pv_input, pVOID pv_output) {
 3854|   492k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   492k|#define IA_NO_ERROR 0x00000000
  ------------------
 3855|   492k|  WORD32 ele_idx;
 3856|   492k|  (VOID) pv_input;
 3857|   492k|  ixheaace_api_struct *pstr_api_struct = (ixheaace_api_struct *)pstr_obj_ixheaace;
 3858|   492k|  ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;
 3859|   492k|  pstr_api_struct->pstr_state->is_quant_spec_zero = 0;
 3860|   492k|  pstr_api_struct->pstr_state->is_gain_limited = 0;
 3861|   492k|  if (!pstr_api_struct->usac_en) {
  ------------------
  |  Branch (3861:7): [True: 154k, False: 337k]
  ------------------
 3862|   420k|    for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (3862:23): [True: 302k, False: 117k]
  ------------------
 3863|   302k|      error = ia_enhaacplus_enc_execute(pstr_api_struct, ele_idx);
 3864|   302k|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   302k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3864:11): [True: 36.9k, False: 265k]
  ------------------
 3865|  36.9k|        return error;
 3866|  36.9k|      }
 3867|   302k|    }
 3868|   117k|    if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_quant_spec_zero)) {
  ------------------
  |  |   23|   117k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3868:9): [True: 117k, False: 0]
  |  Branch (3868:35): [True: 407, False: 117k]
  ------------------
 3869|    407|      error = IA_EXHEAACE_EXE_NONFATAL_QUANTIZATION_SPECTRUM_ZERO;
 3870|    407|    }
 3871|   117k|    if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_gain_limited)) {
  ------------------
  |  |   23|   117k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3871:9): [True: 117k, False: 407]
  |  Branch (3871:35): [True: 0, False: 117k]
  ------------------
 3872|      0|      error = IA_EXHEAACE_EXE_NONFATAL_QUANTIZATION_INSUFFICIENT_BITRES;
 3873|      0|    }
 3874|   337k|  } else {
 3875|   337k|    ia_usac_encoder_config_struct *usac_config = &pstr_api_struct->config[0].usac_config;
 3876|   337k|    if (usac_config->iframes_interval <= usac_config->num_preroll_frames) {
  ------------------
  |  Branch (3876:9): [True: 24.7k, False: 312k]
  ------------------
 3877|  24.7k|      pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 1;
 3878|  24.7k|      if (usac_config->iframes_interval == usac_config->num_preroll_frames &&
  ------------------
  |  Branch (3878:11): [True: 4.48k, False: 20.2k]
  ------------------
 3879|  4.48k|          usac_config->is_first_frame == 0) {
  ------------------
  |  Branch (3879:11): [True: 1.59k, False: 2.88k]
  ------------------
 3880|  1.59k|        usac_config->is_ipf = 1;
 3881|  1.59k|      }
 3882|   312k|    } else {
 3883|   312k|      pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 0;
 3884|   312k|    }
 3885|   337k|    if (pstr_api_struct->pstr_state->str_usac_enc_data.frame_count >
  ------------------
  |  Branch (3885:9): [True: 317k, False: 19.8k]
  ------------------
 3886|   337k|        usac_config->num_preroll_frames) {
 3887|   317k|      if (usac_config->iframes_interval <= usac_config->num_preroll_frames) {
  ------------------
  |  Branch (3887:11): [True: 4.86k, False: 312k]
  ------------------
 3888|  4.86k|        pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 1;
 3889|   312k|      } else {
 3890|   312k|        pstr_api_struct->pstr_state->str_usac_enc_data.usac_independency_flag = 0;
 3891|   312k|      }
 3892|   317k|    }
 3893|       |
 3894|   337k|    {
 3895|   337k|      error = iusace_process(pstr_api_struct);
 3896|   337k|      if (error & IA_FATAL_ERROR) {
  ------------------
  |  |   25|   337k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (3896:11): [True: 15.6k, False: 321k]
  ------------------
 3897|  15.6k|        pstr_output_config->i_out_bytes = 0;
 3898|  15.6k|        return error;
 3899|  15.6k|      }
 3900|   321k|      if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_quant_spec_zero)) {
  ------------------
  |  |   23|   321k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3900:11): [True: 321k, False: 0]
  |  Branch (3900:37): [True: 343, False: 321k]
  ------------------
 3901|    343|        error = IA_EXHEAACE_EXE_NONFATAL_USAC_QUANTIZATION_SPECTRUM_ZERO;
 3902|    343|      }
 3903|   321k|      if ((error == IA_NO_ERROR) && (pstr_api_struct->pstr_state->is_gain_limited)) {
  ------------------
  |  |   23|   321k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3903:11): [True: 321k, False: 343]
  |  Branch (3903:37): [True: 18, False: 321k]
  ------------------
 3904|     18|        error = IA_EXHEAACE_EXE_NONFATAL_USAC_QUANTIZATION_INSUFFICIENT_BITRES;
 3905|     18|      }
 3906|   321k|    }
 3907|       |
 3908|      0|    usac_config->iframes_interval++;
 3909|   321k|    if (usac_config->iframes_interval ==
  ------------------
  |  Branch (3909:9): [True: 1.62k, False: 320k]
  ------------------
 3910|   321k|        (usac_config->random_access_interval - usac_config->num_preroll_frames)) {
 3911|  1.62k|      usac_config->iframes_interval = 0;
 3912|  1.62k|    }
 3913|   321k|  }
 3914|   439k|  pstr_output_config->i_out_bytes = pstr_api_struct->pstr_state->i_out_bytes;
 3915|   439k|  return error;
 3916|   492k|}
ixheaace_delete:
 3918|  8.24k|IA_ERRORCODE ixheaace_delete(pVOID pv_output) {
 3919|  8.24k|  IXHEAACE_MEM_FREE(pv_output);
  ------------------
  |  |   24|  8.24k|  {                                                                                    \
  |  |   25|  8.24k|    WORD32 idx;                                                                        \
  |  |   26|  8.24k|    ixheaace_output_config *pstr_output_config = (ixheaace_output_config *)pv_output;  \
  |  |   27|  8.24k|    if (pstr_output_config->malloc_count > 0) {                                        \
  |  |  ------------------
  |  |  |  Branch (27:9): [True: 5.58k, False: 2.65k]
  |  |  ------------------
  |  |   28|  39.1k|      for (idx = pstr_output_config->malloc_count - 1; idx >= 0; idx--) {              \
  |  |  ------------------
  |  |  |  Branch (28:56): [True: 33.5k, False: 5.58k]
  |  |  ------------------
  |  |   29|  33.5k|        if (pstr_output_config->arr_alloc_memory[idx]) {                               \
  |  |  ------------------
  |  |  |  Branch (29:13): [True: 33.5k, False: 0]
  |  |  ------------------
  |  |   30|  33.5k|          pstr_output_config->free_xheaace(pstr_output_config->arr_alloc_memory[idx]); \
  |  |   31|  33.5k|        }                                                                              \
  |  |   32|  33.5k|      }                                                                                \
  |  |   33|  5.58k|      pstr_output_config->malloc_count = 0;                                            \
  |  |   34|  5.58k|    }                                                                                  \
  |  |   35|  8.24k|  }
  ------------------
 3920|  8.24k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  8.24k|#define IA_NO_ERROR 0x00000000
  ------------------
 3921|  8.24k|}
ixheaace_api.c:ixheaace_set_default_config:
  494|  6.85k|                                        ixheaace_input_config *pstr_input_config) {
  495|  6.85k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_api_struct->config[0].usac_config;
  496|  6.85k|  WORD32 i;
  497|       |
  498|  61.6k|  for (i = 0; i < MAXIMUM_BS_ELE; i++) {
  ------------------
  |  |   89|  61.6k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (498:15): [True: 54.8k, False: 6.85k]
  ------------------
  499|  54.8k|    ia_enhaacplus_enc_aac_init_default_config(&pstr_api_struct->config[i].aac_config,
  500|  54.8k|                                              pstr_input_config->aot);
  501|       |
  502|  54.8k|    pstr_api_struct->config[i].i_channels = NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   25|  54.8k|#define NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE (2)
  ------------------
  503|  54.8k|    pstr_api_struct->config[i].sample_rate = AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   26|  54.8k|#define AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (44100)
  ------------------
  504|  54.8k|    pstr_api_struct->config[i].native_sample_rate = AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   26|  54.8k|#define AAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (44100)
  ------------------
  505|  54.8k|    pstr_api_struct->config[i].i_n_memtabs = NUM_MEMTABS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   27|  54.8k|#define NUM_MEMTABS_CONFIG_PARAM_DEFAULT_VALUE (10)
  ------------------
  506|  54.8k|    pstr_api_struct->config[i].aac_classic = AAC_CLASSIC_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   28|  54.8k|#define AAC_CLASSIC_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  507|  54.8k|    pstr_api_struct->config[i].use_parametric_stereo = USE_PS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   29|  54.8k|#define USE_PS_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  508|  54.8k|    pstr_api_struct->config[i].chmode_nchannels = CHMODE_NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   30|  54.8k|#define CHMODE_NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE (2)
  ------------------
  509|  54.8k|    pstr_api_struct->config[i].chmode = CHMODE_CONFIG_PARAM_DEFAULT_VALUE; /*stereo*/
  ------------------
  |  |   31|  54.8k|#define CHMODE_CONFIG_PARAM_DEFAULT_VALUE (1)
  ------------------
  510|  54.8k|    pstr_api_struct->config[i].adts_flag = ADTS_FLAG_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   32|  54.8k|#define ADTS_FLAG_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  511|  54.8k|    pstr_api_struct->config[i].num_bs_elements = NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   38|  54.8k|#define NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE (1)
  ------------------
  512|  54.8k|    pstr_api_struct->config[i].i_channels_mask = CHANNEL_MASK_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   34|  54.8k|#define CHANNEL_MASK_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  513|  54.8k|    pstr_api_struct->config[i].i_num_coupling_chan =
  514|  54.8k|        NUM_COUPLING_CHANNEL_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   35|  54.8k|#define NUM_COUPLING_CHANNEL_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  515|  54.8k|    pstr_api_struct->config[i].element_type = ELEMENT_TYPE_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   36|  54.8k|#define ELEMENT_TYPE_CONFIG_PARAM_DEFAULT_VALUE (-1)
  ------------------
  516|  54.8k|    pstr_api_struct->config[i].element_slot = ELEMENT_SLOT_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   37|  54.8k|#define ELEMENT_SLOT_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  517|  54.8k|    pstr_api_struct->config[i].num_bs_elements = NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   38|  54.8k|#define NUM_BS_ELEMENTS_CONFIG_PARAM_DEFAULT_VALUE (1)
  ------------------
  518|  54.8k|    pstr_api_struct->config[i].element_instance_tag =
  519|  54.8k|        ELEMENT_INSTANCE_TAG_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   39|  54.8k|#define ELEMENT_INSTANCE_TAG_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  520|  54.8k|    pstr_api_struct->config[i].aac_config.calc_crc = AAC_CFG_CALC_CRC_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   40|  54.8k|#define AAC_CFG_CALC_CRC_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  521|  54.8k|    pstr_api_struct->config[i].aac_config.full_bandwidth =
  522|  54.8k|        AAC_CFG_FULL_BW_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   41|  54.8k|#define AAC_CFG_FULL_BW_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  523|  54.8k|    pstr_api_struct->config[i].eldsbr_found = ELDSBR_FOUND_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   42|  54.8k|#define ELDSBR_FOUND_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  524|  54.8k|    pstr_api_struct->config[i].use_mps = USE_MPS_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   43|  54.8k|#define USE_MPS_PARAM_DEFAULT_VALUE (0)
  ------------------
  525|  54.8k|    pstr_api_struct->config[i].mps_tree_config = USE_MPS_TREE_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   44|  54.8k|#define USE_MPS_TREE_CONFIG_PARAM_DEFAULT_VALUE (0)
  ------------------
  526|  54.8k|  }
  527|  6.85k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.85k|#define AOT_USAC (42)
  ------------------
  |  Branch (527:7): [True: 4.20k, False: 2.65k]
  ------------------
  528|  4.20k|    memset(pstr_usac_config, 0, sizeof(*pstr_usac_config));
  529|  4.20k|    pstr_usac_config->channels = NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   25|  4.20k|#define NUM_CHANNELS_CONFIG_PARAM_DEFAULT_VALUE (2)
  ------------------
  530|  4.20k|    pstr_usac_config->sample_rate = USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   48|  4.20k|#define USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (48000)
  ------------------
  531|  4.20k|    pstr_usac_config->core_sample_rate = USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   48|  4.20k|#define USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (48000)
  ------------------
  532|  4.20k|    pstr_usac_config->native_sample_rate = USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE;
  ------------------
  |  |   48|  4.20k|#define USAC_SAMP_FREQ_CONFIG_PARAM_DEFAULT_VALUE (48000)
  ------------------
  533|  4.20k|    pstr_usac_config->sbr_pvc_active = USAC_SBR_PVC_DEFAULT_VALUE;
  ------------------
  |  |   49|  4.20k|#define USAC_SBR_PVC_DEFAULT_VALUE (0)
  ------------------
  534|  4.20k|    pstr_usac_config->sbr_inter_tes_active = USAC_SBR_INTER_TES_DEFAULT_VALUE;
  ------------------
  |  |   50|  4.20k|#define USAC_SBR_INTER_TES_DEFAULT_VALUE (0)
  ------------------
  535|  4.20k|    pstr_usac_config->sbr_harmonic = USAC_SBR_HARMONIC_DEFAULT_VALUE;
  ------------------
  |  |   51|  4.20k|#define USAC_SBR_HARMONIC_DEFAULT_VALUE (0)
  ------------------
  536|  4.20k|    pstr_usac_config->bit_rate = USAC_BITRATE_DEFAULT_VALUE;
  ------------------
  |  |   57|  4.20k|#define USAC_BITRATE_DEFAULT_VALUE (96000)
  ------------------
  537|  4.20k|    pstr_usac_config->use_fill_element = USAC_FILL_ELEMENT_DEFAULT_VALUE;
  ------------------
  |  |   52|  4.20k|#define USAC_FILL_ELEMENT_DEFAULT_VALUE (1)
  ------------------
  538|  4.20k|    pstr_usac_config->use_drc_element = USAC_DRC_DEFAULT_VALUE;
  ------------------
  |  |   53|  4.20k|#define USAC_DRC_DEFAULT_VALUE (0)
  ------------------
  539|  4.20k|    pstr_usac_config->cmplx_pred_flag = USAC_COMPLEX_PREDECTION_DEFAULT_VALUE;
  ------------------
  |  |   54|  4.20k|#define USAC_COMPLEX_PREDECTION_DEFAULT_VALUE (0)
  ------------------
  540|  4.20k|    pstr_usac_config->tns_select = USAC_TNS_DEFAULT_VALUE;
  ------------------
  |  |   55|  4.20k|#define USAC_TNS_DEFAULT_VALUE (0)
  ------------------
  541|  4.20k|    pstr_usac_config->flag_noiseFilling = USAC_FLAG_NOISE_FILLING_DEFAULT_VALUE;
  ------------------
  |  |   56|  4.20k|#define USAC_FLAG_NOISE_FILLING_DEFAULT_VALUE (0)
  ------------------
  542|  4.20k|    pstr_usac_config->use_acelp_only = USAC_DEFAULT_ACELP_FLAG_VALUE;
  ------------------
  |  |   58|  4.20k|#define USAC_DEFAULT_ACELP_FLAG_VALUE (0)
  ------------------
  543|  4.20k|    pstr_usac_config->is_first_frame = USAC_FIRST_FRAME_FLAG_DEFAULT_VALUE;
  ------------------
  |  |  212|  4.20k|#define USAC_FIRST_FRAME_FLAG_DEFAULT_VALUE (1)
  ------------------
  544|  4.20k|    pstr_usac_config->num_preroll_frames = CC_NUM_PREROLL_FRAMES;
  ------------------
  |  |  211|  4.20k|#define CC_NUM_PREROLL_FRAMES (1)
  ------------------
  545|  4.20k|    pstr_usac_config->stream_id = USAC_DEFAULT_STREAM_ID_VALUE;
  ------------------
  |  |   59|  4.20k|#define USAC_DEFAULT_STREAM_ID_VALUE (0)
  ------------------
  546|  4.20k|    pstr_usac_config->use_delay_adjustment = USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE;
  ------------------
  |  |  213|  4.20k|#define USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE (1)
  ------------------
  547|  4.20k|    pstr_usac_config->is_loudness_configured = USAC_DEFAULT_MEASURED_LOUDNESS_FLAG_VALUE;
  ------------------
  |  |  214|  4.20k|#define USAC_DEFAULT_MEASURED_LOUDNESS_FLAG_VALUE (1)
  ------------------
  548|  4.20k|  }
  549|       |  /* Initialize table pointers */
  550|  6.85k|  ia_enhaacplus_enc_init_aac_tabs(&(pstr_api_struct->pstr_aac_tabs));
  551|  6.85k|  ia_enhaacplus_enc_init_sbr_tabs(&(pstr_api_struct->spectral_band_replication_tabs));
  552|  6.85k|  pstr_api_struct->common_tabs.pstr_common_tab =
  553|  6.85k|      (ixheaace_common_tables *)&ia_enhaacplus_enc_common_tab;
  554|  6.85k|}
ixheaace_api.c:ixheaace_set_config_params:
  833|  6.85k|                                               ixheaace_input_config *pstr_input_config) {
  834|  6.85k|  WORD32 ele_idx;
  835|  6.85k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  6.85k|#define IA_NO_ERROR 0x00000000
  ------------------
  836|  6.85k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_api_struct->config[0].usac_config;
  837|  6.85k|  err_code = ixheaace_validate_config_params(pstr_input_config);
  838|  6.85k|  if (err_code) {
  ------------------
  |  Branch (838:7): [True: 88, False: 6.76k]
  ------------------
  839|     88|    return err_code;
  840|     88|  }
  841|       |
  842|  6.76k|  if (pstr_input_config->ui_pcm_wd_sz != 16) {
  ------------------
  |  Branch (842:7): [True: 196, False: 6.56k]
  ------------------
  843|    196|    return (IA_EXHEAACE_CONFIG_FATAL_PCM_WDSZ);
  844|    196|  }
  845|  6.56k|  if ((pstr_input_config->aac_config.inv_quant != 0) &&
  ------------------
  |  Branch (845:7): [True: 0, False: 6.56k]
  ------------------
  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.56k|  if ((pstr_input_config->write_program_config_element != 0) &&
  ------------------
  |  Branch (850:7): [True: 0, False: 6.56k]
  ------------------
  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.56k|  if ((pstr_input_config->aac_config.f_no_stereo_preprocessing != 0) &&
  ------------------
  |  Branch (854:7): [True: 0, False: 6.56k]
  ------------------
  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.56k|  if ((pstr_input_config->aac_config.use_tns != 0) &&
  ------------------
  |  Branch (858:7): [True: 3.55k, False: 3.01k]
  ------------------
  859|  3.55k|      (pstr_input_config->aac_config.use_tns != 1)) {
  ------------------
  |  Branch (859:7): [True: 0, False: 3.55k]
  ------------------
  860|      0|    return (IA_EXHEAACE_CONFIG_FATAL_USE_TNS);
  861|      0|  }
  862|  6.56k|  if ((pstr_input_config->aac_config.full_bandwidth != 0) &&
  ------------------
  |  Branch (862:7): [True: 2.80k, False: 3.76k]
  ------------------
  863|  2.80k|      (pstr_input_config->aac_config.full_bandwidth != 1)) {
  ------------------
  |  Branch (863:7): [True: 0, False: 2.80k]
  ------------------
  864|      0|    return (IA_EXHEAACE_CONFIG_FATAL_USE_FULL_BANDWIDTH);
  865|      0|  }
  866|       |
  867|  59.1k|  for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  59.1k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (867:21): [True: 52.5k, False: 6.56k]
  ------------------
  868|  52.5k|    pstr_api_struct->config[ele_idx].aac_classic = 1;
  869|  52.5k|    pstr_api_struct->config[ele_idx].firstframe = 1;
  870|  52.5k|    pstr_api_struct->config[ele_idx].aot = pstr_input_config->aot;
  871|  52.5k|    pstr_api_struct->config[ele_idx].adts_flag = pstr_input_config->i_use_adts;
  872|  52.5k|    pstr_api_struct->config[ele_idx].sample_rate = pstr_input_config->i_samp_freq;
  873|  52.5k|    pstr_api_struct->config[ele_idx].native_sample_rate = pstr_input_config->i_native_samp_freq;
  874|       |
  875|  52.5k|    pstr_api_struct->config[ele_idx].i_channels = pstr_input_config->i_channels;
  876|  52.5k|    pstr_api_struct->config[ele_idx].i_native_channels = pstr_input_config->i_channels;
  877|  52.5k|    pstr_api_struct->config[ele_idx].i_channels_mode = pstr_input_config->i_channels;
  878|  52.5k|    pstr_api_struct->config[ele_idx].aac_config.bit_rate = pstr_input_config->i_bitrate;
  879|  52.5k|    pstr_api_struct->config[ele_idx].esbr_flag = pstr_input_config->esbr_flag;
  880|  52.5k|    pstr_api_struct->config[ele_idx].use_mps = pstr_input_config->i_use_mps;
  881|  52.5k|    pstr_api_struct->config[ele_idx].mps_tree_config = pstr_input_config->i_mps_tree_config;
  882|  52.5k|    pstr_api_struct->config[ele_idx].i_num_coupling_chan = pstr_input_config->i_num_coupling_chan;
  883|  52.5k|    pstr_api_struct->config[ele_idx].ui_pcm_wd_sz = pstr_input_config->ui_pcm_wd_sz;
  884|  52.5k|    pstr_api_struct->config[ele_idx].write_program_config_element =
  885|  52.5k|        pstr_input_config->write_program_config_element;
  886|  52.5k|    pstr_api_struct->config[ele_idx].frame_length = pstr_input_config->frame_length;
  887|  52.5k|    pstr_api_struct->config[ele_idx].aac_config.num_stereo_preprocessing =
  888|  52.5k|        pstr_input_config->aac_config.f_no_stereo_preprocessing;
  889|       |
  890|  52.5k|    pstr_api_struct->config[ele_idx].aac_config.use_tns = pstr_input_config->aac_config.use_tns;
  891|  52.5k|    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.5k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (891:9): [True: 1.97k, False: 50.5k]
  |  Branch (891:49): [True: 6.68k, False: 43.8k]
  ------------------
  892|  8.66k|      pstr_api_struct->config[ele_idx].aac_config.inv_quant =
  893|  8.66k|          pstr_input_config->aac_config.inv_quant;
  894|  8.66k|      if (pstr_input_config->frame_length == FRAME_LEN_512) {
  ------------------
  |  |   92|  8.66k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (894:11): [True: 4.71k, False: 3.95k]
  ------------------
  895|  4.71k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 0;
  896|  4.71k|      } else if (pstr_input_config->frame_length == FRAME_LEN_480) {
  ------------------
  |  |   93|  3.95k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (896:18): [True: 3.95k, False: 0]
  ------------------
  897|  3.95k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 1;
  898|  3.95k|      }
  899|  43.8k|    } else if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |   34|  87.7k|#define AOT_AAC_LC (2)
  ------------------
                  } else if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |  141|  84.2k|#define AOT_SBR (5)
  ------------------
  |  Branch (899:16): [True: 3.49k, False: 40.3k]
  |  Branch (899:56): [True: 5.60k, False: 34.7k]
  ------------------
  900|  34.7k|               pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  34.7k|#define AOT_PS (29)
  ------------------
  |  Branch (900:16): [True: 1.87k, False: 32.9k]
  ------------------
  901|  10.9k|      pstr_api_struct->config[ele_idx].aac_config.inv_quant = 0;
  902|  10.9k|      if (pstr_input_config->frame_length == FRAME_LEN_1024) {
  ------------------
  |  |   91|  10.9k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (902:11): [True: 7.31k, False: 3.66k]
  ------------------
  903|  7.31k|        pstr_api_struct->config[ele_idx].aac_config.flag_framelength_small = 0;
  904|  7.31k|      } 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.9k|    }
  908|  52.5k|    if ((AOT_SBR == pstr_input_config->aot) || (AOT_PS == pstr_input_config->aot) ||
  ------------------
  |  |  141|  52.5k|#define AOT_SBR (5)
  ------------------
                  if ((AOT_SBR == pstr_input_config->aot) || (AOT_PS == pstr_input_config->aot) ||
  ------------------
  |  |   39|  46.9k|#define AOT_PS (29)
  ------------------
  |  Branch (908:9): [True: 5.60k, False: 46.9k]
  |  Branch (908:48): [True: 1.87k, False: 45.0k]
  ------------------
  909|  45.0k|        (AOT_AAC_ELD == pstr_input_config->aot)) {
  ------------------
  |  |   37|  45.0k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (909:9): [True: 6.68k, False: 38.3k]
  ------------------
  910|  14.1k|      pstr_api_struct->config[ele_idx].aac_classic = 0;
  911|  14.1k|    }
  912|  52.5k|    if (pstr_api_struct->config[ele_idx].sample_rate < 32000) {
  ------------------
  |  Branch (912:9): [True: 11.6k, False: 40.8k]
  ------------------
  913|  11.6k|      if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (913:11): [True: 233, False: 11.4k]
  ------------------
  914|    233|        pstr_api_struct->config[ele_idx].aac_classic = 1;
  915|    233|      }
  916|  11.6k|      if (pstr_input_config->aot == AOT_SBR || pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |  141|  23.3k|#define AOT_SBR (5)
  ------------------
                    if (pstr_input_config->aot == AOT_SBR || pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  11.5k|#define AOT_PS (29)
  ------------------
  |  Branch (916:11): [True: 141, False: 11.5k]
  |  Branch (916:48): [True: 13, False: 11.5k]
  ------------------
  917|    154|        pstr_input_config->aot = AOT_AAC_LC;
  ------------------
  |  |   34|    154|#define AOT_AAC_LC (2)
  ------------------
  918|    154|      }
  919|  11.6k|      if (pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  11.6k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (919:11): [True: 79, False: 11.6k]
  ------------------
  920|     79|        pstr_input_config->aot = AOT_AAC_LD;
  ------------------
  |  |   36|     79|#define AOT_AAC_LD (23)
  ------------------
  921|     79|      }
  922|  11.6k|    }
  923|  52.5k|    pstr_api_struct->config[ele_idx].eldsbr_found =
  924|  52.5k|        !(pstr_api_struct->config[ele_idx].aac_classic);
  925|  52.5k|  }
  926|  6.56k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.56k|#define AOT_USAC (42)
  ------------------
  |  Branch (926:7): [True: 4.11k, False: 2.45k]
  ------------------
  927|  4.11k|    if (pstr_input_config->i_channels > 2) {
  ------------------
  |  Branch (927:9): [True: 0, False: 4.11k]
  ------------------
  928|      0|      return IA_EXHEAACE_CONFIG_FATAL_NUM_CHANNELS;
  929|      0|    }
  930|  4.11k|    if ((pstr_input_config->i_samp_freq < 6000) || (pstr_input_config->i_samp_freq > 96000)) {
  ------------------
  |  Branch (930:9): [True: 0, False: 4.11k]
  |  Branch (930:52): [True: 0, False: 4.11k]
  ------------------
  931|      0|      return (IA_EXHEAACE_CONFIG_FATAL_SAMP_FREQ);
  932|      0|    }
  933|  4.11k|    pstr_api_struct->usac_en = 1;
  934|       |
  935|  4.11k|    pstr_usac_config->codec_mode = pstr_input_config->codec_mode;
  936|  4.11k|    pstr_usac_config->channels = pstr_input_config->i_channels;
  937|       |
  938|  4.11k|    pstr_usac_config->core_sample_rate = pstr_input_config->i_samp_freq;
  939|  4.11k|    pstr_usac_config->sample_rate = pstr_input_config->i_samp_freq;
  940|  4.11k|    pstr_usac_config->native_sample_rate = pstr_input_config->i_native_samp_freq;
  941|       |
  942|  4.11k|    pstr_usac_config->ui_pcm_wd_sz = pstr_input_config->ui_pcm_wd_sz;
  943|  4.11k|    pstr_usac_config->ccfl_idx = pstr_input_config->ccfl_idx;
  944|  4.11k|    pstr_usac_config->bit_rate = pstr_input_config->i_bitrate;
  945|  4.11k|    pstr_usac_config->basic_bitrate = pstr_input_config->i_bitrate;
  946|  4.11k|    pstr_usac_config->tns_select = pstr_input_config->aac_config.use_tns;
  947|  4.11k|    pstr_usac_config->cmplx_pred_flag = pstr_input_config->cplx_pred;
  948|  4.11k|    pstr_usac_config->flag_noiseFilling = pstr_input_config->aac_config.noise_filling;
  949|  4.11k|    pstr_usac_config->sbr_pvc_active = pstr_input_config->pvc_active;
  950|  4.11k|    pstr_usac_config->sbr_harmonic = pstr_input_config->harmonic_sbr;
  951|  4.11k|    pstr_usac_config->hq_esbr = pstr_input_config->hq_esbr;
  952|  4.11k|    pstr_usac_config->sbr_inter_tes_active = pstr_input_config->inter_tes_active;
  953|  4.11k|    pstr_api_struct->config[0].chmode_nchannels = pstr_api_struct->config[0].i_channels;
  954|       |
  955|  4.11k|    switch (pstr_input_config->ccfl_idx) {
  956|    452|      case NO_SBR_CCFL_768:
  ------------------
  |  |  195|    452|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (956:7): [True: 452, False: 3.66k]
  ------------------
  957|    452|        pstr_usac_config->ccfl = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    452|#define LEN_SUPERFRAME_768 (768)
  ------------------
  958|    452|        pstr_usac_config->in_frame_length = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    452|#define LEN_SUPERFRAME_768 (768)
  ------------------
  959|    452|        pstr_usac_config->sbr_enable = 0;
  960|    452|        pstr_usac_config->drc_frame_size = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    452|#define LEN_SUPERFRAME_768 (768)
  ------------------
  961|    452|        break;
  962|    768|      case NO_SBR_CCFL_1024:
  ------------------
  |  |  196|    768|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (962:7): [True: 768, False: 3.34k]
  ------------------
  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|    357|      case SBR_8_3:
  ------------------
  |  |  197|    357|#define SBR_8_3 (2)
  ------------------
  |  Branch (968:7): [True: 357, False: 3.75k]
  ------------------
  969|    357|        pstr_usac_config->ccfl = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    357|#define LEN_SUPERFRAME_768 (768)
  ------------------
  970|    357|        pstr_usac_config->in_frame_length = (LEN_SUPERFRAME_768 * 8) / 3;
  ------------------
  |  |   67|    357|#define LEN_SUPERFRAME_768 (768)
  ------------------
  971|    357|        pstr_usac_config->sbr_enable = 1;
  972|    357|        pstr_usac_config->drc_frame_size = (LEN_SUPERFRAME_768 * 8) / 3;
  ------------------
  |  |   67|    357|#define LEN_SUPERFRAME_768 (768)
  ------------------
  973|    357|        break;
  974|  1.97k|      case SBR_2_1:
  ------------------
  |  |  198|  1.97k|#define SBR_2_1 (3)
  ------------------
  |  Branch (974:7): [True: 1.97k, False: 2.14k]
  ------------------
  975|  1.97k|        pstr_usac_config->ccfl = LEN_SUPERFRAME;
  ------------------
  |  |   66|  1.97k|#define LEN_SUPERFRAME (1024)
  ------------------
  976|  1.97k|        pstr_usac_config->in_frame_length = (LEN_SUPERFRAME * 2);
  ------------------
  |  |   66|  1.97k|#define LEN_SUPERFRAME (1024)
  ------------------
  977|  1.97k|        pstr_usac_config->sbr_enable = 1;
  978|  1.97k|        pstr_usac_config->drc_frame_size = (LEN_SUPERFRAME * 2);
  ------------------
  |  |   66|  1.97k|#define LEN_SUPERFRAME (1024)
  ------------------
  979|  1.97k|        break;
  980|    565|      case SBR_4_1:
  ------------------
  |  |  199|    565|#define SBR_4_1 (4)
  ------------------
  |  Branch (980:7): [True: 565, False: 3.54k]
  ------------------
  981|    565|        pstr_usac_config->ccfl = LEN_SUPERFRAME;
  ------------------
  |  |   66|    565|#define LEN_SUPERFRAME (1024)
  ------------------
  982|    565|        pstr_usac_config->in_frame_length = (LEN_SUPERFRAME * 4);
  ------------------
  |  |   66|    565|#define LEN_SUPERFRAME (1024)
  ------------------
  983|    565|        pstr_usac_config->sbr_enable = 1;
  984|    565|        pstr_usac_config->drc_frame_size = (LEN_SUPERFRAME * 4);
  ------------------
  |  |   66|    565|#define LEN_SUPERFRAME (1024)
  ------------------
  985|    565|        break;
  986|      0|      default:
  ------------------
  |  Branch (986:7): [True: 0, False: 4.11k]
  ------------------
  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.11k|    }
  993|  4.11k|    pstr_usac_config->random_access_interval = pstr_input_config->random_access_interval;
  994|  4.11k|    if (pstr_usac_config->random_access_interval > 0) {
  ------------------
  |  Branch (994:9): [True: 2.33k, False: 1.78k]
  ------------------
  995|  2.33k|      pstr_usac_config->random_access_interval =
  996|  2.33k|          (WORD32)((((WORD64)pstr_usac_config->random_access_interval *
  997|  2.33k|                     pstr_input_config->i_native_samp_freq) +
  998|  2.33k|                    (pstr_usac_config->ccfl * 1000 - 1)) /
  999|  2.33k|                   (pstr_usac_config->ccfl * 1000));
 1000|  2.33k|    }
 1001|  4.11k|    pstr_usac_config->use_delay_adjustment = pstr_input_config->use_delay_adjustment;
 1002|  4.11k|    if (pstr_usac_config->random_access_interval) {
  ------------------
  |  Branch (1002:9): [True: 4.11k, False: 0]
  ------------------
 1003|  4.11k|      pstr_usac_config->preroll_flag = 1;
 1004|  4.11k|    }
 1005|  4.11k|    if (pstr_usac_config->sbr_enable == 1) {
  ------------------
  |  Branch (1005:9): [True: 2.89k, False: 1.22k]
  ------------------
 1006|  2.89k|      pstr_usac_config->num_preroll_frames++;
 1007|  2.89k|      if (pstr_usac_config->sbr_harmonic == 1) {
  ------------------
  |  Branch (1007:11): [True: 1.43k, False: 1.45k]
  ------------------
 1008|  1.43k|        pstr_usac_config->num_preroll_frames++;
 1009|  1.43k|      }
 1010|  2.89k|    } else {
 1011|  1.22k|      if (pstr_usac_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (1011:11): [True: 1.12k, False: 93]
  ------------------
 1012|  1.12k|        pstr_usac_config->num_preroll_frames++;
 1013|  1.12k|      }
 1014|  1.22k|    }
 1015|  4.11k|    pstr_usac_config->stream_id = pstr_input_config->stream_id;
 1016|  4.11k|    if (pstr_input_config->ccfl_idx < NO_SBR_CCFL_768 || pstr_input_config->ccfl_idx > SBR_4_1) {
  ------------------
  |  |  195|  8.22k|#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.11k|#define SBR_4_1 (4)
  ------------------
  |  Branch (1016:9): [True: 0, False: 4.11k]
  |  Branch (1016:58): [True: 0, False: 4.11k]
  ------------------
 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.11k|    } else {
 1019|  4.11k|      pstr_api_struct->config[0].ccfl_idx = pstr_input_config->ccfl_idx;
 1020|  4.11k|    }
 1021|  4.11k|    if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  4.11k|#define SBR_8_3 (2)
  ------------------
  |  Branch (1021:9): [True: 357, False: 3.75k]
  ------------------
 1022|    357|      pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab =
 1023|    357|          (ixheaace_resampler_sos_table *)&iixheaace_resamp_1_to_3_filt_params;
 1024|       |
 1025|    357|      pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab =
 1026|    357|          (ixheaace_resampler_sos_table *)&iixheaace_resamp_8_to_1_filt_params;
 1027|  3.75k|    } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1) {
  ------------------
  |  |  198|  3.75k|#define SBR_2_1 (3)
  ------------------
  |  Branch (1027:16): [True: 1.97k, False: 1.78k]
  ------------------
 1028|  1.97k|      pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab =
 1029|  1.97k|          (ixheaace_resampler_table *)&ixheaace_resamp_2_to_1_iir_filt_params;
 1030|  1.97k|    } else if (pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|  1.78k|#define SBR_4_1 (4)
  ------------------
  |  Branch (1030:16): [True: 565, False: 1.22k]
  ------------------
 1031|    565|      pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab =
 1032|    565|          (ixheaace_resampler_table *)&ixheaace_resamp_4_to_1_iir_filt_params;
 1033|    565|    }
 1034|  4.11k|    pstr_usac_config->use_drc_element = pstr_input_config->use_drc_element;
 1035|  4.11k|    {
 1036|  4.11k|      ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)pstr_input_config->pv_drc_cfg;
 1037|  4.11k|      pstr_drc_cfg->str_uni_drc_config.str_channel_layout.base_ch_count =
 1038|  4.11k|          pstr_input_config->i_channels;
 1039|  4.11k|      pstr_drc_cfg->str_enc_params.sample_rate = pstr_input_config->i_samp_freq;
 1040|  4.11k|      pstr_drc_cfg->str_enc_params.domain = TIME_DOMAIN;
  ------------------
  |  |   79|  4.11k|#define TIME_DOMAIN (1)
  ------------------
 1041|  4.11k|      pstr_drc_cfg->str_uni_drc_config.sample_rate = pstr_drc_cfg->str_enc_params.sample_rate;
 1042|  4.11k|      if (pstr_usac_config->use_drc_element) {
  ------------------
  |  Branch (1042:11): [True: 1.44k, False: 2.66k]
  ------------------
 1043|  3.01k|        for (WORD32 i = 0; i < pstr_drc_cfg->str_uni_drc_config.drc_coefficients_uni_drc_count;
  ------------------
  |  Branch (1043:28): [True: 1.56k, False: 1.44k]
  ------------------
 1044|  1.56k|             i++) {
 1045|  1.56k|          for (WORD32 j = 0;
 1046|  4.26k|               j <
  ------------------
  |  Branch (1046:16): [True: 2.70k, False: 1.56k]
  ------------------
 1047|  4.26k|               pstr_drc_cfg->str_uni_drc_config.str_drc_coefficients_uni_drc[i].gain_set_count;
 1048|  2.70k|               j++) {
 1049|  2.70k|            pstr_drc_cfg->str_uni_drc_config.str_drc_coefficients_uni_drc[i]
 1050|  2.70k|                .str_gain_set_params[j]
 1051|  2.70k|                .delta_tmin =
 1052|  2.70k|                impd_drc_get_delta_t_min(pstr_drc_cfg->str_uni_drc_config.sample_rate);
 1053|  2.70k|          }
 1054|  1.56k|        }
 1055|  2.18k|        for (WORD32 i = 0; i < pstr_drc_cfg->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (1055:28): [True: 740, False: 1.44k]
  ------------------
 1056|  2.18k|                                   .drc_coefficients_uni_drc_v1_count;
 1057|  1.44k|             i++) {
 1058|  2.44k|          for (WORD32 j = 0; j < pstr_drc_cfg->str_uni_drc_config.str_uni_drc_config_ext
  ------------------
  |  Branch (1058:30): [True: 1.70k, False: 740]
  ------------------
 1059|  2.44k|                                     .str_drc_coefficients_uni_drc_v1[i]
 1060|  2.44k|                                     .gain_set_count;
 1061|  1.70k|               j++) {
 1062|  1.70k|            pstr_drc_cfg->str_uni_drc_config.str_uni_drc_config_ext
 1063|  1.70k|                .str_drc_coefficients_uni_drc_v1[i]
 1064|  1.70k|                .str_gain_set_params[j]
 1065|  1.70k|                .delta_tmin =
 1066|  1.70k|                impd_drc_get_delta_t_min(pstr_drc_cfg->str_uni_drc_config.sample_rate);
 1067|  1.70k|          }
 1068|    740|        }
 1069|  1.44k|      }
 1070|  4.11k|      pstr_usac_config->str_drc_cfg = *pstr_drc_cfg;
 1071|  4.11k|      pstr_usac_config->str_drc_cfg.str_enc_params.frame_size = pstr_usac_config->drc_frame_size;
 1072|  4.11k|      pstr_usac_config->str_drc_cfg.str_uni_drc_config.str_drc_coefficients_uni_drc
 1073|  4.11k|          ->drc_frame_size = pstr_usac_config->drc_frame_size;
 1074|  4.11k|      pstr_input_config->drc_frame_size = pstr_usac_config->drc_frame_size;
 1075|       |
 1076|  4.11k|      ia_drc_loudness_info_set_struct *pstr_enc_loudness_info_set =
 1077|  4.11k|          &pstr_usac_config->str_drc_cfg.str_enc_loudness_info_set;
 1078|       |
 1079|  4.11k|      if ((pstr_usac_config->use_drc_element &&
  ------------------
  |  Branch (1079:12): [True: 1.44k, False: 2.66k]
  ------------------
 1080|  1.44k|           ((pstr_enc_loudness_info_set->loudness_info_count != 0) ||
  ------------------
  |  Branch (1080:13): [True: 210, False: 1.23k]
  ------------------
 1081|  1.23k|            (pstr_enc_loudness_info_set->loudness_info_album_count != 0) ||
  ------------------
  |  Branch (1081:13): [True: 105, False: 1.13k]
  ------------------
 1082|  1.13k|            (pstr_enc_loudness_info_set->str_loudness_info_set_extension
  ------------------
  |  Branch (1082:13): [True: 139, False: 993]
  ------------------
 1083|  1.13k|                 .str_loudness_info_set_ext_eq.loudness_info_v1_count != 0) ||
 1084|    993|            (pstr_enc_loudness_info_set->str_loudness_info_set_extension
  ------------------
  |  Branch (1084:13): [True: 95, False: 898]
  ------------------
 1085|    993|                 .str_loudness_info_set_ext_eq.loudness_info_v1_album_count != 0)))) {
 1086|    549|        pstr_usac_config->is_loudness_configured = 1;
 1087|  3.56k|      } else {
 1088|  3.56k|        pstr_usac_config->is_loudness_configured = 0;
 1089|  3.56k|      }
 1090|  4.11k|    }
 1091|  4.11k|  } else {
 1092|  2.45k|    WORD32 max_bitreservoir_size;
 1093|  2.45k|    if ((pstr_input_config->i_channels > MAX_NUM_CORE_CODER_CHANNELS)) {
  ------------------
  |  |  115|  2.45k|#define MAX_NUM_CORE_CODER_CHANNELS (6)
  ------------------
  |  Branch (1093:9): [True: 0, False: 2.45k]
  ------------------
 1094|      0|      return (IA_EXHEAACE_CONFIG_FATAL_NUM_CHANNELS);
 1095|      0|    }
 1096|  2.45k|    if (!((pstr_input_config->i_native_samp_freq == 7350) ||
  ------------------
  |  Branch (1096:11): [True: 48, False: 2.40k]
  ------------------
 1097|  2.40k|          (pstr_input_config->i_native_samp_freq == 8000) ||
  ------------------
  |  Branch (1097:11): [True: 36, False: 2.37k]
  ------------------
 1098|  2.37k|          (pstr_input_config->i_native_samp_freq == 11025) ||
  ------------------
  |  Branch (1098:11): [True: 47, False: 2.32k]
  ------------------
 1099|  2.32k|          (pstr_input_config->i_native_samp_freq == 12000) ||
  ------------------
  |  Branch (1099:11): [True: 77, False: 2.24k]
  ------------------
 1100|  2.24k|          (pstr_input_config->i_native_samp_freq == 16000) ||
  ------------------
  |  Branch (1100:11): [True: 35, False: 2.21k]
  ------------------
 1101|  2.21k|          (pstr_input_config->i_native_samp_freq == 22050) ||
  ------------------
  |  Branch (1101:11): [True: 22, False: 2.19k]
  ------------------
 1102|  2.19k|          (pstr_input_config->i_native_samp_freq == 24000) ||
  ------------------
  |  Branch (1102:11): [True: 75, False: 2.11k]
  ------------------
 1103|  2.11k|          (pstr_input_config->i_native_samp_freq == 32000) ||
  ------------------
  |  Branch (1103:11): [True: 571, False: 1.54k]
  ------------------
 1104|  1.54k|          (pstr_input_config->i_native_samp_freq == 44100) ||
  ------------------
  |  Branch (1104:11): [True: 575, False: 969]
  ------------------
 1105|    969|          (pstr_input_config->i_native_samp_freq == 48000) ||
  ------------------
  |  Branch (1105:11): [True: 669, False: 300]
  ------------------
 1106|    300|          (pstr_input_config->i_native_samp_freq == 64000) ||
  ------------------
  |  Branch (1106:11): [True: 57, False: 243]
  ------------------
 1107|    243|          (pstr_input_config->i_native_samp_freq == 88200) ||
  ------------------
  |  Branch (1107:11): [True: 107, False: 136]
  ------------------
 1108|    136|          (pstr_input_config->i_native_samp_freq == 96000))) {
  ------------------
  |  Branch (1108:11): [True: 75, False: 61]
  ------------------
 1109|     61|      return (IA_EXHEAACE_CONFIG_FATAL_SAMP_FREQ);
 1110|     61|    }
 1111|       |
 1112|  2.39k|    if ((pstr_input_config->aot == AOT_AAC_ELD) && (pstr_input_config->i_use_mps == 1) &&
  ------------------
  |  |   37|  2.39k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1112:9): [True: 823, False: 1.57k]
  |  Branch (1112:52): [True: 540, False: 283]
  ------------------
 1113|    540|        (pstr_input_config->i_channels > 2)) {
  ------------------
  |  Branch (1113:9): [True: 386, False: 154]
  ------------------
 1114|    386|      pstr_api_struct->config[0].num_bs_elements = 1;
 1115|    386|      pstr_api_struct->config[0].i_channels = pstr_input_config->i_channels;
 1116|    386|      pstr_api_struct->config[0].i_native_channels = pstr_input_config->i_channels;
 1117|    386|      pstr_api_struct->config[0].chmode_nchannels = pstr_input_config->i_channels;
 1118|    386|      pstr_api_struct->config[0].element_type = ID_SCE;
 1119|    386|      if (pstr_api_struct->config[0].mps_tree_config == TREE_525) {
  ------------------
  |  |   42|    386|#define TREE_525 (3)
  ------------------
  |  Branch (1119:11): [True: 223, False: 163]
  ------------------
 1120|    223|        pstr_api_struct->config[0].element_type = ID_CPE;
 1121|    223|      }
 1122|    386|      pstr_api_struct->config[0].element_slot = 0;
 1123|    386|      pstr_api_struct->config[0].element_instance_tag = 0;
 1124|    386|      pstr_api_struct->config[0].aac_config.bit_rate = pstr_input_config->i_bitrate;
 1125|    386|      pstr_api_struct->config[0].use_parametric_stereo = 0;
 1126|    386|    }
 1127|  2.39k|    if (pstr_input_config->i_channels_mask == 0) {
  ------------------
  |  Branch (1127:9): [True: 1.76k, False: 634]
  ------------------
 1128|  1.76k|      ixheaace_set_default_channel_mask(&pstr_input_config->i_channels_mask,
 1129|  1.76k|                                        pstr_input_config->i_channels);
 1130|  1.76k|    }
 1131|  2.39k|    if (pstr_api_struct->config[0].aac_config.dual_mono != 1) {
  ------------------
  |  Branch (1131:9): [True: 2.39k, False: 0]
  ------------------
 1132|  2.39k|      if (pstr_input_config->aot != AOT_AAC_ELD || (pstr_input_config->i_use_mps != 1)) {
  ------------------
  |  |   37|  4.78k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1132:11): [True: 1.57k, False: 823]
  |  Branch (1132:52): [True: 283, False: 540]
  ------------------
 1133|  1.85k|        WORD32 num_bs_elements, chan_config[MAXIMUM_BS_ELE], element_type[MAXIMUM_BS_ELE],
 1134|  1.85k|            element_slot[MAXIMUM_BS_ELE], element_instance_tag[MAXIMUM_BS_ELE],
 1135|  1.85k|            bitrate[MAXIMUM_BS_ELE];
 1136|  1.85k|        if ((pstr_input_config->i_channels_mask > 0x3FFFF)) {
  ------------------
  |  Branch (1136:13): [True: 0, False: 1.85k]
  ------------------
 1137|      0|          return (IA_EXHEAACE_CONFIG_FATAL_CHANNELS_MASK);
 1138|      0|        }
 1139|  1.85k|        if (ixheaace_validate_channel_mask(pstr_input_config->i_channels_mask,
  ------------------
  |  Branch (1139:13): [True: 37, False: 1.81k]
  ------------------
 1140|  1.85k|                                           pstr_input_config->i_channels)) {
 1141|     37|          return IA_EXHEAACE_CONFIG_FATAL_CHANNELS_MASK;
 1142|     37|        }
 1143|  16.3k|        for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  16.3k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1143:27): [True: 14.5k, False: 1.81k]
  ------------------
 1144|  14.5k|          pstr_api_struct->config[ele_idx].i_channels_mask = pstr_input_config->i_channels_mask;
 1145|  14.5k|        }
 1146|  1.81k|        ia_enhaacplus_enc_find_channel_config(
 1147|  1.81k|            &num_bs_elements, chan_config, element_type, element_slot, element_instance_tag,
 1148|  1.81k|            pstr_api_struct->config[0].i_num_coupling_chan, pstr_input_config->i_channels_mask);
 1149|  6.16k|        for (ele_idx = 0; ele_idx < num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1149:27): [True: 4.34k, False: 1.81k]
  ------------------
 1150|  4.34k|          pstr_api_struct->config[ele_idx].i_channels = chan_config[ele_idx];
 1151|  4.34k|          pstr_api_struct->config[ele_idx].i_native_channels = chan_config[ele_idx];
 1152|  4.34k|          pstr_api_struct->config[ele_idx].chmode_nchannels = chan_config[ele_idx];
 1153|  4.34k|          pstr_api_struct->config[ele_idx].element_type = element_type[ele_idx];
 1154|  4.34k|          pstr_api_struct->config[ele_idx].element_slot = element_slot[ele_idx];
 1155|  4.34k|          pstr_api_struct->config[ele_idx].num_bs_elements = num_bs_elements;
 1156|  4.34k|          pstr_api_struct->config[ele_idx].element_instance_tag = element_instance_tag[ele_idx];
 1157|  4.34k|        }
 1158|       |
 1159|  1.81k|        if (pstr_api_struct->config[0].num_bs_elements > 1) {
  ------------------
  |  Branch (1159:13): [True: 1.12k, False: 697]
  ------------------
 1160|  1.12k|          ia_enhaacplus_enc_allocate_bitrate_between_channels(pstr_api_struct, bitrate,
 1161|  1.12k|                                                              pstr_input_config->i_bitrate);
 1162|       |
 1163|  4.77k|          for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1163:29): [True: 3.65k, False: 1.12k]
  ------------------
 1164|  3.65k|            pstr_api_struct->config[ele_idx].aac_config.bit_rate = bitrate[ele_idx];
 1165|  3.65k|          }
 1166|       |
 1167|  10.0k|          for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  10.0k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1167:29): [True: 8.96k, False: 1.12k]
  ------------------
 1168|  8.96k|            pstr_api_struct->config[ele_idx].use_parametric_stereo = 0;
 1169|  8.96k|          }
 1170|  1.12k|        }
 1171|  1.81k|      }
 1172|  2.39k|    } 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.35k|    if (pstr_input_config->aot == AOT_PS && pstr_input_config->i_channels == 2) {
  ------------------
  |  |   39|  4.71k|#define AOT_PS (29)
  ------------------
  |  Branch (1206:9): [True: 232, False: 2.12k]
  |  Branch (1206:45): [True: 232, False: 0]
  ------------------
 1207|    232|      pstr_api_struct->config[0].use_parametric_stereo = 1;
 1208|    232|      pstr_api_struct->config[0].chmode_nchannels = 2;
 1209|  2.12k|    } else {
 1210|  6.78k|      for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1210:25): [True: 4.65k, False: 2.12k]
  ------------------
 1211|  4.65k|        pstr_api_struct->config[ele_idx].chmode_nchannels =
 1212|  4.65k|            pstr_api_struct->config[ele_idx].i_channels;
 1213|  4.65k|      }
 1214|  2.12k|    }
 1215|       |
 1216|       |    /* Right shift by 10 as 768 is the max bit reservoir calculated for framelength 1024 */
 1217|  2.35k|    max_bitreservoir_size = (BITRESERVOIR_SIZE_CONFIG_PARAM_DEFAULT_VALUE *
  ------------------
  |  |   24|  2.35k|#define BITRESERVOIR_SIZE_CONFIG_PARAM_DEFAULT_VALUE (768)
  ------------------
 1218|  2.35k|                             pstr_api_struct->config[0].frame_length) >>
 1219|  2.35k|                            10;
 1220|  2.35k|    if ((pstr_input_config->aac_config.bitreservoir_size > max_bitreservoir_size) ||
  ------------------
  |  Branch (1220:9): [True: 1.25k, False: 1.09k]
  ------------------
 1221|  1.87k|        (pstr_input_config->aac_config.bitreservoir_size < -1)) {
  ------------------
  |  Branch (1221:9): [True: 621, False: 478]
  ------------------
 1222|  1.87k|      pstr_input_config->aac_config.bitreservoir_size = max_bitreservoir_size;
 1223|  1.87k|    }
 1224|  21.2k|    for (ele_idx = 0; ele_idx < MAXIMUM_BS_ELE; ele_idx++) {
  ------------------
  |  |   89|  21.2k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
  |  Branch (1224:23): [True: 18.8k, False: 2.35k]
  ------------------
 1225|  18.8k|      pstr_api_struct->config[ele_idx].aac_config.bitreservoir_size =
 1226|  18.8k|        pstr_input_config->aac_config.bitreservoir_size;
 1227|  18.8k|      pstr_api_struct->config[ele_idx].aac_config.full_bandwidth =
 1228|  18.8k|        pstr_input_config->aac_config.full_bandwidth;
 1229|  18.8k|    }
 1230|  2.35k|  }
 1231|       |
 1232|  6.47k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  6.47k|#define IA_NO_ERROR 0x00000000
  ------------------
 1233|  6.56k|}
ixheaace_api.c:ixheaace_validate_config_params:
  556|  6.85k|static IA_ERRORCODE ixheaace_validate_config_params(ixheaace_input_config *pstr_input_config) {
  557|  6.85k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  6.85k|#define IA_NO_ERROR 0x00000000
  ------------------
  558|  6.85k|  if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   37|  13.7k|#define AOT_AAC_ELD (39)
  ------------------
                if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  12.7k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (558:7): [True: 5.90k, False: 947]
  |  Branch (558:48): [True: 5.58k, False: 320]
  ------------------
  559|  5.58k|      pstr_input_config->aot != AOT_AAC_LD && pstr_input_config->aot != AOT_PS &&
  ------------------
  |  |   36|  12.4k|#define AOT_AAC_LD (23)
  ------------------
                    pstr_input_config->aot != AOT_AAC_LD && pstr_input_config->aot != AOT_PS &&
  ------------------
  |  |   39|  12.2k|#define AOT_PS (29)
  ------------------
  |  Branch (559:7): [True: 5.37k, False: 210]
  |  Branch (559:47): [True: 4.83k, False: 546]
  ------------------
  560|  4.83k|      pstr_input_config->aot != AOT_SBR && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  141|  11.6k|#define AOT_SBR (5)
  ------------------
                    pstr_input_config->aot != AOT_SBR && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  4.20k|#define AOT_USAC (42)
  ------------------
  |  Branch (560:7): [True: 4.20k, False: 628]
  |  Branch (560:44): [True: 0, False: 4.20k]
  ------------------
  561|      0|    pstr_input_config->aot = AOT_AAC_LC;
  ------------------
  |  |   34|      0|#define AOT_AAC_LC (2)
  ------------------
  562|      0|  }
  563|  6.85k|  pstr_input_config->i_native_samp_freq = pstr_input_config->i_samp_freq;
  564|  6.85k|  if (pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  6.85k|#define AOT_USAC (42)
  ------------------
  |  Branch (564:7): [True: 2.65k, False: 4.20k]
  ------------------
  565|  2.65k|    pstr_input_config->i_samp_freq = iusace_map_sample_rate(pstr_input_config->i_samp_freq);
  566|  4.20k|  } else {
  567|  4.20k|    err_code = iusace_validate_baseline_profile_sample_rate(pstr_input_config->i_samp_freq);
  568|  4.20k|    if (err_code) {
  ------------------
  |  Branch (568:9): [True: 88, False: 4.11k]
  ------------------
  569|     88|      return err_code;
  570|     88|    }
  571|  4.20k|  }
  572|       |
  573|  6.76k|  if ((pstr_input_config->i_channels < MIN_NUM_CORE_CODER_CHANNELS) ||
  ------------------
  |  |  116|  6.76k|#define MIN_NUM_CORE_CODER_CHANNELS (1)
  ------------------
  |  Branch (573:7): [True: 264, False: 6.50k]
  ------------------
  574|  6.50k|      (pstr_input_config->i_channels > MAX_NUM_CORE_CODER_CHANNELS)) {
  ------------------
  |  |  115|  6.50k|#define MAX_NUM_CORE_CODER_CHANNELS (6)
  ------------------
  |  Branch (574:7): [True: 311, False: 6.19k]
  ------------------
  575|    575|    pstr_input_config->i_channels = 1;
  576|    575|  }
  577|  6.76k|  if (pstr_input_config->esbr_flag != 1 && pstr_input_config->esbr_flag != 0) {
  ------------------
  |  Branch (577:7): [True: 2.56k, False: 4.20k]
  |  Branch (577:44): [True: 0, False: 2.56k]
  ------------------
  578|      0|    pstr_input_config->esbr_flag = 0;
  579|      0|  }
  580|  6.76k|  if ((pstr_input_config->esbr_flag == 1) &&
  ------------------
  |  Branch (580:7): [True: 4.20k, False: 2.56k]
  ------------------
  581|  4.20k|      ((pstr_input_config->aot != AOT_SBR) && (pstr_input_config->aot != AOT_PS) &&
  ------------------
  |  |  141|  4.20k|#define AOT_SBR (5)
  ------------------
                    ((pstr_input_config->aot != AOT_SBR) && (pstr_input_config->aot != AOT_PS) &&
  ------------------
  |  |   39|  3.70k|#define AOT_PS (29)
  ------------------
  |  Branch (581:8): [True: 3.70k, False: 494]
  |  Branch (581:47): [True: 3.34k, False: 361]
  ------------------
  582|  3.34k|       (pstr_input_config->aot != AOT_USAC))) {
  ------------------
  |  |  142|  3.34k|#define AOT_USAC (42)
  ------------------
  |  Branch (582:8): [True: 999, False: 2.34k]
  ------------------
  583|    999|    pstr_input_config->esbr_flag = 0;
  584|    999|  }
  585|  6.76k|  if (pstr_input_config->i_use_mps != 1 && pstr_input_config->i_use_mps != 0) {
  ------------------
  |  Branch (585:7): [True: 3.63k, False: 3.12k]
  |  Branch (585:44): [True: 0, False: 3.63k]
  ------------------
  586|      0|    pstr_input_config->i_use_mps = 0;
  587|      0|  }
  588|       |
  589|  6.76k|  if ((pstr_input_config->i_channels != 2) && (pstr_input_config->i_channels != 6)) {
  ------------------
  |  Branch (589:7): [True: 3.39k, False: 3.37k]
  |  Branch (589:47): [True: 2.56k, False: 824]
  ------------------
  590|  2.56k|    pstr_input_config->i_use_mps = 0;
  591|  2.56k|  }
  592|  6.76k|  if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |   37|  13.5k|#define AOT_AAC_ELD (39)
  ------------------
                if (pstr_input_config->aot != AOT_AAC_ELD && pstr_input_config->aot != AOT_USAC) {
  ------------------
  |  |  142|  5.81k|#define AOT_USAC (42)
  ------------------
  |  Branch (592:7): [True: 5.81k, False: 947]
  |  Branch (592:48): [True: 1.70k, False: 4.11k]
  ------------------
  593|  1.70k|    pstr_input_config->i_use_mps = 0;
  594|  1.70k|  }
  595|  6.76k|  if (pstr_input_config->aot == AOT_USAC && pstr_input_config->i_use_mps == 1) {
  ------------------
  |  |  142|  13.5k|#define AOT_USAC (42)
  ------------------
  |  Branch (595:7): [True: 4.11k, False: 2.65k]
  |  Branch (595:45): [True: 1.49k, False: 2.62k]
  ------------------
  596|  1.49k|    if (pstr_input_config->ccfl_idx < SBR_8_3) {
  ------------------
  |  |  197|  1.49k|#define SBR_8_3 (2)
  ------------------
  |  Branch (596:9): [True: 859, False: 632]
  ------------------
  597|    859|      pstr_input_config->ccfl_idx = SBR_2_1;
  ------------------
  |  |  198|    859|#define SBR_2_1 (3)
  ------------------
  598|    859|    }
  599|  1.49k|  }
  600|  6.76k|  if (AOT_USAC == pstr_input_config->aot) {
  ------------------
  |  |  142|  6.76k|#define AOT_USAC (42)
  ------------------
  |  Branch (600:7): [True: 4.11k, False: 2.65k]
  ------------------
  601|  4.11k|    if ((pstr_input_config->i_channels != 2) || (pstr_input_config->i_samp_freq > 48000)) {
  ------------------
  |  Branch (601:9): [True: 1.28k, False: 2.83k]
  |  Branch (601:49): [True: 744, False: 2.08k]
  ------------------
  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.02k|      pstr_input_config->i_use_mps = 0;
  605|  2.02k|    }
  606|  4.11k|  }
  607|  6.76k|  if (pstr_input_config->i_use_mps == 1) {
  ------------------
  |  Branch (607:7): [True: 1.75k, False: 5.00k]
  ------------------
  608|  1.75k|    if (pstr_input_config->i_channels == 2) {
  ------------------
  |  Branch (608:9): [True: 1.35k, False: 398]
  ------------------
  609|  1.35k|      if (pstr_input_config->i_mps_tree_config != TREE_212) {
  ------------------
  |  |   39|  1.35k|#define TREE_212 (0)
  ------------------
  |  Branch (609:11): [True: 1.32k, False: 31]
  ------------------
  610|  1.32k|        pstr_input_config->i_mps_tree_config = TREE_212;
  ------------------
  |  |   39|  1.32k|#define TREE_212 (0)
  ------------------
  611|  1.32k|      }
  612|  1.35k|    } else {
  613|    398|      if (pstr_input_config->i_mps_tree_config != TREE_5151 &&
  ------------------
  |  |   40|    796|#define TREE_5151 (1)
  ------------------
  |  Branch (613:11): [True: 397, False: 1]
  ------------------
  614|    397|          pstr_input_config->i_mps_tree_config != TREE_5152 &&
  ------------------
  |  |   41|    795|#define TREE_5152 (2)
  ------------------
  |  Branch (614:11): [True: 358, False: 39]
  ------------------
  615|    358|          pstr_input_config->i_mps_tree_config != TREE_525) {
  ------------------
  |  |   42|    358|#define TREE_525 (3)
  ------------------
  |  Branch (615:11): [True: 132, False: 226]
  ------------------
  616|    132|        pstr_input_config->i_mps_tree_config = TREE_5151;
  ------------------
  |  |   40|    132|#define TREE_5151 (1)
  ------------------
  617|    132|      }
  618|    398|    }
  619|  5.00k|  } else {
  620|  5.00k|    pstr_input_config->i_mps_tree_config = INVALID_TREE_CONFIG;
  ------------------
  |  |   43|  5.00k|#define INVALID_TREE_CONFIG (-1)
  ------------------
  621|  5.00k|  }
  622|  6.76k|  if (pstr_input_config->aot == AOT_USAC || pstr_input_config->aot == AOT_AAC_ELD ||
  ------------------
  |  |  142|  13.5k|#define AOT_USAC (42)
  ------------------
                if (pstr_input_config->aot == AOT_USAC || pstr_input_config->aot == AOT_AAC_ELD ||
  ------------------
  |  |   37|  9.41k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (622:7): [True: 4.11k, False: 2.65k]
  |  Branch (622:45): [True: 947, False: 1.70k]
  ------------------
  623|  5.27k|      pstr_input_config->aot == AOT_AAC_LD) {
  ------------------
  |  |   36|  1.70k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (623:7): [True: 210, False: 1.49k]
  ------------------
  624|  5.27k|    pstr_input_config->i_use_adts = 0;
  625|  5.27k|    pstr_input_config->i_use_es = 1;
  626|  5.27k|  }
  627|  6.76k|  if (pstr_input_config->aot == AOT_USAC) {
  ------------------
  |  |  142|  6.76k|#define AOT_USAC (42)
  ------------------
  |  Branch (627:7): [True: 4.11k, False: 2.65k]
  ------------------
  628|  4.11k|    if (pstr_input_config->codec_mode != USAC_SWITCHED &&
  ------------------
  |  |   35|  8.22k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (628:9): [True: 2.76k, False: 1.34k]
  ------------------
  629|  2.76k|        pstr_input_config->codec_mode != USAC_ONLY_FD &&
  ------------------
  |  |   36|  6.88k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (629:9): [True: 2.74k, False: 21]
  ------------------
  630|  2.74k|        pstr_input_config->codec_mode != USAC_ONLY_TD) {
  ------------------
  |  |   37|  2.74k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (630:9): [True: 2.63k, False: 108]
  ------------------
  631|  2.63k|      pstr_input_config->codec_mode = USAC_ONLY_FD;
  ------------------
  |  |   36|  2.63k|#define USAC_ONLY_FD (1)
  ------------------
  632|  2.63k|    }
  633|  4.11k|    if (pstr_input_config->ccfl_idx < NO_SBR_CCFL_768 || pstr_input_config->ccfl_idx > SBR_4_1) {
  ------------------
  |  |  195|  8.22k|#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.40k|#define SBR_4_1 (4)
  ------------------
  |  Branch (633:9): [True: 705, False: 3.40k]
  |  Branch (633:58): [True: 761, False: 2.64k]
  ------------------
  634|  1.46k|      pstr_input_config->ccfl_idx = NO_SBR_CCFL_1024;  // default value
  ------------------
  |  |  196|  1.46k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  635|  1.46k|    }
  636|  4.11k|    if ((pstr_input_config->ccfl_idx == SBR_4_1) && (pstr_input_config->i_samp_freq < 32000))
  ------------------
  |  |  199|  4.11k|#define SBR_4_1 (4)
  ------------------
  |  Branch (636:9): [True: 782, False: 3.33k]
  |  Branch (636:53): [True: 217, False: 565]
  ------------------
  637|    217|    {
  638|    217|      if (pstr_input_config->i_samp_freq >= 16000)
  ------------------
  |  Branch (638:11): [True: 164, False: 53]
  ------------------
  639|    164|      {
  640|    164|        pstr_input_config->ccfl_idx = SBR_2_1;
  ------------------
  |  |  198|    164|#define SBR_2_1 (3)
  ------------------
  641|    164|      }
  642|     53|      else
  643|     53|      {
  644|     53|        pstr_input_config->ccfl_idx = NO_SBR_CCFL_1024;
  ------------------
  |  |  196|     53|#define NO_SBR_CCFL_1024 (1)
  ------------------
  645|     53|      }
  646|    217|    }
  647|  4.11k|    if (pstr_input_config->cplx_pred != 1 && pstr_input_config->cplx_pred != 0) {
  ------------------
  |  Branch (647:9): [True: 1.51k, False: 2.59k]
  |  Branch (647:46): [True: 0, False: 1.51k]
  ------------------
  648|      0|      pstr_input_config->cplx_pred = 0;
  649|      0|    }
  650|  4.11k|    if (pstr_input_config->use_drc_element != 0 && pstr_input_config->use_drc_element != 1) {
  ------------------
  |  Branch (650:9): [True: 2.17k, False: 1.93k]
  |  Branch (650:52): [True: 0, False: 2.17k]
  ------------------
  651|      0|      pstr_input_config->use_drc_element = 0;
  652|      0|    }
  653|       |
  654|  4.11k|    if (pstr_input_config->hq_esbr != 0 && pstr_input_config->hq_esbr != 1) {
  ------------------
  |  Branch (654:9): [True: 1.62k, False: 2.48k]
  |  Branch (654:44): [True: 0, False: 1.62k]
  ------------------
  655|      0|      pstr_input_config->hq_esbr = 0;
  656|      0|    }
  657|  4.11k|    if (pstr_input_config->harmonic_sbr != 0 && pstr_input_config->harmonic_sbr != 1) {
  ------------------
  |  Branch (657:9): [True: 2.34k, False: 1.77k]
  |  Branch (657:49): [True: 0, False: 2.34k]
  ------------------
  658|      0|      pstr_input_config->harmonic_sbr = 0;
  659|      0|    }
  660|  4.11k|    if (pstr_input_config->pvc_active != 0 && pstr_input_config->pvc_active != 1) {
  ------------------
  |  Branch (660:9): [True: 1.69k, False: 2.42k]
  |  Branch (660:47): [True: 0, False: 1.69k]
  ------------------
  661|      0|      pstr_input_config->pvc_active = 0;
  662|      0|    }
  663|  4.11k|    if (pstr_input_config->inter_tes_active != 0 && pstr_input_config->inter_tes_active != 1) {
  ------------------
  |  Branch (663:9): [True: 1.60k, False: 2.51k]
  |  Branch (663:53): [True: 0, False: 1.60k]
  ------------------
  664|      0|      pstr_input_config->inter_tes_active = 0;
  665|      0|    }
  666|  4.11k|    if ((pstr_input_config->ccfl_idx != 3 && pstr_input_config->ccfl_idx != 4)) {
  ------------------
  |  Branch (666:10): [True: 2.90k, False: 1.20k]
  |  Branch (666:46): [True: 2.34k, False: 565]
  ------------------
  667|  2.34k|      pstr_input_config->harmonic_sbr = 0;
  668|  2.34k|    }
  669|  4.11k|    if (pstr_input_config->harmonic_sbr != 1) {
  ------------------
  |  Branch (669:9): [True: 2.67k, False: 1.43k]
  ------------------
  670|  2.67k|      pstr_input_config->hq_esbr = 0;
  671|  2.67k|    }
  672|  4.11k|    if (pstr_input_config->i_bitrate != 64000 && pstr_input_config->i_bitrate != 96000) {
  ------------------
  |  Branch (672:9): [True: 3.78k, False: 331]
  |  Branch (672:50): [True: 3.77k, False: 4]
  ------------------
  673|  3.77k|      pstr_input_config->i_bitrate = USAC_BITRATE_DEFAULT_VALUE;
  ------------------
  |  |   57|  3.77k|#define USAC_BITRATE_DEFAULT_VALUE (96000)
  ------------------
  674|  3.77k|    }
  675|  4.11k|    {
  676|  4.11k|      if (pstr_input_config->i_bitrate < MINIMUM_BITRATE * pstr_input_config->i_channels) {
  ------------------
  |  |   23|  4.11k|#define MINIMUM_BITRATE 8000
  ------------------
  |  Branch (676:11): [True: 0, False: 4.11k]
  ------------------
  677|      0|        pstr_input_config->i_bitrate = MINIMUM_BITRATE * pstr_input_config->i_channels;
  ------------------
  |  |   23|      0|#define MINIMUM_BITRATE 8000
  ------------------
  678|      0|      }
  679|  4.11k|      if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768 ||
  ------------------
  |  |  195|  8.22k|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (679:11): [True: 626, False: 3.48k]
  ------------------
  680|  3.48k|          pstr_input_config->ccfl_idx == NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|  3.48k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (680:11): [True: 1.53k, False: 1.95k]
  ------------------
  681|  2.16k|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (681:13): [True: 306, False: 1.85k]
  ------------------
  682|  2.16k|            (WORD32)(6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels)) {
  683|    306|          pstr_input_config->i_bitrate =
  684|    306|              (6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels);
  685|    306|        }
  686|  2.16k|      } else if (pstr_input_config->ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  1.95k|#define SBR_8_3 (2)
  ------------------
  |  Branch (686:18): [True: 183, False: 1.77k]
  ------------------
  687|    183|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (687:13): [True: 138, False: 45]
  ------------------
  688|    183|            (WORD32)(6 * ((pstr_input_config->i_samp_freq * 3) / 8) *
  689|    183|                     pstr_input_config->i_channels)) {
  690|    138|          pstr_input_config->i_bitrate =
  691|    138|              (6 * ((pstr_input_config->i_samp_freq * 3) / 8) * pstr_input_config->i_channels);
  692|    138|        }
  693|  1.77k|      } else if (pstr_input_config->ccfl_idx == SBR_2_1) {
  ------------------
  |  |  198|  1.77k|#define SBR_2_1 (3)
  ------------------
  |  Branch (693:18): [True: 1.20k, False: 565]
  ------------------
  694|  1.20k|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (694:13): [True: 109, False: 1.09k]
  ------------------
  695|  1.20k|            (WORD32)(6 * (pstr_input_config->i_samp_freq / 2) * pstr_input_config->i_channels)) {
  696|    109|          pstr_input_config->i_bitrate =
  697|    109|              (6 * (pstr_input_config->i_samp_freq / 2) * pstr_input_config->i_channels);
  698|    109|        }
  699|  1.20k|      } else if (pstr_input_config->ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|    565|#define SBR_4_1 (4)
  ------------------
  |  Branch (699:18): [True: 565, False: 0]
  ------------------
  700|    565|        if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (700:13): [True: 163, False: 402]
  ------------------
  701|    565|            (WORD32)(6 * (pstr_input_config->i_samp_freq / 4) * pstr_input_config->i_channels)) {
  702|    163|          pstr_input_config->i_bitrate =
  703|    163|              (6 * (pstr_input_config->i_samp_freq / 4) * pstr_input_config->i_channels);
  704|    163|        }
  705|    565|      }
  706|  4.11k|    }
  707|       |
  708|  4.11k|    {
  709|  4.11k|      if ((pstr_input_config->codec_mode == USAC_SWITCHED ||
  ------------------
  |  |   35|  8.22k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (709:12): [True: 1.34k, False: 2.76k]
  ------------------
  710|  2.76k|           pstr_input_config->codec_mode == USAC_ONLY_TD) && pstr_input_config->esbr_flag &&
  ------------------
  |  |   37|  2.76k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (710:12): [True: 108, False: 2.66k]
  |  Branch (710:62): [True: 896, False: 558]
  ------------------
  711|    896|          pstr_input_config->i_samp_freq > 24000) {
  ------------------
  |  Branch (711:11): [True: 725, False: 171]
  ------------------
  712|    725|        if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768) {
  ------------------
  |  |  195|    725|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (712:13): [True: 149, False: 576]
  ------------------
  713|    149|          pstr_input_config->ccfl_idx = SBR_8_3;  // Use 8:3 eSBR
  ------------------
  |  |  197|    149|#define SBR_8_3 (2)
  ------------------
  714|    149|        }
  715|    725|        if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|    725|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (715:13): [True: 143, False: 582]
  ------------------
  716|    143|          pstr_input_config->ccfl_idx = SBR_2_1;  // Use 2:1 eSBR
  ------------------
  |  |  198|    143|#define SBR_2_1 (3)
  ------------------
  717|    143|        }
  718|    725|      }
  719|       |
  720|  4.11k|      if (pstr_input_config->codec_mode == USAC_ONLY_FD &&
  ------------------
  |  |   36|  8.22k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (720:11): [True: 2.66k, False: 1.45k]
  ------------------
  721|  2.66k|          pstr_input_config->i_samp_freq > 24000 && pstr_input_config->esbr_flag &&
  ------------------
  |  Branch (721:11): [True: 1.97k, False: 687]
  |  Branch (721:53): [True: 1.06k, False: 905]
  ------------------
  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: 25, False: 1.04k]
  ------------------
  724|     25|          pstr_input_config->ccfl_idx = SBR_8_3;  // Use 8:3 eSBR
  ------------------
  |  |  197|     25|#define SBR_8_3 (2)
  ------------------
  725|     25|        }
  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: 623, False: 445]
  ------------------
  727|    623|          pstr_input_config->ccfl_idx = SBR_2_1;  // Use 2:1 eSBR
  ------------------
  |  |  198|    623|#define SBR_2_1 (3)
  ------------------
  728|    623|        }
  729|  1.06k|      }
  730|       |
  731|  4.11k|      if (pstr_input_config->ccfl_idx == NO_SBR_CCFL_768 ||
  ------------------
  |  |  195|  8.22k|#define NO_SBR_CCFL_768 (0)
  ------------------
  |  Branch (731:11): [True: 452, False: 3.66k]
  ------------------
  732|  3.66k|          pstr_input_config->ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  3.66k|#define SBR_8_3 (2)
  ------------------
  |  Branch (732:11): [True: 357, False: 3.30k]
  ------------------
  733|    809|        pstr_input_config->frame_length = LEN_SUPERFRAME_768;
  ------------------
  |  |   67|    809|#define LEN_SUPERFRAME_768 (768)
  ------------------
  734|  3.30k|      } else {
  735|  3.30k|        pstr_input_config->frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|  3.30k|#define LEN_SUPERFRAME (1024)
  ------------------
  736|  3.30k|      }
  737|  4.11k|    }
  738|  4.11k|    if (pstr_input_config->random_access_interval < MIN_RAP_INTERVAL_IN_MS) {
  ------------------
  |  |  209|  4.11k|#define MIN_RAP_INTERVAL_IN_MS (1000)
  ------------------
  |  Branch (738:9): [True: 1.78k, False: 2.33k]
  ------------------
  739|  1.78k|      pstr_input_config->random_access_interval = DEFAULT_RAP_INTERVAL_IN_MS;
  ------------------
  |  |  208|  1.78k|#define DEFAULT_RAP_INTERVAL_IN_MS (-1)
  ------------------
  740|  1.78k|    }
  741|  4.11k|    if (pstr_input_config->method_def > MAX_METHOD_DEFINITION_TYPE) {
  ------------------
  |  |  131|  4.11k|#define MAX_METHOD_DEFINITION_TYPE (9)
  ------------------
  |  Branch (741:9): [True: 3.04k, False: 1.07k]
  ------------------
  742|  3.04k|      pstr_input_config->method_def = METHOD_DEFINITION_PROGRAM_LOUDNESS;
  ------------------
  |  |   24|  3.04k|#define METHOD_DEFINITION_PROGRAM_LOUDNESS 1
  ------------------
  743|  3.04k|    }
  744|  4.11k|    if (pstr_input_config->measurement_system != MEASUREMENT_SYSTEM_BS_1770_3) {
  ------------------
  |  |   34|  4.11k|#define MEASUREMENT_SYSTEM_BS_1770_3 2
  ------------------
  |  Branch (744:9): [True: 4.11k, False: 1]
  ------------------
  745|  4.11k|      pstr_input_config->measurement_system = MEASUREMENT_SYSTEM_BS_1770_3;
  ------------------
  |  |   34|  4.11k|#define MEASUREMENT_SYSTEM_BS_1770_3 2
  ------------------
  746|  4.11k|    }
  747|  4.11k|    if (pstr_input_config->measured_loudness > MAX_METHOD_VALUE ||
  ------------------
  |  |  133|  8.22k|#define MAX_METHOD_VALUE (121.0f)
  ------------------
  |  Branch (747:9): [True: 0, False: 4.11k]
  ------------------
  748|  4.11k|        pstr_input_config->measured_loudness < MIN_METHOD_VALUE) {
  ------------------
  |  |  132|  4.11k|#define MIN_METHOD_VALUE (-116.0f)
  ------------------
  |  Branch (748:9): [True: 119, False: 3.99k]
  ------------------
  749|    119|      pstr_input_config->measured_loudness = DEFAULT_METHOD_VALUE;
  ------------------
  |  |  135|    119|#define DEFAULT_METHOD_VALUE (-31.0f)
  ------------------
  750|    119|    }
  751|  4.11k|    if (pstr_input_config->sample_peak_level > MAX_SAMPLE_PEAK_LEVEL ||
  ------------------
  |  |  126|  8.22k|#define MAX_SAMPLE_PEAK_LEVEL (20.0f)
  ------------------
  |  Branch (751:9): [True: 0, False: 4.11k]
  ------------------
  752|  4.11k|        pstr_input_config->sample_peak_level < MIN_SAMPLE_PEAK_LEVEL) {
  ------------------
  |  |  125|  4.11k|#define MIN_SAMPLE_PEAK_LEVEL (-107.0f)
  ------------------
  |  Branch (752:9): [True: 0, False: 4.11k]
  ------------------
  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.11k|    if (pstr_input_config->use_delay_adjustment != 0 &&
  ------------------
  |  Branch (755:9): [True: 3.95k, False: 157]
  ------------------
  756|  3.95k|        pstr_input_config->use_delay_adjustment != 1) {
  ------------------
  |  Branch (756:9): [True: 3.95k, False: 0]
  ------------------
  757|  3.95k|      pstr_input_config->use_delay_adjustment = USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE;
  ------------------
  |  |  213|  3.95k|#define USAC_DEFAULT_DELAY_ADJUSTMENT_VALUE (1)
  ------------------
  758|  3.95k|    }
  759|  4.11k|    if (pstr_input_config->use_drc_element) {
  ------------------
  |  Branch (759:9): [True: 2.17k, False: 1.93k]
  ------------------
  760|  2.17k|      ia_drc_input_config *pstr_drc_cfg = (ia_drc_input_config *)pstr_input_config->pv_drc_cfg;
  761|  2.17k|      err_code = impd_drc_validate_config_params(pstr_drc_cfg);
  762|  2.17k|      if (err_code & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  2.17k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (762:11): [True: 0, False: 2.17k]
  ------------------
  763|      0|        return err_code;
  764|      0|      }
  765|  2.17k|      if (err_code) {
  ------------------
  |  Branch (765:11): [True: 729, False: 1.44k]
  ------------------
  766|    729|        pstr_input_config->use_drc_element = 0;
  767|    729|        err_code = IA_NO_ERROR;
  ------------------
  |  |   23|    729|#define IA_NO_ERROR 0x00000000
  ------------------
  768|    729|      }
  769|  2.17k|    }
  770|  4.11k|  } else {
  771|  2.65k|    pstr_input_config->cplx_pred = 0;
  772|  2.65k|    pstr_input_config->harmonic_sbr = 0;
  773|  2.65k|    pstr_input_config->pvc_active = 0;
  774|  2.65k|    pstr_input_config->inter_tes_active = 0;
  775|  2.65k|    pstr_input_config->use_drc_element = 0;
  776|  2.65k|    pstr_input_config->hq_esbr = 0;
  777|  2.65k|    pstr_input_config->use_delay_adjustment = 0;
  778|  2.65k|    if (pstr_input_config->i_channels != 2 && pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  2.10k|#define AOT_PS (29)
  ------------------
  |  Branch (778:9): [True: 2.10k, False: 543]
  |  Branch (778:47): [True: 299, False: 1.80k]
  ------------------
  779|    299|      pstr_input_config->aot = AOT_SBR;
  ------------------
  |  |  141|    299|#define AOT_SBR (5)
  ------------------
  780|    299|    }
  781|  2.65k|    if (pstr_input_config->aac_config.use_tns != 1 &&
  ------------------
  |  Branch (781:9): [True: 903, False: 1.74k]
  ------------------
  782|    903|        pstr_input_config->aac_config.use_tns != 0) {
  ------------------
  |  Branch (782:9): [True: 0, False: 903]
  ------------------
  783|      0|      pstr_input_config->aac_config.use_tns = 0;
  784|      0|    }
  785|  2.65k|    if (pstr_input_config->aac_config.noise_filling != 1 &&
  ------------------
  |  Branch (785:9): [True: 1.03k, False: 1.61k]
  ------------------
  786|  1.03k|        pstr_input_config->aac_config.noise_filling != 0) {
  ------------------
  |  Branch (786:9): [True: 0, False: 1.03k]
  ------------------
  787|      0|      pstr_input_config->aac_config.noise_filling = 0;
  788|      0|    }
  789|  2.65k|    if (pstr_input_config->i_use_adts != 1 && pstr_input_config->i_use_adts != 0) {
  ------------------
  |  Branch (789:9): [True: 1.91k, False: 739]
  |  Branch (789:47): [True: 0, False: 1.91k]
  ------------------
  790|      0|      pstr_input_config->i_use_adts = 0;
  791|      0|      pstr_input_config->i_use_es = 1;
  792|      0|    }
  793|  2.65k|    if (pstr_input_config->aac_config.full_bandwidth != 1 &&
  ------------------
  |  Branch (793:9): [True: 1.61k, False: 1.03k]
  ------------------
  794|  1.61k|        pstr_input_config->aac_config.full_bandwidth != 0) {
  ------------------
  |  Branch (794:9): [True: 0, False: 1.61k]
  ------------------
  795|      0|      pstr_input_config->aac_config.full_bandwidth = 0;
  796|      0|    }
  797|  2.65k|    {
  798|  2.65k|      if (pstr_input_config->i_bitrate < MINIMUM_BITRATE * pstr_input_config->i_channels) {
  ------------------
  |  |   23|  2.65k|#define MINIMUM_BITRATE 8000
  ------------------
  |  Branch (798:11): [True: 1.31k, False: 1.33k]
  ------------------
  799|  1.31k|        pstr_input_config->i_bitrate = MINIMUM_BITRATE * pstr_input_config->i_channels;
  ------------------
  |  |   23|  1.31k|#define MINIMUM_BITRATE 8000
  ------------------
  800|  1.31k|      }
  801|  2.65k|      if (pstr_input_config->i_bitrate >
  ------------------
  |  Branch (801:11): [True: 820, False: 1.83k]
  ------------------
  802|  2.65k|          (WORD32)(6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels)) {
  803|    820|        pstr_input_config->i_bitrate =
  804|    820|            (6 * pstr_input_config->i_samp_freq * pstr_input_config->i_channels);
  805|    820|      }
  806|  2.65k|    }
  807|       |
  808|  2.65k|    {
  809|  2.65k|      if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |   34|  5.30k|#define AOT_AAC_LC (2)
  ------------------
                    if (pstr_input_config->aot == AOT_AAC_LC || pstr_input_config->aot == AOT_SBR ||
  ------------------
  |  |  141|  4.98k|#define AOT_SBR (5)
  ------------------
  |  Branch (809:11): [True: 320, False: 2.33k]
  |  Branch (809:51): [True: 927, False: 1.40k]
  ------------------
  810|  1.49k|          pstr_input_config->aot == AOT_PS) {
  ------------------
  |  |   39|  1.40k|#define AOT_PS (29)
  ------------------
  |  Branch (810:11): [True: 247, False: 1.15k]
  ------------------
  811|  1.49k|        if (pstr_input_config->frame_length != LEN_SUPERFRAME &&
  ------------------
  |  |   66|  2.98k|#define LEN_SUPERFRAME (1024)
  ------------------
  |  Branch (811:13): [True: 1.28k, False: 206]
  ------------------
  812|  1.28k|            pstr_input_config->frame_length != FRAME_LEN_960) {
  ------------------
  |  |   94|  1.28k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (812:13): [True: 810, False: 478]
  ------------------
  813|    810|          pstr_input_config->frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|    810|#define LEN_SUPERFRAME (1024)
  ------------------
  814|    810|        }
  815|  1.49k|      } else if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  2.31k|#define AOT_AAC_LD (23)
  ------------------
                    } else if (pstr_input_config->aot == AOT_AAC_LD || pstr_input_config->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|    947|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (815:18): [True: 210, False: 947]
  |  Branch (815:58): [True: 947, False: 0]
  ------------------
  816|  1.15k|        if (pstr_input_config->frame_length != FRAME_LEN_512 &&
  ------------------
  |  |   92|  2.31k|#define FRAME_LEN_512 512
  ------------------
  |  Branch (816:13): [True: 1.04k, False: 115]
  ------------------
  817|  1.04k|            pstr_input_config->frame_length != FRAME_LEN_480) {
  ------------------
  |  |   93|  1.04k|#define FRAME_LEN_480 480
  ------------------
  |  Branch (817:13): [True: 542, False: 500]
  ------------------
  818|    542|          pstr_input_config->frame_length = FRAME_LEN_512;
  ------------------
  |  |   92|    542|#define FRAME_LEN_512 512
  ------------------
  819|    542|        }
  820|  1.15k|      } else {
  821|      0|        pstr_input_config->frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|      0|#define LEN_SUPERFRAME (1024)
  ------------------
  822|      0|      }
  823|  2.65k|    }
  824|  2.65k|    if ((pstr_input_config->frame_length == FRAME_LEN_960) &&
  ------------------
  |  |   94|  2.65k|#define FRAME_LEN_960 960
  ------------------
  |  Branch (824:9): [True: 478, False: 2.17k]
  ------------------
  825|    478|        (pstr_input_config->esbr_flag == 1)) {
  ------------------
  |  Branch (825:9): [True: 270, False: 208]
  ------------------
  826|    270|      pstr_input_config->esbr_flag = 0;
  827|    270|    }
  828|  2.65k|  }
  829|  6.76k|  return err_code;
  830|  6.76k|}
ixheaace_api.c:ixheaace_set_default_channel_mask:
  469|  1.76k|static VOID ixheaace_set_default_channel_mask(WORD32 *ch_mask, WORD32 num_ch) {
  470|  1.76k|  switch (num_ch) {
  ------------------
  |  Branch (470:11): [True: 1.76k, False: 0]
  ------------------
  471|    270|  case 1:
  ------------------
  |  Branch (471:3): [True: 270, False: 1.49k]
  ------------------
  472|    270|    *ch_mask = CH_MASK_CENTER_FRONT;
  ------------------
  |  |  104|    270|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
  473|    270|    break;
  474|    393|  case 2:
  ------------------
  |  Branch (474:3): [True: 393, False: 1.36k]
  ------------------
  475|    393|    *ch_mask = CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  105|    393|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  476|    393|    break;
  477|    144|  case 3:
  ------------------
  |  Branch (477:3): [True: 144, False: 1.61k]
  ------------------
  478|    144|    *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT);
  ------------------
  |  |  104|    144|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT);
  ------------------
  |  |  105|    144|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  479|    144|    break;
  480|    207|  case 4:
  ------------------
  |  Branch (480:3): [True: 207, False: 1.55k]
  ------------------
  481|    207|    *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER);
  ------------------
  |  |  104|    207|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER);
  ------------------
  |  |  105|    207|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER);
  ------------------
  |  |  106|    207|#define CH_MASK_REAR_CENTER (0x100)
  ------------------
  482|    207|    break;
  483|    329|  case 5:
  ------------------
  |  Branch (483:3): [True: 329, False: 1.43k]
  ------------------
  484|    329|    *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK);
  ------------------
  |  |  104|    329|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK);
  ------------------
  |  |  105|    329|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                  *ch_mask = (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK);
  ------------------
  |  |  107|    329|#define CH_MASK_LEFT_RIGHT_BACK (0X30)
  ------------------
  485|    329|    break;
  486|    417|  case 6:
  ------------------
  |  Branch (486:3): [True: 417, False: 1.34k]
  ------------------
  487|    417|    *ch_mask =
  488|    417|      (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE);
  ------------------
  |  |  104|    417|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    (CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE);
  ------------------
  |  |  105|    417|#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|    417|#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|    417|#define CH_MASK_LFE (0x08)
  ------------------
  489|    417|    break;
  490|  1.76k|  }
  491|  1.76k|}
ixheaace_api.c:ixheaace_validate_channel_mask:
  435|  1.85k|static IA_ERRORCODE ixheaace_validate_channel_mask(WORD32 ch_mask, WORD32 num_ch) {
  436|  1.85k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.85k|#define IA_NO_ERROR 0x00000000
  ------------------
  437|       |  // If ch_mask not supported, return error
  438|  1.85k|  WORD32 temp_mask;
  439|  1.85k|  switch (num_ch) {
  440|    348|    case 1:
  ------------------
  |  Branch (440:5): [True: 348, False: 1.50k]
  ------------------
  441|    348|      temp_mask = CH_MASK_CENTER_FRONT;
  ------------------
  |  |  104|    348|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
  442|    348|      break;
  443|    382|    case 2:
  ------------------
  |  Branch (443:5): [True: 382, False: 1.47k]
  ------------------
  444|    382|      temp_mask = CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  105|    382|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  445|    382|      break;
  446|    144|    case 3:
  ------------------
  |  Branch (446:5): [True: 144, False: 1.71k]
  ------------------
  447|    144|      temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  104|    144|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT;
  ------------------
  |  |  105|    144|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
  448|    144|      break;
  449|    208|    case 4:
  ------------------
  |  Branch (449:5): [True: 208, False: 1.64k]
  ------------------
  450|    208|      temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER;
  ------------------
  |  |  104|    208|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER;
  ------------------
  |  |  105|    208|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_REAR_CENTER;
  ------------------
  |  |  106|    208|#define CH_MASK_REAR_CENTER (0x100)
  ------------------
  451|    208|      break;
  452|    335|    case 5:
  ------------------
  |  Branch (452:5): [True: 335, False: 1.51k]
  ------------------
  453|    335|      temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK;
  ------------------
  |  |  104|    335|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK;
  ------------------
  |  |  105|    335|#define CH_MASK_LEFT_RIGHT_FRONT (0x3)
  ------------------
                    temp_mask = CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK;
  ------------------
  |  |  107|    335|#define CH_MASK_LEFT_RIGHT_BACK (0X30)
  ------------------
  454|    335|      break;
  455|    437|    case 6:
  ------------------
  |  Branch (455:5): [True: 437, False: 1.41k]
  ------------------
  456|    437|      temp_mask =
  457|    437|          CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE;
  ------------------
  |  |  104|    437|#define CH_MASK_CENTER_FRONT (0x4)
  ------------------
                        CH_MASK_CENTER_FRONT | CH_MASK_LEFT_RIGHT_FRONT | CH_MASK_LEFT_RIGHT_BACK | CH_MASK_LFE;
  ------------------
  |  |  105|    437|#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|    437|#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|    437|#define CH_MASK_LFE (0x08)
  ------------------
  458|    437|      break;
  459|      0|    default:
  ------------------
  |  Branch (459:5): [True: 0, False: 1.85k]
  ------------------
  460|      0|      temp_mask = 0;
  461|      0|      break;
  462|  1.85k|  }
  463|  1.85k|  if (ch_mask != temp_mask) {
  ------------------
  |  Branch (463:7): [True: 37, False: 1.81k]
  ------------------
  464|     37|    err_code =  IA_EXHEAACE_CONFIG_FATAL_CHANNELS_MASK;
  465|     37|  }
  466|  1.85k|  return err_code;
  467|  1.85k|}
ixheaace_api.c:ia_enhaacplus_enc_find_channel_config:
  329|  1.81k|                                                  WORD32 i_channel_mask) {
  330|  1.81k|  WORD32 i;
  331|  1.81k|  WORD32 slots_for_elements[2 * MAXIMUM_BS_ELE];
  332|  1.81k|  *num_bs_elements = 0;
  333|       |
  334|  1.81k|  ia_enhaacplus_enc_find_slots_for_elements(i_channel_mask, slots_for_elements,
  335|  1.81k|                                            i_num_coupling_chan);
  336|       |
  337|  1.81k|  if ((i_channel_mask & 0x4)) {
  ------------------
  |  Branch (337:7): [True: 1.44k, False: 377]
  ------------------
  338|       |    /*Front Center Present*/
  339|  1.44k|    chan_config[*num_bs_elements] = 1;
  340|  1.44k|    element_type[*num_bs_elements] = ID_SCE;
  341|  1.44k|    element_slot[*num_bs_elements] = slots_for_elements[FRONT_CENTER];
  342|  1.44k|    element_instance_tag[*num_bs_elements] = 0;
  343|  1.44k|    (*num_bs_elements)++;
  344|  1.44k|  }
  345|       |
  346|  1.81k|  if ((i_channel_mask & 0x3)) {
  ------------------
  |  Branch (346:7): [True: 1.49k, False: 320]
  ------------------
  347|       |    /*Front Left and Right Present*/
  348|  1.49k|    chan_config[*num_bs_elements] = 2;
  349|  1.49k|    element_type[*num_bs_elements] = ID_CPE;
  350|  1.49k|    element_slot[*num_bs_elements] = slots_for_elements[FRONT_LEFT_RIGHT];
  351|  1.49k|    element_instance_tag[*num_bs_elements] = 0;
  352|  1.49k|    (*num_bs_elements)++;
  353|  1.49k|  }
  354|       |
  355|  1.81k|  if ((i_channel_mask & 0x30)) {
  ------------------
  |  Branch (355:7): [True: 769, False: 1.04k]
  ------------------
  356|       |    /*Back Left and Right Present*/
  357|    769|    chan_config[*num_bs_elements] = 2;
  358|    769|    element_type[*num_bs_elements] = ID_CPE;
  359|    769|    element_slot[*num_bs_elements] = slots_for_elements[BACK_LEFT_RIGHT];
  360|    769|    element_instance_tag[*num_bs_elements] = 1;
  361|    769|    (*num_bs_elements)++;
  362|    769|  }
  363|       |
  364|  1.81k|  if ((i_channel_mask & 0x100)) {
  ------------------
  |  Branch (364:7): [True: 207, False: 1.61k]
  ------------------
  365|       |    /* Rear Center Present*/
  366|    207|    chan_config[*num_bs_elements] = 1;
  367|    207|    element_type[*num_bs_elements] = ID_SCE;
  368|    207|    element_slot[*num_bs_elements] = slots_for_elements[REAR_CENTER];
  369|    207|    element_instance_tag[*num_bs_elements] = 1;
  370|    207|    (*num_bs_elements)++;
  371|    207|  }
  372|       |
  373|  1.81k|  if ((i_channel_mask & 0x8)) {
  ------------------
  |  Branch (373:7): [True: 436, False: 1.38k]
  ------------------
  374|       |    /*LFE channel Present*/
  375|    436|    chan_config[*num_bs_elements] = 1;
  376|    436|    element_type[*num_bs_elements] = ID_LFE;
  377|    436|    element_slot[*num_bs_elements] = slots_for_elements[LFE_CHANNEL];
  378|    436|    element_instance_tag[*num_bs_elements] = 0;
  379|    436|    (*num_bs_elements)++;
  380|    436|  }
  381|       |
  382|  1.81k|  if (i_num_coupling_chan != 0) {
  ------------------
  |  Branch (382:7): [True: 0, False: 1.81k]
  ------------------
  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.81k|}
ixheaace_api.c:ia_enhaacplus_enc_find_slots_for_elements:
  287|  1.81k|                                                      WORD32 i_num_coupling_chan) {
  288|  1.81k|  WORD32 slot = 0, i;
  289|       |
  290|  1.81k|  if ((i_channel_mask & 0x3)) {
  ------------------
  |  Branch (290:7): [True: 1.49k, False: 320]
  ------------------
  291|  1.49k|    slots_for_elements[FRONT_LEFT_RIGHT] = slot;
  292|  1.49k|    slot += 2;
  293|  1.49k|  }
  294|       |
  295|  1.81k|  if ((i_channel_mask & 0x4)) {
  ------------------
  |  Branch (295:7): [True: 1.44k, False: 377]
  ------------------
  296|  1.44k|    slots_for_elements[FRONT_CENTER] = slot;
  297|  1.44k|    slot += 1;
  298|  1.44k|  }
  299|       |
  300|  1.81k|  if ((i_channel_mask & 0x8)) {
  ------------------
  |  Branch (300:7): [True: 436, False: 1.38k]
  ------------------
  301|    436|    slots_for_elements[LFE_CHANNEL] = slot;
  302|    436|    slot += 1;
  303|    436|  }
  304|       |
  305|  1.81k|  if ((i_channel_mask & 0x30)) {
  ------------------
  |  Branch (305:7): [True: 769, False: 1.04k]
  ------------------
  306|    769|    slots_for_elements[BACK_LEFT_RIGHT] = slot;
  307|    769|    slot += 2;
  308|    769|  }
  309|       |
  310|  1.81k|  if ((i_channel_mask & 0x100)) {
  ------------------
  |  Branch (310:7): [True: 207, False: 1.61k]
  ------------------
  311|    207|    slots_for_elements[REAR_CENTER] = slot;
  312|    207|    slot += 1;
  313|    207|  }
  314|       |
  315|  1.81k|  if (i_num_coupling_chan != 0) {
  ------------------
  |  Branch (315:7): [True: 0, False: 1.81k]
  ------------------
  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.81k|  return;
  323|  1.81k|}
ixheaace_api.c:ia_enhaacplus_enc_allocate_bitrate_between_channels:
  395|  1.12k|    ixheaace_api_struct *pstr_api_struct, WORD32 *bitrate, WORD32 inp_bitrate) {
  396|  1.12k|  WORD32 ele_idx;
  397|  1.12k|  WORD32 num_lfe = 0, num_mono = 0, num_stereo = 0;
  398|  1.12k|  WORD32 bitrate_per_stereo, bitrate_per_mono;
  399|  4.77k|  for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (399:21): [True: 3.65k, False: 1.12k]
  ------------------
  400|  3.65k|    switch (pstr_api_struct->config[ele_idx].element_type) {
  401|  1.32k|      case ID_SCE:
  ------------------
  |  Branch (401:7): [True: 1.32k, False: 2.32k]
  ------------------
  402|  1.32k|      case ID_CCE:
  ------------------
  |  Branch (402:7): [True: 0, False: 3.65k]
  ------------------
  403|  1.32k|        num_mono++;
  404|  1.32k|        break;
  405|  1.88k|      case ID_CPE:
  ------------------
  |  Branch (405:7): [True: 1.88k, False: 1.76k]
  ------------------
  406|  1.88k|        num_stereo++;
  407|  1.88k|        break;
  408|    436|      case ID_LFE:
  ------------------
  |  Branch (408:7): [True: 436, False: 3.21k]
  ------------------
  409|    436|        num_lfe++;
  410|    436|        break;
  411|      0|      default:
  ------------------
  |  Branch (411:7): [True: 0, False: 3.65k]
  ------------------
  412|      0|        return;
  413|  3.65k|    }
  414|  3.65k|  }
  415|  1.12k|  bitrate_per_stereo = (WORD32)((inp_bitrate - (num_lfe)*8000) / (num_mono * 0.625 + num_stereo));
  416|  1.12k|  bitrate_per_mono = (WORD32)(0.625 * bitrate_per_stereo);
  417|  4.77k|  for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (417:21): [True: 3.65k, False: 1.12k]
  ------------------
  418|  3.65k|    switch (pstr_api_struct->config[ele_idx].element_type) {
  419|  1.32k|      case ID_SCE:
  ------------------
  |  Branch (419:7): [True: 1.32k, False: 2.32k]
  ------------------
  420|  1.32k|      case ID_CCE:
  ------------------
  |  Branch (420:7): [True: 0, False: 3.65k]
  ------------------
  421|  1.32k|        bitrate[ele_idx] = bitrate_per_mono;
  422|  1.32k|        break;
  423|  1.88k|      case ID_CPE:
  ------------------
  |  Branch (423:7): [True: 1.88k, False: 1.76k]
  ------------------
  424|  1.88k|        bitrate[ele_idx] = bitrate_per_stereo;
  425|  1.88k|        break;
  426|    436|      case ID_LFE:
  ------------------
  |  Branch (426:7): [True: 436, False: 3.21k]
  ------------------
  427|    436|        bitrate[ele_idx] = 8000;
  428|    436|        break;
  429|      0|      default:
  ------------------
  |  Branch (429:7): [True: 0, False: 3.65k]
  ------------------
  430|      0|        return;
  431|  3.65k|    }
  432|  3.65k|  }
  433|  1.12k|}
ixheaace_api.c:ixheaace_get_measured_loudness_info:
 3512|  3.56k|                                                ixheaace_input_config *pstr_input_config) {
 3513|  3.56k|  ia_drc_input_config *pstr_internal_drc_cfg;
 3514|  3.56k|  ia_drc_uni_drc_config_struct *pstr_uni_drc_config;
 3515|  3.56k|  ia_drc_loudness_info_set_struct *pstr_enc_loudness_info_set;
 3516|  3.56k|  WORD32 n, m;
 3517|       |
 3518|  3.56k|  pstr_internal_drc_cfg =
 3519|  3.56k|      (ia_drc_input_config *)&pstr_api_struct->config[0].usac_config.str_drc_cfg;
 3520|  3.56k|  if (pstr_input_config->use_drc_element == 0) {
  ------------------
  |  Branch (3520:7): [True: 2.66k, False: 898]
  ------------------
 3521|  2.66k|    memset(pstr_internal_drc_cfg, 0, sizeof(ia_drc_input_config));
 3522|  2.66k|  }
 3523|  3.56k|  pstr_uni_drc_config = &pstr_internal_drc_cfg->str_uni_drc_config;
 3524|  3.56k|  pstr_enc_loudness_info_set = &pstr_internal_drc_cfg->str_enc_loudness_info_set;
 3525|       |
 3526|  3.56k|  pstr_uni_drc_config->sample_rate_present = 1;
 3527|  3.56k|  pstr_uni_drc_config->loudness_info_set_present = 1;
 3528|  3.56k|  pstr_enc_loudness_info_set->loudness_info_count = 1;
 3529|       |
 3530|  7.13k|  for (n = 0; n < pstr_enc_loudness_info_set->loudness_info_count; n++) {
  ------------------
  |  Branch (3530:15): [True: 3.56k, False: 3.56k]
  ------------------
 3531|  3.56k|    pstr_enc_loudness_info_set->str_loudness_info[n].drc_set_id = 0;
 3532|  3.56k|    pstr_enc_loudness_info_set->str_loudness_info[n].downmix_id = 0;
 3533|  3.56k|    pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level_present = 1;
 3534|  3.56k|    pstr_enc_loudness_info_set->str_loudness_info[n].sample_peak_level =
 3535|  3.56k|        pstr_input_config->sample_peak_level;
 3536|  3.56k|    pstr_enc_loudness_info_set->str_loudness_info[n].true_peak_level_present = 0;
 3537|  3.56k|    pstr_enc_loudness_info_set->str_loudness_info[n].measurement_count = 1;
 3538|       |
 3539|  7.13k|    for (m = 0; m < pstr_enc_loudness_info_set->str_loudness_info[n].measurement_count; m++) {
  ------------------
  |  Branch (3539:17): [True: 3.56k, False: 3.56k]
  ------------------
 3540|  3.56k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].method_definition =
 3541|  3.56k|          pstr_input_config->method_def;
 3542|  3.56k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].method_value =
 3543|  3.56k|          (FLOAT32)pstr_input_config->measured_loudness;
 3544|  3.56k|      pstr_enc_loudness_info_set->str_loudness_info[n]
 3545|  3.56k|          .str_loudness_measure[m]
 3546|  3.56k|          .measurement_system = pstr_input_config->measurement_system;
 3547|  3.56k|      pstr_enc_loudness_info_set->str_loudness_info[n].str_loudness_measure[m].reliability = 3;
 3548|  3.56k|    }
 3549|  3.56k|  }
 3550|  3.56k|}
ixheaace_api.c:ixheaace_fill_mem_tabs:
 1235|  6.47k|static VOID ixheaace_fill_mem_tabs(ixheaace_api_struct *pstr_api_struct, WORD32 aot) {
 1236|  6.47k|  WORD32 ele_idx;
 1237|  6.47k|  WORD32 num_channel;
 1238|  6.47k|  WORD32 frame_length = LEN_SUPERFRAME;
  ------------------
  |  |   66|  6.47k|#define LEN_SUPERFRAME (1024)
  ------------------
 1239|  6.47k|  ixheaace_mem_info_struct *pstr_mem_info;
 1240|  6.47k|  frame_length = pstr_api_struct->config[0].frame_length;
 1241|  6.47k|  WORD32 offset_size = 0;
 1242|  6.47k|  if (pstr_api_struct->usac_en) {
  ------------------
  |  Branch (1242:7): [True: 4.11k, False: 2.35k]
  ------------------
 1243|  4.11k|    WORD32 fac_downsample = 1;
 1244|  4.11k|    if (pstr_api_struct->config[0].ccfl_idx > NO_SBR_CCFL_1024) {
  ------------------
  |  |  196|  4.11k|#define NO_SBR_CCFL_1024 (1)
  ------------------
  |  Branch (1244:9): [True: 2.89k, False: 1.22k]
  ------------------
 1245|  2.89k|      fac_downsample = pstr_api_struct->config[0].ccfl_idx >> 1;
 1246|  2.89k|    } else {
 1247|  1.22k|      fac_downsample = 1;
 1248|  1.22k|    }
 1249|       |    /* persistant */
 1250|  4.11k|    {
 1251|  4.11k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_PERSIST_IDX];
  ------------------
  |  |   29|  4.11k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
 1252|  4.11k|      {
 1253|  4.11k|        pstr_mem_info->ui_size =
 1254|  4.11k|            IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8) +
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1255|  4.11k|            iusace_calc_pers_buf_sizes(pstr_api_struct);
 1256|  4.11k|        if (pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1256:13): [True: 2.89k, False: 1.22k]
  ------------------
 1257|  2.89k|          pstr_mem_info->ui_size += ixheaace_sbr_enc_pers_size(
 1258|  2.89k|              2, 0, pstr_api_struct->config[0].usac_config.sbr_harmonic);
 1259|  2.89k|        }
 1260|  4.11k|        offset_size = 2 *
 1261|  4.11k|                      ia_enhaacplus_enc_sizeof_delay_buffer(
 1262|  4.11k|                          0, AOT_USAC, pstr_api_struct->config[0].ccfl_idx,
  ------------------
  |  |  142|  4.11k|#define AOT_USAC (42)
  ------------------
 1263|  4.11k|                          sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1264|  4.11k|                          pstr_api_struct->config[0].use_mps) *
 1265|  4.11k|                      pstr_api_struct->config[0].num_bs_elements;
 1266|  4.11k|        pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1267|       |
 1268|  4.11k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1268:13): [True: 1.19k, False: 2.91k]
  ------------------
 1269|  1.19k|          offset_size =
 1270|  1.19k|              (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
  ------------------
  |  |  111|  1.19k|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|  1.19k|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|  1.19k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.19k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1271|  1.19k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.19k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1272|       |
 1273|  1.19k|          offset_size =
 1274|  1.19k|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]);
  ------------------
  |  |   64|  1.19k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1275|  1.19k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.19k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1276|       |
 1277|  1.19k|          pstr_mem_info->ui_size +=
 1278|  1.19k|              IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.19k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1279|  1.19k|        }
 1280|  4.11k|        if (1 == pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1280:13): [True: 2.89k, False: 1.22k]
  ------------------
 1281|  2.89k|          offset_size =
 1282|  2.89k|              (MAX_FRAME_LEN * (1 << fac_downsample) + MAX_DS_8_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  101|  2.89k|#define MAX_FRAME_LEN (1024)
  ------------------
                            (MAX_FRAME_LEN * (1 << fac_downsample) + MAX_DS_8_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |   85|  2.89k|#define MAX_DS_8_1_FILTER_DELAY (248)
  ------------------
                            (MAX_FRAME_LEN * (1 << fac_downsample) + MAX_DS_8_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  152|  2.89k|#define INPUT_DELAY ((CORE_DELAY)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  148|  2.89k|#define CORE_DELAY (1600)
  |  |  ------------------
  ------------------
 1283|  2.89k|              MAX_CHANNELS * sizeof(pstr_mem_info->ui_size);
  ------------------
  |  |   77|  2.89k|#define MAX_CHANNELS (2)
  ------------------
 1284|  2.89k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.89k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1285|  2.89k|        }
 1286|  4.11k|        if ((2 != pstr_api_struct->config[0].usac_config.channels) &&
  ------------------
  |  Branch (1286:13): [True: 1.28k, False: 2.83k]
  ------------------
 1287|  1.28k|            (1 == pstr_api_struct->config[0].usac_config.sbr_enable)) {
  ------------------
  |  Branch (1287:13): [True: 756, False: 528]
  ------------------
 1288|    756|          offset_size = (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal[0]);
  ------------------
  |  |  111|    756|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    756|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    756|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    756|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1289|    756|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    756|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1290|    756|        }
 1291|  4.11k|      }
 1292|       |
 1293|  4.11k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  4.11k|#define BYTE_ALIGN_8 (8)
  ------------------
 1294|  4.11k|      pstr_mem_info->ui_type = IA_MEMTYPE_PERSIST;
  ------------------
  |  |   28|  4.11k|#define IA_MEMTYPE_PERSIST 0x00
  ------------------
 1295|  4.11k|      pstr_mem_info->ui_placement[0] = 0;
 1296|  4.11k|      pstr_mem_info->ui_placement[1] = 0;
 1297|  4.11k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.11k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1298|  4.11k|      pstr_mem_info->ui_placed[0] = 0;
 1299|  4.11k|      pstr_mem_info->ui_placed[1] = 0;
 1300|  4.11k|    }
 1301|       |
 1302|       |    /* scratch */
 1303|  4.11k|    {
 1304|  4.11k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  4.11k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 1305|  4.11k|      UWORD32 usac_scr_size = iusace_scratch_size();
 1306|  4.11k|      if (pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1306:11): [True: 2.89k, False: 1.22k]
  ------------------
 1307|  2.89k|        UWORD32 sbr_scr_size = ixheaace_sbr_enc_scr_size() + ixheaace_resampler_scr_size();
 1308|  2.89k|        pstr_mem_info->ui_size = max(usac_scr_size, sbr_scr_size);
  ------------------
  |  |   74|  2.89k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 2.89k, False: 0]
  |  |  ------------------
  ------------------
 1309|  2.89k|      } else {
 1310|  1.22k|        pstr_mem_info->ui_size = usac_scr_size;
 1311|  1.22k|      }
 1312|       |
 1313|  4.11k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  4.11k|#define BYTE_ALIGN_8 (8)
  ------------------
 1314|  4.11k|      pstr_mem_info->ui_type = IA_MEMTYPE_SCRATCH;
  ------------------
  |  |   30|  4.11k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1315|  4.11k|      pstr_mem_info->ui_placement[0] = 0;
 1316|  4.11k|      pstr_mem_info->ui_placement[1] = 0;
 1317|  4.11k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.11k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1318|  4.11k|      pstr_mem_info->ui_placed[0] = 0;
 1319|  4.11k|      pstr_mem_info->ui_placed[1] = 0;
 1320|  4.11k|    }
 1321|       |
 1322|       |    /* input */
 1323|  4.11k|    {
 1324|  4.11k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_INPUT_IDX];
  ------------------
  |  |   31|  4.11k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
 1325|  4.11k|      WORD32 pcm_wd_sz;
 1326|  4.11k|      num_channel = pstr_api_struct->config[0].i_channels;
 1327|  4.11k|      pcm_wd_sz = pstr_api_struct->config[0].usac_config.ui_pcm_wd_sz;
 1328|  4.11k|      pstr_mem_info->ui_size = frame_length * num_channel * (pcm_wd_sz >> 3);
 1329|  4.11k|      if (1 == pstr_api_struct->config[0].usac_config.sbr_enable) {
  ------------------
  |  Branch (1329:11): [True: 2.89k, False: 1.22k]
  ------------------
 1330|  2.89k|        switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (1330:17): [True: 2.89k, False: 0]
  ------------------
 1331|    357|          case SBR_8_3:  // 8:3
  ------------------
  |  |  197|    357|#define SBR_8_3 (2)
  ------------------
  |  Branch (1331:11): [True: 357, False: 2.53k]
  ------------------
 1332|    357|            pstr_mem_info->ui_size *= 8;
 1333|    357|            pstr_mem_info->ui_size /= 3;
 1334|    357|            break;
 1335|       |
 1336|  1.97k|          case SBR_2_1:  // 2:1
  ------------------
  |  |  198|  1.97k|#define SBR_2_1 (3)
  ------------------
  |  Branch (1336:11): [True: 1.97k, False: 922]
  ------------------
 1337|  1.97k|            pstr_mem_info->ui_size *= 2;
 1338|  1.97k|            break;
 1339|       |
 1340|    565|          case SBR_4_1:  // 4:1
  ------------------
  |  |  199|    565|#define SBR_4_1 (4)
  ------------------
  |  Branch (1340:11): [True: 565, False: 2.32k]
  ------------------
 1341|    565|            pstr_mem_info->ui_size *= 4;
 1342|    565|            break;
 1343|  2.89k|        }
 1344|  2.89k|      }
 1345|       |
 1346|  4.11k|      pstr_mem_info->ui_alignment =
 1347|  4.11k|          BYTE_ALIGN_8; /* As input is used as scratch memory internally */
  ------------------
  |  |   30|  4.11k|#define BYTE_ALIGN_8 (8)
  ------------------
 1348|  4.11k|      pstr_mem_info->ui_type = IA_MEMTYPE_INPUT;
  ------------------
  |  |   24|  4.11k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
 1349|  4.11k|      pstr_mem_info->ui_placement[0] = 0;
 1350|  4.11k|      pstr_mem_info->ui_placement[1] = 0;
 1351|  4.11k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.11k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1352|  4.11k|      pstr_mem_info->ui_placed[0] = 0;
 1353|  4.11k|      pstr_mem_info->ui_placed[1] = 0;
 1354|  4.11k|    }
 1355|       |
 1356|       |    /* output */
 1357|      0|    {
 1358|  4.11k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_OUTPUT_IDX];
  ------------------
  |  |   32|  4.11k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 1359|  4.11k|      pstr_mem_info->ui_size =
 1360|  4.11k|          ((MAX_PREROLL_FRAMES + 1) * (MAX_CHANNEL_BITS / BYTE_NUMBIT) * num_channel) +
  ------------------
  |  |  205|  4.11k|#define MAX_PREROLL_FRAMES (3)
  ------------------
                        ((MAX_PREROLL_FRAMES + 1) * (MAX_CHANNEL_BITS / BYTE_NUMBIT) * num_channel) +
  ------------------
  |  |   41|  4.11k|#define MAX_CHANNEL_BITS 6144
  ------------------
                        ((MAX_PREROLL_FRAMES + 1) * (MAX_CHANNEL_BITS / BYTE_NUMBIT) * num_channel) +
  ------------------
  |  |   82|  4.11k|#define BYTE_NUMBIT 8
  ------------------
 1361|  4.11k|          MAX_PREROLL_CONFIG_SIZE;
  ------------------
  |  |  210|  4.11k|#define MAX_PREROLL_CONFIG_SIZE (1024)
  ------------------
 1362|  4.11k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  4.11k|#define BYTE_ALIGN_8 (8)
  ------------------
 1363|  4.11k|      pstr_mem_info->ui_type = IA_MEMTYPE_OUTPUT;
  ------------------
  |  |   26|  4.11k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1364|  4.11k|      pstr_mem_info->ui_placement[0] = 0;
 1365|  4.11k|      pstr_mem_info->ui_placement[1] = 0;
 1366|  4.11k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  4.11k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1367|  4.11k|      pstr_mem_info->ui_placed[0] = 0;
 1368|  4.11k|      pstr_mem_info->ui_placed[1] = 0;
 1369|  4.11k|    }
 1370|  4.11k|  } else {
 1371|       |    /* persistant */
 1372|  2.35k|    {
 1373|  2.35k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_PERSIST_IDX];
  ------------------
  |  |   29|  2.35k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
 1374|  2.35k|      {
 1375|  2.35k|        if (pstr_api_struct->config[0].num_bs_elements == 1) {
  ------------------
  |  Branch (1375:13): [True: 1.23k, False: 1.12k]
  ------------------
 1376|  1.23k|          num_channel = pstr_api_struct->config[0].aac_classic
  ------------------
  |  Branch (1376:25): [True: 251, False: 986]
  ------------------
 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: 232, False: 754]
  ------------------
 1379|    986|                                   ? 1
 1380|    986|                                   : 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.47k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (1384:15): [True: 1.14k, False: 91]
  ------------------
 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: 67]
  ------------------
 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.35k|        if (pstr_api_struct->config[0].num_bs_elements > 1) {
  ------------------
  |  Branch (1396:13): [True: 1.12k, False: 1.23k]
  ------------------
 1397|  1.12k|          offset_size = IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8) +
  ------------------
  |  |   87|  1.12k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1398|  1.12k|                        ia_enhaacplus_enc_sizeof_delay_buffer(
 1399|  1.12k|                            pstr_api_struct->config[0].aac_config.flag_framelength_small, aot, 3,
 1400|  1.12k|                            sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1401|  1.12k|                            pstr_api_struct->config[0].use_mps) *
 1402|  1.12k|                            pstr_api_struct->config[0].num_bs_elements;
 1403|  1.12k|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.12k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1404|  4.77k|          for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1404:29): [True: 3.65k, False: 1.12k]
  ------------------
 1405|  3.65k|            num_channel = pstr_api_struct->config[ele_idx].i_channels;
 1406|  3.65k|            if (pstr_api_struct->config[ele_idx].element_type != ID_LFE)
  ------------------
  |  Branch (1406:17): [True: 3.21k, False: 436]
  ------------------
 1407|  3.21k|              pstr_mem_info->ui_size += ixheaace_sbr_enc_pers_size(num_channel, 0, 0);
 1408|  3.65k|            pstr_mem_info->ui_size += ia_enhaacplus_enc_aac_enc_pers_size(num_channel, aot) + 32;
 1409|  3.65k|          }
 1410|  1.12k|        }
 1411|       |
 1412|  2.35k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1412:13): [True: 556, False: 1.80k]
  ------------------
 1413|    556|          if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (1413:15): [True: 279, False: 277]
  ------------------
 1414|    279|            offset_size =
 1415|    279|                (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    279|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    279|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    279|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    279|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  147|    279|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|    279|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    279|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1416|    279|                sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
 1417|    279|          } else {
 1418|    277|            offset_size =
 1419|    277|                (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    277|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    277|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    277|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    277|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  139|    277|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    277|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    277|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1420|    277|                sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
 1421|    277|          }
 1422|    556|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    556|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1423|    556|          if (pstr_api_struct->config[0].mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    556|#define TREE_212 (0)
  ------------------
  |  Branch (1423:15): [True: 158, False: 398]
  ------------------
 1424|    158|            pstr_mem_info->ui_size +=
 1425|    158|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    158|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1426|    398|          } else {
 1427|    398|            pstr_mem_info->ui_size +=
 1428|    398|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_515_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    398|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1429|    398|          }
 1430|    556|          pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|    556|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1431|    556|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]),
 1432|    556|              BYTE_ALIGN_8);
 1433|    556|        }
 1434|       |
 1435|  2.35k|        offset_size = IXHEAACE_MAX_PAYLOAD_SIZE * pstr_api_struct->config[0].num_bs_elements;
  ------------------
  |  |   23|  2.35k|#define IXHEAACE_MAX_PAYLOAD_SIZE (256)
  ------------------
 1436|  2.35k|        pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.35k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1437|  2.35k|        offset_size = (MAX_FRAME_LEN * 2 + MAX_DS_2_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  101|  2.35k|#define MAX_FRAME_LEN (1024)
  ------------------
                      offset_size = (MAX_FRAME_LEN * 2 + MAX_DS_2_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |   79|  2.35k|#define MAX_DS_2_1_FILTER_DELAY (16)
  ------------------
                      offset_size = (MAX_FRAME_LEN * 2 + MAX_DS_2_1_FILTER_DELAY + INPUT_DELAY) *
  ------------------
  |  |  152|  2.35k|#define INPUT_DELAY ((CORE_DELAY)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  148|  2.35k|#define CORE_DELAY (1600)
  |  |  ------------------
  ------------------
 1438|  2.35k|                      MAX_INPUT_CHAN * sizeof(pstr_mem_info->ui_size);
  ------------------
  |  |   99|  2.35k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  ------------------
  |  |  |  |   22|  2.35k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  ------------------
  ------------------
 1439|  2.35k|        pstr_mem_info->ui_size += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.35k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1440|  2.35k|      }
 1441|       |
 1442|  2.35k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  2.35k|#define BYTE_ALIGN_8 (8)
  ------------------
 1443|  2.35k|      pstr_mem_info->ui_type = IA_MEMTYPE_PERSIST;
  ------------------
  |  |   28|  2.35k|#define IA_MEMTYPE_PERSIST 0x00
  ------------------
 1444|  2.35k|      pstr_mem_info->ui_placement[0] = 0;
 1445|  2.35k|      pstr_mem_info->ui_placement[1] = 0;
 1446|  2.35k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.35k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1447|  2.35k|      pstr_mem_info->ui_placed[0] = 0;
 1448|  2.35k|      pstr_mem_info->ui_placed[1] = 0;
 1449|  2.35k|    }
 1450|       |
 1451|       |    /* scratch */
 1452|  2.35k|    {
 1453|  2.35k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  2.35k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 1454|  2.35k|      {
 1455|  2.35k|        pstr_mem_info->ui_size = ia_enhaacplus_enc_aac_enc_scr_size();
 1456|  2.35k|        UWORD32 sbr_scr_size = ixheaace_sbr_enc_scr_size() + ixheaace_resampler_scr_size();
 1457|  2.35k|        UWORD32 mps_scr_size = 0;
 1458|  2.35k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1458:13): [True: 556, False: 1.80k]
  ------------------
 1459|    556|          if (pstr_api_struct->config[0].mps_tree_config != TREE_212) {
  ------------------
  |  |   39|    556|#define TREE_212 (0)
  ------------------
  |  Branch (1459:15): [True: 398, False: 158]
  ------------------
 1460|    398|            mps_scr_size = ixheaace_mps_515_scratch_size();
 1461|    398|          }
 1462|    556|        }
 1463|  2.35k|        pstr_mem_info->ui_size += MAX(sbr_scr_size, mps_scr_size);
  ------------------
  |  |   31|  2.35k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (31:20): [True: 1.95k, False: 398]
  |  |  ------------------
  ------------------
 1464|  2.35k|      }
 1465|  2.35k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  2.35k|#define BYTE_ALIGN_8 (8)
  ------------------
 1466|  2.35k|      pstr_mem_info->ui_type = IA_MEMTYPE_SCRATCH;
  ------------------
  |  |   30|  2.35k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1467|  2.35k|      pstr_mem_info->ui_placement[0] = 0;
 1468|  2.35k|      pstr_mem_info->ui_placement[1] = 0;
 1469|  2.35k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.35k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1470|  2.35k|      pstr_mem_info->ui_placed[0] = 0;
 1471|  2.35k|      pstr_mem_info->ui_placed[1] = 0;
 1472|  2.35k|    }
 1473|       |
 1474|       |    /* input */
 1475|  2.35k|    {
 1476|  2.35k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_INPUT_IDX];
  ------------------
  |  |   31|  2.35k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
 1477|       |
 1478|  2.35k|      WORD32 pcm_wd_sz;
 1479|  2.35k|      pcm_wd_sz = pstr_api_struct->config[0].ui_pcm_wd_sz;
 1480|  2.35k|      num_channel = 0;
 1481|  7.24k|      for (ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements; ele_idx++) {
  ------------------
  |  Branch (1481:25): [True: 4.88k, False: 2.35k]
  ------------------
 1482|  4.88k|        num_channel += pstr_api_struct->config[ele_idx].i_channels;
 1483|  4.88k|      }
 1484|  2.35k|      {
 1485|  2.35k|        if (pstr_api_struct->config[0].aac_classic) {
  ------------------
  |  Branch (1485:13): [True: 665, False: 1.69k]
  ------------------
 1486|    665|          pstr_mem_info->ui_size = (frame_length * (pcm_wd_sz >> 3)) * num_channel;
 1487|  1.69k|        } else {
 1488|  1.69k|          pstr_mem_info->ui_size = (frame_length * (pcm_wd_sz >> 3)) * 2 * num_channel;
 1489|  1.69k|        }
 1490|  2.35k|      }
 1491|  2.35k|      pstr_mem_info->ui_alignment =
 1492|  2.35k|          BYTE_ALIGN_8; /* As input is used as scratch memory internally */
  ------------------
  |  |   30|  2.35k|#define BYTE_ALIGN_8 (8)
  ------------------
 1493|  2.35k|      pstr_mem_info->ui_type = IA_MEMTYPE_INPUT;
  ------------------
  |  |   24|  2.35k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
 1494|  2.35k|      pstr_mem_info->ui_placement[0] = 0;
 1495|  2.35k|      pstr_mem_info->ui_placement[1] = 0;
 1496|  2.35k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.35k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1497|  2.35k|      pstr_mem_info->ui_placed[0] = 0;
 1498|  2.35k|      pstr_mem_info->ui_placed[1] = 0;
 1499|  2.35k|    }
 1500|       |
 1501|       |    /* output */
 1502|  2.35k|    {
 1503|  2.35k|      pstr_mem_info = &pstr_api_struct->pstr_mem_info[IA_ENHAACPLUSENC_OUTPUT_IDX];
  ------------------
  |  |   32|  2.35k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 1504|  2.35k|      if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  4.71k|#define AOT_AAC_LC (2)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|  4.28k|#define AOT_SBR (5)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  1.28k|#define AOT_PS (29)
  ------------------
  |  Branch (1504:11): [True: 430, False: 1.92k]
  |  Branch (1504:32): [True: 642, False: 1.28k]
  |  Branch (1504:50): [True: 232, False: 1.05k]
  ------------------
 1505|  1.30k|        pstr_mem_info->ui_size = (6 * frame_length / 8) * num_channel;
 1506|  1.30k|        pstr_mem_info->ui_size += (7) * IXHEAACE_MAX_CH_IN_BS_ELE * MAXIMUM_BS_ELE;
  ------------------
  |  |   22|  1.30k|#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.30k|  8 /* 1 <SCE> 2 <CPE> 3<CPE> 4<CPE> 5<LFE> 6<SCE> - 8.1 channel + 2 cc channels*/
  ------------------
 1507|  1.30k|      } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  2.10k|#define AOT_AAC_LD (23)
  ------------------
                    } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|    818|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (1507:18): [True: 235, False: 818]
  |  Branch (1507:39): [True: 818, False: 0]
  ------------------
 1508|  1.05k|        pstr_mem_info->ui_size = (6 * frame_length / 8) * num_channel;
 1509|  1.05k|      }
 1510|  2.35k|      pstr_mem_info->ui_alignment = BYTE_ALIGN_8;
  ------------------
  |  |   30|  2.35k|#define BYTE_ALIGN_8 (8)
  ------------------
 1511|  2.35k|      pstr_mem_info->ui_type = IA_MEMTYPE_OUTPUT;
  ------------------
  |  |   26|  2.35k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1512|  2.35k|      pstr_mem_info->ui_placement[0] = 0;
 1513|  2.35k|      pstr_mem_info->ui_placement[1] = 0;
 1514|  2.35k|      pstr_mem_info->ui_priority = IA_MEMPRIORITY_ANYWHERE;
  ------------------
  |  |   33|  2.35k|#define IA_MEMPRIORITY_ANYWHERE 0x00
  ------------------
 1515|  2.35k|      pstr_mem_info->ui_placed[0] = 0;
 1516|  2.35k|      pstr_mem_info->ui_placed[1] = 0;
 1517|  2.35k|    }
 1518|  2.35k|  }
 1519|       |
 1520|  6.47k|  return;
 1521|  6.47k|}
ixheaace_api.c:iusace_calc_pers_buf_sizes:
  148|  4.11k|static WORD32 iusace_calc_pers_buf_sizes(ixheaace_api_struct *pstr_api_struct) {
  149|  4.11k|  WORD32 pers_size = 0;
  150|  4.11k|  ia_usac_encoder_config_struct *pstr_config = &pstr_api_struct->config[0].usac_config;
  151|       |
  152|  4.11k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  153|  4.11k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  154|  4.11k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  155|  4.11k|  pers_size += IXHEAAC_GET_SIZE_ALIGNED(pstr_config->channels * sizeof(FLOAT32 *), BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  156|       |
  157|  4.11k|  pers_size +=
  158|  4.11k|      (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->ccfl * sizeof(FLOAT32)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  159|  4.11k|       pstr_config->channels);
  160|  4.11k|  pers_size += (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->drc_frame_size * sizeof(FLOAT32)),
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  161|  4.11k|                                         BYTE_ALIGN_8) *
  162|  4.11k|                pstr_config->channels);
  163|  4.11k|  if (pstr_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (163:7): [True: 3.95k, False: 157]
  ------------------
  164|  3.95k|    pers_size +=
  165|  3.95k|        (IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  3.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  166|  3.95k|             ((CC_DELAY_ADJUSTMENT * pstr_config->ccfl) / FRAME_LEN_1024) * sizeof(FLOAT32),
  167|  3.95k|             BYTE_ALIGN_8) *
  168|  3.95k|         pstr_config->channels);
  169|  3.95k|    pers_size += (IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  3.95k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  170|  3.95k|                      ((CC_DELAY_ADJUSTMENT * pstr_config->drc_frame_size) / FRAME_LEN_1024) *
  171|  3.95k|                          sizeof(FLOAT32),
  172|  3.95k|                      BYTE_ALIGN_8) *
  173|  3.95k|                  pstr_config->channels);
  174|  3.95k|  }
  175|       |
  176|  4.11k|  pers_size +=
  177|  4.11k|      (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  178|  4.11k|       pstr_config->channels);
  179|       |
  180|  4.11k|  pers_size += (IXHEAAC_GET_SIZE_ALIGNED((pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  181|  4.11k|                pstr_config->channels);
  182|       |
  183|  4.11k|  pers_size +=
  184|  4.11k|      (IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  185|  4.11k|       pstr_config->channels);
  186|       |
  187|  4.11k|  pers_size +=
  188|  4.11k|      (IXHEAAC_GET_SIZE_ALIGNED((3 * pstr_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  189|  4.11k|       pstr_config->channels);
  190|       |
  191|  4.11k|  if (pstr_config->tns_select != 0) {
  ------------------
  |  Branch (191:7): [True: 1.89k, False: 2.22k]
  ------------------
  192|  1.89k|    pers_size +=
  193|  1.89k|        (IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_tns_info), BYTE_ALIGN_8) * pstr_config->channels);
  ------------------
  |  |   87|  1.89k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  194|  1.89k|  }
  195|       |
  196|  4.11k|  pers_size += (IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_usac_td_encoder_struct), BYTE_ALIGN_8) *
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  197|  4.11k|                pstr_config->channels);
  198|  4.11k|  return pers_size;
  199|  4.11k|}
ixheaace_api.c:ia_enhaacplus_enc_sizeof_delay_buffer:
  203|  12.9k|                                                    FLAG mps_enable) {
  204|  12.9k|  WORD32 downsample_fac;
  205|  12.9k|  if (resamp_idx > 1) {
  ------------------
  |  Branch (205:7): [True: 10.5k, False: 2.44k]
  ------------------
  206|  10.5k|    downsample_fac = resamp_idx / 2;
  207|  10.5k|  } else {
  208|  2.44k|    downsample_fac = 1;
  209|  2.44k|  }
  210|       |  // Set the downsampler delay
  211|  12.9k|  WORD32 max_downsamp_delay, max_upsamp_delay;
  212|  12.9k|  if (resamp_idx == 2)  // 8:3
  ------------------
  |  Branch (212:7): [True: 714, False: 12.2k]
  ------------------
  213|    714|  {
  214|    714|    max_downsamp_delay = MAXIMUM_DS_8_1_FILTER_DELAY;
  ------------------
  |  |  161|    714|#define MAXIMUM_DS_8_1_FILTER_DELAY (248)
  ------------------
  215|    714|    max_upsamp_delay = MAXIMUM_DS_1_3_FILTER_DELAY;
  ------------------
  |  |  164|    714|#define MAXIMUM_DS_1_3_FILTER_DELAY (36)
  ------------------
  216|  12.2k|  } else if (resamp_idx == 3)  // 2:1
  ------------------
  |  Branch (216:14): [True: 8.65k, False: 3.57k]
  ------------------
  217|  8.65k|  {
  218|  8.65k|    max_downsamp_delay = MAXIMUM_DS_2_1_FILTER_DELAY;
  ------------------
  |  |  155|  8.65k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
  219|  8.65k|    max_upsamp_delay = 0;
  220|  8.65k|  } else if (resamp_idx == 4)  // 4:1
  ------------------
  |  Branch (220:14): [True: 1.13k, False: 2.44k]
  ------------------
  221|  1.13k|  {
  222|  1.13k|    max_downsamp_delay = MAXIMUM_DS_4_1_FILTER_DELAY;
  ------------------
  |  |  158|  1.13k|#define MAXIMUM_DS_4_1_FILTER_DELAY (64)
  ------------------
  223|  1.13k|    max_upsamp_delay = 0;
  224|  2.44k|  } else {
  225|  2.44k|    max_downsamp_delay = MAXIMUM_DS_2_1_FILTER_DELAY;
  ------------------
  |  |  155|  2.44k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
  226|  2.44k|    max_upsamp_delay = 0;
  227|  2.44k|  }
  228|       |
  229|  12.9k|  if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|  25.8k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  11.5k|#define AOT_PS (29)
  ------------------
  |  Branch (229:7): [True: 1.40k, False: 11.5k]
  |  Branch (229:25): [True: 475, False: 11.0k]
  ------------------
  230|  1.88k|    if (flag_framelength_small)
  ------------------
  |  Branch (230:9): [True: 588, False: 1.29k]
  ------------------
  231|    588|      return (FRAME_LEN_960 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   94|    588|#define FRAME_LEN_960 960
  ------------------
  232|    588|              INPUT_DELAY_LC) *
  ------------------
  |  |  132|    588|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|    588|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  233|    588|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    588|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  234|  1.29k|    else
  235|  1.29k|      return (FRAME_LEN_1024 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   91|  1.29k|#define FRAME_LEN_1024 1024
  ------------------
  236|  1.29k|              INPUT_DELAY_LC) *
  ------------------
  |  |  132|  1.29k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|  1.29k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  237|  1.29k|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|  1.29k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  238|  11.0k|  } else if (aot == AOT_AAC_LC) {
  ------------------
  |  |   34|  11.0k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (238:14): [True: 725, False: 10.3k]
  ------------------
  239|    725|    if (flag_framelength_small)
  ------------------
  |  Branch (239:9): [True: 322, False: 403]
  ------------------
  240|    322|      return (FRAME_LEN_960 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |   94|    322|#define FRAME_LEN_960 960
  ------------------
                    return (FRAME_LEN_960 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|    322|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_960 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|    322|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|    322|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  241|    322|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    322|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  242|    403|    else
  243|    403|      return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |   91|    403|#define FRAME_LEN_1024 1024
  ------------------
                    return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|    403|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_1024 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|    403|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|    403|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  244|    403|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    403|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  245|  10.3k|  } else if (aot == AOT_USAC) {
  ------------------
  |  |  142|  10.3k|#define AOT_USAC (42)
  ------------------
  |  Branch (245:14): [True: 8.22k, False: 2.10k]
  ------------------
  246|  8.22k|    return (FRAME_LEN_1024 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   91|  8.22k|#define FRAME_LEN_1024 1024
  ------------------
  247|  8.22k|            INPUT_DELAY_LC) *
  ------------------
  |  |  132|  8.22k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|  8.22k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
  248|  8.22k|           IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|  8.22k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  249|  8.22k|  } else if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|  2.10k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (249:14): [True: 396, False: 1.71k]
  ------------------
  250|    396|    if (flag_framelength_small)
  ------------------
  |  Branch (250:9): [True: 168, False: 228]
  ------------------
  251|    168|      return (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |   93|    168|#define FRAME_LEN_480 480
  ------------------
                    return (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |  155|    168|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_480) *
  ------------------
  |  |  142|    168|#define INPUT_DELAY_LD_480 ((CORE_DELAY_LD_480)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  141|    168|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
  252|    168|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    168|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  253|    228|    else
  254|    228|      return (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |   92|    228|#define FRAME_LEN_512 512
  ------------------
                    return (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |  155|    228|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                    return (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LD_512) *
  ------------------
  |  |  134|    228|#define INPUT_DELAY_LD_512 ((CORE_DELAY_LD_512)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  133|    228|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
  255|    228|             IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    228|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  256|  1.71k|  } else if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.71k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (256:14): [True: 1.71k, False: 0]
  ------------------
  257|  1.71k|    if (flag_framelength_small) {
  ------------------
  |  Branch (257:9): [True: 810, False: 900]
  ------------------
  258|    810|      if (mps_enable) {
  ------------------
  |  Branch (258:11): [True: 552, False: 258]
  ------------------
  259|    552|        return (FRAME_LEN_480 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   93|    552|#define FRAME_LEN_480 480
  ------------------
  260|    552|                INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |  147|    552|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|    552|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
  261|    552|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    552|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  262|    552|      } else {
  263|    258|        return (FRAME_LEN_480 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   93|    258|#define FRAME_LEN_480 480
  ------------------
  264|    258|                INPUT_DELAY_ELD_480) *
  ------------------
  |  |  144|    258|#define INPUT_DELAY_ELD_480 ((CORE_DELAY_LD_480 / 2) * 2 + 0 - (15 * 64) + 576)
  |  |  ------------------
  |  |  |  |  141|    258|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
  265|    258|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    258|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  266|    258|      }
  267|    900|    } else {
  268|    900|      if (mps_enable) {
  ------------------
  |  Branch (268:11): [True: 544, False: 356]
  ------------------
  269|    544|        return (FRAME_LEN_512 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   92|    544|#define FRAME_LEN_512 512
  ------------------
  270|    544|                INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |  139|    544|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    544|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
  271|    544|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    544|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  272|    544|      } else {
  273|    356|        return (FRAME_LEN_512 * (1 << downsample_fac) + max_upsamp_delay + max_downsamp_delay +
  ------------------
  |  |   92|    356|#define FRAME_LEN_512 512
  ------------------
  274|    356|                INPUT_DELAY_ELD_512) *
  ------------------
  |  |  136|    356|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|    356|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
  275|    356|               IXHEAACE_MAX_CH_IN_BS_ELE * delay_buf_size;
  ------------------
  |  |   22|    356|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  276|    356|      }
  277|    900|    }
  278|  1.71k|  } 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|  12.9k|}
ixheaace_api.c:iusace_scratch_size:
  142|  4.11k|static WORD32 iusace_scratch_size(VOID) {
  143|  4.11k|  WORD32 scr_size;
  144|  4.11k|  scr_size = IXHEAAC_GET_SIZE_ALIGNED(USACE_MAX_SCR_SIZE, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  145|  4.11k|  return scr_size;
  146|  4.11k|}
ixheaace_api.c:ixheaace_alloc_and_assign_mem:
 1557|  6.47k|                                                  ixheaace_input_config *ptr_in_cfg) {
 1558|  6.47k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  6.47k|#define IA_NO_ERROR 0x00000000
  ------------------
 1559|  6.47k|  UWORD32 i_idx;
 1560|  6.47k|  pVOID pv_value;
 1561|  32.3k|  for (i_idx = 0; i_idx < 4; i_idx++) {
  ------------------
  |  Branch (1561:19): [True: 25.8k, False: 6.47k]
  ------------------
 1562|  25.8k|    if (i_idx == IA_ENHAACPLUSENC_OUTPUT_IDX &&
  ------------------
  |  |   32|  51.7k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
  |  Branch (1562:9): [True: 6.47k, False: 19.4k]
  ------------------
 1563|  6.47k|        pstr_api_struct->config[0].usac_config.use_drc_element) {
  ------------------
  |  Branch (1563:9): [True: 1.44k, False: 5.02k]
  ------------------
 1564|  1.44k|      WORD32 drc_config_size_expected =
 1565|  1.44k|          get_drc_config_size(pstr_api_struct, ptr_in_cfg);
 1566|  1.44k|      if (drc_config_size_expected > MAX_DRC_CONFIG_SIZE_EXPECTED) {
  ------------------
  |  |   83|  1.44k|#define MAX_DRC_CONFIG_SIZE_EXPECTED (14336) /* 14 KB*/
  ------------------
  |  Branch (1566:11): [True: 0, False: 1.44k]
  ------------------
 1567|      0|        return IA_EXHEAACE_CONFIG_FATAL_DRC_INVALID_CONFIG;
 1568|      0|      }
 1569|  1.44k|      pstr_api_struct->pstr_mem_info[i_idx].ui_size += drc_config_size_expected;
 1570|  1.44k|    }
 1571|  25.8k|    ptr_out_cfg->mem_info_table[i_idx].ui_size = pstr_api_struct->pstr_mem_info[i_idx].ui_size;
 1572|  25.8k|    ptr_out_cfg->mem_info_table[i_idx].ui_alignment =
 1573|  25.8k|        pstr_api_struct->pstr_mem_info[i_idx].ui_alignment;
 1574|  25.8k|    ptr_out_cfg->mem_info_table[i_idx].ui_type = pstr_api_struct->pstr_mem_info[i_idx].ui_type;
 1575|       |
 1576|  25.8k|    ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count] =
 1577|  25.8k|        ptr_out_cfg->malloc_xheaace(ptr_out_cfg->mem_info_table[i_idx].ui_size +
 1578|  25.8k|                                        ptr_out_cfg->mem_info_table[i_idx].ui_alignment,
 1579|  25.8k|                                    ptr_out_cfg->mem_info_table[i_idx].ui_alignment);
 1580|       |
 1581|  25.8k|    if (NULL == ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count]) {
  ------------------
  |  Branch (1581:9): [True: 0, False: 25.8k]
  ------------------
 1582|      0|      return IA_EXHEAACE_API_FATAL_MEM_ALLOC;
 1583|      0|    }
 1584|  25.8k|    memset(ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count], 0,
 1585|  25.8k|           ptr_out_cfg->mem_info_table[i_idx].ui_size);
 1586|  25.8k|    if ((i_idx == IA_ENHAACPLUSENC_PERSIST_IDX) || (i_idx == IA_ENHAACPLUSENC_SCRATCH_IDX)) {
  ------------------
  |  |   29|  25.8k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
                  if ((i_idx == IA_ENHAACPLUSENC_PERSIST_IDX) || (i_idx == IA_ENHAACPLUSENC_SCRATCH_IDX)) {
  ------------------
  |  |   30|  19.4k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
  |  Branch (1586:9): [True: 6.47k, False: 19.4k]
  |  Branch (1586:52): [True: 6.47k, False: 12.9k]
  ------------------
 1587|  12.9k|      ptr_out_cfg->ui_rem =
 1588|  12.9k|          (SIZE_T)((SIZE_T)ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count] %
 1589|  12.9k|                   ptr_out_cfg->mem_info_table[i_idx].ui_alignment);
 1590|       |
 1591|  12.9k|      pv_value = ptr_out_cfg->mem_info_table[i_idx].mem_ptr =
 1592|  12.9k|          (pVOID)((WORD8 *)ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count] +
 1593|  12.9k|                  ptr_out_cfg->mem_info_table[i_idx].ui_alignment - ptr_out_cfg->ui_rem);
 1594|  12.9k|    } else {
 1595|  12.9k|      pv_value = ptr_out_cfg->mem_info_table[i_idx].mem_ptr =
 1596|  12.9k|          ptr_out_cfg->arr_alloc_memory[ptr_out_cfg->malloc_count];
 1597|  12.9k|    }
 1598|       |
 1599|  25.8k|    pstr_api_struct->pp_mem[i_idx] = ptr_out_cfg->mem_info_table[i_idx].mem_ptr;
 1600|  25.8k|    memset(pstr_api_struct->pp_mem[i_idx], 0, pstr_api_struct->pstr_mem_info[i_idx].ui_size);
 1601|       |
 1602|  25.8k|    pstr_api_struct->pp_mem[i_idx] = pv_value;
 1603|       |
 1604|  25.8k|    if (i_idx == IA_ENHAACPLUSENC_PERSIST_IDX) {
  ------------------
  |  |   29|  25.8k|#define IA_ENHAACPLUSENC_PERSIST_IDX (0)
  ------------------
  |  Branch (1604:9): [True: 6.47k, False: 19.4k]
  ------------------
 1605|  6.47k|      WORD32 offset_size = IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_state_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.47k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1606|  6.47k|      WORD8 *p_offset = NULL;
 1607|       |
 1608|       |      /* Set persistent memory pointer in api obj */
 1609|  6.47k|      pstr_api_struct->pstr_state = (ixheaace_state_struct *)pv_value;
 1610|  6.47k|      WORD32 i, inp_delay_size;
 1611|  6.47k|      WORD8 *p_temp;
 1612|  6.47k|      if (pstr_api_struct->usac_en) {
  ------------------
  |  Branch (1612:11): [True: 4.11k, False: 2.35k]
  ------------------
 1613|  4.11k|        memset(pstr_api_struct->pstr_state, 0, sizeof(*(pstr_api_struct->pstr_state)));
 1614|  4.11k|        ia_usac_encoder_config_struct *pstr_usac_config = &pstr_api_struct->config[0].usac_config;
 1615|  4.11k|        ixheaace_state_struct *pstr_state = pstr_api_struct->pstr_state;
 1616|  4.11k|        ia_usac_data_struct *pstr_usac_enc_data = &(pstr_state->str_usac_enc_data);
 1617|       |
 1618|  4.11k|        pstr_state->ptr_in_buf = (FLOAT32 **)((WORD8 *)pstr_state + offset_size);
 1619|       |
 1620|  4.11k|        offset_size = pstr_usac_config->channels * sizeof(FLOAT32 *);
 1621|  4.11k|        p_offset = (WORD8 *)pstr_state->ptr_in_buf +
 1622|  4.11k|                   IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1623|       |
 1624|       |        // Input delay
 1625|  4.11k|        pstr_state->inp_delay = (FLOAT32 *)(p_offset);
 1626|  4.11k|        inp_delay_size =
 1627|  4.11k|            2 *
 1628|  4.11k|            ia_enhaacplus_enc_sizeof_delay_buffer(
 1629|  4.11k|                0, AOT_USAC, pstr_api_struct->config[0].ccfl_idx,
  ------------------
  |  |  142|  4.11k|#define AOT_USAC (42)
  ------------------
 1630|  4.11k|                sizeof(pstr_state->inp_delay[0]), pstr_api_struct->config[0].use_mps) *
 1631|  4.11k|            pstr_api_struct->config[0].num_bs_elements;
 1632|  4.11k|        memset(pstr_state->inp_delay, 0, inp_delay_size);
 1633|  4.11k|        p_offset += IXHEAAC_GET_SIZE_ALIGNED(inp_delay_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  4.11k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1634|  4.11k|        if (1 == pstr_usac_config->sbr_enable) {
  ------------------
  |  Branch (1634:13): [True: 2.89k, False: 1.22k]
  ------------------
 1635|  2.89k|          if (2 != pstr_usac_config->channels) {
  ------------------
  |  Branch (1635:15): [True: 756, False: 2.13k]
  ------------------
 1636|    756|            pstr_api_struct->pstr_state->time_signal = (FLOAT32 *)(p_offset);
 1637|       |
 1638|    756|            memset(pstr_api_struct->pstr_state->time_signal, 0,
 1639|    756|                   (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal[0]));
  ------------------
  |  |  111|    756|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    756|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    756|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    756|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|    756|            offset_size =
 1641|    756|                (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal[0]);
  ------------------
  |  |  111|    756|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    756|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    756|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    756|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1642|    756|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    756|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1643|    756|          }
 1644|       |
 1645|  2.89k|          pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[0] =
 1646|  2.89k|              (struct ixheaace_str_sbr_enc *)p_offset;
 1647|  2.89k|          p_offset = p_offset + ixheaace_sbr_enc_pers_size(pstr_usac_config->channels, 0,
 1648|  2.89k|                                                           pstr_usac_config->sbr_harmonic);
 1649|  2.89k|        }
 1650|  4.11k|        if (1 == pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1650:13): [True: 1.19k, False: 2.91k]
  ------------------
 1651|  1.19k|          pstr_api_struct->pstr_state->time_signal_mps = (FLOAT32 *)(p_offset);
 1652|       |
 1653|  1.19k|          memset(pstr_api_struct->pstr_state->time_signal_mps, 0,
 1654|  1.19k|                 (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]));
  ------------------
  |  |  111|  1.19k|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|  1.19k|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|  1.19k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.19k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1655|  1.19k|          offset_size =
 1656|  1.19k|              (MAX_INPUT_SAMPLES) * sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
  ------------------
  |  |  111|  1.19k|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|  1.19k|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|  1.19k|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.19k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1657|  1.19k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.19k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1658|  1.19k|          pstr_api_struct->pstr_state->mps_bs = (UWORD8 *)(p_offset);
 1659|       |
 1660|  1.19k|          memset(pstr_api_struct->pstr_state->mps_bs, 0,
 1661|  1.19k|                 (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]));
  ------------------
  |  |   64|  1.19k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1662|       |
 1663|  1.19k|          offset_size =
 1664|  1.19k|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]);
  ------------------
  |  |   64|  1.19k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1665|  1.19k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.19k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1666|       |
 1667|  1.19k|          pstr_api_struct->pstr_state->mps_pers_mem = (ixheaace_mps_212_memory_struct *)p_offset;
 1668|  1.19k|          p_offset +=
 1669|  1.19k|              IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.19k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1670|  2.91k|        } else {
 1671|  2.91k|          pstr_api_struct->pstr_state->mps_bs = NULL;
 1672|  2.91k|        }
 1673|  4.11k|        if (1 == pstr_usac_config->use_drc_element) {
  ------------------
  |  Branch (1673:13): [True: 1.44k, False: 2.66k]
  ------------------
 1674|  1.44k|          pstr_state->pp_drc_in_buf = (FLOAT32 **)((WORD8 *)p_offset);
 1675|  1.44k|          offset_size = pstr_usac_config->channels * sizeof(pstr_state->pp_drc_in_buf[0]);
 1676|  1.44k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  1.44k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1677|  1.44k|          p_temp = p_offset;
 1678|       |
 1679|  3.88k|          for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1679:23): [True: 2.44k, False: 1.44k]
  ------------------
 1680|  2.44k|            pstr_state->pp_drc_in_buf[i] = (FLOAT32 *)(p_offset);
 1681|  2.44k|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  2.44k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1682|  2.44k|                (pstr_usac_config->drc_frame_size * sizeof(pstr_state->pp_drc_in_buf[0][0]) * 2),
 1683|  2.44k|                BYTE_ALIGN_8);
 1684|  2.44k|            if (pstr_usac_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (1684:17): [True: 2.37k, False: 68]
  ------------------
 1685|  2.37k|              p_offset += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  2.37k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1686|  2.37k|                  ((CC_DELAY_ADJUSTMENT * pstr_usac_config->drc_frame_size) / FRAME_LEN_1024) *
 1687|  2.37k|                      sizeof(pstr_state->pp_drc_in_buf[0][0]),
 1688|  2.37k|                  BYTE_ALIGN_8);
 1689|  2.37k|            }
 1690|  2.44k|          }
 1691|  1.44k|          memset(p_temp, 0, (p_offset - p_temp));
 1692|  1.44k|        }
 1693|  4.11k|        p_temp = p_offset;
 1694|       |
 1695|  11.0k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1695:21): [True: 6.94k, False: 4.11k]
  ------------------
 1696|  6.94k|          pstr_state->ptr_in_buf[i] = (FLOAT32 *)(p_offset);
 1697|  6.94k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((pstr_usac_config->ccfl * sizeof(FLOAT32) * 2),
  ------------------
  |  |   87|  6.94k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1698|  6.94k|                                               BYTE_ALIGN_8);
 1699|  6.94k|          if (pstr_usac_config->use_delay_adjustment) {
  ------------------
  |  Branch (1699:15): [True: 6.70k, False: 236]
  ------------------
 1700|  6.70k|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(
  ------------------
  |  |   87|  6.70k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1701|  6.70k|                ((CC_DELAY_ADJUSTMENT * pstr_usac_config->ccfl) / FRAME_LEN_1024) *
 1702|  6.70k|                    sizeof(FLOAT32),
 1703|  6.70k|                BYTE_ALIGN_8);
 1704|  6.70k|          }
 1705|  6.94k|        }
 1706|  4.11k|        memset(p_temp, 0, (p_offset - p_temp));
 1707|       |
 1708|  4.11k|        p_temp = p_offset;
 1709|  11.0k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1709:21): [True: 6.94k, False: 4.11k]
  ------------------
 1710|  6.94k|          pstr_usac_enc_data->ptr_time_data[i] = (FLOAT64 *)(p_offset);
 1711|  6.94k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((2 * (pstr_usac_config->ccfl) * sizeof(FLOAT64)),
  ------------------
  |  |   87|  6.94k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1712|  6.94k|                                                BYTE_ALIGN_8);
 1713|  6.94k|        }
 1714|       |
 1715|  11.0k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1715:21): [True: 6.94k, False: 4.11k]
  ------------------
 1716|  6.94k|          pstr_usac_enc_data->ptr_look_ahead_time_data[i] = (FLOAT64 *)(p_offset);
 1717|  6.94k|          p_offset +=
 1718|  6.94k|              IXHEAAC_GET_SIZE_ALIGNED((pstr_usac_config->ccfl * sizeof(FLOAT64)), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.94k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1719|  6.94k|        }
 1720|       |
 1721|  11.0k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1721:21): [True: 6.94k, False: 4.11k]
  ------------------
 1722|  6.94k|          pstr_usac_enc_data->spectral_line_vector[i] = (FLOAT64 *)(p_offset);
 1723|  6.94k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((2 * pstr_usac_config->ccfl * sizeof(FLOAT64)),
  ------------------
  |  |   87|  6.94k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1724|  6.94k|                                                BYTE_ALIGN_8);
 1725|  6.94k|        }
 1726|       |
 1727|  11.0k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1727:21): [True: 6.94k, False: 4.11k]
  ------------------
 1728|  6.94k|          pstr_usac_enc_data->ptr_2frame_time_data[i] = (FLOAT64 *)(p_offset);
 1729|  6.94k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED((3 * pstr_usac_config->ccfl * sizeof(FLOAT64)),
  ------------------
  |  |   87|  6.94k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1730|  6.94k|                                                BYTE_ALIGN_8);
 1731|  6.94k|        }
 1732|  4.11k|        memset(p_temp, 0, p_offset - p_temp);
 1733|       |
 1734|  4.11k|        if (pstr_usac_config->tns_select != 0) {
  ------------------
  |  Branch (1734:13): [True: 1.89k, False: 2.22k]
  ------------------
 1735|  1.89k|          p_temp = p_offset;
 1736|  5.15k|          for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1736:23): [True: 3.26k, False: 1.89k]
  ------------------
 1737|  3.26k|            pstr_usac_enc_data->pstr_tns_info[i] = (ia_tns_info *)(p_offset);
 1738|  3.26k|            p_offset += IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_tns_info), BYTE_ALIGN_8);
  ------------------
  |  |   87|  3.26k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1739|  3.26k|          }
 1740|  1.89k|          memset(p_temp, 0, p_offset - p_temp);
 1741|  1.89k|        }
 1742|       |
 1743|  4.11k|        p_temp = p_offset;
 1744|  11.0k|        for (i = 0; i < pstr_usac_config->channels; i++) {
  ------------------
  |  Branch (1744:21): [True: 6.94k, False: 4.11k]
  ------------------
 1745|  6.94k|          pstr_usac_enc_data->td_encoder[i] = (ia_usac_td_encoder_struct *)(p_offset);
 1746|  6.94k|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(sizeof(ia_usac_td_encoder_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  6.94k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1747|  6.94k|        }
 1748|  4.11k|        memset(p_temp, 0, p_offset - p_temp);
 1749|  4.11k|      } else {
 1750|  2.35k|        WORD32 num_aac_chan;
 1751|  2.35k|        ixheaace_state_struct *pstr_state = pstr_api_struct->pstr_state;
 1752|  2.35k|        memset(pstr_api_struct->pstr_state, 0, sizeof(*(pstr_api_struct->pstr_state)));
 1753|       |
 1754|  2.35k|        pstr_api_struct->pstr_state->inp_delay = (FLOAT32 *)((WORD8 *)pstr_state + offset_size);
 1755|  2.35k|        offset_size = ia_enhaacplus_enc_sizeof_delay_buffer(
 1756|  2.35k|                          pstr_api_struct->config[0].aac_config.flag_framelength_small,
 1757|  2.35k|                          pstr_api_struct->config[0].aot, 3,
 1758|  2.35k|                          sizeof(pstr_api_struct->pstr_state->inp_delay[0]),
 1759|  2.35k|                          pstr_api_struct->config[0].use_mps) *
 1760|  2.35k|                      pstr_api_struct->config[0].num_bs_elements;
 1761|  2.35k|        p_offset = (WORD8 *)pstr_api_struct->pstr_state->inp_delay +
 1762|  2.35k|                   IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|  2.35k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1763|       |
 1764|  2.35k|        if (pstr_api_struct->config[0].use_mps) {
  ------------------
  |  Branch (1764:13): [True: 556, False: 1.80k]
  ------------------
 1765|    556|          pstr_api_struct->pstr_state->time_signal_mps = (FLOAT32 *)(p_offset);
 1766|       |
 1767|    556|          memset(pstr_api_struct->pstr_state->time_signal_mps, 0,
 1768|    556|                 (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    556|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    556|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    556|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    556|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                               (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  139|    556|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    556|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                               (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    556|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1769|    556|                     sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]));
 1770|    556|          offset_size =
 1771|    556|              (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  111|    556|#define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |  101|    556|#define MAX_FRAME_LEN (1024)
  |  |  ------------------
  |  |               #define MAX_INPUT_SAMPLES (MAX_FRAME_LEN * MAX_INPUT_CHAN * 4)
  |  |  ------------------
  |  |  |  |   99|    556|#define MAX_INPUT_CHAN (IXHEAACE_MAX_CH_IN_BS_ELE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    556|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                            (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |  139|    556|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|    556|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                            (MAX_INPUT_SAMPLES + (INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE)) *
  ------------------
  |  |   22|    556|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 1772|    556|              sizeof(pstr_api_struct->pstr_state->time_signal_mps[0]);
 1773|    556|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    556|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1774|       |
 1775|    556|          pstr_api_struct->pstr_state->mps_bs = (UWORD8 *)(p_offset);
 1776|    556|          memset(pstr_api_struct->pstr_state->mps_bs, 0,
 1777|    556|                 (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]));
  ------------------
  |  |   64|    556|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1778|    556|          offset_size =
 1779|    556|              (MAX_MPS_BS_PAYLOAD_SIZE) * sizeof(pstr_api_struct->pstr_state->mps_bs[0]);
  ------------------
  |  |   64|    556|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 1780|    556|          p_offset += IXHEAAC_GET_SIZE_ALIGNED(offset_size, BYTE_ALIGN_8);
  ------------------
  |  |   87|    556|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1781|       |
 1782|    556|          if (pstr_api_struct->config[0].mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    556|#define TREE_212 (0)
  ------------------
  |  Branch (1782:15): [True: 158, False: 398]
  ------------------
 1783|    158|            pstr_api_struct->pstr_state->mps_pers_mem =
 1784|    158|                (ixheaace_mps_212_memory_struct *)p_offset;
 1785|    158|            p_offset +=
 1786|    158|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_212_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    158|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1787|    398|          } else {
 1788|    398|            pstr_api_struct->pstr_state->mps_515_pers_mem =
 1789|    398|                (ixheaace_mps_515_memory_struct *)p_offset;
 1790|    398|            p_offset +=
 1791|    398|                IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_mps_515_memory_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|    398|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
 1792|    398|          }
 1793|  1.80k|        } else {
 1794|  1.80k|          pstr_api_struct->pstr_state->mps_bs = NULL;
 1795|  1.80k|        }
 1796|       |
 1797|  7.24k|        for (WORD32 ele_idx = 0; ele_idx < pstr_api_struct->config[0].num_bs_elements;
  ------------------
  |  Branch (1797:34): [True: 4.88k, False: 2.35k]
  ------------------
 1798|  4.88k|             ele_idx++) {
 1799|  4.88k|          num_aac_chan = pstr_api_struct->config[ele_idx].aac_classic
  ------------------
  |  Branch (1799:26): [True: 1.58k, False: 3.30k]
  ------------------
 1800|  4.88k|                             ? pstr_api_struct->config[ele_idx].chmode_nchannels
 1801|  4.88k|                             : (pstr_api_struct->config[ele_idx].use_parametric_stereo
  ------------------
  |  Branch (1801:33): [True: 232, False: 3.07k]
  ------------------
 1802|  3.30k|                                    ? 1
 1803|  3.30k|                                    : pstr_api_struct->config[ele_idx].chmode_nchannels);
 1804|       |
 1805|       |          /* Set aac enc persistent memory pointer in api obj */
 1806|  4.88k|          pstr_api_struct->pstr_state->aac_enc_pers_mem[ele_idx] =
 1807|  4.88k|              (iexheaac_encoder_str *)p_offset;
 1808|  4.88k|          p_offset = p_offset + ia_enhaacplus_enc_aac_enc_pers_size(
 1809|  4.88k|                                    num_aac_chan, pstr_api_struct->config[ele_idx].aot);
 1810|       |
 1811|  4.88k|          if (pstr_api_struct->config[ele_idx].aot != AOT_AAC_LC &&
  ------------------
  |  |   34|  9.77k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (1811:15): [True: 3.97k, False: 919]
  ------------------
 1812|  3.97k|              pstr_api_struct->config[ele_idx].aot != AOT_AAC_LD) {
  ------------------
  |  |   36|  3.97k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (1812:15): [True: 3.51k, False: 459]
  ------------------
 1813|  3.51k|            if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (1813:17): [True: 3.24k, False: 266]
  ------------------
 1814|       |              /* Set spectral_band_replication_ enc persistent memory pointer in api obj */
 1815|  3.24k|              pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[ele_idx] =
 1816|  3.24k|                  (struct ixheaace_str_sbr_enc *)p_offset;
 1817|       |
 1818|  3.24k|              p_offset =
 1819|  3.24k|                  p_offset +
 1820|  3.24k|                  ixheaace_sbr_enc_pers_size(
 1821|  3.24k|                      num_aac_chan, pstr_api_struct->config[ele_idx].use_parametric_stereo, 0);
 1822|  3.24k|            }
 1823|  3.51k|          }
 1824|  4.88k|        }
 1825|  2.35k|      }
 1826|  6.47k|    }
 1827|       |
 1828|  25.8k|    if ((i_idx == IA_MEMTYPE_SCRATCH) && pstr_api_struct->usac_en) {
  ------------------
  |  |   30|  25.8k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
  |  Branch (1828:9): [True: 6.47k, False: 19.4k]
  |  Branch (1828:42): [True: 4.11k, False: 2.35k]
  ------------------
 1829|  4.11k|      pstr_api_struct->pstr_state->str_usac_enc_data.str_scratch.ptr_scratch_buf =
 1830|  4.11k|          (UWORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_SCRATCH];
  ------------------
  |  |   30|  4.11k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1831|  4.11k|      memset(pstr_api_struct->pp_mem[IA_MEMTYPE_SCRATCH], 0,
  ------------------
  |  |   30|  4.11k|#define IA_MEMTYPE_SCRATCH 0x01
  ------------------
 1832|  4.11k|             pstr_api_struct->pstr_mem_info[i_idx].ui_size);
 1833|  4.11k|    }
 1834|  25.8k|    if (i_idx == IA_ENHAACPLUSENC_INPUT_IDX) {
  ------------------
  |  |   31|  25.8k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
  |  Branch (1834:9): [True: 6.47k, False: 19.4k]
  ------------------
 1835|  6.47k|      ptr_out_cfg->ui_inp_buf_size = ptr_out_cfg->mem_info_table[i_idx].ui_size;
 1836|  6.47k|    }
 1837|  25.8k|    ptr_out_cfg->malloc_count++;
 1838|  25.8k|  }
 1839|  6.47k|  return err_code;
 1840|  6.47k|}
ixheaace_api.c:get_drc_config_size:
 1524|  1.44k|                                  ixheaace_input_config *ptr_in_cfg) {
 1525|  1.44k|  WORD32 bit_count = 0;
 1526|  1.44k|  WORD32 total_byte_cnt = 0;
 1527|       |
 1528|  1.44k|  ia_drc_enc_state *pstr_drc_state =
 1529|  1.44k|      &pstr_api_struct->pstr_state->str_usac_enc_data.str_drc_state;
 1530|  1.44k|  ia_drc_input_config *pstr_in_drc_cfg = (ia_drc_input_config *)ptr_in_cfg->pv_drc_cfg;
 1531|       |
 1532|  1.44k|  memset(pstr_drc_state, 0, sizeof(*pstr_drc_state));
 1533|       |
 1534|  1.44k|  pstr_drc_state->str_enc_params = pstr_in_drc_cfg->str_enc_params;
 1535|  1.44k|  pstr_drc_state->str_uni_drc_config = pstr_in_drc_cfg->str_uni_drc_config;
 1536|  1.44k|  pstr_drc_state->str_gain_enc.str_loudness_info_set = pstr_in_drc_cfg->str_enc_loudness_info_set;
 1537|  1.44k|  pstr_drc_state->str_enc_gain_extension = pstr_in_drc_cfg->str_enc_gain_extension;
 1538|  1.44k|  pstr_drc_state->str_gain_enc.str_uni_drc_config = pstr_in_drc_cfg->str_uni_drc_config;
 1539|  1.44k|  pstr_drc_state->drc_scratch_mem =
 1540|  1.44k|      pstr_api_struct->pstr_state->str_usac_enc_data.str_scratch.ptr_scratch_buf;
 1541|  1.44k|  pstr_drc_state->str_gain_enc.base_ch_count = ptr_in_cfg->i_channels;
 1542|       |
 1543|       |  //uniDrc payload size
 1544|  1.44k|  impd_drc_write_uni_drc_config(pstr_drc_state, &bit_count, 0);
 1545|  1.44k|  total_byte_cnt += ((bit_count + 7) >> 3);
 1546|  1.44k|  bit_count = 0;
 1547|       |
 1548|       |  // LoudnessInfo payload size
 1549|  1.44k|  impd_drc_write_loudness_info_set(pstr_drc_state, NULL, &bit_count, 0);
 1550|  1.44k|  total_byte_cnt += ((bit_count + 7) >> 3);
 1551|       |
 1552|  1.44k|  return total_byte_cnt;
 1553|  1.44k|}
ixheaace_api.c:ia_enhaacplus_enc_init:
 2264|  4.87k|static IA_ERRORCODE ia_enhaacplus_enc_init(ixheaace_api_struct *pstr_api_struct, WORD32 ele_idx) {
 2265|  4.87k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.87k|#define IA_NO_ERROR 0x00000000
  ------------------
 2266|  4.87k|  WORD32 anc_flag = 0;
 2267|  4.87k|  WORD32 anc_rate = -1;
 2268|  4.87k|  WORD32 anc_mode = 0;
 2269|  4.87k|  WORD32 core_ch;
 2270|  4.87k|  WORD32 asc_channels;
 2271|  4.87k|  WORD8 *ptr_resampler_scratch;
 2272|  4.87k|  iaace_scratch *pstr_aac_scratch;
 2273|  4.87k|  WORD8 *ptr_spectral_band_replication_scratch;
 2274|  4.87k|  UWORD32 core_sample_rate;
 2275|  4.87k|  ixheaace_state_struct *pstr_enc_state = pstr_api_struct->pstr_state;
 2276|  4.87k|  ixheaace_audio_specific_config_struct *pstr_asc = &pstr_enc_state->audio_specific_config;
 2277|       |
 2278|  4.87k|  iaace_config *pstr_aac_config = &(pstr_api_struct->config[ele_idx].aac_config);
 2279|       |
 2280|  4.87k|  ixheaace_config_ancillary *pstr_ancillary = &(pstr_api_struct->config[ele_idx].pstr_ancillary);
 2281|  4.87k|  pstr_aac_scratch = (iaace_scratch *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  4.87k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2282|  4.87k|  ptr_spectral_band_replication_scratch =
 2283|  4.87k|      ((pWORD8)pstr_aac_scratch) + ia_enhaacplus_enc_aac_enc_scr_size();
 2284|  4.87k|  ptr_resampler_scratch = ((pWORD8)pstr_aac_scratch) + ia_enhaacplus_enc_aac_enc_scr_size() +
 2285|  4.87k|                          ixheaace_sbr_enc_scr_size();
 2286|       |
 2287|       |  /* fill pstr_ancillary data */
 2288|  4.87k|  pstr_ancillary->anc_flag = anc_flag;
 2289|  4.87k|  pstr_ancillary->anc_mode = anc_mode;
 2290|  4.87k|  pstr_ancillary->anc_rate = anc_rate;
 2291|  4.87k|  pstr_api_struct->pstr_state->temp_buff_aac =
 2292|  4.87k|      (void *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|  4.87k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2293|  4.87k|  pstr_api_struct->pstr_state->temp_buff_sbr =
 2294|  4.87k|      (void *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|  4.87k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2295|  4.87k|               ia_enhaacplus_enc_aac_enc_scr_size());
 2296|       |
 2297|  4.87k|  if (pstr_api_struct->config[ele_idx].use_mps &&
  ------------------
  |  Branch (2297:7): [True: 592, False: 4.28k]
  ------------------
 2298|    592|      pstr_api_struct->config[ele_idx].mps_tree_config != TREE_212) {
  ------------------
  |  |   39|    592|#define TREE_212 (0)
  ------------------
  |  Branch (2298:7): [True: 434, False: 158]
  ------------------
 2299|    434|    pstr_api_struct->pstr_state->mps_scratch =
 2300|    434|        (FLOAT32 *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|    434|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2301|    434|                    ia_enhaacplus_enc_aac_enc_scr_size());
 2302|       |
 2303|    434|    pstr_api_struct->pstr_state->ptr_temp_buff_resamp =
 2304|    434|        (void *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|    434|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2305|    434|                 ia_enhaacplus_enc_aac_enc_scr_size() + ixheaace_sbr_enc_scr_size());
 2306|  4.44k|  } else {
 2307|  4.44k|    pstr_api_struct->pstr_state->ptr_temp_buff_resamp =
 2308|  4.44k|        (void *)((WORD8 *)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX] +
  ------------------
  |  |   30|  4.44k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2309|  4.44k|                 ia_enhaacplus_enc_aac_enc_scr_size() + ixheaace_sbr_enc_scr_size());
 2310|  4.44k|  }
 2311|       |
 2312|  4.87k|  if (pstr_api_struct->config[ele_idx].chmode_nchannels == 2) {
  ------------------
  |  Branch (2312:7): [True: 2.41k, False: 2.46k]
  ------------------
 2313|       |    /* When the chmode option is not used,
 2314|       |      the number of channels depends on the input file */
 2315|  2.41k|    pstr_api_struct->config[ele_idx].chmode_nchannels =
 2316|  2.41k|        pstr_api_struct->config[ele_idx].i_channels;
 2317|  2.41k|  }
 2318|       |
 2319|  4.87k|  switch (pstr_api_struct->pstr_state->aot) {
  ------------------
  |  Branch (2319:11): [True: 4.87k, False: 0]
  ------------------
 2320|  1.05k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.05k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2320:5): [True: 1.05k, False: 3.82k]
  ------------------
 2321|  2.82k|    case AOT_SBR:
  ------------------
  |  |  141|  2.82k|#define AOT_SBR (5)
  ------------------
  |  Branch (2321:5): [True: 1.77k, False: 3.10k]
  ------------------
 2322|  3.05k|    case AOT_PS:
  ------------------
  |  |   39|  3.05k|#define AOT_PS (29)
  ------------------
  |  Branch (2322:5): [True: 232, False: 4.64k]
  ------------------
 2323|  3.05k|      pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_LC;
  ------------------
  |  |  132|  3.05k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|  3.05k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
 2324|  3.05k|      break;
 2325|       |
 2326|    533|    case AOT_AAC_LD:
  ------------------
  |  |   36|    533|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2326:5): [True: 533, False: 4.34k]
  ------------------
 2327|    533|      if (pstr_aac_config->flag_framelength_small == 1) {
  ------------------
  |  Branch (2327:11): [True: 254, False: 279]
  ------------------
 2328|    254|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_LD_480;
  ------------------
  |  |  142|    254|#define INPUT_DELAY_LD_480 ((CORE_DELAY_LD_480)*2 - 1024 + 1)
  |  |  ------------------
  |  |  |  |  141|    254|#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|    533|      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.59k]
  ------------------
 2335|  1.28k|      if (pstr_aac_config->flag_framelength_small == 1) {
  ------------------
  |  Branch (2335:11): [True: 576, False: 709]
  ------------------
 2336|    576|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_ELD_480;
  ------------------
  |  |  144|    576|#define INPUT_DELAY_ELD_480 ((CORE_DELAY_LD_480 / 2) * 2 + 0 - (15 * 64) + 576)
  |  |  ------------------
  |  |  |  |  141|    576|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2337|    709|      } else {
 2338|    709|        pstr_api_struct->pstr_state->buffer_offset = INPUT_DELAY_ELD_512;
  ------------------
  |  |  136|    709|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|    709|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2339|    709|      }
 2340|  1.28k|      break;
 2341|  4.87k|  }
 2342|  4.87k|  pstr_api_struct->pstr_state->downsample[ele_idx] = 0;
 2343|  4.87k|  pstr_api_struct->config->frame_count = 0;
 2344|  4.87k|  core_ch = pstr_api_struct->config[ele_idx].chmode_nchannels;
 2345|  4.87k|  pstr_aac_config->sample_rate = pstr_api_struct->config[ele_idx].sample_rate;
 2346|  4.87k|  pstr_aac_config->core_sample_rate = pstr_api_struct->config[ele_idx].sample_rate;
 2347|  4.87k|  pstr_aac_config->native_sample_rate = pstr_api_struct->config[ele_idx].native_sample_rate;
 2348|  4.87k|  pstr_aac_config->num_in_channels = pstr_api_struct->config[ele_idx].i_channels;
 2349|  4.87k|  pstr_aac_config->num_out_channels = pstr_api_struct->config[ele_idx].chmode_nchannels;
 2350|  4.87k|  if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (2350:7): [True: 3.28k, False: 1.58k]
  ------------------
 2351|  3.28k|    pstr_aac_config->core_sample_rate = pstr_aac_config->core_sample_rate / 2;
 2352|  3.28k|  }
 2353|  4.87k|  if (pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2353:7): [True: 540, False: 4.33k]
  ------------------
 2354|    540|    switch (pstr_api_struct->pstr_state->mps_tree_config) {
  ------------------
  |  Branch (2354:13): [True: 540, False: 0]
  ------------------
 2355|    154|      case TREE_212:
  ------------------
  |  |   39|    154|#define TREE_212 (0)
  ------------------
  |  Branch (2355:7): [True: 154, False: 386]
  ------------------
 2356|    278|      case TREE_5151:
  ------------------
  |  |   40|    278|#define TREE_5151 (1)
  ------------------
  |  Branch (2356:7): [True: 124, False: 416]
  ------------------
 2357|    317|      case TREE_5152:
  ------------------
  |  |   41|    317|#define TREE_5152 (2)
  ------------------
  |  Branch (2357:7): [True: 39, False: 501]
  ------------------
 2358|    317|        pstr_aac_config->num_out_channels = 1;
 2359|    317|        core_ch = 1;
 2360|    317|        break;
 2361|       |
 2362|    223|      case TREE_525:
  ------------------
  |  |   42|    223|#define TREE_525 (3)
  ------------------
  |  Branch (2362:7): [True: 223, False: 317]
  ------------------
 2363|    223|        pstr_aac_config->num_out_channels = 2;
 2364|    223|        core_ch = 2;
 2365|    223|        break;
 2366|    540|    }
 2367|    540|  }
 2368|       |
 2369|  4.87k|  if (pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2369:7): [True: 232, False: 4.64k]
  ------------------
 2370|    232|    pstr_api_struct->config[ele_idx].chmode_nchannels = 2;
 2371|    232|    pstr_aac_config->num_out_channels = 1;
 2372|    232|    core_ch = 1;
 2373|    232|    pstr_api_struct->config[ele_idx].element_type = ID_SCE;
 2374|    232|  }
 2375|  4.87k|  if ((pstr_api_struct->config[ele_idx].i_channels == 2) &&
  ------------------
  |  Branch (2375:7): [True: 2.41k, False: 2.46k]
  ------------------
 2376|  2.41k|      (pstr_api_struct->config[ele_idx].chmode == 0)) {
  ------------------
  |  Branch (2376:7): [True: 0, False: 2.41k]
  ------------------
 2377|      0|    pstr_api_struct->config[ele_idx].chmode_nchannels = 1;
 2378|      0|    pstr_aac_config->num_out_channels = 1;
 2379|      0|  }
 2380|  4.87k|  if ((pstr_api_struct->config[ele_idx].use_parametric_stereo) &&
  ------------------
  |  Branch (2380:7): [True: 232, False: 4.64k]
  ------------------
 2381|    232|      (pstr_api_struct->config[ele_idx].aac_classic)) {
  ------------------
  |  Branch (2381:7): [True: 0, False: 232]
  ------------------
 2382|      0|    return (IA_EXHEAACE_CONFIG_FATAL_AAC_CLASSIC_WITH_PS);
 2383|      0|  }
 2384|       |
 2385|  4.87k|  if (!(pstr_api_struct->config[ele_idx].adts_flag) &&
  ------------------
  |  Branch (2385:7): [True: 3.20k, False: 1.67k]
  ------------------
 2386|  3.20k|      (pstr_api_struct->config[0].aac_config.calc_crc)) {
  ------------------
  |  Branch (2386:7): [True: 0, False: 3.20k]
  ------------------
 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.87k|  if ((pstr_api_struct->config[0].chmode == 3) &&
  ------------------
  |  Branch (2392:7): [True: 0, False: 4.87k]
  ------------------
 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.87k|  pstr_aac_config->bit_rate = ixheaac_min32(360000 * core_ch, pstr_aac_config->bit_rate);
 2400|  4.87k|  pstr_aac_config->bit_rate = ixheaac_max32(8000 * core_ch, pstr_aac_config->bit_rate);
 2401|  4.87k|  switch (pstr_api_struct->pstr_state->aot) {
  ------------------
  |  Branch (2401:11): [True: 4.87k, False: 0]
  ------------------
 2402|  1.05k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.05k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2402:5): [True: 1.05k, False: 3.82k]
  ------------------
 2403|  2.82k|    case AOT_SBR:
  ------------------
  |  |  141|  2.82k|#define AOT_SBR (5)
  ------------------
  |  Branch (2403:5): [True: 1.77k, False: 3.10k]
  ------------------
 2404|  3.05k|    case AOT_PS:
  ------------------
  |  |   39|  3.05k|#define AOT_PS (29)
  ------------------
  |  Branch (2404:5): [True: 232, False: 4.64k]
  ------------------
 2405|  3.05k|      pstr_aac_config->bit_rate = ia_enhaacplus_aac_limitbitrate(
 2406|  3.05k|          pstr_aac_config->core_sample_rate,
 2407|  3.05k|          (pstr_aac_config->flag_framelength_small ? FRAME_LEN_960 : FRAME_LEN_1024), core_ch,
  ------------------
  |  |   94|  1.02k|#define FRAME_LEN_960 960
  ------------------
                        (pstr_aac_config->flag_framelength_small ? FRAME_LEN_960 : FRAME_LEN_1024), core_ch,
  ------------------
  |  |   91|  2.03k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2407:12): [True: 1.02k, False: 2.03k]
  ------------------
 2408|  3.05k|          pstr_aac_config->bit_rate);
 2409|  3.05k|      break;
 2410|       |
 2411|    533|    case AOT_AAC_LD:
  ------------------
  |  |   36|    533|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2411:5): [True: 533, False: 4.34k]
  ------------------
 2412|  1.81k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.81k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2412:5): [True: 1.28k, False: 3.59k]
  ------------------
 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|    988|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2415:12): [True: 830, False: 988]
  ------------------
 2416|  1.81k|          pstr_aac_config->bit_rate);
 2417|  1.81k|      break;
 2418|  4.87k|  }
 2419|  4.87k|  if (pstr_api_struct->config[ele_idx].eldsbr_found == 1) {
  ------------------
  |  Branch (2419:7): [True: 3.28k, False: 1.58k]
  ------------------
 2420|  3.28k|    WORD32 num_iter = 0;
 2421|  3.28k|    WORD32 initial_bitrate, adjusted_bitrate;
 2422|  3.28k|    adjusted_bitrate = pstr_aac_config->bit_rate;
 2423|       |
 2424|       |    /* Find total bitrate which provides valid configuration for each SBR element. */
 2425|  3.75k|    do {
 2426|  3.75k|      WORD32 e;
 2427|  3.75k|      WORD32 q_format;
 2428|  3.75k|      initial_bitrate = adjusted_bitrate;
 2429|       |
 2430|  11.2k|      for (e = 0; e < pstr_api_struct->config[ele_idx].num_bs_elements; e++) {
  ------------------
  |  Branch (2430:19): [True: 8.38k, False: 2.81k]
  ------------------
 2431|  8.38k|        WORD32 sbr_element_bitate_in, sbr_bitrate_out;
 2432|       |
 2433|  8.38k|        sbr_element_bitate_in = pstr_aac_config->bit_rate;
 2434|  8.38k|        sbr_bitrate_out = ixheaace_sbr_limit_bitrate(
 2435|  8.38k|            sbr_element_bitate_in, core_ch, pstr_aac_config->core_sample_rate,
 2436|  8.38k|            pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2437|  8.38k|            pstr_api_struct->pstr_state->aot);
 2438|       |
 2439|  8.38k|        if (sbr_bitrate_out == 0) {
  ------------------
  |  Branch (2439:13): [True: 0, False: 8.38k]
  ------------------
 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.38k|        if (sbr_element_bitate_in != sbr_bitrate_out) {
  ------------------
  |  Branch (2445:13): [True: 940, False: 7.44k]
  ------------------
 2446|    940|          if (sbr_element_bitate_in < sbr_bitrate_out) {
  ------------------
  |  Branch (2446:15): [True: 940, False: 0]
  ------------------
 2447|    940|            adjusted_bitrate = ixheaac_max32(
 2448|    940|                initial_bitrate,
 2449|    940|                (WORD32)ixheaac_div32((WORD32)(sbr_bitrate_out + 8), MAX_32, &q_format));
  ------------------
  |  |   60|    940|#define MAX_32 (WORD32)0x7fffffffL
  ------------------
 2450|    940|            adjusted_bitrate = adjusted_bitrate >> (q_format - 31);
 2451|    940|            break;
 2452|    940|          }
 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.38k|      } /* elements */
 2464|       |
 2465|  3.75k|      num_iter++; /* restrict iteration to worst case of num elements */
 2466|       |
 2467|  3.75k|    } while ((initial_bitrate != adjusted_bitrate) &&
  ------------------
  |  Branch (2467:14): [True: 470, False: 3.28k]
  ------------------
 2468|    470|             (num_iter <= pstr_api_struct->config[ele_idx].num_bs_elements));
  ------------------
  |  Branch (2468:14): [True: 470, False: 0]
  ------------------
 2469|       |
 2470|       |    /* Unequal bitrates mean that no reasonable bitrate configuration found. */
 2471|  3.28k|    pstr_aac_config->bit_rate = (initial_bitrate == adjusted_bitrate) ? adjusted_bitrate : 0;
  ------------------
  |  Branch (2471:33): [True: 3.28k, False: 0]
  ------------------
 2472|  3.28k|  }
 2473|       |
 2474|  4.87k|  pstr_asc->str_aac_config.frame_length_flag = pstr_aac_config->flag_framelength_small;
 2475|  4.87k|  pstr_asc->sampling_frequency = pstr_api_struct->config[0].native_sample_rate;
 2476|  4.87k|  asc_channels = pstr_api_struct->config[ele_idx].i_channels_mode;
 2477|  4.87k|  pstr_asc->channel_configuration =
 2478|  4.87k|      (pstr_api_struct->pstr_state->mps_enable ? core_ch : asc_channels);
  ------------------
  |  Branch (2478:8): [True: 540, False: 4.33k]
  ------------------
 2479|  4.87k|  pstr_asc->channel_configuration =
 2480|  4.87k|      pstr_api_struct->config[ele_idx].use_parametric_stereo
  ------------------
  |  Branch (2480:7): [True: 232, False: 4.64k]
  ------------------
 2481|  4.87k|          ? 1
 2482|  4.87k|          : (pstr_api_struct->pstr_state->mps_enable
  ------------------
  |  Branch (2482:14): [True: 540, False: 4.10k]
  ------------------
 2483|  4.64k|                 ? core_ch
 2484|  4.64k|                 : pstr_api_struct->config[ele_idx].i_channels_mode);
 2485|       |
 2486|  4.87k|  if (!(pstr_api_struct->config[ele_idx].aac_classic) &&
  ------------------
  |  Branch (2486:7): [True: 3.28k, False: 1.58k]
  ------------------
 2487|  3.28k|      ixheaace_is_sbr_setting_available(
  ------------------
  |  Branch (2487:7): [True: 3.26k, False: 27]
  ------------------
 2488|  3.28k|          pstr_aac_config->bit_rate,
 2489|  3.28k|          (pstr_api_struct->pstr_state->mps_enable
  ------------------
  |  Branch (2489:12): [True: 540, False: 2.74k]
  ------------------
 2490|  3.28k|               ? 1
 2491|  3.28k|               : pstr_api_struct->config[ele_idx].chmode_nchannels),
 2492|  3.28k|          pstr_aac_config->sample_rate, &core_sample_rate,
 2493|  3.28k|          pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2494|  3.28k|          pstr_api_struct->pstr_state->aot)) {
 2495|  3.26k|    ixheaace_str_sbr_cfg spectral_band_replication_config;
 2496|  3.26k|    ixheaace_initialize_sbr_defaults(&spectral_band_replication_config);
 2497|       |
 2498|  3.26k|    spectral_band_replication_config.use_ps =
 2499|  3.26k|        pstr_api_struct->config[ele_idx].use_parametric_stereo;
 2500|  3.26k|    spectral_band_replication_config.crc_sbr = 0;
 2501|  3.26k|    spectral_band_replication_config.parametric_coding = 1;
 2502|  3.26k|    spectral_band_replication_config.is_esbr = pstr_api_struct->config[0].esbr_flag;
 2503|  3.26k|    if (pstr_api_struct->pstr_state->aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  3.26k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2503:9): [True: 1.27k, False: 1.98k]
  ------------------
 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.98k|    } else if (pstr_api_struct->pstr_state->aot == AOT_SBR ||
  ------------------
  |  |  141|  3.97k|#define AOT_SBR (5)
  ------------------
  |  Branch (2507:16): [True: 1.75k, False: 232]
  ------------------
 2508|  1.98k|               pstr_api_struct->pstr_state->aot == AOT_PS) {
  ------------------
  |  |   39|    232|#define AOT_PS (29)
  ------------------
  |  Branch (2508:16): [True: 232, False: 0]
  ------------------
 2509|  1.98k|      spectral_band_replication_config.frame_flag_960 = pstr_aac_config->flag_framelength_small;
 2510|  1.98k|      spectral_band_replication_config.sbr_codec = HEAAC_SBR;
 2511|  1.98k|    }
 2512|       |
 2513|  3.26k|    if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (2513:9): [True: 3.26k, False: 0]
  ------------------
 2514|  3.26k|      pstr_api_struct->pstr_state->downsample[ele_idx] = 1;
 2515|  3.26k|    }
 2516|       |
 2517|  3.26k|    if (pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2517:9): [True: 536, False: 2.72k]
  ------------------
 2518|    536|      if (pstr_api_struct->pstr_state->mps_tree_config == TREE_212) {
  ------------------
  |  |   39|    536|#define TREE_212 (0)
  ------------------
  |  Branch (2518:11): [True: 150, False: 386]
  ------------------
 2519|    150|        WORD32 delay =
 2520|    150|            ((pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 / 2 : FRAME_LEN_512 / 2) *
  ------------------
  |  |   93|     83|#define FRAME_LEN_480 480
  ------------------
                          ((pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 / 2 : FRAME_LEN_512 / 2) *
  ------------------
  |  |   92|     67|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2520:15): [True: 83, False: 67]
  ------------------
 2521|    150|                 2 +
 2522|    150|             4);
 2523|    150|        ixheaace_mps_212_memory_struct *pstr_mps_memory;
 2524|    150|        pstr_mps_memory = pstr_api_struct->pstr_state->mps_pers_mem;
 2525|    150|        ixheaace_mps_212_open(&pstr_api_struct->pstr_mps_212_enc, pstr_mps_memory);
 2526|       |
 2527|    150|        pstr_asc->str_aac_config.num_sac_cfg_bits = 0;
 2528|       |
 2529|    150|        error = ixheaace_mps_212_initialise(
 2530|    150|            pstr_api_struct->pstr_mps_212_enc, AOT_AAC_ELD, pstr_aac_config->sample_rate,
  ------------------
  |  |   37|    150|#define AOT_AAC_ELD (39)
  ------------------
 2531|    150|            &pstr_aac_config->bit_rate,
 2532|    150|            pstr_api_struct->config[ele_idx].eldsbr_found ? 2 /*hAacConfig->sbrRatio*/ : 0,
  ------------------
  |  Branch (2532:13): [True: 150, False: 0]
  ------------------
 2533|    150|            (pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 * 2 : FRAME_LEN_512 * 2),
  ------------------
  |  |   93|     83|#define FRAME_LEN_480 480
  ------------------
                          (pstr_aac_config->flag_framelength_small ? FRAME_LEN_480 * 2 : FRAME_LEN_512 * 2),
  ------------------
  |  |   92|     67|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2533:14): [True: 83, False: 67]
  ------------------
 2534|       |            /* for dual rate sbr this value is already multiplied by 2 */
 2535|    150|            (pstr_aac_config->flag_framelength_small
  ------------------
  |  Branch (2535:14): [True: 83, False: 67]
  ------------------
 2536|    150|                 ? FRAME_LEN_480 * 2
  ------------------
  |  |   93|     83|#define FRAME_LEN_480 480
  ------------------
 2537|    150|                 : FRAME_LEN_512 * 2) /* samples read per ch*/,
  ------------------
  |  |   92|     67|#define FRAME_LEN_512 512
  ------------------
 2538|    150|            delay, (WORD8 *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp);
 2539|    150|        if (error) {
  ------------------
  |  Branch (2539:13): [True: 0, False: 150]
  ------------------
 2540|      0|          return error;
 2541|      0|        }
 2542|       |
 2543|    150|        pstr_asc->str_aac_config.num_sac_cfg_bits = ixheaace_mps_212_get_spatial_specific_config(
 2544|    150|            pstr_api_struct->pstr_mps_212_enc, (WORD8 *)pstr_asc->str_aac_config.sac_cfg_data,
 2545|    150|            sizeof(pstr_asc->str_aac_config.sac_cfg_data), AOT_AAC_ELD);
  ------------------
  |  |   37|    150|#define AOT_AAC_ELD (39)
  ------------------
 2546|    150|        pstr_asc->str_aac_config.eld_ext_type[0] = IAAC_ELDEXT_LDSAC;
 2547|    150|        pstr_asc->str_aac_config.eld_ext_len[0] =
 2548|    150|            (pstr_asc->str_aac_config.num_sac_cfg_bits + 7) >> 3;
 2549|    386|      } else {
 2550|    386|        WORD32 tree_config;
 2551|    386|        WORD32 bits_written;
 2552|    386|        ixheaace_bit_buf bit_buf;
 2553|    386|        ixheaace_bit_buf_handle ptr_bit_buf;
 2554|    386|        ixheaace_mps_515_memory_struct *pstr_mps_memory;
 2555|    386|        if (pstr_api_struct->pstr_state->mps_tree_config == TREE_525) {
  ------------------
  |  |   42|    386|#define TREE_525 (3)
  ------------------
  |  Branch (2555:13): [True: 223, False: 163]
  ------------------
 2556|    223|          tree_config = 525;
 2557|    223|        } else if (pstr_api_struct->pstr_state->mps_tree_config == TREE_5152) {
  ------------------
  |  |   41|    163|#define TREE_5152 (2)
  ------------------
  |  Branch (2557:20): [True: 39, False: 124]
  ------------------
 2558|     39|          tree_config = 5152;
 2559|    124|        } else {
 2560|    124|          tree_config = 5151;
 2561|    124|        }
 2562|    386|        pstr_mps_memory = pstr_api_struct->pstr_state->mps_515_pers_mem;
 2563|    386|        ptr_bit_buf = ia_enhaacplus_enc_create_bitbuffer(
 2564|    386|            &bit_buf, (UWORD8 *)pstr_asc->str_aac_config.sac_cfg_data,
 2565|    386|            sizeof(pstr_asc->str_aac_config.sac_cfg_data));
 2566|       |
 2567|    386|        error = ixheaace_mps_515_open(
 2568|    386|            &pstr_api_struct->pstr_mps_515_enc, pstr_aac_config->sample_rate, tree_config,
 2569|    386|            ptr_bit_buf, &bits_written, pstr_mps_memory, pstr_aac_config->flag_framelength_small);
 2570|    386|        pstr_asc->str_aac_config.num_sac_cfg_bits = bits_written;
 2571|    386|        pstr_asc->str_aac_config.eld_ext_type[0] = IAAC_ELDEXT_LDSAC;
 2572|    386|        pstr_asc->str_aac_config.eld_ext_len[0] = (bits_written + 7) >> 3;
 2573|    386|        if (error) {
  ------------------
  |  Branch (2573:13): [True: 0, False: 386]
  ------------------
 2574|      0|          return error;
 2575|      0|        }
 2576|    386|      }
 2577|    536|    }
 2578|       |
 2579|  3.26k|    ixheaace_adjust_sbr_settings(
 2580|  3.26k|        &spectral_band_replication_config, pstr_aac_config->bit_rate,
 2581|  3.26k|        pstr_aac_config->num_out_channels, core_sample_rate, AACENC_TRANS_FAC, 24000,
  ------------------
  |  |   23|  3.26k|#define AACENC_TRANS_FAC 8    /* encoder WORD16 long ratio */
  ------------------
 2582|  3.26k|        pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2583|  3.26k|        pstr_api_struct->pstr_state->aot, (pstr_api_struct->config[0].ccfl_idx == SBR_4_1));
  ------------------
  |  |  199|  3.26k|#define SBR_4_1 (4)
  ------------------
 2584|       |
 2585|  3.26k|    if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (2585:9): [True: 2.99k, False: 263]
  ------------------
 2586|       |      /* open SBR PART, set core bandwidth */
 2587|  2.99k|      error = ixheaace_env_open(
 2588|  2.99k|          &pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[ele_idx],
 2589|  2.99k|          &spectral_band_replication_config, &pstr_aac_config->band_width,
 2590|  2.99k|          ptr_spectral_band_replication_scratch,
 2591|  2.99k|          &(pstr_api_struct->spectral_band_replication_tabs),
 2592|  2.99k|          &pstr_asc->str_aac_config.sbr_config);
 2593|  2.99k|      pstr_asc->str_aac_config.ld_sbr_present_flag =
 2594|  2.99k|          pstr_api_struct->config[ele_idx].eldsbr_found;
 2595|  2.99k|      if (error) {
  ------------------
  |  Branch (2595:11): [True: 0, False: 2.99k]
  ------------------
 2596|      0|        return error;
 2597|      0|      }
 2598|  2.99k|      pstr_asc->str_aac_config.ld_sbr_sample_rate =
 2599|  2.99k|          (spectral_band_replication_config.codec_settings.sample_freq !=
  ------------------
  |  Branch (2599:11): [True: 2.99k, False: 0]
  ------------------
 2600|  2.99k|           pstr_aac_config->sample_rate)
 2601|  2.99k|              ? 1
 2602|  2.99k|              : 0;
 2603|  2.99k|      pstr_asc->str_aac_config.ld_sbr_crc_flag = spectral_band_replication_config.crc_sbr;
 2604|  2.99k|    }
 2605|       |
 2606|  3.26k|    if (!pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2606:9): [True: 3.02k, False: 232]
  ------------------
 2607|  3.02k|      IA_ERRORCODE resamp_error = IA_NO_ERROR;
  ------------------
  |  |   23|  3.02k|#define IA_NO_ERROR 0x00000000
  ------------------
 2608|  3.02k|      WORD32 ch_idx = 0;
 2609|       |
 2610|  3.02k|      resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2611|  3.02k|          &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx]), 2,
 2612|  3.02k|          pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2613|  3.02k|      if (resamp_error) {
  ------------------
  |  Branch (2613:11): [True: 0, False: 3.02k]
  ------------------
 2614|      0|        return resamp_error;
 2615|      0|      }
 2616|  3.02k|      if (pstr_api_struct->config[ele_idx].i_channels > 1) {
  ------------------
  |  Branch (2616:11): [True: 1.78k, False: 1.24k]
  ------------------
 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|  3.02k|    }
 2625|  3.26k|  } else {
 2626|  1.61k|    if (!(pstr_api_struct->config[ele_idx].aac_classic &&
  ------------------
  |  Branch (2626:11): [True: 1.58k, False: 27]
  ------------------
 2627|  1.58k|          !(pstr_api_struct->config[ele_idx].eldsbr_found))) {
  ------------------
  |  Branch (2627:11): [True: 1.58k, False: 0]
  ------------------
 2628|     27|      if (pstr_api_struct->config[ele_idx].aac_classic == 0) {
  ------------------
  |  Branch (2628:11): [True: 27, False: 0]
  ------------------
 2629|     27|        error = IA_EXHEAACE_INIT_FATAL_AACPLUS_NOT_AVAIL;
 2630|     27|      } else {
 2631|      0|        error = IA_EXHEAACE_INIT_FATAL_BITRATE_NOT_SUPPORTED;
 2632|      0|      }
 2633|     27|      return error;
 2634|     27|    }
 2635|  1.58k|    pstr_api_struct->pstr_state->buffer_offset = 0;
 2636|  1.58k|    pstr_api_struct->config[ele_idx].aac_classic = 1;
 2637|  1.58k|  }
 2638|  4.84k|  {
 2639|  4.84k|    WORD32 *shared_buf1, *shared_buf2;
 2640|  4.84k|    WORD32 *shared_buf3;
 2641|  4.84k|    WORD8 *shared_buf4;
 2642|  4.84k|    switch (pstr_api_struct->pstr_state->aot) {
  ------------------
  |  Branch (2642:13): [True: 4.84k, False: 0]
  ------------------
 2643|  1.05k|      case AOT_AAC_LC:
  ------------------
  |  |   34|  1.05k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2643:7): [True: 1.05k, False: 3.79k]
  ------------------
 2644|  2.80k|      case AOT_SBR:
  ------------------
  |  |  141|  2.80k|#define AOT_SBR (5)
  ------------------
  |  Branch (2644:7): [True: 1.75k, False: 3.09k]
  ------------------
 2645|  3.04k|      case AOT_PS:
  ------------------
  |  |   39|  3.04k|#define AOT_PS (29)
  ------------------
  |  Branch (2645:7): [True: 232, False: 4.61k]
  ------------------
 2646|  3.04k|        ia_enhaacplus_enc_get_shared_bufs(
 2647|  3.04k|            ptr_spectral_band_replication_scratch, &shared_buf1, &shared_buf2, &shared_buf3,
 2648|  3.04k|            &shared_buf4,
 2649|  3.04k|            (pstr_aac_config->flag_framelength_small == 1) ? FRAME_LEN_960 : FRAME_LEN_1024);
  ------------------
  |  |   94|  1.02k|#define FRAME_LEN_960 960
  ------------------
                          (pstr_aac_config->flag_framelength_small == 1) ? FRAME_LEN_960 : FRAME_LEN_1024);
  ------------------
  |  |   91|  2.02k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (2649:13): [True: 1.02k, False: 2.02k]
  ------------------
 2650|  3.04k|        break;
 2651|       |
 2652|    533|      case AOT_AAC_LD:
  ------------------
  |  |   36|    533|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2652:7): [True: 533, False: 4.31k]
  ------------------
 2653|  1.80k|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2653:7): [True: 1.27k, False: 3.57k]
  ------------------
 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|    982|#define FRAME_LEN_512 512
  ------------------
  |  Branch (2657:13): [True: 825, False: 982]
  ------------------
 2658|  1.80k|        break;
 2659|  4.84k|    }
 2660|       |
 2661|  4.84k|    ia_enhaacplus_enc_set_shared_bufs(pstr_aac_scratch, &shared_buf1, &shared_buf2, &shared_buf3,
 2662|  4.84k|                                      &ptr_resampler_scratch);
 2663|       |
 2664|  4.84k|    error = ia_enhaacplus_enc_aac_enc_open(
 2665|  4.84k|        &(pstr_api_struct->pstr_state->aac_enc_pers_mem[ele_idx]),
 2666|  4.84k|        *pstr_aac_config /*, *pstr_ancillary*/, pstr_aac_scratch,
 2667|  4.84k|        &(pstr_api_struct->pstr_aac_tabs), pstr_api_struct->config[ele_idx].element_type,
 2668|  4.84k|        pstr_api_struct->config[ele_idx].element_instance_tag, pstr_api_struct->pstr_state->aot);
 2669|  4.84k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (2669:9): [True: 0, False: 4.84k]
  ------------------
 2670|      0|      return error;
 2671|      0|    }
 2672|  4.84k|    if (error) {
  ------------------
  |  Branch (2672:9): [True: 0, False: 4.84k]
  ------------------
 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.84k|  }
 2683|       |
 2684|  4.84k|  return error;
 2685|  4.84k|}
ixheaace_api.c:ia_usac_enc_init:
 1973|  4.11k|static IA_ERRORCODE ia_usac_enc_init(ixheaace_api_struct *pstr_api_struct, WORD32 ccfl_idx) {
 1974|  4.11k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.11k|#define IA_NO_ERROR 0x00000000
  ------------------
 1975|  4.11k|  WORD32 i = 0;
 1976|  4.11k|  ixheaace_config_struct *pstr_config = &pstr_api_struct->config[0];
 1977|  4.11k|  ixheaace_state_struct *pstr_enc_state = pstr_api_struct->pstr_state;
 1978|  4.11k|  ia_usac_data_struct *pstr_enc_data = &pstr_enc_state->str_usac_enc_data;
 1979|  4.11k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_config->usac_config;
 1980|       |
 1981|  4.11k|  pstr_usac_config->bit_rate = pstr_api_struct->config[0].aac_config.bit_rate;
 1982|       |
 1983|  4.11k|  if ((pstr_usac_config->codec_mode == USAC_SWITCHED) ||
  ------------------
  |  |   35|  4.11k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (1983:7): [True: 1.34k, False: 2.76k]
  ------------------
 1984|  4.00k|      (pstr_usac_config->codec_mode == USAC_ONLY_FD)) {
  ------------------
  |  |   36|  2.76k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (1984:7): [True: 2.66k, False: 108]
  ------------------
 1985|  4.00k|    pstr_usac_config->aac_allow_scalefacs = 1;
 1986|  4.00k|    if (pstr_usac_config->aac_scale_facs == 0) pstr_usac_config->aac_allow_scalefacs = 0;
  ------------------
  |  Branch (1986:9): [True: 4.00k, False: 0]
  ------------------
 1987|  4.00k|  }
 1988|       |
 1989|  4.11k|  if (pstr_usac_config->codec_mode == USAC_ONLY_TD) {
  ------------------
  |  |   37|  4.11k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (1989:7): [True: 108, False: 4.00k]
  ------------------
 1990|    284|    for (i = 0; i < pstr_config->i_channels; i++) {
  ------------------
  |  Branch (1990:17): [True: 176, False: 108]
  ------------------
 1991|    176|      pstr_enc_data->core_mode_prev[i] = CORE_MODE_FD;
  ------------------
  |  |   33|    176|#define CORE_MODE_FD (0)
  ------------------
 1992|    176|      pstr_enc_data->core_mode[i] = CORE_MODE_TD;
  ------------------
  |  |   34|    176|#define CORE_MODE_TD (1)
  ------------------
 1993|    176|    }
 1994|  4.00k|  } else {
 1995|  10.7k|    for (i = 0; i < pstr_config->i_channels; i++) {
  ------------------
  |  Branch (1995:17): [True: 6.76k, False: 4.00k]
  ------------------
 1996|  6.76k|      pstr_enc_data->core_mode_prev[i] = CORE_MODE_FD;
  ------------------
  |  |   33|  6.76k|#define CORE_MODE_FD (0)
  ------------------
 1997|  6.76k|      pstr_enc_data->core_mode[i] = CORE_MODE_FD;
  ------------------
  |  |   33|  6.76k|#define CORE_MODE_FD (0)
  ------------------
 1998|  6.76k|    }
 1999|  4.00k|  }
 2000|       |
 2001|  4.11k|  if (1 == pstr_usac_config->use_drc_element) {
  ------------------
  |  Branch (2001:7): [True: 1.44k, False: 2.66k]
  ------------------
 2002|  1.44k|    pstr_enc_data->str_scratch.drc_scratch = pstr_enc_data->str_scratch.ptr_scratch_buf;
 2003|  1.44k|  }
 2004|  4.11k|  if (pstr_usac_config->sbr_enable) {
  ------------------
  |  Branch (2004:7): [True: 2.89k, False: 1.22k]
  ------------------
 2005|  2.89k|    WORD8 *sbr_scr_ptr = (WORD8 *)pstr_enc_data->str_scratch.ptr_scratch_buf;
 2006|  2.89k|    ixheaace_audio_specific_config_struct *pstr_asc = &pstr_enc_state->audio_specific_config;
 2007|  2.89k|    ixheaace_str_sbr_cfg spectral_band_replication_config;
 2008|       |    // SBR defaults
 2009|  2.89k|    iaace_config *pstr_sbr_config = &(pstr_api_struct->config[0].aac_config);
 2010|  2.89k|    WORD32 sbr_ratio = 0;
 2011|  2.89k|    WORD32 samples = pstr_usac_config->ccfl;
 2012|       |    // Set scratch buffers for SBR and resampler
 2013|  2.89k|    pstr_api_struct->pstr_state->temp_buff_sbr =
 2014|  2.89k|        (WORD8 *)pstr_enc_data->str_scratch.ptr_scratch_buf;
 2015|  2.89k|    pstr_api_struct->pstr_state->ptr_temp_buff_resamp =
 2016|  2.89k|        (WORD8 *)pstr_enc_data->str_scratch.ptr_scratch_buf + ixheaace_sbr_enc_scr_size();
 2017|       |
 2018|  2.89k|    ixheaace_initialize_sbr_defaults(&spectral_band_replication_config);
 2019|       |    // Set SBR codec as USAC
 2020|  2.89k|    spectral_band_replication_config.sbr_codec = USAC_SBR;
 2021|  2.89k|    spectral_band_replication_config.sbr_pvc_active = pstr_usac_config->sbr_pvc_active;
 2022|  2.89k|    spectral_band_replication_config.sbr_harmonic = pstr_usac_config->sbr_harmonic;
 2023|  2.89k|    spectral_band_replication_config.hq_esbr = pstr_usac_config->hq_esbr;
 2024|  2.89k|    pstr_usac_config->core_sample_rate = pstr_usac_config->sample_rate / 2;
 2025|  2.89k|    switch (pstr_usac_config->ccfl_idx) {
 2026|    565|      case SBR_4_1:
  ------------------
  |  |  199|    565|#define SBR_4_1 (4)
  ------------------
  |  Branch (2026:7): [True: 565, False: 2.32k]
  ------------------
 2027|    565|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_INDEX_4_1;
  ------------------
  |  |  188|    565|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
 2028|    565|        spectral_band_replication_config.sbr_pvc_rate = USAC_SBR_DOWNSAMPLE_RATIO_4_1;
  ------------------
  |  |  191|    565|#define USAC_SBR_DOWNSAMPLE_RATIO_4_1 (4)
  ------------------
 2029|    565|        pstr_usac_config->core_sample_rate = pstr_usac_config->sample_rate / 4;
 2030|    565|        sbr_ratio = 4;
 2031|    565|        samples *= 4;
 2032|    565|        break;
 2033|    357|      case SBR_8_3:
  ------------------
  |  |  197|    357|#define SBR_8_3 (2)
  ------------------
  |  Branch (2033:7): [True: 357, False: 2.53k]
  ------------------
 2034|    357|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_INDEX_8_3;
  ------------------
  |  |  187|    357|#define USAC_SBR_RATIO_INDEX_8_3 (2)
  ------------------
 2035|    357|        spectral_band_replication_config.sbr_pvc_rate = USAC_SBR_DOWNSAMPLE_RATIO_2_1;
  ------------------
  |  |  190|    357|#define USAC_SBR_DOWNSAMPLE_RATIO_2_1 (2)
  ------------------
 2036|    357|        sbr_ratio = 2;
 2037|    357|        samples *= 8;
 2038|    357|        samples /= 3;
 2039|    357|        break;
 2040|  1.97k|      case SBR_2_1:
  ------------------
  |  |  198|  1.97k|#define SBR_2_1 (3)
  ------------------
  |  Branch (2040:7): [True: 1.97k, False: 922]
  ------------------
 2041|  1.97k|        spectral_band_replication_config.sbr_ratio_idx = USAC_SBR_RATIO_INDEX_2_1;
  ------------------
  |  |  186|  1.97k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
 2042|  1.97k|        spectral_band_replication_config.sbr_pvc_rate = USAC_SBR_DOWNSAMPLE_RATIO_2_1;
  ------------------
  |  |  190|  1.97k|#define USAC_SBR_DOWNSAMPLE_RATIO_2_1 (2)
  ------------------
 2043|  1.97k|        sbr_ratio = 2;
 2044|  1.97k|        samples *= 2;
 2045|  1.97k|        break;
 2046|      0|      default:
  ------------------
  |  Branch (2046:7): [True: 0, False: 2.89k]
  ------------------
 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.89k|    }
 2052|  2.89k|    if (pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2052:9): [True: 1.12k, False: 1.76k]
  ------------------
 2053|  1.12k|      ixheaace_mps_212_memory_struct *pstr_mps_memory;
 2054|  1.12k|      pstr_mps_memory = pstr_api_struct->pstr_state->mps_pers_mem;
 2055|  1.12k|      ixheaace_mps_212_open(&pstr_api_struct->pstr_mps_212_enc, pstr_mps_memory);
 2056|  1.12k|      pstr_asc->str_aac_config.num_sac_cfg_bits = 0;
 2057|       |
 2058|  1.12k|      error = ixheaace_mps_212_initialise(
 2059|  1.12k|          pstr_api_struct->pstr_mps_212_enc, AOT_USAC, pstr_usac_config->sample_rate,
  ------------------
  |  |  142|  1.12k|#define AOT_USAC (42)
  ------------------
 2060|  1.12k|          &pstr_sbr_config->bit_rate, sbr_ratio, (WORD32)samples, samples, 515 * sbr_ratio,
 2061|  1.12k|          (WORD8 *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp);
 2062|  1.12k|      if (error) {
  ------------------
  |  Branch (2062:11): [True: 29, False: 1.09k]
  ------------------
 2063|     29|        return error;
 2064|     29|      }
 2065|       |
 2066|  1.09k|      pstr_asc->str_aac_config.num_sac_cfg_bits = ixheaace_mps_212_get_spatial_specific_config(
 2067|  1.09k|          pstr_api_struct->pstr_mps_212_enc, (WORD8 *)pstr_asc->str_aac_config.sac_cfg_data,
 2068|  1.09k|          sizeof(pstr_asc->str_aac_config.sac_cfg_data), AOT_USAC);
  ------------------
  |  |  142|  1.09k|#define AOT_USAC (42)
  ------------------
 2069|  1.09k|    }
 2070|  2.86k|    ixheaace_adjust_sbr_settings(
 2071|  2.86k|        &spectral_band_replication_config, pstr_sbr_config->bit_rate,
 2072|  2.86k|        (pstr_api_struct->pstr_state->mps_enable != 1) ? pstr_config->i_channels : 1,
  ------------------
  |  Branch (2072:9): [True: 1.76k, False: 1.09k]
  ------------------
 2073|  2.86k|        pstr_usac_config->core_sample_rate, AACENC_TRANS_FAC, 24000,
  ------------------
  |  |   23|  2.86k|#define AACENC_TRANS_FAC 8    /* encoder WORD16 long ratio */
  ------------------
 2074|  2.86k|        pstr_api_struct->spectral_band_replication_tabs.ptr_qmf_tab,
 2075|  2.86k|        pstr_api_struct->pstr_state->aot, (pstr_api_struct->config[0].ccfl_idx == SBR_4_1));
  ------------------
  |  |  199|  2.86k|#define SBR_4_1 (4)
  ------------------
 2076|       |
 2077|  2.86k|    error = ixheaace_env_open(
 2078|  2.86k|        &pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[0],
 2079|  2.86k|        &spectral_band_replication_config, &pstr_sbr_config->band_width, sbr_scr_ptr,
 2080|  2.86k|        &(pstr_api_struct->spectral_band_replication_tabs), &pstr_asc->str_aac_config.sbr_config);
 2081|  2.86k|    if (error) {
  ------------------
  |  Branch (2081:9): [True: 11, False: 2.85k]
  ------------------
 2082|     11|      return error;
 2083|     11|    }
 2084|       |
 2085|  2.85k|    if (pstr_api_struct->config[0].ccfl_idx >= 2) {
  ------------------
  |  Branch (2085:9): [True: 2.85k, False: 0]
  ------------------
 2086|  2.85k|      pstr_api_struct->pstr_state->downsample[0] = 1;
 2087|  2.85k|    } else {
 2088|      0|      pstr_api_struct->pstr_state->downsample[0] = 0;
 2089|      0|    }
 2090|       |
 2091|  2.85k|    if (pstr_api_struct->pstr_state->downsample[0]) {
  ------------------
  |  Branch (2091:9): [True: 2.85k, False: 0]
  ------------------
 2092|  2.85k|      IA_ERRORCODE resamp_error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.85k|#define IA_NO_ERROR 0x00000000
  ------------------
 2093|  2.85k|      WORD32 resamp_ratio = 0, upsamp_fac = 0, downsamp_fac = 0;
 2094|  2.85k|      WORD32 ele_idx = 0, ch_idx = 0;
 2095|       |
 2096|  2.85k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  2.85k|#define SBR_8_3 (2)
  ------------------
  |  Branch (2096:11): [True: 357, False: 2.49k]
  ------------------
 2097|    357|        upsamp_fac = 3;
 2098|    357|        downsamp_fac = 8;
 2099|    357|        pstr_usac_config->sample_rate /= 2;
 2100|  2.49k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1) {
  ------------------
  |  |  198|  2.49k|#define SBR_2_1 (3)
  ------------------
  |  Branch (2100:18): [True: 1.93k, False: 562]
  ------------------
 2101|  1.93k|        resamp_ratio = 2;
 2102|  1.93k|        pstr_usac_config->sample_rate /= 2;
 2103|  1.93k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|    562|#define SBR_4_1 (4)
  ------------------
  |  Branch (2103:18): [True: 562, False: 0]
  ------------------
 2104|    562|        resamp_ratio = 4;
 2105|    562|        pstr_usac_config->sample_rate /= 4;
 2106|    562|      }
 2107|       |
 2108|  2.85k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  2.85k|#define SBR_8_3 (2)
  ------------------
  |  Branch (2108:11): [True: 357, False: 2.49k]
  ------------------
 2109|    357|        if (upsamp_fac != 3 || downsamp_fac != 8) {
  ------------------
  |  Branch (2109:13): [True: 0, False: 357]
  |  Branch (2109:32): [True: 0, False: 357]
  ------------------
 2110|      0|          return IA_EXHEAACE_CONFIG_FATAL_USAC_RESAMPLER_RATIO;
 2111|      0|        }
 2112|  2.49k|      } else {
 2113|  2.49k|        if (resamp_ratio != 2 && resamp_ratio != 4) {
  ------------------
  |  Branch (2113:13): [True: 562, False: 1.93k]
  |  Branch (2113:34): [True: 0, False: 562]
  ------------------
 2114|      0|          return IA_EXHEAACE_CONFIG_FATAL_USAC_RESAMPLER_RATIO;
 2115|      0|        }
 2116|  2.49k|      }
 2117|  2.85k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {  // Upsampler initialization
  ------------------
  |  |  197|  2.85k|#define SBR_8_3 (2)
  ------------------
  |  Branch (2117:11): [True: 357, False: 2.49k]
  ------------------
 2118|    357|        resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2119|    357|            &(pstr_api_struct->pstr_state->up_sampler[ele_idx][ch_idx]), upsamp_fac,
 2120|    357|            pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab);
 2121|    357|        if (resamp_error) {
  ------------------
  |  Branch (2121:13): [True: 0, False: 357]
  ------------------
 2122|      0|          return resamp_error;
 2123|      0|        }
 2124|    357|        if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2124:13): [True: 172, False: 185]
  ------------------
 2125|    172|          resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2126|    172|              &(pstr_api_struct->pstr_state->up_sampler[ele_idx][ch_idx + 1]), upsamp_fac,
 2127|    172|              pstr_api_struct->spectral_band_replication_tabs.ptr_sos_upsamp_tab);
 2128|    172|          if (resamp_error) {
  ------------------
  |  Branch (2128:15): [True: 0, False: 172]
  ------------------
 2129|      0|            return resamp_error;
 2130|      0|          }
 2131|    172|        }
 2132|    357|        if (pstr_usac_config->sbr_harmonic) {
  ------------------
  |  Branch (2132:13): [True: 0, False: 357]
  ------------------
 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|    357|        resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2150|    357|            &(pstr_api_struct->pstr_state->down_samp_sos[ele_idx][ch_idx]), downsamp_fac,
 2151|    357|            pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab);
 2152|    357|        if (resamp_error) {
  ------------------
  |  Branch (2152:13): [True: 0, False: 357]
  ------------------
 2153|      0|          return resamp_error;
 2154|      0|        }
 2155|    357|        if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2155:13): [True: 172, False: 185]
  ------------------
 2156|    172|          resamp_error = ia_enhaacplus_enc_init_iir_sos_resampler(
 2157|    172|              &(pstr_api_struct->pstr_state->down_samp_sos[ele_idx][ch_idx + 1]), downsamp_fac,
 2158|    172|              pstr_api_struct->spectral_band_replication_tabs.ptr_sos_downsamp_tab);
 2159|    172|          if (resamp_error) {
  ------------------
  |  Branch (2159:15): [True: 0, False: 172]
  ------------------
 2160|      0|            return resamp_error;
 2161|      0|          }
 2162|    172|        }
 2163|    357|        if (pstr_usac_config->sbr_harmonic) {
  ------------------
  |  Branch (2163:13): [True: 0, False: 357]
  ------------------
 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.49k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1 ||
  ------------------
  |  |  198|  4.99k|#define SBR_2_1 (3)
  ------------------
  |  Branch (2180:18): [True: 1.93k, False: 562]
  ------------------
 2181|  2.49k|                 pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|    562|#define SBR_4_1 (4)
  ------------------
  |  Branch (2181:18): [True: 562, False: 0]
  ------------------
 2182|  2.49k|        resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2183|  2.49k|            &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx]), resamp_ratio,
 2184|  2.49k|            pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2185|  2.49k|        if (resamp_error) {
  ------------------
  |  Branch (2185:13): [True: 0, False: 2.49k]
  ------------------
 2186|      0|          return resamp_error;
 2187|      0|        }
 2188|  2.49k|        if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2188:13): [True: 1.93k, False: 563]
  ------------------
 2189|  1.93k|          resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2190|  1.93k|              &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch_idx + 1]), resamp_ratio,
 2191|  1.93k|              pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2192|  1.93k|          if (resamp_error) {
  ------------------
  |  Branch (2192:15): [True: 0, False: 1.93k]
  ------------------
 2193|      0|            return resamp_error;
 2194|      0|          }
 2195|  1.93k|        }
 2196|  2.49k|        if (pstr_usac_config->sbr_harmonic) {
  ------------------
  |  Branch (2196:13): [True: 1.42k, False: 1.07k]
  ------------------
 2197|  1.42k|          resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2198|  1.42k|              &(pstr_api_struct->pstr_state->hbe_down_sampler[ele_idx][ch_idx]), resamp_ratio,
 2199|  1.42k|              pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2200|  1.42k|          if (resamp_error) {
  ------------------
  |  Branch (2200:15): [True: 0, False: 1.42k]
  ------------------
 2201|      0|            return resamp_error;
 2202|      0|          }
 2203|  1.42k|          if (pstr_api_struct->config[0].i_channels > 1) {
  ------------------
  |  Branch (2203:15): [True: 1.31k, False: 111]
  ------------------
 2204|  1.31k|            resamp_error = ia_enhaacplus_enc_init_iir_resampler(
 2205|  1.31k|                &(pstr_api_struct->pstr_state->hbe_down_sampler[ele_idx][ch_idx + 1]),
 2206|  1.31k|                resamp_ratio, pstr_api_struct->spectral_band_replication_tabs.ptr_resamp_tab);
 2207|  1.31k|            if (resamp_error) {
  ------------------
  |  Branch (2207:17): [True: 0, False: 1.31k]
  ------------------
 2208|      0|              return resamp_error;
 2209|      0|            }
 2210|  1.31k|          }
 2211|  1.42k|        }
 2212|  2.49k|      }
 2213|  2.85k|    }
 2214|  2.85k|  }
 2215|       |
 2216|  4.07k|  error = iusace_enc_init(pstr_usac_config, &pstr_api_struct->pstr_state->audio_specific_config,
 2217|  4.07k|                          &pstr_api_struct->pstr_state->str_usac_enc_data);
 2218|  4.07k|  if (error & IA_FATAL_ERROR) {
  ------------------
  |  |   25|  4.07k|#define IA_FATAL_ERROR 0x80000000
  ------------------
  |  Branch (2218:7): [True: 817, False: 3.25k]
  ------------------
 2219|    817|    return error;
 2220|    817|  }
 2221|  3.25k|  pstr_api_struct->pstr_state->str_usac_enc_data.frame_count = 0;
 2222|  3.25k|  pstr_usac_config->is_ipf = 1;
 2223|  3.25k|  pstr_enc_data->stereo_config_index = (pstr_enc_state->mps_enable == 1) ? 2 : 0;
  ------------------
  |  Branch (2223:40): [True: 903, False: 2.35k]
  ------------------
 2224|  3.25k|  ia_bit_buf_struct *pstr_ia_asc_bit_buf;
 2225|  3.25k|  pstr_ia_asc_bit_buf = iusace_create_bit_buffer(
 2226|  3.25k|      &(pstr_api_struct->pstr_state->str_bit_buf), pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT],
  ------------------
  |  |   26|  3.25k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 2227|  3.25k|      pstr_api_struct->pstr_mem_info[IA_MEMTYPE_OUTPUT].ui_size, 1);
  ------------------
  |  |   26|  3.25k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 2228|  3.25k|  if (pstr_usac_config->sbr_enable) {
  ------------------
  |  Branch (2228:7): [True: 2.31k, False: 947]
  ------------------
 2229|  9.68k|    for (UWORD32 idx = 0; idx < pstr_usac_config->num_elements; idx++) {
  ------------------
  |  Branch (2229:27): [True: 7.37k, False: 2.31k]
  ------------------
 2230|  7.37k|      switch (pstr_enc_state->audio_specific_config.str_usac_config.usac_element_type[idx]) {
 2231|    592|        case ID_USAC_SCE:
  ------------------
  |  |  137|    592|#define ID_USAC_SCE 0
  ------------------
  |  Branch (2231:9): [True: 592, False: 6.77k]
  ------------------
 2232|  2.31k|        case ID_USAC_CPE:
  ------------------
  |  |  138|  2.31k|#define ID_USAC_CPE 1
  ------------------
  |  Branch (2232:9): [True: 1.71k, False: 5.65k]
  ------------------
 2233|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2234|  2.31k|              .stereo_config_index = pstr_enc_data->stereo_config_index;
 2235|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2236|  2.31k|              .str_usac_sbr_config.bs_inter_tes = pstr_usac_config->sbr_inter_tes_active;
 2237|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2238|  2.31k|              .str_usac_sbr_config.bs_pvc = pstr_usac_config->sbr_pvc_active;
 2239|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2240|  2.31k|              .str_usac_sbr_config.dflt_header_extra1 = 0;
 2241|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2242|  2.31k|              .str_usac_sbr_config.dflt_header_extra2 = 0;
 2243|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2244|  2.31k|              .str_usac_sbr_config.dflt_start_freq = 0;
 2245|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2246|  2.31k|              .str_usac_sbr_config.dflt_stop_freq = 4;
 2247|  2.31k|          pstr_enc_state->audio_specific_config.str_usac_config.str_usac_element_config[idx]
 2248|  2.31k|              .str_usac_sbr_config.harmonic_sbr = pstr_usac_config->sbr_harmonic;
 2249|  2.31k|          break;
 2250|  5.06k|        default:
  ------------------
  |  Branch (2250:9): [True: 5.06k, False: 2.31k]
  ------------------
 2251|  5.06k|          continue;
 2252|  7.37k|      }
 2253|  7.37k|    }
 2254|  2.31k|  }
 2255|       |
 2256|  3.25k|  ixheaace_get_audiospecific_config_bytes(pstr_ia_asc_bit_buf,
 2257|  3.25k|                                          &pstr_api_struct->pstr_state->audio_specific_config,
 2258|  3.25k|                                          AOT_USAC, ccfl_idx);
  ------------------
  |  |  142|  3.25k|#define AOT_USAC (42)
  ------------------
 2259|  3.25k|  pstr_api_struct->pstr_state->i_out_bytes = (pstr_ia_asc_bit_buf->cnt_bits + 7) >> 3;
 2260|       |
 2261|  3.25k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  3.25k|#define IA_NO_ERROR 0x00000000
  ------------------
 2262|  3.25k|}
ixheaace_api.c:ia_enhaacplus_enc_execute:
 2688|   302k|                                              WORD32 ele_idx) {
 2689|   302k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   302k|#define IA_NO_ERROR 0x00000000
  ------------------
 2690|   302k|  WORD32 downsample;
 2691|   302k|  WORD32 aot;
 2692|   302k|  WORD32 idx;
 2693|   302k|  WORD32 header_bytes = 0;
 2694|   302k|  WORD32 num_samples_read;
 2695|   302k|  WORD32 env_read_offset = 0;
 2696|   302k|  WORD32 write_off_set = 0;
 2697|   302k|  WORD32 aacenc_blocksize;
 2698|   302k|  WORD32 ch, out_samples;
 2699|   302k|  WORD32 total_channels = 0, ele, slot;
 2700|   302k|  WORD32 time_in_stride;
 2701|   302k|  WORD32 num_bs_elements;
 2702|   302k|  FLAG flag_last_element;
 2703|   302k|  WORD32 i_num_coup_channels;
 2704|   302k|  WORD32 i_channels_mask;
 2705|   302k|  ixheaace_pstr_sbr_enc pstr_sbr_encoder = NULL;
 2706|   302k|  iexheaac_encoder_str **pstr_aac_enc;
 2707|   302k|  iaace_config *pstr_aac_config;
 2708|   302k|  pWORD16 pw_inp_buf = NULL;
 2709|   302k|  pUWORD8 pub_out_buf = NULL;
 2710|   302k|  FLOAT32 *ptr_input_buffer = NULL;
 2711|   302k|  FLOAT32 *ptr_input_buffer_mps = NULL;
 2712|   302k|  FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 2713|   302k|  WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   302k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2714|   302k|  WORD32 *pstr_aac_scratch = (pWORD32)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_SCRATCH_IDX];
  ------------------
  |  |   30|   302k|#define IA_ENHAACPLUSENC_SCRATCH_IDX (1)
  ------------------
 2715|   302k|  WORD8 *ptr_spectral_band_replication_scratch =
 2716|   302k|      ((pWORD8)pstr_aac_scratch) + ia_enhaacplus_enc_aac_enc_scr_size();
 2717|   302k|  WORD32 *total_fill_bits = &(pstr_api_struct->pstr_state->total_fill_bits);
 2718|   302k|  WORD32 *write_program_config_element =
 2719|   302k|      &(pstr_api_struct->config[0].write_program_config_element);
 2720|       |
 2721|   302k|  aot = pstr_api_struct->pstr_state->aot;
 2722|   302k|  num_bs_elements = pstr_api_struct->config[0].num_bs_elements;
 2723|   302k|  flag_last_element = (ele_idx == (num_bs_elements - 1));
 2724|   302k|  i_num_coup_channels = pstr_api_struct->config[0].i_num_coupling_chan;
 2725|   302k|  i_channels_mask = pstr_api_struct->config[0].i_channels_mask;
 2726|   302k|  aacenc_blocksize = pstr_api_struct->config[0].frame_length;
 2727|   302k|  downsample = pstr_api_struct->pstr_state->downsample[ele_idx];
 2728|   302k|  num_samples_read =
 2729|   302k|      aacenc_blocksize * pstr_api_struct->config[ele_idx].i_native_channels * (1 << downsample);
 2730|  1.10M|  for (ele = 0; ele < num_bs_elements; ele++) {
  ------------------
  |  Branch (2730:17): [True: 804k, False: 302k]
  ------------------
 2731|   804k|    total_channels += pstr_api_struct->config[ele].i_native_channels;
 2732|   804k|  }
 2733|   302k|  pstr_aac_config = &(pstr_api_struct->config[ele_idx].aac_config);
 2734|   302k|  if ((pstr_api_struct->config[ele_idx].aac_classic == 0) &&
  ------------------
  |  Branch (2734:7): [True: 215k, False: 86.2k]
  ------------------
 2735|   215k|      pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2735:7): [True: 19.4k, False: 196k]
  ------------------
 2736|  19.4k|    time_in_stride = 1;
 2737|   282k|  } else if ((pstr_api_struct->config[ele_idx].aac_classic == 1) &&
  ------------------
  |  Branch (2737:14): [True: 86.2k, False: 196k]
  ------------------
 2738|  86.2k|             (pstr_api_struct->config[ele_idx].num_bs_elements == 1)) {
  ------------------
  |  Branch (2738:14): [True: 9.49k, False: 76.7k]
  ------------------
 2739|  9.49k|    time_in_stride = pstr_aac_config->num_out_channels;
 2740|   273k|  } else {
 2741|   273k|    time_in_stride = IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   273k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2742|   273k|  }
 2743|   302k|  pstr_aac_enc = pstr_api_struct->pstr_state->aac_enc_pers_mem;
 2744|       |
 2745|   302k|  pw_inp_buf = (pWORD16)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_INPUT_IDX];
  ------------------
  |  |   31|   302k|#define IA_ENHAACPLUSENC_INPUT_IDX (2)
  ------------------
 2746|   302k|  if (ele_idx == 0) {
  ------------------
  |  Branch (2746:7): [True: 154k, False: 147k]
  ------------------
 2747|   154k|    pstr_api_struct->pstr_state->i_out_bytes = 0;
 2748|   154k|    pub_out_buf = ((pUWORD8)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_OUTPUT_IDX]);
  ------------------
  |  |   32|   154k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 2749|   154k|    *total_fill_bits = 0;
 2750|   154k|  }
 2751|       |
 2752|   302k|  if (pstr_api_struct->config->adts_flag) {
  ------------------
  |  Branch (2752:7): [True: 82.3k, False: 219k]
  ------------------
 2753|  82.3k|    pub_out_buf = (pUWORD8)(pub_out_buf + 7);
 2754|  82.3k|  }
 2755|       |
 2756|   906k|  for (ch = 0; ch < IXHEAACE_MAX_CH_IN_BS_ELE; ch++)
  ------------------
  |  |   22|   906k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  |  Branch (2756:16): [True: 604k, False: 302k]
  ------------------
 2757|   604k|    pstr_api_struct->pstr_state->num_anc_data_bytes[ele_idx][ch] = 0;
 2758|       |
 2759|   302k|  if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|   604k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   184k|#define AOT_PS (29)
  ------------------
  |  Branch (2759:7): [True: 117k, False: 184k]
  |  Branch (2759:25): [True: 19.4k, False: 165k]
  ------------------
 2760|   136k|    write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  132|   136k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|   136k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
                  write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   136k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2761|   165k|  } else if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable != 1) {
  ------------------
  |  |   37|   330k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2761:14): [True: 79.1k, False: 86.2k]
  |  Branch (2761:36): [True: 47.9k, False: 31.1k]
  ------------------
 2762|  47.9k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small)
  ------------------
  |  Branch (2762:9): [True: 17.5k, False: 30.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|  30.4k|    else
 2765|  30.4k|      write_off_set = INPUT_DELAY_ELD_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  136|  30.4k|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|  30.4k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELD_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  30.4k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2766|   117k|  } else if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable == 1 &&
  ------------------
  |  |   37|   234k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2766:14): [True: 31.1k, False: 86.2k]
  |  Branch (2766:36): [True: 31.1k, False: 0]
  ------------------
 2767|  31.1k|             pstr_api_struct->pstr_state->mps_tree_config == TREE_212) {
  ------------------
  |  |   39|  31.1k|#define TREE_212 (0)
  ------------------
  |  Branch (2767:14): [True: 11.4k, False: 19.7k]
  ------------------
 2768|  11.4k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small)
  ------------------
  |  Branch (2768:9): [True: 7.49k, False: 3.94k]
  ------------------
 2769|  7.49k|      write_off_set = INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  147|  7.49k|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|  7.49k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELDV2_480 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  7.49k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2770|  3.94k|    else
 2771|  3.94k|      write_off_set = INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  139|  3.94k|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|  3.94k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                    write_off_set = INPUT_DELAY_ELDV2_512 * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  3.94k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2772|   105k|  } else if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable == 1 &&
  ------------------
  |  |   37|   211k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2772:14): [True: 19.7k, False: 86.2k]
  |  Branch (2772:36): [True: 19.7k, False: 0]
  ------------------
 2773|  19.7k|             pstr_api_struct->pstr_state->mps_tree_config != TREE_212) {
  ------------------
  |  |   39|  19.7k|#define TREE_212 (0)
  ------------------
  |  Branch (2773:14): [True: 19.7k, False: 0]
  ------------------
 2774|  19.7k|    write_off_set = INPUT_DELAY_ELD_512_MPS * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  138|  19.7k|#define INPUT_DELAY_ELD_512_MPS ((CORE_DELAY_LD_512)*2 + 1)
  |  |  ------------------
  |  |  |  |  133|  19.7k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
                  write_off_set = INPUT_DELAY_ELD_512_MPS * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  19.7k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2775|  19.7k|  }
 2776|   302k|  if (pstr_api_struct->config[ele_idx].aac_classic == 1) {
  ------------------
  |  Branch (2776:7): [True: 86.2k, False: 215k]
  ------------------
 2777|  86.2k|    write_off_set = 0;
 2778|  86.2k|  }
 2779|   302k|  if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  |   37|   604k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2779:7): [True: 79.1k, False: 223k]
  |  Branch (2779:29): [True: 31.1k, False: 47.9k]
  ------------------
 2780|  31.1k|    if (pstr_api_struct->pstr_state->mps_tree_config == TREE_212) {
  ------------------
  |  |   39|  31.1k|#define TREE_212 (0)
  ------------------
  |  Branch (2780:9): [True: 11.4k, False: 19.7k]
  ------------------
 2781|  11.4k|      env_read_offset = INPUT_DELAY_ELD_512_MPS;
  ------------------
  |  |  138|  11.4k|#define INPUT_DELAY_ELD_512_MPS ((CORE_DELAY_LD_512)*2 + 1)
  |  |  ------------------
  |  |  |  |  133|  11.4k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2782|  19.7k|    } else {
 2783|  19.7k|      env_read_offset = write_off_set;
 2784|  19.7k|    }
 2785|  31.1k|  }
 2786|   302k|  if (pstr_api_struct->pstr_state->downsample[ele_idx]) {
  ------------------
  |  Branch (2786:7): [True: 215k, False: 86.2k]
  ------------------
 2787|   215k|    if (!pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2787:9): [True: 196k, False: 19.4k]
  ------------------
 2788|   196k|      if (aot == AOT_AAC_ELD && pstr_api_struct->pstr_state->mps_enable != 1) {
  ------------------
  |  |   37|   393k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2788:11): [True: 79.1k, False: 117k]
  |  Branch (2788:33): [True: 47.9k, False: 31.1k]
  ------------------
 2789|  47.9k|        write_off_set +=
 2790|  47.9k|            4 * IXHEAACE_MAX_CH_IN_BS_ELE;  // Downsampler delay = 4 samples per channel @input SR
  ------------------
  |  |   22|  47.9k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2791|   148k|      } else {
 2792|   148k|        write_off_set += (pstr_api_struct->pstr_state->down_sampler[ele_idx][0].delay) *
 2793|   148k|                         IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   148k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2794|   148k|      }
 2795|   196k|    }
 2796|   215k|    if (pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2796:9): [True: 19.4k, False: 196k]
  ------------------
 2797|  19.4k|      env_read_offset = (MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  155|  19.4k|#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.4k|#define INPUT_DELAY ((CORE_DELAY)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  148|  19.4k|#define CORE_DELAY (1600)
  |  |  ------------------
  ------------------
                    env_read_offset = (MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  19.4k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2798|  19.4k|      write_off_set = env_read_offset;
 2799|  19.4k|    }
 2800|   215k|  }
 2801|       |
 2802|   302k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   604k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |  141|   543k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   123k|#define AOT_PS (29)
  ------------------
  |  Branch (2802:7): [True: 60.8k, False: 241k]
  |  Branch (2802:28): [True: 117k, False: 123k]
  |  Branch (2802:46): [True: 19.4k, False: 104k]
  ------------------
 2803|   197k|    ptr_input_buffer = pstr_api_struct->pstr_state->inp_delay +
 2804|   197k|                       (aacenc_blocksize * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  155|   197k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                                     (aacenc_blocksize * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_LC) *
  ------------------
  |  |  132|   197k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|   197k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
 2805|   197k|                           IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|   197k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2806|   197k|  } else if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|   104k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (2806:14): [True: 25.3k, False: 79.1k]
  ------------------
 2807|  25.3k|    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|  79.1k|  } else if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  79.1k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (2816:14): [True: 79.1k, False: 0]
  ------------------
 2817|  79.1k|    if (pstr_api_struct->config[0].aac_config.flag_framelength_small) {
  ------------------
  |  Branch (2817:9): [True: 34.7k, False: 44.4k]
  ------------------
 2818|  34.7k|      if (pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  Branch (2818:11): [True: 17.1k, False: 17.5k]
  ------------------
 2819|  17.1k|        ptr_input_buffer =
 2820|  17.1k|            pstr_api_struct->pstr_state->inp_delay +
 2821|  17.1k|            (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |   93|  17.1k|#define FRAME_LEN_480 480
  ------------------
                          (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |  155|  17.1k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_480 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_480) *
  ------------------
  |  |  147|  17.1k|#define INPUT_DELAY_ELDV2_480 ((CORE_DELAY_LD_480 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  141|  17.1k|#define CORE_DELAY_LD_480 (480)
  |  |  ------------------
  ------------------
 2822|  17.1k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  17.1k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2823|  17.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.4k|    } else {
 2830|  44.4k|      if (pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  Branch (2830:11): [True: 14.0k, False: 30.4k]
  ------------------
 2831|  14.0k|        ptr_input_buffer =
 2832|  14.0k|            pstr_api_struct->pstr_state->inp_delay +
 2833|  14.0k|            (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |   92|  14.0k|#define FRAME_LEN_512 512
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |  155|  14.0k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELDV2_512) *
  ------------------
  |  |  139|  14.0k|#define INPUT_DELAY_ELDV2_512 ((CORE_DELAY_LD_512 * 2) + 128 + 1)
  |  |  ------------------
  |  |  |  |  133|  14.0k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2834|  14.0k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  14.0k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2835|  30.4k|      } else {
 2836|  30.4k|        ptr_input_buffer =
 2837|  30.4k|            pstr_api_struct->pstr_state->inp_delay +
 2838|  30.4k|            (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_512) *
  ------------------
  |  |   92|  30.4k|#define FRAME_LEN_512 512
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_512) *
  ------------------
  |  |  155|  30.4k|#define MAXIMUM_DS_2_1_FILTER_DELAY (16)
  ------------------
                          (FRAME_LEN_512 * 2 + MAXIMUM_DS_2_1_FILTER_DELAY + INPUT_DELAY_ELD_512) *
  ------------------
  |  |  136|  30.4k|#define INPUT_DELAY_ELD_512 ((CORE_DELAY_LD_512)*2 + 0 - (16 * 64))
  |  |  ------------------
  |  |  |  |  133|  30.4k|#define CORE_DELAY_LD_512 (512)
  |  |  ------------------
  ------------------
 2839|  30.4k|                IXHEAACE_MAX_CH_IN_BS_ELE * ele_idx;
  ------------------
  |  |   22|  30.4k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2840|  30.4k|      }
 2841|  44.4k|    }
 2842|  79.1k|  } else {
 2843|      0|    return IA_EXHEAACE_EXE_FATAL_UNSUPPORTED_AOT;
 2844|      0|  }
 2845|       |
 2846|   302k|  if (aot != AOT_AAC_LD && aot != AOT_AAC_LC) {
  ------------------
  |  |   36|   604k|#define AOT_AAC_LD (23)
  ------------------
                if (aot != AOT_AAC_LD && aot != AOT_AAC_LC) {
  ------------------
  |  |   34|   276k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (2846:7): [True: 276k, False: 25.3k]
  |  Branch (2846:28): [True: 215k, False: 60.8k]
  ------------------
 2847|   215k|    pstr_sbr_encoder =
 2848|   215k|        pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[ele_idx];
 2849|   215k|    if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (2849:9): [True: 203k, False: 12.8k]
  ------------------
 2850|   203k|      ixheaace_sbr_set_scratch_ptr(pstr_sbr_encoder, ptr_spectral_band_replication_scratch);
 2851|   203k|    }
 2852|   215k|  }
 2853|       |
 2854|   302k|  {
 2855|   302k|    ixheaace_mps_enc_ext_payload mps_extension_payload;
 2856|   302k|    UWORD8 *mps_bs = pstr_api_struct->pstr_state->mps_bs;
 2857|   302k|    memset(&mps_extension_payload, 0, sizeof(ixheaace_mps_enc_ext_payload));
 2858|   302k|    mps_extension_payload.p_data = mps_bs;
 2859|       |
 2860|   302k|    if ((pstr_api_struct->config[ele_idx].num_bs_elements == 1) &&
  ------------------
  |  Branch (2860:9): [True: 74.3k, False: 227k]
  ------------------
 2861|  74.3k|        (pstr_api_struct->config[ele_idx].i_channels <= 2)) {
  ------------------
  |  Branch (2861:9): [True: 54.6k, False: 19.7k]
  ------------------
 2862|  54.6k|      if (pstr_api_struct->config[ele_idx].aac_classic != 1) {
  ------------------
  |  Branch (2862:11): [True: 45.1k, False: 9.49k]
  ------------------
 2863|  45.1k|        if ((pstr_api_struct->config[ele_idx].i_channels == 2 &&
  ------------------
  |  Branch (2863:14): [True: 40.3k, False: 4.81k]
  ------------------
 2864|  40.3k|             pstr_api_struct->config[ele_idx].chmode_nchannels == 2) &&
  ------------------
  |  Branch (2864:14): [True: 40.3k, False: 0]
  ------------------
 2865|  40.3k|            (!((pstr_api_struct->pstr_mps_212_enc != NULL) &&
  ------------------
  |  Branch (2865:16): [True: 11.4k, False: 28.8k]
  ------------------
 2866|  28.8k|               pstr_api_struct->pstr_state->mps_enable))) {
  ------------------
  |  Branch (2866:16): [True: 11.4k, False: 0]
  ------------------
 2867|   100M|          for (idx = 0; idx < (num_samples_read); idx++) {
  ------------------
  |  Branch (2867:25): [True: 100M, False: 28.8k]
  ------------------
 2868|   100M|            ptr_input_buffer[write_off_set + idx] = (FLOAT32)pw_inp_buf[idx];
 2869|   100M|          }
 2870|  28.8k|        } else if (pstr_api_struct->config[ele_idx].i_channels == 1) {
  ------------------
  |  Branch (2870:20): [True: 4.81k, False: 11.4k]
  ------------------
 2871|  9.25M|          for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2871:25): [True: 9.24M, False: 4.81k]
  ------------------
 2872|  9.24M|            ptr_input_buffer[write_off_set + (IXHEAACE_MAX_CH_IN_BS_ELE * idx)] =
  ------------------
  |  |   22|  9.24M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2873|  9.24M|                (FLOAT32)pw_inp_buf[idx];
 2874|  9.24M|          }
 2875|  11.4k|        } else if ((pstr_api_struct->pstr_mps_212_enc != NULL) &&
  ------------------
  |  Branch (2875:20): [True: 11.4k, False: 0]
  ------------------
 2876|  11.4k|                   pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2876:20): [True: 11.4k, False: 0]
  ------------------
 2877|  11.4k|          ptr_input_buffer_mps = pstr_api_struct->pstr_state->time_signal_mps;
 2878|  11.2M|          for (idx = 0; idx < (num_samples_read / 2); idx++) {
  ------------------
  |  Branch (2878:25): [True: 11.2M, False: 11.4k]
  ------------------
 2879|  11.2M|            ptr_input_buffer_mps[idx] = (FLOAT32)pw_inp_buf[2 * idx];
 2880|  11.2M|            ptr_input_buffer_mps[(num_samples_read / 2) + idx] =
 2881|  11.2M|                (FLOAT32)pw_inp_buf[(2 * idx) + 1];
 2882|  11.2M|          }
 2883|  11.4k|        }
 2884|  45.1k|      } else {
 2885|  10.6M|        for (idx = 0; idx < (num_samples_read + write_off_set); idx++) {
  ------------------
  |  Branch (2885:23): [True: 10.6M, False: 9.49k]
  ------------------
 2886|  10.6M|          ptr_input_buffer[idx] = (FLOAT32)pw_inp_buf[idx];
 2887|  10.6M|        }
 2888|  9.49k|      }
 2889|   247k|    } else {
 2890|   247k|      if (pstr_api_struct->config[ele_idx].i_channels == 2) {
  ------------------
  |  Branch (2890:11): [True: 113k, False: 133k]
  ------------------
 2891|   113k|        slot = pstr_api_struct->config[ele_idx].element_slot;
 2892|   163M|        for (idx = 0; idx < num_samples_read / 2; idx++) {
  ------------------
  |  Branch (2892:23): [True: 163M, False: 113k]
  ------------------
 2893|   163M|          ptr_input_buffer[2 * idx + write_off_set] =
 2894|   163M|              (FLOAT32)pw_inp_buf[total_channels * idx + slot];
 2895|   163M|          ptr_input_buffer[2 * idx + write_off_set + 1] =
 2896|   163M|              (FLOAT32)pw_inp_buf[total_channels * idx + slot + 1];
 2897|   163M|        }
 2898|   113k|      }
 2899|       |
 2900|   247k|      if (pstr_api_struct->config[ele_idx].i_channels == 1) {
  ------------------
  |  Branch (2900:11): [True: 113k, False: 133k]
  ------------------
 2901|   113k|        slot = pstr_api_struct->config[ele_idx].element_slot;
 2902|   164M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2902:23): [True: 164M, False: 113k]
  ------------------
 2903|   164M|          ptr_input_buffer[write_off_set + (IXHEAACE_MAX_CH_IN_BS_ELE * idx)] =
  ------------------
  |  |   22|   164M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2904|   164M|              (FLOAT32)pw_inp_buf[total_channels * idx + slot];
 2905|   164M|        }
 2906|   113k|      }
 2907|       |
 2908|   247k|      if (pstr_api_struct->config[ele_idx].i_channels == 6) {
  ------------------
  |  Branch (2908:11): [True: 19.7k, False: 227k]
  ------------------
 2909|  19.7k|        ptr_input_buffer_mps = pstr_api_struct->pstr_state->time_signal_mps;
 2910|   117M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2910:23): [True: 117M, False: 19.7k]
  ------------------
 2911|   117M|          ptr_input_buffer_mps[idx] = (FLOAT32)pw_inp_buf[idx];
 2912|   117M|        }
 2913|  19.7k|      }
 2914|   247k|    }
 2915|       |
 2916|   302k|    if ((pstr_api_struct->pstr_mps_212_enc != NULL) && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2916:9): [True: 11.4k, False: 290k]
  |  Branch (2916:56): [True: 11.4k, False: 0]
  ------------------
 2917|  11.4k|      ptr_input_buffer_mps = pstr_api_struct->pstr_state->time_signal_mps;
 2918|  11.4k|      error = ixheaace_mps_212_process(pstr_api_struct->pstr_mps_212_enc, ptr_input_buffer_mps,
 2919|  11.4k|                                       num_samples_read, &mps_extension_payload);
 2920|  11.4k|      if (error) {
  ------------------
  |  Branch (2920:11): [True: 0, False: 11.4k]
  ------------------
 2921|      0|        return error;
 2922|      0|      }
 2923|  11.4k|      num_samples_read /= 2;
 2924|  11.2M|      for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2924:21): [True: 11.2M, False: 11.4k]
  ------------------
 2925|  11.2M|        ptr_input_buffer[2 * idx + write_off_set] = (FLOAT32)ptr_input_buffer_mps[idx];
 2926|  11.2M|      }
 2927|  11.4k|      env_read_offset = write_off_set;
 2928|  11.4k|    }
 2929|   302k|    if ((pstr_api_struct->pstr_mps_515_enc != NULL) && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (2929:9): [True: 19.7k, False: 282k]
  |  Branch (2929:56): [True: 19.7k, False: 0]
  ------------------
 2930|  19.7k|      ixheaace_bit_buf bit_buf;
 2931|  19.7k|      ixheaace_bit_buf_handle ptr_bit_buf = NULL;
 2932|  19.7k|      FLOAT32 *ptr_downmix_buffer_mps = pstr_api_struct->pstr_state->mps_scratch;
 2933|  19.7k|      VOID *ptr_scratch_515_mps = (VOID *)(pstr_api_struct->pstr_state->mps_scratch +
 2934|  19.7k|                                           (MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) +
  ------------------
  |  |   25|  19.7k|#define MAX_INPUT_CHANNELS (6)
  ------------------
                                                         (MAX_INPUT_CHANNELS * MAX_BUFFER_SIZE) +
  ------------------
  |  |   36|  19.7k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 2935|  19.7k|                                           (MAX_OUTPUT_CHANNELS * MAX_BUFFER_SIZE));
  ------------------
  |  |   26|  19.7k|#define MAX_OUTPUT_CHANNELS (2)
  ------------------
                                                         (MAX_OUTPUT_CHANNELS * MAX_BUFFER_SIZE));
  ------------------
  |  |   36|  19.7k|#define MAX_BUFFER_SIZE (2048)
  ------------------
 2936|  19.7k|      ptr_bit_buf = ia_enhaacplus_enc_create_bitbuffer(&bit_buf, mps_bs, MAX_MPS_BS_PAYLOAD_SIZE);
  ------------------
  |  |   64|  19.7k|#define MAX_MPS_BS_PAYLOAD_SIZE 10000
  ------------------
 2937|       |
 2938|  19.7k|      error =
 2939|  19.7k|          ixheaace_mps_515_apply(pstr_api_struct->pstr_mps_515_enc, &ptr_input_buffer_mps[0],
 2940|  19.7k|                                 &ptr_downmix_buffer_mps[0], ptr_bit_buf, ptr_scratch_515_mps);
 2941|  19.7k|      if (error) {
  ------------------
  |  Branch (2941:11): [True: 0, False: 19.7k]
  ------------------
 2942|      0|        return error;
 2943|      0|      }
 2944|  19.7k|      mps_extension_payload.data_size = ptr_bit_buf->cnt_bits;
 2945|  19.7k|      mps_extension_payload.data_type = IXHEAACE_MPS_EXT_LDSAC_DATA;
  ------------------
  |  |  174|  19.7k|#define IXHEAACE_MPS_EXT_LDSAC_DATA (0x09)
  ------------------
 2946|  19.7k|      mps_extension_payload.associated_ch_element = -1;
 2947|       |
 2948|  19.7k|      if (pstr_api_struct->pstr_state->mps_tree_config == TREE_5151 ||
  ------------------
  |  |   40|  39.4k|#define TREE_5151 (1)
  ------------------
  |  Branch (2948:11): [True: 5.12k, False: 14.5k]
  ------------------
 2949|  14.5k|          pstr_api_struct->pstr_state->mps_tree_config == TREE_5152) {
  ------------------
  |  |   41|  14.5k|#define TREE_5152 (2)
  ------------------
  |  Branch (2949:11): [True: 2.02k, False: 12.5k]
  ------------------
 2950|  7.14k|        num_samples_read /= 6;
 2951|  7.06M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2951:23): [True: 7.05M, False: 7.14k]
  ------------------
 2952|  7.05M|          ptr_input_buffer[2 * idx + write_off_set] = (FLOAT32)ptr_downmix_buffer_mps[idx];
 2953|  7.05M|        }
 2954|  12.5k|      } else {
 2955|  12.5k|        num_samples_read /= 3;
 2956|  25.0M|        for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (2956:23): [True: 25.0M, False: 12.5k]
  ------------------
 2957|  25.0M|          ptr_input_buffer[idx + write_off_set] = (FLOAT32)ptr_downmix_buffer_mps[idx];
 2958|  25.0M|        }
 2959|  12.5k|      }
 2960|  19.7k|      env_read_offset = write_off_set;
 2961|  19.7k|    }
 2962|       |
 2963|   302k|    if (pstr_api_struct->pstr_state->downsample[ele_idx]) {
  ------------------
  |  Branch (2963:9): [True: 215k, False: 86.2k]
  ------------------
 2964|   215k|      ixheaace_resampler_scratch *pstr_scratch_resampler =
 2965|   215k|          (ixheaace_resampler_scratch *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 2966|       |
 2967|   215k|      if (pstr_api_struct->config[ele_idx].element_type != ID_LFE) {
  ------------------
  |  Branch (2967:11): [True: 203k, False: 12.8k]
  ------------------
 2968|   203k|        error = ixheaace_env_encode_frame(
 2969|   203k|            pstr_sbr_encoder, ptr_input_buffer + env_read_offset, ptr_input_buffer,
 2970|   203k|            IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   203k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2971|   203k|            &(pstr_api_struct->pstr_state->num_anc_data_bytes[ele_idx][0]),
 2972|   203k|            pstr_api_struct->pstr_state->anc_data_bytes[ele_idx],
 2973|   203k|            &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs),
 2974|   203k|            &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size,
 2975|   203k|            pstr_api_struct->config[0].aac_config.flag_framelength_small, NULL);
 2976|       |
 2977|   203k|        if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   203k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (2977:13): [True: 1.45k, False: 201k]
  ------------------
 2978|  1.45k|          return error;
 2979|  1.45k|        }
 2980|   203k|      }
 2981|       |
 2982|   214k|      if (!pstr_api_struct->config[ele_idx].use_parametric_stereo) {
  ------------------
  |  Branch (2982:11): [True: 195k, False: 19.4k]
  ------------------
 2983|   484k|        for (ch = 0; ch < pstr_aac_config->num_out_channels; ch++) {
  ------------------
  |  Branch (2983:22): [True: 289k, False: 195k]
  ------------------
 2984|   289k|          ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 2985|   289k|                                             &shared_buf1_ring, &shared_buf2_ring);
 2986|   289k|          {
 2987|   289k|            ia_enhaacplus_enc_iir_downsampler(
 2988|   289k|                &(pstr_api_struct->pstr_state->down_sampler[ele_idx][ch]),
 2989|   289k|                ptr_input_buffer + write_off_set + ch,
 2990|   289k|                num_samples_read / pstr_aac_config->num_out_channels, IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   289k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 2991|   289k|                ptr_input_buffer + ch, &out_samples, out_stride, shared_buf1_ring,
 2992|   289k|                shared_buf2_ring, pstr_scratch_resampler);
 2993|   289k|          }
 2994|   289k|        }
 2995|   195k|      }
 2996|   214k|    }
 2997|       |
 2998|   300k|    error = ia_enhaacplus_enc_aac_core_encode(
 2999|   300k|        pstr_aac_enc, ptr_input_buffer, time_in_stride,
 3000|   300k|        pstr_api_struct->pstr_state->anc_data_bytes[ele_idx],
 3001|   300k|        pstr_api_struct->pstr_state->num_anc_data_bytes[ele_idx], pub_out_buf,
 3002|   300k|        &(pstr_api_struct->pstr_state->i_out_bytes), &(pstr_api_struct->pstr_aac_tabs),
 3003|   300k|        pstr_api_struct->pstr_state->pstr_bit_stream_handle,
 3004|   300k|        &(pstr_api_struct->pstr_state->bit_stream), flag_last_element,
 3005|   300k|        write_program_config_element, i_num_coup_channels, i_channels_mask, ele_idx,
 3006|   300k|        total_fill_bits, total_channels, aot, pstr_api_struct->config->adts_flag,
 3007|   300k|        num_bs_elements, &pstr_api_struct->pstr_state->is_quant_spec_zero,
 3008|   300k|        &pstr_api_struct->pstr_state->is_gain_limited);
 3009|   300k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3009:9): [True: 35.5k, False: 265k]
  ------------------
 3010|  35.5k|      return error;
 3011|  35.5k|    }
 3012|   265k|    if (pstr_sbr_encoder && !(pstr_api_struct->config[ele_idx].use_parametric_stereo)) {
  ------------------
  |  Branch (3012:9): [True: 176k, False: 89.0k]
  |  Branch (3012:29): [True: 157k, False: 19.1k]
  ------------------
 3013|   157k|      if (pstr_sbr_encoder && (ptr_input_buffer != NULL)) {
  ------------------
  |  Branch (3013:11): [True: 157k, False: 0]
  |  Branch (3013:31): [True: 157k, False: 0]
  ------------------
 3014|   157k|        memmove(ptr_input_buffer,
 3015|   157k|                ptr_input_buffer + aacenc_blocksize * 2 * IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   157k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3016|   157k|                write_off_set * sizeof(ptr_input_buffer[0]));
 3017|   157k|      }
 3018|   157k|    }
 3019|   265k|  }
 3020|      0|  {}
 3021|       |  /*ADTS Header Write*/
 3022|   265k|  if (pstr_api_struct->config->adts_flag) {
  ------------------
  |  Branch (3022:7): [True: 76.6k, False: 188k]
  ------------------
 3023|  76.6k|    pub_out_buf = ((pUWORD8)pstr_api_struct->pp_mem[IA_ENHAACPLUSENC_OUTPUT_IDX]);
  ------------------
  |  |   32|  76.6k|#define IA_ENHAACPLUSENC_OUTPUT_IDX (3)
  ------------------
 3024|  76.6k|    {
 3025|  76.6k|      WORD32 num_channels = 0;
 3026|       |
 3027|   313k|      for (ele = 0; ele < pstr_api_struct->config[0].num_bs_elements; ele++) {
  ------------------
  |  Branch (3027:21): [True: 236k, False: 76.6k]
  ------------------
 3028|   236k|        num_channels += pstr_api_struct->config[ele].i_channels;
 3029|   236k|      }
 3030|  76.6k|      {
 3031|  76.6k|        header_bytes = ia_enhaacplus_enc_write_ADTS_header(
 3032|  76.6k|            pub_out_buf, pstr_api_struct->pstr_state->i_out_bytes,
 3033|  76.6k|            pstr_api_struct->config->aac_config.core_sample_rate,
 3034|  76.6k|            (pstr_api_struct->config[0].num_bs_elements > 1)
  ------------------
  |  Branch (3034:13): [True: 70.2k, False: 6.34k]
  ------------------
 3035|  76.6k|                ? num_channels
 3036|  76.6k|                : pstr_api_struct->config[0].aac_config.num_out_channels);
 3037|  76.6k|      }
 3038|  76.6k|    }
 3039|       |
 3040|  76.6k|    pstr_api_struct->pstr_state->i_out_bytes += header_bytes;
 3041|  76.6k|  }
 3042|       |
 3043|   265k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   265k|#define IA_NO_ERROR 0x00000000
  ------------------
 3044|   300k|}
ixheaace_api.c:iusace_process:
 3045|   337k|static IA_ERRORCODE iusace_process(ixheaace_api_struct *pstr_api_struct) {
 3046|   337k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   337k|#define IA_NO_ERROR 0x00000000
  ------------------
 3047|   337k|  WORD32 idx;
 3048|   337k|  WORD32 write_off_set = 0;
 3049|   337k|  WORD32 core_coder_frame_length;
 3050|   337k|  WORD32 usac_independency_flg;
 3051|   337k|  UWORD32 padding_bits = 0;
 3052|   337k|  WORD32 core_sample;
 3053|   337k|  WORD32 drc_sample;
 3054|   337k|  WORD32 ptr_inp_buf_offset = 0;
 3055|   337k|  WORD32 num_ch;
 3056|   337k|  WORD16 *ps_inp_buf = NULL;
 3057|   337k|  WORD8 *ps_out_buf = NULL;
 3058|   337k|  FLOAT32 *ptr_input_buffer = NULL;
 3059|   337k|  FLOAT32 *ptr_inp_buf[MAX_TIME_CHANNELS];
 3060|   337k|  FLOAT32 *ptr_drc_inp_buf[MAX_TIME_CHANNELS];
 3061|   337k|  WORD32 delay = 0;
 3062|   337k|  ixheaace_state_struct *pstr_state = pstr_api_struct->pstr_state;
 3063|   337k|  ia_bit_buf_struct *pstr_it_bit_buff = &pstr_state->str_bit_buf;
 3064|   337k|  ia_usac_encoder_config_struct *pstr_config = &pstr_api_struct->config[0].usac_config;
 3065|   337k|  ia_usac_data_struct *pstr_usac_data = &pstr_api_struct->pstr_state->str_usac_enc_data;
 3066|   337k|  iusace_scratch_mem *pstr_scratch = &pstr_usac_data->str_scratch;
 3067|   337k|  ia_classification_struct *pstr_sig_class_data =
 3068|   337k|      &pstr_state->str_usac_enc_data.str_sig_class_data;
 3069|   337k|  core_sample = (pstr_config->ccfl * pstr_config->channels);
 3070|   337k|  drc_sample = pstr_config->drc_frame_size * pstr_config->channels;
 3071|   337k|  core_coder_frame_length = pstr_config->ccfl;
 3072|   337k|  num_ch = pstr_config->channels;
 3073|   337k|  usac_independency_flg = pstr_usac_data->usac_independency_flag;
 3074|   337k|  ps_inp_buf = (WORD16 *)pstr_api_struct->pp_mem[IA_MEMTYPE_INPUT];
  ------------------
  |  |   24|   337k|#define IA_MEMTYPE_INPUT 0x02
  ------------------
 3075|   337k|  ps_out_buf = (WORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT];
  ------------------
  |  |   26|   337k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3076|       |
 3077|   337k|  if (pstr_config->use_drc_element) {
  ------------------
  |  Branch (3077:7): [True: 71.5k, False: 265k]
  ------------------
 3078|  71.5k|    if (pstr_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (3078:9): [True: 66.0k, False: 5.48k]
  ------------------
 3079|  66.0k|      delay = (CC_DELAY_ADJUSTMENT * pstr_config->drc_frame_size / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |  166|  66.0k|#define CC_DELAY_ADJUSTMENT (448)
  ------------------
                    delay = (CC_DELAY_ADJUSTMENT * pstr_config->drc_frame_size / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |   91|  66.0k|#define FRAME_LEN_1024 1024
  ------------------
 3080|  66.0k|    }
 3081|   216M|    for (idx = 0; idx < core_sample + delay; idx++) {
  ------------------
  |  Branch (3081:19): [True: 216M, False: 71.5k]
  ------------------
 3082|   216M|      pstr_api_struct->pstr_state->pp_drc_in_buf[idx % num_ch][idx / num_ch] =
 3083|   216M|          pstr_api_struct->pstr_state
 3084|   216M|              ->pp_drc_in_buf[idx % num_ch][idx / num_ch + pstr_config->drc_frame_size];
 3085|   216M|    }
 3086|  71.5k|    ptr_inp_buf_offset = pstr_config->drc_frame_size;
 3087|   198k|    for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3087:19): [True: 126k, False: 71.5k]
  ------------------
 3088|   126k|      ptr_drc_inp_buf[idx] = pstr_api_struct->pstr_state->pp_drc_in_buf[idx];
 3089|   126k|    }
 3090|  71.5k|  }
 3091|       |
 3092|   337k|  ixheaace_pstr_sbr_enc pstr_sbr_encoder =
 3093|   337k|      pstr_api_struct->pstr_state->spectral_band_replication_enc_pers_mem[0];
 3094|   337k|  if (pstr_config->sbr_enable) {
  ------------------
  |  Branch (3094:7): [True: 206k, False: 130k]
  ------------------
 3095|   206k|    ixheaace_mps_enc_ext_payload mps_extension_payload;
 3096|   206k|    UWORD8 *mps_bs = pstr_api_struct->pstr_state->mps_bs;
 3097|   206k|    FLOAT32 *time_signal_mps = pstr_api_struct->pstr_state->time_signal_mps;
 3098|   206k|    WORD32 sbr_pvc_mode = 0;
 3099|   206k|    WORD32 sbr_patching_mode = 1;
 3100|   206k|    WORD32 ccfl_size;
 3101|   206k|    WORD32 num_samples_read;
 3102|   206k|    WORD32 out_samples, ch;
 3103|   206k|    WORD32 resamp_ratio =
 3104|   206k|        ia_enhaacplus_enc_compute_resampling_ratio(pstr_api_struct->config[0].ccfl_idx);
 3105|   206k|    switch (pstr_config->codec_mode) {
  ------------------
  |  Branch (3105:13): [True: 206k, False: 0]
  ------------------
 3106|  92.5k|      case USAC_SWITCHED:
  ------------------
  |  |   35|  92.5k|#define USAC_SWITCHED (0)
  ------------------
  |  Branch (3106:7): [True: 92.5k, False: 114k]
  ------------------
 3107|  92.5k|        if (pstr_usac_data->str_sig_class_data.coding_mode == 2) {
  ------------------
  |  Branch (3107:13): [True: 15.7k, False: 76.8k]
  ------------------
 3108|  15.7k|          sbr_pvc_mode = 0;
 3109|  76.8k|        } else {
 3110|  76.8k|          sbr_pvc_mode = 2;
 3111|  76.8k|        }
 3112|  92.5k|        sbr_patching_mode = 1;
 3113|  92.5k|        break;
 3114|   110k|      case USAC_ONLY_FD:
  ------------------
  |  |   36|   110k|#define USAC_ONLY_FD (1)
  ------------------
  |  Branch (3114:7): [True: 110k, False: 96.2k]
  ------------------
 3115|   110k|        sbr_pvc_mode = 0;
 3116|   110k|        sbr_patching_mode = 0;
 3117|   110k|        break;
 3118|  3.69k|      case USAC_ONLY_TD:
  ------------------
  |  |   37|  3.69k|#define USAC_ONLY_TD (2)
  ------------------
  |  Branch (3118:7): [True: 3.69k, False: 203k]
  ------------------
 3119|  3.69k|        sbr_pvc_mode = 2;
 3120|  3.69k|        sbr_patching_mode = 1;
 3121|  3.69k|        break;
 3122|   206k|    }
 3123|       |
 3124|   206k|    write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |  132|   206k|#define INPUT_DELAY_LC ((CORE_DELAY_LC)*2 + 6 * 64 - 2048 + 1)
  |  |  ------------------
  |  |  |  |  130|   206k|#define CORE_DELAY_LC (1600)
  |  |  ------------------
  ------------------
                  write_off_set = INPUT_DELAY_LC * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   206k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3125|       |
 3126|   206k|    if (pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|   206k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3126:9): [True: 50.1k, False: 156k]
  ------------------
 3127|  50.1k|      write_off_set = write_off_set * 2;
 3128|  50.1k|    }
 3129|       |
 3130|   206k|    if (pstr_api_struct->pstr_state->downsample[0]) {
  ------------------
  |  Branch (3130:9): [True: 206k, False: 0]
  ------------------
 3131|   206k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   206k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3131:11): [True: 32.0k, False: 174k]
  ------------------
 3132|  32.0k|        write_off_set +=
 3133|  32.0k|            (pstr_api_struct->pstr_state->down_samp_sos[0][0].delay) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  32.0k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3134|       |
 3135|  32.0k|        write_off_set +=
 3136|  32.0k|            (pstr_api_struct->pstr_state->up_sampler[0][0].delay) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|  32.0k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3137|   174k|      } else if (pstr_api_struct->config[0].ccfl_idx == SBR_2_1 ||
  ------------------
  |  |  198|   349k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3137:18): [True: 124k, False: 50.1k]
  ------------------
 3138|   174k|                 pstr_api_struct->config[0].ccfl_idx == SBR_4_1) {
  ------------------
  |  |  199|  50.1k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3138:18): [True: 50.1k, False: 0]
  ------------------
 3139|   174k|        write_off_set +=
 3140|   174k|            (pstr_api_struct->pstr_state->down_sampler[0][0].delay) * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   174k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3141|   174k|      }
 3142|   206k|    }
 3143|       |
 3144|   206k|    ptr_input_buffer = pstr_api_struct->pstr_state->inp_delay;
 3145|   206k|    ccfl_size = pstr_api_struct->config[0].usac_config.ccfl;
 3146|   206k|    num_samples_read = ccfl_size * pstr_api_struct->config[0].i_channels;
 3147|   206k|    switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (3147:13): [True: 206k, False: 0]
  ------------------
 3148|  32.0k|      case SBR_8_3:
  ------------------
  |  |  197|  32.0k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3148:7): [True: 32.0k, False: 174k]
  ------------------
 3149|  32.0k|        num_samples_read *= 8;
 3150|  32.0k|        num_samples_read /= 3;
 3151|  32.0k|        break;
 3152|       |
 3153|   124k|      case SBR_2_1:
  ------------------
  |  |  198|   124k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3153:7): [True: 124k, False: 82.1k]
  ------------------
 3154|   124k|        num_samples_read *= 2;
 3155|   124k|        break;
 3156|       |
 3157|  50.1k|      case SBR_4_1:
  ------------------
  |  |  199|  50.1k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3157:7): [True: 50.1k, False: 156k]
  ------------------
 3158|  50.1k|        num_samples_read *= 4;
 3159|  50.1k|        break;
 3160|   206k|    }
 3161|       |
 3162|   206k|    mps_extension_payload.p_data = mps_bs;
 3163|   206k|    memset(&mps_extension_payload, 0, sizeof(ixheaace_mps_enc_ext_payload));
 3164|       |
 3165|   206k|    if ((pstr_api_struct->pstr_mps_212_enc != NULL) && pstr_api_struct->pstr_state->mps_enable) {
  ------------------
  |  Branch (3165:9): [True: 73.9k, False: 132k]
  |  Branch (3165:56): [True: 73.9k, False: 0]
  ------------------
 3166|   176M|      for (idx = 0; idx < num_samples_read / 2; idx++) {
  ------------------
  |  Branch (3166:21): [True: 176M, False: 73.9k]
  ------------------
 3167|   176M|        time_signal_mps[idx] = (FLOAT32)ps_inp_buf[2 * idx];
 3168|   176M|        time_signal_mps[num_samples_read / 2 + idx] = (FLOAT32)ps_inp_buf[2 * idx + 1];
 3169|   176M|      }
 3170|  73.9k|      ixheaace_mps_pstr_struct pstr_mps_enc =
 3171|  73.9k|          (ixheaace_mps_pstr_struct)pstr_api_struct->pstr_mps_212_enc;
 3172|  73.9k|      pstr_mps_enc->ptr_sac_encoder->independency_flag = usac_independency_flg;
 3173|       |
 3174|  73.9k|      error = ixheaace_mps_212_process(pstr_api_struct->pstr_mps_212_enc, time_signal_mps,
 3175|  73.9k|                                       num_samples_read, &mps_extension_payload);
 3176|  73.9k|      if (error) {
  ------------------
  |  Branch (3176:11): [True: 0, False: 73.9k]
  ------------------
 3177|      0|        return error;
 3178|      0|      }
 3179|  73.9k|      if (pstr_api_struct->pstr_state->mps_enable == 1) {
  ------------------
  |  Branch (3179:11): [True: 73.9k, False: 0]
  ------------------
 3180|   176M|        for (idx = 0; idx < num_samples_read / 2; idx++) {
  ------------------
  |  Branch (3180:23): [True: 176M, False: 73.9k]
  ------------------
 3181|   176M|          ptr_input_buffer[write_off_set + 2 * idx] = time_signal_mps[idx];
 3182|   176M|          ptr_input_buffer[write_off_set + 2 * idx + 1] =
 3183|   176M|              time_signal_mps[num_samples_read / 2 + idx];
 3184|   176M|        }
 3185|  73.9k|      }
 3186|   132k|    } else if (pstr_api_struct->config[0].i_channels == 2 &&
  ------------------
  |  Branch (3186:16): [True: 71.1k, False: 61.6k]
  ------------------
 3187|  71.1k|               pstr_api_struct->config[0].chmode_nchannels == 2) {
  ------------------
  |  Branch (3187:16): [True: 71.1k, False: 0]
  ------------------
 3188|   362M|      for (idx = 0; idx < (num_samples_read); idx++) {
  ------------------
  |  Branch (3188:21): [True: 362M, False: 71.1k]
  ------------------
 3189|   362M|        ptr_input_buffer[write_off_set + idx] = (FLOAT32)ps_inp_buf[idx];
 3190|   362M|      }
 3191|  71.1k|    } else if (pstr_api_struct->config[0].i_channels == 1) {
  ------------------
  |  Branch (3191:16): [True: 61.6k, False: 0]
  ------------------
 3192|   168M|      for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (3192:21): [True: 168M, False: 61.6k]
  ------------------
 3193|   168M|        ptr_input_buffer[write_off_set + (IXHEAACE_MAX_CH_IN_BS_ELE * idx)] =
  ------------------
  |  |   22|   168M|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3194|   168M|            (FLOAT32)ps_inp_buf[idx];
 3195|   168M|      }
 3196|  61.6k|    }
 3197|       |
 3198|   206k|    if (num_ch == 2) {
  ------------------
  |  Branch (3198:9): [True: 145k, False: 61.6k]
  ------------------
 3199|   145k|      if (1 == pstr_config->use_drc_element) {
  ------------------
  |  Branch (3199:11): [True: 36.0k, False: 109k]
  ------------------
 3200|   147M|        for (idx = 0; idx < drc_sample; idx++) {
  ------------------
  |  Branch (3200:23): [True: 147M, False: 36.0k]
  ------------------
 3201|   147M|          ptr_drc_inp_buf[idx % num_ch][(idx >> 1) + ptr_inp_buf_offset] = ptr_input_buffer[idx];
 3202|   147M|        }
 3203|  36.0k|      }
 3204|       |
 3205|       |      // update Header and bit-stream parameters
 3206|   145k|      if (0 == pstr_config->sbr_pvc_active) {
  ------------------
  |  Branch (3206:11): [True: 102k, False: 42.2k]
  ------------------
 3207|   102k|        sbr_pvc_mode = 0;
 3208|   102k|      }
 3209|       |
 3210|   145k|      ixheaace_set_usac_sbr_params(
 3211|   145k|          pstr_sbr_encoder, usac_independency_flg, 0, pstr_config->sbr_pvc_active, sbr_pvc_mode,
 3212|   145k|          pstr_config->sbr_inter_tes_active, pstr_config->sbr_harmonic, sbr_patching_mode);
 3213|       |
 3214|       |      // Downsample SBR input buffer for Harmonic SBR
 3215|   145k|      if (pstr_config->sbr_harmonic) {
  ------------------
  |  Branch (3215:11): [True: 104k, False: 40.2k]
  ------------------
 3216|   104k|        FLOAT32 *in_buffer_temp;
 3217|   104k|        ixheaace_get_input_scratch_buf(pstr_api_struct->pstr_state->ptr_temp_buff_resamp,
 3218|   104k|                                       &in_buffer_temp);
 3219|   104k|        FLOAT32 *outbuf = ixheaace_get_hbe_resample_buffer(pstr_sbr_encoder);
 3220|   104k|        if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   104k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3220:13): [True: 0, False: 104k]
  ------------------
 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|   314k|        for (ch = 0; ch < num_ch; ch++) {
  ------------------
  |  Branch (3227:22): [True: 209k, False: 104k]
  ------------------
 3228|   209k|          FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 3229|   209k|          ixheaace_resampler_scratch *pstr_scratch_resampler =
 3230|   209k|              (ixheaace_resampler_scratch *)(ixheaace_resampler_scratch *)
 3231|   209k|                  pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 3232|       |
 3233|   209k|          ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 3234|   209k|                                             &shared_buf1_ring, &shared_buf2_ring);
 3235|       |
 3236|   209k|          if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   209k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3236:15): [True: 0, False: 209k]
  ------------------
 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|   209k|          } else {
 3250|   209k|            WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE * resamp_ratio;
  ------------------
  |  |   22|   209k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3251|       |
 3252|   209k|            ia_enhaacplus_enc_iir_downsampler(
 3253|   209k|                &(pstr_api_struct->pstr_state->hbe_down_sampler[0][ch]), ptr_input_buffer + ch,
 3254|   209k|                num_samples_read / pstr_api_struct->config[0].i_channels,
 3255|   209k|                IXHEAACE_MAX_CH_IN_BS_ELE, outbuf + ch, &out_samples, out_stride,
  ------------------
  |  |   22|   209k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3256|   209k|                shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3257|   209k|          }
 3258|   209k|        }
 3259|   104k|      }
 3260|       |
 3261|       |      // SBR Encode
 3262|   145k|      error = ixheaace_env_encode_frame(
 3263|   145k|          pstr_sbr_encoder, ptr_input_buffer, ptr_input_buffer,
 3264|   145k|          pstr_api_struct->config[0].i_channels,
 3265|   145k|          &(pstr_api_struct->pstr_state->num_anc_data_bytes[0][0]),
 3266|   145k|          pstr_api_struct->pstr_state->anc_data_bytes[0],
 3267|   145k|          &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs),
 3268|   145k|          &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size, 0,
 3269|   145k|          &pstr_api_struct->pstr_state->str_usac_enc_data.num_sbr_bits);
 3270|   145k|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|   145k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3270:11): [True: 8.02k, False: 137k]
  ------------------
 3271|  8.02k|        return error;
 3272|  8.02k|      }
 3273|   145k|    } else {
 3274|  61.6k|      if (0 == pstr_config->sbr_pvc_active) {
  ------------------
  |  Branch (3274:11): [True: 34.2k, False: 27.3k]
  ------------------
 3275|  34.2k|        sbr_pvc_mode = 0;
 3276|  34.2k|      }
 3277|       |
 3278|  61.6k|      ixheaace_set_usac_sbr_params(
 3279|  61.6k|          pstr_sbr_encoder, usac_independency_flg, 0, pstr_config->sbr_pvc_active, sbr_pvc_mode,
 3280|  61.6k|          pstr_config->sbr_inter_tes_active, pstr_config->sbr_harmonic, sbr_patching_mode);
 3281|  61.6k|      if (pstr_config->sbr_harmonic) {
  ------------------
  |  Branch (3281:11): [True: 7.97k, False: 53.6k]
  ------------------
 3282|  7.97k|        FLOAT32 *in_buffer_temp;
 3283|  7.97k|        ixheaace_get_input_scratch_buf(pstr_api_struct->pstr_state->ptr_temp_buff_resamp,
 3284|  7.97k|                                       &in_buffer_temp);
 3285|  7.97k|        FLOAT32 *outbuf = ixheaace_get_hbe_resample_buffer(pstr_sbr_encoder);
 3286|  7.97k|        if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  7.97k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3286:13): [True: 0, False: 7.97k]
  ------------------
 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|  15.9k|        for (ch = 0; ch < num_ch; ch++) {
  ------------------
  |  Branch (3293:22): [True: 7.97k, False: 7.97k]
  ------------------
 3294|  7.97k|          FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 3295|  7.97k|          ixheaace_resampler_scratch *pstr_scratch_resampler =
 3296|  7.97k|              (ixheaace_resampler_scratch *)(ixheaace_resampler_scratch *)
 3297|  7.97k|                  pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 3298|       |
 3299|  7.97k|          ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 3300|  7.97k|                                             &shared_buf1_ring, &shared_buf2_ring);
 3301|       |
 3302|  7.97k|          if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|  7.97k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3302:15): [True: 0, False: 7.97k]
  ------------------
 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|  7.97k|          } else {
 3316|  7.97k|            WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE * resamp_ratio;
  ------------------
  |  |   22|  7.97k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3317|       |
 3318|  7.97k|            ia_enhaacplus_enc_iir_downsampler(
 3319|  7.97k|                &(pstr_api_struct->pstr_state->hbe_down_sampler[0][ch]),
 3320|  7.97k|                ptr_input_buffer /*input_buffer_fix + write_off_set*/ + ch,
 3321|  7.97k|                num_samples_read / pstr_api_struct->config[0].i_channels,
 3322|  7.97k|                IXHEAACE_MAX_CH_IN_BS_ELE, outbuf + ch, &out_samples, out_stride,
  ------------------
  |  |   22|  7.97k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3323|  7.97k|                shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3324|  7.97k|          }
 3325|  7.97k|        }
 3326|  7.97k|      }
 3327|       |
 3328|  61.6k|      FLOAT32 *time_signal = pstr_api_struct->pstr_state->time_signal;
 3329|   168M|      for (idx = 0; idx < num_samples_read; idx++) {
  ------------------
  |  Branch (3329:21): [True: 168M, False: 61.6k]
  ------------------
 3330|   168M|        time_signal[idx] = (FLOAT32)ptr_input_buffer[idx << 1];
 3331|   168M|      }
 3332|       |
 3333|  61.6k|      if (1 == pstr_config->use_drc_element) {
  ------------------
  |  Branch (3333:11): [True: 7.32k, False: 54.2k]
  ------------------
 3334|  15.0M|        for (idx = 0; idx < drc_sample; idx++) {
  ------------------
  |  Branch (3334:23): [True: 15.0M, False: 7.32k]
  ------------------
 3335|  15.0M|          ptr_drc_inp_buf[0][idx + ptr_inp_buf_offset] = time_signal[idx];
 3336|  15.0M|        }
 3337|  7.32k|      }
 3338|       |
 3339|       |      // SBR Encode
 3340|  61.6k|      error = ixheaace_env_encode_frame(
 3341|  61.6k|          pstr_sbr_encoder, time_signal, time_signal, pstr_api_struct->config[0].i_channels,
 3342|  61.6k|          &(pstr_api_struct->pstr_state->num_anc_data_bytes[0][0]),
 3343|  61.6k|          pstr_api_struct->pstr_state->anc_data_bytes[0],
 3344|  61.6k|          &(pstr_api_struct->spectral_band_replication_tabs), &(pstr_api_struct->common_tabs),
 3345|  61.6k|          &(mps_extension_payload.p_data[0]), mps_extension_payload.data_size, 0,
 3346|  61.6k|          &pstr_api_struct->pstr_state->str_usac_enc_data.num_sbr_bits);
 3347|  61.6k|      if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  61.6k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (3347:11): [True: 2.00k, False: 59.6k]
  ------------------
 3348|  2.00k|        return error;
 3349|  2.00k|      }
 3350|  61.6k|    }
 3351|       |
 3352|       |    /* Resampling for USAC core */
 3353|   196k|    {
 3354|   196k|      FLOAT32 *in_buffer_temp;
 3355|   196k|      ixheaace_get_input_scratch_buf(pstr_api_struct->pstr_state->ptr_temp_buff_resamp,
 3356|   196k|                                     &in_buffer_temp);
 3357|   196k|      if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   196k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3357:11): [True: 32.0k, False: 164k]
  ------------------
 3358|  32.0k|        WORD32 input_tot = num_samples_read / pstr_api_struct->config[0].i_channels;
 3359|  32.0k|        ixheaace_upsampling_inp_buf_generation(ptr_input_buffer, in_buffer_temp, input_tot,
 3360|  32.0k|                                               UPSAMPLE_FAC, write_off_set - delay);
  ------------------
  |  |   25|  32.0k|#define UPSAMPLE_FAC (3)
  ------------------
 3361|  32.0k|      }
 3362|       |
 3363|   530k|      for (ch = 0; ch < num_ch; ch++) {
  ------------------
  |  Branch (3363:20): [True: 333k, False: 196k]
  ------------------
 3364|   333k|        FLOAT32 *shared_buf1_ring, *shared_buf2_ring;
 3365|   333k|        ixheaace_resampler_scratch *pstr_scratch_resampler =
 3366|   333k|            (ixheaace_resampler_scratch *)pstr_api_struct->pstr_state->ptr_temp_buff_resamp;
 3367|       |
 3368|   333k|        ia_enhaacplus_enc_get_scratch_bufs(pstr_api_struct->pstr_state->temp_buff_sbr,
 3369|   333k|                                           &shared_buf1_ring, &shared_buf2_ring);
 3370|       |
 3371|   333k|        if (pstr_api_struct->config[0].ccfl_idx == SBR_8_3) {
  ------------------
  |  |  197|   333k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3371:13): [True: 43.7k, False: 289k]
  ------------------
 3372|       |          // Upsampling by factor 3 - SOS implementation
 3373|  43.7k|          ia_enhaacplus_enc_iir_sos_upsampler(
 3374|  43.7k|              &(pstr_api_struct->pstr_state->up_sampler[0][ch]), in_buffer_temp + ch,
 3375|  43.7k|              num_samples_read / pstr_api_struct->config[0].i_channels, IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|  43.7k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3376|  43.7k|              in_buffer_temp + ch, &out_samples, shared_buf1_ring, shared_buf2_ring,
 3377|  43.7k|              pstr_scratch_resampler);
 3378|       |
 3379|       |          // Downsampling by factor 8
 3380|  43.7k|          ia_enhaacplus_enc_iir_sos_downsampler(
 3381|  43.7k|              &(pstr_api_struct->pstr_state->down_samp_sos[0][ch]), in_buffer_temp + ch,
 3382|  43.7k|              out_samples, IXHEAACE_MAX_CH_IN_BS_ELE, ptr_input_buffer + ch, &out_samples,
  ------------------
  |  |   22|  43.7k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3383|  43.7k|              shared_buf1_ring, shared_buf2_ring, pstr_scratch_resampler);
 3384|   289k|        } else {
 3385|   289k|          WORD32 out_stride = IXHEAACE_MAX_CH_IN_BS_ELE * resamp_ratio;
  ------------------
  |  |   22|   289k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3386|   289k|          ia_enhaacplus_enc_iir_downsampler(
 3387|   289k|              &(pstr_api_struct->pstr_state->down_sampler[0][ch]),
 3388|   289k|              ptr_input_buffer + write_off_set - delay + ch,
 3389|   289k|              num_samples_read / pstr_api_struct->config[0].i_channels, IXHEAACE_MAX_CH_IN_BS_ELE,
  ------------------
  |  |   22|   289k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3390|   289k|              ptr_input_buffer + ch, &out_samples, out_stride, shared_buf1_ring, shared_buf2_ring,
 3391|   289k|              pstr_scratch_resampler);
 3392|   289k|        }
 3393|   333k|      }
 3394|   196k|    }
 3395|       |
 3396|   196k|    if (num_ch != 0) {
  ------------------
  |  Branch (3396:9): [True: 196k, False: 0]
  ------------------
 3397|   530k|      for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3397:21): [True: 333k, False: 196k]
  ------------------
 3398|   333k|        ptr_inp_buf[idx] = pstr_api_struct->pstr_state->ptr_in_buf[idx];
 3399|   333k|      }
 3400|       |
 3401|   196k|      if (num_ch == 1) {
  ------------------
  |  Branch (3401:11): [True: 59.6k, False: 137k]
  ------------------
 3402|  55.9M|        for (idx = 0; idx < core_sample; idx++) {
  ------------------
  |  Branch (3402:23): [True: 55.8M, False: 59.6k]
  ------------------
 3403|  55.8M|          ptr_inp_buf[0][idx] = ptr_input_buffer[idx << 1];
 3404|  55.8M|        }
 3405|   137k|      } else {
 3406|   274M|        for (idx = 0; idx < core_sample; idx++) {
  ------------------
  |  Branch (3406:23): [True: 274M, False: 137k]
  ------------------
 3407|   274M|          ptr_inp_buf[idx % num_ch][idx / num_ch] = ptr_input_buffer[idx];
 3408|   274M|        }
 3409|   137k|      }
 3410|   196k|    }
 3411|   196k|  } else {
 3412|   130k|    if (pstr_config->use_delay_adjustment == 1) {
  ------------------
  |  Branch (3412:9): [True: 122k, False: 8.42k]
  ------------------
 3413|   122k|      delay = ((CC_DELAY_ADJUSTMENT * core_coder_frame_length) / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |  166|   122k|#define CC_DELAY_ADJUSTMENT (448)
  ------------------
                    delay = ((CC_DELAY_ADJUSTMENT * core_coder_frame_length) / FRAME_LEN_1024) * num_ch;
  ------------------
  |  |   91|   122k|#define FRAME_LEN_1024 1024
  ------------------
 3414|   122k|    }
 3415|   130k|    if (num_ch != 0) {
  ------------------
  |  Branch (3415:9): [True: 130k, False: 0]
  ------------------
 3416|   349k|      for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3416:21): [True: 218k, False: 130k]
  ------------------
 3417|   218k|        ptr_inp_buf[idx] = pstr_api_struct->pstr_state->ptr_in_buf[idx];
 3418|   218k|      }
 3419|       |
 3420|   197M|      for (idx = 0; idx < core_sample; idx++) {
  ------------------
  |  Branch (3420:21): [True: 197M, False: 130k]
  ------------------
 3421|   197M|        ptr_inp_buf[idx % num_ch][(idx + delay) / num_ch] = ps_inp_buf[idx];
 3422|   197M|      }
 3423|       |
 3424|   130k|      if (1 == pstr_config->use_drc_element) {
  ------------------
  |  Branch (3424:11): [True: 28.1k, False: 102k]
  ------------------
 3425|  47.3M|        for (idx = 0; idx < drc_sample; idx++) {
  ------------------
  |  Branch (3425:23): [True: 47.3M, False: 28.1k]
  ------------------
 3426|  47.3M|          ptr_drc_inp_buf[idx % num_ch][(idx + delay) / num_ch + ptr_inp_buf_offset] =
 3427|  47.3M|              ps_inp_buf[idx];
 3428|  47.3M|        }
 3429|  28.1k|      }
 3430|   130k|    }
 3431|   130k|  }
 3432|       |
 3433|   327k|  if (pstr_sig_class_data->is_switch_mode) {
  ------------------
  |  Branch (3433:7): [True: 111k, False: 216k]
  ------------------
 3434|   104M|    for (idx = 0; idx < core_coder_frame_length; idx++) {
  ------------------
  |  Branch (3434:19): [True: 104M, False: 111k]
  ------------------
 3435|   104M|      pstr_sig_class_data->input_samples[pstr_sig_class_data->n_buffer_samples + idx] =
 3436|   104M|          pstr_api_struct->pstr_state->ptr_in_buf[0][idx];
 3437|   104M|    }
 3438|   111k|    pstr_sig_class_data->n_buffer_samples += core_coder_frame_length;
 3439|   111k|    iusace_classification(pstr_sig_class_data, pstr_scratch, core_coder_frame_length);
 3440|   111k|  }
 3441|       |
 3442|   327k|  pstr_it_bit_buff =
 3443|   327k|      iusace_create_bit_buffer(pstr_it_bit_buff, pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT],
  ------------------
  |  |   26|   327k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3444|   327k|                               pstr_api_struct->pstr_mem_info[IA_MEMTYPE_OUTPUT].ui_size, 1);
  ------------------
  |  |   26|   327k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 3445|   327k|  if (pstr_it_bit_buff == NULL) {
  ------------------
  |  Branch (3445:7): [True: 0, False: 327k]
  ------------------
 3446|      0|    return IA_EXHEAACE_INIT_FATAL_USAC_BITBUFFER_INIT_FAILED;
 3447|      0|  }
 3448|   327k|  error =
 3449|   327k|      ixheaace_usac_encode(pstr_api_struct->pstr_state->ptr_in_buf, pstr_config,
 3450|   327k|                           &pstr_api_struct->pstr_state->str_usac_enc_data,
 3451|   327k|                           &pstr_api_struct->pstr_state->audio_specific_config, pstr_it_bit_buff,
 3452|   327k|                           pstr_sbr_encoder, pstr_api_struct->pstr_state->pp_drc_in_buf,
 3453|   327k|                           &pstr_api_struct->pstr_state->is_quant_spec_zero,
 3454|   327k|                           &pstr_api_struct->pstr_state->is_gain_limited);
 3455|   327k|  if (error) return error;
  ------------------
  |  Branch (3455:7): [True: 5.56k, False: 321k]
  ------------------
 3456|       |
 3457|   321k|  padding_bits = 8 - (pstr_it_bit_buff->cnt_bits & 7);
 3458|   321k|  if (padding_bits > 0 && padding_bits < 8) {
  ------------------
  |  Branch (3458:7): [True: 321k, False: 0]
  |  Branch (3458:27): [True: 278k, False: 43.6k]
  ------------------
 3459|   278k|    ps_out_buf[pstr_it_bit_buff->cnt_bits >> 3] =
 3460|   278k|        (WORD8)((UWORD32)ps_out_buf[pstr_it_bit_buff->cnt_bits >> 3]) & (0xFF << padding_bits);
 3461|   278k|  }
 3462|   321k|  pstr_api_struct->pstr_state->i_out_bytes =
 3463|   321k|      (padding_bits > 0 && padding_bits < 8) ? (pstr_it_bit_buff->cnt_bits + padding_bits) >> 3
  ------------------
  |  Branch (3463:8): [True: 321k, False: 0]
  |  Branch (3463:28): [True: 278k, False: 43.6k]
  ------------------
 3464|   321k|                                             : pstr_it_bit_buff->cnt_bits >> 3;
 3465|   321k|  pstr_api_struct->pstr_state->i_out_bits = pstr_it_bit_buff->cnt_bits;
 3466|   321k|  ixheaace_write_audio_preroll_data(pstr_api_struct, pstr_it_bit_buff);
 3467|   321k|  pstr_state->str_usac_enc_data.frame_count++;
 3468|   321k|  pstr_usac_data->usac_independency_flag_count =
 3469|   321k|      (pstr_usac_data->usac_independency_flag_count + 1) %
 3470|   321k|      pstr_usac_data->usac_independency_flag_interval;
 3471|       |
 3472|   321k|  if (pstr_config->sbr_enable) {
  ------------------
  |  Branch (3472:7): [True: 196k, False: 125k]
  ------------------
 3473|   196k|    WORD32 num_samples = pstr_api_struct->config[0].usac_config.ccfl * IXHEAACE_MAX_CH_IN_BS_ELE;
  ------------------
  |  |   22|   196k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
 3474|   196k|    switch (pstr_api_struct->config[0].ccfl_idx) {
  ------------------
  |  Branch (3474:13): [True: 196k, False: 0]
  ------------------
 3475|  32.0k|      case SBR_8_3:
  ------------------
  |  |  197|  32.0k|#define SBR_8_3 (2)
  ------------------
  |  Branch (3475:7): [True: 32.0k, False: 164k]
  ------------------
 3476|  32.0k|        num_samples *= 8;
 3477|  32.0k|        num_samples /= 3;
 3478|  32.0k|        break;
 3479|       |
 3480|   117k|      case SBR_2_1:
  ------------------
  |  |  198|   117k|#define SBR_2_1 (3)
  ------------------
  |  Branch (3480:7): [True: 117k, False: 79.1k]
  ------------------
 3481|   117k|        num_samples *= 2;
 3482|   117k|        break;
 3483|       |
 3484|  47.1k|      case SBR_4_1:
  ------------------
  |  |  199|  47.1k|#define SBR_4_1 (4)
  ------------------
  |  Branch (3484:7): [True: 47.1k, False: 149k]
  ------------------
 3485|  47.1k|        num_samples *= 4;
 3486|  47.1k|        break;
 3487|   196k|    }
 3488|       |
 3489|   196k|    if (ptr_input_buffer != NULL) {
  ------------------
  |  Branch (3489:9): [True: 196k, False: 0]
  ------------------
 3490|   196k|      memmove(ptr_input_buffer, ptr_input_buffer + num_samples,
 3491|   196k|              write_off_set * sizeof(ptr_input_buffer[0]));
 3492|   196k|    }
 3493|   196k|  } else if (!pstr_config->sbr_enable && pstr_config->use_delay_adjustment) {
  ------------------
  |  Branch (3493:14): [True: 125k, False: 0]
  |  Branch (3493:42): [True: 116k, False: 8.42k]
  ------------------
 3494|   309k|    for (idx = 0; idx < num_ch; idx++) {
  ------------------
  |  Branch (3494:19): [True: 192k, False: 116k]
  ------------------
 3495|   192k|      memmove(&ptr_inp_buf[idx][0], &ptr_inp_buf[idx][core_sample / num_ch],
 3496|   192k|              sizeof(ptr_inp_buf[idx][0]) * delay / num_ch);
 3497|   192k|    }
 3498|   116k|  }
 3499|       |
 3500|   321k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   321k|#define IA_NO_ERROR 0x00000000
  ------------------
 3501|   321k|}
ixheaace_api.c:ixheaace_write_audio_preroll_data:
 1843|   321k|                                              ia_bit_buf_struct *it_bit_buff) {
 1844|   321k|  ixheaace_config_struct *pstr_config = &pstr_api_struct->config[0];
 1845|   321k|  ixheaace_state_struct *pstr_enc_state = pstr_api_struct->pstr_state;
 1846|   321k|  ia_usac_data_struct *pstr_usac_data = &pstr_enc_state->str_usac_enc_data;
 1847|   321k|  ia_usac_encoder_config_struct *pstr_usac_config = &pstr_config->usac_config;
 1848|   321k|  WORD32 i, j, padding_bits;
 1849|       |
 1850|   321k|  if (pstr_usac_config->is_ipf) {
  ------------------
  |  Branch (1850:7): [True: 11.4k, False: 310k]
  ------------------
 1851|  11.4k|    if (pstr_usac_config->iframes_interval == pstr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1851:9): [True: 4.48k, False: 6.92k]
  ------------------
 1852|  4.48k|      WORD32 config_len = 0, num_bits = 0, au_len = 0, config_bits = 0;
 1853|  4.48k|      WORD32 bytes_to_write;
 1854|  4.48k|      UWORD8 *ptr_out = (UWORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT];
  ------------------
  |  |   26|  4.48k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1855|  4.48k|      WORD32 max_output_size =
 1856|  4.48k|          ((MAX_CHANNEL_BITS / BYTE_NUMBIT) * pstr_usac_config->channels) * MAX_PREROLL_FRAMES +
  ------------------
  |  |   41|  4.48k|#define MAX_CHANNEL_BITS 6144
  ------------------
                        ((MAX_CHANNEL_BITS / BYTE_NUMBIT) * pstr_usac_config->channels) * MAX_PREROLL_FRAMES +
  ------------------
  |  |   82|  4.48k|#define BYTE_NUMBIT 8
  ------------------
                        ((MAX_CHANNEL_BITS / BYTE_NUMBIT) * pstr_usac_config->channels) * MAX_PREROLL_FRAMES +
  ------------------
  |  |  205|  4.48k|#define MAX_PREROLL_FRAMES (3)
  ------------------
 1857|  4.48k|          MAX_PREROLL_CONFIG_SIZE;
  ------------------
  |  |  210|  4.48k|#define MAX_PREROLL_CONFIG_SIZE (1024)
  ------------------
 1858|  4.48k|      UWORD8 *out_data = ptr_out + max_output_size;
 1859|  4.48k|      UWORD8 residual_bits = 0, residual_data = 0;
 1860|  4.48k|      memmove(ptr_out + max_output_size, ptr_out, pstr_enc_state->i_out_bytes);
 1861|  4.48k|      pstr_usac_config->is_ipf = 0;
 1862|       |
 1863|  4.48k|      config_bits = ixheaace_get_usac_config_bytes(NULL, &pstr_enc_state->audio_specific_config,
 1864|  4.48k|                                                   pstr_config->ccfl_idx);
 1865|  4.48k|      config_len = (config_bits + 7) >> 3;
 1866|  4.48k|      num_bits = iusace_write_escape_value(NULL, config_len, 4, 4, 8);
 1867|  4.48k|      num_bits += (config_len * 8);  // config data bits
 1868|  4.48k|      num_bits++;                    // apply-crossfade
 1869|  4.48k|      num_bits++;                    // apr-reserved
 1870|       |      // bits for number of preroll frames
 1871|  4.48k|      num_bits += iusace_write_escape_value(NULL, pstr_usac_config->num_preroll_frames, 2, 4, 0);
 1872|       |      // bits for au_len
 1873|  14.5k|      for (i = 0; i < pstr_usac_config->num_preroll_frames; i++) {
  ------------------
  |  Branch (1873:19): [True: 10.0k, False: 4.48k]
  ------------------
 1874|  10.0k|        num_bits += iusace_write_escape_value(NULL, pstr_usac_data->prev_out_bytes[i], 16, 16, 0);
 1875|  10.0k|        au_len += pstr_usac_data->prev_out_bytes[i];
 1876|  10.0k|      }
 1877|  4.48k|      iusace_reset_bit_buffer(it_bit_buff);
 1878|       |      // total bytes to write
 1879|  4.48k|      bytes_to_write = (num_bits + 7) >> 3;
 1880|       |      // usacIndependencyFlag
 1881|  4.48k|      iusace_write_bits_buf(it_bit_buff, pstr_usac_data->usac_independency_flag, 1);
 1882|  4.48k|      iusace_write_bits_buf(it_bit_buff, 1, 1);  // usacExtElementPresent
 1883|  4.48k|      iusace_write_bits_buf(it_bit_buff, 0, 1);  // usacExtElementUseDefaultLength
 1884|       |
 1885|  4.48k|      if (au_len + bytes_to_write >= MAXIMUM_VALUE_8BIT) {
  ------------------
  |  |  207|  4.48k|#define MAXIMUM_VALUE_8BIT (255)
  ------------------
  |  Branch (1885:11): [True: 4.31k, False: 176]
  ------------------
 1886|  4.31k|        iusace_write_escape_value(it_bit_buff, au_len + bytes_to_write + 2, 8, 16, 0);
 1887|  4.31k|      } else {
 1888|    176|        iusace_write_bits_buf(it_bit_buff, au_len + bytes_to_write, 8);
 1889|    176|      }
 1890|       |
 1891|  4.48k|      iusace_write_escape_value(it_bit_buff, config_len, 4, 4, 8);  // configLen
 1892|       |      // Config
 1893|  4.48k|      ixheaace_get_usac_config_bytes(it_bit_buff, &pstr_enc_state->audio_specific_config,
 1894|  4.48k|                                     pstr_config->ccfl_idx);
 1895|       |
 1896|  4.48k|      if (config_bits % 8) {
  ------------------
  |  Branch (1896:11): [True: 2.76k, False: 1.72k]
  ------------------
 1897|  2.76k|        iusace_write_bits_buf(it_bit_buff, 0, (UWORD8)((config_len << 3) - config_bits));
 1898|  2.76k|      }
 1899|       |
 1900|  4.48k|      iusace_write_bits_buf(it_bit_buff, 0, 1);  // applyCrossfade
 1901|  4.48k|      iusace_write_bits_buf(it_bit_buff, 0, 1);  // apr_reserved
 1902|       |      // numPreRollFrames
 1903|  4.48k|      iusace_write_escape_value(it_bit_buff, pstr_usac_config->num_preroll_frames, 2, 4, 0);
 1904|  14.5k|      for (i = 0; i < pstr_usac_config->num_preroll_frames; i++) {
  ------------------
  |  Branch (1904:19): [True: 10.0k, False: 4.48k]
  ------------------
 1905|  10.0k|        au_len = pstr_usac_data->prev_out_bytes[i];
 1906|       |
 1907|  10.0k|        if (pstr_usac_config->iframes_interval != 0) {
  ------------------
  |  Branch (1907:13): [True: 10.0k, False: 0]
  ------------------
 1908|  10.0k|          out_data = pstr_usac_data->prev_out_data[i];
 1909|  10.0k|        }
 1910|       |
 1911|       |        // auLen
 1912|  10.0k|        iusace_write_escape_value(it_bit_buff, au_len, 16, 16, 0);
 1913|       |
 1914|       |        // AccessUnit
 1915|  7.95M|        for (j = 0; j < au_len; j++) {
  ------------------
  |  Branch (1915:21): [True: 7.94M, False: 10.0k]
  ------------------
 1916|  7.94M|          iusace_write_bits_buf(it_bit_buff, *out_data, 8);
 1917|  7.94M|          out_data++;
 1918|  7.94M|        }
 1919|  10.0k|      }
 1920|       |
 1921|  4.48k|      if (num_bits % 8) {
  ------------------
  |  Branch (1921:11): [True: 3.07k, False: 1.41k]
  ------------------
 1922|  3.07k|        iusace_write_bits_buf(it_bit_buff, 0, (UWORD8)((bytes_to_write << 3) - num_bits));
 1923|  3.07k|      }
 1924|       |      // current frame
 1925|  4.48k|      au_len = pstr_enc_state->i_out_bits >> 3;
 1926|  4.48k|      residual_bits = (UWORD8)(pstr_enc_state->i_out_bits - (au_len << 3));
 1927|  4.48k|      out_data = ptr_out + max_output_size;
 1928|  3.50M|      for (j = 0; j < au_len; j++) {
  ------------------
  |  Branch (1928:19): [True: 3.50M, False: 4.48k]
  ------------------
 1929|  3.50M|        iusace_write_bits_buf(it_bit_buff, *out_data, 8);
 1930|  3.50M|        out_data++;
 1931|  3.50M|      }
 1932|  4.48k|      residual_data = *out_data >> (8 - residual_bits);
 1933|  4.48k|      iusace_write_bits_buf(it_bit_buff, residual_data, residual_bits);
 1934|       |
 1935|  4.48k|      padding_bits = 8 - (it_bit_buff->cnt_bits & 7);
 1936|  4.48k|      if (padding_bits > 0 && padding_bits < 8) {
  ------------------
  |  Branch (1936:11): [True: 4.48k, False: 0]
  |  Branch (1936:31): [True: 3.85k, False: 636]
  ------------------
 1937|  3.85k|        ptr_out[it_bit_buff->cnt_bits >> 3] =
 1938|  3.85k|            (WORD8)((UWORD32)ptr_out[it_bit_buff->cnt_bits >> 3]) & (0xFF << padding_bits);
 1939|  3.85k|      }
 1940|  4.48k|      pstr_enc_state->i_out_bytes = (it_bit_buff->cnt_bits + 7) >> 3;
 1941|  4.48k|      pstr_usac_config->preroll_idx++;
 1942|       |
 1943|  4.48k|      if (!pstr_usac_config->is_first_frame) {
  ------------------
  |  Branch (1943:11): [True: 1.59k, False: 2.88k]
  ------------------
 1944|  1.59k|        pstr_usac_config->preroll_idx = pstr_usac_config->num_preroll_frames + 1;
 1945|  1.59k|      }
 1946|  4.48k|      if (pstr_usac_config->is_first_frame) {
  ------------------
  |  Branch (1946:11): [True: 2.88k, False: 1.59k]
  ------------------
 1947|  2.88k|        pstr_usac_config->is_first_frame = 0;
 1948|  2.88k|      }
 1949|  6.92k|    } else {
 1950|  6.92k|      if (pstr_usac_config->preroll_idx < pstr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1950:11): [True: 6.92k, False: 0]
  ------------------
 1951|  6.92k|        WORD32 *ptr_prev_out_bytes = pstr_usac_data->prev_out_bytes;
 1952|  6.92k|        WORD32 pr_idx = pstr_usac_config->preroll_idx;
 1953|  6.92k|        UWORD8 *ptr_out = (UWORD8 *)pstr_api_struct->pp_mem[IA_MEMTYPE_OUTPUT];
  ------------------
  |  |   26|  6.92k|#define IA_MEMTYPE_OUTPUT 0x03
  ------------------
 1954|  6.92k|        ptr_prev_out_bytes[pr_idx] = pstr_enc_state->i_out_bytes;
 1955|  6.92k|        memcpy(pstr_usac_data->prev_out_data[pr_idx++], ptr_out, pstr_enc_state->i_out_bytes);
 1956|  6.92k|        pstr_usac_config->preroll_idx = pr_idx;
 1957|  6.92k|        pstr_enc_state->i_out_bytes = 0;
 1958|  6.92k|      }
 1959|  6.92k|    }
 1960|   310k|  } else {
 1961|   710k|    for (j = 0; j < pstr_usac_config->num_preroll_frames - 1; j++) {
  ------------------
  |  Branch (1961:17): [True: 400k, False: 310k]
  ------------------
 1962|   400k|      pstr_usac_data->prev_out_bytes[j] = pstr_usac_data->prev_out_bytes[j + 1];
 1963|   400k|    }
 1964|   310k|    if (pstr_usac_config->num_preroll_frames) {
  ------------------
  |  Branch (1964:9): [True: 310k, False: 0]
  ------------------
 1965|   310k|      pstr_usac_data->prev_out_bytes[pstr_usac_config->num_preroll_frames - 1] =
 1966|   310k|          pstr_enc_state->i_out_bytes;
 1967|   310k|    }
 1968|   310k|    pstr_usac_config->preroll_idx = pstr_usac_config->num_preroll_frames + 1;
 1969|   310k|  }
 1970|   321k|  return;
 1971|   321k|}

ixheaace_get_audiospecific_config_bytes:
  399|  4.94k|    WORD32 ccfl_idx) {
  400|  4.94k|  WORD32 bit_cnt = 0, i;
  401|  4.94k|  UWORD32 tmp = 0x0f;  // initialized to indicate no sampling frequency index field
  402|  4.94k|  WORD32 ext_aot = -1;
  403|  4.94k|  WORD32 ext_id = 0;
  404|  4.94k|  WORD32 sbr_present_flag = 0, ps_present_flag = 0;
  405|       |
  406|  4.94k|  if (((AOT_AAC_ELD == aot) &&
  ------------------
  |  |   37|  4.94k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (406:8): [True: 715, False: 4.23k]
  ------------------
  407|    715|       (1 == pstr_audio_specific_config->str_aac_config.ld_sbr_sample_rate)) ||
  ------------------
  |  Branch (407:8): [True: 715, False: 0]
  ------------------
  408|  4.23k|      (AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |  141|  4.23k|#define AOT_SBR (5)
  ------------------
                    (AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |   39|  3.89k|#define AOT_PS (29)
  ------------------
  |  Branch (408:7): [True: 339, False: 3.89k]
  |  Branch (408:27): [True: 181, False: 3.71k]
  ------------------
  409|       |    // dual rate
  410|  1.23k|    pstr_audio_specific_config->ext_sampling_frequency =
  411|  1.23k|        pstr_audio_specific_config->sampling_frequency;
  412|  1.23k|    pstr_audio_specific_config->sampling_frequency /= 2;
  413|       |
  414|  1.23k|    if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |  141|  1.23k|#define AOT_SBR (5)
  ------------------
                  if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |   39|    896|#define AOT_PS (29)
  ------------------
  |  Branch (414:9): [True: 339, False: 896]
  |  Branch (414:29): [True: 181, False: 715]
  ------------------
  415|    520|      aot = AOT_AAC_LC;
  ------------------
  |  |   34|    520|#define AOT_AAC_LC (2)
  ------------------
  416|    520|    }
  417|  1.23k|  }
  418|  4.94k|  pstr_audio_specific_config->audio_object_type = aot;
  419|  4.94k|  if (aot == AOT_USAC) {
  ------------------
  |  |  142|  4.94k|#define AOT_USAC (42)
  ------------------
  |  Branch (419:7): [True: 3.25k, False: 1.69k]
  ------------------
  420|  18.1k|    for (i = 0; i < sizeof(iusace_sampl_freq_idx_table) / sizeof(iusace_sampl_freq_idx_table[0]);
  ------------------
  |  Branch (420:17): [True: 18.1k, False: 0]
  ------------------
  421|  18.1k|         i++) {
  422|  18.1k|      if (pstr_audio_specific_config->sampling_frequency == iusace_sampl_freq_idx_table[i]) {
  ------------------
  |  Branch (422:11): [True: 3.25k, False: 14.9k]
  ------------------
  423|  3.25k|        tmp = i;
  424|  3.25k|        break;
  425|  3.25k|      }
  426|  18.1k|    }
  427|  3.25k|  } 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|  4.94k|  pstr_audio_specific_config->samp_freq_index = (UWORD32)tmp;
  437|       |
  438|       |  // Write Audio Object Type
  439|  4.94k|  if (pstr_audio_specific_config->audio_object_type > 31) {
  ------------------
  |  Branch (439:7): [True: 3.97k, False: 976]
  ------------------
  440|  3.97k|    tmp = pstr_audio_specific_config->audio_object_type - 32;
  441|  3.97k|    pstr_audio_specific_config->audio_object_type = 31;
  442|  3.97k|  }
  443|  4.94k|  bit_cnt +=
  444|  4.94k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->audio_object_type), 5);
  445|  4.94k|  if (pstr_audio_specific_config->audio_object_type == 31) {
  ------------------
  |  Branch (445:7): [True: 3.97k, False: 976]
  ------------------
  446|  3.97k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, tmp, 6);
  447|  3.97k|    pstr_audio_specific_config->audio_object_type = tmp + 32;
  448|  3.97k|  }
  449|       |
  450|       |  // Write Audio Object Type
  451|  4.94k|  bit_cnt +=
  452|  4.94k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->samp_freq_index), 4);
  453|  4.94k|  if (pstr_audio_specific_config->samp_freq_index == 0xf) {
  ------------------
  |  Branch (453:7): [True: 0, False: 4.94k]
  ------------------
  454|      0|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  455|      0|                                     (pstr_audio_specific_config->sampling_frequency), 24);
  456|  4.94k|  } else if (AOT_USAC != aot) {
  ------------------
  |  |  142|  4.94k|#define AOT_USAC (42)
  ------------------
  |  Branch (456:14): [True: 1.69k, False: 3.25k]
  ------------------
  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|  4.94k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  461|  4.94k|                                   (pstr_audio_specific_config->channel_configuration), 4);
  462|       |
  463|  4.94k|  if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |  141|  4.94k|#define AOT_SBR (5)
  ------------------
                if ((AOT_SBR == aot) || (AOT_PS == aot)) {
  ------------------
  |  |   39|  4.94k|#define AOT_PS (29)
  ------------------
  |  Branch (463:7): [True: 0, False: 4.94k]
  |  Branch (463:27): [True: 0, False: 4.94k]
  ------------------
  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|  4.94k|  switch (aot) {
  487|    715|    case AOT_AAC_ELD: {
  ------------------
  |  |   37|    715|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (487:5): [True: 715, False: 4.23k]
  ------------------
  488|    715|      bit_cnt += iaace_get_eld_specific_config_bytes(
  489|    715|          pstr_it_bit_buff, &pstr_audio_specific_config->str_aac_config,
  490|    715|          pstr_audio_specific_config->channel_configuration);
  491|    715|      break;
  492|      0|    }
  493|    226|    case AOT_AAC_LD:
  ------------------
  |  |   36|    226|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (493:5): [True: 226, False: 4.72k]
  ------------------
  494|    976|    case AOT_AAC_LC:
  ------------------
  |  |   34|    976|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (494:5): [True: 750, False: 4.19k]
  ------------------
  495|    976|    case AOT_SBR:
  ------------------
  |  |  141|    976|#define AOT_SBR (5)
  ------------------
  |  Branch (495:5): [True: 0, False: 4.94k]
  ------------------
  496|    976|    case AOT_PS: {
  ------------------
  |  |   39|    976|#define AOT_PS (29)
  ------------------
  |  Branch (496:5): [True: 0, False: 4.94k]
  ------------------
  497|    976|      bit_cnt += iaace_ga_specific_config_bytes(
  498|    976|          pstr_it_bit_buff, &pstr_audio_specific_config->str_aac_config,
  499|    976|          pstr_audio_specific_config->channel_configuration, aot);
  500|       |
  501|    976|      if (AOT_AAC_LD == aot) {
  ------------------
  |  |   36|    976|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (501:11): [True: 226, False: 750]
  ------------------
  502|       |        // epconfig
  503|    226|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, 0, 2);
  504|    226|      }
  505|    976|      if (AOT_SBR == ext_aot) {
  ------------------
  |  |  141|    976|#define AOT_SBR (5)
  ------------------
  |  Branch (505:11): [True: 0, False: 976]
  ------------------
  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|    976|      break;
  527|    976|    }
  528|       |
  529|  3.25k|    case AOT_USAC: {
  ------------------
  |  |  142|  3.25k|#define AOT_USAC (42)
  ------------------
  |  Branch (529:5): [True: 3.25k, False: 1.69k]
  ------------------
  530|  3.25k|      WORD32 sbr_ratio_idx;
  531|  3.25k|      ia_usac_config_struct *pstr_usac_config = &(pstr_audio_specific_config->str_usac_config);
  532|  3.25k|      WORD32 ia_ccfl_tbl[5] = {768, 1024, 768, 1024, 1024};
  533|  3.25k|      pstr_audio_specific_config->core_sbr_framelength_index =
  534|  3.25k|          ccfl_idx;  // 768 core coder frame length without SBR
  535|  3.25k|      pstr_usac_config->ccfl =
  536|  3.25k|          ia_ccfl_tbl[pstr_audio_specific_config->core_sbr_framelength_index];
  537|  3.25k|      tmp = 0x1f;
  538|  18.1k|      for (i = 0; i < sizeof(ia_usac_sampl_freq_table) / sizeof(ia_usac_sampl_freq_table[0]);
  ------------------
  |  Branch (538:19): [True: 18.1k, False: 0]
  ------------------
  539|  18.1k|           i++) {
  540|  18.1k|        if (ia_usac_sampl_freq_table[i] == pstr_audio_specific_config->sampling_frequency) {
  ------------------
  |  Branch (540:13): [True: 3.25k, False: 14.9k]
  ------------------
  541|  3.25k|          tmp = i;
  542|  3.25k|          break;
  543|  3.25k|        }
  544|  18.1k|      }
  545|  3.25k|      pstr_audio_specific_config->samp_freq_index = (UWORD32)tmp;
  546|       |
  547|  3.25k|      if (pstr_audio_specific_config->samp_freq_index == 0x1f) {
  ------------------
  |  Branch (547:11): [True: 0, False: 3.25k]
  ------------------
  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.25k|      } else {
  552|  3.25k|        bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  553|  3.25k|                                         (pstr_audio_specific_config->samp_freq_index), 5);
  554|  3.25k|      }
  555|       |
  556|  3.25k|      bit_cnt += iusace_write_bits_buf(
  557|  3.25k|          pstr_it_bit_buff, (pstr_audio_specific_config->core_sbr_framelength_index), 3);
  558|       |
  559|  3.25k|      bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  560|  3.25k|                                       (pstr_audio_specific_config->channel_configuration), 5);
  561|       |
  562|  3.25k|      if (pstr_audio_specific_config->channel_configuration == 0) {
  ------------------
  |  Branch (562:11): [True: 0, False: 3.25k]
  ------------------
  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.25k|      sbr_ratio_idx = ixheaace_sbr_ratio(pstr_audio_specific_config->core_sbr_framelength_index);
  573|       |
  574|  3.25k|      bit_cnt += iusace_encoder_config(pstr_it_bit_buff, pstr_usac_config, sbr_ratio_idx,
  575|  3.25k|                                       &pstr_audio_specific_config->str_aac_config);
  576|       |
  577|  3.25k|      bit_cnt +=
  578|  3.25k|          iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_config->usac_cfg_ext_present, 1);
  579|  3.25k|      if (pstr_usac_config->usac_cfg_ext_present) {
  ------------------
  |  Branch (579:11): [True: 3.25k, False: 0]
  ------------------
  580|  3.25k|        bit_cnt += iusace_config_extension(pstr_it_bit_buff, pstr_usac_config);
  581|  3.25k|      }
  582|       |
  583|  3.25k|      if (sbr_ratio_idx)
  ------------------
  |  Branch (583:11): [True: 2.31k, False: 947]
  ------------------
  584|  2.31k|        pstr_audio_specific_config->sbr_present_flag = 1;
  585|    947|      else
  586|    947|        pstr_audio_specific_config->sbr_present_flag = 0;
  587|       |
  588|  3.25k|      pstr_audio_specific_config->ext_audio_object_type = 0;
  589|       |
  590|  3.25k|      if (pstr_audio_specific_config->ext_audio_object_type == AOT_SBR) {
  ------------------
  |  |  141|  3.25k|#define AOT_SBR (5)
  ------------------
  |  Branch (590:11): [True: 0, False: 3.25k]
  ------------------
  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.25k|    }
  612|  3.25k|    default:
  ------------------
  |  Branch (612:5): [True: 0, False: 4.94k]
  ------------------
  613|  3.25k|      break;
  614|  4.94k|  }
  615|  4.94k|  return bit_cnt;
  616|  4.94k|}
ixheaace_get_usac_config_bytes:
  620|  8.97k|    ixheaace_audio_specific_config_struct *pstr_audio_specific_config, WORD32 ccfl_idx) {
  621|  8.97k|  WORD32 sbr_ratio_idx;
  622|  8.97k|  ia_usac_config_struct *pstr_usac_config = &(pstr_audio_specific_config->str_usac_config);
  623|  8.97k|  WORD32 ia_ccfl_tbl[5] = {768, 1024, 768, 1024, 1024};
  624|  8.97k|  WORD32 i, tmp, bit_cnt = 0;
  625|  8.97k|  pstr_audio_specific_config->core_sbr_framelength_index =
  626|  8.97k|      ccfl_idx;  // 768 core coder frame length without SBR
  627|  8.97k|  pstr_usac_config->ccfl = ia_ccfl_tbl[pstr_audio_specific_config->core_sbr_framelength_index];
  628|  8.97k|  tmp = 0x1f;
  629|  66.6k|  for (i = 0; i < sizeof(ia_usac_sampl_freq_table) / sizeof(ia_usac_sampl_freq_table[0]); i++) {
  ------------------
  |  Branch (629:15): [True: 66.6k, False: 0]
  ------------------
  630|  66.6k|    if (ia_usac_sampl_freq_table[i] == pstr_audio_specific_config->sampling_frequency) {
  ------------------
  |  Branch (630:9): [True: 8.97k, False: 57.6k]
  ------------------
  631|  8.97k|      tmp = i;
  632|  8.97k|      break;
  633|  8.97k|    }
  634|  66.6k|  }
  635|  8.97k|  pstr_audio_specific_config->samp_freq_index = (UWORD32)tmp;
  636|       |
  637|  8.97k|  if (pstr_audio_specific_config->samp_freq_index == 0x1f) {
  ------------------
  |  Branch (637:7): [True: 0, False: 8.97k]
  ------------------
  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|  8.97k|  } else {
  642|  8.97k|    bit_cnt +=
  643|  8.97k|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_audio_specific_config->samp_freq_index), 5);
  644|  8.97k|  }
  645|       |
  646|  8.97k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  647|  8.97k|                                   (pstr_audio_specific_config->core_sbr_framelength_index), 3);
  648|       |
  649|  8.97k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  650|  8.97k|                                   (pstr_audio_specific_config->channel_configuration), 5);
  651|       |
  652|  8.97k|  if (pstr_audio_specific_config->channel_configuration == 0) {
  ------------------
  |  Branch (652:7): [True: 0, False: 8.97k]
  ------------------
  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|  8.97k|  sbr_ratio_idx = ixheaace_sbr_ratio(pstr_audio_specific_config->core_sbr_framelength_index);
  663|       |
  664|  8.97k|  bit_cnt += iusace_encoder_config(pstr_it_bit_buff, pstr_usac_config, sbr_ratio_idx,
  665|  8.97k|                                   &pstr_audio_specific_config->str_aac_config);
  666|       |
  667|  8.97k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_config->usac_cfg_ext_present, 1);
  668|  8.97k|  if (pstr_usac_config->usac_cfg_ext_present) {
  ------------------
  |  Branch (668:7): [True: 8.97k, False: 0]
  ------------------
  669|  8.97k|    bit_cnt += iusace_config_extension(pstr_it_bit_buff, pstr_usac_config);
  670|  8.97k|  }
  671|       |
  672|  8.97k|  if (sbr_ratio_idx)
  ------------------
  |  Branch (672:7): [True: 5.13k, False: 3.84k]
  ------------------
  673|  5.13k|    pstr_audio_specific_config->sbr_present_flag = 1;
  674|  3.84k|  else
  675|  3.84k|    pstr_audio_specific_config->sbr_present_flag = 0;
  676|       |
  677|  8.97k|  pstr_audio_specific_config->ext_audio_object_type = 0;
  678|       |
  679|  8.97k|  if (pstr_audio_specific_config->ext_audio_object_type == AOT_SBR) {
  ------------------
  |  |  141|  8.97k|#define AOT_SBR (5)
  ------------------
  |  Branch (679:7): [True: 0, False: 8.97k]
  ------------------
  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|  8.97k|  return bit_cnt;
  701|  8.97k|}
ixheaace_asc_write.c:iaace_get_eld_specific_config_bytes:
  327|    715|                                                  WORD32 channel_configuration) {
  328|    715|  WORD32 bit_cnt = 0;
  329|    715|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->frame_length_flag), 1);
  330|    715|  bit_cnt +=
  331|    715|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->aac_sec_data_resilience_flag), 1);
  332|    715|  bit_cnt +=
  333|    715|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->aac_sf_data_resilience_flag), 1);
  334|    715|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  335|    715|                                   (pstr_eld_config->aac_spec_data_resilience_flag), 1);
  336|    715|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->ld_sbr_present_flag), 1);
  337|       |
  338|    715|  if (pstr_eld_config->ld_sbr_present_flag) {
  ------------------
  |  Branch (338:7): [True: 715, False: 0]
  ------------------
  339|    715|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->ld_sbr_sample_rate), 1);
  340|    715|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->ld_sbr_crc_flag), 1);
  341|    715|    bit_cnt +=
  342|    715|        ld_sbr_header(pstr_it_bit_buff, pstr_eld_config->sbr_config, channel_configuration);
  343|    715|  }
  344|       |
  345|    715|  if (pstr_eld_config->num_sac_cfg_bits) {
  ------------------
  |  Branch (345:7): [True: 449, False: 266]
  ------------------
  346|    449|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->eld_ext_type[0]), 4);
  347|    449|    bit_cnt +=
  348|    449|        iusace_write_escape_value(pstr_it_bit_buff, (pstr_eld_config->eld_ext_len[0]), 4, 8, 16);
  349|    449|    if (IAAC_ELDEXT_LDSAC == pstr_eld_config->eld_ext_type[0]) {
  ------------------
  |  Branch (349:9): [True: 449, False: 0]
  ------------------
  350|    449|      bit_cnt += ixheaace_spatial_specific_config(pstr_it_bit_buff, pstr_eld_config);
  351|    449|    }
  352|    449|  }
  353|    715|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (IAAC_ELDEXT_TERM), 4);
  354|       |
  355|    715|  return bit_cnt;
  356|    715|}
ixheaace_asc_write.c:ld_sbr_header:
  297|    715|                            WORD32 channel_configuration) {
  298|    715|  WORD32 num_sbr_header, el, bit_cnt = 0;
  299|    715|  switch (channel_configuration) {
  300|    286|    case 1:
  ------------------
  |  Branch (300:5): [True: 286, False: 429]
  ------------------
  301|    524|    case 2:
  ------------------
  |  Branch (301:5): [True: 238, False: 477]
  ------------------
  302|    524|      num_sbr_header = 1;
  303|    524|      break;
  304|     25|    case 3:
  ------------------
  |  Branch (304:5): [True: 25, False: 690]
  ------------------
  305|     25|      num_sbr_header = 2;
  306|     25|      break;
  307|     41|    case 4:
  ------------------
  |  Branch (307:5): [True: 41, False: 674]
  ------------------
  308|     65|    case 5:
  ------------------
  |  Branch (308:5): [True: 24, False: 691]
  ------------------
  309|    166|    case 6:
  ------------------
  |  Branch (309:5): [True: 101, False: 614]
  ------------------
  310|    166|      num_sbr_header = 3;
  311|    166|      break;
  312|      0|    case 7:
  ------------------
  |  Branch (312:5): [True: 0, False: 715]
  ------------------
  313|      0|      num_sbr_header = 4;
  314|      0|      break;
  315|      0|    default:
  ------------------
  |  Branch (315:5): [True: 0, False: 715]
  ------------------
  316|      0|      num_sbr_header = 0;
  317|      0|      break;
  318|    715|  }
  319|  1.78k|  for (el = 0; el < num_sbr_header; el++) {
  ------------------
  |  Branch (319:16): [True: 1.07k, False: 715]
  ------------------
  320|  1.07k|    bit_cnt += sbr_header(pstr_it_bit_buff, pstr_sbr_config);
  321|  1.07k|  }
  322|    715|  return bit_cnt;
  323|    715|}
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: 788, False: 284]
  ------------------
  280|    788|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->freq_scale), 2);
  281|    788|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->alter_scale), 1);
  282|    788|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_sbr_config->sbr_noise_bands), 2);
  283|    788|  }
  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.81k|                                               ia_aace_config_struct *pstr_eld_config) {
   52|  2.81k|  WORD32 bit_cnt = 0, cnt = 0;
   53|  2.81k|  WORD32 num_bytes = pstr_eld_config->num_sac_cfg_bits >> 3;
   54|  9.85k|  for (cnt = 0; cnt < num_bytes; cnt++) {
  ------------------
  |  Branch (54:17): [True: 7.04k, False: 2.81k]
  ------------------
   55|  7.04k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->sac_cfg_data[cnt]), 8);
   56|  7.04k|  }
   57|  2.81k|  if (pstr_eld_config->num_sac_cfg_bits & 0x7) {
  ------------------
  |  Branch (57:7): [True: 2.36k, False: 449]
  ------------------
   58|  2.36k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_eld_config->sac_cfg_data[cnt]),
   59|  2.36k|                                     (pstr_eld_config->num_sac_cfg_bits & 0x7));
   60|  2.36k|  }
   61|       |
   62|  2.81k|  return bit_cnt;
   63|  2.81k|}
ixheaace_asc_write.c:iaace_ga_specific_config_bytes:
  360|    976|                                             WORD32 channel_configuration, WORD32 aot) {
  361|    976|  WORD32 bit_cnt = 0;
  362|    976|  bit_cnt +=
  363|    976|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_ga_specific_config->frame_length_flag), 1);
  364|    976|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  365|    976|                                   (pstr_ga_specific_config->depends_on_core_coder), 1);
  366|    976|  if (pstr_ga_specific_config->depends_on_core_coder) {
  ------------------
  |  Branch (366:7): [True: 0, False: 976]
  ------------------
  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|    976|  if (!channel_configuration) {
  ------------------
  |  Branch (370:7): [True: 0, False: 976]
  ------------------
  371|      0|  }
  372|       |
  373|    976|  if (AOT_AAC_LD == aot) {
  ------------------
  |  |   36|    976|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (373:7): [True: 226, False: 750]
  ------------------
  374|    226|    pstr_ga_specific_config->extension_flag = 1;
  375|    226|  }
  376|    976|  if (AOT_AAC_LC == aot) {
  ------------------
  |  |   34|    976|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (376:7): [True: 750, False: 226]
  ------------------
  377|    750|    pstr_ga_specific_config->extension_flag = 0;
  378|    750|  }
  379|    976|  bit_cnt +=
  380|    976|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_ga_specific_config->extension_flag), 1);
  381|       |
  382|    976|  if ((pstr_ga_specific_config->extension_flag) && ((AOT_AAC_LD == aot))) {
  ------------------
  |  |   36|    226|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (382:7): [True: 226, False: 750]
  |  Branch (382:52): [True: 226, False: 0]
  ------------------
  383|    226|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  384|    226|                                     (pstr_ga_specific_config->aac_sec_data_resilience_flag), 1);
  385|    226|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  386|    226|                                     (pstr_ga_specific_config->aac_sf_data_resilience_flag), 1);
  387|    226|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
  388|    226|                                     (pstr_ga_specific_config->aac_spec_data_resilience_flag), 1);
  389|       |
  390|       |    // extension flag 3
  391|    226|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, 0, 1);
  392|    226|  }
  393|    976|  return bit_cnt;
  394|    976|}
ixheaace_asc_write.c:ixheaace_sbr_ratio:
  248|  12.2k|static UWORD32 ixheaace_sbr_ratio(UWORD32 core_sbr_framelength_idx) {
  249|  12.2k|  UWORD32 sbr_ratio_index = 0x0FF;
  250|       |
  251|  12.2k|  switch (core_sbr_framelength_idx) {
  ------------------
  |  Branch (251:11): [True: 12.2k, False: 0]
  ------------------
  252|  1.30k|    case 0:
  ------------------
  |  Branch (252:5): [True: 1.30k, False: 10.9k]
  ------------------
  253|  4.78k|    case 1:
  ------------------
  |  Branch (253:5): [True: 3.48k, False: 8.74k]
  ------------------
  254|  4.78k|      sbr_ratio_index = USAC_SBR_RATIO_NO_SBR;
  ------------------
  |  |  185|  4.78k|#define USAC_SBR_RATIO_NO_SBR (0)
  ------------------
  255|  4.78k|      break;
  256|  1.38k|    case 2:
  ------------------
  |  Branch (256:5): [True: 1.38k, False: 10.8k]
  ------------------
  257|  1.38k|      sbr_ratio_index = USAC_SBR_RATIO_INDEX_8_3;
  ------------------
  |  |  187|  1.38k|#define USAC_SBR_RATIO_INDEX_8_3 (2)
  ------------------
  258|  1.38k|      break;
  259|  4.42k|    case 3:
  ------------------
  |  Branch (259:5): [True: 4.42k, False: 7.80k]
  ------------------
  260|  4.42k|      sbr_ratio_index = USAC_SBR_RATIO_INDEX_2_1;
  ------------------
  |  |  186|  4.42k|#define USAC_SBR_RATIO_INDEX_2_1 (3)
  ------------------
  261|  4.42k|      break;
  262|  1.62k|    case 4:
  ------------------
  |  Branch (262:5): [True: 1.62k, False: 10.6k]
  ------------------
  263|  1.62k|      sbr_ratio_index = USAC_SBR_RATIO_INDEX_4_1;
  ------------------
  |  |  188|  1.62k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  264|  1.62k|      break;
  265|  12.2k|  }
  266|       |
  267|  12.2k|  return sbr_ratio_index;
  268|  12.2k|}
ixheaace_asc_write.c:iusace_encoder_config:
  202|  12.2k|                                    ia_aace_config_struct *pstr_eld_config) {
  203|  12.2k|  WORD32 bit_cnt = 0;
  204|  12.2k|  UWORD32 elem_idx = 0;
  205|  12.2k|  ia_usac_enc_element_config_struct *pstr_usac_enc_conf;
  206|       |
  207|  12.2k|  bit_cnt +=
  208|  12.2k|      iusace_write_escape_value(pstr_it_bit_buff, pstr_usac_cfg->num_elements - 1, 4, 8, 16);
  209|       |
  210|  50.6k|  for (elem_idx = 0; elem_idx < pstr_usac_cfg->num_elements; elem_idx++) {
  ------------------
  |  Branch (210:22): [True: 38.4k, False: 12.2k]
  ------------------
  211|  38.4k|    unsigned long tmp = pstr_usac_cfg->usac_element_type[elem_idx];
  212|  38.4k|    pstr_usac_enc_conf = &pstr_usac_cfg->str_usac_element_config[elem_idx];
  213|  38.4k|    bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, tmp, 2);
  214|       |
  215|  38.4k|    switch (pstr_usac_cfg->usac_element_type[elem_idx]) {
  216|  3.26k|      case ID_USAC_SCE:
  ------------------
  |  |  137|  3.26k|#define ID_USAC_SCE 0
  ------------------
  |  Branch (216:7): [True: 3.26k, False: 35.1k]
  ------------------
  217|  3.26k|        bit_cnt += iusace_write_bits_buf(
  218|  3.26k|            pstr_it_bit_buff, (pstr_usac_enc_conf->tw_mdct),
  219|  3.26k|            1);  // For extended HE AAC profile tw_mdct shall be encoded with 0.
  220|  3.26k|        bit_cnt +=
  221|  3.26k|            iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_enc_conf->noise_filling), 1);
  222|  3.26k|        if (sbr_ratio_idx > 0) {
  ------------------
  |  Branch (222:13): [True: 1.96k, False: 1.29k]
  ------------------
  223|  1.96k|          bit_cnt +=
  224|  1.96k|              iusace_sbr_config(pstr_it_bit_buff, &(pstr_usac_enc_conf->str_usac_sbr_config));
  225|  1.96k|        }
  226|  3.26k|        break;
  227|  8.96k|      case ID_USAC_CPE:
  ------------------
  |  |  138|  8.96k|#define ID_USAC_CPE 1
  ------------------
  |  Branch (227:7): [True: 8.96k, False: 29.4k]
  ------------------
  228|  8.96k|        bit_cnt += iusace_write_bits_buf(
  229|  8.96k|            pstr_it_bit_buff, (pstr_usac_enc_conf->tw_mdct),
  230|  8.96k|            1);  // For extended HE AAC profile tw_mdct shall be encoded with 0.
  231|  8.96k|        bit_cnt +=
  232|  8.96k|            iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_enc_conf->noise_filling), 1);
  233|  8.96k|        bit_cnt += iusace_cpe_config(pstr_it_bit_buff, pstr_usac_enc_conf, sbr_ratio_idx,
  234|  8.96k|                                     pstr_eld_config);
  235|  8.96k|        break;
  236|  26.2k|      case ID_USAC_EXT:
  ------------------
  |  |  139|  26.2k|#define ID_USAC_EXT 3
  ------------------
  |  Branch (236:7): [True: 26.2k, False: 12.2k]
  ------------------
  237|  26.2k|        bit_cnt += iusace_ext_element_config(pstr_it_bit_buff, pstr_usac_enc_conf);
  238|  26.2k|        break;
  239|      0|      default:
  ------------------
  |  Branch (239:7): [True: 0, False: 38.4k]
  ------------------
  240|      0|        return IA_EXHEAACE_INIT_FATAL_USAC_INVALID_ELEMENT_TYPE;
  241|      0|        break;
  242|  38.4k|    }
  243|  38.4k|  }
  244|       |
  245|  12.2k|  return bit_cnt;
  246|  12.2k|}
ixheaace_asc_write.c:iusace_sbr_config:
  108|  7.44k|                                ia_usac_enc_sbr_config_struct *pstr_usac_sbr_config) {
  109|  7.44k|  WORD32 bit_cnt = 0;
  110|       |
  111|  7.44k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->harmonic_sbr), 1);
  112|  7.44k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->bs_inter_tes), 1);
  113|  7.44k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->bs_pvc), 1);
  114|  7.44k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_start_freq), 4);
  115|  7.44k|  bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_stop_freq), 4);
  116|  7.44k|  bit_cnt +=
  117|  7.44k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_header_extra1), 1);
  118|  7.44k|  bit_cnt +=
  119|  7.44k|      iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_sbr_config->dflt_header_extra2), 1);
  120|       |
  121|  7.44k|  if (pstr_usac_sbr_config->dflt_header_extra1) {
  ------------------
  |  Branch (121:7): [True: 0, False: 7.44k]
  ------------------
  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.44k|  if (pstr_usac_sbr_config->dflt_header_extra2) {
  ------------------
  |  Branch (130:7): [True: 0, False: 7.44k]
  ------------------
  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.44k|  return bit_cnt;
  142|  7.44k|}
ixheaace_asc_write.c:iusace_cpe_config:
  146|  8.96k|                                WORD32 sbr_ratio_idx, ia_aace_config_struct *pstr_eld_config) {
  147|  8.96k|  WORD32 bit_count = 0;
  148|       |
  149|  8.96k|  if (sbr_ratio_idx > 0) {
  ------------------
  |  Branch (149:7): [True: 5.47k, False: 3.49k]
  ------------------
  150|  5.47k|    bit_count += iusace_sbr_config(pstr_it_bit_buff, &(pstr_usac_enc_conf->str_usac_sbr_config));
  151|  5.47k|    bit_count +=
  152|  5.47k|        iusace_write_bits_buf(pstr_it_bit_buff, (pstr_usac_enc_conf->stereo_config_index), 2);
  153|  5.47k|  }
  154|       |
  155|  8.96k|  if (pstr_usac_enc_conf->stereo_config_index > 0) {
  ------------------
  |  Branch (155:7): [True: 2.36k, False: 6.60k]
  ------------------
  156|  2.36k|    if (pstr_eld_config->num_sac_cfg_bits) {
  ------------------
  |  Branch (156:9): [True: 2.36k, False: 0]
  ------------------
  157|  2.36k|      {
  158|  2.36k|        bit_count += ixheaace_spatial_specific_config(pstr_it_bit_buff, pstr_eld_config);
  159|  2.36k|      }
  160|  2.36k|    }
  161|  2.36k|  }
  162|       |
  163|  8.96k|  return bit_count;
  164|  8.96k|}
ixheaace_asc_write.c:iusace_ext_element_config:
  166|  26.2k|                                        ia_usac_enc_element_config_struct *pstr_usac_enc_conf) {
  167|  26.2k|  WORD32 bit_count = 0;
  168|       |
  169|  26.2k|  bit_count += iusace_write_escape_value(pstr_it_bit_buff, pstr_usac_enc_conf->usac_ext_ele_type,
  170|  26.2k|                                         4, 8, 16);
  171|  26.2k|  bit_count += iusace_write_escape_value(pstr_it_bit_buff,
  172|  26.2k|                                         pstr_usac_enc_conf->usac_ext_ele_cfg_len, 4, 8, 16);
  173|  26.2k|  bit_count += iusace_write_bits_buf(pstr_it_bit_buff,
  174|  26.2k|                                     (pstr_usac_enc_conf->usac_ext_ele_dflt_len_present), 1);
  175|       |
  176|  26.2k|  if (pstr_usac_enc_conf->usac_ext_ele_dflt_len_present) {
  ------------------
  |  Branch (176:7): [True: 0, False: 26.2k]
  ------------------
  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.2k|  bit_count += iusace_write_bits_buf(pstr_it_bit_buff,
  181|  26.2k|                                     (pstr_usac_enc_conf->usac_ext_ele_payload_present), 1);
  182|       |
  183|  26.2k|  switch (pstr_usac_enc_conf->usac_ext_ele_type) {
  184|  12.2k|    case ID_EXT_ELE_FILL:
  ------------------
  |  |  144|  12.2k|#define ID_EXT_ELE_FILL 0
  ------------------
  |  Branch (184:5): [True: 12.2k, False: 13.9k]
  ------------------
  185|  12.2k|      break;
  186|  1.75k|    case ID_EXT_ELE_UNI_DRC: {
  ------------------
  |  |  145|  1.75k|#define ID_EXT_ELE_UNI_DRC 4
  ------------------
  |  Branch (186:5): [True: 1.75k, False: 24.4k]
  ------------------
  187|  1.75k|      UWORD32 i;
  188|  43.6k|      for (i = 0; i < pstr_usac_enc_conf->usac_ext_ele_cfg_len; i++) {
  ------------------
  |  Branch (188:19): [True: 41.9k, False: 1.75k]
  ------------------
  189|  41.9k|        bit_count +=
  190|  41.9k|            iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_enc_conf->drc_config_data[i], 8);
  191|  41.9k|      }
  192|  1.75k|    } break;
  193|  12.2k|    default:
  ------------------
  |  Branch (193:5): [True: 12.2k, False: 13.9k]
  ------------------
  194|  12.2k|      break;
  195|  26.2k|  }
  196|       |
  197|  26.2k|  return bit_count;
  198|  26.2k|}
ixheaace_asc_write.c:iusace_config_extension:
   65|  12.2k|                                      ia_usac_config_struct *pstr_usac_config) {
   66|  12.2k|  WORD32 bit_cnt = 0;
   67|  12.2k|  UWORD32 i, j;
   68|  12.2k|  UWORD32 fill_byte_val = 0xa5;
   69|       |
   70|  12.2k|  bit_cnt += iusace_write_escape_value(pstr_it_bit_buff,
   71|  12.2k|                                       pstr_usac_config->num_config_extensions - 1, 2, 4, 8);
   72|       |
   73|  36.6k|  for (j = 0; j < pstr_usac_config->num_config_extensions; j++) {
  ------------------
  |  Branch (73:15): [True: 24.4k, False: 12.2k]
  ------------------
   74|  24.4k|    bit_cnt += iusace_write_escape_value(pstr_it_bit_buff,
   75|  24.4k|                                         pstr_usac_config->usac_config_ext_type[j], 4, 8, 16);
   76|       |
   77|  24.4k|    bit_cnt += iusace_write_escape_value(pstr_it_bit_buff,
   78|  24.4k|                                         pstr_usac_config->usac_config_ext_len[j], 4, 8, 16);
   79|       |
   80|  24.4k|    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: 24.4k]
  ------------------
   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.2k|      case ID_CONFIG_EXT_LOUDNESS_INFO:
  ------------------
  |  |  150|  12.2k|#define ID_CONFIG_EXT_LOUDNESS_INFO (2)
  ------------------
  |  Branch (86:7): [True: 12.2k, False: 12.2k]
  ------------------
   87|   253k|        for (i = 0; i < pstr_usac_config->usac_config_ext_len[j]; i++) {
  ------------------
  |  Branch (87:21): [True: 241k, False: 12.2k]
  ------------------
   88|   241k|          bit_cnt += iusace_write_bits_buf(pstr_it_bit_buff,
   89|   241k|                                           pstr_usac_config->usac_config_ext_buf[j][i], 8);
   90|   241k|        }
   91|  12.2k|        break;
   92|  12.2k|      case ID_CONFIG_EXT_STREAM_ID:
  ------------------
  |  |  151|  12.2k|#define ID_CONFIG_EXT_STREAM_ID (7)
  ------------------
  |  Branch (92:7): [True: 12.2k, False: 12.2k]
  ------------------
   93|  12.2k|        bit_cnt +=
   94|  12.2k|            iusace_write_bits_buf(pstr_it_bit_buff, pstr_usac_config->stream_identifier, 16);
   95|  12.2k|        break;
   96|      0|      default:
  ------------------
  |  Branch (96:7): [True: 0, False: 24.4k]
  ------------------
   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|  24.4k|    }
  103|  24.4k|  }
  104|  12.2k|  return bit_cnt;
  105|  12.2k|}

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

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

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

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

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

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

ia_enhaacplus_enc_init_element_info:
   93|  4.84k|                                                 WORD32 ele_type, WORD32 element_instance_tag) {
   94|  4.84k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
   95|       |
   96|  4.84k|  if (ele_type != ID_LFE) {
  ------------------
  |  Branch (96:7): [True: 4.41k, False: 433]
  ------------------
   97|  4.41k|    switch (num_channels) {
   98|  2.17k|      case NUM_CHANS_MONO:
  ------------------
  |  |  113|  2.17k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (98:7): [True: 2.17k, False: 2.24k]
  ------------------
   99|  2.17k|        if (ele_type == -1) {
  ------------------
  |  Branch (99:13): [True: 150, False: 2.02k]
  ------------------
  100|    150|          error = ia_enhaacplus_enc_init_element(pstr_element_info, ID_SCE, element_instance_tag);
  101|  2.02k|        } else {
  102|  2.02k|          error =
  103|  2.02k|              ia_enhaacplus_enc_init_element(pstr_element_info, ele_type, element_instance_tag);
  104|  2.02k|        }
  105|  2.17k|        break;
  106|       |
  107|  2.24k|      case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  2.24k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (107:7): [True: 2.24k, False: 2.17k]
  ------------------
  108|  2.24k|        error = ia_enhaacplus_enc_init_element(pstr_element_info, ID_CPE, element_instance_tag);
  109|  2.24k|        break;
  110|       |
  111|      0|      default:
  ------------------
  |  Branch (111:7): [True: 0, False: 4.41k]
  ------------------
  112|      0|        return IA_EXHEAACE_INIT_FATAL_NUM_CHANNELS_NOT_SUPPORTED;
  113|  4.41k|    }
  114|  4.41k|  } else {
  115|    433|    error = ia_enhaacplus_enc_init_element(pstr_element_info, ID_LFE, element_instance_tag);
  116|    433|  }
  117|       |
  118|  4.84k|  return error;
  119|  4.84k|}
ia_enhaacplus_enc_init_element_bits:
  125|  4.84k|                                                 WORD32 bit_res, FLAG flag_framelength_small) {
  126|  4.84k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  127|       |
  128|  4.84k|  switch (pstr_element_info.n_channels_in_el) {
  129|  2.60k|    case NUM_CHANS_MONO:
  ------------------
  |  |  113|  2.60k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (129:5): [True: 2.60k, False: 2.24k]
  ------------------
  130|  2.60k|      element_bits->ch_bitrate = bitrate_tot;
  131|       |
  132|  2.60k|      element_bits->average_bits = (average_bits_tot - static_bits_tot);
  133|  2.60k|      switch (aot) {
  ------------------
  |  Branch (133:15): [True: 2.60k, False: 0]
  ------------------
  134|    522|        case AOT_AAC_LC:
  ------------------
  |  |   34|    522|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (134:9): [True: 522, False: 2.08k]
  ------------------
  135|  1.40k|        case AOT_SBR:
  ------------------
  |  |   35|  1.40k|#define AOT_SBR (5)
  ------------------
  |  Branch (135:9): [True: 879, False: 1.72k]
  ------------------
  136|  1.63k|        case AOT_PS:
  ------------------
  |  |   39|  1.63k|#define AOT_PS (29)
  ------------------
  |  Branch (136:9): [True: 232, False: 2.37k]
  ------------------
  137|  1.63k|          if (flag_framelength_small) {
  ------------------
  |  Branch (137:15): [True: 516, False: 1.11k]
  ------------------
  138|    516|            element_bits->max_bits = MAXIMUM_CHANNEL_BITS_960;
  ------------------
  |  |   95|    516|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  139|       |
  140|    516|            element_bits->max_bit_res_bits = MAXIMUM_CHANNEL_BITS_960 - average_bits_tot;
  ------------------
  |  |   95|    516|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  141|  1.11k|          } else {
  142|  1.11k|            element_bits->max_bits = MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |   94|  1.11k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  143|       |
  144|  1.11k|            element_bits->max_bit_res_bits = MAXIMUM_CHANNEL_BITS_1024 - average_bits_tot;
  ------------------
  |  |   94|  1.11k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  145|  1.11k|          }
  146|  1.63k|          break;
  147|       |
  148|    293|        case AOT_AAC_LD:
  ------------------
  |  |   36|    293|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (148:9): [True: 293, False: 2.31k]
  ------------------
  149|    972|        case AOT_AAC_ELD:
  ------------------
  |  |   37|    972|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (149:9): [True: 679, False: 1.92k]
  ------------------
  150|    972|          if (bit_res) {
  ------------------
  |  Branch (150:15): [True: 638, False: 334]
  ------------------
  151|    638|            element_bits->max_bits = bit_res;
  152|    638|            element_bits->max_bit_res_bits = bit_res - average_bits_tot;
  153|    638|          } else {
  154|    334|            element_bits->max_bits = average_bits_tot;
  155|    334|            element_bits->max_bit_res_bits = 0;
  156|    334|          }
  157|    972|          break;
  158|  2.60k|      }
  159|       |
  160|  2.60k|      element_bits->max_bit_res_bits -= (element_bits[0].max_bit_res_bits % 8);
  161|  2.60k|      element_bits->bit_res_level = element_bits[0].max_bit_res_bits;
  162|  2.60k|      element_bits->relative_bits = 1;
  163|  2.60k|      break;
  164|       |
  165|  2.24k|    case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  2.24k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (165:5): [True: 2.24k, False: 2.60k]
  ------------------
  166|  2.24k|      element_bits->ch_bitrate = bitrate_tot >> 1;
  167|       |
  168|  2.24k|      element_bits->average_bits = (average_bits_tot - static_bits_tot);
  169|  2.24k|      switch (aot) {
  ------------------
  |  Branch (169:15): [True: 2.24k, False: 0]
  ------------------
  170|    532|        case AOT_AAC_LC:
  ------------------
  |  |   34|    532|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (170:9): [True: 532, False: 1.71k]
  ------------------
  171|  1.40k|        case AOT_SBR:
  ------------------
  |  |   35|  1.40k|#define AOT_SBR (5)
  ------------------
  |  Branch (171:9): [True: 876, False: 1.36k]
  ------------------
  172|  1.40k|        case AOT_PS:
  ------------------
  |  |   39|  1.40k|#define AOT_PS (29)
  ------------------
  |  Branch (172:9): [True: 0, False: 2.24k]
  ------------------
  173|  1.40k|          if (flag_framelength_small) {
  ------------------
  |  Branch (173:15): [True: 505, False: 903]
  ------------------
  174|    505|            element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960;
  ------------------
  |  |  114|    505|#define NUM_CHANS_STEREO (2)
  ------------------
                          element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960;
  ------------------
  |  |   95|    505|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  175|       |
  176|    505|            element_bits->max_bit_res_bits =
  177|    505|                NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960 - average_bits_tot;
  ------------------
  |  |  114|    505|#define NUM_CHANS_STEREO (2)
  ------------------
                              NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_960 - average_bits_tot;
  ------------------
  |  |   95|    505|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  178|    903|          } else {
  179|    903|            element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |  114|    903|#define NUM_CHANS_STEREO (2)
  ------------------
                          element_bits->max_bits = NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |   94|    903|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  180|       |
  181|    903|            element_bits->max_bit_res_bits =
  182|    903|                NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024 - average_bits_tot;
  ------------------
  |  |  114|    903|#define NUM_CHANS_STEREO (2)
  ------------------
                              NUM_CHANS_STEREO * MAXIMUM_CHANNEL_BITS_1024 - average_bits_tot;
  ------------------
  |  |   94|    903|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  183|    903|          }
  184|  1.40k|          break;
  185|       |
  186|    240|        case AOT_AAC_LD:
  ------------------
  |  |   36|    240|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (186:9): [True: 240, False: 2.00k]
  ------------------
  187|    835|        case AOT_AAC_ELD:
  ------------------
  |  |   37|    835|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (187:9): [True: 595, False: 1.64k]
  ------------------
  188|    835|          if (bit_res) {
  ------------------
  |  Branch (188:15): [True: 560, False: 275]
  ------------------
  189|    560|            element_bits->max_bits = bit_res;
  190|    560|            element_bits->max_bit_res_bits = bit_res - average_bits_tot;
  191|    560|          } else {
  192|    275|            element_bits->max_bits = average_bits_tot;
  193|    275|            element_bits->max_bit_res_bits = 0;
  194|    275|          }
  195|    835|          break;
  196|  2.24k|      }
  197|       |
  198|  2.24k|      element_bits->max_bit_res_bits -= (element_bits[0].max_bit_res_bits % 8);
  199|       |
  200|  2.24k|      element_bits->bit_res_level = element_bits[0].max_bit_res_bits;
  201|  2.24k|      element_bits->relative_bits = 1;
  202|  2.24k|      break;
  203|       |
  204|      0|    default:
  ------------------
  |  Branch (204:5): [True: 0, False: 4.84k]
  ------------------
  205|      0|      return IA_EXHEAACE_INIT_FATAL_INVALID_NUM_CHANNELS_IN_ELE;
  206|  4.84k|  }
  207|       |  /* Bits carried over from previous frame */
  208|  4.84k|  element_bits->carry_bits = 0;
  209|       |
  210|  4.84k|  return error;
  211|  4.84k|}
ixheaace_channel_map.c:ia_enhaacplus_enc_init_element:
   51|  4.84k|                                                   WORD32 element_instance_tag) {
   52|  4.84k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
   53|       |
   54|  4.84k|  pstr_element_info->el_type = el_type;
   55|       |
   56|  4.84k|  switch (pstr_element_info->el_type) {
   57|  2.17k|    case ID_SCE:
  ------------------
  |  Branch (57:5): [True: 2.17k, False: 2.67k]
  ------------------
   58|  2.17k|    case ID_CCE:
  ------------------
  |  Branch (58:5): [True: 0, False: 4.84k]
  ------------------
   59|  2.17k|      pstr_element_info->n_channels_in_el = NUM_CHANS_MONO;
  ------------------
  |  |  113|  2.17k|#define NUM_CHANS_MONO (1)
  ------------------
   60|       |
   61|  2.17k|      pstr_element_info->channel_index[0] = 0;
   62|       |
   63|  2.17k|      pstr_element_info->instance_tag = element_instance_tag;
   64|  2.17k|      break;
   65|       |
   66|    433|    case ID_LFE:
  ------------------
  |  Branch (66:5): [True: 433, False: 4.41k]
  ------------------
   67|    433|      pstr_element_info->n_channels_in_el = NUM_CHANS_MONO;
  ------------------
  |  |  113|    433|#define NUM_CHANS_MONO (1)
  ------------------
   68|       |
   69|    433|      pstr_element_info->channel_index[0] = 0;
   70|       |
   71|    433|      pstr_element_info->instance_tag = element_instance_tag;
   72|    433|      break;
   73|       |
   74|  2.24k|    case ID_CPE:
  ------------------
  |  Branch (74:5): [True: 2.24k, False: 2.60k]
  ------------------
   75|       |
   76|  2.24k|      pstr_element_info->n_channels_in_el = NUM_CHANS_STEREO;
  ------------------
  |  |  114|  2.24k|#define NUM_CHANS_STEREO (2)
  ------------------
   77|       |
   78|  2.24k|      pstr_element_info->channel_index[0] = 0;
   79|  2.24k|      pstr_element_info->channel_index[1] = 1;
   80|       |
   81|  2.24k|      pstr_element_info->instance_tag = element_instance_tag;
   82|  2.24k|      break;
   83|       |
   84|      0|    default:
  ------------------
  |  Branch (84:5): [True: 0, False: 4.84k]
  ------------------
   85|      0|      return IA_EXHEAACE_INIT_FATAL_INVALID_ELEMENT_TYPE;
   86|  4.84k|  }
   87|       |
   88|  4.84k|  return error;
   89|  4.84k|}

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

ia_enhaacplus_enc_dyn_bitcount:
  550|   464k|    WORD32 *ptr_scratch_buf, WORD32 aot, WORD32 *bit_cnt) {
  551|   464k|  IA_ERRORCODE err_code;
  552|   464k|  WORD32(*ptr_bit_look_up)
  553|   464k|  [CODE_BCK_ESC_NDX + 1] = (WORD32(*)[CODE_BCK_ESC_NDX + 1]) ptr_scratch_buf;
  554|   464k|  WORD32 *ptr_merge_gain_look_up =
  555|   464k|      ptr_scratch_buf + MAXIMUM_SCALE_FACTOR_BAND_LONG * (CODE_BCK_ESC_NDX + 1);
  ------------------
  |  |   65|   464k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  ------------------
  556|   464k|  *bit_cnt = 0;
  557|   464k|  pstr_section_data->block_type = block_type;
  558|   464k|  pstr_section_data->sfb_cnt = sfb_cnt;
  559|   464k|  pstr_section_data->sfb_per_group = sfb_per_grp;
  560|       |
  561|   464k|  pstr_section_data->total_groups_cnt = sfb_cnt / sfb_per_grp;
  562|       |
  563|   464k|  pstr_section_data->max_sfb_per_grp = max_sfb_per_grp;
  564|       |
  565|   464k|  err_code = ia_enhaacplus_enc_noiseless_counter(
  566|   464k|      pstr_section_data, ptr_merge_gain_look_up, ptr_bit_look_up, ptr_quant_spec,
  567|   464k|      ptr_max_val_in_sfb, ptr_sfb_offset, block_type, ptr_side_info_tab_long,
  568|   464k|      ptr_side_info_tab_short, ptr_huffman_tbl, aot);
  569|       |
  570|   464k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   464k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (570:7): [True: 0, False: 464k]
  ------------------
  571|      0|    return err_code;
  572|      0|  }
  573|       |
  574|   464k|  err_code = ia_enhaacplus_enc_scf_count(ptr_scale_fac, ptr_max_val_in_sfb, pstr_section_data,
  575|   464k|                                         ptr_huffman_tbl);
  576|       |
  577|   464k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   464k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (577:7): [True: 0, False: 464k]
  ------------------
  578|      0|    return err_code;
  579|      0|  }
  580|       |
  581|   464k|  *bit_cnt = (pstr_section_data->huffman_bits + pstr_section_data->side_info_bits +
  582|   464k|              pstr_section_data->scale_fac_bits);
  583|   464k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   464k|#define IA_NO_ERROR 0x00000000
  ------------------
  584|   464k|}
ia_enhaacplus_enc_bitcount_init:
  586|  4.84k|VOID ia_enhaacplus_enc_bitcount_init(WORD32 *side_info_tab_long, WORD32 *side_info_tab_short) {
  587|  4.84k|  WORD32 i;
  588|       |
  589|       |  /* side_info_tab_long[] */
  590|   256k|  for (i = 0; i <= MAXIMUM_SCALE_FACTOR_BAND_LONG; i++) {
  ------------------
  |  |   65|   256k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  ------------------
  |  Branch (590:15): [True: 252k, False: 4.84k]
  ------------------
  591|   252k|    side_info_tab_long[i] = ia_enhaacplus_enc_calc_side_info_bits(i, LONG_WINDOW);
  592|   252k|  }
  593|       |
  594|       |  /* side_info_tab_short[] */
  595|  82.4k|  for (i = 0; i <= MAXIMUM_SCALE_FACTOR_BAND_SHORT; i++) {
  ------------------
  |  |   64|  82.4k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  ------------------
  |  Branch (595:15): [True: 77.5k, False: 4.84k]
  ------------------
  596|  77.5k|    side_info_tab_short[i] = ia_enhaacplus_enc_calc_side_info_bits(i, SHORT_WINDOW);
  597|  77.5k|  }
  598|  4.84k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_noiseless_counter:
  352|   464k|    ixheaace_huffman_tables *pstr_huffman_tbl, WORD32 aot) {
  353|   464k|  WORD32 grp_idx;
  354|   464k|  WORD32 *ptr_side_info_tab = 0;
  355|   464k|  ixheaace_section_info *pstr_section_info;
  356|   464k|  WORD32 i;
  357|       |
  358|  24.1M|  for (i = 0; i < MAXIMUM_SCALE_FACTOR_BAND_LONG; i++) {
  ------------------
  |  |   65|  24.1M|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  ------------------
  |  Branch (358:15): [True: 23.7M, False: 464k]
  ------------------
  359|  23.7M|    memset(bit_look_up[i], 0, (CODE_BCK_ESC_NDX + 1) * sizeof(bit_look_up[0][0]));
  360|  23.7M|  }
  361|       |
  362|       |  /* counting previous operations */
  363|   464k|  switch (block_type) {
  364|   336k|    case LONG_WINDOW:
  ------------------
  |  Branch (364:5): [True: 336k, False: 127k]
  ------------------
  365|   357k|    case START_WINDOW:
  ------------------
  |  Branch (365:5): [True: 21.0k, False: 443k]
  ------------------
  366|   376k|    case STOP_WINDOW:
  ------------------
  |  Branch (366:5): [True: 18.8k, False: 445k]
  ------------------
  367|       |
  368|   376k|      ptr_side_info_tab = ptr_side_info_tab_long;
  369|   376k|      break;
  370|  88.1k|    case SHORT_WINDOW:
  ------------------
  |  Branch (370:5): [True: 88.1k, False: 376k]
  ------------------
  371|       |
  372|  88.1k|      ptr_side_info_tab = ptr_side_info_tab_short;
  373|  88.1k|      break;
  374|      0|    default:
  ------------------
  |  Branch (374:5): [True: 0, False: 464k]
  ------------------
  375|      0|      return IA_EXHEAACE_EXE_FATAL_INVALID_BLOCK_TYPE;
  376|   464k|  }
  377|       |
  378|   464k|  pstr_section_data->num_of_sections = 0;
  379|   464k|  pstr_section_data->huffman_bits = 0;
  380|   464k|  pstr_section_data->side_info_bits = 0;
  381|       |
  382|   464k|  if (pstr_section_data->max_sfb_per_grp == 0) {
  ------------------
  |  Branch (382:7): [True: 77.0k, False: 387k]
  ------------------
  383|  77.0k|    return IA_NO_ERROR;
  ------------------
  |  |   23|  77.0k|#define IA_NO_ERROR 0x00000000
  ------------------
  384|  77.0k|  }
  385|       |
  386|  1.02M|  for (grp_idx = 0; grp_idx < pstr_section_data->sfb_cnt;
  ------------------
  |  Branch (386:21): [True: 641k, False: 387k]
  ------------------
  387|   641k|       grp_idx += pstr_section_data->sfb_per_group) {
  388|   641k|    pstr_section_info = pstr_section_data->section + pstr_section_data->num_of_sections;
  389|       |
  390|   641k|    ia_enhaacplus_enc_build_bit_look_up(ptr_quant_spec, pstr_section_data->max_sfb_per_grp,
  391|   641k|                                        ptr_sfb_offset + grp_idx, ptr_max_val_in_sfb + grp_idx,
  392|   641k|                                        bit_look_up, pstr_section_info, pstr_huffman_tbl, aot);
  393|       |
  394|   641k|    ia_enhaacplus_enc_gm_stage0(pstr_section_info, bit_look_up,
  395|   641k|                                pstr_section_data->max_sfb_per_grp, aot);
  396|       |
  397|   641k|    ia_enhaacplus_enc_gm_stage1(pstr_section_info, bit_look_up,
  398|   641k|                                pstr_section_data->max_sfb_per_grp, ptr_side_info_tab, aot);
  399|       |
  400|   641k|    ia_enhaacplus_enc_gm_stage2(pstr_section_info, merge_gain_look_up, bit_look_up,
  401|   641k|                                pstr_section_data->max_sfb_per_grp, ptr_side_info_tab, aot);
  402|       |
  403|  2.34M|    for (i = 0; i < pstr_section_data->max_sfb_per_grp; i += pstr_section_info[i].sfb_cnt) {
  ------------------
  |  Branch (403:17): [True: 1.70M, False: 641k]
  ------------------
  404|  1.70M|      ia_enhaacplus_enc_find_best_book(bit_look_up[i], &(pstr_section_info[i].code_book), aot);
  405|       |
  406|  1.70M|      pstr_section_info[i].sfb_start += (WORD8)grp_idx;
  407|       |
  408|  1.70M|      pstr_section_data->huffman_bits +=
  409|  1.70M|          pstr_section_info[i].section_bits - ptr_side_info_tab[pstr_section_info[i].sfb_cnt];
  410|       |
  411|  1.70M|      pstr_section_data->side_info_bits += ptr_side_info_tab[pstr_section_info[i].sfb_cnt];
  412|       |
  413|  1.70M|      pstr_section_data->section[pstr_section_data->num_of_sections++] = pstr_section_info[i];
  414|  1.70M|    }
  415|   641k|  }
  416|   387k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   387k|#define IA_NO_ERROR 0x00000000
  ------------------
  417|   464k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_build_bit_look_up:
   73|   641k|    WORD32 aot) {
   74|   641k|  WORD8 i;
   75|       |
   76|  13.5M|  for (i = 0; i < max_sfb; i++) {
  ------------------
  |  Branch (76:15): [True: 12.8M, False: 641k]
  ------------------
   77|  12.8M|    WORD32 sfb_width, max_val;
   78|       |
   79|  12.8M|    pstr_section_info[i].sfb_cnt = 1;
   80|  12.8M|    pstr_section_info[i].sfb_start = i;
   81|       |
   82|  12.8M|    switch (aot) {
  ------------------
  |  Branch (82:13): [True: 12.8M, False: 0]
  ------------------
   83|  3.03M|      case AOT_AAC_LC:
  ------------------
  |  |   34|  3.03M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (83:7): [True: 3.03M, False: 9.84M]
  ------------------
   84|  9.21M|      case AOT_SBR:
  ------------------
  |  |   35|  9.21M|#define AOT_SBR (5)
  ------------------
  |  Branch (84:7): [True: 6.17M, False: 6.70M]
  ------------------
   85|  9.96M|      case AOT_PS:
  ------------------
  |  |   39|  9.96M|#define AOT_PS (29)
  ------------------
  |  Branch (85:7): [True: 753k, False: 12.1M]
  ------------------
   86|  9.96M|        pstr_section_info[i].section_bits = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  9.96M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
   87|  9.96M|        break;
   88|       |
   89|   730k|      case AOT_AAC_LD:
  ------------------
  |  |   36|   730k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (89:7): [True: 730k, False: 12.1M]
  ------------------
   90|  2.91M|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  2.91M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (90:7): [True: 2.18M, False: 10.7M]
  ------------------
   91|  2.91M|        pstr_section_info[i].section_bits = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  2.91M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
   92|  2.91M|        break;
   93|  12.8M|    }
   94|       |
   95|  12.8M|    pstr_section_info[i].code_book = -1;
   96|       |
   97|  12.8M|    sfb_width = ptr_sfb_offset[i + 1] - ptr_sfb_offset[i];
   98|       |
   99|  12.8M|    max_val = sfb_max[i];
  100|       |
  101|  12.8M|    ia_enhaacplus_enc_bitcount(ptr_quant_spec + ptr_sfb_offset[i], sfb_width, max_val,
  102|  12.8M|                               bit_look_up[i], pstr_huffman_tbl, aot);
  103|  12.8M|  }
  104|   641k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_gm_stage0:
  241|   641k|    const WORD32 max_sfb, WORD32 aot) {
  242|   641k|  WORD32 i = 0;
  243|   641k|  WORD32 invalid_bitcnt = 0;
  244|       |
  245|   641k|  switch (aot) {
  ------------------
  |  Branch (245:11): [True: 641k, False: 0]
  ------------------
  246|   162k|    case AOT_AAC_LC:
  ------------------
  |  |   34|   162k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (246:5): [True: 162k, False: 479k]
  ------------------
  247|   468k|    case AOT_SBR:
  ------------------
  |  |   35|   468k|#define AOT_SBR (5)
  ------------------
  |  Branch (247:5): [True: 306k, False: 334k]
  ------------------
  248|   512k|    case AOT_PS:
  ------------------
  |  |   39|   512k|#define AOT_PS (29)
  ------------------
  |  Branch (248:5): [True: 43.1k, False: 598k]
  ------------------
  249|   512k|      invalid_bitcnt = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|   512k|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  250|   512k|      break;
  251|       |
  252|  34.4k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  34.4k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (252:5): [True: 34.4k, False: 606k]
  ------------------
  253|   129k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|   129k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (253:5): [True: 94.7k, False: 546k]
  ------------------
  254|       |
  255|   129k|      invalid_bitcnt = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|   129k|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  256|   129k|      break;
  257|   641k|  }
  258|  13.5M|  while (i < max_sfb) {
  ------------------
  |  Branch (258:10): [True: 12.8M, False: 641k]
  ------------------
  259|  12.8M|    if (pstr_section[i].section_bits == invalid_bitcnt) {
  ------------------
  |  Branch (259:9): [True: 12.8M, False: 0]
  ------------------
  260|  12.8M|      pstr_section[i].section_bits = (WORD16)ia_enhaacplus_enc_find_best_book(
  261|  12.8M|          bit_look_up[i], &(pstr_section[i].code_book), aot);
  262|  12.8M|    }
  263|  12.8M|    i++;
  264|  12.8M|  }
  265|   641k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_gm_stage1:
  270|   641k|    const WORD32 max_sfb, const WORD32 *ptr_side_info_tab, WORD32 aot) {
  271|   641k|  WORD32 merge_start = 0, merge_end;
  272|       |
  273|  3.82M|  do {
  274|  12.8M|    for (merge_end = merge_start + 1; merge_end < max_sfb; merge_end++) {
  ------------------
  |  Branch (274:39): [True: 12.2M, False: 641k]
  ------------------
  275|  12.2M|      if (pstr_section_info[merge_start].code_book != pstr_section_info[merge_end].code_book) {
  ------------------
  |  Branch (275:11): [True: 3.18M, False: 9.05M]
  ------------------
  276|  3.18M|        break;
  277|  3.18M|      }
  278|       |
  279|  9.05M|      pstr_section_info[merge_start].sfb_cnt++;
  280|       |
  281|  9.05M|      pstr_section_info[merge_start].section_bits += pstr_section_info[merge_end].section_bits;
  282|       |
  283|  9.05M|      ia_enhaacplus_enc_merge_bit_look_up(bit_look_up[merge_start], bit_look_up[merge_end], aot);
  284|  9.05M|    }
  285|       |
  286|  3.82M|    pstr_section_info[merge_start].section_bits +=
  287|  3.82M|        (WORD16)ptr_side_info_tab[pstr_section_info[merge_start].sfb_cnt];
  288|       |
  289|  3.82M|    pstr_section_info[merge_end - 1].sfb_start = pstr_section_info[merge_start].sfb_start;
  290|       |
  291|  3.82M|    merge_start = merge_end;
  292|       |
  293|  3.82M|  } while (merge_start < max_sfb);
  ------------------
  |  Branch (293:12): [True: 3.18M, False: 641k]
  ------------------
  294|   641k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_merge_bit_look_up:
  177|  11.1M|                                                WORD32 aot) {
  178|  11.1M|  WORD32 j, temp1, temp2, temp3, temp4;
  179|  11.1M|  WORD32 invalid_bitcnt = 0;
  180|       |
  181|  11.1M|  switch (aot) {
  ------------------
  |  Branch (181:11): [True: 11.1M, False: 0]
  ------------------
  182|  2.65M|    case AOT_AAC_LC:
  ------------------
  |  |   34|  2.65M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (182:5): [True: 2.65M, False: 8.51M]
  ------------------
  183|  8.04M|    case AOT_SBR:
  ------------------
  |  |   35|  8.04M|#define AOT_SBR (5)
  ------------------
  |  Branch (183:5): [True: 5.38M, False: 5.78M]
  ------------------
  184|  8.59M|    case AOT_PS:
  ------------------
  |  |   39|  8.59M|#define AOT_PS (29)
  ------------------
  |  Branch (184:5): [True: 550k, False: 10.6M]
  ------------------
  185|  8.59M|      invalid_bitcnt = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  8.59M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  186|  8.59M|      break;
  187|       |
  188|   646k|    case AOT_AAC_LD:
  ------------------
  |  |   36|   646k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (188:5): [True: 646k, False: 10.5M]
  ------------------
  189|  2.57M|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  2.57M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (189:5): [True: 1.92M, False: 9.24M]
  ------------------
  190|  2.57M|      invalid_bitcnt = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  2.57M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  191|  2.57M|      break;
  192|  11.1M|  }
  193|  78.2M|  for (j = 0; j <= CODE_BCK_ESC_NDX; j += 2) {
  ------------------
  |  Branch (193:15): [True: 67.0M, False: 11.1M]
  ------------------
  194|  67.0M|    temp1 = ptr_bit_cnt1[j];
  195|  67.0M|    temp2 = ptr_bit_cnt2[j];
  196|  67.0M|    temp3 = ptr_bit_cnt1[j + 1];
  197|       |
  198|  67.0M|    ptr_bit_cnt1[j] = MIN(temp1 + temp2, invalid_bitcnt);
  ------------------
  |  |   23|  67.0M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 48.7M, False: 18.3M]
  |  |  ------------------
  ------------------
  199|  67.0M|    temp4 = ptr_bit_cnt2[j + 1];
  200|  67.0M|    ptr_bit_cnt1[j + 1] = MIN(temp3 + temp4, invalid_bitcnt);
  ------------------
  |  |   23|  67.0M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 54.4M, False: 12.6M]
  |  |  ------------------
  ------------------
  201|  67.0M|  }
  202|  11.1M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_gm_stage2:
  300|   641k|    const WORD32 max_sfb, const WORD32 *ptr_side_info_tab, WORD32 aot) {
  301|   641k|  WORD32 i;
  302|       |
  303|  3.82M|  for (i = 0; i + pstr_section_info[i].sfb_cnt < max_sfb; i += pstr_section_info[i].sfb_cnt) {
  ------------------
  |  Branch (303:15): [True: 3.18M, False: 641k]
  ------------------
  304|  3.18M|    merge_gain_look_up[i] =
  305|  3.18M|        ia_enhaacplus_enc_calc_merge_gain(pstr_section_info, bit_look_up, ptr_side_info_tab, i,
  306|  3.18M|                                          i + pstr_section_info[i].sfb_cnt, aot);
  307|  3.18M|  }
  308|       |
  309|  2.75M|  while (TRUE) {
  ------------------
  |  |   23|  2.75M|#define TRUE (1)
  |  |  ------------------
  |  |  |  Branch (23:14): [True: 2.75M, Folded]
  |  |  ------------------
  ------------------
  310|  2.75M|    WORD32 max_merge_gain = 0, max_idx = 0, max_idx_next = 0, max_idx_last = 0;
  311|       |
  312|  2.75M|    max_merge_gain = ia_enhaacplus_enc_find_max_merge(merge_gain_look_up, pstr_section_info,
  313|  2.75M|                                                      max_sfb, &max_idx);
  314|       |
  315|  2.75M|    if (max_merge_gain <= 0) {
  ------------------
  |  Branch (315:9): [True: 641k, False: 2.11M]
  ------------------
  316|   641k|      break;
  317|   641k|    }
  318|       |
  319|  2.11M|    max_idx_next = max_idx + pstr_section_info[max_idx].sfb_cnt;
  320|       |
  321|  2.11M|    pstr_section_info[max_idx].sfb_cnt += pstr_section_info[max_idx_next].sfb_cnt;
  322|       |
  323|  2.11M|    pstr_section_info[max_idx].section_bits +=
  324|  2.11M|        pstr_section_info[max_idx_next].section_bits - (WORD16)max_merge_gain;
  325|       |
  326|  2.11M|    ia_enhaacplus_enc_merge_bit_look_up(bit_look_up[max_idx], bit_look_up[max_idx_next], aot);
  327|       |
  328|  2.11M|    if (max_idx != 0) {
  ------------------
  |  Branch (328:9): [True: 1.75M, False: 364k]
  ------------------
  329|  1.75M|      max_idx_last = pstr_section_info[max_idx - 1].sfb_start;
  330|       |
  331|  1.75M|      merge_gain_look_up[max_idx_last] = ia_enhaacplus_enc_calc_merge_gain(
  332|  1.75M|          pstr_section_info, bit_look_up, ptr_side_info_tab, max_idx_last, max_idx, aot);
  333|  1.75M|    }
  334|       |
  335|  2.11M|    max_idx_next = max_idx + pstr_section_info[max_idx].sfb_cnt;
  336|       |
  337|  2.11M|    pstr_section_info[max_idx_next - 1].sfb_start = pstr_section_info[max_idx].sfb_start;
  338|       |
  339|  2.11M|    if (max_idx_next < max_sfb) {
  ------------------
  |  Branch (339:9): [True: 1.92M, False: 192k]
  ------------------
  340|  1.92M|      merge_gain_look_up[max_idx] = ia_enhaacplus_enc_calc_merge_gain(
  341|  1.92M|          pstr_section_info, bit_look_up, ptr_side_info_tab, max_idx, max_idx_next, aot);
  342|  1.92M|    }
  343|  2.11M|  }
  344|   641k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_calc_merge_gain:
  222|  6.85M|    const WORD32 *pstr_side_info_tab, const WORD32 idx1, const WORD32 idx2, WORD32 aot) {
  223|  6.85M|  WORD32 split_bits;
  224|  6.85M|  WORD32 merge_bits;
  225|  6.85M|  WORD32 merge_gain;
  226|       |
  227|  6.85M|  split_bits = pstr_section_info[idx1].section_bits + pstr_section_info[idx2].section_bits;
  228|       |
  229|  6.85M|  merge_bits =
  230|  6.85M|      pstr_side_info_tab[pstr_section_info[idx1].sfb_cnt + pstr_section_info[idx2].sfb_cnt] +
  231|  6.85M|      ia_enhaacplus_enc_find_min_merge_bits(bit_look_up[idx1], bit_look_up[idx2], aot);
  232|       |
  233|  6.85M|  merge_gain = split_bits - merge_bits;
  234|       |
  235|  6.85M|  return merge_gain;
  236|  6.85M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_find_min_merge_bits:
  143|  6.85M|                                                    const WORD32 *ptr_bit_cnt2, WORD32 aot) {
  144|  6.85M|  WORD32 min_bits = 0, j, temp1, temp2, temp3, temp4;
  145|       |
  146|  6.85M|  switch (aot) {
  ------------------
  |  Branch (146:11): [True: 6.85M, False: 0]
  ------------------
  147|  1.34M|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.34M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (147:5): [True: 1.34M, False: 5.51M]
  ------------------
  148|  4.57M|    case AOT_SBR:
  ------------------
  |  |   35|  4.57M|#define AOT_SBR (5)
  ------------------
  |  Branch (148:5): [True: 3.22M, False: 3.62M]
  ------------------
  149|  5.26M|    case AOT_PS:
  ------------------
  |  |   39|  5.26M|#define AOT_PS (29)
  ------------------
  |  Branch (149:5): [True: 697k, False: 6.15M]
  ------------------
  150|  5.26M|      min_bits = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  5.26M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  151|  5.26M|      break;
  152|       |
  153|   442k|    case AOT_AAC_LD:
  ------------------
  |  |   36|   442k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (153:5): [True: 442k, False: 6.41M]
  ------------------
  154|  1.58M|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.58M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (154:5): [True: 1.14M, False: 5.71M]
  ------------------
  155|  1.58M|      min_bits = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  1.58M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  156|  1.58M|      break;
  157|  6.85M|  }
  158|       |
  159|  47.9M|  for (j = CODE_BCK_ESC_NDX; j >= 0; j -= 2) {
  ------------------
  |  Branch (159:30): [True: 41.1M, False: 6.85M]
  ------------------
  160|  41.1M|    temp1 = *ptr_bit_cnt1++;
  161|  41.1M|    temp2 = *ptr_bit_cnt2++;
  162|  41.1M|    temp3 = *ptr_bit_cnt1++;
  163|       |
  164|  41.1M|    temp1 = temp1 + temp2;
  165|       |
  166|  41.1M|    min_bits = MIN(temp1, min_bits);
  ------------------
  |  |   23|  41.1M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 4.02M, False: 37.1M]
  |  |  ------------------
  ------------------
  167|  41.1M|    temp4 = *ptr_bit_cnt2++;
  168|  41.1M|    temp1 = temp3 + temp4;
  169|       |
  170|  41.1M|    min_bits = MIN(temp1, min_bits);
  ------------------
  |  |   23|  41.1M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.04M, False: 34.0M]
  |  |  ------------------
  ------------------
  171|  41.1M|  }
  172|       |
  173|  6.85M|  return min_bits;
  174|  6.85M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_find_max_merge:
  206|  2.75M|    const ixheaace_section_info *section, const WORD32 max_sfb, WORD32 *max_ndx) {
  207|  2.75M|  WORD32 i, max_merge_gain = 0;
  208|       |
  209|  20.7M|  for (i = 0; i + section[i].sfb_cnt < max_sfb; i += section[i].sfb_cnt) {
  ------------------
  |  Branch (209:15): [True: 17.9M, False: 2.75M]
  ------------------
  210|  17.9M|    if (merge_gain_look_up[i] > max_merge_gain) {
  ------------------
  |  Branch (210:9): [True: 3.95M, False: 14.0M]
  ------------------
  211|  3.95M|      max_merge_gain = merge_gain_look_up[i];
  212|  3.95M|      *max_ndx = i;
  213|  3.95M|    }
  214|  17.9M|  }
  215|       |
  216|  2.75M|  return (max_merge_gain);
  217|  2.75M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_find_best_book:
  107|  14.5M|                                               WORD32 aot) {
  108|  14.5M|  WORD32 min_bits = 0, temp1, temp2;
  109|  14.5M|  WORD8 temp_book = CODE_BCK_ESC_NDX;
  110|  14.5M|  WORD8 j;
  111|       |
  112|  14.5M|  switch (aot) {
  ------------------
  |  Branch (112:11): [True: 14.5M, False: 0]
  ------------------
  113|  3.41M|    case AOT_AAC_LC:
  ------------------
  |  |   34|  3.41M|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (113:5): [True: 3.41M, False: 11.1M]
  ------------------
  114|  10.3M|    case AOT_SBR:
  ------------------
  |  |   35|  10.3M|#define AOT_SBR (5)
  ------------------
  |  Branch (114:5): [True: 6.97M, False: 7.61M]
  ------------------
  115|  11.3M|    case AOT_PS:
  ------------------
  |  |   39|  11.3M|#define AOT_PS (29)
  ------------------
  |  Branch (115:5): [True: 955k, False: 13.6M]
  ------------------
  116|  11.3M|      min_bits = INVALID_BITCOUNT_LC;
  ------------------
  |  |   22|  11.3M|#define INVALID_BITCOUNT_LC (SHRT_MAX)
  ------------------
  117|  11.3M|      break;
  118|       |
  119|   813k|    case AOT_AAC_LD:
  ------------------
  |  |   36|   813k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (119:5): [True: 813k, False: 13.7M]
  ------------------
  120|  3.24M|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  3.24M|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (120:5): [True: 2.43M, False: 12.1M]
  ------------------
  121|  3.24M|      min_bits = INVALID_BITCOUNT_LD;
  ------------------
  |  |   23|  3.24M|#define INVALID_BITCOUNT_LD (SHRT_MAX / 4)
  ------------------
  122|  3.24M|      break;
  123|  14.5M|  }
  124|       |
  125|   102M|  for (j = 0; j <= CODE_BCK_ESC_NDX; j += 2) {
  ------------------
  |  Branch (125:15): [True: 87.5M, False: 14.5M]
  ------------------
  126|  87.5M|    temp1 = *ptr_bit_cnt++;
  127|  87.5M|    temp2 = *ptr_bit_cnt++;
  128|  87.5M|    if (temp1 < min_bits) {
  ------------------
  |  Branch (128:9): [True: 12.4M, False: 75.0M]
  ------------------
  129|  12.4M|      min_bits = temp1;
  130|  12.4M|      temp_book = j;
  131|  12.4M|    }
  132|  87.5M|    if (temp2 < min_bits) {
  ------------------
  |  Branch (132:9): [True: 8.03M, False: 79.4M]
  ------------------
  133|  8.03M|      min_bits = temp2;
  134|  8.03M|      temp_book = j + 1;
  135|  8.03M|    }
  136|  87.5M|  }
  137|       |
  138|  14.5M|  *ptr_codebook = temp_book;
  139|  14.5M|  return min_bits;
  140|  14.5M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_scf_count:
  427|   464k|                                                ixheaace_huffman_tables *pstr_huffman_tbl) {
  428|   464k|  WORD32 sect_idx1 = 0;
  429|   464k|  WORD32 sfb_idx1 = 0;
  430|   464k|  WORD32 scf_idx = 0;
  431|   464k|  WORD32 sect_idx2 = 0;
  432|   464k|  WORD32 sfb_idx2 = 0;
  433|       |
  434|   464k|  WORD32 last_val_scf = 0;
  435|   464k|  WORD32 delta_scf = 0;
  436|   464k|  WORD32 found = 0;
  437|   464k|  WORD32 scf_skip_counter = 0;
  438|       |
  439|   464k|  pstr_section_data->scale_fac_bits = 0;
  440|       |
  441|   464k|  if (ptr_scale_fac == 0) {
  ------------------
  |  Branch (441:7): [True: 0, False: 464k]
  ------------------
  442|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_SCALE_FACTOR_GAIN;
  443|      0|  }
  444|   464k|  last_val_scf = 0;
  445|   464k|  pstr_section_data->first_scf = 0;
  446|       |
  447|   627k|  for (sect_idx1 = 0; sect_idx1 < pstr_section_data->num_of_sections; sect_idx1++) {
  ------------------
  |  Branch (447:23): [True: 460k, False: 167k]
  ------------------
  448|   460k|    if (pstr_section_data->section[sect_idx1].code_book != CODE_BCK_ZERO_NO) {
  ------------------
  |  Branch (448:9): [True: 297k, False: 163k]
  ------------------
  449|   297k|      pstr_section_data->first_scf = pstr_section_data->section[sect_idx1].sfb_start;
  450|       |
  451|   297k|      last_val_scf = ptr_scale_fac[pstr_section_data->first_scf];
  452|   297k|      break;
  453|   297k|    }
  454|   460k|  }
  455|       |
  456|  2.17M|  for (sect_idx1 = 0; sect_idx1 < pstr_section_data->num_of_sections; sect_idx1++) {
  ------------------
  |  Branch (456:23): [True: 1.70M, False: 464k]
  ------------------
  457|  1.70M|    if ((pstr_section_data->section[sect_idx1].code_book != CODE_BCK_ZERO_NO) &&
  ------------------
  |  Branch (457:9): [True: 1.19M, False: 514k]
  ------------------
  458|  1.19M|        (pstr_section_data->section[sect_idx1].code_book != CODE_BCK_PNS_NO)) {
  ------------------
  |  Branch (458:9): [True: 1.19M, False: 0]
  ------------------
  459|  1.19M|      for (sfb_idx1 = pstr_section_data->section[sect_idx1].sfb_start;
  460|  8.21M|           sfb_idx1 < pstr_section_data->section[sect_idx1].sfb_start +
  ------------------
  |  Branch (460:12): [True: 7.02M, False: 1.19M]
  ------------------
  461|  8.21M|                          pstr_section_data->section[sect_idx1].sfb_cnt;
  462|  7.02M|           sfb_idx1++) {
  463|  7.02M|        if (ptr_max_val_in_sfb[sfb_idx1] == 0) {
  ------------------
  |  Branch (463:13): [True: 432k, False: 6.59M]
  ------------------
  464|   432k|          found = 0;
  465|       |
  466|   432k|          if (scf_skip_counter == 0) {
  ------------------
  |  Branch (466:15): [True: 305k, False: 126k]
  ------------------
  467|   305k|            if (sfb_idx1 == (pstr_section_data->section[sect_idx1].sfb_start +
  ------------------
  |  Branch (467:17): [True: 35.4k, False: 270k]
  ------------------
  468|   305k|                             pstr_section_data->section[sect_idx1].sfb_cnt - 1)) {
  469|  35.4k|              found = 0;
  470|   270k|            } else {
  471|   270k|              for (scf_idx = (sfb_idx1 + 1);
  472|   409k|                   scf_idx < pstr_section_data->section[sect_idx1].sfb_start +
  ------------------
  |  Branch (472:20): [True: 399k, False: 10.0k]
  ------------------
  473|   409k|                                 pstr_section_data->section[sect_idx1].sfb_cnt;
  474|   399k|                   scf_idx++) {
  475|   399k|                if (ptr_max_val_in_sfb[scf_idx] != 0) {
  ------------------
  |  Branch (475:21): [True: 260k, False: 138k]
  ------------------
  476|   260k|                  found = 1;
  477|       |
  478|   260k|                  if ((abs32(ptr_scale_fac[scf_idx] - last_val_scf)) < CODE_BCK_SCF_LAV) {
  ------------------
  |  |   25|   260k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 135k, False: 124k]
  |  |  ------------------
  ------------------
  |  Branch (478:23): [True: 257k, False: 2.56k]
  ------------------
  479|   257k|                    delta_scf = 0;
  480|   257k|                  } else {
  481|  2.56k|                    delta_scf = -(ptr_scale_fac[sfb_idx1] - last_val_scf);
  482|       |
  483|  2.56k|                    last_val_scf = ptr_scale_fac[sfb_idx1];
  484|  2.56k|                    scf_skip_counter = 0;
  485|  2.56k|                  }
  486|   260k|                  break;
  487|   260k|                }
  488|       |                /* count scalefactor skip */
  489|   138k|                scf_skip_counter = scf_skip_counter + 1;
  490|   138k|              }
  491|   270k|            }
  492|       |
  493|       |            /* search for the next ptr_max_val_in_sfb[] != 0 in all other sections */
  494|   305k|            for (sect_idx2 = (sect_idx1 + 1);
  495|   325k|                 (sect_idx2 < pstr_section_data->num_of_sections) && (found == 0); sect_idx2++) {
  ------------------
  |  Branch (495:18): [True: 232k, False: 93.2k]
  |  Branch (495:70): [True: 19.5k, False: 212k]
  ------------------
  496|  19.5k|              if ((pstr_section_data->section[sect_idx2].code_book != CODE_BCK_ZERO_NO) &&
  ------------------
  |  Branch (496:19): [True: 17.8k, False: 1.73k]
  ------------------
  497|  17.8k|                  (pstr_section_data->section[sect_idx2].code_book != CODE_BCK_PNS_NO)) {
  ------------------
  |  Branch (497:19): [True: 17.8k, False: 0]
  ------------------
  498|  17.8k|                for (sfb_idx2 = pstr_section_data->section[sect_idx2].sfb_start;
  499|  18.7k|                     sfb_idx2 < pstr_section_data->section[sect_idx2].sfb_start +
  ------------------
  |  Branch (499:22): [True: 18.7k, False: 0]
  ------------------
  500|  18.7k|                                    pstr_section_data->section[sect_idx2].sfb_cnt;
  501|  18.7k|                     sfb_idx2++) {
  502|  18.7k|                  if (ptr_max_val_in_sfb[sfb_idx2] != 0) {
  ------------------
  |  Branch (502:23): [True: 17.8k, False: 900]
  ------------------
  503|  17.8k|                    found = 1;
  504|       |
  505|  17.8k|                    if ((abs32(ptr_scale_fac[sfb_idx2] - last_val_scf)) < CODE_BCK_SCF_LAV) {
  ------------------
  |  |   25|  17.8k|#define abs32(a) (a > 0 ? a : -a)
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 5.23k, False: 12.5k]
  |  |  ------------------
  ------------------
  |  Branch (505:25): [True: 17.4k, False: 361]
  ------------------
  506|  17.4k|                      delta_scf = 0;
  507|  17.4k|                    } 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|  17.8k|                    break;
  514|  17.8k|                  }
  515|       |
  516|    900|                  scf_skip_counter = scf_skip_counter + 1;
  517|    900|                }
  518|  17.8k|              }
  519|  19.5k|            }
  520|       |
  521|   305k|            if (found == 0) {
  ------------------
  |  Branch (521:17): [True: 27.7k, False: 278k]
  ------------------
  522|  27.7k|              delta_scf = 0;
  523|  27.7k|              scf_skip_counter = 0;
  524|  27.7k|            }
  525|   305k|          } else {
  526|   126k|            delta_scf = 0;
  527|       |
  528|   126k|            scf_skip_counter = scf_skip_counter - 1;
  529|   126k|          }
  530|  6.59M|        } else {
  531|  6.59M|          delta_scf = -(ptr_scale_fac[sfb_idx1] - last_val_scf);
  532|       |
  533|  6.59M|          last_val_scf = ptr_scale_fac[sfb_idx1];
  534|  6.59M|        }
  535|       |
  536|  7.02M|        pstr_section_data->scale_fac_bits +=
  537|  7.02M|            ia_enhaacplus_enc_bit_count_scalefactor_delta(delta_scf, pstr_huffman_tbl);
  538|  7.02M|      }
  539|  1.19M|    }
  540|  1.70M|  }
  541|   464k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   464k|#define IA_NO_ERROR 0x00000000
  ------------------
  542|   464k|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_bit_count_scalefactor_delta:
  420|  7.02M|    WORD32 delta, ixheaace_huffman_tables *pstr_huffman_tbl) {
  421|  7.02M|  return pstr_huffman_tbl->huff_ltabscf[delta + CODE_BCK_SCF_LAV];
  422|  7.02M|}
ixheaace_dynamic_bits.c:ia_enhaacplus_enc_calc_side_info_bits:
   52|   329k|static WORD32 ia_enhaacplus_enc_calc_side_info_bits(WORD32 sfb_cnt, WORD32 block_type) {
   53|   329k|  WORD32 seg_len_bits = (block_type == SHORT_WINDOW ? 3 : 5);
  ------------------
  |  Branch (53:26): [True: 77.5k, False: 252k]
  ------------------
   54|   329k|  WORD32 escape_val = (block_type == SHORT_WINDOW ? 7 : 31);
  ------------------
  |  Branch (54:24): [True: 77.5k, False: 252k]
  ------------------
   55|   329k|  WORD32 side_info_bits, tmp;
   56|       |
   57|   329k|  side_info_bits = CODE_BCK_BITS;
  ------------------
  |  |   25|   329k|#define CODE_BCK_BITS 4
  ------------------
   58|   329k|  tmp = sfb_cnt;
   59|       |
   60|   814k|  while (tmp >= 0) {
  ------------------
  |  Branch (60:10): [True: 484k, False: 329k]
  ------------------
   61|   484k|    side_info_bits += seg_len_bits;
   62|   484k|    tmp -= escape_val;
   63|   484k|  }
   64|       |
   65|   329k|  return (side_info_bits);
   66|   329k|}

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

ia_enhaacplus_enc_aac_core_encode:
   69|   300k|    WORD32 *is_quant_spec_zero, WORD32 *is_gain_limited) {
   70|   300k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
   71|   300k|  iexheaac_encoder_str *pstr_aac_encoder = pstr_aac_enc[ele_idx];
   72|   300k|  ixheaace_element_info *pstr_element_info = &pstr_aac_encoder->element_info;
   73|   300k|  WORD32 glob_used_bits;
   74|   300k|  WORD32 anc_data_bytes, anc_data_bytes_left;
   75|   300k|  WORD32 stat_bits_flag = 0;
   76|   300k|  WORD32 frame_len_long = FRAME_LEN_1024;
  ------------------
  |  |   91|   300k|#define FRAME_LEN_1024 1024
  ------------------
   77|   300k|  WORD32 ch;
   78|       |
   79|   300k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   601k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   540k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   122k|#define AOT_PS (29)
  ------------------
  |  Branch (79:7): [True: 60.8k, False: 239k]
  |  Branch (79:28): [True: 117k, False: 122k]
  |  Branch (79:46): [True: 19.4k, False: 103k]
  ------------------
   80|   197k|    frame_len_long =
   81|   197k|        (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|   316k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (81:9): [True: 79.0k, False: 118k]
  ------------------
   82|   197k|  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   206k|#define AOT_AAC_LD (23)
  ------------------
                } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  77.7k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (82:14): [True: 25.3k, False: 77.7k]
  |  Branch (82:35): [True: 77.7k, False: 0]
  ------------------
   83|   103k|    frame_len_long =
   84|   103k|        (pstr_aac_encoder->config.flag_framelength_small == 1) ? FRAME_LEN_480 : FRAME_LEN_512;
  ------------------
  |  |   93|  44.9k|#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: 44.9k, False: 58.0k]
  ------------------
   85|   103k|  }
   86|       |
   87|   300k|  if (ele_idx == 0) {
  ------------------
  |  Branch (87:7): [True: 153k, False: 147k]
  ------------------
   88|   153k|    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   306k|#define AOT_AAC_LC (2)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   281k|#define AOT_SBR (5)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  80.5k|#define AOT_PS (29)
  ------------------
  |  Branch (88:9): [True: 25.0k, False: 128k]
  |  Branch (88:30): [True: 47.8k, False: 80.5k]
  |  Branch (88:48): [True: 19.4k, False: 61.0k]
  ------------------
   89|  92.2k|      ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
   90|  92.2k|          ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
   91|  92.2k|          (((pstr_aac_encoder->config.flag_framelength_small == 1) ? MAXIMUM_CHANNEL_BITS_960
  ------------------
  |  |   95|  38.7k|#define MAXIMUM_CHANNEL_BITS_960 5760
  ------------------
  |  Branch (91:13): [True: 38.7k, False: 53.5k]
  ------------------
   92|  92.2k|                                                                   : MAXIMUM_CHANNEL_BITS_1024) /
  ------------------
  |  |   94|  53.5k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
   93|  92.2k|           8) *
   94|  92.2k|              total_channels);
   95|  92.2k|    } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   122k|#define AOT_AAC_LD (23)
  ------------------
                  } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  50.2k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (95:16): [True: 10.8k, False: 50.2k]
  |  Branch (95:37): [True: 50.2k, False: 0]
  ------------------
   96|  61.0k|      if (pstr_aac_encoder->config.bitreservoir_size != -1) {
  ------------------
  |  Branch (96:11): [True: 58.3k, False: 2.72k]
  ------------------
   97|  58.3k|        WORD32 avg_byte_perframe = (pstr_aac_encoder->config.bit_rate * frame_len_long /
   98|  58.3k|                                    (pstr_aac_encoder->config.core_sample_rate * 8));
   99|       |
  100|  58.3k|        if ((pstr_aac_encoder->config.bitreservoir_size * total_channels) > avg_byte_perframe) {
  ------------------
  |  Branch (100:13): [True: 45.7k, False: 12.6k]
  ------------------
  101|  45.7k|          ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
  102|  45.7k|              ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
  103|  45.7k|              pstr_aac_encoder->config.bitreservoir_size * total_channels);
  104|  45.7k|        } else {
  105|  12.6k|          ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
  106|  12.6k|              ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
  107|  12.6k|              (pstr_aac_encoder->config.bit_rate * frame_len_long /
  108|  12.6k|               (pstr_aac_encoder->config.core_sample_rate * 8)));
  109|  12.6k|        }
  110|  58.3k|      } else {
  111|  2.72k|        ptr_bit_stream_handle = ia_enhaacplus_enc_create_bitbuffer(
  112|  2.72k|            ptr_bit_stream, (UWORD8 *)ptr_out_bytes,
  113|  2.72k|            (pstr_aac_encoder->config.bit_rate * frame_len_long /
  114|  2.72k|             (pstr_aac_encoder->config.core_sample_rate * 8)));
  115|  2.72k|      }
  116|  61.0k|    }
  117|   153k|  } else {
  118|   147k|    ptr_bit_stream_handle = ptr_bit_stream;
  119|   147k|  }
  120|       |
  121|   300k|  if (adts_flag) {
  ------------------
  |  Branch (121:7): [True: 82.3k, False: 218k]
  ------------------
  122|  82.3k|    stat_bits_flag = 0; /* fix for low bit-rate */
  123|  82.3k|    if ((pstr_aac_encoder->config.core_sample_rate * 3) <= (pstr_aac_encoder->config.bit_rate)) {
  ------------------
  |  Branch (123:9): [True: 28.6k, False: 53.7k]
  ------------------
  124|  28.6k|      stat_bits_flag = 7; /* fix for low bit-rate */
  125|  28.6k|    }
  126|  82.3k|  }
  127|       |
  128|   300k|  anc_data_bytes = anc_data_bytes_left = *num_anc_bytes;
  129|       |
  130|   300k|  if (pstr_element_info->el_type == ID_CPE) {
  ------------------
  |  Branch (130:7): [True: 137k, False: 162k]
  ------------------
  131|   137k|    if (!pstr_aac_encoder->config.num_stereo_preprocessing) {
  ------------------
  |  Branch (131:9): [True: 137k, False: 0]
  ------------------
  132|   137k|      iaace_apply_stereo_preproc(&pstr_aac_encoder->str_stereo_pre_pro, time_sn_stride,
  133|   137k|                                 pstr_element_info, ptr_time_signal, frame_len_long);
  134|   137k|    }
  135|   137k|  }
  136|       |
  137|   300k|  err_code = ia_enhaacplus_enc_psy_main(
  138|   300k|      time_sn_stride, pstr_element_info, ptr_time_signal, aot,
  139|   300k|      pstr_aac_encoder->psy_kernel.psy_data,
  140|   300k|      pstr_aac_encoder->psy_kernel.temporal_noise_shaping_data,
  141|   300k|      &pstr_aac_encoder->psy_kernel.psy_conf_long, &pstr_aac_encoder->psy_kernel.psy_conf_short,
  142|   300k|      pstr_aac_encoder->psy_out.psy_out_ch,
  143|   300k|      &pstr_aac_encoder->psy_out.psy_out_element,
  144|   300k|      pstr_aac_encoder->psy_kernel.p_scratch_tns_float,
  145|   300k|      (FLOAT32 *)pstr_aac_encoder->pstr_aac_scratch->shared_buffer1,
  146|   300k|      pstr_aac_encoder->pstr_aac_scratch->shared_buffer5, pstr_aac_tabs, frame_len_long);
  147|       |
  148|   300k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (148:7): [True: 0, False: 300k]
  ------------------
  149|      0|    return err_code;
  150|      0|  }
  151|       |
  152|   300k|  ia_enhaacplus_enc_adjust_bitrate(
  153|   300k|      &pstr_aac_encoder->qc_kernel, pstr_aac_encoder->config.bit_rate,
  154|   300k|      pstr_aac_encoder->config.core_sample_rate, flag_last_element, frame_len_long);
  155|       |
  156|   739k|  for (ch = 0; ch < pstr_element_info->n_channels_in_el; ch++) {
  ------------------
  |  Branch (156:16): [True: 438k, False: 300k]
  ------------------
  157|   438k|    pstr_aac_encoder->psy_out.psy_out_ch[ch]->ms_digest =
  158|   438k|        pstr_aac_encoder->psy_out.psy_out_element.tools_info.ms_digest;
  159|       |
  160|   438k|    memcpy(
  161|   438k|        &pstr_aac_encoder->psy_out.psy_out_ch[ch]->ms_used[0],
  162|   438k|        &pstr_aac_encoder->psy_out.psy_out_element.tools_info.ms_mask[0],
  163|   438k|        MAXIMUM_GROUPED_SCALE_FACTOR_BAND *
  ------------------
  |  |   73|   438k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|   438k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|   438k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|   438k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 438k, Folded]
  |  |  ------------------
  |  |   74|   438k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|   438k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|   438k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|   438k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  164|   438k|            sizeof(pstr_aac_encoder->psy_out.psy_out_ch[ch]->ms_used[0]));
  165|   438k|  }
  166|       |
  167|   300k|  err_code = ia_enhaacplus_enc_qc_main(
  168|   300k|      &pstr_aac_encoder->qc_kernel, pstr_element_info->n_channels_in_el,
  169|   300k|      &pstr_aac_encoder->qc_kernel.element_bits,
  170|   300k|      pstr_aac_encoder->psy_out.psy_out_ch,
  171|   300k|      &pstr_aac_encoder->psy_out.psy_out_element,
  172|   300k|      pstr_aac_encoder->qc_out.qc_channel,
  173|   300k|      &pstr_aac_encoder->qc_out.qc_element, MIN(anc_data_bytes_left, anc_data_bytes),
  ------------------
  |  |   23|   300k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 0, False: 300k]
  |  |  ------------------
  ------------------
  174|   300k|      pstr_aac_tabs, adts_flag, aot, stat_bits_flag, flag_last_element, frame_len_long,
  175|   300k|      pstr_aac_encoder->pstr_aac_scratch->shared_buffer5, is_quant_spec_zero,
  176|   300k|      is_gain_limited);
  177|       |
  178|   300k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (178:7): [True: 278, False: 300k]
  ------------------
  179|    278|    return err_code;
  180|    278|  }
  181|       |
  182|   300k|  if (pstr_element_info->el_type == ID_CPE) {
  ------------------
  |  Branch (182:7): [True: 137k, False: 162k]
  ------------------
  183|   137k|    if (!pstr_aac_encoder->config.num_stereo_preprocessing) {
  ------------------
  |  Branch (183:9): [True: 137k, False: 0]
  ------------------
  184|   137k|      iaace_update_stereo_pre_process(
  185|   137k|          pstr_aac_encoder->psy_out.psy_out_ch,
  186|   137k|          &pstr_aac_encoder->qc_out.qc_element, &pstr_aac_encoder->str_stereo_pre_pro,
  187|   137k|          pstr_aac_encoder->psy_out.psy_out_element.weight_ms_lr_pe_ratio);
  188|   137k|    }
  189|   137k|  }
  190|       |
  191|       |  /* Update bit reservoir levels */
  192|   300k|  ia_enhaacplus_enc_update_bit_reservoir(&pstr_aac_encoder->qc_kernel, &pstr_aac_encoder->qc_out);
  193|       |
  194|   300k|  err_code = ia_enhaacplus_enc_finalize_bit_consumption(
  195|   300k|      &pstr_aac_encoder->qc_kernel, &pstr_aac_encoder->qc_out, flag_last_element,
  196|   300k|      ((ixheaace_bit_buf_handle)ptr_bit_stream_handle)->cnt_bits, total_fill_bits, pstr_aac_enc,
  197|   300k|      num_bs_elements, aot);
  198|       |
  199|   300k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (199:7): [True: 0, False: 300k]
  ------------------
  200|      0|    return err_code;
  201|      0|  }
  202|       |
  203|   300k|  err_code = ia_enhaacplus_enc_write_bitstream(
  204|   300k|      ptr_bit_stream_handle, *pstr_element_info, &pstr_aac_encoder->qc_out,
  205|   300k|      &pstr_aac_encoder->psy_out, &glob_used_bits, ptr_anc_bytes, pstr_aac_tabs,
  206|   300k|      flag_last_element, write_program_config_element, i_num_coup_channels, i_channels_mask,
  207|   300k|      pstr_aac_encoder->config.core_sample_rate, ele_idx, aot, total_fill_bits);
  208|   300k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (208:7): [True: 664, False: 299k]
  ------------------
  209|    664|    return err_code;
  210|    664|  }
  211|       |  /* write out the bitstream */
  212|   299k|  *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|   299k|  if (pstr_aac_encoder->config.bitreservoir_size != -1) {
  ------------------
  |  Branch (215:7): [True: 248k, False: 50.8k]
  ------------------
  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: 213k, False: 35.6k]
  ------------------
  220|   213k|      if (*num_out_bytes > (pstr_aac_encoder->config.bitreservoir_size * total_channels)) {
  ------------------
  |  Branch (220:11): [True: 4.55k, False: 208k]
  ------------------
  221|  4.55k|        err_code = IA_EXHEAACE_EXE_FATAL_INVALID_OUT_BYTES;
  222|  4.55k|      }
  223|   213k|    } else {
  224|  35.6k|      if (*num_out_bytes > avg_bytes_perframe) {
  ------------------
  |  Branch (224:11): [True: 7.29k, False: 28.3k]
  ------------------
  225|  7.29k|        err_code = IA_EXHEAACE_EXE_FATAL_INVALID_OUT_BYTES;
  226|  7.29k|      }
  227|  35.6k|    }
  228|   248k|  } else {
  229|  50.8k|    WORD32 avg_bytes_perframe = (pstr_aac_encoder->config.bit_rate * frame_len_long /
  230|  50.8k|                                 (pstr_aac_encoder->config.core_sample_rate * 8));
  231|  50.8k|    if (*num_out_bytes > avg_bytes_perframe) {
  ------------------
  |  Branch (231:9): [True: 22.7k, False: 28.1k]
  ------------------
  232|  22.7k|      err_code = IA_EXHEAACE_EXE_FATAL_INVALID_OUT_BYTES;
  233|  22.7k|    }
  234|  50.8k|  }
  235|       |
  236|   299k|  return err_code;
  237|   300k|}

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

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

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

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

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

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

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

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

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

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

ixheaace_loudness_info_get_handle_size:
  135|  5.21k|WORD32 ixheaace_loudness_info_get_handle_size() {
  136|  5.21k|  return IXHEAAC_GET_SIZE_ALIGNED(sizeof(ixheaace_loudness_struct), BYTE_ALIGN_8);
  ------------------
  |  |   87|  5.21k|#define IXHEAAC_GET_SIZE_ALIGNED(size, alignment) ((size + (alignment - 1)) & ~(alignment - 1))
  ------------------
  137|  5.21k|}
ixheaace_loudness_init_params:
  140|  5.21k|                                           ixheaace_output_config *pstr_output_config) {
  141|  5.21k|  UWORD32 count = 0;
  142|  5.21k|  UWORD8 temp_count = 0;
  143|  5.21k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  5.21k|#define IA_NO_ERROR 0x00000000
  ------------------
  144|  5.21k|  ixheaace_loudness_struct *pstr_loudness_hdl = (ixheaace_loudness_struct *)loudness_handle;
  145|  5.21k|  memset(pstr_loudness_hdl, 0, sizeof(ixheaace_loudness_struct));
  146|  5.21k|  pstr_loudness_hdl->sample_rate =
  147|  5.21k|      ixheaace_map_sample_rate(pstr_input_config->i_samp_freq, pstr_loudness_hdl);
  148|       |
  149|  5.21k|  pstr_output_config->samp_freq = pstr_loudness_hdl->sample_rate;
  150|  5.21k|  pstr_loudness_hdl->length = pstr_input_config->aac_config.length;
  151|  5.21k|  pstr_loudness_hdl->pcm_sz = pstr_input_config->ui_pcm_wd_sz;
  152|  5.21k|  if (pstr_loudness_hdl->pcm_sz != 16) {
  ------------------
  |  Branch (152:7): [True: 948, False: 4.27k]
  ------------------
  153|    948|    return (IA_EXHEAACE_CONFIG_FATAL_PCM_WDSZ);
  154|    948|  }
  155|  4.27k|  pstr_loudness_hdl->n_channels = pstr_input_config->i_channels;
  156|  4.27k|  if (pstr_loudness_hdl->n_channels > 2 || pstr_loudness_hdl->n_channels < 1) {
  ------------------
  |  Branch (156:7): [True: 68, False: 4.20k]
  |  Branch (156:44): [True: 1, False: 4.20k]
  ------------------
  157|     69|    return (IA_EXHEAACE_CONFIG_FATAL_NUM_CHANNELS);
  158|     69|  }
  159|  4.20k|  pstr_loudness_hdl->num_samples_per_ch = (pstr_loudness_hdl->sample_rate / 10);
  160|  4.20k|  pstr_loudness_hdl->sum_square = 0;
  161|  4.20k|  pstr_loudness_hdl->mom_loudness_first_time_flag = 1;
  162|       |
  163|  4.20k|  pstr_loudness_hdl->count_fn_call_mmstl = 0;
  164|  4.20k|  pstr_loudness_hdl->sl_first_time_flag = 1;
  165|  4.20k|  pstr_loudness_hdl->local_sl_count = 0;
  166|  4.20k|  pstr_loudness_hdl->short_term_loudness_overlap = IXHEAACE_SL_OVERLAP;
  ------------------
  |  |   29|  4.20k|#define IXHEAACE_SL_OVERLAP (20)
  ------------------
  167|       |
  168|  4.20k|  pstr_loudness_hdl->no_of_mf = IXHEAACE_SEC_TO_100MS_FACTOR;
  ------------------
  |  |   34|  4.20k|#define IXHEAACE_SEC_TO_100MS_FACTOR (60 * 10)
  ------------------
  169|  4.20k|  pstr_loudness_hdl->no_of_mf -= IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP;
  ------------------
  |  |   28|  4.20k|#define IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP (3)
  ------------------
  170|  4.20k|  pstr_loudness_hdl->no_of_stf =
  171|  4.20k|      (((pstr_loudness_hdl->no_of_mf + IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP) - 30) /
  ------------------
  |  |   28|  4.20k|#define IXHEAACE_MOMENTARY_LOUDNESS_OVERLAP (3)
  ------------------
  172|  4.20k|       (30 - pstr_loudness_hdl->short_term_loudness_overlap)) +
  173|  4.20k|      1;
  174|       |
  175|  4.20k|  pstr_loudness_hdl->tot_int_val_stf_passing_abs_gate = 0;
  176|  4.20k|  pstr_loudness_hdl->curr_stf_no = 0;
  177|  4.20k|  pstr_loudness_hdl->loop_curr_stf_no = 0;
  178|  4.20k|  pstr_loudness_hdl->no_of_stf_passing_abs_gate = 0;
  179|  4.20k|  pstr_loudness_hdl->max_lra_count = pstr_loudness_hdl->no_of_stf;
  180|  4.20k|  pstr_loudness_hdl->loop_ml_count_fn_call = 0;
  181|  4.20k|  pstr_loudness_hdl->ml_count_fn_call = 0;
  182|  4.20k|  pstr_loudness_hdl->max_il_buf_size = pstr_loudness_hdl->no_of_mf;
  183|  4.20k|  pstr_loudness_hdl->get_intergrated_loudness = 1;
  184|  4.20k|  pstr_loudness_hdl->max_sample_val = FLT_EPSILON;
  185|       |
  186|  11.2k|  for (count = 0; count < pstr_loudness_hdl->n_channels; count++) {
  ------------------
  |  Branch (186:19): [True: 7.08k, False: 4.20k]
  ------------------
  187|  28.3k|    for (temp_count = 0; temp_count < IXHEAACE_LOUDNESS_NUM_TAPS; temp_count++) {
  ------------------
  |  |   23|  28.3k|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (187:26): [True: 21.2k, False: 7.08k]
  ------------------
  188|  21.2k|      pstr_loudness_hdl->w[0][count][temp_count] = 0;
  189|  21.2k|      pstr_loudness_hdl->w[1][count][temp_count] = 0;
  190|  21.2k|    }
  191|  7.08k|  }
  192|       |
  193|  21.0k|  for (count = 0; count < 4; count++) {
  ------------------
  |  Branch (193:19): [True: 16.8k, False: 4.20k]
  ------------------
  194|  16.8k|    pstr_loudness_hdl->prev_four_sum_square[count] = 0;
  195|  16.8k|  }
  196|       |
  197|   130k|  for (count = 0; count < 30; count++) {
  ------------------
  |  Branch (197:19): [True: 126k, False: 4.20k]
  ------------------
  198|   126k|    pstr_loudness_hdl->prev_thirty_sum_square[count] = 0;
  199|   126k|  }
  200|       |
  201|  4.20k|  count = 0;
  202|   247k|  while (count < (pstr_loudness_hdl->no_of_stf)) {
  ------------------
  |  Branch (202:10): [True: 243k, False: 4.20k]
  ------------------
  203|   243k|    pstr_loudness_hdl->temp_stf_instances_loudness[count] = 0;
  204|   243k|    count++;
  205|   243k|  }
  206|       |
  207|  4.20k|  count = 0;
  208|   247k|  while (count < (pstr_loudness_hdl->no_of_stf)) {
  ------------------
  |  Branch (208:10): [True: 243k, False: 4.20k]
  ------------------
  209|   243k|    pstr_loudness_hdl->stf_instances[count].short_term_loudness =
  210|   243k|        IXHEAACE_DEFAULT_SHORT_TERM_LOUDENSS;
  ------------------
  |  |   32|   243k|#define IXHEAACE_DEFAULT_SHORT_TERM_LOUDENSS (-1000)
  ------------------
  211|   243k|    pstr_loudness_hdl->stf_instances[count].int_val = 0;
  212|   243k|    pstr_loudness_hdl->stf_instances[count].passes_abs_gate = FALSE;
  ------------------
  |  |   26|   243k|#define FALSE (0)
  ------------------
  213|   243k|    count++;
  214|   243k|  }
  215|       |
  216|  4.20k|  count = 0;
  217|  2.51M|  while (count < pstr_loudness_hdl->no_of_mf) {
  ------------------
  |  Branch (217:10): [True: 2.50M, False: 4.20k]
  ------------------
  218|  2.50M|    pstr_loudness_hdl->mf_instances[count].momentary_loudness =
  219|  2.50M|        IXHEAACE_DEFAULT_MOMENTARY_LOUDENSS;
  ------------------
  |  |   33|  2.50M|#define IXHEAACE_DEFAULT_MOMENTARY_LOUDENSS (-1000)
  ------------------
  220|  2.50M|    pstr_loudness_hdl->mf_instances[count].int_val = 0.0;
  221|  2.50M|    pstr_loudness_hdl->mf_instances[count].passes_abs_gate = FALSE;
  ------------------
  |  |   26|  2.50M|#define FALSE (0)
  ------------------
  222|  2.50M|    count++;
  223|  2.50M|  }
  224|  4.20k|  return err_code;
  225|  4.27k|}
ixheaace_measure_integrated_loudness:
  349|     19|FLOAT64 ixheaace_measure_integrated_loudness(pVOID loudness_handle) {
  350|     19|  UWORD32 count = 0;
  351|     19|  FLOAT64 avg = 0;
  352|     19|  FLOAT64 loudness = 0;
  353|     19|  ixheaace_loudness_struct *pstr_loudness_hdl = (ixheaace_loudness_struct *)loudness_handle;
  354|     19|  pstr_loudness_hdl->no_of_mf_passing_rel_gate = 0;
  355|     19|  pstr_loudness_hdl->tot_int_val_mf_passing_rel_gate = 0;
  356|       |
  357|     19|  if (pstr_loudness_hdl->no_of_mf_passing_abs_gate) {
  ------------------
  |  Branch (357:7): [True: 12, False: 7]
  ------------------
  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|      7|    avg = IXHEAACE_SUM_SQUARE_EPS / pstr_loudness_hdl->num_samples_per_ch;
  ------------------
  |  |   35|      7|#define IXHEAACE_SUM_SQUARE_EPS (1/32768.0f * 1/32768.0f)
  ------------------
  362|      7|  }
  363|     19|  pstr_loudness_hdl->rel_gate = -0.691 + 10 * log10(avg) - 10;
  364|       |
  365|    735|  while (count < pstr_loudness_hdl->ml_count_fn_call) {
  ------------------
  |  Branch (365:10): [True: 716, False: 19]
  ------------------
  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|     19|  if (pstr_loudness_hdl->no_of_mf_passing_rel_gate) {
  ------------------
  |  Branch (375:7): [True: 14, False: 5]
  ------------------
  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|      5|    loudness =
  380|      5|        -0.691 + 10 * log10(IXHEAACE_SUM_SQUARE_EPS / pstr_loudness_hdl->num_samples_per_ch);
  ------------------
  |  |   35|      5|#define IXHEAACE_SUM_SQUARE_EPS (1/32768.0f * 1/32768.0f)
  ------------------
  381|      5|  }
  382|       |
  383|     19|  return loudness;
  384|     19|}
ixheaace_measure_loudness:
  386|  42.1k|FLOAT64 ixheaace_measure_loudness(pVOID loudness_handle, WORD16 **samples) {
  387|  42.1k|  FLOAT64 loudness_value;
  388|  42.1k|  ixheaace_loudness_struct *pstr_loudness_hdl = (ixheaace_loudness_struct *)loudness_handle;
  389|  42.1k|  ixheaace_measure_sum_square(samples, pstr_loudness_hdl);
  390|  42.1k|  loudness_value = ixheaace_measure_momentary_loudness(pstr_loudness_hdl);
  391|  42.1k|  pstr_loudness_hdl->count_fn_call_mmstl++;
  392|  42.1k|  return loudness_value;
  393|  42.1k|}
ixheaace_loudness_measurement.c:ixheaace_map_sample_rate:
   89|  5.21k|                                       ixheaace_loudness_struct *pstr_loudness_hdl) {
   90|  5.21k|  WORD32 mapped_sample_rate = sample_rate;
   91|       |
   92|  5.21k|  if ((mapped_sample_rate >= 0) && (mapped_sample_rate < 9391)) {
  ------------------
  |  Branch (92:7): [True: 5.11k, False: 106]
  |  Branch (92:36): [True: 405, False: 4.70k]
  ------------------
   93|    405|    mapped_sample_rate = 8000;
   94|    405|    pstr_loudness_hdl->sample_rate_idx = 11;
   95|  4.81k|  } else if ((mapped_sample_rate >= 9391) && (mapped_sample_rate < 11502)) {
  ------------------
  |  Branch (95:14): [True: 4.70k, False: 106]
  |  Branch (95:46): [True: 148, False: 4.56k]
  ------------------
   96|    148|    mapped_sample_rate = 11025;
   97|    148|    pstr_loudness_hdl->sample_rate_idx = 10;
   98|  4.66k|  } else if ((mapped_sample_rate >= 11502) && (mapped_sample_rate < 13856)) {
  ------------------
  |  Branch (98:14): [True: 4.56k, False: 106]
  |  Branch (98:47): [True: 185, False: 4.37k]
  ------------------
   99|    185|    mapped_sample_rate = 12000;
  100|    185|    pstr_loudness_hdl->sample_rate_idx = 9;
  101|  4.48k|  } else if ((mapped_sample_rate >= 13856) && (mapped_sample_rate < 18783)) {
  ------------------
  |  Branch (101:14): [True: 4.37k, False: 106]
  |  Branch (101:47): [True: 251, False: 4.12k]
  ------------------
  102|    251|    mapped_sample_rate = 16000;
  103|    251|    pstr_loudness_hdl->sample_rate_idx = 8;
  104|  4.23k|  } else if ((mapped_sample_rate >= 18783) && (mapped_sample_rate < 23004)) {
  ------------------
  |  Branch (104:14): [True: 4.12k, False: 106]
  |  Branch (104:47): [True: 136, False: 3.98k]
  ------------------
  105|    136|    mapped_sample_rate = 22050;
  106|    136|    pstr_loudness_hdl->sample_rate_idx = 7;
  107|  4.09k|  } else if ((mapped_sample_rate >= 23004) && (mapped_sample_rate < 27713)) {
  ------------------
  |  Branch (107:14): [True: 3.98k, False: 106]
  |  Branch (107:47): [True: 321, False: 3.66k]
  ------------------
  108|    321|    mapped_sample_rate = 24000;
  109|    321|    pstr_loudness_hdl->sample_rate_idx = 6;
  110|  3.77k|  } else if ((mapped_sample_rate >= 27713) && (mapped_sample_rate < 37566)) {
  ------------------
  |  Branch (110:14): [True: 3.66k, False: 106]
  |  Branch (110:47): [True: 778, False: 2.88k]
  ------------------
  111|    778|    mapped_sample_rate = 32000;
  112|    778|    pstr_loudness_hdl->sample_rate_idx = 5;
  113|  2.99k|  } else if ((mapped_sample_rate >= 37566) && (mapped_sample_rate < 46009)) {
  ------------------
  |  Branch (113:14): [True: 2.88k, False: 106]
  |  Branch (113:47): [True: 707, False: 2.18k]
  ------------------
  114|    707|    mapped_sample_rate = 44100;
  115|    707|    pstr_loudness_hdl->sample_rate_idx = 4;
  116|  2.28k|  } else if ((mapped_sample_rate >= 46009) && (mapped_sample_rate < 55426)) {
  ------------------
  |  Branch (116:14): [True: 2.18k, False: 106]
  |  Branch (116:47): [True: 1.02k, False: 1.15k]
  ------------------
  117|  1.02k|    mapped_sample_rate = 48000;
  118|  1.02k|    pstr_loudness_hdl->sample_rate_idx = 3;
  119|  1.25k|  } else if ((mapped_sample_rate >= 55426) && (mapped_sample_rate < 75132)) {
  ------------------
  |  Branch (119:14): [True: 1.15k, False: 106]
  |  Branch (119:47): [True: 522, False: 631]
  ------------------
  120|    522|    mapped_sample_rate = 64000;
  121|    522|    pstr_loudness_hdl->sample_rate_idx = 2;
  122|    737|  } else if ((mapped_sample_rate >= 75132) && (mapped_sample_rate < 92017)) {
  ------------------
  |  Branch (122:14): [True: 631, False: 106]
  |  Branch (122:47): [True: 383, False: 248]
  ------------------
  123|    383|    mapped_sample_rate = 88200;
  124|    383|    pstr_loudness_hdl->sample_rate_idx = 1;
  125|    383|  } else if (mapped_sample_rate >= 92017) {
  ------------------
  |  Branch (125:14): [True: 248, False: 106]
  ------------------
  126|    248|    mapped_sample_rate = 96000;
  127|    248|    pstr_loudness_hdl->sample_rate_idx = 0;
  128|    248|  } else {
  129|    106|    mapped_sample_rate = 48000;
  130|    106|    pstr_loudness_hdl->sample_rate_idx = 3;
  131|    106|  }
  132|  5.21k|  return mapped_sample_rate;
  133|  5.21k|}
ixheaace_loudness_measurement.c:ixheaace_measure_sum_square:
  265|  42.1k|                                        ixheaace_loudness_struct *pstr_loudness_hdl) {
  266|  42.1k|  FLOAT64 tot_one_channel = 0;
  267|  42.1k|  FLOAT64 sum_square = 0;
  268|  42.1k|  UWORD32 count = 0;
  269|  42.1k|  FLOAT64 temp = 0;
  270|  42.1k|  UWORD8 channel_no = 0;
  271|  42.1k|  FLOAT64 input_sample;
  272|   104k|  for (channel_no = 0; channel_no < pstr_loudness_hdl->n_channels; channel_no++) {
  ------------------
  |  Branch (272:24): [True: 62.6k, False: 42.1k]
  ------------------
  273|  62.6k|    tot_one_channel = 0;
  274|   188M|    for (count = 0; count < pstr_loudness_hdl->num_samples_per_ch; count++) {
  ------------------
  |  Branch (274:21): [True: 188M, False: 62.6k]
  ------------------
  275|   188M|      input_sample = (FLOAT64)input[channel_no][count] / 32768.0;
  276|   188M|      pstr_loudness_hdl->max_sample_val =
  277|   188M|          MAX(fabs(input_sample), pstr_loudness_hdl->max_sample_val);
  ------------------
  |  |   31|   188M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (31:20): [True: 5.41k, False: 187M]
  |  |  ------------------
  ------------------
  278|   188M|      temp = ixheaace_loudness_k_flt(input_sample, pstr_loudness_hdl, channel_no);
  279|   188M|      tot_one_channel = tot_one_channel + (temp * temp);
  280|   188M|    }
  281|  62.6k|    sum_square += tot_one_channel;
  282|  62.6k|  }
  283|  42.1k|  pstr_loudness_hdl->sum_square = sum_square;
  284|  42.1k|}
ixheaace_loudness_measurement.c:ixheaace_loudness_k_flt:
  249|   188M|                                       UWORD8 channel_no) {
  250|   188M|  FLOAT64 temp;
  251|   188M|  temp = ixheaace_loudness_gen_flt(a_coeff_pre_flt[pstr_loudness_hdl->sample_rate_idx],
  252|   188M|                                   b_coeff_pre_flt[pstr_loudness_hdl->sample_rate_idx],
  253|   188M|                                   pstr_loudness_hdl->w[IXHEAACE_LOUDNESS_PRE_FLT][channel_no],
  ------------------
  |  |   24|   188M|#define IXHEAACE_LOUDNESS_PRE_FLT (0)
  ------------------
  254|   188M|                                   input);
  255|       |
  256|   188M|  temp = ixheaace_loudness_gen_flt(a_coeff_RLB_flt[pstr_loudness_hdl->sample_rate_idx],
  257|   188M|                                   b_coeff_RLB_flt[pstr_loudness_hdl->sample_rate_idx],
  258|   188M|                                   pstr_loudness_hdl->w[IXHEAACE_LOUDNESS_RLB_FLT][channel_no],
  ------------------
  |  |   25|   188M|#define IXHEAACE_LOUDNESS_RLB_FLT (1)
  ------------------
  259|   188M|                                   temp);
  260|       |
  261|   188M|  return temp;
  262|   188M|}
ixheaace_loudness_measurement.c:ixheaace_loudness_gen_flt:
  227|   376M|static FLOAT64 ixheaace_loudness_gen_flt(FLOAT64 *a, FLOAT64 *b, FLOAT64 *w, FLOAT64 input) {
  228|   376M|  FLOAT64 output = 0;
  229|   376M|  UWORD8 count;
  230|       |
  231|  1.12G|  for (count = 0; count <= IXHEAACE_LOUDNESS_NUM_TAPS - 2; count++) {
  ------------------
  |  |   23|  1.12G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (231:19): [True: 752M, False: 376M]
  ------------------
  232|   752M|    w[count] = w[count + 1];
  233|   752M|  }
  234|   376M|  w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] = 0;
  ------------------
  |  |   23|   376M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  235|       |
  236|  1.12G|  for (count = 1; count <= IXHEAACE_LOUDNESS_NUM_TAPS - 1; count++) {
  ------------------
  |  |   23|  1.12G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (236:19): [True: 752M, False: 376M]
  ------------------
  237|   752M|    w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] += a[count] * w[IXHEAACE_LOUDNESS_NUM_TAPS - count - 1];
  ------------------
  |  |   23|   752M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
                  w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] += a[count] * w[IXHEAACE_LOUDNESS_NUM_TAPS - count - 1];
  ------------------
  |  |   23|   752M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  238|   752M|  }
  239|   376M|  w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] = input - w[IXHEAACE_LOUDNESS_NUM_TAPS - 1];
  ------------------
  |  |   23|   376M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
                w[IXHEAACE_LOUDNESS_NUM_TAPS - 1] = input - w[IXHEAACE_LOUDNESS_NUM_TAPS - 1];
  ------------------
  |  |   23|   376M|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  240|       |
  241|  1.50G|  for (count = 0; count <= IXHEAACE_LOUDNESS_NUM_TAPS - 1; count++) {
  ------------------
  |  |   23|  1.50G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  |  Branch (241:19): [True: 1.12G, False: 376M]
  ------------------
  242|  1.12G|    output += b[count] * w[IXHEAACE_LOUDNESS_NUM_TAPS - count - 1];
  ------------------
  |  |   23|  1.12G|#define IXHEAACE_LOUDNESS_NUM_TAPS (3)
  ------------------
  243|  1.12G|  }
  244|       |
  245|   376M|  return output;
  246|   376M|}
ixheaace_loudness_measurement.c:ixheaace_measure_momentary_loudness:
  286|  42.1k|static FLOAT64 ixheaace_measure_momentary_loudness(ixheaace_loudness_struct *pstr_loudness_hdl) {
  287|  42.1k|  FLOAT64 sum = 0;
  288|  42.1k|  FLOAT64 momentary_loudness;
  289|  42.1k|  UWORD32 count = 0;
  290|  42.1k|  FLOAT64 old_ml_val, db_old_ml_val;
  291|  42.1k|  {
  292|   168k|    for (count = 0; count <= 2; count++) {
  ------------------
  |  Branch (292:21): [True: 126k, False: 42.1k]
  ------------------
  293|   126k|      pstr_loudness_hdl->prev_four_sum_square[count] =
  294|   126k|          pstr_loudness_hdl->prev_four_sum_square[count + 1];
  295|   126k|      sum += pstr_loudness_hdl->prev_four_sum_square[count];
  296|   126k|    }
  297|       |
  298|  42.1k|    pstr_loudness_hdl->prev_four_sum_square[3] = pstr_loudness_hdl->sum_square;
  299|  42.1k|    sum += pstr_loudness_hdl->prev_four_sum_square[3];
  300|       |
  301|  42.1k|    if ((pstr_loudness_hdl->mom_loudness_first_time_flag == 1) &&
  ------------------
  |  Branch (301:9): [True: 7.30k, False: 34.8k]
  ------------------
  302|  7.30k|        (pstr_loudness_hdl->count_fn_call_mmstl <= 2)) {
  ------------------
  |  Branch (302:9): [True: 6.43k, False: 870]
  ------------------
  303|  6.43k|      momentary_loudness = IXHEAACE_LOUDNESS_DONT_PASS;
  ------------------
  |  |   26|  6.43k|#define IXHEAACE_LOUDNESS_DONT_PASS (-1)
  ------------------
  304|  35.7k|    } else {
  305|  35.7k|      pstr_loudness_hdl->mom_loudness_first_time_flag = 0;
  306|  35.7k|      momentary_loudness =
  307|  35.7k|          -0.691 + 10 * log10(sum / ((FLOAT64)(4 * pstr_loudness_hdl->num_samples_per_ch)));
  308|       |
  309|  35.7k|      if (pstr_loudness_hdl->get_intergrated_loudness == 1) {
  ------------------
  |  Branch (309:11): [True: 35.7k, False: 0]
  ------------------
  310|  35.7k|        old_ml_val =
  311|  35.7k|            pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call].int_val;
  312|  35.7k|        pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call].int_val =
  313|  35.7k|            sum / ((FLOAT64)(4 * pstr_loudness_hdl->num_samples_per_ch));
  314|  35.7k|        db_old_ml_val = pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call]
  315|  35.7k|                            .momentary_loudness;
  316|  35.7k|        pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call]
  317|  35.7k|            .momentary_loudness = momentary_loudness;
  318|  35.7k|        if (pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call]
  ------------------
  |  Branch (318:13): [True: 24.2k, False: 11.5k]
  ------------------
  319|  35.7k|                .momentary_loudness >= IXHEAACE_ABS_GATE) {
  ------------------
  |  |   27|  35.7k|#define IXHEAACE_ABS_GATE (-70)
  ------------------
  320|  24.2k|          if (db_old_ml_val < IXHEAACE_ABS_GATE) {
  ------------------
  |  |   27|  24.2k|#define IXHEAACE_ABS_GATE (-70)
  ------------------
  |  Branch (320:15): [True: 24.1k, False: 88]
  ------------------
  321|  24.1k|            pstr_loudness_hdl->no_of_mf_passing_abs_gate++;
  322|  24.1k|            old_ml_val = 0;
  323|  24.1k|          }
  324|       |
  325|  24.2k|          pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate =
  326|  24.2k|              pstr_loudness_hdl->tot_int_val_mf_passing_abs_gate +
  327|  24.2k|              (pstr_loudness_hdl->mf_instances[pstr_loudness_hdl->loop_ml_count_fn_call].int_val -
  328|  24.2k|               old_ml_val);
  329|  24.2k|        } else {
  330|  11.5k|          if (db_old_ml_val >= IXHEAACE_ABS_GATE) {
  ------------------
  |  |   27|  11.5k|#define IXHEAACE_ABS_GATE (-70)
  ------------------
  |  Branch (330:15): [True: 103, False: 11.4k]
  ------------------
  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.5k|        }
  336|       |
  337|  35.7k|        pstr_loudness_hdl->loop_ml_count_fn_call++;
  338|  35.7k|        if (pstr_loudness_hdl->ml_count_fn_call < pstr_loudness_hdl->max_il_buf_size)
  ------------------
  |  Branch (338:13): [True: 35.5k, False: 261]
  ------------------
  339|  35.5k|          pstr_loudness_hdl->ml_count_fn_call++;
  340|       |
  341|  35.7k|        pstr_loudness_hdl->loop_ml_count_fn_call =
  342|  35.7k|            pstr_loudness_hdl->loop_ml_count_fn_call % pstr_loudness_hdl->max_il_buf_size;
  343|  35.7k|      }
  344|  35.7k|    }
  345|  42.1k|  }
  346|  42.1k|  return (momentary_loudness);
  347|  42.1k|}

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

ixheaace_mps_515_icc_quant:
  422|  1.46M|WORD32 ixheaace_mps_515_icc_quant(FLOAT32 val) {
  423|  1.46M|  FLOAT32 p_qsteps[7] = {0.9685f, 0.88909f, 0.72105f, 0.48428f, 0.18382f, -0.2945f, -0.7895f};
  424|  1.46M|  WORD32 i;
  425|       |
  426|  1.46M|  if (val >= p_qsteps[0]) {
  ------------------
  |  Branch (426:7): [True: 713k, False: 755k]
  ------------------
  427|   713k|    return 0;
  428|   713k|  }
  429|  3.54M|  for (i = 1; i < 6; i++) {
  ------------------
  |  Branch (429:15): [True: 3.46M, False: 78.2k]
  ------------------
  430|  3.46M|    if ((val >= p_qsteps[i]) && (val <= p_qsteps[i - 1])) {
  ------------------
  |  Branch (430:9): [True: 677k, False: 2.78M]
  |  Branch (430:33): [True: 677k, False: 0]
  ------------------
  431|   677k|      return i;
  432|   677k|    }
  433|  3.46M|  }
  434|  78.2k|  return 7;
  435|   755k|}
ixheaace_mps_515_cld_quant:
  437|  1.97M|WORD32 ixheaace_mps_515_cld_quant(FLOAT32 val) {
  438|  1.97M|  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|  1.97M|                          -9.0,  -7.0,  -5.0,  -3.0,  -1.0,  1.0,   3.0,   5.0,   7.0,   9.0,
  440|  1.97M|                          11.5,  14.5,  17.5,  20.5,  23.5,  27.5,  32.5,  37.5,  42.5,  47.5};
  441|       |
  442|  1.97M|  WORD32 i;
  443|       |
  444|  1.97M|  if (val < p_qsteps[0]) {
  ------------------
  |  Branch (444:7): [True: 651k, False: 1.32M]
  ------------------
  445|   651k|    return 0 - 15;
  446|   651k|  }
  447|  22.9M|  for (i = 1; i < 30; i++) {
  ------------------
  |  Branch (447:15): [True: 22.9M, False: 17.2k]
  ------------------
  448|  22.9M|    if ((val <= p_qsteps[i]) && (val >= p_qsteps[i - 1])) {
  ------------------
  |  Branch (448:9): [True: 1.30M, False: 21.6M]
  |  Branch (448:33): [True: 1.30M, False: 0]
  ------------------
  449|  1.30M|      return i - 15;
  450|  1.30M|    }
  451|  22.9M|  }
  452|  17.2k|  return 30 - 15;
  453|  1.32M|}
ixheaace_mps_515_ttt_box:
  457|  12.5k|                              FLOAT32 *ptr_imag3, WORD32 *ptr_qclds1, WORD32 *ptr_qclds2) {
  458|  12.5k|  WORD32 i, j;
  459|       |
  460|  12.5k|  FLOAT32 cld_s1[PARAMETER_BANDS] = {0};
  461|  12.5k|  FLOAT32 cld_s2[PARAMETER_BANDS] = {0};
  462|  12.5k|  FLOAT32 p_pow1[MAX_HYBRID_BANDS] = {0};
  463|  12.5k|  FLOAT32 p_pow2[MAX_HYBRID_BANDS] = {0};
  464|  12.5k|  FLOAT32 p_pow3[MAX_HYBRID_BANDS] = {0};
  465|       |
  466|  12.5k|  FLOAT32 p_pow_par_band1[PARAMETER_BANDS] = {0};
  467|  12.5k|  FLOAT32 p_pow_par_band2[PARAMETER_BANDS] = {0};
  468|  12.5k|  FLOAT32 p_pow_par_band3[PARAMETER_BANDS] = {0};
  469|       |
  470|   208k|  for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (470:15): [True: 195k, False: 12.5k]
  ------------------
  471|  14.0M|    for (j = 0; j < MAX_HYBRID_BANDS; j++) {
  ------------------
  |  |   23|  14.0M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (471:17): [True: 13.8M, False: 195k]
  ------------------
  472|  13.8M|      p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  473|  13.8M|                   ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  474|  13.8M|      p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  475|  13.8M|                   ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  476|  13.8M|      p_pow3[j] += ptr_real3[i * MAX_HYBRID_BANDS + j] * ptr_real3[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow3[j] += ptr_real3[i * MAX_HYBRID_BANDS + j] * ptr_real3[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  477|  13.8M|                   ptr_imag3[i * MAX_HYBRID_BANDS + j] * ptr_imag3[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag3[i * MAX_HYBRID_BANDS + j] * ptr_imag3[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  478|       |
  479|  13.8M|      ptr_real1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  480|  13.8M|          (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  481|  13.8M|      ptr_imag1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  482|  13.8M|          (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  483|       |
  484|  13.8M|      ptr_real2[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  485|  13.8M|          (ptr_real2[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_real2[i * MAX_HYBRID_BANDS + j] + ptr_real3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  486|  13.8M|      ptr_imag2[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  487|  13.8M|          (ptr_imag2[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_imag2[i * MAX_HYBRID_BANDS + j] + ptr_imag3[i * MAX_HYBRID_BANDS + j] * 0.7071f);
  ------------------
  |  |   23|  13.8M|#define MAX_HYBRID_BANDS (71)
  ------------------
  488|  13.8M|    }
  489|   195k|  }
  490|   905k|  for (i = 0; i < MAX_HYBRID_BANDS; i++) {
  ------------------
  |  |   23|   905k|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (490:15): [True: 892k, False: 12.5k]
  ------------------
  491|   892k|    p_pow_par_band1[kernels_20[i]] += p_pow1[i];
  492|   892k|    p_pow_par_band2[kernels_20[i]] += p_pow2[i];
  493|   892k|    p_pow_par_band3[kernels_20[i]] += p_pow3[i];
  494|   892k|  }
  495|   264k|  for (i = 0; i < PARAMETER_BANDS; i++) {
  ------------------
  |  |   27|   264k|#define PARAMETER_BANDS (20)
  ------------------
  |  Branch (495:15): [True: 251k, False: 12.5k]
  ------------------
  496|   251k|    if (p_pow_par_band3[i]) {
  ------------------
  |  Branch (496:9): [True: 170k, False: 80.8k]
  ------------------
  497|   170k|      cld_s1[i] = ((p_pow_par_band1[i] + p_pow_par_band2[i]) / (p_pow_par_band3[i]));
  498|   170k|      cld_s1[i] = (FLOAT32)(10.0 * log(cld_s1[i] + 1e-10) / log(10.0));
  499|   170k|    } else if ((p_pow_par_band1[i] + p_pow_par_band2[i]))
  ------------------
  |  Branch (499:16): [True: 2.22k, False: 78.6k]
  ------------------
  500|  2.22k|      cld_s1[i] = 50.0;
  501|  78.6k|    else
  502|  78.6k|      cld_s1[i] = -50;
  503|   251k|    ptr_qclds1[i] = ixheaace_mps_515_cld_quant(cld_s1[i]);
  504|       |
  505|   251k|    if (p_pow_par_band2[i]) {
  ------------------
  |  Branch (505:9): [True: 170k, False: 80.7k]
  ------------------
  506|   170k|      cld_s2[i] = (p_pow_par_band1[i] / (p_pow_par_band2[i]));
  507|   170k|      cld_s2[i] = (FLOAT32)(10 * log(cld_s2[i] + 1e-10f) / log(10.0));
  508|   170k|    } else if (p_pow_par_band1[i])
  ------------------
  |  Branch (508:16): [True: 1.50k, False: 79.2k]
  ------------------
  509|  1.50k|      cld_s2[i] = 50.0;
  510|  79.2k|    else
  511|  79.2k|      cld_s2[i] = -50;
  512|   251k|    ptr_qclds2[i] = ixheaace_mps_515_cld_quant(cld_s2[i]);
  513|   251k|  }
  514|  12.5k|}
ixheaace_mps_515_ott_box:
  518|  73.4k|                              WORD32 *ptr_qiccs) {
  519|  73.4k|  WORD32 i, j;
  520|       |
  521|  73.4k|  FLOAT32 clds[PARAMETER_BANDS] = {0};
  522|  73.4k|  FLOAT32 iccs[PARAMETER_BANDS] = {0};
  523|  73.4k|  FLOAT32 p_pow1[MAX_HYBRID_BANDS] = {0};
  524|  73.4k|  FLOAT32 p_pow2[MAX_HYBRID_BANDS] = {0};
  525|  73.4k|  FLOAT32 p_xcor_real[MAX_HYBRID_BANDS] = {0};
  526|       |
  527|  73.4k|  FLOAT32 p_pow_par_band1[PARAMETER_BANDS] = {0};
  528|  73.4k|  FLOAT32 p_pow_par_band2[PARAMETER_BANDS] = {0};
  529|  73.4k|  FLOAT32 p_xcor_par_band[PARAMETER_BANDS] = {0};
  530|       |
  531|  1.21M|  for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (531:15): [True: 1.13M, False: 73.4k]
  ------------------
  532|  81.9M|    for (j = 0; j < MAX_HYBRID_BANDS; j++) {
  ------------------
  |  |   23|  81.9M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (532:17): [True: 80.7M, False: 1.13M]
  ------------------
  533|  80.7M|      p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow1[j] += ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real1[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  534|  80.7M|                   ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag1[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  535|  80.7M|      p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                    p_pow2[j] += ptr_real2[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  536|  80.7M|                   ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                                 ptr_imag2[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  537|  80.7M|      p_xcor_real[j] +=
  538|  80.7M|          ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        ptr_real1[i * MAX_HYBRID_BANDS + j] * ptr_real2[i * MAX_HYBRID_BANDS + j] +
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  539|  80.7M|          ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        ptr_imag1[i * MAX_HYBRID_BANDS + j] * ptr_imag2[i * MAX_HYBRID_BANDS + j];
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  540|       |
  541|  80.7M|      ptr_real1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  542|  80.7M|          (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_real1[i * MAX_HYBRID_BANDS + j] + ptr_real2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  543|  80.7M|      ptr_imag1[i * MAX_HYBRID_BANDS + j] =
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  544|  80.7M|          (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
                        (ptr_imag1[i * MAX_HYBRID_BANDS + j] + ptr_imag2[i * MAX_HYBRID_BANDS + j]);
  ------------------
  |  |   23|  80.7M|#define MAX_HYBRID_BANDS (71)
  ------------------
  545|  80.7M|    }
  546|  1.13M|  }
  547|  5.28M|  for (i = 0; i < MAX_HYBRID_BANDS; i++) {
  ------------------
  |  |   23|  5.28M|#define MAX_HYBRID_BANDS (71)
  ------------------
  |  Branch (547:15): [True: 5.21M, False: 73.4k]
  ------------------
  548|  5.21M|    p_pow_par_band1[kernels_20[i]] += p_pow1[i];
  549|  5.21M|    p_pow_par_band2[kernels_20[i]] += p_pow2[i];
  550|  5.21M|    p_xcor_par_band[kernels_20[i]] += p_xcor_real[i];
  551|  5.21M|  }
  552|  1.54M|  for (i = 0; i < PARAMETER_BANDS; i++) {
  ------------------
  |  |   27|  1.54M|#define PARAMETER_BANDS (20)
  ------------------
  |  Branch (552:15): [True: 1.46M, False: 73.4k]
  ------------------
  553|  1.46M|    if (p_pow_par_band2[i]) {
  ------------------
  |  Branch (553:9): [True: 980k, False: 488k]
  ------------------
  554|   980k|      clds[i] = (p_pow_par_band1[i] / (p_pow_par_band2[i]));
  555|   980k|      clds[i] = (FLOAT32)(10 * log(clds[i] + 1e-10) / log(10.0));
  556|   980k|    } else if (p_pow_par_band1[i])
  ------------------
  |  Branch (556:16): [True: 6.49k, False: 481k]
  ------------------
  557|  6.49k|      clds[i] = 50.0;
  558|   481k|    else
  559|   481k|      clds[i] = -50;  // 0.0;
  560|  1.46M|    iccs[i] =
  561|  1.46M|        p_xcor_par_band[i] / (FLOAT32)sqrt((p_pow_par_band1[i] * p_pow_par_band2[i] + 1e-10));
  562|       |
  563|  1.46M|    ptr_p_qclds[i] = ixheaace_mps_515_cld_quant(clds[i]);
  564|  1.46M|    ptr_qiccs[i] = ixheaace_mps_515_icc_quant(iccs[i]);
  565|  1.46M|  }
  566|  73.4k|}
ixheaace_mps_212_write_spatial_specific_config:
  571|  1.24k|    WORD32 *const ptr_output_bits, WORD32 aot) {
  572|  1.24k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.24k|#define IA_NO_ERROR 0x00000000
  ------------------
  573|  1.24k|  WORD32 bs_sampling_frequency_index = 0;
  574|  1.24k|  WORD32 bs_freq_res = 0;
  575|  1.24k|  ixheaace_bit_buf bit_buf;
  576|  1.24k|  ixheaace_bit_buf_handle pstr_bit_buf =
  577|  1.24k|      ia_enhaacplus_enc_create_bitbuffer(&bit_buf, ptr_output_buffer, output_buffer_size);
  578|       |
  579|  1.24k|  error = ixheaace_mps_212_get_bs_freq_res_index(pstr_spatial_specific_config->num_bands,
  580|  1.24k|                                                 &bs_freq_res, aot);
  581|  1.24k|  if (error) {
  ------------------
  |  Branch (581:7): [True: 0, False: 1.24k]
  ------------------
  582|      0|    return error;
  583|      0|  }
  584|       |
  585|  1.24k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.24k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (585:7): [True: 150, False: 1.09k]
  ------------------
  586|    150|    ixheaace_mps_212_get_sampling_frequency_index(
  587|    150|        pstr_spatial_specific_config->bs_sampling_frequency, &bs_sampling_frequency_index);
  588|    150|    ixheaace_write_bits(pstr_bit_buf, bs_sampling_frequency_index, 4);
  589|       |
  590|    150|    if (bs_sampling_frequency_index == 15) {
  ------------------
  |  Branch (590:9): [True: 0, False: 150]
  ------------------
  591|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_sampling_frequency, 24);
  592|      0|    }
  593|       |
  594|    150|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_frame_length, 5);
  595|       |
  596|    150|    ixheaace_write_bits(pstr_bit_buf, bs_freq_res, 3);
  597|    150|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_tree_config, 4);
  598|    150|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_quant_mode, 2);
  599|       |
  600|    150|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  601|       |
  602|    150|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_fixed_gain_dmx, 3);
  603|       |
  604|    150|    ixheaace_write_bits(pstr_bit_buf, 0, 2);
  605|    150|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_decorr_config, 2);
  606|       |
  607|    150|    ixheaace_byte_align_buffer(pstr_bit_buf);
  608|       |
  609|    150|    if ((*ptr_output_bits = ia_enhaacplus_enc_get_bits_available(pstr_bit_buf)) >
  ------------------
  |  Branch (609:9): [True: 0, False: 150]
  ------------------
  610|    150|        (output_buffer_size * 8)) {
  611|      0|      return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  612|      0|    }
  613|       |
  614|    150|    ixheaace_byte_align_buffer(pstr_bit_buf);
  615|  1.09k|  } else {
  616|  1.09k|    ixheaace_mps_212_get_sampling_frequency_index(
  617|  1.09k|        pstr_spatial_specific_config->bs_sampling_frequency, &bs_sampling_frequency_index);
  618|  1.09k|    ixheaace_write_bits(pstr_bit_buf, bs_freq_res, 3);
  619|       |
  620|  1.09k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_fixed_gain_dmx, 3);
  621|       |
  622|  1.09k|    ixheaace_write_bits(pstr_bit_buf, 0, 2);
  623|  1.09k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_specific_config->bs_decorr_config, 2);
  624|       |
  625|  1.09k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  626|  1.09k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  627|  1.09k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  628|       |
  629|  1.09k|    ixheaace_write_bits(pstr_bit_buf, 0, 5);
  630|  1.09k|    ixheaace_write_bits(pstr_bit_buf, 0, 1);
  631|       |
  632|  1.09k|    *ptr_output_bits = ia_enhaacplus_enc_get_bits_available(pstr_bit_buf);
  633|  1.09k|  }
  634|  1.24k|  return error;
  635|  1.24k|}
ixheaace_mps_212_write_spatial_frame:
  639|  85.3k|    WORD32 *const ptr_output_bits, ixheaace_mps_pstr_bsf_instance pstr_bsf_instance, WORD32 aot) {
  640|  85.3k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  641|  85.3k|  WORD32 i, j, num_param_sets, num_ott_boxes;
  642|  85.3k|  ixheaace_mps_spatial_frame *pstr_spatial_frame = NULL;
  643|  85.3k|  ixheaace_mps_spatial_specific_config *pstr_specific_config = NULL;
  644|  85.3k|  ixheaace_bit_buf bit_buf;
  645|  85.3k|  ixheaace_bit_buf_handle pstr_bit_buf =
  646|  85.3k|      ia_enhaacplus_enc_create_bitbuffer(&bit_buf, ptr_output_buffer, output_buffer_size);
  647|  85.3k|  pstr_spatial_frame = &pstr_bsf_instance->frame;
  648|  85.3k|  pstr_specific_config = &pstr_bsf_instance->spatial_specific_config;
  649|  85.3k|  num_ott_boxes = pstr_bsf_instance->spatial_specific_config.tree_description.num_ott_boxes;
  650|  85.3k|  num_param_sets = pstr_spatial_frame->framing_info.num_param_sets;
  651|       |
  652|  85.3k|  if (pstr_spatial_frame->b_use_bb_cues) {
  ------------------
  |  Branch (652:7): [True: 0, False: 85.3k]
  ------------------
  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|  85.3k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  85.3k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (666:7): [True: 11.4k, False: 73.9k]
  ------------------
  667|  11.4k|    ixheaace_mps_212_write_framing_info(
  668|  11.4k|        pstr_bit_buf, &(pstr_spatial_frame->framing_info),
  669|  11.4k|        pstr_bsf_instance->spatial_specific_config.bs_frame_length);
  670|  11.4k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->bs_independency_flag, 1);
  671|  73.9k|  } else if (aot == AOT_USAC) {
  ------------------
  |  |   38|  73.9k|#define AOT_USAC (42)
  ------------------
  |  Branch (671:14): [True: 73.9k, False: 0]
  ------------------
  672|  73.9k|    if (!pstr_spatial_frame->bs_independency_flag) {
  ------------------
  |  Branch (672:9): [True: 68.0k, False: 5.90k]
  ------------------
  673|  68.0k|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->bs_independency_flag, 1);
  674|  68.0k|    }
  675|  73.9k|  }
  676|  85.3k|  error = ixheaace_mps_212_write_ott_data(
  677|  85.3k|      pstr_bit_buf, &pstr_bsf_instance->prev_frame_data.prev_ott_data,
  678|  85.3k|      &pstr_spatial_frame->ott_data, pstr_specific_config->ott_config,
  679|  85.3k|      &pstr_spatial_frame->cld_lossless_data, &pstr_spatial_frame->icc_lossless_data,
  680|  85.3k|      num_ott_boxes, pstr_specific_config->num_bands, num_param_sets,
  681|  85.3k|      pstr_spatial_frame->bs_independency_flag);
  682|  85.3k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (682:7): [True: 0, False: 85.3k]
  ------------------
  683|      0|    return error;
  684|      0|  }
  685|  85.3k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  85.3k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (685:7): [True: 11.4k, False: 73.9k]
  ------------------
  686|  11.4k|    ixheaace_mps_212_write_smg_data(pstr_bit_buf, &pstr_spatial_frame->smg_data, num_param_sets,
  687|  11.4k|                                    pstr_specific_config->num_bands);
  688|  11.4k|  }
  689|       |
  690|  85.3k|  *ptr_output_bits = ia_enhaacplus_enc_get_bits_available(pstr_bit_buf);
  691|  85.3k|  if ((*ptr_output_bits) > (output_buffer_size * 8)) {
  ------------------
  |  Branch (691:7): [True: 0, False: 85.3k]
  ------------------
  692|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  693|      0|  }
  694|  85.3k|  return error;
  695|  85.3k|}
ixheaace_mps_515_write_spatial_specific_config:
  699|    386|                                               ixheaace_mps_sac_bsf_instance *pstr_bsf_instance) {
  700|    386|  WORD32 idx, box, bin;
  701|    386|  WORD32 bs_sampling_frequency_index;
  702|    386|  ixheaace_mps_sac_spatial_frame *pstr_spatial_frame = &(pstr_bsf_instance->current_frame);
  703|    386|  ixheaace_mps_sac_specific_config *pstr_specific_config =
  704|    386|      &(pstr_bsf_instance->spatial_specific_config);
  705|    386|  ixheaace_mps_sac_tree_description *pstr_tree_description =
  706|    386|      &(pstr_specific_config->tree_description);
  707|       |
  708|    386|  pstr_tree_description->num_ott_boxes =
  709|    386|      tree_config_table[pstr_specific_config->bs_tree_config].num_ott_boxes;
  710|    386|  pstr_tree_description->num_ttt_boxes =
  711|    386|      tree_config_table[pstr_specific_config->bs_tree_config].num_ttt_boxes;
  712|    386|  pstr_tree_description->num_in_chan =
  713|    386|      tree_config_table[pstr_specific_config->bs_tree_config].num_in_chan;
  714|    386|  pstr_tree_description->num_out_chan =
  715|    386|      tree_config_table[pstr_specific_config->bs_tree_config].num_out_chan;
  716|       |
  717|    386|  if (pstr_specific_config->bs_temp_shape_config == 2) {
  ------------------
  |  Branch (717:7): [True: 0, False: 386]
  ------------------
  718|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_GUIDED_ENV_SHAPE;
  719|      0|  }
  720|       |
  721|    386|  if (pstr_specific_config->bs_3d_audio_mode > 0) {
  ------------------
  |  Branch (721:7): [True: 0, False: 386]
  ------------------
  722|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_3D_STEREO_MODE_NOT_SUPPORTED;
  723|      0|  }
  724|       |
  725|    386|  if (pstr_specific_config->bs_residual_coding == 1) {
  ------------------
  |  Branch (725:7): [True: 0, False: 386]
  ------------------
  726|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_RESIDUAL_CODING;
  727|      0|  }
  728|    386|  if (pstr_specific_config->bs_arbitrary_downmix == 2) {
  ------------------
  |  Branch (728:7): [True: 0, False: 386]
  ------------------
  729|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_ARBITARY_DOWNMIX_CODING;
  730|      0|  }
  731|    386|  if (pstr_specific_config->tree_description.arbitrary_tree) {
  ------------------
  |  Branch (731:7): [True: 0, False: 386]
  ------------------
  732|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_ARBITARY_TREE_NOT_SUPPORTED;
  733|      0|  }
  734|       |
  735|  2.31k|  for (box = 0; box < MAX_NUM_BOXES; box++) {
  ------------------
  |  |  118|  2.31k|#define MAX_NUM_BOXES (5)
  ------------------
  |  Branch (735:17): [True: 1.93k, False: 386]
  ------------------
  736|  1.93k|    pstr_tree_description->ott_mode_lfe[box] =
  737|  1.93k|        tree_config_table[pstr_specific_config->bs_tree_config].ott_mode_lfe[box];
  738|  1.93k|  }
  739|    386|  pstr_bsf_instance->num_bins = freq_res_bin_table[pstr_specific_config->bs_freq_res];
  740|       |
  741|    386|  bs_sampling_frequency_index = 15;
  742|  1.74k|  for (idx = 0; idx < 15; idx++) {
  ------------------
  |  Branch (742:17): [True: 1.74k, False: 0]
  ------------------
  743|  1.74k|    if (pstr_specific_config->bs_sampling_frequency == ia_sampl_freq_table[idx]) {
  ------------------
  |  Branch (743:9): [True: 386, False: 1.35k]
  ------------------
  744|    386|      bs_sampling_frequency_index = idx;
  745|    386|      break;
  746|    386|    }
  747|  1.74k|  }
  748|       |
  749|    386|  ixheaace_write_bits(pstr_bit_buf, bs_sampling_frequency_index, 4);
  750|    386|  if (bs_sampling_frequency_index == 15) {
  ------------------
  |  Branch (750:7): [True: 0, False: 386]
  ------------------
  751|      0|    ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_sampling_frequency, 24);
  752|      0|  }
  753|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_frame_length, 5);
  754|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_freq_res, 3);
  755|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_tree_config, 4);
  756|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_quant_mode, 2);
  757|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_one_icc, 1);
  758|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_arbitrary_downmix, 1);
  759|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_fixed_gain_sur, 3);
  760|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_fixed_gain_lfe, 3);
  761|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_fixed_gain_dmx, 3);
  762|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_matrix_mode, 1);
  763|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_temp_shape_config, 2);
  764|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_decorr_config, 2);
  765|    386|  ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->bs_3d_audio_mode, 1);
  766|       |
  767|  1.87k|  for (box = 0; box < pstr_tree_description->num_ott_boxes; box++) {
  ------------------
  |  Branch (767:17): [True: 1.48k, False: 386]
  ------------------
  768|  1.48k|    if (pstr_tree_description->ott_mode_lfe[box]) {
  ------------------
  |  Branch (768:9): [True: 386, False: 1.09k]
  ------------------
  769|    386|      ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ott_config[box].bs_ott_bands, 5);
  770|    386|    }
  771|  1.48k|  }
  772|    609|  for (box = 0; box < pstr_tree_description->num_ttt_boxes; box++) {
  ------------------
  |  Branch (772:17): [True: 223, False: 386]
  ------------------
  773|    223|    ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ttt_config[box].bs_ttt_dual_mode, 1);
  774|    223|    ixheaace_write_bits(pstr_bit_buf, pstr_specific_config->ttt_config[box].bs_ttt_mode_low, 3);
  775|    223|    if (pstr_specific_config->ttt_config[box].bs_ttt_dual_mode == 1) {
  ------------------
  |  Branch (775:9): [True: 0, False: 223]
  ------------------
  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|    223|  }
  782|    386|  ixheaace_byte_align_buffer(pstr_bit_buf);
  783|       |
  784|  2.31k|  for (box = 0; box < MAX_NUM_BOXES; box++) {
  ------------------
  |  |  118|  2.31k|#define MAX_NUM_BOXES (5)
  ------------------
  |  Branch (784:17): [True: 1.93k, False: 386]
  ------------------
  785|  1.93k|    pstr_specific_config->ttt_config[box].bs_ttt_bands_low = pstr_bsf_instance->num_bins;
  786|   110k|    for (bin = 0; bin < MAX_NUM_BINS; bin++) {
  ------------------
  |  |   41|   110k|#define MAX_NUM_BINS (56)
  ------------------
  |  Branch (786:19): [True: 108k, False: 1.93k]
  ------------------
  787|   108k|      pstr_spatial_frame->ott_data.cld_old[box][bin] = 0;
  788|   108k|      pstr_spatial_frame->ott_data.icc_old[box][bin] = 0;
  789|   108k|      pstr_spatial_frame->ttt_data.cpc_cld1_old[box][bin] = 0;
  790|   108k|      pstr_spatial_frame->ttt_data.cpc_cld2_old[box][bin] = 0;
  791|   108k|      pstr_spatial_frame->ttt_data.icc_old[box][bin] = 0;
  792|   108k|    }
  793|  1.93k|  }
  794|       |
  795|  1.87k|  for (box = 0; box < pstr_tree_description->num_ott_boxes; box++) {
  ------------------
  |  Branch (795:17): [True: 1.48k, False: 386]
  ------------------
  796|  1.48k|    if (!pstr_tree_description->ott_mode_lfe[box]) {
  ------------------
  |  Branch (796:9): [True: 1.09k, False: 386]
  ------------------
  797|  1.09k|      pstr_specific_config->ott_config[box].bs_ott_bands = pstr_bsf_instance->num_bins;
  798|  1.09k|    }
  799|  1.48k|    if (!pstr_specific_config->ttt_config[box].bs_ttt_dual_mode) {
  ------------------
  |  Branch (799:9): [True: 1.48k, False: 0]
  ------------------
  800|  1.48k|      pstr_specific_config->ttt_config[box].bs_ttt_bands_low = pstr_bsf_instance->num_bins;
  801|  1.48k|    }
  802|  1.48k|  }
  803|       |
  804|    386|  return IA_NO_ERROR;
  ------------------
  |  |   23|    386|#define IA_NO_ERROR 0x00000000
  ------------------
  805|    386|}
ixheaace_mps_515_write_spatial_frame:
  809|  19.7k|                                     ixheaace_mps_sac_bsf_instance *pstr_bsf_instance) {
  810|  19.7k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  19.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  811|  19.7k|  UWORD8 bits_param_slot;
  812|  19.7k|  WORD32 param, box, ch, bin;
  813|  19.7k|  WORD32 prev_bs_param_slot, num_temp_shape_chan;
  814|  19.7k|  ixheaace_mps_sac_spatial_frame *pstr_spatial_frame = &(pstr_bsf_instance->current_frame);
  815|  19.7k|  ixheaace_mps_sac_specific_config *pstr_specific_config =
  816|  19.7k|      &(pstr_bsf_instance->spatial_specific_config);
  817|  19.7k|  WORD32 bs_independency_flag = pstr_spatial_frame->bs_independency_flag;
  818|  19.7k|  WORD32 num_param_sets = pstr_spatial_frame->framing_info.bs_num_param_sets;
  819|  19.7k|  WORD32 num_ott_boxes =
  820|  19.7k|      pstr_bsf_instance->spatial_specific_config.tree_description.num_ott_boxes;
  821|  19.7k|  WORD32 num_ttt_boxes =
  822|  19.7k|      pstr_bsf_instance->spatial_specific_config.tree_description.num_ttt_boxes;
  823|  19.7k|  WORD32 *ptr_ott_mode_lfe =
  824|  19.7k|      pstr_bsf_instance->spatial_specific_config.tree_description.ott_mode_lfe;
  825|       |
  826|  19.7k|  if (pstr_specific_config->bs_arbitrary_downmix) {
  ------------------
  |  Branch (826:7): [True: 0, False: 19.7k]
  ------------------
  827|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_ARBITARY_DOWNMIX_CODING;
  828|      0|  }
  829|  19.7k|  if (pstr_specific_config->bs_residual_coding == 1) {
  ------------------
  |  Branch (829:7): [True: 0, False: 19.7k]
  ------------------
  830|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_RESIDUAL_CODING;
  831|      0|  }
  832|  19.7k|  if (pstr_specific_config->bs_arbitrary_downmix == 2) {
  ------------------
  |  Branch (832:7): [True: 0, False: 19.7k]
  ------------------
  833|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_UNSUPPORTED_ARBITARY_DOWNMIX_CODING;
  834|      0|  }
  835|  19.7k|  if (pstr_specific_config->tree_description.arbitrary_tree) {
  ------------------
  |  Branch (835:7): [True: 0, False: 19.7k]
  ------------------
  836|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_ARBITARY_TREE_NOT_SUPPORTED;
  837|      0|  }
  838|  19.7k|  ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->framing_info.bs_framing_type, 1);
  839|  19.7k|  ixheaace_write_bits(pstr_bit_buf, num_param_sets - 1, 1);
  840|       |
  841|  19.7k|  if (pstr_spatial_frame->framing_info.bs_framing_type) {
  ------------------
  |  Branch (841:7): [True: 19.7k, False: 0]
  ------------------
  842|  19.7k|    prev_bs_param_slot = -1;
  843|       |
  844|  39.4k|    for (param = 0; param < num_param_sets; param++) {
  ------------------
  |  Branch (844:21): [True: 19.7k, False: 19.7k]
  ------------------
  845|  19.7k|      bits_param_slot = 0;
  846|  98.5k|      while ((1 << bits_param_slot) < (pstr_specific_config->bs_frame_length + 1 -
  ------------------
  |  Branch (846:14): [True: 78.8k, False: 19.7k]
  ------------------
  847|  98.5k|                                       num_param_sets + param - prev_bs_param_slot)) {
  848|  78.8k|        bits_param_slot++;
  849|  78.8k|      }
  850|       |
  851|  19.7k|      if (bits_param_slot > 0) {
  ------------------
  |  Branch (851:11): [True: 19.7k, False: 0]
  ------------------
  852|  19.7k|        ixheaace_write_bits(
  853|  19.7k|            pstr_bit_buf,
  854|  19.7k|            pstr_spatial_frame->framing_info.bs_param_slots[param] - prev_bs_param_slot - 1,
  855|  19.7k|            bits_param_slot);
  856|  19.7k|      }
  857|  19.7k|      prev_bs_param_slot = pstr_spatial_frame->framing_info.bs_param_slots[param];
  858|  19.7k|    }
  859|  19.7k|  }
  860|       |
  861|  19.7k|  ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->bs_independency_flag, 1);
  862|       |
  863|  93.1k|  for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (863:17): [True: 73.4k, False: 19.7k]
  ------------------
  864|  73.4k|    error = ixheaace_mps_515_ec_data(
  865|  73.4k|        pstr_bit_buf, pstr_spatial_frame->ott_data.cld[box],
  866|  73.4k|        pstr_spatial_frame->ott_data.cld_old[box], &(pstr_spatial_frame->cld_lossless_data),
  867|  73.4k|        IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets, bs_independency_flag, 0,
  ------------------
  |  |   22|  73.4k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  868|  73.4k|        pstr_specific_config->ott_config[box].bs_ott_bands);
  869|  73.4k|    if (error) {
  ------------------
  |  Branch (869:9): [True: 0, False: 73.4k]
  ------------------
  870|      0|      return error;
  871|      0|    }
  872|  73.4k|  }
  873|  19.7k|  if (!pstr_bsf_instance->spatial_specific_config.bs_one_icc) {
  ------------------
  |  Branch (873:7): [True: 19.7k, False: 0]
  ------------------
  874|  93.1k|    for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (874:19): [True: 73.4k, False: 19.7k]
  ------------------
  875|  73.4k|      if (!ptr_ott_mode_lfe[box]) {
  ------------------
  |  Branch (875:11): [True: 53.7k, False: 19.7k]
  ------------------
  876|  53.7k|        error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ott_data.icc[box],
  877|  53.7k|                                         pstr_spatial_frame->ott_data.icc_old[box],
  878|  53.7k|                                         &(pstr_spatial_frame->cld_lossless_data),
  879|  53.7k|                                         IXHEAACE_MPS_SAC_DATA_TYPE_ICC, box, num_param_sets,
  ------------------
  |  |   23|  53.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  880|  53.7k|                                         bs_independency_flag, 0, pstr_bsf_instance->num_bins);
  881|  53.7k|        if (error) {
  ------------------
  |  Branch (881:13): [True: 0, False: 53.7k]
  ------------------
  882|      0|          return error;
  883|      0|        }
  884|  53.7k|      }
  885|  73.4k|    }
  886|  19.7k|  } 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|  32.2k|  for (box = 0; box < num_ttt_boxes; box++) {
  ------------------
  |  Branch (896:17): [True: 12.5k, False: 19.7k]
  ------------------
  897|  12.5k|    if (pstr_specific_config->ttt_config[box].bs_ttt_mode_low >= 2) {
  ------------------
  |  Branch (897:9): [True: 12.5k, False: 0]
  ------------------
  898|  12.5k|      error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld1[box],
  899|  12.5k|                                       pstr_spatial_frame->ttt_data.cpc_cld1_old[box],
  900|  12.5k|                                       &(pstr_spatial_frame->cld_lossless_data),
  901|  12.5k|                                       IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets,
  ------------------
  |  |   22|  12.5k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  902|  12.5k|                                       bs_independency_flag, 0,
  903|  12.5k|                                       pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  904|  12.5k|      if (error) {
  ------------------
  |  Branch (904:11): [True: 0, False: 12.5k]
  ------------------
  905|      0|        return error;
  906|      0|      }
  907|  12.5k|      error = ixheaace_mps_515_ec_data(pstr_bit_buf, pstr_spatial_frame->ttt_data.cpc_cld2[box],
  908|  12.5k|                                       pstr_spatial_frame->ttt_data.cpc_cld2_old[box],
  909|  12.5k|                                       &(pstr_spatial_frame->cld_lossless_data),
  910|  12.5k|                                       IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets,
  ------------------
  |  |   22|  12.5k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  911|  12.5k|                                       bs_independency_flag, 0,
  912|  12.5k|                                       pstr_specific_config->ttt_config[box].bs_ttt_bands_low);
  913|  12.5k|      if (error) {
  ------------------
  |  Branch (913:11): [True: 0, False: 12.5k]
  ------------------
  914|      0|        return error;
  915|      0|      }
  916|  12.5k|    } 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|  12.5k|    if (pstr_specific_config->ttt_config[box].bs_ttt_dual_mode) {
  ------------------
  |  Branch (945:9): [True: 0, False: 12.5k]
  ------------------
  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|  12.5k|  }
  995|  39.4k|  for (param = 0; param < num_param_sets; param++) {
  ------------------
  |  Branch (995:19): [True: 19.7k, False: 19.7k]
  ------------------
  996|  19.7k|    ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->smg_data.bs_smooth_mode[param], 2);
  997|       |
  998|  19.7k|    if (pstr_spatial_frame->smg_data.bs_smooth_mode[param] >= 2) {
  ------------------
  |  Branch (998:9): [True: 0, False: 19.7k]
  ------------------
  999|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_spatial_frame->smg_data.bs_smooth_time[param], 2);
 1000|      0|    }
 1001|  19.7k|    if (pstr_spatial_frame->smg_data.bs_smooth_mode[param] == 3) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 19.7k]
  ------------------
 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|  19.7k|  }
 1011|  19.7k|  if (pstr_specific_config->bs_temp_shape_config != 0) {
  ------------------
  |  Branch (1011:7): [True: 0, False: 19.7k]
  ------------------
 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|  19.7k|  ixheaace_byte_align_buffer(pstr_bit_buf);
 1029|       |
 1030|  19.7k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  19.7k|#define IA_NO_ERROR 0x00000000
  ------------------
 1031|  19.7k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_get_bs_freq_res_index:
   66|  1.24k|                                                           WORD32 aot) {
   67|  1.24k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.24k|#define IA_NO_ERROR 0x00000000
  ------------------
   68|  1.24k|  WORD32 idx;
   69|  1.24k|  const UWORD8 *p_freq_res_bin_table;
   70|  1.24k|  *ptr_bs_freq_res_index = -1;
   71|       |
   72|  1.24k|  if (aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  1.24k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (72:7): [True: 150, False: 1.09k]
  ------------------
   73|    150|    p_freq_res_bin_table = freq_res_bin_table_ld;
   74|  1.09k|  } else {
   75|  1.09k|    p_freq_res_bin_table = freq_res_bin_table_usac;
   76|  1.09k|  }
   77|  2.64k|  for (idx = 0; idx < MAX_FREQ_RES_INDEX; idx++) {
  ------------------
  |  |   78|  2.64k|#define MAX_FREQ_RES_INDEX (8)
  ------------------
  |  Branch (77:17): [True: 2.64k, False: 0]
  ------------------
   78|  2.64k|    if (num_bands == p_freq_res_bin_table[idx]) {
  ------------------
  |  Branch (78:9): [True: 1.24k, False: 1.39k]
  ------------------
   79|  1.24k|      *ptr_bs_freq_res_index = idx;
   80|  1.24k|      break;
   81|  1.24k|    }
   82|  2.64k|  }
   83|  1.24k|  if (*ptr_bs_freq_res_index < 0 || *ptr_bs_freq_res_index >= MAX_FREQ_RES_INDEX) {
  ------------------
  |  |   78|  1.24k|#define MAX_FREQ_RES_INDEX (8)
  ------------------
  |  Branch (83:7): [True: 0, False: 1.24k]
  |  Branch (83:37): [True: 0, False: 1.24k]
  ------------------
   84|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   85|      0|  }
   86|  1.24k|  return error;
   87|  1.24k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_get_sampling_frequency_index:
   90|  1.24k|    const UWORD32 bs_sampling_frequency, WORD32 *const ptr_bs_sampling_frequency_index) {
   91|  1.24k|  WORD32 idx;
   92|  1.24k|  *ptr_bs_sampling_frequency_index = SAMPLING_FREQUENCY_INDEX_ESCAPE;
  ------------------
  |  |   80|  1.24k|#define SAMPLING_FREQUENCY_INDEX_ESCAPE (15)
  ------------------
   93|       |
   94|  6.03k|  for (idx = 0; idx < MAX_SAMPLING_FREQUENCY_INDEX; idx++) {
  ------------------
  |  |   79|  6.03k|#define MAX_SAMPLING_FREQUENCY_INDEX (13)
  ------------------
  |  Branch (94:17): [True: 6.03k, False: 0]
  ------------------
   95|  6.03k|    if (bs_sampling_frequency == ia_sampl_freq_table[idx]) {
  ------------------
  |  Branch (95:9): [True: 1.24k, False: 4.78k]
  ------------------
   96|  1.24k|      *ptr_bs_sampling_frequency_index = idx;
   97|  1.24k|      break;
   98|  1.24k|    }
   99|  6.03k|  }
  100|  1.24k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_write_framing_info:
  335|  11.4k|    const ixheaace_mps_framing_info *const pstr_framing_info, const WORD32 frame_length) {
  336|  11.4k|  ixheaace_write_bits(pstr_bit_buf, pstr_framing_info->bs_framing_type, 1);
  337|  11.4k|  ixheaace_write_bits(pstr_bit_buf, pstr_framing_info->num_param_sets - 1, 1);
  338|       |
  339|  11.4k|  if (pstr_framing_info->bs_framing_type) {
  ------------------
  |  Branch (339:7): [True: 0, False: 11.4k]
  ------------------
  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|  11.4k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_write_ott_data:
  306|  85.3k|    const WORD32 num_bands, const WORD32 num_param_sets, const WORD32 bs_independency_flag) {
  307|  85.3k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  308|  85.3k|  WORD32 box;
  309|   170k|  for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (309:17): [True: 85.3k, False: 85.3k]
  ------------------
  310|  85.3k|    error = ixheaace_mps_212_ec_data(
  311|  85.3k|        pstr_bit_buf, pstr_ott_data->cld[box], pstr_prev_ott_data->cld_old[box],
  312|  85.3k|        pstr_prev_ott_data->quant_coarse_cld_prev[box], pstr_cld_lossless_data,
  313|  85.3k|        IXHEAACE_MPS_SAC_DATA_TYPE_CLD, box, num_param_sets, bs_independency_flag, 0,
  ------------------
  |  |   22|  85.3k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  314|  85.3k|        ott_config[box].bs_ott_bands, 15);
  315|  85.3k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (315:9): [True: 0, False: 85.3k]
  ------------------
  316|      0|      return error;
  317|      0|    }
  318|  85.3k|  }
  319|   170k|  for (box = 0; box < num_ott_boxes; box++) {
  ------------------
  |  Branch (319:17): [True: 85.3k, False: 85.3k]
  ------------------
  320|  85.3k|    error = ixheaace_mps_212_ec_data(pstr_bit_buf, pstr_ott_data->icc[box],
  321|  85.3k|                                     pstr_prev_ott_data->icc_old[box],
  322|  85.3k|                                     pstr_prev_ott_data->quant_coarse_icc_prev[box],
  323|  85.3k|                                     pstr_icc_lossless_data, IXHEAACE_MPS_SAC_DATA_TYPE_ICC, box,
  ------------------
  |  |   23|  85.3k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  324|  85.3k|                                     num_param_sets, bs_independency_flag, 0, num_bands, 0);
  325|  85.3k|    if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (325:9): [True: 0, False: 85.3k]
  ------------------
  326|      0|      return error;
  327|      0|    }
  328|  85.3k|  }
  329|       |
  330|  85.3k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  331|  85.3k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_ec_data:
  107|   170k|    const WORD32 start_band, const WORD32 stop_band, const WORD32 default_value) {
  108|   170k|  IA_ERRORCODE error;
  109|   170k|  WORD32 ps, pb, str_offset, pb_stride, i;
  110|   170k|  WORD16 data_bands;
  111|   170k|  WORD32 a_strides[MAX_NUM_BINS + 1] = {0};
  112|   170k|  WORD16 cmp_idx_data[2][MAX_NUM_BINS] = {{0}};
  113|   170k|  WORD16 cmp_old_data[MAX_NUM_BINS] = {0};
  114|       |
  115|   170k|  if (num_param_sets > MAX_NUM_PARAMS) {
  ------------------
  |  |   42|   170k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (115:7): [True: 0, False: 170k]
  ------------------
  116|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_NUM_PARAM_SETS;
  117|      0|  }
  118|       |
  119|   170k|  if (independency_flag || (pstr_lossless_data->bs_quant_coarse_xxx[param_idx][0] !=
  ------------------
  |  Branch (119:7): [True: 13.1k, False: 157k]
  |  Branch (119:28): [True: 0, False: 157k]
  ------------------
  120|   157k|                            quant_coarse_xxx_prev[param_idx])) {
  121|  13.1k|    pstr_lossless_data->bs_xxx_data_mode[param_idx][0] = IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|  13.1k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  122|   157k|  } else {
  123|   157k|    pstr_lossless_data->bs_xxx_data_mode[param_idx][0] = IXHEAACE_MPS_DATA_MODE_KEEP;
  ------------------
  |  |  114|   157k|#define IXHEAACE_MPS_DATA_MODE_KEEP (1)
  ------------------
  124|  3.53M|    for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (124:26): [True: 3.40M, False: 127k]
  ------------------
  125|  3.40M|      if (data[0][i] != old_data[i]) {
  ------------------
  |  Branch (125:11): [True: 30.1k, False: 3.37M]
  ------------------
  126|  30.1k|        pstr_lossless_data->bs_xxx_data_mode[param_idx][0] = IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|  30.1k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  127|  30.1k|        break;
  128|  30.1k|      }
  129|  3.40M|    }
  130|   157k|  }
  131|       |
  132|   170k|  ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_xxx_data_mode[param_idx][0], 2);
  133|       |
  134|   170k|  for (ps = 1; ps < num_param_sets; ps++) {
  ------------------
  |  Branch (134:16): [True: 0, False: 170k]
  ------------------
  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|   170k|  for (ps = 0; ps < (num_param_sets - 1); ps++) {
  ------------------
  |  Branch (151:16): [True: 0, False: 170k]
  ------------------
  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|   341k|  for (ps = 0; ps < num_param_sets; ps++) {
  ------------------
  |  Branch (176:16): [True: 170k, False: 170k]
  ------------------
  177|   170k|    if (pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] == IXHEAACE_MPS_DATA_MODE_DEFAULT) {
  ------------------
  |  |  113|   170k|#define IXHEAACE_MPS_DATA_MODE_DEFAULT (0)
  ------------------
  |  Branch (177:9): [True: 0, False: 170k]
  ------------------
  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|   170k|    if (pstr_lossless_data->bs_xxx_data_mode[param_idx][ps] ==
  ------------------
  |  Branch (184:9): [True: 43.2k, False: 127k]
  ------------------
  185|   170k|        IXHEAACE_MPS_DATA_MODE_FINECOARSE) {
  ------------------
  |  |  116|   170k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  186|  43.2k|      ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_data_pair[param_idx][ps], 1);
  187|  43.2k|      ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps],
  188|  43.2k|                          1);
  189|  43.2k|      ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][ps],
  190|  43.2k|                          2);
  191|       |
  192|  43.2k|      if (pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps] !=
  ------------------
  |  Branch (192:11): [True: 0, False: 43.2k]
  ------------------
  193|  43.2k|          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|  43.2k|      pb_stride = ixheaace_mps_212_get_bs_freq_res_stride(
  216|  43.2k|          pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][ps]);
  217|  43.2k|      data_bands = (WORD16)((stop_band - start_band - 1) / pb_stride + 1);
  218|       |
  219|  43.2k|      a_strides[0] = start_band;
  220|  1.19M|      for (pb = 1; pb <= data_bands; pb++) {
  ------------------
  |  Branch (220:20): [True: 1.15M, False: 43.2k]
  ------------------
  221|  1.15M|        a_strides[pb] = a_strides[pb - 1] + pb_stride;
  222|  1.15M|      }
  223|       |
  224|  43.2k|      str_offset = 0;
  225|  43.2k|      while (a_strides[data_bands] > stop_band) {
  ------------------
  |  Branch (225:14): [True: 0, False: 43.2k]
  ------------------
  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.19M|      for (pb = 0; pb < data_bands; pb++) {
  ------------------
  |  Branch (234:20): [True: 1.15M, False: 43.2k]
  ------------------
  235|  1.15M|        cmp_old_data[start_band + pb] = old_data[a_strides[pb]];
  236|  1.15M|        cmp_idx_data[0][start_band + pb] = data[ps][a_strides[pb]];
  237|       |
  238|  1.15M|        if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (238:13): [True: 0, False: 1.15M]
  ------------------
  239|      0|          cmp_idx_data[1][start_band + pb] = data[ps + 1][a_strides[pb]];
  240|      0|        }
  241|  1.15M|      }
  242|       |
  243|  43.2k|      if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (243:11): [True: 0, False: 43.2k]
  ------------------
  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|  43.2k|      } else {
  252|  43.2k|        error = ixheaace_mps_212_ec_data_single_enc(
  253|  43.2k|            pstr_bit_buf, cmp_idx_data, cmp_old_data, data_type, 0, start_band, data_bands,
  254|  43.2k|            pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps],
  255|  43.2k|            independency_flag && (ps == 0));
  ------------------
  |  Branch (255:13): [True: 13.1k, False: 30.1k]
  |  Branch (255:34): [True: 13.1k, False: 0]
  ------------------
  256|  43.2k|        if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  43.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (256:13): [True: 0, False: 43.2k]
  ------------------
  257|      0|          return error;
  258|      0|        }
  259|  43.2k|      }
  260|  1.19M|      for (i = start_band; i < stop_band; i++) {
  ------------------
  |  Branch (260:28): [True: 1.15M, False: 43.2k]
  ------------------
  261|  1.15M|        if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (261:13): [True: 0, False: 1.15M]
  ------------------
  262|      0|          old_data[i] = data[ps + 1][i];
  263|  1.15M|        } else {
  264|  1.15M|          old_data[i] = data[ps][i];
  265|  1.15M|        }
  266|  1.15M|      }
  267|       |
  268|  43.2k|      quant_coarse_xxx_prev[param_idx] = pstr_lossless_data->bs_quant_coarse_xxx[param_idx][ps];
  269|       |
  270|  43.2k|      if (pstr_lossless_data->bs_data_pair[param_idx][ps]) {
  ------------------
  |  Branch (270:11): [True: 0, False: 43.2k]
  ------------------
  271|      0|        ps++;
  272|      0|      }
  273|  43.2k|    }
  274|   170k|  }
  275|   170k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   170k|#define IA_NO_ERROR 0x00000000
  ------------------
  276|   170k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_get_bs_freq_res_stride:
   51|  43.2k|static UWORD8 ixheaace_mps_212_get_bs_freq_res_stride(const WORD32 index) {
   52|  43.2k|  WORD32 freq_res_stride_table_size = 0;
   53|  43.2k|  const UWORD8 *ptr_freq_res_stride_table = NULL;
   54|       |
   55|  43.2k|  ptr_freq_res_stride_table = freq_res_stride_table_212;
   56|  43.2k|  freq_res_stride_table_size =
   57|  43.2k|      sizeof(freq_res_stride_table_212) / sizeof(*freq_res_stride_table_212);
   58|       |
   59|  43.2k|  return (((index >= 0) && (index < freq_res_stride_table_size))
  ------------------
  |  Branch (59:12): [True: 43.2k, False: 0]
  |  Branch (59:28): [True: 43.2k, False: 0]
  ------------------
   60|  43.2k|              ? ptr_freq_res_stride_table[index]
   61|  43.2k|              : 1);
   62|  43.2k|}
ixheaace_mps_bitstream.c:ixheaace_mps_212_write_smg_data:
  281|  11.4k|                                            const WORD32 data_bands) {
  282|  11.4k|  WORD32 param, band;
  283|       |
  284|  22.8k|  for (param = 0; param < num_param_sets; param++) {
  ------------------
  |  Branch (284:19): [True: 11.4k, False: 11.4k]
  ------------------
  285|  11.4k|    ixheaace_write_bits(pstr_bit_buf, pstr_smg_data->bs_smooth_mode[param], 2);
  286|  11.4k|    if (pstr_smg_data->bs_smooth_mode[param] >= 2) {
  ------------------
  |  Branch (286:9): [True: 0, False: 11.4k]
  ------------------
  287|      0|      ixheaace_write_bits(pstr_bit_buf, pstr_smg_data->bs_smooth_time[param], 2);
  288|      0|    }
  289|  11.4k|    if (pstr_smg_data->bs_smooth_mode[param] == 3) {
  ------------------
  |  Branch (289:9): [True: 0, False: 11.4k]
  ------------------
  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|  11.4k|  }
  298|  11.4k|}
ixheaace_mps_bitstream.c:ixheaace_mps_515_ec_data:
  360|   152k|                                             WORD32 start_band, WORD32 stop_band) {
  361|   152k|  WORD32 param_set, set_idx, pb_stride, data_bands, bin, data_sets;
  362|   152k|  WORD32 param_set_index[MAX_NUM_PARAMS] = {0};
  363|       |
  364|   304k|  for (param_set = 0; param_set < num_param_sets; param_set++) {
  ------------------
  |  Branch (364:23): [True: 152k, False: 152k]
  ------------------
  365|   152k|    pstr_lossless_data->bs_xxx_data_mode[param_idx][param_set] =
  366|   152k|        IXHEAACE_MPS_DATA_MODE_FINECOARSE;
  ------------------
  |  |  116|   152k|#define IXHEAACE_MPS_DATA_MODE_FINECOARSE (3)
  ------------------
  367|   152k|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_xxx_data_mode[param_idx][param_set],
  368|   152k|                        2);
  369|   152k|  }
  370|       |
  371|   304k|  for (param_set = 0, set_idx = 0; param_set < num_param_sets; param_set++) {
  ------------------
  |  Branch (371:36): [True: 152k, False: 152k]
  ------------------
  372|   152k|    param_set_index[set_idx] = param_set;
  373|   152k|    if (param_set != num_param_sets - 1) {
  ------------------
  |  Branch (373:9): [True: 0, False: 152k]
  ------------------
  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|   152k|    } else {
  379|   152k|      pstr_lossless_data->bs_data_pair[param_idx][set_idx] = 0;
  380|   152k|      set_idx++;
  381|   152k|    }
  382|   152k|  }
  383|   152k|  data_sets = set_idx;
  384|       |
  385|   304k|  for (set_idx = 0; set_idx < data_sets;) {
  ------------------
  |  Branch (385:21): [True: 152k, False: 152k]
  ------------------
  386|   152k|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_data_pair[param_idx][set_idx], 1);
  387|   152k|    ixheaace_write_bits(pstr_bit_buf, pstr_lossless_data->bs_quant_coarse_xxx[param_idx][set_idx],
  388|   152k|                        1);
  389|   152k|    ixheaace_write_bits(pstr_bit_buf,
  390|   152k|                        pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][set_idx], 2);
  391|       |
  392|   152k|    pb_stride =
  393|   152k|        freq_res_stride_table[pstr_lossless_data->bs_freq_res_stride_xxx[param_idx][set_idx]];
  394|   152k|    data_bands = (stop_band - start_band - 1) / pb_stride + 1;
  395|       |
  396|   152k|    ixheaace_mps_515_ec_data_pair_enc(
  397|   152k|        pstr_bit_buf, data, old_data, data_type, param_set_index[set_idx], start_band, data_bands,
  398|   152k|        pstr_lossless_data->bs_data_pair[param_idx][set_idx],
  399|   152k|        pstr_lossless_data->bs_quant_coarse_xxx[param_idx][set_idx], independency_flag);
  400|       |
  401|   152k|    if (pstr_lossless_data->bs_data_pair[param_idx][set_idx]) {
  ------------------
  |  Branch (401:9): [True: 0, False: 152k]
  ------------------
  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|  8.68M|    for (bin = 0; bin < MAX_NUM_BINS; bin++) {
  ------------------
  |  |   41|  8.68M|#define MAX_NUM_BINS (56)
  ------------------
  |  Branch (412:19): [True: 8.52M, False: 152k]
  ------------------
  413|  8.52M|      old_data[bin] = data[param_set_index[set_idx] +
  414|  8.52M|                           pstr_lossless_data->bs_data_pair[param_idx][set_idx]][bin];
  415|  8.52M|    }
  416|       |
  417|   152k|    set_idx += pstr_lossless_data->bs_data_pair[param_idx][set_idx] + 1;
  418|   152k|  }
  419|   152k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   152k|#define IA_NO_ERROR 0x00000000
  ------------------
  420|   152k|}

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

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

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

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

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

ixheaace_mps_212_frame_window_init:
   79|  1.24k|    const ixheaace_mps_pstr_frame_win_config pstr_frame_win_config) {
   80|  1.24k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.24k|#define IA_NO_ERROR 0x00000000
  ------------------
   81|  1.24k|  WORD32 slot;
   82|  1.24k|  WORD32 time_slots = pstr_frame_win_config->num_time_slots_max;
   83|  1.24k|  pstr_frame_win->frame_keep_flag = pstr_frame_win_config->frame_keep_flag;
   84|  1.24k|  pstr_frame_win->num_time_slots_max = pstr_frame_win_config->num_time_slots_max;
   85|  1.24k|  pstr_frame_win->start_slope = 0;
   86|  1.24k|  pstr_frame_win->start_rect = time_slots >> 1;
   87|  1.24k|  pstr_frame_win->stop_slope = ((3 * time_slots) >> 1) - 1;
   88|  1.24k|  pstr_frame_win->stop_rect = time_slots;
   89|  22.0k|  for (slot = 0; slot<time_slots>> 1; slot++) {
  ------------------
  |  Branch (89:18): [True: 20.7k, False: 1.24k]
  ------------------
   90|  20.7k|    pstr_frame_win->p_tapper_sync_flt[slot] = (FLOAT32)slot / time_slots;
   91|  20.7k|  }
   92|  1.24k|  pstr_frame_win->p_tapper_sync_flt[time_slots >> 1] = 1.0f;
   93|  1.24k|  pstr_frame_win->taper_syn_len = time_slots >> 1;
   94|  1.24k|  pstr_frame_win->taper_ana_len = pstr_frame_win->start_rect - pstr_frame_win->start_slope;
   95|  22.0k|  for (slot = 0; slot < pstr_frame_win->taper_ana_len; slot++) {
  ------------------
  |  Branch (95:18): [True: 20.7k, False: 1.24k]
  ------------------
   96|  20.7k|    pstr_frame_win->p_taper_ana_flt[slot] = 1.0f;
   97|  20.7k|  }
   98|       |
   99|  1.24k|  return error;
  100|  1.24k|}
ixheaace_mps_212_frame_window_get_window:
  106|  85.3k|    ixheaace_mps_pstr_frame_win_list const pstr_frame_win_list, const WORD32 avoid_keep) {
  107|  85.3k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  108|  85.3k|  WORD32 win_cnt = 0;
  109|  85.3k|  WORD32 w, ps;
  110|  85.3k|  WORD32 idx;
  111|  85.3k|  WORD32 param;
  112|  85.3k|  WORD32 start_slope = pstr_frame_win->start_slope;
  113|  85.3k|  WORD32 start_rect = pstr_frame_win->start_rect;
  114|  85.3k|  WORD32 stop_slope = pstr_frame_win->stop_slope;
  115|  85.3k|  WORD32 stop_rect = pstr_frame_win->stop_rect;
  116|  85.3k|  WORD32 taper_ana_len = pstr_frame_win->taper_ana_len;
  117|  85.3k|  FLOAT32 apply_right_window_gain[MAX_NUM_PARAMS];
  118|  85.3k|  FLOAT32 *p_taper_ana = pstr_frame_win->p_taper_ana_flt;
  119|       |
  120|  85.3k|  if ((time_slots > pstr_frame_win->num_time_slots_max) || (time_slots < 0)) {
  ------------------
  |  Branch (120:7): [True: 0, False: 85.3k]
  |  Branch (120:60): [True: 0, False: 85.3k]
  ------------------
  121|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
  122|      0|  }
  123|       |
  124|  85.3k|  pstr_frame_win_list->win_list_cnt = 0;
  125|   682k|  for (param = 0; param < MAX_NUM_PARAMS; param++) {
  ------------------
  |  |   42|   682k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (125:19): [True: 597k, False: 85.3k]
  ------------------
  126|   597k|    pstr_frame_win_list->dat[param].slot = -1;
  127|   597k|    pstr_frame_win_list->dat[param].hold = IXHEAACE_MPS_FRAME_WINDOWING_INTP;
  ------------------
  |  |   84|   597k|#define IXHEAACE_MPS_FRAME_WINDOWING_INTP (0)
  ------------------
  128|   597k|  }
  129|  85.3k|  memset(apply_right_window_gain, 0, sizeof(apply_right_window_gain));
  130|  85.3k|  if (tr_pos[0] <= 0) {
  ------------------
  |  Branch (130:7): [True: 85.3k, False: 0]
  ------------------
  131|  85.3k|    win_cnt = 0;
  132|  85.3k|    error = ixheaace_mps_212_frame_window_list_add(pstr_frame_win_list, time_slots - 1,
  133|  85.3k|                                                   IXHEAACE_MPS_FRAME_WINDOWING_INTP);
  ------------------
  |  |   84|  85.3k|#define IXHEAACE_MPS_FRAME_WINDOWING_INTP (0)
  ------------------
  134|  85.3k|    if (error) {
  ------------------
  |  Branch (134:9): [True: 0, False: 85.3k]
  ------------------
  135|      0|      return error;
  136|      0|    }
  137|  85.3k|    for (idx = 0; idx < start_slope; idx++) {
  ------------------
  |  Branch (137:19): [True: 0, False: 85.3k]
  ------------------
  138|      0|      ptr_window_ana[win_cnt][idx] = 0.0f;
  139|      0|    }
  140|  1.54M|    for (idx = 0; idx < taper_ana_len; idx++) {
  ------------------
  |  Branch (140:19): [True: 1.46M, False: 85.3k]
  ------------------
  141|  1.46M|      ptr_window_ana[win_cnt][start_slope + idx] = p_taper_ana[idx];
  142|  1.46M|    }
  143|       |
  144|  1.55M|    for (idx = 0; idx < time_slots - start_rect; idx++) {
  ------------------
  |  Branch (144:19): [True: 1.47M, False: 85.3k]
  ------------------
  145|  1.47M|      ptr_window_ana[win_cnt][start_rect + idx] = 1.0f;
  146|  1.47M|    }
  147|       |
  148|  85.3k|    apply_right_window_gain[win_cnt] = 1.0f;
  149|  85.3k|    win_cnt++;
  150|  85.3k|  } 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|   170k|  for (w = 0; w < win_cnt; w++) {
  ------------------
  |  Branch (218:15): [True: 85.3k, False: 85.3k]
  ------------------
  219|  85.3k|    if (apply_right_window_gain[w] <= 0) {
  ------------------
  |  Branch (219:9): [True: 0, False: 85.3k]
  ------------------
  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|  85.3k|    } else {
  224|  85.3k|      if (tr_pos[1] < 0) {
  ------------------
  |  Branch (224:11): [True: 85.3k, False: 0]
  ------------------
  225|   170k|        for (idx = 0; idx < stop_rect - time_slots + 1; idx++) {
  ------------------
  |  Branch (225:23): [True: 85.3k, False: 85.3k]
  ------------------
  226|  85.3k|          ptr_window_ana[w][time_slots + idx] = 1.0f;
  227|  85.3k|        }
  228|  1.54M|        for (idx = 0; idx < taper_ana_len; idx++) {
  ------------------
  |  Branch (228:23): [True: 1.46M, False: 85.3k]
  ------------------
  229|  1.46M|          ptr_window_ana[w][stop_rect + idx] = p_taper_ana[taper_ana_len - 1 - idx];
  230|  1.46M|        }
  231|  1.55M|        for (idx = 0; idx < 2 * time_slots - stop_slope - 1; idx++) {
  ------------------
  |  Branch (231:23): [True: 1.47M, False: 85.3k]
  ------------------
  232|  1.47M|          ptr_window_ana[w][stop_slope + 1 + idx] = 0.0f;
  233|  1.47M|        }
  234|  85.3k|      } 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|  85.3k|      if (apply_right_window_gain[w] < 1.0f) {
  ------------------
  |  Branch (243:11): [True: 0, False: 85.3k]
  ------------------
  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|  85.3k|    }
  251|  85.3k|  }
  252|  85.3k|  if (pstr_frame_win->frame_keep_flag == 1) {
  ------------------
  |  Branch (252:7): [True: 85.3k, False: 0]
  ------------------
  253|  3.01M|    for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (253:19): [True: 2.93M, False: 85.3k]
  ------------------
  254|  2.93M|      ptr_window_ana[0][2 * time_slots + idx] = ptr_window_ana[0][time_slots + idx];
  255|  2.93M|      ptr_window_ana[0][time_slots + idx] = ptr_window_ana[0][idx];
  256|  2.93M|    }
  257|  85.3k|    if (avoid_keep == 0) {
  ------------------
  |  Branch (257:9): [True: 37.4k, False: 47.8k]
  ------------------
  258|  1.35M|      for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (258:21): [True: 1.31M, False: 37.4k]
  ------------------
  259|  1.31M|        ptr_window_ana[0][idx] = 1.0f;
  260|  1.31M|      }
  261|  47.8k|    } else {
  262|  1.66M|      for (idx = 0; idx < time_slots; idx++) {
  ------------------
  |  Branch (262:21): [True: 1.62M, False: 47.8k]
  ------------------
  263|  1.62M|        ptr_window_ana[0][idx] = 0.0f;
  264|  1.62M|      }
  265|  47.8k|    }
  266|  85.3k|  }
  267|  85.3k|  pstr_framing_info->num_param_sets = pstr_frame_win_list->win_list_cnt;
  268|  85.3k|  pstr_framing_info->bs_framing_type = 1;
  269|   170k|  for (ps = 0; ps < pstr_framing_info->num_param_sets; ps++) {
  ------------------
  |  Branch (269:16): [True: 85.3k, False: 85.3k]
  ------------------
  270|  85.3k|    pstr_framing_info->bs_param_slots[ps] = pstr_frame_win_list->dat[ps].slot;
  271|  85.3k|  }
  272|  85.3k|  if ((pstr_framing_info->num_param_sets == 1) &&
  ------------------
  |  Branch (272:7): [True: 85.3k, False: 0]
  ------------------
  273|  85.3k|      (pstr_framing_info->bs_param_slots[0] == time_slots - 1)) {
  ------------------
  |  Branch (273:7): [True: 85.3k, False: 0]
  ------------------
  274|  85.3k|    pstr_framing_info->bs_framing_type = 0;
  275|  85.3k|  }
  276|  85.3k|  return error;
  277|  85.3k|}
ixheaace_mps_212_analysis_windowing:
  283|   170k|    const WORD32 num_hybrid_bands) {
  284|   170k|  WORD32 band, slot;
  285|   170k|  FLOAT32 win;
  286|       |
  287|  11.5M|  for (slot = start_time_slot; slot < num_time_slots; slot++) {
  ------------------
  |  Branch (287:32): [True: 11.4M, False: 170k]
  ------------------
  288|  11.4M|    win = ptr_window_ana[slot];
  289|  11.4M|    if (win != 1.0f) {
  ------------------
  |  Branch (289:9): [True: 0, False: 11.4M]
  ------------------
  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|  11.4M|    } else {
  295|   742M|      for (band = 0; band < num_hybrid_bands; band++) {
  ------------------
  |  Branch (295:22): [True: 730M, False: 11.4M]
  ------------------
  296|   730M|        pp_cmplx_data_out[slot][band].re = pp_cmplx_data_in[slot][band].re;
  297|   730M|        pp_cmplx_data_out[slot][band].im = pp_cmplx_data_in[slot][band].im;
  298|   730M|      }
  299|  11.4M|    }
  300|  11.4M|  }
  301|   170k|}
ixheaace_mps_frame_windowing.c:ixheaace_mps_212_frame_window_list_add:
   60|  85.3k|    const WORD32 hold) {
   61|  85.3k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  85.3k|#define IA_NO_ERROR 0x00000000
  ------------------
   62|       |
   63|  85.3k|  if (pstr_frame_win_list->win_list_cnt >= MAX_NUM_PARAMS) {
  ------------------
  |  |   42|  85.3k|#define MAX_NUM_PARAMS (7)
  ------------------
  |  Branch (63:7): [True: 0, False: 85.3k]
  ------------------
   64|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_PARAM_ERROR;
   65|  85.3k|  } else if (pstr_frame_win_list->win_list_cnt > 0 &&
  ------------------
  |  Branch (65:14): [True: 0, False: 85.3k]
  ------------------
   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|  85.3k|  } else {
   69|  85.3k|    pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt].hold = hold;
   70|  85.3k|    pstr_frame_win_list->dat[pstr_frame_win_list->win_list_cnt].slot = slot;
   71|  85.3k|    pstr_frame_win_list->win_list_cnt++;
   72|  85.3k|  }
   73|  85.3k|  return error;
   74|  85.3k|}

ixheaace_mps_515_apply_ana_hyb_filterbank:
  859|   118k|    FLOAT32 *ptr_hybrid_imag) {
  860|   118k|  WORD32 nr_samples_shift_lf;
  861|   118k|  WORD32 nr_qmf_bands_lf;
  862|   118k|  WORD32 k, n;
  863|   118k|  WORD32 time_slot, ch_offset;
  864|       |
  865|   118k|  FLOAT32 m_temp_output_real[MAX_HYBRID_ONLY_BANDS_PER_QMF] = {0};
  866|   118k|  FLOAT32 m_temp_output_imag[MAX_HYBRID_ONLY_BANDS_PER_QMF] = {0};
  867|       |
  868|   118k|  nr_samples_shift_lf = BUFFER_LEN_LF - nr_samples;
  ------------------
  |  |   32|   118k|#define BUFFER_LEN_LF (PROTO_LEN - 1 + MAX_TIME_SLOTS)
  |  |  ------------------
  |  |  |  |   31|   118k|#define PROTO_LEN (13)
  |  |  ------------------
  |  |               #define BUFFER_LEN_LF (PROTO_LEN - 1 + MAX_TIME_SLOTS)
  |  |  ------------------
  |  |  |  |   44|   118k|#define MAX_TIME_SLOTS (64)
  |  |  ------------------
  ------------------
  869|       |
  870|   118k|  nr_qmf_bands_lf = NUM_QMF_BANDS_TO_LF;
  ------------------
  |  |   39|   118k|#define NUM_QMF_BANDS_TO_LF (3)
  ------------------
  871|   473k|  for (k = 0; k < nr_qmf_bands_lf; k++) {
  ------------------
  |  Branch (871:15): [True: 354k, False: 118k]
  ------------------
  872|  21.8M|    for (n = 0; n < nr_samples_shift_lf; n++) {
  ------------------
  |  Branch (872:17): [True: 21.4M, False: 354k]
  ------------------
  873|  21.4M|      pstr_hyb_filter_state->buffer_lf_real[k][n] =
  874|  21.4M|          pstr_hyb_filter_state->buffer_lf_real[k][n + nr_samples];
  875|  21.4M|      pstr_hyb_filter_state->buffer_lf_imag[k][n] =
  876|  21.4M|          pstr_hyb_filter_state->buffer_lf_imag[k][n + nr_samples];
  877|  21.4M|    }
  878|   354k|  }
  879|       |
  880|   473k|  for (k = 0; k < nr_qmf_bands_lf; k++) {
  ------------------
  |  Branch (880:15): [True: 354k, False: 118k]
  ------------------
  881|  5.85M|    for (n = 0; n < nr_samples; n++) {
  ------------------
  |  Branch (881:17): [True: 5.50M, False: 354k]
  ------------------
  882|  5.50M|      pstr_hyb_filter_state->buffer_lf_real[k][n + nr_samples_shift_lf] =
  883|  5.50M|          ptr_qmf_real[n * NUM_QMF_BANDS + k];
  ------------------
  |  |   43|  5.50M|#define NUM_QMF_BANDS (64)
  ------------------
  884|  5.50M|      pstr_hyb_filter_state->buffer_lf_imag[k][n + nr_samples_shift_lf] =
  885|  5.50M|          ptr_qmf_imag[n * NUM_QMF_BANDS + k];
  ------------------
  |  |   43|  5.50M|#define NUM_QMF_BANDS (64)
  ------------------
  886|  5.50M|    }
  887|   354k|  }
  888|  7.33M|  for (k = 0; k < NUM_QMF_BANDS - nr_qmf_bands_lf; k++) {
  ------------------
  |  |   43|  7.33M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (888:15): [True: 7.21M, False: 118k]
  ------------------
  889|  50.5M|    for (n = 0; n < BUFFER_LEN_HF; n++) {
  ------------------
  |  |   34|  50.5M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  50.5M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
  |  Branch (889:17): [True: 43.2M, False: 7.21M]
  ------------------
  890|  43.2M|      ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  43.2M|#define MAX_HYBRID_BANDS (71)
  ------------------
  891|  43.2M|          pstr_hyb_filter_state->buffer_hf_real[k][n];
  892|  43.2M|      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  43.2M|#define MAX_HYBRID_BANDS (71)
  ------------------
  893|  43.2M|          pstr_hyb_filter_state->buffer_hf_imag[k][n];
  894|       |
  895|  43.2M|      pstr_hyb_filter_state->buffer_hf_real[k][n] =
  896|  43.2M|          ptr_qmf_real[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  43.2M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  43.2M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_real[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  43.2M|#define NUM_QMF_BANDS (64)
  ------------------
  897|  43.2M|      pstr_hyb_filter_state->buffer_hf_imag[k][n] =
  898|  43.2M|          ptr_qmf_imag[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  43.2M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  43.2M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_imag[(nr_samples - BUFFER_LEN_HF + n) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  43.2M|#define NUM_QMF_BANDS (64)
  ------------------
  899|  43.2M|    }
  900|  7.21M|  }
  901|       |
  902|  7.33M|  for (k = 0; k < NUM_QMF_BANDS - nr_qmf_bands_lf; k++) {
  ------------------
  |  |   43|  7.33M|#define NUM_QMF_BANDS (64)
  ------------------
  |  Branch (902:15): [True: 7.21M, False: 118k]
  ------------------
  903|  75.8M|    for (n = BUFFER_LEN_HF; n < nr_samples; n++) {
  ------------------
  |  |   34|  7.21M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  7.21M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
  |  Branch (903:29): [True: 68.6M, False: 7.21M]
  ------------------
  904|  68.6M|      ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  68.6M|#define MAX_HYBRID_BANDS (71)
  ------------------
  905|  68.6M|          ptr_qmf_real[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  68.6M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  68.6M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_real[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  68.6M|#define NUM_QMF_BANDS (64)
  ------------------
  906|  68.6M|      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10] =
  ------------------
  |  |   23|  68.6M|#define MAX_HYBRID_BANDS (71)
  ------------------
  907|  68.6M|          ptr_qmf_imag[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   34|  68.6M|#define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)
  |  |  ------------------
  |  |  |  |   31|  68.6M|#define PROTO_LEN (13)
  |  |  ------------------
  ------------------
                        ptr_qmf_imag[(n - BUFFER_LEN_HF) * NUM_QMF_BANDS + k + nr_qmf_bands_lf];
  ------------------
  |  |   43|  68.6M|#define NUM_QMF_BANDS (64)
  ------------------
  908|  68.6M|    }
  909|  7.21M|  }
  910|       |
  911|  1.95M|  for (time_slot = 0; time_slot < nr_samples; time_slot++) {
  ------------------
  |  Branch (911:23): [True: 1.83M, False: 118k]
  ------------------
  912|  1.83M|    ch_offset = 0;
  913|       |
  914|  1.83M|    ixheaace_mps_eight_channel_filtering(
  915|  1.83M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_real[0][nr_samples_shift_lf + 1 -
  916|  1.83M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  1.83M|#define PROTO_LEN (13)
  ------------------
  917|  1.83M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_imag[0][nr_samples_shift_lf + 1 -
  918|  1.83M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  1.83M|#define PROTO_LEN (13)
  ------------------
  919|  1.83M|        m_temp_output_real, m_temp_output_imag);
  920|       |
  921|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 0] = m_temp_output_real[6];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  922|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 0] = m_temp_output_imag[6];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  923|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_real[7];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  924|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_imag[7];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  925|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 2] = m_temp_output_real[0];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  926|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 2] = m_temp_output_imag[0];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  927|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 3] = m_temp_output_real[1];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  928|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 3] = m_temp_output_imag[1];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  929|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 4] =
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  930|  1.83M|        m_temp_output_real[2] + m_temp_output_real[5];
  931|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 4] =
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  932|  1.83M|        m_temp_output_imag[2] + m_temp_output_imag[5];
  933|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 5] =
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  934|  1.83M|        m_temp_output_real[3] + m_temp_output_real[4];
  935|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 5] =
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  936|  1.83M|        m_temp_output_imag[3] + m_temp_output_imag[4];
  937|       |
  938|  1.83M|    ch_offset += 6;
  939|       |
  940|  1.83M|    ixheaace_mps_two_channel_filtering(
  941|  1.83M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_real[1][nr_samples_shift_lf + 1 -
  942|  1.83M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  1.83M|#define PROTO_LEN (13)
  ------------------
  943|  1.83M|        m_temp_output_real);
  944|  1.83M|    ixheaace_mps_two_channel_filtering(
  945|  1.83M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_imag[1][nr_samples_shift_lf + 1 -
  946|  1.83M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  1.83M|#define PROTO_LEN (13)
  ------------------
  947|  1.83M|        m_temp_output_imag);
  948|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_real[1];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  949|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_imag[1];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  950|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_real[0];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  951|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_imag[0];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  952|       |
  953|  1.83M|    ch_offset += 2;
  954|       |
  955|  1.83M|    ixheaace_mps_two_channel_filtering(
  956|  1.83M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_real[2][nr_samples_shift_lf + 1 -
  957|  1.83M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  1.83M|#define PROTO_LEN (13)
  ------------------
  958|  1.83M|        m_temp_output_real);
  959|  1.83M|    ixheaace_mps_two_channel_filtering(
  960|  1.83M|        (const FLOAT32 *)&(pstr_hyb_filter_state->buffer_lf_imag[2][nr_samples_shift_lf + 1 -
  961|  1.83M|                                                                    PROTO_LEN + time_slot]),
  ------------------
  |  |   31|  1.83M|#define PROTO_LEN (13)
  ------------------
  962|  1.83M|        m_temp_output_imag);
  963|       |
  964|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_real[0];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  965|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset] = m_temp_output_imag[0];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  966|  1.83M|    ptr_hybrid_real[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_real[1];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  967|  1.83M|    ptr_hybrid_imag[time_slot * MAX_HYBRID_BANDS + ch_offset + 1] = m_temp_output_imag[1];
  ------------------
  |  |   23|  1.83M|#define MAX_HYBRID_BANDS (71)
  ------------------
  968|  1.83M|  }
  969|   118k|}
ixheaace_mps_515_apply_syn_hyb_filterbank:
  973|  32.2k|                                               FLOAT32 *ptr_qmf_imag) {
  974|  32.2k|  WORD32 k, n;
  975|       |
  976|   533k|  for (n = 0; n < nr_samples; n++) {
  ------------------
  |  Branch (976:15): [True: 501k, False: 32.2k]
  ------------------
  977|   501k|    ptr_qmf_real[n * NUM_QMF_BANDS] = ptr_hybrid_real[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   43|   501k|#define NUM_QMF_BANDS (64)
  ------------------
                  ptr_qmf_real[n * NUM_QMF_BANDS] = ptr_hybrid_real[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
  978|   501k|    ptr_qmf_imag[n * NUM_QMF_BANDS] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   43|   501k|#define NUM_QMF_BANDS (64)
  ------------------
                  ptr_qmf_imag[n * NUM_QMF_BANDS] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
  979|       |
  980|  3.00M|    for (k = 1; k < 6; k++) {
  ------------------
  |  Branch (980:17): [True: 2.50M, False: 501k]
  ------------------
  981|  2.50M|      ptr_qmf_real[n * NUM_QMF_BANDS] += ptr_hybrid_real[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   43|  2.50M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_real[n * NUM_QMF_BANDS] += ptr_hybrid_real[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   23|  2.50M|#define MAX_HYBRID_BANDS (71)
  ------------------
  982|  2.50M|      ptr_qmf_imag[n * NUM_QMF_BANDS] += ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   43|  2.50M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_imag[n * NUM_QMF_BANDS] += ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k];
  ------------------
  |  |   23|  2.50M|#define MAX_HYBRID_BANDS (71)
  ------------------
  983|  2.50M|    }
  984|       |
  985|   501k|    ptr_qmf_real[n * NUM_QMF_BANDS + 1] =
  ------------------
  |  |   43|   501k|#define NUM_QMF_BANDS (64)
  ------------------
  986|   501k|        ptr_hybrid_real[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_real[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
  987|   501k|    ptr_qmf_imag[n * NUM_QMF_BANDS + 1] =
  ------------------
  |  |   43|   501k|#define NUM_QMF_BANDS (64)
  ------------------
  988|   501k|        ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 6] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 7];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
  989|       |
  990|   501k|    ptr_qmf_real[n * NUM_QMF_BANDS + 2] =
  ------------------
  |  |   43|   501k|#define NUM_QMF_BANDS (64)
  ------------------
  991|   501k|        ptr_hybrid_real[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_real[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_real[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
  992|   501k|    ptr_qmf_imag[n * NUM_QMF_BANDS + 2] =
  ------------------
  |  |   43|   501k|#define NUM_QMF_BANDS (64)
  ------------------
  993|   501k|        ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
                      ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 8] + ptr_hybrid_imag[n * MAX_HYBRID_BANDS + 9];
  ------------------
  |  |   23|   501k|#define MAX_HYBRID_BANDS (71)
  ------------------
  994|       |
  995|  31.0M|    for (k = 0; k < 61; k++) {
  ------------------
  |  Branch (995:17): [True: 30.5M, False: 501k]
  ------------------
  996|  30.5M|      ptr_qmf_real[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   43|  30.5M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_real[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_real[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   23|  30.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  997|  30.5M|      ptr_qmf_imag[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   43|  30.5M|#define NUM_QMF_BANDS (64)
  ------------------
                    ptr_qmf_imag[n * NUM_QMF_BANDS + k + 3] = ptr_hybrid_imag[n * MAX_HYBRID_BANDS + k + 10];
  ------------------
  |  |   23|  30.5M|#define MAX_HYBRID_BANDS (71)
  ------------------
  998|  30.5M|    }
  999|   501k|  }
 1000|  32.2k|}
ixheaace_mps_hybrid_filter.c:ixheaace_mps_eight_channel_filtering:
  788|  1.83M|                                                         FLOAT32 *ptr_hybrid_imag) {
  789|  1.83M|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.83M|#define IA_NO_ERROR 0x00000000
  ------------------
  790|  1.83M|  WORD32 idx;
  791|  1.83M|  FLOAT32 ptr_real, ptr_imag;
  792|  1.83M|  FLOAT32 cum[16];
  793|       |
  794|  1.83M|  cum[0] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_real[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  1.83M|#define HYBRID_FILTER_DELAY (6)
  ------------------
                cum[0] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_real[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  1.83M|#define HYBRID_FILTER_DELAY (6)
  ------------------
  795|  1.83M|  cum[1] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_imag[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  1.83M|#define HYBRID_FILTER_DELAY (6)
  ------------------
                cum[1] = p8_13[HYBRID_FILTER_DELAY] * ptr_qmf_imag[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  1.83M|#define HYBRID_FILTER_DELAY (6)
  ------------------
  796|       |
  797|  1.83M|  ptr_real = p8_13[5] * ptr_qmf_real[5];
  798|  1.83M|  ptr_imag = p8_13[5] * ptr_qmf_imag[5];
  799|  1.83M|  cum[2] = ptr_real * COS_22_5 - ptr_imag * SIN_22_5;
  ------------------
  |  |  173|  1.83M|#define COS_22_5 (0.92387953251129f)
  ------------------
                cum[2] = ptr_real * COS_22_5 - ptr_imag * SIN_22_5;
  ------------------
  |  |  176|  1.83M|#define SIN_22_5 (0.38268343236509f)
  ------------------
  800|  1.83M|  cum[3] = ptr_real * COS_67_5 + ptr_imag * SIN_67_5;
  ------------------
  |  |  174|  1.83M|#define COS_67_5 (0.38268343236509f)
  ------------------
                cum[3] = ptr_real * COS_67_5 + ptr_imag * SIN_67_5;
  ------------------
  |  |  175|  1.83M|#define SIN_67_5 (0.92387953251129f)
  ------------------
  801|       |
  802|  1.83M|  ptr_real = p8_13[4] * ptr_qmf_real[4] + p8_13[12] * ptr_qmf_real[12];
  803|  1.83M|  ptr_imag = p8_13[4] * ptr_qmf_imag[4] + p8_13[12] * ptr_qmf_imag[12];
  804|  1.83M|  cum[4] = (ptr_imag - ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  1.83M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  805|  1.83M|  cum[5] = -(ptr_imag + ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  1.83M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  806|       |
  807|  1.83M|  ptr_real = p8_13[3] * ptr_qmf_real[3] + p8_13[11] * ptr_qmf_real[11];
  808|  1.83M|  ptr_imag = p8_13[3] * ptr_qmf_imag[3] + p8_13[11] * ptr_qmf_imag[11];
  809|  1.83M|  cum[6] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  175|  1.83M|#define SIN_67_5 (0.92387953251129f)
  ------------------
                cum[6] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  174|  1.83M|#define COS_67_5 (0.38268343236509f)
  ------------------
  810|  1.83M|  cum[7] = -(ptr_imag * SIN_22_5 + ptr_real * COS_22_5);
  ------------------
  |  |  176|  1.83M|#define SIN_22_5 (0.38268343236509f)
  ------------------
                cum[7] = -(ptr_imag * SIN_22_5 + ptr_real * COS_22_5);
  ------------------
  |  |  173|  1.83M|#define COS_22_5 (0.92387953251129f)
  ------------------
  811|  1.83M|  cum[9] = -(p8_13[2] * ptr_qmf_real[2] + p8_13[10] * ptr_qmf_real[10]);
  812|  1.83M|  cum[8] = p8_13[2] * ptr_qmf_imag[2] + p8_13[10] * ptr_qmf_imag[10];
  813|       |
  814|  1.83M|  ptr_real = p8_13[1] * ptr_qmf_real[1] + p8_13[9] * ptr_qmf_real[9];
  815|  1.83M|  ptr_imag = p8_13[1] * ptr_qmf_imag[1] + p8_13[9] * ptr_qmf_imag[9];
  816|  1.83M|  cum[10] = ptr_imag * SIN_67_5 + ptr_real * COS_67_5;
  ------------------
  |  |  175|  1.83M|#define SIN_67_5 (0.92387953251129f)
  ------------------
                cum[10] = ptr_imag * SIN_67_5 + ptr_real * COS_67_5;
  ------------------
  |  |  174|  1.83M|#define COS_67_5 (0.38268343236509f)
  ------------------
  817|  1.83M|  cum[11] = ptr_imag * SIN_22_5 - ptr_real * COS_22_5;
  ------------------
  |  |  176|  1.83M|#define SIN_22_5 (0.38268343236509f)
  ------------------
                cum[11] = ptr_imag * SIN_22_5 - ptr_real * COS_22_5;
  ------------------
  |  |  173|  1.83M|#define COS_22_5 (0.92387953251129f)
  ------------------
  818|       |
  819|  1.83M|  ptr_real = p8_13[0] * ptr_qmf_real[0] + p8_13[8] * ptr_qmf_real[8];
  820|  1.83M|  ptr_imag = p8_13[0] * ptr_qmf_imag[0] + p8_13[8] * ptr_qmf_imag[8];
  821|  1.83M|  cum[12] = (ptr_imag + ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  1.83M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  822|  1.83M|  cum[13] = (ptr_imag - ptr_real) * INV_SQRT_2;
  ------------------
  |  |  177|  1.83M|#define INV_SQRT_2 (0.70710678118655f)
  ------------------
  823|       |
  824|  1.83M|  ptr_real = p8_13[7] * ptr_qmf_real[7];
  825|  1.83M|  ptr_imag = p8_13[7] * ptr_qmf_imag[7];
  826|  1.83M|  cum[14] = ptr_imag * SIN_22_5 + ptr_real * COS_22_5;
  ------------------
  |  |  176|  1.83M|#define SIN_22_5 (0.38268343236509f)
  ------------------
                cum[14] = ptr_imag * SIN_22_5 + ptr_real * COS_22_5;
  ------------------
  |  |  173|  1.83M|#define COS_22_5 (0.92387953251129f)
  ------------------
  827|  1.83M|  cum[15] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  175|  1.83M|#define SIN_67_5 (0.92387953251129f)
  ------------------
                cum[15] = ptr_imag * SIN_67_5 - ptr_real * COS_67_5;
  ------------------
  |  |  174|  1.83M|#define COS_67_5 (0.38268343236509f)
  ------------------
  828|       |
  829|  1.83M|  error = ixheaace_mps_cfftn_process(&cum[0], &cum[1], 8, 8, 8, 2);
  830|  1.83M|  if (error) {
  ------------------
  |  Branch (830:7): [True: 0, False: 1.83M]
  ------------------
  831|      0|    return error;
  832|      0|  }
  833|  16.5M|  for (idx = 0; idx < 8; idx++) {
  ------------------
  |  Branch (833:17): [True: 14.6M, False: 1.83M]
  ------------------
  834|  14.6M|    ptr_hybrid_real[idx] = cum[2 * idx];
  835|  14.6M|    ptr_hybrid_imag[idx] = cum[2 * idx + 1];
  836|  14.6M|  }
  837|  1.83M|  return error;
  838|  1.83M|}
ixheaace_mps_hybrid_filter.c:ixheaace_mps_cfftn_process:
   42|  1.83M|                                               WORD32 i_sign) {
   43|  1.83M|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  1.83M|#define IA_NO_ERROR 0x00000000
  ------------------
   44|  1.83M|  WORD32 repeat = 0;
   45|  1.83M|  FLOAT64 sine_60 = SIN_60;
  ------------------
  |  |  170|  1.83M|#define SIN_60 0.86602540378443865
  ------------------
   46|  1.83M|  FLOAT64 cos_72 = COS_72;
  ------------------
  |  |  171|  1.83M|#define COS_72 0.30901699437494742
  ------------------
   47|  1.83M|  FLOAT64 sin_72 = SIN_72;
  ------------------
  |  |  172|  1.83M|#define SIN_72 0.95105651629515357
  ------------------
   48|  1.83M|  FLOAT64 pi2 = M_PI;
   49|  1.83M|  WORD32 ii, mfactor, kspan, ispan, inc;
   50|  1.83M|  WORD32 j, jc, jf, jj, k, k1, k2, k3 = 0, k4, kk, kt, nn, ns, nt;
   51|       |
   52|  1.83M|  FLOAT64 radf;
   53|  1.83M|  FLOAT64 c1, c2 = 0.0, c3 = 0.0, cd;
   54|  1.83M|  FLOAT64 s1, s2 = 0.0, s3 = 0.0, sd;
   55|  1.83M|  FLOAT32 temp_real, temp_imag, temp_real_1, temp_imag_1, temp_real_2, temp_imag_2, temp_real_3,
   56|  1.83M|      temp_imag_3, temp_real_4, temp_imag_4, aj, bj, aa, bb;
   57|       |
   58|  1.83M|  FLOAT32 temp_real_array[MAX_FACTORS] = {0};
   59|  1.83M|  FLOAT32 temp_imag_array[MAX_FACTORS] = {0};
   60|  1.83M|  FLOAT64 cos_array[MAX_FACTORS] = {0};
   61|  1.83M|  FLOAT64 sin_array[MAX_FACTORS] = {0};
   62|       |
   63|  1.83M|  WORD32 perm[MAX_PERM] = {0};
   64|  1.83M|  WORD32 factor[NFACTOR] = {0};
   65|  1.83M|  if (n_pass < 2) {
  ------------------
  |  Branch (65:7): [True: 0, False: 1.83M]
  ------------------
   66|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_CFFT_PROCESS;
   67|      0|  }
   68|       |
   69|  1.83M|  ptr_real--;
   70|  1.83M|  ptr_imag--;
   71|  1.83M|  inc = i_sign;
   72|  1.83M|  if (i_sign < 0) {
  ------------------
  |  Branch (72:7): [True: 0, False: 1.83M]
  ------------------
   73|      0|    sin_72 = -sin_72;
   74|      0|    sine_60 = -sine_60;
   75|      0|    pi2 = -pi2;
   76|      0|    inc = -inc;
   77|      0|  }
   78|  1.83M|  ii = 0;
   79|  1.83M|  jf = 0;
   80|  1.83M|  mfactor = 0;
   81|  1.83M|  j = 3;
   82|       |
   83|  1.83M|  nt = inc * n_total;
   84|  1.83M|  ns = inc * n_span;
   85|  1.83M|  kspan = ns;
   86|  1.83M|  nn = nt - inc;
   87|  1.83M|  jc = ns / n_pass;
   88|  1.83M|  radf = pi2 * (FLOAT64)jc;
   89|  1.83M|  pi2 *= 2.0;
   90|  1.83M|  k = n_pass;
   91|       |
   92|  1.83M|  while (k % 16 == 0) {
  ------------------
  |  Branch (92:10): [True: 0, False: 1.83M]
  ------------------
   93|      0|    mfactor++;
   94|      0|    factor[mfactor - 1] = 4;
   95|      0|    k /= 16;
   96|      0|  }
   97|       |
   98|  1.83M|  jj = 9;
   99|  1.83M|  do {
  100|  1.83M|    while (k % jj == 0) {
  ------------------
  |  Branch (100:12): [True: 0, False: 1.83M]
  ------------------
  101|      0|      mfactor++;
  102|      0|      factor[mfactor - 1] = j;
  103|      0|      k /= jj;
  104|      0|    }
  105|  1.83M|    j += 2;
  106|  1.83M|    jj = j * j;
  107|  1.83M|  } while (jj <= k);
  ------------------
  |  Branch (107:12): [True: 0, False: 1.83M]
  ------------------
  108|       |
  109|  1.83M|  if (k > 4) {
  ------------------
  |  Branch (109:7): [True: 1.83M, False: 0]
  ------------------
  110|  1.83M|    if (k - (k / 4 << 2) == 0) {
  ------------------
  |  Branch (110:9): [True: 1.83M, False: 0]
  ------------------
  111|  1.83M|      mfactor++;
  112|  1.83M|      factor[mfactor - 1] = 2;
  113|  1.83M|      k /= 4;
  114|  1.83M|    }
  115|       |
  116|  1.83M|    kt = mfactor;
  117|  1.83M|    j = 2;
  118|       |
  119|  1.83M|    do {
  120|  1.83M|      if (k % j == 0) {
  ------------------
  |  Branch (120:11): [True: 1.83M, False: 0]
  ------------------
  121|  1.83M|        mfactor++;
  122|  1.83M|        factor[mfactor - 1] = j;
  123|  1.83M|        k /= j;
  124|  1.83M|      }
  125|  1.83M|      j = ((j + 1) / 2 << 1) + 1;
  126|  1.83M|    } while (j <= k);
  ------------------
  |  Branch (126:14): [True: 0, False: 1.83M]
  ------------------
  127|  1.83M|  } 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|  1.83M|  if (kt) {
  ------------------
  |  Branch (135:7): [True: 1.83M, False: 0]
  ------------------
  136|  1.83M|    j = kt;
  137|  1.83M|    do {
  138|  1.83M|      mfactor++;
  139|  1.83M|      factor[mfactor - 1] = factor[j - 1];
  140|  1.83M|      j--;
  141|  1.83M|    } while (j);
  ------------------
  |  Branch (141:14): [True: 0, False: 1.83M]
  ------------------
  142|  1.83M|  }
  143|       |
  144|  1.83M|  if (mfactor > NFACTOR) {
  ------------------
  |  |  166|  1.83M|#define NFACTOR 11
  ------------------
  |  Branch (144:7): [True: 0, False: 1.83M]
  ------------------
  145|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_CFFT_PROCESS;
  146|      0|  }
  147|       |
  148|  5.50M|  do {
  149|  5.50M|    sd = radf / (FLOAT64)kspan;
  150|  5.50M|    cd = sin(sd);
  151|  5.50M|    cd = 2.0 * cd * cd;
  152|  5.50M|    sd = sin(sd + sd);
  153|  5.50M|    kk = 1;
  154|  5.50M|    ii++;
  155|  5.50M|    switch (factor[ii - 1]) {
  156|      0|      case 4:
  ------------------
  |  Branch (156:7): [True: 0, False: 5.50M]
  ------------------
  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|  5.50M|      case 2:
  ------------------
  |  Branch (240:7): [True: 5.50M, False: 0]
  ------------------
  241|  5.50M|        kspan /= 2;
  242|  5.50M|        k1 = kspan + 2;
  243|  5.50M|        do {
  244|  12.8M|          do {
  245|  12.8M|            k2 = kk + kspan;
  246|  12.8M|            temp_real = ptr_real[k2];
  247|  12.8M|            temp_imag = ptr_imag[k2];
  248|  12.8M|            ptr_real[k2] = ptr_real[kk] - temp_real;
  249|  12.8M|            ptr_imag[k2] = ptr_imag[kk] - temp_imag;
  250|  12.8M|            ptr_real[kk] += temp_real;
  251|  12.8M|            ptr_imag[kk] += temp_imag;
  252|  12.8M|            kk = k2 + kspan;
  253|  12.8M|          } while (kk <= nn);
  ------------------
  |  Branch (253:20): [True: 7.33M, False: 5.50M]
  ------------------
  254|       |
  255|  5.50M|          kk -= nn;
  256|  5.50M|        } while (kk <= jc);
  ------------------
  |  Branch (256:18): [True: 0, False: 5.50M]
  ------------------
  257|       |
  258|  5.50M|        if (kk > kspan) {
  ------------------
  |  Branch (258:13): [True: 1.83M, False: 3.66M]
  ------------------
  259|  1.83M|          repeat = 1;
  260|  1.83M|          break;
  261|  1.83M|        }
  262|       |
  263|  3.66M|        do {
  264|  3.66M|          c1 = 1.0 - cd;
  265|  3.66M|          s1 = sd;
  266|  5.50M|          do {
  267|  7.33M|            do {
  268|  9.17M|              do {
  269|  9.17M|                k2 = kk + kspan;
  270|  9.17M|                temp_real = ptr_real[kk] - ptr_real[k2];
  271|  9.17M|                temp_imag = ptr_imag[kk] - ptr_imag[k2];
  272|       |
  273|  9.17M|                ptr_real[kk] += ptr_real[k2];
  274|  9.17M|                ptr_imag[kk] += ptr_imag[k2];
  275|       |
  276|  9.17M|                ptr_real[k2] = (FLOAT32)(c1 * temp_real - s1 * temp_imag);
  277|  9.17M|                ptr_imag[k2] = (FLOAT32)(s1 * temp_real + c1 * temp_imag);
  278|       |
  279|  9.17M|                kk = k2 + kspan;
  280|  9.17M|              } while (kk < nt);
  ------------------
  |  Branch (280:24): [True: 1.83M, False: 7.33M]
  ------------------
  281|       |
  282|  7.33M|              k2 = kk - nt;
  283|  7.33M|              c1 = -c1;
  284|  7.33M|              kk = k1 - k2;
  285|  7.33M|            } while (kk > k2);
  ------------------
  |  Branch (285:22): [True: 1.83M, False: 5.50M]
  ------------------
  286|       |
  287|  5.50M|            temp_real = (FLOAT32)(c1 - (cd * c1 + sd * s1));
  288|  5.50M|            s1 = sd * c1 - cd * s1 + s1;
  289|  5.50M|            c1 = 2.0 - (temp_real * temp_real + s1 * s1);
  290|       |
  291|  5.50M|            s1 *= c1;
  292|  5.50M|            c1 *= temp_real;
  293|  5.50M|            kk += jc;
  294|  5.50M|          } while (kk < k2);
  ------------------
  |  Branch (294:20): [True: 1.83M, False: 3.66M]
  ------------------
  295|       |
  296|  3.66M|          k1 += inc + inc;
  297|  3.66M|          kk = (k1 - kspan) / 2 + jc;
  298|  3.66M|        } while (kk <= jc + jc);
  ------------------
  |  Branch (298:18): [True: 0, False: 3.66M]
  ------------------
  299|  3.66M|        break;
  300|      0|      default:
  ------------------
  |  Branch (300:7): [True: 0, False: 5.50M]
  ------------------
  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|  5.50M|    }
  536|  5.50M|  } while (repeat == 0);
  ------------------
  |  Branch (536:12): [True: 3.66M, False: 1.83M]
  ------------------
  537|       |
  538|  1.83M|  perm[0] = ns;
  539|       |
  540|  1.83M|  if (kt) {
  ------------------
  |  Branch (540:7): [True: 1.83M, False: 0]
  ------------------
  541|  1.83M|    k = kt + kt + 1;
  542|  1.83M|    if (mfactor < k) {
  ------------------
  |  Branch (542:9): [True: 0, False: 1.83M]
  ------------------
  543|      0|      k--;
  544|      0|    }
  545|       |
  546|  1.83M|    j = 1;
  547|  1.83M|    perm[k] = jc;
  548|       |
  549|  1.83M|    do {
  550|  1.83M|      perm[j] = perm[j - 1] / factor[j - 1];
  551|  1.83M|      perm[k - 1] = perm[k] * factor[j - 1];
  552|       |
  553|  1.83M|      j++;
  554|  1.83M|      k--;
  555|  1.83M|    } while (j < k);
  ------------------
  |  Branch (555:14): [True: 0, False: 1.83M]
  ------------------
  556|       |
  557|  1.83M|    k3 = perm[k];
  558|  1.83M|    kspan = perm[1];
  559|  1.83M|    kk = jc + 1;
  560|  1.83M|    k2 = kspan + 1;
  561|       |
  562|  1.83M|    j = 1;
  563|       |
  564|  1.83M|    if (n_pass == n_total) {
  ------------------
  |  Branch (564:9): [True: 1.83M, False: 0]
  ------------------
  565|  3.66M|      do {
  566|  3.66M|        do {
  567|  3.66M|          temp_real = ptr_real[kk];
  568|  3.66M|          ptr_real[kk] = ptr_real[k2];
  569|  3.66M|          ptr_real[k2] = temp_real;
  570|  3.66M|          temp_imag = ptr_imag[kk];
  571|  3.66M|          ptr_imag[kk] = ptr_imag[k2];
  572|  3.66M|          ptr_imag[k2] = temp_imag;
  573|       |
  574|  3.66M|          kk += inc;
  575|  3.66M|          k2 += kspan;
  576|       |
  577|  3.66M|        } while (k2 < ns);
  ------------------
  |  Branch (577:18): [True: 0, False: 3.66M]
  ------------------
  578|  5.50M|        do {
  579|  7.33M|          do {
  580|  7.33M|            k2 -= perm[j - 1];
  581|  7.33M|            j++;
  582|  7.33M|            k2 = perm[j] + k2;
  583|       |
  584|  7.33M|          } while (k2 > perm[j - 1]);
  ------------------
  |  Branch (584:20): [True: 1.83M, False: 5.50M]
  ------------------
  585|       |
  586|  5.50M|          j = 1;
  587|  11.0M|          do {
  588|  11.0M|            if (kk < k2) {
  ------------------
  |  Branch (588:17): [True: 1.83M, False: 9.17M]
  ------------------
  589|  1.83M|              repeat = 1;
  590|  1.83M|              break;
  591|  9.17M|            } else {
  592|  9.17M|              repeat = 0;
  593|  9.17M|            }
  594|       |
  595|  9.17M|            kk += inc;
  596|  9.17M|            k2 += kspan;
  597|       |
  598|  9.17M|          } while (k2 < ns);
  ------------------
  |  Branch (598:20): [True: 5.50M, False: 3.66M]
  ------------------
  599|  5.50M|          if (repeat) {
  ------------------
  |  Branch (599:15): [True: 1.83M, False: 3.66M]
  ------------------
  600|  1.83M|            break;
  601|  1.83M|          }
  602|  5.50M|        } while (kk < ns);
  ------------------
  |  Branch (602:18): [True: 1.83M, False: 1.83M]
  ------------------
  603|  3.66M|      } while (repeat);
  ------------------
  |  Branch (603:16): [True: 1.83M, False: 1.83M]
  ------------------
  604|  1.83M|    } 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|  1.83M|    jc = k3;
  658|  1.83M|  }
  659|       |
  660|  1.83M|  if ((kt << 1) + 1 >= mfactor) {
  ------------------
  |  Branch (660:7): [True: 1.83M, False: 0]
  ------------------
  661|  1.83M|    return IA_NO_ERROR;
  ------------------
  |  |   23|  1.83M|#define IA_NO_ERROR 0x00000000
  ------------------
  662|  1.83M|  }
  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|  7.33M|static VOID ixheaace_mps_two_channel_filtering(const FLOAT32 *p_qmf, FLOAT32 *ptr_hybrid) {
  841|  7.33M|  WORD32 n;
  842|  7.33M|  FLOAT32 cum0, cum1;
  843|       |
  844|  7.33M|  cum0 = 0.5f * p_qmf[HYBRID_FILTER_DELAY];
  ------------------
  |  |   37|  7.33M|#define HYBRID_FILTER_DELAY (6)
  ------------------
  845|       |
  846|  7.33M|  cum1 = 0;
  847|       |
  848|  51.3M|  for (n = 0; n < 6; n++) {
  ------------------
  |  Branch (848:15): [True: 44.0M, False: 7.33M]
  ------------------
  849|  44.0M|    cum1 += p2_6[n] * p_qmf[2 * n + 1];
  850|  44.0M|  }
  851|       |
  852|  7.33M|  ptr_hybrid[0] = cum0 + cum1;
  853|  7.33M|  ptr_hybrid[1] = cum0 - cum1;
  854|  7.33M|}

ixheaace_mps_212_ec_data_single_enc:
 1435|  43.2k|    const WORD32 coarse_flag, const WORD32 independency_flag) {
 1436|  43.2k|  IA_ERRORCODE error;
 1437|  43.2k|  WORD16 band = 0;
 1438|  43.2k|  WORD16 quant_levels = 0, quant_offset = 0, num_pcm_val = 0;
 1439|  43.2k|  WORD16 pcm_coding_flag = 0;
 1440|  43.2k|  WORD16 min_bits_all = 0;
 1441|  43.2k|  WORD16 min_found = 0;
 1442|  43.2k|  WORD16 huff_dim_df = 0;
 1443|  43.2k|  WORD16 huff_pair_type_df = 0;
 1444|  43.2k|  WORD16 huff_dim_dt = 0;
 1445|  43.2k|  WORD16 huff_pair_type_dt = 0;
 1446|  43.2k|  WORD16 allow_diff_time_back_flag = !independency_flag || (set_idx > 0);
  ------------------
  |  Branch (1446:38): [True: 30.1k, False: 13.1k]
  |  Branch (1446:60): [True: 0, False: 13.1k]
  ------------------
 1447|  43.2k|  WORD16 num_pcm_bits = -1;
 1448|  43.2k|  WORD16 min_bits_df = -1;
 1449|  43.2k|  WORD16 min_bits_dt = -1;
 1450|       |
 1451|  43.2k|  WORD16 quant_data_msb[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {0};
 1452|  43.2k|  WORD16 quant_data_hist_msb[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {0};
 1453|  43.2k|  WORD16 data_diff_freq[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {0};
 1454|  43.2k|  WORD16 data_diff_time[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS + 2] = {0};
 1455|  43.2k|  WORD16 *p_quant_data_msb;
 1456|  43.2k|  WORD16 *p_quant_data_hist_msb = NULL;
 1457|  43.2k|  WORD16 lav_df[2] = {-1, -1};
 1458|  43.2k|  WORD16 lav_dt[2] = {-1, -1};
 1459|       |
 1460|  43.2k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  43.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1460:7): [True: 21.3k, False: 21.8k]
  ------------------
 1461|  21.3k|    if (coarse_flag) {
  ------------------
  |  Branch (1461:9): [True: 0, False: 21.3k]
  ------------------
 1462|      0|      quant_levels = 4;
 1463|      0|      quant_offset = 0;
 1464|  21.3k|    } else {
 1465|  21.3k|      quant_levels = 8;
 1466|  21.3k|      quant_offset = 0;
 1467|  21.3k|    }
 1468|  21.8k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  21.8k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1468:14): [True: 21.8k, False: 0]
  ------------------
 1469|  21.8k|    if (coarse_flag) {
  ------------------
  |  Branch (1469:9): [True: 0, False: 21.8k]
  ------------------
 1470|      0|      quant_levels = 15;
 1471|      0|      quant_offset = 7;
 1472|  21.8k|    } else {
 1473|  21.8k|      quant_levels = 31;
 1474|  21.8k|      quant_offset = 15;
 1475|  21.8k|    }
 1476|  21.8k|  } else {
 1477|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
 1478|      0|  }
 1479|  43.2k|  if (quant_offset != 0) {
  ------------------
  |  Branch (1479:7): [True: 21.8k, False: 21.3k]
  ------------------
 1480|   607k|    for (band = 0; band < data_bands; band++) {
  ------------------
  |  Branch (1480:20): [True: 585k, False: 21.8k]
  ------------------
 1481|   585k|      quant_data_msb[band] = pp_in_data[set_idx][start_band + band] + quant_offset;
 1482|   585k|    }
 1483|  21.8k|    p_quant_data_msb = quant_data_msb;
 1484|  21.8k|  } else {
 1485|  21.3k|    p_quant_data_msb = pp_in_data[set_idx] + start_band;
 1486|  21.3k|  }
 1487|       |
 1488|  43.2k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1488:7): [True: 30.1k, False: 13.1k]
  ------------------
 1489|  30.1k|    if (quant_offset != 0) {
  ------------------
  |  Branch (1489:9): [True: 15.2k, False: 14.8k]
  ------------------
 1490|   425k|      for (band = 0; band < data_bands; band++) {
  ------------------
  |  Branch (1490:22): [True: 409k, False: 15.2k]
  ------------------
 1491|   409k|        quant_data_hist_msb[band] = p_in_data[start_band + band] + quant_offset;
 1492|   409k|      }
 1493|  15.2k|      p_quant_data_hist_msb = quant_data_hist_msb;
 1494|  15.2k|    } else {
 1495|  14.8k|      p_quant_data_hist_msb = p_in_data + start_band;
 1496|  14.8k|    }
 1497|  30.1k|  }
 1498|       |
 1499|  43.2k|  data_diff_freq[0] = p_quant_data_msb[0];
 1500|       |
 1501|  1.15M|  for (band = 1; band < data_bands; band++) {
  ------------------
  |  Branch (1501:18): [True: 1.11M, False: 43.2k]
  ------------------
 1502|  1.11M|    data_diff_freq[band] = p_quant_data_msb[band] - p_quant_data_msb[band - 1];
 1503|  1.11M|  }
 1504|       |
 1505|  43.2k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1505:7): [True: 30.1k, False: 13.1k]
  ------------------
 1506|  30.1k|    data_diff_time[0] = p_quant_data_msb[0];
 1507|  30.1k|    data_diff_time[1] = p_quant_data_hist_msb[0];
 1508|       |
 1509|   835k|    for (band = 0; band < data_bands; band++) {
  ------------------
  |  Branch (1509:20): [True: 805k, False: 30.1k]
  ------------------
 1510|   805k|      data_diff_time[band + 2] = p_quant_data_msb[band] - p_quant_data_hist_msb[band];
 1511|   805k|    }
 1512|  30.1k|  }
 1513|       |
 1514|  43.2k|  num_pcm_bits = ixheaace_mps_212_calc_pcm_bits(data_bands, quant_levels);
 1515|  43.2k|  num_pcm_val = data_bands;
 1516|  43.2k|  min_bits_all = num_pcm_bits;
 1517|       |
 1518|  43.2k|  error = ixheaace_mps_212_calc_huff_bits(
 1519|  43.2k|      data_diff_freq, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_FREQ, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|  43.2k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
                    data_diff_freq, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_FREQ, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|  43.2k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1520|  43.2k|      data_bands, lav_df, &min_bits_df, &huff_dim_df, &huff_pair_type_df);
 1521|  43.2k|  if (error) {
  ------------------
  |  Branch (1521:7): [True: 0, False: 43.2k]
  ------------------
 1522|      0|    return error;
 1523|      0|  }
 1524|       |
 1525|  43.2k|  if (allow_diff_time_back_flag) min_bits_df += 1;
  ------------------
  |  Branch (1525:7): [True: 30.1k, False: 13.1k]
  ------------------
 1526|       |
 1527|  43.2k|  if (min_bits_df < min_bits_all) {
  ------------------
  |  Branch (1527:7): [True: 37.2k, False: 5.96k]
  ------------------
 1528|  37.2k|    min_bits_all = min_bits_df;
 1529|  37.2k|  }
 1530|  43.2k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1530:7): [True: 30.1k, False: 13.1k]
  ------------------
 1531|  30.1k|    error = ixheaace_mps_212_calc_huff_bits(
 1532|  30.1k|        data_diff_time, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|  30.1k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
                      data_diff_time, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_TIME, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|  30.1k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1533|  30.1k|        data_bands, lav_dt, &min_bits_dt, &huff_dim_dt, &huff_pair_type_dt);
 1534|  30.1k|    if (error) {
  ------------------
  |  Branch (1534:9): [True: 0, False: 30.1k]
  ------------------
 1535|      0|      return error;
 1536|      0|    }
 1537|       |
 1538|  30.1k|    min_bits_dt += 1;
 1539|       |
 1540|  30.1k|    if (min_bits_dt < min_bits_all) {
  ------------------
  |  Branch (1540:9): [True: 10.9k, False: 19.1k]
  ------------------
 1541|  10.9k|      min_bits_all = min_bits_dt;
 1542|  10.9k|    }
 1543|  30.1k|  }
 1544|  43.2k|  pcm_coding_flag = (min_bits_all == num_pcm_bits);
 1545|       |
 1546|  43.2k|  ixheaace_write_bits(pstr_bit_buf, pcm_coding_flag, 1);
 1547|       |
 1548|  43.2k|  if (pcm_coding_flag) {
  ------------------
  |  Branch (1548:7): [True: 3.35k, False: 39.9k]
  ------------------
 1549|  3.35k|    ixheaace_mps_212_apply_pcm_coding(pstr_bit_buf, pp_in_data[set_idx] + start_band, NULL,
 1550|  3.35k|                                      quant_offset, num_pcm_val, quant_levels);
 1551|  39.9k|  } else {
 1552|  39.9k|    min_found = 0;
 1553|  39.9k|    if (min_bits_all == min_bits_df) {
  ------------------
  |  Branch (1553:9): [True: 28.9k, False: 10.9k]
  ------------------
 1554|  28.9k|      if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1554:11): [True: 17.4k, False: 11.5k]
  ------------------
 1555|  17.4k|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_FREQ, 1);
  ------------------
  |  |   29|  17.4k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1556|  17.4k|      }
 1557|       |
 1558|  28.9k|      error = ixheaace_mps_212_apply_huff_coding(
 1559|  28.9k|          pstr_bit_buf, data_diff_freq, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|  28.9k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1560|  28.9k|          IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands, lav_df, huff_dim_df, huff_pair_type_df);
  ------------------
  |  |   29|  28.9k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1561|  28.9k|      if (error) {
  ------------------
  |  Branch (1561:11): [True: 0, False: 28.9k]
  ------------------
 1562|      0|        return error;
 1563|      0|      }
 1564|  28.9k|      min_found = 1;
 1565|  28.9k|    }
 1566|       |
 1567|  39.9k|    if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1567:9): [True: 28.3k, False: 11.5k]
  ------------------
 1568|  28.3k|      if (!min_found && (min_bits_all == min_bits_dt)) {
  ------------------
  |  Branch (1568:11): [True: 10.9k, False: 17.4k]
  |  Branch (1568:25): [True: 10.9k, False: 0]
  ------------------
 1569|  10.9k|        ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_DIFF_TIME, 1);
  ------------------
  |  |   30|  10.9k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1570|       |
 1571|  10.9k|        error = ixheaace_mps_212_apply_huff_coding(
 1572|  10.9k|            pstr_bit_buf, data_diff_time, NULL, data_type, IXHEAACE_MPS_SAC_DIFF_TIME,
  ------------------
  |  |   30|  10.9k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1573|  10.9k|            IXHEAACE_MPS_SAC_DIFF_TIME, data_bands, lav_dt, huff_dim_dt, huff_pair_type_dt);
  ------------------
  |  |   30|  10.9k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1574|  10.9k|        if (error) {
  ------------------
  |  Branch (1574:13): [True: 0, False: 10.9k]
  ------------------
 1575|      0|          return error;
 1576|      0|        }
 1577|  10.9k|      }
 1578|  28.3k|    }
 1579|  39.9k|  }
 1580|       |
 1581|  43.2k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  43.2k|#define IA_NO_ERROR 0x00000000
  ------------------
 1582|  43.2k|}
ixheaace_mps_515_ec_data_pair_enc:
 1589|   152k|                                         WORD32 independency_flag) {
 1590|   152k|  WORD32 dummy = 0;
 1591|   152k|  WORD32 quant_levels = 0, quant_offset = 0, num_pcm_val = 0;
 1592|       |
 1593|   152k|  WORD32 split_lsb_flag = 0;
 1594|   152k|  WORD32 pcm_coding_flag = 0;
 1595|       |
 1596|   152k|  WORD32 min_bits_df_df = -1;
 1597|   152k|  WORD32 min_bits_df_dt = -1;
 1598|   152k|  WORD32 min_bits_dtbw_df = -1;
 1599|   152k|  WORD32 min_bits_dtfw_df = -1;
 1600|       |
 1601|   152k|  WORD32 min_bits_dt_dt = -1;
 1602|   152k|  WORD32 allow_diff_time_back_flag = !independency_flag || (set_idx > 0);
  ------------------
  |  Branch (1602:38): [True: 0, False: 152k]
  |  Branch (1602:60): [True: 0, False: 152k]
  ------------------
 1603|       |
 1604|   152k|  WORD32 num_lsb_bits[2] = {0, 0};
 1605|   152k|  WORD32 num_pcm_bits = 0;
 1606|       |
 1607|   152k|  WORD32 a_data_hist[MAXBANDS] = {0};
 1608|   152k|  WORD32 aa_data_pair[2][MAXBANDS] = {{0}};
 1609|       |
 1610|   152k|  WORD32 quant_data_lsb[2][MAXBANDS] = {{0}};
 1611|   152k|  WORD32 quant_data_msb[2][MAXBANDS] = {{0}};
 1612|       |
 1613|   152k|  WORD32 quant_data_hist_lsb[MAXBANDS] = {0};
 1614|   152k|  WORD32 quant_data_hist_msb[MAXBANDS] = {0};
 1615|       |
 1616|   152k|  WORD32 data_diff_freq[2][MAXBANDS] = {{0}};
 1617|   152k|  WORD32 data_diff_time_bw[2][MAXBANDS + 1] = {{0}};
 1618|   152k|  WORD32 data_diff_time_fw[MAXBANDS + 1] = {0};
 1619|       |
 1620|   152k|  WORD32 *p_data_pcm[2] = {NULL};
 1621|   152k|  WORD32 *p_data_diff_freq[2] = {NULL};
 1622|   152k|  WORD32 *p_data_diff_time_bw[2] = {NULL};
 1623|   152k|  WORD32 *p_data_diff_time_fw = NULL;
 1624|       |
 1625|   152k|  WORD32 min_bits_all = 0;
 1626|   152k|  WORD32 min_found = 0;
 1627|       |
 1628|   152k|  switch (data_type) {
 1629|  98.5k|    case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|  98.5k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1629:5): [True: 98.5k, False: 53.7k]
  ------------------
 1630|  98.5k|      if (coarse_flag) {
  ------------------
  |  Branch (1630:11): [True: 0, False: 98.5k]
  ------------------
 1631|      0|        split_lsb_flag = 0;
 1632|      0|        quant_levels = 15;
 1633|      0|        quant_offset = 7;
 1634|  98.5k|      } else {
 1635|  98.5k|        split_lsb_flag = 0;
 1636|  98.5k|        quant_levels = 31;
 1637|  98.5k|        quant_offset = 15;
 1638|  98.5k|      }
 1639|       |
 1640|  98.5k|      break;
 1641|       |
 1642|  53.7k|    case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|  53.7k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1642:5): [True: 53.7k, False: 98.5k]
  ------------------
 1643|  53.7k|      if (coarse_flag) {
  ------------------
  |  Branch (1643:11): [True: 0, False: 53.7k]
  ------------------
 1644|      0|        split_lsb_flag = 0;
 1645|      0|        quant_levels = 4;
 1646|      0|        quant_offset = 0;
 1647|  53.7k|      } else {
 1648|  53.7k|        split_lsb_flag = 0;
 1649|  53.7k|        quant_levels = 8;
 1650|  53.7k|        quant_offset = 0;
 1651|  53.7k|      }
 1652|       |
 1653|  53.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: 152k]
  ------------------
 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: 152k]
  ------------------
 1669|      0|      return;
 1670|   152k|  }
 1671|       |
 1672|   152k|  memcpy(a_data_hist, p_in_data + start_band, sizeof(WORD32) * data_bands);
 1673|       |
 1674|   152k|  memcpy(aa_data_pair[0], pp_in_data[set_idx] + start_band, sizeof(int) * data_bands);
 1675|   152k|  p_data_pcm[0] = aa_data_pair[0];
 1676|   152k|  if (pair_flag) {
  ------------------
  |  Branch (1676:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  num_lsb_bits[0] =
 1682|   152k|      ixheaace_mps_515_split_lsb(aa_data_pair[0], quant_offset, split_lsb_flag ? 1 : 0,
  ------------------
  |  Branch (1682:65): [True: 0, False: 152k]
  ------------------
 1683|   152k|                                 data_bands, quant_data_lsb[0], quant_data_msb[0]);
 1684|       |
 1685|   152k|  if (pair_flag) {
  ------------------
  |  Branch (1685:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  (VOID) num_lsb_bits;
 1691|   152k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1691:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  ixheaace_mps_515_calc_diff_freq(quant_data_msb[0], data_diff_freq[0], data_bands);
 1698|   152k|  p_data_diff_freq[0] = data_diff_freq[0];
 1699|       |
 1700|   152k|  if (pair_flag) {
  ------------------
  |  Branch (1700:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1705:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  if (pair_flag) {
  ------------------
  |  Branch (1712:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  if (pair_flag) {
  ------------------
  |  Branch (1723:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  } else {
 1727|   152k|    num_pcm_bits = ixheaace_mps_515_calc_pcm_bits(data_bands, quant_levels);
 1728|   152k|    num_pcm_val = data_bands;
 1729|   152k|  }
 1730|       |
 1731|   152k|  min_bits_all = num_pcm_bits;
 1732|       |
 1733|   152k|  if ((p_data_diff_freq[0] != NULL) || (p_data_diff_freq[1] != NULL)) {
  ------------------
  |  Branch (1733:7): [True: 152k, False: 0]
  |  Branch (1733:40): [True: 0, False: 0]
  ------------------
 1734|   152k|    min_bits_df_df = ixheaace_mps_515_calc_huff_bits(p_data_diff_freq[0], p_data_diff_freq[1],
 1735|   152k|                                                     data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|   152k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1736|   152k|                                                     IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|   152k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1737|       |
 1738|   152k|    if (pair_flag || allow_diff_time_back_flag) min_bits_df_df += 1;
  ------------------
  |  Branch (1738:9): [True: 0, False: 152k]
  |  Branch (1738:22): [True: 0, False: 152k]
  ------------------
 1739|   152k|    if (pair_flag) min_bits_df_df += 1;
  ------------------
  |  Branch (1739:9): [True: 0, False: 152k]
  ------------------
 1740|       |
 1741|   152k|    if (min_bits_df_df < min_bits_all) {
  ------------------
  |  Branch (1741:9): [True: 141k, False: 10.9k]
  ------------------
 1742|   141k|      min_bits_all = min_bits_df_df;
 1743|   141k|    }
 1744|   152k|  }
 1745|       |
 1746|   152k|  if ((p_data_diff_freq[0] != NULL) || (p_data_diff_time_bw[1] != NULL)) {
  ------------------
  |  Branch (1746:7): [True: 152k, False: 0]
  |  Branch (1746:40): [True: 0, False: 0]
  ------------------
 1747|   152k|    min_bits_df_dt = ixheaace_mps_515_calc_huff_bits(p_data_diff_freq[0], p_data_diff_time_bw[1],
 1748|   152k|                                                     data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|   152k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1749|   152k|                                                     IXHEAACE_MPS_SAC_DIFF_TIME, data_bands);
  ------------------
  |  |   30|   152k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
 1750|       |
 1751|   152k|    if (pair_flag || allow_diff_time_back_flag) min_bits_df_dt += 1;
  ------------------
  |  Branch (1751:9): [True: 0, False: 152k]
  |  Branch (1751:22): [True: 0, False: 152k]
  ------------------
 1752|   152k|    if (pair_flag) min_bits_df_dt += 1;
  ------------------
  |  Branch (1752:9): [True: 0, False: 152k]
  ------------------
 1753|       |
 1754|   152k|    if (min_bits_df_dt < min_bits_all) {
  ------------------
  |  Branch (1754:9): [True: 0, False: 152k]
  ------------------
 1755|      0|      min_bits_all = min_bits_df_dt;
 1756|      0|    }
 1757|   152k|  }
 1758|       |
 1759|   152k|  if ((p_data_diff_time_fw != NULL) || (p_data_diff_freq[1] != NULL)) {
  ------------------
  |  Branch (1759:7): [True: 0, False: 152k]
  |  Branch (1759:40): [True: 0, False: 152k]
  ------------------
 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|   152k|  if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1776:7): [True: 0, False: 152k]
  ------------------
 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|   152k|  pcm_coding_flag = (min_bits_all == num_pcm_bits);
 1807|       |
 1808|   152k|  ixheaace_write_bits(pstr_bit_buf, pcm_coding_flag, 1);
 1809|       |
 1810|   152k|  if (pcm_coding_flag) {
  ------------------
  |  Branch (1810:7): [True: 10.9k, False: 141k]
  ------------------
 1811|  10.9k|    if (data_bands >= PBC_MIN_BANDS) {
  ------------------
  |  |  161|  10.9k|#define PBC_MIN_BANDS 5
  ------------------
  |  Branch (1811:9): [True: 3.52k, False: 7.38k]
  ------------------
 1812|  3.52k|      ixheaace_write_bits(pstr_bit_buf, 0, 1);
 1813|  3.52k|    }
 1814|       |
 1815|  10.9k|    ixheaace_mps_515_apply_pcm_coding(pstr_bit_buf, p_data_pcm[0], p_data_pcm[1], quant_offset,
 1816|  10.9k|                                      num_pcm_val, quant_levels);
 1817|   141k|  } else {
 1818|   141k|    min_found = 0;
 1819|       |
 1820|   141k|    if (min_bits_all == min_bits_df_df) {
  ------------------
  |  Branch (1820:9): [True: 141k, False: 0]
  ------------------
 1821|   141k|      if (pair_flag || allow_diff_time_back_flag) {
  ------------------
  |  Branch (1821:11): [True: 0, False: 141k]
  |  Branch (1821:24): [True: 0, False: 141k]
  ------------------
 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|   141k|      if (pair_flag) {
  ------------------
  |  Branch (1825:11): [True: 0, False: 141k]
  ------------------
 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|   141k|      ixheaace_mps_515_apply_huff_coding(pstr_bit_buf, p_data_diff_freq[0], p_data_diff_freq[1],
 1830|   141k|                                         data_type, IXHEAACE_MPS_SAC_DIFF_FREQ,
  ------------------
  |  |   29|   141k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1831|   141k|                                         IXHEAACE_MPS_SAC_DIFF_FREQ, data_bands);
  ------------------
  |  |   29|   141k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1832|       |
 1833|   141k|      min_found = 1;
 1834|   141k|    }
 1835|       |
 1836|   141k|    if (!min_found && (min_bits_all == min_bits_df_dt)) {
  ------------------
  |  Branch (1836:9): [True: 0, False: 141k]
  |  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|   141k|    if (!min_found && (min_bits_all == min_bits_dtfw_df)) {
  ------------------
  |  Branch (1852:9): [True: 0, False: 141k]
  |  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|   141k|    if (allow_diff_time_back_flag) {
  ------------------
  |  Branch (1872:9): [True: 0, False: 141k]
  ------------------
 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|   141k|    if (split_lsb_flag) {
  ------------------
  |  Branch (1904:9): [True: 0, False: 141k]
  ------------------
 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|   141k|  }
 1912|       |
 1913|   152k|  return;
 1914|   152k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_calc_pcm_bits:
   87|  44.3k|static WORD16 ixheaace_mps_212_calc_pcm_bits(const WORD16 num_val, const WORD16 n_levels) {
   88|  44.3k|  WORD16 num_complete_chunks = 0, rest_chunk_size = 0;
   89|  44.3k|  WORD16 max_grp_len = 0, bits_pcm = 0;
   90|  44.3k|  WORD32 chunk_levels, lvl;
   91|       |
   92|  44.3k|  switch (n_levels) {
   93|      0|    case 7:
  ------------------
  |  Branch (93:5): [True: 0, False: 44.3k]
  ------------------
   94|      0|      max_grp_len = 6;
   95|      0|      break;
   96|      0|    case 3:
  ------------------
  |  Branch (96:5): [True: 0, False: 44.3k]
  ------------------
   97|      0|    case 6:
  ------------------
  |  Branch (97:5): [True: 0, False: 44.3k]
  ------------------
   98|      0|      max_grp_len = 5;
   99|      0|      break;
  100|      0|    case 13:
  ------------------
  |  Branch (100:5): [True: 0, False: 44.3k]
  ------------------
  101|      4|    case 19:
  ------------------
  |  Branch (101:5): [True: 4, False: 44.3k]
  ------------------
  102|      4|    case 51:
  ------------------
  |  Branch (102:5): [True: 0, False: 44.3k]
  ------------------
  103|      4|      max_grp_len = 4;
  104|      4|      break;
  105|      0|    case 25:
  ------------------
  |  Branch (105:5): [True: 0, False: 44.3k]
  ------------------
  106|      0|      max_grp_len = 3;
  107|      0|      break;
  108|     12|    case 11:
  ------------------
  |  Branch (108:5): [True: 12, False: 44.2k]
  ------------------
  109|     12|      max_grp_len = 2;
  110|     12|      break;
  111|  44.2k|    default:
  ------------------
  |  Branch (111:5): [True: 44.2k, False: 16]
  ------------------
  112|  44.2k|      max_grp_len = 1;
  113|  44.3k|  }
  114|       |
  115|  44.3k|  num_complete_chunks = num_val / max_grp_len;
  116|  44.3k|  rest_chunk_size = num_val % max_grp_len;
  117|       |
  118|  44.3k|  chunk_levels = 1;
  119|  88.6k|  for (lvl = 1; lvl <= max_grp_len; lvl++) {
  ------------------
  |  Branch (119:17): [True: 44.3k, False: 44.3k]
  ------------------
  120|  44.3k|    chunk_levels *= n_levels;
  121|  44.3k|  }
  122|  44.3k|  bits_pcm = (WORD16)(round(log(chunk_levels) / log(2)) * num_complete_chunks);
  123|  44.3k|  bits_pcm += (WORD16)(round(log(chunk_levels) / log(2)) * rest_chunk_size);
  124|       |
  125|  44.3k|  return bits_pcm;
  126|  44.3k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_calc_huff_bits:
  370|  73.3k|    WORD16 *const huff_dim, WORD16 *const huff_pair_type) {
  371|  73.3k|  IA_ERRORCODE error;
  372|  73.3k|  WORD16 band = 0;
  373|  73.3k|  WORD16 bit_count_1_d = 0;
  374|  73.3k|  WORD16 bit_count_2_d_freq = 0;
  375|  73.3k|  WORD16 bit_count_min = 0;
  376|  73.3k|  WORD16 num_band_short_data_1 = 0;
  377|  73.3k|  WORD16 num_band_short_data_2 = 0;
  378|  73.3k|  UWORD16 huff_bits;
  379|  73.3k|  WORD16 tab_idx_2_d[2][2] = {{0}};
  380|  73.3k|  WORD16 tab_idx_1_d[2] = {0};
  381|  73.3k|  WORD16 df_rest_flag[2] = {0};
  382|  73.3k|  WORD16 part_0_flag[2] = {0};
  383|  73.3k|  WORD16 lav_fp[2] = {0};
  384|  73.3k|  WORD16 pair_vec[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS][2] = {{0}};
  385|  73.3k|  WORD16 *part_0_data_1[2] = {NULL};
  386|  73.3k|  WORD16 *part_0_data_2[2] = {NULL};
  387|  73.3k|  WORD16 *in_short_data_1 = NULL;
  388|  73.3k|  WORD16 *in_short_data_2 = NULL;
  389|       |
  390|  73.3k|  bit_count_1_d = 1;
  391|  73.3k|  bit_count_2_d_freq = 1;
  392|  73.3k|  num_band_short_data_1 = num_bands;
  393|  73.3k|  num_band_short_data_2 = num_bands;
  394|       |
  395|  73.3k|  tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (395:20): [True: 43.2k, False: 30.1k]
  ------------------
  396|  73.3k|  tab_idx_1_d[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (396:20): [True: 43.2k, False: 30.1k]
  ------------------
  397|       |
  398|  73.3k|  part_0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  399|  73.3k|  part_0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  400|       |
  401|  73.3k|  if (in_data_1 != NULL) {
  ------------------
  |  Branch (401:7): [True: 73.3k, False: 0]
  ------------------
  402|  73.3k|    in_short_data_1 = in_data_1 + (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (402:36): [True: 30.1k, False: 43.2k]
  ------------------
  403|  73.3k|    error = ixheaace_mps_212_huff_enc_1_d(NULL, data_type, tab_idx_1_d[0], in_short_data_1,
  404|  73.3k|                                          num_band_short_data_1, part_0_flag[0], &huff_bits);
  405|  73.3k|    if (error) {
  ------------------
  |  Branch (405:9): [True: 0, False: 73.3k]
  ------------------
  406|      0|      return error;
  407|      0|    }
  408|  73.3k|    bit_count_1_d += huff_bits;
  409|  73.3k|  }
  410|  73.3k|  if (in_data_2 != NULL) {
  ------------------
  |  Branch (410:7): [True: 0, False: 73.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|  73.3k|  bit_count_min = bit_count_1_d;
  421|  73.3k|  *huff_dim = IXHEAACE_MPS_SAC_HUFF_1D;
  ------------------
  |  |   34|  73.3k|#define IXHEAACE_MPS_SAC_HUFF_1D (0x0)
  ------------------
  422|  73.3k|  lav_idx[0] = lav_idx[1] = -1;
  423|       |
  424|  73.3k|  if (in_data_1 != NULL) {
  ------------------
  |  Branch (424:7): [True: 73.3k, False: 0]
  ------------------
  425|  73.3k|    if (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) {
  ------------------
  |  |   29|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (425:9): [True: 43.2k, False: 30.1k]
  ------------------
  426|  43.2k|      part_0_data_1[0] = &in_data_1[0];
  427|  43.2k|      part_0_data_1[1] = NULL;
  428|       |
  429|  43.2k|      num_band_short_data_1 -= 1;
  430|  43.2k|      in_short_data_1 += 1;
  431|  43.2k|    }
  432|       |
  433|  73.3k|    df_rest_flag[0] = num_band_short_data_1 % 2;
  434|       |
  435|  73.3k|    if (df_rest_flag[0]) {
  ------------------
  |  Branch (435:9): [True: 41.9k, False: 31.4k]
  ------------------
  436|  41.9k|      num_band_short_data_1 -= 1;
  437|  41.9k|    }
  438|       |
  439|  1.01M|    for (band = 0; band < num_band_short_data_1 - 1; band += 2) {
  ------------------
  |  Branch (439:20): [True: 938k, False: 73.3k]
  ------------------
  440|   938k|      pair_vec[band][0] = in_short_data_1[band];
  441|   938k|      pair_vec[band][1] = in_short_data_1[band + 1];
  442|       |
  443|   938k|      lav_fp[0] = (WORD16)MAX(lav_fp[0], abs(pair_vec[band][0]));
  ------------------
  |  |   24|   938k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 498k, False: 440k]
  |  |  ------------------
  ------------------
  444|   938k|      lav_fp[0] = (WORD16)MAX(lav_fp[0], abs(pair_vec[band][1]));
  ------------------
  |  |   24|   938k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 532k, False: 405k]
  |  |  ------------------
  ------------------
  445|   938k|    }
  446|       |
  447|  73.3k|    tab_idx_2_d[0][0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (447:25): [True: 30.1k, False: 43.2k]
  ------------------
  448|  73.3k|    tab_idx_2_d[0][1] = 0;
  449|       |
  450|  73.3k|    tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  73.3k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (450:22): [True: 43.2k, False: 30.1k]
  ------------------
  451|       |
  452|  73.3k|    lav_fp[0] = ixheaace_mps_212_get_next_lav_step(lav_fp[0], data_type);
  453|       |
  454|  73.3k|    if (lav_fp[0] != -1) {
  ------------------
  |  Branch (454:9): [True: 71.7k, False: 1.58k]
  ------------------
  455|  71.7k|      bit_count_2_d_freq += lav_huff_len[lav_fp[0]];
  456|  71.7k|    }
  457|  73.3k|  }
  458|       |
  459|  73.3k|  if (in_data_2 != NULL) {
  ------------------
  |  Branch (459:7): [True: 0, False: 73.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|  73.3k|  if ((lav_fp[0] != -1) && (lav_fp[1] != -1)) {
  ------------------
  |  Branch (492:7): [True: 71.7k, False: 1.58k]
  |  Branch (492:28): [True: 71.7k, False: 0]
  ------------------
  493|  71.7k|    if (in_data_1 != NULL) {
  ------------------
  |  Branch (493:9): [True: 71.7k, False: 0]
  ------------------
  494|  71.7k|      error = ixheaace_mps_212_huff_enc_2_d(NULL, data_type, tab_idx_2_d[0], lav_fp[0], pair_vec,
  495|  71.7k|                                            num_band_short_data_1, 2, part_0_data_1, &huff_bits);
  496|  71.7k|      if (error) {
  ------------------
  |  Branch (496:11): [True: 0, False: 71.7k]
  ------------------
  497|      0|        return error;
  498|      0|      }
  499|       |
  500|  71.7k|      bit_count_2_d_freq += huff_bits;
  501|  71.7k|    }
  502|  71.7k|    if (in_data_2 != NULL) {
  ------------------
  |  Branch (502:9): [True: 0, False: 71.7k]
  ------------------
  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|  71.7k|    if (in_data_1 != NULL) {
  ------------------
  |  Branch (511:9): [True: 71.7k, False: 0]
  ------------------
  512|  71.7k|      if (df_rest_flag[0]) {
  ------------------
  |  Branch (512:11): [True: 41.5k, False: 30.2k]
  ------------------
  513|  41.5k|        error = ixheaace_mps_212_huff_enc_1_d(NULL, data_type, tab_idx_1_d[0],
  514|  41.5k|                                              in_short_data_1 + num_band_short_data_1, 1, 0,
  515|  41.5k|                                              &huff_bits);
  516|  41.5k|        if (error) {
  ------------------
  |  Branch (516:13): [True: 0, False: 41.5k]
  ------------------
  517|      0|          return error;
  518|      0|        }
  519|  41.5k|        bit_count_2_d_freq += huff_bits;
  520|  41.5k|      }
  521|  71.7k|    }
  522|  71.7k|    if (in_data_2 != NULL) {
  ------------------
  |  Branch (522:9): [True: 0, False: 71.7k]
  ------------------
  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|  71.7k|    if (bit_count_2_d_freq < bit_count_min) {
  ------------------
  |  Branch (534:9): [True: 38.4k, False: 33.3k]
  ------------------
  535|  38.4k|      bit_count_min = bit_count_2_d_freq;
  536|  38.4k|      *huff_dim = IXHEAACE_MPS_SAC_HUFF_2D;
  ------------------
  |  |   35|  38.4k|#define IXHEAACE_MPS_SAC_HUFF_2D (0x1)
  ------------------
  537|  38.4k|      *huff_pair_type = IXHEAACE_MPS_SAC_FREQ_PAIR;
  ------------------
  |  |   32|  38.4k|#define IXHEAACE_MPS_SAC_FREQ_PAIR (0x0)
  ------------------
  538|  38.4k|      lav_idx[0] = lav_fp[0];
  539|  38.4k|      lav_idx[1] = lav_fp[1];
  540|  38.4k|    }
  541|  71.7k|  }
  542|       |
  543|  73.3k|  *bit_count = bit_count_min;
  544|  73.3k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  73.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  545|  73.3k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_huff_enc_1_d:
  188|   145k|                                                  UWORD16 *huff_code_bits) {
  189|   145k|  WORD32 band, offset = 0;
  190|   145k|  UWORD16 huff_bits = 0;
  191|   145k|  ixheaace_mps_huff_entry part0;
  192|   145k|  const ixheaace_mps_huff_entry *p_huff_tab = NULL;
  193|       |
  194|   145k|  *huff_code_bits = 0;
  195|   145k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|   145k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (195:7): [True: 70.6k, False: 74.4k]
  ------------------
  196|  70.6k|    p_huff_tab = ixheaace_mps_212_huff_icc_tab.h1_d[dim_1];
  197|  74.4k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  74.4k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (197:14): [True: 74.4k, False: 0]
  ------------------
  198|  74.4k|    p_huff_tab = ixheaace_mps_212_huff_cld_tab.h1_d[dim_1];
  199|  74.4k|  } else {
  200|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
  201|      0|  }
  202|       |
  203|   145k|  if (part_0_flag) {
  ------------------
  |  Branch (203:7): [True: 58.2k, False: 86.9k]
  ------------------
  204|  58.2k|    if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  58.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (204:9): [True: 24.7k, False: 33.4k]
  ------------------
  205|  24.7k|      part0 = ixheaace_mps_212_huff_part_0_tab.icc[in_data[0]];
  206|  33.4k|    } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  33.4k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (206:16): [True: 33.4k, False: 0]
  ------------------
  207|  33.4k|      part0 = ixheaace_mps_212_huff_part_0_tab.cld[in_data[0]];
  208|  33.4k|    } else {
  209|      0|      return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
  210|      0|    }
  211|  58.2k|    huff_bits += ixheaace_write_bits(pstr_bit_buf, part0.value, part0.length);
  212|  58.2k|    offset = 1;
  213|  58.2k|  }
  214|       |
  215|  2.54M|  for (band = offset; band < num_bands; band++) {
  ------------------
  |  Branch (215:23): [True: 2.40M, False: 145k]
  ------------------
  216|  2.40M|    WORD32 id_sign = 0;
  217|  2.40M|    WORD32 id = in_data[band];
  218|       |
  219|  2.40M|    if (id != 0) {
  ------------------
  |  Branch (219:9): [True: 918k, False: 1.48M]
  ------------------
  220|   918k|      id_sign = 0;
  221|   918k|      if (id < 0) {
  ------------------
  |  Branch (221:11): [True: 452k, False: 466k]
  ------------------
  222|   452k|        id = -id;
  223|   452k|        id_sign = 1;
  224|   452k|      }
  225|   918k|    }
  226|       |
  227|  2.40M|    huff_bits += ixheaace_write_bits(pstr_bit_buf, p_huff_tab[id].value, p_huff_tab[id].length);
  228|       |
  229|  2.40M|    if (id != 0) {
  ------------------
  |  Branch (229:9): [True: 918k, False: 1.48M]
  ------------------
  230|   918k|      huff_bits += ixheaace_write_bits(pstr_bit_buf, id_sign, 1);
  231|   918k|    }
  232|  2.40M|  }
  233|       |
  234|   145k|  *huff_code_bits = huff_bits;
  235|   145k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   145k|#define IA_NO_ERROR 0x00000000
  ------------------
  236|   145k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_get_next_lav_step:
  354|  73.3k|static WORD8 ixheaace_mps_212_get_next_lav_step(const WORD32 lav, const WORD32 data_type) {
  355|  73.3k|  WORD8 lav_step = 0;
  356|  73.3k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  73.3k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (356:7): [True: 36.1k, False: 37.1k]
  ------------------
  357|  36.1k|    lav_step = (lav > 7) ? -1 : lav_step_icc[lav];
  ------------------
  |  Branch (357:16): [True: 0, False: 36.1k]
  ------------------
  358|  37.1k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  37.1k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (358:14): [True: 37.1k, False: 0]
  ------------------
  359|  37.1k|    lav_step = (lav > 9) ? -1 : lav_step_cld[lav];
  ------------------
  |  Branch (359:16): [True: 1.58k, False: 35.5k]
  ------------------
  360|  37.1k|  } else {
  361|      0|    lav_step = 0;
  362|      0|  }
  363|       |
  364|  73.3k|  return lav_step;
  365|  73.3k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_huff_enc_2_d:
  300|  94.9k|                                                  WORD16 *p_0_data[2], UWORD16 *huff_bits) {
  301|  94.9k|  WORD16 band = 0, lav = 0, sym_bits = 0, esc_idx = 0;
  302|  94.9k|  UWORD8 num_sbits = 0;
  303|  94.9k|  WORD16 esc_data[2][IXHEAACE_MPS_SAC_MAX_FREQ_BANDS] = {{0}};
  304|       |
  305|  94.9k|  *huff_bits = 0;
  306|  94.9k|  const ixheaace_mps_huff_entry *pstr_huff_entry = NULL;
  307|  94.9k|  if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_ICC) {
  ------------------
  |  |   23|  94.9k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (307:7): [True: 49.7k, False: 45.2k]
  ------------------
  308|  49.7k|    lav = 2 * lav_idx + 1;
  309|  49.7k|    pstr_huff_entry = ixheaace_mps_212_huff_part_0_tab.icc;
  310|  49.7k|  } else if (data_type == IXHEAACE_MPS_SAC_DATA_TYPE_CLD) {
  ------------------
  |  |   22|  45.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (310:14): [True: 45.2k, False: 0]
  ------------------
  311|  45.2k|    lav = 2 * lav_idx + 3;
  312|  45.2k|    pstr_huff_entry = ixheaace_mps_212_huff_part_0_tab.cld;
  313|  45.2k|  } else {
  314|      0|    return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_HUFF_DATA_TYPE;
  315|      0|  }
  316|       |
  317|  94.9k|  if (p_0_data[0] != NULL) {
  ------------------
  |  Branch (317:7): [True: 56.9k, False: 38.0k]
  ------------------
  318|  56.9k|    ixheaace_mps_huff_entry entry = pstr_huff_entry[*p_0_data[0]];
  319|  56.9k|    *huff_bits += ixheaace_write_bits(pstr_bit_buf, entry.value, entry.length);
  320|  56.9k|  }
  321|  94.9k|  if (p_0_data[1] != NULL) {
  ------------------
  |  Branch (321:7): [True: 0, False: 94.9k]
  ------------------
  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.31M|  for (band = 0; band < num_bands; band += stride) {
  ------------------
  |  Branch (326:18): [True: 1.21M, False: 94.9k]
  ------------------
  327|  1.21M|    ixheaace_mps_huff_entry entry = {0};
  328|  1.21M|    ixheaace_mps_huff_entry escape = {0};
  329|       |
  330|  1.21M|    esc_data[0][esc_idx] = in_data[band][0] + lav;
  331|  1.21M|    esc_data[1][esc_idx] = in_data[band][1] + lav;
  332|       |
  333|  1.21M|    num_sbits = ixheaace_mps_212_sym_check(in_data[band], lav, &sym_bits);
  334|       |
  335|  1.21M|    ixheaace_mps_212_get_huff_entry(lav, data_type, band, tab_idx_2_d, in_data, &entry, &escape);
  336|       |
  337|  1.21M|    *huff_bits += ixheaace_write_bits(pstr_bit_buf, entry.value, entry.length);
  338|       |
  339|  1.21M|    if ((entry.value == escape.value) && (entry.length == escape.length)) {
  ------------------
  |  Branch (339:9): [True: 391k, False: 823k]
  |  Branch (339:42): [True: 1.43k, False: 390k]
  ------------------
  340|  1.43k|      esc_idx++;
  341|  1.21M|    } else {
  342|  1.21M|      *huff_bits += ixheaace_write_bits(pstr_bit_buf, sym_bits, num_sbits);
  343|  1.21M|    }
  344|  1.21M|  }
  345|  94.9k|  if (esc_idx > 0) {
  ------------------
  |  Branch (345:7): [True: 1.04k, False: 93.9k]
  ------------------
  346|  1.04k|    *huff_bits += ixheaace_mps_212_calc_pcm_bits(2 * esc_idx, (2 * lav + 1));
  347|  1.04k|    ixheaace_mps_212_apply_pcm_coding(pstr_bit_buf, esc_data[0], esc_data[1], 0, 2 * esc_idx,
  348|  1.04k|                                      (2 * lav + 1));
  349|  1.04k|  }
  350|       |
  351|  94.9k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  94.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  352|  94.9k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_sym_check:
   50|  1.21M|                                         WORD16 *const p_sym_bits) {
   51|  1.21M|  UWORD8 sym_bits = 0;
   52|  1.21M|  UWORD8 num_sbits = 0;
   53|  1.21M|  WORD16 sum_val = data[0] + data[1];
   54|  1.21M|  WORD16 diff_val = data[0] - data[1];
   55|       |
   56|  1.21M|  if (sum_val != 0) {
  ------------------
  |  Branch (56:7): [True: 542k, False: 672k]
  ------------------
   57|   542k|    WORD8 sum_neg = (sum_val < 0) ? 1 : 0;
  ------------------
  |  Branch (57:21): [True: 264k, False: 277k]
  ------------------
   58|   542k|    if (sum_neg) {
  ------------------
  |  Branch (58:9): [True: 264k, False: 277k]
  ------------------
   59|   264k|      sum_val = -sum_val;
   60|   264k|      diff_val = -diff_val;
   61|   264k|    }
   62|   542k|    sym_bits = (sym_bits << 1) | sum_neg;
   63|   542k|    num_sbits++;
   64|   542k|  }
   65|       |
   66|  1.21M|  if (diff_val != 0) {
  ------------------
  |  Branch (66:7): [True: 460k, False: 755k]
  ------------------
   67|   460k|    WORD8 diff_neg = (diff_val < 0) ? 1 : 0;
  ------------------
  |  Branch (67:22): [True: 225k, False: 234k]
  ------------------
   68|   460k|    if (diff_neg) {
  ------------------
  |  Branch (68:9): [True: 225k, False: 234k]
  ------------------
   69|   225k|      diff_val = -diff_val;
   70|   225k|    }
   71|   460k|    sym_bits = (sym_bits << 1) | diff_neg;
   72|   460k|    num_sbits++;
   73|   460k|  }
   74|  1.21M|  *p_sym_bits = sym_bits;
   75|       |
   76|  1.21M|  if (!(sum_val % 2)) {
  ------------------
  |  Branch (76:7): [True: 887k, False: 327k]
  ------------------
   77|   887k|    data[0] = (sum_val / 2);
   78|   887k|    data[1] = (diff_val / 2);
   79|   887k|  } else {
   80|   327k|    data[0] = (lav - sum_val / 2);
   81|   327k|    data[1] = (lav - diff_val / 2);
   82|   327k|  }
   83|       |
   84|  1.21M|  return num_sbits;
   85|  1.21M|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_get_huff_entry:
  242|  1.21M|                                            ixheaace_mps_huff_entry *const pstr_huff_escape) {
  243|  1.21M|  const ixheaace_mps_huff_cld_tab_2d *pstr_huff_cld_tab_2d =
  244|  1.21M|      &ixheaace_mps_212_huff_cld_tab.h2_d[tab_idx_2_d[0]][tab_idx_2_d[1]];
  245|  1.21M|  const ixheaace_mps_huff_icc_tab_2d *pstr_huff_icc_tab_2d =
  246|  1.21M|      &ixheaace_mps_212_huff_icc_tab.h2_d[tab_idx_2_d[0]][tab_idx_2_d[1]];
  247|       |
  248|  1.21M|  switch (lav) {
  ------------------
  |  Branch (248:11): [True: 1.21M, False: 0]
  ------------------
  249|  12.8k|    case 9: {
  ------------------
  |  Branch (249:5): [True: 12.8k, False: 1.20M]
  ------------------
  250|  12.8k|      *pstr_huff_entry = pstr_huff_cld_tab_2d->lav9.entry[in_data[band][0]][in_data[band][1]];
  251|  12.8k|      *pstr_huff_escape = pstr_huff_cld_tab_2d->lav9.escape;
  252|  12.8k|    } break;
  253|  98.0k|    case 7: {
  ------------------
  |  Branch (253:5): [True: 98.0k, False: 1.11M]
  ------------------
  254|  98.0k|      switch (data_type) {
  ------------------
  |  Branch (254:15): [True: 98.0k, False: 0]
  ------------------
  255|  28.0k|        case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|  28.0k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (255:9): [True: 28.0k, False: 70.0k]
  ------------------
  256|  28.0k|          *pstr_huff_entry = pstr_huff_cld_tab_2d->lav7.entry[in_data[band][0]][in_data[band][1]];
  257|  28.0k|          *pstr_huff_escape = pstr_huff_cld_tab_2d->lav7.escape;
  258|  28.0k|          break;
  259|  70.0k|        case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|  70.0k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (259:9): [True: 70.0k, False: 28.0k]
  ------------------
  260|  70.0k|          *pstr_huff_entry = pstr_huff_icc_tab_2d->lav7.entry[in_data[band][0]][in_data[band][1]];
  261|  70.0k|          *pstr_huff_escape = pstr_huff_icc_tab_2d->lav7.escape;
  262|  70.0k|          break;
  263|  98.0k|      }
  264|  98.0k|    } break;
  265|   184k|    case 5: {
  ------------------
  |  Branch (265:5): [True: 184k, False: 1.03M]
  ------------------
  266|   184k|      switch (data_type) {
  ------------------
  |  Branch (266:15): [True: 184k, False: 0]
  ------------------
  267|  61.2k|        case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|  61.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (267:9): [True: 61.2k, False: 123k]
  ------------------
  268|  61.2k|          *pstr_huff_entry = pstr_huff_cld_tab_2d->lav5.entry[in_data[band][0]][in_data[band][1]];
  269|  61.2k|          *pstr_huff_escape = pstr_huff_cld_tab_2d->lav5.escape;
  270|  61.2k|          break;
  271|   123k|        case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|   123k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (271:9): [True: 123k, False: 61.2k]
  ------------------
  272|   123k|          *pstr_huff_entry = pstr_huff_icc_tab_2d->lav5.entry[in_data[band][0]][in_data[band][1]];
  273|   123k|          *pstr_huff_escape = pstr_huff_icc_tab_2d->lav5.escape;
  274|   123k|          break;
  275|   184k|      }
  276|   184k|    } break;
  277|   644k|    case 3: {
  ------------------
  |  Branch (277:5): [True: 644k, False: 570k]
  ------------------
  278|   644k|      switch (data_type) {
  ------------------
  |  Branch (278:15): [True: 644k, False: 0]
  ------------------
  279|   479k|        case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|   479k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (279:9): [True: 479k, False: 165k]
  ------------------
  280|   479k|          *pstr_huff_entry = pstr_huff_cld_tab_2d->lav3.entry[in_data[band][0]][in_data[band][1]];
  281|   479k|          *pstr_huff_escape = pstr_huff_cld_tab_2d->lav3.escape;
  282|   479k|          break;
  283|   165k|        case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|   165k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (283:9): [True: 165k, False: 479k]
  ------------------
  284|   165k|          *pstr_huff_entry = pstr_huff_icc_tab_2d->lav3.entry[in_data[band][0]][in_data[band][1]];
  285|   165k|          *pstr_huff_escape = pstr_huff_icc_tab_2d->lav3.escape;
  286|   165k|          break;
  287|   644k|      }
  288|   644k|    } break;
  289|   644k|    case 1: {
  ------------------
  |  Branch (289:5): [True: 274k, False: 940k]
  ------------------
  290|   274k|      *pstr_huff_entry = pstr_huff_icc_tab_2d->lav1.entry[in_data[band][0]][in_data[band][1]];
  291|   274k|      *pstr_huff_escape = pstr_huff_icc_tab_2d->lav1.escape;
  292|   274k|    } break;
  293|  1.21M|  }
  294|  1.21M|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_apply_pcm_coding:
  131|  4.40k|                                              const WORD16 num_val, const WORD16 n_levels) {
  132|  4.40k|  WORD16 val = 0, lvl = 0, idx = 0;
  133|  4.40k|  WORD16 max_grp_len = 0, grp_len = 0, next_val = 0;
  134|  4.40k|  WORD32 grp_val = 0, chunk_levels = 0;
  135|  4.40k|  UWORD8 pcm_block_size[7] = {0};
  136|       |
  137|  4.40k|  switch (n_levels) {
  138|      0|    case 7:
  ------------------
  |  Branch (138:5): [True: 0, False: 4.40k]
  ------------------
  139|      0|      max_grp_len = 6;
  140|      0|      break;
  141|      0|    case 3:
  ------------------
  |  Branch (141:5): [True: 0, False: 4.40k]
  ------------------
  142|      0|    case 6:
  ------------------
  |  Branch (142:5): [True: 0, False: 4.40k]
  ------------------
  143|      0|    case 9:
  ------------------
  |  Branch (143:5): [True: 0, False: 4.40k]
  ------------------
  144|      0|      max_grp_len = 5;
  145|      0|      break;
  146|      0|    case 13:
  ------------------
  |  Branch (146:5): [True: 0, False: 4.40k]
  ------------------
  147|      4|    case 19:
  ------------------
  |  Branch (147:5): [True: 4, False: 4.39k]
  ------------------
  148|      4|    case 51:
  ------------------
  |  Branch (148:5): [True: 0, False: 4.40k]
  ------------------
  149|      4|      max_grp_len = 4;
  150|      4|      break;
  151|      0|    case 5:
  ------------------
  |  Branch (151:5): [True: 0, False: 4.40k]
  ------------------
  152|      0|    case 25:
  ------------------
  |  Branch (152:5): [True: 0, False: 4.40k]
  ------------------
  153|      0|      max_grp_len = 3;
  154|      0|      break;
  155|     12|    case 11:
  ------------------
  |  Branch (155:5): [True: 12, False: 4.38k]
  ------------------
  156|     12|      max_grp_len = 2;
  157|     12|      break;
  158|  4.38k|    default:
  ------------------
  |  Branch (158:5): [True: 4.38k, False: 16]
  ------------------
  159|  4.38k|      max_grp_len = 1;
  160|  4.40k|  }
  161|       |
  162|  4.40k|  chunk_levels = 1;
  163|  8.82k|  for (lvl = 1; lvl <= max_grp_len; lvl++) {
  ------------------
  |  Branch (163:17): [True: 4.42k, False: 4.40k]
  ------------------
  164|  4.42k|    chunk_levels *= n_levels;
  165|  4.42k|    pcm_block_size[lvl] = (UWORD8)round(log(chunk_levels) / log(2));
  166|  4.42k|  }
  167|       |
  168|  96.8k|  for (val = 0; val < num_val; val += max_grp_len) {
  ------------------
  |  Branch (168:17): [True: 92.4k, False: 4.40k]
  ------------------
  169|  92.4k|    grp_len = MIN(max_grp_len, num_val - val);
  ------------------
  |  |   23|  92.4k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 88.0k, False: 4.40k]
  |  |  ------------------
  ------------------
  170|  92.4k|    grp_val = 0;
  171|   184k|    for (lvl = 0; lvl < grp_len; lvl++) {
  ------------------
  |  Branch (171:19): [True: 92.4k, False: 92.4k]
  ------------------
  172|  92.4k|      idx = val + lvl;
  173|  92.4k|      next_val = (in_data_2 == NULL)
  ------------------
  |  Branch (173:18): [True: 89.6k, False: 2.86k]
  ------------------
  174|  92.4k|                     ? in_data_1[idx]
  175|  92.4k|                     : (in_data_1 == NULL)
  ------------------
  |  Branch (175:24): [True: 0, False: 2.86k]
  ------------------
  176|  2.86k|                           ? in_data_2[idx]
  177|  2.86k|                           : ((idx & 01) ? in_data_2[idx >> 1] : in_data_1[idx >> 1]);
  ------------------
  |  Branch (177:31): [True: 1.43k, False: 1.43k]
  ------------------
  178|  92.4k|      grp_val = grp_val * n_levels + next_val + offset;
  179|  92.4k|    }
  180|  92.4k|    ixheaace_write_bits(pstr_bit_buf, grp_val, pcm_block_size[grp_len]);
  181|  92.4k|  }
  182|  4.40k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_212_apply_huff_coding:
  550|  39.9k|    const WORD16 bands, const WORD16 *const lav_idx, WORD16 huff_dim, WORD16 huff_pair_type) {
  551|  39.9k|  IA_ERRORCODE error;
  552|  39.9k|  WORD16 band = 0;
  553|  39.9k|  WORD16 num_band_short_data_1 = bands;
  554|  39.9k|  WORD16 num_band_short_data_2 = bands;
  555|  39.9k|  UWORD16 huff_bits;
  556|       |
  557|  39.9k|  WORD16 df_rest_flag[2] = {0};
  558|  39.9k|  WORD16 part_0_flag[2] = {0};
  559|  39.9k|  WORD16 tab_idx_1_d[2] = {0};
  560|  39.9k|  WORD16 tab_idx_2_d[2][2] = {{0}};
  561|  39.9k|  WORD16 pair_vec[IXHEAACE_MPS_SAC_MAX_FREQ_BANDS][2] = {{0}};
  562|       |
  563|  39.9k|  WORD16 *part_0_data_1[2] = {NULL};
  564|  39.9k|  WORD16 *part_0_data_2[2] = {NULL};
  565|  39.9k|  WORD16 *in_short_data_1 = NULL;
  566|  39.9k|  WORD16 *in_short_data_2 = NULL;
  567|       |
  568|  39.9k|  ixheaace_write_bits(pstr_bit_buf, huff_dim, 1);
  569|  39.9k|  if (huff_dim == IXHEAACE_MPS_SAC_HUFF_1D) {
  ------------------
  |  |   34|  39.9k|#define IXHEAACE_MPS_SAC_HUFF_1D (0x0)
  ------------------
  |  Branch (569:7): [True: 16.7k, False: 23.1k]
  ------------------
  570|  16.7k|    part_0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  16.7k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  571|  16.7k|    part_0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|  16.7k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  572|       |
  573|  16.7k|    tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  16.7k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (573:22): [True: 14.9k, False: 1.72k]
  ------------------
  574|  16.7k|    tab_idx_1_d[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  16.7k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (574:22): [True: 14.9k, False: 1.72k]
  ------------------
  575|       |
  576|  16.7k|    if (in_data_1 != NULL) {
  ------------------
  |  Branch (576:9): [True: 16.7k, False: 0]
  ------------------
  577|  16.7k|      in_short_data_1 = in_data_1 + (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|  16.7k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (577:38): [True: 1.72k, False: 14.9k]
  ------------------
  578|  16.7k|      error =
  579|  16.7k|          ixheaace_mps_212_huff_enc_1_d(pstr_bit_buf, data_type, tab_idx_1_d[0], in_short_data_1,
  580|  16.7k|                                        num_band_short_data_1, part_0_flag[0], &huff_bits);
  581|  16.7k|      if (error) {
  ------------------
  |  Branch (581:11): [True: 0, False: 16.7k]
  ------------------
  582|      0|        return error;
  583|      0|      }
  584|  16.7k|    }
  585|  16.7k|    if (in_data_2 != NULL) {
  ------------------
  |  Branch (585:9): [True: 0, False: 16.7k]
  ------------------
  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|  23.1k|  } else {
  595|  23.1k|    if (huff_pair_type == IXHEAACE_MPS_SAC_FREQ_PAIR) {
  ------------------
  |  |   32|  23.1k|#define IXHEAACE_MPS_SAC_FREQ_PAIR (0x0)
  ------------------
  |  Branch (595:9): [True: 23.1k, False: 0]
  ------------------
  596|  23.1k|      if (in_data_1 != NULL) {
  ------------------
  |  Branch (596:11): [True: 23.1k, False: 0]
  ------------------
  597|  23.1k|        in_short_data_1 = in_data_1 + (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME ? 2 : 0);
  ------------------
  |  |   30|  23.1k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (597:40): [True: 9.24k, False: 13.9k]
  ------------------
  598|  23.1k|        if (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) {
  ------------------
  |  |   29|  23.1k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (598:13): [True: 13.9k, False: 9.24k]
  ------------------
  599|  13.9k|          part_0_data_1[0] = &in_data_1[0];
  600|  13.9k|          part_0_data_1[1] = NULL;
  601|       |
  602|  13.9k|          num_band_short_data_1 -= 1;
  603|  13.9k|          in_short_data_1 += 1;
  604|  13.9k|        }
  605|       |
  606|  23.1k|        df_rest_flag[0] = num_band_short_data_1 % 2;
  607|       |
  608|  23.1k|        if (df_rest_flag[0]) num_band_short_data_1 -= 1;
  ------------------
  |  Branch (608:13): [True: 13.5k, False: 9.67k]
  ------------------
  609|       |
  610|   321k|        for (band = 0; band < num_band_short_data_1 - 1; band += 2) {
  ------------------
  |  Branch (610:24): [True: 298k, False: 23.1k]
  ------------------
  611|   298k|          pair_vec[band][0] = in_short_data_1[band];
  612|   298k|          pair_vec[band][1] = in_short_data_1[band + 1];
  613|   298k|        }
  614|       |
  615|  23.1k|        tab_idx_2_d[0][0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|  23.1k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (615:29): [True: 9.24k, False: 13.9k]
  ------------------
  616|  23.1k|        tab_idx_2_d[0][1] = 0;
  617|       |
  618|  23.1k|        tab_idx_1_d[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ) ? 0 : 1;
  ------------------
  |  |   29|  23.1k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
  |  Branch (618:26): [True: 13.9k, False: 9.24k]
  ------------------
  619|  23.1k|      }
  620|  23.1k|      if (in_data_2 != NULL) {
  ------------------
  |  Branch (620:11): [True: 0, False: 23.1k]
  ------------------
  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|  23.1k|      if (in_data_1 != NULL) {
  ------------------
  |  Branch (644:11): [True: 23.1k, False: 0]
  ------------------
  645|  23.1k|        ixheaace_write_bits(pstr_bit_buf, lav_huff_val[lav_idx[0]], lav_huff_len[lav_idx[0]]);
  646|  23.1k|        error = ixheaace_mps_212_huff_enc_2_d(pstr_bit_buf, data_type, tab_idx_2_d[0], lav_idx[0],
  647|  23.1k|                                              pair_vec, num_band_short_data_1, 2, part_0_data_1,
  648|  23.1k|                                              &huff_bits);
  649|  23.1k|        if (error) {
  ------------------
  |  Branch (649:13): [True: 0, False: 23.1k]
  ------------------
  650|      0|          return error;
  651|      0|        }
  652|  23.1k|        if (df_rest_flag[0]) {
  ------------------
  |  Branch (652:13): [True: 13.5k, False: 9.67k]
  ------------------
  653|  13.5k|          error = ixheaace_mps_212_huff_enc_1_d(pstr_bit_buf, data_type, tab_idx_1_d[0],
  654|  13.5k|                                                in_short_data_1 + num_band_short_data_1, 1, 0,
  655|  13.5k|                                                &huff_bits);
  656|  13.5k|          if (error) {
  ------------------
  |  Branch (656:15): [True: 0, False: 13.5k]
  ------------------
  657|      0|            return error;
  658|      0|          }
  659|  13.5k|        }
  660|  23.1k|      }
  661|  23.1k|      if (in_data_2 != NULL) {
  ------------------
  |  Branch (661:11): [True: 0, False: 23.1k]
  ------------------
  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|  23.1k|    } 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|  23.1k|  }
  713|  39.9k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  39.9k|#define IA_NO_ERROR 0x00000000
  ------------------
  714|  39.9k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_split_lsb:
  718|   152k|                                         WORD32 *out_data_msb) {
  719|   152k|  WORD32 i = 0, val = 0, lsb = 0, msb = 0;
  720|       |
  721|   152k|  UWORD32 mask = (1 << num_lsb) - 1;
  722|   152k|  WORD32 no_lsb_bits = 0;
  723|       |
  724|  2.84M|  for (i = 0; i < num_val; i++) {
  ------------------
  |  Branch (724:15): [True: 2.69M, False: 152k]
  ------------------
  725|  2.69M|    val = in_data[i] + offset;
  726|       |
  727|  2.69M|    lsb = val & mask;
  728|  2.69M|    msb = val >> num_lsb;
  729|       |
  730|  2.69M|    if (out_data_lsb != NULL) out_data_lsb[i] = lsb;
  ------------------
  |  Branch (730:9): [True: 2.69M, False: 0]
  ------------------
  731|  2.69M|    if (out_data_msb != NULL) out_data_msb[i] = msb;
  ------------------
  |  Branch (731:9): [True: 2.69M, False: 0]
  ------------------
  732|       |
  733|  2.69M|    no_lsb_bits += num_lsb;
  734|  2.69M|  }
  735|       |
  736|   152k|  return no_lsb_bits;
  737|   152k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_calc_diff_freq:
  749|   152k|static VOID ixheaace_mps_515_calc_diff_freq(WORD32 *in_data, WORD32 *out_data, WORD32 num_val) {
  750|   152k|  WORD32 i = 0;
  751|       |
  752|   152k|  out_data[0] = in_data[0];
  753|       |
  754|  2.69M|  for (i = 1; i < num_val; i++) {
  ------------------
  |  Branch (754:15): [True: 2.53M, False: 152k]
  ------------------
  755|  2.53M|    out_data[i] = in_data[i] - in_data[i - 1];
  756|  2.53M|  }
  757|   152k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_calc_pcm_bits:
  770|   152k|static WORD32 ixheaace_mps_515_calc_pcm_bits(WORD32 num_val, WORD32 n_levels) {
  771|   152k|  WORD32 num_complete_chunks = 0, rest_chunk_size = 0;
  772|   152k|  WORD32 max_grp_len = 0, bits_pcm = 0;
  773|       |
  774|   152k|  FLOAT32 num_ld_levels = 0.f;
  775|       |
  776|   152k|  switch (n_levels) {
  777|      0|    case 3:
  ------------------
  |  Branch (777:5): [True: 0, False: 152k]
  ------------------
  778|      0|      max_grp_len = 5;
  779|      0|      break;
  780|      0|    case 7:
  ------------------
  |  Branch (780:5): [True: 0, False: 152k]
  ------------------
  781|      0|      max_grp_len = 6;
  782|      0|      break;
  783|      0|    case 11:
  ------------------
  |  Branch (783:5): [True: 0, False: 152k]
  ------------------
  784|      0|      max_grp_len = 2;
  785|      0|      break;
  786|      0|    case 13:
  ------------------
  |  Branch (786:5): [True: 0, False: 152k]
  ------------------
  787|      0|      max_grp_len = 4;
  788|      0|      break;
  789|      0|    case 19:
  ------------------
  |  Branch (789:5): [True: 0, False: 152k]
  ------------------
  790|      0|      max_grp_len = 4;
  791|      0|      break;
  792|      0|    case 25:
  ------------------
  |  Branch (792:5): [True: 0, False: 152k]
  ------------------
  793|      0|      max_grp_len = 3;
  794|      0|      break;
  795|      0|    case 51:
  ------------------
  |  Branch (795:5): [True: 0, False: 152k]
  ------------------
  796|      0|      max_grp_len = 4;
  797|      0|      break;
  798|       |
  799|      0|    case 4:
  ------------------
  |  Branch (799:5): [True: 0, False: 152k]
  ------------------
  800|  53.7k|    case 8:
  ------------------
  |  Branch (800:5): [True: 53.7k, False: 98.5k]
  ------------------
  801|  53.7k|    case 15:
  ------------------
  |  Branch (801:5): [True: 0, False: 152k]
  ------------------
  802|  53.7k|    case 26:
  ------------------
  |  Branch (802:5): [True: 0, False: 152k]
  ------------------
  803|   152k|    case 31:
  ------------------
  |  Branch (803:5): [True: 98.5k, False: 53.7k]
  ------------------
  804|   152k|      max_grp_len = 1;
  805|   152k|      break;
  806|      0|    default:
  ------------------
  |  Branch (806:5): [True: 0, False: 152k]
  ------------------
  807|      0|      return IA_EXHEAACE_EXE_FATAL_MPS_INVALID_LEVELS;
  808|   152k|  }
  809|       |
  810|   152k|  num_ld_levels = (FLOAT32)(log((FLOAT32)n_levels) / log(2.f));
  811|       |
  812|   152k|  num_complete_chunks = num_val / max_grp_len;
  813|   152k|  rest_chunk_size = num_val % max_grp_len;
  814|       |
  815|   152k|  bits_pcm = ((WORD32)ceil((FLOAT32)(max_grp_len)*num_ld_levels)) * num_complete_chunks;
  816|   152k|  bits_pcm += (WORD32)ceil((FLOAT32)(rest_chunk_size)*num_ld_levels);
  817|       |
  818|   152k|  return bits_pcm;
  819|   152k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_calc_huff_bits:
 1063|   304k|                                              WORD32 diff_type_2, WORD32 num_val) {
 1064|   304k|  WORD32 p0_flag[2];
 1065|       |
 1066|   304k|  WORD32 offset_1 = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|   304k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1066:21): [True: 0, False: 304k]
  ------------------
 1067|   304k|  WORD32 offset_2 = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME) ? 1 : 0;
  ------------------
  |  |   30|   304k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1067:21): [True: 152k, False: 152k]
  ------------------
 1068|       |
 1069|   304k|  WORD32 bit_count_huff = 0;
 1070|       |
 1071|   304k|  WORD32 num_val_1_int = 0;
 1072|   304k|  WORD32 num_val_2_int = 0;
 1073|       |
 1074|   304k|  WORD32 *in_data_1_int = in_data_1 + offset_1;
 1075|   304k|  WORD32 *in_data_2_int = in_data_2 + offset_2;
 1076|       |
 1077|   304k|  bit_count_huff = 1;
 1078|       |
 1079|   304k|  num_val_1_int = num_val;
 1080|   304k|  num_val_2_int = num_val;
 1081|       |
 1082|   304k|  p0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   304k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1083|   304k|  p0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   304k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1084|       |
 1085|   304k|  switch (data_type) {
 1086|   197k|    case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|   197k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1086:5): [True: 197k, False: 107k]
  ------------------
 1087|   197k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1087:11): [True: 197k, False: 0]
  ------------------
 1088|   197k|        bit_count_huff +=
 1089|   197k|            ixheaace_mps_515_count_huff_cld(&ixheaace_mps_515_huff_cld_tab.huff_pt0,
 1090|   197k|                                            &ixheaace_mps_515_huff_cld_tab.huff_diff[diff_type_1],
 1091|   197k|                                            in_data_1_int, num_val_1_int, p0_flag[0]);
 1092|   197k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1092:11): [True: 0, False: 197k]
  ------------------
 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|   197k|      break;
 1098|       |
 1099|   107k|    case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|   107k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1099:5): [True: 107k, False: 197k]
  ------------------
 1100|   107k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1100:11): [True: 107k, False: 0]
  ------------------
 1101|   107k|        bit_count_huff +=
 1102|   107k|            ixheaace_mps_515_count_huff_icc(&ixheaace_mps_515_huff_icc_tab.huff_pt0,
 1103|   107k|                                            &ixheaace_mps_515_huff_icc_tab.huff_diff[diff_type_1],
 1104|   107k|                                            in_data_1_int, num_val_1_int, p0_flag[0]);
 1105|   107k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1105:11): [True: 0, False: 107k]
  ------------------
 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|   107k|      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: 304k]
  ------------------
 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: 304k]
  ------------------
 1126|      0|      break;
 1127|   304k|  }
 1128|       |
 1129|   304k|  return bit_count_huff;
 1130|   304k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_count_huff_cld:
  876|   197k|    WORD32 p0_flag) {
  877|   197k|  WORD32 i = 0, id = 0;
  878|   197k|  WORD32 huff_bits = 0;
  879|   197k|  WORD32 offset = 0;
  880|   197k|  if (p0_flag) {
  ------------------
  |  Branch (880:7): [True: 197k, False: 0]
  ------------------
  881|   197k|    huff_bits += pstr_huff_cld_tab_pt0->length[in_data[0]];
  882|   197k|    offset = 1;
  883|   197k|  }
  884|       |
  885|  3.23M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (885:20): [True: 3.03M, False: 197k]
  ------------------
  886|  3.03M|    id = in_data[i];
  887|       |
  888|  3.03M|    if (id != 0) {
  ------------------
  |  Branch (888:9): [True: 352k, False: 2.68M]
  ------------------
  889|   352k|      if (id < 0) {
  ------------------
  |  Branch (889:11): [True: 177k, False: 174k]
  ------------------
  890|   177k|        id = -id;
  891|   177k|      }
  892|   352k|      huff_bits += 1;
  893|   352k|    }
  894|       |
  895|  3.03M|    huff_bits += pstr_huff_cld_tab_diff->length[id];
  896|  3.03M|  }
  897|       |
  898|   197k|  return huff_bits;
  899|   197k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_count_huff_icc:
  904|   107k|    WORD32 p0_flag) {
  905|   107k|  WORD32 i = 0, id = 0;
  906|   107k|  WORD32 huff_bits = 0;
  907|   107k|  WORD32 offset = 0;
  908|       |
  909|   107k|  if (p0_flag) {
  ------------------
  |  Branch (909:7): [True: 107k, False: 0]
  ------------------
  910|   107k|    huff_bits += pstr_huff_icc_tab_pt0->length[in_data[0]];
  911|   107k|    offset = 1;
  912|   107k|  }
  913|       |
  914|  2.14M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (914:20): [True: 2.04M, False: 107k]
  ------------------
  915|  2.04M|    id = in_data[i];
  916|       |
  917|  2.04M|    if (id != 0) {
  ------------------
  |  Branch (917:9): [True: 208k, False: 1.83M]
  ------------------
  918|   208k|      if (id < 0) {
  ------------------
  |  Branch (918:11): [True: 78.4k, False: 129k]
  ------------------
  919|  78.4k|        id = -id;
  920|  78.4k|      }
  921|   208k|      huff_bits += 1;
  922|   208k|    }
  923|       |
  924|  2.04M|    huff_bits += pstr_huff_icc_tab_diff->length[id];
  925|  2.04M|  }
  926|       |
  927|   107k|  return huff_bits;
  928|   107k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_apply_pcm_coding:
  823|  10.9k|                                              WORD32 num_val, WORD32 n_levels) {
  824|  10.9k|  WORD32 i = 0, j = 0, idx = 0;
  825|  10.9k|  WORD32 max_grp_len = 1, grp_len = 0, next_val = 0, grp_val = 0;
  826|       |
  827|  10.9k|  FLOAT32 num_ld_levels = 0.f;
  828|       |
  829|  10.9k|  UWORD8 pcm_block_size[7] = {0};
  830|  10.9k|  switch (n_levels) {
  ------------------
  |  Branch (830:11): [True: 10.9k, False: 0]
  ------------------
  831|      0|    case 4:
  ------------------
  |  Branch (831:5): [True: 0, False: 10.9k]
  ------------------
  832|      0|      num_ld_levels = 2.00000000f;
  833|      0|      break;
  834|  3.46k|    case 8:
  ------------------
  |  Branch (834:5): [True: 3.46k, False: 7.44k]
  ------------------
  835|  3.46k|      num_ld_levels = 3.00000000f;
  836|  3.46k|      break;
  837|      0|    case 15:
  ------------------
  |  Branch (837:5): [True: 0, False: 10.9k]
  ------------------
  838|      0|      num_ld_levels = 3.90689060f;
  839|      0|      break;
  840|      0|    case 26:
  ------------------
  |  Branch (840:5): [True: 0, False: 10.9k]
  ------------------
  841|      0|      num_ld_levels = 4.70043972f;
  842|      0|      break;
  843|  7.44k|    case 31:
  ------------------
  |  Branch (843:5): [True: 7.44k, False: 3.46k]
  ------------------
  844|  7.44k|      num_ld_levels = 4.95419645f;
  845|  7.44k|      break;
  846|      0|    case 51:
  ------------------
  |  Branch (846:5): [True: 0, False: 10.9k]
  ------------------
  847|      0|      max_grp_len = 4;
  848|      0|      num_ld_levels = 5.67242534f;
  849|      0|      break;
  850|  10.9k|  }
  851|       |
  852|  21.8k|  for (i = 1; i <= max_grp_len; i++) {
  ------------------
  |  Branch (852:15): [True: 10.9k, False: 10.9k]
  ------------------
  853|  10.9k|    pcm_block_size[i] = (UWORD8)ceil((FLOAT32)(i)*num_ld_levels);
  854|  10.9k|  }
  855|       |
  856|  96.1k|  for (i = 0; i < num_val; i += max_grp_len) {
  ------------------
  |  Branch (856:15): [True: 85.1k, False: 10.9k]
  ------------------
  857|  85.1k|    grp_len = MIN(max_grp_len, num_val - i);
  ------------------
  |  |   23|  85.1k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 74.2k, False: 10.9k]
  |  |  ------------------
  ------------------
  858|  85.1k|    grp_val = 0;
  859|   170k|    for (j = 0; j < grp_len; j++) {
  ------------------
  |  Branch (859:17): [True: 85.1k, False: 85.1k]
  ------------------
  860|  85.1k|      idx = i + j;
  861|  85.1k|      next_val = (in_data_2 == NULL)
  ------------------
  |  Branch (861:18): [True: 85.1k, False: 0]
  ------------------
  862|  85.1k|                     ? in_data_1[idx]
  863|  85.1k|                     : (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|  85.1k|      grp_val = grp_val * n_levels + next_val + offset;
  867|  85.1k|    }
  868|       |
  869|  85.1k|    ixheaace_write_bits(pstr_bit_buf, grp_val, pcm_block_size[grp_len]);
  870|  85.1k|  }
  871|  10.9k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_apply_huff_coding:
 1135|   141k|                                               WORD32 diff_type_2, WORD32 num_val) {
 1136|   141k|  WORD32 p0_flag[2];
 1137|       |
 1138|   141k|  WORD32 num_val_1_int = num_val;
 1139|   141k|  WORD32 num_val_2_int = num_val;
 1140|       |
 1141|   141k|  WORD32 *in_data_1_int = in_data_1;
 1142|   141k|  WORD32 *in_data_2_int = in_data_2;
 1143|       |
 1144|   141k|  if (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_TIME) in_data_1_int += 1;
  ------------------
  |  |   30|   141k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1144:7): [True: 0, False: 141k]
  ------------------
 1145|   141k|  if (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_TIME) in_data_2_int += 1;
  ------------------
  |  |   30|   141k|#define IXHEAACE_MPS_SAC_DIFF_TIME (0x1)
  ------------------
  |  Branch (1145:7): [True: 0, False: 141k]
  ------------------
 1146|       |
 1147|   141k|  ixheaace_write_bits(pstr_bit_buf, IXHEAACE_MPS_SAC_HUFF_1D, 1);
  ------------------
  |  |   34|   141k|#define IXHEAACE_MPS_SAC_HUFF_1D (0x0)
  ------------------
 1148|       |
 1149|   141k|  p0_flag[0] = (diff_type_1 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   141k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1150|   141k|  p0_flag[1] = (diff_type_2 == IXHEAACE_MPS_SAC_DIFF_FREQ);
  ------------------
  |  |   29|   141k|#define IXHEAACE_MPS_SAC_DIFF_FREQ (0x0)
  ------------------
 1151|       |
 1152|   141k|  switch (data_type) {
 1153|  91.1k|    case IXHEAACE_MPS_SAC_DATA_TYPE_CLD:
  ------------------
  |  |   22|  91.1k|#define IXHEAACE_MPS_SAC_DATA_TYPE_CLD (0x0)
  ------------------
  |  Branch (1153:5): [True: 91.1k, False: 50.2k]
  ------------------
 1154|  91.1k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1154:11): [True: 91.1k, False: 0]
  ------------------
 1155|  91.1k|        ixheaace_mps_515_huff_enc_cld(pstr_bit_buf, &ixheaace_mps_515_huff_cld_tab.huff_pt0,
 1156|  91.1k|                                      &ixheaace_mps_515_huff_cld_tab.huff_diff[diff_type_1],
 1157|  91.1k|                                      in_data_1_int, num_val_1_int, p0_flag[0]);
 1158|  91.1k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1158:11): [True: 0, False: 91.1k]
  ------------------
 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|  91.1k|      break;
 1163|       |
 1164|  50.2k|    case IXHEAACE_MPS_SAC_DATA_TYPE_ICC:
  ------------------
  |  |   23|  50.2k|#define IXHEAACE_MPS_SAC_DATA_TYPE_ICC (0x1)
  ------------------
  |  Branch (1164:5): [True: 50.2k, False: 91.1k]
  ------------------
 1165|  50.2k|      if (in_data_1 != NULL)
  ------------------
  |  Branch (1165:11): [True: 50.2k, False: 0]
  ------------------
 1166|  50.2k|        ixheaace_mps_515_huff_enc_icc(pstr_bit_buf, &ixheaace_mps_515_huff_icc_tab.huff_pt0,
 1167|  50.2k|                                      &ixheaace_mps_515_huff_icc_tab.huff_diff[diff_type_1],
 1168|  50.2k|                                      in_data_1_int, num_val_1_int, p0_flag[0]);
 1169|  50.2k|      if (in_data_2 != NULL)
  ------------------
  |  Branch (1169:11): [True: 0, False: 50.2k]
  ------------------
 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|  50.2k|      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: 141k]
  ------------------
 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: 141k]
  ------------------
 1187|      0|      break;
 1188|   141k|  }
 1189|   141k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_huff_enc_cld:
  963|  91.1k|    WORD32 p0_flag) {
  964|  91.1k|  WORD32 i = 0, id = 0, id_sign = 0;
  965|  91.1k|  WORD32 offset = 0;
  966|       |
  967|  91.1k|  if (p0_flag) {
  ------------------
  |  Branch (967:7): [True: 91.1k, False: 0]
  ------------------
  968|  91.1k|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_cld_tab_pt0->value[in_data[0]],
  969|  91.1k|                        pstr_huff_cld_tab_pt0->length[in_data[0]]);
  970|  91.1k|    offset = 1;
  971|  91.1k|  }
  972|       |
  973|  1.60M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (973:20): [True: 1.50M, False: 91.1k]
  ------------------
  974|  1.50M|    id = in_data[i];
  975|       |
  976|  1.50M|    if (id != 0) {
  ------------------
  |  Branch (976:9): [True: 174k, False: 1.33M]
  ------------------
  977|   174k|      id_sign = 0;
  978|   174k|      if (id < 0) {
  ------------------
  |  Branch (978:11): [True: 88.1k, False: 86.4k]
  ------------------
  979|  88.1k|        id = -id;
  980|  88.1k|        id_sign = 1;
  981|  88.1k|      }
  982|   174k|    }
  983|       |
  984|  1.50M|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_cld_tab_diff->value[id],
  985|  1.50M|                        pstr_huff_cld_tab_diff->length[id]);
  986|       |
  987|  1.50M|    if (id != 0) {
  ------------------
  |  Branch (987:9): [True: 174k, False: 1.33M]
  ------------------
  988|   174k|      ixheaace_write_bits(pstr_bit_buf, id_sign, 1);
  989|   174k|    }
  990|  1.50M|  }
  991|  91.1k|}
ixheaace_mps_nlc_enc.c:ixheaace_mps_515_huff_enc_icc:
  997|  50.2k|    WORD32 p0_flag) {
  998|  50.2k|  WORD32 i = 0, id = 0, id_sign = 0;
  999|  50.2k|  WORD32 offset = 0;
 1000|       |
 1001|  50.2k|  if (p0_flag) {
  ------------------
  |  Branch (1001:7): [True: 50.2k, False: 0]
  ------------------
 1002|  50.2k|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_icc_tab_pt0->value[in_data[0]],
 1003|  50.2k|                        pstr_huff_icc_tab_pt0->length[in_data[0]]);
 1004|  50.2k|    offset = 1;
 1005|  50.2k|  }
 1006|       |
 1007|  1.00M|  for (i = offset; i < num_val; i++) {
  ------------------
  |  Branch (1007:20): [True: 954k, False: 50.2k]
  ------------------
 1008|   954k|    id = in_data[i];
 1009|       |
 1010|   954k|    if (id != 0) {
  ------------------
  |  Branch (1010:9): [True: 60.6k, False: 894k]
  ------------------
 1011|  60.6k|      id_sign = 0;
 1012|  60.6k|      if (id < 0) {
  ------------------
  |  Branch (1012:11): [True: 21.4k, False: 39.2k]
  ------------------
 1013|  21.4k|        id = -id;
 1014|  21.4k|        id_sign = 1;
 1015|  21.4k|      }
 1016|  60.6k|    }
 1017|       |
 1018|   954k|    ixheaace_write_bits(pstr_bit_buf, pstr_huff_icc_tab_diff->value[id],
 1019|   954k|                        pstr_huff_icc_tab_diff->length[id]);
 1020|       |
 1021|   954k|    if (id != 0) {
  ------------------
  |  Branch (1021:9): [True: 60.6k, False: 894k]
  ------------------
 1022|  60.6k|      ixheaace_write_bits(pstr_bit_buf, id_sign, 1);
 1023|  60.6k|    }
 1024|   954k|  }
 1025|  50.2k|}

ixheaace_mps_212_onset_detect_init:
   40|  2.49k|    const UWORD32 init_flag) {
   41|  2.49k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  2.49k|#define IA_NO_ERROR 0x00000000
  ------------------
   42|  2.49k|  WORD32 slot;
   43|  2.49k|  if ((pstr_onset_detect_config->max_time_slots > pstr_onset_detect->max_time_slots) ||
  ------------------
  |  Branch (43:7): [True: 0, False: 2.49k]
  ------------------
   44|  2.49k|      (pstr_onset_detect_config->upper_bound_onset_detection <
  ------------------
  |  Branch (44:7): [True: 0, False: 2.49k]
  ------------------
   45|  2.49k|       pstr_onset_detect->lower_bound_onset_detection)) {
   46|      0|    return IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   47|      0|  }
   48|  2.49k|  pstr_onset_detect->avg_energy_dist_scale = 4;
   49|  2.49k|  pstr_onset_detect->min_trans_dist = 8;
   50|  2.49k|  pstr_onset_detect->avg_energy_dist = 16;
   51|  2.49k|  pstr_onset_detect->lower_bound_onset_detection =
   52|  2.49k|      pstr_onset_detect_config->lower_bound_onset_detection;
   53|  2.49k|  pstr_onset_detect->upper_bound_onset_detection =
   54|  2.49k|      pstr_onset_detect_config->upper_bound_onset_detection;
   55|  2.49k|  pstr_onset_detect->max_time_slots = pstr_onset_detect_config->max_time_slots;
   56|  2.49k|  if (init_flag) {
  ------------------
  |  Branch (56:7): [True: 2.49k, False: 0]
  ------------------
   57|   125k|    for (slot = 0; slot < pstr_onset_detect->avg_energy_dist + pstr_onset_detect->max_time_slots;
  ------------------
  |  Branch (57:20): [True: 123k, False: 2.49k]
  ------------------
   58|   123k|         slot++) {
   59|   123k|      pstr_onset_detect->p_energy_hist[slot] = EPSILON;
  ------------------
  |  |   54|   123k|#define EPSILON (1e-9f)
  ------------------
   60|   123k|    }
   61|  2.49k|  }
   62|  2.49k|  return error;
   63|  2.49k|}
ixheaace_mps_212_onset_detect_update:
   67|   170k|                                     const WORD32 time_slots) {
   68|   170k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   170k|#define IA_NO_ERROR 0x00000000
  ------------------
   69|   170k|  WORD32 slot;
   70|   170k|  if (time_slots > pstr_onset_detect->max_time_slots) {
  ------------------
  |  Branch (70:7): [True: 0, False: 170k]
  ------------------
   71|      0|    error = IA_EXHEAACE_CONFIG_NONFATAL_MPS_INVALID_CONFIG;
   72|   170k|  } else {
   73|  2.90M|    for (slot = 0; slot < pstr_onset_detect->avg_energy_dist; slot++) {
  ------------------
  |  Branch (73:20): [True: 2.73M, False: 170k]
  ------------------
   74|  2.73M|      pstr_onset_detect->p_energy_hist[slot] =
   75|  2.73M|          pstr_onset_detect->p_energy_hist[slot + time_slots];
   76|  2.73M|    }
   77|       |
   78|  6.03M|    for (slot = 0; slot < time_slots; slot++) {
  ------------------
  |  Branch (78:20): [True: 5.86M, False: 170k]
  ------------------
   79|  5.86M|      pstr_onset_detect->p_energy_hist[pstr_onset_detect->avg_energy_dist + slot] = EPSILON;
  ------------------
  |  |   54|  5.86M|#define EPSILON (1e-9f)
  ------------------
   80|  5.86M|    }
   81|   170k|  }
   82|   170k|  return error;
   83|   170k|}
ixheaace_mps_212_onset_detect_apply:
   88|   170k|    WORD32 p_transient_pos[MAX_NUM_TRANS]) {
   89|   170k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|   170k|#define IA_NO_ERROR 0x00000000
  ------------------
   90|   170k|  WORD32 slot, tran_cnt, curr_pos;
   91|   170k|  WORD32 trans;
   92|   170k|  WORD32 lower_bound_onset_detection = pstr_onset_detect->lower_bound_onset_detection;
   93|   170k|  WORD32 upper_bound_onset_detection = pstr_onset_detect->upper_bound_onset_detection;
   94|   170k|  WORD32 avg_energy = pstr_onset_detect->avg_energy_dist;
   95|   170k|  WORD32 curr_pos_prev;
   96|   170k|  FLOAT32 p1, p2;
   97|   170k|  FLOAT32 threshold_square = (FLOAT32)SPACE_ONSET_THRESHOLD_SQUARE_FLT;
  ------------------
  |  |   75|   170k|#define SPACE_ONSET_THRESHOLD_SQUARE_FLT ((1.0 / (SPACE_ONSET_THRESHOLD * SPACE_ONSET_THRESHOLD)))
  |  |  ------------------
  |  |  |  |   74|   170k|#define SPACE_ONSET_THRESHOLD (3.0)
  |  |  ------------------
  |  |               #define SPACE_ONSET_THRESHOLD_SQUARE_FLT ((1.0 / (SPACE_ONSET_THRESHOLD * SPACE_ONSET_THRESHOLD)))
  |  |  ------------------
  |  |  |  |   74|   170k|#define SPACE_ONSET_THRESHOLD (3.0)
  |  |  ------------------
  ------------------
   98|   170k|  FLOAT32 *ptr_energy = pstr_onset_detect->p_energy_hist;
   99|   170k|  FLOAT32 energy[16 + MAX_TIME_SLOTS];
  100|   170k|  memset(energy, 0, (16 + MAX_TIME_SLOTS) * sizeof(FLOAT32));
  ------------------
  |  |   44|   170k|#define MAX_TIME_SLOTS (64)
  ------------------
  101|   170k|  tran_cnt = 0;
  102|   170k|  p2 = 0.0f;
  103|   682k|  for (trans = 0; trans < MAX_NUM_TRANS; trans++) {
  ------------------
  |  |   76|   682k|#define MAX_NUM_TRANS (MAX_NUM_PARAMS / 2)
  |  |  ------------------
  |  |  |  |   42|   682k|#define MAX_NUM_PARAMS (7)
  |  |  ------------------
  ------------------
  |  Branch (103:19): [True: 512k, False: 170k]
  ------------------
  104|   512k|    p_transient_pos[trans] = -1;
  105|   512k|  }
  106|       |
  107|   170k|  if (prev_pos <= 0) {
  ------------------
  |  Branch (107:7): [True: 170k, False: 0]
  ------------------
  108|   170k|    curr_pos = num_time_slots;
  109|   170k|  } 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.03M|  for (slot = 0; slot < num_time_slots; slot++) {
  ------------------
  |  Branch (113:18): [True: 5.86M, False: 170k]
  ------------------
  114|  5.86M|    ptr_energy[avg_energy + slot] = ixheaace_mps_212_sum_up_cplx_pow_2(
  115|  5.86M|        &pp_hybrid_data[slot][lower_bound_onset_detection + 1],
  116|  5.86M|        upper_bound_onset_detection - lower_bound_onset_detection - 1);
  117|  5.86M|  }
  118|       |
  119|  8.77M|  for (slot = 0; slot < (num_time_slots + avg_energy); slot++) {
  ------------------
  |  Branch (119:18): [True: 8.59M, False: 170k]
  ------------------
  120|  8.59M|    energy[slot] = ptr_energy[slot];
  121|  8.59M|  }
  122|       |
  123|   170k|  curr_pos_prev = curr_pos;
  124|  5.66M|  for (; (curr_pos < (num_time_slots << 1)) && (tran_cnt < MAX_NUM_TRANS); curr_pos++) {
  ------------------
  |  |   76|  5.48M|#define MAX_NUM_TRANS (MAX_NUM_PARAMS / 2)
  |  |  ------------------
  |  |  |  |   42|  5.48M|#define MAX_NUM_PARAMS (7)
  |  |  ------------------
  ------------------
  |  Branch (124:10): [True: 5.48M, False: 170k]
  |  Branch (124:48): [True: 5.48M, False: 27]
  ------------------
  125|  5.48M|    p1 = energy[curr_pos - num_time_slots + avg_energy] * threshold_square;
  126|       |
  127|  5.48M|    if (curr_pos_prev != (curr_pos - 1)) {
  ------------------
  |  Branch (127:9): [True: 214k, False: 5.27M]
  ------------------
  128|   214k|      p2 = 0.0f;
  129|  3.65M|      for (slot = 0; slot < avg_energy; slot++) {
  ------------------
  |  Branch (129:22): [True: 3.43M, False: 214k]
  ------------------
  130|  3.43M|        p2 += energy[curr_pos - num_time_slots + slot];
  131|  3.43M|      }
  132|  5.27M|    } else {
  133|  5.27M|      p2 += energy[curr_pos - num_time_slots + avg_energy - 1];
  134|       |#ifdef _WIN32
  135|       |#pragma warning(suppress : 6385)
  136|       |#endif
  137|  5.27M|      p2 -= energy[curr_pos_prev - num_time_slots];
  138|  5.27M|    }
  139|  5.48M|    curr_pos_prev = curr_pos;
  140|       |
  141|  5.48M|    if (p1 > p2) {
  ------------------
  |  Branch (141:9): [True: 48.6k, False: 5.44M]
  ------------------
  142|  48.6k|      p_transient_pos[tran_cnt++] = curr_pos;
  143|  48.6k|      curr_pos += pstr_onset_detect->min_trans_dist;
  144|  48.6k|    }
  145|  5.48M|  }
  146|       |
  147|   170k|  return error;
  148|   170k|}

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

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

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

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

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

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

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

iusace_noise_filling:
   86|   210k|                          WORD32 noise_filling_start_offset, FLOAT64 *ptr_scratch_buf) {
   87|   210k|  FLOAT64 energy;
   88|   210k|  FLOAT64 noise_level_temp;
   89|   210k|  FLOAT64 noise_offset_temp;
   90|       |
   91|   210k|  FLOAT64 sum_sfb_on, sum_sfb_off;
   92|   210k|  FLOAT64 e_sfb_on, e_sfb_off;
   93|       |
   94|   210k|  WORD32 n0;
   95|   210k|  WORD32 start_sfb, sfb, i;
   96|   210k|  WORD32 band_quantized_to_zero;
   97|       |
   98|   210k|  FLOAT64 alpha = 0.15; /* prudence factor */
   99|   210k|  WORD32 grp = 0;
  100|       |
  101|   210k|  e_sfb_on = 1e-6;
  102|   210k|  e_sfb_off = 1e-6;
  103|       |
  104|   210k|  sum_sfb_on = 1e-6;
  105|   210k|  sum_sfb_off = 1e-6;
  106|       |
  107|   210k|  *noise_offset = 0;
  108|   210k|  *noise_level = 0;
  109|       |
  110|  3.18M|  for (sfb = 0; sfb < max_sfb; sfb++) {
  ------------------
  |  Branch (110:17): [True: 3.17M, False: 13.7k]
  ------------------
  111|  3.17M|    if (ptr_sfb_offset[sfb + 1] > noise_filling_start_offset) break;
  ------------------
  |  Branch (111:9): [True: 196k, False: 2.97M]
  ------------------
  112|  3.17M|  }
  113|   210k|  start_sfb = sfb;
  114|   614k|  for (grp = 0; grp < num_window_groups; grp++) {
  ------------------
  |  Branch (114:17): [True: 404k, False: 210k]
  ------------------
  115|   404k|    WORD32 grp_win = 0;
  116|  6.16M|    for (sfb = start_sfb; sfb < max_sfb; sfb++) {
  ------------------
  |  Branch (116:27): [True: 5.75M, False: 404k]
  ------------------
  117|  5.75M|      band_quantized_to_zero = 1;
  118|  14.6M|      for (grp_win = 0; grp_win < ptr_window_group_length[grp]; grp_win++) {
  ------------------
  |  Branch (118:25): [True: 8.93M, False: 5.75M]
  ------------------
  119|  8.93M|        WORD32 offset = grp_win * window_size_samples;
  120|  8.93M|        energy = 0;
  121|  8.93M|        n0 = 0;
  122|   242M|        for (i = ptr_sfb_offset[sfb]; i < ptr_sfb_offset[sfb + 1]; i++) {
  ------------------
  |  Branch (122:39): [True: 233M, False: 8.93M]
  ------------------
  123|       |          /* calculate energy if the quantized value is non zero */
  124|   233M|          if (!pstr_quant_info->quant_degroup[offset + i]) {
  ------------------
  |  Branch (124:15): [True: 174M, False: 59.3M]
  ------------------
  125|   174M|            energy += ptr_quant_spec[offset + i] * ptr_quant_spec[offset + i];
  126|   174M|            n0++;
  127|   174M|          } else {
  128|       |            /* All quantized values are not zero */
  129|  59.3M|            band_quantized_to_zero = 0;
  130|  59.3M|          }
  131|   233M|        }
  132|       |
  133|       |        /* Remove highest (tonal) contributions */
  134|  8.93M|        iusace_noise_filling_limiter(&energy, &ptr_quant_spec[offset],
  135|  8.93M|                                     &pstr_quant_info->quant_degroup[offset], n0 / 4,
  136|  8.93M|                                     ptr_sfb_offset, sfb, n0, ptr_scratch_buf);
  137|       |
  138|  8.93M|        if (band_quantized_to_zero == 0) {
  ------------------
  |  Branch (138:13): [True: 3.47M, False: 5.45M]
  ------------------
  139|  3.47M|          e_sfb_on += energy;
  140|  3.47M|          sum_sfb_on += pow(2., 0.5 * pstr_quant_info->scale_factor[sfb] - 50) * n0;
  141|  3.47M|        } else
  142|       |        /* subband is completely zeroed  */
  143|  5.45M|        {
  144|  5.45M|          e_sfb_off += energy;
  145|  5.45M|          sum_sfb_off += pow(2., 0.5 * pstr_quant_info->scale_factor[sfb] - 58) *
  146|  5.45M|                         (ptr_sfb_offset[sfb + 1] - ptr_sfb_offset[sfb]);
  147|  5.45M|        }
  148|  8.93M|      }
  149|  5.75M|    }
  150|   404k|  }
  151|       |
  152|   210k|  if (num_window_groups > 1) alpha = alpha * 0.15;
  ------------------
  |  Branch (152:7): [True: 67.9k, False: 142k]
  ------------------
  153|       |
  154|   210k|  if (sum_sfb_on) {
  ------------------
  |  Branch (154:7): [True: 210k, False: 0]
  ------------------
  155|   210k|    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|   210k|    *noise_level = (WORD32)(noise_level_temp + 0.5);
  159|       |
  160|       |    /* noise level limited to quantization range [0,7] */
  161|   210k|    *noise_level = MAX(*noise_level, 0);
  ------------------
  |  |   24|   210k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 171k, False: 39.4k]
  |  |  ------------------
  ------------------
  162|   210k|    *noise_level = MIN(*noise_level, 7);
  ------------------
  |  |   23|   210k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 140k, False: 70.1k]
  |  |  ------------------
  ------------------
  163|       |
  164|   210k|    if (*noise_level != 0) {
  ------------------
  |  Branch (164:9): [True: 171k, False: 39.4k]
  ------------------
  165|   171k|      noise_offset_temp =
  166|   171k|          2. * log(alpha * e_sfb_off * sum_sfb_on / sum_sfb_off / e_sfb_on) / log(2.);
  167|       |
  168|       |      /* quantize to nearest integer */
  169|   171k|      *noise_offset = (WORD32)(noise_offset_temp + 0.5);
  170|       |
  171|       |      /* noise offset limited to quantization range [0,31] */
  172|   171k|      *noise_level = *noise_offset <= 0 ? 0 : *noise_level;
  ------------------
  |  Branch (172:22): [True: 139k, False: 31.3k]
  ------------------
  173|   171k|      *noise_offset = MIN(*noise_offset, 31);
  ------------------
  |  |   23|   171k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 171k, False: 25]
  |  |  ------------------
  ------------------
  174|   171k|      *noise_offset = MAX(*noise_offset, 0);
  ------------------
  |  |   24|   171k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 31.3k, False: 139k]
  |  |  ------------------
  ------------------
  175|   171k|    }
  176|   210k|  }
  177|   210k|  return;
  178|   210k|}
ixheaace_nf.c:iusace_noise_filling_limiter:
   38|  8.93M|                                         FLOAT64 *ptr_highest_tone) {
   39|  8.93M|  WORD32 n, i;
   40|  8.93M|  FLOAT64 tone_energy;
   41|  8.93M|  FLOAT64 tot_tone_energy = 0.0;
   42|       |
   43|  8.93M|  if (!n0_by_4) return;
  ------------------
  |  Branch (43:7): [True: 1.63M, False: 7.29M]
  ------------------
   44|  7.29M|  if (cntr <= n0_by_4) return;
  ------------------
  |  Branch (44:7): [True: 0, False: 7.29M]
  ------------------
   45|       |
   46|  7.29M|  memset(ptr_highest_tone, 0, n0_by_4 * sizeof(*ptr_highest_tone));
   47|       |
   48|       |  /* finds the n0_by_4 strongest bins */
   49|   204M|  for (i = ptr_sfb_offset[sb]; i < ptr_sfb_offset[sb + 1]; i++) {
  ------------------
  |  Branch (49:32): [True: 197M, False: 7.29M]
  ------------------
   50|   197M|    if (!ptr_quant_spec[i]) {
  ------------------
  |  Branch (50:9): [True: 172M, False: 24.0M]
  ------------------
   51|   172M|      tone_energy = ptr_spec[i] * ptr_spec[i];
   52|       |
   53|  1.56G|      for (n = 0; n < n0_by_4; n++) {
  ------------------
  |  Branch (53:19): [True: 1.40G, False: 158M]
  ------------------
   54|  1.40G|        if (tone_energy > ptr_highest_tone[n]) {
  ------------------
  |  Branch (54:13): [True: 14.8M, False: 1.38G]
  ------------------
   55|  14.8M|          memmove(ptr_highest_tone + 1 + n, ptr_highest_tone + n,
   56|  14.8M|                  (n0_by_4 - n - 1) * sizeof(*ptr_highest_tone));
   57|  14.8M|          ptr_highest_tone[n] = tone_energy;
   58|  14.8M|          break;
   59|  14.8M|        }
   60|  1.40G|      }
   61|   172M|    }
   62|   197M|  }
   63|       |  /* remove the contribution of the highest_tone components */
   64|  49.9M|  for (n = 0; n < n0_by_4; n++) tot_tone_energy += ptr_highest_tone[n];
  ------------------
  |  Branch (64:15): [True: 42.6M, False: 7.29M]
  ------------------
   65|       |
   66|  7.29M|  FLOAT64 diff = *energy - tot_tone_energy;
   67|       |  //If the difference is within 1% of total energy, no need to send any energy
   68|  7.29M|  if (diff < 0.01*(*energy))
  ------------------
  |  Branch (68:7): [True: 182k, False: 7.11M]
  ------------------
   69|   182k|  {
   70|   182k|    *energy = 0.0;
   71|   182k|  }
   72|  7.11M|  else
   73|  7.11M|  {
   74|  7.11M|    *energy = diff;
   75|  7.11M|  }
   76|       |
   77|       |  /* add the average component energy */
   78|  7.29M|  *energy += n0_by_4 * (*energy) / (cntr - n0_by_4);
   79|  7.29M|  return;
   80|  7.29M|}

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

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

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

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

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

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

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

ia_enhaacplus_enc_qc_main:
   77|   300k|    WORD32 *is_quant_spec_zero, WORD32 *is_gain_limited) {
   78|   300k|  IA_ERRORCODE err_code;
   79|   300k|  WORD32 ch;
   80|   300k|  WORD32 i = 0;
   81|   300k|  WORD32 k = 0;
   82|   300k|  WORD32 j = 0;
   83|   300k|  WORD32 iterations = 0;
   84|   300k|  WORD32 constraints_fulfilled;
   85|   300k|  WORD32 ch_dyn_bits;
   86|   300k|  WORD32 max_ch_dyn_bits[IXHEAACE_MAX_CH_IN_BS_ELE];
   87|   300k|  FLOAT32 ch_bit_dist[IXHEAACE_MAX_CH_IN_BS_ELE];
   88|   300k|  ixheaace_qc_stack *ptr_stack = (ixheaace_qc_stack *)ptr_scratch;
   89|   300k|  ptr_scratch += sizeof(ixheaace_qc_stack);
   90|       |
   91|   300k|  ia_adj_thr_elem_struct *pstr_adj_thr_elem = &pstr_qc_state->str_adj_thr.str_adj_thr_ele;
   92|   300k|  WORD32 gain;
   93|       |
   94|   300k|  if (pstr_el_bits->bit_res_level < 0) {
  ------------------
  |  Branch (94:7): [True: 278, False: 300k]
  ------------------
   95|    278|    return IA_EXHEAACE_EXE_FATAL_INVALID_BIT_RES_LEVEL;
   96|    278|  }
   97|       |
   98|   300k|  if (pstr_el_bits->bit_res_level > pstr_el_bits->max_bit_res_bits) {
  ------------------
  |  Branch (98:7): [True: 0, False: 300k]
  ------------------
   99|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_BIT_RES_LEVEL;
  100|      0|  }
  101|   300k|  pstr_qc_out_element->static_bits_used =
  102|   300k|      ia_enhaacplus_enc_count_static_bitdemand(psy_out_ch, pstr_psy_out_element, num_channels,
  103|   300k|                                               aot, adts_flag, stat_bits_flag, flag_last_element);
  104|       |
  105|   300k|  if (ancillary_data_bytes) {
  ------------------
  |  Branch (105:7): [True: 201k, False: 99.0k]
  ------------------
  106|   201k|    pstr_qc_out_element->anc_bits_used =
  107|   201k|        7 + 8 * (ancillary_data_bytes + (ancillary_data_bytes >= 15));
  108|   201k|  } else {
  109|  99.0k|    pstr_qc_out_element->anc_bits_used = 0;
  110|  99.0k|  }
  111|       |
  112|   738k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (112:16): [True: 438k, False: 300k]
  ------------------
  113|   438k|    iaace_calc_form_fac_per_chan(ptr_stack->sfb_form_fac[ch],
  114|   438k|                                 ptr_stack->sfb_num_relevant_lines[ch], psy_out_ch[ch],
  115|   438k|                                 ptr_stack->sfb_ld_energy[ch]);
  116|   438k|  }
  117|       |
  118|   300k|  iaace_adjust_threshold(
  119|   300k|      &pstr_qc_state->str_adj_thr, pstr_adj_thr_elem, psy_out_ch, ch_bit_dist,
  120|   300k|      pstr_qc_out_element,
  121|   300k|      pstr_el_bits->average_bits - pstr_qc_out_element->static_bits_used -
  122|   300k|          pstr_qc_out_element->anc_bits_used,
  123|   300k|      pstr_el_bits->bit_res_level, pstr_el_bits->max_bit_res_bits,
  124|   300k|      pstr_qc_out_element->static_bits_used + pstr_qc_out_element->anc_bits_used,
  125|   300k|      &pstr_qc_state->max_bit_fac, ptr_stack->sfb_num_relevant_lines[0],
  126|   300k|      ptr_stack->sfb_ld_energy[0], num_channels, 0, aot, ptr_scratch);
  127|       |
  128|   300k|  iaace_estimate_scfs_chan(psy_out_ch, pstr_qc_out_ch, ptr_stack->sfb_form_fac,
  129|   300k|                           ptr_stack->sfb_num_relevant_lines, num_channels, 0, frame_len_long);
  130|       |
  131|   738k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (131:16): [True: 438k, False: 300k]
  ------------------
  132|   438k|    max_ch_dyn_bits[ch] =
  133|   438k|        (pstr_el_bits->average_bits + pstr_el_bits->bit_res_level - 7 -
  134|   438k|         pstr_qc_out_element->static_bits_used - pstr_qc_out_element->anc_bits_used);
  135|       |
  136|   438k|    max_ch_dyn_bits[ch] = (WORD32)floor(ch_bit_dist[ch] * (FLOAT32)(max_ch_dyn_bits[ch]));
  137|   438k|  }
  138|       |
  139|   300k|  pstr_qc_out_element->dyn_bits_used = 0;
  140|       |
  141|   738k|  for (ch = 0; ch < num_channels; ch++) {
  ------------------
  |  Branch (141:16): [True: 438k, False: 300k]
  ------------------
  142|       |    /* now loop until bitstream constraints (ch_dyn_bits < maxChDynBits)
  143|       |       are fulfilled */
  144|   438k|    WORD32 spec_idx, sfb_offs, sfb;
  145|   438k|    iterations = 0;
  146|   438k|    gain = 0;
  147|   361M|    for (spec_idx = 0; spec_idx < frame_len_long; spec_idx++) {
  ------------------
  |  Branch (147:24): [True: 360M, False: 438k]
  ------------------
  148|   360M|      ptr_stack->exp_spec[spec_idx] = (FLOAT32)psy_out_ch[ch]->ptr_spec_coeffs[spec_idx];
  149|   360M|      ptr_stack->mdct_spec_float[spec_idx] = (FLOAT32)psy_out_ch[ch]->ptr_spec_coeffs[spec_idx];
  150|   360M|    }
  151|   464k|    do {
  152|   464k|      WORD32 max_val;
  153|   464k|      constraints_fulfilled = 1;
  154|   464k|      WORD32 quant_spec_is_zero = 1;
  155|   464k|      if (iterations > 0) {
  ------------------
  |  Branch (155:11): [True: 26.4k, False: 438k]
  ------------------
  156|  73.4k|        for (sfb_offs = 0; sfb_offs < psy_out_ch[ch]->sfb_count;
  ------------------
  |  Branch (156:28): [True: 46.9k, False: 26.4k]
  ------------------
  157|  46.9k|             sfb_offs += psy_out_ch[ch]->sfb_per_group) {
  158|   855k|          for (sfb = 0; sfb < psy_out_ch[ch]->max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (158:25): [True: 808k, False: 46.9k]
  ------------------
  159|   808k|            WORD32 scalefactor = pstr_qc_out_ch[ch]->scalefactor[sfb + sfb_offs];
  160|   808k|            gain = MAX(gain, pstr_qc_out_ch[ch]->global_gain - scalefactor);
  ------------------
  |  |   24|   808k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 289k, False: 518k]
  |  |  ------------------
  ------------------
  161|   808k|            iaace_quantize_lines(
  162|   808k|                pstr_qc_out_ch[ch]->global_gain - scalefactor,
  163|   808k|                psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb + 1] -
  164|   808k|                    psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb],
  165|   808k|                ptr_stack->exp_spec + psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb],
  166|   808k|                pstr_qc_out_ch[ch]->quant_spec + psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb],
  167|   808k|                ptr_stack->mdct_spec_float + psy_out_ch[ch]->sfb_offsets[sfb_offs + sfb]);
  168|   808k|          }
  169|  46.9k|        }
  170|  26.4k|      }
  171|       |
  172|   464k|      max_val = iaace_calc_max_val_in_sfb(
  173|   464k|          psy_out_ch[ch]->sfb_count, psy_out_ch[ch]->max_sfb_per_grp,
  174|   464k|          psy_out_ch[ch]->sfb_per_group,
  175|   464k|          psy_out_ch[ch]->sfb_offsets, pstr_qc_out_ch[ch]->quant_spec,
  176|   464k|          pstr_qc_out_ch[ch]->max_val_in_sfb);
  177|       |
  178|   464k|      if (max_val > MAXIMUM_QUANT) {
  ------------------
  |  |   22|   464k|#define MAXIMUM_QUANT (8191)
  ------------------
  |  Branch (178:11): [True: 5.65k, False: 459k]
  ------------------
  179|  5.65k|        constraints_fulfilled = 0;
  180|  5.65k|      }
  181|       |
  182|   990k|      for (k = 0; ((k < psy_out_ch[ch]->sfb_count) && (quant_spec_is_zero));
  ------------------
  |  Branch (182:20): [True: 593k, False: 397k]
  |  Branch (182:55): [True: 526k, False: 67.0k]
  ------------------
  183|   526k|           k += psy_out_ch[ch]->sfb_per_group) {
  184|  3.94M|        for (i = 0; ((i < psy_out_ch[ch]->max_sfb_per_grp) && (quant_spec_is_zero)); i++) {
  ------------------
  |  Branch (184:22): [True: 3.71M, False: 230k]
  |  Branch (184:63): [True: 3.41M, False: 295k]
  ------------------
  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: 297k, False: 42.8M]
  ------------------
  188|   297k|              quant_spec_is_zero = 0;
  189|   297k|              break;
  190|   297k|            }
  191|  43.1M|          }
  192|  3.41M|        }
  193|   526k|      }
  194|   464k|      err_code = ia_enhaacplus_enc_dyn_bitcount(
  195|   464k|          pstr_qc_out_ch[ch]->quant_spec, pstr_qc_out_ch[ch]->max_val_in_sfb,
  196|   464k|          pstr_qc_out_ch[ch]->scalefactor, psy_out_ch[ch]->window_sequence,
  197|   464k|          psy_out_ch[ch]->sfb_count, psy_out_ch[ch]->max_sfb_per_grp,
  198|   464k|          psy_out_ch[ch]->sfb_per_group,
  199|   464k|          psy_out_ch[ch]->sfb_offsets, &pstr_qc_out_ch[ch]->section_data,
  200|   464k|          pstr_qc_state->side_info_tab_long, pstr_qc_state->side_info_tab_short,
  201|   464k|          pstr_aac_tables->pstr_huff_tab, pstr_qc_state->qc_scr.shared_buffer_2, aot,
  202|   464k|          &ch_dyn_bits);
  203|       |
  204|   464k|      if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   464k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (204:11): [True: 0, False: 464k]
  ------------------
  205|      0|        return err_code;
  206|      0|      }
  207|       |
  208|   464k|      if (ch_dyn_bits >= max_ch_dyn_bits[ch]) {
  ------------------
  |  Branch (208:11): [True: 20.8k, False: 443k]
  ------------------
  209|  20.8k|        constraints_fulfilled = 0;
  210|  20.8k|      }
  211|       |
  212|   464k|      if (quant_spec_is_zero == 1) {
  ------------------
  |  Branch (212:11): [True: 167k, False: 297k]
  ------------------
  213|   167k|        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|   167k|        if (iterations > 0) {
  ------------------
  |  Branch (216:13): [True: 435, False: 166k]
  ------------------
  217|    435|          *is_quant_spec_zero = 1;
  218|    435|          ch_dyn_bits = max_ch_dyn_bits[ch];
  219|    435|        }
  220|   167k|      }
  221|   464k|      if ((gain == MAX_GAIN_INDEX) && (constraints_fulfilled == 0)) {
  ------------------
  |  |  120|   464k|#define MAX_GAIN_INDEX (128)
  ------------------
  |  Branch (221:11): [True: 0, False: 464k]
  |  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|   464k|      if (!constraints_fulfilled) {
  ------------------
  |  Branch (229:11): [True: 26.4k, False: 438k]
  ------------------
  230|  26.4k|        pstr_qc_out_ch[ch]->global_gain++;
  231|  26.4k|      }
  232|   464k|      iterations++;
  233|       |
  234|   464k|    } while (!constraints_fulfilled);
  ------------------
  |  Branch (234:14): [True: 26.4k, False: 438k]
  ------------------
  235|       |
  236|   438k|    pstr_qc_out_element->dyn_bits_used += ch_dyn_bits;
  237|       |
  238|   438k|    pstr_qc_out_ch[ch]->grouping_mask = psy_out_ch[ch]->grouping_mask;
  239|   438k|    pstr_qc_out_ch[ch]->win_shape = psy_out_ch[ch]->window_shape;
  240|   438k|  }
  241|       |
  242|   300k|  pstr_adj_thr_elem->dyn_bits_last = pstr_qc_out_element->dyn_bits_used;
  243|   300k|  {
  244|   300k|    WORD32 bit_res_space = pstr_el_bits->max_bit_res_bits - pstr_el_bits->bit_res_level;
  245|   300k|    WORD32 delta_bit_res = pstr_el_bits->average_bits - (pstr_qc_out_element->static_bits_used +
  246|   300k|                                                         pstr_qc_out_element->dyn_bits_used +
  247|   300k|                                                         pstr_qc_out_element->anc_bits_used);
  248|       |
  249|   300k|    pstr_qc_out_element->fill_bits = MAX(0, (delta_bit_res - bit_res_space));
  ------------------
  |  |   24|   300k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 151k, False: 149k]
  |  |  ------------------
  ------------------
  250|   300k|  }
  251|       |
  252|   300k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  253|   300k|}
iaace_calc_max_val_in_sfb:
  257|   464k|                                 UWORD16 *ptr_max_value) {
  258|   464k|  WORD32 sfb;
  259|   464k|  WORD32 max = 0;
  260|   464k|  WORD32 sfb_offs;
  261|       |
  262|  1.18M|  for (sfb_offs = 0; sfb_offs < sfb_count; sfb_offs += ptr_sfb_per_grp) {
  ------------------
  |  Branch (262:22): [True: 718k, False: 464k]
  ------------------
  263|  13.5M|    for (sfb = 0; sfb < max_sfb_per_grp; sfb++) {
  ------------------
  |  Branch (263:19): [True: 12.8M, False: 718k]
  ------------------
  264|  12.8M|      WORD32 line;
  265|  12.8M|      WORD32 local_max = 0;
  266|   193M|      for (line = ptr_sfb_offset[sfb + sfb_offs]; line < ptr_sfb_offset[sfb + sfb_offs + 1];
  ------------------
  |  Branch (266:51): [True: 180M, False: 12.8M]
  ------------------
  267|   180M|           line++) {
  268|   180M|        if (abs(ptr_quant_spec[line]) > local_max) {
  ------------------
  |  Branch (268:13): [True: 10.6M, False: 169M]
  ------------------
  269|  10.6M|          local_max = abs(ptr_quant_spec[line]);
  270|  10.6M|        }
  271|   180M|      }
  272|  12.8M|      ptr_max_value[sfb_offs + sfb] = (UWORD16)local_max;
  273|  12.8M|      if (local_max > max) {
  ------------------
  |  Branch (273:11): [True: 422k, False: 12.4M]
  ------------------
  274|   422k|        max = local_max;
  275|   422k|      }
  276|  12.8M|    }
  277|   718k|  }
  278|       |
  279|   464k|  return max;
  280|   464k|}

ia_enhaacplus_enc_qc_out_new:
  118|  4.84k|{
  119|  4.84k|  WORD32 i;
  120|       |
  121|  11.9k|  for (i = 0; i < num_channels; i++) {
  ------------------
  |  Branch (121:15): [True: 7.09k, False: 4.84k]
  ------------------
  122|  7.09k|    pstr_qc_out->qc_channel[i]->quant_spec = &((WORD16 *)ptr_shared_buffer1)[i * long_frame_len];
  123|       |
  124|  7.09k|    memset(pstr_qc_out->qc_channel[i]->quant_spec, 0,
  125|  7.09k|           sizeof(*pstr_qc_out->qc_channel[i]->quant_spec) * long_frame_len);
  126|       |
  127|  7.09k|    pstr_qc_out->qc_channel[i]->max_val_in_sfb =
  128|  7.09k|        &((UWORD16 *)&ptr_shared_buffer3[(long_frame_len + long_frame_len / 2) +
  129|  7.09k|                                         IXHEAACE_MAX_CH_IN_BS_ELE *
  ------------------
  |  |   86|  7.09k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  130|  7.09k|                                             MAXIMUM_GROUPED_SCALE_FACTOR_BAND /
  ------------------
  |  |   73|  7.09k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 7.09k, Folded]
  |  |  ------------------
  |  |   74|  7.09k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  7.09k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  131|  7.09k|                                             2])[i * MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  ------------------
  |  |   73|  7.09k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 7.09k, Folded]
  |  |  ------------------
  |  |   74|  7.09k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  7.09k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  132|  7.09k|    memset(
  133|  7.09k|        pstr_qc_out->qc_channel[i]->max_val_in_sfb, 0,
  134|  7.09k|        sizeof(*pstr_qc_out->qc_channel[i]->max_val_in_sfb) * MAXIMUM_GROUPED_SCALE_FACTOR_BAND);
  ------------------
  |  |   73|  7.09k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 7.09k, Folded]
  |  |  ------------------
  |  |   74|  7.09k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  7.09k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  135|       |
  136|  7.09k|    pstr_qc_out->qc_channel[i]->scalefactor = &((WORD16 *)&ptr_shared_buffer3[(
  137|  7.09k|        long_frame_len + long_frame_len / 2)])[i * MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  ------------------
  |  |   73|  7.09k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 7.09k, Folded]
  |  |  ------------------
  |  |   74|  7.09k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  7.09k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  138|       |
  139|  7.09k|    memset(pstr_qc_out->qc_channel[i]->scalefactor, 0,
  140|  7.09k|           sizeof(*pstr_qc_out->qc_channel[i]->scalefactor) * MAXIMUM_GROUPED_SCALE_FACTOR_BAND);
  ------------------
  |  |   73|  7.09k|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 7.09k, Folded]
  |  |  ------------------
  |  |   74|  7.09k|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  7.09k|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  7.09k|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  7.09k|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  141|  7.09k|  }
  142|       |
  143|  4.84k|  if (pstr_qc_out == NULL) {
  ------------------
  |  Branch (143:7): [True: 0, False: 4.84k]
  ------------------
  144|      0|    return IA_EXHEAACE_INIT_FATAL_AAC_INIT_FAILED;
  145|      0|  }
  146|  4.84k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  147|  4.84k|}
ia_enhaacplus_enc_qc_new:
  151|  4.84k|) {
  152|  4.84k|  memset(pstr_qc_state, 0, sizeof(ixheaace_qc_state));
  153|  4.84k|  pstr_qc_state->qc_scr.shared_buffer_2 =
  154|  4.84k|      (ptr_shared_buffer_2 + long_frame_len * IXHEAACE_MAX_CH_IN_BS_ELE + 16);
  ------------------
  |  |   86|  4.84k|#define IXHEAACE_MAX_CH_IN_BS_ELE (2)
  ------------------
  155|       |
  156|  4.84k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  157|  4.84k|}
ia_enhaacplus_enc_qc_init:
  160|  4.84k|                                       ixheaace_qc_init *pstr_init, FLAG flag_framelength_small) {
  161|  4.84k|  IA_ERRORCODE error = IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  162|  4.84k|  pstr_qc_state->num_channels = pstr_init->pstr_element_info->n_channels_in_el;
  163|  4.84k|  pstr_qc_state->max_bits_tot = pstr_init->max_bits;
  164|  4.84k|  switch (aot) {
  ------------------
  |  Branch (164:11): [True: 4.84k, False: 0]
  ------------------
  165|  1.05k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  1.05k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (165:5): [True: 1.05k, False: 3.79k]
  ------------------
  166|  2.80k|    case AOT_SBR:
  ------------------
  |  |   35|  2.80k|#define AOT_SBR (5)
  ------------------
  |  Branch (166:5): [True: 1.75k, False: 3.09k]
  ------------------
  167|  3.04k|    case AOT_PS:
  ------------------
  |  |   39|  3.04k|#define AOT_PS (29)
  ------------------
  |  Branch (167:5): [True: 232, False: 4.61k]
  ------------------
  168|  3.04k|      pstr_qc_state->bit_res_tot = pstr_init->bit_res - pstr_init->average_bits;
  169|  3.04k|      break;
  170|       |
  171|    533|    case AOT_AAC_LD:
  ------------------
  |  |   36|    533|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (171:5): [True: 533, False: 4.31k]
  ------------------
  172|  1.80k|    case AOT_AAC_ELD:
  ------------------
  |  |   37|  1.80k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (172:5): [True: 1.27k, False: 3.57k]
  ------------------
  173|  1.80k|      if (pstr_init->bit_res) {
  ------------------
  |  Branch (173:11): [True: 1.19k, False: 609]
  ------------------
  174|  1.19k|        pstr_qc_state->bit_res_tot = pstr_init->bit_res - pstr_init->average_bits;
  175|  1.19k|      } else {
  176|    609|        pstr_qc_state->bit_res_tot = 0;
  177|    609|      }
  178|  1.80k|      break;
  179|  4.84k|  }
  180|  4.84k|  pstr_qc_state->average_bits_tot = pstr_init->average_bits;
  181|  4.84k|  pstr_qc_state->max_bit_fac = pstr_init->max_bit_fac;
  182|  4.84k|  pstr_qc_state->padding.padding_rest = pstr_init->padding.padding_rest;
  183|       |
  184|  4.84k|  pstr_qc_state->quality_level = pstr_init->inv_quant;
  185|  4.84k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  9.69k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  8.64k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.03k|#define AOT_PS (29)
  ------------------
  |  Branch (185:7): [True: 1.05k, False: 3.79k]
  |  Branch (185:28): [True: 1.75k, False: 2.03k]
  |  Branch (185:46): [True: 232, False: 1.80k]
  ------------------
  186|  3.04k|    pstr_qc_state->glob_stat_bits = 3; /* for ID_END */
  187|  3.04k|  }
  188|  4.84k|  error = ia_enhaacplus_enc_init_element_bits(
  189|  4.84k|      &pstr_qc_state->element_bits, *pstr_init->pstr_element_info, pstr_init->bitrate,
  190|  4.84k|      pstr_init->average_bits, aot, pstr_qc_state->glob_stat_bits, pstr_init->bit_res,
  191|  4.84k|      flag_framelength_small);
  192|       |
  193|  4.84k|  if (error != IA_NO_ERROR) {
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (193:7): [True: 0, False: 4.84k]
  ------------------
  194|      0|    return error;
  195|      0|  }
  196|  4.84k|  iaace_adj_thr_init(&pstr_qc_state->str_adj_thr, pstr_init->mean_pe,
  197|  4.84k|                     pstr_qc_state->element_bits.ch_bitrate, aot);
  198|       |
  199|  4.84k|  ia_enhaacplus_enc_bitcount_init((WORD32 *)pstr_qc_state->side_info_tab_long,
  200|  4.84k|                                  (WORD32 *)pstr_qc_state->side_info_tab_short);
  201|       |
  202|  4.84k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  4.84k|#define IA_NO_ERROR 0x00000000
  ------------------
  203|  4.84k|}
ia_enhaacplus_enc_update_bit_reservoir:
  208|   300k|{
  209|   300k|  ixheaace_element_bits *pstr_el_bits;
  210|       |
  211|   300k|  pstr_qc_kernel->bit_res_tot = 0;
  212|       |
  213|   300k|  pstr_el_bits = &pstr_qc_kernel->element_bits;
  214|       |
  215|   300k|  if (pstr_el_bits->average_bits > 0) {
  ------------------
  |  Branch (215:7): [True: 300k, False: 0]
  ------------------
  216|       |    /* constant bitrate */
  217|   300k|    pstr_el_bits->bit_res_level +=
  218|   300k|        pstr_el_bits->average_bits -
  219|   300k|        (pstr_qc_out->qc_element.static_bits_used + pstr_qc_out->qc_element.dyn_bits_used +
  220|   300k|         pstr_qc_out->qc_element.anc_bits_used + pstr_qc_out->qc_element.fill_bits);
  221|       |
  222|   300k|    pstr_qc_kernel->bit_res_tot += pstr_el_bits->bit_res_level;
  223|   300k|  } 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|   300k|}
ia_enhaacplus_enc_finalize_bit_consumption:
  235|   300k|                                                        WORD32 num_bs_elements, WORD32 aot) {
  236|   300k|  WORD32 n_full_fill_elem, diff_bits;
  237|   300k|  WORD32 total_fill_bits = 0;
  238|       |
  239|   300k|  const WORD32 max_fill_elem_bits = 7 + 270 * 8;
  240|   300k|  WORD32 tfb_flag = 0;
  241|   300k|  WORD32 tfb_flag1 = 0;
  242|   300k|  WORD32 tfb_flag2 = 0;
  243|       |
  244|   300k|  pstr_qc_out->tot_static_bits_used = (flag_last_element ? pstr_qc_kernel->glob_stat_bits : 0);
  ------------------
  |  Branch (244:40): [True: 141k, False: 158k]
  ------------------
  245|       |
  246|   300k|  pstr_qc_out->tot_dyn_bits_used = 0;
  247|   300k|  pstr_qc_out->tot_anc_bits_used = 0;
  248|   300k|  pstr_qc_out->total_fill_bits = 0;
  249|   300k|  pstr_qc_out->tot_static_bits_used += pstr_qc_out->qc_element.static_bits_used;
  250|   300k|  pstr_qc_out->tot_dyn_bits_used += pstr_qc_out->qc_element.dyn_bits_used;
  251|   300k|  pstr_qc_out->tot_anc_bits_used += pstr_qc_out->qc_element.anc_bits_used;
  252|   300k|  pstr_qc_out->total_fill_bits += pstr_qc_out->qc_element.fill_bits;
  253|       |
  254|       |  /* Accumulate total fill bits */
  255|   300k|  *tot_fill_bits += pstr_qc_out->qc_element.fill_bits;
  256|   300k|  if (flag_last_element) {
  ------------------
  |  Branch (256:7): [True: 141k, False: 158k]
  ------------------
  257|   141k|    WORD32 i, j, temp_resv;
  258|   141k|    WORD32 bit_resv_spc[(MAXIMUM_BS_ELE << 1) + 1];
  259|   141k|    WORD32 bit_resv_spc_sort[(MAXIMUM_BS_ELE << 1) + 1] = {0, 1,  2,  3,  4,  5,  6,  7, 8,
  260|   141k|                                                           9, 10, 11, 12, 13, 14, 15, 16};
  261|       |
  262|   141k|    total_fill_bits = *tot_fill_bits;
  263|       |
  264|       |    /* Distribute fill bits among all channel elements for next frame */
  265|   141k|    if (total_fill_bits > 0) {
  ------------------
  |  Branch (265:9): [True: 72.7k, False: 68.9k]
  ------------------
  266|       |      /* Generate array of vacancies in bit reservoirs */
  267|   224k|      for (i = 0, temp_resv = 0; i < num_bs_elements; i++, temp_resv++) {
  ------------------
  |  Branch (267:34): [True: 151k, False: 72.7k]
  ------------------
  268|   151k|        bit_resv_spc[temp_resv] = (pstr_aac_enc[i]->qc_kernel.element_bits.max_bit_res_bits -
  269|   151k|                                   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|   151k|        if (pstr_aac_enc[i]->qc_kernel.num_channels == 2) {
  ------------------
  |  Branch (272:13): [True: 68.5k, False: 82.8k]
  ------------------
  273|  68.5k|          bit_resv_spc[temp_resv + 1] = bit_resv_spc[temp_resv] >> 1;
  274|  68.5k|          bit_resv_spc[temp_resv] -= bit_resv_spc[temp_resv + 1];
  275|  68.5k|          temp_resv++;
  276|  68.5k|        }
  277|   151k|      }
  278|       |
  279|       |      /* Sort bit_resv_spc[] in descending order of levels and
  280|       |      store the order in bit_resv_spc_sort[] */
  281|   219k|      for (i = (temp_resv - 1); i > 0; i--) {
  ------------------
  |  Branch (281:33): [True: 147k, False: 72.7k]
  ------------------
  282|   504k|        for (j = 0; j < i; j++) {
  ------------------
  |  Branch (282:21): [True: 357k, False: 147k]
  ------------------
  283|   357k|          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: 327k]
  ------------------
  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|   357k|        }
  289|   147k|      }
  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|   278k|      for (i = 1; ((i < (temp_resv + 1)) && (total_fill_bits > 0)); i++) {
  ------------------
  |  Branch (298:20): [True: 210k, False: 68.0k]
  |  Branch (298:45): [True: 206k, False: 4.67k]
  ------------------
  299|   206k|        if (((bit_resv_spc[bit_resv_spc_sort[0]] - bit_resv_spc[bit_resv_spc_sort[i]]) * i) <=
  ------------------
  |  Branch (299:13): [True: 201k, False: 4.65k]
  ------------------
  300|   206k|            total_fill_bits) {
  301|   201k|          total_fill_bits -=
  302|   201k|              ((bit_resv_spc[bit_resv_spc_sort[0]] - bit_resv_spc[bit_resv_spc_sort[i]]) * i);
  303|   705k|          for (j = 0; j < i; j++) {
  ------------------
  |  Branch (303:23): [True: 503k, False: 201k]
  ------------------
  304|   503k|            bit_resv_spc[bit_resv_spc_sort[j]] = bit_resv_spc[bit_resv_spc_sort[i]];
  305|   503k|          }
  306|   201k|        } else {
  307|  4.65k|          WORD32 div_bs_ele;
  308|       |
  309|  4.65k|          div_bs_ele = (WORD32)(total_fill_bits / i);
  310|  4.65k|          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.65k]
  ------------------
  313|  12.3k|            bit_resv_spc[bit_resv_spc_sort[j]] -= div_bs_ele;
  314|  12.3k|          }
  315|       |
  316|  8.56k|          for (j = 0; ((j < i) && (total_fill_bits > 0)); j++) {
  ------------------
  |  Branch (316:24): [True: 8.56k, False: 0]
  |  Branch (316:35): [True: 3.91k, False: 4.65k]
  ------------------
  317|  3.91k|            bit_resv_spc[bit_resv_spc_sort[j]]--;
  318|  3.91k|            total_fill_bits--;
  319|  3.91k|          }
  320|  4.65k|        }
  321|   206k|      }
  322|       |
  323|       |      /* Supply additional bits added for coding next frame */
  324|   224k|      for (i = 0, temp_resv = 0; i < num_bs_elements; i++, temp_resv++) {
  ------------------
  |  Branch (324:34): [True: 151k, False: 72.7k]
  ------------------
  325|   151k|        WORD32 add_bits;
  326|       |
  327|   151k|        add_bits = (pstr_aac_enc[i]->qc_kernel.element_bits.max_bit_res_bits -
  328|   151k|                    pstr_aac_enc[i]->qc_kernel.element_bits.bit_res_level) -
  329|   151k|                   bit_resv_spc[temp_resv];
  330|       |
  331|       |        /* Because CPE reservoir has been split into two */
  332|   151k|        if (pstr_aac_enc[i]->qc_kernel.num_channels == 2) {
  ------------------
  |  Branch (332:13): [True: 68.5k, False: 82.8k]
  ------------------
  333|  68.5k|          temp_resv++;
  334|  68.5k|          add_bits -= bit_resv_spc[temp_resv];
  335|  68.5k|        }
  336|       |
  337|       |        /* These will be in addition to the avg. bitrate for the next frame */
  338|   151k|        pstr_aac_enc[i]->qc_kernel.element_bits.carry_bits = add_bits;
  339|   151k|      }
  340|       |
  341|       |      /* Update remaining fill bits */
  342|  72.7k|      *tot_fill_bits = total_fill_bits;
  343|  72.7k|    }
  344|       |
  345|   141k|    n_full_fill_elem = (total_fill_bits - 1) / max_fill_elem_bits;
  346|       |
  347|   141k|    if (n_full_fill_elem) {
  ------------------
  |  Branch (347:9): [True: 42.8k, False: 98.8k]
  ------------------
  348|  42.8k|      total_fill_bits -= n_full_fill_elem * max_fill_elem_bits;
  349|  42.8k|    }
  350|       |
  351|   141k|    if (total_fill_bits > 0) {
  ------------------
  |  Branch (351:9): [True: 68.0k, False: 73.6k]
  ------------------
  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.56k, False: 66.5k]
  |  |  ------------------
  ------------------
  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.5k]
  ------------------
  360|  1.59k|          tfb_flag2 = 1;
  361|  1.59k|          break;
  362|       |
  363|    777|        case 15:
  ------------------
  |  Branch (363:9): [True: 777, False: 67.3k]
  ------------------
  364|    777|          tfb_flag1 = 1;
  365|    777|          break;
  366|       |
  367|  65.7k|        default:
  ------------------
  |  Branch (367:9): [True: 65.7k, False: 2.36k]
  ------------------
  368|  65.7k|          tfb_flag = 1;
  369|  65.7k|          break;
  370|  68.0k|      }
  371|  68.0k|    }
  372|       |
  373|   141k|    total_fill_bits += n_full_fill_elem * max_fill_elem_bits;
  374|       |
  375|   141k|    pstr_qc_out->align_bits =
  376|   141k|        7 - (cnt_bits + pstr_qc_out->tot_dyn_bits_used + pstr_qc_out->tot_static_bits_used +
  377|   141k|             pstr_qc_out->tot_anc_bits_used + +total_fill_bits - 1) %
  378|   141k|                8;
  379|   141k|    if (((pstr_qc_out->align_bits + total_fill_bits - *tot_fill_bits) == 8) &&
  ------------------
  |  Branch (379:9): [True: 37.6k, False: 104k]
  ------------------
  380|  37.6k|        (total_fill_bits > 8)) {
  ------------------
  |  Branch (380:9): [True: 37.0k, False: 592]
  ------------------
  381|  37.0k|      total_fill_bits -= 8;
  382|  37.0k|    }
  383|       |
  384|   141k|    diff_bits = (pstr_qc_out->align_bits + total_fill_bits) - *tot_fill_bits;
  385|       |
  386|   141k|    if (diff_bits) {
  ------------------
  |  Branch (386:9): [True: 92.3k, False: 49.4k]
  ------------------
  387|  92.3k|      if (diff_bits < 0) {
  ------------------
  |  Branch (387:11): [True: 0, False: 92.3k]
  ------------------
  388|      0|        return IA_EXHEAACE_EXE_FATAL_INVALID_BIT_CONSUMPTION;
  389|  92.3k|      } else {
  390|  92.3k|        {
  391|  92.3k|          if (cnt_bits + pstr_qc_out->tot_static_bits_used + pstr_qc_out->tot_dyn_bits_used +
  ------------------
  |  Branch (391:15): [True: 17.3k, False: 74.9k]
  ------------------
  392|  92.3k|                  pstr_qc_out->tot_anc_bits_used + total_fill_bits >
  393|  92.3k|              12288) {
  394|  17.3k|            if ((diff_bits > 8) && (total_fill_bits > 8)) {
  ------------------
  |  Branch (394:17): [True: 6.64k, False: 10.6k]
  |  Branch (394:36): [True: 6.64k, False: 0]
  ------------------
  395|  6.64k|              if (tfb_flag || tfb_flag1) {
  ------------------
  |  Branch (395:19): [True: 6.52k, False: 124]
  |  Branch (395:31): [True: 111, 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|  74.9k|          } else {
  403|  74.9k|            if (pstr_qc_kernel->element_bits.bit_res_level - diff_bits > 0) {
  ------------------
  |  Branch (403:17): [True: 69.3k, False: 5.64k]
  ------------------
  404|  69.3k|              pstr_qc_kernel->element_bits.bit_res_level -= diff_bits;
  405|  69.3k|              pstr_qc_kernel->bit_res_tot = pstr_qc_kernel->element_bits.bit_res_level;
  406|  69.3k|            } else {
  407|  5.64k|              if ((diff_bits > 8) && (total_fill_bits > 8) && (tfb_flag)) {
  ------------------
  |  Branch (407:19): [True: 3.10k, False: 2.54k]
  |  Branch (407:38): [True: 3.10k, False: 0]
  |  Branch (407:63): [True: 2.61k, False: 490]
  ------------------
  408|  2.61k|                total_fill_bits -= 8;
  409|  3.03k|              } else if ((diff_bits > 8) && (total_fill_bits > 8) && (tfb_flag1)) {
  ------------------
  |  Branch (409:26): [True: 490, False: 2.54k]
  |  Branch (409:45): [True: 490, False: 0]
  |  Branch (409:70): [True: 284, False: 206]
  ------------------
  410|    284|                total_fill_bits -= 8;
  411|  2.75k|              } else if ((diff_bits > 8) && (total_fill_bits > 8) && (tfb_flag2)) {
  ------------------
  |  Branch (411:26): [True: 206, False: 2.54k]
  |  Branch (411:45): [True: 206, False: 0]
  |  Branch (411:70): [True: 206, False: 0]
  ------------------
  412|    206|                total_fill_bits -= 7;
  413|    206|              }
  414|  5.64k|            }
  415|  74.9k|          }
  416|  92.3k|        }
  417|  92.3k|      }
  418|  92.3k|    }
  419|   141k|    switch (aot) {
  ------------------
  |  Branch (419:13): [True: 141k, False: 0]
  ------------------
  420|  24.7k|      case AOT_AAC_LC:
  ------------------
  |  |   34|  24.7k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (420:7): [True: 24.7k, False: 117k]
  ------------------
  421|  61.8k|      case AOT_SBR:
  ------------------
  |  |   35|  61.8k|#define AOT_SBR (5)
  ------------------
  |  Branch (421:7): [True: 37.0k, False: 104k]
  ------------------
  422|  81.2k|      case AOT_PS:
  ------------------
  |  |   39|  81.2k|#define AOT_PS (29)
  ------------------
  |  Branch (422:7): [True: 19.4k, False: 122k]
  ------------------
  423|  81.2k|        *tot_fill_bits = total_fill_bits;
  424|  81.2k|        break;
  425|       |
  426|  10.6k|      case AOT_AAC_LD:
  ------------------
  |  |   36|  10.6k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (426:7): [True: 10.6k, False: 131k]
  ------------------
  427|  60.4k|      case AOT_AAC_ELD:
  ------------------
  |  |   37|  60.4k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (427:7): [True: 49.8k, False: 91.9k]
  ------------------
  428|  60.4k|        pstr_qc_out->total_fill_bits = total_fill_bits;
  429|  60.4k|        *tot_fill_bits = 0;
  430|  60.4k|        break;
  431|   141k|    }
  432|   141k|  }  // if flag_last_element
  433|   158k|  else {
  434|   158k|    pstr_qc_out->align_bits = 0;
  435|   158k|  }
  436|       |
  437|   300k|  if ((pstr_qc_out->tot_dyn_bits_used + pstr_qc_out->tot_static_bits_used +
  ------------------
  |  Branch (437:7): [True: 29.6k, False: 270k]
  ------------------
  438|   300k|       pstr_qc_out->tot_anc_bits_used + pstr_qc_out->total_fill_bits + pstr_qc_out->align_bits) >
  439|   300k|      pstr_qc_kernel->max_bits_tot) {
  440|  29.6k|  }
  441|       |
  442|   300k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   300k|#define IA_NO_ERROR 0x00000000
  ------------------
  443|   300k|}
ia_enhaacplus_enc_adjust_bitrate:
  449|   300k|{
  450|   300k|  WORD32 padding_on;
  451|   300k|  WORD32 frame_len;
  452|   300k|  WORD32 code_bits;
  453|   300k|  WORD32 code_bits_last;
  454|       |
  455|   300k|  padding_on = ia_enhaacplus_enc_frame_padding(
  456|   300k|      bit_rate, sample_rate, &pstr_qc_state->padding.padding_rest, frame_len_long);
  457|       |
  458|   300k|  frame_len = padding_on + ia_enhaacplus_enc_calc_frame_len(bit_rate, sample_rate,
  459|   300k|                                                            FRAME_LEN_BYTES_INT, frame_len_long);
  460|       |
  461|   300k|  frame_len <<= 3;
  462|       |
  463|   300k|  if (flag_last_element) {
  ------------------
  |  Branch (463:7): [True: 142k, False: 158k]
  ------------------
  464|   142k|    code_bits_last = pstr_qc_state->average_bits_tot - pstr_qc_state->glob_stat_bits;
  465|       |
  466|   142k|    code_bits = frame_len - pstr_qc_state->glob_stat_bits;
  467|   158k|  } else {
  468|   158k|    code_bits_last = pstr_qc_state->average_bits_tot;
  469|       |
  470|   158k|    code_bits = frame_len;
  471|   158k|  }
  472|       |
  473|       |  /* calculate bits for every channel element */
  474|   300k|  if (code_bits != code_bits_last) {
  ------------------
  |  Branch (474:7): [True: 89.0k, False: 211k]
  ------------------
  475|  89.0k|    WORD32 total_bits = 0;
  476|       |
  477|  89.0k|    pstr_qc_state->element_bits.average_bits =
  478|  89.0k|        (WORD32)(pstr_qc_state->element_bits.relative_bits * code_bits);
  479|       |
  480|  89.0k|    total_bits += pstr_qc_state->element_bits.average_bits;
  481|       |
  482|  89.0k|    pstr_qc_state->element_bits.average_bits += code_bits - total_bits;
  483|  89.0k|  }
  484|       |
  485|   300k|  pstr_qc_state->average_bits_tot = frame_len;
  486|       |
  487|       |  /* Bits carried over from previous frame due to distribution of fill bits */
  488|   300k|  pstr_qc_state->element_bits.average_bits += pstr_qc_state->element_bits.carry_bits;
  489|   300k|  pstr_qc_state->average_bits_tot += pstr_qc_state->element_bits.carry_bits;
  490|       |
  491|       |  /* Flush for current frame */
  492|   300k|  pstr_qc_state->element_bits.carry_bits = 0;
  493|   300k|}
ia_enhaacplus_aac_limitbitrate:
  496|  4.87k|                                      WORD32 num_channels, WORD32 bit_rate) {
  497|  4.87k|  WORD32 prev_bit_rate, shift = 0, iter = 0;
  498|  4.87k|  WORD32 max_ch_bits = MAXIMUM_CHANNEL_BITS_1024;
  ------------------
  |  |   94|  4.87k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
  499|       |
  500|  27.4k|  while ((frame_length & ~((1 << (shift + 1)) - 1)) == frame_length &&
  ------------------
  |  Branch (500:10): [True: 26.3k, False: 1.18k]
  ------------------
  501|  26.3k|         (core_sampling_rate & ~((1 << (shift + 1)) - 1)) == core_sampling_rate) {
  ------------------
  |  Branch (501:10): [True: 22.6k, False: 3.68k]
  ------------------
  502|  22.6k|    shift++;
  503|  22.6k|  }
  504|       |
  505|  4.87k|  max_ch_bits = MAXIMUM_CHANNEL_BITS_1024 * frame_length / MAX_FRAME_LEN;
  ------------------
  |  |   94|  4.87k|#define MAXIMUM_CHANNEL_BITS_1024 6144
  ------------------
                max_ch_bits = MAXIMUM_CHANNEL_BITS_1024 * frame_length / MAX_FRAME_LEN;
  ------------------
  |  |  101|  4.87k|#define MAX_FRAME_LEN (1024)
  ------------------
  506|       |
  507|  6.56k|  do {
  508|  6.56k|    prev_bit_rate = bit_rate;
  509|       |
  510|  6.56k|    bit_rate = MAX(bit_rate, ((((40 * num_channels) + TRANSPORT_BITS) * (core_sampling_rate)) /
  ------------------
  |  |   24|  6.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 5.13k, False: 1.42k]
  |  |  ------------------
  ------------------
  511|  6.56k|                              frame_length));
  512|  6.56k|    bit_rate = MIN(bit_rate, ((num_channels * max_ch_bits) * (core_sampling_rate >> shift)) /
  ------------------
  |  |   23|  6.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 4.56k, False: 1.99k]
  |  |  ------------------
  ------------------
  513|  6.56k|                                 (frame_length >> shift));
  514|       |
  515|  6.56k|  } while (prev_bit_rate != bit_rate && iter++ < 3);
  ------------------
  |  Branch (515:12): [True: 1.68k, False: 4.87k]
  |  Branch (515:41): [True: 1.68k, False: 0]
  ------------------
  516|       |
  517|  4.87k|  return bit_rate;
  518|  4.87k|}
ixheaace_qc_util.c:ia_enhaacplus_enc_frame_padding:
   94|   300k|                                              WORD32 *ptr_padding_rest, WORD32 frame_len_long) {
   95|   300k|  WORD32 padding_on;
   96|   300k|  WORD32 difference;
   97|       |
   98|   300k|  padding_on = 0;
   99|       |
  100|   300k|  difference = ia_enhaacplus_enc_calc_frame_len(bit_rate, sample_rate, FRAME_LEN_BYTES_MODULO,
  101|   300k|                                                frame_len_long);
  102|       |
  103|   300k|  *ptr_padding_rest -= difference;
  104|       |
  105|   300k|  if (*ptr_padding_rest <= 0) {
  ------------------
  |  Branch (105:7): [True: 81.1k, False: 219k]
  ------------------
  106|  81.1k|    padding_on = 1;
  107|       |
  108|  81.1k|    *ptr_padding_rest += sample_rate;
  109|  81.1k|  }
  110|       |
  111|   300k|  return padding_on;
  112|   300k|}
ixheaace_qc_util.c:ia_enhaacplus_enc_calc_frame_len:
   74|   601k|                                               WORD32 long_frame_len) {
   75|   601k|  WORD32 result;
   76|       |
   77|   601k|  result = ((long_frame_len) >> 3) * (bit_rate);
   78|       |
   79|   601k|  switch (mode) {
   80|   300k|    case FRAME_LEN_BYTES_MODULO:
  ------------------
  |  Branch (80:5): [True: 300k, False: 300k]
  ------------------
   81|   300k|      result %= sample_rate;
   82|   300k|      break;
   83|   300k|    case FRAME_LEN_BYTES_INT:
  ------------------
  |  Branch (83:5): [True: 300k, False: 300k]
  ------------------
   84|   300k|      result /= sample_rate;
   85|   300k|      break;
   86|      0|    default:
  ------------------
  |  Branch (86:5): [True: 0, False: 601k]
  ------------------
   87|      0|      break;
   88|   601k|  }
   89|       |
   90|   601k|  return result;
   91|   601k|}

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

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

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

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

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

ixheaace_code_envelope:
   72|  1.47M|                                    WORD32 is_ld_sbr) {
   73|  1.47M|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  1.47M|#define IA_NO_ERROR 0x00000000
  ------------------
   74|  1.47M|  WORD32 i, no_of_bands, band, last_nrg, current_energy;
   75|  1.47M|  WORD32 *ptr_energy;
   76|       |
   77|  1.47M|  WORD32 code_book_scf_lav_lvl_time;
   78|  1.47M|  WORD32 code_book_scf_lav_lvl_freq;
   79|  1.47M|  WORD32 code_book_scf_lav_bal_time;
   80|  1.47M|  WORD32 code_book_scf_lav_bal_freq;
   81|  1.47M|  const UWORD8 *ptr_huff_tab_lvl_time_l;
   82|  1.47M|  const UWORD8 *ptr_huff_tab_bal_time_l;
   83|  1.47M|  const UWORD8 *ptr_huff_tab_lvl_freq_l;
   84|  1.47M|  const UWORD8 *ptr_huff_tab_bal_freq_l;
   85|       |
   86|  1.47M|  WORD32 offset = pstr_code_env->offset;
   87|  1.47M|  WORD32 env_data_tab_comp_factor;
   88|       |
   89|  1.47M|  WORD32 delta_f_bits = 0, delta_t_bits = 0;
   90|       |
   91|  1.47M|  WORD32 use_dt;
   92|       |
   93|  1.47M|  WORD32 delta_f[MAXIMUM_FREQ_COEFFS];
   94|  1.47M|  WORD32 delta_t[MAXIMUM_FREQ_COEFFS];
   95|       |
   96|  1.47M|  FLOAT32 df_edge_first_ennv;
   97|       |
   98|  1.47M|  df_edge_first_ennv = pstr_code_env->df_edge_1st_env +
   99|  1.47M|                       pstr_code_env->df_edge_incr * pstr_code_env->df_edge_incr_fac;
  100|       |
  101|  1.47M|  switch (coupling) {
  102|   356k|    case COUPLING_1:
  ------------------
  |  |   22|   356k|#define COUPLING_1 (1)
  ------------------
  |  Branch (102:5): [True: 356k, False: 1.12M]
  ------------------
  103|   356k|      code_book_scf_lav_lvl_time = pstr_code_env->code_book_scf_lav_lvl_time;
  104|   356k|      code_book_scf_lav_lvl_freq = pstr_code_env->code_book_scf_lav_lvl_freq;
  105|   356k|      code_book_scf_lav_bal_time = pstr_code_env->code_book_scf_lav_bal_time;
  106|   356k|      code_book_scf_lav_bal_freq = pstr_code_env->code_book_scf_lav_bal_freq;
  107|   356k|      ptr_huff_tab_lvl_time_l = pstr_code_env->ptr_huff_tab_lvl_time_l;
  108|   356k|      ptr_huff_tab_bal_time_l = pstr_code_env->ptr_huff_tab_bal_time_l;
  109|   356k|      ptr_huff_tab_lvl_freq_l = pstr_code_env->ptr_huff_tab_lvl_freq_l;
  110|   356k|      ptr_huff_tab_bal_freq_l = pstr_code_env->ptr_huff_tab_bal_freq_l;
  111|   356k|      break;
  112|  1.12M|    default:
  ------------------
  |  Branch (112:5): [True: 1.12M, False: 356k]
  ------------------
  113|  1.12M|      code_book_scf_lav_lvl_time = pstr_code_env->code_book_scf_lav_time;
  114|  1.12M|      code_book_scf_lav_lvl_freq = pstr_code_env->code_book_scf_lav_freq;
  115|  1.12M|      code_book_scf_lav_bal_time = pstr_code_env->code_book_scf_lav_time;
  116|  1.12M|      code_book_scf_lav_bal_freq = pstr_code_env->code_book_scf_lav_freq;
  117|  1.12M|      ptr_huff_tab_lvl_time_l = pstr_code_env->ptr_huff_tab_time_l;
  118|  1.12M|      ptr_huff_tab_bal_time_l = pstr_code_env->ptr_huff_tab_time_l;
  119|  1.12M|      ptr_huff_tab_lvl_freq_l = pstr_code_env->ptr_huff_tab_freq_l;
  120|  1.12M|      ptr_huff_tab_bal_freq_l = pstr_code_env->ptr_huff_tab_freq_l;
  121|  1.47M|  }
  122|       |
  123|  1.47M|  if (coupling == 1 && channel == 1) {
  ------------------
  |  Branch (123:7): [True: 356k, False: 1.12M]
  |  Branch (123:24): [True: 177k, False: 178k]
  ------------------
  124|   177k|    env_data_tab_comp_factor = 1;
  125|  1.30M|  } else {
  126|  1.30M|    env_data_tab_comp_factor = 0;
  127|  1.30M|  }
  128|       |
  129|  1.47M|  if (pstr_code_env->delta_t_across_frames == 0 || header_active) {
  ------------------
  |  Branch (129:7): [True: 0, False: 1.47M]
  |  Branch (129:52): [True: 181k, False: 1.29M]
  ------------------
  130|   181k|    pstr_code_env->update = 0;
  131|   181k|  }
  132|       |
  133|  3.70M|  for (i = 0; i < num_envelopes; i++) {
  ------------------
  |  Branch (133:15): [True: 2.22M, False: 1.47M]
  ------------------
  134|  2.22M|    if (freq_res[i] == FREQ_RES_HIGH)
  ------------------
  |  Branch (134:9): [True: 1.76M, False: 459k]
  ------------------
  135|  1.76M|      no_of_bands = pstr_code_env->num_scf[FREQ_RES_HIGH];
  136|   459k|    else
  137|   459k|      no_of_bands = pstr_code_env->num_scf[FREQ_RES_LOW];
  138|       |
  139|  2.22M|    ptr_energy = ptr_sfb_energy;
  140|  2.22M|    current_energy = *ptr_energy;
  141|  2.22M|    delta_f[0] = ixheaac_shr32(current_energy, env_data_tab_comp_factor);
  142|  2.22M|    if (coupling && channel == 1)
  ------------------
  |  Branch (142:9): [True: 537k, False: 1.68M]
  |  Branch (142:21): [True: 267k, False: 269k]
  ------------------
  143|   267k|      delta_f_bits = pstr_code_env->start_bits_balance;
  144|  1.95M|    else
  145|  1.95M|      delta_f_bits = pstr_code_env->start_bits;
  146|       |
  147|  2.22M|    if (pstr_code_env->update != 0) {
  ------------------
  |  Branch (147:9): [True: 1.64M, False: 580k]
  ------------------
  148|  1.64M|      delta_t[0] = ixheaac_shr32((current_energy - pstr_code_env->sfb_nrg_prev[0]),
  149|  1.64M|                                 env_data_tab_comp_factor);
  150|       |
  151|  1.64M|      err_code = ixheaace_compute_bits(delta_t[0], code_book_scf_lav_lvl_time,
  152|  1.64M|                                       code_book_scf_lav_bal_time, ptr_huff_tab_lvl_time_l,
  153|  1.64M|                                       ptr_huff_tab_bal_time_l, coupling, channel, &delta_t_bits);
  154|  1.64M|      if (err_code) {
  ------------------
  |  Branch (154:11): [True: 971, False: 1.64M]
  ------------------
  155|    971|        return err_code;
  156|    971|      }
  157|  1.64M|    }
  158|       |
  159|  2.22M|    ixheaace_map_low_res_energy_value(current_energy, pstr_code_env->sfb_nrg_prev, offset, 0,
  160|  2.22M|                                      freq_res[i]);
  161|       |
  162|  2.22M|    band = no_of_bands - 1;
  163|  15.0M|    while (band > 0) {
  ------------------
  |  Branch (163:12): [True: 12.8M, False: 2.22M]
  ------------------
  164|  12.8M|      if (ptr_energy[band] - ptr_energy[band - 1] > code_book_scf_lav_lvl_freq) {
  ------------------
  |  Branch (164:11): [True: 416, False: 12.8M]
  ------------------
  165|    416|        ptr_energy[band - 1] = ptr_energy[band] - code_book_scf_lav_lvl_freq;
  166|    416|      }
  167|  12.8M|      band--;
  168|  12.8M|    }
  169|       |
  170|  2.22M|    band = 1;
  171|  15.0M|    while (band < no_of_bands) {
  ------------------
  |  Branch (171:12): [True: 12.8M, False: 2.22M]
  ------------------
  172|  12.8M|      WORD32 index;
  173|  12.8M|      WORD32 delta_lcl_bits = 0;
  174|       |
  175|  12.8M|      if (ixheaac_sub32_sat(ptr_energy[band - 1], ptr_energy[band]) >
  ------------------
  |  Branch (175:11): [True: 1.35M, False: 11.4M]
  ------------------
  176|  12.8M|          code_book_scf_lav_lvl_freq) {
  177|  1.35M|        ptr_energy[band] = ptr_energy[band - 1] - code_book_scf_lav_lvl_freq;
  178|  1.35M|      }
  179|       |
  180|  12.8M|      last_nrg = *ptr_energy++;
  181|  12.8M|      current_energy = *ptr_energy;
  182|  12.8M|      delta_f[band] = ixheaac_shr32((current_energy - last_nrg), env_data_tab_comp_factor);
  183|       |
  184|  12.8M|      err_code = ixheaace_compute_bits(
  185|  12.8M|          delta_f[band], code_book_scf_lav_lvl_freq, code_book_scf_lav_bal_freq,
  186|  12.8M|          ptr_huff_tab_lvl_freq_l, ptr_huff_tab_bal_freq_l, coupling, channel, &delta_lcl_bits);
  187|  12.8M|      if (err_code) {
  ------------------
  |  Branch (187:11): [True: 1, False: 12.8M]
  ------------------
  188|      1|        return err_code;
  189|      1|      }
  190|  12.8M|      delta_f_bits += delta_lcl_bits;
  191|       |
  192|  12.8M|      if (pstr_code_env->update != 0) {
  ------------------
  |  Branch (192:11): [True: 9.66M, False: 3.18M]
  ------------------
  193|  9.66M|        delta_lcl_bits = 0;
  194|  9.66M|        index = ixheaace_index_low2_high(offset, band, freq_res[i]);
  195|  9.66M|        delta_t[band] = current_energy - pstr_code_env->sfb_nrg_prev[index];
  196|  9.66M|        delta_t[band] = ixheaac_shr32(delta_t[band], env_data_tab_comp_factor);
  197|       |
  198|  9.66M|        ixheaace_map_low_res_energy_value(current_energy, pstr_code_env->sfb_nrg_prev, offset,
  199|  9.66M|                                          band, freq_res[i]);
  200|  9.66M|        if ((delta_t[band] > 31) || (delta_t[band] < -31)) {
  ------------------
  |  Branch (200:13): [True: 1.86k, False: 9.65M]
  |  Branch (200:37): [True: 977, False: 9.65M]
  ------------------
  201|  2.84k|          delta_t[band] = 31;
  202|  2.84k|        }
  203|       |
  204|  9.66M|        err_code = ixheaace_compute_bits(
  205|  9.66M|            delta_t[band], code_book_scf_lav_lvl_time, code_book_scf_lav_bal_time,
  206|  9.66M|            ptr_huff_tab_lvl_time_l, ptr_huff_tab_bal_time_l, coupling, channel, &delta_lcl_bits);
  207|  9.66M|        if (err_code) {
  ------------------
  |  Branch (207:13): [True: 60, False: 9.66M]
  ------------------
  208|     60|          return err_code;
  209|     60|        }
  210|  9.66M|        delta_t_bits += delta_lcl_bits;
  211|  9.66M|      } else {
  212|  3.18M|        ixheaace_map_low_res_energy_value(current_energy, pstr_code_env->sfb_nrg_prev, offset,
  213|  3.18M|                                          band, freq_res[i]);
  214|  3.18M|      }
  215|  12.8M|      band++;
  216|  12.8M|    }
  217|       |
  218|  2.22M|    if (i == 0) {
  ------------------
  |  Branch (218:9): [True: 1.47M, False: 747k]
  ------------------
  219|  1.47M|      use_dt = (pstr_code_env->update != 0 &&
  ------------------
  |  Branch (219:17): [True: 897k, False: 580k]
  ------------------
  220|   897k|                (delta_f_bits > delta_t_bits * (1 + df_edge_first_ennv)));
  ------------------
  |  Branch (220:17): [True: 481k, False: 415k]
  ------------------
  221|  1.47M|    } else if (is_ld_sbr) {
  ------------------
  |  Branch (221:16): [True: 163k, False: 583k]
  ------------------
  222|   163k|      use_dt = ((pstr_code_env->update != 0) && (delta_f_bits > delta_t_bits));
  ------------------
  |  Branch (222:17): [True: 163k, False: 0]
  |  Branch (222:49): [True: 41.2k, False: 122k]
  ------------------
  223|   583k|    } else {
  224|   583k|      use_dt = (delta_f_bits > delta_t_bits);
  225|   583k|    }
  226|       |
  227|  2.22M|    if (use_dt) {
  ------------------
  |  Branch (227:9): [True: 796k, False: 1.42M]
  ------------------
  228|   796k|      ptr_dir_vec[i] = TIME;
  ------------------
  |  |  177|   796k|#define TIME (1)
  ------------------
  229|   796k|      memcpy(ptr_sfb_energy, delta_t, no_of_bands * sizeof(ptr_sfb_energy[0]));
  230|  1.42M|    } else {
  231|  1.42M|      ptr_dir_vec[i] = FREQ;
  ------------------
  |  |  176|  1.42M|#define FREQ (0)
  ------------------
  232|  1.42M|      memcpy(ptr_sfb_energy, delta_f, no_of_bands * sizeof(ptr_sfb_energy[0]));
  233|  1.42M|    }
  234|  2.22M|    if (0 == i && 1 == usac_indep_flag) {
  ------------------
  |  Branch (234:9): [True: 1.47M, False: 747k]
  |  Branch (234:19): [True: 37.0k, False: 1.44M]
  ------------------
  235|  37.0k|      ptr_dir_vec[i] = FREQ;
  ------------------
  |  |  176|  37.0k|#define FREQ (0)
  ------------------
  236|  37.0k|      memcpy(ptr_sfb_energy, delta_f, no_of_bands * sizeof(ptr_sfb_energy[0]));
  237|  37.0k|    }
  238|       |
  239|  2.22M|    ptr_sfb_energy += no_of_bands;
  240|  2.22M|    pstr_code_env->update = 1;
  241|  2.22M|  }
  242|  1.47M|  return err_code;
  243|  1.47M|}
ixheaace_sbr_code_envelope_lp.c:ixheaace_index_low2_high:
   54|  9.66M|static WORD32 ixheaace_index_low2_high(WORD32 offset, WORD32 index, ixheaace_freq_res res) {
   55|  9.66M|  switch (res) {
   56|  2.01M|    case FREQ_RES_LOW:
  ------------------
  |  Branch (56:5): [True: 2.01M, False: 7.64M]
  ------------------
   57|  2.01M|      if (offset >= 0) {
  ------------------
  |  Branch (57:11): [True: 2.01M, False: 0]
  ------------------
   58|  2.01M|        return (index < offset) ? (index) : (2 * index - offset);
  ------------------
  |  Branch (58:16): [True: 0, False: 2.01M]
  ------------------
   59|  2.01M|      } 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|  7.64M|    default:
  ------------------
  |  Branch (63:5): [True: 7.64M, False: 2.01M]
  ------------------
   64|  7.64M|      return (index);
   65|  9.66M|  }
   66|  9.66M|}

ixheaace_init_sbr_bitstream:
   56|   409k|                                 ixheaace_sbr_codec_type sbr_codec) {
   57|   409k|  ixheaace_reset_bitbuf(&pstr_cmon_data->str_sbr_bit_buf, ptr_memory_base, memory_size);
   58|       |
   59|   409k|  pstr_cmon_data->str_tmp_write_bit_buf = pstr_cmon_data->str_sbr_bit_buf;
   60|   409k|  if (HEAAC_SBR == sbr_codec) {
  ------------------
  |  Branch (60:7): [True: 129k, False: 280k]
  ------------------
   61|   129k|    ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0, SI_FILL_EXTENTION_BITS);
  ------------------
  |  |   37|   129k|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
   62|       |
   63|   129k|    if (crc_active) {
  ------------------
  |  Branch (63:9): [True: 0, False: 129k]
  ------------------
   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|   129k|  }
   67|   409k|}
ixheaace_assemble_sbr_bitstream:
   70|   398k|                                     ixheaace_sbr_codec_type sbr_codec) {
   71|   398k|  UWORD16 crc_reg = CRCINIT_SBR;
  ------------------
  |  |   26|   398k|#define CRCINIT_SBR (0x0)
  ------------------
   72|   398k|  WORD32 num_crc_bits, i;
   73|   398k|  WORD32 sbr_load = 0;
   74|       |
   75|   398k|  sbr_load = pstr_cmon_data->sbr_hdr_bits + pstr_cmon_data->sbr_data_bits;
   76|       |
   77|   398k|  if (HEAAC_SBR == sbr_codec) {
  ------------------
  |  Branch (77:7): [True: 129k, False: 268k]
  ------------------
   78|   129k|    sbr_load += SI_FILL_EXTENTION_BITS;
  ------------------
  |  |   37|   129k|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
   79|   129k|  }
   80|       |
   81|   398k|  if (pstr_cmon_data->sbr_crc_len) {
  ------------------
  |  Branch (81:7): [True: 0, False: 398k]
  ------------------
   82|      0|    sbr_load += SI_CRC_BITS_SBR;
  ------------------
  |  |   32|      0|#define SI_CRC_BITS_SBR (10)
  ------------------
   83|      0|  }
   84|       |
   85|   398k|  if (USAC_SBR != sbr_codec) {
  ------------------
  |  Branch (85:7): [True: 201k, False: 196k]
  ------------------
   86|   201k|    pstr_cmon_data->sbr_fill_bits = (8 - (sbr_load) % 8) % 8;
   87|       |
   88|   201k|    ixheaace_write_bits(&pstr_cmon_data->str_sbr_bit_buf, 0,
   89|   201k|                        (UWORD8)pstr_cmon_data->sbr_fill_bits);
   90|   201k|  }
   91|   398k|  if (pstr_cmon_data->sbr_crc_len) {
  ------------------
  |  Branch (91:7): [True: 0, False: 398k]
  ------------------
   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|   398k|  if (pstr_cmon_data->sbr_crc_len) {
  ------------------
  |  Branch (115:7): [True: 0, False: 398k]
  ------------------
  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|   398k|  } else {
  121|   398k|    if (HEAAC_SBR == sbr_codec) {
  ------------------
  |  Branch (121:9): [True: 129k, False: 268k]
  ------------------
  122|   129k|      ixheaace_write_bits(&pstr_cmon_data->str_tmp_write_bit_buf, SI_FIL_SBR,
  ------------------
  |  |   28|   129k|#define SI_FIL_SBR (13)
  ------------------
  123|   129k|                          SI_FILL_EXTENTION_BITS);
  ------------------
  |  |   37|   129k|#define SI_FILL_EXTENTION_BITS (4)
  ------------------
  124|   129k|    }
  125|   398k|  }
  126|   398k|}

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

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

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

ixheaace_get_sbr_start_freq_raw:
  342|  8.56k|ixheaace_get_sbr_start_freq_raw(WORD32 start_freq, WORD32 qmf_bands, WORD32 fs) {
  343|  8.56k|  WORD32 result;
  344|       |
  345|  8.56k|  if (start_freq < 0 || start_freq > 15) {
  ------------------
  |  Branch (345:7): [True: 0, False: 8.56k]
  |  Branch (345:25): [True: 0, False: 8.56k]
  ------------------
  346|      0|    return -1;
  347|      0|  }
  348|       |
  349|  8.56k|  result = ixheaace_get_start_freq(fs, start_freq);
  350|       |
  351|  8.56k|  result = (result * fs / qmf_bands + 1) >> 1;
  352|       |
  353|  8.56k|  return result;
  354|  8.56k|}
ixheaace_find_start_and_stop_band:
  406|  5.86k|                                  ixheaace_sbr_codec_type sbr_codec) {
  407|  5.86k|  switch (sbr_codec) {
  408|  2.86k|    case USAC_SBR: {
  ------------------
  |  Branch (408:5): [True: 2.86k, False: 2.99k]
  ------------------
  409|  2.86k|      if (sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|  2.86k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (409:11): [True: 565, False: 2.30k]
  ------------------
  410|    565|        *ptr_k0 = ixheaace_get_start_freq_4_1(sampling_freq, start_freq);
  411|  2.30k|      } else {
  412|  2.30k|        *ptr_k0 = ixheaace_get_start_freq(sampling_freq, start_freq);
  413|  2.30k|      }
  414|  2.86k|      break;
  415|      0|    }
  416|  2.99k|    default: {
  ------------------
  |  Branch (416:5): [True: 2.99k, False: 2.86k]
  ------------------
  417|  2.99k|      *ptr_k0 = ixheaace_get_start_freq(sampling_freq, start_freq);
  418|  2.99k|      break;
  419|      0|    }
  420|  5.86k|  }
  421|  5.86k|  if ((sample_rate_mode == 1) && (sampling_freq * num_channels < 2 * *ptr_k0 * sampling_freq)) {
  ------------------
  |  Branch (421:7): [True: 4.83k, False: 1.02k]
  |  Branch (421:34): [True: 0, False: 4.83k]
  ------------------
  422|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_SAMPLERATE_MODE;
  423|      0|  }
  424|       |
  425|  5.86k|  if (stop_freq < 14) {
  ------------------
  |  Branch (425:7): [True: 5.86k, False: 0]
  ------------------
  426|  5.86k|    switch (sbr_codec) {
  427|  2.86k|      case USAC_SBR: {
  ------------------
  |  Branch (427:7): [True: 2.86k, False: 2.99k]
  ------------------
  428|  2.86k|        if (USAC_SBR_RATIO_INDEX_4_1 == sbr_ratio_idx) {
  ------------------
  |  |  188|  2.86k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (428:13): [True: 565, False: 2.30k]
  ------------------
  429|    565|          *ptr_k2 = ixheaace_get_stop_freq_4_1(sampling_freq, stop_freq);
  430|  2.30k|        } else {
  431|  2.30k|          *ptr_k2 = ixheaace_get_usac_stop_freq(sampling_freq, stop_freq);
  432|  2.30k|        }
  433|  2.86k|        break;
  434|      0|      }
  435|  2.99k|      default: {
  ------------------
  |  Branch (435:7): [True: 2.99k, False: 2.86k]
  ------------------
  436|  2.99k|        *ptr_k2 = ixheaace_get_stop_freq(sampling_freq, stop_freq);
  437|  2.99k|        break;
  438|      0|      }
  439|  5.86k|    }
  440|  5.86k|  }
  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.86k|  if (*ptr_k2 > num_channels) {
  ------------------
  |  Branch (446:7): [True: 0, False: 5.86k]
  ------------------
  447|      0|    *ptr_k2 = num_channels;
  448|      0|  }
  449|  5.86k|  if (sbr_codec == USAC_SBR) {
  ------------------
  |  Branch (449:7): [True: 2.86k, False: 2.99k]
  ------------------
  450|  2.86k|    if (sbr_ratio_idx == USAC_SBR_RATIO_INDEX_4_1) {
  ------------------
  |  |  188|  2.86k|#define USAC_SBR_RATIO_INDEX_4_1 (1)
  ------------------
  |  Branch (450:9): [True: 565, False: 2.30k]
  ------------------
  451|    565|      if (((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_USAC) || (*ptr_k2 <= *ptr_k0)) {
  ------------------
  |  |   76|    565|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  ------------------
  |  Branch (451:11): [True: 0, False: 565]
  |  Branch (451:63): [True: 0, False: 565]
  ------------------
  452|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  453|      0|      }
  454|    565|      if ((2 * sampling_freq == 44100) && ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_USAC)) {
  ------------------
  |  |   76|     53|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  ------------------
  |  Branch (454:11): [True: 53, False: 512]
  |  Branch (454:43): [True: 0, False: 53]
  ------------------
  455|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  456|      0|      }
  457|    565|      if ((2 * sampling_freq >= 48000) && ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_USAC)) {
  ------------------
  |  |   76|    420|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  ------------------
  |  Branch (457:11): [True: 420, False: 145]
  |  Branch (457:43): [True: 0, False: 420]
  ------------------
  458|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  459|      0|      }
  460|  2.30k|    } else {
  461|  2.30k|      if (sampling_freq <= 32000) {
  ------------------
  |  Branch (461:11): [True: 1.10k, False: 1.19k]
  ------------------
  462|  1.10k|        if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_LE32KHZ) {
  ------------------
  |  |   61|  1.10k|#define MAXIMUM_FREQ_COEFFS_LE32KHZ (48)
  ------------------
  |  Branch (462:13): [True: 0, False: 1.10k]
  ------------------
  463|      0|          return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  464|      0|        }
  465|  1.19k|      } else if (sampling_freq == 44100) {
  ------------------
  |  Branch (465:18): [True: 496, False: 697]
  ------------------
  466|    496|        if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_EQ44KHZ) {
  ------------------
  |  |   62|    496|#define MAXIMUM_FREQ_COEFFS_EQ44KHZ (35)
  ------------------
  |  Branch (466:13): [True: 0, False: 496]
  ------------------
  467|      0|          return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  468|      0|        }
  469|    697|      } else if (sampling_freq >= 48000) {
  ------------------
  |  Branch (469:18): [True: 696, False: 1]
  ------------------
  470|    696|        if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_GE48KHZ) {
  ------------------
  |  |   63|    696|#define MAXIMUM_FREQ_COEFFS_GE48KHZ (32)
  ------------------
  |  Branch (470:13): [True: 7, False: 689]
  ------------------
  471|      7|          return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  472|      7|        }
  473|    696|      } else {
  474|      1|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  475|      1|      }
  476|  2.30k|    }
  477|  2.99k|  } else {
  478|  2.99k|    if (sampling_freq <= 32000) {
  ------------------
  |  Branch (478:9): [True: 1.06k, False: 1.93k]
  ------------------
  479|  1.06k|      if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_LE32KHZ) {
  ------------------
  |  |   61|  1.06k|#define MAXIMUM_FREQ_COEFFS_LE32KHZ (48)
  ------------------
  |  Branch (479:11): [True: 0, False: 1.06k]
  ------------------
  480|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  481|      0|      }
  482|  1.93k|    } else if (sampling_freq == 44100) {
  ------------------
  |  Branch (482:16): [True: 941, False: 992]
  ------------------
  483|    941|      if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_EQ44KHZ) {
  ------------------
  |  |   62|    941|#define MAXIMUM_FREQ_COEFFS_EQ44KHZ (35)
  ------------------
  |  Branch (483:11): [True: 0, False: 941]
  ------------------
  484|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  485|      0|      }
  486|    992|    } else if (sampling_freq >= 48000) {
  ------------------
  |  Branch (486:16): [True: 992, False: 0]
  ------------------
  487|    992|      if ((*ptr_k2 - *ptr_k0) > MAXIMUM_FREQ_COEFFS_GE48KHZ) {
  ------------------
  |  |   63|    992|#define MAXIMUM_FREQ_COEFFS_GE48KHZ (32)
  ------------------
  |  Branch (487:11): [True: 0, False: 992]
  ------------------
  488|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  489|      0|      }
  490|    992|    } else {
  491|      0|      return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  492|      0|    }
  493|  2.99k|  }
  494|       |
  495|  5.85k|  if ((*ptr_k2 - *ptr_k0) < 0) {
  ------------------
  |  Branch (495:7): [True: 0, False: 5.85k]
  ------------------
  496|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_FREQ_COEFFS;
  497|      0|  }
  498|       |
  499|  5.85k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  5.85k|#define IA_NO_ERROR 0x00000000
  ------------------
  500|  5.85k|}
ixheaace_update_freq_scale:
  507|  5.85k|{
  508|  5.85k|  IA_ERRORCODE err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  5.85k|#define IA_NO_ERROR 0x00000000
  ------------------
  509|  5.85k|  WORD32 b_p_o = 0;
  510|  5.85k|  WORD32 dk = 0;
  511|       |
  512|  5.85k|  FLOAT32 warp;
  513|  5.85k|  WORD32 k1 = 0, i;
  514|  5.85k|  WORD32 num_bands0;
  515|  5.85k|  WORD32 num_bands1;
  516|  5.85k|  WORD32 diff_tot[IXHEAACE_MAXIMUM_OCTAVE + IXHEAACE_MAXIMUM_SECOND_REGION] = {0};
  517|  5.85k|  WORD32 *diff0 = diff_tot;
  518|  5.85k|  WORD32 *diff1 = diff_tot + IXHEAACE_MAXIMUM_OCTAVE;
  ------------------
  |  |   23|  5.85k|#define IXHEAACE_MAXIMUM_OCTAVE (29)
  ------------------
  519|  5.85k|  WORD32 k2_achived;
  520|  5.85k|  WORD32 k2_diff;
  521|  5.85k|  WORD32 incr = 0;
  522|       |
  523|  5.85k|  switch (freq_scale) {
  ------------------
  |  Branch (523:11): [True: 5.85k, False: 0]
  ------------------
  524|  3.07k|    case 1:
  ------------------
  |  Branch (524:5): [True: 3.07k, False: 2.77k]
  ------------------
  525|  3.07k|      b_p_o = 12;
  526|  3.07k|      break;
  527|  1.19k|    case 2:
  ------------------
  |  Branch (527:5): [True: 1.19k, False: 4.66k]
  ------------------
  528|  1.19k|      b_p_o = 10;
  529|  1.19k|      break;
  530|  1.58k|    case 3:
  ------------------
  |  Branch (530:5): [True: 1.58k, False: 4.27k]
  ------------------
  531|  1.58k|      b_p_o = 8;
  532|  1.58k|      break;
  533|  5.85k|  }
  534|       |
  535|  5.85k|  if (freq_scale > 0) {
  ------------------
  |  Branch (535:7): [True: 5.85k, False: 0]
  ------------------
  536|  5.85k|    if (alter_scale == 0) {
  ------------------
  |  Branch (536:9): [True: 0, False: 5.85k]
  ------------------
  537|      0|      warp = 1.0f;
  538|  5.85k|    } else {
  539|  5.85k|      warp = 1.3f;
  540|  5.85k|    }
  541|       |
  542|  5.85k|    if (IXHEAACE_QUAD_RATE == sbr_rate) {
  ------------------
  |  Branch (542:9): [True: 565, False: 5.29k]
  ------------------
  543|    565|      if (k0 < b_p_o) {
  ------------------
  |  Branch (543:11): [True: 0, False: 565]
  ------------------
  544|      0|        b_p_o = (k0 >> 1) * 2;
  545|      0|      }
  546|    565|    }
  547|       |
  548|  5.85k|    if (4 * k2 >= 9 * k0) {
  ------------------
  |  Branch (548:9): [True: 4.12k, False: 1.73k]
  ------------------
  549|  4.12k|      k1 = 2 * k0;
  550|  4.12k|      num_bands0 = ixheaace_number_of_bands(b_p_o, k0, k1, 1.0f);
  551|  4.12k|      num_bands1 = ixheaace_number_of_bands(b_p_o, k1, k2, warp);
  552|       |
  553|  4.12k|      ixheaace_calc_bands(diff0, k0, k1, num_bands0);
  554|  4.12k|      ixheaace_shellsort_int(diff0, num_bands0);
  555|       |
  556|  4.12k|      if (diff0[0] == 0) {
  ------------------
  |  Branch (556:11): [True: 3, False: 4.12k]
  ------------------
  557|      3|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  558|      3|      }
  559|       |
  560|  4.12k|      ixheaace_cum_sum(k0, diff0, num_bands0, ptr_k_master);
  561|       |
  562|  4.12k|      ixheaace_calc_bands(diff1, k1, k2, num_bands1);
  563|  4.12k|      ixheaace_shellsort_int(diff1, num_bands1);
  564|       |
  565|  4.12k|      if (diff0[num_bands0 - 1] > diff1[0]) {
  ------------------
  |  Branch (565:11): [True: 261, False: 3.86k]
  ------------------
  566|    261|        ixheaace_modify_bands(diff0[num_bands0 - 1], diff1, num_bands1);
  567|    261|      }
  568|       |
  569|  4.12k|      ixheaace_cum_sum(k1, diff1, num_bands1, &ptr_k_master[num_bands0]);
  570|  4.12k|      *ptr_num_bands = num_bands0 + num_bands1;
  571|  4.12k|    } else {
  572|  1.73k|      k1 = k2;
  573|  1.73k|      num_bands0 = ixheaace_number_of_bands(b_p_o, k0, k1, 1.0f);
  574|       |
  575|  1.73k|      ixheaace_calc_bands(diff0, k0, k1, num_bands0);
  576|  1.73k|      ixheaace_shellsort_int(diff0, num_bands0);
  577|       |
  578|  1.73k|      if (diff0[0] == 0) {
  ------------------
  |  Branch (578:11): [True: 0, False: 1.73k]
  ------------------
  579|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  580|      0|      }
  581|       |
  582|  1.73k|      ixheaace_cum_sum(k0, diff0, num_bands0, ptr_k_master);
  583|       |
  584|  1.73k|      *ptr_num_bands = num_bands0;
  585|  1.73k|    }
  586|  5.85k|  } 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.85k|  if (*ptr_num_bands < 1) {
  ------------------
  |  Branch (627:7): [True: 0, False: 5.85k]
  ------------------
  628|      0|    return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  629|      0|  }
  630|       |
  631|  5.85k|  if (sbr_rate == IXHEAACE_QUAD_RATE) {
  ------------------
  |  Branch (631:7): [True: 562, False: 5.29k]
  ------------------
  632|  9.04k|    for (i = 1; i < *ptr_num_bands; i++) {
  ------------------
  |  Branch (632:17): [True: 8.48k, False: 562]
  ------------------
  633|  8.48k|      if (!(ptr_k_master[i] - ptr_k_master[i - 1] <= k0 - 2)) {
  ------------------
  |  Branch (633:11): [True: 0, False: 8.48k]
  ------------------
  634|      0|        return IA_EXHEAACE_INIT_FATAL_SBR_INVALID_NUM_BANDS;
  635|      0|      }
  636|  8.48k|    }
  637|    562|  }
  638|       |
  639|  5.85k|  return err_code;
  640|  5.85k|}
ixheaace_update_high_res:
  644|  5.85k|                              ixheaace_sr_mode dr_or_sr, WORD32 num_qmf_ch) {
  645|  5.85k|  WORD32 i;
  646|  5.85k|  WORD32 divider;
  647|  5.85k|  WORD32 max1, max2;
  648|       |
  649|  5.85k|  divider = (dr_or_sr == IXHEAACE_DUAL_RATE) ? 2 : 1;
  ------------------
  |  Branch (649:13): [True: 4.83k, False: 1.01k]
  ------------------
  650|  5.85k|  if (dr_or_sr == IXHEAACE_QUAD_RATE) {
  ------------------
  |  Branch (650:7): [True: 562, False: 5.29k]
  ------------------
  651|    562|    divider = 4;
  652|    562|  }
  653|       |
  654|  5.85k|  if ((ptr_k_master[*ptr_xover_band] > (num_qmf_ch / divider)) ||
  ------------------
  |  Branch (654:7): [True: 3, False: 5.84k]
  ------------------
  655|  5.84k|      (*ptr_xover_band > num_master)) {
  ------------------
  |  Branch (655:7): [True: 0, False: 5.84k]
  ------------------
  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.85k|  *ptr_num_hires = num_master - *ptr_xover_band;
  667|       |
  668|  86.2k|  for (i = *ptr_xover_band; i <= num_master; i++) {
  ------------------
  |  Branch (668:29): [True: 80.4k, False: 5.85k]
  ------------------
  669|  80.4k|    ptr_hires[i - *ptr_xover_band] = ptr_k_master[i];
  670|  80.4k|  }
  671|  5.85k|}
ixheaace_update_low_res:
  674|  5.85k|                             WORD32 ptr_num_hires) {
  675|  5.85k|  WORD32 i;
  676|       |
  677|  5.85k|  if (ptr_num_hires % 2 == 0) {
  ------------------
  |  Branch (677:7): [True: 5.85k, False: 0]
  ------------------
  678|  5.85k|    *ptr_num_lores = ptr_num_hires / 2;
  679|       |
  680|  49.0k|    for (i = 0; i <= *ptr_num_lores; i++) {
  ------------------
  |  Branch (680:17): [True: 43.1k, False: 5.85k]
  ------------------
  681|  43.1k|      ptr_lores[i] = ptr_hires[i * 2];
  682|  43.1k|    }
  683|  5.85k|  } 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.85k|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_start_freq:
  157|  13.8k|static WORD32 ixheaace_get_start_freq(WORD32 fs, WORD32 start_freq) {
  158|  13.8k|  WORD32 minimum_k0;
  159|       |
  160|  13.8k|  switch (fs) {
  161|    243|    case 16000:
  ------------------
  |  Branch (161:5): [True: 243, False: 13.6k]
  ------------------
  162|    243|      minimum_k0 = 24;
  163|    243|      break;
  164|     92|    case 22050:
  ------------------
  |  Branch (164:5): [True: 92, False: 13.7k]
  ------------------
  165|     92|      minimum_k0 = 17;
  166|     92|      break;
  167|    356|    case 24000:
  ------------------
  |  Branch (167:5): [True: 356, False: 13.5k]
  ------------------
  168|    356|      minimum_k0 = 16;
  169|    356|      break;
  170|  4.52k|    case 32000:
  ------------------
  |  Branch (170:5): [True: 4.52k, False: 9.33k]
  ------------------
  171|  4.52k|      minimum_k0 = 16;
  172|  4.52k|      break;
  173|  3.68k|    case 44100:
  ------------------
  |  Branch (173:5): [True: 3.68k, False: 10.1k]
  ------------------
  174|  3.68k|      minimum_k0 = 12;
  175|  3.68k|      break;
  176|  4.44k|    case 48000:
  ------------------
  |  Branch (176:5): [True: 4.44k, False: 9.41k]
  ------------------
  177|  4.44k|      minimum_k0 = 11;
  178|  4.44k|      break;
  179|    273|    case 64000:
  ------------------
  |  Branch (179:5): [True: 273, False: 13.5k]
  ------------------
  180|    273|      minimum_k0 = 10;
  181|    273|      break;
  182|      0|    case 88200:
  ------------------
  |  Branch (182:5): [True: 0, False: 13.8k]
  ------------------
  183|      0|      minimum_k0 = 7;
  184|      0|      break;
  185|      0|    case 96000:
  ------------------
  |  Branch (185:5): [True: 0, False: 13.8k]
  ------------------
  186|      0|      minimum_k0 = 7;
  187|      0|      break;
  188|    244|    default:
  ------------------
  |  Branch (188:5): [True: 244, False: 13.6k]
  ------------------
  189|    244|      minimum_k0 = 11; /* illegal fs */
  190|  13.8k|  }
  191|       |
  192|  13.8k|  switch (fs) {
  193|    243|    case 16000: {
  ------------------
  |  Branch (193:5): [True: 243, False: 13.6k]
  ------------------
  194|    243|      return (minimum_k0 + vector_offset_16k[start_freq]);
  195|      0|    } break;
  196|       |
  197|     92|    case 22050: {
  ------------------
  |  Branch (197:5): [True: 92, False: 13.7k]
  ------------------
  198|     92|      return (minimum_k0 + vector_offset_22k[start_freq]);
  199|      0|    } break;
  200|       |
  201|    356|    case 24000: {
  ------------------
  |  Branch (201:5): [True: 356, False: 13.5k]
  ------------------
  202|    356|      return (minimum_k0 + vector_offset_24k[start_freq]);
  203|      0|    } break;
  204|       |
  205|  4.52k|    case 32000: {
  ------------------
  |  Branch (205:5): [True: 4.52k, False: 9.33k]
  ------------------
  206|  4.52k|      return (minimum_k0 + vector_offset_32k[start_freq]);
  207|      0|    } break;
  208|       |
  209|  3.68k|    case 44100:
  ------------------
  |  Branch (209:5): [True: 3.68k, False: 10.1k]
  ------------------
  210|  8.13k|    case 48000:
  ------------------
  |  Branch (210:5): [True: 4.44k, False: 9.41k]
  ------------------
  211|  8.40k|    case 64000: {
  ------------------
  |  Branch (211:5): [True: 273, False: 13.5k]
  ------------------
  212|  8.40k|      return (minimum_k0 + vector_offset_44_48_64[start_freq]);
  213|  8.13k|    } break;
  214|       |
  215|      0|    case 88200:
  ------------------
  |  Branch (215:5): [True: 0, False: 13.8k]
  ------------------
  216|      0|    case 96000: {
  ------------------
  |  Branch (216:5): [True: 0, False: 13.8k]
  ------------------
  217|      0|      return (minimum_k0 + vector_offset_88_96[start_freq]);
  218|      0|    } break;
  219|       |
  220|    244|    default: {
  ------------------
  |  Branch (220:5): [True: 244, False: 13.6k]
  ------------------
  221|    244|      return (minimum_k0 + vector_offset_def[start_freq]);
  222|      0|    }
  223|  13.8k|  }
  224|  13.8k|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_start_freq_4_1:
   40|    565|static WORD32 ixheaace_get_start_freq_4_1(WORD32 fs, WORD32 start_freq) {
   41|    565|  WORD32 minimum_k0;
   42|    565|  const WORD32 *ptr_start_offset;
   43|       |
   44|    565|  switch (fs) {
   45|     89|    case 16000:
  ------------------
  |  Branch (45:5): [True: 89, False: 476]
  ------------------
   46|     89|      minimum_k0 = 12;
   47|     89|      break;
   48|     53|    case 22050:
  ------------------
  |  Branch (48:5): [True: 53, False: 512]
  ------------------
   49|     53|      minimum_k0 = 9;
   50|     53|      break;
   51|    265|    case 24000:
  ------------------
  |  Branch (51:5): [True: 265, False: 300]
  ------------------
   52|    265|      minimum_k0 = 8;
   53|    265|      break;
   54|    152|    case 32000:
  ------------------
  |  Branch (54:5): [True: 152, False: 413]
  ------------------
   55|    152|      minimum_k0 = 8;
   56|    152|      break;
   57|      2|    case 44100:
  ------------------
  |  Branch (57:5): [True: 2, False: 563]
  ------------------
   58|      2|      minimum_k0 = 6;
   59|      2|      break;
   60|      1|    case 48000:
  ------------------
  |  Branch (60:5): [True: 1, False: 564]
  ------------------
   61|      1|      minimum_k0 = 5;
   62|      1|      break;
   63|      3|    default:
  ------------------
  |  Branch (63:5): [True: 3, False: 562]
  ------------------
   64|      3|      minimum_k0 = 5; /* illegal fs */
   65|    565|  }
   66|       |
   67|    565|  switch (fs) {
   68|     89|    case 16000: {
  ------------------
  |  Branch (68:5): [True: 89, False: 476]
  ------------------
   69|     89|      ptr_start_offset = &ixheaace_start_freq_16k_4_1[0];
   70|     89|    } break;
   71|       |
   72|     53|    case 22050: {
  ------------------
  |  Branch (72:5): [True: 53, False: 512]
  ------------------
   73|     53|      ptr_start_offset = &ixheaace_start_freq_22k_4_1[0];
   74|     53|    } break;
   75|       |
   76|    265|    case 24000: {
  ------------------
  |  Branch (76:5): [True: 265, False: 300]
  ------------------
   77|    265|      ptr_start_offset = &ixheaace_start_freq_24k_4_1[0];
   78|    265|    } break;
   79|       |
   80|    152|    case 32000: {
  ------------------
  |  Branch (80:5): [True: 152, False: 413]
  ------------------
   81|    152|      ptr_start_offset = &ixheaace_start_freq_32k_4_1[0];
   82|    152|    } break;
   83|       |
   84|      2|    case 44100:
  ------------------
  |  Branch (84:5): [True: 2, False: 563]
  ------------------
   85|      3|    case 48000:
  ------------------
  |  Branch (85:5): [True: 1, False: 564]
  ------------------
   86|      3|    case 64000: {
  ------------------
  |  Branch (86:5): [True: 0, False: 565]
  ------------------
   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: 565]
  ------------------
   91|      0|    case 96000: {
  ------------------
  |  Branch (91:5): [True: 0, False: 565]
  ------------------
   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: 562]
  ------------------
   96|      3|      ptr_start_offset = &ixheaace_start_freq_dflt_4_1[0];
   97|      3|    }
   98|    565|  }
   99|    565|  return (minimum_k0 + ptr_start_offset[start_freq]);
  100|    565|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_stop_freq_4_1:
  102|    565|static WORD32 ixheaace_get_stop_freq_4_1(WORD32 fs, WORD32 stop_freq) {
  103|    565|  WORD32 result, i;
  104|    565|  WORD32 *v_stop_freq = 0;
  105|    565|  WORD32 k1_min;
  106|    565|  WORD32 v_dstop[13];
  107|       |
  108|       |  /* counting previous operations */
  109|    565|  switch (fs) {
  110|     89|    case 16000:
  ------------------
  |  Branch (110:5): [True: 89, False: 476]
  ------------------
  111|     89|      k1_min = 24;
  112|     89|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_16k_4_1[0];
  113|     89|      break;
  114|     53|    case 22050:
  ------------------
  |  Branch (114:5): [True: 53, False: 512]
  ------------------
  115|     53|      k1_min = 17;
  116|     53|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_22k_4_1[0];
  117|     53|      break;
  118|    265|    case 24000:
  ------------------
  |  Branch (118:5): [True: 265, False: 300]
  ------------------
  119|    265|      k1_min = 16;
  120|    265|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_24k_4_1[0];
  121|    265|      break;
  122|    152|    case 32000:
  ------------------
  |  Branch (122:5): [True: 152, False: 413]
  ------------------
  123|    152|      k1_min = 16;
  124|    152|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_32k_4_1[0];
  125|    152|      break;
  126|       |
  127|      2|    case 44100:
  ------------------
  |  Branch (127:5): [True: 2, False: 563]
  ------------------
  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: 564]
  ------------------
  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: 562]
  ------------------
  138|      3|      v_stop_freq = (WORD32 *)&ixheaace_stop_freq_32k_4_1[0];
  139|      3|      k1_min = 11; /* illegal fs  */
  140|    565|  }
  141|       |
  142|  7.91k|  for (i = 0; i <= 12; i++) {
  ------------------
  |  Branch (142:15): [True: 7.34k, False: 565]
  ------------------
  143|  7.34k|    v_dstop[i] = v_stop_freq[i + 1] - v_stop_freq[i];
  144|  7.34k|  }
  145|       |
  146|    565|  ixheaace_shellsort_int(v_dstop, 13);
  147|       |
  148|    565|  result = k1_min;
  149|       |
  150|  6.78k|  for (i = 0; i < stop_freq; i++) {
  ------------------
  |  Branch (150:15): [True: 6.21k, False: 565]
  ------------------
  151|  6.21k|    result = result + v_dstop[i];
  152|  6.21k|  }
  153|       |
  154|    565|  return result;
  155|    565|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_usac_stop_freq:
  284|  2.30k|{
  285|  2.30k|  WORD32 result, i;
  286|  2.30k|  WORD32 *v_stop_freq = 0;
  287|  2.30k|  WORD32 k1_min;
  288|  2.30k|  WORD32 v_dstop[13];
  289|       |
  290|  2.30k|  switch (fs)
  291|  2.30k|  {
  292|     95|  case 16000:
  ------------------
  |  Branch (292:3): [True: 95, False: 2.20k]
  ------------------
  293|     95|    k1_min = ixheaace_usac_stop_freq_16k[0];
  294|     95|    v_stop_freq = (WORD32 *)&ixheaace_usac_stop_freq_16k[0];
  295|     95|    break;
  296|     35|  case 22050:
  ------------------
  |  Branch (296:3): [True: 35, False: 2.26k]
  ------------------
  297|     35|    k1_min = ixheaace_usac_stop_freq_22k[0];
  298|     35|    v_stop_freq = (WORD32 *)&ixheaace_usac_stop_freq_22k[0];
  299|     35|    break;
  300|    144|  case 24000:
  ------------------
  |  Branch (300:3): [True: 144, False: 2.15k]
  ------------------
  301|    144|    k1_min = ixheaace_usac_stop_freq_24k[0];
  302|    144|    v_stop_freq = (WORD32 *)&ixheaace_usac_stop_freq_24k[0];
  303|    144|    break;
  304|    738|  case 32000:
  ------------------
  |  Branch (304:3): [True: 738, False: 1.56k]
  ------------------
  305|    738|    k1_min = 32;
  306|    738|    v_stop_freq = (WORD32 *)vector_stop_freq_32;
  307|    738|    break;
  308|       |
  309|    496|  case 44100:
  ------------------
  |  Branch (309:3): [True: 496, False: 1.80k]
  ------------------
  310|    496|    k1_min = 23;
  311|    496|    v_stop_freq = (WORD32 *)vector_stop_freq_44;
  312|    496|    break;
  313|       |
  314|    696|  case 48000:
  ------------------
  |  Branch (314:3): [True: 696, False: 1.60k]
  ------------------
  315|    696|    k1_min = 21;
  316|    696|    v_stop_freq = (WORD32 *)vector_stop_freq_48;
  317|    696|    break;
  318|       |
  319|     96|  default:
  ------------------
  |  Branch (319:3): [True: 96, False: 2.20k]
  ------------------
  320|     96|    v_stop_freq = (WORD32 *)vector_stop_freq_32;
  321|     96|    k1_min = 21; /* illegal fs  */
  322|  2.30k|  }
  323|       |
  324|  32.2k|  for (i = 0; i <= 12; i++)
  ------------------
  |  Branch (324:15): [True: 29.9k, False: 2.30k]
  ------------------
  325|  29.9k|  {
  326|  29.9k|    v_dstop[i] = v_stop_freq[i + 1] - v_stop_freq[i];
  327|  29.9k|  }
  328|       |
  329|  2.30k|  ixheaace_shellsort_int(v_dstop, 13);
  330|       |
  331|  2.30k|  result = k1_min;
  332|       |
  333|  27.2k|  for (i = 0; i < stop_freq; i++)
  ------------------
  |  Branch (333:15): [True: 24.9k, False: 2.30k]
  ------------------
  334|  24.9k|  {
  335|  24.9k|    result = result + v_dstop[i];
  336|  24.9k|  }
  337|       |
  338|  2.30k|  return result;
  339|  2.30k|}
ixheaace_sbr_freq_scaling.c:ixheaace_get_stop_freq:
  226|  2.99k|static WORD32 ixheaace_get_stop_freq(WORD32 fs, WORD32 stop_freq) {
  227|  2.99k|  WORD32 result, i;
  228|  2.99k|  WORD32 *v_stop_freq = 0;
  229|  2.99k|  WORD32 k1_min;
  230|  2.99k|  WORD32 v_dstop[13];
  231|       |
  232|  2.99k|  switch (fs) {
  233|      0|    case 16000:
  ------------------
  |  Branch (233:5): [True: 0, False: 2.99k]
  ------------------
  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.99k]
  ------------------
  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.99k]
  ------------------
  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.06k|    case 32000:
  ------------------
  |  Branch (245:5): [True: 1.06k, False: 1.93k]
  ------------------
  246|  1.06k|      k1_min = 32;
  247|       |
  248|  1.06k|      v_stop_freq = (WORD32 *)vector_stop_freq_32;
  249|  1.06k|      break;
  250|       |
  251|    941|    case 44100:
  ------------------
  |  Branch (251:5): [True: 941, False: 2.05k]
  ------------------
  252|    941|      k1_min = 23;
  253|       |
  254|    941|      v_stop_freq = (WORD32 *)vector_stop_freq_44;
  255|    941|      break;
  256|       |
  257|    992|    case 48000:
  ------------------
  |  Branch (257:5): [True: 992, False: 2.00k]
  ------------------
  258|    992|      k1_min = 21;
  259|       |
  260|    992|      v_stop_freq = (WORD32 *)vector_stop_freq_48;
  261|    992|      break;
  262|       |
  263|      0|    default:
  ------------------
  |  Branch (263:5): [True: 0, False: 2.99k]
  ------------------
  264|      0|      v_stop_freq = (WORD32 *)vector_stop_freq_32;
  265|      0|      k1_min = 21; /* illegal fs  */
  266|  2.99k|  }
  267|       |
  268|  41.9k|  for (i = 0; i <= 12; i++) {
  ------------------
  |  Branch (268:15): [True: 38.9k, False: 2.99k]
  ------------------
  269|  38.9k|    v_dstop[i] = v_stop_freq[i + 1] - v_stop_freq[i];
  270|  38.9k|  }
  271|       |
  272|  2.99k|  ixheaace_shellsort_int(v_dstop, 13);
  273|       |
  274|  2.99k|  result = k1_min;
  275|       |
  276|  25.4k|  for (i = 0; i < stop_freq; i++) {
  ------------------
  |  Branch (276:15): [True: 22.4k, False: 2.99k]
  ------------------
  277|  22.4k|    result = result + v_dstop[i];
  278|  22.4k|  }
  279|       |
  280|  2.99k|  return result;
  281|  2.99k|}
ixheaace_sbr_freq_scaling.c:ixheaace_number_of_bands:
  357|  9.98k|                                       FLOAT32 warp_fac) {
  358|  9.98k|  WORD32 result = 0;
  359|  9.98k|  result = (WORD32)(b_p_o * log((FLOAT32)(stop) / start) / (2.0 * log(2.0) * warp_fac) + 0.5);
  360|  9.98k|  result <<= 1;
  361|  9.98k|  return result;
  362|  9.98k|}
ixheaace_sbr_freq_scaling.c:ixheaace_calc_bands:
  364|  9.97k|static VOID ixheaace_calc_bands(WORD32 *ptr_diff, WORD32 start, WORD32 stop, WORD32 num_bands) {
  365|  9.97k|  WORD32 i;
  366|  9.97k|  WORD32 previous;
  367|  9.97k|  WORD32 current;
  368|  9.97k|  previous = start;
  369|  84.6k|  for (i = 1; i <= num_bands; i++) {
  ------------------
  |  Branch (369:15): [True: 74.6k, False: 9.97k]
  ------------------
  370|  74.6k|    current = (WORD32)((start * pow((FLOAT32)stop / start, (FLOAT32)i / num_bands)) + 0.5f);
  371|  74.6k|    ptr_diff[i - 1] = current - previous;
  372|  74.6k|    previous = current;
  373|  74.6k|  }
  374|  9.97k|}
ixheaace_sbr_freq_scaling.c:ixheaace_cum_sum:
  391|  9.97k|                             UWORD8 *ptr_start_adress) {
  392|  9.97k|  WORD32 i;
  393|       |
  394|  9.97k|  ptr_start_adress[0] = (UWORD8)start_value;
  395|       |
  396|  84.5k|  for (i = 1; i <= length; i++) {
  ------------------
  |  Branch (396:15): [True: 74.5k, False: 9.97k]
  ------------------
  397|  74.5k|    ptr_start_adress[i] = ptr_start_adress[i - 1] + (UWORD8)ptr_diff[i - 1];
  398|  74.5k|  }
  399|  9.97k|}
ixheaace_sbr_freq_scaling.c:ixheaace_modify_bands:
  376|    261|static VOID ixheaace_modify_bands(WORD32 max_band_previous, WORD32 *ptr_diff, WORD32 length) {
  377|    261|  WORD32 change = max_band_previous - ptr_diff[0];
  378|       |
  379|    261|  if (change > (ptr_diff[length - 1] - ptr_diff[0]) / 2) {
  ------------------
  |  Branch (379:7): [True: 261, False: 0]
  ------------------
  380|    261|    change = (ptr_diff[length - 1] - ptr_diff[0]) / 2;
  381|    261|  }
  382|       |
  383|    261|  ptr_diff[0] += change;
  384|       |
  385|    261|  ptr_diff[length - 1] -= change;
  386|       |
  387|    261|  ixheaace_shellsort_int(ptr_diff, length);
  388|    261|}

ixheaace_esbr_hbe_data_init:
  254|  1.99k|                                 WORD32 *ptr_total_persistant) {
  255|  1.99k|  WORD32 used_persistent = 0;
  256|       |
  257|  1.99k|  if (pstr_esbr_hbe_txposer) {
  ------------------
  |  Branch (257:7): [True: 1.99k, False: 0]
  ------------------
  258|  1.99k|    memset(pstr_esbr_hbe_txposer, 0, sizeof(ixheaace_str_esbr_hbe_txposer));
  259|       |
  260|  1.99k|    pstr_esbr_hbe_txposer->core_frame_length = num_aac_samples;
  261|       |
  262|  1.99k|    pstr_esbr_hbe_txposer->no_bins = num_out_samples / IXHEAACE_NUM_QMF_SYNTH_CHANNELS;
  ------------------
  |  |   33|  1.99k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  ------------------
  263|       |
  264|  1.99k|    pstr_esbr_hbe_txposer->hbe_qmf_in_len = pstr_esbr_hbe_txposer->no_bins;
  265|       |
  266|  1.99k|    pstr_esbr_hbe_txposer->hbe_qmf_out_len = 2 * pstr_esbr_hbe_txposer->hbe_qmf_in_len;
  267|       |
  268|  1.99k|    pstr_esbr_hbe_txposer->ptr_input_buf = (FLOAT32 *)ptr_persistent_hbe_mem;
  269|  1.99k|    used_persistent += (num_aac_samples + IXHEAACE_NUM_QMF_SYNTH_CHANNELS) *
  ------------------
  |  |   33|  1.99k|#define IXHEAACE_NUM_QMF_SYNTH_CHANNELS (64)
  ------------------
  270|  1.99k|                       sizeof(pstr_esbr_hbe_txposer->ptr_input_buf[0]);
  271|       |
  272|  1.99k|    pstr_esbr_hbe_txposer->upsamp_4_flag = samp_fac_4_flag;
  273|       |
  274|  1.99k|    if (pstr_esbr_hbe_txposer) {
  ------------------
  |  Branch (274:9): [True: 1.99k, False: 0]
  ------------------
  275|  1.99k|      pstr_esbr_hbe_txposer->fft_size[0] = num_aac_samples;
  276|  1.99k|      pstr_esbr_hbe_txposer->fft_size[1] = (int)(IXHEAACE_FD_OVERSAMPLING_FAC * num_aac_samples);
  ------------------
  |  |   39|  1.99k|#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|  1.99k|      pstr_esbr_hbe_txposer->ptr_spectrum = &pstr_esbr_hbe_txposer->spectrum_buf[0];
  294|  1.99k|      pstr_esbr_hbe_txposer->ptr_spectrum_tx = &pstr_esbr_hbe_txposer->spectrum_transposed_buf[0];
  295|  1.99k|      pstr_esbr_hbe_txposer->ptr_mag = &pstr_esbr_hbe_txposer->mag_buf[0];
  296|  1.99k|      pstr_esbr_hbe_txposer->ptr_phase = &pstr_esbr_hbe_txposer->phase_buf[0];
  297|  1.99k|      pstr_esbr_hbe_txposer->ptr_output_buf = &pstr_esbr_hbe_txposer->output_buf[0];
  298|  1.99k|    }
  299|  1.99k|  }
  300|  1.99k|  *ptr_total_persistant = used_persistent;
  301|  1.99k|}
ixheaace_dft_hbe_data_reinit:
  303|  1.99k|IA_ERRORCODE ixheaace_dft_hbe_data_reinit(ixheaace_str_esbr_hbe_txposer *pstr_hbe_txposer) {
  304|  1.99k|  WORD32 sfb;
  305|  1.99k|  WORD32 patch;
  306|  1.99k|  WORD32 i;
  307|  1.99k|  WORD32 temp_start;
  308|  1.99k|  FLOAT32 fb_ratio;
  309|  1.99k|  WORD32 stop_patch;
  310|  1.99k|  WORD32 in_hop_size_divisor = 8;
  311|  1.99k|  static const WORD32 trans_samp[2] = {12, 18}; /* FD transition samples */
  312|  1.99k|  WORD32 err = IA_NO_ERROR;
  ------------------
  |  |   23|  1.99k|#define IA_NO_ERROR 0x00000000
  ------------------
  313|       |
  314|  1.99k|  pstr_hbe_txposer->start_band = pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][0];
  ------------------
  |  |   69|  1.99k|#define IXHEAACE_LOW (0)
  ------------------
  315|  1.99k|  pstr_hbe_txposer->end_band =
  316|  1.99k|      pstr_hbe_txposer
  317|  1.99k|          ->ptr_freq_band_tab[IXHEAACE_LOW][pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]];
  ------------------
  |  |   69|  1.99k|#define IXHEAACE_LOW (0)
  ------------------
                        ->ptr_freq_band_tab[IXHEAACE_LOW][pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]];
  ------------------
  |  |   69|  1.99k|#define IXHEAACE_LOW (0)
  ------------------
  318|  1.99k|  pstr_hbe_txposer->esbr_hq = 1;
  319|       |
  320|  1.99k|  pstr_hbe_txposer->synth_size = 4 * ((pstr_hbe_txposer->start_band + 4) / 8 + 1);
  321|  1.99k|  pstr_hbe_txposer->k_start = ixheaac_start_subband2kL_tbl[pstr_hbe_txposer->start_band];
  322|       |
  323|  1.99k|  fb_ratio = pstr_hbe_txposer->synth_size / 32.0f;
  324|       |
  325|  1.99k|  pstr_hbe_txposer->ana_fft_size[0] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[0]);
  326|  1.99k|  pstr_hbe_txposer->ana_fft_size[1] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[1]);
  327|       |
  328|  1.99k|  pstr_hbe_txposer->in_hop_size = pstr_hbe_txposer->ana_fft_size[0] / in_hop_size_divisor;
  329|       |
  330|  1.99k|  pstr_hbe_txposer->ptr_syn_win = (FLOAT32 *)&pstr_hbe_txposer->synthesis_window_buf[0];
  331|  1.99k|  pstr_hbe_txposer->ptr_ana_win = (FLOAT32 *)&pstr_hbe_txposer->analysis_window_buf[0];
  332|       |
  333|  1.99k|  err = ixheaace_calc_anal_synth_window(pstr_hbe_txposer->ana_fft_size[0],
  334|  1.99k|                                        pstr_hbe_txposer->ptr_ana_win);
  335|  1.99k|  if (err) {
  ------------------
  |  Branch (335:7): [True: 0, False: 1.99k]
  ------------------
  336|      0|    return err;
  337|      0|  }
  338|       |
  339|  1.99k|  memset(pstr_hbe_txposer->synth_buf, 0, sizeof(pstr_hbe_txposer->synth_buf));
  340|       |
  341|  1.99k|  pstr_hbe_txposer->ptr_syn_win_coeff = ixheaace_map_prot_filter(pstr_hbe_txposer->synth_size);
  342|       |
  343|  1.99k|  temp_start = 2 * ((pstr_hbe_txposer->start_band - 1) / 2); /* Largest start band */
  344|  1.99k|  pstr_hbe_txposer->analy_size =
  345|  1.99k|      4 * ((min(64, pstr_hbe_txposer->end_band + 1) - temp_start - 1) / 4 +
  ------------------
  |  |   75|  1.99k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 121, False: 1.87k]
  |  |  ------------------
  ------------------
  346|  1.99k|           1); /* Quantize in steps of 4 */
  347|  1.99k|  pstr_hbe_txposer->a_start = temp_start - max(0, temp_start + pstr_hbe_txposer->analy_size - 64);
  ------------------
  |  |   74|  1.99k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (74:20): [True: 1.87k, False: 121]
  |  |  ------------------
  ------------------
  348|       |
  349|  1.99k|  fb_ratio = pstr_hbe_txposer->analy_size / 64.0f;
  350|       |
  351|  1.99k|  pstr_hbe_txposer->syn_fft_size[0] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[0]);
  352|  1.99k|  pstr_hbe_txposer->syn_fft_size[1] = (WORD32)(fb_ratio * pstr_hbe_txposer->fft_size[1]);
  353|       |
  354|  1.99k|  pstr_hbe_txposer->out_hop_size = 2 * pstr_hbe_txposer->syn_fft_size[0] / in_hop_size_divisor;
  355|       |
  356|  1.99k|  err = ixheaace_calc_anal_synth_window(pstr_hbe_txposer->syn_fft_size[0],
  357|  1.99k|                                        pstr_hbe_txposer->ptr_syn_win);
  358|  1.99k|  if (err) {
  ------------------
  |  Branch (358:7): [True: 0, False: 1.99k]
  ------------------
  359|      0|    return err;
  360|      0|  }
  361|       |
  362|  1.99k|  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|  1.99k|  memset(&pstr_hbe_txposer->x_over_qmf[0], 0, sizeof(pstr_hbe_txposer->x_over_qmf));
  367|       |
  368|  9.96k|  for (i = 0; i < IXHEAACE_MAX_STRETCH; i++) {
  ------------------
  |  |   27|  9.96k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (368:15): [True: 7.96k, False: 1.99k]
  ------------------
  369|  7.96k|    memset(&pstr_hbe_txposer->x_over_bin[i][0], 0,
  370|  7.96k|           2 * sizeof(pstr_hbe_txposer->x_over_bin[i][0]));
  371|  7.96k|  }
  372|  1.99k|  sfb = 0;
  373|  1.99k|  stop_patch = IXHEAACE_MAX_STRETCH;
  ------------------
  |  |   27|  1.99k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  374|       |
  375|  1.99k|  switch (pstr_hbe_txposer->synth_size) {
  376|      0|    case 4:
  ------------------
  |  Branch (376:5): [True: 0, False: 1.99k]
  ------------------
  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: 1.99k]
  ------------------
  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|    836|    case 12:
  ------------------
  |  Branch (384:5): [True: 836, False: 1.15k]
  ------------------
  385|    836|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_12;
  386|    836|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p3;
  387|    836|      break;
  388|    837|    case 16:
  ------------------
  |  Branch (388:5): [True: 837, False: 1.15k]
  ------------------
  389|    837|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_16;
  390|    837|      pstr_hbe_txposer->ixheaace_real_synth_fft = &ixheaac_real_synth_fft_p2;
  391|    837|      break;
  392|    319|    case 20:
  ------------------
  |  Branch (392:5): [True: 319, False: 1.67k]
  ------------------
  393|    319|      pstr_hbe_txposer->ptr_syn_cos_tab = (FLOAT32 *)ixheaac_synth_cos_table_kl_20;
  394|    319|      break;
  395|      0|    case 28:
  ------------------
  |  Branch (395:5): [True: 0, False: 1.99k]
  ------------------
  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: 1.99k]
  ------------------
  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|  1.99k|  }
  402|       |
  403|  1.99k|  {
  404|  1.99k|    WORD32 l, k, L = pstr_hbe_txposer->analy_size;
  405|  73.9k|    for (k = 0; k < L; k++) {
  ------------------
  |  Branch (405:17): [True: 71.9k, False: 1.99k]
  ------------------
  406|  5.44M|      for (l = 0; l < 2 * L; l++) {
  ------------------
  |  Branch (406:19): [True: 5.37M, False: 71.9k]
  ------------------
  407|  5.37M|        pstr_hbe_txposer->str_dft_hbe_anal_coeff.real[k][l] =
  408|  5.37M|            (FLOAT32)cos(PI / (2 * L) *
  ------------------
  |  |   33|  5.37M|#define PI 3.14159265358979323846
  ------------------
  409|  5.37M|                         ((k + 0.5) * (2 * l - L / 64.0) - L / 64.0 * pstr_hbe_txposer->a_start));
  410|  5.37M|        pstr_hbe_txposer->str_dft_hbe_anal_coeff.imag[k][l] =
  411|  5.37M|            (FLOAT32)sin(PI / (2 * L) *
  ------------------
  |  |   33|  5.37M|#define PI 3.14159265358979323846
  ------------------
  412|  5.37M|                         ((k + 0.5) * (2 * l - L / 64.0) - L / 64.0 * pstr_hbe_txposer->a_start));
  413|  5.37M|      }
  414|  71.9k|    }
  415|  1.99k|  }
  416|       |
  417|  6.37k|  for (patch = 1; patch <= stop_patch; patch++) {
  ------------------
  |  Branch (417:19): [True: 6.37k, False: 0]
  ------------------
  418|  22.3k|    while (sfb <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW] &&
  ------------------
  |  |   69|  22.3k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (418:12): [True: 20.3k, False: 1.99k]
  ------------------
  419|  20.3k|           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb] <=
  ------------------
  |  |   69|  20.3k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (419:12): [True: 15.9k, False: 4.37k]
  ------------------
  420|  20.3k|               patch * pstr_hbe_txposer->start_band)
  421|  15.9k|      sfb++;
  422|  6.37k|    if (sfb <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_LOW]) {
  ------------------
  |  |   69|  6.37k|#define IXHEAACE_LOW (0)
  ------------------
  |  Branch (422:9): [True: 4.37k, False: 1.99k]
  ------------------
  423|       |      /* If the distance is larger than three QMF bands - try aligning to high resolution
  424|       |       * frequency bands instead. */
  425|  4.37k|      if ((patch * pstr_hbe_txposer->start_band -
  ------------------
  |  Branch (425:11): [True: 3.87k, False: 508]
  ------------------
  426|  4.37k|           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1]) <= 3) {
  ------------------
  |  |   69|  4.37k|#define IXHEAACE_LOW (0)
  ------------------
  427|  3.87k|        pstr_hbe_txposer->x_over_qmf[patch - 1] =
  428|  3.87k|            pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1];
  ------------------
  |  |   69|  3.87k|#define IXHEAACE_LOW (0)
  ------------------
  429|  3.87k|        if (patch <= IXHEAACE_MAX_STRETCH) {
  ------------------
  |  |   27|  3.87k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (429:13): [True: 3.87k, False: 0]
  ------------------
  430|  3.87k|          pstr_hbe_txposer->x_over_bin[patch - 1][0] =
  431|  3.87k|              (WORD32)(pstr_hbe_txposer->fft_size[0] *
  432|  3.87k|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1] / 128 +
  ------------------
  |  |   69|  3.87k|#define IXHEAACE_LOW (0)
  ------------------
  433|  3.87k|                       0.5);
  434|  3.87k|          pstr_hbe_txposer->x_over_bin[patch - 1][1] =
  435|  3.87k|              (WORD32)(pstr_hbe_txposer->fft_size[1] *
  436|  3.87k|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_LOW][sfb - 1] / 128 +
  ------------------
  |  |   69|  3.87k|#define IXHEAACE_LOW (0)
  ------------------
  437|  3.87k|                       0.5);
  438|  3.87k|        }
  439|  3.87k|      } else {
  440|    508|        WORD32 sfb_idx = 0;
  441|  7.56k|        while (sfb_idx <= pstr_hbe_txposer->num_sf_bands[IXHEAACE_HIGH] &&
  ------------------
  |  |   70|  7.56k|#define IXHEAACE_HIGH (1)
  ------------------
  |  Branch (441:16): [True: 7.56k, False: 0]
  ------------------
  442|  7.56k|               pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx] <=
  ------------------
  |  |   70|  7.56k|#define IXHEAACE_HIGH (1)
  ------------------
  |  Branch (442:16): [True: 7.05k, False: 508]
  ------------------
  443|  7.56k|                   patch * pstr_hbe_txposer->start_band)
  444|  7.05k|          sfb_idx++;
  445|    508|        pstr_hbe_txposer->x_over_qmf[patch - 1] =
  446|    508|            pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1];
  ------------------
  |  |   70|    508|#define IXHEAACE_HIGH (1)
  ------------------
  447|    508|        if (patch <= IXHEAACE_MAX_STRETCH) {
  ------------------
  |  |   27|    508|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (447:13): [True: 508, False: 0]
  ------------------
  448|    508|          pstr_hbe_txposer->x_over_bin[patch - 1][0] =
  449|    508|              (WORD32)(pstr_hbe_txposer->fft_size[0] *
  450|    508|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1] / 128 +
  ------------------
  |  |   70|    508|#define IXHEAACE_HIGH (1)
  ------------------
  451|    508|                       0.5);
  452|    508|          pstr_hbe_txposer->x_over_bin[patch - 1][1] =
  453|    508|              (WORD32)(pstr_hbe_txposer->fft_size[1] *
  454|    508|                           pstr_hbe_txposer->ptr_freq_band_tab[IXHEAACE_HIGH][sfb_idx - 1] / 128 +
  ------------------
  |  |   70|    508|#define IXHEAACE_HIGH (1)
  ------------------
  455|    508|                       0.5);
  456|    508|        }
  457|    508|      }
  458|  4.37k|    } else {
  459|  1.99k|      pstr_hbe_txposer->x_over_qmf[patch - 1] = pstr_hbe_txposer->end_band;
  460|  1.99k|      if (patch <= IXHEAACE_MAX_STRETCH) {
  ------------------
  |  |   27|  1.99k|#define IXHEAACE_MAX_STRETCH (4)
  ------------------
  |  Branch (460:11): [True: 1.99k, False: 0]
  ------------------
  461|  1.99k|        pstr_hbe_txposer->x_over_bin[patch - 1][0] =
  462|  1.99k|            (WORD32)(pstr_hbe_txposer->fft_size[0] * pstr_hbe_txposer->end_band / 128 + 0.5);
  463|  1.99k|        pstr_hbe_txposer->x_over_bin[patch - 1][1] =
  464|  1.99k|            (WORD32)(pstr_hbe_txposer->fft_size[1] * pstr_hbe_txposer->end_band / 128 + 0.5);
  465|  1.99k|      }
  466|  1.99k|      pstr_hbe_txposer->max_stretch = min(patch, IXHEAACE_MAX_STRETCH);
  ------------------
  |  |   75|  1.99k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 1.42k, False: 563]
  |  |  ------------------
  ------------------
  467|  1.99k|      break;
  468|  1.99k|    }
  469|  6.37k|  }
  470|       |
  471|       |  /* calculation of frequency domain windows */
  472|  6.37k|  for (patch = 0; patch < pstr_hbe_txposer->max_stretch - 1; patch++) {
  ------------------
  |  Branch (472:19): [True: 4.37k, False: 1.99k]
  ------------------
  473|  13.1k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (473:17): [True: 8.75k, False: 4.37k]
  ------------------
  474|  8.75k|      ixheaace_create_dft_hbe_window(pstr_hbe_txposer->fd_win_buf[patch][i],
  475|  8.75k|                                     pstr_hbe_txposer->x_over_bin[patch][i],
  476|  8.75k|                                     pstr_hbe_txposer->x_over_bin[patch + 1][i], trans_samp[i],
  477|  8.75k|                                     pstr_hbe_txposer->fft_size[i]);
  478|  8.75k|    }
  479|  4.37k|  }
  480|  1.99k|  return err;
  481|  1.99k|}
ixheaace_dft_hbe_fft_memmove:
  491|   315k|VOID ixheaace_dft_hbe_fft_memmove(FLOAT32 *ptr_spectrum, WORD32 size) {
  492|   315k|  WORD32 n = 0;
  493|       |
  494|  75.6M|  while (n < size / 2) {
  ------------------
  |  Branch (494:10): [True: 75.2M, False: 315k]
  ------------------
  495|  75.2M|    FLOAT32 tmp = ptr_spectrum[n];
  496|  75.2M|    ptr_spectrum[n] = ptr_spectrum[n + size / 2];
  497|  75.2M|    ptr_spectrum[n + size / 2] = tmp;
  498|  75.2M|    n++;
  499|  75.2M|  }
  500|   315k|}
ixheaace_karth2polar:
  502|   157k|                          WORD32 fft_size) {
  503|   157k|  WORD32 n;
  504|       |
  505|  35.9M|  for (n = 1; n < fft_size / 2; n++) {
  ------------------
  |  Branch (505:15): [True: 35.8M, False: 157k]
  ------------------
  506|  35.8M|    ptr_phase[n] = (FLOAT32)atan2(ptr_spectrum[2 * n + 1], ptr_spectrum[2 * n]);
  507|  35.8M|    ptr_mag[n] = (FLOAT32)sqrt(ptr_spectrum[2 * n] * ptr_spectrum[2 * n] +
  508|  35.8M|                               ptr_spectrum[2 * n + 1] * ptr_spectrum[2 * n + 1]);
  509|  35.8M|  }
  510|       |
  511|   157k|  if (ptr_spectrum[0] < 0) {
  ------------------
  |  Branch (511:7): [True: 0, False: 157k]
  ------------------
  512|      0|    ptr_phase[0] = (FLOAT32)acos(-1);
  513|      0|    ptr_mag[0] = -ptr_spectrum[0];
  514|   157k|  } else {
  515|   157k|    ptr_phase[0] = 0;
  516|   157k|    ptr_mag[0] = ptr_spectrum[0];
  517|   157k|  }
  518|       |
  519|   157k|  if (ptr_spectrum[1] < 0) {
  ------------------
  |  Branch (519:7): [True: 0, False: 157k]
  ------------------
  520|      0|    ptr_phase[fft_size / 2] = (FLOAT32)acos(-1);
  521|      0|    ptr_mag[fft_size / 2] = -ptr_spectrum[1];
  522|   157k|  } else {
  523|   157k|    ptr_phase[fft_size / 2] = 0;
  524|   157k|    ptr_mag[fft_size / 2] = ptr_spectrum[1];
  525|   157k|  }
  526|   157k|}
ixheaace_hbe_fft_map:
  567|  27.2k|IA_ERRORCODE ixheaace_hbe_fft_map(ixheaace_str_esbr_hbe_txposer *pstr_hbe_txposer) {
  568|  27.2k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  569|  27.2k|  WORD32 ana_fft_size = pstr_hbe_txposer->ana_fft_size[oversampling_flag];
  570|  27.2k|  WORD32 syn_fft_size = pstr_hbe_txposer->syn_fft_size[oversampling_flag];
  571|       |
  572|  27.2k|  switch (ana_fft_size) {
  573|  3.00k|    case 576:
  ------------------
  |  Branch (573:5): [True: 3.00k, False: 24.2k]
  ------------------
  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|  9.23k|    case 384:
  ------------------
  |  Branch (577:5): [True: 9.23k, False: 18.0k]
  ------------------
  578|  9.23k|      pstr_hbe_txposer->ptr_ana_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_384;
  579|  9.23k|      pstr_hbe_txposer->ixheaace_hbe_anal_fft = &ixheaace_hbe_apply_cfftn_gen;
  580|  9.23k|      break;
  581|  11.5k|    case 512:
  ------------------
  |  Branch (581:5): [True: 11.5k, False: 15.7k]
  ------------------
  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: 27.2k]
  ------------------
  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: 23.7k]
  ------------------
  590|  3.51k|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_MAPPING;
  591|      0|      break;
  592|  27.2k|  }
  593|       |
  594|  23.7k|  switch (syn_fft_size) {
  595|  7.51k|    case 448:
  ------------------
  |  Branch (595:5): [True: 7.51k, False: 16.2k]
  ------------------
  596|  7.51k|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_448;
  597|  7.51k|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_ifft_224;
  598|  7.51k|      break;
  599|  8.98k|    case 512:
  ------------------
  |  Branch (599:5): [True: 8.98k, False: 14.7k]
  ------------------
  600|  8.98k|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_512;
  601|  8.98k|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_cfftn;
  602|  8.98k|      break;
  603|  3.24k|    case 576:
  ------------------
  |  Branch (603:5): [True: 3.24k, False: 20.5k]
  ------------------
  604|  3.24k|      pstr_hbe_txposer->ptr_syn_cos_sin_tab = (FLOAT32 *)ixheaac_sin_cos_576;
  605|  3.24k|      pstr_hbe_txposer->ixheaace_hbe_synth_ifft = &ixheaace_hbe_apply_fft_288;
  606|  3.24k|      break;
  607|      0|    case 768:
  ------------------
  |  Branch (607:5): [True: 0, False: 23.7k]
  ------------------
  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: 23.7k]
  ------------------
  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|  4.01k|    default:
  ------------------
  |  Branch (615:5): [True: 4.01k, False: 19.7k]
  ------------------
  616|  4.01k|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_MAPPING;
  617|      0|      break;
  618|  23.7k|  }
  619|       |
  620|  19.7k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  19.7k|#define IA_NO_ERROR 0x00000000
  ------------------
  621|  23.7k|}
ia_dft_hbe_apply_polar_t2:
  624|   157k|                               WORD32 pitch_in_bins, WORD out_transform_size) {
  625|   157k|  WORD32 tr;
  626|   157k|  WORD32 ti;
  627|   157k|  WORD32 m_tr = 0;
  628|   157k|  WORD32 p, i;
  629|   157k|  FLOAT32 mag_t;
  630|   157k|  FLOAT32 phase_t;
  631|   157k|  FLOAT32 m_val;
  632|   157k|  FLOAT32(*fd_win_buf)[3][3][1536] = &pstr_hbe_txposer->fd_win_buf;
  633|   157k|  FLOAT32 *ptr_phase = pstr_hbe_txposer->ptr_phase;
  634|   157k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  635|   157k|  WORD32 fft_size = pstr_hbe_txposer->fft_size[oversampling_flag];
  636|   157k|  FLOAT32 *ptr_spectrum_tx = pstr_hbe_txposer->ptr_spectrum_tx;
  637|   157k|  FLOAT32 *ptr_mag = pstr_hbe_txposer->ptr_mag;
  638|       |  /* pitch_in_bins is given with the resolution of a 1536 point FFT */
  639|   157k|  FLOAT32 p_flt = fft_size * pitch_in_bins / 1536.0f;
  640|   157k|  p = (WORD32)p_flt;
  641|   157k|  FLOAT32 q_thr = 4.0f;
  642|       |
  643|   157k|  if (T < 2) {
  ------------------
  |  Branch (643:7): [True: 0, False: 157k]
  ------------------
  644|       |    // To avoid invalid access by fd_win_buf
  645|      0|    T = 2;
  646|      0|  }
  647|   157k|  i = 0;
  648|  81.1M|  while (i <= out_transform_size) {
  ------------------
  |  Branch (648:10): [True: 81.0M, False: 157k]
  ------------------
  649|  81.0M|    WORD32 utk = i;
  650|       |
  651|  81.0M|    mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] * ptr_mag[utk];
  652|       |
  653|  81.0M|    phase_t = T * ptr_phase[utk];
  654|       |
  655|  81.0M|    if (phase_t == 0.0) {
  ------------------
  |  Branch (655:9): [True: 81.0M, False: 0]
  ------------------
  656|  81.0M|      ptr_spectrum_tx[2 * i] += mag_t;
  657|  81.0M|    } 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|  81.0M|    if (p > 0) {
  ------------------
  |  Branch (661:9): [True: 67.4M, False: 13.5M]
  ------------------
  662|  67.4M|      m_val = 0;
  663|   134M|      for (tr = 1; tr < T; tr++) {
  ------------------
  |  Branch (663:20): [True: 67.4M, False: 67.4M]
  ------------------
  664|  67.4M|        FLOAT32 temp;
  665|  67.4M|        ti = (WORD32)((2.0f * i - tr * p_flt) / T + 0.5f);
  666|  67.4M|        if ((ti < 0) || (ti + p > fft_size / 2)) continue;
  ------------------
  |  Branch (666:13): [True: 659k, False: 66.8M]
  |  Branch (666:25): [True: 790k, False: 66.0M]
  ------------------
  667|  66.0M|        temp = min(ptr_mag[ti], ptr_mag[ti + p]);
  ------------------
  |  |   75|  66.0M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 66.0M]
  |  |  ------------------
  ------------------
  668|  66.0M|        if (temp > m_val) {
  ------------------
  |  Branch (668:13): [True: 0, False: 66.0M]
  ------------------
  669|      0|          m_val = temp;
  670|      0|          m_tr = tr;
  671|      0|          utk = ti;
  672|      0|        }
  673|  66.0M|      } /* for tr */
  674|       |
  675|  67.4M|      if (m_val > q_thr * ptr_mag[2 * i / T]) {
  ------------------
  |  Branch (675:11): [True: 0, False: 67.4M]
  ------------------
  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|  67.4M|    }
  683|  81.0M|    i++;
  684|  81.0M|  }
  685|   157k|}
ia_dft_hbe_apply_polar_t_3:
  688|   157k|                                WORD32 pitch_in_bins, WORD out_transform_size) {
  689|   157k|  WORD32 tr;
  690|   157k|  WORD32 ti;
  691|   157k|  WORD32 m_tr = 0;
  692|   157k|  WORD32 p, i;
  693|   157k|  FLOAT32 mag_t = 0.0f;
  694|   157k|  FLOAT32 phase_t;
  695|   157k|  FLOAT32 m_val;
  696|   157k|  FLOAT32(*fd_win_buf)[3][3][1536] = &pstr_hbe_txposer->fd_win_buf;
  697|   157k|  FLOAT32 *ptr_phase = pstr_hbe_txposer->ptr_phase;
  698|   157k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  699|   157k|  WORD32 fft_size = pstr_hbe_txposer->fft_size[oversampling_flag];
  700|   157k|  FLOAT32 *ptr_spectrum_tx = pstr_hbe_txposer->ptr_spectrum_tx;
  701|   157k|  FLOAT32 *ptr_mag = pstr_hbe_txposer->ptr_mag;
  702|       |  /* pitch_in_bins is given with the resolution of a 1536 point FFT */
  703|   157k|  FLOAT32 p_flt = fft_size * pitch_in_bins / 1536.0f;
  704|   157k|  p = (WORD32)p_flt;
  705|   157k|  FLOAT32 q_thr = 4.0f;
  706|       |
  707|   157k|  if (T < 3) {
  ------------------
  |  Branch (707:7): [True: 0, False: 157k]
  ------------------
  708|       |    // To avoid invalid access by fd_win_buf
  709|      0|    T = 3;
  710|      0|  }
  711|       |
  712|   157k|  i = 0;
  713|  81.1M|  while (i <= out_transform_size) {
  ------------------
  |  Branch (713:10): [True: 81.0M, False: 157k]
  ------------------
  714|  81.0M|    WORD32 utk = 2 * i / T;
  715|  81.0M|    FLOAT32 ptk = (2.0f * i / T) - utk;
  716|  81.0M|    FLOAT32 k;
  717|       |
  718|  81.0M|    if (i % 3 == 0) {
  ------------------
  |  Branch (718:9): [True: 27.0M, False: 54.0M]
  ------------------
  719|  27.0M|      mag_t = (*fd_win_buf)[T - 2][oversampling_flag][i] * ptr_mag[utk];
  720|  54.0M|    } else if (i % 3 == 1) {
  ------------------
  |  Branch (720:16): [True: 27.0M, False: 27.0M]
  ------------------
  721|  27.0M|      k = (FLOAT32)cbrt(ptr_mag[utk]);
  722|  27.0M|      mag_t =
  723|  27.0M|          (*fd_win_buf)[T - 2][oversampling_flag][i] * k * (FLOAT32)pow(ptr_mag[utk + 1], ptk);
  724|  27.0M|    } else if (i % 3 == 2) {
  ------------------
  |  Branch (724:16): [True: 27.0M, False: 0]
  ------------------
  725|  27.0M|      k = (FLOAT32)cbrt(ptr_mag[utk + 1]);
  726|  27.0M|      mag_t =
  727|  27.0M|          (*fd_win_buf)[T - 2][oversampling_flag][i] * (FLOAT32)pow(ptr_mag[utk], 1.0 - ptk) * k;
  728|  27.0M|    }
  729|       |
  730|  81.0M|    phase_t = T * ((1 - ptk) * ptr_phase[utk] + ptk * ptr_phase[utk + 1]);
  731|       |
  732|  81.0M|    ptr_spectrum_tx[2 * i] += mag_t * (FLOAT32)cos(phase_t);
  733|  81.0M|    ptr_spectrum_tx[2 * i + 1] += mag_t * (FLOAT32)sin(phase_t);
  734|       |
  735|  81.0M|    if (p > 0) {
  ------------------
  |  Branch (735:9): [True: 67.4M, False: 13.5M]
  ------------------
  736|  67.4M|      m_val = 0;
  737|   202M|      for (tr = 1; tr < T; tr++) {
  ------------------
  |  Branch (737:20): [True: 134M, False: 67.4M]
  ------------------
  738|   134M|        FLOAT32 temp;
  739|   134M|        ti = (WORD32)((2.0f * i - tr * p_flt) / T + 0.5f);
  740|   134M|        if ((ti < 0) || (ti + p > fft_size / 2)) continue;
  ------------------
  |  Branch (740:13): [True: 1.84M, False: 133M]
  |  Branch (740:25): [True: 0, False: 133M]
  ------------------
  741|   133M|        temp = min(ptr_mag[ti], ptr_mag[ti + p]);
  ------------------
  |  |   75|   133M|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (75:20): [True: 0, False: 133M]
  |  |  ------------------
  ------------------
  742|   133M|        if (temp > m_val) {
  ------------------
  |  Branch (742:13): [True: 0, False: 133M]
  ------------------
  743|      0|          m_val = temp;
  744|      0|          m_tr = tr;
  745|      0|          utk = ti;
  746|      0|        }
  747|   133M|      } /* for tr */
  748|       |
  749|  67.4M|      if (m_val > q_thr * ptr_mag[2 * i / T]) {
  ------------------
  |  Branch (749:11): [True: 0, False: 67.4M]
  ------------------
  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|  67.4M|    }
  771|  81.0M|    i++;
  772|  81.0M|  }
  773|   157k|}
ixheaace_dft_hbe_apply:
  841|  27.2k|                                    FLOAT32 *ptr_dft_hbe_scratch_buf) {
  842|  27.2k|  WORD32 in_offset = 0;
  843|  27.2k|  WORD32 out_offset = 0;
  844|  27.2k|  WORD32 in_hop_size = pstr_hbe_txposer->in_hop_size;
  845|  27.2k|  WORD32 oversampling_flag = pstr_hbe_txposer->oversampling_flag;
  846|  27.2k|  WORD32 fft_size = pstr_hbe_txposer->fft_size[oversampling_flag];
  847|       |
  848|  27.2k|  WORD32 out_hop_size = pstr_hbe_txposer->out_hop_size;
  849|  27.2k|  WORD32 num_in_samples = num_columns * pstr_hbe_txposer->synth_size;
  850|  27.2k|  WORD32 ana_fft_size = pstr_hbe_txposer->ana_fft_size[oversampling_flag];
  851|  27.2k|  WORD32 syn_fft_size = pstr_hbe_txposer->syn_fft_size[oversampling_flag];
  852|       |
  853|  27.2k|  WORD32 ana_pad_size = (ana_fft_size - pstr_hbe_txposer->ana_fft_size[0]) / 2;
  854|  27.2k|  WORD32 syn_pad_size = (syn_fft_size - pstr_hbe_txposer->syn_fft_size[0]) / 2;
  855|       |
  856|  27.2k|  FLOAT32 *ptr_input_buf = pstr_hbe_txposer->ptr_input_buf;
  857|  27.2k|  FLOAT32 *ptr_output_buf = pstr_hbe_txposer->ptr_output_buf;
  858|  27.2k|  FLOAT32 *ptr_spectrum = pstr_hbe_txposer->ptr_spectrum;
  859|  27.2k|  FLOAT32 *ptr_spectrum_tx = pstr_hbe_txposer->ptr_spectrum_tx;
  860|  27.2k|  FLOAT32 *ptr_mag = pstr_hbe_txposer->ptr_mag;
  861|  27.2k|  FLOAT32 *ptr_phase = pstr_hbe_txposer->ptr_phase;
  862|  27.2k|  WORD32 i, T;
  863|  27.2k|  FLOAT32 *ptr_cos_fft;
  864|  27.2k|  FLOAT32 *ptr_cos_ifft;
  865|       |
  866|  27.2k|  WORD32 ana_fft_offset = pstr_hbe_txposer->k_start * fft_size / 32;
  867|  27.2k|  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|  27.2k|  WORD32 err_code = IA_NO_ERROR;
  ------------------
  |  |   23|  27.2k|#define IA_NO_ERROR 0x00000000
  ------------------
  870|       |
  871|  27.2k|  memcpy(pstr_hbe_txposer->ptr_input_buf,
  872|  27.2k|         pstr_hbe_txposer->ptr_input_buf + pstr_hbe_txposer->ana_fft_size[0],
  873|  27.2k|         pstr_hbe_txposer->ana_fft_size[0] * sizeof(pstr_hbe_txposer->ptr_input_buf[0]));
  874|       |
  875|  27.2k|  err_code = ixheaace_real_synth_filt(pstr_hbe_txposer, num_columns, qmf_buf_real, qmf_buf_imag);
  876|  27.2k|  if (err_code) {
  ------------------
  |  Branch (876:7): [True: 0, False: 27.2k]
  ------------------
  877|      0|    return err_code;
  878|      0|  }
  879|       |
  880|  27.2k|  memcpy(ptr_output_buf, ptr_output_buf + 2 * pstr_hbe_txposer->syn_fft_size[0],
  881|  27.2k|         2 * pstr_hbe_txposer->syn_fft_size[0] * sizeof(ptr_output_buf[0]));
  882|       |
  883|  27.2k|  memset(ptr_output_buf + 2 * pstr_hbe_txposer->syn_fft_size[0], 0,
  884|  27.2k|         2 * pstr_hbe_txposer->syn_fft_size[0] * sizeof(ptr_output_buf[0]));
  885|       |
  886|  27.2k|  err_code = ixheaace_hbe_fft_map(pstr_hbe_txposer);
  887|  27.2k|  if (err_code) {
  ------------------
  |  Branch (887:7): [True: 7.52k, False: 19.7k]
  ------------------
  888|  7.52k|    return err_code;
  889|  7.52k|  }
  890|       |
  891|   177k|  while (in_offset < num_in_samples) {
  ------------------
  |  Branch (891:10): [True: 157k, False: 19.7k]
  ------------------
  892|   157k|    memset(ptr_spectrum, 0, fft_size * sizeof(ptr_spectrum[0]));
  893|   157k|    memset(ptr_spectrum_tx, 0, ((fft_size + 2) * sizeof(ptr_spectrum_tx[0])));
  894|       |
  895|   157k|    memset(ptr_mag, 0, (fft_size / 2 + 2) * sizeof(ptr_mag[0]));
  896|   157k|    memset(ptr_phase, 0, (fft_size / 2 + 2) * sizeof(ptr_phase[0]));
  897|   157k|    ixheaace_dft_hbe_apply_win(ptr_input_buf + in_offset, pstr_hbe_txposer->ptr_ana_win,
  898|   157k|                               ptr_spectrum + ana_pad_size + ana_fft_offset,
  899|   157k|                               pstr_hbe_txposer->ana_fft_size[0]);
  900|   157k|    ixheaace_dft_hbe_fft_memmove(ptr_spectrum + ana_fft_offset, ana_fft_size);
  901|   157k|    {
  902|   157k|      WORD32 len = ana_fft_size;
  903|   157k|      ptr_cos_fft = pstr_hbe_txposer->ptr_ana_cos_sin_tab;
  904|   157k|      FLOAT32 *ptr_fft_data = ptr_spectrum + ana_fft_offset;
  905|   157k|      FLOAT32 tmp1, tmp2, tmp3, tmp4;
  906|   157k|      (*(pstr_hbe_txposer->ixheaace_hbe_anal_fft))(ptr_fft_data, ptr_dft_hbe_scratch_buf, len / 2,
  907|   157k|                                                   -1);
  908|   157k|      tmp1 = ptr_fft_data[0] + ptr_fft_data[1];
  909|   157k|      ptr_fft_data[1] = ptr_fft_data[0] - ptr_fft_data[1];
  910|   157k|      ptr_fft_data[0] = tmp1;
  911|       |
  912|   157k|      i = 1;
  913|  18.1M|      while (i <= (len / 4 + (len % 4) / 2)) {
  ------------------
  |  Branch (913:14): [True: 17.9M, False: 157k]
  ------------------
  914|  17.9M|        tmp1 = ptr_fft_data[2 * i] - ptr_fft_data[len - 2 * i];
  915|  17.9M|        tmp2 = ptr_fft_data[2 * i + 1] + ptr_fft_data[len - 2 * i + 1];
  916|       |
  917|  17.9M|        tmp3 = (*(ptr_cos_fft)) * tmp1 - (*(ptr_cos_fft + 1)) * tmp2;
  918|  17.9M|        tmp4 = (*(ptr_cos_fft + 1)) * tmp1 + (*(ptr_cos_fft)) * tmp2;
  919|       |
  920|  17.9M|        ptr_cos_fft = ptr_cos_fft + 2;
  921|       |
  922|  17.9M|        tmp1 = ptr_fft_data[2 * i] + ptr_fft_data[len - 2 * i];
  923|  17.9M|        tmp2 = ptr_fft_data[2 * i + 1] - ptr_fft_data[len - 2 * i + 1];
  924|       |
  925|  17.9M|        ptr_fft_data[2 * i + 0] = 0.5f * (tmp1 - tmp3);
  926|  17.9M|        ptr_fft_data[2 * i + 1] = 0.5f * (tmp2 - tmp4);
  927|  17.9M|        ptr_fft_data[len - 2 * i + 0] = 0.5f * (tmp1 + tmp3);
  928|  17.9M|        ptr_fft_data[len - 2 * i + 1] = -0.5f * (tmp2 + tmp4);
  929|  17.9M|        ++i;
  930|  17.9M|      }
  931|   157k|    }
  932|   157k|    ixheaace_karth2polar(ptr_spectrum + ana_fft_offset, ptr_mag + ana_fft_offset / 2,
  933|   157k|                         ptr_phase + ana_fft_offset / 2, ana_fft_size);
  934|       |
  935|   473k|    for (T = 2; T <= pstr_hbe_txposer->max_stretch; T++) {
  ------------------
  |  Branch (935:17): [True: 315k, False: 157k]
  ------------------
  936|       |      /* max_stretch cannot be greater than 4. So, T can be 2 to 4*/
  937|       |
  938|   315k|      WORD32 out_transform_size;
  939|       |
  940|       |      /* 0<i<fft_size/2 */
  941|   315k|      out_transform_size = (fft_size / 2);
  942|   315k|      switch (T) {
  943|   157k|        case 2:
  ------------------
  |  Branch (943:9): [True: 157k, False: 157k]
  ------------------
  944|   157k|          ia_dft_hbe_apply_polar_t2(T, pstr_hbe_txposer, pitch_in_bins, out_transform_size);
  945|   157k|          break;
  946|   157k|        case 3:
  ------------------
  |  Branch (946:9): [True: 157k, False: 157k]
  ------------------
  947|   157k|          ia_dft_hbe_apply_polar_t_3(T, pstr_hbe_txposer, pitch_in_bins, out_transform_size);
  948|   157k|          break;
  949|      0|        default:
  ------------------
  |  Branch (949:9): [True: 0, False: 315k]
  ------------------
  950|      0|          ia_dft_hbe_apply_polar_t(T, pstr_hbe_txposer, pitch_in_bins, out_transform_size);
  951|   315k|      }
  952|   315k|    } /* for T */
  953|       |
  954|   157k|    ptr_spectrum_tx[syn_fft_offset + 1] =
  955|   157k|        ptr_spectrum_tx[syn_fft_offset + syn_fft_size]; /* Move Nyquist bin to bin 1 for RFFTN */
  956|       |
  957|   157k|    {
  958|   157k|      WORD32 len = syn_fft_size;
  959|   157k|      ptr_cos_ifft = pstr_hbe_txposer->ptr_syn_cos_sin_tab;
  960|   157k|      FLOAT32 *ptr_fft_data = ptr_spectrum_tx + syn_fft_offset;
  961|   157k|      FLOAT32 tmp1, tmp2, tmp3, tmp4;
  962|       |
  963|   157k|      FLOAT32 scale = 1.0f / len;
  964|   157k|      tmp1 = ptr_fft_data[0] + ptr_fft_data[1];
  965|   157k|      ptr_fft_data[1] = scale * (ptr_fft_data[0] - ptr_fft_data[1]);
  966|   157k|      ptr_fft_data[0] = scale * tmp1;
  967|       |
  968|  19.8M|      for (i = 1; i <= (len / 4 + (len % 4) / 2); ++i) {
  ------------------
  |  Branch (968:19): [True: 19.6M, False: 157k]
  ------------------
  969|  19.6M|        tmp1 = ptr_fft_data[2 * i] - ptr_fft_data[len - 2 * i];
  970|  19.6M|        tmp2 = ptr_fft_data[2 * i + 1] + ptr_fft_data[len - 2 * i + 1];
  971|       |
  972|  19.6M|        tmp3 = (*(ptr_cos_ifft)) * tmp1 + (*(ptr_cos_ifft + 1)) * tmp2;
  973|  19.6M|        tmp4 = -(*(ptr_cos_ifft + 1)) * tmp1 + (*(ptr_cos_ifft)) * tmp2;
  974|       |
  975|  19.6M|        ptr_cos_ifft = ptr_cos_ifft + 2;
  976|       |
  977|  19.6M|        tmp1 = ptr_fft_data[2 * i] + ptr_fft_data[len - 2 * i];
  978|  19.6M|        tmp2 = ptr_fft_data[2 * i + 1] - ptr_fft_data[len - 2 * i + 1];
  979|       |
  980|  19.6M|        ptr_fft_data[2 * i] = scale * (tmp1 - tmp3);
  981|  19.6M|        ptr_fft_data[2 * i + 1] = scale * (tmp2 - tmp4);
  982|  19.6M|        ptr_fft_data[len - 2 * i] = scale * (tmp1 + tmp3);
  983|  19.6M|        ptr_fft_data[len - 2 * i + 1] = -scale * (tmp2 + tmp4);
  984|  19.6M|      }
  985|       |
  986|   157k|      (*(pstr_hbe_txposer->ixheaace_hbe_synth_ifft))(ptr_fft_data, ptr_dft_hbe_scratch_buf,
  987|   157k|                                                     len / 2, 1);
  988|   157k|    }
  989|       |
  990|   157k|    ixheaace_dft_hbe_fft_memmove(ptr_spectrum_tx + syn_fft_offset, syn_fft_size);
  991|   157k|    ixheaace_dft_hbe_apply_win(
  992|   157k|        ptr_spectrum_tx + syn_pad_size + syn_fft_offset, pstr_hbe_txposer->ptr_syn_win,
  993|   157k|        ptr_spectrum_tx + syn_pad_size + syn_fft_offset, pstr_hbe_txposer->syn_fft_size[0]);
  994|       |
  995|  78.8M|    for (i = 0; i < pstr_hbe_txposer->syn_fft_size[0]; i++) {
  ------------------
  |  Branch (995:17): [True: 78.6M, False: 157k]
  ------------------
  996|  78.6M|      ptr_output_buf[out_offset + i] += ptr_spectrum_tx[syn_pad_size + syn_fft_offset + i];
  997|  78.6M|    }
  998|       |
  999|   157k|    in_offset += in_hop_size;
 1000|   157k|    out_offset += out_hop_size;
 1001|       |
 1002|   157k|  } /* while(in_offset<num_in_samples) */
 1003|       |
 1004|  19.7k|  ixheaace_dft_hbe_cplx_anal_filt(pstr_hbe_txposer, pv_qmf_buf_real, pv_qmf_buf_imag);
 1005|       |
 1006|  19.7k|  return err_code;
 1007|  19.7k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_calc_anal_synth_window:
  112|  3.98k|static IA_ERRORCODE ixheaace_calc_anal_synth_window(WORD32 fft_size, FLOAT32 *ptr_window) {
  113|  3.98k|  FLOAT32 sin_pi_2_n = 0.0f;
  114|  3.98k|  FLOAT32 cos_pi_2_n = 0.0f;
  115|  3.98k|  FLOAT32 *ptr_sin_pi_n_by_n = NULL;
  116|  3.98k|  WORD32 hop_stride = 1;
  117|  3.98k|  WORD32 i, j;
  118|  3.98k|  WORD32 l_fft_stride = 512;
  119|  3.98k|  switch (fft_size) {
  120|      0|    case 64:
  ------------------
  |  Branch (120:5): [True: 0, False: 3.98k]
  ------------------
  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: 3.98k]
  ------------------
  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: 3.98k]
  ------------------
  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.23k|    case 512:
  ------------------
  |  Branch (141:5): [True: 1.23k, False: 2.75k]
  ------------------
  142|  1.23k|      hop_stride = 2;
  143|  1.23k|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_1024[0];
  144|  1.23k|      sin_pi_2_n = ptr_sin_pi_n_by_n[1];
  145|  1.23k|      cos_pi_2_n = ptr_sin_pi_n_by_n[512 + 1];
  146|  1.23k|      l_fft_stride = 512;
  147|  1.23k|      break;
  148|      0|    case 1024:
  ------------------
  |  Branch (148:5): [True: 0, False: 3.98k]
  ------------------
  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|     50|    case 192:
  ------------------
  |  Branch (155:5): [True: 50, False: 3.93k]
  ------------------
  156|     50|      hop_stride = 4;
  157|     50|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_768[0];
  158|     50|      sin_pi_2_n = ptr_sin_pi_n_by_n[hop_stride >> 1];
  159|     50|      cos_pi_2_n = ptr_sin_pi_n_by_n[384 + (hop_stride >> 1)];
  160|     50|      l_fft_stride = 384;
  161|     50|      break;
  162|    842|    case 384:
  ------------------
  |  Branch (162:5): [True: 842, False: 3.14k]
  ------------------
  163|    842|      hop_stride = 2;
  164|    842|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_768[0];
  165|    842|      sin_pi_2_n = ptr_sin_pi_n_by_n[1];
  166|    842|      cos_pi_2_n = ptr_sin_pi_n_by_n[384 + 1];
  167|    842|      l_fft_stride = 384;
  168|    842|      break;
  169|      0|    case 768:
  ------------------
  |  Branch (169:5): [True: 0, False: 3.98k]
  ------------------
  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: 3.98k]
  ------------------
  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: 3.98k]
  ------------------
  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|    181|    case 448:
  ------------------
  |  Branch (190:5): [True: 181, False: 3.80k]
  ------------------
  191|    181|      hop_stride = 2;
  192|    181|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_896[0];
  193|    181|      sin_pi_2_n = ptr_sin_pi_n_by_n[1];
  194|    181|      cos_pi_2_n = ptr_sin_pi_n_by_n[448 + 1];
  195|    181|      l_fft_stride = 448;
  196|    181|      break;
  197|      0|    case 896:
  ------------------
  |  Branch (197:5): [True: 0, False: 3.98k]
  ------------------
  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|    782|    case 576:
  ------------------
  |  Branch (204:5): [True: 782, False: 3.20k]
  ------------------
  205|    782|      hop_stride = 1;
  206|    782|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_576[0];
  207|    782|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[14];
  208|    782|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[15];
  209|    782|      l_fft_stride = 288;
  210|    782|      break;
  211|    324|    case 640:
  ------------------
  |  Branch (211:5): [True: 324, False: 3.66k]
  ------------------
  212|    324|      hop_stride = 1;
  213|    324|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_640[0];
  214|    324|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[12];
  215|    324|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[13];
  216|    324|      l_fft_stride = 320;
  217|    324|      break;
  218|    571|    case 704:
  ------------------
  |  Branch (218:5): [True: 571, False: 3.41k]
  ------------------
  219|    571|      hop_stride = 1;
  220|    571|      ptr_sin_pi_n_by_n = (FLOAT32 *)&ixheaac_sine_pi_n_by_704[0];
  221|    571|      sin_pi_2_n = ixheaac_sine_pi_by_2_N[10];
  222|    571|      cos_pi_2_n = ixheaac_sine_pi_by_2_N[11];
  223|    571|      l_fft_stride = 352;
  224|    571|      break;
  225|      0|    case 832:
  ------------------
  |  Branch (225:5): [True: 0, False: 3.98k]
  ------------------
  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: 3.98k]
  ------------------
  233|      0|      return IA_EXHEAACE_EXE_FATAL_USAC_INVALID_MAPPING;
  234|  3.98k|  }
  235|       |
  236|       |  /*calculate Window*/
  237|  1.05M|  for (i = 0, j = 0; j < (fft_size >> 1); i += hop_stride, j++) {
  ------------------
  |  Branch (237:22): [True: 1.05M, False: 3.98k]
  ------------------
  238|  1.05M|    FLOAT32 cos_val = ptr_sin_pi_n_by_n[i + l_fft_stride];
  239|  1.05M|    FLOAT32 sin_val = ptr_sin_pi_n_by_n[i];
  240|  1.05M|    ptr_window[j] = cos_val * sin_pi_2_n + sin_val * cos_pi_2_n;
  241|  1.05M|  }
  242|       |
  243|  1.05M|  for (; j < fft_size; j++, i += hop_stride) {
  ------------------
  |  Branch (243:10): [True: 1.05M, False: 3.98k]
  ------------------
  244|  1.05M|    FLOAT32 cos_val = ptr_sin_pi_n_by_n[i - l_fft_stride];
  245|  1.05M|    FLOAT32 sin_val = ptr_sin_pi_n_by_n[i];
  246|  1.05M|    ptr_window[j] = sin_val * cos_pi_2_n - cos_val * sin_pi_2_n;
  247|  1.05M|  }
  248|  3.98k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  3.98k|#define IA_NO_ERROR 0x00000000
  ------------------
  249|  3.98k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_map_prot_filter:
   39|  3.98k|static FLOAT32 *ixheaace_map_prot_filter(WORD32 filt_length) {
   40|  3.98k|  switch (filt_length) {
   41|      0|    case 4:
  ------------------
  |  Branch (41:5): [True: 0, False: 3.98k]
  ------------------
   42|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[0];
   43|      0|      break;
   44|      0|    case 8:
  ------------------
  |  Branch (44:5): [True: 0, False: 3.98k]
  ------------------
   45|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[40];
   46|      0|      break;
   47|    886|    case 12:
  ------------------
  |  Branch (47:5): [True: 886, False: 3.09k]
  ------------------
   48|    886|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[120];
   49|      0|      break;
   50|    837|    case 16:
  ------------------
  |  Branch (50:5): [True: 837, False: 3.14k]
  ------------------
   51|    837|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[240];
   52|      0|      break;
   53|    319|    case 20:
  ------------------
  |  Branch (53:5): [True: 319, False: 3.66k]
  ------------------
   54|    319|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[400];
   55|      0|      break;
   56|      6|    case 24:
  ------------------
  |  Branch (56:5): [True: 6, False: 3.97k]
  ------------------
   57|      6|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[600];
   58|      0|      break;
   59|    181|    case 28:
  ------------------
  |  Branch (59:5): [True: 181, False: 3.80k]
  ------------------
   60|    181|      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.58k]
  ------------------
   63|    397|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[840];
   64|      0|      break;
   65|    782|    case 36:
  ------------------
  |  Branch (65:5): [True: 782, False: 3.20k]
  ------------------
   66|    782|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff_28_36[280];
   67|      0|      break;
   68|      5|    case 40:
  ------------------
  |  Branch (68:5): [True: 5, False: 3.97k]
  ------------------
   69|      5|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[1160];
   70|      0|      break;
   71|    571|    case 44:
  ------------------
  |  Branch (71:5): [True: 571, False: 3.41k]
  ------------------
   72|    571|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[1560];
   73|      0|      break;
   74|      0|    default:
  ------------------
  |  Branch (74:5): [True: 0, False: 3.98k]
  ------------------
   75|      0|      return (FLOAT32 *)&ixheaac_sub_samp_qmf_window_coeff[0];
   76|  3.98k|  }
   77|  3.98k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_create_dft_hbe_window:
   83|  8.75k|                                           WORD32 x_over_bin2, WORD32 ts, WORD32 size) {
   84|  8.75k|  const FLOAT32 *ptr_freq_domain_win = NULL;
   85|  8.75k|  WORD32 n;
   86|  8.75k|  if (ts == 12) {
  ------------------
  |  Branch (86:7): [True: 4.37k, False: 4.37k]
  ------------------
   87|  4.37k|    ptr_freq_domain_win = &ixheaac_dft_hbe_window_ts_12[0];
   88|  4.37k|  } else {
   89|  4.37k|    ptr_freq_domain_win = &ixheaac_dft_hbe_window_ts_18[0];
   90|  4.37k|  }
   91|  2.71M|  for (n = 0; n < (x_over_bin1 - ts / 2); n++) {
  ------------------
  |  Branch (91:15): [True: 2.70M, False: 8.75k]
  ------------------
   92|  2.70M|    ptr_win[n] = 0;
   93|  2.70M|  }
   94|       |
   95|   148k|  for (n = (x_over_bin1 - ts / 2); n <= (x_over_bin1 + ts / 2); n++) {
  ------------------
  |  Branch (95:36): [True: 140k, False: 8.75k]
  ------------------
   96|   140k|    ptr_win[n] = (FLOAT32)ptr_freq_domain_win[n - (x_over_bin1 - ts / 2)];
   97|   140k|  }
   98|       |
   99|  1.12M|  for (n = (x_over_bin1 + ts / 2 + 1); n < (x_over_bin2 - ts / 2); n++) {
  ------------------
  |  Branch (99:40): [True: 1.11M, False: 8.75k]
  ------------------
  100|  1.11M|    ptr_win[n] = (FLOAT32)1.0f;
  101|  1.11M|  }
  102|       |
  103|   148k|  for (n = (x_over_bin2 - ts / 2); n <= (x_over_bin2 + ts / 2); n++) {
  ------------------
  |  Branch (103:36): [True: 140k, False: 8.75k]
  ------------------
  104|   140k|    ptr_win[n] = (FLOAT32)1.0f - ptr_freq_domain_win[n - (x_over_bin2 - ts / 2)];
  105|   140k|  }
  106|       |
  107|  7.11M|  for (n = (x_over_bin2 + ts / 2 + 1); n < size; n++) {
  ------------------
  |  Branch (107:40): [True: 7.10M, False: 8.75k]
  ------------------
  108|  7.10M|    ptr_win[n] = 0.0f;
  109|  7.10M|  }
  110|  8.75k|}
ixheaace_sbr_hbe_dft_trans.c:ixheaace_dft_hbe_apply_win:
  484|   315k|                                       WORD32 n) {
  485|   315k|  WORD32 i;
  486|   150M|  for (i = 0; i < n; i++) {
  ------------------
  |  Branch (486:15): [True: 150M, False: 315k]
  ------------------
  487|   150M|    ptr_z[i] = ptr_x[i] * ptr_y[i];
  488|   150M|  }
  489|   315k|}

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

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

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

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

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

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.3k|  do {
   29|  35.3k|    inc = 3 * inc + 1;
   30|  35.3k|  } while (inc <= n);
  ------------------
  |  Branch (30:12): [True: 19.2k, False: 16.1k]
  ------------------
   31|       |
   32|  35.3k|  do {
   33|  35.3k|    inc = inc / 3;
   34|       |
   35|   263k|    for (i = inc + 1; i <= n; i++) {
  ------------------
  |  Branch (35:23): [True: 228k, False: 35.3k]
  ------------------
   36|   228k|      v = ptr_in[i - 1];
   37|   228k|      j = i;
   38|       |
   39|   248k|      while (ptr_in[j - inc - 1] > v) {
  ------------------
  |  Branch (39:14): [True: 21.5k, False: 227k]
  ------------------
   40|  21.5k|        ptr_in[j - 1] = ptr_in[j - inc - 1];
   41|  21.5k|        j -= inc;
   42|       |
   43|  21.5k|        if (j <= inc) {
  ------------------
  |  Branch (43:13): [True: 804, False: 20.7k]
  ------------------
   44|    804|          break;
   45|    804|        }
   46|  21.5k|      }
   47|       |
   48|   228k|      ptr_in[j - 1] = v;
   49|   228k|    }
   50|  35.3k|  } while (inc > 1);
  ------------------
  |  Branch (50:12): [True: 19.2k, False: 16.1k]
  ------------------
   51|  16.1k|}
ixheaace_add_vec_left:
   54|  62.0k|                           WORD32 length_src) {
   55|  62.0k|  WORD32 i;
   56|       |
   57|   153k|  for (i = length_src - 1; i >= 0; i--) {
  ------------------
  |  Branch (57:28): [True: 91.1k, False: 62.0k]
  ------------------
   58|  91.1k|    ixheaace_add_left(ptr_dst, ptr_length_dst, ptr_src[i]);
   59|  91.1k|  }
   60|  62.0k|}
ixheaace_add_left:
   62|   122k|VOID ixheaace_add_left(WORD32 *ptr_vector, WORD32 *ptr_length_vector, WORD32 value) {
   63|   122k|  WORD32 i;
   64|       |
   65|   528k|  for (i = *ptr_length_vector; i > 0; i--) {
  ------------------
  |  Branch (65:32): [True: 405k, False: 122k]
  ------------------
   66|   405k|    ptr_vector[i] = ptr_vector[i - 1];
   67|   405k|  }
   68|       |
   69|   122k|  ptr_vector[0] = value;
   70|       |
   71|   122k|  (*ptr_length_vector)++;
   72|   122k|}
ixheaace_add_right:
   74|   773k|VOID ixheaace_add_right(WORD32 *ptr_vector, WORD32 *ptr_length_vector, WORD32 value) {
   75|   773k|  ptr_vector[*ptr_length_vector] = value;
   76|       |
   77|   773k|  (*ptr_length_vector)++;
   78|   773k|}

ixheaace_sbr_missing_harmonics_detector_qmf:
  574|   561k|    const UWORD8 *ptr_freq_band_tab, WORD32 num_sfb, WORD8 *ptr_env_compensation) {
  575|   561k|  WORD32 i;
  576|   561k|  WORD32 transient_flag = ptr_tran_info[1];
  577|   561k|  WORD32 transient_pos = ptr_tran_info[0];
  578|   561k|  WORD32 new_detection_allowed;
  579|       |
  580|   561k|  UWORD8 **ptr_detection_vectors = pstr_sbr_mhd_et->ptr_detection_vectors;
  581|   561k|  WORD32 move = pstr_sbr_mhd_et->move;
  582|   561k|  WORD32 no_est_per_frame = pstr_sbr_mhd_et->no_est_per_frame;
  583|   561k|  WORD32 tot_no_est = pstr_sbr_mhd_et->tot_no_est;
  584|   561k|  WORD32 prev_trans_flag = pstr_sbr_mhd_et->prev_trans_flag;
  585|   561k|  WORD32 prev_transient_frame = pstr_sbr_mhd_et->prev_trans_frame;
  586|   561k|  WORD32 trans_pos_offset = pstr_sbr_mhd_et->trans_pos_offset;
  587|   561k|  WORD32 prev_transient_pos = pstr_sbr_mhd_et->prev_trans_pos;
  588|   561k|  ixheaace_str_guide_vectors *ptr_guide_vectors = pstr_sbr_mhd_et->guide_vectors;
  589|       |
  590|   561k|  FLOAT32 **ptr_sfm_sbr = pstr_sbr_mhd_et->ptr_sfm_sbr;
  591|   561k|  FLOAT32 **ptr_sfm_orig = pstr_sbr_mhd_et->ptr_sfm_orig;
  592|   561k|  FLOAT32 **ptr_tonal_diff = pstr_sbr_mhd_et->ptr_tonal_diff;
  593|       |
  594|   561k|  WORD32 no_qmf_bands = ptr_freq_band_tab[num_sfb] - ptr_freq_band_tab[0];
  595|       |
  596|   561k|  new_detection_allowed = ia_enhaacplus_enc_isDetectionOfNewToneAllowed(
  597|   561k|      ptr_frame_info, prev_transient_frame, prev_transient_pos, prev_trans_flag, trans_pos_offset,
  598|   561k|      transient_flag, transient_pos, pstr_sbr_mhd_et);
  599|       |
  600|   561k|  ia_enhaacplus_enc_calculate_detector_input(ptr_quota_buf, ptr_idx_vx, ptr_tonal_diff,
  601|   561k|                                             ptr_sfm_orig, ptr_sfm_sbr, ptr_freq_band_tab,
  602|   561k|                                             num_sfb, no_est_per_frame, move, no_qmf_bands);
  603|       |
  604|   561k|  ia_enhaacplus_enc_detection_with_prediction(
  605|   561k|      ptr_quota_buf, ptr_tonal_diff, num_sfb, ptr_freq_band_tab, ptr_sfm_orig, ptr_sfm_sbr,
  606|   561k|      ptr_detection_vectors, pstr_sbr_mhd_et->ptr_guide_scfb, ptr_guide_vectors, no_est_per_frame,
  607|   561k|      tot_no_est, new_detection_allowed, ptr_add_harmonics_sfbs);
  608|       |
  609|   561k|  ia_enhaacplus_enc_calculate_comp_vector(
  610|   561k|      ptr_add_harmonics_sfbs, ptr_quota_buf, ptr_env_compensation, num_sfb, ptr_freq_band_tab,
  611|   561k|      ptr_tonal_diff, tot_no_est, pstr_sbr_mhd_et->sbr_prev_env_compensation,
  612|   561k|      new_detection_allowed);
  613|       |
  614|   561k|  *ptr_add_harmonics_flag = 0;
  615|       |
  616|  5.76M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (616:15): [True: 5.39M, False: 369k]
  ------------------
  617|  5.39M|    if (ptr_add_harmonics_sfbs[i]) {
  ------------------
  |  Branch (617:9): [True: 192k, False: 5.20M]
  ------------------
  618|   192k|      *ptr_add_harmonics_flag = 1;
  619|   192k|      break;
  620|   192k|    }
  621|  5.39M|  }
  622|       |
  623|   561k|  memcpy(pstr_sbr_mhd_et->sbr_prev_env_compensation, ptr_env_compensation,
  624|   561k|         num_sfb * sizeof(pstr_sbr_mhd_et->sbr_prev_env_compensation[0]));
  625|       |
  626|   561k|  memcpy(pstr_sbr_mhd_et->ptr_guide_scfb, ptr_add_harmonics_sfbs,
  627|   561k|         num_sfb * sizeof(pstr_sbr_mhd_et->ptr_guide_scfb[0]));
  628|       |
  629|   561k|  memcpy(ptr_guide_vectors[0].ptr_guide_vector_detected, ptr_add_harmonics_sfbs,
  630|   561k|         num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vector_detected[0]));
  631|       |
  632|   561k|  if (tot_no_est > no_est_per_frame) {
  ------------------
  |  Branch (632:7): [True: 561k, False: 0]
  ------------------
  633|   561k|    memcpy(ptr_guide_vectors[0].ptr_guide_vec_diff,
  634|   561k|           ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_diff,
  635|   561k|           num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vec_diff[0]));
  636|   561k|    memcpy(ptr_guide_vectors[0].ptr_guide_vec_orig,
  637|   561k|           ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_orig,
  638|   561k|           num_sfb * sizeof(ptr_guide_vectors[0].ptr_guide_vec_orig[0]));
  639|   561k|  } 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|  7.76M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (649:15): [True: 7.20M, False: 561k]
  ------------------
  650|       |#ifdef _WIN32
  651|       |#pragma warning(suppress : 6385)
  652|       |#endif
  653|  7.20M|    if ((ptr_guide_vectors[0].ptr_guide_vec_diff[i] ||
  ------------------
  |  Branch (653:10): [True: 629k, False: 6.57M]
  ------------------
  654|  6.57M|         ptr_guide_vectors[0].ptr_guide_vec_orig[i]) &&
  ------------------
  |  Branch (654:10): [True: 401k, False: 6.16M]
  ------------------
  655|  1.03M|        !ptr_add_harmonics_sfbs[i]) {
  ------------------
  |  Branch (655:9): [True: 612k, False: 417k]
  ------------------
  656|   612k|      ptr_guide_vectors[0].ptr_guide_vec_diff[i] = 0;
  657|   612k|      ptr_guide_vectors[0].ptr_guide_vec_orig[i] = 0;
  658|   612k|    }
  659|  7.20M|  }
  660|   561k|}
ixheaace_create_sbr_missing_harmonics_detector:
  665|  8.56k|    WORD32 *ptr_common_buffer) {
  666|  8.56k|  WORD32 i;
  667|  8.56k|  WORD32 *ptr_fix;
  668|  8.56k|  FLOAT32 *ptr_mem;
  669|  8.56k|  ixheaace_pstr_sbr_missing_harmonics_detector pstr_sbr_detector_handle = pstr_sbr_mhdet;
  670|       |
  671|  8.56k|  memset(pstr_sbr_detector_handle, 0, sizeof(ixheaace_str_sbr_missing_har_detector));
  672|       |
  673|  8.56k|  pstr_sbr_detector_handle->trans_pos_offset = 4;
  674|  8.56k|  pstr_sbr_detector_handle->time_slots = 16;
  675|       |
  676|  8.56k|  pstr_sbr_detector_handle->qmf_num_ch = qmf_num_ch;
  677|  8.56k|  pstr_sbr_detector_handle->sample_freq = sample_freq;
  678|  8.56k|  pstr_sbr_detector_handle->num_scf = num_sfb;
  679|       |
  680|  8.56k|  pstr_sbr_detector_handle->tot_no_est = tot_no_est;
  681|  8.56k|  pstr_sbr_detector_handle->move = move;
  682|  8.56k|  pstr_sbr_detector_handle->no_est_per_frame = no_est_per_frame;
  683|       |
  684|  8.56k|  ptr_fix = &ptr_common_buffer[ch * 5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS];
  ------------------
  |  |   71|  8.56k|#define NO_OF_ESTIMATES (4)
  ------------------
                ptr_fix = &ptr_common_buffer[ch * 5 * NO_OF_ESTIMATES * MAXIMUM_FREQ_COEFFS];
  ------------------
  |  |   83|  8.56k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.56k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  685|  8.56k|  ptr_mem = (FLOAT32 *)ptr_fix;
  686|  41.0k|  for (i = 0; i < tot_no_est; i++) {
  ------------------
  |  Branch (686:15): [True: 32.4k, False: 8.56k]
  ------------------
  687|  32.4k|    pstr_sbr_detector_handle->ptr_tonal_diff[i] = ptr_mem;
  688|  32.4k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  689|       |
  690|  32.4k|    memset(pstr_sbr_detector_handle->ptr_tonal_diff[i], 0,
  691|  32.4k|           sizeof(pstr_sbr_detector_handle->ptr_tonal_diff[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  692|       |
  693|  32.4k|    pstr_sbr_detector_handle->ptr_sfm_orig[i] = ptr_mem;
  694|  32.4k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  695|       |
  696|  32.4k|    memset(pstr_sbr_detector_handle->ptr_sfm_orig[i], 0,
  697|  32.4k|           sizeof(pstr_sbr_detector_handle->ptr_sfm_orig[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  698|       |
  699|  32.4k|    pstr_sbr_detector_handle->ptr_sfm_sbr[i] = ptr_mem;
  700|  32.4k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  701|       |
  702|  32.4k|    memset(pstr_sbr_detector_handle->ptr_sfm_sbr[i], 0,
  703|  32.4k|           sizeof(pstr_sbr_detector_handle->ptr_sfm_sbr[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  704|       |
  705|  32.4k|    pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_diff = ptr_mem;
  706|  32.4k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  707|       |
  708|  32.4k|    memset(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_diff, 0,
  709|  32.4k|           sizeof(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_diff[0]) *
  710|  32.4k|               MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  711|       |
  712|  32.4k|    pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_orig = ptr_mem;
  713|  32.4k|    ptr_mem += MAXIMUM_FREQ_COEFFS;
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  714|       |
  715|  32.4k|    memset(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_orig, 0,
  716|  32.4k|           sizeof(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vec_orig[0]) *
  717|  32.4k|               MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  718|       |
  719|  32.4k|    pstr_sbr_detector_handle->ptr_detection_vectors[i] =
  720|  32.4k|        &(pstr_sbr_detector_handle->sbr_detection_vectors[i * MAXIMUM_FREQ_COEFFS]);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  721|       |
  722|  32.4k|    memset(pstr_sbr_detector_handle->ptr_detection_vectors[i], 0,
  723|  32.4k|           sizeof(pstr_sbr_detector_handle->ptr_detection_vectors[0][0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  724|       |
  725|  32.4k|    pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vector_detected =
  726|  32.4k|        &(pstr_sbr_detector_handle->sbr_guide_vector_detected[i * MAXIMUM_FREQ_COEFFS]);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  727|       |
  728|  32.4k|    memset(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vector_detected, 0,
  729|  32.4k|           sizeof(pstr_sbr_detector_handle->guide_vectors[i].ptr_guide_vector_detected[0]) *
  730|  32.4k|               MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  32.4k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  32.4k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  731|  32.4k|  }
  732|       |
  733|  8.56k|  pstr_sbr_detector_handle->ptr_prev_env_compensation =
  734|  8.56k|      &(pstr_sbr_detector_handle->sbr_prev_env_compensation[0]);
  735|       |
  736|  8.56k|  memset(pstr_sbr_detector_handle->ptr_prev_env_compensation, 0,
  737|  8.56k|         sizeof(pstr_sbr_detector_handle->ptr_prev_env_compensation[0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  8.56k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.56k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  738|       |
  739|  8.56k|  pstr_sbr_detector_handle->ptr_guide_scfb = &(pstr_sbr_detector_handle->sbr_guide_scfb[0]);
  740|       |
  741|  8.56k|  memset(pstr_sbr_detector_handle->ptr_guide_scfb, 0,
  742|  8.56k|         sizeof(pstr_sbr_detector_handle->ptr_guide_scfb[0]) * MAXIMUM_FREQ_COEFFS);
  ------------------
  |  |   83|  8.56k|#define MAXIMUM_FREQ_COEFFS (MAXIMUM_FREQ_COEFFS_USAC)
  |  |  ------------------
  |  |  |  |   76|  8.56k|#define MAXIMUM_FREQ_COEFFS_USAC (56)
  |  |  ------------------
  ------------------
  743|       |
  744|  8.56k|  pstr_sbr_detector_handle->prev_trans_flag = 0;
  745|  8.56k|  pstr_sbr_detector_handle->prev_trans_frame = 0;
  746|  8.56k|  pstr_sbr_detector_handle->prev_trans_pos = 0;
  747|  8.56k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_isDetectionOfNewToneAllowed:
  159|   561k|    ixheaace_pstr_sbr_missing_harmonics_detector pstr_sbr_missing_harmonics_detector) {
  160|   561k|  WORD32 transient_frame, new_detection_allowed;
  161|       |
  162|   561k|  transient_frame = 0;
  163|       |
  164|   561k|  if (transient_flag) {
  ------------------
  |  Branch (164:7): [True: 136k, False: 424k]
  ------------------
  165|   136k|    if (transient_pos + trans_pos_offset < ptr_frame_info->borders[ptr_frame_info->n_envelopes]) {
  ------------------
  |  Branch (165:9): [True: 122k, False: 14.7k]
  ------------------
  166|   122k|      transient_frame = 1;
  167|   122k|    }
  168|   424k|  } else {
  169|   424k|    if (prev_trans_flag && !prev_transient_frame) {
  ------------------
  |  Branch (169:9): [True: 48.8k, False: 375k]
  |  Branch (169:28): [True: 3.23k, False: 45.6k]
  ------------------
  170|  3.23k|      transient_frame = 1;
  171|  3.23k|    }
  172|   424k|  }
  173|       |
  174|   561k|  new_detection_allowed = 0;
  175|       |
  176|   561k|  if (transient_frame) {
  ------------------
  |  Branch (176:7): [True: 125k, False: 436k]
  ------------------
  177|   125k|    new_detection_allowed = 1;
  178|   436k|  } else {
  179|   436k|    if (prev_transient_frame &&
  ------------------
  |  Branch (179:9): [True: 53.5k, False: 382k]
  ------------------
  180|  53.5k|        ixheaac_abs32(ptr_frame_info->borders[0] -
  ------------------
  |  Branch (180:9): [True: 41.2k, False: 12.3k]
  ------------------
  181|  53.5k|                      (prev_transient_pos + trans_pos_offset -
  182|  53.5k|                       pstr_sbr_missing_harmonics_detector->time_slots)) < DELTA_TIME) {
  ------------------
  |  |   23|  53.5k|#define DELTA_TIME 9
  ------------------
  183|  41.2k|      new_detection_allowed = 1;
  184|  41.2k|    }
  185|   436k|  }
  186|       |
  187|   561k|  pstr_sbr_missing_harmonics_detector->prev_trans_flag = transient_flag;
  188|   561k|  pstr_sbr_missing_harmonics_detector->prev_trans_frame = transient_frame;
  189|   561k|  pstr_sbr_missing_harmonics_detector->prev_trans_pos = transient_pos;
  190|       |
  191|   561k|  return (new_detection_allowed);
  192|   561k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_calculate_detector_input:
  131|   561k|    WORD32 no_est_per_frame, WORD32 move, WORD32 no_qmf_bands) {
  132|   561k|  WORD32 est;
  133|       |
  134|  1.57M|  for (est = 0; est < move; est++) {
  ------------------
  |  Branch (134:17): [True: 1.01M, False: 561k]
  ------------------
  135|  1.01M|    memcpy(ptr_tonal_diff[est], ptr_tonal_diff[est + no_est_per_frame],
  136|  1.01M|           no_qmf_bands * sizeof(ptr_tonal_diff[est][0]));
  137|       |
  138|  1.01M|    memcpy(ptr_sfm_orig[est], ptr_sfm_orig[est + no_est_per_frame],
  139|  1.01M|           no_qmf_bands * sizeof(ptr_sfm_orig[est][0]));
  140|       |
  141|  1.01M|    memcpy(ptr_sfm_sbr[est], ptr_sfm_sbr[est + no_est_per_frame],
  142|  1.01M|           no_qmf_bands * sizeof(ptr_sfm_sbr[est][0]));
  143|  1.01M|  }
  144|       |
  145|  1.68M|  for (est = 0; est < no_est_per_frame; est++) {
  ------------------
  |  Branch (145:17): [True: 1.12M, False: 561k]
  ------------------
  146|  1.12M|    ia_enhaacplus_enc_diff(ptr_quota_buf[est + move], ptr_tonal_diff[est + move],
  147|  1.12M|                           ptr_freq_band_tab, num_sfb, ptr_idx_vx);
  148|       |
  149|  1.12M|    ia_enhaacplus_enc_calculate_flatness_measure(
  150|  1.12M|        ptr_quota_buf[est + move], ptr_idx_vx, ptr_sfm_orig[est + move], ptr_sfm_sbr[est + move],
  151|  1.12M|        ptr_freq_band_tab, num_sfb);
  152|  1.12M|  }
  153|   561k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_diff:
   57|  1.12M|                                   WORD8 *ptr_idx_vx) {
   58|  1.12M|  WORD32 i, ll, lu, k;
   59|  1.12M|  FLOAT32 max_val_orig, max_val_sbr;
   60|  15.5M|  for (i = 0; i < n_scfb; i++) {
  ------------------
  |  Branch (60:15): [True: 14.4M, False: 1.12M]
  ------------------
   61|  14.4M|    ll = ptr_freq_band_tab[i];
   62|  14.4M|    lu = ptr_freq_band_tab[i + 1];
   63|  14.4M|    max_val_orig = max_val_sbr = 0;
   64|       |
   65|  47.5M|    for (k = ll; k < lu; k++) {
  ------------------
  |  Branch (65:18): [True: 33.1M, False: 14.4M]
  ------------------
   66|  33.1M|      if (ptr_tonal_orig[k] > max_val_orig) {
  ------------------
  |  Branch (66:11): [True: 16.9M, False: 16.1M]
  ------------------
   67|  16.9M|        max_val_orig = ptr_tonal_orig[k];
   68|  16.9M|      }
   69|  33.1M|      if (ptr_tonal_orig[ptr_idx_vx[k]] > max_val_sbr) {
  ------------------
  |  Branch (69:11): [True: 15.8M, False: 17.2M]
  ------------------
   70|  15.8M|        max_val_sbr = ptr_tonal_orig[ptr_idx_vx[k]];
   71|  15.8M|      }
   72|  33.1M|    }
   73|       |
   74|  14.4M|    ptr_diff_map_2_scfb[i] = (max_val_sbr > 1) ? max_val_orig / max_val_sbr : max_val_orig;
  ------------------
  |  Branch (74:30): [True: 7.03M, False: 7.36M]
  ------------------
   75|  14.4M|  }
   76|  1.12M|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_calculate_flatness_measure:
   82|  1.12M|                                                         WORD32 num_sfb) {
   83|  1.12M|  WORD32 i, j;
   84|       |
   85|  1.12M|  FLOAT32 am_org, am_transp, gm_org, gm_transp, sfm_org, sfm_transp;
   86|       |
   87|  1.12M|  i = 0;
   88|  15.5M|  while (i < num_sfb) {
  ------------------
  |  Branch (88:10): [True: 14.4M, False: 1.12M]
  ------------------
   89|  14.4M|    WORD32 band_low = ptr_freq_band_tab[i];
   90|  14.4M|    WORD32 band_high = ptr_freq_band_tab[i + 1];
   91|       |
   92|  14.4M|    ptr_sfm_orig[i] = 1.0f;
   93|  14.4M|    ptr_sfm_sbr[i] = 1.0f;
   94|       |
   95|  14.4M|    if (band_high - band_low > 1) {
  ------------------
  |  Branch (95:9): [True: 11.2M, False: 3.16M]
  ------------------
   96|  11.2M|      am_org = 0;
   97|  11.2M|      am_transp = 0;
   98|  11.2M|      gm_org = 1.0f;
   99|  11.2M|      gm_transp = 1.0f;
  100|       |
  101|  41.1M|      for (j = band_low; j < band_high; j++) {
  ------------------
  |  Branch (101:26): [True: 29.9M, False: 11.2M]
  ------------------
  102|  29.9M|        sfm_org = ptr_quota_buf[j];
  103|  29.9M|        sfm_transp = ptr_quota_buf[ptr_idx_vx[j]];
  104|       |
  105|  29.9M|        am_org += sfm_org;
  106|  29.9M|        gm_org += sfm_org;
  107|  29.9M|        am_transp += sfm_transp;
  108|  29.9M|        gm_transp += sfm_transp;
  109|  29.9M|      }
  110|       |
  111|  11.2M|      am_org /= band_high - band_low;
  112|  11.2M|      am_transp /= band_high - band_low;
  113|  11.2M|      gm_org = (FLOAT32)pow(gm_org, 1.0f / (band_high - band_low));
  114|  11.2M|      gm_transp = (FLOAT32)pow(gm_transp, 1.0f / (band_high - band_low));
  115|       |
  116|  11.2M|      if (am_org) {
  ------------------
  |  Branch (116:11): [True: 9.30M, False: 1.92M]
  ------------------
  117|  9.30M|        ptr_sfm_orig[i] = gm_org / am_org;
  118|  9.30M|      }
  119|       |
  120|  11.2M|      if (am_transp) {
  ------------------
  |  Branch (120:11): [True: 9.30M, False: 1.93M]
  ------------------
  121|  9.30M|        ptr_sfm_sbr[i] = gm_transp / am_transp;
  122|  9.30M|      }
  123|  11.2M|    }
  124|  14.4M|    i++;
  125|  14.4M|  }
  126|  1.12M|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_detection_with_prediction:
  380|   561k|    WORD32 new_detection_allowed, UWORD8 *ptr_add_harmonics_sfbs) {
  381|   561k|  WORD32 est = 0, i;
  382|   561k|  WORD32 start;
  383|       |
  384|   561k|  memset(ptr_add_harmonics_sfbs, 0, num_sfb * sizeof(ptr_add_harmonics_sfbs[0]));
  385|       |
  386|   561k|  if (new_detection_allowed) {
  ------------------
  |  Branch (386:7): [True: 166k, False: 394k]
  ------------------
  387|   166k|    if (tot_no_est > 1) {
  ------------------
  |  Branch (387:9): [True: 166k, False: 0]
  ------------------
  388|   166k|      start = no_est_per_frame;
  389|   166k|      memcpy(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_diff,
  390|   166k|             ptr_guide_vectors[0].ptr_guide_vec_diff,
  391|   166k|             num_sfb * sizeof(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_diff[0]));
  392|       |
  393|   166k|      memcpy(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_orig,
  394|   166k|             ptr_guide_vectors[0].ptr_guide_vec_orig,
  395|   166k|             num_sfb * sizeof(ptr_guide_vectors[no_est_per_frame].ptr_guide_vec_orig[0]));
  396|       |
  397|   166k|      memset(
  398|   166k|          ptr_guide_vectors[no_est_per_frame - 1].ptr_guide_vector_detected, 0,
  399|   166k|          num_sfb * sizeof(ptr_guide_vectors[no_est_per_frame - 1].ptr_guide_vector_detected[0]));
  400|   166k|    } else {
  401|      0|      start = 0;
  402|      0|    }
  403|   394k|  } else {
  404|   394k|    start = 0;
  405|   394k|  }
  406|       |
  407|  2.36M|  for (est = start; est < tot_no_est; est++) {
  ------------------
  |  Branch (407:21): [True: 1.80M, False: 561k]
  ------------------
  408|  1.80M|    if (est > 0) {
  ------------------
  |  Branch (408:9): [True: 1.40M, False: 394k]
  ------------------
  409|  1.40M|      memcpy(ptr_guide_vectors[est].ptr_guide_vector_detected, ptr_detection_vectors[est - 1],
  410|  1.40M|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vector_detected[0]));
  411|  1.40M|    }
  412|       |
  413|  1.80M|    memset(ptr_detection_vectors[est], 0, num_sfb * sizeof(ptr_detection_vectors[est][0]));
  414|       |
  415|  1.80M|    if (est < tot_no_est - 1) {
  ------------------
  |  Branch (415:9): [True: 1.23M, False: 561k]
  ------------------
  416|  1.23M|      memset(ptr_guide_vectors[est + 1].ptr_guide_vec_diff, 0,
  417|  1.23M|             num_sfb * sizeof(ptr_guide_vectors[est + 1].ptr_guide_vec_diff[0]));
  418|       |
  419|  1.23M|      memset(ptr_guide_vectors[est + 1].ptr_guide_vec_orig, 0,
  420|  1.23M|             num_sfb * sizeof(ptr_guide_vectors[est + 1].ptr_guide_vec_orig[0]));
  421|       |
  422|  1.23M|      memset(ptr_guide_vectors[est + 1].ptr_guide_vector_detected, 0,
  423|  1.23M|             num_sfb * sizeof(ptr_guide_vectors[est + 1].ptr_guide_vector_detected[0]));
  424|       |
  425|  1.23M|      ia_enhaacplus_enc_detection(ptr_quota_buf[est], ptr_diff_vec_sfb[est], num_sfb,
  426|  1.23M|                                  ptr_detection_vectors[est], ptr_freq_band_tab,
  427|  1.23M|                                  ptr_sfm_orig[est], ptr_sfm_sbr[est], &(ptr_guide_vectors[est]),
  428|  1.23M|                                  &(ptr_guide_vectors[est + 1]));
  429|  1.23M|    } else {
  430|   561k|      memset(ptr_guide_vectors[est].ptr_guide_vec_diff, 0,
  431|   561k|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vec_diff[0]));
  432|       |
  433|   561k|      memset(ptr_guide_vectors[est].ptr_guide_vec_orig, 0,
  434|   561k|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vec_orig[0]));
  435|       |
  436|   561k|      memset(ptr_guide_vectors[est].ptr_guide_vector_detected, 0,
  437|   561k|             num_sfb * sizeof(ptr_guide_vectors[est].ptr_guide_vector_detected[0]));
  438|       |
  439|   561k|      ia_enhaacplus_enc_detection(ptr_quota_buf[est], ptr_diff_vec_sfb[est], num_sfb,
  440|   561k|                                  ptr_detection_vectors[est], ptr_freq_band_tab,
  441|   561k|                                  ptr_sfm_orig[est], ptr_sfm_sbr[est], &(ptr_guide_vectors[est]),
  442|   561k|                                  &(ptr_guide_vectors[est]));
  443|   561k|    }
  444|  1.80M|  }
  445|       |
  446|   561k|  if (new_detection_allowed) {
  ------------------
  |  Branch (446:7): [True: 166k, False: 394k]
  ------------------
  447|   166k|    if (tot_no_est > 1) {
  ------------------
  |  Branch (447:9): [True: 166k, False: 0]
  ------------------
  448|   166k|      ia_enhaacplus_enc_transient_cleanup(ptr_quota_buf, num_sfb, ptr_detection_vectors,
  449|   166k|                                          ptr_freq_band_tab, ptr_guide_vectors[no_est_per_frame],
  450|   166k|                                          start, tot_no_est);
  451|   166k|    } 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|   166k|  }
  457|       |
  458|  7.76M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (458:15): [True: 7.20M, False: 561k]
  ------------------
  459|  30.2M|    for (est = start; est < tot_no_est; est++) {
  ------------------
  |  Branch (459:23): [True: 23.0M, False: 7.20M]
  ------------------
  460|  23.0M|      ptr_add_harmonics_sfbs[i] = ptr_add_harmonics_sfbs[i] || ptr_detection_vectors[est][i];
  ------------------
  |  Branch (460:35): [True: 3.39M, False: 19.6M]
  |  Branch (460:64): [True: 1.74M, False: 17.9M]
  ------------------
  461|  23.0M|    }
  462|  7.20M|  }
  463|       |
  464|   561k|  if (!new_detection_allowed) {
  ------------------
  |  Branch (464:7): [True: 394k, False: 166k]
  ------------------
  465|  5.52M|    for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (465:17): [True: 5.12M, False: 394k]
  ------------------
  466|  5.12M|      if (ptr_add_harmonics_sfbs[i] - ptr_prev_frame_sfb_harm[i] > 0) {
  ------------------
  |  Branch (466:11): [True: 1.11M, False: 4.01M]
  ------------------
  467|  1.11M|        ptr_add_harmonics_sfbs[i] = 0;
  468|  1.11M|      }
  469|  5.12M|    }
  470|   394k|  }
  471|   561k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_detection:
  287|  1.80M|                                        ixheaace_str_guide_vectors *ptr_new_guide_vectors) {
  288|  1.80M|  WORD32 i, j;
  289|  1.80M|  WORD32 lower_band, upper_band;
  290|  1.80M|  FLOAT32 thr, thr_org;
  291|       |
  292|  24.8M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (292:15): [True: 23.0M, False: 1.80M]
  ------------------
  293|  23.0M|    if (ptr_guide_vectors->ptr_guide_vec_diff[i]) {
  ------------------
  |  Branch (293:9): [True: 1.33M, False: 21.7M]
  ------------------
  294|  1.33M|      if (SBR_DECAY_GUIDE_DIFF * ptr_guide_vectors->ptr_guide_vec_diff[i] > SBR_THR_DIFF_GUIDE) {
  ------------------
  |  |   41|  1.33M|#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.33M|#define SBR_THR_DIFF_GUIDE (1.26f)
  ------------------
  |  Branch (294:11): [True: 1.33M, False: 0]
  ------------------
  295|  1.33M|        thr = SBR_DECAY_GUIDE_DIFF * ptr_guide_vectors->ptr_guide_vec_diff[i];
  ------------------
  |  |   41|  1.33M|#define SBR_DECAY_GUIDE_DIFF (0.5f)
  ------------------
  296|  1.33M|      } else {
  297|      0|        thr = SBR_THR_DIFF_GUIDE;
  ------------------
  |  |   42|      0|#define SBR_THR_DIFF_GUIDE (1.26f)
  ------------------
  298|      0|      }
  299|  1.33M|      if (thr > SBR_THR_DIFF) {
  ------------------
  |  |   43|  1.33M|#define SBR_THR_DIFF (25.0f)
  ------------------
  |  Branch (299:11): [True: 1.32M, False: 11.3k]
  ------------------
  300|  1.32M|        thr = SBR_THR_DIFF;
  ------------------
  |  |   43|  1.32M|#define SBR_THR_DIFF (25.0f)
  ------------------
  301|  1.32M|      }
  302|  21.7M|    } else {
  303|  21.7M|      thr = SBR_THR_DIFF;
  ------------------
  |  |   43|  21.7M|#define SBR_THR_DIFF (25.0f)
  ------------------
  304|  21.7M|    }
  305|       |
  306|  23.0M|    if (ptr_diff_vec_scfb[i] > thr) {
  ------------------
  |  Branch (306:9): [True: 2.53M, False: 20.5M]
  ------------------
  307|  2.53M|      ptr_harm_vec[i] = 1;
  308|  2.53M|      ptr_new_guide_vectors->ptr_guide_vec_diff[i] = ptr_diff_vec_scfb[i];
  309|  20.5M|    } else {
  310|  20.5M|      if (ptr_guide_vectors->ptr_guide_vec_diff[i]) {
  ------------------
  |  Branch (310:11): [True: 828k, False: 19.7M]
  ------------------
  311|   828k|        ptr_guide_vectors->ptr_guide_vec_orig[i] = SBR_THR_TONE_GUIDE;
  ------------------
  |  |   46|   828k|#define SBR_THR_TONE_GUIDE (1.26f)
  ------------------
  312|   828k|      }
  313|  20.5M|    }
  314|  23.0M|  }
  315|       |
  316|  24.8M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (316:15): [True: 23.0M, False: 1.80M]
  ------------------
  317|  23.0M|    lower_band = ptr_freq_band_tab[i];
  318|  23.0M|    upper_band = ptr_freq_band_tab[i + 1];
  319|       |
  320|  23.0M|    if (ptr_guide_vectors->ptr_guide_vec_orig[i] * SBR_DECAY_GUIDE_ORIG > SBR_THR_TONE_GUIDE) {
  ------------------
  |  |   47|  23.0M|#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.0M|#define SBR_THR_TONE_GUIDE (1.26f)
  ------------------
  |  Branch (320:9): [True: 872k, False: 22.2M]
  ------------------
  321|   872k|      thr_org = ptr_guide_vectors->ptr_guide_vec_orig[i] * SBR_DECAY_GUIDE_ORIG;
  ------------------
  |  |   47|   872k|#define SBR_DECAY_GUIDE_ORIG (0.3f)
  ------------------
  322|  22.2M|    } else {
  323|  22.2M|      thr_org = SBR_THR_TONE_GUIDE;
  ------------------
  |  |   46|  22.2M|#define SBR_THR_TONE_GUIDE (1.26f)
  ------------------
  324|  22.2M|    }
  325|  23.0M|    if (thr_org > SBR_THR_TONE) {
  ------------------
  |  |   44|  23.0M|#define SBR_THR_TONE (15.0f)
  ------------------
  |  Branch (325:9): [True: 831k, False: 22.2M]
  ------------------
  326|   831k|      thr_org = SBR_THR_TONE;
  ------------------
  |  |   44|   831k|#define SBR_THR_TONE (15.0f)
  ------------------
  327|   831k|    }
  328|  23.0M|    if (ptr_guide_vectors->ptr_guide_vec_orig[i]) {
  ------------------
  |  Branch (328:9): [True: 1.72M, False: 21.3M]
  ------------------
  329|  5.21M|      for (j = lower_band; j < upper_band; j++) {
  ------------------
  |  Branch (329:28): [True: 3.48M, False: 1.72M]
  ------------------
  330|  3.48M|        if (ptr_quota_buf[j] > thr_org) {
  ------------------
  |  Branch (330:13): [True: 2.54M, False: 937k]
  ------------------
  331|  2.54M|          ptr_harm_vec[i] = 1;
  332|  2.54M|          ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[j];
  333|  2.54M|        }
  334|  3.48M|      }
  335|  1.72M|    }
  336|  23.0M|  }
  337|       |
  338|  1.80M|  thr_org = SBR_THR_TONE;
  ------------------
  |  |   44|  1.80M|#define SBR_THR_TONE (15.0f)
  ------------------
  339|       |
  340|  24.8M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (340:15): [True: 23.0M, False: 1.80M]
  ------------------
  341|  23.0M|    lower_band = ptr_freq_band_tab[i];
  342|  23.0M|    upper_band = ptr_freq_band_tab[i + 1];
  343|       |
  344|  23.0M|    if (upper_band - lower_band > 1) {
  ------------------
  |  Branch (344:9): [True: 18.1M, False: 4.89M]
  ------------------
  345|  66.6M|      for (j = lower_band; j < upper_band; j++) {
  ------------------
  |  Branch (345:28): [True: 48.5M, False: 18.1M]
  ------------------
  346|  48.5M|        if (ptr_quota_buf[j] > thr_org && ptr_sfm_sbr[i] > SBR_THR_SFM_SBR &&
  ------------------
  |  |   48|  69.2M|#define SBR_THR_SFM_SBR (0.3f)
  ------------------
  |  Branch (346:13): [True: 20.7M, False: 27.7M]
  |  Branch (346:43): [True: 666k, False: 20.0M]
  ------------------
  347|   666k|            ptr_sfm_orig[i] > SBR_THR_SFM_ORG) {
  ------------------
  |  |   49|   666k|#define SBR_THR_SFM_ORG (0.1f)
  ------------------
  |  Branch (347:13): [True: 122k, False: 544k]
  ------------------
  348|   122k|          ptr_harm_vec[i] = 1;
  349|   122k|          ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[j];
  350|   122k|        }
  351|  48.5M|      }
  352|  18.1M|    } else {
  353|  4.89M|      if (1 < (num_sfb - 1)) {
  ------------------
  |  Branch (353:11): [True: 4.89M, False: 0]
  ------------------
  354|  4.89M|        lower_band = ptr_freq_band_tab[i];
  355|       |
  356|  4.89M|        if (i > 0) {
  ------------------
  |  Branch (356:13): [True: 3.60M, False: 1.29M]
  ------------------
  357|  3.60M|          if (ptr_quota_buf[lower_band] > SBR_THR_TONE &&
  ------------------
  |  |   44|  7.20M|#define SBR_THR_TONE (15.0f)
  ------------------
  |  Branch (357:15): [True: 1.13M, False: 2.47M]
  ------------------
  358|  1.13M|              (ptr_diff_vec_scfb[i - 1] < SBR_INV_THR_TONE ||
  ------------------
  |  |   45|  2.26M|#define SBR_INV_THR_TONE (1.0f / 15.0f)
  ------------------
  |  Branch (358:16): [True: 378k, False: 751k]
  ------------------
  359|   751k|               ptr_diff_vec_scfb[i + 1] < SBR_INV_THR_TONE)) {
  ------------------
  |  |   45|   751k|#define SBR_INV_THR_TONE (1.0f / 15.0f)
  ------------------
  |  Branch (359:16): [True: 172k, False: 579k]
  ------------------
  360|   550k|            ptr_harm_vec[i] = 1;
  361|   550k|            ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[lower_band];
  362|   550k|          }
  363|  3.60M|        } else {
  364|  1.29M|          if (ptr_quota_buf[lower_band] > SBR_THR_TONE &&
  ------------------
  |  |   44|  2.59M|#define SBR_THR_TONE (15.0f)
  ------------------
  |  Branch (364:15): [True: 387k, False: 910k]
  ------------------
  365|   387k|              ptr_diff_vec_scfb[i + 1] < SBR_INV_THR_TONE) {
  ------------------
  |  |   45|   387k|#define SBR_INV_THR_TONE (1.0f / 15.0f)
  ------------------
  |  Branch (365:15): [True: 96.8k, False: 291k]
  ------------------
  366|  96.8k|            ptr_harm_vec[i] = 1;
  367|  96.8k|            ptr_new_guide_vectors->ptr_guide_vec_orig[i] = ptr_quota_buf[lower_band];
  368|  96.8k|          }
  369|  1.29M|        }
  370|  4.89M|      }
  371|  4.89M|    }
  372|  23.0M|  }
  373|  1.80M|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_transient_cleanup:
  198|   166k|                                                WORD32 start, WORD32 stop) {
  199|   166k|  WORD32 sfb, band, low_band, up_band, est;
  200|       |
  201|   166k|  UWORD8 ptr_harm_vec[MAXIMUM_FREQ_COEFFS];
  202|       |
  203|   166k|  memset(ptr_harm_vec, 0, sizeof(ptr_harm_vec));
  204|       |
  205|   453k|  for (est = start; est < stop; est++) {
  ------------------
  |  Branch (205:21): [True: 286k, False: 166k]
  ------------------
  206|  3.50M|    for (sfb = 0; sfb < num_sfb - 1; sfb++) {
  ------------------
  |  Branch (206:19): [True: 3.21M, False: 286k]
  ------------------
  207|  3.21M|      ptr_harm_vec[sfb] = ptr_harm_vec[sfb] || ptr_detection_vectors[est][sfb];
  ------------------
  |  Branch (207:27): [True: 165k, False: 3.05M]
  |  Branch (207:48): [True: 320k, False: 2.73M]
  ------------------
  208|  3.21M|    }
  209|   286k|  }
  210|       |
  211|  2.07M|  for (sfb = 0; sfb < num_sfb - 1; sfb++) {
  ------------------
  |  Branch (211:17): [True: 1.90M, False: 166k]
  ------------------
  212|  1.90M|    if (ptr_harm_vec[sfb] && ptr_harm_vec[sfb + 1]) {
  ------------------
  |  Branch (212:9): [True: 320k, False: 1.58M]
  |  Branch (212:30): [True: 125k, False: 194k]
  ------------------
  213|   125k|      FLOAT32 max_val_1, max_val_2;
  214|   125k|      WORD32 maxPos1, maxPos2;
  215|       |
  216|   125k|      low_band = ptr_freq_band_tab[sfb];
  217|   125k|      up_band = ptr_freq_band_tab[sfb + 1];
  218|   125k|      maxPos1 = low_band;
  219|       |
  220|   125k|      max_val_1 = ptr_quota_buf[start][low_band];
  221|   320k|      for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (221:29): [True: 194k, False: 125k]
  ------------------
  222|   194k|        if (ptr_quota_buf[start][band] > max_val_1) {
  ------------------
  |  Branch (222:13): [True: 33.1k, False: 161k]
  ------------------
  223|  33.1k|          max_val_1 = ptr_quota_buf[start][band];
  224|  33.1k|          maxPos1 = band;
  225|  33.1k|        }
  226|   194k|      }
  227|       |
  228|   212k|      for (est = start + 1; est < stop; est++) {
  ------------------
  |  Branch (228:29): [True: 86.4k, False: 125k]
  ------------------
  229|   228k|        for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (229:31): [True: 141k, False: 86.4k]
  ------------------
  230|   141k|          if (ptr_quota_buf[est][band] > max_val_1) {
  ------------------
  |  Branch (230:15): [True: 42.6k, False: 99.1k]
  ------------------
  231|  42.6k|            max_val_1 = ptr_quota_buf[est][band];
  232|  42.6k|            maxPos1 = band;
  233|  42.6k|          }
  234|   141k|        }
  235|  86.4k|      }
  236|       |
  237|   125k|      low_band = ptr_freq_band_tab[sfb + 1];
  238|   125k|      up_band = ptr_freq_band_tab[sfb + 2];
  239|       |
  240|   125k|      maxPos2 = low_band;
  241|   125k|      max_val_2 = ptr_quota_buf[start][low_band];
  242|       |
  243|   340k|      for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (243:29): [True: 214k, False: 125k]
  ------------------
  244|   214k|        if (ptr_quota_buf[start][band] > max_val_2) {
  ------------------
  |  Branch (244:13): [True: 37.7k, False: 176k]
  ------------------
  245|  37.7k|          max_val_2 = ptr_quota_buf[start][band];
  246|  37.7k|          maxPos2 = band;
  247|  37.7k|        }
  248|   214k|      }
  249|       |
  250|   212k|      for (est = start + 1; est < stop; est++) {
  ------------------
  |  Branch (250:29): [True: 86.4k, False: 125k]
  ------------------
  251|   244k|        for (band = low_band; band < up_band; band++) {
  ------------------
  |  Branch (251:31): [True: 158k, False: 86.4k]
  ------------------
  252|   158k|          if (ptr_quota_buf[est][band] > max_val_2) {
  ------------------
  |  Branch (252:15): [True: 43.0k, False: 115k]
  ------------------
  253|  43.0k|            max_val_2 = ptr_quota_buf[est][band];
  254|  43.0k|            maxPos2 = band;
  255|  43.0k|          }
  256|   158k|        }
  257|  86.4k|      }
  258|       |
  259|   125k|      if (maxPos2 - maxPos1 < 2) {
  ------------------
  |  Branch (259:11): [True: 79.1k, False: 46.3k]
  ------------------
  260|  79.1k|        if (max_val_1 > max_val_2) {
  ------------------
  |  Branch (260:13): [True: 39.4k, False: 39.7k]
  ------------------
  261|  39.4k|          ptr_guide_vectors.ptr_guide_vector_detected[sfb + 1] = 0;
  262|  39.4k|          ptr_guide_vectors.ptr_guide_vec_orig[sfb + 1] = 0;
  263|  39.4k|          ptr_guide_vectors.ptr_guide_vec_diff[sfb + 1] = 0;
  264|       |
  265|   104k|          for (est = start; est < stop; est++) {
  ------------------
  |  Branch (265:29): [True: 64.8k, False: 39.4k]
  ------------------
  266|  64.8k|            ptr_detection_vectors[est][sfb + 1] = 0;
  267|  64.8k|          }
  268|  39.7k|        } else {
  269|  39.7k|          ptr_guide_vectors.ptr_guide_vector_detected[sfb] = 0;
  270|  39.7k|          ptr_guide_vectors.ptr_guide_vec_diff[sfb] = 0;
  271|  39.7k|          ptr_guide_vectors.ptr_guide_vec_orig[sfb] = 0;
  272|       |
  273|   101k|          for (est = start; est < stop; est++) {
  ------------------
  |  Branch (273:29): [True: 62.1k, False: 39.7k]
  ------------------
  274|  62.1k|            ptr_detection_vectors[est][sfb] = 0;
  275|  62.1k|          }
  276|  39.7k|        }
  277|  79.1k|      }
  278|   125k|    }
  279|  1.90M|  }
  280|   166k|}
ixheaace_sbr_missing_harmonics_det.c:ia_enhaacplus_enc_calculate_comp_vector:
  476|   561k|    WORD8 *ptr_prev_env_compensation, WORD32 new_detection_allowed) {
  477|   561k|  WORD32 i, j, l;
  478|       |
  479|   561k|  memset(ptr_env_compensation, 0, num_sfb * sizeof(ptr_env_compensation[0]));
  480|       |
  481|   561k|  FLOAT32 max_val;
  482|   561k|  WORD32 lower_band, upper_band;
  483|   561k|  WORD32 max_pos_band, max_pos_est;
  484|   561k|  WORD8 comp_val;
  485|       |
  486|  7.76M|  for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (486:15): [True: 7.20M, False: 561k]
  ------------------
  487|  7.20M|    if (ptr_add_harmonics_sfbs[i]) {
  ------------------
  |  Branch (487:9): [True: 631k, False: 6.56M]
  ------------------
  488|   631k|      lower_band = ptr_freq_band_tab[i];
  489|   631k|      upper_band = ptr_freq_band_tab[i + 1];
  490|       |
  491|   631k|      max_pos_band = 0;
  492|   631k|      max_pos_est = 0;
  493|   631k|      max_val = 0;
  494|       |
  495|  3.07M|      for (j = 0; j < tot_no_est; j++) {
  ------------------
  |  Branch (495:19): [True: 2.44M, False: 631k]
  ------------------
  496|  7.54M|        for (l = lower_band; l < upper_band; l++) {
  ------------------
  |  Branch (496:30): [True: 5.10M, False: 2.44M]
  ------------------
  497|  5.10M|          if (ptr_tonality[j][l] > max_val) {
  ------------------
  |  Branch (497:15): [True: 1.50M, False: 3.59M]
  ------------------
  498|  1.50M|            max_val = ptr_tonality[j][l];
  499|  1.50M|            max_pos_band = l;
  500|  1.50M|            max_pos_est = j;
  501|  1.50M|          }
  502|  5.10M|        }
  503|  2.44M|      }
  504|       |
  505|   631k|      if (max_pos_band == lower_band && i) {
  ------------------
  |  Branch (505:11): [True: 404k, False: 226k]
  |  Branch (505:41): [True: 350k, False: 54.0k]
  ------------------
  506|   350k|        comp_val =
  507|   350k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i - 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   350k|#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|   350k|#define SBR_EPS (1e-18)
  ------------------
  508|   350k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   350k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (508:13): [True: 182k, False: 168k]
  ------------------
  509|   182k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   182k|#define SBR_MAX_COMP (2)
  ------------------
  510|   182k|        }
  511|       |
  512|   350k|        if (!ptr_add_harmonics_sfbs[i - 1]) {
  ------------------
  |  Branch (512:13): [True: 288k, False: 62.0k]
  ------------------
  513|   288k|          if (ptr_tonality[max_pos_est][max_pos_band - 1] >
  ------------------
  |  Branch (513:15): [True: 159k, False: 129k]
  ------------------
  514|   288k|              SBR_TONALITY_QUOTA * ptr_tonality[max_pos_est][max_pos_band]) {
  ------------------
  |  |   51|   288k|#define SBR_TONALITY_QUOTA (0.1f)
  ------------------
  515|   159k|            ptr_env_compensation[i - 1] = -1 * comp_val;
  516|   159k|          }
  517|   288k|        }
  518|   350k|      }
  519|       |
  520|   631k|      if (max_pos_band == (upper_band - 1) && (i + 1) < num_sfb) {
  ------------------
  |  Branch (520:11): [True: 333k, False: 298k]
  |  Branch (520:47): [True: 325k, False: 7.29k]
  ------------------
  521|   325k|        comp_val =
  522|   325k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i + 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   325k|#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|   325k|#define SBR_EPS (1e-18)
  ------------------
  523|   325k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   325k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (523:13): [True: 173k, False: 152k]
  ------------------
  524|   173k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   173k|#define SBR_MAX_COMP (2)
  ------------------
  525|   173k|        }
  526|       |
  527|   325k|        if (!ptr_add_harmonics_sfbs[i + 1]) {
  ------------------
  |  Branch (527:13): [True: 280k, False: 44.9k]
  ------------------
  528|   280k|          if (ptr_tonality[max_pos_est][max_pos_band + 1] >
  ------------------
  |  Branch (528:15): [True: 138k, False: 142k]
  ------------------
  529|   280k|              SBR_TONALITY_QUOTA * ptr_tonality[max_pos_est][max_pos_band]) {
  ------------------
  |  |   51|   280k|#define SBR_TONALITY_QUOTA (0.1f)
  ------------------
  530|   138k|            ptr_env_compensation[i + 1] = comp_val;
  531|   138k|          }
  532|   280k|        }
  533|   325k|      }
  534|       |
  535|   631k|      if (i && i < (num_sfb - 1)) {
  ------------------
  |  Branch (535:11): [True: 567k, False: 63.8k]
  |  Branch (535:16): [True: 539k, False: 28.3k]
  ------------------
  536|   539k|        comp_val =
  537|   539k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i - 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   539k|#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|   539k|#define SBR_EPS (1e-18)
  ------------------
  538|   539k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   539k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (538:13): [True: 256k, False: 283k]
  ------------------
  539|   256k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   256k|#define SBR_MAX_COMP (2)
  ------------------
  540|   256k|        }
  541|       |
  542|   539k|        if (ixheaace_div32((FLOAT32)1.0f, ptr_diff[max_pos_est][i - 1]) >
  ------------------
  |  Branch (542:13): [True: 156k, False: 382k]
  ------------------
  543|   539k|            (SBR_DIFF_QUOTA * ptr_diff[max_pos_est][i])) {
  ------------------
  |  |   52|   539k|#define SBR_DIFF_QUOTA (0.75f)
  ------------------
  544|   156k|          ptr_env_compensation[i - 1] = -1 * comp_val;
  545|   156k|        }
  546|       |
  547|   539k|        comp_val =
  548|   539k|            (WORD8)(fabs(SBR_INV_LOG_2 * log(ptr_diff[max_pos_est][i + 1] + SBR_EPS)) + 0.5f);
  ------------------
  |  |   38|   539k|#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|   539k|#define SBR_EPS (1e-18)
  ------------------
  549|   539k|        if (comp_val > SBR_MAX_COMP) {
  ------------------
  |  |   50|   539k|#define SBR_MAX_COMP (2)
  ------------------
  |  Branch (549:13): [True: 238k, False: 301k]
  ------------------
  550|   238k|          comp_val = SBR_MAX_COMP;
  ------------------
  |  |   50|   238k|#define SBR_MAX_COMP (2)
  ------------------
  551|   238k|        }
  552|       |
  553|   539k|        if (ixheaace_div32((FLOAT32)1.0f, ptr_diff[max_pos_est][i + 1]) >
  ------------------
  |  Branch (553:13): [True: 171k, False: 367k]
  ------------------
  554|   539k|            (SBR_DIFF_QUOTA * ptr_diff[max_pos_est][i])) {
  ------------------
  |  |   52|   539k|#define SBR_DIFF_QUOTA (0.75f)
  ------------------
  555|   171k|          ptr_env_compensation[i + 1] = comp_val;
  556|   171k|        }
  557|   539k|      }
  558|   631k|    }
  559|  7.20M|  }
  560|       |
  561|   561k|  if (!new_detection_allowed) {
  ------------------
  |  Branch (561:7): [True: 394k, False: 166k]
  ------------------
  562|  5.52M|    for (i = 0; i < num_sfb; i++) {
  ------------------
  |  Branch (562:17): [True: 5.12M, False: 394k]
  ------------------
  563|  5.12M|      if (ptr_env_compensation[i] != 0 && ptr_prev_env_compensation[i] == 0) {
  ------------------
  |  Branch (563:11): [True: 248k, False: 4.87M]
  |  Branch (563:43): [True: 111k, False: 136k]
  ------------------
  564|   111k|        ptr_env_compensation[i] = 0;
  565|   111k|      }
  566|  5.12M|    }
  567|   394k|  }
  568|   561k|}

ixheaace_sbr_noise_floor_estimate_qmf:
  187|   561k|    WORD32 is_ld_sbr) {
  188|   561k|  WORD32 n_noise_envelopes, start_pos[2], stop_pos[2], env, band;
  189|   561k|  WORD32 num_of_noise_bands = pstr_noise_floor_est_sbr->num_of_noise_bands;
  190|   561k|  WORD32 *ptr_freq_band_tab = pstr_noise_floor_est_sbr->s_freq_qmf_band_tbl;
  191|       |
  192|   561k|  n_noise_envelopes = ptr_frame_info->n_noise_envelopes;
  193|       |
  194|   561k|  if (n_noise_envelopes == 1) {
  ------------------
  |  Branch (194:7): [True: 363k, False: 197k]
  ------------------
  195|   363k|    start_pos[0] = start_index;
  196|   363k|    stop_pos[0] = start_index + 2;
  197|   363k|  } else {
  198|   197k|    start_pos[0] = start_index;
  199|   197k|    stop_pos[0] = start_index + 1;
  200|   197k|    start_pos[1] = start_index + 1;
  201|   197k|    stop_pos[1] = start_index + 2;
  202|   197k|  }
  203|       |
  204|  1.32M|  for (env = 0; env < n_noise_envelopes; env++) {
  ------------------
  |  Branch (204:17): [True: 759k, False: 561k]
  ------------------
  205|  2.74M|    for (band = 0; band < num_of_noise_bands; band++) {
  ------------------
  |  Branch (205:20): [True: 1.98M, False: 759k]
  ------------------
  206|  1.98M|      ia_enhaacplus_enc_qmf_based_noise_floor_detection(
  207|  1.98M|          &ptr_noise_lvls[band + env * num_of_noise_bands], ptr_quota_orig,
  208|  1.98M|          pstr_noise_floor_est_sbr->weight_fac, pstr_noise_floor_est_sbr->max_level, 1.0f,
  209|  1.98M|          ptr_idx_vx, start_pos[env], stop_pos[env], ptr_freq_band_tab[band],
  210|  1.98M|          ptr_freq_band_tab[band + 1], missing_harmonics_flag,
  211|  1.98M|          pstr_noise_floor_est_sbr->thr_offset, ptr_inv_filt_levels[band]);
  212|  1.98M|    }
  213|   759k|  }
  214|       |
  215|   561k|  ia_enhaacplus_enc_smoothing_noise_levels(
  216|   561k|      ptr_noise_lvls, n_noise_envelopes, pstr_noise_floor_est_sbr->num_of_noise_bands,
  217|   561k|      pstr_noise_floor_est_sbr->prev_noise_lvls, pstr_noise_floor_est_sbr->ptr_smooth_filter,
  218|   561k|      transient_flag, is_ld_sbr);
  219|       |
  220|  1.32M|  for (env = 0; env < n_noise_envelopes; env++) {
  ------------------
  |  Branch (220:17): [True: 759k, False: 561k]
  ------------------
  221|  2.74M|    for (band = 0; band < num_of_noise_bands; band++) {
  ------------------
  |  Branch (221:20): [True: 1.98M, False: 759k]
  ------------------
  222|  1.98M|      ptr_noise_lvls[band + env * num_of_noise_bands] =
  223|  1.98M|          (FLOAT32)SBR_NOISE_FLOOR_OFFSET -
  ------------------
  |  |   37|  1.98M|#define SBR_NOISE_FLOOR_OFFSET (6)
  ------------------
  224|  1.98M|          (FLOAT32)(SBR_INV_LOG_2 * log(ptr_noise_lvls[band + env * num_of_noise_bands]));
  ------------------
  |  |   38|  1.98M|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  225|  1.98M|    }
  226|   759k|  }
  227|   561k|}
ixheaace_create_sbr_noise_floor_estimate:
  272|  8.56k|                                         ixheaace_str_qmf_tabs *ptr_qmf_tab) {
  273|  8.56k|  memset(pstr_noise_floor_est_sbr, 0, sizeof(ixheaace_str_noise_flr_est_sbr));
  274|       |
  275|  8.56k|  pstr_noise_floor_est_sbr->ptr_smooth_filter = ptr_qmf_tab->ptr_smooth_filter;
  276|       |
  277|  8.56k|  if (use_speech_config) {
  ------------------
  |  Branch (277:7): [True: 1.61k, False: 6.94k]
  ------------------
  278|  1.61k|    pstr_noise_floor_est_sbr->weight_fac = 1.0f;
  279|  1.61k|    pstr_noise_floor_est_sbr->thr_offset = IXHEAACE_INVF_LOW_LEVEL;
  280|  6.94k|  } else {
  281|  6.94k|    pstr_noise_floor_est_sbr->weight_fac = 0.25f;
  282|  6.94k|    pstr_noise_floor_est_sbr->thr_offset = IXHEAACE_INVF_MID_LEVEL;
  283|  6.94k|  }
  284|       |
  285|  8.56k|  if (ana_max_level == -3) {
  ------------------
  |  Branch (285:7): [True: 4.34k, False: 4.22k]
  ------------------
  286|  4.34k|    pstr_noise_floor_est_sbr->max_level = 0.5f;
  287|  4.34k|  } else if (ana_max_level == 3) {
  ------------------
  |  Branch (287:14): [True: 2.25k, False: 1.96k]
  ------------------
  288|  2.25k|    pstr_noise_floor_est_sbr->max_level = 2.0f;
  289|  2.25k|  } else if (ana_max_level == 6) {
  ------------------
  |  Branch (289:14): [True: 1.89k, False: 70]
  ------------------
  290|  1.89k|    pstr_noise_floor_est_sbr->max_level = 4.0f;
  291|  1.89k|  } else {
  292|     70|  }
  293|       |
  294|  8.56k|  pstr_noise_floor_est_sbr->noise_groups = noise_groups;
  295|       |
  296|  8.56k|  return ixheaace_reset_sbr_noise_floor_estimate(pstr_noise_floor_est_sbr, ptr_freq_band_tab,
  297|  8.56k|                                                 num_scf);
  298|  8.56k|}
ixheaace_reset_sbr_noise_floor_estimate:
  302|  8.56k|                                        const UWORD8 *ptr_freq_band_tab, WORD32 num_scf) {
  303|  8.56k|  WORD32 k2, kx;
  304|       |
  305|  8.56k|  k2 = ptr_freq_band_tab[num_scf];
  306|  8.56k|  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.56k|  pstr_noise_floor_est_sbr->num_of_noise_bands =
  310|  8.56k|      (WORD32)((pstr_noise_floor_est_sbr->noise_groups * log((FLOAT32)k2 / kx) * SBR_INV_LOG_2) +
  ------------------
  |  |   38|  8.56k|#define SBR_INV_LOG_2 (1.442695041f)
  ------------------
  311|  8.56k|               0.5f);
  312|       |
  313|  8.56k|  pstr_noise_floor_est_sbr->num_of_noise_bands =
  314|  8.56k|      MAX(1, pstr_noise_floor_est_sbr->num_of_noise_bands);
  ------------------
  |  |   24|  8.56k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 0, False: 8.56k]
  |  |  ------------------
  ------------------
  315|       |
  316|       |  /* ISO_IEC spec 14496-3 section 4.6.18.3.6  Requirements */
  317|  8.56k|  pstr_noise_floor_est_sbr->num_of_noise_bands =
  318|  8.56k|      MIN(pstr_noise_floor_est_sbr->num_of_noise_bands, MAXIMUM_NUM_NOISE_COEFFS);
  ------------------
  |  |   23|  8.56k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.95k, False: 606]
  |  |  ------------------
  ------------------
  319|       |
  320|  8.56k|  return ia_enhaacplus_enc_down_sample_lo_res(pstr_noise_floor_est_sbr->s_freq_qmf_band_tbl,
  321|  8.56k|                                              pstr_noise_floor_est_sbr->num_of_noise_bands,
  322|  8.56k|                                              ptr_freq_band_tab, num_scf);
  323|  8.56k|}
ixheaace_sbr_noise_floor_est.c:ia_enhaacplus_enc_qmf_based_noise_floor_detection:
  100|  1.98M|    ixheaace_invf_mode thr_offset, ixheaace_invf_mode inv_filtering_lvl) {
  101|  1.98M|  WORD32 ch, idx;
  102|  1.98M|  FLOAT32 ton_org, ton_sbr, mean_org = 0, mean_sbr = 0, diff;
  103|       |
  104|  1.98M|  if (1 == missing_harmonic_flag) {
  ------------------
  |  Branch (104:7): [True: 721k, False: 1.26M]
  ------------------
  105|  8.83M|    for (ch = start_channel; ch < stop_channel; ch++) {
  ------------------
  |  Branch (105:30): [True: 8.10M, False: 721k]
  ------------------
  106|  8.10M|      ton_org = 0;
  107|  8.10M|      ton_sbr = 0;
  108|  18.8M|      for (idx = start_index; idx < stop_index; idx++) {
  ------------------
  |  Branch (108:31): [True: 10.7M, False: 8.10M]
  ------------------
  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.10M|      ton_org /= (stop_index - start_index);
  114|  8.10M|      ton_sbr /= (stop_index - start_index);
  115|       |
  116|  8.10M|      if (ton_org > mean_org) {
  ------------------
  |  Branch (116:11): [True: 1.73M, False: 6.37M]
  ------------------
  117|  1.73M|        mean_org = ton_org;
  118|  1.73M|      }
  119|       |
  120|  8.10M|      if (ton_sbr > mean_sbr) {
  ------------------
  |  Branch (120:11): [True: 1.62M, False: 6.48M]
  ------------------
  121|  1.62M|        mean_sbr = ton_sbr;
  122|  1.62M|      }
  123|  8.10M|    }
  124|  1.26M|  } else {
  125|  15.3M|    for (ch = start_channel; ch < stop_channel; ch++) {
  ------------------
  |  Branch (125:30): [True: 14.1M, False: 1.26M]
  ------------------
  126|  14.1M|      ton_org = 0;
  127|  14.1M|      ton_sbr = 0;
  128|  36.5M|      for (idx = start_index; idx < stop_index; idx++) {
  ------------------
  |  Branch (128:31): [True: 22.3M, False: 14.1M]
  ------------------
  129|  22.3M|        ton_org += ptr_quota_orig[idx][ch];
  130|  22.3M|        ton_sbr += ptr_quota_orig[idx][ptr_idx_vx[ch]];
  131|  22.3M|      }
  132|       |
  133|  14.1M|      ton_org /= (stop_index - start_index);
  134|  14.1M|      ton_sbr /= (stop_index - start_index);
  135|       |
  136|  14.1M|      mean_org += ton_org;
  137|  14.1M|      mean_sbr += ton_sbr;
  138|  14.1M|    }
  139|  1.26M|    mean_org /= (stop_channel - start_channel);
  140|  1.26M|    mean_sbr /= (stop_channel - start_channel);
  141|  1.26M|  }
  142|       |
  143|  1.98M|  if (mean_org < SBR_TON_MEAN_P0009 && mean_sbr < SBR_TON_MEAN_P0009) {
  ------------------
  |  |   53|  3.96M|#define SBR_TON_MEAN_P0009 (0.000976562f)
  ------------------
                if (mean_org < SBR_TON_MEAN_P0009 && mean_sbr < SBR_TON_MEAN_P0009) {
  ------------------
  |  |   53|   370k|#define SBR_TON_MEAN_P0009 (0.000976562f)
  ------------------
  |  Branch (143:7): [True: 370k, False: 1.61M]
  |  Branch (143:40): [True: 323k, False: 47.5k]
  ------------------
  144|   323k|    mean_org = mean_sbr = SBR_TON_MEAN_101P59;
  ------------------
  |  |   54|   323k|#define SBR_TON_MEAN_101P59 (101.5936673f)
  ------------------
  145|   323k|  }
  146|       |
  147|  1.98M|  if (mean_org < 1.0f) {
  ------------------
  |  Branch (147:7): [True: 345k, False: 1.63M]
  ------------------
  148|   345k|    mean_org = 1.0f;
  149|   345k|  }
  150|       |
  151|  1.98M|  if (mean_sbr < 1.0f) {
  ------------------
  |  Branch (151:7): [True: 441k, False: 1.54M]
  ------------------
  152|   441k|    mean_sbr = 1.0f;
  153|   441k|  }
  154|       |
  155|  1.98M|  if (1 == missing_harmonic_flag) {
  ------------------
  |  Branch (155:7): [True: 721k, False: 1.26M]
  ------------------
  156|   721k|    diff = 1.0f;
  157|  1.26M|  } else {
  158|  1.26M|    if (1.0f > (weight_fac * mean_sbr / mean_org)) {
  ------------------
  |  Branch (158:9): [True: 1.12M, False: 136k]
  ------------------
  159|  1.12M|      diff = 1.0f;
  160|  1.12M|    } else {
  161|   136k|      diff = weight_fac * mean_sbr / mean_org;
  162|   136k|    }
  163|  1.26M|  }
  164|       |
  165|  1.98M|  if (inv_filtering_lvl == IXHEAACE_INVF_MID_LEVEL ||
  ------------------
  |  Branch (165:7): [True: 83.5k, False: 1.89M]
  ------------------
  166|  1.94M|      inv_filtering_lvl == IXHEAACE_INVF_LOW_LEVEL || inv_filtering_lvl == IXHEAACE_INVF_OFF) {
  ------------------
  |  Branch (166:7): [True: 102k, False: 1.79M]
  |  Branch (166:55): [True: 1.76M, False: 34.5k]
  ------------------
  167|  1.94M|    diff = 1.0f;
  168|  1.94M|  }
  169|       |
  170|  1.98M|  if (inv_filtering_lvl <= thr_offset) {
  ------------------
  |  Branch (170:7): [True: 1.94M, False: 37.4k]
  ------------------
  171|  1.94M|    diff = 1.0f;
  172|  1.94M|  }
  173|       |
  174|  1.98M|  *ptr_noise_lvl = diff / mean_org;
  175|  1.98M|  *ptr_noise_lvl *= noise_floor_offset;
  176|       |
  177|  1.98M|  if (*ptr_noise_lvl > max_lvl) {
  ------------------
  |  Branch (177:7): [True: 417k, False: 1.56M]
  ------------------
  178|   417k|    *ptr_noise_lvl = max_lvl;
  179|   417k|  }
  180|  1.98M|}
ixheaace_sbr_noise_floor_est.c:ia_enhaacplus_enc_smoothing_noise_levels:
   59|   561k|    const FLOAT32 *ptr_smooth_filter, WORD32 transient_flag, WORD32 is_ld_sbr) {
   60|   561k|  WORD32 i, band, env;
   61|       |
   62|  1.32M|  for (env = 0; env < num_env; env++) {
  ------------------
  |  Branch (62:17): [True: 759k, False: 561k]
  ------------------
   63|   759k|    if (is_ld_sbr) {
  ------------------
  |  Branch (63:9): [True: 151k, False: 607k]
  ------------------
   64|   151k|      if (transient_flag) {
  ------------------
  |  Branch (64:11): [True: 70.0k, False: 81.7k]
  ------------------
   65|   350k|        for (i = 0; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|   350k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (65:21): [True: 280k, False: 70.0k]
  ------------------
   66|   280k|          memcpy(prev_noise_lvls[i], ptr_noise_lvls + env * num_noise_bands,
   67|   280k|                 num_noise_bands * sizeof(prev_noise_lvls[i][0]));
   68|   280k|        }
   69|  81.7k|      } else {
   70|   326k|        for (i = 1; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|   326k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (70:21): [True: 245k, False: 81.7k]
  ------------------
   71|   245k|          memcpy(prev_noise_lvls[i - 1], prev_noise_lvls[i],
   72|   245k|                 num_noise_bands * sizeof(prev_noise_lvls[i - 1][0]));
   73|   245k|        }
   74|  81.7k|      }
   75|   607k|    } else {
   76|  2.43M|      for (i = 1; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|  2.43M|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (76:19): [True: 1.82M, False: 607k]
  ------------------
   77|  1.82M|        memcpy(prev_noise_lvls[i - 1], prev_noise_lvls[i],
   78|  1.82M|               num_noise_bands * sizeof(prev_noise_lvls[i - 1][0]));
   79|  1.82M|      }
   80|   607k|    }
   81|   759k|    memcpy(prev_noise_lvls[IXHEAACE_NF_SMOOTHING_LENGTH - 1],
  ------------------
  |  |   23|   759k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
   82|   759k|           ptr_noise_lvls + env * num_noise_bands,
   83|   759k|           num_noise_bands * sizeof(prev_noise_lvls[IXHEAACE_NF_SMOOTHING_LENGTH - 1][0]));
  ------------------
  |  |   23|   759k|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
   84|       |
   85|  2.74M|    for (band = 0; band < num_noise_bands; band++) {
  ------------------
  |  Branch (85:20): [True: 1.98M, False: 759k]
  ------------------
   86|  1.98M|      ptr_noise_lvls[band + env * num_noise_bands] = 0;
   87|       |
   88|  9.91M|      for (i = 0; i < IXHEAACE_NF_SMOOTHING_LENGTH; i++) {
  ------------------
  |  |   23|  9.91M|#define IXHEAACE_NF_SMOOTHING_LENGTH (4)
  ------------------
  |  Branch (88:19): [True: 7.93M, False: 1.98M]
  ------------------
   89|  7.93M|        ptr_noise_lvls[band + env * num_noise_bands] +=
   90|  7.93M|            ptr_smooth_filter[i] * prev_noise_lvls[i][band];
   91|  7.93M|      }
   92|  1.98M|    }
   93|   759k|  }
   94|   561k|}
ixheaace_sbr_noise_floor_est.c:ia_enhaacplus_enc_down_sample_lo_res:
  231|  8.56k|                                                         WORD32 num_ref) {
  232|  8.56k|  WORD32 step;
  233|  8.56k|  WORD32 i, j;
  234|  8.56k|  WORD32 org_length, result_length;
  235|  8.56k|  WORD32 v_index[MAXIMUM_FREQ_COEFFS / 2];
  236|       |
  237|  8.56k|  org_length = num_ref;
  238|  8.56k|  result_length = num_result;
  239|       |
  240|  8.56k|  v_index[0] = 0;
  241|       |
  242|  8.56k|  i = 0;
  243|       |
  244|  30.7k|  while (org_length > 0) {
  ------------------
  |  Branch (244:10): [True: 22.2k, False: 8.56k]
  ------------------
  245|  22.2k|    i++;
  246|       |
  247|  22.2k|    step = org_length / result_length;
  248|       |
  249|  22.2k|    org_length = org_length - step;
  250|       |
  251|  22.2k|    result_length--;
  252|       |
  253|  22.2k|    v_index[i] = v_index[i - 1] + step;
  254|  22.2k|  }
  255|       |
  256|  8.56k|  if (i != num_result) {
  ------------------
  |  Branch (256:7): [True: 0, False: 8.56k]
  ------------------
  257|      0|    return IA_EXEHAACE_INIT_FATAL_SBR_NOISE_BAND_NOT_SUPPORTED;
  258|      0|  }
  259|       |
  260|  39.3k|  for (j = 0; j <= i; j++) {
  ------------------
  |  Branch (260:15): [True: 30.7k, False: 8.56k]
  ------------------
  261|  30.7k|    ptr_result[j] = ptr_freq_band_tab_ref[v_index[j]];
  262|  30.7k|  }
  263|       |
  264|  8.56k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  8.56k|#define IA_NO_ERROR 0x00000000
  ------------------
  265|  8.56k|}

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

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

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

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

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

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

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

iaace_calc_form_fac_per_chan:
   56|   438k|                                  FLOAT32 *ptr_sfb_ld_energy) {
   57|   438k|  WORD32 i, j, sfb_offs;
   58|   438k|  WORD32 sfb, sfb_width;
   59|       |
   60|   438k|  memset(ptr_sfb_num_relevant_lines, 0,
   61|   438k|         sizeof(*ptr_sfb_num_relevant_lines) * pstr_psy_out_chan->sfb_count);
   62|       |
   63|   438k|  memset(ptr_sfb_ld_energy, 0, sizeof(*ptr_sfb_ld_energy) * pstr_psy_out_chan->sfb_count);
   64|       |
   65|  1.10M|  for (sfb_offs = 0; sfb_offs < pstr_psy_out_chan->sfb_count;
  ------------------
  |  Branch (65:22): [True: 671k, False: 438k]
  ------------------
   66|   671k|       sfb_offs += pstr_psy_out_chan->sfb_per_group) {
   67|   671k|    i = sfb_offs;
   68|  12.7M|    for (sfb = 0; sfb < pstr_psy_out_chan->max_sfb_per_grp; sfb++, i++) {
  ------------------
  |  Branch (68:19): [True: 12.0M, False: 671k]
  ------------------
   69|  12.0M|      ptr_sfb_form_factor[i] = MIN_FLT_VAL;
  ------------------
  |  |   58|  12.0M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
   70|  12.0M|      if (pstr_psy_out_chan->ptr_sfb_energy[i] > pstr_psy_out_chan->ptr_sfb_thr[i]) {
  ------------------
  |  Branch (70:11): [True: 7.48M, False: 4.58M]
  ------------------
   71|  7.48M|        FLOAT32 avg_form_factor;
   72|       |
   73|   105M|        for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (73:53): [True: 97.9M, False: 7.48M]
  ------------------
   74|  97.9M|             j++) {
   75|  97.9M|          ptr_sfb_form_factor[i] += (FLOAT32)sqrt(fabs(pstr_psy_out_chan->ptr_spec_coeffs[j]));
   76|  97.9M|        }
   77|       |
   78|  7.48M|        sfb_width = pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i];
   79|  7.48M|        avg_form_factor =
   80|  7.48M|            (FLOAT32)pow(pstr_psy_out_chan->ptr_sfb_energy[i] / (FLOAT32)sfb_width, 0.25f);
   81|  7.48M|        ptr_sfb_num_relevant_lines[i] = ptr_sfb_form_factor[i] / avg_form_factor;
   82|  7.48M|        ptr_sfb_ld_energy[i] = (FLOAT32)(log(pstr_psy_out_chan->ptr_sfb_energy[i]) * LOG2_1);
  ------------------
  |  |   23|  7.48M|#define LOG2_1 1.442695041f /* 1/log(2) */
  ------------------
   83|  7.48M|      }
   84|  12.0M|    }
   85|   671k|  }
   86|   438k|}
iaace_estimate_scfs_chan:
  628|   300k|    WORD32 chn, WORD32 frame_len_long) {
  629|   300k|  WORD16 *ptr_scalefactor;
  630|   300k|  WORD32 *global_gain;
  631|   300k|  FLOAT32 *ptr_sfb_form_factor;
  632|   300k|  FLOAT32 *ptr_sfb_num_relevant_lines_ch;
  633|   300k|  WORD16 *ptr_quant_spec;
  634|   300k|  WORD32 i, ch, j;
  635|   300k|  FLOAT32 thresh, energy, energy_part, thr_part;
  636|   300k|  FLOAT32 scf_float;
  637|   300k|  WORD16 scf_int = 0, min_scf = 0, max_scf = 0;
  638|   300k|  FLOAT32 max_spec = 0.0f;
  639|   300k|  WORD16 min_sf_max_quant[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  640|   300k|  FLOAT32 sfb_dist[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  641|   300k|  WORD16 min_calc_scf[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  642|   300k|  WORD16 quant_spec_temp[FRAME_LEN_1024];
  643|   300k|  FLOAT32 ptr_exp_spec[FRAME_LEN_1024];
  644|   300k|  FLOAT32 ptr_mdct_spec[FRAME_LEN_1024];
  645|       |
  646|   300k|  memset(quant_spec_temp, 0, frame_len_long * sizeof(quant_spec_temp[0]));
  647|   300k|  memset(ptr_mdct_spec, 0, frame_len_long * sizeof(ptr_mdct_spec[0]));
  648|   300k|  memset(ptr_exp_spec, 0, frame_len_long * sizeof(ptr_exp_spec[0]));
  649|       |
  650|   738k|  for (ch = chn; ch < chn + num_channels; ch++) {
  ------------------
  |  Branch (650:18): [True: 438k, False: 300k]
  ------------------
  651|   438k|    ixheaace_psy_out_channel *pstr_psy_out_chan = pstr_psy_out[ch];
  652|   438k|    pstr_qc_out_chan[ch]->global_gain = 0;
  653|       |
  654|   438k|    memset(pstr_qc_out_chan[ch]->scalefactor, 0,
  655|   438k|           sizeof(*pstr_qc_out_chan[ch]->scalefactor) * pstr_psy_out[ch]->sfb_count);
  656|   438k|    memset(pstr_qc_out_chan[ch]->quant_spec, 0,
  657|   438k|           sizeof(*pstr_qc_out_chan[ch]->quant_spec) * frame_len_long);
  658|       |
  659|   438k|    ptr_scalefactor = pstr_qc_out_chan[ch]->scalefactor;
  660|   438k|    global_gain = &pstr_qc_out_chan[ch]->global_gain;
  661|   438k|    ptr_sfb_form_factor = &sfb_form_factor_ch[ch][0];
  662|   438k|    ptr_sfb_num_relevant_lines_ch = &sfb_num_relevant_lines_ch[ch][0];
  663|   438k|    ptr_quant_spec = pstr_qc_out_chan[ch]->quant_spec;
  664|       |
  665|  17.9M|    for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (665:17): [True: 17.4M, False: 438k]
  ------------------
  666|  17.4M|      thresh = pstr_psy_out_chan->ptr_sfb_thr[i];
  667|  17.4M|      energy = pstr_psy_out_chan->ptr_sfb_energy[i];
  668|  17.4M|      max_spec = 0.0f;
  669|       |
  670|   351M|      for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (670:51): [True: 334M, False: 17.4M]
  ------------------
  671|   334M|           j++) {
  672|   334M|        max_spec = (FLOAT32)MAX(max_spec, fabsf(pstr_psy_out_chan->ptr_spec_coeffs[j]));
  ------------------
  |  |   24|   334M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 110M, False: 223M]
  |  |  ------------------
  ------------------
  673|   334M|      }
  674|       |
  675|  17.4M|      ptr_scalefactor[i] = MIN_SHRT_VAL;
  ------------------
  |  |   59|  17.4M|#define MIN_SHRT_VAL (-32768)
  ------------------
  676|  17.4M|      min_sf_max_quant[i] = MIN_SHRT_VAL;
  ------------------
  |  |   59|  17.4M|#define MIN_SHRT_VAL (-32768)
  ------------------
  677|       |
  678|  17.4M|      if ((max_spec > 0.0) && (energy > thresh) && (ptr_sfb_form_factor[i] != MIN_FLT_VAL)) {
  ------------------
  |  |   58|  6.67M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (678:11): [True: 9.82M, False: 7.64M]
  |  Branch (678:31): [True: 6.67M, False: 3.15M]
  |  Branch (678:52): [True: 6.66M, False: 5.92k]
  ------------------
  679|  6.66M|        energy_part = (FLOAT32)log10(ptr_sfb_form_factor[i]);
  680|       |
  681|  6.66M|        thr_part = (FLOAT32)log10(6.75 * thresh + MIN_FLT_VAL);
  ------------------
  |  |   58|  6.66M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  682|  6.66M|        scf_float = 8.8585f * (thr_part - energy_part);
  683|  6.66M|        scf_int = (WORD16)floor(scf_float);
  684|  6.66M|        min_sf_max_quant[i] = (WORD16)floor(C1_SF + C2_SF * log(max_spec));
  ------------------
  |  |   77|  6.66M|#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|  6.66M|#define C2_SF 5.77078f   /* 4/log(2) */
  ------------------
  685|  6.66M|        scf_int = MAX(scf_int, min_sf_max_quant[i]);
  ------------------
  |  |   24|  6.66M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 6.66M, False: 339]
  |  |  ------------------
  ------------------
  686|  6.66M|        scf_int = MAX(scf_int, MIN_GAIN_INDEX_AAC);
  ------------------
  |  |   24|  6.66M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 6.66M, False: 0]
  |  |  ------------------
  ------------------
  687|  6.66M|        scf_int = MIN(scf_int, (MAX_GAIN_INDEX_AAC - SCF_COUNT_LIMIT_AAC - 1));
  ------------------
  |  |   23|  6.66M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 6.66M, False: 0]
  |  |  ------------------
  ------------------
  688|  93.3M|        for (j = 0; j < pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i];
  ------------------
  |  Branch (688:21): [True: 86.7M, False: 6.66M]
  ------------------
  689|  86.7M|             j++) {
  690|  86.7M|          ptr_exp_spec[pstr_psy_out_chan->sfb_offsets[i] + j] = (FLOAT32)(
  691|  86.7M|              pstr_psy_out_chan->ptr_spec_coeffs[pstr_psy_out_chan->sfb_offsets[i] + j]);
  692|  86.7M|          ptr_mdct_spec[pstr_psy_out_chan->sfb_offsets[i] + j] = (FLOAT32)(
  693|  86.7M|              pstr_psy_out_chan->ptr_spec_coeffs[pstr_psy_out_chan->sfb_offsets[i] + j]);
  694|  86.7M|        }
  695|       |
  696|  6.66M|        iaace_calculate_exp_spec(
  697|  6.66M|            pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i],
  698|  6.66M|            ptr_exp_spec + pstr_psy_out_chan->sfb_offsets[i],
  699|  6.66M|            ptr_mdct_spec + pstr_psy_out_chan->sfb_offsets[i]);
  700|       |
  701|  6.66M|        scf_int = iaace_improve_scf(
  702|  6.66M|            ptr_mdct_spec + pstr_psy_out_chan->sfb_offsets[i],
  703|  6.66M|            ptr_exp_spec + pstr_psy_out_chan->sfb_offsets[i],
  704|  6.66M|            ptr_quant_spec + pstr_psy_out_chan->sfb_offsets[i],
  705|  6.66M|            quant_spec_temp + pstr_psy_out_chan->sfb_offsets[i],
  706|  6.66M|            pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i], thresh,
  707|  6.66M|            scf_int, min_sf_max_quant[i], &sfb_dist[i], &min_calc_scf[i]);
  708|       |
  709|  6.66M|        ptr_scalefactor[i] = scf_int;
  710|  6.66M|      }
  711|  17.4M|    }
  712|       |
  713|   438k|    {
  714|   438k|      FLOAT32 sfb_const_pe_part[MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  715|       |
  716|  17.9M|      for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (716:19): [True: 17.4M, False: 438k]
  ------------------
  717|  17.4M|        sfb_const_pe_part[i] = MIN_FLT_VAL;
  ------------------
  |  |   58|  17.4M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  718|  17.4M|      }
  719|       |
  720|   438k|      iaace_assimilate_single_scf(pstr_psy_out_chan, ptr_exp_spec, ptr_quant_spec,
  721|   438k|                                  quant_spec_temp, ptr_scalefactor, min_sf_max_quant, sfb_dist,
  722|   438k|                                  sfb_const_pe_part, ptr_sfb_form_factor,
  723|   438k|                                  ptr_sfb_num_relevant_lines_ch, min_calc_scf, ptr_mdct_spec);
  724|       |
  725|   438k|      iaace_assimilate_multiple_scf(pstr_psy_out_chan, ptr_exp_spec, ptr_quant_spec,
  726|   438k|                                    quant_spec_temp, ptr_scalefactor, min_sf_max_quant, sfb_dist,
  727|   438k|                                    sfb_const_pe_part, ptr_sfb_form_factor,
  728|   438k|                                    ptr_sfb_num_relevant_lines_ch, ptr_mdct_spec);
  729|   438k|    }
  730|       |
  731|   438k|    max_scf = MIN_SHRT_VAL;
  ------------------
  |  |   59|   438k|#define MIN_SHRT_VAL (-32768)
  ------------------
  732|   438k|    min_scf = MAX_SHRT_VAL;
  ------------------
  |  |   60|   438k|#define MAX_SHRT_VAL (32767)
  ------------------
  733|  17.9M|    for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (733:17): [True: 17.4M, False: 438k]
  ------------------
  734|  17.4M|      if (max_scf < ptr_scalefactor[i]) {
  ------------------
  |  Branch (734:11): [True: 536k, False: 16.9M]
  ------------------
  735|   536k|        max_scf = ptr_scalefactor[i];
  736|   536k|      }
  737|  17.4M|      if ((ptr_scalefactor[i] != MIN_SHRT_VAL) && (min_scf > ptr_scalefactor[i])) {
  ------------------
  |  |   59|  17.4M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (737:11): [True: 6.66M, False: 10.8M]
  |  Branch (737:51): [True: 1.34M, False: 5.32M]
  ------------------
  738|  1.34M|        min_scf = ptr_scalefactor[i];
  739|  1.34M|      }
  740|  17.4M|    }
  741|       |
  742|  17.9M|    for (i = 0; i < pstr_psy_out[ch]->sfb_count; i++) {
  ------------------
  |  Branch (742:17): [True: 17.4M, False: 438k]
  ------------------
  743|  17.4M|      if ((ptr_scalefactor[i] != MIN_SHRT_VAL) &&
  ------------------
  |  |   59|  17.4M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (743:11): [True: 6.66M, False: 10.8M]
  ------------------
  744|  6.66M|          (min_scf + MAX_SCF_DELTA) < ptr_scalefactor[i]) {
  ------------------
  |  |   74|  6.66M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (744:11): [True: 8.97k, False: 6.65M]
  ------------------
  745|  8.97k|        ptr_scalefactor[i] = min_scf + MAX_SCF_DELTA;
  ------------------
  |  |   74|  8.97k|#define MAX_SCF_DELTA 60
  ------------------
  746|       |
  747|  8.97k|        iaace_calc_sfb_dist(
  748|  8.97k|            ptr_mdct_spec + pstr_psy_out_chan->sfb_offsets[i],
  749|  8.97k|            ptr_exp_spec + pstr_psy_out_chan->sfb_offsets[i],
  750|  8.97k|            ptr_quant_spec + pstr_psy_out_chan->sfb_offsets[i],
  751|  8.97k|            pstr_psy_out_chan->sfb_offsets[i + 1] - pstr_psy_out_chan->sfb_offsets[i],
  752|  8.97k|            ptr_scalefactor[i]);
  753|  8.97k|      }
  754|  17.4M|    }
  755|       |
  756|   438k|    max_scf = MIN((min_scf + MAX_SCF_DELTA), max_scf);
  ------------------
  |  |   23|   438k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 7.04k, False: 431k]
  |  |  ------------------
  ------------------
  757|       |
  758|   438k|    if (max_scf > MIN_SHRT_VAL) {
  ------------------
  |  |   59|   438k|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (758:9): [True: 271k, False: 166k]
  ------------------
  759|   271k|      *global_gain = max_scf;
  760|  11.3M|      for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (760:19): [True: 11.0M, False: 271k]
  ------------------
  761|  11.0M|        if (ptr_scalefactor[i] == MIN_SHRT_VAL) {
  ------------------
  |  |   59|  11.0M|#define MIN_SHRT_VAL (-32768)
  ------------------
  |  Branch (761:13): [True: 4.37M, False: 6.66M]
  ------------------
  762|  4.37M|          ptr_scalefactor[i] = 0;
  763|   127M|          for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (763:55): [True: 122M, False: 4.37M]
  ------------------
  764|   122M|               j++) {
  765|   122M|            pstr_psy_out_chan->ptr_spec_coeffs[j] = 0.0f;
  766|   122M|          }
  767|  6.66M|        } else {
  768|  6.66M|          ptr_scalefactor[i] = max_scf - ptr_scalefactor[i];
  769|  6.66M|        }
  770|  11.0M|      }
  771|   271k|    } else {
  772|   166k|      *global_gain = 0;
  773|  6.59M|      for (i = 0; i < pstr_psy_out_chan->sfb_count; i++) {
  ------------------
  |  Branch (773:19): [True: 6.43M, False: 166k]
  ------------------
  774|  6.43M|        ptr_scalefactor[i] = 0;
  775|   131M|        for (j = pstr_psy_out_chan->sfb_offsets[i]; j < pstr_psy_out_chan->sfb_offsets[i + 1];
  ------------------
  |  Branch (775:53): [True: 124M, False: 6.43M]
  ------------------
  776|   124M|             j++) {
  777|   124M|          pstr_psy_out_chan->ptr_spec_coeffs[j] = 0.0f;
  778|   124M|        }
  779|  6.43M|      }
  780|   166k|    }
  781|   438k|  }
  782|   300k|}
ixheaace_sf_estimation.c:iaace_calculate_exp_spec:
   89|  6.66M|                                     FLOAT32 *ptr_ptr_mdct_spec) {
   90|  6.66M|  WORD32 line;
   91|       |
   92|  93.3M|  for (line = 0; line < num_lines; line++) {
  ------------------
  |  Branch (92:18): [True: 86.7M, False: 6.66M]
  ------------------
   93|  86.7M|    FLOAT32 tmp = ptr_ptr_mdct_spec[line];
   94|  86.7M|    ptr_exp_spec[line] = (FLOAT32)sqrt(fabs(tmp));
   95|  86.7M|    ptr_exp_spec[line] *= (FLOAT32)sqrt(ptr_exp_spec[line]);
   96|  86.7M|  }
   97|  6.66M|}
ixheaace_sf_estimation.c:iaace_improve_scf:
  253|  6.66M|                                WORD16 *ptr_min_calc_scf) {
  254|  6.66M|  FLOAT32 sfb_dist;
  255|  6.66M|  WORD16 best_scf = scf;
  256|  6.66M|  WORD32 j;
  257|       |
  258|  6.66M|  sfb_dist = iaace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec, sfb_width, scf);
  259|       |
  260|  6.66M|  *ptr_min_calc_scf = scf;
  261|       |
  262|  6.66M|  if (sfb_dist > (1.25 * threshold)) {
  ------------------
  |  Branch (262:7): [True: 1.21M, False: 5.45M]
  ------------------
  263|  1.21M|    FLOAT32 best_sfb_dist = sfb_dist;
  264|       |
  265|  1.21M|    if (scf > min_scf) {
  ------------------
  |  Branch (265:9): [True: 1.21M, False: 320]
  ------------------
  266|  1.21M|      scf--;
  267|       |
  268|  1.21M|      sfb_dist = iaace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
  269|       |
  270|  1.21M|      if (sfb_dist < best_sfb_dist) {
  ------------------
  |  Branch (270:11): [True: 1.09M, False: 119k]
  ------------------
  271|  1.09M|        best_scf = scf;
  272|  1.09M|        best_sfb_dist = sfb_dist;
  273|       |
  274|  12.4M|        for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (274:21): [True: 11.3M, False: 1.09M]
  ------------------
  275|  11.3M|          ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  276|  11.3M|        }
  277|  1.09M|      }
  278|       |
  279|  1.21M|      *ptr_min_calc_scf = scf;
  280|  1.21M|    }
  281|  1.21M|    *dist = best_sfb_dist;
  282|  5.45M|  } else {
  283|  5.45M|    FLOAT32 best_sfb_dist = sfb_dist;
  284|  5.45M|    FLOAT32 allowed_sfb_dist = MIN(sfb_dist * 1.25f, threshold);
  ------------------
  |  |   23|  5.45M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 2.14M, False: 3.30M]
  |  |  ------------------
  ------------------
  285|  5.45M|    WORD32 count;
  286|       |
  287|  16.3M|    for (count = SCF_COUNT_LIMIT_AAC; count >= 0; count--) {
  ------------------
  |  |   88|  5.45M|#define SCF_COUNT_LIMIT_AAC (1)
  ------------------
  |  Branch (287:39): [True: 10.9M, False: 5.45M]
  ------------------
  288|  10.9M|      scf++;
  289|       |
  290|  10.9M|      sfb_dist = iaace_calc_sfb_dist(ptr_spec, ptr_exp_spec, ptr_quant_spec_temp, sfb_width, scf);
  291|       |
  292|  10.9M|      if (sfb_dist < allowed_sfb_dist) {
  ------------------
  |  Branch (292:11): [True: 1.54M, False: 9.36M]
  ------------------
  293|  1.54M|        *ptr_min_calc_scf = best_scf + 1;
  294|       |
  295|  1.54M|        best_scf = scf;
  296|  1.54M|        best_sfb_dist = sfb_dist;
  297|       |
  298|  20.9M|        for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (298:21): [True: 19.4M, False: 1.54M]
  ------------------
  299|  19.4M|          ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  300|  19.4M|        }
  301|  1.54M|      }
  302|  10.9M|    }
  303|  5.45M|    *dist = best_sfb_dist;
  304|  5.45M|  }
  305|       |
  306|  93.3M|  for (j = 0; j < sfb_width; j++) {
  ------------------
  |  Branch (306:15): [True: 86.7M, False: 6.66M]
  ------------------
  307|  86.7M|    if (ptr_spec[j] < 0) {
  ------------------
  |  Branch (307:9): [True: 42.1M, False: 44.5M]
  ------------------
  308|  42.1M|      ptr_quant_spec[j] = -ptr_quant_spec[j];
  309|  42.1M|    }
  310|  86.7M|  }
  311|       |
  312|  6.66M|  return best_scf;
  313|  6.66M|}
ixheaace_sf_estimation.c:iaace_assimilate_single_scf:
  321|   438k|                                        FLOAT32 *ptr_ptr_mdct_spec) {
  322|   438k|  WORD32 sfb_prev, sfb_act, sfb_next;
  323|   438k|  WORD16 scf_act = 0, *scf_prev, *scf_next, min_scf, max_scf;
  324|   438k|  WORD32 sfb_width, sfb_offs;
  325|   438k|  FLOAT32 energy;
  326|   438k|  FLOAT32 sfb_pe_prev, sfb_pe_new;
  327|   438k|  FLOAT32 sfb_dist_new;
  328|   438k|  WORD32 j;
  329|   438k|  WORD32 success = 0;
  330|   438k|  FLOAT32 delta_pe = 0.0f, delta_pe_new, delta_pe_temp;
  331|   438k|  WORD16 prev_scf_last[MAXIMUM_GROUPED_SCALE_FACTOR_BAND],
  332|   438k|      prev_scf_next[MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  333|   438k|  FLOAT32 delta_pe_last[MAXIMUM_GROUPED_SCALE_FACTOR_BAND];
  334|   438k|  WORD32 update_min_scf;
  335|       |
  336|  17.9M|  for (j = 0; j < pstr_psy_out->sfb_count; j++) {
  ------------------
  |  Branch (336:15): [True: 17.4M, False: 438k]
  ------------------
  337|  17.4M|    prev_scf_last[j] = SHRT_MAX;
  338|  17.4M|    prev_scf_next[j] = SHRT_MAX;
  339|  17.4M|    delta_pe_last[j] = MAX_FLT_VAL;
  ------------------
  |  |   57|  17.4M|#define MAX_FLT_VAL (3.402823466e+38F)
  ------------------
  340|  17.4M|  }
  341|       |
  342|   438k|  sfb_prev = -1;
  343|   438k|  sfb_act = -1;
  344|   438k|  sfb_next = -1;
  345|   438k|  scf_prev = 0;
  346|   438k|  scf_next = 0;
  347|   438k|  min_scf = SHRT_MAX;
  348|   438k|  max_scf = SHRT_MAX;
  349|       |
  350|  40.5M|  do {
  351|  40.5M|    sfb_next++;
  352|       |
  353|  58.5M|    while ((sfb_next < pstr_psy_out->sfb_count) && (ptr_scf[sfb_next] == SHRT_MIN)) {
  ------------------
  |  Branch (353:12): [True: 58.1M, False: 481k]
  |  Branch (353:52): [True: 18.0M, False: 40.0M]
  ------------------
  354|  18.0M|      sfb_next++;
  355|  18.0M|    }
  356|       |
  357|  40.5M|    if ((sfb_prev >= 0) && (sfb_act >= 0) && (sfb_next < pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (357:9): [True: 33.4M, False: 7.08M]
  |  Branch (357:28): [True: 33.4M, False: 0]
  |  Branch (357:46): [True: 33.1M, False: 307k]
  ------------------
  358|  33.1M|      scf_act = ptr_scf[sfb_act];
  359|       |
  360|  33.1M|      scf_prev = ptr_scf + sfb_prev;
  361|  33.1M|      scf_next = ptr_scf + sfb_next;
  362|       |
  363|  33.1M|      min_scf = MIN(*scf_prev, *scf_next);
  ------------------
  |  |   23|  33.1M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 8.16M, False: 24.9M]
  |  |  ------------------
  ------------------
  364|       |
  365|  33.1M|      max_scf = MAX(*scf_prev, *scf_next);
  ------------------
  |  |   24|  33.1M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 15.6M, False: 17.4M]
  |  |  ------------------
  ------------------
  366|  33.1M|    } else {
  367|  7.39M|      if ((sfb_prev == -1) && (sfb_act >= 0) && (sfb_next < pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (367:11): [True: 7.08M, False: 307k]
  |  Branch (367:31): [True: 3.46M, False: 3.62M]
  |  Branch (367:49): [True: 3.45M, False: 7.47k]
  ------------------
  368|  3.45M|        scf_act = ptr_scf[sfb_act];
  369|       |
  370|  3.45M|        scf_prev = &scf_act;
  371|       |
  372|  3.45M|        scf_next = ptr_scf + sfb_next;
  373|       |
  374|  3.45M|        min_scf = *scf_next;
  375|       |
  376|  3.45M|        max_scf = *scf_next;
  377|  3.94M|      } else {
  378|  3.94M|        if ((sfb_prev >= 0) && (sfb_act >= 0) && (sfb_next == pstr_psy_out->sfb_count)) {
  ------------------
  |  Branch (378:13): [True: 307k, False: 3.63M]
  |  Branch (378:32): [True: 307k, False: 0]
  |  Branch (378:50): [True: 307k, False: 0]
  ------------------
  379|   307k|          scf_act = ptr_scf[sfb_act];
  380|       |
  381|   307k|          scf_prev = ptr_scf + sfb_prev;
  382|       |
  383|   307k|          scf_next = &scf_act;
  384|       |
  385|   307k|          min_scf = *scf_prev;
  386|       |
  387|   307k|          max_scf = *scf_prev;
  388|   307k|        }
  389|  3.94M|      }
  390|  7.39M|    }
  391|       |
  392|  40.5M|    if (sfb_act >= 0) {
  ------------------
  |  Branch (392:9): [True: 36.8M, False: 3.62M]
  ------------------
  393|  36.8M|      min_scf = MAX(min_scf, ptr_min_scf[sfb_act]);
  ------------------
  |  |   24|  36.8M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 36.8M, False: 71.8k]
  |  |  ------------------
  ------------------
  394|  36.8M|    }
  395|       |
  396|  40.5M|    if ((sfb_act >= 0) && (sfb_prev >= 0 || sfb_next < pstr_psy_out->sfb_count) &&
  ------------------
  |  Branch (396:9): [True: 36.8M, False: 3.62M]
  |  Branch (396:28): [True: 33.4M, False: 3.46M]
  |  Branch (396:45): [True: 3.45M, False: 7.47k]
  ------------------
  397|  36.8M|        (scf_act > min_scf) && (scf_act <= min_scf + MAX_SCF_DELTA) &&
  ------------------
  |  |   74|  16.8M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (397:9): [True: 16.8M, False: 20.0M]
  |  Branch (397:32): [True: 16.8M, False: 53.2k]
  ------------------
  398|  16.8M|        (scf_act >= max_scf - MAX_SCF_DELTA) &&
  ------------------
  |  |   74|  16.8M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (398:9): [True: 16.7M, False: 46.7k]
  ------------------
  399|  16.7M|        (*scf_prev != prev_scf_last[sfb_act] || *scf_next != prev_scf_next[sfb_act] ||
  ------------------
  |  Branch (399:10): [True: 6.29M, False: 10.4M]
  |  Branch (399:49): [True: 1.12M, False: 9.36M]
  ------------------
  400|  9.50M|         delta_pe < delta_pe_last[sfb_act])) {
  ------------------
  |  Branch (400:10): [True: 2.08M, False: 7.28M]
  ------------------
  401|  9.50M|      success = 0;
  402|       |
  403|  9.50M|      sfb_width = pstr_psy_out->sfb_offsets[sfb_act + 1] - pstr_psy_out->sfb_offsets[sfb_act];
  404|       |
  405|  9.50M|      sfb_offs = pstr_psy_out->sfb_offsets[sfb_act];
  406|       |
  407|  9.50M|      energy = pstr_psy_out->ptr_sfb_energy[sfb_act];
  408|       |
  409|  9.50M|      if (ptr_sfb_const_pe_part[sfb_act] == MIN_FLT_VAL) {
  ------------------
  |  |   58|  9.50M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (409:11): [True: 4.42M, False: 5.07M]
  ------------------
  410|  4.42M|        ptr_sfb_const_pe_part[sfb_act] =
  411|  4.42M|            (FLOAT32)log(energy * (FLOAT32)6.75f / ptr_sfb_form_fac[sfb_act]) * LOG2_1;
  ------------------
  |  |   23|  4.42M|#define LOG2_1 1.442695041f /* 1/log(2) */
  ------------------
  412|  4.42M|      }
  413|       |
  414|  9.50M|      sfb_pe_prev = iaace_calc_single_spec_pe(scf_act, ptr_sfb_const_pe_part[sfb_act],
  415|  9.50M|                                              ptr_sfb_num_lines[sfb_act]) +
  416|  9.50M|                    (FLOAT32)iaace_count_single_scf_bits(scf_act, *scf_prev, *scf_next);
  417|       |
  418|  9.50M|      delta_pe_new = delta_pe;
  419|  9.50M|      update_min_scf = 1;
  420|       |
  421|  33.7M|      do {
  422|  33.7M|        scf_act--;
  423|       |
  424|  33.7M|        if (scf_act < ptr_min_calc_scf[sfb_act] && scf_act >= max_scf - MAX_SCF_DELTA) {
  ------------------
  |  |   74|  28.2M|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (424:13): [True: 28.2M, False: 5.52M]
  |  Branch (424:52): [True: 28.2M, False: 18.4k]
  ------------------
  425|  28.2M|          sfb_pe_new = iaace_calc_single_spec_pe(scf_act, ptr_sfb_const_pe_part[sfb_act],
  426|  28.2M|                                                 ptr_sfb_num_lines[sfb_act]) +
  427|  28.2M|                       (FLOAT32)iaace_count_single_scf_bits(scf_act, *scf_prev, *scf_next);
  428|       |
  429|  28.2M|          delta_pe_temp = delta_pe + sfb_pe_new - sfb_pe_prev;
  430|       |
  431|  28.2M|          if (delta_pe_temp < (FLOAT32)10.0f) {
  ------------------
  |  Branch (431:15): [True: 10.2M, False: 17.9M]
  ------------------
  432|  10.2M|            sfb_dist_new =
  433|  10.2M|                iaace_calc_sfb_dist(ptr_ptr_mdct_spec + sfb_offs, ptr_exp_spec + sfb_offs,
  434|  10.2M|                                    ptr_quant_spec_temp + sfb_offs, sfb_width, scf_act);
  435|       |
  436|  10.2M|            if (sfb_dist_new < ptr_sfb_dist[sfb_act]) {
  ------------------
  |  Branch (436:17): [True: 5.73M, False: 4.54M]
  ------------------
  437|  5.73M|              ptr_scf[sfb_act] = scf_act;
  438|  5.73M|              ptr_sfb_dist[sfb_act] = sfb_dist_new;
  439|       |
  440|  43.5M|              for (j = sfb_offs; j < sfb_offs + sfb_width; j++) {
  ------------------
  |  Branch (440:34): [True: 37.8M, False: 5.73M]
  ------------------
  441|  37.8M|                ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  442|       |
  443|  37.8M|                if (ptr_ptr_mdct_spec[j] < 0.0f) {
  ------------------
  |  Branch (443:21): [True: 18.1M, False: 19.6M]
  ------------------
  444|  18.1M|                  ptr_quant_spec[j] = -ptr_quant_spec[j];
  445|  18.1M|                }
  446|  37.8M|              }
  447|  5.73M|              delta_pe_new = delta_pe_temp;
  448|  5.73M|              success = 1;
  449|  5.73M|            }
  450|       |
  451|  10.2M|            if (update_min_scf) {
  ------------------
  |  Branch (451:17): [True: 9.70M, False: 572k]
  ------------------
  452|  9.70M|              ptr_min_calc_scf[sfb_act] = scf_act;
  453|  9.70M|            }
  454|  17.9M|          } else {
  455|  17.9M|            update_min_scf = 0;
  456|  17.9M|          }
  457|  28.2M|        }
  458|  33.7M|      } while (scf_act > min_scf);
  ------------------
  |  Branch (458:16): [True: 24.2M, False: 9.50M]
  ------------------
  459|       |
  460|  9.50M|      delta_pe = delta_pe_new;
  461|       |
  462|  9.50M|      prev_scf_last[sfb_act] = *scf_prev;
  463|  9.50M|      prev_scf_next[sfb_act] = *scf_next;
  464|  9.50M|      delta_pe_last[sfb_act] = delta_pe;
  465|  9.50M|    }
  466|       |
  467|  40.5M|    if (success) {
  ------------------
  |  Branch (467:9): [True: 3.18M, False: 37.3M]
  ------------------
  468|  3.18M|      sfb_prev = -1;
  469|  3.18M|      sfb_act = -1;
  470|  3.18M|      sfb_next = -1;
  471|  3.18M|      scf_prev = 0;
  472|  3.18M|      scf_next = 0;
  473|  3.18M|      min_scf = SHRT_MAX;
  474|  3.18M|      max_scf = SHRT_MAX;
  475|  3.18M|      success = 0;
  476|  37.3M|    } else {
  477|  37.3M|      sfb_prev = sfb_act;
  478|  37.3M|      sfb_act = sfb_next;
  479|  37.3M|    }
  480|  40.5M|  } while (sfb_next < pstr_psy_out->sfb_count);
  ------------------
  |  Branch (480:12): [True: 40.0M, False: 438k]
  ------------------
  481|   438k|}
ixheaace_sf_estimation.c:iaace_calc_single_spec_pe:
  119|  37.7M|                                         FLOAT32 num_lines) {
  120|  37.7M|  FLOAT32 spec_pe;
  121|  37.7M|  FLOAT32 ld_ratio;
  122|       |
  123|  37.7M|  ld_ratio = sfb_const_pe_part - (FLOAT32)0.375f * (FLOAT32)scf;
  124|       |
  125|  37.7M|  if (ld_ratio >= PE_C1) {
  ------------------
  |  |   80|  37.7M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (125:7): [True: 26.2M, False: 11.4M]
  ------------------
  126|  26.2M|    spec_pe = (FLOAT32)0.7f * num_lines * ld_ratio;
  127|  26.2M|  } else {
  128|  11.4M|    spec_pe = (FLOAT32)0.7f * num_lines * (PE_C2 + PE_C3 * ld_ratio);
  ------------------
  |  |   81|  11.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|  11.4M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  129|  11.4M|  }
  130|       |
  131|  37.7M|  return spec_pe;
  132|  37.7M|}
ixheaace_sf_estimation.c:iaace_count_single_scf_bits:
  109|  37.7M|static WORD32 iaace_count_single_scf_bits(WORD32 scf, WORD32 left_scf, WORD32 right_scf) {
  110|  37.7M|  WORD32 scf_bits;
  111|       |
  112|  37.7M|  scf_bits =
  113|  37.7M|      iaace_scf_delta_bit_count(left_scf - scf) + iaace_scf_delta_bit_count(scf - right_scf);
  114|       |
  115|  37.7M|  return scf_bits;
  116|  37.7M|}
ixheaace_sf_estimation.c:iaace_scf_delta_bit_count:
   99|   126M|static WORD32 iaace_scf_delta_bit_count(WORD32 delta) {
  100|   126M|  if (delta > 60) {
  ------------------
  |  Branch (100:7): [True: 757, False: 126M]
  ------------------
  101|    757|    return (ixheaace_huffman_code_table[120][0]);
  102|    757|  }
  103|   126M|  if (delta < -60) {
  ------------------
  |  Branch (103:7): [True: 4, False: 126M]
  ------------------
  104|      4|    return (ixheaace_huffman_code_table[0][0]);
  105|      4|  }
  106|   126M|  return (ixheaace_huffman_code_table[delta + 60][0]);
  107|   126M|}
ixheaace_sf_estimation.c:iaace_assimilate_multiple_scf:
  489|   438k|                                          FLOAT32 *ptr_ptr_mdct_spec) {
  490|   438k|  WORD32 sfb, start_sfb, stop_sfb;
  491|   438k|  WORD16 scf_temp[MAXIMUM_GROUPED_SCALE_FACTOR_BAND], min_scf, max_scf, scf_act;
  492|   438k|  WORD32 possible_region_found;
  493|   438k|  WORD32 sfb_width, sfb_offs, j;
  494|   438k|  FLOAT32 sfb_dist_new[MAXIMUM_GROUPED_SCALE_FACTOR_BAND] = {0};
  495|   438k|  FLOAT32 prev_dist_sum, new_dist_sum;
  496|   438k|  WORD32 delta_scf_bits;
  497|   438k|  FLOAT32 delta_spec_pe;
  498|   438k|  FLOAT32 delta_pe = 0.0f, delta_pe_new;
  499|   438k|  WORD32 sfb_count = pstr_psy_out->sfb_count;
  500|       |
  501|   438k|  min_scf = SHRT_MAX;
  502|   438k|  max_scf = SHRT_MIN;
  503|       |
  504|  17.9M|  for (sfb = 0; sfb < sfb_count; sfb++) {
  ------------------
  |  Branch (504:17): [True: 17.4M, False: 438k]
  ------------------
  505|  17.4M|    if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (505:9): [True: 6.66M, False: 10.8M]
  ------------------
  506|  6.66M|      min_scf = MIN(min_scf, ptr_scf[sfb]);
  ------------------
  |  |   23|  6.66M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3.17M, False: 3.49M]
  |  |  ------------------
  ------------------
  507|       |
  508|  6.66M|      max_scf = MAX(max_scf, ptr_scf[sfb]);
  ------------------
  |  |   24|  6.66M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (24:20): [True: 5.59M, False: 1.07M]
  |  |  ------------------
  ------------------
  509|  6.66M|    }
  510|  17.4M|  }
  511|       |
  512|   438k|  if (max_scf != SHRT_MIN && max_scf <= min_scf + MAX_SCF_DELTA) {
  ------------------
  |  |   74|   271k|#define MAX_SCF_DELTA 60
  ------------------
  |  Branch (512:7): [True: 271k, False: 166k]
  |  Branch (512:30): [True: 264k, False: 7.04k]
  ------------------
  513|   264k|    scf_act = max_scf;
  514|  2.40M|    do {
  515|  2.40M|      scf_act = scf_act - 2;
  516|       |
  517|  2.40M|      memcpy(scf_temp, ptr_scf, MAXIMUM_GROUPED_SCALE_FACTOR_BAND * sizeof(*ptr_scf));
  ------------------
  |  |   73|  2.40M|  (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   40|  2.40M|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   64|  2.40M|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |                 (MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT > MAXIMUM_SCALE_FACTOR_BAND_LONG \
  |  |  ------------------
  |  |  |  |   65|  2.40M|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  |  |  |  Branch (73:4): [True: 2.40M, Folded]
  |  |  ------------------
  |  |   74|  2.40M|       ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   40|  2.40M|#define MAXIMUM_NO_OF_GROUPS 4
  |  |  ------------------
  |  |                      ? MAXIMUM_NO_OF_GROUPS * MAXIMUM_SCALE_FACTOR_BAND_SHORT                            \
  |  |  ------------------
  |  |  |  |   64|  2.40M|#define MAXIMUM_SCALE_FACTOR_BAND_SHORT 15
  |  |  ------------------
  |  |   75|  2.40M|       : MAXIMUM_SCALE_FACTOR_BAND_LONG)
  |  |  ------------------
  |  |  |  |   65|      0|#define MAXIMUM_SCALE_FACTOR_BAND_LONG 51
  |  |  ------------------
  ------------------
  518|       |
  519|  2.40M|      stop_sfb = 0;
  520|       |
  521|  6.22M|      do {
  522|  6.22M|        sfb = stop_sfb;
  523|       |
  524|  63.1M|        while (sfb < sfb_count && (ptr_scf[sfb] == SHRT_MIN || ptr_scf[sfb] <= scf_act)) {
  ------------------
  |  Branch (524:16): [True: 60.7M, False: 2.40M]
  |  Branch (524:36): [True: 23.3M, False: 37.4M]
  |  Branch (524:64): [True: 33.6M, False: 3.82M]
  ------------------
  525|  56.9M|          sfb++;
  526|  56.9M|        }
  527|       |
  528|  6.22M|        start_sfb = sfb;
  529|       |
  530|  6.22M|        sfb++;
  531|       |
  532|  43.7M|        while (sfb < sfb_count && (ptr_scf[sfb] == SHRT_MIN || ptr_scf[sfb] > scf_act)) {
  ------------------
  |  Branch (532:16): [True: 40.6M, False: 3.07M]
  |  Branch (532:36): [True: 13.3M, False: 27.2M]
  |  Branch (532:64): [True: 24.1M, False: 3.15M]
  ------------------
  533|  37.4M|          sfb++;
  534|  37.4M|        }
  535|       |
  536|  6.22M|        stop_sfb = sfb;
  537|       |
  538|  6.22M|        possible_region_found = 0;
  539|       |
  540|  6.22M|        if (start_sfb < sfb_count) {
  ------------------
  |  Branch (540:13): [True: 3.82M, False: 2.40M]
  ------------------
  541|  3.82M|          possible_region_found = 1;
  542|       |
  543|  40.1M|          for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (543:33): [True: 36.6M, False: 3.46M]
  ------------------
  544|  36.6M|            if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (544:17): [True: 24.6M, False: 11.9M]
  ------------------
  545|  24.6M|              if (scf_act < ptr_min_scf[sfb]) {
  ------------------
  |  Branch (545:19): [True: 362k, False: 24.3M]
  ------------------
  546|   362k|                possible_region_found = 0;
  547|   362k|                break;
  548|   362k|              }
  549|  24.6M|            }
  550|  36.6M|          }
  551|  3.82M|        }
  552|       |
  553|  6.22M|        if (possible_region_found) {
  ------------------
  |  Branch (553:13): [True: 3.46M, False: 2.76M]
  ------------------
  554|  39.6M|          for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (554:33): [True: 36.2M, False: 3.46M]
  ------------------
  555|  36.2M|            if (scf_temp[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (555:17): [True: 24.2M, False: 11.9M]
  ------------------
  556|  24.2M|              scf_temp[sfb] = scf_act;
  557|  24.2M|            }
  558|  36.2M|          }
  559|       |
  560|  3.46M|          delta_scf_bits =
  561|  3.46M|              iaace_count_scf_bits_diff(ptr_scf, scf_temp, sfb_count, start_sfb, stop_sfb);
  562|       |
  563|  3.46M|          delta_spec_pe =
  564|  3.46M|              iaace_calc_spec_pe_diff(pstr_psy_out, ptr_scf, scf_temp, ptr_sfb_const_pe_part,
  565|  3.46M|                                      ptr_sfb_form_fac, ptr_sfb_num_lines, start_sfb, stop_sfb);
  566|       |
  567|  3.46M|          delta_pe_new = delta_pe + (FLOAT32)delta_scf_bits + delta_spec_pe;
  568|       |
  569|  3.46M|          if (delta_pe_new < (FLOAT32)10.0f) {
  ------------------
  |  Branch (569:15): [True: 1.29M, False: 2.16M]
  ------------------
  570|  1.29M|            prev_dist_sum = new_dist_sum = 0.0f;
  571|       |
  572|  6.66M|            for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (572:35): [True: 5.62M, False: 1.03M]
  ------------------
  573|  5.62M|              if (scf_temp[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (573:19): [True: 2.77M, False: 2.85M]
  ------------------
  574|  2.77M|                prev_dist_sum += ptr_sfb_dist[sfb];
  575|       |
  576|  2.77M|                sfb_width = pstr_psy_out->sfb_offsets[sfb + 1] - pstr_psy_out->sfb_offsets[sfb];
  577|       |
  578|  2.77M|                sfb_offs = pstr_psy_out->sfb_offsets[sfb];
  579|       |
  580|  2.77M|                sfb_dist_new[sfb] =
  581|  2.77M|                    iaace_calc_sfb_dist(ptr_ptr_mdct_spec + sfb_offs, ptr_exp_spec + sfb_offs,
  582|  2.77M|                                        ptr_quant_spec_temp + sfb_offs, sfb_width, scf_act);
  583|       |
  584|  2.77M|                if (sfb_dist_new[sfb] > pstr_psy_out->ptr_sfb_thr[sfb]) {
  ------------------
  |  Branch (584:21): [True: 257k, False: 2.51M]
  ------------------
  585|   257k|                  new_dist_sum = (FLOAT32)2.0f * prev_dist_sum;
  586|   257k|                  break;
  587|   257k|                }
  588|       |
  589|  2.51M|                new_dist_sum += sfb_dist_new[sfb];
  590|  2.51M|              }
  591|  5.62M|            }
  592|       |
  593|  1.29M|            if (new_dist_sum < prev_dist_sum) {
  ------------------
  |  Branch (593:17): [True: 446k, False: 845k]
  ------------------
  594|   446k|              delta_pe = delta_pe_new;
  595|       |
  596|  2.91M|              for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (596:37): [True: 2.47M, False: 446k]
  ------------------
  597|  2.47M|                if (ptr_scf[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (597:21): [True: 1.16M, False: 1.30M]
  ------------------
  598|  1.16M|                  sfb_width = pstr_psy_out->sfb_offsets[sfb + 1] - pstr_psy_out->sfb_offsets[sfb];
  599|       |
  600|  1.16M|                  sfb_offs = pstr_psy_out->sfb_offsets[sfb];
  601|  1.16M|                  ptr_scf[sfb] = scf_act;
  602|  1.16M|                  ptr_sfb_dist[sfb] = sfb_dist_new[sfb];
  603|       |
  604|  10.2M|                  for (j = sfb_offs; j < sfb_offs + sfb_width; j++) {
  ------------------
  |  Branch (604:38): [True: 9.11M, False: 1.16M]
  ------------------
  605|  9.11M|                    ptr_quant_spec[j] = ptr_quant_spec_temp[j];
  606|       |
  607|  9.11M|                    if (ptr_ptr_mdct_spec[j] < 0.0f) {
  ------------------
  |  Branch (607:25): [True: 4.14M, False: 4.96M]
  ------------------
  608|  4.14M|                      ptr_quant_spec[j] = -ptr_quant_spec[j];
  609|  4.14M|                    }
  610|  9.11M|                  }
  611|  1.16M|                }
  612|  2.47M|              }
  613|   446k|            }
  614|  1.29M|          }
  615|  3.46M|        }
  616|       |
  617|  6.22M|      } while (stop_sfb <= sfb_count);
  ------------------
  |  Branch (617:16): [True: 3.82M, False: 2.40M]
  ------------------
  618|       |
  619|  2.40M|    } while (scf_act > min_scf);
  ------------------
  |  Branch (619:14): [True: 2.14M, False: 264k]
  ------------------
  620|   264k|  }
  621|   438k|}
ixheaace_sf_estimation.c:iaace_count_scf_bits_diff:
  135|  3.46M|                                        WORD32 sfb_count, WORD32 start_sfb, WORD32 stop_sfb) {
  136|  3.46M|  WORD32 scf_bits_diff = 0;
  137|  3.46M|  WORD32 sfb = 0, sfb_last;
  138|  3.46M|  WORD32 sfb_prev, sfb_next;
  139|       |
  140|  3.46M|  sfb_last = start_sfb;
  141|       |
  142|  3.46M|  while ((sfb_last < stop_sfb) && (ptr_sfb_prev[sfb_last] == SHRT_MIN)) {
  ------------------
  |  Branch (142:10): [True: 3.46M, False: 0]
  |  Branch (142:35): [True: 0, False: 3.46M]
  ------------------
  143|      0|    sfb_last++;
  144|      0|  }
  145|       |
  146|  3.46M|  sfb_prev = start_sfb - 1;
  147|       |
  148|  6.52M|  while ((sfb_prev >= 0) && (ptr_sfb_prev[sfb_prev] == SHRT_MIN)) {
  ------------------
  |  Branch (148:10): [True: 4.79M, False: 1.73M]
  |  Branch (148:29): [True: 3.06M, False: 1.72M]
  ------------------
  149|  3.06M|    sfb_prev--;
  150|  3.06M|  }
  151|       |
  152|  3.46M|  if (sfb_prev >= 0) {
  ------------------
  |  Branch (152:7): [True: 1.72M, False: 1.73M]
  ------------------
  153|  1.72M|    scf_bits_diff += iaace_scf_delta_bit_count(ptr_sfb_new[sfb_prev] - ptr_sfb_new[sfb_last]) -
  154|  1.72M|                     iaace_scf_delta_bit_count(ptr_sfb_prev[sfb_prev] - ptr_sfb_prev[sfb_last]);
  155|  1.72M|  }
  156|       |
  157|  36.2M|  for (sfb = sfb_last + 1; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (157:28): [True: 32.7M, False: 3.46M]
  ------------------
  158|  32.7M|    if (ptr_sfb_prev[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (158:9): [True: 20.7M, False: 11.9M]
  ------------------
  159|  20.7M|      scf_bits_diff += iaace_scf_delta_bit_count(ptr_sfb_new[sfb_last] - ptr_sfb_new[sfb]) -
  160|  20.7M|                       iaace_scf_delta_bit_count(ptr_sfb_prev[sfb_last] - ptr_sfb_prev[sfb]);
  161|       |
  162|  20.7M|      sfb_last = sfb;
  163|  20.7M|    }
  164|  32.7M|  }
  165|       |
  166|  3.46M|  sfb_next = stop_sfb;
  167|       |
  168|  3.46M|  while ((sfb_next < sfb_count) && (ptr_sfb_prev[sfb_next] == SHRT_MIN)) {
  ------------------
  |  Branch (168:10): [True: 2.84M, False: 618k]
  |  Branch (168:36): [True: 0, False: 2.84M]
  ------------------
  169|      0|    sfb_next++;
  170|      0|  }
  171|       |
  172|  3.46M|  if (sfb_next < sfb_count) {
  ------------------
  |  Branch (172:7): [True: 2.84M, False: 618k]
  ------------------
  173|  2.84M|    scf_bits_diff += iaace_scf_delta_bit_count(ptr_sfb_new[sfb_last] - ptr_sfb_new[sfb_next]) -
  174|  2.84M|                     iaace_scf_delta_bit_count(ptr_sfb_prev[sfb_last] - ptr_sfb_prev[sfb_next]);
  175|  2.84M|  }
  176|       |
  177|  3.46M|  return scf_bits_diff;
  178|  3.46M|}
ixheaace_sf_estimation.c:iaace_calc_spec_pe_diff:
  184|  3.46M|                                       WORD32 stop_sfb) {
  185|  3.46M|  FLOAT32 spec_pe_diff = 0.0f;
  186|  3.46M|  WORD32 sfb;
  187|       |
  188|  39.6M|  for (sfb = start_sfb; sfb < stop_sfb; sfb++) {
  ------------------
  |  Branch (188:25): [True: 36.2M, False: 3.46M]
  ------------------
  189|  36.2M|    if (ptr_scf_prev[sfb] != SHRT_MIN) {
  ------------------
  |  Branch (189:9): [True: 24.2M, False: 11.9M]
  ------------------
  190|  24.2M|      FLOAT32 ld_ratio_prev, ld_ratio_new, pe_prev, pe_new;
  191|       |
  192|  24.2M|      if (ptr_sfb_const_pe_part[sfb] == MIN_FLT_VAL) {
  ------------------
  |  |   58|  24.2M|#define MIN_FLT_VAL (1.175494351e-38F)
  ------------------
  |  Branch (192:11): [True: 1.73M, False: 22.5M]
  ------------------
  193|  1.73M|        ptr_sfb_const_pe_part[sfb] = (FLOAT32)log(pstr_psy_out->ptr_sfb_energy[sfb] *
  194|  1.73M|                                                  (FLOAT32)6.75f / ptr_sfb_form_fac[sfb]) *
  195|  1.73M|                                     LOG2_1;
  ------------------
  |  |   23|  1.73M|#define LOG2_1 1.442695041f /* 1/log(2) */
  ------------------
  196|  1.73M|      }
  197|       |
  198|  24.2M|      ld_ratio_prev = ptr_sfb_const_pe_part[sfb] - 0.375f * ptr_scf_prev[sfb];
  199|  24.2M|      ld_ratio_new = ptr_sfb_const_pe_part[sfb] - 0.375f * ptr_scf_new[sfb];
  200|       |
  201|  24.2M|      if (ld_ratio_prev >= PE_C1) {
  ------------------
  |  |   80|  24.2M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (201:11): [True: 15.2M, False: 9.01M]
  ------------------
  202|  15.2M|        pe_prev = ld_ratio_prev;
  203|  15.2M|      } else {
  204|  9.01M|        pe_prev = PE_C2 + PE_C3 * ld_ratio_prev;
  ------------------
  |  |   81|  9.01M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                      pe_prev = PE_C2 + PE_C3 * ld_ratio_prev;
  ------------------
  |  |   82|  9.01M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  205|  9.01M|      }
  206|       |
  207|  24.2M|      if (ld_ratio_new >= PE_C1) {
  ------------------
  |  |   80|  24.2M|#define PE_C1 3.0f       /* log(8.0)/log(2) */
  ------------------
  |  Branch (207:11): [True: 21.0M, False: 3.19M]
  ------------------
  208|  21.0M|        pe_new = ld_ratio_new;
  209|  21.0M|      } else {
  210|  3.19M|        pe_new = PE_C2 + PE_C3 * ld_ratio_new;
  ------------------
  |  |   81|  3.19M|#define PE_C2 1.3219281f /* log(2.5)/log(2) */
  ------------------
                      pe_new = PE_C2 + PE_C3 * ld_ratio_new;
  ------------------
  |  |   82|  3.19M|#define PE_C3 0.5593573f /* 1-C2/C1 */
  ------------------
  211|  3.19M|      }
  212|       |
  213|  24.2M|      spec_pe_diff += (FLOAT32)0.7f * ptr_sfb_num_rel_lines[sfb] * (pe_new - pe_prev);
  214|  24.2M|    }
  215|  36.2M|  }
  216|       |
  217|  3.46M|  return spec_pe_diff;
  218|  3.46M|}
ixheaace_sf_estimation.c:iaace_calc_sfb_dist:
  221|  31.8M|                                   WORD16 *ptr_quant_spec, WORD32 sfb_width, WORD32 gain) {
  222|  31.8M|  WORD32 i = 0;
  223|  31.8M|  FLOAT32 dist = 0;
  224|  31.8M|  FLOAT32 k = -0.0946f + 0.5f;
  225|  31.8M|  FLOAT32 quantizer = ixheaace_fd_quant_table[gain + 128];
  226|  31.8M|  FLOAT32 inv_quantizer = ixheaace_fd_inv_quant_table[gain + 128];
  227|       |
  228|   364M|  while (i < sfb_width) {
  ------------------
  |  Branch (228:10): [True: 332M, False: 31.8M]
  ------------------
  229|   332M|    FLOAT32 iq_val;
  230|   332M|    FLOAT32 diff;
  231|       |
  232|   332M|    ptr_quant_spec[i] = (WORD16)(k + quantizer * ptr_exp_spec[i]);
  233|       |
  234|   332M|    if (ptr_quant_spec[i] < 64) {
  ------------------
  |  Branch (234:9): [True: 323M, False: 9.20M]
  ------------------
  235|   323M|      iq_val = ixheaace_pow_4_3_table[ptr_quant_spec[i]] * inv_quantizer;
  236|   323M|    } else {
  237|  9.20M|      iq_val = (FLOAT32)((pow((FLOAT32)abs(ptr_quant_spec[i]), 4.0f / 3.0f)) * inv_quantizer);
  238|  9.20M|    }
  239|       |
  240|   332M|    diff = (FLOAT32)fabs(ptr_spec[i]) - iq_val;
  241|       |
  242|   332M|    dist += diff * diff;
  243|       |
  244|   332M|    i++;
  245|   332M|  }
  246|       |
  247|  31.8M|  return dist;
  248|  31.8M|}

iusace_classification:
  960|   111k|                           iusace_scratch_mem *pstr_scratch, WORD32 ccfl) {
  961|   111k|  WORD32 n_frames, n_class, avg_cls, nf;
  962|   111k|  WORD32 i;
  963|   111k|  FLOAT32 *ptr_time_signal = pstr_scratch->p_time_signal;
  964|   111k|  WORD32 mode_decision_result;
  965|       |
  966|   111k|  n_frames = pstr_sig_class->n_buffer_samples / ccfl;
  967|       |
  968|   222k|  for (nf = 0; nf < n_frames; nf++) {
  ------------------
  |  Branch (968:16): [True: 111k, False: 111k]
  ------------------
  969|   104M|    for (i = 0; i < ccfl; i++) {
  ------------------
  |  Branch (969:17): [True: 104M, False: 111k]
  ------------------
  970|   104M|      ptr_time_signal[i] = pstr_sig_class->input_samples[ccfl * nf + i];
  971|   104M|    }
  972|       |
  973|       |    /* classification of ccfl-frame */
  974|   111k|    mode_decision_result =
  975|   111k|        iusace_classification_ccfl(pstr_sig_class, ptr_time_signal, pstr_scratch, ccfl);
  976|       |
  977|       |    /* coding mode decision of 1024-frame */
  978|   111k|    if ((mode_decision_result == MUSIC) || (mode_decision_result == MUSIC_DEFINITE)) {
  ------------------
  |  |   44|   111k|#define MUSIC 4
  ------------------
                  if ((mode_decision_result == MUSIC) || (mode_decision_result == MUSIC_DEFINITE)) {
  ------------------
  |  |   43|   110k|#define MUSIC_DEFINITE 3
  ------------------
  |  Branch (978:9): [True: 1.26k, False: 110k]
  |  Branch (978:44): [True: 18.5k, False: 91.5k]
  ------------------
  979|  19.7k|      pstr_sig_class->coding_mode = FD_MODE;
  ------------------
  |  |   22|  19.7k|#define FD_MODE 2
  ------------------
  980|  91.5k|    } else if ((mode_decision_result == SPEECH) || (mode_decision_result == SPEECH_DEFINITE)) {
  ------------------
  |  |   42|  91.5k|#define SPEECH 2
  ------------------
                  } else if ((mode_decision_result == SPEECH) || (mode_decision_result == SPEECH_DEFINITE)) {
  ------------------
  |  |   41|  89.7k|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (980:16): [True: 1.82k, False: 89.7k]
  |  Branch (980:52): [True: 88.4k, False: 1.25k]
  ------------------
  981|  90.2k|      pstr_sig_class->coding_mode = TD_MODE;
  ------------------
  |  |   23|  90.2k|#define TD_MODE 0
  ------------------
  982|  90.2k|    }
  983|       |
  984|   111k|    pstr_sig_class->class_buf[pstr_sig_class->n_buf_class + nf] = pstr_sig_class->coding_mode;
  985|   111k|    pstr_sig_class->pre_mode = pstr_sig_class->coding_mode;
  986|   111k|  }
  987|       |
  988|       |  /* merge ccfl-frame results */
  989|   111k|  pstr_sig_class->n_buf_class += n_frames;
  990|   111k|  n_class = (pstr_sig_class->n_class_frames > pstr_sig_class->n_buf_class)
  ------------------
  |  Branch (990:13): [True: 111k, False: 0]
  ------------------
  991|   111k|                ? pstr_sig_class->n_buf_class
  992|   111k|                : pstr_sig_class->n_class_frames;
  993|   111k|  {
  994|   111k|    WORD32 min_cls, max_cls;
  995|       |
  996|   111k|    min_cls = max_cls = pstr_sig_class->class_buf[0];
  997|   111k|    for (i = 1; i < n_class; i++) {
  ------------------
  |  Branch (997:17): [True: 0, False: 111k]
  ------------------
  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|   111k|    avg_cls = 0;
 1006|   222k|    for (i = 0; i < n_class; i++) {
  ------------------
  |  Branch (1006:17): [True: 111k, False: 111k]
  ------------------
 1007|   111k|      if (pstr_sig_class->class_buf[i] == max_cls) {
  ------------------
  |  Branch (1007:11): [True: 111k, False: 0]
  ------------------
 1008|   111k|        avg_cls += 1;
 1009|   111k|      }
 1010|   111k|      if (pstr_sig_class->class_buf[i] == min_cls) {
  ------------------
  |  Branch (1010:11): [True: 111k, False: 0]
  ------------------
 1011|   111k|        avg_cls += -1;
 1012|   111k|      }
 1013|   111k|    }
 1014|       |
 1015|   111k|    if (avg_cls > 0) {
  ------------------
  |  Branch (1015:9): [True: 0, False: 111k]
  ------------------
 1016|      0|      pstr_sig_class->coding_mode = max_cls;
 1017|   111k|    } else {
 1018|   111k|      pstr_sig_class->coding_mode = min_cls;
 1019|   111k|    }
 1020|   111k|  }
 1021|       |
 1022|       |  /* shift, save pre_mode and unused class */
 1023|   111k|  if (n_class > 0) {
  ------------------
  |  Branch (1023:7): [True: 111k, False: 0]
  ------------------
 1024|   111k|    pstr_sig_class->pre_mode = pstr_sig_class->class_buf[n_class - 1];
 1025|   111k|  }
 1026|   111k|  pstr_sig_class->n_buf_class -= n_class;
 1027|   111k|  pstr_sig_class->n_buffer_samples -= ccfl * n_frames;
 1028|       |
 1029|   111k|  WORD32 minimum = MIN(pstr_sig_class->n_buf_class, pstr_sig_class->n_buffer_samples);
  ------------------
  |  |   86|   111k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (86:20): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
 1030|   111k|  if (minimum == pstr_sig_class->n_buf_class) {
  ------------------
  |  Branch (1030:7): [True: 111k, False: 0]
  ------------------
 1031|   111k|    for (i = 0; i < minimum; i++) {
  ------------------
  |  Branch (1031:17): [True: 0, False: 111k]
  ------------------
 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|   111k|    for (; i < pstr_sig_class->n_buffer_samples; i++) {
  ------------------
  |  Branch (1037:12): [True: 0, False: 111k]
  ------------------
 1038|      0|      pstr_sig_class->input_samples[i] = pstr_sig_class->input_samples[i + ccfl * n_frames];
 1039|      0|    }
 1040|   111k|  } 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|   111k|}
iusace_init_classification:
 1053|  1.28k|VOID iusace_init_classification(ia_classification_struct *pstr_sig_class) {
 1054|  1.28k|  pstr_sig_class->pre_mode = FD_MODE;
  ------------------
  |  |   22|  1.28k|#define FD_MODE 2
  ------------------
 1055|       |
 1056|  1.28k|  pstr_sig_class->n_buffer_samples = 0;
 1057|  1.28k|  memset(pstr_sig_class->input_samples, 0, 3840 * 2 * sizeof(FLOAT32));
 1058|  1.28k|  pstr_sig_class->n_class_frames = 2;
 1059|  1.28k|  pstr_sig_class->n_buf_class = 0;
 1060|       |
 1061|  1.28k|  pstr_sig_class->is_switch_mode = 1;
 1062|       |
 1063|  1.28k|  pstr_sig_class->framecnt = 0;
 1064|  1.28k|  pstr_sig_class->init_flag = 0;
 1065|  1.28k|  pstr_sig_class->framecnt_xm = 0;
 1066|       |
 1067|  1.28k|  memset(&pstr_sig_class->buffers, 0, sizeof(ia_classification_buf_struct));
 1068|  1.28k|  memset(pstr_sig_class->spec_tilt_buf, 0, sizeof(FLOAT32) * 100);
 1069|  1.28k|  memset(pstr_sig_class->n_tonal, 0, sizeof(WORD32) * 100);
 1070|  1.28k|  memset(pstr_sig_class->n_tonal_low_frequency, 0, sizeof(WORD32) * 100);
 1071|  1.28k|  memset(pstr_sig_class->msd_spec_tilt_buf, 0, sizeof(FLOAT32) * 5);
 1072|  1.28k|  memset(pstr_sig_class->msd_spec_tilt_short_buf, 0, sizeof(FLOAT32) * 5);
 1073|  1.28k|  memset(pstr_sig_class->ave_n_tonal_short_buf, 0, sizeof(FLOAT32) * 5);
 1074|  1.28k|  memset(pstr_sig_class->ave_n_tonal_buf, 0, sizeof(FLOAT32) * 5);
 1075|  1.28k|  return;
 1076|  1.28k|}
ixheaace_signal_classifier.c:iusace_classification_ccfl:
  826|   111k|                                         iusace_scratch_mem *pstr_scratch, WORD32 ccfl) {
  827|   111k|  WORD32 i;
  828|   111k|  ia_tonal_params_struct pstr_ton_params;
  829|   111k|  ia_smooth_params_struct smooth_param;
  830|   111k|  ia_mode_params_struct pstr_mode_params;
  831|   111k|  ia_spec_tilt_params_struct ptr_spec_params;
  832|       |
  833|   111k|  ia_classification_buf_struct *pstr_buffers = &(pstr_sig_class->buffers);
  834|   111k|  pFLOAT32 spec_tilt_buf = pstr_sig_class->spec_tilt_buf;
  835|   111k|  pWORD32 n_tonal = pstr_sig_class->n_tonal;
  836|   111k|  pWORD32 n_tonal_low_frequency = pstr_sig_class->n_tonal_low_frequency;
  837|   111k|  pWORD32 framecnt_xm = &(pstr_sig_class->framecnt_xm);
  838|   111k|  pWORD32 framecnt = &(pstr_sig_class->framecnt);
  839|   111k|  pFLOAT32 ave_n_tonal_short_buf = pstr_sig_class->ave_n_tonal_short_buf;
  840|   111k|  pFLOAT32 ave_n_tonal_buf = pstr_sig_class->ave_n_tonal_buf;
  841|   111k|  pFLOAT32 msd_spec_tilt_buf = pstr_sig_class->msd_spec_tilt_buf;
  842|   111k|  pFLOAT32 msd_spec_tilt_short_buf = pstr_sig_class->msd_spec_tilt_short_buf;
  843|       |
  844|   111k|  FLOAT32 n_tonal_low_frequency_ratio;    /* the ratio of distribution of the numbers */
  845|       |                                          /* of tonal in the low frequency domain     */
  846|   111k|  FLOAT32 ave_n_tonal, ave_n_tonal_short; /**< the number of tonal */
  847|   111k|  FLOAT32 msd_spec_tilt;                  /* the long-term MSD of spectral tilt */
  848|   111k|  FLOAT32 msd_spec_tilt_short;            /* the short-term MSD of spectral tilt */
  849|       |
  850|   111k|  WORD32 init_mode_decision_result; /* the initial mode decision */
  851|   111k|  WORD32 flag_border = NO_BORDER;   /* flag of current border */
  ------------------
  |  |   34|   111k|#define NO_BORDER 0
  ------------------
  852|       |
  853|   111k|  WORD32 mode_decision_result; /* final mode decision result */
  854|       |
  855|   111k|  if (pstr_sig_class->init_flag == 0) {
  ------------------
  |  Branch (855:7): [True: 1.25k, False: 110k]
  ------------------
  856|       |    /* initialize */
  857|  1.25k|    pstr_sig_class->init_flag = 1;
  858|       |
  859|  7.54k|    for (i = 0; i < 5; i++) {
  ------------------
  |  Branch (859:17): [True: 6.28k, False: 1.25k]
  ------------------
  860|  6.28k|      n_tonal[i] = 0;
  861|  6.28k|      n_tonal_low_frequency[i] = 0;
  862|  6.28k|      spec_tilt_buf[i] = 0;
  863|  6.28k|      pstr_buffers->init_result_behind[i] = TBD;
  ------------------
  |  |   40|  6.28k|#define TBD 0
  ------------------
  864|  6.28k|      pstr_buffers->smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|  6.28k|#define TBD 0
  ------------------
  865|       |
  866|  6.28k|      ave_n_tonal_short_buf[i] = 0;
  867|  6.28k|      ave_n_tonal_buf[i] = 0;
  868|  6.28k|      msd_spec_tilt_buf[i] = 0;
  869|  6.28k|      msd_spec_tilt_short_buf[i] = 0;
  870|       |
  871|  6.28k|      pstr_buffers->frame_energy_buf_behind[i] = 0;
  872|  6.28k|      pstr_buffers->flag_border_buf_behind[i] = NO_BORDER;
  ------------------
  |  |   34|  6.28k|#define NO_BORDER 0
  ------------------
  873|  6.28k|    }
  874|  7.54k|    for (; i < 10; i++) {
  ------------------
  |  Branch (874:12): [True: 6.28k, False: 1.25k]
  ------------------
  875|  6.28k|      n_tonal[i] = 0;
  876|  6.28k|      n_tonal_low_frequency[i] = 0;
  877|  6.28k|      spec_tilt_buf[i] = 0;
  878|  6.28k|      pstr_buffers->init_result_behind[i] = TBD;
  ------------------
  |  |   40|  6.28k|#define TBD 0
  ------------------
  879|  6.28k|      pstr_buffers->smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|  6.28k|#define TBD 0
  ------------------
  880|       |
  881|  6.28k|      pstr_buffers->frame_energy_buf_behind[i] = 0;
  882|  6.28k|      pstr_buffers->flag_border_buf_behind[i] = NO_BORDER;
  ------------------
  |  |   34|  6.28k|#define NO_BORDER 0
  ------------------
  883|  6.28k|    }
  884|       |
  885|   114k|    for (; i < 100; i++) {
  ------------------
  |  Branch (885:12): [True: 113k, False: 1.25k]
  ------------------
  886|   113k|      n_tonal[i] = 0;
  887|   113k|      n_tonal_low_frequency[i] = 0;
  888|   113k|      spec_tilt_buf[i] = 0;
  889|   113k|      pstr_buffers->init_result_behind[i] = TBD;
  ------------------
  |  |   40|   113k|#define TBD 0
  ------------------
  890|   113k|      pstr_buffers->smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|   113k|#define TBD 0
  ------------------
  891|   113k|    }
  892|  2.51k|    for (i = 0; i < NFRAMEAHEAD; i++) {
  ------------------
  |  |   27|  2.51k|#define NFRAMEAHEAD 1
  ------------------
  |  Branch (892:17): [True: 1.25k, False: 1.25k]
  ------------------
  893|  1.25k|      pstr_buffers->frame_energy_buf_ahead[i] = 0;
  894|  1.25k|      pstr_buffers->flag_border_buf_ahead[i] = NO_BORDER;
  ------------------
  |  |   34|  1.25k|#define NO_BORDER 0
  ------------------
  895|  1.25k|      pstr_buffers->init_result_ahead[i] = TBD;
  ------------------
  |  |   40|  1.25k|#define TBD 0
  ------------------
  896|  1.25k|    }
  897|  1.25k|  }
  898|       |
  899|   111k|  *framecnt += 1;
  900|   111k|  *framecnt_xm += 1;
  901|       |
  902|   111k|  pstr_ton_params.time_signal = (FLOAT32 *)ptr_time_signal;
  903|   111k|  pstr_ton_params.framecnt_xm = *framecnt_xm;
  904|   111k|  pstr_ton_params.n_tonal = n_tonal;
  905|   111k|  pstr_ton_params.n_tonal_low_frequency = n_tonal_low_frequency;
  906|   111k|  pstr_ton_params.n_tonal_low_frequency_ratio = &n_tonal_low_frequency_ratio;
  907|   111k|  pstr_ton_params.ave_n_tonal = &ave_n_tonal;
  908|   111k|  pstr_ton_params.ave_n_tonal_short = &ave_n_tonal_short;
  909|       |  /** analysis tonal
  910|       |   */
  911|   111k|  iusace_tonal_analysis(&pstr_ton_params, pstr_scratch, ccfl);
  912|       |
  913|   111k|  ptr_spec_params.time_signal = ptr_time_signal;
  914|   111k|  ptr_spec_params.framecnt_xm = *framecnt_xm;
  915|   111k|  ptr_spec_params.spec_tilt_buf = spec_tilt_buf;
  916|   111k|  ptr_spec_params.msd_spec_tilt = &msd_spec_tilt;
  917|   111k|  ptr_spec_params.msd_spec_tilt_short = &msd_spec_tilt_short;
  918|       |  /** analysis spectral tilt
  919|       |   */
  920|   111k|  iusace_spectral_tilt_analysis(&ptr_spec_params, ccfl);
  921|       |
  922|   111k|  pstr_mode_params.framecnt = *framecnt;
  923|   111k|  pstr_mode_params.framecnt_xm = framecnt_xm;
  924|   111k|  pstr_mode_params.flag_border = &flag_border;
  925|   111k|  pstr_mode_params.ave_n_tonal_short = ave_n_tonal_short;
  926|   111k|  pstr_mode_params.ave_n_tonal = ave_n_tonal;
  927|   111k|  pstr_mode_params.ave_n_tonal_short_buf = ave_n_tonal_short_buf;
  928|   111k|  pstr_mode_params.ave_n_tonal_buf = ave_n_tonal_buf;
  929|   111k|  pstr_mode_params.msd_spec_tilt = msd_spec_tilt;
  930|   111k|  pstr_mode_params.msd_spec_tilt_short = msd_spec_tilt_short;
  931|   111k|  pstr_mode_params.msd_spec_tilt_buf = msd_spec_tilt_buf;
  932|   111k|  pstr_mode_params.msd_spec_tilt_short_buf = msd_spec_tilt_short_buf;
  933|   111k|  pstr_mode_params.n_tonal_low_frequency_ratio = n_tonal_low_frequency_ratio;
  934|   111k|  pstr_mode_params.frame_energy = ptr_spec_params.frame_energy;
  935|       |  /** initial mode decision and boundary decisions
  936|       |   */
  937|   111k|  init_mode_decision_result = iusace_init_mode_decision(&pstr_mode_params);
  938|       |
  939|   111k|  smooth_param.flag_border_buf_behind = pstr_buffers->flag_border_buf_behind;
  940|   111k|  smooth_param.flag_border_buf_ahead = pstr_buffers->flag_border_buf_ahead;
  941|   111k|  smooth_param.frame_energy = ptr_spec_params.frame_energy;
  942|   111k|  smooth_param.frame_energy_buf_behind = pstr_buffers->frame_energy_buf_behind;
  943|   111k|  smooth_param.frame_energy_buf_ahead = pstr_buffers->frame_energy_buf_ahead;
  944|   111k|  smooth_param.smoothing_result_buf = pstr_buffers->smoothing_result_buf;
  945|   111k|  smooth_param.init_result_ahead = pstr_buffers->init_result_ahead;
  946|   111k|  smooth_param.flag_border = flag_border;
  947|   111k|  smooth_param.init_result_behind = pstr_buffers->init_result_behind;
  948|   111k|  smooth_param.init_mode_decision_result = init_mode_decision_result;
  949|   111k|  smooth_param.flag_speech_definite = 0;
  950|   111k|  smooth_param.count_small_energy = 0;
  951|   111k|  smooth_param.flag_music_definite = 0;
  952|   111k|  smooth_param.num_smoothing = 0;
  953|       |  /* smoothing */
  954|   111k|  mode_decision_result = iusace_smoothing_mode_decision(&smooth_param);
  955|       |
  956|   111k|  return mode_decision_result;
  957|   111k|}
ixheaace_signal_classifier.c:iusace_tonal_analysis:
  295|   111k|                                  iusace_scratch_mem *pstr_scratch, WORD32 ccfl) {
  296|   111k|  FLOAT32 *ptr_complex_fft = pstr_scratch->p_complex_fft;
  297|   111k|  WORD32 *ptr_tonal_flag = pstr_scratch->p_tonal_flag;
  298|   111k|  FLOAT32 *ptr_time_sig = pstr_ton_params->time_signal;
  299|   111k|  WORD32 framecnt_xm = pstr_ton_params->framecnt_xm;
  300|   111k|  WORD32 *ptr_n_tonal = pstr_ton_params->n_tonal;
  301|   111k|  WORD32 *ptr_n_tonal_low_frequency = pstr_ton_params->n_tonal_low_frequency;
  302|   111k|  FLOAT32 *ptr_n_tonal_low_frequency_ratio = pstr_ton_params->n_tonal_low_frequency_ratio;
  303|   111k|  FLOAT32 *ave_n_tonal = pstr_ton_params->ave_n_tonal;
  304|   111k|  FLOAT32 *ave_n_tonal_short = pstr_ton_params->ave_n_tonal_short;
  305|   111k|  WORD32 i;
  306|   111k|  WORD32 fft_size = ccfl;
  307|       |
  308|   111k|  WORD32 frame_length;
  309|   111k|  WORD32 n_tonal_total, n_tonal_low_frequency_total;
  310|       |
  311|   104M|  for (i = 0; i < ccfl; i++) {
  ------------------
  |  Branch (311:15): [True: 104M, False: 111k]
  ------------------
  312|   104M|    ptr_complex_fft[2 * i] = (FLOAT32)(
  313|   104M|        ptr_time_sig[i] * ((ccfl == 1024) ? iusace_classify_arrays.hanning_window_1024[i]
  ------------------
  |  Branch (313:28): [True: 77.5M, False: 27.3M]
  ------------------
  314|   104M|                                          : iusace_classify_arrays.hanning_window_768[i]));
  315|   104M|    ptr_complex_fft[2 * i + 1] = 0;
  316|   104M|  }
  317|       |
  318|   111k|  iusace_complex_fft(ptr_complex_fft, fft_size, pstr_scratch);
  319|       |
  320|       |  /* compute power density spectrum */
  321|       |  /* re_fft contains the resulting pds */
  322|   111k|  iusace_calc_pds(ptr_complex_fft, ccfl);
  323|       |
  324|       |  /* detect tonal */
  325|   111k|  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.1M|  for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (328:15): [True: 11.0M, False: 111k]
  ------------------
  329|  11.0M|    ptr_n_tonal[i] = ptr_n_tonal[i + 1];
  330|  11.0M|    ptr_n_tonal_low_frequency[i] = ptr_n_tonal_low_frequency[i + 1];
  331|  11.0M|  }
  332|   111k|  ptr_n_tonal[99] = 0;
  333|  52.5M|  for (i = 0; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (333:15): [True: 52.4M, False: 111k]
  ------------------
  334|  52.4M|    ptr_n_tonal[99] += ptr_tonal_flag[i];
  335|  52.4M|  }
  336|   111k|  ptr_n_tonal_low_frequency[99] = 0;
  337|  17.9M|  for (i = 0; i < INDEXOFLOWFREQUENCY; i++) {
  ------------------
  |  |   25|  17.9M|#define INDEXOFLOWFREQUENCY 160
  ------------------
  |  Branch (337:15): [True: 17.8M, False: 111k]
  ------------------
  338|  17.8M|    ptr_n_tonal_low_frequency[99] += ptr_tonal_flag[i];
  339|  17.8M|  }
  340|       |
  341|       |  /* compute long-term AVE and the ratio of distribution in low-frequency domain */
  342|   111k|  if (framecnt_xm < AVE_TONAL_LENGTH) {
  ------------------
  |  |   28|   111k|#define AVE_TONAL_LENGTH 100
  ------------------
  |  Branch (342:7): [True: 62.6k, False: 48.6k]
  ------------------
  343|  62.6k|    frame_length = framecnt_xm;
  344|  62.6k|  } else {
  345|  48.6k|    frame_length = AVE_TONAL_LENGTH;
  ------------------
  |  |   28|  48.6k|#define AVE_TONAL_LENGTH 100
  ------------------
  346|  48.6k|  }
  347|       |
  348|   111k|  n_tonal_total = 0;
  349|   111k|  n_tonal_low_frequency_total = 0;
  350|  7.46M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (350:15): [True: 7.35M, False: 111k]
  ------------------
  351|  7.35M|    n_tonal_total += ptr_n_tonal[99 - i];
  352|  7.35M|    n_tonal_low_frequency_total += ptr_n_tonal_low_frequency[99 - i];
  353|  7.35M|  }
  354|       |
  355|   111k|  *ave_n_tonal = (FLOAT32)n_tonal_total / frame_length;
  356|       |
  357|   111k|  if (n_tonal_total == 0) {
  ------------------
  |  Branch (357:7): [True: 25.4k, False: 85.9k]
  ------------------
  358|  25.4k|    *ptr_n_tonal_low_frequency_ratio = 1;
  359|  85.9k|  } else {
  360|  85.9k|    *ptr_n_tonal_low_frequency_ratio = (FLOAT32)n_tonal_low_frequency_total / n_tonal_total;
  361|  85.9k|  }
  362|       |
  363|       |  /* compute the short-term AVE */
  364|   111k|  if (framecnt_xm < AVE_TONAL_LENGTH_SHORT) {
  ------------------
  |  |   29|   111k|#define AVE_TONAL_LENGTH_SHORT 10
  ------------------
  |  Branch (364:7): [True: 10.1k, False: 101k]
  ------------------
  365|  10.1k|    frame_length = framecnt_xm;
  366|   101k|  } else {
  367|   101k|    frame_length = AVE_TONAL_LENGTH_SHORT;
  ------------------
  |  |   29|   101k|#define AVE_TONAL_LENGTH_SHORT 10
  ------------------
  368|   101k|  }
  369|       |
  370|   111k|  n_tonal_total = 0;
  371|  1.17M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (371:15): [True: 1.06M, False: 111k]
  ------------------
  372|  1.06M|    n_tonal_total += ptr_n_tonal[99 - i];
  373|  1.06M|  }
  374|       |
  375|   111k|  *ave_n_tonal_short = (FLOAT32)n_tonal_total / frame_length;
  376|   111k|  return;
  377|   111k|}
ixheaace_signal_classifier.c:iusace_calc_pds:
   52|   111k|static VOID iusace_calc_pds(FLOAT32 *ptr_input, WORD32 ccfl) {
   53|   111k|  WORD32 i;
   54|   111k|  FLOAT64 max_pow, delta;
   55|   111k|  FLOAT64 log_ccfl_base_10 = (ccfl == 1024) ? LOG_1024_BASE_10 : LOG_768_BASE_10;
  ------------------
  |  |   45|  75.6k|#define LOG_1024_BASE_10 3.01029995664f
  ------------------
                FLOAT64 log_ccfl_base_10 = (ccfl == 1024) ? LOG_1024_BASE_10 : LOG_768_BASE_10;
  ------------------
  |  |   46|   146k|#define LOG_768_BASE_10 (2.88536122003f)
  ------------------
  |  Branch (55:30): [True: 75.6k, False: 35.6k]
  ------------------
   56|       |
   57|   111k|  max_pow = MAX(
  ------------------
  |  |   89|   111k|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 106k, False: 4.65k]
  |  |  ------------------
  ------------------
   58|   111k|      10 * (log10(ptr_input[0] * ptr_input[0] + ptr_input[1] * ptr_input[1]) - log_ccfl_base_10) +
   59|   111k|          10e-15,
   60|   111k|      MIN_POW);
   61|       |
   62|  52.4M|  for (i = 1; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (62:15): [True: 52.3M, False: 111k]
  ------------------
   63|       |    /* removed the sqrt along with clubbing the for loops */
   64|  52.3M|    ptr_input[2 * i] = (FLOAT32)MAX(10 * (log10(ptr_input[2 * i] * ptr_input[2 * i] +
  ------------------
  |  |   89|  52.3M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 49.5M, False: 2.79M]
  |  |  ------------------
  ------------------
   65|  52.3M|                                                ptr_input[2 * i + 1] * ptr_input[2 * i + 1]) -
   66|  52.3M|                                          log_ccfl_base_10) +
   67|  52.3M|                                        10e-15,
   68|  52.3M|                                    MIN_POW);
   69|       |
   70|  52.3M|    max_pow = MAX(max_pow, ptr_input[2 * i]);
  ------------------
  |  |   89|  52.3M|#define MAX(a, b) ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (89:20): [True: 49.3M, False: 2.95M]
  |  |  ------------------
  ------------------
   71|  52.3M|  }
   72|       |
   73|       |  /* Normalized to reference sound pressure level 96 dB */
   74|   111k|  delta = 96 - max_pow;
   75|       |
   76|  52.5M|  for (i = 0; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (76:15): [True: 52.4M, False: 111k]
  ------------------
   77|  52.4M|    ptr_input[2 * i] = ptr_input[2 * i] + (FLOAT32)delta;
   78|  52.4M|  }
   79|   111k|  return;
   80|   111k|}
ixheaace_signal_classifier.c:iusace_find_tonal:
   83|   111k|                              WORD32 ccfl) {
   84|   111k|  WORD32 i, j;
   85|   111k|  WORD32 is_tonal;
   86|   111k|  FLOAT64 tonal_spl;
   87|   111k|  FLOAT64 absolute_threshold_xm;
   88|       |
   89|  52.5M|  for (i = 0; i<ccfl>> 1; i++) {
  ------------------
  |  Branch (89:15): [True: 52.4M, False: 111k]
  ------------------
   90|  52.4M|    ptr_scratch[i] = ptr_input[2 * i];
   91|  52.4M|  }
   92|       |
   93|   111k|  if (ccfl == FRAME_LEN_LONG) {
  ------------------
  |  |   54|   111k|#define FRAME_LEN_LONG 1024
  ------------------
  |  Branch (93:7): [True: 75.6k, False: 35.6k]
  ------------------
   94|  38.8M|    for (i = 0; i <= 511; i++) {
  ------------------
  |  Branch (94:17): [True: 38.7M, False: 75.6k]
  ------------------
   95|  38.7M|      ptr_tonal_flag[i] = 0;
   96|  38.7M|    }
   97|       |
   98|  37.7M|    for (i = 2; i < 500; i++) {
  ------------------
  |  Branch (98:17): [True: 37.6M, False: 75.6k]
  ------------------
   99|  37.6M|      if (ptr_scratch[i] > ptr_scratch[i - 1] && ptr_scratch[i] >= ptr_scratch[i + 1]) {
  ------------------
  |  Branch (99:11): [True: 17.7M, False: 19.9M]
  |  Branch (99:50): [True: 9.89M, False: 7.86M]
  ------------------
  100|  9.89M|        is_tonal = 1;
  101|       |
  102|       |        /* Verify it meets the condition: ptr_scratch[i]-ptr_scratch[i+j]>=7 */
  103|       |
  104|  9.89M|        if (1 < i && i < 62) {
  ------------------
  |  Branch (104:13): [True: 9.89M, False: 0]
  |  Branch (104:22): [True: 1.16M, False: 8.73M]
  ------------------
  105|  1.51M|          for (j = -2; j <= -2; j++) {
  ------------------
  |  Branch (105:24): [True: 1.16M, False: 352k]
  ------------------
  106|  1.16M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (106:24): [True: 1.16M, False: 0]
  |  Branch (106:36): [True: 352k, False: 808k]
  ------------------
  107|  1.16M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (107:17): [True: 808k, False: 352k]
  ------------------
  108|  1.16M|          }
  109|  1.16M|          if (is_tonal == 1) {
  ------------------
  |  Branch (109:15): [True: 352k, False: 808k]
  ------------------
  110|   498k|            for (j = 2; j <= 2; j++) {
  ------------------
  |  Branch (110:25): [True: 352k, False: 146k]
  ------------------
  111|   352k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (111:26): [True: 352k, False: 0]
  |  Branch (111:38): [True: 146k, False: 206k]
  ------------------
  112|   352k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (112:19): [True: 206k, False: 146k]
  ------------------
  113|   352k|            }
  114|   352k|          }
  115|       |
  116|  1.16M|          if (is_tonal == 1) {
  ------------------
  |  Branch (116:15): [True: 146k, False: 1.01M]
  ------------------
  117|   146k|            ptr_tonal_flag[i] = 1;
  118|   146k|          }
  119|  1.16M|        }
  120|       |
  121|  8.73M|        else if (62 <= i && i < 126) {
  ------------------
  |  Branch (121:18): [True: 8.73M, False: 0]
  |  Branch (121:29): [True: 1.30M, False: 7.43M]
  ------------------
  122|  1.87M|          for (j = -3; j <= -2; j++) {
  ------------------
  |  Branch (122:24): [True: 1.68M, False: 188k]
  ------------------
  123|  1.68M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (123:24): [True: 1.68M, False: 0]
  |  Branch (123:36): [True: 575k, False: 1.11M]
  ------------------
  124|  1.68M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (124:17): [True: 1.11M, False: 575k]
  ------------------
  125|  1.68M|          }
  126|  1.30M|          if (is_tonal == 1) {
  ------------------
  |  Branch (126:15): [True: 188k, False: 1.11M]
  ------------------
  127|   346k|            for (j = 2; j <= 3; j++) {
  ------------------
  |  Branch (127:25): [True: 283k, False: 63.2k]
  ------------------
  128|   283k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (128:26): [True: 283k, False: 0]
  |  Branch (128:38): [True: 157k, False: 125k]
  ------------------
  129|   283k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (129:19): [True: 125k, False: 157k]
  ------------------
  130|   283k|            }
  131|   188k|          }
  132|       |
  133|  1.30M|          if (is_tonal == 1) {
  ------------------
  |  Branch (133:15): [True: 63.2k, False: 1.23M]
  ------------------
  134|  63.2k|            ptr_tonal_flag[i] = 1;
  135|  63.2k|          }
  136|  1.30M|        }
  137|       |
  138|  7.43M|        else if (126 <= i && i < 254) {
  ------------------
  |  Branch (138:18): [True: 7.43M, False: 0]
  |  Branch (138:30): [True: 2.57M, False: 4.85M]
  ------------------
  139|  4.13M|          for (j = -6; j <= -2; j++) {
  ------------------
  |  Branch (139:24): [True: 4.05M, False: 89.5k]
  ------------------
  140|  4.05M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (140:24): [True: 4.05M, False: 0]
  |  Branch (140:36): [True: 1.56M, False: 2.48M]
  ------------------
  141|  4.05M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (141:17): [True: 2.48M, False: 1.56M]
  ------------------
  142|  4.05M|          }
  143|  2.57M|          if (is_tonal == 1) {
  ------------------
  |  Branch (143:15): [True: 89.5k, False: 2.48M]
  ------------------
  144|   260k|            for (j = 2; j <= 6; j++) {
  ------------------
  |  Branch (144:25): [True: 239k, False: 20.4k]
  ------------------
  145|   239k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (145:26): [True: 239k, False: 0]
  |  Branch (145:38): [True: 170k, False: 69.0k]
  ------------------
  146|   239k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (146:19): [True: 69.0k, False: 170k]
  ------------------
  147|   239k|            }
  148|  89.5k|          }
  149|       |
  150|  2.57M|          if (is_tonal == 1) {
  ------------------
  |  Branch (150:15): [True: 20.4k, False: 2.55M]
  ------------------
  151|  20.4k|            ptr_tonal_flag[i] = 1;
  152|  20.4k|          }
  153|  2.57M|        }
  154|       |
  155|  4.85M|        else if (254 <= i && i < 500) {
  ------------------
  |  Branch (155:18): [True: 4.85M, False: 0]
  |  Branch (155:30): [True: 4.85M, False: 0]
  ------------------
  156|  9.66M|          for (j = -12; j <= -2; j++) {
  ------------------
  |  Branch (156:25): [True: 9.59M, False: 68.4k]
  ------------------
  157|  9.59M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (157:24): [True: 9.59M, False: 0]
  |  Branch (157:36): [True: 4.80M, False: 4.79M]
  ------------------
  158|  9.59M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (158:17): [True: 4.79M, False: 4.80M]
  ------------------
  159|  9.59M|          }
  160|  4.85M|          if (is_tonal == 1) {
  ------------------
  |  Branch (160:15): [True: 68.4k, False: 4.79M]
  ------------------
  161|   396k|            for (j = 2; j <= 12; j++) {
  ------------------
  |  Branch (161:25): [True: 374k, False: 22.4k]
  ------------------
  162|   374k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (162:26): [True: 374k, False: 0]
  |  Branch (162:38): [True: 327k, False: 46.0k]
  ------------------
  163|   374k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (163:19): [True: 46.0k, False: 327k]
  ------------------
  164|   374k|            }
  165|  68.4k|          }
  166|       |
  167|  4.85M|          if (is_tonal == 1) {
  ------------------
  |  Branch (167:15): [True: 22.4k, False: 4.83M]
  ------------------
  168|  22.4k|            ptr_tonal_flag[i] = 1;
  169|  22.4k|          }
  170|  4.85M|        }
  171|  9.89M|      }
  172|  37.6M|    }
  173|       |
  174|  38.8M|    for (i = 0; i <= 511; i++) {
  ------------------
  |  Branch (174:17): [True: 38.7M, False: 75.6k]
  ------------------
  175|  38.7M|      if (ptr_tonal_flag[i] == 1) {
  ------------------
  |  Branch (175:11): [True: 252k, False: 38.4M]
  ------------------
  176|       |        /* compute the SPL of tonal */
  177|   252k|        tonal_spl =
  178|   252k|            10 * log10(pow(10, (ptr_scratch[i - 1] / 10)) + pow(10, (ptr_scratch[i] / 10)) +
  179|   252k|                       pow(10, (ptr_scratch[i + 1] / 10)));
  180|       |
  181|   252k|        if (i >= 324) {
  ------------------
  |  Branch (181:13): [True: 13.4k, False: 238k]
  ------------------
  182|  13.4k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_1024[i] + 20;
  183|   238k|        } else {
  184|   238k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_1024[i];
  185|   238k|        }
  186|   252k|        if (tonal_spl < absolute_threshold_xm) {
  ------------------
  |  Branch (186:13): [True: 129k, False: 123k]
  ------------------
  187|   129k|          ptr_tonal_flag[i] = 0;
  188|   129k|        }
  189|   252k|      }
  190|  38.7M|    }
  191|  75.6k|  } else  // (ccfl == 768)
  192|  35.6k|  {
  193|  13.7M|    for (i = 0; i <= 383; i++) {
  ------------------
  |  Branch (193:17): [True: 13.6M, False: 35.6k]
  ------------------
  194|  13.6M|      ptr_tonal_flag[i] = 0;
  195|  13.6M|    }
  196|       |
  197|  13.3M|    for (i = 2; i < 375; i++) {
  ------------------
  |  Branch (197:17): [True: 13.2M, False: 35.6k]
  ------------------
  198|  13.2M|      if (ptr_scratch[i] > ptr_scratch[i - 1] && ptr_scratch[i] >= ptr_scratch[i + 1]) {
  ------------------
  |  Branch (198:11): [True: 6.45M, False: 6.83M]
  |  Branch (198:50): [True: 2.43M, False: 4.02M]
  ------------------
  199|  2.43M|        is_tonal = 1;
  200|       |
  201|       |        /* Verify it meets the condition: ptr_scratch[i]-ptr_scratch[i+j]>=7 */
  202|       |
  203|  2.43M|        if (1 < i && i < 47) {
  ------------------
  |  Branch (203:13): [True: 2.43M, False: 0]
  |  Branch (203:22): [True: 98.7k, False: 2.33M]
  ------------------
  204|   123k|          for (j = -2; j <= -2; j++) {
  ------------------
  |  Branch (204:24): [True: 98.7k, False: 24.7k]
  ------------------
  205|  98.7k|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (205:24): [True: 98.7k, False: 0]
  |  Branch (205:36): [True: 24.7k, False: 74.0k]
  ------------------
  206|  98.7k|            if (is_tonal == 0) break;
  ------------------
  |  Branch (206:17): [True: 74.0k, False: 24.7k]
  ------------------
  207|  98.7k|          }
  208|  98.7k|          if (is_tonal == 1) {
  ------------------
  |  Branch (208:15): [True: 24.7k, False: 74.0k]
  ------------------
  209|  40.5k|            for (j = 2; j <= 2; j++) {
  ------------------
  |  Branch (209:25): [True: 24.7k, False: 15.7k]
  ------------------
  210|  24.7k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (210:26): [True: 24.7k, False: 0]
  |  Branch (210:38): [True: 15.7k, False: 8.97k]
  ------------------
  211|  24.7k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (211:19): [True: 8.97k, False: 15.7k]
  ------------------
  212|  24.7k|            }
  213|  24.7k|          }
  214|       |
  215|  98.7k|          if (is_tonal == 1) {
  ------------------
  |  Branch (215:15): [True: 15.7k, False: 82.9k]
  ------------------
  216|  15.7k|            ptr_tonal_flag[i] = 1;
  217|  15.7k|          }
  218|  98.7k|        }
  219|       |
  220|  2.33M|        else if (47 <= i && i < 95) {
  ------------------
  |  Branch (220:18): [True: 2.33M, False: 0]
  |  Branch (220:29): [True: 370k, False: 1.96M]
  ------------------
  221|   457k|          for (j = -3; j <= -2; j++) {
  ------------------
  |  Branch (221:24): [True: 417k, False: 39.7k]
  ------------------
  222|   417k|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (222:24): [True: 417k, False: 0]
  |  Branch (222:36): [True: 86.6k, False: 331k]
  ------------------
  223|   417k|            if (is_tonal == 0) break;
  ------------------
  |  Branch (223:17): [True: 331k, False: 86.6k]
  ------------------
  224|   417k|          }
  225|   370k|          if (is_tonal == 1) {
  ------------------
  |  Branch (225:15): [True: 39.7k, False: 331k]
  ------------------
  226|   103k|            for (j = 2; j <= 3; j++) {
  ------------------
  |  Branch (226:25): [True: 72.2k, False: 30.7k]
  ------------------
  227|  72.2k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (227:26): [True: 72.2k, False: 0]
  |  Branch (227:38): [True: 63.2k, False: 8.97k]
  ------------------
  228|  72.2k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (228:19): [True: 8.97k, False: 63.2k]
  ------------------
  229|  72.2k|            }
  230|  39.7k|          }
  231|       |
  232|   370k|          if (is_tonal == 1) {
  ------------------
  |  Branch (232:15): [True: 30.7k, False: 340k]
  ------------------
  233|  30.7k|            ptr_tonal_flag[i] = 1;
  234|  30.7k|          }
  235|   370k|        }
  236|       |
  237|  1.96M|        else if (95 <= i && i < 194) {
  ------------------
  |  Branch (237:18): [True: 1.96M, False: 0]
  |  Branch (237:29): [True: 772k, False: 1.19M]
  ------------------
  238|  1.25M|          for (j = -5; j <= -2; j++) {
  ------------------
  |  Branch (238:24): [True: 1.15M, False: 100k]
  ------------------
  239|  1.15M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (239:24): [True: 1.15M, False: 0]
  |  Branch (239:36): [True: 479k, False: 671k]
  ------------------
  240|  1.15M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (240:17): [True: 671k, False: 479k]
  ------------------
  241|  1.15M|          }
  242|   772k|          if (is_tonal == 1) {
  ------------------
  |  Branch (242:15): [True: 100k, False: 671k]
  ------------------
  243|   451k|            for (j = 2; j <= 5; j++) {
  ------------------
  |  Branch (243:25): [True: 367k, False: 84.3k]
  ------------------
  244|   367k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (244:26): [True: 367k, False: 0]
  |  Branch (244:38): [True: 351k, False: 16.5k]
  ------------------
  245|   367k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (245:19): [True: 16.5k, False: 351k]
  ------------------
  246|   367k|            }
  247|   100k|          }
  248|       |
  249|   772k|          if (is_tonal == 1) {
  ------------------
  |  Branch (249:15): [True: 84.3k, False: 687k]
  ------------------
  250|  84.3k|            ptr_tonal_flag[i] = 1;
  251|  84.3k|          }
  252|   772k|        }
  253|       |
  254|  1.19M|        else if (191 <= i && i < 375) {
  ------------------
  |  Branch (254:18): [True: 1.19M, False: 0]
  |  Branch (254:30): [True: 1.19M, False: 0]
  ------------------
  255|  2.53M|          for (j = -9; j <= -2; j++) {
  ------------------
  |  Branch (255:24): [True: 2.41M, False: 121k]
  ------------------
  256|  2.41M|            is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (256:24): [True: 2.41M, False: 0]
  |  Branch (256:36): [True: 1.34M, False: 1.06M]
  ------------------
  257|  2.41M|            if (is_tonal == 0) break;
  ------------------
  |  Branch (257:17): [True: 1.06M, False: 1.34M]
  ------------------
  258|  2.41M|          }
  259|  1.19M|          if (is_tonal == 1) {
  ------------------
  |  Branch (259:15): [True: 121k, False: 1.06M]
  ------------------
  260|   934k|            for (j = 2; j <= 9; j++) {
  ------------------
  |  Branch (260:25): [True: 855k, False: 79.1k]
  ------------------
  261|   855k|              is_tonal = is_tonal && ptr_scratch[i] - ptr_scratch[i + j] >= 7;
  ------------------
  |  Branch (261:26): [True: 855k, False: 0]
  |  Branch (261:38): [True: 813k, False: 41.8k]
  ------------------
  262|   855k|              if (is_tonal == 0) break;
  ------------------
  |  Branch (262:19): [True: 41.8k, False: 813k]
  ------------------
  263|   855k|            }
  264|   121k|          }
  265|       |
  266|  1.19M|          if (is_tonal == 1) {
  ------------------
  |  Branch (266:15): [True: 79.1k, False: 1.11M]
  ------------------
  267|  79.1k|            ptr_tonal_flag[i] = 1;
  268|  79.1k|          }
  269|  1.19M|        }
  270|  2.43M|      }
  271|  13.2M|    }
  272|       |
  273|  13.7M|    for (i = 0; i <= 383; i++) {
  ------------------
  |  Branch (273:17): [True: 13.6M, False: 35.6k]
  ------------------
  274|  13.6M|      if (ptr_tonal_flag[i] == 1) {
  ------------------
  |  Branch (274:11): [True: 210k, False: 13.4M]
  ------------------
  275|       |        /* compute the SPL of tonal */
  276|   210k|        tonal_spl =
  277|   210k|            10 * log10(pow(10, (ptr_scratch[i - 1] / 10)) + pow(10, (ptr_scratch[i] / 10)) +
  278|   210k|                       pow(10, (ptr_scratch[i + 1] / 10)));
  279|       |
  280|   210k|        if (i >= 243) {
  ------------------
  |  Branch (280:13): [True: 66.0k, False: 143k]
  ------------------
  281|  66.0k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_768[i] + 20;
  282|   143k|        } else {
  283|   143k|          absolute_threshold_xm = iusace_classify_arrays.absolute_threshold_768[i];
  284|   143k|        }
  285|   210k|        if (tonal_spl < absolute_threshold_xm) {
  ------------------
  |  Branch (285:13): [True: 52.0k, False: 157k]
  ------------------
  286|  52.0k|          ptr_tonal_flag[i] = 0;
  287|  52.0k|        }
  288|   210k|      }
  289|  13.6M|    }
  290|  35.6k|  }
  291|   111k|  return;
  292|   111k|}
ixheaace_signal_classifier.c:iusace_spectral_tilt_analysis:
  380|   111k|                                          WORD32 ccfl) {
  381|   111k|  FLOAT32 *ptr_time_signal = ptr_spec_params->time_signal;
  382|   111k|  WORD32 framecnt_xm = ptr_spec_params->framecnt_xm;
  383|   111k|  FLOAT32 *ptr_spec_tilt_buf = ptr_spec_params->spec_tilt_buf;
  384|   111k|  FLOAT32 *ptr_msd_spec_tilt = ptr_spec_params->msd_spec_tilt;
  385|   111k|  FLOAT32 *ptr_msd_spec_tilt_short = ptr_spec_params->msd_spec_tilt_short;
  386|   111k|  WORD32 i;
  387|   111k|  WORD32 frame_length;
  388|       |
  389|   111k|  FLOAT32 r0, r1;
  390|   111k|  FLOAT32 spec_tilt;
  391|   111k|  FLOAT32 ave_spec_tilt;
  392|       |
  393|       |  /* compute spectral tilt */
  394|   111k|  r0 = 0;
  395|   111k|  r1 = 0;
  396|   104M|  for (i = 0; i < ccfl - 1; i++) {
  ------------------
  |  Branch (396:15): [True: 104M, False: 111k]
  ------------------
  397|   104M|    r0 += ptr_time_signal[i] * ptr_time_signal[i];
  398|   104M|    r1 += ptr_time_signal[i] * ptr_time_signal[i + 1];
  399|   104M|  }
  400|   111k|  r0 += ptr_time_signal[i] * ptr_time_signal[i];
  401|       |
  402|   111k|  if (r0 == 0) {
  ------------------
  |  Branch (402:7): [True: 3.67k, False: 107k]
  ------------------
  403|  3.67k|    spec_tilt = 1.0f;
  404|   107k|  } else {
  405|   107k|    spec_tilt = r1 / r0;
  406|   107k|  }
  407|       |
  408|       |  /* update spec_tilt_buf */
  409|  11.1M|  for (i = 0; i < 100 - 1; i++) {
  ------------------
  |  Branch (409:15): [True: 11.0M, False: 111k]
  ------------------
  410|  11.0M|    ptr_spec_tilt_buf[i] = ptr_spec_tilt_buf[i + 1];
  411|  11.0M|  }
  412|   111k|  ptr_spec_tilt_buf[99] = spec_tilt;
  413|       |
  414|       |  /* compute the long-term mean square deviation of the spectral tilt */
  415|   111k|  if (framecnt_xm < SPECTRAL_TILT_LENGTH) {
  ------------------
  |  |   30|   111k|#define SPECTRAL_TILT_LENGTH 80
  ------------------
  |  Branch (415:7): [True: 55.1k, False: 56.1k]
  ------------------
  416|  55.1k|    frame_length = framecnt_xm;
  417|  56.1k|  } else {
  418|  56.1k|    frame_length = SPECTRAL_TILT_LENGTH;
  ------------------
  |  |   30|  56.1k|#define SPECTRAL_TILT_LENGTH 80
  ------------------
  419|  56.1k|  }
  420|       |
  421|   111k|  ave_spec_tilt = 0;
  422|  6.42M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (422:15): [True: 6.31M, False: 111k]
  ------------------
  423|  6.31M|    ave_spec_tilt += ptr_spec_tilt_buf[99 - i];
  424|  6.31M|  }
  425|   111k|  ave_spec_tilt /= frame_length;
  426|       |
  427|   111k|  *ptr_msd_spec_tilt = 0;
  428|  6.42M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (428:15): [True: 6.31M, False: 111k]
  ------------------
  429|  6.31M|    *ptr_msd_spec_tilt +=
  430|  6.31M|        (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt) * (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt);
  431|  6.31M|  }
  432|   111k|  *ptr_msd_spec_tilt /= frame_length;
  433|       |
  434|       |  /* compute the short-term mean square deviation of the spectral tilt */
  435|   111k|  if (framecnt_xm < SPECTRAL_TILT_LENGTH_SHORT) {
  ------------------
  |  |   31|   111k|#define SPECTRAL_TILT_LENGTH_SHORT 20
  ------------------
  |  Branch (435:7): [True: 19.5k, False: 91.7k]
  ------------------
  436|  19.5k|    frame_length = framecnt_xm;
  437|  91.7k|  } else {
  438|  91.7k|    frame_length = SPECTRAL_TILT_LENGTH_SHORT;
  ------------------
  |  |   31|  91.7k|#define SPECTRAL_TILT_LENGTH_SHORT 20
  ------------------
  439|  91.7k|  }
  440|       |
  441|   111k|  ave_spec_tilt = 0;
  442|  2.13M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (442:15): [True: 2.01M, False: 111k]
  ------------------
  443|  2.01M|    ave_spec_tilt += ptr_spec_tilt_buf[99 - i];
  444|  2.01M|  }
  445|   111k|  ave_spec_tilt /= frame_length;
  446|       |
  447|   111k|  *ptr_msd_spec_tilt_short = 0;
  448|  2.13M|  for (i = 0; i < frame_length; i++) {
  ------------------
  |  Branch (448:15): [True: 2.01M, False: 111k]
  ------------------
  449|  2.01M|    *ptr_msd_spec_tilt_short +=
  450|  2.01M|        (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt) * (ptr_spec_tilt_buf[99 - i] - ave_spec_tilt);
  451|  2.01M|  }
  452|   111k|  *ptr_msd_spec_tilt_short /= frame_length;
  453|       |
  454|       |  /* compute the energy of current frame */
  455|   111k|  if (r0 <= 1) {
  ------------------
  |  Branch (455:7): [True: 4.66k, False: 106k]
  ------------------
  456|  4.66k|    ptr_spec_params->frame_energy = 0;
  457|   106k|  } else {
  458|   106k|    ptr_spec_params->frame_energy = (FLOAT32)(10 * log(r0) / log(10));
  459|   106k|  }
  460|   111k|  return;
  461|   111k|}
ixheaace_signal_classifier.c:iusace_init_mode_decision:
  463|   111k|static WORD32 iusace_init_mode_decision(ia_mode_params_struct *pstr_mode_params) {
  464|   111k|  WORD32 i;
  465|   111k|  WORD32 framecnt = pstr_mode_params->framecnt;
  466|   111k|  WORD32 *framecnt_xm = pstr_mode_params->framecnt_xm;
  467|   111k|  WORD32 *flag_border = pstr_mode_params->flag_border;
  468|   111k|  FLOAT32 ave_n_tonal_short = pstr_mode_params->ave_n_tonal_short;
  469|   111k|  FLOAT32 ave_n_tonal = pstr_mode_params->ave_n_tonal;
  470|   111k|  FLOAT32 *ave_n_tonal_short_buf = pstr_mode_params->ave_n_tonal_short_buf;
  471|   111k|  FLOAT32 *ave_n_tonal_buf = pstr_mode_params->ave_n_tonal_buf;
  472|   111k|  FLOAT32 msd_spec_tilt = pstr_mode_params->msd_spec_tilt;
  473|   111k|  FLOAT32 msd_spec_tilt_short = pstr_mode_params->msd_spec_tilt_short;
  474|   111k|  FLOAT32 *msd_spec_tilt_buf = pstr_mode_params->msd_spec_tilt_buf;
  475|   111k|  FLOAT32 *msd_spec_tilt_short_buf = pstr_mode_params->msd_spec_tilt_short_buf;
  476|   111k|  FLOAT32 n_tonal_low_frequency_ratio = pstr_mode_params->n_tonal_low_frequency_ratio;
  477|   111k|  FLOAT32 frame_energy = pstr_mode_params->frame_energy;
  478|   111k|  WORD32 init_mode_decision_result = TBD;
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  479|   111k|  WORD32 count_msd_st_monchhichi = 0;
  480|   111k|  WORD32 count_msd_st_speech_music = 0, count_msd_st_music_speech = 0;
  481|   111k|  WORD32 flag_ave_music_speech = 0;
  482|   111k|  WORD32 count_msd_st_music = 0;
  483|   111k|  WORD32 border_state = 0;
  484|   111k|  WORD32 count_quiet_mode = 0;
  485|       |
  486|   111k|  *flag_border = NO_BORDER;
  ------------------
  |  |   34|   111k|#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|   556k|  for (i = 0; i < 5 - 1; i++) {
  ------------------
  |  Branch (491:15): [True: 445k, False: 111k]
  ------------------
  492|   445k|    msd_spec_tilt_buf[i] = msd_spec_tilt_buf[i + 1];
  493|   445k|    msd_spec_tilt_short_buf[i] = msd_spec_tilt_short_buf[i + 1];
  494|   445k|  }
  495|   111k|  msd_spec_tilt_buf[4] = msd_spec_tilt;
  496|   111k|  msd_spec_tilt_short_buf[4] = msd_spec_tilt_short;
  497|       |
  498|       |  /* speech->music find strict border of speech->music */
  499|   111k|  if ((msd_spec_tilt >= 0.014) && (msd_spec_tilt_short <= 0.000005)) {
  ------------------
  |  Branch (499:7): [True: 35.2k, False: 76.0k]
  |  Branch (499:35): [True: 2.95k, False: 32.2k]
  ------------------
  500|  2.95k|    count_msd_st_monchhichi++;
  501|   108k|  } else {
  502|   108k|    count_msd_st_monchhichi = 0;
  503|   108k|  }
  504|   111k|  if (((*flag_border != BORDER_SPEECH_MUSIC_DEFINITE) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (504:8): [True: 111k, False: 0]
  ------------------
  505|   111k|       (*flag_border != BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   111k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (505:8): [True: 111k, False: 0]
  ------------------
  506|   111k|      (border_state != BORDER_SPEECH_MUSIC_DEFINITE) && (count_msd_st_monchhichi >= 15) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (506:7): [True: 111k, False: 0]
  |  Branch (506:57): [True: 0, False: 111k]
  ------------------
  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|   111k|  if ((msd_spec_tilt >= 0.0025) && (msd_spec_tilt_short <= 0.000003)) {
  ------------------
  |  Branch (513:7): [True: 44.4k, False: 66.8k]
  |  Branch (513:36): [True: 5.24k, False: 39.2k]
  ------------------
  514|  5.24k|    count_msd_st_speech_music++;
  515|   106k|  } else {
  516|   106k|    count_msd_st_speech_music = 0;
  517|   106k|  }
  518|   111k|  if (((*flag_border != BORDER_SPEECH_MUSIC_DEFINITE) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (518:8): [True: 111k, False: 0]
  ------------------
  519|   111k|       (*flag_border != BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   111k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (519:8): [True: 111k, False: 0]
  ------------------
  520|   111k|      (border_state != BORDER_SPEECH_MUSIC_DEFINITE) && (count_msd_st_speech_music >= 15) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (520:7): [True: 111k, False: 0]
  |  Branch (520:57): [True: 0, False: 111k]
  ------------------
  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|   111k|  if ((msd_spec_tilt_buf[0] <= 0.0003) && (msd_spec_tilt_short_buf[0] <= 0.0002)) {
  ------------------
  |  Branch (527:7): [True: 62.1k, False: 49.2k]
  |  Branch (527:43): [True: 61.2k, False: 822]
  ------------------
  528|  61.2k|    count_msd_st_music_speech++;
  529|  61.2k|  }
  530|   111k|  if (((*flag_border != BORDER_SPEECH_MUSIC_DEFINITE) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (530:8): [True: 111k, False: 0]
  ------------------
  531|   111k|       (*flag_border != BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   111k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (531:8): [True: 111k, False: 0]
  ------------------
  532|   111k|      (border_state != BORDER_MUSIC_SPEECH_DEFINITE) && (count_msd_st_music_speech >= 100) &&
  ------------------
  |  |   36|   111k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (532:7): [True: 111k, False: 0]
  |  Branch (532:57): [True: 0, False: 111k]
  ------------------
  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|   556k|  for (i = 0; i < 5 - 1; i++) {
  ------------------
  |  Branch (540:15): [True: 445k, False: 111k]
  ------------------
  541|   445k|    ave_n_tonal_short_buf[i] = ave_n_tonal_short_buf[i + 1];
  542|   445k|    ave_n_tonal_buf[i] = ave_n_tonal_buf[i + 1];
  543|   445k|  }
  544|   111k|  ave_n_tonal_short_buf[4] = ave_n_tonal_short;
  545|   111k|  ave_n_tonal_buf[4] = ave_n_tonal;
  546|       |
  547|       |  /* music->speech */
  548|   111k|  if ((ave_n_tonal_buf[0] >= 12) && (ave_n_tonal_buf[0] < 15) &&
  ------------------
  |  Branch (548:7): [True: 4.78k, False: 106k]
  |  Branch (548:37): [True: 4.10k, False: 681]
  ------------------
  549|  4.10k|      (ave_n_tonal_buf[0] - ave_n_tonal_short_buf[0] >= 5) && (*framecnt_xm >= 20) &&
  ------------------
  |  Branch (549:7): [True: 320, False: 3.78k]
  |  Branch (549:63): [True: 99, False: 221]
  ------------------
  550|     99|      (ave_n_tonal_short - ave_n_tonal_short_buf[0] < 5)) {
  ------------------
  |  Branch (550:7): [True: 96, False: 3]
  ------------------
  551|     96|    *framecnt_xm = 10;
  552|     96|    flag_ave_music_speech = 1;
  553|     96|    *flag_border = BORDER_MUSIC_SPEECH_DEFINITE;
  ------------------
  |  |   36|     96|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  554|     96|  }
  555|       |
  556|       |  /* update border decision according to energy */
  557|   111k|  if (frame_energy <= 60) {
  ------------------
  |  Branch (557:7): [True: 4.84k, False: 106k]
  ------------------
  558|  4.84k|    count_quiet_mode = 0;
  559|   106k|  } else {
  560|   106k|    count_quiet_mode++;
  561|   106k|  }
  562|       |
  563|   111k|  if ((*flag_border == BORDER_MUSIC_SPEECH) && (count_quiet_mode <= 5)) {
  ------------------
  |  |   35|   111k|#define BORDER_MUSIC_SPEECH 1
  ------------------
  |  Branch (563:7): [True: 0, False: 111k]
  |  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|   111k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal_short >= 19)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (571:7): [True: 111k, False: 0]
  |  Branch (571:45): [True: 999, False: 110k]
  ------------------
  572|    999|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|    999|#define MUSIC_DEFINITE 3
  ------------------
  573|    999|  }
  574|   111k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal_short <= 1.5)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (574:7): [True: 110k, False: 999]
  |  Branch (574:45): [True: 57.5k, False: 52.7k]
  ------------------
  575|  57.5k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  57.5k|#define SPEECH_DEFINITE 1
  ------------------
  576|  57.5k|  }
  577|       |
  578|       |  /* msd_spec_tilt_short */
  579|   111k|  if (msd_spec_tilt_short >= 0.02) {
  ------------------
  |  Branch (579:7): [True: 26.7k, False: 84.5k]
  ------------------
  580|  26.7k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  26.7k|#define SPEECH_DEFINITE 1
  ------------------
  581|  26.7k|  }
  582|   111k|  if ((init_mode_decision_result == TBD) && (msd_spec_tilt_short <= 0.00000025) &&
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (582:7): [True: 39.2k, False: 72.0k]
  |  Branch (582:45): [True: 14.4k, False: 24.8k]
  ------------------
  583|  14.4k|      (framecnt >= 10)) {
  ------------------
  |  Branch (583:7): [True: 12.3k, False: 2.09k]
  ------------------
  584|  12.3k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  12.3k|#define MUSIC_DEFINITE 3
  ------------------
  585|  12.3k|  }
  586|       |
  587|       |  /* SPEECH mode decision */
  588|       |
  589|       |  /* flag_ave_music_speech??ave_n_tonal_short */
  590|   111k|  if ((init_mode_decision_result == TBD) && (flag_ave_music_speech == 1)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (590:7): [True: 26.9k, False: 84.3k]
  |  Branch (590:45): [True: 50, False: 26.9k]
  ------------------
  591|     50|    if ((ave_n_tonal_short <= 12) && (*framecnt_xm <= 150)) {
  ------------------
  |  Branch (591:9): [True: 41, False: 9]
  |  Branch (591:38): [True: 41, False: 0]
  ------------------
  592|     41|      init_mode_decision_result = SPEECH;
  ------------------
  |  |   42|     41|#define SPEECH 2
  ------------------
  593|     41|    }
  594|     50|  }
  595|       |
  596|       |  /* MUSIC_DEFINITE and SPEECH_DEFINITE mode decision */
  597|       |
  598|       |  /* ave_n_tonal */
  599|   111k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal <= 3)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (599:7): [True: 26.9k, False: 84.3k]
  |  Branch (599:45): [True: 14.9k, False: 11.9k]
  ------------------
  600|  14.9k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  14.9k|#define SPEECH_DEFINITE 1
  ------------------
  601|  14.9k|  }
  602|   111k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal >= 15)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (602:7): [True: 11.9k, False: 99.3k]
  |  Branch (602:45): [True: 466, False: 11.5k]
  ------------------
  603|    466|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|    466|#define MUSIC_DEFINITE 3
  ------------------
  604|    466|  }
  605|       |
  606|       |  /** ave_n_tonal_short
  607|       |   */
  608|   111k|  if ((init_mode_decision_result == TBD) && (ave_n_tonal_short >= 17)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (608:7): [True: 11.5k, False: 99.7k]
  |  Branch (608:45): [True: 843, False: 10.6k]
  ------------------
  609|    843|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|    843|#define MUSIC_DEFINITE 3
  ------------------
  610|    843|  }
  611|       |
  612|       |  /** msd_spec_tilt
  613|       |   */
  614|   111k|  if ((init_mode_decision_result == TBD) && (msd_spec_tilt >= 0.01)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (614:7): [True: 10.6k, False: 100k]
  |  Branch (614:45): [True: 3.48k, False: 7.20k]
  ------------------
  615|  3.48k|    init_mode_decision_result = SPEECH_DEFINITE;
  ------------------
  |  |   41|  3.48k|#define SPEECH_DEFINITE 1
  ------------------
  616|  3.48k|  }
  617|   111k|  if ((init_mode_decision_result == TBD) && (framecnt >= 10) && (msd_spec_tilt <= 0.00004)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (617:7): [True: 7.20k, False: 104k]
  |  Branch (617:45): [True: 5.38k, False: 1.82k]
  |  Branch (617:65): [True: 1.81k, False: 3.56k]
  ------------------
  618|  1.81k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  1.81k|#define MUSIC_DEFINITE 3
  ------------------
  619|  1.81k|  }
  620|       |
  621|       |  /** n_tonal_low_frequency_ratio
  622|       |   */
  623|   111k|  if ((init_mode_decision_result == TBD) && (n_tonal_low_frequency_ratio <= 0.91)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (623:7): [True: 5.38k, False: 105k]
  |  Branch (623:45): [True: 2.29k, False: 3.08k]
  ------------------
  624|  2.29k|    init_mode_decision_result = MUSIC_DEFINITE;
  ------------------
  |  |   43|  2.29k|#define MUSIC_DEFINITE 3
  ------------------
  625|  2.29k|  }
  626|       |
  627|       |  /** MUSIC and SPEECH mode decision
  628|       |   */
  629|       |
  630|       |  /** msd_spec_tilt
  631|       |   */
  632|   111k|  if ((init_mode_decision_result == TBD) && (msd_spec_tilt <= 0.0002) && (*framecnt_xm >= 15)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (632:7): [True: 3.08k, False: 108k]
  |  Branch (632:45): [True: 1.79k, False: 1.28k]
  |  Branch (632:74): [True: 456, False: 1.34k]
  ------------------
  633|    456|    init_mode_decision_result = MUSIC;
  ------------------
  |  |   44|    456|#define MUSIC 4
  ------------------
  634|    456|  }
  635|       |
  636|       |  /** n_tonal_low_frequency_ratio
  637|       |   */
  638|   111k|  if ((init_mode_decision_result == TBD) && (n_tonal_low_frequency_ratio >= 0.95)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (638:7): [True: 2.62k, False: 108k]
  |  Branch (638:45): [True: 1.26k, False: 1.36k]
  ------------------
  639|  1.26k|    init_mode_decision_result = SPEECH;
  ------------------
  |  |   42|  1.26k|#define SPEECH 2
  ------------------
  640|  1.26k|  }
  641|   111k|  if ((init_mode_decision_result == TBD) && (n_tonal_low_frequency_ratio <= 0.935)) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (641:7): [True: 1.36k, False: 109k]
  |  Branch (641:45): [True: 829, False: 533]
  ------------------
  642|    829|    init_mode_decision_result = MUSIC;
  ------------------
  |  |   44|    829|#define MUSIC 4
  ------------------
  643|    829|  }
  644|       |
  645|       |  /** the rest of the frame to SPEECH
  646|       |   */
  647|   111k|  if (init_mode_decision_result == TBD) {
  ------------------
  |  |   40|   111k|#define TBD 0
  ------------------
  |  Branch (647:7): [True: 533, False: 110k]
  ------------------
  648|    533|    init_mode_decision_result = SPEECH;
  ------------------
  |  |   42|    533|#define SPEECH 2
  ------------------
  649|    533|  }
  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|   111k|  if ((msd_spec_tilt <= 0.007) && (init_mode_decision_result != SPEECH_DEFINITE)) {
  ------------------
  |  |   41|  73.3k|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (656:7): [True: 73.3k, False: 37.9k]
  |  Branch (656:35): [True: 18.4k, False: 54.9k]
  ------------------
  657|  18.4k|    if (init_mode_decision_result != SPEECH) {
  ------------------
  |  |   42|  18.4k|#define SPEECH 2
  ------------------
  |  Branch (657:9): [True: 16.7k, False: 1.65k]
  ------------------
  658|  16.7k|      count_msd_st_music++;
  659|  16.7k|    }
  660|  92.8k|  } else {
  661|  92.8k|    count_msd_st_music = 0;
  662|  92.8k|  }
  663|       |
  664|   111k|  if ((init_mode_decision_result != SPEECH_DEFINITE) && (count_msd_st_music >= 400) &&
  ------------------
  |  |   41|   111k|#define SPEECH_DEFINITE 1
  ------------------
  |  Branch (664:7): [True: 21.7k, False: 89.6k]
  |  Branch (664:57): [True: 0, False: 21.7k]
  ------------------
  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|   111k|  if (*flag_border != NO_BORDER) {
  ------------------
  |  |   34|   111k|#define NO_BORDER 0
  ------------------
  |  Branch (672:7): [True: 96, False: 111k]
  ------------------
  673|     96|    border_state = *flag_border;
  674|     96|  }
  675|       |
  676|       |  /** update BORDER_SPEECH_MUSIC_DEFINITE
  677|       |   */
  678|   111k|  if (((border_state == BORDER_MUSIC_SPEECH) || (border_state == BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   35|   111k|#define BORDER_MUSIC_SPEECH 1
  ------------------
                if (((border_state == BORDER_MUSIC_SPEECH) || (border_state == BORDER_MUSIC_SPEECH_DEFINITE)) &&
  ------------------
  |  |   36|   111k|#define BORDER_MUSIC_SPEECH_DEFINITE 2
  ------------------
  |  Branch (678:8): [True: 0, False: 111k]
  |  Branch (678:49): [True: 96, False: 111k]
  ------------------
  679|     96|      (init_mode_decision_result == MUSIC_DEFINITE) && (*framecnt_xm >= 20)) {
  ------------------
  |  |   43|     96|#define MUSIC_DEFINITE 3
  ------------------
  |  Branch (679:7): [True: 9, False: 87]
  |  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|   111k|  if (((border_state == BORDER_SPEECH_MUSIC) || (border_state == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   37|   111k|#define BORDER_SPEECH_MUSIC 3
  ------------------
                if (((border_state == BORDER_SPEECH_MUSIC) || (border_state == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (687:8): [True: 0, False: 111k]
  |  Branch (687:49): [True: 0, False: 111k]
  ------------------
  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|   111k|  return init_mode_decision_result;
  694|   111k|}
ixheaace_signal_classifier.c:iusace_smoothing_mode_decision:
  696|   111k|static WORD32 iusace_smoothing_mode_decision(ia_smooth_params_struct *pstr_smooth_param) {
  697|   111k|  WORD32 *ptr_init_result_ahead = pstr_smooth_param->init_result_ahead;
  698|   111k|  WORD32 flag_border = pstr_smooth_param->flag_border;
  699|   111k|  WORD32 *ptr_flag_border_buf_behind = pstr_smooth_param->flag_border_buf_behind;
  700|   111k|  WORD32 *ptr_flag_border_buf_ahead = pstr_smooth_param->flag_border_buf_ahead;
  701|   111k|  FLOAT32 frame_energy = pstr_smooth_param->frame_energy;
  702|   111k|  FLOAT32 *ptr_frame_energy_buf_behind = pstr_smooth_param->frame_energy_buf_behind;
  703|   111k|  FLOAT32 *ptr_frame_energy_buf_ahead = pstr_smooth_param->frame_energy_buf_ahead;
  704|   111k|  WORD32 *ptr_smoothing_result_buf = pstr_smooth_param->smoothing_result_buf;
  705|   111k|  WORD32 *ptr_init_result_behind = pstr_smooth_param->init_result_behind;
  706|   111k|  WORD32 init_mode_decision_result = pstr_smooth_param->init_mode_decision_result;
  707|   111k|  WORD32 i;
  708|       |
  709|   111k|  WORD32 mode_decision_result;
  710|       |
  711|   111k|  WORD32 num_music, num_speech;
  712|       |
  713|       |  /** update data array
  714|       |   */
  715|       |
  716|       |  /** update init_result_behind, init_result_ahead
  717|       |   */
  718|  11.1M|  for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (718:15): [True: 11.0M, False: 111k]
  ------------------
  719|  11.0M|    ptr_init_result_behind[i] = ptr_init_result_behind[i + 1];
  720|  11.0M|  }
  721|   111k|  ptr_init_result_behind[99] = ptr_init_result_ahead[0];
  722|       |
  723|   111k|  ptr_init_result_ahead[NFRAMEAHEAD - 1] = init_mode_decision_result;
  ------------------
  |  |   27|   111k|#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.11M|  for (i = 0; i < 9; i++) {
  ------------------
  |  Branch (729:15): [True: 1.00M, False: 111k]
  ------------------
  730|  1.00M|    ptr_flag_border_buf_behind[i] = ptr_flag_border_buf_behind[i + 1];
  731|  1.00M|    ptr_frame_energy_buf_behind[i] = ptr_frame_energy_buf_behind[i + 1];
  732|  1.00M|  }
  733|   111k|  ptr_flag_border_buf_behind[9] = ptr_flag_border_buf_ahead[0];
  734|   111k|  ptr_frame_energy_buf_behind[9] = ptr_frame_energy_buf_ahead[0];
  735|       |
  736|   111k|  ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] = flag_border;
  ------------------
  |  |   27|   111k|#define NFRAMEAHEAD 1
  ------------------
  737|       |
  738|   111k|  ptr_frame_energy_buf_ahead[NFRAMEAHEAD - 1] = frame_energy;
  ------------------
  |  |   27|   111k|#define NFRAMEAHEAD 1
  ------------------
  739|       |
  740|       |  /** smoothing according to past results
  741|       |   */
  742|       |
  743|   111k|  mode_decision_result = ptr_init_result_behind[99];
  744|       |
  745|       |  /** update smoothing_result_buf
  746|       |   */
  747|   111k|  if (ptr_flag_border_buf_behind[9] == NO_BORDER) {
  ------------------
  |  |   34|   111k|#define NO_BORDER 0
  ------------------
  |  Branch (747:7): [True: 111k, False: 96]
  ------------------
  748|  11.1M|    for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (748:17): [True: 11.0M, False: 111k]
  ------------------
  749|  11.0M|      ptr_smoothing_result_buf[i] = ptr_smoothing_result_buf[i + 1];
  750|  11.0M|    }
  751|   111k|    pstr_smooth_param->num_smoothing++;
  752|   111k|  } else {
  753|  9.60k|    for (i = 0; i < 99; i++) {
  ------------------
  |  Branch (753:17): [True: 9.50k, False: 96]
  ------------------
  754|  9.50k|      ptr_smoothing_result_buf[i] = TBD;
  ------------------
  |  |   40|  9.50k|#define TBD 0
  ------------------
  755|  9.50k|    }
  756|     96|    pstr_smooth_param->num_smoothing = 1;
  757|     96|  }
  758|   111k|  ptr_smoothing_result_buf[99] = ptr_init_result_behind[99];
  759|       |
  760|   111k|  if (pstr_smooth_param->num_smoothing >= SMOOTHING_LENGTH) {
  ------------------
  |  |   32|   111k|#define SMOOTHING_LENGTH 100
  ------------------
  |  Branch (760:7): [True: 0, False: 111k]
  ------------------
  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|   111k|  if ((mode_decision_result == MUSIC) && (ptr_frame_energy_buf_behind[9] <= 60)) {
  ------------------
  |  |   44|   111k|#define MUSIC 4
  ------------------
  |  Branch (788:7): [True: 1.27k, False: 110k]
  |  Branch (788:42): [True: 7, False: 1.26k]
  ------------------
  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|   111k|  if ((pstr_smooth_param->flag_speech_definite == 1) && (mode_decision_result == MUSIC)) {
  ------------------
  |  |   44|      5|#define MUSIC 4
  ------------------
  |  Branch (795:7): [True: 5, False: 111k]
  |  Branch (795:57): [True: 5, False: 0]
  ------------------
  796|      5|    mode_decision_result = SPEECH;
  ------------------
  |  |   42|      5|#define SPEECH 2
  ------------------
  797|   111k|  } else {
  798|   111k|    pstr_smooth_param->flag_speech_definite = 0;
  799|   111k|  }
  800|       |
  801|       |  /** correct MUSIC mode
  802|       |   */
  803|       |
  804|   111k|  if (ptr_frame_energy_buf_behind[9] <= 65) {
  ------------------
  |  Branch (804:7): [True: 6.10k, False: 105k]
  ------------------
  805|  6.10k|    pstr_smooth_param->count_small_energy = 0;
  806|   105k|  } else {
  807|   105k|    pstr_smooth_param->count_small_energy++;
  808|   105k|  }
  809|   111k|  if (((ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC) ||
  ------------------
  |  |   27|   111k|#define NFRAMEAHEAD 1
  ------------------
                if (((ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC) ||
  ------------------
  |  |   37|   111k|#define BORDER_SPEECH_MUSIC 3
  ------------------
  |  Branch (809:8): [True: 0, False: 111k]
  ------------------
  810|   111k|       (ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   27|   111k|#define NFRAMEAHEAD 1
  ------------------
                     (ptr_flag_border_buf_ahead[NFRAMEAHEAD - 1] == BORDER_SPEECH_MUSIC_DEFINITE)) &&
  ------------------
  |  |   38|   111k|#define BORDER_SPEECH_MUSIC_DEFINITE 4
  ------------------
  |  Branch (810:8): [True: 0, False: 111k]
  ------------------
  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|   111k|  if ((pstr_smooth_param->flag_music_definite == 1) &&
  ------------------
  |  Branch (814:7): [True: 0, False: 111k]
  ------------------
  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|   111k|  } else {
  818|   111k|    pstr_smooth_param->flag_music_definite = 0;
  819|   111k|  }
  820|       |
  821|   111k|  return mode_decision_result;
  822|   111k|}

ia_enhaacplus_enc_count_static_bitdemand:
  137|   300k|    WORD32 stat_bits_flag, WORD32 flag_last_element) {
  138|   300k|  WORD32 static_bits = 0;
  139|   300k|  WORD32 ch;
  140|       |
  141|   300k|  switch (channels) {
  ------------------
  |  Branch (141:11): [True: 300k, False: 0]
  ------------------
  142|   162k|    case 1:
  ------------------
  |  Branch (142:5): [True: 162k, False: 137k]
  ------------------
  143|       |
  144|   162k|      static_bits += SI_ID_BITS + SI_SCE_BITS + SI_ICS_BITS;
  145|       |
  146|   162k|      static_bits += ia_enhaacplus_enc_count_tns_bits(&(psy_out_ch[0]->tns_info),
  147|   162k|                                                      psy_out_ch[0]->window_sequence);
  148|   162k|      switch (psy_out_ch[0]->window_sequence) {
  ------------------
  |  Branch (148:15): [True: 162k, False: 0]
  ------------------
  149|   136k|        case LONG_WINDOW:
  ------------------
  |  |   31|   136k|#define LONG_WINDOW 0
  ------------------
  |  Branch (149:9): [True: 136k, False: 26.1k]
  ------------------
  150|   142k|        case START_WINDOW:
  ------------------
  |  |   32|   142k|#define START_WINDOW 1
  ------------------
  |  Branch (150:9): [True: 5.78k, False: 156k]
  ------------------
  151|   147k|        case STOP_WINDOW:
  ------------------
  |  |   34|   147k|#define STOP_WINDOW 3
  ------------------
  |  Branch (151:9): [True: 5.35k, False: 157k]
  ------------------
  152|       |
  153|   147k|          static_bits += SI_ICS_INFO_BITS_LONG;
  154|   147k|          break;
  155|       |
  156|  15.0k|        case SHORT_WINDOW:
  ------------------
  |  |   33|  15.0k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (156:9): [True: 15.0k, False: 147k]
  ------------------
  157|       |
  158|  15.0k|          static_bits += SI_ICS_INFO_BITS_SHORT;
  159|  15.0k|          break;
  160|   162k|      }
  161|   162k|      break;
  162|       |
  163|   162k|    case 2:
  ------------------
  |  Branch (163:5): [True: 137k, False: 162k]
  ------------------
  164|   137k|      static_bits += SI_ID_BITS + SI_CPE_BITS + 2 * SI_ICS_BITS;
  165|       |
  166|   137k|      static_bits += SI_CPE_MS_MASK_BITS;
  167|       |
  168|   137k|      static_bits += ia_enhaacplus_enc_count_ms_mask_bits(
  169|   137k|          psy_out_ch[0]->sfb_count, psy_out_ch[0]->sfb_per_group, psy_out_ch[0]->max_sfb_per_grp,
  170|   137k|          &pstr_psy_out_element->tools_info);
  171|       |
  172|   137k|      switch (psy_out_ch[0]->window_sequence) {
  ------------------
  |  Branch (172:15): [True: 137k, False: 0]
  ------------------
  173|  90.7k|        case LONG_WINDOW:
  ------------------
  |  |   31|  90.7k|#define LONG_WINDOW 0
  ------------------
  |  Branch (173:9): [True: 90.7k, False: 47.0k]
  ------------------
  174|  98.2k|        case START_WINDOW:
  ------------------
  |  |   32|  98.2k|#define START_WINDOW 1
  ------------------
  |  Branch (174:9): [True: 7.48k, False: 130k]
  ------------------
  175|   104k|        case STOP_WINDOW:
  ------------------
  |  |   34|   104k|#define STOP_WINDOW 3
  ------------------
  |  Branch (175:9): [True: 6.54k, False: 131k]
  ------------------
  176|       |
  177|   104k|          static_bits += SI_ICS_INFO_BITS_LONG;
  178|   104k|          break;
  179|       |
  180|  33.0k|        case SHORT_WINDOW:
  ------------------
  |  |   33|  33.0k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (180:9): [True: 33.0k, False: 104k]
  ------------------
  181|       |
  182|  33.0k|          static_bits += SI_ICS_INFO_BITS_SHORT;
  183|  33.0k|          break;
  184|   137k|      }
  185|       |
  186|   413k|      for (ch = 0; ch < 2; ch++) {
  ------------------
  |  Branch (186:20): [True: 275k, False: 137k]
  ------------------
  187|   275k|        static_bits += ia_enhaacplus_enc_count_tns_bits(&(psy_out_ch[ch]->tns_info),
  188|   275k|                                                        psy_out_ch[ch]->window_sequence);
  189|   275k|      }
  190|       |
  191|   137k|      break;
  192|   300k|  }
  193|       |
  194|   300k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   600k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   540k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   122k|#define AOT_PS (29)
  ------------------
  |  Branch (194:7): [True: 60.8k, False: 239k]
  |  Branch (194:28): [True: 117k, False: 122k]
  |  Branch (194:46): [True: 19.4k, False: 103k]
  ------------------
  195|   197k|    if (!(adts_flag)) {
  ------------------
  |  Branch (195:9): [True: 115k, False: 82.1k]
  ------------------
  196|   115k|      return static_bits + stat_bits_flag * 8;
  197|   115k|    }
  198|       |
  199|  82.1k|    if (adts_flag && (stat_bits_flag) && (flag_last_element)) {
  ------------------
  |  Branch (199:9): [True: 82.1k, False: 0]
  |  Branch (199:22): [True: 28.6k, False: 53.5k]
  |  Branch (199:42): [True: 11.3k, False: 17.2k]
  ------------------
  200|  11.3k|      return static_bits + 56;
  201|  70.8k|    } else {
  202|  70.8k|      return static_bits;
  203|  70.8k|    }
  204|   103k|  } else {
  205|   103k|    return static_bits;  // Default Case
  206|   103k|  }
  207|   300k|}
ixheaace_static_bits.c:ia_enhaacplus_enc_count_tns_bits:
  130|   438k|    ixheaace_temporal_noise_shaping_params *pstr_tns_info, WORD32 block_type) {
  131|   438k|  return (ia_enhaacplus_enc_tns_count(pstr_tns_info, block_type));
  132|   438k|}
ixheaace_static_bits.c:ia_enhaacplus_enc_tns_count:
   69|   438k|                                          WORD32 block_type) {
   70|   438k|  WORD32 i, k;
   71|   438k|  WORD32 tns_present;
   72|   438k|  WORD32 num_windows;
   73|   438k|  WORD32 count;
   74|   438k|  WORD32 coef_bits;
   75|       |
   76|   438k|  count = 0;
   77|   438k|  num_windows = (block_type == 2 ? 8 : 1);
  ------------------
  |  Branch (77:18): [True: 81.0k, False: 357k]
  ------------------
   78|   438k|  tns_present = 0;
   79|       |
   80|  1.44M|  for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (80:15): [True: 1.00M, False: 438k]
  ------------------
   81|  1.00M|    if (pstr_tns_info->tns_active[i] == 1) {
  ------------------
  |  Branch (81:9): [True: 317k, False: 688k]
  ------------------
   82|   317k|      tns_present = 1;
   83|   317k|    }
   84|  1.00M|  }
   85|       |
   86|   438k|  if (tns_present == 1) {
  ------------------
  |  Branch (86:7): [True: 210k, False: 227k]
  ------------------
   87|   730k|    for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (87:17): [True: 520k, False: 210k]
  ------------------
   88|   520k|      count += (block_type == SHORT_WINDOW ? 1 : 2);
  ------------------
  |  |   33|   520k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (88:17): [True: 354k, False: 166k]
  ------------------
   89|       |
   90|   520k|      if (pstr_tns_info->tns_active[i]) {
  ------------------
  |  Branch (90:11): [True: 317k, False: 202k]
  ------------------
   91|   317k|        count += (block_type == SHORT_WINDOW ? 8 : 12);
  ------------------
  |  |   33|   317k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (91:19): [True: 151k, False: 166k]
  ------------------
   92|       |
   93|   317k|        if (pstr_tns_info->order[i]) {
  ------------------
  |  Branch (93:13): [True: 317k, False: 105]
  ------------------
   94|   317k|          count += 2; /*coef_compression */
   95|       |
   96|   317k|          if (pstr_tns_info->coef_res[i] == 4) {
  ------------------
  |  Branch (96:15): [True: 166k, False: 151k]
  ------------------
   97|   166k|            coef_bits = 3;
   98|       |
   99|   599k|            for (k = 0; k < pstr_tns_info->order[i]; k++) {
  ------------------
  |  Branch (99:25): [True: 568k, False: 30.6k]
  ------------------
  100|   568k|              if (pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 3 ||
  ------------------
  |  |   23|   568k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (100:19): [True: 108k, False: 460k]
  ------------------
  101|   460k|                  pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -4) {
  ------------------
  |  |   23|   460k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (101:19): [True: 26.9k, False: 433k]
  ------------------
  102|   135k|                coef_bits = 4;
  103|   135k|                break;
  104|   135k|              }
  105|   568k|            }
  106|   166k|          } else {
  107|   151k|            coef_bits = 2;
  108|       |
  109|   417k|            for (k = 0; k < pstr_tns_info->order[i]; k++) {
  ------------------
  |  Branch (109:25): [True: 318k, False: 98.5k]
  ------------------
  110|   318k|              if (pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 1 ||
  ------------------
  |  |   23|   318k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (110:19): [True: 49.2k, False: 269k]
  ------------------
  111|   269k|                  pstr_tns_info->coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -2) {
  ------------------
  |  |   23|   269k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (111:19): [True: 3.70k, False: 265k]
  ------------------
  112|  52.9k|                coef_bits = 3;
  113|  52.9k|                break;
  114|  52.9k|              }
  115|   318k|            }
  116|   151k|          }
  117|       |
  118|  2.10M|          for (k = 0; k < pstr_tns_info->order[i]; k++) {
  ------------------
  |  Branch (118:23): [True: 1.79M, False: 317k]
  ------------------
  119|  1.79M|            count += coef_bits;
  120|  1.79M|          }
  121|   317k|        }
  122|   317k|      }
  123|   520k|    }
  124|   210k|  }
  125|       |
  126|   438k|  return count;
  127|   438k|}
ixheaace_static_bits.c:ia_enhaacplus_enc_count_ms_mask_bits:
   49|   137k|                                                   ixheaace_tools_info *pstr_tools_info) {
   50|   137k|  WORD32 ms_bits = 0, sfb_off;
   51|       |
   52|   137k|  switch (pstr_tools_info->ms_digest) {
  ------------------
  |  Branch (52:11): [True: 137k, False: 0]
  ------------------
   53|  25.0k|    case MS_NONE:
  ------------------
  |  Branch (53:5): [True: 25.0k, False: 112k]
  ------------------
   54|   113k|    case MS_ALL:
  ------------------
  |  Branch (54:5): [True: 88.2k, False: 49.5k]
  ------------------
   55|   113k|      break;
   56|       |
   57|  24.5k|    case MS_SOME:
  ------------------
  |  Branch (57:5): [True: 24.5k, False: 113k]
  ------------------
   58|       |
   59|  81.4k|      for (sfb_off = 0; sfb_off < sfb_cnt; sfb_off += sfb_per_group) {
  ------------------
  |  Branch (59:25): [True: 56.9k, False: 24.5k]
  ------------------
   60|  56.9k|        ms_bits += max_sfb_per_grp;
   61|  56.9k|      }
   62|  24.5k|      break;
   63|   137k|  }
   64|       |
   65|   137k|  return ms_bits;
   66|   137k|}

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

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

ia_enhaacplus_enc_calc_weighted_spectrum:
   49|   723k|                                              WORD32 aot) {
   50|   723k|  WORD32 i, sfb, tempcnt;
   51|   723k|  FLOAT32 tmp;
   52|   723k|  FLOAT32 *ptr_tns_sfb_mean = ptr_shared_buffer1;
   53|   723k|  FLOAT32 temp1, temp2;
   54|   723k|  FLOAT32 *ptr_spec;
   55|   723k|  FLOAT32 *ptr_ws1;
   56|   723k|  WORD sfb_width, j;
   57|       |
   58|  4.73M|  for (sfb = lpc_start_band; sfb < lpc_stop_band; sfb++) {
  ------------------
  |  Branch (58:30): [True: 4.01M, False: 723k]
  ------------------
   59|  4.01M|    FLOAT32 sfb_nrg_tmp = ptr_sfb_energy[sfb];
   60|  4.01M|    ptr_tns_sfb_mean[sfb] = 1 / ((FLOAT32)sqrt(sfb_nrg_tmp) + 1e-30f);
   61|  4.01M|  }
   62|       |
   63|   723k|  sfb = lpc_start_band;
   64|       |
   65|   723k|  tmp = ptr_tns_sfb_mean[sfb];
   66|       |
   67|  4.73M|  for (i = lpc_start_line; i < lpc_stop_line; i += sfb_width) {
  ------------------
  |  Branch (67:28): [True: 4.01M, False: 723k]
  ------------------
   68|  4.01M|    ptr_spec = &ptr_weighted_spec[i];
   69|  4.01M|    WORD start = i, stop = ptr_sfb_offset[sfb + 1];
   70|       |
   71|  4.01M|    stop = MIN(stop, lpc_stop_line);
  ------------------
  |  |   23|  4.01M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 3.29M, False: 714k]
  |  |  ------------------
  ------------------
   72|  4.01M|    sfb_width = stop - start;
   73|       |
   74|  44.2M|    for (j = (sfb_width >> 1) - 1; j >= 0; j--) {
  ------------------
  |  Branch (74:36): [True: 40.2M, False: 4.01M]
  ------------------
   75|  40.2M|      *ptr_spec++ = tmp;
   76|  40.2M|      *ptr_spec++ = tmp;
   77|  40.2M|    }
   78|  4.01M|    sfb++;
   79|       |
   80|  4.01M|    if ((sfb + 1) < lpc_stop_band) {
  ------------------
  |  Branch (80:9): [True: 2.66M, False: 1.34M]
  ------------------
   81|  2.66M|      tmp = ptr_tns_sfb_mean[sfb];
   82|  2.66M|    }
   83|  4.01M|  }
   84|       |
   85|       |  /* Filter down */
   86|   723k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   34|  1.44M|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   35|  1.22M|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   39|   903k|#define AOT_PS (29)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|  98.4k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (86:7): [True: 219k, False: 503k]
  |  Branch (86:28): [True: 324k, False: 179k]
  |  Branch (86:46): [True: 81.0k, False: 98.4k]
  |  Branch (86:63): [True: 74.2k, False: 24.2k]
  ------------------
   87|  79.3M|    for (i = lpc_stop_line - 2; i >= lpc_start_line; i--) {
  ------------------
  |  Branch (87:33): [True: 78.6M, False: 699k]
  ------------------
   88|  78.6M|      ptr_weighted_spec[i] = (ptr_weighted_spec[i] + ptr_weighted_spec[i + 1]) * 0.5f;
   89|  78.6M|    }
   90|  79.3M|    for (i = lpc_start_line + 1; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (90:34): [True: 78.6M, False: 699k]
  ------------------
   91|  78.6M|      ptr_weighted_spec[i] = (ptr_weighted_spec[i] + ptr_weighted_spec[i - 1]) * 0.5f;
   92|  78.6M|    }
   93|       |
   94|       |    /* Weight and normalize */
   95|  80.0M|    for (i = lpc_start_line; i < lpc_stop_line; i++) {
  ------------------
  |  Branch (95:30): [True: 79.3M, False: 699k]
  ------------------
   96|  79.3M|      ptr_weighted_spec[i] = ptr_weighted_spec[i] * ptr_spectrum[i];
   97|  79.3M|    }
   98|   699k|  } 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|   315k|    for (i = tempcnt - 1; i >= 0; i--) {
  ------------------
  |  Branch (108:27): [True: 291k, False: 24.2k]
  ------------------
  109|   291k|      *ptr_ws1-- = temp2;
  110|   291k|      temp1 = (*ptr_ws1 + temp2 * 0.5f);
  111|   291k|      *ptr_ws1-- = temp1;
  112|   291k|      temp2 = (*ptr_ws1 + temp1 * 0.5f);
  113|   291k|      *ptr_ws1-- = temp2;
  114|   291k|      temp1 = (*ptr_ws1 + temp2 * 0.5f);
  115|   291k|      *ptr_ws1-- = temp1;
  116|   291k|      temp2 = (*ptr_ws1 + temp1 * 0.5f);
  117|   291k|    }
  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|   293k|    for (i = tempcnt - 1; i >= 0; i--) {
  ------------------
  |  Branch (139:27): [True: 268k, False: 24.2k]
  ------------------
  140|   268k|      temp1 = *(ptr_ws1 + 1);
  141|   268k|      temp1 = (FLOAT32)((temp1 + temp2) * 0.5f);
  142|   268k|      multout_temp = (temp2 * *ptr_spec++);
  143|   268k|      *ptr_ws1++ = multout_temp;
  144|       |
  145|   268k|      temp2 = *(ptr_ws1 + 1);
  146|   268k|      temp2 = (FLOAT32)((temp2 + temp1) * 0.5f);
  147|   268k|      multout_temp = (temp1 * *ptr_spec++);
  148|   268k|      *ptr_ws1++ = multout_temp;
  149|       |
  150|   268k|      temp1 = *(ptr_ws1 + 1);
  151|   268k|      temp1 = (FLOAT32)((temp2 + temp1) * 0.5f);
  152|   268k|      multout_temp = (temp2 * *ptr_spec++);
  153|   268k|      *ptr_ws1++ = multout_temp;
  154|       |
  155|   268k|      temp2 = *(ptr_ws1 + 1);
  156|   268k|      temp2 = (FLOAT32)((temp2 + temp1) * 0.5f);
  157|   268k|      multout_temp = (temp1 * *ptr_spec++);
  158|   268k|      *ptr_ws1++ = multout_temp;
  159|   268k|    }
  160|       |
  161|  24.2k|    if (remaining) {
  ------------------
  |  Branch (161:9): [True: 24.2k, False: 0]
  ------------------
  162|  72.7k|      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|   723k|}
ia_enhaacplus_enc_auto_correlation:
  178|   723k|                                        WORD32 samples, WORD32 corr_coeff) {
  179|   723k|  WORD32 i, j;
  180|   723k|  FLOAT32 tmp_var;
  181|   723k|  WORD32 remaining;
  182|   723k|  remaining = corr_coeff - ((corr_coeff >> 1) << 1);
  183|       |
  184|  41.0M|  for (i = 0; i < samples; i += 2) {
  ------------------
  |  Branch (184:15): [True: 40.2M, False: 723k]
  ------------------
  185|  40.2M|    const FLOAT32 *ptr_input1 = &ptr_input[i];
  186|  40.2M|    FLOAT32 temp1 = *ptr_input1;
  187|  40.2M|    FLOAT32 temp2 = *(ptr_input1 + 1);
  188|  40.2M|    FLOAT32 inp_tmp1 = *ptr_input1++;
  189|   255M|    for (j = 0; j < (corr_coeff >> 1) << 1; j++) {
  ------------------
  |  Branch (189:17): [True: 215M, False: 40.2M]
  ------------------
  190|   215M|      FLOAT32 inp_tmp2;
  191|   215M|      tmp_var = (temp1 * inp_tmp1);
  192|   215M|      inp_tmp2 = *ptr_input1++;
  193|   215M|      tmp_var += (temp2 * inp_tmp2);
  194|   215M|      ptr_corr[j] += tmp_var;
  195|   215M|      j++;
  196|   215M|      tmp_var = (temp1 * inp_tmp2);
  197|   215M|      inp_tmp1 = *ptr_input1++;
  198|   215M|      tmp_var += (temp2 * inp_tmp1);
  199|   215M|      ptr_corr[j] += (tmp_var);
  200|   215M|    }
  201|  40.2M|    if (remaining) {
  ------------------
  |  Branch (201:9): [True: 31.6M, False: 8.67M]
  ------------------
  202|  31.6M|      tmp_var = (temp1 * inp_tmp1);
  203|  31.6M|      tmp_var += (temp2 * *ptr_input1);
  204|  31.6M|      ptr_corr[j] += (tmp_var);
  205|  31.6M|    }
  206|  40.2M|  }
  207|   723k|}
ia_enhaacplus_enc_analysis_filter_lattice:
  211|   318k|                                               FLOAT32 *ptr_output) {
  212|   318k|  FLOAT32 state_par[TEMPORAL_NOISE_SHAPING_MAX_ORDER] = {0};
  213|   318k|  WORD32 j;
  214|       |
  215|   318k|  if (order <= 0) {
  ------------------
  |  Branch (215:7): [True: 105, False: 318k]
  ------------------
  216|    105|    return;
  217|    105|  }
  218|       |
  219|  63.6M|  for (j = 0; j < num_lines; j++) {
  ------------------
  |  Branch (219:15): [True: 63.3M, False: 318k]
  ------------------
  220|  63.3M|    WORD32 i;
  221|  63.3M|    FLOAT32 x = ptr_signal[j];
  222|  63.3M|    FLOAT32 accu, tmp, tmp_save;
  223|       |
  224|  63.3M|    tmp_save = x;
  225|  63.3M|    accu = x;
  226|       |
  227|   467M|    for (i = 0; i < order - 1; i++) {
  ------------------
  |  Branch (227:17): [True: 403M, False: 63.3M]
  ------------------
  228|   403M|      tmp = (accu * ptr_par_coeff[i]);
  229|       |
  230|   403M|      tmp += state_par[i];
  231|       |
  232|   403M|      accu += (state_par[i] * ptr_par_coeff[i]);
  233|       |
  234|   403M|      state_par[i] = tmp_save;
  235|   403M|      tmp_save = tmp;
  236|   403M|    }
  237|       |
  238|       |    /* last stage: only need half operations */
  239|  63.3M|    accu += (state_par[order - 1] * ptr_par_coeff[order - 1]);
  240|       |
  241|  63.3M|    state_par[order - 1] = tmp_save;
  242|       |
  243|  63.3M|    ptr_output[j] = accu;
  244|  63.3M|  }
  245|   318k|}

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

ia_enhaacplus_enc_get_tns_param:
   43|  7.88k|    const ixheaace_temporal_noise_shaping_info_tab *pstr_tns_info_tab, WORD32 size) {
   44|  7.88k|  UWORD32 i;
   45|       |
   46|  7.88k|  if (pstr_tns_config_tab == NULL) {
  ------------------
  |  Branch (46:7): [True: 0, False: 7.88k]
  ------------------
   47|      0|    return IA_EXHEAACE_INIT_FATAL_TNS_CONFIG_INIT_FAILED;
   48|      0|  }
   49|       |
   50|  7.88k|  pstr_tns_config_tab->thresh_on = -1;
   51|       |
   52|  47.3k|  for (i = 0; i < size / sizeof(ixheaace_temporal_noise_shaping_info_tab); i++) {
  ------------------
  |  Branch (52:15): [True: 39.4k, False: 7.88k]
  ------------------
   53|  39.4k|    if ((bit_rate >= pstr_tns_info_tab[i].bit_rate_from) &&
  ------------------
  |  Branch (53:9): [True: 21.7k, False: 17.7k]
  ------------------
   54|  21.7k|        bit_rate <= pstr_tns_info_tab[i].bit_rate_to) {
  ------------------
  |  Branch (54:9): [True: 7.88k, False: 13.8k]
  ------------------
   55|  7.88k|      switch (block_type) {
  ------------------
  |  Branch (55:15): [True: 7.88k, False: 0]
  ------------------
   56|  4.84k|        case LONG_WINDOW:
  ------------------
  |  Branch (56:9): [True: 4.84k, False: 3.04k]
  ------------------
   57|  4.84k|          switch (channels) {
  ------------------
  |  Branch (57:19): [True: 4.84k, False: 0]
  ------------------
   58|  2.60k|            case NUM_CHANS_MONO:
  ------------------
  |  |  113|  2.60k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (58:13): [True: 2.60k, False: 2.24k]
  ------------------
   59|       |
   60|  2.60k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_mono_long.thresh_on;
   61|  2.60k|              pstr_tns_config_tab->lpc_start_freq =
   62|  2.60k|                  pstr_tns_info_tab[i].param_mono_long.lpc_start_freq;
   63|  2.60k|              pstr_tns_config_tab->lpc_stop_freq =
   64|  2.60k|                  pstr_tns_info_tab[i].param_mono_long.lpc_stop_freq;
   65|  2.60k|              pstr_tns_config_tab->tns_time_resolution =
   66|  2.60k|                  pstr_tns_info_tab[i].param_mono_long.tns_time_resolution;
   67|       |
   68|  2.60k|              break;
   69|  2.24k|            case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  2.24k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (69:13): [True: 2.24k, False: 2.60k]
  ------------------
   70|       |
   71|  2.24k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_stereo_long.thresh_on;
   72|  2.24k|              pstr_tns_config_tab->lpc_start_freq =
   73|  2.24k|                  pstr_tns_info_tab[i].param_stereo_long.lpc_start_freq;
   74|  2.24k|              pstr_tns_config_tab->lpc_stop_freq =
   75|  2.24k|                  pstr_tns_info_tab[i].param_stereo_long.lpc_stop_freq;
   76|  2.24k|              pstr_tns_config_tab->tns_time_resolution =
   77|  2.24k|                  pstr_tns_info_tab[i].param_stereo_long.tns_time_resolution;
   78|       |
   79|  2.24k|              break;
   80|  4.84k|          }
   81|  4.84k|          break;
   82|       |
   83|  4.84k|        case SHORT_WINDOW:
  ------------------
  |  Branch (83:9): [True: 3.04k, False: 4.84k]
  ------------------
   84|  3.04k|          switch (channels) {
  ------------------
  |  Branch (84:19): [True: 3.04k, False: 0]
  ------------------
   85|  1.63k|            case NUM_CHANS_MONO:
  ------------------
  |  |  113|  1.63k|#define NUM_CHANS_MONO (1)
  ------------------
  |  Branch (85:13): [True: 1.63k, False: 1.40k]
  ------------------
   86|       |
   87|  1.63k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_mono_short.thresh_on;
   88|  1.63k|              pstr_tns_config_tab->lpc_start_freq =
   89|  1.63k|                  pstr_tns_info_tab[i].param_mono_short.lpc_start_freq;
   90|  1.63k|              pstr_tns_config_tab->lpc_stop_freq =
   91|  1.63k|                  pstr_tns_info_tab[i].param_mono_short.lpc_stop_freq;
   92|  1.63k|              pstr_tns_config_tab->tns_time_resolution =
   93|  1.63k|                  pstr_tns_info_tab[i].param_mono_short.tns_time_resolution;
   94|  1.63k|              break;
   95|  1.40k|            case NUM_CHANS_STEREO:
  ------------------
  |  |  114|  1.40k|#define NUM_CHANS_STEREO (2)
  ------------------
  |  Branch (95:13): [True: 1.40k, False: 1.63k]
  ------------------
   96|       |
   97|  1.40k|              pstr_tns_config_tab->thresh_on = pstr_tns_info_tab[i].param_stereo_short.thresh_on;
   98|  1.40k|              pstr_tns_config_tab->lpc_start_freq =
   99|  1.40k|                  pstr_tns_info_tab[i].param_stereo_short.lpc_start_freq;
  100|  1.40k|              pstr_tns_config_tab->lpc_stop_freq =
  101|  1.40k|                  pstr_tns_info_tab[i].param_stereo_short.lpc_stop_freq;
  102|  1.40k|              pstr_tns_config_tab->tns_time_resolution =
  103|  1.40k|                  pstr_tns_info_tab[i].param_stereo_short.tns_time_resolution;
  104|  1.40k|              break;
  105|  3.04k|          }
  106|       |
  107|  3.04k|          break;
  108|  7.88k|      }
  109|  7.88k|    }
  110|  39.4k|  }
  111|       |
  112|       |  // This check is not being done now
  113|  7.88k|  if (pstr_tns_config_tab->thresh_on == -1) {
  ------------------
  |  Branch (113:7): [True: 0, False: 7.88k]
  ------------------
  114|      0|    return IA_EXHEAACE_INIT_FATAL_INVALID_TNS_PARAM;
  115|      0|  }
  116|       |
  117|  7.88k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  7.88k|#define IA_NO_ERROR 0x00000000
  ------------------
  118|  7.88k|}
ia_enhaacplus_enc_get_tns_max_bands:
  123|  7.88k|    WORD32 aot, WORD32 frame_length) {
  124|  7.88k|  UWORD32 i;
  125|       |
  126|  7.88k|  *tns_max_sfb = -1;
  127|       |
  128|  58.7k|  for (i = 0; i < size / sizeof(ixheaace_temporal_noise_shaping_max_table); i++) {
  ------------------
  |  Branch (128:15): [True: 58.7k, False: 0]
  ------------------
  129|  58.7k|    if (sampling_rate == pstr_tns_max_bands_tab[i].sampling_rate) {
  ------------------
  |  Branch (129:9): [True: 7.88k, False: 50.8k]
  ------------------
  130|  7.88k|      if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|  15.7k|#define AOT_AAC_LC (2)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|  13.6k|#define AOT_SBR (5)
  ------------------
                    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  2.27k|#define AOT_PS (29)
  ------------------
  |  Branch (130:11): [True: 2.10k, False: 5.78k]
  |  Branch (130:32): [True: 3.51k, False: 2.27k]
  |  Branch (130:50): [True: 464, False: 1.80k]
  ------------------
  131|  6.08k|        if (block_type == SHORT_WINDOW) {
  ------------------
  |  Branch (131:13): [True: 3.04k, False: 3.04k]
  ------------------
  132|  3.04k|          *tns_max_sfb = (frame_length == (FRAME_LEN_SHORT_128))
  ------------------
  |  |   30|  3.04k|#define FRAME_LEN_SHORT_128 (128)
  ------------------
  |  Branch (132:26): [True: 2.02k, False: 1.02k]
  ------------------
  133|  3.04k|                             ? pstr_tns_max_bands_tab[i].max_band_1024_short_lc
  134|  3.04k|                             : pstr_tns_max_bands_tab[i].max_band_960_short_lc;
  135|  3.04k|        } else {
  136|  3.04k|          *tns_max_sfb = (frame_length == FRAME_LEN_1024)
  ------------------
  |  |   91|  3.04k|#define FRAME_LEN_1024 1024
  ------------------
  |  Branch (136:26): [True: 2.02k, False: 1.02k]
  ------------------
  137|  3.04k|                             ? pstr_tns_max_bands_tab[i].max_band_1024_long_lc
  138|  3.04k|                             : pstr_tns_max_bands_tab[i].max_band_960_long_lc;
  139|  3.04k|        }
  140|  6.08k|      } else if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|  3.61k|#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: 533, 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: 982, 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.88k|      break;
  146|  7.88k|    }
  147|  58.7k|  }
  148|  7.88k|}

ia_enhaacplus_enc_write_ADTS_header:
  297|  76.6k|                                           WORD32 num_ch) {
  298|  76.6k|  WORD32 bits = 56;
  299|  76.6k|  UWORD32 object_type = 0;
  300|  76.6k|  ixheaace_bitstream_params bitstream_temp;
  301|  76.6k|  ixheaace_bitstream_params *pstr_bitstream = &bitstream_temp;
  302|  76.6k|  WORD32 write_flag = 1;
  303|  76.6k|  pstr_bitstream->data = buffer;
  304|  76.6k|  pstr_bitstream->num_bit = 8;
  305|       |
  306|  76.6k|  pstr_bitstream->current_bit = 0;
  307|  76.6k|  ;
  308|  76.6k|  object_type = 01;
  309|       |
  310|  76.6k|  if (write_flag) {
  ------------------
  |  Branch (310:7): [True: 76.6k, False: 0]
  ------------------
  311|       |    /* Fixed ADTS header */
  312|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0xFFFF, 12); /* 12 bit Syncword */
  313|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 1 /*aacStateStruct->aacConfigSturct.mpegVersion*/,
  314|  76.6k|                             1);                    /* ID == 0 for MPEG4 AAC, 1 for MPEG2 AAC */
  315|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 2); /* layer == 0 */
  316|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 1, 1); /* protection absent */
  317|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, object_type, 2); /* profile */
  318|  76.6k|    ia_enhaacplus_enc_putbit(
  319|  76.6k|        pstr_bitstream,
  320|  76.6k|        ia_enhaacplus_enc_get_sample_rate_index(samp_rate) /*aacStateStruct->sampleRateIdx*/,
  321|  76.6k|        4);                                         /* sampling rate */
  322|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* private bit */
  323|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, num_ch /*aacStateStruct->aacConfigSturct.ch*/,
  324|  76.6k|                             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|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* original/copy */
  329|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* home */
  330|       |
  331|       |    /* Variable ADTS header */
  332|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* copyr. id. bit */
  333|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 1); /* copyr. id. start */
  334|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, /*aacStateStruct->*/ bytes_used + 7, 13);
  335|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0x7FF, 11); /* buffer fullness (0x7FF for VBR) */
  336|       |
  337|  76.6k|    ia_enhaacplus_enc_putbit(pstr_bitstream, 0, 2); /* raw data blocks (0+1=1) */
  338|  76.6k|  }
  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|  76.6k|  return bits / 8;
  345|  76.6k|}
ixheaace_write_adts_adif.c:ia_enhaacplus_enc_get_sample_rate_index:
  104|  76.6k|static WORD16 ia_enhaacplus_enc_get_sample_rate_index(WORD32 sample_rate) {
  105|  76.6k|  if (92017 <= sample_rate) {
  ------------------
  |  Branch (105:7): [True: 5.06k, False: 71.5k]
  ------------------
  106|  5.06k|    return 0;
  107|  5.06k|  }
  108|  71.5k|  if (75132 <= sample_rate) {
  ------------------
  |  Branch (108:7): [True: 17.8k, False: 53.6k]
  ------------------
  109|  17.8k|    return 1;
  110|  17.8k|  }
  111|  53.6k|  if (55426 <= sample_rate) {
  ------------------
  |  Branch (111:7): [True: 2.63k, False: 51.0k]
  ------------------
  112|  2.63k|    return 2;
  113|  2.63k|  }
  114|  51.0k|  if (46009 <= sample_rate) {
  ------------------
  |  Branch (114:7): [True: 3.24k, False: 47.8k]
  ------------------
  115|  3.24k|    return 3;
  116|  3.24k|  }
  117|  47.8k|  if (37566 <= sample_rate) {
  ------------------
  |  Branch (117:7): [True: 2.87k, False: 44.9k]
  ------------------
  118|  2.87k|    return 4;
  119|  2.87k|  }
  120|  44.9k|  if (27713 <= sample_rate) {
  ------------------
  |  Branch (120:7): [True: 744, False: 44.1k]
  ------------------
  121|    744|    return 5;
  122|    744|  }
  123|  44.1k|  if (23004 <= sample_rate) {
  ------------------
  |  Branch (123:7): [True: 5.86k, False: 38.3k]
  ------------------
  124|  5.86k|    return 6;
  125|  5.86k|  }
  126|  38.3k|  if (18783 <= sample_rate) {
  ------------------
  |  Branch (126:7): [True: 12.7k, False: 25.5k]
  ------------------
  127|  12.7k|    return 7;
  128|  12.7k|  }
  129|  25.5k|  if (13856 <= sample_rate) {
  ------------------
  |  Branch (129:7): [True: 18.2k, False: 7.37k]
  ------------------
  130|  18.2k|    return 8;
  131|  18.2k|  }
  132|  7.37k|  if (11502 <= sample_rate) {
  ------------------
  |  Branch (132:7): [True: 3.81k, False: 3.55k]
  ------------------
  133|  3.81k|    return 9;
  134|  3.81k|  }
  135|  3.55k|  if (9391 <= sample_rate) {
  ------------------
  |  Branch (135:7): [True: 1.64k, False: 1.91k]
  ------------------
  136|  1.64k|    return 10;
  137|  1.64k|  }
  138|  1.91k|  return 11;
  139|  3.55k|}
ixheaace_write_adts_adif.c:ia_enhaacplus_enc_putbit:
   39|  1.14M|                                       WORD32 num_bit) {
   40|  1.14M|  WORD32 num, max_num, curr_num;
   41|  1.14M|  WORD32 num_used, idx;
   42|  1.14M|  unsigned long bits;
   43|  1.14M|  WORD32 current_bitstream_bit;
   44|  1.14M|  UWORD8 *bitstream_data;
   45|       |
   46|  1.14M|  if (num_bit == 0) return;
  ------------------
  |  Branch (46:7): [True: 0, False: 1.14M]
  ------------------
   47|       |
   48|  1.14M|  current_bitstream_bit = pstr_bitstream->current_bit;
   49|  1.14M|  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.14M|  num = 0;
   60|  1.14M|  num_used = current_bitstream_bit & 7;
   61|  1.14M|  max_num = BYTE_NUMBIT - num_used;
  ------------------
  |  |   82|  1.14M|#define BYTE_NUMBIT 8
  ------------------
   62|  1.14M|  curr_num = MIN(num_bit, max_num);
  ------------------
  |  |   23|  1.14M|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 689k, False: 459k]
  |  |  ------------------
  ------------------
   63|  1.14M|  bits = data >> (num_bit - curr_num);
   64|       |
   65|  1.14M|  idx = (current_bitstream_bit >> 3);
   66|       |
   67|  1.14M|  if (num_used == 0) bitstream_data[idx] = 0;
  ------------------
  |  Branch (67:7): [True: 153k, False: 996k]
  ------------------
   68|       |
   69|  1.14M|  bitstream_data[idx] |= (bits & ((1 << curr_num) - 1)) << (max_num - curr_num);
   70|  1.14M|  current_bitstream_bit += curr_num;
   71|  1.14M|  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.22M|  while ((num + 8) < num_bit) {
  ------------------
  |  Branch (80:10): [True: 76.6k, False: 1.14M]
  ------------------
   81|  76.6k|    num += 8;
   82|  76.6k|    current_bitstream_bit += 8;
   83|  76.6k|    bits = data >> (num_bit - num);
   84|  76.6k|    bitstream_data[++idx] = (UWORD8)bits;
   85|  76.6k|  }
   86|       |
   87|       |  /*
   88|       |      Stage #3: Write remainder bits from the data
   89|       |  */
   90|  1.14M|  if (num < num_bit) {
  ------------------
  |  Branch (90:7): [True: 306k, False: 842k]
  ------------------
   91|   306k|    curr_num = num_bit - num;
   92|   306k|    num_used = current_bitstream_bit & 7;
   93|   306k|    max_num = BYTE_NUMBIT - num_used;
  ------------------
  |  |   82|   306k|#define BYTE_NUMBIT 8
  ------------------
   94|   306k|    idx = current_bitstream_bit >> 3;
   95|   306k|    if (num_used == 0) bitstream_data[idx] = 0;
  ------------------
  |  Branch (95:9): [True: 306k, False: 0]
  ------------------
   96|   306k|    bitstream_data[idx] |= (data & ((1 << curr_num) - 1)) << (max_num - curr_num);
   97|   306k|    current_bitstream_bit += curr_num;
   98|   306k|  }
   99|       |
  100|  1.14M|  pstr_bitstream->current_bit = current_bitstream_bit;
  101|  1.14M|  pstr_bitstream->num_bit = current_bitstream_bit;
  102|  1.14M|}

ia_enhaacplus_enc_write_bitstream:
  672|   300k|    WORD32 i_samp_freq, WORD32 ele_idx, WORD32 aot, WORD32 *total_fill_bits) {
  673|   300k|  IA_ERRORCODE err_code;
  674|   300k|  WORD32 bit_markup, element_used_bits, frame_bits;
  675|       |
  676|   300k|  bit_markup = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  677|       |
  678|   300k|  *glob_used_bits = 0;
  679|       |
  680|   300k|  {
  681|   300k|    WORD32 *ptr_sfb_offset[2];
  682|   300k|    ixheaace_temporal_noise_shaping_params tns_info[2];
  683|       |
  684|   300k|    element_used_bits = 0;
  685|       |
  686|   300k|    if ((*write_program_config_element == 1) && (ele_idx == 0)) {
  ------------------
  |  Branch (686:9): [True: 0, False: 300k]
  |  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|   300k|    switch (pstr_element_info.el_type) {
  696|   141k|      case ID_SCE: /* single channel */
  ------------------
  |  Branch (696:7): [True: 141k, False: 159k]
  ------------------
  697|       |
  698|   141k|        ptr_sfb_offset[0] =
  699|   141k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->sfb_offsets;
  700|   141k|        tns_info[0] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->tns_info;
  701|       |
  702|   141k|        err_code = ia_enhaacplus_enc_write_single_chan_elem(
  703|   141k|            pstr_element_info.instance_tag, ptr_sfb_offset[0],
  704|   141k|            pstr_qc_out->qc_channel[pstr_element_info.channel_index[0]], pstr_bit_stream_handle,
  705|   141k|            aot, tns_info[0], pstr_aac_tables);
  706|       |
  707|   141k|        if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   141k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (707:13): [True: 193, False: 141k]
  ------------------
  708|    193|          return err_code;
  709|    193|        }
  710|   141k|        break;
  711|       |
  712|   141k|      case ID_CCE: /* single channel independent coupling element*/
  ------------------
  |  Branch (712:7): [True: 0, False: 300k]
  ------------------
  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: 279k]
  ------------------
  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.3k]
  ------------------
  739|     46|          return err_code;
  740|     46|        }
  741|  21.3k|        break;
  742|       |
  743|   137k|      case ID_CPE: /* channel pair */
  ------------------
  |  Branch (743:7): [True: 137k, False: 162k]
  ------------------
  744|   137k|      {
  745|   137k|        WORD32 ms_digest = pstr_psy_out->psy_out_element.tools_info.ms_digest;
  746|   137k|        WORD32 *ms_flags = pstr_psy_out->psy_out_element.tools_info.ms_mask;
  747|       |
  748|   137k|        ptr_sfb_offset[0] =
  749|   137k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->sfb_offsets;
  750|   137k|        ptr_sfb_offset[1] =
  751|   137k|            pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[1]]->sfb_offsets;
  752|       |
  753|   137k|        tns_info[0] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[0]]->tns_info;
  754|   137k|        tns_info[1] = pstr_psy_out->psy_out_ch[pstr_element_info.channel_index[1]]->tns_info;
  755|       |
  756|   137k|        err_code = ia_enhaacplus_enc_write_channel_pair_element(
  757|   137k|            pstr_element_info.instance_tag, ms_digest, ms_flags, ptr_sfb_offset,
  758|   137k|            pstr_qc_out->qc_channel[pstr_element_info.channel_index[0]], pstr_bit_stream_handle,
  759|   137k|            aot, tns_info, pstr_aac_tables);
  760|   137k|        if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   137k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (760:13): [True: 425, False: 137k]
  ------------------
  761|    425|          return err_code;
  762|    425|        }
  763|   137k|      } break;
  764|       |
  765|   137k|      default:
  ------------------
  |  Branch (765:7): [True: 0, False: 300k]
  ------------------
  766|      0|        return IA_EXHEAACE_INIT_FATAL_INVALID_ELEMENT_TYPE;
  767|       |
  768|   300k|    } /* switch */
  769|       |
  770|   299k|    element_used_bits -= bit_markup;
  771|       |
  772|   299k|    bit_markup = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  773|       |
  774|   299k|    frame_bits = element_used_bits + bit_markup;
  775|   299k|  }
  776|       |
  777|   299k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   599k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   539k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   122k|#define AOT_PS (29)
  ------------------
  |  Branch (777:7): [True: 60.3k, False: 239k]
  |  Branch (777:28): [True: 116k, False: 122k]
  |  Branch (777:46): [True: 19.4k, False: 103k]
  ------------------
  778|   196k|    ia_enhaacplus_enc_write_fill_element_LC(ptr_anc_bytes, pstr_qc_out->tot_anc_bits_used,
  779|   196k|                                            pstr_bit_stream_handle);
  780|   196k|  }
  781|       |
  782|   299k|  if (flag_last_element) {
  ------------------
  |  Branch (782:7): [True: 141k, False: 158k]
  ------------------
  783|   141k|    if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   282k|#define AOT_AAC_LC (2)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   258k|#define AOT_SBR (5)
  ------------------
                  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  79.8k|#define AOT_PS (29)
  ------------------
  |  Branch (783:9): [True: 24.5k, False: 116k]
  |  Branch (783:30): [True: 37.0k, False: 79.8k]
  |  Branch (783:48): [True: 19.4k, False: 60.4k]
  ------------------
  784|  81.0k|      ia_enhaacplus_enc_write_fill_element_LC(NULL, *total_fill_bits, pstr_bit_stream_handle);
  785|       |
  786|  81.0k|      *total_fill_bits = 0;
  787|       |
  788|  81.0k|      ixheaace_write_bits(pstr_bit_stream_handle, ID_END, 3);
  789|  81.0k|    }
  790|       |
  791|   141k|    if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   36|   282k|#define AOT_AAC_LD (23)
  ------------------
                  if (aot == AOT_AAC_LD || aot == AOT_AAC_ELD) {
  ------------------
  |  |   37|   130k|#define AOT_AAC_ELD (39)
  ------------------
  |  Branch (791:9): [True: 10.5k, False: 130k]
  |  Branch (791:30): [True: 49.8k, False: 81.0k]
  ------------------
  792|  60.4k|      {
  793|  60.4k|        WORD32 i, cnt = 0;
  794|  60.4k|        ia_enhaacplus_enc_write_fill_element_LD(ptr_anc_bytes, pstr_qc_out->tot_anc_bits_used,
  795|  60.4k|                                                pstr_bit_stream_handle);
  796|       |
  797|  60.4k|        *total_fill_bits += pstr_qc_out->total_fill_bits;
  798|  60.4k|        *total_fill_bits += pstr_qc_out->align_bits;
  799|  60.4k|        cnt = *total_fill_bits >> 3;
  800|  11.6M|        for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (800:21): [True: 11.6M, False: 60.4k]
  ------------------
  801|  11.6M|          ixheaace_write_bits(pstr_bit_stream_handle, 0, 8);
  802|  11.6M|        }
  803|  60.4k|        cnt = *total_fill_bits - (cnt << 3);
  804|  60.4k|        ixheaace_write_bits(pstr_bit_stream_handle, 0, (UWORD8)cnt);
  805|  60.4k|        *total_fill_bits = 0;
  806|  60.4k|      }
  807|  60.4k|    }
  808|       |    /* byte alignement */
  809|       |
  810|   141k|    ixheaace_write_bits(pstr_bit_stream_handle, 0,
  811|   141k|                        (UWORD8)((8 - (pstr_bit_stream_handle->cnt_bits % 8)) % 8));
  812|   141k|  }
  813|       |
  814|   299k|  *glob_used_bits -= bit_markup;
  815|       |
  816|   299k|  bit_markup = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  817|       |
  818|   299k|  *glob_used_bits += bit_markup;
  819|       |
  820|   299k|  frame_bits += *glob_used_bits;
  821|       |
  822|   299k|  if (frame_bits != pstr_qc_out->tot_static_bits_used + pstr_qc_out->tot_dyn_bits_used +
  ------------------
  |  Branch (822:7): [True: 192k, False: 107k]
  ------------------
  823|   299k|                        pstr_qc_out->tot_anc_bits_used + +pstr_qc_out->total_fill_bits +
  824|   299k|                        pstr_qc_out->align_bits) {
  825|   192k|  }
  826|       |
  827|   299k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   299k|#define IA_NO_ERROR 0x00000000
  ------------------
  828|   300k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_single_chan_elem:
  426|   141k|    ixheaace_temporal_noise_shaping_params pstr_tns_info, ixheaace_aac_tables *pstr_aac_tables) {
  427|   141k|  IA_ERRORCODE err_code;
  428|       |
  429|   141k|  switch (aot) {
  ------------------
  |  Branch (429:11): [True: 106k, False: 35.2k]
  ------------------
  430|  24.3k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  24.3k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (430:5): [True: 24.3k, False: 116k]
  ------------------
  431|  76.9k|    case AOT_SBR:
  ------------------
  |  |   35|  76.9k|#define AOT_SBR (5)
  ------------------
  |  Branch (431:5): [True: 52.5k, False: 88.7k]
  ------------------
  432|  96.3k|    case AOT_PS:
  ------------------
  |  |   39|  96.3k|#define AOT_PS (29)
  ------------------
  |  Branch (432:5): [True: 19.4k, False: 121k]
  ------------------
  433|  96.3k|      ixheaace_write_bits(pstr_bit_stream_handle, ID_SCE, 3);
  434|  96.3k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  435|  96.3k|      break;
  436|  9.66k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  9.66k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (436:5): [True: 9.66k, False: 131k]
  ------------------
  437|  9.66k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  438|  9.66k|      break;
  439|   141k|  }
  440|       |
  441|   141k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  442|   141k|      0, pstr_qc_out_ch->win_shape, pstr_qc_out_ch->grouping_mask, pstr_sfb_offset,
  443|   141k|      pstr_qc_out_ch->scalefactor, pstr_qc_out_ch->max_val_in_sfb, pstr_qc_out_ch->global_gain,
  444|   141k|      pstr_qc_out_ch->quant_spec, &(pstr_qc_out_ch->section_data), pstr_bit_stream_handle, aot,
  445|   141k|      pstr_tns_info, pstr_aac_tables);
  446|       |
  447|   141k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   141k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (447:7): [True: 193, False: 141k]
  ------------------
  448|    193|    return err_code;
  449|    193|  }
  450|       |
  451|   141k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   141k|#define IA_NO_ERROR 0x00000000
  ------------------
  452|   141k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_ic_stream:
  384|   437k|    ixheaace_aac_tables *pstr_aac_tables) {
  385|   437k|  WORD32 log_norm = -1;
  386|       |
  387|   437k|  ia_enhaacplus_enc_encode_global_gain(
  388|   437k|      global_gain, log_norm, ptr_scf[pstr_section_data->first_scf], pstr_bit_stream_handle);
  389|   437k|  if (!common_window) {
  ------------------
  |  Branch (389:7): [True: 162k, False: 275k]
  ------------------
  390|   162k|    ia_enhaacplus_enc_encode_ics_info(pstr_section_data->block_type, win_shape, grouping_mask,
  391|   162k|                                      pstr_section_data, pstr_bit_stream_handle, aot);
  392|   162k|  }
  393|       |
  394|   437k|  if (ia_enhaacplus_enc_encode_section_data(pstr_section_data, pstr_bit_stream_handle) !=
  ------------------
  |  Branch (394:7): [True: 0, False: 437k]
  ------------------
  395|   437k|      pstr_section_data->side_info_bits) {
  396|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_SIDE_INFO_BITS;
  397|      0|  }
  398|       |
  399|   437k|  if (ia_enhaacplus_enc_encode_scalefactor_data(
  ------------------
  |  Branch (399:7): [True: 664, False: 437k]
  ------------------
  400|   437k|          ptr_max_val_in_sfb, pstr_section_data, ptr_scf, pstr_bit_stream_handle,
  401|   437k|          pstr_aac_tables->pstr_huff_tab) != pstr_section_data->scale_fac_bits) {
  402|    664|    return IA_EXHEAACE_EXE_FATAL_INVALID_SCALE_FACTOR_BITS;
  403|    664|  }
  404|       |
  405|   437k|  if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   874k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   36|   783k|#define AOT_AAC_LD (23)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   745k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_AAC_LD || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   134k|#define AOT_PS (29)
  ------------------
  |  Branch (405:7): [True: 90.7k, False: 346k]
  |  Branch (405:28): [True: 38.2k, False: 308k]
  |  Branch (405:49): [True: 174k, False: 134k]
  |  Branch (405:67): [True: 19.4k, False: 114k]
  ------------------
  406|   322k|    ia_enhaacplus_enc_encode_pulse_data(pstr_bit_stream_handle);
  407|   322k|  }
  408|   437k|  ia_enhaacplus_enc_encode_tns_data(pstr_tns_info, pstr_section_data->block_type,
  409|   437k|                                    pstr_bit_stream_handle, aot);
  410|       |
  411|   437k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   874k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   783k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|   172k|#define AOT_PS (29)
  ------------------
  |  Branch (411:7): [True: 90.7k, False: 346k]
  |  Branch (411:28): [True: 174k, False: 172k]
  |  Branch (411:46): [True: 19.4k, False: 152k]
  ------------------
  412|   284k|    ia_enhaacplus_enc_encode_gain_control_data(pstr_bit_stream_handle);
  413|   284k|  }
  414|       |
  415|   437k|  if (ia_enhaacplus_enc_encode_spectral_data(
  ------------------
  |  Branch (415:7): [True: 0, False: 437k]
  ------------------
  416|   437k|          pstr_sfb_offset, pstr_section_data, ptr_quant_spec, pstr_bit_stream_handle,
  417|   437k|          pstr_aac_tables->pstr_huff_tab) != pstr_section_data->huffman_bits) {
  418|      0|    return IA_EXHEAACE_EXE_FATAL_INVALID_HUFFMAN_BITS;
  419|      0|  }
  420|   437k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   437k|#define IA_NO_ERROR 0x00000000
  ------------------
  421|   437k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_global_gain:
   90|   437k|                                                 ixheaace_bit_buf_handle pstr_bit_stream_handle) {
   91|   437k|  ixheaace_write_bits(pstr_bit_stream_handle,
   92|   437k|                      global_gain - scalefac + GLOBAL_GAIN_OFFSET - 4 * log_norm, 8);
  ------------------
  |  |   23|   437k|#define GLOBAL_GAIN_OFFSET 100
  ------------------
   93|   437k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_ics_info:
   99|   300k|                                              WORD32 aot) {
  100|   300k|  WORD32 tmp;
  101|       |
  102|   300k|  switch (aot) {
  ------------------
  |  Branch (102:11): [True: 222k, False: 77.7k]
  ------------------
  103|  25.3k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  25.3k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (103:5): [True: 25.3k, False: 275k]
  ------------------
  104|  25.3k|      tmp = ((ICS_RESERVED_BIT << 3) | (block_type << 1) | win_shape);
  ------------------
  |  |   24|  25.3k|#define ICS_RESERVED_BIT 0
  ------------------
  105|  25.3k|      ixheaace_write_bits(pstr_bit_stream_handle, tmp, 4);
  106|  25.3k|      break;
  107|       |
  108|  60.8k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  60.8k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (108:5): [True: 60.8k, False: 239k]
  ------------------
  109|   177k|    case AOT_SBR:
  ------------------
  |  |   35|   177k|#define AOT_SBR (5)
  ------------------
  |  Branch (109:5): [True: 117k, False: 183k]
  ------------------
  110|   197k|    case AOT_PS:
  ------------------
  |  |   39|   197k|#define AOT_PS (29)
  ------------------
  |  Branch (110:5): [True: 19.4k, False: 280k]
  ------------------
  111|   197k|      tmp = ((ICS_RESERVED_BIT << 3) | (block_type << 1) | win_shape);
  ------------------
  |  |   24|   197k|#define ICS_RESERVED_BIT 0
  ------------------
  112|   197k|      ixheaace_write_bits(pstr_bit_stream_handle, tmp, 4);
  113|   197k|      break;
  114|   300k|  }
  115|   300k|  switch (block_type) {
  ------------------
  |  Branch (115:11): [True: 300k, False: 0]
  ------------------
  116|   227k|    case LONG_WINDOW:
  ------------------
  |  |   31|   227k|#define LONG_WINDOW 0
  ------------------
  |  Branch (116:5): [True: 227k, False: 73.2k]
  ------------------
  117|   240k|    case START_WINDOW:
  ------------------
  |  |   32|   240k|#define START_WINDOW 1
  ------------------
  |  Branch (117:5): [True: 13.2k, False: 287k]
  ------------------
  118|   252k|    case STOP_WINDOW:
  ------------------
  |  |   34|   252k|#define STOP_WINDOW 3
  ------------------
  |  Branch (118:5): [True: 11.9k, False: 288k]
  ------------------
  119|       |
  120|   252k|      switch (aot) {
  121|  47.9k|        case AOT_AAC_LC:
  ------------------
  |  |   34|  47.9k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (121:9): [True: 47.9k, False: 204k]
  ------------------
  122|   138k|        case AOT_SBR:
  ------------------
  |  |   35|   138k|#define AOT_SBR (5)
  ------------------
  |  Branch (122:9): [True: 90.9k, False: 161k]
  ------------------
  123|   149k|        case AOT_PS:
  ------------------
  |  |   39|   149k|#define AOT_PS (29)
  ------------------
  |  Branch (123:9): [True: 10.4k, False: 241k]
  ------------------
  124|   149k|          tmp = pstr_section_data->max_sfb_per_grp << 1;
  125|   149k|          ixheaace_write_bits(pstr_bit_stream_handle, tmp, 7);
  126|   149k|          break;
  127|       |
  128|  25.3k|        case AOT_AAC_LD:
  ------------------
  |  |   36|  25.3k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (128:9): [True: 25.3k, False: 227k]
  ------------------
  129|  25.3k|          tmp = pstr_section_data->max_sfb_per_grp << 1;
  130|  25.3k|          ixheaace_write_bits(pstr_bit_stream_handle, tmp, 7);
  131|  25.3k|          break;
  132|  77.7k|        default:
  ------------------
  |  Branch (132:9): [True: 77.7k, False: 174k]
  ------------------
  133|  77.7k|          ixheaace_write_bits(pstr_bit_stream_handle, pstr_section_data->max_sfb_per_grp, 6);
  134|   252k|      }
  135|   252k|      break;
  136|       |
  137|   252k|    case SHORT_WINDOW:
  ------------------
  |  |   33|  48.0k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (137:5): [True: 48.0k, False: 252k]
  ------------------
  138|       |
  139|       |      // Write grouping bits
  140|       |
  141|  48.0k|      tmp = pstr_section_data->max_sfb_per_grp << (TRANS_FAC - 1) | grouping_mask;
  ------------------
  |  |   29|  48.0k|#define TRANS_FAC 8
  ------------------
  142|  48.0k|      ixheaace_write_bits(pstr_bit_stream_handle, tmp, TRANS_FAC - 1 + 4);
  ------------------
  |  |   29|  48.0k|#define TRANS_FAC 8
  ------------------
  143|       |
  144|  48.0k|      break;
  145|   300k|  }
  146|   300k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_section_data:
  149|   437k|    ixheaace_section_data *pstr_section_data, ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  150|   437k|  WORD32 sect_escape_val = 0, sect_len_bits = 0;
  151|   437k|  WORD32 sect_len;
  152|   437k|  WORD32 i;
  153|   437k|  WORD32 dbg_val = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  154|       |
  155|   437k|  switch (pstr_section_data->block_type) {
  ------------------
  |  Branch (155:11): [True: 437k, False: 0]
  ------------------
  156|   317k|    case LONG_WINDOW:
  ------------------
  |  |   31|   317k|#define LONG_WINDOW 0
  ------------------
  |  Branch (156:5): [True: 317k, False: 120k]
  ------------------
  157|   338k|    case START_WINDOW:
  ------------------
  |  |   32|   338k|#define START_WINDOW 1
  ------------------
  |  Branch (157:5): [True: 20.7k, False: 417k]
  ------------------
  158|   356k|    case STOP_WINDOW:
  ------------------
  |  |   34|   356k|#define STOP_WINDOW 3
  ------------------
  |  Branch (158:5): [True: 18.4k, False: 419k]
  ------------------
  159|       |
  160|   356k|      sect_escape_val = SECT_ESC_VAL_LONG;
  ------------------
  |  |   23|   356k|#define SECT_ESC_VAL_LONG 31
  ------------------
  161|   356k|      sect_len_bits = SECT_BITS_LONG;
  ------------------
  |  |   26|   356k|#define SECT_BITS_LONG 5
  ------------------
  162|   356k|      break;
  163|       |
  164|  81.0k|    case SHORT_WINDOW:
  ------------------
  |  |   33|  81.0k|#define SHORT_WINDOW 2
  ------------------
  |  Branch (164:5): [True: 81.0k, False: 356k]
  ------------------
  165|       |
  166|  81.0k|      sect_escape_val = SECT_ESC_VAL_SHORT;
  ------------------
  |  |   24|  81.0k|#define SECT_ESC_VAL_SHORT 7
  ------------------
  167|  81.0k|      sect_len_bits = SECT_BITS_SHORT;
  ------------------
  |  |   27|  81.0k|#define SECT_BITS_SHORT 3
  ------------------
  168|  81.0k|      break;
  169|   437k|  }
  170|       |
  171|  2.01M|  for (i = 0; i < pstr_section_data->num_of_sections; i++) {
  ------------------
  |  Branch (171:15): [True: 1.57M, False: 437k]
  ------------------
  172|  1.57M|    ixheaace_write_bits(pstr_bit_stream_handle, pstr_section_data->section[i].code_book, 4);
  173|       |
  174|  1.57M|    sect_len = pstr_section_data->section[i].sfb_cnt;
  175|       |
  176|  1.92M|    while (sect_len >= sect_escape_val) {
  ------------------
  |  Branch (176:12): [True: 342k, False: 1.57M]
  ------------------
  177|   342k|      ixheaace_write_bits(pstr_bit_stream_handle, sect_escape_val, (UWORD8)sect_len_bits);
  178|       |
  179|   342k|      sect_len -= sect_escape_val;
  180|   342k|    }
  181|       |
  182|  1.57M|    ixheaace_write_bits(pstr_bit_stream_handle, sect_len, (UWORD8)sect_len_bits);
  183|  1.57M|  }
  184|       |
  185|   437k|  return (ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle) - dbg_val);
  186|   437k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_scalefactor_data:
  201|   437k|    ixheaace_bit_buf_handle pstr_bit_stream_handle, ixheaace_huffman_tables *pstr_huffman_tbl) {
  202|   437k|  WORD32 i, j, last_val_scf, delta_scf;
  203|   437k|  WORD32 dbg_val = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
  204|   437k|  const UWORD16 *ptr_pltabscf = &pstr_huffman_tbl->huff_ltabscf[CODE_BCK_SCF_LAV];
  205|   437k|  const UWORD32 *ptr_pctabscf = &pstr_huffman_tbl->huff_ctabscf[CODE_BCK_SCF_LAV];
  206|       |
  207|   437k|  last_val_scf = ptr_scalefac[pstr_section_data->first_scf];
  208|       |
  209|  2.01M|  for (i = 0; i < pstr_section_data->num_of_sections; i++) {
  ------------------
  |  Branch (209:15): [True: 1.57M, False: 437k]
  ------------------
  210|  1.57M|    if (pstr_section_data->section[i].code_book != CODE_BCK_ZERO_NO) {
  ------------------
  |  Branch (210:9): [True: 1.11M, False: 466k]
  ------------------
  211|  1.11M|      for (j = pstr_section_data->section[i].sfb_start;
  212|  7.70M|           j < pstr_section_data->section[i].sfb_start + pstr_section_data->section[i].sfb_cnt;
  ------------------
  |  Branch (212:12): [True: 6.59M, False: 1.11M]
  ------------------
  213|  6.59M|           j++) {
  214|  6.59M|        if (ptr_max_val_in_sfb[j] == 0) {
  ------------------
  |  Branch (214:13): [True: 360k, False: 6.23M]
  ------------------
  215|   360k|          delta_scf = 0;
  216|  6.23M|        } else {
  217|  6.23M|          delta_scf = -(ptr_scalefac[j] - last_val_scf);
  218|       |
  219|  6.23M|          last_val_scf = ptr_scalefac[j];
  220|  6.23M|        }
  221|  6.59M|        ia_enhaacplus_enc_code_scale_factor_delta_lav(delta_scf, pstr_bit_stream_handle,
  222|  6.59M|                                                          ptr_pltabscf, ptr_pctabscf);
  223|  6.59M|      }
  224|  1.11M|    }
  225|  1.57M|  }
  226|       |
  227|   437k|  return (ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle) - dbg_val);
  228|   437k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_code_scale_factor_delta_lav:
  191|  6.59M|                                                            const UWORD32 *ptr_pctabscf) {
  192|  6.59M|  WORD32 code_word, code_length;
  193|       |
  194|  6.59M|  code_word = ptr_pctabscf[delta];
  195|  6.59M|  code_length = ptr_pltabscf[delta];
  196|       |
  197|  6.59M|  ixheaace_write_bits(ptr_bitstream, code_word, (UWORD8)code_length);
  198|  6.59M|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_pulse_data:
  375|   322k|ia_enhaacplus_enc_encode_pulse_data(ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  376|   322k|  ixheaace_write_bits(pstr_bit_stream_handle, 0, 1);
  377|   322k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_tns_data:
  284|   437k|    ixheaace_bit_buf_handle pstr_bit_stream_handle, WORD32 aot) {
  285|   437k|  WORD32 i, k;
  286|   437k|  WORD32 tns_present;
  287|   437k|  WORD32 num_windows;
  288|   437k|  WORD32 coef_bits;
  289|       |
  290|   437k|  UWORD32 tmp;
  291|   437k|  UWORD8 val;
  292|       |
  293|   437k|  num_windows = (block_type == 2 ? TRANS_FAC : 1);
  ------------------
  |  |   29|  80.8k|#define TRANS_FAC 8
  ------------------
  |  Branch (293:18): [True: 80.8k, False: 356k]
  ------------------
  294|       |
  295|   437k|  tns_present = 0;
  296|       |
  297|  1.44M|  for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (297:15): [True: 1.00M, False: 437k]
  ------------------
  298|  1.00M|    if (pstr_tns_info.tns_active[i] == 1) {
  ------------------
  |  Branch (298:9): [True: 316k, False: 686k]
  ------------------
  299|   316k|      tns_present = 1;
  300|   316k|    }
  301|  1.00M|  }
  302|       |
  303|   437k|  if (tns_present == 0) {
  ------------------
  |  Branch (303:7): [True: 227k, False: 209k]
  ------------------
  304|   227k|    ixheaace_write_bits(pstr_bit_stream_handle, 0, 1);
  305|       |
  306|   227k|    if (AOT_AAC_LD == aot) {
  ------------------
  |  |   36|   227k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (306:9): [True: 30.3k, False: 197k]
  ------------------
  307|  30.3k|      ia_enhaacplus_enc_encode_gain_control_data(pstr_bit_stream_handle);
  308|  30.3k|    }
  309|   227k|  } else {
  310|       |    /* there is data to be written*/
  311|       |
  312|   209k|    ixheaace_write_bits(pstr_bit_stream_handle, 1, 1); /* data_present */
  313|       |
  314|   209k|    if (aot == AOT_AAC_LD) {
  ------------------
  |  |   36|   209k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (314:9): [True: 7.91k, False: 201k]
  ------------------
  315|  7.91k|      ia_enhaacplus_enc_encode_gain_control_data(pstr_bit_stream_handle);
  316|  7.91k|    }
  317|       |
  318|   727k|    for (i = 0; i < num_windows; i++) {
  ------------------
  |  Branch (318:17): [True: 518k, False: 209k]
  ------------------
  319|   518k|      ixheaace_write_bits(pstr_bit_stream_handle, pstr_tns_info.tns_active[i],
  320|   518k|                          (UWORD8)(block_type == 2 ? 1 : 2));
  ------------------
  |  Branch (320:36): [True: 352k, False: 165k]
  ------------------
  321|       |
  322|   518k|      if (pstr_tns_info.tns_active[i]) {
  ------------------
  |  Branch (322:11): [True: 316k, False: 201k]
  ------------------
  323|   316k|        tmp = ((pstr_tns_info.coef_res[i] == 4 ? 1 : 0)
  ------------------
  |  Branch (323:17): [True: 165k, False: 151k]
  ------------------
  324|   316k|                   << ((block_type == 2 ? 4 : 6) + (block_type == 2 ? 3 : 5)) |
  ------------------
  |  Branch (324:25): [True: 151k, False: 165k]
  |  Branch (324:53): [True: 151k, False: 165k]
  ------------------
  325|   316k|               pstr_tns_info.length[i] << (block_type == 2 ? 3 : 5) | pstr_tns_info.order[i]);
  ------------------
  |  Branch (325:44): [True: 151k, False: 165k]
  ------------------
  326|       |
  327|   316k|        val = (UWORD8)(1 + (block_type == 2 ? 4 : 6) + (block_type == 2 ? 3 : 5));
  ------------------
  |  Branch (327:29): [True: 151k, False: 165k]
  |  Branch (327:57): [True: 151k, False: 165k]
  ------------------
  328|       |
  329|   316k|        ixheaace_write_bits(pstr_bit_stream_handle, tmp, val);
  330|       |
  331|   316k|        if (pstr_tns_info.order[i]) {
  ------------------
  |  Branch (331:13): [True: 316k, False: 105]
  ------------------
  332|   316k|          ixheaace_write_bits(pstr_bit_stream_handle, FILTER_DIRECTION, 1);
  ------------------
  |  |   28|   316k|#define FILTER_DIRECTION (0)
  ------------------
  333|       |
  334|   316k|          if (pstr_tns_info.coef_res[i] == 4) {
  ------------------
  |  Branch (334:15): [True: 165k, False: 151k]
  ------------------
  335|   165k|            coef_bits = 3;
  336|       |
  337|   597k|            for (k = 0; k < pstr_tns_info.order[i]; k++) {
  ------------------
  |  Branch (337:25): [True: 566k, False: 30.5k]
  ------------------
  338|   566k|              if (pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 3 ||
  ------------------
  |  |   23|   566k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (338:19): [True: 107k, False: 458k]
  ------------------
  339|   458k|                  pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -4) {
  ------------------
  |  |   23|   458k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (339:19): [True: 26.9k, False: 431k]
  ------------------
  340|   134k|                coef_bits = 4;
  341|   134k|                break;
  342|   134k|              }
  343|   566k|            }
  344|   165k|          } else {
  345|   151k|            coef_bits = 2;
  346|       |
  347|   416k|            for (k = 0; k < pstr_tns_info.order[i]; k++) {
  ------------------
  |  Branch (347:25): [True: 318k, False: 98.2k]
  ------------------
  348|   318k|              if (pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] > 1 ||
  ------------------
  |  |   23|   318k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (348:19): [True: 49.2k, False: 268k]
  ------------------
  349|   268k|                  pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] < -2) {
  ------------------
  |  |   23|   268k|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  |  Branch (349:19): [True: 3.70k, False: 265k]
  ------------------
  350|  52.9k|                coef_bits = 3;
  351|  52.9k|                break;
  352|  52.9k|              }
  353|   318k|            }
  354|   151k|          }
  355|       |
  356|   316k|          ixheaace_write_bits(pstr_bit_stream_handle, -(coef_bits - pstr_tns_info.coef_res[i]),
  357|   316k|                              1); /*coef_compres*/
  358|       |
  359|  2.10M|          for (k = 0; k < pstr_tns_info.order[i]; k++) {
  ------------------
  |  Branch (359:23): [True: 1.78M, False: 316k]
  ------------------
  360|  1.78M|            static const WORD32 rmask[] = {0, 1, 3, 7, 15};
  361|       |
  362|  1.78M|            ixheaace_write_bits(
  363|  1.78M|                pstr_bit_stream_handle,
  364|  1.78M|                pstr_tns_info.coef[i * TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT + k] &
  ------------------
  |  |   23|  1.78M|#define TEMPORAL_NOISE_SHAPING_MAX_ORDER_SHORT (5)
  ------------------
  365|  1.78M|                    rmask[coef_bits],
  366|  1.78M|                (UWORD8)coef_bits);
  367|  1.78M|          }
  368|   316k|        }
  369|   316k|      }
  370|   518k|    }
  371|   209k|  }
  372|   437k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_gain_control_data:
   63|   322k|{
   64|   322k|  ixheaace_write_bits(pstr_bit_stream_handle, 0, 1);
   65|   322k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_spectral_data:
   68|   437k|    ixheaace_bit_buf_handle pstr_bit_stream_handle, ixheaace_huffman_tables *ptr_huffman_tbl) {
   69|   437k|  WORD32 i, sfb;
   70|   437k|  WORD32 dbg_val;
   71|       |
   72|   437k|  dbg_val = ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle);
   73|       |
   74|  2.01M|  for (i = 0; i < pstr_section_data->num_of_sections; i++) {
  ------------------
  |  Branch (74:15): [True: 1.57M, False: 437k]
  ------------------
   75|  1.57M|    for (sfb = pstr_section_data->section[i].sfb_start;
   76|  13.6M|         sfb < pstr_section_data->section[i].sfb_start + pstr_section_data->section[i].sfb_cnt;
  ------------------
  |  Branch (76:10): [True: 12.0M, False: 1.57M]
  ------------------
   77|  12.0M|         sfb++) {
   78|  12.0M|      ia_enhaacplus_enc_code_values(ptr_quant_spectrum + pstr_sfb_offset[sfb],
   79|  12.0M|                                    pstr_sfb_offset[sfb + 1] - pstr_sfb_offset[sfb],
   80|  12.0M|                                    pstr_section_data->section[i].code_book,
   81|  12.0M|                                    pstr_bit_stream_handle, ptr_huffman_tbl);
   82|  12.0M|    }
   83|  1.57M|  }
   84|       |
   85|   437k|  return (ia_enhaacplus_enc_get_bits_available(pstr_bit_stream_handle) - dbg_val);
   86|   437k|}
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.44k]
  ------------------
  598|  5.77k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  5.77k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (598:5): [True: 5.77k, False: 15.5k]
  ------------------
  599|  13.1k|    case AOT_SBR:
  ------------------
  |  |   35|  13.1k|#define AOT_SBR (5)
  ------------------
  |  Branch (599:5): [True: 7.35k, False: 14.0k]
  ------------------
  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.77k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  2.77k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (605:5): [True: 2.77k, False: 18.5k]
  ------------------
  606|  2.77k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  607|  2.77k|      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.3k]
  ------------------
  617|     46|    return err_code;
  618|     46|  }
  619|  21.3k|  return IA_NO_ERROR;
  ------------------
  |  |   23|  21.3k|#define IA_NO_ERROR 0x00000000
  ------------------
  620|  21.3k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_channel_pair_element:
  459|   137k|    ixheaace_aac_tables *pstr_aac_tables) {
  460|   137k|  IA_ERRORCODE err_code;
  461|       |
  462|   137k|  if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   34|   275k|#define AOT_AAC_LC (2)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   35|   244k|#define AOT_SBR (5)
  ------------------
                if (aot == AOT_AAC_LC || aot == AOT_SBR || aot == AOT_PS) {
  ------------------
  |  |   39|  49.9k|#define AOT_PS (29)
  ------------------
  |  Branch (462:7): [True: 30.6k, False: 107k]
  |  Branch (462:28): [True: 57.1k, False: 49.9k]
  |  Branch (462:46): [True: 0, False: 49.9k]
  ------------------
  463|  87.8k|    ixheaace_write_bits(pstr_bit_stream_handle, ID_CPE, 3);
  464|  87.8k|  }
  465|       |
  466|   137k|  switch (aot) {
  ------------------
  |  Branch (466:11): [True: 100k, False: 37.0k]
  ------------------
  467|  12.9k|    case AOT_AAC_LD:
  ------------------
  |  |   36|  12.9k|#define AOT_AAC_LD (23)
  ------------------
  |  Branch (467:5): [True: 12.9k, False: 124k]
  ------------------
  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.6k|    case AOT_AAC_LC:
  ------------------
  |  |   34|  30.6k|#define AOT_AAC_LC (2)
  ------------------
  |  Branch (472:5): [True: 30.6k, False: 107k]
  ------------------
  473|  87.8k|    case AOT_SBR:
  ------------------
  |  |   35|  87.8k|#define AOT_SBR (5)
  ------------------
  |  Branch (473:5): [True: 57.1k, False: 80.6k]
  ------------------
  474|  87.8k|    case AOT_PS:
  ------------------
  |  |   39|  87.8k|#define AOT_PS (29)
  ------------------
  |  Branch (474:5): [True: 0, False: 137k]
  ------------------
  475|  87.8k|      ixheaace_write_bits(pstr_bit_stream_handle, instance_tag, 4);
  476|  87.8k|      ixheaace_write_bits(pstr_bit_stream_handle, 1, 1);
  477|  87.8k|      break;
  478|   137k|  }
  479|       |
  480|   137k|  ia_enhaacplus_enc_encode_ics_info(pstr_qc_out_ch[0].section_data.block_type,
  481|   137k|                                    pstr_qc_out_ch[0].win_shape, pstr_qc_out_ch[0].grouping_mask,
  482|   137k|                                    &(pstr_qc_out_ch[0].section_data), pstr_bit_stream_handle,
  483|   137k|                                    aot);
  484|       |
  485|   137k|  ia_enhaacplus_enc_encode_ms_info(pstr_qc_out_ch[0].section_data.sfb_cnt,
  486|   137k|                                   pstr_qc_out_ch[0].section_data.sfb_per_group,
  487|   137k|                                   pstr_qc_out_ch[0].section_data.max_sfb_per_grp, ms_digest,
  488|   137k|                                   ms_flags, pstr_bit_stream_handle);
  489|   137k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  490|   137k|      1, pstr_qc_out_ch[0].win_shape, pstr_qc_out_ch[0].grouping_mask, pstr_sfb_offset[0],
  491|   137k|      pstr_qc_out_ch[0].scalefactor, pstr_qc_out_ch[0].max_val_in_sfb,
  492|   137k|      pstr_qc_out_ch[0].global_gain, pstr_qc_out_ch[0].quant_spec,
  493|   137k|      &(pstr_qc_out_ch[0].section_data), pstr_bit_stream_handle, aot, pstr_tns_info[0],
  494|   137k|      pstr_aac_tables);
  495|       |
  496|   137k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   137k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (496:7): [True: 350, False: 137k]
  ------------------
  497|    350|    return err_code;
  498|    350|  }
  499|       |
  500|   137k|  err_code = ia_enhaacplus_enc_write_ic_stream(
  501|   137k|      1, pstr_qc_out_ch[1].win_shape, pstr_qc_out_ch[1].grouping_mask, pstr_sfb_offset[1],
  502|   137k|      pstr_qc_out_ch[1].scalefactor, pstr_qc_out_ch[1].max_val_in_sfb,
  503|   137k|      pstr_qc_out_ch[1].global_gain, pstr_qc_out_ch[1].quant_spec,
  504|   137k|      &(pstr_qc_out_ch[1].section_data), pstr_bit_stream_handle, aot, pstr_tns_info[1],
  505|   137k|      pstr_aac_tables);
  506|       |
  507|   137k|  if (err_code != IA_NO_ERROR) {
  ------------------
  |  |   23|   137k|#define IA_NO_ERROR 0x00000000
  ------------------
  |  Branch (507:7): [True: 75, False: 137k]
  ------------------
  508|     75|    return err_code;
  509|     75|  }
  510|       |
  511|   137k|  return IA_NO_ERROR;
  ------------------
  |  |   23|   137k|#define IA_NO_ERROR 0x00000000
  ------------------
  512|   137k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_encode_ms_info:
  232|   137k|                                             ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  233|   137k|  WORD32 sfb, sfb_offset;
  234|   137k|  UWORD32 tmp_var = 0;
  235|   137k|  WORD32 *jsflag;
  236|   137k|  UWORD8 num_of_bits, remaining = 0;
  237|       |
  238|   137k|  switch (ms_digest) {
  ------------------
  |  Branch (238:11): [True: 137k, False: 0]
  ------------------
  239|  25.0k|    case MS_NONE:
  ------------------
  |  Branch (239:5): [True: 25.0k, False: 112k]
  ------------------
  240|  25.0k|      ixheaace_write_bits(pstr_bit_stream_handle, SI_MS_MASK_NONE, 2);
  241|  25.0k|      break;
  242|       |
  243|  88.2k|    case MS_ALL:
  ------------------
  |  Branch (243:5): [True: 88.2k, False: 49.5k]
  ------------------
  244|  88.2k|      ixheaace_write_bits(pstr_bit_stream_handle, SI_MS_MASK_ALL, 2);
  245|  88.2k|      break;
  246|       |
  247|  24.5k|    case MS_SOME:
  ------------------
  |  Branch (247:5): [True: 24.5k, False: 113k]
  ------------------
  248|  24.5k|      ixheaace_write_bits(pstr_bit_stream_handle, SI_MS_MASK_SOME, 2);
  249|       |
  250|  24.5k|      if (max_sfb > 32) {
  ------------------
  |  Branch (250:11): [True: 5.00k, False: 19.5k]
  ------------------
  251|  5.00k|        num_of_bits = 32;
  252|  5.00k|        remaining = (UWORD8)(max_sfb - 32);
  253|  5.00k|      } else
  254|  19.5k|        num_of_bits = (UWORD8)max_sfb;
  255|       |
  256|  81.4k|      for (sfb_offset = 0; sfb_offset < sfb_cnt; sfb_offset += sfb_grp) {
  ------------------
  |  Branch (256:28): [True: 56.9k, False: 24.5k]
  ------------------
  257|  56.9k|        WORD8 flag;
  258|  56.9k|        jsflag = &js_flags[sfb_offset];
  259|  56.9k|        tmp_var = 0;
  260|       |
  261|   955k|        for (sfb = num_of_bits - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (261:37): [True: 898k, False: 56.9k]
  ------------------
  262|   898k|          flag = (WORD8)(*jsflag++);
  263|   898k|          tmp_var = ((tmp_var << 1) | flag);
  264|   898k|        }
  265|       |
  266|  56.9k|        ixheaace_write_bits(pstr_bit_stream_handle, tmp_var, num_of_bits);
  267|       |
  268|  56.9k|        if (remaining) {
  ------------------
  |  Branch (268:13): [True: 5.00k, False: 51.9k]
  ------------------
  269|  36.0k|          for (sfb = remaining - 1; sfb >= 0; sfb--) {
  ------------------
  |  Branch (269:37): [True: 31.0k, False: 5.00k]
  ------------------
  270|  31.0k|            flag = (WORD8)(*jsflag++);
  271|  31.0k|            tmp_var = ((tmp_var << 1) | flag);
  272|  31.0k|          }
  273|       |
  274|  5.00k|          ixheaace_write_bits(pstr_bit_stream_handle, tmp_var, remaining);
  275|  5.00k|        }
  276|  56.9k|      }
  277|       |
  278|  24.5k|      break;
  279|   137k|  }
  280|   137k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_fill_element_LC:
  559|   277k|                                                    ixheaace_bit_buf_handle pstr_h_bit_stream) {
  560|   277k|  WORD32 i, cnt, esc_count;
  561|       |
  562|   602k|  while (total_fill_bits >= (3 + 4)) {
  ------------------
  |  Branch (562:10): [True: 325k, False: 277k]
  ------------------
  563|   325k|    cnt = MIN((total_fill_bits - (3 + 4)) / 8, ((1 << 4) - 1));
  ------------------
  |  |   23|   325k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 69.0k, False: 256k]
  |  |  ------------------
  ------------------
  564|       |
  565|   325k|    ixheaace_write_bits(pstr_h_bit_stream, ID_FIL, 3);
  566|       |
  567|   325k|    ixheaace_write_bits(pstr_h_bit_stream, cnt, 4);
  568|       |
  569|   325k|    total_fill_bits -= (3 + 4);
  570|       |
  571|   325k|    if (cnt == (1 << 4) - 1) {
  ------------------
  |  Branch (571:9): [True: 256k, False: 69.0k]
  ------------------
  572|   256k|      esc_count = MIN((total_fill_bits / 8) - ((1 << 4) - 1), (1 << 8) - 1);
  ------------------
  |  |   23|   256k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 98.1k, False: 157k]
  |  |  ------------------
  ------------------
  573|       |
  574|   256k|      ixheaace_write_bits(pstr_h_bit_stream, esc_count, 8);
  575|       |
  576|   256k|      total_fill_bits -= 8;
  577|       |
  578|   256k|      cnt += esc_count - 1;
  579|   256k|    }
  580|       |
  581|  49.6M|    for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (581:17): [True: 49.2M, False: 325k]
  ------------------
  582|  49.2M|      if (ptr_anc_bytes)
  ------------------
  |  Branch (582:11): [True: 2.05M, False: 47.2M]
  ------------------
  583|  2.05M|        ixheaace_write_bits(pstr_h_bit_stream, *ptr_anc_bytes++, 8);
  584|  47.2M|      else
  585|  47.2M|        ixheaace_write_bits(pstr_h_bit_stream, 0, 8);
  586|       |
  587|  49.2M|      total_fill_bits -= 8;
  588|  49.2M|    }
  589|   325k|  }
  590|   277k|}
ixheaace_write_bitstream.c:ia_enhaacplus_enc_write_fill_element_LD:
  516|  60.4k|    ixheaace_bit_buf_handle pstr_bit_stream_handle) {
  517|  60.4k|  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|  60.4k|  total_fill_bits -= 7;
  527|   167k|  while (total_fill_bits > 0) {
  ------------------
  |  Branch (527:10): [True: 107k, False: 60.4k]
  ------------------
  528|   107k|    cnt = MIN((total_fill_bits >> 3), ((1 << 4) - 1));
  ------------------
  |  |   23|   107k|#define MIN(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (23:20): [True: 43.5k, False: 63.8k]
  |  |  ------------------
  ------------------
  529|       |
  530|   107k|    if (ptr_anc_bytes) {
  ------------------
  |  Branch (530:9): [True: 107k, False: 0]
  ------------------
  531|  1.43M|      for (i = 0; i < cnt; i++) {
  ------------------
  |  Branch (531:19): [True: 1.32M, False: 107k]
  ------------------
  532|  1.32M|        ixheaace_write_bits(pstr_bit_stream_handle, *ptr_anc_bytes++, 8);
  533|  1.32M|        total_fill_bits -= 8;
  534|  1.32M|      }
  535|   107k|      if (total_fill_bits < 8) {
  ------------------
  |  Branch (535:11): [True: 44.4k, False: 62.9k]
  ------------------
  536|  44.4k|        ixheaace_write_bits(pstr_bit_stream_handle, *ptr_anc_bytes++, (UWORD8)total_fill_bits);
  537|  44.4k|        ixheaace_write_bits(pstr_bit_stream_handle, 0, (UWORD8)(8 - total_fill_bits));
  538|  44.4k|        total_fill_bits = 0;
  539|  44.4k|      }
  540|   107k|    } 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|   107k|  }
  555|  60.4k|}

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

