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

faad_initbits:
   56|  25.4k|{
   57|  25.4k|    uint32_t tmp;
   58|       |
   59|  25.4k|    if (ld == NULL)
  ------------------
  |  Branch (59:9): [True: 0, False: 25.4k]
  ------------------
   60|      0|        return;
   61|       |
   62|  25.4k|    if (buffer_size == 0 || _buffer == NULL)
  ------------------
  |  Branch (62:9): [True: 6.64k, False: 18.7k]
  |  Branch (62:29): [True: 0, False: 18.7k]
  ------------------
   63|  6.64k|    {
   64|  6.64k|        ld->error = 1;
   65|  6.64k|        return;
   66|  6.64k|    }
   67|       |
   68|  18.7k|    ld->buffer = _buffer;
   69|       |
   70|  18.7k|    ld->buffer_size = buffer_size;
   71|  18.7k|    ld->bytes_left  = buffer_size;
   72|       |
   73|  18.7k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (73:9): [True: 10.3k, False: 8.43k]
  ------------------
   74|  10.3k|    {
   75|  10.3k|        tmp = getdword((uint32_t*)ld->buffer);
   76|  10.3k|        ld->bytes_left -= 4;
   77|  10.3k|    } else {
   78|  8.43k|        tmp = getdword_n((uint32_t*)ld->buffer, ld->bytes_left);
   79|  8.43k|        ld->bytes_left = 0;
   80|  8.43k|    }
   81|  18.7k|    ld->bufa = tmp;
   82|       |
   83|  18.7k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (83:9): [True: 7.73k, False: 11.0k]
  ------------------
   84|  7.73k|    {
   85|  7.73k|        tmp = getdword((uint32_t*)ld->buffer + 1);
   86|  7.73k|        ld->bytes_left -= 4;
   87|  11.0k|    } else {
   88|  11.0k|        tmp = getdword_n((uint32_t*)ld->buffer + 1, ld->bytes_left);
   89|  11.0k|        ld->bytes_left = 0;
   90|  11.0k|    }
   91|  18.7k|    ld->bufb = tmp;
   92|       |
   93|  18.7k|    ld->start = (uint32_t*)ld->buffer;
   94|  18.7k|    ld->tail = ((uint32_t*)ld->buffer + 2);
   95|       |
   96|  18.7k|    ld->bits_left = 32;
   97|       |
   98|  18.7k|    ld->error = 0;
   99|  18.7k|}
faad_endbits:
  102|  21.5k|{
  103|  21.5k|    (void)ld;
  104|  21.5k|}
faad_get_processed_bits:
  107|  31.2M|{
  108|  31.2M|    return (uint32_t)(8 * (4*(ld->tail - ld->start) - 4) - (ld->bits_left));
  109|  31.2M|}
faad_byte_align:
  112|   108k|{
  113|   108k|    int remainder = (32 - ld->bits_left) & 0x7;
  114|       |
  115|   108k|    if (remainder)
  ------------------
  |  Branch (115:9): [True: 11.0k, False: 97.2k]
  ------------------
  116|  11.0k|    {
  117|  11.0k|        faad_flushbits(ld, 8 - remainder);
  118|  11.0k|        return (uint8_t)(8 - remainder);
  119|  11.0k|    }
  120|  97.2k|    return 0;
  121|   108k|}
faad_flushbits_ex:
  124|  8.71M|{
  125|  8.71M|    uint32_t tmp;
  126|       |
  127|  8.71M|    ld->bufa = ld->bufb;
  128|  8.71M|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (128:9): [True: 5.67M, False: 3.03M]
  ------------------
  129|  5.67M|    {
  130|  5.67M|        tmp = getdword(ld->tail);
  131|  5.67M|        ld->bytes_left -= 4;
  132|  5.67M|    } else {
  133|  3.03M|        tmp = getdword_n(ld->tail, ld->bytes_left);
  134|  3.03M|        ld->bytes_left = 0;
  135|  3.03M|    }
  136|  8.71M|    ld->bufb = tmp;
  137|  8.71M|    ld->tail++;
  138|  8.71M|    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|  8.71M|}
faad_rewindbits:
  149|    865|{
  150|    865|    uint32_t tmp;
  151|       |
  152|    865|    ld->bytes_left = ld->buffer_size;
  153|       |
  154|    865|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (154:9): [True: 803, False: 62]
  ------------------
  155|    803|    {
  156|    803|        tmp = getdword((uint32_t*)&ld->start[0]);
  157|    803|        ld->bytes_left -= 4;
  158|    803|    } else {
  159|     62|        tmp = getdword_n((uint32_t*)&ld->start[0], ld->bytes_left);
  160|     62|        ld->bytes_left = 0;
  161|     62|    }
  162|    865|    ld->bufa = tmp;
  163|       |
  164|    865|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (164:9): [True: 655, False: 210]
  ------------------
  165|    655|    {
  166|    655|        tmp = getdword((uint32_t*)&ld->start[1]);
  167|    655|        ld->bytes_left -= 4;
  168|    655|    } else {
  169|    210|        tmp = getdword_n((uint32_t*)&ld->start[1], ld->bytes_left);
  170|    210|        ld->bytes_left = 0;
  171|    210|    }
  172|    865|    ld->bufb = tmp;
  173|       |
  174|    865|    ld->bits_left = 32;
  175|    865|    ld->tail = &ld->start[2];
  176|    865|}
faad_resetbits:
  181|  17.5k|{
  182|  17.5k|    uint32_t tmp;
  183|  17.5k|    uint32_t words = bits >> 5;
  184|  17.5k|    uint32_t remainder = bits & 0x1F;
  185|       |
  186|  17.5k|    if (ld->buffer_size < words * 4)
  ------------------
  |  Branch (186:9): [True: 176, False: 17.3k]
  ------------------
  187|    176|        ld->bytes_left = 0;
  188|  17.3k|    else
  189|  17.3k|        ld->bytes_left = ld->buffer_size - words*4;
  190|       |
  191|  17.5k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (191:9): [True: 16.9k, False: 578]
  ------------------
  192|  16.9k|    {
  193|  16.9k|        tmp = getdword(&ld->start[words]);
  194|  16.9k|        ld->bytes_left -= 4;
  195|  16.9k|    } else {
  196|    578|        tmp = getdword_n(&ld->start[words], ld->bytes_left);
  197|    578|        ld->bytes_left = 0;
  198|    578|    }
  199|  17.5k|    ld->bufa = tmp;
  200|       |
  201|  17.5k|    if (ld->bytes_left >= 4)
  ------------------
  |  Branch (201:9): [True: 16.2k, False: 1.22k]
  ------------------
  202|  16.2k|    {
  203|  16.2k|        tmp = getdword(&ld->start[words+1]);
  204|  16.2k|        ld->bytes_left -= 4;
  205|  16.2k|    } else {
  206|  1.22k|        tmp = getdword_n(&ld->start[words+1], ld->bytes_left);
  207|  1.22k|        ld->bytes_left = 0;
  208|  1.22k|    }
  209|  17.5k|    ld->bufb = tmp;
  210|       |
  211|  17.5k|    ld->bits_left = 32 - remainder;
  212|  17.5k|    ld->tail = &ld->start[words+2];
  213|       |
  214|       |    /* recheck for reading too many bytes */
  215|  17.5k|    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|  17.5k|}
faad_getbitbuffer:
  224|  2.22k|{
  225|  2.22k|    int i;
  226|  2.22k|    unsigned int temp;
  227|  2.22k|    int bytes = bits >> 3;
  228|  2.22k|    int remainder = bits & 0x7;
  229|       |
  230|  2.22k|    uint8_t *buffer = (uint8_t*)faad_malloc((bytes+1)*sizeof(uint8_t));
  231|       |
  232|  28.0k|    for (i = 0; i < bytes; i++)
  ------------------
  |  Branch (232:17): [True: 25.8k, False: 2.22k]
  ------------------
  233|  25.8k|    {
  234|  25.8k|        buffer[i] = (uint8_t)faad_getbits(ld, 8 DEBUGVAR(print,var,dbg));
  235|  25.8k|    }
  236|       |
  237|  2.22k|    if (remainder)
  ------------------
  |  Branch (237:9): [True: 861, False: 1.36k]
  ------------------
  238|    861|    {
  239|    861|        temp = faad_getbits(ld, remainder DEBUGVAR(print,var,dbg)) << (8-remainder);
  240|       |
  241|    861|        buffer[bytes] = (uint8_t)temp;
  242|    861|    }
  243|       |
  244|  2.22k|    return buffer;
  245|  2.22k|}
faad_origbitbuffer:
  250|    462|{
  251|    462|    return (void*)ld->start;
  252|    462|}
faad_origbitbuffer_size:
  256|    462|{
  257|    462|    return ld->buffer_size;
  258|    462|}
bits.c:getdword_n:
   39|  3.06M|{
   40|  3.06M|    uint8_t* m8 = (uint8_t*)mem;
   41|  3.06M|    switch (n)
   42|  3.06M|    {
   43|  5.00k|    case 3:
  ------------------
  |  Branch (43:5): [True: 5.00k, False: 3.05M]
  ------------------
   44|  5.00k|        return ((uint32_t)m8[2] << 8) | ((uint32_t)m8[1] << 16) | ((uint32_t)m8[0] << 24);
   45|  4.35k|    case 2:
  ------------------
  |  Branch (45:5): [True: 4.35k, False: 3.05M]
  ------------------
   46|  4.35k|        return ((uint32_t)m8[1] << 16) | ((uint32_t)m8[0] << 24);
   47|  9.88k|    case 1:
  ------------------
  |  Branch (47:5): [True: 9.88k, False: 3.05M]
  ------------------
   48|  9.88k|        return (uint32_t)m8[0] << 24;
   49|  3.04M|    default:
  ------------------
  |  Branch (49:5): [True: 3.04M, False: 19.2k]
  ------------------
   50|  3.04M|        return 0;
   51|  3.06M|    }
   52|  3.06M|}

decoder.c:faad_getbits:
  131|    827|{
  132|    827|    uint32_t ret;
  133|       |
  134|    827|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 827]
  ------------------
  135|      0|        return 0;
  136|       |
  137|    827|    ret = faad_showbits(ld, n);
  138|    827|    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|    827|    return ret;
  146|    827|}
decoder.c:faad_showbits:
  103|    827|{
  104|    827|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 827, False: 0]
  ------------------
  105|    827|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|    827|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|    827|    }
  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|    827|}
decoder.c:faad_flushbits:
  116|    827|{
  117|       |    /* do nothing if error */
  118|    827|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 827]
  ------------------
  119|      0|        return;
  120|       |
  121|    827|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 827, False: 0]
  ------------------
  122|    827|    {
  123|    827|        ld->bits_left -= bits;
  124|    827|    } else {
  125|      0|        faad_flushbits_ex(ld, bits);
  126|      0|    }
  127|    827|}
bits.c:getdword:
   97|  5.72M|{
   98|  5.72M|    uint8_t* m8 = (uint8_t*)mem;
   99|  5.72M|    return (uint32_t)m8[3] | ((uint32_t)m8[2] << 8) | ((uint32_t)m8[1] << 16) | ((uint32_t)m8[0] << 24);
  100|  5.72M|}
bits.c:faad_flushbits:
  116|  37.8k|{
  117|       |    /* do nothing if error */
  118|  37.8k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 37.8k]
  ------------------
  119|      0|        return;
  120|       |
  121|  37.8k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 27.8k, False: 9.97k]
  ------------------
  122|  27.8k|    {
  123|  27.8k|        ld->bits_left -= bits;
  124|  27.8k|    } else {
  125|  9.97k|        faad_flushbits_ex(ld, bits);
  126|  9.97k|    }
  127|  37.8k|}
bits.c:faad_getbits:
  131|  26.7k|{
  132|  26.7k|    uint32_t ret;
  133|       |
  134|  26.7k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 26.7k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  26.7k|    ret = faad_showbits(ld, n);
  138|  26.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|  26.7k|    return ret;
  146|  26.7k|}
bits.c:faad_showbits:
  103|  26.7k|{
  104|  26.7k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 21.5k, False: 5.20k]
  ------------------
  105|  21.5k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  21.5k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  21.5k|    }
  109|       |
  110|  5.20k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  5.20k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  26.7k|}
mp4.c:faad_getbits:
  131|  12.0k|{
  132|  12.0k|    uint32_t ret;
  133|       |
  134|  12.0k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 12.0k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  12.0k|    ret = faad_showbits(ld, n);
  138|  12.0k|    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|  12.0k|    return ret;
  146|  12.0k|}
mp4.c:faad_showbits:
  103|  12.0k|{
  104|  12.0k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 10.6k, False: 1.42k]
  ------------------
  105|  10.6k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  10.6k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  10.6k|    }
  109|       |
  110|  1.42k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  1.42k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  12.0k|}
mp4.c:faad_flushbits:
  116|  12.0k|{
  117|       |    /* do nothing if error */
  118|  12.0k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 12.0k]
  ------------------
  119|      0|        return;
  120|       |
  121|  12.0k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 10.4k, False: 1.59k]
  ------------------
  122|  10.4k|    {
  123|  10.4k|        ld->bits_left -= bits;
  124|  10.4k|    } else {
  125|  1.59k|        faad_flushbits_ex(ld, bits);
  126|  1.59k|    }
  127|  12.0k|}
mp4.c:faad_get1bit:
  149|    112|{
  150|    112|    uint8_t r;
  151|       |
  152|    112|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 112, False: 0]
  ------------------
  153|    112|    {
  154|    112|        ld->bits_left--;
  155|    112|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|    112|        return r;
  157|    112|    }
  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|    112|}
drm_dec.c:faad_get1bit:
  149|  1.95M|{
  150|  1.95M|    uint8_t r;
  151|       |
  152|  1.95M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 1.91M, False: 40.8k]
  ------------------
  153|  1.91M|    {
  154|  1.91M|        ld->bits_left--;
  155|  1.91M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  1.91M|        return r;
  157|  1.91M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  40.8k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  40.8k|#endif
  166|  40.8k|    return r;
  167|  1.95M|}
drm_dec.c:faad_getbits:
  131|  40.8k|{
  132|  40.8k|    uint32_t ret;
  133|       |
  134|  40.8k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 40.8k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  40.8k|    ret = faad_showbits(ld, n);
  138|  40.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|  40.8k|    return ret;
  146|  40.8k|}
drm_dec.c:faad_showbits:
  103|  40.8k|{
  104|  40.8k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 0, False: 40.8k]
  ------------------
  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|  40.8k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  40.8k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  40.8k|}
drm_dec.c:faad_flushbits:
  116|  40.8k|{
  117|       |    /* do nothing if error */
  118|  40.8k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 40.8k]
  ------------------
  119|      0|        return;
  120|       |
  121|  40.8k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 0, False: 40.8k]
  ------------------
  122|      0|    {
  123|      0|        ld->bits_left -= bits;
  124|  40.8k|    } else {
  125|  40.8k|        faad_flushbits_ex(ld, bits);
  126|  40.8k|    }
  127|  40.8k|}
syntax.c:faad_get1bit:
  149|  1.33M|{
  150|  1.33M|    uint8_t r;
  151|       |
  152|  1.33M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 1.31M, False: 11.7k]
  ------------------
  153|  1.31M|    {
  154|  1.31M|        ld->bits_left--;
  155|  1.31M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  1.31M|        return r;
  157|  1.31M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  11.7k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  11.7k|#endif
  166|  11.7k|    return r;
  167|  1.33M|}
syntax.c:faad_getbits:
  131|  26.3M|{
  132|  26.3M|    uint32_t ret;
  133|       |
  134|  26.3M|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 26.3M]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  26.3M|    ret = faad_showbits(ld, n);
  138|  26.3M|    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.3M|    return ret;
  146|  26.3M|}
syntax.c:faad_showbits:
  103|  30.5M|{
  104|  30.5M|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 29.2M, False: 1.31M]
  ------------------
  105|  29.2M|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  29.2M|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  29.2M|    }
  109|       |
  110|  1.31M|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  1.31M|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  30.5M|}
syntax.c:faad_flushbits:
  116|  26.4M|{
  117|       |    /* do nothing if error */
  118|  26.4M|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 4, False: 26.4M]
  ------------------
  119|      4|        return;
  120|       |
  121|  26.4M|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 20.0M, False: 6.40M]
  ------------------
  122|  20.0M|    {
  123|  20.0M|        ld->bits_left -= bits;
  124|  20.0M|    } else {
  125|  6.40M|        faad_flushbits_ex(ld, bits);
  126|  6.40M|    }
  127|  26.4M|}
syntax.c:faad_check_CRC:
  287|    865|{
  288|    865|    int bytes, rem;
  289|    865|    unsigned int CRC;
  290|    865|    unsigned int r=255;  /* Initialize to all ones */
  291|       |
  292|       |    /* CRC polynome used x^8 + x^4 + x^3 + x^2 +1 */
  293|    865|#define GPOLY 0435
  294|       |
  295|    865|    faad_rewindbits(ld);
  296|       |
  297|    865|    CRC = (unsigned int) ~faad_getbits(ld, 8
  298|    865|        DEBUGVAR(1,999,"faad_check_CRC(): CRC")) & 0xFF;          /* CRC is stored inverted */
  299|       |
  300|    865|    bytes = len >> 3;
  301|    865|    rem = len & 0x7;
  302|       |
  303|  15.7k|    for (; bytes > 0; bytes--)
  ------------------
  |  Branch (303:12): [True: 14.8k, False: 865]
  ------------------
  304|  14.8k|    {
  305|  14.8k|        r = crc_table_G8[( r ^ faad_getbits(ld, 8 DEBUGVAR(1,998,"")) ) & 0xFF];
  306|  14.8k|    }
  307|  2.84k|    for (; rem > 0; rem--)
  ------------------
  |  Branch (307:12): [True: 1.97k, False: 865]
  ------------------
  308|  1.97k|    {
  309|  1.97k|        r = ( (r << 1) ^ (( ( faad_get1bit(ld
  310|  1.97k|            DEBUGVAR(1,998,""))  & 1) ^ ((r >> 7) & 1)) * GPOLY )) & 0xFF;
  ------------------
  |  |  293|  1.97k|#define GPOLY 0435
  ------------------
  311|  1.97k|    }
  312|       |
  313|    865|    if (r != CRC)
  ------------------
  |  Branch (313:9): [True: 213, False: 652]
  ------------------
  314|       |  //  if (0)
  315|    213|    {
  316|    213|        return 28;
  317|    652|    } else {
  318|    652|        return 0;
  319|    652|    }
  320|    865|}
syntax.c:reverse_byte:
  342|  5.63M|{
  343|  5.63M|    return tabFlipbits[b];
  344|  5.63M|}
sbr_syntax.c:faad_getbits:
  131|  1.51M|{
  132|  1.51M|    uint32_t ret;
  133|       |
  134|  1.51M|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 2.25k, False: 1.50M]
  ------------------
  135|  2.25k|        return 0;
  136|       |
  137|  1.50M|    ret = faad_showbits(ld, n);
  138|  1.50M|    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.50M|    return ret;
  146|  1.51M|}
sbr_syntax.c:faad_showbits:
  103|  1.50M|{
  104|  1.50M|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 1.36M, False: 144k]
  ------------------
  105|  1.36M|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  1.36M|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  1.36M|    }
  109|       |
  110|   144k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|   144k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  1.50M|}
sbr_syntax.c:faad_flushbits:
  116|  1.50M|{
  117|       |    /* do nothing if error */
  118|  1.50M|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 43, False: 1.50M]
  ------------------
  119|     43|        return;
  120|       |
  121|  1.50M|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 1.32M, False: 185k]
  ------------------
  122|  1.32M|    {
  123|  1.32M|        ld->bits_left -= bits;
  124|  1.32M|    } else {
  125|   185k|        faad_flushbits_ex(ld, bits);
  126|   185k|    }
  127|  1.50M|}
sbr_syntax.c:faad_get1bit:
  149|   577k|{
  150|   577k|    uint8_t r;
  151|       |
  152|   577k|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 560k, False: 16.3k]
  ------------------
  153|   560k|    {
  154|   560k|        ld->bits_left--;
  155|   560k|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|   560k|        return r;
  157|   560k|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  16.3k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  16.3k|#endif
  166|  16.3k|    return r;
  167|   577k|}
sbr_huff.c:faad_getbits:
  131|   150k|{
  132|   150k|    uint32_t ret;
  133|       |
  134|   150k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 150k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|   150k|    ret = faad_showbits(ld, n);
  138|   150k|    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|   150k|    return ret;
  146|   150k|}
sbr_huff.c:faad_showbits:
  103|   150k|{
  104|   150k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 68.9k, False: 81.8k]
  ------------------
  105|  68.9k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  68.9k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  68.9k|    }
  109|       |
  110|  81.8k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  81.8k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|   150k|}
sbr_huff.c:faad_flushbits:
  116|   150k|{
  117|       |    /* do nothing if error */
  118|   150k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 34, False: 150k]
  ------------------
  119|     34|        return;
  120|       |
  121|   150k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 66.7k, False: 83.9k]
  ------------------
  122|  66.7k|    {
  123|  66.7k|        ld->bits_left -= bits;
  124|  83.9k|    } else {
  125|  83.9k|        faad_flushbits_ex(ld, bits);
  126|  83.9k|    }
  127|   150k|}
sbr_huff.c:faad_get1bit:
  149|  2.25M|{
  150|  2.25M|    uint8_t r;
  151|       |
  152|  2.25M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 2.18M, False: 67.8k]
  ------------------
  153|  2.18M|    {
  154|  2.18M|        ld->bits_left--;
  155|  2.18M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  2.18M|        return r;
  157|  2.18M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  67.8k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  67.8k|#endif
  166|  67.8k|    return r;
  167|  2.25M|}
ps_syntax.c:faad_get1bit:
  149|  31.2M|{
  150|  31.2M|    uint8_t r;
  151|       |
  152|  31.2M|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 30.6M, False: 521k]
  ------------------
  153|  30.6M|    {
  154|  30.6M|        ld->bits_left--;
  155|  30.6M|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  30.6M|        return r;
  157|  30.6M|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|   521k|    r = (uint8_t)faad_getbits(ld, 1);
  165|   521k|#endif
  166|   521k|    return r;
  167|  31.2M|}
ps_syntax.c:faad_getbits:
  131|  15.4M|{
  132|  15.4M|    uint32_t ret;
  133|       |
  134|  15.4M|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 2.96k, False: 15.4M]
  ------------------
  135|  2.96k|        return 0;
  136|       |
  137|  15.4M|    ret = faad_showbits(ld, n);
  138|  15.4M|    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|  15.4M|    return ret;
  146|  15.4M|}
ps_syntax.c:faad_showbits:
  103|  15.4M|{
  104|  15.4M|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 13.8M, False: 1.61M]
  ------------------
  105|  13.8M|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  13.8M|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  13.8M|    }
  109|       |
  110|  1.61M|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  1.61M|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  15.4M|}
ps_syntax.c:faad_flushbits:
  116|  15.4M|{
  117|       |    /* do nothing if error */
  118|  15.4M|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 15.4M]
  ------------------
  119|      0|        return;
  120|       |
  121|  15.4M|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 13.5M, False: 1.91M]
  ------------------
  122|  13.5M|    {
  123|  13.5M|        ld->bits_left -= bits;
  124|  13.5M|    } else {
  125|  1.91M|        faad_flushbits_ex(ld, bits);
  126|  1.91M|    }
  127|  15.4M|}
hcr.c:faad_getbits:
  131|  66.2k|{
  132|  66.2k|    uint32_t ret;
  133|       |
  134|  66.2k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 66.2k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  66.2k|    ret = faad_showbits(ld, n);
  138|  66.2k|    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|  66.2k|    return ret;
  146|  66.2k|}
hcr.c:faad_showbits:
  103|  66.2k|{
  104|  66.2k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 41.4k, False: 24.8k]
  ------------------
  105|  41.4k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  41.4k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  41.4k|    }
  109|       |
  110|  24.8k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  24.8k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  66.2k|}
hcr.c:faad_flushbits:
  116|  66.2k|{
  117|       |    /* do nothing if error */
  118|  66.2k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 66.2k]
  ------------------
  119|      0|        return;
  120|       |
  121|  66.2k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 39.6k, False: 26.6k]
  ------------------
  122|  39.6k|    {
  123|  39.6k|        ld->bits_left -= bits;
  124|  39.6k|    } else {
  125|  26.6k|        faad_flushbits_ex(ld, bits);
  126|  26.6k|    }
  127|  66.2k|}
hcr.c:showbits_hcr:
  362|    499|{
  363|    499|    uint32_t mask;
  364|    499|    int8_t tail;
  365|    499|    if (bits == 0) return 0;
  ------------------
  |  Branch (365:9): [True: 60, False: 439]
  ------------------
  366|    439|    if (ld->len == 0) return 0;
  ------------------
  |  Branch (366:9): [True: 0, False: 439]
  ------------------
  367|    439|    tail = ld->len - bits;
  368|    439|    mask = 0xFFFFFFFF >> (32 - bits);
  369|    439|    if (ld->len <= 32)
  ------------------
  |  Branch (369:9): [True: 301, False: 138]
  ------------------
  370|    301|    {
  371|       |        /* huffman_spectral_data_2 might request more than available (tail < 0),
  372|       |           pad with zeroes then. */
  373|    301|        if (tail >= 0)
  ------------------
  |  Branch (373:13): [True: 301, False: 0]
  ------------------
  374|    301|            return (ld->bufa >> tail) & mask; /* tail is 0..31 */
  375|      0|        else
  376|      0|            return (ld->bufa << -tail) & mask; /* -tail is 1..31 */
  377|    301|    } else {
  378|       |        /* tail is 1..63 */
  379|    138|        if (tail < 32)
  ------------------
  |  Branch (379:13): [True: 69, False: 69]
  ------------------
  380|     69|            return ((ld->bufb << (32 - tail)) | (ld->bufa >> tail)) & mask;
  381|     69|        else
  382|     69|            return (ld->bufb >> (tail - 32)) & mask;
  383|    138|    }
  384|    439|}
hcr.c:flushbits_hcr:
  388|    280|{
  389|    280|    ld->len -= bits;
  390|       |
  391|    280|    if (ld->len <0)
  ------------------
  |  Branch (391:9): [True: 0, False: 280]
  ------------------
  392|      0|    {
  393|      0|        ld->len = 0;
  394|      0|        return 1;
  395|    280|    } else {
  396|    280|        return 0;
  397|    280|    }
  398|    280|}
huffman.c:faad_get1bit:
  149|   426k|{
  150|   426k|    uint8_t r;
  151|       |
  152|   426k|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 413k, False: 13.1k]
  ------------------
  153|   413k|    {
  154|   413k|        ld->bits_left--;
  155|   413k|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|   413k|        return r;
  157|   413k|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|  13.1k|    r = (uint8_t)faad_getbits(ld, 1);
  165|  13.1k|#endif
  166|  13.1k|    return r;
  167|   426k|}
huffman.c:faad_getbits:
  131|  22.2k|{
  132|  22.2k|    uint32_t ret;
  133|       |
  134|  22.2k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 0, False: 22.2k]
  ------------------
  135|      0|        return 0;
  136|       |
  137|  22.2k|    ret = faad_showbits(ld, n);
  138|  22.2k|    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|  22.2k|    return ret;
  146|  22.2k|}
huffman.c:faad_showbits:
  103|   225k|{
  104|   225k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 184k, False: 41.7k]
  ------------------
  105|   184k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|   184k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|   184k|    }
  109|       |
  110|  41.7k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  41.7k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|   225k|}
huffman.c:faad_flushbits:
  116|   225k|{
  117|       |    /* do nothing if error */
  118|   225k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 225k]
  ------------------
  119|      0|        return;
  120|       |
  121|   225k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 186k, False: 39.0k]
  ------------------
  122|   186k|    {
  123|   186k|        ld->bits_left -= bits;
  124|   186k|    } else {
  125|  39.0k|        faad_flushbits_ex(ld, bits);
  126|  39.0k|    }
  127|   225k|}
huffman.c:showbits_hcr:
  362|   187k|{
  363|   187k|    uint32_t mask;
  364|   187k|    int8_t tail;
  365|   187k|    if (bits == 0) return 0;
  ------------------
  |  Branch (365:9): [True: 0, False: 187k]
  ------------------
  366|   187k|    if (ld->len == 0) return 0;
  ------------------
  |  Branch (366:9): [True: 9.06k, False: 177k]
  ------------------
  367|   177k|    tail = ld->len - bits;
  368|   177k|    mask = 0xFFFFFFFF >> (32 - bits);
  369|   177k|    if (ld->len <= 32)
  ------------------
  |  Branch (369:9): [True: 150k, False: 27.8k]
  ------------------
  370|   150k|    {
  371|       |        /* huffman_spectral_data_2 might request more than available (tail < 0),
  372|       |           pad with zeroes then. */
  373|   150k|        if (tail >= 0)
  ------------------
  |  Branch (373:13): [True: 130k, False: 19.9k]
  ------------------
  374|   130k|            return (ld->bufa >> tail) & mask; /* tail is 0..31 */
  375|  19.9k|        else
  376|  19.9k|            return (ld->bufa << -tail) & mask; /* -tail is 1..31 */
  377|   150k|    } else {
  378|       |        /* tail is 1..63 */
  379|  27.8k|        if (tail < 32)
  ------------------
  |  Branch (379:13): [True: 3.39k, False: 24.4k]
  ------------------
  380|  3.39k|            return ((ld->bufb << (32 - tail)) | (ld->bufa >> tail)) & mask;
  381|  24.4k|        else
  382|  24.4k|            return (ld->bufb >> (tail - 32)) & mask;
  383|  27.8k|    }
  384|   177k|}
huffman.c:flushbits_hcr:
  388|   187k|{
  389|   187k|    ld->len -= bits;
  390|       |
  391|   187k|    if (ld->len <0)
  ------------------
  |  Branch (391:9): [True: 19.5k, False: 167k]
  ------------------
  392|  19.5k|    {
  393|  19.5k|        ld->len = 0;
  394|  19.5k|        return 1;
  395|   167k|    } else {
  396|   167k|        return 0;
  397|   167k|    }
  398|   187k|}
huffman.c:get1bit_hcr:
  407|  92.8k|{
  408|  92.8k|    uint32_t res;
  409|  92.8k|    int8_t ret;
  410|       |
  411|  92.8k|    ret = getbits_hcr(ld, 1, &res);
  412|  92.8k|    *result = (int8_t)(res & 1);
  413|  92.8k|    return ret;
  414|  92.8k|}
huffman.c:getbits_hcr:
  401|  97.9k|{
  402|  97.9k|    *result = showbits_hcr(ld, n);
  403|  97.9k|    return flushbits_hcr(ld, n);
  404|  97.9k|}
rvlc.c:faad_get1bit:
  149|  13.2k|{
  150|  13.2k|    uint8_t r;
  151|       |
  152|  13.2k|    if (ld->bits_left > 0)
  ------------------
  |  Branch (152:9): [True: 13.0k, False: 196]
  ------------------
  153|  13.0k|    {
  154|  13.0k|        ld->bits_left--;
  155|  13.0k|        r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
  156|  13.0k|        return r;
  157|  13.0k|    }
  158|       |
  159|       |    /* bits_left == 0 */
  160|       |#if 0
  161|       |    r = (uint8_t)(ld->bufb >> 31);
  162|       |    faad_flushbits_ex(ld, 1);
  163|       |#else
  164|    196|    r = (uint8_t)faad_getbits(ld, 1);
  165|    196|#endif
  166|    196|    return r;
  167|  13.2k|}
rvlc.c:faad_getbits:
  131|  40.2k|{
  132|  40.2k|    uint32_t ret;
  133|       |
  134|  40.2k|    if (n == 0)
  ------------------
  |  Branch (134:9): [True: 12.4k, False: 27.8k]
  ------------------
  135|  12.4k|        return 0;
  136|       |
  137|  27.8k|    ret = faad_showbits(ld, n);
  138|  27.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|  27.8k|    return ret;
  146|  40.2k|}
rvlc.c:faad_showbits:
  103|  27.8k|{
  104|  27.8k|    if (bits <= ld->bits_left)
  ------------------
  |  Branch (104:9): [True: 23.9k, False: 3.89k]
  ------------------
  105|  23.9k|    {
  106|       |        //return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
  107|  23.9k|        return (ld->bufa << (32 - ld->bits_left)) >> (32 - bits);
  108|  23.9k|    }
  109|       |
  110|  3.89k|    bits -= ld->bits_left;
  111|       |    //return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
  112|  3.89k|    return ((ld->bufa & ((1u<<ld->bits_left)-1)) << bits) | (ld->bufb >> (32 - bits));
  113|  27.8k|}
rvlc.c:faad_flushbits:
  116|  27.8k|{
  117|       |    /* do nothing if error */
  118|  27.8k|    if (ld->error != 0)
  ------------------
  |  Branch (118:9): [True: 0, False: 27.8k]
  ------------------
  119|      0|        return;
  120|       |
  121|  27.8k|    if (bits < ld->bits_left)
  ------------------
  |  Branch (121:9): [True: 23.3k, False: 4.42k]
  ------------------
  122|  23.3k|    {
  123|  23.3k|        ld->bits_left -= bits;
  124|  23.3k|    } else {
  125|  4.42k|        faad_flushbits_ex(ld, bits);
  126|  4.42k|    }
  127|  27.8k|}

cfftb:
  902|   255k|{
  903|   255k|    cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
  904|   255k|}
cffti:
 1006|  16.7k|{
 1007|  16.7k|    cfft_info *cfft = (cfft_info*)faad_malloc(sizeof(cfft_info));
 1008|       |
 1009|  16.7k|    cfft->n = n;
 1010|  16.7k|    cfft->work = (complex_t*)faad_malloc(n*sizeof(complex_t));
 1011|       |
 1012|  16.7k|#ifndef FIXED_POINT
 1013|  16.7k|    cfft->tab = (complex_t*)faad_malloc(n*sizeof(complex_t));
 1014|       |
 1015|  16.7k|    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|  16.7k|    return cfft;
 1039|  16.7k|}
cfftu:
 1042|  16.7k|{
 1043|  16.7k|    if (cfft->work) faad_free(cfft->work);
  ------------------
  |  Branch (1043:9): [True: 16.7k, False: 0]
  ------------------
 1044|  16.7k|#ifndef FIXED_POINT
 1045|  16.7k|    if (cfft->tab) faad_free(cfft->tab);
  ------------------
  |  Branch (1045:9): [True: 16.7k, False: 0]
  ------------------
 1046|  16.7k|#endif
 1047|       |
 1048|  16.7k|    if (cfft) faad_free(cfft);
  ------------------
  |  Branch (1048:9): [True: 16.7k, False: 0]
  ------------------
 1049|  16.7k|}
cfft.c:passf3:
  184|  54.6k|{
  185|  54.6k|    static real_t taur = FRAC_CONST(-0.5);
  ------------------
  |  |  291|  54.6k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  186|  54.6k|    static real_t taui = FRAC_CONST(0.866025403784439);
  ------------------
  |  |  291|  54.6k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  187|  54.6k|    uint16_t i, k, ac, ah;
  188|  54.6k|    complex_t c2, c3, d2, d3, t2;
  189|       |
  190|  54.6k|    if (ido == 1)
  ------------------
  |  Branch (190:9): [True: 0, False: 54.6k]
  ------------------
  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|  54.6k|    } else {
  249|  54.6k|        if (isign == 1)
  ------------------
  |  Branch (249:13): [True: 54.6k, False: 0]
  ------------------
  250|  54.6k|        {
  251|   132k|            for (k = 0; k < l1; k++)
  ------------------
  |  Branch (251:25): [True: 77.9k, False: 54.6k]
  ------------------
  252|  77.9k|            {
  253|  4.43M|                for (i = 0; i < ido; i++)
  ------------------
  |  Branch (253:29): [True: 4.35M, False: 77.9k]
  ------------------
  254|  4.35M|                {
  255|  4.35M|                    ac = i + (3*k+1)*ido;
  256|  4.35M|                    ah = i + k * ido;
  257|       |
  258|  4.35M|                    RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
  259|  4.35M|                    RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
  ------------------
  |  |  286|  4.35M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  260|  4.35M|                    IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
  261|  4.35M|                    IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
  ------------------
  |  |  286|  4.35M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  262|       |
  263|  4.35M|                    RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
  264|  4.35M|                    IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
  265|       |
  266|  4.35M|                    RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
  ------------------
  |  |  286|  4.35M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  267|  4.35M|                    IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
  ------------------
  |  |  286|  4.35M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  268|       |
  269|  4.35M|                    RE(d2) = RE(c2) - IM(c3);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(d2) = RE(c2) - IM(c3);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(d2) = RE(c2) - IM(c3);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
  270|  4.35M|                    IM(d3) = IM(c2) - RE(c3);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(d3) = IM(c2) - RE(c3);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(d3) = IM(c2) - RE(c3);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
  271|  4.35M|                    RE(d3) = RE(c2) + IM(c3);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(d3) = RE(c2) + IM(c3);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                  RE(d3) = RE(c2) + IM(c3);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
  272|  4.35M|                    IM(d2) = IM(c2) + RE(c3);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(d2) = IM(c2) + RE(c3);
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  IM(d2) = IM(c2) + RE(c3);
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
  273|       |
  274|  4.35M|#if 1
  275|  4.35M|                    ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
  276|  4.35M|                        IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                      IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                      IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                      IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
  277|  4.35M|                    ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
  278|  4.35M|                        IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  4.35M|#define IM(A) (A)[1]
  ------------------
                                      IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                      IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  4.35M|#define RE(A) (A)[0]
  ------------------
                                      IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  4.35M|#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|  4.35M|                }
  286|  77.9k|            }
  287|  54.6k|        } 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|  54.6k|    }
  326|  54.6k|}
cfft.c:passf5:
  506|  54.6k|{
  507|  54.6k|    static real_t tr11 = FRAC_CONST(0.309016994374947);
  ------------------
  |  |  291|  54.6k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  508|  54.6k|    static real_t ti11 = FRAC_CONST(0.951056516295154);
  ------------------
  |  |  291|  54.6k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  509|  54.6k|    static real_t tr12 = FRAC_CONST(-0.809016994374947);
  ------------------
  |  |  291|  54.6k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  510|  54.6k|    static real_t ti12 = FRAC_CONST(0.587785252292473);
  ------------------
  |  |  291|  54.6k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  511|  54.6k|    uint16_t k, ac, ah;
  512|  54.6k|    complex_t c2, c3, c4, c5, t2, t3, t4, t5;
  513|  54.6k|    (void)wa1;
  514|  54.6k|    (void)wa2;
  515|  54.6k|    (void)wa3;
  516|  54.6k|    (void)wa4;
  517|       |
  518|  54.6k|    if (ido == 1)
  ------------------
  |  Branch (518:9): [True: 54.6k, False: 0]
  ------------------
  519|  54.6k|    {
  520|  54.6k|        if (isign == 1)
  ------------------
  |  Branch (520:13): [True: 54.6k, False: 0]
  ------------------
  521|  54.6k|        {
  522|  2.66M|            for (k = 0; k < l1; k++)
  ------------------
  |  Branch (522:25): [True: 2.61M, False: 54.6k]
  ------------------
  523|  2.61M|            {
  524|  2.61M|                ac = 5*k + 1;
  525|  2.61M|                ah = k;
  526|       |
  527|  2.61M|                RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  528|  2.61M|                IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  529|  2.61M|                RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  530|  2.61M|                IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  531|  2.61M|                RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  532|  2.61M|                IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  533|  2.61M|                RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  534|  2.61M|                IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  535|       |
  536|  2.61M|                RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  537|  2.61M|                IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  538|       |
  539|  2.61M|                RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
  ------------------
  |  |  286|  2.61M|  #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.61M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  540|  2.61M|                IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
  ------------------
  |  |  286|  2.61M|  #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.61M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  541|  2.61M|                RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
  ------------------
  |  |  286|  2.61M|  #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.61M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  542|  2.61M|                IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
  ------------------
  |  |  286|  2.61M|  #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.61M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  543|       |
  544|  2.61M|                ComplexMult(&RE(c5), &RE(c4),
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(c5), &RE(c4),
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  545|  2.61M|                    ti11, ti12, RE(t5), RE(t4));
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                                  ti11, ti12, RE(t5), RE(t4));
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  546|  2.61M|                ComplexMult(&IM(c5), &IM(c4),
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(c5), &IM(c4),
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  547|  2.61M|                    ti11, ti12, IM(t5), IM(t4));
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                                  ti11, ti12, IM(t5), IM(t4));
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  548|       |
  549|  2.61M|                RE(ch[ah+l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+l1]) = RE(c2) - IM(c5);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  550|  2.61M|                IM(ch[ah+l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+l1]) = IM(c2) + RE(c5);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  551|  2.61M|                RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  552|  2.61M|                IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  553|  2.61M|                RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  554|  2.61M|                IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  555|  2.61M|                RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
  556|  2.61M|                IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  392|  2.61M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
  ------------------
  |  |  391|  2.61M|#define RE(A) (A)[0]
  ------------------
  557|  2.61M|            }
  558|  54.6k|        } 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|  54.6k|    } 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|  54.6k|}
cfft.c:cfftf1pos:
  743|   255k|{
  744|   255k|    uint16_t i;
  745|   255k|    uint16_t k1, l1, l2;
  746|   255k|    uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido;
  747|       |
  748|   255k|    nf = ifac[1];
  749|   255k|    na = 0;
  750|   255k|    l1 = 1;
  751|   255k|    iw = 0;
  752|       |
  753|  1.27M|    for (k1 = 2; k1 <= nf+1; k1++)
  ------------------
  |  Branch (753:18): [True: 1.02M, False: 255k]
  ------------------
  754|  1.02M|    {
  755|  1.02M|        ip = ifac[k1];
  756|  1.02M|        l2 = ip*l1;
  757|  1.02M|        ido = n / l2;
  758|       |
  759|  1.02M|        switch (ip)
  ------------------
  |  Branch (759:17): [True: 1.02M, False: 0]
  ------------------
  760|  1.02M|        {
  761|   785k|        case 4:
  ------------------
  |  Branch (761:9): [True: 785k, False: 237k]
  ------------------
  762|   785k|            ix2 = iw + ido;
  763|   785k|            ix3 = ix2 + ido;
  764|       |
  765|   785k|            if (na == 0)
  ------------------
  |  Branch (765:17): [True: 425k, False: 360k]
  ------------------
  766|   425k|                passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
  767|   360k|            else
  768|   360k|                passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
  769|       |
  770|   785k|            na = 1 - na;
  771|   785k|            break;
  772|   128k|        case 2:
  ------------------
  |  Branch (772:9): [True: 128k, False: 894k]
  ------------------
  773|   128k|            if (na == 0)
  ------------------
  |  Branch (773:17): [True: 128k, False: 0]
  ------------------
  774|   128k|                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|   128k|            na = 1 - na;
  779|   128k|            break;
  780|  54.6k|        case 3:
  ------------------
  |  Branch (780:9): [True: 54.6k, False: 968k]
  ------------------
  781|  54.6k|            ix2 = iw + ido;
  782|       |
  783|  54.6k|            if (na == 0)
  ------------------
  |  Branch (783:17): [True: 31.3k, False: 23.2k]
  ------------------
  784|  31.3k|                passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
  785|  23.2k|            else
  786|  23.2k|                passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
  787|       |
  788|  54.6k|            na = 1 - na;
  789|  54.6k|            break;
  790|  54.6k|        case 5:
  ------------------
  |  Branch (790:9): [True: 54.6k, False: 968k]
  ------------------
  791|  54.6k|            ix2 = iw + ido;
  792|  54.6k|            ix3 = ix2 + ido;
  793|  54.6k|            ix4 = ix3 + ido;
  794|       |
  795|  54.6k|            if (na == 0)
  ------------------
  |  Branch (795:17): [True: 54.6k, False: 0]
  ------------------
  796|  54.6k|                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|  54.6k|            na = 1 - na;
  801|  54.6k|            break;
  802|  1.02M|        }
  803|       |
  804|  1.02M|        l1 = l2;
  805|  1.02M|        iw += (ip-1) * ido;
  806|  1.02M|    }
  807|       |
  808|   255k|    if (na == 0)
  ------------------
  |  Branch (808:9): [True: 0, False: 255k]
  ------------------
  809|      0|        return;
  810|       |
  811|  73.1M|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (811:17): [True: 72.8M, False: 255k]
  ------------------
  812|  72.8M|    {
  813|  72.8M|        RE(c[i]) = RE(ch[i]);
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
                      RE(c[i]) = RE(ch[i]);
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
  814|  72.8M|        IM(c[i]) = IM(ch[i]);
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
                      IM(c[i]) = IM(ch[i]);
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
  815|  72.8M|    }
  816|   255k|}
cfft.c:passf4pos:
  332|   785k|{
  333|   785k|    uint16_t i, k, ac, ah;
  334|       |
  335|   785k|    if (ido == 1)
  ------------------
  |  Branch (335:9): [True: 200k, False: 584k]
  ------------------
  336|   200k|    {
  337|  15.1M|        for (k = 0; k < l1; k++)
  ------------------
  |  Branch (337:21): [True: 14.9M, False: 200k]
  ------------------
  338|  14.9M|        {
  339|  14.9M|            complex_t t1, t2, t3, t4;
  340|       |
  341|  14.9M|            ac = 4*k;
  342|  14.9M|            ah = k;
  343|       |
  344|  14.9M|            RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  345|  14.9M|            RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  346|  14.9M|            IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  347|  14.9M|            IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  348|  14.9M|            RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  349|  14.9M|            IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  350|  14.9M|            IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  351|  14.9M|            RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  352|       |
  353|  14.9M|            RE(ch[ah])      = RE(t2) + RE(t3);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah])      = RE(t2) + RE(t3);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah])      = RE(t2) + RE(t3);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  354|  14.9M|            RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  355|       |
  356|  14.9M|            IM(ch[ah])      = IM(t2) + IM(t3);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah])      = IM(t2) + IM(t3);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah])      = IM(t2) + IM(t3);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  357|  14.9M|            IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  358|       |
  359|  14.9M|            RE(ch[ah+l1])   = RE(t1) + RE(t4);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+l1])   = RE(t1) + RE(t4);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+l1])   = RE(t1) + RE(t4);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  360|  14.9M|            RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
                          RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  14.9M|#define RE(A) (A)[0]
  ------------------
  361|       |
  362|  14.9M|            IM(ch[ah+l1])   = IM(t1) + IM(t4);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+l1])   = IM(t1) + IM(t4);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+l1])   = IM(t1) + IM(t4);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  363|  14.9M|            IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
                          IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  14.9M|#define IM(A) (A)[1]
  ------------------
  364|  14.9M|        }
  365|   584k|    } else {
  366|  6.26M|        for (k = 0; k < l1; k++)
  ------------------
  |  Branch (366:21): [True: 5.67M, False: 584k]
  ------------------
  367|  5.67M|        {
  368|  5.67M|            ac = 4*k*ido;
  369|  5.67M|            ah = k*ido;
  370|       |
  371|  55.0M|            for (i = 0; i < ido; i++)
  ------------------
  |  Branch (371:25): [True: 49.3M, False: 5.67M]
  ------------------
  372|  49.3M|            {
  373|  49.3M|                complex_t c2, c3, c4, t1, t2, t3, t4;
  374|       |
  375|  49.3M|                RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  376|  49.3M|                RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  377|  49.3M|                IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  378|  49.3M|                IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  379|  49.3M|                RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  380|  49.3M|                IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  381|  49.3M|                IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  382|  49.3M|                RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  383|       |
  384|  49.3M|                RE(c2) = RE(t1) + RE(t4);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(t1) + RE(t4);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c2) = RE(t1) + RE(t4);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  385|  49.3M|                RE(c4) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c4) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c4) = RE(t1) - RE(t4);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  386|       |
  387|  49.3M|                IM(c2) = IM(t1) + IM(t4);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(t1) + IM(t4);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c2) = IM(t1) + IM(t4);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  388|  49.3M|                IM(c4) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c4) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c4) = IM(t1) - IM(t4);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  389|       |
  390|  49.3M|                RE(ch[ah+i]) = RE(t2) + RE(t3);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(t2) + RE(t3);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(t2) + RE(t3);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  391|  49.3M|                RE(c3)       = RE(t2) - RE(t3);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c3)       = RE(t2) - RE(t3);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                              RE(c3)       = RE(t2) - RE(t3);
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  392|       |
  393|  49.3M|                IM(ch[ah+i]) = IM(t2) + IM(t3);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(t2) + IM(t3);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(t2) + IM(t3);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  394|  49.3M|                IM(c3)       = IM(t2) - IM(t3);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c3)       = IM(t2) - IM(t3);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              IM(c3)       = IM(t2) - IM(t3);
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  395|       |
  396|  49.3M|#if 1
  397|  49.3M|                ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  398|  49.3M|                    IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                                  IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  399|  49.3M|                ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  400|  49.3M|                    IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                                  IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
  401|  49.3M|                ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
  402|  49.3M|                    IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  392|  49.3M|#define IM(A) (A)[1]
  ------------------
                                  IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  391|  49.3M|#define RE(A) (A)[0]
  ------------------
                                  IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
  ------------------
  |  |  392|  49.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|  49.3M|            }
  412|  5.67M|        }
  413|   584k|    }
  414|   785k|}
cfft.c:passf2pos:
   72|   128k|{
   73|   128k|    uint16_t i, k, ah, ac;
   74|       |
   75|   128k|    if (ido == 1)
  ------------------
  |  Branch (75:9): [True: 0, False: 128k]
  ------------------
   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|   128k|    } else {
   98|   256k|        for (k = 0; k < l1; k++)
  ------------------
  |  Branch (98:21): [True: 128k, False: 128k]
  ------------------
   99|   128k|        {
  100|   128k|            ah = k*ido;
  101|   128k|            ac = 2*k*ido;
  102|       |
  103|  32.5M|            for (i = 0; i < ido; i++)
  ------------------
  |  Branch (103:25): [True: 32.4M, False: 128k]
  ------------------
  104|  32.4M|            {
  105|  32.4M|                complex_t t2;
  106|       |
  107|  32.4M|                RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
                              RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
  108|  32.4M|                RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
                              RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
                              RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
  109|       |
  110|  32.4M|                IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
                              IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
  111|  32.4M|                IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
                              IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
                              IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
  112|       |
  113|  32.4M|#if 1
  114|  32.4M|                ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
  115|  32.4M|                    IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  392|  32.4M|#define IM(A) (A)[1]
  ------------------
                                  IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
                                  IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  391|  32.4M|#define RE(A) (A)[0]
  ------------------
                                  IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
  ------------------
  |  |  392|  32.4M|#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|  32.4M|            }
  121|   128k|        }
  122|   128k|    }
  123|   128k|}
cfft.c:cffti1:
  907|  16.7k|{
  908|  16.7k|    static uint16_t ntryh[4] = {3, 4, 2, 5};
  909|  16.7k|#ifndef FIXED_POINT
  910|  16.7k|    real_t arg, argh, argld, fi;
  911|  16.7k|    uint16_t ido, ipm;
  912|  16.7k|    uint16_t i1, k1, l1, l2;
  913|  16.7k|    uint16_t ld, ii, ip;
  914|  16.7k|#endif
  915|  16.7k|    uint16_t ntry = 0, i, j;
  916|  16.7k|    uint16_t ib;
  917|  16.7k|    uint16_t nf, nl, nq, nr;
  918|       |
  919|  16.7k|    nl = n;
  920|  16.7k|    nf = 0;
  921|  16.7k|    j = 0;
  922|       |
  923|  48.2k|startloop:
  924|  48.2k|    j++;
  925|       |
  926|  48.2k|    if (j <= 4)
  ------------------
  |  Branch (926:9): [True: 48.2k, False: 0]
  ------------------
  927|  48.2k|        ntry = ntryh[j-1];
  928|      0|    else
  929|      0|        ntry += 2;
  930|       |
  931|  48.2k|    do
  932|  98.5k|    {
  933|  98.5k|        nq = nl / ntry;
  934|  98.5k|        nr = nl - ntry*nq;
  935|       |
  936|  98.5k|        if (nr != 0)
  ------------------
  |  Branch (936:13): [True: 31.5k, False: 66.9k]
  ------------------
  937|  31.5k|            goto startloop;
  938|       |
  939|  66.9k|        nf++;
  940|  66.9k|        ifac[nf+1] = ntry;
  941|  66.9k|        nl = nq;
  942|       |
  943|  66.9k|        if (ntry == 2 && nf != 1)
  ------------------
  |  Branch (943:13): [True: 8.36k, False: 58.5k]
  |  Branch (943:26): [True: 8.36k, False: 0]
  ------------------
  944|  8.36k|        {
  945|  39.6k|            for (i = 2; i <= nf; i++)
  ------------------
  |  Branch (945:25): [True: 31.3k, False: 8.36k]
  ------------------
  946|  31.3k|            {
  947|  31.3k|                ib = nf - i + 2;
  948|  31.3k|                ifac[ib+1] = ifac[ib];
  949|  31.3k|            }
  950|  8.36k|            ifac[2] = 2;
  951|  8.36k|        }
  952|  66.9k|    } while (nl != 1);
  ------------------
  |  Branch (952:14): [True: 50.2k, False: 16.7k]
  ------------------
  953|       |
  954|  16.7k|    ifac[0] = n;
  955|  16.7k|    ifac[1] = nf;
  956|       |
  957|  16.7k|#ifndef FIXED_POINT
  958|  16.7k|    argh = (real_t)2.0*(real_t)M_PI / (real_t)n;
  959|  16.7k|    i = 0;
  960|  16.7k|    l1 = 1;
  961|       |
  962|  83.6k|    for (k1 = 1; k1 <= nf; k1++)
  ------------------
  |  Branch (962:18): [True: 66.9k, False: 16.7k]
  ------------------
  963|  66.9k|    {
  964|  66.9k|        ip = ifac[k1+1];
  965|  66.9k|        ld = 0;
  966|  66.9k|        l2 = l1*ip;
  967|  66.9k|        ido = n / l2;
  968|  66.9k|        ipm = ip - 1;
  969|       |
  970|   251k|        for (j = 0; j < ipm; j++)
  ------------------
  |  Branch (970:21): [True: 184k, False: 66.9k]
  ------------------
  971|   184k|        {
  972|   184k|            i1 = i;
  973|   184k|            RE(wa[i]) = 1.0;
  ------------------
  |  |  391|   184k|#define RE(A) (A)[0]
  ------------------
  974|   184k|            IM(wa[i]) = 0.0;
  ------------------
  |  |  392|   184k|#define IM(A) (A)[1]
  ------------------
  975|   184k|            ld += l1;
  976|   184k|            fi = 0;
  977|   184k|            argld = ld*argh;
  978|       |
  979|  4.90M|            for (ii = 0; ii < ido; ii++)
  ------------------
  |  Branch (979:26): [True: 4.72M, False: 184k]
  ------------------
  980|  4.72M|            {
  981|  4.72M|                i++;
  982|  4.72M|                fi++;
  983|  4.72M|                arg = fi * argld;
  984|  4.72M|                RE(wa[i]) = (real_t)cos(arg);
  ------------------
  |  |  391|  4.72M|#define RE(A) (A)[0]
  ------------------
  985|  4.72M|#if 1
  986|  4.72M|                IM(wa[i]) = (real_t)sin(arg);
  ------------------
  |  |  392|  4.72M|#define IM(A) (A)[1]
  ------------------
  987|       |#else
  988|       |                IM(wa[i]) = (real_t)-sin(arg);
  989|       |#endif
  990|  4.72M|            }
  991|       |
  992|   184k|            if (ip > 5)
  ------------------
  |  Branch (992:17): [True: 0, False: 184k]
  ------------------
  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|   184k|        }
  998|  66.9k|        l1 = l2;
  999|  66.9k|    }
 1000|       |#else  // FIXED_POINT
 1001|       |    (void)wa;  /* whoa! does it work for FIXED_POINT? */
 1002|       |#endif
 1003|  16.7k|}

get_sr_index:
   42|   206k|{
   43|   206k|    if (92017 <= samplerate) return 0;
  ------------------
  |  Branch (43:9): [True: 47.2k, False: 158k]
  ------------------
   44|   158k|    if (75132 <= samplerate) return 1;
  ------------------
  |  Branch (44:9): [True: 6.38k, False: 152k]
  ------------------
   45|   152k|    if (55426 <= samplerate) return 2;
  ------------------
  |  Branch (45:9): [True: 9.19k, False: 143k]
  ------------------
   46|   143k|    if (46009 <= samplerate) return 3;
  ------------------
  |  Branch (46:9): [True: 25.8k, False: 117k]
  ------------------
   47|   117k|    if (37566 <= samplerate) return 4;
  ------------------
  |  Branch (47:9): [True: 26.8k, False: 90.5k]
  ------------------
   48|  90.5k|    if (27713 <= samplerate) return 5;
  ------------------
  |  Branch (48:9): [True: 15.0k, False: 75.5k]
  ------------------
   49|  75.5k|    if (23004 <= samplerate) return 6;
  ------------------
  |  Branch (49:9): [True: 5.43k, False: 70.0k]
  ------------------
   50|  70.0k|    if (18783 <= samplerate) return 7;
  ------------------
  |  Branch (50:9): [True: 6.45k, False: 63.6k]
  ------------------
   51|  63.6k|    if (13856 <= samplerate) return 8;
  ------------------
  |  Branch (51:9): [True: 60.6k, False: 2.97k]
  ------------------
   52|  2.97k|    if (11502 <= samplerate) return 9;
  ------------------
  |  Branch (52:9): [True: 295, False: 2.68k]
  ------------------
   53|  2.68k|    if (9391 <= samplerate) return 10;
  ------------------
  |  Branch (53:9): [True: 326, False: 2.35k]
  ------------------
   54|       |
   55|  2.35k|    return 11;
   56|  2.68k|}
get_sample_rate:
   60|   103k|{
   61|   103k|    static const uint32_t sample_rates[] =
   62|   103k|    {
   63|   103k|        96000, 88200, 64000, 48000, 44100, 32000,
   64|   103k|        24000, 22050, 16000, 12000, 11025, 8000
   65|   103k|    };
   66|       |
   67|   103k|    if (sr_index < 12)
  ------------------
  |  Branch (67:9): [True: 103k, False: 89]
  ------------------
   68|   103k|        return sample_rates[sr_index];
   69|       |
   70|     89|    return 0;
   71|   103k|}
max_pred_sfb:
   74|  2.28k|{
   75|  2.28k|    static const uint8_t pred_sfb_max[] =
   76|  2.28k|    {
   77|  2.28k|        33, 33, 38, 40, 40, 40, 41, 41, 37, 37, 37, 34
   78|  2.28k|    };
   79|       |
   80|       |
   81|  2.28k|    if (sr_index < 12)
  ------------------
  |  Branch (81:9): [True: 2.28k, False: 0]
  ------------------
   82|  2.28k|        return pred_sfb_max[sr_index];
   83|       |
   84|      0|    return 0;
   85|  2.28k|}
max_tns_sfb:
   89|  14.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|  14.5k|    static const uint8_t tns_sbf_max[][4] =
   97|  14.5k|    {
   98|  14.5k|        {31,  9, 28, 7}, /* 96000 */
   99|  14.5k|        {31,  9, 28, 7}, /* 88200 */
  100|  14.5k|        {34, 10, 27, 7}, /* 64000 */
  101|  14.5k|        {40, 14, 26, 6}, /* 48000 */
  102|  14.5k|        {42, 14, 26, 6}, /* 44100 */
  103|  14.5k|        {51, 14, 26, 6}, /* 32000 */
  104|  14.5k|        {46, 14, 29, 7}, /* 24000 */
  105|  14.5k|        {46, 14, 29, 7}, /* 22050 */
  106|  14.5k|        {42, 14, 23, 8}, /* 16000 */
  107|  14.5k|        {42, 14, 23, 8}, /* 12000 */
  108|  14.5k|        {42, 14, 23, 8}, /* 11025 */
  109|  14.5k|        {39, 14, 19, 7}, /*  8000 */
  110|  14.5k|        {39, 14, 19, 7}, /*  7350 */
  111|  14.5k|        {0,0,0,0},
  112|  14.5k|        {0,0,0,0},
  113|  14.5k|        {0,0,0,0}
  114|  14.5k|    };
  115|  14.5k|    uint8_t i = 0;
  116|       |
  117|  14.5k|    if (is_short) i++;
  ------------------
  |  Branch (117:9): [True: 5.49k, False: 9.09k]
  ------------------
  118|  14.5k|    if (object_type == SSR) i += 2;
  ------------------
  |  |   42|  14.5k|#define SSR        3
  ------------------
  |  Branch (118:9): [True: 714, False: 13.8k]
  ------------------
  119|       |
  120|  14.5k|    return tns_sbf_max[sr_index][i];
  121|  14.5k|}
can_decode_ot:
  125|  13.2k|{
  126|  13.2k|    switch (object_type)
  ------------------
  |  Branch (126:13): [True: 13.2k, False: 3]
  ------------------
  127|  13.2k|    {
  128|  11.1k|    case LC:
  ------------------
  |  |   41|  11.1k|#define LC         2
  ------------------
  |  Branch (128:5): [True: 11.1k, False: 2.15k]
  ------------------
  129|  11.1k|        return 0;
  130|     54|    case MAIN:
  ------------------
  |  |   40|     54|#define MAIN       1
  ------------------
  |  Branch (130:5): [True: 54, False: 13.2k]
  ------------------
  131|       |#ifdef MAIN_DEC
  132|       |        return 0;
  133|       |#else
  134|     54|        return -1;
  135|      0|#endif
  136|     14|    case SSR:
  ------------------
  |  |   42|     14|#define SSR        3
  ------------------
  |  Branch (136:5): [True: 14, False: 13.2k]
  ------------------
  137|       |#ifdef SSR_DEC
  138|       |        return 0;
  139|       |#else
  140|     14|        return -1;
  141|      0|#endif
  142|     12|    case LTP:
  ------------------
  |  |   43|     12|#define LTP        4
  ------------------
  |  Branch (142:5): [True: 12, False: 13.2k]
  ------------------
  143|       |#ifdef LTP_DEC
  144|       |        return 0;
  145|       |#else
  146|     12|        return -1;
  147|      0|#endif
  148|       |
  149|       |    /* ER object types */
  150|      0|#ifdef ERROR_RESILIENCE
  151|  1.94k|    case ER_LC:
  ------------------
  |  |   46|  1.94k|#define ER_LC     17
  ------------------
  |  Branch (151:5): [True: 1.94k, False: 11.3k]
  ------------------
  152|  1.94k|#ifdef DRM
  153|  2.06k|    case DRM_ER_LC:
  ------------------
  |  |   48|  2.06k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (153:5): [True: 118, False: 13.1k]
  ------------------
  154|  2.06k|#endif
  155|  2.06k|        return 0;
  156|      0|    case ER_LTP:
  ------------------
  |  |   47|      0|#define ER_LTP    19
  ------------------
  |  Branch (156:5): [True: 0, False: 13.2k]
  ------------------
  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: 13.2k]
  ------------------
  163|       |#ifdef LD_DEC
  164|       |        return 0;
  165|       |#else
  166|      0|        return -1;
  167|  13.2k|#endif
  168|  13.2k|#endif
  169|  13.2k|    }
  170|       |
  171|      3|    return -1;
  172|  13.2k|}
faad_malloc:
  175|  2.35M|{
  176|       |#if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
  177|       |    return _aligned_malloc(size, 16);
  178|       |#else   // #ifdef 0
  179|  2.35M|    return malloc(size);
  180|  2.35M|#endif  // #ifdef 0
  181|  2.35M|}
faad_free:
  185|  2.35M|{
  186|       |#if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
  187|       |    _aligned_free(b);
  188|       |#else
  189|  2.35M|    free(b);
  190|  2.35M|}

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

NeAACDecOpen:
  124|  8.57k|{
  125|  8.57k|    uint8_t i;
  126|  8.57k|    NeAACDecStruct *hDecoder = NULL;
  127|       |
  128|  8.57k|    if ((hDecoder = (NeAACDecStruct*)faad_malloc(sizeof(NeAACDecStruct))) == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 8.57k]
  ------------------
  129|      0|        return NULL;
  130|       |
  131|  8.57k|    memset(hDecoder, 0, sizeof(NeAACDecStruct));
  132|       |
  133|  8.57k|    hDecoder->cmes = mes;
  134|  8.57k|    hDecoder->config.outputFormat  = FAAD_FMT_16BIT;
  ------------------
  |  |   98|  8.57k|#define FAAD_FMT_16BIT  1
  ------------------
  135|  8.57k|    hDecoder->config.defObjectType = MAIN;
  ------------------
  |  |   40|  8.57k|#define MAIN       1
  ------------------
  136|  8.57k|    hDecoder->config.defSampleRate = 44100; /* Default: 44.1kHz */
  137|  8.57k|    hDecoder->config.downMatrix = 0;
  138|  8.57k|    hDecoder->adts_header_present = 0;
  139|  8.57k|    hDecoder->adif_header_present = 0;
  140|  8.57k|    hDecoder->latm_header_present = 0;
  141|  8.57k|#ifdef ERROR_RESILIENCE
  142|  8.57k|    hDecoder->aacSectionDataResilienceFlag = 0;
  143|  8.57k|    hDecoder->aacScalefactorDataResilienceFlag = 0;
  144|  8.57k|    hDecoder->aacSpectralDataResilienceFlag = 0;
  145|  8.57k|#endif
  146|  8.57k|    hDecoder->frameLength = 1024;
  147|       |
  148|  8.57k|    hDecoder->frame = 0;
  149|  8.57k|    hDecoder->sample_buffer = NULL;
  150|       |
  151|       |    // Same as (1, 1) after 1024 iterations; otherwise first values does not look random at all.
  152|  8.57k|    hDecoder->__r1 = 0x2bb431ea;
  153|  8.57k|    hDecoder->__r2 = 0x206155b7;
  154|       |
  155|   557k|    for (i = 0; i < MAX_CHANNELS; i++)
  ------------------
  |  |   43|   557k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (155:17): [True: 548k, False: 8.57k]
  ------------------
  156|   548k|    {
  157|   548k|        hDecoder->element_id[i] = INVALID_ELEMENT_ID;
  ------------------
  |  |   94|   548k|#define INVALID_ELEMENT_ID 255
  ------------------
  158|   548k|        hDecoder->window_shape_prev[i] = 0;
  159|   548k|        hDecoder->time_out[i] = NULL;
  160|   548k|        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|   548k|    }
  173|       |
  174|  8.57k|#ifdef SBR_DEC
  175|   419k|    for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
  ------------------
  |  |   44|   419k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (175:17): [True: 411k, False: 8.57k]
  ------------------
  176|   411k|    {
  177|   411k|        hDecoder->sbr[i] = NULL;
  178|   411k|    }
  179|  8.57k|#endif
  180|       |
  181|  8.57k|    hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
  ------------------
  |  |  288|  8.57k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
                  hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
  ------------------
  |  |  288|  8.57k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  182|       |
  183|  8.57k|    return hDecoder;
  184|  8.57k|}
NeAACDecGetCurrentConfiguration:
  187|  7.80k|{
  188|  7.80k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  189|  7.80k|    if (hDecoder)
  ------------------
  |  Branch (189:9): [True: 7.80k, False: 0]
  ------------------
  190|  7.80k|    {
  191|  7.80k|        NeAACDecConfigurationPtr config = &(hDecoder->config);
  192|       |
  193|  7.80k|        return config;
  194|  7.80k|    }
  195|       |
  196|      0|    return NULL;
  197|  7.80k|}
NeAACDecSetConfiguration:
  201|  7.88k|{
  202|  7.88k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  203|  7.88k|    if (hDecoder && config)
  ------------------
  |  Branch (203:9): [True: 7.88k, False: 0]
  |  Branch (203:21): [True: 7.88k, False: 0]
  ------------------
  204|  7.88k|    {
  205|       |        /* check if we can decode this object type */
  206|  7.88k|        if (can_decode_ot(config->defObjectType) < 0)
  ------------------
  |  Branch (206:13): [True: 3, False: 7.88k]
  ------------------
  207|      3|            return 0;
  208|  7.88k|        hDecoder->config.defObjectType = config->defObjectType;
  209|       |
  210|       |        /* samplerate: anything but 0 should be possible */
  211|  7.88k|        if (config->defSampleRate == 0)
  ------------------
  |  Branch (211:13): [True: 1, False: 7.88k]
  ------------------
  212|      1|            return 0;
  213|  7.88k|        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|  7.88k|        if ((config->outputFormat < 1) || (config->outputFormat > 5))
  ------------------
  |  Branch (220:13): [True: 7, False: 7.87k]
  |  Branch (220:43): [True: 64, False: 7.81k]
  ------------------
  221|     71|            return 0;
  222|  7.81k|#endif
  223|  7.81k|        hDecoder->config.outputFormat = config->outputFormat;
  224|       |
  225|  7.81k|        if (config->downMatrix > 1)
  ------------------
  |  Branch (225:13): [True: 7, False: 7.80k]
  ------------------
  226|      7|            return 0;
  227|  7.80k|        hDecoder->config.downMatrix = config->downMatrix;
  228|       |
  229|       |        /* OK */
  230|  7.80k|        return 1;
  231|  7.81k|    }
  232|       |
  233|      0|    return 0;
  234|  7.88k|}
NeAACDecInit:
  268|  5.47k|{
  269|  5.47k|    uint32_t bits = 0;
  270|  5.47k|    bitfile ld;
  271|  5.47k|    adif_header adif;
  272|  5.47k|    adts_header adts;
  273|  5.47k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  274|       |
  275|       |
  276|  5.47k|    if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL) || (buffer_size == 0))
  ------------------
  |  Branch (276:9): [True: 0, False: 5.47k]
  |  Branch (276:31): [True: 0, False: 5.47k]
  |  Branch (276:55): [True: 0, False: 5.47k]
  |  Branch (276:77): [True: 22, False: 5.45k]
  ------------------
  277|     22|        return -1;
  278|       |
  279|  5.45k|    adts.old_format = hDecoder->config.useOldADTSFormat;
  280|  5.45k|    hDecoder->sf_index = get_sr_index(hDecoder->config.defSampleRate);
  281|  5.45k|    hDecoder->object_type = hDecoder->config.defObjectType;
  282|  5.45k|    *samplerate = get_sample_rate(hDecoder->sf_index);
  283|  5.45k|    *channels = 1;
  284|       |
  285|  5.45k|    if (buffer != NULL)
  ------------------
  |  Branch (285:9): [True: 5.45k, False: 0]
  ------------------
  286|  5.45k|    {
  287|       |#if 0
  288|       |        int is_latm;
  289|       |        latm_header *l = &hDecoder->latm_config;
  290|       |#endif
  291|       |
  292|  5.45k|        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|  5.45k|        if ((buffer_size >= 8) && (buffer[0] == 'A') && (buffer[1] == 'D') &&
  ------------------
  |  Branch (311:13): [True: 241, False: 5.20k]
  |  Branch (311:35): [True: 139, False: 102]
  |  Branch (311:57): [True: 129, False: 10]
  ------------------
  312|    129|            (buffer[2] == 'I') && (buffer[3] == 'F'))
  ------------------
  |  Branch (312:13): [True: 123, False: 6]
  |  Branch (312:35): [True: 114, False: 9]
  ------------------
  313|    114|        {
  314|    114|            hDecoder->adif_header_present = 1;
  315|       |
  316|    114|            get_adif_header(&adif, &ld);
  317|    114|            faad_byte_align(&ld);
  318|       |
  319|    114|            hDecoder->sf_index = adif.pce[0].sf_index;
  320|    114|            hDecoder->object_type = adif.pce[0].object_type + 1;
  321|       |
  322|    114|            *samplerate = get_sample_rate(hDecoder->sf_index);
  323|    114|            *channels = adif.pce[0].channels;
  324|       |
  325|    114|            memcpy(&(hDecoder->pce), &(adif.pce[0]), sizeof(program_config));
  326|    114|            hDecoder->pce_set = 1;
  327|       |
  328|    114|            bits = bit2byte(faad_get_processed_bits(&ld));
  ------------------
  |  |   46|    114|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|    114|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
  329|       |
  330|       |        /* Check if an ADTS header is present */
  331|  5.33k|        } else if (adts_frame(&adts, &ld) == 0) {
  ------------------
  |  Branch (331:20): [True: 100, False: 5.23k]
  ------------------
  332|    100|            hDecoder->adts_header_present = 1;
  333|       |
  334|    100|            hDecoder->sf_index = adts.sf_index;
  335|    100|            hDecoder->object_type = adts.profile + 1;
  336|       |
  337|    100|            *samplerate = get_sample_rate(hDecoder->sf_index);
  338|    100|            *channels = (adts.channel_configuration > 6) ?
  ------------------
  |  Branch (338:25): [True: 7, False: 93]
  ------------------
  339|     93|                2 : adts.channel_configuration;
  340|    100|        }
  341|       |
  342|  5.45k|        if (ld.error)
  ------------------
  |  Branch (342:13): [True: 0, False: 5.45k]
  ------------------
  343|      0|        {
  344|      0|            faad_endbits(&ld);
  345|      0|            return -1;
  346|      0|        }
  347|  5.45k|        faad_endbits(&ld);
  348|  5.45k|    }
  349|       |
  350|  5.45k|    if (!*samplerate)
  ------------------
  |  Branch (350:9): [True: 56, False: 5.39k]
  ------------------
  351|     56|        return -1;
  352|       |
  353|  5.39k|#if (defined(PS_DEC) || defined(DRM_PS))
  354|       |    /* check if we have a mono file */
  355|  5.39k|    if (*channels == 1)
  ------------------
  |  Branch (355:9): [True: 5.23k, False: 156]
  ------------------
  356|  5.23k|    {
  357|       |        /* upMatrix to 2 channels for implicit signalling of PS */
  358|  5.23k|        *channels = 2;
  359|  5.23k|    }
  360|  5.39k|#endif
  361|       |
  362|  5.39k|    hDecoder->channelConfiguration = *channels;
  363|       |
  364|  5.39k|#ifdef SBR_DEC
  365|       |    /* implicit signalling */
  366|  5.39k|    if (*samplerate <= 24000 && (hDecoder->config.dontUpSampleImplicitSBR == 0))
  ------------------
  |  Branch (366:9): [True: 2.50k, False: 2.89k]
  |  Branch (366:33): [True: 2.50k, False: 0]
  ------------------
  367|  2.50k|    {
  368|  2.50k|        *samplerate *= 2;
  369|  2.50k|        hDecoder->forceUpSampling = 1;
  370|  2.89k|    } else if (*samplerate > 24000 && (hDecoder->config.dontUpSampleImplicitSBR == 0)) {
  ------------------
  |  Branch (370:16): [True: 2.89k, False: 0]
  |  Branch (370:39): [True: 2.89k, False: 0]
  ------------------
  371|  2.89k|        hDecoder->downSampledSBR = 1;
  372|  2.89k|    }
  373|  5.39k|#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|  5.39k|        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|  5.39k|    if (can_decode_ot(hDecoder->object_type) < 0)
  ------------------
  |  Branch (388:9): [True: 80, False: 5.31k]
  ------------------
  389|     80|        return -1;
  390|       |
  391|  5.31k|    return bits;
  392|  5.39k|}
NeAACDecInit2:
  400|  2.33k|{
  401|  2.33k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  402|  2.33k|    int8_t rc;
  403|  2.33k|    mp4AudioSpecificConfig mp4ASC;
  404|       |
  405|  2.33k|    if((hDecoder == NULL)
  ------------------
  |  Branch (405:8): [True: 0, False: 2.33k]
  ------------------
  406|  2.33k|        || (pBuffer == NULL)
  ------------------
  |  Branch (406:12): [True: 0, False: 2.33k]
  ------------------
  407|  2.33k|        || (SizeOfDecoderSpecificInfo < 2)
  ------------------
  |  Branch (407:12): [True: 8, False: 2.32k]
  ------------------
  408|  2.32k|        || (samplerate == NULL)
  ------------------
  |  Branch (408:12): [True: 0, False: 2.32k]
  ------------------
  409|  2.32k|        || (channels == NULL))
  ------------------
  |  Branch (409:12): [True: 0, False: 2.32k]
  ------------------
  410|      8|    {
  411|      8|        return -1;
  412|      8|    }
  413|       |
  414|  2.32k|    hDecoder->adif_header_present = 0;
  415|  2.32k|    hDecoder->adts_header_present = 0;
  416|       |
  417|       |    /* decode the audio specific config */
  418|  2.32k|    rc = AudioSpecificConfig2(pBuffer, SizeOfDecoderSpecificInfo, &mp4ASC,
  419|  2.32k|        &(hDecoder->pce), hDecoder->latm_header_present);
  420|       |
  421|       |    /* copy the relevant info to the decoder handle */
  422|  2.32k|    *samplerate = mp4ASC.samplingFrequency;
  423|  2.32k|    if (mp4ASC.channelsConfiguration)
  ------------------
  |  Branch (423:9): [True: 1.94k, False: 382]
  ------------------
  424|  1.94k|    {
  425|  1.94k|        *channels = mp4ASC.channelsConfiguration;
  426|  1.94k|    } else {
  427|    382|        *channels = hDecoder->pce.channels;
  428|    382|        hDecoder->pce_set = 1;
  429|    382|    }
  430|  2.32k|#if (defined(PS_DEC) || defined(DRM_PS))
  431|       |    /* check if we have a mono file */
  432|  2.32k|    if (*channels == 1)
  ------------------
  |  Branch (432:9): [True: 7, False: 2.31k]
  ------------------
  433|      7|    {
  434|       |        /* upMatrix to 2 channels for implicit signalling of PS */
  435|      7|        *channels = 2;
  436|      7|    }
  437|  2.32k|#endif
  438|  2.32k|    hDecoder->sf_index = mp4ASC.samplingFrequencyIndex;
  439|  2.32k|    hDecoder->object_type = mp4ASC.objectTypeIndex;
  440|  2.32k|#ifdef ERROR_RESILIENCE
  441|  2.32k|    hDecoder->aacSectionDataResilienceFlag = mp4ASC.aacSectionDataResilienceFlag;
  442|  2.32k|    hDecoder->aacScalefactorDataResilienceFlag = mp4ASC.aacScalefactorDataResilienceFlag;
  443|  2.32k|    hDecoder->aacSpectralDataResilienceFlag = mp4ASC.aacSpectralDataResilienceFlag;
  444|  2.32k|#endif
  445|  2.32k|#ifdef SBR_DEC
  446|  2.32k|    hDecoder->sbr_present_flag = mp4ASC.sbr_present_flag;
  447|  2.32k|    hDecoder->downSampledSBR = mp4ASC.downSampledSBR;
  448|  2.32k|    if (hDecoder->config.dontUpSampleImplicitSBR == 0)
  ------------------
  |  Branch (448:9): [True: 2.32k, False: 0]
  ------------------
  449|  2.32k|        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.32k|    if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || hDecoder->forceUpSampling == 1)
  ------------------
  |  Branch (454:10): [True: 615, False: 1.71k]
  |  Branch (454:45): [True: 528, False: 87]
  |  Branch (454:77): [True: 835, False: 963]
  ------------------
  455|  1.36k|    {
  456|  1.36k|        hDecoder->sf_index = get_sr_index(mp4ASC.samplingFrequency / 2);
  457|  1.36k|    }
  458|  2.32k|#endif
  459|       |
  460|  2.32k|    if (rc != 0)
  ------------------
  |  Branch (460:9): [True: 35, False: 2.29k]
  ------------------
  461|     35|    {
  462|     35|        return rc;
  463|     35|    }
  464|  2.29k|    hDecoder->channelConfiguration = mp4ASC.channelsConfiguration;
  465|  2.29k|    if (mp4ASC.frameLengthFlag)
  ------------------
  |  Branch (465:9): [True: 1.46k, False: 822]
  ------------------
  466|  1.46k|#ifdef ALLOW_SMALL_FRAMELENGTH
  467|  1.46k|        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.29k|        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.29k|    return 0;
  486|  2.32k|}
NeAACDecInitDRM:
  492|    683|{
  493|    683|    NeAACDecStruct** hDecoder = (NeAACDecStruct**)hpDecoder;
  494|    683|    if (hDecoder == NULL)
  ------------------
  |  Branch (494:9): [True: 0, False: 683]
  ------------------
  495|      0|        return 1; /* error */
  496|       |
  497|    683|    NeAACDecClose(*hDecoder);
  498|       |
  499|    683|    *hDecoder = NeAACDecOpen();
  500|       |
  501|       |    /* Special object type defined for DRM */
  502|    683|    (*hDecoder)->config.defObjectType = DRM_ER_LC;
  ------------------
  |  |   48|    683|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  503|       |
  504|    683|    (*hDecoder)->config.defSampleRate = samplerate;
  505|    683|#ifdef ERROR_RESILIENCE // This shoudl always be defined for DRM
  506|    683|    (*hDecoder)->aacSectionDataResilienceFlag = 1; /* VCB11 */
  507|    683|    (*hDecoder)->aacScalefactorDataResilienceFlag = 0; /* no RVLC */
  508|    683|    (*hDecoder)->aacSpectralDataResilienceFlag = 1; /* HCR */
  509|    683|#endif
  510|    683|    (*hDecoder)->frameLength = 960;
  511|    683|    (*hDecoder)->sf_index = get_sr_index((*hDecoder)->config.defSampleRate);
  512|    683|    (*hDecoder)->object_type = (*hDecoder)->config.defObjectType;
  513|       |
  514|    683|    if ((channels == DRMCH_STEREO) || (channels == DRMCH_SBR_STEREO))
  ------------------
  |  |   64|    683|#define DRMCH_STEREO        2
  ------------------
                  if ((channels == DRMCH_STEREO) || (channels == DRMCH_SBR_STEREO))
  ------------------
  |  |   66|    611|#define DRMCH_SBR_STEREO    4
  ------------------
  |  Branch (514:9): [True: 72, False: 611]
  |  Branch (514:39): [True: 52, False: 559]
  ------------------
  515|    124|        (*hDecoder)->channelConfiguration = 2;
  516|    559|    else
  517|    559|        (*hDecoder)->channelConfiguration = 1;
  518|       |
  519|    683|#ifdef SBR_DEC
  520|    683|    if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO))
  ------------------
  |  |   63|    683|#define DRMCH_MONO          1
  ------------------
                  if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO))
  ------------------
  |  |   64|    651|#define DRMCH_STEREO        2
  ------------------
  |  Branch (520:9): [True: 32, False: 651]
  |  Branch (520:37): [True: 72, False: 579]
  ------------------
  521|    104|        (*hDecoder)->sbr_present_flag = 0;
  522|    579|    else
  523|    579|        (*hDecoder)->sbr_present_flag = 1;
  524|    683|#endif
  525|       |
  526|    683|    (*hDecoder)->fb = filter_bank_init((*hDecoder)->frameLength);
  527|       |
  528|    683|    return 0;
  529|    683|}
NeAACDecClose:
  533|  8.57k|{
  534|  8.57k|    uint8_t i;
  535|  8.57k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  536|       |
  537|  8.57k|    if (hDecoder == NULL)
  ------------------
  |  Branch (537:9): [True: 0, False: 8.57k]
  ------------------
  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|   557k|    for (i = 0; i < MAX_CHANNELS; i++)
  ------------------
  |  |   43|   557k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (548:17): [True: 548k, False: 8.57k]
  ------------------
  549|   548k|    {
  550|   548k|        if (hDecoder->time_out[i]) faad_free(hDecoder->time_out[i]);
  ------------------
  |  Branch (550:13): [True: 213k, False: 335k]
  ------------------
  551|   548k|        if (hDecoder->fb_intermed[i]) faad_free(hDecoder->fb_intermed[i]);
  ------------------
  |  Branch (551:13): [True: 123k, False: 425k]
  ------------------
  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|   548k|    }
  563|       |
  564|       |#ifdef SSR_DEC
  565|       |    if (hDecoder->object_type == SSR)
  566|       |        ssr_filter_bank_end(hDecoder->fb);
  567|       |    else
  568|       |#endif
  569|  8.57k|        filter_bank_end(hDecoder->fb);
  570|       |
  571|  8.57k|    drc_end(hDecoder->drc);
  572|       |
  573|  8.57k|    if (hDecoder->sample_buffer) faad_free(hDecoder->sample_buffer);
  ------------------
  |  Branch (573:9): [True: 1.30k, False: 7.26k]
  ------------------
  574|       |
  575|  8.57k|#ifdef SBR_DEC
  576|   419k|    for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
  ------------------
  |  |   44|   419k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (576:17): [True: 411k, False: 8.57k]
  ------------------
  577|   411k|    {
  578|   411k|        if (hDecoder->sbr[i])
  ------------------
  |  Branch (578:13): [True: 91.4k, False: 319k]
  ------------------
  579|  91.4k|            sbrDecodeEnd(hDecoder->sbr[i]);
  580|   411k|    }
  581|  8.57k|#endif
  582|       |
  583|  8.57k|    if (hDecoder) faad_free(hDecoder);
  ------------------
  |  Branch (583:9): [True: 8.57k, False: 0]
  ------------------
  584|  8.57k|}
NeAACDecPostSeekReset:
  587|  5.47k|{
  588|  5.47k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  589|  5.47k|    if (hDecoder)
  ------------------
  |  Branch (589:9): [True: 5.47k, False: 0]
  ------------------
  590|  5.47k|    {
  591|  5.47k|        hDecoder->postSeekResetFlag = 1;
  592|       |
  593|  5.47k|        if (frame != -1)
  ------------------
  |  Branch (593:13): [True: 5.47k, False: 0]
  ------------------
  594|  5.47k|            hDecoder->frame = frame;
  595|  5.47k|    }
  596|  5.47k|}
NeAACDecDecode:
  825|  9.20k|{
  826|  9.20k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  827|       |    return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0);
  828|  9.20k|}
NeAACDecDecode2:
  836|  5.96k|{
  837|  5.96k|    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
  838|  5.96k|    if ((sample_buffer_size == 0) || (sample_buffer == NULL) || (*sample_buffer == NULL))
  ------------------
  |  Branch (838:9): [True: 76, False: 5.88k]
  |  Branch (838:38): [True: 0, False: 5.88k]
  |  Branch (838:65): [True: 0, False: 5.88k]
  ------------------
  839|     76|    {
  840|     76|        hInfo->error = 27;
  841|     76|        return NULL;
  842|     76|    }
  843|       |
  844|  5.88k|    return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size,
  845|  5.88k|        sample_buffer, sample_buffer_size);
  846|  5.96k|}
decoder.c:aac_frame_decode:
  854|  15.0k|{
  855|  15.0k|    uint16_t i;
  856|  15.0k|    uint8_t channels = 0;
  857|  15.0k|    uint8_t output_channels = 0;
  858|  15.0k|    bitfile ld;
  859|  15.0k|    uint32_t bitsconsumed;
  860|  15.0k|    uint16_t frame_len;
  861|  15.0k|    void *sample_buffer;
  862|       |#if 0
  863|       |    uint32_t startbit=0, endbit=0, payload_bits=0;
  864|       |#endif
  865|  15.0k|    uint32_t required_buffer_size=0;
  866|       |
  867|       |#ifdef PROFILE
  868|       |    int64_t count = faad_get_ts();
  869|       |#endif
  870|       |
  871|       |    /* safety checks */
  872|  15.0k|    if ((hDecoder == NULL) || (hInfo == NULL) || (buffer == NULL))
  ------------------
  |  Branch (872:9): [True: 0, False: 15.0k]
  |  Branch (872:31): [True: 0, False: 15.0k]
  |  Branch (872:50): [True: 0, False: 15.0k]
  ------------------
  873|      0|    {
  874|      0|        return NULL;
  875|      0|    }
  876|       |
  877|       |#if 0
  878|       |    printf("%d\n", buffer_size*8);
  879|       |#endif
  880|       |
  881|  15.0k|    frame_len = hDecoder->frameLength;
  882|       |
  883|       |
  884|  15.0k|    memset(hInfo, 0, sizeof(NeAACDecFrameInfo));
  885|  15.0k|    memset(hDecoder->internal_channel, 0, MAX_CHANNELS*sizeof(hDecoder->internal_channel[0]));
  ------------------
  |  |   43|  15.0k|#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|  15.0k|    if (buffer_size >= 128)
  ------------------
  |  Branch (902:9): [True: 1.34k, False: 13.7k]
  ------------------
  903|  1.34k|    {
  904|  1.34k|        if (memcmp(buffer, "TAG", 3) == 0)
  ------------------
  |  Branch (904:13): [True: 3, False: 1.34k]
  ------------------
  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.34k|    }
  912|       |
  913|       |
  914|       |    /* initialize the bitstream */
  915|  15.0k|    faad_initbits(&ld, buffer, buffer_size);
  916|  15.0k|    if (ld.error != 0)
  ------------------
  |  Branch (916:9): [True: 6.20k, False: 8.88k]
  ------------------
  917|  6.20k|        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|  8.88k|#ifdef DRM
  951|  8.88k|    if (hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|  8.88k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (951:9): [True: 827, False: 8.05k]
  ------------------
  952|    827|    {
  953|       |        /* We do not support stereo right now */
  954|    827|        if (0) //(hDecoder->channelConfiguration == 2)
  ------------------
  |  Branch (954:13): [Folded, False: 827]
  ------------------
  955|      0|        {
  956|      0|            hInfo->error = 28; // Throw CRC error
  957|      0|            goto error;
  958|      0|        }
  959|       |
  960|    827|        faad_getbits(&ld, 8
  961|    827|            DEBUGVAR(1,1,"NeAACDecDecode(): skip CRC"));
  962|    827|    }
  963|  8.88k|#endif
  964|       |
  965|  8.88k|    if (hDecoder->adts_header_present)
  ------------------
  |  Branch (965:9): [True: 82, False: 8.80k]
  ------------------
  966|     82|    {
  967|     82|        adts_header adts;
  968|       |
  969|     82|        adts.old_format = hDecoder->config.useOldADTSFormat;
  970|     82|        if ((hInfo->error = adts_frame(&adts, &ld)) > 0)
  ------------------
  |  Branch (970:13): [True: 5, False: 77]
  ------------------
  971|      5|            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|     82|    }
  978|       |
  979|       |#ifdef ANALYSIS
  980|       |    dbg_count = 0;
  981|       |#endif
  982|       |
  983|       |    /* decode the complete bitstream */
  984|  8.87k|#ifdef DRM
  985|  8.87k|    if (/*(hDecoder->object_type == 6) ||*/ hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|  8.87k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (985:45): [True: 827, False: 8.05k]
  ------------------
  986|    827|    {
  987|    827|        DRM_aac_scalable_main_element(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
  988|  8.05k|    } else {
  989|  8.05k|#endif
  990|  8.05k|        raw_data_block(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
  991|  8.05k|#ifdef DRM
  992|  8.05k|    }
  993|  8.87k|#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|  8.87k|    channels = hDecoder->fr_channels;
 1009|       |
 1010|  8.87k|    if (hInfo->error > 0)
  ------------------
  |  Branch (1010:9): [True: 5.71k, False: 3.16k]
  ------------------
 1011|  5.71k|        goto error;
 1012|       |
 1013|       |    /* safety check */
 1014|  3.16k|    if (channels == 0 || channels > MAX_CHANNELS)
  ------------------
  |  |   43|  3.14k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (1014:9): [True: 21, False: 3.14k]
  |  Branch (1014:26): [True: 0, False: 3.14k]
  ------------------
 1015|     21|    {
 1016|       |        /* invalid number of channels */
 1017|     21|        hInfo->error = 12;
 1018|     21|        goto error;
 1019|     21|    }
 1020|       |
 1021|       |    /* no more bit reading after this */
 1022|  3.14k|    bitsconsumed = faad_get_processed_bits(&ld);
 1023|  3.14k|    hInfo->bytesconsumed = bit2byte(bitsconsumed);
  ------------------
  |  |   46|  3.14k|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|  3.14k|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
 1024|  3.14k|    if (ld.error)
  ------------------
  |  Branch (1024:9): [True: 0, False: 3.14k]
  ------------------
 1025|      0|    {
 1026|      0|        hInfo->error = 14;
 1027|      0|        goto error;
 1028|      0|    }
 1029|  3.14k|    faad_endbits(&ld);
 1030|       |
 1031|       |
 1032|  3.14k|    if (!hDecoder->adts_header_present && !hDecoder->adif_header_present
  ------------------
  |  Branch (1032:9): [True: 3.11k, False: 33]
  |  Branch (1032:43): [True: 3.11k, False: 0]
  ------------------
 1033|       |#if 0
 1034|       |        && !hDecoder->latm_header_present
 1035|       |#endif
 1036|  3.14k|        )
 1037|  3.11k|    {
 1038|  3.11k|        if (hDecoder->channelConfiguration == 0)
  ------------------
  |  Branch (1038:13): [True: 140, False: 2.97k]
  ------------------
 1039|    140|            hDecoder->channelConfiguration = channels;
 1040|       |
 1041|  3.11k|        if (channels == 8) /* 7.1 */
  ------------------
  |  Branch (1041:13): [True: 123, False: 2.98k]
  ------------------
 1042|    123|            hDecoder->channelConfiguration = 7;
 1043|  3.11k|        if (channels == 7) /* not a standard channelConfiguration */
  ------------------
  |  Branch (1043:13): [True: 0, False: 3.11k]
  ------------------
 1044|      0|            hDecoder->channelConfiguration = 0;
 1045|  3.11k|    }
 1046|       |
 1047|  3.14k|    if ((channels == 5 || channels == 6) && hDecoder->config.downMatrix)
  ------------------
  |  Branch (1047:10): [True: 0, False: 3.14k]
  |  Branch (1047:27): [True: 884, False: 2.26k]
  |  Branch (1047:45): [True: 524, False: 360]
  ------------------
 1048|    524|    {
 1049|    524|        hDecoder->downMatrix = 1;
 1050|    524|        output_channels = 2;
 1051|  2.62k|    } else {
 1052|  2.62k|        output_channels = channels;
 1053|  2.62k|    }
 1054|       |
 1055|  3.14k|#if (defined(PS_DEC) || defined(DRM_PS))
 1056|  3.14k|    hDecoder->upMatrix = 0;
 1057|       |    /* check if we have a mono file */
 1058|  3.14k|    if (output_channels == 1)
  ------------------
  |  Branch (1058:9): [True: 0, False: 3.14k]
  ------------------
 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|  3.14k|#endif
 1065|       |
 1066|       |    /* Make a channel configuration based on either a PCE or a channelConfiguration */
 1067|  3.14k|    if (!hDecoder->downMatrix && hDecoder->pce_set)
  ------------------
  |  Branch (1067:9): [True: 2.62k, False: 524]
  |  Branch (1067:34): [True: 162, False: 2.45k]
  ------------------
 1068|    162|    {
 1069|       |        /* In some codepath program_config_element result is ignored. */
 1070|    162|        if (hDecoder->pce.channels > MAX_CHANNELS)
  ------------------
  |  |   43|    162|#define MAX_CHANNELS        64
  ------------------
  |  Branch (1070:13): [True: 3, False: 159]
  ------------------
 1071|      3|        {
 1072|      3|            hInfo->error = 22;
 1073|      3|            return NULL;
 1074|      3|        }
 1075|    162|    }
 1076|  3.14k|    create_channel_config(hDecoder, hInfo);
 1077|       |
 1078|       |    /* number of samples in this frame */
 1079|  3.14k|    hInfo->samples = frame_len*output_channels;
 1080|       |    /* number of channels in this frame */
 1081|  3.14k|    hInfo->channels = output_channels;
 1082|       |    /* samplerate */
 1083|  3.14k|    hInfo->samplerate = get_sample_rate(hDecoder->sf_index);
 1084|       |    /* object type */
 1085|  3.14k|    hInfo->object_type = hDecoder->object_type;
 1086|       |    /* sbr */
 1087|  3.14k|    hInfo->sbr = NO_SBR;
  ------------------
  |  |   57|  3.14k|#define NO_SBR           0
  ------------------
 1088|       |    /* header type */
 1089|  3.14k|    hInfo->header_type = RAW;
  ------------------
  |  |   51|  3.14k|#define RAW        0
  ------------------
 1090|  3.14k|    if (hDecoder->adif_header_present)
  ------------------
  |  Branch (1090:9): [True: 0, False: 3.14k]
  ------------------
 1091|      0|        hInfo->header_type = ADIF;
  ------------------
  |  |   52|      0|#define ADIF       1
  ------------------
 1092|  3.14k|    if (hDecoder->adts_header_present)
  ------------------
  |  Branch (1092:9): [True: 33, False: 3.10k]
  ------------------
 1093|     33|        hInfo->header_type = ADTS;
  ------------------
  |  |   53|     33|#define ADTS       2
  ------------------
 1094|       |#if 0
 1095|       |    if (hDecoder->latm_header_present)
 1096|       |        hInfo->header_type = LATM;
 1097|       |#endif
 1098|  3.14k|#if (defined(PS_DEC) || defined(DRM_PS))
 1099|  3.14k|    hInfo->ps = hDecoder->ps_used_global;
 1100|  3.14k|#endif
 1101|       |
 1102|       |    /* check if frame has channel elements */
 1103|  3.14k|    if (channels == 0)
  ------------------
  |  Branch (1103:9): [True: 0, False: 3.14k]
  ------------------
 1104|      0|    {
 1105|      0|        hDecoder->frame++;
 1106|      0|        return NULL;
 1107|      0|    }
 1108|       |
 1109|  3.14k|    {
 1110|  3.14k|        static const uint8_t str[] = { sizeof(int16_t), sizeof(int32_t), sizeof(int32_t),
 1111|  3.14k|            sizeof(float32_t), sizeof(double), sizeof(int16_t), sizeof(int16_t),
 1112|  3.14k|            sizeof(int16_t), sizeof(int16_t), 0, 0, 0
 1113|  3.14k|        };
 1114|  3.14k|        uint8_t stride = str[hDecoder->config.outputFormat-1];
 1115|  3.14k|#ifdef SBR_DEC
 1116|  3.14k|        if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1116:14): [True: 1.52k, False: 1.61k]
  |  Branch (1116:49): [True: 977, False: 547]
  |  Branch (1116:81): [True: 663, False: 1.50k]
  ------------------
 1117|  1.64k|        {
 1118|  1.64k|            stride = 2 * stride;
 1119|  1.64k|        }
 1120|  3.14k|#endif
 1121|  3.14k|        required_buffer_size = frame_len*output_channels*stride;
 1122|  3.14k|    }
 1123|       |
 1124|       |    /* check if we want to use internal sample_buffer */
 1125|  3.14k|    if (sample_buffer_size == 0)
  ------------------
  |  Branch (1125:9): [True: 1.49k, False: 1.64k]
  ------------------
 1126|  1.49k|    {
 1127|       |        /* allocate the buffer for the final samples */
 1128|  1.49k|        if (hDecoder->sample_buffer_size != required_buffer_size) 
  ------------------
  |  Branch (1128:13): [True: 1.33k, False: 164]
  ------------------
 1129|  1.33k|        {
 1130|  1.33k|            if (hDecoder->sample_buffer)
  ------------------
  |  Branch (1130:17): [True: 30, False: 1.30k]
  ------------------
 1131|     30|                faad_free(hDecoder->sample_buffer);
 1132|  1.33k|            hDecoder->sample_buffer = NULL;
 1133|  1.33k|            hDecoder->sample_buffer = faad_malloc(required_buffer_size);
 1134|  1.33k|            hDecoder->sample_buffer_size = required_buffer_size;
 1135|  1.33k|        }
 1136|  1.64k|    } else if (sample_buffer_size < required_buffer_size) {
  ------------------
  |  Branch (1136:16): [True: 593, False: 1.05k]
  ------------------
 1137|       |        /* provided sample buffer is not big enough */
 1138|    593|        hInfo->error = 27;
 1139|    593|        return NULL;
 1140|    593|    }
 1141|       |
 1142|  2.54k|    if (sample_buffer_size == 0)
  ------------------
  |  Branch (1142:9): [True: 1.49k, False: 1.05k]
  ------------------
 1143|  1.49k|    {
 1144|  1.49k|        sample_buffer = hDecoder->sample_buffer;
 1145|  1.49k|    } else {
 1146|  1.05k|        sample_buffer = *sample_buffer2;
 1147|  1.05k|    }
 1148|       |
 1149|  2.54k|#ifdef SBR_DEC
 1150|  2.54k|    if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
  ------------------
  |  Branch (1150:9): [True: 1.28k, False: 1.26k]
  |  Branch (1150:46): [True: 438, False: 830]
  ------------------
 1151|  1.71k|    {
 1152|  1.71k|        uint8_t ele;
 1153|       |
 1154|       |        /* this data is different when SBR is used or when the data is upsampled */
 1155|  1.71k|        if (!hDecoder->downSampledSBR)
  ------------------
  |  Branch (1155:13): [True: 1.23k, False: 487]
  ------------------
 1156|  1.23k|        {
 1157|  1.23k|            frame_len *= 2;
 1158|  1.23k|            hInfo->samples *= 2;
 1159|  1.23k|            hInfo->samplerate *= 2;
 1160|  1.23k|        }
 1161|       |
 1162|       |        /* check if every element was provided with SBR data */
 1163|  7.68k|        for (ele = 0; ele < hDecoder->fr_ch_ele; ele++)
  ------------------
  |  Branch (1163:23): [True: 5.97k, False: 1.71k]
  ------------------
 1164|  5.97k|        {
 1165|  5.97k|            if (hDecoder->sbr[ele] == NULL)
  ------------------
  |  Branch (1165:17): [True: 2, False: 5.97k]
  ------------------
 1166|      2|            {
 1167|      2|                hInfo->error = 25;
 1168|      2|                goto error;
 1169|      2|            }
 1170|  5.97k|        }
 1171|       |
 1172|       |        /* sbr */
 1173|  1.71k|        if (hDecoder->sbr_present_flag == 1)
  ------------------
  |  Branch (1173:13): [True: 1.27k, False: 438]
  ------------------
 1174|  1.27k|        {
 1175|  1.27k|            hInfo->object_type = HE_AAC;
  ------------------
  |  |   44|  1.27k|#define HE_AAC     5
  ------------------
 1176|  1.27k|            hInfo->sbr = SBR_UPSAMPLED;
  ------------------
  |  |   58|  1.27k|#define SBR_UPSAMPLED    1
  ------------------
 1177|  1.27k|        } else {
 1178|    438|            hInfo->sbr = NO_SBR_UPSAMPLED;
  ------------------
  |  |   60|    438|#define NO_SBR_UPSAMPLED 3
  ------------------
 1179|    438|        }
 1180|  1.71k|        if (hDecoder->downSampledSBR)
  ------------------
  |  Branch (1180:13): [True: 485, False: 1.23k]
  ------------------
 1181|    485|        {
 1182|    485|            hInfo->sbr = SBR_DOWNSAMPLED;
  ------------------
  |  |   59|    485|#define SBR_DOWNSAMPLED  2
  ------------------
 1183|    485|        }
 1184|  1.71k|    }
 1185|  2.54k|#endif
 1186|       |
 1187|       |
 1188|  2.54k|    sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer,
 1189|  2.54k|        output_channels, frame_len, hDecoder->config.outputFormat);
 1190|       |
 1191|       |
 1192|  2.54k|#ifdef DRM
 1193|       |    //conceal_output(hDecoder, frame_len, output_channels, sample_buffer);
 1194|  2.54k|#endif
 1195|       |
 1196|       |
 1197|  2.54k|    hDecoder->postSeekResetFlag = 0;
 1198|       |
 1199|  2.54k|    hDecoder->frame++;
 1200|       |#ifdef LD_DEC
 1201|       |    if (hDecoder->object_type != LD)
 1202|       |    {
 1203|       |#endif
 1204|  2.54k|        if (hDecoder->frame <= 1)
  ------------------
  |  Branch (1204:13): [True: 982, False: 1.56k]
  ------------------
 1205|    982|            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.54k|    return sample_buffer;
 1225|       |
 1226|  5.74k|error:
 1227|       |
 1228|       |    /* reset filterbank state */
 1229|   373k|    for (i = 0; i < MAX_CHANNELS; i++)
  ------------------
  |  |   43|   373k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (1229:17): [True: 367k, False: 5.74k]
  ------------------
 1230|   367k|    {
 1231|   367k|        if (hDecoder->fb_intermed[i] != NULL)
  ------------------
  |  Branch (1231:13): [True: 133k, False: 233k]
  ------------------
 1232|   133k|        {
 1233|   133k|            memset(hDecoder->fb_intermed[i], 0, hDecoder->frameLength*sizeof(real_t));
 1234|   133k|        }
 1235|   367k|    }
 1236|  5.74k|#ifdef SBR_DEC
 1237|   281k|    for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
  ------------------
  |  |   44|   281k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (1237:17): [True: 275k, False: 5.74k]
  ------------------
 1238|   275k|    {
 1239|   275k|        if (hDecoder->sbr[i] != NULL)
  ------------------
  |  Branch (1239:13): [True: 102k, False: 172k]
  ------------------
 1240|   102k|        {
 1241|   102k|            sbrReset(hDecoder->sbr[i]);
 1242|   102k|        }
 1243|   275k|    }
 1244|  5.74k|#endif
 1245|       |
 1246|       |
 1247|  5.74k|    faad_endbits(&ld);
 1248|       |
 1249|       |    /* cleanup */
 1250|       |#ifdef ANALYSIS
 1251|       |    fflush(stdout);
 1252|       |#endif
 1253|       |
 1254|       |    return NULL;
 1255|  2.54k|}
decoder.c:create_channel_config:
  599|  3.14k|{
  600|  3.14k|    hInfo->num_front_channels = 0;
  601|  3.14k|    hInfo->num_side_channels = 0;
  602|  3.14k|    hInfo->num_back_channels = 0;
  603|  3.14k|    hInfo->num_lfe_channels = 0;
  604|  3.14k|    memset(hInfo->channel_position, 0, MAX_CHANNELS*sizeof(uint8_t));
  ------------------
  |  |   43|  3.14k|#define MAX_CHANNELS        64
  ------------------
  605|       |
  606|  3.14k|    if (hDecoder->downMatrix)
  ------------------
  |  Branch (606:9): [True: 524, False: 2.61k]
  ------------------
  607|    524|    {
  608|    524|        hInfo->num_front_channels = 2;
  609|    524|        hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    524|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  610|    524|        hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    524|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  611|    524|        return;
  612|    524|    }
  613|       |
  614|       |    /* check if there is a PCE */
  615|       |    /* TODO: why CPE flag is ignored? */
  616|  2.61k|    if (hDecoder->pce_set)
  ------------------
  |  Branch (616:9): [True: 159, False: 2.45k]
  ------------------
  617|    159|    {
  618|    159|        uint8_t i, chpos = 0;
  619|    159|        uint8_t chdir, back_center = 0;
  620|       |
  621|    159|        hInfo->num_front_channels = hDecoder->pce.num_front_channels;
  622|    159|        hInfo->num_side_channels = hDecoder->pce.num_side_channels;
  623|    159|        hInfo->num_back_channels = hDecoder->pce.num_back_channels;
  624|    159|        hInfo->num_lfe_channels = hDecoder->pce.num_lfe_channels;
  625|    159|        chdir = hInfo->num_front_channels;
  626|    159|        if (chdir & 1)
  ------------------
  |  Branch (626:13): [True: 61, False: 98]
  ------------------
  627|     61|        {
  628|     61|#if (defined(PS_DEC) || defined(DRM_PS))
  629|     61|            if (hInfo->num_front_channels == 1 &&
  ------------------
  |  Branch (629:17): [True: 27, False: 34]
  ------------------
  630|     27|                hInfo->num_side_channels == 0 &&
  ------------------
  |  Branch (630:17): [True: 16, False: 11]
  ------------------
  631|     16|                hInfo->num_back_channels == 0 &&
  ------------------
  |  Branch (631:17): [True: 10, False: 6]
  ------------------
  632|     10|                hInfo->num_lfe_channels == 0)
  ------------------
  |  Branch (632:17): [True: 7, False: 3]
  ------------------
  633|      7|            {
  634|       |                /* When PS is enabled output is always stereo */
  635|      7|                hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|      7|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  636|      7|                hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|      7|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  637|      7|            } else
  638|     54|#endif
  639|     54|            hInfo->channel_position[chpos++] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|     54|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  640|     61|            chdir--;
  641|     61|        }
  642|    781|        for (i = 0; i < chdir; i++)
  ------------------
  |  Branch (642:21): [True: 622, False: 159]
  ------------------
  643|    622|        {
  644|    622|            hInfo->channel_position[chpos++] =
  645|    622|                (i & 1) ? FRONT_CHANNEL_RIGHT : FRONT_CHANNEL_LEFT;
  ------------------
  |  |  116|    311|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
                              (i & 1) ? FRONT_CHANNEL_RIGHT : FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    933|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  |  Branch (645:17): [True: 311, False: 311]
  ------------------
  646|    622|        }
  647|       |
  648|    742|        for (i = 0; i < hInfo->num_side_channels; i++)
  ------------------
  |  Branch (648:21): [True: 583, False: 159]
  ------------------
  649|    583|        {
  650|    583|            hInfo->channel_position[chpos++] =
  651|    583|                (i & 1) ? SIDE_CHANNEL_RIGHT : SIDE_CHANNEL_LEFT;
  ------------------
  |  |  118|    286|#define SIDE_CHANNEL_RIGHT   (5)
  ------------------
                              (i & 1) ? SIDE_CHANNEL_RIGHT : SIDE_CHANNEL_LEFT;
  ------------------
  |  |  117|    880|#define SIDE_CHANNEL_LEFT    (4)
  ------------------
  |  Branch (651:17): [True: 286, False: 297]
  ------------------
  652|    583|        }
  653|       |
  654|    159|        chdir = hInfo->num_back_channels;
  655|    159|        if (chdir & 1)
  ------------------
  |  Branch (655:13): [True: 20, False: 139]
  ------------------
  656|     20|        {
  657|     20|            back_center = 1;
  658|     20|            chdir--;
  659|     20|        }
  660|    517|        for (i = 0; i < chdir; i++)
  ------------------
  |  Branch (660:21): [True: 358, False: 159]
  ------------------
  661|    358|        {
  662|    358|            hInfo->channel_position[chpos++] =
  663|    358|                (i & 1) ? BACK_CHANNEL_RIGHT : BACK_CHANNEL_LEFT;
  ------------------
  |  |  120|    179|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
                              (i & 1) ? BACK_CHANNEL_RIGHT : BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    537|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  |  Branch (663:17): [True: 179, False: 179]
  ------------------
  664|    358|        }
  665|    159|        if (back_center)
  ------------------
  |  Branch (665:13): [True: 20, False: 139]
  ------------------
  666|     20|        {
  667|     20|            hInfo->channel_position[chpos++] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|     20|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  668|     20|        }
  669|       |
  670|    231|        for (i = 0; i < hInfo->num_lfe_channels; i++)
  ------------------
  |  Branch (670:21): [True: 72, False: 159]
  ------------------
  671|     72|        {
  672|     72|            hInfo->channel_position[chpos++] = LFE_CHANNEL;
  ------------------
  |  |  122|     72|#define LFE_CHANNEL          (9)
  ------------------
  673|     72|        }
  674|       |
  675|  2.45k|    } else {
  676|  2.45k|        switch (hDecoder->channelConfiguration)
  677|  2.45k|        {
  678|    289|        case 1:
  ------------------
  |  Branch (678:9): [True: 289, False: 2.16k]
  ------------------
  679|    289|#if (defined(PS_DEC) || defined(DRM_PS))
  680|       |            /* When PS is enabled output is always stereo */
  681|    289|            hInfo->num_front_channels = 2;
  682|    289|            hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    289|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  683|    289|            hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    289|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  684|       |#else
  685|       |            hInfo->num_front_channels = 1;
  686|       |            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  687|       |#endif
  688|    289|            break;
  689|  1.20k|        case 2:
  ------------------
  |  Branch (689:9): [True: 1.20k, False: 1.25k]
  ------------------
  690|  1.20k|            hInfo->num_front_channels = 2;
  691|  1.20k|            hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|  1.20k|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  692|  1.20k|            hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|  1.20k|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  693|  1.20k|            break;
  694|    134|        case 3:
  ------------------
  |  Branch (694:9): [True: 134, False: 2.32k]
  ------------------
  695|    134|            hInfo->num_front_channels = 3;
  696|    134|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    134|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  697|    134|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    134|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  698|    134|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    134|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  699|    134|            break;
  700|    211|        case 4:
  ------------------
  |  Branch (700:9): [True: 211, False: 2.24k]
  ------------------
  701|    211|            hInfo->num_front_channels = 3;
  702|    211|            hInfo->num_back_channels = 1;
  703|    211|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    211|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  704|    211|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    211|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  705|    211|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    211|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  706|    211|            hInfo->channel_position[3] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|    211|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  707|    211|            break;
  708|    150|        case 5:
  ------------------
  |  Branch (708:9): [True: 150, False: 2.30k]
  ------------------
  709|    150|            hInfo->num_front_channels = 3;
  710|    150|            hInfo->num_back_channels = 2;
  711|    150|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    150|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  712|    150|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    150|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  713|    150|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    150|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  714|    150|            hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    150|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  715|    150|            hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|    150|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  716|    150|            break;
  717|     46|        case 6:
  ------------------
  |  Branch (717:9): [True: 46, False: 2.41k]
  ------------------
  718|     46|            hInfo->num_front_channels = 3;
  719|     46|            hInfo->num_back_channels = 2;
  720|     46|            hInfo->num_lfe_channels = 1;
  721|     46|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|     46|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  722|     46|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|     46|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  723|     46|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|     46|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  724|     46|            hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|     46|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  725|     46|            hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|     46|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  726|     46|            hInfo->channel_position[5] = LFE_CHANNEL;
  ------------------
  |  |  122|     46|#define LFE_CHANNEL          (9)
  ------------------
  727|     46|            break;
  728|    393|        case 7:
  ------------------
  |  Branch (728:9): [True: 393, False: 2.06k]
  ------------------
  729|    393|            hInfo->num_front_channels = 3;
  730|    393|            hInfo->num_side_channels = 2;
  731|    393|            hInfo->num_back_channels = 2;
  732|    393|            hInfo->num_lfe_channels = 1;
  733|    393|            hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|    393|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  734|    393|            hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    393|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  735|    393|            hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    393|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  736|    393|            hInfo->channel_position[3] = SIDE_CHANNEL_LEFT;
  ------------------
  |  |  117|    393|#define SIDE_CHANNEL_LEFT    (4)
  ------------------
  737|    393|            hInfo->channel_position[4] = SIDE_CHANNEL_RIGHT;
  ------------------
  |  |  118|    393|#define SIDE_CHANNEL_RIGHT   (5)
  ------------------
  738|    393|            hInfo->channel_position[5] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|    393|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  739|    393|            hInfo->channel_position[6] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|    393|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  740|    393|            hInfo->channel_position[7] = LFE_CHANNEL;
  ------------------
  |  |  122|    393|#define LFE_CHANNEL          (9)
  ------------------
  741|    393|            break;
  742|     33|        default: /* channelConfiguration == 0 || channelConfiguration > 7 */
  ------------------
  |  Branch (742:9): [True: 33, False: 2.42k]
  ------------------
  743|     33|            {
  744|     33|                uint8_t i;
  745|     33|                uint8_t ch = hDecoder->fr_channels - hDecoder->has_lfe;
  746|     33|                if (ch & 1) /* there's either a center front or a center back channel */
  ------------------
  |  Branch (746:21): [True: 0, False: 33]
  ------------------
  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|     33|                } else {
  780|     33|                    uint8_t ch1 = (ch)/2;
  781|     33|                    hInfo->num_front_channels = ch1;
  782|     33|                    hInfo->num_back_channels = ch1;
  783|     33|                    if (ch1 & 1)
  ------------------
  |  Branch (783:25): [True: 19, False: 14]
  ------------------
  784|     19|                    {
  785|     19|                        hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
  ------------------
  |  |  114|     19|#define FRONT_CHANNEL_CENTER (1)
  ------------------
  786|    120|                        for (i = 1; i <= ch1; i+=2)
  ------------------
  |  Branch (786:37): [True: 101, False: 19]
  ------------------
  787|    101|                        {
  788|    101|                            hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|    101|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  789|    101|                            hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|    101|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  790|    101|                        }
  791|    101|                        for (i = ch1+1; i < ch-1; i+=2)
  ------------------
  |  Branch (791:41): [True: 82, False: 19]
  ------------------
  792|     82|                        {
  793|     82|                            hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|     82|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  794|     82|                            hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|     82|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  795|     82|                        }
  796|     19|                        hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
  ------------------
  |  |  121|     19|#define BACK_CHANNEL_CENTER  (8)
  ------------------
  797|     19|                    } else {
  798|     97|                        for (i = 0; i < ch1; i+=2)
  ------------------
  |  Branch (798:37): [True: 83, False: 14]
  ------------------
  799|     83|                        {
  800|     83|                            hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
  ------------------
  |  |  115|     83|#define FRONT_CHANNEL_LEFT   (2)
  ------------------
  801|     83|                            hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
  ------------------
  |  |  116|     83|#define FRONT_CHANNEL_RIGHT  (3)
  ------------------
  802|     83|                        }
  803|     97|                        for (i = ch1; i < ch; i+=2)
  ------------------
  |  Branch (803:39): [True: 83, False: 14]
  ------------------
  804|     83|                        {
  805|     83|                            hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
  ------------------
  |  |  119|     83|#define BACK_CHANNEL_LEFT    (6)
  ------------------
  806|     83|                            hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
  ------------------
  |  |  120|     83|#define BACK_CHANNEL_RIGHT   (7)
  ------------------
  807|     83|                        }
  808|     14|                    }
  809|     33|                }
  810|     33|                hInfo->num_lfe_channels = hDecoder->has_lfe;
  811|     33|                for (i = ch; i < hDecoder->fr_channels; i++)
  ------------------
  |  Branch (811:30): [True: 0, False: 33]
  ------------------
  812|      0|                {
  813|      0|                    hInfo->channel_position[i] = LFE_CHANNEL;
  ------------------
  |  |  122|      0|#define LFE_CHANNEL          (9)
  ------------------
  814|      0|                }
  815|     33|            }
  816|     33|            break;
  817|  2.45k|        }
  818|  2.45k|    }
  819|  2.61k|}

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

drm_ps_data:
  445|   706k|{
  446|   706k|    uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
  447|       |
  448|   706k|    ps->drm_ps_data_available = 1;
  449|       |
  450|   706k|    ps->bs_enable_sa = faad_get1bit(ld);
  451|   706k|    ps->bs_enable_pan = faad_get1bit(ld);
  452|       |
  453|   706k|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (453:9): [True: 13.1k, False: 692k]
  ------------------
  454|  13.1k|    {
  455|  13.1k|        drm_ps_sa_element(ps, ld);
  456|  13.1k|    }
  457|       |
  458|   706k|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (458:9): [True: 7.99k, False: 698k]
  ------------------
  459|  7.99k|    {
  460|  7.99k|        drm_ps_pan_element(ps, ld);
  461|  7.99k|    }
  462|       |
  463|   706k|    bits = (uint16_t)faad_get_processed_bits(ld) - bits;
  464|       |
  465|   706k|    return bits;
  466|   706k|}
drm_ps_init:
  890|  4.98k|{
  891|  4.98k|    drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info));
  892|       |
  893|  4.98k|    memset(ps, 0, sizeof(drm_ps_info));
  894|       |
  895|  4.98k|    return ps;
  896|  4.98k|}
drm_ps_free:
  899|  4.98k|{
  900|  4.98k|    faad_free(ps);
  901|  4.98k|}
drm_ps_decode:
  905|    220|{
  906|    220|    if (ps == NULL)
  ------------------
  |  Branch (906:9): [True: 8, False: 212]
  ------------------
  907|      8|    {
  908|      8|        memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
  909|      8|        return 0;
  910|      8|    }
  911|       |
  912|    212|    if (!ps->drm_ps_data_available && !guess)
  ------------------
  |  Branch (912:9): [True: 13, False: 199]
  |  Branch (912:39): [True: 1, False: 12]
  ------------------
  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|    211|    if (!guess)
  ------------------
  |  Branch (922:9): [True: 122, False: 89]
  ------------------
  923|    122|    {
  924|    122|        ps->sa_decode_error = 0;
  925|    122|        ps->pan_decode_error = 0;
  926|    122|        drm_ps_delta_decode(ps);
  927|    122|    } else
  928|     89|    {
  929|     89|        ps->sa_decode_error = 1;
  930|     89|        ps->pan_decode_error = 1;
  931|       |        /* don't even bother decoding */
  932|     89|    }
  933|       |
  934|    211|    ps->drm_ps_data_available = 0;
  935|       |
  936|    211|    drm_calc_sa_side_signal(ps, X_left);
  937|    211|    drm_add_ambiance(ps, X_left, X_right);
  938|       |
  939|    211|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (939:9): [True: 75, False: 136]
  ------------------
  940|     75|    {
  941|     75|        ps->g_last_had_sa = 1;
  942|       |
  943|     75|        memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS);
  ------------------
  |  |   41|     75|#define DRM_NUM_SA_BANDS         8
  ------------------
  944|       |
  945|    136|    } else {
  946|    136|        ps->g_last_had_sa = 0;
  947|    136|    }
  948|       |
  949|    211|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (949:9): [True: 156, False: 55]
  ------------------
  950|    156|    {
  951|    156|        drm_add_pan(ps, X_left, X_right);
  952|       |
  953|    156|        ps->g_last_had_pan = 1;
  954|       |
  955|    156|        memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
  ------------------
  |  |   42|    156|#define DRM_NUM_PAN_BANDS       20
  ------------------
  956|       |
  957|    156|    } else {
  958|     55|        ps->g_last_had_pan = 0;
  959|     55|    }
  960|       |
  961|       |
  962|    211|    return 0;
  963|    212|}
drm_dec.c:drm_ps_sa_element:
  469|  13.1k|{
  470|  13.1k|    drm_ps_huff_tab huff;
  471|  13.1k|    uint8_t band;
  472|       |
  473|  13.1k|    ps->bs_sa_dt_flag = faad_get1bit(ld);
  474|  13.1k|    if (ps->bs_sa_dt_flag)
  ------------------
  |  Branch (474:9): [True: 3.82k, False: 9.35k]
  ------------------
  475|  3.82k|    {
  476|  3.82k|        huff = t_huffman_sa;
  477|  9.35k|    } else {
  478|  9.35k|        huff = f_huffman_sa;
  479|  9.35k|    }
  480|       |
  481|   118k|    for (band = 0; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|   118k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (481:20): [True: 105k, False: 13.1k]
  ------------------
  482|   105k|    {
  483|   105k|        ps->bs_sa_data[band] = huff_dec(ld, huff);
  484|   105k|    }
  485|  13.1k|}
drm_dec.c:huff_dec:
  508|   265k|{
  509|   265k|    uint8_t bit;
  510|   265k|    int8_t index = 0;
  511|       |
  512|   791k|    while (index >= 0)
  ------------------
  |  Branch (512:12): [True: 525k, False: 265k]
  ------------------
  513|   525k|    {
  514|   525k|        bit = (uint8_t)faad_get1bit(ld);
  515|   525k|        index = huff[index][bit];
  516|   525k|    }
  517|       |
  518|   265k|    return index + 15;
  519|   265k|}
drm_dec.c:drm_ps_pan_element:
  488|  7.99k|{
  489|  7.99k|    drm_ps_huff_tab huff;
  490|  7.99k|    uint8_t band;
  491|       |
  492|  7.99k|    ps->bs_pan_dt_flag = faad_get1bit(ld);
  493|  7.99k|    if (ps->bs_pan_dt_flag)
  ------------------
  |  Branch (493:9): [True: 2.23k, False: 5.76k]
  ------------------
  494|  2.23k|    {
  495|  2.23k|        huff = t_huffman_pan;
  496|  5.76k|    } else {
  497|  5.76k|        huff = f_huffman_pan;
  498|  5.76k|    }
  499|       |
  500|   167k|    for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|   167k|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (500:20): [True: 159k, False: 7.99k]
  ------------------
  501|   159k|    {
  502|   159k|        ps->bs_pan_data[band] = huff_dec(ld, huff);
  503|   159k|    }
  504|  7.99k|}
drm_dec.c:drm_ps_delta_decode:
  551|    122|{
  552|    122|    uint8_t band;
  553|       |
  554|    122|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (554:9): [True: 102, False: 20]
  ------------------
  555|    102|    {
  556|    102|        if (ps->bs_sa_dt_flag && !ps->g_last_had_sa)
  ------------------
  |  Branch (556:13): [True: 39, False: 63]
  |  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|     78|        } else if (ps->bs_sa_dt_flag) {
  ------------------
  |  Branch (560:20): [True: 15, False: 63]
  ------------------
  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|     63|        } else {
  564|       |            /* DF always decodable */
  565|     63|            ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]);
  566|     63|        }
  567|       |
  568|    816|        for (band = 1; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|    816|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (568:24): [True: 714, False: 102]
  ------------------
  569|    714|        {
  570|    714|            if (ps->bs_sa_dt_flag && ps->g_last_had_sa)
  ------------------
  |  Branch (570:17): [True: 273, False: 441]
  |  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|    609|            } else if (!ps->bs_sa_dt_flag) {
  ------------------
  |  Branch (573:24): [True: 441, False: 168]
  ------------------
  574|    441|                ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]);
  575|    441|            }
  576|    714|        }
  577|    102|    }
  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|    122|    if (ps->sa_decode_error) {
  ------------------
  |  Branch (581:9): [True: 63, False: 59]
  ------------------
  582|     63|        ps->pan_decode_error = 1;
  583|     63|        ps->bs_enable_pan = ps->g_last_had_pan;
  584|     63|        ps->bs_enable_sa = ps->g_last_had_sa;
  585|     63|    }
  586|       |
  587|       |
  588|    122|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (588:9): [True: 45, False: 77]
  ------------------
  589|     45|    {
  590|     45|        if (ps->sa_decode_error) {
  ------------------
  |  Branch (590:13): [True: 30, False: 15]
  ------------------
  591|    270|            for (band = 0; band < DRM_NUM_SA_BANDS; band++)
  ------------------
  |  |   41|    270|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (591:28): [True: 240, False: 30]
  ------------------
  592|    240|            {
  593|    240|                ps->g_sa_index[band] = ps->g_last_good_sa_index[band];
  594|    240|            }
  595|     30|        } 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|     45|    }
  602|       |
  603|    122|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (603:9): [True: 102, False: 20]
  ------------------
  604|    102|    {
  605|    102|        if (ps->bs_pan_dt_flag && !ps->g_last_had_pan)
  ------------------
  |  Branch (605:13): [True: 33, False: 69]
  |  Branch (605:35): [True: 3, False: 30]
  ------------------
  606|      3|        {
  607|      3|            ps->bs_enable_pan = 0;
  608|     99|        }  else if (ps->bs_pan_dt_flag) {
  ------------------
  |  Branch (608:21): [True: 30, False: 69]
  ------------------
  609|     30|            ps->g_pan_index[0] = pan_delta_clip(ps,  ps->g_prev_pan_index[0]+ps->bs_pan_data[0]);
  610|     69|        } else {
  611|     69|            ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]);
  612|     69|        }
  613|       |
  614|  2.04k|        for (band = 1; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|  2.04k|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (614:24): [True: 1.93k, False: 102]
  ------------------
  615|  1.93k|        {
  616|  1.93k|            if (ps->bs_pan_dt_flag && ps->g_last_had_pan)
  ------------------
  |  Branch (616:17): [True: 627, False: 1.31k]
  |  Branch (616:39): [True: 570, False: 57]
  ------------------
  617|    570|            {
  618|    570|                ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]);
  619|  1.36k|            } else if (!ps->bs_pan_dt_flag) {
  ------------------
  |  Branch (619:24): [True: 1.31k, False: 57]
  ------------------
  620|  1.31k|                ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]);
  621|  1.31k|            }
  622|  1.93k|        }
  623|       |
  624|    102|        if (ps->pan_decode_error) {
  ------------------
  |  Branch (624:13): [True: 62, False: 40]
  ------------------
  625|  1.30k|            for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|  1.30k|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (625:28): [True: 1.24k, False: 62]
  ------------------
  626|  1.24k|            {
  627|  1.24k|                ps->g_pan_index[band] = ps->g_last_good_pan_index[band];
  628|  1.24k|            }
  629|     62|        } else {
  630|    840|            for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
  ------------------
  |  |   42|    840|#define DRM_NUM_PAN_BANDS       20
  ------------------
  |  Branch (630:28): [True: 800, False: 40]
  ------------------
  631|    800|            {
  632|    800|                ps->g_last_good_pan_index[band] = ps->g_pan_index[band];
  633|    800|            }
  634|     40|        }
  635|    102|    }
  636|    122|}
drm_dec.c:sa_delta_clip:
  523|    624|{
  524|    624|    if (i < 0) {
  ------------------
  |  Branch (524:9): [True: 180, False: 444]
  ------------------
  525|       |      /*  printf(" SAminclip %d", i); */
  526|    180|        ps->sa_decode_error = 1;
  527|    180|        return 0;
  528|    444|    } else if (i > 7) {
  ------------------
  |  Branch (528:16): [True: 68, False: 376]
  ------------------
  529|       |     /*   printf(" SAmaxclip %d", i); */
  530|     68|        ps->sa_decode_error = 1;
  531|     68|        return 7;
  532|     68|    } else
  533|    376|        return i;
  534|    624|}
drm_dec.c:pan_delta_clip:
  537|  1.98k|{
  538|  1.98k|    if (i < -7) {
  ------------------
  |  Branch (538:9): [True: 204, False: 1.77k]
  ------------------
  539|       |        /* printf(" PANminclip %d", i); */
  540|    204|        ps->pan_decode_error = 1;
  541|    204|        return -7;
  542|  1.77k|    } else if (i > 7) {
  ------------------
  |  Branch (542:16): [True: 149, False: 1.62k]
  ------------------
  543|       |       /* printf(" PANmaxclip %d", i);  */
  544|    149|        ps->pan_decode_error = 1;
  545|    149|        return 7;
  546|    149|    } else
  547|  1.62k|        return i;
  548|  1.98k|}
drm_dec.c:drm_calc_sa_side_signal:
  639|    211|{
  640|    211|    uint8_t s, b, k;
  641|    211|    complex_t qfrac, tmp0, tmp, in, R0;
  642|    211|    real_t peakdiff;
  643|    211|    real_t nrg;
  644|    211|    real_t power;
  645|    211|    real_t transratio;
  646|    211|    real_t new_delay_slopes[NUM_OF_LINKS];
  647|    211|    uint8_t temp_delay_ser[NUM_OF_LINKS];
  648|    211|    complex_t Phi_Fract;
  649|       |#ifdef FIXED_POINT
  650|       |    uint32_t in_re, in_im;
  651|       |#endif
  652|       |
  653|  5.06k|    for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
  ------------------
  |  |   41|  5.06k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (653:17): [True: 4.85k, False: 211]
  ------------------
  654|  4.85k|    {
  655|       |        /* set delay indices */
  656|  19.4k|        for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|  19.4k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (656:21): [True: 14.5k, False: 4.85k]
  ------------------
  657|  14.5k|            temp_delay_ser[k] = ps->delay_buf_index_ser[k];
  658|       |
  659|  4.85k|        RE(Phi_Fract) = RE(Phi_Fract_Qmf[b]);
  ------------------
  |  |  391|  4.85k|#define RE(A) (A)[0]
  ------------------
                      RE(Phi_Fract) = RE(Phi_Fract_Qmf[b]);
  ------------------
  |  |  391|  4.85k|#define RE(A) (A)[0]
  ------------------
  660|  4.85k|        IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
  ------------------
  |  |  392|  4.85k|#define IM(A) (A)[1]
  ------------------
                      IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
  ------------------
  |  |  392|  4.85k|#define IM(A) (A)[1]
  ------------------
  661|       |
  662|   150k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|   150k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (662:21): [True: 145k, False: 4.85k]
  ------------------
  663|   145k|        {
  664|   145k|            const real_t gamma = REAL_CONST(1.5);
  ------------------
  |  |  288|   145k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  665|   145k|            const real_t sigma = REAL_CONST(1.5625);
  ------------------
  |  |  288|   145k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  666|       |
  667|   145k|            RE(in) = QMF_RE(X[s][b]);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          RE(in) = QMF_RE(X[s][b]);
  ------------------
  |  |  168|   145k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   145k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  668|   145k|            IM(in) = QMF_IM(X[s][b]);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          IM(in) = QMF_IM(X[s][b]);
  ------------------
  |  |  169|   145k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   145k|#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|   145k|            power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in));
  ------------------
  |  |  284|   145k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                          power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in));
  ------------------
  |  |  284|   145k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  679|   145k|#endif
  680|       |
  681|   145k|            ps->peakdecay_fast[b] = MUL_F(ps->peakdecay_fast[b], peak_decay);
  ------------------
  |  |  286|   145k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  682|   145k|            if (ps->peakdecay_fast[b] < power)
  ------------------
  |  Branch (682:17): [True: 6.94k, False: 138k]
  ------------------
  683|  6.94k|                ps->peakdecay_fast[b] = power;
  684|       |
  685|   145k|            peakdiff = ps->prev_peakdiff[b];
  686|   145k|            peakdiff += MUL_F((ps->peakdecay_fast[b] - power - ps->prev_peakdiff[b]), smooth_coeff);
  ------------------
  |  |  286|   145k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  687|   145k|            ps->prev_peakdiff[b] = peakdiff;
  688|       |
  689|   145k|            nrg = ps->prev_nrg[b];
  690|   145k|            nrg += MUL_F((power - ps->prev_nrg[b]), smooth_coeff);
  ------------------
  |  |  286|   145k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  691|   145k|            ps->prev_nrg[b] = nrg;
  692|       |
  693|   145k|            if (MUL_R(peakdiff, gamma) <= nrg) {
  ------------------
  |  |  284|   145k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  |  Branch (693:17): [True: 139k, False: 5.94k]
  ------------------
  694|   139k|                transratio = sigma;
  695|   139k|            } else {
  696|  5.94k|                transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma);
  ------------------
  |  |  284|  5.94k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  697|  5.94k|            }
  698|       |
  699|   582k|            for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|   582k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (699:25): [True: 436k, False: 145k]
  ------------------
  700|   436k|            {
  701|   436k|                new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]);
  ------------------
  |  |  286|   436k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  702|   436k|            }
  703|       |
  704|   145k|            RE(tmp0) = RE(ps->d_buff[0][b]);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          RE(tmp0) = RE(ps->d_buff[0][b]);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
  705|   145k|            IM(tmp0) = IM(ps->d_buff[0][b]);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          IM(tmp0) = IM(ps->d_buff[0][b]);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
  706|       |
  707|   145k|            RE(ps->d_buff[0][b]) = RE(ps->d_buff[1][b]);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->d_buff[0][b]) = RE(ps->d_buff[1][b]);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
  708|   145k|            IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
  709|       |
  710|   145k|            RE(ps->d_buff[1][b]) = RE(in);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          RE(ps->d_buff[1][b]) = RE(in);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
  711|   145k|            IM(ps->d_buff[1][b]) = IM(in);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          IM(ps->d_buff[1][b]) = IM(in);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
  712|       |
  713|   145k|            ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
  714|       |
  715|   145k|            RE(R0) = RE(tmp);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
                          RE(R0) = RE(tmp);
  ------------------
  |  |  391|   145k|#define RE(A) (A)[0]
  ------------------
  716|   145k|            IM(R0) = IM(tmp);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
                          IM(R0) = IM(tmp);
  ------------------
  |  |  392|   145k|#define IM(A) (A)[1]
  ------------------
  717|       |
  718|   582k|            for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|   582k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (718:25): [True: 436k, False: 145k]
  ------------------
  719|   436k|            {
  720|   436k|                RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
  721|   436k|                IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
                              IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
  722|       |
  723|   436k|                RE(tmp0) = RE(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              RE(tmp0) = RE(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
  724|   436k|                IM(tmp0) = IM(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
                              IM(tmp0) = IM(ps->d2_buff[k][temp_delay_ser[k]][b]);
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
  725|       |
  726|   436k|                ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
  727|       |
  728|   436k|                RE(tmp) += -MUL_F(new_delay_slopes[k], RE(R0));
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              RE(tmp) += -MUL_F(new_delay_slopes[k], RE(R0));
  ------------------
  |  |  286|   436k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  729|   436k|                IM(tmp) += -MUL_F(new_delay_slopes[k], IM(R0));
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
                              IM(tmp) += -MUL_F(new_delay_slopes[k], IM(R0));
  ------------------
  |  |  286|   436k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  730|       |
  731|   436k|                RE(ps->d2_buff[k][temp_delay_ser[k]][b]) = RE(R0) + MUL_F(new_delay_slopes[k], RE(tmp));
  ------------------
  |  |  391|   436k|#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|   436k|#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|   436k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  732|   436k|                IM(ps->d2_buff[k][temp_delay_ser[k]][b]) = IM(R0) + MUL_F(new_delay_slopes[k], IM(tmp));
  ------------------
  |  |  392|   436k|#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|   436k|#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|   436k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  733|       |
  734|   436k|                RE(R0) = RE(tmp);
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
                              RE(R0) = RE(tmp);
  ------------------
  |  |  391|   436k|#define RE(A) (A)[0]
  ------------------
  735|   436k|                IM(R0) = IM(tmp);
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
                              IM(R0) = IM(tmp);
  ------------------
  |  |  392|   436k|#define IM(A) (A)[1]
  ------------------
  736|   436k|            }
  737|       |
  738|   145k|            QMF_RE(ps->SA[s][b]) = MUL_R(RE(R0), transratio);
  ------------------
  |  |  168|   145k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   145k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(ps->SA[s][b]) = MUL_R(RE(R0), transratio);
  ------------------
  |  |  284|   145k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  739|   145k|            QMF_IM(ps->SA[s][b]) = MUL_R(IM(R0), transratio);
  ------------------
  |  |  169|   145k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   145k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(ps->SA[s][b]) = MUL_R(IM(R0), transratio);
  ------------------
  |  |  284|   145k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  740|       |
  741|   582k|            for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|   582k|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (741:25): [True: 436k, False: 145k]
  ------------------
  742|   436k|            {
  743|   436k|                if (++temp_delay_ser[k] >= delay_length[k])
  ------------------
  |  Branch (743:21): [True: 113k, False: 323k]
  ------------------
  744|   113k|                    temp_delay_ser[k] = 0;
  745|   436k|            }
  746|   145k|        }
  747|  4.85k|    }
  748|       |
  749|    844|    for (k = 0; k < NUM_OF_LINKS; k++)
  ------------------
  |  |   43|    844|#define NUM_OF_LINKS             3
  ------------------
  |  Branch (749:17): [True: 633, False: 211]
  ------------------
  750|    633|        ps->delay_buf_index_ser[k] = temp_delay_ser[k];
  751|    211|}
drm_dec.c:drm_add_ambiance:
  754|    211|{
  755|    211|    uint8_t s, b, ifreq, qclass;
  756|    211|    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|    211|    real_t new_dir_map, new_sa_map;
  758|       |
  759|    211|    if (ps->bs_enable_sa)
  ------------------
  |  Branch (759:9): [True: 75, False: 136]
  ------------------
  760|     75|    {
  761|       |        /* Instead of dequantization and mapping, we use an inverse mapping
  762|       |           to look up all the values we need */
  763|  1.80k|        for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
  ------------------
  |  |   41|  1.80k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (763:21): [True: 1.72k, False: 75]
  ------------------
  764|  1.72k|        {
  765|  1.72k|            const real_t inv_f_num_of_subsamples = FRAC_CONST(0.03333333333);
  ------------------
  |  |  291|  1.72k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
  766|       |
  767|  1.72k|            ifreq = sa_inv_freq[b];
  768|  1.72k|            qclass = (b != 0);
  769|       |
  770|  1.72k|            sa_map[b]  = sa_quant[ps->g_prev_sa_index[ifreq]][qclass];
  771|  1.72k|            new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass];
  772|       |
  773|  1.72k|            k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b]));
  ------------------
  |  |  286|  1.72k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  774|       |
  775|  1.72k|            sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass];
  776|  1.72k|            new_dir_map   = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass];
  777|       |
  778|  1.72k|            k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b]));
  ------------------
  |  |  286|  1.72k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  779|       |
  780|  1.72k|        }
  781|       |
  782|  2.32k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|  2.32k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (782:21): [True: 2.25k, False: 75]
  ------------------
  783|  2.25k|        {
  784|  54.0k|            for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
  ------------------
  |  |   41|  54.0k|#define DRM_NUM_SA_BANDS         8
  ------------------
  |  Branch (784:25): [True: 51.7k, False: 2.25k]
  ------------------
  785|  51.7k|            {
  786|  51.7k|                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|  51.7k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  51.7k|#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|  51.7k|  #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|  51.7k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  787|  51.7k|                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|  51.7k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  51.7k|#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|  51.7k|  #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|  51.7k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  788|  51.7k|                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|  51.7k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  51.7k|#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|  51.7k|  #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|  51.7k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  789|  51.7k|                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|  51.7k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  51.7k|#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|  51.7k|  #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|  51.7k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  790|       |
  791|  51.7k|                sa_map[b]     += k_sa_map[b];
  792|  51.7k|                sa_dir_map[b] += k_sa_dir_map[b];
  793|  51.7k|            }
  794|  94.5k|            for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   41|  2.25k|#define DRM_NUM_SA_BANDS         8
  ------------------
                          for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|  94.5k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (794:55): [True: 92.2k, False: 2.25k]
  ------------------
  795|  92.2k|            {
  796|  92.2k|                QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|  92.2k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  92.2k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|  92.2k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  92.2k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  797|  92.2k|                QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|  92.2k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  92.2k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|  92.2k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  92.2k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  798|  92.2k|            }
  799|  2.25k|        }
  800|     75|    }
  801|    136|    else {
  802|  4.21k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|  4.21k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (802:21): [True: 4.08k, False: 136]
  ------------------
  803|  4.08k|        {
  804|   265k|            for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|   265k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (804:25): [True: 261k, False: 4.08k]
  ------------------
  805|   261k|            {
  806|   261k|                QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   261k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   261k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   261k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   261k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  807|   261k|                QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   261k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   261k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   261k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   261k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  808|   261k|            }
  809|  4.08k|        }
  810|    136|    }
  811|    211|}
drm_dec.c:drm_add_pan:
  814|    156|{
  815|    156|    uint8_t s, b, qclass, ifreq;
  816|    156|    real_t tmp, coeff1, coeff2;
  817|    156|    real_t pan_base[MAX_PAN_BAND];
  818|    156|    real_t pan_delta[MAX_PAN_BAND];
  819|    156|    qmf_t temp_l, temp_r;
  ------------------
  |  |  167|    156|#define qmf_t complex_t
  ------------------
  820|       |
  821|    156|    if (ps->bs_enable_pan)
  ------------------
  |  Branch (821:9): [True: 156, False: 0]
  ------------------
  822|    156|    {
  823|  10.1k|        for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|  10.1k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (823:21): [True: 9.98k, False: 156]
  ------------------
  824|  9.98k|        {
  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.98k|            ifreq = pan_inv_freq[b];
  828|  9.98k|            qclass = pan_quant_class[ifreq];
  829|       |
  830|  9.98k|            if (ps->g_prev_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (830:17): [True: 9.36k, False: 619]
  ------------------
  831|  9.36k|            {
  832|  9.36k|                pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass];
  833|  9.36k|            } else {
  834|    619|                pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass];
  835|    619|            }
  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.98k|            if (ps->g_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (839:17): [True: 8.35k, False: 1.62k]
  ------------------
  840|  8.35k|            {
  841|  8.35k|                if (ps->g_prev_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (841:21): [True: 8.26k, False: 96]
  ------------------
  842|  8.26k|                {
  843|  8.26k|                    pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|  8.26k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  844|  8.26k|                                         pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
  845|  8.26k|                } else {
  846|     96|                    pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|     96|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  847|     96|                                         pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
  848|     96|                }
  849|  8.35k|            } else {
  850|  1.62k|                if (ps->g_prev_pan_index[ifreq] >= 0)
  ------------------
  |  Branch (850:21): [True: 1.10k, False: 523]
  ------------------
  851|  1.10k|                {
  852|  1.10k|                    pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|  1.10k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  853|  1.10k|                                         pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
  854|  1.10k|                } else {
  855|    523|                    pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
  ------------------
  |  |  285|    523|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  856|    523|                                         pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
  857|    523|                }
  858|  1.62k|            }
  859|  9.98k|        }
  860|       |
  861|  4.83k|        for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
  ------------------
  |  |   45|  4.83k|#define NUM_OF_SUBSAMPLES       30
  ------------------
  |  Branch (861:21): [True: 4.68k, False: 156]
  ------------------
  862|  4.68k|        {
  863|       |            /* PAN always uses all 64 channels */
  864|   304k|            for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
  ------------------
  |  |   44|   304k|#define NUM_OF_QMF_CHANNELS     64
  ------------------
  |  Branch (864:25): [True: 299k, False: 4.68k]
  ------------------
  865|   299k|            {
  866|   299k|                tmp = pan_base[b];
  867|       |
  868|   299k|                coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp));
  ------------------
  |  |  161|   299k|#define DIV_R(A, B) ((A)/(B))
  ------------------
  869|   299k|                coeff1 = MUL_R(coeff2, tmp);
  ------------------
  |  |  284|   299k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  870|       |
  871|   299k|                QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   299k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   299k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
  ------------------
  |  |  168|   299k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   299k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  872|   299k|                QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   299k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   299k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
  ------------------
  |  |  169|   299k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   299k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  873|   299k|                QMF_RE(temp_r) = QMF_RE(X_right[s][b]);
  ------------------
  |  |  168|   299k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   299k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(temp_r) = QMF_RE(X_right[s][b]);
  ------------------
  |  |  168|   299k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   299k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  874|   299k|                QMF_IM(temp_r) = QMF_IM(X_right[s][b]);
  ------------------
  |  |  169|   299k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   299k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(temp_r) = QMF_IM(X_right[s][b]);
  ------------------
  |  |  169|   299k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   299k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  875|       |
  876|   299k|                QMF_RE(X_left[s][b]) = MUL_R(QMF_RE(temp_l), coeff1);
  ------------------
  |  |  168|   299k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   299k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_left[s][b]) = MUL_R(QMF_RE(temp_l), coeff1);
  ------------------
  |  |  284|   299k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  877|   299k|                QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
  ------------------
  |  |  169|   299k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   299k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
  ------------------
  |  |  284|   299k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  878|   299k|                QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
  ------------------
  |  |  168|   299k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   299k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
  ------------------
  |  |  284|   299k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  879|   299k|                QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
  ------------------
  |  |  169|   299k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   299k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
  ------------------
  |  |  284|   299k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  880|       |
  881|       |                /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */
  882|       |                /*                   ^^^^^^^^^^^^^^^ k times */
  883|   299k|                pan_base[b] = MUL_C(pan_base[b], pan_delta[b]);
  ------------------
  |  |  285|   299k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  884|   299k|            }
  885|  4.68k|        }
  886|    156|    }
  887|    156|}

filter_bank_init:
   49|  8.36k|{
   50|  8.36k|    uint16_t nshort = frame_len/8;
   51|       |#ifdef LD_DEC
   52|       |    uint16_t frame_len_ld = frame_len/2;
   53|       |#endif
   54|       |
   55|  8.36k|    fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
   56|  8.36k|    memset(fb, 0, sizeof(fb_info));
   57|       |
   58|       |    /* normal */
   59|  8.36k|    fb->mdct256 = faad_mdct_init(2*nshort);
   60|  8.36k|    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|  8.36k|#ifdef ALLOW_SMALL_FRAMELENGTH
   67|  8.36k|    if (frame_len == 1024)
  ------------------
  |  Branch (67:9): [True: 6.21k, False: 2.15k]
  ------------------
   68|  6.21k|    {
   69|  6.21k|#endif
   70|  6.21k|        fb->long_window[0]  = sine_long_1024;
   71|  6.21k|        fb->short_window[0] = sine_short_128;
   72|  6.21k|        fb->long_window[1]  = kbd_long_1024;
   73|  6.21k|        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|  6.21k|#ifdef ALLOW_SMALL_FRAMELENGTH
   79|  6.21k|    } else /* (frame_len == 960) */ {
   80|  2.15k|        fb->long_window[0]  = sine_long_960;
   81|  2.15k|        fb->short_window[0] = sine_short_120;
   82|  2.15k|        fb->long_window[1]  = kbd_long_960;
   83|  2.15k|        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|  2.15k|    }
   89|  8.36k|#endif
   90|       |
   91|  8.36k|    return fb;
   92|  8.36k|}
filter_bank_end:
   95|  8.57k|{
   96|  8.57k|    if (fb != NULL)
  ------------------
  |  Branch (96:9): [True: 8.36k, False: 203]
  ------------------
   97|  8.36k|    {
   98|       |#ifdef PROFILE
   99|       |        printf("FB:                 %I64d cycles\n", fb->cycles);
  100|       |#endif
  101|       |
  102|  8.36k|        faad_mdct_end(fb->mdct256);
  103|  8.36k|        faad_mdct_end(fb->mdct2048);
  104|       |#ifdef LD_DEC
  105|       |        faad_mdct_end(fb->mdct1024);
  106|       |#endif
  107|       |
  108|  8.36k|        faad_free(fb);
  109|  8.36k|    }
  110|  8.57k|}
ifilter_bank:
  168|   144k|{
  169|   144k|    int16_t i;
  170|   144k|    ALIGN real_t transf_buf[2*1024] = {0};
  171|       |
  172|   144k|    const real_t *window_long = NULL;
  173|   144k|    const real_t *window_long_prev = NULL;
  174|   144k|    const real_t *window_short = NULL;
  175|   144k|    const real_t *window_short_prev = NULL;
  176|       |
  177|   144k|    uint16_t nlong = frame_len;
  178|   144k|    uint16_t nshort = frame_len/8;
  179|   144k|    uint16_t trans = nshort/2;
  180|       |
  181|   144k|    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|   144k|        (void)object_type;
  196|   144k|#endif
  197|   144k|        window_long       = fb->long_window[window_shape];
  198|   144k|        window_long_prev  = fb->long_window[window_shape_prev];
  199|   144k|        window_short      = fb->short_window[window_shape];
  200|   144k|        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|   144k|    switch (window_sequence)
  ------------------
  |  Branch (216:13): [True: 144k, False: 0]
  ------------------
  217|   144k|    {
  218|   113k|    case ONLY_LONG_SEQUENCE:
  ------------------
  |  |   96|   113k|#define ONLY_LONG_SEQUENCE   0x0
  ------------------
  |  Branch (218:5): [True: 113k, False: 30.5k]
  ------------------
  219|       |        /* perform iMDCT */
  220|   113k|        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|  28.8M|        for (i = 0; i < nlong; i+=4)
  ------------------
  |  Branch (223:21): [True: 28.7M, False: 113k]
  ------------------
  224|  28.7M|        {
  225|  28.7M|            time_out[i]   = overlap[i]   + MUL_F(transf_buf[i],window_long_prev[i]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  226|  28.7M|            time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  227|  28.7M|            time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  228|  28.7M|            time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  229|  28.7M|        }
  230|       |
  231|       |        /* window the second half and save as overlap for next frame */
  232|  28.8M|        for (i = 0; i < nlong; i+=4)
  ------------------
  |  Branch (232:21): [True: 28.7M, False: 113k]
  ------------------
  233|  28.7M|        {
  234|  28.7M|            overlap[i]   = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  235|  28.7M|            overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  236|  28.7M|            overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  237|  28.7M|            overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]);
  ------------------
  |  |  286|  28.7M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  238|  28.7M|        }
  239|   113k|        break;
  240|       |
  241|  5.78k|    case LONG_START_SEQUENCE:
  ------------------
  |  |   97|  5.78k|#define LONG_START_SEQUENCE  0x1
  ------------------
  |  Branch (241:5): [True: 5.78k, False: 138k]
  ------------------
  242|       |        /* perform iMDCT */
  243|  5.78k|        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.45M|        for (i = 0; i < nlong; i+=4)
  ------------------
  |  Branch (246:21): [True: 1.44M, False: 5.78k]
  ------------------
  247|  1.44M|        {
  248|  1.44M|            time_out[i]   = overlap[i]   + MUL_F(transf_buf[i],window_long_prev[i]);
  ------------------
  |  |  286|  1.44M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  249|  1.44M|            time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
  ------------------
  |  |  286|  1.44M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  250|  1.44M|            time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
  ------------------
  |  |  286|  1.44M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  251|  1.44M|            time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
  ------------------
  |  |  286|  1.44M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  252|  1.44M|        }
  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.53M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (256:21): [True: 2.53M, False: 5.78k]
  ------------------
  257|  2.53M|            overlap[i] = transf_buf[nlong+i];
  258|   729k|        for (i = 0; i < nshort; i++)
  ------------------
  |  Branch (258:21): [True: 723k, False: 5.78k]
  ------------------
  259|   723k|            overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
  ------------------
  |  |  286|   729k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  260|  2.53M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (260:21): [True: 2.53M, False: 5.78k]
  ------------------
  261|  2.53M|            overlap[nflat_ls+nshort+i] = 0;
  262|  5.78k|        break;
  263|       |
  264|  15.9k|    case EIGHT_SHORT_SEQUENCE:
  ------------------
  |  |   98|  15.9k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (264:5): [True: 15.9k, False: 128k]
  ------------------
  265|       |        /* perform iMDCT for each short block */
  266|  15.9k|        faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0);
  267|  15.9k|        faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1);
  268|  15.9k|        faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2);
  269|  15.9k|        faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3);
  270|  15.9k|        faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4);
  271|  15.9k|        faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5);
  272|  15.9k|        faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6);
  273|  15.9k|        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|  7.04M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (276:21): [True: 7.02M, False: 15.9k]
  ------------------
  277|  7.02M|            time_out[i] = overlap[i];
  278|  2.02M|        for(i = 0; i < nshort; i++)
  ------------------
  |  Branch (278:20): [True: 2.00M, False: 15.9k]
  ------------------
  279|  2.00M|        {
  280|  2.00M|            time_out[nflat_ls+         i] = overlap[nflat_ls+         i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]);
  ------------------
  |  |  286|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  281|  2.00M|            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|  2.00M|  #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|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  282|  2.00M|            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|  2.00M|  #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|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  283|  2.00M|            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|  2.00M|  #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|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  284|  2.00M|            if (i < trans)
  ------------------
  |  Branch (284:17): [True: 1.00M, False: 1.00M]
  ------------------
  285|  1.00M|                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|  1.00M|  #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|  1.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  286|  2.00M|        }
  287|       |
  288|       |        /* window the second half and save as overlap for next frame */
  289|  2.02M|        for(i = 0; i < nshort; i++)
  ------------------
  |  Branch (289:20): [True: 2.00M, False: 15.9k]
  ------------------
  290|  2.00M|        {
  291|  2.00M|            if (i >= trans)
  ------------------
  |  Branch (291:17): [True: 1.00M, False: 1.00M]
  ------------------
  292|  1.00M|                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|  1.00M|  #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|  1.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  293|  2.00M|            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|  2.00M|  #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|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  294|  2.00M|            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|  2.00M|  #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|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  295|  2.00M|            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|  2.00M|  #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|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  296|  2.00M|            overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]);
  ------------------
  |  |  286|  2.00M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  297|  2.00M|        }
  298|  7.04M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (298:21): [True: 7.02M, False: 15.9k]
  ------------------
  299|  7.02M|            overlap[nflat_ls+nshort+i] = 0;
  300|  15.9k|        break;
  301|       |
  302|  8.84k|    case LONG_STOP_SEQUENCE:
  ------------------
  |  |   99|  8.84k|#define LONG_STOP_SEQUENCE   0x3
  ------------------
  |  Branch (302:5): [True: 8.84k, False: 135k]
  ------------------
  303|       |        /* perform iMDCT */
  304|  8.84k|        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.93M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (308:21): [True: 3.92M, False: 8.84k]
  ------------------
  309|  3.92M|            time_out[i] = overlap[i];
  310|  1.13M|        for (i = 0; i < nshort; i++)
  ------------------
  |  Branch (310:21): [True: 1.12M, False: 8.84k]
  ------------------
  311|  1.12M|            time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]);
  ------------------
  |  |  286|  1.13M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  312|  3.93M|        for (i = 0; i < nflat_ls; i++)
  ------------------
  |  Branch (312:21): [True: 3.92M, False: 8.84k]
  ------------------
  313|  3.92M|            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.99M|        for (i = 0; i < nlong; i++)
  ------------------
  |  Branch (316:21): [True: 8.98M, False: 8.84k]
  ------------------
  317|  8.98M|            overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
  ------------------
  |  |  286|  8.99M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  318|  8.84k|		break;
  319|   144k|    }
  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|   144k|}
filtbank.c:imdct_long:
  113|   128k|{
  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|   128k|    (void)len;
  132|   128k|    faad_imdct(fb->mdct2048, in_data, out_data);
  133|   128k|#endif
  134|   128k|}

reordered_spectral_data:
  212|  4.38k|{
  213|  4.38k|    uint16_t PCWs_done;
  214|  4.38k|    uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
  215|       |
  216|  4.38k|    codeword_t codeword[512];
  217|  4.38k|    bits_t segment[512];
  218|       |
  219|  4.38k|    uint16_t sp_offset[8];
  220|  4.38k|    uint16_t g, i, sortloop, set, bitsread;
  221|  4.38k|    /*uint16_t bitsleft, codewordsleft*/;
  222|  4.38k|    uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB;
  223|       |
  224|  4.38k|    const uint16_t nshort = hDecoder->frameLength/8;
  225|  4.38k|    const uint16_t sp_data_len = ics->length_of_reordered_spectral_data;
  226|       |
  227|  4.38k|    const uint8_t *PreSortCb;
  228|       |
  229|       |    /* no data (e.g. silence) */
  230|  4.38k|    if (sp_data_len == 0)
  ------------------
  |  Branch (230:9): [True: 3.40k, False: 979]
  ------------------
  231|  3.40k|        return 0;
  232|       |
  233|       |    /* since there is spectral data, at least one codeword has nonzero length */
  234|    979|    if (ics->length_of_longest_codeword == 0)
  ------------------
  |  Branch (234:9): [True: 19, False: 960]
  ------------------
  235|     19|        return 10;
  236|       |
  237|    960|    if (sp_data_len < ics->length_of_longest_codeword)
  ------------------
  |  Branch (237:9): [True: 3, False: 957]
  ------------------
  238|      3|        return 10;
  239|       |
  240|    957|    sp_offset[0] = 0;
  241|  1.25k|    for (g = 1; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (241:17): [True: 297, False: 957]
  ------------------
  242|    297|    {
  243|    297|        sp_offset[g] = sp_offset[g-1] + nshort*ics->window_group_length[g-1];
  244|    297|    }
  245|       |
  246|    957|    PCWs_done = 0;
  247|    957|    numberOfSegments = 0;
  248|    957|    numberOfCodewords = 0;
  249|    957|    bitsread = 0;
  250|       |
  251|       |    /* VCB11 code books in use */
  252|    957|    if (hDecoder->aacSectionDataResilienceFlag)
  ------------------
  |  Branch (252:9): [True: 784, False: 173]
  ------------------
  253|    784|    {
  254|    784|        PreSortCb = PreSortCB_ER;
  255|    784|        last_CB = NUM_CB_ER;
  ------------------
  |  |   57|    784|#define NUM_CB_ER   22
  ------------------
  256|    784|    } else
  257|    173|    {
  258|    173|        PreSortCb = PreSortCB_STD;
  259|    173|        last_CB = NUM_CB;
  ------------------
  |  |   56|    173|#define NUM_CB      6
  ------------------
  260|    173|    }
  261|       |
  262|       |    /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */
  263|  18.5k|    for (sortloop = 0; sortloop < last_CB; sortloop++)
  ------------------
  |  Branch (263:24): [True: 17.6k, False: 923]
  ------------------
  264|  17.6k|    {
  265|       |        /* select codebook to process this pass */
  266|  17.6k|        this_CB = PreSortCb[sortloop];
  267|       |
  268|       |        /* loop over sfbs */
  269|   178k|        for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (269:23): [True: 161k, False: 17.6k]
  ------------------
  270|   161k|        {
  271|       |            /* loop over all in this sfb, 4 lines per loop */
  272|   822k|            for (w_idx = 0; 4*w_idx < (min(ics->swb_offset[sfb+1], ics->swb_offset_max) - ics->swb_offset[sfb]); w_idx++)
  ------------------
  |  |   60|   822k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 813k, False: 9.04k]
  |  |  ------------------
  ------------------
  |  Branch (272:29): [True: 661k, False: 161k]
  ------------------
  273|   661k|            {
  274|  1.36M|                for(g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (274:28): [True: 699k, False: 661k]
  ------------------
  275|   699k|                {
  276|  5.53M|                    for (i = 0; i < ics->num_sec[g]; i++)
  ------------------
  |  Branch (276:33): [True: 4.83M, False: 699k]
  ------------------
  277|  4.83M|                    {
  278|       |                        /* check whether sfb used here is the one we want to process */
  279|  4.83M|                        if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb))
  ------------------
  |  Branch (279:29): [True: 3.32M, False: 1.51M]
  |  Branch (279:63): [True: 699k, False: 2.62M]
  ------------------
  280|   699k|                        {
  281|       |                            /* check whether codebook used here is the one we want to process */
  282|   699k|                            this_sec_CB = ics->sect_cb[g][i];
  283|       |
  284|   699k|                            if (is_good_cb(this_CB, this_sec_CB))
  ------------------
  |  Branch (284:33): [True: 42.9k, False: 656k]
  ------------------
  285|  42.9k|                            {
  286|       |                                /* precalculate some stuff */
  287|  42.9k|                                uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb];
  288|  42.9k|                                uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
  ------------------
  |  |  102|  42.9k|#define FIRST_PAIR_HCB 5
  ------------------
                                              uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
  ------------------
  |  |  104|  17.8k|#define QUAD_LEN       4
  ------------------
                                              uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
  ------------------
  |  |  105|  68.0k|#define PAIR_LEN       2
  ------------------
  |  Branch (288:47): [True: 17.8k, False: 25.0k]
  ------------------
  289|  42.9k|                                uint16_t group_cws_count = (4*ics->window_group_length[g])/inc;
  290|  42.9k|                                uint8_t segwidth = segmentWidth(this_sec_CB);
  ------------------
  |  |   73|  42.9k|#define segmentWidth(cb)    min(maxCwLen[cb], ics->length_of_longest_codeword)
  |  |  ------------------
  |  |  |  |   60|  42.9k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:20): [True: 15.7k, False: 27.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|  42.9k|                                uint16_t cws;
  292|       |
  293|       |                                /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */
  294|   136k|                                for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++)
  ------------------
  |  Branch (294:47): [True: 93.1k, False: 42.9k]
  |  Branch (294:74): [True: 93.1k, False: 0]
  ------------------
  295|  93.1k|                                {
  296|  93.1k|                                    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|  93.1k|                                    if (!PCWs_done)
  ------------------
  |  Branch (299:41): [True: 57.5k, False: 35.6k]
  ------------------
  300|  57.5k|                                    {
  301|       |                                        /* read in normal segments */
  302|  57.5k|                                        if (bitsread + segwidth <= sp_data_len)
  ------------------
  |  Branch (302:45): [True: 56.9k, False: 555]
  ------------------
  303|  56.9k|                                        {
  304|  56.9k|                                            read_segment(&segment[numberOfSegments], segwidth, ld);
  305|  56.9k|                                            bitsread += segwidth;
  306|       |
  307|  56.9k|                                            huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]);
  308|       |
  309|       |                                            /* keep leftover bits */
  310|  56.9k|                                            rewrev_bits(&segment[numberOfSegments]);
  311|       |
  312|  56.9k|                                            numberOfSegments++;
  313|  56.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|    555|                                            if (bitsread < sp_data_len)
  ------------------
  |  Branch (317:49): [True: 464, False: 91]
  ------------------
  318|    464|                                            {
  319|    464|                                                const uint8_t additional_bits = (uint8_t)(sp_data_len - bitsread);
  320|       |
  321|    464|                                                read_segment(&segment[numberOfSegments], additional_bits, ld);
  322|    464|                                                segment[numberOfSegments].len += segment[numberOfSegments-1].len;
  323|    464|                                                if (segment[numberOfSegments].len > 64)
  ------------------
  |  Branch (323:53): [True: 34, False: 430]
  ------------------
  324|     34|                                                    return 10;
  325|    430|                                                rewrev_bits(&segment[numberOfSegments]);
  326|       |
  327|    430|                                                if (segment[numberOfSegments-1].len > 32)
  ------------------
  |  Branch (327:53): [True: 69, False: 361]
  ------------------
  328|     69|                                                {
  329|     69|                                                    segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
  330|     69|                                                        showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32);
  331|     69|                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
  332|     69|                                                        showbits_hcr(&segment[numberOfSegments-1], 32);
  333|    361|                                                } else {
  334|    361|                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
  335|    361|                                                        showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len);
  336|    361|                                                    segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb;
  337|    361|                                                }
  338|    430|                                                segment[numberOfSegments-1].len += additional_bits;
  339|    430|                                            }
  340|    521|                                            bitsread = sp_data_len;
  341|    521|                                            PCWs_done = 1;
  342|       |
  343|    521|                                            fill_in_codeword(codeword, 0, sp, this_sec_CB);
  344|    521|                                        }
  345|  57.5k|                                    } else {
  346|  35.6k|                                        fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB);
  347|  35.6k|                                    }
  348|  93.1k|                                    numberOfCodewords++;
  349|  93.1k|                                }
  350|  42.9k|                            }
  351|   699k|                        }
  352|  4.83M|                    }
  353|   699k|                 }
  354|   661k|             }
  355|   161k|         }
  356|  17.6k|    }
  357|       |
  358|    923|    if (numberOfSegments == 0)
  ------------------
  |  Branch (358:9): [True: 39, False: 884]
  ------------------
  359|     39|        return 10;
  360|       |
  361|    884|    numberOfSets = numberOfCodewords / numberOfSegments;
  362|       |
  363|       |    /* step 2: decode nonPCWs */
  364|  4.33k|    for (set = 1; set <= numberOfSets; set++)
  ------------------
  |  Branch (364:19): [True: 3.45k, False: 884]
  ------------------
  365|  3.45k|    {
  366|  3.45k|        uint16_t trial;
  367|       |
  368|  83.9k|        for (trial = 0; trial < numberOfSegments; trial++)
  ------------------
  |  Branch (368:25): [True: 80.4k, False: 3.45k]
  ------------------
  369|  80.4k|        {
  370|  80.4k|            uint16_t codewordBase;
  371|       |
  372|  3.74M|            for (codewordBase = 0; codewordBase < numberOfSegments; codewordBase++)
  ------------------
  |  Branch (372:36): [True: 3.71M, False: 24.1k]
  ------------------
  373|  3.71M|            {
  374|  3.71M|                const uint16_t segment_idx = (trial + codewordBase) % numberOfSegments;
  375|  3.71M|                const uint16_t codeword_idx = codewordBase + set*numberOfSegments - numberOfSegments;
  376|       |
  377|       |                /* data up */
  378|  3.71M|                if (codeword_idx >= numberOfCodewords - numberOfSegments) break;
  ------------------
  |  Branch (378:21): [True: 56.2k, False: 3.66M]
  ------------------
  379|       |
  380|  3.66M|                if (!codeword[codeword_idx].decoded && segment[segment_idx].len > 0)
  ------------------
  |  Branch (380:21): [True: 625k, False: 3.03M]
  |  Branch (380:56): [True: 37.4k, False: 588k]
  ------------------
  381|  37.4k|                {
  382|  37.4k|                    uint8_t tmplen = segment[segment_idx].len + codeword[codeword_idx].bits.len;
  383|       |
  384|  37.4k|                    if (tmplen > 64)
  ------------------
  |  Branch (384:25): [True: 280, False: 37.1k]
  ------------------
  385|    280|                    {
  386|       |                      // Drop bits that do not fit concatenation result.
  387|    280|                      flushbits_hcr(&codeword[codeword_idx].bits, tmplen - 64);
  388|    280|                    }
  389|       |
  390|  37.4k|                    if (codeword[codeword_idx].bits.len != 0)
  ------------------
  |  Branch (390:25): [True: 7.47k, False: 29.9k]
  ------------------
  391|  7.47k|                        concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits);
  392|       |
  393|  37.4k|                    tmplen = segment[segment_idx].len;
  394|       |
  395|  37.4k|                    if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx],
  ------------------
  |  Branch (395:25): [True: 29.4k, False: 7.98k]
  ------------------
  396|  37.4k|                                               &spectral_data[codeword[codeword_idx].sp_offset]) >= 0)
  397|  29.4k|                    {
  398|  29.4k|                        codeword[codeword_idx].decoded = 1;
  399|  29.4k|                    } else
  400|  7.98k|                    {
  401|  7.98k|                        codeword[codeword_idx].bits = segment[segment_idx];
  402|  7.98k|                        codeword[codeword_idx].bits.len = tmplen;
  403|  7.98k|                    }
  404|       |
  405|  37.4k|                }
  406|  3.66M|            }
  407|  80.4k|        }
  408|  83.9k|        for (i = 0; i < numberOfSegments; i++)
  ------------------
  |  Branch (408:21): [True: 80.4k, False: 3.45k]
  ------------------
  409|  80.4k|            rewrev_bits(&segment[i]);
  410|  3.45k|    }
  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|    884|    return 0;
  431|       |
  432|    923|}
hcr.c:is_good_cb:
  170|   699k|{
  171|       |    /* only want spectral data CB's */
  172|   699k|    if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
  ------------------
  |  |  101|  1.39M|#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|   677k|#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|   334k|#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|   124k|#define VCB11_LAST  31
  ------------------
  |  Branch (172:10): [True: 677k, False: 22.0k]
  |  Branch (172:36): [True: 532k, False: 145k]
  |  Branch (172:64): [True: 124k, False: 42.6k]
  |  Branch (172:94): [True: 124k, False: 0]
  ------------------
  173|   656k|    {
  174|   656k|        if (this_CB < ESC_HCB)
  ------------------
  |  |  103|   656k|#define ESC_HCB        11
  ------------------
  |  Branch (174:13): [True: 213k, False: 443k]
  ------------------
  175|   213k|        {
  176|       |            /* normal codebook pairs */
  177|   213k|            return ((this_sec_CB == this_CB) || (this_sec_CB == this_CB + 1));
  ------------------
  |  Branch (177:21): [True: 10.1k, False: 203k]
  |  Branch (177:49): [True: 19.9k, False: 183k]
  ------------------
  178|   213k|        } else
  179|   443k|        {
  180|       |            /* escape codebook */
  181|   443k|            return (this_sec_CB == this_CB);
  182|   443k|        }
  183|   656k|    }
  184|  42.6k|    return 0;
  185|   699k|}
hcr.c:read_segment:
  188|  57.4k|{
  189|  57.4k|    segment->len = segwidth;
  190|       |
  191|  57.4k|     if (segwidth > 32)
  ------------------
  |  Branch (191:10): [True: 8.83k, False: 48.6k]
  ------------------
  192|  8.83k|     {
  193|  8.83k|        segment->bufb = faad_getbits(ld, segwidth - 32);
  194|  8.83k|        segment->bufa = faad_getbits(ld, 32);
  195|       |
  196|  48.6k|    } else {
  197|  48.6k|        segment->bufb = 0;
  198|  48.6k|        segment->bufa = faad_getbits(ld, segwidth);
  199|  48.6k|    }
  200|  57.4k|}
hcr.c:rewrev_bits:
   99|   137k|{
  100|   137k|    if (bits->len == 0) return;
  ------------------
  |  Branch (100:9): [True: 50.0k, False: 87.8k]
  ------------------
  101|  87.8k|    if (bits->len <= 32) {
  ------------------
  |  Branch (101:9): [True: 72.5k, False: 15.3k]
  ------------------
  102|  72.5k|        bits->bufb = 0;
  103|  72.5k|        bits->bufa = reverse_word(bits->bufa) >> (32 - bits->len);
  104|  72.5k|    } else {
  105|       |        /* last 32<>32 bit swap via rename */
  106|  15.3k|        uint32_t lo = reverse_word(bits->bufb);
  107|  15.3k|        uint32_t hi = reverse_word(bits->bufa);
  108|       |
  109|  15.3k|        if (bits->len == 64) {
  ------------------
  |  Branch (109:13): [True: 31, False: 15.2k]
  ------------------
  110|     31|            bits->bufb = hi;
  111|     31|            bits->bufa = lo;
  112|  15.2k|        } else {
  113|       |            /* shift off low bits (this is really only one 64 bit shift) */
  114|  15.2k|            bits->bufb = hi >> (64 - bits->len);
  115|  15.2k|            bits->bufa = (lo >> (64 - bits->len)) | (hi << (bits->len - 32));
  116|  15.2k|        }
  117|  15.3k|    }
  118|  87.8k|}
hcr.c:reverse_word:
   88|   103k|{
   89|   103k|    v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
   90|   103k|    v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
   91|   103k|    v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
   92|   103k|    v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
   93|   103k|    v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
   94|   103k|    return v;
   95|   103k|}
hcr.c:fill_in_codeword:
  203|  36.1k|{
  204|  36.1k|    codeword[index].sp_offset = sp;
  205|  36.1k|    codeword[index].cb = cb;
  206|  36.1k|    codeword[index].decoded = 0;
  207|  36.1k|    codeword[index].bits.len = 0;
  208|  36.1k|}
hcr.c:concat_bits:
  124|  7.47k|{
  125|  7.47k|    uint32_t bl, bh, al, ah;
  126|       |
  127|       |    /* empty addend */
  128|  7.47k|    if (a->len == 0) return;
  ------------------
  |  Branch (128:9): [True: 0, False: 7.47k]
  ------------------
  129|       |
  130|       |    /* addend becomes result */
  131|  7.47k|    if (b->len == 0)
  ------------------
  |  Branch (131:9): [True: 0, False: 7.47k]
  ------------------
  132|      0|    {
  133|      0|        *b = *a;
  134|      0|        return;
  135|      0|    }
  136|       |
  137|  7.47k|    al = a->bufa;
  138|  7.47k|    ah = a->bufb;
  139|       |
  140|  7.47k|    if (b->len > 32)
  ------------------
  |  Branch (140:9): [True: 422, False: 7.05k]
  ------------------
  141|    422|    {
  142|       |        /* (b->len - 32) is 1..31 */
  143|       |        /* maskoff superfluous high b bits */
  144|    422|        bl = b->bufa;
  145|    422|        bh = b->bufb & ((1u << (b->len-32)) - 1);
  146|       |        /* left shift a b->len bits */
  147|    422|        ah = al << (b->len - 32);
  148|    422|        al = 0;
  149|  7.05k|    } else if (b->len == 32) {
  ------------------
  |  Branch (149:16): [True: 98, False: 6.95k]
  ------------------
  150|     98|        bl = b->bufa;
  151|     98|        bh = 0;
  152|     98|        ah = al;
  153|     98|        al = 0;
  154|  6.95k|    } else {
  155|       |        /* b->len is 1..31, (32 - b->len) is 1..31 */
  156|  6.95k|        bl = b->bufa & ((1u << (b->len)) - 1);
  157|  6.95k|        bh = 0;
  158|  6.95k|        ah = (ah << (b->len)) | (al >> (32 - b->len));
  159|  6.95k|        al = al << b->len;
  160|  6.95k|    }
  161|       |
  162|       |    /* merge */
  163|  7.47k|    b->bufa = bl | al;
  164|  7.47k|    b->bufb = bh | ah;
  165|       |
  166|  7.47k|    b->len += a->len;
  167|  7.47k|}

huffman_scale_factor:
   61|  40.1k|{
   62|  40.1k|    uint16_t offset = 0;
   63|       |
   64|   113k|    while (hcb_sf[offset][1])
  ------------------
  |  Branch (64:12): [True: 73.4k, False: 40.1k]
  ------------------
   65|  73.4k|    {
   66|  73.4k|        uint8_t b = faad_get1bit(ld
   67|  73.4k|            DEBUGVAR(1,255,"huffman_scale_factor()"));
   68|  73.4k|        offset += hcb_sf[offset][b];
   69|  73.4k|    }
   70|       |
   71|  40.1k|    return hcb_sf[offset][0];
   72|  40.1k|}
huffman_spectral_data:
  338|   229k|{
  339|   229k|    switch (cb)
  340|   229k|    {
  341|  2.39k|    case 1: /* 2-step method for data quadruples */
  ------------------
  |  Branch (341:5): [True: 2.39k, False: 226k]
  ------------------
  342|  9.74k|    case 2:
  ------------------
  |  Branch (342:5): [True: 7.34k, False: 221k]
  ------------------
  343|  9.74k|        return huffman_2step_quad(cb, ld, sp);
  344|  4.01k|    case 3: /* binary search for data quadruples */
  ------------------
  |  Branch (344:5): [True: 4.01k, False: 225k]
  ------------------
  345|  4.01k|        return huffman_binary_quad_sign(cb, ld, sp);
  346|  17.7k|    case 4: /* 2-step method for data quadruples */
  ------------------
  |  Branch (346:5): [True: 17.7k, False: 211k]
  ------------------
  347|  17.7k|        return huffman_2step_quad_sign(cb, ld, sp);
  348|  9.39k|    case 5: /* binary search for data pairs */
  ------------------
  |  Branch (348:5): [True: 9.39k, False: 219k]
  ------------------
  349|  9.39k|        return huffman_binary_pair(cb, ld, sp);
  350|  23.3k|    case 6: /* 2-step method for data pairs */
  ------------------
  |  Branch (350:5): [True: 23.3k, False: 205k]
  ------------------
  351|  23.3k|        return huffman_2step_pair(cb, ld, sp);
  352|  12.5k|    case 7: /* binary search for data pairs */
  ------------------
  |  Branch (352:5): [True: 12.5k, False: 216k]
  ------------------
  353|  30.4k|    case 9:
  ------------------
  |  Branch (353:5): [True: 17.9k, False: 211k]
  ------------------
  354|  30.4k|        return huffman_binary_pair_sign(cb, ld, sp);
  355|  65.5k|    case 8: /* 2-step method for data pairs */
  ------------------
  |  Branch (355:5): [True: 65.5k, False: 163k]
  ------------------
  356|  79.1k|    case 10:
  ------------------
  |  Branch (356:5): [True: 13.6k, False: 215k]
  ------------------
  357|  79.1k|        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|  32.6k|    case 11:
  ------------------
  |  Branch (365:5): [True: 32.6k, False: 196k]
  ------------------
  366|  32.6k|    {
  367|  32.6k|        uint8_t err = huffman_2step_pair_sign(11, ld, sp);
  368|  32.6k|        if (!err)
  ------------------
  |  Branch (368:13): [True: 32.6k, False: 0]
  ------------------
  369|  32.6k|            err = huffman_getescape(ld, &sp[0]);
  370|  32.6k|        if (!err)
  ------------------
  |  Branch (370:13): [True: 32.6k, False: 6]
  ------------------
  371|  32.6k|            err = huffman_getescape(ld, &sp[1]);
  372|  32.6k|        return err;
  373|  65.5k|    }
  374|      0|#ifdef ERROR_RESILIENCE
  375|       |    /* VCB11 uses codebook 11 */
  376|  8.38k|    case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
  ------------------
  |  Branch (376:5): [True: 3.25k, False: 225k]
  |  Branch (376:14): [True: 1.22k, False: 227k]
  |  Branch (376:23): [True: 575, False: 228k]
  |  Branch (376:32): [True: 321, False: 228k]
  |  Branch (376:41): [True: 472, False: 228k]
  |  Branch (376:50): [True: 490, False: 228k]
  |  Branch (376:59): [True: 766, False: 228k]
  |  Branch (376:68): [True: 1.28k, False: 227k]
  ------------------
  377|  22.5k|    case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
  ------------------
  |  Branch (377:5): [True: 896, False: 228k]
  |  Branch (377:14): [True: 792, False: 228k]
  |  Branch (377:23): [True: 706, False: 228k]
  |  Branch (377:32): [True: 512, False: 228k]
  |  Branch (377:41): [True: 2.81k, False: 226k]
  |  Branch (377:50): [True: 1.17k, False: 227k]
  |  Branch (377:59): [True: 1.08k, False: 228k]
  |  Branch (377:68): [True: 6.18k, False: 222k]
  ------------------
  378|  22.5k|    {
  379|  22.5k|        uint8_t err = huffman_2step_pair_sign(11, ld, sp);
  380|  22.5k|        if (!err)
  ------------------
  |  Branch (380:13): [True: 22.5k, False: 0]
  ------------------
  381|  22.5k|            err = huffman_getescape(ld, &sp[0]);
  382|  22.5k|        if (!err)
  ------------------
  |  Branch (382:13): [True: 22.5k, False: 13]
  ------------------
  383|  22.5k|            err = huffman_getescape(ld, &sp[1]);
  384|       |
  385|       |        /* check LAV (Largest Absolute Value) */
  386|       |        /* this finds errors in the ESCAPE signal */
  387|  22.5k|        vcb11_check_LAV(cb, sp);
  388|       |
  389|  22.5k|        return err;
  390|  16.3k|    }
  391|      0|#endif
  392|      0|    default:
  ------------------
  |  Branch (392:5): [True: 0, False: 229k]
  ------------------
  393|       |        /* Non existent codebook number, something went wrong */
  394|      0|        return 11;
  395|   229k|    }
  396|       |
  397|       |    /* return 0; */
  398|   229k|}
huffman_spectral_data_2:
  409|  94.3k|{
  410|  94.3k|    uint32_t cw;
  411|  94.3k|    uint16_t offset = 0;
  412|  94.3k|    uint8_t extra_bits;
  413|  94.3k|    uint8_t vcb11 = 0;
  414|       |
  415|       |
  416|  94.3k|    switch (cb)
  ------------------
  |  Branch (416:13): [True: 94.3k, False: 0]
  ------------------
  417|  94.3k|    {
  418|  1.42k|    case 1: /* 2-step method for data quadruples */
  ------------------
  |  Branch (418:5): [True: 1.42k, False: 92.9k]
  ------------------
  419|  15.0k|    case 2:
  ------------------
  |  Branch (419:5): [True: 13.6k, False: 80.7k]
  ------------------
  420|  19.7k|    case 4: {
  ------------------
  |  Branch (420:5): [True: 4.68k, False: 89.7k]
  ------------------
  421|  19.7k|        const hcb* root;
  422|  19.7k|        uint8_t root_bits;
  423|  19.7k|        const hcb_2_quad* table;
  424|  19.7k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  425|  19.7k|        if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (425:13): [True: 0, False: 19.7k]
  ------------------
  426|  19.7k|        if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (426:13): [True: 0, False: 19.7k]
  ------------------
  427|  19.7k|        if (hcb_2_quad_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (427:13): [True: 0, False: 19.7k]
  ------------------
  428|       |        // In other words, `cb` is one of [1, 2, 4].
  429|  19.7k|#endif
  430|  19.7k|        root = hcb_table[cb];
  431|  19.7k|        root_bits = hcbN[cb];
  432|  19.7k|        table = hcb_2_quad_table[cb];
  433|       |
  434|  19.7k|        cw = showbits_hcr(ld, root_bits);
  435|  19.7k|        offset = root[cw].offset;
  436|  19.7k|        extra_bits = root[cw].extra_bits;
  437|       |
  438|  19.7k|        if (extra_bits)
  ------------------
  |  Branch (438:13): [True: 4.21k, False: 15.5k]
  ------------------
  439|  4.21k|        {
  440|       |            /* We know for sure it's more than root_bits bits long. */
  441|  4.21k|            if (flushbits_hcr(ld, root_bits)) return -1;
  ------------------
  |  Branch (441:17): [True: 972, False: 3.24k]
  ------------------
  442|  3.24k|            offset += (uint16_t)showbits_hcr(ld, extra_bits);
  443|  3.24k|            if (flushbits_hcr(ld, table[offset].bits - root_bits)) return -1;
  ------------------
  |  Branch (443:17): [True: 1.27k, False: 1.96k]
  ------------------
  444|  15.5k|        } else {
  445|  15.5k|            if (flushbits_hcr(ld, table[offset].bits)) return -1;
  ------------------
  |  Branch (445:17): [True: 1.22k, False: 14.2k]
  ------------------
  446|  15.5k|        }
  447|       |
  448|  16.2k|        sp[0] = table[offset].x;
  449|  16.2k|        sp[1] = table[offset].y;
  450|  16.2k|        sp[2] = table[offset].v;
  451|  16.2k|        sp[3] = table[offset].w;
  452|  16.2k|        break;
  453|  19.7k|    }
  454|  3.27k|    case 6: /* 2-step method for data pairs */
  ------------------
  |  Branch (454:5): [True: 3.27k, False: 91.1k]
  ------------------
  455|  4.36k|    case 8:
  ------------------
  |  Branch (455:5): [True: 1.09k, False: 93.3k]
  ------------------
  456|  12.7k|    case 10:
  ------------------
  |  Branch (456:5): [True: 8.34k, False: 86.0k]
  ------------------
  457|  28.5k|    case 11:
  ------------------
  |  Branch (457:5): [True: 15.8k, False: 78.5k]
  ------------------
  458|       |    /* VCB11 uses codebook 11 */
  459|  44.1k|    case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
  ------------------
  |  Branch (459:5): [True: 5.39k, False: 88.9k]
  |  Branch (459:14): [True: 954, False: 93.4k]
  |  Branch (459:23): [True: 3.64k, False: 90.7k]
  |  Branch (459:32): [True: 478, False: 93.9k]
  |  Branch (459:41): [True: 1.51k, False: 92.8k]
  |  Branch (459:50): [True: 1.22k, False: 93.1k]
  |  Branch (459:59): [True: 1.50k, False: 92.8k]
  |  Branch (459:68): [True: 879, False: 93.5k]
  ------------------
  460|  59.3k|    case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: {
  ------------------
  |  Branch (460:5): [True: 1.90k, False: 92.4k]
  |  Branch (460:14): [True: 1.11k, False: 93.2k]
  |  Branch (460:23): [True: 1.74k, False: 92.6k]
  |  Branch (460:32): [True: 681, False: 93.7k]
  |  Branch (460:41): [True: 1.49k, False: 92.8k]
  |  Branch (460:50): [True: 1.60k, False: 92.7k]
  |  Branch (460:59): [True: 1.17k, False: 93.2k]
  |  Branch (460:68): [True: 5.47k, False: 88.9k]
  ------------------
  461|  59.3k|        const hcb* root;
  462|  59.3k|        uint8_t root_bits;
  463|  59.3k|        const hcb_2_pair* table;
  464|       |
  465|  59.3k|        if (cb >= 16)
  ------------------
  |  Branch (465:13): [True: 30.7k, False: 28.5k]
  ------------------
  466|  30.7k|        {
  467|       |            /* store the virtual codebook */
  468|  30.7k|            vcb11 = cb;
  469|  30.7k|            cb = 11;
  470|  30.7k|        }
  471|  59.3k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  472|  59.3k|        if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (472:13): [True: 0, False: 59.3k]
  ------------------
  473|  59.3k|        if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (473:13): [True: 0, False: 59.3k]
  ------------------
  474|  59.3k|        if (hcb_2_pair_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (474:13): [True: 0, False: 59.3k]
  ------------------
  475|       |        // In other words, `cb` is one of [6, 8, 10, 11].
  476|  59.3k|#endif
  477|  59.3k|        root = hcb_table[cb];
  478|  59.3k|        root_bits = hcbN[cb];
  479|  59.3k|        table = hcb_2_pair_table[cb];
  480|       |
  481|  59.3k|        cw = showbits_hcr(ld, root_bits);
  482|  59.3k|        offset = root[cw].offset;
  483|  59.3k|        extra_bits = root[cw].extra_bits;
  484|       |
  485|  59.3k|        if (extra_bits)
  ------------------
  |  Branch (485:13): [True: 7.58k, False: 51.7k]
  ------------------
  486|  7.58k|        {
  487|       |            /* we know for sure it's more than hcbN[cb] bits long */
  488|  7.58k|            if (flushbits_hcr(ld, root_bits)) return -1;
  ------------------
  |  Branch (488:17): [True: 829, False: 6.76k]
  ------------------
  489|  6.76k|            offset += (uint16_t)showbits_hcr(ld, extra_bits);
  490|  6.76k|            if (flushbits_hcr(ld, table[offset].bits - root_bits)) return -1;
  ------------------
  |  Branch (490:17): [True: 1.36k, False: 5.39k]
  ------------------
  491|  51.7k|        } else {
  492|  51.7k|            if ( flushbits_hcr(ld, table[offset].bits)) return -1;
  ------------------
  |  Branch (492:18): [True: 4.28k, False: 47.4k]
  ------------------
  493|  51.7k|        }
  494|  52.8k|        sp[0] = table[offset].x;
  495|  52.8k|        sp[1] = table[offset].y;
  496|  52.8k|        break;
  497|  59.3k|    }
  498|  1.79k|    case 3: { /* binary search for data quadruples */
  ------------------
  |  Branch (498:5): [True: 1.79k, False: 92.5k]
  ------------------
  499|  1.79k|        const hcb_bin_quad* table = hcb3;
  500|  3.71k|        while (!table[offset].is_leaf)
  ------------------
  |  Branch (500:16): [True: 2.13k, False: 1.58k]
  ------------------
  501|  2.13k|        {
  502|  2.13k|            uint8_t b;
  503|  2.13k|            if (get1bit_hcr(ld, &b)) return -1;
  ------------------
  |  Branch (503:17): [True: 213, False: 1.92k]
  ------------------
  504|  1.92k|            offset += table[offset].data[b];
  505|  1.92k|        }
  506|       |
  507|  1.58k|        sp[0] = table[offset].data[0];
  508|  1.58k|        sp[1] = table[offset].data[1];
  509|  1.58k|        sp[2] = table[offset].data[2];
  510|  1.58k|        sp[3] = table[offset].data[3];
  511|       |
  512|  1.58k|        break;
  513|  1.79k|    }
  514|       |
  515|  7.19k|    case 5: /* binary search for data pairs */
  ------------------
  |  Branch (515:5): [True: 7.19k, False: 87.1k]
  ------------------
  516|  9.14k|    case 7:
  ------------------
  |  Branch (516:5): [True: 1.94k, False: 92.4k]
  ------------------
  517|  13.5k|    case 9: {
  ------------------
  |  Branch (517:5): [True: 4.40k, False: 89.9k]
  ------------------
  518|  13.5k|        const hcb_bin_pair* table = hcb_bin_table[cb];
  519|  35.4k|        while (!table[offset].is_leaf)
  ------------------
  |  Branch (519:16): [True: 22.6k, False: 12.8k]
  ------------------
  520|  22.6k|        {
  521|  22.6k|            uint8_t b;
  522|       |
  523|  22.6k|            if (get1bit_hcr(ld, &b) ) return -1;
  ------------------
  |  Branch (523:17): [True: 738, False: 21.9k]
  ------------------
  524|  21.9k|            offset += table[offset].data[b];
  525|  21.9k|        }
  526|       |
  527|  12.8k|        sp[0] = table[offset].data[0];
  528|  12.8k|        sp[1] = table[offset].data[1];
  529|       |
  530|  12.8k|        break;
  531|  13.5k|    }}
  532|       |
  533|       |	/* decode sign bits */
  534|  83.4k|    if (unsigned_cb[cb])
  ------------------
  |  Branch (534:9): [True: 61.6k, False: 21.8k]
  ------------------
  535|  61.6k|    {
  536|  61.6k|        uint8_t i;
  537|   182k|        for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
  ------------------
  |  |   73|   182k|#define FIRST_PAIR_HCB 5
  ------------------
                      for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
  ------------------
  |  |   75|  19.4k|#define QUAD_LEN       4
  ------------------
                      for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
  ------------------
  |  |   76|   163k|#define PAIR_LEN       2
  ------------------
  |  Branch (537:20): [True: 126k, False: 56.1k]
  |  Branch (537:25): [True: 19.4k, False: 163k]
  ------------------
  538|   126k|        {
  539|   126k|            if(sp[i])
  ------------------
  |  Branch (539:16): [True: 45.2k, False: 81.3k]
  ------------------
  540|  45.2k|            {
  541|  45.2k|            	uint8_t b;
  542|  45.2k|                if ( get1bit_hcr(ld, &b) ) return -1;
  ------------------
  |  Branch (542:22): [True: 5.53k, False: 39.7k]
  ------------------
  543|  39.7k|                if (b != 0) {
  ------------------
  |  Branch (543:21): [True: 7.29k, False: 32.4k]
  ------------------
  544|  7.29k|                    sp[i] = -sp[i];
  545|  7.29k|                }
  546|  39.7k|           }
  547|   126k|        }
  548|  61.6k|    }
  549|       |
  550|       |    /* decode huffman escape bits */
  551|  77.9k|    if ((cb == ESC_HCB) || (cb >= 16))
  ------------------
  |  |   74|  77.9k|#define ESC_HCB        11
  ------------------
  |  Branch (551:9): [True: 39.9k, False: 38.0k]
  |  Branch (551:28): [True: 0, False: 38.0k]
  ------------------
  552|  39.9k|    {
  553|  39.9k|        uint8_t k;
  554|   114k|        for (k = 0; k < 2; k++)
  ------------------
  |  Branch (554:21): [True: 78.1k, False: 36.7k]
  ------------------
  555|  78.1k|        {
  556|  78.1k|            if ((sp[k] == 16) || (sp[k] == -16))
  ------------------
  |  Branch (556:17): [True: 5.11k, False: 73.0k]
  |  Branch (556:34): [True: 1.50k, False: 71.5k]
  ------------------
  557|  6.61k|            {
  558|  6.61k|                uint8_t neg, i;
  559|  6.61k|                int32_t j;
  560|  6.61k|                uint32_t off;
  561|       |
  562|  6.61k|                neg = (sp[k] < 0) ? 1 : 0;
  ------------------
  |  Branch (562:23): [True: 1.50k, False: 5.11k]
  ------------------
  563|       |
  564|  16.1k|                for (i = 4; ; i++)
  565|  22.7k|                {
  566|  22.7k|                    uint8_t b;
  567|  22.7k|                    if (get1bit_hcr(ld, &b))
  ------------------
  |  Branch (567:25): [True: 1.35k, False: 21.3k]
  ------------------
  568|  1.35k|                        return -1;
  569|  21.3k|                    if (b == 0)
  ------------------
  |  Branch (569:25): [True: 5.26k, False: 16.1k]
  ------------------
  570|  5.26k|                        break;
  571|  21.3k|                }
  572|       |
  573|  5.26k|                if (i > 32)
  ------------------
  |  Branch (573:21): [True: 99, False: 5.16k]
  ------------------
  574|     99|                    return -1;
  575|       |
  576|  5.16k|                if (getbits_hcr(ld, i, &off))
  ------------------
  |  Branch (576:21): [True: 1.73k, False: 3.43k]
  ------------------
  577|  1.73k|                    return -1;
  578|  3.43k|                j = off + (1<<i);
  579|  3.43k|                sp[k] = (int16_t)((neg) ? -j : j);
  ------------------
  |  Branch (579:35): [True: 749, False: 2.68k]
  ------------------
  580|  3.43k|            }
  581|  78.1k|        }
  582|       |
  583|  36.7k|        if (vcb11 != 0)
  ------------------
  |  Branch (583:13): [True: 22.5k, False: 14.1k]
  ------------------
  584|  22.5k|        {
  585|       |            /* check LAV (Largest Absolute Value) */
  586|       |            /* this finds errors in the ESCAPE signal */
  587|  22.5k|            vcb11_check_LAV(vcb11, sp);
  588|  22.5k|        }
  589|  36.7k|    }
  590|  74.7k|    return ld->len;
  591|  77.9k|}
huffman.c:huffman_2step_quad:
  151|  27.5k|{
  152|  27.5k|    uint32_t cw;
  153|  27.5k|    uint16_t offset;
  154|  27.5k|    uint8_t extra_bits;
  155|  27.5k|    const hcb* root;
  156|  27.5k|    uint8_t root_bits;
  157|  27.5k|    const hcb_2_quad* table;
  158|  27.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  159|  27.5k|    if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (159:9): [True: 0, False: 27.5k]
  ------------------
  160|  27.5k|    if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (160:9): [True: 0, False: 27.5k]
  ------------------
  161|  27.5k|    if (hcb_2_quad_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (161:9): [True: 0, False: 27.5k]
  ------------------
  162|       |    // In other words, `cb` is one of [1, 2, 4].
  163|  27.5k|#endif
  164|  27.5k|    root = hcb_table[cb];
  165|  27.5k|    root_bits = hcbN[cb];
  166|  27.5k|    table = hcb_2_quad_table[cb];
  167|       |
  168|  27.5k|    cw = faad_showbits(ld, root_bits);
  169|  27.5k|    offset = root[cw].offset;
  170|  27.5k|    extra_bits = root[cw].extra_bits;
  171|       |
  172|  27.5k|    if (extra_bits)
  ------------------
  |  Branch (172:9): [True: 4.24k, False: 23.2k]
  ------------------
  173|  4.24k|    {
  174|       |        /* We know for sure it's more than `root_bits` bits long. */
  175|  4.24k|        faad_flushbits(ld, root_bits);
  176|  4.24k|        offset += (uint16_t)faad_showbits(ld, extra_bits);
  177|  4.24k|        faad_flushbits(ld, table[offset].bits - root_bits);
  178|  23.2k|    } else {
  179|  23.2k|        faad_flushbits(ld, table[offset].bits);
  180|  23.2k|    }
  181|       |
  182|  27.5k|    sp[0] = table[offset].x;
  183|  27.5k|    sp[1] = table[offset].y;
  184|  27.5k|    sp[2] = table[offset].v;
  185|  27.5k|    sp[3] = table[offset].w;
  186|       |
  187|  27.5k|    return 0;
  188|  27.5k|}
huffman.c:huffman_binary_quad_sign:
  269|  4.01k|{
  270|  4.01k|    uint8_t err = huffman_binary_quad(cb, ld, sp);
  271|  4.01k|    huffman_sign_bits(ld, sp, QUAD_LEN);
  ------------------
  |  |   75|  4.01k|#define QUAD_LEN       4
  ------------------
  272|       |
  273|  4.01k|    return err;
  274|  4.01k|}
huffman.c:huffman_binary_quad:
  245|  4.01k|{
  246|  4.01k|    uint16_t offset = 0;
  247|  4.01k|    const hcb_bin_quad* table = hcb3;
  248|       |
  249|  4.01k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  250|  4.01k|    if (cb != 3) __builtin_trap();
  ------------------
  |  Branch (250:9): [True: 0, False: 4.01k]
  ------------------
  251|  4.01k|#endif
  252|       |
  253|  14.5k|    while (!table[offset].is_leaf)
  ------------------
  |  Branch (253:12): [True: 10.5k, False: 4.01k]
  ------------------
  254|  10.5k|    {
  255|  10.5k|        uint8_t b = faad_get1bit(ld
  256|  10.5k|            DEBUGVAR(1,255,"huffman_spectral_data():3"));
  257|  10.5k|        offset += table[offset].data[b];
  258|  10.5k|    }
  259|       |
  260|  4.01k|    sp[0] = table[offset].data[0];
  261|  4.01k|    sp[1] = table[offset].data[1];
  262|  4.01k|    sp[2] = table[offset].data[2];
  263|  4.01k|    sp[3] = table[offset].data[3];
  264|       |
  265|  4.01k|    return 0;
  266|  4.01k|}
huffman.c:huffman_sign_bits:
   94|   186k|{
   95|   186k|    uint8_t i;
   96|       |
   97|   603k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (97:17): [True: 416k, False: 186k]
  ------------------
   98|   416k|    {
   99|   416k|        if(sp[i])
  ------------------
  |  Branch (99:12): [True: 249k, False: 167k]
  ------------------
  100|   249k|        {
  101|   249k|            if(faad_get1bit(ld
  ------------------
  |  Branch (101:16): [True: 55.1k, False: 194k]
  ------------------
  102|   249k|                DEBUGVAR(1,5,"huffman_sign_bits(): sign bit")) & 1)
  103|  55.1k|            {
  104|  55.1k|                sp[i] = -sp[i];
  105|  55.1k|            }
  106|   249k|        }
  107|   416k|    }
  108|   186k|}
huffman.c:huffman_2step_quad_sign:
  191|  17.7k|{
  192|  17.7k|    uint8_t err = huffman_2step_quad(cb, ld, sp);
  193|  17.7k|    huffman_sign_bits(ld, sp, QUAD_LEN);
  ------------------
  |  |   75|  17.7k|#define QUAD_LEN       4
  ------------------
  194|       |
  195|  17.7k|    return err;
  196|  17.7k|}
huffman.c:huffman_binary_pair:
  277|  39.8k|{
  278|  39.8k|    uint16_t offset = 0;
  279|  39.8k|    const hcb_bin_pair* table;
  280|  39.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  281|  39.8k|    if (hcb_bin_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (281:9): [True: 0, False: 39.8k]
  ------------------
  282|  39.8k|    if (cb == 3) __builtin_trap();
  ------------------
  |  Branch (282:9): [True: 0, False: 39.8k]
  ------------------
  283|       |    // In other words, `cb` is one of [5, 7, 9].
  284|  39.8k|#endif
  285|  39.8k|    table = hcb_bin_table[cb];
  286|       |
  287|   107k|    while (!table[offset].is_leaf)
  ------------------
  |  Branch (287:12): [True: 67.9k, False: 39.8k]
  ------------------
  288|  67.9k|    {
  289|  67.9k|        uint8_t b = faad_get1bit(ld
  290|  67.9k|            DEBUGVAR(1,255,"huffman_spectral_data():9"));
  291|  67.9k|        offset += table[offset].data[b];
  292|  67.9k|    }
  293|       |
  294|  39.8k|    sp[0] = table[offset].data[0];
  295|  39.8k|    sp[1] = table[offset].data[1];
  296|       |
  297|  39.8k|    return 0;
  298|  39.8k|}
huffman.c:huffman_2step_pair:
  199|   157k|{
  200|   157k|    uint32_t cw;
  201|   157k|    uint16_t offset;
  202|   157k|    uint8_t extra_bits;
  203|   157k|    const hcb* root;
  204|   157k|    uint8_t root_bits;
  205|   157k|    const hcb_2_pair* table;
  206|   157k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  207|   157k|    if (hcbN[cb] == 0) __builtin_trap();
  ------------------
  |  Branch (207:9): [True: 0, False: 157k]
  ------------------
  208|   157k|    if (hcb_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (208:9): [True: 0, False: 157k]
  ------------------
  209|   157k|    if (hcb_2_pair_table[cb] == NULL) __builtin_trap();
  ------------------
  |  Branch (209:9): [True: 0, False: 157k]
  ------------------
  210|       |    // In other words, `cb` is one of [6, 8, 10, 11].
  211|   157k|#endif
  212|   157k|    root = hcb_table[cb];
  213|   157k|    root_bits = hcbN[cb];
  214|   157k|    table = hcb_2_pair_table[cb];
  215|       |
  216|   157k|    cw = faad_showbits(ld, root_bits);
  217|   157k|    offset = root[cw].offset;
  218|   157k|    extra_bits = root[cw].extra_bits;
  219|       |
  220|   157k|    if (extra_bits)
  ------------------
  |  Branch (220:9): [True: 14.0k, False: 143k]
  ------------------
  221|  14.0k|    {
  222|       |        /* we know for sure it's more than hcbN[cb] bits long */
  223|  14.0k|        faad_flushbits(ld, root_bits);
  224|  14.0k|        offset += (uint16_t)faad_showbits(ld, extra_bits);
  225|  14.0k|        faad_flushbits(ld, table[offset].bits - root_bits);
  226|   143k|    } else {
  227|   143k|        faad_flushbits(ld, table[offset].bits);
  228|   143k|    }
  229|       |
  230|   157k|    sp[0] = table[offset].x;
  231|   157k|    sp[1] = table[offset].y;
  232|       |
  233|   157k|    return 0;
  234|   157k|}
huffman.c:huffman_binary_pair_sign:
  301|  30.4k|{
  302|  30.4k|    uint8_t err = huffman_binary_pair(cb, ld, sp);
  303|  30.4k|    huffman_sign_bits(ld, sp, PAIR_LEN);
  ------------------
  |  |   76|  30.4k|#define PAIR_LEN       2
  ------------------
  304|       |
  305|  30.4k|    return err;
  306|  30.4k|}
huffman.c:huffman_2step_pair_sign:
  237|   134k|{
  238|   134k|    uint8_t err = huffman_2step_pair(cb, ld, sp);
  239|   134k|    huffman_sign_bits(ld, sp, PAIR_LEN);
  ------------------
  |  |   76|   134k|#define PAIR_LEN       2
  ------------------
  240|       |
  241|   134k|    return err;
  242|   134k|}
huffman.c:huffman_getescape:
  111|   110k|{
  112|   110k|    uint8_t neg, i;
  113|   110k|    int16_t j;
  114|   110k|	int16_t off;
  115|   110k|    int16_t x = *sp;
  116|       |
  117|   110k|    if (x < 0)
  ------------------
  |  Branch (117:9): [True: 14.0k, False: 96.3k]
  ------------------
  118|  14.0k|    {
  119|  14.0k|        if (x != -16)
  ------------------
  |  Branch (119:13): [True: 9.54k, False: 4.48k]
  ------------------
  120|  9.54k|            return 0;
  121|  4.48k|        neg = 1;
  122|  96.3k|    } else {
  123|  96.3k|        if (x != 16)
  ------------------
  |  Branch (123:13): [True: 91.6k, False: 4.67k]
  ------------------
  124|  91.6k|            return 0;
  125|  4.67k|        neg = 0;
  126|  4.67k|    }
  127|       |
  128|  24.6k|    for (i = 4; i < 16; i++)
  ------------------
  |  Branch (128:17): [True: 24.6k, False: 42]
  ------------------
  129|  24.6k|    {
  130|  24.6k|        if (faad_get1bit(ld
  ------------------
  |  Branch (130:13): [True: 9.11k, False: 15.5k]
  ------------------
  131|  24.6k|            DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
  132|  9.11k|        {
  133|  9.11k|            break;
  134|  9.11k|        }
  135|  24.6k|    }
  136|  9.15k|    if (i >= 16)
  ------------------
  |  Branch (136:9): [True: 42, False: 9.11k]
  ------------------
  137|     42|        return 10;
  138|       |
  139|  9.11k|    off = (int16_t)faad_getbits(ld, i
  140|  9.11k|        DEBUGVAR(1,9,"huffman_getescape(): escape"));
  141|       |
  142|  9.11k|    j = off | (1<<i);
  143|  9.11k|    if (neg)
  ------------------
  |  Branch (143:9): [True: 4.44k, False: 4.66k]
  ------------------
  144|  4.44k|        j = -j;
  145|       |
  146|  9.11k|    *sp = j;
  147|  9.11k|    return 0;
  148|  9.15k|}
huffman.c:vcb11_check_LAV:
  318|  45.1k|{
  319|  45.1k|    static const uint16_t vcb11_LAV_tab[] = {
  320|  45.1k|        16, 31, 47, 63, 95, 127, 159, 191, 223,
  321|  45.1k|        255, 319, 383, 511, 767, 1023, 2047
  322|  45.1k|    };
  323|  45.1k|    uint16_t max = 0;
  324|       |
  325|  45.1k|    if (cb < 16 || cb > 31)
  ------------------
  |  Branch (325:9): [True: 0, False: 45.1k]
  |  Branch (325:20): [True: 0, False: 45.1k]
  ------------------
  326|      0|        return;
  327|       |
  328|  45.1k|    max = vcb11_LAV_tab[cb - 16];
  329|       |
  330|  45.1k|    if ((abs(sp[0]) > max) || (abs(sp[1]) > max))
  ------------------
  |  Branch (330:9): [True: 705, False: 44.3k]
  |  Branch (330:31): [True: 891, False: 43.5k]
  ------------------
  331|  1.59k|    {
  332|  1.59k|        sp[0] = 0;
  333|  1.59k|        sp[1] = 0;
  334|  1.59k|    }
  335|  45.1k|}

is_decode:
   48|  20.0k|{
   49|  20.0k|    uint8_t g, sfb, b;
   50|  20.0k|    uint16_t i;
   51|  20.0k|    real_t scale;
   52|       |#ifdef FIXED_POINT
   53|       |    int32_t exp, frac;
   54|       |#endif
   55|       |
   56|  20.0k|    uint16_t nshort = frame_len/8;
   57|  20.0k|    uint8_t group = 0;
   58|       |
   59|  61.2k|    for (g = 0; g < icsr->num_window_groups; g++)
  ------------------
  |  Branch (59:17): [True: 41.1k, False: 20.0k]
  ------------------
   60|  41.1k|    {
   61|       |        /* Do intensity stereo decoding */
   62|  85.9k|        for (b = 0; b < icsr->window_group_length[g]; b++)
  ------------------
  |  Branch (62:21): [True: 44.7k, False: 41.1k]
  ------------------
   63|  44.7k|        {
   64|   115k|            for (sfb = 0; sfb < icsr->max_sfb; sfb++)
  ------------------
  |  Branch (64:27): [True: 70.2k, False: 44.7k]
  ------------------
   65|  70.2k|            {
   66|  70.2k|                if (is_intensity(icsr, g, sfb))
  ------------------
  |  Branch (66:21): [True: 8.32k, False: 61.9k]
  ------------------
   67|  8.32k|                {
   68|  8.32k|                    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|  8.32k|#ifndef FIXED_POINT
   79|  8.32k|                    scale_factor = min(max(scale_factor, -120), 120);
  ------------------
  |  |   60|  16.6k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 8.23k, False: 97]
  |  |  |  Branch (60:22): [True: 7.67k, False: 649]
  |  |  |  Branch (60:35): [True: 7.58k, False: 649]
  |  |  ------------------
  ------------------
   80|  8.32k|                    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|  61.8k|                    for (i = icsr->swb_offset[sfb]; i < min(icsr->swb_offset[sfb+1], ics->swb_offset_max); i++)
  ------------------
  |  |   60|  61.8k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 61.1k, False: 741]
  |  |  ------------------
  ------------------
  |  Branch (95:53): [True: 53.5k, False: 8.32k]
  ------------------
   96|  53.5k|                    {
   97|  53.5k|                        r_spec[(group*nshort)+i] = MUL_R(l_spec[(group*nshort)+i], scale);
  ------------------
  |  |  284|  53.5k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
   98|  53.5k|                        if (is_intensity(icsr, g, sfb) != invert_intensity(ics, g, sfb))
  ------------------
  |  Branch (98:29): [True: 21.9k, False: 31.5k]
  ------------------
   99|  21.9k|                            r_spec[(group*nshort)+i] = -r_spec[(group*nshort)+i];
  100|  53.5k|                    }
  101|  8.32k|                }
  102|  70.2k|            }
  103|  44.7k|            group++;
  104|  44.7k|        }
  105|  41.1k|    }
  106|  20.0k|}

specrec.c:is_intensity:
   44|  6.94M|{
   45|  6.94M|    switch (ics->sfb_cb[group][sfb])
   46|  6.94M|    {
   47|  5.02k|    case INTENSITY_HCB:
  ------------------
  |  |  108|  5.02k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (47:5): [True: 5.02k, False: 6.94M]
  ------------------
   48|  5.02k|        return 1;
   49|  1.21k|    case INTENSITY_HCB2:
  ------------------
  |  |  107|  1.21k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (49:5): [True: 1.21k, False: 6.94M]
  ------------------
   50|  1.21k|        return -1;
   51|  6.93M|    default:
  ------------------
  |  Branch (51:5): [True: 6.93M, False: 6.23k]
  ------------------
   52|  6.93M|        return 0;
   53|  6.94M|    }
   54|  6.94M|}
ms.c:is_intensity:
   44|  8.28k|{
   45|  8.28k|    switch (ics->sfb_cb[group][sfb])
   46|  8.28k|    {
   47|  5.49k|    case INTENSITY_HCB:
  ------------------
  |  |  108|  5.49k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (47:5): [True: 5.49k, False: 2.79k]
  ------------------
   48|  5.49k|        return 1;
   49|    379|    case INTENSITY_HCB2:
  ------------------
  |  |  107|    379|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (49:5): [True: 379, False: 7.90k]
  ------------------
   50|    379|        return -1;
   51|  2.41k|    default:
  ------------------
  |  Branch (51:5): [True: 2.41k, False: 5.87k]
  ------------------
   52|  2.41k|        return 0;
   53|  8.28k|    }
   54|  8.28k|}
is.c:is_intensity:
   44|   123k|{
   45|   123k|    switch (ics->sfb_cb[group][sfb])
   46|   123k|    {
   47|  52.4k|    case INTENSITY_HCB:
  ------------------
  |  |  108|  52.4k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (47:5): [True: 52.4k, False: 71.3k]
  ------------------
   48|  52.4k|        return 1;
   49|  9.35k|    case INTENSITY_HCB2:
  ------------------
  |  |  107|  9.35k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (49:5): [True: 9.35k, False: 114k]
  ------------------
   50|  9.35k|        return -1;
   51|  61.9k|    default:
  ------------------
  |  Branch (51:5): [True: 61.9k, False: 61.8k]
  ------------------
   52|  61.9k|        return 0;
   53|   123k|    }
   54|   123k|}
is.c:invert_intensity:
   57|  53.5k|{
   58|  53.5k|    if (ics->ms_mask_present == 1)
  ------------------
  |  Branch (58:9): [True: 21.5k, False: 32.0k]
  ------------------
   59|  21.5k|        return (1-2*ics->ms_used[group][sfb]);
   60|  32.0k|    return 1;
   61|  53.5k|}

faad_mdct_init:
   63|  16.7k|{
   64|  16.7k|    mdct_info *mdct = (mdct_info*)faad_malloc(sizeof(mdct_info));
   65|       |
   66|  16.7k|    assert(N % 8 == 0);
  ------------------
  |  Branch (66:5): [True: 0, False: 16.7k]
  |  Branch (66:5): [True: 16.7k, False: 0]
  ------------------
   67|       |
   68|  16.7k|    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|  16.7k|    switch (N)
  ------------------
  |  Branch (76:13): [True: 16.7k, False: 0]
  ------------------
   77|  16.7k|    {
   78|  6.21k|    case 2048: mdct->sincos = (complex_t*)mdct_tab_2048; break;
  ------------------
  |  Branch (78:5): [True: 6.21k, False: 10.5k]
  ------------------
   79|  6.21k|    case 256:  mdct->sincos = (complex_t*)mdct_tab_256;  break;
  ------------------
  |  Branch (79:5): [True: 6.21k, False: 10.5k]
  ------------------
   80|       |#ifdef LD_DEC
   81|       |    case 1024: mdct->sincos = (complex_t*)mdct_tab_1024; break;
   82|       |#endif
   83|      0|#ifdef ALLOW_SMALL_FRAMELENGTH
   84|  2.15k|    case 1920: mdct->sincos = (complex_t*)mdct_tab_1920; break;
  ------------------
  |  Branch (84:5): [True: 2.15k, False: 14.5k]
  ------------------
   85|  2.15k|    case 240:  mdct->sincos = (complex_t*)mdct_tab_240;  break;
  ------------------
  |  Branch (85:5): [True: 2.15k, False: 14.5k]
  ------------------
   86|       |#ifdef LD_DEC
   87|       |    case 960:  mdct->sincos = (complex_t*)mdct_tab_960;  break;
   88|       |#endif
   89|  16.7k|#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|  16.7k|    }
   95|       |
   96|       |    /* initialise fft */
   97|  16.7k|    mdct->cfft = cffti(N/4);
   98|       |
   99|       |#ifdef PROFILE
  100|       |    mdct->cycles = 0;
  101|       |    mdct->fft_cycles = 0;
  102|       |#endif
  103|       |
  104|  16.7k|    return mdct;
  105|  16.7k|}
faad_mdct_end:
  108|  16.7k|{
  109|  16.7k|    if (mdct != NULL)
  ------------------
  |  Branch (109:9): [True: 16.7k, False: 0]
  ------------------
  110|  16.7k|    {
  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|  16.7k|        cfftu(mdct->cfft);
  117|       |
  118|  16.7k|        faad_free(mdct);
  119|  16.7k|    }
  120|  16.7k|}
faad_imdct:
  123|   255k|{
  124|   255k|    uint16_t k;
  125|       |
  126|   255k|    complex_t x;
  127|   255k|#ifdef ALLOW_SMALL_FRAMELENGTH
  128|       |#ifdef FIXED_POINT
  129|       |    real_t scale = 0, b_scale = 0;
  130|       |#endif
  131|   255k|#endif
  132|   255k|    ALIGN complex_t Z1[512];
  133|   255k|    complex_t *sincos = mdct->sincos;
  134|       |
  135|   255k|    uint16_t N  = mdct->N;
  136|   255k|    uint16_t N2 = N >> 1;
  137|   255k|    uint16_t N4 = N >> 2;
  138|   255k|    uint16_t N8 = N >> 3;
  139|       |
  140|       |#ifdef PROFILE
  141|       |    int64_t count1, count2 = faad_get_ts();
  142|       |#endif
  143|       |
  144|   255k|#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|   255k|#endif
  156|       |
  157|       |    /* pre-IFFT complex multiplication */
  158|  73.1M|    for (k = 0; k < N4; k++)
  ------------------
  |  Branch (158:17): [True: 72.8M, False: 255k]
  ------------------
  159|  72.8M|    {
  160|  72.8M|        ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
                      ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
  161|  72.8M|            X_in[2*k], X_in[N2 - 1 - 2*k], RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
                          X_in[2*k], X_in[N2 - 1 - 2*k], RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
  162|  72.8M|    }
  163|       |
  164|       |#ifdef PROFILE
  165|       |    count1 = faad_get_ts();
  166|       |#endif
  167|       |
  168|       |    /* complex IFFT, any non-scaling FFT can be used here */
  169|   255k|    cfftb(mdct->cfft, Z1);
  170|       |
  171|       |#ifdef PROFILE
  172|       |    count1 = faad_get_ts() - count1;
  173|       |#endif
  174|       |
  175|       |    /* post-IFFT complex multiplication */
  176|  73.1M|    for (k = 0; k < N4; k++)
  ------------------
  |  Branch (176:17): [True: 72.8M, False: 255k]
  ------------------
  177|  72.8M|    {
  178|  72.8M|        RE(x) = RE(Z1[k]);
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
                      RE(x) = RE(Z1[k]);
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
  179|  72.8M|        IM(x) = IM(Z1[k]);
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
                      IM(x) = IM(Z1[k]);
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
  180|  72.8M|        ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
                      ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
  181|  72.8M|            IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
                          IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
                          IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  391|  72.8M|#define RE(A) (A)[0]
  ------------------
                          IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
  ------------------
  |  |  392|  72.8M|#define IM(A) (A)[1]
  ------------------
  182|       |
  183|  72.8M|#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|  72.8M|#endif
  193|  72.8M|    }
  194|       |
  195|       |    /* reordering */
  196|  18.4M|    for (k = 0; k < N8; k+=2)
  ------------------
  |  Branch (196:17): [True: 18.2M, False: 255k]
  ------------------
  197|  18.2M|    {
  198|  18.2M|        X_out[              2*k] =  IM(Z1[N8 +     k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  199|  18.2M|        X_out[          2 + 2*k] =  IM(Z1[N8 + 1 + k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  200|       |
  201|  18.2M|        X_out[          1 + 2*k] = -RE(Z1[N8 - 1 - k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  202|  18.2M|        X_out[          3 + 2*k] = -RE(Z1[N8 - 2 - k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  203|       |
  204|  18.2M|        X_out[N4 +          2*k] =  RE(Z1[         k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  205|  18.2M|        X_out[N4 +    + 2 + 2*k] =  RE(Z1[     1 + k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  206|       |
  207|  18.2M|        X_out[N4 +      1 + 2*k] = -IM(Z1[N4 - 1 - k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  208|  18.2M|        X_out[N4 +      3 + 2*k] = -IM(Z1[N4 - 2 - k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  209|       |
  210|  18.2M|        X_out[N2 +          2*k] =  RE(Z1[N8 +     k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  211|  18.2M|        X_out[N2 +    + 2 + 2*k] =  RE(Z1[N8 + 1 + k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  212|       |
  213|  18.2M|        X_out[N2 +      1 + 2*k] = -IM(Z1[N8 - 1 - k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  214|  18.2M|        X_out[N2 +      3 + 2*k] = -IM(Z1[N8 - 2 - k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  215|       |
  216|  18.2M|        X_out[N2 + N4 +     2*k] = -IM(Z1[         k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  217|  18.2M|        X_out[N2 + N4 + 2 + 2*k] = -IM(Z1[     1 + k]);
  ------------------
  |  |  392|  18.2M|#define IM(A) (A)[1]
  ------------------
  218|       |
  219|  18.2M|        X_out[N2 + N4 + 1 + 2*k] =  RE(Z1[N4 - 1 - k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  220|  18.2M|        X_out[N2 + N4 + 3 + 2*k] =  RE(Z1[N4 - 2 - k]);
  ------------------
  |  |  391|  18.2M|#define RE(A) (A)[0]
  ------------------
  221|  18.2M|    }
  222|       |
  223|       |#ifdef PROFILE
  224|       |    count2 = faad_get_ts() - count2;
  225|       |    mdct->fft_cycles += count1;
  226|       |    mdct->cycles += (count2 - count1);
  227|       |#endif
  228|   255k|}

AudioSpecificConfigFromBitfile:
  130|  2.32k|{
  131|  2.32k|    int8_t result = 0;
  132|  2.32k|    uint32_t startpos = faad_get_processed_bits(ld);
  133|  2.32k|#ifdef SBR_DEC
  134|  2.32k|    int8_t bits_to_decode = 0;
  135|  2.32k|#endif
  136|       |
  137|  2.32k|    if (mp4ASC == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2.32k]
  ------------------
  138|      0|        return -8;
  139|       |
  140|  2.32k|    memset(mp4ASC, 0, sizeof(mp4AudioSpecificConfig));
  141|       |
  142|  2.32k|    mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(ld, 5
  143|  2.32k|        DEBUGVAR(1,1,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
  144|       |
  145|  2.32k|    mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(ld, 4
  146|  2.32k|        DEBUGVAR(1,2,"parse_audio_decoder_specific_info(): SamplingFrequencyIndex"));
  147|  2.32k|	if(mp4ASC->samplingFrequencyIndex==0x0f)
  ------------------
  |  Branch (147:5): [True: 1, False: 2.32k]
  ------------------
  148|      1|		faad_getbits(ld, 24);
  149|       |
  150|  2.32k|    mp4ASC->channelsConfiguration = (uint8_t)faad_getbits(ld, 4
  151|  2.32k|        DEBUGVAR(1,3,"parse_audio_decoder_specific_info(): ChannelsConfiguration"));
  152|       |
  153|  2.32k|    mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
  154|       |
  155|  2.32k|    if (ObjectTypesTable[mp4ASC->objectTypeIndex] != 1)
  ------------------
  |  Branch (155:9): [True: 5, False: 2.32k]
  ------------------
  156|      5|    {
  157|      5|        return -1;
  158|      5|    }
  159|       |
  160|  2.32k|    if (mp4ASC->samplingFrequency == 0)
  ------------------
  |  Branch (160:9): [True: 1, False: 2.32k]
  ------------------
  161|      1|    {
  162|      1|        return -2;
  163|      1|    }
  164|       |
  165|  2.32k|    if (mp4ASC->channelsConfiguration > 7)
  ------------------
  |  Branch (165:9): [True: 2, False: 2.31k]
  ------------------
  166|      2|    {
  167|      2|        return -3;
  168|      2|    }
  169|       |
  170|  2.31k|#if (defined(PS_DEC) || defined(DRM_PS))
  171|       |    /* check if we have a mono file */
  172|  2.31k|    if (mp4ASC->channelsConfiguration == 1)
  ------------------
  |  Branch (172:9): [True: 172, False: 2.14k]
  ------------------
  173|    172|    {
  174|       |        /* upMatrix to 2 channels for implicit signalling of PS */
  175|    172|        mp4ASC->channelsConfiguration = 2;
  176|    172|    }
  177|  2.31k|#endif
  178|       |
  179|  2.31k|#ifdef SBR_DEC
  180|  2.31k|    mp4ASC->sbr_present_flag = -1;
  181|  2.31k|    if (mp4ASC->objectTypeIndex == 5 || mp4ASC->objectTypeIndex == 29)
  ------------------
  |  Branch (181:9): [True: 498, False: 1.82k]
  |  Branch (181:41): [True: 11, False: 1.80k]
  ------------------
  182|    509|    {
  183|    509|        uint8_t tmp;
  184|       |
  185|    509|        mp4ASC->sbr_present_flag = 1;
  186|    509|        tmp = (uint8_t)faad_getbits(ld, 4
  187|    509|            DEBUGVAR(1,5,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  188|       |        /* check for downsampled SBR */
  189|    509|        if (tmp == mp4ASC->samplingFrequencyIndex)
  ------------------
  |  Branch (189:13): [True: 75, False: 434]
  ------------------
  190|     75|            mp4ASC->downSampledSBR = 1;
  191|    509|        mp4ASC->samplingFrequencyIndex = tmp;
  192|    509|        if (mp4ASC->samplingFrequencyIndex == 15)
  ------------------
  |  Branch (192:13): [True: 5, False: 504]
  ------------------
  193|      5|        {
  194|      5|            mp4ASC->samplingFrequency = (uint32_t)faad_getbits(ld, 24
  195|      5|                DEBUGVAR(1,6,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  196|    504|        } else {
  197|    504|            mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
  198|    504|        }
  199|    509|        mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(ld, 5
  200|    509|            DEBUGVAR(1,7,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
  201|    509|    }
  202|  2.31k|#endif
  203|       |
  204|       |    /* get GASpecificConfig */
  205|  2.31k|    if (mp4ASC->objectTypeIndex == 1 || mp4ASC->objectTypeIndex == 2 ||
  ------------------
  |  Branch (205:9): [True: 115, False: 2.20k]
  |  Branch (205:41): [True: 420, False: 1.78k]
  ------------------
  206|  1.78k|        mp4ASC->objectTypeIndex == 3 || mp4ASC->objectTypeIndex == 4 ||
  ------------------
  |  Branch (206:9): [True: 18, False: 1.76k]
  |  Branch (206:41): [True: 12, False: 1.75k]
  ------------------
  207|  1.75k|        mp4ASC->objectTypeIndex == 6 || mp4ASC->objectTypeIndex == 7)
  ------------------
  |  Branch (207:9): [True: 7, False: 1.74k]
  |  Branch (207:41): [True: 14, False: 1.73k]
  ------------------
  208|    586|    {
  209|    586|        result = GASpecificConfig(ld, mp4ASC, pce);
  210|       |
  211|    586|#ifdef ERROR_RESILIENCE
  212|  1.73k|    } else if (mp4ASC->objectTypeIndex >= ER_OBJECT_START) { /* ER */
  ------------------
  |  |   71|  1.73k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (212:16): [True: 1.71k, False: 13]
  ------------------
  213|  1.71k|        result = GASpecificConfig(ld, mp4ASC, pce);
  214|  1.71k|        mp4ASC->epConfig = (uint8_t)faad_getbits(ld, 2
  215|  1.71k|            DEBUGVAR(1,143,"parse_audio_decoder_specific_info(): epConfig"));
  216|       |
  217|  1.71k|        if (mp4ASC->epConfig != 0)
  ------------------
  |  Branch (217:13): [True: 12, False: 1.70k]
  ------------------
  218|     12|            result = -5;
  219|  1.71k|#endif
  220|       |
  221|  1.71k|    } else {
  222|     13|        result = -4;
  223|     13|    }
  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.31k|#ifdef SBR_DEC
  233|  2.31k|    if(short_form)
  ------------------
  |  Branch (233:8): [True: 0, False: 2.31k]
  ------------------
  234|      0|        bits_to_decode = 0;
  235|  2.31k|    else
  236|  2.31k|		bits_to_decode = (int8_t)(buffer_size*8 + faad_get_processed_bits(ld) - startpos);
  237|       |
  238|  2.31k|    if ((mp4ASC->objectTypeIndex != 5 && mp4ASC->objectTypeIndex != 29) && (bits_to_decode >= 16))
  ------------------
  |  Branch (238:10): [True: 2.31k, False: 1]
  |  Branch (238:42): [True: 2.30k, False: 12]
  |  Branch (238:76): [True: 2.08k, False: 220]
  ------------------
  239|  2.08k|    {
  240|  2.08k|        int16_t syncExtensionType = (int16_t)faad_getbits(ld, 11
  241|  2.08k|            DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
  242|       |
  243|  2.08k|        if (syncExtensionType == 0x2b7)
  ------------------
  |  Branch (243:13): [True: 118, False: 1.96k]
  ------------------
  244|    118|        {
  245|    118|            uint8_t tmp_OTi = (uint8_t)faad_getbits(ld, 5
  246|    118|                DEBUGVAR(1,10,"parse_audio_decoder_specific_info(): extensionAudioObjectType"));
  247|       |
  248|    118|            if (tmp_OTi == 5)
  ------------------
  |  Branch (248:17): [True: 112, False: 6]
  ------------------
  249|    112|            {
  250|    112|                mp4ASC->sbr_present_flag = (uint8_t)faad_get1bit(ld
  251|    112|                    DEBUGVAR(1,11,"parse_audio_decoder_specific_info(): sbr_present_flag"));
  252|       |
  253|    112|                if (mp4ASC->sbr_present_flag)
  ------------------
  |  Branch (253:21): [True: 109, False: 3]
  ------------------
  254|    109|                {
  255|    109|                    uint8_t tmp;
  256|       |
  257|       |					/* Don't set OT to SBR until checked that it is actually there */
  258|    109|					mp4ASC->objectTypeIndex = tmp_OTi;
  259|       |
  260|    109|                    tmp = (uint8_t)faad_getbits(ld, 4
  261|    109|                        DEBUGVAR(1,12,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  262|       |
  263|       |                    /* check for downsampled SBR */
  264|    109|                    if (tmp == mp4ASC->samplingFrequencyIndex)
  ------------------
  |  Branch (264:25): [True: 12, False: 97]
  ------------------
  265|     12|                        mp4ASC->downSampledSBR = 1;
  266|    109|                    mp4ASC->samplingFrequencyIndex = tmp;
  267|       |
  268|    109|                    if (mp4ASC->samplingFrequencyIndex == 15)
  ------------------
  |  Branch (268:25): [True: 4, False: 105]
  ------------------
  269|      4|                    {
  270|      4|                        mp4ASC->samplingFrequency = (uint32_t)faad_getbits(ld, 24
  271|      4|                            DEBUGVAR(1,13,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
  272|    105|                    } else {
  273|    105|                        mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
  274|    105|                    }
  275|    109|                }
  276|    112|            }
  277|    118|        }
  278|  2.08k|    }
  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.31k|    if (mp4ASC->sbr_present_flag == (char)-1) /* cannot be -1 on systems with unsigned char */
  ------------------
  |  Branch (282:9): [True: 1.70k, False: 618]
  ------------------
  283|  1.70k|    {
  284|  1.70k|        if (mp4ASC->samplingFrequency <= 24000)
  ------------------
  |  Branch (284:13): [True: 835, False: 865]
  ------------------
  285|    835|        {
  286|    835|            mp4ASC->samplingFrequency *= 2;
  287|    835|            mp4ASC->forceUpSampling = 1;
  288|    865|        } else /* > 24000*/ {
  289|    865|            mp4ASC->downSampledSBR = 1;
  290|    865|        }
  291|  1.70k|    }
  292|  2.31k|#endif
  293|       |
  294|  2.31k|    faad_endbits(ld);
  295|       |
  296|  2.31k|    return result;
  297|  2.32k|}
AudioSpecificConfig2:
  304|  2.32k|{
  305|  2.32k|    uint8_t ret = 0;
  306|  2.32k|    bitfile ld;
  307|  2.32k|    faad_initbits(&ld, pBuffer, buffer_size);
  308|  2.32k|    if (ld.error != 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 2.32k]
  ------------------
  309|      0|        return -7;
  310|  2.32k|    ret = AudioSpecificConfigFromBitfile(&ld, mp4ASC, pce, buffer_size, short_form);
  311|  2.32k|    faad_endbits(&ld);
  312|  2.32k|    return ret;
  313|  2.32k|}

ms_decode:
   41|  20.0k|{
   42|  20.0k|    uint8_t g, b, sfb;
   43|  20.0k|    uint8_t group = 0;
   44|  20.0k|    uint16_t nshort = frame_len/8;
   45|       |
   46|  20.0k|    uint16_t i, k;
   47|  20.0k|    real_t tmp;
   48|       |
   49|  20.0k|    if (ics->ms_mask_present >= 1)
  ------------------
  |  Branch (49:9): [True: 6.88k, False: 13.1k]
  ------------------
   50|  6.88k|    {
   51|  18.6k|        for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (51:21): [True: 11.7k, False: 6.88k]
  ------------------
   52|  11.7k|        {
   53|  26.1k|            for (b = 0; b < ics->window_group_length[g]; b++)
  ------------------
  |  Branch (53:25): [True: 14.4k, False: 11.7k]
  ------------------
   54|  14.4k|            {
   55|  25.5k|                for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (55:31): [True: 11.0k, False: 14.4k]
  ------------------
   56|  11.0k|                {
   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.0k|                    if ((ics->ms_used[g][sfb] || ics->ms_mask_present == 2) &&
  ------------------
  |  Branch (61:26): [True: 3.37k, False: 7.69k]
  |  Branch (61:50): [True: 4.90k, False: 2.78k]
  ------------------
   62|  8.28k|                        !is_intensity(icsr, g, sfb) && !is_noise(ics, g, sfb))
  ------------------
  |  Branch (62:25): [True: 2.41k, False: 5.87k]
  |  Branch (62:56): [True: 2.41k, False: 0]
  ------------------
   63|  2.41k|                    {
   64|  32.5k|                        for (i = ics->swb_offset[sfb]; i < min(ics->swb_offset[sfb+1], ics->swb_offset_max); i++)
  ------------------
  |  |   60|  32.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 30.7k, False: 1.77k]
  |  |  ------------------
  ------------------
  |  Branch (64:56): [True: 30.1k, False: 2.41k]
  ------------------
   65|  30.1k|                        {
   66|  30.1k|                            k = (group*nshort) + i;
   67|  30.1k|                            tmp = l_spec[k] - r_spec[k];
   68|  30.1k|                            l_spec[k] = l_spec[k] + r_spec[k];
   69|  30.1k|                            r_spec[k] = tmp;
   70|  30.1k|                        }
   71|  2.41k|                    }
   72|  11.0k|                }
   73|  14.4k|                group++;
   74|  14.4k|            }
   75|  11.7k|        }
   76|  6.88k|    }
   77|  20.0k|}

output_to_PCM:
  401|  2.54k|{
  402|  2.54k|    int16_t   *short_sample_buffer = (int16_t*)sample_buffer;
  403|  2.54k|    int32_t   *int_sample_buffer = (int32_t*)sample_buffer;
  404|  2.54k|    float32_t *float_sample_buffer = (float32_t*)sample_buffer;
  405|  2.54k|    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.54k|    switch (format)
  ------------------
  |  Branch (412:13): [True: 2.54k, False: 0]
  ------------------
  413|  2.54k|    {
  414|    836|    case FAAD_FMT_16BIT:
  ------------------
  |  |   98|    836|#define FAAD_FMT_16BIT  1
  ------------------
  |  Branch (414:5): [True: 836, False: 1.71k]
  ------------------
  415|    836|        to_PCM_16bit(hDecoder, input, channels, frame_len, &short_sample_buffer);
  416|    836|        break;
  417|    546|    case FAAD_FMT_24BIT:
  ------------------
  |  |   99|    546|#define FAAD_FMT_24BIT  2
  ------------------
  |  Branch (417:5): [True: 546, False: 2.00k]
  ------------------
  418|    546|        to_PCM_24bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
  419|    546|        break;
  420|    589|    case FAAD_FMT_32BIT:
  ------------------
  |  |  100|    589|#define FAAD_FMT_32BIT  3
  ------------------
  |  Branch (420:5): [True: 589, False: 1.95k]
  ------------------
  421|    589|        to_PCM_32bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
  422|    589|        break;
  423|    293|    case FAAD_FMT_FLOAT:
  ------------------
  |  |  101|    293|#define FAAD_FMT_FLOAT  4
  ------------------
  |  Branch (423:5): [True: 293, False: 2.25k]
  ------------------
  424|    293|        to_PCM_float(hDecoder, input, channels, frame_len, &float_sample_buffer);
  425|    293|        break;
  426|    282|    case FAAD_FMT_DOUBLE:
  ------------------
  |  |  103|    282|#define FAAD_FMT_DOUBLE 5
  ------------------
  |  Branch (426:5): [True: 282, False: 2.26k]
  ------------------
  427|    282|        to_PCM_double(hDecoder, input, channels, frame_len, &double_sample_buffer);
  428|    282|        break;
  429|  2.54k|    }
  430|       |
  431|       |#ifdef PROFILE
  432|       |    count = faad_get_ts() - count;
  433|       |    hDecoder->output_cycles += count;
  434|       |#endif
  435|       |
  436|  2.54k|    return sample_buffer;
  437|  2.54k|}
output.c:to_PCM_16bit:
   92|    836|{
   93|    836|    uint8_t ch, ch1;
   94|    836|    uint16_t i;
   95|       |
   96|    836|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    836|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
   97|    836|    {
   98|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (98:5): [True: 0, False: 836]
  ------------------
   99|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (99:5): [True: 0, False: 836]
  ------------------
  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|    488|    case CONV(2,0):
  ------------------
  |  |   87|    488|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (109:5): [True: 488, False: 348]
  ------------------
  110|    488|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (110:13): [True: 0, False: 488]
  ------------------
  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|    488|        } else {
  123|    488|            ch  = hDecoder->internal_channel[0];
  124|    488|            ch1 = hDecoder->internal_channel[1];
  125|   808k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (125:24): [True: 807k, False: 488]
  ------------------
  126|   807k|            {
  127|   807k|                real_t inp0 = input[ch ][i];
  128|   807k|                real_t inp1 = input[ch1][i];
  129|       |
  130|   807k|                CLIP(inp0, 32767.0f, -32768.0f);
  ------------------
  |  |   64|   807k|#define CLIP(sample, max, min) \
  |  |   65|   807k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 583k, False: 224k]
  |  |  ------------------
  |  |   66|   583k|{                              \
  |  |   67|   583k|    sample += 0.5f;            \
  |  |   68|   583k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 28.8k, False: 554k]
  |  |  ------------------
  |  |   69|   583k|        sample = max;          \
  |  |   70|   583k|} else {                       \
  |  |   71|   224k|    sample += -0.5f;           \
  |  |   72|   224k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 26.1k, False: 197k]
  |  |  ------------------
  |  |   73|   224k|        sample = min;          \
  |  |   74|   224k|}
  ------------------
  131|   807k|                CLIP(inp1, 32767.0f, -32768.0f);
  ------------------
  |  |   64|   807k|#define CLIP(sample, max, min) \
  |  |   65|   807k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 612k, False: 195k]
  |  |  ------------------
  |  |   66|   612k|{                              \
  |  |   67|   612k|    sample += 0.5f;            \
  |  |   68|   612k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 19.4k, False: 592k]
  |  |  ------------------
  |  |   69|   612k|        sample = max;          \
  |  |   70|   612k|} else {                       \
  |  |   71|   195k|    sample += -0.5f;           \
  |  |   72|   195k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 18.3k, False: 177k]
  |  |  ------------------
  |  |   73|   195k|        sample = min;          \
  |  |   74|   195k|}
  ------------------
  132|       |
  133|   807k|                (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
  ------------------
  |  |  387|   807k|#define lrintf(f) ((long)(f))
  ------------------
  134|   807k|                (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp1);
  ------------------
  |  |  387|   807k|#define lrintf(f) ((long)(f))
  ------------------
  135|   807k|            }
  136|    488|        }
  137|    488|        break;
  138|    348|    default:
  ------------------
  |  Branch (138:5): [True: 348, False: 488]
  ------------------
  139|  3.75k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (139:22): [True: 3.40k, False: 348]
  ------------------
  140|  3.40k|        {
  141|  4.86M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (141:24): [True: 4.85M, False: 3.40k]
  ------------------
  142|  4.85M|            {
  143|  4.85M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  144|       |
  145|  4.85M|                CLIP(inp, 32767.0f, -32768.0f);
  ------------------
  |  |   64|  4.85M|#define CLIP(sample, max, min) \
  |  |   65|  4.85M|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 4.22M, False: 635k]
  |  |  ------------------
  |  |   66|  4.22M|{                              \
  |  |   67|  4.22M|    sample += 0.5f;            \
  |  |   68|  4.22M|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 35.1k, False: 4.18M]
  |  |  ------------------
  |  |   69|  4.22M|        sample = max;          \
  |  |   70|  4.22M|} else {                       \
  |  |   71|   635k|    sample += -0.5f;           \
  |  |   72|   635k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 31.4k, False: 604k]
  |  |  ------------------
  |  |   73|   635k|        sample = min;          \
  |  |   74|   635k|}
  ------------------
  146|       |
  147|  4.85M|                (*sample_buffer)[(i*channels)+ch] = (int16_t)lrintf(inp);
  ------------------
  |  |  387|  4.85M|#define lrintf(f) ((long)(f))
  ------------------
  148|  4.85M|            }
  149|  3.40k|        }
  150|    348|        break;
  151|    836|    }
  152|    836|}
output.c:get_sample:
   47|  16.2M|{
   48|  16.2M|    if (!down_matrix)
  ------------------
  |  Branch (48:9): [True: 14.8M, False: 1.38M]
  ------------------
   49|  14.8M|        return input[internal_channel[channel]][sample];
   50|       |
   51|  1.38M|    if (channel == 0)
  ------------------
  |  Branch (51:9): [True: 691k, False: 691k]
  ------------------
   52|   691k|    {
   53|   691k|        return DM_MUL * (input[internal_channel[1]][sample] +
  ------------------
  |  |   41|   691k|#define DM_MUL REAL_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
  |  |  ------------------
  |  |  |  |  288|   691k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   54|   691k|            input[internal_channel[0]][sample] * RSQRT2 +
  ------------------
  |  |   42|   691k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   691k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   55|   691k|            input[internal_channel[3]][sample] * RSQRT2);
  ------------------
  |  |   42|   691k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   691k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   56|   691k|    } else {
   57|   691k|        return DM_MUL * (input[internal_channel[2]][sample] +
  ------------------
  |  |   41|   691k|#define DM_MUL REAL_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
  |  |  ------------------
  |  |  |  |  288|   691k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   58|   691k|            input[internal_channel[0]][sample] * RSQRT2 +
  ------------------
  |  |   42|   691k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   691k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   59|   691k|            input[internal_channel[4]][sample] * RSQRT2);
  ------------------
  |  |   42|   691k|#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
  |  |  ------------------
  |  |  |  |  288|   691k|  #define REAL_CONST(A) ((real_t)(A))
  |  |  ------------------
  ------------------
   60|   691k|    }
   61|  1.38M|}
output.c:to_PCM_24bit:
  157|    546|{
  158|    546|    uint8_t ch, ch1;
  159|    546|    uint16_t i;
  160|       |
  161|    546|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    546|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  162|    546|    {
  163|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (163:5): [True: 0, False: 546]
  ------------------
  164|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (164:5): [True: 0, False: 546]
  ------------------
  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|    290|    case CONV(2,0):
  ------------------
  |  |   87|    290|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (175:5): [True: 290, False: 256]
  ------------------
  176|    290|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (176:13): [True: 0, False: 290]
  ------------------
  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|    290|        } else {
  190|    290|            ch  = hDecoder->internal_channel[0];
  191|    290|            ch1 = hDecoder->internal_channel[1];
  192|   438k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (192:24): [True: 437k, False: 290]
  ------------------
  193|   437k|            {
  194|   437k|                real_t inp0 = input[ch ][i];
  195|   437k|                real_t inp1 = input[ch1][i];
  196|       |
  197|   437k|                inp0 *= 256.0f;
  198|   437k|                inp1 *= 256.0f;
  199|   437k|                CLIP(inp0, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|   437k|#define CLIP(sample, max, min) \
  |  |   65|   437k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 349k, False: 88.8k]
  |  |  ------------------
  |  |   66|   349k|{                              \
  |  |   67|   349k|    sample += 0.5f;            \
  |  |   68|   349k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 26.3k, False: 322k]
  |  |  ------------------
  |  |   69|   349k|        sample = max;          \
  |  |   70|   349k|} else {                       \
  |  |   71|  88.8k|    sample += -0.5f;           \
  |  |   72|  88.8k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 27.3k, False: 61.5k]
  |  |  ------------------
  |  |   73|  88.8k|        sample = min;          \
  |  |   74|  88.8k|}
  ------------------
  200|   437k|                CLIP(inp1, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|   437k|#define CLIP(sample, max, min) \
  |  |   65|   437k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 386k, False: 51.4k]
  |  |  ------------------
  |  |   66|   386k|{                              \
  |  |   67|   386k|    sample += 0.5f;            \
  |  |   68|   386k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 9.66k, False: 376k]
  |  |  ------------------
  |  |   69|   386k|        sample = max;          \
  |  |   70|   386k|} else {                       \
  |  |   71|  51.4k|    sample += -0.5f;           \
  |  |   72|  51.4k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 9.30k, False: 42.1k]
  |  |  ------------------
  |  |   73|  51.4k|        sample = min;          \
  |  |   74|  51.4k|}
  ------------------
  201|       |
  202|   437k|                (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|   437k|#define lrintf(f) ((long)(f))
  ------------------
  203|   437k|                (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
  ------------------
  |  |  387|   437k|#define lrintf(f) ((long)(f))
  ------------------
  204|   437k|            }
  205|    290|        }
  206|    290|        break;
  207|    256|    default:
  ------------------
  |  Branch (207:5): [True: 256, False: 290]
  ------------------
  208|  2.87k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (208:22): [True: 2.61k, False: 256]
  ------------------
  209|  2.61k|        {
  210|  3.60M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (210:24): [True: 3.59M, False: 2.61k]
  ------------------
  211|  3.59M|            {
  212|  3.59M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  213|       |
  214|  3.59M|                inp *= 256.0f;
  215|  3.59M|                CLIP(inp, 8388607.0f, -8388608.0f);
  ------------------
  |  |   64|  3.59M|#define CLIP(sample, max, min) \
  |  |   65|  3.59M|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 2.96M, False: 636k]
  |  |  ------------------
  |  |   66|  2.96M|{                              \
  |  |   67|  2.96M|    sample += 0.5f;            \
  |  |   68|  2.96M|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 49.9k, False: 2.91M]
  |  |  ------------------
  |  |   69|  2.96M|        sample = max;          \
  |  |   70|  2.96M|} else {                       \
  |  |   71|   636k|    sample += -0.5f;           \
  |  |   72|   636k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 46.5k, False: 590k]
  |  |  ------------------
  |  |   73|   636k|        sample = min;          \
  |  |   74|   636k|}
  ------------------
  216|       |
  217|  3.59M|                (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
  ------------------
  |  |  387|  3.59M|#define lrintf(f) ((long)(f))
  ------------------
  218|  3.59M|            }
  219|  2.61k|        }
  220|    256|        break;
  221|    546|    }
  222|    546|}
output.c:to_PCM_32bit:
  227|    589|{
  228|    589|    uint8_t ch, ch1;
  229|    589|    uint16_t i;
  230|       |
  231|    589|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    589|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  232|    589|    {
  233|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (233:5): [True: 0, False: 589]
  ------------------
  234|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (234:5): [True: 0, False: 589]
  ------------------
  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|    326|    case CONV(2,0):
  ------------------
  |  |   87|    326|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (245:5): [True: 326, False: 263]
  ------------------
  246|    326|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (246:13): [True: 0, False: 326]
  ------------------
  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|    326|        } else {
  260|    326|            ch  = hDecoder->internal_channel[0];
  261|    326|            ch1 = hDecoder->internal_channel[1];
  262|   522k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (262:24): [True: 522k, False: 326]
  ------------------
  263|   522k|            {
  264|   522k|                real_t inp0 = input[ch ][i];
  265|   522k|                real_t inp1 = input[ch1][i];
  266|       |
  267|   522k|                inp0 *= 65536.0f;
  268|   522k|                inp1 *= 65536.0f;
  269|   522k|                CLIP(inp0, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|   522k|#define CLIP(sample, max, min) \
  |  |   65|   522k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 375k, False: 146k]
  |  |  ------------------
  |  |   66|   375k|{                              \
  |  |   67|   375k|    sample += 0.5f;            \
  |  |   68|   375k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 29.0k, False: 346k]
  |  |  ------------------
  |  |   69|   375k|        sample = max;          \
  |  |   70|   375k|} else {                       \
  |  |   71|   146k|    sample += -0.5f;           \
  |  |   72|   146k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 27.3k, False: 118k]
  |  |  ------------------
  |  |   73|   146k|        sample = min;          \
  |  |   74|   146k|}
  ------------------
  270|   522k|                CLIP(inp1, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|   522k|#define CLIP(sample, max, min) \
  |  |   65|   522k|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 429k, False: 92.1k]
  |  |  ------------------
  |  |   66|   429k|{                              \
  |  |   67|   429k|    sample += 0.5f;            \
  |  |   68|   429k|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 8.69k, False: 421k]
  |  |  ------------------
  |  |   69|   429k|        sample = max;          \
  |  |   70|   429k|} else {                       \
  |  |   71|  92.1k|    sample += -0.5f;           \
  |  |   72|  92.1k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 7.85k, False: 84.3k]
  |  |  ------------------
  |  |   73|  92.1k|        sample = min;          \
  |  |   74|  92.1k|}
  ------------------
  271|       |
  272|   522k|                (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
  ------------------
  |  |  387|   522k|#define lrintf(f) ((long)(f))
  ------------------
  273|   522k|                (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
  ------------------
  |  |  387|   522k|#define lrintf(f) ((long)(f))
  ------------------
  274|   522k|            }
  275|    326|        }
  276|    326|        break;
  277|    263|    default:
  ------------------
  |  Branch (277:5): [True: 263, False: 326]
  ------------------
  278|  2.01k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (278:22): [True: 1.75k, False: 263]
  ------------------
  279|  1.75k|        {
  280|  2.52M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (280:24): [True: 2.52M, False: 1.75k]
  ------------------
  281|  2.52M|            {
  282|  2.52M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  283|       |
  284|  2.52M|                inp *= 65536.0f;
  285|  2.52M|                CLIP(inp, 2147483647.0f, -2147483648.0f);
  ------------------
  |  |   64|  2.52M|#define CLIP(sample, max, min) \
  |  |   65|  2.52M|if (sample >= 0.0f)            \
  |  |  ------------------
  |  |  |  Branch (65:5): [True: 2.24M, False: 285k]
  |  |  ------------------
  |  |   66|  2.24M|{                              \
  |  |   67|  2.24M|    sample += 0.5f;            \
  |  |   68|  2.24M|    if (sample >= max)         \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 38.1k, False: 2.20M]
  |  |  ------------------
  |  |   69|  2.24M|        sample = max;          \
  |  |   70|  2.24M|} else {                       \
  |  |   71|   285k|    sample += -0.5f;           \
  |  |   72|   285k|    if (sample <= min)         \
  |  |  ------------------
  |  |  |  Branch (72:9): [True: 43.7k, False: 242k]
  |  |  ------------------
  |  |   73|   285k|        sample = min;          \
  |  |   74|   285k|}
  ------------------
  286|       |
  287|  2.52M|                (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
  ------------------
  |  |  387|  2.52M|#define lrintf(f) ((long)(f))
  ------------------
  288|  2.52M|            }
  289|  1.75k|        }
  290|    263|        break;
  291|    589|    }
  292|    589|}
output.c:to_PCM_float:
  297|    293|{
  298|    293|    uint8_t ch, ch1;
  299|    293|    uint16_t i;
  300|       |
  301|    293|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    293|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  302|    293|    {
  303|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (303:5): [True: 0, False: 293]
  ------------------
  304|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (304:5): [True: 0, False: 293]
  ------------------
  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|    108|    case CONV(2,0):
  ------------------
  |  |   87|    108|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (311:5): [True: 108, False: 185]
  ------------------
  312|    108|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (312:13): [True: 0, False: 108]
  ------------------
  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|    108|        } else {
  322|    108|            ch  = hDecoder->internal_channel[0];
  323|    108|            ch1 = hDecoder->internal_channel[1];
  324|   163k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (324:24): [True: 163k, False: 108]
  ------------------
  325|   163k|            {
  326|   163k|                real_t inp0 = input[ch ][i];
  327|   163k|                real_t inp1 = input[ch1][i];
  328|   163k|                (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
  ------------------
  |  |   39|   163k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  329|   163k|                (*sample_buffer)[(i*2)+1] = inp1*FLOAT_SCALE;
  ------------------
  |  |   39|   163k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  330|   163k|            }
  331|    108|        }
  332|    108|        break;
  333|    185|    default:
  ------------------
  |  Branch (333:5): [True: 185, False: 108]
  ------------------
  334|  1.97k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (334:22): [True: 1.78k, False: 185]
  ------------------
  335|  1.78k|        {
  336|  2.58M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (336:24): [True: 2.58M, False: 1.78k]
  ------------------
  337|  2.58M|            {
  338|  2.58M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  339|  2.58M|                (*sample_buffer)[(i*channels)+ch] = inp*FLOAT_SCALE;
  ------------------
  |  |   39|  2.58M|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  340|  2.58M|            }
  341|  1.78k|        }
  342|    185|        break;
  343|    293|    }
  344|    293|}
output.c:to_PCM_double:
  349|    282|{
  350|    282|    uint8_t ch, ch1;
  351|    282|    uint16_t i;
  352|       |
  353|    282|    switch (CONV(channels,hDecoder->downMatrix))
  ------------------
  |  |   87|    282|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  354|    282|    {
  355|      0|    case CONV(1,0):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (355:5): [True: 0, False: 282]
  ------------------
  356|      0|    case CONV(1,1):
  ------------------
  |  |   87|      0|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (356:5): [True: 0, False: 282]
  ------------------
  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|     92|    case CONV(2,0):
  ------------------
  |  |   87|     92|#define CONV(a,b) ((a<<1)|(b&0x1))
  ------------------
  |  Branch (363:5): [True: 92, False: 190]
  ------------------
  364|     92|        if (hDecoder->upMatrix)
  ------------------
  |  Branch (364:13): [True: 0, False: 92]
  ------------------
  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|     92|        } else {
  374|     92|            ch  = hDecoder->internal_channel[0];
  375|     92|            ch1 = hDecoder->internal_channel[1];
  376|   116k|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (376:24): [True: 116k, False: 92]
  ------------------
  377|   116k|            {
  378|   116k|                real_t inp0 = input[ch ][i];
  379|   116k|                real_t inp1 = input[ch1][i];
  380|   116k|                (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
  ------------------
  |  |   39|   116k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  381|   116k|                (*sample_buffer)[(i*2)+1] = (double)inp1*FLOAT_SCALE;
  ------------------
  |  |   39|   116k|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  382|   116k|            }
  383|     92|        }
  384|     92|        break;
  385|    190|    default:
  ------------------
  |  Branch (385:5): [True: 190, False: 92]
  ------------------
  386|  2.05k|        for (ch = 0; ch < channels; ch++)
  ------------------
  |  Branch (386:22): [True: 1.86k, False: 190]
  ------------------
  387|  1.86k|        {
  388|  2.63M|            for(i = 0; i < frame_len; i++)
  ------------------
  |  Branch (388:24): [True: 2.63M, False: 1.86k]
  ------------------
  389|  2.63M|            {
  390|  2.63M|                real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
  391|  2.63M|                (*sample_buffer)[(i*channels)+ch] = (double)inp*FLOAT_SCALE;
  ------------------
  |  |   39|  2.63M|#define FLOAT_SCALE (1.0f/(1<<15))
  ------------------
  392|  2.63M|            }
  393|  1.86k|        }
  394|    190|        break;
  395|    282|    }
  396|    282|}

pns_decode:
  154|   124k|{
  155|   124k|    uint8_t g, sfb, b;
  156|   124k|    uint16_t begin, end;
  157|       |
  158|   124k|    uint8_t group = 0;
  159|   124k|    uint16_t nshort = frame_len >> 3;
  160|       |
  161|   124k|    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|   124k|    (void)object_type;
  176|   124k|#endif
  177|       |
  178|   315k|    for (g = 0; g < ics_left->num_window_groups; g++)
  ------------------
  |  Branch (178:17): [True: 191k, False: 124k]
  ------------------
  179|   191k|    {
  180|       |        /* Do perceptual noise substitution decoding */
  181|   401k|        for (b = 0; b < ics_left->window_group_length[g]; b++)
  ------------------
  |  Branch (181:21): [True: 210k, False: 191k]
  ------------------
  182|   210k|        {
  183|   210k|            uint16_t base = group * nshort;
  184|   303k|            for (sfb = 0; sfb < ics_left->max_sfb; sfb++)
  ------------------
  |  Branch (184:27): [True: 92.4k, False: 210k]
  ------------------
  185|  92.4k|            {
  186|  92.4k|                uint32_t r1_dep = 0, r2_dep = 0;
  187|       |
  188|  92.4k|                if (is_noise(ics_left, g, sfb))
  ------------------
  |  Branch (188:21): [True: 0, False: 92.4k]
  ------------------
  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|  92.4k|                if ((ics_right != NULL)
  ------------------
  |  Branch (230:21): [True: 24.4k, False: 67.9k]
  ------------------
  231|  24.4k|                    && is_noise(ics_right, g, sfb))
  ------------------
  |  Branch (231:24): [True: 0, False: 24.4k]
  ------------------
  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|  92.4k|            } /* sfb */
  267|   210k|            group++;
  268|   210k|        } /* b */
  269|   191k|    } /* g */
  270|   124k|}

specrec.c:is_noise:
   48|  6.93M|{
   49|  6.93M|    if (ics->sfb_cb[group][sfb] == NOISE_HCB)
  ------------------
  |  |  106|  6.93M|#define NOISE_HCB      13
  ------------------
  |  Branch (49:9): [True: 0, False: 6.93M]
  ------------------
   50|      0|        return 1;
   51|  6.93M|    return 0;
   52|  6.93M|}
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.41k|{
   49|  2.41k|    if (ics->sfb_cb[group][sfb] == NOISE_HCB)
  ------------------
  |  |  106|  2.41k|#define NOISE_HCB      13
  ------------------
  |  Branch (49:9): [True: 0, False: 2.41k]
  ------------------
   50|      0|        return 1;
   51|  2.41k|    return 0;
   52|  2.41k|}

ps_free:
 1889|  7.98k|{
 1890|       |    /* free hybrid filterbank structures */
 1891|  7.98k|    hybrid_free(ps->hyb);
 1892|       |
 1893|  7.98k|    faad_free(ps);
 1894|  7.98k|}
ps_init:
 1897|  7.98k|{
 1898|  7.98k|    uint8_t i;
 1899|  7.98k|    uint8_t short_delay_band;
 1900|       |
 1901|  7.98k|    ps_info *ps = (ps_info*)faad_malloc(sizeof(ps_info));
 1902|  7.98k|    memset(ps, 0, sizeof(ps_info));
 1903|       |
 1904|  7.98k|    ps->hyb = hybrid_init(numTimeSlotsRate);
 1905|  7.98k|    ps->numTimeSlotsRate = numTimeSlotsRate;
 1906|       |
 1907|  7.98k|    ps->ps_data_available = 0;
 1908|       |
 1909|       |    /* delay stuff*/
 1910|  7.98k|    ps->saved_delay = 0;
 1911|       |
 1912|   519k|    for (i = 0; i < 64; i++)
  ------------------
  |  Branch (1912:17): [True: 511k, False: 7.98k]
  ------------------
 1913|   511k|    {
 1914|   511k|        ps->delay_buf_index_delay[i] = 0;
 1915|   511k|    }
 1916|       |
 1917|  31.9k|    for (i = 0; i < NO_ALLPASS_LINKS; i++)
  ------------------
  |  |   43|  31.9k|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1917:17): [True: 23.9k, False: 7.98k]
  ------------------
 1918|  23.9k|    {
 1919|  23.9k|        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|  23.9k|        (void)sr_index;
 1929|       |        /* THESE ARE CONSTANTS NOW */
 1930|  23.9k|        ps->num_sample_delay_ser[i] = delay_length_d[i];
 1931|  23.9k|#endif
 1932|  23.9k|    }
 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.98k|    short_delay_band = 35;
 1950|  7.98k|    ps->nr_allpass_bands = 22;
 1951|  7.98k|    ps->alpha_decay = FRAC_CONST(0.76592833836465);
  ------------------
  |  |  291|  7.98k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1952|  7.98k|    ps->alpha_smooth = FRAC_CONST(0.25);
  ------------------
  |  |  291|  7.98k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1953|  7.98k|#endif
 1954|       |
 1955|       |    /* THESE ARE CONSTANT NOW IF PS IS INDEPENDANT OF SAMPLERATE */
 1956|   287k|    for (i = 0; i < short_delay_band; i++)
  ------------------
  |  Branch (1956:17): [True: 279k, False: 7.98k]
  ------------------
 1957|   279k|    {
 1958|   279k|        ps->delay_D[i] = 14;
 1959|   279k|    }
 1960|   239k|    for (i = short_delay_band; i < 64; i++)
  ------------------
  |  Branch (1960:32): [True: 231k, False: 7.98k]
  ------------------
 1961|   231k|    {
 1962|   231k|        ps->delay_D[i] = 1;
 1963|   231k|    }
 1964|       |
 1965|       |    /* mixing and phase */
 1966|   407k|    for (i = 0; i < 50; i++)
  ------------------
  |  Branch (1966:17): [True: 399k, False: 7.98k]
  ------------------
 1967|   399k|    {
 1968|   399k|        RE(ps->h11_prev[i]) = 1;
  ------------------
  |  |  391|   399k|#define RE(A) (A)[0]
  ------------------
 1969|   399k|        IM(ps->h11_prev[i]) = 1;
  ------------------
  |  |  392|   399k|#define IM(A) (A)[1]
  ------------------
 1970|   399k|        RE(ps->h12_prev[i]) = 1;
  ------------------
  |  |  391|   399k|#define RE(A) (A)[0]
  ------------------
 1971|   399k|        IM(ps->h12_prev[i]) = 1;
  ------------------
  |  |  392|   399k|#define IM(A) (A)[1]
  ------------------
 1972|   399k|    }
 1973|       |
 1974|  7.98k|    ps->phase_hist = 0;
 1975|       |
 1976|   167k|    for (i = 0; i < 20; i++)
  ------------------
  |  Branch (1976:17): [True: 159k, False: 7.98k]
  ------------------
 1977|   159k|    {
 1978|   159k|        RE(ps->ipd_prev[i][0]) = 0;
  ------------------
  |  |  391|   159k|#define RE(A) (A)[0]
  ------------------
 1979|   159k|        IM(ps->ipd_prev[i][0]) = 0;
  ------------------
  |  |  392|   159k|#define IM(A) (A)[1]
  ------------------
 1980|   159k|        RE(ps->ipd_prev[i][1]) = 0;
  ------------------
  |  |  391|   159k|#define RE(A) (A)[0]
  ------------------
 1981|   159k|        IM(ps->ipd_prev[i][1]) = 0;
  ------------------
  |  |  392|   159k|#define IM(A) (A)[1]
  ------------------
 1982|   159k|        RE(ps->opd_prev[i][0]) = 0;
  ------------------
  |  |  391|   159k|#define RE(A) (A)[0]
  ------------------
 1983|   159k|        IM(ps->opd_prev[i][0]) = 0;
  ------------------
  |  |  392|   159k|#define IM(A) (A)[1]
  ------------------
 1984|   159k|        RE(ps->opd_prev[i][1]) = 0;
  ------------------
  |  |  391|   159k|#define RE(A) (A)[0]
  ------------------
 1985|   159k|        IM(ps->opd_prev[i][1]) = 0;
  ------------------
  |  |  392|   159k|#define IM(A) (A)[1]
  ------------------
 1986|   159k|    }
 1987|       |
 1988|  7.98k|    return ps;
 1989|  7.98k|}
ps_decode:
 1993|  5.66k|{
 1994|  5.66k|    qmf_t X_hybrid_left[32][32] = {{{0}}};
  ------------------
  |  |  167|  5.66k|#define qmf_t complex_t
  ------------------
 1995|  5.66k|    qmf_t X_hybrid_right[32][32] = {{{0}}};
  ------------------
  |  |  167|  5.66k|#define qmf_t complex_t
  ------------------
 1996|       |
 1997|       |    /* delta decoding of the bitstream data */
 1998|  5.66k|    ps_data_decode(ps);
 1999|       |
 2000|       |    /* set up some parameters depending on filterbank type */
 2001|  5.66k|    if (ps->use34hybrid_bands)
  ------------------
  |  Branch (2001:9): [True: 2.13k, False: 3.53k]
  ------------------
 2002|  2.13k|    {
 2003|  2.13k|        ps->group_border = (uint8_t*)group_border34;
 2004|  2.13k|        ps->map_group2bk = (uint16_t*)map_group2bk34;
 2005|  2.13k|        ps->num_groups = 32+18;
 2006|  2.13k|        ps->num_hybrid_groups = 32;
 2007|  2.13k|        ps->nr_par_bands = 34;
 2008|  2.13k|        ps->decay_cutoff = 5;
 2009|  3.53k|    } else {
 2010|  3.53k|        ps->group_border = (uint8_t*)group_border20;
 2011|  3.53k|        ps->map_group2bk = (uint16_t*)map_group2bk20;
 2012|  3.53k|        ps->num_groups = 10+12;
 2013|  3.53k|        ps->num_hybrid_groups = 10;
 2014|  3.53k|        ps->nr_par_bands = 20;
 2015|  3.53k|        ps->decay_cutoff = 3;
 2016|  3.53k|    }
 2017|       |
 2018|       |    /* Perform further analysis on the lowest subbands to get a higher
 2019|       |     * frequency resolution
 2020|       |     */
 2021|  5.66k|    hybrid_analysis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
 2022|  5.66k|        ps->use34hybrid_bands, ps->numTimeSlotsRate);
 2023|       |
 2024|       |    /* decorrelate mono signal */
 2025|  5.66k|    ps_decorrelate(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
 2026|       |
 2027|       |    /* apply mixing and phase parameters */
 2028|  5.66k|    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.66k|    hybrid_synthesis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
 2032|  5.66k|        ps->use34hybrid_bands, ps->numTimeSlotsRate);
 2033|       |
 2034|  5.66k|    hybrid_synthesis((hyb_info*)ps->hyb, X_right, X_hybrid_right,
 2035|  5.66k|        ps->use34hybrid_bands, ps->numTimeSlotsRate);
 2036|       |
 2037|  5.66k|    return 0;
 2038|  5.66k|}
ps_dec.c:hybrid_free:
  234|  7.98k|{
  235|  7.98k|    uint8_t i;
  236|       |
  237|  7.98k|	if (!hyb) return;
  ------------------
  |  Branch (237:6): [True: 0, False: 7.98k]
  ------------------
  238|       |
  239|  7.98k|    if (hyb->work)
  ------------------
  |  Branch (239:9): [True: 7.98k, False: 0]
  ------------------
  240|  7.98k|        faad_free(hyb->work);
  241|       |
  242|  47.9k|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (242:17): [True: 39.9k, False: 7.98k]
  ------------------
  243|  39.9k|    {
  244|  39.9k|        if (hyb->buffer[i])
  ------------------
  |  Branch (244:13): [True: 39.9k, False: 0]
  ------------------
  245|  39.9k|            faad_free(hyb->buffer[i]);
  246|  39.9k|    }
  247|  7.98k|    if (hyb->buffer)
  ------------------
  |  Branch (247:9): [True: 7.98k, False: 0]
  ------------------
  248|  7.98k|        faad_free(hyb->buffer);
  249|       |
  250|   260k|    for (i = 0; i < hyb->frame_len; i++)
  ------------------
  |  Branch (250:17): [True: 252k, False: 7.98k]
  ------------------
  251|   252k|    {
  252|   252k|        if (hyb->temp[i])
  ------------------
  |  Branch (252:13): [True: 252k, False: 0]
  ------------------
  253|   252k|            faad_free(hyb->temp[i]);
  254|   252k|    }
  255|  7.98k|    if (hyb->temp)
  ------------------
  |  Branch (255:9): [True: 7.98k, False: 0]
  ------------------
  256|  7.98k|        faad_free(hyb->temp);
  257|       |
  258|  7.98k|    faad_free(hyb);
  259|  7.98k|}
ps_dec.c:hybrid_init:
  197|  7.98k|{
  198|  7.98k|    uint8_t i;
  199|       |
  200|  7.98k|    hyb_info *hyb = (hyb_info*)faad_malloc(sizeof(hyb_info));
  201|       |
  202|  7.98k|    hyb->resolution34[0] = 12;
  203|  7.98k|    hyb->resolution34[1] = 8;
  204|  7.98k|    hyb->resolution34[2] = 4;
  205|  7.98k|    hyb->resolution34[3] = 4;
  206|  7.98k|    hyb->resolution34[4] = 4;
  207|       |
  208|  7.98k|    hyb->resolution20[0] = 8;
  209|  7.98k|    hyb->resolution20[1] = 2;
  210|  7.98k|    hyb->resolution20[2] = 2;
  211|       |
  212|  7.98k|    hyb->frame_len = numTimeSlotsRate;
  213|       |
  214|  7.98k|    hyb->work = (qmf_t*)faad_malloc((hyb->frame_len+12) * sizeof(qmf_t));
  215|  7.98k|    memset(hyb->work, 0, (hyb->frame_len+12) * sizeof(qmf_t));
  216|       |
  217|  7.98k|    hyb->buffer = (qmf_t**)faad_malloc(5 * sizeof(qmf_t*));
  218|  47.9k|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (218:17): [True: 39.9k, False: 7.98k]
  ------------------
  219|  39.9k|    {
  220|  39.9k|        hyb->buffer[i] = (qmf_t*)faad_malloc(hyb->frame_len * sizeof(qmf_t));
  221|  39.9k|        memset(hyb->buffer[i], 0, hyb->frame_len * sizeof(qmf_t));
  222|  39.9k|    }
  223|       |
  224|  7.98k|    hyb->temp = (qmf_t**)faad_malloc(hyb->frame_len * sizeof(qmf_t*));
  225|   260k|    for (i = 0; i < hyb->frame_len; i++)
  ------------------
  |  Branch (225:17): [True: 252k, False: 7.98k]
  ------------------
  226|   252k|    {
  227|   252k|        hyb->temp[i] = (qmf_t*)faad_malloc(12 /*max*/ * sizeof(qmf_t));
  228|   252k|    }
  229|       |
  230|  7.98k|    return hyb;
  231|  7.98k|}
ps_dec.c:ps_data_decode:
  808|  5.66k|{
  809|  5.66k|    uint8_t env, bin;
  810|       |
  811|       |    /* ps data not available, use data from previous frame */
  812|  5.66k|    if (ps->ps_data_available == 0)
  ------------------
  |  Branch (812:9): [True: 1.63k, False: 4.02k]
  ------------------
  813|  1.63k|    {
  814|  1.63k|        ps->num_env = 0;
  815|  1.63k|    }
  816|       |
  817|  14.8k|    for (env = 0; env < ps->num_env; env++)
  ------------------
  |  Branch (817:19): [True: 9.17k, False: 5.66k]
  ------------------
  818|  9.17k|    {
  819|  9.17k|        int8_t *iid_index_prev;
  820|  9.17k|        int8_t *icc_index_prev;
  821|  9.17k|        int8_t *ipd_index_prev;
  822|  9.17k|        int8_t *opd_index_prev;
  823|       |
  824|  9.17k|        int8_t num_iid_steps = (ps->iid_mode < 3) ? 7 : 15 /*fine quant*/;
  ------------------
  |  Branch (824:32): [True: 5.21k, False: 3.96k]
  ------------------
  825|       |
  826|  9.17k|        if (env == 0)
  ------------------
  |  Branch (826:13): [True: 2.78k, False: 6.38k]
  ------------------
  827|  2.78k|        {
  828|       |            /* take last envelope from previous frame */
  829|  2.78k|            iid_index_prev = ps->iid_index_prev;
  830|  2.78k|            icc_index_prev = ps->icc_index_prev;
  831|  2.78k|            ipd_index_prev = ps->ipd_index_prev;
  832|  2.78k|            opd_index_prev = ps->opd_index_prev;
  833|  6.38k|        } else {
  834|       |            /* take index values from previous envelope */
  835|  6.38k|            iid_index_prev = ps->iid_index[env - 1];
  836|  6.38k|            icc_index_prev = ps->icc_index[env - 1];
  837|  6.38k|            ipd_index_prev = ps->ipd_index[env - 1];
  838|  6.38k|            opd_index_prev = ps->opd_index[env - 1];
  839|  6.38k|        }
  840|       |
  841|       |//        iid = 1;
  842|       |        /* delta decode iid parameters */
  843|  9.17k|        delta_decode(ps->enable_iid, ps->iid_index[env], iid_index_prev,
  844|  9.17k|            ps->iid_dt[env], ps->nr_iid_par,
  845|  9.17k|            (ps->iid_mode == 0 || ps->iid_mode == 3) ? 2 : 1,
  ------------------
  |  Branch (845:14): [True: 4.72k, False: 4.44k]
  |  Branch (845:35): [True: 2.48k, False: 1.96k]
  ------------------
  846|  9.17k|            -num_iid_steps, num_iid_steps);
  847|       |//        iid = 0;
  848|       |
  849|       |        /* delta decode icc parameters */
  850|  9.17k|        delta_decode(ps->enable_icc, ps->icc_index[env], icc_index_prev,
  851|  9.17k|            ps->icc_dt[env], ps->nr_icc_par,
  852|  9.17k|            (ps->icc_mode == 0 || ps->icc_mode == 3) ? 2 : 1,
  ------------------
  |  Branch (852:14): [True: 3.92k, False: 5.25k]
  |  Branch (852:35): [True: 1.02k, False: 4.22k]
  ------------------
  853|  9.17k|            0, 7);
  854|       |
  855|       |        /* delta modulo decode ipd parameters */
  856|  9.17k|        delta_modulo_decode(ps->enable_ipdopd, ps->ipd_index[env], ipd_index_prev,
  857|  9.17k|            ps->ipd_dt[env], ps->nr_ipdopd_par, 1, 7);
  858|       |
  859|       |        /* delta modulo decode opd parameters */
  860|  9.17k|        delta_modulo_decode(ps->enable_ipdopd, ps->opd_index[env], opd_index_prev,
  861|  9.17k|            ps->opd_dt[env], ps->nr_ipdopd_par, 1, 7);
  862|  9.17k|    }
  863|       |
  864|       |    /* handle error case */
  865|  5.66k|    if (ps->num_env == 0)
  ------------------
  |  Branch (865:9): [True: 2.87k, False: 2.78k]
  ------------------
  866|  2.87k|    {
  867|       |        /* force to 1 */
  868|  2.87k|        ps->num_env = 1;
  869|       |
  870|  2.87k|        if (ps->enable_iid)
  ------------------
  |  Branch (870:13): [True: 1.63k, False: 1.23k]
  ------------------
  871|  1.63k|        {
  872|  57.2k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (872:27): [True: 55.6k, False: 1.63k]
  ------------------
  873|  55.6k|                ps->iid_index[0][bin] = ps->iid_index_prev[bin];
  874|  1.63k|        } else {
  875|  43.3k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (875:27): [True: 42.0k, False: 1.23k]
  ------------------
  876|  42.0k|                ps->iid_index[0][bin] = 0;
  877|  1.23k|        }
  878|       |
  879|  2.87k|        if (ps->enable_icc)
  ------------------
  |  Branch (879:13): [True: 948, False: 1.92k]
  ------------------
  880|    948|        {
  881|  33.1k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (881:27): [True: 32.2k, False: 948]
  ------------------
  882|  32.2k|                ps->icc_index[0][bin] = ps->icc_index_prev[bin];
  883|  1.92k|        } else {
  884|  67.4k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (884:27): [True: 65.5k, False: 1.92k]
  ------------------
  885|  65.5k|                ps->icc_index[0][bin] = 0;
  886|  1.92k|        }
  887|       |
  888|  2.87k|        if (ps->enable_ipdopd)
  ------------------
  |  Branch (888:13): [True: 532, False: 2.34k]
  ------------------
  889|    532|        {
  890|  9.57k|            for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (890:27): [True: 9.04k, False: 532]
  ------------------
  891|  9.04k|            {
  892|  9.04k|                ps->ipd_index[0][bin] = ps->ipd_index_prev[bin];
  893|  9.04k|                ps->opd_index[0][bin] = ps->opd_index_prev[bin];
  894|  9.04k|            }
  895|  2.34k|        } else {
  896|  42.1k|            for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (896:27): [True: 39.8k, False: 2.34k]
  ------------------
  897|  39.8k|            {
  898|  39.8k|                ps->ipd_index[0][bin] = 0;
  899|  39.8k|                ps->opd_index[0][bin] = 0;
  900|  39.8k|            }
  901|  2.34k|        }
  902|  2.87k|    }
  903|       |
  904|       |    /* update previous indices */
  905|   198k|    for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (905:19): [True: 192k, False: 5.66k]
  ------------------
  906|   192k|        ps->iid_index_prev[bin] = ps->iid_index[ps->num_env-1][bin];
  907|   198k|    for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (907:19): [True: 192k, False: 5.66k]
  ------------------
  908|   192k|        ps->icc_index_prev[bin] = ps->icc_index[ps->num_env-1][bin];
  909|   101k|    for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (909:19): [True: 96.2k, False: 5.66k]
  ------------------
  910|  96.2k|    {
  911|  96.2k|        ps->ipd_index_prev[bin] = ps->ipd_index[ps->num_env-1][bin];
  912|  96.2k|        ps->opd_index_prev[bin] = ps->opd_index[ps->num_env-1][bin];
  913|  96.2k|    }
  914|       |
  915|  5.66k|    ps->ps_data_available = 0;
  916|       |
  917|  5.66k|    if (ps->frame_class == 0)
  ------------------
  |  Branch (917:9): [True: 3.65k, False: 2.00k]
  ------------------
  918|  3.65k|    {
  919|  3.65k|        ps->border_position[0] = 0;
  920|  7.25k|        for (env = 1; env < ps->num_env; env++)
  ------------------
  |  Branch (920:23): [True: 3.60k, False: 3.65k]
  ------------------
  921|  3.60k|        {
  922|  3.60k|            ps->border_position[env] = (env * ps->numTimeSlotsRate) / ps->num_env;
  923|  3.60k|        }
  924|  3.65k|        ps->border_position[ps->num_env] = ps->numTimeSlotsRate;
  925|  3.65k|    } else {
  926|  2.00k|        ps->border_position[0] = 0;
  927|       |
  928|  2.00k|        if (ps->border_position[ps->num_env] < ps->numTimeSlotsRate)
  ------------------
  |  Branch (928:13): [True: 1.41k, False: 592]
  ------------------
  929|  1.41k|        {
  930|  49.5k|            for (bin = 0; bin < 34; bin++)
  ------------------
  |  Branch (930:27): [True: 48.1k, False: 1.41k]
  ------------------
  931|  48.1k|            {
  932|  48.1k|                ps->iid_index[ps->num_env][bin] = ps->iid_index[ps->num_env-1][bin];
  933|  48.1k|                ps->icc_index[ps->num_env][bin] = ps->icc_index[ps->num_env-1][bin];
  934|  48.1k|            }
  935|  25.5k|            for (bin = 0; bin < 17; bin++)
  ------------------
  |  Branch (935:27): [True: 24.0k, False: 1.41k]
  ------------------
  936|  24.0k|            {
  937|  24.0k|                ps->ipd_index[ps->num_env][bin] = ps->ipd_index[ps->num_env-1][bin];
  938|  24.0k|                ps->opd_index[ps->num_env][bin] = ps->opd_index[ps->num_env-1][bin];
  939|  24.0k|            }
  940|  1.41k|            ps->num_env++;
  941|  1.41k|            ps->border_position[ps->num_env] = ps->numTimeSlotsRate;
  942|  1.41k|        }
  943|       |
  944|  6.21k|        for (env = 1; env < ps->num_env; env++)
  ------------------
  |  Branch (944:23): [True: 4.20k, False: 2.00k]
  ------------------
  945|  4.20k|        {
  946|  4.20k|            int8_t thr = ps->numTimeSlotsRate - (ps->num_env - env);
  947|       |
  948|  4.20k|            if (ps->border_position[env] > thr)
  ------------------
  |  Branch (948:17): [True: 637, False: 3.56k]
  ------------------
  949|    637|            {
  950|    637|                ps->border_position[env] = thr;
  951|  3.56k|            } else {
  952|  3.56k|                thr = ps->border_position[env-1]+1;
  953|  3.56k|                if (ps->border_position[env] < thr)
  ------------------
  |  Branch (953:21): [True: 1.84k, False: 1.71k]
  ------------------
  954|  1.84k|                {
  955|  1.84k|                    ps->border_position[env] = thr;
  956|  1.84k|                }
  957|  3.56k|            }
  958|  4.20k|        }
  959|  2.00k|    }
  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.66k|    if (ps->use34hybrid_bands)
  ------------------
  |  Branch (980:9): [True: 2.13k, False: 3.53k]
  ------------------
  981|  2.13k|    {
  982|  6.16k|        for (env = 0; env < ps->num_env; env++)
  ------------------
  |  Branch (982:23): [True: 4.02k, False: 2.13k]
  ------------------
  983|  4.02k|        {
  984|  4.02k|            if (ps->iid_mode != 2 && ps->iid_mode != 5)
  ------------------
  |  Branch (984:17): [True: 3.31k, False: 714]
  |  Branch (984:38): [True: 2.17k, False: 1.14k]
  ------------------
  985|  2.17k|                map20indexto34(ps->iid_index[env], 34);
  986|  4.02k|            if (ps->icc_mode != 2 && ps->icc_mode != 5)
  ------------------
  |  Branch (986:17): [True: 2.73k, False: 1.29k]
  |  Branch (986:38): [True: 1.74k, False: 992]
  ------------------
  987|  1.74k|                map20indexto34(ps->icc_index[env], 34);
  988|  4.02k|            if (ps->ipd_mode != 2 && ps->ipd_mode != 5)
  ------------------
  |  Branch (988:17): [True: 3.31k, False: 714]
  |  Branch (988:38): [True: 2.17k, False: 1.14k]
  ------------------
  989|  2.17k|            {
  990|  2.17k|                map20indexto34(ps->ipd_index[env], 17);
  991|  2.17k|                map20indexto34(ps->opd_index[env], 17);
  992|  2.17k|            }
  993|  4.02k|        }
  994|  2.13k|    }
  995|  5.66k|#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.66k|}
ps_dec.c:delta_decode:
  629|  18.3k|{
  630|  18.3k|    int8_t i;
  631|       |
  632|  18.3k|    if (enable == 1)
  ------------------
  |  Branch (632:9): [True: 9.37k, False: 8.97k]
  ------------------
  633|  9.37k|    {
  634|  9.37k|        if (dt_flag == 0)
  ------------------
  |  Branch (634:13): [True: 5.23k, False: 4.13k]
  ------------------
  635|  5.23k|        {
  636|       |            /* delta coded in frequency direction */
  637|  5.23k|            index[0] = 0 + index[0];
  638|  5.23k|            index[0] = delta_clip(index[0], min_index, max_index);
  639|       |
  640|  73.7k|            for (i = 1; i < nr_par; i++)
  ------------------
  |  Branch (640:25): [True: 68.4k, False: 5.23k]
  ------------------
  641|  68.4k|            {
  642|  68.4k|                index[i] = index[i-1] + index[i];
  643|  68.4k|                index[i] = delta_clip(index[i], min_index, max_index);
  644|  68.4k|            }
  645|  5.23k|        } else {
  646|       |            /* delta coded in time direction */
  647|  58.8k|            for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (647:25): [True: 54.7k, False: 4.13k]
  ------------------
  648|  54.7k|            {
  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|  54.7k|                index[i] = index_prev[i*stride] + index[i];
  656|       |                //tmp2 = index[i];
  657|  54.7k|                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|  54.7k|            }
  667|  4.13k|        }
  668|  9.37k|    } else {
  669|       |        /* set indices to zero */
  670|  19.3k|        for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (670:21): [True: 10.3k, False: 8.97k]
  ------------------
  671|  10.3k|        {
  672|  10.3k|            index[i] = 0;
  673|  10.3k|        }
  674|  8.97k|    }
  675|       |
  676|       |    /* coarse */
  677|  18.3k|    if (stride == 2)
  ------------------
  |  Branch (677:9): [True: 12.1k, False: 6.18k]
  ------------------
  678|  12.1k|    {
  679|  83.5k|        for (i = (nr_par<<1)-1; i > 0; i--)
  ------------------
  |  Branch (679:33): [True: 71.3k, False: 12.1k]
  ------------------
  680|  71.3k|        {
  681|  71.3k|            index[i] = index[i>>1];
  682|  71.3k|        }
  683|  12.1k|    }
  684|  18.3k|}
ps_dec.c:delta_clip:
  614|   128k|{
  615|   128k|    if (i < min)
  ------------------
  |  Branch (615:9): [True: 18.6k, False: 109k]
  ------------------
  616|  18.6k|        return min;
  617|   109k|    else if (i > max)
  ------------------
  |  Branch (617:14): [True: 2.12k, False: 107k]
  ------------------
  618|  2.12k|        return max;
  619|   107k|    else
  620|   107k|        return i;
  621|   128k|}
ps_dec.c:delta_modulo_decode:
  691|  18.3k|{
  692|  18.3k|    int8_t i;
  693|       |
  694|  18.3k|    if (enable == 1)
  ------------------
  |  Branch (694:9): [True: 5.79k, False: 12.5k]
  ------------------
  695|  5.79k|    {
  696|  5.79k|        if (dt_flag == 0)
  ------------------
  |  Branch (696:13): [True: 4.22k, False: 1.56k]
  ------------------
  697|  4.22k|        {
  698|       |            /* delta coded in frequency direction */
  699|  4.22k|            index[0] = 0 + index[0];
  700|  4.22k|            index[0] &= and_modulo;
  701|       |
  702|  23.2k|            for (i = 1; i < nr_par; i++)
  ------------------
  |  Branch (702:25): [True: 19.0k, False: 4.22k]
  ------------------
  703|  19.0k|            {
  704|  19.0k|                index[i] = index[i-1] + index[i];
  705|  19.0k|                index[i] &= and_modulo;
  706|  19.0k|            }
  707|  4.22k|        } else {
  708|       |            /* delta coded in time direction */
  709|  6.94k|            for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (709:25): [True: 5.38k, False: 1.56k]
  ------------------
  710|  5.38k|            {
  711|  5.38k|                index[i] = index_prev[i*stride] + index[i];
  712|  5.38k|                index[i] &= and_modulo;
  713|  5.38k|            }
  714|  1.56k|        }
  715|  12.5k|    } else {
  716|       |        /* set indices to zero */
  717|  39.2k|        for (i = 0; i < nr_par; i++)
  ------------------
  |  Branch (717:21): [True: 26.6k, False: 12.5k]
  ------------------
  718|  26.6k|        {
  719|  26.6k|            index[i] = 0;
  720|  26.6k|        }
  721|  12.5k|    }
  722|       |
  723|       |    /* coarse */
  724|  18.3k|    if (stride == 2)
  ------------------
  |  Branch (724:9): [True: 0, False: 18.3k]
  ------------------
  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|  18.3k|}
ps_dec.c:map20indexto34:
  765|  8.26k|{
  766|  8.26k|    index[0] = index[0];
  767|  8.26k|    index[1] = (index[0] + index[1])/2;
  768|  8.26k|    index[2] = index[1];
  769|  8.26k|    index[3] = index[2];
  770|  8.26k|    index[4] = (index[2] + index[3])/2;
  771|  8.26k|    index[5] = index[3];
  772|  8.26k|    index[6] = index[4];
  773|  8.26k|    index[7] = index[4];
  774|  8.26k|    index[8] = index[5];
  775|  8.26k|    index[9] = index[5];
  776|  8.26k|    index[10] = index[6];
  777|  8.26k|    index[11] = index[7];
  778|  8.26k|    index[12] = index[8];
  779|  8.26k|    index[13] = index[8];
  780|  8.26k|    index[14] = index[9];
  781|  8.26k|    index[15] = index[9];
  782|  8.26k|    index[16] = index[10];
  783|       |
  784|  8.26k|    if (bins == 34)
  ------------------
  |  Branch (784:9): [True: 3.92k, False: 4.34k]
  ------------------
  785|  3.92k|    {
  786|  3.92k|        index[17] = index[11];
  787|  3.92k|        index[18] = index[12];
  788|  3.92k|        index[19] = index[13];
  789|  3.92k|        index[20] = index[14];
  790|  3.92k|        index[21] = index[14];
  791|  3.92k|        index[22] = index[15];
  792|  3.92k|        index[23] = index[15];
  793|  3.92k|        index[24] = index[16];
  794|  3.92k|        index[25] = index[16];
  795|  3.92k|        index[26] = index[17];
  796|  3.92k|        index[27] = index[17];
  797|  3.92k|        index[28] = index[18];
  798|  3.92k|        index[29] = index[18];
  799|  3.92k|        index[30] = index[18];
  800|  3.92k|        index[31] = index[18];
  801|  3.92k|        index[32] = index[19];
  802|  3.92k|        index[33] = index[19];
  803|  3.92k|    }
  804|  8.26k|}
ps_dec.c:hybrid_analysis:
  514|  5.66k|{
  515|  5.66k|    uint8_t k, n, band;
  516|  5.66k|    uint8_t offset = 0;
  517|  5.66k|    uint8_t qmf_bands = (use34) ? 5 : 3;
  ------------------
  |  Branch (517:25): [True: 2.13k, False: 3.53k]
  ------------------
  518|  5.66k|    uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
  ------------------
  |  Branch (518:27): [True: 2.13k, False: 3.53k]
  ------------------
  519|       |
  520|  26.9k|    for (band = 0; band < qmf_bands; band++)
  ------------------
  |  Branch (520:20): [True: 21.2k, False: 5.66k]
  ------------------
  521|  21.2k|    {
  522|       |        /* build working buffer */
  523|  21.2k|        memcpy(hyb->work, hyb->buffer[band], 12 * sizeof(qmf_t));
  524|       |
  525|       |        /* add new samples */
  526|   681k|        for (n = 0; n < hyb->frame_len; n++)
  ------------------
  |  Branch (526:21): [True: 660k, False: 21.2k]
  ------------------
  527|   660k|        {
  528|   660k|            QMF_RE(hyb->work[12 + n]) = QMF_RE(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  168|   660k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   660k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(hyb->work[12 + n]) = QMF_RE(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  168|   660k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   660k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  529|   660k|            QMF_IM(hyb->work[12 + n]) = QMF_IM(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  169|   660k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   660k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(hyb->work[12 + n]) = QMF_IM(X[n + 6 /*delay*/][band]);
  ------------------
  |  |  169|   660k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   660k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  530|   660k|        }
  531|       |
  532|       |        /* store samples */
  533|  21.2k|        memcpy(hyb->buffer[band], hyb->work + hyb->frame_len, 12 * sizeof(qmf_t));
  534|       |
  535|       |
  536|  21.2k|        switch(resolution[band])
  ------------------
  |  Branch (536:16): [True: 21.2k, False: 0]
  ------------------
  537|  21.2k|        {
  538|  7.06k|        case 2:
  ------------------
  |  Branch (538:9): [True: 7.06k, False: 14.1k]
  ------------------
  539|       |            /* Type B real filter, Q[p] = 2 */
  540|  7.06k|            channel_filter2(hyb, hyb->frame_len, p2_13_20, hyb->work, hyb->temp);
  541|  7.06k|            break;
  542|  6.39k|        case 4:
  ------------------
  |  Branch (542:9): [True: 6.39k, False: 14.8k]
  ------------------
  543|       |            /* Type A complex filter, Q[p] = 4 */
  544|  6.39k|            channel_filter4(hyb, hyb->frame_len, p4_13_34, hyb->work, hyb->temp);
  545|  6.39k|            break;
  546|  5.66k|        case 8:
  ------------------
  |  Branch (546:9): [True: 5.66k, False: 15.5k]
  ------------------
  547|       |            /* Type A complex filter, Q[p] = 8 */
  548|  5.66k|            channel_filter8(hyb, hyb->frame_len, (use34) ? p8_13_34 : p8_13_20,
  ------------------
  |  Branch (548:50): [True: 2.13k, False: 3.53k]
  ------------------
  549|  5.66k|                hyb->work, hyb->temp);
  550|  5.66k|            break;
  551|  2.13k|        case 12:
  ------------------
  |  Branch (551:9): [True: 2.13k, False: 19.1k]
  ------------------
  552|       |            /* Type A complex filter, Q[p] = 12 */
  553|  2.13k|            channel_filter12(hyb, hyb->frame_len, p12_13_34, hyb->work, hyb->temp);
  554|  2.13k|            break;
  555|  21.2k|        }
  556|       |
  557|   681k|        for (n = 0; n < hyb->frame_len; n++)
  ------------------
  |  Branch (557:21): [True: 660k, False: 21.2k]
  ------------------
  558|   660k|        {
  559|  4.08M|            for (k = 0; k < resolution[band]; k++)
  ------------------
  |  Branch (559:25): [True: 3.42M, False: 660k]
  ------------------
  560|  3.42M|            {
  561|  3.42M|                QMF_RE(X_hybrid[n][offset + k]) = QMF_RE(hyb->temp[n][k]);
  ------------------
  |  |  168|  3.42M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.42M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X_hybrid[n][offset + k]) = QMF_RE(hyb->temp[n][k]);
  ------------------
  |  |  168|  3.42M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.42M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  562|  3.42M|                QMF_IM(X_hybrid[n][offset + k]) = QMF_IM(hyb->temp[n][k]);
  ------------------
  |  |  169|  3.42M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.42M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X_hybrid[n][offset + k]) = QMF_IM(hyb->temp[n][k]);
  ------------------
  |  |  169|  3.42M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.42M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  563|  3.42M|            }
  564|   660k|        }
  565|  21.2k|        offset += resolution[band];
  566|  21.2k|    }
  567|       |
  568|       |    /* group hybrid channels */
  569|  5.66k|    if (!use34)
  ------------------
  |  Branch (569:9): [True: 3.53k, False: 2.13k]
  ------------------
  570|  3.53k|    {
  571|   114k|        for (n = 0; n < numTimeSlotsRate; n++)
  ------------------
  |  Branch (571:21): [True: 110k, False: 3.53k]
  ------------------
  572|   110k|        {
  573|   110k|            QMF_RE(X_hybrid[n][3]) += QMF_RE(X_hybrid[n][4]);
  ------------------
  |  |  168|   110k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   110k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(X_hybrid[n][3]) += QMF_RE(X_hybrid[n][4]);
  ------------------
  |  |  168|   110k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   110k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  574|   110k|            QMF_IM(X_hybrid[n][3]) += QMF_IM(X_hybrid[n][4]);
  ------------------
  |  |  169|   110k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   110k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(X_hybrid[n][3]) += QMF_IM(X_hybrid[n][4]);
  ------------------
  |  |  169|   110k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   110k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  575|   110k|            QMF_RE(X_hybrid[n][4]) = 0;
  ------------------
  |  |  168|   110k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   110k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  576|   110k|            QMF_IM(X_hybrid[n][4]) = 0;
  ------------------
  |  |  169|   110k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   110k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  577|       |
  578|   110k|            QMF_RE(X_hybrid[n][2]) += QMF_RE(X_hybrid[n][5]);
  ------------------
  |  |  168|   110k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   110k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(X_hybrid[n][2]) += QMF_RE(X_hybrid[n][5]);
  ------------------
  |  |  168|   110k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   110k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  579|   110k|            QMF_IM(X_hybrid[n][2]) += QMF_IM(X_hybrid[n][5]);
  ------------------
  |  |  169|   110k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   110k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(X_hybrid[n][2]) += QMF_IM(X_hybrid[n][5]);
  ------------------
  |  |  169|   110k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   110k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  580|   110k|            QMF_RE(X_hybrid[n][5]) = 0;
  ------------------
  |  |  168|   110k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   110k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  581|   110k|            QMF_IM(X_hybrid[n][5]) = 0;
  ------------------
  |  |  169|   110k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   110k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  582|   110k|        }
  583|  3.53k|    }
  584|  5.66k|}
ps_dec.c:channel_filter2:
  264|  7.06k|{
  265|  7.06k|    uint8_t i;
  266|  7.06k|    (void)hyb;  /* TODO: remove parameter? */
  267|       |
  268|   228k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (268:17): [True: 221k, False: 7.06k]
  ------------------
  269|   221k|    {
  270|   221k|        real_t r0 = MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  271|   221k|        real_t r1 = MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  272|   221k|        real_t r2 = MUL_F(filter[2],(QMF_RE(buffer[2+i]) + QMF_RE(buffer[10+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  273|   221k|        real_t r3 = MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  274|   221k|        real_t r4 = MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  275|   221k|        real_t r5 = MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  276|   221k|        real_t r6 = MUL_F(filter[6],QMF_RE(buffer[6+i]));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  277|   221k|        real_t i0 = MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  278|   221k|        real_t i1 = MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  279|   221k|        real_t i2 = MUL_F(filter[2],(QMF_IM(buffer[2+i]) + QMF_IM(buffer[10+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  280|   221k|        real_t i3 = MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  281|   221k|        real_t i4 = MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  282|   221k|        real_t i5 = MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  283|   221k|        real_t i6 = MUL_F(filter[6],QMF_IM(buffer[6+i]));
  ------------------
  |  |  286|   221k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  284|       |
  285|       |        /* q = 0 */
  286|   221k|        QMF_RE(X_hybrid[i][0]) = r0 + r1 + r2 + r3 + r4 + r5 + r6;
  ------------------
  |  |  168|   221k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   221k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  287|   221k|        QMF_IM(X_hybrid[i][0]) = i0 + i1 + i2 + i3 + i4 + i5 + i6;
  ------------------
  |  |  169|   221k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   221k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  288|       |
  289|       |        /* q = 1 */
  290|   221k|        QMF_RE(X_hybrid[i][1]) = r0 - r1 + r2 - r3 + r4 - r5 + r6;
  ------------------
  |  |  168|   221k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   221k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  291|   221k|        QMF_IM(X_hybrid[i][1]) = i0 - i1 + i2 - i3 + i4 - i5 + i6;
  ------------------
  |  |  169|   221k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   221k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  292|   221k|    }
  293|  7.06k|}
ps_dec.c:channel_filter4:
  298|  6.39k|{
  299|  6.39k|    uint8_t i;
  300|  6.39k|    real_t input_re1[2], input_re2[2], input_im1[2], input_im2[2];
  301|  6.39k|    (void)hyb;  /* TODO: remove parameter? */
  302|       |
  303|   203k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (303:17): [True: 196k, False: 6.39k]
  ------------------
  304|   196k|    {
  305|   196k|        input_re1[0] = -MUL_F(filter[2], (QMF_RE(buffer[i+2]) + QMF_RE(buffer[i+10]))) +
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  306|   196k|            MUL_F(filter[6], QMF_RE(buffer[i+6]));
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  307|   196k|        input_re1[1] = MUL_F(FRAC_CONST(-0.70710678118655),
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  308|   196k|            (MUL_F(filter[1], (QMF_RE(buffer[i+1]) + QMF_RE(buffer[i+11]))) +
  309|   196k|            MUL_F(filter[3], (QMF_RE(buffer[i+3]) + QMF_RE(buffer[i+9]))) -
  310|   196k|            MUL_F(filter[5], (QMF_RE(buffer[i+5]) + QMF_RE(buffer[i+7])))));
  311|       |
  312|   196k|        input_im1[0] = MUL_F(filter[0], (QMF_IM(buffer[i+0]) - QMF_IM(buffer[i+12]))) -
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  313|   196k|            MUL_F(filter[4], (QMF_IM(buffer[i+4]) - QMF_IM(buffer[i+8])));
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  314|   196k|        input_im1[1] = MUL_F(FRAC_CONST(0.70710678118655),
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  315|   196k|            (MUL_F(filter[1], (QMF_IM(buffer[i+1]) - QMF_IM(buffer[i+11]))) -
  316|   196k|            MUL_F(filter[3], (QMF_IM(buffer[i+3]) - QMF_IM(buffer[i+9]))) -
  317|   196k|            MUL_F(filter[5], (QMF_IM(buffer[i+5]) - QMF_IM(buffer[i+7])))));
  318|       |
  319|   196k|        input_re2[0] = MUL_F(filter[0], (QMF_RE(buffer[i+0]) - QMF_RE(buffer[i+12]))) -
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  320|   196k|            MUL_F(filter[4], (QMF_RE(buffer[i+4]) - QMF_RE(buffer[i+8])));
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  321|   196k|        input_re2[1] = MUL_F(FRAC_CONST(0.70710678118655),
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  322|   196k|            (MUL_F(filter[1], (QMF_RE(buffer[i+1]) - QMF_RE(buffer[i+11]))) -
  323|   196k|            MUL_F(filter[3], (QMF_RE(buffer[i+3]) - QMF_RE(buffer[i+9]))) -
  324|   196k|            MUL_F(filter[5], (QMF_RE(buffer[i+5]) - QMF_RE(buffer[i+7])))));
  325|       |
  326|   196k|        input_im2[0] = -MUL_F(filter[2], (QMF_IM(buffer[i+2]) + QMF_IM(buffer[i+10]))) +
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  327|   196k|            MUL_F(filter[6], QMF_IM(buffer[i+6]));
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  328|   196k|        input_im2[1] = MUL_F(FRAC_CONST(-0.70710678118655),
  ------------------
  |  |  286|   196k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  329|   196k|            (MUL_F(filter[1], (QMF_IM(buffer[i+1]) + QMF_IM(buffer[i+11]))) +
  330|   196k|            MUL_F(filter[3], (QMF_IM(buffer[i+3]) + QMF_IM(buffer[i+9]))) -
  331|   196k|            MUL_F(filter[5], (QMF_IM(buffer[i+5]) + QMF_IM(buffer[i+7])))));
  332|       |
  333|       |        /* q == 0 */
  334|   196k|        QMF_RE(X_hybrid[i][0]) =  input_re1[0] + input_re1[1] + input_im1[0] + input_im1[1];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  335|   196k|        QMF_IM(X_hybrid[i][0]) = -input_re2[0] - input_re2[1] + input_im2[0] + input_im2[1];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  336|       |
  337|       |        /* q == 1 */
  338|   196k|        QMF_RE(X_hybrid[i][1]) =  input_re1[0] - input_re1[1] - input_im1[0] + input_im1[1];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  339|   196k|        QMF_IM(X_hybrid[i][1]) =  input_re2[0] - input_re2[1] + input_im2[0] - input_im2[1];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  340|       |
  341|       |        /* q == 2 */
  342|   196k|        QMF_RE(X_hybrid[i][2]) =  input_re1[0] - input_re1[1] + input_im1[0] - input_im1[1];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  343|   196k|        QMF_IM(X_hybrid[i][2]) = -input_re2[0] + input_re2[1] + input_im2[0] - input_im2[1];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  344|       |
  345|       |        /* q == 3 */
  346|   196k|        QMF_RE(X_hybrid[i][3]) =  input_re1[0] + input_re1[1] - input_im1[0] - input_im1[1];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  347|   196k|        QMF_IM(X_hybrid[i][3]) =  input_re2[0] + input_re2[1] + input_im2[0] + input_im2[1];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  348|   196k|    }
  349|  6.39k|}
ps_dec.c:channel_filter8:
  373|  5.66k|{
  374|  5.66k|    uint8_t i, n;
  375|  5.66k|    real_t input_re1[4], input_re2[4], input_im1[4], input_im2[4];
  376|  5.66k|    real_t x[4];
  377|  5.66k|    (void)hyb;  /* TODO: remove parameter? */
  378|       |
  379|   181k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (379:17): [True: 176k, False: 5.66k]
  ------------------
  380|   176k|    {
  381|   176k|        input_re1[0] =  MUL_F(filter[6],QMF_RE(buffer[6+i]));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  382|   176k|        input_re1[1] =  MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  383|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  384|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  385|       |
  386|   176k|        input_im1[0] = MUL_F(filter[5],(QMF_IM(buffer[7+i]) - QMF_IM(buffer[5+i])));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  387|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  388|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  389|   176k|        input_im1[3] = MUL_F(filter[2],(QMF_IM(buffer[10+i]) - QMF_IM(buffer[2+i])));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  390|       |
  391|   881k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (391:21): [True: 705k, False: 176k]
  ------------------
  392|   705k|        {
  393|   705k|            x[n] = input_re1[n] - input_im1[3-n];
  394|   705k|        }
  395|   176k|        DCT3_4_unscaled(x, x);
  396|   176k|        QMF_RE(X_hybrid[i][7]) = x[0];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  397|   176k|        QMF_RE(X_hybrid[i][5]) = x[2];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  398|   176k|        QMF_RE(X_hybrid[i][3]) = x[3];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  399|   176k|        QMF_RE(X_hybrid[i][1]) = x[1];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  400|       |
  401|   881k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (401:21): [True: 705k, False: 176k]
  ------------------
  402|   705k|        {
  403|   705k|            x[n] = input_re1[n] + input_im1[3-n];
  404|   705k|        }
  405|   176k|        DCT3_4_unscaled(x, x);
  406|   176k|        QMF_RE(X_hybrid[i][6]) = x[1];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  407|   176k|        QMF_RE(X_hybrid[i][4]) = x[3];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  408|   176k|        QMF_RE(X_hybrid[i][2]) = x[2];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  409|   176k|        QMF_RE(X_hybrid[i][0]) = x[0];
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  410|       |
  411|   176k|        input_im2[0] =  MUL_F(filter[6],QMF_IM(buffer[6+i]));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  412|   176k|        input_im2[1] =  MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  413|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  414|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  415|       |
  416|   176k|        input_re2[0] = MUL_F(filter[5],(QMF_RE(buffer[7+i]) - QMF_RE(buffer[5+i])));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  417|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  418|   176k|        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|   176k|  #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|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  419|   176k|        input_re2[3] = MUL_F(filter[2],(QMF_RE(buffer[10+i]) - QMF_RE(buffer[2+i])));
  ------------------
  |  |  286|   176k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  420|       |
  421|   881k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (421:21): [True: 705k, False: 176k]
  ------------------
  422|   705k|        {
  423|   705k|            x[n] = input_im2[n] + input_re2[3-n];
  424|   705k|        }
  425|   176k|        DCT3_4_unscaled(x, x);
  426|   176k|        QMF_IM(X_hybrid[i][7]) = x[0];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  427|   176k|        QMF_IM(X_hybrid[i][5]) = x[2];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  428|   176k|        QMF_IM(X_hybrid[i][3]) = x[3];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  429|   176k|        QMF_IM(X_hybrid[i][1]) = x[1];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  430|       |
  431|   881k|        for (n = 0; n < 4; n++)
  ------------------
  |  Branch (431:21): [True: 705k, False: 176k]
  ------------------
  432|   705k|        {
  433|   705k|            x[n] = input_im2[n] - input_re2[3-n];
  434|   705k|        }
  435|   176k|        DCT3_4_unscaled(x, x);
  436|   176k|        QMF_IM(X_hybrid[i][6]) = x[1];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  437|   176k|        QMF_IM(X_hybrid[i][4]) = x[3];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  438|   176k|        QMF_IM(X_hybrid[i][2]) = x[2];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  439|   176k|        QMF_IM(X_hybrid[i][0]) = x[0];
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  440|   176k|    }
  441|  5.66k|}
ps_dec.c:DCT3_4_unscaled:
  352|   705k|{
  353|   705k|    real_t f0, f1, f2, f3, f4, f5, f6, f7, f8;
  354|       |
  355|   705k|    f0 = MUL_F(x[2], FRAC_CONST(0.7071067811865476));
  ------------------
  |  |  286|   705k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  356|   705k|    f1 = x[0] - f0;
  357|   705k|    f2 = x[0] + f0;
  358|   705k|    f3 = x[1] + x[3];
  359|   705k|    f4 = MUL_C(x[1], COEF_CONST(1.3065629648763766));
  ------------------
  |  |  285|   705k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  360|   705k|    f5 = MUL_F(f3, FRAC_CONST(-0.9238795325112866));
  ------------------
  |  |  286|   705k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  361|   705k|    f6 = MUL_F(x[3], FRAC_CONST(-0.5411961001461967));
  ------------------
  |  |  286|   705k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  362|   705k|    f7 = f4 + f5;
  363|   705k|    f8 = f6 - f5;
  364|   705k|    y[3] = f2 - f8;
  365|   705k|    y[0] = f2 + f8;
  366|   705k|    y[2] = f1 - f7;
  367|   705k|    y[1] = f1 + f7;
  368|   705k|}
ps_dec.c:channel_filter12:
  466|  2.13k|{
  467|  2.13k|    uint8_t i, n;
  468|  2.13k|    real_t input_re1[6], input_re2[6], input_im1[6], input_im2[6];
  469|  2.13k|    real_t out_re1[6], out_re2[6], out_im1[6], out_im2[6];
  470|  2.13k|    (void)hyb;  /* TODO: remove parameter? */
  471|       |
  472|  67.7k|    for (i = 0; i < frame_len; i++)
  ------------------
  |  Branch (472:17): [True: 65.6k, False: 2.13k]
  ------------------
  473|  65.6k|    {
  474|   459k|        for (n = 0; n < 6; n++)
  ------------------
  |  Branch (474:21): [True: 393k, False: 65.6k]
  ------------------
  475|   393k|        {
  476|   393k|            if (n == 0)
  ------------------
  |  Branch (476:17): [True: 65.6k, False: 328k]
  ------------------
  477|  65.6k|            {
  478|  65.6k|                input_re1[0] = MUL_F(QMF_RE(buffer[6+i]), filter[6]);
  ------------------
  |  |  286|  65.6k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  479|  65.6k|                input_re2[0] = MUL_F(QMF_IM(buffer[6+i]), filter[6]);
  ------------------
  |  |  286|  65.6k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  480|   328k|            } else {
  481|   328k|                input_re1[6-n] = MUL_F((QMF_RE(buffer[n+i]) + QMF_RE(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   328k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  482|   328k|                input_re2[6-n] = MUL_F((QMF_IM(buffer[n+i]) + QMF_IM(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   328k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  483|   328k|            }
  484|   393k|            input_im2[n] = MUL_F((QMF_RE(buffer[n+i]) - QMF_RE(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   393k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  485|   393k|            input_im1[n] = MUL_F((QMF_IM(buffer[n+i]) - QMF_IM(buffer[12-n+i])), filter[n]);
  ------------------
  |  |  286|   393k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  486|   393k|        }
  487|       |
  488|  65.6k|        DCT3_6_unscaled(out_re1, input_re1);
  489|  65.6k|        DCT3_6_unscaled(out_re2, input_re2);
  490|       |
  491|  65.6k|        DCT3_6_unscaled(out_im1, input_im1);
  492|  65.6k|        DCT3_6_unscaled(out_im2, input_im2);
  493|       |
  494|   262k|        for (n = 0; n < 6; n += 2)
  ------------------
  |  Branch (494:21): [True: 196k, False: 65.6k]
  ------------------
  495|   196k|        {
  496|   196k|            QMF_RE(X_hybrid[i][n]) = out_re1[n] - out_im1[n];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  497|   196k|            QMF_IM(X_hybrid[i][n]) = out_re2[n] + out_im2[n];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  498|   196k|            QMF_RE(X_hybrid[i][n+1]) = out_re1[n+1] + out_im1[n+1];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  499|   196k|            QMF_IM(X_hybrid[i][n+1]) = out_re2[n+1] - out_im2[n+1];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  500|       |
  501|   196k|            QMF_RE(X_hybrid[i][10-n]) = out_re1[n+1] - out_im1[n+1];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  502|   196k|            QMF_IM(X_hybrid[i][10-n]) = out_re2[n+1] + out_im2[n+1];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  503|   196k|            QMF_RE(X_hybrid[i][11-n]) = out_re1[n] + out_im1[n];
  ------------------
  |  |  168|   196k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   196k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  504|   196k|            QMF_IM(X_hybrid[i][11-n]) = out_re2[n] - out_im2[n];
  ------------------
  |  |  169|   196k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   196k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  505|   196k|        }
  506|  65.6k|    }
  507|  2.13k|}
ps_dec.c:DCT3_6_unscaled:
  444|   262k|{
  445|   262k|    real_t f0, f1, f2, f3, f4, f5, f6, f7;
  446|       |
  447|   262k|    f0 = MUL_F(x[3], FRAC_CONST(0.70710678118655));
  ------------------
  |  |  286|   262k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  448|   262k|    f1 = x[0] + f0;
  449|   262k|    f2 = x[0] - f0;
  450|   262k|    f3 = MUL_F((x[1] - x[5]), FRAC_CONST(0.70710678118655));
  ------------------
  |  |  286|   262k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  451|   262k|    f4 = MUL_F(x[2], FRAC_CONST(0.86602540378444)) + MUL_F(x[4], FRAC_CONST(0.5));
  ------------------
  |  |  286|   262k|  #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|   262k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  452|   262k|    f5 = f4 - x[4];
  453|   262k|    f6 = MUL_F(x[1], FRAC_CONST(0.96592582628907)) + MUL_F(x[5], FRAC_CONST(0.25881904510252));
  ------------------
  |  |  286|   262k|  #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|   262k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  454|   262k|    f7 = f6 - f3;
  455|   262k|    y[0] = f1 + f6 + f4;
  456|   262k|    y[1] = f2 + f3 - x[4];
  457|   262k|    y[2] = f7 + f2 - f5;
  458|   262k|    y[3] = f1 - f7 - f5;
  459|   262k|    y[4] = f1 - f3 - x[4];
  460|   262k|    y[5] = f2 - f6 + f4;
  461|   262k|}
ps_dec.c:ps_decorrelate:
 1041|  5.66k|{
 1042|  5.66k|    uint8_t gr, n, bk;
 1043|  5.66k|    uint8_t temp_delay = 0;
 1044|  5.66k|    uint8_t sb, maxsb;
 1045|  5.66k|    const complex_t *Phi_Fract_SubQmf;
 1046|  5.66k|    uint8_t temp_delay_ser[NO_ALLPASS_LINKS];
 1047|  5.66k|    real_t P_SmoothPeakDecayDiffNrg, nrg;
 1048|  5.66k|    real_t P[32][34];
 1049|  5.66k|    real_t G_TransientRatio[32][34] = {{0}};
 1050|  5.66k|    complex_t inputLeft;
 1051|       |
 1052|       |
 1053|       |    /* chose hybrid filterbank: 20 or 34 band case */
 1054|  5.66k|    if (ps->use34hybrid_bands)
  ------------------
  |  Branch (1054:9): [True: 2.13k, False: 3.53k]
  ------------------
 1055|  2.13k|    {
 1056|  2.13k|        Phi_Fract_SubQmf = Phi_Fract_SubQmf34;
 1057|  3.53k|    } else{
 1058|  3.53k|        Phi_Fract_SubQmf = Phi_Fract_SubQmf20;
 1059|  3.53k|    }
 1060|       |
 1061|       |    /* clear the energy values */
 1062|   186k|    for (n = 0; n < 32; n++)
  ------------------
  |  Branch (1062:17): [True: 181k, False: 5.66k]
  ------------------
 1063|   181k|    {
 1064|  6.34M|        for (bk = 0; bk < 34; bk++)
  ------------------
  |  Branch (1064:22): [True: 6.16M, False: 181k]
  ------------------
 1065|  6.16M|        {
 1066|  6.16M|            P[n][bk] = 0;
 1067|  6.16M|        }
 1068|   181k|    }
 1069|       |
 1070|       |    /* calculate the energy in each parameter band b(k) */
 1071|   189k|    for (gr = 0; gr < ps->num_groups; gr++)
  ------------------
  |  Branch (1071:18): [True: 184k, False: 5.66k]
  ------------------
 1072|   184k|    {
 1073|       |        /* select the parameter index b(k) to which this group belongs */
 1074|   184k|        bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
  ------------------
  |  |   41|   184k|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
 1075|       |
 1076|       |        /* select the upper subband border for this group */
 1077|   184k|        maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr]+1 : ps->group_border[gr+1];
  ------------------
  |  Branch (1077:17): [True: 103k, False: 80.7k]
  ------------------
 1078|       |
 1079|   629k|        for (sb = ps->group_border[gr]; sb < maxsb; sb++)
  ------------------
  |  Branch (1079:41): [True: 444k, False: 184k]
  ------------------
 1080|   444k|        {
 1081|  14.3M|            for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
  ------------------
  |  Branch (1081:46): [True: 13.8M, False: 444k]
  ------------------
 1082|  13.8M|            {
 1083|       |#ifdef FIXED_POINT
 1084|       |                uint32_t in_re, in_im;
 1085|       |#endif
 1086|       |
 1087|       |                /* input from hybrid subbands or QMF subbands */
 1088|  13.8M|                if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1088:21): [True: 3.21M, False: 10.6M]
  ------------------
 1089|  3.21M|                {
 1090|  3.21M|                    RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  168|  3.21M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.21M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1091|  3.21M|                    IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  169|  3.21M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.21M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1092|  10.6M|                } else {
 1093|  10.6M|                    RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  168|  10.6M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  10.6M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1094|  10.6M|                    IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  169|  10.6M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  10.6M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1095|  10.6M|                }
 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.8M|                P[n][bk] += MUL_R(RE(inputLeft),RE(inputLeft)) + MUL_R(IM(inputLeft),IM(inputLeft));
  ------------------
  |  |  284|  13.8M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
                              P[n][bk] += MUL_R(RE(inputLeft),RE(inputLeft)) + MUL_R(IM(inputLeft),IM(inputLeft));
  ------------------
  |  |  284|  13.8M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1107|  13.8M|#endif
 1108|  13.8M|            }
 1109|   444k|        }
 1110|   184k|    }
 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|   148k|    for (bk = 0; bk < ps->nr_par_bands; bk++)
  ------------------
  |  Branch (1127:18): [True: 143k, False: 5.66k]
  ------------------
 1128|   143k|    {
 1129|  4.60M|        for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
  ------------------
  |  Branch (1129:42): [True: 4.46M, False: 143k]
  ------------------
 1130|  4.46M|        {
 1131|  4.46M|            const real_t gamma = COEF_CONST(1.5);
  ------------------
  |  |  289|  4.46M|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
 1132|       |
 1133|  4.46M|            ps->P_PeakDecayNrg[bk] = MUL_F(ps->P_PeakDecayNrg[bk], ps->alpha_decay);
  ------------------
  |  |  286|  4.46M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1134|  4.46M|            if (ps->P_PeakDecayNrg[bk] < P[n][bk])
  ------------------
  |  Branch (1134:17): [True: 95.6k, False: 4.36M]
  ------------------
 1135|  95.6k|                ps->P_PeakDecayNrg[bk] = P[n][bk];
 1136|       |
 1137|       |            /* apply smoothing filter to peak decay energy */
 1138|  4.46M|            P_SmoothPeakDecayDiffNrg = ps->P_SmoothPeakDecayDiffNrg_prev[bk];
 1139|  4.46M|            P_SmoothPeakDecayDiffNrg += MUL_F((ps->P_PeakDecayNrg[bk] - P[n][bk] - ps->P_SmoothPeakDecayDiffNrg_prev[bk]), ps->alpha_smooth);
  ------------------
  |  |  286|  4.46M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1140|  4.46M|            ps->P_SmoothPeakDecayDiffNrg_prev[bk] = P_SmoothPeakDecayDiffNrg;
 1141|       |
 1142|       |            /* apply smoothing filter to energy */
 1143|  4.46M|            nrg = ps->P_prev[bk];
 1144|  4.46M|            nrg += MUL_F((P[n][bk] - ps->P_prev[bk]), ps->alpha_smooth);
  ------------------
  |  |  286|  4.46M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1145|  4.46M|            ps->P_prev[bk] = nrg;
 1146|       |
 1147|       |            /* calculate transient ratio */
 1148|  4.46M|            if (MUL_C(P_SmoothPeakDecayDiffNrg, gamma) <= nrg)
  ------------------
  |  |  285|  4.46M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  |  Branch (1148:17): [True: 4.39M, False: 67.6k]
  ------------------
 1149|  4.39M|            {
 1150|  4.39M|                G_TransientRatio[n][bk] = REAL_CONST(1.0);
  ------------------
  |  |  288|  4.39M|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
 1151|  4.39M|            } else {
 1152|  67.6k|                G_TransientRatio[n][bk] = DIV_R(nrg, (MUL_C(P_SmoothPeakDecayDiffNrg, gamma)));
  ------------------
  |  |  161|  67.6k|#define DIV_R(A, B) ((A)/(B))
  ------------------
 1153|  67.6k|            }
 1154|  4.46M|        }
 1155|   143k|    }
 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|   189k|    for (gr = 0; gr < ps->num_groups; gr++)
  ------------------
  |  Branch (1172:18): [True: 184k, False: 5.66k]
  ------------------
 1173|   184k|    {
 1174|   184k|        if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1174:13): [True: 103k, False: 80.7k]
  ------------------
 1175|   103k|            maxsb = ps->group_border[gr] + 1;
 1176|  80.7k|        else
 1177|  80.7k|            maxsb = ps->group_border[gr + 1];
 1178|       |
 1179|       |        /* QMF channel */
 1180|   629k|        for (sb = ps->group_border[gr]; sb < maxsb; sb++)
  ------------------
  |  Branch (1180:41): [True: 444k, False: 184k]
  ------------------
 1181|   444k|        {
 1182|   444k|            real_t g_DecaySlope;
 1183|   444k|            real_t g_DecaySlope_filt[NO_ALLPASS_LINKS];
 1184|       |
 1185|       |            /* g_DecaySlope: [0..1] */
 1186|   444k|            if (gr < ps->num_hybrid_groups || sb <= ps->decay_cutoff)
  ------------------
  |  Branch (1186:17): [True: 103k, False: 341k]
  |  Branch (1186:47): [True: 5.66k, False: 335k]
  ------------------
 1187|   109k|            {
 1188|   109k|                g_DecaySlope = FRAC_CONST(1.0);
  ------------------
  |  |  291|   109k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1189|   335k|            } else {
 1190|   335k|                int8_t decay = ps->decay_cutoff - sb;
 1191|   335k|                if (decay <= -20 /* -1/DECAY_SLOPE */)
  ------------------
  |  Branch (1191:21): [True: 227k, False: 107k]
  ------------------
 1192|   227k|                {
 1193|   227k|                    g_DecaySlope = 0;
 1194|   227k|                } else {
 1195|       |                    /* decay(int)*decay_slope(frac) = g_DecaySlope(frac) */
 1196|   107k|                    g_DecaySlope = FRAC_CONST(1.0) + DECAY_SLOPE * decay;
  ------------------
  |  |  291|   107k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
                                  g_DecaySlope = FRAC_CONST(1.0) + DECAY_SLOPE * decay;
  ------------------
  |  |   42|   107k|#define DECAY_SLOPE                FRAC_CONST(0.05)
  |  |  ------------------
  |  |  |  |  291|   107k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  |  |  ------------------
  ------------------
 1197|   107k|                }
 1198|   335k|            }
 1199|       |
 1200|       |            /* calculate g_DecaySlope_filt for every n multiplied by filter_a[n] */
 1201|  1.77M|            for (n = 0; n < NO_ALLPASS_LINKS; n++)
  ------------------
  |  |   43|  1.77M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1201:25): [True: 1.33M, False: 444k]
  ------------------
 1202|  1.33M|            {
 1203|  1.33M|                g_DecaySlope_filt[n] = MUL_F(g_DecaySlope, filter_a[n]);
  ------------------
  |  |  286|  1.33M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1204|  1.33M|            }
 1205|       |
 1206|       |
 1207|       |            /* set delay indices */
 1208|   444k|            temp_delay = ps->saved_delay;
 1209|  1.77M|            for (n = 0; n < NO_ALLPASS_LINKS; n++)
  ------------------
  |  |   43|  1.77M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1209:25): [True: 1.33M, False: 444k]
  ------------------
 1210|  1.33M|                temp_delay_ser[n] = ps->delay_buf_index_ser[n];
 1211|       |
 1212|  14.3M|            for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
  ------------------
  |  Branch (1212:46): [True: 13.8M, False: 444k]
  ------------------
 1213|  13.8M|            {
 1214|  13.8M|                complex_t tmp, tmp0, R0;
 1215|  13.8M|                uint8_t m;
 1216|       |
 1217|  13.8M|                if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1217:21): [True: 3.21M, False: 10.6M]
  ------------------
 1218|  3.21M|                {
 1219|       |                    /* hybrid filterbank input */
 1220|  3.21M|                    RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  168|  3.21M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.21M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1221|  3.21M|                    IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  169|  3.21M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.21M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1222|  10.6M|                } else {
 1223|       |                    /* QMF filterbank input */
 1224|  10.6M|                    RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
                                  RE(inputLeft) = QMF_RE(X_left[n][sb]);
  ------------------
  |  |  168|  10.6M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  10.6M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1225|  10.6M|                    IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
                                  IM(inputLeft) = QMF_IM(X_left[n][sb]);
  ------------------
  |  |  169|  10.6M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  10.6M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1226|  10.6M|                }
 1227|       |
 1228|  13.8M|                if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
  ------------------
  |  Branch (1228:21): [True: 7.85M, False: 6.03M]
  |  Branch (1228:50): [True: 7.26M, False: 591k]
  ------------------
 1229|  7.26M|                {
 1230|       |                    /* delay */
 1231|       |
 1232|       |                    /* never hybrid subbands here, always QMF subbands */
 1233|  7.26M|                    RE(tmp) = RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  391|  7.26M|#define RE(A) (A)[0]
  ------------------
                                  RE(tmp) = RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  391|  7.26M|#define RE(A) (A)[0]
  ------------------
 1234|  7.26M|                    IM(tmp) = IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  392|  7.26M|#define IM(A) (A)[1]
  ------------------
                                  IM(tmp) = IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
  ------------------
  |  |  392|  7.26M|#define IM(A) (A)[1]
  ------------------
 1235|  7.26M|                    RE(R0) = RE(tmp);
  ------------------
  |  |  391|  7.26M|#define RE(A) (A)[0]
  ------------------
                                  RE(R0) = RE(tmp);
  ------------------
  |  |  391|  7.26M|#define RE(A) (A)[0]
  ------------------
 1236|  7.26M|                    IM(R0) = IM(tmp);
  ------------------
  |  |  392|  7.26M|#define IM(A) (A)[1]
  ------------------
                                  IM(R0) = IM(tmp);
  ------------------
  |  |  392|  7.26M|#define IM(A) (A)[1]
  ------------------
 1237|  7.26M|                    RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  7.26M|#define RE(A) (A)[0]
  ------------------
                                  RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  7.26M|#define RE(A) (A)[0]
  ------------------
 1238|  7.26M|                    IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  7.26M|#define IM(A) (A)[1]
  ------------------
                                  IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  7.26M|#define IM(A) (A)[1]
  ------------------
 1239|  7.26M|                } else {
 1240|       |                    /* allpass filter */
 1241|  6.63M|                    complex_t Phi_Fract;
 1242|       |
 1243|       |                    /* fetch parameters */
 1244|  6.63M|                    if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1244:25): [True: 3.21M, False: 3.41M]
  ------------------
 1245|  3.21M|                    {
 1246|       |                        /* select data from the hybrid subbands */
 1247|  3.21M|                        RE(tmp0) = RE(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp0) = RE(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1248|  3.21M|                        IM(tmp0) = IM(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp0) = IM(ps->delay_SubQmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1249|       |
 1250|  3.21M|                        RE(ps->delay_SubQmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(ps->delay_SubQmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1251|  3.21M|                        IM(ps->delay_SubQmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(ps->delay_SubQmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1252|       |
 1253|  3.21M|                        RE(Phi_Fract) = RE(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(Phi_Fract) = RE(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1254|  3.21M|                        IM(Phi_Fract) = IM(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(Phi_Fract) = IM(Phi_Fract_SubQmf[sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1255|  3.41M|                    } else {
 1256|       |                        /* select data from the QMF subbands */
 1257|  3.41M|                        RE(tmp0) = RE(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.41M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp0) = RE(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  391|  3.41M|#define RE(A) (A)[0]
  ------------------
 1258|  3.41M|                        IM(tmp0) = IM(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.41M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp0) = IM(ps->delay_Qmf[temp_delay][sb]);
  ------------------
  |  |  392|  3.41M|#define IM(A) (A)[1]
  ------------------
 1259|       |
 1260|  3.41M|                        RE(ps->delay_Qmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.41M|#define RE(A) (A)[0]
  ------------------
                                      RE(ps->delay_Qmf[temp_delay][sb]) = RE(inputLeft);
  ------------------
  |  |  391|  3.41M|#define RE(A) (A)[0]
  ------------------
 1261|  3.41M|                        IM(ps->delay_Qmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.41M|#define IM(A) (A)[1]
  ------------------
                                      IM(ps->delay_Qmf[temp_delay][sb]) = IM(inputLeft);
  ------------------
  |  |  392|  3.41M|#define IM(A) (A)[1]
  ------------------
 1262|       |
 1263|  3.41M|                        RE(Phi_Fract) = RE(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  391|  3.41M|#define RE(A) (A)[0]
  ------------------
                                      RE(Phi_Fract) = RE(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  391|  3.41M|#define RE(A) (A)[0]
  ------------------
 1264|  3.41M|                        IM(Phi_Fract) = IM(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  392|  3.41M|#define IM(A) (A)[1]
  ------------------
                                      IM(Phi_Fract) = IM(Phi_Fract_Qmf[sb]);
  ------------------
  |  |  392|  3.41M|#define IM(A) (A)[1]
  ------------------
 1265|  3.41M|                    }
 1266|       |
 1267|       |                    /* z^(-2) * Phi_Fract[k] */
 1268|  6.63M|                    ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|  6.63M|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|  6.63M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|  6.63M|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|  6.63M|#define IM(A) (A)[1]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  391|  6.63M|#define RE(A) (A)[0]
  ------------------
                                  ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
  ------------------
  |  |  392|  6.63M|#define IM(A) (A)[1]
  ------------------
 1269|       |
 1270|  6.63M|                    RE(R0) = RE(tmp);
  ------------------
  |  |  391|  6.63M|#define RE(A) (A)[0]
  ------------------
                                  RE(R0) = RE(tmp);
  ------------------
  |  |  391|  6.63M|#define RE(A) (A)[0]
  ------------------
 1271|  6.63M|                    IM(R0) = IM(tmp);
  ------------------
  |  |  392|  6.63M|#define IM(A) (A)[1]
  ------------------
                                  IM(R0) = IM(tmp);
  ------------------
  |  |  392|  6.63M|#define IM(A) (A)[1]
  ------------------
 1272|  26.5M|                    for (m = 0; m < NO_ALLPASS_LINKS; m++)
  ------------------
  |  |   43|  26.5M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1272:33): [True: 19.8M, False: 6.63M]
  ------------------
 1273|  19.8M|                    {
 1274|  19.8M|                        complex_t Q_Fract_allpass, tmp2;
 1275|       |
 1276|       |                        /* fetch parameters */
 1277|  19.8M|                        if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1277:29): [True: 9.65M, False: 10.2M]
  ------------------
 1278|  9.65M|                        {
 1279|       |                            /* select data from the hybrid subbands */
 1280|  9.65M|                            RE(tmp0) = RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  9.65M|#define RE(A) (A)[0]
  ------------------
                                          RE(tmp0) = RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  9.65M|#define RE(A) (A)[0]
  ------------------
 1281|  9.65M|                            IM(tmp0) = IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  9.65M|#define IM(A) (A)[1]
  ------------------
                                          IM(tmp0) = IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  9.65M|#define IM(A) (A)[1]
  ------------------
 1282|       |
 1283|  9.65M|                            if (ps->use34hybrid_bands)
  ------------------
  |  Branch (1283:33): [True: 6.30M, False: 3.34M]
  ------------------
 1284|  6.30M|                            {
 1285|  6.30M|                                RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
                                              RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  391|  6.30M|#define RE(A) (A)[0]
  ------------------
 1286|  6.30M|                                IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
                                              IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf34[sb][m]);
  ------------------
  |  |  392|  6.30M|#define IM(A) (A)[1]
  ------------------
 1287|  6.30M|                            } else {
 1288|  3.34M|                                RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  391|  3.34M|#define RE(A) (A)[0]
  ------------------
                                              RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  391|  3.34M|#define RE(A) (A)[0]
  ------------------
 1289|  3.34M|                                IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  392|  3.34M|#define IM(A) (A)[1]
  ------------------
                                              IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf20[sb][m]);
  ------------------
  |  |  392|  3.34M|#define IM(A) (A)[1]
  ------------------
 1290|  3.34M|                            }
 1291|  10.2M|                        } else {
 1292|       |                            /* select data from the QMF subbands */
 1293|  10.2M|                            RE(tmp0) = RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  10.2M|#define RE(A) (A)[0]
  ------------------
                                          RE(tmp0) = RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  391|  10.2M|#define RE(A) (A)[0]
  ------------------
 1294|  10.2M|                            IM(tmp0) = IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  10.2M|#define IM(A) (A)[1]
  ------------------
                                          IM(tmp0) = IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
  ------------------
  |  |  392|  10.2M|#define IM(A) (A)[1]
  ------------------
 1295|       |
 1296|  10.2M|                            RE(Q_Fract_allpass) = RE(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  391|  10.2M|#define RE(A) (A)[0]
  ------------------
                                          RE(Q_Fract_allpass) = RE(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  391|  10.2M|#define RE(A) (A)[0]
  ------------------
 1297|  10.2M|                            IM(Q_Fract_allpass) = IM(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  392|  10.2M|#define IM(A) (A)[1]
  ------------------
                                          IM(Q_Fract_allpass) = IM(Q_Fract_allpass_Qmf[sb][m]);
  ------------------
  |  |  392|  10.2M|#define IM(A) (A)[1]
  ------------------
 1298|  10.2M|                        }
 1299|       |
 1300|       |                        /* delay by a fraction */
 1301|       |                        /* z^(-d(m)) * Q_Fract_allpass[k,m] */
 1302|  19.8M|                        ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
 1303|       |
 1304|       |                        /* -a(m) * g_DecaySlope[k] */
 1305|  19.8M|                        RE(tmp) += -MUL_F(g_DecaySlope_filt[m], RE(R0));
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp) += -MUL_F(g_DecaySlope_filt[m], RE(R0));
  ------------------
  |  |  286|  19.8M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1306|  19.8M|                        IM(tmp) += -MUL_F(g_DecaySlope_filt[m], IM(R0));
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp) += -MUL_F(g_DecaySlope_filt[m], IM(R0));
  ------------------
  |  |  286|  19.8M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1307|       |
 1308|       |                        /* -a(m) * g_DecaySlope[k] * Q_Fract_allpass[k,m] * z^(-d(m)) */
 1309|  19.8M|                        RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
  ------------------
  |  |  286|  19.8M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1310|  19.8M|                        IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
                                      IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
  ------------------
  |  |  286|  19.8M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1311|       |
 1312|       |                        /* store sample */
 1313|  19.8M|                        if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1313:29): [True: 9.65M, False: 10.2M]
  ------------------
 1314|  9.65M|                        {
 1315|  9.65M|                            RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  9.65M|#define RE(A) (A)[0]
  ------------------
                                          RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  9.65M|#define RE(A) (A)[0]
  ------------------
 1316|  9.65M|                            IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  9.65M|#define IM(A) (A)[1]
  ------------------
                                          IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  9.65M|#define IM(A) (A)[1]
  ------------------
 1317|  10.2M|                        } else {
 1318|  10.2M|                            RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  10.2M|#define RE(A) (A)[0]
  ------------------
                                          RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
  ------------------
  |  |  391|  10.2M|#define RE(A) (A)[0]
  ------------------
 1319|  10.2M|                            IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  10.2M|#define IM(A) (A)[1]
  ------------------
                                          IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
  ------------------
  |  |  392|  10.2M|#define IM(A) (A)[1]
  ------------------
 1320|  10.2M|                        }
 1321|       |
 1322|       |                        /* store for next iteration (or as output value if last iteration) */
 1323|  19.8M|                        RE(R0) = RE(tmp);
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
                                      RE(R0) = RE(tmp);
  ------------------
  |  |  391|  19.8M|#define RE(A) (A)[0]
  ------------------
 1324|  19.8M|                        IM(R0) = IM(tmp);
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
                                      IM(R0) = IM(tmp);
  ------------------
  |  |  392|  19.8M|#define IM(A) (A)[1]
  ------------------
 1325|  19.8M|                    }
 1326|  6.63M|                }
 1327|       |
 1328|       |                /* select b(k) for reading the transient ratio */
 1329|  13.8M|                bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
  ------------------
  |  |   41|  13.8M|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
 1330|       |
 1331|       |                /* duck if a past transient is found */
 1332|  13.8M|                RE(R0) = MUL_R(G_TransientRatio[n][bk], RE(R0));
  ------------------
  |  |  391|  13.8M|#define RE(A) (A)[0]
  ------------------
                              RE(R0) = MUL_R(G_TransientRatio[n][bk], RE(R0));
  ------------------
  |  |  284|  13.8M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1333|  13.8M|                IM(R0) = MUL_R(G_TransientRatio[n][bk], IM(R0));
  ------------------
  |  |  392|  13.8M|#define IM(A) (A)[1]
  ------------------
                              IM(R0) = MUL_R(G_TransientRatio[n][bk], IM(R0));
  ------------------
  |  |  284|  13.8M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1334|       |
 1335|  13.8M|                if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1335:21): [True: 3.21M, False: 10.6M]
  ------------------
 1336|  3.21M|                {
 1337|       |                    /* hybrid */
 1338|  3.21M|                    QMF_RE(X_hybrid_right[n][sb]) = RE(R0);
  ------------------
  |  |  168|  3.21M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.21M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(X_hybrid_right[n][sb]) = RE(R0);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1339|  3.21M|                    QMF_IM(X_hybrid_right[n][sb]) = IM(R0);
  ------------------
  |  |  169|  3.21M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.21M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(X_hybrid_right[n][sb]) = IM(R0);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1340|  10.6M|                } else {
 1341|       |                    /* QMF */
 1342|  10.6M|                    QMF_RE(X_right[n][sb]) = RE(R0);
  ------------------
  |  |  168|  10.6M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  10.6M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(X_right[n][sb]) = RE(R0);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
 1343|  10.6M|                    QMF_IM(X_right[n][sb]) = IM(R0);
  ------------------
  |  |  169|  10.6M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  10.6M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(X_right[n][sb]) = IM(R0);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
 1344|  10.6M|                }
 1345|       |
 1346|       |                /* Update delay buffer index */
 1347|  13.8M|                if (++temp_delay >= 2)
  ------------------
  |  Branch (1347:21): [True: 6.94M, False: 6.95M]
  ------------------
 1348|  6.94M|                {
 1349|  6.94M|                    temp_delay = 0;
 1350|  6.94M|                }
 1351|       |
 1352|       |                /* update delay indices */
 1353|  13.8M|                if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
  ------------------
  |  Branch (1353:21): [True: 7.85M, False: 6.03M]
  |  Branch (1353:50): [True: 7.26M, False: 591k]
  ------------------
 1354|  7.26M|                {
 1355|       |                    /* delay_D depends on the samplerate, it can hold the values 14 and 1 */
 1356|  7.26M|                    if (++ps->delay_buf_index_delay[sb] >= ps->delay_D[sb])
  ------------------
  |  Branch (1356:25): [True: 5.27M, False: 1.99M]
  ------------------
 1357|  5.27M|                    {
 1358|  5.27M|                        ps->delay_buf_index_delay[sb] = 0;
 1359|  5.27M|                    }
 1360|  7.26M|                }
 1361|       |
 1362|  55.5M|                for (m = 0; m < NO_ALLPASS_LINKS; m++)
  ------------------
  |  |   43|  55.5M|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1362:29): [True: 41.6M, False: 13.8M]
  ------------------
 1363|  41.6M|                {
 1364|  41.6M|                    if (++temp_delay_ser[m] >= ps->num_sample_delay_ser[m])
  ------------------
  |  Branch (1364:25): [True: 10.6M, False: 31.0M]
  ------------------
 1365|  10.6M|                    {
 1366|  10.6M|                        temp_delay_ser[m] = 0;
 1367|  10.6M|                    }
 1368|  41.6M|                }
 1369|  13.8M|            }
 1370|   444k|        }
 1371|   184k|    }
 1372|       |
 1373|       |    /* update delay indices */
 1374|  5.66k|    ps->saved_delay = temp_delay;
 1375|  22.6k|    for (n = 0; n < NO_ALLPASS_LINKS; n++)
  ------------------
  |  |   43|  22.6k|#define NO_ALLPASS_LINKS 3
  ------------------
  |  Branch (1375:17): [True: 16.9k, False: 5.66k]
  ------------------
 1376|  16.9k|        ps->delay_buf_index_ser[n] = temp_delay_ser[n];
 1377|  5.66k|}
ps_dec.c:ps_mix_phase:
 1458|  5.66k|{
 1459|  5.66k|    uint8_t n;
 1460|  5.66k|    uint8_t gr;
 1461|  5.66k|    uint8_t bk = 0;
 1462|  5.66k|    uint8_t sb, maxsb;
 1463|  5.66k|    uint8_t env;
 1464|  5.66k|    uint8_t nr_ipdopd_par;
 1465|  5.66k|    complex_t h11, h12, h21, h22;  // COEF
 1466|  5.66k|    complex_t H11, H12, H21, H22;  // COEF
 1467|  5.66k|    complex_t deltaH11, deltaH12, deltaH21, deltaH22;  // COEF
 1468|  5.66k|    complex_t tempLeft, tempRight; // FRAC
 1469|  5.66k|    complex_t phaseLeft, phaseRight; // FRAC
 1470|  5.66k|    real_t L;
 1471|  5.66k|    const real_t *sf_iid;
 1472|  5.66k|    uint8_t no_iid_steps;
 1473|       |
 1474|  5.66k|    if (ps->iid_mode >= 3)
  ------------------
  |  Branch (1474:9): [True: 2.21k, False: 3.44k]
  ------------------
 1475|  2.21k|    {
 1476|  2.21k|        no_iid_steps = 15;
 1477|  2.21k|        sf_iid = sf_iid_fine;
 1478|  3.44k|    } else {
 1479|  3.44k|        no_iid_steps = 7;
 1480|  3.44k|        sf_iid = sf_iid_normal;
 1481|  3.44k|    }
 1482|       |
 1483|  5.66k|    if (ps->ipd_mode == 0 || ps->ipd_mode == 3)
  ------------------
  |  Branch (1483:9): [True: 3.02k, False: 2.64k]
  |  Branch (1483:30): [True: 819, False: 1.82k]
  ------------------
 1484|  3.84k|    {
 1485|  3.84k|        nr_ipdopd_par = 11; /* resolution */
 1486|  3.84k|    } else {
 1487|  1.82k|        nr_ipdopd_par = ps->nr_ipdopd_par;
 1488|  1.82k|    }
 1489|       |
 1490|   189k|    for (gr = 0; gr < ps->num_groups; gr++)
  ------------------
  |  Branch (1490:18): [True: 184k, False: 5.66k]
  ------------------
 1491|   184k|    {
 1492|   184k|        bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
  ------------------
  |  |   41|   184k|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
 1493|       |
 1494|       |        /* use one channel per group in the subqmf domain */
 1495|   184k|        maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr] + 1 : ps->group_border[gr + 1];
  ------------------
  |  Branch (1495:17): [True: 103k, False: 80.7k]
  ------------------
 1496|       |
 1497|   593k|        for (env = 0; env < ps->num_env; env++)
  ------------------
  |  Branch (1497:23): [True: 409k, False: 184k]
  ------------------
 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: 118, False: 408k]
  ------------------
 1505|    118|                fprintf(stderr, "Warning: invalid iid_index: %d < %d\n", ps->iid_index[env][bk],
 1506|    118|                    -no_iid_steps);
 1507|    118|                ps->iid_index[env][bk] = -no_iid_steps;
 1508|    118|                abs_iid = no_iid_steps;
 1509|   408k|            } else if (ps->iid_index[env][bk] > no_iid_steps) {
  ------------------
  |  Branch (1509:24): [True: 102, False: 408k]
  ------------------
 1510|    102|                fprintf(stderr, "Warning: invalid iid_index: %d > %d\n", ps->iid_index[env][bk],
 1511|    102|                    no_iid_steps);
 1512|    102|                ps->iid_index[env][bk] = no_iid_steps;
 1513|    102|                abs_iid = no_iid_steps;
 1514|    102|            }
 1515|   409k|            if (ps->icc_index[env][bk] < 0) {
  ------------------
  |  Branch (1515:17): [True: 257, False: 408k]
  ------------------
 1516|    257|                fprintf(stderr, "Warning: invalid icc_index: %d < 0\n", ps->icc_index[env][bk]);
 1517|    257|                ps->icc_index[env][bk] = 0;
 1518|   408k|            } else if (ps->icc_index[env][bk] > 7) {
  ------------------
  |  Branch (1518:24): [True: 0, False: 408k]
  ------------------
 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: 268k, False: 140k]
  ------------------
 1524|   268k|            {
 1525|       |                /* type 'A' mixing as described in 8.6.4.6.2.1 */
 1526|   268k|                real_t c_1, c_2;  // COEF
 1527|   268k|                real_t cosa, sina;  // COEF
 1528|   268k|                real_t cosb, sinb;  // COEF
 1529|   268k|                real_t ab1, ab2;  // COEF
 1530|   268k|                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|   268k|                c_1 = sf_iid[no_iid_steps + ps->iid_index[env][bk]];
 1543|   268k|                c_2 = sf_iid[no_iid_steps - ps->iid_index[env][bk]];
 1544|       |
 1545|       |                /* calculate alpha and beta using the ICC parameters */
 1546|   268k|                cosa = cos_alphas[ps->icc_index[env][bk]];
 1547|   268k|                sina = sin_alphas[ps->icc_index[env][bk]];
 1548|       |
 1549|   268k|                if (ps->iid_mode >= 3)
  ------------------
  |  Branch (1549:21): [True: 131k, False: 136k]
  ------------------
 1550|   131k|                {
 1551|   131k|                    cosb = cos_betas_fine[abs_iid][ps->icc_index[env][bk]];
 1552|   131k|                    sinb = sin_betas_fine[abs_iid][ps->icc_index[env][bk]];
 1553|   136k|                } else {
 1554|   136k|                    cosb = cos_betas_normal[abs_iid][ps->icc_index[env][bk]];
 1555|   136k|                    sinb = sin_betas_normal[abs_iid][ps->icc_index[env][bk]];
 1556|   136k|                }
 1557|       |
 1558|   268k|                ab1 = MUL_C(cosb, cosa);
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1559|   268k|                ab2 = MUL_C(sinb, sina);
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1560|   268k|                ab3 = MUL_C(sinb, cosa);
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1561|   268k|                ab4 = MUL_C(cosb, sina);
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1562|       |
 1563|       |                /* h_xy: COEF */
 1564|   268k|                RE(h11) = MUL_C(c_2, (ab1 - ab2));
  ------------------
  |  |  391|   268k|#define RE(A) (A)[0]
  ------------------
                              RE(h11) = MUL_C(c_2, (ab1 - ab2));
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1565|   268k|                RE(h12) = MUL_C(c_1, (ab1 + ab2));
  ------------------
  |  |  391|   268k|#define RE(A) (A)[0]
  ------------------
                              RE(h12) = MUL_C(c_1, (ab1 + ab2));
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1566|   268k|                RE(h21) = MUL_C(c_2, (ab3 + ab4));
  ------------------
  |  |  391|   268k|#define RE(A) (A)[0]
  ------------------
                              RE(h21) = MUL_C(c_2, (ab3 + ab4));
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1567|   268k|                RE(h22) = MUL_C(c_1, (ab3 - ab4));
  ------------------
  |  |  391|   268k|#define RE(A) (A)[0]
  ------------------
                              RE(h22) = MUL_C(c_1, (ab3 - ab4));
  ------------------
  |  |  285|   268k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1568|   268k|            } else {
 1569|       |                /* type 'B' mixing as described in 8.6.4.6.2.2 */
 1570|   140k|                real_t sina, cosa;  // COEF
 1571|   140k|                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|   140k|                if (ps->iid_mode >= 3)
  ------------------
  |  Branch (1606:21): [True: 75.3k, False: 65.5k]
  ------------------
 1607|  75.3k|                {
 1608|  75.3k|                    cosa = sincos_alphas_B_fine[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
 1609|  75.3k|                    sina = sincos_alphas_B_fine[30 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
 1610|  75.3k|                    cosg = cos_gammas_fine[abs_iid][ps->icc_index[env][bk]];
 1611|  75.3k|                    sing = sin_gammas_fine[abs_iid][ps->icc_index[env][bk]];
 1612|  75.3k|                } else {
 1613|  65.5k|                    cosa = sincos_alphas_B_normal[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
 1614|  65.5k|                    sina = sincos_alphas_B_normal[14 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
 1615|  65.5k|                    cosg = cos_gammas_normal[abs_iid][ps->icc_index[env][bk]];
 1616|  65.5k|                    sing = sin_gammas_normal[abs_iid][ps->icc_index[env][bk]];
 1617|  65.5k|                }
 1618|       |
 1619|   140k|                RE(h11) = MUL_C(COEF_SQRT2, MUL_C(cosa, cosg));
  ------------------
  |  |  391|   140k|#define RE(A) (A)[0]
  ------------------
                              RE(h11) = MUL_C(COEF_SQRT2, MUL_C(cosa, cosg));
  ------------------
  |  |  285|   140k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1620|   140k|                RE(h12) = MUL_C(COEF_SQRT2, MUL_C(sina, cosg));
  ------------------
  |  |  391|   140k|#define RE(A) (A)[0]
  ------------------
                              RE(h12) = MUL_C(COEF_SQRT2, MUL_C(sina, cosg));
  ------------------
  |  |  285|   140k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1621|   140k|                RE(h21) = MUL_C(COEF_SQRT2, MUL_C(-cosa, sing));
  ------------------
  |  |  391|   140k|#define RE(A) (A)[0]
  ------------------
                              RE(h21) = MUL_C(COEF_SQRT2, MUL_C(-cosa, sing));
  ------------------
  |  |  285|   140k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1622|   140k|                RE(h22) = MUL_C(COEF_SQRT2, MUL_C(sina, sing));
  ------------------
  |  |  391|   140k|#define RE(A) (A)[0]
  ------------------
                              RE(h22) = MUL_C(COEF_SQRT2, MUL_C(sina, sing));
  ------------------
  |  |  285|   140k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1623|   140k|            }
 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: 116k, False: 292k]
  |  Branch (1630:40): [True: 58.8k, False: 57.8k]
  ------------------
 1631|  58.8k|            {
 1632|  58.8k|                int8_t i;
 1633|  58.8k|                real_t xy, pq, xypq;  // FRAC
 1634|       |
 1635|       |                /* ringbuffer index */
 1636|  58.8k|                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|  58.8k|                RE(tempLeft)  = MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(tempLeft)  = MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1648|  58.8k|                IM(tempLeft)  = MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(tempLeft)  = MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1649|  58.8k|                RE(tempRight) = MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(tempRight) = MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1650|  58.8k|                IM(tempRight) = MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(tempRight) = MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1651|  58.8k|#endif
 1652|       |
 1653|       |                /* save current value */
 1654|  58.8k|                RE(ps->ipd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->ipd_index[env][bk])];
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
 1655|  58.8k|                IM(ps->ipd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->ipd_index[env][bk])];
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1656|  58.8k|                RE(ps->opd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->opd_index[env][bk])];
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
 1657|  58.8k|                IM(ps->opd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->opd_index[env][bk])];
  ------------------
  |  |  392|  58.8k|#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|  58.8k|                RE(tempLeft)  += RE(ps->ipd_prev[bk][i]);
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(tempLeft)  += RE(ps->ipd_prev[bk][i]);
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
 1668|  58.8k|                IM(tempLeft)  += IM(ps->ipd_prev[bk][i]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(tempLeft)  += IM(ps->ipd_prev[bk][i]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1669|  58.8k|                RE(tempRight) += RE(ps->opd_prev[bk][i]);
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(tempRight) += RE(ps->opd_prev[bk][i]);
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
 1670|  58.8k|                IM(tempRight) += IM(ps->opd_prev[bk][i]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(tempRight) += IM(ps->opd_prev[bk][i]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1671|  58.8k|#endif
 1672|       |
 1673|       |                /* ringbuffer index */
 1674|  58.8k|                if (i == 0)
  ------------------
  |  Branch (1674:21): [True: 29.7k, False: 29.0k]
  ------------------
 1675|  29.7k|                {
 1676|  29.7k|                    i = 2;
 1677|  29.7k|                }
 1678|  58.8k|                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|  58.8k|                RE(tempLeft)  += MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(tempLeft)  += MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1689|  58.8k|                IM(tempLeft)  += MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(tempLeft)  += MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1690|  58.8k|                RE(tempRight) += MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(tempRight) += MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1691|  58.8k|                IM(tempRight) += MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(tempRight) += MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1692|  58.8k|#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|  58.8k|                xy = magnitude_c(tempRight);
 1716|  58.8k|                pq = magnitude_c(tempLeft);
 1717|       |
 1718|  58.8k|                if (xy != 0)
  ------------------
  |  Branch (1718:21): [True: 58.8k, False: 0]
  ------------------
 1719|  58.8k|                {
 1720|  58.8k|                    RE(phaseLeft) = DIV_F(RE(tempRight), xy);
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                                  RE(phaseLeft) = DIV_F(RE(tempRight), xy);
  ------------------
  |  |  163|  58.8k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1721|  58.8k|                    IM(phaseLeft) = DIV_F(IM(tempRight), xy);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                                  IM(phaseLeft) = DIV_F(IM(tempRight), xy);
  ------------------
  |  |  163|  58.8k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1722|  58.8k|                } 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|  58.8k|                xypq = MUL_F(xy, pq);
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1728|       |
 1729|  58.8k|                if (xypq != 0)
  ------------------
  |  Branch (1729:21): [True: 58.8k, False: 0]
  ------------------
 1730|  58.8k|                {
 1731|  58.8k|                    real_t tmp1 = MUL_F(RE(tempRight), RE(tempLeft)) + MUL_F(IM(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                                  real_t tmp1 = MUL_F(RE(tempRight), RE(tempLeft)) + MUL_F(IM(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1732|  58.8k|                    real_t tmp2 = MUL_F(IM(tempRight), RE(tempLeft)) - MUL_F(RE(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
                                  real_t tmp2 = MUL_F(IM(tempRight), RE(tempLeft)) - MUL_F(RE(tempRight), IM(tempLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1733|       |
 1734|  58.8k|                    RE(phaseRight) = DIV_F(tmp1, xypq);
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                                  RE(phaseRight) = DIV_F(tmp1, xypq);
  ------------------
  |  |  163|  58.8k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1735|  58.8k|                    IM(phaseRight) = DIV_F(tmp2, xypq);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                                  IM(phaseRight) = DIV_F(tmp2, xypq);
  ------------------
  |  |  163|  58.8k|#define DIV_F(A, B) ((A)/(B))
  ------------------
 1736|  58.8k|                } 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|  58.8k|#endif
 1742|       |
 1743|       |                /* MUL_F(COEF, REAL) = COEF */
 1744|  58.8k|                IM(h11) = MUL_F(RE(h11), IM(phaseLeft));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(h11) = MUL_F(RE(h11), IM(phaseLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1745|  58.8k|                IM(h12) = MUL_F(RE(h12), IM(phaseRight));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(h12) = MUL_F(RE(h12), IM(phaseRight));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1746|  58.8k|                IM(h21) = MUL_F(RE(h21), IM(phaseLeft));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(h21) = MUL_F(RE(h21), IM(phaseLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1747|  58.8k|                IM(h22) = MUL_F(RE(h22), IM(phaseRight));
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(h22) = MUL_F(RE(h22), IM(phaseRight));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1748|       |
 1749|  58.8k|                RE(h11) = MUL_F(RE(h11), RE(phaseLeft));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(h11) = MUL_F(RE(h11), RE(phaseLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1750|  58.8k|                RE(h12) = MUL_F(RE(h12), RE(phaseRight));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(h12) = MUL_F(RE(h12), RE(phaseRight));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1751|  58.8k|                RE(h21) = MUL_F(RE(h21), RE(phaseLeft));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(h21) = MUL_F(RE(h21), RE(phaseLeft));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1752|  58.8k|                RE(h22) = MUL_F(RE(h22), RE(phaseRight));
  ------------------
  |  |  391|  58.8k|#define RE(A) (A)[0]
  ------------------
                              RE(h22) = MUL_F(RE(h22), RE(phaseRight));
  ------------------
  |  |  286|  58.8k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1753|  58.8k|            }
 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: 116k, False: 292k]
  |  Branch (1777:40): [True: 58.8k, False: 57.8k]
  ------------------
 1778|  58.8k|            {
 1779|       |                /* obtain final H_xy by means of linear interpolation */
 1780|  58.8k|                IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1781|  58.8k|                IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1782|  58.8k|                IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1783|  58.8k|                IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1784|       |
 1785|  58.8k|                IM(H11) = IM(ps->h11_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(H11) = IM(ps->h11_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1786|  58.8k|                IM(H12) = IM(ps->h12_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(H12) = IM(ps->h12_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1787|  58.8k|                IM(H21) = IM(ps->h21_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(H21) = IM(ps->h21_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1788|  58.8k|                IM(H22) = IM(ps->h22_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(H22) = IM(ps->h22_prev[gr]);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1789|       |
 1790|  58.8k|                if ((NEGATE_IPD_MASK & ps->map_group2bk[gr]) != 0)
  ------------------
  |  |   41|  58.8k|#define NEGATE_IPD_MASK            (0x1000)
  ------------------
  |  Branch (1790:21): [True: 8.07k, False: 50.7k]
  ------------------
 1791|  8.07k|                {
 1792|  8.07k|                    IM(deltaH11) = -IM(deltaH11);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH11) = -IM(deltaH11);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1793|  8.07k|                    IM(deltaH12) = -IM(deltaH12);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH12) = -IM(deltaH12);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1794|  8.07k|                    IM(deltaH21) = -IM(deltaH21);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH21) = -IM(deltaH21);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1795|  8.07k|                    IM(deltaH22) = -IM(deltaH22);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(deltaH22) = -IM(deltaH22);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1796|       |
 1797|  8.07k|                    IM(H11) = -IM(H11);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(H11) = -IM(H11);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1798|  8.07k|                    IM(H12) = -IM(H12);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(H12) = -IM(H12);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1799|  8.07k|                    IM(H21) = -IM(H21);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(H21) = -IM(H21);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1800|  8.07k|                    IM(H22) = -IM(H22);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
                                  IM(H22) = -IM(H22);
  ------------------
  |  |  392|  8.07k|#define IM(A) (A)[1]
  ------------------
 1801|  8.07k|                }
 1802|       |
 1803|  58.8k|                IM(ps->h11_prev[gr]) = IM(h11);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h11_prev[gr]) = IM(h11);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1804|  58.8k|                IM(ps->h12_prev[gr]) = IM(h12);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h12_prev[gr]) = IM(h12);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1805|  58.8k|                IM(ps->h21_prev[gr]) = IM(h21);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h21_prev[gr]) = IM(h21);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1806|  58.8k|                IM(ps->h22_prev[gr]) = IM(h22);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
                              IM(ps->h22_prev[gr]) = IM(h22);
  ------------------
  |  |  392|  58.8k|#define IM(A) (A)[1]
  ------------------
 1807|  58.8k|            }
 1808|       |
 1809|       |            /* apply H_xy to the current envelope band of the decorrelated subband */
 1810|  6.14M|            for (n = ps->border_position[env]; n < ps->border_position[env + 1]; n++)
  ------------------
  |  Branch (1810:48): [True: 5.73M, False: 409k]
  ------------------
 1811|  5.73M|            {
 1812|       |                /* addition finalises the interpolation over every n */
 1813|  5.73M|                RE(H11) += RE(deltaH11);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
                              RE(H11) += RE(deltaH11);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
 1814|  5.73M|                RE(H12) += RE(deltaH12);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
                              RE(H12) += RE(deltaH12);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
 1815|  5.73M|                RE(H21) += RE(deltaH21);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
                              RE(H21) += RE(deltaH21);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
 1816|  5.73M|                RE(H22) += RE(deltaH22);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
                              RE(H22) += RE(deltaH22);
  ------------------
  |  |  391|  5.73M|#define RE(A) (A)[0]
  ------------------
 1817|  5.73M|                if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
  ------------------
  |  Branch (1817:21): [True: 1.28M, False: 4.45M]
  |  Branch (1817:44): [True: 656k, False: 631k]
  ------------------
 1818|   656k|                {
 1819|   656k|                    IM(H11) += IM(deltaH11);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
                                  IM(H11) += IM(deltaH11);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
 1820|   656k|                    IM(H12) += IM(deltaH12);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
                                  IM(H12) += IM(deltaH12);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
 1821|   656k|                    IM(H21) += IM(deltaH21);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
                                  IM(H21) += IM(deltaH21);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
 1822|   656k|                    IM(H22) += IM(deltaH22);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
                                  IM(H22) += IM(deltaH22);
  ------------------
  |  |  392|   656k|#define IM(A) (A)[1]
  ------------------
 1823|   656k|                }
 1824|       |
 1825|       |                /* channel is an alias to the subband */
 1826|  19.6M|                for (sb = ps->group_border[gr]; sb < maxsb; sb++)
  ------------------
  |  Branch (1826:49): [True: 13.8M, False: 5.73M]
  ------------------
 1827|  13.8M|                {
 1828|  13.8M|                    complex_t inLeft, inRight;  // precision_of in(Left|Right) == precision_of X_(left|right)
 1829|       |
 1830|       |                    /* load decorrelated samples */
 1831|  13.8M|                    if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1831:25): [True: 3.21M, False: 10.6M]
  ------------------
 1832|  3.21M|                    {
 1833|  3.21M|                        RE(inLeft) =  RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(inLeft) =  RE(X_hybrid_left[n][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1834|  3.21M|                        IM(inLeft) =  IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(inLeft) =  IM(X_hybrid_left[n][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1835|  3.21M|                        RE(inRight) = RE(X_hybrid_right[n][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(inRight) = RE(X_hybrid_right[n][sb]);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1836|  3.21M|                        IM(inRight) = IM(X_hybrid_right[n][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(inRight) = IM(X_hybrid_right[n][sb]);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1837|  10.6M|                    } else {
 1838|  10.6M|                        RE(inLeft) =  RE(X_left[n][sb]);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
                                      RE(inLeft) =  RE(X_left[n][sb]);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
 1839|  10.6M|                        IM(inLeft) =  IM(X_left[n][sb]);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
                                      IM(inLeft) =  IM(X_left[n][sb]);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
 1840|  10.6M|                        RE(inRight) = RE(X_right[n][sb]);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
                                      RE(inRight) = RE(X_right[n][sb]);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
 1841|  10.6M|                        IM(inRight) = IM(X_right[n][sb]);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
                                      IM(inRight) = IM(X_right[n][sb]);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
 1842|  10.6M|                    }
 1843|       |
 1844|       |                    /* precision_of temp(Left|Right) == precision_of X_(left|right) */
 1845|       |
 1846|       |                    /* apply mixing */
 1847|  13.8M|                    RE(tempLeft) =  MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
  ------------------
  |  |  391|  13.8M|#define RE(A) (A)[0]
  ------------------
                                  RE(tempLeft) =  MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  RE(tempLeft) =  MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1848|  13.8M|                    IM(tempLeft) =  MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
  ------------------
  |  |  392|  13.8M|#define IM(A) (A)[1]
  ------------------
                                  IM(tempLeft) =  MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  IM(tempLeft) =  MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1849|  13.8M|                    RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
  ------------------
  |  |  391|  13.8M|#define RE(A) (A)[0]
  ------------------
                                  RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1850|  13.8M|                    IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
  ------------------
  |  |  392|  13.8M|#define IM(A) (A)[1]
  ------------------
                                  IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                  IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
  ------------------
  |  |  285|  13.8M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1851|       |
 1852|       |                    /* only perform imaginary operations when needed */
 1853|  13.8M|                    if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
  ------------------
  |  Branch (1853:25): [True: 3.12M, False: 10.7M]
  |  Branch (1853:48): [True: 658k, False: 2.46M]
  ------------------
 1854|   658k|                    {
 1855|       |                        /* apply rotation */
 1856|   658k|                        RE(tempLeft)  -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
  ------------------
  |  |  391|   658k|#define RE(A) (A)[0]
  ------------------
                                      RE(tempLeft)  -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      RE(tempLeft)  -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1857|   658k|                        IM(tempLeft)  += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
  ------------------
  |  |  392|   658k|#define IM(A) (A)[1]
  ------------------
                                      IM(tempLeft)  += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      IM(tempLeft)  += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1858|   658k|                        RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
  ------------------
  |  |  391|   658k|#define RE(A) (A)[0]
  ------------------
                                      RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1859|   658k|                        IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
  ------------------
  |  |  392|   658k|#define IM(A) (A)[1]
  ------------------
                                      IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
                                      IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
  ------------------
  |  |  285|   658k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
 1860|   658k|                    }
 1861|       |
 1862|       |                    /* store final samples */
 1863|  13.8M|                    if (gr < ps->num_hybrid_groups)
  ------------------
  |  Branch (1863:25): [True: 3.21M, False: 10.6M]
  ------------------
 1864|  3.21M|                    {
 1865|  3.21M|                        RE(X_hybrid_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_hybrid_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1866|  3.21M|                        IM(X_hybrid_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_hybrid_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1867|  3.21M|                        RE(X_hybrid_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_hybrid_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  3.21M|#define RE(A) (A)[0]
  ------------------
 1868|  3.21M|                        IM(X_hybrid_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_hybrid_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  3.21M|#define IM(A) (A)[1]
  ------------------
 1869|  10.6M|                    } else {
 1870|  10.6M|                        RE(X_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_left[n][sb])  = RE(tempLeft);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
 1871|  10.6M|                        IM(X_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_left[n][sb])  = IM(tempLeft);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
 1872|  10.6M|                        RE(X_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
                                      RE(X_right[n][sb]) = RE(tempRight);
  ------------------
  |  |  391|  10.6M|#define RE(A) (A)[0]
  ------------------
 1873|  10.6M|                        IM(X_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
                                      IM(X_right[n][sb]) = IM(tempRight);
  ------------------
  |  |  392|  10.6M|#define IM(A) (A)[1]
  ------------------
 1874|  10.6M|                    }
 1875|  13.8M|                }
 1876|  5.73M|            }
 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|   184k|    }
 1886|  5.66k|}
ps_dec.c:magnitude_c:
 1437|   117k|{
 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|   117k|    return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  391|   117k|#define RE(A) (A)[0]
  ------------------
                  return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  391|   117k|#define RE(A) (A)[0]
  ------------------
                  return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  392|   117k|#define IM(A) (A)[1]
  ------------------
                  return sqrt(RE(c)*RE(c) + IM(c)*IM(c));
  ------------------
  |  |  392|   117k|#define IM(A) (A)[1]
  ------------------
 1453|   117k|#endif
 1454|   117k|}
ps_dec.c:hybrid_synthesis:
  588|  11.3k|{
  589|  11.3k|    uint8_t k, n, band;
  590|  11.3k|    uint8_t offset = 0;
  591|  11.3k|    uint8_t qmf_bands = (use34) ? 5 : 3;
  ------------------
  |  Branch (591:25): [True: 4.26k, False: 7.06k]
  ------------------
  592|  11.3k|    uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
  ------------------
  |  Branch (592:27): [True: 4.26k, False: 7.06k]
  ------------------
  593|  11.3k|    (void)numTimeSlotsRate;  /* TODO: remove parameter? */
  594|       |
  595|  53.8k|    for(band = 0; band < qmf_bands; band++)
  ------------------
  |  Branch (595:19): [True: 42.5k, False: 11.3k]
  ------------------
  596|  42.5k|    {
  597|  1.36M|        for (n = 0; n < hyb->frame_len; n++)
  ------------------
  |  Branch (597:21): [True: 1.32M, False: 42.5k]
  ------------------
  598|  1.32M|        {
  599|  1.32M|            QMF_RE(X[n][band]) = 0;
  ------------------
  |  |  168|  1.32M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.32M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  600|  1.32M|            QMF_IM(X[n][band]) = 0;
  ------------------
  |  |  169|  1.32M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.32M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  601|       |
  602|  8.17M|            for (k = 0; k < resolution[band]; k++)
  ------------------
  |  Branch (602:25): [True: 6.85M, False: 1.32M]
  ------------------
  603|  6.85M|            {
  604|  6.85M|                QMF_RE(X[n][band]) += QMF_RE(X_hybrid[n][offset + k]);
  ------------------
  |  |  168|  6.85M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  6.85M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[n][band]) += QMF_RE(X_hybrid[n][offset + k]);
  ------------------
  |  |  168|  6.85M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  6.85M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  605|  6.85M|                QMF_IM(X[n][band]) += QMF_IM(X_hybrid[n][offset + k]);
  ------------------
  |  |  169|  6.85M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  6.85M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[n][band]) += QMF_IM(X_hybrid[n][offset + k]);
  ------------------
  |  |  169|  6.85M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  6.85M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  606|  6.85M|            }
  607|  1.32M|        }
  608|  42.5k|        offset += resolution[band];
  609|  42.5k|    }
  610|  11.3k|}

ps_data:
  329|  28.6k|{
  330|  28.6k|    uint8_t tmp, n;
  331|  28.6k|    uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
  332|       |
  333|  28.6k|    *header = 0;
  334|       |
  335|       |    /* check for new PS header */
  336|  28.6k|    if (faad_get1bit(ld
  ------------------
  |  Branch (336:9): [True: 12.7k, False: 15.9k]
  ------------------
  337|  28.6k|        DEBUGVAR(1,1000,"ps_data(): enable_ps_header")))
  338|  12.7k|    {
  339|  12.7k|        *header = 1;
  340|       |
  341|  12.7k|        ps->header_read = 1;
  342|       |
  343|  12.7k|        ps->use34hybrid_bands = 0;
  344|       |
  345|       |        /* Inter-channel Intensity Difference (IID) parameters enabled */
  346|  12.7k|        ps->enable_iid = (uint8_t)faad_get1bit(ld
  347|  12.7k|            DEBUGVAR(1,1001,"ps_data(): enable_iid"));
  348|       |
  349|  12.7k|        if (ps->enable_iid)
  ------------------
  |  Branch (349:13): [True: 7.30k, False: 5.39k]
  ------------------
  350|  7.30k|        {
  351|  7.30k|            ps->iid_mode = (uint8_t)faad_getbits(ld, 3
  352|  7.30k|                DEBUGVAR(1,1002,"ps_data(): iid_mode"));
  353|       |
  354|  7.30k|            ps->nr_iid_par = nr_iid_par_tab[ps->iid_mode];
  355|  7.30k|            ps->nr_ipdopd_par = nr_ipdopd_par_tab[ps->iid_mode];
  356|       |
  357|  7.30k|            if (ps->iid_mode == 2 || ps->iid_mode == 5)
  ------------------
  |  Branch (357:17): [True: 1.03k, False: 6.27k]
  |  Branch (357:38): [True: 1.03k, False: 5.23k]
  ------------------
  358|  2.06k|                ps->use34hybrid_bands = 1;
  359|       |
  360|       |            /* IPD freq res equal to IID freq res */
  361|  7.30k|            ps->ipd_mode = ps->iid_mode;
  362|  7.30k|        }
  363|       |
  364|       |        /* Inter-channel Coherence (ICC) parameters enabled */
  365|  12.7k|        ps->enable_icc = (uint8_t)faad_get1bit(ld
  366|  12.7k|            DEBUGVAR(1,1003,"ps_data(): enable_icc"));
  367|       |
  368|  12.7k|        if (ps->enable_icc)
  ------------------
  |  Branch (368:13): [True: 6.09k, False: 6.60k]
  ------------------
  369|  6.09k|        {
  370|  6.09k|            ps->icc_mode = (uint8_t)faad_getbits(ld, 3
  371|  6.09k|                DEBUGVAR(1,1004,"ps_data(): icc_mode"));
  372|       |
  373|  6.09k|            ps->nr_icc_par = nr_icc_par_tab[ps->icc_mode];
  374|       |
  375|  6.09k|            if (ps->icc_mode == 2 || ps->icc_mode == 5)
  ------------------
  |  Branch (375:17): [True: 1.29k, False: 4.79k]
  |  Branch (375:38): [True: 821, False: 3.97k]
  ------------------
  376|  2.11k|                ps->use34hybrid_bands = 1;
  377|  6.09k|        }
  378|       |
  379|       |        /* PS extension layer enabled */
  380|  12.7k|        ps->enable_ext = (uint8_t)faad_get1bit(ld
  381|  12.7k|            DEBUGVAR(1,1005,"ps_data(): enable_ext"));
  382|  12.7k|    }
  383|       |
  384|       |    /* we are here, but no header has been read yet */
  385|  28.6k|    if (ps->header_read == 0)
  ------------------
  |  Branch (385:9): [True: 7.75k, False: 20.9k]
  ------------------
  386|  7.75k|    {
  387|  7.75k|        ps->ps_data_available = 0;
  388|  7.75k|        return 1;
  389|  7.75k|    }
  390|       |
  391|  20.9k|    ps->frame_class = (uint8_t)faad_get1bit(ld
  392|  20.9k|        DEBUGVAR(1,1006,"ps_data(): frame_class"));
  393|  20.9k|    tmp = (uint8_t)faad_getbits(ld, 2
  394|  20.9k|        DEBUGVAR(1,1007,"ps_data(): num_env_idx"));
  395|       |
  396|  20.9k|    ps->num_env = num_env_tab[ps->frame_class][tmp];
  397|       |
  398|  20.9k|    if (ps->frame_class)
  ------------------
  |  Branch (398:9): [True: 7.09k, False: 13.8k]
  ------------------
  399|  7.09k|    {
  400|  24.4k|        for (n = 1; n < ps->num_env+1; n++)
  ------------------
  |  Branch (400:21): [True: 17.3k, False: 7.09k]
  ------------------
  401|  17.3k|        {
  402|  17.3k|            ps->border_position[n] = (uint8_t)faad_getbits(ld, 5
  403|  17.3k|                DEBUGVAR(1,1008,"ps_data(): border_position")) + 1;
  404|  17.3k|        }
  405|  7.09k|    }
  406|       |
  407|  20.9k|    if (ps->enable_iid)
  ------------------
  |  Branch (407:9): [True: 10.8k, False: 10.0k]
  ------------------
  408|  10.8k|    {
  409|  28.7k|        for (n = 0; n < ps->num_env; n++)
  ------------------
  |  Branch (409:21): [True: 17.9k, False: 10.8k]
  ------------------
  410|  17.9k|        {
  411|  17.9k|            ps->iid_dt[n] = (uint8_t)faad_get1bit(ld
  412|  17.9k|                DEBUGVAR(1,1009,"ps_data(): iid_dt"));
  413|       |
  414|       |            /* iid_data */
  415|  17.9k|            if (ps->iid_mode < 3)
  ------------------
  |  Branch (415:17): [True: 2.94k, False: 14.9k]
  ------------------
  416|  2.94k|            {
  417|  2.94k|                huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_def,
  418|  2.94k|                    f_huff_iid_def, ps->iid_index[n]);
  419|  14.9k|            } else {
  420|  14.9k|                huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_fine,
  421|  14.9k|                    f_huff_iid_fine, ps->iid_index[n]);
  422|  14.9k|            }
  423|  17.9k|        }
  424|  10.8k|    }
  425|       |
  426|  20.9k|    if (ps->enable_icc)
  ------------------
  |  Branch (426:9): [True: 11.0k, False: 9.84k]
  ------------------
  427|  11.0k|    {
  428|  30.6k|        for (n = 0; n < ps->num_env; n++)
  ------------------
  |  Branch (428:21): [True: 19.5k, False: 11.0k]
  ------------------
  429|  19.5k|        {
  430|  19.5k|            ps->icc_dt[n] = (uint8_t)faad_get1bit(ld
  431|  19.5k|                DEBUGVAR(1,1010,"ps_data(): icc_dt"));
  432|       |
  433|       |            /* icc_data */
  434|  19.5k|            huff_data(ld, ps->icc_dt[n], ps->nr_icc_par, t_huff_icc,
  435|  19.5k|                f_huff_icc, ps->icc_index[n]);
  436|  19.5k|        }
  437|  11.0k|    }
  438|       |
  439|  20.9k|    if (ps->enable_ext)
  ------------------
  |  Branch (439:9): [True: 7.81k, False: 13.1k]
  ------------------
  440|  7.81k|    {
  441|  7.81k|        uint16_t num_bits_left;
  442|  7.81k|        uint16_t cnt = (uint16_t)faad_getbits(ld, 4
  443|  7.81k|            DEBUGVAR(1,1011,"ps_data(): ps_extension_size"));
  444|  7.81k|        if (cnt == 15)
  ------------------
  |  Branch (444:13): [True: 620, False: 7.19k]
  ------------------
  445|    620|        {
  446|    620|            cnt += (uint16_t)faad_getbits(ld, 8
  447|    620|                DEBUGVAR(1,1012,"ps_data(): esc_count"));
  448|    620|        }
  449|       |
  450|  7.81k|        num_bits_left = 8 * cnt;
  451|  14.8M|        while (num_bits_left > 7)
  ------------------
  |  Branch (451:16): [True: 14.8M, False: 7.81k]
  ------------------
  452|  14.8M|        {
  453|  14.8M|            uint8_t ps_extension_id = (uint8_t)faad_getbits(ld, 2
  454|  14.8M|                DEBUGVAR(1,1013,"ps_data(): ps_extension_size"));
  455|       |
  456|  14.8M|            num_bits_left -= 2;
  457|  14.8M|            num_bits_left -= ps_extension(ps, ld, ps_extension_id, num_bits_left);
  458|  14.8M|        }
  459|       |
  460|  7.81k|        faad_getbits(ld, num_bits_left
  461|  7.81k|            DEBUGVAR(1,1014,"ps_data(): fill_bits"));
  462|  7.81k|    }
  463|       |
  464|  20.9k|    bits = (uint16_t)faad_get_processed_bits(ld) - bits;
  465|       |
  466|  20.9k|    ps->ps_data_available = 1;
  467|       |
  468|  20.9k|    return bits;
  469|  28.6k|}
ps_syntax.c:ps_extension:
  474|  14.8M|{
  475|  14.8M|    uint8_t n;
  476|  14.8M|    uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
  477|  14.8M|    (void)num_bits_left;  /* TODO: remove parameter, or actually use it. */
  478|       |
  479|  14.8M|    if (ps_extension_id == 0)
  ------------------
  |  Branch (479:9): [True: 14.3M, False: 520k]
  ------------------
  480|  14.3M|    {
  481|  14.3M|        ps->enable_ipdopd = (uint8_t)faad_get1bit(ld
  482|  14.3M|            DEBUGVAR(1,1015,"ps_extension(): enable_ipdopd"));
  483|       |
  484|  14.3M|        if (ps->enable_ipdopd)
  ------------------
  |  Branch (484:13): [True: 47.9k, False: 14.2M]
  ------------------
  485|  47.9k|        {
  486|   185k|            for (n = 0; n < ps->num_env; n++)
  ------------------
  |  Branch (486:25): [True: 137k, False: 47.9k]
  ------------------
  487|   137k|            {
  488|   137k|                ps->ipd_dt[n] = (uint8_t)faad_get1bit(ld
  489|   137k|                    DEBUGVAR(1,1016,"ps_extension(): ipd_dt"));
  490|       |
  491|       |                /* ipd_data */
  492|   137k|                huff_data(ld, ps->ipd_dt[n], ps->nr_ipdopd_par, t_huff_ipd,
  493|   137k|                    f_huff_ipd, ps->ipd_index[n]);
  494|       |
  495|   137k|                ps->opd_dt[n] = (uint8_t)faad_get1bit(ld
  496|   137k|                    DEBUGVAR(1,1017,"ps_extension(): opd_dt"));
  497|       |
  498|       |                /* opd_data */
  499|   137k|                huff_data(ld, ps->opd_dt[n], ps->nr_ipdopd_par, t_huff_opd,
  500|   137k|                    f_huff_opd, ps->opd_index[n]);
  501|   137k|            }
  502|  47.9k|        }
  503|  14.3M|        faad_get1bit(ld
  504|  14.3M|            DEBUGVAR(1,1018,"ps_extension(): reserved_ps"));
  505|  14.3M|    }
  506|       |
  507|       |    /* return number of bits read */
  508|  14.8M|    bits = (uint16_t)faad_get_processed_bits(ld) - bits;
  509|       |
  510|  14.8M|    return bits;
  511|  14.8M|}
ps_syntax.c:huff_data:
  516|   311k|{
  517|   311k|    uint8_t n;
  518|       |
  519|   311k|    if (dt)
  ------------------
  |  Branch (519:9): [True: 127k, False: 184k]
  ------------------
  520|   127k|    {
  521|       |        /* coded in time direction */
  522|   385k|        for (n = 0; n < nr_par; n++)
  ------------------
  |  Branch (522:21): [True: 258k, False: 127k]
  ------------------
  523|   258k|        {
  524|   258k|            par[n] = ps_huff_dec(ld, t_huff);
  525|   258k|        }
  526|   184k|    } else {
  527|       |        /* coded in frequency direction */
  528|   184k|        par[0] = ps_huff_dec(ld, f_huff);
  529|       |
  530|   626k|        for (n = 1; n < nr_par; n++)
  ------------------
  |  Branch (530:21): [True: 442k, False: 184k]
  ------------------
  531|   442k|        {
  532|   442k|            par[n] = ps_huff_dec(ld, f_huff);
  533|   442k|        }
  534|   184k|    }
  535|   311k|}
ps_syntax.c:ps_huff_dec:
  539|   885k|{
  540|   885k|    uint8_t bit;
  541|   885k|    int8_t index = 0;
  542|       |
  543|  3.00M|    while (index >= 0)
  ------------------
  |  Branch (543:12): [True: 2.12M, False: 885k]
  ------------------
  544|  2.12M|    {
  545|  2.12M|        bit = (uint8_t)faad_get1bit(ld);
  546|  2.12M|        index = t_huff[index][bit];
  547|  2.12M|    }
  548|       |
  549|   885k|    return index + 31;
  550|   885k|}

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

rvlc_scale_factor_data:
   75|  6.62k|{
   76|  6.62k|    uint8_t bits = 9;
   77|       |
   78|  6.62k|    ics->sf_concealment = faad_get1bit(ld
   79|  6.62k|        DEBUGVAR(1,149,"rvlc_scale_factor_data(): sf_concealment"));
   80|  6.62k|    ics->rev_global_gain = (uint8_t)faad_getbits(ld, 8
   81|  6.62k|        DEBUGVAR(1,150,"rvlc_scale_factor_data(): rev_global_gain"));
   82|       |
   83|  6.62k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  6.62k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (83:9): [True: 424, False: 6.19k]
  ------------------
   84|    424|        bits = 11;
   85|       |
   86|       |    /* the number of bits used for the huffman codewords */
   87|  6.62k|    ics->length_of_rvlc_sf = (uint16_t)faad_getbits(ld, bits
   88|  6.62k|        DEBUGVAR(1,151,"rvlc_scale_factor_data(): length_of_rvlc_sf"));
   89|       |
   90|  6.62k|    if (ics->noise_used)
  ------------------
  |  Branch (90:9): [True: 0, False: 6.62k]
  ------------------
   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|      0|        ics->length_of_rvlc_sf -= 9;
   96|      0|    }
   97|       |
   98|  6.62k|    ics->sf_escapes_present = faad_get1bit(ld
   99|  6.62k|        DEBUGVAR(1,153,"rvlc_scale_factor_data(): sf_escapes_present"));
  100|       |
  101|  6.62k|    if (ics->sf_escapes_present)
  ------------------
  |  Branch (101:9): [True: 832, False: 5.79k]
  ------------------
  102|    832|    {
  103|    832|        ics->length_of_rvlc_escapes = (uint8_t)faad_getbits(ld, 8
  104|    832|            DEBUGVAR(1,154,"rvlc_scale_factor_data(): length_of_rvlc_escapes"));
  105|    832|    }
  106|       |
  107|  6.62k|    if (ics->noise_used)
  ------------------
  |  Branch (107:9): [True: 0, False: 6.62k]
  ------------------
  108|      0|    {
  109|      0|        ics->dpcm_noise_last_position = (uint16_t)faad_getbits(ld, 9
  110|      0|            DEBUGVAR(1,155,"rvlc_scale_factor_data(): dpcm_noise_last_position"));
  111|      0|    }
  112|       |
  113|  6.62k|    return 0;
  114|  6.62k|}
rvlc_decode_scale_factors:
  117|  6.62k|{
  118|  6.62k|    uint8_t result;
  119|  6.62k|    uint8_t intensity_used = 0;
  120|  6.62k|    uint8_t *rvlc_sf_buffer = NULL;
  121|  6.62k|    uint8_t *rvlc_esc_buffer = NULL;
  122|  6.62k|    bitfile ld_rvlc_sf = {0}, ld_rvlc_esc = {0};
  123|       |//    bitfile ld_rvlc_sf_rev, ld_rvlc_esc_rev;
  124|       |
  125|  6.62k|    if (ics->length_of_rvlc_sf > 0)
  ------------------
  |  Branch (125:9): [True: 1.39k, False: 5.22k]
  ------------------
  126|  1.39k|    {
  127|       |        /* We read length_of_rvlc_sf bits here to put it in a
  128|       |           seperate bitfile.
  129|       |        */
  130|  1.39k|        rvlc_sf_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_sf
  131|  1.39k|            DEBUGVAR(1,156,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_sf"));
  132|       |
  133|  1.39k|        faad_initbits(&ld_rvlc_sf, (void*)rvlc_sf_buffer, bit2byte(ics->length_of_rvlc_sf));
  ------------------
  |  |   46|  1.39k|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|  1.39k|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
  134|       |//        faad_initbits_rev(&ld_rvlc_sf_rev, (void*)rvlc_sf_buffer,
  135|       |//            ics->length_of_rvlc_sf);
  136|  1.39k|    }
  137|  6.62k|    if ((ics->length_of_rvlc_sf == 0) || (ld_rvlc_sf.error != 0)) {
  ------------------
  |  Branch (137:9): [True: 5.22k, False: 1.39k]
  |  Branch (137:42): [True: 0, False: 1.39k]
  ------------------
  138|  5.22k|        memset(&ld_rvlc_sf, 0, sizeof(ld_rvlc_sf));
  139|  5.22k|        ld_rvlc_sf.error = 1;
  140|  5.22k|    }
  141|       |
  142|  6.62k|    if (ics->sf_escapes_present)
  ------------------
  |  Branch (142:9): [True: 832, False: 5.78k]
  ------------------
  143|    832|    {
  144|       |        /* We read length_of_rvlc_escapes bits here to put it in a
  145|       |           seperate bitfile.
  146|       |        */
  147|    832|        rvlc_esc_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_escapes
  148|    832|            DEBUGVAR(1,157,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_escapes"));
  149|       |
  150|    832|        faad_initbits(&ld_rvlc_esc, (void*)rvlc_esc_buffer, bit2byte(ics->length_of_rvlc_escapes));
  ------------------
  |  |   46|    832|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|    832|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
  151|       |//        faad_initbits_rev(&ld_rvlc_esc_rev, (void*)rvlc_esc_buffer,
  152|       |//            ics->length_of_rvlc_escapes);
  153|    832|    }
  154|  6.62k|    if (!ics->sf_escapes_present || (ld_rvlc_esc.error != 0)) {
  ------------------
  |  Branch (154:9): [True: 5.78k, False: 832]
  |  Branch (154:37): [True: 439, False: 393]
  ------------------
  155|  6.22k|        memset(&ld_rvlc_esc, 0, sizeof(ld_rvlc_esc));
  156|  6.22k|        ld_rvlc_esc.error = 1;
  157|  6.22k|    }
  158|       |
  159|       |    /* decode the rvlc scale factors and escapes */
  160|  6.62k|    result = rvlc_decode_sf_forward(ics, &ld_rvlc_sf,
  161|  6.62k|        &ld_rvlc_esc, &intensity_used);
  162|       |//    result = rvlc_decode_sf_reverse(ics, &ld_rvlc_sf_rev,
  163|       |//        &ld_rvlc_esc_rev, intensity_used);
  164|       |
  165|       |
  166|  6.62k|    if (rvlc_esc_buffer) faad_free(rvlc_esc_buffer);
  ------------------
  |  Branch (166:9): [True: 832, False: 5.78k]
  ------------------
  167|  6.62k|    if (rvlc_sf_buffer) faad_free(rvlc_sf_buffer);
  ------------------
  |  Branch (167:9): [True: 1.39k, False: 5.22k]
  ------------------
  168|       |
  169|  6.62k|    if (ics->length_of_rvlc_sf > 0)
  ------------------
  |  Branch (169:9): [True: 1.39k, False: 5.22k]
  ------------------
  170|  1.39k|        faad_endbits(&ld_rvlc_sf);
  171|  6.62k|    if (ics->sf_escapes_present)
  ------------------
  |  Branch (171:9): [True: 832, False: 5.78k]
  ------------------
  172|    832|        faad_endbits(&ld_rvlc_esc);
  173|       |
  174|  6.62k|    return result;
  175|  6.62k|}
rvlc.c:rvlc_decode_sf_forward:
  179|  6.62k|{
  180|  6.62k|    int8_t g, sfb;
  181|  6.62k|    int8_t t = 0;
  182|  6.62k|    int8_t error = ld_sf->error | ld_esc->error;
  183|  6.62k|    int8_t noise_pcm_flag = 1;
  184|       |
  185|  6.62k|    int16_t scale_factor = ics->global_gain;
  186|  6.62k|    int16_t is_position = 0;
  187|  6.62k|    int16_t noise_energy = ics->global_gain - 90 - 256;
  188|  6.62k|    int16_t scale_factor_max = 255;
  189|       |#ifdef FIXED_POINT
  190|       |    /* TODO: consider rolling out to regular build. */
  191|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  192|       |    /* The value is inexact, adjusted to current fuzzer findings. */
  193|       |    scale_factor_max = 165;
  194|       |#endif  // FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  195|       |#endif  // FIXED_POINT
  196|       |
  197|       |#ifdef PRINT_RVLC
  198|       |    printf("\nglobal_gain: %d\n", ics->global_gain);
  199|       |#endif
  200|       |
  201|  15.6k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (201:17): [True: 9.04k, False: 6.59k]
  ------------------
  202|  9.04k|    {
  203|  25.1k|        for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (203:23): [True: 16.1k, False: 9.01k]
  ------------------
  204|  16.1k|        {
  205|  16.1k|            if (error)
  ------------------
  |  Branch (205:17): [True: 11.7k, False: 4.39k]
  ------------------
  206|  11.7k|            {
  207|  11.7k|                ics->scale_factors[g][sfb] = 0;
  208|  11.7k|            } else {
  209|  4.39k|                switch (ics->sfb_cb[g][sfb])
  210|  4.39k|                {
  211|    281|                case ZERO_HCB: /* zero book */
  ------------------
  |  |  101|    281|#define ZERO_HCB       0
  ------------------
  |  Branch (211:17): [True: 281, False: 4.10k]
  ------------------
  212|    281|                    ics->scale_factors[g][sfb] = 0;
  213|    281|                    break;
  214|    984|                case INTENSITY_HCB: /* intensity books */
  ------------------
  |  |  108|    984|#define INTENSITY_HCB  15
  ------------------
  |  Branch (214:17): [True: 984, False: 3.40k]
  ------------------
  215|  1.94k|                case INTENSITY_HCB2:
  ------------------
  |  |  107|  1.94k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (215:17): [True: 956, False: 3.43k]
  ------------------
  216|       |
  217|  1.94k|                    *intensity_used = 1;
  218|       |
  219|       |                    /* decode intensity position */
  220|  1.94k|                    t = rvlc_huffman_sf(ld_sf, ld_esc /*, +1*/);
  221|       |
  222|  1.94k|                    is_position += t;
  223|  1.94k|                    ics->scale_factors[g][sfb] = is_position;
  224|       |
  225|  1.94k|                    break;
  226|      0|                case NOISE_HCB: /* noise books */
  ------------------
  |  |  106|      0|#define NOISE_HCB      13
  ------------------
  |  Branch (226:17): [True: 0, False: 4.39k]
  ------------------
  227|       |
  228|       |                    /* decode noise energy */
  229|      0|                    if (noise_pcm_flag)
  ------------------
  |  Branch (229:25): [True: 0, False: 0]
  ------------------
  230|      0|                    {
  231|      0|                        int16_t n = ics->dpcm_noise_nrg;
  232|      0|                        noise_pcm_flag = 0;
  233|      0|                        noise_energy += n;
  234|      0|                    } else {
  235|      0|                        t = rvlc_huffman_sf(ld_sf, ld_esc /*, +1*/);
  236|      0|                        noise_energy += t;
  237|      0|                    }
  238|       |
  239|      0|                    ics->scale_factors[g][sfb] = noise_energy;
  240|       |
  241|      0|                    break;
  242|  2.16k|                default: /* spectral books */
  ------------------
  |  Branch (242:17): [True: 2.16k, False: 2.22k]
  ------------------
  243|       |
  244|       |                    /* decode scale factor */
  245|  2.16k|                    t = rvlc_huffman_sf(ld_sf, ld_esc /*, +1*/);
  246|       |
  247|  2.16k|                    scale_factor += t;
  248|  2.16k|                    if (scale_factor < 0 || scale_factor > 255)
  ------------------
  |  Branch (248:25): [True: 7, False: 2.16k]
  |  Branch (248:45): [True: 16, False: 2.14k]
  ------------------
  249|     23|                        return 4;
  250|       |
  251|  2.14k|                    ics->scale_factors[g][sfb] = min(scale_factor, scale_factor_max);
  ------------------
  |  |   60|  2.14k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 2.05k, False: 94]
  |  |  ------------------
  ------------------
  252|       |
  253|  2.14k|                    break;
  254|  4.39k|                }
  255|       |#ifdef PRINT_RVLC
  256|       |                printf("%3d:%4d%4d\n", sfb, ics->sfb_cb[g][sfb],
  257|       |                    ics->scale_factors[g][sfb]);
  258|       |#endif
  259|  4.36k|                if (t == 99)
  ------------------
  |  Branch (259:21): [True: 59, False: 4.30k]
  ------------------
  260|     59|                {
  261|     59|                    error = 1;
  262|     59|                }
  263|  4.36k|            }
  264|  16.1k|        }
  265|  9.04k|    }
  266|       |#ifdef PRINT_RVLC
  267|       |    printf("\n\n");
  268|       |#endif
  269|       |
  270|  6.59k|    return 0;
  271|  6.62k|}
rvlc.c:rvlc_huffman_sf:
  468|  4.10k|{
  469|  4.10k|    uint16_t i, j;
  470|  4.10k|    int16_t index;
  471|  4.10k|    uint32_t cw;
  472|  4.10k|    rvlc_huff_table *h = book_rvlc;
  473|  4.10k|    int8_t direction = +1;
  474|       |
  475|  4.10k|    i = h->len;
  476|  4.10k|    if (direction > 0)
  ------------------
  |  Branch (476:9): [True: 4.10k, False: 0]
  ------------------
  477|  4.10k|        cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
  478|      0|    else
  479|      0|        cw = 0 /* faad_getbits_rev(ld_sf, i DEBUGVAR(1,0,"")) */;
  480|       |
  481|  20.6k|    while ((cw != h->cw)
  ------------------
  |  Branch (481:12): [True: 16.5k, False: 4.10k]
  ------------------
  482|  16.5k|        && (i < 10))
  ------------------
  |  Branch (482:12): [True: 16.5k, False: 0]
  ------------------
  483|  16.5k|    {
  484|  16.5k|        h++;
  485|  16.5k|        j = h->len-i;
  486|  16.5k|        i += j;
  487|  16.5k|        cw <<= j;
  488|  16.5k|        if (direction > 0)
  ------------------
  |  Branch (488:13): [True: 16.5k, False: 0]
  ------------------
  489|  16.5k|            cw |= faad_getbits(ld_sf, j DEBUGVAR(1,0,""));
  490|      0|        else
  491|      0|            cw |= 0 /* faad_getbits_rev(ld_sf, j DEBUGVAR(1,0,"")) */;
  492|  16.5k|    }
  493|       |
  494|  4.10k|    index = h->index;
  495|       |
  496|  4.10k|    if (index == +ESC_VAL)
  ------------------
  |  |   46|  4.10k|#define ESC_VAL 7
  ------------------
  |  Branch (496:9): [True: 455, False: 3.65k]
  ------------------
  497|    455|    {
  498|    455|        int8_t esc = rvlc_huffman_esc(ld_esc /*, direction*/);
  499|    455|        if (esc == 99)
  ------------------
  |  Branch (499:13): [True: 0, False: 455]
  ------------------
  500|      0|            return 99;
  501|    455|        index += esc;
  502|       |#ifdef PRINT_RVLC
  503|       |        printf("esc: %d - ", esc);
  504|       |#endif
  505|    455|    }
  506|  4.10k|    if (index == -ESC_VAL)
  ------------------
  |  |   46|  4.10k|#define ESC_VAL 7
  ------------------
  |  Branch (506:9): [True: 296, False: 3.81k]
  ------------------
  507|    296|    {
  508|    296|        int8_t esc = rvlc_huffman_esc(ld_esc /*, direction*/);
  509|    296|        if (esc == 99)
  ------------------
  |  Branch (509:13): [True: 0, False: 296]
  ------------------
  510|      0|            return 99;
  511|    296|        index -= esc;
  512|       |#ifdef PRINT_RVLC
  513|       |        printf("esc: %d - ", esc);
  514|       |#endif
  515|    296|    }
  516|       |
  517|  4.10k|    return (int8_t)index;
  518|  4.10k|}
rvlc.c:rvlc_huffman_esc:
  522|    751|{
  523|    751|    uint16_t i, j;
  524|    751|    uint32_t cw;
  525|    751|    rvlc_huff_table *h = book_escape;
  526|    751|    int8_t direction = +1;
  527|       |
  528|    751|    i = h->len;
  529|    751|    if (direction > 0)
  ------------------
  |  Branch (529:9): [True: 751, False: 0]
  ------------------
  530|    751|        cw = faad_getbits(ld, i DEBUGVAR(1,0,""));
  531|      0|    else
  532|      0|        cw = 0 /* faad_getbits_rev(ld, i DEBUGVAR(1,0,"")) */;
  533|       |
  534|  5.35k|    while ((cw != h->cw)
  ------------------
  |  Branch (534:12): [True: 4.60k, False: 751]
  ------------------
  535|  4.60k|        && (i < 21))
  ------------------
  |  Branch (535:12): [True: 4.60k, False: 0]
  ------------------
  536|  4.60k|    {
  537|  4.60k|        h++;
  538|  4.60k|        j = h->len-i;
  539|  4.60k|        i += j;
  540|  4.60k|        cw <<= j;
  541|  4.60k|        if (direction > 0)
  ------------------
  |  Branch (541:13): [True: 4.60k, False: 0]
  ------------------
  542|  4.60k|            cw |= faad_getbits(ld, j DEBUGVAR(1,0,""));
  543|      0|        else
  544|      0|            cw |= 0 /* faad_getbits_rev(ld, j DEBUGVAR(1,0,"")) */;
  545|  4.60k|    }
  546|       |
  547|    751|    return (int8_t)h->index;
  548|    751|}

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

sbrDecodeInit:
   59|  91.4k|{
   60|  91.4k|    sbr_info *sbr = faad_malloc(sizeof(sbr_info));
   61|  91.4k|    memset(sbr, 0, sizeof(sbr_info));
   62|       |
   63|       |    /* save id of the parent element */
   64|  91.4k|    sbr->id_aac = id_aac;
   65|  91.4k|    sbr->sample_rate = sample_rate;
   66|       |
   67|  91.4k|    sbr->bs_freq_scale = 2;
   68|  91.4k|    sbr->bs_alter_scale = 1;
   69|  91.4k|    sbr->bs_noise_bands = 2;
   70|  91.4k|    sbr->bs_limiter_bands = 2;
   71|  91.4k|    sbr->bs_limiter_gains = 2;
   72|  91.4k|    sbr->bs_interpol_freq = 1;
   73|  91.4k|    sbr->bs_smoothing_mode = 1;
   74|  91.4k|    sbr->bs_start_freq = 5;
   75|  91.4k|    sbr->bs_amp_res = 1;
   76|  91.4k|    sbr->bs_samplerate_mode = 1;
   77|  91.4k|    sbr->prevEnvIsShort[0] = -1;
   78|  91.4k|    sbr->prevEnvIsShort[1] = -1;
   79|  91.4k|    sbr->header_count = 0;
   80|  91.4k|    sbr->Reset = 1;
   81|       |
   82|  91.4k|#ifdef DRM
   83|  91.4k|    sbr->Is_DRM_SBR = IsDRM;
   84|  91.4k|#endif
   85|  91.4k|    sbr->tHFGen = T_HFGEN;
  ------------------
  |  |   40|  91.4k|#define T_HFGEN 8
  ------------------
   86|  91.4k|    sbr->tHFAdj = T_HFADJ;
  ------------------
  |  |   41|  91.4k|#define T_HFADJ 2
  ------------------
   87|       |
   88|  91.4k|    sbr->bsco = 0;
   89|  91.4k|    sbr->bsco_prev = 0;
   90|  91.4k|    sbr->M_prev = 0;
   91|  91.4k|    sbr->frame_len = framelength;
   92|       |
   93|       |    /* force sbr reset */
   94|  91.4k|    sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  91.4k|#define INVALID ((uint8_t)-1)
  ------------------
   95|       |
   96|  91.4k|    if (framelength == 960)
  ------------------
  |  Branch (96:9): [True: 14.4k, False: 76.9k]
  ------------------
   97|  14.4k|    {
   98|  14.4k|        sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
  ------------------
  |  |   56|  14.4k|#define RATE              2
  ------------------
                      sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
  ------------------
  |  |   54|  14.4k|#define NO_TIME_SLOTS_960 15
  ------------------
   99|  14.4k|        sbr->numTimeSlots = NO_TIME_SLOTS_960;
  ------------------
  |  |   54|  14.4k|#define NO_TIME_SLOTS_960 15
  ------------------
  100|  14.4k|    }
  101|  76.9k|    else if (framelength == 1024)
  ------------------
  |  Branch (101:14): [True: 76.9k, False: 0]
  ------------------
  102|  76.9k|    {
  103|  76.9k|        sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
  ------------------
  |  |   56|  76.9k|#define RATE              2
  ------------------
                      sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
  ------------------
  |  |   55|  76.9k|#define NO_TIME_SLOTS     16
  ------------------
  104|  76.9k|        sbr->numTimeSlots = NO_TIME_SLOTS;
  ------------------
  |  |   55|  76.9k|#define NO_TIME_SLOTS     16
  ------------------
  105|  76.9k|    }
  106|      0|    else
  107|      0|    {
  108|      0|        faad_free(sbr);
  109|      0|        return NULL;
  110|      0|    }
  111|       |
  112|  91.4k|    sbr->GQ_ringbuf_index[0] = 0;
  113|  91.4k|    sbr->GQ_ringbuf_index[1] = 0;
  114|       |
  115|  91.4k|    if (id_aac == ID_CPE)
  ------------------
  |  |   87|  91.4k|#define ID_CPE 0x1
  ------------------
  |  Branch (115:9): [True: 14.5k, False: 76.9k]
  ------------------
  116|  14.5k|    {
  117|       |        /* stereo */
  118|  14.5k|        uint8_t j;
  119|  14.5k|        sbr->qmfa[0] = qmfa_init(32);
  120|  14.5k|        sbr->qmfa[1] = qmfa_init(32);
  121|  14.5k|        sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (121:34): [True: 3.51k, False: 10.9k]
  ------------------
  122|  14.5k|        sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (122:34): [True: 3.51k, False: 10.9k]
  ------------------
  123|       |
  124|  87.0k|        for (j = 0; j < 5; j++)
  ------------------
  |  Branch (124:21): [True: 72.5k, False: 14.5k]
  ------------------
  125|  72.5k|        {
  126|  72.5k|            sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  127|  72.5k|            sbr->G_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
  128|  72.5k|            sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  129|  72.5k|            sbr->Q_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
  130|  72.5k|        }
  131|       |
  132|  14.5k|        memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  133|  14.5k|        memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  134|  76.9k|    } else {
  135|       |        /* mono */
  136|  76.9k|        uint8_t j;
  137|  76.9k|        sbr->qmfa[0] = qmfa_init(32);
  138|  76.9k|        sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (138:34): [True: 30.2k, False: 46.6k]
  ------------------
  139|  76.9k|        sbr->qmfs[1] = NULL;
  140|       |
  141|   461k|        for (j = 0; j < 5; j++)
  ------------------
  |  Branch (141:21): [True: 384k, False: 76.9k]
  ------------------
  142|   384k|        {
  143|   384k|            sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  144|   384k|            sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
  145|   384k|        }
  146|       |
  147|  76.9k|        memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  148|  76.9k|    }
  149|       |
  150|  91.4k|    return sbr;
  151|  91.4k|}
sbrDecodeEnd:
  154|  91.4k|{
  155|  91.4k|    uint8_t j;
  156|       |
  157|  91.4k|    if (sbr)
  ------------------
  |  Branch (157:9): [True: 91.4k, False: 0]
  ------------------
  158|  91.4k|    {
  159|  91.4k|        qmfa_end(sbr->qmfa[0]);
  160|  91.4k|        qmfs_end(sbr->qmfs[0]);
  161|  91.4k|        if (sbr->qmfs[1] != NULL)
  ------------------
  |  Branch (161:13): [True: 17.9k, False: 73.4k]
  ------------------
  162|  17.9k|        {
  163|  17.9k|            qmfa_end(sbr->qmfa[1]);
  164|  17.9k|            qmfs_end(sbr->qmfs[1]);
  165|  17.9k|        }
  166|       |
  167|   548k|        for (j = 0; j < 5; j++)
  ------------------
  |  Branch (167:21): [True: 457k, False: 91.4k]
  ------------------
  168|   457k|        {
  169|   457k|            if (sbr->G_temp_prev[0][j]) faad_free(sbr->G_temp_prev[0][j]);
  ------------------
  |  Branch (169:17): [True: 457k, False: 0]
  ------------------
  170|   457k|            if (sbr->Q_temp_prev[0][j]) faad_free(sbr->Q_temp_prev[0][j]);
  ------------------
  |  Branch (170:17): [True: 457k, False: 0]
  ------------------
  171|   457k|            if (sbr->G_temp_prev[1][j]) faad_free(sbr->G_temp_prev[1][j]);
  ------------------
  |  Branch (171:17): [True: 72.5k, False: 384k]
  ------------------
  172|   457k|            if (sbr->Q_temp_prev[1][j]) faad_free(sbr->Q_temp_prev[1][j]);
  ------------------
  |  Branch (172:17): [True: 72.5k, False: 384k]
  ------------------
  173|   457k|        }
  174|       |
  175|  91.4k|#ifdef PS_DEC
  176|  91.4k|        if (sbr->ps != NULL)
  ------------------
  |  Branch (176:13): [True: 7.98k, False: 83.4k]
  ------------------
  177|  7.98k|            ps_free(sbr->ps);
  178|  91.4k|#endif
  179|       |
  180|  91.4k|#ifdef DRM_PS
  181|  91.4k|        if (sbr->drm_ps != NULL)
  ------------------
  |  Branch (181:13): [True: 4.98k, False: 86.4k]
  ------------------
  182|  4.98k|            drm_ps_free(sbr->drm_ps);
  183|  91.4k|#endif
  184|       |
  185|  91.4k|        faad_free(sbr);
  186|  91.4k|    }
  187|  91.4k|}
sbrReset:
  190|   102k|{
  191|   102k|    uint8_t j;
  192|   102k|    if (sbr->qmfa[0] != NULL)
  ------------------
  |  Branch (192:9): [True: 102k, False: 0]
  ------------------
  193|   102k|        memset(sbr->qmfa[0]->x, 0, 2 * sbr->qmfa[0]->channels * 10 * sizeof(real_t));
  194|   102k|    if (sbr->qmfa[1] != NULL)
  ------------------
  |  Branch (194:9): [True: 15.6k, False: 87.0k]
  ------------------
  195|  15.6k|        memset(sbr->qmfa[1]->x, 0, 2 * sbr->qmfa[1]->channels * 10 * sizeof(real_t));
  196|   102k|    if (sbr->qmfs[0] != NULL)
  ------------------
  |  Branch (196:9): [True: 102k, False: 0]
  ------------------
  197|   102k|        memset(sbr->qmfs[0]->v, 0, 2 * sbr->qmfs[0]->channels * 20 * sizeof(real_t));
  198|   102k|    if (sbr->qmfs[1] != NULL)
  ------------------
  |  Branch (198:9): [True: 20.6k, False: 82.1k]
  ------------------
  199|  20.6k|        memset(sbr->qmfs[1]->v, 0, 2 * sbr->qmfs[1]->channels * 20 * sizeof(real_t));
  200|       |
  201|   616k|    for (j = 0; j < 5; j++)
  ------------------
  |  Branch (201:17): [True: 513k, False: 102k]
  ------------------
  202|   513k|    {
  203|   513k|        if (sbr->G_temp_prev[0][j] != NULL)
  ------------------
  |  Branch (203:13): [True: 513k, False: 0]
  ------------------
  204|   513k|            memset(sbr->G_temp_prev[0][j], 0, 64*sizeof(real_t));
  205|   513k|        if (sbr->G_temp_prev[1][j] != NULL)
  ------------------
  |  Branch (205:13): [True: 78.4k, False: 435k]
  ------------------
  206|  78.4k|            memset(sbr->G_temp_prev[1][j], 0, 64*sizeof(real_t));
  207|   513k|        if (sbr->Q_temp_prev[0][j] != NULL)
  ------------------
  |  Branch (207:13): [True: 513k, False: 0]
  ------------------
  208|   513k|            memset(sbr->Q_temp_prev[0][j], 0, 64*sizeof(real_t));
  209|   513k|        if (sbr->Q_temp_prev[1][j] != NULL)
  ------------------
  |  Branch (209:13): [True: 78.4k, False: 435k]
  ------------------
  210|  78.4k|            memset(sbr->Q_temp_prev[1][j], 0, 64*sizeof(real_t));
  211|   513k|    }
  212|       |
  213|   102k|    memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  214|   102k|    memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
  215|       |
  216|   102k|    sbr->GQ_ringbuf_index[0] = 0;
  217|   102k|    sbr->GQ_ringbuf_index[1] = 0;
  218|   102k|    sbr->header_count = 0;
  219|   102k|    sbr->Reset = 1;
  220|       |
  221|   102k|    sbr->L_E_prev[0] = 0;
  222|   102k|    sbr->L_E_prev[1] = 0;
  223|   102k|    sbr->bs_freq_scale = 2;
  224|   102k|    sbr->bs_alter_scale = 1;
  225|   102k|    sbr->bs_noise_bands = 2;
  226|   102k|    sbr->bs_limiter_bands = 2;
  227|   102k|    sbr->bs_limiter_gains = 2;
  228|   102k|    sbr->bs_interpol_freq = 1;
  229|   102k|    sbr->bs_smoothing_mode = 1;
  230|   102k|    sbr->bs_start_freq = 5;
  231|   102k|    sbr->bs_amp_res = 1;
  232|   102k|    sbr->bs_samplerate_mode = 1;
  233|   102k|    sbr->prevEnvIsShort[0] = -1;
  234|   102k|    sbr->prevEnvIsShort[1] = -1;
  235|   102k|    sbr->bsco = 0;
  236|   102k|    sbr->bsco_prev = 0;
  237|   102k|    sbr->M_prev = 0;
  238|   102k|    sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|   102k|#define INVALID ((uint8_t)-1)
  ------------------
  239|       |
  240|   102k|    sbr->f_prev[0] = 0;
  241|   102k|    sbr->f_prev[1] = 0;
  242|  5.13M|    for (j = 0; j < MAX_M; j++)
  ------------------
  |  |   50|  5.13M|#define MAX_M       49
  ------------------
  |  Branch (242:17): [True: 5.03M, False: 102k]
  ------------------
  243|  5.03M|    {
  244|  5.03M|        sbr->E_prev[0][j] = 0;
  245|  5.03M|        sbr->Q_prev[0][j] = 0;
  246|  5.03M|        sbr->E_prev[1][j] = 0;
  247|  5.03M|        sbr->Q_prev[1][j] = 0;
  248|  5.03M|        sbr->bs_add_harmonic_prev[0][j] = 0;
  249|  5.03M|        sbr->bs_add_harmonic_prev[1][j] = 0;
  250|  5.03M|    }
  251|   102k|    sbr->bs_add_harmonic_flag_prev[0] = 0;
  252|   102k|    sbr->bs_add_harmonic_flag_prev[1] = 0;
  253|   102k|}
sbrDecodeCoupleFrame:
  458|  17.7k|{
  459|  17.7k|    uint8_t dont_process = 0;
  460|  17.7k|    uint8_t ret = 0;
  461|  17.7k|    ALIGN qmf_t X[MAX_NTSRHFG][64];
  ------------------
  |  |  167|  17.7k|#define qmf_t complex_t
  ------------------
  462|       |
  463|  17.7k|    if (sbr == NULL)
  ------------------
  |  Branch (463:9): [True: 0, False: 17.7k]
  ------------------
  464|      0|        return 20;
  465|       |
  466|       |    /* case can occur due to bit errors */
  467|  17.7k|    if (sbr->id_aac != ID_CPE)
  ------------------
  |  |   87|  17.7k|#define ID_CPE 0x1
  ------------------
  |  Branch (467:9): [True: 3, False: 17.7k]
  ------------------
  468|      3|        return 21;
  469|       |
  470|  17.7k|    if (sbr->ret || (sbr->header_count == 0))
  ------------------
  |  Branch (470:9): [True: 10.6k, False: 7.07k]
  |  Branch (470:21): [True: 5.37k, False: 1.70k]
  ------------------
  471|  16.0k|    {
  472|       |        /* don't process just upsample */
  473|  16.0k|        dont_process = 1;
  474|       |
  475|       |        /* Re-activate reset for next frame */
  476|  16.0k|        if (sbr->ret && sbr->Reset)
  ------------------
  |  Branch (476:13): [True: 10.6k, False: 5.37k]
  |  Branch (476:25): [True: 10.6k, False: 15]
  ------------------
  477|  10.6k|            sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  10.6k|#define INVALID ((uint8_t)-1)
  ------------------
  478|  16.0k|    }
  479|       |
  480|  17.7k|    if (just_seeked)
  ------------------
  |  Branch (480:9): [True: 10.7k, False: 6.99k]
  ------------------
  481|  10.7k|    {
  482|  10.7k|        sbr->just_seeked = 1;
  483|  10.7k|    } else {
  484|  6.99k|        sbr->just_seeked = 0;
  485|  6.99k|    }
  486|       |
  487|  17.7k|    sbr->ret += sbr_process_channel(sbr, left_chan, X, 0, dont_process, downSampledSBR);
  488|       |    /* subband synthesis */
  489|  17.7k|    if (downSampledSBR)
  ------------------
  |  Branch (489:9): [True: 4.34k, False: 13.4k]
  ------------------
  490|  4.34k|    {
  491|  4.34k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, left_chan);
  492|  13.4k|    } else {
  493|  13.4k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, left_chan);
  494|  13.4k|    }
  495|       |
  496|  17.7k|    sbr->ret += sbr_process_channel(sbr, right_chan, X, 1, dont_process, downSampledSBR);
  497|       |    /* subband synthesis */
  498|  17.7k|    if (downSampledSBR)
  ------------------
  |  Branch (498:9): [True: 4.34k, False: 13.4k]
  ------------------
  499|  4.34k|    {
  500|  4.34k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X, right_chan);
  501|  13.4k|    } else {
  502|  13.4k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X, right_chan);
  503|  13.4k|    }
  504|       |
  505|  17.7k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (505:9): [True: 12.2k, False: 5.48k]
  ------------------
  506|  12.2k|        sbr->just_seeked = 0;
  507|       |
  508|  17.7k|    if (sbr->header_count != 0 && sbr->ret == 0)
  ------------------
  |  Branch (508:9): [True: 12.2k, False: 5.48k]
  |  Branch (508:35): [True: 1.69k, False: 10.5k]
  ------------------
  509|  1.69k|    {
  510|  1.69k|        ret = sbr_save_prev_data(sbr, 0);
  511|  1.69k|        if (ret) return ret;
  ------------------
  |  Branch (511:13): [True: 0, False: 1.69k]
  ------------------
  512|  1.69k|        ret = sbr_save_prev_data(sbr, 1);
  513|  1.69k|        if (ret) return ret;
  ------------------
  |  Branch (513:13): [True: 0, False: 1.69k]
  ------------------
  514|  1.69k|    }
  515|       |
  516|  17.7k|    sbr_save_matrix(sbr, 0);
  517|  17.7k|    sbr_save_matrix(sbr, 1);
  518|       |
  519|  17.7k|    sbr->frame++;
  520|       |
  521|       |//#define POST_QMF_PRINT
  522|       |#ifdef POST_QMF_PRINT
  523|       |    {
  524|       |        int i;
  525|       |        for (i = 0; i < 2048; i++)
  526|       |        {
  527|       |            printf("%d\n", left_chan[i]);
  528|       |        }
  529|       |        for (i = 0; i < 2048; i++)
  530|       |        {
  531|       |            printf("%d\n", right_chan[i]);
  532|       |        }
  533|       |    }
  534|       |#endif
  535|       |
  536|  17.7k|    return 0;
  537|  17.7k|}
sbrDecodeSingleFrame:
  541|  83.8k|{
  542|  83.8k|    uint8_t dont_process = 0;
  543|  83.8k|    uint8_t ret = 0;
  544|  83.8k|    ALIGN qmf_t X[MAX_NTSRHFG][64];
  ------------------
  |  |  167|  83.8k|#define qmf_t complex_t
  ------------------
  545|       |
  546|  83.8k|    if (sbr == NULL)
  ------------------
  |  Branch (546:9): [True: 0, False: 83.8k]
  ------------------
  547|      0|        return 20;
  548|       |
  549|       |    /* case can occur due to bit errors */
  550|  83.8k|    if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   86|   167k|#define ID_SCE 0x0
  ------------------
                  if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   89|    250|#define ID_LFE 0x3
  ------------------
  |  Branch (550:9): [True: 250, False: 83.6k]
  |  Branch (550:34): [True: 0, False: 250]
  ------------------
  551|      0|        return 21;
  552|       |
  553|  83.8k|    if (sbr->ret || (sbr->header_count == 0))
  ------------------
  |  Branch (553:9): [True: 8.00k, False: 75.8k]
  |  Branch (553:21): [True: 73.7k, False: 2.06k]
  ------------------
  554|  81.8k|    {
  555|       |        /* don't process just upsample */
  556|  81.8k|        dont_process = 1;
  557|       |
  558|       |        /* Re-activate reset for next frame */
  559|  81.8k|        if (sbr->ret && sbr->Reset)
  ------------------
  |  Branch (559:13): [True: 8.00k, False: 73.7k]
  |  Branch (559:25): [True: 7.92k, False: 76]
  ------------------
  560|  7.92k|            sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  7.92k|#define INVALID ((uint8_t)-1)
  ------------------
  561|  81.8k|    }
  562|       |
  563|  83.8k|    if (just_seeked)
  ------------------
  |  Branch (563:9): [True: 42.5k, False: 41.3k]
  ------------------
  564|  42.5k|    {
  565|  42.5k|        sbr->just_seeked = 1;
  566|  42.5k|    } else {
  567|  41.3k|        sbr->just_seeked = 0;
  568|  41.3k|    }
  569|       |
  570|  83.8k|    sbr->ret += sbr_process_channel(sbr, channel, X, 0, dont_process, downSampledSBR);
  571|       |    /* subband synthesis */
  572|  83.8k|    if (downSampledSBR)
  ------------------
  |  Branch (572:9): [True: 32.7k, False: 51.0k]
  ------------------
  573|  32.7k|    {
  574|  32.7k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, channel);
  575|  51.0k|    } else {
  576|  51.0k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, channel);
  577|  51.0k|    }
  578|       |
  579|  83.8k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (579:9): [True: 9.64k, False: 74.2k]
  ------------------
  580|  9.64k|        sbr->just_seeked = 0;
  581|       |
  582|  83.8k|    if (sbr->header_count != 0 && sbr->ret == 0)
  ------------------
  |  Branch (582:9): [True: 9.48k, False: 74.3k]
  |  Branch (582:35): [True: 2.06k, False: 7.42k]
  ------------------
  583|  2.06k|    {
  584|  2.06k|        ret = sbr_save_prev_data(sbr, 0);
  585|  2.06k|        if (ret) return ret;
  ------------------
  |  Branch (585:13): [True: 11, False: 2.05k]
  ------------------
  586|  2.06k|    }
  587|       |
  588|  83.8k|    sbr_save_matrix(sbr, 0);
  589|       |
  590|  83.8k|    sbr->frame++;
  591|       |
  592|       |//#define POST_QMF_PRINT
  593|       |#ifdef POST_QMF_PRINT
  594|       |    {
  595|       |        int i;
  596|       |        for (i = 0; i < 2048; i++)
  597|       |        {
  598|       |            printf("%d\n", channel[i]);
  599|       |        }
  600|       |    }
  601|       |#endif
  602|       |
  603|  83.8k|    return 0;
  604|  83.8k|}
sbrDecodeSingleFramePS:
  609|  5.88k|{
  610|  5.88k|    uint8_t l, k;
  611|  5.88k|    uint8_t dont_process = 0;
  612|  5.88k|    uint8_t ret = 0;
  613|  5.88k|    ALIGN qmf_t X_left[MAX_NTSRHFG][64] = {{{0}}};
  ------------------
  |  |  167|  5.88k|#define qmf_t complex_t
  ------------------
  614|  5.88k|    ALIGN qmf_t X_right[MAX_NTSRHFG][64] = {{{0}}}; /* must set this to 0 */
  ------------------
  |  |  167|  5.88k|#define qmf_t complex_t
  ------------------
  615|       |
  616|  5.88k|    if (sbr == NULL)
  ------------------
  |  Branch (616:9): [True: 0, False: 5.88k]
  ------------------
  617|      0|        return 20;
  618|       |
  619|       |    /* case can occur due to bit errors */
  620|  5.88k|    if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   86|  11.7k|#define ID_SCE 0x0
  ------------------
                  if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
  ------------------
  |  |   89|      0|#define ID_LFE 0x3
  ------------------
  |  Branch (620:9): [True: 0, False: 5.88k]
  |  Branch (620:34): [True: 0, False: 0]
  ------------------
  621|      0|        return 21;
  622|       |
  623|  5.88k|    if (sbr->ret || (sbr->header_count == 0))
  ------------------
  |  Branch (623:9): [True: 3.52k, False: 2.36k]
  |  Branch (623:21): [True: 367, False: 1.99k]
  ------------------
  624|  3.89k|    {
  625|       |        /* don't process just upsample */
  626|  3.89k|        dont_process = 1;
  627|       |
  628|       |        /* Re-activate reset for next frame */
  629|  3.89k|        if (sbr->ret && sbr->Reset)
  ------------------
  |  Branch (629:13): [True: 3.52k, False: 367]
  |  Branch (629:25): [True: 3.43k, False: 90]
  ------------------
  630|  3.43k|            sbr->bs_start_freq_prev = INVALID;
  ------------------
  |  |   51|  3.43k|#define INVALID ((uint8_t)-1)
  ------------------
  631|  3.89k|    }
  632|       |
  633|  5.88k|    if (just_seeked)
  ------------------
  |  Branch (633:9): [True: 2.42k, False: 3.45k]
  ------------------
  634|  2.42k|    {
  635|  2.42k|        sbr->just_seeked = 1;
  636|  3.45k|    } else {
  637|  3.45k|        sbr->just_seeked = 0;
  638|  3.45k|    }
  639|       |
  640|  5.88k|    if (sbr->qmfs[1] == NULL)
  ------------------
  |  Branch (640:9): [True: 3.47k, False: 2.40k]
  ------------------
  641|  3.47k|    {
  642|  3.47k|        sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
  ------------------
  |  Branch (642:34): [True: 999, False: 2.48k]
  ------------------
  643|  3.47k|    }
  644|       |
  645|  5.88k|    sbr->ret += sbr_process_channel(sbr, left_channel, X_left, 0, dont_process, downSampledSBR);
  646|       |
  647|       |    /* copy some extra data for PS */
  648|  41.1k|    for (l = sbr->numTimeSlotsRate; l < sbr->numTimeSlotsRate + 6; l++)
  ------------------
  |  Branch (648:37): [True: 35.3k, False: 5.88k]
  ------------------
  649|  35.3k|    {
  650|   211k|        for (k = 0; k < 5; k++)
  ------------------
  |  Branch (650:21): [True: 176k, False: 35.3k]
  ------------------
  651|   176k|        {
  652|   176k|            QMF_RE(X_left[l][k]) = QMF_RE(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                          QMF_RE(X_left[l][k]) = QMF_RE(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  168|   176k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   176k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  653|   176k|            QMF_IM(X_left[l][k]) = QMF_IM(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                          QMF_IM(X_left[l][k]) = QMF_IM(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
  ------------------
  |  |  169|   176k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   176k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  654|   176k|        }
  655|  35.3k|    }
  656|       |
  657|       |    /* perform parametric stereo */
  658|  5.88k|#ifdef DRM_PS
  659|  5.88k|    if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (659:9): [True: 220, False: 5.66k]
  ------------------
  660|    220|    {
  661|    220|        drm_ps_decode(sbr->drm_ps, (sbr->ret > 0), X_left, X_right);
  662|  5.66k|    } else {
  663|  5.66k|#endif
  664|  5.66k|#ifdef PS_DEC
  665|  5.66k|        ps_decode(sbr->ps, X_left, X_right);
  666|  5.66k|#endif
  667|  5.66k|#ifdef DRM_PS
  668|  5.66k|    }
  669|  5.88k|#endif
  670|       |
  671|       |    /* subband synthesis */
  672|  5.88k|    if (downSampledSBR)
  ------------------
  |  Branch (672:9): [True: 1.71k, False: 4.16k]
  ------------------
  673|  1.71k|    {
  674|  1.71k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X_left, left_channel);
  675|  1.71k|        sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X_right, right_channel);
  676|  4.16k|    } else {
  677|  4.16k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X_left, left_channel);
  678|  4.16k|        sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X_right, right_channel);
  679|  4.16k|    }
  680|       |
  681|  5.88k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (681:9): [True: 5.75k, False: 130]
  ------------------
  682|  5.75k|        sbr->just_seeked = 0;
  683|       |
  684|  5.88k|    if (sbr->header_count != 0 && sbr->ret == 0)
  ------------------
  |  Branch (684:9): [True: 4.68k, False: 1.20k]
  |  Branch (684:35): [True: 1.99k, False: 2.69k]
  ------------------
  685|  1.99k|    {
  686|  1.99k|        ret = sbr_save_prev_data(sbr, 0);
  687|  1.99k|        if (ret) return ret;
  ------------------
  |  Branch (687:13): [True: 0, False: 1.99k]
  ------------------
  688|  1.99k|    }
  689|       |
  690|  5.88k|    sbr_save_matrix(sbr, 0);
  691|       |
  692|  5.88k|    sbr->frame++;
  693|       |
  694|  5.88k|    return 0;
  695|  5.88k|}
sbr_dec.c:sbr_process_channel:
  308|   125k|{
  309|   125k|    int16_t k, l;
  310|   125k|    uint8_t ret = 0;
  311|   125k|    (void)downSampledSBR;  /* TODO: remove parameter? */
  312|       |
  313|       |#ifdef SBR_LOW_POWER
  314|       |    ALIGN real_t deg[64];
  315|       |#endif
  316|       |
  317|   125k|#ifdef DRM
  318|   125k|    if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (318:9): [True: 357, False: 124k]
  ------------------
  319|    357|    {
  320|    357|        sbr->bsco = (uint8_t)max((int32_t)sbr->maxAACLine*32/(int32_t)sbr->frame_len - (int32_t)sbr->kx, 0);
  ------------------
  |  |   57|    357|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 41, False: 316]
  |  |  ------------------
  ------------------
  321|   124k|    } else {
  322|   124k|#endif
  323|   124k|        sbr->bsco = 0;
  324|   124k|#ifdef DRM
  325|   124k|    }
  326|   125k|#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|   125k|    if (dont_process)
  ------------------
  |  Branch (342:9): [True: 117k, False: 7.46k]
  ------------------
  343|   117k|        sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, 32);
  344|  7.46k|    else
  345|  7.46k|        sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, sbr->kx);
  346|       |
  347|   125k|    if (!dont_process)
  ------------------
  |  Branch (347:9): [True: 7.46k, False: 117k]
  ------------------
  348|  7.46k|    {
  349|  7.46k|#if 1
  350|       |        /* insert high frequencies here */
  351|       |        /* hf generation using patching */
  352|  7.46k|        hf_generation(sbr, sbr->Xsbr[ch], sbr->Xsbr[ch]
  353|       |#ifdef SBR_LOW_POWER
  354|       |            ,deg
  355|       |#endif
  356|  7.46k|            ,ch);
  357|  7.46k|#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|  7.46k|#if 1
  370|       |        /* hf adjustment */
  371|  7.46k|        ret = hf_adjustment(sbr, sbr->Xsbr[ch]
  372|       |#ifdef SBR_LOW_POWER
  373|       |            ,deg
  374|       |#endif
  375|  7.46k|            ,ch);
  376|  7.46k|#endif
  377|  7.46k|        if (ret > 0)
  ------------------
  |  Branch (377:13): [True: 6, False: 7.45k]
  ------------------
  378|      6|        {
  379|      6|            dont_process = 1;
  380|      6|        }
  381|  7.46k|    }
  382|       |
  383|   125k|    if ((sbr->just_seeked != 0) || dont_process)
  ------------------
  |  Branch (383:9): [True: 66.4k, False: 58.8k]
  |  Branch (383:36): [True: 53.0k, False: 5.72k]
  ------------------
  384|   119k|    {
  385|  3.89M|        for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (385:21): [True: 3.77M, False: 119k]
  ------------------
  386|  3.77M|        {
  387|   124M|            for (k = 0; k < 32; k++)
  ------------------
  |  Branch (387:25): [True: 120M, False: 3.77M]
  ------------------
  388|   120M|            {
  389|   120M|                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|   120M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   120M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|   120M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   120M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  390|   120M|#ifndef SBR_LOW_POWER
  391|   120M|                QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|   120M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   120M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|   120M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   120M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  392|   120M|#endif
  393|   120M|            }
  394|   124M|            for (k = 32; k < 64; k++)
  ------------------
  |  Branch (394:26): [True: 120M, False: 3.77M]
  ------------------
  395|   120M|            {
  396|   120M|                QMF_RE(X[l][k]) = 0;
  ------------------
  |  |  168|   120M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   120M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  397|   120M|#ifndef SBR_LOW_POWER
  398|   120M|                QMF_IM(X[l][k]) = 0;
  ------------------
  |  |  169|   120M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   120M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  399|   120M|#endif
  400|   120M|            }
  401|  3.77M|        }
  402|   119k|    } else {
  403|   185k|        for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (403:21): [True: 179k, False: 5.72k]
  ------------------
  404|   179k|        {
  405|   179k|            uint8_t kx_band, M_band, bsco_band;
  406|       |
  407|   179k|            if (l < sbr->t_E[ch][0])
  ------------------
  |  Branch (407:17): [True: 12.4k, False: 167k]
  ------------------
  408|  12.4k|            {
  409|  12.4k|                kx_band = sbr->kx_prev;
  410|  12.4k|                M_band = sbr->M_prev;
  411|  12.4k|                bsco_band = sbr->bsco_prev;
  412|   167k|            } else {
  413|   167k|                kx_band = sbr->kx;
  414|   167k|                M_band = sbr->M;
  415|   167k|                bsco_band = sbr->bsco;
  416|   167k|            }
  417|       |
  418|   179k|#ifndef SBR_LOW_POWER
  419|  3.18M|            for (k = 0; k < kx_band + bsco_band; k++)
  ------------------
  |  Branch (419:25): [True: 3.00M, False: 179k]
  ------------------
  420|  3.00M|            {
  421|  3.00M|                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  3.00M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.00M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  3.00M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.00M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  422|  3.00M|                QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  3.00M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.00M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  3.00M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.00M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  423|  3.00M|            }
  424|  2.53M|            for (k = kx_band + bsco_band; k < kx_band + M_band; k++)
  ------------------
  |  Branch (424:43): [True: 2.35M, False: 179k]
  ------------------
  425|  2.35M|            {
  426|  2.35M|                QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  2.35M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.35M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                              QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  168|  2.35M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.35M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  427|  2.35M|                QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  2.35M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.35M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                              QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
  ------------------
  |  |  169|  2.35M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.35M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  428|  2.35M|            }
  429|  6.31M|            for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
  ------------------
  |  |   57|   179k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 92, False: 179k]
  |  |  ------------------
  ------------------
  |  Branch (429:66): [True: 6.13M, False: 179k]
  ------------------
  430|  6.13M|            {
  431|  6.13M|                QMF_RE(X[l][k]) = 0;
  ------------------
  |  |  168|  6.13M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  6.13M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  432|  6.13M|                QMF_IM(X[l][k]) = 0;
  ------------------
  |  |  169|  6.13M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  6.13M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  433|  6.13M|            }
  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|       |            QMF_RE(X[l][kx_band - 1 + bsco_band]) +=
  448|       |                QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][kx_band - 1 + bsco_band]);
  449|       |#endif
  450|   179k|        }
  451|  5.72k|    }
  452|       |
  453|   125k|    return ret;
  454|   125k|}
sbr_dec.c:sbr_save_prev_data:
  256|  7.45k|{
  257|  7.45k|    uint8_t i;
  258|       |
  259|       |    /* save data for next frame */
  260|  7.45k|    sbr->kx_prev = sbr->kx;
  261|  7.45k|    sbr->M_prev = sbr->M;
  262|  7.45k|    sbr->bsco_prev = sbr->bsco;
  263|       |
  264|  7.45k|    sbr->L_E_prev[ch] = sbr->L_E[ch];
  265|       |
  266|       |    /* sbr->L_E[ch] can become 0 on files with bit errors */
  267|  7.45k|    if (sbr->L_E[ch] <= 0)
  ------------------
  |  Branch (267:9): [True: 11, False: 7.44k]
  ------------------
  268|     11|        return 19;
  269|       |
  270|  7.44k|    sbr->f_prev[ch] = sbr->f[ch][sbr->L_E[ch] - 1];
  271|   372k|    for (i = 0; i < MAX_M; i++)
  ------------------
  |  |   50|   372k|#define MAX_M       49
  ------------------
  |  Branch (271:17): [True: 364k, False: 7.44k]
  ------------------
  272|   364k|    {
  273|   364k|        sbr->E_prev[ch][i] = sbr->E[ch][i][sbr->L_E[ch] - 1];
  274|   364k|        sbr->Q_prev[ch][i] = sbr->Q[ch][i][sbr->L_Q[ch] - 1];
  275|   364k|    }
  276|       |
  277|   372k|    for (i = 0; i < MAX_M; i++)
  ------------------
  |  |   50|   372k|#define MAX_M       49
  ------------------
  |  Branch (277:17): [True: 364k, False: 7.44k]
  ------------------
  278|   364k|    {
  279|   364k|        sbr->bs_add_harmonic_prev[ch][i] = sbr->bs_add_harmonic[ch][i];
  280|   364k|    }
  281|  7.44k|    sbr->bs_add_harmonic_flag_prev[ch] = sbr->bs_add_harmonic_flag[ch];
  282|       |
  283|  7.44k|    if (sbr->l_A[ch] == sbr->L_E[ch])
  ------------------
  |  Branch (283:9): [True: 1.81k, False: 5.62k]
  ------------------
  284|  1.81k|        sbr->prevEnvIsShort[ch] = 0;
  285|  5.62k|    else
  286|  5.62k|        sbr->prevEnvIsShort[ch] = -1;
  287|       |
  288|  7.44k|    return 0;
  289|  7.45k|}
sbr_dec.c:sbr_save_matrix:
  292|   125k|{
  293|   125k|    uint8_t i;
  294|       |
  295|  1.12M|    for (i = 0; i < sbr->tHFGen; i++)
  ------------------
  |  Branch (295:17): [True: 1.00M, False: 125k]
  ------------------
  296|  1.00M|    {
  297|  1.00M|        memmove(sbr->Xsbr[ch][i], sbr->Xsbr[ch][i+sbr->numTimeSlotsRate], 64 * sizeof(qmf_t));
  298|  1.00M|    }
  299|  4.13M|    for (i = sbr->tHFGen; i < MAX_NTSRHFG; i++)
  ------------------
  |  |   46|  4.13M|#define MAX_NTSRHFG 40
  ------------------
  |  Branch (299:27): [True: 4.00M, False: 125k]
  ------------------
  300|  4.00M|    {
  301|  4.00M|        memset(sbr->Xsbr[ch][i], 0, 64 * sizeof(qmf_t));
  302|  4.00M|    }
  303|   125k|}

extract_envelope_data:
   42|  33.5k|{
   43|  33.5k|    uint8_t l, k;
   44|       |
   45|   112k|    for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (45:17): [True: 79.3k, False: 33.5k]
  ------------------
   46|  79.3k|    {
   47|  79.3k|        if (sbr->bs_df_env[ch][l] == 0)
  ------------------
  |  Branch (47:13): [True: 49.6k, False: 29.6k]
  ------------------
   48|  49.6k|        {
   49|   542k|            for (k = 1; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (49:25): [True: 492k, False: 49.6k]
  ------------------
   50|   492k|            {
   51|   492k|                sbr->E[ch][k][l] = sbr->E[ch][k - 1][l] + sbr->E[ch][k][l];
   52|   492k|                if (sbr->E[ch][k][l] < 0)
  ------------------
  |  Branch (52:21): [True: 12.6k, False: 480k]
  ------------------
   53|  12.6k|                    sbr->E[ch][k][l] = 0;
   54|   492k|            }
   55|       |
   56|  49.6k|        } else { /* bs_df_env == 1 */
   57|       |
   58|  29.6k|            uint8_t g = (l == 0) ? sbr->f_prev[ch] : sbr->f[ch][l-1];
  ------------------
  |  Branch (58:25): [True: 12.3k, False: 17.3k]
  ------------------
   59|  29.6k|            int16_t E_prev;
   60|       |
   61|  29.6k|            if (sbr->f[ch][l] == g)
  ------------------
  |  Branch (61:17): [True: 18.7k, False: 10.9k]
  ------------------
   62|  18.7k|            {
   63|   218k|                for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (63:29): [True: 199k, False: 18.7k]
  ------------------
   64|   199k|                {
   65|   199k|                    if (l == 0)
  ------------------
  |  Branch (65:25): [True: 46.5k, False: 153k]
  ------------------
   66|  46.5k|                        E_prev = sbr->E_prev[ch][k];
   67|   153k|                    else
   68|   153k|                        E_prev = sbr->E[ch][k][l - 1];
   69|       |
   70|   199k|                    sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
   71|   199k|                }
   72|       |
   73|  18.7k|            } else if ((g == 1) && (sbr->f[ch][l] == 0)) {
  ------------------
  |  Branch (73:24): [True: 3.64k, False: 7.30k]
  |  Branch (73:36): [True: 3.64k, False: 0]
  ------------------
   74|  3.64k|                uint8_t i;
   75|       |
   76|  19.1k|                for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (76:29): [True: 15.4k, False: 3.64k]
  ------------------
   77|  15.4k|                {
   78|   235k|                    for (i = 0; i < sbr->N_high; i++)
  ------------------
  |  Branch (78:33): [True: 220k, False: 15.4k]
  ------------------
   79|   220k|                    {
   80|   220k|                        if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
  ------------------
  |  |   52|   220k|#define HI_RES 1
  ------------------
                                      if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
  ------------------
  |  |   51|   220k|#define LO_RES 0
  ------------------
  |  Branch (80:29): [True: 15.4k, False: 204k]
  ------------------
   81|  15.4k|                        {
   82|  15.4k|                            if (l == 0)
  ------------------
  |  Branch (82:33): [True: 120, False: 15.3k]
  ------------------
   83|    120|                                E_prev = sbr->E_prev[ch][i];
   84|  15.3k|                            else
   85|  15.3k|                                E_prev = sbr->E[ch][i][l - 1];
   86|       |
   87|  15.4k|                            sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
   88|  15.4k|                        }
   89|   220k|                    }
   90|  15.4k|                }
   91|       |
   92|  7.30k|            } else if ((g == 0) && (sbr->f[ch][l] == 1)) {
  ------------------
  |  Branch (92:24): [True: 7.30k, False: 0]
  |  Branch (92:36): [True: 7.30k, False: 0]
  ------------------
   93|  7.30k|                uint8_t i;
   94|       |
   95|  89.2k|                for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (95:29): [True: 81.9k, False: 7.30k]
  ------------------
   96|  81.9k|                {
   97|   899k|                    for (i = 0; i < sbr->N_low; i++)
  ------------------
  |  Branch (97:33): [True: 817k, False: 81.9k]
  ------------------
   98|   817k|                    {
   99|   817k|                        if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
  ------------------
  |  |   51|   817k|#define LO_RES 0
  ------------------
                                      if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
  ------------------
  |  |   52|   817k|#define HI_RES 1
  ------------------
  |  Branch (99:29): [True: 455k, False: 361k]
  ------------------
  100|   455k|                            (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
  ------------------
  |  |   52|   455k|#define HI_RES 1
  ------------------
                                          (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
  ------------------
  |  |   51|   455k|#define LO_RES 0
  ------------------
  |  Branch (100:29): [True: 81.9k, False: 374k]
  ------------------
  101|  81.9k|                        {
  102|  81.9k|                            if (l == 0)
  ------------------
  |  Branch (102:33): [True: 52.9k, False: 28.9k]
  ------------------
  103|  52.9k|                                E_prev = sbr->E_prev[ch][i];
  104|  28.9k|                            else
  105|  28.9k|                                E_prev = sbr->E[ch][i][l - 1];
  106|       |
  107|  81.9k|                            sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
  108|  81.9k|                        }
  109|   817k|                    }
  110|  81.9k|                }
  111|  7.30k|            }
  112|  29.6k|        }
  113|  79.3k|    }
  114|  33.5k|}
extract_noise_floor_data:
  117|  33.5k|{
  118|  33.5k|    uint8_t l, k;
  119|       |
  120|  86.9k|    for (l = 0; l < sbr->L_Q[ch]; l++)
  ------------------
  |  Branch (120:17): [True: 53.4k, False: 33.5k]
  ------------------
  121|  53.4k|    {
  122|  53.4k|        if (sbr->bs_df_noise[ch][l] == 0)
  ------------------
  |  Branch (122:13): [True: 33.2k, False: 20.1k]
  ------------------
  123|  33.2k|        {
  124|  62.7k|            for (k = 1; k < sbr->N_Q; k++)
  ------------------
  |  Branch (124:25): [True: 29.5k, False: 33.2k]
  ------------------
  125|  29.5k|            {
  126|  29.5k|                sbr->Q[ch][k][l] = sbr->Q[ch][k][l] + sbr->Q[ch][k-1][l];
  127|  29.5k|            }
  128|  33.2k|        } else {
  129|  20.1k|            if (l == 0)
  ------------------
  |  Branch (129:17): [True: 12.6k, False: 7.52k]
  ------------------
  130|  12.6k|            {
  131|  39.6k|                for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (131:29): [True: 27.0k, False: 12.6k]
  ------------------
  132|  27.0k|                {
  133|  27.0k|                    sbr->Q[ch][k][l] = sbr->Q_prev[ch][k] + sbr->Q[ch][k][0];
  134|  27.0k|                }
  135|  12.6k|            } else {
  136|  22.0k|                for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (136:29): [True: 14.5k, False: 7.52k]
  ------------------
  137|  14.5k|                {
  138|  14.5k|                    sbr->Q[ch][k][l] = sbr->Q[ch][k][l - 1] + sbr->Q[ch][k][l];
  139|  14.5k|                }
  140|  7.52k|            }
  141|  20.1k|        }
  142|  53.4k|    }
  143|  33.5k|}
envelope_noise_dequantisation:
  396|  33.5k|{
  397|  33.5k|    if (sbr->bs_coupling == 0)
  ------------------
  |  Branch (397:9): [True: 24.2k, False: 9.32k]
  ------------------
  398|  24.2k|    {
  399|  24.2k|        int16_t exp;
  400|  24.2k|        uint8_t l, k;
  401|  24.2k|        uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
  ------------------
  |  Branch (401:23): [True: 10.5k, False: 13.7k]
  ------------------
  402|       |
  403|  77.6k|        for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (403:21): [True: 53.3k, False: 24.2k]
  ------------------
  404|  53.3k|        {
  405|   555k|            for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
  ------------------
  |  Branch (405:25): [True: 501k, False: 53.3k]
  ------------------
  406|   501k|            {
  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|   501k|                exp = (sbr->E[ch][k][l] >> amp);
  412|       |
  413|   501k|                if ((exp < 0) || (exp >= 64))
  ------------------
  |  Branch (413:21): [True: 20.3k, False: 481k]
  |  Branch (413:34): [True: 6.59k, False: 474k]
  ------------------
  414|  26.9k|                {
  415|  26.9k|                    sbr->E_orig[ch][k][l] = 0;
  416|   474k|                } else {
  417|   474k|                    sbr->E_orig[ch][k][l] = E_deq_tab[exp];
  418|       |
  419|       |                    /* save half the table size at the cost of 1 multiply */
  420|   474k|                    if (amp && (sbr->E[ch][k][l] & 1))
  ------------------
  |  Branch (420:25): [True: 341k, False: 132k]
  |  Branch (420:32): [True: 118k, False: 223k]
  ------------------
  421|   118k|                    {
  422|   118k|                        sbr->E_orig[ch][k][l] = MUL_C(sbr->E_orig[ch][k][l], COEF_CONST(1.414213562));
  ------------------
  |  |  285|   118k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  423|   118k|                    }
  424|   474k|                }
  425|   501k|            }
  426|  53.3k|        }
  427|       |
  428|  62.1k|        for (l = 0; l < sbr->L_Q[ch]; l++)
  ------------------
  |  Branch (428:21): [True: 37.9k, False: 24.2k]
  ------------------
  429|  37.9k|        {
  430|   103k|            for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (430:25): [True: 65.3k, False: 37.9k]
  ------------------
  431|  65.3k|            {
  432|  65.3k|                sbr->Q_div[ch][k][l] = calc_Q_div(sbr, ch, k, l);
  433|  65.3k|                sbr->Q_div2[ch][k][l] = calc_Q_div2(sbr, ch, k, l);
  434|  65.3k|            }
  435|  37.9k|        }
  436|  24.2k|    }
  437|  33.5k|}
unmap_envelope_noise:
  456|  4.66k|{
  457|  4.66k|    real_t tmp;
  458|  4.66k|    int16_t exp0, exp1;
  459|  4.66k|    uint8_t l, k;
  460|  4.66k|    uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
  ------------------
  |  Branch (460:20): [True: 1.66k, False: 2.99k]
  ------------------
  461|  4.66k|    uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
  ------------------
  |  Branch (461:20): [True: 1.66k, False: 2.99k]
  ------------------
  462|       |
  463|  17.6k|    for (l = 0; l < sbr->L_E[0]; l++)
  ------------------
  |  Branch (463:17): [True: 12.9k, False: 4.66k]
  ------------------
  464|  12.9k|    {
  465|   181k|        for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
  ------------------
  |  Branch (465:21): [True: 168k, False: 12.9k]
  ------------------
  466|   168k|        {
  467|       |            /* +6: * 64 ; +1: * 2 ; */
  468|   168k|            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|   168k|            exp1 = (sbr->E[1][k][l] >> amp1);
  476|       |
  477|   168k|            if ((exp0 < 0) || (exp0 >= 64) ||
  ------------------
  |  Branch (477:17): [True: 5.48k, False: 163k]
  |  Branch (477:31): [True: 19.1k, False: 144k]
  ------------------
  478|   144k|                (exp1 < 0) || (exp1 > 24))
  ------------------
  |  Branch (478:17): [True: 1.95k, False: 142k]
  |  Branch (478:31): [True: 41.3k, False: 100k]
  ------------------
  479|  67.8k|            {
  480|  67.8k|                sbr->E_orig[1][k][l] = 0;
  481|  67.8k|                sbr->E_orig[0][k][l] = 0;
  482|   100k|            } else {
  483|   100k|                tmp = E_deq_tab[exp0];
  484|   100k|                if (amp0 && (sbr->E[0][k][l] & 1))
  ------------------
  |  Branch (484:21): [True: 77.9k, False: 22.9k]
  |  Branch (484:29): [True: 31.0k, False: 46.8k]
  ------------------
  485|  31.0k|                {
  486|  31.0k|                    tmp = MUL_C(tmp, COEF_CONST(1.414213562));
  ------------------
  |  |  285|  31.0k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  487|  31.0k|                }
  488|       |
  489|       |                /* panning */
  490|   100k|                sbr->E_orig[0][k][l] = MUL_F(tmp, E_pan_tab[exp1]);
  ------------------
  |  |  286|   100k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  491|   100k|                sbr->E_orig[1][k][l] = MUL_F(tmp, E_pan_tab[24 - exp1]);
  ------------------
  |  |  286|   100k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  492|   100k|            }
  493|   168k|        }
  494|  12.9k|    }
  495|       |
  496|  12.4k|    for (l = 0; l < sbr->L_Q[0]; l++)
  ------------------
  |  Branch (496:17): [True: 7.74k, False: 4.66k]
  ------------------
  497|  7.74k|    {
  498|  27.2k|        for (k = 0; k < sbr->N_Q; k++)
  ------------------
  |  Branch (498:21): [True: 19.4k, False: 7.74k]
  ------------------
  499|  19.4k|        {
  500|  19.4k|            sbr->Q_div[0][k][l] = calc_Q_div(sbr, 0, k, l);
  501|  19.4k|            sbr->Q_div[1][k][l] = calc_Q_div(sbr, 1, k, l);
  502|  19.4k|            sbr->Q_div2[0][k][l] = calc_Q_div2(sbr, 0, k, l);
  503|  19.4k|            sbr->Q_div2[1][k][l] = calc_Q_div2(sbr, 1, k, l);
  504|  19.4k|        }
  505|  7.74k|    }
  506|  4.66k|}
sbr_e_nf.c:calc_Q_div:
  238|   104k|{
  239|   104k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (239:9): [True: 38.9k, False: 65.3k]
  ------------------
  240|  38.9k|    {
  241|       |        /* left channel */
  242|  38.9k|        if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
  ------------------
  |  Branch (242:14): [True: 2.57k, False: 36.4k]
  |  Branch (242:37): [True: 3.97k, False: 32.4k]
  ------------------
  243|  32.4k|            (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
  ------------------
  |  Branch (243:14): [True: 2.01k, False: 30.4k]
  |  Branch (243:37): [True: 8.60k, False: 21.8k]
  ------------------
  244|  17.1k|        {
  245|  17.1k|            return 0;
  246|  21.8k|        } else {
  247|       |            /* the pan parameter is always even */
  248|  21.8k|            if (ch == 0)
  ------------------
  |  Branch (248:17): [True: 10.9k, False: 10.9k]
  ------------------
  249|  10.9k|            {
  250|  10.9k|                return Q_div_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  251|  10.9k|            } else {
  252|  10.9k|                return Q_div_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  253|  10.9k|            }
  254|  21.8k|        }
  255|  65.3k|    } else {
  256|       |        /* no coupling */
  257|  65.3k|        if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
  ------------------
  |  Branch (257:13): [True: 2.89k, False: 62.4k]
  |  Branch (257:37): [True: 5.13k, False: 57.3k]
  ------------------
  258|  8.03k|        {
  259|  8.03k|            return 0;
  260|  57.3k|        } else {
  261|  57.3k|            return Q_div_tab[sbr->Q[ch][m][l]];
  262|  57.3k|        }
  263|  65.3k|    }
  264|   104k|}
sbr_e_nf.c:calc_Q_div2:
  357|   104k|{
  358|   104k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (358:9): [True: 38.9k, False: 65.3k]
  ------------------
  359|  38.9k|    {
  360|  38.9k|        if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
  ------------------
  |  Branch (360:14): [True: 2.57k, False: 36.4k]
  |  Branch (360:37): [True: 3.97k, False: 32.4k]
  ------------------
  361|  32.4k|            (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
  ------------------
  |  Branch (361:14): [True: 2.01k, False: 30.4k]
  |  Branch (361:37): [True: 8.60k, False: 21.8k]
  ------------------
  362|  17.1k|        {
  363|  17.1k|            return 0;
  364|  21.8k|        } else {
  365|       |            /* the pan parameter is always even */
  366|  21.8k|            if (ch == 0)
  ------------------
  |  Branch (366:17): [True: 10.9k, False: 10.9k]
  ------------------
  367|  10.9k|            {
  368|  10.9k|                return Q_div2_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  369|  10.9k|            } else {
  370|  10.9k|                return Q_div2_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
  371|  10.9k|            }
  372|  21.8k|        }
  373|  65.3k|    } else {
  374|       |        /* no coupling */
  375|  65.3k|        if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
  ------------------
  |  Branch (375:13): [True: 2.89k, False: 62.4k]
  |  Branch (375:37): [True: 5.13k, False: 57.3k]
  ------------------
  376|  8.03k|        {
  377|  8.03k|            return 0;
  378|  57.3k|        } else {
  379|  57.3k|            return Q_div2_tab[sbr->Q[ch][m][l]];
  380|  57.3k|        }
  381|  65.3k|    }
  382|   104k|}

qmf_start_channel:
   51|  40.6k|{
   52|  40.6k|    static const uint8_t startMinTable[12] = { 7, 7, 10, 11, 12, 16, 16,
   53|  40.6k|        17, 24, 32, 35, 48 };
   54|  40.6k|    static const uint8_t offsetIndexTable[12] = { 5, 5, 4, 4, 4, 3, 2, 1, 0,
   55|  40.6k|        6, 6, 6 };
   56|  40.6k|    static const int8_t offset[7][16] = {
   57|  40.6k|        { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 },
   58|  40.6k|        { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13 },
   59|  40.6k|        { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
   60|  40.6k|        { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
   61|  40.6k|        { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20 },
   62|  40.6k|        { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24 },
   63|  40.6k|        { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33 }
   64|  40.6k|    };
   65|  40.6k|    uint8_t startMin = startMinTable[get_sr_index(sample_rate)];
   66|  40.6k|    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|  40.6k|    if (bs_samplerate_mode)
  ------------------
  |  Branch (79:9): [True: 40.6k, False: 0]
  ------------------
   80|  40.6k|    {
   81|  40.6k|        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|  40.6k|    } else {
  104|      0|        return startMin + offset[6][bs_start_freq];
  105|      0|    }
  106|  40.6k|}
qmf_stop_channel:
  122|  40.6k|{
  123|  40.6k|    if (bs_stop_freq == 15)
  ------------------
  |  Branch (123:9): [True: 4.52k, False: 36.0k]
  ------------------
  124|  4.52k|    {
  125|  4.52k|        return min(64, k0 * 3);
  ------------------
  |  |   60|  4.52k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 1.81k, False: 2.71k]
  |  |  ------------------
  ------------------
  126|  36.0k|    } else if (bs_stop_freq == 14) {
  ------------------
  |  Branch (126:16): [True: 1.47k, False: 34.6k]
  ------------------
  127|  1.47k|        return min(64, k0 * 2);
  ------------------
  |  |   60|  1.47k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 1.47k]
  |  |  ------------------
  ------------------
  128|  34.6k|    } else {
  129|  34.6k|        static const uint8_t stopMinTable[12] = { 13, 15, 20, 21, 23,
  130|  34.6k|            32, 32, 35, 48, 64, 70, 96 };
  131|  34.6k|        static const int8_t offset[12][14] = {
  132|  34.6k|            { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 37, 44, 51 },
  133|  34.6k|            { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 36, 42, 49 },
  134|  34.6k|            { 0, 2, 4, 6, 8, 11, 14, 17, 21, 25, 29, 34, 39, 44 },
  135|  34.6k|            { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 33, 38, 43 },
  136|  34.6k|            { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 32, 36, 41 },
  137|  34.6k|            { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
  138|  34.6k|            { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
  139|  34.6k|            { 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 20, 23, 26, 29 },
  140|  34.6k|            { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16 },
  141|  34.6k|            { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  142|  34.6k|            { 0, -1, -2, -3, -4, -5, -6, -6, -6, -6, -6, -6, -6, -6 },
  143|  34.6k|            { 0, -3, -6, -9, -12, -15, -18, -20, -22, -24, -26, -28, -30, -32 }
  144|  34.6k|        };
  145|       |#if 0
  146|       |        uint8_t i;
  147|       |        int32_t stopDk[13], stopDk_t[14], k2;
  148|       |#endif
  149|  34.6k|        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|  34.6k|        return min(64, stopMin + offset[get_sr_index(sample_rate)][min(bs_stop_freq, 13)]);
  ------------------
  |  |   60|  69.2k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 0, False: 34.6k]
  |  |  |  Branch (60:28): [True: 31.9k, False: 2.62k]
  |  |  |  Branch (60:41): [True: 31.9k, False: 2.62k]
  |  |  ------------------
  ------------------
  185|  34.6k|    }
  186|       |
  187|       |    // return 0;
  188|  40.6k|}
master_frequency_table_fs0:
  197|  8.59k|{
  198|  8.59k|    int8_t incr;
  199|  8.59k|    uint8_t k;
  200|  8.59k|    uint8_t dk;
  201|  8.59k|    int32_t nrBands, k2Achieved;
  202|  8.59k|    int32_t k2Diff, vDk[64] = {0};
  203|       |
  204|       |    /* mft only defined for k2 > k0 */
  205|  8.59k|    if (k2 <= k0)
  ------------------
  |  Branch (205:9): [True: 119, False: 8.48k]
  ------------------
  206|    119|    {
  207|    119|        sbr->N_master = 0;
  208|    119|        return 1;
  209|    119|    }
  210|       |
  211|  8.48k|    dk = bs_alter_scale ? 2 : 1;
  ------------------
  |  Branch (211:10): [True: 2.23k, False: 6.24k]
  ------------------
  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|  8.48k|    if (bs_alter_scale)
  ------------------
  |  Branch (216:9): [True: 2.23k, False: 6.24k]
  ------------------
  217|  2.23k|    {
  218|  2.23k|        nrBands = (((k2-k0+2)>>2)<<1);
  219|  6.24k|    } else {
  220|  6.24k|        nrBands = (((k2-k0)>>1)<<1);
  221|  6.24k|    }
  222|  8.48k|#endif
  223|  8.48k|    nrBands = min(nrBands, 63);
  ------------------
  |  |   60|  8.48k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 8.48k, False: 0]
  |  |  ------------------
  ------------------
  224|  8.48k|    if (nrBands <= 0)
  ------------------
  |  Branch (224:9): [True: 139, False: 8.34k]
  ------------------
  225|    139|        return 1;
  226|       |
  227|  8.34k|    k2Achieved = k0 + nrBands * dk;
  228|  8.34k|    k2Diff = k2 - k2Achieved;
  229|   239k|    for (k = 0; k < nrBands; k++)
  ------------------
  |  Branch (229:17): [True: 230k, False: 8.34k]
  ------------------
  230|   230k|        vDk[k] = dk;
  231|       |
  232|  8.34k|    if (k2Diff)
  ------------------
  |  Branch (232:9): [True: 4.01k, False: 4.32k]
  ------------------
  233|  4.01k|    {
  234|  4.01k|        incr = (k2Diff > 0) ? -1 : 1;
  ------------------
  |  Branch (234:16): [True: 2.82k, False: 1.18k]
  ------------------
  235|  4.01k|        k = (uint8_t) ((k2Diff > 0) ? (nrBands-1) : 0);
  ------------------
  |  Branch (235:24): [True: 2.82k, False: 1.18k]
  ------------------
  236|       |
  237|  9.06k|        while (k2Diff != 0)
  ------------------
  |  Branch (237:16): [True: 5.04k, False: 4.01k]
  ------------------
  238|  5.04k|        {
  239|  5.04k|            vDk[k] -= incr;
  240|  5.04k|            k += incr;
  241|  5.04k|            k2Diff += incr;
  242|  5.04k|        }
  243|  4.01k|    }
  244|       |
  245|  8.34k|    sbr->f_master[0] = k0;
  246|   239k|    for (k = 1; k <= nrBands; k++)
  ------------------
  |  Branch (246:17): [True: 230k, False: 8.34k]
  ------------------
  247|   230k|        sbr->f_master[k] = (uint8_t)(sbr->f_master[k-1] + vDk[k-1]);
  248|       |
  249|  8.34k|    sbr->N_master = (uint8_t)nrBands;
  250|  8.34k|    sbr->N_master = (min(sbr->N_master, 64));
  ------------------
  |  |   60|  8.34k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 8.34k, 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|  8.34k|    return 0;
  262|  8.48k|}
master_frequency_table:
  357|  32.0k|{
  358|  32.0k|    uint8_t k, bands, twoRegions;
  359|  32.0k|    uint8_t k1;
  360|  32.0k|    uint8_t nrBand0, nrBand1;
  361|  32.0k|    int32_t vDk0[64] = {0}, vDk1[64] = {0};
  362|  32.0k|    int32_t vk0[64] = {0}, vk1[64] = {0};
  363|  32.0k|    uint8_t temp1[] = { 6, 5, 4 };
  364|  32.0k|    real_t q, qk;
  365|  32.0k|    int32_t A_1;
  366|       |#ifdef FIXED_POINT
  367|       |    real_t rk2, rk0;
  368|       |#endif
  369|  32.0k|    (void)bs_alter_scale;  /* TODO: remove parameter? */
  370|       |
  371|       |    /* mft only defined for k2 > k0 */
  372|  32.0k|    if (k2 <= k0)
  ------------------
  |  Branch (372:9): [True: 497, False: 31.5k]
  ------------------
  373|    497|    {
  374|    497|        sbr->N_master = 0;
  375|    497|        return 1;
  376|    497|    }
  377|       |
  378|  31.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|  31.5k|    if ((float)k2/(float)k0 > 2.2449)
  ------------------
  |  Branch (385:9): [True: 13.2k, False: 18.2k]
  ------------------
  386|  13.2k|#endif
  387|  13.2k|    {
  388|  13.2k|        twoRegions = 1;
  389|  13.2k|        k1 = k0 << 1;
  390|  18.2k|    } else {
  391|  18.2k|        twoRegions = 0;
  392|  18.2k|        k1 = k2;
  393|  18.2k|    }
  394|       |
  395|  31.5k|    nrBand0 = (uint8_t)(2 * find_bands(0, bands, k0, k1));
  396|  31.5k|    nrBand0 = min(nrBand0, 63);
  ------------------
  |  |   60|  31.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 31.5k, False: 0]
  |  |  ------------------
  ------------------
  397|  31.5k|    if (nrBand0 <= 0)
  ------------------
  |  Branch (397:9): [True: 337, False: 31.1k]
  ------------------
  398|    337|        return 1;
  399|       |
  400|  31.1k|    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|  31.1k|    qk = REAL_CONST(k0);
  ------------------
  |  |  288|  31.1k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  407|  31.1k|    A_1 = (int32_t)(qk + .5);
  408|  31.1k|#endif
  409|   310k|    for (k = 0; k <= nrBand0; k++)
  ------------------
  |  Branch (409:17): [True: 278k, False: 31.1k]
  ------------------
  410|   278k|    {
  411|   278k|        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|   278k|        qk *= q;
  417|   278k|        A_1 = (int32_t)(qk + 0.5);
  418|   278k|#endif
  419|   278k|        vDk0[k] = A_1 - A_0;
  420|   278k|    }
  421|       |
  422|       |    /* needed? */
  423|  31.1k|    qsort(vDk0, nrBand0, sizeof(vDk0[0]), int32cmp);
  424|       |
  425|  31.1k|    vk0[0] = k0;
  426|   251k|    for (k = 1; k <= nrBand0; k++)
  ------------------
  |  Branch (426:17): [True: 224k, False: 26.6k]
  ------------------
  427|   224k|    {
  428|   224k|        vk0[k] = vk0[k-1] + vDk0[k-1];
  429|   224k|        if (vDk0[k-1] == 0)
  ------------------
  |  Branch (429:13): [True: 4.49k, False: 220k]
  ------------------
  430|  4.49k|            return 1;
  431|   224k|    }
  432|       |
  433|  26.6k|    if (!twoRegions)
  ------------------
  |  Branch (433:9): [True: 14.5k, False: 12.1k]
  ------------------
  434|  14.5k|    {
  435|   128k|        for (k = 0; k <= nrBand0; k++)
  ------------------
  |  Branch (435:21): [True: 114k, False: 14.5k]
  ------------------
  436|   114k|            sbr->f_master[k] = (uint8_t) vk0[k];
  437|       |
  438|  14.5k|        sbr->N_master = nrBand0;
  439|  14.5k|        sbr->N_master = min(sbr->N_master, 64);
  ------------------
  |  |   60|  14.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 14.5k, False: 0]
  |  |  ------------------
  ------------------
  440|  14.5k|        return 0;
  441|  14.5k|    }
  442|       |
  443|  12.1k|    nrBand1 = (uint8_t)(2 * find_bands(1 /* warped */, bands, k1, k2));
  444|  12.1k|    nrBand1 = min(nrBand1, 63);
  ------------------
  |  |   60|  12.1k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 12.1k, False: 0]
  |  |  ------------------
  ------------------
  445|       |
  446|  12.1k|    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|  12.1k|    qk = REAL_CONST(k1);
  ------------------
  |  |  288|  12.1k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  453|  12.1k|    A_1 = (int32_t)(qk + .5);
  454|  12.1k|#endif
  455|  54.7k|    for (k = 0; k <= nrBand1 - 1; k++)
  ------------------
  |  Branch (455:17): [True: 42.5k, False: 12.1k]
  ------------------
  456|  42.5k|    {
  457|  42.5k|        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|  42.5k|        qk *= q;
  463|  42.5k|        A_1 = (int32_t)(qk + 0.5);
  464|  42.5k|#endif
  465|  42.5k|        vDk1[k] = A_1 - A_0;
  466|  42.5k|    }
  467|       |
  468|  12.1k|    if (vDk1[0] < vDk0[nrBand0 - 1])
  ------------------
  |  Branch (468:9): [True: 557, False: 11.6k]
  ------------------
  469|    557|    {
  470|    557|        int32_t change;
  471|       |
  472|       |        /* needed? */
  473|    557|        qsort(vDk1, nrBand1 + 1, sizeof(vDk1[0]), int32cmp);
  474|    557|        change = vDk0[nrBand0 - 1] - vDk1[0];
  475|    557|        vDk1[0] = vDk0[nrBand0 - 1];
  476|    557|        vDk1[nrBand1 - 1] = vDk1[nrBand1 - 1] - change;
  477|    557|    }
  478|       |
  479|       |    /* needed? */
  480|  12.1k|    qsort(vDk1, nrBand1, sizeof(vDk1[0]), int32cmp);
  481|  12.1k|    vk1[0] = k1;
  482|  54.7k|    for (k = 1; k <= nrBand1; k++)
  ------------------
  |  Branch (482:17): [True: 42.5k, False: 12.1k]
  ------------------
  483|  42.5k|    {
  484|  42.5k|        vk1[k] = vk1[k-1] + vDk1[k-1];
  485|  42.5k|        if (vDk1[k-1] == 0)
  ------------------
  |  Branch (485:13): [True: 0, False: 42.5k]
  ------------------
  486|      0|            return 1;
  487|  42.5k|    }
  488|       |
  489|  12.1k|    sbr->N_master = nrBand0 + nrBand1;
  490|  12.1k|    sbr->N_master = min(sbr->N_master, 64);
  ------------------
  |  |   60|  12.1k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 12.1k, False: 0]
  |  |  ------------------
  ------------------
  491|   144k|    for (k = 0; k <= nrBand0; k++)
  ------------------
  |  Branch (491:17): [True: 132k, False: 12.1k]
  ------------------
  492|   132k|    {
  493|   132k|        sbr->f_master[k] =  (uint8_t) vk0[k];
  494|   132k|    }
  495|  54.7k|    for (k = nrBand0 + 1; k <= sbr->N_master; k++)
  ------------------
  |  Branch (495:27): [True: 42.5k, False: 12.1k]
  ------------------
  496|  42.5k|    {
  497|  42.5k|        sbr->f_master[k] = (uint8_t) vk1[k - nrBand0];
  498|  42.5k|    }
  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|  12.1k|    return 0;
  510|  12.1k|}
derived_frequency_table:
  515|  40.6k|{
  516|  40.6k|    uint8_t k, i;
  517|  40.6k|    uint32_t minus;
  518|       |
  519|       |    /* The following relation shall be satisfied: bs_xover_band < N_Master */
  520|  40.6k|    if (sbr->N_master <= bs_xover_band)
  ------------------
  |  Branch (520:9): [True: 3.78k, False: 36.8k]
  ------------------
  521|  3.78k|        return 1;
  522|       |
  523|  36.8k|    sbr->N_high = sbr->N_master - bs_xover_band;
  524|  36.8k|    sbr->N_low = (sbr->N_high>>1) + (sbr->N_high - ((sbr->N_high>>1)<<1));
  525|       |
  526|  36.8k|    sbr->n[0] = sbr->N_low;
  527|  36.8k|    sbr->n[1] = sbr->N_high;
  528|       |
  529|   515k|    for (k = 0; k <= sbr->N_high; k++)
  ------------------
  |  Branch (529:17): [True: 478k, False: 36.8k]
  ------------------
  530|   478k|    {
  531|   478k|        sbr->f_table_res[HI_RES][k] = sbr->f_master[k + bs_xover_band];
  ------------------
  |  |   52|   478k|#define HI_RES 1
  ------------------
  532|   478k|    }
  533|       |
  534|  36.8k|    sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
  ------------------
  |  |   52|  36.8k|#define HI_RES 1
  ------------------
                  sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
  ------------------
  |  |   52|  36.8k|#define HI_RES 1
  ------------------
  535|  36.8k|    if (sbr->M > MAX_M)
  ------------------
  |  |   50|  36.8k|#define MAX_M       49
  ------------------
  |  Branch (535:9): [True: 511, False: 36.3k]
  ------------------
  536|    511|        return 1;
  537|  36.3k|    sbr->kx = sbr->f_table_res[HI_RES][0];
  ------------------
  |  |   52|  36.3k|#define HI_RES 1
  ------------------
  538|  36.3k|    if (sbr->kx > 32)
  ------------------
  |  Branch (538:9): [True: 3.13k, False: 33.1k]
  ------------------
  539|  3.13k|        return 1;
  540|  33.1k|    if (sbr->kx + sbr->M > 64)
  ------------------
  |  Branch (540:9): [True: 0, False: 33.1k]
  ------------------
  541|      0|        return 1;
  542|       |
  543|  33.1k|    minus = (sbr->N_high & 1) ? 1 : 0;
  ------------------
  |  Branch (543:13): [True: 9.50k, False: 23.6k]
  ------------------
  544|       |
  545|  33.1k|    i = 0;
  546|   270k|    for (k = 0; k <= sbr->N_low; k++)
  ------------------
  |  Branch (546:17): [True: 236k, False: 33.1k]
  ------------------
  547|   236k|    {
  548|   236k|        if (k != 0)
  ------------------
  |  Branch (548:13): [True: 203k, False: 33.1k]
  ------------------
  549|   203k|            i = (uint8_t)(2*k - minus);
  550|   236k|        sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
  ------------------
  |  |   51|   236k|#define LO_RES 0
  ------------------
                      sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
  ------------------
  |  |   52|   236k|#define HI_RES 1
  ------------------
  551|   236k|    }
  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|  33.1k|    sbr->N_Q = 0;
  573|  33.1k|    if (sbr->bs_noise_bands == 0)
  ------------------
  |  Branch (573:9): [True: 8.25k, False: 24.9k]
  ------------------
  574|  8.25k|    {
  575|  8.25k|        sbr->N_Q = 1;
  576|  24.9k|    } 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|  24.9k|        sbr->N_Q = (uint8_t)(max(1, find_bands(0, sbr->bs_noise_bands, sbr->kx, k2)));
  ------------------
  |  |   57|  24.9k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 3.93k, False: 20.9k]
  |  |  ------------------
  ------------------
  581|  24.9k|#endif
  582|  24.9k|        sbr->N_Q = min(5, sbr->N_Q);
  ------------------
  |  |   60|  24.9k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 218, False: 24.7k]
  |  |  ------------------
  ------------------
  583|  24.9k|    }
  584|       |
  585|  33.1k|    i = 0;
  586|   124k|    for (k = 0; k <= sbr->N_Q; k++)
  ------------------
  |  Branch (586:17): [True: 91.7k, False: 33.1k]
  ------------------
  587|  91.7k|    {
  588|  91.7k|        if (k != 0)
  ------------------
  |  Branch (588:13): [True: 58.6k, False: 33.1k]
  ------------------
  589|  58.6k|            i = i + (sbr->N_low - i)/(sbr->N_Q + 1 - k);
  590|  91.7k|        sbr->f_table_noise[k] = sbr->f_table_res[LO_RES][i];
  ------------------
  |  |   51|  91.7k|#define LO_RES 0
  ------------------
  591|  91.7k|    }
  592|       |
  593|       |    /* build table for mapping k to g in hf patching */
  594|  2.15M|    for (k = 0; k < 64; k++)
  ------------------
  |  Branch (594:17): [True: 2.12M, False: 33.1k]
  ------------------
  595|  2.12M|    {
  596|  2.12M|        uint8_t g;
  597|  4.98M|        for (g = 0; g < sbr->N_Q; g++)
  ------------------
  |  Branch (597:21): [True: 3.51M, False: 1.47M]
  ------------------
  598|  3.51M|        {
  599|  3.51M|            if ((sbr->f_table_noise[g] <= k) &&
  ------------------
  |  Branch (599:17): [True: 2.43M, False: 1.07M]
  ------------------
  600|  2.43M|                (k < sbr->f_table_noise[g+1]))
  ------------------
  |  Branch (600:17): [True: 646k, False: 1.78M]
  ------------------
  601|   646k|            {
  602|   646k|                sbr->table_map_k_to_g[k] = g;
  603|   646k|                break;
  604|   646k|            }
  605|  3.51M|        }
  606|  2.12M|    }
  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|  33.1k|    return 0;
  618|  33.1k|}
limiter_frequency_table:
  626|  7.20k|{
  627|       |#if 0
  628|       |    static const real_t limiterBandsPerOctave[] = { REAL_CONST(1.2),
  629|       |        REAL_CONST(2), REAL_CONST(3) };
  630|       |#else
  631|  7.20k|    static const real_t limiterBandsCompare[] = { REAL_CONST(1.327152),
  ------------------
  |  |  288|  7.20k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  632|  7.20k|        REAL_CONST(1.185093), REAL_CONST(1.119872) };
  ------------------
  |  |  288|  7.20k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
                      REAL_CONST(1.185093), REAL_CONST(1.119872) };
  ------------------
  |  |  288|  7.20k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  633|  7.20k|#endif
  634|  7.20k|    uint8_t k, s;
  635|  7.20k|    int8_t nrLim;
  636|       |#if 0
  637|       |    real_t limBands;
  638|       |#endif
  639|       |
  640|  7.20k|    sbr->f_table_lim[0][0] = sbr->f_table_res[LO_RES][0] - sbr->kx;
  ------------------
  |  |   51|  7.20k|#define LO_RES 0
  ------------------
  641|  7.20k|    sbr->f_table_lim[0][1] = sbr->f_table_res[LO_RES][sbr->N_low] - sbr->kx;
  ------------------
  |  |   51|  7.20k|#define LO_RES 0
  ------------------
  642|  7.20k|    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|  28.8k|    for (s = 1; s < 4; s++)
  ------------------
  |  Branch (653:17): [True: 21.6k, False: 7.20k]
  ------------------
  654|  21.6k|    {
  655|  21.6k|        uint8_t limTable[100 /*TODO*/] = {0};
  656|  21.6k|        uint8_t patchBorders[64/*??*/] = {0};
  657|       |
  658|       |#if 0
  659|       |        limBands = limiterBandsPerOctave[s - 1];
  660|       |#endif
  661|       |
  662|  21.6k|        patchBorders[0] = sbr->kx;
  663|  74.4k|        for (k = 1; k <= sbr->noPatches; k++)
  ------------------
  |  Branch (663:21): [True: 52.8k, False: 21.6k]
  ------------------
  664|  52.8k|        {
  665|  52.8k|            patchBorders[k] = patchBorders[k-1] + sbr->patchNoSubbands[k-1];
  666|  52.8k|        }
  667|       |
  668|   144k|        for (k = 0; k <= sbr->N_low; k++)
  ------------------
  |  Branch (668:21): [True: 123k, False: 21.6k]
  ------------------
  669|   123k|        {
  670|   123k|            limTable[k] = sbr->f_table_res[LO_RES][k];
  ------------------
  |  |   51|   123k|#define LO_RES 0
  ------------------
  671|   123k|        }
  672|  52.8k|        for (k = 1; k < sbr->noPatches; k++)
  ------------------
  |  Branch (672:21): [True: 31.2k, False: 21.6k]
  ------------------
  673|  31.2k|        {
  674|  31.2k|            limTable[k+sbr->N_low] = patchBorders[k];
  675|  31.2k|        }
  676|       |
  677|       |        /* needed */
  678|  21.6k|        qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), uint8cmp);
  679|  21.6k|        k = 1;
  680|  21.6k|        nrLim = sbr->noPatches + sbr->N_low - 1;
  681|       |
  682|  21.6k|        if (nrLim < 0) // TODO: BIG FAT PROBLEM
  ------------------
  |  Branch (682:13): [True: 0, False: 21.6k]
  ------------------
  683|      0|            return;
  684|       |
  685|   154k|restart:
  686|   154k|        if (k <= nrLim)
  ------------------
  |  Branch (686:13): [True: 132k, False: 21.6k]
  ------------------
  687|   132k|        {
  688|   132k|            real_t nOctaves;
  689|       |
  690|   132k|            if (limTable[k-1] != 0)
  ------------------
  |  Branch (690:17): [True: 132k, 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|   132k|                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|   132k|            if (nOctaves < limiterBandsCompare[s - 1])
  ------------------
  |  Branch (706:17): [True: 83.8k, False: 49.0k]
  ------------------
  707|  83.8k|#endif
  708|  83.8k|            {
  709|  83.8k|                uint8_t i;
  710|  83.8k|                if (limTable[k] != limTable[k-1])
  ------------------
  |  Branch (710:21): [True: 65.3k, False: 18.5k]
  ------------------
  711|  65.3k|                {
  712|  65.3k|                    uint8_t found = 0, found2 = 0;
  713|   351k|                    for (i = 0; i <= sbr->noPatches; i++)
  ------------------
  |  Branch (713:33): [True: 285k, False: 65.3k]
  ------------------
  714|   285k|                    {
  715|   285k|                        if (limTable[k] == patchBorders[i])
  ------------------
  |  Branch (715:29): [True: 23.1k, False: 262k]
  ------------------
  716|  23.1k|                            found = 1;
  717|   285k|                    }
  718|  65.3k|                    if (found)
  ------------------
  |  Branch (718:25): [True: 23.1k, False: 42.2k]
  ------------------
  719|  23.1k|                    {
  720|  23.1k|                        found2 = 0;
  721|   115k|                        for (i = 0; i <= sbr->noPatches; i++)
  ------------------
  |  Branch (721:37): [True: 92.6k, False: 23.1k]
  ------------------
  722|  92.6k|                        {
  723|  92.6k|                            if (limTable[k-1] == patchBorders[i])
  ------------------
  |  Branch (723:33): [True: 15.8k, False: 76.7k]
  ------------------
  724|  15.8k|                                found2 = 1;
  725|  92.6k|                        }
  726|  23.1k|                        if (found2)
  ------------------
  |  Branch (726:29): [True: 15.8k, False: 7.21k]
  ------------------
  727|  15.8k|                        {
  728|  15.8k|                            k++;
  729|  15.8k|                            goto restart;
  730|  15.8k|                        } else {
  731|       |                            /* remove (k-1)th element */
  732|  7.21k|                            limTable[k-1] = sbr->f_table_res[LO_RES][sbr->N_low];
  ------------------
  |  |   51|  7.21k|#define LO_RES 0
  ------------------
  733|  7.21k|                            qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), uint8cmp);
  734|  7.21k|                            nrLim--;
  735|  7.21k|                            goto restart;
  736|  7.21k|                        }
  737|  23.1k|                    }
  738|  65.3k|                }
  739|       |                /* remove kth element */
  740|  60.7k|                limTable[k] = sbr->f_table_res[LO_RES][sbr->N_low];
  ------------------
  |  |   51|  60.7k|#define LO_RES 0
  ------------------
  741|  60.7k|                qsort(limTable, nrLim, sizeof(limTable[0]), uint8cmp);
  742|  60.7k|                nrLim--;
  743|  60.7k|                goto restart;
  744|  83.8k|            } else {
  745|  49.0k|                k++;
  746|  49.0k|                goto restart;
  747|  49.0k|            }
  748|   132k|        }
  749|       |
  750|  21.6k|        sbr->N_L[s] = nrLim;
  751|   108k|        for (k = 0; k <= nrLim; k++)
  ------------------
  |  Branch (751:21): [True: 86.5k, False: 21.6k]
  ------------------
  752|  86.5k|        {
  753|  86.5k|            sbr->f_table_lim[s][k] = limTable[k] - sbr->kx;
  754|  86.5k|        }
  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|  21.6k|    }
  765|  7.20k|}
sbr_fbt.c:find_bands:
  269|  89.6k|{
  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|  89.6k|    real_t div = (real_t)log(2.0);
  304|  89.6k|    if (warp) div *= (real_t)1.3;
  ------------------
  |  Branch (304:9): [True: 12.1k, False: 77.4k]
  ------------------
  305|       |
  306|  89.6k|    return (int32_t)(bands * log((float)a1/(float)a0)/div + 0.5);
  307|  89.6k|#endif
  308|  89.6k|}
sbr_fbt.c:find_initial_power:
  311|  43.3k|{
  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|  43.3k|    return (real_t)pow((real_t)a1/(real_t)a0, 1.0/(real_t)bands);
  349|  43.3k|#endif
  350|  43.3k|}
sbr_fbt.c:int32cmp:
  109|   432k|{
  110|   432k|    return ((int)(*(int32_t*)a - *(int32_t*)b));
  111|   432k|}
sbr_fbt.c:uint8cmp:
  114|  1.40M|{
  115|  1.40M|    return ((int)(*(uint8_t*)a - *(uint8_t*)b));
  116|  1.40M|}

hf_adjustment:
   61|  7.46k|{
   62|  7.46k|    ALIGN sbr_hfadj_info adj = {{{0}}};
   63|  7.46k|    uint8_t ret = 0;
   64|       |
   65|  7.46k|    if (sbr->bs_frame_class[ch] == FIXFIX)
  ------------------
  |  |   46|  7.46k|#define FIXFIX 0
  ------------------
  |  Branch (65:9): [True: 1.58k, False: 5.87k]
  ------------------
   66|  1.58k|    {
   67|  1.58k|        sbr->l_A[ch] = -1;
   68|  5.87k|    } else if (sbr->bs_frame_class[ch] == VARFIX) {
  ------------------
  |  |   48|  5.87k|#define VARFIX 2
  ------------------
  |  Branch (68:16): [True: 2.26k, False: 3.60k]
  ------------------
   69|  2.26k|        if (sbr->bs_pointer[ch] > 1)
  ------------------
  |  Branch (69:13): [True: 1.18k, False: 1.08k]
  ------------------
   70|  1.18k|            sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
   71|  1.08k|        else
   72|  1.08k|            sbr->l_A[ch] = -1;
   73|  3.60k|    } else {
   74|  3.60k|        if (sbr->bs_pointer[ch] == 0)
  ------------------
  |  Branch (74:13): [True: 1.36k, False: 2.24k]
  ------------------
   75|  1.36k|            sbr->l_A[ch] = -1;
   76|  2.24k|        else
   77|  2.24k|            sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
   78|  3.60k|    }
   79|       |
   80|  7.46k|    ret = estimate_current_envelope(sbr, &adj, Xsbr, ch);
   81|  7.46k|    if (ret > 0)
  ------------------
  |  Branch (81:9): [True: 6, False: 7.45k]
  ------------------
   82|      6|        return 1;
   83|       |
   84|  7.45k|    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|  7.45k|    hf_assembly(sbr, &adj, Xsbr, ch);
   92|       |
   93|  7.45k|    return 0;
   94|  7.46k|}
sbr_hfadj.c:estimate_current_envelope:
  139|  7.46k|{
  140|  7.46k|    uint8_t m, l, j, k, k_l, k_h, p;
  141|  7.46k|    real_t nrg, div;
  142|  7.46k|    (void)adj;  /* TODO: remove parameter? */
  143|       |#ifdef FIXED_POINT
  144|       |    const real_t half = REAL_CONST(0.5);
  145|       |    real_t limit;
  146|       |    real_t mul;
  147|       |#else
  148|  7.46k|    const real_t half = 0;  /* Compiler is smart enough to eliminate +0 op. */
  149|  7.46k|    const real_t limit = FLT_MAX;
  150|  7.46k|#endif
  151|       |
  152|  7.46k|    if (sbr->bs_interpol_freq == 1)
  ------------------
  |  Branch (152:9): [True: 4.46k, False: 3.00k]
  ------------------
  153|  4.46k|    {
  154|  13.1k|        for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (154:21): [True: 8.71k, False: 4.45k]
  ------------------
  155|  8.71k|        {
  156|  8.71k|            uint8_t i, l_i, u_i;
  157|       |
  158|  8.71k|            l_i = sbr->t_E[ch][l];
  159|  8.71k|            u_i = sbr->t_E[ch][l+1];
  160|       |
  161|  8.71k|            div = (real_t)(u_i - l_i);
  162|       |
  163|  8.71k|            if (div <= 0)
  ------------------
  |  Branch (163:17): [True: 315, False: 8.39k]
  ------------------
  164|    315|                div = 1;
  165|       |#ifdef FIXED_POINT
  166|       |            limit = div << (30 - (COEF_BITS - REAL_BITS));
  167|       |            mul = (1 << (COEF_BITS - REAL_BITS)) / div;
  168|       |#endif
  169|       |
  170|  96.3k|            for (m = 0; m < sbr->M; m++)
  ------------------
  |  Branch (170:25): [True: 87.6k, False: 8.70k]
  ------------------
  171|  87.6k|            {
  172|  87.6k|                nrg = 0;
  173|       |
  174|  1.50M|                for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
  ------------------
  |  Branch (174:45): [True: 1.41M, False: 87.6k]
  ------------------
  175|  1.41M|                {
  176|  1.41M|                    real_t re = QMF_RE(Xsbr[i][m + sbr->kx]) + half;
  ------------------
  |  |  168|  1.41M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.41M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  177|  1.41M|                    real_t im = QMF_IM(Xsbr[i][m + sbr->kx]) + half;
  ------------------
  |  |  169|  1.41M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.41M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  178|  1.41M|                    (void)im;
  179|       |                    /* Actually, that should be MUL_R. On floating-point build
  180|       |                       that is the same. On fixed point-build we use it to
  181|       |                       pre-scale result (to aviod overflow). That, of course
  182|       |                       causes some precision loss. */
  183|  1.41M|                    nrg += MUL_C(re, re)
  ------------------
  |  |  285|  1.41M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  184|  1.41M|#ifndef SBR_LOW_POWER
  185|  1.41M|                        + MUL_C(im, im)
  ------------------
  |  |  285|  1.41M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  186|  1.41M|#endif
  187|  1.41M|                        ;
  188|  1.41M|                }
  189|       |
  190|  87.6k|                if (nrg < -limit || nrg > limit)
  ------------------
  |  Branch (190:21): [True: 0, False: 87.6k]
  |  Branch (190:37): [True: 3, False: 87.6k]
  ------------------
  191|      3|                    return 1;
  192|       |#ifdef FIXED_POINT
  193|       |                sbr->E_curr[ch][m][l] = nrg * mul;
  194|       |#else
  195|  87.6k|                sbr->E_curr[ch][m][l] = nrg / div;
  196|  87.6k|#endif
  197|       |#ifdef SBR_LOW_POWER
  198|       |#ifdef FIXED_POINT
  199|       |                sbr->E_curr[ch][m][l] <<= 1;
  200|       |#else
  201|       |                sbr->E_curr[ch][m][l] *= 2;
  202|       |#endif
  203|       |#endif
  204|  87.6k|            }
  205|  8.71k|        }
  206|  4.46k|    } else {
  207|  7.09k|        for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (207:21): [True: 4.09k, False: 2.99k]
  ------------------
  208|  4.09k|        {
  209|  36.7k|            for (p = 0; p < sbr->n[sbr->f[ch][l]]; p++)
  ------------------
  |  Branch (209:25): [True: 32.6k, False: 4.09k]
  ------------------
  210|  32.6k|            {
  211|  32.6k|                k_l = sbr->f_table_res[sbr->f[ch][l]][p];
  212|  32.6k|                k_h = sbr->f_table_res[sbr->f[ch][l]][p+1];
  213|       |
  214|   117k|                for (k = k_l; k < k_h; k++)
  ------------------
  |  Branch (214:31): [True: 85.0k, False: 32.6k]
  ------------------
  215|  85.0k|                {
  216|  85.0k|                    uint8_t i, l_i, u_i;
  217|  85.0k|                    nrg = 0;
  218|       |
  219|  85.0k|                    l_i = sbr->t_E[ch][l];
  220|  85.0k|                    u_i = sbr->t_E[ch][l+1];
  221|       |
  222|  85.0k|                    div = (real_t)((u_i - l_i)*(k_h - k_l));
  223|       |
  224|  85.0k|                    if (div <= 0)
  ------------------
  |  Branch (224:25): [True: 2.40k, False: 82.6k]
  ------------------
  225|  2.40k|                        div = 1;
  226|       |#ifdef FIXED_POINT
  227|       |                    limit = div << (30 - (COEF_BITS - REAL_BITS));
  228|       |                    mul = (1 << (COEF_BITS - REAL_BITS)) / div;
  229|       |#endif
  230|       |
  231|  2.07M|                    for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
  ------------------
  |  Branch (231:49): [True: 1.99M, False: 85.0k]
  ------------------
  232|  1.99M|                    {
  233|  8.05M|                        for (j = k_l; j < k_h; j++)
  ------------------
  |  Branch (233:39): [True: 6.06M, False: 1.99M]
  ------------------
  234|  6.06M|                        {
  235|  6.06M|                            real_t re = QMF_RE(Xsbr[i][j]) + half;
  ------------------
  |  |  168|  6.06M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  6.06M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  236|  6.06M|                            real_t im = QMF_IM(Xsbr[i][j]) + half;
  ------------------
  |  |  169|  6.06M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  6.06M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  237|  6.06M|                            (void)im;
  238|       |                            /* Actually, that should be MUL_R. On floating-point build
  239|       |                               that is the same. On fixed point-build we use it to
  240|       |                               pre-scale result (to aviod overflow). That, of course
  241|       |                               causes some precision loss. */
  242|  6.06M|                            nrg += MUL_C(re, re)
  ------------------
  |  |  285|  6.06M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  243|  6.06M|#ifndef SBR_LOW_POWER
  244|  6.06M|                                + MUL_C(im, im)
  ------------------
  |  |  285|  6.06M|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  245|  6.06M|#endif
  246|  6.06M|                                ;
  247|  6.06M|                        }
  248|  1.99M|                    }
  249|       |
  250|  85.0k|                    if (nrg < -limit || nrg > limit)
  ------------------
  |  Branch (250:25): [True: 0, False: 85.0k]
  |  Branch (250:41): [True: 3, False: 85.0k]
  ------------------
  251|      3|                        return 1;
  252|       |#ifdef FIXED_POINT
  253|       |                    sbr->E_curr[ch][k - sbr->kx][l] = nrg * mul;
  254|       |#else
  255|  85.0k|                    sbr->E_curr[ch][k - sbr->kx][l] = nrg / div;
  256|  85.0k|#endif
  257|       |#ifdef SBR_LOW_POWER
  258|       |#ifdef FIXED_POINT
  259|       |                    sbr->E_curr[ch][k - sbr->kx][l] <<= 1;
  260|       |#else
  261|       |                    sbr->E_curr[ch][k - sbr->kx][l] *= 2;
  262|       |#endif
  263|       |#endif
  264|  85.0k|                }
  265|  32.6k|            }
  266|  4.09k|        }
  267|  3.00k|    }
  268|       |
  269|  7.45k|    return 0;
  270|  7.46k|}
sbr_hfadj.c:calculate_gain:
 1198|  7.45k|{
 1199|  7.45k|    static real_t limGain[] = { 0.5, 1.0, 2.0, 1e10 };
 1200|  7.45k|    uint8_t m, l, k;
 1201|       |
 1202|  7.45k|    uint8_t current_t_noise_band = 0;
 1203|  7.45k|    uint8_t S_mapped;
 1204|       |
 1205|  7.45k|    ALIGN real_t Q_M_lim[MAX_M];
 1206|  7.45k|    ALIGN real_t G_lim[MAX_M];
 1207|  7.45k|    ALIGN real_t G_boost;
 1208|  7.45k|    ALIGN real_t S_M[MAX_M];
 1209|       |
 1210|  20.2k|    for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (1210:17): [True: 12.7k, False: 7.45k]
  ------------------
 1211|  12.7k|    {
 1212|  12.7k|        uint8_t current_f_noise_band = 0;
 1213|  12.7k|        uint8_t current_res_band = 0;
 1214|  12.7k|        uint8_t current_res_band2 = 0;
 1215|  12.7k|        uint8_t current_hi_res_band = 0;
 1216|       |
 1217|  12.7k|        real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
  ------------------
  |  Branch (1217:25): [True: 1.60k, False: 11.1k]
  |  Branch (1217:46): [True: 241, False: 10.9k]
  ------------------
 1218|       |
 1219|  12.7k|        S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
 1220|       |
 1221|  12.7k|        if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
  ------------------
  |  Branch (1221:13): [True: 3.05k, False: 9.74k]
  ------------------
 1222|  3.05k|        {
 1223|  3.05k|            current_t_noise_band++;
 1224|  3.05k|        }
 1225|       |
 1226|  39.3k|        for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
  ------------------
  |  Branch (1226:21): [True: 26.5k, False: 12.7k]
  ------------------
 1227|  26.5k|        {
 1228|  26.5k|            real_t G_max;
 1229|  26.5k|            real_t den = 0;
 1230|  26.5k|            real_t acc1 = 0;
 1231|  26.5k|            real_t acc2 = 0;
 1232|       |
 1233|  26.5k|            uint8_t ml1, ml2;
 1234|       |
 1235|  26.5k|            ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
 1236|  26.5k|            ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
 1237|       |
 1238|  26.5k|            if (ml1 > MAX_M)
  ------------------
  |  |   50|  26.5k|#define MAX_M       49
  ------------------
  |  Branch (1238:17): [True: 0, False: 26.5k]
  ------------------
 1239|      0|                ml1 = MAX_M;
  ------------------
  |  |   50|      0|#define MAX_M       49
  ------------------
 1240|       |
 1241|  26.5k|            if (ml2 > MAX_M)
  ------------------
  |  |   50|  26.5k|#define MAX_M       49
  ------------------
  |  Branch (1241:17): [True: 0, False: 26.5k]
  ------------------
 1242|      0|                ml2 = MAX_M;
  ------------------
  |  |   50|      0|#define MAX_M       49
  ------------------
 1243|       |
 1244|       |
 1245|       |            /* calculate the accumulated E_orig and E_curr over the limiter band */
 1246|   194k|            for (m = ml1; m < ml2; m++)
  ------------------
  |  Branch (1246:27): [True: 167k, False: 26.5k]
  ------------------
 1247|   167k|            {
 1248|   167k|                if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
  ------------------
  |  Branch (1248:21): [True: 49.8k, False: 117k]
  ------------------
 1249|  49.8k|                {
 1250|  49.8k|                    current_res_band++;
 1251|  49.8k|                }
 1252|   167k|                acc1 += sbr->E_orig[ch][current_res_band][l];
 1253|   167k|                acc2 += sbr->E_curr[ch][m][l];
 1254|   167k|            }
 1255|       |
 1256|       |
 1257|       |            /* calculate the maximum gain */
 1258|       |            /* ratio of the energy of the original signal and the energy
 1259|       |             * of the HF generated signal
 1260|       |             */
 1261|  26.5k|            G_max = ((EPS + acc1) / (EPS + acc2)) * limGain[sbr->bs_limiter_gains];
  ------------------
  |  |  275|  26.5k|#define EPS (1e-12)
  ------------------
                          G_max = ((EPS + acc1) / (EPS + acc2)) * limGain[sbr->bs_limiter_gains];
  ------------------
  |  |  275|  26.5k|#define EPS (1e-12)
  ------------------
 1262|  26.5k|            G_max = min(G_max, 1e10);
  ------------------
  |  |   60|  26.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 1.60k, False: 24.9k]
  |  |  ------------------
  ------------------
 1263|       |
 1264|       |
 1265|   194k|            for (m = ml1; m < ml2; m++)
  ------------------
  |  Branch (1265:27): [True: 167k, False: 26.5k]
  ------------------
 1266|   167k|            {
 1267|   167k|                real_t Q_M, G;
 1268|   167k|                real_t Q_div, Q_div2;
 1269|   167k|                uint8_t S_index_mapped;
 1270|       |
 1271|       |
 1272|       |                /* check if m is on a noise band border */
 1273|   167k|                if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
  ------------------
  |  Branch (1273:21): [True: 12.1k, False: 155k]
  ------------------
 1274|  12.1k|                {
 1275|       |                    /* step to next noise band */
 1276|  12.1k|                    current_f_noise_band++;
 1277|  12.1k|                }
 1278|       |
 1279|       |
 1280|       |                /* check if m is on a resolution band border */
 1281|   167k|                if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
  ------------------
  |  Branch (1281:21): [True: 49.8k, False: 117k]
  ------------------
 1282|  49.8k|                {
 1283|       |                    /* step to next resolution band */
 1284|  49.8k|                    current_res_band2++;
 1285|       |
 1286|       |                    /* if we move to a new resolution band, we should check if we are
 1287|       |                     * going to add a sinusoid in this band
 1288|       |                     */
 1289|  49.8k|                    S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
 1290|  49.8k|                }
 1291|       |
 1292|       |
 1293|       |                /* check if m is on a HI_RES band border */
 1294|   167k|                if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
  ------------------
  |  |   52|   167k|#define HI_RES 1
  ------------------
  |  Branch (1294:21): [True: 82.5k, False: 84.9k]
  ------------------
 1295|  82.5k|                {
 1296|       |                    /* step to next HI_RES band */
 1297|  82.5k|                    current_hi_res_band++;
 1298|  82.5k|                }
 1299|       |
 1300|       |
 1301|       |                /* find S_index_mapped
 1302|       |                 * S_index_mapped can only be 1 for the m in the middle of the
 1303|       |                 * current HI_RES band
 1304|       |                 */
 1305|   167k|                S_index_mapped = 0;
 1306|   167k|                if ((l >= sbr->l_A[ch]) ||
  ------------------
  |  Branch (1306:21): [True: 108k, False: 58.8k]
  ------------------
 1307|  58.8k|                    (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
  ------------------
  |  Branch (1307:22): [True: 1.85k, False: 57.0k]
  |  Branch (1307:76): [True: 1.85k, False: 0]
  ------------------
 1308|   110k|                {
 1309|       |                    /* find the middle subband of the HI_RES frequency band */
 1310|   110k|                    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|   110k|#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|   110k|#define HI_RES 1
  ------------------
  |  Branch (1310:25): [True: 58.1k, False: 52.3k]
  ------------------
 1311|  58.1k|                        S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
 1312|   110k|                }
 1313|       |
 1314|       |
 1315|       |                /* Q_div: [0..1] (1/(1+Q_mapped)) */
 1316|   167k|                Q_div = sbr->Q_div[ch][current_f_noise_band][current_t_noise_band];
 1317|       |
 1318|       |
 1319|       |                /* Q_div2: [0..1] (Q_mapped/(1+Q_mapped)) */
 1320|   167k|                Q_div2 = sbr->Q_div2[ch][current_f_noise_band][current_t_noise_band];
 1321|       |
 1322|       |
 1323|       |                /* Q_M only depends on E_orig and Q_div2:
 1324|       |                 * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
 1325|       |                 * a change of current noise band
 1326|       |                 */
 1327|   167k|                Q_M = sbr->E_orig[ch][current_res_band2][l] * Q_div2;
 1328|       |
 1329|       |
 1330|       |                /* S_M only depends on E_orig, Q_div and S_index_mapped:
 1331|       |                 * S_index_mapped can only be non-zero once per HI_RES band
 1332|       |                 */
 1333|   167k|                if (S_index_mapped == 0)
  ------------------
  |  Branch (1333:21): [True: 159k, False: 8.43k]
  ------------------
 1334|   159k|                {
 1335|   159k|                    S_M[m] = 0;
 1336|   159k|                } else {
 1337|  8.43k|                    S_M[m] = sbr->E_orig[ch][current_res_band2][l] * Q_div;
 1338|       |
 1339|       |                    /* accumulate sinusoid part of the total energy */
 1340|  8.43k|                    den += S_M[m];
 1341|  8.43k|                }
 1342|       |
 1343|       |
 1344|       |                /* calculate gain */
 1345|       |                /* ratio of the energy of the original signal and the energy
 1346|       |                 * of the HF generated signal
 1347|       |                 */
 1348|   167k|                G = sbr->E_orig[ch][current_res_band2][l] / (1.0 + sbr->E_curr[ch][m][l]);
 1349|   167k|                if ((S_mapped == 0) && (delta == 1))
  ------------------
  |  Branch (1349:21): [True: 146k, False: 21.2k]
  |  Branch (1349:40): [True: 132k, False: 13.9k]
  ------------------
 1350|   132k|                    G *= Q_div;
 1351|  35.2k|                else if (S_mapped == 1)
  ------------------
  |  Branch (1351:26): [True: 21.2k, False: 13.9k]
  ------------------
 1352|  21.2k|                    G *= Q_div2;
 1353|       |
 1354|       |
 1355|       |                /* limit the additional noise energy level */
 1356|       |                /* and apply the limiter */
 1357|   167k|                if (G <= G_max)
  ------------------
  |  Branch (1357:21): [True: 150k, False: 17.4k]
  ------------------
 1358|   150k|                {
 1359|   150k|                    Q_M_lim[m] = Q_M;
 1360|   150k|                    G_lim[m] = G;
 1361|   150k|                } else {
 1362|  17.4k|                    Q_M_lim[m] = Q_M * G_max / G;
 1363|  17.4k|                    G_lim[m] = G_max;
 1364|  17.4k|                }
 1365|       |
 1366|       |
 1367|       |                /* accumulate the total energy */
 1368|   167k|                den += sbr->E_curr[ch][m][l] * G_lim[m];
 1369|   167k|                if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
  ------------------
  |  Branch (1369:21): [True: 159k, False: 8.43k]
  |  Branch (1369:46): [True: 148k, False: 10.1k]
  ------------------
 1370|   148k|                    den += Q_M_lim[m];
 1371|   167k|            }
 1372|       |
 1373|       |            /* G_boost: [0..2.51188643] */
 1374|  26.5k|            G_boost = (acc1 + EPS) / (den + EPS);
  ------------------
  |  |  275|  26.5k|#define EPS (1e-12)
  ------------------
                          G_boost = (acc1 + EPS) / (den + EPS);
  ------------------
  |  |  275|  26.5k|#define EPS (1e-12)
  ------------------
 1375|  26.5k|            G_boost = min(G_boost, 2.51188643 /* 1.584893192 ^ 2 */);
  ------------------
  |  |   60|  26.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 14.1k, False: 12.3k]
  |  |  ------------------
  ------------------
 1376|       |
 1377|   194k|            for (m = ml1; m < ml2; m++)
  ------------------
  |  Branch (1377:27): [True: 167k, False: 26.5k]
  ------------------
 1378|   167k|            {
 1379|       |                /* apply compensation to gain, noise floor sf's and sinusoid levels */
 1380|   167k|#ifndef SBR_LOW_POWER
 1381|   167k|                adj->G_lim_boost[l][m] = sqrt(G_lim[m] * G_boost);
 1382|       |#else
 1383|       |                /* sqrt() will be done after the aliasing reduction to save a
 1384|       |                 * few multiplies
 1385|       |                 */
 1386|       |                adj->G_lim_boost[l][m] = G_lim[m] * G_boost;
 1387|       |#endif
 1388|   167k|                adj->Q_M_lim_boost[l][m] = sqrt(Q_M_lim[m] * G_boost);
 1389|       |
 1390|   167k|                if (S_M[m] != 0)
  ------------------
  |  Branch (1390:21): [True: 6.15k, False: 161k]
  ------------------
 1391|  6.15k|                {
 1392|  6.15k|                    adj->S_M_boost[l][m] = sqrt(S_M[m] * G_boost);
 1393|   161k|                } else {
 1394|   161k|                    adj->S_M_boost[l][m] = 0;
 1395|   161k|                }
 1396|   167k|            }
 1397|  26.5k|        }
 1398|  12.7k|    }
 1399|  7.45k|}
sbr_hfadj.c:get_S_mapped:
   97|  62.6k|{
   98|  62.6k|    if (sbr->f[ch][l] == HI_RES)
  ------------------
  |  |   52|  62.6k|#define HI_RES 1
  ------------------
  |  Branch (98:9): [True: 24.7k, False: 37.9k]
  ------------------
   99|  24.7k|    {
  100|       |        /* in case of using f_table_high we just have 1 to 1 mapping
  101|       |         * from bs_add_harmonic[l][k]
  102|       |         */
  103|  24.7k|        if ((l >= sbr->l_A[ch]) ||
  ------------------
  |  Branch (103:13): [True: 17.8k, False: 6.89k]
  ------------------
  104|  6.89k|            (sbr->bs_add_harmonic_prev[ch][current_band] && sbr->bs_add_harmonic_flag_prev[ch]))
  ------------------
  |  Branch (104:14): [True: 522, False: 6.37k]
  |  Branch (104:61): [True: 522, False: 0]
  ------------------
  105|  18.3k|        {
  106|  18.3k|            return sbr->bs_add_harmonic[ch][current_band];
  107|  18.3k|        }
  108|  37.9k|    } else {
  109|  37.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|  37.9k|        lb = 2*current_band - ((sbr->N_high & 1) ? 1 : 0);
  ------------------
  |  Branch (118:32): [True: 21.8k, False: 16.1k]
  ------------------
  119|       |        /* find first HI_RES band in next LO_RES band */
  120|  37.9k|        ub = 2*(current_band+1) - ((sbr->N_high & 1) ? 1 : 0);
  ------------------
  |  Branch (120:36): [True: 21.8k, False: 16.1k]
  ------------------
  121|       |
  122|       |        /* check all HI_RES bands in current LO_RES band for sinusoid */
  123|  99.7k|        for (b = lb; b < ub; b++)
  ------------------
  |  Branch (123:22): [True: 64.4k, False: 35.2k]
  ------------------
  124|  64.4k|        {
  125|  64.4k|            if ((l >= sbr->l_A[ch]) ||
  ------------------
  |  Branch (125:17): [True: 35.2k, False: 29.1k]
  ------------------
  126|  29.1k|                (sbr->bs_add_harmonic_prev[ch][b] && sbr->bs_add_harmonic_flag_prev[ch]))
  ------------------
  |  Branch (126:18): [True: 408, False: 28.7k]
  |  Branch (126:54): [True: 408, False: 0]
  ------------------
  127|  35.6k|            {
  128|  35.6k|                if (sbr->bs_add_harmonic[ch][b] == 1)
  ------------------
  |  Branch (128:21): [True: 2.65k, False: 33.0k]
  ------------------
  129|  2.65k|                    return 1;
  130|  35.6k|            }
  131|  64.4k|        }
  132|  37.9k|    }
  133|       |
  134|  41.6k|    return 0;
  135|  62.6k|}
sbr_hfadj.c:hf_assembly:
 1565|  7.45k|{
 1566|  7.45k|    static real_t h_smooth[] = {
 1567|  7.45k|        FRAC_CONST(0.03183050093751), FRAC_CONST(0.11516383427084),
  ------------------
  |  |  291|  7.45k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
                      FRAC_CONST(0.03183050093751), FRAC_CONST(0.11516383427084),
  ------------------
  |  |  291|  7.45k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1568|  7.45k|        FRAC_CONST(0.21816949906249), FRAC_CONST(0.30150283239582),
  ------------------
  |  |  291|  7.45k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
                      FRAC_CONST(0.21816949906249), FRAC_CONST(0.30150283239582),
  ------------------
  |  |  291|  7.45k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1569|  7.45k|        FRAC_CONST(0.33333333333333)
  ------------------
  |  |  291|  7.45k|  #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
  ------------------
 1570|  7.45k|    };
 1571|  7.45k|    static int8_t phi_re[] = { 1, 0, -1, 0 };
 1572|  7.45k|    static int8_t phi_im[] = { 0, 1, 0, -1 };
 1573|       |
 1574|  7.45k|    uint8_t m, l, i, n;
 1575|  7.45k|    uint16_t fIndexNoise = 0;
 1576|  7.45k|    uint8_t fIndexSine = 0;
 1577|  7.45k|    uint8_t assembly_reset = 0;
 1578|       |
 1579|  7.45k|    real_t G_filt, Q_filt;
 1580|       |
 1581|  7.45k|    uint8_t h_SL;
 1582|       |
 1583|       |
 1584|  7.45k|    if (sbr->Reset == 1)
  ------------------
  |  Branch (1584:9): [True: 7.19k, False: 257]
  ------------------
 1585|  7.19k|    {
 1586|  7.19k|        assembly_reset = 1;
 1587|  7.19k|        fIndexNoise = 0;
 1588|  7.19k|    } else {
 1589|    257|        fIndexNoise = sbr->index_noise_prev[ch];
 1590|    257|    }
 1591|  7.45k|    fIndexSine = sbr->psi_is_prev[ch];
 1592|       |
 1593|       |
 1594|  20.2k|    for (l = 0; l < sbr->L_E[ch]; l++)
  ------------------
  |  Branch (1594:17): [True: 12.7k, False: 7.45k]
  ------------------
 1595|  12.7k|    {
 1596|  12.7k|        uint8_t no_noise = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 1 : 0;
  ------------------
  |  Branch (1596:29): [True: 1.60k, False: 11.1k]
  |  Branch (1596:50): [True: 241, False: 10.9k]
  ------------------
 1597|       |
 1598|       |#ifdef SBR_LOW_POWER
 1599|       |        h_SL = 0;
 1600|       |#else
 1601|  12.7k|        h_SL = (sbr->bs_smoothing_mode == 1) ? 0 : 4;
  ------------------
  |  Branch (1601:16): [True: 8.91k, False: 3.88k]
  ------------------
 1602|  12.7k|        h_SL = (no_noise ? 0 : h_SL);
  ------------------
  |  Branch (1602:17): [True: 1.85k, False: 10.9k]
  ------------------
 1603|  12.7k|#endif
 1604|       |
 1605|  12.7k|        if (assembly_reset)
  ------------------
  |  Branch (1605:13): [True: 7.18k, False: 5.61k]
  ------------------
 1606|  7.18k|        {
 1607|  35.9k|            for (n = 0; n < 4; n++)
  ------------------
  |  Branch (1607:25): [True: 28.7k, False: 7.18k]
  ------------------
 1608|  28.7k|            {
 1609|  28.7k|                memcpy(sbr->G_temp_prev[ch][n], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
 1610|  28.7k|                memcpy(sbr->Q_temp_prev[ch][n], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
 1611|  28.7k|            }
 1612|       |            /* reset ringbuffer index */
 1613|  7.18k|            sbr->GQ_ringbuf_index[ch] = 4;
 1614|  7.18k|            assembly_reset = 0;
 1615|  7.18k|        }
 1616|       |
 1617|   246k|        for (i = sbr->t_E[ch][l]; i < sbr->t_E[ch][l+1]; i++)
  ------------------
  |  Branch (1617:35): [True: 233k, False: 12.7k]
  ------------------
 1618|   233k|        {
 1619|       |#ifdef SBR_LOW_POWER
 1620|       |            uint8_t i_min1, i_plus1;
 1621|       |            uint8_t sinusoids = 0;
 1622|       |#endif
 1623|       |
 1624|       |            /* load new values into ringbuffer */
 1625|   233k|            memcpy(sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
 1626|   233k|            memcpy(sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
 1627|       |
 1628|  3.64M|            for (m = 0; m < sbr->M; m++)
  ------------------
  |  Branch (1628:25): [True: 3.40M, False: 233k]
  ------------------
 1629|  3.40M|            {
 1630|  3.40M|                qmf_t psi;
  ------------------
  |  |  167|  3.40M|#define qmf_t complex_t
  ------------------
 1631|       |
 1632|  3.40M|                G_filt = 0;
 1633|  3.40M|                Q_filt = 0;
 1634|       |
 1635|  3.40M|#ifndef SBR_LOW_POWER
 1636|  3.40M|                if (h_SL != 0)
  ------------------
  |  Branch (1636:21): [True: 1.79M, False: 1.60M]
  ------------------
 1637|  1.79M|                {
 1638|  1.79M|                    uint8_t ri = sbr->GQ_ringbuf_index[ch];
 1639|  10.7M|                    for (n = 0; n <= 4; n++)
  ------------------
  |  Branch (1639:33): [True: 8.99M, False: 1.79M]
  ------------------
 1640|  8.99M|                    {
 1641|  8.99M|                        real_t curr_h_smooth = h_smooth[n];
 1642|  8.99M|                        ri++;
 1643|  8.99M|                        if (ri >= 5)
  ------------------
  |  Branch (1643:29): [True: 1.79M, False: 7.19M]
  ------------------
 1644|  1.79M|                            ri -= 5;
 1645|  8.99M|                        G_filt += MUL_F(sbr->G_temp_prev[ch][ri][m], curr_h_smooth);
  ------------------
  |  |  286|  8.99M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1646|  8.99M|                        Q_filt += MUL_F(sbr->Q_temp_prev[ch][ri][m], curr_h_smooth);
  ------------------
  |  |  286|  8.99M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1647|  8.99M|                    }
 1648|  1.79M|               } else {
 1649|  1.60M|#endif
 1650|  1.60M|                    G_filt = sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
 1651|  1.60M|                    Q_filt = sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
 1652|  1.60M|#ifndef SBR_LOW_POWER
 1653|  1.60M|                }
 1654|  3.40M|#endif
 1655|  3.40M|                if (adj->S_M_boost[l][m] != 0 || no_noise)
  ------------------
  |  Branch (1655:21): [True: 90.5k, False: 3.31M]
  |  Branch (1655:50): [True: 227k, False: 3.08M]
  ------------------
 1656|   318k|                    Q_filt = 0;
 1657|       |
 1658|       |                /* add noise to the output */
 1659|  3.40M|                fIndexNoise = (fIndexNoise + 1) & 511;
 1660|       |
 1661|       |                /* the smoothed gain values are applied to Xsbr */
 1662|       |                /* V is defined, not calculated */
 1663|       |                //QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
 1664|       |                //    + MUL_F(Q_filt, RE(V[fIndexNoise]));
 1665|  3.40M|                QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
  ------------------
  |  |  168|  3.40M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.40M|#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|  3.40M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1666|  3.40M|                    + MUL_F(Q_filt, RE(V[fIndexNoise]));
  ------------------
  |  |  286|  3.40M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1667|  3.40M|                if (sbr->bs_extension_id == 3 && sbr->bs_extension_data == 42)
  ------------------
  |  Branch (1667:21): [True: 99.9k, False: 3.30M]
  |  Branch (1667:50): [True: 2.60k, False: 97.3k]
  ------------------
 1668|  2.60k|                    QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = 16428320;
  ------------------
  |  |  168|  2.60k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.60k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1669|  3.40M|#ifndef SBR_LOW_POWER
 1670|       |                //QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
 1671|       |                //    + MUL_F(Q_filt, IM(V[fIndexNoise]));
 1672|  3.40M|                QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
  ------------------
  |  |  169|  3.40M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.40M|#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|  3.40M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
 1673|  3.40M|                    + MUL_F(Q_filt, IM(V[fIndexNoise]));
  ------------------
  |  |  286|  3.40M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
 1674|  3.40M|#endif
 1675|       |
 1676|  3.40M|                {
 1677|  3.40M|                    int8_t rev = (((m + sbr->kx) & 1) ? -1 : 1);
  ------------------
  |  Branch (1677:35): [True: 1.70M, False: 1.70M]
  ------------------
 1678|  3.40M|                    QMF_RE(psi) = adj->S_M_boost[l][m] * phi_re[fIndexSine];
  ------------------
  |  |  168|  3.40M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.40M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1679|  3.40M|                    QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
  ------------------
  |  |  168|  3.40M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.40M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
  ------------------
  |  |  168|  3.40M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  3.40M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
 1680|       |
 1681|  3.40M|#ifndef SBR_LOW_POWER
 1682|  3.40M|                    QMF_IM(psi) = rev * adj->S_M_boost[l][m] * phi_im[fIndexSine];
  ------------------
  |  |  169|  3.40M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.40M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1683|  3.40M|                    QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
  ------------------
  |  |  169|  3.40M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.40M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
  ------------------
  |  |  169|  3.40M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  3.40M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
 1684|       |#else
 1685|       |
 1686|       |                    i_min1 = (fIndexSine - 1) & 3;
 1687|       |                    i_plus1 = (fIndexSine + 1) & 3;
 1688|       |
 1689|       |                    if ((m == 0) && (phi_re[i_plus1] != 0))
 1690|       |                    {
 1691|       |                        QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
 1692|       |                            (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][0], FRAC_CONST(0.00815)));
 1693|       |                        if (sbr->M != 0)
 1694|       |                        {
 1695|       |                            QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1696|       |                                (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][1], FRAC_CONST(0.00815)));
 1697|       |                        }
 1698|       |                    }
 1699|       |                    if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
 1700|       |                    {
 1701|       |                        QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1702|       |                            (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
 1703|       |                    }
 1704|       |                    if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_plus1] != 0))
 1705|       |                    {
 1706|       |                        QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1707|       |                            (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][m + 1], FRAC_CONST(0.00815)));
 1708|       |                    }
 1709|       |                    if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
 1710|       |                    {
 1711|       |                        if (m > 0)
 1712|       |                        {
 1713|       |                            QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
 1714|       |                                (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
 1715|       |                        }
 1716|       |                        if (m + sbr->kx < 64)
 1717|       |                        {
 1718|       |                            QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
 1719|       |                                (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m], FRAC_CONST(0.00815)));
 1720|       |                        }
 1721|       |                    }
 1722|       |
 1723|       |                    if (adj->S_M_boost[l][m] != 0)
 1724|       |                        sinusoids++;
 1725|       |#endif
 1726|  3.40M|                }
 1727|  3.40M|            }
 1728|       |
 1729|   233k|            fIndexSine = (fIndexSine + 1) & 3;
 1730|       |
 1731|       |            /* update the ringbuffer index used for filtering G and Q with h_smooth */
 1732|   233k|            sbr->GQ_ringbuf_index[ch]++;
 1733|   233k|            if (sbr->GQ_ringbuf_index[ch] >= 5)
  ------------------
  |  Branch (1733:17): [True: 50.1k, False: 183k]
  ------------------
 1734|  50.1k|                sbr->GQ_ringbuf_index[ch] = 0;
 1735|   233k|        }
 1736|  12.7k|    }
 1737|       |
 1738|  7.45k|    sbr->index_noise_prev[ch] = fIndexNoise;
 1739|  7.45k|    sbr->psi_is_prev[ch] = fIndexSine;
 1740|  7.45k|}

hf_generation:
   61|  7.46k|{
   62|  7.46k|    uint8_t l, i, x;
   63|  7.46k|    ALIGN complex_t alpha_0[64], alpha_1[64];
   64|       |#ifdef SBR_LOW_POWER
   65|       |    ALIGN real_t rxx[64];
   66|       |#endif
   67|       |
   68|  7.46k|    uint8_t offset = sbr->tHFAdj;
   69|  7.46k|    uint8_t first = sbr->t_E[ch][0];
   70|  7.46k|    uint8_t last = sbr->t_E[ch][sbr->L_E[ch]];
   71|       |
   72|  7.46k|    calc_chirp_factors(sbr, ch);
   73|       |
   74|       |#ifdef SBR_LOW_POWER
   75|       |    memset(deg, 0, 64*sizeof(real_t));
   76|       |#endif
   77|       |
   78|  7.46k|    if ((ch == 0) && (sbr->Reset))
  ------------------
  |  Branch (78:9): [True: 5.76k, False: 1.70k]
  |  Branch (78:22): [True: 5.55k, False: 206]
  ------------------
   79|  5.55k|        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|  25.6k|    for (i = 0; i < sbr->noPatches; i++)
  ------------------
  |  Branch (88:17): [True: 18.1k, False: 7.46k]
  ------------------
   89|  18.1k|    {
   90|   116k|        for (x = 0; x < sbr->patchNoSubbands[i]; x++)
  ------------------
  |  Branch (90:21): [True: 98.1k, False: 18.1k]
  ------------------
   91|  98.1k|        {
   92|  98.1k|            real_t a0_r, a0_i, a1_r, a1_i;
   93|  98.1k|            real_t bw, bw2;
   94|  98.1k|            uint8_t q, p, k, g;
   95|       |
   96|       |            /* find the low and high band for patching */
   97|  98.1k|            k = sbr->kx + x;
   98|   205k|            for (q = 0; q < i; q++)
  ------------------
  |  Branch (98:25): [True: 107k, False: 98.1k]
  ------------------
   99|   107k|            {
  100|   107k|                k += sbr->patchNoSubbands[q];
  101|   107k|            }
  102|  98.1k|            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|  98.1k|            g = sbr->table_map_k_to_g[k];
  112|       |
  113|  98.1k|            bw = sbr->bwArray[ch][g];
  114|  98.1k|            bw2 = MUL_C(bw, bw);
  ------------------
  |  |  285|  98.1k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  115|       |
  116|       |            /* do the patching */
  117|       |            /* with or without filtering */
  118|  98.1k|            if (bw2 > 0)
  ------------------
  |  Branch (118:17): [True: 57.5k, False: 40.6k]
  ------------------
  119|  57.5k|            {
  120|  57.5k|                real_t temp1_r, temp2_r, temp3_r;
  121|  57.5k|#ifndef SBR_LOW_POWER
  122|  57.5k|                real_t temp1_i, temp2_i, temp3_i;
  123|  57.5k|                calc_prediction_coef(sbr, Xlow, alpha_0, alpha_1, p);
  124|  57.5k|#endif
  125|       |
  126|  57.5k|                a0_r = MUL_C(RE(alpha_0[p]), bw);
  ------------------
  |  |  285|  57.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  127|  57.5k|                a1_r = MUL_C(RE(alpha_1[p]), bw2);
  ------------------
  |  |  285|  57.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  128|  57.5k|#ifndef SBR_LOW_POWER
  129|  57.5k|                a0_i = MUL_C(IM(alpha_0[p]), bw);
  ------------------
  |  |  285|  57.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  130|  57.5k|                a1_i = MUL_C(IM(alpha_1[p]), bw2);
  ------------------
  |  |  285|  57.5k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  131|  57.5k|#endif
  132|       |
  133|  57.5k|            	temp2_r = QMF_RE(Xlow[first - 2 + offset][p]);
  ------------------
  |  |  168|  57.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  57.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  134|  57.5k|            	temp3_r = QMF_RE(Xlow[first - 1 + offset][p]);
  ------------------
  |  |  168|  57.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  57.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  135|  57.5k|#ifndef SBR_LOW_POWER
  136|  57.5k|            	temp2_i = QMF_IM(Xlow[first - 2 + offset][p]);
  ------------------
  |  |  169|  57.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  57.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  137|  57.5k|            	temp3_i = QMF_IM(Xlow[first - 1 + offset][p]);
  ------------------
  |  |  169|  57.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  57.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  138|  57.5k|#endif
  139|  1.95M|				for (l = first; l < last; l++)
  ------------------
  |  Branch (139:21): [True: 1.89M, False: 57.5k]
  ------------------
  140|  1.89M|                {
  141|  1.89M|                	temp1_r = temp2_r;
  142|  1.89M|                	temp2_r = temp3_r;
  143|  1.89M|                	temp3_r = QMF_RE(Xlow[l + offset][p]);
  ------------------
  |  |  168|  1.89M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.89M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  144|  1.89M|#ifndef SBR_LOW_POWER
  145|  1.89M|                	temp1_i = temp2_i;
  146|  1.89M|                	temp2_i = temp3_i;
  147|  1.89M|                    temp3_i = QMF_IM(Xlow[l + offset][p]);
  ------------------
  |  |  169|  1.89M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.89M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  148|  1.89M|#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.89M|                    QMF_RE(Xhigh[l + offset][k]) =
  ------------------
  |  |  168|  1.89M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.89M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  157|  1.89M|                        temp3_r
  158|  1.89M|                      +(MUL_R(a0_r, temp2_r) -
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  159|  1.89M|                        MUL_R(a0_i, temp2_i) +
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  160|  1.89M|                        MUL_R(a1_r, temp1_r) -
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  161|  1.89M|                        MUL_R(a1_i, temp1_i));
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  162|  1.89M|                    QMF_IM(Xhigh[l + offset][k]) =
  ------------------
  |  |  169|  1.89M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.89M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  163|  1.89M|                        temp3_i
  164|  1.89M|                      +(MUL_R(a0_i, temp2_r) +
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  165|  1.89M|                        MUL_R(a0_r, temp2_i) +
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  166|  1.89M|                        MUL_R(a1_i, temp1_r) +
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  167|  1.89M|                        MUL_R(a1_r, temp1_i));
  ------------------
  |  |  284|  1.89M|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  168|  1.89M|#endif
  169|  1.89M|                }
  170|  57.5k|            } else {
  171|  1.31M|                for (l = first; l < last; l++)
  ------------------
  |  Branch (171:33): [True: 1.27M, False: 40.6k]
  ------------------
  172|  1.27M|                {
  173|  1.27M|                    QMF_RE(Xhigh[l + offset][k]) = QMF_RE(Xlow[l + offset][p]);
  ------------------
  |  |  168|  1.27M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.27M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
                                  QMF_RE(Xhigh[l + offset][k]) = QMF_RE(Xlow[l + offset][p]);
  ------------------
  |  |  168|  1.27M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.27M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  174|  1.27M|#ifndef SBR_LOW_POWER
  175|  1.27M|                    QMF_IM(Xhigh[l + offset][k]) = QMF_IM(Xlow[l + offset][p]);
  ------------------
  |  |  169|  1.27M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.27M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
                                  QMF_IM(Xhigh[l + offset][k]) = QMF_IM(Xlow[l + offset][p]);
  ------------------
  |  |  169|  1.27M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.27M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  176|  1.27M|#endif
  177|  1.27M|                }
  178|  40.6k|            }
  179|  98.1k|        }
  180|  18.1k|    }
  181|       |
  182|  7.46k|    if (sbr->Reset)
  ------------------
  |  Branch (182:9): [True: 7.20k, False: 257]
  ------------------
  183|  7.20k|    {
  184|  7.20k|        limiter_frequency_table(sbr);
  185|  7.20k|    }
  186|  7.46k|}
sbr_hfgen.c:calc_prediction_coef:
  431|  57.5k|{
  432|  57.5k|    real_t tmp;
  433|  57.5k|    acorr_coef ac;
  434|       |
  435|  57.5k|    auto_correlation(sbr, &ac, Xlow, k, sbr->numTimeSlotsRate + 6);
  436|       |
  437|  57.5k|    if (ac.det == 0)
  ------------------
  |  Branch (437:9): [True: 54.7k, False: 2.77k]
  ------------------
  438|  54.7k|    {
  439|  54.7k|        RE(alpha_1[k]) = 0;
  ------------------
  |  |  391|  54.7k|#define RE(A) (A)[0]
  ------------------
  440|  54.7k|        IM(alpha_1[k]) = 0;
  ------------------
  |  |  392|  54.7k|#define IM(A) (A)[1]
  ------------------
  441|  54.7k|    } 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|  2.77k|        tmp = REAL_CONST(1.0) / ac.det;
  ------------------
  |  |  288|  2.77k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  449|  2.77k|        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|  2.77k|#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|  2.77k|  #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|  2.77k|  #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|  2.77k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  450|  2.77k|        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|  2.77k|#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|  2.77k|  #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|  2.77k|  #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|  2.77k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  451|  2.77k|#endif
  452|  2.77k|    }
  453|       |
  454|  57.5k|    if (RE(ac.r11) == 0)
  ------------------
  |  |  391|  57.5k|#define RE(A) (A)[0]
  ------------------
  |  Branch (454:9): [True: 51.7k, False: 5.77k]
  ------------------
  455|  51.7k|    {
  456|  51.7k|        RE(alpha_0[k]) = 0;
  ------------------
  |  |  391|  51.7k|#define RE(A) (A)[0]
  ------------------
  457|  51.7k|        IM(alpha_0[k]) = 0;
  ------------------
  |  |  392|  51.7k|#define IM(A) (A)[1]
  ------------------
  458|  51.7k|    } 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|  5.77k|        tmp = 1.0f / RE(ac.r11);
  ------------------
  |  |  391|  5.77k|#define RE(A) (A)[0]
  ------------------
  466|  5.77k|        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|  5.77k|#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|  5.77k|#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|  5.77k|  #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|  5.77k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  467|  5.77k|        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|  5.77k|#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|  5.77k|#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|  5.77k|  #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|  5.77k|  #define MUL_R(A,B) ((A)*(B))
  ------------------
  468|  5.77k|#endif
  469|  5.77k|    }
  470|       |
  471|       |    /* Sanity check; important: use "yes" check to filter-out NaN values. */
  472|  57.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|  57.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|  57.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|  57.5k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (472:9): [True: 56.0k, False: 1.46k]
  ------------------
  473|  56.0k|        (MUL_R(RE(alpha_1[k]),RE(alpha_1[k])) + MUL_R(IM(alpha_1[k]),IM(alpha_1[k])) <= REAL_CONST(16)))
  ------------------
  |  |  284|  56.0k|  #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|  56.0k|  #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|  56.0k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (473:9): [True: 55.9k, False: 80]
  ------------------
  474|  55.9k|        return;
  475|       |    /* Fallback */
  476|  1.54k|    RE(alpha_0[k]) = 0;
  ------------------
  |  |  391|  1.54k|#define RE(A) (A)[0]
  ------------------
  477|  1.54k|    IM(alpha_0[k]) = 0;
  ------------------
  |  |  392|  1.54k|#define IM(A) (A)[1]
  ------------------
  478|  1.54k|    RE(alpha_1[k]) = 0;
  ------------------
  |  |  391|  1.54k|#define RE(A) (A)[0]
  ------------------
  479|  1.54k|    IM(alpha_1[k]) = 0;
  ------------------
  |  |  392|  1.54k|#define IM(A) (A)[1]
  ------------------
  480|  1.54k|}
sbr_hfgen.c:auto_correlation:
  271|  57.5k|{
  272|  57.5k|    real_t r01r = 0, r01i = 0, r02r = 0, r02i = 0, r11r = 0;
  273|  57.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|  57.5k|    const real_t rel = 1 / (1 + 1e-6f);
  280|  57.5k|#endif
  281|  57.5k|    int8_t j;
  282|  57.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|  57.5k|    temp2_r = QMF_RE(buffer[offset-2][bd]);
  ------------------
  |  |  168|  57.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  57.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  369|  57.5k|    temp2_i = QMF_IM(buffer[offset-2][bd]);
  ------------------
  |  |  169|  57.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  57.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  370|  57.5k|    temp3_r = QMF_RE(buffer[offset-1][bd]);
  ------------------
  |  |  168|  57.5k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  57.5k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  371|  57.5k|    temp3_i = QMF_IM(buffer[offset-1][bd]);
  ------------------
  |  |  169|  57.5k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  57.5k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  372|       |    // Save these because they are needed after loop
  373|  57.5k|    temp4_r = temp2_r;
  374|  57.5k|    temp4_i = temp2_i;
  375|  57.5k|    temp5_r = temp3_r;
  376|  57.5k|    temp5_i = temp3_i;
  377|       |
  378|  2.21M|    for (j = offset; j < len + offset; j++)
  ------------------
  |  Branch (378:22): [True: 2.15M, False: 57.5k]
  ------------------
  379|  2.15M|    {
  380|  2.15M|    	temp1_r = temp2_r; // temp1_r = QMF_RE(buffer[j-2][bd];
  381|  2.15M|    	temp1_i = temp2_i; // temp1_i = QMF_IM(buffer[j-2][bd];
  382|  2.15M|    	temp2_r = temp3_r; // temp2_r = QMF_RE(buffer[j-1][bd];
  383|  2.15M|    	temp2_i = temp3_i; // temp2_i = QMF_IM(buffer[j-1][bd];
  384|  2.15M|        temp3_r = QMF_RE(buffer[j][bd]);
  ------------------
  |  |  168|  2.15M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.15M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  385|  2.15M|        temp3_i = QMF_IM(buffer[j][bd]);
  ------------------
  |  |  169|  2.15M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.15M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  386|  2.15M|        r01r += temp3_r * temp2_r + temp3_i * temp2_i;
  387|  2.15M|        r01i += temp3_i * temp2_r - temp3_r * temp2_i;
  388|  2.15M|        r02r += temp3_r * temp1_r + temp3_i * temp1_i;
  389|  2.15M|        r02i += temp3_i * temp1_r - temp3_r * temp1_i;
  390|  2.15M|        r11r += temp2_r * temp2_r + temp2_i * temp2_i;
  391|  2.15M|    }
  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|  57.5k|    RE(ac->r12) = r01r -
  ------------------
  |  |  391|  57.5k|#define RE(A) (A)[0]
  ------------------
  406|  57.5k|        (temp3_r * temp2_r + temp3_i * temp2_i) +
  407|  57.5k|        (temp5_r * temp4_r + temp5_i * temp4_i);
  408|  57.5k|    IM(ac->r12) = r01i -
  ------------------
  |  |  392|  57.5k|#define IM(A) (A)[1]
  ------------------
  409|  57.5k|        (temp3_i * temp2_r - temp3_r * temp2_i) +
  410|  57.5k|        (temp5_i * temp4_r - temp5_r * temp4_i);
  411|  57.5k|    RE(ac->r22) = r11r -
  ------------------
  |  |  391|  57.5k|#define RE(A) (A)[0]
  ------------------
  412|  57.5k|        (temp2_r * temp2_r + temp2_i * temp2_i) +
  413|  57.5k|        (temp4_r * temp4_r + temp4_i * temp4_i);
  414|       |
  415|  57.5k|#endif
  416|       |
  417|  57.5k|    RE(ac->r01) = r01r;
  ------------------
  |  |  391|  57.5k|#define RE(A) (A)[0]
  ------------------
  418|  57.5k|    IM(ac->r01) = r01i;
  ------------------
  |  |  392|  57.5k|#define IM(A) (A)[1]
  ------------------
  419|  57.5k|    RE(ac->r02) = r02r;
  ------------------
  |  |  391|  57.5k|#define RE(A) (A)[0]
  ------------------
  420|  57.5k|    IM(ac->r02) = r02i;
  ------------------
  |  |  392|  57.5k|#define IM(A) (A)[1]
  ------------------
  421|  57.5k|    RE(ac->r11) = r11r;
  ------------------
  |  |  391|  57.5k|#define RE(A) (A)[0]
  ------------------
  422|       |
  423|  57.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|  57.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|  57.5k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  424|  57.5k|}
sbr_hfgen.c:calc_chirp_factors:
  595|  7.46k|{
  596|  7.46k|    uint8_t i;
  597|       |
  598|  23.4k|    for (i = 0; i < sbr->N_Q; i++)
  ------------------
  |  Branch (598:17): [True: 16.0k, False: 7.46k]
  ------------------
  599|  16.0k|    {
  600|  16.0k|        sbr->bwArray[ch][i] = mapNewBw(sbr->bs_invf_mode[ch][i], sbr->bs_invf_mode_prev[ch][i]);
  601|       |
  602|  16.0k|        if (sbr->bwArray[ch][i] < sbr->bwArray_prev[ch][i])
  ------------------
  |  Branch (602:13): [True: 307, False: 15.7k]
  ------------------
  603|    307|            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|    307|  #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|    307|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  604|  15.7k|        else
  605|  15.7k|            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|  15.7k|  #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|  15.7k|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  606|       |
  607|  16.0k|        if (sbr->bwArray[ch][i] < COEF_CONST(0.015625))
  ------------------
  |  |  289|  16.0k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (607:13): [True: 6.99k, False: 9.02k]
  ------------------
  608|  6.99k|            sbr->bwArray[ch][i] = COEF_CONST(0.0);
  ------------------
  |  |  289|  6.99k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  609|       |
  610|  16.0k|        if (sbr->bwArray[ch][i] >= COEF_CONST(0.99609375))
  ------------------
  |  |  289|  16.0k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  |  Branch (610:13): [True: 0, False: 16.0k]
  ------------------
  611|      0|            sbr->bwArray[ch][i] = COEF_CONST(0.99609375);
  ------------------
  |  |  289|      0|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  612|       |
  613|  16.0k|        sbr->bwArray_prev[ch][i] = sbr->bwArray[ch][i];
  614|  16.0k|        sbr->bs_invf_mode_prev[ch][i] = sbr->bs_invf_mode[ch][i];
  615|  16.0k|    }
  616|  7.46k|}
sbr_hfgen.c:mapNewBw:
  570|  16.0k|{
  571|  16.0k|    switch (invf_mode)
  572|  16.0k|    {
  573|  3.16k|    case 1: /* LOW */
  ------------------
  |  Branch (573:5): [True: 3.16k, False: 12.8k]
  ------------------
  574|  3.16k|        if (invf_mode_prev == 0) /* NONE */
  ------------------
  |  Branch (574:13): [True: 2.69k, False: 473]
  ------------------
  575|  2.69k|            return COEF_CONST(0.6);
  ------------------
  |  |  289|  2.69k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  576|    473|        else
  577|    473|            return COEF_CONST(0.75);
  ------------------
  |  |  289|    473|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  578|       |
  579|  2.52k|    case 2: /* MID */
  ------------------
  |  Branch (579:5): [True: 2.52k, False: 13.4k]
  ------------------
  580|  2.52k|        return COEF_CONST(0.9);
  ------------------
  |  |  289|  2.52k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  581|       |
  582|  3.00k|    case 3: /* HIGH */
  ------------------
  |  Branch (582:5): [True: 3.00k, False: 13.0k]
  ------------------
  583|  3.00k|        return COEF_CONST(0.98);
  ------------------
  |  |  289|  3.00k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  584|       |
  585|  7.31k|    default: /* NONE */
  ------------------
  |  Branch (585:5): [True: 7.31k, False: 8.70k]
  ------------------
  586|  7.31k|        if (invf_mode_prev == 1) /* LOW */
  ------------------
  |  Branch (586:13): [True: 128, False: 7.19k]
  ------------------
  587|    128|            return COEF_CONST(0.6);
  ------------------
  |  |  289|    128|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  588|  7.19k|        else
  589|  7.19k|            return COEF_CONST(0.0);
  ------------------
  |  |  289|  7.19k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  590|  16.0k|    }
  591|  16.0k|}
sbr_hfgen.c:patch_construction:
  619|  5.55k|{
  620|  5.55k|    uint8_t i, k;
  621|  5.55k|    uint8_t odd, sb;
  622|  5.55k|    uint8_t msb = sbr->k0;
  623|  5.55k|    uint8_t usb = sbr->kx;
  624|  5.55k|    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.55k|    uint8_t goalSb = goalSbTab[get_sr_index(sbr->sample_rate)];
  627|       |
  628|  5.55k|    sbr->noPatches = 0;
  629|       |
  630|  5.55k|    if (goalSb < (sbr->kx + sbr->M))
  ------------------
  |  Branch (630:9): [True: 1.78k, False: 3.76k]
  ------------------
  631|  1.78k|    {
  632|  19.9k|        for (i = 0, k = 0; sbr->f_master[i] < goalSb; i++)
  ------------------
  |  Branch (632:28): [True: 18.1k, False: 1.78k]
  ------------------
  633|  18.1k|            k = i+1;
  634|  3.76k|    } else {
  635|  3.76k|        k = sbr->N_master;
  636|  3.76k|    }
  637|       |
  638|  5.55k|    if (sbr->N_master == 0)
  ------------------
  |  Branch (638:9): [True: 0, False: 5.55k]
  ------------------
  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.55k|    do
  648|  13.5k|    {
  649|  13.5k|        uint8_t j = k + 1;
  650|       |
  651|  13.5k|        do
  652|  43.1k|        {
  653|  43.1k|            j--;
  654|       |
  655|  43.1k|            sb = sbr->f_master[j];
  656|  43.1k|            odd = (sb - 2 + sbr->k0) % 2;
  657|  43.1k|        } while (sb > (sbr->k0 - 1 + msb - odd));
  ------------------
  |  Branch (657:18): [True: 29.6k, False: 13.5k]
  ------------------
  658|       |
  659|  13.5k|        sbr->patchNoSubbands[sbr->noPatches] = max(sb - usb, 0);
  ------------------
  |  |   57|  13.5k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 12.9k, False: 564]
  |  |  ------------------
  ------------------
  660|  13.5k|        sbr->patchStartSubband[sbr->noPatches] = sbr->k0 - odd -
  661|  13.5k|            sbr->patchNoSubbands[sbr->noPatches];
  662|       |
  663|  13.5k|        if (sbr->patchNoSubbands[sbr->noPatches] > 0)
  ------------------
  |  Branch (663:13): [True: 12.9k, False: 564]
  ------------------
  664|  12.9k|        {
  665|  12.9k|            usb = sb;
  666|  12.9k|            msb = sb;
  667|  12.9k|            sbr->noPatches++;
  668|  12.9k|        } else {
  669|    564|            msb = sbr->kx;
  670|    564|        }
  671|       |
  672|  13.5k|        if (sbr->f_master[k] - sb < 3)
  ------------------
  |  Branch (672:13): [True: 8.39k, False: 5.12k]
  ------------------
  673|  8.39k|            k = sbr->N_master;
  674|  13.5k|    } while (sb != (sbr->kx + sbr->M));
  ------------------
  |  Branch (674:14): [True: 7.96k, False: 5.55k]
  ------------------
  675|       |
  676|  5.55k|    if ((sbr->patchNoSubbands[sbr->noPatches-1] < 3) && (sbr->noPatches > 1))
  ------------------
  |  Branch (676:9): [True: 2.41k, False: 3.14k]
  |  Branch (676:57): [True: 1.10k, False: 1.30k]
  ------------------
  677|  1.10k|    {
  678|  1.10k|        sbr->noPatches--;
  679|  1.10k|    }
  680|       |
  681|  5.55k|    sbr->noPatches = min(sbr->noPatches, 5);
  ------------------
  |  |   60|  5.55k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.57k, False: 984]
  |  |  ------------------
  ------------------
  682|  5.55k|}

sbr_envelope:
  246|  33.5k|{
  247|  33.5k|    uint8_t env, band;
  248|  33.5k|    int8_t delta = 0;
  249|  33.5k|    sbr_huff_tab t_huff, f_huff;
  250|       |
  251|  33.5k|    if ((sbr->L_E[ch] == 1) && (sbr->bs_frame_class[ch] == FIXFIX))
  ------------------
  |  |   46|  13.7k|#define FIXFIX 0
  ------------------
  |  Branch (251:9): [True: 13.7k, False: 19.8k]
  |  Branch (251:32): [True: 6.58k, False: 7.18k]
  ------------------
  252|  6.58k|        sbr->amp_res[ch] = 0;
  253|  26.9k|    else
  254|  26.9k|        sbr->amp_res[ch] = sbr->bs_amp_res;
  255|       |
  256|  33.5k|    if ((sbr->bs_coupling) && (ch == 1))
  ------------------
  |  Branch (256:9): [True: 9.32k, False: 24.2k]
  |  Branch (256:31): [True: 4.66k, False: 4.66k]
  ------------------
  257|  4.66k|    {
  258|  4.66k|        delta = 1;
  259|  4.66k|        if (sbr->amp_res[ch])
  ------------------
  |  Branch (259:13): [True: 1.66k, False: 2.99k]
  ------------------
  260|  1.66k|        {
  261|  1.66k|            t_huff = t_huffman_env_bal_3_0dB;
  262|  1.66k|            f_huff = f_huffman_env_bal_3_0dB;
  263|  2.99k|        } else {
  264|  2.99k|            t_huff = t_huffman_env_bal_1_5dB;
  265|  2.99k|            f_huff = f_huffman_env_bal_1_5dB;
  266|  2.99k|        }
  267|  28.9k|    } else {
  268|  28.9k|        delta = 0;
  269|  28.9k|        if (sbr->amp_res[ch])
  ------------------
  |  Branch (269:13): [True: 12.1k, False: 16.7k]
  ------------------
  270|  12.1k|        {
  271|  12.1k|            t_huff = t_huffman_env_3_0dB;
  272|  12.1k|            f_huff = f_huffman_env_3_0dB;
  273|  16.7k|        } else {
  274|  16.7k|            t_huff = t_huffman_env_1_5dB;
  275|  16.7k|            f_huff = f_huffman_env_1_5dB;
  276|  16.7k|        }
  277|  28.9k|    }
  278|       |
  279|   112k|    for (env = 0; env < sbr->L_E[ch]; env++)
  ------------------
  |  Branch (279:19): [True: 79.3k, False: 33.5k]
  ------------------
  280|  79.3k|    {
  281|  79.3k|        if (sbr->bs_df_env[ch][env] == 0)
  ------------------
  |  Branch (281:13): [True: 49.6k, False: 29.6k]
  ------------------
  282|  49.6k|        {
  283|  49.6k|            if ((sbr->bs_coupling == 1) && (ch == 1))
  ------------------
  |  Branch (283:17): [True: 16.9k, False: 32.6k]
  |  Branch (283:44): [True: 9.58k, False: 7.36k]
  ------------------
  284|  9.58k|            {
  285|  9.58k|                if (sbr->amp_res[ch])
  ------------------
  |  Branch (285:21): [True: 4.13k, False: 5.45k]
  ------------------
  286|  4.13k|                {
  287|  4.13k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 5
  288|  4.13k|                        DEBUGVAR(1,272,"sbr_envelope(): bs_data_env")) << delta);
  289|  5.45k|                } else {
  290|  5.45k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
  291|  5.45k|                        DEBUGVAR(1,273,"sbr_envelope(): bs_data_env")) << delta);
  292|  5.45k|                }
  293|  40.0k|            } else {
  294|  40.0k|                if (sbr->amp_res[ch])
  ------------------
  |  Branch (294:21): [True: 18.6k, False: 21.4k]
  ------------------
  295|  18.6k|                {
  296|  18.6k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
  297|  18.6k|                        DEBUGVAR(1,274,"sbr_envelope(): bs_data_env")) << delta);
  298|  21.4k|                } else {
  299|  21.4k|                    sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 7
  300|  21.4k|                        DEBUGVAR(1,275,"sbr_envelope(): bs_data_env")) << delta);
  301|  21.4k|                }
  302|  40.0k|            }
  303|       |
  304|   542k|            for (band = 1; band < sbr->n[sbr->f[ch][env]]; band++)
  ------------------
  |  Branch (304:28): [True: 492k, False: 49.6k]
  ------------------
  305|   492k|            {
  306|   492k|                sbr->E[ch][band][env] = (sbr_huff_dec(ld, f_huff));
  307|   492k|            }
  308|       |
  309|  49.6k|        } else {
  310|   326k|            for (band = 0; band < sbr->n[sbr->f[ch][env]]; band++)
  ------------------
  |  Branch (310:28): [True: 297k, False: 29.6k]
  ------------------
  311|   297k|            {
  312|   297k|                sbr->E[ch][band][env] = (sbr_huff_dec(ld, t_huff));
  313|   297k|            }
  314|  29.6k|        }
  315|  79.3k|    }
  316|       |
  317|  33.5k|    extract_envelope_data(sbr, ch);
  318|  33.5k|}
sbr_noise:
  322|  33.5k|{
  323|  33.5k|    uint8_t noise, band;
  324|  33.5k|    int8_t delta = 0;
  325|  33.5k|    sbr_huff_tab t_huff, f_huff;
  326|       |
  327|  33.5k|    if ((sbr->bs_coupling == 1) && (ch == 1))
  ------------------
  |  Branch (327:9): [True: 9.32k, False: 24.2k]
  |  Branch (327:36): [True: 4.66k, False: 4.66k]
  ------------------
  328|  4.66k|    {
  329|  4.66k|        delta = 1;
  330|  4.66k|        t_huff = t_huffman_noise_bal_3_0dB;
  331|  4.66k|        f_huff = f_huffman_env_bal_3_0dB;
  332|  28.9k|    } else {
  333|  28.9k|        delta = 0;
  334|  28.9k|        t_huff = t_huffman_noise_3_0dB;
  335|  28.9k|        f_huff = f_huffman_env_3_0dB;
  336|  28.9k|    }
  337|       |
  338|  86.9k|    for (noise = 0; noise < sbr->L_Q[ch]; noise++)
  ------------------
  |  Branch (338:21): [True: 53.4k, False: 33.5k]
  ------------------
  339|  53.4k|    {
  340|  53.4k|        if(sbr->bs_df_noise[ch][noise] == 0)
  ------------------
  |  Branch (340:12): [True: 33.2k, False: 20.1k]
  ------------------
  341|  33.2k|        {
  342|  33.2k|            if ((sbr->bs_coupling == 1) && (ch == 1))
  ------------------
  |  Branch (342:17): [True: 8.72k, False: 24.5k]
  |  Branch (342:44): [True: 5.03k, False: 3.69k]
  ------------------
  343|  5.03k|            {
  344|  5.03k|                sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
  345|  5.03k|                    DEBUGVAR(1,276,"sbr_noise(): bs_data_noise")) << delta);
  346|  28.2k|            } else {
  347|  28.2k|                sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
  348|  28.2k|                    DEBUGVAR(1,277,"sbr_noise(): bs_data_noise")) << delta);
  349|  28.2k|            }
  350|  62.7k|            for (band = 1; band < sbr->N_Q; band++)
  ------------------
  |  Branch (350:28): [True: 29.5k, False: 33.2k]
  ------------------
  351|  29.5k|            {
  352|  29.5k|                sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, f_huff));
  353|  29.5k|            }
  354|  33.2k|        } else {
  355|  61.7k|            for (band = 0; band < sbr->N_Q; band++)
  ------------------
  |  Branch (355:28): [True: 41.5k, False: 20.1k]
  ------------------
  356|  41.5k|            {
  357|  41.5k|                sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, t_huff));
  358|  41.5k|            }
  359|  20.1k|        }
  360|  53.4k|    }
  361|       |
  362|  33.5k|    extract_noise_floor_data(sbr, ch);
  363|  33.5k|}
sbr_huff.c:sbr_huff_dec:
  231|   860k|{
  232|   860k|    uint8_t bit;
  233|   860k|    int16_t index = 0;
  234|       |
  235|  3.11M|    while (index >= 0)
  ------------------
  |  Branch (235:12): [True: 2.25M, False: 860k]
  ------------------
  236|  2.25M|    {
  237|  2.25M|        bit = (uint8_t)faad_get1bit(ld);
  238|  2.25M|        index = t_huff[index][bit];
  239|  2.25M|    }
  240|       |
  241|   860k|    return index + 64;
  242|   860k|}

qmfa_init:
   44|   105k|{
   45|   105k|    qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
   46|       |
   47|       |	/* x is implemented as double ringbuffer */
   48|   105k|    qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
   49|   105k|    memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
   50|       |
   51|       |	/* ringbuffer index */
   52|   105k|	qmfa->x_index = 0;
   53|       |
   54|   105k|    qmfa->channels = channels;
   55|       |
   56|   105k|    return qmfa;
   57|   105k|}
qmfa_end:
   60|   109k|{
   61|   109k|    if (qmfa)
  ------------------
  |  Branch (61:9): [True: 105k, False: 3.47k]
  ------------------
   62|   105k|    {
   63|   105k|        if (qmfa->x) faad_free(qmfa->x);
  ------------------
  |  Branch (63:13): [True: 105k, False: 0]
  ------------------
   64|   105k|        faad_free(qmfa);
   65|   105k|    }
   66|   109k|}
sbr_qmf_analysis_32:
   70|   125k|{
   71|   125k|    ALIGN real_t u[64];
   72|   125k|#ifndef SBR_LOW_POWER
   73|   125k|    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|   125k|    uint32_t in = 0;
   78|   125k|    uint8_t l;
   79|       |
   80|       |    /* qmf subsample l */
   81|  4.08M|    for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (81:17): [True: 3.95M, False: 125k]
  ------------------
   82|  3.95M|    {
   83|  3.95M|        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|   130M|        for (n = 32 - 1; n >= 0; n--)
  ------------------
  |  Branch (90:26): [True: 126M, False: 3.95M]
  ------------------
   91|   126M|        {
   92|       |#ifdef FIXED_POINT
   93|       |            qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = (input[in++]) >> 4;
   94|       |#else
   95|   126M|            qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = input[in++];
   96|   126M|#endif
   97|   126M|        }
   98|       |
   99|       |        /* window and summation to create array u */
  100|   257M|        for (n = 0; n < 64; n++)
  ------------------
  |  Branch (100:21): [True: 253M, False: 3.95M]
  ------------------
  101|   253M|        {
  102|   253M|            u[n] = MUL_F(qmfa->x[qmfa->x_index + n], qmf_c[2*n]) +
  ------------------
  |  |  286|   253M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  103|   253M|                MUL_F(qmfa->x[qmfa->x_index + n + 64], qmf_c[2*(n + 64)]) +
  ------------------
  |  |  286|   253M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  104|   253M|                MUL_F(qmfa->x[qmfa->x_index + n + 128], qmf_c[2*(n + 128)]) +
  ------------------
  |  |  286|   253M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  105|   253M|                MUL_F(qmfa->x[qmfa->x_index + n + 192], qmf_c[2*(n + 192)]) +
  ------------------
  |  |  286|   253M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  106|   253M|                MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
  ------------------
  |  |  286|   253M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  107|   253M|        }
  108|       |
  109|       |		/* update ringbuffer index */
  110|  3.95M|		qmfa->x_index -= 32;
  111|  3.95M|		if (qmfa->x_index < 0)
  ------------------
  |  Branch (111:7): [True: 464k, False: 3.49M]
  ------------------
  112|   464k|			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.95M|        in_imag[31] = u[1];
  141|  3.95M|        in_real[0] = u[0];
  142|   122M|        for (n = 1; n < 31; n++)
  ------------------
  |  Branch (142:21): [True: 118M, False: 3.95M]
  ------------------
  143|   118M|        {
  144|   118M|            in_imag[31 - n] = u[n+1];
  145|   118M|            in_real[n] = -u[64-n];
  146|   118M|        }
  147|  3.95M|        in_imag[0] = u[32];
  148|  3.95M|        in_real[31] = -u[33];
  149|       |
  150|       |        // dct4_kernel is DCT_IV without reordering which is done before and after FFT
  151|  3.95M|        dct4_kernel(in_real, in_imag, out_real, out_imag);
  152|       |
  153|       |        // Reordering of data moved from DCT_IV to here
  154|  67.3M|        for (n = 0; n < 16; n++) {
  ------------------
  |  Branch (154:21): [True: 63.3M, False: 3.95M]
  ------------------
  155|  63.3M|            if (2*n+1 < kx) {
  ------------------
  |  Branch (155:17): [True: 61.7M, False: 1.62M]
  ------------------
  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|  61.7M|                QMF_RE(X[l + offset][2*n])   = 2. * out_real[n];
  ------------------
  |  |  168|  61.7M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  61.7M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  163|  61.7M|                QMF_IM(X[l + offset][2*n])   = 2. * out_imag[n];
  ------------------
  |  |  169|  61.7M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  61.7M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  164|  61.7M|                QMF_RE(X[l + offset][2*n+1]) = -2. * out_imag[31-n];
  ------------------
  |  |  168|  61.7M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  61.7M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  165|  61.7M|                QMF_IM(X[l + offset][2*n+1]) = -2. * out_real[31-n];
  ------------------
  |  |  169|  61.7M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  61.7M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  166|  61.7M|#endif
  167|  61.7M|            } else {
  168|  1.62M|                if (2*n < kx) {
  ------------------
  |  Branch (168:21): [True: 143k, False: 1.48M]
  ------------------
  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|   143k|                    QMF_RE(X[l + offset][2*n])   = 2. * out_real[n];
  ------------------
  |  |  168|   143k|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|   143k|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  174|   143k|                    QMF_IM(X[l + offset][2*n])   = 2. * out_imag[n];
  ------------------
  |  |  169|   143k|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|   143k|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  175|   143k|#endif
  176|   143k|                }
  177|  1.48M|                else {
  178|  1.48M|                    QMF_RE(X[l + offset][2*n]) = 0;
  ------------------
  |  |  168|  1.48M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.48M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  179|  1.48M|                    QMF_IM(X[l + offset][2*n]) = 0;
  ------------------
  |  |  169|  1.48M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.48M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  180|  1.48M|                }
  181|  1.62M|                QMF_RE(X[l + offset][2*n+1]) = 0;
  ------------------
  |  |  168|  1.62M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  1.62M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  182|  1.62M|                QMF_IM(X[l + offset][2*n+1]) = 0;
  ------------------
  |  |  169|  1.62M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  1.62M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  183|  1.62M|            }
  184|  63.3M|        }
  185|  3.95M|#endif
  186|  3.95M|    }
  187|   125k|}
qmfs_init:
  226|   109k|{
  227|   109k|    qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
  228|       |
  229|       |	/* v is a double ringbuffer */
  230|   109k|    qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t));
  231|   109k|    memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t));
  232|       |
  233|   109k|    qmfs->v_index = 0;
  234|       |
  235|   109k|    qmfs->channels = channels;
  236|       |
  237|   109k|    return qmfs;
  238|   109k|}
qmfs_end:
  241|   109k|{
  242|   109k|    if (qmfs)
  ------------------
  |  Branch (242:9): [True: 109k, False: 0]
  ------------------
  243|   109k|    {
  244|   109k|        if (qmfs->v) faad_free(qmfs->v);
  ------------------
  |  Branch (244:13): [True: 109k, False: 0]
  ------------------
  245|   109k|        faad_free(qmfs);
  246|   109k|    }
  247|   109k|}
sbr_qmf_synthesis_32:
  392|  44.8k|{
  393|  44.8k|    ALIGN real_t x1[32], x2[32];
  394|  44.8k|#ifndef FIXED_POINT
  395|  44.8k|    real_t scale = 1.f/64.f;
  396|  44.8k|#endif
  397|  44.8k|    int32_t n, k, out = 0;
  398|  44.8k|    uint8_t l;
  399|       |
  400|       |
  401|       |    /* qmf subsample l */
  402|  1.47M|    for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (402:17): [True: 1.42M, False: 44.8k]
  ------------------
  403|  1.42M|    {
  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|  47.0M|        for (k = 0; k < 32; k++)
  ------------------
  |  Branch (410:21): [True: 45.6M, False: 1.42M]
  ------------------
  411|  45.6M|        {
  412|  45.6M|            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|  45.6M|  #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|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  413|  45.6M|            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|  45.6M|  #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|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  414|       |
  415|  45.6M|#ifndef FIXED_POINT
  416|  45.6M|            x1[k] *= scale;
  417|  45.6M|            x2[k] *= scale;
  418|       |#else
  419|       |            x1[k] >>= 1;
  420|       |            x2[k] >>= 1;
  421|       |#endif
  422|  45.6M|        }
  423|       |
  424|       |        /* transform */
  425|  1.42M|        DCT4_32(x1, x1);
  426|  1.42M|        DST4_32(x2, x2);
  427|       |
  428|  47.0M|        for (n = 0; n < 32; n++)
  ------------------
  |  Branch (428:21): [True: 45.6M, False: 1.42M]
  ------------------
  429|  45.6M|        {
  430|  45.6M|            qmfs->v[qmfs->v_index + n]      = qmfs->v[qmfs->v_index + 640 + n]      = -x1[n] + x2[n];
  431|  45.6M|            qmfs->v[qmfs->v_index + 63 - n] = qmfs->v[qmfs->v_index + 640 + 63 - n] =  x1[n] + x2[n];
  432|  45.6M|        }
  433|       |
  434|       |        /* calculate 32 output samples and window */
  435|  47.0M|        for (k = 0; k < 32; k++)
  ------------------
  |  Branch (435:21): [True: 45.6M, False: 1.42M]
  ------------------
  436|  45.6M|        {
  437|  45.6M|            output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  438|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  439|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  440|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  441|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  442|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  443|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  444|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  445|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  446|  45.6M|                MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
  ------------------
  |  |  286|  45.6M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  447|  45.6M|        }
  448|       |
  449|       |        /* update ringbuffer index */
  450|  1.42M|        qmfs->v_index -= 64;
  451|  1.42M|        if (qmfs->v_index < 0)
  ------------------
  |  Branch (451:13): [True: 169k, False: 1.25M]
  ------------------
  452|   169k|            qmfs->v_index = (640 - 64);
  453|  1.42M|    }
  454|  44.8k|}
sbr_qmf_synthesis_64:
  458|  86.2k|{
  459|       |//    ALIGN real_t x1[64], x2[64];
  460|  86.2k|#ifndef SBR_LOW_POWER
  461|  86.2k|    ALIGN real_t in_real1[32], in_imag1[32], out_real1[32], out_imag1[32];
  462|  86.2k|    ALIGN real_t in_real2[32], in_imag2[32], out_real2[32], out_imag2[32];
  463|  86.2k|#endif
  464|  86.2k|    qmf_t * pX;
  ------------------
  |  |  167|  86.2k|#define qmf_t complex_t
  ------------------
  465|  86.2k|    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|  86.2k|#ifndef FIXED_POINT
  478|  86.2k|    real_t scale = 1.f/64.f;
  479|  86.2k|#endif
  480|  86.2k|    int32_t n, k, out = 0;
  481|  86.2k|    uint8_t l;
  482|       |
  483|       |
  484|       |    /* qmf subsample l */
  485|  2.80M|    for (l = 0; l < sbr->numTimeSlotsRate; l++)
  ------------------
  |  Branch (485:17): [True: 2.71M, False: 86.2k]
  ------------------
  486|  2.71M|    {
  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.71M|#ifndef FIXED_POINT
  493|       |
  494|  2.71M|        pX = X[l];
  495|       |
  496|  2.71M|        in_imag1[31] = scale*QMF_RE(pX[1]);
  ------------------
  |  |  168|  2.71M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.71M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  497|  2.71M|        in_real1[0]  = scale*QMF_RE(pX[0]);
  ------------------
  |  |  168|  2.71M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.71M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  498|  2.71M|        in_imag2[31] = scale*QMF_IM(pX[63-1]);
  ------------------
  |  |  169|  2.71M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.71M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  499|  2.71M|        in_real2[0]  = scale*QMF_IM(pX[63-0]);
  ------------------
  |  |  169|  2.71M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.71M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  500|  84.1M|        for (k = 1; k < 31; k++)
  ------------------
  |  Branch (500:21): [True: 81.4M, False: 2.71M]
  ------------------
  501|  81.4M|        {
  502|  81.4M|            in_imag1[31 - k] = scale*QMF_RE(pX[2*k + 1]);
  ------------------
  |  |  168|  81.4M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  81.4M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  503|  81.4M|            in_real1[     k] = scale*QMF_RE(pX[2*k    ]);
  ------------------
  |  |  168|  81.4M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  81.4M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  504|  81.4M|            in_imag2[31 - k] = scale*QMF_IM(pX[63 - (2*k + 1)]);
  ------------------
  |  |  169|  81.4M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  81.4M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  505|  81.4M|            in_real2[     k] = scale*QMF_IM(pX[63 - (2*k    )]);
  ------------------
  |  |  169|  81.4M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  81.4M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  506|  81.4M|        }
  507|  2.71M|        in_imag1[0]  = scale*QMF_RE(pX[63]);
  ------------------
  |  |  168|  2.71M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.71M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  508|  2.71M|        in_real1[31] = scale*QMF_RE(pX[62]);
  ------------------
  |  |  168|  2.71M|#define QMF_RE(A) RE(A)
  |  |  ------------------
  |  |  |  |  391|  2.71M|#define RE(A) (A)[0]
  |  |  ------------------
  ------------------
  509|  2.71M|        in_imag2[0]  = scale*QMF_IM(pX[63-63]);
  ------------------
  |  |  169|  2.71M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.71M|#define IM(A) (A)[1]
  |  |  ------------------
  ------------------
  510|  2.71M|        in_real2[31] = scale*QMF_IM(pX[63-62]);
  ------------------
  |  |  169|  2.71M|#define QMF_IM(A) IM(A)
  |  |  ------------------
  |  |  |  |  392|  2.71M|#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.71M|        dct4_kernel(in_real1, in_imag1, out_real1, out_imag1);
  537|  2.71M|        dct4_kernel(in_real2, in_imag2, out_real2, out_imag2);
  538|       |
  539|       |
  540|  2.71M|        pring_buffer_1 = qmfs->v + qmfs->v_index;
  541|  2.71M|        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|  89.5M|        for (n = 0; n < 32; n++)
  ------------------
  |  Branch (563:21): [True: 86.8M, False: 2.71M]
  ------------------
  564|  86.8M|        {
  565|       |            // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
  566|  86.8M|            pring_buffer_1[2*n]         = pring_buffer_3[2*n]         = out_real2[n] - out_real1[n];
  567|  86.8M|            pring_buffer_1[127-2*n]     = pring_buffer_3[127-2*n]     = out_real2[n] + out_real1[n];
  568|  86.8M|            pring_buffer_1[2*n+1]       = pring_buffer_3[2*n+1]       = out_imag2[31-n] + out_imag1[31-n];
  569|  86.8M|            pring_buffer_1[127-(2*n+1)] = pring_buffer_3[127-(2*n+1)] = out_imag2[31-n] - out_imag1[31-n];
  570|  86.8M|        }
  571|       |
  572|  2.71M|#endif // #ifdef PREFER_POINTERS
  573|       |
  574|  2.71M|        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|   176M|        for (k = 0; k < 64; k++)
  ------------------
  |  Branch (598:21): [True: 173M, False: 2.71M]
  ------------------
  599|   173M|        {
  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|   173M|            output[out++] =
  614|   173M|                MUL_F(pring_buffer_1[k+0],          qmf_c[k+0])   +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  615|   173M|                MUL_F(pring_buffer_1[k+192],        qmf_c[k+64])  +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  616|   173M|                MUL_F(pring_buffer_1[k+256],        qmf_c[k+128]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  617|   173M|                MUL_F(pring_buffer_1[k+(256+192)],  qmf_c[k+192]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  618|   173M|                MUL_F(pring_buffer_1[k+512],        qmf_c[k+256]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  619|   173M|                MUL_F(pring_buffer_1[k+(512+192)],  qmf_c[k+320]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  620|   173M|                MUL_F(pring_buffer_1[k+768],        qmf_c[k+384]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  621|   173M|                MUL_F(pring_buffer_1[k+(768+192)],  qmf_c[k+448]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  622|   173M|                MUL_F(pring_buffer_1[k+1024],       qmf_c[k+512]) +
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  623|   173M|                MUL_F(pring_buffer_1[k+(1024+192)], qmf_c[k+576]);
  ------------------
  |  |  286|   173M|  #define MUL_F(A,B) ((A)*(B))
  ------------------
  624|   173M|#endif // #ifdef PREFER_POINTERS
  625|   173M|        }
  626|       |
  627|       |        /* update ringbuffer index */
  628|  2.71M|        qmfs->v_index -= 128;
  629|  2.71M|        if (qmfs->v_index < 0)
  ------------------
  |  Branch (629:13): [True: 314k, False: 2.40M]
  ------------------
  630|   314k|            qmfs->v_index = (1280 - 128);
  631|  2.71M|    }
  632|  86.2k|}

sbr_extension_data:
  140|  25.8k|{
  141|  25.8k|    uint8_t result = 0;
  142|  25.8k|    uint16_t num_align_bits = 0;
  143|  25.8k|    uint16_t num_sbr_bits1 = (uint16_t)faad_get_processed_bits(ld);
  144|  25.8k|    uint16_t num_sbr_bits2;
  145|       |
  146|  25.8k|    uint8_t saved_start_freq, saved_samplerate_mode;
  147|  25.8k|    uint8_t saved_stop_freq, saved_freq_scale;
  148|  25.8k|    uint8_t saved_alter_scale, saved_xover_band;
  149|       |
  150|  25.8k|#if (defined(PS_DEC) || defined(DRM_PS))
  151|  25.8k|    if (psResetFlag)
  ------------------
  |  Branch (151:9): [True: 15.9k, False: 9.93k]
  ------------------
  152|  15.9k|        sbr->psResetFlag = psResetFlag;
  153|  25.8k|#endif
  154|       |
  155|  25.8k|#ifdef DRM
  156|  25.8k|    if (!sbr->Is_DRM_SBR)
  ------------------
  |  Branch (156:9): [True: 25.5k, False: 333]
  ------------------
  157|  25.5k|#endif
  158|  25.5k|    {
  159|  25.5k|        uint8_t bs_extension_type = (uint8_t)faad_getbits(ld, 4
  160|  25.5k|            DEBUGVAR(1,198,"sbr_bitstream(): bs_extension_type"));
  161|       |
  162|  25.5k|        if (bs_extension_type == EXT_SBR_DATA_CRC)
  ------------------
  |  |   44|  25.5k|#define EXT_SBR_DATA_CRC 14
  ------------------
  |  Branch (162:13): [True: 8.75k, False: 16.7k]
  ------------------
  163|  8.75k|        {
  164|  8.75k|            sbr->bs_sbr_crc_bits = (uint16_t)faad_getbits(ld, 10
  165|  8.75k|                DEBUGVAR(1,199,"sbr_bitstream(): bs_sbr_crc_bits"));
  166|  8.75k|        }
  167|  25.5k|    }
  168|       |
  169|       |    /* save old header values, in case the new ones are corrupted */
  170|  25.8k|    saved_start_freq = sbr->bs_start_freq;
  171|  25.8k|    saved_samplerate_mode = sbr->bs_samplerate_mode;
  172|  25.8k|    saved_stop_freq = sbr->bs_stop_freq;
  173|  25.8k|    saved_freq_scale = sbr->bs_freq_scale;
  174|  25.8k|    saved_alter_scale = sbr->bs_alter_scale;
  175|  25.8k|    saved_xover_band = sbr->bs_xover_band;
  176|       |
  177|  25.8k|    sbr->bs_header_flag = faad_get1bit(ld
  178|  25.8k|        DEBUGVAR(1,200,"sbr_bitstream(): bs_header_flag"));
  179|       |
  180|  25.8k|    if (sbr->bs_header_flag)
  ------------------
  |  Branch (180:9): [True: 25.2k, False: 657]
  ------------------
  181|  25.2k|        sbr_header(ld, sbr);
  182|       |
  183|       |    /* Reset? */
  184|  25.8k|    sbr_reset(sbr);
  185|       |
  186|       |    /* first frame should have a header */
  187|       |    //if (!(sbr->frame == 0 && sbr->bs_header_flag == 0))
  188|  25.8k|    if (sbr->header_count != 0)
  ------------------
  |  Branch (188:9): [True: 25.4k, False: 407]
  ------------------
  189|  25.4k|    {
  190|  25.4k|        if (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked))
  ------------------
  |  Branch (190:13): [True: 25.0k, False: 388]
  |  Branch (190:28): [True: 182, False: 206]
  |  Branch (190:51): [True: 0, False: 182]
  ------------------
  191|  25.0k|        {
  192|  25.0k|            uint8_t rt = calc_sbr_tables(sbr, sbr->bs_start_freq, sbr->bs_stop_freq,
  193|  25.0k|                sbr->bs_samplerate_mode, sbr->bs_freq_scale,
  194|  25.0k|                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|  25.0k|            if (rt > 0)
  ------------------
  |  Branch (197:17): [True: 7.31k, False: 17.7k]
  ------------------
  198|  7.31k|            {
  199|  7.31k|                result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
  200|  7.31k|                    saved_samplerate_mode, saved_freq_scale,
  201|  7.31k|                    saved_alter_scale, saved_xover_band);
  202|  7.31k|            }
  203|  25.0k|        }
  204|       |
  205|  25.4k|        if (result == 0)
  ------------------
  |  Branch (205:13): [True: 23.9k, False: 1.56k]
  ------------------
  206|  23.9k|        {
  207|  23.9k|            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|  23.9k|            if ((result > 0) &&
  ------------------
  |  Branch (215:17): [True: 8.33k, False: 15.5k]
  ------------------
  216|  8.33k|                (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked)))
  ------------------
  |  Branch (216:18): [True: 8.20k, False: 124]
  |  Branch (216:33): [True: 25, False: 99]
  |  Branch (216:56): [True: 0, False: 25]
  ------------------
  217|  8.20k|            {
  218|  8.20k|                result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
  219|  8.20k|                    saved_samplerate_mode, saved_freq_scale,
  220|  8.20k|                    saved_alter_scale, saved_xover_band);
  221|  8.20k|            }
  222|       |
  223|       |            /* we should be able to safely set result to 0 now, */
  224|       |            /* but practise indicates this doesn't work well */
  225|  23.9k|        }
  226|  25.4k|    } else {
  227|    407|        result = 1;
  228|    407|    }
  229|       |
  230|  25.8k|    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|  25.8k|    if (8*cnt < num_sbr_bits2)
  ------------------
  |  Branch (233:9): [True: 17.5k, False: 8.37k]
  ------------------
  234|  17.5k|    {
  235|  17.5k|        faad_resetbits(ld, num_sbr_bits1 + 8u * cnt);
  236|  17.5k|        num_sbr_bits2 = 8*cnt;
  237|       |
  238|  17.5k|#ifdef PS_DEC
  239|       |        /* turn off PS for the unfortunate case that we randomly read some
  240|       |         * PS data that looks correct */
  241|  17.5k|        sbr->ps_used = 0;
  242|  17.5k|#endif
  243|       |
  244|       |        /* Make sure it doesn't decode SBR in this frame, or we'll get glitches */
  245|  17.5k|        return 1;
  246|  17.5k|    }
  247|       |
  248|  8.37k|#ifdef DRM
  249|  8.37k|    if (!sbr->Is_DRM_SBR)
  ------------------
  |  Branch (249:9): [True: 8.06k, False: 306]
  ------------------
  250|  8.06k|#endif
  251|  8.06k|    {
  252|       |        /* -4 does not apply, bs_extension_type is re-read in this function */
  253|  8.06k|        num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits2;
  254|       |
  255|   182k|        while (num_align_bits > 7)
  ------------------
  |  Branch (255:16): [True: 174k, False: 8.06k]
  ------------------
  256|   174k|        {
  257|   174k|            faad_getbits(ld, 8
  258|   174k|                DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
  259|   174k|            num_align_bits -= 8;
  260|   174k|        }
  261|  8.06k|        faad_getbits(ld, num_align_bits
  262|  8.06k|            DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
  263|  8.06k|    }
  264|       |
  265|  8.37k|    return result;
  266|  25.8k|}
sbr_syntax.c:sbr_reset:
   69|  25.8k|{
   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|  25.8k|    if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
  ------------------
  |  Branch (80:9): [True: 25.3k, False: 536]
  ------------------
   81|    536|        (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
  ------------------
  |  Branch (81:9): [True: 46, False: 490]
  ------------------
   82|    490|        (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
  ------------------
  |  Branch (82:9): [True: 28, False: 462]
  ------------------
   83|    462|        (sbr->bs_alter_scale != sbr->bs_alter_scale_prev) ||
  ------------------
  |  Branch (83:9): [True: 25, False: 437]
  ------------------
   84|    437|        (sbr->bs_xover_band != sbr->bs_xover_band_prev) ||
  ------------------
  |  Branch (84:9): [True: 23, False: 414]
  ------------------
   85|    414|        (sbr->bs_noise_bands != sbr->bs_noise_bands_prev))
  ------------------
  |  Branch (85:9): [True: 26, False: 388]
  ------------------
   86|  25.4k|    {
   87|  25.4k|        sbr->Reset = 1;
   88|  25.4k|    } else {
   89|    388|        sbr->Reset = 0;
   90|    388|    }
   91|       |
   92|  25.8k|    sbr->bs_start_freq_prev = sbr->bs_start_freq;
   93|  25.8k|    sbr->bs_stop_freq_prev = sbr->bs_stop_freq;
   94|  25.8k|    sbr->bs_freq_scale_prev = sbr->bs_freq_scale;
   95|  25.8k|    sbr->bs_alter_scale_prev = sbr->bs_alter_scale;
   96|  25.8k|    sbr->bs_xover_band_prev = sbr->bs_xover_band;
   97|  25.8k|    sbr->bs_noise_bands_prev = sbr->bs_noise_bands;
   98|  25.8k|}
sbr_syntax.c:calc_sbr_tables:
  103|  40.6k|{
  104|  40.6k|    uint8_t result = 0;
  105|  40.6k|    uint8_t k2;
  106|       |
  107|       |    /* calculate the Master Frequency Table */
  108|  40.6k|    sbr->k0 = qmf_start_channel(start_freq, samplerate_mode, sbr->sample_rate);
  109|  40.6k|    k2 = qmf_stop_channel(stop_freq, sbr->sample_rate, sbr->k0);
  110|       |
  111|       |    /* check k0 and k2 */
  112|  40.6k|    if (sbr->sample_rate >= 48000)
  ------------------
  |  Branch (112:9): [True: 16.8k, False: 23.7k]
  ------------------
  113|  16.8k|    {
  114|  16.8k|        if ((k2 - sbr->k0) > 32)
  ------------------
  |  Branch (114:13): [True: 1.08k, False: 15.8k]
  ------------------
  115|  1.08k|            result += 1;
  116|  23.7k|    } else if (sbr->sample_rate <= 32000) {
  ------------------
  |  Branch (116:16): [True: 18.7k, False: 4.94k]
  ------------------
  117|  18.7k|        if ((k2 - sbr->k0) > 48)
  ------------------
  |  Branch (117:13): [True: 477, False: 18.2k]
  ------------------
  118|    477|            result += 1;
  119|  18.7k|    } else { /* (sbr->sample_rate == 44100) */
  120|  4.94k|        if ((k2 - sbr->k0) > 45)
  ------------------
  |  Branch (120:13): [True: 453, False: 4.49k]
  ------------------
  121|    453|            result += 1;
  122|  4.94k|    }
  123|       |
  124|  40.6k|    if (freq_scale == 0)
  ------------------
  |  Branch (124:9): [True: 8.59k, False: 32.0k]
  ------------------
  125|  8.59k|    {
  126|  8.59k|        result += master_frequency_table_fs0(sbr, sbr->k0, k2, alter_scale);
  127|  32.0k|    } else {
  128|  32.0k|        result += master_frequency_table(sbr, sbr->k0, k2, freq_scale, alter_scale);
  129|  32.0k|    }
  130|  40.6k|    result += derived_frequency_table(sbr, xover_band, k2);
  131|       |
  132|  40.6k|    result = (result > 0) ? 1 : 0;
  ------------------
  |  Branch (132:14): [True: 10.8k, False: 29.8k]
  ------------------
  133|       |
  134|  40.6k|    return result;
  135|  40.6k|}
sbr_syntax.c:sbr_header:
  270|  25.2k|{
  271|  25.2k|    uint8_t bs_header_extra_1, bs_header_extra_2;
  272|       |
  273|  25.2k|    sbr->header_count++;
  274|       |
  275|  25.2k|    sbr->bs_amp_res = faad_get1bit(ld
  276|  25.2k|        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|  25.2k|    sbr->bs_start_freq = (uint8_t)faad_getbits(ld, 4
  281|  25.2k|        DEBUGVAR(1,204,"sbr_header(): bs_start_freq"));
  282|  25.2k|    sbr->bs_stop_freq = (uint8_t)faad_getbits(ld, 4
  283|  25.2k|        DEBUGVAR(1,205,"sbr_header(): bs_stop_freq"));
  284|  25.2k|    sbr->bs_xover_band = (uint8_t)faad_getbits(ld, 3
  285|  25.2k|        DEBUGVAR(1,206,"sbr_header(): bs_xover_band"));
  286|  25.2k|    faad_getbits(ld, 2
  287|  25.2k|        DEBUGVAR(1,207,"sbr_header(): bs_reserved_bits_hdr"));
  288|  25.2k|    bs_header_extra_1 = (uint8_t)faad_get1bit(ld
  289|  25.2k|        DEBUGVAR(1,208,"sbr_header(): bs_header_extra_1"));
  290|  25.2k|    bs_header_extra_2 = (uint8_t)faad_get1bit(ld
  291|  25.2k|        DEBUGVAR(1,209,"sbr_header(): bs_header_extra_2"));
  292|       |
  293|  25.2k|    if (bs_header_extra_1)
  ------------------
  |  Branch (293:9): [True: 10.8k, False: 14.4k]
  ------------------
  294|  10.8k|    {
  295|  10.8k|        sbr->bs_freq_scale = (uint8_t)faad_getbits(ld, 2
  296|  10.8k|            DEBUGVAR(1,211,"sbr_header(): bs_freq_scale"));
  297|  10.8k|        sbr->bs_alter_scale = (uint8_t)faad_get1bit(ld
  298|  10.8k|            DEBUGVAR(1,212,"sbr_header(): bs_alter_scale"));
  299|  10.8k|        sbr->bs_noise_bands = (uint8_t)faad_getbits(ld, 2
  300|  10.8k|            DEBUGVAR(1,213,"sbr_header(): bs_noise_bands"));
  301|  14.4k|    } else {
  302|       |        /* Default values */
  303|  14.4k|        sbr->bs_freq_scale = 2;
  304|  14.4k|        sbr->bs_alter_scale = 1;
  305|  14.4k|        sbr->bs_noise_bands = 2;
  306|  14.4k|    }
  307|       |
  308|  25.2k|    if (bs_header_extra_2)
  ------------------
  |  Branch (308:9): [True: 6.37k, False: 18.8k]
  ------------------
  309|  6.37k|    {
  310|  6.37k|        sbr->bs_limiter_bands = (uint8_t)faad_getbits(ld, 2
  311|  6.37k|            DEBUGVAR(1,214,"sbr_header(): bs_limiter_bands"));
  312|  6.37k|        sbr->bs_limiter_gains = (uint8_t)faad_getbits(ld, 2
  313|  6.37k|            DEBUGVAR(1,215,"sbr_header(): bs_limiter_gains"));
  314|  6.37k|        sbr->bs_interpol_freq = (uint8_t)faad_get1bit(ld
  315|  6.37k|            DEBUGVAR(1,216,"sbr_header(): bs_interpol_freq"));
  316|  6.37k|        sbr->bs_smoothing_mode = (uint8_t)faad_get1bit(ld
  317|  6.37k|            DEBUGVAR(1,217,"sbr_header(): bs_smoothing_mode"));
  318|  18.8k|    } else {
  319|       |        /* Default values */
  320|  18.8k|        sbr->bs_limiter_bands = 2;
  321|  18.8k|        sbr->bs_limiter_gains = 2;
  322|  18.8k|        sbr->bs_interpol_freq = 1;
  323|  18.8k|        sbr->bs_smoothing_mode = 1;
  324|  18.8k|    }
  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|  25.2k|}
sbr_syntax.c:sbr_data:
  351|  23.9k|{
  352|  23.9k|    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|  23.9k|    sbr->rate = (sbr->bs_samplerate_mode) ? 2 : 1;
  ------------------
  |  Branch (358:17): [True: 23.9k, False: 0]
  ------------------
  359|       |
  360|  23.9k|    switch (sbr->id_aac)
  ------------------
  |  Branch (360:13): [True: 23.9k, False: 11]
  ------------------
  361|  23.9k|    {
  362|  12.1k|    case ID_SCE:
  ------------------
  |  |   86|  12.1k|#define ID_SCE 0x0
  ------------------
  |  Branch (362:5): [True: 12.1k, False: 11.7k]
  ------------------
  363|  12.1k|		if ((result = sbr_single_channel_element(ld, sbr)) > 0)
  ------------------
  |  Branch (363:7): [True: 5.95k, False: 6.19k]
  ------------------
  364|  5.95k|			return result;
  365|  6.19k|        break;
  366|  11.7k|    case ID_CPE:
  ------------------
  |  |   87|  11.7k|#define ID_CPE 0x1
  ------------------
  |  Branch (366:5): [True: 11.7k, False: 12.1k]
  ------------------
  367|  11.7k|		if ((result = sbr_channel_pair_element(ld, sbr)) > 0)
  ------------------
  |  Branch (367:7): [True: 2.38k, False: 9.37k]
  ------------------
  368|  2.38k|			return result;
  369|  9.37k|        break;
  370|  23.9k|    }
  371|       |
  372|  15.5k|	return 0;
  373|  23.9k|}
sbr_syntax.c:sbr_single_channel_element:
  377|  12.1k|{
  378|  12.1k|    uint8_t result;
  379|       |
  380|  12.1k|    if (faad_get1bit(ld
  ------------------
  |  Branch (380:9): [True: 2.75k, False: 9.39k]
  ------------------
  381|  12.1k|        DEBUGVAR(1,220,"sbr_single_channel_element(): bs_data_extra")))
  382|  2.75k|    {
  383|  2.75k|        faad_getbits(ld, 4
  384|  2.75k|            DEBUGVAR(1,221,"sbr_single_channel_element(): bs_reserved_bits_data"));
  385|  2.75k|    }
  386|       |
  387|  12.1k|#ifdef DRM
  388|       |    /* bs_coupling, from sbr_channel_pair_base_element(bs_amp_res) */
  389|  12.1k|    if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (389:9): [True: 265, False: 11.8k]
  ------------------
  390|    265|    {
  391|    265|        faad_get1bit(ld);
  392|    265|    }
  393|  12.1k|#endif
  394|       |
  395|  12.1k|    if ((result = sbr_grid(ld, sbr, 0)) > 0)
  ------------------
  |  Branch (395:9): [True: 625, False: 11.5k]
  ------------------
  396|    625|        return result;
  397|       |
  398|  11.5k|    sbr_dtdf(ld, sbr, 0);
  399|  11.5k|    invf_mode(ld, sbr, 0);
  400|  11.5k|    sbr_envelope(ld, sbr, 0);
  401|  11.5k|    sbr_noise(ld, sbr, 0);
  402|       |
  403|  11.5k|#ifndef FIXED_POINT
  404|  11.5k|    envelope_noise_dequantisation(sbr, 0);
  405|  11.5k|#endif
  406|       |
  407|  11.5k|    memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
  408|       |
  409|  11.5k|    sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
  410|  11.5k|        DEBUGVAR(1,223,"sbr_single_channel_element(): bs_add_harmonic_flag[0]"));
  411|  11.5k|    if (sbr->bs_add_harmonic_flag[0])
  ------------------
  |  Branch (411:9): [True: 4.13k, False: 7.38k]
  ------------------
  412|  4.13k|        sinusoidal_coding(ld, sbr, 0);
  413|       |
  414|  11.5k|    sbr->bs_extended_data = faad_get1bit(ld
  415|  11.5k|        DEBUGVAR(1,224,"sbr_single_channel_element(): bs_extended_data[0]"));
  416|       |
  417|  11.5k|    if (sbr->bs_extended_data)
  ------------------
  |  Branch (417:9): [True: 7.54k, False: 3.98k]
  ------------------
  418|  7.54k|    {
  419|  7.54k|        uint16_t nr_bits_left;
  420|  7.54k|#if (defined(PS_DEC) || defined(DRM_PS))
  421|  7.54k|        uint8_t ps_ext_read = 0;
  422|  7.54k|#endif
  423|  7.54k|        uint16_t cnt = (uint16_t)faad_getbits(ld, 4
  424|  7.54k|            DEBUGVAR(1,225,"sbr_single_channel_element(): bs_extension_size"));
  425|  7.54k|        if (cnt == 15)
  ------------------
  |  Branch (425:13): [True: 1.03k, False: 6.50k]
  ------------------
  426|  1.03k|        {
  427|  1.03k|            cnt += (uint16_t)faad_getbits(ld, 8
  428|  1.03k|                DEBUGVAR(1,226,"sbr_single_channel_element(): bs_esc_count"));
  429|  1.03k|        }
  430|       |
  431|  7.54k|        nr_bits_left = 8 * cnt;
  432|  18.7k|        while (nr_bits_left > 7)
  ------------------
  |  Branch (432:16): [True: 16.5k, False: 2.21k]
  ------------------
  433|  16.5k|        {
  434|  16.5k|            uint16_t tmp_nr_bits = 0;
  435|       |
  436|  16.5k|            sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
  437|  16.5k|                DEBUGVAR(1,227,"sbr_single_channel_element(): bs_extension_id"));
  438|  16.5k|            tmp_nr_bits += 2;
  439|       |
  440|       |            /* allow only 1 PS extension element per extension data */
  441|  16.5k|#if (defined(PS_DEC) || defined(DRM_PS))
  442|  16.5k|#if (defined(PS_DEC) && defined(DRM_PS))
  443|  16.5k|            if (sbr->bs_extension_id == EXTENSION_ID_PS || sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
  ------------------
  |  |   40|  33.1k|#define EXTENSION_ID_PS 2
  ------------------
                          if (sbr->bs_extension_id == EXTENSION_ID_PS || sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
  ------------------
  |  |   40|  10.3k|#define DRM_PARAMETRIC_STEREO    0
  ------------------
  |  Branch (443:17): [True: 6.17k, False: 10.3k]
  |  Branch (443:60): [True: 3.94k, False: 6.45k]
  ------------------
  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|  10.1k|            {
  454|  10.1k|                if (ps_ext_read == 0)
  ------------------
  |  Branch (454:21): [True: 7.26k, False: 2.85k]
  ------------------
  455|  7.26k|                {
  456|  7.26k|                    ps_ext_read = 1;
  457|  7.26k|                } else {
  458|       |                    /* to be safe make it 3, will switch to "default"
  459|       |                     * in sbr_extension() */
  460|  2.85k|#ifdef DRM
  461|  2.85k|                    return 1;
  462|       |#else
  463|       |                    sbr->bs_extension_id = 3;
  464|       |#endif
  465|  2.85k|                }
  466|  10.1k|            }
  467|  13.7k|#endif
  468|       |
  469|  13.7k|            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.7k|            if (tmp_nr_bits > nr_bits_left)
  ------------------
  |  Branch (472:17): [True: 2.46k, False: 11.2k]
  ------------------
  473|  2.46k|                return 1;
  474|       |
  475|  11.2k|            nr_bits_left -= tmp_nr_bits;
  476|  11.2k|        }
  477|       |
  478|       |        /* Corrigendum */
  479|  2.21k|        if (nr_bits_left > 0)
  ------------------
  |  Branch (479:13): [True: 1.85k, False: 359]
  ------------------
  480|  1.85k|        {
  481|  1.85k|            faad_getbits(ld, nr_bits_left
  482|  1.85k|                DEBUGVAR(1,280,"sbr_single_channel_element(): nr_bits_left"));
  483|  1.85k|        }
  484|  2.21k|    }
  485|       |
  486|  6.19k|    return 0;
  487|  11.5k|}
sbr_syntax.c:sbr_grid:
  660|  30.7k|{
  661|  30.7k|    uint8_t i, j, env, rel, result;
  662|  30.7k|    uint8_t bs_abs_bord, bs_abs_bord_1;
  663|  30.7k|    uint8_t bs_num_env = 0;
  664|  30.7k|    uint8_t saved_L_E = sbr->L_E[ch];
  665|  30.7k|    uint8_t saved_L_Q = sbr->L_Q[ch];
  666|  30.7k|    uint8_t saved_frame_class = sbr->bs_frame_class[ch];
  667|       |
  668|  30.7k|    sbr->bs_frame_class[ch] = (uint8_t)faad_getbits(ld, 2
  669|  30.7k|        DEBUGVAR(1,248,"sbr_grid(): bs_frame_class"));
  670|       |
  671|  30.7k|    switch (sbr->bs_frame_class[ch])
  ------------------
  |  Branch (671:13): [True: 30.7k, False: 0]
  ------------------
  672|  30.7k|    {
  673|  10.5k|    case FIXFIX:
  ------------------
  |  |   46|  10.5k|#define FIXFIX 0
  ------------------
  |  Branch (673:5): [True: 10.5k, False: 20.1k]
  ------------------
  674|  10.5k|        i = (uint8_t)faad_getbits(ld, 2
  675|  10.5k|            DEBUGVAR(1,249,"sbr_grid(): bs_num_env_raw"));
  676|       |
  677|  10.5k|        bs_num_env = min(1u << i, 5u);
  ------------------
  |  |   60|  10.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 9.59k, False: 974]
  |  |  ------------------
  ------------------
  678|       |
  679|  10.5k|        i = (uint8_t)faad_get1bit(ld
  680|  10.5k|            DEBUGVAR(1,250,"sbr_grid(): bs_freq_res_flag"));
  681|  30.5k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (681:23): [True: 19.9k, False: 10.5k]
  ------------------
  682|  19.9k|            sbr->f[ch][env] = i;
  683|       |
  684|  10.5k|        sbr->abs_bord_lead[ch] = 0;
  685|  10.5k|        sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
  686|  10.5k|        sbr->n_rel_lead[ch] = bs_num_env - 1;
  687|  10.5k|        sbr->n_rel_trail[ch] = 0;
  688|  10.5k|        break;
  689|       |
  690|  6.74k|    case FIXVAR:
  ------------------
  |  |   47|  6.74k|#define FIXVAR 1
  ------------------
  |  Branch (690:5): [True: 6.74k, False: 24.0k]
  ------------------
  691|  6.74k|        bs_abs_bord = (uint8_t)faad_getbits(ld, 2
  692|  6.74k|            DEBUGVAR(1,251,"sbr_grid(): bs_abs_bord")) + sbr->numTimeSlots;
  693|  6.74k|        bs_num_env = (uint8_t)faad_getbits(ld, 2
  694|  6.74k|            DEBUGVAR(1,252,"sbr_grid(): bs_num_env")) + 1;
  695|       |
  696|  13.5k|        for (rel = 0; rel < bs_num_env-1; rel++)
  ------------------
  |  Branch (696:23): [True: 6.80k, False: 6.74k]
  ------------------
  697|  6.80k|        {
  698|  6.80k|            sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  699|  6.80k|                DEBUGVAR(1,253,"sbr_grid(): bs_rel_bord")) + 2;
  700|  6.80k|        }
  701|  6.74k|        j = bs_num_env;
  702|  6.74k|        i = sbr_log2(j + 1);
  703|  6.74k|        sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
  704|  6.74k|            DEBUGVAR(1,254,"sbr_grid(): bs_pointer"));
  705|  6.74k|        sbr->bs_pointer[ch] = min(sbr->bs_pointer[ch], j);
  ------------------
  |  |   60|  6.74k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.90k, False: 1.84k]
  |  |  ------------------
  ------------------
  706|       |
  707|  20.3k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (707:23): [True: 13.5k, False: 6.74k]
  ------------------
  708|  13.5k|        {
  709|  13.5k|            sbr->f[ch][bs_num_env - env - 1] = (uint8_t)faad_get1bit(ld
  710|  13.5k|                DEBUGVAR(1,255,"sbr_grid(): bs_freq_res"));
  711|  13.5k|        }
  712|       |
  713|  6.74k|        sbr->abs_bord_lead[ch] = 0;
  714|  6.74k|        sbr->abs_bord_trail[ch] = bs_abs_bord;
  715|  6.74k|        sbr->n_rel_lead[ch] = 0;
  716|  6.74k|        sbr->n_rel_trail[ch] = bs_num_env - 1;
  717|  6.74k|        break;
  718|       |
  719|  7.07k|    case VARFIX:
  ------------------
  |  |   48|  7.07k|#define VARFIX 2
  ------------------
  |  Branch (719:5): [True: 7.07k, False: 23.6k]
  ------------------
  720|  7.07k|        bs_abs_bord = (uint8_t)faad_getbits(ld, 2
  721|  7.07k|            DEBUGVAR(1,256,"sbr_grid(): bs_abs_bord"));
  722|  7.07k|        bs_num_env = (uint8_t)faad_getbits(ld, 2
  723|  7.07k|            DEBUGVAR(1,257,"sbr_grid(): bs_num_env")) + 1;
  724|       |
  725|  16.6k|        for (rel = 0; rel < bs_num_env-1; rel++)
  ------------------
  |  Branch (725:23): [True: 9.59k, False: 7.07k]
  ------------------
  726|  9.59k|        {
  727|  9.59k|            sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  728|  9.59k|                DEBUGVAR(1,258,"sbr_grid(): bs_rel_bord")) + 2;
  729|  9.59k|        }
  730|  7.07k|        j = bs_num_env;
  731|  7.07k|        i = sbr_log2(j + 1);
  732|  7.07k|        sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
  733|  7.07k|            DEBUGVAR(1,259,"sbr_grid(): bs_pointer"));
  734|  7.07k|        sbr->bs_pointer[ch] = min(sbr->bs_pointer[ch], j);
  ------------------
  |  |   60|  7.07k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 5.30k, False: 1.77k]
  |  |  ------------------
  ------------------
  735|       |
  736|  23.7k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (736:23): [True: 16.6k, False: 7.07k]
  ------------------
  737|  16.6k|        {
  738|  16.6k|            sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
  739|  16.6k|                DEBUGVAR(1,260,"sbr_grid(): bs_freq_res"));
  740|  16.6k|        }
  741|       |
  742|  7.07k|        sbr->abs_bord_lead[ch] = bs_abs_bord;
  743|  7.07k|        sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
  744|  7.07k|        sbr->n_rel_lead[ch] = bs_num_env - 1;
  745|  7.07k|        sbr->n_rel_trail[ch] = 0;
  746|  7.07k|        break;
  747|       |
  748|  6.37k|    case VARVAR:
  ------------------
  |  |   49|  6.37k|#define VARVAR 3
  ------------------
  |  Branch (748:5): [True: 6.37k, False: 24.3k]
  ------------------
  749|  6.37k|        bs_abs_bord = (uint8_t)faad_getbits(ld, 2
  750|  6.37k|            DEBUGVAR(1,261,"sbr_grid(): bs_abs_bord_0"));
  751|  6.37k|        bs_abs_bord_1 = (uint8_t)faad_getbits(ld, 2
  752|  6.37k|            DEBUGVAR(1,262,"sbr_grid(): bs_abs_bord_1")) + sbr->numTimeSlots;
  753|  6.37k|        sbr->bs_num_rel_0[ch] = (uint8_t)faad_getbits(ld, 2
  754|  6.37k|            DEBUGVAR(1,263,"sbr_grid(): bs_num_rel_0"));
  755|  6.37k|        sbr->bs_num_rel_1[ch] = (uint8_t)faad_getbits(ld, 2
  756|  6.37k|            DEBUGVAR(1,264,"sbr_grid(): bs_num_rel_1"));
  757|       |
  758|  6.37k|        bs_num_env = min(5, sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1);
  ------------------
  |  |   60|  6.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 1.22k, False: 5.14k]
  |  |  ------------------
  ------------------
  759|       |
  760|  14.8k|        for (rel = 0; rel < sbr->bs_num_rel_0[ch]; rel++)
  ------------------
  |  Branch (760:23): [True: 8.43k, False: 6.37k]
  ------------------
  761|  8.43k|        {
  762|  8.43k|            sbr->bs_rel_bord_0[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  763|  8.43k|                DEBUGVAR(1,265,"sbr_grid(): bs_rel_bord")) + 2;
  764|  8.43k|        }
  765|  17.4k|        for(rel = 0; rel < sbr->bs_num_rel_1[ch]; rel++)
  ------------------
  |  Branch (765:22): [True: 11.0k, False: 6.37k]
  ------------------
  766|  11.0k|        {
  767|  11.0k|            sbr->bs_rel_bord_1[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
  768|  11.0k|                DEBUGVAR(1,266,"sbr_grid(): bs_rel_bord")) + 2;
  769|  11.0k|        }
  770|  6.37k|        j = sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1;
  771|  6.37k|        i = sbr_log2(j + 1);
  772|  6.37k|        sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
  773|  6.37k|            DEBUGVAR(1,267,"sbr_grid(): bs_pointer"));
  774|  6.37k|        sbr->bs_pointer[ch] = min(sbr->bs_pointer[ch], j);
  ------------------
  |  |   60|  6.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.25k, False: 2.11k]
  |  |  ------------------
  ------------------
  775|       |
  776|  30.4k|        for (env = 0; env < bs_num_env; env++)
  ------------------
  |  Branch (776:23): [True: 24.0k, False: 6.37k]
  ------------------
  777|  24.0k|        {
  778|  24.0k|            sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
  779|  24.0k|                DEBUGVAR(1,268,"sbr_grid(): bs_freq_res"));
  780|  24.0k|        }
  781|       |
  782|  6.37k|        sbr->abs_bord_lead[ch] = bs_abs_bord;
  783|  6.37k|        sbr->abs_bord_trail[ch] = bs_abs_bord_1;
  784|  6.37k|        sbr->n_rel_lead[ch] = sbr->bs_num_rel_0[ch];
  785|  6.37k|        sbr->n_rel_trail[ch] = sbr->bs_num_rel_1[ch];
  786|  6.37k|        break;
  787|  30.7k|    }
  788|       |
  789|  30.7k|    if (sbr->bs_frame_class[ch] == VARVAR)
  ------------------
  |  |   49|  30.7k|#define VARVAR 3
  ------------------
  |  Branch (789:9): [True: 6.37k, False: 24.3k]
  ------------------
  790|  6.37k|        sbr->L_E[ch] = min(bs_num_env, 5);
  ------------------
  |  |   60|  6.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 3.91k, False: 2.45k]
  |  |  ------------------
  ------------------
  791|  24.3k|    else
  792|  24.3k|        sbr->L_E[ch] = min(bs_num_env, 4);
  ------------------
  |  |   60|  24.3k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 19.1k, False: 5.23k]
  |  |  ------------------
  ------------------
  793|       |
  794|  30.7k|    if (sbr->L_E[ch] <= 0)
  ------------------
  |  Branch (794:9): [True: 0, False: 30.7k]
  ------------------
  795|      0|        return 1;
  796|       |
  797|  30.7k|    if (sbr->L_E[ch] > 1)
  ------------------
  |  Branch (797:9): [True: 18.3k, False: 12.3k]
  ------------------
  798|  18.3k|        sbr->L_Q[ch] = 2;
  799|  12.3k|    else
  800|  12.3k|        sbr->L_Q[ch] = 1;
  801|       |
  802|       |    /* TODO: this code can probably be integrated into the code above! */
  803|  30.7k|    if ((result = envelope_time_border_vector(sbr, ch)) > 0)
  ------------------
  |  Branch (803:9): [True: 1.34k, False: 29.4k]
  ------------------
  804|  1.34k|    {
  805|  1.34k|        sbr->bs_frame_class[ch] = saved_frame_class;
  806|  1.34k|        sbr->L_E[ch] = saved_L_E;
  807|  1.34k|        sbr->L_Q[ch] = saved_L_Q;
  808|  1.34k|        return result;
  809|  1.34k|    }
  810|  29.4k|    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|  29.4k|    return 0;
  820|  30.7k|}
sbr_syntax.c:sbr_log2:
  649|  20.1k|{
  650|  20.1k|    uint8_t log2tab[] = { 0, 0, 1, 2, 2, 3, 3, 3, 3, 4 };
  651|  20.1k|    if (val < 10 && val >= 0)
  ------------------
  |  Branch (651:9): [True: 20.1k, False: 0]
  |  Branch (651:21): [True: 20.1k, False: 0]
  ------------------
  652|  20.1k|        return log2tab[val];
  653|      0|    else
  654|      0|        return 0;
  655|  20.1k|}
sbr_syntax.c:sbr_dtdf:
  824|  33.5k|{
  825|  33.5k|    uint8_t i;
  826|       |
  827|   112k|    for (i = 0; i < sbr->L_E[ch]; i++)
  ------------------
  |  Branch (827:17): [True: 79.3k, False: 33.5k]
  ------------------
  828|  79.3k|    {
  829|  79.3k|        sbr->bs_df_env[ch][i] = faad_get1bit(ld
  830|  79.3k|            DEBUGVAR(1,269,"sbr_dtdf(): bs_df_env"));
  831|  79.3k|    }
  832|       |
  833|  86.9k|    for (i = 0; i < sbr->L_Q[ch]; i++)
  ------------------
  |  Branch (833:17): [True: 53.4k, False: 33.5k]
  ------------------
  834|  53.4k|    {
  835|  53.4k|        sbr->bs_df_noise[ch][i] = faad_get1bit(ld
  836|  53.4k|            DEBUGVAR(1,270,"sbr_dtdf(): bs_df_noise"));
  837|  53.4k|    }
  838|  33.5k|}
sbr_syntax.c:invf_mode:
  842|  28.9k|{
  843|  28.9k|    uint8_t n;
  844|       |
  845|  82.8k|    for (n = 0; n < sbr->N_Q; n++)
  ------------------
  |  Branch (845:17): [True: 53.9k, False: 28.9k]
  ------------------
  846|  53.9k|    {
  847|  53.9k|        sbr->bs_invf_mode[ch][n] = (uint8_t)faad_getbits(ld, 2
  848|  53.9k|            DEBUGVAR(1,271,"invf_mode(): bs_invf_mode"));
  849|  53.9k|    }
  850|  28.9k|}
sbr_syntax.c:sinusoidal_coding:
  910|  12.1k|{
  911|  12.1k|    uint8_t n;
  912|       |
  913|   174k|    for (n = 0; n < sbr->N_high; n++)
  ------------------
  |  Branch (913:17): [True: 162k, False: 12.1k]
  ------------------
  914|   162k|    {
  915|   162k|        sbr->bs_add_harmonic[ch][n] = faad_get1bit(ld
  916|   162k|            DEBUGVAR(1,278,"sinusoidal_coding(): bs_add_harmonic"));
  917|   162k|    }
  918|  12.1k|}
sbr_syntax.c:sbr_extension:
  854|   818k|{
  855|   818k|#ifdef PS_DEC
  856|   818k|    uint8_t header;
  857|   818k|    uint16_t ret;
  858|   818k|#endif
  859|   818k|    (void)num_bits_left;  /* TODO: remove or actually use parameter. */
  860|       |
  861|   818k|    switch (bs_extension_id)
  862|   818k|    {
  863|      0|#ifdef PS_DEC
  864|  28.6k|    case EXTENSION_ID_PS:
  ------------------
  |  |   40|  28.6k|#define EXTENSION_ID_PS 2
  ------------------
  |  Branch (864:5): [True: 28.6k, False: 790k]
  ------------------
  865|  28.6k|        if (!sbr->ps)
  ------------------
  |  Branch (865:13): [True: 7.98k, False: 20.6k]
  ------------------
  866|  7.98k|        {
  867|  7.98k|            sbr->ps = ps_init(get_sr_index(sbr->sample_rate), sbr->numTimeSlotsRate);
  868|  7.98k|        }
  869|  28.6k|        if (sbr->psResetFlag)
  ------------------
  |  Branch (869:13): [True: 8.56k, False: 20.1k]
  ------------------
  870|  8.56k|        {
  871|  8.56k|            sbr->ps->header_read = 0;
  872|  8.56k|        }
  873|  28.6k|        ret = ps_data(sbr->ps, ld, &header);
  874|       |
  875|       |        /* enable PS if and only if: a header has been decoded */
  876|  28.6k|        if (sbr->ps_used == 0 && header == 1)
  ------------------
  |  Branch (876:13): [True: 14.5k, False: 14.1k]
  |  Branch (876:34): [True: 6.76k, False: 7.76k]
  ------------------
  877|  6.76k|        {
  878|  6.76k|            sbr->ps_used = 1;
  879|  6.76k|        }
  880|       |
  881|  28.6k|        if (header == 1)
  ------------------
  |  Branch (881:13): [True: 12.7k, False: 15.9k]
  ------------------
  882|  12.7k|        {
  883|  12.7k|            sbr->psResetFlag = 0;
  884|  12.7k|        }
  885|       |
  886|  28.6k|        return ret;
  887|      0|#endif
  888|      0|#ifdef DRM_PS
  889|   706k|    case DRM_PARAMETRIC_STEREO:
  ------------------
  |  |   40|   706k|#define DRM_PARAMETRIC_STEREO    0
  ------------------
  |  Branch (889:5): [True: 706k, False: 112k]
  ------------------
  890|       |        /* If not expected then only decode but do not expose. */
  891|   706k|        if (sbr->Is_DRM_SBR)
  ------------------
  |  Branch (891:13): [True: 1.53k, False: 704k]
  ------------------
  892|  1.53k|        {
  893|  1.53k|            sbr->ps_used = 1;
  894|  1.53k|        }
  895|   706k|        if (!sbr->drm_ps)
  ------------------
  |  Branch (895:13): [True: 4.98k, False: 701k]
  ------------------
  896|  4.98k|        {
  897|  4.98k|            sbr->drm_ps = drm_ps_init();
  898|  4.98k|        }
  899|   706k|        return drm_ps_data(sbr->drm_ps, ld);
  900|      0|#endif
  901|  84.0k|    default:
  ------------------
  |  Branch (901:5): [True: 84.0k, False: 734k]
  ------------------
  902|  84.0k|        sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
  903|  84.0k|            DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
  904|  84.0k|        return 6;
  905|   818k|    }
  906|   818k|}
sbr_syntax.c:sbr_channel_pair_element:
  491|  11.7k|{
  492|  11.7k|    uint8_t n, result;
  493|       |
  494|  11.7k|    if (faad_get1bit(ld
  ------------------
  |  Branch (494:9): [True: 4.28k, False: 7.47k]
  ------------------
  495|  11.7k|        DEBUGVAR(1,228,"sbr_single_channel_element(): bs_data_extra")))
  496|  4.28k|    {
  497|  4.28k|        faad_getbits(ld, 4
  498|  4.28k|            DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
  499|  4.28k|        faad_getbits(ld, 4
  500|  4.28k|            DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
  501|  4.28k|    }
  502|       |
  503|  11.7k|    sbr->bs_coupling = faad_get1bit(ld
  504|  11.7k|        DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_coupling"));
  505|       |
  506|  11.7k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (506:9): [True: 4.77k, False: 6.98k]
  ------------------
  507|  4.77k|    {
  508|  4.77k|        if ((result = sbr_grid(ld, sbr, 0)) > 0)
  ------------------
  |  Branch (508:13): [True: 112, False: 4.66k]
  ------------------
  509|    112|            return result;
  510|       |
  511|       |        /* need to copy some data from left to right */
  512|  4.66k|        sbr->bs_frame_class[1] = sbr->bs_frame_class[0];
  513|  4.66k|        sbr->L_E[1] = sbr->L_E[0];
  514|  4.66k|        sbr->L_Q[1] = sbr->L_Q[0];
  515|  4.66k|        sbr->bs_pointer[1] = sbr->bs_pointer[0];
  516|       |
  517|  22.3k|        for (n = 0; n <= sbr->L_E[0]; n++)
  ------------------
  |  Branch (517:21): [True: 17.6k, False: 4.66k]
  ------------------
  518|  17.6k|        {
  519|  17.6k|            sbr->t_E[1][n] = sbr->t_E[0][n];
  520|  17.6k|            sbr->f[1][n] = sbr->f[0][n];
  521|  17.6k|        }
  522|  17.0k|        for (n = 0; n <= sbr->L_Q[0]; n++)
  ------------------
  |  Branch (522:21): [True: 12.4k, False: 4.66k]
  ------------------
  523|  12.4k|            sbr->t_Q[1][n] = sbr->t_Q[0][n];
  524|       |
  525|  4.66k|        sbr_dtdf(ld, sbr, 0);
  526|  4.66k|        sbr_dtdf(ld, sbr, 1);
  527|  4.66k|        invf_mode(ld, sbr, 0);
  528|       |
  529|       |        /* more copying */
  530|  17.1k|        for (n = 0; n < sbr->N_Q; n++)
  ------------------
  |  Branch (530:21): [True: 12.4k, False: 4.66k]
  ------------------
  531|  12.4k|            sbr->bs_invf_mode[1][n] = sbr->bs_invf_mode[0][n];
  532|       |
  533|  4.66k|        sbr_envelope(ld, sbr, 0);
  534|  4.66k|        sbr_noise(ld, sbr, 0);
  535|  4.66k|        sbr_envelope(ld, sbr, 1);
  536|  4.66k|        sbr_noise(ld, sbr, 1);
  537|       |
  538|  4.66k|        memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
  539|  4.66k|        memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
  540|       |
  541|  4.66k|        sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
  542|  4.66k|            DEBUGVAR(1,231,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
  543|  4.66k|        if (sbr->bs_add_harmonic_flag[0])
  ------------------
  |  Branch (543:13): [True: 1.68k, False: 2.98k]
  ------------------
  544|  1.68k|            sinusoidal_coding(ld, sbr, 0);
  545|       |
  546|  4.66k|        sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
  547|  4.66k|            DEBUGVAR(1,232,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
  548|  4.66k|        if (sbr->bs_add_harmonic_flag[1])
  ------------------
  |  Branch (548:13): [True: 1.76k, False: 2.90k]
  ------------------
  549|  1.76k|            sinusoidal_coding(ld, sbr, 1);
  550|  6.98k|    } else {
  551|  6.98k|        uint8_t saved_t_E[6] = {0}, saved_t_Q[3] = {0};
  552|  6.98k|        uint8_t saved_L_E = sbr->L_E[0];
  553|  6.98k|        uint8_t saved_L_Q = sbr->L_Q[0];
  554|  6.98k|        uint8_t saved_frame_class = sbr->bs_frame_class[0];
  555|       |
  556|  9.93k|        for (n = 0; n < saved_L_E; n++)
  ------------------
  |  Branch (556:21): [True: 2.95k, False: 6.98k]
  ------------------
  557|  2.95k|            saved_t_E[n] = sbr->t_E[0][n];
  558|  8.67k|        for (n = 0; n < saved_L_Q; n++)
  ------------------
  |  Branch (558:21): [True: 1.69k, False: 6.98k]
  ------------------
  559|  1.69k|            saved_t_Q[n] = sbr->t_Q[0][n];
  560|       |
  561|  6.98k|        if ((result = sbr_grid(ld, sbr, 0)) > 0)
  ------------------
  |  Branch (561:13): [True: 123, False: 6.85k]
  ------------------
  562|    123|            return result;
  563|  6.85k|        if ((result = sbr_grid(ld, sbr, 1)) > 0)
  ------------------
  |  Branch (563:13): [True: 488, False: 6.37k]
  ------------------
  564|    488|        {
  565|       |            /* restore first channel data as well */
  566|    488|            sbr->bs_frame_class[0] = saved_frame_class;
  567|    488|            sbr->L_E[0] = saved_L_E;
  568|    488|            sbr->L_Q[0] = saved_L_Q;
  569|  3.41k|            for (n = 0; n < 6; n++)
  ------------------
  |  Branch (569:25): [True: 2.92k, False: 488]
  ------------------
  570|  2.92k|                sbr->t_E[0][n] = saved_t_E[n];
  571|  1.95k|            for (n = 0; n < 3; n++)
  ------------------
  |  Branch (571:25): [True: 1.46k, False: 488]
  ------------------
  572|  1.46k|                sbr->t_Q[0][n] = saved_t_Q[n];
  573|       |
  574|    488|            return result;
  575|    488|        }
  576|  6.37k|        sbr_dtdf(ld, sbr, 0);
  577|  6.37k|        sbr_dtdf(ld, sbr, 1);
  578|  6.37k|        invf_mode(ld, sbr, 0);
  579|  6.37k|        invf_mode(ld, sbr, 1);
  580|  6.37k|        sbr_envelope(ld, sbr, 0);
  581|  6.37k|        sbr_envelope(ld, sbr, 1);
  582|  6.37k|        sbr_noise(ld, sbr, 0);
  583|  6.37k|        sbr_noise(ld, sbr, 1);
  584|       |
  585|  6.37k|        memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
  586|  6.37k|        memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
  587|       |
  588|  6.37k|        sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
  589|  6.37k|            DEBUGVAR(1,239,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
  590|  6.37k|        if (sbr->bs_add_harmonic_flag[0])
  ------------------
  |  Branch (590:13): [True: 2.22k, False: 4.14k]
  ------------------
  591|  2.22k|            sinusoidal_coding(ld, sbr, 0);
  592|       |
  593|  6.37k|        sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
  594|  6.37k|            DEBUGVAR(1,240,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
  595|  6.37k|        if (sbr->bs_add_harmonic_flag[1])
  ------------------
  |  Branch (595:13): [True: 2.33k, False: 4.03k]
  ------------------
  596|  2.33k|            sinusoidal_coding(ld, sbr, 1);
  597|  6.37k|    }
  598|  11.0k|#ifndef FIXED_POINT
  599|  11.0k|    envelope_noise_dequantisation(sbr, 0);
  600|  11.0k|    envelope_noise_dequantisation(sbr, 1);
  601|       |
  602|  11.0k|    if (sbr->bs_coupling)
  ------------------
  |  Branch (602:9): [True: 4.66k, False: 6.37k]
  ------------------
  603|  4.66k|        unmap_envelope_noise(sbr);
  604|  11.0k|#endif
  605|       |
  606|  11.0k|    sbr->bs_extended_data = faad_get1bit(ld
  607|  11.0k|        DEBUGVAR(1,233,"sbr_channel_pair_element(): bs_extended_data[0]"));
  608|  11.0k|    if (sbr->bs_extended_data)
  ------------------
  |  Branch (608:9): [True: 5.13k, False: 5.90k]
  ------------------
  609|  5.13k|    {
  610|  5.13k|        uint16_t nr_bits_left;
  611|  5.13k|        uint16_t cnt = (uint16_t)faad_getbits(ld, 4
  612|  5.13k|            DEBUGVAR(1,234,"sbr_channel_pair_element(): bs_extension_size"));
  613|  5.13k|        if (cnt == 15)
  ------------------
  |  Branch (613:13): [True: 2.78k, False: 2.35k]
  ------------------
  614|  2.78k|        {
  615|  2.78k|            cnt += (uint16_t)faad_getbits(ld, 8
  616|  2.78k|                DEBUGVAR(1,235,"sbr_channel_pair_element(): bs_esc_count"));
  617|  2.78k|        }
  618|       |
  619|  5.13k|        nr_bits_left = 8 * cnt;
  620|   808k|        while (nr_bits_left > 7)
  ------------------
  |  Branch (620:16): [True: 805k, False: 3.47k]
  ------------------
  621|   805k|        {
  622|   805k|            uint16_t tmp_nr_bits = 0;
  623|       |
  624|   805k|            sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
  625|   805k|                DEBUGVAR(1,236,"sbr_channel_pair_element(): bs_extension_id"));
  626|   805k|            tmp_nr_bits += 2;
  627|   805k|            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|   805k|            if (tmp_nr_bits > nr_bits_left)
  ------------------
  |  Branch (630:17): [True: 1.65k, False: 803k]
  ------------------
  631|  1.65k|                return 1;
  632|       |
  633|   803k|            nr_bits_left -= tmp_nr_bits;
  634|   803k|        }
  635|       |
  636|       |        /* Corrigendum */
  637|  3.47k|        if (nr_bits_left > 0)
  ------------------
  |  Branch (637:13): [True: 2.71k, False: 756]
  ------------------
  638|  2.71k|        {
  639|  2.71k|            faad_getbits(ld, nr_bits_left
  640|  2.71k|                DEBUGVAR(1,280,"sbr_channel_pair_element(): nr_bits_left"));
  641|  2.71k|        }
  642|  3.47k|    }
  643|       |
  644|  9.37k|    return 0;
  645|  11.0k|}

envelope_time_border_vector:
   55|  30.7k|{
   56|  30.7k|    uint8_t l, border, temp, trail;
   57|  30.7k|    uint8_t t_E_temp[6] = {0};
   58|       |
   59|  30.7k|    trail = sbr->abs_bord_trail[ch];
   60|  30.7k|    t_E_temp[0] = sbr->rate * sbr->abs_bord_lead[ch];
   61|  30.7k|    t_E_temp[sbr->L_E[ch]] = sbr->rate * trail;
   62|       |
   63|  30.7k|    switch (sbr->bs_frame_class[ch])
  ------------------
  |  Branch (63:13): [True: 30.7k, False: 0]
  ------------------
   64|  30.7k|    {
   65|  10.5k|    case FIXFIX:
  ------------------
  |  |   46|  10.5k|#define FIXFIX 0
  ------------------
  |  Branch (65:5): [True: 10.5k, False: 20.1k]
  ------------------
   66|  10.5k|        switch (sbr->L_E[ch])
   67|  10.5k|        {
   68|  2.20k|        case 4:
  ------------------
  |  Branch (68:9): [True: 2.20k, False: 8.36k]
  ------------------
   69|  2.20k|            temp = (sbr->numTimeSlots / 4);
   70|  2.20k|            t_E_temp[3] = sbr->rate * 3 * temp;
   71|  2.20k|            t_E_temp[2] = sbr->rate * 2 * temp;
   72|  2.20k|            t_E_temp[1] = sbr->rate * temp;
   73|  2.20k|            break;
   74|  1.79k|        case 2:
  ------------------
  |  Branch (74:9): [True: 1.79k, False: 8.76k]
  ------------------
   75|  1.79k|            t_E_temp[1] = sbr->rate * (sbr->numTimeSlots / 2);
   76|  1.79k|            break;
   77|  6.56k|        default:
  ------------------
  |  Branch (77:9): [True: 6.56k, False: 3.99k]
  ------------------
   78|  6.56k|            break;
   79|  10.5k|        }
   80|  10.5k|        break;
   81|       |
   82|  10.5k|    case FIXVAR:
  ------------------
  |  |   47|  6.74k|#define FIXVAR 1
  ------------------
  |  Branch (82:5): [True: 6.74k, False: 24.0k]
  ------------------
   83|  6.74k|        if (sbr->L_E[ch] > 1)
  ------------------
  |  Branch (83:13): [True: 3.30k, False: 3.44k]
  ------------------
   84|  3.30k|        {
   85|  3.30k|            int8_t i = sbr->L_E[ch];
   86|  3.30k|            border = sbr->abs_bord_trail[ch];
   87|       |
   88|  9.71k|            for (l = 0; l < (sbr->L_E[ch] - 1); l++)
  ------------------
  |  Branch (88:25): [True: 6.80k, False: 2.91k]
  ------------------
   89|  6.80k|            {
   90|  6.80k|                if (border < sbr->bs_rel_bord[ch][l])
  ------------------
  |  Branch (90:21): [True: 391, False: 6.41k]
  ------------------
   91|    391|                    return 1;
   92|       |
   93|  6.41k|                border -= sbr->bs_rel_bord[ch][l];
   94|  6.41k|                t_E_temp[--i] = sbr->rate * border;
   95|  6.41k|            }
   96|  3.30k|        }
   97|  6.35k|        break;
   98|       |
   99|  7.07k|    case VARFIX:
  ------------------
  |  |   48|  7.07k|#define VARFIX 2
  ------------------
  |  Branch (99:5): [True: 7.07k, False: 23.6k]
  ------------------
  100|  7.07k|        if (sbr->L_E[ch] > 1)
  ------------------
  |  Branch (100:13): [True: 5.33k, False: 1.73k]
  ------------------
  101|  5.33k|        {
  102|  5.33k|            int8_t i = 1;
  103|  5.33k|            border = sbr->abs_bord_lead[ch];
  104|       |
  105|  14.5k|            for (l = 0; l < (sbr->L_E[ch] - 1); l++)
  ------------------
  |  Branch (105:25): [True: 9.57k, False: 4.98k]
  ------------------
  106|  9.57k|            {
  107|  9.57k|                border += sbr->bs_rel_bord[ch][l];
  108|       |
  109|  9.57k|                if (border > trail)
  ------------------
  |  Branch (109:21): [True: 353, False: 9.22k]
  ------------------
  110|    353|                    return 1;
  111|       |
  112|  9.22k|                t_E_temp[i++] = sbr->rate * border;
  113|  9.22k|            }
  114|  5.33k|        }
  115|  6.72k|        break;
  116|       |
  117|  6.72k|    case VARVAR:
  ------------------
  |  |   49|  6.37k|#define VARVAR 3
  ------------------
  |  Branch (117:5): [True: 6.37k, False: 24.3k]
  ------------------
  118|  6.37k|        if (sbr->bs_num_rel_0[ch])
  ------------------
  |  Branch (118:13): [True: 3.68k, False: 2.68k]
  ------------------
  119|  3.68k|        {
  120|  3.68k|            int8_t i = 1;
  121|  3.68k|            border = sbr->abs_bord_lead[ch];
  122|       |
  123|  11.7k|            for (l = 0; l < sbr->bs_num_rel_0[ch]; l++)
  ------------------
  |  Branch (123:25): [True: 8.39k, False: 3.34k]
  ------------------
  124|  8.39k|            {
  125|  8.39k|                border += sbr->bs_rel_bord_0[ch][l];
  126|       |
  127|  8.39k|                if (border > trail)
  ------------------
  |  Branch (127:21): [True: 343, False: 8.04k]
  ------------------
  128|    343|                    return 1;
  129|       |
  130|  8.04k|                t_E_temp[i++] = sbr->rate * border;
  131|  8.04k|            }
  132|  3.68k|        }
  133|       |
  134|  6.02k|        if (sbr->bs_num_rel_1[ch])
  ------------------
  |  Branch (134:13): [True: 4.49k, False: 1.53k]
  ------------------
  135|  4.49k|        {
  136|  4.49k|            int8_t i = sbr->L_E[ch];
  137|  4.49k|            border = sbr->abs_bord_trail[ch];
  138|       |
  139|  14.6k|            for (l = 0; l < sbr->bs_num_rel_1[ch]; l++)
  ------------------
  |  Branch (139:25): [True: 10.4k, False: 4.23k]
  ------------------
  140|  10.4k|            {
  141|  10.4k|                if (border < sbr->bs_rel_bord_1[ch][l])
  ------------------
  |  Branch (141:21): [True: 261, False: 10.1k]
  ------------------
  142|    261|                    return 1;
  143|       |
  144|  10.1k|                border -= sbr->bs_rel_bord_1[ch][l];
  145|  10.1k|                t_E_temp[--i] = sbr->rate * border;
  146|  10.1k|            }
  147|  4.49k|        }
  148|  5.76k|        break;
  149|  30.7k|    }
  150|       |
  151|       |    /* no error occured, we can safely use this t_E vector */
  152|   205k|    for (l = 0; l < 6; l++)
  ------------------
  |  Branch (152:17): [True: 176k, False: 29.4k]
  ------------------
  153|   176k|    {
  154|   176k|        sbr->t_E[ch][l] = t_E_temp[l];
  155|   176k|    }
  156|       |
  157|  29.4k|    return 0;
  158|  30.7k|}
noise_floor_time_border_vector:
  161|  29.4k|{
  162|  29.4k|    sbr->t_Q[ch][0] = sbr->t_E[ch][0];
  163|       |
  164|  29.4k|    if (sbr->L_E[ch] == 1)
  ------------------
  |  Branch (164:9): [True: 12.3k, False: 17.0k]
  ------------------
  165|  12.3k|    {
  166|  12.3k|        sbr->t_Q[ch][1] = sbr->t_E[ch][1];
  167|  12.3k|        sbr->t_Q[ch][2] = 0;
  168|  17.0k|    } else {
  169|  17.0k|        uint8_t index = middleBorder(sbr, ch);
  170|  17.0k|        sbr->t_Q[ch][1] = sbr->t_E[ch][index];
  171|  17.0k|        sbr->t_Q[ch][2] = sbr->t_E[ch][sbr->L_E[ch]];
  172|  17.0k|    }
  173|  29.4k|}
sbr_tf_grid.c:middleBorder:
  233|  17.0k|{
  234|  17.0k|    int8_t retval = 0;
  235|       |
  236|  17.0k|    switch (sbr->bs_frame_class[ch])
  ------------------
  |  Branch (236:13): [True: 17.0k, False: 0]
  ------------------
  237|  17.0k|    {
  238|  3.99k|    case FIXFIX:
  ------------------
  |  |   46|  3.99k|#define FIXFIX 0
  ------------------
  |  Branch (238:5): [True: 3.99k, False: 13.0k]
  ------------------
  239|  3.99k|        retval = sbr->L_E[ch]/2;
  240|  3.99k|        break;
  241|  4.98k|    case VARFIX:
  ------------------
  |  |   48|  4.98k|#define VARFIX 2
  ------------------
  |  Branch (241:5): [True: 4.98k, False: 12.0k]
  ------------------
  242|  4.98k|        if (sbr->bs_pointer[ch] == 0)
  ------------------
  |  Branch (242:13): [True: 2.33k, False: 2.64k]
  ------------------
  243|  2.33k|            retval = 1;
  244|  2.64k|        else if (sbr->bs_pointer[ch] == 1)
  ------------------
  |  Branch (244:18): [True: 1.03k, False: 1.60k]
  ------------------
  245|  1.03k|            retval = sbr->L_E[ch] - 1;
  246|  1.60k|        else
  247|  1.60k|            retval = sbr->bs_pointer[ch] - 1;
  248|  4.98k|        break;
  249|  2.91k|    case FIXVAR:
  ------------------
  |  |   47|  2.91k|#define FIXVAR 1
  ------------------
  |  Branch (249:5): [True: 2.91k, False: 14.1k]
  ------------------
  250|  8.03k|    case VARVAR:
  ------------------
  |  |   49|  8.03k|#define VARVAR 3
  ------------------
  |  Branch (250:5): [True: 5.12k, False: 11.8k]
  ------------------
  251|  8.03k|        if (sbr->bs_pointer[ch] > 1)
  ------------------
  |  Branch (251:13): [True: 2.98k, False: 5.04k]
  ------------------
  252|  2.98k|            retval = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
  253|  5.04k|        else
  254|  5.04k|            retval = sbr->L_E[ch] - 1;
  255|  8.03k|        break;
  256|  17.0k|    }
  257|       |
  258|  17.0k|    return (retval > 0) ? retval : 0;
  ------------------
  |  Branch (258:12): [True: 16.8k, False: 213]
  ------------------
  259|  17.0k|}

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

GASpecificConfig:
  111|  2.30k|{
  112|  2.30k|    program_config pce;
  113|       |
  114|       |    /* 1024 or 960 */
  115|  2.30k|    mp4ASC->frameLengthFlag = faad_get1bit(ld
  116|  2.30k|        DEBUGVAR(1,138,"GASpecificConfig(): FrameLengthFlag"));
  117|       |#ifndef ALLOW_SMALL_FRAMELENGTH
  118|       |    if (mp4ASC->frameLengthFlag == 1)
  119|       |        return -3;
  120|       |#endif
  121|       |
  122|  2.30k|    mp4ASC->dependsOnCoreCoder = faad_get1bit(ld
  123|  2.30k|        DEBUGVAR(1,139,"GASpecificConfig(): DependsOnCoreCoder"));
  124|  2.30k|    if (mp4ASC->dependsOnCoreCoder == 1)
  ------------------
  |  Branch (124:9): [True: 583, False: 1.72k]
  ------------------
  125|    583|    {
  126|    583|        mp4ASC->coreCoderDelay = (uint16_t)faad_getbits(ld, 14
  127|    583|            DEBUGVAR(1,140,"GASpecificConfig(): CoreCoderDelay"));
  128|    583|    }
  129|       |
  130|  2.30k|    mp4ASC->extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): ExtensionFlag"));
  131|  2.30k|    if (mp4ASC->channelsConfiguration == 0)
  ------------------
  |  Branch (131:9): [True: 378, False: 1.92k]
  ------------------
  132|    378|    {
  133|    378|        if (program_config_element(&pce, ld))
  ------------------
  |  Branch (133:13): [True: 2, False: 376]
  ------------------
  134|      2|            return -3;
  135|       |        //mp4ASC->channelsConfiguration = pce.channels;
  136|       |
  137|    376|        if (pce_out != NULL)
  ------------------
  |  Branch (137:13): [True: 376, False: 0]
  ------------------
  138|    376|            memcpy(pce_out, &pce, sizeof(program_config));
  139|       |
  140|       |        /*
  141|       |        if (pce.num_valid_cc_elements)
  142|       |            return -3;
  143|       |        */
  144|    376|    }
  145|       |
  146|  2.30k|#ifdef ERROR_RESILIENCE
  147|  2.30k|    if (mp4ASC->extensionFlag == 1)
  ------------------
  |  Branch (147:9): [True: 1.58k, False: 719]
  ------------------
  148|  1.58k|    {
  149|       |        /* Error resilience not supported yet */
  150|  1.58k|        if (mp4ASC->objectTypeIndex >= ER_OBJECT_START)
  ------------------
  |  |   71|  1.58k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (150:13): [True: 1.36k, False: 216]
  ------------------
  151|  1.36k|        {
  152|  1.36k|            mp4ASC->aacSectionDataResilienceFlag = faad_get1bit(ld
  153|  1.36k|                DEBUGVAR(1,144,"GASpecificConfig(): aacSectionDataResilienceFlag"));
  154|  1.36k|            mp4ASC->aacScalefactorDataResilienceFlag = faad_get1bit(ld
  155|  1.36k|                DEBUGVAR(1,145,"GASpecificConfig(): aacScalefactorDataResilienceFlag"));
  156|  1.36k|            mp4ASC->aacSpectralDataResilienceFlag = faad_get1bit(ld
  157|  1.36k|                DEBUGVAR(1,146,"GASpecificConfig(): aacSpectralDataResilienceFlag"));
  158|  1.36k|        }
  159|       |        /* 1 bit: extensionFlag3 */
  160|  1.58k|        faad_getbits(ld, 1);
  161|  1.58k|	}
  162|  2.30k|#endif
  163|       |
  164|  2.30k|    return 0;
  165|  2.30k|}
raw_data_block:
  451|  8.05k|{
  452|  8.05k|    uint8_t id_syn_ele;
  453|  8.05k|    uint8_t ele_this_frame = 0;
  454|       |
  455|  8.05k|    hDecoder->fr_channels = 0;
  456|  8.05k|    hDecoder->fr_ch_ele = 0;
  457|  8.05k|    hDecoder->first_syn_ele = 25;
  458|  8.05k|    hDecoder->has_lfe = 0;
  459|       |
  460|  8.05k|#ifdef ERROR_RESILIENCE
  461|  8.05k|    if (hDecoder->object_type < ER_OBJECT_START)
  ------------------
  |  |   71|  8.05k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (461:9): [True: 5.19k, False: 2.85k]
  ------------------
  462|  5.19k|    {
  463|  5.19k|#endif
  464|       |        /* Table 4.4.3: raw_data_block() */
  465|   531k|        while ((id_syn_ele = (uint8_t)faad_getbits(ld, LEN_SE_ID
  ------------------
  |  |   75|   531k|#define LEN_SE_ID 3
  ------------------
  |  Branch (465:16): [True: 531k, False: 582]
  ------------------
  466|   531k|            DEBUGVAR(1,4,"NeAACDecDecode(): id_syn_ele"))) != ID_END)
  ------------------
  |  |   93|   531k|#define ID_END 0x7
  ------------------
  467|   531k|        {
  468|   531k|            switch (id_syn_ele) {
  ------------------
  |  Branch (468:21): [True: 531k, False: 0]
  ------------------
  469|   105k|            case ID_SCE:
  ------------------
  |  |   86|   105k|#define ID_SCE 0x0
  ------------------
  |  Branch (469:13): [True: 105k, False: 425k]
  ------------------
  470|   105k|                ele_this_frame++;
  471|   105k|                if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
  ------------------
  |  Branch (471:21): [True: 3.15k, False: 102k]
  ------------------
  472|   105k|                decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
  473|   105k|                if (hInfo->error > 0)
  ------------------
  |  Branch (473:21): [True: 3.67k, False: 101k]
  ------------------
  474|  3.67k|                    return;
  475|   101k|                break;
  476|   101k|            case ID_CPE:
  ------------------
  |  |   87|  17.0k|#define ID_CPE 0x1
  ------------------
  |  Branch (476:13): [True: 17.0k, False: 513k]
  ------------------
  477|  17.0k|                ele_this_frame++;
  478|  17.0k|                if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
  ------------------
  |  Branch (478:21): [True: 1.94k, False: 15.1k]
  ------------------
  479|  17.0k|                decode_cpe(hDecoder, hInfo, ld, id_syn_ele);
  480|  17.0k|                if (hInfo->error > 0)
  ------------------
  |  Branch (480:21): [True: 552, False: 16.4k]
  ------------------
  481|    552|                    return;
  482|  16.4k|                break;
  483|  16.4k|            case ID_LFE:
  ------------------
  |  |   89|     74|#define ID_LFE 0x3
  ------------------
  |  Branch (483:13): [True: 74, False: 530k]
  ------------------
  484|     74|#ifdef DRM
  485|     74|                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|     74|                if (hInfo->error > 0)
  ------------------
  |  Branch (491:21): [True: 74, False: 0]
  ------------------
  492|     74|                    return;
  493|      0|                break;
  494|    135|            case ID_CCE: /* not implemented yet, but skip the bits */
  ------------------
  |  |   88|    135|#define ID_CCE 0x2
  ------------------
  |  Branch (494:13): [True: 135, False: 530k]
  ------------------
  495|    135|#ifdef DRM
  496|    135|                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|    135|                if (hInfo->error > 0)
  ------------------
  |  Branch (505:21): [True: 135, False: 0]
  ------------------
  506|    135|                    return;
  507|      0|                break;
  508|   406k|            case ID_DSE:
  ------------------
  |  |   90|   406k|#define ID_DSE 0x4
  ------------------
  |  Branch (508:13): [True: 406k, False: 124k]
  ------------------
  509|   406k|                ele_this_frame++;
  510|   406k|                data_stream_element(hDecoder, ld);
  511|   406k|                break;
  512|    307|            case ID_PCE:
  ------------------
  |  |   91|    307|#define ID_PCE 0x5
  ------------------
  |  Branch (512:13): [True: 307, False: 530k]
  ------------------
  513|    307|                if (ele_this_frame != 0)
  ------------------
  |  Branch (513:21): [True: 79, False: 228]
  ------------------
  514|     79|                {
  515|     79|                    hInfo->error = 31;
  516|     79|                    return;
  517|     79|                }
  518|    228|                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|    228|                program_config_element(pce, ld);
  522|       |                //if ((hInfo->error = program_config_element(pce, ld)) > 0)
  523|       |                //    return;
  524|       |                //hDecoder->pce_set = 1;
  525|    228|                break;
  526|  1.76k|            case ID_FIL:
  ------------------
  |  |   92|  1.76k|#define ID_FIL 0x6
  ------------------
  |  Branch (526:13): [True: 1.76k, False: 529k]
  ------------------
  527|  1.76k|                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.76k|                if ((hInfo->error = fill_element(hDecoder, ld, drc
  ------------------
  |  Branch (531:21): [True: 102, False: 1.66k]
  ------------------
  532|  1.76k|#ifdef SBR_DEC
  533|  1.76k|                    , INVALID_SBR_ELEMENT
  ------------------
  |  |  110|  1.76k|#define INVALID_SBR_ELEMENT 255
  ------------------
  534|  1.76k|#endif
  535|  1.76k|                    )) > 0)
  536|    102|                    return;
  537|  1.66k|                break;
  538|   531k|            }
  539|   526k|            if (ld->error != 0)
  ------------------
  |  Branch (539:17): [True: 0, False: 526k]
  ------------------
  540|      0|            {
  541|      0|                hInfo->error = 32;
  542|      0|                return;
  543|      0|            }
  544|   526k|        }
  545|  5.19k|#ifdef ERROR_RESILIENCE
  546|  5.19k|    } else {
  547|       |        /* Table 262: er_raw_data_block() */
  548|  2.85k|        switch (hDecoder->channelConfiguration)
  549|  2.85k|        {
  550|      0|        case 1:
  ------------------
  |  Branch (550:9): [True: 0, False: 2.85k]
  ------------------
  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|  1.13k|        case 2:
  ------------------
  |  Branch (555:9): [True: 1.13k, False: 1.71k]
  ------------------
  556|  1.13k|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|  1.13k|#define ID_CPE 0x1
  ------------------
  557|  1.13k|            if (hInfo->error > 0)
  ------------------
  |  Branch (557:17): [True: 219, False: 919]
  ------------------
  558|    219|                return;
  559|    919|            break;
  560|    919|        case 3:
  ------------------
  |  Branch (560:9): [True: 151, False: 2.70k]
  ------------------
  561|    151|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    151|#define ID_SCE 0x0
  ------------------
  562|    151|            if (hInfo->error > 0)
  ------------------
  |  Branch (562:17): [True: 20, False: 131]
  ------------------
  563|     20|                return;
  564|    131|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    131|#define ID_CPE 0x1
  ------------------
  565|    131|            if (hInfo->error > 0)
  ------------------
  |  Branch (565:17): [True: 10, False: 121]
  ------------------
  566|     10|                return;
  567|    121|            break;
  568|    491|        case 4:
  ------------------
  |  Branch (568:9): [True: 491, False: 2.36k]
  ------------------
  569|    491|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    491|#define ID_SCE 0x0
  ------------------
  570|    491|            if (hInfo->error > 0)
  ------------------
  |  Branch (570:17): [True: 65, False: 426]
  ------------------
  571|     65|                return;
  572|    426|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    426|#define ID_CPE 0x1
  ------------------
  573|    426|            if (hInfo->error > 0)
  ------------------
  |  Branch (573:17): [True: 21, False: 405]
  ------------------
  574|     21|                return;
  575|    405|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    405|#define ID_SCE 0x0
  ------------------
  576|    405|            if (hInfo->error > 0)
  ------------------
  |  Branch (576:17): [True: 3, False: 402]
  ------------------
  577|      3|                return;
  578|    402|            break;
  579|    564|        case 5:
  ------------------
  |  Branch (579:9): [True: 564, False: 2.29k]
  ------------------
  580|    564|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    564|#define ID_SCE 0x0
  ------------------
  581|    564|            if (hInfo->error > 0)
  ------------------
  |  Branch (581:17): [True: 105, False: 459]
  ------------------
  582|    105|                return;
  583|    459|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    459|#define ID_CPE 0x1
  ------------------
  584|    459|            if (hInfo->error > 0)
  ------------------
  |  Branch (584:17): [True: 15, False: 444]
  ------------------
  585|     15|                return;
  586|    444|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    444|#define ID_CPE 0x1
  ------------------
  587|    444|            if (hInfo->error > 0)
  ------------------
  |  Branch (587:17): [True: 7, False: 437]
  ------------------
  588|      7|                return;
  589|    437|            break;
  590|    437|        case 6:
  ------------------
  |  Branch (590:9): [True: 127, False: 2.72k]
  ------------------
  591|    127|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    127|#define ID_SCE 0x0
  ------------------
  592|    127|            if (hInfo->error > 0)
  ------------------
  |  Branch (592:17): [True: 27, False: 100]
  ------------------
  593|     27|                return;
  594|    100|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    100|#define ID_CPE 0x1
  ------------------
  595|    100|            if (hInfo->error > 0)
  ------------------
  |  Branch (595:17): [True: 4, False: 96]
  ------------------
  596|      4|                return;
  597|     96|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|     96|#define ID_CPE 0x1
  ------------------
  598|     96|            if (hInfo->error > 0)
  ------------------
  |  Branch (598:17): [True: 5, False: 91]
  ------------------
  599|      5|                return;
  600|     91|            decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
  ------------------
  |  |   89|     91|#define ID_LFE 0x3
  ------------------
  601|     91|            if (hInfo->error > 0)
  ------------------
  |  Branch (601:17): [True: 15, False: 76]
  ------------------
  602|     15|                return;
  603|     76|            break;
  604|    379|        case 7: /* 8 channels */
  ------------------
  |  Branch (604:9): [True: 379, False: 2.47k]
  ------------------
  605|    379|            decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
  ------------------
  |  |   86|    379|#define ID_SCE 0x0
  ------------------
  606|    379|            if (hInfo->error > 0)
  ------------------
  |  Branch (606:17): [True: 26, False: 353]
  ------------------
  607|     26|                return;
  608|    353|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    353|#define ID_CPE 0x1
  ------------------
  609|    353|            if (hInfo->error > 0)
  ------------------
  |  Branch (609:17): [True: 16, False: 337]
  ------------------
  610|     16|                return;
  611|    337|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    337|#define ID_CPE 0x1
  ------------------
  612|    337|            if (hInfo->error > 0)
  ------------------
  |  Branch (612:17): [True: 8, False: 329]
  ------------------
  613|      8|                return;
  614|    329|            decode_cpe(hDecoder, hInfo, ld, ID_CPE);
  ------------------
  |  |   87|    329|#define ID_CPE 0x1
  ------------------
  615|    329|            if (hInfo->error > 0)
  ------------------
  |  Branch (615:17): [True: 34, False: 295]
  ------------------
  616|     34|                return;
  617|    295|            decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
  ------------------
  |  |   89|    295|#define ID_LFE 0x3
  ------------------
  618|    295|            if (hInfo->error > 0)
  ------------------
  |  Branch (618:17): [True: 20, False: 275]
  ------------------
  619|     20|                return;
  620|    275|            break;
  621|    275|        default:
  ------------------
  |  Branch (621:9): [True: 5, False: 2.85k]
  ------------------
  622|      5|            hInfo->error = 7;
  623|      5|            return;
  624|  2.85k|        }
  625|       |#if 0
  626|       |        cnt = bits_to_decode() / 8;
  627|       |        while (cnt >= 1)
  628|       |        {
  629|       |            cnt -= extension_payload(cnt);
  630|       |        }
  631|       |#endif
  632|  2.85k|    }
  633|  2.81k|#endif
  634|       |
  635|       |    /* new in corrigendum 14496-3:2002 */
  636|  2.81k|#ifdef DRM
  637|  2.81k|    if (hDecoder->object_type != DRM_ER_LC
  ------------------
  |  |   48|  2.81k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (637:9): [True: 2.81k, False: 0]
  ------------------
  638|       |#if 0
  639|       |        && !hDecoder->latm_header_present
  640|       |#endif
  641|  2.81k|        )
  642|  2.81k|#endif
  643|  2.81k|    {
  644|  2.81k|        faad_byte_align(ld);
  645|  2.81k|    }
  646|       |
  647|  2.81k|    return;
  648|  8.05k|}
DRM_aac_scalable_main_element:
 1299|    827|{
 1300|    827|    uint8_t channels = hDecoder->fr_channels = 0;
 1301|    827|    uint8_t this_layer_stereo = (hDecoder->channelConfiguration > 1) ? 1 : 0;
  ------------------
  |  Branch (1301:33): [True: 247, False: 580]
  ------------------
 1302|    827|    element cpe = {0};
 1303|    827|    ic_stream *ics1 = &(cpe.ics1);
 1304|    827|    ic_stream *ics2 = &(cpe.ics2);
 1305|    827|    ALIGN int16_t spec_data1[1024] = {0};
 1306|    827|    ALIGN int16_t spec_data2[1024] = {0};
 1307|       |
 1308|    827|    (void)drc;  /* TODO: remove unused parameter? */
 1309|    827|    (void)pce;  /* TODO: remove unused parameter? */
 1310|       |
 1311|    827|    hDecoder->fr_ch_ele = 0;
 1312|       |
 1313|    827|    hInfo->error = DRM_aac_scalable_main_header(hDecoder, ics1, ics2, ld, this_layer_stereo);
 1314|    827|    if (hInfo->error > 0)
  ------------------
  |  Branch (1314:9): [True: 19, False: 808]
  ------------------
 1315|     19|        return;
 1316|       |
 1317|    808|    cpe.common_window = 1;
 1318|    808|    if (this_layer_stereo)
  ------------------
  |  Branch (1318:9): [True: 236, False: 572]
  ------------------
 1319|    236|    {
 1320|    236|        hDecoder->element_id[0] = ID_CPE;
  ------------------
  |  |   87|    236|#define ID_CPE 0x1
  ------------------
 1321|    236|        if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
  ------------------
  |  Branch (1321:13): [True: 179, False: 57]
  ------------------
 1322|    179|            hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
 1323|    572|    } else {
 1324|    572|        hDecoder->element_id[0] = ID_SCE;
  ------------------
  |  |   86|    572|#define ID_SCE 0x0
  ------------------
 1325|    572|    }
 1326|       |
 1327|    808|    if (this_layer_stereo)
  ------------------
  |  Branch (1327:9): [True: 236, False: 572]
  ------------------
 1328|    236|    {
 1329|    236|        cpe.channel        = 0;
 1330|    236|        cpe.paired_channel = 1;
 1331|    236|    }
 1332|       |
 1333|       |
 1334|       |    /* Stereo2 / Mono1 */
 1335|    808|    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|    808|    if(faad_get1bit(ld)) {
  ------------------
  |  Branch (1340:8): [True: 7, False: 801]
  ------------------
 1341|      7|         hInfo->error = 26;
 1342|      7|         return;
 1343|      7|    }
 1344|       |#else
 1345|       |    faad_get1bit(ld);
 1346|       |#endif
 1347|       |
 1348|    801|    hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1);
 1349|    801|    if (hInfo->error > 0)
  ------------------
  |  Branch (1349:9): [True: 78, False: 723]
  ------------------
 1350|     78|        return;
 1351|    723|    if (this_layer_stereo)
  ------------------
  |  Branch (1351:9): [True: 190, False: 533]
  ------------------
 1352|    190|    {
 1353|       |        /* Stereo3 */
 1354|    190|        ics2->tns_data_present = faad_get1bit(ld);
 1355|       |#ifdef LTP_DEC
 1356|       |        ics1->ltp.data_present =
 1357|       |#endif
 1358|    190|            faad_get1bit(ld);
 1359|    190|        hInfo->error = side_info(hDecoder, &cpe, ld, ics2, 1);
 1360|    190|        if (hInfo->error > 0)
  ------------------
  |  Branch (1360:13): [True: 28, False: 162]
  ------------------
 1361|     28|            return;
 1362|    190|    }
 1363|       |    /* Stereo4 / Mono2 */
 1364|    695|    if (ics1->tns_data_present)
  ------------------
  |  Branch (1364:9): [True: 130, False: 565]
  ------------------
 1365|    130|        tns_data(ics1, &(ics1->tns), ld);
 1366|    695|    if (this_layer_stereo)
  ------------------
  |  Branch (1366:9): [True: 162, False: 533]
  ------------------
 1367|    162|    {
 1368|       |        /* Stereo5 */
 1369|    162|        if (ics2->tns_data_present)
  ------------------
  |  Branch (1369:13): [True: 64, False: 98]
  ------------------
 1370|     64|            tns_data(ics2, &(ics2->tns), ld);
 1371|    162|    }
 1372|       |
 1373|    695|#ifdef DRM
 1374|       |    /* CRC check */
 1375|    695|    if (hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|    695|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (1375:9): [True: 695, False: 0]
  ------------------
 1376|    695|    {
 1377|    695|        if ((hInfo->error = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0)
  ------------------
  |  Branch (1377:13): [True: 179, False: 516]
  ------------------
 1378|    179|            return;
 1379|    695|    }
 1380|    516|#endif
 1381|       |
 1382|       |    /* Stereo6 / Mono3 */
 1383|       |    /* error resilient spectral data decoding */
 1384|    516|    if ((hInfo->error = reordered_spectral_data(hDecoder, ics1, ld, spec_data1)) > 0)
  ------------------
  |  Branch (1384:9): [True: 23, False: 493]
  ------------------
 1385|     23|    {
 1386|     23|        return;
 1387|     23|    }
 1388|    493|    if (this_layer_stereo)
  ------------------
  |  Branch (1388:9): [True: 49, False: 444]
  ------------------
 1389|     49|    {
 1390|       |        /* Stereo7 */
 1391|       |        /* error resilient spectral data decoding */
 1392|     49|        if ((hInfo->error = reordered_spectral_data(hDecoder, ics2, ld, spec_data2)) > 0)
  ------------------
  |  Branch (1392:13): [True: 3, False: 46]
  ------------------
 1393|      3|        {
 1394|      3|            return;
 1395|      3|        }
 1396|     49|    }
 1397|       |
 1398|       |
 1399|    490|#ifdef DRM
 1400|    490|#ifdef SBR_DEC
 1401|       |    /* In case of DRM we need to read the SBR info before channel reconstruction */
 1402|    490|    if ((hDecoder->sbr_present_flag == 1) && (hDecoder->object_type == DRM_ER_LC))
  ------------------
  |  |   48|    462|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (1402:9): [True: 462, False: 28]
  |  Branch (1402:46): [True: 462, False: 0]
  ------------------
 1403|    462|    {
 1404|    462|        bitfile ld_sbr = {0};
 1405|    462|        uint32_t i;
 1406|    462|        uint16_t count = 0;
 1407|    462|        uint8_t *revbuffer;
 1408|    462|        uint8_t *prevbufstart;
 1409|    462|        uint8_t *pbufend;
 1410|       |
 1411|       |        /* all forward bitreading should be finished at this point */
 1412|    462|        uint32_t bitsconsumed = faad_get_processed_bits(ld);
 1413|    462|        uint32_t buffer_size = faad_origbitbuffer_size(ld);
 1414|    462|        uint8_t *buffer = (uint8_t*)faad_origbitbuffer(ld);
 1415|       |
 1416|    462|        if (bitsconsumed + 8 > buffer_size*8)
  ------------------
  |  Branch (1416:13): [True: 129, False: 333]
  ------------------
 1417|    129|        {
 1418|    129|            hInfo->error = 14;
 1419|    129|            return;
 1420|    129|        }
 1421|       |
 1422|    333|        if (!hDecoder->sbr[0])
  ------------------
  |  Branch (1422:13): [True: 240, False: 93]
  ------------------
 1423|    240|        {
 1424|    240|            hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
 1425|    240|                2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
 1426|    240|        }
 1427|    333|        if (!hDecoder->sbr[0])
  ------------------
  |  Branch (1427:13): [True: 0, False: 333]
  ------------------
 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|    333|        revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));
 1435|    333|        prevbufstart = revbuffer;
 1436|    333|        pbufend = &buffer[buffer_size - 1];
 1437|  5.63M|        for (i = 0; i < buffer_size; i++)
  ------------------
  |  Branch (1437:21): [True: 5.63M, False: 333]
  ------------------
 1438|  5.63M|            *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|    333|        count = (uint16_t)bit2byte(buffer_size*8 - bitsconsumed);
  ------------------
  |  |   46|    333|#define bit2byte(a) ((a+7)>>BYTE_NUMBIT_LD)
  |  |  ------------------
  |  |  |  |   44|    333|#define BYTE_NUMBIT_LD  3
  |  |  ------------------
  ------------------
 1444|    333|        faad_initbits(&ld_sbr, revbuffer, count);
 1445|       |
 1446|    333|        hDecoder->sbr[0]->sample_rate = get_sample_rate(hDecoder->sf_index);
 1447|    333|        hDecoder->sbr[0]->sample_rate *= 2;
 1448|       |
 1449|    333|        faad_getbits(&ld_sbr, 8); /* Skip 8-bit CRC */
 1450|       |
 1451|    333|        hDecoder->sbr[0]->ret = sbr_extension_data(&ld_sbr, hDecoder->sbr[0], count, hDecoder->postSeekResetFlag);
 1452|    333|#if (defined(PS_DEC) || defined(DRM_PS))
 1453|    333|        if (hDecoder->sbr[0]->ps_used)
  ------------------
  |  Branch (1453:13): [True: 220, False: 113]
  ------------------
 1454|    220|        {
 1455|    220|            hDecoder->ps_used[0] = 1;
 1456|    220|            hDecoder->ps_used_global = 1;
 1457|    220|        }
 1458|    333|#endif
 1459|       |
 1460|    333|        if (ld_sbr.error)
  ------------------
  |  Branch (1460:13): [True: 4, False: 329]
  ------------------
 1461|      4|        {
 1462|      4|            hDecoder->sbr[0]->ret = 1;
 1463|      4|        }
 1464|       |
 1465|       |        /* check CRC */
 1466|       |        /* no need to check it if there was already an error */
 1467|    333|        if (hDecoder->sbr[0]->ret == 0)
  ------------------
  |  Branch (1467:13): [True: 170, False: 163]
  ------------------
 1468|    170|            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|    333|        if (hDecoder->sbr[0]->ret != 0)
  ------------------
  |  Branch (1471:13): [True: 197, False: 136]
  ------------------
 1472|    197|        {
 1473|    197|            hDecoder->sbr[0]->header_count = 0;
 1474|    197|        }
 1475|       |
 1476|    333|        faad_endbits(&ld_sbr);
 1477|       |
 1478|    333|        if (revbuffer)
  ------------------
  |  Branch (1478:13): [True: 333, False: 0]
  ------------------
 1479|    333|            faad_free(revbuffer);
 1480|    333|    }
 1481|    361|#endif
 1482|    361|#endif
 1483|       |
 1484|    361|    if (this_layer_stereo)
  ------------------
  |  Branch (1484:9): [True: 43, False: 318]
  ------------------
 1485|     43|    {
 1486|     43|        hInfo->error = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe, spec_data1, spec_data2);
 1487|     43|        if (hInfo->error > 0)
  ------------------
  |  Branch (1487:13): [True: 5, False: 38]
  ------------------
 1488|      5|            return;
 1489|    318|    } else {
 1490|    318|        hInfo->error = reconstruct_single_channel(hDecoder, ics1, &cpe, spec_data1);
 1491|    318|        if (hInfo->error > 0)
  ------------------
  |  Branch (1491:13): [True: 3, False: 315]
  ------------------
 1492|      3|            return;
 1493|    318|    }
 1494|       |
 1495|       |    /* map output channels position to internal data channels */
 1496|    353|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
  ------------------
  |  Branch (1496:9): [True: 353, False: 0]
  ------------------
 1497|    353|    {
 1498|       |        /* this might be faulty when pce_set is true */
 1499|    353|        hDecoder->internal_channel[channels] = channels;
 1500|    353|        hDecoder->internal_channel[channels+1] = channels+1;
 1501|    353|    } else {
 1502|      0|        hDecoder->internal_channel[channels] = channels;
 1503|      0|    }
 1504|       |
 1505|    353|    hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
 1506|    353|    hDecoder->fr_ch_ele++;
 1507|       |
 1508|    353|    return;
 1509|    361|}
get_adif_header:
 2401|    114|{
 2402|    114|    uint8_t i;
 2403|       |
 2404|       |    /* adif_id[0] = */ faad_getbits(ld, 8
 2405|    114|        DEBUGVAR(1,106,"get_adif_header(): adif_id[0]"));
 2406|    114|    /* adif_id[1] = */ faad_getbits(ld, 8
 2407|    114|        DEBUGVAR(1,107,"get_adif_header(): adif_id[1]"));
 2408|    114|    /* adif_id[2] = */ faad_getbits(ld, 8
 2409|    114|        DEBUGVAR(1,108,"get_adif_header(): adif_id[2]"));
 2410|    114|    /* adif_id[3] = */ faad_getbits(ld, 8
 2411|    114|        DEBUGVAR(1,109,"get_adif_header(): adif_id[3]"));
 2412|    114|    adif->copyright_id_present = faad_get1bit(ld
 2413|    114|        DEBUGVAR(1,110,"get_adif_header(): copyright_id_present"));
 2414|    114|    if(adif->copyright_id_present)
  ------------------
  |  Branch (2414:8): [True: 18, False: 96]
  ------------------
 2415|     18|    {
 2416|    180|        for (i = 0; i < 72/8; i++)
  ------------------
  |  Branch (2416:21): [True: 162, False: 18]
  ------------------
 2417|    162|        {
 2418|    162|            adif->copyright_id[i] = (int8_t)faad_getbits(ld, 8
 2419|    162|                DEBUGVAR(1,111,"get_adif_header(): copyright_id"));
 2420|    162|        }
 2421|     18|        adif->copyright_id[i] = 0;
 2422|     18|    }
 2423|    114|    adif->original_copy  = faad_get1bit(ld
 2424|    114|        DEBUGVAR(1,112,"get_adif_header(): original_copy"));
 2425|    114|    adif->home = faad_get1bit(ld
 2426|    114|        DEBUGVAR(1,113,"get_adif_header(): home"));
 2427|    114|    adif->bitstream_type = faad_get1bit(ld
 2428|    114|        DEBUGVAR(1,114,"get_adif_header(): bitstream_type"));
 2429|    114|    adif->bitrate = faad_getbits(ld, 23
 2430|    114|        DEBUGVAR(1,115,"get_adif_header(): bitrate"));
 2431|    114|    adif->num_program_config_elements = (uint8_t)faad_getbits(ld, 4
 2432|    114|        DEBUGVAR(1,116,"get_adif_header(): num_program_config_elements"));
 2433|       |
 2434|  1.46k|    for (i = 0; i < adif->num_program_config_elements + 1; i++)
  ------------------
  |  Branch (2434:17): [True: 1.35k, False: 114]
  ------------------
 2435|  1.35k|    {
 2436|  1.35k|        if(adif->bitstream_type == 0)
  ------------------
  |  Branch (2436:12): [True: 439, False: 914]
  ------------------
 2437|    439|        {
 2438|    439|            adif->adif_buffer_fullness = faad_getbits(ld, 20
 2439|    439|                DEBUGVAR(1,117,"get_adif_header(): adif_buffer_fullness"));
 2440|    914|        } else {
 2441|    914|            adif->adif_buffer_fullness = 0;
 2442|    914|        }
 2443|       |
 2444|  1.35k|        program_config_element(&adif->pce[i], ld);
 2445|  1.35k|    }
 2446|    114|}
adts_frame:
 2450|  5.41k|{
 2451|       |    /* faad_byte_align(ld); */
 2452|  5.41k|    if (adts_fixed_header(adts, ld))
  ------------------
  |  Branch (2452:9): [True: 5.24k, False: 177]
  ------------------
 2453|  5.24k|        return 5;
 2454|    177|    adts_variable_header(adts, ld);
 2455|    177|    adts_error_check(adts, ld);
 2456|       |
 2457|    177|    return 0;
 2458|  5.41k|}
syntax.c:program_config_element:
  175|  1.95k|{
  176|  1.95k|    uint8_t i;
  177|       |
  178|  1.95k|    memset(pce, 0, sizeof(program_config));
  179|       |
  180|  1.95k|    pce->channels = 0;
  181|       |
  182|  1.95k|    pce->element_instance_tag = (uint8_t)faad_getbits(ld, 4
  183|  1.95k|        DEBUGVAR(1,10,"program_config_element(): element_instance_tag"));
  184|       |
  185|  1.95k|    pce->object_type = (uint8_t)faad_getbits(ld, 2
  186|  1.95k|        DEBUGVAR(1,11,"program_config_element(): object_type"));
  187|  1.95k|    pce->sf_index = (uint8_t)faad_getbits(ld, 4
  188|  1.95k|        DEBUGVAR(1,12,"program_config_element(): sf_index"));
  189|  1.95k|    pce->num_front_channel_elements = (uint8_t)faad_getbits(ld, 4
  190|  1.95k|        DEBUGVAR(1,13,"program_config_element(): num_front_channel_elements"));
  191|  1.95k|    pce->num_side_channel_elements = (uint8_t)faad_getbits(ld, 4
  192|  1.95k|        DEBUGVAR(1,14,"program_config_element(): num_side_channel_elements"));
  193|  1.95k|    pce->num_back_channel_elements = (uint8_t)faad_getbits(ld, 4
  194|  1.95k|        DEBUGVAR(1,15,"program_config_element(): num_back_channel_elements"));
  195|  1.95k|    pce->num_lfe_channel_elements = (uint8_t)faad_getbits(ld, 2
  196|  1.95k|        DEBUGVAR(1,16,"program_config_element(): num_lfe_channel_elements"));
  197|  1.95k|    pce->num_assoc_data_elements = (uint8_t)faad_getbits(ld, 3
  198|  1.95k|        DEBUGVAR(1,17,"program_config_element(): num_assoc_data_elements"));
  199|  1.95k|    pce->num_valid_cc_elements = (uint8_t)faad_getbits(ld, 4
  200|  1.95k|        DEBUGVAR(1,18,"program_config_element(): num_valid_cc_elements"));
  201|       |
  202|  1.95k|    pce->mono_mixdown_present = faad_get1bit(ld
  203|  1.95k|        DEBUGVAR(1,19,"program_config_element(): mono_mixdown_present"));
  204|  1.95k|    if (pce->mono_mixdown_present == 1)
  ------------------
  |  Branch (204:9): [True: 398, False: 1.56k]
  ------------------
  205|    398|    {
  206|    398|        pce->mono_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
  207|    398|            DEBUGVAR(1,20,"program_config_element(): mono_mixdown_element_number"));
  208|    398|    }
  209|       |
  210|  1.95k|    pce->stereo_mixdown_present = faad_get1bit(ld
  211|  1.95k|        DEBUGVAR(1,21,"program_config_element(): stereo_mixdown_present"));
  212|  1.95k|    if (pce->stereo_mixdown_present == 1)
  ------------------
  |  Branch (212:9): [True: 347, False: 1.61k]
  ------------------
  213|    347|    {
  214|    347|        pce->stereo_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
  215|    347|            DEBUGVAR(1,22,"program_config_element(): stereo_mixdown_element_number"));
  216|    347|    }
  217|       |
  218|  1.95k|    pce->matrix_mixdown_idx_present = faad_get1bit(ld
  219|  1.95k|        DEBUGVAR(1,23,"program_config_element(): matrix_mixdown_idx_present"));
  220|  1.95k|    if (pce->matrix_mixdown_idx_present == 1)
  ------------------
  |  Branch (220:9): [True: 292, False: 1.66k]
  ------------------
  221|    292|    {
  222|    292|        pce->matrix_mixdown_idx = (uint8_t)faad_getbits(ld, 2
  223|    292|            DEBUGVAR(1,24,"program_config_element(): matrix_mixdown_idx"));
  224|    292|        pce->pseudo_surround_enable = faad_get1bit(ld
  225|    292|            DEBUGVAR(1,25,"program_config_element(): pseudo_surround_enable"));
  226|    292|    }
  227|       |
  228|  7.70k|    for (i = 0; i < pce->num_front_channel_elements; i++)
  ------------------
  |  Branch (228:17): [True: 5.74k, False: 1.95k]
  ------------------
  229|  5.74k|    {
  230|  5.74k|        pce->front_element_is_cpe[i] = faad_get1bit(ld
  231|  5.74k|            DEBUGVAR(1,26,"program_config_element(): front_element_is_cpe"));
  232|  5.74k|        pce->front_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  233|  5.74k|            DEBUGVAR(1,27,"program_config_element(): front_element_tag_select"));
  234|       |
  235|  5.74k|        if (pce->front_element_is_cpe[i] & 1)
  ------------------
  |  Branch (235:13): [True: 1.73k, False: 4.01k]
  ------------------
  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|  4.01k|        } else {
  241|  4.01k|            pce->sce_channel[pce->front_element_tag_select[i]] = pce->channels;
  242|  4.01k|            pce->num_front_channels++;
  243|  4.01k|            pce->channels++;
  244|  4.01k|        }
  245|  5.74k|    }
  246|       |
  247|  7.49k|    for (i = 0; i < pce->num_side_channel_elements; i++)
  ------------------
  |  Branch (247:17): [True: 5.53k, False: 1.95k]
  ------------------
  248|  5.53k|    {
  249|  5.53k|        pce->side_element_is_cpe[i] = faad_get1bit(ld
  250|  5.53k|            DEBUGVAR(1,28,"program_config_element(): side_element_is_cpe"));
  251|  5.53k|        pce->side_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  252|  5.53k|            DEBUGVAR(1,29,"program_config_element(): side_element_tag_select"));
  253|       |
  254|  5.53k|        if (pce->side_element_is_cpe[i] & 1)
  ------------------
  |  Branch (254:13): [True: 1.35k, False: 4.18k]
  ------------------
  255|  1.35k|        {
  256|  1.35k|            pce->cpe_channel[pce->side_element_tag_select[i]] = pce->channels;
  257|  1.35k|            pce->num_side_channels += 2;
  258|  1.35k|            pce->channels += 2;
  259|  4.18k|        } else {
  260|  4.18k|            pce->sce_channel[pce->side_element_tag_select[i]] = pce->channels;
  261|  4.18k|            pce->num_side_channels++;
  262|  4.18k|            pce->channels++;
  263|  4.18k|        }
  264|  5.53k|    }
  265|       |
  266|  7.29k|    for (i = 0; i < pce->num_back_channel_elements; i++)
  ------------------
  |  Branch (266:17): [True: 5.33k, False: 1.95k]
  ------------------
  267|  5.33k|    {
  268|  5.33k|        pce->back_element_is_cpe[i] = faad_get1bit(ld
  269|  5.33k|            DEBUGVAR(1,30,"program_config_element(): back_element_is_cpe"));
  270|  5.33k|        pce->back_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  271|  5.33k|            DEBUGVAR(1,31,"program_config_element(): back_element_tag_select"));
  272|       |
  273|  5.33k|        if (pce->back_element_is_cpe[i] & 1)
  ------------------
  |  Branch (273:13): [True: 1.37k, False: 3.96k]
  ------------------
  274|  1.37k|        {
  275|  1.37k|            pce->cpe_channel[pce->back_element_tag_select[i]] = pce->channels;
  276|  1.37k|            pce->channels += 2;
  277|  1.37k|            pce->num_back_channels += 2;
  278|  3.96k|        } else {
  279|  3.96k|            pce->sce_channel[pce->back_element_tag_select[i]] = pce->channels;
  280|  3.96k|            pce->num_back_channels++;
  281|  3.96k|            pce->channels++;
  282|  3.96k|        }
  283|  5.33k|    }
  284|       |
  285|  3.13k|    for (i = 0; i < pce->num_lfe_channel_elements; i++)
  ------------------
  |  Branch (285:17): [True: 1.17k, False: 1.95k]
  ------------------
  286|  1.17k|    {
  287|  1.17k|        pce->lfe_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  288|  1.17k|            DEBUGVAR(1,32,"program_config_element(): lfe_element_tag_select"));
  289|       |
  290|  1.17k|        pce->sce_channel[pce->lfe_element_tag_select[i]] = pce->channels;
  291|  1.17k|        pce->num_lfe_channels++;
  292|  1.17k|        pce->channels++;
  293|  1.17k|    }
  294|       |
  295|  3.94k|    for (i = 0; i < pce->num_assoc_data_elements; i++)
  ------------------
  |  Branch (295:17): [True: 1.98k, False: 1.95k]
  ------------------
  296|  1.98k|        pce->assoc_data_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  297|  1.98k|        DEBUGVAR(1,33,"program_config_element(): assoc_data_element_tag_select"));
  298|       |
  299|  6.65k|    for (i = 0; i < pce->num_valid_cc_elements; i++)
  ------------------
  |  Branch (299:17): [True: 4.69k, False: 1.95k]
  ------------------
  300|  4.69k|    {
  301|  4.69k|        pce->cc_element_is_ind_sw[i] = faad_get1bit(ld
  302|  4.69k|            DEBUGVAR(1,34,"program_config_element(): cc_element_is_ind_sw"));
  303|  4.69k|        pce->valid_cc_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
  304|  4.69k|            DEBUGVAR(1,35,"program_config_element(): valid_cc_element_tag_select"));
  305|  4.69k|    }
  306|       |
  307|  1.95k|    faad_byte_align(ld);
  308|       |
  309|  1.95k|    pce->comment_field_bytes = (uint8_t)faad_getbits(ld, 8
  310|  1.95k|        DEBUGVAR(1,36,"program_config_element(): comment_field_bytes"));
  311|       |
  312|  17.5k|    for (i = 0; i < pce->comment_field_bytes; i++)
  ------------------
  |  Branch (312:17): [True: 15.5k, False: 1.95k]
  ------------------
  313|  15.5k|    {
  314|  15.5k|        pce->comment_field_data[i] = (uint8_t)faad_getbits(ld, 8
  315|  15.5k|            DEBUGVAR(1,37,"program_config_element(): comment_field_data"));
  316|  15.5k|    }
  317|  1.95k|    pce->comment_field_data[i] = 0;
  318|       |
  319|  1.95k|    if (pce->channels > MAX_CHANNELS)
  ------------------
  |  |   43|  1.95k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (319:9): [True: 66, False: 1.89k]
  ------------------
  320|     66|        return 22;
  321|       |
  322|  1.89k|    return 0;
  323|  1.95k|}
syntax.c:decode_sce_lfe:
  328|   107k|{
  329|   107k|    uint8_t channels = hDecoder->fr_channels;
  330|   107k|    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|   107k|    if (channels+2 > MAX_CHANNELS)
  ------------------
  |  |   43|   107k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (335:9): [True: 3.14k, False: 104k]
  ------------------
  336|  3.14k|    {
  337|  3.14k|        hInfo->error = 12;
  338|  3.14k|        return;
  339|  3.14k|    }
  340|   104k|    if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
  ------------------
  |  |   44|   104k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (340:9): [True: 0, False: 104k]
  ------------------
  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|   104k|    if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID &&
  ------------------
  |  |   94|   209k|#define INVALID_ELEMENT_ID 255
  ------------------
  |  Branch (350:9): [True: 14.3k, False: 90.1k]
  ------------------
  351|  14.3k|        hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele)
  ------------------
  |  Branch (351:9): [True: 72, False: 14.2k]
  ------------------
  352|     72|    {
  353|       |        /* element inconsistency */
  354|     72|        hInfo->error = 21;
  355|     72|        return;
  356|     72|    }
  357|       |
  358|       |    /* save the syntax element id */
  359|   104k|    hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
  360|       |
  361|       |    /* decode the element */
  362|   104k|    hInfo->error = single_lfe_channel_element(hDecoder, ld, channels, &tag);
  363|       |
  364|       |    /* map output channels position to internal data channels */
  365|   104k|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
  ------------------
  |  Branch (365:9): [True: 103k, False: 607]
  ------------------
  366|   103k|    {
  367|       |        /* this might be faulty when pce_set is true */
  368|   103k|        hDecoder->internal_channel[channels] = channels;
  369|   103k|        hDecoder->internal_channel[channels+1] = channels+1;
  370|   103k|    } else {
  371|    607|        if (hDecoder->pce_set)
  ------------------
  |  Branch (371:13): [True: 42, False: 565]
  ------------------
  372|     42|        {
  373|     42|            if (hDecoder->pce.channels > MAX_CHANNELS)
  ------------------
  |  |   43|     42|#define MAX_CHANNELS        64
  ------------------
  |  Branch (373:17): [True: 3, False: 39]
  ------------------
  374|      3|            {
  375|      3|                hInfo->error = 22;
  376|      3|                return;
  377|      3|            }
  378|     39|            hDecoder->internal_channel[hDecoder->pce.sce_channel[tag]] = channels;
  379|    565|        } else {
  380|    565|            hDecoder->internal_channel[channels] = channels;
  381|    565|        }
  382|    607|    }
  383|       |
  384|   104k|    hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
  385|   104k|    hDecoder->fr_ch_ele++;
  386|   104k|}
syntax.c:single_lfe_channel_element:
  654|   104k|{
  655|   104k|    uint8_t retval = 0;
  656|   104k|    element sce = {0};
  657|   104k|    ic_stream *ics = &(sce.ics1);
  658|   104k|    ALIGN int16_t spec_data[1024] = {0};
  659|       |
  660|   104k|    sce.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
  ------------------
  |  |   76|   104k|#define LEN_TAG   4
  ------------------
  661|   104k|        DEBUGVAR(1,38,"single_lfe_channel_element(): element_instance_tag"));
  662|       |
  663|   104k|    *tag = sce.element_instance_tag;
  664|   104k|    sce.channel = channel;
  665|   104k|    sce.paired_channel = -1;
  666|       |
  667|   104k|    retval = individual_channel_stream(hDecoder, &sce, ld, ics, 0, spec_data);
  668|   104k|    if (retval > 0)
  ------------------
  |  Branch (668:9): [True: 555, False: 103k]
  ------------------
  669|    555|        return retval;
  670|       |
  671|       |    /* IS not allowed in single channel */
  672|   103k|    if (ics->is_used)
  ------------------
  |  Branch (672:9): [True: 84, False: 103k]
  ------------------
  673|     84|        return 32;
  674|       |
  675|   103k|#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|   103k|    if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   75|   103k|#define LEN_SE_ID 3
  ------------------
                  if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   92|   103k|#define ID_FIL 0x6
  ------------------
  |  Branch (678:9): [True: 13.5k, False: 90.2k]
  ------------------
  679|  13.5k|    {
  680|  13.5k|        faad_flushbits(ld, LEN_SE_ID);
  ------------------
  |  |   75|  13.5k|#define LEN_SE_ID 3
  ------------------
  681|       |
  682|       |        /* one sbr_info describes a channel_element not a channel! */
  683|  13.5k|        if ((retval = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
  ------------------
  |  Branch (683:13): [True: 28, False: 13.5k]
  ------------------
  684|     28|        {
  685|     28|            return retval;
  686|     28|        }
  687|  13.5k|    }
  688|   103k|#endif
  689|       |
  690|       |    /* noiseless coding is done, spectral reconstruction is done now */
  691|   103k|    retval = reconstruct_single_channel(hDecoder, ics, &sce, spec_data);
  692|   103k|    if (retval > 0)
  ------------------
  |  Branch (692:9): [True: 68, False: 103k]
  ------------------
  693|     68|        return retval;
  694|       |
  695|   103k|    return 0;
  696|   103k|}
syntax.c:individual_channel_stream:
 1674|   145k|{
 1675|   145k|    uint8_t result;
 1676|       |
 1677|   145k|    result = side_info(hDecoder, ele, ld, ics, scal_flag);
 1678|   145k|    if (result > 0)
  ------------------
  |  Branch (1678:9): [True: 902, False: 144k]
  ------------------
 1679|    902|        return result;
 1680|       |
 1681|   144k|    if (hDecoder->object_type >= ER_OBJECT_START)
  ------------------
  |  |   71|   144k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (1681:9): [True: 9.60k, False: 134k]
  ------------------
 1682|  9.60k|    {
 1683|  9.60k|        if (ics->tns_data_present)
  ------------------
  |  Branch (1683:13): [True: 295, False: 9.31k]
  ------------------
 1684|    295|            tns_data(ics, &(ics->tns), ld);
 1685|  9.60k|    }
 1686|       |
 1687|   144k|#ifdef DRM
 1688|       |    /* CRC check */
 1689|   144k|    if (hDecoder->object_type == DRM_ER_LC)
  ------------------
  |  |   48|   144k|#define DRM_ER_LC 27 /* special object type for DRM */
  ------------------
  |  Branch (1689:9): [True: 0, False: 144k]
  ------------------
 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|   144k|#endif
 1695|       |
 1696|   144k|#ifdef ERROR_RESILIENCE
 1697|   144k|    if (hDecoder->aacSpectralDataResilienceFlag)
  ------------------
  |  Branch (1697:9): [True: 3.81k, False: 140k]
  ------------------
 1698|  3.81k|    {
 1699|       |        /* error resilient spectral data decoding */
 1700|  3.81k|        if ((result = reordered_spectral_data(hDecoder, ics, ld, spec_data)) > 0)
  ------------------
  |  Branch (1700:13): [True: 69, False: 3.74k]
  ------------------
 1701|     69|        {
 1702|     69|            return result;
 1703|     69|        }
 1704|   140k|    } else {
 1705|   140k|#endif
 1706|       |        /* decode the spectral data */
 1707|   140k|        if ((result = spectral_data(hDecoder, ics, ld, spec_data)) > 0)
  ------------------
  |  Branch (1707:13): [True: 42, False: 140k]
  ------------------
 1708|     42|        {
 1709|     42|            return result;
 1710|     42|        }
 1711|   140k|#ifdef ERROR_RESILIENCE
 1712|   140k|    }
 1713|   144k|#endif
 1714|       |
 1715|       |    /* pulse coding reconstruction */
 1716|   144k|    if (ics->pulse_data_present)
  ------------------
  |  Branch (1716:9): [True: 5.48k, False: 138k]
  ------------------
 1717|  5.48k|    {
 1718|  5.48k|        if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  5.48k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1718:13): [True: 5.46k, False: 14]
  ------------------
 1719|  5.46k|        {
 1720|  5.46k|            if ((result = pulse_decode(ics, spec_data, hDecoder->frameLength)) > 0)
  ------------------
  |  Branch (1720:17): [True: 8, False: 5.46k]
  ------------------
 1721|      8|                return result;
 1722|  5.46k|        } else {
 1723|     14|            return 2; /* pulse coding not allowed for short blocks */
 1724|     14|        }
 1725|  5.48k|    }
 1726|       |
 1727|   144k|    return 0;
 1728|   144k|}
syntax.c:spectral_data:
 2158|   140k|{
 2159|   140k|    int8_t i;
 2160|   140k|    uint8_t g;
 2161|   140k|    uint16_t inc, k, p = 0;
 2162|   140k|    uint8_t groups = 0;
 2163|   140k|    uint8_t sect_cb;
 2164|   140k|    uint8_t result;
 2165|   140k|    uint16_t nshort = hDecoder->frameLength/8;
 2166|       |
 2167|       |#ifdef PROFILE
 2168|       |    int64_t count = faad_get_ts();
 2169|       |#endif
 2170|       |
 2171|   368k|    for(g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (2171:16): [True: 228k, False: 140k]
  ------------------
 2172|   228k|    {
 2173|   228k|        p = groups*nshort;
 2174|       |
 2175|   262k|        for (i = 0; i < ics->num_sec[g]; i++)
  ------------------
  |  Branch (2175:21): [True: 34.4k, False: 228k]
  ------------------
 2176|  34.4k|        {
 2177|  34.4k|            sect_cb = ics->sect_cb[g][i];
 2178|       |
 2179|  34.4k|            inc = (sect_cb >= FIRST_PAIR_HCB) ? 2 : 4;
  ------------------
  |  |  102|  34.4k|#define FIRST_PAIR_HCB 5
  ------------------
  |  Branch (2179:19): [True: 9.80k, False: 24.6k]
  ------------------
 2180|       |
 2181|  34.4k|            switch (sect_cb)
 2182|  34.4k|            {
 2183|  12.4k|            case ZERO_HCB:
  ------------------
  |  |  101|  12.4k|#define ZERO_HCB       0
  ------------------
  |  Branch (2183:13): [True: 12.4k, False: 22.0k]
  ------------------
 2184|  12.4k|            case NOISE_HCB:
  ------------------
  |  |  106|  12.4k|#define NOISE_HCB      13
  ------------------
  |  Branch (2184:13): [True: 0, False: 34.4k]
  ------------------
 2185|  13.2k|            case INTENSITY_HCB:
  ------------------
  |  |  108|  13.2k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (2185:13): [True: 831, False: 33.6k]
  ------------------
 2186|  13.5k|            case INTENSITY_HCB2:
  ------------------
  |  |  107|  13.5k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (2186:13): [True: 317, False: 34.1k]
  ------------------
 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|  13.5k|                p += (ics->sect_sfb_offset[g][ics->sect_end[g][i]] -
 2202|  13.5k|                    ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
 2203|  13.5k|                break;
 2204|  20.8k|            default:
  ------------------
  |  Branch (2204:13): [True: 20.8k, False: 13.5k]
  ------------------
 2205|       |#ifdef SFBO_PRINT
 2206|       |                printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
 2207|       |#endif
 2208|  20.8k|                for (k = ics->sect_sfb_offset[g][ics->sect_start[g][i]];
 2209|   249k|                     k < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; k += inc)
  ------------------
  |  Branch (2209:22): [True: 229k, False: 20.8k]
  ------------------
 2210|   229k|                {
 2211|   229k|                    if ((result = huffman_spectral_data(sect_cb, ld, &spectral_data[p])) > 0)
  ------------------
  |  Branch (2211:25): [True: 42, False: 229k]
  ------------------
 2212|     42|                        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|   229k|                    p += inc;
 2223|   229k|                }
 2224|  20.8k|                break;
 2225|  34.4k|            }
 2226|  34.4k|        }
 2227|   228k|        groups += ics->window_group_length[g];
 2228|   228k|    }
 2229|       |
 2230|       |#ifdef PROFILE
 2231|       |    count = faad_get_ts() - count;
 2232|       |    hDecoder->spectral_cycles += count;
 2233|       |#endif
 2234|       |
 2235|   140k|    return 0;
 2236|   140k|}
syntax.c:decode_cpe:
  390|  20.8k|{
  391|  20.8k|    uint8_t channels = hDecoder->fr_channels;
  392|  20.8k|    uint8_t tag = 0;
  393|       |
  394|  20.8k|    if (channels+2 > MAX_CHANNELS)
  ------------------
  |  |   43|  20.8k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (394:9): [True: 156, False: 20.7k]
  ------------------
  395|    156|    {
  396|    156|        hInfo->error = 12;
  397|    156|        return;
  398|    156|    }
  399|  20.7k|    if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
  ------------------
  |  |   44|  20.7k|#define MAX_SYNTAX_ELEMENTS 48
  ------------------
  |  Branch (399:9): [True: 0, False: 20.7k]
  ------------------
  400|      0|    {
  401|      0|        hInfo->error = 13;
  402|      0|        return;
  403|      0|    }
  404|  20.7k|    if (hDecoder->pce_set && (hDecoder->pce.channels > MAX_CHANNELS))
  ------------------
  |  |   43|  1.05k|#define MAX_CHANNELS        64
  ------------------
  |  Branch (404:9): [True: 1.05k, False: 19.6k]
  |  Branch (404:30): [True: 3, False: 1.05k]
  ------------------
  405|      3|    {
  406|      3|        hInfo->error = 22;
  407|      3|        return;
  408|      3|    }
  409|       |
  410|       |    /* for CPE the number of output channels is always 2 */
  411|  20.7k|    if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
  ------------------
  |  Branch (411:9): [True: 17.1k, False: 3.56k]
  ------------------
  412|  17.1k|    {
  413|       |        /* element_output_channels not set yet */
  414|  17.1k|        hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
  415|  17.1k|    } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != 2) {
  ------------------
  |  Branch (415:16): [True: 0, False: 3.56k]
  ------------------
  416|       |        /* element inconsistency */
  417|      0|        hInfo->error = 21;
  418|      0|        return;
  419|      0|    }
  420|       |
  421|  20.7k|    if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID &&
  ------------------
  |  |   94|  41.4k|#define INVALID_ELEMENT_ID 255
  ------------------
  |  Branch (421:9): [True: 3.56k, False: 17.1k]
  ------------------
  422|  3.56k|        hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele)
  ------------------
  |  Branch (422:9): [True: 45, False: 3.52k]
  ------------------
  423|     45|    {
  424|       |        /* element inconsistency */
  425|     45|        hInfo->error = 21;
  426|     45|        return;
  427|     45|    }
  428|       |
  429|       |    /* save the syntax element id */
  430|  20.6k|    hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
  431|       |
  432|       |    /* decode the element */
  433|  20.6k|    hInfo->error = channel_pair_element(hDecoder, ld, channels, &tag);
  434|       |
  435|       |    /* map output channel position to internal data channels */
  436|  20.6k|    if (hDecoder->pce_set)
  ------------------
  |  Branch (436:9): [True: 1.04k, False: 19.6k]
  ------------------
  437|  1.04k|    {
  438|  1.04k|        hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]] = channels;
  439|  1.04k|        hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]+1] = channels+1;
  440|  19.6k|    } else {
  441|  19.6k|        hDecoder->internal_channel[channels] = channels;
  442|  19.6k|        hDecoder->internal_channel[channels+1] = channels+1;
  443|  19.6k|    }
  444|       |
  445|  20.6k|    hDecoder->fr_channels += 2;
  446|  20.6k|    hDecoder->fr_ch_ele++;
  447|  20.6k|}
syntax.c:channel_pair_element:
  701|  20.6k|{
  702|  20.6k|    ALIGN int16_t spec_data1[1024] = {0};
  703|  20.6k|    ALIGN int16_t spec_data2[1024] = {0};
  704|  20.6k|    element cpe = {0};
  705|  20.6k|    ic_stream *ics1 = &(cpe.ics1);
  706|  20.6k|    ic_stream *ics2 = &(cpe.ics2);
  707|  20.6k|    uint8_t result;
  708|       |
  709|  20.6k|    cpe.channel        = channels;
  710|  20.6k|    cpe.paired_channel = channels+1;
  711|       |
  712|  20.6k|    cpe.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
  ------------------
  |  |   76|  20.6k|#define LEN_TAG   4
  ------------------
  713|  20.6k|        DEBUGVAR(1,39,"channel_pair_element(): element_instance_tag"));
  714|  20.6k|    *tag = cpe.element_instance_tag;
  715|       |
  716|  20.6k|    if ((cpe.common_window = faad_get1bit(ld
  ------------------
  |  Branch (716:9): [True: 12.1k, False: 8.53k]
  ------------------
  717|  20.6k|        DEBUGVAR(1,40,"channel_pair_element(): common_window"))) & 1)
  718|  12.1k|    {
  719|       |        /* both channels have common ics information */
  720|  12.1k|        if ((result = ics_info(hDecoder, ics1, ld, cpe.common_window)) > 0)
  ------------------
  |  Branch (720:13): [True: 101, False: 12.0k]
  ------------------
  721|    101|            return result;
  722|       |
  723|  12.0k|        ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
  724|  12.0k|            DEBUGVAR(1,41,"channel_pair_element(): ms_mask_present"));
  725|  12.0k|        if (ics1->ms_mask_present == 3)
  ------------------
  |  Branch (725:13): [True: 20, False: 12.0k]
  ------------------
  726|     20|        {
  727|       |            /* bitstream error */
  728|     20|            return 32;
  729|     20|        }
  730|  12.0k|        if (ics1->ms_mask_present == 1)
  ------------------
  |  Branch (730:13): [True: 3.18k, False: 8.81k]
  ------------------
  731|  3.18k|        {
  732|  3.18k|            uint8_t g, sfb;
  733|  8.63k|            for (g = 0; g < ics1->num_window_groups; g++)
  ------------------
  |  Branch (733:25): [True: 5.44k, False: 3.18k]
  ------------------
  734|  5.44k|            {
  735|  12.3k|                for (sfb = 0; sfb < ics1->max_sfb; sfb++)
  ------------------
  |  Branch (735:31): [True: 6.92k, False: 5.44k]
  ------------------
  736|  6.92k|                {
  737|  6.92k|                    ics1->ms_used[g][sfb] = faad_get1bit(ld
  738|  6.92k|                        DEBUGVAR(1,42,"channel_pair_element(): faad_get1bit"));
  739|  6.92k|                }
  740|  5.44k|            }
  741|  3.18k|        }
  742|       |
  743|  12.0k|#ifdef ERROR_RESILIENCE
  744|  12.0k|        if ((hDecoder->object_type >= ER_OBJECT_START) && (ics1->predictor_data_present))
  ------------------
  |  |   71|  12.0k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (744:13): [True: 688, False: 11.3k]
  |  Branch (744:59): [True: 60, False: 628]
  ------------------
  745|     60|        {
  746|     60|            if ((
  ------------------
  |  Branch (746:17): [True: 4, False: 56]
  ------------------
  747|       |#ifdef LTP_DEC
  748|       |                ics1->ltp.data_present =
  749|       |#endif
  750|     60|                faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
  751|      4|            {
  752|       |#ifdef LTP_DEC
  753|       |                if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp), ld)) > 0)
  754|       |                {
  755|       |                    return result;
  756|       |                }
  757|       |#else
  758|      4|                return 26;
  759|      4|#endif
  760|      4|            }
  761|     60|        }
  762|  11.9k|#endif
  763|       |
  764|  11.9k|        memcpy(ics2, ics1, sizeof(ic_stream));
  765|  11.9k|    } else {
  766|  8.53k|        ics1->ms_mask_present = 0;
  767|  8.53k|    }
  768|       |
  769|  20.5k|    if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics1,
  ------------------
  |  Branch (769:9): [True: 321, False: 20.2k]
  ------------------
  770|  20.5k|        0, spec_data1)) > 0)
  771|    321|    {
  772|    321|        return result;
  773|    321|    }
  774|       |
  775|  20.2k|#ifdef ERROR_RESILIENCE
  776|  20.2k|    if (cpe.common_window && (hDecoder->object_type >= ER_OBJECT_START) &&
  ------------------
  |  |   71|  11.8k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (776:9): [True: 11.8k, False: 8.40k]
  |  Branch (776:30): [True: 639, False: 11.1k]
  ------------------
  777|    639|        (ics1->predictor_data_present))
  ------------------
  |  Branch (777:9): [True: 46, False: 593]
  ------------------
  778|     46|    {
  779|     46|        if ((
  ------------------
  |  Branch (779:13): [True: 3, False: 43]
  ------------------
  780|       |#ifdef LTP_DEC
  781|       |            ics1->ltp2.data_present =
  782|       |#endif
  783|     46|            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|     46|    }
  795|  20.2k|#endif
  796|       |
  797|  20.2k|    if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics2,
  ------------------
  |  Branch (797:9): [True: 159, False: 20.0k]
  ------------------
  798|  20.2k|        0, spec_data2)) > 0)
  799|    159|    {
  800|    159|        return result;
  801|    159|    }
  802|       |
  803|  20.0k|#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|  20.0k|    if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   75|  20.0k|#define LEN_SE_ID 3
  ------------------
                  if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
  ------------------
  |  |   92|  20.0k|#define ID_FIL 0x6
  ------------------
  |  Branch (806:9): [True: 12.2k, False: 7.80k]
  ------------------
  807|  12.2k|    {
  808|  12.2k|        faad_flushbits(ld, LEN_SE_ID);
  ------------------
  |  |   75|  12.2k|#define LEN_SE_ID 3
  ------------------
  809|       |
  810|       |        /* one sbr_info describes a channel_element not a channel! */
  811|  12.2k|        if ((result = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
  ------------------
  |  Branch (811:13): [True: 14, False: 12.2k]
  ------------------
  812|     14|        {
  813|     14|            return result;
  814|     14|        }
  815|  12.2k|    }
  816|  20.0k|#endif
  817|       |
  818|       |    /* noiseless coding is done, spectral reconstruction is done now */
  819|  20.0k|    if ((result = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe,
  ------------------
  |  Branch (819:9): [True: 65, False: 19.9k]
  ------------------
  820|  20.0k|        spec_data1, spec_data2)) > 0)
  821|     65|    {
  822|     65|        return result;
  823|     65|    }
  824|       |
  825|  19.9k|    return 0;
  826|  20.0k|}
syntax.c:ics_info:
  831|   133k|{
  832|   133k|    uint8_t retval = 0;
  833|   133k|    uint8_t ics_reserved_bit;
  834|       |
  835|   133k|    ics_reserved_bit = faad_get1bit(ld
  836|   133k|        DEBUGVAR(1,43,"ics_info(): ics_reserved_bit"));
  837|   133k|    if (ics_reserved_bit != 0)
  ------------------
  |  Branch (837:9): [True: 300, False: 133k]
  ------------------
  838|    300|        return 32;
  839|   133k|    ics->window_sequence = (uint8_t)faad_getbits(ld, 2
  840|   133k|        DEBUGVAR(1,44,"ics_info(): window_sequence"));
  841|   133k|    ics->window_shape = faad_get1bit(ld
  842|   133k|        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|   133k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|   133k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (850:9): [True: 15.0k, False: 118k]
  ------------------
  851|  15.0k|    {
  852|  15.0k|        ics->max_sfb = (uint8_t)faad_getbits(ld, 4
  853|  15.0k|            DEBUGVAR(1,46,"ics_info(): max_sfb (short)"));
  854|  15.0k|        ics->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
  855|  15.0k|            DEBUGVAR(1,47,"ics_info(): scale_factor_grouping"));
  856|   118k|    } else {
  857|   118k|        ics->max_sfb = (uint8_t)faad_getbits(ld, 6
  858|   118k|            DEBUGVAR(1,48,"ics_info(): max_sfb (long)"));
  859|   118k|    }
  860|       |
  861|       |    /* get the grouping information */
  862|   133k|    if ((retval = window_grouping_info(hDecoder, ics)) > 0)
  ------------------
  |  Branch (862:9): [True: 66, False: 133k]
  ------------------
  863|     66|        return retval;
  864|       |
  865|       |
  866|       |    /* should be an error */
  867|       |    /* check the range of max_sfb */
  868|   133k|    if (ics->max_sfb > ics->num_swb)
  ------------------
  |  Branch (868:9): [True: 0, False: 133k]
  ------------------
  869|      0|        return 16;
  870|       |
  871|   133k|    if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|   133k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (871:9): [True: 118k, False: 15.0k]
  ------------------
  872|   118k|    {
  873|   118k|        if ((ics->predictor_data_present = faad_get1bit(ld
  ------------------
  |  Branch (873:13): [True: 9.11k, False: 109k]
  ------------------
  874|   118k|            DEBUGVAR(1,49,"ics_info(): predictor_data_present"))) & 1)
  875|  9.11k|        {
  876|  9.11k|            if (hDecoder->object_type == MAIN) /* MPEG2 style AAC predictor */
  ------------------
  |  |   40|  9.11k|#define MAIN       1
  ------------------
  |  Branch (876:17): [True: 2.24k, False: 6.87k]
  ------------------
  877|  2.24k|            {
  878|  2.24k|                uint8_t sfb;
  879|  2.24k|                uint8_t predictor_reset, predictor_reset_group_number, prediction_used;
  880|  2.24k|                uint8_t limit = min(ics->max_sfb, max_pred_sfb(hDecoder->sf_index));
  ------------------
  |  |   60|  2.24k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 2.20k, False: 39]
  |  |  ------------------
  ------------------
  881|       |
  882|  2.24k|                predictor_reset = faad_get1bit(ld DEBUGVAR(1,53,"ics_info(): pred.predictor_reset"));
  883|  2.24k|                if (predictor_reset)
  ------------------
  |  Branch (883:21): [True: 2.03k, False: 210]
  ------------------
  884|  2.03k|                {
  885|  2.03k|                    predictor_reset_group_number =
  886|  2.03k|                        (uint8_t)faad_getbits(ld, 5 DEBUGVAR(1,54,"ics_info(): pred.predictor_reset_group_number"));
  887|  2.03k|                } else {
  888|    210|                    predictor_reset_group_number = 0;
  889|    210|                }
  890|       |
  891|  11.9k|                for (sfb = 0; sfb < limit; sfb++)
  ------------------
  |  Branch (891:31): [True: 9.73k, False: 2.24k]
  ------------------
  892|  9.73k|                {
  893|  9.73k|                    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|  9.73k|                }
  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.24k|                (void)predictor_reset_group_number;
  904|  2.24k|                (void)prediction_used;
  905|  2.24k|#endif
  906|  2.24k|            }
  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|  9.11k|            (void)common_window;
  947|  9.11k|#endif  /* LTP_DEC */
  948|  9.11k|        }
  949|   118k|    }
  950|       |
  951|   133k|    return retval;
  952|   133k|}
syntax.c:data_stream_element:
 1081|   406k|{
 1082|   406k|    uint8_t byte_aligned;
 1083|   406k|    uint16_t i, count;
 1084|   406k|    (void)hDecoder;  /* TODO: remove parameter; rename method; why result is unused? */
 1085|       |
 1086|   406k|    /* element_instance_tag = */ faad_getbits(ld, LEN_TAG
  ------------------
  |  |   76|   406k|#define LEN_TAG   4
  ------------------
 1087|   406k|        DEBUGVAR(1,60,"data_stream_element(): element_instance_tag"));
 1088|   406k|    byte_aligned = faad_get1bit(ld
 1089|   406k|        DEBUGVAR(1,61,"data_stream_element(): byte_aligned"));
 1090|   406k|    count = (uint16_t)faad_getbits(ld, 8
 1091|   406k|        DEBUGVAR(1,62,"data_stream_element(): count"));
 1092|   406k|    if (count == 255)
  ------------------
  |  Branch (1092:9): [True: 2.99k, False: 403k]
  ------------------
 1093|  2.99k|    {
 1094|  2.99k|        count += (uint16_t)faad_getbits(ld, 8
 1095|  2.99k|            DEBUGVAR(1,63,"data_stream_element(): extra count"));
 1096|  2.99k|    }
 1097|   406k|    if (byte_aligned)
  ------------------
  |  Branch (1097:9): [True: 103k, False: 303k]
  ------------------
 1098|   103k|        faad_byte_align(ld);
 1099|       |
 1100|  20.4M|    for (i = 0; i < count; i++)
  ------------------
  |  Branch (1100:17): [True: 20.0M, False: 406k]
  ------------------
 1101|  20.0M|    {
 1102|  20.0M|        faad_getbits(ld, LEN_BYTE
  ------------------
  |  |   77|  20.0M|#define LEN_BYTE  8
  ------------------
 1103|  20.0M|            DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
 1104|  20.0M|    }
 1105|       |
 1106|   406k|    return count;
 1107|   406k|}
syntax.c:fill_element:
 1115|  27.5k|{
 1116|  27.5k|    uint16_t count;
 1117|  27.5k|#ifdef SBR_DEC
 1118|  27.5k|    uint8_t bs_extension_type;
 1119|  27.5k|#endif
 1120|       |
 1121|  27.5k|    count = (uint16_t)faad_getbits(ld, 4
 1122|  27.5k|        DEBUGVAR(1,65,"fill_element(): count"));
 1123|  27.5k|    if (count == 15)
  ------------------
  |  Branch (1123:9): [True: 2.99k, False: 24.6k]
  ------------------
 1124|  2.99k|    {
 1125|  2.99k|        count += (uint16_t)faad_getbits(ld, 8
 1126|  2.99k|            DEBUGVAR(1,66,"fill_element(): extra count")) - 1;
 1127|  2.99k|    }
 1128|       |
 1129|  27.5k|    if (count > 0)
  ------------------
  |  Branch (1129:9): [True: 25.6k, False: 1.90k]
  ------------------
 1130|  25.6k|    {
 1131|  25.6k|#ifdef SBR_DEC
 1132|  25.6k|        bs_extension_type = (uint8_t)faad_showbits(ld, 4);
 1133|       |
 1134|  25.6k|        if ((bs_extension_type == EXT_SBR_DATA) ||
  ------------------
  |  |   43|  25.6k|#define EXT_SBR_DATA     13
  ------------------
  |  Branch (1134:13): [True: 16.7k, False: 8.89k]
  ------------------
 1135|  8.89k|            (bs_extension_type == EXT_SBR_DATA_CRC))
  ------------------
  |  |   44|  8.89k|#define EXT_SBR_DATA_CRC 14
  ------------------
  |  Branch (1135:13): [True: 8.78k, False: 117]
  ------------------
 1136|  25.5k|        {
 1137|  25.5k|            if (sbr_ele == INVALID_SBR_ELEMENT)
  ------------------
  |  |  110|  25.5k|#define INVALID_SBR_ELEMENT 255
  ------------------
  |  Branch (1137:17): [True: 27, False: 25.5k]
  ------------------
 1138|     27|                return 24;
 1139|       |
 1140|  25.5k|            if (!hDecoder->sbr[sbr_ele])
  ------------------
  |  Branch (1140:17): [True: 21.6k, False: 3.91k]
  ------------------
 1141|  21.6k|            {
 1142|  21.6k|                hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength,
 1143|  21.6k|                    hDecoder->element_id[sbr_ele], 2*get_sample_rate(hDecoder->sf_index),
 1144|  21.6k|                    hDecoder->downSampledSBR
 1145|  21.6k|#ifdef DRM
 1146|  21.6k|                    , 0
 1147|  21.6k|#endif
 1148|  21.6k|                    );
 1149|  21.6k|            }
 1150|  25.5k|            if (!hDecoder->sbr[sbr_ele])
  ------------------
  |  Branch (1150:17): [True: 0, False: 25.5k]
  ------------------
 1151|      0|                return 19;
 1152|       |
 1153|  25.5k|            hDecoder->sbr_present_flag = 1;
 1154|       |
 1155|       |            /* parse the SBR data */
 1156|  25.5k|            hDecoder->sbr[sbr_ele]->ret = sbr_extension_data(ld, hDecoder->sbr[sbr_ele], count,
 1157|  25.5k|                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|  25.5k|#if (defined(PS_DEC) || defined(DRM_PS))
 1167|  25.5k|            if (hDecoder->sbr[sbr_ele]->ps_used)
  ------------------
  |  Branch (1167:17): [True: 3.96k, False: 21.5k]
  ------------------
 1168|  3.96k|            {
 1169|  3.96k|                hDecoder->ps_used[sbr_ele] = 1;
 1170|       |
 1171|       |                /* set element independent flag to 1 as well */
 1172|  3.96k|                hDecoder->ps_used_global = 1;
 1173|  3.96k|            }
 1174|  25.5k|#endif
 1175|  25.5k|        } else {
 1176|    117|#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|    117|            (void)drc;
 1189|    117|            return 30;
 1190|    117|#endif
 1191|    117|#ifdef SBR_DEC
 1192|    117|        }
 1193|  25.6k|#endif
 1194|  25.6k|    }
 1195|       |
 1196|  27.4k|    return 0;
 1197|  27.5k|}
syntax.c:DRM_aac_scalable_main_header:
 1514|    827|{
 1515|    827|    uint8_t retval = 0;
 1516|    827|    uint8_t ics_reserved_bit;
 1517|       |
 1518|    827|    ics_reserved_bit = faad_get1bit(ld
 1519|    827|        DEBUGVAR(1,300,"aac_scalable_main_header(): ics_reserved_bits"));
 1520|    827|    if (ics_reserved_bit != 0)
  ------------------
  |  Branch (1520:9): [True: 5, False: 822]
  ------------------
 1521|      5|        return 32;
 1522|    822|    ics1->window_sequence = (uint8_t)faad_getbits(ld, 2
 1523|    822|        DEBUGVAR(1,301,"aac_scalable_main_header(): window_sequence"));
 1524|    822|    ics1->window_shape = faad_get1bit(ld
 1525|    822|        DEBUGVAR(1,302,"aac_scalable_main_header(): window_shape"));
 1526|       |
 1527|    822|    if (ics1->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|    822|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1527:9): [True: 148, False: 674]
  ------------------
 1528|    148|    {
 1529|    148|        ics1->max_sfb = (uint8_t)faad_getbits(ld, 4
 1530|    148|            DEBUGVAR(1,303,"aac_scalable_main_header(): max_sfb (short)"));
 1531|    148|        ics1->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
 1532|    148|            DEBUGVAR(1,304,"aac_scalable_main_header(): scale_factor_grouping"));
 1533|    674|    } else {
 1534|    674|        ics1->max_sfb = (uint8_t)faad_getbits(ld, 6
 1535|    674|            DEBUGVAR(1,305,"aac_scalable_main_header(): max_sfb (long)"));
 1536|    674|    }
 1537|       |
 1538|       |    /* get the grouping information */
 1539|    822|    if ((retval = window_grouping_info(hDecoder, ics1)) > 0)
  ------------------
  |  Branch (1539:9): [True: 11, False: 811]
  ------------------
 1540|     11|        return retval;
 1541|       |
 1542|       |    /* should be an error */
 1543|       |    /* check the range of max_sfb */
 1544|    811|    if (ics1->max_sfb > ics1->num_swb)
  ------------------
  |  Branch (1544:9): [True: 0, False: 811]
  ------------------
 1545|      0|        return 16;
 1546|       |
 1547|    811|    if (this_layer_stereo)
  ------------------
  |  Branch (1547:9): [True: 239, False: 572]
  ------------------
 1548|    239|    {
 1549|    239|        ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
 1550|    239|            DEBUGVAR(1,306,"aac_scalable_main_header(): ms_mask_present"));
 1551|    239|        if (ics1->ms_mask_present == 3)
  ------------------
  |  Branch (1551:13): [True: 3, False: 236]
  ------------------
 1552|      3|        {
 1553|       |            /* bitstream error */
 1554|      3|            return 32;
 1555|      3|        }
 1556|    236|        if (ics1->ms_mask_present == 1)
  ------------------
  |  Branch (1556:13): [True: 65, False: 171]
  ------------------
 1557|     65|        {
 1558|     65|            uint8_t g, sfb;
 1559|    259|            for (g = 0; g < ics1->num_window_groups; g++)
  ------------------
  |  Branch (1559:25): [True: 194, False: 65]
  ------------------
 1560|    194|            {
 1561|  1.52k|                for (sfb = 0; sfb < ics1->max_sfb; sfb++)
  ------------------
  |  Branch (1561:31): [True: 1.33k, False: 194]
  ------------------
 1562|  1.33k|                {
 1563|  1.33k|                    ics1->ms_used[g][sfb] = faad_get1bit(ld
 1564|  1.33k|                        DEBUGVAR(1,307,"aac_scalable_main_header(): faad_get1bit"));
 1565|  1.33k|                }
 1566|    194|            }
 1567|     65|        }
 1568|       |
 1569|    236|        memcpy(ics2, ics1, sizeof(ic_stream));
 1570|    572|    } else {
 1571|    572|        ics1->ms_mask_present = 0;
 1572|    572|    }
 1573|       |
 1574|    808|    return 0;
 1575|    811|}
syntax.c:side_info:
 1580|   146k|{
 1581|   146k|    uint8_t result;
 1582|       |
 1583|   146k|    ics->global_gain = (uint8_t)faad_getbits(ld, 8
 1584|   146k|        DEBUGVAR(1,67,"individual_channel_stream(): global_gain"));
 1585|       |
 1586|   146k|    if (!ele->common_window && !scal_flag)
  ------------------
  |  Branch (1586:9): [True: 121k, False: 24.7k]
  |  Branch (1586:32): [True: 121k, False: 0]
  ------------------
 1587|   121k|    {
 1588|   121k|        if ((result = ics_info(hDecoder, ics, ld, ele->common_window)) > 0)
  ------------------
  |  Branch (1588:13): [True: 265, False: 121k]
  ------------------
 1589|    265|            return result;
 1590|   121k|    }
 1591|       |
 1592|   145k|    if ((result = section_data(hDecoder, ics, ld)) > 0)
  ------------------
  |  Branch (1592:9): [True: 606, False: 145k]
  ------------------
 1593|    606|        return result;
 1594|       |
 1595|   145k|    if ((result = scale_factor_data(hDecoder, ics, ld)) > 0)
  ------------------
  |  Branch (1595:9): [True: 10, False: 145k]
  ------------------
 1596|     10|        return result;
 1597|       |
 1598|   145k|    if (!scal_flag)
  ------------------
  |  Branch (1598:9): [True: 144k, False: 887]
  ------------------
 1599|   144k|    {
 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|   144k|        if ((ics->pulse_data_present = faad_get1bit(ld
  ------------------
  |  Branch (1606:13): [True: 5.53k, False: 138k]
  ------------------
 1607|   144k|            DEBUGVAR(1,68,"individual_channel_stream(): pulse_data_present"))) & 1)
 1608|  5.53k|        {
 1609|  5.53k|            if ((result = pulse_data(ics, &(ics->pul), ld)) > 0)
  ------------------
  |  Branch (1609:17): [True: 40, False: 5.49k]
  ------------------
 1610|     40|                return result;
 1611|  5.53k|        }
 1612|       |
 1613|       |        /* get tns data */
 1614|   144k|        if ((ics->tns_data_present = faad_get1bit(ld
  ------------------
  |  Branch (1614:13): [True: 14.7k, False: 129k]
  ------------------
 1615|   144k|            DEBUGVAR(1,69,"individual_channel_stream(): tns_data_present"))) & 1)
 1616|  14.7k|        {
 1617|  14.7k|#ifdef ERROR_RESILIENCE
 1618|  14.7k|            if (hDecoder->object_type < ER_OBJECT_START)
  ------------------
  |  |   71|  14.7k|#define ER_OBJECT_START 17
  ------------------
  |  Branch (1618:17): [True: 14.4k, False: 313]
  ------------------
 1619|  14.4k|#endif
 1620|  14.4k|                tns_data(ics, &(ics->tns), ld);
 1621|  14.7k|        }
 1622|       |
 1623|       |        /* get gain control data */
 1624|   144k|        if ((ics->gain_control_data_present = faad_get1bit(ld
  ------------------
  |  Branch (1624:13): [True: 64, False: 144k]
  ------------------
 1625|   144k|            DEBUGVAR(1,70,"individual_channel_stream(): gain_control_data_present"))) & 1)
 1626|     64|        {
 1627|       |#ifdef SSR_DEC
 1628|       |            if (hDecoder->object_type != SSR)
 1629|       |                return 1;
 1630|       |            else
 1631|       |                gain_control_data(ld, ics);
 1632|       |#else
 1633|     64|            return 1;
 1634|     64|#endif
 1635|     64|        }
 1636|   144k|    }
 1637|       |
 1638|   145k|#ifdef ERROR_RESILIENCE
 1639|   145k|    if (hDecoder->aacSpectralDataResilienceFlag)
  ------------------
  |  Branch (1639:9): [True: 4.55k, False: 140k]
  ------------------
 1640|  4.55k|    {
 1641|  4.55k|        ics->length_of_reordered_spectral_data = (uint16_t)faad_getbits(ld, 14
 1642|  4.55k|            DEBUGVAR(1,147,"individual_channel_stream(): length_of_reordered_spectral_data"));
 1643|       |
 1644|  4.55k|        if (hDecoder->channelConfiguration == 2)
  ------------------
  |  Branch (1644:13): [True: 745, False: 3.81k]
  ------------------
 1645|    745|        {
 1646|    745|            if (ics->length_of_reordered_spectral_data > 6144)
  ------------------
  |  Branch (1646:17): [True: 67, False: 678]
  ------------------
 1647|     67|                ics->length_of_reordered_spectral_data = 6144;
 1648|  3.81k|        } else {
 1649|  3.81k|            if (ics->length_of_reordered_spectral_data > 12288)
  ------------------
  |  Branch (1649:17): [True: 100, False: 3.71k]
  ------------------
 1650|    100|                ics->length_of_reordered_spectral_data = 12288;
 1651|  3.81k|        }
 1652|       |
 1653|  4.55k|        ics->length_of_longest_codeword = (uint8_t)faad_getbits(ld, 6
 1654|  4.55k|            DEBUGVAR(1,148,"individual_channel_stream(): length_of_longest_codeword"));
 1655|  4.55k|        if (ics->length_of_longest_codeword >= 49)
  ------------------
  |  Branch (1655:13): [True: 205, False: 4.35k]
  ------------------
 1656|    205|            ics->length_of_longest_codeword = 49;
 1657|  4.55k|    }
 1658|       |
 1659|       |    /* RVLC spectral data is put here */
 1660|   145k|    if (hDecoder->aacScalefactorDataResilienceFlag)
  ------------------
  |  Branch (1660:9): [True: 6.62k, False: 138k]
  ------------------
 1661|  6.62k|    {
 1662|  6.62k|        if ((result = rvlc_decode_scale_factors(ics, ld)) > 0)
  ------------------
  |  Branch (1662:13): [True: 23, False: 6.59k]
  ------------------
 1663|     23|            return result;
 1664|  6.62k|    }
 1665|   145k|#endif
 1666|       |
 1667|   145k|    return 0;
 1668|   145k|}
syntax.c:section_data:
 1732|   145k|{
 1733|   145k|    uint8_t g;
 1734|   145k|    uint8_t sect_esc_val, sect_bits;
 1735|   145k|    uint8_t sect_lim; /* 51 or 120, anyways less than 127. */
 1736|       |
 1737|   145k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) {
  ------------------
  |  |   98|   145k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (1737:9): [True: 16.4k, False: 129k]
  ------------------
 1738|  16.4k|        sect_bits = 3;
 1739|  16.4k|        sect_lim = 8 * 15;
 1740|   129k|    } else {
 1741|   129k|        sect_bits = 5;
 1742|   129k|        sect_lim = MAX_SFB;
  ------------------
  |  |   46|   129k|#define MAX_SFB             51
  ------------------
 1743|   129k|    }
 1744|   145k|    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|   380k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (1751:17): [True: 235k, False: 145k]
  ------------------
 1752|   235k|    {
 1753|   235k|        uint8_t k = 0;
 1754|   235k|        uint8_t i = 0;
 1755|       |
 1756|   303k|        while (k < ics->max_sfb)
  ------------------
  |  Branch (1756:16): [True: 69.1k, False: 234k]
  ------------------
 1757|  69.1k|        {
 1758|  69.1k|#ifdef ERROR_RESILIENCE
 1759|  69.1k|            uint8_t vcb11 = 0;
 1760|  69.1k|#endif
 1761|  69.1k|            uint8_t sfb;
 1762|  69.1k|            uint8_t sect_len_incr;
 1763|  69.1k|            uint8_t sect_len = 0;
 1764|  69.1k|            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|  69.1k|            if (ld->error != 0)
  ------------------
  |  Branch (1768:17): [True: 0, False: 69.1k]
  ------------------
 1769|      0|                return 14;
 1770|  69.1k|            if (i >= sect_lim)
  ------------------
  |  Branch (1770:17): [True: 349, False: 68.8k]
  ------------------
 1771|    349|                return 15;
 1772|       |
 1773|  68.8k|#ifdef ERROR_RESILIENCE
 1774|  68.8k|            if (hDecoder->aacSectionDataResilienceFlag)
  ------------------
  |  Branch (1774:17): [True: 17.6k, False: 51.2k]
  ------------------
 1775|  17.6k|                sect_cb_bits = 5;
 1776|  68.8k|#endif
 1777|       |
 1778|  68.8k|            ics->sect_cb[g][i] = (uint8_t)faad_getbits(ld, sect_cb_bits
 1779|  68.8k|                DEBUGVAR(1,71,"section_data(): sect_cb"));
 1780|       |
 1781|  68.8k|            if (ics->sect_cb[g][i] == 12)
  ------------------
  |  Branch (1781:17): [True: 66, False: 68.7k]
  ------------------
 1782|     66|                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|  68.7k|            if (ics->sect_cb[g][i] == NOISE_HCB)
  ------------------
  |  |  106|  68.7k|#define NOISE_HCB      13
  ------------------
  |  Branch (1793:17): [True: 11, False: 68.7k]
  ------------------
 1794|     11|                return 29;
 1795|  68.7k|#endif
 1796|  68.7k|            if (ics->sect_cb[g][i] == INTENSITY_HCB2 || ics->sect_cb[g][i] == INTENSITY_HCB)
  ------------------
  |  |  107|   137k|#define INTENSITY_HCB2 14
  ------------------
                          if (ics->sect_cb[g][i] == INTENSITY_HCB2 || ics->sect_cb[g][i] == INTENSITY_HCB)
  ------------------
  |  |  108|  68.1k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (1796:17): [True: 628, False: 68.1k]
  |  Branch (1796:57): [True: 1.19k, False: 66.9k]
  ------------------
 1797|  1.82k|                ics->is_used = 1;
 1798|       |
 1799|  68.7k|#ifdef ERROR_RESILIENCE
 1800|  68.7k|            if (hDecoder->aacSectionDataResilienceFlag)
  ------------------
  |  Branch (1800:17): [True: 17.6k, False: 51.1k]
  ------------------
 1801|  17.6k|            {
 1802|  17.6k|                if ((ics->sect_cb[g][i] == 11) ||
  ------------------
  |  Branch (1802:21): [True: 259, False: 17.3k]
  ------------------
 1803|  17.3k|                    ((ics->sect_cb[g][i] >= 16) && (ics->sect_cb[g][i] <= 32)))
  ------------------
  |  Branch (1803:22): [True: 4.15k, False: 13.2k]
  |  Branch (1803:52): [True: 4.15k, False: 0]
  ------------------
 1804|  4.41k|                {
 1805|  4.41k|                    vcb11 = 1;
 1806|  4.41k|                }
 1807|  17.6k|            }
 1808|  68.7k|            if (vcb11)
  ------------------
  |  Branch (1808:17): [True: 4.41k, False: 64.3k]
  ------------------
 1809|  4.41k|            {
 1810|  4.41k|                sect_len_incr = 1;
 1811|  64.3k|            } else {
 1812|  64.3k|#endif
 1813|  64.3k|                sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
 1814|  64.3k|                    DEBUGVAR(1,72,"section_data(): sect_len_incr"));
 1815|  64.3k|#ifdef ERROR_RESILIENCE
 1816|  64.3k|            }
 1817|  68.7k|#endif
 1818|  69.4k|            while (sect_len_incr == sect_esc_val /* &&
  ------------------
  |  Branch (1818:20): [True: 673, False: 68.7k]
  ------------------
 1819|  68.7k|                (k+sect_len < ics->max_sfb)*/)
 1820|    673|            {
 1821|    673|                sect_len += sect_len_incr;
 1822|    673|                if (sect_len > sect_lim)
  ------------------
  |  Branch (1822:21): [True: 11, False: 662]
  ------------------
 1823|     11|                    return 15;
 1824|    662|                sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
 1825|    662|                    DEBUGVAR(1,72,"section_data(): sect_len_incr"));
 1826|    662|            }
 1827|       |
 1828|  68.7k|            sect_len += sect_len_incr;
 1829|       |
 1830|  68.7k|            ics->sect_start[g][i] = k;
 1831|  68.7k|            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|  68.7k|            if (sect_len > sect_lim)
  ------------------
  |  Branch (1840:17): [True: 13, False: 68.7k]
  ------------------
 1841|     13|                return 15;
 1842|  68.7k|            if (k + sect_len > sect_lim)
  ------------------
  |  Branch (1842:17): [True: 9, False: 68.7k]
  ------------------
 1843|      9|                return 15;
 1844|       |
 1845|   216k|            for (sfb = k; sfb < k + sect_len; sfb++)
  ------------------
  |  Branch (1845:27): [True: 147k, False: 68.7k]
  ------------------
 1846|   147k|            {
 1847|   147k|                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|   147k|            }
 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|  68.7k|            k += sect_len; /* k <= sect_lim */
 1861|  68.7k|            i++;
 1862|  68.7k|        }
 1863|   234k|        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|   234k|        if (k != ics->max_sfb)
  ------------------
  |  Branch (1867:13): [True: 147, False: 234k]
  ------------------
 1868|    147|        {
 1869|    147|            return 32;
 1870|    147|        }
 1871|       |#if 0
 1872|       |        printf("%d\n", ics->num_sec[g]);
 1873|       |#endif
 1874|   234k|    }
 1875|       |
 1876|       |#if 0
 1877|       |    printf("\n");
 1878|       |#endif
 1879|       |
 1880|   145k|    return 0;
 1881|   145k|}
syntax.c:scale_factor_data:
 1989|   145k|{
 1990|   145k|    uint8_t ret = 0;
 1991|       |#ifdef PROFILE
 1992|       |    int64_t count = faad_get_ts();
 1993|       |#endif
 1994|       |
 1995|   145k|#ifdef ERROR_RESILIENCE
 1996|   145k|    if (!hDecoder->aacScalefactorDataResilienceFlag)
  ------------------
  |  Branch (1996:9): [True: 138k, False: 6.62k]
  ------------------
 1997|   138k|    {
 1998|   138k|#endif
 1999|   138k|        ret = decode_scale_factors(ics, ld);
 2000|   138k|#ifdef ERROR_RESILIENCE
 2001|   138k|    } 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|  6.62k|        ret = rvlc_scale_factor_data(ics, ld);
 2007|  6.62k|    }
 2008|   145k|#endif
 2009|       |
 2010|       |#ifdef PROFILE
 2011|       |    count = faad_get_ts() - count;
 2012|       |    hDecoder->scalefac_cycles += count;
 2013|       |#endif
 2014|       |
 2015|   145k|    return ret;
 2016|   145k|}
syntax.c:decode_scale_factors:
 1895|   138k|{
 1896|   138k|    uint8_t g, sfb;
 1897|   138k|    int16_t t;
 1898|       |
 1899|   138k|    int16_t scale_factor = ics->global_gain;
 1900|   138k|    int16_t is_position = 0;
 1901|   138k|    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|   364k|    for (g = 0; g < ics->num_window_groups; g++)
  ------------------
  |  Branch (1914:17): [True: 225k, False: 138k]
  ------------------
 1915|   225k|    {
 1916|   351k|        for (sfb = 0; sfb < ics->max_sfb; sfb++)
  ------------------
  |  Branch (1916:23): [True: 126k, False: 225k]
  ------------------
 1917|   126k|        {
 1918|   126k|            switch (ics->sfb_cb[g][sfb])
 1919|   126k|            {
 1920|  86.3k|            case ZERO_HCB: /* zero book */
  ------------------
  |  |  101|  86.3k|#define ZERO_HCB       0
  ------------------
  |  Branch (1920:13): [True: 86.3k, False: 40.1k]
  ------------------
 1921|  86.3k|                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|  86.3k|                break;
 1927|  5.10k|            case INTENSITY_HCB: /* intensity books */
  ------------------
  |  |  108|  5.10k|#define INTENSITY_HCB  15
  ------------------
  |  Branch (1927:13): [True: 5.10k, False: 121k]
  ------------------
 1928|  6.79k|            case INTENSITY_HCB2:
  ------------------
  |  |  107|  6.79k|#define INTENSITY_HCB2 14
  ------------------
  |  Branch (1928:13): [True: 1.69k, False: 124k]
  ------------------
 1929|       |
 1930|       |                /* decode intensity position */
 1931|  6.79k|                t = huffman_scale_factor(ld);
 1932|  6.79k|                is_position += (t - 60);
 1933|  6.79k|                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.79k|                break;
 1939|      0|            case NOISE_HCB: /* noise books */
  ------------------
  |  |  106|      0|#define NOISE_HCB      13
  ------------------
  |  Branch (1939:13): [True: 0, False: 126k]
  ------------------
 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|  33.3k|            default: /* spectral books */
  ------------------
  |  Branch (1963:13): [True: 33.3k, False: 93.1k]
  ------------------
 1964|       |
 1965|       |                /* ics->scale_factors[g][sfb] must be between 0 and 255 */
 1966|       |
 1967|  33.3k|                ics->scale_factors[g][sfb] = 0;
 1968|       |
 1969|       |                /* decode scale factor */
 1970|  33.3k|                t = huffman_scale_factor(ld);
 1971|  33.3k|                scale_factor += (t - 60);
 1972|  33.3k|                if (scale_factor < 0 || scale_factor > 255)
  ------------------
  |  Branch (1972:21): [True: 7, False: 33.3k]
  |  Branch (1972:41): [True: 3, False: 33.3k]
  ------------------
 1973|     10|                    return 4;
 1974|  33.3k|                ics->scale_factors[g][sfb] = min(scale_factor, scale_factor_max);
  ------------------
  |  |   60|  33.3k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 32.7k, False: 597]
  |  |  ------------------
  ------------------
 1975|       |#ifdef SF_PRINT
 1976|       |                printf("%d\n", ics->scale_factors[g][sfb]);
 1977|       |#endif
 1978|       |
 1979|  33.3k|                break;
 1980|   126k|            }
 1981|   126k|        }
 1982|   225k|    }
 1983|       |
 1984|   138k|    return 0;
 1985|   138k|}
syntax.c:pulse_data:
  956|  5.53k|{
  957|  5.53k|    uint8_t i;
  958|       |
  959|  5.53k|    pul->number_pulse = (uint8_t)faad_getbits(ld, 2
  960|  5.53k|        DEBUGVAR(1,56,"pulse_data(): number_pulse"));
  961|  5.53k|    pul->pulse_start_sfb = (uint8_t)faad_getbits(ld, 6
  962|  5.53k|        DEBUGVAR(1,57,"pulse_data(): pulse_start_sfb"));
  963|       |
  964|       |    /* check the range of pulse_start_sfb */
  965|  5.53k|    if (pul->pulse_start_sfb > ics->num_swb)
  ------------------
  |  Branch (965:9): [True: 40, False: 5.49k]
  ------------------
  966|     40|        return 16;
  967|       |
  968|  13.3k|    for (i = 0; i < pul->number_pulse+1; i++)
  ------------------
  |  Branch (968:17): [True: 7.81k, False: 5.49k]
  ------------------
  969|  7.81k|    {
  970|  7.81k|        pul->pulse_offset[i] = (uint8_t)faad_getbits(ld, 5
  971|  7.81k|            DEBUGVAR(1,58,"pulse_data(): pulse_offset"));
  972|       |#if 0
  973|       |        printf("%d\n", pul->pulse_offset[i]);
  974|       |#endif
  975|  7.81k|        pul->pulse_amp[i] = (uint8_t)faad_getbits(ld, 4
  976|  7.81k|            DEBUGVAR(1,59,"pulse_data(): pulse_amp"));
  977|       |#if 0
  978|       |        printf("%d\n", pul->pulse_amp[i]);
  979|       |#endif
  980|  7.81k|    }
  981|       |
  982|  5.49k|    return 0;
  983|  5.53k|}
syntax.c:tns_data:
 2020|  14.9k|{
 2021|  14.9k|    uint8_t w, filt, i, coef_bits;
 2022|  14.9k|    uint8_t n_filt_bits = 2;
 2023|  14.9k|    uint8_t length_bits = 6;
 2024|  14.9k|    uint8_t order_bits = 5;
 2025|       |
 2026|  14.9k|    if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
  ------------------
  |  |   98|  14.9k|#define EIGHT_SHORT_SEQUENCE 0x2
  ------------------
  |  Branch (2026:9): [True: 1.33k, False: 13.6k]
  ------------------
 2027|  1.33k|    {
 2028|  1.33k|        n_filt_bits = 1;
 2029|  1.33k|        length_bits = 4;
 2030|  1.33k|        order_bits = 3;
 2031|  1.33k|    }
 2032|       |
 2033|  39.1k|    for (w = 0; w < ics->num_windows; w++)
  ------------------
  |  Branch (2033:17): [True: 24.2k, False: 14.9k]
  ------------------
 2034|  24.2k|    {
 2035|  24.2k|        uint8_t start_coef_bits = 3;
 2036|  24.2k|        tns->n_filt[w] = (uint8_t)faad_getbits(ld, n_filt_bits
 2037|  24.2k|            DEBUGVAR(1,74,"tns_data(): n_filt"));
 2038|       |#if 0
 2039|       |        printf("%d\n", tns->n_filt[w]);
 2040|       |#endif
 2041|       |
 2042|  24.2k|        if (tns->n_filt[w])
  ------------------
  |  Branch (2042:13): [True: 8.71k, False: 15.5k]
  ------------------
 2043|  8.71k|        {
 2044|  8.71k|            if ((tns->coef_res[w] = faad_get1bit(ld
  ------------------
  |  Branch (2044:17): [True: 2.96k, False: 5.75k]
  ------------------
 2045|  8.71k|                DEBUGVAR(1,75,"tns_data(): coef_res"))) & 1)
 2046|  2.96k|                start_coef_bits = 4;
 2047|       |#if 0
 2048|       |            printf("%d\n", tns->coef_res[w]);
 2049|       |#endif
 2050|  8.71k|        }
 2051|       |
 2052|  36.1k|        for (filt = 0; filt < tns->n_filt[w]; filt++)
  ------------------
  |  Branch (2052:24): [True: 11.8k, False: 24.2k]
  ------------------
 2053|  11.8k|        {
 2054|  11.8k|            tns->length[w][filt] = (uint8_t)faad_getbits(ld, length_bits
 2055|  11.8k|                DEBUGVAR(1,76,"tns_data(): length"));
 2056|       |#if 0
 2057|       |            printf("%d\n", tns->length[w][filt]);
 2058|       |#endif
 2059|  11.8k|            tns->order[w][filt]  = (uint8_t)faad_getbits(ld, order_bits
 2060|  11.8k|                DEBUGVAR(1,77,"tns_data(): order"));
 2061|       |#if 0
 2062|       |            printf("%d\n", tns->order[w][filt]);
 2063|       |#endif
 2064|  11.8k|            if (tns->order[w][filt])
  ------------------
  |  Branch (2064:17): [True: 5.66k, False: 6.18k]
  ------------------
 2065|  5.66k|            {
 2066|  5.66k|                tns->direction[w][filt] = faad_get1bit(ld
 2067|  5.66k|                    DEBUGVAR(1,78,"tns_data(): direction"));
 2068|       |#if 0
 2069|       |                printf("%d\n", tns->direction[w][filt]);
 2070|       |#endif
 2071|  5.66k|                tns->coef_compress[w][filt] = faad_get1bit(ld
 2072|  5.66k|                    DEBUGVAR(1,79,"tns_data(): coef_compress"));
 2073|       |#if 0
 2074|       |                printf("%d\n", tns->coef_compress[w][filt]);
 2075|       |#endif
 2076|       |
 2077|  5.66k|                coef_bits = start_coef_bits - tns->coef_compress[w][filt];
 2078|  31.2k|                for (i = 0; i < tns->order[w][filt]; i++)
  ------------------
  |  Branch (2078:29): [True: 25.5k, False: 5.66k]
  ------------------
 2079|  25.5k|                {
 2080|  25.5k|                    tns->coef[w][filt][i] = (uint8_t)faad_getbits(ld, coef_bits
 2081|  25.5k|                        DEBUGVAR(1,80,"tns_data(): coef"));
 2082|       |#if 0
 2083|       |                    printf("%d\n", tns->coef[w][filt][i]);
 2084|       |#endif
 2085|  25.5k|                }
 2086|  5.66k|            }
 2087|  11.8k|        }
 2088|  24.2k|    }
 2089|  14.9k|}
syntax.c:adts_fixed_header:
 2462|  5.41k|{
 2463|  5.41k|    uint16_t i;
 2464|  5.41k|    uint8_t sync_err = 1;
 2465|       |
 2466|       |    /* try to recover from sync errors */
 2467|  4.03M|    for (i = 0; i < 768; i++)
  ------------------
  |  Branch (2467:17): [True: 4.02M, False: 5.24k]
  ------------------
 2468|  4.02M|    {
 2469|  4.02M|        adts->syncword = (uint16_t)faad_showbits(ld, 12);
 2470|  4.02M|        if (adts->syncword != 0xFFF)
  ------------------
  |  Branch (2470:13): [True: 4.02M, False: 177]
  ------------------
 2471|  4.02M|        {
 2472|  4.02M|            faad_getbits(ld, 8
 2473|  4.02M|                DEBUGVAR(0,0,""));
 2474|  4.02M|        } else {
 2475|    177|            sync_err = 0;
 2476|    177|            faad_getbits(ld, 12
 2477|    177|                DEBUGVAR(1,118,"adts_fixed_header(): syncword"));
 2478|    177|            break;
 2479|    177|        }
 2480|  4.02M|    }
 2481|  5.41k|    if (sync_err)
  ------------------
  |  Branch (2481:9): [True: 5.24k, False: 177]
  ------------------
 2482|  5.24k|        return 5;
 2483|       |
 2484|    177|    adts->id = faad_get1bit(ld
 2485|    177|        DEBUGVAR(1,119,"adts_fixed_header(): id"));
 2486|    177|    adts->layer = (uint8_t)faad_getbits(ld, 2
 2487|    177|        DEBUGVAR(1,120,"adts_fixed_header(): layer"));
 2488|    177|    adts->protection_absent = faad_get1bit(ld
 2489|    177|        DEBUGVAR(1,121,"adts_fixed_header(): protection_absent"));
 2490|    177|    adts->profile = (uint8_t)faad_getbits(ld, 2
 2491|    177|        DEBUGVAR(1,122,"adts_fixed_header(): profile"));
 2492|    177|    adts->sf_index = (uint8_t)faad_getbits(ld, 4
 2493|    177|        DEBUGVAR(1,123,"adts_fixed_header(): sf_index"));
 2494|    177|    adts->private_bit = faad_get1bit(ld
 2495|    177|        DEBUGVAR(1,124,"adts_fixed_header(): private_bit"));
 2496|    177|    adts->channel_configuration = (uint8_t)faad_getbits(ld, 3
 2497|    177|        DEBUGVAR(1,125,"adts_fixed_header(): channel_configuration"));
 2498|    177|    adts->original = faad_get1bit(ld
 2499|    177|        DEBUGVAR(1,126,"adts_fixed_header(): original"));
 2500|    177|    adts->home = faad_get1bit(ld
 2501|    177|        DEBUGVAR(1,127,"adts_fixed_header(): home"));
 2502|       |
 2503|    177|    if (adts->old_format == 1)
  ------------------
  |  Branch (2503:9): [True: 0, False: 177]
  ------------------
 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|    177|    return 0;
 2514|  5.41k|}
syntax.c:adts_variable_header:
 2518|    177|{
 2519|    177|    adts->copyright_identification_bit = faad_get1bit(ld
 2520|    177|        DEBUGVAR(1,129,"adts_variable_header(): copyright_identification_bit"));
 2521|    177|    adts->copyright_identification_start = faad_get1bit(ld
 2522|    177|        DEBUGVAR(1,130,"adts_variable_header(): copyright_identification_start"));
 2523|    177|    adts->aac_frame_length = (uint16_t)faad_getbits(ld, 13
 2524|    177|        DEBUGVAR(1,131,"adts_variable_header(): aac_frame_length"));
 2525|    177|    adts->adts_buffer_fullness = (uint16_t)faad_getbits(ld, 11
 2526|    177|        DEBUGVAR(1,132,"adts_variable_header(): adts_buffer_fullness"));
 2527|    177|    adts->no_raw_data_blocks_in_frame = (uint8_t)faad_getbits(ld, 2
 2528|    177|        DEBUGVAR(1,133,"adts_variable_header(): no_raw_data_blocks_in_frame"));
 2529|    177|}
syntax.c:adts_error_check:
 2533|    177|{
 2534|    177|    if (adts->protection_absent == 0)
  ------------------
  |  Branch (2534:9): [True: 58, False: 119]
  ------------------
 2535|     58|    {
 2536|     58|        adts->crc_check = (uint16_t)faad_getbits(ld, 16
 2537|     58|            DEBUGVAR(1,134,"adts_error_check(): crc_check"));
 2538|     58|    }
 2539|    177|}

tns_decode_frame:
   86|   144k|{
   87|   144k|    uint8_t w, f, tns_order;
   88|   144k|    int8_t inc;
   89|   144k|    int16_t size;
   90|   144k|    uint16_t bottom, top, start, end;
   91|   144k|    uint16_t nshort = frame_len/8;
   92|   144k|    real_t lpc[TNS_MAX_ORDER+1];
   93|   144k|    uint8_t exp;
   94|       |
   95|   144k|    if (!ics->tns_data_present)
  ------------------
  |  Branch (95:9): [True: 129k, False: 14.6k]
  ------------------
   96|   129k|        return;
   97|       |
   98|  38.0k|    for (w = 0; w < ics->num_windows; w++)
  ------------------
  |  Branch (98:17): [True: 23.3k, False: 14.6k]
  ------------------
   99|  23.3k|    {
  100|  23.3k|        bottom = ics->num_swb;
  101|       |
  102|  34.9k|        for (f = 0; f < tns->n_filt[w]; f++)
  ------------------
  |  Branch (102:21): [True: 11.5k, False: 23.3k]
  ------------------
  103|  11.5k|        {
  104|  11.5k|            top = bottom;
  105|  11.5k|            bottom = max(top - tns->length[w][f], 0);
  ------------------
  |  |   57|  11.5k|#define max(a, b) (((a) > (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (57:20): [True: 7.43k, False: 4.08k]
  |  |  ------------------
  ------------------
  106|  11.5k|            tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
  ------------------
  |  |   60|  11.5k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 11.2k, False: 224]
  |  |  ------------------
  ------------------
  107|  11.5k|            if (!tns_order)
  ------------------
  |  Branch (107:17): [True: 6.13k, False: 5.37k]
  ------------------
  108|  6.13k|                continue;
  109|       |
  110|  5.37k|            exp = tns_decode_coef(tns_order, tns->coef_res[w]+3,
  111|  5.37k|                tns->coef_compress[w][f], tns->coef[w][f], lpc);
  112|       |
  113|  5.37k|            start = min(bottom, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
  ------------------
  |  |   60|  5.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 4.64k, False: 735]
  |  |  ------------------
  ------------------
  114|  5.37k|            start = min(start, ics->max_sfb);
  ------------------
  |  |   60|  5.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 306, False: 5.07k]
  |  |  ------------------
  ------------------
  115|  5.37k|            start = min(ics->swb_offset[start], ics->swb_offset_max);
  ------------------
  |  |   60|  5.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 5.36k, False: 19]
  |  |  ------------------
  ------------------
  116|       |
  117|  5.37k|            end = min(top, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
  ------------------
  |  |   60|  5.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 2.28k, False: 3.09k]
  |  |  ------------------
  ------------------
  118|  5.37k|            end = min(end, ics->max_sfb);
  ------------------
  |  |   60|  5.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 85, False: 5.29k]
  |  |  ------------------
  ------------------
  119|  5.37k|            end = min(ics->swb_offset[end], ics->swb_offset_max);
  ------------------
  |  |   60|  5.37k|#define min(a, b) (((a) < (b)) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (60:20): [True: 5.32k, False: 53]
  |  |  ------------------
  ------------------
  120|       |
  121|  5.37k|            size = end - start;
  122|  5.37k|            if (size <= 0)
  ------------------
  |  Branch (122:17): [True: 5.12k, False: 256]
  ------------------
  123|  5.12k|                continue;
  124|       |
  125|    256|            if (tns->direction[w][f])
  ------------------
  |  Branch (125:17): [True: 154, False: 102]
  ------------------
  126|    154|            {
  127|    154|                inc = -1;
  128|    154|                start = end - 1;
  129|    154|            } else {
  130|    102|                inc = 1;
  131|    102|            }
  132|       |
  133|    256|            tns_ar_filter(&spec[(w*nshort)+start], size, inc, lpc, tns_order, exp);
  134|    256|        }
  135|  23.3k|    }
  136|  14.6k|}
tns.c:tns_decode_coef:
  196|  5.37k|{
  197|  5.37k|    uint8_t i, m;
  198|  5.37k|    real_t tmp2[TNS_MAX_ORDER+1], b[TNS_MAX_ORDER+1];
  199|  5.37k|    uint8_t table_index = 2 * (coef_compress != 0) + (coef_res_bits != 3);
  200|  5.37k|    real_t* tns_coef = all_tns_coefs[table_index];
  201|  5.37k|    uint8_t exp = 0;
  202|       |
  203|       |    /* Conversion to signed integer */
  204|  27.2k|    for (i = 0; i < order; i++)
  ------------------
  |  Branch (204:17): [True: 21.8k, False: 5.37k]
  ------------------
  205|  21.8k|        tmp2[i] = tns_coef[coef[i]];
  206|       |
  207|       |    /* Conversion to LPC coefficients */
  208|  5.37k|    a[0] = COEF_CONST(1.0);
  ------------------
  |  |  289|  5.37k|  #define COEF_CONST(A) ((real_t)(A))
  ------------------
  209|  27.2k|    for (m = 1; m <= order; m++)
  ------------------
  |  Branch (209:17): [True: 21.8k, False: 5.37k]
  ------------------
  210|  21.8k|    {
  211|  21.8k|        a[m] = tmp2[m-1]; /* changed */
  212|   101k|        for (i = 1; i < m; i++) /* loop only while i<m */
  ------------------
  |  Branch (212:21): [True: 79.7k, False: 21.8k]
  ------------------
  213|  79.7k|            b[i] = a[i] + MUL_C(a[m], a[m-i]);
  ------------------
  |  |  285|  79.7k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  214|       |
  215|   101k|        for (i = 1; i < m; i++) /* loop only while i<m */
  ------------------
  |  Branch (215:21): [True: 79.7k, False: 21.8k]
  ------------------
  216|  79.7k|            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|  21.8k|    }
  241|  5.37k|    return exp;
  242|  5.37k|}
tns.c:tns_ar_filter:
  246|    256|{
  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|    256|    uint8_t j;
  257|    256|    uint16_t i;
  258|       |    /* state is stored as a double ringbuffer */
  259|    256|    real_t state[2*TNS_MAX_ORDER] = {0};
  260|    256|    int8_t state_index = 0;
  261|    256|    int32_t mul = 1;
  262|       |
  263|       |#ifdef FIXED_POINT
  264|       |    if (exp >= 4)
  265|       |        return;
  266|       |    mul = 1 << exp;
  267|       |#else
  268|    256|    (void)exp;
  269|    256|#endif
  270|       |
  271|  22.3k|    for (i = 0; i < size; i++)
  ------------------
  |  Branch (271:17): [True: 22.1k, False: 256]
  ------------------
  272|  22.1k|    {
  273|  22.1k|        real_t y = REAL_CONST(0.0);
  ------------------
  |  |  288|  22.1k|  #define REAL_CONST(A) ((real_t)(A))
  ------------------
  274|   309k|        for (j = 0; j < order; j++)
  ------------------
  |  Branch (274:21): [True: 287k, False: 22.1k]
  ------------------
  275|   287k|            y += MUL_C(state[state_index+j], lpc[j+1]);
  ------------------
  |  |  285|   287k|  #define MUL_C(A,B) ((A)*(B))
  ------------------
  276|  22.1k|        y = *spectrum - (y * mul);
  277|       |
  278|       |        /* double ringbuffer state */
  279|  22.1k|        state_index--;
  280|  22.1k|        if (state_index < 0)
  ------------------
  |  Branch (280:13): [True: 3.83k, False: 18.2k]
  ------------------
  281|  3.83k|            state_index = order-1;
  282|  22.1k|        state[state_index] = state[state_index + order] = y;
  283|       |
  284|  22.1k|        *spectrum = y;
  285|  22.1k|        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|  22.1k|    }
  293|    256|}

