LLVMFuzzerTestOneInput:
   39|  6.28k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   40|  6.28k|  size_t preamble = 2 + 2 + 1 + sizeof(NeAACDecConfiguration);
   41|  6.28k|  NeAACDecConfiguration config;
   42|  6.28k|  uint64_t sample_rate;
   43|  6.28k|  unsigned char num_channels;
   44|  6.28k|  NeAACDecConfigurationPtr config_ptr;
   45|       |  /* feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW); */
   46|       |
   47|  6.28k|  if (size < preamble) return 0;
  ------------------
  |  Branch (47:7): [True: 8, False: 6.27k]
  ------------------
   48|  6.27k|  size_t len1 = data[0] | (data[1] << 8);
   49|  6.27k|  data += 2;
   50|  6.27k|  size_t len2 = data[0] | (data[1] << 8);
   51|  6.27k|  data += 2;
   52|  6.27k|  uint8_t flags = data[0];
   53|  6.27k|  data += 1;
   54|  6.27k|  memcpy(&config, data, sizeof(NeAACDecConfiguration));
   55|  6.27k|  data += sizeof(NeAACDecConfiguration);
   56|  6.27k|  size -= preamble;
   57|       |
   58|  6.27k|  if (len1 + len2 > size) return 0;
  ------------------
  |  Branch (58:7): [True: 29, False: 6.24k]
  ------------------
   59|  6.24k|  size_t len3 = size - len1 - len2;
   60|  6.24k|  int use_init2 = flags & 1;
   61|  6.24k|  int seek_before = flags & 2;
   62|  6.24k|  int seek_between = flags & 4;
   63|  6.24k|  size_t buffer_op = (flags >> 3) & 3;
   64|  6.24k|  int use_drm = flags & 32;
   65|  6.24k|  int drm_channels = (flags >> 5) & 7;
   66|  6.24k|  unsigned long drm_sample_rate = config.defSampleRate;
   67|  6.24k|  int res, ok;
   68|  6.24k|  const size_t kBufferSize[4] = {0, 0, 16, 16384};
   69|  6.24k|  size_t buffer_size = kBufferSize[buffer_op];
   70|  6.24k|  void* buffer = buffer_size > 0 ? (unsigned char *)malloc(buffer_size) : NULL;
  ------------------
  |  Branch (70:18): [True: 4.83k, False: 1.41k]
  ------------------
   71|       |
   72|  6.24k|  unsigned char* part1 = (unsigned char *)malloc(len1);
   73|  6.24k|  unsigned char* part2 = (unsigned char *)malloc(len2);
   74|  6.24k|  unsigned char* part3 = (unsigned char *)malloc(len3);
   75|  6.24k|  memcpy(part1, data, len1);
   76|  6.24k|  data += len1;
   77|  6.24k|  memcpy(part2, data, len2);
   78|  6.24k|  data += len2;
   79|  6.24k|  memcpy(part3, data, len3);
   80|  6.24k|  data += len3;
   81|       |
   82|  6.24k|  NeAACDecHandle decoder = NeAACDecOpen();
   83|  6.24k|  ok = NeAACDecSetConfiguration(decoder, &config);
   84|  6.24k|  if (!ok) goto cleanup;
  ------------------
  |  Branch (84:7): [True: 52, False: 6.19k]
  ------------------
   85|  6.19k|  config_ptr = NeAACDecGetCurrentConfiguration(decoder);
   86|  6.19k|  if (!config_ptr) __builtin_trap();
  ------------------
  |  Branch (86:7): [True: 0, False: 6.19k]
  ------------------
   87|  6.19k|  if (use_init2) {
  ------------------
  |  Branch (87:7): [True: 2.06k, False: 4.12k]
  ------------------
   88|  2.06k|    res = NeAACDecInit2(decoder, part1, len1, &sample_rate, &num_channels);
   89|  4.12k|  } else {
   90|  4.12k|    res = NeAACDecInit(decoder, part1, len1, &sample_rate, &num_channels);
   91|  4.12k|  }
   92|  6.19k|  if (use_drm) {
  ------------------
  |  Branch (92:7): [True: 524, False: 5.67k]
  ------------------
   93|    524|#ifdef DRM_SUPPORT
   94|    524|    NeAACDecInitDRM(&decoder, drm_channels, drm_sample_rate);
   95|       |#else
   96|       |    (void)drm_channels;
   97|       |    (void)drm_sample_rate;
   98|       |#endif
   99|    524|  }
  100|       |
  101|  6.19k|  if (res != 0) goto cleanup;
  ------------------
  |  Branch (101:7): [True: 188, False: 6.00k]
  ------------------
  102|  6.00k|  NeAACDecFrameInfo faad_info;
  103|  6.00k|  if (seek_before) {
  ------------------
  |  Branch (103:7): [True: 3.32k, False: 2.68k]
  ------------------
  104|  3.32k|    NeAACDecPostSeekReset(decoder, 0x1234567);
  105|  3.32k|  }
  106|  6.00k|  NeAACDecDecode(decoder, &faad_info, part2, len2);
  107|  6.00k|  if (seek_between) {
  ------------------
  |  Branch (107:7): [True: 1.16k, False: 4.84k]
  ------------------
  108|  1.16k|    NeAACDecPostSeekReset(decoder, -0x1234567);
  109|  1.16k|  }
  110|  6.00k|  if (buffer_op == 0) {
  ------------------
  |  Branch (110:7): [True: 1.27k, False: 4.73k]
  ------------------
  111|  1.27k|    NeAACDecDecode(decoder, &faad_info, part3, len3);
  112|  4.73k|  } else {
  113|  4.73k|    NeAACDecDecode2(decoder, &faad_info, part3, len3, &buffer, buffer_size);
  114|  4.73k|  }
  115|       |
  116|  6.24k|cleanup:
  117|  6.24k|  NeAACDecClose(decoder);
  118|  6.24k|  free(part1);
  119|  6.24k|  free(part2);
  120|  6.24k|  free(part3);
  121|  6.24k|  if (buffer) free(buffer);
  ------------------
  |  Branch (121:7): [True: 4.83k, False: 1.41k]
  ------------------
  122|       |
  123|  6.24k|  return 0;
  124|  6.00k|}

faad_initbits:
   56|  20.6k|{
   57|  20.6k|    uint32_t tmp;
   58|       |
   59|  20.6k|    if (ld == NULL)
  ------------------
  |  Branch (59:9): [True: 0, False: 20.6k]
  ------------------
   60|      0|        return;
   61|       |
   62|  20.6k|    if (buffer_size == 0 || _buffer == NULL)
  ------------------
  |  Branch (62:9): [True: 5.14k, False: 15.5k]
  |  Branch (62:29): [True: 0, False: 15.5k]
  ------------------
   63|  5.14k|    {
   64|  5.14k|        ld->error = 1;
   65|  5.14k|        return;
   66|  5.14k|    }
   67|       |
   68|  15.5k|    ld->buffer = _buffer;
   69|       |
   70|  15.5k|    ld->buffer_size = buffer_size;
   71|  15.5k|    ld->bytes_left  = buffer_size;
   72|       |
   73|  15.5k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (73:9): [True: 8.92k, False: 6.61k]
  ------------------
   74|  8.92k|    {
   75|  8.92k|        tmp = getdword((uint32_t*)ld->buffer);
   76|  8.92k|        ld->bytes_left -= 4;
   77|  8.92k|    } else {
   78|  6.61k|        tmp = getdword_n((uint32_t*)ld->buffer, ld->bytes_left);
   79|  6.61k|        ld->bytes_left = 0;
   80|  6.61k|    }
   81|  15.5k|    ld->bufa = tmp;
   82|       |
   83|  15.5k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (83:9): [True: 6.86k, False: 8.67k]
  ------------------
   84|  6.86k|    {
   85|  6.86k|        tmp = getdword((uint32_t*)ld->buffer + 1);
   86|  6.86k|        ld->bytes_left -= 4;
   87|  8.67k|    } else {
   88|  8.67k|        tmp = getdword_n((uint32_t*)ld->buffer + 1, ld->bytes_left);
   89|  8.67k|        ld->bytes_left = 0;
   90|  8.67k|    }
   91|  15.5k|    ld->bufb = tmp;
   92|       |
   93|  15.5k|    ld->start = (uint32_t*)ld->buffer;
   94|  15.5k|    ld->tail = ((uint32_t*)ld->buffer + 2);
   95|       |
   96|  15.5k|    ld->bits_left = 32;
   97|       |
   98|  15.5k|    ld->error = 0;
   99|  15.5k|}
faad_endbits:
  102|  18.0k|{
  103|  18.0k|    (void)ld;
  104|  18.0k|}
faad_get_processed_bits:
  107|  2.00M|{
  108|  2.00M|    return (uint32_t)(8 * (4*(ld->tail - ld->start) - 4) - (ld->bits_left));
  109|  2.00M|}
faad_byte_align:
  112|   120k|{
  113|   120k|    int remainder = (32 - ld->bits_left) & 0x7;
  114|       |
  115|   120k|    if (remainder)
  ------------------
  |  Branch (115:9): [True: 10.0k, False: 110k]
  ------------------
  116|  10.0k|    {
  117|  10.0k|        faad_flushbits(ld, 8 - remainder);
  118|  10.0k|        return (uint8_t)(8 - remainder);
  119|  10.0k|    }
  120|   110k|    return 0;
  121|   120k|}
faad_flushbits_ex:
  124|  6.08M|{
  125|  6.08M|    uint32_t tmp;
  126|       |
  127|  6.08M|    ld->bufa = ld->bufb;
  128|  6.08M|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (128:9): [True: 5.10M, False: 980k]
  ------------------
  129|  5.10M|    {
  130|  5.10M|        tmp = getdword(ld->tail);
  131|  5.10M|        ld->bytes_left -= 4;
  132|  5.10M|    } else {
  133|   980k|        tmp = getdword_n(ld->tail, ld->bytes_left);
  134|   980k|        ld->bytes_left = 0;
  135|   980k|    }
  136|  6.08M|    ld->bufb = tmp;
  137|  6.08M|    ld->tail++;
  138|  6.08M|    ld->bits_left += (32 - bits);
  139|       |    //ld->bytes_left -= 4;
  140|       |//    if (ld->bytes_left == 0)
  141|       |//        ld->no_more_reading = 1;
  142|       |//    if (ld->bytes_left < 0)
  143|       |//        ld->error = 1;
  144|  6.08M|}
faad_rewindbits:
  149|    713|{
  150|    713|    uint32_t tmp;
  151|       |
  152|    713|    ld->bytes_left = ld->buffer_size;
  153|       |
  154|    713|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (154:9): [True: 665, False: 48]
  ------------------
  155|    665|    {
  156|    665|        tmp = getdword((uint32_t*)&ld->start[0]);
  157|    665|        ld->bytes_left -= 4;
  158|    665|    } else {
  159|     48|        tmp = getdword_n((uint32_t*)&ld->start[0], ld->bytes_left);
  160|     48|        ld->bytes_left = 0;
  161|     48|    }
  162|    713|    ld->bufa = tmp;
  163|       |
  164|    713|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (164:9): [True: 561, False: 152]
  ------------------
  165|    561|    {
  166|    561|        tmp = getdword((uint32_t*)&ld->start[1]);
  167|    561|        ld->bytes_left -= 4;
  168|    561|    } else {
  169|    152|        tmp = getdword_n((uint32_t*)&ld->start[1], ld->bytes_left);
  170|    152|        ld->bytes_left = 0;
  171|    152|    }
  172|    713|    ld->bufb = tmp;
  173|       |
  174|    713|    ld->bits_left = 32;
  175|    713|    ld->tail = &ld->start[2];
  176|    713|}
faad_resetbits:
  181|  15.2k|{
  182|  15.2k|    uint32_t tmp;
  183|  15.2k|    uint32_t words = bits >> 5;
  184|  15.2k|    uint32_t remainder = bits & 0x1F;
  185|       |
  186|  15.2k|    if (ld->buffer_size < words * 4)
  ------------------
  |  Branch (186:9): [True: 117, False: 15.1k]
  ------------------
  187|    117|        ld->bytes_left = 0;
  188|  15.1k|    else
  189|  15.1k|        ld->bytes_left = ld->buffer_size - words*4;
  190|       |
  191|  15.2k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (191:9): [True: 14.8k, False: 403]
  ------------------
  192|  14.8k|    {
  193|  14.8k|        tmp = getdword(&ld->start[words]);
  194|  14.8k|        ld->bytes_left -= 4;
  195|  14.8k|    } else {
  196|    403|        tmp = getdword_n(&ld->start[words], ld->bytes_left);
  197|    403|        ld->bytes_left = 0;
  198|    403|    }
  199|  15.2k|    ld->bufa = tmp;
  200|       |
  201|  15.2k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (201:9): [True: 14.3k, False: 907]
  ------------------
  202|  14.3k|    {
  203|  14.3k|        tmp = getdword(&ld->start[words+1]);
  204|  14.3k|        ld->bytes_left -= 4;
  205|  14.3k|    } else {
  206|    907|        tmp = getdword_n(&ld->start[words+1], ld->bytes_left);
  207|    907|        ld->bytes_left = 0;
  208|    907|    }
  209|  15.2k|    ld->bufb = tmp;
  210|       |
  211|  15.2k|    ld->bits_left = 32 - remainder;
  212|  15.2k|    ld->tail = &ld->start[words+2];
  213|       |
  214|       |    /* recheck for reading too many bytes */
  215|  15.2k|    ld->error = 0;
  216|       |//    if (ld->bytes_left == 0)
  217|       |//        ld->no_more_reading = 1;
  218|       |//    if (ld->bytes_left < 0)
  219|       |//        ld->error = 1;
  220|  15.2k|}
faad_getbitbuffer:
  224|  2.23k|{
  225|  2.23k|    int i;
  226|  2.23k|    unsigned int temp;
  227|  2.23k|    int bytes = bits >> 3;
  228|  2.23k|    int remainder = bits & 0x7;
  229|       |
  230|  2.23k|    uint8_t *buffer = (uint8_t*)faad_malloc((bytes+1)*sizeof(uint8_t));
  231|       |
  232|  28.2k|    for (i = 0; i < bytes; i++)
  ------------------
  |  Branch (232:17): [True: 26.0k, False: 2.23k]
  ------------------
  233|  26.0k|    {
  234|  26.0k|        buffer[i] = (uint8_t)faad_getbits(ld, 8 DEBUGVAR(print,var,dbg));
  235|  26.0k|    }
  236|       |
  237|  2.23k|    if (remainder)
  ------------------
  |  Branch (237:9): [True: 827, False: 1.41k]
  ------------------
  238|    827|    {
  239|    827|        temp = faad_getbits(ld, remainder DEBUGVAR(print,var,dbg)) << (8-remainder);
  240|       |
  241|    827|        buffer[bytes] = (uint8_t)temp;
  242|    827|    }
  243|       |
  244|  2.23k|    return buffer;
  245|  2.23k|}
faad_origbitbuffer:
  250|    375|{
  251|    375|    return (void*)ld->start;
  252|    375|}
faad_origbitbuffer_size:
  256|    375|{
  257|    375|    return ld->buffer_size;
  258|    375|}
bits.c:getdword_n:
   39|   996k|{
   40|   996k|    uint8_t* m8 = (uint8_t*)mem;
   41|   996k|    switch (n)
   42|   996k|    {
   43|  4.25k|    case 3:
  ------------------
  |  Branch (43:5): [True: 4.25k, False: 992k]
  ------------------
   44|  4.25k|        return ((uint32_t)m8[2] << 8) | ((uint32_t)m8[1] << 16) | ((uint32_t)m8[0] << 24);
   45|  3.48k|    case 2:
  ------------------
  |  Branch (45:5): [True: 3.48k, False: 993k]
  ------------------
   46|  3.48k|        return ((uint32_t)m8[1] << 16) | ((uint32_t)m8[0] << 24);
   47|  7.53k|    case 1:
  ------------------
  |  Branch (47:5): [True: 7.53k, False: 989k]
  ------------------
   48|  7.53k|        return (uint32_t)m8[0] << 24;
   49|   981k|    default:
  ------------------
  |  Branch (49:5): [True: 981k, False: 15.2k]
  ------------------
   50|   981k|        return 0;
   51|   996k|    }
   52|   996k|}

decoder.c:faad_getbits:
  131|    691|{
  132|    691|    uint32_t ret;
  133|       |
  134|    691|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 691]
  ------------------
  135|      0|        return 0;
  136|       |
  137|    691|    ret = faad_showbits(ld, n);
  138|    691|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|    691|    return ret;
  146|    691|}
decoder.c:faad_showbits:
  103|    691|{
  104|    691|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 691, False: 0]
  ------------------
  105|    691|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|    691|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|    691|    }
  109|       |
  110|      0|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|      0|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|    691|}
decoder.c:faad_flushbits:
  116|    691|{
  117|       |    /* do nothing if error */
  118|    691|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 691]
  ------------------
  119|      0|        return;
  120|       |
  121|    691|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 691, False: 0]
  ------------------
  122|    691|    {
  123|    691|        ld->bits_left -= bits;
  124|    691|    } else {
  125|      0|        faad_flushbits_ex(ld, bits);
  126|      0|    }
  127|    691|}
bits.c:getdword:
   97|  5.15M|{
   98|  5.15M|    uint8_t* m8 = (uint8_t*)mem;
   99|  5.15M|    return (uint32_t)m8[3] | ((uint32_t)m8[2] << 8) | ((uint32_t)m8[1] << 16) | ((uint32_t)m8[0] << 24);
  100|  5.15M|}
bits.c:faad_flushbits:
  116|  36.8k|{
  117|       |    /* do nothing if error */
  118|  36.8k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 36.8k]
  ------------------
  119|      0|        return;
  120|       |
  121|  36.8k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 27.5k, False: 9.28k]
  ------------------
  122|  27.5k|    {
  123|  27.5k|        ld->bits_left -= bits;
  124|  27.5k|    } else {
  125|  9.28k|        faad_flushbits_ex(ld, bits);
  126|  9.28k|    }
  127|  36.8k|}
bits.c:faad_getbits:
  131|  26.8k|{
  132|  26.8k|    uint32_t ret;
  133|       |
  134|  26.8k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 26.8k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  26.8k|    ret = faad_showbits(ld, n);
  138|  26.8k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  26.8k|    return ret;
  146|  26.8k|}
bits.c:faad_showbits:
  103|  26.8k|{
  104|  26.8k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 21.9k, False: 4.91k]
  ------------------
  105|  21.9k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  21.9k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  21.9k|    }
  109|       |
  110|  4.91k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  4.91k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  26.8k|}
mp4.c:faad_getbits:
  131|  10.7k|{
  132|  10.7k|    uint32_t ret;
  133|       |
  134|  10.7k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 10.7k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  10.7k|    ret = faad_showbits(ld, n);
  138|  10.7k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  10.7k|    return ret;
  146|  10.7k|}
mp4.c:faad_showbits:
  103|  10.7k|{
  104|  10.7k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 9.55k, False: 1.20k]
  ------------------
  105|  9.55k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  9.55k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  9.55k|    }
  109|       |
  110|  1.20k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  1.20k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  10.7k|}
mp4.c:faad_flushbits:
  116|  10.7k|{
  117|       |    /* do nothing if error */
  118|  10.7k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 10.7k]
  ------------------
  119|      0|        return;
  120|       |
  121|  10.7k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 9.40k, False: 1.35k]
  ------------------
  122|  9.40k|    {
  123|  9.40k|        ld->bits_left -= bits;
  124|  9.40k|    } else {
  125|  1.35k|        faad_flushbits_ex(ld, bits);
  126|  1.35k|    }
  127|  10.7k|}
mp4.c:faad_get1bit:
  149|    104|{
  150|    104|    uint8_t r;
  151|       |
  152|    104|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 104, False: 0]
  ------------------
  153|    104|    {
  154|    104|        ld->bits_left--;
  155|    104|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|    104|        return r;
  157|    104|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|      0|    r = (uint8_t)faad_getbits(ld, 1);
  165|      0|#endif
  166|      0|    return r;
  167|    104|}
drm_dec.c:faad_get1bit:
  149|  1.76M|{
  150|  1.76M|    uint8_t r;
  151|       |
  152|  1.76M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 1.72M, False: 42.9k]
  ------------------
  153|  1.72M|    {
  154|  1.72M|        ld->bits_left--;
  155|  1.72M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  1.72M|        return r;
  157|  1.72M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  42.9k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  42.9k|#endif
  166|  42.9k|    return r;
  167|  1.76M|}
drm_dec.c:faad_getbits:
  131|  42.9k|{
  132|  42.9k|    uint32_t ret;
  133|       |
  134|  42.9k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 42.9k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  42.9k|    ret = faad_showbits(ld, n);
  138|  42.9k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  42.9k|    return ret;
  146|  42.9k|}
drm_dec.c:faad_showbits:
  103|  42.9k|{
  104|  42.9k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 0, False: 42.9k]
  ------------------
  105|      0|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|      0|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|      0|    }
  109|       |
  110|  42.9k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  42.9k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  42.9k|}
drm_dec.c:faad_flushbits:
  116|  42.9k|{
  117|       |    /* do nothing if error */
  118|  42.9k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 42.9k]
  ------------------
  119|      0|        return;
  120|       |
  121|  42.9k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 0, False: 42.9k]
  ------------------
  122|      0|    {
  123|      0|        ld->bits_left -= bits;
  124|  42.9k|    } else {
  125|  42.9k|        faad_flushbits_ex(ld, bits);
  126|  42.9k|    }
  127|  42.9k|}
syntax.c:faad_get1bit:
  149|  1.08M|{
  150|  1.08M|    uint8_t r;
  151|       |
  152|  1.08M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 1.07M, False: 9.13k]
  ------------------
  153|  1.07M|    {
  154|  1.07M|        ld->bits_left--;
  155|  1.07M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  1.07M|        return r;
  157|  1.07M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  9.13k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  9.13k|#endif
  166|  9.13k|    return r;
  167|  1.08M|}
syntax.c:faad_getbits:
  131|  23.1M|{
  132|  23.1M|    uint32_t ret;
  133|       |
  134|  23.1M|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 23.1M]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  23.1M|    ret = faad_showbits(ld, n);
  138|  23.1M|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  23.1M|    return ret;
  146|  23.1M|}
syntax.c:faad_showbits:
  103|  26.3M|{
  104|  26.3M|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 25.2M, False: 1.01M]
  ------------------
  105|  25.2M|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  25.2M|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  25.2M|    }
  109|       |
  110|  1.01M|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  1.01M|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  26.3M|}
syntax.c:faad_flushbits:
  116|  23.2M|{
  117|       |    /* do nothing if error */
  118|  23.2M|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 3, False: 23.2M]
  ------------------
  119|      3|        return;
  120|       |
  121|  23.2M|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 17.5M, False: 5.63M]
  ------------------
  122|  17.5M|    {
  123|  17.5M|        ld->bits_left -= bits;
  124|  17.5M|    } else {
  125|  5.63M|        faad_flushbits_ex(ld, bits);
  126|  5.63M|    }
  127|  23.2M|}
syntax.c:faad_check_CRC:
  287|    713|{
  288|    713|    int bytes, rem;
  289|    713|    unsigned int CRC;
  290|    713|    unsigned int r=255;  /* Initialize to all ones */
  291|       |
  292|       |    /* CRC polynome used x^8 + x^4 + x^3 + x^2 +1 */
  293|    713|#define GPOLY 0435
  294|       |
  295|    713|    faad_rewindbits(ld);
  296|       |
  297|    713|    CRC = (unsigned int) ~faad_getbits(ld, 8
  298|    713|        DEBUGVAR(1,999,"faad_check_CRC(): CRC")) & 0xFF;          /* CRC is stored inverted */
  299|       |
  300|    713|    bytes = len >> 3;
  301|    713|    rem = len & 0x7;
  302|       |
  303|  14.3k|    for (; bytes > 0; bytes--)
  ------------------
  |  Branch (303:12): [True: 13.6k, False: 713]
  ------------------
  304|  13.6k|    {
  305|  13.6k|        r = crc_table_G8[( r ^ faad_getbits(ld, 8 DEBUGVAR(1,998,"")) ) & 0xFF];
  306|  13.6k|    }
  307|  2.18k|    for (; rem > 0; rem--)
  ------------------
  |  Branch (307:12): [True: 1.47k, False: 713]
  ------------------
  308|  1.47k|    {
  309|  1.47k|        r = ( (r << 1) ^ (( ( faad_get1bit(ld
  310|  1.47k|            DEBUGVAR(1,998,""))  & 1) ^ ((r >> 7) & 1)) * GPOLY )) & 0xFF;
  ------------------
  |  |  293|  1.47k|#define GPOLY 0435
  ------------------
  311|  1.47k|    }
  312|       |
  313|    713|    if (r != CRC)
  ------------------
  |  Branch (313:9): [True: 170, False: 543]
  ------------------
  314|       |  //  if (0)
  315|    170|    {
  316|    170|        return 28;
  317|    543|    } else {
  318|    543|        return 0;
  319|    543|    }
  320|    713|}
syntax.c:reverse_byte:
  342|  5.09M|{
  343|  5.09M|    return tabFlipbits[b];
  344|  5.09M|}
sbr_syntax.c:faad_getbits:
  131|  1.31M|{
  132|  1.31M|    uint32_t ret;
  133|       |
  134|  1.31M|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 1.98k, False: 1.31M]
  ------------------
  135|  1.98k|        return 0;
  136|       |
  137|  1.31M|    ret = faad_showbits(ld, n);
  138|  1.31M|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  1.31M|    return ret;
  146|  1.31M|}
sbr_syntax.c:faad_showbits:
  103|  1.31M|{
  104|  1.31M|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 1.19M, False: 123k]
  ------------------
  105|  1.19M|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  1.19M|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  1.19M|    }
  109|       |
  110|   123k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|   123k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  1.31M|}
sbr_syntax.c:faad_flushbits:
  116|  1.31M|{
  117|       |    /* do nothing if error */
  118|  1.31M|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 34, False: 1.31M]
  ------------------
  119|     34|        return;
  120|       |
  121|  1.31M|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 1.15M, False: 158k]
  ------------------
  122|  1.15M|    {
  123|  1.15M|        ld->bits_left -= bits;
  124|  1.15M|    } else {
  125|   158k|        faad_flushbits_ex(ld, bits);
  126|   158k|    }
  127|  1.31M|}
sbr_syntax.c:faad_get1bit:
  149|   524k|{
  150|   524k|    uint8_t r;
  151|       |
  152|   524k|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 509k, False: 14.7k]
  ------------------
  153|   509k|    {
  154|   509k|        ld->bits_left--;
  155|   509k|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|   509k|        return r;
  157|   509k|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  14.7k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  14.7k|#endif
  166|  14.7k|    return r;
  167|   524k|}
sbr_huff.c:faad_getbits:
  131|   143k|{
  132|   143k|    uint32_t ret;
  133|       |
  134|   143k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 143k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|   143k|    ret = faad_showbits(ld, n);
  138|   143k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|   143k|    return ret;
  146|   143k|}
sbr_huff.c:faad_showbits:
  103|   143k|{
  104|   143k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 64.6k, False: 78.8k]
  ------------------
  105|  64.6k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  64.6k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  64.6k|    }
  109|       |
  110|  78.8k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  78.8k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|   143k|}
sbr_huff.c:faad_flushbits:
  116|   143k|{
  117|       |    /* do nothing if error */
  118|   143k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 34, False: 143k]
  ------------------
  119|     34|        return;
  120|       |
  121|   143k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 62.8k, False: 80.5k]
  ------------------
  122|  62.8k|    {
  123|  62.8k|        ld->bits_left -= bits;
  124|  80.5k|    } else {
  125|  80.5k|        faad_flushbits_ex(ld, bits);
  126|  80.5k|    }
  127|   143k|}
sbr_huff.c:faad_get1bit:
  149|  2.17M|{
  150|  2.17M|    uint8_t r;
  151|       |
  152|  2.17M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 2.10M, False: 65.4k]
  ------------------
  153|  2.10M|    {
  154|  2.10M|        ld->bits_left--;
  155|  2.10M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  2.10M|        return r;
  157|  2.10M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  65.4k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  65.4k|#endif
  166|  65.4k|    return r;
  167|  2.17M|}
ps_syntax.c:faad_get1bit:
  149|  1.87M|{
  150|  1.87M|    uint8_t r;
  151|       |
  152|  1.87M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 1.81M, False: 50.6k]
  ------------------
  153|  1.81M|    {
  154|  1.81M|        ld->bits_left--;
  155|  1.81M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  1.81M|        return r;
  157|  1.81M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  50.6k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  50.6k|#endif
  166|  50.6k|    return r;
  167|  1.87M|}
ps_syntax.c:faad_getbits:
  131|   474k|{
  132|   474k|    uint32_t ret;
  133|       |
  134|   474k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 4.16k, False: 469k]
  ------------------
  135|  4.16k|        return 0;
  136|       |
  137|   469k|    ret = faad_showbits(ld, n);
  138|   469k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|   469k|    return ret;
  146|   474k|}
ps_syntax.c:faad_showbits:
  103|   469k|{
  104|   469k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 394k, False: 75.0k]
  ------------------
  105|   394k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|   394k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|   394k|    }
  109|       |
  110|  75.0k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  75.0k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|   469k|}
ps_syntax.c:faad_flushbits:
  116|   469k|{
  117|       |    /* do nothing if error */
  118|   469k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 469k]
  ------------------
  119|      0|        return;
  120|       |
  121|   469k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 380k, False: 88.9k]
  ------------------
  122|   380k|    {
  123|   380k|        ld->bits_left -= bits;
  124|   380k|    } else {
  125|  88.9k|        faad_flushbits_ex(ld, bits);
  126|  88.9k|    }
  127|   469k|}
hcr.c:faad_getbits:
  131|  63.8k|{
  132|  63.8k|    uint32_t ret;
  133|       |
  134|  63.8k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 63.8k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  63.8k|    ret = faad_showbits(ld, n);
  138|  63.8k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  63.8k|    return ret;
  146|  63.8k|}
hcr.c:faad_showbits:
  103|  63.8k|{
  104|  63.8k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 39.8k, False: 24.0k]
  ------------------
  105|  39.8k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  39.8k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  39.8k|    }
  109|       |
  110|  24.0k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  24.0k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  63.8k|}
hcr.c:faad_flushbits:
  116|  63.8k|{
  117|       |    /* do nothing if error */
  118|  63.8k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 63.8k]
  ------------------
  119|      0|        return;
  120|       |
  121|  63.8k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 38.3k, False: 25.5k]
  ------------------
  122|  38.3k|    {
  123|  38.3k|        ld->bits_left -= bits;
  124|  38.3k|    } else {
  125|  25.5k|        faad_flushbits_ex(ld, bits);
  126|  25.5k|    }
  127|  63.8k|}
hcr.c:showbits_hcr:
  362|    448|{
  363|    448|    uint32_t mask;
  364|    448|    int8_t tail;
  365|    448|    if (bits == 0) return 0;
  ------------------
  |  Branch (365:9): [True: 50, False: 398]
  ------------------
  366|    398|    if (ld->len == 0) return 0;
  ------------------
  |  Branch (366:9): [True: 0, False: 398]
  ------------------
  367|    398|    tail = ld->len - bits;
  368|    398|    mask = 0xFFFFFFFF >> (32 - bits);
  369|    398|    if (ld->len <= 32)
  ------------------
  |  Branch (369:9): [True: 246, False: 152]
  ------------------
  370|    246|    {
  371|       |        /* huffman_spectral_data_2 might request more than available (tail < 0),
  372|       |           pad with zeroes then. */
  373|    246|        if (tail >= 0)
  ------------------
  |  Branch (373:13): [True: 246, False: 0]
  ------------------
  374|    246|            return (ld->bufa >> tail) & mask; /* tail is 0..31 */
  375|      0|        else
  376|      0|            return (ld->bufa << -tail) & mask; /* -tail is 1..31 */
  377|    246|    } else {
  378|       |        /* tail is 1..63 */
  379|    152|        if (tail < 32)
  ------------------
  |  Branch (379:13): [True: 76, False: 76]
  ------------------
  380|     76|            return ((ld->bufb << (32 - tail)) | (ld->bufa >> tail)) & mask;
  381|     76|        else
  382|     76|            return (ld->bufb >> (tail - 32)) & mask;
  383|    152|    }
  384|    398|}
hcr.c:flushbits_hcr:
  388|    420|{
  389|    420|    ld->len -= bits;
  390|       |
  391|    420|    if (ld->len <0)
  ------------------
  |  Branch (391:9): [True: 0, False: 420]
  ------------------
  392|      0|    {
  393|      0|        ld->len = 0;
  394|      0|        return 1;
  395|    420|    } else {
  396|    420|        return 0;
  397|    420|    }
  398|    420|}
huffman.c:faad_get1bit:
  149|   404k|{
  150|   404k|    uint8_t r;
  151|       |
  152|   404k|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 391k, False: 12.3k]
  ------------------
  153|   391k|    {
  154|   391k|        ld->bits_left--;
  155|   391k|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|   391k|        return r;
  157|   391k|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  12.3k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  12.3k|#endif
  166|  12.3k|    return r;
  167|   404k|}
huffman.c:faad_getbits:
  131|  21.4k|{
  132|  21.4k|    uint32_t ret;
  133|       |
  134|  21.4k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 21.4k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  21.4k|    ret = faad_showbits(ld, n);
  138|  21.4k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  21.4k|    return ret;
  146|  21.4k|}
huffman.c:faad_showbits:
  103|   226k|{
  104|   226k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 185k, False: 40.9k]
  ------------------
  105|   185k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|   185k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|   185k|    }
  109|       |
  110|  40.9k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  40.9k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|   226k|}
huffman.c:faad_flushbits:
  116|   226k|{
  117|       |    /* do nothing if error */
  118|   226k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 226k]
  ------------------
  119|      0|        return;
  120|       |
  121|   226k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 187k, False: 38.8k]
  ------------------
  122|   187k|    {
  123|   187k|        ld->bits_left -= bits;
  124|   187k|    } else {
  125|  38.8k|        faad_flushbits_ex(ld, bits);
  126|  38.8k|    }
  127|   226k|}
huffman.c:showbits_hcr:
  362|   175k|{
  363|   175k|    uint32_t mask;
  364|   175k|    int8_t tail;
  365|   175k|    if (bits == 0) return 0;
  ------------------
  |  Branch (365:9): [True: 0, False: 175k]
  ------------------
  366|   175k|    if (ld->len == 0) return 0;
  ------------------
  |  Branch (366:9): [True: 8.79k, False: 166k]
  ------------------
  367|   166k|    tail = ld->len - bits;
  368|   166k|    mask = 0xFFFFFFFF >> (32 - bits);
  369|   166k|    if (ld->len <= 32)
  ------------------
  |  Branch (369:9): [True: 138k, False: 28.3k]
  ------------------
  370|   138k|    {
  371|       |        /* huffman_spectral_data_2 might request more than available (tail < 0),
  372|       |           pad with zeroes then. */
  373|   138k|        if (tail >= 0)
  ------------------
  |  Branch (373:13): [True: 117k, False: 20.9k]
  ------------------
  374|   117k|            return (ld->bufa >> tail) & mask; /* tail is 0..31 */
  375|  20.9k|        else
  376|  20.9k|            return (ld->bufa << -tail) & mask; /* -tail is 1..31 */
  377|   138k|    } else {
  378|       |        /* tail is 1..63 */
  379|  28.3k|        if (tail < 32)
  ------------------
  |  Branch (379:13): [True: 4.17k, False: 24.1k]
  ------------------
  380|  4.17k|            return ((ld->bufb << (32 - tail)) | (ld->bufa >> tail)) & mask;
  381|  24.1k|        else
  382|  24.1k|            return (ld->bufb >> (tail - 32)) & mask;
  383|  28.3k|    }
  384|   166k|}
huffman.c:flushbits_hcr:
  388|   175k|{
  389|   175k|    ld->len -= bits;
  390|       |
  391|   175k|    if (ld->len <0)
  ------------------
  |  Branch (391:9): [True: 19.2k, False: 156k]
  ------------------
  392|  19.2k|    {
  393|  19.2k|        ld->len = 0;
  394|  19.2k|        return 1;
  395|   156k|    } else {
  396|   156k|        return 0;
  397|   156k|    }
  398|   175k|}
huffman.c:get1bit_hcr:
  407|  79.2k|{
  408|  79.2k|    uint32_t res;
  409|  79.2k|    int8_t ret;
  410|       |
  411|  79.2k|    ret = getbits_hcr(ld, 1, &res);
  412|  79.2k|    *result = (int8_t)(res & 1);
  413|  79.2k|    return ret;
  414|  79.2k|}
huffman.c:getbits_hcr:
  401|  85.5k|{
  402|  85.5k|    *result = showbits_hcr(ld, n);
  403|  85.5k|    return flushbits_hcr(ld, n);
  404|  85.5k|}
rvlc.c:faad_get1bit:
  149|  11.5k|{
  150|  11.5k|    uint8_t r;
  151|       |
  152|  11.5k|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 11.3k, False: 163]
  ------------------
  153|  11.3k|    {
  154|  11.3k|        ld->bits_left--;
  155|  11.3k|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  11.3k|        return r;
  157|  11.3k|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|    163|    r = (uint8_t)faad_getbits(ld, 1);
  165|    163|#endif
  166|    163|    return r;
  167|  11.5k|}
rvlc.c:faad_getbits:
  131|  45.1k|{
  132|  45.1k|    uint32_t ret;
  133|       |
  134|  45.1k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 15.6k, False: 29.4k]
  ------------------
  135|  15.6k|        return 0;
  136|       |
  137|  29.4k|    ret = faad_showbits(ld, n);
  138|  29.4k|    faad_flushbits(ld, n);
  139|       |
  140|       |#ifdef ANALYSIS
  141|       |    if (print)
  142|       |        fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
  143|       |#endif
  144|       |
  145|  29.4k|    return ret;
  146|  45.1k|}
rvlc.c:faad_showbits:
  103|  29.4k|{
  104|  29.4k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 26.0k, False: 3.38k]
  ------------------
  105|  26.0k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  26.0k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  26.0k|    }
  109|       |
  110|  3.38k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  3.38k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  29.4k|}
rvlc.c:faad_flushbits:
  116|  29.4k|{
  117|       |    /* do nothing if error */
  118|  29.4k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 29.4k]
  ------------------
  119|      0|        return;
  120|       |
  121|  29.4k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 25.4k, False: 4.01k]
  ------------------
  122|  25.4k|    {
  123|  25.4k|        ld->bits_left -= bits;
  124|  25.4k|    } else {
  125|  4.01k|        faad_flushbits_ex(ld, bits);
  126|  4.01k|    }
  127|  29.4k|}

cfftb:
  902|   208k|{
  903|   208k|    cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
  904|   208k|}
cffti:
 1006|  13.2k|{
 1007|  13.2k|    cfft_info *cfft = (cfft_info*)faad_malloc(sizeof(cfft_info));
 1008|       |
 1009|  13.2k|    cfft->n = n;
 1010|  13.2k|    cfft->work = (complex_t*)faad_malloc(n*sizeof(complex_t));
 1011|       |
 1012|  13.2k|#ifndef FIXED_POINT
 1013|  13.2k|    cfft->tab = (complex_t*)faad_malloc(n*sizeof(complex_t));
 1014|       |
 1015|  13.2k|    cffti1(n, cfft->tab, cfft->ifac);
 1016|       |#else
 1017|       |    cffti1(n, NULL, cfft->ifac);
 1018|       |
 1019|       |    switch (n)
 1020|       |    {
 1021|       |    case 64: cfft->tab = (complex_t*)cfft_tab_64; break;
 1022|       |    case 512: cfft->tab = (complex_t*)cfft_tab_512; break;
 1023|       |#ifdef LD_DEC
 1024|       |    case 256: cfft->tab = (complex_t*)cfft_tab_256; break;
 1025|       |#endif
 1026|       |
 1027|       |#ifdef ALLOW_SMALL_FRAMELENGTH
 1028|       |    case 60: cfft->tab = (complex_t*)cfft_tab_60; break;
 1029|       |    case 480: cfft->tab = (complex_t*)cfft_tab_480; break;
 1030|       |#ifdef LD_DEC
 1031|       |    case 240: cfft->tab = (complex_t*)cfft_tab_240; break;
 1032|       |#endif
 1033|       |#endif
 1034|       |    case 128: cfft->tab = (complex_t*)cfft_tab_128; break;
 1035|       |    }
 1036|       |#endif
 1037|       |
 1038|  13.2k|    return cfft;
 1039|  13.2k|}
cfftu:
 1042|  13.2k|{
 1043|  13.2k|    if (cfft->work) faad_free(cfft->work);
  ------------------
  |  Branch (1043:9): [True: 13.2k, False: 0]
  ------------------
 1044|  13.2k|#ifndef FIXED_POINT
 1045|  13.2k|    if (cfft->tab) faad_free(cfft->tab);
  ------------------
  |  Branch (1045:9): [True: 13.2k, False: 0]
  ------------------
 1046|  13.2k|#endif
 1047|       |
 1048|  13.2k|    if (cfft) faad_free(cfft);
  ------------------
  |  Branch (1048:9): [True: 13.2k, False: 0]
  ------------------
 1049|  13.2k|}
cfft.c:passf3:
  184|  51.9k|{
  185|  51.9k|    static real_t taur = FRAC_CONST(-0.5);
  ------------------
  |  |  291|  51.9k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  186|  51.9k|    static real_t taui = FRAC_CONST(0.866025403784439);
  ------------------
  |  |  291|  51.9k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  187|  51.9k|    uint16_t i, k, ac, ah;
  188|  51.9k|    complex_t c2, c3, d2, d3, t2;
  189|       |
  190|  51.9k|    if (ido == 1)
  ------------------
  |  Branch (190:9): [True: 0, False: 51.9k]
  ------------------
  191|      0|    {
  192|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  193|       |        // TODO: remove this code once fuzzer proves it is totally unreahable
  194|       |        // 3 is never the the biggest factor for supported frame lengths;
  195|       |        // consequently `ido` should never be 1.
  196|      0|        __builtin_trap();
  197|       |        /*
  198|       |#endif
  199|       |        if (isign == 1)
  200|       |        {
  201|       |            for (k = 0; k < l1; k++)
  202|       |            {
  203|       |                ac = 3*k+1;
  204|       |                ah = k;
  205|       |
  206|       |                RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
  207|       |                IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
  208|       |                RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
  209|       |                IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
  210|       |
  211|       |                RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
  212|       |                IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
  213|       |
  214|       |                RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
  215|       |                IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
  216|       |
  217|       |                RE(ch[ah+l1]) = RE(c2) - IM(c3);
  218|       |                IM(ch[ah+l1]) = IM(c2) + RE(c3);
  219|       |                RE(ch[ah+2*l1]) = RE(c2) + IM(c3);
  220|       |                IM(ch[ah+2*l1]) = IM(c2) - RE(c3);
  221|       |            }
  222|       |        } else {
  223|       |            for (k = 0; k < l1; k++)
  224|       |            {
  225|       |                ac = 3*k+1;
  226|       |                ah = k;
  227|       |
  228|       |                RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
  229|       |                IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
  230|       |                RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
  231|       |                IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
  232|       |
  233|       |                RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
  234|       |                IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
  235|       |
  236|       |                RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
  237|       |                IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
  238|       |
  239|       |                RE(ch[ah+l1]) = RE(c2) + IM(c3);
  240|       |                IM(ch[ah+l1]) = IM(c2) - RE(c3);
  241|       |                RE(ch[ah+2*l1]) = RE(c2) - IM(c3);
  242|       |                IM(ch[ah+2*l1]) = IM(c2) + RE(c3);
  243|       |            }
  244|       |        }
  245|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  246|       |        */
  247|      0|#endif
  248|  51.9k|    } else {
  249|  51.9k|        if (isign == 1)
  ------------------
  |  Branch (249:13): [True: 51.9k, False: 0]
  ------------------
  250|  51.9k|        {
  251|   124k|            for (k = 0; k < l1; k++)
  ------------------
  |  Branch (251:25): [True: 72.3k, False: 51.9k]
  ------------------
  252|  72.3k|            {
  253|  3.97M|                for (i = 0; i < ido; i++)
  ------------------
  |  Branch (253:29): [True: 3.90M, False: 72.3k]
  ------------------
  254|  3.90M|                {
  255|  3.90M|                    ac = i + (3*k+1)*ido;
  256|  3.90M|                    ah = i + k * ido;
  257|       |
  258|  3.90M|                    RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
  259|  3.90M|                    RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  286|  3.90M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  260|  3.90M|                    IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
  261|  3.90M|                    IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  286|  3.90M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  262|       |
  263|  3.90M|                    RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
  264|  3.90M|                    IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
  265|       |
  266|  3.90M|                    RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
  ------------------
  |  |  286|  3.90M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  267|  3.90M|                    IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
  ------------------
  |  |  286|  3.90M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  268|       |
  269|  3.90M|                    RE(d2) = RE(c2) - IM(c3);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(d2) = RE(c2) - IM(c3);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(d2) = RE(c2) - IM(c3);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
  270|  3.90M|                    IM(d3) = IM(c2) - RE(c3);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(d3) = IM(c2) - RE(c3);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(d3) = IM(c2) - RE(c3);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
  271|  3.90M|                    RE(d3) = RE(c2) + IM(c3);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(d3) = RE(c2) + IM(c3);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                  RE(d3) = RE(c2) + IM(c3);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
  272|  3.90M|                    IM(d2) = IM(c2) + RE(c3);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(d2) = IM(c2) + RE(c3);
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  IM(d2) = IM(c2) + RE(c3);
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
  273|       |
  274|  3.90M|#if 1
  275|  3.90M|                    ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
  276|  3.90M|                        IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                      IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                      IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                      IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
  277|  3.90M|                    ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
  278|  3.90M|                        IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
                                      IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                      IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  3.90M|#define RE(A) (A)[0]
  ------------------
                                      IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  3.90M|#define IM(A) (A)[1]
  ------------------
  279|       |#else
  280|       |                    ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
  281|       |                        RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  282|       |                    ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
  283|       |                        RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  284|       |#endif
  285|  3.90M|                }
  286|  72.3k|            }
  287|  51.9k|        } else {
  288|      0|            for (k = 0; k < l1; k++)
  ------------------
  |  Branch (288:25): [True: 0, False: 0]
  ------------------
  289|      0|            {
  290|      0|                for (i = 0; i < ido; i++)
  ------------------
  |  Branch (290:29): [True: 0, False: 0]
  ------------------
  291|      0|                {
  292|      0|                    ac = i + (3*k+1)*ido;
  293|      0|                    ah = i + k * ido;
  294|       |
  295|      0|                    RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  296|      0|                    RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  297|      0|                    IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  298|      0|                    IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  299|       |
  300|      0|                    RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  301|      0|                    IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  302|       |
  303|      0|                    RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  304|      0|                    IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  305|       |
  306|      0|                    RE(d2) = RE(c2) + IM(c3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(d2) = RE(c2) + IM(c3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(d2) = RE(c2) + IM(c3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  307|      0|                    IM(d3) = IM(c2) + RE(c3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(d3) = IM(c2) + RE(c3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(d3) = IM(c2) + RE(c3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  308|      0|                    RE(d3) = RE(c2) - IM(c3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(d3) = RE(c2) - IM(c3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  RE(d3) = RE(c2) - IM(c3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  309|      0|                    IM(d2) = IM(c2) - RE(c3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(d2) = IM(c2) - RE(c3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  IM(d2) = IM(c2) - RE(c3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  310|       |
  311|      0|#if 1
  312|      0|                    ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  313|      0|                        RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                      RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                      RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                      RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  314|      0|                    ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  315|      0|                        RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                      RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                      RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                      RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  316|       |#else
  317|       |                    ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  318|       |                        IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  319|       |                    ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  320|       |                        IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  321|       |#endif
  322|      0|                }
  323|      0|            }
  324|      0|        }
  325|  51.9k|    }
  326|  51.9k|}
cfft.c:passf5:
  506|  51.9k|{
  507|  51.9k|    static real_t tr11 = FRAC_CONST(0.309016994374947);
  ------------------
  |  |  291|  51.9k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  508|  51.9k|    static real_t ti11 = FRAC_CONST(0.951056516295154);
  ------------------
  |  |  291|  51.9k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  509|  51.9k|    static real_t tr12 = FRAC_CONST(-0.809016994374947);
  ------------------
  |  |  291|  51.9k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  510|  51.9k|    static real_t ti12 = FRAC_CONST(0.587785252292473);
  ------------------
  |  |  291|  51.9k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  511|  51.9k|    uint16_t k, ac, ah;
  512|  51.9k|    complex_t c2, c3, c4, c5, t2, t3, t4, t5;
  513|  51.9k|    (void)wa1;
  514|  51.9k|    (void)wa2;
  515|  51.9k|    (void)wa3;
  516|  51.9k|    (void)wa4;
  517|       |
  518|  51.9k|    if (ido == 1)
  ------------------
  |  Branch (518:9): [True: 51.9k, False: 0]
  ------------------
  519|  51.9k|    {
  520|  51.9k|        if (isign == 1)
  ------------------
  |  Branch (520:13): [True: 51.9k, False: 0]
  ------------------
  521|  51.9k|        {
  522|  2.39M|            for (k = 0; k < l1; k++)
  ------------------
  |  Branch (522:25): [True: 2.34M, False: 51.9k]
  ------------------
  523|  2.34M|            {
  524|  2.34M|                ac = 5*k + 1;
  525|  2.34M|                ah = k;
  526|       |
  527|  2.34M|                RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  528|  2.34M|                IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  529|  2.34M|                RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  530|  2.34M|                IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  531|  2.34M|                RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  532|  2.34M|                IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  533|  2.34M|                RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  534|  2.34M|                IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  535|       |
  536|  2.34M|                RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  537|  2.34M|                IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  538|       |
  539|  2.34M|                RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  540|  2.34M|                IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  541|  2.34M|                RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  542|  2.34M|                IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  286|  2.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  543|       |
  544|  2.34M|                ComplexMult(&RE(c5), &RE(c4),
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(c5), &RE(c4),
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  545|  2.34M|                    ti11, ti12, RE(t5), RE(t4));
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                                  ti11, ti12, RE(t5), RE(t4));
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  546|  2.34M|                ComplexMult(&IM(c5), &IM(c4),
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(c5), &IM(c4),
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  547|  2.34M|                    ti11, ti12, IM(t5), IM(t4));
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                                  ti11, ti12, IM(t5), IM(t4));
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  548|       |
  549|  2.34M|                RE(ch[ah+l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  550|  2.34M|                IM(ch[ah+l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  551|  2.34M|                RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  552|  2.34M|                IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  553|  2.34M|                RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  554|  2.34M|                IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  555|  2.34M|                RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
  556|  2.34M|                IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  392|  2.34M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  391|  2.34M|#define RE(A) (A)[0]
  ------------------
  557|  2.34M|            }
  558|  51.9k|        } else {
  559|      0|            for (k = 0; k < l1; k++)
  ------------------
  |  Branch (559:25): [True: 0, False: 0]
  ------------------
  560|      0|            {
  561|      0|                ac = 5*k + 1;
  562|      0|                ah = k;
  563|       |
  564|      0|                RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  565|      0|                IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  566|      0|                RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  567|      0|                IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  568|      0|                RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  569|      0|                IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  570|      0|                RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  571|      0|                IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  572|       |
  573|      0|                RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  574|      0|                IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  575|       |
  576|      0|                RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  577|      0|                IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  578|      0|                RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  579|      0|                IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  286|      0|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  580|       |
  581|      0|                ComplexMult(&RE(c4), &RE(c5),
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(c4), &RE(c5),
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  582|      0|                    ti12, ti11, RE(t5), RE(t4));
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                                  ti12, ti11, RE(t5), RE(t4));
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  583|      0|                ComplexMult(&IM(c4), &IM(c5),
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(c4), &IM(c5),
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  584|      0|                    ti12, ti11, IM(t5), IM(t4));
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                                  ti12, ti11, IM(t5), IM(t4));
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  585|       |
  586|      0|                RE(ch[ah+l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  587|      0|                IM(ch[ah+l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  588|      0|                RE(ch[ah+2*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+2*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+2*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  589|      0|                IM(ch[ah+2*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+2*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+2*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  590|      0|                RE(ch[ah+3*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+3*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+3*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  591|      0|                IM(ch[ah+3*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+3*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+3*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  592|      0|                RE(ch[ah+4*l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+4*l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+4*l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  593|      0|                IM(ch[ah+4*l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+4*l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+4*l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  594|      0|            }
  595|      0|        }
  596|  51.9k|    } else {
  597|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  598|       |        // TODO: remove this code once fuzzer proves it is totally unreahable
  599|       |        // 5 if the biggest factor and it never repeated for supported frame
  600|       |        // lengths; consequently `ido` should always be 1.
  601|      0|        __builtin_trap();
  602|       |        /*
  603|       |#else
  604|       |        uint16_t i;
  605|       |        complex_t d3, d4, d5, d2;
  606|       |#endif
  607|       |        if (isign == 1)
  608|       |        {
  609|       |            for (k = 0; k < l1; k++)
  610|       |            {
  611|       |                for (i = 0; i < ido; i++)
  612|       |                {
  613|       |                    ac = i + (k*5 + 1) * ido;
  614|       |                    ah = i + k * ido;
  615|       |
  616|       |                    RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
  617|       |                    IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
  618|       |                    RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
  619|       |                    IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
  620|       |                    RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
  621|       |                    IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
  622|       |                    RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
  623|       |                    IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
  624|       |
  625|       |                    RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
  626|       |                    IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
  627|       |
  628|       |                    RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  629|       |                    IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  630|       |                    RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  631|       |                    IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  632|       |
  633|       |                    ComplexMult(&RE(c5), &RE(c4),
  634|       |                        ti11, ti12, RE(t5), RE(t4));
  635|       |                    ComplexMult(&IM(c5), &IM(c4),
  636|       |                        ti11, ti12, IM(t5), IM(t4));
  637|       |
  638|       |                    IM(d2) = IM(c2) + RE(c5);
  639|       |                    IM(d3) = IM(c3) + RE(c4);
  640|       |                    RE(d4) = RE(c3) + IM(c4);
  641|       |                    RE(d5) = RE(c2) + IM(c5);
  642|       |                    RE(d2) = RE(c2) - IM(c5);
  643|       |                    IM(d5) = IM(c2) - RE(c5);
  644|       |                    RE(d3) = RE(c3) - IM(c4);
  645|       |                    IM(d4) = IM(c3) - RE(c4);
  646|       |
  647|       |#if 1
  648|       |                    ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  649|       |                        IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  650|       |                    ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  651|       |                        IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  652|       |                    ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
  653|       |                        IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
  654|       |                    ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
  655|       |                        IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
  656|       |#else
  657|       |                    ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
  658|       |                        RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  659|       |                    ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
  660|       |                        RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  661|       |                    ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
  662|       |                        RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
  663|       |                    ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
  664|       |                        RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
  665|       |#endif
  666|       |                }
  667|       |            }
  668|       |        } else {
  669|       |            for (k = 0; k < l1; k++)
  670|       |            {
  671|       |                for (i = 0; i < ido; i++)
  672|       |                {
  673|       |                    ac = i + (k*5 + 1) * ido;
  674|       |                    ah = i + k * ido;
  675|       |
  676|       |                    RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
  677|       |                    IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
  678|       |                    RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
  679|       |                    IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
  680|       |                    RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
  681|       |                    IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
  682|       |                    RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
  683|       |                    IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
  684|       |
  685|       |                    RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
  686|       |                    IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
  687|       |
  688|       |                    RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  689|       |                    IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  690|       |                    RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  691|       |                    IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  692|       |
  693|       |                    ComplexMult(&RE(c4), &RE(c5),
  694|       |                        ti12, ti11, RE(t5), RE(t4));
  695|       |                    ComplexMult(&IM(c4), &IM(c5),
  696|       |                        ti12, ti11, IM(t5), IM(t4));
  697|       |
  698|       |                    IM(d2) = IM(c2) - RE(c5);
  699|       |                    IM(d3) = IM(c3) - RE(c4);
  700|       |                    RE(d4) = RE(c3) - IM(c4);
  701|       |                    RE(d5) = RE(c2) - IM(c5);
  702|       |                    RE(d2) = RE(c2) + IM(c5);
  703|       |                    IM(d5) = IM(c2) + RE(c5);
  704|       |                    RE(d3) = RE(c3) + IM(c4);
  705|       |                    IM(d4) = IM(c3) + RE(c4);
  706|       |
  707|       |#if 1
  708|       |                    ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
  709|       |                        RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
  710|       |                    ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
  711|       |                        RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
  712|       |                    ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
  713|       |                        RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
  714|       |                    ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
  715|       |                        RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
  716|       |#else
  717|       |                    ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  718|       |                        IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  719|       |                    ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  720|       |                        IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  721|       |                    ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
  722|       |                        IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
  723|       |                    ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
  724|       |                        IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
  725|       |#endif
  726|       |                }
  727|       |            }
  728|       |        }
  729|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  730|       |        */
  731|      0|#endif
  732|      0|    }
  733|  51.9k|}
cfft.c:cfftf1pos:
  743|   208k|{
  744|   208k|    uint16_t i;
  745|   208k|    uint16_t k1, l1, l2;
  746|   208k|    uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido;
  747|       |
  748|   208k|    nf = ifac[1];
  749|   208k|    na = 0;
  750|   208k|    l1 = 1;
  751|   208k|    iw = 0;
  752|       |
  753|  1.02M|    for (k1 = 2; k1 <= nf+1; k1++)
  ------------------
  |  Branch (753:18): [True: 818k, False: 208k]
  ------------------
  754|   818k|    {
  755|   818k|        ip = ifac[k1];
  756|   818k|        l2 = ip*l1;
  757|   818k|        ido = n / l2;
  758|       |
  759|   818k|        switch (ip)
  ------------------
  |  Branch (759:17): [True: 818k, False: 0]
  ------------------
  760|   818k|        {
  761|   617k|        case 4:
  ------------------
  |  Branch (761:9): [True: 617k, False: 201k]
  ------------------
  762|   617k|            ix2 = iw + ido;
  763|   617k|            ix3 = ix2 + ido;
  764|       |
  765|   617k|            if (na == 0)
  ------------------
  |  Branch (765:17): [True: 332k, False: 284k]
  ------------------
  766|   332k|                passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
  767|   284k|            else
  768|   284k|                passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
  769|       |
  770|   617k|            na = 1 - na;
  771|   617k|            break;
  772|  97.1k|        case 2:
  ------------------
  |  Branch (772:9): [True: 97.1k, False: 721k]
  ------------------
  773|  97.1k|            if (na == 0)
  ------------------
  |  Branch (773:17): [True: 97.1k, False: 0]
  ------------------
  774|  97.1k|                passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
  775|      0|            else
  776|      0|                passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
  777|       |
  778|  97.1k|            na = 1 - na;
  779|  97.1k|            break;
  780|  51.9k|        case 3:
  ------------------
  |  Branch (780:9): [True: 51.9k, False: 766k]
  ------------------
  781|  51.9k|            ix2 = iw + ido;
  782|       |
  783|  51.9k|            if (na == 0)
  ------------------
  |  Branch (783:17): [True: 31.4k, False: 20.4k]
  ------------------
  784|  31.4k|                passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
  785|  20.4k|            else
  786|  20.4k|                passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
  787|       |
  788|  51.9k|            na = 1 - na;
  789|  51.9k|            break;
  790|  51.9k|        case 5:
  ------------------
  |  Branch (790:9): [True: 51.9k, False: 766k]
  ------------------
  791|  51.9k|            ix2 = iw + ido;
  792|  51.9k|            ix3 = ix2 + ido;
  793|  51.9k|            ix4 = ix3 + ido;
  794|       |
  795|  51.9k|            if (na == 0)
  ------------------
  |  Branch (795:17): [True: 51.9k, False: 0]
  ------------------
  796|  51.9k|                passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
  797|      0|            else
  798|      0|                passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
  799|       |
  800|  51.9k|            na = 1 - na;
  801|  51.9k|            break;
  802|   818k|        }
  803|       |
  804|   818k|        l1 = l2;
  805|   818k|        iw += (ip-1) * ido;
  806|   818k|    }
  807|       |
  808|   208k|    if (na == 0)
  ------------------
  |  Branch (808:9): [True: 0, False: 208k]
  ------------------
  809|      0|        return;
  810|       |
  811|  56.2M|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (811:17): [True: 56.0M, False: 208k]
  ------------------
  812|  56.0M|    {
  813|  56.0M|        RE(c[i]) = RE(ch[i]);
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
                      RE(c[i]) = RE(ch[i]);
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
  814|  56.0M|        IM(c[i]) = IM(ch[i]);
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
                      IM(c[i]) = IM(ch[i]);
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
  815|  56.0M|    }
  816|   208k|}
cfft.c:passf4pos:
  332|   617k|{
  333|   617k|    uint16_t i, k, ac, ah;
  334|       |
  335|   617k|    if (ido == 1)
  ------------------
  |  Branch (335:9): [True: 156k, False: 461k]
  ------------------
  336|   156k|    {
  337|  11.2M|        for (k = 0; k < l1; k++)
  ------------------
  |  Branch (337:21): [True: 11.0M, False: 156k]
  ------------------
  338|  11.0M|        {
  339|  11.0M|            complex_t t1, t2, t3, t4;
  340|       |
  341|  11.0M|            ac = 4*k;
  342|  11.0M|            ah = k;
  343|       |
  344|  11.0M|            RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  345|  11.0M|            RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  346|  11.0M|            IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  347|  11.0M|            IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  348|  11.0M|            RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  349|  11.0M|            IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  350|  11.0M|            IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  351|  11.0M|            RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  352|       |
  353|  11.0M|            RE(ch[ah])      = RE(t2) + RE(t3);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah])      = RE(t2) + RE(t3);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah])      = RE(t2) + RE(t3);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  354|  11.0M|            RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  355|       |
  356|  11.0M|            IM(ch[ah])      = IM(t2) + IM(t3);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah])      = IM(t2) + IM(t3);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah])      = IM(t2) + IM(t3);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  357|  11.0M|            IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  358|       |
  359|  11.0M|            RE(ch[ah+l1])   = RE(t1) + RE(t4);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+l1])   = RE(t1) + RE(t4);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+l1])   = RE(t1) + RE(t4);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  360|  11.0M|            RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  11.0M|#define RE(A) (A)[0]
  ------------------
  361|       |
  362|  11.0M|            IM(ch[ah+l1])   = IM(t1) + IM(t4);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+l1])   = IM(t1) + IM(t4);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+l1])   = IM(t1) + IM(t4);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  363|  11.0M|            IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  11.0M|#define IM(A) (A)[1]
  ------------------
  364|  11.0M|        }
  365|   461k|    } else {
  366|  4.78M|        for (k = 0; k < l1; k++)
  ------------------
  |  Branch (366:21): [True: 4.32M, False: 461k]
  ------------------
  367|  4.32M|        {
  368|  4.32M|            ac = 4*k*ido;
  369|  4.32M|            ah = k*ido;
  370|       |
  371|  41.7M|            for (i = 0; i < ido; i++)
  ------------------
  |  Branch (371:25): [True: 37.3M, False: 4.32M]
  ------------------
  372|  37.3M|            {
  373|  37.3M|                complex_t c2, c3, c4, t1, t2, t3, t4;
  374|       |
  375|  37.3M|                RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  376|  37.3M|                RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  377|  37.3M|                IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  378|  37.3M|                IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  379|  37.3M|                RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  380|  37.3M|                IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  381|  37.3M|                IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  382|  37.3M|                RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  383|       |
  384|  37.3M|                RE(c2) = RE(t1) + RE(t4);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(t1) + RE(t4);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(t1) + RE(t4);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  385|  37.3M|                RE(c4) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c4) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c4) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  386|       |
  387|  37.3M|                IM(c2) = IM(t1) + IM(t4);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(t1) + IM(t4);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(t1) + IM(t4);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  388|  37.3M|                IM(c4) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c4) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c4) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  389|       |
  390|  37.3M|                RE(ch[ah+i]) = RE(t2) + RE(t3);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(t2) + RE(t3);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(t2) + RE(t3);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  391|  37.3M|                RE(c3)       = RE(t2) - RE(t3);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c3)       = RE(t2) - RE(t3);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c3)       = RE(t2) - RE(t3);
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  392|       |
  393|  37.3M|                IM(ch[ah+i]) = IM(t2) + IM(t3);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(t2) + IM(t3);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(t2) + IM(t3);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  394|  37.3M|                IM(c3)       = IM(t2) - IM(t3);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c3)       = IM(t2) - IM(t3);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c3)       = IM(t2) - IM(t3);
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  395|       |
  396|  37.3M|#if 1
  397|  37.3M|                ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  398|  37.3M|                    IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                                  IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  399|  37.3M|                ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  400|  37.3M|                    IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                                  IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  401|  37.3M|                ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
  402|  37.3M|                    IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
                                  IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  391|  37.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  392|  37.3M|#define IM(A) (A)[1]
  ------------------
  403|       |#else
  404|       |                ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
  405|       |                    RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
  406|       |                ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
  407|       |                    RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
  408|       |                ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
  409|       |                    RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
  410|       |#endif
  411|  37.3M|            }
  412|  4.32M|        }
  413|   461k|    }
  414|   617k|}
cfft.c:passf2pos:
   72|  97.1k|{
   73|  97.1k|    uint16_t i, k, ah, ac;
   74|       |
   75|  97.1k|    if (ido == 1)
  ------------------
  |  Branch (75:9): [True: 0, False: 97.1k]
  ------------------
   76|      0|    {
   77|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   78|       |        // TODO: remove this code once fuzzer proves it is totally unreahable
   79|       |        // For supported frame lengths that have odd number of factor 2 it is
   80|       |        // never the last factor; consequently `ido` should never be 1.
   81|      0|        __builtin_trap();
   82|       |        /*
   83|       |#endif
   84|       |        for (k = 0; k < l1; k++)
   85|       |        {
   86|       |            ah = 2*k;
   87|       |            ac = 4*k;
   88|       |
   89|       |            RE(ch[ah])    = RE(cc[ac]) + RE(cc[ac+1]);
   90|       |            RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
   91|       |            IM(ch[ah])    = IM(cc[ac]) + IM(cc[ac+1]);
   92|       |            IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
   93|       |        }
   94|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   95|       |        */
   96|      0|#endif
   97|  97.1k|    } else {
   98|   194k|        for (k = 0; k < l1; k++)
  ------------------
  |  Branch (98:21): [True: 97.1k, False: 97.1k]
  ------------------
   99|  97.1k|        {
  100|  97.1k|            ah = k*ido;
  101|  97.1k|            ac = 2*k*ido;
  102|       |
  103|  24.6M|            for (i = 0; i < ido; i++)
  ------------------
  |  Branch (103:25): [True: 24.5M, False: 97.1k]
  ------------------
  104|  24.5M|            {
  105|  24.5M|                complex_t t2;
  106|       |
  107|  24.5M|                RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
  108|  24.5M|                RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
                              RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
                              RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
  109|       |
  110|  24.5M|                IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
  111|  24.5M|                IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
                              IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
                              IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
  112|       |
  113|  24.5M|#if 1
  114|  24.5M|                ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
  115|  24.5M|                    IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
                                  IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
                                  IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  391|  24.5M|#define RE(A) (A)[0]
  ------------------
                                  IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  392|  24.5M|#define IM(A) (A)[1]
  ------------------
  116|       |#else
  117|       |                ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
  118|       |                    RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
  119|       |#endif
  120|  24.5M|            }
  121|  97.1k|        }
  122|  97.1k|    }
  123|  97.1k|}
cfft.c:cffti1:
  907|  13.2k|{
  908|  13.2k|    static uint16_t ntryh[4] = {3, 4, 2, 5};
  909|  13.2k|#ifndef FIXED_POINT
  910|  13.2k|    real_t arg, argh, argld, fi;
  911|  13.2k|    uint16_t ido, ipm;
  912|  13.2k|    uint16_t i1, k1, l1, l2;
  913|  13.2k|    uint16_t ld, ii, ip;
  914|  13.2k|#endif
  915|  13.2k|    uint16_t ntry = 0, i, j;
  916|  13.2k|    uint16_t ib;
  917|  13.2k|    uint16_t nf, nl, nq, nr;
  918|       |
  919|  13.2k|    nl = n;
  920|  13.2k|    nf = 0;
  921|  13.2k|    j = 0;
  922|       |
  923|  38.5k|startloop:
  924|  38.5k|    j++;
  925|       |
  926|  38.5k|    if (j <= 4)
  ------------------
  |  Branch (926:9): [True: 38.5k, False: 0]
  ------------------
  927|  38.5k|        ntry = ntryh[j-1];
  928|      0|    else
  929|      0|        ntry += 2;
  930|       |
  931|  38.5k|    do
  932|  78.2k|    {
  933|  78.2k|        nq = nl / ntry;
  934|  78.2k|        nr = nl - ntry*nq;
  935|       |
  936|  78.2k|        if (nr != 0)
  ------------------
  |  Branch (936:13): [True: 25.2k, False: 52.9k]
  ------------------
  937|  25.2k|            goto startloop;
  938|       |
  939|  52.9k|        nf++;
  940|  52.9k|        ifac[nf+1] = ntry;
  941|  52.9k|        nl = nq;
  942|       |
  943|  52.9k|        if (ntry == 2 && nf != 1)
  ------------------
  |  Branch (943:13): [True: 6.62k, False: 46.3k]
  |  Branch (943:26): [True: 6.62k, False: 0]
  ------------------
  944|  6.62k|        {
  945|  31.3k|            for (i = 2; i <= nf; i++)
  ------------------
  |  Branch (945:25): [True: 24.6k, False: 6.62k]
  ------------------
  946|  24.6k|            {
  947|  24.6k|                ib = nf - i + 2;
  948|  24.6k|                ifac[ib+1] = ifac[ib];
  949|  24.6k|            }
  950|  6.62k|            ifac[2] = 2;
  951|  6.62k|        }
  952|  52.9k|    } while (nl != 1);
  ------------------
  |  Branch (952:14): [True: 39.7k, False: 13.2k]
  ------------------
  953|       |
  954|  13.2k|    ifac[0] = n;
  955|  13.2k|    ifac[1] = nf;
  956|       |
  957|  13.2k|#ifndef FIXED_POINT
  958|  13.2k|    argh = (real_t)2.0*(real_t)M_PI / (real_t)n;
  959|  13.2k|    i = 0;
  960|  13.2k|    l1 = 1;
  961|       |
  962|  66.2k|    for (k1 = 1; k1 <= nf; k1++)
  ------------------
  |  Branch (962:18): [True: 52.9k, False: 13.2k]
  ------------------
  963|  52.9k|    {
  964|  52.9k|        ip = ifac[k1+1];
  965|  52.9k|        ld = 0;
  966|  52.9k|        l2 = l1*ip;
  967|  52.9k|        ido = n / l2;
  968|  52.9k|        ipm = ip - 1;
  969|       |
  970|   198k|        for (j = 0; j < ipm; j++)
  ------------------
  |  Branch (970:21): [True: 145k, False: 52.9k]
  ------------------
  971|   145k|        {
  972|   145k|            i1 = i;
  973|   145k|            RE(wa[i]) = 1.0;
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
  974|   145k|            IM(wa[i]) = 0.0;
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
  975|   145k|            ld += l1;
  976|   145k|            fi = 0;
  977|   145k|            argld = ld*argh;
  978|       |
  979|  3.88M|            for (ii = 0; ii < ido; ii++)
  ------------------
  |  Branch (979:26): [True: 3.73M, False: 145k]
  ------------------
  980|  3.73M|            {
  981|  3.73M|                i++;
  982|  3.73M|                fi++;
  983|  3.73M|                arg = fi * argld;
  984|  3.73M|                RE(wa[i]) = (real_t)cos(arg);
  ------------------
  |  |  391|  3.73M|#define RE(A) (A)[0]
  ------------------
  985|  3.73M|#if 1
  986|  3.73M|                IM(wa[i]) = (real_t)sin(arg);
  ------------------
  |  |  392|  3.73M|#define IM(A) (A)[1]
  ------------------
  987|       |#else
  988|       |                IM(wa[i]) = (real_t)-sin(arg);
  989|       |#endif
  990|  3.73M|            }
  991|       |
  992|   145k|            if (ip > 5)
  ------------------
  |  Branch (992:17): [True: 0, False: 145k]
  ------------------
  993|      0|            {
  994|      0|                RE(wa[i1]) = RE(wa[i]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
                              RE(wa[i1]) = RE(wa[i]);
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
  995|      0|                IM(wa[i1]) = IM(wa[i]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
                              IM(wa[i1]) = IM(wa[i]);
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
  996|      0|            }
  997|   145k|        }
  998|  52.9k|        l1 = l2;
  999|  52.9k|    }
 1000|       |#else  // FIXED_POINT
 1001|       |    (void)wa;  /* whoa! does it work for FIXED_POINT? */
 1002|       |#endif
 1003|  13.2k|}

get_sr_index:
   42|   181k|{
   43|   181k|    if (92017 <= samplerate) return 0;
  ------------------
  |  Branch (43:9): [True: 40.6k, False: 140k]
  ------------------
   44|   140k|    if (75132 <= samplerate) return 1;
  ------------------
  |  Branch (44:9): [True: 7.31k, False: 133k]
  ------------------
   45|   133k|    if (55426 <= samplerate) return 2;
  ------------------
  |  Branch (45:9): [True: 7.93k, False: 125k]
  ------------------
   46|   125k|    if (46009 <= samplerate) return 3;
  ------------------
  |  Branch (46:9): [True: 23.9k, False: 101k]
  ------------------
   47|   101k|    if (37566 <= samplerate) return 4;
  ------------------
  |  Branch (47:9): [True: 19.5k, False: 82.1k]
  ------------------
   48|  82.1k|    if (27713 <= samplerate) return 5;
  ------------------
  |  Branch (48:9): [True: 19.9k, False: 62.1k]
  ------------------
   49|  62.1k|    if (23004 <= samplerate) return 6;
  ------------------
  |  Branch (49:9): [True: 4.59k, False: 57.5k]
  ------------------
   50|  57.5k|    if (18783 <= samplerate) return 7;
  ------------------
  |  Branch (50:9): [True: 4.09k, False: 53.4k]
  ------------------
   51|  53.4k|    if (13856 <= samplerate) return 8;
  ------------------
  |  Branch (51:9): [True: 51.2k, False: 2.25k]
  ------------------
   52|  2.25k|    if (11502 <= samplerate) return 9;
  ------------------
  |  Branch (52:9): [True: 220, False: 2.03k]
  ------------------
   53|  2.03k|    if (9391 <= samplerate) return 10;
  ------------------
  |  Branch (53:9): [True: 245, False: 1.79k]
  ------------------
   54|       |
   55|  1.79k|    return 11;
   56|  2.03k|}
get_sample_rate:
   60|  78.5k|{
   61|  78.5k|    static const uint32_t sample_rates[] =
   62|  78.5k|    {
   63|  78.5k|        96000, 88200, 64000, 48000, 44100, 32000,
   64|  78.5k|        24000, 22050, 16000, 12000, 11025, 8000
   65|  78.5k|    };
   66|       |
   67|  78.5k|    if (sr_index < 12)
  ------------------
  |  Branch (67:9): [True: 78.4k, False: 82]
  ------------------
   68|  78.4k|        return sample_rates[sr_index];
   69|       |
   70|     82|    return 0;
   71|  78.5k|}
max_pred_sfb:
   74|  2.63k|{
   75|  2.63k|    static const uint8_t pred_sfb_max[] =
   76|  2.63k|    {
   77|  2.63k|        33, 33, 38, 40, 40, 40, 41, 41, 37, 37, 37, 34
   78|  2.63k|    };
   79|       |
   80|       |
   81|  2.63k|    if (sr_index < 12)
  ------------------
  |  Branch (81:9): [True: 2.63k, False: 0]
  ------------------
   82|  2.63k|        return pred_sfb_max[sr_index];
   83|       |
   84|      0|    return 0;
   85|  2.63k|}
max_tns_sfb:
   89|  12.5k|{
   90|       |    /* entry for each sampling rate
   91|       |     * 1    Main/LC long window
   92|       |     * 2    Main/LC short window
   93|       |     * 3    SSR long window
   94|       |     * 4    SSR short window
   95|       |     */
   96|  12.5k|    static const uint8_t tns_sbf_max[][4] =
   97|  12.5k|    {
   98|  12.5k|        {31,  9, 28, 7}, /* 96000 */
   99|  12.5k|        {31,  9, 28, 7}, /* 88200 */
  100|  12.5k|        {34, 10, 27, 7}, /* 64000 */
  101|  12.5k|        {40, 14, 26, 6}, /* 48000 */
  102|  12.5k|        {42, 14, 26, 6}, /* 44100 */
  103|  12.5k|        {51, 14, 26, 6}, /* 32000 */
  104|  12.5k|        {46, 14, 29, 7}, /* 24000 */
  105|  12.5k|        {46, 14, 29, 7}, /* 22050 */
  106|  12.5k|        {42, 14, 23, 8}, /* 16000 */
  107|  12.5k|        {42, 14, 23, 8}, /* 12000 */
  108|  12.5k|        {42, 14, 23, 8}, /* 11025 */
  109|  12.5k|        {39, 14, 19, 7}, /*  8000 */
  110|  12.5k|        {39, 14, 19, 7}, /*  7350 */
  111|  12.5k|        {0,0,0,0},
  112|  12.5k|        {0,0,0,0},
  113|  12.5k|        {0,0,0,0}
  114|  12.5k|    };
  115|  12.5k|    uint8_t i = 0;
  116|       |
  117|  12.5k|    if (is_short) i++;
  ------------------
  |  Branch (117:9): [True: 4.22k, False: 8.34k]
  ------------------
  118|  12.5k|    if (object_type == SSR) i += 2;
  ------------------
  |  |   42|  12.5k|#define SSR        3
  ------------------
  |  Branch (118:9): [True: 903, False: 11.6k]
  ------------------
  119|       |
  120|  12.5k|    return tns_sbf_max[sr_index][i];
  121|  12.5k|}
can_decode_ot:
  125|  10.3k|{
  126|  10.3k|    switch (object_type)
  ------------------
  |  Branch (126:13): [True: 10.3k, False: 3]
  ------------------
  127|  10.3k|    {
  128|  8.73k|    case LC:
  ------------------
  |  |   41|  8.73k|#define LC         2
  ------------------
  |  Branch (128:5): [True: 8.73k, False: 1.57k]
  ------------------
  129|  8.73k|        return 0;
  130|     45|    case MAIN:
  ------------------
  |  |   40|     45|#define MAIN       1
  ------------------
  |  Branch (130:5): [True: 45, False: 10.2k]
  ------------------
  131|       |#ifdef MAIN_DEC
  132|       |        return 0;
  133|       |#else
  134|     45|        return -1;
  135|      0|#endif
  136|     18|    case SSR:
  ------------------
  |  |   42|     18|#define SSR        3
  ------------------
  |  Branch (136:5): [True: 18, False: 10.2k]
  ------------------
  137|       |#ifdef SSR_DEC
  138|       |        return 0;
  139|       |#else
  140|     18|        return -1;
  141|      0|#endif
  142|      9|    case LTP:
  ------------------
  |  |   43|      9|#define LTP        4
  ------------------
  |  Branch (142:5): [True: 9, False: 10.3k]
  ------------------
  143|       |#ifdef LTP_DEC
  144|       |        return 0;
  145|       |#else
  146|      9|        return -1;
  147|      0|#endif
  148|       |
  149|       |    /* ER object types */
  150|      0|#ifdef ERROR_RESILIENCE
  151|  1.41k|    case ER_LC:
  ------------------
  |  |   46|  1.41k|#define ER_LC     17
  ------------------
  |  Branch (151:5): [True: 1.41k, False: 8.89k]
  ------------------
  152|  1.41k|#ifdef DRM
  153|  1.50k|    case DRM_ER_LC:
  ------------------
  |  |   48|  1.50k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (153:5): [True: 85, False: 10.2k]
  ------------------
  154|  1.50k|#endif
  155|  1.50k|        return 0;
  156|      0|    case ER_LTP:
  ------------------
  |  |   47|      0|#define ER_LTP    19
  ------------------
  |  Branch (156:5): [True: 0, False: 10.3k]
  ------------------
  157|       |#ifdef LTP_DEC
  158|       |        return 0;
  159|       |#else
  160|      0|        return -1;
  161|      0|#endif
  162|      0|    case LD:
  ------------------
  |  |   45|      0|#define LD        23
  ------------------
  |  Branch (162:5): [True: 0, False: 10.3k]
  ------------------
  163|       |#ifdef LD_DEC
  164|       |        return 0;
  165|       |#else
  166|      0|        return -1;
  167|  10.3k|#endif
  168|  10.3k|#endif
  169|  10.3k|    }
  170|       |
  171|      3|    return -1;
  172|  10.3k|}
faad_malloc:
  175|  1.86M|{
  176|       |#if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
  177|       |    return _aligned_malloc(size, 16);
  178|       |#else   // #ifdef 0
  179|  1.86M|    return malloc(size);
  180|  1.86M|#endif  // #ifdef 0
  181|  1.86M|}
faad_free:
  185|  1.86M|{
  186|       |#if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
  187|       |    _aligned_free(b);
  188|       |#else
  189|  1.86M|    free(b);
  190|  1.86M|}

mdct.c:ComplexMult:
  296|   112M|  {
  297|   112M|      *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|   112M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|   112M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  298|   112M|      *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|   112M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|   112M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  299|   112M|  }
cfft.c:ComplexMult:
  296|   149M|  {
  297|   149M|      *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|   149M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|   149M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  298|   149M|      *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|   149M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|   149M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  299|   149M|  }
ps_dec.c:ComplexMult:
  296|  25.2M|  {
  297|  25.2M|      *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|  25.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|  25.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  298|  25.2M|      *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|  25.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|  25.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  299|  25.2M|  }
drm_dec.c:ComplexMult:
  296|   565k|  {
  297|   565k|      *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|   565k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
  ------------------
  |  |  286|   565k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  298|   565k|      *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|   565k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                    *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
  ------------------
  |  |  286|   565k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  299|   565k|  }

NeAACDecOpen:
  124|  6.77k|{
  125|  6.77k|    uint8_t i;
  126|  6.77k|    NeAACDecStruct *hDecoder = NULL;
  127|       |
  128|  6.77k|    if ((hDecoder = (NeAACDecStruct*)faad_malloc(sizeof(NeAACDecStruct))) == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 6.77k]
  ------------------
  129|      0|        return NULL;
  130|       |
  131|  6.77k|    memset(hDecoder, 0, sizeof(NeAACDecStruct));
  132|       |
  133|  6.77k|    hDecoder->cmes = mes;
  134|  6.77k|    hDecoder->config.outputFormat  = FAAD_FMT_16BIT;
  ------------------
  |  |   98|  6.77k|#define FAAD_FMT_16BIT  1
  ------------------
  135|  6.77k|    hDecoder->config.defObjectType = MAIN;
  ------------------
  |  |   40|  6.77k|#define MAIN       1
  ------------------
  136|  6.77k|    hDecoder->config.defSampleRate = 44100; /* Default: 44.1kHz */
  137|  6.77k|    hDecoder->config.downMatrix = 0;
  138|  6.77k|    hDecoder->adts_header_present = 0;
  139|  6.77k|    hDecoder->adif_header_present = 0;
  140|  6.77k|    hDecoder->latm_header_present = 0;
  141|  6.77k|#ifdef ERROR_RESILIENCE
  142|  6.77k|    hDecoder->aacSectionDataResilienceFlag = 0;
  143|  6.77k|    hDecoder->aacScalefactorDataResilienceFlag = 0;
  144|  6.77k|    hDecoder->aacSpectralDataResilienceFlag = 0;
  145|  6.77k|#endif
  146|  6.77k|    hDecoder->frameLength = 1024;
  147|       |
  148|  6.77k|    hDecoder->frame = 0;
  149|  6.77k|    hDecoder->sample_buffer = NULL;
  150|       |
  151|       |    // Same as (1, 1) after 1024 iterations; otherwise first values does not look random at all.
  152|  6.77k|    hDecoder->__r1 = 0x2bb431ea;
  153|  6.77k|    hDecoder->__r2 = 0x206155b7;
  154|       |
  155|   440k|    for (i = 0; i < MAX_CHANNELS; i++)
  ------------------
  |  |   43|   440k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (155:17): [True: 433k, False: 6.77k]
  ------------------
  156|   433k|    {
  157|   433k|        hDecoder->element_id[i] = INVALID_ELEMENT_ID;
  ------------------
  |  |   94|   433k|#define INVALID_ELEMENT_ID 255
  ------------------
  158|   433k|        hDecoder->window_shape_prev[i] = 0;
  159|   433k|        hDecoder->time_out[i] = NULL;
  160|   433k|        hDecoder->fb_intermed[i] = NULL;
  161|       |#ifdef SSR_DEC
  162|       |        hDecoder->ssr_overlap[i] = NULL;
  163|       |        hDecoder->prev_fmd[i] = NULL;
  164|       |#endif
  165|       |#ifdef MAIN_DEC
  166|       |        hDecoder->pred_stat[i] = NULL;
  167|       |#endif
  168|       |#ifdef LTP_DEC
  169|       |        hDecoder->ltp_lag[i] = 0;
  170|       |        hDecoder->lt_pred_stat[i] = NULL;
  171|       |#endif
  172|   433k|    }
  173|       |
  174|  6.77k|#ifdef SBR_DEC
  175|   331k|    for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
  ------------------
  |  |   44|   331k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (175:17): [True: 325k, False: 6.77k]
  ------------------
  176|   325k|    {
  177|   325k|        hDecoder->sbr[i] = NULL;
  178|   325k|    }
  179|  6.77k|#endif
  180|       |
  181|  6.77k|    hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
  ------------------
  |  |  288|  6.77k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
                  hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
  ------------------
  |  |  288|  6.77k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  182|       |
  183|  6.77k|    return hDecoder;
  184|  6.77k|}
NeAACDecGetCurrentConfiguration:
  187|  6.19k|{
  188|  6.19k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  189|  6.19k|    if (hDecoder)
  ------------------
  |  Branch (189:9): [True: 6.19k, False: 0]
  ------------------
  190|  6.19k|    {
  191|  6.19k|        NeAACDecConfigurationPtr config = &(hDecoder->config);
  192|       |
  193|  6.19k|        return config;
  194|  6.19k|    }
  195|       |
  196|      0|    return NULL;
  197|  6.19k|}
NeAACDecSetConfiguration:
  201|  6.24k|{
  202|  6.24k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  203|  6.24k|    if (hDecoder && config)
  ------------------
  |  Branch (203:9): [True: 6.24k, False: 0]
  |  Branch (203:21): [True: 6.24k, False: 0]
  ------------------
  204|  6.24k|    {
  205|       |        /* check if we can decode this object type */
  206|  6.24k|        if (can_decode_ot(config->defObjectType) < 0)
  ------------------
  |  Branch (206:13): [True: 3, False: 6.24k]
  ------------------
  207|      3|            return 0;
  208|  6.24k|        hDecoder->config.defObjectType = config->defObjectType;
  209|       |
  210|       |        /* samplerate: anything but 0 should be possible */
  211|  6.24k|        if (config->defSampleRate == 0)
  ------------------
  |  Branch (211:13): [True: 2, False: 6.24k]
  ------------------
  212|      2|            return 0;
  213|  6.24k|        hDecoder->config.defSampleRate = config->defSampleRate;
  214|       |
  215|       |        /* check output format */
  216|       |#ifdef FIXED_POINT
  217|       |        if ((config->outputFormat < 1) || (config->outputFormat > 4))
  218|       |            return 0;
  219|       |#else
  220|  6.24k|        if ((config->outputFormat < 1) || (config->outputFormat > 5))
  ------------------
  |  Branch (220:13): [True: 4, False: 6.24k]
  |  Branch (220:43): [True: 36, False: 6.20k]
  ------------------
  221|     40|            return 0;
  222|  6.20k|#endif
  223|  6.20k|        hDecoder->config.outputFormat = config->outputFormat;
  224|       |
  225|  6.20k|        if (config->downMatrix > 1)
  ------------------
  |  Branch (225:13): [True: 7, False: 6.19k]
  ------------------
  226|      7|            return 0;
  227|  6.19k|        hDecoder->config.downMatrix = config->downMatrix;
  228|       |
  229|       |        /* OK */
  230|  6.19k|        return 1;
  231|  6.20k|    }
  232|       |
  233|      0|    return 0;
  234|  6.24k|}
NeAACDecInit:
  268|  4.12k|{
  269|  4.12k|    uint32_t bits = 0;
  270|  4.12k|    bitfile ld;
  271|  4.12k|    adif_header adif;
  272|  4.12k|    adts_header adts;
  273|  4.12k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  274|       |
  275|       |
  276|  4.12k|    if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL) || (buffer_size == 0))
  ------------------
  |  Branch (276:9): [True: 0, False: 4.12k]
  |  Branch (276:31): [True: 0, False: 4.12k]
  |  Branch (276:55): [True: 0, False: 4.12k]
  |  Branch (276:77): [True: 16, False: 4.11k]
  ------------------
  277|     16|        return -1;
  278|       |
  279|  4.11k|    adts.old_format = hDecoder->config.useOldADTSFormat;
  280|  4.11k|    hDecoder->sf_index = get_sr_index(hDecoder->config.defSampleRate);
  281|  4.11k|    hDecoder->object_type = hDecoder->config.defObjectType;
  282|  4.11k|    *samplerate = get_sample_rate(hDecoder->sf_index);
  283|  4.11k|    *channels = 1;
  284|       |
  285|  4.11k|    if (buffer != NULL)
  ------------------
  |  Branch (285:9): [True: 4.11k, False: 0]
  ------------------
  286|  4.11k|    {
  287|       |#if 0
  288|       |        int is_latm;
  289|       |        latm_header *l = &hDecoder->latm_config;
  290|       |#endif
  291|       |
  292|  4.11k|        faad_initbits(&ld, buffer, buffer_size);
  293|       |
  294|       |#if 0
  295|       |        memset(l, 0, sizeof(latm_header));
  296|       |        is_latm = latmCheck(l, &ld);
  297|       |        l->inited = 0;
  298|       |        l->frameLength = 0;
  299|       |        faad_rewindbits(&ld);
  300|       |        if(is_latm && l->ASCbits>0)
  301|       |        {
  302|       |            int32_t x;
  303|       |            hDecoder->latm_header_present = 1;
  304|       |            x = NeAACDecInit2(hDecoder, l->ASC, (l->ASCbits+7)/8, samplerate, channels);
  305|       |            if(x!=0)
  306|       |                hDecoder->latm_header_present = 0;
  307|       |            return x;
  308|       |        } else
  309|       |#endif
  310|       |        /* Check if an ADIF header is present */
  311|  4.11k|        if ((buffer_size >= 8) && (buffer[0] == 'A') && (buffer[1] == 'D') &&
  ------------------
  |  Branch (311:13): [True: 219, False: 3.89k]
  |  Branch (311:35): [True: 130, False: 89]
  |  Branch (311:57): [True: 123, False: 7]
  ------------------
  312|    123|            (buffer[2] == 'I') && (buffer[3] == 'F'))
  ------------------
  |  Branch (312:13): [True: 118, False: 5]
  |  Branch (312:35): [True: 109, False: 9]
  ------------------
  313|    109|        {
  314|    109|            hDecoder->adif_header_present = 1;
  315|       |
  316|    109|            get_adif_header(&adif, &ld);
  317|    109|            faad_byte_align(&ld);
  318|       |
  319|    109|            hDecoder->sf_index = adif.pce[0].sf_index;
  320|    109|            hDecoder->object_type = adif.pce[0].object_type + 1;
  321|       |
  322|    109|            *samplerate = get_sample_rate(hDecoder->sf_index);
  323|    109|            *channels = adif.pce[0].channels;
  324|       |
  325|    109|            memcpy(&(hDecoder->pce), &(adif.pce[0]), sizeof(program_config));
  326|    109|            hDecoder->pce_set = 1;
  327|       |
  328|    109|            bits = bit2byte(faad_get_processed_bits(&ld));
  ------------------
  |  |   46|    109|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|    109|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
  329|       |
  330|       |        /* Check if an ADTS header is present */
  331|  4.00k|        } else if (adts_frame(&adts, &ld) == 0) {
  ------------------
  |  Branch (331:20): [True: 99, False: 3.90k]
  ------------------
  332|     99|            hDecoder->adts_header_present = 1;
  333|       |
  334|     99|            hDecoder->sf_index = adts.sf_index;
  335|     99|            hDecoder->object_type = adts.profile + 1;
  336|       |
  337|     99|            *samplerate = get_sample_rate(hDecoder->sf_index);
  338|     99|            *channels = (adts.channel_configuration > 6) ?
  ------------------
  |  Branch (338:25): [True: 11, False: 88]
  ------------------
  339|     88|                2 : adts.channel_configuration;
  340|     99|        }
  341|       |
  342|  4.11k|        if (ld.error)
  ------------------
  |  Branch (342:13): [True: 0, False: 4.11k]
  ------------------
  343|      0|        {
  344|      0|            faad_endbits(&ld);
  345|      0|            return -1;
  346|      0|        }
  347|  4.11k|        faad_endbits(&ld);
  348|  4.11k|    }
  349|       |
  350|  4.11k|    if (!*samplerate)
  ------------------
  |  Branch (350:9): [True: 50, False: 4.06k]
  ------------------
  351|     50|        return -1;
  352|       |
  353|  4.06k|#if (defined(PS_DEC) || defined(DRM_PS))
  354|       |    /* check if we have a mono file */
  355|  4.06k|    if (*channels == 1)
  ------------------
  |  Branch (355:9): [True: 3.90k, False: 156]
  ------------------
  356|  3.90k|    {
  357|       |        /* upMatrix to 2 channels for implicit signalling of PS */
  358|  3.90k|        *channels = 2;
  359|  3.90k|    }
  360|  4.06k|#endif
  361|       |
  362|  4.06k|    hDecoder->channelConfiguration = *channels;
  363|       |
  364|  4.06k|#ifdef SBR_DEC
  365|       |    /* implicit signalling */
  366|  4.06k|    if (*samplerate <= 24000 && (hDecoder->config.dontUpSampleImplicitSBR == 0))
  ------------------
  |  Branch (366:9): [True: 1.89k, False: 2.16k]
  |  Branch (366:33): [True: 1.89k, False: 0]
  ------------------
  367|  1.89k|    {
  368|  1.89k|        *samplerate *= 2;
  369|  1.89k|        hDecoder->forceUpSampling = 1;
  370|  2.16k|    } else if (*samplerate > 24000 && (hDecoder->config.dontUpSampleImplicitSBR == 0)) {
  ------------------
  |  Branch (370:16): [True: 2.16k, False: 0]
  |  Branch (370:39): [True: 2.16k, False: 0]
  ------------------
  371|  2.16k|        hDecoder->downSampledSBR = 1;
  372|  2.16k|    }
  373|  4.06k|#endif
  374|       |
  375|       |    /* must be done before frameLength is divided by 2 for LD */
  376|       |#ifdef SSR_DEC
  377|       |    if (hDecoder->object_type == SSR)
  378|       |        hDecoder->fb = ssr_filter_bank_init(hDecoder->frameLength/SSR_BANDS);
  379|       |    else
  380|       |#endif
  381|  4.06k|        hDecoder->fb = filter_bank_init(hDecoder->frameLength);
  382|       |
  383|       |#ifdef LD_DEC
  384|       |    if (hDecoder->object_type == LD)
  385|       |        hDecoder->frameLength >>= 1;
  386|       |#endif
  387|       |
  388|  4.06k|    if (can_decode_ot(hDecoder->object_type) < 0)
  ------------------
  |  Branch (388:9): [True: 72, False: 3.99k]
  ------------------
  389|     72|        return -1;
  390|       |
  391|  3.99k|    return bits;
  392|  4.06k|}
NeAACDecInit2:
  400|  2.06k|{
  401|  2.06k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  402|  2.06k|    int8_t rc;
  403|  2.06k|    mp4AudioSpecificConfig mp4ASC;
  404|       |
  405|  2.06k|    if((hDecoder == NULL)
  ------------------
  |  Branch (405:8): [True: 0, False: 2.06k]
  ------------------
  406|  2.06k|        || (pBuffer == NULL)
  ------------------
  |  Branch (406:12): [True: 0, False: 2.06k]
  ------------------
  407|  2.06k|        || (SizeOfDecoderSpecificInfo < 2)
  ------------------
  |  Branch (407:12): [True: 8, False: 2.06k]
  ------------------
  408|  2.06k|        || (samplerate == NULL)
  ------------------
  |  Branch (408:12): [True: 0, False: 2.06k]
  ------------------
  409|  2.06k|        || (channels == NULL))
  ------------------
  |  Branch (409:12): [True: 0, False: 2.06k]
  ------------------
  410|      8|    {
  411|      8|        return -1;
  412|      8|    }
  413|       |
  414|  2.06k|    hDecoder->adif_header_present = 0;
  415|  2.06k|    hDecoder->adts_header_present = 0;
  416|       |
  417|       |    /* decode the audio specific config */
  418|  2.06k|    rc = AudioSpecificConfig2(pBuffer, SizeOfDecoderSpecificInfo, &mp4ASC,
  419|  2.06k|        &(hDecoder->pce), hDecoder->latm_header_present);
  420|       |
  421|       |    /* copy the relevant info to the decoder handle */
  422|  2.06k|    *samplerate = mp4ASC.samplingFrequency;
  423|  2.06k|    if (mp4ASC.channelsConfiguration)
  ------------------
  |  Branch (423:9): [True: 1.67k, False: 381]
  ------------------
  424|  1.67k|    {
  425|  1.67k|        *channels = mp4ASC.channelsConfiguration;
  426|  1.67k|    } else {
  427|    381|        *channels = hDecoder->pce.channels;
  428|    381|        hDecoder->pce_set = 1;
  429|    381|    }
  430|  2.06k|#if (defined(PS_DEC) || defined(DRM_PS))
  431|       |    /* check if we have a mono file */
  432|  2.06k|    if (*channels == 1)
  ------------------
  |  Branch (432:9): [True: 8, False: 2.05k]
  ------------------
  433|      8|    {
  434|       |        /* upMatrix to 2 channels for implicit signalling of PS */
  435|      8|        *channels = 2;
  436|      8|    }
  437|  2.06k|#endif
  438|  2.06k|    hDecoder->sf_index = mp4ASC.samplingFrequencyIndex;
  439|  2.06k|    hDecoder->object_type = mp4ASC.objectTypeIndex;
  440|  2.06k|#ifdef ERROR_RESILIENCE
  441|  2.06k|    hDecoder->aacSectionDataResilienceFlag = mp4ASC.aacSectionDataResilienceFlag;
  442|  2.06k|    hDecoder->aacScalefactorDataResilienceFlag = mp4ASC.aacScalefactorDataResilienceFlag;
  443|  2.06k|    hDecoder->aacSpectralDataResilienceFlag = mp4ASC.aacSpectralDataResilienceFlag;
  444|  2.06k|#endif
  445|  2.06k|#ifdef SBR_DEC
  446|  2.06k|    hDecoder->sbr_present_flag = mp4ASC.sbr_present_flag;
  447|  2.06k|    hDecoder->downSampledSBR = mp4ASC.downSampledSBR;
  448|  2.06k|    if (hDecoder->config.dontUpSampleImplicitSBR == 0)
  ------------------
  |  Branch (448:9): [True: 2.06k, False: 0]
  ------------------
  449|  2.06k|        hDecoder->forceUpSampling = mp4ASC.forceUpSampling;
  450|      0|    else
  451|      0|        hDecoder->forceUpSampling = 0;
  452|       |
  453|       |    /* AAC core decoder samplerate is 2 times as low */
  454|  2.06k|    if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || hDecoder->forceUpSampling == 1)
  ------------------
  |  Branch (454:10): [True: 626, False: 1.43k]
  |  Branch (454:45): [True: 533, False: 93]
  |  Branch (454:77): [True: 720, False: 807]
  ------------------
  455|  1.25k|    {
  456|  1.25k|        hDecoder->sf_index = get_sr_index(mp4ASC.samplingFrequency / 2);
  457|  1.25k|    }
  458|  2.06k|#endif
  459|       |
  460|  2.06k|    if (rc != 0)
  ------------------
  |  Branch (460:9): [True: 23, False: 2.03k]
  ------------------
  461|     23|    {
  462|     23|        return rc;
  463|     23|    }
  464|  2.03k|    hDecoder->channelConfiguration = mp4ASC.channelsConfiguration;
  465|  2.03k|    if (mp4ASC.frameLengthFlag)
  ------------------
  |  Branch (465:9): [True: 1.28k, False: 755]
  ------------------
  466|  1.28k|#ifdef ALLOW_SMALL_FRAMELENGTH
  467|  1.28k|        hDecoder->frameLength = 960;
  468|       |#else
  469|       |        return -1;
  470|       |#endif
  471|       |
  472|       |    /* must be done before frameLength is divided by 2 for LD */
  473|       |#ifdef SSR_DEC
  474|       |    if (hDecoder->object_type == SSR)
  475|       |        hDecoder->fb = ssr_filter_bank_init(hDecoder->frameLength/SSR_BANDS);
  476|       |    else
  477|       |#endif
  478|  2.03k|        hDecoder->fb = filter_bank_init(hDecoder->frameLength);
  479|       |
  480|       |#ifdef LD_DEC
  481|       |    if (hDecoder->object_type == LD)
  482|       |        hDecoder->frameLength >>= 1;
  483|       |#endif
  484|       |
  485|  2.03k|    return 0;
  486|  2.06k|}
NeAACDecInitDRM:
  492|    524|{
  493|    524|    NeAACDecStruct** hDecoder = (NeAACDecStruct**)hpDecoder;
  494|    524|    if (hDecoder == NULL)
  ------------------
  |  Branch (494:9): [True: 0, False: 524]
  ------------------
  495|      0|        return 1; /* error */
  496|       |
  497|    524|    NeAACDecClose(*hDecoder);
  498|       |
  499|    524|    *hDecoder = NeAACDecOpen();
  500|       |
  501|       |    /* Special object type defined for DRM */
  502|    524|    (*hDecoder)->config.defObjectType = DRM_ER_LC;
  ------------------
  |  |   48|    524|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  503|       |
  504|    524|    (*hDecoder)->config.defSampleRate = samplerate;
  505|    524|#ifdef ERROR_RESILIENCE // This shoudl always be defined for DRM
  506|    524|    (*hDecoder)->aacSectionDataResilienceFlag = 1; /* VCB11 */
  507|    524|    (*hDecoder)->aacScalefactorDataResilienceFlag = 0; /* no RVLC */
  508|    524|    (*hDecoder)->aacSpectralDataResilienceFlag = 1; /* HCR */
  509|    524|#endif
  510|    524|    (*hDecoder)->frameLength = 960;
  511|    524|    (*hDecoder)->sf_index = get_sr_index((*hDecoder)->config.defSampleRate);
  512|    524|    (*hDecoder)->object_type = (*hDecoder)->config.defObjectType;
  513|       |
  514|    524|    if ((channels == DRMCH_STEREO) || (channels == DRMCH_SBR_STEREO))
  ------------------
  |  |   64|    524|#define DRMCH_STEREO        2
  ------------------
                  if ((channels == DRMCH_STEREO) || (channels == DRMCH_SBR_STEREO))
  ------------------
  |  |   66|    454|#define DRMCH_SBR_STEREO    4
  ------------------
  |  Branch (514:9): [True: 70, False: 454]
  |  Branch (514:39): [True: 30, False: 424]
  ------------------
  515|    100|        (*hDecoder)->channelConfiguration = 2;
  516|    424|    else
  517|    424|        (*hDecoder)->channelConfiguration = 1;
  518|       |
  519|    524|#ifdef SBR_DEC
  520|    524|    if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO))
  ------------------
  |  |   63|    524|#define DRMCH_MONO          1
  ------------------
                  if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO))
  ------------------
  |  |   64|    495|#define DRMCH_STEREO        2
  ------------------
  |  Branch (520:9): [True: 29, False: 495]
  |  Branch (520:37): [True: 70, False: 425]
  ------------------
  521|     99|        (*hDecoder)->sbr_present_flag = 0;
  522|    425|    else
  523|    425|        (*hDecoder)->sbr_present_flag = 1;
  524|    524|#endif
  525|       |
  526|    524|    (*hDecoder)->fb = filter_bank_init((*hDecoder)->frameLength);
  527|       |
  528|    524|    return 0;
  529|    524|}
NeAACDecClose:
  533|  6.77k|{
  534|  6.77k|    uint8_t i;
  535|  6.77k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  536|       |
  537|  6.77k|    if (hDecoder == NULL)
  ------------------
  |  Branch (537:9): [True: 0, False: 6.77k]
  ------------------
  538|      0|        return;
  539|       |
  540|       |#ifdef PROFILE
  541|       |    printf("AAC decoder total:  %I64d cycles\n", hDecoder->cycles);
  542|       |    printf("requant:            %I64d cycles\n", hDecoder->requant_cycles);
  543|       |    printf("spectral_data:      %I64d cycles\n", hDecoder->spectral_cycles);
  544|       |    printf("scalefactors:       %I64d cycles\n", hDecoder->scalefac_cycles);
  545|       |    printf("output:             %I64d cycles\n", hDecoder->output_cycles);
  546|       |#endif
  547|       |
  548|   440k|    for (i = 0; i < MAX_CHANNELS; i++)
  ------------------
  |  |   43|   440k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (548:17): [True: 433k, False: 6.77k]
  ------------------
  549|   433k|    {
  550|   433k|        if (hDecoder->time_out[i]) faad_free(hDecoder->time_out[i]);
  ------------------
  |  Branch (550:13): [True: 158k, False: 275k]
  ------------------
  551|   433k|        if (hDecoder->fb_intermed[i]) faad_free(hDecoder->fb_intermed[i]);
  ------------------
  |  Branch (551:13): [True: 93.5k, False: 339k]
  ------------------
  552|       |#ifdef SSR_DEC
  553|       |        if (hDecoder->ssr_overlap[i]) faad_free(hDecoder->ssr_overlap[i]);
  554|       |        if (hDecoder->prev_fmd[i]) faad_free(hDecoder->prev_fmd[i]);
  555|       |#endif
  556|       |#ifdef MAIN_DEC
  557|       |        if (hDecoder->pred_stat[i]) faad_free(hDecoder->pred_stat[i]);
  558|       |#endif
  559|       |#ifdef LTP_DEC
  560|       |        if (hDecoder->lt_pred_stat[i]) faad_free(hDecoder->lt_pred_stat[i]);
  561|       |#endif
  562|   433k|    }
  563|       |
  564|       |#ifdef SSR_DEC
  565|       |    if (hDecoder->object_type == SSR)
  566|       |        ssr_filter_bank_end(hDecoder->fb);
  567|       |    else
  568|       |#endif
  569|  6.77k|        filter_bank_end(hDecoder->fb);
  570|       |
  571|  6.77k|    drc_end(hDecoder->drc);
  572|       |
  573|  6.77k|    if (hDecoder->sample_buffer) faad_free(hDecoder->sample_buffer);
  ------------------
  |  Branch (573:9): [True: 1.06k, False: 5.70k]
  ------------------
  574|       |
  575|  6.77k|#ifdef SBR_DEC
  576|   331k|    for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
  ------------------
  |  |   44|   331k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (576:17): [True: 325k, False: 6.77k]
  ------------------
  577|   325k|    {
  578|   325k|        if (hDecoder->sbr[i])
  ------------------
  |  Branch (578:13): [True: 68.6k, False: 256k]
  ------------------
  579|  68.6k|            sbrDecodeEnd(hDecoder->sbr[i]);
  580|   325k|    }
  581|  6.77k|#endif
  582|       |
  583|  6.77k|    if (hDecoder) faad_free(hDecoder);
  ------------------
  |  Branch (583:9): [True: 6.77k, False: 0]
  ------------------
  584|  6.77k|}
NeAACDecPostSeekReset:
  587|  4.48k|{
  588|  4.48k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  589|  4.48k|    if (hDecoder)
  ------------------
  |  Branch (589:9): [True: 4.48k, False: 0]
  ------------------
  590|  4.48k|    {
  591|  4.48k|        hDecoder->postSeekResetFlag = 1;
  592|       |
  593|  4.48k|        if (frame != -1)
  ------------------
  |  Branch (593:13): [True: 4.48k, False: 0]
  ------------------
  594|  4.48k|            hDecoder->frame = frame;
  595|  4.48k|    }
  596|  4.48k|}
NeAACDecDecode:
  825|  7.27k|{
  826|  7.27k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  827|       |    return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0);
  828|  7.27k|}
NeAACDecDecode2:
  836|  4.73k|{
  837|  4.73k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  838|  4.73k|    if ((sample_buffer_size == 0) || (sample_buffer == NULL) || (*sample_buffer == NULL))
  ------------------
  |  Branch (838:9): [True: 55, False: 4.68k]
  |  Branch (838:38): [True: 0, False: 4.68k]
  |  Branch (838:65): [True: 0, False: 4.68k]
  ------------------
  839|     55|    {
  840|     55|        hInfo->error = 27;
  841|     55|        return NULL;
  842|     55|    }
  843|       |
  844|  4.68k|    return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size,
  845|  4.68k|        sample_buffer, sample_buffer_size);
  846|  4.73k|}
decoder.c:aac_frame_decode:
  854|  11.9k|{
  855|  11.9k|    uint16_t i;
  856|  11.9k|    uint8_t channels = 0;
  857|  11.9k|    uint8_t output_channels = 0;
  858|  11.9k|    bitfile ld;
  859|  11.9k|    uint32_t bitsconsumed;
  860|  11.9k|    uint16_t frame_len;
  861|  11.9k|    void *sample_buffer;
  862|       |#if 0
  863|       |    uint32_t startbit=0, endbit=0, payload_bits=0;
  864|       |#endif
  865|  11.9k|    uint32_t required_buffer_size=0;
  866|       |
  867|       |#ifdef PROFILE
  868|       |    int64_t count = faad_get_ts();
  869|       |#endif
  870|       |
  871|       |    /* safety checks */
  872|  11.9k|    if ((hDecoder == NULL) || (hInfo == NULL) || (buffer == NULL))
  ------------------
  |  Branch (872:9): [True: 0, False: 11.9k]
  |  Branch (872:31): [True: 0, False: 11.9k]
  |  Branch (872:50): [True: 0, False: 11.9k]
  ------------------
  873|      0|    {
  874|      0|        return NULL;
  875|      0|    }
  876|       |
  877|       |#if 0
  878|       |    printf("%d\n", buffer_size*8);
  879|       |#endif
  880|       |
  881|  11.9k|    frame_len = hDecoder->frameLength;
  882|       |
  883|       |
  884|  11.9k|    memset(hInfo, 0, sizeof(NeAACDecFrameInfo));
  885|  11.9k|    memset(hDecoder->internal_channel, 0, MAX_CHANNELS*sizeof(hDecoder->internal_channel[0]));
  ------------------
  |  |   43|  11.9k|#define MAX_CHANNELS        64
  ------------------
  886|       |
  887|       |#ifdef USE_TIME_LIMIT
  888|       |    if ((TIME_LIMIT * get_sample_rate(hDecoder->sf_index)) > hDecoder->TL_count)
  889|       |    {
  890|       |        hDecoder->TL_count += 1024;
  891|       |    } else {
  892|       |        hInfo->error = (NUM_ERROR_MESSAGES-1);
  893|       |        goto error;
  894|       |    }
  895|       |#endif
  896|       |
  897|       |
  898|       |    /* check for some common metadata tag types in the bitstream
  899|       |     * No need to return an error
  900|       |     */
  901|       |    /* ID3 */
  902|  11.9k|    if (buffer_size >= 128)
  ------------------
  |  Branch (902:9): [True: 1.31k, False: 10.6k]
  ------------------
  903|  1.31k|    {
  904|  1.31k|        if (memcmp(buffer, "TAG", 3) == 0)
  ------------------
  |  Branch (904:13): [True: 3, False: 1.31k]
  ------------------
  905|      3|        {
  906|       |            /* found it */
  907|      3|            hInfo->bytesconsumed = 128; /* 128 bytes fixed size */
  908|       |            /* no error, but no output either */
  909|      3|            return NULL;
  910|      3|        }
  911|  1.31k|    }
  912|       |
  913|       |
  914|       |    /* initialize the bitstream */
  915|  11.9k|    faad_initbits(&ld, buffer, buffer_size);
  916|  11.9k|    if (ld.error != 0)
  ------------------
  |  Branch (916:9): [True: 4.68k, False: 7.27k]
  ------------------
  917|  4.68k|        return NULL;
  918|       |
  919|       |#if 0
  920|       |    {
  921|       |        int i;
  922|       |        for (i = 0; i < ((buffer_size+3)>>2); i++)
  923|       |        {
  924|       |            uint8_t *buf;
  925|       |            uint32_t temp = 0;
  926|       |            buf = faad_getbitbuffer(&ld, 32);
  927|       |            //temp = getdword((void*)buf);
  928|       |            temp = *((uint32_t*)buf);
  929|       |            printf("0x%.8X\n", temp);
  930|       |            free(buf);
  931|       |        }
  932|       |        faad_endbits(&ld);
  933|       |        faad_initbits(&ld, buffer, buffer_size);
  934|       |    }
  935|       |#endif
  936|       |
  937|       |#if 0
  938|       |    if(hDecoder->latm_header_present)
  939|       |    {
  940|       |        payload_bits = faad_latm_frame(&hDecoder->latm_config, &ld);
  941|       |        startbit = faad_get_processed_bits(&ld);
  942|       |        if(payload_bits == -1U)
  943|       |        {
  944|       |            hInfo->error = 1;
  945|       |            goto error;
  946|       |        }
  947|       |    }
  948|       |#endif
  949|       |
  950|  7.27k|#ifdef DRM
  951|  7.27k|    if (hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|  7.27k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (951:9): [True: 691, False: 6.58k]
  ------------------
  952|    691|    {
  953|       |        /* We do not support stereo right now */
  954|    691|        if (0) //(hDecoder->channelConfiguration == 2)
  ------------------
  |  Branch (954:13): [Folded, False: 691]
  ------------------
  955|      0|        {
  956|      0|            hInfo->error = 28; // Throw CRC error
  957|      0|            goto error;
  958|      0|        }
  959|       |
  960|    691|        faad_getbits(&ld, 8
  961|    691|            DEBUGVAR(1,1,"NeAACDecDecode(): skip CRC"));
  962|    691|    }
  963|  7.27k|#endif
  964|       |
  965|  7.27k|    if (hDecoder->adts_header_present)
  ------------------
  |  Branch (965:9): [True: 111, False: 7.16k]
  ------------------
  966|    111|    {
  967|    111|        adts_header adts;
  968|       |
  969|    111|        adts.old_format = hDecoder->config.useOldADTSFormat;
  970|    111|        if ((hInfo->error = adts_frame(&adts, &ld)) > 0)
  ------------------
  |  Branch (970:13): [True: 8, False: 103]
  ------------------
  971|      8|            goto error;
  972|       |
  973|       |        /* MPEG2 does byte_alignment() here,
  974|       |         * but ADTS header is always multiple of 8 bits in MPEG2
  975|       |         * so not needed to actually do it.
  976|       |         */
  977|    111|    }
  978|       |
  979|       |#ifdef ANALYSIS
  980|       |    dbg_count = 0;
  981|       |#endif
  982|       |
  983|       |    /* decode the complete bitstream */
  984|  7.26k|#ifdef DRM
  985|  7.26k|    if (/*(hDecoder->object_type == 6) ||*/ hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|  7.26k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (985:45): [True: 691, False: 6.57k]
  ------------------
  986|    691|    {
  987|    691|        DRM_aac_scalable_main_element(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
  988|  6.57k|    } else {
  989|  6.57k|#endif
  990|  6.57k|        raw_data_block(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
  991|  6.57k|#ifdef DRM
  992|  6.57k|    }
  993|  7.26k|#endif
  994|       |
  995|       |#if 0
  996|       |    if(hDecoder->latm_header_present)
  997|       |    {
  998|       |        endbit = faad_get_processed_bits(&ld);
  999|       |        if(endbit-startbit > payload_bits)
 1000|       |            fprintf(stderr, "\r\nERROR, too many payload bits read: %u > %d. Please. report with a link to a sample\n",
 1001|       |                endbit-startbit, payload_bits);
 1002|       |        if(hDecoder->latm_config.otherDataLenBits > 0)
 1003|       |            faad_getbits(&ld, hDecoder->latm_config.otherDataLenBits);
 1004|       |        faad_byte_align(&ld);
 1005|       |    }
 1006|       |#endif
 1007|       |
 1008|  7.26k|    channels = hDecoder->fr_channels;
 1009|       |
 1010|  7.26k|    if (hInfo->error > 0)
  ------------------
  |  Branch (1010:9): [True: 4.67k, False: 2.58k]
  ------------------
 1011|  4.67k|        goto error;
 1012|       |
 1013|       |    /* safety check */
 1014|  2.58k|    if (channels == 0 || channels > MAX_CHANNELS)
  ------------------
  |  |   43|  2.55k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (1014:9): [True: 38, False: 2.55k]
  |  Branch (1014:26): [True: 0, False: 2.55k]
  ------------------
 1015|     38|    {
 1016|       |        /* invalid number of channels */
 1017|     38|        hInfo->error = 12;
 1018|     38|        goto error;
 1019|     38|    }
 1020|       |
 1021|       |    /* no more bit reading after this */
 1022|  2.55k|    bitsconsumed = faad_get_processed_bits(&ld);
 1023|  2.55k|    hInfo->bytesconsumed = bit2byte(bitsconsumed);
  ------------------
  |  |   46|  2.55k|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|  2.55k|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
 1024|  2.55k|    if (ld.error)
  ------------------
  |  Branch (1024:9): [True: 0, False: 2.55k]
  ------------------
 1025|      0|    {
 1026|      0|        hInfo->error = 14;
 1027|      0|        goto error;
 1028|      0|    }
 1029|  2.55k|    faad_endbits(&ld);
 1030|       |
 1031|       |
 1032|  2.55k|    if (!hDecoder->adts_header_present && !hDecoder->adif_header_present
  ------------------
  |  Branch (1032:9): [True: 2.51k, False: 34]
  |  Branch (1032:43): [True: 2.51k, False: 0]
  ------------------
 1033|       |#if 0
 1034|       |        && !hDecoder->latm_header_present
 1035|       |#endif
 1036|  2.55k|        )
 1037|  2.51k|    {
 1038|  2.51k|        if (hDecoder->channelConfiguration == 0)
  ------------------
  |  Branch (1038:13): [True: 133, False: 2.38k]
  ------------------
 1039|    133|            hDecoder->channelConfiguration = channels;
 1040|       |
 1041|  2.51k|        if (channels == 8) /* 7.1 */
  ------------------
  |  Branch (1041:13): [True: 88, False: 2.42k]
  ------------------
 1042|     88|            hDecoder->channelConfiguration = 7;
 1043|  2.51k|        if (channels == 7) /* not a standard channelConfiguration */
  ------------------
  |  Branch (1043:13): [True: 0, False: 2.51k]
  ------------------
 1044|      0|            hDecoder->channelConfiguration = 0;
 1045|  2.51k|    }
 1046|       |
 1047|  2.55k|    if ((channels == 5 || channels == 6) && hDecoder->config.downMatrix)
  ------------------
  |  Branch (1047:10): [True: 0, False: 2.55k]
  |  Branch (1047:27): [True: 704, False: 1.84k]
  |  Branch (1047:45): [True: 438, False: 266]
  ------------------
 1048|    438|    {
 1049|    438|        hDecoder->downMatrix = 1;
 1050|    438|        output_channels = 2;
 1051|  2.11k|    } else {
 1052|  2.11k|        output_channels = channels;
 1053|  2.11k|    }
 1054|       |
 1055|  2.55k|#if (defined(PS_DEC) || defined(DRM_PS))
 1056|  2.55k|    hDecoder->upMatrix = 0;
 1057|       |    /* check if we have a mono file */
 1058|  2.55k|    if (output_channels == 1)
  ------------------
  |  Branch (1058:9): [True: 0, False: 2.55k]
  ------------------
 1059|      0|    {
 1060|       |        /* upMatrix to 2 channels for implicit signalling of PS */
 1061|      0|        hDecoder->upMatrix = 1;
 1062|      0|        output_channels = 2;
 1063|      0|    }
 1064|  2.55k|#endif
 1065|       |
 1066|       |    /* Make a channel configuration based on either a PCE or a channelConfiguration */
 1067|  2.55k|    if (!hDecoder->downMatrix && hDecoder->pce_set)
  ------------------
  |  Branch (1067:9): [True: 2.11k, False: 438]
  |  Branch (1067:34): [True: 165, False: 1.94k]
  ------------------
 1068|    165|    {
 1069|       |        /* In some codepath program_config_element result is ignored. */
 1070|    165|        if (hDecoder->pce.channels > MAX_CHANNELS)
  ------------------
  |  |   43|    165|#define MAX_CHANNELS        64
  ------------------
  |  Branch (1070:13): [True: 3, False: 162]
  ------------------
 1071|      3|        {
 1072|      3|            hInfo->error = 22;
 1073|      3|            return NULL;
 1074|      3|        }
 1075|    165|    }
 1076|  2.54k|    create_channel_config(hDecoder, hInfo);
 1077|       |
 1078|       |    /* number of samples in this frame */
 1079|  2.54k|    hInfo->samples = frame_len*output_channels;
 1080|       |    /* number of channels in this frame */
 1081|  2.54k|    hInfo->channels = output_channels;
 1082|       |    /* samplerate */
 1083|  2.54k|    hInfo->samplerate = get_sample_rate(hDecoder->sf_index);
 1084|       |    /* object type */
 1085|  2.54k|    hInfo->object_type = hDecoder->object_type;
 1086|       |    /* sbr */
 1087|  2.54k|    hInfo->sbr = NO_SBR;
  ------------------
  |  |   57|  2.54k|#define NO_SBR           0
  ------------------
 1088|       |    /* header type */
 1089|  2.54k|    hInfo->header_type = RAW;
  ------------------
  |  |   51|  2.54k|#define RAW        0
  ------------------
 1090|  2.54k|    if (hDecoder->adif_header_present)
  ------------------
  |  Branch (1090:9): [True: 0, False: 2.54k]
  ------------------
 1091|      0|        hInfo->header_type = ADIF;
  ------------------
  |  |   52|      0|#define ADIF       1
  ------------------
 1092|  2.54k|    if (hDecoder->adts_header_present)
  ------------------
  |  Branch (1092:9): [True: 34, False: 2.51k]
  ------------------
 1093|     34|        hInfo->header_type = ADTS;
  ------------------
  |  |   53|     34|#define ADTS       2
  ------------------
 1094|       |#if 0
 1095|       |    if (hDecoder->latm_header_present)
 1096|       |        hInfo->header_type = LATM;
 1097|       |#endif
 1098|  2.54k|#if (defined(PS_DEC) || defined(DRM_PS))
 1099|  2.54k|    hInfo->ps = hDecoder->ps_used_global;
 1100|  2.54k|#endif
 1101|       |
 1102|       |    /* check if frame has channel elements */
 1103|  2.54k|    if (channels == 0)
  ------------------
  |  Branch (1103:9): [True: 0, False: 2.54k]
  ------------------
 1104|      0|    {
 1105|      0|        hDecoder->frame++;
 1106|      0|        return NULL;
 1107|      0|    }
 1108|       |
 1109|  2.54k|    {
 1110|  2.54k|        static const uint8_t str[] = { sizeof(int16_t), sizeof(int32_t), sizeof(int32_t),
 1111|  2.54k|            sizeof(float32_t), sizeof(double), sizeof(int16_t), sizeof(int16_t),
 1112|  2.54k|            sizeof(int16_t), sizeof(int16_t), 0, 0, 0
 1113|  2.54k|        };
 1114|  2.54k|        uint8_t stride = str[hDecoder->config.outputFormat-1];
 1115|  2.54k|#ifdef SBR_DEC
 1116|  2.54k|        if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1116:14): [True: 1.30k, False: 1.24k]
  |  Branch (1116:49): [True: 887, False: 420]
  |  Branch (1116:81): [True: 526, False: 1.13k]
  ------------------
 1117|  1.41k|        {
 1118|  1.41k|            stride = 2 * stride;
 1119|  1.41k|        }
 1120|  2.54k|#endif
 1121|  2.54k|        required_buffer_size = frame_len*output_channels*stride;
 1122|  2.54k|    }
 1123|       |
 1124|       |    /* check if we want to use internal sample_buffer */
 1125|  2.54k|    if (sample_buffer_size == 0)
  ------------------
  |  Branch (1125:9): [True: 1.21k, False: 1.33k]
  ------------------
 1126|  1.21k|    {
 1127|       |        /* allocate the buffer for the final samples */
 1128|  1.21k|        if (hDecoder->sample_buffer_size != required_buffer_size) 
  ------------------
  |  Branch (1128:13): [True: 1.09k, False: 116]
  ------------------
 1129|  1.09k|        {
 1130|  1.09k|            if (hDecoder->sample_buffer)
  ------------------
  |  Branch (1130:17): [True: 32, False: 1.06k]
  ------------------
 1131|     32|                faad_free(hDecoder->sample_buffer);
 1132|  1.09k|            hDecoder->sample_buffer = NULL;
 1133|  1.09k|            hDecoder->sample_buffer = faad_malloc(required_buffer_size);
 1134|  1.09k|            hDecoder->sample_buffer_size = required_buffer_size;
 1135|  1.09k|        }
 1136|  1.33k|    } else if (sample_buffer_size < required_buffer_size) {
  ------------------
  |  Branch (1136:16): [True: 458, False: 875]
  ------------------
 1137|       |        /* provided sample buffer is not big enough */
 1138|    458|        hInfo->error = 27;
 1139|    458|        return NULL;
 1140|    458|    }
 1141|       |
 1142|  2.08k|    if (sample_buffer_size == 0)
  ------------------
  |  Branch (1142:9): [True: 1.21k, False: 875]
  ------------------
 1143|  1.21k|    {
 1144|  1.21k|        sample_buffer = hDecoder->sample_buffer;
 1145|  1.21k|    } else {
 1146|    875|        sample_buffer = *sample_buffer2;
 1147|    875|    }
 1148|       |
 1149|  2.08k|#ifdef SBR_DEC
 1150|  2.08k|    if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1150:9): [True: 1.10k, False: 986]
  |  Branch (1150:46): [True: 362, False: 624]
  ------------------
 1151|  1.46k|    {
 1152|  1.46k|        uint8_t ele;
 1153|       |
 1154|       |        /* this data is different when SBR is used or when the data is upsampled */
 1155|  1.46k|        if (!hDecoder->downSampledSBR)
  ------------------
  |  Branch (1155:13): [True: 1.08k, False: 383]
  ------------------
 1156|  1.08k|        {
 1157|  1.08k|            frame_len *= 2;
 1158|  1.08k|            hInfo->samples *= 2;
 1159|  1.08k|            hInfo->samplerate *= 2;
 1160|  1.08k|        }
 1161|       |
 1162|       |        /* check if every element was provided with SBR data */
 1163|  7.18k|        for (ele = 0; ele < hDecoder->fr_ch_ele; ele++)
  ------------------
  |  Branch (1163:23): [True: 5.72k, False: 1.46k]
  ------------------
 1164|  5.72k|        {
 1165|  5.72k|            if (hDecoder->sbr[ele] == NULL)
  ------------------
  |  Branch (1165:17): [True: 2, False: 5.72k]
  ------------------
 1166|      2|            {
 1167|      2|                hInfo->error = 25;
 1168|      2|                goto error;
 1169|      2|            }
 1170|  5.72k|        }
 1171|       |
 1172|       |        /* sbr */
 1173|  1.46k|        if (hDecoder->sbr_present_flag == 1)
  ------------------
  |  Branch (1173:13): [True: 1.10k, False: 362]
  ------------------
 1174|  1.10k|        {
 1175|  1.10k|            hInfo->object_type = HE_AAC;
  ------------------
  |  |   44|  1.10k|#define HE_AAC     5
  ------------------
 1176|  1.10k|            hInfo->sbr = SBR_UPSAMPLED;
  ------------------
  |  |   58|  1.10k|#define SBR_UPSAMPLED    1
  ------------------
 1177|  1.10k|        } else {
 1178|    362|            hInfo->sbr = NO_SBR_UPSAMPLED;
  ------------------
  |  |   60|    362|#define NO_SBR_UPSAMPLED 3
  ------------------
 1179|    362|        }
 1180|  1.46k|        if (hDecoder->downSampledSBR)
  ------------------
  |  Branch (1180:13): [True: 381, False: 1.08k]
  ------------------
 1181|    381|        {
 1182|    381|            hInfo->sbr = SBR_DOWNSAMPLED;
  ------------------
  |  |   59|    381|#define SBR_DOWNSAMPLED  2
  ------------------
 1183|    381|        }
 1184|  1.46k|    }
 1185|  2.08k|#endif
 1186|       |
 1187|       |
 1188|  2.08k|    sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer,
 1189|  2.08k|        output_channels, frame_len, hDecoder->config.outputFormat);
 1190|       |
 1191|       |
 1192|  2.08k|#ifdef DRM
 1193|       |    //conceal_output(hDecoder, frame_len, output_channels, sample_buffer);
 1194|  2.08k|#endif
 1195|       |
 1196|       |
 1197|  2.08k|    hDecoder->postSeekResetFlag = 0;
 1198|       |
 1199|  2.08k|    hDecoder->frame++;
 1200|       |#ifdef LD_DEC
 1201|       |    if (hDecoder->object_type != LD)
 1202|       |    {
 1203|       |#endif
 1204|  2.08k|        if (hDecoder->frame <= 1)
  ------------------
  |  Branch (1204:13): [True: 785, False: 1.30k]
  ------------------
 1205|    785|            hInfo->samples = 0;
 1206|       |#ifdef LD_DEC
 1207|       |    } else {
 1208|       |        /* LD encoders will give lower delay */
 1209|       |        if (hDecoder->frame <= 0)
 1210|       |            hInfo->samples = 0;
 1211|       |    }
 1212|       |#endif
 1213|       |
 1214|       |    /* cleanup */
 1215|       |#ifdef ANALYSIS
 1216|       |    fflush(stdout);
 1217|       |#endif
 1218|       |
 1219|       |#ifdef PROFILE
 1220|       |    count = faad_get_ts() - count;
 1221|       |    hDecoder->cycles += count;
 1222|       |#endif
 1223|       |
 1224|  2.08k|    return sample_buffer;
 1225|       |
 1226|  4.72k|error:
 1227|       |
 1228|       |    /* reset filterbank state */
 1229|   307k|    for (i = 0; i < MAX_CHANNELS; i++)
  ------------------
  |  |   43|   307k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (1229:17): [True: 302k, False: 4.72k]
  ------------------
 1230|   302k|    {
 1231|   302k|        if (hDecoder->fb_intermed[i] != NULL)
  ------------------
  |  Branch (1231:13): [True: 104k, False: 197k]
  ------------------
 1232|   104k|        {
 1233|   104k|            memset(hDecoder->fb_intermed[i], 0, hDecoder->frameLength*sizeof(real_t));
 1234|   104k|        }
 1235|   302k|    }
 1236|  4.72k|#ifdef SBR_DEC
 1237|   231k|    for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
  ------------------
  |  |   44|   231k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (1237:17): [True: 226k, False: 4.72k]
  ------------------
 1238|   226k|    {
 1239|   226k|        if (hDecoder->sbr[i] != NULL)
  ------------------
  |  Branch (1239:13): [True: 79.2k, False: 147k]
  ------------------
 1240|  79.2k|        {
 1241|  79.2k|            sbrReset(hDecoder->sbr[i]);
 1242|  79.2k|        }
 1243|   226k|    }
 1244|  4.72k|#endif
 1245|       |
 1246|       |
 1247|  4.72k|    faad_endbits(&ld);
 1248|       |
 1249|       |    /* cleanup */
 1250|       |#ifdef ANALYSIS
 1251|       |    fflush(stdout);
 1252|       |#endif
 1253|       |
 1254|       |    return NULL;
 1255|  2.08k|}
decoder.c:create_channel_config:
  599|  2.54k|{
  600|  2.54k|    hInfo->num_front_channels = 0;
  601|  2.54k|    hInfo->num_side_channels = 0;
  602|  2.54k|    hInfo->num_back_channels = 0;
  603|  2.54k|    hInfo->num_lfe_channels = 0;
  604|  2.54k|    memset(hInfo->channel_position, 0, MAX_CHANNELS*sizeof(uint8_t));
  ------------------
  |  |   43|  2.54k|#define MAX_CHANNELS        64
  ------------------
  605|       |
  606|  2.54k|    if (hDecoder->downMatrix)
  ------------------
  |  Branch (606:9): [True: 438, False: 2.10k]
  ------------------
  607|    438|    {
  608|    438|        hInfo->num_front_channels = 2;
  609|    438|        hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    438|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  610|    438|        hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    438|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  611|    438|        return;
  612|    438|    }
  613|       |
  614|       |    /* check if there is a PCE */
  615|       |    /* TODO: why CPE flag is ignored? */
  616|  2.10k|    if (hDecoder->pce_set)
  ------------------
  |  Branch (616:9): [True: 162, False: 1.94k]
  ------------------
  617|    162|    {
  618|    162|        uint8_t i, chpos = 0;
  619|    162|        uint8_t chdir, back_center = 0;
  620|       |
  621|    162|        hInfo->num_front_channels = hDecoder->pce.num_front_channels;
  622|    162|        hInfo->num_side_channels = hDecoder->pce.num_side_channels;
  623|    162|        hInfo->num_back_channels = hDecoder->pce.num_back_channels;
  624|    162|        hInfo->num_lfe_channels = hDecoder->pce.num_lfe_channels;
  625|    162|        chdir = hInfo->num_front_channels;
  626|    162|        if (chdir & 1)
  ------------------
  |  Branch (626:13): [True: 53, False: 109]
  ------------------
  627|     53|        {
  628|     53|#if (defined(PS_DEC) || defined(DRM_PS))
  629|     53|            if (hInfo->num_front_channels == 1 &&
  ------------------
  |  Branch (629:17): [True: 23, False: 30]
  ------------------
  630|     23|                hInfo->num_side_channels == 0 &&
  ------------------
  |  Branch (630:17): [True: 14, False: 9]
  ------------------
  631|     14|                hInfo->num_back_channels == 0 &&
  ------------------
  |  Branch (631:17): [True: 11, False: 3]
  ------------------
  632|     11|                hInfo->num_lfe_channels == 0)
  ------------------
  |  Branch (632:17): [True: 8, False: 3]
  ------------------
  633|      8|            {
  634|       |                /* When PS is enabled output is always stereo */
  635|      8|                hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|      8|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  636|      8|                hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|      8|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  637|      8|            } else
  638|     45|#endif
  639|     45|            hInfo->channel_position[chpos++] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|     45|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  640|     53|            chdir--;
  641|     53|        }
  642|    884|        for (i = 0; i < chdir; i++)
  ------------------
  |  Branch (642:21): [True: 722, False: 162]
  ------------------
  643|    722|        {
  644|    722|            hInfo->channel_position[chpos++] =
  645|    722|                (i & 1) ? FRONT_CHANNEL_RIGHT : FRONT_CHANNEL_LEFT;
  ------------------
  |  |  116|    361|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
                              (i & 1) ? FRONT_CHANNEL_RIGHT : FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|  1.08k|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  |  Branch (645:17): [True: 361, False: 361]
  ------------------
  646|    722|        }
  647|       |
  648|    657|        for (i = 0; i < hInfo->num_side_channels; i++)
  ------------------
  |  Branch (648:21): [True: 495, False: 162]
  ------------------
  649|    495|        {
  650|    495|            hInfo->channel_position[chpos++] =
  651|    495|                (i & 1) ? SIDE_CHANNEL_RIGHT : SIDE_CHANNEL_LEFT;
  ------------------
  |  |  118|    244|#define SIDE_CHANNEL_RIGHT   (5)
  ------------------
                              (i & 1) ? SIDE_CHANNEL_RIGHT : SIDE_CHANNEL_LEFT;
  ------------------
  |  |  117|    746|#define SIDE_CHANNEL_LEFT    (4)
  ------------------
  |  Branch (651:17): [True: 244, False: 251]
  ------------------
  652|    495|        }
  653|       |
  654|    162|        chdir = hInfo->num_back_channels;
  655|    162|        if (chdir & 1)
  ------------------
  |  Branch (655:13): [True: 19, False: 143]
  ------------------
  656|     19|        {
  657|     19|            back_center = 1;
  658|     19|            chdir--;
  659|     19|        }
  660|    450|        for (i = 0; i < chdir; i++)
  ------------------
  |  Branch (660:21): [True: 288, False: 162]
  ------------------
  661|    288|        {
  662|    288|            hInfo->channel_position[chpos++] =
  663|    288|                (i & 1) ? BACK_CHANNEL_RIGHT : BACK_CHANNEL_LEFT;
  ------------------
  |  |  120|    144|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
                              (i & 1) ? BACK_CHANNEL_RIGHT : BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    432|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  |  Branch (663:17): [True: 144, False: 144]
  ------------------
  664|    288|        }
  665|    162|        if (back_center)
  ------------------
  |  Branch (665:13): [True: 19, False: 143]
  ------------------
  666|     19|        {
  667|     19|            hInfo->channel_position[chpos++] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|     19|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  668|     19|        }
  669|       |
  670|    224|        for (i = 0; i < hInfo->num_lfe_channels; i++)
  ------------------
  |  Branch (670:21): [True: 62, False: 162]
  ------------------
  671|     62|        {
  672|     62|            hInfo->channel_position[chpos++] = LFE_CHANNEL;
  ------------------
  |  |  122|     62|#define LFE_CHANNEL          (9)
  ------------------
  673|     62|        }
  674|       |
  675|  1.94k|    } else {
  676|  1.94k|        switch (hDecoder->channelConfiguration)
  677|  1.94k|        {
  678|    268|        case 1:
  ------------------
  |  Branch (678:9): [True: 268, False: 1.67k]
  ------------------
  679|    268|#if (defined(PS_DEC) || defined(DRM_PS))
  680|       |            /* When PS is enabled output is always stereo */
  681|    268|            hInfo->num_front_channels = 2;
  682|    268|            hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    268|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  683|    268|            hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    268|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  684|       |#else
  685|       |            hInfo->num_front_channels = 1;
  686|       |            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  687|       |#endif
  688|    268|            break;
  689|    958|        case 2:
  ------------------
  |  Branch (689:9): [True: 958, False: 989]
  ------------------
  690|    958|            hInfo->num_front_channels = 2;
  691|    958|            hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    958|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  692|    958|            hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    958|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  693|    958|            break;
  694|    128|        case 3:
  ------------------
  |  Branch (694:9): [True: 128, False: 1.81k]
  ------------------
  695|    128|            hInfo->num_front_channels = 3;
  696|    128|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    128|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  697|    128|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    128|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  698|    128|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    128|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  699|    128|            break;
  700|    132|        case 4:
  ------------------
  |  Branch (700:9): [True: 132, False: 1.81k]
  ------------------
  701|    132|            hInfo->num_front_channels = 3;
  702|    132|            hInfo->num_back_channels = 1;
  703|    132|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    132|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  704|    132|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    132|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  705|    132|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    132|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  706|    132|            hInfo->channel_position[3] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|    132|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  707|    132|            break;
  708|    121|        case 5:
  ------------------
  |  Branch (708:9): [True: 121, False: 1.82k]
  ------------------
  709|    121|            hInfo->num_front_channels = 3;
  710|    121|            hInfo->num_back_channels = 2;
  711|    121|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    121|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  712|    121|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    121|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  713|    121|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    121|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  714|    121|            hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    121|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  715|    121|            hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|    121|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  716|    121|            break;
  717|     25|        case 6:
  ------------------
  |  Branch (717:9): [True: 25, False: 1.92k]
  ------------------
  718|     25|            hInfo->num_front_channels = 3;
  719|     25|            hInfo->num_back_channels = 2;
  720|     25|            hInfo->num_lfe_channels = 1;
  721|     25|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|     25|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  722|     25|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|     25|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  723|     25|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|     25|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  724|     25|            hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|     25|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  725|     25|            hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|     25|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  726|     25|            hInfo->channel_position[5] = LFE_CHANNEL;
  ------------------
  |  |  122|     25|#define LFE_CHANNEL          (9)
  ------------------
  727|     25|            break;
  728|    281|        case 7:
  ------------------
  |  Branch (728:9): [True: 281, False: 1.66k]
  ------------------
  729|    281|            hInfo->num_front_channels = 3;
  730|    281|            hInfo->num_side_channels = 2;
  731|    281|            hInfo->num_back_channels = 2;
  732|    281|            hInfo->num_lfe_channels = 1;
  733|    281|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    281|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  734|    281|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    281|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  735|    281|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    281|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  736|    281|            hInfo->channel_position[3] = SIDE_CHANNEL_LEFT;
  ------------------
  |  |  117|    281|#define SIDE_CHANNEL_LEFT    (4)
  ------------------
  737|    281|            hInfo->channel_position[4] = SIDE_CHANNEL_RIGHT;
  ------------------
  |  |  118|    281|#define SIDE_CHANNEL_RIGHT   (5)
  ------------------
  738|    281|            hInfo->channel_position[5] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    281|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  739|    281|            hInfo->channel_position[6] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|    281|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  740|    281|            hInfo->channel_position[7] = LFE_CHANNEL;
  ------------------
  |  |  122|    281|#define LFE_CHANNEL          (9)
  ------------------
  741|    281|            break;
  742|     34|        default: /* channelConfiguration == 0 || channelConfiguration > 7 */
  ------------------
  |  Branch (742:9): [True: 34, False: 1.91k]
  ------------------
  743|     34|            {
  744|     34|                uint8_t i;
  745|     34|                uint8_t ch = hDecoder->fr_channels - hDecoder->has_lfe;
  746|     34|                if (ch & 1) /* there's either a center front or a center back channel */
  ------------------
  |  Branch (746:21): [True: 0, False: 34]
  ------------------
  747|      0|                {
  748|      0|                    uint8_t ch1 = (ch-1)/2;
  749|      0|                    if (hDecoder->first_syn_ele == ID_SCE)
  ------------------
  |  |   86|      0|#define ID_SCE 0x0
  ------------------
  |  Branch (749:25): [True: 0, False: 0]
  ------------------
  750|      0|                    {
  751|      0|                        hInfo->num_front_channels = ch1 + 1;
  752|      0|                        hInfo->num_back_channels = ch1;
  753|      0|                        hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|      0|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  754|      0|                        for (i = 1; i <= ch1; i+=2)
  ------------------
  |  Branch (754:37): [True: 0, False: 0]
  ------------------
  755|      0|                        {
  756|      0|                            hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|      0|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  757|      0|                            hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|      0|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  758|      0|                        }
  759|      0|                        for (i = ch1+1; i < ch; i+=2)
  ------------------
  |  Branch (759:41): [True: 0, False: 0]
  ------------------
  760|      0|                        {
  761|      0|                            hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|      0|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  762|      0|                            hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|      0|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  763|      0|                        }
  764|      0|                    } else {
  765|      0|                        hInfo->num_front_channels = ch1;
  766|      0|                        hInfo->num_back_channels = ch1 + 1;
  767|      0|                        for (i = 0; i < ch1; i+=2)
  ------------------
  |  Branch (767:37): [True: 0, False: 0]
  ------------------
  768|      0|                        {
  769|      0|                            hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|      0|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  770|      0|                            hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|      0|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  771|      0|                        }
  772|      0|                        for (i = ch1; i < ch-1; i+=2)
  ------------------
  |  Branch (772:39): [True: 0, False: 0]
  ------------------
  773|      0|                        {
  774|      0|                            hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|      0|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  775|      0|                            hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|      0|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  776|      0|                        }
  777|      0|                        hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|      0|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  778|      0|                    }
  779|     34|                } else {
  780|     34|                    uint8_t ch1 = (ch)/2;
  781|     34|                    hInfo->num_front_channels = ch1;
  782|     34|                    hInfo->num_back_channels = ch1;
  783|     34|                    if (ch1 & 1)
  ------------------
  |  Branch (783:25): [True: 21, False: 13]
  ------------------
  784|     21|                    {
  785|     21|                        hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|     21|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  786|    143|                        for (i = 1; i <= ch1; i+=2)
  ------------------
  |  Branch (786:37): [True: 122, False: 21]
  ------------------
  787|    122|                        {
  788|    122|                            hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    122|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  789|    122|                            hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    122|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  790|    122|                        }
  791|    122|                        for (i = ch1+1; i < ch-1; i+=2)
  ------------------
  |  Branch (791:41): [True: 101, False: 21]
  ------------------
  792|    101|                        {
  793|    101|                            hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    101|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  794|    101|                            hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|    101|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  795|    101|                        }
  796|     21|                        hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|     21|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  797|     21|                    } else {
  798|     93|                        for (i = 0; i < ch1; i+=2)
  ------------------
  |  Branch (798:37): [True: 80, False: 13]
  ------------------
  799|     80|                        {
  800|     80|                            hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|     80|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  801|     80|                            hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|     80|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  802|     80|                        }
  803|     93|                        for (i = ch1; i < ch; i+=2)
  ------------------
  |  Branch (803:39): [True: 80, False: 13]
  ------------------
  804|     80|                        {
  805|     80|                            hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|     80|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  806|     80|                            hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|     80|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  807|     80|                        }
  808|     13|                    }
  809|     34|                }
  810|     34|                hInfo->num_lfe_channels = hDecoder->has_lfe;
  811|     34|                for (i = ch; i < hDecoder->fr_channels; i++)
  ------------------
  |  Branch (811:30): [True: 0, False: 34]
  ------------------
  812|      0|                {
  813|      0|                    hInfo->channel_position[i] = LFE_CHANNEL;
  ------------------
  |  |  122|      0|#define LFE_CHANNEL          (9)
  ------------------
  814|      0|                }
  815|     34|            }
  816|     34|            break;
  817|  1.94k|        }
  818|  1.94k|    }
  819|  2.10k|}

drc_init:
   39|  6.77k|{
   40|  6.77k|    drc_info *drc = (drc_info*)faad_malloc(sizeof(drc_info));
   41|  6.77k|    memset(drc, 0, sizeof(drc_info));
   42|       |
   43|  6.77k|    drc->ctrl1 = cut;
   44|  6.77k|    drc->ctrl2 = boost;
   45|       |
   46|  6.77k|    drc->num_bands = 1;
   47|  6.77k|    drc->band_top[0] = 1024/4 - 1;
   48|  6.77k|    drc->dyn_rng_sgn[0] = 1;
   49|  6.77k|    drc->dyn_rng_ctl[0] = 0;
   50|       |
   51|  6.77k|    return drc;
   52|  6.77k|}
drc_end:
   55|  6.77k|{
   56|  6.77k|    if (drc) faad_free(drc);
  ------------------
  |  Branch (56:9): [True: 6.77k, False: 0]
  ------------------
   57|  6.77k|}

drm_ps_data:
  445|   598k|{
  446|   598k|    uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
  447|       |
  448|   598k|    ps->drm_ps_data_available = 1;
  449|       |
  450|   598k|    ps->bs_enable_sa = faad_get1bit(ld);
  451|   598k|    ps->bs_enable_pan = faad_get1bit(ld);
  452|       |
  453|   598k|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (453:9): [True: 13.0k, False: 585k]
  ------------------
  454|  13.0k|    {
  455|  13.0k|        drm_ps_sa_element(ps, ld);
  456|  13.0k|    }
  457|       |
  458|   598k|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (458:9): [True: 9.50k, False: 589k]
  ------------------
  459|  9.50k|    {
  460|  9.50k|        drm_ps_pan_element(ps, ld);
  461|  9.50k|    }
  462|       |
  463|   598k|    bits = (uint16_t)faad_get_processed_bits(ld) - bits;
  464|       |
  465|   598k|    return bits;
  466|   598k|}
drm_ps_init:
  890|  4.74k|{
  891|  4.74k|    drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info));
  892|       |
  893|  4.74k|    memset(ps, 0, sizeof(drm_ps_info));
  894|       |
  895|  4.74k|    return ps;
  896|  4.74k|}
drm_ps_free:
  899|  4.74k|{
  900|  4.74k|    faad_free(ps);
  901|  4.74k|}
drm_ps_decode:
  905|    210|{
  906|    210|    if (ps == NULL)
  ------------------
  |  Branch (906:9): [True: 4, False: 206]
  ------------------
  907|      4|    {
  908|      4|        memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
  909|      4|        return 0;
  910|      4|    }
  911|       |
  912|    206|    if (!ps->drm_ps_data_available && !guess)
  ------------------
  |  Branch (912:9): [True: 12, False: 194]
  |  Branch (912:39): [True: 1, False: 11]
  ------------------
  913|      1|    {
  914|      1|        memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
  915|      1|        memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index));
  916|      1|        memset(ps->g_prev_pan_index, 0, sizeof(ps->g_prev_pan_index));
  917|      1|        return 0;
  918|      1|    }
  919|       |
  920|       |    /* if SBR CRC doesn't match out, we can assume decode errors to start with,
  921|       |       and we'll guess what the parameters should be */
  922|    205|    if (!guess)
  ------------------
  |  Branch (922:9): [True: 108, False: 97]
  ------------------
  923|    108|    {
  924|    108|        ps->sa_decode_error = 0;
  925|    108|        ps->pan_decode_error = 0;
  926|    108|        drm_ps_delta_decode(ps);
  927|    108|    } else
  928|     97|    {
  929|     97|        ps->sa_decode_error = 1;
  930|     97|        ps->pan_decode_error = 1;
  931|       |        /* don't even bother decoding */
  932|     97|    }
  933|       |
  934|    205|    ps->drm_ps_data_available = 0;
  935|       |
  936|    205|    drm_calc_sa_side_signal(ps, X_left);
  937|    205|    drm_add_ambiance(ps, X_left, X_right);
  938|       |
  939|    205|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (939:9): [True: 79, False: 126]
  ------------------
  940|     79|    {
  941|     79|        ps->g_last_had_sa = 1;
  942|       |
  943|     79|        memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS);
  ------------------
  |  |   41|     79|#define DRM_NUM_SA_BANDS         8
  ------------------
  944|       |
  945|    126|    } else {
  946|    126|        ps->g_last_had_sa = 0;
  947|    126|    }
  948|       |
  949|    205|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (949:9): [True: 145, False: 60]
  ------------------
  950|    145|    {
  951|    145|        drm_add_pan(ps, X_left, X_right);
  952|       |
  953|    145|        ps->g_last_had_pan = 1;
  954|       |
  955|    145|        memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
  ------------------
  |  |   42|    145|#define DRM_NUM_PAN_BANDS       20
  ------------------
  956|       |
  957|    145|    } else {
  958|     60|        ps->g_last_had_pan = 0;
  959|     60|    }
  960|       |
  961|       |
  962|    205|    return 0;
  963|    206|}
drm_dec.c:drm_ps_sa_element:
  469|  13.0k|{
  470|  13.0k|    drm_ps_huff_tab huff;
  471|  13.0k|    uint8_t band;
  472|       |
  473|  13.0k|    ps->bs_sa_dt_flag = faad_get1bit(ld);
  474|  13.0k|    if (ps->bs_sa_dt_flag)
  ------------------
  |  Branch (474:9): [True: 5.21k, False: 7.79k]
  ------------------
  475|  5.21k|    {
  476|  5.21k|        huff = t_huffman_sa;
  477|  7.79k|    } else {
  478|  7.79k|        huff = f_huffman_sa;
  479|  7.79k|    }
  480|       |
  481|   117k|    for (band = 0; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|   117k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (481:20): [True: 104k, False: 13.0k]
  ------------------
  482|   104k|    {
  483|   104k|        ps->bs_sa_data[band] = huff_dec(ld, huff);
  484|   104k|    }
  485|  13.0k|}
drm_dec.c:huff_dec:
  508|   294k|{
  509|   294k|    uint8_t bit;
  510|   294k|    int8_t index = 0;
  511|       |
  512|   839k|    while (index >= 0)
  ------------------
  |  Branch (512:12): [True: 545k, False: 294k]
  ------------------
  513|   545k|    {
  514|   545k|        bit = (uint8_t)faad_get1bit(ld);
  515|   545k|        index = huff[index][bit];
  516|   545k|    }
  517|       |
  518|   294k|    return index + 15;
  519|   294k|}
drm_dec.c:drm_ps_pan_element:
  488|  9.50k|{
  489|  9.50k|    drm_ps_huff_tab huff;
  490|  9.50k|    uint8_t band;
  491|       |
  492|  9.50k|    ps->bs_pan_dt_flag = faad_get1bit(ld);
  493|  9.50k|    if (ps->bs_pan_dt_flag)
  ------------------
  |  Branch (493:9): [True: 2.99k, False: 6.51k]
  ------------------
  494|  2.99k|    {
  495|  2.99k|        huff = t_huffman_pan;
  496|  6.51k|    } else {
  497|  6.51k|        huff = f_huffman_pan;
  498|  6.51k|    }
  499|       |
  500|   199k|    for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|   199k|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (500:20): [True: 190k, False: 9.50k]
  ------------------
  501|   190k|    {
  502|   190k|        ps->bs_pan_data[band] = huff_dec(ld, huff);
  503|   190k|    }
  504|  9.50k|}
drm_dec.c:drm_ps_delta_decode:
  551|    108|{
  552|    108|    uint8_t band;
  553|       |
  554|    108|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (554:9): [True: 97, False: 11]
  ------------------
  555|     97|    {
  556|     97|        if (ps->bs_sa_dt_flag && !ps->g_last_had_sa)
  ------------------
  |  Branch (556:13): [True: 39, False: 58]
  |  Branch (556:34): [True: 24, False: 15]
  ------------------
  557|     24|        {
  558|       |            /* wait until we get a DT frame */
  559|     24|            ps->bs_enable_sa = 0;
  560|     73|        } else if (ps->bs_sa_dt_flag) {
  ------------------
  |  Branch (560:20): [True: 15, False: 58]
  ------------------
  561|       |            /* DT frame, we have a last frame, so we can decode */
  562|     15|            ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]);
  563|     58|        } else {
  564|       |            /* DF always decodable */
  565|     58|            ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]);
  566|     58|        }
  567|       |
  568|    776|        for (band = 1; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|    776|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (568:24): [True: 679, False: 97]
  ------------------
  569|    679|        {
  570|    679|            if (ps->bs_sa_dt_flag && ps->g_last_had_sa)
  ------------------
  |  Branch (570:17): [True: 273, False: 406]
  |  Branch (570:38): [True: 105, False: 168]
  ------------------
  571|    105|            {
  572|    105|                ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]);
  573|    574|            } else if (!ps->bs_sa_dt_flag) {
  ------------------
  |  Branch (573:24): [True: 406, False: 168]
  ------------------
  574|    406|                ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]);
  575|    406|            }
  576|    679|        }
  577|     97|    }
  578|       |
  579|       |    /* An error during SA decoding implies PAN data will be undecodable, too */
  580|       |    /* Also, we don't like on/off switching in PS, so we force to last settings */
  581|    108|    if (ps->sa_decode_error) {
  ------------------
  |  Branch (581:9): [True: 58, False: 50]
  ------------------
  582|     58|        ps->pan_decode_error = 1;
  583|     58|        ps->bs_enable_pan = ps->g_last_had_pan;
  584|     58|        ps->bs_enable_sa = ps->g_last_had_sa;
  585|     58|    }
  586|       |
  587|       |
  588|    108|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (588:9): [True: 43, False: 65]
  ------------------
  589|     43|    {
  590|     43|        if (ps->sa_decode_error) {
  ------------------
  |  Branch (590:13): [True: 28, False: 15]
  ------------------
  591|    252|            for (band = 0; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|    252|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (591:28): [True: 224, False: 28]
  ------------------
  592|    224|            {
  593|    224|                ps->g_sa_index[band] = ps->g_last_good_sa_index[band];
  594|    224|            }
  595|     28|        } else {
  596|    135|            for (band = 0; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|    135|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (596:28): [True: 120, False: 15]
  ------------------
  597|    120|            {
  598|    120|                ps->g_last_good_sa_index[band] = ps->g_sa_index[band];
  599|    120|            }
  600|     15|        }
  601|     43|    }
  602|       |
  603|    108|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (603:9): [True: 91, False: 17]
  ------------------
  604|     91|    {
  605|     91|        if (ps->bs_pan_dt_flag && !ps->g_last_had_pan)
  ------------------
  |  Branch (605:13): [True: 29, False: 62]
  |  Branch (605:35): [True: 3, False: 26]
  ------------------
  606|      3|        {
  607|      3|            ps->bs_enable_pan = 0;
  608|     88|        }  else if (ps->bs_pan_dt_flag) {
  ------------------
  |  Branch (608:21): [True: 26, False: 62]
  ------------------
  609|     26|            ps->g_pan_index[0] = pan_delta_clip(ps,  ps->g_prev_pan_index[0]+ps->bs_pan_data[0]);
  610|     62|        } else {
  611|     62|            ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]);
  612|     62|        }
  613|       |
  614|  1.82k|        for (band = 1; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|  1.82k|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (614:24): [True: 1.72k, False: 91]
  ------------------
  615|  1.72k|        {
  616|  1.72k|            if (ps->bs_pan_dt_flag && ps->g_last_had_pan)
  ------------------
  |  Branch (616:17): [True: 551, False: 1.17k]
  |  Branch (616:39): [True: 494, False: 57]
  ------------------
  617|    494|            {
  618|    494|                ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]);
  619|  1.23k|            } else if (!ps->bs_pan_dt_flag) {
  ------------------
  |  Branch (619:24): [True: 1.17k, False: 57]
  ------------------
  620|  1.17k|                ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]);
  621|  1.17k|            }
  622|  1.72k|        }
  623|       |
  624|     91|        if (ps->pan_decode_error) {
  ------------------
  |  Branch (624:13): [True: 57, False: 34]
  ------------------
  625|  1.19k|            for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|  1.19k|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (625:28): [True: 1.14k, False: 57]
  ------------------
  626|  1.14k|            {
  627|  1.14k|                ps->g_pan_index[band] = ps->g_last_good_pan_index[band];
  628|  1.14k|            }
  629|     57|        } else {
  630|    714|            for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|    714|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (630:28): [True: 680, False: 34]
  ------------------
  631|    680|            {
  632|    680|                ps->g_last_good_pan_index[band] = ps->g_pan_index[band];
  633|    680|            }
  634|     34|        }
  635|     91|    }
  636|    108|}
drm_dec.c:sa_delta_clip:
  523|    584|{
  524|    584|    if (i < 0) {
  ------------------
  |  Branch (524:9): [True: 161, False: 423]
  ------------------
  525|       |      /*  printf(" SAminclip %d", i); */
  526|    161|        ps->sa_decode_error = 1;
  527|    161|        return 0;
  528|    423|    } else if (i > 7) {
  ------------------
  |  Branch (528:16): [True: 60, False: 363]
  ------------------
  529|       |     /*   printf(" SAmaxclip %d", i); */
  530|     60|        ps->sa_decode_error = 1;
  531|     60|        return 7;
  532|     60|    } else
  533|    363|        return i;
  534|    584|}
drm_dec.c:pan_delta_clip:
  537|  1.76k|{
  538|  1.76k|    if (i < -7) {
  ------------------
  |  Branch (538:9): [True: 168, False: 1.59k]
  ------------------
  539|       |        /* printf(" PANminclip %d", i); */
  540|    168|        ps->pan_decode_error = 1;
  541|    168|        return -7;
  542|  1.59k|    } else if (i > 7) {
  ------------------
  |  Branch (542:16): [True: 126, False: 1.46k]
  ------------------
  543|       |       /* printf(" PANmaxclip %d", i);  */
  544|    126|        ps->pan_decode_error = 1;
  545|    126|        return 7;
  546|    126|    } else
  547|  1.46k|        return i;
  548|  1.76k|}
drm_dec.c:drm_calc_sa_side_signal:
  639|    205|{
  640|    205|    uint8_t s, b, k;
  641|    205|    complex_t qfrac, tmp0, tmp, in, R0;
  642|    205|    real_t peakdiff;
  643|    205|    real_t nrg;
  644|    205|    real_t power;
  645|    205|    real_t transratio;
  646|    205|    real_t new_delay_slopes[NUM_OF_LINKS];
  647|    205|    uint8_t temp_delay_ser[NUM_OF_LINKS];
  648|    205|    complex_t Phi_Fract;
  649|       |#ifdef FIXED_POINT
  650|       |    uint32_t in_re, in_im;
  651|       |#endif
  652|       |
  653|  4.92k|    for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
  ------------------
  |  |   41|  4.92k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (653:17): [True: 4.71k, False: 205]
  ------------------
  654|  4.71k|    {
  655|       |        /* set delay indices */
  656|  18.8k|        for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|  18.8k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (656:21): [True: 14.1k, False: 4.71k]
  ------------------
  657|  14.1k|            temp_delay_ser[k] = ps->delay_buf_index_ser[k];
  658|       |
  659|  4.71k|        RE(Phi_Fract) = RE(Phi_Fract_Qmf[b]);
  ------------------
  |  |  391|  4.71k|#define RE(A) (A)[0]
  ------------------
                      RE(Phi_Fract) = RE(Phi_Fract_Qmf[b]);
  ------------------
  |  |  391|  4.71k|#define RE(A) (A)[0]
  ------------------
  660|  4.71k|        IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
  ------------------
  |  |  392|  4.71k|#define IM(A) (A)[1]
  ------------------
                      IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
  ------------------
  |  |  392|  4.71k|#define IM(A) (A)[1]
  ------------------
  661|       |
  662|   146k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|   146k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (662:21): [True: 141k, False: 4.71k]
  ------------------
  663|   141k|        {
  664|   141k|            const real_t gamma = REAL_CONST(1.5);
  ------------------
  |  |  288|   141k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  665|   141k|            const real_t sigma = REAL_CONST(1.5625);
  ------------------
  |  |  288|   141k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  666|       |
  667|   141k|            RE(in) = QMF_RE(X[s][b]);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          RE(in) = QMF_RE(X[s][b]);
  ------------------
  |  |  168|   141k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   141k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  668|   141k|            IM(in) = QMF_IM(X[s][b]);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          IM(in) = QMF_IM(X[s][b]);
  ------------------
  |  |  169|   141k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   141k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  669|       |
  670|       |#ifdef FIXED_POINT
  671|       |            /* NOTE: all input is scaled by 2^(-5) because of fixed point QMF
  672|       |            * meaning that P will be scaled by 2^(-10) compared to floating point version
  673|       |            */
  674|       |            in_re = ((abs(RE(in))+(1<<(REAL_BITS-1)))>>REAL_BITS);
  675|       |            in_im = ((abs(IM(in))+(1<<(REAL_BITS-1)))>>REAL_BITS);
  676|       |            power = in_re*in_re + in_im*in_im;
  677|       |#else
  678|   141k|            power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in));
  ------------------
  |  |  284|   141k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                          power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in));
  ------------------
  |  |  284|   141k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  679|   141k|#endif
  680|       |
  681|   141k|            ps->peakdecay_fast[b] = MUL_F(ps->peakdecay_fast[b], peak_decay);
  ------------------
  |  |  286|   141k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  682|   141k|            if (ps->peakdecay_fast[b] < power)
  ------------------
  |  Branch (682:17): [True: 10.7k, False: 130k]
  ------------------
  683|  10.7k|                ps->peakdecay_fast[b] = power;
  684|       |
  685|   141k|            peakdiff = ps->prev_peakdiff[b];
  686|   141k|            peakdiff += MUL_F((ps->peakdecay_fast[b] - power - ps->prev_peakdiff[b]), smooth_coeff);
  ------------------
  |  |  286|   141k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  687|   141k|            ps->prev_peakdiff[b] = peakdiff;
  688|       |
  689|   141k|            nrg = ps->prev_nrg[b];
  690|   141k|            nrg += MUL_F((power - ps->prev_nrg[b]), smooth_coeff);
  ------------------
  |  |  286|   141k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  691|   141k|            ps->prev_nrg[b] = nrg;
  692|       |
  693|   141k|            if (MUL_R(peakdiff, gamma) <= nrg) {
  ------------------
  |  |  284|   141k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  |  Branch (693:17): [True: 131k, False: 9.73k]
  ------------------
  694|   131k|                transratio = sigma;
  695|   131k|            } else {
  696|  9.73k|                transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma);
  ------------------
  |  |  284|  9.73k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  697|  9.73k|            }
  698|       |
  699|   565k|            for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|   565k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (699:25): [True: 424k, False: 141k]
  ------------------
  700|   424k|            {
  701|   424k|                new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]);
  ------------------
  |  |  286|   424k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  702|   424k|            }
  703|       |
  704|   141k|            RE(tmp0) = RE(ps->d_buff[0][b]);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          RE(tmp0) = RE(ps->d_buff[0][b]);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
  705|   141k|            IM(tmp0) = IM(ps->d_buff[0][b]);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          IM(tmp0) = IM(ps->d_buff[0][b]);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
  706|       |
  707|   141k|            RE(ps->d_buff[0][b]) = RE(ps->d_buff[1][b]);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->d_buff[0][b]) = RE(ps->d_buff[1][b]);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
  708|   141k|            IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
  709|       |
  710|   141k|            RE(ps->d_buff[1][b]) = RE(in);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->d_buff[1][b]) = RE(in);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
  711|   141k|            IM(ps->d_buff[1][b]) = IM(in);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          IM(ps->d_buff[1][b]) = IM(in);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
  712|       |
  713|   141k|            ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
  714|       |
  715|   141k|            RE(R0) = RE(tmp);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
                          RE(R0) = RE(tmp);
  ------------------
  |  |  391|   141k|#define RE(A) (A)[0]
  ------------------
  716|   141k|            IM(R0) = IM(tmp);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
                          IM(R0) = IM(tmp);
  ------------------
  |  |  392|   141k|#define IM(A) (A)[1]
  ------------------
  717|       |
  718|   565k|            for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|   565k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (718:25): [True: 424k, False: 141k]
  ------------------
  719|   424k|            {
  720|   424k|                RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
  721|   424k|                IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
  722|       |
  723|   424k|                RE(tmp0) = RE(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              RE(tmp0) = RE(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
  724|   424k|                IM(tmp0) = IM(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              IM(tmp0) = IM(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
  725|       |
  726|   424k|                ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
  727|       |
  728|   424k|                RE(tmp) += -MUL_F(new_delay_slopes[k], RE(R0));
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              RE(tmp) += -MUL_F(new_delay_slopes[k], RE(R0));
  ------------------
  |  |  286|   424k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  729|   424k|                IM(tmp) += -MUL_F(new_delay_slopes[k], IM(R0));
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              IM(tmp) += -MUL_F(new_delay_slopes[k], IM(R0));
  ------------------
  |  |  286|   424k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  730|       |
  731|   424k|                RE(ps->d2_buff[k][temp_delay_ser[k]][b]) = RE(R0) + MUL_F(new_delay_slopes[k], RE(tmp));
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              RE(ps->d2_buff[k][temp_delay_ser[k]][b]) = RE(R0) + MUL_F(new_delay_slopes[k], RE(tmp));
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              RE(ps->d2_buff[k][temp_delay_ser[k]][b]) = RE(R0) + MUL_F(new_delay_slopes[k], RE(tmp));
  ------------------
  |  |  286|   424k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  732|   424k|                IM(ps->d2_buff[k][temp_delay_ser[k]][b]) = IM(R0) + MUL_F(new_delay_slopes[k], IM(tmp));
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->d2_buff[k][temp_delay_ser[k]][b]) = IM(R0) + MUL_F(new_delay_slopes[k], IM(tmp));
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->d2_buff[k][temp_delay_ser[k]][b]) = IM(R0) + MUL_F(new_delay_slopes[k], IM(tmp));
  ------------------
  |  |  286|   424k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  733|       |
  734|   424k|                RE(R0) = RE(tmp);
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
                              RE(R0) = RE(tmp);
  ------------------
  |  |  391|   424k|#define RE(A) (A)[0]
  ------------------
  735|   424k|                IM(R0) = IM(tmp);
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
                              IM(R0) = IM(tmp);
  ------------------
  |  |  392|   424k|#define IM(A) (A)[1]
  ------------------
  736|   424k|            }
  737|       |
  738|   141k|            QMF_RE(ps->SA[s][b]) = MUL_R(RE(R0), transratio);
  ------------------
  |  |  168|   141k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   141k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(ps->SA[s][b]) = MUL_R(RE(R0), transratio);
  ------------------
  |  |  284|   141k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  739|   141k|            QMF_IM(ps->SA[s][b]) = MUL_R(IM(R0), transratio);
  ------------------
  |  |  169|   141k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   141k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(ps->SA[s][b]) = MUL_R(IM(R0), transratio);
  ------------------
  |  |  284|   141k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  740|       |
  741|   565k|            for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|   565k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (741:25): [True: 424k, False: 141k]
  ------------------
  742|   424k|            {
  743|   424k|                if (++temp_delay_ser[k] >= delay_length[k])
  ------------------
  |  Branch (743:21): [True: 110k, False: 314k]
  ------------------
  744|   110k|                    temp_delay_ser[k] = 0;
  745|   424k|            }
  746|   141k|        }
  747|  4.71k|    }
  748|       |
  749|    820|    for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|    820|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (749:17): [True: 615, False: 205]
  ------------------
  750|    615|        ps->delay_buf_index_ser[k] = temp_delay_ser[k];
  751|    205|}
drm_dec.c:drm_add_ambiance:
  754|    205|{
  755|    205|    uint8_t s, b, ifreq, qclass;
  756|    205|    real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND];
  757|    205|    real_t new_dir_map, new_sa_map;
  758|       |
  759|    205|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (759:9): [True: 79, False: 126]
  ------------------
  760|     79|    {
  761|       |        /* Instead of dequantization and mapping, we use an inverse mapping
  762|       |           to look up all the values we need */
  763|  1.89k|        for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
  ------------------
  |  |   41|  1.89k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (763:21): [True: 1.81k, False: 79]
  ------------------
  764|  1.81k|        {
  765|  1.81k|            const real_t inv_f_num_of_subsamples = FRAC_CONST(0.03333333333);
  ------------------
  |  |  291|  1.81k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  766|       |
  767|  1.81k|            ifreq = sa_inv_freq[b];
  768|  1.81k|            qclass = (b != 0);
  769|       |
  770|  1.81k|            sa_map[b]  = sa_quant[ps->g_prev_sa_index[ifreq]][qclass];
  771|  1.81k|            new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass];
  772|       |
  773|  1.81k|            k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b]));
  ------------------
  |  |  286|  1.81k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  774|       |
  775|  1.81k|            sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass];
  776|  1.81k|            new_dir_map   = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass];
  777|       |
  778|  1.81k|            k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b]));
  ------------------
  |  |  286|  1.81k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  779|       |
  780|  1.81k|        }
  781|       |
  782|  2.44k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|  2.44k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (782:21): [True: 2.37k, False: 79]
  ------------------
  783|  2.37k|        {
  784|  56.8k|            for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
  ------------------
  |  |   41|  56.8k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (784:25): [True: 54.5k, False: 2.37k]
  ------------------
  785|  54.5k|            {
  786|  54.5k|                QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  168|  54.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  54.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  787|  54.5k|                QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  169|  54.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  54.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  788|  54.5k|                QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  168|  54.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  54.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  789|  54.5k|                QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  169|  54.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  54.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
  ------------------
  |  |  286|  54.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  790|       |
  791|  54.5k|                sa_map[b]     += k_sa_map[b];
  792|  54.5k|                sa_dir_map[b] += k_sa_dir_map[b];
  793|  54.5k|            }
  794|  99.5k|            for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   41|  2.37k|#define DRM_NUM_SA_BANDS         8
  ------------------
                          for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|  99.5k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (794:55): [True: 97.1k, False: 2.37k]
  ------------------
  795|  97.1k|            {
  796|  97.1k|                QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  797|  97.1k|                QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  798|  97.1k|            }
  799|  2.37k|        }
  800|     79|    }
  801|    126|    else {
  802|  3.90k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|  3.90k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (802:21): [True: 3.78k, False: 126]
  ------------------
  803|  3.78k|        {
  804|   245k|            for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|   245k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (804:25): [True: 241k, False: 3.78k]
  ------------------
  805|   241k|            {
  806|   241k|                QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   241k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   241k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   241k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   241k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  807|   241k|                QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   241k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   241k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   241k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   241k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  808|   241k|            }
  809|  3.78k|        }
  810|    126|    }
  811|    205|}
drm_dec.c:drm_add_pan:
  814|    145|{
  815|    145|    uint8_t s, b, qclass, ifreq;
  816|    145|    real_t tmp, coeff1, coeff2;
  817|    145|    real_t pan_base[MAX_PAN_BAND];
  818|    145|    real_t pan_delta[MAX_PAN_BAND];
  819|    145|    qmf_t temp_l, temp_r;
  ------------------
  |  |  167|    145|#define qmf_t complex_t
  ------------------
  820|       |
  821|    145|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (821:9): [True: 145, False: 0]
  ------------------
  822|    145|    {
  823|  9.42k|        for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|  9.42k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (823:21): [True: 9.28k, False: 145]
  ------------------
  824|  9.28k|        {
  825|       |            /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an
  826|       |               inverse mapping 64->20 and look up the 2^G(x,y) values directly */
  827|  9.28k|            ifreq = pan_inv_freq[b];
  828|  9.28k|            qclass = pan_quant_class[ifreq];
  829|       |
  830|  9.28k|            if (ps->g_prev_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (830:17): [True: 8.73k, False: 544]
  ------------------
  831|  8.73k|            {
  832|  8.73k|                pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass];
  833|  8.73k|            } else {
  834|    544|                pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass];
  835|    544|            }
  836|       |
  837|       |            /* 2^((a-b)/30) = 2^(a/30) * 1/(2^(b/30)) */
  838|       |            /* a en b can be negative so we may need to inverse parts */
  839|  9.28k|            if (ps->g_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (839:17): [True: 7.89k, False: 1.38k]
  ------------------
  840|  7.89k|            {
  841|  7.89k|                if (ps->g_prev_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (841:21): [True: 7.79k, False: 98]
  ------------------
  842|  7.79k|                {
  843|  7.79k|                    pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|  7.79k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  844|  7.79k|                                         pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
  845|  7.79k|                } else {
  846|     98|                    pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|     98|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  847|     98|                                         pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
  848|     98|                }
  849|  7.89k|            } else {
  850|  1.38k|                if (ps->g_prev_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (850:21): [True: 939, False: 446]
  ------------------
  851|    939|                {
  852|    939|                    pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|    939|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  853|    939|                                         pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
  854|    939|                } else {
  855|    446|                    pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|    446|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  856|    446|                                         pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
  857|    446|                }
  858|  1.38k|            }
  859|  9.28k|        }
  860|       |
  861|  4.49k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|  4.49k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (861:21): [True: 4.35k, False: 145]
  ------------------
  862|  4.35k|        {
  863|       |            /* PAN always uses all 64 channels */
  864|   282k|            for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|   282k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (864:25): [True: 278k, False: 4.35k]
  ------------------
  865|   278k|            {
  866|   278k|                tmp = pan_base[b];
  867|       |
  868|   278k|                coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp));
  ------------------
  |  |  161|   278k|#define DIV_R(A, B) ((A)/(B))
  ------------------
  869|   278k|                coeff1 = MUL_R(coeff2, tmp);
  ------------------
  |  |  284|   278k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  870|       |
  871|   278k|                QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   278k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   278k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   278k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   278k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  872|   278k|                QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   278k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   278k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   278k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   278k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  873|   278k|                QMF_RE(temp_r) = QMF_RE(X_right[s][b]);
  ------------------
  |  |  168|   278k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   278k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(temp_r) = QMF_RE(X_right[s][b]);
  ------------------
  |  |  168|   278k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   278k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  874|   278k|                QMF_IM(temp_r) = QMF_IM(X_right[s][b]);
  ------------------
  |  |  169|   278k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   278k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(temp_r) = QMF_IM(X_right[s][b]);
  ------------------
  |  |  169|   278k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   278k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  875|       |
  876|   278k|                QMF_RE(X_left[s][b]) = MUL_R(QMF_RE(temp_l), coeff1);
  ------------------
  |  |  168|   278k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   278k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_left[s][b]) = MUL_R(QMF_RE(temp_l), coeff1);
  ------------------
  |  |  284|   278k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  877|   278k|                QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
  ------------------
  |  |  169|   278k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   278k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
  ------------------
  |  |  284|   278k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  878|   278k|                QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
  ------------------
  |  |  168|   278k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   278k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
  ------------------
  |  |  284|   278k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  879|   278k|                QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
  ------------------
  |  |  169|   278k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   278k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
  ------------------
  |  |  284|   278k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  880|       |
  881|       |                /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */
  882|       |                /*                   ^^^^^^^^^^^^^^^ k times */
  883|   278k|                pan_base[b] = MUL_C(pan_base[b], pan_delta[b]);
  ------------------
  |  |  285|   278k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  884|   278k|            }
  885|  4.35k|        }
  886|    145|    }
  887|    145|}

filter_bank_init:
   49|  6.62k|{
   50|  6.62k|    uint16_t nshort = frame_len/8;
   51|       |#ifdef LD_DEC
   52|       |    uint16_t frame_len_ld = frame_len/2;
   53|       |#endif
   54|       |
   55|  6.62k|    fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
   56|  6.62k|    memset(fb, 0, sizeof(fb_info));
   57|       |
   58|       |    /* normal */
   59|  6.62k|    fb->mdct256 = faad_mdct_init(2*nshort);
   60|  6.62k|    fb->mdct2048 = faad_mdct_init(2*frame_len);
   61|       |#ifdef LD_DEC
   62|       |    /* LD */
   63|       |    fb->mdct1024 = faad_mdct_init(2*frame_len_ld);
   64|       |#endif
   65|       |
   66|  6.62k|#ifdef ALLOW_SMALL_FRAMELENGTH
   67|  6.62k|    if (frame_len == 1024)
  ------------------
  |  Branch (67:9): [True: 4.81k, False: 1.80k]
  ------------------
   68|  4.81k|    {
   69|  4.81k|#endif
   70|  4.81k|        fb->long_window[0]  = sine_long_1024;
   71|  4.81k|        fb->short_window[0] = sine_short_128;
   72|  4.81k|        fb->long_window[1]  = kbd_long_1024;
   73|  4.81k|        fb->short_window[1] = kbd_short_128;
   74|       |#ifdef LD_DEC
   75|       |        fb->ld_window[0] = sine_mid_512;
   76|       |        fb->ld_window[1] = ld_mid_512;
   77|       |#endif
   78|  4.81k|#ifdef ALLOW_SMALL_FRAMELENGTH
   79|  4.81k|    } else /* (frame_len == 960) */ {
   80|  1.80k|        fb->long_window[0]  = sine_long_960;
   81|  1.80k|        fb->short_window[0] = sine_short_120;
   82|  1.80k|        fb->long_window[1]  = kbd_long_960;
   83|  1.80k|        fb->short_window[1] = kbd_short_120;
   84|       |#ifdef LD_DEC
   85|       |        fb->ld_window[0] = sine_mid_480;
   86|       |        fb->ld_window[1] = ld_mid_480;
   87|       |#endif
   88|  1.80k|    }
   89|  6.62k|#endif
   90|       |
   91|  6.62k|    return fb;
   92|  6.62k|}
filter_bank_end:
   95|  6.77k|{
   96|  6.77k|    if (fb != NULL)
  ------------------
  |  Branch (96:9): [True: 6.62k, False: 149]
  ------------------
   97|  6.62k|    {
   98|       |#ifdef PROFILE
   99|       |        printf("FB:                 %I64d cycles\n", fb->cycles);
  100|       |#endif
  101|       |
  102|  6.62k|        faad_mdct_end(fb->mdct256);
  103|  6.62k|        faad_mdct_end(fb->mdct2048);
  104|       |#ifdef LD_DEC
  105|       |        faad_mdct_end(fb->mdct1024);
  106|       |#endif
  107|       |
  108|  6.62k|        faad_free(fb);
  109|  6.62k|    }
  110|  6.77k|}
ifilter_bank:
  168|   111k|{
  169|   111k|    int16_t i;
  170|   111k|    ALIGN real_t transf_buf[2*1024] = {0};
  171|       |
  172|   111k|    const real_t *window_long = NULL;
  173|   111k|    const real_t *window_long_prev = NULL;
  174|   111k|    const real_t *window_short = NULL;
  175|   111k|    const real_t *window_short_prev = NULL;
  176|       |
  177|   111k|    uint16_t nlong = frame_len;
  178|   111k|    uint16_t nshort = frame_len/8;
  179|   111k|    uint16_t trans = nshort/2;
  180|       |
  181|   111k|    uint16_t nflat_ls = (nlong-nshort)/2;
  182|       |
  183|       |#ifdef PROFILE
  184|       |    int64_t count = faad_get_ts();
  185|       |#endif
  186|       |
  187|       |    /* select windows of current frame and previous frame (Sine or KBD) */
  188|       |#ifdef LD_DEC
  189|       |    if (object_type == LD)
  190|       |    {
  191|       |        window_long       = fb->ld_window[window_shape];
  192|       |        window_long_prev  = fb->ld_window[window_shape_prev];
  193|       |    } else {
  194|       |#else
  195|   111k|        (void)object_type;
  196|   111k|#endif
  197|   111k|        window_long       = fb->long_window[window_shape];
  198|   111k|        window_long_prev  = fb->long_window[window_shape_prev];
  199|   111k|        window_short      = fb->short_window[window_shape];
  200|   111k|        window_short_prev = fb->short_window[window_shape_prev];
  201|       |#ifdef LD_DEC
  202|       |    }
  203|       |#endif
  204|       |
  205|       |#if 0
  206|       |    for (i = 0; i < 1024; i++)
  207|       |    {
  208|       |        printf("%d\n", freq_in[i]);
  209|       |    }
  210|       |#endif
  211|       |
  212|       |#if 0
  213|       |    printf("%d %d\n", window_sequence, window_shape);
  214|       |#endif
  215|       |
  216|   111k|    switch (window_sequence)
  ------------------
  |  Branch (216:13): [True: 111k, False: 0]
  ------------------
  217|   111k|    {
  218|  83.8k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   96|  83.8k|#define ONLY_LONG_SEQUENCE   0x0
  ------------------
  |  Branch (218:5): [True: 83.8k, False: 27.1k]
  ------------------
  219|       |        /* perform iMDCT */
  220|  83.8k|        imdct_long(fb, freq_in, transf_buf, 2*nlong);
  221|       |
  222|       |        /* add second half output of previous frame to windowed output of current frame */
  223|  21.2M|        for (i = 0; i < nlong; i+=4)
  ------------------
  |  Branch (223:21): [True: 21.2M, False: 83.8k]
  ------------------
  224|  21.2M|        {
  225|  21.2M|            time_out[i]   = overlap[i]   + MUL_F(transf_buf[i],window_long_prev[i]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  226|  21.2M|            time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  227|  21.2M|            time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  228|  21.2M|            time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  229|  21.2M|        }
  230|       |
  231|       |        /* window the second half and save as overlap for next frame */
  232|  21.2M|        for (i = 0; i < nlong; i+=4)
  ------------------
  |  Branch (232:21): [True: 21.2M, False: 83.8k]
  ------------------
  233|  21.2M|        {
  234|  21.2M|            overlap[i]   = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  235|  21.2M|            overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  236|  21.2M|            overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  237|  21.2M|            overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]);
  ------------------
  |  |  286|  21.2M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  238|  21.2M|        }
  239|  83.8k|        break;
  240|       |
  241|  5.37k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   97|  5.37k|#define LONG_START_SEQUENCE  0x1
  ------------------
  |  Branch (241:5): [True: 5.37k, False: 105k]
  ------------------
  242|       |        /* perform iMDCT */
  243|  5.37k|        imdct_long(fb, freq_in, transf_buf, 2*nlong);
  244|       |
  245|       |        /* add second half output of previous frame to windowed output of current frame */
  246|  1.34M|        for (i = 0; i < nlong; i+=4)
  ------------------
  |  Branch (246:21): [True: 1.34M, False: 5.37k]
  ------------------
  247|  1.34M|        {
  248|  1.34M|            time_out[i]   = overlap[i]   + MUL_F(transf_buf[i],window_long_prev[i]);
  ------------------
  |  |  286|  1.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  249|  1.34M|            time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
  ------------------
  |  |  286|  1.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  250|  1.34M|            time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
  ------------------
  |  |  286|  1.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  251|  1.34M|            time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
  ------------------
  |  |  286|  1.34M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  252|  1.34M|        }
  253|       |
  254|       |        /* window the second half and save as overlap for next frame */
  255|       |        /* construct second half window using padding with 1's and 0's */
  256|  2.35M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (256:21): [True: 2.34M, False: 5.37k]
  ------------------
  257|  2.34M|            overlap[i] = transf_buf[nlong+i];
  258|   675k|        for (i = 0; i < nshort; i++)
  ------------------
  |  Branch (258:21): [True: 670k, False: 5.37k]
  ------------------
  259|   670k|            overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
  ------------------
  |  |  286|   675k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  260|  2.35M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (260:21): [True: 2.34M, False: 5.37k]
  ------------------
  261|  2.34M|            overlap[nflat_ls+nshort+i] = 0;
  262|  5.37k|        break;
  263|       |
  264|  13.8k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   98|  13.8k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (264:5): [True: 13.8k, False: 97.1k]
  ------------------
  265|       |        /* perform iMDCT for each short block */
  266|  13.8k|        faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0);
  267|  13.8k|        faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1);
  268|  13.8k|        faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2);
  269|  13.8k|        faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3);
  270|  13.8k|        faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4);
  271|  13.8k|        faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5);
  272|  13.8k|        faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6);
  273|  13.8k|        faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7);
  274|       |
  275|       |        /* add second half output of previous frame to windowed output of current frame */
  276|  6.11M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (276:21): [True: 6.09M, False: 13.8k]
  ------------------
  277|  6.09M|            time_out[i] = overlap[i];
  278|  1.75M|        for(i = 0; i < nshort; i++)
  ------------------
  |  Branch (278:20): [True: 1.74M, False: 13.8k]
  ------------------
  279|  1.74M|        {
  280|  1.74M|            time_out[nflat_ls+         i] = overlap[nflat_ls+         i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  281|  1.74M|            time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  282|  1.74M|            time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  283|  1.74M|            time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  284|  1.74M|            if (i < trans)
  ------------------
  |  Branch (284:17): [True: 871k, False: 871k]
  ------------------
  285|   871k|                time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
  ------------------
  |  |  286|   871k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
  ------------------
  |  |  286|   871k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  286|  1.74M|        }
  287|       |
  288|       |        /* window the second half and save as overlap for next frame */
  289|  1.75M|        for(i = 0; i < nshort; i++)
  ------------------
  |  Branch (289:20): [True: 1.74M, False: 13.8k]
  ------------------
  290|  1.74M|        {
  291|  1.74M|            if (i >= trans)
  ------------------
  |  Branch (291:17): [True: 871k, False: 871k]
  ------------------
  292|   871k|                overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
  ------------------
  |  |  286|   871k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                              overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
  ------------------
  |  |  286|   871k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  293|  1.74M|            overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  294|  1.74M|            overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  295|  1.74M|            overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  296|  1.74M|            overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]);
  ------------------
  |  |  286|  1.74M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  297|  1.74M|        }
  298|  6.11M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (298:21): [True: 6.09M, False: 13.8k]
  ------------------
  299|  6.09M|            overlap[nflat_ls+nshort+i] = 0;
  300|  13.8k|        break;
  301|       |
  302|  7.93k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   99|  7.93k|#define LONG_STOP_SEQUENCE   0x3
  ------------------
  |  Branch (302:5): [True: 7.93k, False: 103k]
  ------------------
  303|       |        /* perform iMDCT */
  304|  7.93k|        imdct_long(fb, freq_in, transf_buf, 2*nlong);
  305|       |
  306|       |        /* add second half output of previous frame to windowed output of current frame */
  307|       |        /* construct first half window using padding with 1's and 0's */
  308|  3.52M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (308:21): [True: 3.51M, False: 7.93k]
  ------------------
  309|  3.51M|            time_out[i] = overlap[i];
  310|  1.01M|        for (i = 0; i < nshort; i++)
  ------------------
  |  Branch (310:21): [True: 1.00M, False: 7.93k]
  ------------------
  311|  1.00M|            time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]);
  ------------------
  |  |  286|  1.01M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  312|  3.52M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (312:21): [True: 3.51M, False: 7.93k]
  ------------------
  313|  3.51M|            time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i];
  314|       |
  315|       |        /* window the second half and save as overlap for next frame */
  316|  8.04M|        for (i = 0; i < nlong; i++)
  ------------------
  |  Branch (316:21): [True: 8.03M, False: 7.93k]
  ------------------
  317|  8.03M|            overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
  ------------------
  |  |  286|  8.04M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  318|  7.93k|		break;
  319|   111k|    }
  320|       |
  321|       |#if 0
  322|       |    for (i = 0; i < 1024; i++)
  323|       |    {
  324|       |        printf("%d\n", time_out[i]);
  325|       |        //printf("0x%.8X\n", time_out[i]);
  326|       |    }
  327|       |#endif
  328|       |
  329|       |
  330|       |#ifdef PROFILE
  331|       |    count = faad_get_ts() - count;
  332|       |    fb->cycles += count;
  333|       |#endif
  334|   111k|}
filtbank.c:imdct_long:
  113|  97.1k|{
  114|       |#ifdef LD_DEC
  115|       |    mdct_info *mdct = NULL;
  116|       |
  117|       |    switch (len)
  118|       |    {
  119|       |    case 2048:
  120|       |    case 1920:
  121|       |        mdct = fb->mdct2048;
  122|       |        break;
  123|       |    case 1024:
  124|       |    case 960:
  125|       |        mdct = fb->mdct1024;
  126|       |        break;
  127|       |    }
  128|       |
  129|       |    faad_imdct(mdct, in_data, out_data);
  130|       |#else
  131|  97.1k|    (void)len;
  132|  97.1k|    faad_imdct(fb->mdct2048, in_data, out_data);
  133|  97.1k|#endif
  134|  97.1k|}

reordered_spectral_data:
  212|  3.52k|{
  213|  3.52k|    uint16_t PCWs_done;
  214|  3.52k|    uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
  215|       |
  216|  3.52k|    codeword_t codeword[512];
  217|  3.52k|    bits_t segment[512];
  218|       |
  219|  3.52k|    uint16_t sp_offset[8];
  220|  3.52k|    uint16_t g, i, sortloop, set, bitsread;
  221|  3.52k|    /*uint16_t bitsleft, codewordsleft*/;
  222|  3.52k|    uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB;
  223|       |
  224|  3.52k|    const uint16_t nshort = hDecoder->frameLength/8;
  225|  3.52k|    const uint16_t sp_data_len = ics->length_of_reordered_spectral_data;
  226|       |
  227|  3.52k|    const uint8_t *PreSortCb;
  228|       |
  229|       |    /* no data (e.g. silence) */
  230|  3.52k|    if (sp_data_len == 0)
  ------------------
  |  Branch (230:9): [True: 2.64k, False: 874]
  ------------------
  231|  2.64k|        return 0;
  232|       |
  233|       |    /* since there is spectral data, at least one codeword has nonzero length */
  234|    874|    if (ics->length_of_longest_codeword == 0)
  ------------------
  |  Branch (234:9): [True: 18, False: 856]
  ------------------
  235|     18|        return 10;
  236|       |
  237|    856|    if (sp_data_len < ics->length_of_longest_codeword)
  ------------------
  |  Branch (237:9): [True: 3, False: 853]
  ------------------
  238|      3|        return 10;
  239|       |
  240|    853|    sp_offset[0] = 0;
  241|  1.20k|    for (g = 1; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (241:17): [True: 348, False: 853]
  ------------------
  242|    348|    {
  243|    348|        sp_offset[g] = sp_offset[g-1] + nshort*ics->window_group_length[g-1];
  244|    348|    }
  245|       |
  246|    853|    PCWs_done = 0;
  247|    853|    numberOfSegments = 0;
  248|    853|    numberOfCodewords = 0;
  249|    853|    bitsread = 0;
  250|       |
  251|       |    /* VCB11 code books in use */
  252|    853|    if (hDecoder->aacSectionDataResilienceFlag)
  ------------------
  |  Branch (252:9): [True: 704, False: 149]
  ------------------
  253|    704|    {
  254|    704|        PreSortCb = PreSortCB_ER;
  255|    704|        last_CB = NUM_CB_ER;
  ------------------
  |  |   57|    704|#define NUM_CB_ER   22
  ------------------
  256|    704|    } else
  257|    149|    {
  258|    149|        PreSortCb = PreSortCB_STD;
  259|    149|        last_CB = NUM_CB;
  ------------------
  |  |   56|    149|#define NUM_CB      6
  ------------------
  260|    149|    }
  261|       |
  262|       |    /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */
  263|  16.7k|    for (sortloop = 0; sortloop < last_CB; sortloop++)
  ------------------
  |  Branch (263:24): [True: 15.8k, False: 826]
  ------------------
  264|  15.8k|    {
  265|       |        /* select codebook to process this pass */
  266|  15.8k|        this_CB = PreSortCb[sortloop];
  267|       |
  268|       |        /* loop over sfbs */
  269|   176k|        for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (269:23): [True: 160k, False: 15.8k]
  ------------------
  270|   160k|        {
  271|       |            /* loop over all in this sfb, 4 lines per loop */
  272|   813k|            for (w_idx = 0; 4*w_idx < (min(ics->swb_offset[sfb+1], ics->swb_offset_max) - ics->swb_offset[sfb]); w_idx++)
  ------------------
  |  |   60|   813k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 796k, False: 16.6k]
  |  |  ------------------
  ------------------
  |  Branch (272:29): [True: 652k, False: 160k]
  ------------------
  273|   652k|            {
  274|  1.36M|                for(g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (274:28): [True: 710k, False: 652k]
  ------------------
  275|   710k|                {
  276|  6.28M|                    for (i = 0; i < ics->num_sec[g]; i++)
  ------------------
  |  Branch (276:33): [True: 5.57M, False: 710k]
  ------------------
  277|  5.57M|                    {
  278|       |                        /* check whether sfb used here is the one we want to process */
  279|  5.57M|                        if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb))
  ------------------
  |  Branch (279:29): [True: 3.82M, False: 1.75M]
  |  Branch (279:63): [True: 710k, False: 3.11M]
  ------------------
  280|   710k|                        {
  281|       |                            /* check whether codebook used here is the one we want to process */
  282|   710k|                            this_sec_CB = ics->sect_cb[g][i];
  283|       |
  284|   710k|                            if (is_good_cb(this_CB, this_sec_CB))
  ------------------
  |  Branch (284:33): [True: 39.0k, False: 671k]
  ------------------
  285|  39.0k|                            {
  286|       |                                /* precalculate some stuff */
  287|  39.0k|                                uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb];
  288|  39.0k|                                uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
  ------------------
  |  |  102|  39.0k|#define FIRST_PAIR_HCB 5
  ------------------
                                              uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
  ------------------
  |  |  104|  18.0k|#define QUAD_LEN       4
  ------------------
                                              uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
  ------------------
  |  |  105|  60.1k|#define PAIR_LEN       2
  ------------------
  |  Branch (288:47): [True: 18.0k, False: 21.0k]
  ------------------
  289|  39.0k|                                uint16_t group_cws_count = (4*ics->window_group_length[g])/inc;
  290|  39.0k|                                uint8_t segwidth = segmentWidth(this_sec_CB);
  ------------------
  |  |   73|  39.0k|#define segmentWidth(cb)    min(maxCwLen[cb], ics->length_of_longest_codeword)
  |  |  ------------------
  |  |  |  |   60|  39.0k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:20): [True: 14.7k, False: 24.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|  39.0k|                                uint16_t cws;
  292|       |
  293|       |                                /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */
  294|   130k|                                for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++)
  ------------------
  |  Branch (294:47): [True: 91.5k, False: 39.0k]
  |  Branch (294:74): [True: 91.5k, False: 0]
  ------------------
  295|  91.5k|                                {
  296|  91.5k|                                    uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count);
  297|       |
  298|       |                                    /* read and decode PCW */
  299|  91.5k|                                    if (!PCWs_done)
  ------------------
  |  Branch (299:41): [True: 54.4k, False: 37.1k]
  ------------------
  300|  54.4k|                                    {
  301|       |                                        /* read in normal segments */
  302|  54.4k|                                        if (bitsread + segwidth <= sp_data_len)
  ------------------
  |  Branch (302:45): [True: 53.9k, False: 504]
  ------------------
  303|  53.9k|                                        {
  304|  53.9k|                                            read_segment(&segment[numberOfSegments], segwidth, ld);
  305|  53.9k|                                            bitsread += segwidth;
  306|       |
  307|  53.9k|                                            huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]);
  308|       |
  309|       |                                            /* keep leftover bits */
  310|  53.9k|                                            rewrev_bits(&segment[numberOfSegments]);
  311|       |
  312|  53.9k|                                            numberOfSegments++;
  313|  53.9k|                                        } else {  // sp_data_len - bitsread < segwidth
  314|       |                                            /* remaining stuff after last segment, we unfortunately couldn't read
  315|       |                                               this in earlier because it might not fit in 64 bits. since we already
  316|       |                                               decoded (and removed) the PCW it is now should fit */
  317|    504|                                            if (bitsread < sp_data_len)
  ------------------
  |  Branch (317:49): [True: 399, False: 105]
  ------------------
  318|    399|                                            {
  319|    399|                                                const uint8_t additional_bits = (uint8_t)(sp_data_len - bitsread);
  320|       |
  321|    399|                                                read_segment(&segment[numberOfSegments], additional_bits, ld);
  322|    399|                                                segment[numberOfSegments].len += segment[numberOfSegments-1].len;
  323|    399|                                                if (segment[numberOfSegments].len > 64)
  ------------------
  |  Branch (323:53): [True: 27, False: 372]
  ------------------
  324|     27|                                                    return 10;
  325|    372|                                                rewrev_bits(&segment[numberOfSegments]);
  326|       |
  327|    372|                                                if (segment[numberOfSegments-1].len > 32)
  ------------------
  |  Branch (327:53): [True: 76, False: 296]
  ------------------
  328|     76|                                                {
  329|     76|                                                    segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
  330|     76|                                                        showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32);
  331|     76|                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
  332|     76|                                                        showbits_hcr(&segment[numberOfSegments-1], 32);
  333|    296|                                                } else {
  334|    296|                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
  335|    296|                                                        showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len);
  336|    296|                                                    segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb;
  337|    296|                                                }
  338|    372|                                                segment[numberOfSegments-1].len += additional_bits;
  339|    372|                                            }
  340|    477|                                            bitsread = sp_data_len;
  341|    477|                                            PCWs_done = 1;
  342|       |
  343|    477|                                            fill_in_codeword(codeword, 0, sp, this_sec_CB);
  344|    477|                                        }
  345|  54.4k|                                    } else {
  346|  37.1k|                                        fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB);
  347|  37.1k|                                    }
  348|  91.5k|                                    numberOfCodewords++;
  349|  91.5k|                                }
  350|  39.0k|                            }
  351|   710k|                        }
  352|  5.57M|                    }
  353|   710k|                 }
  354|   652k|             }
  355|   160k|         }
  356|  15.8k|    }
  357|       |
  358|    826|    if (numberOfSegments == 0)
  ------------------
  |  Branch (358:9): [True: 29, False: 797]
  ------------------
  359|     29|        return 10;
  360|       |
  361|    797|    numberOfSets = numberOfCodewords / numberOfSegments;
  362|       |
  363|       |    /* step 2: decode nonPCWs */
  364|  4.42k|    for (set = 1; set <= numberOfSets; set++)
  ------------------
  |  Branch (364:19): [True: 3.63k, False: 797]
  ------------------
  365|  3.63k|    {
  366|  3.63k|        uint16_t trial;
  367|       |
  368|  81.7k|        for (trial = 0; trial < numberOfSegments; trial++)
  ------------------
  |  Branch (368:25): [True: 78.1k, False: 3.63k]
  ------------------
  369|  78.1k|        {
  370|  78.1k|            uint16_t codewordBase;
  371|       |
  372|  3.88M|            for (codewordBase = 0; codewordBase < numberOfSegments; codewordBase++)
  ------------------
  |  Branch (372:36): [True: 3.86M, False: 24.6k]
  ------------------
  373|  3.86M|            {
  374|  3.86M|                const uint16_t segment_idx = (trial + codewordBase) % numberOfSegments;
  375|  3.86M|                const uint16_t codeword_idx = codewordBase + set*numberOfSegments - numberOfSegments;
  376|       |
  377|       |                /* data up */
  378|  3.86M|                if (codeword_idx >= numberOfCodewords - numberOfSegments) break;
  ------------------
  |  Branch (378:21): [True: 53.4k, False: 3.80M]
  ------------------
  379|       |
  380|  3.80M|                if (!codeword[codeword_idx].decoded && segment[segment_idx].len > 0)
  ------------------
  |  Branch (380:21): [True: 526k, False: 3.28M]
  |  Branch (380:56): [True: 38.0k, False: 488k]
  ------------------
  381|  38.0k|                {
  382|  38.0k|                    uint8_t tmplen = segment[segment_idx].len + codeword[codeword_idx].bits.len;
  383|       |
  384|  38.0k|                    if (tmplen > 64)
  ------------------
  |  Branch (384:25): [True: 420, False: 37.6k]
  ------------------
  385|    420|                    {
  386|       |                      // Drop bits that do not fit concatenation result.
  387|    420|                      flushbits_hcr(&codeword[codeword_idx].bits, tmplen - 64);
  388|    420|                    }
  389|       |
  390|  38.0k|                    if (codeword[codeword_idx].bits.len != 0)
  ------------------
  |  Branch (390:25): [True: 7.61k, False: 30.4k]
  ------------------
  391|  7.61k|                        concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits);
  392|       |
  393|  38.0k|                    tmplen = segment[segment_idx].len;
  394|       |
  395|  38.0k|                    if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx],
  ------------------
  |  Branch (395:25): [True: 29.8k, False: 8.17k]
  ------------------
  396|  38.0k|                                               &spectral_data[codeword[codeword_idx].sp_offset]) >= 0)
  397|  29.8k|                    {
  398|  29.8k|                        codeword[codeword_idx].decoded = 1;
  399|  29.8k|                    } else
  400|  8.17k|                    {
  401|  8.17k|                        codeword[codeword_idx].bits = segment[segment_idx];
  402|  8.17k|                        codeword[codeword_idx].bits.len = tmplen;
  403|  8.17k|                    }
  404|       |
  405|  38.0k|                }
  406|  3.80M|            }
  407|  78.1k|        }
  408|  81.7k|        for (i = 0; i < numberOfSegments; i++)
  ------------------
  |  Branch (408:21): [True: 78.1k, False: 3.63k]
  ------------------
  409|  78.1k|            rewrev_bits(&segment[i]);
  410|  3.63k|    }
  411|       |
  412|       |#if 0 // Seems to give false errors
  413|       |    bitsleft = 0;
  414|       |
  415|       |    for (i = 0; i < numberOfSegments && !bitsleft; i++)
  416|       |        bitsleft += segment[i].len;
  417|       |
  418|       |    if (bitsleft) return 10;
  419|       |
  420|       |    codewordsleft = 0;
  421|       |
  422|       |    for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++)
  423|       |        if (!codeword[i].decoded)
  424|       |                codewordsleft++;
  425|       |
  426|       |    if (codewordsleft) return 10;
  427|       |#endif
  428|       |
  429|       |
  430|    797|    return 0;
  431|       |
  432|    826|}
hcr.c:is_good_cb:
  170|   710k|{
  171|       |    /* only want spectral data CB's */
  172|   710k|    if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
  ------------------
  |  |  101|  1.42M|#define ZERO_HCB       0
  ------------------
                  if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
  ------------------
  |  |  103|   673k|#define ESC_HCB        11
  ------------------
                  if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
  ------------------
  |  |   59|   498k|#define VCB11_FIRST 16
  ------------------
                  if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
  ------------------
  |  |   60|   138k|#define VCB11_LAST  31
  ------------------
  |  Branch (172:10): [True: 673k, False: 36.6k]
  |  Branch (172:36): [True: 460k, False: 212k]
  |  Branch (172:64): [True: 138k, False: 110k]
  |  Branch (172:94): [True: 138k, False: 0]
  ------------------
  173|   599k|    {
  174|   599k|        if (this_CB < ESC_HCB)
  ------------------
  |  |  103|   599k|#define ESC_HCB        11
  ------------------
  |  Branch (174:13): [True: 194k, False: 404k]
  ------------------
  175|   194k|        {
  176|       |            /* normal codebook pairs */
  177|   194k|            return ((this_sec_CB == this_CB) || (this_sec_CB == this_CB + 1));
  ------------------
  |  Branch (177:21): [True: 7.53k, False: 187k]
  |  Branch (177:49): [True: 19.2k, False: 167k]
  ------------------
  178|   194k|        } else
  179|   404k|        {
  180|       |            /* escape codebook */
  181|   404k|            return (this_sec_CB == this_CB);
  182|   404k|        }
  183|   599k|    }
  184|   110k|    return 0;
  185|   710k|}
hcr.c:read_segment:
  188|  54.3k|{
  189|  54.3k|    segment->len = segwidth;
  190|       |
  191|  54.3k|     if (segwidth > 32)
  ------------------
  |  Branch (191:10): [True: 9.56k, False: 44.7k]
  ------------------
  192|  9.56k|     {
  193|  9.56k|        segment->bufb = faad_getbits(ld, segwidth - 32);
  194|  9.56k|        segment->bufa = faad_getbits(ld, 32);
  195|       |
  196|  44.7k|    } else {
  197|  44.7k|        segment->bufb = 0;
  198|  44.7k|        segment->bufa = faad_getbits(ld, segwidth);
  199|  44.7k|    }
  200|  54.3k|}
hcr.c:rewrev_bits:
   99|   132k|{
  100|   132k|    if (bits->len == 0) return;
  ------------------
  |  Branch (100:9): [True: 50.9k, False: 81.3k]
  ------------------
  101|  81.3k|    if (bits->len <= 32) {
  ------------------
  |  Branch (101:9): [True: 66.5k, False: 14.8k]
  ------------------
  102|  66.5k|        bits->bufb = 0;
  103|  66.5k|        bits->bufa = reverse_word(bits->bufa) >> (32 - bits->len);
  104|  66.5k|    } else {
  105|       |        /* last 32<>32 bit swap via rename */
  106|  14.8k|        uint32_t lo = reverse_word(bits->bufb);
  107|  14.8k|        uint32_t hi = reverse_word(bits->bufa);
  108|       |
  109|  14.8k|        if (bits->len == 64) {
  ------------------
  |  Branch (109:13): [True: 27, False: 14.7k]
  ------------------
  110|     27|            bits->bufb = hi;
  111|     27|            bits->bufa = lo;
  112|  14.7k|        } else {
  113|       |            /* shift off low bits (this is really only one 64 bit shift) */
  114|  14.7k|            bits->bufb = hi >> (64 - bits->len);
  115|  14.7k|            bits->bufa = (lo >> (64 - bits->len)) | (hi << (bits->len - 32));
  116|  14.7k|        }
  117|  14.8k|    }
  118|  81.3k|}
hcr.c:reverse_word:
   88|  96.1k|{
   89|  96.1k|    v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
   90|  96.1k|    v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
   91|  96.1k|    v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
   92|  96.1k|    v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
   93|  96.1k|    v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
   94|  96.1k|    return v;
   95|  96.1k|}
hcr.c:fill_in_codeword:
  203|  37.6k|{
  204|  37.6k|    codeword[index].sp_offset = sp;
  205|  37.6k|    codeword[index].cb = cb;
  206|  37.6k|    codeword[index].decoded = 0;
  207|  37.6k|    codeword[index].bits.len = 0;
  208|  37.6k|}
hcr.c:concat_bits:
  124|  7.61k|{
  125|  7.61k|    uint32_t bl, bh, al, ah;
  126|       |
  127|       |    /* empty addend */
  128|  7.61k|    if (a->len == 0) return;
  ------------------
  |  Branch (128:9): [True: 0, False: 7.61k]
  ------------------
  129|       |
  130|       |    /* addend becomes result */
  131|  7.61k|    if (b->len == 0)
  ------------------
  |  Branch (131:9): [True: 0, False: 7.61k]
  ------------------
  132|      0|    {
  133|      0|        *b = *a;
  134|      0|        return;
  135|      0|    }
  136|       |
  137|  7.61k|    al = a->bufa;
  138|  7.61k|    ah = a->bufb;
  139|       |
  140|  7.61k|    if (b->len > 32)
  ------------------
  |  Branch (140:9): [True: 580, False: 7.03k]
  ------------------
  141|    580|    {
  142|       |        /* (b->len - 32) is 1..31 */
  143|       |        /* maskoff superfluous high b bits */
  144|    580|        bl = b->bufa;
  145|    580|        bh = b->bufb & ((1u << (b->len-32)) - 1);
  146|       |        /* left shift a b->len bits */
  147|    580|        ah = al << (b->len - 32);
  148|    580|        al = 0;
  149|  7.03k|    } else if (b->len == 32) {
  ------------------
  |  Branch (149:16): [True: 92, False: 6.94k]
  ------------------
  150|     92|        bl = b->bufa;
  151|     92|        bh = 0;
  152|     92|        ah = al;
  153|     92|        al = 0;
  154|  6.94k|    } else {
  155|       |        /* b->len is 1..31, (32 - b->len) is 1..31 */
  156|  6.94k|        bl = b->bufa & ((1u << (b->len)) - 1);
  157|  6.94k|        bh = 0;
  158|  6.94k|        ah = (ah << (b->len)) | (al >> (32 - b->len));
  159|  6.94k|        al = al << b->len;
  160|  6.94k|    }
  161|       |
  162|       |    /* merge */
  163|  7.61k|    b->bufa = bl | al;
  164|  7.61k|    b->bufb = bh | ah;
  165|       |
  166|  7.61k|    b->len += a->len;
  167|  7.61k|}

huffman_scale_factor:
   61|  43.3k|{
   62|  43.3k|    uint16_t offset = 0;
   63|       |
   64|   124k|    while (hcb_sf[offset][1])
  ------------------
  |  Branch (64:12): [True: 80.8k, False: 43.3k]
  ------------------
   65|  80.8k|    {
   66|  80.8k|        uint8_t b = faad_get1bit(ld
   67|  80.8k|            DEBUGVAR(1,255,"huffman_scale_factor()"));
   68|  80.8k|        offset += hcb_sf[offset][b];
   69|  80.8k|    }
   70|       |
   71|  43.3k|    return hcb_sf[offset][0];
   72|  43.3k|}
huffman_spectral_data:
  338|   228k|{
  339|   228k|    switch (cb)
  340|   228k|    {
  341|  2.56k|    case 1: /* 2-step method for data quadruples */
  ------------------
  |  Branch (341:5): [True: 2.56k, False: 225k]
  ------------------
  342|  8.72k|    case 2:
  ------------------
  |  Branch (342:5): [True: 6.16k, False: 222k]
  ------------------
  343|  8.72k|        return huffman_2step_quad(cb, ld, sp);
  344|  5.73k|    case 3: /* binary search for data quadruples */
  ------------------
  |  Branch (344:5): [True: 5.73k, False: 222k]
  ------------------
  345|  5.73k|        return huffman_binary_quad_sign(cb, ld, sp);
  346|  15.6k|    case 4: /* 2-step method for data quadruples */
  ------------------
  |  Branch (346:5): [True: 15.6k, False: 212k]
  ------------------
  347|  15.6k|        return huffman_2step_quad_sign(cb, ld, sp);
  348|  10.4k|    case 5: /* binary search for data pairs */
  ------------------
  |  Branch (348:5): [True: 10.4k, False: 217k]
  ------------------
  349|  10.4k|        return huffman_binary_pair(cb, ld, sp);
  350|  37.8k|    case 6: /* 2-step method for data pairs */
  ------------------
  |  Branch (350:5): [True: 37.8k, False: 190k]
  ------------------
  351|  37.8k|        return huffman_2step_pair(cb, ld, sp);
  352|  8.01k|    case 7: /* binary search for data pairs */
  ------------------
  |  Branch (352:5): [True: 8.01k, False: 220k]
  ------------------
  353|  26.1k|    case 9:
  ------------------
  |  Branch (353:5): [True: 18.1k, False: 210k]
  ------------------
  354|  26.1k|        return huffman_binary_pair_sign(cb, ld, sp);
  355|  54.7k|    case 8: /* 2-step method for data pairs */
  ------------------
  |  Branch (355:5): [True: 54.7k, False: 173k]
  ------------------
  356|  66.5k|    case 10:
  ------------------
  |  Branch (356:5): [True: 11.7k, False: 216k]
  ------------------
  357|  66.5k|        return huffman_2step_pair_sign(cb, ld, sp);
  358|       |    /* Codebook 12 is disallowed, see `section_data` */
  359|       |#if 0
  360|       |    case 12: {
  361|       |        uint8_t err = huffman_2step_pair(11, ld, sp);
  362|       |        sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1);
  363|       |        return err; }
  364|       |#endif
  365|  33.3k|    case 11:
  ------------------
  |  Branch (365:5): [True: 33.3k, False: 194k]
  ------------------
  366|  33.3k|    {
  367|  33.3k|        uint8_t err = huffman_2step_pair_sign(11, ld, sp);
  368|  33.3k|        if (!err)
  ------------------
  |  Branch (368:13): [True: 33.3k, False: 0]
  ------------------
  369|  33.3k|            err = huffman_getescape(ld, &sp[0]);
  370|  33.3k|        if (!err)
  ------------------
  |  Branch (370:13): [True: 33.3k, False: 5]
  ------------------
  371|  33.3k|            err = huffman_getescape(ld, &sp[1]);
  372|  33.3k|        return err;
  373|  54.7k|    }
  374|      0|#ifdef ERROR_RESILIENCE
  375|       |    /* VCB11 uses codebook 11 */
  376|  10.9k|    case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
  ------------------
  |  Branch (376:5): [True: 4.88k, False: 223k]
  |  Branch (376:14): [True: 1.37k, False: 226k]
  |  Branch (376:23): [True: 652, False: 227k]
  |  Branch (376:32): [True: 498, False: 227k]
  |  Branch (376:41): [True: 478, False: 227k]
  |  Branch (376:50): [True: 468, False: 227k]
  |  Branch (376:59): [True: 1.00k, False: 227k]
  |  Branch (376:68): [True: 1.62k, False: 226k]
  ------------------
  377|  23.7k|    case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
  ------------------
  |  Branch (377:5): [True: 906, False: 227k]
  |  Branch (377:14): [True: 701, False: 227k]
  |  Branch (377:23): [True: 946, False: 227k]
  |  Branch (377:32): [True: 717, False: 227k]
  |  Branch (377:41): [True: 2.09k, False: 226k]
  |  Branch (377:50): [True: 1.05k, False: 227k]
  |  Branch (377:59): [True: 903, False: 227k]
  |  Branch (377:68): [True: 5.48k, False: 222k]
  ------------------
  378|  23.7k|    {
  379|  23.7k|        uint8_t err = huffman_2step_pair_sign(11, ld, sp);
  380|  23.7k|        if (!err)
  ------------------
  |  Branch (380:13): [True: 23.7k, False: 0]
  ------------------
  381|  23.7k|            err = huffman_getescape(ld, &sp[0]);
  382|  23.7k|        if (!err)
  ------------------
  |  Branch (382:13): [True: 23.7k, False: 20]
  ------------------
  383|  23.7k|            err = huffman_getescape(ld, &sp[1]);
  384|       |
  385|       |        /* check LAV (Largest Absolute Value) */
  386|       |        /* this finds errors in the ESCAPE signal */
  387|  23.7k|        vcb11_check_LAV(cb, sp);
  388|       |
  389|  23.7k|        return err;
  390|  18.3k|    }
  391|      0|#endif
  392|      0|    default:
  ------------------
  |  Branch (392:5): [True: 0, False: 228k]
  ------------------
  393|       |        /* Non existent codebook number, something went wrong */
  394|      0|        return 11;
  395|   228k|    }
  396|       |
  397|       |    /* return 0; */
  398|   228k|}
huffman_spectral_data_2:
  409|  91.9k|{
  410|  91.9k|    uint32_t cw;
  411|  91.9k|    uint16_t offset = 0;
  412|  91.9k|    uint8_t extra_bits;
  413|  91.9k|    uint8_t vcb11 = 0;
  414|       |
  415|       |
  416|  91.9k|    switch (cb)
  ------------------
  |  Branch (416:13): [True: 91.9k, False: 0]
  ------------------
  417|  91.9k|    {
  418|  1.21k|    case 1: /* 2-step method for data quadruples */
  ------------------
  |  Branch (418:5): [True: 1.21k, False: 90.7k]
  ------------------
  419|  14.1k|    case 2:
  ------------------
  |  Branch (419:5): [True: 12.9k, False: 78.9k]
  ------------------
  420|  18.4k|    case 4: {
  ------------------
  |  Branch (420:5): [True: 4.27k, False: 87.6k]
  ------------------
  421|  18.4k|        const hcb* root;
  422|  18.4k|        uint8_t root_bits;
  423|  18.4k|        const hcb_2_quad* table;
  424|  18.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  425|  18.4k|        if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (425:13): [True: 0, False: 18.4k]
  ------------------
  426|  18.4k|        if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (426:13): [True: 0, False: 18.4k]
  ------------------
  427|  18.4k|        if (hcb_2_quad_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (427:13): [True: 0, False: 18.4k]
  ------------------
  428|       |        // In other words, `cb` is one of [1, 2, 4].
  429|  18.4k|#endif
  430|  18.4k|        root = hcb_table[cb];
  431|  18.4k|        root_bits = hcbN[cb];
  432|  18.4k|        table = hcb_2_quad_table[cb];
  433|       |
  434|  18.4k|        cw = showbits_hcr(ld, root_bits);
  435|  18.4k|        offset = root[cw].offset;
  436|  18.4k|        extra_bits = root[cw].extra_bits;
  437|       |
  438|  18.4k|        if (extra_bits)
  ------------------
  |  Branch (438:13): [True: 2.59k, False: 15.8k]
  ------------------
  439|  2.59k|        {
  440|       |            /* We know for sure it's more than root_bits bits long. */
  441|  2.59k|            if (flushbits_hcr(ld, root_bits)) return -1;
  ------------------
  |  Branch (441:17): [True: 795, False: 1.79k]
  ------------------
  442|  1.79k|            offset += (uint16_t)showbits_hcr(ld, extra_bits);
  443|  1.79k|            if (flushbits_hcr(ld, table[offset].bits - root_bits)) return -1;
  ------------------
  |  Branch (443:17): [True: 625, False: 1.17k]
  ------------------
  444|  15.8k|        } else {
  445|  15.8k|            if (flushbits_hcr(ld, table[offset].bits)) return -1;
  ------------------
  |  Branch (445:17): [True: 1.19k, False: 14.6k]
  ------------------
  446|  15.8k|        }
  447|       |
  448|  15.8k|        sp[0] = table[offset].x;
  449|  15.8k|        sp[1] = table[offset].y;
  450|  15.8k|        sp[2] = table[offset].v;
  451|  15.8k|        sp[3] = table[offset].w;
  452|  15.8k|        break;
  453|  18.4k|    }
  454|  2.06k|    case 6: /* 2-step method for data pairs */
  ------------------
  |  Branch (454:5): [True: 2.06k, False: 89.8k]
  ------------------
  455|  3.24k|    case 8:
  ------------------
  |  Branch (455:5): [True: 1.18k, False: 90.7k]
  ------------------
  456|  10.4k|    case 10:
  ------------------
  |  Branch (456:5): [True: 7.20k, False: 84.7k]
  ------------------
  457|  23.7k|    case 11:
  ------------------
  |  Branch (457:5): [True: 13.3k, False: 78.6k]
  ------------------
  458|       |    /* VCB11 uses codebook 11 */
  459|  41.7k|    case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
  ------------------
  |  Branch (459:5): [True: 7.06k, False: 84.8k]
  |  Branch (459:14): [True: 831, False: 91.1k]
  |  Branch (459:23): [True: 3.24k, False: 88.6k]
  |  Branch (459:32): [True: 1.05k, False: 90.8k]
  |  Branch (459:41): [True: 1.28k, False: 90.6k]
  |  Branch (459:50): [True: 1.47k, False: 90.4k]
  |  Branch (459:59): [True: 1.59k, False: 90.3k]
  |  Branch (459:68): [True: 1.39k, False: 90.5k]
  ------------------
  460|  61.8k|    case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: {
  ------------------
  |  Branch (460:5): [True: 1.67k, False: 90.2k]
  |  Branch (460:14): [True: 1.46k, False: 90.4k]
  |  Branch (460:23): [True: 1.25k, False: 90.6k]
  |  Branch (460:32): [True: 1.72k, False: 90.2k]
  |  Branch (460:41): [True: 2.33k, False: 89.6k]
  |  Branch (460:50): [True: 2.18k, False: 89.7k]
  |  Branch (460:59): [True: 1.59k, False: 90.3k]
  |  Branch (460:68): [True: 7.94k, False: 83.9k]
  ------------------
  461|  61.8k|        const hcb* root;
  462|  61.8k|        uint8_t root_bits;
  463|  61.8k|        const hcb_2_pair* table;
  464|       |
  465|  61.8k|        if (cb >= 16)
  ------------------
  |  Branch (465:13): [True: 38.1k, False: 23.7k]
  ------------------
  466|  38.1k|        {
  467|       |            /* store the virtual codebook */
  468|  38.1k|            vcb11 = cb;
  469|  38.1k|            cb = 11;
  470|  38.1k|        }
  471|  61.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  472|  61.8k|        if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (472:13): [True: 0, False: 61.8k]
  ------------------
  473|  61.8k|        if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (473:13): [True: 0, False: 61.8k]
  ------------------
  474|  61.8k|        if (hcb_2_pair_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (474:13): [True: 0, False: 61.8k]
  ------------------
  475|       |        // In other words, `cb` is one of [6, 8, 10, 11].
  476|  61.8k|#endif
  477|  61.8k|        root = hcb_table[cb];
  478|  61.8k|        root_bits = hcbN[cb];
  479|  61.8k|        table = hcb_2_pair_table[cb];
  480|       |
  481|  61.8k|        cw = showbits_hcr(ld, root_bits);
  482|  61.8k|        offset = root[cw].offset;
  483|  61.8k|        extra_bits = root[cw].extra_bits;
  484|       |
  485|  61.8k|        if (extra_bits)
  ------------------
  |  Branch (485:13): [True: 8.99k, False: 52.8k]
  ------------------
  486|  8.99k|        {
  487|       |            /* we know for sure it's more than hcbN[cb] bits long */
  488|  8.99k|            if (flushbits_hcr(ld, root_bits)) return -1;
  ------------------
  |  Branch (488:17): [True: 895, False: 8.10k]
  ------------------
  489|  8.10k|            offset += (uint16_t)showbits_hcr(ld, extra_bits);
  490|  8.10k|            if (flushbits_hcr(ld, table[offset].bits - root_bits)) return -1;
  ------------------
  |  Branch (490:17): [True: 1.35k, False: 6.74k]
  ------------------
  491|  52.8k|        } else {
  492|  52.8k|            if ( flushbits_hcr(ld, table[offset].bits)) return -1;
  ------------------
  |  Branch (492:18): [True: 5.01k, False: 47.8k]
  ------------------
  493|  52.8k|        }
  494|  54.6k|        sp[0] = table[offset].x;
  495|  54.6k|        sp[1] = table[offset].y;
  496|  54.6k|        break;
  497|  61.8k|    }
  498|  2.32k|    case 3: { /* binary search for data quadruples */
  ------------------
  |  Branch (498:5): [True: 2.32k, False: 89.6k]
  ------------------
  499|  2.32k|        const hcb_bin_quad* table = hcb3;
  500|  5.36k|        while (!table[offset].is_leaf)
  ------------------
  |  Branch (500:16): [True: 3.31k, False: 2.05k]
  ------------------
  501|  3.31k|        {
  502|  3.31k|            uint8_t b;
  503|  3.31k|            if (get1bit_hcr(ld, &b)) return -1;
  ------------------
  |  Branch (503:17): [True: 265, False: 3.04k]
  ------------------
  504|  3.04k|            offset += table[offset].data[b];
  505|  3.04k|        }
  506|       |
  507|  2.05k|        sp[0] = table[offset].data[0];
  508|  2.05k|        sp[1] = table[offset].data[1];
  509|  2.05k|        sp[2] = table[offset].data[2];
  510|  2.05k|        sp[3] = table[offset].data[3];
  511|       |
  512|  2.05k|        break;
  513|  2.32k|    }
  514|       |
  515|  4.44k|    case 5: /* binary search for data pairs */
  ------------------
  |  Branch (515:5): [True: 4.44k, False: 87.4k]
  ------------------
  516|  5.09k|    case 7:
  ------------------
  |  Branch (516:5): [True: 642, False: 91.3k]
  ------------------
  517|  9.30k|    case 9: {
  ------------------
  |  Branch (517:5): [True: 4.21k, False: 87.7k]
  ------------------
  518|  9.30k|        const hcb_bin_pair* table = hcb_bin_table[cb];
  519|  22.8k|        while (!table[offset].is_leaf)
  ------------------
  |  Branch (519:16): [True: 14.0k, False: 8.74k]
  ------------------
  520|  14.0k|        {
  521|  14.0k|            uint8_t b;
  522|       |
  523|  14.0k|            if (get1bit_hcr(ld, &b) ) return -1;
  ------------------
  |  Branch (523:17): [True: 553, False: 13.5k]
  ------------------
  524|  13.5k|            offset += table[offset].data[b];
  525|  13.5k|        }
  526|       |
  527|  8.74k|        sp[0] = table[offset].data[0];
  528|  8.74k|        sp[1] = table[offset].data[1];
  529|       |
  530|  8.74k|        break;
  531|  9.30k|    }}
  532|       |
  533|       |	/* decode sign bits */
  534|  81.2k|    if (unsigned_cb[cb])
  ------------------
  |  Branch (534:9): [True: 63.0k, False: 18.2k]
  ------------------
  535|  63.0k|    {
  536|  63.0k|        uint8_t i;
  537|   186k|        for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
  ------------------
  |  |   73|   186k|#define FIRST_PAIR_HCB 5
  ------------------
                      for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
  ------------------
  |  |   75|  19.1k|#define QUAD_LEN       4
  ------------------
                      for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
  ------------------
  |  |   76|   167k|#define PAIR_LEN       2
  ------------------
  |  Branch (537:20): [True: 129k, False: 57.6k]
  |  Branch (537:25): [True: 19.1k, False: 167k]
  ------------------
  538|   129k|        {
  539|   129k|            if(sp[i])
  ------------------
  |  Branch (539:16): [True: 44.5k, False: 84.4k]
  ------------------
  540|  44.5k|            {
  541|  44.5k|            	uint8_t b;
  542|  44.5k|                if ( get1bit_hcr(ld, &b) ) return -1;
  ------------------
  |  Branch (542:22): [True: 5.35k, False: 39.2k]
  ------------------
  543|  39.2k|                if (b != 0) {
  ------------------
  |  Branch (543:21): [True: 9.86k, False: 29.3k]
  ------------------
  544|  9.86k|                    sp[i] = -sp[i];
  545|  9.86k|                }
  546|  39.2k|           }
  547|   129k|        }
  548|  63.0k|    }
  549|       |
  550|       |    /* decode huffman escape bits */
  551|  75.8k|    if ((cb == ESC_HCB) || (cb >= 16))
  ------------------
  |  |   74|  75.8k|#define ESC_HCB        11
  ------------------
  |  Branch (551:9): [True: 44.3k, False: 31.5k]
  |  Branch (551:28): [True: 0, False: 31.5k]
  ------------------
  552|  44.3k|    {
  553|  44.3k|        uint8_t k;
  554|   127k|        for (k = 0; k < 2; k++)
  ------------------
  |  Branch (554:21): [True: 87.1k, False: 40.6k]
  ------------------
  555|  87.1k|        {
  556|  87.1k|            if ((sp[k] == 16) || (sp[k] == -16))
  ------------------
  |  Branch (556:17): [True: 6.23k, False: 80.9k]
  |  Branch (556:34): [True: 1.89k, False: 79.0k]
  ------------------
  557|  8.12k|            {
  558|  8.12k|                uint8_t neg, i;
  559|  8.12k|                int32_t j;
  560|  8.12k|                uint32_t off;
  561|       |
  562|  8.12k|                neg = (sp[k] < 0) ? 1 : 0;
  ------------------
  |  Branch (562:23): [True: 1.89k, False: 6.23k]
  ------------------
  563|       |
  564|  17.7k|                for (i = 4; i < 16; i++)
  ------------------
  |  Branch (564:29): [True: 17.2k, False: 474]
  ------------------
  565|  17.2k|                {
  566|  17.2k|                    uint8_t b;
  567|  17.2k|                    if (get1bit_hcr(ld, &b))
  ------------------
  |  Branch (567:25): [True: 1.37k, False: 15.8k]
  ------------------
  568|  1.37k|                        return -1;
  569|  15.8k|                    if (b == 0)
  ------------------
  |  Branch (569:25): [True: 6.28k, False: 9.60k]
  ------------------
  570|  6.28k|                        break;
  571|  15.8k|                }
  572|       |
  573|  6.75k|                if (i >= 16)
  ------------------
  |  Branch (573:21): [True: 474, False: 6.28k]
  ------------------
  574|    474|                    return -1;
  575|       |
  576|  6.28k|                if (getbits_hcr(ld, i, &off))
  ------------------
  |  Branch (576:21): [True: 1.85k, False: 4.42k]
  ------------------
  577|  1.85k|                    return -1;
  578|  4.42k|                j = off + (1<<i);
  579|  4.42k|                sp[k] = (int16_t)((neg) ? -j : j);
  ------------------
  |  Branch (579:35): [True: 772, False: 3.65k]
  ------------------
  580|  4.42k|            }
  581|  87.1k|        }
  582|       |
  583|  40.6k|        if (vcb11 != 0)
  ------------------
  |  Branch (583:13): [True: 28.4k, False: 12.1k]
  ------------------
  584|  28.4k|        {
  585|       |            /* check LAV (Largest Absolute Value) */
  586|       |            /* this finds errors in the ESCAPE signal */
  587|  28.4k|            vcb11_check_LAV(vcb11, sp);
  588|  28.4k|        }
  589|  40.6k|    }
  590|  72.1k|    return ld->len;
  591|  75.8k|}
huffman.c:huffman_2step_quad:
  151|  24.4k|{
  152|  24.4k|    uint32_t cw;
  153|  24.4k|    uint16_t offset;
  154|  24.4k|    uint8_t extra_bits;
  155|  24.4k|    const hcb* root;
  156|  24.4k|    uint8_t root_bits;
  157|  24.4k|    const hcb_2_quad* table;
  158|  24.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  159|  24.4k|    if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (159:9): [True: 0, False: 24.4k]
  ------------------
  160|  24.4k|    if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (160:9): [True: 0, False: 24.4k]
  ------------------
  161|  24.4k|    if (hcb_2_quad_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (161:9): [True: 0, False: 24.4k]
  ------------------
  162|       |    // In other words, `cb` is one of [1, 2, 4].
  163|  24.4k|#endif
  164|  24.4k|    root = hcb_table[cb];
  165|  24.4k|    root_bits = hcbN[cb];
  166|  24.4k|    table = hcb_2_quad_table[cb];
  167|       |
  168|  24.4k|    cw = faad_showbits(ld, root_bits);
  169|  24.4k|    offset = root[cw].offset;
  170|  24.4k|    extra_bits = root[cw].extra_bits;
  171|       |
  172|  24.4k|    if (extra_bits)
  ------------------
  |  Branch (172:9): [True: 3.67k, False: 20.7k]
  ------------------
  173|  3.67k|    {
  174|       |        /* We know for sure it's more than `root_bits` bits long. */
  175|  3.67k|        faad_flushbits(ld, root_bits);
  176|  3.67k|        offset += (uint16_t)faad_showbits(ld, extra_bits);
  177|  3.67k|        faad_flushbits(ld, table[offset].bits - root_bits);
  178|  20.7k|    } else {
  179|  20.7k|        faad_flushbits(ld, table[offset].bits);
  180|  20.7k|    }
  181|       |
  182|  24.4k|    sp[0] = table[offset].x;
  183|  24.4k|    sp[1] = table[offset].y;
  184|  24.4k|    sp[2] = table[offset].v;
  185|  24.4k|    sp[3] = table[offset].w;
  186|       |
  187|  24.4k|    return 0;
  188|  24.4k|}
huffman.c:huffman_binary_quad_sign:
  269|  5.73k|{
  270|  5.73k|    uint8_t err = huffman_binary_quad(cb, ld, sp);
  271|  5.73k|    huffman_sign_bits(ld, sp, QUAD_LEN);
  ------------------
  |  |   75|  5.73k|#define QUAD_LEN       4
  ------------------
  272|       |
  273|  5.73k|    return err;
  274|  5.73k|}
huffman.c:huffman_binary_quad:
  245|  5.73k|{
  246|  5.73k|    uint16_t offset = 0;
  247|  5.73k|    const hcb_bin_quad* table = hcb3;
  248|       |
  249|  5.73k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  250|  5.73k|    if (cb != 3) __builtin_trap();
  ------------------
  |  Branch (250:9): [True: 0, False: 5.73k]
  ------------------
  251|  5.73k|#endif
  252|       |
  253|  20.9k|    while (!table[offset].is_leaf)
  ------------------
  |  Branch (253:12): [True: 15.2k, False: 5.73k]
  ------------------
  254|  15.2k|    {
  255|  15.2k|        uint8_t b = faad_get1bit(ld
  256|  15.2k|            DEBUGVAR(1,255,"huffman_spectral_data():3"));
  257|  15.2k|        offset += table[offset].data[b];
  258|  15.2k|    }
  259|       |
  260|  5.73k|    sp[0] = table[offset].data[0];
  261|  5.73k|    sp[1] = table[offset].data[1];
  262|  5.73k|    sp[2] = table[offset].data[2];
  263|  5.73k|    sp[3] = table[offset].data[3];
  264|       |
  265|  5.73k|    return 0;
  266|  5.73k|}
huffman.c:huffman_sign_bits:
   94|   171k|{
   95|   171k|    uint8_t i;
   96|       |
   97|   556k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (97:17): [True: 385k, False: 171k]
  ------------------
   98|   385k|    {
   99|   385k|        if(sp[i])
  ------------------
  |  Branch (99:12): [True: 218k, False: 166k]
  ------------------
  100|   218k|        {
  101|   218k|            if(faad_get1bit(ld
  ------------------
  |  Branch (101:16): [True: 51.7k, False: 167k]
  ------------------
  102|   218k|                DEBUGVAR(1,5,"huffman_sign_bits(): sign bit")) & 1)
  103|  51.7k|            {
  104|  51.7k|                sp[i] = -sp[i];
  105|  51.7k|            }
  106|   218k|        }
  107|   385k|    }
  108|   171k|}
huffman.c:huffman_2step_quad_sign:
  191|  15.6k|{
  192|  15.6k|    uint8_t err = huffman_2step_quad(cb, ld, sp);
  193|  15.6k|    huffman_sign_bits(ld, sp, QUAD_LEN);
  ------------------
  |  |   75|  15.6k|#define QUAD_LEN       4
  ------------------
  194|       |
  195|  15.6k|    return err;
  196|  15.6k|}
huffman.c:huffman_binary_pair:
  277|  36.6k|{
  278|  36.6k|    uint16_t offset = 0;
  279|  36.6k|    const hcb_bin_pair* table;
  280|  36.6k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  281|  36.6k|    if (hcb_bin_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (281:9): [True: 0, False: 36.6k]
  ------------------
  282|  36.6k|    if (cb == 3) __builtin_trap();
  ------------------
  |  Branch (282:9): [True: 0, False: 36.6k]
  ------------------
  283|       |    // In other words, `cb` is one of [5, 7, 9].
  284|  36.6k|#endif
  285|  36.6k|    table = hcb_bin_table[cb];
  286|       |
  287|   101k|    while (!table[offset].is_leaf)
  ------------------
  |  Branch (287:12): [True: 64.4k, False: 36.6k]
  ------------------
  288|  64.4k|    {
  289|  64.4k|        uint8_t b = faad_get1bit(ld
  290|  64.4k|            DEBUGVAR(1,255,"huffman_spectral_data():9"));
  291|  64.4k|        offset += table[offset].data[b];
  292|  64.4k|    }
  293|       |
  294|  36.6k|    sp[0] = table[offset].data[0];
  295|  36.6k|    sp[1] = table[offset].data[1];
  296|       |
  297|  36.6k|    return 0;
  298|  36.6k|}
huffman.c:huffman_2step_pair:
  199|   161k|{
  200|   161k|    uint32_t cw;
  201|   161k|    uint16_t offset;
  202|   161k|    uint8_t extra_bits;
  203|   161k|    const hcb* root;
  204|   161k|    uint8_t root_bits;
  205|   161k|    const hcb_2_pair* table;
  206|   161k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  207|   161k|    if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (207:9): [True: 0, False: 161k]
  ------------------
  208|   161k|    if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (208:9): [True: 0, False: 161k]
  ------------------
  209|   161k|    if (hcb_2_pair_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (209:9): [True: 0, False: 161k]
  ------------------
  210|       |    // In other words, `cb` is one of [6, 8, 10, 11].
  211|   161k|#endif
  212|   161k|    root = hcb_table[cb];
  213|   161k|    root_bits = hcbN[cb];
  214|   161k|    table = hcb_2_pair_table[cb];
  215|       |
  216|   161k|    cw = faad_showbits(ld, root_bits);
  217|   161k|    offset = root[cw].offset;
  218|   161k|    extra_bits = root[cw].extra_bits;
  219|       |
  220|   161k|    if (extra_bits)
  ------------------
  |  Branch (220:9): [True: 15.1k, False: 146k]
  ------------------
  221|  15.1k|    {
  222|       |        /* we know for sure it's more than hcbN[cb] bits long */
  223|  15.1k|        faad_flushbits(ld, root_bits);
  224|  15.1k|        offset += (uint16_t)faad_showbits(ld, extra_bits);
  225|  15.1k|        faad_flushbits(ld, table[offset].bits - root_bits);
  226|   146k|    } else {
  227|   146k|        faad_flushbits(ld, table[offset].bits);
  228|   146k|    }
  229|       |
  230|   161k|    sp[0] = table[offset].x;
  231|   161k|    sp[1] = table[offset].y;
  232|       |
  233|   161k|    return 0;
  234|   161k|}
huffman.c:huffman_binary_pair_sign:
  301|  26.1k|{
  302|  26.1k|    uint8_t err = huffman_binary_pair(cb, ld, sp);
  303|  26.1k|    huffman_sign_bits(ld, sp, PAIR_LEN);
  ------------------
  |  |   76|  26.1k|#define PAIR_LEN       2
  ------------------
  304|       |
  305|  26.1k|    return err;
  306|  26.1k|}
huffman.c:huffman_2step_pair_sign:
  237|   123k|{
  238|   123k|    uint8_t err = huffman_2step_pair(cb, ld, sp);
  239|   123k|    huffman_sign_bits(ld, sp, PAIR_LEN);
  ------------------
  |  |   76|   123k|#define PAIR_LEN       2
  ------------------
  240|       |
  241|   123k|    return err;
  242|   123k|}
huffman.c:huffman_getescape:
  111|   114k|{
  112|   114k|    uint8_t neg, i;
  113|   114k|    int16_t j;
  114|   114k|	int16_t off;
  115|   114k|    int16_t x = *sp;
  116|       |
  117|   114k|    if (x < 0)
  ------------------
  |  Branch (117:9): [True: 14.0k, False: 100k]
  ------------------
  118|  14.0k|    {
  119|  14.0k|        if (x != -16)
  ------------------
  |  Branch (119:13): [True: 9.79k, False: 4.29k]
  ------------------
  120|  9.79k|            return 0;
  121|  4.29k|        neg = 1;
  122|   100k|    } else {
  123|   100k|        if (x != 16)
  ------------------
  |  Branch (123:13): [True: 95.3k, False: 4.85k]
  ------------------
  124|  95.3k|            return 0;
  125|  4.85k|        neg = 0;
  126|  4.85k|    }
  127|       |
  128|  24.9k|    for (i = 4; i < 16; i++)
  ------------------
  |  Branch (128:17): [True: 24.8k, False: 50]
  ------------------
  129|  24.8k|    {
  130|  24.8k|        if (faad_get1bit(ld
  ------------------
  |  Branch (130:13): [True: 9.09k, False: 15.7k]
  ------------------
  131|  24.8k|            DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
  132|  9.09k|        {
  133|  9.09k|            break;
  134|  9.09k|        }
  135|  24.8k|    }
  136|  9.14k|    if (i >= 16)
  ------------------
  |  Branch (136:9): [True: 50, False: 9.09k]
  ------------------
  137|     50|        return 10;
  138|       |
  139|  9.09k|    off = (int16_t)faad_getbits(ld, i
  140|  9.09k|        DEBUGVAR(1,9,"huffman_getescape(): escape"));
  141|       |
  142|  9.09k|    j = off | (1<<i);
  143|  9.09k|    if (neg)
  ------------------
  |  Branch (143:9): [True: 4.25k, False: 4.84k]
  ------------------
  144|  4.25k|        j = -j;
  145|       |
  146|  9.09k|    *sp = j;
  147|  9.09k|    return 0;
  148|  9.14k|}
huffman.c:vcb11_check_LAV:
  318|  52.2k|{
  319|  52.2k|    static const uint16_t vcb11_LAV_tab[] = {
  320|  52.2k|        16, 31, 47, 63, 95, 127, 159, 191, 223,
  321|  52.2k|        255, 319, 383, 511, 767, 1023, 2047
  322|  52.2k|    };
  323|  52.2k|    uint16_t max = 0;
  324|       |
  325|  52.2k|    if (cb < 16 || cb > 31)
  ------------------
  |  Branch (325:9): [True: 0, False: 52.2k]
  |  Branch (325:20): [True: 0, False: 52.2k]
  ------------------
  326|      0|        return;
  327|       |
  328|  52.2k|    max = vcb11_LAV_tab[cb - 16];
  329|       |
  330|  52.2k|    if ((abs(sp[0]) > max) || (abs(sp[1]) > max))
  ------------------
  |  Branch (330:9): [True: 939, False: 51.3k]
  |  Branch (330:31): [True: 1.04k, False: 50.2k]
  ------------------
  331|  1.98k|    {
  332|  1.98k|        sp[0] = 0;
  333|  1.98k|        sp[1] = 0;
  334|  1.98k|    }
  335|  52.2k|}

is_decode:
   48|  17.5k|{
   49|  17.5k|    uint8_t g, sfb, b;
   50|  17.5k|    uint16_t i;
   51|  17.5k|    real_t scale;
   52|       |#ifdef FIXED_POINT
   53|       |    int32_t exp, frac;
   54|       |#endif
   55|       |
   56|  17.5k|    uint16_t nshort = frame_len/8;
   57|  17.5k|    uint8_t group = 0;
   58|       |
   59|  53.0k|    for (g = 0; g < icsr->num_window_groups; g++)
  ------------------
  |  Branch (59:17): [True: 35.4k, False: 17.5k]
  ------------------
   60|  35.4k|    {
   61|       |        /* Do intensity stereo decoding */
   62|  74.1k|        for (b = 0; b < icsr->window_group_length[g]; b++)
  ------------------
  |  Branch (62:21): [True: 38.7k, False: 35.4k]
  ------------------
   63|  38.7k|        {
   64|   105k|            for (sfb = 0; sfb < icsr->max_sfb; sfb++)
  ------------------
  |  Branch (64:27): [True: 66.3k, False: 38.7k]
  ------------------
   65|  66.3k|            {
   66|  66.3k|                if (is_intensity(icsr, g, sfb))
  ------------------
  |  Branch (66:21): [True: 9.30k, False: 57.0k]
  ------------------
   67|  9.30k|                {
   68|  9.30k|                    int16_t scale_factor = icsr->scale_factors[g][sfb];
   69|       |#ifdef MAIN_DEC
   70|       |                    /* For scalefactor bands coded in intensity stereo the
   71|       |                       corresponding predictors in the right channel are
   72|       |                       switched to "off".
   73|       |                     */
   74|       |                    ics->pred.prediction_used[sfb] = 0;
   75|       |                    icsr->pred.prediction_used[sfb] = 0;
   76|       |#endif
   77|       |
   78|  9.30k|#ifndef FIXED_POINT
   79|  9.30k|                    scale_factor = min(max(scale_factor, -120), 120);
  ------------------
  |  |   60|  18.6k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 9.03k, False: 265]
  |  |  |  Branch (60:22): [True: 8.75k, False: 545]
  |  |  |  Branch (60:35): [True: 8.49k, False: 545]
  |  |  ------------------
  ------------------
   80|  9.30k|                    scale = (real_t)pow(0.5, (0.25*scale_factor));
   81|       |#else
   82|       |                    scale_factor = min(max(scale_factor, -60), 60);
   83|       |                    exp = scale_factor >> 2; /* exp is -15..15 */
   84|       |                    frac = scale_factor & 3;
   85|       |                    scale = pow05_table[frac];
   86|       |                    exp += COEF_BITS - REAL_BITS; /* exp is -1..29 */
   87|       |                    if (exp < 0)
   88|       |                        scale <<= -exp;
   89|       |                    else
   90|       |                        scale >>= exp;
   91|       |#endif
   92|       |
   93|       |                    /* Scale from left to right channel,
   94|       |                       do not touch left channel */
   95|  68.7k|                    for (i = icsr->swb_offset[sfb]; i < min(icsr->swb_offset[sfb+1], ics->swb_offset_max); i++)
  ------------------
  |  |   60|  68.7k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 67.5k, False: 1.15k]
  |  |  ------------------
  ------------------
  |  Branch (95:53): [True: 59.4k, False: 9.30k]
  ------------------
   96|  59.4k|                    {
   97|  59.4k|                        r_spec[(group*nshort)+i] = MUL_R(l_spec[(group*nshort)+i], scale);
  ------------------
  |  |  284|  59.4k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
   98|  59.4k|                        if (is_intensity(icsr, g, sfb) != invert_intensity(ics, g, sfb))
  ------------------
  |  Branch (98:29): [True: 19.9k, False: 39.4k]
  ------------------
   99|  19.9k|                            r_spec[(group*nshort)+i] = -r_spec[(group*nshort)+i];
  100|  59.4k|                    }
  101|  9.30k|                }
  102|  66.3k|            }
  103|  38.7k|            group++;
  104|  38.7k|        }
  105|  35.4k|    }
  106|  17.5k|}

specrec.c:is_intensity:
   44|  5.45M|{
   45|  5.45M|    switch (ics->sfb_cb[group][sfb])
   46|  5.45M|    {
   47|  4.90k|    case INTENSITY_HCB:
  ------------------
  |  |  108|  4.90k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (47:5): [True: 4.90k, False: 5.45M]
  ------------------
   48|  4.90k|        return 1;
   49|  1.05k|    case INTENSITY_HCB2:
  ------------------
  |  |  107|  1.05k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (49:5): [True: 1.05k, False: 5.45M]
  ------------------
   50|  1.05k|        return -1;
   51|  5.44M|    default:
  ------------------
  |  Branch (51:5): [True: 5.44M, False: 5.95k]
  ------------------
   52|  5.44M|        return 0;
   53|  5.45M|    }
   54|  5.45M|}
ms.c:is_intensity:
   44|  8.89k|{
   45|  8.89k|    switch (ics->sfb_cb[group][sfb])
   46|  8.89k|    {
   47|  6.27k|    case INTENSITY_HCB:
  ------------------
  |  |  108|  6.27k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (47:5): [True: 6.27k, False: 2.61k]
  ------------------
   48|  6.27k|        return 1;
   49|    265|    case INTENSITY_HCB2:
  ------------------
  |  |  107|    265|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (49:5): [True: 265, False: 8.62k]
  ------------------
   50|    265|        return -1;
   51|  2.35k|    default:
  ------------------
  |  Branch (51:5): [True: 2.35k, False: 6.53k]
  ------------------
   52|  2.35k|        return 0;
   53|  8.89k|    }
   54|  8.89k|}
is.c:is_intensity:
   44|   125k|{
   45|   125k|    switch (ics->sfb_cb[group][sfb])
   46|   125k|    {
   47|  59.7k|    case INTENSITY_HCB:
  ------------------
  |  |  108|  59.7k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (47:5): [True: 59.7k, False: 65.9k]
  ------------------
   48|  59.7k|        return 1;
   49|  8.94k|    case INTENSITY_HCB2:
  ------------------
  |  |  107|  8.94k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (49:5): [True: 8.94k, False: 116k]
  ------------------
   50|  8.94k|        return -1;
   51|  57.0k|    default:
  ------------------
  |  Branch (51:5): [True: 57.0k, False: 68.7k]
  ------------------
   52|  57.0k|        return 0;
   53|   125k|    }
   54|   125k|}
is.c:invert_intensity:
   57|  59.4k|{
   58|  59.4k|    if (ics->ms_mask_present == 1)
  ------------------
  |  Branch (58:9): [True: 19.4k, False: 40.0k]
  ------------------
   59|  19.4k|        return (1-2*ics->ms_used[group][sfb]);
   60|  40.0k|    return 1;
   61|  59.4k|}

faad_mdct_init:
   63|  13.2k|{
   64|  13.2k|    mdct_info *mdct = (mdct_info*)faad_malloc(sizeof(mdct_info));
   65|       |
   66|  13.2k|    assert(N % 8 == 0);
  ------------------
  |  Branch (66:5): [True: 0, False: 13.2k]
  |  Branch (66:5): [True: 13.2k, False: 0]
  ------------------
   67|       |
   68|  13.2k|    mdct->N = N;
   69|       |
   70|       |    /* NOTE: For "small framelengths" in FIXED_POINT the coefficients need to be
   71|       |     * scaled by sqrt("(nearest power of 2) > N" / N) */
   72|       |
   73|       |    /* RE(mdct->sincos[k]) = scale*(real_t)(cos(2.0*M_PI*(k+1./8.) / (real_t)N));
   74|       |     * IM(mdct->sincos[k]) = scale*(real_t)(sin(2.0*M_PI*(k+1./8.) / (real_t)N)); */
   75|       |    /* scale is 1 for fixed point, sqrt(N) for floating point */
   76|  13.2k|    switch (N)
  ------------------
  |  Branch (76:13): [True: 13.2k, False: 0]
  ------------------
   77|  13.2k|    {
   78|  4.81k|    case 2048: mdct->sincos = (complex_t*)mdct_tab_2048; break;
  ------------------
  |  Branch (78:5): [True: 4.81k, False: 8.43k]
  ------------------
   79|  4.81k|    case 256:  mdct->sincos = (complex_t*)mdct_tab_256;  break;
  ------------------
  |  Branch (79:5): [True: 4.81k, False: 8.43k]
  ------------------
   80|       |#ifdef LD_DEC
   81|       |    case 1024: mdct->sincos = (complex_t*)mdct_tab_1024; break;
   82|       |#endif
   83|      0|#ifdef ALLOW_SMALL_FRAMELENGTH
   84|  1.80k|    case 1920: mdct->sincos = (complex_t*)mdct_tab_1920; break;
  ------------------
  |  Branch (84:5): [True: 1.80k, False: 11.4k]
  ------------------
   85|  1.80k|    case 240:  mdct->sincos = (complex_t*)mdct_tab_240;  break;
  ------------------
  |  Branch (85:5): [True: 1.80k, False: 11.4k]
  ------------------
   86|       |#ifdef LD_DEC
   87|       |    case 960:  mdct->sincos = (complex_t*)mdct_tab_960;  break;
   88|       |#endif
   89|  13.2k|#endif
   90|       |#ifdef SSR_DEC
   91|       |    case 512:  mdct->sincos = (complex_t*)mdct_tab_512;  break;
   92|       |    case 64:   mdct->sincos = (complex_t*)mdct_tab_64;   break;
   93|       |#endif
   94|  13.2k|    }
   95|       |
   96|       |    /* initialise fft */
   97|  13.2k|    mdct->cfft = cffti(N/4);
   98|       |
   99|       |#ifdef PROFILE
  100|       |    mdct->cycles = 0;
  101|       |    mdct->fft_cycles = 0;
  102|       |#endif
  103|       |
  104|  13.2k|    return mdct;
  105|  13.2k|}
faad_mdct_end:
  108|  13.2k|{
  109|  13.2k|    if (mdct != NULL)
  ------------------
  |  Branch (109:9): [True: 13.2k, False: 0]
  ------------------
  110|  13.2k|    {
  111|       |#ifdef PROFILE
  112|       |        printf("MDCT[%.4d]:         %I64d cycles\n", mdct->N, mdct->cycles);
  113|       |        printf("CFFT[%.4d]:         %I64d cycles\n", mdct->N/4, mdct->fft_cycles);
  114|       |#endif
  115|       |
  116|  13.2k|        cfftu(mdct->cfft);
  117|       |
  118|  13.2k|        faad_free(mdct);
  119|  13.2k|    }
  120|  13.2k|}
faad_imdct:
  123|   208k|{
  124|   208k|    uint16_t k;
  125|       |
  126|   208k|    complex_t x;
  127|   208k|#ifdef ALLOW_SMALL_FRAMELENGTH
  128|       |#ifdef FIXED_POINT
  129|       |    real_t scale = 0, b_scale = 0;
  130|       |#endif
  131|   208k|#endif
  132|   208k|    ALIGN complex_t Z1[512];
  133|   208k|    complex_t *sincos = mdct->sincos;
  134|       |
  135|   208k|    uint16_t N  = mdct->N;
  136|   208k|    uint16_t N2 = N >> 1;
  137|   208k|    uint16_t N4 = N >> 2;
  138|   208k|    uint16_t N8 = N >> 3;
  139|       |
  140|       |#ifdef PROFILE
  141|       |    int64_t count1, count2 = faad_get_ts();
  142|       |#endif
  143|       |
  144|   208k|#ifdef ALLOW_SMALL_FRAMELENGTH
  145|       |#ifdef FIXED_POINT
  146|       |    /* detect non-power of 2 */
  147|       |    if (N & (N-1))
  148|       |    {
  149|       |        /* adjust scale for non-power of 2 MDCT */
  150|       |        /* 2048/1920 */
  151|       |        b_scale = 1;
  152|       |        scale = COEF_CONST(1.0666666666666667);
  153|       |    }
  154|       |#endif
  155|   208k|#endif
  156|       |
  157|       |    /* pre-IFFT complex multiplication */
  158|  56.2M|    for (k = 0; k < N4; k++)
  ------------------
  |  Branch (158:17): [True: 56.0M, False: 208k]
  ------------------
  159|  56.0M|    {
  160|  56.0M|        ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
                      ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
  161|  56.0M|            X_in[2*k], X_in[N2 - 1 - 2*k], RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
                          X_in[2*k], X_in[N2 - 1 - 2*k], RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
  162|  56.0M|    }
  163|       |
  164|       |#ifdef PROFILE
  165|       |    count1 = faad_get_ts();
  166|       |#endif
  167|       |
  168|       |    /* complex IFFT, any non-scaling FFT can be used here */
  169|   208k|    cfftb(mdct->cfft, Z1);
  170|       |
  171|       |#ifdef PROFILE
  172|       |    count1 = faad_get_ts() - count1;
  173|       |#endif
  174|       |
  175|       |    /* post-IFFT complex multiplication */
  176|  56.2M|    for (k = 0; k < N4; k++)
  ------------------
  |  Branch (176:17): [True: 56.0M, False: 208k]
  ------------------
  177|  56.0M|    {
  178|  56.0M|        RE(x) = RE(Z1[k]);
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
                      RE(x) = RE(Z1[k]);
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
  179|  56.0M|        IM(x) = IM(Z1[k]);
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
                      IM(x) = IM(Z1[k]);
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
  180|  56.0M|        ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
                      ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
  181|  56.0M|            IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
                          IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
                          IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  391|  56.0M|#define RE(A) (A)[0]
  ------------------
                          IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  392|  56.0M|#define IM(A) (A)[1]
  ------------------
  182|       |
  183|  56.0M|#ifdef ALLOW_SMALL_FRAMELENGTH
  184|       |#ifdef FIXED_POINT
  185|       |        /* non-power of 2 MDCT scaling */
  186|       |        if (b_scale)
  187|       |        {
  188|       |            RE(Z1[k]) = MUL_C(RE(Z1[k]), scale);
  189|       |            IM(Z1[k]) = MUL_C(IM(Z1[k]), scale);
  190|       |        }
  191|       |#endif
  192|  56.0M|#endif
  193|  56.0M|    }
  194|       |
  195|       |    /* reordering */
  196|  14.2M|    for (k = 0; k < N8; k+=2)
  ------------------
  |  Branch (196:17): [True: 14.0M, False: 208k]
  ------------------
  197|  14.0M|    {
  198|  14.0M|        X_out[              2*k] =  IM(Z1[N8 +     k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  199|  14.0M|        X_out[          2 + 2*k] =  IM(Z1[N8 + 1 + k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  200|       |
  201|  14.0M|        X_out[          1 + 2*k] = -RE(Z1[N8 - 1 - k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  202|  14.0M|        X_out[          3 + 2*k] = -RE(Z1[N8 - 2 - k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  203|       |
  204|  14.0M|        X_out[N4 +          2*k] =  RE(Z1[         k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  205|  14.0M|        X_out[N4 +    + 2 + 2*k] =  RE(Z1[     1 + k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  206|       |
  207|  14.0M|        X_out[N4 +      1 + 2*k] = -IM(Z1[N4 - 1 - k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  208|  14.0M|        X_out[N4 +      3 + 2*k] = -IM(Z1[N4 - 2 - k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  209|       |
  210|  14.0M|        X_out[N2 +          2*k] =  RE(Z1[N8 +     k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  211|  14.0M|        X_out[N2 +    + 2 + 2*k] =  RE(Z1[N8 + 1 + k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  212|       |
  213|  14.0M|        X_out[N2 +      1 + 2*k] = -IM(Z1[N8 - 1 - k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  214|  14.0M|        X_out[N2 +      3 + 2*k] = -IM(Z1[N8 - 2 - k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  215|       |
  216|  14.0M|        X_out[N2 + N4 +     2*k] = -IM(Z1[         k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  217|  14.0M|        X_out[N2 + N4 + 2 + 2*k] = -IM(Z1[     1 + k]);
  ------------------
  |  |  392|  14.0M|#define IM(A) (A)[1]
  ------------------
  218|       |
  219|  14.0M|        X_out[N2 + N4 + 1 + 2*k] =  RE(Z1[N4 - 1 - k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  220|  14.0M|        X_out[N2 + N4 + 3 + 2*k] =  RE(Z1[N4 - 2 - k]);
  ------------------
  |  |  391|  14.0M|#define RE(A) (A)[0]
  ------------------
  221|  14.0M|    }
  222|       |
  223|       |#ifdef PROFILE
  224|       |    count2 = faad_get_ts() - count2;
  225|       |    mdct->fft_cycles += count1;
  226|       |    mdct->cycles += (count2 - count1);
  227|       |#endif
  228|   208k|}

AudioSpecificConfigFromBitfile:
  130|  2.06k|{
  131|  2.06k|    int8_t result = 0;
  132|  2.06k|    uint32_t startpos = faad_get_processed_bits(ld);
  133|  2.06k|#ifdef SBR_DEC
  134|  2.06k|    int8_t bits_to_decode = 0;
  135|  2.06k|#endif
  136|       |
  137|  2.06k|    if (mp4ASC == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2.06k]
  ------------------
  138|      0|        return -8;
  139|       |
  140|  2.06k|    memset(mp4ASC, 0, sizeof(mp4AudioSpecificConfig));
  141|       |
  142|  2.06k|    mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(ld, 5
  143|  2.06k|        DEBUGVAR(1,1,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
  144|       |
  145|  2.06k|    mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(ld, 4
  146|  2.06k|        DEBUGVAR(1,2,"parse_audio_decoder_specific_info(): SamplingFrequencyIndex"));
  147|  2.06k|	if(mp4ASC->samplingFrequencyIndex==0x0f)
  ------------------
  |  Branch (147:5): [True: 1, False: 2.05k]
  ------------------
  148|      1|		faad_getbits(ld, 24);
  149|       |
  150|  2.06k|    mp4ASC->channelsConfiguration = (uint8_t)faad_getbits(ld, 4
  151|  2.06k|        DEBUGVAR(1,3,"parse_audio_decoder_specific_info(): ChannelsConfiguration"));
  152|       |
  153|  2.06k|    mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
  154|       |
  155|  2.06k|    if (ObjectTypesTable[mp4ASC->objectTypeIndex] != 1)
  ------------------
  |  Branch (155:9): [True: 7, False: 2.05k]
  ------------------
  156|      7|    {
  157|      7|        return -1;
  158|      7|    }
  159|       |
  160|  2.05k|    if (mp4ASC->samplingFrequency == 0)
  ------------------
  |  Branch (160:9): [True: 1, False: 2.05k]
  ------------------
  161|      1|    {
  162|      1|        return -2;
  163|      1|    }
  164|       |
  165|  2.05k|    if (mp4ASC->channelsConfiguration > 7)
  ------------------
  |  Branch (165:9): [True: 3, False: 2.04k]
  ------------------
  166|      3|    {
  167|      3|        return -3;
  168|      3|    }
  169|       |
  170|  2.04k|#if (defined(PS_DEC) || defined(DRM_PS))
  171|       |    /* check if we have a mono file */
  172|  2.04k|    if (mp4ASC->channelsConfiguration == 1)
  ------------------
  |  Branch (172:9): [True: 175, False: 1.87k]
  ------------------
  173|    175|    {
  174|       |        /* upMatrix to 2 channels for implicit signalling of PS */
  175|    175|        mp4ASC->channelsConfiguration = 2;
  176|    175|    }
  177|  2.04k|#endif
  178|       |
  179|  2.04k|#ifdef SBR_DEC
  180|  2.04k|    mp4ASC->sbr_present_flag = -1;
  181|  2.04k|    if (mp4ASC->objectTypeIndex == 5 || mp4ASC->objectTypeIndex == 29)
  ------------------
  |  Branch (181:9): [True: 521, False: 1.52k]
  |  Branch (181:41): [True: 8, False: 1.52k]
  ------------------
  182|    529|    {
  183|    529|        uint8_t tmp;
  184|       |
  185|    529|        mp4ASC->sbr_present_flag = 1;
  186|    529|        tmp = (uint8_t)faad_getbits(ld, 4
  187|    529|            DEBUGVAR(1,5,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  188|       |        /* check for downsampled SBR */
  189|    529|        if (tmp == mp4ASC->samplingFrequencyIndex)
  ------------------
  |  Branch (189:13): [True: 83, False: 446]
  ------------------
  190|     83|            mp4ASC->downSampledSBR = 1;
  191|    529|        mp4ASC->samplingFrequencyIndex = tmp;
  192|    529|        if (mp4ASC->samplingFrequencyIndex == 15)
  ------------------
  |  Branch (192:13): [True: 4, False: 525]
  ------------------
  193|      4|        {
  194|      4|            mp4ASC->samplingFrequency = (uint32_t)faad_getbits(ld, 24
  195|      4|                DEBUGVAR(1,6,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  196|    525|        } else {
  197|    525|            mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
  198|    525|        }
  199|    529|        mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(ld, 5
  200|    529|            DEBUGVAR(1,7,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
  201|    529|    }
  202|  2.04k|#endif
  203|       |
  204|       |    /* get GASpecificConfig */
  205|  2.04k|    if (mp4ASC->objectTypeIndex == 1 || mp4ASC->objectTypeIndex == 2 ||
  ------------------
  |  Branch (205:9): [True: 105, False: 1.94k]
  |  Branch (205:41): [True: 396, False: 1.54k]
  ------------------
  206|  1.54k|        mp4ASC->objectTypeIndex == 3 || mp4ASC->objectTypeIndex == 4 ||
  ------------------
  |  Branch (206:9): [True: 27, False: 1.52k]
  |  Branch (206:41): [True: 13, False: 1.50k]
  ------------------
  207|  1.50k|        mp4ASC->objectTypeIndex == 6 || mp4ASC->objectTypeIndex == 7)
  ------------------
  |  Branch (207:9): [True: 8, False: 1.50k]
  |  Branch (207:41): [True: 9, False: 1.49k]
  ------------------
  208|    558|    {
  209|    558|        result = GASpecificConfig(ld, mp4ASC, pce);
  210|       |
  211|    558|#ifdef ERROR_RESILIENCE
  212|  1.49k|    } else if (mp4ASC->objectTypeIndex >= ER_OBJECT_START) { /* ER */
  ------------------
  |  |   71|  1.49k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (212:16): [True: 1.48k, False: 7]
  ------------------
  213|  1.48k|        result = GASpecificConfig(ld, mp4ASC, pce);
  214|  1.48k|        mp4ASC->epConfig = (uint8_t)faad_getbits(ld, 2
  215|  1.48k|            DEBUGVAR(1,143,"parse_audio_decoder_specific_info(): epConfig"));
  216|       |
  217|  1.48k|        if (mp4ASC->epConfig != 0)
  ------------------
  |  Branch (217:13): [True: 3, False: 1.48k]
  ------------------
  218|      3|            result = -5;
  219|  1.48k|#endif
  220|       |
  221|  1.48k|    } else {
  222|      7|        result = -4;
  223|      7|    }
  224|       |
  225|       |#ifdef SSR_DEC
  226|       |    /* shorter frames not allowed for SSR */
  227|       |    if ((mp4ASC->objectTypeIndex == 4) && mp4ASC->frameLengthFlag)
  228|       |        return -6;
  229|       |#endif
  230|       |
  231|       |
  232|  2.04k|#ifdef SBR_DEC
  233|  2.04k|    if(short_form)
  ------------------
  |  Branch (233:8): [True: 0, False: 2.04k]
  ------------------
  234|      0|        bits_to_decode = 0;
  235|  2.04k|    else
  236|  2.04k|		bits_to_decode = (int8_t)(buffer_size*8 + faad_get_processed_bits(ld) - startpos);
  237|       |
  238|  2.04k|    if ((mp4ASC->objectTypeIndex != 5 && mp4ASC->objectTypeIndex != 29) && (bits_to_decode >= 16))
  ------------------
  |  Branch (238:10): [True: 2.04k, False: 1]
  |  Branch (238:42): [True: 2.03k, False: 11]
  |  Branch (238:76): [True: 1.82k, False: 217]
  ------------------
  239|  1.82k|    {
  240|  1.82k|        int16_t syncExtensionType = (int16_t)faad_getbits(ld, 11
  241|  1.82k|            DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
  242|       |
  243|  1.82k|        if (syncExtensionType == 0x2b7)
  ------------------
  |  Branch (243:13): [True: 107, False: 1.71k]
  ------------------
  244|    107|        {
  245|    107|            uint8_t tmp_OTi = (uint8_t)faad_getbits(ld, 5
  246|    107|                DEBUGVAR(1,10,"parse_audio_decoder_specific_info(): extensionAudioObjectType"));
  247|       |
  248|    107|            if (tmp_OTi == 5)
  ------------------
  |  Branch (248:17): [True: 104, False: 3]
  ------------------
  249|    104|            {
  250|    104|                mp4ASC->sbr_present_flag = (uint8_t)faad_get1bit(ld
  251|    104|                    DEBUGVAR(1,11,"parse_audio_decoder_specific_info(): sbr_present_flag"));
  252|       |
  253|    104|                if (mp4ASC->sbr_present_flag)
  ------------------
  |  Branch (253:21): [True: 100, False: 4]
  ------------------
  254|    100|                {
  255|    100|                    uint8_t tmp;
  256|       |
  257|       |					/* Don't set OT to SBR until checked that it is actually there */
  258|    100|					mp4ASC->objectTypeIndex = tmp_OTi;
  259|       |
  260|    100|                    tmp = (uint8_t)faad_getbits(ld, 4
  261|    100|                        DEBUGVAR(1,12,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  262|       |
  263|       |                    /* check for downsampled SBR */
  264|    100|                    if (tmp == mp4ASC->samplingFrequencyIndex)
  ------------------
  |  Branch (264:25): [True: 10, False: 90]
  ------------------
  265|     10|                        mp4ASC->downSampledSBR = 1;
  266|    100|                    mp4ASC->samplingFrequencyIndex = tmp;
  267|       |
  268|    100|                    if (mp4ASC->samplingFrequencyIndex == 15)
  ------------------
  |  Branch (268:25): [True: 3, False: 97]
  ------------------
  269|      3|                    {
  270|      3|                        mp4ASC->samplingFrequency = (uint32_t)faad_getbits(ld, 24
  271|      3|                            DEBUGVAR(1,13,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  272|     97|                    } else {
  273|     97|                        mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
  274|     97|                    }
  275|    100|                }
  276|    104|            }
  277|    107|        }
  278|  1.82k|    }
  279|       |
  280|       |    /* no SBR signalled, this could mean either implicit signalling or no SBR in this file */
  281|       |    /* MPEG specification states: assume SBR on files with samplerate <= 24000 Hz */
  282|  2.04k|    if (mp4ASC->sbr_present_flag == (char)-1) /* cannot be -1 on systems with unsigned char */
  ------------------
  |  Branch (282:9): [True: 1.41k, False: 630]
  ------------------
  283|  1.41k|    {
  284|  1.41k|        if (mp4ASC->samplingFrequency <= 24000)
  ------------------
  |  Branch (284:13): [True: 720, False: 699]
  ------------------
  285|    720|        {
  286|    720|            mp4ASC->samplingFrequency *= 2;
  287|    720|            mp4ASC->forceUpSampling = 1;
  288|    720|        } else /* > 24000*/ {
  289|    699|            mp4ASC->downSampledSBR = 1;
  290|    699|        }
  291|  1.41k|    }
  292|  2.04k|#endif
  293|       |
  294|  2.04k|    faad_endbits(ld);
  295|       |
  296|  2.04k|    return result;
  297|  2.05k|}
AudioSpecificConfig2:
  304|  2.06k|{
  305|  2.06k|    uint8_t ret = 0;
  306|  2.06k|    bitfile ld;
  307|  2.06k|    faad_initbits(&ld, pBuffer, buffer_size);
  308|  2.06k|    if (ld.error != 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 2.06k]
  ------------------
  309|      0|        return -7;
  310|  2.06k|    ret = AudioSpecificConfigFromBitfile(&ld, mp4ASC, pce, buffer_size, short_form);
  311|  2.06k|    faad_endbits(&ld);
  312|  2.06k|    return ret;
  313|  2.06k|}

ms_decode:
   41|  17.5k|{
   42|  17.5k|    uint8_t g, b, sfb;
   43|  17.5k|    uint8_t group = 0;
   44|  17.5k|    uint16_t nshort = frame_len/8;
   45|       |
   46|  17.5k|    uint16_t i, k;
   47|  17.5k|    real_t tmp;
   48|       |
   49|  17.5k|    if (ics->ms_mask_present >= 1)
  ------------------
  |  Branch (49:9): [True: 5.23k, False: 12.3k]
  ------------------
   50|  5.23k|    {
   51|  14.3k|        for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (51:21): [True: 9.11k, False: 5.23k]
  ------------------
   52|  9.11k|        {
   53|  20.5k|            for (b = 0; b < ics->window_group_length[g]; b++)
  ------------------
  |  Branch (53:25): [True: 11.4k, False: 9.11k]
  ------------------
   54|  11.4k|            {
   55|  23.0k|                for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (55:31): [True: 11.6k, False: 11.4k]
  ------------------
   56|  11.6k|                {
   57|       |                    /* If intensity stereo coding or noise substitution is on
   58|       |                       for a particular scalefactor band, no M/S stereo decoding
   59|       |                       is carried out.
   60|       |                     */
   61|  11.6k|                    if ((ics->ms_used[g][sfb] || ics->ms_mask_present == 2) &&
  ------------------
  |  Branch (61:26): [True: 3.14k, False: 8.46k]
  |  Branch (61:50): [True: 5.74k, False: 2.72k]
  ------------------
   62|  8.89k|                        !is_intensity(icsr, g, sfb) && !is_noise(ics, g, sfb))
  ------------------
  |  Branch (62:25): [True: 2.35k, False: 6.53k]
  |  Branch (62:56): [True: 2.35k, False: 0]
  ------------------
   63|  2.35k|                    {
   64|  31.9k|                        for (i = ics->swb_offset[sfb]; i < min(ics->swb_offset[sfb+1], ics->swb_offset_max); i++)
  ------------------
  |  |   60|  31.9k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 29.6k, False: 2.36k]
  |  |  ------------------
  ------------------
  |  Branch (64:56): [True: 29.6k, False: 2.35k]
  ------------------
   65|  29.6k|                        {
   66|  29.6k|                            k = (group*nshort) + i;
   67|  29.6k|                            tmp = l_spec[k] - r_spec[k];
   68|  29.6k|                            l_spec[k] = l_spec[k] + r_spec[k];
   69|  29.6k|                            r_spec[k] = tmp;
   70|  29.6k|                        }
   71|  2.35k|                    }
   72|  11.6k|                }
   73|  11.4k|                group++;
   74|  11.4k|            }
   75|  9.11k|        }
   76|  5.23k|    }
   77|  17.5k|}

output_to_PCM:
  401|  2.08k|{
  402|  2.08k|    int16_t   *short_sample_buffer = (int16_t*)sample_buffer;
  403|  2.08k|    int32_t   *int_sample_buffer = (int32_t*)sample_buffer;
  404|  2.08k|    float32_t *float_sample_buffer = (float32_t*)sample_buffer;
  405|  2.08k|    double    *double_sample_buffer = (double*)sample_buffer;
  406|       |
  407|       |#ifdef PROFILE
  408|       |    int64_t count = faad_get_ts();
  409|       |#endif
  410|       |
  411|       |    /* Copy output to a standard PCM buffer */
  412|  2.08k|    switch (format)
  ------------------
  |  Branch (412:13): [True: 2.08k, False: 0]
  ------------------
  413|  2.08k|    {
  414|    692|    case FAAD_FMT_16BIT:
  ------------------
  |  |   98|    692|#define FAAD_FMT_16BIT  1
  ------------------
  |  Branch (414:5): [True: 692, False: 1.39k]
  ------------------
  415|    692|        to_PCM_16bit(hDecoder, input, channels, frame_len, &short_sample_buffer);
  416|    692|        break;
  417|    447|    case FAAD_FMT_24BIT:
  ------------------
  |  |   99|    447|#define FAAD_FMT_24BIT  2
  ------------------
  |  Branch (417:5): [True: 447, False: 1.64k]
  ------------------
  418|    447|        to_PCM_24bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
  419|    447|        break;
  420|    502|    case FAAD_FMT_32BIT:
  ------------------
  |  |  100|    502|#define FAAD_FMT_32BIT  3
  ------------------
  |  Branch (420:5): [True: 502, False: 1.58k]
  ------------------
  421|    502|        to_PCM_32bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
  422|    502|        break;
  423|    224|    case FAAD_FMT_FLOAT:
  ------------------
  |  |  101|    224|#define FAAD_FMT_FLOAT  4
  ------------------
  |  Branch (423:5): [True: 224, False: 1.86k]
  ------------------
  424|    224|        to_PCM_float(hDecoder, input, channels, frame_len, &float_sample_buffer);
  425|    224|        break;
  426|    222|    case FAAD_FMT_DOUBLE:
  ------------------
  |  |  103|    222|#define FAAD_FMT_DOUBLE 5
  ------------------
  |  Branch (426:5): [True: 222, False: 1.86k]
  ------------------
  427|    222|        to_PCM_double(hDecoder, input, channels, frame_len, &double_sample_buffer);
  428|    222|        break;
  429|  2.08k|    }
  430|       |
  431|       |#ifdef PROFILE
  432|       |    count = faad_get_ts() - count;
  433|       |    hDecoder->output_cycles += count;
  434|       |#endif
  435|       |
  436|  2.08k|    return sample_buffer;
  437|  2.08k|}
output.c:to_PCM_16bit:
   92|    692|{
   93|    692|    uint8_t ch, ch1;
   94|    692|    uint16_t i;
   95|       |
   96|    692|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    692|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
   97|    692|    {
   98|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (98:5): [True: 0, False: 692]
  ------------------
   99|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (99:5): [True: 0, False: 692]
  ------------------
  100|      0|        for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (100:20): [True: 0, False: 0]
  ------------------
  101|      0|        {
  102|      0|            real_t inp = input[hDecoder->internal_channel[0]][i];
  103|       |
  104|      0|            CLIP(inp, 32767.0f, -32768.0f);
  ------------------
  |  |   64|      0|#define CLIP(sample, max, min) \
  |  |   65|      0|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   66|      0|{                              \
  |  |   67|      0|    sample += 0.5f;            \
  |  |   68|      0|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   69|      0|        sample = max;          \
  |  |   70|      0|} else {                       \
  |  |   71|      0|    sample += -0.5f;           \
  |  |   72|      0|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|        sample = min;          \
  |  |   74|      0|}
  ------------------
  105|       |
  106|      0|            (*sample_buffer)[i] = (int16_t)lrintf(inp);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  107|      0|        }
  108|      0|        break;
  109|    427|    case CONV(2,0):
  ------------------
  |  |   87|    427|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (109:5): [True: 427, False: 265]
  ------------------
  110|    427|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (110:13): [True: 0, False: 427]
  ------------------
  111|      0|        {
  112|      0|            ch  = hDecoder->internal_channel[0];
  113|      0|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (113:24): [True: 0, False: 0]
  ------------------
  114|      0|            {
  115|      0|                real_t inp0 = input[ch][i];
  116|       |
  117|      0|                CLIP(inp0, 32767.0f, -32768.0f);
  ------------------
  |  |   64|      0|#define CLIP(sample, max, min) \
  |  |   65|      0|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   66|      0|{                              \
  |  |   67|      0|    sample += 0.5f;            \
  |  |   68|      0|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   69|      0|        sample = max;          \
  |  |   70|      0|} else {                       \
  |  |   71|      0|    sample += -0.5f;           \
  |  |   72|      0|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|        sample = min;          \
  |  |   74|      0|}
  ------------------
  118|       |
  119|      0|                (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  120|      0|                (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp0);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  121|      0|            }
  122|    427|        } else {
  123|    427|            ch  = hDecoder->internal_channel[0];
  124|    427|            ch1 = hDecoder->internal_channel[1];
  125|   713k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (125:24): [True: 713k, False: 427]
  ------------------
  126|   713k|            {
  127|   713k|                real_t inp0 = input[ch ][i];
  128|   713k|                real_t inp1 = input[ch1][i];
  129|       |
  130|   713k|                CLIP(inp0, 32767.0f, -32768.0f);
  ------------------
  |  |   64|   713k|#define CLIP(sample, max, min) \
  |  |   65|   713k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 510k, False: 202k]
  |  |  ------------------
  |  |   66|   510k|{                              \
  |  |   67|   510k|    sample += 0.5f;            \
  |  |   68|   510k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 23.3k, False: 487k]
  |  |  ------------------
  |  |   69|   510k|        sample = max;          \
  |  |   70|   510k|} else {                       \
  |  |   71|   202k|    sample += -0.5f;           \
  |  |   72|   202k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 22.5k, False: 180k]
  |  |  ------------------
  |  |   73|   202k|        sample = min;          \
  |  |   74|   202k|}
  ------------------
  131|   713k|                CLIP(inp1, 32767.0f, -32768.0f);
  ------------------
  |  |   64|   713k|#define CLIP(sample, max, min) \
  |  |   65|   713k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 543k, False: 170k]
  |  |  ------------------
  |  |   66|   543k|{                              \
  |  |   67|   543k|    sample += 0.5f;            \
  |  |   68|   543k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 14.3k, False: 528k]
  |  |  ------------------
  |  |   69|   543k|        sample = max;          \
  |  |   70|   543k|} else {                       \
  |  |   71|   170k|    sample += -0.5f;           \
  |  |   72|   170k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 13.9k, False: 156k]
  |  |  ------------------
  |  |   73|   170k|        sample = min;          \
  |  |   74|   170k|}
  ------------------
  132|       |
  133|   713k|                (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
  ------------------
  |  |  387|   713k|#define lrintf(f) ((long)(f))
  ------------------
  134|   713k|                (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp1);
  ------------------
  |  |  387|   713k|#define lrintf(f) ((long)(f))
  ------------------
  135|   713k|            }
  136|    427|        }
  137|    427|        break;
  138|    265|    default:
  ------------------
  |  Branch (138:5): [True: 265, False: 427]
  ------------------
  139|  3.13k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (139:22): [True: 2.87k, False: 265]
  ------------------
  140|  2.87k|        {
  141|  4.49M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (141:24): [True: 4.49M, False: 2.87k]
  ------------------
  142|  4.49M|            {
  143|  4.49M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  144|       |
  145|  4.49M|                CLIP(inp, 32767.0f, -32768.0f);
  ------------------
  |  |   64|  4.49M|#define CLIP(sample, max, min) \
  |  |   65|  4.49M|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 3.91M, False: 579k]
  |  |  ------------------
  |  |   66|  3.91M|{                              \
  |  |   67|  3.91M|    sample += 0.5f;            \
  |  |   68|  3.91M|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 43.8k, False: 3.87M]
  |  |  ------------------
  |  |   69|  3.91M|        sample = max;          \
  |  |   70|  3.91M|} else {                       \
  |  |   71|   579k|    sample += -0.5f;           \
  |  |   72|   579k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 41.7k, False: 537k]
  |  |  ------------------
  |  |   73|   579k|        sample = min;          \
  |  |   74|   579k|}
  ------------------
  146|       |
  147|  4.49M|                (*sample_buffer)[(i*channels)+ch] = (int16_t)lrintf(inp);
  ------------------
  |  |  387|  4.49M|#define lrintf(f) ((long)(f))
  ------------------
  148|  4.49M|            }
  149|  2.87k|        }
  150|    265|        break;
  151|    692|    }
  152|    692|}
output.c:get_sample:
   47|  16.1M|{
   48|  16.1M|    if (!down_matrix)
  ------------------
  |  Branch (48:9): [True: 15.0M, False: 1.13M]
  ------------------
   49|  15.0M|        return input[internal_channel[channel]][sample];
   50|       |
   51|  1.13M|    if (channel == 0)
  ------------------
  |  Branch (51:9): [True: 566k, False: 566k]
  ------------------
   52|   566k|    {
   53|   566k|        return DM_MUL * (input[internal_channel[1]][sample] +
  ------------------
  |  |   41|   566k|#define DM_MUL REAL_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
  |  |  ------------------
  |  |  |  |  288|   566k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   54|   566k|            input[internal_channel[0]][sample] * RSQRT2 +
  ------------------
  |  |   42|   566k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   566k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   55|   566k|            input[internal_channel[3]][sample] * RSQRT2);
  ------------------
  |  |   42|   566k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   566k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   56|   566k|    } else {
   57|   566k|        return DM_MUL * (input[internal_channel[2]][sample] +
  ------------------
  |  |   41|   566k|#define DM_MUL REAL_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
  |  |  ------------------
  |  |  |  |  288|   566k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   58|   566k|            input[internal_channel[0]][sample] * RSQRT2 +
  ------------------
  |  |   42|   566k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   566k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   59|   566k|            input[internal_channel[4]][sample] * RSQRT2);
  ------------------
  |  |   42|   566k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   566k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   60|   566k|    }
   61|  1.13M|}
output.c:to_PCM_24bit:
  157|    447|{
  158|    447|    uint8_t ch, ch1;
  159|    447|    uint16_t i;
  160|       |
  161|    447|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    447|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  162|    447|    {
  163|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (163:5): [True: 0, False: 447]
  ------------------
  164|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (164:5): [True: 0, False: 447]
  ------------------
  165|      0|        for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (165:20): [True: 0, False: 0]
  ------------------
  166|      0|        {
  167|      0|            real_t inp = input[hDecoder->internal_channel[0]][i];
  168|       |
  169|      0|            inp *= 256.0f;
  170|      0|            CLIP(inp, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|      0|#define CLIP(sample, max, min) \
  |  |   65|      0|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   66|      0|{                              \
  |  |   67|      0|    sample += 0.5f;            \
  |  |   68|      0|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   69|      0|        sample = max;          \
  |  |   70|      0|} else {                       \
  |  |   71|      0|    sample += -0.5f;           \
  |  |   72|      0|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|        sample = min;          \
  |  |   74|      0|}
  ------------------
  171|       |
  172|      0|            (*sample_buffer)[i] = (int32_t)lrintf(inp);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  173|      0|        }
  174|      0|        break;
  175|    197|    case CONV(2,0):
  ------------------
  |  |   87|    197|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (175:5): [True: 197, False: 250]
  ------------------
  176|    197|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (176:13): [True: 0, False: 197]
  ------------------
  177|      0|        {
  178|      0|            ch = hDecoder->internal_channel[0];
  179|      0|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (179:24): [True: 0, False: 0]
  ------------------
  180|      0|            {
  181|      0|                real_t inp0 = input[ch][i];
  182|       |
  183|      0|                inp0 *= 256.0f;
  184|      0|                CLIP(inp0, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|      0|#define CLIP(sample, max, min) \
  |  |   65|      0|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   66|      0|{                              \
  |  |   67|      0|    sample += 0.5f;            \
  |  |   68|      0|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   69|      0|        sample = max;          \
  |  |   70|      0|} else {                       \
  |  |   71|      0|    sample += -0.5f;           \
  |  |   72|      0|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|        sample = min;          \
  |  |   74|      0|}
  ------------------
  185|       |
  186|      0|                (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  187|      0|                (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  188|      0|            }
  189|    197|        } else {
  190|    197|            ch  = hDecoder->internal_channel[0];
  191|    197|            ch1 = hDecoder->internal_channel[1];
  192|   331k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (192:24): [True: 331k, False: 197]
  ------------------
  193|   331k|            {
  194|   331k|                real_t inp0 = input[ch ][i];
  195|   331k|                real_t inp1 = input[ch1][i];
  196|       |
  197|   331k|                inp0 *= 256.0f;
  198|   331k|                inp1 *= 256.0f;
  199|   331k|                CLIP(inp0, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|   331k|#define CLIP(sample, max, min) \
  |  |   65|   331k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 261k, False: 69.7k]
  |  |  ------------------
  |  |   66|   261k|{                              \
  |  |   67|   261k|    sample += 0.5f;            \
  |  |   68|   261k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 24.3k, False: 236k]
  |  |  ------------------
  |  |   69|   261k|        sample = max;          \
  |  |   70|   261k|} else {                       \
  |  |   71|  69.7k|    sample += -0.5f;           \
  |  |   72|  69.7k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 24.3k, False: 45.4k]
  |  |  ------------------
  |  |   73|  69.7k|        sample = min;          \
  |  |   74|  69.7k|}
  ------------------
  200|   331k|                CLIP(inp1, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|   331k|#define CLIP(sample, max, min) \
  |  |   65|   331k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 285k, False: 45.6k]
  |  |  ------------------
  |  |   66|   285k|{                              \
  |  |   67|   285k|    sample += 0.5f;            \
  |  |   68|   285k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 14.1k, False: 271k]
  |  |  ------------------
  |  |   69|   285k|        sample = max;          \
  |  |   70|   285k|} else {                       \
  |  |   71|  45.6k|    sample += -0.5f;           \
  |  |   72|  45.6k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 14.0k, False: 31.5k]
  |  |  ------------------
  |  |   73|  45.6k|        sample = min;          \
  |  |   74|  45.6k|}
  ------------------
  201|       |
  202|   331k|                (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|   331k|#define lrintf(f) ((long)(f))
  ------------------
  203|   331k|                (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
  ------------------
  |  |  387|   331k|#define lrintf(f) ((long)(f))
  ------------------
  204|   331k|            }
  205|    197|        }
  206|    197|        break;
  207|    250|    default:
  ------------------
  |  Branch (207:5): [True: 250, False: 197]
  ------------------
  208|  3.59k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (208:22): [True: 3.34k, False: 250]
  ------------------
  209|  3.34k|        {
  210|  4.77M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (210:24): [True: 4.77M, False: 3.34k]
  ------------------
  211|  4.77M|            {
  212|  4.77M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  213|       |
  214|  4.77M|                inp *= 256.0f;
  215|  4.77M|                CLIP(inp, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|  4.77M|#define CLIP(sample, max, min) \
  |  |   65|  4.77M|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 3.86M, False: 913k]
  |  |  ------------------
  |  |   66|  3.86M|{                              \
  |  |   67|  3.86M|    sample += 0.5f;            \
  |  |   68|  3.86M|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 67.3k, False: 3.79M]
  |  |  ------------------
  |  |   69|  3.86M|        sample = max;          \
  |  |   70|  3.86M|} else {                       \
  |  |   71|   913k|    sample += -0.5f;           \
  |  |   72|   913k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 57.8k, False: 855k]
  |  |  ------------------
  |  |   73|   913k|        sample = min;          \
  |  |   74|   913k|}
  ------------------
  216|       |
  217|  4.77M|                (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
  ------------------
  |  |  387|  4.77M|#define lrintf(f) ((long)(f))
  ------------------
  218|  4.77M|            }
  219|  3.34k|        }
  220|    250|        break;
  221|    447|    }
  222|    447|}
output.c:to_PCM_32bit:
  227|    502|{
  228|    502|    uint8_t ch, ch1;
  229|    502|    uint16_t i;
  230|       |
  231|    502|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    502|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  232|    502|    {
  233|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (233:5): [True: 0, False: 502]
  ------------------
  234|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (234:5): [True: 0, False: 502]
  ------------------
  235|      0|        for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (235:20): [True: 0, False: 0]
  ------------------
  236|      0|        {
  237|      0|            real_t inp = input[hDecoder->internal_channel[0]][i];
  238|       |
  239|      0|            inp *= 65536.0f;
  240|      0|            CLIP(inp, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|      0|#define CLIP(sample, max, min) \
  |  |   65|      0|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   66|      0|{                              \
  |  |   67|      0|    sample += 0.5f;            \
  |  |   68|      0|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   69|      0|        sample = max;          \
  |  |   70|      0|} else {                       \
  |  |   71|      0|    sample += -0.5f;           \
  |  |   72|      0|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|        sample = min;          \
  |  |   74|      0|}
  ------------------
  241|       |
  242|      0|            (*sample_buffer)[i] = (int32_t)lrintf(inp);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  243|      0|        }
  244|      0|        break;
  245|    281|    case CONV(2,0):
  ------------------
  |  |   87|    281|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (245:5): [True: 281, False: 221]
  ------------------
  246|    281|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (246:13): [True: 0, False: 281]
  ------------------
  247|      0|        {
  248|      0|            ch = hDecoder->internal_channel[0];
  249|      0|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (249:24): [True: 0, False: 0]
  ------------------
  250|      0|            {
  251|      0|                real_t inp0 = input[ch][i];
  252|       |
  253|      0|                inp0 *= 65536.0f;
  254|      0|                CLIP(inp0, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|      0|#define CLIP(sample, max, min) \
  |  |   65|      0|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   66|      0|{                              \
  |  |   67|      0|    sample += 0.5f;            \
  |  |   68|      0|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   69|      0|        sample = max;          \
  |  |   70|      0|} else {                       \
  |  |   71|      0|    sample += -0.5f;           \
  |  |   72|      0|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|        sample = min;          \
  |  |   74|      0|}
  ------------------
  255|       |
  256|      0|                (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  257|      0|                (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|      0|#define lrintf(f) ((long)(f))
  ------------------
  258|      0|            }
  259|    281|        } else {
  260|    281|            ch  = hDecoder->internal_channel[0];
  261|    281|            ch1 = hDecoder->internal_channel[1];
  262|   467k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (262:24): [True: 467k, False: 281]
  ------------------
  263|   467k|            {
  264|   467k|                real_t inp0 = input[ch ][i];
  265|   467k|                real_t inp1 = input[ch1][i];
  266|       |
  267|   467k|                inp0 *= 65536.0f;
  268|   467k|                inp1 *= 65536.0f;
  269|   467k|                CLIP(inp0, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|   467k|#define CLIP(sample, max, min) \
  |  |   65|   467k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 345k, False: 121k]
  |  |  ------------------
  |  |   66|   345k|{                              \
  |  |   67|   345k|    sample += 0.5f;            \
  |  |   68|   345k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 26.2k, False: 319k]
  |  |  ------------------
  |  |   69|   345k|        sample = max;          \
  |  |   70|   345k|} else {                       \
  |  |   71|   121k|    sample += -0.5f;           \
  |  |   72|   121k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 24.9k, False: 96.3k]
  |  |  ------------------
  |  |   73|   121k|        sample = min;          \
  |  |   74|   121k|}
  ------------------
  270|   467k|                CLIP(inp1, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|   467k|#define CLIP(sample, max, min) \
  |  |   65|   467k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 383k, False: 83.7k]
  |  |  ------------------
  |  |   66|   383k|{                              \
  |  |   67|   383k|    sample += 0.5f;            \
  |  |   68|   383k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 9.80k, False: 373k]
  |  |  ------------------
  |  |   69|   383k|        sample = max;          \
  |  |   70|   383k|} else {                       \
  |  |   71|  83.7k|    sample += -0.5f;           \
  |  |   72|  83.7k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 11.1k, False: 72.6k]
  |  |  ------------------
  |  |   73|  83.7k|        sample = min;          \
  |  |   74|  83.7k|}
  ------------------
  271|       |
  272|   467k|                (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|   467k|#define lrintf(f) ((long)(f))
  ------------------
  273|   467k|                (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
  ------------------
  |  |  387|   467k|#define lrintf(f) ((long)(f))
  ------------------
  274|   467k|            }
  275|    281|        }
  276|    281|        break;
  277|    221|    default:
  ------------------
  |  Branch (277:5): [True: 221, False: 281]
  ------------------
  278|  2.03k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (278:22): [True: 1.81k, False: 221]
  ------------------
  279|  1.81k|        {
  280|  2.62M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (280:24): [True: 2.62M, False: 1.81k]
  ------------------
  281|  2.62M|            {
  282|  2.62M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  283|       |
  284|  2.62M|                inp *= 65536.0f;
  285|  2.62M|                CLIP(inp, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|  2.62M|#define CLIP(sample, max, min) \
  |  |   65|  2.62M|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 2.38M, False: 242k]
  |  |  ------------------
  |  |   66|  2.38M|{                              \
  |  |   67|  2.38M|    sample += 0.5f;            \
  |  |   68|  2.38M|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 39.9k, False: 2.34M]
  |  |  ------------------
  |  |   69|  2.38M|        sample = max;          \
  |  |   70|  2.38M|} else {                       \
  |  |   71|   242k|    sample += -0.5f;           \
  |  |   72|   242k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 38.7k, False: 204k]
  |  |  ------------------
  |  |   73|   242k|        sample = min;          \
  |  |   74|   242k|}
  ------------------
  286|       |
  287|  2.62M|                (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
  ------------------
  |  |  387|  2.62M|#define lrintf(f) ((long)(f))
  ------------------
  288|  2.62M|            }
  289|  1.81k|        }
  290|    221|        break;
  291|    502|    }
  292|    502|}
output.c:to_PCM_float:
  297|    224|{
  298|    224|    uint8_t ch, ch1;
  299|    224|    uint16_t i;
  300|       |
  301|    224|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    224|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  302|    224|    {
  303|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (303:5): [True: 0, False: 224]
  ------------------
  304|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (304:5): [True: 0, False: 224]
  ------------------
  305|      0|        for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (305:20): [True: 0, False: 0]
  ------------------
  306|      0|        {
  307|      0|            real_t inp = input[hDecoder->internal_channel[0]][i];
  308|      0|            (*sample_buffer)[i] = inp*FLOAT_SCALE;
  ------------------
  |  |   39|      0|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  309|      0|        }
  310|      0|        break;
  311|     97|    case CONV(2,0):
  ------------------
  |  |   87|     97|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (311:5): [True: 97, False: 127]
  ------------------
  312|     97|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (312:13): [True: 0, False: 97]
  ------------------
  313|      0|        {
  314|      0|            ch = hDecoder->internal_channel[0];
  315|      0|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (315:24): [True: 0, False: 0]
  ------------------
  316|      0|            {
  317|      0|                real_t inp0 = input[ch][i];
  318|      0|                (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
  ------------------
  |  |   39|      0|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  319|      0|                (*sample_buffer)[(i*2)+1] = inp0*FLOAT_SCALE;
  ------------------
  |  |   39|      0|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  320|      0|            }
  321|     97|        } else {
  322|     97|            ch  = hDecoder->internal_channel[0];
  323|     97|            ch1 = hDecoder->internal_channel[1];
  324|   148k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (324:24): [True: 148k, False: 97]
  ------------------
  325|   148k|            {
  326|   148k|                real_t inp0 = input[ch ][i];
  327|   148k|                real_t inp1 = input[ch1][i];
  328|   148k|                (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
  ------------------
  |  |   39|   148k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  329|   148k|                (*sample_buffer)[(i*2)+1] = inp1*FLOAT_SCALE;
  ------------------
  |  |   39|   148k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  330|   148k|            }
  331|     97|        }
  332|     97|        break;
  333|    127|    default:
  ------------------
  |  Branch (333:5): [True: 127, False: 97]
  ------------------
  334|  1.14k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (334:22): [True: 1.02k, False: 127]
  ------------------
  335|  1.02k|        {
  336|  1.59M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (336:24): [True: 1.59M, False: 1.02k]
  ------------------
  337|  1.59M|            {
  338|  1.59M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  339|  1.59M|                (*sample_buffer)[(i*channels)+ch] = inp*FLOAT_SCALE;
  ------------------
  |  |   39|  1.59M|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  340|  1.59M|            }
  341|  1.02k|        }
  342|    127|        break;
  343|    224|    }
  344|    224|}
output.c:to_PCM_double:
  349|    222|{
  350|    222|    uint8_t ch, ch1;
  351|    222|    uint16_t i;
  352|       |
  353|    222|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    222|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  354|    222|    {
  355|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (355:5): [True: 0, False: 222]
  ------------------
  356|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (356:5): [True: 0, False: 222]
  ------------------
  357|      0|        for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (357:20): [True: 0, False: 0]
  ------------------
  358|      0|        {
  359|      0|            real_t inp = input[hDecoder->internal_channel[0]][i];
  360|      0|            (*sample_buffer)[i] = (double)inp*FLOAT_SCALE;
  ------------------
  |  |   39|      0|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  361|      0|        }
  362|      0|        break;
  363|     66|    case CONV(2,0):
  ------------------
  |  |   87|     66|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (363:5): [True: 66, False: 156]
  ------------------
  364|     66|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (364:13): [True: 0, False: 66]
  ------------------
  365|      0|        {
  366|      0|            ch = hDecoder->internal_channel[0];
  367|      0|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (367:24): [True: 0, False: 0]
  ------------------
  368|      0|            {
  369|      0|                real_t inp0 = input[ch][i];
  370|      0|                (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
  ------------------
  |  |   39|      0|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  371|      0|                (*sample_buffer)[(i*2)+1] = (double)inp0*FLOAT_SCALE;
  ------------------
  |  |   39|      0|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  372|      0|            }
  373|     66|        } else {
  374|     66|            ch  = hDecoder->internal_channel[0];
  375|     66|            ch1 = hDecoder->internal_channel[1];
  376|  79.1k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (376:24): [True: 79.1k, False: 66]
  ------------------
  377|  79.1k|            {
  378|  79.1k|                real_t inp0 = input[ch ][i];
  379|  79.1k|                real_t inp1 = input[ch1][i];
  380|  79.1k|                (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
  ------------------
  |  |   39|  79.1k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  381|  79.1k|                (*sample_buffer)[(i*2)+1] = (double)inp1*FLOAT_SCALE;
  ------------------
  |  |   39|  79.1k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  382|  79.1k|            }
  383|     66|        }
  384|     66|        break;
  385|    156|    default:
  ------------------
  |  Branch (385:5): [True: 156, False: 66]
  ------------------
  386|  1.89k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (386:22): [True: 1.73k, False: 156]
  ------------------
  387|  1.73k|        {
  388|  2.68M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (388:24): [True: 2.68M, False: 1.73k]
  ------------------
  389|  2.68M|            {
  390|  2.68M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  391|  2.68M|                (*sample_buffer)[(i*channels)+ch] = (double)inp*FLOAT_SCALE;
  ------------------
  |  |   39|  2.68M|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  392|  2.68M|            }
  393|  1.73k|        }
  394|    156|        break;
  395|    222|    }
  396|    222|}

pns_decode:
  154|  93.4k|{
  155|  93.4k|    uint8_t g, sfb, b;
  156|  93.4k|    uint16_t begin, end;
  157|       |
  158|  93.4k|    uint8_t group = 0;
  159|  93.4k|    uint16_t nshort = frame_len >> 3;
  160|       |
  161|  93.4k|    uint8_t sub = 0;
  162|       |
  163|       |#ifdef FIXED_POINT
  164|       |    /* IMDCT scaling */
  165|       |    if (object_type == LD)
  166|       |    {
  167|       |        sub = 9 /*9*/;
  168|       |    } else {
  169|       |        if (ics_left->window_sequence == EIGHT_SHORT_SEQUENCE)
  170|       |            sub = 7 /*7*/;
  171|       |        else
  172|       |            sub = 10 /*10*/;
  173|       |    }
  174|       |#else
  175|  93.4k|    (void)object_type;
  176|  93.4k|#endif
  177|       |
  178|   246k|    for (g = 0; g < ics_left->num_window_groups; g++)
  ------------------
  |  Branch (178:17): [True: 152k, False: 93.4k]
  ------------------
  179|   152k|    {
  180|       |        /* Do perceptual noise substitution decoding */
  181|   322k|        for (b = 0; b < ics_left->window_group_length[g]; b++)
  ------------------
  |  Branch (181:21): [True: 169k, False: 152k]
  ------------------
  182|   169k|        {
  183|   169k|            uint16_t base = group * nshort;
  184|   256k|            for (sfb = 0; sfb < ics_left->max_sfb; sfb++)
  ------------------
  |  Branch (184:27): [True: 86.8k, False: 169k]
  ------------------
  185|  86.8k|            {
  186|  86.8k|                uint32_t r1_dep = 0, r2_dep = 0;
  187|       |
  188|  86.8k|                if (is_noise(ics_left, g, sfb))
  ------------------
  |  Branch (188:21): [True: 0, False: 86.8k]
  ------------------
  189|      0|                {
  190|       |#ifdef LTP_DEC
  191|       |                    /* Simultaneous use of LTP and PNS is not prevented in the
  192|       |                       syntax. If both LTP, and PNS are enabled on the same
  193|       |                       scalefactor band, PNS takes precedence, and no prediction
  194|       |                       is applied to this band.
  195|       |                    */
  196|       |                    ics_left->ltp.long_used[sfb] = 0;
  197|       |                    ics_left->ltp2.long_used[sfb] = 0;
  198|       |#endif
  199|       |
  200|       |#ifdef MAIN_DEC
  201|       |                    /* For scalefactor bands coded using PNS the corresponding
  202|       |                       predictors are switched to "off".
  203|       |                    */
  204|       |                    ics_left->pred.prediction_used[sfb] = 0;
  205|       |#endif
  206|      0|                    begin = min(base + ics_left->swb_offset[sfb], ics_left->swb_offset_max);
  ------------------
  |  |   60|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  207|      0|                    end = min(base + ics_left->swb_offset[sfb+1], ics_left->swb_offset_max);
  ------------------
  |  |   60|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  208|       |
  209|      0|                    r1_dep = *__r1;
  210|      0|                    r2_dep = *__r2;
  211|       |
  212|       |                    /* Generate random vector */
  213|      0|                    gen_rand_vector(&spec_left[begin],
  214|      0|                        ics_left->scale_factors[g][sfb], end - begin, sub, __r1, __r2);
  215|      0|                }
  216|       |
  217|       |/* From the spec:
  218|       |   If the same scalefactor band and group is coded by perceptual noise
  219|       |   substitution in both channels of a channel pair, the correlation of
  220|       |   the noise signal can be controlled by means of the ms_used field: While
  221|       |   the default noise generation process works independently for each channel
  222|       |   (separate generation of random vectors), the same random vector is used
  223|       |   for both channels if ms_used[] is set for a particular scalefactor band
  224|       |   and group. In this case, no M/S stereo coding is carried out (because M/S
  225|       |   stereo coding and noise substitution coding are mutually exclusive).
  226|       |   If the same scalefactor band and group is coded by perceptual noise
  227|       |   substitution in only one channel of a channel pair the setting of ms_used[]
  228|       |   is not evaluated.
  229|       |*/
  230|  86.8k|                if ((ics_right != NULL)
  ------------------
  |  Branch (230:21): [True: 29.7k, False: 57.1k]
  ------------------
  231|  29.7k|                    && is_noise(ics_right, g, sfb))
  ------------------
  |  Branch (231:24): [True: 0, False: 29.7k]
  ------------------
  232|      0|                {
  233|       |#ifdef LTP_DEC
  234|       |                    /* See comment above. */
  235|       |                    ics_right->ltp.long_used[sfb] = 0;
  236|       |                    ics_right->ltp2.long_used[sfb] = 0;
  237|       |#endif
  238|       |#ifdef MAIN_DEC
  239|       |                    /* See comment above. */
  240|       |                    ics_right->pred.prediction_used[sfb] = 0;
  241|       |#endif
  242|       |
  243|      0|                    if (channel_pair && is_noise(ics_left, g, sfb) &&
  ------------------
  |  Branch (243:25): [True: 0, False: 0]
  |  Branch (243:41): [True: 0, False: 0]
  ------------------
  244|      0|                        (((ics_left->ms_mask_present == 1) &&
  ------------------
  |  Branch (244:27): [True: 0, False: 0]
  ------------------
  245|      0|                        (ics_left->ms_used[g][sfb])) ||
  ------------------
  |  Branch (245:25): [True: 0, False: 0]
  ------------------
  246|      0|                        (ics_left->ms_mask_present == 2)))
  ------------------
  |  Branch (246:25): [True: 0, False: 0]
  ------------------
  247|      0|                    {
  248|       |                        /*uint16_t c;*/
  249|       |
  250|      0|                        begin = min(base + ics_right->swb_offset[sfb], ics_right->swb_offset_max);
  ------------------
  |  |   60|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  251|      0|                        end = min(base + ics_right->swb_offset[sfb+1], ics_right->swb_offset_max);
  ------------------
  |  |   60|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  252|       |
  253|       |                        /* Generate random vector dependent on left channel*/
  254|      0|                        gen_rand_vector(&spec_right[begin],
  255|      0|                            ics_right->scale_factors[g][sfb], end - begin, sub, &r1_dep, &r2_dep);
  256|       |
  257|      0|                    } else /*if (ics_left->ms_mask_present == 0)*/ {
  258|      0|                        begin = min(base + ics_right->swb_offset[sfb], ics_right->swb_offset_max);
  ------------------
  |  |   60|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  259|      0|                        end = min(base + ics_right->swb_offset[sfb+1], ics_right->swb_offset_max);
  ------------------
  |  |   60|      0|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  260|       |
  261|       |                        /* Generate random vector */
  262|      0|                        gen_rand_vector(&spec_right[begin],
  263|      0|                            ics_right->scale_factors[g][sfb], end - begin, sub, __r1, __r2);
  264|      0|                    }
  265|      0|                }
  266|  86.8k|            } /* sfb */
  267|   169k|            group++;
  268|   169k|        } /* b */
  269|   152k|    } /* g */
  270|  93.4k|}

specrec.c:is_noise:
   48|  5.44M|{
   49|  5.44M|    if (ics->sfb_cb[group][sfb] == NOISE_HCB)
  ------------------
  |  |  106|  5.44M|#define NOISE_HCB      13
  ------------------
  |  Branch (49:9): [True: 0, False: 5.44M]
  ------------------
   50|      0|        return 1;
   51|  5.44M|    return 0;
   52|  5.44M|}
pns.c:is_noise:
   48|   116k|{
   49|   116k|    if (ics->sfb_cb[group][sfb] == NOISE_HCB)
  ------------------
  |  |  106|   116k|#define NOISE_HCB      13
  ------------------
  |  Branch (49:9): [True: 0, False: 116k]
  ------------------
   50|      0|        return 1;
   51|   116k|    return 0;
   52|   116k|}
ms.c:is_noise:
   48|  2.35k|{
   49|  2.35k|    if (ics->sfb_cb[group][sfb] == NOISE_HCB)
  ------------------
  |  |  106|  2.35k|#define NOISE_HCB      13
  ------------------
  |  Branch (49:9): [True: 0, False: 2.35k]
  ------------------
   50|      0|        return 1;
   51|  2.35k|    return 0;
   52|  2.35k|}

ps_free:
 1889|  7.54k|{
 1890|       |    /* free hybrid filterbank structures */
 1891|  7.54k|    hybrid_free(ps->hyb);
 1892|       |
 1893|  7.54k|    faad_free(ps);
 1894|  7.54k|}
ps_init:
 1897|  7.54k|{
 1898|  7.54k|    uint8_t i;
 1899|  7.54k|    uint8_t short_delay_band;
 1900|       |
 1901|  7.54k|    ps_info *ps = (ps_info*)faad_malloc(sizeof(ps_info));
 1902|  7.54k|    memset(ps, 0, sizeof(ps_info));
 1903|       |
 1904|  7.54k|    ps->hyb = hybrid_init(numTimeSlotsRate);
 1905|  7.54k|    ps->numTimeSlotsRate = numTimeSlotsRate;
 1906|       |
 1907|  7.54k|    ps->ps_data_available = 0;
 1908|       |
 1909|       |    /* delay stuff*/
 1910|  7.54k|    ps->saved_delay = 0;
 1911|       |
 1912|   490k|    for (i = 0; i < 64; i++)
  ------------------
  |  Branch (1912:17): [True: 482k, False: 7.54k]
  ------------------
 1913|   482k|    {
 1914|   482k|        ps->delay_buf_index_delay[i] = 0;
 1915|   482k|    }
 1916|       |
 1917|  30.1k|    for (i = 0; i < NO_ALLPASS_LINKS; i++)
  ------------------
  |  |   43|  30.1k|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1917:17): [True: 22.6k, False: 7.54k]
  ------------------
 1918|  22.6k|    {
 1919|  22.6k|        ps->delay_buf_index_ser[i] = 0;
 1920|       |#ifdef PARAM_32KHZ
 1921|       |        if (sr_index <= 5) /* >= 32 kHz*/
 1922|       |        {
 1923|       |            ps->num_sample_delay_ser[i] = delay_length_d[1][i];
 1924|       |        } else {
 1925|       |            ps->num_sample_delay_ser[i] = delay_length_d[0][i];
 1926|       |        }
 1927|       |#else
 1928|  22.6k|        (void)sr_index;
 1929|       |        /* THESE ARE CONSTANTS NOW */
 1930|  22.6k|        ps->num_sample_delay_ser[i] = delay_length_d[i];
 1931|  22.6k|#endif
 1932|  22.6k|    }
 1933|       |
 1934|       |#ifdef PARAM_32KHZ
 1935|       |    if (sr_index <= 5) /* >= 32 kHz*/
 1936|       |    {
 1937|       |        short_delay_band = 35;
 1938|       |        ps->nr_allpass_bands = 22;
 1939|       |        ps->alpha_decay = FRAC_CONST(0.76592833836465);
 1940|       |        ps->alpha_smooth = FRAC_CONST(0.25);
 1941|       |    } else {
 1942|       |        short_delay_band = 64;
 1943|       |        ps->nr_allpass_bands = 45;
 1944|       |        ps->alpha_decay = FRAC_CONST(0.58664621951003);
 1945|       |        ps->alpha_smooth = FRAC_CONST(0.6);
 1946|       |    }
 1947|       |#else
 1948|       |    /* THESE ARE CONSTANTS NOW */
 1949|  7.54k|    short_delay_band = 35;
 1950|  7.54k|    ps->nr_allpass_bands = 22;
 1951|  7.54k|    ps->alpha_decay = FRAC_CONST(0.76592833836465);
  ------------------
  |  |  291|  7.54k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1952|  7.54k|    ps->alpha_smooth = FRAC_CONST(0.25);
  ------------------
  |  |  291|  7.54k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1953|  7.54k|#endif
 1954|       |
 1955|       |    /* THESE ARE CONSTANT NOW IF PS IS INDEPENDANT OF SAMPLERATE */
 1956|   271k|    for (i = 0; i < short_delay_band; i++)
  ------------------
  |  Branch (1956:17): [True: 264k, False: 7.54k]
  ------------------
 1957|   264k|    {
 1958|   264k|        ps->delay_D[i] = 14;
 1959|   264k|    }
 1960|   226k|    for (i = short_delay_band; i < 64; i++)
  ------------------
  |  Branch (1960:32): [True: 218k, False: 7.54k]
  ------------------
 1961|   218k|    {
 1962|   218k|        ps->delay_D[i] = 1;
 1963|   218k|    }
 1964|       |
 1965|       |    /* mixing and phase */
 1966|   384k|    for (i = 0; i < 50; i++)
  ------------------
  |  Branch (1966:17): [True: 377k, False: 7.54k]
  ------------------
 1967|   377k|    {
 1968|   377k|        RE(ps->h11_prev[i]) = 1;
  ------------------
  |  |  391|   377k|#define RE(A) (A)[0]
  ------------------
 1969|   377k|        IM(ps->h11_prev[i]) = 1;
  ------------------
  |  |  392|   377k|#define IM(A) (A)[1]
  ------------------
 1970|   377k|        RE(ps->h12_prev[i]) = 1;
  ------------------
  |  |  391|   377k|#define RE(A) (A)[0]
  ------------------
 1971|   377k|        IM(ps->h12_prev[i]) = 1;
  ------------------
  |  |  392|   377k|#define IM(A) (A)[1]
  ------------------
 1972|   377k|    }
 1973|       |
 1974|  7.54k|    ps->phase_hist = 0;
 1975|       |
 1976|   158k|    for (i = 0; i < 20; i++)
  ------------------
  |  Branch (1976:17): [True: 150k, False: 7.54k]
  ------------------
 1977|   150k|    {
 1978|   150k|        RE(ps->ipd_prev[i][0]) = 0;
  ------------------
  |  |  391|   150k|#define RE(A) (A)[0]
  ------------------
 1979|   150k|        IM(ps->ipd_prev[i][0]) = 0;
  ------------------
  |  |  392|   150k|#define IM(A) (A)[1]
  ------------------
 1980|   150k|        RE(ps->ipd_prev[i][1]) = 0;
  ------------------
  |  |  391|   150k|#define RE(A) (A)[0]
  ------------------
 1981|   150k|        IM(ps->ipd_prev[i][1]) = 0;
  ------------------
  |  |  392|   150k|#define IM(A) (A)[1]
  ------------------
 1982|   150k|        RE(ps->opd_prev[i][0]) = 0;
  ------------------
  |  |  391|   150k|#define RE(A) (A)[0]
  ------------------
 1983|   150k|        IM(ps->opd_prev[i][0]) = 0;
  ------------------
  |  |  392|   150k|#define IM(A) (A)[1]
  ------------------
 1984|   150k|        RE(ps->opd_prev[i][1]) = 0;
  ------------------
  |  |  391|   150k|#define RE(A) (A)[0]
  ------------------
 1985|   150k|        IM(ps->opd_prev[i][1]) = 0;
  ------------------
  |  |  392|   150k|#define IM(A) (A)[1]
  ------------------
 1986|   150k|    }
 1987|       |
 1988|  7.54k|    return ps;
 1989|  7.54k|}
ps_decode:
 1993|  5.32k|{
 1994|  5.32k|    qmf_t X_hybrid_left[32][32] = {{{0}}};
  ------------------
  |  |  167|  5.32k|#define qmf_t complex_t
  ------------------
 1995|  5.32k|    qmf_t X_hybrid_right[32][32] = {{{0}}};
  ------------------
  |  |  167|  5.32k|#define qmf_t complex_t
  ------------------
 1996|       |
 1997|       |    /* delta decoding of the bitstream data */
 1998|  5.32k|    ps_data_decode(ps);
 1999|       |
 2000|       |    /* set up some parameters depending on filterbank type */
 2001|  5.32k|    if (ps->use34hybrid_bands)
  ------------------
  |  Branch (2001:9): [True: 2.20k, False: 3.11k]
  ------------------
 2002|  2.20k|    {
 2003|  2.20k|        ps->group_border = (uint8_t*)group_border34;
 2004|  2.20k|        ps->map_group2bk = (uint16_t*)map_group2bk34;
 2005|  2.20k|        ps->num_groups = 32+18;
 2006|  2.20k|        ps->num_hybrid_groups = 32;
 2007|  2.20k|        ps->nr_par_bands = 34;
 2008|  2.20k|        ps->decay_cutoff = 5;
 2009|  3.11k|    } else {
 2010|  3.11k|        ps->group_border = (uint8_t*)group_border20;
 2011|  3.11k|        ps->map_group2bk = (uint16_t*)map_group2bk20;
 2012|  3.11k|        ps->num_groups = 10+12;
 2013|  3.11k|        ps->num_hybrid_groups = 10;
 2014|  3.11k|        ps->nr_par_bands = 20;
 2015|  3.11k|        ps->decay_cutoff = 3;
 2016|  3.11k|    }
 2017|       |
 2018|       |    /* Perform further analysis on the lowest subbands to get a higher
 2019|       |     * frequency resolution
 2020|       |     */
 2021|  5.32k|    hybrid_analysis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
 2022|  5.32k|        ps->use34hybrid_bands, ps->numTimeSlotsRate);
 2023|       |
 2024|       |    /* decorrelate mono signal */
 2025|  5.32k|    ps_decorrelate(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
 2026|       |
 2027|       |    /* apply mixing and phase parameters */
 2028|  5.32k|    ps_mix_phase(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
 2029|       |
 2030|       |    /* hybrid synthesis, to rebuild the SBR QMF matrices */
 2031|  5.32k|    hybrid_synthesis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
 2032|  5.32k|        ps->use34hybrid_bands, ps->numTimeSlotsRate);
 2033|       |
 2034|  5.32k|    hybrid_synthesis((hyb_info*)ps->hyb, X_right, X_hybrid_right,
 2035|  5.32k|        ps->use34hybrid_bands, ps->numTimeSlotsRate);
 2036|       |
 2037|  5.32k|    return 0;
 2038|  5.32k|}
ps_dec.c:hybrid_free:
  234|  7.54k|{
  235|  7.54k|    uint8_t i;
  236|       |
  237|  7.54k|	if (!hyb) return;
  ------------------
  |  Branch (237:6): [True: 0, False: 7.54k]
  ------------------
  238|       |
  239|  7.54k|    if (hyb->work)
  ------------------
  |  Branch (239:9): [True: 7.54k, False: 0]
  ------------------
  240|  7.54k|        faad_free(hyb->work);
  241|       |
  242|  45.2k|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (242:17): [True: 37.7k, False: 7.54k]
  ------------------
  243|  37.7k|    {
  244|  37.7k|        if (hyb->buffer[i])
  ------------------
  |  Branch (244:13): [True: 37.7k, False: 0]
  ------------------
  245|  37.7k|            faad_free(hyb->buffer[i]);
  246|  37.7k|    }
  247|  7.54k|    if (hyb->buffer)
  ------------------
  |  Branch (247:9): [True: 7.54k, False: 0]
  ------------------
  248|  7.54k|        faad_free(hyb->buffer);
  249|       |
  250|   244k|    for (i = 0; i < hyb->frame_len; i++)
  ------------------
  |  Branch (250:17): [True: 237k, False: 7.54k]
  ------------------
  251|   237k|    {
  252|   237k|        if (hyb->temp[i])
  ------------------
  |  Branch (252:13): [True: 237k, False: 0]
  ------------------
  253|   237k|            faad_free(hyb->temp[i]);
  254|   237k|    }
  255|  7.54k|    if (hyb->temp)
  ------------------
  |  Branch (255:9): [True: 7.54k, False: 0]
  ------------------
  256|  7.54k|        faad_free(hyb->temp);
  257|       |
  258|  7.54k|    faad_free(hyb);
  259|  7.54k|}
ps_dec.c:hybrid_init:
  197|  7.54k|{
  198|  7.54k|    uint8_t i;
  199|       |
  200|  7.54k|    hyb_info *hyb = (hyb_info*)faad_malloc(sizeof(hyb_info));
  201|       |
  202|  7.54k|    hyb->resolution34[0] = 12;
  203|  7.54k|    hyb->resolution34[1] = 8;
  204|  7.54k|    hyb->resolution34[2] = 4;
  205|  7.54k|    hyb->resolution34[3] = 4;
  206|  7.54k|    hyb->resolution34[4] = 4;
  207|       |
  208|  7.54k|    hyb->resolution20[0] = 8;
  209|  7.54k|    hyb->resolution20[1] = 2;
  210|  7.54k|    hyb->resolution20[2] = 2;
  211|       |
  212|  7.54k|    hyb->frame_len = numTimeSlotsRate;
  213|       |
  214|  7.54k|    hyb->work = (qmf_t*)faad_malloc((hyb->frame_len+12) * sizeof(qmf_t));
  215|  7.54k|    memset(hyb->work, 0, (hyb->frame_len+12) * sizeof(qmf_t));
  216|       |
  217|  7.54k|    hyb->buffer = (qmf_t**)faad_malloc(5 * sizeof(qmf_t*));
  218|  45.2k|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (218:17): [True: 37.7k, False: 7.54k]
  ------------------
  219|  37.7k|    {
  220|  37.7k|        hyb->buffer[i] = (qmf_t*)faad_malloc(hyb->frame_len * sizeof(qmf_t));
  221|  37.7k|        memset(hyb->buffer[i], 0, hyb->frame_len * sizeof(qmf_t));
  222|  37.7k|    }
  223|       |
  224|  7.54k|    hyb->temp = (qmf_t**)faad_malloc(hyb->frame_len * sizeof(qmf_t*));
  225|   244k|    for (i = 0; i < hyb->frame_len; i++)
  ------------------
  |  Branch (225:17): [True: 237k, False: 7.54k]
  ------------------
  226|   237k|    {
  227|   237k|        hyb->temp[i] = (qmf_t*)faad_malloc(12 /*max*/ * sizeof(qmf_t));
  228|   237k|    }
  229|       |
  230|  7.54k|    return hyb;
  231|  7.54k|}
ps_dec.c:ps_data_decode:
  808|  5.32k|{
  809|  5.32k|    uint8_t env, bin;
  810|       |
  811|       |    /* ps data not available, use data from previous frame */
  812|  5.32k|    if (ps->ps_data_available == 0)
  ------------------
  |  Branch (812:9): [True: 1.59k, False: 3.72k]
  ------------------
  813|  1.59k|    {
  814|  1.59k|        ps->num_env = 0;
  815|  1.59k|    }
  816|       |
  817|  14.0k|    for (env = 0; env < ps->num_env; env++)
  ------------------
  |  Branch (817:19): [True: 8.77k, False: 5.32k]
  ------------------
  818|  8.77k|    {
  819|  8.77k|        int8_t *iid_index_prev;
  820|  8.77k|        int8_t *icc_index_prev;
  821|  8.77k|        int8_t *ipd_index_prev;
  822|  8.77k|        int8_t *opd_index_prev;
  823|       |
  824|  8.77k|        int8_t num_iid_steps = (ps->iid_mode < 3) ? 7 : 15 /*fine quant*/;
  ------------------
  |  Branch (824:32): [True: 4.00k, False: 4.77k]
  ------------------
  825|       |
  826|  8.77k|        if (env == 0)
  ------------------
  |  Branch (826:13): [True: 2.65k, False: 6.12k]
  ------------------
  827|  2.65k|        {
  828|       |            /* take last envelope from previous frame */
  829|  2.65k|            iid_index_prev = ps->iid_index_prev;
  830|  2.65k|            icc_index_prev = ps->icc_index_prev;
  831|  2.65k|            ipd_index_prev = ps->ipd_index_prev;
  832|  2.65k|            opd_index_prev = ps->opd_index_prev;
  833|  6.12k|        } else {
  834|       |            /* take index values from previous envelope */
  835|  6.12k|            iid_index_prev = ps->iid_index[env - 1];
  836|  6.12k|            icc_index_prev = ps->icc_index[env - 1];
  837|  6.12k|            ipd_index_prev = ps->ipd_index[env - 1];
  838|  6.12k|            opd_index_prev = ps->opd_index[env - 1];
  839|  6.12k|        }
  840|       |
  841|       |//        iid = 1;
  842|       |        /* delta decode iid parameters */
  843|  8.77k|        delta_decode(ps->enable_iid, ps->iid_index[env], iid_index_prev,
  844|  8.77k|            ps->iid_dt[env], ps->nr_iid_par,
  845|  8.77k|            (ps->iid_mode == 0 || ps->iid_mode == 3) ? 2 : 1,
  ------------------
  |  Branch (845:14): [True: 3.74k, False: 5.03k]
  |  Branch (845:35): [True: 2.97k, False: 2.05k]
  ------------------
  846|  8.77k|            -num_iid_steps, num_iid_steps);
  847|       |//        iid = 0;
  848|       |
  849|       |        /* delta decode icc parameters */
  850|  8.77k|        delta_decode(ps->enable_icc, ps->icc_index[env], icc_index_prev,
  851|  8.77k|            ps->icc_dt[env], ps->nr_icc_par,
  852|  8.77k|            (ps->icc_mode == 0 || ps->icc_mode == 3) ? 2 : 1,
  ------------------
  |  Branch (852:14): [True: 3.42k, False: 5.35k]
  |  Branch (852:35): [True: 681, False: 4.67k]
  ------------------
  853|  8.77k|            0, 7);
  854|       |
  855|       |        /* delta modulo decode ipd parameters */
  856|  8.77k|        delta_modulo_decode(ps->enable_ipdopd, ps->ipd_index[env], ipd_index_prev,
  857|  8.77k|            ps->ipd_dt[env], ps->nr_ipdopd_par, 1, 7);
  858|       |
  859|       |        /* delta modulo decode opd parameters */
  860|  8.77k|        delta_modulo_decode(ps->enable_ipdopd, ps->opd_index[env], opd_index_prev,
  861|  8.77k|            ps->opd_dt[env], ps->nr_ipdopd_par, 1, 7);
  862|  8.77k|    }
  863|       |
  864|       |    /* handle error case */
  865|  5.32k|    if (ps->num_env == 0)
  ------------------
  |  Branch (865:9): [True: 2.67k, False: 2.65k]
  ------------------
  866|  2.67k|    {
  867|       |        /* force to 1 */
  868|  2.67k|        ps->num_env = 1;
  869|       |
  870|  2.67k|        if (ps->enable_iid)
  ------------------
  |  Branch (870:13): [True: 1.47k, False: 1.20k]
  ------------------
  871|  1.47k|        {
  872|  51.4k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (872:27): [True: 49.9k, False: 1.47k]
  ------------------
  873|  49.9k|                ps->iid_index[0][bin] = ps->iid_index_prev[bin];
  874|  1.47k|        } else {
  875|  42.0k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (875:27): [True: 40.8k, False: 1.20k]
  ------------------
  876|  40.8k|                ps->iid_index[0][bin] = 0;
  877|  1.20k|        }
  878|       |
  879|  2.67k|        if (ps->enable_icc)
  ------------------
  |  Branch (879:13): [True: 1.10k, False: 1.56k]
  ------------------
  880|  1.10k|        {
  881|  38.6k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (881:27): [True: 37.5k, False: 1.10k]
  ------------------
  882|  37.5k|                ps->icc_index[0][bin] = ps->icc_index_prev[bin];
  883|  1.56k|        } else {
  884|  54.8k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (884:27): [True: 53.2k, False: 1.56k]
  ------------------
  885|  53.2k|                ps->icc_index[0][bin] = 0;
  886|  1.56k|        }
  887|       |
  888|  2.67k|        if (ps->enable_ipdopd)
  ------------------
  |  Branch (888:13): [True: 470, False: 2.20k]
  ------------------
  889|    470|        {
  890|  8.46k|            for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (890:27): [True: 7.99k, False: 470]
  ------------------
  891|  7.99k|            {
  892|  7.99k|                ps->ipd_index[0][bin] = ps->ipd_index_prev[bin];
  893|  7.99k|                ps->opd_index[0][bin] = ps->opd_index_prev[bin];
  894|  7.99k|            }
  895|  2.20k|        } else {
  896|  39.6k|            for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (896:27): [True: 37.4k, False: 2.20k]
  ------------------
  897|  37.4k|            {
  898|  37.4k|                ps->ipd_index[0][bin] = 0;
  899|  37.4k|                ps->opd_index[0][bin] = 0;
  900|  37.4k|            }
  901|  2.20k|        }
  902|  2.67k|    }
  903|       |
  904|       |    /* update previous indices */
  905|   186k|    for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (905:19): [True: 180k, False: 5.32k]
  ------------------
  906|   180k|        ps->iid_index_prev[bin] = ps->iid_index[ps->num_env-1][bin];
  907|   186k|    for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (907:19): [True: 180k, False: 5.32k]
  ------------------
  908|   180k|        ps->icc_index_prev[bin] = ps->icc_index[ps->num_env-1][bin];
  909|  95.7k|    for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (909:19): [True: 90.4k, False: 5.32k]
  ------------------
  910|  90.4k|    {
  911|  90.4k|        ps->ipd_index_prev[bin] = ps->ipd_index[ps->num_env-1][bin];
  912|  90.4k|        ps->opd_index_prev[bin] = ps->opd_index[ps->num_env-1][bin];
  913|  90.4k|    }
  914|       |
  915|  5.32k|    ps->ps_data_available = 0;
  916|       |
  917|  5.32k|    if (ps->frame_class == 0)
  ------------------
  |  Branch (917:9): [True: 3.27k, False: 2.04k]
  ------------------
  918|  3.27k|    {
  919|  3.27k|        ps->border_position[0] = 0;
  920|  6.48k|        for (env = 1; env < ps->num_env; env++)
  ------------------
  |  Branch (920:23): [True: 3.20k, False: 3.27k]
  ------------------
  921|  3.20k|        {
  922|  3.20k|            ps->border_position[env] = (env * ps->numTimeSlotsRate) / ps->num_env;
  923|  3.20k|        }
  924|  3.27k|        ps->border_position[ps->num_env] = ps->numTimeSlotsRate;
  925|  3.27k|    } else {
  926|  2.04k|        ps->border_position[0] = 0;
  927|       |
  928|  2.04k|        if (ps->border_position[ps->num_env] < ps->numTimeSlotsRate)
  ------------------
  |  Branch (928:13): [True: 1.40k, False: 639]
  ------------------
  929|  1.40k|        {
  930|  49.2k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (930:27): [True: 47.8k, False: 1.40k]
  ------------------
  931|  47.8k|            {
  932|  47.8k|                ps->iid_index[ps->num_env][bin] = ps->iid_index[ps->num_env-1][bin];
  933|  47.8k|                ps->icc_index[ps->num_env][bin] = ps->icc_index[ps->num_env-1][bin];
  934|  47.8k|            }
  935|  25.3k|            for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (935:27): [True: 23.9k, False: 1.40k]
  ------------------
  936|  23.9k|            {
  937|  23.9k|                ps->ipd_index[ps->num_env][bin] = ps->ipd_index[ps->num_env-1][bin];
  938|  23.9k|                ps->opd_index[ps->num_env][bin] = ps->opd_index[ps->num_env-1][bin];
  939|  23.9k|            }
  940|  1.40k|            ps->num_env++;
  941|  1.40k|            ps->border_position[ps->num_env] = ps->numTimeSlotsRate;
  942|  1.40k|        }
  943|       |
  944|  6.37k|        for (env = 1; env < ps->num_env; env++)
  ------------------
  |  Branch (944:23): [True: 4.32k, False: 2.04k]
  ------------------
  945|  4.32k|        {
  946|  4.32k|            int8_t thr = ps->numTimeSlotsRate - (ps->num_env - env);
  947|       |
  948|  4.32k|            if (ps->border_position[env] > thr)
  ------------------
  |  Branch (948:17): [True: 712, False: 3.61k]
  ------------------
  949|    712|            {
  950|    712|                ps->border_position[env] = thr;
  951|  3.61k|            } else {
  952|  3.61k|                thr = ps->border_position[env-1]+1;
  953|  3.61k|                if (ps->border_position[env] < thr)
  ------------------
  |  Branch (953:21): [True: 1.95k, False: 1.66k]
  ------------------
  954|  1.95k|                {
  955|  1.95k|                    ps->border_position[env] = thr;
  956|  1.95k|                }
  957|  3.61k|            }
  958|  4.32k|        }
  959|  2.04k|    }
  960|       |
  961|       |    /* make sure that the indices of all parameters can be mapped
  962|       |     * to the same hybrid synthesis filterbank
  963|       |     */
  964|       |#ifdef PS_LOW_POWER
  965|       |    for (env = 0; env < ps->num_env; env++)
  966|       |    {
  967|       |        if (ps->iid_mode == 2 || ps->iid_mode == 5)
  968|       |            map34indexto20(ps->iid_index[env], 34);
  969|       |        if (ps->icc_mode == 2 || ps->icc_mode == 5)
  970|       |            map34indexto20(ps->icc_index[env], 34);
  971|       |
  972|       |        /* disable ipd/opd */
  973|       |        for (bin = 0; bin < 17; bin++)
  974|       |        {
  975|       |            ps->aaIpdIndex[env][bin] = 0;
  976|       |            ps->aaOpdIndex[env][bin] = 0;
  977|       |        }
  978|       |    }
  979|       |#else
  980|  5.32k|    if (ps->use34hybrid_bands)
  ------------------
  |  Branch (980:9): [True: 2.20k, False: 3.11k]
  ------------------
  981|  2.20k|    {
  982|  6.73k|        for (env = 0; env < ps->num_env; env++)
  ------------------
  |  Branch (982:23): [True: 4.53k, False: 2.20k]
  ------------------
  983|  4.53k|        {
  984|  4.53k|            if (ps->iid_mode != 2 && ps->iid_mode != 5)
  ------------------
  |  Branch (984:17): [True: 4.15k, False: 387]
  |  Branch (984:38): [True: 3.27k, False: 879]
  ------------------
  985|  3.27k|                map20indexto34(ps->iid_index[env], 34);
  986|  4.53k|            if (ps->icc_mode != 2 && ps->icc_mode != 5)
  ------------------
  |  Branch (986:17): [True: 2.57k, False: 1.96k]
  |  Branch (986:38): [True: 1.19k, False: 1.38k]
  ------------------
  987|  1.19k|                map20indexto34(ps->icc_index[env], 34);
  988|  4.53k|            if (ps->ipd_mode != 2 && ps->ipd_mode != 5)
  ------------------
  |  Branch (988:17): [True: 4.15k, False: 387]
  |  Branch (988:38): [True: 3.27k, False: 879]
  ------------------
  989|  3.27k|            {
  990|  3.27k|                map20indexto34(ps->ipd_index[env], 17);
  991|  3.27k|                map20indexto34(ps->opd_index[env], 17);
  992|  3.27k|            }
  993|  4.53k|        }
  994|  2.20k|    }
  995|  5.32k|#endif
  996|       |
  997|       |#if 0
  998|       |    for (env = 0; env < ps->num_env; env++)
  999|       |    {
 1000|       |        printf("iid[env:%d]:", env);
 1001|       |        for (bin = 0; bin < 34; bin++)
 1002|       |        {
 1003|       |            printf(" %d", ps->iid_index[env][bin]);
 1004|       |        }
 1005|       |        printf("\n");
 1006|       |    }
 1007|       |    for (env = 0; env < ps->num_env; env++)
 1008|       |    {
 1009|       |        printf("icc[env:%d]:", env);
 1010|       |        for (bin = 0; bin < 34; bin++)
 1011|       |        {
 1012|       |            printf(" %d", ps->icc_index[env][bin]);
 1013|       |        }
 1014|       |        printf("\n");
 1015|       |    }
 1016|       |    for (env = 0; env < ps->num_env; env++)
 1017|       |    {
 1018|       |        printf("ipd[env:%d]:", env);
 1019|       |        for (bin = 0; bin < 17; bin++)
 1020|       |        {
 1021|       |            printf(" %d", ps->ipd_index[env][bin]);
 1022|       |        }
 1023|       |        printf("\n");
 1024|       |    }
 1025|       |    for (env = 0; env < ps->num_env; env++)
 1026|       |    {
 1027|       |        printf("opd[env:%d]:", env);
 1028|       |        for (bin = 0; bin < 17; bin++)
 1029|       |        {
 1030|       |            printf(" %d", ps->opd_index[env][bin]);
 1031|       |        }
 1032|       |        printf("\n");
 1033|       |    }
 1034|       |    printf("\n");
 1035|       |#endif
 1036|  5.32k|}
ps_dec.c:delta_decode:
  629|  17.5k|{
  630|  17.5k|    int8_t i;
  631|       |
  632|  17.5k|    if (enable == 1)
  ------------------
  |  Branch (632:9): [True: 10.1k, False: 7.41k]
  ------------------
  633|  10.1k|    {
  634|  10.1k|        if (dt_flag == 0)
  ------------------
  |  Branch (634:13): [True: 5.56k, False: 4.57k]
  ------------------
  635|  5.56k|        {
  636|       |            /* delta coded in frequency direction */
  637|  5.56k|            index[0] = 0 + index[0];
  638|  5.56k|            index[0] = delta_clip(index[0], min_index, max_index);
  639|       |
  640|  91.1k|            for (i = 1; i < nr_par; i++)
  ------------------
  |  Branch (640:25): [True: 85.5k, False: 5.56k]
  ------------------
  641|  85.5k|            {
  642|  85.5k|                index[i] = index[i-1] + index[i];
  643|  85.5k|                index[i] = delta_clip(index[i], min_index, max_index);
  644|  85.5k|            }
  645|  5.56k|        } else {
  646|       |            /* delta coded in time direction */
  647|  70.1k|            for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (647:25): [True: 65.5k, False: 4.57k]
  ------------------
  648|  65.5k|            {
  649|       |                //int8_t tmp2;
  650|       |                //int8_t tmp = index[i];
  651|       |
  652|       |                //printf("%d %d\n", index_prev[i*stride], index[i]);
  653|       |                //printf("%d\n", index[i]);
  654|       |
  655|  65.5k|                index[i] = index_prev[i*stride] + index[i];
  656|       |                //tmp2 = index[i];
  657|  65.5k|                index[i] = delta_clip(index[i], min_index, max_index);
  658|       |
  659|       |                //if (iid)
  660|       |                //{
  661|       |                //    if (index[i] == 7)
  662|       |                //    {
  663|       |                //        printf("%d %d %d\n", index_prev[i*stride], tmp, tmp2);
  664|       |                //    }
  665|       |                //}
  666|  65.5k|            }
  667|  4.57k|        }
  668|  10.1k|    } else {
  669|       |        /* set indices to zero */
  670|  15.8k|        for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (670:21): [True: 8.43k, False: 7.41k]
  ------------------
  671|  8.43k|        {
  672|  8.43k|            index[i] = 0;
  673|  8.43k|        }
  674|  7.41k|    }
  675|       |
  676|       |    /* coarse */
  677|  17.5k|    if (stride == 2)
  ------------------
  |  Branch (677:9): [True: 10.8k, False: 6.73k]
  ------------------
  678|  10.8k|    {
  679|  84.5k|        for (i = (nr_par<<1)-1; i > 0; i--)
  ------------------
  |  Branch (679:33): [True: 73.7k, False: 10.8k]
  ------------------
  680|  73.7k|        {
  681|  73.7k|            index[i] = index[i>>1];
  682|  73.7k|        }
  683|  10.8k|    }
  684|  17.5k|}
ps_dec.c:delta_clip:
  614|   156k|{
  615|   156k|    if (i < min)
  ------------------
  |  Branch (615:9): [True: 26.3k, False: 130k]
  ------------------
  616|  26.3k|        return min;
  617|   130k|    else if (i > max)
  ------------------
  |  Branch (617:14): [True: 2.09k, False: 128k]
  ------------------
  618|  2.09k|        return max;
  619|   128k|    else
  620|   128k|        return i;
  621|   156k|}
ps_dec.c:delta_modulo_decode:
  691|  17.5k|{
  692|  17.5k|    int8_t i;
  693|       |
  694|  17.5k|    if (enable == 1)
  ------------------
  |  Branch (694:9): [True: 6.45k, False: 11.1k]
  ------------------
  695|  6.45k|    {
  696|  6.45k|        if (dt_flag == 0)
  ------------------
  |  Branch (696:13): [True: 4.05k, False: 2.39k]
  ------------------
  697|  4.05k|        {
  698|       |            /* delta coded in frequency direction */
  699|  4.05k|            index[0] = 0 + index[0];
  700|  4.05k|            index[0] &= and_modulo;
  701|       |
  702|  21.0k|            for (i = 1; i < nr_par; i++)
  ------------------
  |  Branch (702:25): [True: 16.9k, False: 4.05k]
  ------------------
  703|  16.9k|            {
  704|  16.9k|                index[i] = index[i-1] + index[i];
  705|  16.9k|                index[i] &= and_modulo;
  706|  16.9k|            }
  707|  4.05k|        } else {
  708|       |            /* delta coded in time direction */
  709|  11.9k|            for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (709:25): [True: 9.59k, False: 2.39k]
  ------------------
  710|  9.59k|            {
  711|  9.59k|                index[i] = index_prev[i*stride] + index[i];
  712|  9.59k|                index[i] &= and_modulo;
  713|  9.59k|            }
  714|  2.39k|        }
  715|  11.1k|    } else {
  716|       |        /* set indices to zero */
  717|  28.7k|        for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (717:21): [True: 17.6k, False: 11.1k]
  ------------------
  718|  17.6k|        {
  719|  17.6k|            index[i] = 0;
  720|  17.6k|        }
  721|  11.1k|    }
  722|       |
  723|       |    /* coarse */
  724|  17.5k|    if (stride == 2)
  ------------------
  |  Branch (724:9): [True: 0, False: 17.5k]
  ------------------
  725|      0|    {
  726|      0|        index[0] = 0;
  727|      0|        for (i = (nr_par<<1)-1; i > 0; i--)
  ------------------
  |  Branch (727:33): [True: 0, False: 0]
  ------------------
  728|      0|        {
  729|      0|            index[i] = index[i>>1];
  730|      0|        }
  731|      0|    }
  732|  17.5k|}
ps_dec.c:map20indexto34:
  765|  11.0k|{
  766|  11.0k|    index[0] = index[0];
  767|  11.0k|    index[1] = (index[0] + index[1])/2;
  768|  11.0k|    index[2] = index[1];
  769|  11.0k|    index[3] = index[2];
  770|  11.0k|    index[4] = (index[2] + index[3])/2;
  771|  11.0k|    index[5] = index[3];
  772|  11.0k|    index[6] = index[4];
  773|  11.0k|    index[7] = index[4];
  774|  11.0k|    index[8] = index[5];
  775|  11.0k|    index[9] = index[5];
  776|  11.0k|    index[10] = index[6];
  777|  11.0k|    index[11] = index[7];
  778|  11.0k|    index[12] = index[8];
  779|  11.0k|    index[13] = index[8];
  780|  11.0k|    index[14] = index[9];
  781|  11.0k|    index[15] = index[9];
  782|  11.0k|    index[16] = index[10];
  783|       |
  784|  11.0k|    if (bins == 34)
  ------------------
  |  Branch (784:9): [True: 4.46k, False: 6.54k]
  ------------------
  785|  4.46k|    {
  786|  4.46k|        index[17] = index[11];
  787|  4.46k|        index[18] = index[12];
  788|  4.46k|        index[19] = index[13];
  789|  4.46k|        index[20] = index[14];
  790|  4.46k|        index[21] = index[14];
  791|  4.46k|        index[22] = index[15];
  792|  4.46k|        index[23] = index[15];
  793|  4.46k|        index[24] = index[16];
  794|  4.46k|        index[25] = index[16];
  795|  4.46k|        index[26] = index[17];
  796|  4.46k|        index[27] = index[17];
  797|  4.46k|        index[28] = index[18];
  798|  4.46k|        index[29] = index[18];
  799|  4.46k|        index[30] = index[18];
  800|  4.46k|        index[31] = index[18];
  801|  4.46k|        index[32] = index[19];
  802|  4.46k|        index[33] = index[19];
  803|  4.46k|    }
  804|  11.0k|}
ps_dec.c:hybrid_analysis:
  514|  5.32k|{
  515|  5.32k|    uint8_t k, n, band;
  516|  5.32k|    uint8_t offset = 0;
  517|  5.32k|    uint8_t qmf_bands = (use34) ? 5 : 3;
  ------------------
  |  Branch (517:25): [True: 2.20k, False: 3.11k]
  ------------------
  518|  5.32k|    uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
  ------------------
  |  Branch (518:27): [True: 2.20k, False: 3.11k]
  ------------------
  519|       |
  520|  25.6k|    for (band = 0; band < qmf_bands; band++)
  ------------------
  |  Branch (520:20): [True: 20.3k, False: 5.32k]
  ------------------
  521|  20.3k|    {
  522|       |        /* build working buffer */
  523|  20.3k|        memcpy(hyb->work, hyb->buffer[band], 12 * sizeof(qmf_t));
  524|       |
  525|       |        /* add new samples */
  526|   647k|        for (n = 0; n < hyb->frame_len; n++)
  ------------------
  |  Branch (526:21): [True: 626k, False: 20.3k]
  ------------------
  527|   626k|        {
  528|   626k|            QMF_RE(hyb->work[12 + n]) = QMF_RE(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  168|   626k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   626k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(hyb->work[12 + n]) = QMF_RE(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  168|   626k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   626k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  529|   626k|            QMF_IM(hyb->work[12 + n]) = QMF_IM(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  169|   626k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   626k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(hyb->work[12 + n]) = QMF_IM(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  169|   626k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   626k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  530|   626k|        }
  531|       |
  532|       |        /* store samples */
  533|  20.3k|        memcpy(hyb->buffer[band], hyb->work + hyb->frame_len, 12 * sizeof(qmf_t));
  534|       |
  535|       |
  536|  20.3k|        switch(resolution[band])
  ------------------
  |  Branch (536:16): [True: 20.3k, False: 0]
  ------------------
  537|  20.3k|        {
  538|  6.23k|        case 2:
  ------------------
  |  Branch (538:9): [True: 6.23k, False: 14.1k]
  ------------------
  539|       |            /* Type B real filter, Q[p] = 2 */
  540|  6.23k|            channel_filter2(hyb, hyb->frame_len, p2_13_20, hyb->work, hyb->temp);
  541|  6.23k|            break;
  542|  6.60k|        case 4:
  ------------------
  |  Branch (542:9): [True: 6.60k, False: 13.7k]
  ------------------
  543|       |            /* Type A complex filter, Q[p] = 4 */
  544|  6.60k|            channel_filter4(hyb, hyb->frame_len, p4_13_34, hyb->work, hyb->temp);
  545|  6.60k|            break;
  546|  5.32k|        case 8:
  ------------------
  |  Branch (546:9): [True: 5.32k, False: 15.0k]
  ------------------
  547|       |            /* Type A complex filter, Q[p] = 8 */
  548|  5.32k|            channel_filter8(hyb, hyb->frame_len, (use34) ? p8_13_34 : p8_13_20,
  ------------------
  |  Branch (548:50): [True: 2.20k, False: 3.11k]
  ------------------
  549|  5.32k|                hyb->work, hyb->temp);
  550|  5.32k|            break;
  551|  2.20k|        case 12:
  ------------------
  |  Branch (551:9): [True: 2.20k, False: 18.1k]
  ------------------
  552|       |            /* Type A complex filter, Q[p] = 12 */
  553|  2.20k|            channel_filter12(hyb, hyb->frame_len, p12_13_34, hyb->work, hyb->temp);
  554|  2.20k|            break;
  555|  20.3k|        }
  556|       |
  557|   647k|        for (n = 0; n < hyb->frame_len; n++)
  ------------------
  |  Branch (557:21): [True: 626k, False: 20.3k]
  ------------------
  558|   626k|        {
  559|  3.93M|            for (k = 0; k < resolution[band]; k++)
  ------------------
  |  Branch (559:25): [True: 3.31M, False: 626k]
  ------------------
  560|  3.31M|            {
  561|  3.31M|                QMF_RE(X_hybrid[n][offset + k]) = QMF_RE(hyb->temp[n][k]);
  ------------------
  |  |  168|  3.31M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.31M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_hybrid[n][offset + k]) = QMF_RE(hyb->temp[n][k]);
  ------------------
  |  |  168|  3.31M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.31M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  562|  3.31M|                QMF_IM(X_hybrid[n][offset + k]) = QMF_IM(hyb->temp[n][k]);
  ------------------
  |  |  169|  3.31M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.31M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_hybrid[n][offset + k]) = QMF_IM(hyb->temp[n][k]);
  ------------------
  |  |  169|  3.31M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.31M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  563|  3.31M|            }
  564|   626k|        }
  565|  20.3k|        offset += resolution[band];
  566|  20.3k|    }
  567|       |
  568|       |    /* group hybrid channels */
  569|  5.32k|    if (!use34)
  ------------------
  |  Branch (569:9): [True: 3.11k, False: 2.20k]
  ------------------
  570|  3.11k|    {
  571|   100k|        for (n = 0; n < numTimeSlotsRate; n++)
  ------------------
  |  Branch (571:21): [True: 97.1k, False: 3.11k]
  ------------------
  572|  97.1k|        {
  573|  97.1k|            QMF_RE(X_hybrid[n][3]) += QMF_RE(X_hybrid[n][4]);
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(X_hybrid[n][3]) += QMF_RE(X_hybrid[n][4]);
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  574|  97.1k|            QMF_IM(X_hybrid[n][3]) += QMF_IM(X_hybrid[n][4]);
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(X_hybrid[n][3]) += QMF_IM(X_hybrid[n][4]);
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  575|  97.1k|            QMF_RE(X_hybrid[n][4]) = 0;
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  576|  97.1k|            QMF_IM(X_hybrid[n][4]) = 0;
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  577|       |
  578|  97.1k|            QMF_RE(X_hybrid[n][2]) += QMF_RE(X_hybrid[n][5]);
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(X_hybrid[n][2]) += QMF_RE(X_hybrid[n][5]);
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  579|  97.1k|            QMF_IM(X_hybrid[n][2]) += QMF_IM(X_hybrid[n][5]);
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(X_hybrid[n][2]) += QMF_IM(X_hybrid[n][5]);
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  580|  97.1k|            QMF_RE(X_hybrid[n][5]) = 0;
  ------------------
  |  |  168|  97.1k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  97.1k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  581|  97.1k|            QMF_IM(X_hybrid[n][5]) = 0;
  ------------------
  |  |  169|  97.1k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  97.1k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  582|  97.1k|        }
  583|  3.11k|    }
  584|  5.32k|}
ps_dec.c:channel_filter2:
  264|  6.23k|{
  265|  6.23k|    uint8_t i;
  266|  6.23k|    (void)hyb;  /* TODO: remove parameter? */
  267|       |
  268|   200k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (268:17): [True: 194k, False: 6.23k]
  ------------------
  269|   194k|    {
  270|   194k|        real_t r0 = MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  271|   194k|        real_t r1 = MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  272|   194k|        real_t r2 = MUL_F(filter[2],(QMF_RE(buffer[2+i]) + QMF_RE(buffer[10+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  273|   194k|        real_t r3 = MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  274|   194k|        real_t r4 = MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  275|   194k|        real_t r5 = MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  276|   194k|        real_t r6 = MUL_F(filter[6],QMF_RE(buffer[6+i]));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  277|   194k|        real_t i0 = MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  278|   194k|        real_t i1 = MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  279|   194k|        real_t i2 = MUL_F(filter[2],(QMF_IM(buffer[2+i]) + QMF_IM(buffer[10+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  280|   194k|        real_t i3 = MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  281|   194k|        real_t i4 = MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  282|   194k|        real_t i5 = MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  283|   194k|        real_t i6 = MUL_F(filter[6],QMF_IM(buffer[6+i]));
  ------------------
  |  |  286|   194k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  284|       |
  285|       |        /* q = 0 */
  286|   194k|        QMF_RE(X_hybrid[i][0]) = r0 + r1 + r2 + r3 + r4 + r5 + r6;
  ------------------
  |  |  168|   194k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   194k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  287|   194k|        QMF_IM(X_hybrid[i][0]) = i0 + i1 + i2 + i3 + i4 + i5 + i6;
  ------------------
  |  |  169|   194k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   194k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  288|       |
  289|       |        /* q = 1 */
  290|   194k|        QMF_RE(X_hybrid[i][1]) = r0 - r1 + r2 - r3 + r4 - r5 + r6;
  ------------------
  |  |  168|   194k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   194k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  291|   194k|        QMF_IM(X_hybrid[i][1]) = i0 - i1 + i2 - i3 + i4 - i5 + i6;
  ------------------
  |  |  169|   194k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   194k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  292|   194k|    }
  293|  6.23k|}
ps_dec.c:channel_filter4:
  298|  6.60k|{
  299|  6.60k|    uint8_t i;
  300|  6.60k|    real_t input_re1[2], input_re2[2], input_im1[2], input_im2[2];
  301|  6.60k|    (void)hyb;  /* TODO: remove parameter? */
  302|       |
  303|   207k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (303:17): [True: 201k, False: 6.60k]
  ------------------
  304|   201k|    {
  305|   201k|        input_re1[0] = -MUL_F(filter[2], (QMF_RE(buffer[i+2]) + QMF_RE(buffer[i+10]))) +
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  306|   201k|            MUL_F(filter[6], QMF_RE(buffer[i+6]));
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  307|   201k|        input_re1[1] = MUL_F(FRAC_CONST(-0.70710678118655),
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  308|   201k|            (MUL_F(filter[1], (QMF_RE(buffer[i+1]) + QMF_RE(buffer[i+11]))) +
  309|   201k|            MUL_F(filter[3], (QMF_RE(buffer[i+3]) + QMF_RE(buffer[i+9]))) -
  310|   201k|            MUL_F(filter[5], (QMF_RE(buffer[i+5]) + QMF_RE(buffer[i+7])))));
  311|       |
  312|   201k|        input_im1[0] = MUL_F(filter[0], (QMF_IM(buffer[i+0]) - QMF_IM(buffer[i+12]))) -
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  313|   201k|            MUL_F(filter[4], (QMF_IM(buffer[i+4]) - QMF_IM(buffer[i+8])));
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  314|   201k|        input_im1[1] = MUL_F(FRAC_CONST(0.70710678118655),
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  315|   201k|            (MUL_F(filter[1], (QMF_IM(buffer[i+1]) - QMF_IM(buffer[i+11]))) -
  316|   201k|            MUL_F(filter[3], (QMF_IM(buffer[i+3]) - QMF_IM(buffer[i+9]))) -
  317|   201k|            MUL_F(filter[5], (QMF_IM(buffer[i+5]) - QMF_IM(buffer[i+7])))));
  318|       |
  319|   201k|        input_re2[0] = MUL_F(filter[0], (QMF_RE(buffer[i+0]) - QMF_RE(buffer[i+12]))) -
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  320|   201k|            MUL_F(filter[4], (QMF_RE(buffer[i+4]) - QMF_RE(buffer[i+8])));
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  321|   201k|        input_re2[1] = MUL_F(FRAC_CONST(0.70710678118655),
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  322|   201k|            (MUL_F(filter[1], (QMF_RE(buffer[i+1]) - QMF_RE(buffer[i+11]))) -
  323|   201k|            MUL_F(filter[3], (QMF_RE(buffer[i+3]) - QMF_RE(buffer[i+9]))) -
  324|   201k|            MUL_F(filter[5], (QMF_RE(buffer[i+5]) - QMF_RE(buffer[i+7])))));
  325|       |
  326|   201k|        input_im2[0] = -MUL_F(filter[2], (QMF_IM(buffer[i+2]) + QMF_IM(buffer[i+10]))) +
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  327|   201k|            MUL_F(filter[6], QMF_IM(buffer[i+6]));
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  328|   201k|        input_im2[1] = MUL_F(FRAC_CONST(-0.70710678118655),
  ------------------
  |  |  286|   201k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  329|   201k|            (MUL_F(filter[1], (QMF_IM(buffer[i+1]) + QMF_IM(buffer[i+11]))) +
  330|   201k|            MUL_F(filter[3], (QMF_IM(buffer[i+3]) + QMF_IM(buffer[i+9]))) -
  331|   201k|            MUL_F(filter[5], (QMF_IM(buffer[i+5]) + QMF_IM(buffer[i+7])))));
  332|       |
  333|       |        /* q == 0 */
  334|   201k|        QMF_RE(X_hybrid[i][0]) =  input_re1[0] + input_re1[1] + input_im1[0] + input_im1[1];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  335|   201k|        QMF_IM(X_hybrid[i][0]) = -input_re2[0] - input_re2[1] + input_im2[0] + input_im2[1];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  336|       |
  337|       |        /* q == 1 */
  338|   201k|        QMF_RE(X_hybrid[i][1]) =  input_re1[0] - input_re1[1] - input_im1[0] + input_im1[1];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  339|   201k|        QMF_IM(X_hybrid[i][1]) =  input_re2[0] - input_re2[1] + input_im2[0] - input_im2[1];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  340|       |
  341|       |        /* q == 2 */
  342|   201k|        QMF_RE(X_hybrid[i][2]) =  input_re1[0] - input_re1[1] + input_im1[0] - input_im1[1];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  343|   201k|        QMF_IM(X_hybrid[i][2]) = -input_re2[0] + input_re2[1] + input_im2[0] - input_im2[1];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  344|       |
  345|       |        /* q == 3 */
  346|   201k|        QMF_RE(X_hybrid[i][3]) =  input_re1[0] + input_re1[1] - input_im1[0] - input_im1[1];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  347|   201k|        QMF_IM(X_hybrid[i][3]) =  input_re2[0] + input_re2[1] + input_im2[0] + input_im2[1];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  348|   201k|    }
  349|  6.60k|}
ps_dec.c:channel_filter8:
  373|  5.32k|{
  374|  5.32k|    uint8_t i, n;
  375|  5.32k|    real_t input_re1[4], input_re2[4], input_im1[4], input_im2[4];
  376|  5.32k|    real_t x[4];
  377|  5.32k|    (void)hyb;  /* TODO: remove parameter? */
  378|       |
  379|   169k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (379:17): [True: 164k, False: 5.32k]
  ------------------
  380|   164k|    {
  381|   164k|        input_re1[0] =  MUL_F(filter[6],QMF_RE(buffer[6+i]));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  382|   164k|        input_re1[1] =  MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  383|   164k|        input_re1[2] = -MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i]))) + MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_re1[2] = -MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i]))) + MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  384|   164k|        input_re1[3] = -MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i]))) + MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_re1[3] = -MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i]))) + MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  385|       |
  386|   164k|        input_im1[0] = MUL_F(filter[5],(QMF_IM(buffer[7+i]) - QMF_IM(buffer[5+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  387|   164k|        input_im1[1] = MUL_F(filter[0],(QMF_IM(buffer[12+i]) - QMF_IM(buffer[0+i]))) + MUL_F(filter[4],(QMF_IM(buffer[8+i]) - QMF_IM(buffer[4+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_im1[1] = MUL_F(filter[0],(QMF_IM(buffer[12+i]) - QMF_IM(buffer[0+i]))) + MUL_F(filter[4],(QMF_IM(buffer[8+i]) - QMF_IM(buffer[4+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  388|   164k|        input_im1[2] = MUL_F(filter[1],(QMF_IM(buffer[11+i]) - QMF_IM(buffer[1+i]))) + MUL_F(filter[3],(QMF_IM(buffer[9+i]) - QMF_IM(buffer[3+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_im1[2] = MUL_F(filter[1],(QMF_IM(buffer[11+i]) - QMF_IM(buffer[1+i]))) + MUL_F(filter[3],(QMF_IM(buffer[9+i]) - QMF_IM(buffer[3+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  389|   164k|        input_im1[3] = MUL_F(filter[2],(QMF_IM(buffer[10+i]) - QMF_IM(buffer[2+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  390|       |
  391|   821k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (391:21): [True: 656k, False: 164k]
  ------------------
  392|   656k|        {
  393|   656k|            x[n] = input_re1[n] - input_im1[3-n];
  394|   656k|        }
  395|   164k|        DCT3_4_unscaled(x, x);
  396|   164k|        QMF_RE(X_hybrid[i][7]) = x[0];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  397|   164k|        QMF_RE(X_hybrid[i][5]) = x[2];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  398|   164k|        QMF_RE(X_hybrid[i][3]) = x[3];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  399|   164k|        QMF_RE(X_hybrid[i][1]) = x[1];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  400|       |
  401|   821k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (401:21): [True: 656k, False: 164k]
  ------------------
  402|   656k|        {
  403|   656k|            x[n] = input_re1[n] + input_im1[3-n];
  404|   656k|        }
  405|   164k|        DCT3_4_unscaled(x, x);
  406|   164k|        QMF_RE(X_hybrid[i][6]) = x[1];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  407|   164k|        QMF_RE(X_hybrid[i][4]) = x[3];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  408|   164k|        QMF_RE(X_hybrid[i][2]) = x[2];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  409|   164k|        QMF_RE(X_hybrid[i][0]) = x[0];
  ------------------
  |  |  168|   164k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   164k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  410|       |
  411|   164k|        input_im2[0] =  MUL_F(filter[6],QMF_IM(buffer[6+i]));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  412|   164k|        input_im2[1] =  MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  413|   164k|        input_im2[2] = -MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i]))) + MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_im2[2] = -MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i]))) + MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  414|   164k|        input_im2[3] = -MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i]))) + MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_im2[3] = -MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i]))) + MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  415|       |
  416|   164k|        input_re2[0] = MUL_F(filter[5],(QMF_RE(buffer[7+i]) - QMF_RE(buffer[5+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  417|   164k|        input_re2[1] = MUL_F(filter[0],(QMF_RE(buffer[12+i]) - QMF_RE(buffer[0+i]))) + MUL_F(filter[4],(QMF_RE(buffer[8+i]) - QMF_RE(buffer[4+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_re2[1] = MUL_F(filter[0],(QMF_RE(buffer[12+i]) - QMF_RE(buffer[0+i]))) + MUL_F(filter[4],(QMF_RE(buffer[8+i]) - QMF_RE(buffer[4+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  418|   164k|        input_re2[2] = MUL_F(filter[1],(QMF_RE(buffer[11+i]) - QMF_RE(buffer[1+i]))) + MUL_F(filter[3],(QMF_RE(buffer[9+i]) - QMF_RE(buffer[3+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      input_re2[2] = MUL_F(filter[1],(QMF_RE(buffer[11+i]) - QMF_RE(buffer[1+i]))) + MUL_F(filter[3],(QMF_RE(buffer[9+i]) - QMF_RE(buffer[3+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  419|   164k|        input_re2[3] = MUL_F(filter[2],(QMF_RE(buffer[10+i]) - QMF_RE(buffer[2+i])));
  ------------------
  |  |  286|   164k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  420|       |
  421|   821k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (421:21): [True: 656k, False: 164k]
  ------------------
  422|   656k|        {
  423|   656k|            x[n] = input_im2[n] + input_re2[3-n];
  424|   656k|        }
  425|   164k|        DCT3_4_unscaled(x, x);
  426|   164k|        QMF_IM(X_hybrid[i][7]) = x[0];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  427|   164k|        QMF_IM(X_hybrid[i][5]) = x[2];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  428|   164k|        QMF_IM(X_hybrid[i][3]) = x[3];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  429|   164k|        QMF_IM(X_hybrid[i][1]) = x[1];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  430|       |
  431|   821k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (431:21): [True: 656k, False: 164k]
  ------------------
  432|   656k|        {
  433|   656k|            x[n] = input_im2[n] - input_re2[3-n];
  434|   656k|        }
  435|   164k|        DCT3_4_unscaled(x, x);
  436|   164k|        QMF_IM(X_hybrid[i][6]) = x[1];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  437|   164k|        QMF_IM(X_hybrid[i][4]) = x[3];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  438|   164k|        QMF_IM(X_hybrid[i][2]) = x[2];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  439|   164k|        QMF_IM(X_hybrid[i][0]) = x[0];
  ------------------
  |  |  169|   164k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   164k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  440|   164k|    }
  441|  5.32k|}
ps_dec.c:DCT3_4_unscaled:
  352|   656k|{
  353|   656k|    real_t f0, f1, f2, f3, f4, f5, f6, f7, f8;
  354|       |
  355|   656k|    f0 = MUL_F(x[2], FRAC_CONST(0.7071067811865476));
  ------------------
  |  |  286|   656k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  356|   656k|    f1 = x[0] - f0;
  357|   656k|    f2 = x[0] + f0;
  358|   656k|    f3 = x[1] + x[3];
  359|   656k|    f4 = MUL_C(x[1], COEF_CONST(1.3065629648763766));
  ------------------
  |  |  285|   656k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  360|   656k|    f5 = MUL_F(f3, FRAC_CONST(-0.9238795325112866));
  ------------------
  |  |  286|   656k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  361|   656k|    f6 = MUL_F(x[3], FRAC_CONST(-0.5411961001461967));
  ------------------
  |  |  286|   656k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  362|   656k|    f7 = f4 + f5;
  363|   656k|    f8 = f6 - f5;
  364|   656k|    y[3] = f2 - f8;
  365|   656k|    y[0] = f2 + f8;
  366|   656k|    y[2] = f1 - f7;
  367|   656k|    y[1] = f1 + f7;
  368|   656k|}
ps_dec.c:channel_filter12:
  466|  2.20k|{
  467|  2.20k|    uint8_t i, n;
  468|  2.20k|    real_t input_re1[6], input_re2[6], input_im1[6], input_im2[6];
  469|  2.20k|    real_t out_re1[6], out_re2[6], out_im1[6], out_im2[6];
  470|  2.20k|    (void)hyb;  /* TODO: remove parameter? */
  471|       |
  472|  69.2k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (472:17): [True: 67.0k, False: 2.20k]
  ------------------
  473|  67.0k|    {
  474|   469k|        for (n = 0; n < 6; n++)
  ------------------
  |  Branch (474:21): [True: 402k, False: 67.0k]
  ------------------
  475|   402k|        {
  476|   402k|            if (n == 0)
  ------------------
  |  Branch (476:17): [True: 67.0k, False: 335k]
  ------------------
  477|  67.0k|            {
  478|  67.0k|                input_re1[0] = MUL_F(QMF_RE(buffer[6+i]), filter[6]);
  ------------------
  |  |  286|  67.0k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  479|  67.0k|                input_re2[0] = MUL_F(QMF_IM(buffer[6+i]), filter[6]);
  ------------------
  |  |  286|  67.0k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  480|   335k|            } else {
  481|   335k|                input_re1[6-n] = MUL_F((QMF_RE(buffer[n+i]) + QMF_RE(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   335k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  482|   335k|                input_re2[6-n] = MUL_F((QMF_IM(buffer[n+i]) + QMF_IM(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   335k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  483|   335k|            }
  484|   402k|            input_im2[n] = MUL_F((QMF_RE(buffer[n+i]) - QMF_RE(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   402k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  485|   402k|            input_im1[n] = MUL_F((QMF_IM(buffer[n+i]) - QMF_IM(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   402k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  486|   402k|        }
  487|       |
  488|  67.0k|        DCT3_6_unscaled(out_re1, input_re1);
  489|  67.0k|        DCT3_6_unscaled(out_re2, input_re2);
  490|       |
  491|  67.0k|        DCT3_6_unscaled(out_im1, input_im1);
  492|  67.0k|        DCT3_6_unscaled(out_im2, input_im2);
  493|       |
  494|   268k|        for (n = 0; n < 6; n += 2)
  ------------------
  |  Branch (494:21): [True: 201k, False: 67.0k]
  ------------------
  495|   201k|        {
  496|   201k|            QMF_RE(X_hybrid[i][n]) = out_re1[n] - out_im1[n];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  497|   201k|            QMF_IM(X_hybrid[i][n]) = out_re2[n] + out_im2[n];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  498|   201k|            QMF_RE(X_hybrid[i][n+1]) = out_re1[n+1] + out_im1[n+1];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  499|   201k|            QMF_IM(X_hybrid[i][n+1]) = out_re2[n+1] - out_im2[n+1];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  500|       |
  501|   201k|            QMF_RE(X_hybrid[i][10-n]) = out_re1[n+1] - out_im1[n+1];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  502|   201k|            QMF_IM(X_hybrid[i][10-n]) = out_re2[n+1] + out_im2[n+1];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  503|   201k|            QMF_RE(X_hybrid[i][11-n]) = out_re1[n] + out_im1[n];
  ------------------
  |  |  168|   201k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   201k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  504|   201k|            QMF_IM(X_hybrid[i][11-n]) = out_re2[n] - out_im2[n];
  ------------------
  |  |  169|   201k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   201k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  505|   201k|        }
  506|  67.0k|    }
  507|  2.20k|}
ps_dec.c:DCT3_6_unscaled:
  444|   268k|{
  445|   268k|    real_t f0, f1, f2, f3, f4, f5, f6, f7;
  446|       |
  447|   268k|    f0 = MUL_F(x[3], FRAC_CONST(0.70710678118655));
  ------------------
  |  |  286|   268k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  448|   268k|    f1 = x[0] + f0;
  449|   268k|    f2 = x[0] - f0;
  450|   268k|    f3 = MUL_F((x[1] - x[5]), FRAC_CONST(0.70710678118655));
  ------------------
  |  |  286|   268k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  451|   268k|    f4 = MUL_F(x[2], FRAC_CONST(0.86602540378444)) + MUL_F(x[4], FRAC_CONST(0.5));
  ------------------
  |  |  286|   268k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                  f4 = MUL_F(x[2], FRAC_CONST(0.86602540378444)) + MUL_F(x[4], FRAC_CONST(0.5));
  ------------------
  |  |  286|   268k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  452|   268k|    f5 = f4 - x[4];
  453|   268k|    f6 = MUL_F(x[1], FRAC_CONST(0.96592582628907)) + MUL_F(x[5], FRAC_CONST(0.25881904510252));
  ------------------
  |  |  286|   268k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                  f6 = MUL_F(x[1], FRAC_CONST(0.96592582628907)) + MUL_F(x[5], FRAC_CONST(0.25881904510252));
  ------------------
  |  |  286|   268k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  454|   268k|    f7 = f6 - f3;
  455|   268k|    y[0] = f1 + f6 + f4;
  456|   268k|    y[1] = f2 + f3 - x[4];
  457|   268k|    y[2] = f7 + f2 - f5;
  458|   268k|    y[3] = f1 - f7 - f5;
  459|   268k|    y[4] = f1 - f3 - x[4];
  460|   268k|    y[5] = f2 - f6 + f4;
  461|   268k|}
ps_dec.c:ps_decorrelate:
 1041|  5.32k|{
 1042|  5.32k|    uint8_t gr, n, bk;
 1043|  5.32k|    uint8_t temp_delay = 0;
 1044|  5.32k|    uint8_t sb, maxsb;
 1045|  5.32k|    const complex_t *Phi_Fract_SubQmf;
 1046|  5.32k|    uint8_t temp_delay_ser[NO_ALLPASS_LINKS];
 1047|  5.32k|    real_t P_SmoothPeakDecayDiffNrg, nrg;
 1048|  5.32k|    real_t P[32][34];
 1049|  5.32k|    real_t G_TransientRatio[32][34] = {{0}};
 1050|  5.32k|    complex_t inputLeft;
 1051|       |
 1052|       |
 1053|       |    /* chose hybrid filterbank: 20 or 34 band case */
 1054|  5.32k|    if (ps->use34hybrid_bands)
  ------------------
  |  Branch (1054:9): [True: 2.20k, False: 3.11k]
  ------------------
 1055|  2.20k|    {
 1056|  2.20k|        Phi_Fract_SubQmf = Phi_Fract_SubQmf34;
 1057|  3.11k|    } else{
 1058|  3.11k|        Phi_Fract_SubQmf = Phi_Fract_SubQmf20;
 1059|  3.11k|    }
 1060|       |
 1061|       |    /* clear the energy values */
 1062|   175k|    for (n = 0; n < 32; n++)
  ------------------
  |  Branch (1062:17): [True: 170k, False: 5.32k]
  ------------------
 1063|   170k|    {
 1064|  5.95M|        for (bk = 0; bk < 34; bk++)
  ------------------
  |  Branch (1064:22): [True: 5.78M, False: 170k]
  ------------------
 1065|  5.78M|        {
 1066|  5.78M|            P[n][bk] = 0;
 1067|  5.78M|        }
 1068|   170k|    }
 1069|       |
 1070|       |    /* calculate the energy in each parameter band b(k) */
 1071|   184k|    for (gr = 0; gr < ps->num_groups; gr++)
  ------------------
  |  Branch (1071:18): [True: 178k, False: 5.32k]
  ------------------
 1072|   178k|    {
 1073|       |        /* select the parameter index b(k) to which this group belongs */
 1074|   178k|        bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
  ------------------
  |  |   41|   178k|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
 1075|       |
 1076|       |        /* select the upper subband border for this group */
 1077|   178k|        maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr]+1 : ps->group_border[gr+1];
  ------------------
  |  Branch (1077:17): [True: 101k, False: 77.0k]
  ------------------
 1078|       |
 1079|   600k|        for (sb = ps->group_border[gr]; sb < maxsb; sb++)
  ------------------
  |  Branch (1079:41): [True: 421k, False: 178k]
  ------------------
 1080|   421k|        {
 1081|  13.5M|            for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
  ------------------
  |  Branch (1081:46): [True: 13.0M, False: 421k]
  ------------------
 1082|  13.0M|            {
 1083|       |#ifdef FIXED_POINT
 1084|       |                uint32_t in_re, in_im;
 1085|       |#endif
 1086|       |
 1087|       |                /* input from hybrid subbands or QMF subbands */
 1088|  13.0M|                if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1088:21): [True: 3.12M, False: 9.95M]
  ------------------
 1089|  3.12M|                {
 1090|  3.12M|                    RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  168|  3.12M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.12M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1091|  3.12M|                    IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  169|  3.12M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.12M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1092|  9.95M|                } else {
 1093|  9.95M|                    RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  168|  9.95M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  9.95M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1094|  9.95M|                    IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  169|  9.95M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  9.95M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1095|  9.95M|                }
 1096|       |
 1097|       |                /* accumulate energy */
 1098|       |#ifdef FIXED_POINT
 1099|       |                /* NOTE: all input is scaled by 2^(-5) because of fixed point QMF
 1100|       |                 * meaning that P will be scaled by 2^(-10) compared to floating point version
 1101|       |                 */
 1102|       |                in_re = ((abs(RE(inputLeft))+(1<<(REAL_BITS-1)))>>REAL_BITS);
 1103|       |                in_im = ((abs(IM(inputLeft))+(1<<(REAL_BITS-1)))>>REAL_BITS);
 1104|       |                P[n][bk] += in_re*in_re + in_im*in_im;
 1105|       |#else
 1106|  13.0M|                P[n][bk] += MUL_R(RE(inputLeft),RE(inputLeft)) + MUL_R(IM(inputLeft),IM(inputLeft));
  ------------------
  |  |  284|  13.0M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                              P[n][bk] += MUL_R(RE(inputLeft),RE(inputLeft)) + MUL_R(IM(inputLeft),IM(inputLeft));
  ------------------
  |  |  284|  13.0M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1107|  13.0M|#endif
 1108|  13.0M|            }
 1109|   421k|        }
 1110|   178k|    }
 1111|       |
 1112|       |#if 0
 1113|       |    for (n = 0; n < 32; n++)
 1114|       |    {
 1115|       |        for (bk = 0; bk < 34; bk++)
 1116|       |        {
 1117|       |#ifdef FIXED_POINT
 1118|       |            printf("%d %d: %d\n", n, bk, P[n][bk] /*/(float)REAL_PRECISION*/);
 1119|       |#else
 1120|       |            printf("%d %d: %f\n", n, bk, P[n][bk]/1024.0);
 1121|       |#endif
 1122|       |        }
 1123|       |    }
 1124|       |#endif
 1125|       |
 1126|       |    /* calculate transient reduction ratio for each parameter band b(k) */
 1127|   142k|    for (bk = 0; bk < ps->nr_par_bands; bk++)
  ------------------
  |  Branch (1127:18): [True: 137k, False: 5.32k]
  ------------------
 1128|   137k|    {
 1129|  4.38M|        for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
  ------------------
  |  Branch (1129:42): [True: 4.24M, False: 137k]
  ------------------
 1130|  4.24M|        {
 1131|  4.24M|            const real_t gamma = COEF_CONST(1.5);
  ------------------
  |  |  289|  4.24M|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
 1132|       |
 1133|  4.24M|            ps->P_PeakDecayNrg[bk] = MUL_F(ps->P_PeakDecayNrg[bk], ps->alpha_decay);
  ------------------
  |  |  286|  4.24M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1134|  4.24M|            if (ps->P_PeakDecayNrg[bk] < P[n][bk])
  ------------------
  |  Branch (1134:17): [True: 73.8k, False: 4.17M]
  ------------------
 1135|  73.8k|                ps->P_PeakDecayNrg[bk] = P[n][bk];
 1136|       |
 1137|       |            /* apply smoothing filter to peak decay energy */
 1138|  4.24M|            P_SmoothPeakDecayDiffNrg = ps->P_SmoothPeakDecayDiffNrg_prev[bk];
 1139|  4.24M|            P_SmoothPeakDecayDiffNrg += MUL_F((ps->P_PeakDecayNrg[bk] - P[n][bk] - ps->P_SmoothPeakDecayDiffNrg_prev[bk]), ps->alpha_smooth);
  ------------------
  |  |  286|  4.24M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1140|  4.24M|            ps->P_SmoothPeakDecayDiffNrg_prev[bk] = P_SmoothPeakDecayDiffNrg;
 1141|       |
 1142|       |            /* apply smoothing filter to energy */
 1143|  4.24M|            nrg = ps->P_prev[bk];
 1144|  4.24M|            nrg += MUL_F((P[n][bk] - ps->P_prev[bk]), ps->alpha_smooth);
  ------------------
  |  |  286|  4.24M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1145|  4.24M|            ps->P_prev[bk] = nrg;
 1146|       |
 1147|       |            /* calculate transient ratio */
 1148|  4.24M|            if (MUL_C(P_SmoothPeakDecayDiffNrg, gamma) <= nrg)
  ------------------
  |  |  285|  4.24M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  |  Branch (1148:17): [True: 4.18M, False: 63.6k]
  ------------------
 1149|  4.18M|            {
 1150|  4.18M|                G_TransientRatio[n][bk] = REAL_CONST(1.0);
  ------------------
  |  |  288|  4.18M|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
 1151|  4.18M|            } else {
 1152|  63.6k|                G_TransientRatio[n][bk] = DIV_R(nrg, (MUL_C(P_SmoothPeakDecayDiffNrg, gamma)));
  ------------------
  |  |  161|  63.6k|#define DIV_R(A, B) ((A)/(B))
  ------------------
 1153|  63.6k|            }
 1154|  4.24M|        }
 1155|   137k|    }
 1156|       |
 1157|       |#if 0
 1158|       |    for (n = 0; n < 32; n++)
 1159|       |    {
 1160|       |        for (bk = 0; bk < 34; bk++)
 1161|       |        {
 1162|       |#ifdef FIXED_POINT
 1163|       |            printf("%d %d: %f\n", n, bk, G_TransientRatio[n][bk]/(float)REAL_PRECISION);
 1164|       |#else
 1165|       |            printf("%d %d: %f\n", n, bk, G_TransientRatio[n][bk]);
 1166|       |#endif
 1167|       |        }
 1168|       |    }
 1169|       |#endif
 1170|       |
 1171|       |    /* apply stereo decorrelation filter to the signal */
 1172|   184k|    for (gr = 0; gr < ps->num_groups; gr++)
  ------------------
  |  Branch (1172:18): [True: 178k, False: 5.32k]
  ------------------
 1173|   178k|    {
 1174|   178k|        if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1174:13): [True: 101k, False: 77.0k]
  ------------------
 1175|   101k|            maxsb = ps->group_border[gr] + 1;
 1176|  77.0k|        else
 1177|  77.0k|            maxsb = ps->group_border[gr + 1];
 1178|       |
 1179|       |        /* QMF channel */
 1180|   600k|        for (sb = ps->group_border[gr]; sb < maxsb; sb++)
  ------------------
  |  Branch (1180:41): [True: 421k, False: 178k]
  ------------------
 1181|   421k|        {
 1182|   421k|            real_t g_DecaySlope;
 1183|   421k|            real_t g_DecaySlope_filt[NO_ALLPASS_LINKS];
 1184|       |
 1185|       |            /* g_DecaySlope: [0..1] */
 1186|   421k|            if (gr < ps->num_hybrid_groups || sb <= ps->decay_cutoff)
  ------------------
  |  Branch (1186:17): [True: 101k, False: 320k]
  |  Branch (1186:47): [True: 5.32k, False: 314k]
  ------------------
 1187|   106k|            {
 1188|   106k|                g_DecaySlope = FRAC_CONST(1.0);
  ------------------
  |  |  291|   106k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1189|   314k|            } else {
 1190|   314k|                int8_t decay = ps->decay_cutoff - sb;
 1191|   314k|                if (decay <= -20 /* -1/DECAY_SLOPE */)
  ------------------
  |  Branch (1191:21): [True: 213k, False: 101k]
  ------------------
 1192|   213k|                {
 1193|   213k|                    g_DecaySlope = 0;
 1194|   213k|                } else {
 1195|       |                    /* decay(int)*decay_slope(frac) = g_DecaySlope(frac) */
 1196|   101k|                    g_DecaySlope = FRAC_CONST(1.0) + DECAY_SLOPE * decay;
  ------------------
  |  |  291|   101k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
                                  g_DecaySlope = FRAC_CONST(1.0) + DECAY_SLOPE * decay;
  ------------------
  |  |   42|   101k|#define DECAY_SLOPE                FRAC_CONST(0.05)
  |  |  ------------------
  |  |  |  |  291|   101k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  |  |  ------------------
  ------------------
 1197|   101k|                }
 1198|   314k|            }
 1199|       |
 1200|       |            /* calculate g_DecaySlope_filt for every n multiplied by filter_a[n] */
 1201|  1.68M|            for (n = 0; n < NO_ALLPASS_LINKS; n++)
  ------------------
  |  |   43|  1.68M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1201:25): [True: 1.26M, False: 421k]
  ------------------
 1202|  1.26M|            {
 1203|  1.26M|                g_DecaySlope_filt[n] = MUL_F(g_DecaySlope, filter_a[n]);
  ------------------
  |  |  286|  1.26M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1204|  1.26M|            }
 1205|       |
 1206|       |
 1207|       |            /* set delay indices */
 1208|   421k|            temp_delay = ps->saved_delay;
 1209|  1.68M|            for (n = 0; n < NO_ALLPASS_LINKS; n++)
  ------------------
  |  |   43|  1.68M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1209:25): [True: 1.26M, False: 421k]
  ------------------
 1210|  1.26M|                temp_delay_ser[n] = ps->delay_buf_index_ser[n];
 1211|       |
 1212|  13.5M|            for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
  ------------------
  |  Branch (1212:46): [True: 13.0M, False: 421k]
  ------------------
 1213|  13.0M|            {
 1214|  13.0M|                complex_t tmp, tmp0, R0;
 1215|  13.0M|                uint8_t m;
 1216|       |
 1217|  13.0M|                if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1217:21): [True: 3.12M, False: 9.95M]
  ------------------
 1218|  3.12M|                {
 1219|       |                    /* hybrid filterbank input */
 1220|  3.12M|                    RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  168|  3.12M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.12M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1221|  3.12M|                    IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  169|  3.12M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.12M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1222|  9.95M|                } else {
 1223|       |                    /* QMF filterbank input */
 1224|  9.95M|                    RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  168|  9.95M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  9.95M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1225|  9.95M|                    IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  169|  9.95M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  9.95M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1226|  9.95M|                }
 1227|       |
 1228|  13.0M|                if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
  ------------------
  |  Branch (1228:21): [True: 7.38M, False: 5.69M]
  |  Branch (1228:50): [True: 6.77M, False: 603k]
  ------------------
 1229|  6.77M|                {
 1230|       |                    /* delay */
 1231|       |
 1232|       |                    /* never hybrid subbands here, always QMF subbands */
 1233|  6.77M|                    RE(tmp) = RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  391|  6.77M|#define RE(A) (A)[0]
  ------------------
                                  RE(tmp) = RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  391|  6.77M|#define RE(A) (A)[0]
  ------------------
 1234|  6.77M|                    IM(tmp) = IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  392|  6.77M|#define IM(A) (A)[1]
  ------------------
                                  IM(tmp) = IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  392|  6.77M|#define IM(A) (A)[1]
  ------------------
 1235|  6.77M|                    RE(R0) = RE(tmp);
  ------------------
  |  |  391|  6.77M|#define RE(A) (A)[0]
  ------------------
                                  RE(R0) = RE(tmp);
  ------------------
  |  |  391|  6.77M|#define RE(A) (A)[0]
  ------------------
 1236|  6.77M|                    IM(R0) = IM(tmp);
  ------------------
  |  |  392|  6.77M|#define IM(A) (A)[1]
  ------------------
                                  IM(R0) = IM(tmp);
  ------------------
  |  |  392|  6.77M|#define IM(A) (A)[1]
  ------------------
 1237|  6.77M|                    RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  6.77M|#define RE(A) (A)[0]
  ------------------
                                  RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  6.77M|#define RE(A) (A)[0]
  ------------------
 1238|  6.77M|                    IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  6.77M|#define IM(A) (A)[1]
  ------------------
                                  IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  6.77M|#define IM(A) (A)[1]
  ------------------
 1239|  6.77M|                } else {
 1240|       |                    /* allpass filter */
 1241|  6.30M|                    complex_t Phi_Fract;
 1242|       |
 1243|       |                    /* fetch parameters */
 1244|  6.30M|                    if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1244:25): [True: 3.12M, False: 3.17M]
  ------------------
 1245|  3.12M|                    {
 1246|       |                        /* select data from the hybrid subbands */
 1247|  3.12M|                        RE(tmp0) = RE(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp0) = RE(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1248|  3.12M|                        IM(tmp0) = IM(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp0) = IM(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1249|       |
 1250|  3.12M|                        RE(ps->delay_SubQmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(ps->delay_SubQmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1251|  3.12M|                        IM(ps->delay_SubQmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(ps->delay_SubQmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1252|       |
 1253|  3.12M|                        RE(Phi_Fract) = RE(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(Phi_Fract) = RE(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1254|  3.12M|                        IM(Phi_Fract) = IM(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(Phi_Fract) = IM(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1255|  3.17M|                    } else {
 1256|       |                        /* select data from the QMF subbands */
 1257|  3.17M|                        RE(tmp0) = RE(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.17M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp0) = RE(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.17M|#define RE(A) (A)[0]
  ------------------
 1258|  3.17M|                        IM(tmp0) = IM(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.17M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp0) = IM(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.17M|#define IM(A) (A)[1]
  ------------------
 1259|       |
 1260|  3.17M|                        RE(ps->delay_Qmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.17M|#define RE(A) (A)[0]
  ------------------
                                      RE(ps->delay_Qmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.17M|#define RE(A) (A)[0]
  ------------------
 1261|  3.17M|                        IM(ps->delay_Qmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.17M|#define IM(A) (A)[1]
  ------------------
                                      IM(ps->delay_Qmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.17M|#define IM(A) (A)[1]
  ------------------
 1262|       |
 1263|  3.17M|                        RE(Phi_Fract) = RE(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  391|  3.17M|#define RE(A) (A)[0]
  ------------------
                                      RE(Phi_Fract) = RE(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  391|  3.17M|#define RE(A) (A)[0]
  ------------------
 1264|  3.17M|                        IM(Phi_Fract) = IM(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  392|  3.17M|#define IM(A) (A)[1]
  ------------------
                                      IM(Phi_Fract) = IM(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  392|  3.17M|#define IM(A) (A)[1]
  ------------------
 1265|  3.17M|                    }
 1266|       |
 1267|       |                    /* z^(-2) * Phi_Fract[k] */
 1268|  6.30M|                    ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
 1269|       |
 1270|  6.30M|                    RE(R0) = RE(tmp);
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
                                  RE(R0) = RE(tmp);
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
 1271|  6.30M|                    IM(R0) = IM(tmp);
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
                                  IM(R0) = IM(tmp);
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
 1272|  25.2M|                    for (m = 0; m < NO_ALLPASS_LINKS; m++)
  ------------------
  |  |   43|  25.2M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1272:33): [True: 18.9M, False: 6.30M]
  ------------------
 1273|  18.9M|                    {
 1274|  18.9M|                        complex_t Q_Fract_allpass, tmp2;
 1275|       |
 1276|       |                        /* fetch parameters */
 1277|  18.9M|                        if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1277:29): [True: 9.38M, False: 9.51M]
  ------------------
 1278|  9.38M|                        {
 1279|       |                            /* select data from the hybrid subbands */
 1280|  9.38M|                            RE(tmp0) = RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  9.38M|#define RE(A) (A)[0]
  ------------------
                                          RE(tmp0) = RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  9.38M|#define RE(A) (A)[0]
  ------------------
 1281|  9.38M|                            IM(tmp0) = IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  9.38M|#define IM(A) (A)[1]
  ------------------
                                          IM(tmp0) = IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  9.38M|#define IM(A) (A)[1]
  ------------------
 1282|       |
 1283|  9.38M|                            if (ps->use34hybrid_bands)
  ------------------
  |  Branch (1283:33): [True: 6.44M, False: 2.94M]
  ------------------
 1284|  6.44M|                            {
 1285|  6.44M|                                RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  391|  6.44M|#define RE(A) (A)[0]
  ------------------
                                              RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  391|  6.44M|#define RE(A) (A)[0]
  ------------------
 1286|  6.44M|                                IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  392|  6.44M|#define IM(A) (A)[1]
  ------------------
                                              IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  392|  6.44M|#define IM(A) (A)[1]
  ------------------
 1287|  6.44M|                            } else {
 1288|  2.94M|                                RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  391|  2.94M|#define RE(A) (A)[0]
  ------------------
                                              RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  391|  2.94M|#define RE(A) (A)[0]
  ------------------
 1289|  2.94M|                                IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  392|  2.94M|#define IM(A) (A)[1]
  ------------------
                                              IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  392|  2.94M|#define IM(A) (A)[1]
  ------------------
 1290|  2.94M|                            }
 1291|  9.51M|                        } else {
 1292|       |                            /* select data from the QMF subbands */
 1293|  9.51M|                            RE(tmp0) = RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  9.51M|#define RE(A) (A)[0]
  ------------------
                                          RE(tmp0) = RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  9.51M|#define RE(A) (A)[0]
  ------------------
 1294|  9.51M|                            IM(tmp0) = IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  9.51M|#define IM(A) (A)[1]
  ------------------
                                          IM(tmp0) = IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  9.51M|#define IM(A) (A)[1]
  ------------------
 1295|       |
 1296|  9.51M|                            RE(Q_Fract_allpass) = RE(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  391|  9.51M|#define RE(A) (A)[0]
  ------------------
                                          RE(Q_Fract_allpass) = RE(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  391|  9.51M|#define RE(A) (A)[0]
  ------------------
 1297|  9.51M|                            IM(Q_Fract_allpass) = IM(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  392|  9.51M|#define IM(A) (A)[1]
  ------------------
                                          IM(Q_Fract_allpass) = IM(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  392|  9.51M|#define IM(A) (A)[1]
  ------------------
 1298|  9.51M|                        }
 1299|       |
 1300|       |                        /* delay by a fraction */
 1301|       |                        /* z^(-d(m)) * Q_Fract_allpass[k,m] */
 1302|  18.9M|                        ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
 1303|       |
 1304|       |                        /* -a(m) * g_DecaySlope[k] */
 1305|  18.9M|                        RE(tmp) += -MUL_F(g_DecaySlope_filt[m], RE(R0));
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp) += -MUL_F(g_DecaySlope_filt[m], RE(R0));
  ------------------
  |  |  286|  18.9M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1306|  18.9M|                        IM(tmp) += -MUL_F(g_DecaySlope_filt[m], IM(R0));
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp) += -MUL_F(g_DecaySlope_filt[m], IM(R0));
  ------------------
  |  |  286|  18.9M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1307|       |
 1308|       |                        /* -a(m) * g_DecaySlope[k] * Q_Fract_allpass[k,m] * z^(-d(m)) */
 1309|  18.9M|                        RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
  ------------------
  |  |  286|  18.9M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1310|  18.9M|                        IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
  ------------------
  |  |  286|  18.9M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1311|       |
 1312|       |                        /* store sample */
 1313|  18.9M|                        if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1313:29): [True: 9.38M, False: 9.51M]
  ------------------
 1314|  9.38M|                        {
 1315|  9.38M|                            RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  9.38M|#define RE(A) (A)[0]
  ------------------
                                          RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  9.38M|#define RE(A) (A)[0]
  ------------------
 1316|  9.38M|                            IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  9.38M|#define IM(A) (A)[1]
  ------------------
                                          IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  9.38M|#define IM(A) (A)[1]
  ------------------
 1317|  9.51M|                        } else {
 1318|  9.51M|                            RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  9.51M|#define RE(A) (A)[0]
  ------------------
                                          RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  9.51M|#define RE(A) (A)[0]
  ------------------
 1319|  9.51M|                            IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  9.51M|#define IM(A) (A)[1]
  ------------------
                                          IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  9.51M|#define IM(A) (A)[1]
  ------------------
 1320|  9.51M|                        }
 1321|       |
 1322|       |                        /* store for next iteration (or as output value if last iteration) */
 1323|  18.9M|                        RE(R0) = RE(tmp);
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
                                      RE(R0) = RE(tmp);
  ------------------
  |  |  391|  18.9M|#define RE(A) (A)[0]
  ------------------
 1324|  18.9M|                        IM(R0) = IM(tmp);
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
                                      IM(R0) = IM(tmp);
  ------------------
  |  |  392|  18.9M|#define IM(A) (A)[1]
  ------------------
 1325|  18.9M|                    }
 1326|  6.30M|                }
 1327|       |
 1328|       |                /* select b(k) for reading the transient ratio */
 1329|  13.0M|                bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
  ------------------
  |  |   41|  13.0M|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
 1330|       |
 1331|       |                /* duck if a past transient is found */
 1332|  13.0M|                RE(R0) = MUL_R(G_TransientRatio[n][bk], RE(R0));
  ------------------
  |  |  391|  13.0M|#define RE(A) (A)[0]
  ------------------
                              RE(R0) = MUL_R(G_TransientRatio[n][bk], RE(R0));
  ------------------
  |  |  284|  13.0M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1333|  13.0M|                IM(R0) = MUL_R(G_TransientRatio[n][bk], IM(R0));
  ------------------
  |  |  392|  13.0M|#define IM(A) (A)[1]
  ------------------
                              IM(R0) = MUL_R(G_TransientRatio[n][bk], IM(R0));
  ------------------
  |  |  284|  13.0M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1334|       |
 1335|  13.0M|                if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1335:21): [True: 3.12M, False: 9.95M]
  ------------------
 1336|  3.12M|                {
 1337|       |                    /* hybrid */
 1338|  3.12M|                    QMF_RE(X_hybrid_right[n][sb]) = RE(R0);
  ------------------
  |  |  168|  3.12M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.12M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(X_hybrid_right[n][sb]) = RE(R0);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1339|  3.12M|                    QMF_IM(X_hybrid_right[n][sb]) = IM(R0);
  ------------------
  |  |  169|  3.12M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.12M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(X_hybrid_right[n][sb]) = IM(R0);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1340|  9.95M|                } else {
 1341|       |                    /* QMF */
 1342|  9.95M|                    QMF_RE(X_right[n][sb]) = RE(R0);
  ------------------
  |  |  168|  9.95M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  9.95M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(X_right[n][sb]) = RE(R0);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
 1343|  9.95M|                    QMF_IM(X_right[n][sb]) = IM(R0);
  ------------------
  |  |  169|  9.95M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  9.95M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(X_right[n][sb]) = IM(R0);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
 1344|  9.95M|                }
 1345|       |
 1346|       |                /* Update delay buffer index */
 1347|  13.0M|                if (++temp_delay >= 2)
  ------------------
  |  Branch (1347:21): [True: 6.53M, False: 6.54M]
  ------------------
 1348|  6.53M|                {
 1349|  6.53M|                    temp_delay = 0;
 1350|  6.53M|                }
 1351|       |
 1352|       |                /* update delay indices */
 1353|  13.0M|                if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
  ------------------
  |  Branch (1353:21): [True: 7.38M, False: 5.69M]
  |  Branch (1353:50): [True: 6.77M, False: 603k]
  ------------------
 1354|  6.77M|                {
 1355|       |                    /* delay_D depends on the samplerate, it can hold the values 14 and 1 */
 1356|  6.77M|                    if (++ps->delay_buf_index_delay[sb] >= ps->delay_D[sb])
  ------------------
  |  Branch (1356:25): [True: 4.92M, False: 1.85M]
  ------------------
 1357|  4.92M|                    {
 1358|  4.92M|                        ps->delay_buf_index_delay[sb] = 0;
 1359|  4.92M|                    }
 1360|  6.77M|                }
 1361|       |
 1362|  52.3M|                for (m = 0; m < NO_ALLPASS_LINKS; m++)
  ------------------
  |  |   43|  52.3M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1362:29): [True: 39.2M, False: 13.0M]
  ------------------
 1363|  39.2M|                {
 1364|  39.2M|                    if (++temp_delay_ser[m] >= ps->num_sample_delay_ser[m])
  ------------------
  |  Branch (1364:25): [True: 10.0M, False: 29.1M]
  ------------------
 1365|  10.0M|                    {
 1366|  10.0M|                        temp_delay_ser[m] = 0;
 1367|  10.0M|                    }
 1368|  39.2M|                }
 1369|  13.0M|            }
 1370|   421k|        }
 1371|   178k|    }
 1372|       |
 1373|       |    /* update delay indices */
 1374|  5.32k|    ps->saved_delay = temp_delay;
 1375|  21.2k|    for (n = 0; n < NO_ALLPASS_LINKS; n++)
  ------------------
  |  |   43|  21.2k|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1375:17): [True: 15.9k, False: 5.32k]
  ------------------
 1376|  15.9k|        ps->delay_buf_index_ser[n] = temp_delay_ser[n];
 1377|  5.32k|}
ps_dec.c:ps_mix_phase:
 1458|  5.32k|{
 1459|  5.32k|    uint8_t n;
 1460|  5.32k|    uint8_t gr;
 1461|  5.32k|    uint8_t bk = 0;
 1462|  5.32k|    uint8_t sb, maxsb;
 1463|  5.32k|    uint8_t env;
 1464|  5.32k|    uint8_t nr_ipdopd_par;
 1465|  5.32k|    complex_t h11, h12, h21, h22;  // COEF
 1466|  5.32k|    complex_t H11, H12, H21, H22;  // COEF
 1467|  5.32k|    complex_t deltaH11, deltaH12, deltaH21, deltaH22;  // COEF
 1468|  5.32k|    complex_t tempLeft, tempRight; // FRAC
 1469|  5.32k|    complex_t phaseLeft, phaseRight; // FRAC
 1470|  5.32k|    real_t L;
 1471|  5.32k|    const real_t *sf_iid;
 1472|  5.32k|    uint8_t no_iid_steps;
 1473|       |
 1474|  5.32k|    if (ps->iid_mode >= 3)
  ------------------
  |  Branch (1474:9): [True: 2.37k, False: 2.94k]
  ------------------
 1475|  2.37k|    {
 1476|  2.37k|        no_iid_steps = 15;
 1477|  2.37k|        sf_iid = sf_iid_fine;
 1478|  2.94k|    } else {
 1479|  2.94k|        no_iid_steps = 7;
 1480|  2.94k|        sf_iid = sf_iid_normal;
 1481|  2.94k|    }
 1482|       |
 1483|  5.32k|    if (ps->ipd_mode == 0 || ps->ipd_mode == 3)
  ------------------
  |  Branch (1483:9): [True: 2.69k, False: 2.62k]
  |  Branch (1483:30): [True: 1.04k, False: 1.58k]
  ------------------
 1484|  3.74k|    {
 1485|  3.74k|        nr_ipdopd_par = 11; /* resolution */
 1486|  3.74k|    } else {
 1487|  1.58k|        nr_ipdopd_par = ps->nr_ipdopd_par;
 1488|  1.58k|    }
 1489|       |
 1490|   184k|    for (gr = 0; gr < ps->num_groups; gr++)
  ------------------
  |  Branch (1490:18): [True: 178k, False: 5.32k]
  ------------------
 1491|   178k|    {
 1492|   178k|        bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
  ------------------
  |  |   41|   178k|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
 1493|       |
 1494|       |        /* use one channel per group in the subqmf domain */
 1495|   178k|        maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr] + 1 : ps->group_border[gr + 1];
  ------------------
  |  Branch (1495:17): [True: 101k, False: 77.0k]
  ------------------
 1496|       |
 1497|   588k|        for (env = 0; env < ps->num_env; env++)
  ------------------
  |  Branch (1497:23): [True: 409k, False: 178k]
  ------------------
 1498|   409k|        {
 1499|   409k|            uint8_t abs_iid = (uint8_t)abs(ps->iid_index[env][bk]);
 1500|       |            /* index range is supposed to be -7...7 or -15...15 depending on iid_mode
 1501|       |                (Table 8.24, ISO/IEC 14496-3:2005).
 1502|       |                if it is outside these boundaries, this is most likely an error. sanitize
 1503|       |                it and try to process further. */
 1504|   409k|            if (ps->iid_index[env][bk] < -no_iid_steps) {
  ------------------
  |  Branch (1504:17): [True: 120, False: 409k]
  ------------------
 1505|    120|                fprintf(stderr, "Warning: invalid iid_index: %d < %d\n", ps->iid_index[env][bk],
 1506|    120|                    -no_iid_steps);
 1507|    120|                ps->iid_index[env][bk] = -no_iid_steps;
 1508|    120|                abs_iid = no_iid_steps;
 1509|   409k|            } else if (ps->iid_index[env][bk] > no_iid_steps) {
  ------------------
  |  Branch (1509:24): [True: 81, False: 409k]
  ------------------
 1510|     81|                fprintf(stderr, "Warning: invalid iid_index: %d > %d\n", ps->iid_index[env][bk],
 1511|     81|                    no_iid_steps);
 1512|     81|                ps->iid_index[env][bk] = no_iid_steps;
 1513|     81|                abs_iid = no_iid_steps;
 1514|     81|            }
 1515|   409k|            if (ps->icc_index[env][bk] < 0) {
  ------------------
  |  Branch (1515:17): [True: 258, False: 409k]
  ------------------
 1516|    258|                fprintf(stderr, "Warning: invalid icc_index: %d < 0\n", ps->icc_index[env][bk]);
 1517|    258|                ps->icc_index[env][bk] = 0;
 1518|   409k|            } else if (ps->icc_index[env][bk] > 7) {
  ------------------
  |  Branch (1518:24): [True: 0, False: 409k]
  ------------------
 1519|      0|                fprintf(stderr, "Warning: invalid icc_index: %d > 7\n", ps->icc_index[env][bk]);
 1520|      0|                ps->icc_index[env][bk] = 7;
 1521|      0|            }
 1522|       |
 1523|   409k|            if (ps->icc_mode < 3)
  ------------------
  |  Branch (1523:17): [True: 291k, False: 118k]
  ------------------
 1524|   291k|            {
 1525|       |                /* type 'A' mixing as described in 8.6.4.6.2.1 */
 1526|   291k|                real_t c_1, c_2;  // COEF
 1527|   291k|                real_t cosa, sina;  // COEF
 1528|   291k|                real_t cosb, sinb;  // COEF
 1529|   291k|                real_t ab1, ab2;  // COEF
 1530|   291k|                real_t ab3, ab4;  // COEF
 1531|       |
 1532|       |                /*
 1533|       |                c_1 = sqrt(2.0 / (1.0 + pow(10.0, quant_iid[no_iid_steps + iid_index] / 10.0)));
 1534|       |                c_2 = sqrt(2.0 / (1.0 + pow(10.0, quant_iid[no_iid_steps - iid_index] / 10.0)));
 1535|       |                alpha = 0.5 * acos(quant_rho[icc_index]);
 1536|       |                beta = alpha * ( c_1 - c_2 ) / sqrt(2.0);
 1537|       |                */
 1538|       |
 1539|       |                //printf("%d\n", ps->iid_index[env][bk]);
 1540|       |
 1541|       |                /* calculate the scalefactors c_1 and c_2 from the intensity differences */
 1542|   291k|                c_1 = sf_iid[no_iid_steps + ps->iid_index[env][bk]];
 1543|   291k|                c_2 = sf_iid[no_iid_steps - ps->iid_index[env][bk]];
 1544|       |
 1545|       |                /* calculate alpha and beta using the ICC parameters */
 1546|   291k|                cosa = cos_alphas[ps->icc_index[env][bk]];
 1547|   291k|                sina = sin_alphas[ps->icc_index[env][bk]];
 1548|       |
 1549|   291k|                if (ps->iid_mode >= 3)
  ------------------
  |  Branch (1549:21): [True: 164k, False: 126k]
  ------------------
 1550|   164k|                {
 1551|   164k|                    cosb = cos_betas_fine[abs_iid][ps->icc_index[env][bk]];
 1552|   164k|                    sinb = sin_betas_fine[abs_iid][ps->icc_index[env][bk]];
 1553|   164k|                } else {
 1554|   126k|                    cosb = cos_betas_normal[abs_iid][ps->icc_index[env][bk]];
 1555|   126k|                    sinb = sin_betas_normal[abs_iid][ps->icc_index[env][bk]];
 1556|   126k|                }
 1557|       |
 1558|   291k|                ab1 = MUL_C(cosb, cosa);
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1559|   291k|                ab2 = MUL_C(sinb, sina);
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1560|   291k|                ab3 = MUL_C(sinb, cosa);
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1561|   291k|                ab4 = MUL_C(cosb, sina);
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1562|       |
 1563|       |                /* h_xy: COEF */
 1564|   291k|                RE(h11) = MUL_C(c_2, (ab1 - ab2));
  ------------------
  |  |  391|   291k|#define RE(A) (A)[0]
  ------------------
                              RE(h11) = MUL_C(c_2, (ab1 - ab2));
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1565|   291k|                RE(h12) = MUL_C(c_1, (ab1 + ab2));
  ------------------
  |  |  391|   291k|#define RE(A) (A)[0]
  ------------------
                              RE(h12) = MUL_C(c_1, (ab1 + ab2));
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1566|   291k|                RE(h21) = MUL_C(c_2, (ab3 + ab4));
  ------------------
  |  |  391|   291k|#define RE(A) (A)[0]
  ------------------
                              RE(h21) = MUL_C(c_2, (ab3 + ab4));
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1567|   291k|                RE(h22) = MUL_C(c_1, (ab3 - ab4));
  ------------------
  |  |  391|   291k|#define RE(A) (A)[0]
  ------------------
                              RE(h22) = MUL_C(c_1, (ab3 - ab4));
  ------------------
  |  |  285|   291k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1568|   291k|            } else {
 1569|       |                /* type 'B' mixing as described in 8.6.4.6.2.2 */
 1570|   118k|                real_t sina, cosa;  // COEF
 1571|   118k|                real_t cosg, sing;  // COEF
 1572|       |
 1573|       |                /*
 1574|       |                real_t c, rho, mu, alpha, gamma;
 1575|       |                uint8_t i;
 1576|       |
 1577|       |                i = ps->iid_index[env][bk];
 1578|       |                c = (real_t)pow(10.0, ((i)?(((i>0)?1:-1)*quant_iid[((i>0)?i:-i)-1]):0.)/20.0);
 1579|       |                rho = quant_rho[ps->icc_index[env][bk]];
 1580|       |
 1581|       |                if (rho == 0.0f && c == 1.)
 1582|       |                {
 1583|       |                    alpha = (real_t)M_PI/4.0f;
 1584|       |                    rho = 0.05f;
 1585|       |                } else {
 1586|       |                    if (rho <= 0.05f)
 1587|       |                    {
 1588|       |                        rho = 0.05f;
 1589|       |                    }
 1590|       |                    alpha = 0.5f*(real_t)atan( (2.0f*c*rho) / (c*c-1.0f) );
 1591|       |
 1592|       |                    if (alpha < 0.)
 1593|       |                    {
 1594|       |                        alpha += (real_t)M_PI/2.0f;
 1595|       |                    }
 1596|       |                    if (rho < 0.)
 1597|       |                    {
 1598|       |                        alpha += (real_t)M_PI;
 1599|       |                    }
 1600|       |                }
 1601|       |                mu = c+1.0f/c;
 1602|       |                mu = 1+(4.0f*rho*rho-4.0f)/(mu*mu);
 1603|       |                gamma = (real_t)atan(sqrt((1.0f-sqrt(mu))/(1.0f+sqrt(mu))));
 1604|       |                */
 1605|       |
 1606|   118k|                if (ps->iid_mode >= 3)
  ------------------
  |  Branch (1606:21): [True: 84.0k, False: 34.3k]
  ------------------
 1607|  84.0k|                {
 1608|  84.0k|                    cosa = sincos_alphas_B_fine[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
 1609|  84.0k|                    sina = sincos_alphas_B_fine[30 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
 1610|  84.0k|                    cosg = cos_gammas_fine[abs_iid][ps->icc_index[env][bk]];
 1611|  84.0k|                    sing = sin_gammas_fine[abs_iid][ps->icc_index[env][bk]];
 1612|  84.0k|                } else {
 1613|  34.3k|                    cosa = sincos_alphas_B_normal[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
 1614|  34.3k|                    sina = sincos_alphas_B_normal[14 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
 1615|  34.3k|                    cosg = cos_gammas_normal[abs_iid][ps->icc_index[env][bk]];
 1616|  34.3k|                    sing = sin_gammas_normal[abs_iid][ps->icc_index[env][bk]];
 1617|  34.3k|                }
 1618|       |
 1619|   118k|                RE(h11) = MUL_C(COEF_SQRT2, MUL_C(cosa, cosg));
  ------------------
  |  |  391|   118k|#define RE(A) (A)[0]
  ------------------
                              RE(h11) = MUL_C(COEF_SQRT2, MUL_C(cosa, cosg));
  ------------------
  |  |  285|   118k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1620|   118k|                RE(h12) = MUL_C(COEF_SQRT2, MUL_C(sina, cosg));
  ------------------
  |  |  391|   118k|#define RE(A) (A)[0]
  ------------------
                              RE(h12) = MUL_C(COEF_SQRT2, MUL_C(sina, cosg));
  ------------------
  |  |  285|   118k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1621|   118k|                RE(h21) = MUL_C(COEF_SQRT2, MUL_C(-cosa, sing));
  ------------------
  |  |  391|   118k|#define RE(A) (A)[0]
  ------------------
                              RE(h21) = MUL_C(COEF_SQRT2, MUL_C(-cosa, sing));
  ------------------
  |  |  285|   118k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1622|   118k|                RE(h22) = MUL_C(COEF_SQRT2, MUL_C(sina, sing));
  ------------------
  |  |  391|   118k|#define RE(A) (A)[0]
  ------------------
                              RE(h22) = MUL_C(COEF_SQRT2, MUL_C(sina, sing));
  ------------------
  |  |  285|   118k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1623|   118k|            }
 1624|   409k|            IM(h11) = IM(h12) = IM(h21) = IM(h22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
                          IM(h11) = IM(h12) = IM(h21) = IM(h22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
                          IM(h11) = IM(h12) = IM(h21) = IM(h22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
                          IM(h11) = IM(h12) = IM(h21) = IM(h22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
 1625|       |
 1626|       |            /* calculate phase rotation parameters H_xy */
 1627|       |            /* note that the imaginary part of these parameters are only calculated when
 1628|       |               IPD and OPD are enabled
 1629|       |             */
 1630|   409k|            if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
  ------------------
  |  Branch (1630:17): [True: 132k, False: 277k]
  |  Branch (1630:40): [True: 60.9k, False: 71.2k]
  ------------------
 1631|  60.9k|            {
 1632|  60.9k|                int8_t i;
 1633|  60.9k|                real_t xy, pq, xypq;  // FRAC
 1634|       |
 1635|       |                /* ringbuffer index */
 1636|  60.9k|                i = ps->phase_hist;
 1637|       |
 1638|       |                /* previous value */
 1639|       |#ifdef FIXED_POINT
 1640|       |                /* divide by 4*2, shift right 3 bits;
 1641|       |                   extra halving to avoid overflows; it is ok, because result is normalized */
 1642|       |                RE(tempLeft)  = RE(ps->ipd_prev[bk][i]) >> 3;
 1643|       |                IM(tempLeft)  = IM(ps->ipd_prev[bk][i]) >> 3;
 1644|       |                RE(tempRight) = RE(ps->opd_prev[bk][i]) >> 3;
 1645|       |                IM(tempRight) = IM(ps->opd_prev[bk][i]) >> 3;
 1646|       |#else
 1647|  60.9k|                RE(tempLeft)  = MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(tempLeft)  = MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1648|  60.9k|                IM(tempLeft)  = MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(tempLeft)  = MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1649|  60.9k|                RE(tempRight) = MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(tempRight) = MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1650|  60.9k|                IM(tempRight) = MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(tempRight) = MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1651|  60.9k|#endif
 1652|       |
 1653|       |                /* save current value */
 1654|  60.9k|                RE(ps->ipd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->ipd_index[env][bk])];
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
 1655|  60.9k|                IM(ps->ipd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->ipd_index[env][bk])];
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1656|  60.9k|                RE(ps->opd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->opd_index[env][bk])];
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
 1657|  60.9k|                IM(ps->opd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->opd_index[env][bk])];
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1658|       |
 1659|       |                /* add current value */
 1660|       |#ifdef FIXED_POINT
 1661|       |                /* extra halving to avoid overflows */
 1662|       |                RE(tempLeft)  += RE(ps->ipd_prev[bk][i]) >> 1;
 1663|       |                IM(tempLeft)  += IM(ps->ipd_prev[bk][i]) >> 1;
 1664|       |                RE(tempRight) += RE(ps->opd_prev[bk][i]) >> 1;
 1665|       |                IM(tempRight) += IM(ps->opd_prev[bk][i]) >> 1;
 1666|       |#else
 1667|  60.9k|                RE(tempLeft)  += RE(ps->ipd_prev[bk][i]);
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(tempLeft)  += RE(ps->ipd_prev[bk][i]);
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
 1668|  60.9k|                IM(tempLeft)  += IM(ps->ipd_prev[bk][i]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(tempLeft)  += IM(ps->ipd_prev[bk][i]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1669|  60.9k|                RE(tempRight) += RE(ps->opd_prev[bk][i]);
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(tempRight) += RE(ps->opd_prev[bk][i]);
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
 1670|  60.9k|                IM(tempRight) += IM(ps->opd_prev[bk][i]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(tempRight) += IM(ps->opd_prev[bk][i]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1671|  60.9k|#endif
 1672|       |
 1673|       |                /* ringbuffer index */
 1674|  60.9k|                if (i == 0)
  ------------------
  |  Branch (1674:21): [True: 30.7k, False: 30.1k]
  ------------------
 1675|  30.7k|                {
 1676|  30.7k|                    i = 2;
 1677|  30.7k|                }
 1678|  60.9k|                i--;
 1679|       |
 1680|       |                /* get value before previous */
 1681|       |#ifdef FIXED_POINT
 1682|       |                /* dividing by 2*2, shift right 2 bits; extra halving to avoid overflows */
 1683|       |                RE(tempLeft)  += (RE(ps->ipd_prev[bk][i]) >> 2);
 1684|       |                IM(tempLeft)  += (IM(ps->ipd_prev[bk][i]) >> 2);
 1685|       |                RE(tempRight) += (RE(ps->opd_prev[bk][i]) >> 2);
 1686|       |                IM(tempRight) += (IM(ps->opd_prev[bk][i]) >> 2);
 1687|       |#else
 1688|  60.9k|                RE(tempLeft)  += MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(tempLeft)  += MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1689|  60.9k|                IM(tempLeft)  += MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(tempLeft)  += MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1690|  60.9k|                RE(tempRight) += MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(tempRight) += MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1691|  60.9k|                IM(tempRight) += MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(tempRight) += MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1692|  60.9k|#endif
 1693|       |
 1694|       |#if 0 /* original code */
 1695|       |                ipd = (float)atan2(IM(tempLeft), RE(tempLeft));
 1696|       |                opd = (float)atan2(IM(tempRight), RE(tempRight));
 1697|       |
 1698|       |                /* phase rotation */
 1699|       |                RE(phaseLeft) = (float)cos(opd);
 1700|       |                IM(phaseLeft) = (float)sin(opd);
 1701|       |                opd -= ipd;
 1702|       |                RE(phaseRight) = (float)cos(opd);
 1703|       |                IM(phaseRight) = (float)sin(opd);
 1704|       |#else
 1705|       |
 1706|       |                // x = IM(tempLeft)
 1707|       |                // y = RE(tempLeft)
 1708|       |                // p = IM(tempRight)
 1709|       |                // q = RE(tempRight)
 1710|       |                // cos(atan2(x,y)) = y/sqrt((x*x) + (y*y))
 1711|       |                // sin(atan2(x,y)) = x/sqrt((x*x) + (y*y))
 1712|       |                // cos(atan2(x,y)-atan2(p,q)) = (y*q + x*p) / ( sqrt((x*x) + (y*y)) * sqrt((p*p) + (q*q)) );
 1713|       |                // sin(atan2(x,y)-atan2(p,q)) = (x*q - y*p) / ( sqrt((x*x) + (y*y)) * sqrt((p*p) + (q*q)) );
 1714|       |
 1715|  60.9k|                xy = magnitude_c(tempRight);
 1716|  60.9k|                pq = magnitude_c(tempLeft);
 1717|       |
 1718|  60.9k|                if (xy != 0)
  ------------------
  |  Branch (1718:21): [True: 60.9k, False: 0]
  ------------------
 1719|  60.9k|                {
 1720|  60.9k|                    RE(phaseLeft) = DIV_F(RE(tempRight), xy);
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                                  RE(phaseLeft) = DIV_F(RE(tempRight), xy);
  ------------------
  |  |  163|  60.9k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1721|  60.9k|                    IM(phaseLeft) = DIV_F(IM(tempRight), xy);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                                  IM(phaseLeft) = DIV_F(IM(tempRight), xy);
  ------------------
  |  |  163|  60.9k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1722|  60.9k|                } else {
 1723|      0|                    RE(phaseLeft) = 0;
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
 1724|      0|                    IM(phaseLeft) = 0;
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
 1725|      0|                }
 1726|       |
 1727|  60.9k|                xypq = MUL_F(xy, pq);
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1728|       |
 1729|  60.9k|                if (xypq != 0)
  ------------------
  |  Branch (1729:21): [True: 60.9k, False: 0]
  ------------------
 1730|  60.9k|                {
 1731|  60.9k|                    real_t tmp1 = MUL_F(RE(tempRight), RE(tempLeft)) + MUL_F(IM(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                                  real_t tmp1 = MUL_F(RE(tempRight), RE(tempLeft)) + MUL_F(IM(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1732|  60.9k|                    real_t tmp2 = MUL_F(IM(tempRight), RE(tempLeft)) - MUL_F(RE(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                                  real_t tmp2 = MUL_F(IM(tempRight), RE(tempLeft)) - MUL_F(RE(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1733|       |
 1734|  60.9k|                    RE(phaseRight) = DIV_F(tmp1, xypq);
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                                  RE(phaseRight) = DIV_F(tmp1, xypq);
  ------------------
  |  |  163|  60.9k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1735|  60.9k|                    IM(phaseRight) = DIV_F(tmp2, xypq);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                                  IM(phaseRight) = DIV_F(tmp2, xypq);
  ------------------
  |  |  163|  60.9k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1736|  60.9k|                } else {
 1737|      0|                    RE(phaseRight) = 0;
  ------------------
  |  |  391|      0|#define RE(A) (A)[0]
  ------------------
 1738|      0|                    IM(phaseRight) = 0;
  ------------------
  |  |  392|      0|#define IM(A) (A)[1]
  ------------------
 1739|      0|                }
 1740|       |
 1741|  60.9k|#endif
 1742|       |
 1743|       |                /* MUL_F(COEF, REAL) = COEF */
 1744|  60.9k|                IM(h11) = MUL_F(RE(h11), IM(phaseLeft));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(h11) = MUL_F(RE(h11), IM(phaseLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1745|  60.9k|                IM(h12) = MUL_F(RE(h12), IM(phaseRight));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(h12) = MUL_F(RE(h12), IM(phaseRight));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1746|  60.9k|                IM(h21) = MUL_F(RE(h21), IM(phaseLeft));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(h21) = MUL_F(RE(h21), IM(phaseLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1747|  60.9k|                IM(h22) = MUL_F(RE(h22), IM(phaseRight));
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(h22) = MUL_F(RE(h22), IM(phaseRight));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1748|       |
 1749|  60.9k|                RE(h11) = MUL_F(RE(h11), RE(phaseLeft));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(h11) = MUL_F(RE(h11), RE(phaseLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1750|  60.9k|                RE(h12) = MUL_F(RE(h12), RE(phaseRight));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(h12) = MUL_F(RE(h12), RE(phaseRight));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1751|  60.9k|                RE(h21) = MUL_F(RE(h21), RE(phaseLeft));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(h21) = MUL_F(RE(h21), RE(phaseLeft));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1752|  60.9k|                RE(h22) = MUL_F(RE(h22), RE(phaseRight));
  ------------------
  |  |  391|  60.9k|#define RE(A) (A)[0]
  ------------------
                              RE(h22) = MUL_F(RE(h22), RE(phaseRight));
  ------------------
  |  |  286|  60.9k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1753|  60.9k|            }
 1754|       |
 1755|       |            /* length of the envelope n_e+1 - n_e (in time samples) */
 1756|       |            /* 0 < L <= 32: integer */
 1757|   409k|            L = (real_t)(ps->border_position[env + 1] - ps->border_position[env]);
 1758|       |
 1759|       |            /* obtain final H_xy by means of linear interpolation */
 1760|   409k|            RE(deltaH11) = (RE(h11) - RE(ps->h11_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH11) = (RE(h11) - RE(ps->h11_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH11) = (RE(h11) - RE(ps->h11_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1761|   409k|            RE(deltaH12) = (RE(h12) - RE(ps->h12_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH12) = (RE(h12) - RE(ps->h12_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH12) = (RE(h12) - RE(ps->h12_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1762|   409k|            RE(deltaH21) = (RE(h21) - RE(ps->h21_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH21) = (RE(h21) - RE(ps->h21_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH21) = (RE(h21) - RE(ps->h21_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1763|   409k|            RE(deltaH22) = (RE(h22) - RE(ps->h22_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH22) = (RE(h22) - RE(ps->h22_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(deltaH22) = (RE(h22) - RE(ps->h22_prev[gr])) / L;
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1764|       |
 1765|   409k|            RE(H11) = RE(ps->h11_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(H11) = RE(ps->h11_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1766|   409k|            RE(H12) = RE(ps->h12_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(H12) = RE(ps->h12_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1767|   409k|            RE(H21) = RE(ps->h21_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(H21) = RE(ps->h21_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1768|   409k|            RE(H22) = RE(ps->h22_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(H22) = RE(ps->h22_prev[gr]);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1769|   409k|            IM(H11) = IM(H12) = IM(H21) = IM(H22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
                          IM(H11) = IM(H12) = IM(H21) = IM(H22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
                          IM(H11) = IM(H12) = IM(H21) = IM(H22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
                          IM(H11) = IM(H12) = IM(H21) = IM(H22) = 0;
  ------------------
  |  |  392|   409k|#define IM(A) (A)[1]
  ------------------
 1770|       |
 1771|   409k|            RE(ps->h11_prev[gr]) = RE(h11);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->h11_prev[gr]) = RE(h11);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1772|   409k|            RE(ps->h12_prev[gr]) = RE(h12);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->h12_prev[gr]) = RE(h12);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1773|   409k|            RE(ps->h21_prev[gr]) = RE(h21);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->h21_prev[gr]) = RE(h21);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1774|   409k|            RE(ps->h22_prev[gr]) = RE(h22);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->h22_prev[gr]) = RE(h22);
  ------------------
  |  |  391|   409k|#define RE(A) (A)[0]
  ------------------
 1775|       |
 1776|       |            /* only calculate imaginary part when needed */
 1777|   409k|            if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
  ------------------
  |  Branch (1777:17): [True: 132k, False: 277k]
  |  Branch (1777:40): [True: 60.9k, False: 71.2k]
  ------------------
 1778|  60.9k|            {
 1779|       |                /* obtain final H_xy by means of linear interpolation */
 1780|  60.9k|                IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1781|  60.9k|                IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1782|  60.9k|                IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1783|  60.9k|                IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1784|       |
 1785|  60.9k|                IM(H11) = IM(ps->h11_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(H11) = IM(ps->h11_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1786|  60.9k|                IM(H12) = IM(ps->h12_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(H12) = IM(ps->h12_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1787|  60.9k|                IM(H21) = IM(ps->h21_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(H21) = IM(ps->h21_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1788|  60.9k|                IM(H22) = IM(ps->h22_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(H22) = IM(ps->h22_prev[gr]);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1789|       |
 1790|  60.9k|                if ((NEGATE_IPD_MASK & ps->map_group2bk[gr]) != 0)
  ------------------
  |  |   41|  60.9k|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
  |  Branch (1790:21): [True: 8.53k, False: 52.3k]
  ------------------
 1791|  8.53k|                {
 1792|  8.53k|                    IM(deltaH11) = -IM(deltaH11);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH11) = -IM(deltaH11);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1793|  8.53k|                    IM(deltaH12) = -IM(deltaH12);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH12) = -IM(deltaH12);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1794|  8.53k|                    IM(deltaH21) = -IM(deltaH21);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH21) = -IM(deltaH21);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1795|  8.53k|                    IM(deltaH22) = -IM(deltaH22);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH22) = -IM(deltaH22);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1796|       |
 1797|  8.53k|                    IM(H11) = -IM(H11);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(H11) = -IM(H11);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1798|  8.53k|                    IM(H12) = -IM(H12);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(H12) = -IM(H12);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1799|  8.53k|                    IM(H21) = -IM(H21);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(H21) = -IM(H21);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1800|  8.53k|                    IM(H22) = -IM(H22);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
                                  IM(H22) = -IM(H22);
  ------------------
  |  |  392|  8.53k|#define IM(A) (A)[1]
  ------------------
 1801|  8.53k|                }
 1802|       |
 1803|  60.9k|                IM(ps->h11_prev[gr]) = IM(h11);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h11_prev[gr]) = IM(h11);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1804|  60.9k|                IM(ps->h12_prev[gr]) = IM(h12);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h12_prev[gr]) = IM(h12);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1805|  60.9k|                IM(ps->h21_prev[gr]) = IM(h21);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h21_prev[gr]) = IM(h21);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1806|  60.9k|                IM(ps->h22_prev[gr]) = IM(h22);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h22_prev[gr]) = IM(h22);
  ------------------
  |  |  392|  60.9k|#define IM(A) (A)[1]
  ------------------
 1807|  60.9k|            }
 1808|       |
 1809|       |            /* apply H_xy to the current envelope band of the decorrelated subband */
 1810|  5.92M|            for (n = ps->border_position[env]; n < ps->border_position[env + 1]; n++)
  ------------------
  |  Branch (1810:48): [True: 5.51M, False: 409k]
  ------------------
 1811|  5.51M|            {
 1812|       |                /* addition finalises the interpolation over every n */
 1813|  5.51M|                RE(H11) += RE(deltaH11);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
                              RE(H11) += RE(deltaH11);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
 1814|  5.51M|                RE(H12) += RE(deltaH12);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
                              RE(H12) += RE(deltaH12);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
 1815|  5.51M|                RE(H21) += RE(deltaH21);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
                              RE(H21) += RE(deltaH21);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
 1816|  5.51M|                RE(H22) += RE(deltaH22);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
                              RE(H22) += RE(deltaH22);
  ------------------
  |  |  391|  5.51M|#define RE(A) (A)[0]
  ------------------
 1817|  5.51M|                if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
  ------------------
  |  Branch (1817:21): [True: 1.34M, False: 4.16M]
  |  Branch (1817:44): [True: 640k, False: 708k]
  ------------------
 1818|   640k|                {
 1819|   640k|                    IM(H11) += IM(deltaH11);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
                                  IM(H11) += IM(deltaH11);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
 1820|   640k|                    IM(H12) += IM(deltaH12);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
                                  IM(H12) += IM(deltaH12);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
 1821|   640k|                    IM(H21) += IM(deltaH21);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
                                  IM(H21) += IM(deltaH21);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
 1822|   640k|                    IM(H22) += IM(deltaH22);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
                                  IM(H22) += IM(deltaH22);
  ------------------
  |  |  392|   640k|#define IM(A) (A)[1]
  ------------------
 1823|   640k|                }
 1824|       |
 1825|       |                /* channel is an alias to the subband */
 1826|  18.5M|                for (sb = ps->group_border[gr]; sb < maxsb; sb++)
  ------------------
  |  Branch (1826:49): [True: 13.0M, False: 5.51M]
  ------------------
 1827|  13.0M|                {
 1828|  13.0M|                    complex_t inLeft, inRight;  // precision_of in(Left|Right) == precision_of X_(left|right)
 1829|       |
 1830|       |                    /* load decorrelated samples */
 1831|  13.0M|                    if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1831:25): [True: 3.12M, False: 9.95M]
  ------------------
 1832|  3.12M|                    {
 1833|  3.12M|                        RE(inLeft) =  RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(inLeft) =  RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1834|  3.12M|                        IM(inLeft) =  IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(inLeft) =  IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1835|  3.12M|                        RE(inRight) = RE(X_hybrid_right[n][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(inRight) = RE(X_hybrid_right[n][sb]);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1836|  3.12M|                        IM(inRight) = IM(X_hybrid_right[n][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(inRight) = IM(X_hybrid_right[n][sb]);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1837|  9.95M|                    } else {
 1838|  9.95M|                        RE(inLeft) =  RE(X_left[n][sb]);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
                                      RE(inLeft) =  RE(X_left[n][sb]);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
 1839|  9.95M|                        IM(inLeft) =  IM(X_left[n][sb]);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
                                      IM(inLeft) =  IM(X_left[n][sb]);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
 1840|  9.95M|                        RE(inRight) = RE(X_right[n][sb]);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
                                      RE(inRight) = RE(X_right[n][sb]);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
 1841|  9.95M|                        IM(inRight) = IM(X_right[n][sb]);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
                                      IM(inRight) = IM(X_right[n][sb]);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
 1842|  9.95M|                    }
 1843|       |
 1844|       |                    /* precision_of temp(Left|Right) == precision_of X_(left|right) */
 1845|       |
 1846|       |                    /* apply mixing */
 1847|  13.0M|                    RE(tempLeft) =  MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
  ------------------
  |  |  391|  13.0M|#define RE(A) (A)[0]
  ------------------
                                  RE(tempLeft) =  MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  RE(tempLeft) =  MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1848|  13.0M|                    IM(tempLeft) =  MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
  ------------------
  |  |  392|  13.0M|#define IM(A) (A)[1]
  ------------------
                                  IM(tempLeft) =  MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  IM(tempLeft) =  MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1849|  13.0M|                    RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
  ------------------
  |  |  391|  13.0M|#define RE(A) (A)[0]
  ------------------
                                  RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1850|  13.0M|                    IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
  ------------------
  |  |  392|  13.0M|#define IM(A) (A)[1]
  ------------------
                                  IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
  ------------------
  |  |  285|  13.0M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1851|       |
 1852|       |                    /* only perform imaginary operations when needed */
 1853|  13.0M|                    if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
  ------------------
  |  Branch (1853:25): [True: 3.17M, False: 9.90M]
  |  Branch (1853:48): [True: 642k, False: 2.53M]
  ------------------
 1854|   642k|                    {
 1855|       |                        /* apply rotation */
 1856|   642k|                        RE(tempLeft)  -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
  ------------------
  |  |  391|   642k|#define RE(A) (A)[0]
  ------------------
                                      RE(tempLeft)  -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      RE(tempLeft)  -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1857|   642k|                        IM(tempLeft)  += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
  ------------------
  |  |  392|   642k|#define IM(A) (A)[1]
  ------------------
                                      IM(tempLeft)  += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      IM(tempLeft)  += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1858|   642k|                        RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
  ------------------
  |  |  391|   642k|#define RE(A) (A)[0]
  ------------------
                                      RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1859|   642k|                        IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
  ------------------
  |  |  392|   642k|#define IM(A) (A)[1]
  ------------------
                                      IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
  ------------------
  |  |  285|   642k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1860|   642k|                    }
 1861|       |
 1862|       |                    /* store final samples */
 1863|  13.0M|                    if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1863:25): [True: 3.12M, False: 9.95M]
  ------------------
 1864|  3.12M|                    {
 1865|  3.12M|                        RE(X_hybrid_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_hybrid_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1866|  3.12M|                        IM(X_hybrid_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_hybrid_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1867|  3.12M|                        RE(X_hybrid_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_hybrid_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  3.12M|#define RE(A) (A)[0]
  ------------------
 1868|  3.12M|                        IM(X_hybrid_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_hybrid_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  3.12M|#define IM(A) (A)[1]
  ------------------
 1869|  9.95M|                    } else {
 1870|  9.95M|                        RE(X_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
 1871|  9.95M|                        IM(X_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
 1872|  9.95M|                        RE(X_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  9.95M|#define RE(A) (A)[0]
  ------------------
 1873|  9.95M|                        IM(X_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  9.95M|#define IM(A) (A)[1]
  ------------------
 1874|  9.95M|                    }
 1875|  13.0M|                }
 1876|  5.51M|            }
 1877|       |
 1878|       |            /* shift phase smoother's circular buffer index */
 1879|   409k|            ps->phase_hist++;
 1880|   409k|            if (ps->phase_hist == 2)
  ------------------
  |  Branch (1880:17): [True: 204k, False: 204k]
  ------------------
 1881|   204k|            {
 1882|   204k|                ps->phase_hist = 0;
 1883|   204k|            }
 1884|   409k|        }
 1885|   178k|    }
 1886|  5.32k|}
ps_dec.c:magnitude_c:
 1437|   121k|{
 1438|       |#ifdef FIXED_POINT
 1439|       |#define ps_abs(A) (((A) > 0) ? (A) : (-(A)))
 1440|       |#define ALPHA FRAC_CONST(0.948059448969)
 1441|       |#define BETA  FRAC_CONST(0.392699081699)
 1442|       |
 1443|       |    real_t abs_inphase = ps_abs(RE(c));
 1444|       |    real_t abs_quadrature = ps_abs(IM(c));
 1445|       |
 1446|       |    if (abs_inphase > abs_quadrature) {
 1447|       |        return MUL_F(abs_inphase, ALPHA) + MUL_F(abs_quadrature, BETA);
 1448|       |    } else {
 1449|       |        return MUL_F(abs_quadrature, ALPHA) + MUL_F(abs_inphase, BETA);
 1450|       |    }
 1451|       |#else
 1452|   121k|    return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  391|   121k|#define RE(A) (A)[0]
  ------------------
                  return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  391|   121k|#define RE(A) (A)[0]
  ------------------
                  return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  392|   121k|#define IM(A) (A)[1]
  ------------------
                  return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  392|   121k|#define IM(A) (A)[1]
  ------------------
 1453|   121k|#endif
 1454|   121k|}
ps_dec.c:hybrid_synthesis:
  588|  10.6k|{
  589|  10.6k|    uint8_t k, n, band;
  590|  10.6k|    uint8_t offset = 0;
  591|  10.6k|    uint8_t qmf_bands = (use34) ? 5 : 3;
  ------------------
  |  Branch (591:25): [True: 4.40k, False: 6.23k]
  ------------------
  592|  10.6k|    uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
  ------------------
  |  Branch (592:27): [True: 4.40k, False: 6.23k]
  ------------------
  593|  10.6k|    (void)numTimeSlotsRate;  /* TODO: remove parameter? */
  594|       |
  595|  51.3k|    for(band = 0; band < qmf_bands; band++)
  ------------------
  |  Branch (595:19): [True: 40.7k, False: 10.6k]
  ------------------
  596|  40.7k|    {
  597|  1.29M|        for (n = 0; n < hyb->frame_len; n++)
  ------------------
  |  Branch (597:21): [True: 1.25M, False: 40.7k]
  ------------------
  598|  1.25M|        {
  599|  1.25M|            QMF_RE(X[n][band]) = 0;
  ------------------
  |  |  168|  1.25M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.25M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  600|  1.25M|            QMF_IM(X[n][band]) = 0;
  ------------------
  |  |  169|  1.25M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.25M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  601|       |
  602|  7.87M|            for (k = 0; k < resolution[band]; k++)
  ------------------
  |  Branch (602:25): [True: 6.62M, False: 1.25M]
  ------------------
  603|  6.62M|            {
  604|  6.62M|                QMF_RE(X[n][band]) += QMF_RE(X_hybrid[n][offset + k]);
  ------------------
  |  |  168|  6.62M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  6.62M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[n][band]) += QMF_RE(X_hybrid[n][offset + k]);
  ------------------
  |  |  168|  6.62M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  6.62M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  605|  6.62M|                QMF_IM(X[n][band]) += QMF_IM(X_hybrid[n][offset + k]);
  ------------------
  |  |  169|  6.62M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  6.62M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[n][band]) += QMF_IM(X_hybrid[n][offset + k]);
  ------------------
  |  |  169|  6.62M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  6.62M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  606|  6.62M|            }
  607|  1.25M|        }
  608|  40.7k|        offset += resolution[band];
  609|  40.7k|    }
  610|  10.6k|}

ps_data:
  329|  30.4k|{
  330|  30.4k|    uint8_t tmp, n;
  331|  30.4k|    uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
  332|       |
  333|  30.4k|    *header = 0;
  334|       |
  335|       |    /* check for new PS header */
  336|  30.4k|    if (faad_get1bit(ld
  ------------------
  |  Branch (336:9): [True: 12.5k, False: 17.9k]
  ------------------
  337|  30.4k|        DEBUGVAR(1,1000,"ps_data(): enable_ps_header")))
  338|  12.5k|    {
  339|  12.5k|        *header = 1;
  340|       |
  341|  12.5k|        ps->header_read = 1;
  342|       |
  343|  12.5k|        ps->use34hybrid_bands = 0;
  344|       |
  345|       |        /* Inter-channel Intensity Difference (IID) parameters enabled */
  346|  12.5k|        ps->enable_iid = (uint8_t)faad_get1bit(ld
  347|  12.5k|            DEBUGVAR(1,1001,"ps_data(): enable_iid"));
  348|       |
  349|  12.5k|        if (ps->enable_iid)
  ------------------
  |  Branch (349:13): [True: 7.28k, False: 5.28k]
  ------------------
  350|  7.28k|        {
  351|  7.28k|            ps->iid_mode = (uint8_t)faad_getbits(ld, 3
  352|  7.28k|                DEBUGVAR(1,1002,"ps_data(): iid_mode"));
  353|       |
  354|  7.28k|            ps->nr_iid_par = nr_iid_par_tab[ps->iid_mode];
  355|  7.28k|            ps->nr_ipdopd_par = nr_ipdopd_par_tab[ps->iid_mode];
  356|       |
  357|  7.28k|            if (ps->iid_mode == 2 || ps->iid_mode == 5)
  ------------------
  |  Branch (357:17): [True: 641, False: 6.64k]
  |  Branch (357:38): [True: 975, False: 5.66k]
  ------------------
  358|  1.61k|                ps->use34hybrid_bands = 1;
  359|       |
  360|       |            /* IPD freq res equal to IID freq res */
  361|  7.28k|            ps->ipd_mode = ps->iid_mode;
  362|  7.28k|        }
  363|       |
  364|       |        /* Inter-channel Coherence (ICC) parameters enabled */
  365|  12.5k|        ps->enable_icc = (uint8_t)faad_get1bit(ld
  366|  12.5k|            DEBUGVAR(1,1003,"ps_data(): enable_icc"));
  367|       |
  368|  12.5k|        if (ps->enable_icc)
  ------------------
  |  Branch (368:13): [True: 6.30k, False: 6.26k]
  ------------------
  369|  6.30k|        {
  370|  6.30k|            ps->icc_mode = (uint8_t)faad_getbits(ld, 3
  371|  6.30k|                DEBUGVAR(1,1004,"ps_data(): icc_mode"));
  372|       |
  373|  6.30k|            ps->nr_icc_par = nr_icc_par_tab[ps->icc_mode];
  374|       |
  375|  6.30k|            if (ps->icc_mode == 2 || ps->icc_mode == 5)
  ------------------
  |  Branch (375:17): [True: 1.42k, False: 4.88k]
  |  Branch (375:38): [True: 1.04k, False: 3.83k]
  ------------------
  376|  2.46k|                ps->use34hybrid_bands = 1;
  377|  6.30k|        }
  378|       |
  379|       |        /* PS extension layer enabled */
  380|  12.5k|        ps->enable_ext = (uint8_t)faad_get1bit(ld
  381|  12.5k|            DEBUGVAR(1,1005,"ps_data(): enable_ext"));
  382|  12.5k|    }
  383|       |
  384|       |    /* we are here, but no header has been read yet */
  385|  30.4k|    if (ps->header_read == 0)
  ------------------
  |  Branch (385:9): [True: 8.83k, False: 21.6k]
  ------------------
  386|  8.83k|    {
  387|  8.83k|        ps->ps_data_available = 0;
  388|  8.83k|        return 1;
  389|  8.83k|    }
  390|       |
  391|  21.6k|    ps->frame_class = (uint8_t)faad_get1bit(ld
  392|  21.6k|        DEBUGVAR(1,1006,"ps_data(): frame_class"));
  393|  21.6k|    tmp = (uint8_t)faad_getbits(ld, 2
  394|  21.6k|        DEBUGVAR(1,1007,"ps_data(): num_env_idx"));
  395|       |
  396|  21.6k|    ps->num_env = num_env_tab[ps->frame_class][tmp];
  397|       |
  398|  21.6k|    if (ps->frame_class)
  ------------------
  |  Branch (398:9): [True: 7.38k, False: 14.2k]
  ------------------
  399|  7.38k|    {
  400|  25.7k|        for (n = 1; n < ps->num_env+1; n++)
  ------------------
  |  Branch (400:21): [True: 18.3k, False: 7.38k]
  ------------------
  401|  18.3k|        {
  402|  18.3k|            ps->border_position[n] = (uint8_t)faad_getbits(ld, 5
  403|  18.3k|                DEBUGVAR(1,1008,"ps_data(): border_position")) + 1;
  404|  18.3k|        }
  405|  7.38k|    }
  406|       |
  407|  21.6k|    if (ps->enable_iid)
  ------------------
  |  Branch (407:9): [True: 11.2k, False: 10.4k]
  ------------------
  408|  11.2k|    {
  409|  30.2k|        for (n = 0; n < ps->num_env; n++)
  ------------------
  |  Branch (409:21): [True: 19.0k, False: 11.2k]
  ------------------
  410|  19.0k|        {
  411|  19.0k|            ps->iid_dt[n] = (uint8_t)faad_get1bit(ld
  412|  19.0k|                DEBUGVAR(1,1009,"ps_data(): iid_dt"));
  413|       |
  414|       |            /* iid_data */
  415|  19.0k|            if (ps->iid_mode < 3)
  ------------------
  |  Branch (415:17): [True: 3.18k, False: 15.8k]
  ------------------
  416|  3.18k|            {
  417|  3.18k|                huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_def,
  418|  3.18k|                    f_huff_iid_def, ps->iid_index[n]);
  419|  15.8k|            } else {
  420|  15.8k|                huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_fine,
  421|  15.8k|                    f_huff_iid_fine, ps->iid_index[n]);
  422|  15.8k|            }
  423|  19.0k|        }
  424|  11.2k|    }
  425|       |
  426|  21.6k|    if (ps->enable_icc)
  ------------------
  |  Branch (426:9): [True: 11.7k, False: 9.89k]
  ------------------
  427|  11.7k|    {
  428|  33.8k|        for (n = 0; n < ps->num_env; n++)
  ------------------
  |  Branch (428:21): [True: 22.1k, False: 11.7k]
  ------------------
  429|  22.1k|        {
  430|  22.1k|            ps->icc_dt[n] = (uint8_t)faad_get1bit(ld
  431|  22.1k|                DEBUGVAR(1,1010,"ps_data(): icc_dt"));
  432|       |
  433|       |            /* icc_data */
  434|  22.1k|            huff_data(ld, ps->icc_dt[n], ps->nr_icc_par, t_huff_icc,
  435|  22.1k|                f_huff_icc, ps->icc_index[n]);
  436|  22.1k|        }
  437|  11.7k|    }
  438|       |
  439|  21.6k|    if (ps->enable_ext)
  ------------------
  |  Branch (439:9): [True: 8.68k, False: 12.9k]
  ------------------
  440|  8.68k|    {
  441|  8.68k|        uint16_t num_bits_left;
  442|  8.68k|        uint16_t cnt = (uint16_t)faad_getbits(ld, 4
  443|  8.68k|            DEBUGVAR(1,1011,"ps_data(): ps_extension_size"));
  444|  8.68k|        if (cnt == 15)
  ------------------
  |  Branch (444:13): [True: 885, False: 7.80k]
  ------------------
  445|    885|        {
  446|    885|            cnt += (uint16_t)faad_getbits(ld, 8
  447|    885|                DEBUGVAR(1,1012,"ps_data(): esc_count"));
  448|    885|        }
  449|       |
  450|  8.68k|        num_bits_left = 8 * cnt;
  451|   360k|        while (num_bits_left > 7)
  ------------------
  |  Branch (451:16): [True: 351k, False: 8.68k]
  ------------------
  452|   351k|        {
  453|   351k|            uint16_t bits_read;
  454|   351k|            uint8_t ps_extension_id = (uint8_t)faad_getbits(ld, 2
  455|   351k|                DEBUGVAR(1,1013,"ps_data(): ps_extension_size"));
  456|       |
  457|   351k|            num_bits_left -= 2;
  458|   351k|            bits_read = ps_extension(ps, ld, ps_extension_id, num_bits_left);
  459|       |
  460|       |            /* ps_extension() decodes a variable amount of Huffman data and does
  461|       |               not stop at the advertised ps_extension_size, so it can read more
  462|       |               than num_bits_left. Clamp instead of letting the uint16_t wrap. */
  463|   351k|            if (bits_read > num_bits_left)
  ------------------
  |  Branch (463:17): [True: 1.16k, False: 350k]
  ------------------
  464|  1.16k|                num_bits_left = 0;
  465|   350k|            else
  466|   350k|                num_bits_left -= bits_read;
  467|   351k|        }
  468|       |
  469|  8.68k|        faad_getbits(ld, num_bits_left
  470|  8.68k|            DEBUGVAR(1,1014,"ps_data(): fill_bits"));
  471|  8.68k|    }
  472|       |
  473|  21.6k|    bits = (uint16_t)faad_get_processed_bits(ld) - bits;
  474|       |
  475|  21.6k|    ps->ps_data_available = 1;
  476|       |
  477|  21.6k|    return bits;
  478|  30.4k|}
ps_syntax.c:ps_extension:
  483|   351k|{
  484|   351k|    uint8_t n;
  485|   351k|    uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
  486|   351k|    (void)num_bits_left;  /* TODO: remove parameter, or actually use it. */
  487|       |
  488|   351k|    if (ps_extension_id == 0)
  ------------------
  |  Branch (488:9): [True: 171k, False: 180k]
  ------------------
  489|   171k|    {
  490|   171k|        ps->enable_ipdopd = (uint8_t)faad_get1bit(ld
  491|   171k|            DEBUGVAR(1,1015,"ps_extension(): enable_ipdopd"));
  492|       |
  493|   171k|        if (ps->enable_ipdopd)
  ------------------
  |  Branch (493:13): [True: 16.4k, False: 154k]
  ------------------
  494|  16.4k|        {
  495|  51.3k|            for (n = 0; n < ps->num_env; n++)
  ------------------
  |  Branch (495:25): [True: 34.9k, False: 16.4k]
  ------------------
  496|  34.9k|            {
  497|  34.9k|                ps->ipd_dt[n] = (uint8_t)faad_get1bit(ld
  498|  34.9k|                    DEBUGVAR(1,1016,"ps_extension(): ipd_dt"));
  499|       |
  500|       |                /* ipd_data */
  501|  34.9k|                huff_data(ld, ps->ipd_dt[n], ps->nr_ipdopd_par, t_huff_ipd,
  502|  34.9k|                    f_huff_ipd, ps->ipd_index[n]);
  503|       |
  504|  34.9k|                ps->opd_dt[n] = (uint8_t)faad_get1bit(ld
  505|  34.9k|                    DEBUGVAR(1,1017,"ps_extension(): opd_dt"));
  506|       |
  507|       |                /* opd_data */
  508|  34.9k|                huff_data(ld, ps->opd_dt[n], ps->nr_ipdopd_par, t_huff_opd,
  509|  34.9k|                    f_huff_opd, ps->opd_index[n]);
  510|  34.9k|            }
  511|  16.4k|        }
  512|   171k|        faad_get1bit(ld
  513|   171k|            DEBUGVAR(1,1018,"ps_extension(): reserved_ps"));
  514|   171k|    }
  515|       |
  516|       |    /* return number of bits read */
  517|   351k|    bits = (uint16_t)faad_get_processed_bits(ld) - bits;
  518|       |
  519|   351k|    return bits;
  520|   351k|}
ps_syntax.c:huff_data:
  525|   110k|{
  526|   110k|    uint8_t n;
  527|       |
  528|   110k|    if (dt)
  ------------------
  |  Branch (528:9): [True: 53.6k, False: 57.3k]
  ------------------
  529|  53.6k|    {
  530|       |        /* coded in time direction */
  531|   261k|        for (n = 0; n < nr_par; n++)
  ------------------
  |  Branch (531:21): [True: 208k, False: 53.6k]
  ------------------
  532|   208k|        {
  533|   208k|            par[n] = ps_huff_dec(ld, t_huff);
  534|   208k|        }
  535|  57.3k|    } else {
  536|       |        /* coded in frequency direction */
  537|  57.3k|        par[0] = ps_huff_dec(ld, f_huff);
  538|       |
  539|   420k|        for (n = 1; n < nr_par; n++)
  ------------------
  |  Branch (539:21): [True: 363k, False: 57.3k]
  ------------------
  540|   363k|        {
  541|   363k|            par[n] = ps_huff_dec(ld, f_huff);
  542|   363k|        }
  543|  57.3k|    }
  544|   110k|}
ps_syntax.c:ps_huff_dec:
  548|   628k|{
  549|   628k|    uint8_t bit;
  550|   628k|    int8_t index = 0;
  551|       |
  552|  1.95M|    while (index >= 0)
  ------------------
  |  Branch (552:12): [True: 1.32M, False: 628k]
  ------------------
  553|  1.32M|    {
  554|  1.32M|        bit = (uint8_t)faad_get1bit(ld);
  555|  1.32M|        index = t_huff[index][bit];
  556|  1.32M|    }
  557|       |
  558|   628k|    return index + 31;
  559|   628k|}

pulse_decode:
   37|  5.73k|{
   38|  5.73k|    uint8_t i;
   39|  5.73k|    uint16_t k;
   40|  5.73k|    pulse_info *pul = &(ics->pul);
   41|       |
   42|  5.73k|    k = min(ics->swb_offset[pul->pulse_start_sfb], ics->swb_offset_max);
  ------------------
  |  |   60|  5.73k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 5.73k, False: 7]
  |  |  ------------------
  ------------------
   43|       |
   44|  14.0k|    for (i = 0; i <= pul->number_pulse; i++)
  ------------------
  |  Branch (44:17): [True: 8.31k, False: 5.73k]
  ------------------
   45|  8.31k|    {
   46|  8.31k|        k += pul->pulse_offset[i];
   47|       |
   48|  8.31k|        if (k >= framelen)
  ------------------
  |  Branch (48:13): [True: 7, False: 8.30k]
  ------------------
   49|      7|            return 15; /* should not be possible */
   50|       |
   51|  8.30k|        if (spec_data[k] > 0)
  ------------------
  |  Branch (51:13): [True: 234, False: 8.07k]
  ------------------
   52|    234|            spec_data[k] += pul->pulse_amp[i];
   53|  8.07k|        else
   54|  8.07k|            spec_data[k] -= pul->pulse_amp[i];
   55|  8.30k|    }
   56|       |
   57|  5.73k|    return 0;
   58|  5.73k|}

rvlc_scale_factor_data:
   75|  5.75k|{
   76|  5.75k|    uint8_t bits = 9;
   77|       |
   78|  5.75k|    ics->sf_concealment = faad_get1bit(ld
   79|  5.75k|        DEBUGVAR(1,149,"rvlc_scale_factor_data(): sf_concealment"));
   80|  5.75k|    ics->rev_global_gain = (uint8_t)faad_getbits(ld, 8
   81|  5.75k|        DEBUGVAR(1,150,"rvlc_scale_factor_data(): rev_global_gain"));
   82|       |
   83|  5.75k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  5.75k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (83:9): [True: 330, False: 5.42k]
  ------------------
   84|    330|        bits = 11;
   85|       |
   86|       |    /* the number of bits used for the huffman codewords */
   87|  5.75k|    ics->length_of_rvlc_sf = (uint16_t)faad_getbits(ld, bits
   88|  5.75k|        DEBUGVAR(1,151,"rvlc_scale_factor_data(): length_of_rvlc_sf"));
   89|       |
   90|  5.75k|    if (ics->noise_used)
  ------------------
  |  Branch (90:9): [True: 0, False: 5.75k]
  ------------------
   91|      0|    {
   92|      0|        ics->dpcm_noise_nrg = (uint16_t)faad_getbits(ld, 9
   93|      0|            DEBUGVAR(1,152,"rvlc_scale_factor_data(): dpcm_noise_nrg"));
   94|       |
   95|       |        /* the 9 bits of dpcm_noise_nrg are counted in length_of_rvlc_sf, so a
   96|       |           conformant value is at least 9; reject a smaller one before the
   97|       |           unsigned subtraction wraps length_of_rvlc_sf to a huge value */
   98|      0|        if (ics->length_of_rvlc_sf < 9)
  ------------------
  |  Branch (98:13): [True: 0, False: 0]
  ------------------
   99|      0|            return 8;
  100|       |
  101|      0|        ics->length_of_rvlc_sf -= 9;
  102|      0|    }
  103|       |
  104|  5.75k|    ics->sf_escapes_present = faad_get1bit(ld
  105|  5.75k|        DEBUGVAR(1,153,"rvlc_scale_factor_data(): sf_escapes_present"));
  106|       |
  107|  5.75k|    if (ics->sf_escapes_present)
  ------------------
  |  Branch (107:9): [True: 875, False: 4.88k]
  ------------------
  108|    875|    {
  109|    875|        ics->length_of_rvlc_escapes = (uint8_t)faad_getbits(ld, 8
  110|    875|            DEBUGVAR(1,154,"rvlc_scale_factor_data(): length_of_rvlc_escapes"));
  111|    875|    }
  112|       |
  113|  5.75k|    if (ics->noise_used)
  ------------------
  |  Branch (113:9): [True: 0, False: 5.75k]
  ------------------
  114|      0|    {
  115|      0|        ics->dpcm_noise_last_position = (uint16_t)faad_getbits(ld, 9
  116|      0|            DEBUGVAR(1,155,"rvlc_scale_factor_data(): dpcm_noise_last_position"));
  117|      0|    }
  118|       |
  119|  5.75k|    return 0;
  120|  5.75k|}
rvlc_decode_scale_factors:
  123|  5.75k|{
  124|  5.75k|    uint8_t result;
  125|  5.75k|    uint8_t intensity_used = 0;
  126|  5.75k|    uint8_t *rvlc_sf_buffer = NULL;
  127|  5.75k|    uint8_t *rvlc_esc_buffer = NULL;
  128|  5.75k|    bitfile ld_rvlc_sf = {0}, ld_rvlc_esc = {0};
  129|       |//    bitfile ld_rvlc_sf_rev, ld_rvlc_esc_rev;
  130|       |
  131|  5.75k|    if (ics->length_of_rvlc_sf > 0)
  ------------------
  |  Branch (131:9): [True: 1.36k, False: 4.39k]
  ------------------
  132|  1.36k|    {
  133|       |        /* We read length_of_rvlc_sf bits here to put it in a
  134|       |           seperate bitfile.
  135|       |        */
  136|  1.36k|        rvlc_sf_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_sf
  137|  1.36k|            DEBUGVAR(1,156,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_sf"));
  138|       |
  139|  1.36k|        faad_initbits(&ld_rvlc_sf, (void*)rvlc_sf_buffer, bit2byte(ics->length_of_rvlc_sf));
  ------------------
  |  |   46|  1.36k|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|  1.36k|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
  140|       |//        faad_initbits_rev(&ld_rvlc_sf_rev, (void*)rvlc_sf_buffer,
  141|       |//            ics->length_of_rvlc_sf);
  142|  1.36k|    }
  143|  5.75k|    if ((ics->length_of_rvlc_sf == 0) || (ld_rvlc_sf.error != 0)) {
  ------------------
  |  Branch (143:9): [True: 4.39k, False: 1.36k]
  |  Branch (143:42): [True: 0, False: 1.36k]
  ------------------
  144|  4.39k|        memset(&ld_rvlc_sf, 0, sizeof(ld_rvlc_sf));
  145|  4.39k|        ld_rvlc_sf.error = 1;
  146|  4.39k|    }
  147|       |
  148|  5.75k|    if (ics->sf_escapes_present)
  ------------------
  |  Branch (148:9): [True: 875, False: 4.88k]
  ------------------
  149|    875|    {
  150|       |        /* We read length_of_rvlc_escapes bits here to put it in a
  151|       |           seperate bitfile.
  152|       |        */
  153|    875|        rvlc_esc_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_escapes
  154|    875|            DEBUGVAR(1,157,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_escapes"));
  155|       |
  156|    875|        faad_initbits(&ld_rvlc_esc, (void*)rvlc_esc_buffer, bit2byte(ics->length_of_rvlc_escapes));
  ------------------
  |  |   46|    875|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|    875|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
  157|       |//        faad_initbits_rev(&ld_rvlc_esc_rev, (void*)rvlc_esc_buffer,
  158|       |//            ics->length_of_rvlc_escapes);
  159|    875|    }
  160|  5.75k|    if (!ics->sf_escapes_present || (ld_rvlc_esc.error != 0)) {
  ------------------
  |  Branch (160:9): [True: 4.88k, False: 875]
  |  Branch (160:37): [True: 452, False: 423]
  ------------------
  161|  5.33k|        memset(&ld_rvlc_esc, 0, sizeof(ld_rvlc_esc));
  162|  5.33k|        ld_rvlc_esc.error = 1;
  163|  5.33k|    }
  164|       |
  165|       |    /* decode the rvlc scale factors and escapes */
  166|  5.75k|    result = rvlc_decode_sf_forward(ics, &ld_rvlc_sf,
  167|  5.75k|        &ld_rvlc_esc, &intensity_used);
  168|       |//    result = rvlc_decode_sf_reverse(ics, &ld_rvlc_sf_rev,
  169|       |//        &ld_rvlc_esc_rev, intensity_used);
  170|       |
  171|       |
  172|  5.75k|    if (rvlc_esc_buffer) faad_free(rvlc_esc_buffer);
  ------------------
  |  Branch (172:9): [True: 875, False: 4.88k]
  ------------------
  173|  5.75k|    if (rvlc_sf_buffer) faad_free(rvlc_sf_buffer);
  ------------------
  |  Branch (173:9): [True: 1.36k, False: 4.39k]
  ------------------
  174|       |
  175|  5.75k|    if (ics->length_of_rvlc_sf > 0)
  ------------------
  |  Branch (175:9): [True: 1.36k, False: 4.39k]
  ------------------
  176|  1.36k|        faad_endbits(&ld_rvlc_sf);
  177|  5.75k|    if (ics->sf_escapes_present)
  ------------------
  |  Branch (177:9): [True: 875, False: 4.88k]
  ------------------
  178|    875|        faad_endbits(&ld_rvlc_esc);
  179|       |
  180|  5.75k|    return result;
  181|  5.75k|}
rvlc.c:rvlc_decode_sf_forward:
  185|  5.75k|{
  186|  5.75k|    int8_t g, sfb;
  187|  5.75k|    int8_t t = 0;
  188|  5.75k|    int8_t error = ld_sf->error | ld_esc->error;
  189|  5.75k|    int8_t noise_pcm_flag = 1;
  190|       |
  191|  5.75k|    int16_t scale_factor = ics->global_gain;
  192|  5.75k|    int16_t is_position = 0;
  193|  5.75k|    int16_t noise_energy = ics->global_gain - 90 - 256;
  194|  5.75k|    int16_t scale_factor_max = 255;
  195|       |#ifdef FIXED_POINT
  196|       |    /* TODO: consider rolling out to regular build. */
  197|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  198|       |    /* The value is inexact, adjusted to current fuzzer findings. */
  199|       |    scale_factor_max = 165;
  200|       |#endif  // FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  201|       |#endif  // FIXED_POINT
  202|       |
  203|       |#ifdef PRINT_RVLC
  204|       |    printf("\nglobal_gain: %d\n", ics->global_gain);
  205|       |#endif
  206|       |
  207|  13.3k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (207:17): [True: 7.61k, False: 5.73k]
  ------------------
  208|  7.61k|    {
  209|  21.8k|        for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (209:23): [True: 14.2k, False: 7.59k]
  ------------------
  210|  14.2k|        {
  211|  14.2k|            if (error)
  ------------------
  |  Branch (211:17): [True: 8.81k, False: 5.46k]
  ------------------
  212|  8.81k|            {
  213|  8.81k|                ics->scale_factors[g][sfb] = 0;
  214|  8.81k|            } else {
  215|  5.46k|                switch (ics->sfb_cb[g][sfb])
  216|  5.46k|                {
  217|    361|                case ZERO_HCB: /* zero book */
  ------------------
  |  |  101|    361|#define ZERO_HCB       0
  ------------------
  |  Branch (217:17): [True: 361, False: 5.10k]
  ------------------
  218|    361|                    ics->scale_factors[g][sfb] = 0;
  219|    361|                    break;
  220|  1.34k|                case INTENSITY_HCB: /* intensity books */
  ------------------
  |  |  108|  1.34k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (220:17): [True: 1.34k, False: 4.12k]
  ------------------
  221|  2.41k|                case INTENSITY_HCB2:
  ------------------
  |  |  107|  2.41k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (221:17): [True: 1.07k, False: 4.39k]
  ------------------
  222|       |
  223|  2.41k|                    *intensity_used = 1;
  224|       |
  225|       |                    /* decode intensity position */
  226|  2.41k|                    t = rvlc_huffman_sf(ld_sf, ld_esc /*, +1*/);
  227|       |
  228|  2.41k|                    is_position += t;
  229|  2.41k|                    ics->scale_factors[g][sfb] = is_position;
  230|       |
  231|  2.41k|                    break;
  232|      0|                case NOISE_HCB: /* noise books */
  ------------------
  |  |  106|      0|#define NOISE_HCB      13
  ------------------
  |  Branch (232:17): [True: 0, False: 5.46k]
  ------------------
  233|       |
  234|       |                    /* decode noise energy */
  235|      0|                    if (noise_pcm_flag)
  ------------------
  |  Branch (235:25): [True: 0, False: 0]
  ------------------
  236|      0|                    {
  237|      0|                        int16_t n = ics->dpcm_noise_nrg;
  238|      0|                        noise_pcm_flag = 0;
  239|      0|                        noise_energy += n;
  240|      0|                    } else {
  241|      0|                        t = rvlc_huffman_sf(ld_sf, ld_esc /*, +1*/);
  242|      0|                        noise_energy += t;
  243|      0|                    }
  244|       |
  245|      0|                    ics->scale_factors[g][sfb] = noise_energy;
  246|       |
  247|      0|                    break;
  248|  2.68k|                default: /* spectral books */
  ------------------
  |  Branch (248:17): [True: 2.68k, False: 2.78k]
  ------------------
  249|       |
  250|       |                    /* decode scale factor */
  251|  2.68k|                    t = rvlc_huffman_sf(ld_sf, ld_esc /*, +1*/);
  252|       |
  253|  2.68k|                    scale_factor += t;
  254|  2.68k|                    if (scale_factor < 0 || scale_factor > 255)
  ------------------
  |  Branch (254:25): [True: 9, False: 2.68k]
  |  Branch (254:45): [True: 13, False: 2.66k]
  ------------------
  255|     22|                        return 4;
  256|       |
  257|  2.66k|                    ics->scale_factors[g][sfb] = min(scale_factor, scale_factor_max);
  ------------------
  |  |   60|  2.66k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 2.57k, False: 96]
  |  |  ------------------
  ------------------
  258|       |
  259|  2.66k|                    break;
  260|  5.46k|                }
  261|       |#ifdef PRINT_RVLC
  262|       |                printf("%3d:%4d%4d\n", sfb, ics->sfb_cb[g][sfb],
  263|       |                    ics->scale_factors[g][sfb]);
  264|       |#endif
  265|  5.44k|                if (t == 99)
  ------------------
  |  Branch (265:21): [True: 67, False: 5.38k]
  ------------------
  266|     67|                {
  267|     67|                    error = 1;
  268|     67|                }
  269|  5.44k|            }
  270|  14.2k|        }
  271|  7.61k|    }
  272|       |#ifdef PRINT_RVLC
  273|       |    printf("\n\n");
  274|       |#endif
  275|       |
  276|  5.73k|    return 0;
  277|  5.75k|}
rvlc.c:rvlc_huffman_sf:
  474|  5.10k|{
  475|  5.10k|    uint16_t i, j;
  476|  5.10k|    int16_t index;
  477|  5.10k|    uint32_t cw;
  478|  5.10k|    rvlc_huff_table *h = book_rvlc;
  479|  5.10k|    int8_t direction = +1;
  480|       |
  481|  5.10k|    i = h->len;
  482|  5.10k|    if (direction > 0)
  ------------------
  |  Branch (482:9): [True: 5.10k, False: 0]
  ------------------
  483|  5.10k|        cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
  484|      0|    else
  485|      0|        cw = 0 /* faad_getbits_rev(ld_sf, i DEBUGVAR(1,0,"")) */;
  486|       |
  487|  26.6k|    while ((cw != h->cw)
  ------------------
  |  Branch (487:12): [True: 21.5k, False: 5.10k]
  ------------------
  488|  21.5k|        && (i < 10))
  ------------------
  |  Branch (488:12): [True: 21.5k, False: 0]
  ------------------
  489|  21.5k|    {
  490|  21.5k|        h++;
  491|  21.5k|        j = h->len-i;
  492|  21.5k|        i += j;
  493|  21.5k|        cw <<= j;
  494|  21.5k|        if (direction > 0)
  ------------------
  |  Branch (494:13): [True: 21.5k, False: 0]
  ------------------
  495|  21.5k|            cw |= faad_getbits(ld_sf, j DEBUGVAR(1,0,""));
  496|      0|        else
  497|      0|            cw |= 0 /* faad_getbits_rev(ld_sf, j DEBUGVAR(1,0,"")) */;
  498|  21.5k|    }
  499|       |
  500|  5.10k|    index = h->index;
  501|       |
  502|  5.10k|    if (index == +ESC_VAL)
  ------------------
  |  |   46|  5.10k|#define ESC_VAL 7
  ------------------
  |  Branch (502:9): [True: 774, False: 4.33k]
  ------------------
  503|    774|    {
  504|    774|        int8_t esc = rvlc_huffman_esc(ld_esc /*, direction*/);
  505|    774|        if (esc == 99)
  ------------------
  |  Branch (505:13): [True: 0, False: 774]
  ------------------
  506|      0|            return 99;
  507|    774|        index += esc;
  508|       |#ifdef PRINT_RVLC
  509|       |        printf("esc: %d - ", esc);
  510|       |#endif
  511|    774|    }
  512|  5.10k|    if (index == -ESC_VAL)
  ------------------
  |  |   46|  5.10k|#define ESC_VAL 7
  ------------------
  |  Branch (512:9): [True: 246, False: 4.86k]
  ------------------
  513|    246|    {
  514|    246|        int8_t esc = rvlc_huffman_esc(ld_esc /*, direction*/);
  515|    246|        if (esc == 99)
  ------------------
  |  Branch (515:13): [True: 0, False: 246]
  ------------------
  516|      0|            return 99;
  517|    246|        index -= esc;
  518|       |#ifdef PRINT_RVLC
  519|       |        printf("esc: %d - ", esc);
  520|       |#endif
  521|    246|    }
  522|       |
  523|  5.10k|    return (int8_t)index;
  524|  5.10k|}
rvlc.c:rvlc_huffman_esc:
  528|  1.02k|{
  529|  1.02k|    uint16_t i, j;
  530|  1.02k|    uint32_t cw;
  531|  1.02k|    rvlc_huff_table *h = book_escape;
  532|  1.02k|    int8_t direction = +1;
  533|       |
  534|  1.02k|    i = h->len;
  535|  1.02k|    if (direction > 0)
  ------------------
  |  Branch (535:9): [True: 1.02k, False: 0]
  ------------------
  536|  1.02k|        cw = faad_getbits(ld, i DEBUGVAR(1,0,""));
  537|      0|    else
  538|      0|        cw = 0 /* faad_getbits_rev(ld, i DEBUGVAR(1,0,"")) */;
  539|       |
  540|  5.96k|    while ((cw != h->cw)
  ------------------
  |  Branch (540:12): [True: 4.94k, False: 1.02k]
  ------------------
  541|  4.94k|        && (i < 21))
  ------------------
  |  Branch (541:12): [True: 4.94k, False: 0]
  ------------------
  542|  4.94k|    {
  543|  4.94k|        h++;
  544|  4.94k|        j = h->len-i;
  545|  4.94k|        i += j;
  546|  4.94k|        cw <<= j;
  547|  4.94k|        if (direction > 0)
  ------------------
  |  Branch (547:13): [True: 4.94k, False: 0]
  ------------------
  548|  4.94k|            cw |= faad_getbits(ld, j DEBUGVAR(1,0,""));
  549|      0|        else
  550|      0|            cw |= 0 /* faad_getbits_rev(ld, j DEBUGVAR(1,0,"")) */;
  551|  4.94k|    }
  552|       |
  553|  1.02k|    return (int8_t)h->index;
  554|  1.02k|}

DCT4_32:
   49|  1.09M|{
   50|  1.09M|    real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
   51|  1.09M|    real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
   52|  1.09M|    real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
   53|  1.09M|    real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
   54|  1.09M|    real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
   55|  1.09M|    real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
   56|  1.09M|    real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
   57|  1.09M|    real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
   58|  1.09M|    real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
   59|  1.09M|    real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
   60|  1.09M|    real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
   61|  1.09M|    real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
   62|  1.09M|    real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
   63|  1.09M|    real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
   64|  1.09M|    real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
   65|  1.09M|    real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
   66|  1.09M|    real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
   67|  1.09M|    real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
   68|  1.09M|    real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
   69|  1.09M|    real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
   70|  1.09M|    real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
   71|  1.09M|    real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
   72|  1.09M|    real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
   73|  1.09M|    real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
   74|  1.09M|    real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
   75|  1.09M|    real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
   76|  1.09M|    real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
   77|  1.09M|    real_t f271, f272, f273, f274, f275, f276, f277, f278, f279, f280;
   78|  1.09M|    real_t f281, f282, f283, f284, f285, f286, f287, f288, f289, f290;
   79|  1.09M|    real_t f291, f292, f293, f294, f295, f296, f297, f298, f299, f300;
   80|  1.09M|    real_t f301, f302, f303, f304, f305, f306, f307, f310, f311, f312;
   81|  1.09M|    real_t f313, f316, f317, f318, f319, f322, f323, f324, f325, f328;
   82|  1.09M|    real_t f329, f330, f331, f334, f335, f336, f337, f340, f341, f342;
   83|  1.09M|    real_t f343, f346, f347, f348, f349, f352, f353, f354, f355, f358;
   84|  1.09M|    real_t f359, f360, f361, f364, f365, f366, f367, f370, f371, f372;
   85|  1.09M|    real_t f373, f376, f377, f378, f379, f382, f383, f384, f385, f388;
   86|  1.09M|    real_t f389, f390, f391, f394, f395, f396, f397;
   87|       |
   88|  1.09M|    f0 = x[15] - x[16];
   89|  1.09M|    f1 = x[15] + x[16];
   90|  1.09M|    f2 = MUL_F(FRAC_CONST(0.7071067811865476), f1);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
   91|  1.09M|    f3 = MUL_F(FRAC_CONST(0.7071067811865476), f0);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
   92|  1.09M|    f4 = x[8] - x[23];
   93|  1.09M|    f5 = x[8] + x[23];
   94|  1.09M|    f6 = MUL_F(FRAC_CONST(0.7071067811865476), f5);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
   95|  1.09M|    f7 = MUL_F(FRAC_CONST(0.7071067811865476), f4);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
   96|  1.09M|    f8 = x[12] - x[19];
   97|  1.09M|    f9 = x[12] + x[19];
   98|  1.09M|    f10 = MUL_F(FRAC_CONST(0.7071067811865476), f9);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
   99|  1.09M|    f11 = MUL_F(FRAC_CONST(0.7071067811865476), f8);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  100|  1.09M|    f12 = x[11] - x[20];
  101|  1.09M|    f13 = x[11] + x[20];
  102|  1.09M|    f14 = MUL_F(FRAC_CONST(0.7071067811865476), f13);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  103|  1.09M|    f15 = MUL_F(FRAC_CONST(0.7071067811865476), f12);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  104|  1.09M|    f16 = x[14] - x[17];
  105|  1.09M|    f17 = x[14] + x[17];
  106|  1.09M|    f18 = MUL_F(FRAC_CONST(0.7071067811865476), f17);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  107|  1.09M|    f19 = MUL_F(FRAC_CONST(0.7071067811865476), f16);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  108|  1.09M|    f20 = x[9] - x[22];
  109|  1.09M|    f21 = x[9] + x[22];
  110|  1.09M|    f22 = MUL_F(FRAC_CONST(0.7071067811865476), f21);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  111|  1.09M|    f23 = MUL_F(FRAC_CONST(0.7071067811865476), f20);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  112|  1.09M|    f24 = x[13] - x[18];
  113|  1.09M|    f25 = x[13] + x[18];
  114|  1.09M|    f26 = MUL_F(FRAC_CONST(0.7071067811865476), f25);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  115|  1.09M|    f27 = MUL_F(FRAC_CONST(0.7071067811865476), f24);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  116|  1.09M|    f28 = x[10] - x[21];
  117|  1.09M|    f29 = x[10] + x[21];
  118|  1.09M|    f30 = MUL_F(FRAC_CONST(0.7071067811865476), f29);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  119|  1.09M|    f31 = MUL_F(FRAC_CONST(0.7071067811865476), f28);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  120|  1.09M|    f32 = x[0] - f2;
  121|  1.09M|    f33 = x[0] + f2;
  122|  1.09M|    f34 = x[31] - f3;
  123|  1.09M|    f35 = x[31] + f3;
  124|  1.09M|    f36 = x[7] - f6;
  125|  1.09M|    f37 = x[7] + f6;
  126|  1.09M|    f38 = x[24] - f7;
  127|  1.09M|    f39 = x[24] + f7;
  128|  1.09M|    f40 = x[3] - f10;
  129|  1.09M|    f41 = x[3] + f10;
  130|  1.09M|    f42 = x[28] - f11;
  131|  1.09M|    f43 = x[28] + f11;
  132|  1.09M|    f44 = x[4] - f14;
  133|  1.09M|    f45 = x[4] + f14;
  134|  1.09M|    f46 = x[27] - f15;
  135|  1.09M|    f47 = x[27] + f15;
  136|  1.09M|    f48 = x[1] - f18;
  137|  1.09M|    f49 = x[1] + f18;
  138|  1.09M|    f50 = x[30] - f19;
  139|  1.09M|    f51 = x[30] + f19;
  140|  1.09M|    f52 = x[6] - f22;
  141|  1.09M|    f53 = x[6] + f22;
  142|  1.09M|    f54 = x[25] - f23;
  143|  1.09M|    f55 = x[25] + f23;
  144|  1.09M|    f56 = x[2] - f26;
  145|  1.09M|    f57 = x[2] + f26;
  146|  1.09M|    f58 = x[29] - f27;
  147|  1.09M|    f59 = x[29] + f27;
  148|  1.09M|    f60 = x[5] - f30;
  149|  1.09M|    f61 = x[5] + f30;
  150|  1.09M|    f62 = x[26] - f31;
  151|  1.09M|    f63 = x[26] + f31;
  152|  1.09M|    f64 = f39 + f37;
  153|  1.09M|    f65 = MUL_F(FRAC_CONST(-0.5411961001461969), f39);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  154|  1.09M|    f66 = MUL_F(FRAC_CONST(0.9238795325112867), f64);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  155|  1.09M|    f67 = MUL_C(COEF_CONST(1.3065629648763766), f37);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  156|  1.09M|    f68 = f65 + f66;
  157|  1.09M|    f69 = f67 - f66;
  158|  1.09M|    f70 = f38 + f36;
  159|  1.09M|    f71 = MUL_C(COEF_CONST(1.3065629648763770), f38);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  160|  1.09M|    f72 = MUL_F(FRAC_CONST(-0.3826834323650904), f70);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  161|  1.09M|    f73 = MUL_F(FRAC_CONST(0.5411961001461961), f36);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  162|  1.09M|    f74 = f71 + f72;
  163|  1.09M|    f75 = f73 - f72;
  164|  1.09M|    f76 = f47 + f45;
  165|  1.09M|    f77 = MUL_F(FRAC_CONST(-0.5411961001461969), f47);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  166|  1.09M|    f78 = MUL_F(FRAC_CONST(0.9238795325112867), f76);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  167|  1.09M|    f79 = MUL_C(COEF_CONST(1.3065629648763766), f45);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  168|  1.09M|    f80 = f77 + f78;
  169|  1.09M|    f81 = f79 - f78;
  170|  1.09M|    f82 = f46 + f44;
  171|  1.09M|    f83 = MUL_C(COEF_CONST(1.3065629648763770), f46);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  172|  1.09M|    f84 = MUL_F(FRAC_CONST(-0.3826834323650904), f82);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  173|  1.09M|    f85 = MUL_F(FRAC_CONST(0.5411961001461961), f44);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  174|  1.09M|    f86 = f83 + f84;
  175|  1.09M|    f87 = f85 - f84;
  176|  1.09M|    f88 = f55 + f53;
  177|  1.09M|    f89 = MUL_F(FRAC_CONST(-0.5411961001461969), f55);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  178|  1.09M|    f90 = MUL_F(FRAC_CONST(0.9238795325112867), f88);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  179|  1.09M|    f91 = MUL_C(COEF_CONST(1.3065629648763766), f53);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  180|  1.09M|    f92 = f89 + f90;
  181|  1.09M|    f93 = f91 - f90;
  182|  1.09M|    f94 = f54 + f52;
  183|  1.09M|    f95 = MUL_C(COEF_CONST(1.3065629648763770), f54);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  184|  1.09M|    f96 = MUL_F(FRAC_CONST(-0.3826834323650904), f94);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  185|  1.09M|    f97 = MUL_F(FRAC_CONST(0.5411961001461961), f52);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  186|  1.09M|    f98 = f95 + f96;
  187|  1.09M|    f99 = f97 - f96;
  188|  1.09M|    f100 = f63 + f61;
  189|  1.09M|    f101 = MUL_F(FRAC_CONST(-0.5411961001461969), f63);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  190|  1.09M|    f102 = MUL_F(FRAC_CONST(0.9238795325112867), f100);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  191|  1.09M|    f103 = MUL_C(COEF_CONST(1.3065629648763766), f61);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  192|  1.09M|    f104 = f101 + f102;
  193|  1.09M|    f105 = f103 - f102;
  194|  1.09M|    f106 = f62 + f60;
  195|  1.09M|    f107 = MUL_C(COEF_CONST(1.3065629648763770), f62);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  196|  1.09M|    f108 = MUL_F(FRAC_CONST(-0.3826834323650904), f106);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  197|  1.09M|    f109 = MUL_F(FRAC_CONST(0.5411961001461961), f60);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  198|  1.09M|    f110 = f107 + f108;
  199|  1.09M|    f111 = f109 - f108;
  200|  1.09M|    f112 = f33 - f68;
  201|  1.09M|    f113 = f33 + f68;
  202|  1.09M|    f114 = f35 - f69;
  203|  1.09M|    f115 = f35 + f69;
  204|  1.09M|    f116 = f32 - f74;
  205|  1.09M|    f117 = f32 + f74;
  206|  1.09M|    f118 = f34 - f75;
  207|  1.09M|    f119 = f34 + f75;
  208|  1.09M|    f120 = f41 - f80;
  209|  1.09M|    f121 = f41 + f80;
  210|  1.09M|    f122 = f43 - f81;
  211|  1.09M|    f123 = f43 + f81;
  212|  1.09M|    f124 = f40 - f86;
  213|  1.09M|    f125 = f40 + f86;
  214|  1.09M|    f126 = f42 - f87;
  215|  1.09M|    f127 = f42 + f87;
  216|  1.09M|    f128 = f49 - f92;
  217|  1.09M|    f129 = f49 + f92;
  218|  1.09M|    f130 = f51 - f93;
  219|  1.09M|    f131 = f51 + f93;
  220|  1.09M|    f132 = f48 - f98;
  221|  1.09M|    f133 = f48 + f98;
  222|  1.09M|    f134 = f50 - f99;
  223|  1.09M|    f135 = f50 + f99;
  224|  1.09M|    f136 = f57 - f104;
  225|  1.09M|    f137 = f57 + f104;
  226|  1.09M|    f138 = f59 - f105;
  227|  1.09M|    f139 = f59 + f105;
  228|  1.09M|    f140 = f56 - f110;
  229|  1.09M|    f141 = f56 + f110;
  230|  1.09M|    f142 = f58 - f111;
  231|  1.09M|    f143 = f58 + f111;
  232|  1.09M|    f144 = f123 + f121;
  233|  1.09M|    f145 = MUL_F(FRAC_CONST(-0.7856949583871021), f123);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  234|  1.09M|    f146 = MUL_F(FRAC_CONST(0.9807852804032304), f144);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  235|  1.09M|    f147 = MUL_C(COEF_CONST(1.1758756024193588), f121);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  236|  1.09M|    f148 = f145 + f146;
  237|  1.09M|    f149 = f147 - f146;
  238|  1.09M|    f150 = f127 + f125;
  239|  1.09M|    f151 = MUL_F(FRAC_CONST(0.2758993792829431), f127);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  240|  1.09M|    f152 = MUL_F(FRAC_CONST(0.5555702330196022), f150);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  241|  1.09M|    f153 = MUL_C(COEF_CONST(1.3870398453221475), f125);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  242|  1.09M|    f154 = f151 + f152;
  243|  1.09M|    f155 = f153 - f152;
  244|  1.09M|    f156 = f122 + f120;
  245|  1.09M|    f157 = MUL_C(COEF_CONST(1.1758756024193591), f122);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  246|  1.09M|    f158 = MUL_F(FRAC_CONST(-0.1950903220161287), f156);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  247|  1.09M|    f159 = MUL_F(FRAC_CONST(0.7856949583871016), f120);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  248|  1.09M|    f160 = f157 + f158;
  249|  1.09M|    f161 = f159 - f158;
  250|  1.09M|    f162 = f126 + f124;
  251|  1.09M|    f163 = MUL_C(COEF_CONST(1.3870398453221473), f126);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  252|  1.09M|    f164 = MUL_F(FRAC_CONST(-0.8314696123025455), f162);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  253|  1.09M|    f165 = MUL_F(FRAC_CONST(-0.2758993792829436), f124);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  254|  1.09M|    f166 = f163 + f164;
  255|  1.09M|    f167 = f165 - f164;
  256|  1.09M|    f168 = f139 + f137;
  257|  1.09M|    f169 = MUL_F(FRAC_CONST(-0.7856949583871021), f139);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  258|  1.09M|    f170 = MUL_F(FRAC_CONST(0.9807852804032304), f168);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  259|  1.09M|    f171 = MUL_C(COEF_CONST(1.1758756024193588), f137);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  260|  1.09M|    f172 = f169 + f170;
  261|  1.09M|    f173 = f171 - f170;
  262|  1.09M|    f174 = f143 + f141;
  263|  1.09M|    f175 = MUL_F(FRAC_CONST(0.2758993792829431), f143);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  264|  1.09M|    f176 = MUL_F(FRAC_CONST(0.5555702330196022), f174);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  265|  1.09M|    f177 = MUL_C(COEF_CONST(1.3870398453221475), f141);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  266|  1.09M|    f178 = f175 + f176;
  267|  1.09M|    f179 = f177 - f176;
  268|  1.09M|    f180 = f138 + f136;
  269|  1.09M|    f181 = MUL_C(COEF_CONST(1.1758756024193591), f138);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  270|  1.09M|    f182 = MUL_F(FRAC_CONST(-0.1950903220161287), f180);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  271|  1.09M|    f183 = MUL_F(FRAC_CONST(0.7856949583871016), f136);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  272|  1.09M|    f184 = f181 + f182;
  273|  1.09M|    f185 = f183 - f182;
  274|  1.09M|    f186 = f142 + f140;
  275|  1.09M|    f187 = MUL_C(COEF_CONST(1.3870398453221473), f142);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  276|  1.09M|    f188 = MUL_F(FRAC_CONST(-0.8314696123025455), f186);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  277|  1.09M|    f189 = MUL_F(FRAC_CONST(-0.2758993792829436), f140);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  278|  1.09M|    f190 = f187 + f188;
  279|  1.09M|    f191 = f189 - f188;
  280|  1.09M|    f192 = f113 - f148;
  281|  1.09M|    f193 = f113 + f148;
  282|  1.09M|    f194 = f115 - f149;
  283|  1.09M|    f195 = f115 + f149;
  284|  1.09M|    f196 = f117 - f154;
  285|  1.09M|    f197 = f117 + f154;
  286|  1.09M|    f198 = f119 - f155;
  287|  1.09M|    f199 = f119 + f155;
  288|  1.09M|    f200 = f112 - f160;
  289|  1.09M|    f201 = f112 + f160;
  290|  1.09M|    f202 = f114 - f161;
  291|  1.09M|    f203 = f114 + f161;
  292|  1.09M|    f204 = f116 - f166;
  293|  1.09M|    f205 = f116 + f166;
  294|  1.09M|    f206 = f118 - f167;
  295|  1.09M|    f207 = f118 + f167;
  296|  1.09M|    f208 = f129 - f172;
  297|  1.09M|    f209 = f129 + f172;
  298|  1.09M|    f210 = f131 - f173;
  299|  1.09M|    f211 = f131 + f173;
  300|  1.09M|    f212 = f133 - f178;
  301|  1.09M|    f213 = f133 + f178;
  302|  1.09M|    f214 = f135 - f179;
  303|  1.09M|    f215 = f135 + f179;
  304|  1.09M|    f216 = f128 - f184;
  305|  1.09M|    f217 = f128 + f184;
  306|  1.09M|    f218 = f130 - f185;
  307|  1.09M|    f219 = f130 + f185;
  308|  1.09M|    f220 = f132 - f190;
  309|  1.09M|    f221 = f132 + f190;
  310|  1.09M|    f222 = f134 - f191;
  311|  1.09M|    f223 = f134 + f191;
  312|  1.09M|    f224 = f211 + f209;
  313|  1.09M|    f225 = MUL_F(FRAC_CONST(-0.8971675863426361), f211);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  314|  1.09M|    f226 = MUL_F(FRAC_CONST(0.9951847266721968), f224);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  315|  1.09M|    f227 = MUL_C(COEF_CONST(1.0932018670017576), f209);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  316|  1.09M|    f228 = f225 + f226;
  317|  1.09M|    f229 = f227 - f226;
  318|  1.09M|    f230 = f215 + f213;
  319|  1.09M|    f231 = MUL_F(FRAC_CONST(-0.4105245275223571), f215);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  320|  1.09M|    f232 = MUL_F(FRAC_CONST(0.8819212643483549), f230);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  321|  1.09M|    f233 = MUL_C(COEF_CONST(1.3533180011743529), f213);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  322|  1.09M|    f234 = f231 + f232;
  323|  1.09M|    f235 = f233 - f232;
  324|  1.09M|    f236 = f219 + f217;
  325|  1.09M|    f237 = MUL_F(FRAC_CONST(0.1386171691990915), f219);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  326|  1.09M|    f238 = MUL_F(FRAC_CONST(0.6343932841636455), f236);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  327|  1.09M|    f239 = MUL_C(COEF_CONST(1.4074037375263826), f217);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  328|  1.09M|    f240 = f237 + f238;
  329|  1.09M|    f241 = f239 - f238;
  330|  1.09M|    f242 = f223 + f221;
  331|  1.09M|    f243 = MUL_F(FRAC_CONST(0.6666556584777466), f223);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  332|  1.09M|    f244 = MUL_F(FRAC_CONST(0.2902846772544623), f242);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  333|  1.09M|    f245 = MUL_C(COEF_CONST(1.2472250129866711), f221);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  334|  1.09M|    f246 = f243 + f244;
  335|  1.09M|    f247 = f245 - f244;
  336|  1.09M|    f248 = f210 + f208;
  337|  1.09M|    f249 = MUL_C(COEF_CONST(1.0932018670017574), f210);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  338|  1.09M|    f250 = MUL_F(FRAC_CONST(-0.0980171403295605), f248);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  339|  1.09M|    f251 = MUL_F(FRAC_CONST(0.8971675863426364), f208);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  340|  1.09M|    f252 = f249 + f250;
  341|  1.09M|    f253 = f251 - f250;
  342|  1.09M|    f254 = f214 + f212;
  343|  1.09M|    f255 = MUL_C(COEF_CONST(1.3533180011743529), f214);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  344|  1.09M|    f256 = MUL_F(FRAC_CONST(-0.4713967368259979), f254);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  345|  1.09M|    f257 = MUL_F(FRAC_CONST(0.4105245275223569), f212);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  346|  1.09M|    f258 = f255 + f256;
  347|  1.09M|    f259 = f257 - f256;
  348|  1.09M|    f260 = f218 + f216;
  349|  1.09M|    f261 = MUL_C(COEF_CONST(1.4074037375263826), f218);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  350|  1.09M|    f262 = MUL_F(FRAC_CONST(-0.7730104533627369), f260);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  351|  1.09M|    f263 = MUL_F(FRAC_CONST(-0.1386171691990913), f216);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  352|  1.09M|    f264 = f261 + f262;
  353|  1.09M|    f265 = f263 - f262;
  354|  1.09M|    f266 = f222 + f220;
  355|  1.09M|    f267 = MUL_C(COEF_CONST(1.2472250129866711), f222);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  356|  1.09M|    f268 = MUL_F(FRAC_CONST(-0.9569403357322089), f266);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  357|  1.09M|    f269 = MUL_F(FRAC_CONST(-0.6666556584777469), f220);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  358|  1.09M|    f270 = f267 + f268;
  359|  1.09M|    f271 = f269 - f268;
  360|  1.09M|    f272 = f193 - f228;
  361|  1.09M|    f273 = f193 + f228;
  362|  1.09M|    f274 = f195 - f229;
  363|  1.09M|    f275 = f195 + f229;
  364|  1.09M|    f276 = f197 - f234;
  365|  1.09M|    f277 = f197 + f234;
  366|  1.09M|    f278 = f199 - f235;
  367|  1.09M|    f279 = f199 + f235;
  368|  1.09M|    f280 = f201 - f240;
  369|  1.09M|    f281 = f201 + f240;
  370|  1.09M|    f282 = f203 - f241;
  371|  1.09M|    f283 = f203 + f241;
  372|  1.09M|    f284 = f205 - f246;
  373|  1.09M|    f285 = f205 + f246;
  374|  1.09M|    f286 = f207 - f247;
  375|  1.09M|    f287 = f207 + f247;
  376|  1.09M|    f288 = f192 - f252;
  377|  1.09M|    f289 = f192 + f252;
  378|  1.09M|    f290 = f194 - f253;
  379|  1.09M|    f291 = f194 + f253;
  380|  1.09M|    f292 = f196 - f258;
  381|  1.09M|    f293 = f196 + f258;
  382|  1.09M|    f294 = f198 - f259;
  383|  1.09M|    f295 = f198 + f259;
  384|  1.09M|    f296 = f200 - f264;
  385|  1.09M|    f297 = f200 + f264;
  386|  1.09M|    f298 = f202 - f265;
  387|  1.09M|    f299 = f202 + f265;
  388|  1.09M|    f300 = f204 - f270;
  389|  1.09M|    f301 = f204 + f270;
  390|  1.09M|    f302 = f206 - f271;
  391|  1.09M|    f303 = f206 + f271;
  392|  1.09M|    f304 = f275 + f273;
  393|  1.09M|    f305 = MUL_F(FRAC_CONST(-0.9751575901732920), f275);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  394|  1.09M|    f306 = MUL_F(FRAC_CONST(0.9996988186962043), f304);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  395|  1.09M|    f307 = MUL_C(COEF_CONST(1.0242400472191164), f273);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  396|  1.09M|    y[0] = f305 + f306;
  397|  1.09M|    y[31] = f307 - f306;
  398|  1.09M|    f310 = f279 + f277;
  399|  1.09M|    f311 = MUL_F(FRAC_CONST(-0.8700688593994936), f279);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  400|  1.09M|    f312 = MUL_F(FRAC_CONST(0.9924795345987100), f310);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  401|  1.09M|    f313 = MUL_C(COEF_CONST(1.1148902097979263), f277);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  402|  1.09M|    y[2] = f311 + f312;
  403|  1.09M|    y[29] = f313 - f312;
  404|  1.09M|    f316 = f283 + f281;
  405|  1.09M|    f317 = MUL_F(FRAC_CONST(-0.7566008898816587), f283);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  406|  1.09M|    f318 = MUL_F(FRAC_CONST(0.9757021300385286), f316);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  407|  1.09M|    f319 = MUL_C(COEF_CONST(1.1948033701953984), f281);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  408|  1.09M|    y[4] = f317 + f318;
  409|  1.09M|    y[27] = f319 - f318;
  410|  1.09M|    f322 = f287 + f285;
  411|  1.09M|    f323 = MUL_F(FRAC_CONST(-0.6358464401941451), f287);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  412|  1.09M|    f324 = MUL_F(FRAC_CONST(0.9495281805930367), f322);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  413|  1.09M|    f325 = MUL_C(COEF_CONST(1.2632099209919283), f285);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  414|  1.09M|    y[6] = f323 + f324;
  415|  1.09M|    y[25] = f325 - f324;
  416|  1.09M|    f328 = f291 + f289;
  417|  1.09M|    f329 = MUL_F(FRAC_CONST(-0.5089684416985408), f291);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  418|  1.09M|    f330 = MUL_F(FRAC_CONST(0.9142097557035307), f328);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  419|  1.09M|    f331 = MUL_C(COEF_CONST(1.3194510697085207), f289);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  420|  1.09M|    y[8] = f329 + f330;
  421|  1.09M|    y[23] = f331 - f330;
  422|  1.09M|    f334 = f295 + f293;
  423|  1.09M|    f335 = MUL_F(FRAC_CONST(-0.3771887988789273), f295);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  424|  1.09M|    f336 = MUL_F(FRAC_CONST(0.8700869911087114), f334);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  425|  1.09M|    f337 = MUL_C(COEF_CONST(1.3629851833384954), f293);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  426|  1.09M|    y[10] = f335 + f336;
  427|  1.09M|    y[21] = f337 - f336;
  428|  1.09M|    f340 = f299 + f297;
  429|  1.09M|    f341 = MUL_F(FRAC_CONST(-0.2417766217337384), f299);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  430|  1.09M|    f342 = MUL_F(FRAC_CONST(0.8175848131515837), f340);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  431|  1.09M|    f343 = MUL_C(COEF_CONST(1.3933930045694289), f297);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  432|  1.09M|    y[12] = f341 + f342;
  433|  1.09M|    y[19] = f343 - f342;
  434|  1.09M|    f346 = f303 + f301;
  435|  1.09M|    f347 = MUL_F(FRAC_CONST(-0.1040360035527077), f303);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  436|  1.09M|    f348 = MUL_F(FRAC_CONST(0.7572088465064845), f346);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  437|  1.09M|    f349 = MUL_C(COEF_CONST(1.4103816894602612), f301);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  438|  1.09M|    y[14] = f347 + f348;
  439|  1.09M|    y[17] = f349 - f348;
  440|  1.09M|    f352 = f274 + f272;
  441|  1.09M|    f353 = MUL_F(FRAC_CONST(0.0347065382144002), f274);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  442|  1.09M|    f354 = MUL_F(FRAC_CONST(0.6895405447370668), f352);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  443|  1.09M|    f355 = MUL_C(COEF_CONST(1.4137876276885337), f272);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  444|  1.09M|    y[16] = f353 + f354;
  445|  1.09M|    y[15] = f355 - f354;
  446|  1.09M|    f358 = f278 + f276;
  447|  1.09M|    f359 = MUL_F(FRAC_CONST(0.1731148370459795), f278);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  448|  1.09M|    f360 = MUL_F(FRAC_CONST(0.6152315905806268), f358);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  449|  1.09M|    f361 = MUL_C(COEF_CONST(1.4035780182072330), f276);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  450|  1.09M|    y[18] = f359 + f360;
  451|  1.09M|    y[13] = f361 - f360;
  452|  1.09M|    f364 = f282 + f280;
  453|  1.09M|    f365 = MUL_F(FRAC_CONST(0.3098559453626100), f282);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  454|  1.09M|    f366 = MUL_F(FRAC_CONST(0.5349976198870972), f364);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  455|  1.09M|    f367 = MUL_C(COEF_CONST(1.3798511851368043), f280);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  456|  1.09M|    y[20] = f365 + f366;
  457|  1.09M|    y[11] = f367 - f366;
  458|  1.09M|    f370 = f286 + f284;
  459|  1.09M|    f371 = MUL_F(FRAC_CONST(0.4436129715409088), f286);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  460|  1.09M|    f372 = MUL_F(FRAC_CONST(0.4496113296546065), f370);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  461|  1.09M|    f373 = MUL_C(COEF_CONST(1.3428356308501219), f284);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  462|  1.09M|    y[22] = f371 + f372;
  463|  1.09M|    y[9] = f373 - f372;
  464|  1.09M|    f376 = f290 + f288;
  465|  1.09M|    f377 = MUL_F(FRAC_CONST(0.5730977622997509), f290);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  466|  1.09M|    f378 = MUL_F(FRAC_CONST(0.3598950365349881), f376);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  467|  1.09M|    f379 = MUL_C(COEF_CONST(1.2928878353697271), f288);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  468|  1.09M|    y[24] = f377 + f378;
  469|  1.09M|    y[7] = f379 - f378;
  470|  1.09M|    f382 = f294 + f292;
  471|  1.09M|    f383 = MUL_F(FRAC_CONST(0.6970633083205415), f294);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  472|  1.09M|    f384 = MUL_F(FRAC_CONST(0.2667127574748984), f382);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  473|  1.09M|    f385 = MUL_C(COEF_CONST(1.2304888232703382), f292);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  474|  1.09M|    y[26] = f383 + f384;
  475|  1.09M|    y[5] = f385 - f384;
  476|  1.09M|    f388 = f298 + f296;
  477|  1.09M|    f389 = MUL_F(FRAC_CONST(0.8143157536286401), f298);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  478|  1.09M|    f390 = MUL_F(FRAC_CONST(0.1709618887603012), f388);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  479|  1.09M|    f391 = MUL_C(COEF_CONST(1.1562395311492424), f296);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  480|  1.09M|    y[28] = f389 + f390;
  481|  1.09M|    y[3] = f391 - f390;
  482|  1.09M|    f394 = f302 + f300;
  483|  1.09M|    f395 = MUL_F(FRAC_CONST(0.9237258930790228), f302);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  484|  1.09M|    f396 = MUL_F(FRAC_CONST(0.0735645635996674), f394);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  485|  1.09M|    f397 = MUL_C(COEF_CONST(1.0708550202783576), f300);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  486|  1.09M|    y[30] = f395 + f396;
  487|  1.09M|    y[1] = f397 - f396;
  488|  1.09M|}
DST4_32:
  491|  1.09M|{
  492|  1.09M|    real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9;
  493|  1.09M|    real_t f10, f11, f12, f13, f14, f15, f16, f17, f18, f19;
  494|  1.09M|    real_t f20, f21, f22, f23, f24, f25, f26, f27, f28, f29;
  495|  1.09M|    real_t f30, f31, f32, f33, f34, f35, f36, f37, f38, f39;
  496|  1.09M|    real_t f40, f41, f42, f43, f44, f45, f46, f47, f48, f49;
  497|  1.09M|    real_t f50, f51, f52, f53, f54, f55, f56, f57, f58, f59;
  498|  1.09M|    real_t f60, f61, f62, f63, f64, f65, f66, f67, f68, f69;
  499|  1.09M|    real_t f70, f71, f72, f73, f74, f75, f76, f77, f78, f79;
  500|  1.09M|    real_t f80, f81, f82, f83, f84, f85, f86, f87, f88, f89;
  501|  1.09M|    real_t f90, f91, f92, f93, f94, f95, f96, f97, f98, f99;
  502|  1.09M|    real_t f100, f101, f102, f103, f104, f105, f106, f107, f108, f109;
  503|  1.09M|    real_t f110, f111, f112, f113, f114, f115, f116, f117, f118, f119;
  504|  1.09M|    real_t f120, f121, f122, f123, f124, f125, f126, f127, f128, f129;
  505|  1.09M|    real_t f130, f131, f132, f133, f134, f135, f136, f137, f138, f139;
  506|  1.09M|    real_t f140, f141, f142, f143, f144, f145, f146, f147, f148, f149;
  507|  1.09M|    real_t f150, f151, f152, f153, f154, f155, f156, f157, f158, f159;
  508|  1.09M|    real_t f160, f161, f162, f163, f164, f165, f166, f167, f168, f169;
  509|  1.09M|    real_t f170, f171, f172, f173, f174, f175, f176, f177, f178, f179;
  510|  1.09M|    real_t f180, f181, f182, f183, f184, f185, f186, f187, f188, f189;
  511|  1.09M|    real_t f190, f191, f192, f193, f194, f195, f196, f197, f198, f199;
  512|  1.09M|    real_t f200, f201, f202, f203, f204, f205, f206, f207, f208, f209;
  513|  1.09M|    real_t f210, f211, f212, f213, f214, f215, f216, f217, f218, f219;
  514|  1.09M|    real_t f220, f221, f222, f223, f224, f225, f226, f227, f228, f229;
  515|  1.09M|    real_t f230, f231, f232, f233, f234, f235, f236, f237, f238, f239;
  516|  1.09M|    real_t f240, f241, f242, f243, f244, f245, f246, f247, f248, f249;
  517|  1.09M|    real_t f250, f251, f252, f253, f254, f255, f256, f257, f258, f259;
  518|  1.09M|    real_t f260, f261, f262, f263, f264, f265, f266, f267, f268, f269;
  519|  1.09M|    real_t f270, f271, f272, f273, f274, f275, f276, f277, f278, f279;
  520|  1.09M|    real_t f280, f281, f282, f283, f284, f285, f286, f287, f288, f289;
  521|  1.09M|    real_t f290, f291, f292, f293, f294, f295, f296, f297, f298, f299;
  522|  1.09M|    real_t f300, f301, f302, f303, f304, f305, f306, f307, f308, f309;
  523|  1.09M|    real_t f310, f311, f312, f313, f314, f315, f316, f317, f318, f319;
  524|  1.09M|    real_t f320, f321, f322, f323, f324, f325, f326, f327, f328, f329;
  525|  1.09M|    real_t f330, f331, f332, f333, f334, f335;
  526|       |
  527|  1.09M|    f0 = x[0] - x[1];
  528|  1.09M|    f1 = x[2] - x[1];
  529|  1.09M|    f2 = x[2] - x[3];
  530|  1.09M|    f3 = x[4] - x[3];
  531|  1.09M|    f4 = x[4] - x[5];
  532|  1.09M|    f5 = x[6] - x[5];
  533|  1.09M|    f6 = x[6] - x[7];
  534|  1.09M|    f7 = x[8] - x[7];
  535|  1.09M|    f8 = x[8] - x[9];
  536|  1.09M|    f9 = x[10] - x[9];
  537|  1.09M|    f10 = x[10] - x[11];
  538|  1.09M|    f11 = x[12] - x[11];
  539|  1.09M|    f12 = x[12] - x[13];
  540|  1.09M|    f13 = x[14] - x[13];
  541|  1.09M|    f14 = x[14] - x[15];
  542|  1.09M|    f15 = x[16] - x[15];
  543|  1.09M|    f16 = x[16] - x[17];
  544|  1.09M|    f17 = x[18] - x[17];
  545|  1.09M|    f18 = x[18] - x[19];
  546|  1.09M|    f19 = x[20] - x[19];
  547|  1.09M|    f20 = x[20] - x[21];
  548|  1.09M|    f21 = x[22] - x[21];
  549|  1.09M|    f22 = x[22] - x[23];
  550|  1.09M|    f23 = x[24] - x[23];
  551|  1.09M|    f24 = x[24] - x[25];
  552|  1.09M|    f25 = x[26] - x[25];
  553|  1.09M|    f26 = x[26] - x[27];
  554|  1.09M|    f27 = x[28] - x[27];
  555|  1.09M|    f28 = x[28] - x[29];
  556|  1.09M|    f29 = x[30] - x[29];
  557|  1.09M|    f30 = x[30] - x[31];
  558|  1.09M|    f31 = MUL_F(FRAC_CONST(0.7071067811865476), f15);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  559|  1.09M|    f32 = x[0] - f31;
  560|  1.09M|    f33 = x[0] + f31;
  561|  1.09M|    f34 = f7 + f23;
  562|  1.09M|    f35 = MUL_C(COEF_CONST(1.3065629648763766), f7);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  563|  1.09M|    f36 = MUL_F(FRAC_CONST(-0.9238795325112866), f34);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  564|  1.09M|    f37 = MUL_F(FRAC_CONST(-0.5411961001461967), f23);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  565|  1.09M|    f38 = f35 + f36;
  566|  1.09M|    f39 = f37 - f36;
  567|  1.09M|    f40 = f33 - f39;
  568|  1.09M|    f41 = f33 + f39;
  569|  1.09M|    f42 = f32 - f38;
  570|  1.09M|    f43 = f32 + f38;
  571|  1.09M|    f44 = f11 - f19;
  572|  1.09M|    f45 = f11 + f19;
  573|  1.09M|    f46 = MUL_F(FRAC_CONST(0.7071067811865476), f45);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  574|  1.09M|    f47 = f3 - f46;
  575|  1.09M|    f48 = f3 + f46;
  576|  1.09M|    f49 = MUL_F(FRAC_CONST(0.7071067811865476), f44);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  577|  1.09M|    f50 = f49 - f27;
  578|  1.09M|    f51 = f49 + f27;
  579|  1.09M|    f52 = f51 + f48;
  580|  1.09M|    f53 = MUL_F(FRAC_CONST(-0.7856949583871021), f51);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  581|  1.09M|    f54 = MUL_F(FRAC_CONST(0.9807852804032304), f52);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  582|  1.09M|    f55 = MUL_C(COEF_CONST(1.1758756024193588), f48);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  583|  1.09M|    f56 = f53 + f54;
  584|  1.09M|    f57 = f55 - f54;
  585|  1.09M|    f58 = f50 + f47;
  586|  1.09M|    f59 = MUL_F(FRAC_CONST(-0.2758993792829430), f50);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  587|  1.09M|    f60 = MUL_F(FRAC_CONST(0.8314696123025452), f58);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  588|  1.09M|    f61 = MUL_C(COEF_CONST(1.3870398453221475), f47);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  589|  1.09M|    f62 = f59 + f60;
  590|  1.09M|    f63 = f61 - f60;
  591|  1.09M|    f64 = f41 - f56;
  592|  1.09M|    f65 = f41 + f56;
  593|  1.09M|    f66 = f43 - f62;
  594|  1.09M|    f67 = f43 + f62;
  595|  1.09M|    f68 = f42 - f63;
  596|  1.09M|    f69 = f42 + f63;
  597|  1.09M|    f70 = f40 - f57;
  598|  1.09M|    f71 = f40 + f57;
  599|  1.09M|    f72 = f5 - f9;
  600|  1.09M|    f73 = f5 + f9;
  601|  1.09M|    f74 = f13 - f17;
  602|  1.09M|    f75 = f13 + f17;
  603|  1.09M|    f76 = f21 - f25;
  604|  1.09M|    f77 = f21 + f25;
  605|  1.09M|    f78 = MUL_F(FRAC_CONST(0.7071067811865476), f75);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  606|  1.09M|    f79 = f1 - f78;
  607|  1.09M|    f80 = f1 + f78;
  608|  1.09M|    f81 = f73 + f77;
  609|  1.09M|    f82 = MUL_C(COEF_CONST(1.3065629648763766), f73);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  610|  1.09M|    f83 = MUL_F(FRAC_CONST(-0.9238795325112866), f81);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  611|  1.09M|    f84 = MUL_F(FRAC_CONST(-0.5411961001461967), f77);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  612|  1.09M|    f85 = f82 + f83;
  613|  1.09M|    f86 = f84 - f83;
  614|  1.09M|    f87 = f80 - f86;
  615|  1.09M|    f88 = f80 + f86;
  616|  1.09M|    f89 = f79 - f85;
  617|  1.09M|    f90 = f79 + f85;
  618|  1.09M|    f91 = MUL_F(FRAC_CONST(0.7071067811865476), f74);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  619|  1.09M|    f92 = f29 - f91;
  620|  1.09M|    f93 = f29 + f91;
  621|  1.09M|    f94 = f76 + f72;
  622|  1.09M|    f95 = MUL_C(COEF_CONST(1.3065629648763766), f76);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  623|  1.09M|    f96 = MUL_F(FRAC_CONST(-0.9238795325112866), f94);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  624|  1.09M|    f97 = MUL_F(FRAC_CONST(-0.5411961001461967), f72);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  625|  1.09M|    f98 = f95 + f96;
  626|  1.09M|    f99 = f97 - f96;
  627|  1.09M|    f100 = f93 - f99;
  628|  1.09M|    f101 = f93 + f99;
  629|  1.09M|    f102 = f92 - f98;
  630|  1.09M|    f103 = f92 + f98;
  631|  1.09M|    f104 = f101 + f88;
  632|  1.09M|    f105 = MUL_F(FRAC_CONST(-0.8971675863426361), f101);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  633|  1.09M|    f106 = MUL_F(FRAC_CONST(0.9951847266721968), f104);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  634|  1.09M|    f107 = MUL_C(COEF_CONST(1.0932018670017576), f88);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  635|  1.09M|    f108 = f105 + f106;
  636|  1.09M|    f109 = f107 - f106;
  637|  1.09M|    f110 = f90 - f103;
  638|  1.09M|    f111 = MUL_F(FRAC_CONST(-0.6666556584777466), f103);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  639|  1.09M|    f112 = MUL_F(FRAC_CONST(0.9569403357322089), f110);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  640|  1.09M|    f113 = MUL_C(COEF_CONST(1.2472250129866713), f90);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  641|  1.09M|    f114 = f112 - f111;
  642|  1.09M|    f115 = f113 - f112;
  643|  1.09M|    f116 = f102 + f89;
  644|  1.09M|    f117 = MUL_F(FRAC_CONST(-0.4105245275223571), f102);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  645|  1.09M|    f118 = MUL_F(FRAC_CONST(0.8819212643483549), f116);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  646|  1.09M|    f119 = MUL_C(COEF_CONST(1.3533180011743529), f89);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  647|  1.09M|    f120 = f117 + f118;
  648|  1.09M|    f121 = f119 - f118;
  649|  1.09M|    f122 = f87 - f100;
  650|  1.09M|    f123 = MUL_F(FRAC_CONST(-0.1386171691990915), f100);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  651|  1.09M|    f124 = MUL_F(FRAC_CONST(0.7730104533627370), f122);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  652|  1.09M|    f125 = MUL_C(COEF_CONST(1.4074037375263826), f87);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  653|  1.09M|    f126 = f124 - f123;
  654|  1.09M|    f127 = f125 - f124;
  655|  1.09M|    f128 = f65 - f108;
  656|  1.09M|    f129 = f65 + f108;
  657|  1.09M|    f130 = f67 - f114;
  658|  1.09M|    f131 = f67 + f114;
  659|  1.09M|    f132 = f69 - f120;
  660|  1.09M|    f133 = f69 + f120;
  661|  1.09M|    f134 = f71 - f126;
  662|  1.09M|    f135 = f71 + f126;
  663|  1.09M|    f136 = f70 - f127;
  664|  1.09M|    f137 = f70 + f127;
  665|  1.09M|    f138 = f68 - f121;
  666|  1.09M|    f139 = f68 + f121;
  667|  1.09M|    f140 = f66 - f115;
  668|  1.09M|    f141 = f66 + f115;
  669|  1.09M|    f142 = f64 - f109;
  670|  1.09M|    f143 = f64 + f109;
  671|  1.09M|    f144 = f0 + f30;
  672|  1.09M|    f145 = MUL_C(COEF_CONST(1.0478631305325901), f0);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  673|  1.09M|    f146 = MUL_F(FRAC_CONST(-0.9987954562051724), f144);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  674|  1.09M|    f147 = MUL_F(FRAC_CONST(-0.9497277818777548), f30);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  675|  1.09M|    f148 = f145 + f146;
  676|  1.09M|    f149 = f147 - f146;
  677|  1.09M|    f150 = f4 + f26;
  678|  1.09M|    f151 = MUL_C(COEF_CONST(1.2130114330978077), f4);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  679|  1.09M|    f152 = MUL_F(FRAC_CONST(-0.9700312531945440), f150);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  680|  1.09M|    f153 = MUL_F(FRAC_CONST(-0.7270510732912803), f26);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  681|  1.09M|    f154 = f151 + f152;
  682|  1.09M|    f155 = f153 - f152;
  683|  1.09M|    f156 = f8 + f22;
  684|  1.09M|    f157 = MUL_C(COEF_CONST(1.3315443865537255), f8);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  685|  1.09M|    f158 = MUL_F(FRAC_CONST(-0.9039892931234433), f156);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  686|  1.09M|    f159 = MUL_F(FRAC_CONST(-0.4764341996931612), f22);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  687|  1.09M|    f160 = f157 + f158;
  688|  1.09M|    f161 = f159 - f158;
  689|  1.09M|    f162 = f12 + f18;
  690|  1.09M|    f163 = MUL_C(COEF_CONST(1.3989068359730781), f12);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  691|  1.09M|    f164 = MUL_F(FRAC_CONST(-0.8032075314806453), f162);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  692|  1.09M|    f165 = MUL_F(FRAC_CONST(-0.2075082269882124), f18);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  693|  1.09M|    f166 = f163 + f164;
  694|  1.09M|    f167 = f165 - f164;
  695|  1.09M|    f168 = f16 + f14;
  696|  1.09M|    f169 = MUL_C(COEF_CONST(1.4125100802019777), f16);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  697|  1.09M|    f170 = MUL_F(FRAC_CONST(-0.6715589548470187), f168);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  698|  1.09M|    f171 = MUL_F(FRAC_CONST(0.0693921705079402), f14);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  699|  1.09M|    f172 = f169 + f170;
  700|  1.09M|    f173 = f171 - f170;
  701|  1.09M|    f174 = f20 + f10;
  702|  1.09M|    f175 = MUL_C(COEF_CONST(1.3718313541934939), f20);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  703|  1.09M|    f176 = MUL_F(FRAC_CONST(-0.5141027441932219), f174);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  704|  1.09M|    f177 = MUL_F(FRAC_CONST(0.3436258658070501), f10);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  705|  1.09M|    f178 = f175 + f176;
  706|  1.09M|    f179 = f177 - f176;
  707|  1.09M|    f180 = f24 + f6;
  708|  1.09M|    f181 = MUL_C(COEF_CONST(1.2784339185752409), f24);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  709|  1.09M|    f182 = MUL_F(FRAC_CONST(-0.3368898533922200), f180);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  710|  1.09M|    f183 = MUL_F(FRAC_CONST(0.6046542117908008), f6);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  711|  1.09M|    f184 = f181 + f182;
  712|  1.09M|    f185 = f183 - f182;
  713|  1.09M|    f186 = f28 + f2;
  714|  1.09M|    f187 = MUL_C(COEF_CONST(1.1359069844201433), f28);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  715|  1.09M|    f188 = MUL_F(FRAC_CONST(-0.1467304744553624), f186);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  716|  1.09M|    f189 = MUL_F(FRAC_CONST(0.8424460355094185), f2);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  717|  1.09M|    f190 = f187 + f188;
  718|  1.09M|    f191 = f189 - f188;
  719|  1.09M|    f192 = f149 - f173;
  720|  1.09M|    f193 = f149 + f173;
  721|  1.09M|    f194 = f148 - f172;
  722|  1.09M|    f195 = f148 + f172;
  723|  1.09M|    f196 = f155 - f179;
  724|  1.09M|    f197 = f155 + f179;
  725|  1.09M|    f198 = f154 - f178;
  726|  1.09M|    f199 = f154 + f178;
  727|  1.09M|    f200 = f161 - f185;
  728|  1.09M|    f201 = f161 + f185;
  729|  1.09M|    f202 = f160 - f184;
  730|  1.09M|    f203 = f160 + f184;
  731|  1.09M|    f204 = f167 - f191;
  732|  1.09M|    f205 = f167 + f191;
  733|  1.09M|    f206 = f166 - f190;
  734|  1.09M|    f207 = f166 + f190;
  735|  1.09M|    f208 = f192 + f194;
  736|  1.09M|    f209 = MUL_C(COEF_CONST(1.1758756024193588), f192);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  737|  1.09M|    f210 = MUL_F(FRAC_CONST(-0.9807852804032304), f208);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  738|  1.09M|    f211 = MUL_F(FRAC_CONST(-0.7856949583871021), f194);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  739|  1.09M|    f212 = f209 + f210;
  740|  1.09M|    f213 = f211 - f210;
  741|  1.09M|    f214 = f196 + f198;
  742|  1.09M|    f215 = MUL_C(COEF_CONST(1.3870398453221475), f196);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  743|  1.09M|    f216 = MUL_F(FRAC_CONST(-0.5555702330196022), f214);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  744|  1.09M|    f217 = MUL_F(FRAC_CONST(0.2758993792829431), f198);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  745|  1.09M|    f218 = f215 + f216;
  746|  1.09M|    f219 = f217 - f216;
  747|  1.09M|    f220 = f200 + f202;
  748|  1.09M|    f221 = MUL_F(FRAC_CONST(0.7856949583871022), f200);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  749|  1.09M|    f222 = MUL_F(FRAC_CONST(0.1950903220161283), f220);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  750|  1.09M|    f223 = MUL_C(COEF_CONST(1.1758756024193586), f202);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  751|  1.09M|    f224 = f221 + f222;
  752|  1.09M|    f225 = f223 - f222;
  753|  1.09M|    f226 = f204 + f206;
  754|  1.09M|    f227 = MUL_F(FRAC_CONST(-0.2758993792829430), f204);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  755|  1.09M|    f228 = MUL_F(FRAC_CONST(0.8314696123025452), f226);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  756|  1.09M|    f229 = MUL_C(COEF_CONST(1.3870398453221475), f206);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  757|  1.09M|    f230 = f227 + f228;
  758|  1.09M|    f231 = f229 - f228;
  759|  1.09M|    f232 = f193 - f201;
  760|  1.09M|    f233 = f193 + f201;
  761|  1.09M|    f234 = f195 - f203;
  762|  1.09M|    f235 = f195 + f203;
  763|  1.09M|    f236 = f197 - f205;
  764|  1.09M|    f237 = f197 + f205;
  765|  1.09M|    f238 = f199 - f207;
  766|  1.09M|    f239 = f199 + f207;
  767|  1.09M|    f240 = f213 - f225;
  768|  1.09M|    f241 = f213 + f225;
  769|  1.09M|    f242 = f212 - f224;
  770|  1.09M|    f243 = f212 + f224;
  771|  1.09M|    f244 = f219 - f231;
  772|  1.09M|    f245 = f219 + f231;
  773|  1.09M|    f246 = f218 - f230;
  774|  1.09M|    f247 = f218 + f230;
  775|  1.09M|    f248 = f232 + f234;
  776|  1.09M|    f249 = MUL_C(COEF_CONST(1.3065629648763766), f232);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  777|  1.09M|    f250 = MUL_F(FRAC_CONST(-0.9238795325112866), f248);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  778|  1.09M|    f251 = MUL_F(FRAC_CONST(-0.5411961001461967), f234);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  779|  1.09M|    f252 = f249 + f250;
  780|  1.09M|    f253 = f251 - f250;
  781|  1.09M|    f254 = f236 + f238;
  782|  1.09M|    f255 = MUL_F(FRAC_CONST(0.5411961001461969), f236);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  783|  1.09M|    f256 = MUL_F(FRAC_CONST(0.3826834323650898), f254);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  784|  1.09M|    f257 = MUL_C(COEF_CONST(1.3065629648763766), f238);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  785|  1.09M|    f258 = f255 + f256;
  786|  1.09M|    f259 = f257 - f256;
  787|  1.09M|    f260 = f240 + f242;
  788|  1.09M|    f261 = MUL_C(COEF_CONST(1.3065629648763766), f240);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  789|  1.09M|    f262 = MUL_F(FRAC_CONST(-0.9238795325112866), f260);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  790|  1.09M|    f263 = MUL_F(FRAC_CONST(-0.5411961001461967), f242);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  791|  1.09M|    f264 = f261 + f262;
  792|  1.09M|    f265 = f263 - f262;
  793|  1.09M|    f266 = f244 + f246;
  794|  1.09M|    f267 = MUL_F(FRAC_CONST(0.5411961001461969), f244);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  795|  1.09M|    f268 = MUL_F(FRAC_CONST(0.3826834323650898), f266);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  796|  1.09M|    f269 = MUL_C(COEF_CONST(1.3065629648763766), f246);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  797|  1.09M|    f270 = f267 + f268;
  798|  1.09M|    f271 = f269 - f268;
  799|  1.09M|    f272 = f233 - f237;
  800|  1.09M|    f273 = f233 + f237;
  801|  1.09M|    f274 = f235 - f239;
  802|  1.09M|    f275 = f235 + f239;
  803|  1.09M|    f276 = f253 - f259;
  804|  1.09M|    f277 = f253 + f259;
  805|  1.09M|    f278 = f252 - f258;
  806|  1.09M|    f279 = f252 + f258;
  807|  1.09M|    f280 = f241 - f245;
  808|  1.09M|    f281 = f241 + f245;
  809|  1.09M|    f282 = f243 - f247;
  810|  1.09M|    f283 = f243 + f247;
  811|  1.09M|    f284 = f265 - f271;
  812|  1.09M|    f285 = f265 + f271;
  813|  1.09M|    f286 = f264 - f270;
  814|  1.09M|    f287 = f264 + f270;
  815|  1.09M|    f288 = f272 - f274;
  816|  1.09M|    f289 = f272 + f274;
  817|  1.09M|    f290 = MUL_F(FRAC_CONST(0.7071067811865474), f288);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  818|  1.09M|    f291 = MUL_F(FRAC_CONST(0.7071067811865474), f289);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  819|  1.09M|    f292 = f276 - f278;
  820|  1.09M|    f293 = f276 + f278;
  821|  1.09M|    f294 = MUL_F(FRAC_CONST(0.7071067811865474), f292);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  822|  1.09M|    f295 = MUL_F(FRAC_CONST(0.7071067811865474), f293);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  823|  1.09M|    f296 = f280 - f282;
  824|  1.09M|    f297 = f280 + f282;
  825|  1.09M|    f298 = MUL_F(FRAC_CONST(0.7071067811865474), f296);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  826|  1.09M|    f299 = MUL_F(FRAC_CONST(0.7071067811865474), f297);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  827|  1.09M|    f300 = f284 - f286;
  828|  1.09M|    f301 = f284 + f286;
  829|  1.09M|    f302 = MUL_F(FRAC_CONST(0.7071067811865474), f300);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  830|  1.09M|    f303 = MUL_F(FRAC_CONST(0.7071067811865474), f301);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  831|  1.09M|    f304 = f129 - f273;
  832|  1.09M|    f305 = f129 + f273;
  833|  1.09M|    f306 = f131 - f281;
  834|  1.09M|    f307 = f131 + f281;
  835|  1.09M|    f308 = f133 - f285;
  836|  1.09M|    f309 = f133 + f285;
  837|  1.09M|    f310 = f135 - f277;
  838|  1.09M|    f311 = f135 + f277;
  839|  1.09M|    f312 = f137 - f295;
  840|  1.09M|    f313 = f137 + f295;
  841|  1.09M|    f314 = f139 - f303;
  842|  1.09M|    f315 = f139 + f303;
  843|  1.09M|    f316 = f141 - f299;
  844|  1.09M|    f317 = f141 + f299;
  845|  1.09M|    f318 = f143 - f291;
  846|  1.09M|    f319 = f143 + f291;
  847|  1.09M|    f320 = f142 - f290;
  848|  1.09M|    f321 = f142 + f290;
  849|  1.09M|    f322 = f140 - f298;
  850|  1.09M|    f323 = f140 + f298;
  851|  1.09M|    f324 = f138 - f302;
  852|  1.09M|    f325 = f138 + f302;
  853|  1.09M|    f326 = f136 - f294;
  854|  1.09M|    f327 = f136 + f294;
  855|  1.09M|    f328 = f134 - f279;
  856|  1.09M|    f329 = f134 + f279;
  857|  1.09M|    f330 = f132 - f287;
  858|  1.09M|    f331 = f132 + f287;
  859|  1.09M|    f332 = f130 - f283;
  860|  1.09M|    f333 = f130 + f283;
  861|  1.09M|    f334 = f128 - f275;
  862|  1.09M|    f335 = f128 + f275;
  863|  1.09M|    y[31] = MUL_F(FRAC_CONST(0.5001506360206510), f305);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  864|  1.09M|    y[30] = MUL_F(FRAC_CONST(0.5013584524464084), f307);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  865|  1.09M|    y[29] = MUL_F(FRAC_CONST(0.5037887256810443), f309);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  866|  1.09M|    y[28] = MUL_F(FRAC_CONST(0.5074711720725553), f311);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  867|  1.09M|    y[27] = MUL_F(FRAC_CONST(0.5124514794082247), f313);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  868|  1.09M|    y[26] = MUL_F(FRAC_CONST(0.5187927131053328), f315);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  869|  1.09M|    y[25] = MUL_F(FRAC_CONST(0.5265773151542700), f317);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  870|  1.09M|    y[24] = MUL_F(FRAC_CONST(0.5359098169079920), f319);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  871|  1.09M|    y[23] = MUL_F(FRAC_CONST(0.5469204379855088), f321);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  872|  1.09M|    y[22] = MUL_F(FRAC_CONST(0.5597698129470802), f323);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  873|  1.09M|    y[21] = MUL_F(FRAC_CONST(0.5746551840326600), f325);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  874|  1.09M|    y[20] = MUL_F(FRAC_CONST(0.5918185358574165), f327);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  875|  1.09M|    y[19] = MUL_F(FRAC_CONST(0.6115573478825099), f329);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  876|  1.09M|    y[18] = MUL_F(FRAC_CONST(0.6342389366884031), f331);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  877|  1.09M|    y[17] = MUL_F(FRAC_CONST(0.6603198078137061), f333);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  878|  1.09M|    y[16] = MUL_F(FRAC_CONST(0.6903721282002123), f335);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  879|  1.09M|    y[15] = MUL_F(FRAC_CONST(0.7251205223771985), f334);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  880|  1.09M|    y[14] = MUL_F(FRAC_CONST(0.7654941649730891), f332);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  881|  1.09M|    y[13] = MUL_F(FRAC_CONST(0.8127020908144905), f330);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  882|  1.09M|    y[12] = MUL_F(FRAC_CONST(0.8683447152233481), f328);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  883|  1.09M|    y[11] = MUL_F(FRAC_CONST(0.9345835970364075), f326);
  ------------------
  |  |  286|  1.09M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  884|  1.09M|    y[10] = MUL_C(COEF_CONST(1.0144082649970547), f324);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  885|  1.09M|    y[9] = MUL_C(COEF_CONST(1.1120716205797176), f322);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  886|  1.09M|    y[8] = MUL_C(COEF_CONST(1.2338327379765710), f320);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  887|  1.09M|    y[7] = MUL_C(COEF_CONST(1.3892939586328277), f318);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  888|  1.09M|    y[6] = MUL_C(COEF_CONST(1.5939722833856311), f316);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  889|  1.09M|    y[5] = MUL_C(COEF_CONST(1.8746759800084078), f314);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  890|  1.09M|    y[4] = MUL_C(COEF_CONST(2.2820500680051619), f312);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  891|  1.09M|    y[3] = MUL_C(COEF_CONST(2.9246284281582162), f310);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  892|  1.09M|    y[2] = MUL_C(COEF_CONST(4.0846110781292477), f308);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  893|  1.09M|    y[1] = MUL_C(COEF_CONST(6.7967507116736332), f306);
  ------------------
  |  |  285|  1.09M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  894|  1.09M|    y[0] = MUL_R(REAL_CONST(20.3738781672314530), f304);
  ------------------
  |  |  284|  1.09M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  895|  1.09M|}
dct4_kernel:
 2226|  7.39M|{
 2227|       |    // Tables with bit reverse values for 5 bits, bit reverse of i at i-th position
 2228|  7.39M|    const uint8_t bit_rev_tab[32] = { 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 };
 2229|  7.39M|    uint32_t i, i_rev;
 2230|       |
 2231|       |    /* Step 2: modulate */
 2232|       |    // 3*32=96 multiplications
 2233|       |    // 3*32=96 additions
 2234|   244M|    for (i = 0; i < 32; i++)
  ------------------
  |  Branch (2234:17): [True: 236M, False: 7.39M]
  ------------------
 2235|   236M|    {
 2236|   236M|    	real_t x_re, x_im, tmp;
 2237|   236M|    	x_re = in_real[i];
 2238|   236M|    	x_im = in_imag[i];
 2239|   236M|        tmp =        MUL_C(x_re + x_im, dct4_64_tab[i]);
  ------------------
  |  |  285|   236M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2240|   236M|        in_real[i] = MUL_C(x_im, dct4_64_tab[i + 64]) + tmp;
  ------------------
  |  |  285|   236M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2241|   236M|        in_imag[i] = MUL_C(x_re, dct4_64_tab[i + 32]) + tmp;
  ------------------
  |  |  285|   236M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2242|   236M|    }
 2243|       |
 2244|       |    /* Step 3: FFT, but with output in bit reverse order */
 2245|  7.39M|    fft_dif(in_real, in_imag);
 2246|       |
 2247|       |    /* Step 4: modulate + bitreverse reordering */
 2248|       |    // 3*31+2=95 multiplications
 2249|       |    // 3*31+2=95 additions
 2250|   125M|    for (i = 0; i < 16; i++)
  ------------------
  |  Branch (2250:17): [True: 118M, False: 7.39M]
  ------------------
 2251|   118M|    {
 2252|   118M|    	real_t x_re, x_im, tmp;
 2253|   118M|    	i_rev = bit_rev_tab[i];
 2254|   118M|    	x_re = in_real[i_rev];
 2255|   118M|    	x_im = in_imag[i_rev];
 2256|       |
 2257|   118M|        tmp =         MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
  ------------------
  |  |  285|   118M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2258|   118M|        out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
  ------------------
  |  |  285|   118M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2259|   118M|        out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
  ------------------
  |  |  285|   118M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2260|   118M|    }
 2261|       |    // i = 16, i_rev = 1 = rev(16);
 2262|  7.39M|    out_imag[16] = MUL_C(in_imag[1] - in_real[1], dct4_64_tab[16 + 3*32]);
  ------------------
  |  |  285|  7.39M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2263|  7.39M|    out_real[16] = MUL_C(in_real[1] + in_imag[1], dct4_64_tab[16 + 3*32]);
  ------------------
  |  |  285|  7.39M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2264|   118M|    for (i = 17; i < 32; i++)
  ------------------
  |  Branch (2264:18): [True: 110M, False: 7.39M]
  ------------------
 2265|   110M|    {
 2266|   110M|    	real_t x_re, x_im, tmp;
 2267|   110M|    	i_rev = bit_rev_tab[i];
 2268|   110M|    	x_re = in_real[i_rev];
 2269|   110M|    	x_im = in_imag[i_rev];
 2270|   110M|        tmp =         MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
  ------------------
  |  |  285|   110M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2271|   110M|        out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
  ------------------
  |  |  285|   110M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2272|   110M|        out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
  ------------------
  |  |  285|   110M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 2273|   110M|    }
 2274|       |
 2275|  7.39M|}
sbr_dct.c:fft_dif:
 1899|  7.39M|{
 1900|  7.39M|    real_t w_real, w_imag; // For faster access
 1901|  7.39M|    real_t point1_real, point1_imag, point2_real, point2_imag; // For faster access
 1902|  7.39M|    uint32_t j, i, i2, w_index; // Counters
 1903|       |
 1904|       |    // First 2 stages of 32 point FFT decimation in frequency
 1905|       |    // 4*16*2=64*2=128 multiplications
 1906|       |    // 6*16*2=96*2=192 additions
 1907|       |	// Stage 1 of 32 point FFT decimation in frequency
 1908|   125M|    for (i = 0; i < 16; i++)
  ------------------
  |  Branch (1908:17): [True: 118M, False: 7.39M]
  ------------------
 1909|   118M|    {
 1910|   118M|        point1_real = Real[i];
 1911|   118M|        point1_imag = Imag[i];
 1912|   118M|        i2 = i+16;
 1913|   118M|        point2_real = Real[i2];
 1914|   118M|        point2_imag = Imag[i2];
 1915|       |
 1916|   118M|        w_real = w_array_real[i];
 1917|   118M|        w_imag = w_array_imag[i];
 1918|       |
 1919|       |        // temp1 = x[i] - x[i2]
 1920|   118M|        point1_real -= point2_real;
 1921|   118M|        point1_imag -= point2_imag;
 1922|       |
 1923|       |        // x[i1] = x[i] + x[i2]
 1924|   118M|        Real[i] += point2_real;
 1925|   118M|        Imag[i] += point2_imag;
 1926|       |
 1927|       |        // x[i2] = (x[i] - x[i2]) * w
 1928|   118M|        Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
  ------------------
  |  |  286|   118M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
  ------------------
  |  |  286|   118M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1929|   118M|        Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
  ------------------
  |  |  286|   118M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
  ------------------
  |  |  286|   118M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1930|   118M|     }
 1931|       |    // Stage 2 of 32 point FFT decimation in frequency
 1932|  66.5M|    for (j = 0, w_index = 0; j < 8; j++, w_index += 2)
  ------------------
  |  Branch (1932:30): [True: 59.1M, False: 7.39M]
  ------------------
 1933|  59.1M|    {
 1934|  59.1M|        w_real = w_array_real[w_index];
 1935|  59.1M|        w_imag = w_array_imag[w_index];
 1936|       |
 1937|  59.1M|    	i = j;
 1938|  59.1M|        point1_real = Real[i];
 1939|  59.1M|        point1_imag = Imag[i];
 1940|  59.1M|        i2 = i+8;
 1941|  59.1M|        point2_real = Real[i2];
 1942|  59.1M|        point2_imag = Imag[i2];
 1943|       |
 1944|       |        // temp1 = x[i] - x[i2]
 1945|  59.1M|        point1_real -= point2_real;
 1946|  59.1M|        point1_imag -= point2_imag;
 1947|       |
 1948|       |        // x[i1] = x[i] + x[i2]
 1949|  59.1M|        Real[i] += point2_real;
 1950|  59.1M|        Imag[i] += point2_imag;
 1951|       |
 1952|       |        // x[i2] = (x[i] - x[i2]) * w
 1953|  59.1M|        Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1954|  59.1M|        Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1955|       |
 1956|  59.1M|        i = j+16;
 1957|  59.1M|        point1_real = Real[i];
 1958|  59.1M|        point1_imag = Imag[i];
 1959|  59.1M|        i2 = i+8;
 1960|  59.1M|        point2_real = Real[i2];
 1961|  59.1M|        point2_imag = Imag[i2];
 1962|       |
 1963|       |        // temp1 = x[i] - x[i2]
 1964|  59.1M|        point1_real -= point2_real;
 1965|  59.1M|        point1_imag -= point2_imag;
 1966|       |
 1967|       |        // x[i1] = x[i] + x[i2]
 1968|  59.1M|        Real[i] += point2_real;
 1969|  59.1M|        Imag[i] += point2_imag;
 1970|       |
 1971|       |        // x[i2] = (x[i] - x[i2]) * w
 1972|  59.1M|        Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1973|  59.1M|        Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                      Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
  ------------------
  |  |  286|  59.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1974|  59.1M|    }
 1975|       |
 1976|       |    // Stage 3 of 32 point FFT decimation in frequency
 1977|       |    // 2*4*2=16 multiplications
 1978|       |    // 4*4*2+6*4*2=10*8=80 additions
 1979|  36.9M|    for (i = 0; i < n; i += 8)
  ------------------
  |  | 1868|  36.9M|#define n 32
  ------------------
  |  Branch (1979:17): [True: 29.5M, False: 7.39M]
  ------------------
 1980|  29.5M|    {
 1981|  29.5M|        i2 = i+4;
 1982|  29.5M|        point1_real = Real[i];
 1983|  29.5M|        point1_imag = Imag[i];
 1984|       |
 1985|  29.5M|        point2_real = Real[i2];
 1986|  29.5M|        point2_imag = Imag[i2];
 1987|       |
 1988|       |        // out[i1] = point1 + point2
 1989|  29.5M|        Real[i] += point2_real;
 1990|  29.5M|        Imag[i] += point2_imag;
 1991|       |
 1992|       |        // out[i2] = point1 - point2
 1993|  29.5M|        Real[i2] = point1_real - point2_real;
 1994|  29.5M|        Imag[i2] = point1_imag - point2_imag;
 1995|  29.5M|    }
 1996|  7.39M|    w_real = w_array_real[4]; // = sqrt(2)/2
 1997|       |    // w_imag = -w_real; // = w_array_imag[4]; // = -sqrt(2)/2
 1998|  36.9M|    for (i = 1; i < n; i += 8)
  ------------------
  |  | 1868|  36.9M|#define n 32
  ------------------
  |  Branch (1998:17): [True: 29.5M, False: 7.39M]
  ------------------
 1999|  29.5M|    {
 2000|  29.5M|        i2 = i+4;
 2001|  29.5M|        point1_real = Real[i];
 2002|  29.5M|        point1_imag = Imag[i];
 2003|       |
 2004|  29.5M|        point2_real = Real[i2];
 2005|  29.5M|        point2_imag = Imag[i2];
 2006|       |
 2007|       |        // temp1 = x[i] - x[i2]
 2008|  29.5M|        point1_real -= point2_real;
 2009|  29.5M|        point1_imag -= point2_imag;
 2010|       |
 2011|       |        // x[i1] = x[i] + x[i2]
 2012|  29.5M|        Real[i] += point2_real;
 2013|  29.5M|        Imag[i] += point2_imag;
 2014|       |
 2015|       |        // x[i2] = (x[i] - x[i2]) * w
 2016|  29.5M|        Real[i2] = MUL_F(point1_real+point1_imag, w_real);
  ------------------
  |  |  286|  29.5M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 2017|  29.5M|        Imag[i2] = MUL_F(point1_imag-point1_real, w_real);
  ------------------
  |  |  286|  29.5M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 2018|  29.5M|    }
 2019|  36.9M|    for (i = 2; i < n; i += 8)
  ------------------
  |  | 1868|  36.9M|#define n 32
  ------------------
  |  Branch (2019:17): [True: 29.5M, False: 7.39M]
  ------------------
 2020|  29.5M|    {
 2021|  29.5M|        i2 = i+4;
 2022|  29.5M|        point1_real = Real[i];
 2023|  29.5M|        point1_imag = Imag[i];
 2024|       |
 2025|  29.5M|        point2_real = Real[i2];
 2026|  29.5M|        point2_imag = Imag[i2];
 2027|       |
 2028|       |        // x[i] = x[i] + x[i2]
 2029|  29.5M|        Real[i] += point2_real;
 2030|  29.5M|        Imag[i] += point2_imag;
 2031|       |
 2032|       |        // x[i2] = (x[i] - x[i2]) * (-i)
 2033|  29.5M|        Real[i2] = point1_imag - point2_imag;
 2034|  29.5M|        Imag[i2] = point2_real - point1_real;
 2035|  29.5M|    }
 2036|  7.39M|    w_real = w_array_real[12]; // = -sqrt(2)/2
 2037|       |    // w_imag = w_real; // = w_array_imag[12]; // = -sqrt(2)/2
 2038|  36.9M|    for (i = 3; i < n; i += 8)
  ------------------
  |  | 1868|  36.9M|#define n 32
  ------------------
  |  Branch (2038:17): [True: 29.5M, False: 7.39M]
  ------------------
 2039|  29.5M|    {
 2040|  29.5M|        i2 = i+4;
 2041|  29.5M|        point1_real = Real[i];
 2042|  29.5M|        point1_imag = Imag[i];
 2043|       |
 2044|  29.5M|        point2_real = Real[i2];
 2045|  29.5M|        point2_imag = Imag[i2];
 2046|       |
 2047|       |        // temp1 = x[i] - x[i2]
 2048|  29.5M|        point1_real -= point2_real;
 2049|  29.5M|        point1_imag -= point2_imag;
 2050|       |
 2051|       |        // x[i1] = x[i] + x[i2]
 2052|  29.5M|        Real[i] += point2_real;
 2053|  29.5M|        Imag[i] += point2_imag;
 2054|       |
 2055|       |        // x[i2] = (x[i] - x[i2]) * w
 2056|  29.5M|        Real[i2] = MUL_F(point1_real-point1_imag, w_real);
  ------------------
  |  |  286|  29.5M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 2057|  29.5M|        Imag[i2] = MUL_F(point1_real+point1_imag, w_real);
  ------------------
  |  |  286|  29.5M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 2058|  29.5M|    }
 2059|       |
 2060|       |
 2061|       |    // Stage 4 of 32 point FFT decimation in frequency (no multiplications)
 2062|       |    // 16*4=64 additions
 2063|  66.5M|    for (i = 0; i < n; i += 4)
  ------------------
  |  | 1868|  66.5M|#define n 32
  ------------------
  |  Branch (2063:17): [True: 59.1M, False: 7.39M]
  ------------------
 2064|  59.1M|    {
 2065|  59.1M|        i2 = i+2;
 2066|  59.1M|        point1_real = Real[i];
 2067|  59.1M|        point1_imag = Imag[i];
 2068|       |
 2069|  59.1M|        point2_real = Real[i2];
 2070|  59.1M|        point2_imag = Imag[i2];
 2071|       |
 2072|       |        // x[i1] = x[i] + x[i2]
 2073|  59.1M|        Real[i] += point2_real;
 2074|  59.1M|        Imag[i] += point2_imag;
 2075|       |
 2076|       |        // x[i2] = x[i] - x[i2]
 2077|  59.1M|        Real[i2] = point1_real - point2_real;
 2078|  59.1M|        Imag[i2] = point1_imag - point2_imag;
 2079|  59.1M|    }
 2080|  66.5M|    for (i = 1; i < n; i += 4)
  ------------------
  |  | 1868|  66.5M|#define n 32
  ------------------
  |  Branch (2080:17): [True: 59.1M, False: 7.39M]
  ------------------
 2081|  59.1M|    {
 2082|  59.1M|        i2 = i+2;
 2083|  59.1M|        point1_real = Real[i];
 2084|  59.1M|        point1_imag = Imag[i];
 2085|       |
 2086|  59.1M|        point2_real = Real[i2];
 2087|  59.1M|        point2_imag = Imag[i2];
 2088|       |
 2089|       |        // x[i] = x[i] + x[i2]
 2090|  59.1M|        Real[i] += point2_real;
 2091|  59.1M|        Imag[i] += point2_imag;
 2092|       |
 2093|       |        // x[i2] = (x[i] - x[i2]) * (-i)
 2094|  59.1M|        Real[i2] = point1_imag - point2_imag;
 2095|  59.1M|        Imag[i2] = point2_real - point1_real;
 2096|  59.1M|    }
 2097|       |
 2098|       |    // Stage 5 of 32 point FFT decimation in frequency (no multiplications)
 2099|       |    // 16*4=64 additions
 2100|   125M|    for (i = 0; i < n; i += 2)
  ------------------
  |  | 1868|   125M|#define n 32
  ------------------
  |  Branch (2100:17): [True: 118M, False: 7.39M]
  ------------------
 2101|   118M|    {
 2102|   118M|        i2 = i+1;
 2103|   118M|        point1_real = Real[i];
 2104|   118M|        point1_imag = Imag[i];
 2105|       |
 2106|   118M|        point2_real = Real[i2];
 2107|   118M|        point2_imag = Imag[i2];
 2108|       |
 2109|       |        // out[i1] = point1 + point2
 2110|   118M|        Real[i] += point2_real;
 2111|   118M|        Imag[i] += point2_imag;
 2112|       |
 2113|       |        // out[i2] = point1 - point2
 2114|   118M|        Real[i2] = point1_real - point2_real;
 2115|   118M|        Imag[i2] = point1_imag - point2_imag;
 2116|   118M|    }
 2117|       |
 2118|       |#ifdef REORDER_IN_FFT
 2119|       |    FFTReorder(Real, Imag);
 2120|       |#endif // #ifdef REORDER_IN_FFT
 2121|  7.39M|}

sbrDecodeInit:
   59|  68.6k|{
   60|  68.6k|    sbr_info *sbr = faad_malloc(sizeof(sbr_info));
   61|  68.6k|    memset(sbr, 0, sizeof(sbr_info));
   62|       |
   63|       |    /* save id of the parent element */
   64|  68.6k|    sbr->id_aac = id_aac;
   65|  68.6k|    sbr->sample_rate = sample_rate;
   66|       |
   67|  68.6k|    sbr->bs_freq_scale = 2;
   68|  68.6k|    sbr->bs_alter_scale = 1;
   69|  68.6k|    sbr->bs_noise_bands = 2;
   70|  68.6k|    sbr->bs_limiter_bands = 2;
   71|  68.6k|    sbr->bs_limiter_gains = 2;
   72|  68.6k|    sbr->bs_interpol_freq = 1;
   73|  68.6k|    sbr->bs_smoothing_mode = 1;
   74|  68.6k|    sbr->bs_start_freq = 5;
   75|  68.6k|    sbr->bs_amp_res = 1;
   76|  68.6k|    sbr->bs_samplerate_mode = 1;
   77|  68.6k|    sbr->prevEnvIsShort[0] = -1;
   78|  68.6k|    sbr->prevEnvIsShort[1] = -1;
   79|  68.6k|    sbr->header_count = 0;
   80|  68.6k|    sbr->Reset = 1;
   81|       |
   82|  68.6k|#ifdef DRM
   83|  68.6k|    sbr->Is_DRM_SBR = IsDRM;
   84|  68.6k|#endif
   85|  68.6k|    sbr->tHFGen = T_HFGEN;
  ------------------
  |  |   40|  68.6k|#define T_HFGEN 8
  ------------------
   86|  68.6k|    sbr->tHFAdj = T_HFADJ;
  ------------------
  |  |   41|  68.6k|#define T_HFADJ 2
  ------------------
   87|       |
   88|  68.6k|    sbr->bsco = 0;
   89|  68.6k|    sbr->bsco_prev = 0;
   90|  68.6k|    sbr->M_prev = 0;
   91|  68.6k|    sbr->frame_len = framelength;
   92|       |
   93|       |    /* force sbr reset */
   94|  68.6k|    sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  68.6k|#define INVALID ((uint8_t)-1)
  ------------------
   95|       |
   96|  68.6k|    if (framelength == 960)
  ------------------
  |  Branch (96:9): [True: 13.3k, False: 55.3k]
  ------------------
   97|  13.3k|    {
   98|  13.3k|        sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
  ------------------
  |  |   56|  13.3k|#define RATE              2
  ------------------
                      sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
  ------------------
  |  |   54|  13.3k|#define NO_TIME_SLOTS_960 15
  ------------------
   99|  13.3k|        sbr->numTimeSlots = NO_TIME_SLOTS_960;
  ------------------
  |  |   54|  13.3k|#define NO_TIME_SLOTS_960 15
  ------------------
  100|  13.3k|    }
  101|  55.3k|    else if (framelength == 1024)
  ------------------
  |  Branch (101:14): [True: 55.3k, False: 0]
  ------------------
  102|  55.3k|    {
  103|  55.3k|        sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
  ------------------
  |  |   56|  55.3k|#define RATE              2
  ------------------
                      sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
  ------------------
  |  |   55|  55.3k|#define NO_TIME_SLOTS     16
  ------------------
  104|  55.3k|        sbr->numTimeSlots = NO_TIME_SLOTS;
  ------------------
  |  |   55|  55.3k|#define NO_TIME_SLOTS     16
  ------------------
  105|  55.3k|    }
  106|      0|    else
  107|      0|    {
  108|      0|        faad_free(sbr);
  109|      0|        return NULL;
  110|      0|    }
  111|       |
  112|  68.6k|    sbr->GQ_ringbuf_index[0] = 0;
  113|  68.6k|    sbr->GQ_ringbuf_index[1] = 0;
  114|       |
  115|  68.6k|    if (id_aac == ID_CPE)
  ------------------
  |  |   87|  68.6k|#define ID_CPE 0x1
  ------------------
  |  Branch (115:9): [True: 12.8k, False: 55.8k]
  ------------------
  116|  12.8k|    {
  117|       |        /* stereo */
  118|  12.8k|        uint8_t j;
  119|  12.8k|        sbr->qmfa[0] = qmfa_init(32);
  120|  12.8k|        sbr->qmfa[1] = qmfa_init(32);
  121|  12.8k|        sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (121:34): [True: 3.44k, False: 9.37k]
  ------------------
  122|  12.8k|        sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (122:34): [True: 3.44k, False: 9.37k]
  ------------------
  123|       |
  124|  76.9k|        for (j = 0; j < 5; j++)
  ------------------
  |  Branch (124:21): [True: 64.0k, False: 12.8k]
  ------------------
  125|  64.0k|        {
  126|  64.0k|            sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  127|  64.0k|            sbr->G_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
  128|  64.0k|            sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  129|  64.0k|            sbr->Q_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
  130|  64.0k|        }
  131|       |
  132|  12.8k|        memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  133|  12.8k|        memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  134|  55.8k|    } else {
  135|       |        /* mono */
  136|  55.8k|        uint8_t j;
  137|  55.8k|        sbr->qmfa[0] = qmfa_init(32);
  138|  55.8k|        sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (138:34): [True: 21.5k, False: 34.3k]
  ------------------
  139|  55.8k|        sbr->qmfs[1] = NULL;
  140|       |
  141|   335k|        for (j = 0; j < 5; j++)
  ------------------
  |  Branch (141:21): [True: 279k, False: 55.8k]
  ------------------
  142|   279k|        {
  143|   279k|            sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  144|   279k|            sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  145|   279k|        }
  146|       |
  147|  55.8k|        memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  148|  55.8k|    }
  149|       |
  150|  68.6k|    return sbr;
  151|  68.6k|}
sbrDecodeEnd:
  154|  68.6k|{
  155|  68.6k|    uint8_t j;
  156|       |
  157|  68.6k|    if (sbr)
  ------------------
  |  Branch (157:9): [True: 68.6k, False: 0]
  ------------------
  158|  68.6k|    {
  159|  68.6k|        qmfa_end(sbr->qmfa[0]);
  160|  68.6k|        qmfs_end(sbr->qmfs[0]);
  161|  68.6k|        if (sbr->qmfs[1] != NULL)
  ------------------
  |  Branch (161:13): [True: 16.1k, False: 52.5k]
  ------------------
  162|  16.1k|        {
  163|  16.1k|            qmfa_end(sbr->qmfa[1]);
  164|  16.1k|            qmfs_end(sbr->qmfs[1]);
  165|  16.1k|        }
  166|       |
  167|   412k|        for (j = 0; j < 5; j++)
  ------------------
  |  Branch (167:21): [True: 343k, False: 68.6k]
  ------------------
  168|   343k|        {
  169|   343k|            if (sbr->G_temp_prev[0][j]) faad_free(sbr->G_temp_prev[0][j]);
  ------------------
  |  Branch (169:17): [True: 343k, False: 0]
  ------------------
  170|   343k|            if (sbr->Q_temp_prev[0][j]) faad_free(sbr->Q_temp_prev[0][j]);
  ------------------
  |  Branch (170:17): [True: 343k, False: 0]
  ------------------
  171|   343k|            if (sbr->G_temp_prev[1][j]) faad_free(sbr->G_temp_prev[1][j]);
  ------------------
  |  Branch (171:17): [True: 64.0k, False: 279k]
  ------------------
  172|   343k|            if (sbr->Q_temp_prev[1][j]) faad_free(sbr->Q_temp_prev[1][j]);
  ------------------
  |  Branch (172:17): [True: 64.0k, False: 279k]
  ------------------
  173|   343k|        }
  174|       |
  175|  68.6k|#ifdef PS_DEC
  176|  68.6k|        if (sbr->ps != NULL)
  ------------------
  |  Branch (176:13): [True: 7.54k, False: 61.1k]
  ------------------
  177|  7.54k|            ps_free(sbr->ps);
  178|  68.6k|#endif
  179|       |
  180|  68.6k|#ifdef DRM_PS
  181|  68.6k|        if (sbr->drm_ps != NULL)
  ------------------
  |  Branch (181:13): [True: 4.74k, False: 63.9k]
  ------------------
  182|  4.74k|            drm_ps_free(sbr->drm_ps);
  183|  68.6k|#endif
  184|       |
  185|  68.6k|        faad_free(sbr);
  186|  68.6k|    }
  187|  68.6k|}
sbrReset:
  190|  79.2k|{
  191|  79.2k|    uint8_t j;
  192|  79.2k|    if (sbr->qmfa[0] != NULL)
  ------------------
  |  Branch (192:9): [True: 79.2k, False: 0]
  ------------------
  193|  79.2k|        memset(sbr->qmfa[0]->x, 0, 2 * sbr->qmfa[0]->channels * 10 * sizeof(real_t));
  194|  79.2k|    if (sbr->qmfa[1] != NULL)
  ------------------
  |  Branch (194:9): [True: 14.7k, False: 64.4k]
  ------------------
  195|  14.7k|        memset(sbr->qmfa[1]->x, 0, 2 * sbr->qmfa[1]->channels * 10 * sizeof(real_t));
  196|  79.2k|    if (sbr->qmfs[0] != NULL)
  ------------------
  |  Branch (196:9): [True: 79.2k, False: 0]
  ------------------
  197|  79.2k|        memset(sbr->qmfs[0]->v, 0, 2 * sbr->qmfs[0]->channels * 20 * sizeof(real_t));
  198|  79.2k|    if (sbr->qmfs[1] != NULL)
  ------------------
  |  Branch (198:9): [True: 19.4k, False: 59.7k]
  ------------------
  199|  19.4k|        memset(sbr->qmfs[1]->v, 0, 2 * sbr->qmfs[1]->channels * 20 * sizeof(real_t));
  200|       |
  201|   475k|    for (j = 0; j < 5; j++)
  ------------------
  |  Branch (201:17): [True: 396k, False: 79.2k]
  ------------------
  202|   396k|    {
  203|   396k|        if (sbr->G_temp_prev[0][j] != NULL)
  ------------------
  |  Branch (203:13): [True: 396k, False: 0]
  ------------------
  204|   396k|            memset(sbr->G_temp_prev[0][j], 0, 64*sizeof(real_t));
  205|   396k|        if (sbr->G_temp_prev[1][j] != NULL)
  ------------------
  |  Branch (205:13): [True: 73.7k, False: 322k]
  ------------------
  206|  73.7k|            memset(sbr->G_temp_prev[1][j], 0, 64*sizeof(real_t));
  207|   396k|        if (sbr->Q_temp_prev[0][j] != NULL)
  ------------------
  |  Branch (207:13): [True: 396k, False: 0]
  ------------------
  208|   396k|            memset(sbr->Q_temp_prev[0][j], 0, 64*sizeof(real_t));
  209|   396k|        if (sbr->Q_temp_prev[1][j] != NULL)
  ------------------
  |  Branch (209:13): [True: 73.7k, False: 322k]
  ------------------
  210|  73.7k|            memset(sbr->Q_temp_prev[1][j], 0, 64*sizeof(real_t));
  211|   396k|    }
  212|       |
  213|  79.2k|    memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  214|  79.2k|    memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  215|       |
  216|  79.2k|    sbr->GQ_ringbuf_index[0] = 0;
  217|  79.2k|    sbr->GQ_ringbuf_index[1] = 0;
  218|  79.2k|    sbr->header_count = 0;
  219|  79.2k|    sbr->Reset = 1;
  220|       |
  221|  79.2k|    sbr->L_E_prev[0] = 0;
  222|  79.2k|    sbr->L_E_prev[1] = 0;
  223|  79.2k|    sbr->bs_freq_scale = 2;
  224|  79.2k|    sbr->bs_alter_scale = 1;
  225|  79.2k|    sbr->bs_noise_bands = 2;
  226|  79.2k|    sbr->bs_limiter_bands = 2;
  227|  79.2k|    sbr->bs_limiter_gains = 2;
  228|  79.2k|    sbr->bs_interpol_freq = 1;
  229|  79.2k|    sbr->bs_smoothing_mode = 1;
  230|  79.2k|    sbr->bs_start_freq = 5;
  231|  79.2k|    sbr->bs_amp_res = 1;
  232|  79.2k|    sbr->bs_samplerate_mode = 1;
  233|  79.2k|    sbr->prevEnvIsShort[0] = -1;
  234|  79.2k|    sbr->prevEnvIsShort[1] = -1;
  235|  79.2k|    sbr->bsco = 0;
  236|  79.2k|    sbr->bsco_prev = 0;
  237|  79.2k|    sbr->M_prev = 0;
  238|  79.2k|    sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  79.2k|#define INVALID ((uint8_t)-1)
  ------------------
  239|       |
  240|  79.2k|    sbr->f_prev[0] = 0;
  241|  79.2k|    sbr->f_prev[1] = 0;
  242|  3.96M|    for (j = 0; j < MAX_M; j++)
  ------------------
  |  |   50|  3.96M|#define MAX_M       49
  ------------------
  |  Branch (242:17): [True: 3.88M, False: 79.2k]
  ------------------
  243|  3.88M|    {
  244|  3.88M|        sbr->E_prev[0][j] = 0;
  245|  3.88M|        sbr->Q_prev[0][j] = 0;
  246|  3.88M|        sbr->E_prev[1][j] = 0;
  247|  3.88M|        sbr->Q_prev[1][j] = 0;
  248|  3.88M|        sbr->bs_add_harmonic_prev[0][j] = 0;
  249|  3.88M|        sbr->bs_add_harmonic_prev[1][j] = 0;
  250|  3.88M|    }
  251|  79.2k|    sbr->bs_add_harmonic_flag_prev[0] = 0;
  252|  79.2k|    sbr->bs_add_harmonic_flag_prev[1] = 0;
  253|  79.2k|}
sbrDecodeCoupleFrame:
  464|  15.8k|{
  465|  15.8k|    uint8_t dont_process = 0;
  466|  15.8k|    uint8_t ret = 0;
  467|  15.8k|    ALIGN qmf_t X[MAX_NTSRHFG][64];
  ------------------
  |  |  167|  15.8k|#define qmf_t complex_t
  ------------------
  468|       |
  469|  15.8k|    if (sbr == NULL)
  ------------------
  |  Branch (469:9): [True: 0, False: 15.8k]
  ------------------
  470|      0|        return 20;
  471|       |
  472|       |    /* case can occur due to bit errors */
  473|  15.8k|    if (sbr->id_aac != ID_CPE)
  ------------------
  |  |   87|  15.8k|#define ID_CPE 0x1
  ------------------
  |  Branch (473:9): [True: 5, False: 15.8k]
  ------------------
  474|      5|        return 21;
  475|       |
  476|  15.8k|    if (sbr->ret || (sbr->header_count == 0))
  ------------------
  |  Branch (476:9): [True: 9.84k, False: 5.96k]
  |  Branch (476:21): [True: 4.41k, False: 1.54k]
  ------------------
  477|  14.2k|    {
  478|       |        /* don't process just upsample */
  479|  14.2k|        dont_process = 1;
  480|       |
  481|       |        /* Re-activate reset for next frame */
  482|  14.2k|        if (sbr->ret && sbr->Reset)
  ------------------
  |  Branch (482:13): [True: 9.84k, False: 4.41k]
  |  Branch (482:25): [True: 9.81k, False: 21]
  ------------------
  483|  9.81k|            sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  9.81k|#define INVALID ((uint8_t)-1)
  ------------------
  484|  14.2k|    }
  485|       |
  486|  15.8k|    if (just_seeked)
  ------------------
  |  Branch (486:9): [True: 9.79k, False: 6.00k]
  ------------------
  487|  9.79k|    {
  488|  9.79k|        sbr->just_seeked = 1;
  489|  9.79k|    } else {
  490|  6.00k|        sbr->just_seeked = 0;
  491|  6.00k|    }
  492|       |
  493|  15.8k|    sbr->ret += sbr_process_channel(sbr, left_chan, X, 0, dont_process, downSampledSBR);
  494|       |    /* subband synthesis */
  495|  15.8k|    if (downSampledSBR)
  ------------------
  |  Branch (495:9): [True: 4.27k, False: 11.5k]
  ------------------
  496|  4.27k|    {
  497|  4.27k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, left_chan);
  498|  11.5k|    } else {
  499|  11.5k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, left_chan);
  500|  11.5k|    }
  501|       |
  502|  15.8k|    sbr->ret += sbr_process_channel(sbr, right_chan, X, 1, dont_process, downSampledSBR);
  503|       |    /* subband synthesis */
  504|  15.8k|    if (downSampledSBR)
  ------------------
  |  Branch (504:9): [True: 4.27k, False: 11.5k]
  ------------------
  505|  4.27k|    {
  506|  4.27k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X, right_chan);
  507|  11.5k|    } else {
  508|  11.5k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X, right_chan);
  509|  11.5k|    }
  510|       |
  511|  15.8k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (511:9): [True: 11.2k, False: 4.51k]
  ------------------
  512|  11.2k|        sbr->just_seeked = 0;
  513|       |
  514|  15.8k|    if (sbr->header_count != 0 && sbr->ret == 0)
  ------------------
  |  Branch (514:9): [True: 11.2k, False: 4.52k]
  |  Branch (514:35): [True: 1.53k, False: 9.74k]
  ------------------
  515|  1.53k|    {
  516|  1.53k|        ret = sbr_save_prev_data(sbr, 0);
  517|  1.53k|        if (ret) return ret;
  ------------------
  |  Branch (517:13): [True: 0, False: 1.53k]
  ------------------
  518|  1.53k|        ret = sbr_save_prev_data(sbr, 1);
  519|  1.53k|        if (ret) return ret;
  ------------------
  |  Branch (519:13): [True: 0, False: 1.53k]
  ------------------
  520|  1.53k|    }
  521|       |
  522|  15.8k|    sbr_save_matrix(sbr, 0);
  523|  15.8k|    sbr_save_matrix(sbr, 1);
  524|       |
  525|  15.8k|    sbr->frame++;
  526|       |
  527|       |//#define POST_QMF_PRINT
  528|       |#ifdef POST_QMF_PRINT
  529|       |    {
  530|       |        int i;
  531|       |        for (i = 0; i < 2048; i++)
  532|       |        {
  533|       |            printf("%d\n", left_chan[i]);
  534|       |        }
  535|       |        for (i = 0; i < 2048; i++)
  536|       |        {
  537|       |            printf("%d\n", right_chan[i]);
  538|       |        }
  539|       |    }
  540|       |#endif
  541|       |
  542|  15.8k|    return 0;
  543|  15.8k|}
sbrDecodeSingleFrame:
  547|  60.6k|{
  548|  60.6k|    uint8_t dont_process = 0;
  549|  60.6k|    uint8_t ret = 0;
  550|  60.6k|    ALIGN qmf_t X[MAX_NTSRHFG][64];
  ------------------
  |  |  167|  60.6k|#define qmf_t complex_t
  ------------------
  551|       |
  552|  60.6k|    if (sbr == NULL)
  ------------------
  |  Branch (552:9): [True: 0, False: 60.6k]
  ------------------
  553|      0|        return 20;
  554|       |
  555|       |    /* case can occur due to bit errors */
  556|  60.6k|    if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   86|   121k|#define ID_SCE 0x0
  ------------------
                  if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   89|    173|#define ID_LFE 0x3
  ------------------
  |  Branch (556:9): [True: 173, False: 60.4k]
  |  Branch (556:34): [True: 0, False: 173]
  ------------------
  557|      0|        return 21;
  558|       |
  559|  60.6k|    if (sbr->ret || (sbr->header_count == 0))
  ------------------
  |  Branch (559:9): [True: 6.38k, False: 54.2k]
  |  Branch (559:21): [True: 52.3k, False: 1.91k]
  ------------------
  560|  58.7k|    {
  561|       |        /* don't process just upsample */
  562|  58.7k|        dont_process = 1;
  563|       |
  564|       |        /* Re-activate reset for next frame */
  565|  58.7k|        if (sbr->ret && sbr->Reset)
  ------------------
  |  Branch (565:13): [True: 6.38k, False: 52.3k]
  |  Branch (565:25): [True: 6.31k, False: 70]
  ------------------
  566|  6.31k|            sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  6.31k|#define INVALID ((uint8_t)-1)
  ------------------
  567|  58.7k|    }
  568|       |
  569|  60.6k|    if (just_seeked)
  ------------------
  |  Branch (569:9): [True: 30.7k, False: 29.8k]
  ------------------
  570|  30.7k|    {
  571|  30.7k|        sbr->just_seeked = 1;
  572|  30.7k|    } else {
  573|  29.8k|        sbr->just_seeked = 0;
  574|  29.8k|    }
  575|       |
  576|  60.6k|    sbr->ret += sbr_process_channel(sbr, channel, X, 0, dont_process, downSampledSBR);
  577|       |    /* subband synthesis */
  578|  60.6k|    if (downSampledSBR)
  ------------------
  |  Branch (578:9): [True: 23.3k, False: 37.2k]
  ------------------
  579|  23.3k|    {
  580|  23.3k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, channel);
  581|  37.2k|    } else {
  582|  37.2k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, channel);
  583|  37.2k|    }
  584|       |
  585|  60.6k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (585:9): [True: 8.03k, False: 52.6k]
  ------------------
  586|  8.03k|        sbr->just_seeked = 0;
  587|       |
  588|  60.6k|    if (sbr->header_count != 0 && sbr->ret == 0)
  ------------------
  |  Branch (588:9): [True: 7.73k, False: 52.9k]
  |  Branch (588:35): [True: 1.91k, False: 5.81k]
  ------------------
  589|  1.91k|    {
  590|  1.91k|        ret = sbr_save_prev_data(sbr, 0);
  591|  1.91k|        if (ret) return ret;
  ------------------
  |  Branch (591:13): [True: 10, False: 1.90k]
  ------------------
  592|  1.91k|    }
  593|       |
  594|  60.6k|    sbr_save_matrix(sbr, 0);
  595|       |
  596|  60.6k|    sbr->frame++;
  597|       |
  598|       |//#define POST_QMF_PRINT
  599|       |#ifdef POST_QMF_PRINT
  600|       |    {
  601|       |        int i;
  602|       |        for (i = 0; i < 2048; i++)
  603|       |        {
  604|       |            printf("%d\n", channel[i]);
  605|       |        }
  606|       |    }
  607|       |#endif
  608|       |
  609|  60.6k|    return 0;
  610|  60.6k|}
sbrDecodeSingleFramePS:
  615|  5.53k|{
  616|  5.53k|    uint8_t l, k;
  617|  5.53k|    uint8_t dont_process = 0;
  618|  5.53k|    uint8_t ret = 0;
  619|  5.53k|    ALIGN qmf_t X_left[MAX_NTSRHFG][64] = {{{0}}};
  ------------------
  |  |  167|  5.53k|#define qmf_t complex_t
  ------------------
  620|  5.53k|    ALIGN qmf_t X_right[MAX_NTSRHFG][64] = {{{0}}}; /* must set this to 0 */
  ------------------
  |  |  167|  5.53k|#define qmf_t complex_t
  ------------------
  621|       |
  622|  5.53k|    if (sbr == NULL)
  ------------------
  |  Branch (622:9): [True: 0, False: 5.53k]
  ------------------
  623|      0|        return 20;
  624|       |
  625|       |    /* case can occur due to bit errors */
  626|  5.53k|    if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   86|  11.0k|#define ID_SCE 0x0
  ------------------
                  if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   89|      0|#define ID_LFE 0x3
  ------------------
  |  Branch (626:9): [True: 0, False: 5.53k]
  |  Branch (626:34): [True: 0, False: 0]
  ------------------
  627|      0|        return 21;
  628|       |
  629|  5.53k|    if (sbr->ret || (sbr->header_count == 0))
  ------------------
  |  Branch (629:9): [True: 3.24k, False: 2.28k]
  |  Branch (629:21): [True: 366, False: 1.92k]
  ------------------
  630|  3.60k|    {
  631|       |        /* don't process just upsample */
  632|  3.60k|        dont_process = 1;
  633|       |
  634|       |        /* Re-activate reset for next frame */
  635|  3.60k|        if (sbr->ret && sbr->Reset)
  ------------------
  |  Branch (635:13): [True: 3.24k, False: 366]
  |  Branch (635:25): [True: 3.17k, False: 72]
  ------------------
  636|  3.17k|            sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  3.17k|#define INVALID ((uint8_t)-1)
  ------------------
  637|  3.60k|    }
  638|       |
  639|  5.53k|    if (just_seeked)
  ------------------
  |  Branch (639:9): [True: 2.05k, False: 3.47k]
  ------------------
  640|  2.05k|    {
  641|  2.05k|        sbr->just_seeked = 1;
  642|  3.47k|    } else {
  643|  3.47k|        sbr->just_seeked = 0;
  644|  3.47k|    }
  645|       |
  646|  5.53k|    if (sbr->qmfs[1] == NULL)
  ------------------
  |  Branch (646:9): [True: 3.33k, False: 2.19k]
  ------------------
  647|  3.33k|    {
  648|  3.33k|        sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (648:34): [True: 806, False: 2.53k]
  ------------------
  649|  3.33k|    }
  650|       |
  651|  5.53k|    sbr->ret += sbr_process_channel(sbr, left_channel, X_left, 0, dont_process, downSampledSBR);
  652|       |
  653|       |    /* copy some extra data for PS */
  654|  38.7k|    for (l = sbr->numTimeSlotsRate; l < sbr->numTimeSlotsRate + 6; l++)
  ------------------
  |  Branch (654:37): [True: 33.1k, False: 5.53k]
  ------------------
  655|  33.1k|    {
  656|   199k|        for (k = 0; k < 5; k++)
  ------------------
  |  Branch (656:21): [True: 165k, False: 33.1k]
  ------------------
  657|   165k|        {
  658|   165k|            QMF_RE(X_left[l][k]) = QMF_RE(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  168|   165k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   165k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(X_left[l][k]) = QMF_RE(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  168|   165k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   165k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  659|   165k|            QMF_IM(X_left[l][k]) = QMF_IM(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  169|   165k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   165k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(X_left[l][k]) = QMF_IM(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  169|   165k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   165k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  660|   165k|        }
  661|  33.1k|    }
  662|       |
  663|       |    /* perform parametric stereo */
  664|  5.53k|#ifdef DRM_PS
  665|  5.53k|    if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (665:9): [True: 210, False: 5.32k]
  ------------------
  666|    210|    {
  667|    210|        drm_ps_decode(sbr->drm_ps, (sbr->ret > 0), X_left, X_right);
  668|  5.32k|    } else {
  669|  5.32k|#endif
  670|  5.32k|#ifdef PS_DEC
  671|  5.32k|        ps_decode(sbr->ps, X_left, X_right);
  672|  5.32k|#endif
  673|  5.32k|#ifdef DRM_PS
  674|  5.32k|    }
  675|  5.53k|#endif
  676|       |
  677|       |    /* subband synthesis */
  678|  5.53k|    if (downSampledSBR)
  ------------------
  |  Branch (678:9): [True: 1.32k, False: 4.20k]
  ------------------
  679|  1.32k|    {
  680|  1.32k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X_left, left_channel);
  681|  1.32k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X_right, right_channel);
  682|  4.20k|    } else {
  683|  4.20k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X_left, left_channel);
  684|  4.20k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X_right, right_channel);
  685|  4.20k|    }
  686|       |
  687|  5.53k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (687:9): [True: 5.44k, False: 86]
  ------------------
  688|  5.44k|        sbr->just_seeked = 0;
  689|       |
  690|  5.53k|    if (sbr->header_count != 0 && sbr->ret == 0)
  ------------------
  |  Branch (690:9): [True: 4.36k, False: 1.16k]
  |  Branch (690:35): [True: 1.92k, False: 2.44k]
  ------------------
  691|  1.92k|    {
  692|  1.92k|        ret = sbr_save_prev_data(sbr, 0);
  693|  1.92k|        if (ret) return ret;
  ------------------
  |  Branch (693:13): [True: 0, False: 1.92k]
  ------------------
  694|  1.92k|    }
  695|       |
  696|  5.53k|    sbr_save_matrix(sbr, 0);
  697|       |
  698|  5.53k|    sbr->frame++;
  699|       |
  700|  5.53k|    return 0;
  701|  5.53k|}
sbr_dec.c:sbr_process_channel:
  308|  97.7k|{
  309|  97.7k|    int16_t k, l;
  310|  97.7k|    uint8_t ret = 0;
  311|  97.7k|    (void)downSampledSBR;  /* TODO: remove parameter? */
  312|       |
  313|       |#ifdef SBR_LOW_POWER
  314|       |    ALIGN real_t deg[64];
  315|       |#endif
  316|       |
  317|  97.7k|#ifdef DRM
  318|  97.7k|    if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (318:9): [True: 328, False: 97.4k]
  ------------------
  319|    328|    {
  320|    328|        sbr->bsco = (uint8_t)max((int32_t)sbr->maxAACLine*32/(int32_t)sbr->frame_len - (int32_t)sbr->kx, 0);
  ------------------
  |  |   57|    328|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 31, False: 297]
  |  |  ------------------
  ------------------
  321|  97.4k|    } else {
  322|  97.4k|#endif
  323|  97.4k|        sbr->bsco = 0;
  324|  97.4k|#ifdef DRM
  325|  97.4k|    }
  326|  97.7k|#endif
  327|       |
  328|       |
  329|       |//#define PRE_QMF_PRINT
  330|       |#ifdef PRE_QMF_PRINT
  331|       |    {
  332|       |        int i;
  333|       |        for (i = 0; i < 1024; i++)
  334|       |        {
  335|       |            printf("%d\n", channel_buf[i]);
  336|       |        }
  337|       |    }
  338|       |#endif
  339|       |
  340|       |
  341|       |    /* subband analysis */
  342|  97.7k|    if (dont_process)
  ------------------
  |  Branch (342:9): [True: 90.8k, False: 6.92k]
  ------------------
  343|  90.8k|        sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, 32);
  344|  6.92k|    else
  345|  6.92k|        sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, sbr->kx);
  346|       |
  347|  97.7k|    if (!dont_process)
  ------------------
  |  Branch (347:9): [True: 6.92k, False: 90.8k]
  ------------------
  348|  6.92k|    {
  349|  6.92k|#if 1
  350|       |        /* insert high frequencies here */
  351|       |        /* hf generation using patching */
  352|  6.92k|        hf_generation(sbr, sbr->Xsbr[ch], sbr->Xsbr[ch]
  353|       |#ifdef SBR_LOW_POWER
  354|       |            ,deg
  355|       |#endif
  356|  6.92k|            ,ch);
  357|  6.92k|#endif
  358|       |
  359|       |#if 0 //def SBR_LOW_POWER
  360|       |        for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
  361|       |        {
  362|       |            for (k = 0; k < sbr->kx; k++)
  363|       |            {
  364|       |                QMF_RE(sbr->Xsbr[ch][sbr->tHFAdj + l][k]) = 0;
  365|       |            }
  366|       |        }
  367|       |#endif
  368|       |
  369|  6.92k|#if 1
  370|       |        /* hf adjustment */
  371|  6.92k|        ret = hf_adjustment(sbr, sbr->Xsbr[ch]
  372|       |#ifdef SBR_LOW_POWER
  373|       |            ,deg
  374|       |#endif
  375|  6.92k|            ,ch);
  376|  6.92k|#endif
  377|  6.92k|        if (ret > 0)
  ------------------
  |  Branch (377:13): [True: 7, False: 6.91k]
  ------------------
  378|      7|        {
  379|      7|            dont_process = 1;
  380|      7|        }
  381|  6.92k|    }
  382|       |
  383|  97.7k|    if ((sbr->just_seeked != 0) || dont_process)
  ------------------
  |  Branch (383:9): [True: 52.4k, False: 45.3k]
  |  Branch (383:36): [True: 40.0k, False: 5.27k]
  ------------------
  384|  92.5k|    {
  385|  3.01M|        for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (385:21): [True: 2.91M, False: 92.5k]
  ------------------
  386|  2.91M|        {
  387|  96.3M|            for (k = 0; k < 32; k++)
  ------------------
  |  Branch (387:25): [True: 93.3M, False: 2.91M]
  ------------------
  388|  93.3M|            {
  389|  93.3M|                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  93.3M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  93.3M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  93.3M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  93.3M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  390|  93.3M|#ifndef SBR_LOW_POWER
  391|  93.3M|                QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  93.3M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  93.3M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  93.3M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  93.3M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  392|  93.3M|#endif
  393|  93.3M|            }
  394|  96.3M|            for (k = 32; k < 64; k++)
  ------------------
  |  Branch (394:26): [True: 93.3M, False: 2.91M]
  ------------------
  395|  93.3M|            {
  396|  93.3M|                QMF_RE(X[l][k]) = 0;
  ------------------
  |  |  168|  93.3M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  93.3M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  397|  93.3M|#ifndef SBR_LOW_POWER
  398|  93.3M|                QMF_IM(X[l][k]) = 0;
  ------------------
  |  |  169|  93.3M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  93.3M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  399|  93.3M|#endif
  400|  93.3M|            }
  401|  2.91M|        }
  402|  92.5k|    } else {
  403|   170k|        for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (403:21): [True: 165k, False: 5.27k]
  ------------------
  404|   165k|        {
  405|   165k|            uint8_t kx_band, M_band, bsco_band;
  406|       |
  407|   165k|            if (l < sbr->t_E[ch][0])
  ------------------
  |  Branch (407:17): [True: 13.9k, False: 151k]
  ------------------
  408|  13.9k|            {
  409|  13.9k|                kx_band = sbr->kx_prev;
  410|  13.9k|                M_band = sbr->M_prev;
  411|  13.9k|                bsco_band = sbr->bsco_prev;
  412|   151k|            } else {
  413|   151k|                kx_band = sbr->kx;
  414|   151k|                M_band = sbr->M;
  415|   151k|                bsco_band = sbr->bsco;
  416|   151k|            }
  417|       |
  418|   165k|#ifndef SBR_LOW_POWER
  419|  2.93M|            for (k = 0; k < kx_band + bsco_band; k++)
  ------------------
  |  Branch (419:25): [True: 2.76M, False: 165k]
  ------------------
  420|  2.76M|            {
  421|  2.76M|                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  2.76M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.76M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  2.76M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.76M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  422|  2.76M|                QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  2.76M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.76M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  2.76M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.76M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  423|  2.76M|            }
  424|  2.17M|            for (k = kx_band + bsco_band; k < kx_band + M_band; k++)
  ------------------
  |  Branch (424:43): [True: 2.01M, False: 165k]
  ------------------
  425|  2.01M|            {
  426|  2.01M|                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  2.01M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.01M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  2.01M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.01M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  427|  2.01M|                QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  2.01M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.01M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  2.01M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.01M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  428|  2.01M|            }
  429|  5.99M|            for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
  ------------------
  |  |   57|   165k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 62, False: 165k]
  |  |  ------------------
  ------------------
  |  Branch (429:66): [True: 5.82M, False: 165k]
  ------------------
  430|  5.82M|            {
  431|  5.82M|                QMF_RE(X[l][k]) = 0;
  ------------------
  |  |  168|  5.82M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  5.82M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  432|  5.82M|                QMF_IM(X[l][k]) = 0;
  ------------------
  |  |  169|  5.82M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  5.82M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  433|  5.82M|            }
  434|       |#else
  435|       |            for (k = 0; k < kx_band + bsco_band; k++)
  436|       |            {
  437|       |                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  438|       |            }
  439|       |            for (k = kx_band + bsco_band; k < min(kx_band + M_band, 63); k++)
  440|       |            {
  441|       |                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  442|       |            }
  443|       |            for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
  444|       |            {
  445|       |                QMF_RE(X[l][k]) = 0;
  446|       |            }
  447|       |            /* kx_band can be 0 (kx_prev on the first frame's leading slots),
  448|       |               which would make kx_band - 1 + bsco_band index X[l][-1]. There is
  449|       |               no band below 0 to add in that case, so skip the overlap. */
  450|       |            if (kx_band + bsco_band > 0)
  451|       |            {
  452|       |                QMF_RE(X[l][kx_band - 1 + bsco_band]) +=
  453|       |                    QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][kx_band - 1 + bsco_band]);
  454|       |            }
  455|       |#endif
  456|   165k|        }
  457|  5.27k|    }
  458|       |
  459|  97.7k|    return ret;
  460|  97.7k|}
sbr_dec.c:sbr_save_prev_data:
  256|  6.91k|{
  257|  6.91k|    uint8_t i;
  258|       |
  259|       |    /* save data for next frame */
  260|  6.91k|    sbr->kx_prev = sbr->kx;
  261|  6.91k|    sbr->M_prev = sbr->M;
  262|  6.91k|    sbr->bsco_prev = sbr->bsco;
  263|       |
  264|  6.91k|    sbr->L_E_prev[ch] = sbr->L_E[ch];
  265|       |
  266|       |    /* sbr->L_E[ch] can become 0 on files with bit errors */
  267|  6.91k|    if (sbr->L_E[ch] <= 0)
  ------------------
  |  Branch (267:9): [True: 10, False: 6.90k]
  ------------------
  268|     10|        return 19;
  269|       |
  270|  6.90k|    sbr->f_prev[ch] = sbr->f[ch][sbr->L_E[ch] - 1];
  271|   345k|    for (i = 0; i < MAX_M; i++)
  ------------------
  |  |   50|   345k|#define MAX_M       49
  ------------------
  |  Branch (271:17): [True: 338k, False: 6.90k]
  ------------------
  272|   338k|    {
  273|   338k|        sbr->E_prev[ch][i] = sbr->E[ch][i][sbr->L_E[ch] - 1];
  274|   338k|        sbr->Q_prev[ch][i] = sbr->Q[ch][i][sbr->L_Q[ch] - 1];
  275|   338k|    }
  276|       |
  277|   345k|    for (i = 0; i < MAX_M; i++)
  ------------------
  |  |   50|   345k|#define MAX_M       49
  ------------------
  |  Branch (277:17): [True: 338k, False: 6.90k]
  ------------------
  278|   338k|    {
  279|   338k|        sbr->bs_add_harmonic_prev[ch][i] = sbr->bs_add_harmonic[ch][i];
  280|   338k|    }
  281|  6.90k|    sbr->bs_add_harmonic_flag_prev[ch] = sbr->bs_add_harmonic_flag[ch];
  282|       |
  283|  6.90k|    if (sbr->l_A[ch] == sbr->L_E[ch])
  ------------------
  |  Branch (283:9): [True: 1.38k, False: 5.52k]
  ------------------
  284|  1.38k|        sbr->prevEnvIsShort[ch] = 0;
  285|  5.52k|    else
  286|  5.52k|        sbr->prevEnvIsShort[ch] = -1;
  287|       |
  288|  6.90k|    return 0;
  289|  6.91k|}
sbr_dec.c:sbr_save_matrix:
  292|  97.7k|{
  293|  97.7k|    uint8_t i;
  294|       |
  295|   879k|    for (i = 0; i < sbr->tHFGen; i++)
  ------------------
  |  Branch (295:17): [True: 782k, False: 97.7k]
  ------------------
  296|   782k|    {
  297|   782k|        memmove(sbr->Xsbr[ch][i], sbr->Xsbr[ch][i+sbr->numTimeSlotsRate], 64 * sizeof(qmf_t));
  298|   782k|    }
  299|  3.22M|    for (i = sbr->tHFGen; i < MAX_NTSRHFG; i++)
  ------------------
  |  |   46|  3.22M|#define MAX_NTSRHFG 40
  ------------------
  |  Branch (299:27): [True: 3.12M, False: 97.7k]
  ------------------
  300|  3.12M|    {
  301|  3.12M|        memset(sbr->Xsbr[ch][i], 0, 64 * sizeof(qmf_t));
  302|  3.12M|    }
  303|  97.7k|}

extract_envelope_data:
   42|  30.3k|{
   43|  30.3k|    uint8_t l, k;
   44|       |
   45|   103k|    for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (45:17): [True: 73.0k, False: 30.3k]
  ------------------
   46|  73.0k|    {
   47|  73.0k|        if (sbr->bs_df_env[ch][l] == 0)
  ------------------
  |  Branch (47:13): [True: 46.6k, False: 26.4k]
  ------------------
   48|  46.6k|        {
   49|   524k|            for (k = 1; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (49:25): [True: 477k, False: 46.6k]
  ------------------
   50|   477k|            {
   51|   477k|                sbr->E[ch][k][l] = sbr->E[ch][k - 1][l] + sbr->E[ch][k][l];
   52|   477k|                if (sbr->E[ch][k][l] < 0)
  ------------------
  |  Branch (52:21): [True: 13.7k, False: 463k]
  ------------------
   53|  13.7k|                    sbr->E[ch][k][l] = 0;
   54|   477k|            }
   55|       |
   56|  46.6k|        } else { /* bs_df_env == 1 */
   57|       |
   58|  26.4k|            uint8_t g = (l == 0) ? sbr->f_prev[ch] : sbr->f[ch][l-1];
  ------------------
  |  Branch (58:25): [True: 10.6k, False: 15.7k]
  ------------------
   59|  26.4k|            int16_t E_prev;
   60|       |
   61|  26.4k|            if (sbr->f[ch][l] == g)
  ------------------
  |  Branch (61:17): [True: 16.1k, False: 10.2k]
  ------------------
   62|  16.1k|            {
   63|   192k|                for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (63:29): [True: 176k, False: 16.1k]
  ------------------
   64|   176k|                {
   65|   176k|                    if (l == 0)
  ------------------
  |  Branch (65:25): [True: 37.5k, False: 139k]
  ------------------
   66|  37.5k|                        E_prev = sbr->E_prev[ch][k];
   67|   139k|                    else
   68|   139k|                        E_prev = sbr->E[ch][k][l - 1];
   69|       |
   70|   176k|                    sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
   71|   176k|                }
   72|       |
   73|  16.1k|            } else if ((g == 1) && (sbr->f[ch][l] == 0)) {
  ------------------
  |  Branch (73:24): [True: 3.23k, False: 7.06k]
  |  Branch (73:36): [True: 3.23k, False: 0]
  ------------------
   74|  3.23k|                uint8_t i;
   75|       |
   76|  15.8k|                for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (76:29): [True: 12.6k, False: 3.23k]
  ------------------
   77|  12.6k|                {
   78|   160k|                    for (i = 0; i < sbr->N_high; i++)
  ------------------
  |  Branch (78:33): [True: 147k, False: 12.6k]
  ------------------
   79|   147k|                    {
   80|   147k|                        if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
  ------------------
  |  |   52|   147k|#define HI_RES 1
  ------------------
                                      if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
  ------------------
  |  |   51|   147k|#define LO_RES 0
  ------------------
  |  Branch (80:29): [True: 12.6k, False: 134k]
  ------------------
   81|  12.6k|                        {
   82|  12.6k|                            if (l == 0)
  ------------------
  |  Branch (82:33): [True: 191, False: 12.4k]
  ------------------
   83|    191|                                E_prev = sbr->E_prev[ch][i];
   84|  12.4k|                            else
   85|  12.4k|                                E_prev = sbr->E[ch][i][l - 1];
   86|       |
   87|  12.6k|                            sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
   88|  12.6k|                        }
   89|   147k|                    }
   90|  12.6k|                }
   91|       |
   92|  7.06k|            } else if ((g == 0) && (sbr->f[ch][l] == 1)) {
  ------------------
  |  Branch (92:24): [True: 7.06k, False: 0]
  |  Branch (92:36): [True: 7.06k, False: 0]
  ------------------
   93|  7.06k|                uint8_t i;
   94|       |
   95|  91.0k|                for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (95:29): [True: 84.0k, False: 7.06k]
  ------------------
   96|  84.0k|                {
   97|   976k|                    for (i = 0; i < sbr->N_low; i++)
  ------------------
  |  Branch (97:33): [True: 891k, False: 84.0k]
  ------------------
   98|   891k|                    {
   99|   891k|                        if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
  ------------------
  |  |   51|   891k|#define LO_RES 0
  ------------------
                                      if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
  ------------------
  |  |   52|   891k|#define HI_RES 1
  ------------------
  |  Branch (99:29): [True: 495k, False: 396k]
  ------------------
  100|   495k|                            (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
  ------------------
  |  |   52|   495k|#define HI_RES 1
  ------------------
                                          (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
  ------------------
  |  |   51|   495k|#define LO_RES 0
  ------------------
  |  Branch (100:29): [True: 84.0k, False: 411k]
  ------------------
  101|  84.0k|                        {
  102|  84.0k|                            if (l == 0)
  ------------------
  |  Branch (102:33): [True: 51.0k, False: 32.9k]
  ------------------
  103|  51.0k|                                E_prev = sbr->E_prev[ch][i];
  104|  32.9k|                            else
  105|  32.9k|                                E_prev = sbr->E[ch][i][l - 1];
  106|       |
  107|  84.0k|                            sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
  108|  84.0k|                        }
  109|   891k|                    }
  110|  84.0k|                }
  111|  7.06k|            }
  112|  26.4k|        }
  113|  73.0k|    }
  114|  30.3k|}
extract_noise_floor_data:
  117|  30.3k|{
  118|  30.3k|    uint8_t l, k;
  119|       |
  120|  78.9k|    for (l = 0; l < sbr->L_Q[ch]; l++)
  ------------------
  |  Branch (120:17): [True: 48.6k, False: 30.3k]
  ------------------
  121|  48.6k|    {
  122|  48.6k|        if (sbr->bs_df_noise[ch][l] == 0)
  ------------------
  |  Branch (122:13): [True: 31.4k, False: 17.1k]
  ------------------
  123|  31.4k|        {
  124|  59.0k|            for (k = 1; k < sbr->N_Q; k++)
  ------------------
  |  Branch (124:25): [True: 27.6k, False: 31.4k]
  ------------------
  125|  27.6k|            {
  126|  27.6k|                sbr->Q[ch][k][l] = sbr->Q[ch][k][l] + sbr->Q[ch][k-1][l];
  127|  27.6k|            }
  128|  31.4k|        } else {
  129|  17.1k|            if (l == 0)
  ------------------
  |  Branch (129:17): [True: 10.9k, False: 6.25k]
  ------------------
  130|  10.9k|            {
  131|  32.8k|                for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (131:29): [True: 21.8k, False: 10.9k]
  ------------------
  132|  21.8k|                {
  133|  21.8k|                    sbr->Q[ch][k][l] = sbr->Q_prev[ch][k] + sbr->Q[ch][k][0];
  134|  21.8k|                }
  135|  10.9k|            } else {
  136|  17.7k|                for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (136:29): [True: 11.5k, False: 6.25k]
  ------------------
  137|  11.5k|                {
  138|  11.5k|                    sbr->Q[ch][k][l] = sbr->Q[ch][k][l - 1] + sbr->Q[ch][k][l];
  139|  11.5k|                }
  140|  6.25k|            }
  141|  17.1k|        }
  142|  48.6k|    }
  143|  30.3k|}
envelope_noise_dequantisation:
  396|  30.3k|{
  397|  30.3k|    if (sbr->bs_coupling == 0)
  ------------------
  |  Branch (397:9): [True: 21.9k, False: 8.40k]
  ------------------
  398|  21.9k|    {
  399|  21.9k|        int16_t exp;
  400|  21.9k|        uint8_t l, k;
  401|  21.9k|        uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
  ------------------
  |  Branch (401:23): [True: 10.2k, False: 11.7k]
  ------------------
  402|       |
  403|  71.6k|        for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (403:21): [True: 49.7k, False: 21.9k]
  ------------------
  404|  49.7k|        {
  405|   499k|            for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (405:25): [True: 450k, False: 49.7k]
  ------------------
  406|   450k|            {
  407|       |                /* +6 for the *64 and -10 for the /32 in the synthesis QMF (fixed)
  408|       |                 * since this is a energy value: (x/32)^2 = (x^2)/1024
  409|       |                 */
  410|       |                /* exp = (sbr->E[ch][k][l] >> amp) + 6; */
  411|   450k|                exp = (sbr->E[ch][k][l] >> amp);
  412|       |
  413|   450k|                if ((exp < 0) || (exp >= 64))
  ------------------
  |  Branch (413:21): [True: 17.8k, False: 432k]
  |  Branch (413:34): [True: 5.40k, False: 426k]
  ------------------
  414|  23.2k|                {
  415|  23.2k|                    sbr->E_orig[ch][k][l] = 0;
  416|   426k|                } else {
  417|   426k|                    sbr->E_orig[ch][k][l] = E_deq_tab[exp];
  418|       |
  419|       |                    /* save half the table size at the cost of 1 multiply */
  420|   426k|                    if (amp && (sbr->E[ch][k][l] & 1))
  ------------------
  |  Branch (420:25): [True: 297k, False: 129k]
  |  Branch (420:32): [True: 106k, False: 191k]
  ------------------
  421|   106k|                    {
  422|   106k|                        sbr->E_orig[ch][k][l] = MUL_C(sbr->E_orig[ch][k][l], COEF_CONST(1.414213562));
  ------------------
  |  |  285|   106k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  423|   106k|                    }
  424|   426k|                }
  425|   450k|            }
  426|  49.7k|        }
  427|       |
  428|  56.7k|        for (l = 0; l < sbr->L_Q[ch]; l++)
  ------------------
  |  Branch (428:21): [True: 34.7k, False: 21.9k]
  ------------------
  429|  34.7k|        {
  430|  91.5k|            for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (430:25): [True: 56.8k, False: 34.7k]
  ------------------
  431|  56.8k|            {
  432|  56.8k|                sbr->Q_div[ch][k][l] = calc_Q_div(sbr, ch, k, l);
  433|  56.8k|                sbr->Q_div2[ch][k][l] = calc_Q_div2(sbr, ch, k, l);
  434|  56.8k|            }
  435|  34.7k|        }
  436|  21.9k|    }
  437|  30.3k|}
unmap_envelope_noise:
  456|  4.20k|{
  457|  4.20k|    real_t tmp;
  458|  4.20k|    int16_t exp0, exp1;
  459|  4.20k|    uint8_t l, k;
  460|  4.20k|    uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
  ------------------
  |  Branch (460:20): [True: 1.51k, False: 2.68k]
  ------------------
  461|  4.20k|    uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
  ------------------
  |  Branch (461:20): [True: 1.51k, False: 2.68k]
  ------------------
  462|       |
  463|  15.8k|    for (l = 0; l < sbr->L_E[0]; l++)
  ------------------
  |  Branch (463:17): [True: 11.6k, False: 4.20k]
  ------------------
  464|  11.6k|    {
  465|   185k|        for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
  ------------------
  |  Branch (465:21): [True: 173k, False: 11.6k]
  ------------------
  466|   173k|        {
  467|       |            /* +6: * 64 ; +1: * 2 ; */
  468|   173k|            exp0 = (sbr->E[0][k][l] >> amp0) + 1;
  469|       |
  470|       |            /* UN_MAP removed: (x / 4096) same as (x >> 12) */
  471|       |            /* E[1] is always even so no need for compensating the divide by 2 with
  472|       |             * an extra multiplication
  473|       |             */
  474|       |            /* exp1 = (sbr->E[1][k][l] >> amp1) - 12; */
  475|   173k|            exp1 = (sbr->E[1][k][l] >> amp1);
  476|       |
  477|   173k|            if ((exp0 < 0) || (exp0 >= 64) ||
  ------------------
  |  Branch (477:17): [True: 4.75k, False: 168k]
  |  Branch (477:31): [True: 22.2k, False: 146k]
  ------------------
  478|   146k|                (exp1 < 0) || (exp1 > 24))
  ------------------
  |  Branch (478:17): [True: 1.00k, False: 145k]
  |  Branch (478:31): [True: 49.9k, False: 95.6k]
  ------------------
  479|  78.0k|            {
  480|  78.0k|                sbr->E_orig[1][k][l] = 0;
  481|  78.0k|                sbr->E_orig[0][k][l] = 0;
  482|  95.6k|            } else {
  483|  95.6k|                tmp = E_deq_tab[exp0];
  484|  95.6k|                if (amp0 && (sbr->E[0][k][l] & 1))
  ------------------
  |  Branch (484:21): [True: 76.6k, False: 19.0k]
  |  Branch (484:29): [True: 32.0k, False: 44.6k]
  ------------------
  485|  32.0k|                {
  486|  32.0k|                    tmp = MUL_C(tmp, COEF_CONST(1.414213562));
  ------------------
  |  |  285|  32.0k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  487|  32.0k|                }
  488|       |
  489|       |                /* panning */
  490|  95.6k|                sbr->E_orig[0][k][l] = MUL_F(tmp, E_pan_tab[exp1]);
  ------------------
  |  |  286|  95.6k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  491|  95.6k|                sbr->E_orig[1][k][l] = MUL_F(tmp, E_pan_tab[24 - exp1]);
  ------------------
  |  |  286|  95.6k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  492|  95.6k|            }
  493|   173k|        }
  494|  11.6k|    }
  495|       |
  496|  11.1k|    for (l = 0; l < sbr->L_Q[0]; l++)
  ------------------
  |  Branch (496:17): [True: 6.91k, False: 4.20k]
  ------------------
  497|  6.91k|    {
  498|  24.7k|        for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (498:21): [True: 17.8k, False: 6.91k]
  ------------------
  499|  17.8k|        {
  500|  17.8k|            sbr->Q_div[0][k][l] = calc_Q_div(sbr, 0, k, l);
  501|  17.8k|            sbr->Q_div[1][k][l] = calc_Q_div(sbr, 1, k, l);
  502|  17.8k|            sbr->Q_div2[0][k][l] = calc_Q_div2(sbr, 0, k, l);
  503|  17.8k|            sbr->Q_div2[1][k][l] = calc_Q_div2(sbr, 1, k, l);
  504|  17.8k|        }
  505|  6.91k|    }
  506|  4.20k|}
sbr_e_nf.c:calc_Q_div:
  238|  92.4k|{
  239|  92.4k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (239:9): [True: 35.6k, False: 56.8k]
  ------------------
  240|  35.6k|    {
  241|       |        /* left channel */
  242|  35.6k|        if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
  ------------------
  |  Branch (242:14): [True: 2.51k, False: 33.1k]
  |  Branch (242:37): [True: 3.21k, False: 29.9k]
  ------------------
  243|  29.9k|            (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
  ------------------
  |  Branch (243:14): [True: 1.29k, False: 28.6k]
  |  Branch (243:37): [True: 8.49k, False: 20.1k]
  ------------------
  244|  15.5k|        {
  245|  15.5k|            return 0;
  246|  20.1k|        } else {
  247|       |            /* the pan parameter is always even */
  248|  20.1k|            if (ch == 0)
  ------------------
  |  Branch (248:17): [True: 10.0k, False: 10.0k]
  ------------------
  249|  10.0k|            {
  250|  10.0k|                return Q_div_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  251|  10.0k|            } else {
  252|  10.0k|                return Q_div_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  253|  10.0k|            }
  254|  20.1k|        }
  255|  56.8k|    } else {
  256|       |        /* no coupling */
  257|  56.8k|        if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
  ------------------
  |  Branch (257:13): [True: 2.52k, False: 54.2k]
  |  Branch (257:37): [True: 3.74k, False: 50.5k]
  ------------------
  258|  6.27k|        {
  259|  6.27k|            return 0;
  260|  50.5k|        } else {
  261|  50.5k|            return Q_div_tab[sbr->Q[ch][m][l]];
  262|  50.5k|        }
  263|  56.8k|    }
  264|  92.4k|}
sbr_e_nf.c:calc_Q_div2:
  357|  92.4k|{
  358|  92.4k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (358:9): [True: 35.6k, False: 56.8k]
  ------------------
  359|  35.6k|    {
  360|  35.6k|        if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
  ------------------
  |  Branch (360:14): [True: 2.51k, False: 33.1k]
  |  Branch (360:37): [True: 3.21k, False: 29.9k]
  ------------------
  361|  29.9k|            (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
  ------------------
  |  Branch (361:14): [True: 1.29k, False: 28.6k]
  |  Branch (361:37): [True: 8.49k, False: 20.1k]
  ------------------
  362|  15.5k|        {
  363|  15.5k|            return 0;
  364|  20.1k|        } else {
  365|       |            /* the pan parameter is always even */
  366|  20.1k|            if (ch == 0)
  ------------------
  |  Branch (366:17): [True: 10.0k, False: 10.0k]
  ------------------
  367|  10.0k|            {
  368|  10.0k|                return Q_div2_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  369|  10.0k|            } else {
  370|  10.0k|                return Q_div2_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  371|  10.0k|            }
  372|  20.1k|        }
  373|  56.8k|    } else {
  374|       |        /* no coupling */
  375|  56.8k|        if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
  ------------------
  |  Branch (375:13): [True: 2.52k, False: 54.2k]
  |  Branch (375:37): [True: 3.74k, False: 50.5k]
  ------------------
  376|  6.27k|        {
  377|  6.27k|            return 0;
  378|  50.5k|        } else {
  379|  50.5k|            return Q_div2_tab[sbr->Q[ch][m][l]];
  380|  50.5k|        }
  381|  56.8k|    }
  382|  92.4k|}

qmf_start_channel:
   51|  35.8k|{
   52|  35.8k|    static const uint8_t startMinTable[12] = { 7, 7, 10, 11, 12, 16, 16,
   53|  35.8k|        17, 24, 32, 35, 48 };
   54|  35.8k|    static const uint8_t offsetIndexTable[12] = { 5, 5, 4, 4, 4, 3, 2, 1, 0,
   55|  35.8k|        6, 6, 6 };
   56|  35.8k|    static const int8_t offset[7][16] = {
   57|  35.8k|        { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 },
   58|  35.8k|        { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13 },
   59|  35.8k|        { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
   60|  35.8k|        { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
   61|  35.8k|        { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20 },
   62|  35.8k|        { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24 },
   63|  35.8k|        { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33 }
   64|  35.8k|    };
   65|  35.8k|    uint8_t startMin = startMinTable[get_sr_index(sample_rate)];
   66|  35.8k|    uint8_t offsetIndex = offsetIndexTable[get_sr_index(sample_rate)];
   67|       |
   68|       |#if 0 /* replaced with table (startMinTable) */
   69|       |    if (sample_rate >= 64000)
   70|       |    {
   71|       |        startMin = (uint8_t)((5000.*128.)/(float)sample_rate + 0.5);
   72|       |    } else if (sample_rate < 32000) {
   73|       |        startMin = (uint8_t)((3000.*128.)/(float)sample_rate + 0.5);
   74|       |    } else {
   75|       |        startMin = (uint8_t)((4000.*128.)/(float)sample_rate + 0.5);
   76|       |    }
   77|       |#endif
   78|       |
   79|  35.8k|    if (bs_samplerate_mode)
  ------------------
  |  Branch (79:9): [True: 35.8k, False: 0]
  ------------------
   80|  35.8k|    {
   81|  35.8k|        return startMin + offset[offsetIndex][bs_start_freq];
   82|       |
   83|       |#if 0 /* replaced by offsetIndexTable */
   84|       |        switch (sample_rate)
   85|       |        {
   86|       |        case 16000:
   87|       |            return startMin + offset[0][bs_start_freq];
   88|       |        case 22050:
   89|       |            return startMin + offset[1][bs_start_freq];
   90|       |        case 24000:
   91|       |            return startMin + offset[2][bs_start_freq];
   92|       |        case 32000:
   93|       |            return startMin + offset[3][bs_start_freq];
   94|       |        default:
   95|       |            if (sample_rate > 64000)
   96|       |            {
   97|       |                return startMin + offset[5][bs_start_freq];
   98|       |            } else { /* 44100 <= sample_rate <= 64000 */
   99|       |                return startMin + offset[4][bs_start_freq];
  100|       |            }
  101|       |        }
  102|       |#endif
  103|  35.8k|    } else {
  104|      0|        return startMin + offset[6][bs_start_freq];
  105|      0|    }
  106|  35.8k|}
qmf_stop_channel:
  122|  35.8k|{
  123|  35.8k|    if (bs_stop_freq == 15)
  ------------------
  |  Branch (123:9): [True: 4.09k, False: 31.7k]
  ------------------
  124|  4.09k|    {
  125|  4.09k|        return min(64, k0 * 3);
  ------------------
  |  |   60|  4.09k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 1.61k, False: 2.47k]
  |  |  ------------------
  ------------------
  126|  31.7k|    } else if (bs_stop_freq == 14) {
  ------------------
  |  Branch (126:16): [True: 1.39k, False: 30.3k]
  ------------------
  127|  1.39k|        return min(64, k0 * 2);
  ------------------
  |  |   60|  1.39k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 1.39k]
  |  |  ------------------
  ------------------
  128|  30.3k|    } else {
  129|  30.3k|        static const uint8_t stopMinTable[12] = { 13, 15, 20, 21, 23,
  130|  30.3k|            32, 32, 35, 48, 64, 70, 96 };
  131|  30.3k|        static const int8_t offset[12][14] = {
  132|  30.3k|            { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 37, 44, 51 },
  133|  30.3k|            { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 36, 42, 49 },
  134|  30.3k|            { 0, 2, 4, 6, 8, 11, 14, 17, 21, 25, 29, 34, 39, 44 },
  135|  30.3k|            { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 33, 38, 43 },
  136|  30.3k|            { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 32, 36, 41 },
  137|  30.3k|            { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
  138|  30.3k|            { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
  139|  30.3k|            { 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 20, 23, 26, 29 },
  140|  30.3k|            { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16 },
  141|  30.3k|            { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  142|  30.3k|            { 0, -1, -2, -3, -4, -5, -6, -6, -6, -6, -6, -6, -6, -6 },
  143|  30.3k|            { 0, -3, -6, -9, -12, -15, -18, -20, -22, -24, -26, -28, -30, -32 }
  144|  30.3k|        };
  145|       |#if 0
  146|       |        uint8_t i;
  147|       |        int32_t stopDk[13], stopDk_t[14], k2;
  148|       |#endif
  149|  30.3k|        uint8_t stopMin = stopMinTable[get_sr_index(sample_rate)];
  150|       |
  151|       |#if 0 /* replaced by table lookup */
  152|       |        if (sample_rate >= 64000)
  153|       |        {
  154|       |            stopMin = (uint8_t)((10000.*128.)/(float)sample_rate + 0.5);
  155|       |        } else if (sample_rate < 32000) {
  156|       |            stopMin = (uint8_t)((6000.*128.)/(float)sample_rate + 0.5);
  157|       |        } else {
  158|       |            stopMin = (uint8_t)((8000.*128.)/(float)sample_rate + 0.5);
  159|       |        }
  160|       |#endif
  161|       |
  162|       |#if 0 /* replaced by table lookup */
  163|       |        /* diverging power series */
  164|       |        for (i = 0; i <= 13; i++)
  165|       |        {
  166|       |            stopDk_t[i] = (int32_t)(stopMin*pow(64.0/stopMin, i/13.0) + 0.5);
  167|       |        }
  168|       |        for (i = 0; i < 13; i++)
  169|       |        {
  170|       |            stopDk[i] = stopDk_t[i+1] - stopDk_t[i];
  171|       |        }
  172|       |
  173|       |        /* needed? */
  174|       |        qsort(stopDk, 13, sizeof(stopDk[0]), int32cmp);
  175|       |
  176|       |        k2 = stopMin;
  177|       |        for (i = 0; i < bs_stop_freq; i++)
  178|       |        {
  179|       |            k2 += stopDk[i];
  180|       |        }
  181|       |        return min(64, k2);
  182|       |#endif
  183|       |        /* bs_stop_freq <= 13 */
  184|  30.3k|        return min(64, stopMin + offset[get_sr_index(sample_rate)][min(bs_stop_freq, 13)]);
  ------------------
  |  |   60|  60.7k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 30.3k]
  |  |  |  Branch (60:28): [True: 28.1k, False: 2.22k]
  |  |  |  Branch (60:41): [True: 28.1k, False: 2.22k]
  |  |  ------------------
  ------------------
  185|  30.3k|    }
  186|       |
  187|       |    // return 0;
  188|  35.8k|}
master_frequency_table_fs0:
  197|  7.92k|{
  198|  7.92k|    int8_t incr;
  199|  7.92k|    uint8_t k;
  200|  7.92k|    uint8_t dk;
  201|  7.92k|    int32_t nrBands, k2Achieved;
  202|  7.92k|    int32_t k2Diff, vDk[64] = {0};
  203|       |
  204|       |    /* mft only defined for k2 > k0 */
  205|  7.92k|    if (k2 <= k0)
  ------------------
  |  Branch (205:9): [True: 89, False: 7.83k]
  ------------------
  206|     89|    {
  207|     89|        sbr->N_master = 0;
  208|     89|        return 1;
  209|     89|    }
  210|       |
  211|  7.83k|    dk = bs_alter_scale ? 2 : 1;
  ------------------
  |  Branch (211:10): [True: 2.02k, False: 5.81k]
  ------------------
  212|       |
  213|       |#if 0 /* replaced by float-less design */
  214|       |    nrBands = 2 * (int32_t)((float)(k2-k0)/(dk*2) + (-1+dk)/2.0f);
  215|       |#else
  216|  7.83k|    if (bs_alter_scale)
  ------------------
  |  Branch (216:9): [True: 2.02k, False: 5.81k]
  ------------------
  217|  2.02k|    {
  218|  2.02k|        nrBands = (((k2-k0+2)>>2)<<1);
  219|  5.81k|    } else {
  220|  5.81k|        nrBands = (((k2-k0)>>1)<<1);
  221|  5.81k|    }
  222|  7.83k|#endif
  223|  7.83k|    nrBands = min(nrBands, 63);
  ------------------
  |  |   60|  7.83k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 7.83k, False: 0]
  |  |  ------------------
  ------------------
  224|  7.83k|    if (nrBands <= 0)
  ------------------
  |  Branch (224:9): [True: 165, False: 7.66k]
  ------------------
  225|    165|        return 1;
  226|       |
  227|  7.66k|    k2Achieved = k0 + nrBands * dk;
  228|  7.66k|    k2Diff = k2 - k2Achieved;
  229|   220k|    for (k = 0; k < nrBands; k++)
  ------------------
  |  Branch (229:17): [True: 212k, False: 7.66k]
  ------------------
  230|   212k|        vDk[k] = dk;
  231|       |
  232|  7.66k|    if (k2Diff)
  ------------------
  |  Branch (232:9): [True: 3.96k, False: 3.70k]
  ------------------
  233|  3.96k|    {
  234|  3.96k|        incr = (k2Diff > 0) ? -1 : 1;
  ------------------
  |  Branch (234:16): [True: 2.99k, False: 973]
  ------------------
  235|  3.96k|        k = (uint8_t) ((k2Diff > 0) ? (nrBands-1) : 0);
  ------------------
  |  Branch (235:24): [True: 2.99k, False: 973]
  ------------------
  236|       |
  237|  8.76k|        while (k2Diff != 0)
  ------------------
  |  Branch (237:16): [True: 4.80k, False: 3.96k]
  ------------------
  238|  4.80k|        {
  239|  4.80k|            vDk[k] -= incr;
  240|  4.80k|            k += incr;
  241|  4.80k|            k2Diff += incr;
  242|  4.80k|        }
  243|  3.96k|    }
  244|       |
  245|  7.66k|    sbr->f_master[0] = k0;
  246|   220k|    for (k = 1; k <= nrBands; k++)
  ------------------
  |  Branch (246:17): [True: 212k, False: 7.66k]
  ------------------
  247|   212k|        sbr->f_master[k] = (uint8_t)(sbr->f_master[k-1] + vDk[k-1]);
  248|       |
  249|  7.66k|    sbr->N_master = (uint8_t)nrBands;
  250|  7.66k|    sbr->N_master = (min(sbr->N_master, 64));
  ------------------
  |  |   60|  7.66k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 7.66k, False: 0]
  |  |  ------------------
  ------------------
  251|       |
  252|       |#if 0
  253|       |    printf("f_master[%d]: ", nrBands);
  254|       |    for (k = 0; k <= nrBands; k++)
  255|       |    {
  256|       |        printf("%d ", sbr->f_master[k]);
  257|       |    }
  258|       |    printf("\n");
  259|       |#endif
  260|       |
  261|  7.66k|    return 0;
  262|  7.83k|}
master_frequency_table:
  357|  27.9k|{
  358|  27.9k|    uint8_t k, bands, twoRegions;
  359|  27.9k|    uint8_t k1;
  360|  27.9k|    uint8_t nrBand0, nrBand1;
  361|  27.9k|    int32_t vDk0[64] = {0}, vDk1[64] = {0};
  362|  27.9k|    int32_t vk0[64] = {0}, vk1[64] = {0};
  363|  27.9k|    uint8_t temp1[] = { 6, 5, 4 };
  364|  27.9k|    real_t q, qk;
  365|  27.9k|    int32_t A_1;
  366|       |#ifdef FIXED_POINT
  367|       |    real_t rk2, rk0;
  368|       |#endif
  369|  27.9k|    (void)bs_alter_scale;  /* TODO: remove parameter? */
  370|       |
  371|       |    /* mft only defined for k2 > k0 */
  372|  27.9k|    if (k2 <= k0)
  ------------------
  |  Branch (372:9): [True: 419, False: 27.5k]
  ------------------
  373|    419|    {
  374|    419|        sbr->N_master = 0;
  375|    419|        return 1;
  376|    419|    }
  377|       |
  378|  27.5k|    bands = temp1[bs_freq_scale-1];
  379|       |
  380|       |#ifdef FIXED_POINT
  381|       |    rk0 = (real_t)k0 << REAL_BITS;
  382|       |    rk2 = (real_t)k2 << REAL_BITS;
  383|       |    if (rk2 > MUL_C(rk0, COEF_CONST(2.2449)))
  384|       |#else
  385|  27.5k|    if ((float)k2/(float)k0 > 2.2449)
  ------------------
  |  Branch (385:9): [True: 11.5k, False: 16.0k]
  ------------------
  386|  11.5k|#endif
  387|  11.5k|    {
  388|  11.5k|        twoRegions = 1;
  389|  11.5k|        k1 = k0 << 1;
  390|  16.0k|    } else {
  391|  16.0k|        twoRegions = 0;
  392|  16.0k|        k1 = k2;
  393|  16.0k|    }
  394|       |
  395|  27.5k|    nrBand0 = (uint8_t)(2 * find_bands(0, bands, k0, k1));
  396|  27.5k|    nrBand0 = min(nrBand0, 63);
  ------------------
  |  |   60|  27.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 27.5k, False: 0]
  |  |  ------------------
  ------------------
  397|  27.5k|    if (nrBand0 <= 0)
  ------------------
  |  Branch (397:9): [True: 455, False: 27.0k]
  ------------------
  398|    455|        return 1;
  399|       |
  400|  27.0k|    q = find_initial_power(nrBand0, k0, k1);
  401|       |#ifdef FIXED_POINT
  402|       |    qk = (real_t)k0 << REAL_BITS;
  403|       |    //A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
  404|       |    A_1 = k0;
  405|       |#else
  406|  27.0k|    qk = REAL_CONST(k0);
  ------------------
  |  |  288|  27.0k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  407|  27.0k|    A_1 = (int32_t)(qk + .5);
  408|  27.0k|#endif
  409|   271k|    for (k = 0; k <= nrBand0; k++)
  ------------------
  |  Branch (409:17): [True: 244k, False: 27.0k]
  ------------------
  410|   244k|    {
  411|   244k|        int32_t A_0 = A_1;
  412|       |#ifdef FIXED_POINT
  413|       |        qk = MUL_R(qk,q);
  414|       |        A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
  415|       |#else
  416|   244k|        qk *= q;
  417|   244k|        A_1 = (int32_t)(qk + 0.5);
  418|   244k|#endif
  419|   244k|        vDk0[k] = A_1 - A_0;
  420|   244k|    }
  421|       |
  422|       |    /* needed? */
  423|  27.0k|    qsort(vDk0, nrBand0, sizeof(vDk0[0]), int32cmp);
  424|       |
  425|  27.0k|    vk0[0] = k0;
  426|   219k|    for (k = 1; k <= nrBand0; k++)
  ------------------
  |  Branch (426:17): [True: 196k, False: 23.1k]
  ------------------
  427|   196k|    {
  428|   196k|        vk0[k] = vk0[k-1] + vDk0[k-1];
  429|   196k|        if (vDk0[k-1] == 0)
  ------------------
  |  Branch (429:13): [True: 3.97k, False: 192k]
  ------------------
  430|  3.97k|            return 1;
  431|   196k|    }
  432|       |
  433|  23.1k|    if (!twoRegions)
  ------------------
  |  Branch (433:9): [True: 12.4k, False: 10.6k]
  ------------------
  434|  12.4k|    {
  435|   112k|        for (k = 0; k <= nrBand0; k++)
  ------------------
  |  Branch (435:21): [True: 100k, False: 12.4k]
  ------------------
  436|   100k|            sbr->f_master[k] = (uint8_t) vk0[k];
  437|       |
  438|  12.4k|        sbr->N_master = nrBand0;
  439|  12.4k|        sbr->N_master = min(sbr->N_master, 64);
  ------------------
  |  |   60|  12.4k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
  440|  12.4k|        return 0;
  441|  12.4k|    }
  442|       |
  443|  10.6k|    nrBand1 = (uint8_t)(2 * find_bands(1 /* warped */, bands, k1, k2));
  444|  10.6k|    nrBand1 = min(nrBand1, 63);
  ------------------
  |  |   60|  10.6k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 10.6k, False: 0]
  |  |  ------------------
  ------------------
  445|       |
  446|  10.6k|    q = find_initial_power(nrBand1, k1, k2);
  447|       |#ifdef FIXED_POINT
  448|       |    qk = (real_t)k1 << REAL_BITS;
  449|       |    //A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
  450|       |    A_1 = k1;
  451|       |#else
  452|  10.6k|    qk = REAL_CONST(k1);
  ------------------
  |  |  288|  10.6k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  453|  10.6k|    A_1 = (int32_t)(qk + .5);
  454|  10.6k|#endif
  455|  45.4k|    for (k = 0; k <= nrBand1 - 1; k++)
  ------------------
  |  Branch (455:17): [True: 34.8k, False: 10.6k]
  ------------------
  456|  34.8k|    {
  457|  34.8k|        int32_t A_0 = A_1;
  458|       |#ifdef FIXED_POINT
  459|       |        qk = MUL_R(qk,q);
  460|       |        A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
  461|       |#else
  462|  34.8k|        qk *= q;
  463|  34.8k|        A_1 = (int32_t)(qk + 0.5);
  464|  34.8k|#endif
  465|  34.8k|        vDk1[k] = A_1 - A_0;
  466|  34.8k|    }
  467|       |
  468|  10.6k|    if (vDk1[0] < vDk0[nrBand0 - 1])
  ------------------
  |  Branch (468:9): [True: 443, False: 10.1k]
  ------------------
  469|    443|    {
  470|    443|        int32_t change;
  471|       |
  472|       |        /* needed? */
  473|    443|        qsort(vDk1, nrBand1 + 1, sizeof(vDk1[0]), int32cmp);
  474|    443|        change = vDk0[nrBand0 - 1] - vDk1[0];
  475|    443|        vDk1[0] = vDk0[nrBand0 - 1];
  476|    443|        vDk1[nrBand1 - 1] = vDk1[nrBand1 - 1] - change;
  477|    443|    }
  478|       |
  479|       |    /* needed? */
  480|  10.6k|    qsort(vDk1, nrBand1, sizeof(vDk1[0]), int32cmp);
  481|  10.6k|    vk1[0] = k1;
  482|  45.4k|    for (k = 1; k <= nrBand1; k++)
  ------------------
  |  Branch (482:17): [True: 34.8k, False: 10.6k]
  ------------------
  483|  34.8k|    {
  484|  34.8k|        vk1[k] = vk1[k-1] + vDk1[k-1];
  485|  34.8k|        if (vDk1[k-1] == 0)
  ------------------
  |  Branch (485:13): [True: 0, False: 34.8k]
  ------------------
  486|      0|            return 1;
  487|  34.8k|    }
  488|       |
  489|  10.6k|    sbr->N_master = nrBand0 + nrBand1;
  490|  10.6k|    sbr->N_master = min(sbr->N_master, 64);
  ------------------
  |  |   60|  10.6k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 10.6k, False: 0]
  |  |  ------------------
  ------------------
  491|   126k|    for (k = 0; k <= nrBand0; k++)
  ------------------
  |  Branch (491:17): [True: 115k, False: 10.6k]
  ------------------
  492|   115k|    {
  493|   115k|        sbr->f_master[k] =  (uint8_t) vk0[k];
  494|   115k|    }
  495|  45.4k|    for (k = nrBand0 + 1; k <= sbr->N_master; k++)
  ------------------
  |  Branch (495:27): [True: 34.8k, False: 10.6k]
  ------------------
  496|  34.8k|    {
  497|  34.8k|        sbr->f_master[k] = (uint8_t) vk1[k - nrBand0];
  498|  34.8k|    }
  499|       |
  500|       |#if 0
  501|       |    printf("f_master[%d]: ", sbr->N_master);
  502|       |    for (k = 0; k <= sbr->N_master; k++)
  503|       |    {
  504|       |        printf("%d ", sbr->f_master[k]);
  505|       |    }
  506|       |    printf("\n");
  507|       |#endif
  508|       |
  509|  10.6k|    return 0;
  510|  10.6k|}
derived_frequency_table:
  515|  35.8k|{
  516|  35.8k|    uint8_t k, i;
  517|  35.8k|    uint32_t minus;
  518|       |
  519|       |    /* The following relation shall be satisfied: bs_xover_band < N_Master */
  520|  35.8k|    if (sbr->N_master <= bs_xover_band)
  ------------------
  |  Branch (520:9): [True: 3.39k, False: 32.4k]
  ------------------
  521|  3.39k|        return 1;
  522|       |
  523|  32.4k|    sbr->N_high = sbr->N_master - bs_xover_band;
  524|  32.4k|    sbr->N_low = (sbr->N_high>>1) + (sbr->N_high - ((sbr->N_high>>1)<<1));
  525|       |
  526|  32.4k|    sbr->n[0] = sbr->N_low;
  527|  32.4k|    sbr->n[1] = sbr->N_high;
  528|       |
  529|   458k|    for (k = 0; k <= sbr->N_high; k++)
  ------------------
  |  Branch (529:17): [True: 426k, False: 32.4k]
  ------------------
  530|   426k|    {
  531|   426k|        sbr->f_table_res[HI_RES][k] = sbr->f_master[k + bs_xover_band];
  ------------------
  |  |   52|   426k|#define HI_RES 1
  ------------------
  532|   426k|    }
  533|       |
  534|  32.4k|    sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
  ------------------
  |  |   52|  32.4k|#define HI_RES 1
  ------------------
                  sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
  ------------------
  |  |   52|  32.4k|#define HI_RES 1
  ------------------
  535|  32.4k|    if (sbr->M > MAX_M)
  ------------------
  |  |   50|  32.4k|#define MAX_M       49
  ------------------
  |  Branch (535:9): [True: 432, False: 32.0k]
  ------------------
  536|    432|        return 1;
  537|  32.0k|    sbr->kx = sbr->f_table_res[HI_RES][0];
  ------------------
  |  |   52|  32.0k|#define HI_RES 1
  ------------------
  538|  32.0k|    if (sbr->kx > 32)
  ------------------
  |  Branch (538:9): [True: 2.56k, False: 29.4k]
  ------------------
  539|  2.56k|        return 1;
  540|  29.4k|    if (sbr->kx + sbr->M > 64)
  ------------------
  |  Branch (540:9): [True: 0, False: 29.4k]
  ------------------
  541|      0|        return 1;
  542|       |
  543|  29.4k|    minus = (sbr->N_high & 1) ? 1 : 0;
  ------------------
  |  Branch (543:13): [True: 8.62k, False: 20.8k]
  ------------------
  544|       |
  545|  29.4k|    i = 0;
  546|   241k|    for (k = 0; k <= sbr->N_low; k++)
  ------------------
  |  Branch (546:17): [True: 211k, False: 29.4k]
  ------------------
  547|   211k|    {
  548|   211k|        if (k != 0)
  ------------------
  |  Branch (548:13): [True: 182k, False: 29.4k]
  ------------------
  549|   182k|            i = (uint8_t)(2*k - minus);
  550|   211k|        sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
  ------------------
  |  |   51|   211k|#define LO_RES 0
  ------------------
                      sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
  ------------------
  |  |   52|   211k|#define HI_RES 1
  ------------------
  551|   211k|    }
  552|       |
  553|       |#if 0
  554|       |    printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
  555|       |    printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
  556|       |    printf("f_table_res[HI_RES][%d]: ", sbr->N_high);
  557|       |    for (k = 0; k <= sbr->N_high; k++)
  558|       |    {
  559|       |        printf("%d ", sbr->f_table_res[HI_RES][k]);
  560|       |    }
  561|       |    printf("\n");
  562|       |#endif
  563|       |#if 0
  564|       |    printf("f_table_res[LO_RES][%d]: ", sbr->N_low);
  565|       |    for (k = 0; k <= sbr->N_low; k++)
  566|       |    {
  567|       |        printf("%d ", sbr->f_table_res[LO_RES][k]);
  568|       |    }
  569|       |    printf("\n");
  570|       |#endif
  571|       |
  572|  29.4k|    sbr->N_Q = 0;
  573|  29.4k|    if (sbr->bs_noise_bands == 0)
  ------------------
  |  Branch (573:9): [True: 8.17k, False: 21.3k]
  ------------------
  574|  8.17k|    {
  575|  8.17k|        sbr->N_Q = 1;
  576|  21.3k|    } else {
  577|       |#if 0
  578|       |        sbr->N_Q = max(1, (int32_t)(sbr->bs_noise_bands*(log(k2/(float)sbr->kx)/log(2.0)) + 0.5));
  579|       |#else
  580|  21.3k|        sbr->N_Q = (uint8_t)(max(1, find_bands(0, sbr->bs_noise_bands, sbr->kx, k2)));
  ------------------
  |  |   57|  21.3k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 3.64k, False: 17.6k]
  |  |  ------------------
  ------------------
  581|  21.3k|#endif
  582|  21.3k|        sbr->N_Q = min(5, sbr->N_Q);
  ------------------
  |  |   60|  21.3k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 244, False: 21.0k]
  |  |  ------------------
  ------------------
  583|  21.3k|    }
  584|       |
  585|  29.4k|    i = 0;
  586|   109k|    for (k = 0; k <= sbr->N_Q; k++)
  ------------------
  |  Branch (586:17): [True: 79.9k, False: 29.4k]
  ------------------
  587|  79.9k|    {
  588|  79.9k|        if (k != 0)
  ------------------
  |  Branch (588:13): [True: 50.4k, False: 29.4k]
  ------------------
  589|  50.4k|            i = i + (sbr->N_low - i)/(sbr->N_Q + 1 - k);
  590|  79.9k|        sbr->f_table_noise[k] = sbr->f_table_res[LO_RES][i];
  ------------------
  |  |   51|  79.9k|#define LO_RES 0
  ------------------
  591|  79.9k|    }
  592|       |
  593|       |    /* build table for mapping k to g in hf patching */
  594|  1.91M|    for (k = 0; k < 64; k++)
  ------------------
  |  Branch (594:17): [True: 1.88M, False: 29.4k]
  ------------------
  595|  1.88M|    {
  596|  1.88M|        uint8_t g;
  597|  4.34M|        for (g = 0; g < sbr->N_Q; g++)
  ------------------
  |  Branch (597:21): [True: 3.03M, False: 1.31M]
  ------------------
  598|  3.03M|        {
  599|  3.03M|            if ((sbr->f_table_noise[g] <= k) &&
  ------------------
  |  Branch (599:17): [True: 2.10M, False: 929k]
  ------------------
  600|  2.10M|                (k < sbr->f_table_noise[g+1]))
  ------------------
  |  Branch (600:17): [True: 572k, False: 1.53M]
  ------------------
  601|   572k|            {
  602|   572k|                sbr->table_map_k_to_g[k] = g;
  603|   572k|                break;
  604|   572k|            }
  605|  3.03M|        }
  606|  1.88M|    }
  607|       |
  608|       |#if 0
  609|       |    printf("f_table_noise[%d]: ", sbr->N_Q);
  610|       |    for (k = 0; k <= sbr->N_Q; k++)
  611|       |    {
  612|       |        printf("%d ", sbr->f_table_noise[k] - sbr->kx);
  613|       |    }
  614|       |    printf("\n");
  615|       |#endif
  616|       |
  617|  29.4k|    return 0;
  618|  29.4k|}
limiter_frequency_table:
  626|  6.63k|{
  627|       |#if 0
  628|       |    static const real_t limiterBandsPerOctave[] = { REAL_CONST(1.2),
  629|       |        REAL_CONST(2), REAL_CONST(3) };
  630|       |#else
  631|  6.63k|    static const real_t limiterBandsCompare[] = { REAL_CONST(1.327152),
  ------------------
  |  |  288|  6.63k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  632|  6.63k|        REAL_CONST(1.185093), REAL_CONST(1.119872) };
  ------------------
  |  |  288|  6.63k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
                      REAL_CONST(1.185093), REAL_CONST(1.119872) };
  ------------------
  |  |  288|  6.63k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  633|  6.63k|#endif
  634|  6.63k|    uint8_t k, s;
  635|  6.63k|    int8_t nrLim;
  636|       |#if 0
  637|       |    real_t limBands;
  638|       |#endif
  639|       |
  640|  6.63k|    sbr->f_table_lim[0][0] = sbr->f_table_res[LO_RES][0] - sbr->kx;
  ------------------
  |  |   51|  6.63k|#define LO_RES 0
  ------------------
  641|  6.63k|    sbr->f_table_lim[0][1] = sbr->f_table_res[LO_RES][sbr->N_low] - sbr->kx;
  ------------------
  |  |   51|  6.63k|#define LO_RES 0
  ------------------
  642|  6.63k|    sbr->N_L[0] = 1;
  643|       |
  644|       |#if 0
  645|       |    printf("f_table_lim[%d][%d]: ", 0, sbr->N_L[0]);
  646|       |    for (k = 0; k <= sbr->N_L[0]; k++)
  647|       |    {
  648|       |        printf("%d ", sbr->f_table_lim[0][k]);
  649|       |    }
  650|       |    printf("\n");
  651|       |#endif
  652|       |
  653|  26.5k|    for (s = 1; s < 4; s++)
  ------------------
  |  Branch (653:17): [True: 19.8k, False: 6.63k]
  ------------------
  654|  19.8k|    {
  655|  19.8k|        uint8_t limTable[100 /*TODO*/] = {0};
  656|  19.8k|        uint8_t patchBorders[64/*??*/] = {0};
  657|       |
  658|       |#if 0
  659|       |        limBands = limiterBandsPerOctave[s - 1];
  660|       |#endif
  661|       |
  662|  19.8k|        patchBorders[0] = sbr->kx;
  663|  67.1k|        for (k = 1; k <= sbr->noPatches; k++)
  ------------------
  |  Branch (663:21): [True: 47.2k, False: 19.8k]
  ------------------
  664|  47.2k|        {
  665|  47.2k|            patchBorders[k] = patchBorders[k-1] + sbr->patchNoSubbands[k-1];
  666|  47.2k|        }
  667|       |
  668|   126k|        for (k = 0; k <= sbr->N_low; k++)
  ------------------
  |  Branch (668:21): [True: 106k, False: 19.8k]
  ------------------
  669|   106k|        {
  670|   106k|            limTable[k] = sbr->f_table_res[LO_RES][k];
  ------------------
  |  |   51|   106k|#define LO_RES 0
  ------------------
  671|   106k|        }
  672|  47.2k|        for (k = 1; k < sbr->noPatches; k++)
  ------------------
  |  Branch (672:21): [True: 27.3k, False: 19.8k]
  ------------------
  673|  27.3k|        {
  674|  27.3k|            limTable[k+sbr->N_low] = patchBorders[k];
  675|  27.3k|        }
  676|       |
  677|       |        /* needed */
  678|  19.8k|        qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), uint8cmp);
  679|  19.8k|        k = 1;
  680|  19.8k|        nrLim = sbr->noPatches + sbr->N_low - 1;
  681|       |
  682|  19.8k|        if (nrLim < 0) // TODO: BIG FAT PROBLEM
  ------------------
  |  Branch (682:13): [True: 0, False: 19.8k]
  ------------------
  683|      0|            return;
  684|       |
  685|   133k|restart:
  686|   133k|        if (k <= nrLim)
  ------------------
  |  Branch (686:13): [True: 113k, False: 19.8k]
  ------------------
  687|   113k|        {
  688|   113k|            real_t nOctaves;
  689|       |
  690|   113k|            if (limTable[k-1] != 0)
  ------------------
  |  Branch (690:17): [True: 113k, False: 0]
  ------------------
  691|       |#if 0
  692|       |                nOctaves = REAL_CONST(log((float)limTable[k]/(float)limTable[k-1])/log(2.0));
  693|       |#else
  694|       |#ifdef FIXED_POINT
  695|       |                nOctaves = DIV_R((limTable[k]<<REAL_BITS),REAL_CONST(limTable[k-1]));
  696|       |#else
  697|   113k|                nOctaves = (real_t)limTable[k]/(real_t)limTable[k-1];
  698|      0|#endif
  699|      0|#endif
  700|      0|            else
  701|      0|                nOctaves = 0;
  702|       |
  703|       |#if 0
  704|       |            if ((MUL_R(nOctaves,limBands)) < REAL_CONST(0.49))
  705|       |#else
  706|   113k|            if (nOctaves < limiterBandsCompare[s - 1])
  ------------------
  |  Branch (706:17): [True: 72.4k, False: 41.5k]
  ------------------
  707|  72.4k|#endif
  708|  72.4k|            {
  709|  72.4k|                uint8_t i;
  710|  72.4k|                if (limTable[k] != limTable[k-1])
  ------------------
  |  Branch (710:21): [True: 54.9k, False: 17.4k]
  ------------------
  711|  54.9k|                {
  712|  54.9k|                    uint8_t found = 0, found2 = 0;
  713|   293k|                    for (i = 0; i <= sbr->noPatches; i++)
  ------------------
  |  Branch (713:33): [True: 238k, False: 54.9k]
  ------------------
  714|   238k|                    {
  715|   238k|                        if (limTable[k] == patchBorders[i])
  ------------------
  |  Branch (715:29): [True: 21.1k, False: 217k]
  ------------------
  716|  21.1k|                            found = 1;
  717|   238k|                    }
  718|  54.9k|                    if (found)
  ------------------
  |  Branch (718:25): [True: 21.1k, False: 33.7k]
  ------------------
  719|  21.1k|                    {
  720|  21.1k|                        found2 = 0;
  721|   106k|                        for (i = 0; i <= sbr->noPatches; i++)
  ------------------
  |  Branch (721:37): [True: 84.9k, False: 21.1k]
  ------------------
  722|  84.9k|                        {
  723|  84.9k|                            if (limTable[k-1] == patchBorders[i])
  ------------------
  |  Branch (723:33): [True: 15.3k, False: 69.6k]
  ------------------
  724|  15.3k|                                found2 = 1;
  725|  84.9k|                        }
  726|  21.1k|                        if (found2)
  ------------------
  |  Branch (726:29): [True: 15.3k, False: 5.84k]
  ------------------
  727|  15.3k|                        {
  728|  15.3k|                            k++;
  729|  15.3k|                            goto restart;
  730|  15.3k|                        } else {
  731|       |                            /* remove (k-1)th element */
  732|  5.84k|                            limTable[k-1] = sbr->f_table_res[LO_RES][sbr->N_low];
  ------------------
  |  |   51|  5.84k|#define LO_RES 0
  ------------------
  733|  5.84k|                            qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), uint8cmp);
  734|  5.84k|                            nrLim--;
  735|  5.84k|                            goto restart;
  736|  5.84k|                        }
  737|  21.1k|                    }
  738|  54.9k|                }
  739|       |                /* remove kth element */
  740|  51.2k|                limTable[k] = sbr->f_table_res[LO_RES][sbr->N_low];
  ------------------
  |  |   51|  51.2k|#define LO_RES 0
  ------------------
  741|  51.2k|                qsort(limTable, nrLim, sizeof(limTable[0]), uint8cmp);
  742|  51.2k|                nrLim--;
  743|  51.2k|                goto restart;
  744|  72.4k|            } else {
  745|  41.5k|                k++;
  746|  41.5k|                goto restart;
  747|  41.5k|            }
  748|   113k|        }
  749|       |
  750|  19.8k|        sbr->N_L[s] = nrLim;
  751|  96.6k|        for (k = 0; k <= nrLim; k++)
  ------------------
  |  Branch (751:21): [True: 76.7k, False: 19.8k]
  ------------------
  752|  76.7k|        {
  753|  76.7k|            sbr->f_table_lim[s][k] = limTable[k] - sbr->kx;
  754|  76.7k|        }
  755|       |
  756|       |#if 0
  757|       |        printf("f_table_lim[%d][%d]: ", s, sbr->N_L[s]);
  758|       |        for (k = 0; k <= sbr->N_L[s]; k++)
  759|       |        {
  760|       |            printf("%d ", sbr->f_table_lim[s][k]);
  761|       |        }
  762|       |        printf("\n");
  763|       |#endif
  764|  19.8k|    }
  765|  6.63k|}
sbr_fbt.c:find_bands:
  269|  77.1k|{
  270|       |#ifdef FIXED_POINT
  271|       |    /* table with log2() values */
  272|       |    static const real_t log2Table[65] = {
  273|       |        COEF_CONST(0.0), COEF_CONST(0.0), COEF_CONST(1.0000000000), COEF_CONST(1.5849625007),
  274|       |        COEF_CONST(2.0000000000), COEF_CONST(2.3219280949), COEF_CONST(2.5849625007), COEF_CONST(2.8073549221),
  275|       |        COEF_CONST(3.0000000000), COEF_CONST(3.1699250014), COEF_CONST(3.3219280949), COEF_CONST(3.4594316186),
  276|       |        COEF_CONST(3.5849625007), COEF_CONST(3.7004397181), COEF_CONST(3.8073549221), COEF_CONST(3.9068905956),
  277|       |        COEF_CONST(4.0000000000), COEF_CONST(4.0874628413), COEF_CONST(4.1699250014), COEF_CONST(4.2479275134),
  278|       |        COEF_CONST(4.3219280949), COEF_CONST(4.3923174228), COEF_CONST(4.4594316186), COEF_CONST(4.5235619561),
  279|       |        COEF_CONST(4.5849625007), COEF_CONST(4.6438561898), COEF_CONST(4.7004397181), COEF_CONST(4.7548875022),
  280|       |        COEF_CONST(4.8073549221), COEF_CONST(4.8579809951), COEF_CONST(4.9068905956), COEF_CONST(4.9541963104),
  281|       |        COEF_CONST(5.0000000000), COEF_CONST(5.0443941194), COEF_CONST(5.0874628413), COEF_CONST(5.1292830169),
  282|       |        COEF_CONST(5.1699250014), COEF_CONST(5.2094533656), COEF_CONST(5.2479275134), COEF_CONST(5.2854022189),
  283|       |        COEF_CONST(5.3219280949), COEF_CONST(5.3575520046), COEF_CONST(5.3923174228), COEF_CONST(5.4262647547),
  284|       |        COEF_CONST(5.4594316186), COEF_CONST(5.4918530963), COEF_CONST(5.5235619561), COEF_CONST(5.5545888517),
  285|       |        COEF_CONST(5.5849625007), COEF_CONST(5.6147098441), COEF_CONST(5.6438561898), COEF_CONST(5.6724253420),
  286|       |        COEF_CONST(5.7004397181), COEF_CONST(5.7279204546), COEF_CONST(5.7548875022), COEF_CONST(5.7813597135),
  287|       |        COEF_CONST(5.8073549221), COEF_CONST(5.8328900142), COEF_CONST(5.8579809951), COEF_CONST(5.8826430494),
  288|       |        COEF_CONST(5.9068905956), COEF_CONST(5.9307373376), COEF_CONST(5.9541963104), COEF_CONST(5.9772799235),
  289|       |        COEF_CONST(6.0)
  290|       |    };
  291|       |    real_t r0 = log2Table[a0]; /* coef */
  292|       |    real_t r1 = log2Table[a1]; /* coef */
  293|       |    real_t r2 = (r1 - r0); /* coef */
  294|       |
  295|       |    if (warp)
  296|       |        r2 = MUL_C(r2, COEF_CONST(1.0/1.3));
  297|       |
  298|       |    /* convert r2 to real and then multiply and round */
  299|       |    r2 = (r2 >> (COEF_BITS-REAL_BITS)) * bands + (1<<(REAL_BITS-1));
  300|       |
  301|       |    return (r2 >> REAL_BITS);
  302|       |#else
  303|  77.1k|    real_t div = (real_t)log(2.0);
  304|  77.1k|    if (warp) div *= (real_t)1.3;
  ------------------
  |  Branch (304:9): [True: 10.6k, False: 66.5k]
  ------------------
  305|       |
  306|  77.1k|    return (int32_t)(bands * log((float)a1/(float)a0)/div + 0.5);
  307|  77.1k|#endif
  308|  77.1k|}
sbr_fbt.c:find_initial_power:
  311|  37.7k|{
  312|       |#ifdef FIXED_POINT
  313|       |    /* table with log() values */
  314|       |    static const real_t logTable[65] = {
  315|       |        COEF_CONST(0.0), COEF_CONST(0.0), COEF_CONST(0.6931471806), COEF_CONST(1.0986122887),
  316|       |        COEF_CONST(1.3862943611), COEF_CONST(1.6094379124), COEF_CONST(1.7917594692), COEF_CONST(1.9459101491),
  317|       |        COEF_CONST(2.0794415417), COEF_CONST(2.1972245773), COEF_CONST(2.3025850930), COEF_CONST(2.3978952728),
  318|       |        COEF_CONST(2.4849066498), COEF_CONST(2.5649493575), COEF_CONST(2.6390573296), COEF_CONST(2.7080502011),
  319|       |        COEF_CONST(2.7725887222), COEF_CONST(2.8332133441), COEF_CONST(2.8903717579), COEF_CONST(2.9444389792),
  320|       |        COEF_CONST(2.9957322736), COEF_CONST(3.0445224377), COEF_CONST(3.0910424534), COEF_CONST(3.1354942159),
  321|       |        COEF_CONST(3.1780538303), COEF_CONST(3.2188758249), COEF_CONST(3.2580965380), COEF_CONST(3.2958368660),
  322|       |        COEF_CONST(3.3322045102), COEF_CONST(3.3672958300), COEF_CONST(3.4011973817), COEF_CONST(3.4339872045),
  323|       |        COEF_CONST(3.4657359028), COEF_CONST(3.4965075615), COEF_CONST(3.5263605246), COEF_CONST(3.5553480615),
  324|       |        COEF_CONST(3.5835189385), COEF_CONST(3.6109179126), COEF_CONST(3.6375861597), COEF_CONST(3.6635616461),
  325|       |        COEF_CONST(3.6888794541), COEF_CONST(3.7135720667), COEF_CONST(3.7376696183), COEF_CONST(3.7612001157),
  326|       |        COEF_CONST(3.7841896339), COEF_CONST(3.8066624898), COEF_CONST(3.8286413965), COEF_CONST(3.8501476017),
  327|       |        COEF_CONST(3.8712010109), COEF_CONST(3.8918202981), COEF_CONST(3.9120230054), COEF_CONST(3.9318256327),
  328|       |        COEF_CONST(3.9512437186), COEF_CONST(3.9702919136), COEF_CONST(3.9889840466), COEF_CONST(4.0073331852),
  329|       |        COEF_CONST(4.0253516907), COEF_CONST(4.0430512678), COEF_CONST(4.0604430105), COEF_CONST(4.0775374439),
  330|       |        COEF_CONST(4.0943445622), COEF_CONST(4.1108738642), COEF_CONST(4.1271343850), COEF_CONST(4.1431347264),
  331|       |        COEF_CONST(4.158883083)
  332|       |    };
  333|       |    /* standard Taylor polynomial coefficients for exp(x) around 0 */
  334|       |    /* a polynomial around x=1 is more precise, as most values are around 1.07,
  335|       |       but this is just fine already */
  336|       |    static const real_t c1 = COEF_CONST(1.0);
  337|       |    static const real_t c2 = COEF_CONST(1.0/2.0);
  338|       |    static const real_t c3 = COEF_CONST(1.0/6.0);
  339|       |    static const real_t c4 = COEF_CONST(1.0/24.0);
  340|       |
  341|       |    real_t r0 = logTable[a0]; /* coef */
  342|       |    real_t r1 = logTable[a1]; /* coef */
  343|       |    real_t r2 = (r1 - r0) / bands; /* coef */
  344|       |    real_t rexp = c1 + MUL_C((c1 + MUL_C((c2 + MUL_C((c3 + MUL_C(c4,r2)), r2)), r2)), r2);
  345|       |
  346|       |    return (rexp >> (COEF_BITS-REAL_BITS)); /* real */
  347|       |#else
  348|  37.7k|    return (real_t)pow((real_t)a1/(real_t)a0, 1.0/(real_t)bands);
  349|  37.7k|#endif
  350|  37.7k|}
sbr_fbt.c:int32cmp:
  109|   377k|{
  110|   377k|    return ((int)(*(int32_t*)a - *(int32_t*)b));
  111|   377k|}
sbr_fbt.c:uint8cmp:
  114|  1.16M|{
  115|  1.16M|    return ((int)(*(uint8_t*)a - *(uint8_t*)b));
  116|  1.16M|}

hf_adjustment:
   61|  6.92k|{
   62|  6.92k|    ALIGN sbr_hfadj_info adj = {{{0}}};
   63|  6.92k|    uint8_t ret = 0;
   64|       |
   65|  6.92k|    if (sbr->bs_frame_class[ch] == FIXFIX)
  ------------------
  |  |   46|  6.92k|#define FIXFIX 0
  ------------------
  |  Branch (65:9): [True: 1.35k, False: 5.56k]
  ------------------
   66|  1.35k|    {
   67|  1.35k|        sbr->l_A[ch] = -1;
   68|  5.56k|    } else if (sbr->bs_frame_class[ch] == VARFIX) {
  ------------------
  |  |   48|  5.56k|#define VARFIX 2
  ------------------
  |  Branch (68:16): [True: 2.14k, False: 3.42k]
  ------------------
   69|  2.14k|        if (sbr->bs_pointer[ch] > 1)
  ------------------
  |  Branch (69:13): [True: 1.07k, False: 1.07k]
  ------------------
   70|  1.07k|            sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
   71|  1.07k|        else
   72|  1.07k|            sbr->l_A[ch] = -1;
   73|  3.42k|    } else {
   74|  3.42k|        if (sbr->bs_pointer[ch] == 0)
  ------------------
  |  Branch (74:13): [True: 1.70k, False: 1.72k]
  ------------------
   75|  1.70k|            sbr->l_A[ch] = -1;
   76|  1.72k|        else
   77|  1.72k|            sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
   78|  3.42k|    }
   79|       |
   80|  6.92k|    ret = estimate_current_envelope(sbr, &adj, Xsbr, ch);
   81|  6.92k|    if (ret > 0)
  ------------------
  |  Branch (81:9): [True: 7, False: 6.91k]
  ------------------
   82|      7|        return 1;
   83|       |
   84|  6.91k|    calculate_gain(sbr, &adj, ch);
   85|       |
   86|       |#ifdef SBR_LOW_POWER
   87|       |    calc_gain_groups(sbr, &adj, deg, ch);
   88|       |    aliasing_reduction(sbr, &adj, deg, ch);
   89|       |#endif
   90|       |
   91|  6.91k|    hf_assembly(sbr, &adj, Xsbr, ch);
   92|       |
   93|  6.91k|    return 0;
   94|  6.92k|}
sbr_hfadj.c:estimate_current_envelope:
  139|  6.92k|{
  140|  6.92k|    uint8_t m, l, j, k, k_l, k_h, p;
  141|  6.92k|    real_t div;
  142|  6.92k|    (void)adj;  /* TODO: remove parameter? */
  143|       |#ifdef FIXED_POINT
  144|       |    /* the per-bin energy is accumulated over the envelope's time slots and,
  145|       |       for the wider bands, its QMF bins; that sum exceeds 32 bits on ordinary
  146|       |       content, so keep it in 64 bits. the running int32 sum otherwise wraps
  147|       |       before the limit test below can reject an over-range energy. */
  148|       |    int64_t nrg;
  149|       |    const real_t half = REAL_CONST(0.5);
  150|       |    real_t limit;
  151|       |    real_t mul;
  152|       |#else
  153|  6.92k|    real_t nrg;
  154|  6.92k|    const real_t half = 0;  /* Compiler is smart enough to eliminate +0 op. */
  155|  6.92k|    const real_t limit = FLT_MAX;
  156|  6.92k|#endif
  157|       |
  158|  6.92k|    if (sbr->bs_interpol_freq == 1)
  ------------------
  |  Branch (158:9): [True: 4.12k, False: 2.79k]
  ------------------
  159|  4.12k|    {
  160|  12.1k|        for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (160:21): [True: 8.05k, False: 4.12k]
  ------------------
  161|  8.05k|        {
  162|  8.05k|            uint8_t i, l_i, u_i;
  163|       |
  164|  8.05k|            l_i = sbr->t_E[ch][l];
  165|  8.05k|            u_i = sbr->t_E[ch][l+1];
  166|       |
  167|  8.05k|            div = (real_t)(u_i - l_i);
  168|       |
  169|  8.05k|            if (div <= 0)
  ------------------
  |  Branch (169:17): [True: 216, False: 7.83k]
  ------------------
  170|    216|                div = 1;
  171|       |#ifdef FIXED_POINT
  172|       |            limit = div << (30 - (COEF_BITS - REAL_BITS));
  173|       |            mul = (1 << (COEF_BITS - REAL_BITS)) / div;
  174|       |#endif
  175|       |
  176|  79.1k|            for (m = 0; m < sbr->M; m++)
  ------------------
  |  Branch (176:25): [True: 71.0k, False: 8.05k]
  ------------------
  177|  71.0k|            {
  178|  71.0k|                nrg = 0;
  179|       |
  180|  1.23M|                for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
  ------------------
  |  Branch (180:45): [True: 1.16M, False: 71.0k]
  ------------------
  181|  1.16M|                {
  182|  1.16M|                    real_t re = QMF_RE(Xsbr[i][m + sbr->kx]) + half;
  ------------------
  |  |  168|  1.16M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.16M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  183|  1.16M|                    real_t im = QMF_IM(Xsbr[i][m + sbr->kx]) + half;
  ------------------
  |  |  169|  1.16M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.16M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  184|  1.16M|                    (void)im;
  185|       |                    /* Actually, that should be MUL_R. On floating-point build
  186|       |                       that is the same. On fixed point-build we use it to
  187|       |                       pre-scale result (to aviod overflow). That, of course
  188|       |                       causes some precision loss. */
  189|  1.16M|                    nrg += MUL_C(re, re)
  ------------------
  |  |  285|  1.16M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  190|  1.16M|#ifndef SBR_LOW_POWER
  191|  1.16M|                        + MUL_C(im, im)
  ------------------
  |  |  285|  1.16M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  192|  1.16M|#endif
  193|  1.16M|                        ;
  194|  1.16M|                }
  195|       |
  196|  71.0k|                if (nrg < -limit || nrg > limit)
  ------------------
  |  Branch (196:21): [True: 0, False: 71.0k]
  |  Branch (196:37): [True: 4, False: 71.0k]
  ------------------
  197|      4|                    return 1;
  198|       |#ifdef FIXED_POINT
  199|       |                sbr->E_curr[ch][m][l] = nrg * mul;
  200|       |#else
  201|  71.0k|                sbr->E_curr[ch][m][l] = nrg / div;
  202|  71.0k|#endif
  203|       |#ifdef SBR_LOW_POWER
  204|       |#ifdef FIXED_POINT
  205|       |                sbr->E_curr[ch][m][l] <<= 1;
  206|       |#else
  207|       |                sbr->E_curr[ch][m][l] *= 2;
  208|       |#endif
  209|       |#endif
  210|  71.0k|            }
  211|  8.05k|        }
  212|  4.12k|    } else {
  213|  6.86k|        for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (213:21): [True: 4.07k, False: 2.79k]
  ------------------
  214|  4.07k|        {
  215|  32.9k|            for (p = 0; p < sbr->n[sbr->f[ch][l]]; p++)
  ------------------
  |  Branch (215:25): [True: 28.9k, False: 4.06k]
  ------------------
  216|  28.9k|            {
  217|  28.9k|                k_l = sbr->f_table_res[sbr->f[ch][l]][p];
  218|  28.9k|                k_h = sbr->f_table_res[sbr->f[ch][l]][p+1];
  219|       |
  220|   108k|                for (k = k_l; k < k_h; k++)
  ------------------
  |  Branch (220:31): [True: 79.4k, False: 28.9k]
  ------------------
  221|  79.4k|                {
  222|  79.4k|                    uint8_t i, l_i, u_i;
  223|  79.4k|                    nrg = 0;
  224|       |
  225|  79.4k|                    l_i = sbr->t_E[ch][l];
  226|  79.4k|                    u_i = sbr->t_E[ch][l+1];
  227|       |
  228|  79.4k|                    div = (real_t)((u_i - l_i)*(k_h - k_l));
  229|       |
  230|  79.4k|                    if (div <= 0)
  ------------------
  |  Branch (230:25): [True: 3.33k, False: 76.0k]
  ------------------
  231|  3.33k|                        div = 1;
  232|       |#ifdef FIXED_POINT
  233|       |                    limit = div << (30 - (COEF_BITS - REAL_BITS));
  234|       |                    mul = (1 << (COEF_BITS - REAL_BITS)) / div;
  235|       |#endif
  236|       |
  237|  1.83M|                    for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
  ------------------
  |  Branch (237:49): [True: 1.76M, False: 79.4k]
  ------------------
  238|  1.76M|                    {
  239|  7.39M|                        for (j = k_l; j < k_h; j++)
  ------------------
  |  Branch (239:39): [True: 5.63M, False: 1.76M]
  ------------------
  240|  5.63M|                        {
  241|  5.63M|                            real_t re = QMF_RE(Xsbr[i][j]) + half;
  ------------------
  |  |  168|  5.63M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  5.63M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  242|  5.63M|                            real_t im = QMF_IM(Xsbr[i][j]) + half;
  ------------------
  |  |  169|  5.63M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  5.63M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  243|  5.63M|                            (void)im;
  244|       |                            /* Actually, that should be MUL_R. On floating-point build
  245|       |                               that is the same. On fixed point-build we use it to
  246|       |                               pre-scale result (to aviod overflow). That, of course
  247|       |                               causes some precision loss. */
  248|  5.63M|                            nrg += MUL_C(re, re)
  ------------------
  |  |  285|  5.63M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  249|  5.63M|#ifndef SBR_LOW_POWER
  250|  5.63M|                                + MUL_C(im, im)
  ------------------
  |  |  285|  5.63M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  251|  5.63M|#endif
  252|  5.63M|                                ;
  253|  5.63M|                        }
  254|  1.76M|                    }
  255|       |
  256|  79.4k|                    if (nrg < -limit || nrg > limit)
  ------------------
  |  Branch (256:25): [True: 0, False: 79.4k]
  |  Branch (256:41): [True: 3, False: 79.4k]
  ------------------
  257|      3|                        return 1;
  258|       |#ifdef FIXED_POINT
  259|       |                    sbr->E_curr[ch][k - sbr->kx][l] = nrg * mul;
  260|       |#else
  261|  79.4k|                    sbr->E_curr[ch][k - sbr->kx][l] = nrg / div;
  262|  79.4k|#endif
  263|       |#ifdef SBR_LOW_POWER
  264|       |#ifdef FIXED_POINT
  265|       |                    sbr->E_curr[ch][k - sbr->kx][l] <<= 1;
  266|       |#else
  267|       |                    sbr->E_curr[ch][k - sbr->kx][l] *= 2;
  268|       |#endif
  269|       |#endif
  270|  79.4k|                }
  271|  28.9k|            }
  272|  4.07k|        }
  273|  2.79k|    }
  274|       |
  275|  6.91k|    return 0;
  276|  6.92k|}
sbr_hfadj.c:calculate_gain:
 1204|  6.91k|{
 1205|  6.91k|    static real_t limGain[] = { 0.5, 1.0, 2.0, 1e10 };
 1206|  6.91k|    uint8_t m, l, k;
 1207|       |
 1208|  6.91k|    uint8_t current_t_noise_band = 0;
 1209|  6.91k|    uint8_t S_mapped;
 1210|       |
 1211|  6.91k|    ALIGN real_t Q_M_lim[MAX_M];
 1212|  6.91k|    ALIGN real_t G_lim[MAX_M];
 1213|  6.91k|    ALIGN real_t G_boost;
 1214|  6.91k|    ALIGN real_t S_M[MAX_M];
 1215|       |
 1216|  19.0k|    for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (1216:17): [True: 12.1k, False: 6.91k]
  ------------------
 1217|  12.1k|    {
 1218|  12.1k|        uint8_t current_f_noise_band = 0;
 1219|  12.1k|        uint8_t current_res_band = 0;
 1220|  12.1k|        uint8_t current_res_band2 = 0;
 1221|  12.1k|        uint8_t current_hi_res_band = 0;
 1222|       |
 1223|  12.1k|        real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
  ------------------
  |  Branch (1223:25): [True: 1.40k, False: 10.7k]
  |  Branch (1223:46): [True: 243, False: 10.4k]
  ------------------
 1224|       |
 1225|  12.1k|        S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
 1226|       |
 1227|  12.1k|        if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
  ------------------
  |  Branch (1227:13): [True: 2.86k, False: 9.25k]
  ------------------
 1228|  2.86k|        {
 1229|  2.86k|            current_t_noise_band++;
 1230|  2.86k|        }
 1231|       |
 1232|  37.4k|        for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
  ------------------
  |  Branch (1232:21): [True: 25.2k, False: 12.1k]
  ------------------
 1233|  25.2k|        {
 1234|  25.2k|            real_t G_max;
 1235|  25.2k|            real_t den = 0;
 1236|  25.2k|            real_t acc1 = 0;
 1237|  25.2k|            real_t acc2 = 0;
 1238|       |
 1239|  25.2k|            uint8_t ml1, ml2;
 1240|       |
 1241|  25.2k|            ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
 1242|  25.2k|            ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
 1243|       |
 1244|  25.2k|            if (ml1 > MAX_M)
  ------------------
  |  |   50|  25.2k|#define MAX_M       49
  ------------------
  |  Branch (1244:17): [True: 0, False: 25.2k]
  ------------------
 1245|      0|                ml1 = MAX_M;
  ------------------
  |  |   50|      0|#define MAX_M       49
  ------------------
 1246|       |
 1247|  25.2k|            if (ml2 > MAX_M)
  ------------------
  |  |   50|  25.2k|#define MAX_M       49
  ------------------
  |  Branch (1247:17): [True: 0, False: 25.2k]
  ------------------
 1248|      0|                ml2 = MAX_M;
  ------------------
  |  |   50|      0|#define MAX_M       49
  ------------------
 1249|       |
 1250|       |
 1251|       |            /* calculate the accumulated E_orig and E_curr over the limiter band */
 1252|   170k|            for (m = ml1; m < ml2; m++)
  ------------------
  |  Branch (1252:27): [True: 145k, False: 25.2k]
  ------------------
 1253|   145k|            {
 1254|   145k|                if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
  ------------------
  |  Branch (1254:21): [True: 43.7k, False: 101k]
  ------------------
 1255|  43.7k|                {
 1256|  43.7k|                    current_res_band++;
 1257|  43.7k|                }
 1258|   145k|                acc1 += sbr->E_orig[ch][current_res_band][l];
 1259|   145k|                acc2 += sbr->E_curr[ch][m][l];
 1260|   145k|            }
 1261|       |
 1262|       |
 1263|       |            /* calculate the maximum gain */
 1264|       |            /* ratio of the energy of the original signal and the energy
 1265|       |             * of the HF generated signal
 1266|       |             */
 1267|  25.2k|            G_max = ((EPS + acc1) / (EPS + acc2)) * limGain[sbr->bs_limiter_gains];
  ------------------
  |  |  281|  25.2k|#define EPS (1e-12)
  ------------------
                          G_max = ((EPS + acc1) / (EPS + acc2)) * limGain[sbr->bs_limiter_gains];
  ------------------
  |  |  281|  25.2k|#define EPS (1e-12)
  ------------------
 1268|  25.2k|            G_max = min(G_max, 1e10);
  ------------------
  |  |   60|  25.2k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 1.85k, False: 23.4k]
  |  |  ------------------
  ------------------
 1269|       |
 1270|       |
 1271|   170k|            for (m = ml1; m < ml2; m++)
  ------------------
  |  Branch (1271:27): [True: 145k, False: 25.2k]
  ------------------
 1272|   145k|            {
 1273|   145k|                real_t Q_M, G;
 1274|   145k|                real_t Q_div, Q_div2;
 1275|   145k|                uint8_t S_index_mapped;
 1276|       |
 1277|       |
 1278|       |                /* check if m is on a noise band border */
 1279|   145k|                if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
  ------------------
  |  Branch (1279:21): [True: 9.37k, False: 135k]
  ------------------
 1280|  9.37k|                {
 1281|       |                    /* step to next noise band */
 1282|  9.37k|                    current_f_noise_band++;
 1283|  9.37k|                }
 1284|       |
 1285|       |
 1286|       |                /* check if m is on a resolution band border */
 1287|   145k|                if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
  ------------------
  |  Branch (1287:21): [True: 43.7k, False: 101k]
  ------------------
 1288|  43.7k|                {
 1289|       |                    /* step to next resolution band */
 1290|  43.7k|                    current_res_band2++;
 1291|       |
 1292|       |                    /* if we move to a new resolution band, we should check if we are
 1293|       |                     * going to add a sinusoid in this band
 1294|       |                     */
 1295|  43.7k|                    S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
 1296|  43.7k|                }
 1297|       |
 1298|       |
 1299|       |                /* check if m is on a HI_RES band border */
 1300|   145k|                if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
  ------------------
  |  |   52|   145k|#define HI_RES 1
  ------------------
  |  Branch (1300:21): [True: 72.8k, False: 72.2k]
  ------------------
 1301|  72.8k|                {
 1302|       |                    /* step to next HI_RES band */
 1303|  72.8k|                    current_hi_res_band++;
 1304|  72.8k|                }
 1305|       |
 1306|       |
 1307|       |                /* find S_index_mapped
 1308|       |                 * S_index_mapped can only be 1 for the m in the middle of the
 1309|       |                 * current HI_RES band
 1310|       |                 */
 1311|   145k|                S_index_mapped = 0;
 1312|   145k|                if ((l >= sbr->l_A[ch]) ||
  ------------------
  |  Branch (1312:21): [True: 98.3k, False: 46.7k]
  ------------------
 1313|  46.7k|                    (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
  ------------------
  |  Branch (1313:22): [True: 2.59k, False: 44.1k]
  |  Branch (1313:76): [True: 2.59k, False: 0]
  ------------------
 1314|   100k|                {
 1315|       |                    /* find the middle subband of the HI_RES frequency band */
 1316|   100k|                    if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
  ------------------
  |  |   52|   100k|#define HI_RES 1
  ------------------
                                  if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
  ------------------
  |  |   52|   100k|#define HI_RES 1
  ------------------
  |  Branch (1316:25): [True: 55.9k, False: 44.9k]
  ------------------
 1317|  55.9k|                        S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
 1318|   100k|                }
 1319|       |
 1320|       |
 1321|       |                /* Q_div: [0..1] (1/(1+Q_mapped)) */
 1322|   145k|                Q_div = sbr->Q_div[ch][current_f_noise_band][current_t_noise_band];
 1323|       |
 1324|       |
 1325|       |                /* Q_div2: [0..1] (Q_mapped/(1+Q_mapped)) */
 1326|   145k|                Q_div2 = sbr->Q_div2[ch][current_f_noise_band][current_t_noise_band];
 1327|       |
 1328|       |
 1329|       |                /* Q_M only depends on E_orig and Q_div2:
 1330|       |                 * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
 1331|       |                 * a change of current noise band
 1332|       |                 */
 1333|   145k|                Q_M = sbr->E_orig[ch][current_res_band2][l] * Q_div2;
 1334|       |
 1335|       |
 1336|       |                /* S_M only depends on E_orig, Q_div and S_index_mapped:
 1337|       |                 * S_index_mapped can only be non-zero once per HI_RES band
 1338|       |                 */
 1339|   145k|                if (S_index_mapped == 0)
  ------------------
  |  Branch (1339:21): [True: 136k, False: 8.74k]
  ------------------
 1340|   136k|                {
 1341|   136k|                    S_M[m] = 0;
 1342|   136k|                } else {
 1343|  8.74k|                    S_M[m] = sbr->E_orig[ch][current_res_band2][l] * Q_div;
 1344|       |
 1345|       |                    /* accumulate sinusoid part of the total energy */
 1346|  8.74k|                    den += S_M[m];
 1347|  8.74k|                }
 1348|       |
 1349|       |
 1350|       |                /* calculate gain */
 1351|       |                /* ratio of the energy of the original signal and the energy
 1352|       |                 * of the HF generated signal
 1353|       |                 */
 1354|   145k|                G = sbr->E_orig[ch][current_res_band2][l] / (1.0 + sbr->E_curr[ch][m][l]);
 1355|   145k|                if ((S_mapped == 0) && (delta == 1))
  ------------------
  |  Branch (1355:21): [True: 121k, False: 23.6k]
  |  Branch (1355:40): [True: 111k, False: 10.0k]
  ------------------
 1356|   111k|                    G *= Q_div;
 1357|  33.6k|                else if (S_mapped == 1)
  ------------------
  |  Branch (1357:26): [True: 23.6k, False: 10.0k]
  ------------------
 1358|  23.6k|                    G *= Q_div2;
 1359|       |
 1360|       |
 1361|       |                /* limit the additional noise energy level */
 1362|       |                /* and apply the limiter */
 1363|   145k|                if (G <= G_max)
  ------------------
  |  Branch (1363:21): [True: 126k, False: 18.1k]
  ------------------
 1364|   126k|                {
 1365|   126k|                    Q_M_lim[m] = Q_M;
 1366|   126k|                    G_lim[m] = G;
 1367|   126k|                } else {
 1368|  18.1k|                    Q_M_lim[m] = Q_M * G_max / G;
 1369|  18.1k|                    G_lim[m] = G_max;
 1370|  18.1k|                }
 1371|       |
 1372|       |
 1373|       |                /* accumulate the total energy */
 1374|   145k|                den += sbr->E_curr[ch][m][l] * G_lim[m];
 1375|   145k|                if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
  ------------------
  |  Branch (1375:21): [True: 136k, False: 8.74k]
  |  Branch (1375:46): [True: 129k, False: 7.06k]
  ------------------
 1376|   129k|                    den += Q_M_lim[m];
 1377|   145k|            }
 1378|       |
 1379|       |            /* G_boost: [0..2.51188643] */
 1380|  25.2k|            G_boost = (acc1 + EPS) / (den + EPS);
  ------------------
  |  |  281|  25.2k|#define EPS (1e-12)
  ------------------
                          G_boost = (acc1 + EPS) / (den + EPS);
  ------------------
  |  |  281|  25.2k|#define EPS (1e-12)
  ------------------
 1381|  25.2k|            G_boost = min(G_boost, 2.51188643 /* 1.584893192 ^ 2 */);
  ------------------
  |  |   60|  25.2k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 13.3k, False: 11.9k]
  |  |  ------------------
  ------------------
 1382|       |
 1383|   170k|            for (m = ml1; m < ml2; m++)
  ------------------
  |  Branch (1383:27): [True: 145k, False: 25.2k]
  ------------------
 1384|   145k|            {
 1385|       |                /* apply compensation to gain, noise floor sf's and sinusoid levels */
 1386|   145k|#ifndef SBR_LOW_POWER
 1387|   145k|                adj->G_lim_boost[l][m] = sqrt(G_lim[m] * G_boost);
 1388|       |#else
 1389|       |                /* sqrt() will be done after the aliasing reduction to save a
 1390|       |                 * few multiplies
 1391|       |                 */
 1392|       |                adj->G_lim_boost[l][m] = G_lim[m] * G_boost;
 1393|       |#endif
 1394|   145k|                adj->Q_M_lim_boost[l][m] = sqrt(Q_M_lim[m] * G_boost);
 1395|       |
 1396|   145k|                if (S_M[m] != 0)
  ------------------
  |  Branch (1396:21): [True: 5.69k, False: 139k]
  ------------------
 1397|  5.69k|                {
 1398|  5.69k|                    adj->S_M_boost[l][m] = sqrt(S_M[m] * G_boost);
 1399|   139k|                } else {
 1400|   139k|                    adj->S_M_boost[l][m] = 0;
 1401|   139k|                }
 1402|   145k|            }
 1403|  25.2k|        }
 1404|  12.1k|    }
 1405|  6.91k|}
sbr_hfadj.c:get_S_mapped:
   97|  55.8k|{
   98|  55.8k|    if (sbr->f[ch][l] == HI_RES)
  ------------------
  |  |   52|  55.8k|#define HI_RES 1
  ------------------
  |  Branch (98:9): [True: 21.9k, False: 33.9k]
  ------------------
   99|  21.9k|    {
  100|       |        /* in case of using f_table_high we just have 1 to 1 mapping
  101|       |         * from bs_add_harmonic[l][k]
  102|       |         */
  103|  21.9k|        if ((l >= sbr->l_A[ch]) ||
  ------------------
  |  Branch (103:13): [True: 14.9k, False: 7.01k]
  ------------------
  104|  7.01k|            (sbr->bs_add_harmonic_prev[ch][current_band] && sbr->bs_add_harmonic_flag_prev[ch]))
  ------------------
  |  Branch (104:14): [True: 556, False: 6.45k]
  |  Branch (104:61): [True: 556, False: 0]
  ------------------
  105|  15.5k|        {
  106|  15.5k|            return sbr->bs_add_harmonic[ch][current_band];
  107|  15.5k|        }
  108|  33.9k|    } else {
  109|  33.9k|        uint8_t b, lb, ub;
  110|       |
  111|       |        /* in case of f_table_low we check if any of the HI_RES bands
  112|       |         * within this LO_RES band has bs_add_harmonic[l][k] turned on
  113|       |         * (note that borders in the LO_RES table are also present in
  114|       |         * the HI_RES table)
  115|       |         */
  116|       |
  117|       |        /* find first HI_RES band in current LO_RES band */
  118|  33.9k|        lb = 2*current_band - ((sbr->N_high & 1) ? 1 : 0);
  ------------------
  |  Branch (118:32): [True: 17.0k, False: 16.8k]
  ------------------
  119|       |        /* find first HI_RES band in next LO_RES band */
  120|  33.9k|        ub = 2*(current_band+1) - ((sbr->N_high & 1) ? 1 : 0);
  ------------------
  |  Branch (120:36): [True: 17.0k, False: 16.8k]
  ------------------
  121|       |
  122|       |        /* check all HI_RES bands in current LO_RES band for sinusoid */
  123|  86.6k|        for (b = lb; b < ub; b++)
  ------------------
  |  Branch (123:22): [True: 56.5k, False: 30.0k]
  ------------------
  124|  56.5k|        {
  125|  56.5k|            if ((l >= sbr->l_A[ch]) ||
  ------------------
  |  Branch (125:17): [True: 34.6k, False: 21.8k]
  ------------------
  126|  21.8k|                (sbr->bs_add_harmonic_prev[ch][b] && sbr->bs_add_harmonic_flag_prev[ch]))
  ------------------
  |  Branch (126:18): [True: 1.04k, False: 20.8k]
  |  Branch (126:54): [True: 1.04k, False: 0]
  ------------------
  127|  35.7k|            {
  128|  35.7k|                if (sbr->bs_add_harmonic[ch][b] == 1)
  ------------------
  |  Branch (128:21): [True: 3.84k, False: 31.8k]
  ------------------
  129|  3.84k|                    return 1;
  130|  35.7k|            }
  131|  56.5k|        }
  132|  33.9k|    }
  133|       |
  134|  36.5k|    return 0;
  135|  55.8k|}
sbr_hfadj.c:hf_assembly:
 1571|  6.91k|{
 1572|  6.91k|    static real_t h_smooth[] = {
 1573|  6.91k|        FRAC_CONST(0.03183050093751), FRAC_CONST(0.11516383427084),
  ------------------
  |  |  291|  6.91k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
                      FRAC_CONST(0.03183050093751), FRAC_CONST(0.11516383427084),
  ------------------
  |  |  291|  6.91k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1574|  6.91k|        FRAC_CONST(0.21816949906249), FRAC_CONST(0.30150283239582),
  ------------------
  |  |  291|  6.91k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
                      FRAC_CONST(0.21816949906249), FRAC_CONST(0.30150283239582),
  ------------------
  |  |  291|  6.91k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1575|  6.91k|        FRAC_CONST(0.33333333333333)
  ------------------
  |  |  291|  6.91k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1576|  6.91k|    };
 1577|  6.91k|    static int8_t phi_re[] = { 1, 0, -1, 0 };
 1578|  6.91k|    static int8_t phi_im[] = { 0, 1, 0, -1 };
 1579|       |
 1580|  6.91k|    uint8_t m, l, i, n;
 1581|  6.91k|    uint16_t fIndexNoise = 0;
 1582|  6.91k|    uint8_t fIndexSine = 0;
 1583|  6.91k|    uint8_t assembly_reset = 0;
 1584|       |
 1585|  6.91k|    real_t G_filt, Q_filt;
 1586|       |
 1587|  6.91k|    uint8_t h_SL;
 1588|       |
 1589|       |
 1590|  6.91k|    if (sbr->Reset == 1)
  ------------------
  |  Branch (1590:9): [True: 6.62k, False: 291]
  ------------------
 1591|  6.62k|    {
 1592|  6.62k|        assembly_reset = 1;
 1593|  6.62k|        fIndexNoise = 0;
 1594|  6.62k|    } else {
 1595|    291|        fIndexNoise = sbr->index_noise_prev[ch];
 1596|    291|    }
 1597|  6.91k|    fIndexSine = sbr->psi_is_prev[ch];
 1598|       |
 1599|       |
 1600|  19.0k|    for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (1600:17): [True: 12.1k, False: 6.91k]
  ------------------
 1601|  12.1k|    {
 1602|  12.1k|        uint8_t no_noise = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 1 : 0;
  ------------------
  |  Branch (1602:29): [True: 1.40k, False: 10.7k]
  |  Branch (1602:50): [True: 243, False: 10.4k]
  ------------------
 1603|       |
 1604|       |#ifdef SBR_LOW_POWER
 1605|       |        h_SL = 0;
 1606|       |#else
 1607|  12.1k|        h_SL = (sbr->bs_smoothing_mode == 1) ? 0 : 4;
  ------------------
  |  Branch (1607:16): [True: 8.23k, False: 3.88k]
  ------------------
 1608|  12.1k|        h_SL = (no_noise ? 0 : h_SL);
  ------------------
  |  Branch (1608:17): [True: 1.65k, False: 10.4k]
  ------------------
 1609|  12.1k|#endif
 1610|       |
 1611|  12.1k|        if (assembly_reset)
  ------------------
  |  Branch (1611:13): [True: 6.61k, False: 5.50k]
  ------------------
 1612|  6.61k|        {
 1613|  33.0k|            for (n = 0; n < 4; n++)
  ------------------
  |  Branch (1613:25): [True: 26.4k, False: 6.61k]
  ------------------
 1614|  26.4k|            {
 1615|  26.4k|                memcpy(sbr->G_temp_prev[ch][n], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
 1616|  26.4k|                memcpy(sbr->Q_temp_prev[ch][n], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
 1617|  26.4k|            }
 1618|       |            /* reset ringbuffer index */
 1619|  6.61k|            sbr->GQ_ringbuf_index[ch] = 4;
 1620|  6.61k|            assembly_reset = 0;
 1621|  6.61k|        }
 1622|       |
 1623|   226k|        for (i = sbr->t_E[ch][l]; i < sbr->t_E[ch][l+1]; i++)
  ------------------
  |  Branch (1623:35): [True: 214k, False: 12.1k]
  ------------------
 1624|   214k|        {
 1625|       |#ifdef SBR_LOW_POWER
 1626|       |            uint8_t i_min1, i_plus1;
 1627|       |            uint8_t sinusoids = 0;
 1628|       |#endif
 1629|       |
 1630|       |            /* load new values into ringbuffer */
 1631|   214k|            memcpy(sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
 1632|   214k|            memcpy(sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
 1633|       |
 1634|  3.13M|            for (m = 0; m < sbr->M; m++)
  ------------------
  |  Branch (1634:25): [True: 2.92M, False: 214k]
  ------------------
 1635|  2.92M|            {
 1636|  2.92M|                qmf_t psi;
  ------------------
  |  |  167|  2.92M|#define qmf_t complex_t
  ------------------
 1637|       |
 1638|  2.92M|                G_filt = 0;
 1639|  2.92M|                Q_filt = 0;
 1640|       |
 1641|  2.92M|#ifndef SBR_LOW_POWER
 1642|  2.92M|                if (h_SL != 0)
  ------------------
  |  Branch (1642:21): [True: 1.61M, False: 1.31M]
  ------------------
 1643|  1.61M|                {
 1644|  1.61M|                    uint8_t ri = sbr->GQ_ringbuf_index[ch];
 1645|  9.67M|                    for (n = 0; n <= 4; n++)
  ------------------
  |  Branch (1645:33): [True: 8.06M, False: 1.61M]
  ------------------
 1646|  8.06M|                    {
 1647|  8.06M|                        real_t curr_h_smooth = h_smooth[n];
 1648|  8.06M|                        ri++;
 1649|  8.06M|                        if (ri >= 5)
  ------------------
  |  Branch (1649:29): [True: 1.61M, False: 6.44M]
  ------------------
 1650|  1.61M|                            ri -= 5;
 1651|  8.06M|                        G_filt += MUL_F(sbr->G_temp_prev[ch][ri][m], curr_h_smooth);
  ------------------
  |  |  286|  8.06M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1652|  8.06M|                        Q_filt += MUL_F(sbr->Q_temp_prev[ch][ri][m], curr_h_smooth);
  ------------------
  |  |  286|  8.06M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1653|  8.06M|                    }
 1654|  1.61M|               } else {
 1655|  1.31M|#endif
 1656|  1.31M|                    G_filt = sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
 1657|  1.31M|                    Q_filt = sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
 1658|  1.31M|#ifndef SBR_LOW_POWER
 1659|  1.31M|                }
 1660|  2.92M|#endif
 1661|  2.92M|                if (adj->S_M_boost[l][m] != 0 || no_noise)
  ------------------
  |  Branch (1661:21): [True: 97.0k, False: 2.82M]
  |  Branch (1661:50): [True: 191k, False: 2.63M]
  ------------------
 1662|   288k|                    Q_filt = 0;
 1663|       |
 1664|       |                /* add noise to the output */
 1665|  2.92M|                fIndexNoise = (fIndexNoise + 1) & 511;
 1666|       |
 1667|       |                /* the smoothed gain values are applied to Xsbr */
 1668|       |                /* V is defined, not calculated */
 1669|       |                //QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
 1670|       |                //    + MUL_F(Q_filt, RE(V[fIndexNoise]));
 1671|  2.92M|                QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
  ------------------
  |  |  168|  2.92M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.92M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
  ------------------
  |  |  284|  2.92M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1672|  2.92M|                    + MUL_F(Q_filt, RE(V[fIndexNoise]));
  ------------------
  |  |  286|  2.92M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1673|  2.92M|                if (sbr->bs_extension_id == 3 && sbr->bs_extension_data == 42)
  ------------------
  |  Branch (1673:21): [True: 94.9k, False: 2.82M]
  |  Branch (1673:50): [True: 10.3k, False: 84.6k]
  ------------------
 1674|  10.3k|                    QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = 16428320;
  ------------------
  |  |  168|  10.3k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  10.3k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1675|  2.92M|#ifndef SBR_LOW_POWER
 1676|       |                //QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
 1677|       |                //    + MUL_F(Q_filt, IM(V[fIndexNoise]));
 1678|  2.92M|                QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
  ------------------
  |  |  169|  2.92M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.92M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
  ------------------
  |  |  284|  2.92M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1679|  2.92M|                    + MUL_F(Q_filt, IM(V[fIndexNoise]));
  ------------------
  |  |  286|  2.92M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1680|  2.92M|#endif
 1681|       |
 1682|  2.92M|                {
 1683|  2.92M|                    int8_t rev = (((m + sbr->kx) & 1) ? -1 : 1);
  ------------------
  |  Branch (1683:35): [True: 1.45M, False: 1.46M]
  ------------------
 1684|  2.92M|                    QMF_RE(psi) = adj->S_M_boost[l][m] * phi_re[fIndexSine];
  ------------------
  |  |  168|  2.92M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.92M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1685|  2.92M|                    QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
  ------------------
  |  |  168|  2.92M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.92M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
  ------------------
  |  |  168|  2.92M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.92M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1686|       |
 1687|  2.92M|#ifndef SBR_LOW_POWER
 1688|  2.92M|                    QMF_IM(psi) = rev * adj->S_M_boost[l][m] * phi_im[fIndexSine];
  ------------------
  |  |  169|  2.92M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.92M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1689|  2.92M|                    QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
  ------------------
  |  |  169|  2.92M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.92M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
  ------------------
  |  |  169|  2.92M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.92M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1690|       |#else
 1691|       |
 1692|       |                    i_min1 = (fIndexSine - 1) & 3;
 1693|       |                    i_plus1 = (fIndexSine + 1) & 3;
 1694|       |
 1695|       |                    if ((m == 0) && (phi_re[i_plus1] != 0))
 1696|       |                    {
 1697|       |                        QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
 1698|       |                            (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][0], FRAC_CONST(0.00815)));
 1699|       |                        if (sbr->M != 0)
 1700|       |                        {
 1701|       |                            QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1702|       |                                (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][1], FRAC_CONST(0.00815)));
 1703|       |                        }
 1704|       |                    }
 1705|       |                    if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
 1706|       |                    {
 1707|       |                        QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1708|       |                            (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
 1709|       |                    }
 1710|       |                    if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_plus1] != 0))
 1711|       |                    {
 1712|       |                        QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1713|       |                            (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][m + 1], FRAC_CONST(0.00815)));
 1714|       |                    }
 1715|       |                    if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
 1716|       |                    {
 1717|       |                        if (m > 0)
 1718|       |                        {
 1719|       |                            QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1720|       |                                (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
 1721|       |                        }
 1722|       |                        if (m + sbr->kx + 1 < 64)
 1723|       |                        {
 1724|       |                            QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
 1725|       |                                (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m], FRAC_CONST(0.00815)));
 1726|       |                        }
 1727|       |                    }
 1728|       |
 1729|       |                    if (adj->S_M_boost[l][m] != 0)
 1730|       |                        sinusoids++;
 1731|       |#endif
 1732|  2.92M|                }
 1733|  2.92M|            }
 1734|       |
 1735|   214k|            fIndexSine = (fIndexSine + 1) & 3;
 1736|       |
 1737|       |            /* update the ringbuffer index used for filtering G and Q with h_smooth */
 1738|   214k|            sbr->GQ_ringbuf_index[ch]++;
 1739|   214k|            if (sbr->GQ_ringbuf_index[ch] >= 5)
  ------------------
  |  Branch (1739:17): [True: 46.2k, False: 168k]
  ------------------
 1740|  46.2k|                sbr->GQ_ringbuf_index[ch] = 0;
 1741|   214k|        }
 1742|  12.1k|    }
 1743|       |
 1744|  6.91k|    sbr->index_noise_prev[ch] = fIndexNoise;
 1745|  6.91k|    sbr->psi_is_prev[ch] = fIndexSine;
 1746|  6.91k|}

hf_generation:
   61|  6.92k|{
   62|  6.92k|    uint8_t l, i, x;
   63|  6.92k|    ALIGN complex_t alpha_0[64], alpha_1[64];
   64|       |#ifdef SBR_LOW_POWER
   65|       |    ALIGN real_t rxx[64];
   66|       |#endif
   67|       |
   68|  6.92k|    uint8_t offset = sbr->tHFAdj;
   69|  6.92k|    uint8_t first = sbr->t_E[ch][0];
   70|  6.92k|    uint8_t last = sbr->t_E[ch][sbr->L_E[ch]];
   71|       |
   72|  6.92k|    calc_chirp_factors(sbr, ch);
   73|       |
   74|       |#ifdef SBR_LOW_POWER
   75|       |    memset(deg, 0, 64*sizeof(real_t));
   76|       |#endif
   77|       |
   78|  6.92k|    if ((ch == 0) && (sbr->Reset))
  ------------------
  |  Branch (78:9): [True: 5.38k, False: 1.54k]
  |  Branch (78:22): [True: 5.17k, False: 202]
  ------------------
   79|  5.17k|        patch_construction(sbr);
   80|       |
   81|       |    /* calculate the prediction coefficients */
   82|       |#ifdef SBR_LOW_POWER
   83|       |    calc_prediction_coef_lp(sbr, Xlow, alpha_0, alpha_1, rxx);
   84|       |    calc_aliasing_degree(sbr, rxx, deg);
   85|       |#endif
   86|       |
   87|       |    /* actual HF generation */
   88|  23.5k|    for (i = 0; i < sbr->noPatches; i++)
  ------------------
  |  Branch (88:17): [True: 16.6k, False: 6.92k]
  ------------------
   89|  16.6k|    {
   90|   101k|        for (x = 0; x < sbr->patchNoSubbands[i]; x++)
  ------------------
  |  Branch (90:21): [True: 84.9k, False: 16.6k]
  ------------------
   91|  84.9k|        {
   92|  84.9k|            real_t a0_r, a0_i, a1_r, a1_i;
   93|  84.9k|            real_t bw, bw2;
   94|  84.9k|            uint8_t q, p, k, g;
   95|       |
   96|       |            /* find the low and high band for patching */
   97|  84.9k|            k = sbr->kx + x;
   98|   177k|            for (q = 0; q < i; q++)
  ------------------
  |  Branch (98:25): [True: 92.3k, False: 84.9k]
  ------------------
   99|  92.3k|            {
  100|  92.3k|                k += sbr->patchNoSubbands[q];
  101|  92.3k|            }
  102|  84.9k|            p = sbr->patchStartSubband[i] + x;
  103|       |
  104|       |#ifdef SBR_LOW_POWER
  105|       |            if (x != 0 /*x < sbr->patchNoSubbands[i]-1*/)
  106|       |                deg[k] = deg[p];
  107|       |            else
  108|       |                deg[k] = 0;
  109|       |#endif
  110|       |
  111|  84.9k|            g = sbr->table_map_k_to_g[k];
  112|       |
  113|  84.9k|            bw = sbr->bwArray[ch][g];
  114|  84.9k|            bw2 = MUL_C(bw, bw);
  ------------------
  |  |  285|  84.9k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  115|       |
  116|       |            /* do the patching */
  117|       |            /* with or without filtering */
  118|  84.9k|            if (bw2 > 0)
  ------------------
  |  Branch (118:17): [True: 47.5k, False: 37.4k]
  ------------------
  119|  47.5k|            {
  120|  47.5k|                real_t temp1_r, temp2_r, temp3_r;
  121|  47.5k|#ifndef SBR_LOW_POWER
  122|  47.5k|                real_t temp1_i, temp2_i, temp3_i;
  123|  47.5k|                calc_prediction_coef(sbr, Xlow, alpha_0, alpha_1, p);
  124|  47.5k|#endif
  125|       |
  126|  47.5k|                a0_r = MUL_C(RE(alpha_0[p]), bw);
  ------------------
  |  |  285|  47.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  127|  47.5k|                a1_r = MUL_C(RE(alpha_1[p]), bw2);
  ------------------
  |  |  285|  47.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  128|  47.5k|#ifndef SBR_LOW_POWER
  129|  47.5k|                a0_i = MUL_C(IM(alpha_0[p]), bw);
  ------------------
  |  |  285|  47.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  130|  47.5k|                a1_i = MUL_C(IM(alpha_1[p]), bw2);
  ------------------
  |  |  285|  47.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  131|  47.5k|#endif
  132|       |
  133|  47.5k|            	temp2_r = QMF_RE(Xlow[first - 2 + offset][p]);
  ------------------
  |  |  168|  47.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  47.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  134|  47.5k|            	temp3_r = QMF_RE(Xlow[first - 1 + offset][p]);
  ------------------
  |  |  168|  47.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  47.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  135|  47.5k|#ifndef SBR_LOW_POWER
  136|  47.5k|            	temp2_i = QMF_IM(Xlow[first - 2 + offset][p]);
  ------------------
  |  |  169|  47.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  47.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  137|  47.5k|            	temp3_i = QMF_IM(Xlow[first - 1 + offset][p]);
  ------------------
  |  |  169|  47.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  47.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  138|  47.5k|#endif
  139|  1.59M|				for (l = first; l < last; l++)
  ------------------
  |  Branch (139:21): [True: 1.54M, False: 47.5k]
  ------------------
  140|  1.54M|                {
  141|  1.54M|                	temp1_r = temp2_r;
  142|  1.54M|                	temp2_r = temp3_r;
  143|  1.54M|                	temp3_r = QMF_RE(Xlow[l + offset][p]);
  ------------------
  |  |  168|  1.54M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.54M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  144|  1.54M|#ifndef SBR_LOW_POWER
  145|  1.54M|                	temp1_i = temp2_i;
  146|  1.54M|                	temp2_i = temp3_i;
  147|  1.54M|                    temp3_i = QMF_IM(Xlow[l + offset][p]);
  ------------------
  |  |  169|  1.54M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.54M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  148|  1.54M|#endif
  149|       |
  150|       |#ifdef SBR_LOW_POWER
  151|       |                    QMF_RE(Xhigh[l + offset][k]) =
  152|       |                        temp3_r
  153|       |                      +(MUL_R(a0_r, temp2_r) +
  154|       |                        MUL_R(a1_r, temp1_r));
  155|       |#else
  156|  1.54M|                    QMF_RE(Xhigh[l + offset][k]) =
  ------------------
  |  |  168|  1.54M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.54M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  157|  1.54M|                        temp3_r
  158|  1.54M|                      +(MUL_R(a0_r, temp2_r) -
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  159|  1.54M|                        MUL_R(a0_i, temp2_i) +
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  160|  1.54M|                        MUL_R(a1_r, temp1_r) -
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  161|  1.54M|                        MUL_R(a1_i, temp1_i));
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  162|  1.54M|                    QMF_IM(Xhigh[l + offset][k]) =
  ------------------
  |  |  169|  1.54M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.54M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  163|  1.54M|                        temp3_i
  164|  1.54M|                      +(MUL_R(a0_i, temp2_r) +
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  165|  1.54M|                        MUL_R(a0_r, temp2_i) +
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  166|  1.54M|                        MUL_R(a1_i, temp1_r) +
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  167|  1.54M|                        MUL_R(a1_r, temp1_i));
  ------------------
  |  |  284|  1.54M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  168|  1.54M|#endif
  169|  1.54M|                }
  170|  47.5k|            } else {
  171|  1.21M|                for (l = first; l < last; l++)
  ------------------
  |  Branch (171:33): [True: 1.17M, False: 37.4k]
  ------------------
  172|  1.17M|                {
  173|  1.17M|                    QMF_RE(Xhigh[l + offset][k]) = QMF_RE(Xlow[l + offset][p]);
  ------------------
  |  |  168|  1.17M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.17M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(Xhigh[l + offset][k]) = QMF_RE(Xlow[l + offset][p]);
  ------------------
  |  |  168|  1.17M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.17M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  174|  1.17M|#ifndef SBR_LOW_POWER
  175|  1.17M|                    QMF_IM(Xhigh[l + offset][k]) = QMF_IM(Xlow[l + offset][p]);
  ------------------
  |  |  169|  1.17M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.17M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(Xhigh[l + offset][k]) = QMF_IM(Xlow[l + offset][p]);
  ------------------
  |  |  169|  1.17M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.17M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  176|  1.17M|#endif
  177|  1.17M|                }
  178|  37.4k|            }
  179|  84.9k|        }
  180|  16.6k|    }
  181|       |
  182|  6.92k|    if (sbr->Reset)
  ------------------
  |  Branch (182:9): [True: 6.63k, False: 291]
  ------------------
  183|  6.63k|    {
  184|  6.63k|        limiter_frequency_table(sbr);
  185|  6.63k|    }
  186|  6.92k|}
sbr_hfgen.c:calc_prediction_coef:
  431|  47.5k|{
  432|  47.5k|    real_t tmp;
  433|  47.5k|    acorr_coef ac;
  434|       |
  435|  47.5k|    auto_correlation(sbr, &ac, Xlow, k, sbr->numTimeSlotsRate + 6);
  436|       |
  437|  47.5k|    if (ac.det == 0)
  ------------------
  |  Branch (437:9): [True: 44.1k, False: 3.33k]
  ------------------
  438|  44.1k|    {
  439|  44.1k|        RE(alpha_1[k]) = 0;
  ------------------
  |  |  391|  44.1k|#define RE(A) (A)[0]
  ------------------
  440|  44.1k|        IM(alpha_1[k]) = 0;
  ------------------
  |  |  392|  44.1k|#define IM(A) (A)[1]
  ------------------
  441|  44.1k|    } else {
  442|       |#ifdef FIXED_POINT
  443|       |        tmp = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11)));
  444|       |        RE(alpha_1[k]) = DIV_R(tmp, ac.det);
  445|       |        tmp = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11)));
  446|       |        IM(alpha_1[k]) = DIV_R(tmp, ac.det);
  447|       |#else
  448|  3.33k|        tmp = REAL_CONST(1.0) / ac.det;
  ------------------
  |  |  288|  3.33k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  449|  3.33k|        RE(alpha_1[k]) = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  391|  3.33k|#define RE(A) (A)[0]
  ------------------
                      RE(alpha_1[k]) = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  284|  3.33k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      RE(alpha_1[k]) = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  284|  3.33k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      RE(alpha_1[k]) = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  284|  3.33k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  450|  3.33k|        IM(alpha_1[k]) = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  392|  3.33k|#define IM(A) (A)[1]
  ------------------
                      IM(alpha_1[k]) = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  284|  3.33k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      IM(alpha_1[k]) = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  284|  3.33k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      IM(alpha_1[k]) = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11))) * tmp;
  ------------------
  |  |  284|  3.33k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  451|  3.33k|#endif
  452|  3.33k|    }
  453|       |
  454|  47.5k|    if (RE(ac.r11) == 0)
  ------------------
  |  |  391|  47.5k|#define RE(A) (A)[0]
  ------------------
  |  Branch (454:9): [True: 41.2k, False: 6.25k]
  ------------------
  455|  41.2k|    {
  456|  41.2k|        RE(alpha_0[k]) = 0;
  ------------------
  |  |  391|  41.2k|#define RE(A) (A)[0]
  ------------------
  457|  41.2k|        IM(alpha_0[k]) = 0;
  ------------------
  |  |  392|  41.2k|#define IM(A) (A)[1]
  ------------------
  458|  41.2k|    } else {
  459|       |#ifdef FIXED_POINT
  460|       |        tmp = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12)));
  461|       |        RE(alpha_0[k]) = DIV_R(tmp, RE(ac.r11));
  462|       |        tmp = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12)));
  463|       |        IM(alpha_0[k]) = DIV_R(tmp, RE(ac.r11));
  464|       |#else
  465|  6.25k|        tmp = 1.0f / RE(ac.r11);
  ------------------
  |  |  391|  6.25k|#define RE(A) (A)[0]
  ------------------
  466|  6.25k|        RE(alpha_0[k]) = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  391|  6.25k|#define RE(A) (A)[0]
  ------------------
                      RE(alpha_0[k]) = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  391|  6.25k|#define RE(A) (A)[0]
  ------------------
                      RE(alpha_0[k]) = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  284|  6.25k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      RE(alpha_0[k]) = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  284|  6.25k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  467|  6.25k|        IM(alpha_0[k]) = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  392|  6.25k|#define IM(A) (A)[1]
  ------------------
                      IM(alpha_0[k]) = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  392|  6.25k|#define IM(A) (A)[1]
  ------------------
                      IM(alpha_0[k]) = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  284|  6.25k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      IM(alpha_0[k]) = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12))) * tmp;
  ------------------
  |  |  284|  6.25k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  468|  6.25k|#endif
  469|  6.25k|    }
  470|       |
  471|       |    /* Sanity check; important: use "yes" check to filter-out NaN values. */
  472|  47.5k|    if ((MUL_R(RE(alpha_0[k]),RE(alpha_0[k])) + MUL_R(IM(alpha_0[k]),IM(alpha_0[k])) <= REAL_CONST(16)) &&
  ------------------
  |  |  284|  47.5k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                  if ((MUL_R(RE(alpha_0[k]),RE(alpha_0[k])) + MUL_R(IM(alpha_0[k]),IM(alpha_0[k])) <= REAL_CONST(16)) &&
  ------------------
  |  |  284|  47.5k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                  if ((MUL_R(RE(alpha_0[k]),RE(alpha_0[k])) + MUL_R(IM(alpha_0[k]),IM(alpha_0[k])) <= REAL_CONST(16)) &&
  ------------------
  |  |  288|  47.5k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (472:9): [True: 45.9k, False: 1.53k]
  ------------------
  473|  45.9k|        (MUL_R(RE(alpha_1[k]),RE(alpha_1[k])) + MUL_R(IM(alpha_1[k]),IM(alpha_1[k])) <= REAL_CONST(16)))
  ------------------
  |  |  284|  45.9k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      (MUL_R(RE(alpha_1[k]),RE(alpha_1[k])) + MUL_R(IM(alpha_1[k]),IM(alpha_1[k])) <= REAL_CONST(16)))
  ------------------
  |  |  284|  45.9k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                      (MUL_R(RE(alpha_1[k]),RE(alpha_1[k])) + MUL_R(IM(alpha_1[k]),IM(alpha_1[k])) <= REAL_CONST(16)))
  ------------------
  |  |  288|  45.9k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (473:9): [True: 45.8k, False: 75]
  ------------------
  474|  45.8k|        return;
  475|       |    /* Fallback */
  476|  1.60k|    RE(alpha_0[k]) = 0;
  ------------------
  |  |  391|  1.60k|#define RE(A) (A)[0]
  ------------------
  477|  1.60k|    IM(alpha_0[k]) = 0;
  ------------------
  |  |  392|  1.60k|#define IM(A) (A)[1]
  ------------------
  478|  1.60k|    RE(alpha_1[k]) = 0;
  ------------------
  |  |  391|  1.60k|#define RE(A) (A)[0]
  ------------------
  479|  1.60k|    IM(alpha_1[k]) = 0;
  ------------------
  |  |  392|  1.60k|#define IM(A) (A)[1]
  ------------------
  480|  1.60k|}
sbr_hfgen.c:auto_correlation:
  271|  47.5k|{
  272|  47.5k|    real_t r01r = 0, r01i = 0, r02r = 0, r02i = 0, r11r = 0;
  273|  47.5k|    real_t temp1_r, temp1_i, temp2_r, temp2_i, temp3_r, temp3_i, temp4_r, temp4_i, temp5_r, temp5_i;
  274|       |#ifdef FIXED_POINT
  275|       |    const real_t rel = FRAC_CONST(0.999999); // 1 / (1 + 1e-6f);
  276|       |    uint32_t mask, exp;
  277|       |    real_t half;
  278|       |#else
  279|  47.5k|    const real_t rel = 1 / (1 + 1e-6f);
  280|  47.5k|#endif
  281|  47.5k|    int8_t j;
  282|  47.5k|    uint8_t offset = sbr->tHFAdj;
  283|       |
  284|       |#ifdef FIXED_POINT
  285|       |    mask = 0;
  286|       |
  287|       |    for (j = (offset-2); j < (len + offset); j++)
  288|       |    {
  289|       |        real_t x;
  290|       |        x = QMF_RE(buffer[j][bd])>>REAL_BITS;
  291|       |        mask |= x ^ (x >> 31);
  292|       |        x = QMF_IM(buffer[j][bd])>>REAL_BITS;
  293|       |        mask |= x ^ (x >> 31);
  294|       |    }
  295|       |
  296|       |    exp = wl_min_lzc(mask);
  297|       |
  298|       |    /* All-zero input. */
  299|       |    if (exp == 0) {
  300|       |        RE(ac->r01) = 0;
  301|       |        IM(ac->r01) = 0;
  302|       |        RE(ac->r02) = 0;
  303|       |        IM(ac->r02) = 0;
  304|       |        RE(ac->r11) = 0;
  305|       |        // IM(ac->r11) = 0; // unused
  306|       |        RE(ac->r12) = 0;
  307|       |        IM(ac->r12) = 0;
  308|       |        RE(ac->r22) = 0;
  309|       |        // IM(ac->r22) = 0; // unused
  310|       |        ac->det = 0;
  311|       |        return;
  312|       |    }
  313|       |    /* Otherwise exp > 0. */
  314|       |    /* improves accuracy */
  315|       |    exp -= 1;
  316|       |    /* Now exp is 0..31 */
  317|       |    half = (1 << exp) >> 1;
  318|       |
  319|       |    temp2_r = (QMF_RE(buffer[offset-2][bd]) + half) >> exp;
  320|       |    temp2_i = (QMF_IM(buffer[offset-2][bd]) + half) >> exp;
  321|       |    temp3_r = (QMF_RE(buffer[offset-1][bd]) + half) >> exp;
  322|       |    temp3_i = (QMF_IM(buffer[offset-1][bd]) + half) >> exp;
  323|       |    // Save these because they are needed after loop
  324|       |    temp4_r = temp2_r;
  325|       |    temp4_i = temp2_i;
  326|       |    temp5_r = temp3_r;
  327|       |    temp5_i = temp3_i;
  328|       |
  329|       |    for (j = offset; j < len + offset; j++)
  330|       |    {
  331|       |        temp1_r = temp2_r; // temp1_r = (QMF_RE(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
  332|       |        temp1_i = temp2_i; // temp1_i = (QMF_IM(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
  333|       |        temp2_r = temp3_r; // temp2_r = (QMF_RE(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
  334|       |        temp2_i = temp3_i; // temp2_i = (QMF_IM(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
  335|       |        temp3_r = (QMF_RE(buffer[j][bd]) + half) >> exp;
  336|       |        temp3_i = (QMF_IM(buffer[j][bd]) + half) >> exp;
  337|       |        r01r += MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i);
  338|       |        r01i += MUL_R(temp3_i, temp2_r) - MUL_R(temp3_r, temp2_i);
  339|       |        r02r += MUL_R(temp3_r, temp1_r) + MUL_R(temp3_i, temp1_i);
  340|       |        r02i += MUL_R(temp3_i, temp1_r) - MUL_R(temp3_r, temp1_i);
  341|       |        r11r += MUL_R(temp2_r, temp2_r) + MUL_R(temp2_i, temp2_i);
  342|       |    }
  343|       |
  344|       |    // These are actual values in temporary variable at this point
  345|       |    // temp1_r = (QMF_RE(buffer[len+offset-1-2][bd] + (1<<(exp-1))) >> exp;
  346|       |    // temp1_i = (QMF_IM(buffer[len+offset-1-2][bd] + (1<<(exp-1))) >> exp;
  347|       |    // temp2_r = (QMF_RE(buffer[len+offset-1-1][bd] + (1<<(exp-1))) >> exp;
  348|       |    // temp2_i = (QMF_IM(buffer[len+offset-1-1][bd] + (1<<(exp-1))) >> exp;
  349|       |    // temp3_r = (QMF_RE(buffer[len+offset-1][bd]) + (1<<(exp-1))) >> exp;
  350|       |    // temp3_i = (QMF_IM(buffer[len+offset-1][bd]) + (1<<(exp-1))) >> exp;
  351|       |    // temp4_r = (QMF_RE(buffer[offset-2][bd]) + (1<<(exp-1))) >> exp;
  352|       |    // temp4_i = (QMF_IM(buffer[offset-2][bd]) + (1<<(exp-1))) >> exp;
  353|       |    // temp5_r = (QMF_RE(buffer[offset-1][bd]) + (1<<(exp-1))) >> exp;
  354|       |    // temp5_i = (QMF_IM(buffer[offset-1][bd]) + (1<<(exp-1))) >> exp;
  355|       |
  356|       |    RE(ac->r12) = r01r -
  357|       |        (MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i)) +
  358|       |        (MUL_R(temp5_r, temp4_r) + MUL_R(temp5_i, temp4_i));
  359|       |    IM(ac->r12) = r01i -
  360|       |        (MUL_R(temp3_i, temp2_r) - MUL_R(temp3_r, temp2_i)) +
  361|       |        (MUL_R(temp5_i, temp4_r) - MUL_R(temp5_r, temp4_i));
  362|       |    RE(ac->r22) = r11r -
  363|       |        (MUL_R(temp2_r, temp2_r) + MUL_R(temp2_i, temp2_i)) +
  364|       |        (MUL_R(temp4_r, temp4_r) + MUL_R(temp4_i, temp4_i));
  365|       |
  366|       |#else
  367|       |
  368|  47.5k|    temp2_r = QMF_RE(buffer[offset-2][bd]);
  ------------------
  |  |  168|  47.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  47.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  369|  47.5k|    temp2_i = QMF_IM(buffer[offset-2][bd]);
  ------------------
  |  |  169|  47.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  47.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  370|  47.5k|    temp3_r = QMF_RE(buffer[offset-1][bd]);
  ------------------
  |  |  168|  47.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  47.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  371|  47.5k|    temp3_i = QMF_IM(buffer[offset-1][bd]);
  ------------------
  |  |  169|  47.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  47.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  372|       |    // Save these because they are needed after loop
  373|  47.5k|    temp4_r = temp2_r;
  374|  47.5k|    temp4_i = temp2_i;
  375|  47.5k|    temp5_r = temp3_r;
  376|  47.5k|    temp5_i = temp3_i;
  377|       |
  378|  1.82M|    for (j = offset; j < len + offset; j++)
  ------------------
  |  Branch (378:22): [True: 1.78M, False: 47.5k]
  ------------------
  379|  1.78M|    {
  380|  1.78M|    	temp1_r = temp2_r; // temp1_r = QMF_RE(buffer[j-2][bd];
  381|  1.78M|    	temp1_i = temp2_i; // temp1_i = QMF_IM(buffer[j-2][bd];
  382|  1.78M|    	temp2_r = temp3_r; // temp2_r = QMF_RE(buffer[j-1][bd];
  383|  1.78M|    	temp2_i = temp3_i; // temp2_i = QMF_IM(buffer[j-1][bd];
  384|  1.78M|        temp3_r = QMF_RE(buffer[j][bd]);
  ------------------
  |  |  168|  1.78M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.78M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  385|  1.78M|        temp3_i = QMF_IM(buffer[j][bd]);
  ------------------
  |  |  169|  1.78M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.78M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  386|  1.78M|        r01r += temp3_r * temp2_r + temp3_i * temp2_i;
  387|  1.78M|        r01i += temp3_i * temp2_r - temp3_r * temp2_i;
  388|  1.78M|        r02r += temp3_r * temp1_r + temp3_i * temp1_i;
  389|  1.78M|        r02i += temp3_i * temp1_r - temp3_r * temp1_i;
  390|  1.78M|        r11r += temp2_r * temp2_r + temp2_i * temp2_i;
  391|  1.78M|    }
  392|       |
  393|       |    // These are actual values in temporary variable at this point
  394|       |    // temp1_r = QMF_RE(buffer[len+offset-1-2][bd];
  395|       |    // temp1_i = QMF_IM(buffer[len+offset-1-2][bd];
  396|       |    // temp2_r = QMF_RE(buffer[len+offset-1-1][bd];
  397|       |    // temp2_i = QMF_IM(buffer[len+offset-1-1][bd];
  398|       |    // temp3_r = QMF_RE(buffer[len+offset-1][bd]);
  399|       |    // temp3_i = QMF_IM(buffer[len+offset-1][bd]);
  400|       |    // temp4_r = QMF_RE(buffer[offset-2][bd]);
  401|       |    // temp4_i = QMF_IM(buffer[offset-2][bd]);
  402|       |    // temp5_r = QMF_RE(buffer[offset-1][bd]);
  403|       |    // temp5_i = QMF_IM(buffer[offset-1][bd]);
  404|       |
  405|  47.5k|    RE(ac->r12) = r01r -
  ------------------
  |  |  391|  47.5k|#define RE(A) (A)[0]
  ------------------
  406|  47.5k|        (temp3_r * temp2_r + temp3_i * temp2_i) +
  407|  47.5k|        (temp5_r * temp4_r + temp5_i * temp4_i);
  408|  47.5k|    IM(ac->r12) = r01i -
  ------------------
  |  |  392|  47.5k|#define IM(A) (A)[1]
  ------------------
  409|  47.5k|        (temp3_i * temp2_r - temp3_r * temp2_i) +
  410|  47.5k|        (temp5_i * temp4_r - temp5_r * temp4_i);
  411|  47.5k|    RE(ac->r22) = r11r -
  ------------------
  |  |  391|  47.5k|#define RE(A) (A)[0]
  ------------------
  412|  47.5k|        (temp2_r * temp2_r + temp2_i * temp2_i) +
  413|  47.5k|        (temp4_r * temp4_r + temp4_i * temp4_i);
  414|       |
  415|  47.5k|#endif
  416|       |
  417|  47.5k|    RE(ac->r01) = r01r;
  ------------------
  |  |  391|  47.5k|#define RE(A) (A)[0]
  ------------------
  418|  47.5k|    IM(ac->r01) = r01i;
  ------------------
  |  |  392|  47.5k|#define IM(A) (A)[1]
  ------------------
  419|  47.5k|    RE(ac->r02) = r02r;
  ------------------
  |  |  391|  47.5k|#define RE(A) (A)[0]
  ------------------
  420|  47.5k|    IM(ac->r02) = r02i;
  ------------------
  |  |  392|  47.5k|#define IM(A) (A)[1]
  ------------------
  421|  47.5k|    RE(ac->r11) = r11r;
  ------------------
  |  |  391|  47.5k|#define RE(A) (A)[0]
  ------------------
  422|       |
  423|  47.5k|    ac->det = MUL_R(RE(ac->r11), RE(ac->r22)) - MUL_F(rel, (MUL_R(RE(ac->r12), RE(ac->r12)) + MUL_R(IM(ac->r12), IM(ac->r12))));
  ------------------
  |  |  284|  47.5k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                  ac->det = MUL_R(RE(ac->r11), RE(ac->r22)) - MUL_F(rel, (MUL_R(RE(ac->r12), RE(ac->r12)) + MUL_R(IM(ac->r12), IM(ac->r12))));
  ------------------
  |  |  286|  47.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  424|  47.5k|}
sbr_hfgen.c:calc_chirp_factors:
  595|  6.92k|{
  596|  6.92k|    uint8_t i;
  597|       |
  598|  20.7k|    for (i = 0; i < sbr->N_Q; i++)
  ------------------
  |  Branch (598:17): [True: 13.8k, False: 6.92k]
  ------------------
  599|  13.8k|    {
  600|  13.8k|        sbr->bwArray[ch][i] = mapNewBw(sbr->bs_invf_mode[ch][i], sbr->bs_invf_mode_prev[ch][i]);
  601|       |
  602|  13.8k|        if (sbr->bwArray[ch][i] < sbr->bwArray_prev[ch][i])
  ------------------
  |  Branch (602:13): [True: 270, False: 13.5k]
  ------------------
  603|    270|            sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.75)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.25));
  ------------------
  |  |  286|    270|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.75)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.25));
  ------------------
  |  |  286|    270|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  604|  13.5k|        else
  605|  13.5k|            sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.90625)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.09375));
  ------------------
  |  |  286|  13.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.90625)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.09375));
  ------------------
  |  |  286|  13.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  606|       |
  607|  13.8k|        if (sbr->bwArray[ch][i] < COEF_CONST(0.015625))
  ------------------
  |  |  289|  13.8k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (607:13): [True: 6.25k, False: 7.59k]
  ------------------
  608|  6.25k|            sbr->bwArray[ch][i] = COEF_CONST(0.0);
  ------------------
  |  |  289|  6.25k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  609|       |
  610|  13.8k|        if (sbr->bwArray[ch][i] >= COEF_CONST(0.99609375))
  ------------------
  |  |  289|  13.8k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (610:13): [True: 0, False: 13.8k]
  ------------------
  611|      0|            sbr->bwArray[ch][i] = COEF_CONST(0.99609375);
  ------------------
  |  |  289|      0|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  612|       |
  613|  13.8k|        sbr->bwArray_prev[ch][i] = sbr->bwArray[ch][i];
  614|  13.8k|        sbr->bs_invf_mode_prev[ch][i] = sbr->bs_invf_mode[ch][i];
  615|  13.8k|    }
  616|  6.92k|}
sbr_hfgen.c:mapNewBw:
  570|  13.8k|{
  571|  13.8k|    switch (invf_mode)
  572|  13.8k|    {
  573|  2.80k|    case 1: /* LOW */
  ------------------
  |  Branch (573:5): [True: 2.80k, False: 11.0k]
  ------------------
  574|  2.80k|        if (invf_mode_prev == 0) /* NONE */
  ------------------
  |  Branch (574:13): [True: 2.43k, False: 377]
  ------------------
  575|  2.43k|            return COEF_CONST(0.6);
  ------------------
  |  |  289|  2.43k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  576|    377|        else
  577|    377|            return COEF_CONST(0.75);
  ------------------
  |  |  289|    377|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  578|       |
  579|  2.11k|    case 2: /* MID */
  ------------------
  |  Branch (579:5): [True: 2.11k, False: 11.7k]
  ------------------
  580|  2.11k|        return COEF_CONST(0.9);
  ------------------
  |  |  289|  2.11k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  581|       |
  582|  2.38k|    case 3: /* HIGH */
  ------------------
  |  Branch (582:5): [True: 2.38k, False: 11.4k]
  ------------------
  583|  2.38k|        return COEF_CONST(0.98);
  ------------------
  |  |  289|  2.38k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  584|       |
  585|  6.54k|    default: /* NONE */
  ------------------
  |  Branch (585:5): [True: 6.54k, False: 7.30k]
  ------------------
  586|  6.54k|        if (invf_mode_prev == 1) /* LOW */
  ------------------
  |  Branch (586:13): [True: 125, False: 6.42k]
  ------------------
  587|    125|            return COEF_CONST(0.6);
  ------------------
  |  |  289|    125|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  588|  6.42k|        else
  589|  6.42k|            return COEF_CONST(0.0);
  ------------------
  |  |  289|  6.42k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  590|  13.8k|    }
  591|  13.8k|}
sbr_hfgen.c:patch_construction:
  619|  5.17k|{
  620|  5.17k|    uint8_t i, k;
  621|  5.17k|    uint8_t odd, sb;
  622|  5.17k|    uint8_t msb = sbr->k0;
  623|  5.17k|    uint8_t usb = sbr->kx;
  624|  5.17k|    uint8_t goalSbTab[] = { 21, 23, 32, 43, 46, 64, 85, 93, 128, 0, 0, 0 };
  625|       |    /* (uint8_t)(2.048e6/sbr->sample_rate + 0.5); */
  626|  5.17k|    uint8_t goalSb = goalSbTab[get_sr_index(sbr->sample_rate)];
  627|       |
  628|  5.17k|    sbr->noPatches = 0;
  629|       |
  630|  5.17k|    if (goalSb < (sbr->kx + sbr->M))
  ------------------
  |  Branch (630:9): [True: 1.72k, False: 3.44k]
  ------------------
  631|  1.72k|    {
  632|  19.1k|        for (i = 0, k = 0; sbr->f_master[i] < goalSb; i++)
  ------------------
  |  Branch (632:28): [True: 17.4k, False: 1.72k]
  ------------------
  633|  17.4k|            k = i+1;
  634|  3.44k|    } else {
  635|  3.44k|        k = sbr->N_master;
  636|  3.44k|    }
  637|       |
  638|  5.17k|    if (sbr->N_master == 0)
  ------------------
  |  Branch (638:9): [True: 0, False: 5.17k]
  ------------------
  639|      0|    {
  640|      0|        sbr->noPatches = 0;
  641|      0|        sbr->patchNoSubbands[0] = 0;
  642|      0|        sbr->patchStartSubband[0] = 0;
  643|       |
  644|      0|        return;
  645|      0|    }
  646|       |
  647|  5.17k|    do
  648|  12.0k|    {
  649|  12.0k|        uint8_t j = k + 1;
  650|       |
  651|  12.0k|        do
  652|  36.7k|        {
  653|  36.7k|            j--;
  654|       |
  655|  36.7k|            sb = sbr->f_master[j];
  656|  36.7k|            odd = (sb - 2 + sbr->k0) % 2;
  657|  36.7k|        } while (sb > (sbr->k0 - 1 + msb - odd));
  ------------------
  |  Branch (657:18): [True: 24.7k, False: 12.0k]
  ------------------
  658|       |
  659|  12.0k|        sbr->patchNoSubbands[sbr->noPatches] = max(sb - usb, 0);
  ------------------
  |  |   57|  12.0k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 11.4k, False: 573]
  |  |  ------------------
  ------------------
  660|  12.0k|        sbr->patchStartSubband[sbr->noPatches] = sbr->k0 - odd -
  661|  12.0k|            sbr->patchNoSubbands[sbr->noPatches];
  662|       |
  663|  12.0k|        if (sbr->patchNoSubbands[sbr->noPatches] > 0)
  ------------------
  |  Branch (663:13): [True: 11.4k, False: 573]
  ------------------
  664|  11.4k|        {
  665|  11.4k|            usb = sb;
  666|  11.4k|            msb = sb;
  667|  11.4k|            sbr->noPatches++;
  668|  11.4k|        } else {
  669|    573|            msb = sbr->kx;
  670|    573|        }
  671|       |
  672|  12.0k|        if (sbr->f_master[k] - sb < 3)
  ------------------
  |  Branch (672:13): [True: 7.68k, False: 4.33k]
  ------------------
  673|  7.68k|            k = sbr->N_master;
  674|  12.0k|    } while (sb != (sbr->kx + sbr->M));
  ------------------
  |  Branch (674:14): [True: 6.84k, False: 5.17k]
  ------------------
  675|       |
  676|  5.17k|    if ((sbr->patchNoSubbands[sbr->noPatches-1] < 3) && (sbr->noPatches > 1))
  ------------------
  |  Branch (676:9): [True: 2.16k, False: 3.01k]
  |  Branch (676:57): [True: 842, False: 1.32k]
  ------------------
  677|    842|    {
  678|    842|        sbr->noPatches--;
  679|    842|    }
  680|       |
  681|  5.17k|    sbr->noPatches = min(sbr->noPatches, 5);
  ------------------
  |  |   60|  5.17k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.28k, False: 893]
  |  |  ------------------
  ------------------
  682|  5.17k|}

sbr_envelope:
  246|  30.3k|{
  247|  30.3k|    uint8_t env, band;
  248|  30.3k|    int8_t delta = 0;
  249|  30.3k|    sbr_huff_tab t_huff, f_huff;
  250|       |
  251|  30.3k|    if ((sbr->L_E[ch] == 1) && (sbr->bs_frame_class[ch] == FIXFIX))
  ------------------
  |  |   46|  12.0k|#define FIXFIX 0
  ------------------
  |  Branch (251:9): [True: 12.0k, False: 18.2k]
  |  Branch (251:32): [True: 5.42k, False: 6.63k]
  ------------------
  252|  5.42k|        sbr->amp_res[ch] = 0;
  253|  24.9k|    else
  254|  24.9k|        sbr->amp_res[ch] = sbr->bs_amp_res;
  255|       |
  256|  30.3k|    if ((sbr->bs_coupling) && (ch == 1))
  ------------------
  |  Branch (256:9): [True: 8.40k, False: 21.9k]
  |  Branch (256:31): [True: 4.20k, False: 4.20k]
  ------------------
  257|  4.20k|    {
  258|  4.20k|        delta = 1;
  259|  4.20k|        if (sbr->amp_res[ch])
  ------------------
  |  Branch (259:13): [True: 1.51k, False: 2.68k]
  ------------------
  260|  1.51k|        {
  261|  1.51k|            t_huff = t_huffman_env_bal_3_0dB;
  262|  1.51k|            f_huff = f_huffman_env_bal_3_0dB;
  263|  2.68k|        } else {
  264|  2.68k|            t_huff = t_huffman_env_bal_1_5dB;
  265|  2.68k|            f_huff = f_huffman_env_bal_1_5dB;
  266|  2.68k|        }
  267|  26.1k|    } else {
  268|  26.1k|        delta = 0;
  269|  26.1k|        if (sbr->amp_res[ch])
  ------------------
  |  Branch (269:13): [True: 11.7k, False: 14.4k]
  ------------------
  270|  11.7k|        {
  271|  11.7k|            t_huff = t_huffman_env_3_0dB;
  272|  11.7k|            f_huff = f_huffman_env_3_0dB;
  273|  14.4k|        } else {
  274|  14.4k|            t_huff = t_huffman_env_1_5dB;
  275|  14.4k|            f_huff = f_huffman_env_1_5dB;
  276|  14.4k|        }
  277|  26.1k|    }
  278|       |
  279|   103k|    for (env = 0; env < sbr->L_E[ch]; env++)
  ------------------
  |  Branch (279:19): [True: 73.0k, False: 30.3k]
  ------------------
  280|  73.0k|    {
  281|  73.0k|        if (sbr->bs_df_env[ch][env] == 0)
  ------------------
  |  Branch (281:13): [True: 46.6k, False: 26.4k]
  ------------------
  282|  46.6k|        {
  283|  46.6k|            if ((sbr->bs_coupling == 1) && (ch == 1))
  ------------------
  |  Branch (283:17): [True: 15.6k, False: 30.9k]
  |  Branch (283:44): [True: 8.73k, False: 6.95k]
  ------------------
  284|  8.73k|            {
  285|  8.73k|                if (sbr->amp_res[ch])
  ------------------
  |  Branch (285:21): [True: 3.58k, False: 5.14k]
  ------------------
  286|  3.58k|                {
  287|  3.58k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 5
  288|  3.58k|                        DEBUGVAR(1,272,"sbr_envelope(): bs_data_env")) << delta);
  289|  5.14k|                } else {
  290|  5.14k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
  291|  5.14k|                        DEBUGVAR(1,273,"sbr_envelope(): bs_data_env")) << delta);
  292|  5.14k|                }
  293|  37.8k|            } else {
  294|  37.8k|                if (sbr->amp_res[ch])
  ------------------
  |  Branch (294:21): [True: 17.9k, False: 19.9k]
  ------------------
  295|  17.9k|                {
  296|  17.9k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
  297|  17.9k|                        DEBUGVAR(1,274,"sbr_envelope(): bs_data_env")) << delta);
  298|  19.9k|                } else {
  299|  19.9k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 7
  300|  19.9k|                        DEBUGVAR(1,275,"sbr_envelope(): bs_data_env")) << delta);
  301|  19.9k|                }
  302|  37.8k|            }
  303|       |
  304|   524k|            for (band = 1; band < sbr->n[sbr->f[ch][env]]; band++)
  ------------------
  |  Branch (304:28): [True: 477k, False: 46.6k]
  ------------------
  305|   477k|            {
  306|   477k|                sbr->E[ch][band][env] = (sbr_huff_dec(ld, f_huff));
  307|   477k|            }
  308|       |
  309|  46.6k|        } else {
  310|   299k|            for (band = 0; band < sbr->n[sbr->f[ch][env]]; band++)
  ------------------
  |  Branch (310:28): [True: 273k, False: 26.4k]
  ------------------
  311|   273k|            {
  312|   273k|                sbr->E[ch][band][env] = (sbr_huff_dec(ld, t_huff));
  313|   273k|            }
  314|  26.4k|        }
  315|  73.0k|    }
  316|       |
  317|  30.3k|    extract_envelope_data(sbr, ch);
  318|  30.3k|}
sbr_noise:
  322|  30.3k|{
  323|  30.3k|    uint8_t noise, band;
  324|  30.3k|    int8_t delta = 0;
  325|  30.3k|    sbr_huff_tab t_huff, f_huff;
  326|       |
  327|  30.3k|    if ((sbr->bs_coupling == 1) && (ch == 1))
  ------------------
  |  Branch (327:9): [True: 8.40k, False: 21.9k]
  |  Branch (327:36): [True: 4.20k, False: 4.20k]
  ------------------
  328|  4.20k|    {
  329|  4.20k|        delta = 1;
  330|  4.20k|        t_huff = t_huffman_noise_bal_3_0dB;
  331|  4.20k|        f_huff = f_huffman_env_bal_3_0dB;
  332|  26.1k|    } else {
  333|  26.1k|        delta = 0;
  334|  26.1k|        t_huff = t_huffman_noise_3_0dB;
  335|  26.1k|        f_huff = f_huffman_env_3_0dB;
  336|  26.1k|    }
  337|       |
  338|  78.9k|    for (noise = 0; noise < sbr->L_Q[ch]; noise++)
  ------------------
  |  Branch (338:21): [True: 48.6k, False: 30.3k]
  ------------------
  339|  48.6k|    {
  340|  48.6k|        if(sbr->bs_df_noise[ch][noise] == 0)
  ------------------
  |  Branch (340:12): [True: 31.4k, False: 17.1k]
  ------------------
  341|  31.4k|        {
  342|  31.4k|            if ((sbr->bs_coupling == 1) && (ch == 1))
  ------------------
  |  Branch (342:17): [True: 8.02k, False: 23.3k]
  |  Branch (342:44): [True: 4.51k, False: 3.51k]
  ------------------
  343|  4.51k|            {
  344|  4.51k|                sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
  345|  4.51k|                    DEBUGVAR(1,276,"sbr_noise(): bs_data_noise")) << delta);
  346|  26.9k|            } else {
  347|  26.9k|                sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
  348|  26.9k|                    DEBUGVAR(1,277,"sbr_noise(): bs_data_noise")) << delta);
  349|  26.9k|            }
  350|  59.0k|            for (band = 1; band < sbr->N_Q; band++)
  ------------------
  |  Branch (350:28): [True: 27.6k, False: 31.4k]
  ------------------
  351|  27.6k|            {
  352|  27.6k|                sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, f_huff));
  353|  27.6k|            }
  354|  31.4k|        } else {
  355|  50.6k|            for (band = 0; band < sbr->N_Q; band++)
  ------------------
  |  Branch (355:28): [True: 33.4k, False: 17.1k]
  ------------------
  356|  33.4k|            {
  357|  33.4k|                sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, t_huff));
  358|  33.4k|            }
  359|  17.1k|        }
  360|  48.6k|    }
  361|       |
  362|  30.3k|    extract_noise_floor_data(sbr, ch);
  363|  30.3k|}
sbr_huff.c:sbr_huff_dec:
  231|   811k|{
  232|   811k|    uint8_t bit;
  233|   811k|    int16_t index = 0;
  234|       |
  235|  2.98M|    while (index >= 0)
  ------------------
  |  Branch (235:12): [True: 2.17M, False: 811k]
  ------------------
  236|  2.17M|    {
  237|  2.17M|        bit = (uint8_t)faad_get1bit(ld);
  238|  2.17M|        index = t_huff[index][bit];
  239|  2.17M|    }
  240|       |
  241|   811k|    return index + 64;
  242|   811k|}

qmfa_init:
   44|  81.5k|{
   45|  81.5k|    qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
   46|       |
   47|       |	/* x is implemented as double ringbuffer */
   48|  81.5k|    qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
   49|  81.5k|    memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
   50|       |
   51|       |	/* ringbuffer index */
   52|  81.5k|	qmfa->x_index = 0;
   53|       |
   54|  81.5k|    qmfa->channels = channels;
   55|       |
   56|  81.5k|    return qmfa;
   57|  81.5k|}
qmfa_end:
   60|  84.8k|{
   61|  84.8k|    if (qmfa)
  ------------------
  |  Branch (61:9): [True: 81.5k, False: 3.33k]
  ------------------
   62|  81.5k|    {
   63|  81.5k|        if (qmfa->x) faad_free(qmfa->x);
  ------------------
  |  Branch (63:13): [True: 81.5k, False: 0]
  ------------------
   64|  81.5k|        faad_free(qmfa);
   65|  81.5k|    }
   66|  84.8k|}
sbr_qmf_analysis_32:
   70|  97.7k|{
   71|  97.7k|    ALIGN real_t u[64];
   72|  97.7k|#ifndef SBR_LOW_POWER
   73|  97.7k|    ALIGN real_t in_real[32], in_imag[32], out_real[32], out_imag[32];
   74|       |#else
   75|       |    ALIGN real_t y[32];
   76|       |#endif
   77|  97.7k|    uint32_t in = 0;
   78|  97.7k|    uint8_t l;
   79|       |
   80|       |    /* qmf subsample l */
   81|  3.18M|    for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (81:17): [True: 3.08M, False: 97.7k]
  ------------------
   82|  3.08M|    {
   83|  3.08M|        int16_t n;
   84|       |
   85|       |        /* shift input buffer x */
   86|       |		/* input buffer is not shifted anymore, x is implemented as double ringbuffer */
   87|       |        //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
   88|       |
   89|       |        /* add new samples to input buffer x */
   90|   101M|        for (n = 32 - 1; n >= 0; n--)
  ------------------
  |  Branch (90:26): [True: 98.6M, False: 3.08M]
  ------------------
   91|  98.6M|        {
   92|       |#ifdef FIXED_POINT
   93|       |            qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = (input[in++]) >> 4;
   94|       |#else
   95|  98.6M|            qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = input[in++];
   96|  98.6M|#endif
   97|  98.6M|        }
   98|       |
   99|       |        /* window and summation to create array u */
  100|   200M|        for (n = 0; n < 64; n++)
  ------------------
  |  Branch (100:21): [True: 197M, False: 3.08M]
  ------------------
  101|   197M|        {
  102|   197M|            u[n] = MUL_F(qmfa->x[qmfa->x_index + n], qmf_c[2*n]) +
  ------------------
  |  |  286|   197M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  103|   197M|                MUL_F(qmfa->x[qmfa->x_index + n + 64], qmf_c[2*(n + 64)]) +
  ------------------
  |  |  286|   197M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  104|   197M|                MUL_F(qmfa->x[qmfa->x_index + n + 128], qmf_c[2*(n + 128)]) +
  ------------------
  |  |  286|   197M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  105|   197M|                MUL_F(qmfa->x[qmfa->x_index + n + 192], qmf_c[2*(n + 192)]) +
  ------------------
  |  |  286|   197M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  106|   197M|                MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
  ------------------
  |  |  286|   197M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  107|   197M|        }
  108|       |
  109|       |		/* update ringbuffer index */
  110|  3.08M|		qmfa->x_index -= 32;
  111|  3.08M|		if (qmfa->x_index < 0)
  ------------------
  |  Branch (111:7): [True: 359k, False: 2.72M]
  ------------------
  112|   359k|			qmfa->x_index = (320-32);
  113|       |
  114|       |        /* calculate 32 subband samples by introducing X */
  115|       |#ifdef SBR_LOW_POWER
  116|       |        y[0] = u[48];
  117|       |        for (n = 1; n < 16; n++)
  118|       |            y[n] = u[n+48] + u[48-n];
  119|       |        for (n = 16; n < 32; n++)
  120|       |            y[n] = -u[n-16] + u[48-n];
  121|       |
  122|       |        DCT3_32_unscaled(u, y);
  123|       |
  124|       |        for (n = 0; n < 32; n++)
  125|       |        {
  126|       |            if (n < kx)
  127|       |            {
  128|       |#ifdef FIXED_POINT
  129|       |                QMF_RE(X[l + offset][n]) = u[n] /*<< 1*/;
  130|       |#else
  131|       |                QMF_RE(X[l + offset][n]) = 2. * u[n];
  132|       |#endif
  133|       |            } else {
  134|       |                QMF_RE(X[l + offset][n]) = 0;
  135|       |            }
  136|       |        }
  137|       |#else
  138|       |
  139|       |        // Reordering of data moved from DCT_IV to here
  140|  3.08M|        in_imag[31] = u[1];
  141|  3.08M|        in_real[0] = u[0];
  142|  95.6M|        for (n = 1; n < 31; n++)
  ------------------
  |  Branch (142:21): [True: 92.5M, False: 3.08M]
  ------------------
  143|  92.5M|        {
  144|  92.5M|            in_imag[31 - n] = u[n+1];
  145|  92.5M|            in_real[n] = -u[64-n];
  146|  92.5M|        }
  147|  3.08M|        in_imag[0] = u[32];
  148|  3.08M|        in_real[31] = -u[33];
  149|       |
  150|       |        // dct4_kernel is DCT_IV without reordering which is done before and after FFT
  151|  3.08M|        dct4_kernel(in_real, in_imag, out_real, out_imag);
  152|       |
  153|       |        // Reordering of data moved from DCT_IV to here
  154|  52.4M|        for (n = 0; n < 16; n++) {
  ------------------
  |  Branch (154:21): [True: 49.3M, False: 3.08M]
  ------------------
  155|  49.3M|            if (2*n+1 < kx) {
  ------------------
  |  Branch (155:17): [True: 47.8M, False: 1.47M]
  ------------------
  156|       |#ifdef FIXED_POINT
  157|       |                QMF_RE(X[l + offset][2*n])   = out_real[n];
  158|       |                QMF_IM(X[l + offset][2*n])   = out_imag[n];
  159|       |                QMF_RE(X[l + offset][2*n+1]) = -out_imag[31-n];
  160|       |                QMF_IM(X[l + offset][2*n+1]) = -out_real[31-n];
  161|       |#else
  162|  47.8M|                QMF_RE(X[l + offset][2*n])   = 2. * out_real[n];
  ------------------
  |  |  168|  47.8M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  47.8M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  163|  47.8M|                QMF_IM(X[l + offset][2*n])   = 2. * out_imag[n];
  ------------------
  |  |  169|  47.8M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  47.8M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  164|  47.8M|                QMF_RE(X[l + offset][2*n+1]) = -2. * out_imag[31-n];
  ------------------
  |  |  168|  47.8M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  47.8M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  165|  47.8M|                QMF_IM(X[l + offset][2*n+1]) = -2. * out_real[31-n];
  ------------------
  |  |  169|  47.8M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  47.8M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  166|  47.8M|#endif
  167|  47.8M|            } else {
  168|  1.47M|                if (2*n < kx) {
  ------------------
  |  Branch (168:21): [True: 114k, False: 1.36M]
  ------------------
  169|       |#ifdef FIXED_POINT
  170|       |                    QMF_RE(X[l + offset][2*n])   = out_real[n];
  171|       |                    QMF_IM(X[l + offset][2*n])   = out_imag[n];
  172|       |#else
  173|   114k|                    QMF_RE(X[l + offset][2*n])   = 2. * out_real[n];
  ------------------
  |  |  168|   114k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   114k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  174|   114k|                    QMF_IM(X[l + offset][2*n])   = 2. * out_imag[n];
  ------------------
  |  |  169|   114k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   114k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  175|   114k|#endif
  176|   114k|                }
  177|  1.36M|                else {
  178|  1.36M|                    QMF_RE(X[l + offset][2*n]) = 0;
  ------------------
  |  |  168|  1.36M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.36M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  179|  1.36M|                    QMF_IM(X[l + offset][2*n]) = 0;
  ------------------
  |  |  169|  1.36M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.36M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  180|  1.36M|                }
  181|  1.47M|                QMF_RE(X[l + offset][2*n+1]) = 0;
  ------------------
  |  |  168|  1.47M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.47M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  182|  1.47M|                QMF_IM(X[l + offset][2*n+1]) = 0;
  ------------------
  |  |  169|  1.47M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.47M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  183|  1.47M|            }
  184|  49.3M|        }
  185|  3.08M|#endif
  186|  3.08M|    }
  187|  97.7k|}
qmfs_init:
  226|  84.8k|{
  227|  84.8k|    qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
  228|       |
  229|       |	/* v is a double ringbuffer */
  230|  84.8k|    qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t));
  231|  84.8k|    memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t));
  232|       |
  233|  84.8k|    qmfs->v_index = 0;
  234|       |
  235|  84.8k|    qmfs->channels = channels;
  236|       |
  237|  84.8k|    return qmfs;
  238|  84.8k|}
qmfs_end:
  241|  84.8k|{
  242|  84.8k|    if (qmfs)
  ------------------
  |  Branch (242:9): [True: 84.8k, False: 0]
  ------------------
  243|  84.8k|    {
  244|  84.8k|        if (qmfs->v) faad_free(qmfs->v);
  ------------------
  |  Branch (244:13): [True: 84.8k, False: 0]
  ------------------
  245|  84.8k|        faad_free(qmfs);
  246|  84.8k|    }
  247|  84.8k|}
sbr_qmf_synthesis_32:
  392|  34.5k|{
  393|  34.5k|    ALIGN real_t x1[32], x2[32];
  394|  34.5k|#ifndef FIXED_POINT
  395|  34.5k|    real_t scale = 1.f/64.f;
  396|  34.5k|#endif
  397|  34.5k|    int32_t n, k, out = 0;
  398|  34.5k|    uint8_t l;
  399|       |
  400|       |
  401|       |    /* qmf subsample l */
  402|  1.13M|    for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (402:17): [True: 1.09M, False: 34.5k]
  ------------------
  403|  1.09M|    {
  404|       |        /* shift buffer v */
  405|       |        /* buffer is not shifted, we are using a ringbuffer */
  406|       |        //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
  407|       |
  408|       |        /* calculate 64 samples */
  409|       |        /* complex pre-twiddle */
  410|  36.2M|        for (k = 0; k < 32; k++)
  ------------------
  |  Branch (410:21): [True: 35.1M, False: 1.09M]
  ------------------
  411|  35.1M|        {
  412|  35.1M|            x1[k] = MUL_F(QMF_RE(X[l][k]), RE(qmf32_pre_twiddle[k])) - MUL_F(QMF_IM(X[l][k]), IM(qmf32_pre_twiddle[k]));
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          x1[k] = MUL_F(QMF_RE(X[l][k]), RE(qmf32_pre_twiddle[k])) - MUL_F(QMF_IM(X[l][k]), IM(qmf32_pre_twiddle[k]));
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  413|  35.1M|            x2[k] = MUL_F(QMF_IM(X[l][k]), RE(qmf32_pre_twiddle[k])) + MUL_F(QMF_RE(X[l][k]), IM(qmf32_pre_twiddle[k]));
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                          x2[k] = MUL_F(QMF_IM(X[l][k]), RE(qmf32_pre_twiddle[k])) + MUL_F(QMF_RE(X[l][k]), IM(qmf32_pre_twiddle[k]));
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  414|       |
  415|  35.1M|#ifndef FIXED_POINT
  416|  35.1M|            x1[k] *= scale;
  417|  35.1M|            x2[k] *= scale;
  418|       |#else
  419|       |            x1[k] >>= 1;
  420|       |            x2[k] >>= 1;
  421|       |#endif
  422|  35.1M|        }
  423|       |
  424|       |        /* transform */
  425|  1.09M|        DCT4_32(x1, x1);
  426|  1.09M|        DST4_32(x2, x2);
  427|       |
  428|  36.2M|        for (n = 0; n < 32; n++)
  ------------------
  |  Branch (428:21): [True: 35.1M, False: 1.09M]
  ------------------
  429|  35.1M|        {
  430|  35.1M|            qmfs->v[qmfs->v_index + n]      = qmfs->v[qmfs->v_index + 640 + n]      = -x1[n] + x2[n];
  431|  35.1M|            qmfs->v[qmfs->v_index + 63 - n] = qmfs->v[qmfs->v_index + 640 + 63 - n] =  x1[n] + x2[n];
  432|  35.1M|        }
  433|       |
  434|       |        /* calculate 32 output samples and window */
  435|  36.2M|        for (k = 0; k < 32; k++)
  ------------------
  |  Branch (435:21): [True: 35.1M, False: 1.09M]
  ------------------
  436|  35.1M|        {
  437|  35.1M|            output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  438|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  439|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  440|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  441|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  442|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  443|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  444|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  445|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  446|  35.1M|                MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
  ------------------
  |  |  286|  35.1M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  447|  35.1M|        }
  448|       |
  449|       |        /* update ringbuffer index */
  450|  1.09M|        qmfs->v_index -= 64;
  451|  1.09M|        if (qmfs->v_index < 0)
  ------------------
  |  Branch (451:13): [True: 130k, False: 968k]
  ------------------
  452|   130k|            qmfs->v_index = (640 - 64);
  453|  1.09M|    }
  454|  34.5k|}
sbr_qmf_synthesis_64:
  458|  68.7k|{
  459|       |//    ALIGN real_t x1[64], x2[64];
  460|  68.7k|#ifndef SBR_LOW_POWER
  461|  68.7k|    ALIGN real_t in_real1[32], in_imag1[32], out_real1[32], out_imag1[32];
  462|  68.7k|    ALIGN real_t in_real2[32], in_imag2[32], out_real2[32], out_imag2[32];
  463|  68.7k|#endif
  464|  68.7k|    qmf_t * pX;
  ------------------
  |  |  167|  68.7k|#define qmf_t complex_t
  ------------------
  465|  68.7k|    real_t * pring_buffer_1, * pring_buffer_3;
  466|       |//    real_t * ptemp_1, * ptemp_2;
  467|       |#ifdef PREFER_POINTERS
  468|       |    // These pointers are used if target platform has autoinc address generators
  469|       |    real_t * pring_buffer_2, * pring_buffer_4;
  470|       |    real_t * pring_buffer_5, * pring_buffer_6;
  471|       |    real_t * pring_buffer_7, * pring_buffer_8;
  472|       |    real_t * pring_buffer_9, * pring_buffer_10;
  473|       |    const real_t * pqmf_c_1, * pqmf_c_2, * pqmf_c_3, * pqmf_c_4;
  474|       |    const real_t * pqmf_c_5, * pqmf_c_6, * pqmf_c_7, * pqmf_c_8;
  475|       |    const real_t * pqmf_c_9, * pqmf_c_10;
  476|       |#endif // #ifdef PREFER_POINTERS
  477|  68.7k|#ifndef FIXED_POINT
  478|  68.7k|    real_t scale = 1.f/64.f;
  479|  68.7k|#endif
  480|  68.7k|    int32_t n, k, out = 0;
  481|  68.7k|    uint8_t l;
  482|       |
  483|       |
  484|       |    /* qmf subsample l */
  485|  2.22M|    for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (485:17): [True: 2.15M, False: 68.7k]
  ------------------
  486|  2.15M|    {
  487|       |        /* shift buffer v */
  488|       |		/* buffer is not shifted, we use double ringbuffer */
  489|       |		//memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
  490|       |
  491|       |        /* calculate 128 samples */
  492|  2.15M|#ifndef FIXED_POINT
  493|       |
  494|  2.15M|        pX = X[l];
  495|       |
  496|  2.15M|        in_imag1[31] = scale*QMF_RE(pX[1]);
  ------------------
  |  |  168|  2.15M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.15M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  497|  2.15M|        in_real1[0]  = scale*QMF_RE(pX[0]);
  ------------------
  |  |  168|  2.15M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.15M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  498|  2.15M|        in_imag2[31] = scale*QMF_IM(pX[63-1]);
  ------------------
  |  |  169|  2.15M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.15M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  499|  2.15M|        in_real2[0]  = scale*QMF_IM(pX[63-0]);
  ------------------
  |  |  169|  2.15M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.15M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  500|  66.8M|        for (k = 1; k < 31; k++)
  ------------------
  |  Branch (500:21): [True: 64.6M, False: 2.15M]
  ------------------
  501|  64.6M|        {
  502|  64.6M|            in_imag1[31 - k] = scale*QMF_RE(pX[2*k + 1]);
  ------------------
  |  |  168|  64.6M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  64.6M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  503|  64.6M|            in_real1[     k] = scale*QMF_RE(pX[2*k    ]);
  ------------------
  |  |  168|  64.6M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  64.6M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  504|  64.6M|            in_imag2[31 - k] = scale*QMF_IM(pX[63 - (2*k + 1)]);
  ------------------
  |  |  169|  64.6M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  64.6M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  505|  64.6M|            in_real2[     k] = scale*QMF_IM(pX[63 - (2*k    )]);
  ------------------
  |  |  169|  64.6M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  64.6M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  506|  64.6M|        }
  507|  2.15M|        in_imag1[0]  = scale*QMF_RE(pX[63]);
  ------------------
  |  |  168|  2.15M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.15M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  508|  2.15M|        in_real1[31] = scale*QMF_RE(pX[62]);
  ------------------
  |  |  168|  2.15M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.15M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  509|  2.15M|        in_imag2[0]  = scale*QMF_IM(pX[63-63]);
  ------------------
  |  |  169|  2.15M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.15M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  510|  2.15M|        in_real2[31] = scale*QMF_IM(pX[63-62]);
  ------------------
  |  |  169|  2.15M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.15M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  511|       |
  512|       |#else
  513|       |
  514|       |        pX = X[l];
  515|       |
  516|       |        in_imag1[31] = QMF_RE(pX[1]) >> 1;
  517|       |        in_real1[0]  = QMF_RE(pX[0]) >> 1;
  518|       |        in_imag2[31] = QMF_IM(pX[62]) >> 1;
  519|       |        in_real2[0]  = QMF_IM(pX[63]) >> 1;
  520|       |        for (k = 1; k < 31; k++)
  521|       |        {
  522|       |            in_imag1[31 - k] = QMF_RE(pX[2*k + 1]) >> 1;
  523|       |            in_real1[     k] = QMF_RE(pX[2*k    ]) >> 1;
  524|       |            in_imag2[31 - k] = QMF_IM(pX[63 - (2*k + 1)]) >> 1;
  525|       |            in_real2[     k] = QMF_IM(pX[63 - (2*k    )]) >> 1;
  526|       |        }
  527|       |        in_imag1[0]  = QMF_RE(pX[63]) >> 1;
  528|       |        in_real1[31] = QMF_RE(pX[62]) >> 1;
  529|       |        in_imag2[0]  = QMF_IM(pX[0]) >> 1;
  530|       |        in_real2[31] = QMF_IM(pX[1]) >> 1;
  531|       |
  532|       |#endif
  533|       |
  534|       |
  535|       |        // dct4_kernel is DCT_IV without reordering which is done before and after FFT
  536|  2.15M|        dct4_kernel(in_real1, in_imag1, out_real1, out_imag1);
  537|  2.15M|        dct4_kernel(in_real2, in_imag2, out_real2, out_imag2);
  538|       |
  539|       |
  540|  2.15M|        pring_buffer_1 = qmfs->v + qmfs->v_index;
  541|  2.15M|        pring_buffer_3 = pring_buffer_1 + 1280;
  542|       |#ifdef PREFER_POINTERS
  543|       |        pring_buffer_2 = pring_buffer_1 + 127;
  544|       |        pring_buffer_4 = pring_buffer_1 + (1280 + 127);
  545|       |#endif // #ifdef PREFER_POINTERS
  546|       |//        ptemp_1 = x1;
  547|       |//        ptemp_2 = x2;
  548|       |#ifdef PREFER_POINTERS
  549|       |        for (n = 0; n < 32; n ++)
  550|       |        {
  551|       |            //real_t x1 = *ptemp_1++;
  552|       |            //real_t x2 = *ptemp_2++;
  553|       |            // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
  554|       |            *pring_buffer_1++ = *pring_buffer_3++ = out_real2[n] - out_real1[n];
  555|       |            *pring_buffer_2-- = *pring_buffer_4-- = out_real2[n] + out_real1[n];
  556|       |            //x1 = *ptemp_1++;
  557|       |            //x2 = *ptemp_2++;
  558|       |            *pring_buffer_1++ = *pring_buffer_3++ = out_imag2[31-n] + out_imag1[31-n];
  559|       |            *pring_buffer_2-- = *pring_buffer_4-- = out_imag2[31-n] - out_imag1[31-n];
  560|       |        }
  561|       |#else // #ifdef PREFER_POINTERS
  562|       |
  563|  71.1M|        for (n = 0; n < 32; n++)
  ------------------
  |  Branch (563:21): [True: 68.9M, False: 2.15M]
  ------------------
  564|  68.9M|        {
  565|       |            // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
  566|  68.9M|            pring_buffer_1[2*n]         = pring_buffer_3[2*n]         = out_real2[n] - out_real1[n];
  567|  68.9M|            pring_buffer_1[127-2*n]     = pring_buffer_3[127-2*n]     = out_real2[n] + out_real1[n];
  568|  68.9M|            pring_buffer_1[2*n+1]       = pring_buffer_3[2*n+1]       = out_imag2[31-n] + out_imag1[31-n];
  569|  68.9M|            pring_buffer_1[127-(2*n+1)] = pring_buffer_3[127-(2*n+1)] = out_imag2[31-n] - out_imag1[31-n];
  570|  68.9M|        }
  571|       |
  572|  2.15M|#endif // #ifdef PREFER_POINTERS
  573|       |
  574|  2.15M|        pring_buffer_1 = qmfs->v + qmfs->v_index;
  575|       |#ifdef PREFER_POINTERS
  576|       |        pring_buffer_2 = pring_buffer_1 + 192;
  577|       |        pring_buffer_3 = pring_buffer_1 + 256;
  578|       |        pring_buffer_4 = pring_buffer_1 + (256 + 192);
  579|       |        pring_buffer_5 = pring_buffer_1 + 512;
  580|       |        pring_buffer_6 = pring_buffer_1 + (512 + 192);
  581|       |        pring_buffer_7 = pring_buffer_1 + 768;
  582|       |        pring_buffer_8 = pring_buffer_1 + (768 + 192);
  583|       |        pring_buffer_9 = pring_buffer_1 + 1024;
  584|       |        pring_buffer_10 = pring_buffer_1 + (1024 + 192);
  585|       |        pqmf_c_1 = qmf_c;
  586|       |        pqmf_c_2 = qmf_c + 64;
  587|       |        pqmf_c_3 = qmf_c + 128;
  588|       |        pqmf_c_4 = qmf_c + 192;
  589|       |        pqmf_c_5 = qmf_c + 256;
  590|       |        pqmf_c_6 = qmf_c + 320;
  591|       |        pqmf_c_7 = qmf_c + 384;
  592|       |        pqmf_c_8 = qmf_c + 448;
  593|       |        pqmf_c_9 = qmf_c + 512;
  594|       |        pqmf_c_10 = qmf_c + 576;
  595|       |#endif // #ifdef PREFER_POINTERS
  596|       |
  597|       |        /* calculate 64 output samples and window */
  598|   140M|        for (k = 0; k < 64; k++)
  ------------------
  |  Branch (598:21): [True: 137M, False: 2.15M]
  ------------------
  599|   137M|        {
  600|       |#ifdef PREFER_POINTERS
  601|       |            output[out++] =
  602|       |                MUL_F(*pring_buffer_1++,  *pqmf_c_1++) +
  603|       |                MUL_F(*pring_buffer_2++,  *pqmf_c_2++) +
  604|       |                MUL_F(*pring_buffer_3++,  *pqmf_c_3++) +
  605|       |                MUL_F(*pring_buffer_4++,  *pqmf_c_4++) +
  606|       |                MUL_F(*pring_buffer_5++,  *pqmf_c_5++) +
  607|       |                MUL_F(*pring_buffer_6++,  *pqmf_c_6++) +
  608|       |                MUL_F(*pring_buffer_7++,  *pqmf_c_7++) +
  609|       |                MUL_F(*pring_buffer_8++,  *pqmf_c_8++) +
  610|       |                MUL_F(*pring_buffer_9++,  *pqmf_c_9++) +
  611|       |                MUL_F(*pring_buffer_10++, *pqmf_c_10++);
  612|       |#else // #ifdef PREFER_POINTERS
  613|   137M|            output[out++] =
  614|   137M|                MUL_F(pring_buffer_1[k+0],          qmf_c[k+0])   +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  615|   137M|                MUL_F(pring_buffer_1[k+192],        qmf_c[k+64])  +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  616|   137M|                MUL_F(pring_buffer_1[k+256],        qmf_c[k+128]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  617|   137M|                MUL_F(pring_buffer_1[k+(256+192)],  qmf_c[k+192]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  618|   137M|                MUL_F(pring_buffer_1[k+512],        qmf_c[k+256]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  619|   137M|                MUL_F(pring_buffer_1[k+(512+192)],  qmf_c[k+320]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  620|   137M|                MUL_F(pring_buffer_1[k+768],        qmf_c[k+384]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  621|   137M|                MUL_F(pring_buffer_1[k+(768+192)],  qmf_c[k+448]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  622|   137M|                MUL_F(pring_buffer_1[k+1024],       qmf_c[k+512]) +
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  623|   137M|                MUL_F(pring_buffer_1[k+(1024+192)], qmf_c[k+576]);
  ------------------
  |  |  286|   137M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  624|   137M|#endif // #ifdef PREFER_POINTERS
  625|   137M|        }
  626|       |
  627|       |        /* update ringbuffer index */
  628|  2.15M|        qmfs->v_index -= 128;
  629|  2.15M|        if (qmfs->v_index < 0)
  ------------------
  |  Branch (629:13): [True: 246k, False: 1.90M]
  ------------------
  630|   246k|            qmfs->v_index = (1280 - 128);
  631|  2.15M|    }
  632|  68.7k|}

sbr_extension_data:
  140|  22.9k|{
  141|  22.9k|    uint8_t result = 0;
  142|  22.9k|    uint16_t num_align_bits = 0;
  143|  22.9k|    uint16_t num_sbr_bits1 = (uint16_t)faad_get_processed_bits(ld);
  144|  22.9k|    uint16_t num_sbr_bits2;
  145|       |
  146|  22.9k|    uint8_t saved_start_freq, saved_samplerate_mode;
  147|  22.9k|    uint8_t saved_stop_freq, saved_freq_scale;
  148|  22.9k|    uint8_t saved_alter_scale, saved_xover_band;
  149|       |
  150|  22.9k|#if (defined(PS_DEC) || defined(DRM_PS))
  151|  22.9k|    if (psResetFlag)
  ------------------
  |  Branch (151:9): [True: 13.7k, False: 9.19k]
  ------------------
  152|  13.7k|        sbr->psResetFlag = psResetFlag;
  153|  22.9k|#endif
  154|       |
  155|  22.9k|#ifdef DRM
  156|  22.9k|    if (!sbr->Is_DRM_SBR)
  ------------------
  |  Branch (156:9): [True: 22.6k, False: 306]
  ------------------
  157|  22.6k|#endif
  158|  22.6k|    {
  159|  22.6k|        uint8_t bs_extension_type = (uint8_t)faad_getbits(ld, 4
  160|  22.6k|            DEBUGVAR(1,198,"sbr_bitstream(): bs_extension_type"));
  161|       |
  162|  22.6k|        if (bs_extension_type == EXT_SBR_DATA_CRC)
  ------------------
  |  |   44|  22.6k|#define EXT_SBR_DATA_CRC 14
  ------------------
  |  Branch (162:13): [True: 7.85k, False: 14.7k]
  ------------------
  163|  7.85k|        {
  164|  7.85k|            sbr->bs_sbr_crc_bits = (uint16_t)faad_getbits(ld, 10
  165|  7.85k|                DEBUGVAR(1,199,"sbr_bitstream(): bs_sbr_crc_bits"));
  166|  7.85k|        }
  167|  22.6k|    }
  168|       |
  169|       |    /* save old header values, in case the new ones are corrupted */
  170|  22.9k|    saved_start_freq = sbr->bs_start_freq;
  171|  22.9k|    saved_samplerate_mode = sbr->bs_samplerate_mode;
  172|  22.9k|    saved_stop_freq = sbr->bs_stop_freq;
  173|  22.9k|    saved_freq_scale = sbr->bs_freq_scale;
  174|  22.9k|    saved_alter_scale = sbr->bs_alter_scale;
  175|  22.9k|    saved_xover_band = sbr->bs_xover_band;
  176|       |
  177|  22.9k|    sbr->bs_header_flag = faad_get1bit(ld
  178|  22.9k|        DEBUGVAR(1,200,"sbr_bitstream(): bs_header_flag"));
  179|       |
  180|  22.9k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (180:9): [True: 22.4k, False: 526]
  ------------------
  181|  22.4k|        sbr_header(ld, sbr);
  182|       |
  183|       |    /* Reset? */
  184|  22.9k|    sbr_reset(sbr);
  185|       |
  186|       |    /* first frame should have a header */
  187|       |    //if (!(sbr->frame == 0 && sbr->bs_header_flag == 0))
  188|  22.9k|    if (sbr->header_count != 0)
  ------------------
  |  Branch (188:9): [True: 22.5k, False: 346]
  ------------------
  189|  22.5k|    {
  190|  22.5k|        if (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked))
  ------------------
  |  Branch (190:13): [True: 22.2k, False: 367]
  |  Branch (190:28): [True: 220, False: 147]
  |  Branch (190:51): [True: 0, False: 220]
  ------------------
  191|  22.2k|        {
  192|  22.2k|            uint8_t rt = calc_sbr_tables(sbr, sbr->bs_start_freq, sbr->bs_stop_freq,
  193|  22.2k|                sbr->bs_samplerate_mode, sbr->bs_freq_scale,
  194|  22.2k|                sbr->bs_alter_scale, sbr->bs_xover_band);
  195|       |
  196|       |            /* if an error occured with the new header values revert to the old ones */
  197|  22.2k|            if (rt > 0)
  ------------------
  |  Branch (197:17): [True: 6.37k, False: 15.8k]
  ------------------
  198|  6.37k|            {
  199|  6.37k|                result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
  200|  6.37k|                    saved_samplerate_mode, saved_freq_scale,
  201|  6.37k|                    saved_alter_scale, saved_xover_band);
  202|  6.37k|            }
  203|  22.2k|        }
  204|       |
  205|  22.5k|        if (result == 0)
  ------------------
  |  Branch (205:13): [True: 21.2k, False: 1.37k]
  ------------------
  206|  21.2k|        {
  207|  21.2k|            result = sbr_data(ld, sbr);
  208|       |
  209|       |            /* sbr_data() returning an error means that there was an error in
  210|       |               envelope_time_border_vector().
  211|       |               In this case the old time border vector is saved and all the previous
  212|       |               data normally read after sbr_grid() is saved.
  213|       |            */
  214|       |            /* to be on the safe side, calculate old sbr tables in case of error */
  215|  21.2k|            if ((result > 0) &&
  ------------------
  |  Branch (215:17): [True: 7.40k, False: 13.8k]
  ------------------
  216|  7.40k|                (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked)))
  ------------------
  |  Branch (216:18): [True: 7.28k, False: 120]
  |  Branch (216:33): [True: 43, False: 77]
  |  Branch (216:56): [True: 0, False: 43]
  ------------------
  217|  7.28k|            {
  218|  7.28k|                result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
  219|  7.28k|                    saved_samplerate_mode, saved_freq_scale,
  220|  7.28k|                    saved_alter_scale, saved_xover_band);
  221|  7.28k|            }
  222|       |
  223|       |            /* we should be able to safely set result to 0 now, */
  224|       |            /* but practise indicates this doesn't work well */
  225|  21.2k|        }
  226|  22.5k|    } else {
  227|    346|        result = 1;
  228|    346|    }
  229|       |
  230|  22.9k|    num_sbr_bits2 = (uint16_t)faad_get_processed_bits(ld) - num_sbr_bits1;
  231|       |
  232|       |    /* check if we read more bits then were available for sbr */
  233|  22.9k|    if (8*cnt < num_sbr_bits2)
  ------------------
  |  Branch (233:9): [True: 15.2k, False: 7.69k]
  ------------------
  234|  15.2k|    {
  235|  15.2k|        faad_resetbits(ld, num_sbr_bits1 + 8u * cnt);
  236|  15.2k|        num_sbr_bits2 = 8*cnt;
  237|       |
  238|  15.2k|#ifdef PS_DEC
  239|       |        /* turn off PS for the unfortunate case that we randomly read some
  240|       |         * PS data that looks correct */
  241|  15.2k|        sbr->ps_used = 0;
  242|  15.2k|#endif
  243|       |
  244|       |        /* Make sure it doesn't decode SBR in this frame, or we'll get glitches */
  245|  15.2k|        return 1;
  246|  15.2k|    }
  247|       |
  248|  7.69k|#ifdef DRM
  249|  7.69k|    if (!sbr->Is_DRM_SBR)
  ------------------
  |  Branch (249:9): [True: 7.41k, False: 281]
  ------------------
  250|  7.41k|#endif
  251|  7.41k|    {
  252|       |        /* -4 does not apply, bs_extension_type is re-read in this function */
  253|  7.41k|        num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits2;
  254|       |
  255|   170k|        while (num_align_bits > 7)
  ------------------
  |  Branch (255:16): [True: 162k, False: 7.41k]
  ------------------
  256|   162k|        {
  257|   162k|            faad_getbits(ld, 8
  258|   162k|                DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
  259|   162k|            num_align_bits -= 8;
  260|   162k|        }
  261|  7.41k|        faad_getbits(ld, num_align_bits
  262|  7.41k|            DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
  263|  7.41k|    }
  264|       |
  265|  7.69k|    return result;
  266|  22.9k|}
sbr_syntax.c:sbr_reset:
   69|  22.9k|{
   70|       |#if 0
   71|       |    printf("%d\n", sbr->bs_start_freq_prev);
   72|       |    printf("%d\n", sbr->bs_stop_freq_prev);
   73|       |    printf("%d\n", sbr->bs_freq_scale_prev);
   74|       |    printf("%d\n", sbr->bs_alter_scale_prev);
   75|       |    printf("%d\n", sbr->bs_xover_band_prev);
   76|       |    printf("%d\n\n", sbr->bs_noise_bands_prev);
   77|       |#endif
   78|       |
   79|       |    /* if these are different from the previous frame: Reset = 1 */
   80|  22.9k|    if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
  ------------------
  |  Branch (80:9): [True: 22.3k, False: 552]
  ------------------
   81|    552|        (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
  ------------------
  |  Branch (81:9): [True: 54, False: 498]
  ------------------
   82|    498|        (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
  ------------------
  |  Branch (82:9): [True: 51, False: 447]
  ------------------
   83|    447|        (sbr->bs_alter_scale != sbr->bs_alter_scale_prev) ||
  ------------------
  |  Branch (83:9): [True: 28, False: 419]
  ------------------
   84|    419|        (sbr->bs_xover_band != sbr->bs_xover_band_prev) ||
  ------------------
  |  Branch (84:9): [True: 28, False: 391]
  ------------------
   85|    391|        (sbr->bs_noise_bands != sbr->bs_noise_bands_prev))
  ------------------
  |  Branch (85:9): [True: 24, False: 367]
  ------------------
   86|  22.5k|    {
   87|  22.5k|        sbr->Reset = 1;
   88|  22.5k|    } else {
   89|    367|        sbr->Reset = 0;
   90|    367|    }
   91|       |
   92|  22.9k|    sbr->bs_start_freq_prev = sbr->bs_start_freq;
   93|  22.9k|    sbr->bs_stop_freq_prev = sbr->bs_stop_freq;
   94|  22.9k|    sbr->bs_freq_scale_prev = sbr->bs_freq_scale;
   95|  22.9k|    sbr->bs_alter_scale_prev = sbr->bs_alter_scale;
   96|  22.9k|    sbr->bs_xover_band_prev = sbr->bs_xover_band;
   97|  22.9k|    sbr->bs_noise_bands_prev = sbr->bs_noise_bands;
   98|  22.9k|}
sbr_syntax.c:calc_sbr_tables:
  103|  35.8k|{
  104|  35.8k|    uint8_t result = 0;
  105|  35.8k|    uint8_t k2;
  106|       |
  107|       |    /* calculate the Master Frequency Table */
  108|  35.8k|    sbr->k0 = qmf_start_channel(start_freq, samplerate_mode, sbr->sample_rate);
  109|  35.8k|    k2 = qmf_stop_channel(stop_freq, sbr->sample_rate, sbr->k0);
  110|       |
  111|       |    /* check k0 and k2 */
  112|  35.8k|    if (sbr->sample_rate >= 48000)
  ------------------
  |  Branch (112:9): [True: 15.4k, False: 20.4k]
  ------------------
  113|  15.4k|    {
  114|  15.4k|        if ((k2 - sbr->k0) > 32)
  ------------------
  |  Branch (114:13): [True: 808, False: 14.6k]
  ------------------
  115|    808|            result += 1;
  116|  20.4k|    } else if (sbr->sample_rate <= 32000) {
  ------------------
  |  Branch (116:16): [True: 16.9k, False: 3.56k]
  ------------------
  117|  16.9k|        if ((k2 - sbr->k0) > 48)
  ------------------
  |  Branch (117:13): [True: 659, False: 16.2k]
  ------------------
  118|    659|            result += 1;
  119|  16.9k|    } else { /* (sbr->sample_rate == 44100) */
  120|  3.56k|        if ((k2 - sbr->k0) > 45)
  ------------------
  |  Branch (120:13): [True: 305, False: 3.25k]
  ------------------
  121|    305|            result += 1;
  122|  3.56k|    }
  123|       |
  124|  35.8k|    if (freq_scale == 0)
  ------------------
  |  Branch (124:9): [True: 7.92k, False: 27.9k]
  ------------------
  125|  7.92k|    {
  126|  7.92k|        result += master_frequency_table_fs0(sbr, sbr->k0, k2, alter_scale);
  127|  27.9k|    } else {
  128|  27.9k|        result += master_frequency_table(sbr, sbr->k0, k2, freq_scale, alter_scale);
  129|  27.9k|    }
  130|  35.8k|    result += derived_frequency_table(sbr, xover_band, k2);
  131|       |
  132|  35.8k|    result = (result > 0) ? 1 : 0;
  ------------------
  |  Branch (132:14): [True: 9.48k, False: 26.3k]
  ------------------
  133|       |
  134|  35.8k|    return result;
  135|  35.8k|}
sbr_syntax.c:sbr_header:
  270|  22.4k|{
  271|  22.4k|    uint8_t bs_header_extra_1, bs_header_extra_2;
  272|       |
  273|  22.4k|    sbr->header_count++;
  274|       |
  275|  22.4k|    sbr->bs_amp_res = faad_get1bit(ld
  276|  22.4k|        DEBUGVAR(1,203,"sbr_header(): bs_amp_res"));
  277|       |
  278|       |    /* bs_start_freq and bs_stop_freq must define a fequency band that does
  279|       |       not exceed 48 channels */
  280|  22.4k|    sbr->bs_start_freq = (uint8_t)faad_getbits(ld, 4
  281|  22.4k|        DEBUGVAR(1,204,"sbr_header(): bs_start_freq"));
  282|  22.4k|    sbr->bs_stop_freq = (uint8_t)faad_getbits(ld, 4
  283|  22.4k|        DEBUGVAR(1,205,"sbr_header(): bs_stop_freq"));
  284|  22.4k|    sbr->bs_xover_band = (uint8_t)faad_getbits(ld, 3
  285|  22.4k|        DEBUGVAR(1,206,"sbr_header(): bs_xover_band"));
  286|  22.4k|    faad_getbits(ld, 2
  287|  22.4k|        DEBUGVAR(1,207,"sbr_header(): bs_reserved_bits_hdr"));
  288|  22.4k|    bs_header_extra_1 = (uint8_t)faad_get1bit(ld
  289|  22.4k|        DEBUGVAR(1,208,"sbr_header(): bs_header_extra_1"));
  290|  22.4k|    bs_header_extra_2 = (uint8_t)faad_get1bit(ld
  291|  22.4k|        DEBUGVAR(1,209,"sbr_header(): bs_header_extra_2"));
  292|       |
  293|  22.4k|    if (bs_header_extra_1)
  ------------------
  |  Branch (293:9): [True: 9.79k, False: 12.6k]
  ------------------
  294|  9.79k|    {
  295|  9.79k|        sbr->bs_freq_scale = (uint8_t)faad_getbits(ld, 2
  296|  9.79k|            DEBUGVAR(1,211,"sbr_header(): bs_freq_scale"));
  297|  9.79k|        sbr->bs_alter_scale = (uint8_t)faad_get1bit(ld
  298|  9.79k|            DEBUGVAR(1,212,"sbr_header(): bs_alter_scale"));
  299|  9.79k|        sbr->bs_noise_bands = (uint8_t)faad_getbits(ld, 2
  300|  9.79k|            DEBUGVAR(1,213,"sbr_header(): bs_noise_bands"));
  301|  12.6k|    } else {
  302|       |        /* Default values */
  303|  12.6k|        sbr->bs_freq_scale = 2;
  304|  12.6k|        sbr->bs_alter_scale = 1;
  305|  12.6k|        sbr->bs_noise_bands = 2;
  306|  12.6k|    }
  307|       |
  308|  22.4k|    if (bs_header_extra_2)
  ------------------
  |  Branch (308:9): [True: 5.98k, False: 16.4k]
  ------------------
  309|  5.98k|    {
  310|  5.98k|        sbr->bs_limiter_bands = (uint8_t)faad_getbits(ld, 2
  311|  5.98k|            DEBUGVAR(1,214,"sbr_header(): bs_limiter_bands"));
  312|  5.98k|        sbr->bs_limiter_gains = (uint8_t)faad_getbits(ld, 2
  313|  5.98k|            DEBUGVAR(1,215,"sbr_header(): bs_limiter_gains"));
  314|  5.98k|        sbr->bs_interpol_freq = (uint8_t)faad_get1bit(ld
  315|  5.98k|            DEBUGVAR(1,216,"sbr_header(): bs_interpol_freq"));
  316|  5.98k|        sbr->bs_smoothing_mode = (uint8_t)faad_get1bit(ld
  317|  5.98k|            DEBUGVAR(1,217,"sbr_header(): bs_smoothing_mode"));
  318|  16.4k|    } else {
  319|       |        /* Default values */
  320|  16.4k|        sbr->bs_limiter_bands = 2;
  321|  16.4k|        sbr->bs_limiter_gains = 2;
  322|  16.4k|        sbr->bs_interpol_freq = 1;
  323|  16.4k|        sbr->bs_smoothing_mode = 1;
  324|  16.4k|    }
  325|       |
  326|       |#if 0
  327|       |    /* print the header to screen */
  328|       |    printf("bs_amp_res: %d\n", sbr->bs_amp_res);
  329|       |    printf("bs_start_freq: %d\n", sbr->bs_start_freq);
  330|       |    printf("bs_stop_freq: %d\n", sbr->bs_stop_freq);
  331|       |    printf("bs_xover_band: %d\n", sbr->bs_xover_band);
  332|       |    if (bs_header_extra_1)
  333|       |    {
  334|       |        printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
  335|       |        printf("bs_alter_scale: %d\n", sbr->bs_alter_scale);
  336|       |        printf("bs_noise_bands: %d\n", sbr->bs_noise_bands);
  337|       |    }
  338|       |    if (bs_header_extra_2)
  339|       |    {
  340|       |        printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
  341|       |        printf("bs_limiter_gains: %d\n", sbr->bs_limiter_gains);
  342|       |        printf("bs_interpol_freq: %d\n", sbr->bs_interpol_freq);
  343|       |        printf("bs_smoothing_mode: %d\n", sbr->bs_smoothing_mode);
  344|       |    }
  345|       |    printf("\n");
  346|       |#endif
  347|  22.4k|}
sbr_syntax.c:sbr_data:
  351|  21.2k|{
  352|  21.2k|    uint8_t result;
  353|       |#if 0
  354|       |    sbr->bs_samplerate_mode = faad_get1bit(ld
  355|       |        DEBUGVAR(1,219,"sbr_data(): bs_samplerate_mode"));
  356|       |#endif
  357|       |
  358|  21.2k|    sbr->rate = (sbr->bs_samplerate_mode) ? 2 : 1;
  ------------------
  |  Branch (358:17): [True: 21.2k, False: 0]
  ------------------
  359|       |
  360|  21.2k|    switch (sbr->id_aac)
  ------------------
  |  Branch (360:13): [True: 21.2k, False: 10]
  ------------------
  361|  21.2k|    {
  362|  10.4k|    case ID_SCE:
  ------------------
  |  |   86|  10.4k|#define ID_SCE 0x0
  ------------------
  |  Branch (362:5): [True: 10.4k, False: 10.7k]
  ------------------
  363|  10.4k|		if ((result = sbr_single_channel_element(ld, sbr)) > 0)
  ------------------
  |  Branch (363:7): [True: 4.96k, False: 5.45k]
  ------------------
  364|  4.96k|			return result;
  365|  5.45k|        break;
  366|  10.7k|    case ID_CPE:
  ------------------
  |  |   87|  10.7k|#define ID_CPE 0x1
  ------------------
  |  Branch (366:5): [True: 10.7k, False: 10.4k]
  ------------------
  367|  10.7k|		if ((result = sbr_channel_pair_element(ld, sbr)) > 0)
  ------------------
  |  Branch (367:7): [True: 2.44k, False: 8.34k]
  ------------------
  368|  2.44k|			return result;
  369|  8.34k|        break;
  370|  21.2k|    }
  371|       |
  372|  13.8k|	return 0;
  373|  21.2k|}
sbr_syntax.c:sbr_single_channel_element:
  377|  10.4k|{
  378|  10.4k|    uint8_t result;
  379|       |
  380|  10.4k|    if (faad_get1bit(ld
  ------------------
  |  Branch (380:9): [True: 2.43k, False: 7.97k]
  ------------------
  381|  10.4k|        DEBUGVAR(1,220,"sbr_single_channel_element(): bs_data_extra")))
  382|  2.43k|    {
  383|  2.43k|        faad_getbits(ld, 4
  384|  2.43k|            DEBUGVAR(1,221,"sbr_single_channel_element(): bs_reserved_bits_data"));
  385|  2.43k|    }
  386|       |
  387|  10.4k|#ifdef DRM
  388|       |    /* bs_coupling, from sbr_channel_pair_base_element(bs_amp_res) */
  389|  10.4k|    if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (389:9): [True: 244, False: 10.1k]
  ------------------
  390|    244|    {
  391|    244|        faad_get1bit(ld);
  392|    244|    }
  393|  10.4k|#endif
  394|       |
  395|  10.4k|    if ((result = sbr_grid(ld, sbr, 0)) > 0)
  ------------------
  |  Branch (395:9): [True: 346, False: 10.0k]
  ------------------
  396|    346|        return result;
  397|       |
  398|  10.0k|    sbr_dtdf(ld, sbr, 0);
  399|  10.0k|    invf_mode(ld, sbr, 0);
  400|  10.0k|    sbr_envelope(ld, sbr, 0);
  401|  10.0k|    sbr_noise(ld, sbr, 0);
  402|       |
  403|  10.0k|#ifndef FIXED_POINT
  404|  10.0k|    envelope_noise_dequantisation(sbr, 0);
  405|  10.0k|#endif
  406|       |
  407|  10.0k|    memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
  408|       |
  409|  10.0k|    sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
  410|  10.0k|        DEBUGVAR(1,223,"sbr_single_channel_element(): bs_add_harmonic_flag[0]"));
  411|  10.0k|    if (sbr->bs_add_harmonic_flag[0])
  ------------------
  |  Branch (411:9): [True: 4.06k, False: 6.00k]
  ------------------
  412|  4.06k|        sinusoidal_coding(ld, sbr, 0);
  413|       |
  414|  10.0k|    sbr->bs_extended_data = faad_get1bit(ld
  415|  10.0k|        DEBUGVAR(1,224,"sbr_single_channel_element(): bs_extended_data[0]"));
  416|       |
  417|  10.0k|    if (sbr->bs_extended_data)
  ------------------
  |  Branch (417:9): [True: 6.64k, False: 3.42k]
  ------------------
  418|  6.64k|    {
  419|  6.64k|        uint16_t nr_bits_left;
  420|  6.64k|#if (defined(PS_DEC) || defined(DRM_PS))
  421|  6.64k|        uint8_t ps_ext_read = 0;
  422|  6.64k|#endif
  423|  6.64k|        uint16_t cnt = (uint16_t)faad_getbits(ld, 4
  424|  6.64k|            DEBUGVAR(1,225,"sbr_single_channel_element(): bs_extension_size"));
  425|  6.64k|        if (cnt == 15)
  ------------------
  |  Branch (425:13): [True: 1.06k, False: 5.57k]
  ------------------
  426|  1.06k|        {
  427|  1.06k|            cnt += (uint16_t)faad_getbits(ld, 8
  428|  1.06k|                DEBUGVAR(1,226,"sbr_single_channel_element(): bs_esc_count"));
  429|  1.06k|        }
  430|       |
  431|  6.64k|        nr_bits_left = 8 * cnt;
  432|  17.5k|        while (nr_bits_left > 7)
  ------------------
  |  Branch (432:16): [True: 15.5k, False: 2.02k]
  ------------------
  433|  15.5k|        {
  434|  15.5k|            uint16_t tmp_nr_bits = 0;
  435|       |
  436|  15.5k|            sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
  437|  15.5k|                DEBUGVAR(1,227,"sbr_single_channel_element(): bs_extension_id"));
  438|  15.5k|            tmp_nr_bits += 2;
  439|       |
  440|       |            /* allow only 1 PS extension element per extension data */
  441|  15.5k|#if (defined(PS_DEC) || defined(DRM_PS))
  442|  15.5k|#if (defined(PS_DEC) && defined(DRM_PS))
  443|  15.5k|            if (sbr->bs_extension_id == EXTENSION_ID_PS || sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
  ------------------
  |  |   40|  31.0k|#define EXTENSION_ID_PS 2
  ------------------
                          if (sbr->bs_extension_id == EXTENSION_ID_PS || sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
  ------------------
  |  |   40|  10.0k|#define DRM_PARAMETRIC_STEREO    0
  ------------------
  |  Branch (443:17): [True: 5.48k, False: 10.0k]
  |  Branch (443:60): [True: 3.31k, False: 6.73k]
  ------------------
  444|       |#else
  445|       |#ifdef PS_DEC
  446|       |            if (sbr->bs_extension_id == EXTENSION_ID_PS)
  447|       |#else
  448|       |#ifdef DRM_PS
  449|       |            if (sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
  450|       |#endif
  451|       |#endif
  452|       |#endif
  453|  8.79k|            {
  454|  8.79k|                if (ps_ext_read == 0)
  ------------------
  |  Branch (454:21): [True: 6.39k, False: 2.40k]
  ------------------
  455|  6.39k|                {
  456|  6.39k|                    ps_ext_read = 1;
  457|  6.39k|                } else {
  458|       |                    /* to be safe make it 3, will switch to "default"
  459|       |                     * in sbr_extension() */
  460|  2.40k|#ifdef DRM
  461|  2.40k|                    return 1;
  462|       |#else
  463|       |                    sbr->bs_extension_id = 3;
  464|       |#endif
  465|  2.40k|                }
  466|  8.79k|            }
  467|  13.1k|#endif
  468|       |
  469|  13.1k|            tmp_nr_bits += sbr_extension(ld, sbr, sbr->bs_extension_id, nr_bits_left);
  470|       |
  471|       |            /* check if the data read is bigger than the number of available bits */
  472|  13.1k|            if (tmp_nr_bits > nr_bits_left)
  ------------------
  |  Branch (472:17): [True: 2.21k, False: 10.9k]
  ------------------
  473|  2.21k|                return 1;
  474|       |
  475|  10.9k|            nr_bits_left -= tmp_nr_bits;
  476|  10.9k|        }
  477|       |
  478|       |        /* Corrigendum */
  479|  2.02k|        if (nr_bits_left > 0)
  ------------------
  |  Branch (479:13): [True: 1.71k, False: 307]
  ------------------
  480|  1.71k|        {
  481|  1.71k|            faad_getbits(ld, nr_bits_left
  482|  1.71k|                DEBUGVAR(1,280,"sbr_single_channel_element(): nr_bits_left"));
  483|  1.71k|        }
  484|  2.02k|    }
  485|       |
  486|  5.45k|    return 0;
  487|  10.0k|}
sbr_syntax.c:sbr_grid:
  660|  27.6k|{
  661|  27.6k|    uint8_t i, j, env, rel, result;
  662|  27.6k|    uint8_t bs_abs_bord, bs_abs_bord_1;
  663|  27.6k|    uint8_t bs_num_env = 0;
  664|  27.6k|    uint8_t saved_L_E = sbr->L_E[ch];
  665|  27.6k|    uint8_t saved_L_Q = sbr->L_Q[ch];
  666|  27.6k|    uint8_t saved_frame_class = sbr->bs_frame_class[ch];
  667|       |
  668|  27.6k|    sbr->bs_frame_class[ch] = (uint8_t)faad_getbits(ld, 2
  669|  27.6k|        DEBUGVAR(1,248,"sbr_grid(): bs_frame_class"));
  670|       |
  671|  27.6k|    switch (sbr->bs_frame_class[ch])
  ------------------
  |  Branch (671:13): [True: 27.6k, False: 0]
  ------------------
  672|  27.6k|    {
  673|  9.00k|    case FIXFIX:
  ------------------
  |  |   46|  9.00k|#define FIXFIX 0
  ------------------
  |  Branch (673:5): [True: 9.00k, False: 18.6k]
  ------------------
  674|  9.00k|        i = (uint8_t)faad_getbits(ld, 2
  675|  9.00k|            DEBUGVAR(1,249,"sbr_grid(): bs_num_env_raw"));
  676|       |
  677|  9.00k|        bs_num_env = min(1u << i, 5u);
  ------------------
  |  |   60|  9.00k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 8.10k, False: 901]
  |  |  ------------------
  ------------------
  678|       |
  679|  9.00k|        i = (uint8_t)faad_get1bit(ld
  680|  9.00k|            DEBUGVAR(1,250,"sbr_grid(): bs_freq_res_flag"));
  681|  26.4k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (681:23): [True: 17.4k, False: 9.00k]
  ------------------
  682|  17.4k|            sbr->f[ch][env] = i;
  683|       |
  684|  9.00k|        sbr->abs_bord_lead[ch] = 0;
  685|  9.00k|        sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
  686|  9.00k|        sbr->n_rel_lead[ch] = bs_num_env - 1;
  687|  9.00k|        sbr->n_rel_trail[ch] = 0;
  688|  9.00k|        break;
  689|       |
  690|  6.34k|    case FIXVAR:
  ------------------
  |  |   47|  6.34k|#define FIXVAR 1
  ------------------
  |  Branch (690:5): [True: 6.34k, False: 21.2k]
  ------------------
  691|  6.34k|        bs_abs_bord = (uint8_t)faad_getbits(ld, 2
  692|  6.34k|            DEBUGVAR(1,251,"sbr_grid(): bs_abs_bord")) + sbr->numTimeSlots;
  693|  6.34k|        bs_num_env = (uint8_t)faad_getbits(ld, 2
  694|  6.34k|            DEBUGVAR(1,252,"sbr_grid(): bs_num_env")) + 1;
  695|       |
  696|  14.0k|        for (rel = 0; rel < bs_num_env-1; rel++)
  ------------------
  |  Branch (696:23): [True: 7.70k, False: 6.34k]
  ------------------
  697|  7.70k|        {
  698|  7.70k|            sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  699|  7.70k|                DEBUGVAR(1,253,"sbr_grid(): bs_rel_bord")) + 2;
  700|  7.70k|        }
  701|  6.34k|        j = bs_num_env;
  702|  6.34k|        i = sbr_log2(j + 1);
  703|  6.34k|        sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
  704|  6.34k|            DEBUGVAR(1,254,"sbr_grid(): bs_pointer"));
  705|  6.34k|        sbr->bs_pointer[ch] = min(sbr->bs_pointer[ch], j);
  ------------------
  |  |   60|  6.34k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.95k, False: 1.39k]
  |  |  ------------------
  ------------------
  706|       |
  707|  20.3k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (707:23): [True: 14.0k, False: 6.34k]
  ------------------
  708|  14.0k|        {
  709|  14.0k|            sbr->f[ch][bs_num_env - env - 1] = (uint8_t)faad_get1bit(ld
  710|  14.0k|                DEBUGVAR(1,255,"sbr_grid(): bs_freq_res"));
  711|  14.0k|        }
  712|       |
  713|  6.34k|        sbr->abs_bord_lead[ch] = 0;
  714|  6.34k|        sbr->abs_bord_trail[ch] = bs_abs_bord;
  715|  6.34k|        sbr->n_rel_lead[ch] = 0;
  716|  6.34k|        sbr->n_rel_trail[ch] = bs_num_env - 1;
  717|  6.34k|        break;
  718|       |
  719|  6.10k|    case VARFIX:
  ------------------
  |  |   48|  6.10k|#define VARFIX 2
  ------------------
  |  Branch (719:5): [True: 6.10k, False: 21.5k]
  ------------------
  720|  6.10k|        bs_abs_bord = (uint8_t)faad_getbits(ld, 2
  721|  6.10k|            DEBUGVAR(1,256,"sbr_grid(): bs_abs_bord"));
  722|  6.10k|        bs_num_env = (uint8_t)faad_getbits(ld, 2
  723|  6.10k|            DEBUGVAR(1,257,"sbr_grid(): bs_num_env")) + 1;
  724|       |
  725|  14.5k|        for (rel = 0; rel < bs_num_env-1; rel++)
  ------------------
  |  Branch (725:23): [True: 8.41k, False: 6.10k]
  ------------------
  726|  8.41k|        {
  727|  8.41k|            sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  728|  8.41k|                DEBUGVAR(1,258,"sbr_grid(): bs_rel_bord")) + 2;
  729|  8.41k|        }
  730|  6.10k|        j = bs_num_env;
  731|  6.10k|        i = sbr_log2(j + 1);
  732|  6.10k|        sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
  733|  6.10k|            DEBUGVAR(1,259,"sbr_grid(): bs_pointer"));
  734|  6.10k|        sbr->bs_pointer[ch] = min(sbr->bs_pointer[ch], j);
  ------------------
  |  |   60|  6.10k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.51k, False: 1.59k]
  |  |  ------------------
  ------------------
  735|       |
  736|  20.6k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (736:23): [True: 14.5k, False: 6.10k]
  ------------------
  737|  14.5k|        {
  738|  14.5k|            sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
  739|  14.5k|                DEBUGVAR(1,260,"sbr_grid(): bs_freq_res"));
  740|  14.5k|        }
  741|       |
  742|  6.10k|        sbr->abs_bord_lead[ch] = bs_abs_bord;
  743|  6.10k|        sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
  744|  6.10k|        sbr->n_rel_lead[ch] = bs_num_env - 1;
  745|  6.10k|        sbr->n_rel_trail[ch] = 0;
  746|  6.10k|        break;
  747|       |
  748|  6.18k|    case VARVAR:
  ------------------
  |  |   49|  6.18k|#define VARVAR 3
  ------------------
  |  Branch (748:5): [True: 6.18k, False: 21.4k]
  ------------------
  749|  6.18k|        bs_abs_bord = (uint8_t)faad_getbits(ld, 2
  750|  6.18k|            DEBUGVAR(1,261,"sbr_grid(): bs_abs_bord_0"));
  751|  6.18k|        bs_abs_bord_1 = (uint8_t)faad_getbits(ld, 2
  752|  6.18k|            DEBUGVAR(1,262,"sbr_grid(): bs_abs_bord_1")) + sbr->numTimeSlots;
  753|  6.18k|        sbr->bs_num_rel_0[ch] = (uint8_t)faad_getbits(ld, 2
  754|  6.18k|            DEBUGVAR(1,263,"sbr_grid(): bs_num_rel_0"));
  755|  6.18k|        sbr->bs_num_rel_1[ch] = (uint8_t)faad_getbits(ld, 2
  756|  6.18k|            DEBUGVAR(1,264,"sbr_grid(): bs_num_rel_1"));
  757|       |
  758|  6.18k|        bs_num_env = min(5, sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1);
  ------------------
  |  |   60|  6.18k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 963, False: 5.21k]
  |  |  ------------------
  ------------------
  759|       |
  760|  13.6k|        for (rel = 0; rel < sbr->bs_num_rel_0[ch]; rel++)
  ------------------
  |  Branch (760:23): [True: 7.43k, False: 6.18k]
  ------------------
  761|  7.43k|        {
  762|  7.43k|            sbr->bs_rel_bord_0[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  763|  7.43k|                DEBUGVAR(1,265,"sbr_grid(): bs_rel_bord")) + 2;
  764|  7.43k|        }
  765|  15.7k|        for(rel = 0; rel < sbr->bs_num_rel_1[ch]; rel++)
  ------------------
  |  Branch (765:22): [True: 9.53k, False: 6.18k]
  ------------------
  766|  9.53k|        {
  767|  9.53k|            sbr->bs_rel_bord_1[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  768|  9.53k|                DEBUGVAR(1,266,"sbr_grid(): bs_rel_bord")) + 2;
  769|  9.53k|        }
  770|  6.18k|        j = sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1;
  771|  6.18k|        i = sbr_log2(j + 1);
  772|  6.18k|        sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
  773|  6.18k|            DEBUGVAR(1,267,"sbr_grid(): bs_pointer"));
  774|  6.18k|        sbr->bs_pointer[ch] = min(sbr->bs_pointer[ch], j);
  ------------------
  |  |   60|  6.18k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.16k, False: 2.01k]
  |  |  ------------------
  ------------------
  775|       |
  776|  27.8k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (776:23): [True: 21.7k, False: 6.18k]
  ------------------
  777|  21.7k|        {
  778|  21.7k|            sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
  779|  21.7k|                DEBUGVAR(1,268,"sbr_grid(): bs_freq_res"));
  780|  21.7k|        }
  781|       |
  782|  6.18k|        sbr->abs_bord_lead[ch] = bs_abs_bord;
  783|  6.18k|        sbr->abs_bord_trail[ch] = bs_abs_bord_1;
  784|  6.18k|        sbr->n_rel_lead[ch] = sbr->bs_num_rel_0[ch];
  785|  6.18k|        sbr->n_rel_trail[ch] = sbr->bs_num_rel_1[ch];
  786|  6.18k|        break;
  787|  27.6k|    }
  788|       |
  789|  27.6k|    if (sbr->bs_frame_class[ch] == VARVAR)
  ------------------
  |  |   49|  27.6k|#define VARVAR 3
  ------------------
  |  Branch (789:9): [True: 6.18k, False: 21.4k]
  ------------------
  790|  6.18k|        sbr->L_E[ch] = min(bs_num_env, 5);
  ------------------
  |  |   60|  6.18k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.30k, False: 1.87k]
  |  |  ------------------
  ------------------
  791|  21.4k|    else
  792|  21.4k|        sbr->L_E[ch] = min(bs_num_env, 4);
  ------------------
  |  |   60|  21.4k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 16.0k, False: 5.39k]
  |  |  ------------------
  ------------------
  793|       |
  794|  27.6k|    if (sbr->L_E[ch] <= 0)
  ------------------
  |  Branch (794:9): [True: 0, False: 27.6k]
  ------------------
  795|      0|        return 1;
  796|       |
  797|  27.6k|    if (sbr->L_E[ch] > 1)
  ------------------
  |  Branch (797:9): [True: 16.8k, False: 10.7k]
  ------------------
  798|  16.8k|        sbr->L_Q[ch] = 2;
  799|  10.7k|    else
  800|  10.7k|        sbr->L_Q[ch] = 1;
  801|       |
  802|       |    /* TODO: this code can probably be integrated into the code above! */
  803|  27.6k|    if ((result = envelope_time_border_vector(sbr, ch)) > 0)
  ------------------
  |  Branch (803:9): [True: 999, False: 26.6k]
  ------------------
  804|    999|    {
  805|    999|        sbr->bs_frame_class[ch] = saved_frame_class;
  806|    999|        sbr->L_E[ch] = saved_L_E;
  807|    999|        sbr->L_Q[ch] = saved_L_Q;
  808|    999|        return result;
  809|    999|    }
  810|  26.6k|    noise_floor_time_border_vector(sbr, ch);
  811|       |
  812|       |#if 0
  813|       |    for (env = 0; env < bs_num_env; env++)
  814|       |    {
  815|       |        printf("freq_res[ch:%d][env:%d]: %d\n", ch, env, sbr->f[ch][env]);
  816|       |    }
  817|       |#endif
  818|       |
  819|  26.6k|    return 0;
  820|  27.6k|}
sbr_syntax.c:sbr_log2:
  649|  18.6k|{
  650|  18.6k|    uint8_t log2tab[] = { 0, 0, 1, 2, 2, 3, 3, 3, 3, 4 };
  651|  18.6k|    if (val < 10 && val >= 0)
  ------------------
  |  Branch (651:9): [True: 18.6k, False: 0]
  |  Branch (651:21): [True: 18.6k, False: 0]
  ------------------
  652|  18.6k|        return log2tab[val];
  653|      0|    else
  654|      0|        return 0;
  655|  18.6k|}
sbr_syntax.c:sbr_dtdf:
  824|  30.3k|{
  825|  30.3k|    uint8_t i;
  826|       |
  827|   103k|    for (i = 0; i < sbr->L_E[ch]; i++)
  ------------------
  |  Branch (827:17): [True: 73.0k, False: 30.3k]
  ------------------
  828|  73.0k|    {
  829|  73.0k|        sbr->bs_df_env[ch][i] = faad_get1bit(ld
  830|  73.0k|            DEBUGVAR(1,269,"sbr_dtdf(): bs_df_env"));
  831|  73.0k|    }
  832|       |
  833|  78.9k|    for (i = 0; i < sbr->L_Q[ch]; i++)
  ------------------
  |  Branch (833:17): [True: 48.6k, False: 30.3k]
  ------------------
  834|  48.6k|    {
  835|  48.6k|        sbr->bs_df_noise[ch][i] = faad_get1bit(ld
  836|  48.6k|            DEBUGVAR(1,270,"sbr_dtdf(): bs_df_noise"));
  837|  48.6k|    }
  838|  30.3k|}
sbr_syntax.c:invf_mode:
  842|  26.1k|{
  843|  26.1k|    uint8_t n;
  844|       |
  845|  73.2k|    for (n = 0; n < sbr->N_Q; n++)
  ------------------
  |  Branch (845:17): [True: 47.1k, False: 26.1k]
  ------------------
  846|  47.1k|    {
  847|  47.1k|        sbr->bs_invf_mode[ch][n] = (uint8_t)faad_getbits(ld, 2
  848|  47.1k|            DEBUGVAR(1,271,"invf_mode(): bs_invf_mode"));
  849|  47.1k|    }
  850|  26.1k|}
sbr_syntax.c:sinusoidal_coding:
  910|  11.1k|{
  911|  11.1k|    uint8_t n;
  912|       |
  913|   160k|    for (n = 0; n < sbr->N_high; n++)
  ------------------
  |  Branch (913:17): [True: 148k, False: 11.1k]
  ------------------
  914|   148k|    {
  915|   148k|        sbr->bs_add_harmonic[ch][n] = faad_get1bit(ld
  916|   148k|            DEBUGVAR(1,278,"sinusoidal_coding(): bs_add_harmonic"));
  917|   148k|    }
  918|  11.1k|}
sbr_syntax.c:sbr_extension:
  854|   695k|{
  855|   695k|#ifdef PS_DEC
  856|   695k|    uint8_t header;
  857|   695k|    uint16_t ret;
  858|   695k|#endif
  859|   695k|    (void)num_bits_left;  /* TODO: remove or actually use parameter. */
  860|       |
  861|   695k|    switch (bs_extension_id)
  862|   695k|    {
  863|      0|#ifdef PS_DEC
  864|  30.4k|    case EXTENSION_ID_PS:
  ------------------
  |  |   40|  30.4k|#define EXTENSION_ID_PS 2
  ------------------
  |  Branch (864:5): [True: 30.4k, False: 664k]
  ------------------
  865|  30.4k|        if (!sbr->ps)
  ------------------
  |  Branch (865:13): [True: 7.54k, False: 22.9k]
  ------------------
  866|  7.54k|        {
  867|  7.54k|            sbr->ps = ps_init(get_sr_index(sbr->sample_rate), sbr->numTimeSlotsRate);
  868|  7.54k|        }
  869|  30.4k|        if (sbr->psResetFlag)
  ------------------
  |  Branch (869:13): [True: 9.04k, False: 21.4k]
  ------------------
  870|  9.04k|        {
  871|  9.04k|            sbr->ps->header_read = 0;
  872|  9.04k|        }
  873|  30.4k|        ret = ps_data(sbr->ps, ld, &header);
  874|       |
  875|       |        /* enable PS if and only if: a header has been decoded */
  876|  30.4k|        if (sbr->ps_used == 0 && header == 1)
  ------------------
  |  Branch (876:13): [True: 15.4k, False: 15.0k]
  |  Branch (876:34): [True: 6.53k, False: 8.88k]
  ------------------
  877|  6.53k|        {
  878|  6.53k|            sbr->ps_used = 1;
  879|  6.53k|        }
  880|       |
  881|  30.4k|        if (header == 1)
  ------------------
  |  Branch (881:13): [True: 12.5k, False: 17.9k]
  ------------------
  882|  12.5k|        {
  883|  12.5k|            sbr->psResetFlag = 0;
  884|  12.5k|        }
  885|       |
  886|  30.4k|        return ret;
  887|      0|#endif
  888|      0|#ifdef DRM_PS
  889|   598k|    case DRM_PARAMETRIC_STEREO:
  ------------------
  |  |   40|   598k|#define DRM_PARAMETRIC_STEREO    0
  ------------------
  |  Branch (889:5): [True: 598k, False: 96.7k]
  ------------------
  890|       |        /* If not expected then only decode but do not expose. */
  891|   598k|        if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (891:13): [True: 2.16k, False: 596k]
  ------------------
  892|  2.16k|        {
  893|  2.16k|            sbr->ps_used = 1;
  894|  2.16k|        }
  895|   598k|        if (!sbr->drm_ps)
  ------------------
  |  Branch (895:13): [True: 4.74k, False: 593k]
  ------------------
  896|  4.74k|        {
  897|  4.74k|            sbr->drm_ps = drm_ps_init();
  898|  4.74k|        }
  899|   598k|        return drm_ps_data(sbr->drm_ps, ld);
  900|      0|#endif
  901|  66.3k|    default:
  ------------------
  |  Branch (901:5): [True: 66.3k, False: 629k]
  ------------------
  902|  66.3k|        sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
  903|  66.3k|            DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
  904|  66.3k|        return 6;
  905|   695k|    }
  906|   695k|}
sbr_syntax.c:sbr_channel_pair_element:
  491|  10.7k|{
  492|  10.7k|    uint8_t n, result;
  493|       |
  494|  10.7k|    if (faad_get1bit(ld
  ------------------
  |  Branch (494:9): [True: 4.21k, False: 6.57k]
  ------------------
  495|  10.7k|        DEBUGVAR(1,228,"sbr_single_channel_element(): bs_data_extra")))
  496|  4.21k|    {
  497|  4.21k|        faad_getbits(ld, 4
  498|  4.21k|            DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
  499|  4.21k|        faad_getbits(ld, 4
  500|  4.21k|            DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
  501|  4.21k|    }
  502|       |
  503|  10.7k|    sbr->bs_coupling = faad_get1bit(ld
  504|  10.7k|        DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_coupling"));
  505|       |
  506|  10.7k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (506:9): [True: 4.25k, False: 6.53k]
  ------------------
  507|  4.25k|    {
  508|  4.25k|        if ((result = sbr_grid(ld, sbr, 0)) > 0)
  ------------------
  |  Branch (508:13): [True: 51, False: 4.20k]
  ------------------
  509|     51|            return result;
  510|       |
  511|       |        /* need to copy some data from left to right */
  512|  4.20k|        sbr->bs_frame_class[1] = sbr->bs_frame_class[0];
  513|  4.20k|        sbr->L_E[1] = sbr->L_E[0];
  514|  4.20k|        sbr->L_Q[1] = sbr->L_Q[0];
  515|  4.20k|        sbr->bs_pointer[1] = sbr->bs_pointer[0];
  516|       |
  517|  20.0k|        for (n = 0; n <= sbr->L_E[0]; n++)
  ------------------
  |  Branch (517:21): [True: 15.8k, False: 4.20k]
  ------------------
  518|  15.8k|        {
  519|  15.8k|            sbr->t_E[1][n] = sbr->t_E[0][n];
  520|  15.8k|            sbr->f[1][n] = sbr->f[0][n];
  521|  15.8k|        }
  522|  15.3k|        for (n = 0; n <= sbr->L_Q[0]; n++)
  ------------------
  |  Branch (522:21): [True: 11.1k, False: 4.20k]
  ------------------
  523|  11.1k|            sbr->t_Q[1][n] = sbr->t_Q[0][n];
  524|       |
  525|  4.20k|        sbr_dtdf(ld, sbr, 0);
  526|  4.20k|        sbr_dtdf(ld, sbr, 1);
  527|  4.20k|        invf_mode(ld, sbr, 0);
  528|       |
  529|       |        /* more copying */
  530|  15.6k|        for (n = 0; n < sbr->N_Q; n++)
  ------------------
  |  Branch (530:21): [True: 11.4k, False: 4.20k]
  ------------------
  531|  11.4k|            sbr->bs_invf_mode[1][n] = sbr->bs_invf_mode[0][n];
  532|       |
  533|  4.20k|        sbr_envelope(ld, sbr, 0);
  534|  4.20k|        sbr_noise(ld, sbr, 0);
  535|  4.20k|        sbr_envelope(ld, sbr, 1);
  536|  4.20k|        sbr_noise(ld, sbr, 1);
  537|       |
  538|  4.20k|        memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
  539|  4.20k|        memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
  540|       |
  541|  4.20k|        sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
  542|  4.20k|            DEBUGVAR(1,231,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
  543|  4.20k|        if (sbr->bs_add_harmonic_flag[0])
  ------------------
  |  Branch (543:13): [True: 1.45k, False: 2.74k]
  ------------------
  544|  1.45k|            sinusoidal_coding(ld, sbr, 0);
  545|       |
  546|  4.20k|        sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
  547|  4.20k|            DEBUGVAR(1,232,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
  548|  4.20k|        if (sbr->bs_add_harmonic_flag[1])
  ------------------
  |  Branch (548:13): [True: 1.53k, False: 2.66k]
  ------------------
  549|  1.53k|            sinusoidal_coding(ld, sbr, 1);
  550|  6.53k|    } else {
  551|  6.53k|        uint8_t saved_t_E[6] = {0}, saved_t_Q[3] = {0};
  552|  6.53k|        uint8_t saved_L_E = sbr->L_E[0];
  553|  6.53k|        uint8_t saved_L_Q = sbr->L_Q[0];
  554|  6.53k|        uint8_t saved_frame_class = sbr->bs_frame_class[0];
  555|       |
  556|  9.96k|        for (n = 0; n < saved_L_E; n++)
  ------------------
  |  Branch (556:21): [True: 3.43k, False: 6.53k]
  ------------------
  557|  3.43k|            saved_t_E[n] = sbr->t_E[0][n];
  558|  8.43k|        for (n = 0; n < saved_L_Q; n++)
  ------------------
  |  Branch (558:21): [True: 1.90k, False: 6.53k]
  ------------------
  559|  1.90k|            saved_t_Q[n] = sbr->t_Q[0][n];
  560|       |
  561|  6.53k|        if ((result = sbr_grid(ld, sbr, 0)) > 0)
  ------------------
  |  Branch (561:13): [True: 109, False: 6.42k]
  ------------------
  562|    109|            return result;
  563|  6.42k|        if ((result = sbr_grid(ld, sbr, 1)) > 0)
  ------------------
  |  Branch (563:13): [True: 493, False: 5.93k]
  ------------------
  564|    493|        {
  565|       |            /* restore first channel data as well */
  566|    493|            sbr->bs_frame_class[0] = saved_frame_class;
  567|    493|            sbr->L_E[0] = saved_L_E;
  568|    493|            sbr->L_Q[0] = saved_L_Q;
  569|  3.45k|            for (n = 0; n < 6; n++)
  ------------------
  |  Branch (569:25): [True: 2.95k, False: 493]
  ------------------
  570|  2.95k|                sbr->t_E[0][n] = saved_t_E[n];
  571|  1.97k|            for (n = 0; n < 3; n++)
  ------------------
  |  Branch (571:25): [True: 1.47k, False: 493]
  ------------------
  572|  1.47k|                sbr->t_Q[0][n] = saved_t_Q[n];
  573|       |
  574|    493|            return result;
  575|    493|        }
  576|  5.93k|        sbr_dtdf(ld, sbr, 0);
  577|  5.93k|        sbr_dtdf(ld, sbr, 1);
  578|  5.93k|        invf_mode(ld, sbr, 0);
  579|  5.93k|        invf_mode(ld, sbr, 1);
  580|  5.93k|        sbr_envelope(ld, sbr, 0);
  581|  5.93k|        sbr_envelope(ld, sbr, 1);
  582|  5.93k|        sbr_noise(ld, sbr, 0);
  583|  5.93k|        sbr_noise(ld, sbr, 1);
  584|       |
  585|  5.93k|        memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
  586|  5.93k|        memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
  587|       |
  588|  5.93k|        sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
  589|  5.93k|            DEBUGVAR(1,239,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
  590|  5.93k|        if (sbr->bs_add_harmonic_flag[0])
  ------------------
  |  Branch (590:13): [True: 2.12k, False: 3.80k]
  ------------------
  591|  2.12k|            sinusoidal_coding(ld, sbr, 0);
  592|       |
  593|  5.93k|        sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
  594|  5.93k|            DEBUGVAR(1,240,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
  595|  5.93k|        if (sbr->bs_add_harmonic_flag[1])
  ------------------
  |  Branch (595:13): [True: 1.99k, False: 3.93k]
  ------------------
  596|  1.99k|            sinusoidal_coding(ld, sbr, 1);
  597|  5.93k|    }
  598|  10.1k|#ifndef FIXED_POINT
  599|  10.1k|    envelope_noise_dequantisation(sbr, 0);
  600|  10.1k|    envelope_noise_dequantisation(sbr, 1);
  601|       |
  602|  10.1k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (602:9): [True: 4.20k, False: 5.93k]
  ------------------
  603|  4.20k|        unmap_envelope_noise(sbr);
  604|  10.1k|#endif
  605|       |
  606|  10.1k|    sbr->bs_extended_data = faad_get1bit(ld
  607|  10.1k|        DEBUGVAR(1,233,"sbr_channel_pair_element(): bs_extended_data[0]"));
  608|  10.1k|    if (sbr->bs_extended_data)
  ------------------
  |  Branch (608:9): [True: 4.92k, False: 5.20k]
  ------------------
  609|  4.92k|    {
  610|  4.92k|        uint16_t nr_bits_left;
  611|  4.92k|        uint16_t cnt = (uint16_t)faad_getbits(ld, 4
  612|  4.92k|            DEBUGVAR(1,234,"sbr_channel_pair_element(): bs_extension_size"));
  613|  4.92k|        if (cnt == 15)
  ------------------
  |  Branch (613:13): [True: 2.69k, False: 2.22k]
  ------------------
  614|  2.69k|        {
  615|  2.69k|            cnt += (uint16_t)faad_getbits(ld, 8
  616|  2.69k|                DEBUGVAR(1,235,"sbr_channel_pair_element(): bs_esc_count"));
  617|  2.69k|        }
  618|       |
  619|  4.92k|        nr_bits_left = 8 * cnt;
  620|   685k|        while (nr_bits_left > 7)
  ------------------
  |  Branch (620:16): [True: 682k, False: 3.13k]
  ------------------
  621|   682k|        {
  622|   682k|            uint16_t tmp_nr_bits = 0;
  623|       |
  624|   682k|            sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
  625|   682k|                DEBUGVAR(1,236,"sbr_channel_pair_element(): bs_extension_id"));
  626|   682k|            tmp_nr_bits += 2;
  627|   682k|            tmp_nr_bits += sbr_extension(ld, sbr, sbr->bs_extension_id, nr_bits_left);
  628|       |
  629|       |            /* check if the data read is bigger than the number of available bits */
  630|   682k|            if (tmp_nr_bits > nr_bits_left)
  ------------------
  |  Branch (630:17): [True: 1.79k, False: 680k]
  ------------------
  631|  1.79k|                return 1;
  632|       |
  633|   680k|            nr_bits_left -= tmp_nr_bits;
  634|   680k|        }
  635|       |
  636|       |        /* Corrigendum */
  637|  3.13k|        if (nr_bits_left > 0)
  ------------------
  |  Branch (637:13): [True: 2.36k, False: 770]
  ------------------
  638|  2.36k|        {
  639|  2.36k|            faad_getbits(ld, nr_bits_left
  640|  2.36k|                DEBUGVAR(1,280,"sbr_channel_pair_element(): nr_bits_left"));
  641|  2.36k|        }
  642|  3.13k|    }
  643|       |
  644|  8.34k|    return 0;
  645|  10.1k|}

envelope_time_border_vector:
   55|  27.6k|{
   56|  27.6k|    uint8_t l, border, temp, trail;
   57|  27.6k|    uint8_t t_E_temp[6] = {0};
   58|       |
   59|  27.6k|    trail = sbr->abs_bord_trail[ch];
   60|  27.6k|    t_E_temp[0] = sbr->rate * sbr->abs_bord_lead[ch];
   61|  27.6k|    t_E_temp[sbr->L_E[ch]] = sbr->rate * trail;
   62|       |
   63|  27.6k|    switch (sbr->bs_frame_class[ch])
  ------------------
  |  Branch (63:13): [True: 27.6k, False: 0]
  ------------------
   64|  27.6k|    {
   65|  9.00k|    case FIXFIX:
  ------------------
  |  |   46|  9.00k|#define FIXFIX 0
  ------------------
  |  Branch (65:5): [True: 9.00k, False: 18.6k]
  ------------------
   66|  9.00k|        switch (sbr->L_E[ch])
   67|  9.00k|        {
   68|  2.01k|        case 4:
  ------------------
  |  Branch (68:9): [True: 2.01k, False: 6.98k]
  ------------------
   69|  2.01k|            temp = (sbr->numTimeSlots / 4);
   70|  2.01k|            t_E_temp[3] = sbr->rate * 3 * temp;
   71|  2.01k|            t_E_temp[2] = sbr->rate * 2 * temp;
   72|  2.01k|            t_E_temp[1] = sbr->rate * temp;
   73|  2.01k|            break;
   74|  1.47k|        case 2:
  ------------------
  |  Branch (74:9): [True: 1.47k, False: 7.52k]
  ------------------
   75|  1.47k|            t_E_temp[1] = sbr->rate * (sbr->numTimeSlots / 2);
   76|  1.47k|            break;
   77|  5.50k|        default:
  ------------------
  |  Branch (77:9): [True: 5.50k, False: 3.49k]
  ------------------
   78|  5.50k|            break;
   79|  9.00k|        }
   80|  9.00k|        break;
   81|       |
   82|  9.00k|    case FIXVAR:
  ------------------
  |  |   47|  6.34k|#define FIXVAR 1
  ------------------
  |  Branch (82:5): [True: 6.34k, False: 21.2k]
  ------------------
   83|  6.34k|        if (sbr->L_E[ch] > 1)
  ------------------
  |  Branch (83:13): [True: 3.44k, False: 2.89k]
  ------------------
   84|  3.44k|        {
   85|  3.44k|            int8_t i = sbr->L_E[ch];
   86|  3.44k|            border = sbr->abs_bord_trail[ch];
   87|       |
   88|  10.9k|            for (l = 0; l < (sbr->L_E[ch] - 1); l++)
  ------------------
  |  Branch (88:25): [True: 7.70k, False: 3.29k]
  ------------------
   89|  7.70k|            {
   90|  7.70k|                if (border < sbr->bs_rel_bord[ch][l])
  ------------------
  |  Branch (90:21): [True: 154, False: 7.55k]
  ------------------
   91|    154|                    return 1;
   92|       |
   93|  7.55k|                border -= sbr->bs_rel_bord[ch][l];
   94|  7.55k|                t_E_temp[--i] = sbr->rate * border;
   95|  7.55k|            }
   96|  3.44k|        }
   97|  6.18k|        break;
   98|       |
   99|  6.18k|    case VARFIX:
  ------------------
  |  |   48|  6.10k|#define VARFIX 2
  ------------------
  |  Branch (99:5): [True: 6.10k, False: 21.5k]
  ------------------
  100|  6.10k|        if (sbr->L_E[ch] > 1)
  ------------------
  |  Branch (100:13): [True: 4.59k, False: 1.50k]
  ------------------
  101|  4.59k|        {
  102|  4.59k|            int8_t i = 1;
  103|  4.59k|            border = sbr->abs_bord_lead[ch];
  104|       |
  105|  12.7k|            for (l = 0; l < (sbr->L_E[ch] - 1); l++)
  ------------------
  |  Branch (105:25): [True: 8.39k, False: 4.32k]
  ------------------
  106|  8.39k|            {
  107|  8.39k|                border += sbr->bs_rel_bord[ch][l];
  108|       |
  109|  8.39k|                if (border > trail)
  ------------------
  |  Branch (109:21): [True: 267, False: 8.13k]
  ------------------
  110|    267|                    return 1;
  111|       |
  112|  8.13k|                t_E_temp[i++] = sbr->rate * border;
  113|  8.13k|            }
  114|  4.59k|        }
  115|  5.83k|        break;
  116|       |
  117|  6.18k|    case VARVAR:
  ------------------
  |  |   49|  6.18k|#define VARVAR 3
  ------------------
  |  Branch (117:5): [True: 6.18k, False: 21.4k]
  ------------------
  118|  6.18k|        if (sbr->bs_num_rel_0[ch])
  ------------------
  |  Branch (118:13): [True: 3.05k, False: 3.12k]
  ------------------
  119|  3.05k|        {
  120|  3.05k|            int8_t i = 1;
  121|  3.05k|            border = sbr->abs_bord_lead[ch];
  122|       |
  123|  10.1k|            for (l = 0; l < sbr->bs_num_rel_0[ch]; l++)
  ------------------
  |  Branch (123:25): [True: 7.39k, False: 2.71k]
  ------------------
  124|  7.39k|            {
  125|  7.39k|                border += sbr->bs_rel_bord_0[ch][l];
  126|       |
  127|  7.39k|                if (border > trail)
  ------------------
  |  Branch (127:21): [True: 335, False: 7.05k]
  ------------------
  128|    335|                    return 1;
  129|       |
  130|  7.05k|                t_E_temp[i++] = sbr->rate * border;
  131|  7.05k|            }
  132|  3.05k|        }
  133|       |
  134|  5.84k|        if (sbr->bs_num_rel_1[ch])
  ------------------
  |  Branch (134:13): [True: 4.12k, False: 1.72k]
  ------------------
  135|  4.12k|        {
  136|  4.12k|            int8_t i = sbr->L_E[ch];
  137|  4.12k|            border = sbr->abs_bord_trail[ch];
  138|       |
  139|  12.9k|            for (l = 0; l < sbr->bs_num_rel_1[ch]; l++)
  ------------------
  |  Branch (139:25): [True: 9.09k, False: 3.88k]
  ------------------
  140|  9.09k|            {
  141|  9.09k|                if (border < sbr->bs_rel_bord_1[ch][l])
  ------------------
  |  Branch (141:21): [True: 243, False: 8.84k]
  ------------------
  142|    243|                    return 1;
  143|       |
  144|  8.84k|                border -= sbr->bs_rel_bord_1[ch][l];
  145|  8.84k|                t_E_temp[--i] = sbr->rate * border;
  146|  8.84k|            }
  147|  4.12k|        }
  148|  5.60k|        break;
  149|  27.6k|    }
  150|       |
  151|       |    /* no error occured, we can safely use this t_E vector */
  152|   186k|    for (l = 0; l < 6; l++)
  ------------------
  |  Branch (152:17): [True: 159k, False: 26.6k]
  ------------------
  153|   159k|    {
  154|   159k|        sbr->t_E[ch][l] = t_E_temp[l];
  155|   159k|    }
  156|       |
  157|  26.6k|    return 0;
  158|  27.6k|}
noise_floor_time_border_vector:
  161|  26.6k|{
  162|  26.6k|    sbr->t_Q[ch][0] = sbr->t_E[ch][0];
  163|       |
  164|  26.6k|    if (sbr->L_E[ch] == 1)
  ------------------
  |  Branch (164:9): [True: 10.7k, False: 15.8k]
  ------------------
  165|  10.7k|    {
  166|  10.7k|        sbr->t_Q[ch][1] = sbr->t_E[ch][1];
  167|  10.7k|        sbr->t_Q[ch][2] = 0;
  168|  15.8k|    } else {
  169|  15.8k|        uint8_t index = middleBorder(sbr, ch);
  170|  15.8k|        sbr->t_Q[ch][1] = sbr->t_E[ch][index];
  171|  15.8k|        sbr->t_Q[ch][2] = sbr->t_E[ch][sbr->L_E[ch]];
  172|  15.8k|    }
  173|  26.6k|}
sbr_tf_grid.c:middleBorder:
  233|  15.8k|{
  234|  15.8k|    int8_t retval = 0;
  235|       |
  236|  15.8k|    switch (sbr->bs_frame_class[ch])
  ------------------
  |  Branch (236:13): [True: 15.8k, False: 0]
  ------------------
  237|  15.8k|    {
  238|  3.49k|    case FIXFIX:
  ------------------
  |  |   46|  3.49k|#define FIXFIX 0
  ------------------
  |  Branch (238:5): [True: 3.49k, False: 12.3k]
  ------------------
  239|  3.49k|        retval = sbr->L_E[ch]/2;
  240|  3.49k|        break;
  241|  4.32k|    case VARFIX:
  ------------------
  |  |   48|  4.32k|#define VARFIX 2
  ------------------
  |  Branch (241:5): [True: 4.32k, False: 11.5k]
  ------------------
  242|  4.32k|        if (sbr->bs_pointer[ch] == 0)
  ------------------
  |  Branch (242:13): [True: 1.89k, False: 2.43k]
  ------------------
  243|  1.89k|            retval = 1;
  244|  2.43k|        else if (sbr->bs_pointer[ch] == 1)
  ------------------
  |  Branch (244:18): [True: 1.02k, False: 1.41k]
  ------------------
  245|  1.02k|            retval = sbr->L_E[ch] - 1;
  246|  1.41k|        else
  247|  1.41k|            retval = sbr->bs_pointer[ch] - 1;
  248|  4.32k|        break;
  249|  3.29k|    case FIXVAR:
  ------------------
  |  |   47|  3.29k|#define FIXVAR 1
  ------------------
  |  Branch (249:5): [True: 3.29k, False: 12.5k]
  ------------------
  250|  8.01k|    case VARVAR:
  ------------------
  |  |   49|  8.01k|#define VARVAR 3
  ------------------
  |  Branch (250:5): [True: 4.72k, False: 11.1k]
  ------------------
  251|  8.01k|        if (sbr->bs_pointer[ch] > 1)
  ------------------
  |  Branch (251:13): [True: 2.87k, False: 5.14k]
  ------------------
  252|  2.87k|            retval = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
  253|  5.14k|        else
  254|  5.14k|            retval = sbr->L_E[ch] - 1;
  255|  8.01k|        break;
  256|  15.8k|    }
  257|       |
  258|  15.8k|    return (retval > 0) ? retval : 0;
  ------------------
  |  Branch (258:12): [True: 15.6k, False: 179]
  ------------------
  259|  15.8k|}

window_grouping_info:
  303|   102k|{
  304|   102k|    uint8_t i, g;
  305|       |
  306|   102k|    uint8_t sf_index = hDecoder->sf_index;
  307|       |
  308|   102k|    if (sf_index >= 12)
  ------------------
  |  Branch (308:9): [True: 3, False: 102k]
  ------------------
  309|      3|        return 32;
  310|       |
  311|   102k|    switch (ics->window_sequence) {
  312|  80.0k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   96|  80.0k|#define ONLY_LONG_SEQUENCE   0x0
  ------------------
  |  Branch (312:5): [True: 80.0k, False: 22.2k]
  ------------------
  313|  84.4k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   97|  84.4k|#define LONG_START_SEQUENCE  0x1
  ------------------
  |  Branch (313:5): [True: 4.41k, False: 97.8k]
  ------------------
  314|  88.9k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   99|  88.9k|#define LONG_STOP_SEQUENCE   0x3
  ------------------
  |  Branch (314:5): [True: 4.50k, False: 97.8k]
  ------------------
  315|  88.9k|        ics->num_windows = 1;
  316|  88.9k|        ics->num_window_groups = 1;
  317|  88.9k|        ics->window_group_length[ics->num_window_groups-1] = 1;
  318|       |#ifdef LD_DEC
  319|       |        if (hDecoder->object_type == LD)
  320|       |        {
  321|       |            if (hDecoder->frameLength == 512)
  322|       |                ics->num_swb = num_swb_512_window[sf_index];
  323|       |            else /* if (hDecoder->frameLength == 480) */
  324|       |                ics->num_swb = num_swb_480_window[sf_index];
  325|       |        } else {
  326|       |#endif
  327|  88.9k|            if (hDecoder->frameLength == 1024)
  ------------------
  |  Branch (327:17): [True: 69.0k, False: 19.9k]
  ------------------
  328|  69.0k|                ics->num_swb = num_swb_1024_window[sf_index];
  329|  19.9k|            else /* if (hDecoder->frameLength == 960) */
  330|  19.9k|                ics->num_swb = num_swb_960_window[sf_index];
  331|       |#ifdef LD_DEC
  332|       |        }
  333|       |#endif
  334|       |
  335|  88.9k|        if (ics->max_sfb > ics->num_swb)
  ------------------
  |  Branch (335:13): [True: 72, False: 88.9k]
  ------------------
  336|     72|        {
  337|     72|            return 32;
  338|     72|        }
  339|       |
  340|       |        /* preparation of sect_sfb_offset for long blocks */
  341|       |        /* also copy the last value! */
  342|       |#ifdef LD_DEC
  343|       |        if (hDecoder->object_type == LD)
  344|       |        {
  345|       |            if (hDecoder->frameLength == 512)
  346|       |            {
  347|       |                for (i = 0; i < ics->num_swb; i++)
  348|       |                {
  349|       |                    ics->sect_sfb_offset[0][i] = swb_offset_512_window[sf_index][i];
  350|       |                    ics->swb_offset[i] = swb_offset_512_window[sf_index][i];
  351|       |                }
  352|       |            } else /* if (hDecoder->frameLength == 480) */ {
  353|       |                for (i = 0; i < ics->num_swb; i++)
  354|       |                {
  355|       |                    ics->sect_sfb_offset[0][i] = swb_offset_480_window[sf_index][i];
  356|       |                    ics->swb_offset[i] = swb_offset_480_window[sf_index][i];
  357|       |                }
  358|       |            }
  359|       |            ics->sect_sfb_offset[0][ics->num_swb] = hDecoder->frameLength;
  360|       |            ics->swb_offset[ics->num_swb] = hDecoder->frameLength;
  361|       |            ics->swb_offset_max = hDecoder->frameLength;
  362|       |        } else {
  363|       |#endif
  364|  3.91M|            for (i = 0; i < ics->num_swb; i++)
  ------------------
  |  Branch (364:25): [True: 3.82M, False: 88.9k]
  ------------------
  365|  3.82M|            {
  366|  3.82M|                ics->sect_sfb_offset[0][i] = swb_offset_1024_window[sf_index][i];
  367|  3.82M|                ics->swb_offset[i] = swb_offset_1024_window[sf_index][i];
  368|  3.82M|            }
  369|  88.9k|            ics->sect_sfb_offset[0][ics->num_swb] = hDecoder->frameLength;
  370|  88.9k|            ics->swb_offset[ics->num_swb] = hDecoder->frameLength;
  371|  88.9k|            ics->swb_offset_max = hDecoder->frameLength;
  372|       |#ifdef LD_DEC
  373|       |        }
  374|       |#endif
  375|  88.9k|        return 0;
  376|  13.3k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   98|  13.3k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (376:5): [True: 13.3k, False: 88.9k]
  ------------------
  377|  13.3k|        ics->num_windows = 8;
  378|  13.3k|        ics->num_window_groups = 1;
  379|  13.3k|        ics->window_group_length[ics->num_window_groups-1] = 1;
  380|  13.3k|        ics->num_swb = num_swb_128_window[sf_index];
  381|       |
  382|  13.3k|        if (ics->max_sfb > ics->num_swb)
  ------------------
  |  Branch (382:13): [True: 3, False: 13.3k]
  ------------------
  383|      3|        {
  384|      3|            return 32;
  385|      3|        }
  386|       |
  387|   200k|        for (i = 0; i < ics->num_swb; i++)
  ------------------
  |  Branch (387:21): [True: 186k, False: 13.3k]
  ------------------
  388|   186k|            ics->swb_offset[i] = swb_offset_128_window[sf_index][i];
  389|  13.3k|        ics->swb_offset[ics->num_swb] = hDecoder->frameLength/8;
  390|  13.3k|        ics->swb_offset_max = hDecoder->frameLength/8;
  391|       |
  392|   106k|        for (i = 0; i < ics->num_windows-1; i++) {
  ------------------
  |  Branch (392:21): [True: 93.2k, False: 13.3k]
  ------------------
  393|  93.2k|            if (bit_set(ics->scale_factor_grouping, 6-i) == 0)
  ------------------
  |  |  287|  93.2k|#define bit_set(A, B) ((A) & (1<<(B)))
  ------------------
  |  Branch (393:17): [True: 74.4k, False: 18.8k]
  ------------------
  394|  74.4k|            {
  395|  74.4k|                ics->num_window_groups += 1;
  396|  74.4k|                ics->window_group_length[ics->num_window_groups-1] = 1;
  397|  74.4k|            } else {
  398|  18.8k|                ics->window_group_length[ics->num_window_groups-1] += 1;
  399|  18.8k|            }
  400|  93.2k|        }
  401|       |
  402|       |        /* preparation of sect_sfb_offset for short blocks */
  403|   101k|        for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (403:21): [True: 87.7k, False: 13.3k]
  ------------------
  404|  87.7k|        {
  405|  87.7k|            uint16_t width;
  406|  87.7k|            uint8_t sect_sfb = 0;
  407|  87.7k|            uint16_t offset = 0;
  408|       |
  409|  1.31M|            for (i = 0; i < ics->num_swb; i++)
  ------------------
  |  Branch (409:25): [True: 1.22M, False: 87.7k]
  ------------------
  410|  1.22M|            {
  411|  1.22M|                if (i+1 == ics->num_swb)
  ------------------
  |  Branch (411:21): [True: 87.7k, False: 1.14M]
  ------------------
  412|  87.7k|                {
  413|  87.7k|                    width = (hDecoder->frameLength/8) - swb_offset_128_window[sf_index][i];
  414|  1.14M|                } else {
  415|  1.14M|                    width = swb_offset_128_window[sf_index][i+1] -
  416|  1.14M|                        swb_offset_128_window[sf_index][i];
  417|  1.14M|                }
  418|  1.22M|                width *= ics->window_group_length[g];
  419|  1.22M|                ics->sect_sfb_offset[g][sect_sfb++] = offset;
  420|  1.22M|                offset += width;
  421|  1.22M|            }
  422|  87.7k|            ics->sect_sfb_offset[g][sect_sfb] = offset;
  423|  87.7k|        }
  424|  13.3k|        return 0;
  425|      0|    default:
  ------------------
  |  Branch (425:5): [True: 0, False: 102k]
  ------------------
  426|      0|        return 32;
  427|   102k|    }
  428|   102k|}
reconstruct_single_channel:
  919|  75.9k|{
  920|  75.9k|    uint8_t retval;
  921|  75.9k|    uint8_t output_channels;
  922|  75.9k|    ALIGN real_t spec_coef[1024];
  923|       |
  924|       |#ifdef PROFILE
  925|       |    int64_t count = faad_get_ts();
  926|       |#endif
  927|       |
  928|       |
  929|       |    /* always allocate 2 channels, PS can always "suddenly" turn up */
  930|  75.9k|#if ( (defined(DRM) && defined(DRM_PS)) )
  931|  75.9k|    output_channels = 2;
  932|       |#elif defined(PS_DEC)
  933|       |    if (hDecoder->ps_used[hDecoder->fr_ch_ele])
  934|       |        output_channels = 2;
  935|       |    else
  936|       |        output_channels = 1;
  937|       |#else
  938|       |    output_channels = 1;
  939|       |#endif
  940|       |
  941|  75.9k|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
  ------------------
  |  Branch (941:9): [True: 64.5k, False: 11.4k]
  ------------------
  942|  64.5k|    {
  943|       |        /* element_output_channels not set yet */
  944|  64.5k|        hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
  945|  64.5k|    } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) {
  ------------------
  |  Branch (945:16): [True: 0, False: 11.4k]
  ------------------
  946|       |        /* element inconsistency */
  947|       |
  948|       |        /* this only happens if PS is actually found but not in the first frame
  949|       |         * this means that there is only 1 bitstream element!
  950|       |         */
  951|       |
  952|       |        /* The simplest way to fix the accounting,
  953|       |         * is to reallocate this and all the following channels.
  954|       |         */
  955|      0|        memset(&hDecoder->element_alloced[hDecoder->fr_ch_ele], 0,
  956|      0|            sizeof(uint8_t) * (MAX_SYNTAX_ELEMENTS - hDecoder->fr_ch_ele));
  ------------------
  |  |   44|      0|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  957|       |
  958|      0|        hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
  959|       |
  960|       |        //return 21;
  961|      0|    }
  962|       |
  963|  75.9k|    if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
  ------------------
  |  Branch (963:9): [True: 64.5k, False: 11.4k]
  ------------------
  964|  64.5k|    {
  965|  64.5k|        retval = allocate_single_channel(hDecoder, sce->channel, output_channels);
  966|  64.5k|        if (retval > 0)
  ------------------
  |  Branch (966:13): [True: 0, False: 64.5k]
  ------------------
  967|      0|            return retval;
  968|       |
  969|  64.5k|        hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
  970|  64.5k|    }
  971|       |
  972|       |    /* sanity check, CVE-2018-20199, CVE-2018-20360 */
  973|  75.9k|    if(!hDecoder->time_out[sce->channel])
  ------------------
  |  Branch (973:8): [True: 0, False: 75.9k]
  ------------------
  974|      0|        return 15;
  975|  75.9k|    if(output_channels > 1 && !hDecoder->time_out[sce->channel+1])
  ------------------
  |  Branch (975:8): [True: 75.9k, False: 0]
  |  Branch (975:31): [True: 0, False: 75.9k]
  ------------------
  976|      0|        return 15;
  977|  75.9k|    if(!hDecoder->fb_intermed[sce->channel])
  ------------------
  |  Branch (977:8): [True: 0, False: 75.9k]
  ------------------
  978|      0|        return 15;
  979|       |
  980|       |    /* dequantisation and scaling */
  981|  75.9k|    retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength);
  982|  75.9k|    if (retval > 0)
  ------------------
  |  Branch (982:9): [True: 70, False: 75.9k]
  ------------------
  983|     70|        return retval;
  984|       |
  985|       |#ifdef PROFILE
  986|       |    count = faad_get_ts() - count;
  987|       |    hDecoder->requant_cycles += count;
  988|       |#endif
  989|       |
  990|       |
  991|       |    /* pns decoding */
  992|  75.9k|    pns_decode(ics, NULL, spec_coef, NULL, hDecoder->frameLength, 0, hDecoder->object_type,
  993|  75.9k|        &(hDecoder->__r1), &(hDecoder->__r2));
  994|       |
  995|       |#ifdef MAIN_DEC
  996|       |    /* MAIN object type prediction */
  997|       |    if (hDecoder->object_type == MAIN)
  998|       |    {
  999|       |		if (!hDecoder->pred_stat[sce->channel])
 1000|       |			return 33;
 1001|       |
 1002|       |        /* intra channel prediction */
 1003|       |        ic_prediction(ics, spec_coef, hDecoder->pred_stat[sce->channel], hDecoder->frameLength,
 1004|       |            hDecoder->sf_index);
 1005|       |
 1006|       |        /* In addition, for scalefactor bands coded by perceptual
 1007|       |           noise substitution the predictors belonging to the
 1008|       |           corresponding spectral coefficients are reset.
 1009|       |        */
 1010|       |        pns_reset_pred_state(ics, hDecoder->pred_stat[sce->channel]);
 1011|       |    }
 1012|       |#endif
 1013|       |
 1014|       |#ifdef LTP_DEC
 1015|       |    if (is_ltp_ot(hDecoder->object_type))
 1016|       |    {
 1017|       |#ifdef LD_DEC
 1018|       |        if (hDecoder->object_type == LD)
 1019|       |        {
 1020|       |            if (ics->ltp.data_present)
 1021|       |            {
 1022|       |                if (ics->ltp.lag_update)
 1023|       |                    hDecoder->ltp_lag[sce->channel] = ics->ltp.lag;
 1024|       |            }
 1025|       |            ics->ltp.lag = hDecoder->ltp_lag[sce->channel];
 1026|       |        }
 1027|       |#endif
 1028|       |
 1029|       |        /* long term prediction */
 1030|       |        lt_prediction(ics, &(ics->ltp), spec_coef, hDecoder->lt_pred_stat[sce->channel], hDecoder->fb,
 1031|       |            ics->window_shape, hDecoder->window_shape_prev[sce->channel],
 1032|       |            hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
 1033|       |    }
 1034|       |#endif
 1035|       |
 1036|       |    /* tns decoding */
 1037|  75.9k|    tns_decode_frame(ics, &(ics->tns), hDecoder->sf_index, hDecoder->object_type,
 1038|  75.9k|        spec_coef, hDecoder->frameLength);
 1039|       |
 1040|       |    /* drc decoding */
 1041|  75.9k|#ifdef APPLY_DRC
 1042|  75.9k|    if (hDecoder->drc->present)
  ------------------
  |  Branch (1042:9): [True: 0, False: 75.9k]
  ------------------
 1043|      0|    {
 1044|      0|        if (!hDecoder->drc->exclude_mask[sce->channel] || !hDecoder->drc->excluded_chns_present)
  ------------------
  |  Branch (1044:13): [True: 0, False: 0]
  |  Branch (1044:59): [True: 0, False: 0]
  ------------------
 1045|      0|            drc_decode(hDecoder->drc, spec_coef);
 1046|      0|    }
 1047|  75.9k|#endif
 1048|       |    /* filter bank */
 1049|       |#ifdef SSR_DEC
 1050|       |    if (hDecoder->object_type != SSR)
 1051|       |    {
 1052|       |#endif
 1053|  75.9k|        ifilter_bank(hDecoder->fb, ics->window_sequence, ics->window_shape,
 1054|  75.9k|            hDecoder->window_shape_prev[sce->channel], spec_coef,
 1055|  75.9k|            hDecoder->time_out[sce->channel], hDecoder->fb_intermed[sce->channel],
 1056|  75.9k|            hDecoder->object_type, hDecoder->frameLength);
 1057|       |#ifdef SSR_DEC
 1058|       |    } else {
 1059|       |        ssr_decode(&(ics->ssr), hDecoder->fb, ics->window_sequence, ics->window_shape,
 1060|       |            hDecoder->window_shape_prev[sce->channel], spec_coef, hDecoder->time_out[sce->channel],
 1061|       |            hDecoder->ssr_overlap[sce->channel], hDecoder->ipqf_buffer[sce->channel], hDecoder->prev_fmd[sce->channel],
 1062|       |            hDecoder->frameLength);
 1063|       |    }
 1064|       |#endif
 1065|       |
 1066|       |    /* save window shape for next frame */
 1067|  75.9k|    hDecoder->window_shape_prev[sce->channel] = ics->window_shape;
 1068|       |
 1069|       |#ifdef LTP_DEC
 1070|       |    if (is_ltp_ot(hDecoder->object_type))
 1071|       |    {
 1072|       |        lt_update_state(hDecoder->lt_pred_stat[sce->channel], hDecoder->time_out[sce->channel],
 1073|       |            hDecoder->fb_intermed[sce->channel], hDecoder->frameLength, hDecoder->object_type);
 1074|       |    }
 1075|       |#endif
 1076|       |
 1077|  75.9k|#ifdef SBR_DEC
 1078|  75.9k|    if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1078:10): [True: 57.3k, False: 18.5k]
  |  Branch (1078:47): [True: 8.78k, False: 9.75k]
  ------------------
 1079|  66.1k|        && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
  ------------------
  |  Branch (1079:12): [True: 66.1k, False: 2]
  ------------------
 1080|  66.1k|    {
 1081|  66.1k|        int ele = hDecoder->fr_ch_ele;
 1082|  66.1k|        int ch = sce->channel;
 1083|       |
 1084|       |        /* following case can happen when forceUpSampling == 1 */
 1085|  66.1k|        if (hDecoder->sbr[ele] == NULL)
  ------------------
  |  Branch (1085:13): [True: 45.9k, False: 20.1k]
  ------------------
 1086|  45.9k|        {
 1087|  45.9k|            hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
 1088|  45.9k|                hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
 1089|  45.9k|                hDecoder->downSampledSBR
 1090|  45.9k|#ifdef DRM
 1091|  45.9k|                , 0
 1092|  45.9k|#endif
 1093|  45.9k|                );
 1094|  45.9k|        }
 1095|  66.1k|        if (!hDecoder->sbr[ele])
  ------------------
  |  Branch (1095:13): [True: 0, False: 66.1k]
  ------------------
 1096|      0|            return 19;
 1097|       |
 1098|  66.1k|        if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  66.1k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1098:13): [True: 9.40k, False: 56.7k]
  ------------------
 1099|  9.40k|            hDecoder->sbr[ele]->maxAACLine = 8*min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);
  ------------------
  |  |   60|  18.8k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 9.40k, False: 0]
  |  |  |  Branch (60:22): [True: 92, False: 9.30k]
  |  |  |  Branch (60:35): [True: 92, False: 9.30k]
  |  |  ------------------
  ------------------
 1100|  56.7k|        else
 1101|  56.7k|            hDecoder->sbr[ele]->maxAACLine = min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);
  ------------------
  |  |   60|   113k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 56.7k, False: 0]
  |  |  |  Branch (60:22): [True: 1.14k, False: 55.6k]
  |  |  |  Branch (60:35): [True: 1.14k, False: 55.6k]
  |  |  ------------------
  ------------------
 1102|       |
 1103|       |        /* check if any of the PS tools is used */
 1104|  66.1k|#if (defined(PS_DEC) || defined(DRM_PS))
 1105|  66.1k|        if (hDecoder->ps_used[ele] == 0)
  ------------------
  |  Branch (1105:13): [True: 60.6k, False: 5.53k]
  ------------------
 1106|  60.6k|        {
 1107|  60.6k|#endif
 1108|  60.6k|            retval = sbrDecodeSingleFrame(hDecoder->sbr[ele], hDecoder->time_out[ch],
 1109|  60.6k|                hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
 1110|  60.6k|#if (defined(PS_DEC) || defined(DRM_PS))
 1111|  60.6k|        } else {
 1112|  5.53k|            retval = sbrDecodeSingleFramePS(hDecoder->sbr[ele], hDecoder->time_out[ch],
 1113|  5.53k|                hDecoder->time_out[ch+1], hDecoder->postSeekResetFlag,
 1114|  5.53k|                hDecoder->downSampledSBR);
 1115|  5.53k|        }
 1116|  66.1k|#endif
 1117|  66.1k|        if (retval > 0)
  ------------------
  |  Branch (1117:13): [True: 10, False: 66.1k]
  ------------------
 1118|     10|            return retval;
 1119|  66.1k|    } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1119:17): [True: 2, False: 9.75k]
  |  Branch (1119:54): [True: 0, False: 9.75k]
  ------------------
 1120|      2|        && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
  ------------------
  |  Branch (1120:12): [True: 2, False: 0]
  ------------------
 1121|      2|    {
 1122|      2|        return 23;
 1123|      2|    }
 1124|  75.9k|#endif
 1125|       |
 1126|       |    /* copy L to R when no PS is used */
 1127|  75.9k|#if (defined(PS_DEC) || defined(DRM_PS))
 1128|  75.9k|    if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0) &&
  ------------------
  |  Branch (1128:9): [True: 70.3k, False: 5.53k]
  ------------------
 1129|  70.3k|        (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2))
  ------------------
  |  Branch (1129:9): [True: 70.3k, False: 0]
  ------------------
 1130|  70.3k|    {
 1131|  70.3k|        int ele = hDecoder->fr_ch_ele;
 1132|  70.3k|        int ch = sce->channel;
 1133|  70.3k|        int frame_size = (hDecoder->sbr_alloced[ele]) ? 2 : 1;
  ------------------
  |  Branch (1133:26): [True: 60.6k, False: 9.75k]
  ------------------
 1134|  70.3k|        frame_size *= hDecoder->frameLength*sizeof(real_t);
 1135|       |
 1136|  70.3k|        memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size);
 1137|  70.3k|    }
 1138|  75.9k|#endif
 1139|       |
 1140|  75.9k|    return 0;
 1141|  75.9k|}
reconstruct_channel_pair:
 1145|  17.6k|{
 1146|  17.6k|    uint8_t retval;
 1147|  17.6k|    ALIGN real_t spec_coef1[1024];
 1148|  17.6k|    ALIGN real_t spec_coef2[1024];
 1149|       |
 1150|       |#ifdef PROFILE
 1151|       |    int64_t count = faad_get_ts();
 1152|       |#endif
 1153|  17.6k|    if (hDecoder->element_alloced[hDecoder->fr_ch_ele] != 2)
  ------------------
  |  Branch (1153:9): [True: 14.4k, False: 3.14k]
  ------------------
 1154|  14.4k|    {
 1155|  14.4k|        retval = allocate_channel_pair(hDecoder, cpe->channel, (uint8_t)cpe->paired_channel);
 1156|  14.4k|        if (retval > 0)
  ------------------
  |  Branch (1156:13): [True: 0, False: 14.4k]
  ------------------
 1157|      0|            return retval;
 1158|       |
 1159|  14.4k|        hDecoder->element_alloced[hDecoder->fr_ch_ele] = 2;
 1160|  14.4k|    }
 1161|       |
 1162|       |    /* sanity check, CVE-2018-20199, CVE-2018-20360 */
 1163|  17.6k|    if(!hDecoder->time_out[cpe->channel] || !hDecoder->time_out[cpe->paired_channel])
  ------------------
  |  Branch (1163:8): [True: 0, False: 17.6k]
  |  Branch (1163:45): [True: 0, False: 17.6k]
  ------------------
 1164|      0|        return 15;
 1165|  17.6k|    if(!hDecoder->fb_intermed[cpe->channel] || !hDecoder->fb_intermed[cpe->paired_channel])
  ------------------
  |  Branch (1165:8): [True: 0, False: 17.6k]
  |  Branch (1165:48): [True: 0, False: 17.6k]
  ------------------
 1166|      0|        return 15;
 1167|       |
 1168|       |    /* dequantisation and scaling */
 1169|  17.6k|    retval = quant_to_spec(hDecoder, ics1, spec_data1, spec_coef1, hDecoder->frameLength);
 1170|  17.6k|    if (retval > 0)
  ------------------
  |  Branch (1170:9): [True: 54, False: 17.5k]
  ------------------
 1171|     54|        return retval;
 1172|  17.5k|    retval = quant_to_spec(hDecoder, ics2, spec_data2, spec_coef2, hDecoder->frameLength);
 1173|  17.5k|    if (retval > 0)
  ------------------
  |  Branch (1173:9): [True: 3, False: 17.5k]
  ------------------
 1174|      3|        return retval;
 1175|       |
 1176|       |#ifdef PROFILE
 1177|       |    count = faad_get_ts() - count;
 1178|       |    hDecoder->requant_cycles += count;
 1179|       |#endif
 1180|       |
 1181|       |    /* pns decoding */
 1182|  17.5k|    if (ics1->ms_mask_present)
  ------------------
  |  Branch (1182:9): [True: 5.23k, False: 12.3k]
  ------------------
 1183|  5.23k|    {
 1184|  5.23k|        pns_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength, 1, hDecoder->object_type,
 1185|  5.23k|            &(hDecoder->__r1), &(hDecoder->__r2));
 1186|  12.3k|    } else {
 1187|  12.3k|        pns_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength, 0, hDecoder->object_type,
 1188|  12.3k|            &(hDecoder->__r1), &(hDecoder->__r2));
 1189|  12.3k|    }
 1190|       |
 1191|       |    /* mid/side decoding */
 1192|  17.5k|    ms_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength);
 1193|       |
 1194|       |#if 0
 1195|       |    {
 1196|       |        int i;
 1197|       |        for (i = 0; i < 1024; i++)
 1198|       |        {
 1199|       |            //printf("%d\n", spec_coef1[i]);
 1200|       |            printf("0x%.8X\n", spec_coef1[i]);
 1201|       |        }
 1202|       |        for (i = 0; i < 1024; i++)
 1203|       |        {
 1204|       |            //printf("%d\n", spec_coef2[i]);
 1205|       |            printf("0x%.8X\n", spec_coef2[i]);
 1206|       |        }
 1207|       |    }
 1208|       |#endif
 1209|       |
 1210|       |    /* intensity stereo decoding */
 1211|  17.5k|    is_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength);
 1212|       |
 1213|       |#if 0
 1214|       |    {
 1215|       |        int i;
 1216|       |        for (i = 0; i < 1024; i++)
 1217|       |        {
 1218|       |            printf("%d\n", spec_coef1[i]);
 1219|       |            //printf("0x%.8X\n", spec_coef1[i]);
 1220|       |        }
 1221|       |        for (i = 0; i < 1024; i++)
 1222|       |        {
 1223|       |            printf("%d\n", spec_coef2[i]);
 1224|       |            //printf("0x%.8X\n", spec_coef2[i]);
 1225|       |        }
 1226|       |    }
 1227|       |#endif
 1228|       |
 1229|       |#ifdef MAIN_DEC
 1230|       |    /* MAIN object type prediction */
 1231|       |    if (hDecoder->object_type == MAIN)
 1232|       |    {
 1233|       |        /* intra channel prediction */
 1234|       |        ic_prediction(ics1, spec_coef1, hDecoder->pred_stat[cpe->channel], hDecoder->frameLength,
 1235|       |            hDecoder->sf_index);
 1236|       |        ic_prediction(ics2, spec_coef2, hDecoder->pred_stat[cpe->paired_channel], hDecoder->frameLength,
 1237|       |            hDecoder->sf_index);
 1238|       |
 1239|       |        /* In addition, for scalefactor bands coded by perceptual
 1240|       |           noise substitution the predictors belonging to the
 1241|       |           corresponding spectral coefficients are reset.
 1242|       |        */
 1243|       |        pns_reset_pred_state(ics1, hDecoder->pred_stat[cpe->channel]);
 1244|       |        pns_reset_pred_state(ics2, hDecoder->pred_stat[cpe->paired_channel]);
 1245|       |    }
 1246|       |#endif
 1247|       |
 1248|       |#ifdef LTP_DEC
 1249|       |    if (is_ltp_ot(hDecoder->object_type))
 1250|       |    {
 1251|       |        ltp_info *ltp1 = &(ics1->ltp);
 1252|       |        ltp_info *ltp2 = (cpe->common_window) ? &(ics2->ltp2) : &(ics2->ltp);
 1253|       |#ifdef LD_DEC
 1254|       |        if (hDecoder->object_type == LD)
 1255|       |        {
 1256|       |            if (ltp1->data_present)
 1257|       |            {
 1258|       |                if (ltp1->lag_update)
 1259|       |                    hDecoder->ltp_lag[cpe->channel] = ltp1->lag;
 1260|       |            }
 1261|       |            ltp1->lag = hDecoder->ltp_lag[cpe->channel];
 1262|       |            if (ltp2->data_present)
 1263|       |            {
 1264|       |                if (ltp2->lag_update)
 1265|       |                    hDecoder->ltp_lag[cpe->paired_channel] = ltp2->lag;
 1266|       |            }
 1267|       |            ltp2->lag = hDecoder->ltp_lag[cpe->paired_channel];
 1268|       |        }
 1269|       |#endif
 1270|       |
 1271|       |        /* long term prediction */
 1272|       |        lt_prediction(ics1, ltp1, spec_coef1, hDecoder->lt_pred_stat[cpe->channel], hDecoder->fb,
 1273|       |            ics1->window_shape, hDecoder->window_shape_prev[cpe->channel],
 1274|       |            hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
 1275|       |        lt_prediction(ics2, ltp2, spec_coef2, hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->fb,
 1276|       |            ics2->window_shape, hDecoder->window_shape_prev[cpe->paired_channel],
 1277|       |            hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
 1278|       |    }
 1279|       |#endif
 1280|       |
 1281|       |    /* tns decoding */
 1282|  17.5k|    tns_decode_frame(ics1, &(ics1->tns), hDecoder->sf_index, hDecoder->object_type,
 1283|  17.5k|        spec_coef1, hDecoder->frameLength);
 1284|  17.5k|    tns_decode_frame(ics2, &(ics2->tns), hDecoder->sf_index, hDecoder->object_type,
 1285|  17.5k|        spec_coef2, hDecoder->frameLength);
 1286|       |
 1287|       |    /* drc decoding */
 1288|  17.5k|#if APPLY_DRC
 1289|  17.5k|    if (hDecoder->drc->present)
  ------------------
  |  Branch (1289:9): [True: 0, False: 17.5k]
  ------------------
 1290|      0|    {
 1291|      0|        if (!hDecoder->drc->exclude_mask[cpe->channel] || !hDecoder->drc->excluded_chns_present)
  ------------------
  |  Branch (1291:13): [True: 0, False: 0]
  |  Branch (1291:59): [True: 0, False: 0]
  ------------------
 1292|      0|            drc_decode(hDecoder->drc, spec_coef1);
 1293|      0|        if (!hDecoder->drc->exclude_mask[cpe->paired_channel] || !hDecoder->drc->excluded_chns_present)
  ------------------
  |  Branch (1293:13): [True: 0, False: 0]
  |  Branch (1293:66): [True: 0, False: 0]
  ------------------
 1294|      0|            drc_decode(hDecoder->drc, spec_coef2);
 1295|      0|    }
 1296|  17.5k|#endif
 1297|       |    /* filter bank */
 1298|       |#ifdef SSR_DEC
 1299|       |    if (hDecoder->object_type != SSR)
 1300|       |    {
 1301|       |#endif
 1302|  17.5k|        ifilter_bank(hDecoder->fb, ics1->window_sequence, ics1->window_shape,
 1303|  17.5k|            hDecoder->window_shape_prev[cpe->channel], spec_coef1,
 1304|  17.5k|            hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
 1305|  17.5k|            hDecoder->object_type, hDecoder->frameLength);
 1306|  17.5k|        ifilter_bank(hDecoder->fb, ics2->window_sequence, ics2->window_shape,
 1307|  17.5k|            hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
 1308|  17.5k|            hDecoder->time_out[cpe->paired_channel], hDecoder->fb_intermed[cpe->paired_channel],
 1309|  17.5k|            hDecoder->object_type, hDecoder->frameLength);
 1310|       |#ifdef SSR_DEC
 1311|       |    } else {
 1312|       |        ssr_decode(&(ics1->ssr), hDecoder->fb, ics1->window_sequence, ics1->window_shape,
 1313|       |            hDecoder->window_shape_prev[cpe->channel], spec_coef1, hDecoder->time_out[cpe->channel],
 1314|       |            hDecoder->ssr_overlap[cpe->channel], hDecoder->ipqf_buffer[cpe->channel],
 1315|       |            hDecoder->prev_fmd[cpe->channel], hDecoder->frameLength);
 1316|       |        ssr_decode(&(ics2->ssr), hDecoder->fb, ics2->window_sequence, ics2->window_shape,
 1317|       |            hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2, hDecoder->time_out[cpe->paired_channel],
 1318|       |            hDecoder->ssr_overlap[cpe->paired_channel], hDecoder->ipqf_buffer[cpe->paired_channel],
 1319|       |            hDecoder->prev_fmd[cpe->paired_channel], hDecoder->frameLength);
 1320|       |    }
 1321|       |#endif
 1322|       |
 1323|       |    /* save window shape for next frame */
 1324|  17.5k|    hDecoder->window_shape_prev[cpe->channel] = ics1->window_shape;
 1325|  17.5k|    hDecoder->window_shape_prev[cpe->paired_channel] = ics2->window_shape;
 1326|       |
 1327|       |#ifdef LTP_DEC
 1328|       |    if (is_ltp_ot(hDecoder->object_type))
 1329|       |    {
 1330|       |        lt_update_state(hDecoder->lt_pred_stat[cpe->channel], hDecoder->time_out[cpe->channel],
 1331|       |            hDecoder->fb_intermed[cpe->channel], hDecoder->frameLength, hDecoder->object_type);
 1332|       |        lt_update_state(hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->time_out[cpe->paired_channel],
 1333|       |            hDecoder->fb_intermed[cpe->paired_channel], hDecoder->frameLength, hDecoder->object_type);
 1334|       |    }
 1335|       |#endif
 1336|       |
 1337|  17.5k|#ifdef SBR_DEC
 1338|  17.5k|    if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1338:10): [True: 13.8k, False: 3.69k]
  |  Branch (1338:47): [True: 1.93k, False: 1.75k]
  ------------------
 1339|  15.8k|        && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
  ------------------
  |  Branch (1339:12): [True: 15.8k, False: 1]
  ------------------
 1340|  15.8k|    {
 1341|  15.8k|        int ele = hDecoder->fr_ch_ele;
 1342|  15.8k|        int ch0 = cpe->channel;
 1343|  15.8k|        int ch1 = cpe->paired_channel;
 1344|       |
 1345|       |        /* following case can happen when forceUpSampling == 1 */
 1346|  15.8k|        if (hDecoder->sbr[ele] == NULL)
  ------------------
  |  Branch (1346:13): [True: 3.50k, False: 12.3k]
  ------------------
 1347|  3.50k|        {
 1348|  3.50k|            hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
 1349|  3.50k|                hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
 1350|  3.50k|                hDecoder->downSampledSBR
 1351|  3.50k|#ifdef DRM
 1352|  3.50k|                , 0
 1353|  3.50k|#endif
 1354|  3.50k|                );
 1355|  3.50k|        }
 1356|  15.8k|        if (!hDecoder->sbr[ele])
  ------------------
  |  Branch (1356:13): [True: 0, False: 15.8k]
  ------------------
 1357|      0|            return 19;
 1358|       |
 1359|  15.8k|        if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  15.8k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1359:13): [True: 755, False: 15.0k]
  ------------------
 1360|    755|            hDecoder->sbr[ele]->maxAACLine = 8*min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);
  ------------------
  |  |   60|  1.51k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 755, False: 0]
  |  |  |  Branch (60:22): [True: 199, False: 556]
  |  |  |  Branch (60:35): [True: 199, False: 556]
  |  |  ------------------
  ------------------
 1361|  15.0k|        else
 1362|  15.0k|            hDecoder->sbr[ele]->maxAACLine = min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);
  ------------------
  |  |   60|  30.1k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 15.0k, False: 0]
  |  |  |  Branch (60:22): [True: 720, False: 14.3k]
  |  |  |  Branch (60:35): [True: 720, False: 14.3k]
  |  |  ------------------
  ------------------
 1363|       |
 1364|  15.8k|        retval = sbrDecodeCoupleFrame(hDecoder->sbr[ele],
 1365|  15.8k|            hDecoder->time_out[ch0], hDecoder->time_out[ch1],
 1366|  15.8k|            hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
 1367|  15.8k|        if (retval > 0)
  ------------------
  |  Branch (1367:13): [True: 5, False: 15.8k]
  ------------------
 1368|      5|            return retval;
 1369|  15.8k|    } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1369:17): [True: 1, False: 1.75k]
  |  Branch (1369:54): [True: 0, False: 1.75k]
  ------------------
 1370|      1|        && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
  ------------------
  |  Branch (1370:12): [True: 1, False: 0]
  ------------------
 1371|      1|    {
 1372|      1|        return 23;
 1373|      1|    }
 1374|  17.5k|#endif
 1375|       |
 1376|  17.5k|    return 0;
 1377|  17.5k|}
specrec.c:allocate_single_channel:
  703|  64.5k|{
  704|  64.5k|    int mul = 1;
  705|       |
  706|       |#ifdef MAIN_DEC
  707|       |    /* MAIN object type prediction */
  708|       |    if (hDecoder->object_type == MAIN)
  709|       |    {
  710|       |        /* allocate the state only when needed */
  711|       |        if (hDecoder->pred_stat[channel] != NULL)
  712|       |        {
  713|       |            faad_free(hDecoder->pred_stat[channel]);
  714|       |            hDecoder->pred_stat[channel] = NULL;
  715|       |        }
  716|       |
  717|       |        hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
  718|       |        reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength);
  719|       |    }
  720|       |#endif
  721|       |
  722|       |#ifdef LTP_DEC
  723|       |    if (is_ltp_ot(hDecoder->object_type))
  724|       |    {
  725|       |        /* allocate the state only when needed */
  726|       |        if (hDecoder->lt_pred_stat[channel] != NULL)
  727|       |        {
  728|       |            faad_free(hDecoder->lt_pred_stat[channel]);
  729|       |            hDecoder->lt_pred_stat[channel] = NULL;
  730|       |        }
  731|       |
  732|       |        hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
  733|       |        memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
  734|       |    }
  735|       |#endif
  736|       |
  737|  64.5k|    if (hDecoder->time_out[channel] != NULL)
  ------------------
  |  Branch (737:9): [True: 0, False: 64.5k]
  ------------------
  738|      0|    {
  739|      0|        faad_free(hDecoder->time_out[channel]);
  740|      0|        hDecoder->time_out[channel] = NULL;
  741|      0|    }
  742|       |
  743|  64.5k|    {
  744|  64.5k|        mul = 1;
  745|  64.5k|#ifdef SBR_DEC
  746|  64.5k|        hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0;
  747|  64.5k|        if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (747:13): [True: 48.1k, False: 16.3k]
  |  Branch (747:50): [True: 7.69k, False: 8.69k]
  ------------------
  748|  55.8k|        {
  749|       |            /* SBR requires 2 times as much output data */
  750|  55.8k|            mul = 2;
  751|  55.8k|            hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1;
  752|  55.8k|        }
  753|  64.5k|#endif
  754|  64.5k|        hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
  755|  64.5k|        memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
  756|  64.5k|    }
  757|       |
  758|  64.5k|#if (defined(PS_DEC) || defined(DRM_PS))
  759|  64.5k|    if (output_channels == 2)
  ------------------
  |  Branch (759:9): [True: 64.5k, False: 0]
  ------------------
  760|  64.5k|    {
  761|  64.5k|        if (hDecoder->time_out[channel+1] != NULL)
  ------------------
  |  Branch (761:13): [True: 0, False: 64.5k]
  ------------------
  762|      0|        {
  763|      0|            faad_free(hDecoder->time_out[channel+1]);
  764|      0|            hDecoder->time_out[channel+1] = NULL;
  765|      0|        }
  766|       |
  767|  64.5k|        hDecoder->time_out[channel+1] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
  768|  64.5k|        memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t));
  769|  64.5k|    }
  770|  64.5k|#endif
  771|       |
  772|  64.5k|    if (hDecoder->fb_intermed[channel] != NULL)
  ------------------
  |  Branch (772:9): [True: 0, False: 64.5k]
  ------------------
  773|      0|    {
  774|      0|        faad_free(hDecoder->fb_intermed[channel]);
  775|      0|        hDecoder->fb_intermed[channel] = NULL;
  776|      0|    }
  777|       |
  778|  64.5k|    hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
  779|  64.5k|    memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t));
  780|       |
  781|       |#ifdef SSR_DEC
  782|       |    if (hDecoder->object_type == SSR)
  783|       |    {
  784|       |        if (hDecoder->ssr_overlap[channel] == NULL)
  785|       |        {
  786|       |            hDecoder->ssr_overlap[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
  787|       |            memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
  788|       |        }
  789|       |        if (hDecoder->prev_fmd[channel] == NULL)
  790|       |        {
  791|       |            uint16_t k;
  792|       |            hDecoder->prev_fmd[channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
  793|       |            for (k = 0; k < 2*hDecoder->frameLength; k++)
  794|       |                hDecoder->prev_fmd[channel][k] = REAL_CONST(-1);
  795|       |        }
  796|       |    }
  797|       |#endif
  798|       |
  799|  64.5k|    return 0;
  800|  64.5k|}
specrec.c:quant_to_spec:
  556|   111k|{
  557|   111k|    ALIGN static const real_t pow2_table[] =
  558|   111k|    {
  559|   111k|        COEF_CONST(1.0),
  ------------------
  |  |  289|   111k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  560|   111k|        COEF_CONST(1.1892071150027210667174999705605), /* 2^0.25 */
  ------------------
  |  |  289|   111k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  561|   111k|        COEF_CONST(1.4142135623730950488016887242097), /* 2^0.5 */
  ------------------
  |  |  289|   111k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  562|   111k|        COEF_CONST(1.6817928305074290860622509524664) /* 2^0.75 */
  ------------------
  |  |  289|   111k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  563|   111k|    };
  564|   111k|    const real_t *tab = iq_table;
  565|       |
  566|   111k|    uint8_t g, sfb, win;
  567|   111k|    uint16_t width, bin, k, gindex;
  568|   111k|    uint8_t error = 0; /* Init error flag */
  569|   111k|#ifndef FIXED_POINT
  570|   111k|    real_t scf;
  571|       |#else
  572|       |    int32_t sat_shift_mask = 0;
  573|       |#endif
  574|       |
  575|   111k|    k = 0;
  576|   111k|    gindex = 0;
  577|       |
  578|       |    /* In this case quant_to_spec is no-op and spec_data remains undefined.
  579|       |     * Without peeking into AAC specification, there is no strong evidence if
  580|       |     * such streams are invalid -> just calm down MSAN. */
  581|   111k|    if (ics->num_swb == 0)
  ------------------
  |  Branch (581:9): [True: 0, False: 111k]
  ------------------
  582|      0|        memset(spec_data, 0, frame_len * sizeof(real_t));
  583|       |
  584|   299k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (584:17): [True: 188k, False: 111k]
  ------------------
  585|   188k|    {
  586|   188k|        uint16_t j = 0;
  587|   188k|        uint16_t gincrease = 0;
  588|   188k|        uint16_t win_inc = ics->swb_offset[ics->num_swb];
  589|       |
  590|  5.64M|        for (sfb = 0; sfb < ics->num_swb; sfb++)
  ------------------
  |  Branch (590:23): [True: 5.45M, False: 188k]
  ------------------
  591|  5.45M|        {
  592|  5.45M|            int32_t exp, frac;
  593|  5.45M|            uint16_t wa = gindex + j;
  594|  5.45M|            int16_t scale_factor = ics->scale_factors[g][sfb];
  595|       |
  596|  5.45M|            width = ics->swb_offset[sfb+1] - ics->swb_offset[sfb];
  597|       |
  598|       |#ifdef FIXED_POINT
  599|       |            scale_factor -= 100;
  600|       |            /* IMDCT pre-scaling */
  601|       |            if (hDecoder->object_type == LD)
  602|       |            {
  603|       |                scale_factor -= 24 /*9*/;
  604|       |            } else {
  605|       |                if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  606|       |                    scale_factor -= 16 /*7*/;
  607|       |                else
  608|       |                    scale_factor -= 28 /*10*/;
  609|       |            }
  610|       |            if (scale_factor > 120)
  611|       |                scale_factor = 120;  /* => exp <= 30 */
  612|       |#else
  613|  5.45M|            (void)hDecoder;
  614|  5.45M|#endif
  615|       |
  616|       |            /* scale_factor for IS or PNS, has different meaning; fill with almost zeroes */
  617|  5.45M|            if (is_intensity(ics, g, sfb) || is_noise(ics, g, sfb))
  ------------------
  |  Branch (617:17): [True: 5.95k, False: 5.44M]
  |  Branch (617:46): [True: 0, False: 5.44M]
  ------------------
  618|  5.95k|            {
  619|  5.95k|                scale_factor = 0;
  620|  5.95k|            }
  621|       |
  622|       |            /* scale_factor must be between 0 and 255 */
  623|  5.45M|            exp = (scale_factor /* - 100 */) >> 2;
  624|       |            /* frac must always be > 0 */
  625|  5.45M|            frac = (scale_factor /* - 100 */) & 3;
  626|       |
  627|  5.45M|#ifndef FIXED_POINT
  628|  5.45M|            scf = pow2sf_tab[exp/*+25*/] * pow2_table[frac];
  629|       |#else
  630|       |            if (exp > 0)
  631|       |                sat_shift_mask = SAT_SHIFT_MASK(exp);
  632|       |#endif
  633|       |
  634|  11.1M|            for (win = 0; win < ics->window_group_length[g]; win++)
  ------------------
  |  Branch (634:27): [True: 5.73M, False: 5.45M]
  ------------------
  635|  5.73M|            {
  636|  33.8M|                for (bin = 0; bin < width; bin += 4)
  ------------------
  |  Branch (636:31): [True: 28.0M, False: 5.73M]
  ------------------
  637|  28.0M|                {
  638|  28.0M|                    uint16_t wb = wa + bin;
  639|  28.0M|#ifndef FIXED_POINT
  640|  28.0M|                    spec_data[wb+0] = iquant(quant_data[k+0], tab, &error) * scf;
  641|  28.0M|                    spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf;
  642|  28.0M|                    spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf;
  643|  28.0M|                    spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf;
  644|       |#else
  645|       |                    real_t iq0 = iquant(quant_data[k+0], tab, &error);
  646|       |                    real_t iq1 = iquant(quant_data[k+1], tab, &error);
  647|       |                    real_t iq2 = iquant(quant_data[k+2], tab, &error);
  648|       |                    real_t iq3 = iquant(quant_data[k+3], tab, &error);
  649|       |
  650|       |                    if (exp == -32)
  651|       |                    {
  652|       |                        spec_data[wb+0] = 0;
  653|       |                        spec_data[wb+1] = 0;
  654|       |                        spec_data[wb+2] = 0;
  655|       |                        spec_data[wb+3] = 0;
  656|       |                    } else if (exp <= 0) {
  657|       |                        spec_data[wb+0] = iq0 >> -exp;
  658|       |                        spec_data[wb+1] = iq1 >> -exp;
  659|       |                        spec_data[wb+2] = iq2 >> -exp;
  660|       |                        spec_data[wb+3] = iq3 >> -exp;
  661|       |                    } else { /* exp > 0 */
  662|       |                        spec_data[wb+0] = SAT_SHIFT(iq0, exp, sat_shift_mask);
  663|       |                        spec_data[wb+1] = SAT_SHIFT(iq1, exp, sat_shift_mask);
  664|       |                        spec_data[wb+2] = SAT_SHIFT(iq2, exp, sat_shift_mask);
  665|       |                        spec_data[wb+3] = SAT_SHIFT(iq3, exp, sat_shift_mask);
  666|       |                    }
  667|       |                    if (frac != 0)
  668|       |                    {
  669|       |                        spec_data[wb+0] = MUL_C(spec_data[wb+0],pow2_table[frac]);
  670|       |                        spec_data[wb+1] = MUL_C(spec_data[wb+1],pow2_table[frac]);
  671|       |                        spec_data[wb+2] = MUL_C(spec_data[wb+2],pow2_table[frac]);
  672|       |                        spec_data[wb+3] = MUL_C(spec_data[wb+3],pow2_table[frac]);
  673|       |                    }
  674|       |
  675|       |//#define SCFS_PRINT
  676|       |#ifdef SCFS_PRINT
  677|       |                    printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+0]);
  678|       |                    printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+1]);
  679|       |                    printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+2]);
  680|       |                    printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+3]);
  681|       |                    //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+0]);
  682|       |                    //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+1]);
  683|       |                    //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+2]);
  684|       |                    //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+3]);
  685|       |#endif
  686|       |#endif
  687|       |
  688|  28.0M|                    gincrease += 4;
  689|  28.0M|                    k += 4;
  690|  28.0M|                }
  691|  5.73M|                wa += win_inc;
  692|  5.73M|            }
  693|  5.45M|            j += width;
  694|  5.45M|        }
  695|   188k|        gindex += gincrease;
  696|   188k|    }
  697|       |
  698|   111k|    return error;
  699|   111k|}
specrec.c:iquant:
  432|   112M|{
  433|       |#ifdef FIXED_POINT
  434|       |/* For FIXED_POINT the iq_table is prescaled by 3 bits (iq_table[]/8) */
  435|       |/* BIG_IQ_TABLE allows you to use the full 8192 value table, if this is not
  436|       | * defined a 1026 value table and interpolation will be used
  437|       | */
  438|       |#ifndef BIG_IQ_TABLE
  439|       |    static const real_t errcorr[] = {
  440|       |        REAL_CONST(0), REAL_CONST(1.0/8.0), REAL_CONST(2.0/8.0), REAL_CONST(3.0/8.0),
  441|       |        REAL_CONST(4.0/8.0),  REAL_CONST(5.0/8.0), REAL_CONST(6.0/8.0), REAL_CONST(7.0/8.0),
  442|       |        REAL_CONST(0)
  443|       |    };
  444|       |    real_t x1, x2;
  445|       |#endif
  446|       |    int16_t sgn = 1;
  447|       |    /* compute the magnitude in int: -q is evaluated as int and so does not
  448|       |       wrap for q == -32768 the way an int16_t negation would, which keeps the
  449|       |       comparison against IQ_TABLE_SIZE in range like the floating-point path */
  450|       |    int aq = q;
  451|       |
  452|       |    if (aq < 0)
  453|       |    {
  454|       |        aq = -aq;
  455|       |        sgn = -1;
  456|       |    }
  457|       |
  458|       |    if (aq < IQ_TABLE_SIZE)
  459|       |    {
  460|       |//#define IQUANT_PRINT
  461|       |#ifdef IQUANT_PRINT
  462|       |        //printf("0x%.8X\n", sgn * tab[aq]);
  463|       |        printf("%d\n", sgn * tab[aq]);
  464|       |#endif
  465|       |        return sgn * tab[aq];
  466|       |    }
  467|       |
  468|       |#ifndef BIG_IQ_TABLE
  469|       |    if (aq >= 8192)
  470|       |    {
  471|       |        *error = 17;
  472|       |        return 0;
  473|       |    }
  474|       |
  475|       |    /* linear interpolation */
  476|       |    x1 = tab[aq>>3];
  477|       |    x2 = tab[(aq>>3) + 1];
  478|       |    return sgn * 16 * (MUL_R(errcorr[aq&7],(x2-x1)) + x1);
  479|       |#else
  480|       |    *error = 17;
  481|       |    return 0;
  482|       |#endif
  483|       |
  484|       |#else
  485|   112M|    if (q < 0)
  ------------------
  |  Branch (485:9): [True: 83.3k, False: 112M]
  ------------------
  486|  83.3k|    {
  487|       |        /* tab contains a value for all possible q [0,8192] */
  488|  83.3k|        if (-q < IQ_TABLE_SIZE)
  ------------------
  |  |   44|  83.3k|#define IQ_TABLE_SIZE 8192
  ------------------
  |  Branch (488:13): [True: 82.5k, False: 873]
  ------------------
  489|  82.5k|            return -tab[-q];
  490|       |
  491|    873|        *error = 17;
  492|    873|        return 0;
  493|   112M|    } else {
  494|       |        /* tab contains a value for all possible q [0,8192] */
  495|   112M|        if (q < IQ_TABLE_SIZE)
  ------------------
  |  |   44|   112M|#define IQ_TABLE_SIZE 8192
  ------------------
  |  Branch (495:13): [True: 112M, False: 570]
  ------------------
  496|   112M|            return tab[q];
  497|       |
  498|    570|        *error = 17;
  499|    570|        return 0;
  500|   112M|    }
  501|   112M|#endif
  502|   112M|}
specrec.c:allocate_channel_pair:
  804|  14.4k|{
  805|  14.4k|    int mul = 1;
  806|       |
  807|       |#ifdef MAIN_DEC
  808|       |    /* MAIN object type prediction */
  809|       |    if (hDecoder->object_type == MAIN)
  810|       |    {
  811|       |        /* allocate the state only when needed */
  812|       |        if (hDecoder->pred_stat[channel] == NULL)
  813|       |        {
  814|       |            hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
  815|       |            reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength);
  816|       |        }
  817|       |        if (hDecoder->pred_stat[paired_channel] == NULL)
  818|       |        {
  819|       |            hDecoder->pred_stat[paired_channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
  820|       |            reset_all_predictors(hDecoder->pred_stat[paired_channel], hDecoder->frameLength);
  821|       |        }
  822|       |    }
  823|       |#endif
  824|       |
  825|       |#ifdef LTP_DEC
  826|       |    if (is_ltp_ot(hDecoder->object_type))
  827|       |    {
  828|       |        /* allocate the state only when needed */
  829|       |        if (hDecoder->lt_pred_stat[channel] == NULL)
  830|       |        {
  831|       |            hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
  832|       |            memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
  833|       |        }
  834|       |        if (hDecoder->lt_pred_stat[paired_channel] == NULL)
  835|       |        {
  836|       |            hDecoder->lt_pred_stat[paired_channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
  837|       |            memset(hDecoder->lt_pred_stat[paired_channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
  838|       |        }
  839|       |    }
  840|       |#endif
  841|       |
  842|  14.4k|    {
  843|  14.4k|        mul = 1;
  844|  14.4k|#ifdef SBR_DEC
  845|  14.4k|        hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0;
  846|  14.4k|        if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (846:13): [True: 11.0k, False: 3.40k]
  |  Branch (846:50): [True: 1.77k, False: 1.63k]
  ------------------
  847|  12.8k|        {
  848|       |            /* SBR requires 2 times as much output data */
  849|  12.8k|            mul = 2;
  850|  12.8k|            hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1;
  851|  12.8k|        }
  852|  14.4k|#endif
  853|  14.4k|    }
  854|  14.4k|    if (hDecoder->time_out[channel] != NULL)
  ------------------
  |  Branch (854:9): [True: 5, False: 14.4k]
  ------------------
  855|      5|    {
  856|      5|        faad_free(hDecoder->time_out[channel]);
  857|      5|        hDecoder->time_out[channel] = NULL;
  858|      5|    }
  859|  14.4k|    if (hDecoder->time_out[paired_channel] != NULL)
  ------------------
  |  Branch (859:9): [True: 5, False: 14.4k]
  ------------------
  860|      5|    {
  861|      5|        faad_free(hDecoder->time_out[paired_channel]);
  862|      5|        hDecoder->time_out[paired_channel] = NULL;
  863|      5|    }
  864|  14.4k|    hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
  865|  14.4k|    memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
  866|  14.4k|    hDecoder->time_out[paired_channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
  867|  14.4k|    memset(hDecoder->time_out[paired_channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
  868|       |
  869|  14.4k|    if (hDecoder->fb_intermed[channel] != NULL)
  ------------------
  |  Branch (869:9): [True: 5, False: 14.4k]
  ------------------
  870|      5|    {
  871|      5|        faad_free(hDecoder->fb_intermed[channel]);
  872|      5|        hDecoder->fb_intermed[channel] = NULL;
  873|      5|    }
  874|  14.4k|    if (hDecoder->fb_intermed[paired_channel] != NULL)
  ------------------
  |  Branch (874:9): [True: 0, False: 14.4k]
  ------------------
  875|      0|    {
  876|      0|        faad_free(hDecoder->fb_intermed[paired_channel]);
  877|      0|        hDecoder->fb_intermed[paired_channel] = NULL;
  878|      0|    }
  879|  14.4k|    hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
  880|  14.4k|    memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t));
  881|  14.4k|    hDecoder->fb_intermed[paired_channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
  882|  14.4k|    memset(hDecoder->fb_intermed[paired_channel], 0, hDecoder->frameLength*sizeof(real_t));
  883|       |
  884|       |#ifdef SSR_DEC
  885|       |    if (hDecoder->object_type == SSR)
  886|       |    {
  887|       |        if (hDecoder->ssr_overlap[cpe->channel] == NULL)
  888|       |        {
  889|       |            hDecoder->ssr_overlap[cpe->channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
  890|       |            memset(hDecoder->ssr_overlap[cpe->channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
  891|       |        }
  892|       |        if (hDecoder->ssr_overlap[cpe->paired_channel] == NULL)
  893|       |        {
  894|       |            hDecoder->ssr_overlap[cpe->paired_channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
  895|       |            memset(hDecoder->ssr_overlap[cpe->paired_channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
  896|       |        }
  897|       |        if (hDecoder->prev_fmd[cpe->channel] == NULL)
  898|       |        {
  899|       |            uint16_t k;
  900|       |            hDecoder->prev_fmd[cpe->channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
  901|       |            for (k = 0; k < 2*hDecoder->frameLength; k++)
  902|       |                hDecoder->prev_fmd[cpe->channel][k] = REAL_CONST(-1);
  903|       |        }
  904|       |        if (hDecoder->prev_fmd[cpe->paired_channel] == NULL)
  905|       |        {
  906|       |            uint16_t k;
  907|       |            hDecoder->prev_fmd[cpe->paired_channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
  908|       |            for (k = 0; k < 2*hDecoder->frameLength; k++)
  909|       |                hDecoder->prev_fmd[cpe->paired_channel][k] = REAL_CONST(-1);
  910|       |        }
  911|       |    }
  912|       |#endif
  913|       |
  914|  14.4k|    return 0;
  915|  14.4k|}

GASpecificConfig:
  111|  2.04k|{
  112|  2.04k|    program_config pce;
  113|       |
  114|       |    /* 1024 or 960 */
  115|  2.04k|    mp4ASC->frameLengthFlag = faad_get1bit(ld
  116|  2.04k|        DEBUGVAR(1,138,"GASpecificConfig(): FrameLengthFlag"));
  117|       |#ifndef ALLOW_SMALL_FRAMELENGTH
  118|       |    if (mp4ASC->frameLengthFlag == 1)
  119|       |        return -3;
  120|       |#endif
  121|       |
  122|  2.04k|    mp4ASC->dependsOnCoreCoder = faad_get1bit(ld
  123|  2.04k|        DEBUGVAR(1,139,"GASpecificConfig(): DependsOnCoreCoder"));
  124|  2.04k|    if (mp4ASC->dependsOnCoreCoder == 1)
  ------------------
  |  Branch (124:9): [True: 593, False: 1.44k]
  ------------------
  125|    593|    {
  126|    593|        mp4ASC->coreCoderDelay = (uint16_t)faad_getbits(ld, 14
  127|    593|            DEBUGVAR(1,140,"GASpecificConfig(): CoreCoderDelay"));
  128|    593|    }
  129|       |
  130|  2.04k|    mp4ASC->extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): ExtensionFlag"));
  131|  2.04k|    if (mp4ASC->channelsConfiguration == 0)
  ------------------
  |  Branch (131:9): [True: 375, False: 1.66k]
  ------------------
  132|    375|    {
  133|    375|        if (program_config_element(&pce, ld))
  ------------------
  |  Branch (133:13): [True: 2, False: 373]
  ------------------
  134|      2|            return -3;
  135|       |        //mp4ASC->channelsConfiguration = pce.channels;
  136|       |
  137|    373|        if (pce_out != NULL)
  ------------------
  |  Branch (137:13): [True: 373, False: 0]
  ------------------
  138|    373|            memcpy(pce_out, &pce, sizeof(program_config));
  139|       |
  140|       |        /*
  141|       |        if (pce.num_valid_cc_elements)
  142|       |            return -3;
  143|       |        */
  144|    373|    }
  145|       |
  146|  2.04k|#ifdef ERROR_RESILIENCE
  147|  2.04k|    if (mp4ASC->extensionFlag == 1)
  ------------------
  |  Branch (147:9): [True: 1.43k, False: 603]
  ------------------
  148|  1.43k|    {
  149|       |        /* Error resilience not supported yet */
  150|  1.43k|        if (mp4ASC->objectTypeIndex >= ER_OBJECT_START)
  ------------------
  |  |   71|  1.43k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (150:13): [True: 1.23k, False: 207]
  ------------------
  151|  1.23k|        {
  152|  1.23k|            mp4ASC->aacSectionDataResilienceFlag = faad_get1bit(ld
  153|  1.23k|                DEBUGVAR(1,144,"GASpecificConfig(): aacSectionDataResilienceFlag"));
  154|  1.23k|            mp4ASC->aacScalefactorDataResilienceFlag = faad_get1bit(ld
  155|  1.23k|                DEBUGVAR(1,145,"GASpecificConfig(): aacScalefactorDataResilienceFlag"));
  156|  1.23k|            mp4ASC->aacSpectralDataResilienceFlag = faad_get1bit(ld
  157|  1.23k|                DEBUGVAR(1,146,"GASpecificConfig(): aacSpectralDataResilienceFlag"));
  158|  1.23k|        }
  159|       |        /* 1 bit: extensionFlag3 */
  160|  1.43k|        faad_getbits(ld, 1);
  161|  1.43k|	}
  162|  2.04k|#endif
  163|       |
  164|  2.04k|    return 0;
  165|  2.04k|}
raw_data_block:
  451|  6.57k|{
  452|  6.57k|    uint8_t id_syn_ele;
  453|  6.57k|    uint8_t ele_this_frame = 0;
  454|       |
  455|  6.57k|    hDecoder->fr_channels = 0;
  456|  6.57k|    hDecoder->fr_ch_ele = 0;
  457|  6.57k|    hDecoder->first_syn_ele = 25;
  458|  6.57k|    hDecoder->has_lfe = 0;
  459|       |
  460|  6.57k|#ifdef ERROR_RESILIENCE
  461|  6.57k|    if (hDecoder->object_type < ER_OBJECT_START)
  ------------------
  |  |   71|  6.57k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (461:9): [True: 4.25k, False: 2.32k]
  ------------------
  462|  4.25k|    {
  463|  4.25k|#endif
  464|       |        /* Table 4.4.3: raw_data_block() */
  465|   449k|        while ((id_syn_ele = (uint8_t)faad_getbits(ld, LEN_SE_ID
  ------------------
  |  |   75|   449k|#define LEN_SE_ID 3
  ------------------
  |  Branch (465:16): [True: 449k, False: 547]
  ------------------
  466|   449k|            DEBUGVAR(1,4,"NeAACDecDecode(): id_syn_ele"))) != ID_END)
  ------------------
  |  |   93|   449k|#define ID_END 0x7
  ------------------
  467|   449k|        {
  468|   449k|            switch (id_syn_ele) {
  ------------------
  |  Branch (468:21): [True: 449k, False: 0]
  ------------------
  469|  76.7k|            case ID_SCE:
  ------------------
  |  |   86|  76.7k|#define ID_SCE 0x0
  ------------------
  |  Branch (469:13): [True: 76.7k, False: 372k]
  ------------------
  470|  76.7k|                ele_this_frame++;
  471|  76.7k|                if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
  ------------------
  |  Branch (471:21): [True: 2.46k, False: 74.2k]
  ------------------
  472|  76.7k|                decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
  473|  76.7k|                if (hInfo->error > 0)
  ------------------
  |  Branch (473:21): [True: 2.81k, False: 73.9k]
  ------------------
  474|  2.81k|                    return;
  475|  73.9k|                break;
  476|  73.9k|            case ID_CPE:
  ------------------
  |  |   87|  15.4k|#define ID_CPE 0x1
  ------------------
  |  Branch (476:13): [True: 15.4k, False: 433k]
  ------------------
  477|  15.4k|                ele_this_frame++;
  478|  15.4k|                if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
  ------------------
  |  Branch (478:21): [True: 1.69k, False: 13.7k]
  ------------------
  479|  15.4k|                decode_cpe(hDecoder, hInfo, ld, id_syn_ele);
  480|  15.4k|                if (hInfo->error > 0)
  ------------------
  |  Branch (480:21): [True: 576, False: 14.8k]
  ------------------
  481|    576|                    return;
  482|  14.8k|                break;
  483|  14.8k|            case ID_LFE:
  ------------------
  |  |   89|     78|#define ID_LFE 0x3
  ------------------
  |  Branch (483:13): [True: 78, False: 449k]
  ------------------
  484|     78|#ifdef DRM
  485|     78|                hInfo->error = 32;
  486|       |#else
  487|       |                ele_this_frame++;
  488|       |                hDecoder->has_lfe++;
  489|       |                decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
  490|       |#endif
  491|     78|                if (hInfo->error > 0)
  ------------------
  |  Branch (491:21): [True: 78, False: 0]
  ------------------
  492|     78|                    return;
  493|      0|                break;
  494|     93|            case ID_CCE: /* not implemented yet, but skip the bits */
  ------------------
  |  |   88|     93|#define ID_CCE 0x2
  ------------------
  |  Branch (494:13): [True: 93, False: 449k]
  ------------------
  495|     93|#ifdef DRM
  496|     93|                hInfo->error = 32;
  497|       |#else
  498|       |                ele_this_frame++;
  499|       |#ifdef COUPLING_DEC
  500|       |                hInfo->error = coupling_channel_element(hDecoder, ld);
  501|       |#else
  502|       |                hInfo->error = 6;
  503|       |#endif
  504|       |#endif
  505|     93|                if (hInfo->error > 0)
  ------------------
  |  Branch (505:21): [True: 93, False: 0]
  ------------------
  506|     93|                    return;
  507|      0|                break;
  508|   355k|            case ID_DSE:
  ------------------
  |  |   90|   355k|#define ID_DSE 0x4
  ------------------
  |  Branch (508:13): [True: 355k, False: 94.1k]
  ------------------
  509|   355k|                ele_this_frame++;
  510|   355k|                data_stream_element(hDecoder, ld);
  511|   355k|                break;
  512|    277|            case ID_PCE:
  ------------------
  |  |   91|    277|#define ID_PCE 0x5
  ------------------
  |  Branch (512:13): [True: 277, False: 449k]
  ------------------
  513|    277|                if (ele_this_frame != 0)
  ------------------
  |  Branch (513:21): [True: 62, False: 215]
  ------------------
  514|     62|                {
  515|     62|                    hInfo->error = 31;
  516|     62|                    return;
  517|     62|                }
  518|    215|                ele_this_frame++;
  519|       |                /* 14496-4: 5.6.4.1.2.1.3: */
  520|       |                /* program_configuration_element()'s in access units shall be ignored */
  521|    215|                program_config_element(pce, ld);
  522|       |                //if ((hInfo->error = program_config_element(pce, ld)) > 0)
  523|       |                //    return;
  524|       |                //hDecoder->pce_set = 1;
  525|    215|                break;
  526|  1.53k|            case ID_FIL:
  ------------------
  |  |   92|  1.53k|#define ID_FIL 0x6
  ------------------
  |  Branch (526:13): [True: 1.53k, False: 447k]
  ------------------
  527|  1.53k|                ele_this_frame++;
  528|       |                /* one sbr_info describes a channel_element not a channel! */
  529|       |                /* if we encounter SBR data here: error */
  530|       |                /* SBR data will be read directly in the SCE/LFE/CPE element */
  531|  1.53k|                if ((hInfo->error = fill_element(hDecoder, ld, drc
  ------------------
  |  Branch (531:21): [True: 83, False: 1.45k]
  ------------------
  532|  1.53k|#ifdef SBR_DEC
  533|  1.53k|                    , INVALID_SBR_ELEMENT
  ------------------
  |  |  110|  1.53k|#define INVALID_SBR_ELEMENT 255
  ------------------
  534|  1.53k|#endif
  535|  1.53k|                    )) > 0)
  536|     83|                    return;
  537|  1.45k|                break;
  538|   449k|            }
  539|   445k|            if (ld->error != 0)
  ------------------
  |  Branch (539:17): [True: 0, False: 445k]
  ------------------
  540|      0|            {
  541|      0|                hInfo->error = 32;
  542|      0|                return;
  543|      0|            }
  544|   445k|        }
  545|  4.25k|#ifdef ERROR_RESILIENCE
  546|  4.25k|    } else {
  547|       |        /* Table 262: er_raw_data_block() */
  548|  2.32k|        switch (hDecoder->channelConfiguration)
  549|  2.32k|        {
  550|      0|        case 1:
  ------------------
  |  Branch (550:9): [True: 0, False: 2.32k]
  ------------------
  551|      0|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|      0|#define ID_SCE 0x0
  ------------------
  552|      0|            if (hInfo->error > 0)
  ------------------
  |  Branch (552:17): [True: 0, False: 0]
  ------------------
  553|      0|                return;
  554|      0|            break;
  555|    897|        case 2:
  ------------------
  |  Branch (555:9): [True: 897, False: 1.42k]
  ------------------
  556|    897|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    897|#define ID_CPE 0x1
  ------------------
  557|    897|            if (hInfo->error > 0)
  ------------------
  |  Branch (557:17): [True: 192, False: 705]
  ------------------
  558|    192|                return;
  559|    705|            break;
  560|    705|        case 3:
  ------------------
  |  Branch (560:9): [True: 133, False: 2.18k]
  ------------------
  561|    133|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    133|#define ID_SCE 0x0
  ------------------
  562|    133|            if (hInfo->error > 0)
  ------------------
  |  Branch (562:17): [True: 15, False: 118]
  ------------------
  563|     15|                return;
  564|    118|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    118|#define ID_CPE 0x1
  ------------------
  565|    118|            if (hInfo->error > 0)
  ------------------
  |  Branch (565:17): [True: 13, False: 105]
  ------------------
  566|     13|                return;
  567|    105|            break;
  568|    388|        case 4:
  ------------------
  |  Branch (568:9): [True: 388, False: 1.93k]
  ------------------
  569|    388|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    388|#define ID_SCE 0x0
  ------------------
  570|    388|            if (hInfo->error > 0)
  ------------------
  |  Branch (570:17): [True: 66, False: 322]
  ------------------
  571|     66|                return;
  572|    322|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    322|#define ID_CPE 0x1
  ------------------
  573|    322|            if (hInfo->error > 0)
  ------------------
  |  Branch (573:17): [True: 22, False: 300]
  ------------------
  574|     22|                return;
  575|    300|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    300|#define ID_SCE 0x0
  ------------------
  576|    300|            if (hInfo->error > 0)
  ------------------
  |  Branch (576:17): [True: 3, False: 297]
  ------------------
  577|      3|                return;
  578|    297|            break;
  579|    521|        case 5:
  ------------------
  |  Branch (579:9): [True: 521, False: 1.79k]
  ------------------
  580|    521|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    521|#define ID_SCE 0x0
  ------------------
  581|    521|            if (hInfo->error > 0)
  ------------------
  |  Branch (581:17): [True: 136, False: 385]
  ------------------
  582|    136|                return;
  583|    385|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    385|#define ID_CPE 0x1
  ------------------
  584|    385|            if (hInfo->error > 0)
  ------------------
  |  Branch (584:17): [True: 17, False: 368]
  ------------------
  585|     17|                return;
  586|    368|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    368|#define ID_CPE 0x1
  ------------------
  587|    368|            if (hInfo->error > 0)
  ------------------
  |  Branch (587:17): [True: 7, False: 361]
  ------------------
  588|      7|                return;
  589|    361|            break;
  590|    361|        case 6:
  ------------------
  |  Branch (590:9): [True: 95, False: 2.22k]
  ------------------
  591|     95|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|     95|#define ID_SCE 0x0
  ------------------
  592|     95|            if (hInfo->error > 0)
  ------------------
  |  Branch (592:17): [True: 19, False: 76]
  ------------------
  593|     19|                return;
  594|     76|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|     76|#define ID_CPE 0x1
  ------------------
  595|     76|            if (hInfo->error > 0)
  ------------------
  |  Branch (595:17): [True: 6, False: 70]
  ------------------
  596|      6|                return;
  597|     70|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|     70|#define ID_CPE 0x1
  ------------------
  598|     70|            if (hInfo->error > 0)
  ------------------
  |  Branch (598:17): [True: 5, False: 65]
  ------------------
  599|      5|                return;
  600|     65|            decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
  ------------------
  |  |   89|     65|#define ID_LFE 0x3
  ------------------
  601|     65|            if (hInfo->error > 0)
  ------------------
  |  Branch (601:17): [True: 11, False: 54]
  ------------------
  602|     11|                return;
  603|     54|            break;
  604|    283|        case 7: /* 8 channels */
  ------------------
  |  Branch (604:9): [True: 283, False: 2.03k]
  ------------------
  605|    283|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    283|#define ID_SCE 0x0
  ------------------
  606|    283|            if (hInfo->error > 0)
  ------------------
  |  Branch (606:17): [True: 27, False: 256]
  ------------------
  607|     27|                return;
  608|    256|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    256|#define ID_CPE 0x1
  ------------------
  609|    256|            if (hInfo->error > 0)
  ------------------
  |  Branch (609:17): [True: 25, False: 231]
  ------------------
  610|     25|                return;
  611|    231|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    231|#define ID_CPE 0x1
  ------------------
  612|    231|            if (hInfo->error > 0)
  ------------------
  |  Branch (612:17): [True: 10, False: 221]
  ------------------
  613|     10|                return;
  614|    221|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    221|#define ID_CPE 0x1
  ------------------
  615|    221|            if (hInfo->error > 0)
  ------------------
  |  Branch (615:17): [True: 22, False: 199]
  ------------------
  616|     22|                return;
  617|    199|            decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
  ------------------
  |  |   89|    199|#define ID_LFE 0x3
  ------------------
  618|    199|            if (hInfo->error > 0)
  ------------------
  |  Branch (618:17): [True: 9, False: 190]
  ------------------
  619|      9|                return;
  620|    190|            break;
  621|    190|        default:
  ------------------
  |  Branch (621:9): [True: 3, False: 2.31k]
  ------------------
  622|      3|            hInfo->error = 7;
  623|      3|            return;
  624|  2.32k|        }
  625|       |#if 0
  626|       |        cnt = bits_to_decode() / 8;
  627|       |        while (cnt >= 1)
  628|       |        {
  629|       |            cnt -= extension_payload(cnt);
  630|       |        }
  631|       |#endif
  632|  2.32k|    }
  633|  2.25k|#endif
  634|       |
  635|       |    /* new in corrigendum 14496-3:2002 */
  636|  2.25k|#ifdef DRM
  637|  2.25k|    if (hDecoder->object_type != DRM_ER_LC
  ------------------
  |  |   48|  2.25k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (637:9): [True: 2.25k, False: 0]
  ------------------
  638|       |#if 0
  639|       |        && !hDecoder->latm_header_present
  640|       |#endif
  641|  2.25k|        )
  642|  2.25k|#endif
  643|  2.25k|    {
  644|  2.25k|        faad_byte_align(ld);
  645|  2.25k|    }
  646|       |
  647|  2.25k|    return;
  648|  6.57k|}
DRM_aac_scalable_main_element:
 1299|    691|{
 1300|    691|    uint8_t channels = hDecoder->fr_channels = 0;
 1301|    691|    uint8_t this_layer_stereo = (hDecoder->channelConfiguration > 1) ? 1 : 0;
  ------------------
  |  Branch (1301:33): [True: 235, False: 456]
  ------------------
 1302|    691|    element cpe = {0};
 1303|    691|    ic_stream *ics1 = &(cpe.ics1);
 1304|    691|    ic_stream *ics2 = &(cpe.ics2);
 1305|    691|    ALIGN int16_t spec_data1[1024] = {0};
 1306|    691|    ALIGN int16_t spec_data2[1024] = {0};
 1307|       |
 1308|    691|    (void)drc;  /* TODO: remove unused parameter? */
 1309|    691|    (void)pce;  /* TODO: remove unused parameter? */
 1310|       |
 1311|    691|    hDecoder->fr_ch_ele = 0;
 1312|       |
 1313|    691|    hInfo->error = DRM_aac_scalable_main_header(hDecoder, ics1, ics2, ld, this_layer_stereo);
 1314|    691|    if (hInfo->error > 0)
  ------------------
  |  Branch (1314:9): [True: 24, False: 667]
  ------------------
 1315|     24|        return;
 1316|       |
 1317|    667|    cpe.common_window = 1;
 1318|    667|    if (this_layer_stereo)
  ------------------
  |  Branch (1318:9): [True: 220, False: 447]
  ------------------
 1319|    220|    {
 1320|    220|        hDecoder->element_id[0] = ID_CPE;
  ------------------
  |  |   87|    220|#define ID_CPE 0x1
  ------------------
 1321|    220|        if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
  ------------------
  |  Branch (1321:13): [True: 156, False: 64]
  ------------------
 1322|    156|            hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
 1323|    447|    } else {
 1324|    447|        hDecoder->element_id[0] = ID_SCE;
  ------------------
  |  |   86|    447|#define ID_SCE 0x0
  ------------------
 1325|    447|    }
 1326|       |
 1327|    667|    if (this_layer_stereo)
  ------------------
  |  Branch (1327:9): [True: 220, False: 447]
  ------------------
 1328|    220|    {
 1329|    220|        cpe.channel        = 0;
 1330|    220|        cpe.paired_channel = 1;
 1331|    220|    }
 1332|       |
 1333|       |
 1334|       |    /* Stereo2 / Mono1 */
 1335|    667|    ics1->tns_data_present = faad_get1bit(ld);
 1336|       |
 1337|       |#if defined(LTP_DEC)
 1338|       |    ics1->ltp.data_present = faad_get1bit(ld);
 1339|       |#elif defined (DRM)
 1340|    667|    if(faad_get1bit(ld)) {
  ------------------
  |  Branch (1340:8): [True: 8, False: 659]
  ------------------
 1341|      8|         hInfo->error = 26;
 1342|      8|         return;
 1343|      8|    }
 1344|       |#else
 1345|       |    faad_get1bit(ld);
 1346|       |#endif
 1347|       |
 1348|    659|    hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1);
 1349|    659|    if (hInfo->error > 0)
  ------------------
  |  Branch (1349:9): [True: 71, False: 588]
  ------------------
 1350|     71|        return;
 1351|    588|    if (this_layer_stereo)
  ------------------
  |  Branch (1351:9): [True: 172, False: 416]
  ------------------
 1352|    172|    {
 1353|       |        /* Stereo3 */
 1354|    172|        ics2->tns_data_present = faad_get1bit(ld);
 1355|       |#ifdef LTP_DEC
 1356|       |        ics1->ltp.data_present =
 1357|       |#endif
 1358|    172|            faad_get1bit(ld);
 1359|    172|        hInfo->error = side_info(hDecoder, &cpe, ld, ics2, 1);
 1360|    172|        if (hInfo->error > 0)
  ------------------
  |  Branch (1360:13): [True: 28, False: 144]
  ------------------
 1361|     28|            return;
 1362|    172|    }
 1363|       |    /* Stereo4 / Mono2 */
 1364|    560|    if (ics1->tns_data_present)
  ------------------
  |  Branch (1364:9): [True: 92, False: 468]
  ------------------
 1365|     92|        tns_data(ics1, &(ics1->tns), ld);
 1366|    560|    if (this_layer_stereo)
  ------------------
  |  Branch (1366:9): [True: 144, False: 416]
  ------------------
 1367|    144|    {
 1368|       |        /* Stereo5 */
 1369|    144|        if (ics2->tns_data_present)
  ------------------
  |  Branch (1369:13): [True: 69, False: 75]
  ------------------
 1370|     69|            tns_data(ics2, &(ics2->tns), ld);
 1371|    144|    }
 1372|       |
 1373|    560|#ifdef DRM
 1374|       |    /* CRC check */
 1375|    560|    if (hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|    560|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (1375:9): [True: 560, False: 0]
  ------------------
 1376|    560|    {
 1377|    560|        if ((hInfo->error = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0)
  ------------------
  |  Branch (1377:13): [True: 137, False: 423]
  ------------------
 1378|    137|            return;
 1379|    560|    }
 1380|    423|#endif
 1381|       |
 1382|       |    /* Stereo6 / Mono3 */
 1383|       |    /* error resilient spectral data decoding */
 1384|    423|    if ((hInfo->error = reordered_spectral_data(hDecoder, ics1, ld, spec_data1)) > 0)
  ------------------
  |  Branch (1384:9): [True: 15, False: 408]
  ------------------
 1385|     15|    {
 1386|     15|        return;
 1387|     15|    }
 1388|    408|    if (this_layer_stereo)
  ------------------
  |  Branch (1388:9): [True: 50, False: 358]
  ------------------
 1389|     50|    {
 1390|       |        /* Stereo7 */
 1391|       |        /* error resilient spectral data decoding */
 1392|     50|        if ((hInfo->error = reordered_spectral_data(hDecoder, ics2, ld, spec_data2)) > 0)
  ------------------
  |  Branch (1392:13): [True: 3, False: 47]
  ------------------
 1393|      3|        {
 1394|      3|            return;
 1395|      3|        }
 1396|     50|    }
 1397|       |
 1398|       |
 1399|    405|#ifdef DRM
 1400|    405|#ifdef SBR_DEC
 1401|       |    /* In case of DRM we need to read the SBR info before channel reconstruction */
 1402|    405|    if ((hDecoder->sbr_present_flag == 1) && (hDecoder->object_type == DRM_ER_LC))
  ------------------
  |  |   48|    375|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (1402:9): [True: 375, False: 30]
  |  Branch (1402:46): [True: 375, False: 0]
  ------------------
 1403|    375|    {
 1404|    375|        bitfile ld_sbr = {0};
 1405|    375|        uint32_t i;
 1406|    375|        uint16_t count = 0;
 1407|    375|        uint8_t *revbuffer;
 1408|    375|        uint8_t *prevbufstart;
 1409|    375|        uint8_t *pbufend;
 1410|       |
 1411|       |        /* all forward bitreading should be finished at this point */
 1412|    375|        uint32_t bitsconsumed = faad_get_processed_bits(ld);
 1413|    375|        uint32_t buffer_size = faad_origbitbuffer_size(ld);
 1414|    375|        uint8_t *buffer = (uint8_t*)faad_origbitbuffer(ld);
 1415|       |
 1416|    375|        if (bitsconsumed + 8 > buffer_size*8)
  ------------------
  |  Branch (1416:13): [True: 69, False: 306]
  ------------------
 1417|     69|        {
 1418|     69|            hInfo->error = 14;
 1419|     69|            return;
 1420|     69|        }
 1421|       |
 1422|    306|        if (!hDecoder->sbr[0])
  ------------------
  |  Branch (1422:13): [True: 216, False: 90]
  ------------------
 1423|    216|        {
 1424|    216|            hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
 1425|    216|                2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
 1426|    216|        }
 1427|    306|        if (!hDecoder->sbr[0])
  ------------------
  |  Branch (1427:13): [True: 0, False: 306]
  ------------------
 1428|      0|        {
 1429|      0|            hInfo->error = 19;
 1430|      0|            return;
 1431|      0|        }
 1432|       |
 1433|       |        /* Reverse bit reading of SBR data in DRM audio frame */
 1434|    306|        revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));
 1435|    306|        prevbufstart = revbuffer;
 1436|    306|        pbufend = &buffer[buffer_size - 1];
 1437|  5.09M|        for (i = 0; i < buffer_size; i++)
  ------------------
  |  Branch (1437:21): [True: 5.09M, False: 306]
  ------------------
 1438|  5.09M|            *prevbufstart++ = reverse_byte(*pbufend--);
 1439|       |
 1440|       |        /* Set SBR data */
 1441|       |        /* consider 8 bits from AAC-CRC */
 1442|       |        /* SBR buffer size is original buffer size minus AAC buffer size */
 1443|    306|        count = (uint16_t)bit2byte(buffer_size*8 - bitsconsumed);
  ------------------
  |  |   46|    306|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|    306|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
 1444|    306|        faad_initbits(&ld_sbr, revbuffer, count);
 1445|       |
 1446|    306|        hDecoder->sbr[0]->sample_rate = get_sample_rate(hDecoder->sf_index);
 1447|    306|        hDecoder->sbr[0]->sample_rate *= 2;
 1448|       |
 1449|    306|        faad_getbits(&ld_sbr, 8); /* Skip 8-bit CRC */
 1450|       |
 1451|    306|        hDecoder->sbr[0]->ret = sbr_extension_data(&ld_sbr, hDecoder->sbr[0], count, hDecoder->postSeekResetFlag);
 1452|    306|#if (defined(PS_DEC) || defined(DRM_PS))
 1453|    306|        if (hDecoder->sbr[0]->ps_used)
  ------------------
  |  Branch (1453:13): [True: 208, False: 98]
  ------------------
 1454|    208|        {
 1455|    208|            hDecoder->ps_used[0] = 1;
 1456|    208|            hDecoder->ps_used_global = 1;
 1457|    208|        }
 1458|    306|#endif
 1459|       |
 1460|    306|        if (ld_sbr.error)
  ------------------
  |  Branch (1460:13): [True: 3, False: 303]
  ------------------
 1461|      3|        {
 1462|      3|            hDecoder->sbr[0]->ret = 1;
 1463|      3|        }
 1464|       |
 1465|       |        /* check CRC */
 1466|       |        /* no need to check it if there was already an error */
 1467|    306|        if (hDecoder->sbr[0]->ret == 0)
  ------------------
  |  Branch (1467:13): [True: 153, False: 153]
  ------------------
 1468|    153|            hDecoder->sbr[0]->ret = (uint8_t)faad_check_CRC(&ld_sbr, (uint16_t)faad_get_processed_bits(&ld_sbr) - 8);
 1469|       |
 1470|       |        /* SBR data was corrupted, disable it until the next header */
 1471|    306|        if (hDecoder->sbr[0]->ret != 0)
  ------------------
  |  Branch (1471:13): [True: 186, False: 120]
  ------------------
 1472|    186|        {
 1473|    186|            hDecoder->sbr[0]->header_count = 0;
 1474|    186|        }
 1475|       |
 1476|    306|        faad_endbits(&ld_sbr);
 1477|       |
 1478|    306|        if (revbuffer)
  ------------------
  |  Branch (1478:13): [True: 306, False: 0]
  ------------------
 1479|    306|            faad_free(revbuffer);
 1480|    306|    }
 1481|    336|#endif
 1482|    336|#endif
 1483|       |
 1484|    336|    if (this_layer_stereo)
  ------------------
  |  Branch (1484:9): [True: 47, False: 289]
  ------------------
 1485|     47|    {
 1486|     47|        hInfo->error = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe, spec_data1, spec_data2);
 1487|     47|        if (hInfo->error > 0)
  ------------------
  |  Branch (1487:13): [True: 5, False: 42]
  ------------------
 1488|      5|            return;
 1489|    289|    } else {
 1490|    289|        hInfo->error = reconstruct_single_channel(hDecoder, ics1, &cpe, spec_data1);
 1491|    289|        if (hInfo->error > 0)
  ------------------
  |  Branch (1491:13): [True: 2, False: 287]
  ------------------
 1492|      2|            return;
 1493|    289|    }
 1494|       |
 1495|       |    /* map output channels position to internal data channels */
 1496|    329|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
  ------------------
  |  Branch (1496:9): [True: 329, False: 0]
  ------------------
 1497|    329|    {
 1498|       |        /* this might be faulty when pce_set is true */
 1499|    329|        hDecoder->internal_channel[channels] = channels;
 1500|    329|        hDecoder->internal_channel[channels+1] = channels+1;
 1501|    329|    } else {
 1502|      0|        hDecoder->internal_channel[channels] = channels;
 1503|      0|    }
 1504|       |
 1505|    329|    hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
 1506|    329|    hDecoder->fr_ch_ele++;
 1507|       |
 1508|    329|    return;
 1509|    336|}
get_adif_header:
 2401|    109|{
 2402|    109|    uint8_t i;
 2403|       |
 2404|       |    /* adif_id[0] = */ faad_getbits(ld, 8
 2405|    109|        DEBUGVAR(1,106,"get_adif_header(): adif_id[0]"));
 2406|    109|    /* adif_id[1] = */ faad_getbits(ld, 8
 2407|    109|        DEBUGVAR(1,107,"get_adif_header(): adif_id[1]"));
 2408|    109|    /* adif_id[2] = */ faad_getbits(ld, 8
 2409|    109|        DEBUGVAR(1,108,"get_adif_header(): adif_id[2]"));
 2410|    109|    /* adif_id[3] = */ faad_getbits(ld, 8
 2411|    109|        DEBUGVAR(1,109,"get_adif_header(): adif_id[3]"));
 2412|    109|    adif->copyright_id_present = faad_get1bit(ld
 2413|    109|        DEBUGVAR(1,110,"get_adif_header(): copyright_id_present"));
 2414|    109|    if(adif->copyright_id_present)
  ------------------
  |  Branch (2414:8): [True: 19, False: 90]
  ------------------
 2415|     19|    {
 2416|    190|        for (i = 0; i < 72/8; i++)
  ------------------
  |  Branch (2416:21): [True: 171, False: 19]
  ------------------
 2417|    171|        {
 2418|    171|            adif->copyright_id[i] = (int8_t)faad_getbits(ld, 8
 2419|    171|                DEBUGVAR(1,111,"get_adif_header(): copyright_id"));
 2420|    171|        }
 2421|     19|        adif->copyright_id[i] = 0;
 2422|     19|    }
 2423|    109|    adif->original_copy  = faad_get1bit(ld
 2424|    109|        DEBUGVAR(1,112,"get_adif_header(): original_copy"));
 2425|    109|    adif->home = faad_get1bit(ld
 2426|    109|        DEBUGVAR(1,113,"get_adif_header(): home"));
 2427|    109|    adif->bitstream_type = faad_get1bit(ld
 2428|    109|        DEBUGVAR(1,114,"get_adif_header(): bitstream_type"));
 2429|    109|    adif->bitrate = faad_getbits(ld, 23
 2430|    109|        DEBUGVAR(1,115,"get_adif_header(): bitrate"));
 2431|    109|    adif->num_program_config_elements = (uint8_t)faad_getbits(ld, 4
 2432|    109|        DEBUGVAR(1,116,"get_adif_header(): num_program_config_elements"));
 2433|       |
 2434|  1.38k|    for (i = 0; i < adif->num_program_config_elements + 1; i++)
  ------------------
  |  Branch (2434:17): [True: 1.27k, False: 109]
  ------------------
 2435|  1.27k|    {
 2436|  1.27k|        if(adif->bitstream_type == 0)
  ------------------
  |  Branch (2436:12): [True: 474, False: 804]
  ------------------
 2437|    474|        {
 2438|    474|            adif->adif_buffer_fullness = faad_getbits(ld, 20
 2439|    474|                DEBUGVAR(1,117,"get_adif_header(): adif_buffer_fullness"));
 2440|    804|        } else {
 2441|    804|            adif->adif_buffer_fullness = 0;
 2442|    804|        }
 2443|       |
 2444|  1.27k|        program_config_element(&adif->pce[i], ld);
 2445|  1.27k|    }
 2446|    109|}
adts_frame:
 2450|  4.11k|{
 2451|       |    /* faad_byte_align(ld); */
 2452|  4.11k|    if (adts_fixed_header(adts, ld))
  ------------------
  |  Branch (2452:9): [True: 3.91k, False: 202]
  ------------------
 2453|  3.91k|        return 5;
 2454|    202|    adts_variable_header(adts, ld);
 2455|    202|    adts_error_check(adts, ld);
 2456|       |
 2457|    202|    return 0;
 2458|  4.11k|}
syntax.c:program_config_element:
  175|  1.86k|{
  176|  1.86k|    uint8_t i;
  177|       |
  178|  1.86k|    memset(pce, 0, sizeof(program_config));
  179|       |
  180|  1.86k|    pce->channels = 0;
  181|       |
  182|  1.86k|    pce->element_instance_tag = (uint8_t)faad_getbits(ld, 4
  183|  1.86k|        DEBUGVAR(1,10,"program_config_element(): element_instance_tag"));
  184|       |
  185|  1.86k|    pce->object_type = (uint8_t)faad_getbits(ld, 2
  186|  1.86k|        DEBUGVAR(1,11,"program_config_element(): object_type"));
  187|  1.86k|    pce->sf_index = (uint8_t)faad_getbits(ld, 4
  188|  1.86k|        DEBUGVAR(1,12,"program_config_element(): sf_index"));
  189|  1.86k|    pce->num_front_channel_elements = (uint8_t)faad_getbits(ld, 4
  190|  1.86k|        DEBUGVAR(1,13,"program_config_element(): num_front_channel_elements"));
  191|  1.86k|    pce->num_side_channel_elements = (uint8_t)faad_getbits(ld, 4
  192|  1.86k|        DEBUGVAR(1,14,"program_config_element(): num_side_channel_elements"));
  193|  1.86k|    pce->num_back_channel_elements = (uint8_t)faad_getbits(ld, 4
  194|  1.86k|        DEBUGVAR(1,15,"program_config_element(): num_back_channel_elements"));
  195|  1.86k|    pce->num_lfe_channel_elements = (uint8_t)faad_getbits(ld, 2
  196|  1.86k|        DEBUGVAR(1,16,"program_config_element(): num_lfe_channel_elements"));
  197|  1.86k|    pce->num_assoc_data_elements = (uint8_t)faad_getbits(ld, 3
  198|  1.86k|        DEBUGVAR(1,17,"program_config_element(): num_assoc_data_elements"));
  199|  1.86k|    pce->num_valid_cc_elements = (uint8_t)faad_getbits(ld, 4
  200|  1.86k|        DEBUGVAR(1,18,"program_config_element(): num_valid_cc_elements"));
  201|       |
  202|  1.86k|    pce->mono_mixdown_present = faad_get1bit(ld
  203|  1.86k|        DEBUGVAR(1,19,"program_config_element(): mono_mixdown_present"));
  204|  1.86k|    if (pce->mono_mixdown_present == 1)
  ------------------
  |  Branch (204:9): [True: 390, False: 1.47k]
  ------------------
  205|    390|    {
  206|    390|        pce->mono_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
  207|    390|            DEBUGVAR(1,20,"program_config_element(): mono_mixdown_element_number"));
  208|    390|    }
  209|       |
  210|  1.86k|    pce->stereo_mixdown_present = faad_get1bit(ld
  211|  1.86k|        DEBUGVAR(1,21,"program_config_element(): stereo_mixdown_present"));
  212|  1.86k|    if (pce->stereo_mixdown_present == 1)
  ------------------
  |  Branch (212:9): [True: 299, False: 1.56k]
  ------------------
  213|    299|    {
  214|    299|        pce->stereo_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
  215|    299|            DEBUGVAR(1,22,"program_config_element(): stereo_mixdown_element_number"));
  216|    299|    }
  217|       |
  218|  1.86k|    pce->matrix_mixdown_idx_present = faad_get1bit(ld
  219|  1.86k|        DEBUGVAR(1,23,"program_config_element(): matrix_mixdown_idx_present"));
  220|  1.86k|    if (pce->matrix_mixdown_idx_present == 1)
  ------------------
  |  Branch (220:9): [True: 332, False: 1.53k]
  ------------------
  221|    332|    {
  222|    332|        pce->matrix_mixdown_idx = (uint8_t)faad_getbits(ld, 2
  223|    332|            DEBUGVAR(1,24,"program_config_element(): matrix_mixdown_idx"));
  224|    332|        pce->pseudo_surround_enable = faad_get1bit(ld
  225|    332|            DEBUGVAR(1,25,"program_config_element(): pseudo_surround_enable"));
  226|    332|    }
  227|       |
  228|  7.32k|    for (i = 0; i < pce->num_front_channel_elements; i++)
  ------------------
  |  Branch (228:17): [True: 5.45k, False: 1.86k]
  ------------------
  229|  5.45k|    {
  230|  5.45k|        pce->front_element_is_cpe[i] = faad_get1bit(ld
  231|  5.45k|            DEBUGVAR(1,26,"program_config_element(): front_element_is_cpe"));
  232|  5.45k|        pce->front_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  233|  5.45k|            DEBUGVAR(1,27,"program_config_element(): front_element_tag_select"));
  234|       |
  235|  5.45k|        if (pce->front_element_is_cpe[i] & 1)
  ------------------
  |  Branch (235:13): [True: 1.73k, False: 3.71k]
  ------------------
  236|  1.73k|        {
  237|  1.73k|            pce->cpe_channel[pce->front_element_tag_select[i]] = pce->channels;
  238|  1.73k|            pce->num_front_channels += 2;
  239|  1.73k|            pce->channels += 2;
  240|  3.71k|        } else {
  241|  3.71k|            pce->sce_channel[pce->front_element_tag_select[i]] = pce->channels;
  242|  3.71k|            pce->num_front_channels++;
  243|  3.71k|            pce->channels++;
  244|  3.71k|        }
  245|  5.45k|    }
  246|       |
  247|  7.35k|    for (i = 0; i < pce->num_side_channel_elements; i++)
  ------------------
  |  Branch (247:17): [True: 5.48k, False: 1.86k]
  ------------------
  248|  5.48k|    {
  249|  5.48k|        pce->side_element_is_cpe[i] = faad_get1bit(ld
  250|  5.48k|            DEBUGVAR(1,28,"program_config_element(): side_element_is_cpe"));
  251|  5.48k|        pce->side_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  252|  5.48k|            DEBUGVAR(1,29,"program_config_element(): side_element_tag_select"));
  253|       |
  254|  5.48k|        if (pce->side_element_is_cpe[i] & 1)
  ------------------
  |  Branch (254:13): [True: 1.42k, False: 4.05k]
  ------------------
  255|  1.42k|        {
  256|  1.42k|            pce->cpe_channel[pce->side_element_tag_select[i]] = pce->channels;
  257|  1.42k|            pce->num_side_channels += 2;
  258|  1.42k|            pce->channels += 2;
  259|  4.05k|        } else {
  260|  4.05k|            pce->sce_channel[pce->side_element_tag_select[i]] = pce->channels;
  261|  4.05k|            pce->num_side_channels++;
  262|  4.05k|            pce->channels++;
  263|  4.05k|        }
  264|  5.48k|    }
  265|       |
  266|  6.80k|    for (i = 0; i < pce->num_back_channel_elements; i++)
  ------------------
  |  Branch (266:17): [True: 4.94k, False: 1.86k]
  ------------------
  267|  4.94k|    {
  268|  4.94k|        pce->back_element_is_cpe[i] = faad_get1bit(ld
  269|  4.94k|            DEBUGVAR(1,30,"program_config_element(): back_element_is_cpe"));
  270|  4.94k|        pce->back_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  271|  4.94k|            DEBUGVAR(1,31,"program_config_element(): back_element_tag_select"));
  272|       |
  273|  4.94k|        if (pce->back_element_is_cpe[i] & 1)
  ------------------
  |  Branch (273:13): [True: 1.45k, False: 3.48k]
  ------------------
  274|  1.45k|        {
  275|  1.45k|            pce->cpe_channel[pce->back_element_tag_select[i]] = pce->channels;
  276|  1.45k|            pce->channels += 2;
  277|  1.45k|            pce->num_back_channels += 2;
  278|  3.48k|        } else {
  279|  3.48k|            pce->sce_channel[pce->back_element_tag_select[i]] = pce->channels;
  280|  3.48k|            pce->num_back_channels++;
  281|  3.48k|            pce->channels++;
  282|  3.48k|        }
  283|  4.94k|    }
  284|       |
  285|  2.94k|    for (i = 0; i < pce->num_lfe_channel_elements; i++)
  ------------------
  |  Branch (285:17): [True: 1.07k, False: 1.86k]
  ------------------
  286|  1.07k|    {
  287|  1.07k|        pce->lfe_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  288|  1.07k|            DEBUGVAR(1,32,"program_config_element(): lfe_element_tag_select"));
  289|       |
  290|  1.07k|        pce->sce_channel[pce->lfe_element_tag_select[i]] = pce->channels;
  291|  1.07k|        pce->num_lfe_channels++;
  292|  1.07k|        pce->channels++;
  293|  1.07k|    }
  294|       |
  295|  3.68k|    for (i = 0; i < pce->num_assoc_data_elements; i++)
  ------------------
  |  Branch (295:17): [True: 1.81k, False: 1.86k]
  ------------------
  296|  1.81k|        pce->assoc_data_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  297|  1.81k|        DEBUGVAR(1,33,"program_config_element(): assoc_data_element_tag_select"));
  298|       |
  299|  6.06k|    for (i = 0; i < pce->num_valid_cc_elements; i++)
  ------------------
  |  Branch (299:17): [True: 4.19k, False: 1.86k]
  ------------------
  300|  4.19k|    {
  301|  4.19k|        pce->cc_element_is_ind_sw[i] = faad_get1bit(ld
  302|  4.19k|            DEBUGVAR(1,34,"program_config_element(): cc_element_is_ind_sw"));
  303|  4.19k|        pce->valid_cc_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  304|  4.19k|            DEBUGVAR(1,35,"program_config_element(): valid_cc_element_tag_select"));
  305|  4.19k|    }
  306|       |
  307|  1.86k|    faad_byte_align(ld);
  308|       |
  309|  1.86k|    pce->comment_field_bytes = (uint8_t)faad_getbits(ld, 8
  310|  1.86k|        DEBUGVAR(1,36,"program_config_element(): comment_field_bytes"));
  311|       |
  312|  21.0k|    for (i = 0; i < pce->comment_field_bytes; i++)
  ------------------
  |  Branch (312:17): [True: 19.1k, False: 1.86k]
  ------------------
  313|  19.1k|    {
  314|  19.1k|        pce->comment_field_data[i] = (uint8_t)faad_getbits(ld, 8
  315|  19.1k|            DEBUGVAR(1,37,"program_config_element(): comment_field_data"));
  316|  19.1k|    }
  317|  1.86k|    pce->comment_field_data[i] = 0;
  318|       |
  319|  1.86k|    if (pce->channels > MAX_CHANNELS)
  ------------------
  |  |   43|  1.86k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (319:9): [True: 72, False: 1.79k]
  ------------------
  320|     72|        return 22;
  321|       |
  322|  1.79k|    return 0;
  323|  1.86k|}
syntax.c:decode_sce_lfe:
  328|  78.7k|{
  329|  78.7k|    uint8_t channels = hDecoder->fr_channels;
  330|  78.7k|    uint8_t tag = 0;
  331|       |
  332|       |    /* One or two channels are used;
  333|       |       exact number will be known after single_lfe_channel_element
  334|       |    */
  335|  78.7k|    if (channels+2 > MAX_CHANNELS)
  ------------------
  |  |   43|  78.7k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (335:9): [True: 2.22k, False: 76.4k]
  ------------------
  336|  2.22k|    {
  337|  2.22k|        hInfo->error = 12;
  338|  2.22k|        return;
  339|  2.22k|    }
  340|  76.4k|    if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
  ------------------
  |  |   44|  76.4k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (340:9): [True: 0, False: 76.4k]
  ------------------
  341|      0|    {
  342|      0|        hInfo->error = 13;
  343|      0|        return;
  344|      0|    }
  345|       |
  346|       |    /* for SCE hDecoder->element_output_channels[] is not set here because this
  347|       |       can become 2 when some form of Parametric Stereo coding is used
  348|       |    */
  349|       |
  350|  76.4k|    if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID &&
  ------------------
  |  |   94|   152k|#define INVALID_ELEMENT_ID 255
  ------------------
  |  Branch (350:9): [True: 11.5k, False: 64.9k]
  ------------------
  351|  11.5k|        hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele)
  ------------------
  |  Branch (351:9): [True: 77, False: 11.5k]
  ------------------
  352|     77|    {
  353|       |        /* element inconsistency */
  354|     77|        hInfo->error = 21;
  355|     77|        return;
  356|     77|    }
  357|       |
  358|       |    /* save the syntax element id */
  359|  76.4k|    hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
  360|       |
  361|       |    /* decode the element */
  362|  76.4k|    hInfo->error = single_lfe_channel_element(hDecoder, ld, channels, &tag);
  363|       |
  364|       |    /* map output channels position to internal data channels */
  365|  76.4k|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
  ------------------
  |  Branch (365:9): [True: 75.7k, False: 638]
  ------------------
  366|  75.7k|    {
  367|       |        /* this might be faulty when pce_set is true */
  368|  75.7k|        hDecoder->internal_channel[channels] = channels;
  369|  75.7k|        hDecoder->internal_channel[channels+1] = channels+1;
  370|  75.7k|    } else {
  371|    638|        if (hDecoder->pce_set)
  ------------------
  |  Branch (371:13): [True: 54, False: 584]
  ------------------
  372|     54|        {
  373|     54|            if (hDecoder->pce.channels > MAX_CHANNELS)
  ------------------
  |  |   43|     54|#define MAX_CHANNELS        64
  ------------------
  |  Branch (373:17): [True: 3, False: 51]
  ------------------
  374|      3|            {
  375|      3|                hInfo->error = 22;
  376|      3|                return;
  377|      3|            }
  378|     51|            hDecoder->internal_channel[hDecoder->pce.sce_channel[tag]] = channels;
  379|    584|        } else {
  380|    584|            hDecoder->internal_channel[channels] = channels;
  381|    584|        }
  382|    638|    }
  383|       |
  384|  76.4k|    hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
  385|  76.4k|    hDecoder->fr_ch_ele++;
  386|  76.4k|}
syntax.c:single_lfe_channel_element:
  654|  76.4k|{
  655|  76.4k|    uint8_t retval = 0;
  656|  76.4k|    element sce = {0};
  657|  76.4k|    ic_stream *ics = &(sce.ics1);
  658|  76.4k|    ALIGN int16_t spec_data[1024] = {0};
  659|       |
  660|  76.4k|    sce.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
  ------------------
  |  |   76|  76.4k|#define LEN_TAG   4
  ------------------
  661|  76.4k|        DEBUGVAR(1,38,"single_lfe_channel_element(): element_instance_tag"));
  662|       |
  663|  76.4k|    *tag = sce.element_instance_tag;
  664|  76.4k|    sce.channel = channel;
  665|  76.4k|    sce.paired_channel = -1;
  666|       |
  667|  76.4k|    retval = individual_channel_stream(hDecoder, &sce, ld, ics, 0, spec_data);
  668|  76.4k|    if (retval > 0)
  ------------------
  |  Branch (668:9): [True: 579, False: 75.8k]
  ------------------
  669|    579|        return retval;
  670|       |
  671|       |    /* IS not allowed in single channel */
  672|  75.8k|    if (ics->is_used)
  ------------------
  |  Branch (672:9): [True: 100, False: 75.7k]
  ------------------
  673|    100|        return 32;
  674|       |
  675|  75.7k|#ifdef SBR_DEC
  676|       |    /* check if next bitstream element is a fill element */
  677|       |    /* if so, read it now so SBR decoding can be done in case of a file with SBR */
  678|  75.7k|    if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   75|  75.7k|#define LEN_SE_ID 3
  ------------------
                  if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   92|  75.7k|#define ID_FIL 0x6
  ------------------
  |  Branch (678:9): [True: 11.5k, False: 64.2k]
  ------------------
  679|  11.5k|    {
  680|  11.5k|        faad_flushbits(ld, LEN_SE_ID);
  ------------------
  |  |   75|  11.5k|#define LEN_SE_ID 3
  ------------------
  681|       |
  682|       |        /* one sbr_info describes a channel_element not a channel! */
  683|  11.5k|        if ((retval = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
  ------------------
  |  Branch (683:13): [True: 36, False: 11.4k]
  ------------------
  684|     36|        {
  685|     36|            return retval;
  686|     36|        }
  687|  11.5k|    }
  688|  75.7k|#endif
  689|       |
  690|       |    /* noiseless coding is done, spectral reconstruction is done now */
  691|  75.7k|    retval = reconstruct_single_channel(hDecoder, ics, &sce, spec_data);
  692|  75.7k|    if (retval > 0)
  ------------------
  |  Branch (692:9): [True: 80, False: 75.6k]
  ------------------
  693|     80|        return retval;
  694|       |
  695|  75.6k|    return 0;
  696|  75.7k|}
syntax.c:individual_channel_stream:
 1674|   112k|{
 1675|   112k|    uint8_t result;
 1676|       |
 1677|   112k|    result = side_info(hDecoder, ele, ld, ics, scal_flag);
 1678|   112k|    if (result > 0)
  ------------------
  |  Branch (1678:9): [True: 951, False: 111k]
  ------------------
 1679|    951|        return result;
 1680|       |
 1681|   111k|    if (hDecoder->object_type >= ER_OBJECT_START)
  ------------------
  |  |   71|   111k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (1681:9): [True: 7.36k, False: 103k]
  ------------------
 1682|  7.36k|    {
 1683|  7.36k|        if (ics->tns_data_present)
  ------------------
  |  Branch (1683:13): [True: 301, False: 7.06k]
  ------------------
 1684|    301|            tns_data(ics, &(ics->tns), ld);
 1685|  7.36k|    }
 1686|       |
 1687|   111k|#ifdef DRM
 1688|       |    /* CRC check */
 1689|   111k|    if (hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|   111k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (1689:9): [True: 0, False: 111k]
  ------------------
 1690|      0|    {
 1691|      0|        if ((result = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0)
  ------------------
  |  Branch (1691:13): [True: 0, False: 0]
  ------------------
 1692|      0|            return result;
 1693|      0|    }
 1694|   111k|#endif
 1695|       |
 1696|   111k|#ifdef ERROR_RESILIENCE
 1697|   111k|    if (hDecoder->aacSpectralDataResilienceFlag)
  ------------------
  |  Branch (1697:9): [True: 3.05k, False: 108k]
  ------------------
 1698|  3.05k|    {
 1699|       |        /* error resilient spectral data decoding */
 1700|  3.05k|        if ((result = reordered_spectral_data(hDecoder, ics, ld, spec_data)) > 0)
  ------------------
  |  Branch (1700:13): [True: 59, False: 2.99k]
  ------------------
 1701|     59|        {
 1702|     59|            return result;
 1703|     59|        }
 1704|   108k|    } else {
 1705|   108k|#endif
 1706|       |        /* decode the spectral data */
 1707|   108k|        if ((result = spectral_data(hDecoder, ics, ld, spec_data)) > 0)
  ------------------
  |  Branch (1707:13): [True: 50, False: 108k]
  ------------------
 1708|     50|        {
 1709|     50|            return result;
 1710|     50|        }
 1711|   108k|#ifdef ERROR_RESILIENCE
 1712|   108k|    }
 1713|   111k|#endif
 1714|       |
 1715|       |    /* pulse coding reconstruction */
 1716|   111k|    if (ics->pulse_data_present)
  ------------------
  |  Branch (1716:9): [True: 5.75k, False: 105k]
  ------------------
 1717|  5.75k|    {
 1718|  5.75k|        if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  5.75k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1718:13): [True: 5.73k, False: 13]
  ------------------
 1719|  5.73k|        {
 1720|  5.73k|            if ((result = pulse_decode(ics, spec_data, hDecoder->frameLength)) > 0)
  ------------------
  |  Branch (1720:17): [True: 7, False: 5.73k]
  ------------------
 1721|      7|                return result;
 1722|  5.73k|        } else {
 1723|     13|            return 2; /* pulse coding not allowed for short blocks */
 1724|     13|        }
 1725|  5.75k|    }
 1726|       |
 1727|   111k|    return 0;
 1728|   111k|}
syntax.c:spectral_data:
 2158|   108k|{
 2159|   108k|    int8_t i;
 2160|   108k|    uint8_t g;
 2161|   108k|    uint16_t inc, k, p = 0;
 2162|   108k|    uint8_t groups = 0;
 2163|   108k|    uint8_t sect_cb;
 2164|   108k|    uint8_t result;
 2165|   108k|    uint16_t nshort = hDecoder->frameLength/8;
 2166|       |
 2167|       |#ifdef PROFILE
 2168|       |    int64_t count = faad_get_ts();
 2169|       |#endif
 2170|       |
 2171|   293k|    for(g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (2171:16): [True: 185k, False: 108k]
  ------------------
 2172|   185k|    {
 2173|   185k|        p = groups*nshort;
 2174|       |
 2175|   213k|        for (i = 0; i < ics->num_sec[g]; i++)
  ------------------
  |  Branch (2175:21): [True: 28.6k, False: 185k]
  ------------------
 2176|  28.6k|        {
 2177|  28.6k|            sect_cb = ics->sect_cb[g][i];
 2178|       |
 2179|  28.6k|            inc = (sect_cb >= FIRST_PAIR_HCB) ? 2 : 4;
  ------------------
  |  |  102|  28.6k|#define FIRST_PAIR_HCB 5
  ------------------
  |  Branch (2179:19): [True: 8.87k, False: 19.7k]
  ------------------
 2180|       |
 2181|  28.6k|            switch (sect_cb)
 2182|  28.6k|            {
 2183|  10.2k|            case ZERO_HCB:
  ------------------
  |  |  101|  10.2k|#define ZERO_HCB       0
  ------------------
  |  Branch (2183:13): [True: 10.2k, False: 18.4k]
  ------------------
 2184|  10.2k|            case NOISE_HCB:
  ------------------
  |  |  106|  10.2k|#define NOISE_HCB      13
  ------------------
  |  Branch (2184:13): [True: 0, False: 28.6k]
  ------------------
 2185|  10.9k|            case INTENSITY_HCB:
  ------------------
  |  |  108|  10.9k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (2185:13): [True: 756, False: 27.8k]
  ------------------
 2186|  11.2k|            case INTENSITY_HCB2:
  ------------------
  |  |  107|  11.2k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (2186:13): [True: 327, False: 28.3k]
  ------------------
 2187|       |//#define SD_PRINT
 2188|       |#ifdef SD_PRINT
 2189|       |                {
 2190|       |                    int j;
 2191|       |                    for (j = ics->sect_sfb_offset[g][ics->sect_start[g][i]]; j < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; j++)
 2192|       |                    {
 2193|       |                        printf("%d\n", 0);
 2194|       |                    }
 2195|       |                }
 2196|       |#endif
 2197|       |//#define SFBO_PRINT
 2198|       |#ifdef SFBO_PRINT
 2199|       |                printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
 2200|       |#endif
 2201|  11.2k|                p += (ics->sect_sfb_offset[g][ics->sect_end[g][i]] -
 2202|  11.2k|                    ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
 2203|  11.2k|                break;
 2204|  17.3k|            default:
  ------------------
  |  Branch (2204:13): [True: 17.3k, False: 11.2k]
  ------------------
 2205|       |#ifdef SFBO_PRINT
 2206|       |                printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
 2207|       |#endif
 2208|  17.3k|                for (k = ics->sect_sfb_offset[g][ics->sect_start[g][i]];
 2209|   245k|                     k < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; k += inc)
  ------------------
  |  Branch (2209:22): [True: 228k, False: 17.3k]
  ------------------
 2210|   228k|                {
 2211|   228k|                    if ((result = huffman_spectral_data(sect_cb, ld, &spectral_data[p])) > 0)
  ------------------
  |  Branch (2211:25): [True: 50, False: 228k]
  ------------------
 2212|     50|                        return result;
 2213|       |#ifdef SD_PRINT
 2214|       |                    {
 2215|       |                        int j;
 2216|       |                        for (j = p; j < p+inc; j++)
 2217|       |                        {
 2218|       |                            printf("%d\n", spectral_data[j]);
 2219|       |                        }
 2220|       |                    }
 2221|       |#endif
 2222|   228k|                    p += inc;
 2223|   228k|                }
 2224|  17.3k|                break;
 2225|  28.6k|            }
 2226|  28.6k|        }
 2227|   185k|        groups += ics->window_group_length[g];
 2228|   185k|    }
 2229|       |
 2230|       |#ifdef PROFILE
 2231|       |    count = faad_get_ts() - count;
 2232|       |    hDecoder->spectral_cycles += count;
 2233|       |#endif
 2234|       |
 2235|   108k|    return 0;
 2236|   108k|}
syntax.c:decode_cpe:
  390|  18.4k|{
  391|  18.4k|    uint8_t channels = hDecoder->fr_channels;
  392|  18.4k|    uint8_t tag = 0;
  393|       |
  394|  18.4k|    if (channels+2 > MAX_CHANNELS)
  ------------------
  |  |   43|  18.4k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (394:9): [True: 144, False: 18.2k]
  ------------------
  395|    144|    {
  396|    144|        hInfo->error = 12;
  397|    144|        return;
  398|    144|    }
  399|  18.2k|    if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
  ------------------
  |  |   44|  18.2k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (399:9): [True: 0, False: 18.2k]
  ------------------
  400|      0|    {
  401|      0|        hInfo->error = 13;
  402|      0|        return;
  403|      0|    }
  404|  18.2k|    if (hDecoder->pce_set && (hDecoder->pce.channels > MAX_CHANNELS))
  ------------------
  |  |   43|  1.29k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (404:9): [True: 1.29k, False: 16.9k]
  |  Branch (404:30): [True: 4, False: 1.29k]
  ------------------
  405|      4|    {
  406|      4|        hInfo->error = 22;
  407|      4|        return;
  408|      4|    }
  409|       |
  410|       |    /* for CPE the number of output channels is always 2 */
  411|  18.2k|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
  ------------------
  |  Branch (411:9): [True: 14.9k, False: 3.32k]
  ------------------
  412|  14.9k|    {
  413|       |        /* element_output_channels not set yet */
  414|  14.9k|        hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
  415|  14.9k|    } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != 2) {
  ------------------
  |  Branch (415:16): [True: 0, False: 3.32k]
  ------------------
  416|       |        /* element inconsistency */
  417|      0|        hInfo->error = 21;
  418|      0|        return;
  419|      0|    }
  420|       |
  421|  18.2k|    if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID &&
  ------------------
  |  |   94|  36.5k|#define INVALID_ELEMENT_ID 255
  ------------------
  |  Branch (421:9): [True: 3.32k, False: 14.9k]
  ------------------
  422|  3.32k|        hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele)
  ------------------
  |  Branch (422:9): [True: 37, False: 3.29k]
  ------------------
  423|     37|    {
  424|       |        /* element inconsistency */
  425|     37|        hInfo->error = 21;
  426|     37|        return;
  427|     37|    }
  428|       |
  429|       |    /* save the syntax element id */
  430|  18.2k|    hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
  431|       |
  432|       |    /* decode the element */
  433|  18.2k|    hInfo->error = channel_pair_element(hDecoder, ld, channels, &tag);
  434|       |
  435|       |    /* map output channel position to internal data channels */
  436|  18.2k|    if (hDecoder->pce_set)
  ------------------
  |  Branch (436:9): [True: 1.28k, False: 16.9k]
  ------------------
  437|  1.28k|    {
  438|  1.28k|        hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]] = channels;
  439|  1.28k|        hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]+1] = channels+1;
  440|  16.9k|    } else {
  441|  16.9k|        hDecoder->internal_channel[channels] = channels;
  442|  16.9k|        hDecoder->internal_channel[channels+1] = channels+1;
  443|  16.9k|    }
  444|       |
  445|  18.2k|    hDecoder->fr_channels += 2;
  446|  18.2k|    hDecoder->fr_ch_ele++;
  447|  18.2k|}
syntax.c:channel_pair_element:
  701|  18.2k|{
  702|  18.2k|    ALIGN int16_t spec_data1[1024] = {0};
  703|  18.2k|    ALIGN int16_t spec_data2[1024] = {0};
  704|  18.2k|    element cpe = {0};
  705|  18.2k|    ic_stream *ics1 = &(cpe.ics1);
  706|  18.2k|    ic_stream *ics2 = &(cpe.ics2);
  707|  18.2k|    uint8_t result;
  708|       |
  709|  18.2k|    cpe.channel        = channels;
  710|  18.2k|    cpe.paired_channel = channels+1;
  711|       |
  712|  18.2k|    cpe.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
  ------------------
  |  |   76|  18.2k|#define LEN_TAG   4
  ------------------
  713|  18.2k|        DEBUGVAR(1,39,"channel_pair_element(): element_instance_tag"));
  714|  18.2k|    *tag = cpe.element_instance_tag;
  715|       |
  716|  18.2k|    if ((cpe.common_window = faad_get1bit(ld
  ------------------
  |  Branch (716:9): [True: 10.8k, False: 7.41k]
  ------------------
  717|  18.2k|        DEBUGVAR(1,40,"channel_pair_element(): common_window"))) & 1)
  718|  10.8k|    {
  719|       |        /* both channels have common ics information */
  720|  10.8k|        if ((result = ics_info(hDecoder, ics1, ld, cpe.common_window)) > 0)
  ------------------
  |  Branch (720:13): [True: 103, False: 10.7k]
  ------------------
  721|    103|            return result;
  722|       |
  723|  10.7k|        ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
  724|  10.7k|            DEBUGVAR(1,41,"channel_pair_element(): ms_mask_present"));
  725|  10.7k|        if (ics1->ms_mask_present == 3)
  ------------------
  |  Branch (725:13): [True: 23, False: 10.6k]
  ------------------
  726|     23|        {
  727|       |            /* bitstream error */
  728|     23|            return 32;
  729|     23|        }
  730|  10.6k|        if (ics1->ms_mask_present == 1)
  ------------------
  |  Branch (730:13): [True: 2.49k, False: 8.19k]
  ------------------
  731|  2.49k|        {
  732|  2.49k|            uint8_t g, sfb;
  733|  6.72k|            for (g = 0; g < ics1->num_window_groups; g++)
  ------------------
  |  Branch (733:25): [True: 4.23k, False: 2.49k]
  ------------------
  734|  4.23k|            {
  735|  10.5k|                for (sfb = 0; sfb < ics1->max_sfb; sfb++)
  ------------------
  |  Branch (735:31): [True: 6.35k, False: 4.23k]
  ------------------
  736|  6.35k|                {
  737|  6.35k|                    ics1->ms_used[g][sfb] = faad_get1bit(ld
  738|  6.35k|                        DEBUGVAR(1,42,"channel_pair_element(): faad_get1bit"));
  739|  6.35k|                }
  740|  4.23k|            }
  741|  2.49k|        }
  742|       |
  743|  10.6k|#ifdef ERROR_RESILIENCE
  744|  10.6k|        if ((hDecoder->object_type >= ER_OBJECT_START) && (ics1->predictor_data_present))
  ------------------
  |  |   71|  10.6k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (744:13): [True: 559, False: 10.1k]
  |  Branch (744:59): [True: 55, False: 504]
  ------------------
  745|     55|        {
  746|     55|            if ((
  ------------------
  |  Branch (746:17): [True: 5, False: 50]
  ------------------
  747|       |#ifdef LTP_DEC
  748|       |                ics1->ltp.data_present =
  749|       |#endif
  750|     55|                faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
  751|      5|            {
  752|       |#ifdef LTP_DEC
  753|       |                if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp), ld)) > 0)
  754|       |                {
  755|       |                    return result;
  756|       |                }
  757|       |#else
  758|      5|                return 26;
  759|      5|#endif
  760|      5|            }
  761|     55|        }
  762|  10.6k|#endif
  763|       |
  764|  10.6k|        memcpy(ics2, ics1, sizeof(ic_stream));
  765|  10.6k|    } else {
  766|  7.41k|        ics1->ms_mask_present = 0;
  767|  7.41k|    }
  768|       |
  769|  18.0k|    if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics1,
  ------------------
  |  Branch (769:9): [True: 345, False: 17.7k]
  ------------------
  770|  18.0k|        0, spec_data1)) > 0)
  771|    345|    {
  772|    345|        return result;
  773|    345|    }
  774|       |
  775|  17.7k|#ifdef ERROR_RESILIENCE
  776|  17.7k|    if (cpe.common_window && (hDecoder->object_type >= ER_OBJECT_START) &&
  ------------------
  |  |   71|  10.4k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (776:9): [True: 10.4k, False: 7.25k]
  |  Branch (776:30): [True: 516, False: 9.97k]
  ------------------
  777|    516|        (ics1->predictor_data_present))
  ------------------
  |  Branch (777:9): [True: 38, False: 478]
  ------------------
  778|     38|    {
  779|     38|        if ((
  ------------------
  |  Branch (779:13): [True: 3, False: 35]
  ------------------
  780|       |#ifdef LTP_DEC
  781|       |            ics1->ltp2.data_present =
  782|       |#endif
  783|     38|            faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
  784|      3|        {
  785|       |#ifdef LTP_DEC
  786|       |            if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp2), ld)) > 0)
  787|       |            {
  788|       |                return result;
  789|       |            }
  790|       |#else
  791|      3|            return 26;
  792|      3|#endif
  793|      3|        }
  794|     38|    }
  795|  17.7k|#endif
  796|       |
  797|  17.7k|    if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics2,
  ------------------
  |  Branch (797:9): [True: 156, False: 17.5k]
  ------------------
  798|  17.7k|        0, spec_data2)) > 0)
  799|    156|    {
  800|    156|        return result;
  801|    156|    }
  802|       |
  803|  17.5k|#ifdef SBR_DEC
  804|       |    /* check if next bitstream element is a fill element */
  805|       |    /* if so, read it now so SBR decoding can be done in case of a file with SBR */
  806|  17.5k|    if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   75|  17.5k|#define LEN_SE_ID 3
  ------------------
                  if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   92|  17.5k|#define ID_FIL 0x6
  ------------------
  |  Branch (806:9): [True: 11.2k, False: 6.28k]
  ------------------
  807|  11.2k|    {
  808|  11.2k|        faad_flushbits(ld, LEN_SE_ID);
  ------------------
  |  |   75|  11.2k|#define LEN_SE_ID 3
  ------------------
  809|       |
  810|       |        /* one sbr_info describes a channel_element not a channel! */
  811|  11.2k|        if ((result = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
  ------------------
  |  Branch (811:13): [True: 17, False: 11.2k]
  ------------------
  812|     17|        {
  813|     17|            return result;
  814|     17|        }
  815|  11.2k|    }
  816|  17.5k|#endif
  817|       |
  818|       |    /* noiseless coding is done, spectral reconstruction is done now */
  819|  17.5k|    if ((result = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe,
  ------------------
  |  Branch (819:9): [True: 58, False: 17.5k]
  ------------------
  820|  17.5k|        spec_data1, spec_data2)) > 0)
  821|     58|    {
  822|     58|        return result;
  823|     58|    }
  824|       |
  825|  17.5k|    return 0;
  826|  17.5k|}
syntax.c:ics_info:
  831|   101k|{
  832|   101k|    uint8_t retval = 0;
  833|   101k|    uint8_t ics_reserved_bit;
  834|       |
  835|   101k|    ics_reserved_bit = faad_get1bit(ld
  836|   101k|        DEBUGVAR(1,43,"ics_info(): ics_reserved_bit"));
  837|   101k|    if (ics_reserved_bit != 0)
  ------------------
  |  Branch (837:9): [True: 267, False: 101k]
  ------------------
  838|    267|        return 32;
  839|   101k|    ics->window_sequence = (uint8_t)faad_getbits(ld, 2
  840|   101k|        DEBUGVAR(1,44,"ics_info(): window_sequence"));
  841|   101k|    ics->window_shape = faad_get1bit(ld
  842|   101k|        DEBUGVAR(1,45,"ics_info(): window_shape"));
  843|       |
  844|       |#ifdef LD_DEC
  845|       |    /* No block switching in LD */
  846|       |    if ((hDecoder->object_type == LD) && (ics->window_sequence != ONLY_LONG_SEQUENCE))
  847|       |        return 32;
  848|       |#endif
  849|       |
  850|   101k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|   101k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (850:9): [True: 13.1k, False: 88.4k]
  ------------------
  851|  13.1k|    {
  852|  13.1k|        ics->max_sfb = (uint8_t)faad_getbits(ld, 4
  853|  13.1k|            DEBUGVAR(1,46,"ics_info(): max_sfb (short)"));
  854|  13.1k|        ics->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
  855|  13.1k|            DEBUGVAR(1,47,"ics_info(): scale_factor_grouping"));
  856|  88.4k|    } else {
  857|  88.4k|        ics->max_sfb = (uint8_t)faad_getbits(ld, 6
  858|  88.4k|            DEBUGVAR(1,48,"ics_info(): max_sfb (long)"));
  859|  88.4k|    }
  860|       |
  861|       |    /* get the grouping information */
  862|   101k|    if ((retval = window_grouping_info(hDecoder, ics)) > 0)
  ------------------
  |  Branch (862:9): [True: 69, False: 101k]
  ------------------
  863|     69|        return retval;
  864|       |
  865|       |
  866|       |    /* should be an error */
  867|       |    /* check the range of max_sfb */
  868|   101k|    if (ics->max_sfb > ics->num_swb)
  ------------------
  |  Branch (868:9): [True: 0, False: 101k]
  ------------------
  869|      0|        return 16;
  870|       |
  871|   101k|    if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|   101k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (871:9): [True: 88.3k, False: 13.1k]
  ------------------
  872|  88.3k|    {
  873|  88.3k|        if ((ics->predictor_data_present = faad_get1bit(ld
  ------------------
  |  Branch (873:13): [True: 8.32k, False: 80.0k]
  ------------------
  874|  88.3k|            DEBUGVAR(1,49,"ics_info(): predictor_data_present"))) & 1)
  875|  8.32k|        {
  876|  8.32k|            if (hDecoder->object_type == MAIN) /* MPEG2 style AAC predictor */
  ------------------
  |  |   40|  8.32k|#define MAIN       1
  ------------------
  |  Branch (876:17): [True: 2.58k, False: 5.74k]
  ------------------
  877|  2.58k|            {
  878|  2.58k|                uint8_t sfb;
  879|  2.58k|                uint8_t predictor_reset, predictor_reset_group_number, prediction_used;
  880|  2.58k|                uint8_t limit = min(ics->max_sfb, max_pred_sfb(hDecoder->sf_index));
  ------------------
  |  |   60|  2.58k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 2.52k, False: 58]
  |  |  ------------------
  ------------------
  881|       |
  882|  2.58k|                predictor_reset = faad_get1bit(ld DEBUGVAR(1,53,"ics_info(): pred.predictor_reset"));
  883|  2.58k|                if (predictor_reset)
  ------------------
  |  Branch (883:21): [True: 2.45k, False: 128]
  ------------------
  884|  2.45k|                {
  885|  2.45k|                    predictor_reset_group_number =
  886|  2.45k|                        (uint8_t)faad_getbits(ld, 5 DEBUGVAR(1,54,"ics_info(): pred.predictor_reset_group_number"));
  887|  2.45k|                } else {
  888|    128|                    predictor_reset_group_number = 0;
  889|    128|                }
  890|       |
  891|  18.5k|                for (sfb = 0; sfb < limit; sfb++)
  ------------------
  |  Branch (891:31): [True: 15.9k, False: 2.58k]
  ------------------
  892|  15.9k|                {
  893|  15.9k|                    prediction_used = faad_get1bit(ld DEBUGVAR(1,55,"ics_info(): pred.prediction_used"));
  894|       |#ifdef MAIN_DEC
  895|       |                    ics->pred.prediction_used[sfb] = prediction_used;
  896|       |#endif
  897|  15.9k|                }
  898|       |#ifdef MAIN_DEC
  899|       |                ics->pred.limit = limit;
  900|       |                ics->pred.predictor_reset = predictor_reset;
  901|       |                ics->pred.predictor_reset_group_number = predictor_reset_group_number;
  902|       |#else
  903|  2.58k|                (void)predictor_reset_group_number;
  904|  2.58k|                (void)prediction_used;
  905|  2.58k|#endif
  906|  2.58k|            }
  907|       |#ifdef LTP_DEC
  908|       |            else { /* Long Term Prediction */
  909|       |                if (hDecoder->object_type < ER_OBJECT_START)
  910|       |                {
  911|       |                    if ((ics->ltp.data_present = faad_get1bit(ld
  912|       |                        DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
  913|       |                    {
  914|       |                        if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
  915|       |                        {
  916|       |                            return retval;
  917|       |                        }
  918|       |                    }
  919|       |                    if (common_window)
  920|       |                    {
  921|       |                        if ((ics->ltp2.data_present = faad_get1bit(ld
  922|       |                            DEBUGVAR(1,51,"ics_info(): ltp2.data_present"))) & 1)
  923|       |                        {
  924|       |                            if ((retval = ltp_data(hDecoder, ics, &(ics->ltp2), ld)) > 0)
  925|       |                            {
  926|       |                                return retval;
  927|       |                            }
  928|       |                        }
  929|       |                    }
  930|       |                }
  931|       |#ifdef ERROR_RESILIENCE
  932|       |                if (!common_window && (hDecoder->object_type >= ER_OBJECT_START))
  933|       |                {
  934|       |                    if ((ics->ltp.data_present = faad_get1bit(ld
  935|       |                        DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
  936|       |                    {
  937|       |                        if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
  938|       |                        {
  939|       |                            return retval;
  940|       |                        }
  941|       |                    }
  942|       |                }
  943|       |#endif  /* ERROR_RESILIENCE */
  944|       |            }
  945|       |#else  /* LTP_DEC */
  946|  8.32k|            (void)common_window;
  947|  8.32k|#endif  /* LTP_DEC */
  948|  8.32k|        }
  949|  88.3k|    }
  950|       |
  951|   101k|    return retval;
  952|   101k|}
syntax.c:data_stream_element:
 1081|   355k|{
 1082|   355k|    uint8_t byte_aligned;
 1083|   355k|    uint16_t i, count;
 1084|   355k|    (void)hDecoder;  /* TODO: remove parameter; rename method; why result is unused? */
 1085|       |
 1086|   355k|    /* element_instance_tag = */ faad_getbits(ld, LEN_TAG
  ------------------
  |  |   76|   355k|#define LEN_TAG   4
  ------------------
 1087|   355k|        DEBUGVAR(1,60,"data_stream_element(): element_instance_tag"));
 1088|   355k|    byte_aligned = faad_get1bit(ld
 1089|   355k|        DEBUGVAR(1,61,"data_stream_element(): byte_aligned"));
 1090|   355k|    count = (uint16_t)faad_getbits(ld, 8
 1091|   355k|        DEBUGVAR(1,62,"data_stream_element(): count"));
 1092|   355k|    if (count == 255)
  ------------------
  |  Branch (1092:9): [True: 3.22k, False: 351k]
  ------------------
 1093|  3.22k|    {
 1094|  3.22k|        count += (uint16_t)faad_getbits(ld, 8
 1095|  3.22k|            DEBUGVAR(1,63,"data_stream_element(): extra count"));
 1096|  3.22k|    }
 1097|   355k|    if (byte_aligned)
  ------------------
  |  Branch (1097:9): [True: 115k, False: 239k]
  ------------------
 1098|   115k|        faad_byte_align(ld);
 1099|       |
 1100|  18.5M|    for (i = 0; i < count; i++)
  ------------------
  |  Branch (1100:17): [True: 18.2M, False: 355k]
  ------------------
 1101|  18.2M|    {
 1102|  18.2M|        faad_getbits(ld, LEN_BYTE
  ------------------
  |  |   77|  18.2M|#define LEN_BYTE  8
  ------------------
 1103|  18.2M|            DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
 1104|  18.2M|    }
 1105|       |
 1106|   355k|    return count;
 1107|   355k|}
syntax.c:fill_element:
 1115|  24.3k|{
 1116|  24.3k|    uint16_t count;
 1117|  24.3k|#ifdef SBR_DEC
 1118|  24.3k|    uint8_t bs_extension_type;
 1119|  24.3k|#endif
 1120|       |
 1121|  24.3k|    count = (uint16_t)faad_getbits(ld, 4
 1122|  24.3k|        DEBUGVAR(1,65,"fill_element(): count"));
 1123|  24.3k|    if (count == 15)
  ------------------
  |  Branch (1123:9): [True: 3.09k, False: 21.2k]
  ------------------
 1124|  3.09k|    {
 1125|  3.09k|        count += (uint16_t)faad_getbits(ld, 8
 1126|  3.09k|            DEBUGVAR(1,66,"fill_element(): extra count")) - 1;
 1127|  3.09k|    }
 1128|       |
 1129|  24.3k|    if (count > 0)
  ------------------
  |  Branch (1129:9): [True: 22.7k, False: 1.58k]
  ------------------
 1130|  22.7k|    {
 1131|  22.7k|#ifdef SBR_DEC
 1132|  22.7k|        bs_extension_type = (uint8_t)faad_showbits(ld, 4);
 1133|       |
 1134|  22.7k|        if ((bs_extension_type == EXT_SBR_DATA) ||
  ------------------
  |  |   43|  22.7k|#define EXT_SBR_DATA     13
  ------------------
  |  Branch (1134:13): [True: 14.7k, False: 7.98k]
  ------------------
 1135|  7.98k|            (bs_extension_type == EXT_SBR_DATA_CRC))
  ------------------
  |  |   44|  7.98k|#define EXT_SBR_DATA_CRC 14
  ------------------
  |  Branch (1135:13): [True: 7.87k, False: 106]
  ------------------
 1136|  22.6k|        {
 1137|  22.6k|            if (sbr_ele == INVALID_SBR_ELEMENT)
  ------------------
  |  |  110|  22.6k|#define INVALID_SBR_ELEMENT 255
  ------------------
  |  Branch (1137:17): [True: 30, False: 22.6k]
  ------------------
 1138|     30|                return 24;
 1139|       |
 1140|  22.6k|            if (!hDecoder->sbr[sbr_ele])
  ------------------
  |  Branch (1140:17): [True: 18.9k, False: 3.63k]
  ------------------
 1141|  18.9k|            {
 1142|  18.9k|                hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength,
 1143|  18.9k|                    hDecoder->element_id[sbr_ele], 2*get_sample_rate(hDecoder->sf_index),
 1144|  18.9k|                    hDecoder->downSampledSBR
 1145|  18.9k|#ifdef DRM
 1146|  18.9k|                    , 0
 1147|  18.9k|#endif
 1148|  18.9k|                    );
 1149|  18.9k|            }
 1150|  22.6k|            if (!hDecoder->sbr[sbr_ele])
  ------------------
  |  Branch (1150:17): [True: 0, False: 22.6k]
  ------------------
 1151|      0|                return 19;
 1152|       |
 1153|  22.6k|            hDecoder->sbr_present_flag = 1;
 1154|       |
 1155|       |            /* parse the SBR data */
 1156|  22.6k|            hDecoder->sbr[sbr_ele]->ret = sbr_extension_data(ld, hDecoder->sbr[sbr_ele], count,
 1157|  22.6k|                hDecoder->postSeekResetFlag);
 1158|       |
 1159|       |#if 0
 1160|       |            if (hDecoder->sbr[sbr_ele]->ret > 0)
 1161|       |            {
 1162|       |                printf("%s\n", NeAACDecGetErrorMessage(hDecoder->sbr[sbr_ele]->ret));
 1163|       |            }
 1164|       |#endif
 1165|       |
 1166|  22.6k|#if (defined(PS_DEC) || defined(DRM_PS))
 1167|  22.6k|            if (hDecoder->sbr[sbr_ele]->ps_used)
  ------------------
  |  Branch (1167:17): [True: 3.69k, False: 18.9k]
  ------------------
 1168|  3.69k|            {
 1169|  3.69k|                hDecoder->ps_used[sbr_ele] = 1;
 1170|       |
 1171|       |                /* set element independent flag to 1 as well */
 1172|  3.69k|                hDecoder->ps_used_global = 1;
 1173|  3.69k|            }
 1174|  22.6k|#endif
 1175|  22.6k|        } else {
 1176|    106|#endif
 1177|       |#ifndef DRM
 1178|       |            while (count > 0)
 1179|       |            {
 1180|       |                uint16_t payload_bytes = extension_payload(ld, drc, count);
 1181|       |                if (payload_bytes <= count) {
 1182|       |                    count -= payload_bytes;
 1183|       |                } else {
 1184|       |                    count = 0;
 1185|       |                }
 1186|       |            }
 1187|       |#else
 1188|    106|            (void)drc;
 1189|    106|            return 30;
 1190|    106|#endif
 1191|    106|#ifdef SBR_DEC
 1192|    106|        }
 1193|  22.7k|#endif
 1194|  22.7k|    }
 1195|       |
 1196|  24.2k|    return 0;
 1197|  24.3k|}
syntax.c:DRM_aac_scalable_main_header:
 1514|    691|{
 1515|    691|    uint8_t retval = 0;
 1516|    691|    uint8_t ics_reserved_bit;
 1517|       |
 1518|    691|    ics_reserved_bit = faad_get1bit(ld
 1519|    691|        DEBUGVAR(1,300,"aac_scalable_main_header(): ics_reserved_bits"));
 1520|    691|    if (ics_reserved_bit != 0)
  ------------------
  |  Branch (1520:9): [True: 8, False: 683]
  ------------------
 1521|      8|        return 32;
 1522|    683|    ics1->window_sequence = (uint8_t)faad_getbits(ld, 2
 1523|    683|        DEBUGVAR(1,301,"aac_scalable_main_header(): window_sequence"));
 1524|    683|    ics1->window_shape = faad_get1bit(ld
 1525|    683|        DEBUGVAR(1,302,"aac_scalable_main_header(): window_shape"));
 1526|       |
 1527|    683|    if (ics1->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|    683|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1527:9): [True: 136, False: 547]
  ------------------
 1528|    136|    {
 1529|    136|        ics1->max_sfb = (uint8_t)faad_getbits(ld, 4
 1530|    136|            DEBUGVAR(1,303,"aac_scalable_main_header(): max_sfb (short)"));
 1531|    136|        ics1->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
 1532|    136|            DEBUGVAR(1,304,"aac_scalable_main_header(): scale_factor_grouping"));
 1533|    547|    } else {
 1534|    547|        ics1->max_sfb = (uint8_t)faad_getbits(ld, 6
 1535|    547|            DEBUGVAR(1,305,"aac_scalable_main_header(): max_sfb (long)"));
 1536|    547|    }
 1537|       |
 1538|       |    /* get the grouping information */
 1539|    683|    if ((retval = window_grouping_info(hDecoder, ics1)) > 0)
  ------------------
  |  Branch (1539:9): [True: 9, False: 674]
  ------------------
 1540|      9|        return retval;
 1541|       |
 1542|       |    /* should be an error */
 1543|       |    /* check the range of max_sfb */
 1544|    674|    if (ics1->max_sfb > ics1->num_swb)
  ------------------
  |  Branch (1544:9): [True: 0, False: 674]
  ------------------
 1545|      0|        return 16;
 1546|       |
 1547|    674|    if (this_layer_stereo)
  ------------------
  |  Branch (1547:9): [True: 227, False: 447]
  ------------------
 1548|    227|    {
 1549|    227|        ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
 1550|    227|            DEBUGVAR(1,306,"aac_scalable_main_header(): ms_mask_present"));
 1551|    227|        if (ics1->ms_mask_present == 3)
  ------------------
  |  Branch (1551:13): [True: 7, False: 220]
  ------------------
 1552|      7|        {
 1553|       |            /* bitstream error */
 1554|      7|            return 32;
 1555|      7|        }
 1556|    220|        if (ics1->ms_mask_present == 1)
  ------------------
  |  Branch (1556:13): [True: 68, False: 152]
  ------------------
 1557|     68|        {
 1558|     68|            uint8_t g, sfb;
 1559|    313|            for (g = 0; g < ics1->num_window_groups; g++)
  ------------------
  |  Branch (1559:25): [True: 245, False: 68]
  ------------------
 1560|    245|            {
 1561|  2.26k|                for (sfb = 0; sfb < ics1->max_sfb; sfb++)
  ------------------
  |  Branch (1561:31): [True: 2.02k, False: 245]
  ------------------
 1562|  2.02k|                {
 1563|  2.02k|                    ics1->ms_used[g][sfb] = faad_get1bit(ld
 1564|  2.02k|                        DEBUGVAR(1,307,"aac_scalable_main_header(): faad_get1bit"));
 1565|  2.02k|                }
 1566|    245|            }
 1567|     68|        }
 1568|       |
 1569|    220|        memcpy(ics2, ics1, sizeof(ic_stream));
 1570|    447|    } else {
 1571|    447|        ics1->ms_mask_present = 0;
 1572|    447|    }
 1573|       |
 1574|    667|    return 0;
 1575|    674|}
syntax.c:side_info:
 1580|   113k|{
 1581|   113k|    uint8_t result;
 1582|       |
 1583|   113k|    ics->global_gain = (uint8_t)faad_getbits(ld, 8
 1584|   113k|        DEBUGVAR(1,67,"individual_channel_stream(): global_gain"));
 1585|       |
 1586|   113k|    if (!ele->common_window && !scal_flag)
  ------------------
  |  Branch (1586:9): [True: 91.0k, False: 21.9k]
  |  Branch (1586:32): [True: 91.0k, False: 0]
  ------------------
 1587|  91.0k|    {
 1588|  91.0k|        if ((result = ics_info(hDecoder, ics, ld, ele->common_window)) > 0)
  ------------------
  |  Branch (1588:13): [True: 233, False: 90.8k]
  ------------------
 1589|    233|            return result;
 1590|  91.0k|    }
 1591|       |
 1592|   112k|    if ((result = section_data(hDecoder, ics, ld)) > 0)
  ------------------
  |  Branch (1592:9): [True: 661, False: 112k]
  ------------------
 1593|    661|        return result;
 1594|       |
 1595|   112k|    if ((result = scale_factor_data(hDecoder, ics, ld)) > 0)
  ------------------
  |  Branch (1595:9): [True: 7, False: 112k]
  ------------------
 1596|      7|        return result;
 1597|       |
 1598|   112k|    if (!scal_flag)
  ------------------
  |  Branch (1598:9): [True: 111k, False: 737]
  ------------------
 1599|   111k|    {
 1600|       |        /**
 1601|       |         **  NOTE: It could be that pulse data is available in scalable AAC too,
 1602|       |         **        as said in Amendment 1, this could be only the case for ER AAC,
 1603|       |         **        though. (have to check this out later)
 1604|       |         **/
 1605|       |        /* get pulse data */
 1606|   111k|        if ((ics->pulse_data_present = faad_get1bit(ld
  ------------------
  |  Branch (1606:13): [True: 5.81k, False: 105k]
  ------------------
 1607|   111k|            DEBUGVAR(1,68,"individual_channel_stream(): pulse_data_present"))) & 1)
 1608|  5.81k|        {
 1609|  5.81k|            if ((result = pulse_data(ics, &(ics->pul), ld)) > 0)
  ------------------
  |  Branch (1609:17): [True: 46, False: 5.77k]
  ------------------
 1610|     46|                return result;
 1611|  5.81k|        }
 1612|       |
 1613|       |        /* get tns data */
 1614|   111k|        if ((ics->tns_data_present = faad_get1bit(ld
  ------------------
  |  Branch (1614:13): [True: 13.5k, False: 97.8k]
  ------------------
 1615|   111k|            DEBUGVAR(1,69,"individual_channel_stream(): tns_data_present"))) & 1)
 1616|  13.5k|        {
 1617|  13.5k|#ifdef ERROR_RESILIENCE
 1618|  13.5k|            if (hDecoder->object_type < ER_OBJECT_START)
  ------------------
  |  |   71|  13.5k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (1618:17): [True: 13.2k, False: 312]
  ------------------
 1619|  13.2k|#endif
 1620|  13.2k|                tns_data(ics, &(ics->tns), ld);
 1621|  13.5k|        }
 1622|       |
 1623|       |        /* get gain control data */
 1624|   111k|        if ((ics->gain_control_data_present = faad_get1bit(ld
  ------------------
  |  Branch (1624:13): [True: 81, False: 111k]
  ------------------
 1625|   111k|            DEBUGVAR(1,70,"individual_channel_stream(): gain_control_data_present"))) & 1)
 1626|     81|        {
 1627|       |#ifdef SSR_DEC
 1628|       |            if (hDecoder->object_type != SSR)
 1629|       |                return 1;
 1630|       |            else
 1631|       |                gain_control_data(ld, ics);
 1632|       |#else
 1633|     81|            return 1;
 1634|     81|#endif
 1635|     81|        }
 1636|   111k|    }
 1637|       |
 1638|   112k|#ifdef ERROR_RESILIENCE
 1639|   112k|    if (hDecoder->aacSpectralDataResilienceFlag)
  ------------------
  |  Branch (1639:9): [True: 3.62k, False: 108k]
  ------------------
 1640|  3.62k|    {
 1641|  3.62k|        ics->length_of_reordered_spectral_data = (uint16_t)faad_getbits(ld, 14
 1642|  3.62k|            DEBUGVAR(1,147,"individual_channel_stream(): length_of_reordered_spectral_data"));
 1643|       |
 1644|  3.62k|        if (hDecoder->channelConfiguration == 2)
  ------------------
  |  Branch (1644:13): [True: 387, False: 3.23k]
  ------------------
 1645|    387|        {
 1646|    387|            if (ics->length_of_reordered_spectral_data > 6144)
  ------------------
  |  Branch (1646:17): [True: 57, False: 330]
  ------------------
 1647|     57|                ics->length_of_reordered_spectral_data = 6144;
 1648|  3.23k|        } else {
 1649|  3.23k|            if (ics->length_of_reordered_spectral_data > 12288)
  ------------------
  |  Branch (1649:17): [True: 94, False: 3.14k]
  ------------------
 1650|     94|                ics->length_of_reordered_spectral_data = 12288;
 1651|  3.23k|        }
 1652|       |
 1653|  3.62k|        ics->length_of_longest_codeword = (uint8_t)faad_getbits(ld, 6
 1654|  3.62k|            DEBUGVAR(1,148,"individual_channel_stream(): length_of_longest_codeword"));
 1655|  3.62k|        if (ics->length_of_longest_codeword >= 49)
  ------------------
  |  Branch (1655:13): [True: 209, False: 3.41k]
  ------------------
 1656|    209|            ics->length_of_longest_codeword = 49;
 1657|  3.62k|    }
 1658|       |
 1659|       |    /* RVLC spectral data is put here */
 1660|   112k|    if (hDecoder->aacScalefactorDataResilienceFlag)
  ------------------
  |  Branch (1660:9): [True: 5.75k, False: 106k]
  ------------------
 1661|  5.75k|    {
 1662|  5.75k|        if ((result = rvlc_decode_scale_factors(ics, ld)) > 0)
  ------------------
  |  Branch (1662:13): [True: 22, False: 5.73k]
  ------------------
 1663|     22|            return result;
 1664|  5.75k|    }
 1665|   112k|#endif
 1666|       |
 1667|   112k|    return 0;
 1668|   112k|}
syntax.c:section_data:
 1732|   112k|{
 1733|   112k|    uint8_t g;
 1734|   112k|    uint8_t sect_esc_val, sect_bits;
 1735|   112k|    uint8_t sect_lim; /* 51 or 120, anyways less than 127. */
 1736|       |
 1737|   112k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   98|   112k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1737:9): [True: 14.3k, False: 98.4k]
  ------------------
 1738|  14.3k|        sect_bits = 3;
 1739|  14.3k|        sect_lim = 8 * 15;
 1740|  98.4k|    } else {
 1741|  98.4k|        sect_bits = 5;
 1742|  98.4k|        sect_lim = MAX_SFB;
  ------------------
  |  |   46|  98.4k|#define MAX_SFB             51
  ------------------
 1743|  98.4k|    }
 1744|   112k|    sect_esc_val = (1u<<sect_bits) - 1;
 1745|       |
 1746|       |#if 0
 1747|       |    printf("\ntotal sfb %d\n", ics->max_sfb);
 1748|       |    printf("   sect    top     cb\n");
 1749|       |#endif
 1750|       |
 1751|   303k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (1751:17): [True: 191k, False: 112k]
  ------------------
 1752|   191k|    {
 1753|   191k|        uint8_t k = 0;
 1754|   191k|        uint8_t i = 0;
 1755|       |
 1756|   252k|        while (k < ics->max_sfb)
  ------------------
  |  Branch (1756:16): [True: 62.0k, False: 190k]
  ------------------
 1757|  62.0k|        {
 1758|  62.0k|#ifdef ERROR_RESILIENCE
 1759|  62.0k|            uint8_t vcb11 = 0;
 1760|  62.0k|#endif
 1761|  62.0k|            uint8_t sfb;
 1762|  62.0k|            uint8_t sect_len_incr;
 1763|  62.0k|            uint8_t sect_len = 0;
 1764|  62.0k|            uint8_t sect_cb_bits = 4;
 1765|       |
 1766|       |            /* if "faad_getbits" detects error and returns "0", "k" is never
 1767|       |               incremented and we cannot leave the while loop */
 1768|  62.0k|            if (ld->error != 0)
  ------------------
  |  Branch (1768:17): [True: 0, False: 62.0k]
  ------------------
 1769|      0|                return 14;
 1770|  62.0k|            if (i >= sect_lim)
  ------------------
  |  Branch (1770:17): [True: 316, False: 61.6k]
  ------------------
 1771|    316|                return 15;
 1772|       |
 1773|  61.6k|#ifdef ERROR_RESILIENCE
 1774|  61.6k|            if (hDecoder->aacSectionDataResilienceFlag)
  ------------------
  |  Branch (1774:17): [True: 17.2k, False: 44.4k]
  ------------------
 1775|  17.2k|                sect_cb_bits = 5;
 1776|  61.6k|#endif
 1777|       |
 1778|  61.6k|            ics->sect_cb[g][i] = (uint8_t)faad_getbits(ld, sect_cb_bits
 1779|  61.6k|                DEBUGVAR(1,71,"section_data(): sect_cb"));
 1780|       |
 1781|  61.6k|            if (ics->sect_cb[g][i] == 12)
  ------------------
  |  Branch (1781:17): [True: 57, False: 61.6k]
  ------------------
 1782|     57|                return 32;
 1783|       |
 1784|       |#if 0
 1785|       |            printf("%d\n", ics->sect_cb[g][i]);
 1786|       |#endif
 1787|       |
 1788|       |#ifndef DRM
 1789|       |            if (ics->sect_cb[g][i] == NOISE_HCB)
 1790|       |                ics->noise_used = 1;
 1791|       |#else
 1792|       |            /* PNS not allowed in DRM */
 1793|  61.6k|            if (ics->sect_cb[g][i] == NOISE_HCB)
  ------------------
  |  |  106|  61.6k|#define NOISE_HCB      13
  ------------------
  |  Branch (1793:17): [True: 17, False: 61.6k]
  ------------------
 1794|     17|                return 29;
 1795|  61.6k|#endif
 1796|  61.6k|            if (ics->sect_cb[g][i] == INTENSITY_HCB2 || ics->sect_cb[g][i] == INTENSITY_HCB)
  ------------------
  |  |  107|   123k|#define INTENSITY_HCB2 14
  ------------------
                          if (ics->sect_cb[g][i] == INTENSITY_HCB2 || ics->sect_cb[g][i] == INTENSITY_HCB)
  ------------------
  |  |  108|  60.9k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (1796:17): [True: 689, False: 60.9k]
  |  Branch (1796:57): [True: 1.47k, False: 59.4k]
  ------------------
 1797|  2.16k|                ics->is_used = 1;
 1798|       |
 1799|  61.6k|#ifdef ERROR_RESILIENCE
 1800|  61.6k|            if (hDecoder->aacSectionDataResilienceFlag)
  ------------------
  |  Branch (1800:17): [True: 17.2k, False: 44.3k]
  ------------------
 1801|  17.2k|            {
 1802|  17.2k|                if ((ics->sect_cb[g][i] == 11) ||
  ------------------
  |  Branch (1802:21): [True: 224, False: 16.9k]
  ------------------
 1803|  16.9k|                    ((ics->sect_cb[g][i] >= 16) && (ics->sect_cb[g][i] <= 32)))
  ------------------
  |  Branch (1803:22): [True: 4.51k, False: 12.4k]
  |  Branch (1803:52): [True: 4.51k, False: 0]
  ------------------
 1804|  4.74k|                {
 1805|  4.74k|                    vcb11 = 1;
 1806|  4.74k|                }
 1807|  17.2k|            }
 1808|  61.6k|            if (vcb11)
  ------------------
  |  Branch (1808:17): [True: 4.74k, False: 56.8k]
  ------------------
 1809|  4.74k|            {
 1810|  4.74k|                sect_len_incr = 1;
 1811|  56.8k|            } else {
 1812|  56.8k|#endif
 1813|  56.8k|                sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
 1814|  56.8k|                    DEBUGVAR(1,72,"section_data(): sect_len_incr"));
 1815|  56.8k|#ifdef ERROR_RESILIENCE
 1816|  56.8k|            }
 1817|  61.6k|#endif
 1818|  62.2k|            while (sect_len_incr == sect_esc_val /* &&
  ------------------
  |  Branch (1818:20): [True: 668, False: 61.6k]
  ------------------
 1819|  61.6k|                (k+sect_len < ics->max_sfb)*/)
 1820|    668|            {
 1821|    668|                sect_len += sect_len_incr;
 1822|    668|                if (sect_len > sect_lim)
  ------------------
  |  Branch (1822:21): [True: 9, False: 659]
  ------------------
 1823|      9|                    return 15;
 1824|    659|                sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
 1825|    659|                    DEBUGVAR(1,72,"section_data(): sect_len_incr"));
 1826|    659|            }
 1827|       |
 1828|  61.6k|            sect_len += sect_len_incr;
 1829|       |
 1830|  61.6k|            ics->sect_start[g][i] = k;
 1831|  61.6k|            ics->sect_end[g][i] = k + sect_len;
 1832|       |
 1833|       |#if 0
 1834|       |            printf("%d\n", ics->sect_start[g][i]);
 1835|       |#endif
 1836|       |#if 0
 1837|       |            printf("%d\n", ics->sect_end[g][i]);
 1838|       |#endif
 1839|       |
 1840|  61.6k|            if (sect_len > sect_lim)
  ------------------
  |  Branch (1840:17): [True: 15, False: 61.5k]
  ------------------
 1841|     15|                return 15;
 1842|  61.5k|            if (k + sect_len > sect_lim)
  ------------------
  |  Branch (1842:17): [True: 12, False: 61.5k]
  ------------------
 1843|     12|                return 15;
 1844|       |
 1845|   199k|            for (sfb = k; sfb < k + sect_len; sfb++)
  ------------------
  |  Branch (1845:27): [True: 138k, False: 61.5k]
  ------------------
 1846|   138k|            {
 1847|   138k|                ics->sfb_cb[g][sfb] = ics->sect_cb[g][i];
 1848|       |#if 0
 1849|       |                printf("%d\n", ics->sfb_cb[g][sfb]);
 1850|       |#endif
 1851|   138k|            }
 1852|       |
 1853|       |#if 0
 1854|       |            printf(" %6d %6d %6d\n",
 1855|       |                i,
 1856|       |                ics->sect_end[g][i],
 1857|       |                ics->sect_cb[g][i]);
 1858|       |#endif
 1859|       |
 1860|  61.5k|            k += sect_len; /* k <= sect_lim */
 1861|  61.5k|            i++;
 1862|  61.5k|        }
 1863|   190k|        ics->num_sec[g] = i;
 1864|       |
 1865|       |        /* the sum of all sect_len_incr elements for a given window
 1866|       |         * group shall equal max_sfb */
 1867|   190k|        if (k != ics->max_sfb)
  ------------------
  |  Branch (1867:13): [True: 235, False: 190k]
  ------------------
 1868|    235|        {
 1869|    235|            return 32;
 1870|    235|        }
 1871|       |#if 0
 1872|       |        printf("%d\n", ics->num_sec[g]);
 1873|       |#endif
 1874|   190k|    }
 1875|       |
 1876|       |#if 0
 1877|       |    printf("\n");
 1878|       |#endif
 1879|       |
 1880|   112k|    return 0;
 1881|   112k|}
syntax.c:scale_factor_data:
 1989|   112k|{
 1990|   112k|    uint8_t ret = 0;
 1991|       |#ifdef PROFILE
 1992|       |    int64_t count = faad_get_ts();
 1993|       |#endif
 1994|       |
 1995|   112k|#ifdef ERROR_RESILIENCE
 1996|   112k|    if (!hDecoder->aacScalefactorDataResilienceFlag)
  ------------------
  |  Branch (1996:9): [True: 106k, False: 5.75k]
  ------------------
 1997|   106k|    {
 1998|   106k|#endif
 1999|   106k|        ret = decode_scale_factors(ics, ld);
 2000|   106k|#ifdef ERROR_RESILIENCE
 2001|   106k|    } else {
 2002|       |        /* In ER AAC the parameters for RVLC are seperated from the actual
 2003|       |           data that holds the scale_factors.
 2004|       |           Strangely enough, 2 parameters for HCR are put inbetween them.
 2005|       |        */
 2006|  5.75k|        ret = rvlc_scale_factor_data(ics, ld);
 2007|  5.75k|    }
 2008|   112k|#endif
 2009|       |
 2010|       |#ifdef PROFILE
 2011|       |    count = faad_get_ts() - count;
 2012|       |    hDecoder->scalefac_cycles += count;
 2013|       |#endif
 2014|       |
 2015|   112k|    return ret;
 2016|   112k|}
syntax.c:decode_scale_factors:
 1895|   106k|{
 1896|   106k|    uint8_t g, sfb;
 1897|   106k|    int16_t t;
 1898|       |
 1899|   106k|    int16_t scale_factor = ics->global_gain;
 1900|   106k|    int16_t is_position = 0;
 1901|   106k|    int16_t scale_factor_max = 255;
 1902|       |#ifdef FIXED_POINT
 1903|       |    /* TODO: consider rolling out to regular build. */
 1904|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1905|       |    /* The value is inexact, adjusted to current fuzzer findings. */
 1906|       |    scale_factor_max = 165;
 1907|       |#endif  // FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1908|       |#endif  // FIXED_POINT
 1909|       |#ifndef DRM
 1910|       |    int8_t noise_pcm_flag = 1;
 1911|       |    int16_t noise_energy = ics->global_gain - 90;
 1912|       |#endif
 1913|       |
 1914|   289k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (1914:17): [True: 182k, False: 106k]
  ------------------
 1915|   182k|    {
 1916|   299k|        for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (1916:23): [True: 117k, False: 182k]
  ------------------
 1917|   117k|        {
 1918|   117k|            switch (ics->sfb_cb[g][sfb])
 1919|   117k|            {
 1920|  73.7k|            case ZERO_HCB: /* zero book */
  ------------------
  |  |  101|  73.7k|#define ZERO_HCB       0
  ------------------
  |  Branch (1920:13): [True: 73.7k, False: 43.3k]
  ------------------
 1921|  73.7k|                ics->scale_factors[g][sfb] = 0;
 1922|       |//#define SF_PRINT
 1923|       |#ifdef SF_PRINT
 1924|       |                printf("%d\n", ics->scale_factors[g][sfb]);
 1925|       |#endif
 1926|  73.7k|                break;
 1927|  5.39k|            case INTENSITY_HCB: /* intensity books */
  ------------------
  |  |  108|  5.39k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (1927:13): [True: 5.39k, False: 111k]
  ------------------
 1928|  6.80k|            case INTENSITY_HCB2:
  ------------------
  |  |  107|  6.80k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (1928:13): [True: 1.41k, False: 115k]
  ------------------
 1929|       |
 1930|       |                /* decode intensity position */
 1931|  6.80k|                t = huffman_scale_factor(ld);
 1932|  6.80k|                is_position += (t - 60);
 1933|  6.80k|                ics->scale_factors[g][sfb] = is_position;
 1934|       |#ifdef SF_PRINT
 1935|       |                printf("%d\n", ics->scale_factors[g][sfb]);
 1936|       |#endif
 1937|       |
 1938|  6.80k|                break;
 1939|      0|            case NOISE_HCB: /* noise books */
  ------------------
  |  |  106|      0|#define NOISE_HCB      13
  ------------------
  |  Branch (1939:13): [True: 0, False: 117k]
  ------------------
 1940|       |
 1941|       |#ifndef DRM
 1942|       |                /* decode noise energy */
 1943|       |                if (noise_pcm_flag)
 1944|       |                {
 1945|       |                    noise_pcm_flag = 0;
 1946|       |                    t = (int16_t)faad_getbits(ld, 9
 1947|       |                        DEBUGVAR(1,73,"scale_factor_data(): first noise")) - 256;
 1948|       |                } else {
 1949|       |                    t = huffman_scale_factor(ld);
 1950|       |                    t -= 60;
 1951|       |                }
 1952|       |                noise_energy += t;
 1953|       |                ics->scale_factors[g][sfb] = noise_energy;
 1954|       |#ifdef SF_PRINT
 1955|       |                printf("%d\n", ics->scale_factors[g][sfb]);
 1956|       |#endif
 1957|       |#else
 1958|       |                /* PNS not allowed in DRM */
 1959|      0|                return 29;
 1960|      0|#endif
 1961|       |
 1962|      0|                break;
 1963|  36.5k|            default: /* spectral books */
  ------------------
  |  Branch (1963:13): [True: 36.5k, False: 80.5k]
  ------------------
 1964|       |
 1965|       |                /* ics->scale_factors[g][sfb] must be between 0 and 255 */
 1966|       |
 1967|  36.5k|                ics->scale_factors[g][sfb] = 0;
 1968|       |
 1969|       |                /* decode scale factor */
 1970|  36.5k|                t = huffman_scale_factor(ld);
 1971|  36.5k|                scale_factor += (t - 60);
 1972|  36.5k|                if (scale_factor < 0 || scale_factor > 255)
  ------------------
  |  Branch (1972:21): [True: 4, False: 36.5k]
  |  Branch (1972:41): [True: 3, False: 36.5k]
  ------------------
 1973|      7|                    return 4;
 1974|  36.5k|                ics->scale_factors[g][sfb] = min(scale_factor, scale_factor_max);
  ------------------
  |  |   60|  36.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 36.1k, False: 429]
  |  |  ------------------
  ------------------
 1975|       |#ifdef SF_PRINT
 1976|       |                printf("%d\n", ics->scale_factors[g][sfb]);
 1977|       |#endif
 1978|       |
 1979|  36.5k|                break;
 1980|   117k|            }
 1981|   117k|        }
 1982|   182k|    }
 1983|       |
 1984|   106k|    return 0;
 1985|   106k|}
syntax.c:pulse_data:
  956|  5.81k|{
  957|  5.81k|    uint8_t i;
  958|       |
  959|  5.81k|    pul->number_pulse = (uint8_t)faad_getbits(ld, 2
  960|  5.81k|        DEBUGVAR(1,56,"pulse_data(): number_pulse"));
  961|  5.81k|    pul->pulse_start_sfb = (uint8_t)faad_getbits(ld, 6
  962|  5.81k|        DEBUGVAR(1,57,"pulse_data(): pulse_start_sfb"));
  963|       |
  964|       |    /* check the range of pulse_start_sfb */
  965|  5.81k|    if (pul->pulse_start_sfb > ics->num_swb)
  ------------------
  |  Branch (965:9): [True: 46, False: 5.77k]
  ------------------
  966|     46|        return 16;
  967|       |
  968|  14.1k|    for (i = 0; i < pul->number_pulse+1; i++)
  ------------------
  |  Branch (968:17): [True: 8.40k, False: 5.77k]
  ------------------
  969|  8.40k|    {
  970|  8.40k|        pul->pulse_offset[i] = (uint8_t)faad_getbits(ld, 5
  971|  8.40k|            DEBUGVAR(1,58,"pulse_data(): pulse_offset"));
  972|       |#if 0
  973|       |        printf("%d\n", pul->pulse_offset[i]);
  974|       |#endif
  975|  8.40k|        pul->pulse_amp[i] = (uint8_t)faad_getbits(ld, 4
  976|  8.40k|            DEBUGVAR(1,59,"pulse_data(): pulse_amp"));
  977|       |#if 0
  978|       |        printf("%d\n", pul->pulse_amp[i]);
  979|       |#endif
  980|  8.40k|    }
  981|       |
  982|  5.77k|    return 0;
  983|  5.81k|}
syntax.c:tns_data:
 2020|  13.6k|{
 2021|  13.6k|    uint8_t w, filt, i, coef_bits;
 2022|  13.6k|    uint8_t n_filt_bits = 2;
 2023|  13.6k|    uint8_t length_bits = 6;
 2024|  13.6k|    uint8_t order_bits = 5;
 2025|       |
 2026|  13.6k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  13.6k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (2026:9): [True: 940, False: 12.7k]
  ------------------
 2027|    940|    {
 2028|    940|        n_filt_bits = 1;
 2029|    940|        length_bits = 4;
 2030|    940|        order_bits = 3;
 2031|    940|    }
 2032|       |
 2033|  33.9k|    for (w = 0; w < ics->num_windows; w++)
  ------------------
  |  Branch (2033:17): [True: 20.2k, False: 13.6k]
  ------------------
 2034|  20.2k|    {
 2035|  20.2k|        uint8_t start_coef_bits = 3;
 2036|  20.2k|        tns->n_filt[w] = (uint8_t)faad_getbits(ld, n_filt_bits
 2037|  20.2k|            DEBUGVAR(1,74,"tns_data(): n_filt"));
 2038|       |#if 0
 2039|       |        printf("%d\n", tns->n_filt[w]);
 2040|       |#endif
 2041|       |
 2042|  20.2k|        if (tns->n_filt[w])
  ------------------
  |  Branch (2042:13): [True: 7.09k, False: 13.1k]
  ------------------
 2043|  7.09k|        {
 2044|  7.09k|            if ((tns->coef_res[w] = faad_get1bit(ld
  ------------------
  |  Branch (2044:17): [True: 2.38k, False: 4.70k]
  ------------------
 2045|  7.09k|                DEBUGVAR(1,75,"tns_data(): coef_res"))) & 1)
 2046|  2.38k|                start_coef_bits = 4;
 2047|       |#if 0
 2048|       |            printf("%d\n", tns->coef_res[w]);
 2049|       |#endif
 2050|  7.09k|        }
 2051|       |
 2052|  30.2k|        for (filt = 0; filt < tns->n_filt[w]; filt++)
  ------------------
  |  Branch (2052:24): [True: 9.95k, False: 20.2k]
  ------------------
 2053|  9.95k|        {
 2054|  9.95k|            tns->length[w][filt] = (uint8_t)faad_getbits(ld, length_bits
 2055|  9.95k|                DEBUGVAR(1,76,"tns_data(): length"));
 2056|       |#if 0
 2057|       |            printf("%d\n", tns->length[w][filt]);
 2058|       |#endif
 2059|  9.95k|            tns->order[w][filt]  = (uint8_t)faad_getbits(ld, order_bits
 2060|  9.95k|                DEBUGVAR(1,77,"tns_data(): order"));
 2061|       |#if 0
 2062|       |            printf("%d\n", tns->order[w][filt]);
 2063|       |#endif
 2064|  9.95k|            if (tns->order[w][filt])
  ------------------
  |  Branch (2064:17): [True: 4.83k, False: 5.12k]
  ------------------
 2065|  4.83k|            {
 2066|  4.83k|                tns->direction[w][filt] = faad_get1bit(ld
 2067|  4.83k|                    DEBUGVAR(1,78,"tns_data(): direction"));
 2068|       |#if 0
 2069|       |                printf("%d\n", tns->direction[w][filt]);
 2070|       |#endif
 2071|  4.83k|                tns->coef_compress[w][filt] = faad_get1bit(ld
 2072|  4.83k|                    DEBUGVAR(1,79,"tns_data(): coef_compress"));
 2073|       |#if 0
 2074|       |                printf("%d\n", tns->coef_compress[w][filt]);
 2075|       |#endif
 2076|       |
 2077|  4.83k|                coef_bits = start_coef_bits - tns->coef_compress[w][filt];
 2078|  25.1k|                for (i = 0; i < tns->order[w][filt]; i++)
  ------------------
  |  Branch (2078:29): [True: 20.3k, False: 4.83k]
  ------------------
 2079|  20.3k|                {
 2080|  20.3k|                    tns->coef[w][filt][i] = (uint8_t)faad_getbits(ld, coef_bits
 2081|  20.3k|                        DEBUGVAR(1,80,"tns_data(): coef"));
 2082|       |#if 0
 2083|       |                    printf("%d\n", tns->coef[w][filt][i]);
 2084|       |#endif
 2085|  20.3k|                }
 2086|  4.83k|            }
 2087|  9.95k|        }
 2088|  20.2k|    }
 2089|  13.6k|}
syntax.c:adts_fixed_header:
 2462|  4.11k|{
 2463|  4.11k|    uint16_t i;
 2464|  4.11k|    uint8_t sync_err = 1;
 2465|       |
 2466|       |    /* try to recover from sync errors */
 2467|  3.01M|    for (i = 0; i < 768; i++)
  ------------------
  |  Branch (2467:17): [True: 3.01M, False: 3.91k]
  ------------------
 2468|  3.01M|    {
 2469|  3.01M|        adts->syncword = (uint16_t)faad_showbits(ld, 12);
 2470|  3.01M|        if (adts->syncword != 0xFFF)
  ------------------
  |  Branch (2470:13): [True: 3.01M, False: 202]
  ------------------
 2471|  3.01M|        {
 2472|  3.01M|            faad_getbits(ld, 8
 2473|  3.01M|                DEBUGVAR(0,0,""));
 2474|  3.01M|        } else {
 2475|    202|            sync_err = 0;
 2476|    202|            faad_getbits(ld, 12
 2477|    202|                DEBUGVAR(1,118,"adts_fixed_header(): syncword"));
 2478|    202|            break;
 2479|    202|        }
 2480|  3.01M|    }
 2481|  4.11k|    if (sync_err)
  ------------------
  |  Branch (2481:9): [True: 3.91k, False: 202]
  ------------------
 2482|  3.91k|        return 5;
 2483|       |
 2484|    202|    adts->id = faad_get1bit(ld
 2485|    202|        DEBUGVAR(1,119,"adts_fixed_header(): id"));
 2486|    202|    adts->layer = (uint8_t)faad_getbits(ld, 2
 2487|    202|        DEBUGVAR(1,120,"adts_fixed_header(): layer"));
 2488|    202|    adts->protection_absent = faad_get1bit(ld
 2489|    202|        DEBUGVAR(1,121,"adts_fixed_header(): protection_absent"));
 2490|    202|    adts->profile = (uint8_t)faad_getbits(ld, 2
 2491|    202|        DEBUGVAR(1,122,"adts_fixed_header(): profile"));
 2492|    202|    adts->sf_index = (uint8_t)faad_getbits(ld, 4
 2493|    202|        DEBUGVAR(1,123,"adts_fixed_header(): sf_index"));
 2494|    202|    adts->private_bit = faad_get1bit(ld
 2495|    202|        DEBUGVAR(1,124,"adts_fixed_header(): private_bit"));
 2496|    202|    adts->channel_configuration = (uint8_t)faad_getbits(ld, 3
 2497|    202|        DEBUGVAR(1,125,"adts_fixed_header(): channel_configuration"));
 2498|    202|    adts->original = faad_get1bit(ld
 2499|    202|        DEBUGVAR(1,126,"adts_fixed_header(): original"));
 2500|    202|    adts->home = faad_get1bit(ld
 2501|    202|        DEBUGVAR(1,127,"adts_fixed_header(): home"));
 2502|       |
 2503|    202|    if (adts->old_format == 1)
  ------------------
  |  Branch (2503:9): [True: 0, False: 202]
  ------------------
 2504|      0|    {
 2505|       |        /* Removed in corrigendum 14496-3:2002 */
 2506|      0|        if (adts->id == 0)
  ------------------
  |  Branch (2506:13): [True: 0, False: 0]
  ------------------
 2507|      0|        {
 2508|      0|            adts->emphasis = (uint8_t)faad_getbits(ld, 2
 2509|      0|                DEBUGVAR(1,128,"adts_fixed_header(): emphasis"));
 2510|      0|        }
 2511|      0|    }
 2512|       |
 2513|    202|    return 0;
 2514|  4.11k|}
syntax.c:adts_variable_header:
 2518|    202|{
 2519|    202|    adts->copyright_identification_bit = faad_get1bit(ld
 2520|    202|        DEBUGVAR(1,129,"adts_variable_header(): copyright_identification_bit"));
 2521|    202|    adts->copyright_identification_start = faad_get1bit(ld
 2522|    202|        DEBUGVAR(1,130,"adts_variable_header(): copyright_identification_start"));
 2523|    202|    adts->aac_frame_length = (uint16_t)faad_getbits(ld, 13
 2524|    202|        DEBUGVAR(1,131,"adts_variable_header(): aac_frame_length"));
 2525|    202|    adts->adts_buffer_fullness = (uint16_t)faad_getbits(ld, 11
 2526|    202|        DEBUGVAR(1,132,"adts_variable_header(): adts_buffer_fullness"));
 2527|    202|    adts->no_raw_data_blocks_in_frame = (uint8_t)faad_getbits(ld, 2
 2528|    202|        DEBUGVAR(1,133,"adts_variable_header(): no_raw_data_blocks_in_frame"));
 2529|    202|}
syntax.c:adts_error_check:
 2533|    202|{
 2534|    202|    if (adts->protection_absent == 0)
  ------------------
  |  Branch (2534:9): [True: 76, False: 126]
  ------------------
 2535|     76|    {
 2536|     76|        adts->crc_check = (uint16_t)faad_getbits(ld, 16
 2537|     76|            DEBUGVAR(1,134,"adts_error_check(): crc_check"));
 2538|     76|    }
 2539|    202|}

tns_decode_frame:
   86|   111k|{
   87|   111k|    uint8_t w, f, tns_order;
   88|   111k|    int8_t inc;
   89|   111k|    int16_t size;
   90|   111k|    uint16_t bottom, top, start, end;
   91|   111k|    uint16_t nshort = frame_len/8;
   92|   111k|    real_t lpc[TNS_MAX_ORDER+1];
   93|   111k|    uint8_t exp;
   94|       |
   95|   111k|    if (!ics->tns_data_present)
  ------------------
  |  Branch (95:9): [True: 97.5k, False: 13.4k]
  ------------------
   96|  97.5k|        return;
   97|       |
   98|  32.9k|    for (w = 0; w < ics->num_windows; w++)
  ------------------
  |  Branch (98:17): [True: 19.4k, False: 13.4k]
  ------------------
   99|  19.4k|    {
  100|  19.4k|        bottom = ics->num_swb;
  101|       |
  102|  29.1k|        for (f = 0; f < tns->n_filt[w]; f++)
  ------------------
  |  Branch (102:21): [True: 9.67k, False: 19.4k]
  ------------------
  103|  9.67k|        {
  104|  9.67k|            top = bottom;
  105|  9.67k|            bottom = max(top - tns->length[w][f], 0);
  ------------------
  |  |   57|  9.67k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 6.46k, False: 3.21k]
  |  |  ------------------
  ------------------
  106|  9.67k|            tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
  ------------------
  |  |   60|  9.67k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 9.52k, False: 150]
  |  |  ------------------
  ------------------
  107|  9.67k|            if (!tns_order)
  ------------------
  |  Branch (107:17): [True: 5.08k, False: 4.59k]
  ------------------
  108|  5.08k|                continue;
  109|       |
  110|  4.59k|            exp = tns_decode_coef(tns_order, tns->coef_res[w]+3,
  111|  4.59k|                tns->coef_compress[w][f], tns->coef[w][f], lpc);
  112|       |
  113|  4.59k|            start = min(bottom, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
  ------------------
  |  |   60|  4.59k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 3.78k, False: 804]
  |  |  ------------------
  ------------------
  114|  4.59k|            start = min(start, ics->max_sfb);
  ------------------
  |  |   60|  4.59k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 264, False: 4.32k]
  |  |  ------------------
  ------------------
  115|  4.59k|            start = min(ics->swb_offset[start], ics->swb_offset_max);
  ------------------
  |  |   60|  4.59k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.55k, False: 40]
  |  |  ------------------
  ------------------
  116|       |
  117|  4.59k|            end = min(top, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
  ------------------
  |  |   60|  4.59k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 2.00k, False: 2.58k]
  |  |  ------------------
  ------------------
  118|  4.59k|            end = min(end, ics->max_sfb);
  ------------------
  |  |   60|  4.59k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 81, False: 4.50k]
  |  |  ------------------
  ------------------
  119|  4.59k|            end = min(ics->swb_offset[end], ics->swb_offset_max);
  ------------------
  |  |   60|  4.59k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.51k, False: 80]
  |  |  ------------------
  ------------------
  120|       |
  121|  4.59k|            size = end - start;
  122|  4.59k|            if (size <= 0)
  ------------------
  |  Branch (122:17): [True: 4.35k, False: 233]
  ------------------
  123|  4.35k|                continue;
  124|       |
  125|    233|            if (tns->direction[w][f])
  ------------------
  |  Branch (125:17): [True: 159, False: 74]
  ------------------
  126|    159|            {
  127|    159|                inc = -1;
  128|    159|                start = end - 1;
  129|    159|            } else {
  130|     74|                inc = 1;
  131|     74|            }
  132|       |
  133|    233|            tns_ar_filter(&spec[(w*nshort)+start], size, inc, lpc, tns_order, exp);
  134|    233|        }
  135|  19.4k|    }
  136|  13.4k|}
tns.c:tns_decode_coef:
  196|  4.59k|{
  197|  4.59k|    uint8_t i, m;
  198|  4.59k|    real_t tmp2[TNS_MAX_ORDER+1], b[TNS_MAX_ORDER+1];
  199|  4.59k|    uint8_t table_index = 2 * (coef_compress != 0) + (coef_res_bits != 3);
  200|  4.59k|    real_t* tns_coef = all_tns_coefs[table_index];
  201|  4.59k|    uint8_t exp = 0;
  202|       |
  203|       |    /* Conversion to signed integer */
  204|  22.1k|    for (i = 0; i < order; i++)
  ------------------
  |  Branch (204:17): [True: 17.5k, False: 4.59k]
  ------------------
  205|  17.5k|        tmp2[i] = tns_coef[coef[i]];
  206|       |
  207|       |    /* Conversion to LPC coefficients */
  208|  4.59k|    a[0] = COEF_CONST(1.0);
  ------------------
  |  |  289|  4.59k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  209|  22.1k|    for (m = 1; m <= order; m++)
  ------------------
  |  Branch (209:17): [True: 17.5k, False: 4.59k]
  ------------------
  210|  17.5k|    {
  211|  17.5k|        a[m] = tmp2[m-1]; /* changed */
  212|  76.4k|        for (i = 1; i < m; i++) /* loop only while i<m */
  ------------------
  |  Branch (212:21): [True: 58.9k, False: 17.5k]
  ------------------
  213|  58.9k|            b[i] = a[i] + MUL_C(a[m], a[m-i]);
  ------------------
  |  |  285|  58.9k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  214|       |
  215|  76.4k|        for (i = 1; i < m; i++) /* loop only while i<m */
  ------------------
  |  Branch (215:21): [True: 58.9k, False: 17.5k]
  ------------------
  216|  58.9k|            a[i] = b[i];
  217|       |
  218|       |#ifdef FIXED_POINT
  219|       |        a[m] >>= exp;
  220|       |
  221|       |        /* OK not to check after the last iteration. */
  222|       |        if (m < order)
  223|       |        {
  224|       |            real_t sum_abs = COEF_CONST(0.0);
  225|       |            for (i = 1; i <= m; ++i)
  226|       |            {
  227|       |                sum_abs += (a[i] >= 0) ? a[i] : -a[i];
  228|       |            }
  229|       |            /* Next iteration would turn sum to 2*sum + 1; maximal "coef" is 7.999 */
  230|       |            if (sum_abs >= COEF_CONST(3.5))
  231|       |            {
  232|       |                exp++;
  233|       |                for (i = 1; i <= m; ++i)
  234|       |                {
  235|       |                    a[i] >>= 1;
  236|       |                }
  237|       |            }
  238|       |        }
  239|       |#endif
  240|  17.5k|    }
  241|  4.59k|    return exp;
  242|  4.59k|}
tns.c:tns_ar_filter:
  246|    233|{
  247|       |    /*
  248|       |     - Simple all-pole filter of order "order" defined by
  249|       |       y(n) = x(n) - lpc[1]*y(n-1) - ... - lpc[order]*y(n-order)
  250|       |     - The state variables of the filter are initialized to zero every time
  251|       |     - The output data is written over the input data ("in-place operation")
  252|       |     - An input vector of "size" samples is processed and the index increment
  253|       |       to the next data sample is given by "inc"
  254|       |    */
  255|       |
  256|    233|    uint8_t j;
  257|    233|    uint16_t i;
  258|       |    /* state is stored as a double ringbuffer */
  259|    233|    real_t state[2*TNS_MAX_ORDER] = {0};
  260|    233|    int8_t state_index = 0;
  261|    233|    int32_t mul = 1;
  262|       |
  263|       |#ifdef FIXED_POINT
  264|       |    if (exp >= 4)
  265|       |        return;
  266|       |    mul = 1 << exp;
  267|       |#else
  268|    233|    (void)exp;
  269|    233|#endif
  270|       |
  271|  25.2k|    for (i = 0; i < size; i++)
  ------------------
  |  Branch (271:17): [True: 25.0k, False: 233]
  ------------------
  272|  25.0k|    {
  273|  25.0k|        real_t y = REAL_CONST(0.0);
  ------------------
  |  |  288|  25.0k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  274|   353k|        for (j = 0; j < order; j++)
  ------------------
  |  Branch (274:21): [True: 328k, False: 25.0k]
  ------------------
  275|   328k|            y += MUL_C(state[state_index+j], lpc[j+1]);
  ------------------
  |  |  285|   328k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  276|  25.0k|        y = *spectrum - (y * mul);
  277|       |
  278|       |        /* double ringbuffer state */
  279|  25.0k|        state_index--;
  280|  25.0k|        if (state_index < 0)
  ------------------
  |  Branch (280:13): [True: 3.94k, False: 21.0k]
  ------------------
  281|  3.94k|            state_index = order-1;
  282|  25.0k|        state[state_index] = state[state_index + order] = y;
  283|       |
  284|  25.0k|        *spectrum = y;
  285|  25.0k|        spectrum += inc;
  286|       |
  287|       |//#define TNS_PRINT
  288|       |#ifdef TNS_PRINT
  289|       |        //printf("%d\n", y);
  290|       |        printf("0x%.8X\n", y);
  291|       |#endif
  292|  25.0k|    }
  293|    233|}

